/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
/******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js":
/*!*****************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/arrays.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"tail\": () => (/* binding */ tail),\n/* harmony export */   \"tail2\": () => (/* binding */ tail2),\n/* harmony export */   \"equals\": () => (/* binding */ equals),\n/* harmony export */   \"binarySearch\": () => (/* binding */ binarySearch),\n/* harmony export */   \"findFirstInSorted\": () => (/* binding */ findFirstInSorted),\n/* harmony export */   \"quickSelect\": () => (/* binding */ quickSelect),\n/* harmony export */   \"mergeSort\": () => (/* binding */ mergeSort),\n/* harmony export */   \"groupBy\": () => (/* binding */ groupBy),\n/* harmony export */   \"coalesce\": () => (/* binding */ coalesce),\n/* harmony export */   \"isFalsyOrEmpty\": () => (/* binding */ isFalsyOrEmpty),\n/* harmony export */   \"isNonEmptyArray\": () => (/* binding */ isNonEmptyArray),\n/* harmony export */   \"distinct\": () => (/* binding */ distinct),\n/* harmony export */   \"distinctES6\": () => (/* binding */ distinctES6),\n/* harmony export */   \"firstOrDefault\": () => (/* binding */ firstOrDefault),\n/* harmony export */   \"flatten\": () => (/* binding */ flatten),\n/* harmony export */   \"range\": () => (/* binding */ range),\n/* harmony export */   \"arrayInsert\": () => (/* binding */ arrayInsert),\n/* harmony export */   \"pushToStart\": () => (/* binding */ pushToStart),\n/* harmony export */   \"pushToEnd\": () => (/* binding */ pushToEnd),\n/* harmony export */   \"asArray\": () => (/* binding */ asArray)\n/* harmony export */ });\n/**\r\n * Returns the last element of an array.\r\n * @param array The array.\r\n * @param n Which element from the end (default is zero).\r\n */\r\nfunction tail(array, n = 0) {\r\n    return array[array.length - (1 + n)];\r\n}\r\nfunction tail2(arr) {\r\n    if (arr.length === 0) {\r\n        throw new Error('Invalid tail call');\r\n    }\r\n    return [arr.slice(0, arr.length - 1), arr[arr.length - 1]];\r\n}\r\nfunction equals(one, other, itemEquals = (a, b) => a === b) {\r\n    if (one === other) {\r\n        return true;\r\n    }\r\n    if (!one || !other) {\r\n        return false;\r\n    }\r\n    if (one.length !== other.length) {\r\n        return false;\r\n    }\r\n    for (let i = 0, len = one.length; i < len; i++) {\r\n        if (!itemEquals(one[i], other[i])) {\r\n            return false;\r\n        }\r\n    }\r\n    return true;\r\n}\r\nfunction binarySearch(array, key, comparator) {\r\n    let low = 0, high = array.length - 1;\r\n    while (low <= high) {\r\n        const mid = ((low + high) / 2) | 0;\r\n        const comp = comparator(array[mid], key);\r\n        if (comp < 0) {\r\n            low = mid + 1;\r\n        }\r\n        else if (comp > 0) {\r\n            high = mid - 1;\r\n        }\r\n        else {\r\n            return mid;\r\n        }\r\n    }\r\n    return -(low + 1);\r\n}\r\n/**\r\n * Takes a sorted array and a function p. The array is sorted in such a way that all elements where p(x) is false\r\n * are located before all elements where p(x) is true.\r\n * @returns the least x for which p(x) is true or array.length if no element fullfills the given function.\r\n */\r\nfunction findFirstInSorted(array, p) {\r\n    let low = 0, high = array.length;\r\n    if (high === 0) {\r\n        return 0; // no children\r\n    }\r\n    while (low < high) {\r\n        const mid = Math.floor((low + high) / 2);\r\n        if (p(array[mid])) {\r\n            high = mid;\r\n        }\r\n        else {\r\n            low = mid + 1;\r\n        }\r\n    }\r\n    return low;\r\n}\r\nfunction quickSelect(nth, data, compare) {\r\n    nth = nth | 0;\r\n    if (nth >= data.length) {\r\n        throw new TypeError('invalid index');\r\n    }\r\n    let pivotValue = data[Math.floor(data.length * Math.random())];\r\n    let lower = [];\r\n    let higher = [];\r\n    let pivots = [];\r\n    for (let value of data) {\r\n        const val = compare(value, pivotValue);\r\n        if (val < 0) {\r\n            lower.push(value);\r\n        }\r\n        else if (val > 0) {\r\n            higher.push(value);\r\n        }\r\n        else {\r\n            pivots.push(value);\r\n        }\r\n    }\r\n    if (nth < lower.length) {\r\n        return quickSelect(nth, lower, compare);\r\n    }\r\n    else if (nth < lower.length + pivots.length) {\r\n        return pivots[0];\r\n    }\r\n    else {\r\n        return quickSelect(nth - (lower.length + pivots.length), higher, compare);\r\n    }\r\n}\r\n/**\r\n * Like `Array#sort` but always stable. Usually runs a little slower `than Array#sort`\r\n * so only use this when actually needing stable sort.\r\n */\r\nfunction mergeSort(data, compare) {\r\n    _sort(data, compare, 0, data.length - 1, []);\r\n    return data;\r\n}\r\nfunction _merge(a, compare, lo, mid, hi, aux) {\r\n    let leftIdx = lo, rightIdx = mid + 1;\r\n    for (let i = lo; i <= hi; i++) {\r\n        aux[i] = a[i];\r\n    }\r\n    for (let i = lo; i <= hi; i++) {\r\n        if (leftIdx > mid) {\r\n            // left side consumed\r\n            a[i] = aux[rightIdx++];\r\n        }\r\n        else if (rightIdx > hi) {\r\n            // right side consumed\r\n            a[i] = aux[leftIdx++];\r\n        }\r\n        else if (compare(aux[rightIdx], aux[leftIdx]) < 0) {\r\n            // right element is less -> comes first\r\n            a[i] = aux[rightIdx++];\r\n        }\r\n        else {\r\n            // left element comes first (less or equal)\r\n            a[i] = aux[leftIdx++];\r\n        }\r\n    }\r\n}\r\nfunction _sort(a, compare, lo, hi, aux) {\r\n    if (hi <= lo) {\r\n        return;\r\n    }\r\n    const mid = lo + ((hi - lo) / 2) | 0;\r\n    _sort(a, compare, lo, mid, aux);\r\n    _sort(a, compare, mid + 1, hi, aux);\r\n    if (compare(a[mid], a[mid + 1]) <= 0) {\r\n        // left and right are sorted and if the last-left element is less\r\n        // or equals than the first-right element there is nothing else\r\n        // to do\r\n        return;\r\n    }\r\n    _merge(a, compare, lo, mid, hi, aux);\r\n}\r\nfunction groupBy(data, compare) {\r\n    const result = [];\r\n    let currentGroup = undefined;\r\n    for (const element of mergeSort(data.slice(0), compare)) {\r\n        if (!currentGroup || compare(currentGroup[0], element) !== 0) {\r\n            currentGroup = [element];\r\n            result.push(currentGroup);\r\n        }\r\n        else {\r\n            currentGroup.push(element);\r\n        }\r\n    }\r\n    return result;\r\n}\r\n/**\r\n * @returns New array with all falsy values removed. The original array IS NOT modified.\r\n */\r\nfunction coalesce(array) {\r\n    return array.filter(e => !!e);\r\n}\r\n/**\r\n * @returns false if the provided object is an array and not empty.\r\n */\r\nfunction isFalsyOrEmpty(obj) {\r\n    return !Array.isArray(obj) || obj.length === 0;\r\n}\r\nfunction isNonEmptyArray(obj) {\r\n    return Array.isArray(obj) && obj.length > 0;\r\n}\r\n/**\r\n * Removes duplicates from the given array. The optional keyFn allows to specify\r\n * how elements are checked for equalness by returning a unique string for each.\r\n */\r\nfunction distinct(array, keyFn) {\r\n    if (!keyFn) {\r\n        return array.filter((element, position) => {\r\n            return array.indexOf(element) === position;\r\n        });\r\n    }\r\n    const seen = Object.create(null);\r\n    return array.filter((elem) => {\r\n        const key = keyFn(elem);\r\n        if (seen[key]) {\r\n            return false;\r\n        }\r\n        seen[key] = true;\r\n        return true;\r\n    });\r\n}\r\nfunction distinctES6(array) {\r\n    const seen = new Set();\r\n    return array.filter(element => {\r\n        if (seen.has(element)) {\r\n            return false;\r\n        }\r\n        seen.add(element);\r\n        return true;\r\n    });\r\n}\r\nfunction firstOrDefault(array, notFoundValue) {\r\n    return array.length > 0 ? array[0] : notFoundValue;\r\n}\r\nfunction flatten(arr) {\r\n    return [].concat(...arr);\r\n}\r\nfunction range(arg, to) {\r\n    let from = typeof to === 'number' ? arg : 0;\r\n    if (typeof to === 'number') {\r\n        from = arg;\r\n    }\r\n    else {\r\n        from = 0;\r\n        to = arg;\r\n    }\r\n    const result = [];\r\n    if (from <= to) {\r\n        for (let i = from; i < to; i++) {\r\n            result.push(i);\r\n        }\r\n    }\r\n    else {\r\n        for (let i = from; i > to; i--) {\r\n            result.push(i);\r\n        }\r\n    }\r\n    return result;\r\n}\r\n/**\r\n * Insert `insertArr` inside `target` at `insertIndex`.\r\n * Please don't touch unless you understand https://jsperf.com/inserting-an-array-within-an-array\r\n */\r\nfunction arrayInsert(target, insertIndex, insertArr) {\r\n    const before = target.slice(0, insertIndex);\r\n    const after = target.slice(insertIndex);\r\n    return before.concat(insertArr, after);\r\n}\r\n/**\r\n * Pushes an element to the start of the array, if found.\r\n */\r\nfunction pushToStart(arr, value) {\r\n    const index = arr.indexOf(value);\r\n    if (index > -1) {\r\n        arr.splice(index, 1);\r\n        arr.unshift(value);\r\n    }\r\n}\r\n/**\r\n * Pushes an element to the end of the array, if found.\r\n */\r\nfunction pushToEnd(arr, value) {\r\n    const index = arr.indexOf(value);\r\n    if (index > -1) {\r\n        arr.splice(index, 1);\r\n        arr.push(value);\r\n    }\r\n}\r\nfunction asArray(x) {\r\n    return Array.isArray(x) ? x : [x];\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/arrays.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js":
/*!***********************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/cancellation.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"CancellationToken\": () => (/* binding */ CancellationToken),\n/* harmony export */   \"CancellationTokenSource\": () => (/* binding */ CancellationTokenSource)\n/* harmony export */ });\n/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event.js */ \"./node_modules/monaco-editor/esm/vs/base/common/event.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nconst shortcutEvent = Object.freeze(function (callback, context) {\r\n    const handle = setTimeout(callback.bind(context), 0);\r\n    return { dispose() { clearTimeout(handle); } };\r\n});\r\nvar CancellationToken;\r\n(function (CancellationToken) {\r\n    function isCancellationToken(thing) {\r\n        if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) {\r\n            return true;\r\n        }\r\n        if (thing instanceof MutableToken) {\r\n            return true;\r\n        }\r\n        if (!thing || typeof thing !== 'object') {\r\n            return false;\r\n        }\r\n        return typeof thing.isCancellationRequested === 'boolean'\r\n            && typeof thing.onCancellationRequested === 'function';\r\n    }\r\n    CancellationToken.isCancellationToken = isCancellationToken;\r\n    CancellationToken.None = Object.freeze({\r\n        isCancellationRequested: false,\r\n        onCancellationRequested: _event_js__WEBPACK_IMPORTED_MODULE_0__.Event.None\r\n    });\r\n    CancellationToken.Cancelled = Object.freeze({\r\n        isCancellationRequested: true,\r\n        onCancellationRequested: shortcutEvent\r\n    });\r\n})(CancellationToken || (CancellationToken = {}));\r\nclass MutableToken {\r\n    constructor() {\r\n        this._isCancelled = false;\r\n        this._emitter = null;\r\n    }\r\n    cancel() {\r\n        if (!this._isCancelled) {\r\n            this._isCancelled = true;\r\n            if (this._emitter) {\r\n                this._emitter.fire(undefined);\r\n                this.dispose();\r\n            }\r\n        }\r\n    }\r\n    get isCancellationRequested() {\r\n        return this._isCancelled;\r\n    }\r\n    get onCancellationRequested() {\r\n        if (this._isCancelled) {\r\n            return shortcutEvent;\r\n        }\r\n        if (!this._emitter) {\r\n            this._emitter = new _event_js__WEBPACK_IMPORTED_MODULE_0__.Emitter();\r\n        }\r\n        return this._emitter.event;\r\n    }\r\n    dispose() {\r\n        if (this._emitter) {\r\n            this._emitter.dispose();\r\n            this._emitter = null;\r\n        }\r\n    }\r\n}\r\nclass CancellationTokenSource {\r\n    constructor(parent) {\r\n        this._token = undefined;\r\n        this._parentListener = undefined;\r\n        this._parentListener = parent && parent.onCancellationRequested(this.cancel, this);\r\n    }\r\n    get token() {\r\n        if (!this._token) {\r\n            // be lazy and create the token only when\r\n            // actually needed\r\n            this._token = new MutableToken();\r\n        }\r\n        return this._token;\r\n    }\r\n    cancel() {\r\n        if (!this._token) {\r\n            // save an object by returning the default\r\n            // cancelled token when cancellation happens\r\n            // before someone asks for the token\r\n            this._token = CancellationToken.Cancelled;\r\n        }\r\n        else if (this._token instanceof MutableToken) {\r\n            // actually cancel\r\n            this._token.cancel();\r\n        }\r\n    }\r\n    dispose(cancel = false) {\r\n        if (cancel) {\r\n            this.cancel();\r\n        }\r\n        if (this._parentListener) {\r\n            this._parentListener.dispose();\r\n        }\r\n        if (!this._token) {\r\n            // ensure to initialize with an empty token if we had none\r\n            this._token = CancellationToken.None;\r\n        }\r\n        else if (this._token instanceof MutableToken) {\r\n            // actually dispose\r\n            this._token.dispose();\r\n        }\r\n    }\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/cancellation.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js":
/*!********************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"StringDiffSequence\": () => (/* binding */ StringDiffSequence),\n/* harmony export */   \"stringDiff\": () => (/* binding */ stringDiff),\n/* harmony export */   \"Debug\": () => (/* binding */ Debug),\n/* harmony export */   \"MyArray\": () => (/* binding */ MyArray),\n/* harmony export */   \"LcsDiff\": () => (/* binding */ LcsDiff)\n/* harmony export */ });\n/* harmony import */ var _diffChange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diffChange.js */ \"./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js\");\n/* harmony import */ var _hash_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../hash.js */ \"./node_modules/monaco-editor/esm/vs/base/common/hash.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n\r\nclass StringDiffSequence {\r\n    constructor(source) {\r\n        this.source = source;\r\n    }\r\n    getElements() {\r\n        const source = this.source;\r\n        const characters = new Int32Array(source.length);\r\n        for (let i = 0, len = source.length; i < len; i++) {\r\n            characters[i] = source.charCodeAt(i);\r\n        }\r\n        return characters;\r\n    }\r\n}\r\nfunction stringDiff(original, modified, pretty) {\r\n    return new LcsDiff(new StringDiffSequence(original), new StringDiffSequence(modified)).ComputeDiff(pretty).changes;\r\n}\r\n//\r\n// The code below has been ported from a C# implementation in VS\r\n//\r\nclass Debug {\r\n    static Assert(condition, message) {\r\n        if (!condition) {\r\n            throw new Error(message);\r\n        }\r\n    }\r\n}\r\nclass MyArray {\r\n    /**\r\n     * Copies a range of elements from an Array starting at the specified source index and pastes\r\n     * them to another Array starting at the specified destination index. The length and the indexes\r\n     * are specified as 64-bit integers.\r\n     * sourceArray:\r\n     *\t\tThe Array that contains the data to copy.\r\n     * sourceIndex:\r\n     *\t\tA 64-bit integer that represents the index in the sourceArray at which copying begins.\r\n     * destinationArray:\r\n     *\t\tThe Array that receives the data.\r\n     * destinationIndex:\r\n     *\t\tA 64-bit integer that represents the index in the destinationArray at which storing begins.\r\n     * length:\r\n     *\t\tA 64-bit integer that represents the number of elements to copy.\r\n     */\r\n    static Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length) {\r\n        for (let i = 0; i < length; i++) {\r\n            destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];\r\n        }\r\n    }\r\n    static Copy2(sourceArray, sourceIndex, destinationArray, destinationIndex, length) {\r\n        for (let i = 0; i < length; i++) {\r\n            destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];\r\n        }\r\n    }\r\n}\r\n/**\r\n * A utility class which helps to create the set of DiffChanges from\r\n * a difference operation. This class accepts original DiffElements and\r\n * modified DiffElements that are involved in a particular change. The\r\n * MarktNextChange() method can be called to mark the separation between\r\n * distinct changes. At the end, the Changes property can be called to retrieve\r\n * the constructed changes.\r\n */\r\nclass DiffChangeHelper {\r\n    /**\r\n     * Constructs a new DiffChangeHelper for the given DiffSequences.\r\n     */\r\n    constructor() {\r\n        this.m_changes = [];\r\n        this.m_originalStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */;\r\n        this.m_modifiedStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */;\r\n        this.m_originalCount = 0;\r\n        this.m_modifiedCount = 0;\r\n    }\r\n    /**\r\n     * Marks the beginning of the next change in the set of differences.\r\n     */\r\n    MarkNextChange() {\r\n        // Only add to the list if there is something to add\r\n        if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\r\n            // Add the new change to our list\r\n            this.m_changes.push(new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__.DiffChange(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount));\r\n        }\r\n        // Reset for the next change\r\n        this.m_originalCount = 0;\r\n        this.m_modifiedCount = 0;\r\n        this.m_originalStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */;\r\n        this.m_modifiedStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */;\r\n    }\r\n    /**\r\n     * Adds the original element at the given position to the elements\r\n     * affected by the current change. The modified index gives context\r\n     * to the change position with respect to the original sequence.\r\n     * @param originalIndex The index of the original element to add.\r\n     * @param modifiedIndex The index of the modified element that provides corresponding position in the modified sequence.\r\n     */\r\n    AddOriginalElement(originalIndex, modifiedIndex) {\r\n        // The 'true' start index is the smallest of the ones we've seen\r\n        this.m_originalStart = Math.min(this.m_originalStart, originalIndex);\r\n        this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);\r\n        this.m_originalCount++;\r\n    }\r\n    /**\r\n     * Adds the modified element at the given position to the elements\r\n     * affected by the current change. The original index gives context\r\n     * to the change position with respect to the modified sequence.\r\n     * @param originalIndex The index of the original element that provides corresponding position in the original sequence.\r\n     * @param modifiedIndex The index of the modified element to add.\r\n     */\r\n    AddModifiedElement(originalIndex, modifiedIndex) {\r\n        // The 'true' start index is the smallest of the ones we've seen\r\n        this.m_originalStart = Math.min(this.m_originalStart, originalIndex);\r\n        this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);\r\n        this.m_modifiedCount++;\r\n    }\r\n    /**\r\n     * Retrieves all of the changes marked by the class.\r\n     */\r\n    getChanges() {\r\n        if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\r\n            // Finish up on whatever is left\r\n            this.MarkNextChange();\r\n        }\r\n        return this.m_changes;\r\n    }\r\n    /**\r\n     * Retrieves all of the changes marked by the class in the reverse order\r\n     */\r\n    getReverseChanges() {\r\n        if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\r\n            // Finish up on whatever is left\r\n            this.MarkNextChange();\r\n        }\r\n        this.m_changes.reverse();\r\n        return this.m_changes;\r\n    }\r\n}\r\n/**\r\n * An implementation of the difference algorithm described in\r\n * \"An O(ND) Difference Algorithm and its variations\" by Eugene W. Myers\r\n */\r\nclass LcsDiff {\r\n    /**\r\n     * Constructs the DiffFinder\r\n     */\r\n    constructor(originalSequence, modifiedSequence, continueProcessingPredicate = null) {\r\n        this.ContinueProcessingPredicate = continueProcessingPredicate;\r\n        const [originalStringElements, originalElementsOrHash, originalHasStrings] = LcsDiff._getElements(originalSequence);\r\n        const [modifiedStringElements, modifiedElementsOrHash, modifiedHasStrings] = LcsDiff._getElements(modifiedSequence);\r\n        this._hasStrings = (originalHasStrings && modifiedHasStrings);\r\n        this._originalStringElements = originalStringElements;\r\n        this._originalElementsOrHash = originalElementsOrHash;\r\n        this._modifiedStringElements = modifiedStringElements;\r\n        this._modifiedElementsOrHash = modifiedElementsOrHash;\r\n        this.m_forwardHistory = [];\r\n        this.m_reverseHistory = [];\r\n    }\r\n    static _isStringArray(arr) {\r\n        return (arr.length > 0 && typeof arr[0] === 'string');\r\n    }\r\n    static _getElements(sequence) {\r\n        const elements = sequence.getElements();\r\n        if (LcsDiff._isStringArray(elements)) {\r\n            const hashes = new Int32Array(elements.length);\r\n            for (let i = 0, len = elements.length; i < len; i++) {\r\n                hashes[i] = (0,_hash_js__WEBPACK_IMPORTED_MODULE_1__.stringHash)(elements[i], 0);\r\n            }\r\n            return [elements, hashes, true];\r\n        }\r\n        if (elements instanceof Int32Array) {\r\n            return [[], elements, false];\r\n        }\r\n        return [[], new Int32Array(elements), false];\r\n    }\r\n    ElementsAreEqual(originalIndex, newIndex) {\r\n        if (this._originalElementsOrHash[originalIndex] !== this._modifiedElementsOrHash[newIndex]) {\r\n            return false;\r\n        }\r\n        return (this._hasStrings ? this._originalStringElements[originalIndex] === this._modifiedStringElements[newIndex] : true);\r\n    }\r\n    OriginalElementsAreEqual(index1, index2) {\r\n        if (this._originalElementsOrHash[index1] !== this._originalElementsOrHash[index2]) {\r\n            return false;\r\n        }\r\n        return (this._hasStrings ? this._originalStringElements[index1] === this._originalStringElements[index2] : true);\r\n    }\r\n    ModifiedElementsAreEqual(index1, index2) {\r\n        if (this._modifiedElementsOrHash[index1] !== this._modifiedElementsOrHash[index2]) {\r\n            return false;\r\n        }\r\n        return (this._hasStrings ? this._modifiedStringElements[index1] === this._modifiedStringElements[index2] : true);\r\n    }\r\n    ComputeDiff(pretty) {\r\n        return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, pretty);\r\n    }\r\n    /**\r\n     * Computes the differences between the original and modified input\r\n     * sequences on the bounded range.\r\n     * @returns An array of the differences between the two input sequences.\r\n     */\r\n    _ComputeDiff(originalStart, originalEnd, modifiedStart, modifiedEnd, pretty) {\r\n        const quitEarlyArr = [false];\r\n        let changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr);\r\n        if (pretty) {\r\n            // We have to clean up the computed diff to be more intuitive\r\n            // but it turns out this cannot be done correctly until the entire set\r\n            // of diffs have been computed\r\n            changes = this.PrettifyChanges(changes);\r\n        }\r\n        return {\r\n            quitEarly: quitEarlyArr[0],\r\n            changes: changes\r\n        };\r\n    }\r\n    /**\r\n     * Private helper method which computes the differences on the bounded range\r\n     * recursively.\r\n     * @returns An array of the differences between the two input sequences.\r\n     */\r\n    ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr) {\r\n        quitEarlyArr[0] = false;\r\n        // Find the start of the differences\r\n        while (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) {\r\n            originalStart++;\r\n            modifiedStart++;\r\n        }\r\n        // Find the end of the differences\r\n        while (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) {\r\n            originalEnd--;\r\n            modifiedEnd--;\r\n        }\r\n        // In the special case where we either have all insertions or all deletions or the sequences are identical\r\n        if (originalStart > originalEnd || modifiedStart > modifiedEnd) {\r\n            let changes;\r\n            if (modifiedStart <= modifiedEnd) {\r\n                Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd');\r\n                // All insertions\r\n                changes = [\r\n                    new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__.DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1)\r\n                ];\r\n            }\r\n            else if (originalStart <= originalEnd) {\r\n                Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd');\r\n                // All deletions\r\n                changes = [\r\n                    new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__.DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0)\r\n                ];\r\n            }\r\n            else {\r\n                Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd');\r\n                Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd');\r\n                // Identical sequences - No differences\r\n                changes = [];\r\n            }\r\n            return changes;\r\n        }\r\n        // This problem can be solved using the Divide-And-Conquer technique.\r\n        const midOriginalArr = [0];\r\n        const midModifiedArr = [0];\r\n        const result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr);\r\n        const midOriginal = midOriginalArr[0];\r\n        const midModified = midModifiedArr[0];\r\n        if (result !== null) {\r\n            // Result is not-null when there was enough memory to compute the changes while\r\n            // searching for the recursion point\r\n            return result;\r\n        }\r\n        else if (!quitEarlyArr[0]) {\r\n            // We can break the problem down recursively by finding the changes in the\r\n            // First Half:   (originalStart, modifiedStart) to (midOriginal, midModified)\r\n            // Second Half:  (midOriginal + 1, minModified + 1) to (originalEnd, modifiedEnd)\r\n            // NOTE: ComputeDiff() is inclusive, therefore the second range starts on the next point\r\n            const leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr);\r\n            let rightChanges = [];\r\n            if (!quitEarlyArr[0]) {\r\n                rightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr);\r\n            }\r\n            else {\r\n                // We did't have time to finish the first half, so we don't have time to compute this half.\r\n                // Consider the entire rest of the sequence different.\r\n                rightChanges = [\r\n                    new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__.DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1)\r\n                ];\r\n            }\r\n            return this.ConcatenateChanges(leftChanges, rightChanges);\r\n        }\r\n        // If we hit here, we quit early, and so can't return anything meaningful\r\n        return [\r\n            new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__.DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)\r\n        ];\r\n    }\r\n    WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) {\r\n        let forwardChanges = null;\r\n        let reverseChanges = null;\r\n        // First, walk backward through the forward diagonals history\r\n        let changeHelper = new DiffChangeHelper();\r\n        let diagonalMin = diagonalForwardStart;\r\n        let diagonalMax = diagonalForwardEnd;\r\n        let diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalForwardOffset;\r\n        let lastOriginalIndex = -1073741824 /* MIN_SAFE_SMALL_INTEGER */;\r\n        let historyIndex = this.m_forwardHistory.length - 1;\r\n        do {\r\n            // Get the diagonal index from the relative diagonal number\r\n            const diagonal = diagonalRelative + diagonalForwardBase;\r\n            // Figure out where we came from\r\n            if (diagonal === diagonalMin || (diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) {\r\n                // Vertical line (the element is an insert)\r\n                originalIndex = forwardPoints[diagonal + 1];\r\n                modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;\r\n                if (originalIndex < lastOriginalIndex) {\r\n                    changeHelper.MarkNextChange();\r\n                }\r\n                lastOriginalIndex = originalIndex;\r\n                changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex);\r\n                diagonalRelative = (diagonal + 1) - diagonalForwardBase; //Setup for the next iteration\r\n            }\r\n            else {\r\n                // Horizontal line (the element is a deletion)\r\n                originalIndex = forwardPoints[diagonal - 1] + 1;\r\n                modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;\r\n                if (originalIndex < lastOriginalIndex) {\r\n                    changeHelper.MarkNextChange();\r\n                }\r\n                lastOriginalIndex = originalIndex - 1;\r\n                changeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1);\r\n                diagonalRelative = (diagonal - 1) - diagonalForwardBase; //Setup for the next iteration\r\n            }\r\n            if (historyIndex >= 0) {\r\n                forwardPoints = this.m_forwardHistory[historyIndex];\r\n                diagonalForwardBase = forwardPoints[0]; //We stored this in the first spot\r\n                diagonalMin = 1;\r\n                diagonalMax = forwardPoints.length - 1;\r\n            }\r\n        } while (--historyIndex >= -1);\r\n        // Ironically, we get the forward changes as the reverse of the\r\n        // order we added them since we technically added them backwards\r\n        forwardChanges = changeHelper.getReverseChanges();\r\n        if (quitEarlyArr[0]) {\r\n            // TODO: Calculate a partial from the reverse diagonals.\r\n            //       For now, just assume everything after the midOriginal/midModified point is a diff\r\n            let originalStartPoint = midOriginalArr[0] + 1;\r\n            let modifiedStartPoint = midModifiedArr[0] + 1;\r\n            if (forwardChanges !== null && forwardChanges.length > 0) {\r\n                const lastForwardChange = forwardChanges[forwardChanges.length - 1];\r\n                originalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd());\r\n                modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd());\r\n            }\r\n            reverseChanges = [\r\n                new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__.DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1)\r\n            ];\r\n        }\r\n        else {\r\n            // Now walk backward through the reverse diagonals history\r\n            changeHelper = new DiffChangeHelper();\r\n            diagonalMin = diagonalReverseStart;\r\n            diagonalMax = diagonalReverseEnd;\r\n            diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset;\r\n            lastOriginalIndex = 1073741824 /* MAX_SAFE_SMALL_INTEGER */;\r\n            historyIndex = (deltaIsEven) ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2;\r\n            do {\r\n                // Get the diagonal index from the relative diagonal number\r\n                const diagonal = diagonalRelative + diagonalReverseBase;\r\n                // Figure out where we came from\r\n                if (diagonal === diagonalMin || (diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) {\r\n                    // Horizontal line (the element is a deletion))\r\n                    originalIndex = reversePoints[diagonal + 1] - 1;\r\n                    modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;\r\n                    if (originalIndex > lastOriginalIndex) {\r\n                        changeHelper.MarkNextChange();\r\n                    }\r\n                    lastOriginalIndex = originalIndex + 1;\r\n                    changeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1);\r\n                    diagonalRelative = (diagonal + 1) - diagonalReverseBase; //Setup for the next iteration\r\n                }\r\n                else {\r\n                    // Vertical line (the element is an insertion)\r\n                    originalIndex = reversePoints[diagonal - 1];\r\n                    modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;\r\n                    if (originalIndex > lastOriginalIndex) {\r\n                        changeHelper.MarkNextChange();\r\n                    }\r\n                    lastOriginalIndex = originalIndex;\r\n                    changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1);\r\n                    diagonalRelative = (diagonal - 1) - diagonalReverseBase; //Setup for the next iteration\r\n                }\r\n                if (historyIndex >= 0) {\r\n                    reversePoints = this.m_reverseHistory[historyIndex];\r\n                    diagonalReverseBase = reversePoints[0]; //We stored this in the first spot\r\n                    diagonalMin = 1;\r\n                    diagonalMax = reversePoints.length - 1;\r\n                }\r\n            } while (--historyIndex >= -1);\r\n            // There are cases where the reverse history will find diffs that\r\n            // are correct, but not intuitive, so we need shift them.\r\n            reverseChanges = changeHelper.getChanges();\r\n        }\r\n        return this.ConcatenateChanges(forwardChanges, reverseChanges);\r\n    }\r\n    /**\r\n     * Given the range to compute the diff on, this method finds the point:\r\n     * (midOriginal, midModified)\r\n     * that exists in the middle of the LCS of the two sequences and\r\n     * is the point at which the LCS problem may be broken down recursively.\r\n     * This method will try to keep the LCS trace in memory. If the LCS recursion\r\n     * point is calculated and the full trace is available in memory, then this method\r\n     * will return the change list.\r\n     * @param originalStart The start bound of the original sequence range\r\n     * @param originalEnd The end bound of the original sequence range\r\n     * @param modifiedStart The start bound of the modified sequence range\r\n     * @param modifiedEnd The end bound of the modified sequence range\r\n     * @param midOriginal The middle point of the original sequence range\r\n     * @param midModified The middle point of the modified sequence range\r\n     * @returns The diff changes, if available, otherwise null\r\n     */\r\n    ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr) {\r\n        let originalIndex = 0, modifiedIndex = 0;\r\n        let diagonalForwardStart = 0, diagonalForwardEnd = 0;\r\n        let diagonalReverseStart = 0, diagonalReverseEnd = 0;\r\n        // To traverse the edit graph and produce the proper LCS, our actual\r\n        // start position is just outside the given boundary\r\n        originalStart--;\r\n        modifiedStart--;\r\n        // We set these up to make the compiler happy, but they will\r\n        // be replaced before we return with the actual recursion point\r\n        midOriginalArr[0] = 0;\r\n        midModifiedArr[0] = 0;\r\n        // Clear out the history\r\n        this.m_forwardHistory = [];\r\n        this.m_reverseHistory = [];\r\n        // Each cell in the two arrays corresponds to a diagonal in the edit graph.\r\n        // The integer value in the cell represents the originalIndex of the furthest\r\n        // reaching point found so far that ends in that diagonal.\r\n        // The modifiedIndex can be computed mathematically from the originalIndex and the diagonal number.\r\n        const maxDifferences = (originalEnd - originalStart) + (modifiedEnd - modifiedStart);\r\n        const numDiagonals = maxDifferences + 1;\r\n        const forwardPoints = new Int32Array(numDiagonals);\r\n        const reversePoints = new Int32Array(numDiagonals);\r\n        // diagonalForwardBase: Index into forwardPoints of the diagonal which passes through (originalStart, modifiedStart)\r\n        // diagonalReverseBase: Index into reversePoints of the diagonal which passes through (originalEnd, modifiedEnd)\r\n        const diagonalForwardBase = (modifiedEnd - modifiedStart);\r\n        const diagonalReverseBase = (originalEnd - originalStart);\r\n        // diagonalForwardOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the\r\n        //    diagonal number (relative to diagonalForwardBase)\r\n        // diagonalReverseOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the\r\n        //    diagonal number (relative to diagonalReverseBase)\r\n        const diagonalForwardOffset = (originalStart - modifiedStart);\r\n        const diagonalReverseOffset = (originalEnd - modifiedEnd);\r\n        // delta: The difference between the end diagonal and the start diagonal. This is used to relate diagonal numbers\r\n        //   relative to the start diagonal with diagonal numbers relative to the end diagonal.\r\n        // The Even/Oddn-ness of this delta is important for determining when we should check for overlap\r\n        const delta = diagonalReverseBase - diagonalForwardBase;\r\n        const deltaIsEven = (delta % 2 === 0);\r\n        // Here we set up the start and end points as the furthest points found so far\r\n        // in both the forward and reverse directions, respectively\r\n        forwardPoints[diagonalForwardBase] = originalStart;\r\n        reversePoints[diagonalReverseBase] = originalEnd;\r\n        // Remember if we quit early, and thus need to do a best-effort result instead of a real result.\r\n        quitEarlyArr[0] = false;\r\n        // A couple of points:\r\n        // --With this method, we iterate on the number of differences between the two sequences.\r\n        //   The more differences there actually are, the longer this will take.\r\n        // --Also, as the number of differences increases, we have to search on diagonals further\r\n        //   away from the reference diagonal (which is diagonalForwardBase for forward, diagonalReverseBase for reverse).\r\n        // --We extend on even diagonals (relative to the reference diagonal) only when numDifferences\r\n        //   is even and odd diagonals only when numDifferences is odd.\r\n        for (let numDifferences = 1; numDifferences <= (maxDifferences / 2) + 1; numDifferences++) {\r\n            let furthestOriginalIndex = 0;\r\n            let furthestModifiedIndex = 0;\r\n            // Run the algorithm in the forward direction\r\n            diagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals);\r\n            diagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals);\r\n            for (let diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) {\r\n                // STEP 1: We extend the furthest reaching point in the present diagonal\r\n                // by looking at the diagonals above and below and picking the one whose point\r\n                // is further away from the start point (originalStart, modifiedStart)\r\n                if (diagonal === diagonalForwardStart || (diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) {\r\n                    originalIndex = forwardPoints[diagonal + 1];\r\n                }\r\n                else {\r\n                    originalIndex = forwardPoints[diagonal - 1] + 1;\r\n                }\r\n                modifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset;\r\n                // Save the current originalIndex so we can test for false overlap in step 3\r\n                const tempOriginalIndex = originalIndex;\r\n                // STEP 2: We can continue to extend the furthest reaching point in the present diagonal\r\n                // so long as the elements are equal.\r\n                while (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) {\r\n                    originalIndex++;\r\n                    modifiedIndex++;\r\n                }\r\n                forwardPoints[diagonal] = originalIndex;\r\n                if (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) {\r\n                    furthestOriginalIndex = originalIndex;\r\n                    furthestModifiedIndex = modifiedIndex;\r\n                }\r\n                // STEP 3: If delta is odd (overlap first happens on forward when delta is odd)\r\n                // and diagonal is in the range of reverse diagonals computed for numDifferences-1\r\n                // (the previous iteration; we haven't computed reverse diagonals for numDifferences yet)\r\n                // then check for overlap.\r\n                if (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= (numDifferences - 1)) {\r\n                    if (originalIndex >= reversePoints[diagonal]) {\r\n                        midOriginalArr[0] = originalIndex;\r\n                        midModifiedArr[0] = modifiedIndex;\r\n                        if (tempOriginalIndex <= reversePoints[diagonal] && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) {\r\n                            // BINGO! We overlapped, and we have the full trace in memory!\r\n                            return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);\r\n                        }\r\n                        else {\r\n                            // Either false overlap, or we didn't have enough memory for the full trace\r\n                            // Just return the recursion point\r\n                            return null;\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n            // Check to see if we should be quitting early, before moving on to the next iteration.\r\n            const matchLengthOfLongest = ((furthestOriginalIndex - originalStart) + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2;\r\n            if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) {\r\n                // We can't finish, so skip ahead to generating a result from what we have.\r\n                quitEarlyArr[0] = true;\r\n                // Use the furthest distance we got in the forward direction.\r\n                midOriginalArr[0] = furthestOriginalIndex;\r\n                midModifiedArr[0] = furthestModifiedIndex;\r\n                if (matchLengthOfLongest > 0 && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) {\r\n                    // Enough of the history is in memory to walk it backwards\r\n                    return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);\r\n                }\r\n                else {\r\n                    // We didn't actually remember enough of the history.\r\n                    //Since we are quiting the diff early, we need to shift back the originalStart and modified start\r\n                    //back into the boundary limits since we decremented their value above beyond the boundary limit.\r\n                    originalStart++;\r\n                    modifiedStart++;\r\n                    return [\r\n                        new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__.DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)\r\n                    ];\r\n                }\r\n            }\r\n            // Run the algorithm in the reverse direction\r\n            diagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals);\r\n            diagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals);\r\n            for (let diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) {\r\n                // STEP 1: We extend the furthest reaching point in the present diagonal\r\n                // by looking at the diagonals above and below and picking the one whose point\r\n                // is further away from the start point (originalEnd, modifiedEnd)\r\n                if (diagonal === diagonalReverseStart || (diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) {\r\n                    originalIndex = reversePoints[diagonal + 1] - 1;\r\n                }\r\n                else {\r\n                    originalIndex = reversePoints[diagonal - 1];\r\n                }\r\n                modifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset;\r\n                // Save the current originalIndex so we can test for false overlap\r\n                const tempOriginalIndex = originalIndex;\r\n                // STEP 2: We can continue to extend the furthest reaching point in the present diagonal\r\n                // as long as the elements are equal.\r\n                while (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) {\r\n                    originalIndex--;\r\n                    modifiedIndex--;\r\n                }\r\n                reversePoints[diagonal] = originalIndex;\r\n                // STEP 4: If delta is even (overlap first happens on reverse when delta is even)\r\n                // and diagonal is in the range of forward diagonals computed for numDifferences\r\n                // then check for overlap.\r\n                if (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) {\r\n                    if (originalIndex <= forwardPoints[diagonal]) {\r\n                        midOriginalArr[0] = originalIndex;\r\n                        midModifiedArr[0] = modifiedIndex;\r\n                        if (tempOriginalIndex >= forwardPoints[diagonal] && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) {\r\n                            // BINGO! We overlapped, and we have the full trace in memory!\r\n                            return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);\r\n                        }\r\n                        else {\r\n                            // Either false overlap, or we didn't have enough memory for the full trace\r\n                            // Just return the recursion point\r\n                            return null;\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n            // Save current vectors to history before the next iteration\r\n            if (numDifferences <= 1447 /* MaxDifferencesHistory */) {\r\n                // We are allocating space for one extra int, which we fill with\r\n                // the index of the diagonal base index\r\n                let temp = new Int32Array(diagonalForwardEnd - diagonalForwardStart + 2);\r\n                temp[0] = diagonalForwardBase - diagonalForwardStart + 1;\r\n                MyArray.Copy2(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1);\r\n                this.m_forwardHistory.push(temp);\r\n                temp = new Int32Array(diagonalReverseEnd - diagonalReverseStart + 2);\r\n                temp[0] = diagonalReverseBase - diagonalReverseStart + 1;\r\n                MyArray.Copy2(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1);\r\n                this.m_reverseHistory.push(temp);\r\n            }\r\n        }\r\n        // If we got here, then we have the full trace in history. We just have to convert it to a change list\r\n        // NOTE: This part is a bit messy\r\n        return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);\r\n    }\r\n    /**\r\n     * Shifts the given changes to provide a more intuitive diff.\r\n     * While the first element in a diff matches the first element after the diff,\r\n     * we shift the diff down.\r\n     *\r\n     * @param changes The list of changes to shift\r\n     * @returns The shifted changes\r\n     */\r\n    PrettifyChanges(changes) {\r\n        // Shift all the changes down first\r\n        for (let i = 0; i < changes.length; i++) {\r\n            const change = changes[i];\r\n            const originalStop = (i < changes.length - 1) ? changes[i + 1].originalStart : this._originalElementsOrHash.length;\r\n            const modifiedStop = (i < changes.length - 1) ? changes[i + 1].modifiedStart : this._modifiedElementsOrHash.length;\r\n            const checkOriginal = change.originalLength > 0;\r\n            const checkModified = change.modifiedLength > 0;\r\n            while (change.originalStart + change.originalLength < originalStop &&\r\n                change.modifiedStart + change.modifiedLength < modifiedStop &&\r\n                (!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength)) &&\r\n                (!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) {\r\n                change.originalStart++;\r\n                change.modifiedStart++;\r\n            }\r\n            let mergedChangeArr = [null];\r\n            if (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) {\r\n                changes[i] = mergedChangeArr[0];\r\n                changes.splice(i + 1, 1);\r\n                i--;\r\n                continue;\r\n            }\r\n        }\r\n        // Shift changes back up until we hit empty or whitespace-only lines\r\n        for (let i = changes.length - 1; i >= 0; i--) {\r\n            const change = changes[i];\r\n            let originalStop = 0;\r\n            let modifiedStop = 0;\r\n            if (i > 0) {\r\n                const prevChange = changes[i - 1];\r\n                if (prevChange.originalLength > 0) {\r\n                    originalStop = prevChange.originalStart + prevChange.originalLength;\r\n                }\r\n                if (prevChange.modifiedLength > 0) {\r\n                    modifiedStop = prevChange.modifiedStart + prevChange.modifiedLength;\r\n                }\r\n            }\r\n            const checkOriginal = change.originalLength > 0;\r\n            const checkModified = change.modifiedLength > 0;\r\n            let bestDelta = 0;\r\n            let bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength);\r\n            for (let delta = 1;; delta++) {\r\n                const originalStart = change.originalStart - delta;\r\n                const modifiedStart = change.modifiedStart - delta;\r\n                if (originalStart < originalStop || modifiedStart < modifiedStop) {\r\n                    break;\r\n                }\r\n                if (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) {\r\n                    break;\r\n                }\r\n                if (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) {\r\n                    break;\r\n                }\r\n                const score = this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength);\r\n                if (score > bestScore) {\r\n                    bestScore = score;\r\n                    bestDelta = delta;\r\n                }\r\n            }\r\n            change.originalStart -= bestDelta;\r\n            change.modifiedStart -= bestDelta;\r\n        }\r\n        // There could be multiple longest common substrings.\r\n        // Give preference to the ones containing longer lines\r\n        if (this._hasStrings) {\r\n            for (let i = 1, len = changes.length; i < len; i++) {\r\n                const aChange = changes[i - 1];\r\n                const bChange = changes[i];\r\n                const matchedLength = bChange.originalStart - aChange.originalStart - aChange.originalLength;\r\n                const aOriginalStart = aChange.originalStart;\r\n                const bOriginalEnd = bChange.originalStart + bChange.originalLength;\r\n                const abOriginalLength = bOriginalEnd - aOriginalStart;\r\n                const aModifiedStart = aChange.modifiedStart;\r\n                const bModifiedEnd = bChange.modifiedStart + bChange.modifiedLength;\r\n                const abModifiedLength = bModifiedEnd - aModifiedStart;\r\n                // Avoid wasting a lot of time with these searches\r\n                if (matchedLength < 5 && abOriginalLength < 20 && abModifiedLength < 20) {\r\n                    const t = this._findBetterContiguousSequence(aOriginalStart, abOriginalLength, aModifiedStart, abModifiedLength, matchedLength);\r\n                    if (t) {\r\n                        const [originalMatchStart, modifiedMatchStart] = t;\r\n                        if (originalMatchStart !== aChange.originalStart + aChange.originalLength || modifiedMatchStart !== aChange.modifiedStart + aChange.modifiedLength) {\r\n                            // switch to another sequence that has a better score\r\n                            aChange.originalLength = originalMatchStart - aChange.originalStart;\r\n                            aChange.modifiedLength = modifiedMatchStart - aChange.modifiedStart;\r\n                            bChange.originalStart = originalMatchStart + matchedLength;\r\n                            bChange.modifiedStart = modifiedMatchStart + matchedLength;\r\n                            bChange.originalLength = bOriginalEnd - bChange.originalStart;\r\n                            bChange.modifiedLength = bModifiedEnd - bChange.modifiedStart;\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n        return changes;\r\n    }\r\n    _findBetterContiguousSequence(originalStart, originalLength, modifiedStart, modifiedLength, desiredLength) {\r\n        if (originalLength < desiredLength || modifiedLength < desiredLength) {\r\n            return null;\r\n        }\r\n        const originalMax = originalStart + originalLength - desiredLength + 1;\r\n        const modifiedMax = modifiedStart + modifiedLength - desiredLength + 1;\r\n        let bestScore = 0;\r\n        let bestOriginalStart = 0;\r\n        let bestModifiedStart = 0;\r\n        for (let i = originalStart; i < originalMax; i++) {\r\n            for (let j = modifiedStart; j < modifiedMax; j++) {\r\n                const score = this._contiguousSequenceScore(i, j, desiredLength);\r\n                if (score > 0 && score > bestScore) {\r\n                    bestScore = score;\r\n                    bestOriginalStart = i;\r\n                    bestModifiedStart = j;\r\n                }\r\n            }\r\n        }\r\n        if (bestScore > 0) {\r\n            return [bestOriginalStart, bestModifiedStart];\r\n        }\r\n        return null;\r\n    }\r\n    _contiguousSequenceScore(originalStart, modifiedStart, length) {\r\n        let score = 0;\r\n        for (let l = 0; l < length; l++) {\r\n            if (!this.ElementsAreEqual(originalStart + l, modifiedStart + l)) {\r\n                return 0;\r\n            }\r\n            score += this._originalStringElements[originalStart + l].length;\r\n        }\r\n        return score;\r\n    }\r\n    _OriginalIsBoundary(index) {\r\n        if (index <= 0 || index >= this._originalElementsOrHash.length - 1) {\r\n            return true;\r\n        }\r\n        return (this._hasStrings && /^\\s*$/.test(this._originalStringElements[index]));\r\n    }\r\n    _OriginalRegionIsBoundary(originalStart, originalLength) {\r\n        if (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) {\r\n            return true;\r\n        }\r\n        if (originalLength > 0) {\r\n            const originalEnd = originalStart + originalLength;\r\n            if (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) {\r\n                return true;\r\n            }\r\n        }\r\n        return false;\r\n    }\r\n    _ModifiedIsBoundary(index) {\r\n        if (index <= 0 || index >= this._modifiedElementsOrHash.length - 1) {\r\n            return true;\r\n        }\r\n        return (this._hasStrings && /^\\s*$/.test(this._modifiedStringElements[index]));\r\n    }\r\n    _ModifiedRegionIsBoundary(modifiedStart, modifiedLength) {\r\n        if (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) {\r\n            return true;\r\n        }\r\n        if (modifiedLength > 0) {\r\n            const modifiedEnd = modifiedStart + modifiedLength;\r\n            if (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) {\r\n                return true;\r\n            }\r\n        }\r\n        return false;\r\n    }\r\n    _boundaryScore(originalStart, originalLength, modifiedStart, modifiedLength) {\r\n        const originalScore = (this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0);\r\n        const modifiedScore = (this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0);\r\n        return (originalScore + modifiedScore);\r\n    }\r\n    /**\r\n     * Concatenates the two input DiffChange lists and returns the resulting\r\n     * list.\r\n     * @param The left changes\r\n     * @param The right changes\r\n     * @returns The concatenated list\r\n     */\r\n    ConcatenateChanges(left, right) {\r\n        let mergedChangeArr = [];\r\n        if (left.length === 0 || right.length === 0) {\r\n            return (right.length > 0) ? right : left;\r\n        }\r\n        else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) {\r\n            // Since we break the problem down recursively, it is possible that we\r\n            // might recurse in the middle of a change thereby splitting it into\r\n            // two changes. Here in the combining stage, we detect and fuse those\r\n            // changes back together\r\n            const result = new Array(left.length + right.length - 1);\r\n            MyArray.Copy(left, 0, result, 0, left.length - 1);\r\n            result[left.length - 1] = mergedChangeArr[0];\r\n            MyArray.Copy(right, 1, result, left.length, right.length - 1);\r\n            return result;\r\n        }\r\n        else {\r\n            const result = new Array(left.length + right.length);\r\n            MyArray.Copy(left, 0, result, 0, left.length);\r\n            MyArray.Copy(right, 0, result, left.length, right.length);\r\n            return result;\r\n        }\r\n    }\r\n    /**\r\n     * Returns true if the two changes overlap and can be merged into a single\r\n     * change\r\n     * @param left The left change\r\n     * @param right The right change\r\n     * @param mergedChange The merged change if the two overlap, null otherwise\r\n     * @returns True if the two changes overlap\r\n     */\r\n    ChangesOverlap(left, right, mergedChangeArr) {\r\n        Debug.Assert(left.originalStart <= right.originalStart, 'Left change is not less than or equal to right change');\r\n        Debug.Assert(left.modifiedStart <= right.modifiedStart, 'Left change is not less than or equal to right change');\r\n        if (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) {\r\n            const originalStart = left.originalStart;\r\n            let originalLength = left.originalLength;\r\n            const modifiedStart = left.modifiedStart;\r\n            let modifiedLength = left.modifiedLength;\r\n            if (left.originalStart + left.originalLength >= right.originalStart) {\r\n                originalLength = right.originalStart + right.originalLength - left.originalStart;\r\n            }\r\n            if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) {\r\n                modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart;\r\n            }\r\n            mergedChangeArr[0] = new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__.DiffChange(originalStart, originalLength, modifiedStart, modifiedLength);\r\n            return true;\r\n        }\r\n        else {\r\n            mergedChangeArr[0] = null;\r\n            return false;\r\n        }\r\n    }\r\n    /**\r\n     * Helper method used to clip a diagonal index to the range of valid\r\n     * diagonals. This also decides whether or not the diagonal index,\r\n     * if it exceeds the boundary, should be clipped to the boundary or clipped\r\n     * one inside the boundary depending on the Even/Odd status of the boundary\r\n     * and numDifferences.\r\n     * @param diagonal The index of the diagonal to clip.\r\n     * @param numDifferences The current number of differences being iterated upon.\r\n     * @param diagonalBaseIndex The base reference diagonal.\r\n     * @param numDiagonals The total number of diagonals.\r\n     * @returns The clipped diagonal index.\r\n     */\r\n    ClipDiagonalBound(diagonal, numDifferences, diagonalBaseIndex, numDiagonals) {\r\n        if (diagonal >= 0 && diagonal < numDiagonals) {\r\n            // Nothing to clip, its in range\r\n            return diagonal;\r\n        }\r\n        // diagonalsBelow: The number of diagonals below the reference diagonal\r\n        // diagonalsAbove: The number of diagonals above the reference diagonal\r\n        const diagonalsBelow = diagonalBaseIndex;\r\n        const diagonalsAbove = numDiagonals - diagonalBaseIndex - 1;\r\n        const diffEven = (numDifferences % 2 === 0);\r\n        if (diagonal < 0) {\r\n            const lowerBoundEven = (diagonalsBelow % 2 === 0);\r\n            return (diffEven === lowerBoundEven) ? 0 : 1;\r\n        }\r\n        else {\r\n            const upperBoundEven = (diagonalsAbove % 2 === 0);\r\n            return (diffEven === upperBoundEven) ? numDiagonals - 1 : numDiagonals - 2;\r\n        }\r\n    }\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js":
/*!**************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"DiffChange\": () => (/* binding */ DiffChange)\n/* harmony export */ });\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n/**\r\n * Represents information about a specific difference between two sequences.\r\n */\r\nclass DiffChange {\r\n    /**\r\n     * Constructs a new DiffChange with the given sequence information\r\n     * and content.\r\n     */\r\n    constructor(originalStart, originalLength, modifiedStart, modifiedLength) {\r\n        //Debug.Assert(originalLength > 0 || modifiedLength > 0, \"originalLength and modifiedLength cannot both be <= 0\");\r\n        this.originalStart = originalStart;\r\n        this.originalLength = originalLength;\r\n        this.modifiedStart = modifiedStart;\r\n        this.modifiedLength = modifiedLength;\r\n    }\r\n    /**\r\n     * The end point (exclusive) of the change in the original sequence.\r\n     */\r\n    getOriginalEnd() {\r\n        return this.originalStart + this.originalLength;\r\n    }\r\n    /**\r\n     * The end point (exclusive) of the change in the modified sequence.\r\n     */\r\n    getModifiedEnd() {\r\n        return this.modifiedStart + this.modifiedLength;\r\n    }\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/errors.js":
/*!*****************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/errors.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"ErrorHandler\": () => (/* binding */ ErrorHandler),\n/* harmony export */   \"errorHandler\": () => (/* binding */ errorHandler),\n/* harmony export */   \"onUnexpectedError\": () => (/* binding */ onUnexpectedError),\n/* harmony export */   \"onUnexpectedExternalError\": () => (/* binding */ onUnexpectedExternalError),\n/* harmony export */   \"transformErrorForSerialization\": () => (/* binding */ transformErrorForSerialization),\n/* harmony export */   \"isPromiseCanceledError\": () => (/* binding */ isPromiseCanceledError),\n/* harmony export */   \"canceled\": () => (/* binding */ canceled),\n/* harmony export */   \"illegalArgument\": () => (/* binding */ illegalArgument),\n/* harmony export */   \"illegalState\": () => (/* binding */ illegalState)\n/* harmony export */ });\n// Avoid circular dependency on EventEmitter by implementing a subset of the interface.\r\nclass ErrorHandler {\r\n    constructor() {\r\n        this.listeners = [];\r\n        this.unexpectedErrorHandler = function (e) {\r\n            setTimeout(() => {\r\n                if (e.stack) {\r\n                    throw new Error(e.message + '\\n\\n' + e.stack);\r\n                }\r\n                throw e;\r\n            }, 0);\r\n        };\r\n    }\r\n    emit(e) {\r\n        this.listeners.forEach((listener) => {\r\n            listener(e);\r\n        });\r\n    }\r\n    onUnexpectedError(e) {\r\n        this.unexpectedErrorHandler(e);\r\n        this.emit(e);\r\n    }\r\n    // For external errors, we don't want the listeners to be called\r\n    onUnexpectedExternalError(e) {\r\n        this.unexpectedErrorHandler(e);\r\n    }\r\n}\r\nconst errorHandler = new ErrorHandler();\r\nfunction onUnexpectedError(e) {\r\n    // ignore errors from cancelled promises\r\n    if (!isPromiseCanceledError(e)) {\r\n        errorHandler.onUnexpectedError(e);\r\n    }\r\n    return undefined;\r\n}\r\nfunction onUnexpectedExternalError(e) {\r\n    // ignore errors from cancelled promises\r\n    if (!isPromiseCanceledError(e)) {\r\n        errorHandler.onUnexpectedExternalError(e);\r\n    }\r\n    return undefined;\r\n}\r\nfunction transformErrorForSerialization(error) {\r\n    if (error instanceof Error) {\r\n        let { name, message } = error;\r\n        const stack = error.stacktrace || error.stack;\r\n        return {\r\n            $isError: true,\r\n            name,\r\n            message,\r\n            stack\r\n        };\r\n    }\r\n    // return as is\r\n    return error;\r\n}\r\nconst canceledName = 'Canceled';\r\n/**\r\n * Checks if the given error is a promise in canceled state\r\n */\r\nfunction isPromiseCanceledError(error) {\r\n    return error instanceof Error && error.name === canceledName && error.message === canceledName;\r\n}\r\n/**\r\n * Returns an error that signals cancellation.\r\n */\r\nfunction canceled() {\r\n    const error = new Error(canceledName);\r\n    error.name = error.message;\r\n    return error;\r\n}\r\nfunction illegalArgument(name) {\r\n    if (name) {\r\n        return new Error(`Illegal argument: ${name}`);\r\n    }\r\n    else {\r\n        return new Error('Illegal argument');\r\n    }\r\n}\r\nfunction illegalState(name) {\r\n    if (name) {\r\n        return new Error(`Illegal state: ${name}`);\r\n    }\r\n    else {\r\n        return new Error('Illegal state');\r\n    }\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/errors.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/event.js":
/*!****************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/event.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"Event\": () => (/* binding */ Event),\n/* harmony export */   \"Emitter\": () => (/* binding */ Emitter),\n/* harmony export */   \"PauseableEmitter\": () => (/* binding */ PauseableEmitter),\n/* harmony export */   \"EventBufferer\": () => (/* binding */ EventBufferer),\n/* harmony export */   \"Relay\": () => (/* binding */ Relay)\n/* harmony export */ });\n/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ \"./node_modules/monaco-editor/esm/vs/base/common/errors.js\");\n/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lifecycle.js */ \"./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js\");\n/* harmony import */ var _linkedList_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linkedList.js */ \"./node_modules/monaco-editor/esm/vs/base/common/linkedList.js\");\n/* harmony import */ var _stopwatch_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stopwatch.js */ \"./node_modules/monaco-editor/esm/vs/base/common/stopwatch.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n\r\n\r\n\r\nvar Event;\r\n(function (Event) {\r\n    Event.None = () => _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__.Disposable.None;\r\n    /**\r\n     * Given an event, returns another event which only fires once.\r\n     */\r\n    function once(event) {\r\n        return (listener, thisArgs = null, disposables) => {\r\n            // we need this, in case the event fires during the listener call\r\n            let didFire = false;\r\n            let result;\r\n            result = event(e => {\r\n                if (didFire) {\r\n                    return;\r\n                }\r\n                else if (result) {\r\n                    result.dispose();\r\n                }\r\n                else {\r\n                    didFire = true;\r\n                }\r\n                return listener.call(thisArgs, e);\r\n            }, null, disposables);\r\n            if (didFire) {\r\n                result.dispose();\r\n            }\r\n            return result;\r\n        };\r\n    }\r\n    Event.once = once;\r\n    /**\r\n     * Given an event and a `map` function, returns another event which maps each element\r\n     * through the mapping function.\r\n     */\r\n    function map(event, map) {\r\n        return snapshot((listener, thisArgs = null, disposables) => event(i => listener.call(thisArgs, map(i)), null, disposables));\r\n    }\r\n    Event.map = map;\r\n    /**\r\n     * Given an event and an `each` function, returns another identical event and calls\r\n     * the `each` function per each element.\r\n     */\r\n    function forEach(event, each) {\r\n        return snapshot((listener, thisArgs = null, disposables) => event(i => { each(i); listener.call(thisArgs, i); }, null, disposables));\r\n    }\r\n    Event.forEach = forEach;\r\n    function filter(event, filter) {\r\n        return snapshot((listener, thisArgs = null, disposables) => event(e => filter(e) && listener.call(thisArgs, e), null, disposables));\r\n    }\r\n    Event.filter = filter;\r\n    /**\r\n     * Given an event, returns the same event but typed as `Event<void>`.\r\n     */\r\n    function signal(event) {\r\n        return event;\r\n    }\r\n    Event.signal = signal;\r\n    function any(...events) {\r\n        return (listener, thisArgs = null, disposables) => (0,_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__.combinedDisposable)(...events.map(event => event(e => listener.call(thisArgs, e), null, disposables)));\r\n    }\r\n    Event.any = any;\r\n    /**\r\n     * Given an event and a `merge` function, returns another event which maps each element\r\n     * and the cumulative result through the `merge` function. Similar to `map`, but with memory.\r\n     */\r\n    function reduce(event, merge, initial) {\r\n        let output = initial;\r\n        return map(event, e => {\r\n            output = merge(output, e);\r\n            return output;\r\n        });\r\n    }\r\n    Event.reduce = reduce;\r\n    /**\r\n     * Given a chain of event processing functions (filter, map, etc), each\r\n     * function will be invoked per event & per listener. Snapshotting an event\r\n     * chain allows each function to be invoked just once per event.\r\n     */\r\n    function snapshot(event) {\r\n        let listener;\r\n        const emitter = new Emitter({\r\n            onFirstListenerAdd() {\r\n                listener = event(emitter.fire, emitter);\r\n            },\r\n            onLastListenerRemove() {\r\n                listener.dispose();\r\n            }\r\n        });\r\n        return emitter.event;\r\n    }\r\n    Event.snapshot = snapshot;\r\n    function debounce(event, merge, delay = 100, leading = false, leakWarningThreshold) {\r\n        let subscription;\r\n        let output = undefined;\r\n        let handle = undefined;\r\n        let numDebouncedCalls = 0;\r\n        const emitter = new Emitter({\r\n            leakWarningThreshold,\r\n            onFirstListenerAdd() {\r\n                subscription = event(cur => {\r\n                    numDebouncedCalls++;\r\n                    output = merge(output, cur);\r\n                    if (leading && !handle) {\r\n                        emitter.fire(output);\r\n                        output = undefined;\r\n                    }\r\n                    clearTimeout(handle);\r\n                    handle = setTimeout(() => {\r\n                        const _output = output;\r\n                        output = undefined;\r\n                        handle = undefined;\r\n                        if (!leading || numDebouncedCalls > 1) {\r\n                            emitter.fire(_output);\r\n                        }\r\n                        numDebouncedCalls = 0;\r\n                    }, delay);\r\n                });\r\n            },\r\n            onLastListenerRemove() {\r\n                subscription.dispose();\r\n            }\r\n        });\r\n        return emitter.event;\r\n    }\r\n    Event.debounce = debounce;\r\n    /**\r\n     * Given an event, it returns another event which fires only once and as soon as\r\n     * the input event emits. The event data is the number of millis it took for the\r\n     * event to fire.\r\n     */\r\n    function stopwatch(event) {\r\n        const start = new Date().getTime();\r\n        return map(once(event), _ => new Date().getTime() - start);\r\n    }\r\n    Event.stopwatch = stopwatch;\r\n    /**\r\n     * Given an event, it returns another event which fires only when the event\r\n     * element changes.\r\n     */\r\n    function latch(event) {\r\n        let firstCall = true;\r\n        let cache;\r\n        return filter(event, value => {\r\n            const shouldEmit = firstCall || value !== cache;\r\n            firstCall = false;\r\n            cache = value;\r\n            return shouldEmit;\r\n        });\r\n    }\r\n    Event.latch = latch;\r\n    /**\r\n     * Buffers the provided event until a first listener comes\r\n     * along, at which point fire all the events at once and\r\n     * pipe the event from then on.\r\n     *\r\n     * ```typescript\r\n     * const emitter = new Emitter<number>();\r\n     * const event = emitter.event;\r\n     * const bufferedEvent = buffer(event);\r\n     *\r\n     * emitter.fire(1);\r\n     * emitter.fire(2);\r\n     * emitter.fire(3);\r\n     * // nothing...\r\n     *\r\n     * const listener = bufferedEvent(num => console.log(num));\r\n     * // 1, 2, 3\r\n     *\r\n     * emitter.fire(4);\r\n     * // 4\r\n     * ```\r\n     */\r\n    function buffer(event, nextTick = false, _buffer = []) {\r\n        let buffer = _buffer.slice();\r\n        let listener = event(e => {\r\n            if (buffer) {\r\n                buffer.push(e);\r\n            }\r\n            else {\r\n                emitter.fire(e);\r\n            }\r\n        });\r\n        const flush = () => {\r\n            if (buffer) {\r\n                buffer.forEach(e => emitter.fire(e));\r\n            }\r\n            buffer = null;\r\n        };\r\n        const emitter = new Emitter({\r\n            onFirstListenerAdd() {\r\n                if (!listener) {\r\n                    listener = event(e => emitter.fire(e));\r\n                }\r\n            },\r\n            onFirstListenerDidAdd() {\r\n                if (buffer) {\r\n                    if (nextTick) {\r\n                        setTimeout(flush);\r\n                    }\r\n                    else {\r\n                        flush();\r\n                    }\r\n                }\r\n            },\r\n            onLastListenerRemove() {\r\n                if (listener) {\r\n                    listener.dispose();\r\n                }\r\n                listener = null;\r\n            }\r\n        });\r\n        return emitter.event;\r\n    }\r\n    Event.buffer = buffer;\r\n    class ChainableEvent {\r\n        constructor(event) {\r\n            this.event = event;\r\n        }\r\n        map(fn) {\r\n            return new ChainableEvent(map(this.event, fn));\r\n        }\r\n        forEach(fn) {\r\n            return new ChainableEvent(forEach(this.event, fn));\r\n        }\r\n        filter(fn) {\r\n            return new ChainableEvent(filter(this.event, fn));\r\n        }\r\n        reduce(merge, initial) {\r\n            return new ChainableEvent(reduce(this.event, merge, initial));\r\n        }\r\n        latch() {\r\n            return new ChainableEvent(latch(this.event));\r\n        }\r\n        debounce(merge, delay = 100, leading = false, leakWarningThreshold) {\r\n            return new ChainableEvent(debounce(this.event, merge, delay, leading, leakWarningThreshold));\r\n        }\r\n        on(listener, thisArgs, disposables) {\r\n            return this.event(listener, thisArgs, disposables);\r\n        }\r\n        once(listener, thisArgs, disposables) {\r\n            return once(this.event)(listener, thisArgs, disposables);\r\n        }\r\n    }\r\n    function chain(event) {\r\n        return new ChainableEvent(event);\r\n    }\r\n    Event.chain = chain;\r\n    function fromNodeEventEmitter(emitter, eventName, map = id => id) {\r\n        const fn = (...args) => result.fire(map(...args));\r\n        const onFirstListenerAdd = () => emitter.on(eventName, fn);\r\n        const onLastListenerRemove = () => emitter.removeListener(eventName, fn);\r\n        const result = new Emitter({ onFirstListenerAdd, onLastListenerRemove });\r\n        return result.event;\r\n    }\r\n    Event.fromNodeEventEmitter = fromNodeEventEmitter;\r\n    function fromDOMEventEmitter(emitter, eventName, map = id => id) {\r\n        const fn = (...args) => result.fire(map(...args));\r\n        const onFirstListenerAdd = () => emitter.addEventListener(eventName, fn);\r\n        const onLastListenerRemove = () => emitter.removeEventListener(eventName, fn);\r\n        const result = new Emitter({ onFirstListenerAdd, onLastListenerRemove });\r\n        return result.event;\r\n    }\r\n    Event.fromDOMEventEmitter = fromDOMEventEmitter;\r\n    function fromPromise(promise) {\r\n        const emitter = new Emitter();\r\n        let shouldEmit = false;\r\n        promise\r\n            .then(undefined, () => null)\r\n            .then(() => {\r\n            if (!shouldEmit) {\r\n                setTimeout(() => emitter.fire(undefined), 0);\r\n            }\r\n            else {\r\n                emitter.fire(undefined);\r\n            }\r\n        });\r\n        shouldEmit = true;\r\n        return emitter.event;\r\n    }\r\n    Event.fromPromise = fromPromise;\r\n    function toPromise(event) {\r\n        return new Promise(resolve => once(event)(resolve));\r\n    }\r\n    Event.toPromise = toPromise;\r\n})(Event || (Event = {}));\r\nclass EventProfiling {\r\n    constructor(name) {\r\n        this._listenerCount = 0;\r\n        this._invocationCount = 0;\r\n        this._elapsedOverall = 0;\r\n        this._name = `${name}_${EventProfiling._idPool++}`;\r\n    }\r\n    start(listenerCount) {\r\n        this._stopWatch = new _stopwatch_js__WEBPACK_IMPORTED_MODULE_3__.StopWatch(true);\r\n        this._listenerCount = listenerCount;\r\n    }\r\n    stop() {\r\n        if (this._stopWatch) {\r\n            const elapsed = this._stopWatch.elapsed();\r\n            this._elapsedOverall += elapsed;\r\n            this._invocationCount += 1;\r\n            console.info(`did FIRE ${this._name}: elapsed_ms: ${elapsed.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`);\r\n            this._stopWatch = undefined;\r\n        }\r\n    }\r\n}\r\nEventProfiling._idPool = 0;\r\nlet _globalLeakWarningThreshold = -1;\r\nclass LeakageMonitor {\r\n    constructor(customThreshold, name = Math.random().toString(18).slice(2, 5)) {\r\n        this.customThreshold = customThreshold;\r\n        this.name = name;\r\n        this._warnCountdown = 0;\r\n    }\r\n    dispose() {\r\n        if (this._stacks) {\r\n            this._stacks.clear();\r\n        }\r\n    }\r\n    check(listenerCount) {\r\n        let threshold = _globalLeakWarningThreshold;\r\n        if (typeof this.customThreshold === 'number') {\r\n            threshold = this.customThreshold;\r\n        }\r\n        if (threshold <= 0 || listenerCount < threshold) {\r\n            return undefined;\r\n        }\r\n        if (!this._stacks) {\r\n            this._stacks = new Map();\r\n        }\r\n        const stack = new Error().stack.split('\\n').slice(3).join('\\n');\r\n        const count = (this._stacks.get(stack) || 0);\r\n        this._stacks.set(stack, count + 1);\r\n        this._warnCountdown -= 1;\r\n        if (this._warnCountdown <= 0) {\r\n            // only warn on first exceed and then every time the limit\r\n            // is exceeded by 50% again\r\n            this._warnCountdown = threshold * 0.5;\r\n            // find most frequent listener and print warning\r\n            let topStack;\r\n            let topCount = 0;\r\n            for (const [stack, count] of this._stacks) {\r\n                if (!topStack || topCount < count) {\r\n                    topStack = stack;\r\n                    topCount = count;\r\n                }\r\n            }\r\n            console.warn(`[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`);\r\n            console.warn(topStack);\r\n        }\r\n        return () => {\r\n            const count = (this._stacks.get(stack) || 0);\r\n            this._stacks.set(stack, count - 1);\r\n        };\r\n    }\r\n}\r\n/**\r\n * The Emitter can be used to expose an Event to the public\r\n * to fire it from the insides.\r\n * Sample:\r\n    class Document {\r\n\r\n        private readonly _onDidChange = new Emitter<(value:string)=>any>();\r\n\r\n        public onDidChange = this._onDidChange.event;\r\n\r\n        // getter-style\r\n        // get onDidChange(): Event<(value:string)=>any> {\r\n        // \treturn this._onDidChange.event;\r\n        // }\r\n\r\n        private _doIt() {\r\n            //...\r\n            this._onDidChange.fire(value);\r\n        }\r\n    }\r\n */\r\nclass Emitter {\r\n    constructor(options) {\r\n        var _a;\r\n        this._disposed = false;\r\n        this._options = options;\r\n        this._leakageMon = _globalLeakWarningThreshold > 0 ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) : undefined;\r\n        this._perfMon = ((_a = this._options) === null || _a === void 0 ? void 0 : _a._profName) ? new EventProfiling(this._options._profName) : undefined;\r\n    }\r\n    /**\r\n     * For the public to allow to subscribe\r\n     * to events from this Emitter\r\n     */\r\n    get event() {\r\n        if (!this._event) {\r\n            this._event = (listener, thisArgs, disposables) => {\r\n                var _a;\r\n                if (!this._listeners) {\r\n                    this._listeners = new _linkedList_js__WEBPACK_IMPORTED_MODULE_2__.LinkedList();\r\n                }\r\n                const firstListener = this._listeners.isEmpty();\r\n                if (firstListener && this._options && this._options.onFirstListenerAdd) {\r\n                    this._options.onFirstListenerAdd(this);\r\n                }\r\n                const remove = this._listeners.push(!thisArgs ? listener : [listener, thisArgs]);\r\n                if (firstListener && this._options && this._options.onFirstListenerDidAdd) {\r\n                    this._options.onFirstListenerDidAdd(this);\r\n                }\r\n                if (this._options && this._options.onListenerDidAdd) {\r\n                    this._options.onListenerDidAdd(this, listener, thisArgs);\r\n                }\r\n                // check and record this emitter for potential leakage\r\n                const removeMonitor = (_a = this._leakageMon) === null || _a === void 0 ? void 0 : _a.check(this._listeners.size);\r\n                let result;\r\n                result = {\r\n                    dispose: () => {\r\n                        if (removeMonitor) {\r\n                            removeMonitor();\r\n                        }\r\n                        result.dispose = Emitter._noop;\r\n                        if (!this._disposed) {\r\n                            remove();\r\n                            if (this._options && this._options.onLastListenerRemove) {\r\n                                const hasListeners = (this._listeners && !this._listeners.isEmpty());\r\n                                if (!hasListeners) {\r\n                                    this._options.onLastListenerRemove(this);\r\n                                }\r\n                            }\r\n                        }\r\n                    }\r\n                };\r\n                if (disposables instanceof _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__.DisposableStore) {\r\n                    disposables.add(result);\r\n                }\r\n                else if (Array.isArray(disposables)) {\r\n                    disposables.push(result);\r\n                }\r\n                return result;\r\n            };\r\n        }\r\n        return this._event;\r\n    }\r\n    /**\r\n     * To be kept private to fire an event to\r\n     * subscribers\r\n     */\r\n    fire(event) {\r\n        var _a, _b;\r\n        if (this._listeners) {\r\n            // put all [listener,event]-pairs into delivery queue\r\n            // then emit all event. an inner/nested event might be\r\n            // the driver of this\r\n            if (!this._deliveryQueue) {\r\n                this._deliveryQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_2__.LinkedList();\r\n            }\r\n            for (let listener of this._listeners) {\r\n                this._deliveryQueue.push([listener, event]);\r\n            }\r\n            // start/stop performance insight collection\r\n            (_a = this._perfMon) === null || _a === void 0 ? void 0 : _a.start(this._deliveryQueue.size);\r\n            while (this._deliveryQueue.size > 0) {\r\n                const [listener, event] = this._deliveryQueue.shift();\r\n                try {\r\n                    if (typeof listener === 'function') {\r\n                        listener.call(undefined, event);\r\n                    }\r\n                    else {\r\n                        listener[0].call(listener[1], event);\r\n                    }\r\n                }\r\n                catch (e) {\r\n                    (0,_errors_js__WEBPACK_IMPORTED_MODULE_0__.onUnexpectedError)(e);\r\n                }\r\n            }\r\n            (_b = this._perfMon) === null || _b === void 0 ? void 0 : _b.stop();\r\n        }\r\n    }\r\n    dispose() {\r\n        var _a, _b, _c;\r\n        (_a = this._listeners) === null || _a === void 0 ? void 0 : _a.clear();\r\n        (_b = this._deliveryQueue) === null || _b === void 0 ? void 0 : _b.clear();\r\n        (_c = this._leakageMon) === null || _c === void 0 ? void 0 : _c.dispose();\r\n        this._disposed = true;\r\n    }\r\n}\r\nEmitter._noop = function () { };\r\nclass PauseableEmitter extends Emitter {\r\n    constructor(options) {\r\n        super(options);\r\n        this._isPaused = 0;\r\n        this._eventQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_2__.LinkedList();\r\n        this._mergeFn = options === null || options === void 0 ? void 0 : options.merge;\r\n    }\r\n    pause() {\r\n        this._isPaused++;\r\n    }\r\n    resume() {\r\n        if (this._isPaused !== 0 && --this._isPaused === 0) {\r\n            if (this._mergeFn) {\r\n                // use the merge function to create a single composite\r\n                // event. make a copy in case firing pauses this emitter\r\n                const events = Array.from(this._eventQueue);\r\n                this._eventQueue.clear();\r\n                super.fire(this._mergeFn(events));\r\n            }\r\n            else {\r\n                // no merging, fire each event individually and test\r\n                // that this emitter isn't paused halfway through\r\n                while (!this._isPaused && this._eventQueue.size !== 0) {\r\n                    super.fire(this._eventQueue.shift());\r\n                }\r\n            }\r\n        }\r\n    }\r\n    fire(event) {\r\n        if (this._listeners) {\r\n            if (this._isPaused !== 0) {\r\n                this._eventQueue.push(event);\r\n            }\r\n            else {\r\n                super.fire(event);\r\n            }\r\n        }\r\n    }\r\n}\r\n/**\r\n * The EventBufferer is useful in situations in which you want\r\n * to delay firing your events during some code.\r\n * You can wrap that code and be sure that the event will not\r\n * be fired during that wrap.\r\n *\r\n * ```\r\n * const emitter: Emitter;\r\n * const delayer = new EventDelayer();\r\n * const delayedEvent = delayer.wrapEvent(emitter.event);\r\n *\r\n * delayedEvent(console.log);\r\n *\r\n * delayer.bufferEvents(() => {\r\n *   emitter.fire(); // event will not be fired yet\r\n * });\r\n *\r\n * // event will only be fired at this point\r\n * ```\r\n */\r\nclass EventBufferer {\r\n    constructor() {\r\n        this.buffers = [];\r\n    }\r\n    wrapEvent(event) {\r\n        return (listener, thisArgs, disposables) => {\r\n            return event(i => {\r\n                const buffer = this.buffers[this.buffers.length - 1];\r\n                if (buffer) {\r\n                    buffer.push(() => listener.call(thisArgs, i));\r\n                }\r\n                else {\r\n                    listener.call(thisArgs, i);\r\n                }\r\n            }, undefined, disposables);\r\n        };\r\n    }\r\n    bufferEvents(fn) {\r\n        const buffer = [];\r\n        this.buffers.push(buffer);\r\n        const r = fn();\r\n        this.buffers.pop();\r\n        buffer.forEach(flush => flush());\r\n        return r;\r\n    }\r\n}\r\n/**\r\n * A Relay is an event forwarder which functions as a replugabble event pipe.\r\n * Once created, you can connect an input event to it and it will simply forward\r\n * events from that input event through its own `event` property. The `input`\r\n * can be changed at any point in time.\r\n */\r\nclass Relay {\r\n    constructor() {\r\n        this.listening = false;\r\n        this.inputEvent = Event.None;\r\n        this.inputEventListener = _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__.Disposable.None;\r\n        this.emitter = new Emitter({\r\n            onFirstListenerDidAdd: () => {\r\n                this.listening = true;\r\n                this.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter);\r\n            },\r\n            onLastListenerRemove: () => {\r\n                this.listening = false;\r\n                this.inputEventListener.dispose();\r\n            }\r\n        });\r\n        this.event = this.emitter.event;\r\n    }\r\n    set input(event) {\r\n        this.inputEvent = event;\r\n        if (this.listening) {\r\n            this.inputEventListener.dispose();\r\n            this.inputEventListener = event(this.emitter.fire, this.emitter);\r\n        }\r\n    }\r\n    dispose() {\r\n        this.inputEventListener.dispose();\r\n        this.emitter.dispose();\r\n    }\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/event.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/hash.js":
/*!***************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/hash.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"hash\": () => (/* binding */ hash),\n/* harmony export */   \"doHash\": () => (/* binding */ doHash),\n/* harmony export */   \"stringHash\": () => (/* binding */ stringHash),\n/* harmony export */   \"toHexString\": () => (/* binding */ toHexString),\n/* harmony export */   \"StringSHA1\": () => (/* binding */ StringSHA1)\n/* harmony export */ });\n/* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./strings.js */ \"./node_modules/monaco-editor/esm/vs/base/common/strings.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n/**\r\n * Return a hash value for an object.\r\n */\r\nfunction hash(obj) {\r\n    return doHash(obj, 0);\r\n}\r\nfunction doHash(obj, hashVal) {\r\n    switch (typeof obj) {\r\n        case 'object':\r\n            if (obj === null) {\r\n                return numberHash(349, hashVal);\r\n            }\r\n            else if (Array.isArray(obj)) {\r\n                return arrayHash(obj, hashVal);\r\n            }\r\n            return objectHash(obj, hashVal);\r\n        case 'string':\r\n            return stringHash(obj, hashVal);\r\n        case 'boolean':\r\n            return booleanHash(obj, hashVal);\r\n        case 'number':\r\n            return numberHash(obj, hashVal);\r\n        case 'undefined':\r\n            return numberHash(937, hashVal);\r\n        default:\r\n            return numberHash(617, hashVal);\r\n    }\r\n}\r\nfunction numberHash(val, initialHashVal) {\r\n    return (((initialHashVal << 5) - initialHashVal) + val) | 0; // hashVal * 31 + ch, keep as int32\r\n}\r\nfunction booleanHash(b, initialHashVal) {\r\n    return numberHash(b ? 433 : 863, initialHashVal);\r\n}\r\nfunction stringHash(s, hashVal) {\r\n    hashVal = numberHash(149417, hashVal);\r\n    for (let i = 0, length = s.length; i < length; i++) {\r\n        hashVal = numberHash(s.charCodeAt(i), hashVal);\r\n    }\r\n    return hashVal;\r\n}\r\nfunction arrayHash(arr, initialHashVal) {\r\n    initialHashVal = numberHash(104579, initialHashVal);\r\n    return arr.reduce((hashVal, item) => doHash(item, hashVal), initialHashVal);\r\n}\r\nfunction objectHash(obj, initialHashVal) {\r\n    initialHashVal = numberHash(181387, initialHashVal);\r\n    return Object.keys(obj).sort().reduce((hashVal, key) => {\r\n        hashVal = stringHash(key, hashVal);\r\n        return doHash(obj[key], hashVal);\r\n    }, initialHashVal);\r\n}\r\nfunction leftRotate(value, bits, totalBits = 32) {\r\n    // delta + bits = totalBits\r\n    const delta = totalBits - bits;\r\n    // All ones, expect `delta` zeros aligned to the right\r\n    const mask = ~((1 << delta) - 1);\r\n    // Join (value left-shifted `bits` bits) with (masked value right-shifted `delta` bits)\r\n    return ((value << bits) | ((mask & value) >>> delta)) >>> 0;\r\n}\r\nfunction fill(dest, index = 0, count = dest.byteLength, value = 0) {\r\n    for (let i = 0; i < count; i++) {\r\n        dest[index + i] = value;\r\n    }\r\n}\r\nfunction leftPad(value, length, char = '0') {\r\n    while (value.length < length) {\r\n        value = char + value;\r\n    }\r\n    return value;\r\n}\r\nfunction toHexString(bufferOrValue, bitsize = 32) {\r\n    if (bufferOrValue instanceof ArrayBuffer) {\r\n        return Array.from(new Uint8Array(bufferOrValue)).map(b => b.toString(16).padStart(2, '0')).join('');\r\n    }\r\n    return leftPad((bufferOrValue >>> 0).toString(16), bitsize / 4);\r\n}\r\n/**\r\n * A SHA1 implementation that works with strings and does not allocate.\r\n */\r\nclass StringSHA1 {\r\n    constructor() {\r\n        this._h0 = 0x67452301;\r\n        this._h1 = 0xEFCDAB89;\r\n        this._h2 = 0x98BADCFE;\r\n        this._h3 = 0x10325476;\r\n        this._h4 = 0xC3D2E1F0;\r\n        this._buff = new Uint8Array(64 /* BLOCK_SIZE */ + 3 /* to fit any utf-8 */);\r\n        this._buffDV = new DataView(this._buff.buffer);\r\n        this._buffLen = 0;\r\n        this._totalLen = 0;\r\n        this._leftoverHighSurrogate = 0;\r\n        this._finished = false;\r\n    }\r\n    update(str) {\r\n        const strLen = str.length;\r\n        if (strLen === 0) {\r\n            return;\r\n        }\r\n        const buff = this._buff;\r\n        let buffLen = this._buffLen;\r\n        let leftoverHighSurrogate = this._leftoverHighSurrogate;\r\n        let charCode;\r\n        let offset;\r\n        if (leftoverHighSurrogate !== 0) {\r\n            charCode = leftoverHighSurrogate;\r\n            offset = -1;\r\n            leftoverHighSurrogate = 0;\r\n        }\r\n        else {\r\n            charCode = str.charCodeAt(0);\r\n            offset = 0;\r\n        }\r\n        while (true) {\r\n            let codePoint = charCode;\r\n            if (_strings_js__WEBPACK_IMPORTED_MODULE_0__.isHighSurrogate(charCode)) {\r\n                if (offset + 1 < strLen) {\r\n                    const nextCharCode = str.charCodeAt(offset + 1);\r\n                    if (_strings_js__WEBPACK_IMPORTED_MODULE_0__.isLowSurrogate(nextCharCode)) {\r\n                        offset++;\r\n                        codePoint = _strings_js__WEBPACK_IMPORTED_MODULE_0__.computeCodePoint(charCode, nextCharCode);\r\n                    }\r\n                    else {\r\n                        // illegal => unicode replacement character\r\n                        codePoint = 65533 /* UNICODE_REPLACEMENT */;\r\n                    }\r\n                }\r\n                else {\r\n                    // last character is a surrogate pair\r\n                    leftoverHighSurrogate = charCode;\r\n                    break;\r\n                }\r\n            }\r\n            else if (_strings_js__WEBPACK_IMPORTED_MODULE_0__.isLowSurrogate(charCode)) {\r\n                // illegal => unicode replacement character\r\n                codePoint = 65533 /* UNICODE_REPLACEMENT */;\r\n            }\r\n            buffLen = this._push(buff, buffLen, codePoint);\r\n            offset++;\r\n            if (offset < strLen) {\r\n                charCode = str.charCodeAt(offset);\r\n            }\r\n            else {\r\n                break;\r\n            }\r\n        }\r\n        this._buffLen = buffLen;\r\n        this._leftoverHighSurrogate = leftoverHighSurrogate;\r\n    }\r\n    _push(buff, buffLen, codePoint) {\r\n        if (codePoint < 0x0080) {\r\n            buff[buffLen++] = codePoint;\r\n        }\r\n        else if (codePoint < 0x0800) {\r\n            buff[buffLen++] = 0b11000000 | ((codePoint & 0b00000000000000000000011111000000) >>> 6);\r\n            buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0);\r\n        }\r\n        else if (codePoint < 0x10000) {\r\n            buff[buffLen++] = 0b11100000 | ((codePoint & 0b00000000000000001111000000000000) >>> 12);\r\n            buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000111111000000) >>> 6);\r\n            buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0);\r\n        }\r\n        else {\r\n            buff[buffLen++] = 0b11110000 | ((codePoint & 0b00000000000111000000000000000000) >>> 18);\r\n            buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000111111000000000000) >>> 12);\r\n            buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000111111000000) >>> 6);\r\n            buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0);\r\n        }\r\n        if (buffLen >= 64 /* BLOCK_SIZE */) {\r\n            this._step();\r\n            buffLen -= 64 /* BLOCK_SIZE */;\r\n            this._totalLen += 64 /* BLOCK_SIZE */;\r\n            // take last 3 in case of UTF8 overflow\r\n            buff[0] = buff[64 /* BLOCK_SIZE */ + 0];\r\n            buff[1] = buff[64 /* BLOCK_SIZE */ + 1];\r\n            buff[2] = buff[64 /* BLOCK_SIZE */ + 2];\r\n        }\r\n        return buffLen;\r\n    }\r\n    digest() {\r\n        if (!this._finished) {\r\n            this._finished = true;\r\n            if (this._leftoverHighSurrogate) {\r\n                // illegal => unicode replacement character\r\n                this._leftoverHighSurrogate = 0;\r\n                this._buffLen = this._push(this._buff, this._buffLen, 65533 /* UNICODE_REPLACEMENT */);\r\n            }\r\n            this._totalLen += this._buffLen;\r\n            this._wrapUp();\r\n        }\r\n        return toHexString(this._h0) + toHexString(this._h1) + toHexString(this._h2) + toHexString(this._h3) + toHexString(this._h4);\r\n    }\r\n    _wrapUp() {\r\n        this._buff[this._buffLen++] = 0x80;\r\n        fill(this._buff, this._buffLen);\r\n        if (this._buffLen > 56) {\r\n            this._step();\r\n            fill(this._buff);\r\n        }\r\n        // this will fit because the mantissa can cover up to 52 bits\r\n        const ml = 8 * this._totalLen;\r\n        this._buffDV.setUint32(56, Math.floor(ml / 4294967296), false);\r\n        this._buffDV.setUint32(60, ml % 4294967296, false);\r\n        this._step();\r\n    }\r\n    _step() {\r\n        const bigBlock32 = StringSHA1._bigBlock32;\r\n        const data = this._buffDV;\r\n        for (let j = 0; j < 64 /* 16*4 */; j += 4) {\r\n            bigBlock32.setUint32(j, data.getUint32(j, false), false);\r\n        }\r\n        for (let j = 64; j < 320 /* 80*4 */; j += 4) {\r\n            bigBlock32.setUint32(j, leftRotate((bigBlock32.getUint32(j - 12, false) ^ bigBlock32.getUint32(j - 32, false) ^ bigBlock32.getUint32(j - 56, false) ^ bigBlock32.getUint32(j - 64, false)), 1), false);\r\n        }\r\n        let a = this._h0;\r\n        let b = this._h1;\r\n        let c = this._h2;\r\n        let d = this._h3;\r\n        let e = this._h4;\r\n        let f, k;\r\n        let temp;\r\n        for (let j = 0; j < 80; j++) {\r\n            if (j < 20) {\r\n                f = (b & c) | ((~b) & d);\r\n                k = 0x5A827999;\r\n            }\r\n            else if (j < 40) {\r\n                f = b ^ c ^ d;\r\n                k = 0x6ED9EBA1;\r\n            }\r\n            else if (j < 60) {\r\n                f = (b & c) | (b & d) | (c & d);\r\n                k = 0x8F1BBCDC;\r\n            }\r\n            else {\r\n                f = b ^ c ^ d;\r\n                k = 0xCA62C1D6;\r\n            }\r\n            temp = (leftRotate(a, 5) + f + e + k + bigBlock32.getUint32(j * 4, false)) & 0xffffffff;\r\n            e = d;\r\n            d = c;\r\n            c = leftRotate(b, 30);\r\n            b = a;\r\n            a = temp;\r\n        }\r\n        this._h0 = (this._h0 + a) & 0xffffffff;\r\n        this._h1 = (this._h1 + b) & 0xffffffff;\r\n        this._h2 = (this._h2 + c) & 0xffffffff;\r\n        this._h3 = (this._h3 + d) & 0xffffffff;\r\n        this._h4 = (this._h4 + e) & 0xffffffff;\r\n    }\r\n}\r\nStringSHA1._bigBlock32 = new DataView(new ArrayBuffer(320)); // 80 * 4 = 320\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/hash.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js":
/*!*******************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/iterator.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"Iterable\": () => (/* binding */ Iterable)\n/* harmony export */ });\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nvar Iterable;\r\n(function (Iterable) {\r\n    function is(thing) {\r\n        return thing && typeof thing === 'object' && typeof thing[Symbol.iterator] === 'function';\r\n    }\r\n    Iterable.is = is;\r\n    const _empty = Object.freeze([]);\r\n    function empty() {\r\n        return _empty;\r\n    }\r\n    Iterable.empty = empty;\r\n    function* single(element) {\r\n        yield element;\r\n    }\r\n    Iterable.single = single;\r\n    function from(iterable) {\r\n        return iterable || _empty;\r\n    }\r\n    Iterable.from = from;\r\n    function isEmpty(iterable) {\r\n        return !iterable || iterable[Symbol.iterator]().next().done === true;\r\n    }\r\n    Iterable.isEmpty = isEmpty;\r\n    function first(iterable) {\r\n        return iterable[Symbol.iterator]().next().value;\r\n    }\r\n    Iterable.first = first;\r\n    function some(iterable, predicate) {\r\n        for (const element of iterable) {\r\n            if (predicate(element)) {\r\n                return true;\r\n            }\r\n        }\r\n        return false;\r\n    }\r\n    Iterable.some = some;\r\n    function find(iterable, predicate) {\r\n        for (const element of iterable) {\r\n            if (predicate(element)) {\r\n                return element;\r\n            }\r\n        }\r\n        return undefined;\r\n    }\r\n    Iterable.find = find;\r\n    function* filter(iterable, predicate) {\r\n        for (const element of iterable) {\r\n            if (predicate(element)) {\r\n                yield element;\r\n            }\r\n        }\r\n    }\r\n    Iterable.filter = filter;\r\n    function* map(iterable, fn) {\r\n        for (const element of iterable) {\r\n            yield fn(element);\r\n        }\r\n    }\r\n    Iterable.map = map;\r\n    function* concat(...iterables) {\r\n        for (const iterable of iterables) {\r\n            for (const element of iterable) {\r\n                yield element;\r\n            }\r\n        }\r\n    }\r\n    Iterable.concat = concat;\r\n    function* concatNested(iterables) {\r\n        for (const iterable of iterables) {\r\n            for (const element of iterable) {\r\n                yield element;\r\n            }\r\n        }\r\n    }\r\n    Iterable.concatNested = concatNested;\r\n    function reduce(iterable, reducer, initialValue) {\r\n        let value = initialValue;\r\n        for (const element of iterable) {\r\n            value = reducer(value, element);\r\n        }\r\n        return value;\r\n    }\r\n    Iterable.reduce = reduce;\r\n    /**\r\n     * Returns an iterable slice of the array, with the same semantics as `array.slice()`.\r\n     */\r\n    function* slice(arr, from, to = arr.length) {\r\n        if (from < 0) {\r\n            from += arr.length;\r\n        }\r\n        if (to < 0) {\r\n            to += arr.length;\r\n        }\r\n        else if (to > arr.length) {\r\n            to = arr.length;\r\n        }\r\n        for (; from < to; from++) {\r\n            yield arr[from];\r\n        }\r\n    }\r\n    Iterable.slice = slice;\r\n    /**\r\n     * Consumes `atMost` elements from iterable and returns the consumed elements,\r\n     * and an iterable for the rest of the elements.\r\n     */\r\n    function consume(iterable, atMost = Number.POSITIVE_INFINITY) {\r\n        const consumed = [];\r\n        if (atMost === 0) {\r\n            return [consumed, iterable];\r\n        }\r\n        const iterator = iterable[Symbol.iterator]();\r\n        for (let i = 0; i < atMost; i++) {\r\n            const next = iterator.next();\r\n            if (next.done) {\r\n                return [consumed, Iterable.empty()];\r\n            }\r\n            consumed.push(next.value);\r\n        }\r\n        return [consumed, { [Symbol.iterator]() { return iterator; } }];\r\n    }\r\n    Iterable.consume = consume;\r\n    /**\r\n     * Returns whether the iterables are the same length and all items are\r\n     * equal using the comparator function.\r\n     */\r\n    function equals(a, b, comparator = (at, bt) => at === bt) {\r\n        const ai = a[Symbol.iterator]();\r\n        const bi = b[Symbol.iterator]();\r\n        while (true) {\r\n            const an = ai.next();\r\n            const bn = bi.next();\r\n            if (an.done !== bn.done) {\r\n                return false;\r\n            }\r\n            else if (an.done) {\r\n                return true;\r\n            }\r\n            else if (!comparator(an.value, bn.value)) {\r\n                return false;\r\n            }\r\n        }\r\n    }\r\n    Iterable.equals = equals;\r\n})(Iterable || (Iterable = {}));\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/iterator.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js":
/*!*******************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"KeyCodeUtils\": () => (/* binding */ KeyCodeUtils),\n/* harmony export */   \"KeyChord\": () => (/* binding */ KeyChord),\n/* harmony export */   \"createKeybinding\": () => (/* binding */ createKeybinding),\n/* harmony export */   \"createSimpleKeybinding\": () => (/* binding */ createSimpleKeybinding),\n/* harmony export */   \"SimpleKeybinding\": () => (/* binding */ SimpleKeybinding),\n/* harmony export */   \"ChordKeybinding\": () => (/* binding */ ChordKeybinding),\n/* harmony export */   \"ResolvedKeybindingPart\": () => (/* binding */ ResolvedKeybindingPart),\n/* harmony export */   \"ResolvedKeybinding\": () => (/* binding */ ResolvedKeybinding)\n/* harmony export */ });\n/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ \"./node_modules/monaco-editor/esm/vs/base/common/errors.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nclass KeyCodeStrMap {\r\n    constructor() {\r\n        this._keyCodeToStr = [];\r\n        this._strToKeyCode = Object.create(null);\r\n    }\r\n    define(keyCode, str) {\r\n        this._keyCodeToStr[keyCode] = str;\r\n        this._strToKeyCode[str.toLowerCase()] = keyCode;\r\n    }\r\n    keyCodeToStr(keyCode) {\r\n        return this._keyCodeToStr[keyCode];\r\n    }\r\n    strToKeyCode(str) {\r\n        return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */;\r\n    }\r\n}\r\nconst uiMap = new KeyCodeStrMap();\r\nconst userSettingsUSMap = new KeyCodeStrMap();\r\nconst userSettingsGeneralMap = new KeyCodeStrMap();\r\n(function () {\r\n    function define(keyCode, uiLabel, usUserSettingsLabel = uiLabel, generalUserSettingsLabel = usUserSettingsLabel) {\r\n        uiMap.define(keyCode, uiLabel);\r\n        userSettingsUSMap.define(keyCode, usUserSettingsLabel);\r\n        userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel);\r\n    }\r\n    define(0 /* Unknown */, 'unknown');\r\n    define(1 /* Backspace */, 'Backspace');\r\n    define(2 /* Tab */, 'Tab');\r\n    define(3 /* Enter */, 'Enter');\r\n    define(4 /* Shift */, 'Shift');\r\n    define(5 /* Ctrl */, 'Ctrl');\r\n    define(6 /* Alt */, 'Alt');\r\n    define(7 /* PauseBreak */, 'PauseBreak');\r\n    define(8 /* CapsLock */, 'CapsLock');\r\n    define(9 /* Escape */, 'Escape');\r\n    define(10 /* Space */, 'Space');\r\n    define(11 /* PageUp */, 'PageUp');\r\n    define(12 /* PageDown */, 'PageDown');\r\n    define(13 /* End */, 'End');\r\n    define(14 /* Home */, 'Home');\r\n    define(15 /* LeftArrow */, 'LeftArrow', 'Left');\r\n    define(16 /* UpArrow */, 'UpArrow', 'Up');\r\n    define(17 /* RightArrow */, 'RightArrow', 'Right');\r\n    define(18 /* DownArrow */, 'DownArrow', 'Down');\r\n    define(19 /* Insert */, 'Insert');\r\n    define(20 /* Delete */, 'Delete');\r\n    define(21 /* KEY_0 */, '0');\r\n    define(22 /* KEY_1 */, '1');\r\n    define(23 /* KEY_2 */, '2');\r\n    define(24 /* KEY_3 */, '3');\r\n    define(25 /* KEY_4 */, '4');\r\n    define(26 /* KEY_5 */, '5');\r\n    define(27 /* KEY_6 */, '6');\r\n    define(28 /* KEY_7 */, '7');\r\n    define(29 /* KEY_8 */, '8');\r\n    define(30 /* KEY_9 */, '9');\r\n    define(31 /* KEY_A */, 'A');\r\n    define(32 /* KEY_B */, 'B');\r\n    define(33 /* KEY_C */, 'C');\r\n    define(34 /* KEY_D */, 'D');\r\n    define(35 /* KEY_E */, 'E');\r\n    define(36 /* KEY_F */, 'F');\r\n    define(37 /* KEY_G */, 'G');\r\n    define(38 /* KEY_H */, 'H');\r\n    define(39 /* KEY_I */, 'I');\r\n    define(40 /* KEY_J */, 'J');\r\n    define(41 /* KEY_K */, 'K');\r\n    define(42 /* KEY_L */, 'L');\r\n    define(43 /* KEY_M */, 'M');\r\n    define(44 /* KEY_N */, 'N');\r\n    define(45 /* KEY_O */, 'O');\r\n    define(46 /* KEY_P */, 'P');\r\n    define(47 /* KEY_Q */, 'Q');\r\n    define(48 /* KEY_R */, 'R');\r\n    define(49 /* KEY_S */, 'S');\r\n    define(50 /* KEY_T */, 'T');\r\n    define(51 /* KEY_U */, 'U');\r\n    define(52 /* KEY_V */, 'V');\r\n    define(53 /* KEY_W */, 'W');\r\n    define(54 /* KEY_X */, 'X');\r\n    define(55 /* KEY_Y */, 'Y');\r\n    define(56 /* KEY_Z */, 'Z');\r\n    define(57 /* Meta */, 'Meta');\r\n    define(58 /* ContextMenu */, 'ContextMenu');\r\n    define(59 /* F1 */, 'F1');\r\n    define(60 /* F2 */, 'F2');\r\n    define(61 /* F3 */, 'F3');\r\n    define(62 /* F4 */, 'F4');\r\n    define(63 /* F5 */, 'F5');\r\n    define(64 /* F6 */, 'F6');\r\n    define(65 /* F7 */, 'F7');\r\n    define(66 /* F8 */, 'F8');\r\n    define(67 /* F9 */, 'F9');\r\n    define(68 /* F10 */, 'F10');\r\n    define(69 /* F11 */, 'F11');\r\n    define(70 /* F12 */, 'F12');\r\n    define(71 /* F13 */, 'F13');\r\n    define(72 /* F14 */, 'F14');\r\n    define(73 /* F15 */, 'F15');\r\n    define(74 /* F16 */, 'F16');\r\n    define(75 /* F17 */, 'F17');\r\n    define(76 /* F18 */, 'F18');\r\n    define(77 /* F19 */, 'F19');\r\n    define(78 /* NumLock */, 'NumLock');\r\n    define(79 /* ScrollLock */, 'ScrollLock');\r\n    define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1');\r\n    define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS');\r\n    define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA');\r\n    define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS');\r\n    define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD');\r\n    define(85 /* US_SLASH */, '/', '/', 'OEM_2');\r\n    define(86 /* US_BACKTICK */, '`', '`', 'OEM_3');\r\n    define(110 /* ABNT_C1 */, 'ABNT_C1');\r\n    define(111 /* ABNT_C2 */, 'ABNT_C2');\r\n    define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4');\r\n    define(88 /* US_BACKSLASH */, '\\\\', '\\\\', 'OEM_5');\r\n    define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6');\r\n    define(90 /* US_QUOTE */, '\\'', '\\'', 'OEM_7');\r\n    define(91 /* OEM_8 */, 'OEM_8');\r\n    define(92 /* OEM_102 */, 'OEM_102');\r\n    define(93 /* NUMPAD_0 */, 'NumPad0');\r\n    define(94 /* NUMPAD_1 */, 'NumPad1');\r\n    define(95 /* NUMPAD_2 */, 'NumPad2');\r\n    define(96 /* NUMPAD_3 */, 'NumPad3');\r\n    define(97 /* NUMPAD_4 */, 'NumPad4');\r\n    define(98 /* NUMPAD_5 */, 'NumPad5');\r\n    define(99 /* NUMPAD_6 */, 'NumPad6');\r\n    define(100 /* NUMPAD_7 */, 'NumPad7');\r\n    define(101 /* NUMPAD_8 */, 'NumPad8');\r\n    define(102 /* NUMPAD_9 */, 'NumPad9');\r\n    define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply');\r\n    define(104 /* NUMPAD_ADD */, 'NumPad_Add');\r\n    define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator');\r\n    define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract');\r\n    define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal');\r\n    define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide');\r\n})();\r\nvar KeyCodeUtils;\r\n(function (KeyCodeUtils) {\r\n    function toString(keyCode) {\r\n        return uiMap.keyCodeToStr(keyCode);\r\n    }\r\n    KeyCodeUtils.toString = toString;\r\n    function fromString(key) {\r\n        return uiMap.strToKeyCode(key);\r\n    }\r\n    KeyCodeUtils.fromString = fromString;\r\n    function toUserSettingsUS(keyCode) {\r\n        return userSettingsUSMap.keyCodeToStr(keyCode);\r\n    }\r\n    KeyCodeUtils.toUserSettingsUS = toUserSettingsUS;\r\n    function toUserSettingsGeneral(keyCode) {\r\n        return userSettingsGeneralMap.keyCodeToStr(keyCode);\r\n    }\r\n    KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral;\r\n    function fromUserSettings(key) {\r\n        return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key);\r\n    }\r\n    KeyCodeUtils.fromUserSettings = fromUserSettings;\r\n})(KeyCodeUtils || (KeyCodeUtils = {}));\r\nfunction KeyChord(firstPart, secondPart) {\r\n    const chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0;\r\n    return (firstPart | chordPart) >>> 0;\r\n}\r\nfunction createKeybinding(keybinding, OS) {\r\n    if (keybinding === 0) {\r\n        return null;\r\n    }\r\n    const firstPart = (keybinding & 0x0000FFFF) >>> 0;\r\n    const chordPart = (keybinding & 0xFFFF0000) >>> 16;\r\n    if (chordPart !== 0) {\r\n        return new ChordKeybinding([\r\n            createSimpleKeybinding(firstPart, OS),\r\n            createSimpleKeybinding(chordPart, OS)\r\n        ]);\r\n    }\r\n    return new ChordKeybinding([createSimpleKeybinding(firstPart, OS)]);\r\n}\r\nfunction createSimpleKeybinding(keybinding, OS) {\r\n    const ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false);\r\n    const winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false);\r\n    const ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd);\r\n    const shiftKey = (keybinding & 1024 /* Shift */ ? true : false);\r\n    const altKey = (keybinding & 512 /* Alt */ ? true : false);\r\n    const metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl);\r\n    const keyCode = (keybinding & 255 /* KeyCode */);\r\n    return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode);\r\n}\r\nclass SimpleKeybinding {\r\n    constructor(ctrlKey, shiftKey, altKey, metaKey, keyCode) {\r\n        this.ctrlKey = ctrlKey;\r\n        this.shiftKey = shiftKey;\r\n        this.altKey = altKey;\r\n        this.metaKey = metaKey;\r\n        this.keyCode = keyCode;\r\n    }\r\n    equals(other) {\r\n        return (this.ctrlKey === other.ctrlKey\r\n            && this.shiftKey === other.shiftKey\r\n            && this.altKey === other.altKey\r\n            && this.metaKey === other.metaKey\r\n            && this.keyCode === other.keyCode);\r\n    }\r\n    isModifierKey() {\r\n        return (this.keyCode === 0 /* Unknown */\r\n            || this.keyCode === 5 /* Ctrl */\r\n            || this.keyCode === 57 /* Meta */\r\n            || this.keyCode === 6 /* Alt */\r\n            || this.keyCode === 4 /* Shift */);\r\n    }\r\n    toChord() {\r\n        return new ChordKeybinding([this]);\r\n    }\r\n    /**\r\n     * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?\r\n     */\r\n    isDuplicateModifierCase() {\r\n        return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */)\r\n            || (this.shiftKey && this.keyCode === 4 /* Shift */)\r\n            || (this.altKey && this.keyCode === 6 /* Alt */)\r\n            || (this.metaKey && this.keyCode === 57 /* Meta */));\r\n    }\r\n}\r\nclass ChordKeybinding {\r\n    constructor(parts) {\r\n        if (parts.length === 0) {\r\n            throw (0,_errors_js__WEBPACK_IMPORTED_MODULE_0__.illegalArgument)(`parts`);\r\n        }\r\n        this.parts = parts;\r\n    }\r\n}\r\nclass ResolvedKeybindingPart {\r\n    constructor(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) {\r\n        this.ctrlKey = ctrlKey;\r\n        this.shiftKey = shiftKey;\r\n        this.altKey = altKey;\r\n        this.metaKey = metaKey;\r\n        this.keyLabel = kbLabel;\r\n        this.keyAriaLabel = kbAriaLabel;\r\n    }\r\n}\r\n/**\r\n * A resolved keybinding. Can be a simple keybinding or a chord keybinding.\r\n */\r\nclass ResolvedKeybinding {\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js":
/*!********************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"trackDisposable\": () => (/* binding */ trackDisposable),\n/* harmony export */   \"MultiDisposeError\": () => (/* binding */ MultiDisposeError),\n/* harmony export */   \"isDisposable\": () => (/* binding */ isDisposable),\n/* harmony export */   \"dispose\": () => (/* binding */ dispose),\n/* harmony export */   \"combinedDisposable\": () => (/* binding */ combinedDisposable),\n/* harmony export */   \"toDisposable\": () => (/* binding */ toDisposable),\n/* harmony export */   \"DisposableStore\": () => (/* binding */ DisposableStore),\n/* harmony export */   \"Disposable\": () => (/* binding */ Disposable),\n/* harmony export */   \"MutableDisposable\": () => (/* binding */ MutableDisposable),\n/* harmony export */   \"ImmortalReference\": () => (/* binding */ ImmortalReference)\n/* harmony export */ });\n/* harmony import */ var _iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./iterator.js */ \"./node_modules/monaco-editor/esm/vs/base/common/iterator.js\");\n\r\n/**\r\n * Enables logging of potentially leaked disposables.\r\n *\r\n * A disposable is considered leaked if it is not disposed or not registered as the child of\r\n * another disposable. This tracking is very simple an only works for classes that either\r\n * extend Disposable or use a DisposableStore. This means there are a lot of false positives.\r\n */\r\nconst TRACK_DISPOSABLES = false;\r\nlet disposableTracker = null;\r\nif (TRACK_DISPOSABLES) {\r\n    const __is_disposable_tracked__ = '__is_disposable_tracked__';\r\n    disposableTracker = new class {\r\n        trackDisposable(x) {\r\n            const stack = new Error('Potentially leaked disposable').stack;\r\n            setTimeout(() => {\r\n                if (!x[__is_disposable_tracked__]) {\r\n                    console.log(stack);\r\n                }\r\n            }, 3000);\r\n        }\r\n        markTracked(x) {\r\n            if (x && x !== Disposable.None) {\r\n                try {\r\n                    x[__is_disposable_tracked__] = true;\r\n                }\r\n                catch (_a) {\r\n                    // noop\r\n                }\r\n            }\r\n        }\r\n    };\r\n}\r\nfunction markTracked(x) {\r\n    if (!disposableTracker) {\r\n        return;\r\n    }\r\n    disposableTracker.markTracked(x);\r\n}\r\nfunction trackDisposable(x) {\r\n    if (!disposableTracker) {\r\n        return x;\r\n    }\r\n    disposableTracker.trackDisposable(x);\r\n    return x;\r\n}\r\nclass MultiDisposeError extends Error {\r\n    constructor(errors) {\r\n        super(`Encountered errors while disposing of store. Errors: [${errors.join(', ')}]`);\r\n        this.errors = errors;\r\n    }\r\n}\r\nfunction isDisposable(thing) {\r\n    return typeof thing.dispose === 'function' && thing.dispose.length === 0;\r\n}\r\nfunction dispose(arg) {\r\n    if (_iterator_js__WEBPACK_IMPORTED_MODULE_0__.Iterable.is(arg)) {\r\n        let errors = [];\r\n        for (const d of arg) {\r\n            if (d) {\r\n                markTracked(d);\r\n                try {\r\n                    d.dispose();\r\n                }\r\n                catch (e) {\r\n                    errors.push(e);\r\n                }\r\n            }\r\n        }\r\n        if (errors.length === 1) {\r\n            throw errors[0];\r\n        }\r\n        else if (errors.length > 1) {\r\n            throw new MultiDisposeError(errors);\r\n        }\r\n        return Array.isArray(arg) ? [] : arg;\r\n    }\r\n    else if (arg) {\r\n        markTracked(arg);\r\n        arg.dispose();\r\n        return arg;\r\n    }\r\n}\r\nfunction combinedDisposable(...disposables) {\r\n    disposables.forEach(markTracked);\r\n    return toDisposable(() => dispose(disposables));\r\n}\r\nfunction toDisposable(fn) {\r\n    const self = trackDisposable({\r\n        dispose: () => {\r\n            markTracked(self);\r\n            fn();\r\n        }\r\n    });\r\n    return self;\r\n}\r\nclass DisposableStore {\r\n    constructor() {\r\n        this._toDispose = new Set();\r\n        this._isDisposed = false;\r\n    }\r\n    /**\r\n     * Dispose of all registered disposables and mark this object as disposed.\r\n     *\r\n     * Any future disposables added to this object will be disposed of on `add`.\r\n     */\r\n    dispose() {\r\n        if (this._isDisposed) {\r\n            return;\r\n        }\r\n        markTracked(this);\r\n        this._isDisposed = true;\r\n        this.clear();\r\n    }\r\n    /**\r\n     * Dispose of all registered disposables but do not mark this object as disposed.\r\n     */\r\n    clear() {\r\n        try {\r\n            dispose(this._toDispose.values());\r\n        }\r\n        finally {\r\n            this._toDispose.clear();\r\n        }\r\n    }\r\n    add(t) {\r\n        if (!t) {\r\n            return t;\r\n        }\r\n        if (t === this) {\r\n            throw new Error('Cannot register a disposable on itself!');\r\n        }\r\n        markTracked(t);\r\n        if (this._isDisposed) {\r\n            if (!DisposableStore.DISABLE_DISPOSED_WARNING) {\r\n                console.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack);\r\n            }\r\n        }\r\n        else {\r\n            this._toDispose.add(t);\r\n        }\r\n        return t;\r\n    }\r\n}\r\nDisposableStore.DISABLE_DISPOSED_WARNING = false;\r\nclass Disposable {\r\n    constructor() {\r\n        this._store = new DisposableStore();\r\n        trackDisposable(this);\r\n    }\r\n    dispose() {\r\n        markTracked(this);\r\n        this._store.dispose();\r\n    }\r\n    _register(t) {\r\n        if (t === this) {\r\n            throw new Error('Cannot register a disposable on itself!');\r\n        }\r\n        return this._store.add(t);\r\n    }\r\n}\r\nDisposable.None = Object.freeze({ dispose() { } });\r\n/**\r\n * Manages the lifecycle of a disposable value that may be changed.\r\n *\r\n * This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can\r\n * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.\r\n */\r\nclass MutableDisposable {\r\n    constructor() {\r\n        this._isDisposed = false;\r\n        trackDisposable(this);\r\n    }\r\n    get value() {\r\n        return this._isDisposed ? undefined : this._value;\r\n    }\r\n    set value(value) {\r\n        var _a;\r\n        if (this._isDisposed || value === this._value) {\r\n            return;\r\n        }\r\n        (_a = this._value) === null || _a === void 0 ? void 0 : _a.dispose();\r\n        if (value) {\r\n            markTracked(value);\r\n        }\r\n        this._value = value;\r\n    }\r\n    clear() {\r\n        this.value = undefined;\r\n    }\r\n    dispose() {\r\n        var _a;\r\n        this._isDisposed = true;\r\n        markTracked(this);\r\n        (_a = this._value) === null || _a === void 0 ? void 0 : _a.dispose();\r\n        this._value = undefined;\r\n    }\r\n}\r\nclass ImmortalReference {\r\n    constructor(object) {\r\n        this.object = object;\r\n    }\r\n    dispose() { }\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js":
/*!*********************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/linkedList.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"LinkedList\": () => (/* binding */ LinkedList)\n/* harmony export */ });\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nclass Node {\r\n    constructor(element) {\r\n        this.element = element;\r\n        this.next = Node.Undefined;\r\n        this.prev = Node.Undefined;\r\n    }\r\n}\r\nNode.Undefined = new Node(undefined);\r\nclass LinkedList {\r\n    constructor() {\r\n        this._first = Node.Undefined;\r\n        this._last = Node.Undefined;\r\n        this._size = 0;\r\n    }\r\n    get size() {\r\n        return this._size;\r\n    }\r\n    isEmpty() {\r\n        return this._first === Node.Undefined;\r\n    }\r\n    clear() {\r\n        this._first = Node.Undefined;\r\n        this._last = Node.Undefined;\r\n        this._size = 0;\r\n    }\r\n    unshift(element) {\r\n        return this._insert(element, false);\r\n    }\r\n    push(element) {\r\n        return this._insert(element, true);\r\n    }\r\n    _insert(element, atTheEnd) {\r\n        const newNode = new Node(element);\r\n        if (this._first === Node.Undefined) {\r\n            this._first = newNode;\r\n            this._last = newNode;\r\n        }\r\n        else if (atTheEnd) {\r\n            // push\r\n            const oldLast = this._last;\r\n            this._last = newNode;\r\n            newNode.prev = oldLast;\r\n            oldLast.next = newNode;\r\n        }\r\n        else {\r\n            // unshift\r\n            const oldFirst = this._first;\r\n            this._first = newNode;\r\n            newNode.next = oldFirst;\r\n            oldFirst.prev = newNode;\r\n        }\r\n        this._size += 1;\r\n        let didRemove = false;\r\n        return () => {\r\n            if (!didRemove) {\r\n                didRemove = true;\r\n                this._remove(newNode);\r\n            }\r\n        };\r\n    }\r\n    shift() {\r\n        if (this._first === Node.Undefined) {\r\n            return undefined;\r\n        }\r\n        else {\r\n            const res = this._first.element;\r\n            this._remove(this._first);\r\n            return res;\r\n        }\r\n    }\r\n    pop() {\r\n        if (this._last === Node.Undefined) {\r\n            return undefined;\r\n        }\r\n        else {\r\n            const res = this._last.element;\r\n            this._remove(this._last);\r\n            return res;\r\n        }\r\n    }\r\n    _remove(node) {\r\n        if (node.prev !== Node.Undefined && node.next !== Node.Undefined) {\r\n            // middle\r\n            const anchor = node.prev;\r\n            anchor.next = node.next;\r\n            node.next.prev = anchor;\r\n        }\r\n        else if (node.prev === Node.Undefined && node.next === Node.Undefined) {\r\n            // only node\r\n            this._first = Node.Undefined;\r\n            this._last = Node.Undefined;\r\n        }\r\n        else if (node.next === Node.Undefined) {\r\n            // last\r\n            this._last = this._last.prev;\r\n            this._last.next = Node.Undefined;\r\n        }\r\n        else if (node.prev === Node.Undefined) {\r\n            // first\r\n            this._first = this._first.next;\r\n            this._first.prev = Node.Undefined;\r\n        }\r\n        // done\r\n        this._size -= 1;\r\n    }\r\n    *[Symbol.iterator]() {\r\n        let node = this._first;\r\n        while (node !== Node.Undefined) {\r\n            yield node.element;\r\n            node = node.next;\r\n        }\r\n    }\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/linkedList.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/path.js":
/*!***************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/path.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"win32\": () => (/* binding */ win32),\n/* harmony export */   \"posix\": () => (/* binding */ posix),\n/* harmony export */   \"normalize\": () => (/* binding */ normalize),\n/* harmony export */   \"resolve\": () => (/* binding */ resolve),\n/* harmony export */   \"relative\": () => (/* binding */ relative),\n/* harmony export */   \"dirname\": () => (/* binding */ dirname),\n/* harmony export */   \"basename\": () => (/* binding */ basename),\n/* harmony export */   \"extname\": () => (/* binding */ extname),\n/* harmony export */   \"sep\": () => (/* binding */ sep)\n/* harmony export */ });\n/* harmony import */ var _process_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./process.js */ \"./node_modules/monaco-editor/esm/vs/base/common/process.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n// NOTE: VSCode's copy of nodejs path library to be usable in common (non-node) namespace\r\n// Copied from: https://github.com/nodejs/node/blob/v12.8.1/lib/path.js\r\n/**\r\n * Copyright Joyent, Inc. and other Node contributors.\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a\r\n * copy of this software and associated documentation files (the\r\n * \"Software\"), to deal in the Software without restriction, including\r\n * without limitation the rights to use, copy, modify, merge, publish,\r\n * distribute, sublicense, and/or sell copies of the Software, and to permit\r\n * persons to whom the Software is furnished to do so, subject to the\r\n * following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included\r\n * in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\r\n * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\r\n * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\r\n * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\r\n * USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nconst CHAR_UPPERCASE_A = 65; /* A */\r\nconst CHAR_LOWERCASE_A = 97; /* a */\r\nconst CHAR_UPPERCASE_Z = 90; /* Z */\r\nconst CHAR_LOWERCASE_Z = 122; /* z */\r\nconst CHAR_DOT = 46; /* . */\r\nconst CHAR_FORWARD_SLASH = 47; /* / */\r\nconst CHAR_BACKWARD_SLASH = 92; /* \\ */\r\nconst CHAR_COLON = 58; /* : */\r\nconst CHAR_QUESTION_MARK = 63; /* ? */\r\nclass ErrorInvalidArgType extends Error {\r\n    constructor(name, expected, actual) {\r\n        // determiner: 'must be' or 'must not be'\r\n        let determiner;\r\n        if (typeof expected === 'string' && expected.indexOf('not ') === 0) {\r\n            determiner = 'must not be';\r\n            expected = expected.replace(/^not /, '');\r\n        }\r\n        else {\r\n            determiner = 'must be';\r\n        }\r\n        const type = name.indexOf('.') !== -1 ? 'property' : 'argument';\r\n        let msg = `The \"${name}\" ${type} ${determiner} of type ${expected}`;\r\n        msg += `. Received type ${typeof actual}`;\r\n        super(msg);\r\n        this.code = 'ERR_INVALID_ARG_TYPE';\r\n    }\r\n}\r\nfunction validateString(value, name) {\r\n    if (typeof value !== 'string') {\r\n        throw new ErrorInvalidArgType(name, 'string', value);\r\n    }\r\n}\r\nfunction isPathSeparator(code) {\r\n    return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;\r\n}\r\nfunction isPosixPathSeparator(code) {\r\n    return code === CHAR_FORWARD_SLASH;\r\n}\r\nfunction isWindowsDeviceRoot(code) {\r\n    return code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z ||\r\n        code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z;\r\n}\r\n// Resolves . and .. elements in a path with directory names\r\nfunction normalizeString(path, allowAboveRoot, separator, isPathSeparator) {\r\n    let res = '';\r\n    let lastSegmentLength = 0;\r\n    let lastSlash = -1;\r\n    let dots = 0;\r\n    let code = 0;\r\n    for (let i = 0; i <= path.length; ++i) {\r\n        if (i < path.length) {\r\n            code = path.charCodeAt(i);\r\n        }\r\n        else if (isPathSeparator(code)) {\r\n            break;\r\n        }\r\n        else {\r\n            code = CHAR_FORWARD_SLASH;\r\n        }\r\n        if (isPathSeparator(code)) {\r\n            if (lastSlash === i - 1 || dots === 1) {\r\n                // NOOP\r\n            }\r\n            else if (dots === 2) {\r\n                if (res.length < 2 || lastSegmentLength !== 2 ||\r\n                    res.charCodeAt(res.length - 1) !== CHAR_DOT ||\r\n                    res.charCodeAt(res.length - 2) !== CHAR_DOT) {\r\n                    if (res.length > 2) {\r\n                        const lastSlashIndex = res.lastIndexOf(separator);\r\n                        if (lastSlashIndex === -1) {\r\n                            res = '';\r\n                            lastSegmentLength = 0;\r\n                        }\r\n                        else {\r\n                            res = res.slice(0, lastSlashIndex);\r\n                            lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);\r\n                        }\r\n                        lastSlash = i;\r\n                        dots = 0;\r\n                        continue;\r\n                    }\r\n                    else if (res.length !== 0) {\r\n                        res = '';\r\n                        lastSegmentLength = 0;\r\n                        lastSlash = i;\r\n                        dots = 0;\r\n                        continue;\r\n                    }\r\n                }\r\n                if (allowAboveRoot) {\r\n                    res += res.length > 0 ? `${separator}..` : '..';\r\n                    lastSegmentLength = 2;\r\n                }\r\n            }\r\n            else {\r\n                if (res.length > 0) {\r\n                    res += `${separator}${path.slice(lastSlash + 1, i)}`;\r\n                }\r\n                else {\r\n                    res = path.slice(lastSlash + 1, i);\r\n                }\r\n                lastSegmentLength = i - lastSlash - 1;\r\n            }\r\n            lastSlash = i;\r\n            dots = 0;\r\n        }\r\n        else if (code === CHAR_DOT && dots !== -1) {\r\n            ++dots;\r\n        }\r\n        else {\r\n            dots = -1;\r\n        }\r\n    }\r\n    return res;\r\n}\r\nfunction _format(sep, pathObject) {\r\n    if (pathObject === null || typeof pathObject !== 'object') {\r\n        throw new ErrorInvalidArgType('pathObject', 'Object', pathObject);\r\n    }\r\n    const dir = pathObject.dir || pathObject.root;\r\n    const base = pathObject.base ||\r\n        `${pathObject.name || ''}${pathObject.ext || ''}`;\r\n    if (!dir) {\r\n        return base;\r\n    }\r\n    return dir === pathObject.root ? `${dir}${base}` : `${dir}${sep}${base}`;\r\n}\r\nconst win32 = {\r\n    // path.resolve([from ...], to)\r\n    resolve(...pathSegments) {\r\n        let resolvedDevice = '';\r\n        let resolvedTail = '';\r\n        let resolvedAbsolute = false;\r\n        for (let i = pathSegments.length - 1; i >= -1; i--) {\r\n            let path;\r\n            if (i >= 0) {\r\n                path = pathSegments[i];\r\n                validateString(path, 'path');\r\n                // Skip empty entries\r\n                if (path.length === 0) {\r\n                    continue;\r\n                }\r\n            }\r\n            else if (resolvedDevice.length === 0) {\r\n                path = _process_js__WEBPACK_IMPORTED_MODULE_0__.cwd();\r\n            }\r\n            else {\r\n                // Windows has the concept of drive-specific current working\r\n                // directories. If we've resolved a drive letter but not yet an\r\n                // absolute path, get cwd for that drive, or the process cwd if\r\n                // the drive cwd is not available. We're sure the device is not\r\n                // a UNC path at this points, because UNC paths are always absolute.\r\n                path = _process_js__WEBPACK_IMPORTED_MODULE_0__.env[`=${resolvedDevice}`] || _process_js__WEBPACK_IMPORTED_MODULE_0__.cwd();\r\n                // Verify that a cwd was found and that it actually points\r\n                // to our drive. If not, default to the drive's root.\r\n                if (path === undefined ||\r\n                    path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() &&\r\n                        path.charCodeAt(2) === CHAR_BACKWARD_SLASH) {\r\n                    path = `${resolvedDevice}\\\\`;\r\n                }\r\n            }\r\n            const len = path.length;\r\n            let rootEnd = 0;\r\n            let device = '';\r\n            let isAbsolute = false;\r\n            const code = path.charCodeAt(0);\r\n            // Try to match a root\r\n            if (len === 1) {\r\n                if (isPathSeparator(code)) {\r\n                    // `path` contains just a path separator\r\n                    rootEnd = 1;\r\n                    isAbsolute = true;\r\n                }\r\n            }\r\n            else if (isPathSeparator(code)) {\r\n                // Possible UNC root\r\n                // If we started with a separator, we know we at least have an\r\n                // absolute path of some kind (UNC or otherwise)\r\n                isAbsolute = true;\r\n                if (isPathSeparator(path.charCodeAt(1))) {\r\n                    // Matched double path separator at beginning\r\n                    let j = 2;\r\n                    let last = j;\r\n                    // Match 1 or more non-path separators\r\n                    while (j < len && !isPathSeparator(path.charCodeAt(j))) {\r\n                        j++;\r\n                    }\r\n                    if (j < len && j !== last) {\r\n                        const firstPart = path.slice(last, j);\r\n                        // Matched!\r\n                        last = j;\r\n                        // Match 1 or more path separators\r\n                        while (j < len && isPathSeparator(path.charCodeAt(j))) {\r\n                            j++;\r\n                        }\r\n                        if (j < len && j !== last) {\r\n                            // Matched!\r\n                            last = j;\r\n                            // Match 1 or more non-path separators\r\n                            while (j < len && !isPathSeparator(path.charCodeAt(j))) {\r\n                                j++;\r\n                            }\r\n                            if (j === len || j !== last) {\r\n                                // We matched a UNC root\r\n                                device = `\\\\\\\\${firstPart}\\\\${path.slice(last, j)}`;\r\n                                rootEnd = j;\r\n                            }\r\n                        }\r\n                    }\r\n                }\r\n                else {\r\n                    rootEnd = 1;\r\n                }\r\n            }\r\n            else if (isWindowsDeviceRoot(code) &&\r\n                path.charCodeAt(1) === CHAR_COLON) {\r\n                // Possible device root\r\n                device = path.slice(0, 2);\r\n                rootEnd = 2;\r\n                if (len > 2 && isPathSeparator(path.charCodeAt(2))) {\r\n                    // Treat separator following drive name as an absolute path\r\n                    // indicator\r\n                    isAbsolute = true;\r\n                    rootEnd = 3;\r\n                }\r\n            }\r\n            if (device.length > 0) {\r\n                if (resolvedDevice.length > 0) {\r\n                    if (device.toLowerCase() !== resolvedDevice.toLowerCase()) {\r\n                        // This path points to another device so it is not applicable\r\n                        continue;\r\n                    }\r\n                }\r\n                else {\r\n                    resolvedDevice = device;\r\n                }\r\n            }\r\n            if (resolvedAbsolute) {\r\n                if (resolvedDevice.length > 0) {\r\n                    break;\r\n                }\r\n            }\r\n            else {\r\n                resolvedTail = `${path.slice(rootEnd)}\\\\${resolvedTail}`;\r\n                resolvedAbsolute = isAbsolute;\r\n                if (isAbsolute && resolvedDevice.length > 0) {\r\n                    break;\r\n                }\r\n            }\r\n        }\r\n        // At this point the path should be resolved to a full absolute path,\r\n        // but handle relative paths to be safe (might happen when process.cwd()\r\n        // fails)\r\n        // Normalize the tail path\r\n        resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\\\', isPathSeparator);\r\n        return resolvedAbsolute ?\r\n            `${resolvedDevice}\\\\${resolvedTail}` :\r\n            `${resolvedDevice}${resolvedTail}` || '.';\r\n    },\r\n    normalize(path) {\r\n        validateString(path, 'path');\r\n        const len = path.length;\r\n        if (len === 0) {\r\n            return '.';\r\n        }\r\n        let rootEnd = 0;\r\n        let device;\r\n        let isAbsolute = false;\r\n        const code = path.charCodeAt(0);\r\n        // Try to match a root\r\n        if (len === 1) {\r\n            // `path` contains just a single char, exit early to avoid\r\n            // unnecessary work\r\n            return isPosixPathSeparator(code) ? '\\\\' : path;\r\n        }\r\n        if (isPathSeparator(code)) {\r\n            // Possible UNC root\r\n            // If we started with a separator, we know we at least have an absolute\r\n            // path of some kind (UNC or otherwise)\r\n            isAbsolute = true;\r\n            if (isPathSeparator(path.charCodeAt(1))) {\r\n                // Matched double path separator at beginning\r\n                let j = 2;\r\n                let last = j;\r\n                // Match 1 or more non-path separators\r\n                while (j < len && !isPathSeparator(path.charCodeAt(j))) {\r\n                    j++;\r\n                }\r\n                if (j < len && j !== last) {\r\n                    const firstPart = path.slice(last, j);\r\n                    // Matched!\r\n                    last = j;\r\n                    // Match 1 or more path separators\r\n                    while (j < len && isPathSeparator(path.charCodeAt(j))) {\r\n                        j++;\r\n                    }\r\n                    if (j < len && j !== last) {\r\n                        // Matched!\r\n                        last = j;\r\n                        // Match 1 or more non-path separators\r\n                        while (j < len && !isPathSeparator(path.charCodeAt(j))) {\r\n                            j++;\r\n                        }\r\n                        if (j === len) {\r\n                            // We matched a UNC root only\r\n                            // Return the normalized version of the UNC root since there\r\n                            // is nothing left to process\r\n                            return `\\\\\\\\${firstPart}\\\\${path.slice(last)}\\\\`;\r\n                        }\r\n                        if (j !== last) {\r\n                            // We matched a UNC root with leftovers\r\n                            device = `\\\\\\\\${firstPart}\\\\${path.slice(last, j)}`;\r\n                            rootEnd = j;\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n            else {\r\n                rootEnd = 1;\r\n            }\r\n        }\r\n        else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\r\n            // Possible device root\r\n            device = path.slice(0, 2);\r\n            rootEnd = 2;\r\n            if (len > 2 && isPathSeparator(path.charCodeAt(2))) {\r\n                // Treat separator following drive name as an absolute path\r\n                // indicator\r\n                isAbsolute = true;\r\n                rootEnd = 3;\r\n            }\r\n        }\r\n        let tail = rootEnd < len ?\r\n            normalizeString(path.slice(rootEnd), !isAbsolute, '\\\\', isPathSeparator) :\r\n            '';\r\n        if (tail.length === 0 && !isAbsolute) {\r\n            tail = '.';\r\n        }\r\n        if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) {\r\n            tail += '\\\\';\r\n        }\r\n        if (device === undefined) {\r\n            return isAbsolute ? `\\\\${tail}` : tail;\r\n        }\r\n        return isAbsolute ? `${device}\\\\${tail}` : `${device}${tail}`;\r\n    },\r\n    isAbsolute(path) {\r\n        validateString(path, 'path');\r\n        const len = path.length;\r\n        if (len === 0) {\r\n            return false;\r\n        }\r\n        const code = path.charCodeAt(0);\r\n        return isPathSeparator(code) ||\r\n            // Possible device root\r\n            len > 2 &&\r\n                isWindowsDeviceRoot(code) &&\r\n                path.charCodeAt(1) === CHAR_COLON &&\r\n                isPathSeparator(path.charCodeAt(2));\r\n    },\r\n    join(...paths) {\r\n        if (paths.length === 0) {\r\n            return '.';\r\n        }\r\n        let joined;\r\n        let firstPart;\r\n        for (let i = 0; i < paths.length; ++i) {\r\n            const arg = paths[i];\r\n            validateString(arg, 'path');\r\n            if (arg.length > 0) {\r\n                if (joined === undefined) {\r\n                    joined = firstPart = arg;\r\n                }\r\n                else {\r\n                    joined += `\\\\${arg}`;\r\n                }\r\n            }\r\n        }\r\n        if (joined === undefined) {\r\n            return '.';\r\n        }\r\n        // Make sure that the joined path doesn't start with two slashes, because\r\n        // normalize() will mistake it for an UNC path then.\r\n        //\r\n        // This step is skipped when it is very clear that the user actually\r\n        // intended to point at an UNC path. This is assumed when the first\r\n        // non-empty string arguments starts with exactly two slashes followed by\r\n        // at least one more non-slash character.\r\n        //\r\n        // Note that for normalize() to treat a path as an UNC path it needs to\r\n        // have at least 2 components, so we don't filter for that here.\r\n        // This means that the user can use join to construct UNC paths from\r\n        // a server name and a share name; for example:\r\n        //   path.join('//server', 'share') -> '\\\\\\\\server\\\\share\\\\')\r\n        let needsReplace = true;\r\n        let slashCount = 0;\r\n        if (typeof firstPart === 'string' && isPathSeparator(firstPart.charCodeAt(0))) {\r\n            ++slashCount;\r\n            const firstLen = firstPart.length;\r\n            if (firstLen > 1 && isPathSeparator(firstPart.charCodeAt(1))) {\r\n                ++slashCount;\r\n                if (firstLen > 2) {\r\n                    if (isPathSeparator(firstPart.charCodeAt(2))) {\r\n                        ++slashCount;\r\n                    }\r\n                    else {\r\n                        // We matched a UNC path in the first part\r\n                        needsReplace = false;\r\n                    }\r\n                }\r\n            }\r\n        }\r\n        if (needsReplace) {\r\n            // Find any more consecutive slashes we need to replace\r\n            while (slashCount < joined.length &&\r\n                isPathSeparator(joined.charCodeAt(slashCount))) {\r\n                slashCount++;\r\n            }\r\n            // Replace the slashes if needed\r\n            if (slashCount >= 2) {\r\n                joined = `\\\\${joined.slice(slashCount)}`;\r\n            }\r\n        }\r\n        return win32.normalize(joined);\r\n    },\r\n    // It will solve the relative path from `from` to `to`, for instance:\r\n    //  from = 'C:\\\\orandea\\\\test\\\\aaa'\r\n    //  to = 'C:\\\\orandea\\\\impl\\\\bbb'\r\n    // The output of the function should be: '..\\\\..\\\\impl\\\\bbb'\r\n    relative(from, to) {\r\n        validateString(from, 'from');\r\n        validateString(to, 'to');\r\n        if (from === to) {\r\n            return '';\r\n        }\r\n        const fromOrig = win32.resolve(from);\r\n        const toOrig = win32.resolve(to);\r\n        if (fromOrig === toOrig) {\r\n            return '';\r\n        }\r\n        from = fromOrig.toLowerCase();\r\n        to = toOrig.toLowerCase();\r\n        if (from === to) {\r\n            return '';\r\n        }\r\n        // Trim any leading backslashes\r\n        let fromStart = 0;\r\n        while (fromStart < from.length &&\r\n            from.charCodeAt(fromStart) === CHAR_BACKWARD_SLASH) {\r\n            fromStart++;\r\n        }\r\n        // Trim trailing backslashes (applicable to UNC paths only)\r\n        let fromEnd = from.length;\r\n        while (fromEnd - 1 > fromStart &&\r\n            from.charCodeAt(fromEnd - 1) === CHAR_BACKWARD_SLASH) {\r\n            fromEnd--;\r\n        }\r\n        const fromLen = fromEnd - fromStart;\r\n        // Trim any leading backslashes\r\n        let toStart = 0;\r\n        while (toStart < to.length &&\r\n            to.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {\r\n            toStart++;\r\n        }\r\n        // Trim trailing backslashes (applicable to UNC paths only)\r\n        let toEnd = to.length;\r\n        while (toEnd - 1 > toStart &&\r\n            to.charCodeAt(toEnd - 1) === CHAR_BACKWARD_SLASH) {\r\n            toEnd--;\r\n        }\r\n        const toLen = toEnd - toStart;\r\n        // Compare paths to find the longest common path from root\r\n        const length = fromLen < toLen ? fromLen : toLen;\r\n        let lastCommonSep = -1;\r\n        let i = 0;\r\n        for (; i < length; i++) {\r\n            const fromCode = from.charCodeAt(fromStart + i);\r\n            if (fromCode !== to.charCodeAt(toStart + i)) {\r\n                break;\r\n            }\r\n            else if (fromCode === CHAR_BACKWARD_SLASH) {\r\n                lastCommonSep = i;\r\n            }\r\n        }\r\n        // We found a mismatch before the first common path separator was seen, so\r\n        // return the original `to`.\r\n        if (i !== length) {\r\n            if (lastCommonSep === -1) {\r\n                return toOrig;\r\n            }\r\n        }\r\n        else {\r\n            if (toLen > length) {\r\n                if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {\r\n                    // We get here if `from` is the exact base path for `to`.\r\n                    // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\foo\\\\bar\\\\baz'\r\n                    return toOrig.slice(toStart + i + 1);\r\n                }\r\n                if (i === 2) {\r\n                    // We get here if `from` is the device root.\r\n                    // For example: from='C:\\\\'; to='C:\\\\foo'\r\n                    return toOrig.slice(toStart + i);\r\n                }\r\n            }\r\n            if (fromLen > length) {\r\n                if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {\r\n                    // We get here if `to` is the exact base path for `from`.\r\n                    // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\foo'\r\n                    lastCommonSep = i;\r\n                }\r\n                else if (i === 2) {\r\n                    // We get here if `to` is the device root.\r\n                    // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\'\r\n                    lastCommonSep = 3;\r\n                }\r\n            }\r\n            if (lastCommonSep === -1) {\r\n                lastCommonSep = 0;\r\n            }\r\n        }\r\n        let out = '';\r\n        // Generate the relative path based on the path difference between `to` and\r\n        // `from`\r\n        for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\r\n            if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {\r\n                out += out.length === 0 ? '..' : '\\\\..';\r\n            }\r\n        }\r\n        toStart += lastCommonSep;\r\n        // Lastly, append the rest of the destination (`to`) path that comes after\r\n        // the common path parts\r\n        if (out.length > 0) {\r\n            return `${out}${toOrig.slice(toStart, toEnd)}`;\r\n        }\r\n        if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {\r\n            ++toStart;\r\n        }\r\n        return toOrig.slice(toStart, toEnd);\r\n    },\r\n    toNamespacedPath(path) {\r\n        // Note: this will *probably* throw somewhere.\r\n        if (typeof path !== 'string') {\r\n            return path;\r\n        }\r\n        if (path.length === 0) {\r\n            return '';\r\n        }\r\n        const resolvedPath = win32.resolve(path);\r\n        if (resolvedPath.length <= 2) {\r\n            return path;\r\n        }\r\n        if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {\r\n            // Possible UNC root\r\n            if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {\r\n                const code = resolvedPath.charCodeAt(2);\r\n                if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {\r\n                    // Matched non-long UNC root, convert the path to a long UNC path\r\n                    return `\\\\\\\\?\\\\UNC\\\\${resolvedPath.slice(2)}`;\r\n                }\r\n            }\r\n        }\r\n        else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0)) &&\r\n            resolvedPath.charCodeAt(1) === CHAR_COLON &&\r\n            resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) {\r\n            // Matched device root, convert the path to a long UNC path\r\n            return `\\\\\\\\?\\\\${resolvedPath}`;\r\n        }\r\n        return path;\r\n    },\r\n    dirname(path) {\r\n        validateString(path, 'path');\r\n        const len = path.length;\r\n        if (len === 0) {\r\n            return '.';\r\n        }\r\n        let rootEnd = -1;\r\n        let offset = 0;\r\n        const code = path.charCodeAt(0);\r\n        if (len === 1) {\r\n            // `path` contains just a path separator, exit early to avoid\r\n            // unnecessary work or a dot.\r\n            return isPathSeparator(code) ? path : '.';\r\n        }\r\n        // Try to match a root\r\n        if (isPathSeparator(code)) {\r\n            // Possible UNC root\r\n            rootEnd = offset = 1;\r\n            if (isPathSeparator(path.charCodeAt(1))) {\r\n                // Matched double path separator at beginning\r\n                let j = 2;\r\n                let last = j;\r\n                // Match 1 or more non-path separators\r\n                while (j < len && !isPathSeparator(path.charCodeAt(j))) {\r\n                    j++;\r\n                }\r\n                if (j < len && j !== last) {\r\n                    // Matched!\r\n                    last = j;\r\n                    // Match 1 or more path separators\r\n                    while (j < len && isPathSeparator(path.charCodeAt(j))) {\r\n                        j++;\r\n                    }\r\n                    if (j < len && j !== last) {\r\n                        // Matched!\r\n                        last = j;\r\n                        // Match 1 or more non-path separators\r\n                        while (j < len && !isPathSeparator(path.charCodeAt(j))) {\r\n                            j++;\r\n                        }\r\n                        if (j === len) {\r\n                            // We matched a UNC root only\r\n                            return path;\r\n                        }\r\n                        if (j !== last) {\r\n                            // We matched a UNC root with leftovers\r\n                            // Offset by 1 to include the separator after the UNC root to\r\n                            // treat it as a \"normal root\" on top of a (UNC) root\r\n                            rootEnd = offset = j + 1;\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n            // Possible device root\r\n        }\r\n        else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\r\n            rootEnd = len > 2 && isPathSeparator(path.charCodeAt(2)) ? 3 : 2;\r\n            offset = rootEnd;\r\n        }\r\n        let end = -1;\r\n        let matchedSlash = true;\r\n        for (let i = len - 1; i >= offset; --i) {\r\n            if (isPathSeparator(path.charCodeAt(i))) {\r\n                if (!matchedSlash) {\r\n                    end = i;\r\n                    break;\r\n                }\r\n            }\r\n            else {\r\n                // We saw the first non-path separator\r\n                matchedSlash = false;\r\n            }\r\n        }\r\n        if (end === -1) {\r\n            if (rootEnd === -1) {\r\n                return '.';\r\n            }\r\n            end = rootEnd;\r\n        }\r\n        return path.slice(0, end);\r\n    },\r\n    basename(path, ext) {\r\n        if (ext !== undefined) {\r\n            validateString(ext, 'ext');\r\n        }\r\n        validateString(path, 'path');\r\n        let start = 0;\r\n        let end = -1;\r\n        let matchedSlash = true;\r\n        let i;\r\n        // Check for a drive letter prefix so as not to mistake the following\r\n        // path separator as an extra separator at the end of the path that can be\r\n        // disregarded\r\n        if (path.length >= 2 &&\r\n            isWindowsDeviceRoot(path.charCodeAt(0)) &&\r\n            path.charCodeAt(1) === CHAR_COLON) {\r\n            start = 2;\r\n        }\r\n        if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\r\n            if (ext === path) {\r\n                return '';\r\n            }\r\n            let extIdx = ext.length - 1;\r\n            let firstNonSlashEnd = -1;\r\n            for (i = path.length - 1; i >= start; --i) {\r\n                const code = path.charCodeAt(i);\r\n                if (isPathSeparator(code)) {\r\n                    // If we reached a path separator that was not part of a set of path\r\n                    // separators at the end of the string, stop now\r\n                    if (!matchedSlash) {\r\n                        start = i + 1;\r\n                        break;\r\n                    }\r\n                }\r\n                else {\r\n                    if (firstNonSlashEnd === -1) {\r\n                        // We saw the first non-path separator, remember this index in case\r\n                        // we need it if the extension ends up not matching\r\n                        matchedSlash = false;\r\n                        firstNonSlashEnd = i + 1;\r\n                    }\r\n                    if (extIdx >= 0) {\r\n                        // Try to match the explicit extension\r\n                        if (code === ext.charCodeAt(extIdx)) {\r\n                            if (--extIdx === -1) {\r\n                                // We matched the extension, so mark this as the end of our path\r\n                                // component\r\n                                end = i;\r\n                            }\r\n                        }\r\n                        else {\r\n                            // Extension does not match, so our result is the entire path\r\n                            // component\r\n                            extIdx = -1;\r\n                            end = firstNonSlashEnd;\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n            if (start === end) {\r\n                end = firstNonSlashEnd;\r\n            }\r\n            else if (end === -1) {\r\n                end = path.length;\r\n            }\r\n            return path.slice(start, end);\r\n        }\r\n        for (i = path.length - 1; i >= start; --i) {\r\n            if (isPathSeparator(path.charCodeAt(i))) {\r\n                // If we reached a path separator that was not part of a set of path\r\n                // separators at the end of the string, stop now\r\n                if (!matchedSlash) {\r\n                    start = i + 1;\r\n                    break;\r\n                }\r\n            }\r\n            else if (end === -1) {\r\n                // We saw the first non-path separator, mark this as the end of our\r\n                // path component\r\n                matchedSlash = false;\r\n                end = i + 1;\r\n            }\r\n        }\r\n        if (end === -1) {\r\n            return '';\r\n        }\r\n        return path.slice(start, end);\r\n    },\r\n    extname(path) {\r\n        validateString(path, 'path');\r\n        let start = 0;\r\n        let startDot = -1;\r\n        let startPart = 0;\r\n        let end = -1;\r\n        let matchedSlash = true;\r\n        // Track the state of characters (if any) we see before our first dot and\r\n        // after any path separator we find\r\n        let preDotState = 0;\r\n        // Check for a drive letter prefix so as not to mistake the following\r\n        // path separator as an extra separator at the end of the path that can be\r\n        // disregarded\r\n        if (path.length >= 2 &&\r\n            path.charCodeAt(1) === CHAR_COLON &&\r\n            isWindowsDeviceRoot(path.charCodeAt(0))) {\r\n            start = startPart = 2;\r\n        }\r\n        for (let i = path.length - 1; i >= start; --i) {\r\n            const code = path.charCodeAt(i);\r\n            if (isPathSeparator(code)) {\r\n                // If we reached a path separator that was not part of a set of path\r\n                // separators at the end of the string, stop now\r\n                if (!matchedSlash) {\r\n                    startPart = i + 1;\r\n                    break;\r\n                }\r\n                continue;\r\n            }\r\n            if (end === -1) {\r\n                // We saw the first non-path separator, mark this as the end of our\r\n                // extension\r\n                matchedSlash = false;\r\n                end = i + 1;\r\n            }\r\n            if (code === CHAR_DOT) {\r\n                // If this is our first dot, mark it as the start of our extension\r\n                if (startDot === -1) {\r\n                    startDot = i;\r\n                }\r\n                else if (preDotState !== 1) {\r\n                    preDotState = 1;\r\n                }\r\n            }\r\n            else if (startDot !== -1) {\r\n                // We saw a non-dot and non-path separator before our dot, so we should\r\n                // have a good chance at having a non-empty extension\r\n                preDotState = -1;\r\n            }\r\n        }\r\n        if (startDot === -1 ||\r\n            end === -1 ||\r\n            // We saw a non-dot character immediately before the dot\r\n            preDotState === 0 ||\r\n            // The (right-most) trimmed path component is exactly '..'\r\n            (preDotState === 1 &&\r\n                startDot === end - 1 &&\r\n                startDot === startPart + 1)) {\r\n            return '';\r\n        }\r\n        return path.slice(startDot, end);\r\n    },\r\n    format: _format.bind(null, '\\\\'),\r\n    parse(path) {\r\n        validateString(path, 'path');\r\n        const ret = { root: '', dir: '', base: '', ext: '', name: '' };\r\n        if (path.length === 0) {\r\n            return ret;\r\n        }\r\n        const len = path.length;\r\n        let rootEnd = 0;\r\n        let code = path.charCodeAt(0);\r\n        if (len === 1) {\r\n            if (isPathSeparator(code)) {\r\n                // `path` contains just a path separator, exit early to avoid\r\n                // unnecessary work\r\n                ret.root = ret.dir = path;\r\n                return ret;\r\n            }\r\n            ret.base = ret.name = path;\r\n            return ret;\r\n        }\r\n        // Try to match a root\r\n        if (isPathSeparator(code)) {\r\n            // Possible UNC root\r\n            rootEnd = 1;\r\n            if (isPathSeparator(path.charCodeAt(1))) {\r\n                // Matched double path separator at beginning\r\n                let j = 2;\r\n                let last = j;\r\n                // Match 1 or more non-path separators\r\n                while (j < len && !isPathSeparator(path.charCodeAt(j))) {\r\n                    j++;\r\n                }\r\n                if (j < len && j !== last) {\r\n                    // Matched!\r\n                    last = j;\r\n                    // Match 1 or more path separators\r\n                    while (j < len && isPathSeparator(path.charCodeAt(j))) {\r\n                        j++;\r\n                    }\r\n                    if (j < len && j !== last) {\r\n                        // Matched!\r\n                        last = j;\r\n                        // Match 1 or more non-path separators\r\n                        while (j < len && !isPathSeparator(path.charCodeAt(j))) {\r\n                            j++;\r\n                        }\r\n                        if (j === len) {\r\n                            // We matched a UNC root only\r\n                            rootEnd = j;\r\n                        }\r\n                        else if (j !== last) {\r\n                            // We matched a UNC root with leftovers\r\n                            rootEnd = j + 1;\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n        else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\r\n            // Possible device root\r\n            if (len <= 2) {\r\n                // `path` contains just a drive root, exit early to avoid\r\n                // unnecessary work\r\n                ret.root = ret.dir = path;\r\n                return ret;\r\n            }\r\n            rootEnd = 2;\r\n            if (isPathSeparator(path.charCodeAt(2))) {\r\n                if (len === 3) {\r\n                    // `path` contains just a drive root, exit early to avoid\r\n                    // unnecessary work\r\n                    ret.root = ret.dir = path;\r\n                    return ret;\r\n                }\r\n                rootEnd = 3;\r\n            }\r\n        }\r\n        if (rootEnd > 0) {\r\n            ret.root = path.slice(0, rootEnd);\r\n        }\r\n        let startDot = -1;\r\n        let startPart = rootEnd;\r\n        let end = -1;\r\n        let matchedSlash = true;\r\n        let i = path.length - 1;\r\n        // Track the state of characters (if any) we see before our first dot and\r\n        // after any path separator we find\r\n        let preDotState = 0;\r\n        // Get non-dir info\r\n        for (; i >= rootEnd; --i) {\r\n            code = path.charCodeAt(i);\r\n            if (isPathSeparator(code)) {\r\n                // If we reached a path separator that was not part of a set of path\r\n                // separators at the end of the string, stop now\r\n                if (!matchedSlash) {\r\n                    startPart = i + 1;\r\n                    break;\r\n                }\r\n                continue;\r\n            }\r\n            if (end === -1) {\r\n                // We saw the first non-path separator, mark this as the end of our\r\n                // extension\r\n                matchedSlash = false;\r\n                end = i + 1;\r\n            }\r\n            if (code === CHAR_DOT) {\r\n                // If this is our first dot, mark it as the start of our extension\r\n                if (startDot === -1) {\r\n                    startDot = i;\r\n                }\r\n                else if (preDotState !== 1) {\r\n                    preDotState = 1;\r\n                }\r\n            }\r\n            else if (startDot !== -1) {\r\n                // We saw a non-dot and non-path separator before our dot, so we should\r\n                // have a good chance at having a non-empty extension\r\n                preDotState = -1;\r\n            }\r\n        }\r\n        if (end !== -1) {\r\n            if (startDot === -1 ||\r\n                // We saw a non-dot character immediately before the dot\r\n                preDotState === 0 ||\r\n                // The (right-most) trimmed path component is exactly '..'\r\n                (preDotState === 1 &&\r\n                    startDot === end - 1 &&\r\n                    startDot === startPart + 1)) {\r\n                ret.base = ret.name = path.slice(startPart, end);\r\n            }\r\n            else {\r\n                ret.name = path.slice(startPart, startDot);\r\n                ret.base = path.slice(startPart, end);\r\n                ret.ext = path.slice(startDot, end);\r\n            }\r\n        }\r\n        // If the directory is the root, use the entire root as the `dir` including\r\n        // the trailing slash if any (`C:\\abc` -> `C:\\`). Otherwise, strip out the\r\n        // trailing slash (`C:\\abc\\def` -> `C:\\abc`).\r\n        if (startPart > 0 && startPart !== rootEnd) {\r\n            ret.dir = path.slice(0, startPart - 1);\r\n        }\r\n        else {\r\n            ret.dir = ret.root;\r\n        }\r\n        return ret;\r\n    },\r\n    sep: '\\\\',\r\n    delimiter: ';',\r\n    win32: null,\r\n    posix: null\r\n};\r\nconst posix = {\r\n    // path.resolve([from ...], to)\r\n    resolve(...pathSegments) {\r\n        let resolvedPath = '';\r\n        let resolvedAbsolute = false;\r\n        for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\r\n            const path = i >= 0 ? pathSegments[i] : _process_js__WEBPACK_IMPORTED_MODULE_0__.cwd();\r\n            validateString(path, 'path');\r\n            // Skip empty entries\r\n            if (path.length === 0) {\r\n                continue;\r\n            }\r\n            resolvedPath = `${path}/${resolvedPath}`;\r\n            resolvedAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;\r\n        }\r\n        // At this point the path should be resolved to a full absolute path, but\r\n        // handle relative paths to be safe (might happen when process.cwd() fails)\r\n        // Normalize the path\r\n        resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, '/', isPosixPathSeparator);\r\n        if (resolvedAbsolute) {\r\n            return `/${resolvedPath}`;\r\n        }\r\n        return resolvedPath.length > 0 ? resolvedPath : '.';\r\n    },\r\n    normalize(path) {\r\n        validateString(path, 'path');\r\n        if (path.length === 0) {\r\n            return '.';\r\n        }\r\n        const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;\r\n        const trailingSeparator = path.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH;\r\n        // Normalize the path\r\n        path = normalizeString(path, !isAbsolute, '/', isPosixPathSeparator);\r\n        if (path.length === 0) {\r\n            if (isAbsolute) {\r\n                return '/';\r\n            }\r\n            return trailingSeparator ? './' : '.';\r\n        }\r\n        if (trailingSeparator) {\r\n            path += '/';\r\n        }\r\n        return isAbsolute ? `/${path}` : path;\r\n    },\r\n    isAbsolute(path) {\r\n        validateString(path, 'path');\r\n        return path.length > 0 && path.charCodeAt(0) === CHAR_FORWARD_SLASH;\r\n    },\r\n    join(...paths) {\r\n        if (paths.length === 0) {\r\n            return '.';\r\n        }\r\n        let joined;\r\n        for (let i = 0; i < paths.length; ++i) {\r\n            const arg = paths[i];\r\n            validateString(arg, 'path');\r\n            if (arg.length > 0) {\r\n                if (joined === undefined) {\r\n                    joined = arg;\r\n                }\r\n                else {\r\n                    joined += `/${arg}`;\r\n                }\r\n            }\r\n        }\r\n        if (joined === undefined) {\r\n            return '.';\r\n        }\r\n        return posix.normalize(joined);\r\n    },\r\n    relative(from, to) {\r\n        validateString(from, 'from');\r\n        validateString(to, 'to');\r\n        if (from === to) {\r\n            return '';\r\n        }\r\n        // Trim leading forward slashes.\r\n        from = posix.resolve(from);\r\n        to = posix.resolve(to);\r\n        if (from === to) {\r\n            return '';\r\n        }\r\n        const fromStart = 1;\r\n        const fromEnd = from.length;\r\n        const fromLen = fromEnd - fromStart;\r\n        const toStart = 1;\r\n        const toLen = to.length - toStart;\r\n        // Compare paths to find the longest common path from root\r\n        const length = (fromLen < toLen ? fromLen : toLen);\r\n        let lastCommonSep = -1;\r\n        let i = 0;\r\n        for (; i < length; i++) {\r\n            const fromCode = from.charCodeAt(fromStart + i);\r\n            if (fromCode !== to.charCodeAt(toStart + i)) {\r\n                break;\r\n            }\r\n            else if (fromCode === CHAR_FORWARD_SLASH) {\r\n                lastCommonSep = i;\r\n            }\r\n        }\r\n        if (i === length) {\r\n            if (toLen > length) {\r\n                if (to.charCodeAt(toStart + i) === CHAR_FORWARD_SLASH) {\r\n                    // We get here if `from` is the exact base path for `to`.\r\n                    // For example: from='/foo/bar'; to='/foo/bar/baz'\r\n                    return to.slice(toStart + i + 1);\r\n                }\r\n                if (i === 0) {\r\n                    // We get here if `from` is the root\r\n                    // For example: from='/'; to='/foo'\r\n                    return to.slice(toStart + i);\r\n                }\r\n            }\r\n            else if (fromLen > length) {\r\n                if (from.charCodeAt(fromStart + i) === CHAR_FORWARD_SLASH) {\r\n                    // We get here if `to` is the exact base path for `from`.\r\n                    // For example: from='/foo/bar/baz'; to='/foo/bar'\r\n                    lastCommonSep = i;\r\n                }\r\n                else if (i === 0) {\r\n                    // We get here if `to` is the root.\r\n                    // For example: from='/foo/bar'; to='/'\r\n                    lastCommonSep = 0;\r\n                }\r\n            }\r\n        }\r\n        let out = '';\r\n        // Generate the relative path based on the path difference between `to`\r\n        // and `from`.\r\n        for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\r\n            if (i === fromEnd || from.charCodeAt(i) === CHAR_FORWARD_SLASH) {\r\n                out += out.length === 0 ? '..' : '/..';\r\n            }\r\n        }\r\n        // Lastly, append the rest of the destination (`to`) path that comes after\r\n        // the common path parts.\r\n        return `${out}${to.slice(toStart + lastCommonSep)}`;\r\n    },\r\n    toNamespacedPath(path) {\r\n        // Non-op on posix systems\r\n        return path;\r\n    },\r\n    dirname(path) {\r\n        validateString(path, 'path');\r\n        if (path.length === 0) {\r\n            return '.';\r\n        }\r\n        const hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH;\r\n        let end = -1;\r\n        let matchedSlash = true;\r\n        for (let i = path.length - 1; i >= 1; --i) {\r\n            if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {\r\n                if (!matchedSlash) {\r\n                    end = i;\r\n                    break;\r\n                }\r\n            }\r\n            else {\r\n                // We saw the first non-path separator\r\n                matchedSlash = false;\r\n            }\r\n        }\r\n        if (end === -1) {\r\n            return hasRoot ? '/' : '.';\r\n        }\r\n        if (hasRoot && end === 1) {\r\n            return '//';\r\n        }\r\n        return path.slice(0, end);\r\n    },\r\n    basename(path, ext) {\r\n        if (ext !== undefined) {\r\n            validateString(ext, 'ext');\r\n        }\r\n        validateString(path, 'path');\r\n        let start = 0;\r\n        let end = -1;\r\n        let matchedSlash = true;\r\n        let i;\r\n        if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\r\n            if (ext === path) {\r\n                return '';\r\n            }\r\n            let extIdx = ext.length - 1;\r\n            let firstNonSlashEnd = -1;\r\n            for (i = path.length - 1; i >= 0; --i) {\r\n                const code = path.charCodeAt(i);\r\n                if (code === CHAR_FORWARD_SLASH) {\r\n                    // If we reached a path separator that was not part of a set of path\r\n                    // separators at the end of the string, stop now\r\n                    if (!matchedSlash) {\r\n                        start = i + 1;\r\n                        break;\r\n                    }\r\n                }\r\n                else {\r\n                    if (firstNonSlashEnd === -1) {\r\n                        // We saw the first non-path separator, remember this index in case\r\n                        // we need it if the extension ends up not matching\r\n                        matchedSlash = false;\r\n                        firstNonSlashEnd = i + 1;\r\n                    }\r\n                    if (extIdx >= 0) {\r\n                        // Try to match the explicit extension\r\n                        if (code === ext.charCodeAt(extIdx)) {\r\n                            if (--extIdx === -1) {\r\n                                // We matched the extension, so mark this as the end of our path\r\n                                // component\r\n                                end = i;\r\n                            }\r\n                        }\r\n                        else {\r\n                            // Extension does not match, so our result is the entire path\r\n                            // component\r\n                            extIdx = -1;\r\n                            end = firstNonSlashEnd;\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n            if (start === end) {\r\n                end = firstNonSlashEnd;\r\n            }\r\n            else if (end === -1) {\r\n                end = path.length;\r\n            }\r\n            return path.slice(start, end);\r\n        }\r\n        for (i = path.length - 1; i >= 0; --i) {\r\n            if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {\r\n                // If we reached a path separator that was not part of a set of path\r\n                // separators at the end of the string, stop now\r\n                if (!matchedSlash) {\r\n                    start = i + 1;\r\n                    break;\r\n                }\r\n            }\r\n            else if (end === -1) {\r\n                // We saw the first non-path separator, mark this as the end of our\r\n                // path component\r\n                matchedSlash = false;\r\n                end = i + 1;\r\n            }\r\n        }\r\n        if (end === -1) {\r\n            return '';\r\n        }\r\n        return path.slice(start, end);\r\n    },\r\n    extname(path) {\r\n        validateString(path, 'path');\r\n        let startDot = -1;\r\n        let startPart = 0;\r\n        let end = -1;\r\n        let matchedSlash = true;\r\n        // Track the state of characters (if any) we see before our first dot and\r\n        // after any path separator we find\r\n        let preDotState = 0;\r\n        for (let i = path.length - 1; i >= 0; --i) {\r\n            const code = path.charCodeAt(i);\r\n            if (code === CHAR_FORWARD_SLASH) {\r\n                // If we reached a path separator that was not part of a set of path\r\n                // separators at the end of the string, stop now\r\n                if (!matchedSlash) {\r\n                    startPart = i + 1;\r\n                    break;\r\n                }\r\n                continue;\r\n            }\r\n            if (end === -1) {\r\n                // We saw the first non-path separator, mark this as the end of our\r\n                // extension\r\n                matchedSlash = false;\r\n                end = i + 1;\r\n            }\r\n            if (code === CHAR_DOT) {\r\n                // If this is our first dot, mark it as the start of our extension\r\n                if (startDot === -1) {\r\n                    startDot = i;\r\n                }\r\n                else if (preDotState !== 1) {\r\n                    preDotState = 1;\r\n                }\r\n            }\r\n            else if (startDot !== -1) {\r\n                // We saw a non-dot and non-path separator before our dot, so we should\r\n                // have a good chance at having a non-empty extension\r\n                preDotState = -1;\r\n            }\r\n        }\r\n        if (startDot === -1 ||\r\n            end === -1 ||\r\n            // We saw a non-dot character immediately before the dot\r\n            preDotState === 0 ||\r\n            // The (right-most) trimmed path component is exactly '..'\r\n            (preDotState === 1 &&\r\n                startDot === end - 1 &&\r\n                startDot === startPart + 1)) {\r\n            return '';\r\n        }\r\n        return path.slice(startDot, end);\r\n    },\r\n    format: _format.bind(null, '/'),\r\n    parse(path) {\r\n        validateString(path, 'path');\r\n        const ret = { root: '', dir: '', base: '', ext: '', name: '' };\r\n        if (path.length === 0) {\r\n            return ret;\r\n        }\r\n        const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;\r\n        let start;\r\n        if (isAbsolute) {\r\n            ret.root = '/';\r\n            start = 1;\r\n        }\r\n        else {\r\n            start = 0;\r\n        }\r\n        let startDot = -1;\r\n        let startPart = 0;\r\n        let end = -1;\r\n        let matchedSlash = true;\r\n        let i = path.length - 1;\r\n        // Track the state of characters (if any) we see before our first dot and\r\n        // after any path separator we find\r\n        let preDotState = 0;\r\n        // Get non-dir info\r\n        for (; i >= start; --i) {\r\n            const code = path.charCodeAt(i);\r\n            if (code === CHAR_FORWARD_SLASH) {\r\n                // If we reached a path separator that was not part of a set of path\r\n                // separators at the end of the string, stop now\r\n                if (!matchedSlash) {\r\n                    startPart = i + 1;\r\n                    break;\r\n                }\r\n                continue;\r\n            }\r\n            if (end === -1) {\r\n                // We saw the first non-path separator, mark this as the end of our\r\n                // extension\r\n                matchedSlash = false;\r\n                end = i + 1;\r\n            }\r\n            if (code === CHAR_DOT) {\r\n                // If this is our first dot, mark it as the start of our extension\r\n                if (startDot === -1) {\r\n                    startDot = i;\r\n                }\r\n                else if (preDotState !== 1) {\r\n                    preDotState = 1;\r\n                }\r\n            }\r\n            else if (startDot !== -1) {\r\n                // We saw a non-dot and non-path separator before our dot, so we should\r\n                // have a good chance at having a non-empty extension\r\n                preDotState = -1;\r\n            }\r\n        }\r\n        if (end !== -1) {\r\n            const start = startPart === 0 && isAbsolute ? 1 : startPart;\r\n            if (startDot === -1 ||\r\n                // We saw a non-dot character immediately before the dot\r\n                preDotState === 0 ||\r\n                // The (right-most) trimmed path component is exactly '..'\r\n                (preDotState === 1 &&\r\n                    startDot === end - 1 &&\r\n                    startDot === startPart + 1)) {\r\n                ret.base = ret.name = path.slice(start, end);\r\n            }\r\n            else {\r\n                ret.name = path.slice(start, startDot);\r\n                ret.base = path.slice(start, end);\r\n                ret.ext = path.slice(startDot, end);\r\n            }\r\n        }\r\n        if (startPart > 0) {\r\n            ret.dir = path.slice(0, startPart - 1);\r\n        }\r\n        else if (isAbsolute) {\r\n            ret.dir = '/';\r\n        }\r\n        return ret;\r\n    },\r\n    sep: '/',\r\n    delimiter: ':',\r\n    win32: null,\r\n    posix: null\r\n};\r\nposix.win32 = win32.win32 = win32;\r\nposix.posix = win32.posix = posix;\r\nconst normalize = (_process_js__WEBPACK_IMPORTED_MODULE_0__.platform === 'win32' ? win32.normalize : posix.normalize);\r\nconst resolve = (_process_js__WEBPACK_IMPORTED_MODULE_0__.platform === 'win32' ? win32.resolve : posix.resolve);\r\nconst relative = (_process_js__WEBPACK_IMPORTED_MODULE_0__.platform === 'win32' ? win32.relative : posix.relative);\r\nconst dirname = (_process_js__WEBPACK_IMPORTED_MODULE_0__.platform === 'win32' ? win32.dirname : posix.dirname);\r\nconst basename = (_process_js__WEBPACK_IMPORTED_MODULE_0__.platform === 'win32' ? win32.basename : posix.basename);\r\nconst extname = (_process_js__WEBPACK_IMPORTED_MODULE_0__.platform === 'win32' ? win32.extname : posix.extname);\r\nconst sep = (_process_js__WEBPACK_IMPORTED_MODULE_0__.platform === 'win32' ? win32.sep : posix.sep);\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/path.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/platform.js":
/*!*******************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/platform.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"isElectronSandboxed\": () => (/* binding */ isElectronSandboxed),\n/* harmony export */   \"browserCodeLoadingCacheStrategy\": () => (/* binding */ browserCodeLoadingCacheStrategy),\n/* harmony export */   \"isPreferringBrowserCodeLoad\": () => (/* binding */ isPreferringBrowserCodeLoad),\n/* harmony export */   \"isWindows\": () => (/* binding */ isWindows),\n/* harmony export */   \"isMacintosh\": () => (/* binding */ isMacintosh),\n/* harmony export */   \"isLinux\": () => (/* binding */ isLinux),\n/* harmony export */   \"isNative\": () => (/* binding */ isNative),\n/* harmony export */   \"isWeb\": () => (/* binding */ isWeb),\n/* harmony export */   \"isIOS\": () => (/* binding */ isIOS),\n/* harmony export */   \"userAgent\": () => (/* binding */ userAgent),\n/* harmony export */   \"globals\": () => (/* binding */ globals),\n/* harmony export */   \"setImmediate\": () => (/* binding */ setImmediate),\n/* harmony export */   \"OS\": () => (/* binding */ OS),\n/* harmony export */   \"isLittleEndian\": () => (/* binding */ isLittleEndian)\n/* harmony export */ });\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nvar _a;\r\nconst LANGUAGE_DEFAULT = 'en';\r\nlet _isWindows = false;\r\nlet _isMacintosh = false;\r\nlet _isLinux = false;\r\nlet _isLinuxSnap = false;\r\nlet _isNative = false;\r\nlet _isWeb = false;\r\nlet _isIOS = false;\r\nlet _locale = undefined;\r\nlet _language = LANGUAGE_DEFAULT;\r\nlet _translationsConfigFile = undefined;\r\nlet _userAgent = undefined;\r\nconst _globals = (typeof self === 'object' ? self : typeof __webpack_require__.g === 'object' ? __webpack_require__.g : {});\r\nlet nodeProcess = undefined;\r\nif (typeof process !== 'undefined') {\r\n    // Native environment (non-sandboxed)\r\n    nodeProcess = process;\r\n}\r\nelse if (typeof _globals.vscode !== 'undefined') {\r\n    // Native environment (sandboxed)\r\n    nodeProcess = _globals.vscode.process;\r\n}\r\nconst isElectronRenderer = typeof ((_a = nodeProcess === null || nodeProcess === void 0 ? void 0 : nodeProcess.versions) === null || _a === void 0 ? void 0 : _a.electron) === 'string' && nodeProcess.type === 'renderer';\r\nconst isElectronSandboxed = isElectronRenderer && (nodeProcess === null || nodeProcess === void 0 ? void 0 : nodeProcess.sandboxed);\r\nconst browserCodeLoadingCacheStrategy = (() => {\r\n    // Always enabled when sandbox is enabled\r\n    if (isElectronSandboxed) {\r\n        return 'bypassHeatCheck';\r\n    }\r\n    // Otherwise, only enabled conditionally\r\n    const env = nodeProcess === null || nodeProcess === void 0 ? void 0 : nodeProcess.env['ENABLE_VSCODE_BROWSER_CODE_LOADING'];\r\n    if (typeof env === 'string') {\r\n        if (env === 'none' || env === 'code' || env === 'bypassHeatCheck' || env === 'bypassHeatCheckAndEagerCompile') {\r\n            return env;\r\n        }\r\n        return 'bypassHeatCheck';\r\n    }\r\n    return undefined;\r\n})();\r\nconst isPreferringBrowserCodeLoad = typeof browserCodeLoadingCacheStrategy === 'string';\r\n// Web environment\r\nif (typeof navigator === 'object' && !isElectronRenderer) {\r\n    _userAgent = navigator.userAgent;\r\n    _isWindows = _userAgent.indexOf('Windows') >= 0;\r\n    _isMacintosh = _userAgent.indexOf('Macintosh') >= 0;\r\n    _isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;\r\n    _isLinux = _userAgent.indexOf('Linux') >= 0;\r\n    _isWeb = true;\r\n    _locale = navigator.language;\r\n    _language = _locale;\r\n}\r\n// Native environment\r\nelse if (typeof nodeProcess === 'object') {\r\n    _isWindows = (nodeProcess.platform === 'win32');\r\n    _isMacintosh = (nodeProcess.platform === 'darwin');\r\n    _isLinux = (nodeProcess.platform === 'linux');\r\n    _isLinuxSnap = _isLinux && !!nodeProcess.env['SNAP'] && !!nodeProcess.env['SNAP_REVISION'];\r\n    _locale = LANGUAGE_DEFAULT;\r\n    _language = LANGUAGE_DEFAULT;\r\n    const rawNlsConfig = nodeProcess.env['VSCODE_NLS_CONFIG'];\r\n    if (rawNlsConfig) {\r\n        try {\r\n            const nlsConfig = JSON.parse(rawNlsConfig);\r\n            const resolved = nlsConfig.availableLanguages['*'];\r\n            _locale = nlsConfig.locale;\r\n            // VSCode's default language is 'en'\r\n            _language = resolved ? resolved : LANGUAGE_DEFAULT;\r\n            _translationsConfigFile = nlsConfig._translationsConfigFile;\r\n        }\r\n        catch (e) {\r\n        }\r\n    }\r\n    _isNative = true;\r\n}\r\n// Unknown environment\r\nelse {\r\n    console.error('Unable to resolve platform.');\r\n}\r\nlet _platform = 0 /* Web */;\r\nif (_isMacintosh) {\r\n    _platform = 1 /* Mac */;\r\n}\r\nelse if (_isWindows) {\r\n    _platform = 3 /* Windows */;\r\n}\r\nelse if (_isLinux) {\r\n    _platform = 2 /* Linux */;\r\n}\r\nconst isWindows = _isWindows;\r\nconst isMacintosh = _isMacintosh;\r\nconst isLinux = _isLinux;\r\nconst isNative = _isNative;\r\nconst isWeb = _isWeb;\r\nconst isIOS = _isIOS;\r\nconst userAgent = _userAgent;\r\nconst globals = _globals;\r\nconst setImmediate = (function defineSetImmediate() {\r\n    if (globals.setImmediate) {\r\n        return globals.setImmediate.bind(globals);\r\n    }\r\n    if (typeof globals.postMessage === 'function' && !globals.importScripts) {\r\n        let pending = [];\r\n        globals.addEventListener('message', (e) => {\r\n            if (e.data && e.data.vscodeSetImmediateId) {\r\n                for (let i = 0, len = pending.length; i < len; i++) {\r\n                    const candidate = pending[i];\r\n                    if (candidate.id === e.data.vscodeSetImmediateId) {\r\n                        pending.splice(i, 1);\r\n                        candidate.callback();\r\n                        return;\r\n                    }\r\n                }\r\n            }\r\n        });\r\n        let lastId = 0;\r\n        return (callback) => {\r\n            const myId = ++lastId;\r\n            pending.push({\r\n                id: myId,\r\n                callback: callback\r\n            });\r\n            globals.postMessage({ vscodeSetImmediateId: myId }, '*');\r\n        };\r\n    }\r\n    if (nodeProcess && typeof nodeProcess.nextTick === 'function') {\r\n        return nodeProcess.nextTick.bind(nodeProcess);\r\n    }\r\n    const _promise = Promise.resolve();\r\n    return (callback) => _promise.then(callback);\r\n})();\r\nconst OS = (_isMacintosh || _isIOS ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */));\r\nlet _isLittleEndian = true;\r\nlet _isLittleEndianComputed = false;\r\nfunction isLittleEndian() {\r\n    if (!_isLittleEndianComputed) {\r\n        _isLittleEndianComputed = true;\r\n        const test = new Uint8Array(2);\r\n        test[0] = 1;\r\n        test[1] = 2;\r\n        const view = new Uint16Array(test.buffer);\r\n        _isLittleEndian = (view[0] === (2 << 8) + 1);\r\n    }\r\n    return _isLittleEndian;\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/platform.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/process.js":
/*!******************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/process.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"cwd\": () => (/* binding */ cwd),\n/* harmony export */   \"env\": () => (/* binding */ env),\n/* harmony export */   \"platform\": () => (/* binding */ platform)\n/* harmony export */ });\n/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ \"./node_modules/monaco-editor/esm/vs/base/common/platform.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nlet safeProcess;\r\n// Native node.js environment\r\nif (typeof process !== 'undefined') {\r\n    safeProcess = process;\r\n}\r\n// Native sandbox environment\r\nelse if (typeof _platform_js__WEBPACK_IMPORTED_MODULE_0__.globals.vscode !== 'undefined') {\r\n    safeProcess = {\r\n        // Supported\r\n        get platform() { return _platform_js__WEBPACK_IMPORTED_MODULE_0__.globals.vscode.process.platform; },\r\n        get env() { return _platform_js__WEBPACK_IMPORTED_MODULE_0__.globals.vscode.process.env; },\r\n        nextTick(callback) { return (0,_platform_js__WEBPACK_IMPORTED_MODULE_0__.setImmediate)(callback); },\r\n        // Unsupported\r\n        cwd() { return _platform_js__WEBPACK_IMPORTED_MODULE_0__.globals.vscode.process.env.VSCODE_CWD || _platform_js__WEBPACK_IMPORTED_MODULE_0__.globals.vscode.process.execPath.substr(0, _platform_js__WEBPACK_IMPORTED_MODULE_0__.globals.vscode.process.execPath.lastIndexOf(_platform_js__WEBPACK_IMPORTED_MODULE_0__.globals.vscode.process.platform === 'win32' ? '\\\\' : '/')); }\r\n    };\r\n}\r\n// Web environment\r\nelse {\r\n    safeProcess = {\r\n        // Supported\r\n        get platform() { return _platform_js__WEBPACK_IMPORTED_MODULE_0__.isWindows ? 'win32' : _platform_js__WEBPACK_IMPORTED_MODULE_0__.isMacintosh ? 'darwin' : 'linux'; },\r\n        nextTick(callback) { return (0,_platform_js__WEBPACK_IMPORTED_MODULE_0__.setImmediate)(callback); },\r\n        // Unsupported\r\n        get env() { return Object.create(null); },\r\n        cwd() { return '/'; }\r\n    };\r\n}\r\nconst cwd = safeProcess.cwd;\r\nconst env = safeProcess.env;\r\nconst platform = safeProcess.platform;\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/process.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/stopwatch.js":
/*!********************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/stopwatch.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"StopWatch\": () => (/* binding */ StopWatch)\n/* harmony export */ });\n/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ \"./node_modules/monaco-editor/esm/vs/base/common/platform.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nconst hasPerformanceNow = (_platform_js__WEBPACK_IMPORTED_MODULE_0__.globals.performance && typeof _platform_js__WEBPACK_IMPORTED_MODULE_0__.globals.performance.now === 'function');\r\nclass StopWatch {\r\n    constructor(highResolution) {\r\n        this._highResolution = hasPerformanceNow && highResolution;\r\n        this._startTime = this._now();\r\n        this._stopTime = -1;\r\n    }\r\n    static create(highResolution = true) {\r\n        return new StopWatch(highResolution);\r\n    }\r\n    stop() {\r\n        this._stopTime = this._now();\r\n    }\r\n    elapsed() {\r\n        if (this._stopTime !== -1) {\r\n            return this._stopTime - this._startTime;\r\n        }\r\n        return this._now() - this._startTime;\r\n    }\r\n    _now() {\r\n        return this._highResolution ? _platform_js__WEBPACK_IMPORTED_MODULE_0__.globals.performance.now() : Date.now();\r\n    }\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/stopwatch.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/strings.js":
/*!******************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/strings.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"isFalsyOrWhitespace\": () => (/* binding */ isFalsyOrWhitespace),\n/* harmony export */   \"format\": () => (/* binding */ format),\n/* harmony export */   \"escape\": () => (/* binding */ escape),\n/* harmony export */   \"escapeRegExpCharacters\": () => (/* binding */ escapeRegExpCharacters),\n/* harmony export */   \"trim\": () => (/* binding */ trim),\n/* harmony export */   \"ltrim\": () => (/* binding */ ltrim),\n/* harmony export */   \"rtrim\": () => (/* binding */ rtrim),\n/* harmony export */   \"convertSimple2RegExpPattern\": () => (/* binding */ convertSimple2RegExpPattern),\n/* harmony export */   \"stripWildcards\": () => (/* binding */ stripWildcards),\n/* harmony export */   \"createRegExp\": () => (/* binding */ createRegExp),\n/* harmony export */   \"regExpLeadsToEndlessLoop\": () => (/* binding */ regExpLeadsToEndlessLoop),\n/* harmony export */   \"regExpFlags\": () => (/* binding */ regExpFlags),\n/* harmony export */   \"splitLines\": () => (/* binding */ splitLines),\n/* harmony export */   \"firstNonWhitespaceIndex\": () => (/* binding */ firstNonWhitespaceIndex),\n/* harmony export */   \"getLeadingWhitespace\": () => (/* binding */ getLeadingWhitespace),\n/* harmony export */   \"lastNonWhitespaceIndex\": () => (/* binding */ lastNonWhitespaceIndex),\n/* harmony export */   \"compare\": () => (/* binding */ compare),\n/* harmony export */   \"compareSubstring\": () => (/* binding */ compareSubstring),\n/* harmony export */   \"compareIgnoreCase\": () => (/* binding */ compareIgnoreCase),\n/* harmony export */   \"compareSubstringIgnoreCase\": () => (/* binding */ compareSubstringIgnoreCase),\n/* harmony export */   \"isLowerAsciiLetter\": () => (/* binding */ isLowerAsciiLetter),\n/* harmony export */   \"isUpperAsciiLetter\": () => (/* binding */ isUpperAsciiLetter),\n/* harmony export */   \"equalsIgnoreCase\": () => (/* binding */ equalsIgnoreCase),\n/* harmony export */   \"startsWithIgnoreCase\": () => (/* binding */ startsWithIgnoreCase),\n/* harmony export */   \"commonPrefixLength\": () => (/* binding */ commonPrefixLength),\n/* harmony export */   \"commonSuffixLength\": () => (/* binding */ commonSuffixLength),\n/* harmony export */   \"isHighSurrogate\": () => (/* binding */ isHighSurrogate),\n/* harmony export */   \"isLowSurrogate\": () => (/* binding */ isLowSurrogate),\n/* harmony export */   \"computeCodePoint\": () => (/* binding */ computeCodePoint),\n/* harmony export */   \"getNextCodePoint\": () => (/* binding */ getNextCodePoint),\n/* harmony export */   \"nextCharLength\": () => (/* binding */ nextCharLength),\n/* harmony export */   \"prevCharLength\": () => (/* binding */ prevCharLength),\n/* harmony export */   \"decodeUTF8\": () => (/* binding */ decodeUTF8),\n/* harmony export */   \"containsRTL\": () => (/* binding */ containsRTL),\n/* harmony export */   \"containsEmoji\": () => (/* binding */ containsEmoji),\n/* harmony export */   \"isBasicASCII\": () => (/* binding */ isBasicASCII),\n/* harmony export */   \"UNUSUAL_LINE_TERMINATORS\": () => (/* binding */ UNUSUAL_LINE_TERMINATORS),\n/* harmony export */   \"containsUnusualLineTerminators\": () => (/* binding */ containsUnusualLineTerminators),\n/* harmony export */   \"containsFullWidthCharacter\": () => (/* binding */ containsFullWidthCharacter),\n/* harmony export */   \"isFullWidthCharacter\": () => (/* binding */ isFullWidthCharacter),\n/* harmony export */   \"isEmojiImprecise\": () => (/* binding */ isEmojiImprecise),\n/* harmony export */   \"UTF8_BOM_CHARACTER\": () => (/* binding */ UTF8_BOM_CHARACTER),\n/* harmony export */   \"startsWithUTF8BOM\": () => (/* binding */ startsWithUTF8BOM),\n/* harmony export */   \"containsUppercaseCharacter\": () => (/* binding */ containsUppercaseCharacter),\n/* harmony export */   \"singleLetterHash\": () => (/* binding */ singleLetterHash),\n/* harmony export */   \"getGraphemeBreakType\": () => (/* binding */ getGraphemeBreakType),\n/* harmony export */   \"breakBetweenGraphemeBreakType\": () => (/* binding */ breakBetweenGraphemeBreakType)\n/* harmony export */ });\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nfunction isFalsyOrWhitespace(str) {\r\n    if (!str || typeof str !== 'string') {\r\n        return true;\r\n    }\r\n    return str.trim().length === 0;\r\n}\r\nconst _formatRegexp = /{(\\d+)}/g;\r\n/**\r\n * Helper to produce a string with a variable number of arguments. Insert variable segments\r\n * into the string using the {n} notation where N is the index of the argument following the string.\r\n * @param value string to which formatting is applied\r\n * @param args replacements for {n}-entries\r\n */\r\nfunction format(value, ...args) {\r\n    if (args.length === 0) {\r\n        return value;\r\n    }\r\n    return value.replace(_formatRegexp, function (match, group) {\r\n        const idx = parseInt(group, 10);\r\n        return isNaN(idx) || idx < 0 || idx >= args.length ?\r\n            match :\r\n            args[idx];\r\n    });\r\n}\r\n/**\r\n * Converts HTML characters inside the string to use entities instead. Makes the string safe from\r\n * being used e.g. in HTMLElement.innerHTML.\r\n */\r\nfunction escape(html) {\r\n    return html.replace(/[<>&]/g, function (match) {\r\n        switch (match) {\r\n            case '<': return '&lt;';\r\n            case '>': return '&gt;';\r\n            case '&': return '&amp;';\r\n            default: return match;\r\n        }\r\n    });\r\n}\r\n/**\r\n * Escapes regular expression characters in a given string\r\n */\r\nfunction escapeRegExpCharacters(value) {\r\n    return value.replace(/[\\\\\\{\\}\\*\\+\\?\\|\\^\\$\\.\\[\\]\\(\\)]/g, '\\\\$&');\r\n}\r\n/**\r\n * Removes all occurrences of needle from the beginning and end of haystack.\r\n * @param haystack string to trim\r\n * @param needle the thing to trim (default is a blank)\r\n */\r\nfunction trim(haystack, needle = ' ') {\r\n    const trimmed = ltrim(haystack, needle);\r\n    return rtrim(trimmed, needle);\r\n}\r\n/**\r\n * Removes all occurrences of needle from the beginning of haystack.\r\n * @param haystack string to trim\r\n * @param needle the thing to trim\r\n */\r\nfunction ltrim(haystack, needle) {\r\n    if (!haystack || !needle) {\r\n        return haystack;\r\n    }\r\n    const needleLen = needle.length;\r\n    if (needleLen === 0 || haystack.length === 0) {\r\n        return haystack;\r\n    }\r\n    let offset = 0;\r\n    while (haystack.indexOf(needle, offset) === offset) {\r\n        offset = offset + needleLen;\r\n    }\r\n    return haystack.substring(offset);\r\n}\r\n/**\r\n * Removes all occurrences of needle from the end of haystack.\r\n * @param haystack string to trim\r\n * @param needle the thing to trim\r\n */\r\nfunction rtrim(haystack, needle) {\r\n    if (!haystack || !needle) {\r\n        return haystack;\r\n    }\r\n    const needleLen = needle.length, haystackLen = haystack.length;\r\n    if (needleLen === 0 || haystackLen === 0) {\r\n        return haystack;\r\n    }\r\n    let offset = haystackLen, idx = -1;\r\n    while (true) {\r\n        idx = haystack.lastIndexOf(needle, offset - 1);\r\n        if (idx === -1 || idx + needleLen !== offset) {\r\n            break;\r\n        }\r\n        if (idx === 0) {\r\n            return '';\r\n        }\r\n        offset = idx;\r\n    }\r\n    return haystack.substring(0, offset);\r\n}\r\nfunction convertSimple2RegExpPattern(pattern) {\r\n    return pattern.replace(/[\\-\\\\\\{\\}\\+\\?\\|\\^\\$\\.\\,\\[\\]\\(\\)\\#\\s]/g, '\\\\$&').replace(/[\\*]/g, '.*');\r\n}\r\nfunction stripWildcards(pattern) {\r\n    return pattern.replace(/\\*/g, '');\r\n}\r\nfunction createRegExp(searchString, isRegex, options = {}) {\r\n    if (!searchString) {\r\n        throw new Error('Cannot create regex from empty string');\r\n    }\r\n    if (!isRegex) {\r\n        searchString = escapeRegExpCharacters(searchString);\r\n    }\r\n    if (options.wholeWord) {\r\n        if (!/\\B/.test(searchString.charAt(0))) {\r\n            searchString = '\\\\b' + searchString;\r\n        }\r\n        if (!/\\B/.test(searchString.charAt(searchString.length - 1))) {\r\n            searchString = searchString + '\\\\b';\r\n        }\r\n    }\r\n    let modifiers = '';\r\n    if (options.global) {\r\n        modifiers += 'g';\r\n    }\r\n    if (!options.matchCase) {\r\n        modifiers += 'i';\r\n    }\r\n    if (options.multiline) {\r\n        modifiers += 'm';\r\n    }\r\n    if (options.unicode) {\r\n        modifiers += 'u';\r\n    }\r\n    return new RegExp(searchString, modifiers);\r\n}\r\nfunction regExpLeadsToEndlessLoop(regexp) {\r\n    // Exit early if it's one of these special cases which are meant to match\r\n    // against an empty string\r\n    if (regexp.source === '^' || regexp.source === '^$' || regexp.source === '$' || regexp.source === '^\\\\s*$') {\r\n        return false;\r\n    }\r\n    // We check against an empty string. If the regular expression doesn't advance\r\n    // (e.g. ends in an endless loop) it will match an empty string.\r\n    const match = regexp.exec('');\r\n    return !!(match && regexp.lastIndex === 0);\r\n}\r\nfunction regExpFlags(regexp) {\r\n    return (regexp.global ? 'g' : '')\r\n        + (regexp.ignoreCase ? 'i' : '')\r\n        + (regexp.multiline ? 'm' : '')\r\n        + (regexp /* standalone editor compilation */.unicode ? 'u' : '');\r\n}\r\nfunction splitLines(str) {\r\n    return str.split(/\\r\\n|\\r|\\n/);\r\n}\r\n/**\r\n * Returns first index of the string that is not whitespace.\r\n * If string is empty or contains only whitespaces, returns -1\r\n */\r\nfunction firstNonWhitespaceIndex(str) {\r\n    for (let i = 0, len = str.length; i < len; i++) {\r\n        const chCode = str.charCodeAt(i);\r\n        if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) {\r\n            return i;\r\n        }\r\n    }\r\n    return -1;\r\n}\r\n/**\r\n * Returns the leading whitespace of the string.\r\n * If the string contains only whitespaces, returns entire string\r\n */\r\nfunction getLeadingWhitespace(str, start = 0, end = str.length) {\r\n    for (let i = start; i < end; i++) {\r\n        const chCode = str.charCodeAt(i);\r\n        if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) {\r\n            return str.substring(start, i);\r\n        }\r\n    }\r\n    return str.substring(start, end);\r\n}\r\n/**\r\n * Returns last index of the string that is not whitespace.\r\n * If string is empty or contains only whitespaces, returns -1\r\n */\r\nfunction lastNonWhitespaceIndex(str, startIndex = str.length - 1) {\r\n    for (let i = startIndex; i >= 0; i--) {\r\n        const chCode = str.charCodeAt(i);\r\n        if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) {\r\n            return i;\r\n        }\r\n    }\r\n    return -1;\r\n}\r\nfunction compare(a, b) {\r\n    if (a < b) {\r\n        return -1;\r\n    }\r\n    else if (a > b) {\r\n        return 1;\r\n    }\r\n    else {\r\n        return 0;\r\n    }\r\n}\r\nfunction compareSubstring(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) {\r\n    for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) {\r\n        let codeA = a.charCodeAt(aStart);\r\n        let codeB = b.charCodeAt(bStart);\r\n        if (codeA < codeB) {\r\n            return -1;\r\n        }\r\n        else if (codeA > codeB) {\r\n            return 1;\r\n        }\r\n    }\r\n    const aLen = aEnd - aStart;\r\n    const bLen = bEnd - bStart;\r\n    if (aLen < bLen) {\r\n        return -1;\r\n    }\r\n    else if (aLen > bLen) {\r\n        return 1;\r\n    }\r\n    return 0;\r\n}\r\nfunction compareIgnoreCase(a, b) {\r\n    return compareSubstringIgnoreCase(a, b, 0, a.length, 0, b.length);\r\n}\r\nfunction compareSubstringIgnoreCase(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) {\r\n    for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) {\r\n        let codeA = a.charCodeAt(aStart);\r\n        let codeB = b.charCodeAt(bStart);\r\n        if (codeA === codeB) {\r\n            // equal\r\n            continue;\r\n        }\r\n        const diff = codeA - codeB;\r\n        if (diff === 32 && isUpperAsciiLetter(codeB)) { //codeB =[65-90] && codeA =[97-122]\r\n            continue;\r\n        }\r\n        else if (diff === -32 && isUpperAsciiLetter(codeA)) { //codeB =[97-122] && codeA =[65-90]\r\n            continue;\r\n        }\r\n        if (isLowerAsciiLetter(codeA) && isLowerAsciiLetter(codeB)) {\r\n            //\r\n            return diff;\r\n        }\r\n        else {\r\n            return compareSubstring(a.toLowerCase(), b.toLowerCase(), aStart, aEnd, bStart, bEnd);\r\n        }\r\n    }\r\n    const aLen = aEnd - aStart;\r\n    const bLen = bEnd - bStart;\r\n    if (aLen < bLen) {\r\n        return -1;\r\n    }\r\n    else if (aLen > bLen) {\r\n        return 1;\r\n    }\r\n    return 0;\r\n}\r\nfunction isLowerAsciiLetter(code) {\r\n    return code >= 97 /* a */ && code <= 122 /* z */;\r\n}\r\nfunction isUpperAsciiLetter(code) {\r\n    return code >= 65 /* A */ && code <= 90 /* Z */;\r\n}\r\nfunction isAsciiLetter(code) {\r\n    return isLowerAsciiLetter(code) || isUpperAsciiLetter(code);\r\n}\r\nfunction equalsIgnoreCase(a, b) {\r\n    return a.length === b.length && doEqualsIgnoreCase(a, b);\r\n}\r\nfunction doEqualsIgnoreCase(a, b, stopAt = a.length) {\r\n    for (let i = 0; i < stopAt; i++) {\r\n        const codeA = a.charCodeAt(i);\r\n        const codeB = b.charCodeAt(i);\r\n        if (codeA === codeB) {\r\n            continue;\r\n        }\r\n        // a-z A-Z\r\n        if (isAsciiLetter(codeA) && isAsciiLetter(codeB)) {\r\n            const diff = Math.abs(codeA - codeB);\r\n            if (diff !== 0 && diff !== 32) {\r\n                return false;\r\n            }\r\n        }\r\n        // Any other charcode\r\n        else {\r\n            if (String.fromCharCode(codeA).toLowerCase() !== String.fromCharCode(codeB).toLowerCase()) {\r\n                return false;\r\n            }\r\n        }\r\n    }\r\n    return true;\r\n}\r\nfunction startsWithIgnoreCase(str, candidate) {\r\n    const candidateLength = candidate.length;\r\n    if (candidate.length > str.length) {\r\n        return false;\r\n    }\r\n    return doEqualsIgnoreCase(str, candidate, candidateLength);\r\n}\r\n/**\r\n * @returns the length of the common prefix of the two strings.\r\n */\r\nfunction commonPrefixLength(a, b) {\r\n    let i, len = Math.min(a.length, b.length);\r\n    for (i = 0; i < len; i++) {\r\n        if (a.charCodeAt(i) !== b.charCodeAt(i)) {\r\n            return i;\r\n        }\r\n    }\r\n    return len;\r\n}\r\n/**\r\n * @returns the length of the common suffix of the two strings.\r\n */\r\nfunction commonSuffixLength(a, b) {\r\n    let i, len = Math.min(a.length, b.length);\r\n    const aLastIndex = a.length - 1;\r\n    const bLastIndex = b.length - 1;\r\n    for (i = 0; i < len; i++) {\r\n        if (a.charCodeAt(aLastIndex - i) !== b.charCodeAt(bLastIndex - i)) {\r\n            return i;\r\n        }\r\n    }\r\n    return len;\r\n}\r\n/**\r\n * See http://en.wikipedia.org/wiki/Surrogate_pair\r\n */\r\nfunction isHighSurrogate(charCode) {\r\n    return (0xD800 <= charCode && charCode <= 0xDBFF);\r\n}\r\n/**\r\n * See http://en.wikipedia.org/wiki/Surrogate_pair\r\n */\r\nfunction isLowSurrogate(charCode) {\r\n    return (0xDC00 <= charCode && charCode <= 0xDFFF);\r\n}\r\n/**\r\n * See http://en.wikipedia.org/wiki/Surrogate_pair\r\n */\r\nfunction computeCodePoint(highSurrogate, lowSurrogate) {\r\n    return ((highSurrogate - 0xD800) << 10) + (lowSurrogate - 0xDC00) + 0x10000;\r\n}\r\n/**\r\n * get the code point that begins at offset `offset`\r\n */\r\nfunction getNextCodePoint(str, len, offset) {\r\n    const charCode = str.charCodeAt(offset);\r\n    if (isHighSurrogate(charCode) && offset + 1 < len) {\r\n        const nextCharCode = str.charCodeAt(offset + 1);\r\n        if (isLowSurrogate(nextCharCode)) {\r\n            return computeCodePoint(charCode, nextCharCode);\r\n        }\r\n    }\r\n    return charCode;\r\n}\r\n/**\r\n * get the code point that ends right before offset `offset`\r\n */\r\nfunction getPrevCodePoint(str, offset) {\r\n    const charCode = str.charCodeAt(offset - 1);\r\n    if (isLowSurrogate(charCode) && offset > 1) {\r\n        const prevCharCode = str.charCodeAt(offset - 2);\r\n        if (isHighSurrogate(prevCharCode)) {\r\n            return computeCodePoint(prevCharCode, charCode);\r\n        }\r\n    }\r\n    return charCode;\r\n}\r\nfunction nextCharLength(str, offset) {\r\n    const graphemeBreakTree = GraphemeBreakTree.getInstance();\r\n    const initialOffset = offset;\r\n    const len = str.length;\r\n    const initialCodePoint = getNextCodePoint(str, len, offset);\r\n    offset += (initialCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);\r\n    let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint);\r\n    while (offset < len) {\r\n        const nextCodePoint = getNextCodePoint(str, len, offset);\r\n        const nextGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(nextCodePoint);\r\n        if (breakBetweenGraphemeBreakType(graphemeBreakType, nextGraphemeBreakType)) {\r\n            break;\r\n        }\r\n        offset += (nextCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);\r\n        graphemeBreakType = nextGraphemeBreakType;\r\n    }\r\n    return (offset - initialOffset);\r\n}\r\nfunction prevCharLength(str, offset) {\r\n    const graphemeBreakTree = GraphemeBreakTree.getInstance();\r\n    const initialOffset = offset;\r\n    const initialCodePoint = getPrevCodePoint(str, offset);\r\n    offset -= (initialCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);\r\n    let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint);\r\n    while (offset > 0) {\r\n        const prevCodePoint = getPrevCodePoint(str, offset);\r\n        const prevGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(prevCodePoint);\r\n        if (breakBetweenGraphemeBreakType(prevGraphemeBreakType, graphemeBreakType)) {\r\n            break;\r\n        }\r\n        offset -= (prevCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);\r\n        graphemeBreakType = prevGraphemeBreakType;\r\n    }\r\n    return (initialOffset - offset);\r\n}\r\n/**\r\n * A manual decoding of a UTF8 string.\r\n * Use only in environments which do not offer native conversion methods!\r\n */\r\nfunction decodeUTF8(buffer) {\r\n    // https://en.wikipedia.org/wiki/UTF-8\r\n    const len = buffer.byteLength;\r\n    const result = [];\r\n    let offset = 0;\r\n    while (offset < len) {\r\n        const v0 = buffer[offset];\r\n        let codePoint;\r\n        if (v0 >= 0b11110000 && offset + 3 < len) {\r\n            // 4 bytes\r\n            codePoint = ((((buffer[offset++] & 0b00000111) << 18) >>> 0)\r\n                | (((buffer[offset++] & 0b00111111) << 12) >>> 0)\r\n                | (((buffer[offset++] & 0b00111111) << 6) >>> 0)\r\n                | (((buffer[offset++] & 0b00111111) << 0) >>> 0));\r\n        }\r\n        else if (v0 >= 0b11100000 && offset + 2 < len) {\r\n            // 3 bytes\r\n            codePoint = ((((buffer[offset++] & 0b00001111) << 12) >>> 0)\r\n                | (((buffer[offset++] & 0b00111111) << 6) >>> 0)\r\n                | (((buffer[offset++] & 0b00111111) << 0) >>> 0));\r\n        }\r\n        else if (v0 >= 0b11000000 && offset + 1 < len) {\r\n            // 2 bytes\r\n            codePoint = ((((buffer[offset++] & 0b00011111) << 6) >>> 0)\r\n                | (((buffer[offset++] & 0b00111111) << 0) >>> 0));\r\n        }\r\n        else {\r\n            // 1 byte\r\n            codePoint = buffer[offset++];\r\n        }\r\n        if ((codePoint >= 0 && codePoint <= 0xD7FF) || (codePoint >= 0xE000 && codePoint <= 0xFFFF)) {\r\n            // Basic Multilingual Plane\r\n            result.push(String.fromCharCode(codePoint));\r\n        }\r\n        else if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\r\n            // Supplementary Planes\r\n            const uPrime = codePoint - 0x10000;\r\n            const w1 = 0xD800 + ((uPrime & 0b11111111110000000000) >>> 10);\r\n            const w2 = 0xDC00 + ((uPrime & 0b00000000001111111111) >>> 0);\r\n            result.push(String.fromCharCode(w1));\r\n            result.push(String.fromCharCode(w2));\r\n        }\r\n        else {\r\n            // illegal code point\r\n            result.push(String.fromCharCode(0xFFFD));\r\n        }\r\n    }\r\n    return result.join('');\r\n}\r\n/**\r\n * Generated using https://github.com/alexdima/unicode-utils/blob/master/generate-rtl-test.js\r\n */\r\nconst CONTAINS_RTL = /(?:[\\u05BE\\u05C0\\u05C3\\u05C6\\u05D0-\\u05F4\\u0608\\u060B\\u060D\\u061B-\\u064A\\u066D-\\u066F\\u0671-\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1-\\u07EA\\u07F4\\u07F5\\u07FA-\\u0815\\u081A\\u0824\\u0828\\u0830-\\u0858\\u085E-\\u08BD\\u200F\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFD3D\\uFD50-\\uFDFC\\uFE70-\\uFEFC]|\\uD802[\\uDC00-\\uDD1B\\uDD20-\\uDE00\\uDE10-\\uDE33\\uDE40-\\uDEE4\\uDEEB-\\uDF35\\uDF40-\\uDFFF]|\\uD803[\\uDC00-\\uDCFF]|\\uD83A[\\uDC00-\\uDCCF\\uDD00-\\uDD43\\uDD50-\\uDFFF]|\\uD83B[\\uDC00-\\uDEBB])/;\r\n/**\r\n * Returns true if `str` contains any Unicode character that is classified as \"R\" or \"AL\".\r\n */\r\nfunction containsRTL(str) {\r\n    return CONTAINS_RTL.test(str);\r\n}\r\n/**\r\n * Generated using https://github.com/alexdima/unicode-utils/blob/master/generate-emoji-test.js\r\n */\r\nconst CONTAINS_EMOJI = /(?:[\\u231A\\u231B\\u23F0\\u23F3\\u2600-\\u27BF\\u2B50\\u2B55]|\\uD83C[\\uDDE6-\\uDDFF\\uDF00-\\uDFFF]|\\uD83D[\\uDC00-\\uDE4F\\uDE80-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD00-\\uDDFF\\uDE70-\\uDED6])/;\r\nfunction containsEmoji(str) {\r\n    return CONTAINS_EMOJI.test(str);\r\n}\r\nconst IS_BASIC_ASCII = /^[\\t\\n\\r\\x20-\\x7E]*$/;\r\n/**\r\n * Returns true if `str` contains only basic ASCII characters in the range 32 - 126 (including 32 and 126) or \\n, \\r, \\t\r\n */\r\nfunction isBasicASCII(str) {\r\n    return IS_BASIC_ASCII.test(str);\r\n}\r\nconst UNUSUAL_LINE_TERMINATORS = /[\\u2028\\u2029]/; // LINE SEPARATOR (LS) or PARAGRAPH SEPARATOR (PS)\r\n/**\r\n * Returns true if `str` contains unusual line terminators, like LS or PS\r\n */\r\nfunction containsUnusualLineTerminators(str) {\r\n    return UNUSUAL_LINE_TERMINATORS.test(str);\r\n}\r\nfunction containsFullWidthCharacter(str) {\r\n    for (let i = 0, len = str.length; i < len; i++) {\r\n        if (isFullWidthCharacter(str.charCodeAt(i))) {\r\n            return true;\r\n        }\r\n    }\r\n    return false;\r\n}\r\nfunction isFullWidthCharacter(charCode) {\r\n    // Do a cheap trick to better support wrapping of wide characters, treat them as 2 columns\r\n    // http://jrgraphix.net/research/unicode_blocks.php\r\n    //          2E80 — 2EFF   CJK Radicals Supplement\r\n    //          2F00 — 2FDF   Kangxi Radicals\r\n    //          2FF0 — 2FFF   Ideographic Description Characters\r\n    //          3000 — 303F   CJK Symbols and Punctuation\r\n    //          3040 — 309F   Hiragana\r\n    //          30A0 — 30FF   Katakana\r\n    //          3100 — 312F   Bopomofo\r\n    //          3130 — 318F   Hangul Compatibility Jamo\r\n    //          3190 — 319F   Kanbun\r\n    //          31A0 — 31BF   Bopomofo Extended\r\n    //          31F0 — 31FF   Katakana Phonetic Extensions\r\n    //          3200 — 32FF   Enclosed CJK Letters and Months\r\n    //          3300 — 33FF   CJK Compatibility\r\n    //          3400 — 4DBF   CJK Unified Ideographs Extension A\r\n    //          4DC0 — 4DFF   Yijing Hexagram Symbols\r\n    //          4E00 — 9FFF   CJK Unified Ideographs\r\n    //          A000 — A48F   Yi Syllables\r\n    //          A490 — A4CF   Yi Radicals\r\n    //          AC00 — D7AF   Hangul Syllables\r\n    // [IGNORE] D800 — DB7F   High Surrogates\r\n    // [IGNORE] DB80 — DBFF   High Private Use Surrogates\r\n    // [IGNORE] DC00 — DFFF   Low Surrogates\r\n    // [IGNORE] E000 — F8FF   Private Use Area\r\n    //          F900 — FAFF   CJK Compatibility Ideographs\r\n    // [IGNORE] FB00 — FB4F   Alphabetic Presentation Forms\r\n    // [IGNORE] FB50 — FDFF   Arabic Presentation Forms-A\r\n    // [IGNORE] FE00 — FE0F   Variation Selectors\r\n    // [IGNORE] FE20 — FE2F   Combining Half Marks\r\n    // [IGNORE] FE30 — FE4F   CJK Compatibility Forms\r\n    // [IGNORE] FE50 — FE6F   Small Form Variants\r\n    // [IGNORE] FE70 — FEFF   Arabic Presentation Forms-B\r\n    //          FF00 — FFEF   Halfwidth and Fullwidth Forms\r\n    //               [https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms]\r\n    //               of which FF01 - FF5E fullwidth ASCII of 21 to 7E\r\n    // [IGNORE]    and FF65 - FFDC halfwidth of Katakana and Hangul\r\n    // [IGNORE] FFF0 — FFFF   Specials\r\n    charCode = +charCode; // @perf\r\n    return ((charCode >= 0x2E80 && charCode <= 0xD7AF)\r\n        || (charCode >= 0xF900 && charCode <= 0xFAFF)\r\n        || (charCode >= 0xFF01 && charCode <= 0xFF5E));\r\n}\r\n/**\r\n * A fast function (therefore imprecise) to check if code points are emojis.\r\n * Generated using https://github.com/alexdima/unicode-utils/blob/master/generate-emoji-test.js\r\n */\r\nfunction isEmojiImprecise(x) {\r\n    return ((x >= 0x1F1E6 && x <= 0x1F1FF) || (x === 8986) || (x === 8987) || (x === 9200)\r\n        || (x === 9203) || (x >= 9728 && x <= 10175) || (x === 11088) || (x === 11093)\r\n        || (x >= 127744 && x <= 128591) || (x >= 128640 && x <= 128764)\r\n        || (x >= 128992 && x <= 129003) || (x >= 129280 && x <= 129535)\r\n        || (x >= 129648 && x <= 129750));\r\n}\r\n// -- UTF-8 BOM\r\nconst UTF8_BOM_CHARACTER = String.fromCharCode(65279 /* UTF8_BOM */);\r\nfunction startsWithUTF8BOM(str) {\r\n    return !!(str && str.length > 0 && str.charCodeAt(0) === 65279 /* UTF8_BOM */);\r\n}\r\nfunction containsUppercaseCharacter(target, ignoreEscapedChars = false) {\r\n    if (!target) {\r\n        return false;\r\n    }\r\n    if (ignoreEscapedChars) {\r\n        target = target.replace(/\\\\./g, '');\r\n    }\r\n    return target.toLowerCase() !== target;\r\n}\r\n/**\r\n * Produces 'a'-'z', followed by 'A'-'Z'... followed by 'a'-'z', etc.\r\n */\r\nfunction singleLetterHash(n) {\r\n    const LETTERS_CNT = (90 /* Z */ - 65 /* A */ + 1);\r\n    n = n % (2 * LETTERS_CNT);\r\n    if (n < LETTERS_CNT) {\r\n        return String.fromCharCode(97 /* a */ + n);\r\n    }\r\n    return String.fromCharCode(65 /* A */ + n - LETTERS_CNT);\r\n}\r\n//#region Unicode Grapheme Break\r\nfunction getGraphemeBreakType(codePoint) {\r\n    const graphemeBreakTree = GraphemeBreakTree.getInstance();\r\n    return graphemeBreakTree.getGraphemeBreakType(codePoint);\r\n}\r\nfunction breakBetweenGraphemeBreakType(breakTypeA, breakTypeB) {\r\n    // http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundary_Rules\r\n    // !!! Let's make the common case a bit faster\r\n    if (breakTypeA === 0 /* Other */) {\r\n        // see https://www.unicode.org/Public/13.0.0/ucd/auxiliary/GraphemeBreakTest-13.0.0d10.html#table\r\n        return (breakTypeB !== 5 /* Extend */ && breakTypeB !== 7 /* SpacingMark */);\r\n    }\r\n    // Do not break between a CR and LF. Otherwise, break before and after controls.\r\n    // GB3                                        CR × LF\r\n    // GB4                       (Control | CR | LF) ÷\r\n    // GB5                                           ÷ (Control | CR | LF)\r\n    if (breakTypeA === 2 /* CR */) {\r\n        if (breakTypeB === 3 /* LF */) {\r\n            return false; // GB3\r\n        }\r\n    }\r\n    if (breakTypeA === 4 /* Control */ || breakTypeA === 2 /* CR */ || breakTypeA === 3 /* LF */) {\r\n        return true; // GB4\r\n    }\r\n    if (breakTypeB === 4 /* Control */ || breakTypeB === 2 /* CR */ || breakTypeB === 3 /* LF */) {\r\n        return true; // GB5\r\n    }\r\n    // Do not break Hangul syllable sequences.\r\n    // GB6                                         L × (L | V | LV | LVT)\r\n    // GB7                                  (LV | V) × (V | T)\r\n    // GB8                                 (LVT | T) × T\r\n    if (breakTypeA === 8 /* L */) {\r\n        if (breakTypeB === 8 /* L */ || breakTypeB === 9 /* V */ || breakTypeB === 11 /* LV */ || breakTypeB === 12 /* LVT */) {\r\n            return false; // GB6\r\n        }\r\n    }\r\n    if (breakTypeA === 11 /* LV */ || breakTypeA === 9 /* V */) {\r\n        if (breakTypeB === 9 /* V */ || breakTypeB === 10 /* T */) {\r\n            return false; // GB7\r\n        }\r\n    }\r\n    if (breakTypeA === 12 /* LVT */ || breakTypeA === 10 /* T */) {\r\n        if (breakTypeB === 10 /* T */) {\r\n            return false; // GB8\r\n        }\r\n    }\r\n    // Do not break before extending characters or ZWJ.\r\n    // GB9                                           × (Extend | ZWJ)\r\n    if (breakTypeB === 5 /* Extend */ || breakTypeB === 13 /* ZWJ */) {\r\n        return false; // GB9\r\n    }\r\n    // The GB9a and GB9b rules only apply to extended grapheme clusters:\r\n    // Do not break before SpacingMarks, or after Prepend characters.\r\n    // GB9a                                          × SpacingMark\r\n    // GB9b                                  Prepend ×\r\n    if (breakTypeB === 7 /* SpacingMark */) {\r\n        return false; // GB9a\r\n    }\r\n    if (breakTypeA === 1 /* Prepend */) {\r\n        return false; // GB9b\r\n    }\r\n    // Do not break within emoji modifier sequences or emoji zwj sequences.\r\n    // GB11    \\p{Extended_Pictographic} Extend* ZWJ × \\p{Extended_Pictographic}\r\n    if (breakTypeA === 13 /* ZWJ */ && breakTypeB === 14 /* Extended_Pictographic */) {\r\n        // Note: we are not implementing the rule entirely here to avoid introducing states\r\n        return false; // GB11\r\n    }\r\n    // GB12                          sot (RI RI)* RI × RI\r\n    // GB13                        [^RI] (RI RI)* RI × RI\r\n    if (breakTypeA === 6 /* Regional_Indicator */ && breakTypeB === 6 /* Regional_Indicator */) {\r\n        // Note: we are not implementing the rule entirely here to avoid introducing states\r\n        return false; // GB12 & GB13\r\n    }\r\n    // GB999                                     Any ÷ Any\r\n    return true;\r\n}\r\nclass GraphemeBreakTree {\r\n    constructor() {\r\n        this._data = getGraphemeBreakRawData();\r\n    }\r\n    static getInstance() {\r\n        if (!GraphemeBreakTree._INSTANCE) {\r\n            GraphemeBreakTree._INSTANCE = new GraphemeBreakTree();\r\n        }\r\n        return GraphemeBreakTree._INSTANCE;\r\n    }\r\n    getGraphemeBreakType(codePoint) {\r\n        // !!! Let's make 7bit ASCII a bit faster: 0..31\r\n        if (codePoint < 32) {\r\n            if (codePoint === 10 /* LineFeed */) {\r\n                return 3 /* LF */;\r\n            }\r\n            if (codePoint === 13 /* CarriageReturn */) {\r\n                return 2 /* CR */;\r\n            }\r\n            return 4 /* Control */;\r\n        }\r\n        // !!! Let's make 7bit ASCII a bit faster: 32..126\r\n        if (codePoint < 127) {\r\n            return 0 /* Other */;\r\n        }\r\n        const data = this._data;\r\n        const nodeCount = data.length / 3;\r\n        let nodeIndex = 1;\r\n        while (nodeIndex <= nodeCount) {\r\n            if (codePoint < data[3 * nodeIndex]) {\r\n                // go left\r\n                nodeIndex = 2 * nodeIndex;\r\n            }\r\n            else if (codePoint > data[3 * nodeIndex + 1]) {\r\n                // go right\r\n                nodeIndex = 2 * nodeIndex + 1;\r\n            }\r\n            else {\r\n                // hit\r\n                return data[3 * nodeIndex + 2];\r\n            }\r\n        }\r\n        return 0 /* Other */;\r\n    }\r\n}\r\nGraphemeBreakTree._INSTANCE = null;\r\nfunction getGraphemeBreakRawData() {\r\n    // generated using https://github.com/alexdima/unicode-utils/blob/master/generate-grapheme-break.js\r\n    return JSON.parse('[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]');\r\n}\r\n//#endregion\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/strings.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/types.js":
/*!****************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/types.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"isArray\": () => (/* binding */ isArray),\n/* harmony export */   \"isString\": () => (/* binding */ isString),\n/* harmony export */   \"isObject\": () => (/* binding */ isObject),\n/* harmony export */   \"isNumber\": () => (/* binding */ isNumber),\n/* harmony export */   \"isBoolean\": () => (/* binding */ isBoolean),\n/* harmony export */   \"isUndefined\": () => (/* binding */ isUndefined),\n/* harmony export */   \"isUndefinedOrNull\": () => (/* binding */ isUndefinedOrNull),\n/* harmony export */   \"assertType\": () => (/* binding */ assertType),\n/* harmony export */   \"assertIsDefined\": () => (/* binding */ assertIsDefined),\n/* harmony export */   \"isFunction\": () => (/* binding */ isFunction),\n/* harmony export */   \"validateConstraints\": () => (/* binding */ validateConstraints),\n/* harmony export */   \"validateConstraint\": () => (/* binding */ validateConstraint),\n/* harmony export */   \"getAllPropertyNames\": () => (/* binding */ getAllPropertyNames),\n/* harmony export */   \"getAllMethodNames\": () => (/* binding */ getAllMethodNames),\n/* harmony export */   \"createProxyObject\": () => (/* binding */ createProxyObject),\n/* harmony export */   \"withNullAsUndefined\": () => (/* binding */ withNullAsUndefined)\n/* harmony export */ });\n/**\r\n * @returns whether the provided parameter is a JavaScript Array or not.\r\n */\r\nfunction isArray(array) {\r\n    return Array.isArray(array);\r\n}\r\n/**\r\n * @returns whether the provided parameter is a JavaScript String or not.\r\n */\r\nfunction isString(str) {\r\n    return (typeof str === 'string');\r\n}\r\n/**\r\n *\r\n * @returns whether the provided parameter is of type `object` but **not**\r\n *\t`null`, an `array`, a `regexp`, nor a `date`.\r\n */\r\nfunction isObject(obj) {\r\n    // The method can't do a type cast since there are type (like strings) which\r\n    // are subclasses of any put not positvely matched by the function. Hence type\r\n    // narrowing results in wrong results.\r\n    return typeof obj === 'object'\r\n        && obj !== null\r\n        && !Array.isArray(obj)\r\n        && !(obj instanceof RegExp)\r\n        && !(obj instanceof Date);\r\n}\r\n/**\r\n * In **contrast** to just checking `typeof` this will return `false` for `NaN`.\r\n * @returns whether the provided parameter is a JavaScript Number or not.\r\n */\r\nfunction isNumber(obj) {\r\n    return (typeof obj === 'number' && !isNaN(obj));\r\n}\r\n/**\r\n * @returns whether the provided parameter is a JavaScript Boolean or not.\r\n */\r\nfunction isBoolean(obj) {\r\n    return (obj === true || obj === false);\r\n}\r\n/**\r\n * @returns whether the provided parameter is undefined.\r\n */\r\nfunction isUndefined(obj) {\r\n    return (typeof obj === 'undefined');\r\n}\r\n/**\r\n * @returns whether the provided parameter is undefined or null.\r\n */\r\nfunction isUndefinedOrNull(obj) {\r\n    return (isUndefined(obj) || obj === null);\r\n}\r\nfunction assertType(condition, type) {\r\n    if (!condition) {\r\n        throw new Error(type ? `Unexpected type, expected '${type}'` : 'Unexpected type');\r\n    }\r\n}\r\n/**\r\n * Asserts that the argument passed in is neither undefined nor null.\r\n */\r\nfunction assertIsDefined(arg) {\r\n    if (isUndefinedOrNull(arg)) {\r\n        throw new Error('Assertion Failed: argument is undefined or null');\r\n    }\r\n    return arg;\r\n}\r\n/**\r\n * @returns whether the provided parameter is a JavaScript Function or not.\r\n */\r\nfunction isFunction(obj) {\r\n    return (typeof obj === 'function');\r\n}\r\nfunction validateConstraints(args, constraints) {\r\n    const len = Math.min(args.length, constraints.length);\r\n    for (let i = 0; i < len; i++) {\r\n        validateConstraint(args[i], constraints[i]);\r\n    }\r\n}\r\nfunction validateConstraint(arg, constraint) {\r\n    if (isString(constraint)) {\r\n        if (typeof arg !== constraint) {\r\n            throw new Error(`argument does not match constraint: typeof ${constraint}`);\r\n        }\r\n    }\r\n    else if (isFunction(constraint)) {\r\n        try {\r\n            if (arg instanceof constraint) {\r\n                return;\r\n            }\r\n        }\r\n        catch (_a) {\r\n            // ignore\r\n        }\r\n        if (!isUndefinedOrNull(arg) && arg.constructor === constraint) {\r\n            return;\r\n        }\r\n        if (constraint.length === 1 && constraint.call(undefined, arg) === true) {\r\n            return;\r\n        }\r\n        throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`);\r\n    }\r\n}\r\nfunction getAllPropertyNames(obj) {\r\n    let res = [];\r\n    let proto = Object.getPrototypeOf(obj);\r\n    while (Object.prototype !== proto) {\r\n        res = res.concat(Object.getOwnPropertyNames(proto));\r\n        proto = Object.getPrototypeOf(proto);\r\n    }\r\n    return res;\r\n}\r\nfunction getAllMethodNames(obj) {\r\n    const methods = [];\r\n    for (const prop of getAllPropertyNames(obj)) {\r\n        if (typeof obj[prop] === 'function') {\r\n            methods.push(prop);\r\n        }\r\n    }\r\n    return methods;\r\n}\r\nfunction createProxyObject(methodNames, invoke) {\r\n    const createProxyMethod = (method) => {\r\n        return function () {\r\n            const args = Array.prototype.slice.call(arguments, 0);\r\n            return invoke(method, args);\r\n        };\r\n    };\r\n    let result = {};\r\n    for (const methodName of methodNames) {\r\n        result[methodName] = createProxyMethod(methodName);\r\n    }\r\n    return result;\r\n}\r\n/**\r\n * Converts null to undefined, passes all other values through.\r\n */\r\nfunction withNullAsUndefined(x) {\r\n    return x === null ? undefined : x;\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/types.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/uint.js":
/*!***************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/uint.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"toUint8\": () => (/* binding */ toUint8),\n/* harmony export */   \"toUint32\": () => (/* binding */ toUint32)\n/* harmony export */ });\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nfunction toUint8(v) {\r\n    if (v < 0) {\r\n        return 0;\r\n    }\r\n    if (v > 255 /* MAX_UINT_8 */) {\r\n        return 255 /* MAX_UINT_8 */;\r\n    }\r\n    return v | 0;\r\n}\r\nfunction toUint32(v) {\r\n    if (v < 0) {\r\n        return 0;\r\n    }\r\n    if (v > 4294967295 /* MAX_UINT_32 */) {\r\n        return 4294967295 /* MAX_UINT_32 */;\r\n    }\r\n    return v | 0;\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/uint.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/uri.js":
/*!**************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/uri.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"URI\": () => (/* binding */ URI),\n/* harmony export */   \"uriToFsPath\": () => (/* binding */ uriToFsPath)\n/* harmony export */ });\n/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ \"./node_modules/monaco-editor/esm/vs/base/common/platform.js\");\n/* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./path.js */ \"./node_modules/monaco-editor/esm/vs/base/common/path.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n\r\nconst _schemePattern = /^\\w[\\w\\d+.-]*$/;\r\nconst _singleSlashStart = /^\\//;\r\nconst _doubleSlashStart = /^\\/\\//;\r\nfunction _validateUri(ret, _strict) {\r\n    // scheme, must be set\r\n    if (!ret.scheme && _strict) {\r\n        throw new Error(`[UriError]: Scheme is missing: {scheme: \"\", authority: \"${ret.authority}\", path: \"${ret.path}\", query: \"${ret.query}\", fragment: \"${ret.fragment}\"}`);\r\n    }\r\n    // scheme, https://tools.ietf.org/html/rfc3986#section-3.1\r\n    // ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\r\n    if (ret.scheme && !_schemePattern.test(ret.scheme)) {\r\n        throw new Error('[UriError]: Scheme contains illegal characters.');\r\n    }\r\n    // path, http://tools.ietf.org/html/rfc3986#section-3.3\r\n    // If a URI contains an authority component, then the path component\r\n    // must either be empty or begin with a slash (\"/\") character.  If a URI\r\n    // does not contain an authority component, then the path cannot begin\r\n    // with two slash characters (\"//\").\r\n    if (ret.path) {\r\n        if (ret.authority) {\r\n            if (!_singleSlashStart.test(ret.path)) {\r\n                throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash (\"/\") character');\r\n            }\r\n        }\r\n        else {\r\n            if (_doubleSlashStart.test(ret.path)) {\r\n                throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters (\"//\")');\r\n            }\r\n        }\r\n    }\r\n}\r\n// for a while we allowed uris *without* schemes and this is the migration\r\n// for them, e.g. an uri without scheme and without strict-mode warns and falls\r\n// back to the file-scheme. that should cause the least carnage and still be a\r\n// clear warning\r\nfunction _schemeFix(scheme, _strict) {\r\n    if (!scheme && !_strict) {\r\n        return 'file';\r\n    }\r\n    return scheme;\r\n}\r\n// implements a bit of https://tools.ietf.org/html/rfc3986#section-5\r\nfunction _referenceResolution(scheme, path) {\r\n    // the slash-character is our 'default base' as we don't\r\n    // support constructing URIs relative to other URIs. This\r\n    // also means that we alter and potentially break paths.\r\n    // see https://tools.ietf.org/html/rfc3986#section-5.1.4\r\n    switch (scheme) {\r\n        case 'https':\r\n        case 'http':\r\n        case 'file':\r\n            if (!path) {\r\n                path = _slash;\r\n            }\r\n            else if (path[0] !== _slash) {\r\n                path = _slash + path;\r\n            }\r\n            break;\r\n    }\r\n    return path;\r\n}\r\nconst _empty = '';\r\nconst _slash = '/';\r\nconst _regexp = /^(([^:/?#]+?):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/;\r\n/**\r\n * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.\r\n * This class is a simple parser which creates the basic component parts\r\n * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation\r\n * and encoding.\r\n *\r\n * ```txt\r\n *       foo://example.com:8042/over/there?name=ferret#nose\r\n *       \\_/   \\______________/\\_________/ \\_________/ \\__/\r\n *        |           |            |            |        |\r\n *     scheme     authority       path        query   fragment\r\n *        |   _____________________|__\r\n *       / \\ /                        \\\r\n *       urn:example:animal:ferret:nose\r\n * ```\r\n */\r\nclass URI {\r\n    /**\r\n     * @internal\r\n     */\r\n    constructor(schemeOrData, authority, path, query, fragment, _strict = false) {\r\n        if (typeof schemeOrData === 'object') {\r\n            this.scheme = schemeOrData.scheme || _empty;\r\n            this.authority = schemeOrData.authority || _empty;\r\n            this.path = schemeOrData.path || _empty;\r\n            this.query = schemeOrData.query || _empty;\r\n            this.fragment = schemeOrData.fragment || _empty;\r\n            // no validation because it's this URI\r\n            // that creates uri components.\r\n            // _validateUri(this);\r\n        }\r\n        else {\r\n            this.scheme = _schemeFix(schemeOrData, _strict);\r\n            this.authority = authority || _empty;\r\n            this.path = _referenceResolution(this.scheme, path || _empty);\r\n            this.query = query || _empty;\r\n            this.fragment = fragment || _empty;\r\n            _validateUri(this, _strict);\r\n        }\r\n    }\r\n    static isUri(thing) {\r\n        if (thing instanceof URI) {\r\n            return true;\r\n        }\r\n        if (!thing) {\r\n            return false;\r\n        }\r\n        return typeof thing.authority === 'string'\r\n            && typeof thing.fragment === 'string'\r\n            && typeof thing.path === 'string'\r\n            && typeof thing.query === 'string'\r\n            && typeof thing.scheme === 'string'\r\n            && typeof thing.fsPath === 'string'\r\n            && typeof thing.with === 'function'\r\n            && typeof thing.toString === 'function';\r\n    }\r\n    // ---- filesystem path -----------------------\r\n    /**\r\n     * Returns a string representing the corresponding file system path of this URI.\r\n     * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the\r\n     * platform specific path separator.\r\n     *\r\n     * * Will *not* validate the path for invalid characters and semantics.\r\n     * * Will *not* look at the scheme of this URI.\r\n     * * The result shall *not* be used for display purposes but for accessing a file on disk.\r\n     *\r\n     *\r\n     * The *difference* to `URI#path` is the use of the platform specific separator and the handling\r\n     * of UNC paths. See the below sample of a file-uri with an authority (UNC path).\r\n     *\r\n     * ```ts\r\n        const u = URI.parse('file://server/c$/folder/file.txt')\r\n        u.authority === 'server'\r\n        u.path === '/shares/c$/file.txt'\r\n        u.fsPath === '\\\\server\\c$\\folder\\file.txt'\r\n    ```\r\n     *\r\n     * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,\r\n     * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working\r\n     * with URIs that represent files on disk (`file` scheme).\r\n     */\r\n    get fsPath() {\r\n        // if (this.scheme !== 'file') {\r\n        // \tconsole.warn(`[UriError] calling fsPath with scheme ${this.scheme}`);\r\n        // }\r\n        return uriToFsPath(this, false);\r\n    }\r\n    // ---- modify to new -------------------------\r\n    with(change) {\r\n        if (!change) {\r\n            return this;\r\n        }\r\n        let { scheme, authority, path, query, fragment } = change;\r\n        if (scheme === undefined) {\r\n            scheme = this.scheme;\r\n        }\r\n        else if (scheme === null) {\r\n            scheme = _empty;\r\n        }\r\n        if (authority === undefined) {\r\n            authority = this.authority;\r\n        }\r\n        else if (authority === null) {\r\n            authority = _empty;\r\n        }\r\n        if (path === undefined) {\r\n            path = this.path;\r\n        }\r\n        else if (path === null) {\r\n            path = _empty;\r\n        }\r\n        if (query === undefined) {\r\n            query = this.query;\r\n        }\r\n        else if (query === null) {\r\n            query = _empty;\r\n        }\r\n        if (fragment === undefined) {\r\n            fragment = this.fragment;\r\n        }\r\n        else if (fragment === null) {\r\n            fragment = _empty;\r\n        }\r\n        if (scheme === this.scheme\r\n            && authority === this.authority\r\n            && path === this.path\r\n            && query === this.query\r\n            && fragment === this.fragment) {\r\n            return this;\r\n        }\r\n        return new Uri(scheme, authority, path, query, fragment);\r\n    }\r\n    // ---- parse & validate ------------------------\r\n    /**\r\n     * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`,\r\n     * `file:///usr/home`, or `scheme:with/path`.\r\n     *\r\n     * @param value A string which represents an URI (see `URI#toString`).\r\n     */\r\n    static parse(value, _strict = false) {\r\n        const match = _regexp.exec(value);\r\n        if (!match) {\r\n            return new Uri(_empty, _empty, _empty, _empty, _empty);\r\n        }\r\n        return new Uri(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict);\r\n    }\r\n    /**\r\n     * Creates a new URI from a file system path, e.g. `c:\\my\\files`,\r\n     * `/usr/home`, or `\\\\server\\share\\some\\path`.\r\n     *\r\n     * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument\r\n     * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**\r\n     * `URI.parse('file://' + path)` because the path might contain characters that are\r\n     * interpreted (# and ?). See the following sample:\r\n     * ```ts\r\n    const good = URI.file('/coding/c#/project1');\r\n    good.scheme === 'file';\r\n    good.path === '/coding/c#/project1';\r\n    good.fragment === '';\r\n    const bad = URI.parse('file://' + '/coding/c#/project1');\r\n    bad.scheme === 'file';\r\n    bad.path === '/coding/c'; // path is now broken\r\n    bad.fragment === '/project1';\r\n    ```\r\n     *\r\n     * @param path A file system path (see `URI#fsPath`)\r\n     */\r\n    static file(path) {\r\n        let authority = _empty;\r\n        // normalize to fwd-slashes on windows,\r\n        // on other systems bwd-slashes are valid\r\n        // filename character, eg /f\\oo/ba\\r.txt\r\n        if (_platform_js__WEBPACK_IMPORTED_MODULE_0__.isWindows) {\r\n            path = path.replace(/\\\\/g, _slash);\r\n        }\r\n        // check for authority as used in UNC shares\r\n        // or use the path as given\r\n        if (path[0] === _slash && path[1] === _slash) {\r\n            const idx = path.indexOf(_slash, 2);\r\n            if (idx === -1) {\r\n                authority = path.substring(2);\r\n                path = _slash;\r\n            }\r\n            else {\r\n                authority = path.substring(2, idx);\r\n                path = path.substring(idx) || _slash;\r\n            }\r\n        }\r\n        return new Uri('file', authority, path, _empty, _empty);\r\n    }\r\n    static from(components) {\r\n        return new Uri(components.scheme, components.authority, components.path, components.query, components.fragment);\r\n    }\r\n    /**\r\n     * Join a URI path with path fragments and normalizes the resulting path.\r\n     *\r\n     * @param uri The input URI.\r\n     * @param pathFragment The path fragment to add to the URI path.\r\n     * @returns The resulting URI.\r\n     */\r\n    static joinPath(uri, ...pathFragment) {\r\n        if (!uri.path) {\r\n            throw new Error(`[UriError]: cannot call joinPath on URI without path`);\r\n        }\r\n        let newPath;\r\n        if (_platform_js__WEBPACK_IMPORTED_MODULE_0__.isWindows && uri.scheme === 'file') {\r\n            newPath = URI.file(_path_js__WEBPACK_IMPORTED_MODULE_1__.win32.join(uriToFsPath(uri, true), ...pathFragment)).path;\r\n        }\r\n        else {\r\n            newPath = _path_js__WEBPACK_IMPORTED_MODULE_1__.posix.join(uri.path, ...pathFragment);\r\n        }\r\n        return uri.with({ path: newPath });\r\n    }\r\n    // ---- printing/externalize ---------------------------\r\n    /**\r\n     * Creates a string representation for this URI. It's guaranteed that calling\r\n     * `URI.parse` with the result of this function creates an URI which is equal\r\n     * to this URI.\r\n     *\r\n     * * The result shall *not* be used for display purposes but for externalization or transport.\r\n     * * The result will be encoded using the percentage encoding and encoding happens mostly\r\n     * ignore the scheme-specific encoding rules.\r\n     *\r\n     * @param skipEncoding Do not encode the result, default is `false`\r\n     */\r\n    toString(skipEncoding = false) {\r\n        return _asFormatted(this, skipEncoding);\r\n    }\r\n    toJSON() {\r\n        return this;\r\n    }\r\n    static revive(data) {\r\n        if (!data) {\r\n            return data;\r\n        }\r\n        else if (data instanceof URI) {\r\n            return data;\r\n        }\r\n        else {\r\n            const result = new Uri(data);\r\n            result._formatted = data.external;\r\n            result._fsPath = data._sep === _pathSepMarker ? data.fsPath : null;\r\n            return result;\r\n        }\r\n    }\r\n}\r\nconst _pathSepMarker = _platform_js__WEBPACK_IMPORTED_MODULE_0__.isWindows ? 1 : undefined;\r\n// This class exists so that URI is compatibile with vscode.Uri (API).\r\nclass Uri extends URI {\r\n    constructor() {\r\n        super(...arguments);\r\n        this._formatted = null;\r\n        this._fsPath = null;\r\n    }\r\n    get fsPath() {\r\n        if (!this._fsPath) {\r\n            this._fsPath = uriToFsPath(this, false);\r\n        }\r\n        return this._fsPath;\r\n    }\r\n    toString(skipEncoding = false) {\r\n        if (!skipEncoding) {\r\n            if (!this._formatted) {\r\n                this._formatted = _asFormatted(this, false);\r\n            }\r\n            return this._formatted;\r\n        }\r\n        else {\r\n            // we don't cache that\r\n            return _asFormatted(this, true);\r\n        }\r\n    }\r\n    toJSON() {\r\n        const res = {\r\n            $mid: 1\r\n        };\r\n        // cached state\r\n        if (this._fsPath) {\r\n            res.fsPath = this._fsPath;\r\n            res._sep = _pathSepMarker;\r\n        }\r\n        if (this._formatted) {\r\n            res.external = this._formatted;\r\n        }\r\n        // uri components\r\n        if (this.path) {\r\n            res.path = this.path;\r\n        }\r\n        if (this.scheme) {\r\n            res.scheme = this.scheme;\r\n        }\r\n        if (this.authority) {\r\n            res.authority = this.authority;\r\n        }\r\n        if (this.query) {\r\n            res.query = this.query;\r\n        }\r\n        if (this.fragment) {\r\n            res.fragment = this.fragment;\r\n        }\r\n        return res;\r\n    }\r\n}\r\n// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2\r\nconst encodeTable = {\r\n    [58 /* Colon */]: '%3A',\r\n    [47 /* Slash */]: '%2F',\r\n    [63 /* QuestionMark */]: '%3F',\r\n    [35 /* Hash */]: '%23',\r\n    [91 /* OpenSquareBracket */]: '%5B',\r\n    [93 /* CloseSquareBracket */]: '%5D',\r\n    [64 /* AtSign */]: '%40',\r\n    [33 /* ExclamationMark */]: '%21',\r\n    [36 /* DollarSign */]: '%24',\r\n    [38 /* Ampersand */]: '%26',\r\n    [39 /* SingleQuote */]: '%27',\r\n    [40 /* OpenParen */]: '%28',\r\n    [41 /* CloseParen */]: '%29',\r\n    [42 /* Asterisk */]: '%2A',\r\n    [43 /* Plus */]: '%2B',\r\n    [44 /* Comma */]: '%2C',\r\n    [59 /* Semicolon */]: '%3B',\r\n    [61 /* Equals */]: '%3D',\r\n    [32 /* Space */]: '%20',\r\n};\r\nfunction encodeURIComponentFast(uriComponent, allowSlash) {\r\n    let res = undefined;\r\n    let nativeEncodePos = -1;\r\n    for (let pos = 0; pos < uriComponent.length; pos++) {\r\n        const code = uriComponent.charCodeAt(pos);\r\n        // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3\r\n        if ((code >= 97 /* a */ && code <= 122 /* z */)\r\n            || (code >= 65 /* A */ && code <= 90 /* Z */)\r\n            || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */)\r\n            || code === 45 /* Dash */\r\n            || code === 46 /* Period */\r\n            || code === 95 /* Underline */\r\n            || code === 126 /* Tilde */\r\n            || (allowSlash && code === 47 /* Slash */)) {\r\n            // check if we are delaying native encode\r\n            if (nativeEncodePos !== -1) {\r\n                res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));\r\n                nativeEncodePos = -1;\r\n            }\r\n            // check if we write into a new string (by default we try to return the param)\r\n            if (res !== undefined) {\r\n                res += uriComponent.charAt(pos);\r\n            }\r\n        }\r\n        else {\r\n            // encoding needed, we need to allocate a new string\r\n            if (res === undefined) {\r\n                res = uriComponent.substr(0, pos);\r\n            }\r\n            // check with default table first\r\n            const escaped = encodeTable[code];\r\n            if (escaped !== undefined) {\r\n                // check if we are delaying native encode\r\n                if (nativeEncodePos !== -1) {\r\n                    res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));\r\n                    nativeEncodePos = -1;\r\n                }\r\n                // append escaped variant to result\r\n                res += escaped;\r\n            }\r\n            else if (nativeEncodePos === -1) {\r\n                // use native encode only when needed\r\n                nativeEncodePos = pos;\r\n            }\r\n        }\r\n    }\r\n    if (nativeEncodePos !== -1) {\r\n        res += encodeURIComponent(uriComponent.substring(nativeEncodePos));\r\n    }\r\n    return res !== undefined ? res : uriComponent;\r\n}\r\nfunction encodeURIComponentMinimal(path) {\r\n    let res = undefined;\r\n    for (let pos = 0; pos < path.length; pos++) {\r\n        const code = path.charCodeAt(pos);\r\n        if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) {\r\n            if (res === undefined) {\r\n                res = path.substr(0, pos);\r\n            }\r\n            res += encodeTable[code];\r\n        }\r\n        else {\r\n            if (res !== undefined) {\r\n                res += path[pos];\r\n            }\r\n        }\r\n    }\r\n    return res !== undefined ? res : path;\r\n}\r\n/**\r\n * Compute `fsPath` for the given uri\r\n */\r\nfunction uriToFsPath(uri, keepDriveLetterCasing) {\r\n    let value;\r\n    if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {\r\n        // unc path: file://shares/c$/far/boo\r\n        value = `//${uri.authority}${uri.path}`;\r\n    }\r\n    else if (uri.path.charCodeAt(0) === 47 /* Slash */\r\n        && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */)\r\n        && uri.path.charCodeAt(2) === 58 /* Colon */) {\r\n        if (!keepDriveLetterCasing) {\r\n            // windows drive letter: file:///c:/far/boo\r\n            value = uri.path[1].toLowerCase() + uri.path.substr(2);\r\n        }\r\n        else {\r\n            value = uri.path.substr(1);\r\n        }\r\n    }\r\n    else {\r\n        // other path\r\n        value = uri.path;\r\n    }\r\n    if (_platform_js__WEBPACK_IMPORTED_MODULE_0__.isWindows) {\r\n        value = value.replace(/\\//g, '\\\\');\r\n    }\r\n    return value;\r\n}\r\n/**\r\n * Create the external version of a uri\r\n */\r\nfunction _asFormatted(uri, skipEncoding) {\r\n    const encoder = !skipEncoding\r\n        ? encodeURIComponentFast\r\n        : encodeURIComponentMinimal;\r\n    let res = '';\r\n    let { scheme, authority, path, query, fragment } = uri;\r\n    if (scheme) {\r\n        res += scheme;\r\n        res += ':';\r\n    }\r\n    if (authority || scheme === 'file') {\r\n        res += _slash;\r\n        res += _slash;\r\n    }\r\n    if (authority) {\r\n        let idx = authority.indexOf('@');\r\n        if (idx !== -1) {\r\n            // <user>@<auth>\r\n            const userinfo = authority.substr(0, idx);\r\n            authority = authority.substr(idx + 1);\r\n            idx = userinfo.indexOf(':');\r\n            if (idx === -1) {\r\n                res += encoder(userinfo, false);\r\n            }\r\n            else {\r\n                // <user>:<pass>@<auth>\r\n                res += encoder(userinfo.substr(0, idx), false);\r\n                res += ':';\r\n                res += encoder(userinfo.substr(idx + 1), false);\r\n            }\r\n            res += '@';\r\n        }\r\n        authority = authority.toLowerCase();\r\n        idx = authority.indexOf(':');\r\n        if (idx === -1) {\r\n            res += encoder(authority, false);\r\n        }\r\n        else {\r\n            // <auth>:<port>\r\n            res += encoder(authority.substr(0, idx), false);\r\n            res += authority.substr(idx);\r\n        }\r\n    }\r\n    if (path) {\r\n        // lower-case windows drive letters in /C:/fff or C:/fff\r\n        if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) {\r\n            const code = path.charCodeAt(1);\r\n            if (code >= 65 /* A */ && code <= 90 /* Z */) {\r\n                path = `/${String.fromCharCode(code + 32)}:${path.substr(3)}`; // \"/c:\".length === 3\r\n            }\r\n        }\r\n        else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) {\r\n            const code = path.charCodeAt(0);\r\n            if (code >= 65 /* A */ && code <= 90 /* Z */) {\r\n                path = `${String.fromCharCode(code + 32)}:${path.substr(2)}`; // \"/c:\".length === 3\r\n            }\r\n        }\r\n        // encode the rest of the path\r\n        res += encoder(path, true);\r\n    }\r\n    if (query) {\r\n        res += '?';\r\n        res += encoder(query, false);\r\n    }\r\n    if (fragment) {\r\n        res += '#';\r\n        res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment;\r\n    }\r\n    return res;\r\n}\r\n// --- decode\r\nfunction decodeURIComponentGraceful(str) {\r\n    try {\r\n        return decodeURIComponent(str);\r\n    }\r\n    catch (_a) {\r\n        if (str.length > 3) {\r\n            return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3));\r\n        }\r\n        else {\r\n            return str;\r\n        }\r\n    }\r\n}\r\nconst _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g;\r\nfunction percentDecode(str) {\r\n    if (!str.match(_rEncodedAsHex)) {\r\n        return str;\r\n    }\r\n    return str.replace(_rEncodedAsHex, (match) => decodeURIComponentGraceful(match));\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/uri.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js":
/*!******************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js ***!
  \******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"logOnceWebWorkerWarning\": () => (/* binding */ logOnceWebWorkerWarning),\n/* harmony export */   \"SimpleWorkerClient\": () => (/* binding */ SimpleWorkerClient),\n/* harmony export */   \"SimpleWorkerServer\": () => (/* binding */ SimpleWorkerServer),\n/* harmony export */   \"create\": () => (/* binding */ create)\n/* harmony export */ });\n/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors.js */ \"./node_modules/monaco-editor/esm/vs/base/common/errors.js\");\n/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lifecycle.js */ \"./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js\");\n/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform.js */ \"./node_modules/monaco-editor/esm/vs/base/common/platform.js\");\n/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../types.js */ \"./node_modules/monaco-editor/esm/vs/base/common/types.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n\r\n\r\n\r\nconst INITIALIZE = '$initialize';\r\nlet webWorkerWarningLogged = false;\r\nfunction logOnceWebWorkerWarning(err) {\r\n    if (!_platform_js__WEBPACK_IMPORTED_MODULE_2__.isWeb) {\r\n        // running tests\r\n        return;\r\n    }\r\n    if (!webWorkerWarningLogged) {\r\n        webWorkerWarningLogged = true;\r\n        console.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq');\r\n    }\r\n    console.warn(err.message);\r\n}\r\nclass SimpleWorkerProtocol {\r\n    constructor(handler) {\r\n        this._workerId = -1;\r\n        this._handler = handler;\r\n        this._lastSentReq = 0;\r\n        this._pendingReplies = Object.create(null);\r\n    }\r\n    setWorkerId(workerId) {\r\n        this._workerId = workerId;\r\n    }\r\n    sendMessage(method, args) {\r\n        let req = String(++this._lastSentReq);\r\n        return new Promise((resolve, reject) => {\r\n            this._pendingReplies[req] = {\r\n                resolve: resolve,\r\n                reject: reject\r\n            };\r\n            this._send({\r\n                vsWorker: this._workerId,\r\n                req: req,\r\n                method: method,\r\n                args: args\r\n            });\r\n        });\r\n    }\r\n    handleMessage(message) {\r\n        if (!message || !message.vsWorker) {\r\n            return;\r\n        }\r\n        if (this._workerId !== -1 && message.vsWorker !== this._workerId) {\r\n            return;\r\n        }\r\n        this._handleMessage(message);\r\n    }\r\n    _handleMessage(msg) {\r\n        if (msg.seq) {\r\n            let replyMessage = msg;\r\n            if (!this._pendingReplies[replyMessage.seq]) {\r\n                console.warn('Got reply to unknown seq');\r\n                return;\r\n            }\r\n            let reply = this._pendingReplies[replyMessage.seq];\r\n            delete this._pendingReplies[replyMessage.seq];\r\n            if (replyMessage.err) {\r\n                let err = replyMessage.err;\r\n                if (replyMessage.err.$isError) {\r\n                    err = new Error();\r\n                    err.name = replyMessage.err.name;\r\n                    err.message = replyMessage.err.message;\r\n                    err.stack = replyMessage.err.stack;\r\n                }\r\n                reply.reject(err);\r\n                return;\r\n            }\r\n            reply.resolve(replyMessage.res);\r\n            return;\r\n        }\r\n        let requestMessage = msg;\r\n        let req = requestMessage.req;\r\n        let result = this._handler.handleMessage(requestMessage.method, requestMessage.args);\r\n        result.then((r) => {\r\n            this._send({\r\n                vsWorker: this._workerId,\r\n                seq: req,\r\n                res: r,\r\n                err: undefined\r\n            });\r\n        }, (e) => {\r\n            if (e.detail instanceof Error) {\r\n                // Loading errors have a detail property that points to the actual error\r\n                e.detail = (0,_errors_js__WEBPACK_IMPORTED_MODULE_0__.transformErrorForSerialization)(e.detail);\r\n            }\r\n            this._send({\r\n                vsWorker: this._workerId,\r\n                seq: req,\r\n                res: undefined,\r\n                err: (0,_errors_js__WEBPACK_IMPORTED_MODULE_0__.transformErrorForSerialization)(e)\r\n            });\r\n        });\r\n    }\r\n    _send(msg) {\r\n        let transfer = [];\r\n        if (msg.req) {\r\n            const m = msg;\r\n            for (let i = 0; i < m.args.length; i++) {\r\n                if (m.args[i] instanceof ArrayBuffer) {\r\n                    transfer.push(m.args[i]);\r\n                }\r\n            }\r\n        }\r\n        else {\r\n            const m = msg;\r\n            if (m.res instanceof ArrayBuffer) {\r\n                transfer.push(m.res);\r\n            }\r\n        }\r\n        this._handler.sendMessage(msg, transfer);\r\n    }\r\n}\r\n/**\r\n * Main thread side\r\n */\r\nclass SimpleWorkerClient extends _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__.Disposable {\r\n    constructor(workerFactory, moduleId, host) {\r\n        super();\r\n        let lazyProxyReject = null;\r\n        this._worker = this._register(workerFactory.create('vs/base/common/worker/simpleWorker', (msg) => {\r\n            this._protocol.handleMessage(msg);\r\n        }, (err) => {\r\n            // in Firefox, web workers fail lazily :(\r\n            // we will reject the proxy\r\n            if (lazyProxyReject) {\r\n                lazyProxyReject(err);\r\n            }\r\n        }));\r\n        this._protocol = new SimpleWorkerProtocol({\r\n            sendMessage: (msg, transfer) => {\r\n                this._worker.postMessage(msg, transfer);\r\n            },\r\n            handleMessage: (method, args) => {\r\n                if (typeof host[method] !== 'function') {\r\n                    return Promise.reject(new Error('Missing method ' + method + ' on main thread host.'));\r\n                }\r\n                try {\r\n                    return Promise.resolve(host[method].apply(host, args));\r\n                }\r\n                catch (e) {\r\n                    return Promise.reject(e);\r\n                }\r\n            }\r\n        });\r\n        this._protocol.setWorkerId(this._worker.getId());\r\n        // Gather loader configuration\r\n        let loaderConfiguration = null;\r\n        if (typeof self.require !== 'undefined' && typeof self.require.getConfig === 'function') {\r\n            // Get the configuration from the Monaco AMD Loader\r\n            loaderConfiguration = self.require.getConfig();\r\n        }\r\n        else if (typeof self.requirejs !== 'undefined') {\r\n            // Get the configuration from requirejs\r\n            loaderConfiguration = self.requirejs.s.contexts._.config;\r\n        }\r\n        const hostMethods = _types_js__WEBPACK_IMPORTED_MODULE_3__.getAllMethodNames(host);\r\n        // Send initialize message\r\n        this._onModuleLoaded = this._protocol.sendMessage(INITIALIZE, [\r\n            this._worker.getId(),\r\n            JSON.parse(JSON.stringify(loaderConfiguration)),\r\n            moduleId,\r\n            hostMethods,\r\n        ]);\r\n        // Create proxy to loaded code\r\n        const proxyMethodRequest = (method, args) => {\r\n            return this._request(method, args);\r\n        };\r\n        this._lazyProxy = new Promise((resolve, reject) => {\r\n            lazyProxyReject = reject;\r\n            this._onModuleLoaded.then((availableMethods) => {\r\n                resolve(_types_js__WEBPACK_IMPORTED_MODULE_3__.createProxyObject(availableMethods, proxyMethodRequest));\r\n            }, (e) => {\r\n                reject(e);\r\n                this._onError('Worker failed to load ' + moduleId, e);\r\n            });\r\n        });\r\n    }\r\n    getProxyObject() {\r\n        return this._lazyProxy;\r\n    }\r\n    _request(method, args) {\r\n        return new Promise((resolve, reject) => {\r\n            this._onModuleLoaded.then(() => {\r\n                this._protocol.sendMessage(method, args).then(resolve, reject);\r\n            }, reject);\r\n        });\r\n    }\r\n    _onError(message, error) {\r\n        console.error(message);\r\n        console.info(error);\r\n    }\r\n}\r\n/**\r\n * Worker side\r\n */\r\nclass SimpleWorkerServer {\r\n    constructor(postMessage, requestHandlerFactory) {\r\n        this._requestHandlerFactory = requestHandlerFactory;\r\n        this._requestHandler = null;\r\n        this._protocol = new SimpleWorkerProtocol({\r\n            sendMessage: (msg, transfer) => {\r\n                postMessage(msg, transfer);\r\n            },\r\n            handleMessage: (method, args) => this._handleMessage(method, args)\r\n        });\r\n    }\r\n    onmessage(msg) {\r\n        this._protocol.handleMessage(msg);\r\n    }\r\n    _handleMessage(method, args) {\r\n        if (method === INITIALIZE) {\r\n            return this.initialize(args[0], args[1], args[2], args[3]);\r\n        }\r\n        if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') {\r\n            return Promise.reject(new Error('Missing requestHandler or method: ' + method));\r\n        }\r\n        try {\r\n            return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args));\r\n        }\r\n        catch (e) {\r\n            return Promise.reject(e);\r\n        }\r\n    }\r\n    initialize(workerId, loaderConfig, moduleId, hostMethods) {\r\n        this._protocol.setWorkerId(workerId);\r\n        const proxyMethodRequest = (method, args) => {\r\n            return this._protocol.sendMessage(method, args);\r\n        };\r\n        const hostProxy = _types_js__WEBPACK_IMPORTED_MODULE_3__.createProxyObject(hostMethods, proxyMethodRequest);\r\n        if (this._requestHandlerFactory) {\r\n            // static request handler\r\n            this._requestHandler = this._requestHandlerFactory(hostProxy);\r\n            return Promise.resolve(_types_js__WEBPACK_IMPORTED_MODULE_3__.getAllMethodNames(this._requestHandler));\r\n        }\r\n        if (loaderConfig) {\r\n            // Remove 'baseUrl', handling it is beyond scope for now\r\n            if (typeof loaderConfig.baseUrl !== 'undefined') {\r\n                delete loaderConfig['baseUrl'];\r\n            }\r\n            if (typeof loaderConfig.paths !== 'undefined') {\r\n                if (typeof loaderConfig.paths.vs !== 'undefined') {\r\n                    delete loaderConfig.paths['vs'];\r\n                }\r\n            }\r\n            if (typeof loaderConfig.trustedTypesPolicy !== undefined) {\r\n                // don't use, it has been destroyed during serialize\r\n                delete loaderConfig['trustedTypesPolicy'];\r\n            }\r\n            // Since this is in a web worker, enable catching errors\r\n            loaderConfig.catchError = true;\r\n            self.require.config(loaderConfig);\r\n        }\r\n        return new Promise((resolve, reject) => {\r\n            // Use the global require to be sure to get the global config\r\n            self.require([moduleId], (module) => {\r\n                this._requestHandler = module.create(hostProxy);\r\n                if (!this._requestHandler) {\r\n                    reject(new Error(`No RequestHandler!`));\r\n                    return;\r\n                }\r\n                resolve(_types_js__WEBPACK_IMPORTED_MODULE_3__.getAllMethodNames(this._requestHandler));\r\n            }, reject);\r\n        });\r\n    }\r\n}\r\n/**\r\n * Called on the worker side\r\n */\r\nfunction create(postMessage) {\r\n    return new SimpleWorkerServer(postMessage, null);\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js":
/*!*************************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js ***!
  \*************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"CharacterClassifier\": () => (/* binding */ CharacterClassifier),\n/* harmony export */   \"CharacterSet\": () => (/* binding */ CharacterSet)\n/* harmony export */ });\n/* harmony import */ var _base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/uint.js */ \"./node_modules/monaco-editor/esm/vs/base/common/uint.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n/**\r\n * A fast character classifier that uses a compact array for ASCII values.\r\n */\r\nclass CharacterClassifier {\r\n    constructor(_defaultValue) {\r\n        let defaultValue = (0,_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__.toUint8)(_defaultValue);\r\n        this._defaultValue = defaultValue;\r\n        this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue);\r\n        this._map = new Map();\r\n    }\r\n    static _createAsciiMap(defaultValue) {\r\n        let asciiMap = new Uint8Array(256);\r\n        for (let i = 0; i < 256; i++) {\r\n            asciiMap[i] = defaultValue;\r\n        }\r\n        return asciiMap;\r\n    }\r\n    set(charCode, _value) {\r\n        let value = (0,_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__.toUint8)(_value);\r\n        if (charCode >= 0 && charCode < 256) {\r\n            this._asciiMap[charCode] = value;\r\n        }\r\n        else {\r\n            this._map.set(charCode, value);\r\n        }\r\n    }\r\n    get(charCode) {\r\n        if (charCode >= 0 && charCode < 256) {\r\n            return this._asciiMap[charCode];\r\n        }\r\n        else {\r\n            return (this._map.get(charCode) || this._defaultValue);\r\n        }\r\n    }\r\n}\r\nclass CharacterSet {\r\n    constructor() {\r\n        this._actual = new CharacterClassifier(0 /* False */);\r\n    }\r\n    add(charCode) {\r\n        this._actual.set(charCode, 1 /* True */);\r\n    }\r\n    has(charCode) {\r\n        return (this._actual.get(charCode) === 1 /* True */);\r\n    }\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js":
/*!**************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/position.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"Position\": () => (/* binding */ Position)\n/* harmony export */ });\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n/**\r\n * A position in the editor.\r\n */\r\nclass Position {\r\n    constructor(lineNumber, column) {\r\n        this.lineNumber = lineNumber;\r\n        this.column = column;\r\n    }\r\n    /**\r\n     * Create a new position from this position.\r\n     *\r\n     * @param newLineNumber new line number\r\n     * @param newColumn new column\r\n     */\r\n    with(newLineNumber = this.lineNumber, newColumn = this.column) {\r\n        if (newLineNumber === this.lineNumber && newColumn === this.column) {\r\n            return this;\r\n        }\r\n        else {\r\n            return new Position(newLineNumber, newColumn);\r\n        }\r\n    }\r\n    /**\r\n     * Derive a new position from this position.\r\n     *\r\n     * @param deltaLineNumber line number delta\r\n     * @param deltaColumn column delta\r\n     */\r\n    delta(deltaLineNumber = 0, deltaColumn = 0) {\r\n        return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn);\r\n    }\r\n    /**\r\n     * Test if this position equals other position\r\n     */\r\n    equals(other) {\r\n        return Position.equals(this, other);\r\n    }\r\n    /**\r\n     * Test if position `a` equals position `b`\r\n     */\r\n    static equals(a, b) {\r\n        if (!a && !b) {\r\n            return true;\r\n        }\r\n        return (!!a &&\r\n            !!b &&\r\n            a.lineNumber === b.lineNumber &&\r\n            a.column === b.column);\r\n    }\r\n    /**\r\n     * Test if this position is before other position.\r\n     * If the two positions are equal, the result will be false.\r\n     */\r\n    isBefore(other) {\r\n        return Position.isBefore(this, other);\r\n    }\r\n    /**\r\n     * Test if position `a` is before position `b`.\r\n     * If the two positions are equal, the result will be false.\r\n     */\r\n    static isBefore(a, b) {\r\n        if (a.lineNumber < b.lineNumber) {\r\n            return true;\r\n        }\r\n        if (b.lineNumber < a.lineNumber) {\r\n            return false;\r\n        }\r\n        return a.column < b.column;\r\n    }\r\n    /**\r\n     * Test if this position is before other position.\r\n     * If the two positions are equal, the result will be true.\r\n     */\r\n    isBeforeOrEqual(other) {\r\n        return Position.isBeforeOrEqual(this, other);\r\n    }\r\n    /**\r\n     * Test if position `a` is before position `b`.\r\n     * If the two positions are equal, the result will be true.\r\n     */\r\n    static isBeforeOrEqual(a, b) {\r\n        if (a.lineNumber < b.lineNumber) {\r\n            return true;\r\n        }\r\n        if (b.lineNumber < a.lineNumber) {\r\n            return false;\r\n        }\r\n        return a.column <= b.column;\r\n    }\r\n    /**\r\n     * A function that compares positions, useful for sorting\r\n     */\r\n    static compare(a, b) {\r\n        let aLineNumber = a.lineNumber | 0;\r\n        let bLineNumber = b.lineNumber | 0;\r\n        if (aLineNumber === bLineNumber) {\r\n            let aColumn = a.column | 0;\r\n            let bColumn = b.column | 0;\r\n            return aColumn - bColumn;\r\n        }\r\n        return aLineNumber - bLineNumber;\r\n    }\r\n    /**\r\n     * Clone this position.\r\n     */\r\n    clone() {\r\n        return new Position(this.lineNumber, this.column);\r\n    }\r\n    /**\r\n     * Convert to a human-readable representation.\r\n     */\r\n    toString() {\r\n        return '(' + this.lineNumber + ',' + this.column + ')';\r\n    }\r\n    // ---\r\n    /**\r\n     * Create a `Position` from an `IPosition`.\r\n     */\r\n    static lift(pos) {\r\n        return new Position(pos.lineNumber, pos.column);\r\n    }\r\n    /**\r\n     * Test if `obj` is an `IPosition`.\r\n     */\r\n    static isIPosition(obj) {\r\n        return (obj\r\n            && (typeof obj.lineNumber === 'number')\r\n            && (typeof obj.column === 'number'));\r\n    }\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/editor/common/core/position.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js":
/*!***********************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/range.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"Range\": () => (/* binding */ Range)\n/* harmony export */ });\n/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/core/position.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n/**\r\n * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn)\r\n */\r\nclass Range {\r\n    constructor(startLineNumber, startColumn, endLineNumber, endColumn) {\r\n        if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) {\r\n            this.startLineNumber = endLineNumber;\r\n            this.startColumn = endColumn;\r\n            this.endLineNumber = startLineNumber;\r\n            this.endColumn = startColumn;\r\n        }\r\n        else {\r\n            this.startLineNumber = startLineNumber;\r\n            this.startColumn = startColumn;\r\n            this.endLineNumber = endLineNumber;\r\n            this.endColumn = endColumn;\r\n        }\r\n    }\r\n    /**\r\n     * Test if this range is empty.\r\n     */\r\n    isEmpty() {\r\n        return Range.isEmpty(this);\r\n    }\r\n    /**\r\n     * Test if `range` is empty.\r\n     */\r\n    static isEmpty(range) {\r\n        return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn);\r\n    }\r\n    /**\r\n     * Test if position is in this range. If the position is at the edges, will return true.\r\n     */\r\n    containsPosition(position) {\r\n        return Range.containsPosition(this, position);\r\n    }\r\n    /**\r\n     * Test if `position` is in `range`. If the position is at the edges, will return true.\r\n     */\r\n    static containsPosition(range, position) {\r\n        if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) {\r\n            return false;\r\n        }\r\n        if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) {\r\n            return false;\r\n        }\r\n        if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) {\r\n            return false;\r\n        }\r\n        return true;\r\n    }\r\n    /**\r\n     * Test if range is in this range. If the range is equal to this range, will return true.\r\n     */\r\n    containsRange(range) {\r\n        return Range.containsRange(this, range);\r\n    }\r\n    /**\r\n     * Test if `otherRange` is in `range`. If the ranges are equal, will return true.\r\n     */\r\n    static containsRange(range, otherRange) {\r\n        if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {\r\n            return false;\r\n        }\r\n        if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {\r\n            return false;\r\n        }\r\n        if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) {\r\n            return false;\r\n        }\r\n        if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) {\r\n            return false;\r\n        }\r\n        return true;\r\n    }\r\n    /**\r\n     * Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true.\r\n     */\r\n    strictContainsRange(range) {\r\n        return Range.strictContainsRange(this, range);\r\n    }\r\n    /**\r\n     * Test if `otherRange` is strinctly in `range` (must start after, and end before). If the ranges are equal, will return false.\r\n     */\r\n    static strictContainsRange(range, otherRange) {\r\n        if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {\r\n            return false;\r\n        }\r\n        if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {\r\n            return false;\r\n        }\r\n        if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn <= range.startColumn) {\r\n            return false;\r\n        }\r\n        if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn >= range.endColumn) {\r\n            return false;\r\n        }\r\n        return true;\r\n    }\r\n    /**\r\n     * A reunion of the two ranges.\r\n     * The smallest position will be used as the start point, and the largest one as the end point.\r\n     */\r\n    plusRange(range) {\r\n        return Range.plusRange(this, range);\r\n    }\r\n    /**\r\n     * A reunion of the two ranges.\r\n     * The smallest position will be used as the start point, and the largest one as the end point.\r\n     */\r\n    static plusRange(a, b) {\r\n        let startLineNumber;\r\n        let startColumn;\r\n        let endLineNumber;\r\n        let endColumn;\r\n        if (b.startLineNumber < a.startLineNumber) {\r\n            startLineNumber = b.startLineNumber;\r\n            startColumn = b.startColumn;\r\n        }\r\n        else if (b.startLineNumber === a.startLineNumber) {\r\n            startLineNumber = b.startLineNumber;\r\n            startColumn = Math.min(b.startColumn, a.startColumn);\r\n        }\r\n        else {\r\n            startLineNumber = a.startLineNumber;\r\n            startColumn = a.startColumn;\r\n        }\r\n        if (b.endLineNumber > a.endLineNumber) {\r\n            endLineNumber = b.endLineNumber;\r\n            endColumn = b.endColumn;\r\n        }\r\n        else if (b.endLineNumber === a.endLineNumber) {\r\n            endLineNumber = b.endLineNumber;\r\n            endColumn = Math.max(b.endColumn, a.endColumn);\r\n        }\r\n        else {\r\n            endLineNumber = a.endLineNumber;\r\n            endColumn = a.endColumn;\r\n        }\r\n        return new Range(startLineNumber, startColumn, endLineNumber, endColumn);\r\n    }\r\n    /**\r\n     * A intersection of the two ranges.\r\n     */\r\n    intersectRanges(range) {\r\n        return Range.intersectRanges(this, range);\r\n    }\r\n    /**\r\n     * A intersection of the two ranges.\r\n     */\r\n    static intersectRanges(a, b) {\r\n        let resultStartLineNumber = a.startLineNumber;\r\n        let resultStartColumn = a.startColumn;\r\n        let resultEndLineNumber = a.endLineNumber;\r\n        let resultEndColumn = a.endColumn;\r\n        let otherStartLineNumber = b.startLineNumber;\r\n        let otherStartColumn = b.startColumn;\r\n        let otherEndLineNumber = b.endLineNumber;\r\n        let otherEndColumn = b.endColumn;\r\n        if (resultStartLineNumber < otherStartLineNumber) {\r\n            resultStartLineNumber = otherStartLineNumber;\r\n            resultStartColumn = otherStartColumn;\r\n        }\r\n        else if (resultStartLineNumber === otherStartLineNumber) {\r\n            resultStartColumn = Math.max(resultStartColumn, otherStartColumn);\r\n        }\r\n        if (resultEndLineNumber > otherEndLineNumber) {\r\n            resultEndLineNumber = otherEndLineNumber;\r\n            resultEndColumn = otherEndColumn;\r\n        }\r\n        else if (resultEndLineNumber === otherEndLineNumber) {\r\n            resultEndColumn = Math.min(resultEndColumn, otherEndColumn);\r\n        }\r\n        // Check if selection is now empty\r\n        if (resultStartLineNumber > resultEndLineNumber) {\r\n            return null;\r\n        }\r\n        if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) {\r\n            return null;\r\n        }\r\n        return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn);\r\n    }\r\n    /**\r\n     * Test if this range equals other.\r\n     */\r\n    equalsRange(other) {\r\n        return Range.equalsRange(this, other);\r\n    }\r\n    /**\r\n     * Test if range `a` equals `b`.\r\n     */\r\n    static equalsRange(a, b) {\r\n        return (!!a &&\r\n            !!b &&\r\n            a.startLineNumber === b.startLineNumber &&\r\n            a.startColumn === b.startColumn &&\r\n            a.endLineNumber === b.endLineNumber &&\r\n            a.endColumn === b.endColumn);\r\n    }\r\n    /**\r\n     * Return the end position (which will be after or equal to the start position)\r\n     */\r\n    getEndPosition() {\r\n        return Range.getEndPosition(this);\r\n    }\r\n    /**\r\n     * Return the end position (which will be after or equal to the start position)\r\n     */\r\n    static getEndPosition(range) {\r\n        return new _position_js__WEBPACK_IMPORTED_MODULE_0__.Position(range.endLineNumber, range.endColumn);\r\n    }\r\n    /**\r\n     * Return the start position (which will be before or equal to the end position)\r\n     */\r\n    getStartPosition() {\r\n        return Range.getStartPosition(this);\r\n    }\r\n    /**\r\n     * Return the start position (which will be before or equal to the end position)\r\n     */\r\n    static getStartPosition(range) {\r\n        return new _position_js__WEBPACK_IMPORTED_MODULE_0__.Position(range.startLineNumber, range.startColumn);\r\n    }\r\n    /**\r\n     * Transform to a user presentable string representation.\r\n     */\r\n    toString() {\r\n        return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']';\r\n    }\r\n    /**\r\n     * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position.\r\n     */\r\n    setEndPosition(endLineNumber, endColumn) {\r\n        return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn);\r\n    }\r\n    /**\r\n     * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position.\r\n     */\r\n    setStartPosition(startLineNumber, startColumn) {\r\n        return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn);\r\n    }\r\n    /**\r\n     * Create a new empty range using this range's start position.\r\n     */\r\n    collapseToStart() {\r\n        return Range.collapseToStart(this);\r\n    }\r\n    /**\r\n     * Create a new empty range using this range's start position.\r\n     */\r\n    static collapseToStart(range) {\r\n        return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn);\r\n    }\r\n    // ---\r\n    static fromPositions(start, end = start) {\r\n        return new Range(start.lineNumber, start.column, end.lineNumber, end.column);\r\n    }\r\n    static lift(range) {\r\n        if (!range) {\r\n            return null;\r\n        }\r\n        return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);\r\n    }\r\n    /**\r\n     * Test if `obj` is an `IRange`.\r\n     */\r\n    static isIRange(obj) {\r\n        return (obj\r\n            && (typeof obj.startLineNumber === 'number')\r\n            && (typeof obj.startColumn === 'number')\r\n            && (typeof obj.endLineNumber === 'number')\r\n            && (typeof obj.endColumn === 'number'));\r\n    }\r\n    /**\r\n     * Test if the two ranges are touching in any way.\r\n     */\r\n    static areIntersectingOrTouching(a, b) {\r\n        // Check if `a` is before `b`\r\n        if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) {\r\n            return false;\r\n        }\r\n        // Check if `b` is before `a`\r\n        if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) {\r\n            return false;\r\n        }\r\n        // These ranges must intersect\r\n        return true;\r\n    }\r\n    /**\r\n     * Test if the two ranges are intersecting. If the ranges are touching it returns true.\r\n     */\r\n    static areIntersecting(a, b) {\r\n        // Check if `a` is before `b`\r\n        if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) {\r\n            return false;\r\n        }\r\n        // Check if `b` is before `a`\r\n        if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) {\r\n            return false;\r\n        }\r\n        // These ranges must intersect\r\n        return true;\r\n    }\r\n    /**\r\n     * A function that compares ranges, useful for sorting ranges\r\n     * It will first compare ranges on the startPosition and then on the endPosition\r\n     */\r\n    static compareRangesUsingStarts(a, b) {\r\n        if (a && b) {\r\n            const aStartLineNumber = a.startLineNumber | 0;\r\n            const bStartLineNumber = b.startLineNumber | 0;\r\n            if (aStartLineNumber === bStartLineNumber) {\r\n                const aStartColumn = a.startColumn | 0;\r\n                const bStartColumn = b.startColumn | 0;\r\n                if (aStartColumn === bStartColumn) {\r\n                    const aEndLineNumber = a.endLineNumber | 0;\r\n                    const bEndLineNumber = b.endLineNumber | 0;\r\n                    if (aEndLineNumber === bEndLineNumber) {\r\n                        const aEndColumn = a.endColumn | 0;\r\n                        const bEndColumn = b.endColumn | 0;\r\n                        return aEndColumn - bEndColumn;\r\n                    }\r\n                    return aEndLineNumber - bEndLineNumber;\r\n                }\r\n                return aStartColumn - bStartColumn;\r\n            }\r\n            return aStartLineNumber - bStartLineNumber;\r\n        }\r\n        const aExists = (a ? 1 : 0);\r\n        const bExists = (b ? 1 : 0);\r\n        return aExists - bExists;\r\n    }\r\n    /**\r\n     * A function that compares ranges, useful for sorting ranges\r\n     * It will first compare ranges on the endPosition and then on the startPosition\r\n     */\r\n    static compareRangesUsingEnds(a, b) {\r\n        if (a.endLineNumber === b.endLineNumber) {\r\n            if (a.endColumn === b.endColumn) {\r\n                if (a.startLineNumber === b.startLineNumber) {\r\n                    return a.startColumn - b.startColumn;\r\n                }\r\n                return a.startLineNumber - b.startLineNumber;\r\n            }\r\n            return a.endColumn - b.endColumn;\r\n        }\r\n        return a.endLineNumber - b.endLineNumber;\r\n    }\r\n    /**\r\n     * Test if the range spans multiple lines.\r\n     */\r\n    static spansMultipleLines(range) {\r\n        return range.endLineNumber > range.startLineNumber;\r\n    }\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/editor/common/core/range.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js":
/*!***************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"Selection\": () => (/* binding */ Selection)\n/* harmony export */ });\n/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/core/position.js\");\n/* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/core/range.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n\r\n/**\r\n * A selection in the editor.\r\n * The selection is a range that has an orientation.\r\n */\r\nclass Selection extends _range_js__WEBPACK_IMPORTED_MODULE_1__.Range {\r\n    constructor(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) {\r\n        super(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn);\r\n        this.selectionStartLineNumber = selectionStartLineNumber;\r\n        this.selectionStartColumn = selectionStartColumn;\r\n        this.positionLineNumber = positionLineNumber;\r\n        this.positionColumn = positionColumn;\r\n    }\r\n    /**\r\n     * Transform to a human-readable representation.\r\n     */\r\n    toString() {\r\n        return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']';\r\n    }\r\n    /**\r\n     * Test if equals other selection.\r\n     */\r\n    equalsSelection(other) {\r\n        return (Selection.selectionsEqual(this, other));\r\n    }\r\n    /**\r\n     * Test if the two selections are equal.\r\n     */\r\n    static selectionsEqual(a, b) {\r\n        return (a.selectionStartLineNumber === b.selectionStartLineNumber &&\r\n            a.selectionStartColumn === b.selectionStartColumn &&\r\n            a.positionLineNumber === b.positionLineNumber &&\r\n            a.positionColumn === b.positionColumn);\r\n    }\r\n    /**\r\n     * Get directions (LTR or RTL).\r\n     */\r\n    getDirection() {\r\n        if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) {\r\n            return 0 /* LTR */;\r\n        }\r\n        return 1 /* RTL */;\r\n    }\r\n    /**\r\n     * Create a new selection with a different `positionLineNumber` and `positionColumn`.\r\n     */\r\n    setEndPosition(endLineNumber, endColumn) {\r\n        if (this.getDirection() === 0 /* LTR */) {\r\n            return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn);\r\n        }\r\n        return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn);\r\n    }\r\n    /**\r\n     * Get the position at `positionLineNumber` and `positionColumn`.\r\n     */\r\n    getPosition() {\r\n        return new _position_js__WEBPACK_IMPORTED_MODULE_0__.Position(this.positionLineNumber, this.positionColumn);\r\n    }\r\n    /**\r\n     * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`.\r\n     */\r\n    setStartPosition(startLineNumber, startColumn) {\r\n        if (this.getDirection() === 0 /* LTR */) {\r\n            return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn);\r\n        }\r\n        return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn);\r\n    }\r\n    // ----\r\n    /**\r\n     * Create a `Selection` from one or two positions\r\n     */\r\n    static fromPositions(start, end = start) {\r\n        return new Selection(start.lineNumber, start.column, end.lineNumber, end.column);\r\n    }\r\n    /**\r\n     * Create a `Selection` from an `ISelection`.\r\n     */\r\n    static liftSelection(sel) {\r\n        return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn);\r\n    }\r\n    /**\r\n     * `a` equals `b`.\r\n     */\r\n    static selectionsArrEqual(a, b) {\r\n        if (a && !b || !a && b) {\r\n            return false;\r\n        }\r\n        if (!a && !b) {\r\n            return true;\r\n        }\r\n        if (a.length !== b.length) {\r\n            return false;\r\n        }\r\n        for (let i = 0, len = a.length; i < len; i++) {\r\n            if (!this.selectionsEqual(a[i], b[i])) {\r\n                return false;\r\n            }\r\n        }\r\n        return true;\r\n    }\r\n    /**\r\n     * Test if `obj` is an `ISelection`.\r\n     */\r\n    static isISelection(obj) {\r\n        return (obj\r\n            && (typeof obj.selectionStartLineNumber === 'number')\r\n            && (typeof obj.selectionStartColumn === 'number')\r\n            && (typeof obj.positionLineNumber === 'number')\r\n            && (typeof obj.positionColumn === 'number'));\r\n    }\r\n    /**\r\n     * Create with a direction.\r\n     */\r\n    static createWithDirection(startLineNumber, startColumn, endLineNumber, endColumn, direction) {\r\n        if (direction === 0 /* LTR */) {\r\n            return new Selection(startLineNumber, startColumn, endLineNumber, endColumn);\r\n        }\r\n        return new Selection(endLineNumber, endColumn, startLineNumber, startColumn);\r\n    }\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js":
/*!***********************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/token.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"Token\": () => (/* binding */ Token),\n/* harmony export */   \"TokenizationResult\": () => (/* binding */ TokenizationResult),\n/* harmony export */   \"TokenizationResult2\": () => (/* binding */ TokenizationResult2)\n/* harmony export */ });\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nclass Token {\r\n    constructor(offset, type, language) {\r\n        this.offset = offset | 0; // @perf\r\n        this.type = type;\r\n        this.language = language;\r\n    }\r\n    toString() {\r\n        return '(' + this.offset + ', ' + this.type + ')';\r\n    }\r\n}\r\nclass TokenizationResult {\r\n    constructor(tokens, endState) {\r\n        this.tokens = tokens;\r\n        this.endState = endState;\r\n    }\r\n}\r\nclass TokenizationResult2 {\r\n    constructor(tokens, endState) {\r\n        this.tokens = tokens;\r\n        this.endState = endState;\r\n    }\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/editor/common/core/token.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js":
/*!******************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js ***!
  \******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"DiffComputer\": () => (/* binding */ DiffComputer)\n/* harmony export */ });\n/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ \"./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js\");\n/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ \"./node_modules/monaco-editor/esm/vs/base/common/strings.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n\r\nconst MINIMUM_MATCHING_CHARACTER_LENGTH = 3;\r\nfunction computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) {\r\n    const diffAlgo = new _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__.LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate);\r\n    return diffAlgo.ComputeDiff(pretty);\r\n}\r\nclass LineSequence {\r\n    constructor(lines) {\r\n        const startColumns = [];\r\n        const endColumns = [];\r\n        for (let i = 0, length = lines.length; i < length; i++) {\r\n            startColumns[i] = getFirstNonBlankColumn(lines[i], 1);\r\n            endColumns[i] = getLastNonBlankColumn(lines[i], 1);\r\n        }\r\n        this.lines = lines;\r\n        this._startColumns = startColumns;\r\n        this._endColumns = endColumns;\r\n    }\r\n    getElements() {\r\n        const elements = [];\r\n        for (let i = 0, len = this.lines.length; i < len; i++) {\r\n            elements[i] = this.lines[i].substring(this._startColumns[i] - 1, this._endColumns[i] - 1);\r\n        }\r\n        return elements;\r\n    }\r\n    getStartLineNumber(i) {\r\n        return i + 1;\r\n    }\r\n    getEndLineNumber(i) {\r\n        return i + 1;\r\n    }\r\n    createCharSequence(shouldIgnoreTrimWhitespace, startIndex, endIndex) {\r\n        const charCodes = [];\r\n        const lineNumbers = [];\r\n        const columns = [];\r\n        let len = 0;\r\n        for (let index = startIndex; index <= endIndex; index++) {\r\n            const lineContent = this.lines[index];\r\n            const startColumn = (shouldIgnoreTrimWhitespace ? this._startColumns[index] : 1);\r\n            const endColumn = (shouldIgnoreTrimWhitespace ? this._endColumns[index] : lineContent.length + 1);\r\n            for (let col = startColumn; col < endColumn; col++) {\r\n                charCodes[len] = lineContent.charCodeAt(col - 1);\r\n                lineNumbers[len] = index + 1;\r\n                columns[len] = col;\r\n                len++;\r\n            }\r\n        }\r\n        return new CharSequence(charCodes, lineNumbers, columns);\r\n    }\r\n}\r\nclass CharSequence {\r\n    constructor(charCodes, lineNumbers, columns) {\r\n        this._charCodes = charCodes;\r\n        this._lineNumbers = lineNumbers;\r\n        this._columns = columns;\r\n    }\r\n    getElements() {\r\n        return this._charCodes;\r\n    }\r\n    getStartLineNumber(i) {\r\n        return this._lineNumbers[i];\r\n    }\r\n    getStartColumn(i) {\r\n        return this._columns[i];\r\n    }\r\n    getEndLineNumber(i) {\r\n        return this._lineNumbers[i];\r\n    }\r\n    getEndColumn(i) {\r\n        return this._columns[i] + 1;\r\n    }\r\n}\r\nclass CharChange {\r\n    constructor(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn) {\r\n        this.originalStartLineNumber = originalStartLineNumber;\r\n        this.originalStartColumn = originalStartColumn;\r\n        this.originalEndLineNumber = originalEndLineNumber;\r\n        this.originalEndColumn = originalEndColumn;\r\n        this.modifiedStartLineNumber = modifiedStartLineNumber;\r\n        this.modifiedStartColumn = modifiedStartColumn;\r\n        this.modifiedEndLineNumber = modifiedEndLineNumber;\r\n        this.modifiedEndColumn = modifiedEndColumn;\r\n    }\r\n    static createFromDiffChange(diffChange, originalCharSequence, modifiedCharSequence) {\r\n        let originalStartLineNumber;\r\n        let originalStartColumn;\r\n        let originalEndLineNumber;\r\n        let originalEndColumn;\r\n        let modifiedStartLineNumber;\r\n        let modifiedStartColumn;\r\n        let modifiedEndLineNumber;\r\n        let modifiedEndColumn;\r\n        if (diffChange.originalLength === 0) {\r\n            originalStartLineNumber = 0;\r\n            originalStartColumn = 0;\r\n            originalEndLineNumber = 0;\r\n            originalEndColumn = 0;\r\n        }\r\n        else {\r\n            originalStartLineNumber = originalCharSequence.getStartLineNumber(diffChange.originalStart);\r\n            originalStartColumn = originalCharSequence.getStartColumn(diffChange.originalStart);\r\n            originalEndLineNumber = originalCharSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);\r\n            originalEndColumn = originalCharSequence.getEndColumn(diffChange.originalStart + diffChange.originalLength - 1);\r\n        }\r\n        if (diffChange.modifiedLength === 0) {\r\n            modifiedStartLineNumber = 0;\r\n            modifiedStartColumn = 0;\r\n            modifiedEndLineNumber = 0;\r\n            modifiedEndColumn = 0;\r\n        }\r\n        else {\r\n            modifiedStartLineNumber = modifiedCharSequence.getStartLineNumber(diffChange.modifiedStart);\r\n            modifiedStartColumn = modifiedCharSequence.getStartColumn(diffChange.modifiedStart);\r\n            modifiedEndLineNumber = modifiedCharSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);\r\n            modifiedEndColumn = modifiedCharSequence.getEndColumn(diffChange.modifiedStart + diffChange.modifiedLength - 1);\r\n        }\r\n        return new CharChange(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn);\r\n    }\r\n}\r\nfunction postProcessCharChanges(rawChanges) {\r\n    if (rawChanges.length <= 1) {\r\n        return rawChanges;\r\n    }\r\n    const result = [rawChanges[0]];\r\n    let prevChange = result[0];\r\n    for (let i = 1, len = rawChanges.length; i < len; i++) {\r\n        const currChange = rawChanges[i];\r\n        const originalMatchingLength = currChange.originalStart - (prevChange.originalStart + prevChange.originalLength);\r\n        const modifiedMatchingLength = currChange.modifiedStart - (prevChange.modifiedStart + prevChange.modifiedLength);\r\n        // Both of the above should be equal, but the continueProcessingPredicate may prevent this from being true\r\n        const matchingLength = Math.min(originalMatchingLength, modifiedMatchingLength);\r\n        if (matchingLength < MINIMUM_MATCHING_CHARACTER_LENGTH) {\r\n            // Merge the current change into the previous one\r\n            prevChange.originalLength = (currChange.originalStart + currChange.originalLength) - prevChange.originalStart;\r\n            prevChange.modifiedLength = (currChange.modifiedStart + currChange.modifiedLength) - prevChange.modifiedStart;\r\n        }\r\n        else {\r\n            // Add the current change\r\n            result.push(currChange);\r\n            prevChange = currChange;\r\n        }\r\n    }\r\n    return result;\r\n}\r\nclass LineChange {\r\n    constructor(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges) {\r\n        this.originalStartLineNumber = originalStartLineNumber;\r\n        this.originalEndLineNumber = originalEndLineNumber;\r\n        this.modifiedStartLineNumber = modifiedStartLineNumber;\r\n        this.modifiedEndLineNumber = modifiedEndLineNumber;\r\n        this.charChanges = charChanges;\r\n    }\r\n    static createFromDiffResult(shouldIgnoreTrimWhitespace, diffChange, originalLineSequence, modifiedLineSequence, continueCharDiff, shouldComputeCharChanges, shouldPostProcessCharChanges) {\r\n        let originalStartLineNumber;\r\n        let originalEndLineNumber;\r\n        let modifiedStartLineNumber;\r\n        let modifiedEndLineNumber;\r\n        let charChanges = undefined;\r\n        if (diffChange.originalLength === 0) {\r\n            originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart) - 1;\r\n            originalEndLineNumber = 0;\r\n        }\r\n        else {\r\n            originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart);\r\n            originalEndLineNumber = originalLineSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);\r\n        }\r\n        if (diffChange.modifiedLength === 0) {\r\n            modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart) - 1;\r\n            modifiedEndLineNumber = 0;\r\n        }\r\n        else {\r\n            modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart);\r\n            modifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);\r\n        }\r\n        if (shouldComputeCharChanges && diffChange.originalLength > 0 && diffChange.originalLength < 20 && diffChange.modifiedLength > 0 && diffChange.modifiedLength < 20 && continueCharDiff()) {\r\n            // Compute character changes for diff chunks of at most 20 lines...\r\n            const originalCharSequence = originalLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1);\r\n            const modifiedCharSequence = modifiedLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1);\r\n            let rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueCharDiff, true).changes;\r\n            if (shouldPostProcessCharChanges) {\r\n                rawChanges = postProcessCharChanges(rawChanges);\r\n            }\r\n            charChanges = [];\r\n            for (let i = 0, length = rawChanges.length; i < length; i++) {\r\n                charChanges.push(CharChange.createFromDiffChange(rawChanges[i], originalCharSequence, modifiedCharSequence));\r\n            }\r\n        }\r\n        return new LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges);\r\n    }\r\n}\r\nclass DiffComputer {\r\n    constructor(originalLines, modifiedLines, opts) {\r\n        this.shouldComputeCharChanges = opts.shouldComputeCharChanges;\r\n        this.shouldPostProcessCharChanges = opts.shouldPostProcessCharChanges;\r\n        this.shouldIgnoreTrimWhitespace = opts.shouldIgnoreTrimWhitespace;\r\n        this.shouldMakePrettyDiff = opts.shouldMakePrettyDiff;\r\n        this.originalLines = originalLines;\r\n        this.modifiedLines = modifiedLines;\r\n        this.original = new LineSequence(originalLines);\r\n        this.modified = new LineSequence(modifiedLines);\r\n        this.continueLineDiff = createContinueProcessingPredicate(opts.maxComputationTime);\r\n        this.continueCharDiff = createContinueProcessingPredicate(opts.maxComputationTime === 0 ? 0 : Math.min(opts.maxComputationTime, 5000)); // never run after 5s for character changes...\r\n    }\r\n    computeDiff() {\r\n        if (this.original.lines.length === 1 && this.original.lines[0].length === 0) {\r\n            // empty original => fast path\r\n            if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {\r\n                return {\r\n                    quitEarly: false,\r\n                    changes: []\r\n                };\r\n            }\r\n            return {\r\n                quitEarly: false,\r\n                changes: [{\r\n                        originalStartLineNumber: 1,\r\n                        originalEndLineNumber: 1,\r\n                        modifiedStartLineNumber: 1,\r\n                        modifiedEndLineNumber: this.modified.lines.length,\r\n                        charChanges: [{\r\n                                modifiedEndColumn: 0,\r\n                                modifiedEndLineNumber: 0,\r\n                                modifiedStartColumn: 0,\r\n                                modifiedStartLineNumber: 0,\r\n                                originalEndColumn: 0,\r\n                                originalEndLineNumber: 0,\r\n                                originalStartColumn: 0,\r\n                                originalStartLineNumber: 0\r\n                            }]\r\n                    }]\r\n            };\r\n        }\r\n        if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {\r\n            // empty modified => fast path\r\n            return {\r\n                quitEarly: false,\r\n                changes: [{\r\n                        originalStartLineNumber: 1,\r\n                        originalEndLineNumber: this.original.lines.length,\r\n                        modifiedStartLineNumber: 1,\r\n                        modifiedEndLineNumber: 1,\r\n                        charChanges: [{\r\n                                modifiedEndColumn: 0,\r\n                                modifiedEndLineNumber: 0,\r\n                                modifiedStartColumn: 0,\r\n                                modifiedStartLineNumber: 0,\r\n                                originalEndColumn: 0,\r\n                                originalEndLineNumber: 0,\r\n                                originalStartColumn: 0,\r\n                                originalStartLineNumber: 0\r\n                            }]\r\n                    }]\r\n            };\r\n        }\r\n        const diffResult = computeDiff(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff);\r\n        const rawChanges = diffResult.changes;\r\n        const quitEarly = diffResult.quitEarly;\r\n        // The diff is always computed with ignoring trim whitespace\r\n        // This ensures we get the prettiest diff\r\n        if (this.shouldIgnoreTrimWhitespace) {\r\n            const lineChanges = [];\r\n            for (let i = 0, length = rawChanges.length; i < length; i++) {\r\n                lineChanges.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, rawChanges[i], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));\r\n            }\r\n            return {\r\n                quitEarly: quitEarly,\r\n                changes: lineChanges\r\n            };\r\n        }\r\n        // Need to post-process and introduce changes where the trim whitespace is different\r\n        // Note that we are looping starting at -1 to also cover the lines before the first change\r\n        const result = [];\r\n        let originalLineIndex = 0;\r\n        let modifiedLineIndex = 0;\r\n        for (let i = -1 /* !!!! */, len = rawChanges.length; i < len; i++) {\r\n            const nextChange = (i + 1 < len ? rawChanges[i + 1] : null);\r\n            const originalStop = (nextChange ? nextChange.originalStart : this.originalLines.length);\r\n            const modifiedStop = (nextChange ? nextChange.modifiedStart : this.modifiedLines.length);\r\n            while (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) {\r\n                const originalLine = this.originalLines[originalLineIndex];\r\n                const modifiedLine = this.modifiedLines[modifiedLineIndex];\r\n                if (originalLine !== modifiedLine) {\r\n                    // These lines differ only in trim whitespace\r\n                    // Check the leading whitespace\r\n                    {\r\n                        let originalStartColumn = getFirstNonBlankColumn(originalLine, 1);\r\n                        let modifiedStartColumn = getFirstNonBlankColumn(modifiedLine, 1);\r\n                        while (originalStartColumn > 1 && modifiedStartColumn > 1) {\r\n                            const originalChar = originalLine.charCodeAt(originalStartColumn - 2);\r\n                            const modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2);\r\n                            if (originalChar !== modifiedChar) {\r\n                                break;\r\n                            }\r\n                            originalStartColumn--;\r\n                            modifiedStartColumn--;\r\n                        }\r\n                        if (originalStartColumn > 1 || modifiedStartColumn > 1) {\r\n                            this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, 1, originalStartColumn, modifiedLineIndex + 1, 1, modifiedStartColumn);\r\n                        }\r\n                    }\r\n                    // Check the trailing whitespace\r\n                    {\r\n                        let originalEndColumn = getLastNonBlankColumn(originalLine, 1);\r\n                        let modifiedEndColumn = getLastNonBlankColumn(modifiedLine, 1);\r\n                        const originalMaxColumn = originalLine.length + 1;\r\n                        const modifiedMaxColumn = modifiedLine.length + 1;\r\n                        while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) {\r\n                            const originalChar = originalLine.charCodeAt(originalEndColumn - 1);\r\n                            const modifiedChar = originalLine.charCodeAt(modifiedEndColumn - 1);\r\n                            if (originalChar !== modifiedChar) {\r\n                                break;\r\n                            }\r\n                            originalEndColumn++;\r\n                            modifiedEndColumn++;\r\n                        }\r\n                        if (originalEndColumn < originalMaxColumn || modifiedEndColumn < modifiedMaxColumn) {\r\n                            this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, originalEndColumn, originalMaxColumn, modifiedLineIndex + 1, modifiedEndColumn, modifiedMaxColumn);\r\n                        }\r\n                    }\r\n                }\r\n                originalLineIndex++;\r\n                modifiedLineIndex++;\r\n            }\r\n            if (nextChange) {\r\n                // Emit the actual change\r\n                result.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, nextChange, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));\r\n                originalLineIndex += nextChange.originalLength;\r\n                modifiedLineIndex += nextChange.modifiedLength;\r\n            }\r\n        }\r\n        return {\r\n            quitEarly: quitEarly,\r\n            changes: result\r\n        };\r\n    }\r\n    _pushTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) {\r\n        if (this._mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn)) {\r\n            // Merged into previous\r\n            return;\r\n        }\r\n        let charChanges = undefined;\r\n        if (this.shouldComputeCharChanges) {\r\n            charChanges = [new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)];\r\n        }\r\n        result.push(new LineChange(originalLineNumber, originalLineNumber, modifiedLineNumber, modifiedLineNumber, charChanges));\r\n    }\r\n    _mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) {\r\n        const len = result.length;\r\n        if (len === 0) {\r\n            return false;\r\n        }\r\n        const prevChange = result[len - 1];\r\n        if (prevChange.originalEndLineNumber === 0 || prevChange.modifiedEndLineNumber === 0) {\r\n            // Don't merge with inserts/deletes\r\n            return false;\r\n        }\r\n        if (prevChange.originalEndLineNumber + 1 === originalLineNumber && prevChange.modifiedEndLineNumber + 1 === modifiedLineNumber) {\r\n            prevChange.originalEndLineNumber = originalLineNumber;\r\n            prevChange.modifiedEndLineNumber = modifiedLineNumber;\r\n            if (this.shouldComputeCharChanges && prevChange.charChanges) {\r\n                prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn));\r\n            }\r\n            return true;\r\n        }\r\n        return false;\r\n    }\r\n}\r\nfunction getFirstNonBlankColumn(txt, defaultValue) {\r\n    const r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__.firstNonWhitespaceIndex(txt);\r\n    if (r === -1) {\r\n        return defaultValue;\r\n    }\r\n    return r + 1;\r\n}\r\nfunction getLastNonBlankColumn(txt, defaultValue) {\r\n    const r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__.lastNonWhitespaceIndex(txt);\r\n    if (r === -1) {\r\n        return defaultValue;\r\n    }\r\n    return r + 2;\r\n}\r\nfunction createContinueProcessingPredicate(maximumRuntime) {\r\n    if (maximumRuntime === 0) {\r\n        return () => true;\r\n    }\r\n    const startTime = Date.now();\r\n    return () => {\r\n        return Date.now() - startTime < maximumRuntime;\r\n    };\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js":
/*!**********************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js ***!
  \**********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"MirrorTextModel\": () => (/* binding */ MirrorTextModel)\n/* harmony export */ });\n/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ \"./node_modules/monaco-editor/esm/vs/base/common/strings.js\");\n/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/position.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/core/position.js\");\n/* harmony import */ var _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../viewModel/prefixSumComputer.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n\r\n\r\nclass MirrorTextModel {\r\n    constructor(uri, lines, eol, versionId) {\r\n        this._uri = uri;\r\n        this._lines = lines;\r\n        this._eol = eol;\r\n        this._versionId = versionId;\r\n        this._lineStarts = null;\r\n        this._cachedTextValue = null;\r\n    }\r\n    dispose() {\r\n        this._lines.length = 0;\r\n    }\r\n    getText() {\r\n        if (this._cachedTextValue === null) {\r\n            this._cachedTextValue = this._lines.join(this._eol);\r\n        }\r\n        return this._cachedTextValue;\r\n    }\r\n    onEvents(e) {\r\n        if (e.eol && e.eol !== this._eol) {\r\n            this._eol = e.eol;\r\n            this._lineStarts = null;\r\n        }\r\n        // Update my lines\r\n        const changes = e.changes;\r\n        for (const change of changes) {\r\n            this._acceptDeleteRange(change.range);\r\n            this._acceptInsertText(new _core_position_js__WEBPACK_IMPORTED_MODULE_1__.Position(change.range.startLineNumber, change.range.startColumn), change.text);\r\n        }\r\n        this._versionId = e.versionId;\r\n        this._cachedTextValue = null;\r\n    }\r\n    _ensureLineStarts() {\r\n        if (!this._lineStarts) {\r\n            const eolLength = this._eol.length;\r\n            const linesLength = this._lines.length;\r\n            const lineStartValues = new Uint32Array(linesLength);\r\n            for (let i = 0; i < linesLength; i++) {\r\n                lineStartValues[i] = this._lines[i].length + eolLength;\r\n            }\r\n            this._lineStarts = new _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_2__.PrefixSumComputer(lineStartValues);\r\n        }\r\n    }\r\n    /**\r\n     * All changes to a line's text go through this method\r\n     */\r\n    _setLineText(lineIndex, newValue) {\r\n        this._lines[lineIndex] = newValue;\r\n        if (this._lineStarts) {\r\n            // update prefix sum\r\n            this._lineStarts.changeValue(lineIndex, this._lines[lineIndex].length + this._eol.length);\r\n        }\r\n    }\r\n    _acceptDeleteRange(range) {\r\n        if (range.startLineNumber === range.endLineNumber) {\r\n            if (range.startColumn === range.endColumn) {\r\n                // Nothing to delete\r\n                return;\r\n            }\r\n            // Delete text on the affected line\r\n            this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1)\r\n                + this._lines[range.startLineNumber - 1].substring(range.endColumn - 1));\r\n            return;\r\n        }\r\n        // Take remaining text on last line and append it to remaining text on first line\r\n        this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1)\r\n            + this._lines[range.endLineNumber - 1].substring(range.endColumn - 1));\r\n        // Delete middle lines\r\n        this._lines.splice(range.startLineNumber, range.endLineNumber - range.startLineNumber);\r\n        if (this._lineStarts) {\r\n            // update prefix sum\r\n            this._lineStarts.removeValues(range.startLineNumber, range.endLineNumber - range.startLineNumber);\r\n        }\r\n    }\r\n    _acceptInsertText(position, insertText) {\r\n        if (insertText.length === 0) {\r\n            // Nothing to insert\r\n            return;\r\n        }\r\n        let insertLines = (0,_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__.splitLines)(insertText);\r\n        if (insertLines.length === 1) {\r\n            // Inserting text on one line\r\n            this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1)\r\n                + insertLines[0]\r\n                + this._lines[position.lineNumber - 1].substring(position.column - 1));\r\n            return;\r\n        }\r\n        // Append overflowing text from first line to the end of text to insert\r\n        insertLines[insertLines.length - 1] += this._lines[position.lineNumber - 1].substring(position.column - 1);\r\n        // Delete overflowing text from first line and insert text on first line\r\n        this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1)\r\n            + insertLines[0]);\r\n        // Insert new lines & store lengths\r\n        let newLengths = new Uint32Array(insertLines.length - 1);\r\n        for (let i = 1; i < insertLines.length; i++) {\r\n            this._lines.splice(position.lineNumber + i - 1, 0, insertLines[i]);\r\n            newLengths[i - 1] = insertLines[i].length + this._eol.length;\r\n        }\r\n        if (this._lineStarts) {\r\n            // update prefix sum\r\n            this._lineStarts.insertValues(position.lineNumber, newLengths);\r\n        }\r\n    }\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js":
/*!*****************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"USUAL_WORD_SEPARATORS\": () => (/* binding */ USUAL_WORD_SEPARATORS),\n/* harmony export */   \"DEFAULT_WORD_REGEXP\": () => (/* binding */ DEFAULT_WORD_REGEXP),\n/* harmony export */   \"ensureValidWordDefinition\": () => (/* binding */ ensureValidWordDefinition),\n/* harmony export */   \"getWordAtText\": () => (/* binding */ getWordAtText)\n/* harmony export */ });\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nconst USUAL_WORD_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\\\|;:\\'\",.<>/?';\r\n/**\r\n * Create a word definition regular expression based on default word separators.\r\n * Optionally provide allowed separators that should be included in words.\r\n *\r\n * The default would look like this:\r\n * /(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)/g\r\n */\r\nfunction createWordRegExp(allowInWords = '') {\r\n    let source = '(-?\\\\d*\\\\.\\\\d\\\\w*)|([^';\r\n    for (const sep of USUAL_WORD_SEPARATORS) {\r\n        if (allowInWords.indexOf(sep) >= 0) {\r\n            continue;\r\n        }\r\n        source += '\\\\' + sep;\r\n    }\r\n    source += '\\\\s]+)';\r\n    return new RegExp(source, 'g');\r\n}\r\n// catches numbers (including floating numbers) in the first group, and alphanum in the second\r\nconst DEFAULT_WORD_REGEXP = createWordRegExp();\r\nfunction ensureValidWordDefinition(wordDefinition) {\r\n    let result = DEFAULT_WORD_REGEXP;\r\n    if (wordDefinition && (wordDefinition instanceof RegExp)) {\r\n        if (!wordDefinition.global) {\r\n            let flags = 'g';\r\n            if (wordDefinition.ignoreCase) {\r\n                flags += 'i';\r\n            }\r\n            if (wordDefinition.multiline) {\r\n                flags += 'm';\r\n            }\r\n            if (wordDefinition.unicode) {\r\n                flags += 'u';\r\n            }\r\n            result = new RegExp(wordDefinition.source, flags);\r\n        }\r\n        else {\r\n            result = wordDefinition;\r\n        }\r\n    }\r\n    result.lastIndex = 0;\r\n    return result;\r\n}\r\nconst _defaultConfig = {\r\n    maxLen: 1000,\r\n    windowSize: 15,\r\n    timeBudget: 150\r\n};\r\nfunction getWordAtText(column, wordDefinition, text, textOffset, config = _defaultConfig) {\r\n    if (text.length > config.maxLen) {\r\n        // don't throw strings that long at the regexp\r\n        // but use a sub-string in which a word must occur\r\n        let start = column - config.maxLen / 2;\r\n        if (start < 0) {\r\n            start = 0;\r\n        }\r\n        else {\r\n            textOffset += start;\r\n        }\r\n        text = text.substring(start, column + config.maxLen / 2);\r\n        return getWordAtText(column, wordDefinition, text, textOffset, config);\r\n    }\r\n    const t1 = Date.now();\r\n    const pos = column - 1 - textOffset;\r\n    let prevRegexIndex = -1;\r\n    let match = null;\r\n    for (let i = 1;; i++) {\r\n        // check time budget\r\n        if (Date.now() - t1 >= config.timeBudget) {\r\n            break;\r\n        }\r\n        // reset the index at which the regexp should start matching, also know where it\r\n        // should stop so that subsequent search don't repeat previous searches\r\n        const regexIndex = pos - config.windowSize * i;\r\n        wordDefinition.lastIndex = Math.max(0, regexIndex);\r\n        const thisMatch = _findRegexMatchEnclosingPosition(wordDefinition, text, pos, prevRegexIndex);\r\n        if (!thisMatch && match) {\r\n            // stop: we have something\r\n            break;\r\n        }\r\n        match = thisMatch;\r\n        // stop: searched at start\r\n        if (regexIndex <= 0) {\r\n            break;\r\n        }\r\n        prevRegexIndex = regexIndex;\r\n    }\r\n    if (match) {\r\n        let result = {\r\n            word: match[0],\r\n            startColumn: textOffset + 1 + match.index,\r\n            endColumn: textOffset + 1 + match.index + match[0].length\r\n        };\r\n        wordDefinition.lastIndex = 0;\r\n        return result;\r\n    }\r\n    return null;\r\n}\r\nfunction _findRegexMatchEnclosingPosition(wordDefinition, text, pos, stopPos) {\r\n    let match;\r\n    while (match = wordDefinition.exec(text)) {\r\n        const matchIndex = match.index || 0;\r\n        if (matchIndex <= pos && wordDefinition.lastIndex >= pos) {\r\n            return match;\r\n        }\r\n        else if (stopPos > 0 && matchIndex > stopPos) {\r\n            return null;\r\n        }\r\n    }\r\n    return null;\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js":
/*!*******************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js ***!
  \*******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"Uint8Matrix\": () => (/* binding */ Uint8Matrix),\n/* harmony export */   \"StateMachine\": () => (/* binding */ StateMachine),\n/* harmony export */   \"LinkComputer\": () => (/* binding */ LinkComputer),\n/* harmony export */   \"computeLinks\": () => (/* binding */ computeLinks)\n/* harmony export */ });\n/* harmony import */ var _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/characterClassifier.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nclass Uint8Matrix {\r\n    constructor(rows, cols, defaultValue) {\r\n        const data = new Uint8Array(rows * cols);\r\n        for (let i = 0, len = rows * cols; i < len; i++) {\r\n            data[i] = defaultValue;\r\n        }\r\n        this._data = data;\r\n        this.rows = rows;\r\n        this.cols = cols;\r\n    }\r\n    get(row, col) {\r\n        return this._data[row * this.cols + col];\r\n    }\r\n    set(row, col, value) {\r\n        this._data[row * this.cols + col] = value;\r\n    }\r\n}\r\nclass StateMachine {\r\n    constructor(edges) {\r\n        let maxCharCode = 0;\r\n        let maxState = 0 /* Invalid */;\r\n        for (let i = 0, len = edges.length; i < len; i++) {\r\n            let [from, chCode, to] = edges[i];\r\n            if (chCode > maxCharCode) {\r\n                maxCharCode = chCode;\r\n            }\r\n            if (from > maxState) {\r\n                maxState = from;\r\n            }\r\n            if (to > maxState) {\r\n                maxState = to;\r\n            }\r\n        }\r\n        maxCharCode++;\r\n        maxState++;\r\n        let states = new Uint8Matrix(maxState, maxCharCode, 0 /* Invalid */);\r\n        for (let i = 0, len = edges.length; i < len; i++) {\r\n            let [from, chCode, to] = edges[i];\r\n            states.set(from, chCode, to);\r\n        }\r\n        this._states = states;\r\n        this._maxCharCode = maxCharCode;\r\n    }\r\n    nextState(currentState, chCode) {\r\n        if (chCode < 0 || chCode >= this._maxCharCode) {\r\n            return 0 /* Invalid */;\r\n        }\r\n        return this._states.get(currentState, chCode);\r\n    }\r\n}\r\n// State machine for http:// or https:// or file://\r\nlet _stateMachine = null;\r\nfunction getStateMachine() {\r\n    if (_stateMachine === null) {\r\n        _stateMachine = new StateMachine([\r\n            [1 /* Start */, 104 /* h */, 2 /* H */],\r\n            [1 /* Start */, 72 /* H */, 2 /* H */],\r\n            [1 /* Start */, 102 /* f */, 6 /* F */],\r\n            [1 /* Start */, 70 /* F */, 6 /* F */],\r\n            [2 /* H */, 116 /* t */, 3 /* HT */],\r\n            [2 /* H */, 84 /* T */, 3 /* HT */],\r\n            [3 /* HT */, 116 /* t */, 4 /* HTT */],\r\n            [3 /* HT */, 84 /* T */, 4 /* HTT */],\r\n            [4 /* HTT */, 112 /* p */, 5 /* HTTP */],\r\n            [4 /* HTT */, 80 /* P */, 5 /* HTTP */],\r\n            [5 /* HTTP */, 115 /* s */, 9 /* BeforeColon */],\r\n            [5 /* HTTP */, 83 /* S */, 9 /* BeforeColon */],\r\n            [5 /* HTTP */, 58 /* Colon */, 10 /* AfterColon */],\r\n            [6 /* F */, 105 /* i */, 7 /* FI */],\r\n            [6 /* F */, 73 /* I */, 7 /* FI */],\r\n            [7 /* FI */, 108 /* l */, 8 /* FIL */],\r\n            [7 /* FI */, 76 /* L */, 8 /* FIL */],\r\n            [8 /* FIL */, 101 /* e */, 9 /* BeforeColon */],\r\n            [8 /* FIL */, 69 /* E */, 9 /* BeforeColon */],\r\n            [9 /* BeforeColon */, 58 /* Colon */, 10 /* AfterColon */],\r\n            [10 /* AfterColon */, 47 /* Slash */, 11 /* AlmostThere */],\r\n            [11 /* AlmostThere */, 47 /* Slash */, 12 /* End */],\r\n        ]);\r\n    }\r\n    return _stateMachine;\r\n}\r\nlet _classifier = null;\r\nfunction getClassifier() {\r\n    if (_classifier === null) {\r\n        _classifier = new _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__.CharacterClassifier(0 /* None */);\r\n        const FORCE_TERMINATION_CHARACTERS = ' \\t<>\\'\\\"、。｡､，．：；‘“〈《「『【〔（［｛｢｣｝］）〕】』」》〉”’｀～…';\r\n        for (let i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) {\r\n            _classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), 1 /* ForceTermination */);\r\n        }\r\n        const CANNOT_END_WITH_CHARACTERS = '.,;';\r\n        for (let i = 0; i < CANNOT_END_WITH_CHARACTERS.length; i++) {\r\n            _classifier.set(CANNOT_END_WITH_CHARACTERS.charCodeAt(i), 2 /* CannotEndIn */);\r\n        }\r\n    }\r\n    return _classifier;\r\n}\r\nclass LinkComputer {\r\n    static _createLink(classifier, line, lineNumber, linkBeginIndex, linkEndIndex) {\r\n        // Do not allow to end link in certain characters...\r\n        let lastIncludedCharIndex = linkEndIndex - 1;\r\n        do {\r\n            const chCode = line.charCodeAt(lastIncludedCharIndex);\r\n            const chClass = classifier.get(chCode);\r\n            if (chClass !== 2 /* CannotEndIn */) {\r\n                break;\r\n            }\r\n            lastIncludedCharIndex--;\r\n        } while (lastIncludedCharIndex > linkBeginIndex);\r\n        // Handle links enclosed in parens, square brackets and curlys.\r\n        if (linkBeginIndex > 0) {\r\n            const charCodeBeforeLink = line.charCodeAt(linkBeginIndex - 1);\r\n            const lastCharCodeInLink = line.charCodeAt(lastIncludedCharIndex);\r\n            if ((charCodeBeforeLink === 40 /* OpenParen */ && lastCharCodeInLink === 41 /* CloseParen */)\r\n                || (charCodeBeforeLink === 91 /* OpenSquareBracket */ && lastCharCodeInLink === 93 /* CloseSquareBracket */)\r\n                || (charCodeBeforeLink === 123 /* OpenCurlyBrace */ && lastCharCodeInLink === 125 /* CloseCurlyBrace */)) {\r\n                // Do not end in ) if ( is before the link start\r\n                // Do not end in ] if [ is before the link start\r\n                // Do not end in } if { is before the link start\r\n                lastIncludedCharIndex--;\r\n            }\r\n        }\r\n        return {\r\n            range: {\r\n                startLineNumber: lineNumber,\r\n                startColumn: linkBeginIndex + 1,\r\n                endLineNumber: lineNumber,\r\n                endColumn: lastIncludedCharIndex + 2\r\n            },\r\n            url: line.substring(linkBeginIndex, lastIncludedCharIndex + 1)\r\n        };\r\n    }\r\n    static computeLinks(model, stateMachine = getStateMachine()) {\r\n        const classifier = getClassifier();\r\n        let result = [];\r\n        for (let i = 1, lineCount = model.getLineCount(); i <= lineCount; i++) {\r\n            const line = model.getLineContent(i);\r\n            const len = line.length;\r\n            let j = 0;\r\n            let linkBeginIndex = 0;\r\n            let linkBeginChCode = 0;\r\n            let state = 1 /* Start */;\r\n            let hasOpenParens = false;\r\n            let hasOpenSquareBracket = false;\r\n            let inSquareBrackets = false;\r\n            let hasOpenCurlyBracket = false;\r\n            while (j < len) {\r\n                let resetStateMachine = false;\r\n                const chCode = line.charCodeAt(j);\r\n                if (state === 13 /* Accept */) {\r\n                    let chClass;\r\n                    switch (chCode) {\r\n                        case 40 /* OpenParen */:\r\n                            hasOpenParens = true;\r\n                            chClass = 0 /* None */;\r\n                            break;\r\n                        case 41 /* CloseParen */:\r\n                            chClass = (hasOpenParens ? 0 /* None */ : 1 /* ForceTermination */);\r\n                            break;\r\n                        case 91 /* OpenSquareBracket */:\r\n                            inSquareBrackets = true;\r\n                            hasOpenSquareBracket = true;\r\n                            chClass = 0 /* None */;\r\n                            break;\r\n                        case 93 /* CloseSquareBracket */:\r\n                            inSquareBrackets = false;\r\n                            chClass = (hasOpenSquareBracket ? 0 /* None */ : 1 /* ForceTermination */);\r\n                            break;\r\n                        case 123 /* OpenCurlyBrace */:\r\n                            hasOpenCurlyBracket = true;\r\n                            chClass = 0 /* None */;\r\n                            break;\r\n                        case 125 /* CloseCurlyBrace */:\r\n                            chClass = (hasOpenCurlyBracket ? 0 /* None */ : 1 /* ForceTermination */);\r\n                            break;\r\n                        /* The following three rules make it that ' or \" or ` are allowed inside links if the link began with a different one */\r\n                        case 39 /* SingleQuote */:\r\n                            chClass = (linkBeginChCode === 34 /* DoubleQuote */ || linkBeginChCode === 96 /* BackTick */) ? 0 /* None */ : 1 /* ForceTermination */;\r\n                            break;\r\n                        case 34 /* DoubleQuote */:\r\n                            chClass = (linkBeginChCode === 39 /* SingleQuote */ || linkBeginChCode === 96 /* BackTick */) ? 0 /* None */ : 1 /* ForceTermination */;\r\n                            break;\r\n                        case 96 /* BackTick */:\r\n                            chClass = (linkBeginChCode === 39 /* SingleQuote */ || linkBeginChCode === 34 /* DoubleQuote */) ? 0 /* None */ : 1 /* ForceTermination */;\r\n                            break;\r\n                        case 42 /* Asterisk */:\r\n                            // `*` terminates a link if the link began with `*`\r\n                            chClass = (linkBeginChCode === 42 /* Asterisk */) ? 1 /* ForceTermination */ : 0 /* None */;\r\n                            break;\r\n                        case 124 /* Pipe */:\r\n                            // `|` terminates a link if the link began with `|`\r\n                            chClass = (linkBeginChCode === 124 /* Pipe */) ? 1 /* ForceTermination */ : 0 /* None */;\r\n                            break;\r\n                        case 32 /* Space */:\r\n                            // ` ` allow space in between [ and ]\r\n                            chClass = (inSquareBrackets ? 0 /* None */ : 1 /* ForceTermination */);\r\n                            break;\r\n                        default:\r\n                            chClass = classifier.get(chCode);\r\n                    }\r\n                    // Check if character terminates link\r\n                    if (chClass === 1 /* ForceTermination */) {\r\n                        result.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, j));\r\n                        resetStateMachine = true;\r\n                    }\r\n                }\r\n                else if (state === 12 /* End */) {\r\n                    let chClass;\r\n                    if (chCode === 91 /* OpenSquareBracket */) {\r\n                        // Allow for the authority part to contain ipv6 addresses which contain [ and ]\r\n                        hasOpenSquareBracket = true;\r\n                        chClass = 0 /* None */;\r\n                    }\r\n                    else {\r\n                        chClass = classifier.get(chCode);\r\n                    }\r\n                    // Check if character terminates link\r\n                    if (chClass === 1 /* ForceTermination */) {\r\n                        resetStateMachine = true;\r\n                    }\r\n                    else {\r\n                        state = 13 /* Accept */;\r\n                    }\r\n                }\r\n                else {\r\n                    state = stateMachine.nextState(state, chCode);\r\n                    if (state === 0 /* Invalid */) {\r\n                        resetStateMachine = true;\r\n                    }\r\n                }\r\n                if (resetStateMachine) {\r\n                    state = 1 /* Start */;\r\n                    hasOpenParens = false;\r\n                    hasOpenSquareBracket = false;\r\n                    hasOpenCurlyBracket = false;\r\n                    // Record where the link started\r\n                    linkBeginIndex = j + 1;\r\n                    linkBeginChCode = chCode;\r\n                }\r\n                j++;\r\n            }\r\n            if (state === 13 /* Accept */) {\r\n                result.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, len));\r\n            }\r\n        }\r\n        return result;\r\n    }\r\n}\r\n/**\r\n * Returns an array of all links contains in the provided\r\n * document. *Note* that this operation is computational\r\n * expensive and should not run in the UI thread.\r\n */\r\nfunction computeLinks(model) {\r\n    if (!model || typeof model.getLineCount !== 'function' || typeof model.getLineContent !== 'function') {\r\n        // Unknown caller!\r\n        return [];\r\n    }\r\n    return LinkComputer.computeLinks(model);\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js":
/*!*************************************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js ***!
  \*************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"BasicInplaceReplace\": () => (/* binding */ BasicInplaceReplace)\n/* harmony export */ });\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nclass BasicInplaceReplace {\r\n    constructor() {\r\n        this._defaultValueSet = [\r\n            ['true', 'false'],\r\n            ['True', 'False'],\r\n            ['Private', 'Public', 'Friend', 'ReadOnly', 'Partial', 'Protected', 'WriteOnly'],\r\n            ['public', 'protected', 'private'],\r\n        ];\r\n    }\r\n    navigateValueSet(range1, text1, range2, text2, up) {\r\n        if (range1 && text1) {\r\n            let result = this.doNavigateValueSet(text1, up);\r\n            if (result) {\r\n                return {\r\n                    range: range1,\r\n                    value: result\r\n                };\r\n            }\r\n        }\r\n        if (range2 && text2) {\r\n            let result = this.doNavigateValueSet(text2, up);\r\n            if (result) {\r\n                return {\r\n                    range: range2,\r\n                    value: result\r\n                };\r\n            }\r\n        }\r\n        return null;\r\n    }\r\n    doNavigateValueSet(text, up) {\r\n        let numberResult = this.numberReplace(text, up);\r\n        if (numberResult !== null) {\r\n            return numberResult;\r\n        }\r\n        return this.textReplace(text, up);\r\n    }\r\n    numberReplace(value, up) {\r\n        let precision = Math.pow(10, value.length - (value.lastIndexOf('.') + 1));\r\n        let n1 = Number(value);\r\n        let n2 = parseFloat(value);\r\n        if (!isNaN(n1) && !isNaN(n2) && n1 === n2) {\r\n            if (n1 === 0 && !up) {\r\n                return null; // don't do negative\r\n                //\t\t\t} else if(n1 === 9 && up) {\r\n                //\t\t\t\treturn null; // don't insert 10 into a number\r\n            }\r\n            else {\r\n                n1 = Math.floor(n1 * precision);\r\n                n1 += up ? precision : -precision;\r\n                return String(n1 / precision);\r\n            }\r\n        }\r\n        return null;\r\n    }\r\n    textReplace(value, up) {\r\n        return this.valueSetsReplace(this._defaultValueSet, value, up);\r\n    }\r\n    valueSetsReplace(valueSets, value, up) {\r\n        let result = null;\r\n        for (let i = 0, len = valueSets.length; result === null && i < len; i++) {\r\n            result = this.valueSetReplace(valueSets[i], value, up);\r\n        }\r\n        return result;\r\n    }\r\n    valueSetReplace(valueSet, value, up) {\r\n        let idx = valueSet.indexOf(value);\r\n        if (idx >= 0) {\r\n            idx += up ? +1 : -1;\r\n            if (idx < 0) {\r\n                idx = valueSet.length - 1;\r\n            }\r\n            else {\r\n                idx %= valueSet.length;\r\n            }\r\n            return valueSet[idx];\r\n        }\r\n        return null;\r\n    }\r\n}\r\nBasicInplaceReplace.INSTANCE = new BasicInplaceReplace();\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js":
/*!****************************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js ***!
  \****************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"EditorSimpleWorker\": () => (/* binding */ EditorSimpleWorker),\n/* harmony export */   \"create\": () => (/* binding */ create)\n/* harmony export */ });\n/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ \"./node_modules/monaco-editor/esm/vs/base/common/arrays.js\");\n/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ \"./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js\");\n/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/platform.js */ \"./node_modules/monaco-editor/esm/vs/base/common/platform.js\");\n/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/uri.js */ \"./node_modules/monaco-editor/esm/vs/base/common/uri.js\");\n/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/position.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/core/position.js\");\n/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/range.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/core/range.js\");\n/* harmony import */ var _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../diff/diffComputer.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js\");\n/* harmony import */ var _model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../model/mirrorTextModel.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js\");\n/* harmony import */ var _model_wordHelper_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../model/wordHelper.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js\");\n/* harmony import */ var _modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../modes/linkComputer.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js\");\n/* harmony import */ var _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../modes/supports/inplaceReplaceSupport.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js\");\n/* harmony import */ var _standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../standalone/standaloneBase.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js\");\n/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../base/common/types.js */ \"./node_modules/monaco-editor/esm/vs/base/common/types.js\");\n/* harmony import */ var _base_common_stopwatch_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../base/common/stopwatch.js */ \"./node_modules/monaco-editor/esm/vs/base/common/stopwatch.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n    return new (P || (P = Promise))(function (resolve, reject) {\r\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n    });\r\n};\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * @internal\r\n */\r\nclass MirrorModel extends _model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_7__.MirrorTextModel {\r\n    get uri() {\r\n        return this._uri;\r\n    }\r\n    get version() {\r\n        return this._versionId;\r\n    }\r\n    get eol() {\r\n        return this._eol;\r\n    }\r\n    getValue() {\r\n        return this.getText();\r\n    }\r\n    getLinesContent() {\r\n        return this._lines.slice(0);\r\n    }\r\n    getLineCount() {\r\n        return this._lines.length;\r\n    }\r\n    getLineContent(lineNumber) {\r\n        return this._lines[lineNumber - 1];\r\n    }\r\n    getWordAtPosition(position, wordDefinition) {\r\n        let wordAtText = (0,_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_8__.getWordAtText)(position.column, (0,_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_8__.ensureValidWordDefinition)(wordDefinition), this._lines[position.lineNumber - 1], 0);\r\n        if (wordAtText) {\r\n            return new _core_range_js__WEBPACK_IMPORTED_MODULE_5__.Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn);\r\n        }\r\n        return null;\r\n    }\r\n    words(wordDefinition) {\r\n        const lines = this._lines;\r\n        const wordenize = this._wordenize.bind(this);\r\n        let lineNumber = 0;\r\n        let lineText = '';\r\n        let wordRangesIdx = 0;\r\n        let wordRanges = [];\r\n        return {\r\n            *[Symbol.iterator]() {\r\n                while (true) {\r\n                    if (wordRangesIdx < wordRanges.length) {\r\n                        const value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end);\r\n                        wordRangesIdx += 1;\r\n                        yield value;\r\n                    }\r\n                    else {\r\n                        if (lineNumber < lines.length) {\r\n                            lineText = lines[lineNumber];\r\n                            wordRanges = wordenize(lineText, wordDefinition);\r\n                            wordRangesIdx = 0;\r\n                            lineNumber += 1;\r\n                        }\r\n                        else {\r\n                            break;\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        };\r\n    }\r\n    getLineWords(lineNumber, wordDefinition) {\r\n        let content = this._lines[lineNumber - 1];\r\n        let ranges = this._wordenize(content, wordDefinition);\r\n        let words = [];\r\n        for (const range of ranges) {\r\n            words.push({\r\n                word: content.substring(range.start, range.end),\r\n                startColumn: range.start + 1,\r\n                endColumn: range.end + 1\r\n            });\r\n        }\r\n        return words;\r\n    }\r\n    _wordenize(content, wordDefinition) {\r\n        const result = [];\r\n        let match;\r\n        wordDefinition.lastIndex = 0; // reset lastIndex just to be sure\r\n        while (match = wordDefinition.exec(content)) {\r\n            if (match[0].length === 0) {\r\n                // it did match the empty string\r\n                break;\r\n            }\r\n            result.push({ start: match.index, end: match.index + match[0].length });\r\n        }\r\n        return result;\r\n    }\r\n    getValueInRange(range) {\r\n        range = this._validateRange(range);\r\n        if (range.startLineNumber === range.endLineNumber) {\r\n            return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1);\r\n        }\r\n        let lineEnding = this._eol;\r\n        let startLineIndex = range.startLineNumber - 1;\r\n        let endLineIndex = range.endLineNumber - 1;\r\n        let resultLines = [];\r\n        resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1));\r\n        for (let i = startLineIndex + 1; i < endLineIndex; i++) {\r\n            resultLines.push(this._lines[i]);\r\n        }\r\n        resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1));\r\n        return resultLines.join(lineEnding);\r\n    }\r\n    offsetAt(position) {\r\n        position = this._validatePosition(position);\r\n        this._ensureLineStarts();\r\n        return this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1);\r\n    }\r\n    positionAt(offset) {\r\n        offset = Math.floor(offset);\r\n        offset = Math.max(0, offset);\r\n        this._ensureLineStarts();\r\n        let out = this._lineStarts.getIndexOf(offset);\r\n        let lineLength = this._lines[out.index].length;\r\n        // Ensure we return a valid position\r\n        return {\r\n            lineNumber: 1 + out.index,\r\n            column: 1 + Math.min(out.remainder, lineLength)\r\n        };\r\n    }\r\n    _validateRange(range) {\r\n        const start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn });\r\n        const end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn });\r\n        if (start.lineNumber !== range.startLineNumber\r\n            || start.column !== range.startColumn\r\n            || end.lineNumber !== range.endLineNumber\r\n            || end.column !== range.endColumn) {\r\n            return {\r\n                startLineNumber: start.lineNumber,\r\n                startColumn: start.column,\r\n                endLineNumber: end.lineNumber,\r\n                endColumn: end.column\r\n            };\r\n        }\r\n        return range;\r\n    }\r\n    _validatePosition(position) {\r\n        if (!_core_position_js__WEBPACK_IMPORTED_MODULE_4__.Position.isIPosition(position)) {\r\n            throw new Error('bad position');\r\n        }\r\n        let { lineNumber, column } = position;\r\n        let hasChanged = false;\r\n        if (lineNumber < 1) {\r\n            lineNumber = 1;\r\n            column = 1;\r\n            hasChanged = true;\r\n        }\r\n        else if (lineNumber > this._lines.length) {\r\n            lineNumber = this._lines.length;\r\n            column = this._lines[lineNumber - 1].length + 1;\r\n            hasChanged = true;\r\n        }\r\n        else {\r\n            let maxCharacter = this._lines[lineNumber - 1].length + 1;\r\n            if (column < 1) {\r\n                column = 1;\r\n                hasChanged = true;\r\n            }\r\n            else if (column > maxCharacter) {\r\n                column = maxCharacter;\r\n                hasChanged = true;\r\n            }\r\n        }\r\n        if (!hasChanged) {\r\n            return position;\r\n        }\r\n        else {\r\n            return { lineNumber, column };\r\n        }\r\n    }\r\n}\r\n/**\r\n * @internal\r\n */\r\nclass EditorSimpleWorker {\r\n    constructor(host, foreignModuleFactory) {\r\n        this._host = host;\r\n        this._models = Object.create(null);\r\n        this._foreignModuleFactory = foreignModuleFactory;\r\n        this._foreignModule = null;\r\n    }\r\n    dispose() {\r\n        this._models = Object.create(null);\r\n    }\r\n    _getModel(uri) {\r\n        return this._models[uri];\r\n    }\r\n    _getModels() {\r\n        let all = [];\r\n        Object.keys(this._models).forEach((key) => all.push(this._models[key]));\r\n        return all;\r\n    }\r\n    acceptNewModel(data) {\r\n        this._models[data.url] = new MirrorModel(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__.URI.parse(data.url), data.lines, data.EOL, data.versionId);\r\n    }\r\n    acceptModelChanged(strURL, e) {\r\n        if (!this._models[strURL]) {\r\n            return;\r\n        }\r\n        let model = this._models[strURL];\r\n        model.onEvents(e);\r\n    }\r\n    acceptRemovedModel(strURL) {\r\n        if (!this._models[strURL]) {\r\n            return;\r\n        }\r\n        delete this._models[strURL];\r\n    }\r\n    // ---- BEGIN diff --------------------------------------------------------------------------\r\n    computeDiff(originalUrl, modifiedUrl, ignoreTrimWhitespace, maxComputationTime) {\r\n        return __awaiter(this, void 0, void 0, function* () {\r\n            const original = this._getModel(originalUrl);\r\n            const modified = this._getModel(modifiedUrl);\r\n            if (!original || !modified) {\r\n                return null;\r\n            }\r\n            const originalLines = original.getLinesContent();\r\n            const modifiedLines = modified.getLinesContent();\r\n            const diffComputer = new _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_6__.DiffComputer(originalLines, modifiedLines, {\r\n                shouldComputeCharChanges: true,\r\n                shouldPostProcessCharChanges: true,\r\n                shouldIgnoreTrimWhitespace: ignoreTrimWhitespace,\r\n                shouldMakePrettyDiff: true,\r\n                maxComputationTime: maxComputationTime\r\n            });\r\n            const diffResult = diffComputer.computeDiff();\r\n            const identical = (diffResult.changes.length > 0 ? false : this._modelsAreIdentical(original, modified));\r\n            return {\r\n                quitEarly: diffResult.quitEarly,\r\n                identical: identical,\r\n                changes: diffResult.changes\r\n            };\r\n        });\r\n    }\r\n    _modelsAreIdentical(original, modified) {\r\n        const originalLineCount = original.getLineCount();\r\n        const modifiedLineCount = modified.getLineCount();\r\n        if (originalLineCount !== modifiedLineCount) {\r\n            return false;\r\n        }\r\n        for (let line = 1; line <= originalLineCount; line++) {\r\n            const originalLine = original.getLineContent(line);\r\n            const modifiedLine = modified.getLineContent(line);\r\n            if (originalLine !== modifiedLine) {\r\n                return false;\r\n            }\r\n        }\r\n        return true;\r\n    }\r\n    computeMoreMinimalEdits(modelUrl, edits) {\r\n        return __awaiter(this, void 0, void 0, function* () {\r\n            const model = this._getModel(modelUrl);\r\n            if (!model) {\r\n                return edits;\r\n            }\r\n            const result = [];\r\n            let lastEol = undefined;\r\n            edits = (0,_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__.mergeSort)(edits, (a, b) => {\r\n                if (a.range && b.range) {\r\n                    return _core_range_js__WEBPACK_IMPORTED_MODULE_5__.Range.compareRangesUsingStarts(a.range, b.range);\r\n                }\r\n                // eol only changes should go to the end\r\n                let aRng = a.range ? 0 : 1;\r\n                let bRng = b.range ? 0 : 1;\r\n                return aRng - bRng;\r\n            });\r\n            for (let { range, text, eol } of edits) {\r\n                if (typeof eol === 'number') {\r\n                    lastEol = eol;\r\n                }\r\n                if (_core_range_js__WEBPACK_IMPORTED_MODULE_5__.Range.isEmpty(range) && !text) {\r\n                    // empty change\r\n                    continue;\r\n                }\r\n                const original = model.getValueInRange(range);\r\n                text = text.replace(/\\r\\n|\\n|\\r/g, model.eol);\r\n                if (original === text) {\r\n                    // noop\r\n                    continue;\r\n                }\r\n                // make sure diff won't take too long\r\n                if (Math.max(text.length, original.length) > EditorSimpleWorker._diffLimit) {\r\n                    result.push({ range, text });\r\n                    continue;\r\n                }\r\n                // compute diff between original and edit.text\r\n                const changes = (0,_base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__.stringDiff)(original, text, false);\r\n                const editOffset = model.offsetAt(_core_range_js__WEBPACK_IMPORTED_MODULE_5__.Range.lift(range).getStartPosition());\r\n                for (const change of changes) {\r\n                    const start = model.positionAt(editOffset + change.originalStart);\r\n                    const end = model.positionAt(editOffset + change.originalStart + change.originalLength);\r\n                    const newEdit = {\r\n                        text: text.substr(change.modifiedStart, change.modifiedLength),\r\n                        range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column }\r\n                    };\r\n                    if (model.getValueInRange(newEdit.range) !== newEdit.text) {\r\n                        result.push(newEdit);\r\n                    }\r\n                }\r\n            }\r\n            if (typeof lastEol === 'number') {\r\n                result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } });\r\n            }\r\n            return result;\r\n        });\r\n    }\r\n    // ---- END minimal edits ---------------------------------------------------------------\r\n    computeLinks(modelUrl) {\r\n        return __awaiter(this, void 0, void 0, function* () {\r\n            let model = this._getModel(modelUrl);\r\n            if (!model) {\r\n                return null;\r\n            }\r\n            return (0,_modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_9__.computeLinks)(model);\r\n        });\r\n    }\r\n    textualSuggest(modelUrls, leadingWord, wordDef, wordDefFlags) {\r\n        return __awaiter(this, void 0, void 0, function* () {\r\n            const sw = new _base_common_stopwatch_js__WEBPACK_IMPORTED_MODULE_13__.StopWatch(true);\r\n            const wordDefRegExp = new RegExp(wordDef, wordDefFlags);\r\n            const seen = new Set();\r\n            outer: for (let url of modelUrls) {\r\n                const model = this._getModel(url);\r\n                if (!model) {\r\n                    continue;\r\n                }\r\n                for (let word of model.words(wordDefRegExp)) {\r\n                    if (word === leadingWord || !isNaN(Number(word))) {\r\n                        continue;\r\n                    }\r\n                    seen.add(word);\r\n                    if (seen.size > EditorSimpleWorker._suggestionsLimit) {\r\n                        break outer;\r\n                    }\r\n                }\r\n            }\r\n            return { words: Array.from(seen), duration: sw.elapsed() };\r\n        });\r\n    }\r\n    // ---- END suggest --------------------------------------------------------------------------\r\n    //#region -- word ranges --\r\n    computeWordRanges(modelUrl, range, wordDef, wordDefFlags) {\r\n        return __awaiter(this, void 0, void 0, function* () {\r\n            let model = this._getModel(modelUrl);\r\n            if (!model) {\r\n                return Object.create(null);\r\n            }\r\n            const wordDefRegExp = new RegExp(wordDef, wordDefFlags);\r\n            const result = Object.create(null);\r\n            for (let line = range.startLineNumber; line < range.endLineNumber; line++) {\r\n                let words = model.getLineWords(line, wordDefRegExp);\r\n                for (const word of words) {\r\n                    if (!isNaN(Number(word.word))) {\r\n                        continue;\r\n                    }\r\n                    let array = result[word.word];\r\n                    if (!array) {\r\n                        array = [];\r\n                        result[word.word] = array;\r\n                    }\r\n                    array.push({\r\n                        startLineNumber: line,\r\n                        startColumn: word.startColumn,\r\n                        endLineNumber: line,\r\n                        endColumn: word.endColumn\r\n                    });\r\n                }\r\n            }\r\n            return result;\r\n        });\r\n    }\r\n    //#endregion\r\n    navigateValueSet(modelUrl, range, up, wordDef, wordDefFlags) {\r\n        return __awaiter(this, void 0, void 0, function* () {\r\n            let model = this._getModel(modelUrl);\r\n            if (!model) {\r\n                return null;\r\n            }\r\n            let wordDefRegExp = new RegExp(wordDef, wordDefFlags);\r\n            if (range.startColumn === range.endColumn) {\r\n                range = {\r\n                    startLineNumber: range.startLineNumber,\r\n                    startColumn: range.startColumn,\r\n                    endLineNumber: range.endLineNumber,\r\n                    endColumn: range.endColumn + 1\r\n                };\r\n            }\r\n            let selectionText = model.getValueInRange(range);\r\n            let wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp);\r\n            if (!wordRange) {\r\n                return null;\r\n            }\r\n            let word = model.getValueInRange(wordRange);\r\n            let result = _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_10__.BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up);\r\n            return result;\r\n        });\r\n    }\r\n    // ---- BEGIN foreign module support --------------------------------------------------------------------------\r\n    loadForeignModule(moduleId, createData, foreignHostMethods) {\r\n        const proxyMethodRequest = (method, args) => {\r\n            return this._host.fhr(method, args);\r\n        };\r\n        const foreignHost = _base_common_types_js__WEBPACK_IMPORTED_MODULE_12__.createProxyObject(foreignHostMethods, proxyMethodRequest);\r\n        let ctx = {\r\n            host: foreignHost,\r\n            getMirrorModels: () => {\r\n                return this._getModels();\r\n            }\r\n        };\r\n        if (this._foreignModuleFactory) {\r\n            this._foreignModule = this._foreignModuleFactory(ctx, createData);\r\n            // static foreing module\r\n            return Promise.resolve(_base_common_types_js__WEBPACK_IMPORTED_MODULE_12__.getAllMethodNames(this._foreignModule));\r\n        }\r\n        // ESM-comment-begin\r\n        // \t\treturn new Promise<any>((resolve, reject) => {\r\n        // \t\t\trequire([moduleId], (foreignModule: { create: IForeignModuleFactory }) => {\r\n        // \t\t\t\tthis._foreignModule = foreignModule.create(ctx, createData);\r\n        // \r\n        // \t\t\t\tresolve(types.getAllMethodNames(this._foreignModule));\r\n        // \r\n        // \t\t\t}, reject);\r\n        // \t\t});\r\n        // ESM-comment-end\r\n        // ESM-uncomment-begin\r\n        return Promise.reject(new Error(`Unexpected usage`));\r\n        // ESM-uncomment-end\r\n    }\r\n    // foreign method request\r\n    fmr(method, args) {\r\n        if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') {\r\n            return Promise.reject(new Error('Missing requestHandler or method: ' + method));\r\n        }\r\n        try {\r\n            return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args));\r\n        }\r\n        catch (e) {\r\n            return Promise.reject(e);\r\n        }\r\n    }\r\n}\r\n// ---- END diff --------------------------------------------------------------------------\r\n// ---- BEGIN minimal edits ---------------------------------------------------------------\r\nEditorSimpleWorker._diffLimit = 100000;\r\n// ---- BEGIN suggest --------------------------------------------------------------------------\r\nEditorSimpleWorker._suggestionsLimit = 10000;\r\n/**\r\n * Called on the worker side\r\n * @internal\r\n */\r\nfunction create(host) {\r\n    return new EditorSimpleWorker(host, null);\r\n}\r\nif (typeof importScripts === 'function') {\r\n    // Running in a web worker\r\n    _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__.globals.monaco = (0,_standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_11__.createMonacoBaseAPI)();\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js":
/*!**************************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js ***!
  \**************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"KeyMod\": () => (/* binding */ KeyMod),\n/* harmony export */   \"createMonacoBaseAPI\": () => (/* binding */ createMonacoBaseAPI)\n/* harmony export */ });\n/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ \"./node_modules/monaco-editor/esm/vs/base/common/cancellation.js\");\n/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/event.js */ \"./node_modules/monaco-editor/esm/vs/base/common/event.js\");\n/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ \"./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js\");\n/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/uri.js */ \"./node_modules/monaco-editor/esm/vs/base/common/uri.js\");\n/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/position.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/core/position.js\");\n/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/range.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/core/range.js\");\n/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/selection.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js\");\n/* harmony import */ var _core_token_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/token.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/core/token.js\");\n/* harmony import */ var _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./standaloneEnums.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nclass KeyMod {\r\n    static chord(firstPart, secondPart) {\r\n        return (0,_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__.KeyChord)(firstPart, secondPart);\r\n    }\r\n}\r\nKeyMod.CtrlCmd = 2048 /* CtrlCmd */;\r\nKeyMod.Shift = 1024 /* Shift */;\r\nKeyMod.Alt = 512 /* Alt */;\r\nKeyMod.WinCtrl = 256 /* WinCtrl */;\r\nfunction createMonacoBaseAPI() {\r\n    return {\r\n        editor: undefined,\r\n        languages: undefined,\r\n        CancellationTokenSource: _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__.CancellationTokenSource,\r\n        Emitter: _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__.Emitter,\r\n        KeyCode: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__.KeyCode,\r\n        KeyMod: KeyMod,\r\n        Position: _core_position_js__WEBPACK_IMPORTED_MODULE_4__.Position,\r\n        Range: _core_range_js__WEBPACK_IMPORTED_MODULE_5__.Range,\r\n        Selection: _core_selection_js__WEBPACK_IMPORTED_MODULE_6__.Selection,\r\n        SelectionDirection: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__.SelectionDirection,\r\n        MarkerSeverity: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__.MarkerSeverity,\r\n        MarkerTag: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__.MarkerTag,\r\n        Uri: _base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__.URI,\r\n        Token: _core_token_js__WEBPACK_IMPORTED_MODULE_7__.Token\r\n    };\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js":
/*!***************************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js ***!
  \***************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"AccessibilitySupport\": () => (/* binding */ AccessibilitySupport),\n/* harmony export */   \"CompletionItemInsertTextRule\": () => (/* binding */ CompletionItemInsertTextRule),\n/* harmony export */   \"CompletionItemKind\": () => (/* binding */ CompletionItemKind),\n/* harmony export */   \"CompletionItemTag\": () => (/* binding */ CompletionItemTag),\n/* harmony export */   \"CompletionTriggerKind\": () => (/* binding */ CompletionTriggerKind),\n/* harmony export */   \"ContentWidgetPositionPreference\": () => (/* binding */ ContentWidgetPositionPreference),\n/* harmony export */   \"CursorChangeReason\": () => (/* binding */ CursorChangeReason),\n/* harmony export */   \"DefaultEndOfLine\": () => (/* binding */ DefaultEndOfLine),\n/* harmony export */   \"DocumentHighlightKind\": () => (/* binding */ DocumentHighlightKind),\n/* harmony export */   \"EditorAutoIndentStrategy\": () => (/* binding */ EditorAutoIndentStrategy),\n/* harmony export */   \"EditorOption\": () => (/* binding */ EditorOption),\n/* harmony export */   \"EndOfLinePreference\": () => (/* binding */ EndOfLinePreference),\n/* harmony export */   \"EndOfLineSequence\": () => (/* binding */ EndOfLineSequence),\n/* harmony export */   \"IndentAction\": () => (/* binding */ IndentAction),\n/* harmony export */   \"InlineHintKind\": () => (/* binding */ InlineHintKind),\n/* harmony export */   \"KeyCode\": () => (/* binding */ KeyCode),\n/* harmony export */   \"MarkerSeverity\": () => (/* binding */ MarkerSeverity),\n/* harmony export */   \"MarkerTag\": () => (/* binding */ MarkerTag),\n/* harmony export */   \"MinimapPosition\": () => (/* binding */ MinimapPosition),\n/* harmony export */   \"MouseTargetType\": () => (/* binding */ MouseTargetType),\n/* harmony export */   \"OverlayWidgetPositionPreference\": () => (/* binding */ OverlayWidgetPositionPreference),\n/* harmony export */   \"OverviewRulerLane\": () => (/* binding */ OverviewRulerLane),\n/* harmony export */   \"RenderLineNumbersType\": () => (/* binding */ RenderLineNumbersType),\n/* harmony export */   \"RenderMinimap\": () => (/* binding */ RenderMinimap),\n/* harmony export */   \"ScrollType\": () => (/* binding */ ScrollType),\n/* harmony export */   \"ScrollbarVisibility\": () => (/* binding */ ScrollbarVisibility),\n/* harmony export */   \"SelectionDirection\": () => (/* binding */ SelectionDirection),\n/* harmony export */   \"SignatureHelpTriggerKind\": () => (/* binding */ SignatureHelpTriggerKind),\n/* harmony export */   \"SymbolKind\": () => (/* binding */ SymbolKind),\n/* harmony export */   \"SymbolTag\": () => (/* binding */ SymbolTag),\n/* harmony export */   \"TextEditorCursorBlinkingStyle\": () => (/* binding */ TextEditorCursorBlinkingStyle),\n/* harmony export */   \"TextEditorCursorStyle\": () => (/* binding */ TextEditorCursorStyle),\n/* harmony export */   \"TrackedRangeStickiness\": () => (/* binding */ TrackedRangeStickiness),\n/* harmony export */   \"WrappingIndent\": () => (/* binding */ WrappingIndent)\n/* harmony export */ });\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.\r\nvar AccessibilitySupport;\r\n(function (AccessibilitySupport) {\r\n    /**\r\n     * This should be the browser case where it is not known if a screen reader is attached or no.\r\n     */\r\n    AccessibilitySupport[AccessibilitySupport[\"Unknown\"] = 0] = \"Unknown\";\r\n    AccessibilitySupport[AccessibilitySupport[\"Disabled\"] = 1] = \"Disabled\";\r\n    AccessibilitySupport[AccessibilitySupport[\"Enabled\"] = 2] = \"Enabled\";\r\n})(AccessibilitySupport || (AccessibilitySupport = {}));\r\nvar CompletionItemInsertTextRule;\r\n(function (CompletionItemInsertTextRule) {\r\n    /**\r\n     * Adjust whitespace/indentation of multiline insert texts to\r\n     * match the current line indentation.\r\n     */\r\n    CompletionItemInsertTextRule[CompletionItemInsertTextRule[\"KeepWhitespace\"] = 1] = \"KeepWhitespace\";\r\n    /**\r\n     * `insertText` is a snippet.\r\n     */\r\n    CompletionItemInsertTextRule[CompletionItemInsertTextRule[\"InsertAsSnippet\"] = 4] = \"InsertAsSnippet\";\r\n})(CompletionItemInsertTextRule || (CompletionItemInsertTextRule = {}));\r\nvar CompletionItemKind;\r\n(function (CompletionItemKind) {\r\n    CompletionItemKind[CompletionItemKind[\"Method\"] = 0] = \"Method\";\r\n    CompletionItemKind[CompletionItemKind[\"Function\"] = 1] = \"Function\";\r\n    CompletionItemKind[CompletionItemKind[\"Constructor\"] = 2] = \"Constructor\";\r\n    CompletionItemKind[CompletionItemKind[\"Field\"] = 3] = \"Field\";\r\n    CompletionItemKind[CompletionItemKind[\"Variable\"] = 4] = \"Variable\";\r\n    CompletionItemKind[CompletionItemKind[\"Class\"] = 5] = \"Class\";\r\n    CompletionItemKind[CompletionItemKind[\"Struct\"] = 6] = \"Struct\";\r\n    CompletionItemKind[CompletionItemKind[\"Interface\"] = 7] = \"Interface\";\r\n    CompletionItemKind[CompletionItemKind[\"Module\"] = 8] = \"Module\";\r\n    CompletionItemKind[CompletionItemKind[\"Property\"] = 9] = \"Property\";\r\n    CompletionItemKind[CompletionItemKind[\"Event\"] = 10] = \"Event\";\r\n    CompletionItemKind[CompletionItemKind[\"Operator\"] = 11] = \"Operator\";\r\n    CompletionItemKind[CompletionItemKind[\"Unit\"] = 12] = \"Unit\";\r\n    CompletionItemKind[CompletionItemKind[\"Value\"] = 13] = \"Value\";\r\n    CompletionItemKind[CompletionItemKind[\"Constant\"] = 14] = \"Constant\";\r\n    CompletionItemKind[CompletionItemKind[\"Enum\"] = 15] = \"Enum\";\r\n    CompletionItemKind[CompletionItemKind[\"EnumMember\"] = 16] = \"EnumMember\";\r\n    CompletionItemKind[CompletionItemKind[\"Keyword\"] = 17] = \"Keyword\";\r\n    CompletionItemKind[CompletionItemKind[\"Text\"] = 18] = \"Text\";\r\n    CompletionItemKind[CompletionItemKind[\"Color\"] = 19] = \"Color\";\r\n    CompletionItemKind[CompletionItemKind[\"File\"] = 20] = \"File\";\r\n    CompletionItemKind[CompletionItemKind[\"Reference\"] = 21] = \"Reference\";\r\n    CompletionItemKind[CompletionItemKind[\"Customcolor\"] = 22] = \"Customcolor\";\r\n    CompletionItemKind[CompletionItemKind[\"Folder\"] = 23] = \"Folder\";\r\n    CompletionItemKind[CompletionItemKind[\"TypeParameter\"] = 24] = \"TypeParameter\";\r\n    CompletionItemKind[CompletionItemKind[\"User\"] = 25] = \"User\";\r\n    CompletionItemKind[CompletionItemKind[\"Issue\"] = 26] = \"Issue\";\r\n    CompletionItemKind[CompletionItemKind[\"Snippet\"] = 27] = \"Snippet\";\r\n})(CompletionItemKind || (CompletionItemKind = {}));\r\nvar CompletionItemTag;\r\n(function (CompletionItemTag) {\r\n    CompletionItemTag[CompletionItemTag[\"Deprecated\"] = 1] = \"Deprecated\";\r\n})(CompletionItemTag || (CompletionItemTag = {}));\r\n/**\r\n * How a suggest provider was triggered.\r\n */\r\nvar CompletionTriggerKind;\r\n(function (CompletionTriggerKind) {\r\n    CompletionTriggerKind[CompletionTriggerKind[\"Invoke\"] = 0] = \"Invoke\";\r\n    CompletionTriggerKind[CompletionTriggerKind[\"TriggerCharacter\"] = 1] = \"TriggerCharacter\";\r\n    CompletionTriggerKind[CompletionTriggerKind[\"TriggerForIncompleteCompletions\"] = 2] = \"TriggerForIncompleteCompletions\";\r\n})(CompletionTriggerKind || (CompletionTriggerKind = {}));\r\n/**\r\n * A positioning preference for rendering content widgets.\r\n */\r\nvar ContentWidgetPositionPreference;\r\n(function (ContentWidgetPositionPreference) {\r\n    /**\r\n     * Place the content widget exactly at a position\r\n     */\r\n    ContentWidgetPositionPreference[ContentWidgetPositionPreference[\"EXACT\"] = 0] = \"EXACT\";\r\n    /**\r\n     * Place the content widget above a position\r\n     */\r\n    ContentWidgetPositionPreference[ContentWidgetPositionPreference[\"ABOVE\"] = 1] = \"ABOVE\";\r\n    /**\r\n     * Place the content widget below a position\r\n     */\r\n    ContentWidgetPositionPreference[ContentWidgetPositionPreference[\"BELOW\"] = 2] = \"BELOW\";\r\n})(ContentWidgetPositionPreference || (ContentWidgetPositionPreference = {}));\r\n/**\r\n * Describes the reason the cursor has changed its position.\r\n */\r\nvar CursorChangeReason;\r\n(function (CursorChangeReason) {\r\n    /**\r\n     * Unknown or not set.\r\n     */\r\n    CursorChangeReason[CursorChangeReason[\"NotSet\"] = 0] = \"NotSet\";\r\n    /**\r\n     * A `model.setValue()` was called.\r\n     */\r\n    CursorChangeReason[CursorChangeReason[\"ContentFlush\"] = 1] = \"ContentFlush\";\r\n    /**\r\n     * The `model` has been changed outside of this cursor and the cursor recovers its position from associated markers.\r\n     */\r\n    CursorChangeReason[CursorChangeReason[\"RecoverFromMarkers\"] = 2] = \"RecoverFromMarkers\";\r\n    /**\r\n     * There was an explicit user gesture.\r\n     */\r\n    CursorChangeReason[CursorChangeReason[\"Explicit\"] = 3] = \"Explicit\";\r\n    /**\r\n     * There was a Paste.\r\n     */\r\n    CursorChangeReason[CursorChangeReason[\"Paste\"] = 4] = \"Paste\";\r\n    /**\r\n     * There was an Undo.\r\n     */\r\n    CursorChangeReason[CursorChangeReason[\"Undo\"] = 5] = \"Undo\";\r\n    /**\r\n     * There was a Redo.\r\n     */\r\n    CursorChangeReason[CursorChangeReason[\"Redo\"] = 6] = \"Redo\";\r\n})(CursorChangeReason || (CursorChangeReason = {}));\r\n/**\r\n * The default end of line to use when instantiating models.\r\n */\r\nvar DefaultEndOfLine;\r\n(function (DefaultEndOfLine) {\r\n    /**\r\n     * Use line feed (\\n) as the end of line character.\r\n     */\r\n    DefaultEndOfLine[DefaultEndOfLine[\"LF\"] = 1] = \"LF\";\r\n    /**\r\n     * Use carriage return and line feed (\\r\\n) as the end of line character.\r\n     */\r\n    DefaultEndOfLine[DefaultEndOfLine[\"CRLF\"] = 2] = \"CRLF\";\r\n})(DefaultEndOfLine || (DefaultEndOfLine = {}));\r\n/**\r\n * A document highlight kind.\r\n */\r\nvar DocumentHighlightKind;\r\n(function (DocumentHighlightKind) {\r\n    /**\r\n     * A textual occurrence.\r\n     */\r\n    DocumentHighlightKind[DocumentHighlightKind[\"Text\"] = 0] = \"Text\";\r\n    /**\r\n     * Read-access of a symbol, like reading a variable.\r\n     */\r\n    DocumentHighlightKind[DocumentHighlightKind[\"Read\"] = 1] = \"Read\";\r\n    /**\r\n     * Write-access of a symbol, like writing to a variable.\r\n     */\r\n    DocumentHighlightKind[DocumentHighlightKind[\"Write\"] = 2] = \"Write\";\r\n})(DocumentHighlightKind || (DocumentHighlightKind = {}));\r\n/**\r\n * Configuration options for auto indentation in the editor\r\n */\r\nvar EditorAutoIndentStrategy;\r\n(function (EditorAutoIndentStrategy) {\r\n    EditorAutoIndentStrategy[EditorAutoIndentStrategy[\"None\"] = 0] = \"None\";\r\n    EditorAutoIndentStrategy[EditorAutoIndentStrategy[\"Keep\"] = 1] = \"Keep\";\r\n    EditorAutoIndentStrategy[EditorAutoIndentStrategy[\"Brackets\"] = 2] = \"Brackets\";\r\n    EditorAutoIndentStrategy[EditorAutoIndentStrategy[\"Advanced\"] = 3] = \"Advanced\";\r\n    EditorAutoIndentStrategy[EditorAutoIndentStrategy[\"Full\"] = 4] = \"Full\";\r\n})(EditorAutoIndentStrategy || (EditorAutoIndentStrategy = {}));\r\nvar EditorOption;\r\n(function (EditorOption) {\r\n    EditorOption[EditorOption[\"acceptSuggestionOnCommitCharacter\"] = 0] = \"acceptSuggestionOnCommitCharacter\";\r\n    EditorOption[EditorOption[\"acceptSuggestionOnEnter\"] = 1] = \"acceptSuggestionOnEnter\";\r\n    EditorOption[EditorOption[\"accessibilitySupport\"] = 2] = \"accessibilitySupport\";\r\n    EditorOption[EditorOption[\"accessibilityPageSize\"] = 3] = \"accessibilityPageSize\";\r\n    EditorOption[EditorOption[\"ariaLabel\"] = 4] = \"ariaLabel\";\r\n    EditorOption[EditorOption[\"autoClosingBrackets\"] = 5] = \"autoClosingBrackets\";\r\n    EditorOption[EditorOption[\"autoClosingOvertype\"] = 6] = \"autoClosingOvertype\";\r\n    EditorOption[EditorOption[\"autoClosingQuotes\"] = 7] = \"autoClosingQuotes\";\r\n    EditorOption[EditorOption[\"autoIndent\"] = 8] = \"autoIndent\";\r\n    EditorOption[EditorOption[\"automaticLayout\"] = 9] = \"automaticLayout\";\r\n    EditorOption[EditorOption[\"autoSurround\"] = 10] = \"autoSurround\";\r\n    EditorOption[EditorOption[\"codeLens\"] = 11] = \"codeLens\";\r\n    EditorOption[EditorOption[\"codeLensFontFamily\"] = 12] = \"codeLensFontFamily\";\r\n    EditorOption[EditorOption[\"codeLensFontSize\"] = 13] = \"codeLensFontSize\";\r\n    EditorOption[EditorOption[\"colorDecorators\"] = 14] = \"colorDecorators\";\r\n    EditorOption[EditorOption[\"columnSelection\"] = 15] = \"columnSelection\";\r\n    EditorOption[EditorOption[\"comments\"] = 16] = \"comments\";\r\n    EditorOption[EditorOption[\"contextmenu\"] = 17] = \"contextmenu\";\r\n    EditorOption[EditorOption[\"copyWithSyntaxHighlighting\"] = 18] = \"copyWithSyntaxHighlighting\";\r\n    EditorOption[EditorOption[\"cursorBlinking\"] = 19] = \"cursorBlinking\";\r\n    EditorOption[EditorOption[\"cursorSmoothCaretAnimation\"] = 20] = \"cursorSmoothCaretAnimation\";\r\n    EditorOption[EditorOption[\"cursorStyle\"] = 21] = \"cursorStyle\";\r\n    EditorOption[EditorOption[\"cursorSurroundingLines\"] = 22] = \"cursorSurroundingLines\";\r\n    EditorOption[EditorOption[\"cursorSurroundingLinesStyle\"] = 23] = \"cursorSurroundingLinesStyle\";\r\n    EditorOption[EditorOption[\"cursorWidth\"] = 24] = \"cursorWidth\";\r\n    EditorOption[EditorOption[\"disableLayerHinting\"] = 25] = \"disableLayerHinting\";\r\n    EditorOption[EditorOption[\"disableMonospaceOptimizations\"] = 26] = \"disableMonospaceOptimizations\";\r\n    EditorOption[EditorOption[\"dragAndDrop\"] = 27] = \"dragAndDrop\";\r\n    EditorOption[EditorOption[\"emptySelectionClipboard\"] = 28] = \"emptySelectionClipboard\";\r\n    EditorOption[EditorOption[\"extraEditorClassName\"] = 29] = \"extraEditorClassName\";\r\n    EditorOption[EditorOption[\"fastScrollSensitivity\"] = 30] = \"fastScrollSensitivity\";\r\n    EditorOption[EditorOption[\"find\"] = 31] = \"find\";\r\n    EditorOption[EditorOption[\"fixedOverflowWidgets\"] = 32] = \"fixedOverflowWidgets\";\r\n    EditorOption[EditorOption[\"folding\"] = 33] = \"folding\";\r\n    EditorOption[EditorOption[\"foldingStrategy\"] = 34] = \"foldingStrategy\";\r\n    EditorOption[EditorOption[\"foldingHighlight\"] = 35] = \"foldingHighlight\";\r\n    EditorOption[EditorOption[\"unfoldOnClickAfterEndOfLine\"] = 36] = \"unfoldOnClickAfterEndOfLine\";\r\n    EditorOption[EditorOption[\"fontFamily\"] = 37] = \"fontFamily\";\r\n    EditorOption[EditorOption[\"fontInfo\"] = 38] = \"fontInfo\";\r\n    EditorOption[EditorOption[\"fontLigatures\"] = 39] = \"fontLigatures\";\r\n    EditorOption[EditorOption[\"fontSize\"] = 40] = \"fontSize\";\r\n    EditorOption[EditorOption[\"fontWeight\"] = 41] = \"fontWeight\";\r\n    EditorOption[EditorOption[\"formatOnPaste\"] = 42] = \"formatOnPaste\";\r\n    EditorOption[EditorOption[\"formatOnType\"] = 43] = \"formatOnType\";\r\n    EditorOption[EditorOption[\"glyphMargin\"] = 44] = \"glyphMargin\";\r\n    EditorOption[EditorOption[\"gotoLocation\"] = 45] = \"gotoLocation\";\r\n    EditorOption[EditorOption[\"hideCursorInOverviewRuler\"] = 46] = \"hideCursorInOverviewRuler\";\r\n    EditorOption[EditorOption[\"highlightActiveIndentGuide\"] = 47] = \"highlightActiveIndentGuide\";\r\n    EditorOption[EditorOption[\"hover\"] = 48] = \"hover\";\r\n    EditorOption[EditorOption[\"inDiffEditor\"] = 49] = \"inDiffEditor\";\r\n    EditorOption[EditorOption[\"letterSpacing\"] = 50] = \"letterSpacing\";\r\n    EditorOption[EditorOption[\"lightbulb\"] = 51] = \"lightbulb\";\r\n    EditorOption[EditorOption[\"lineDecorationsWidth\"] = 52] = \"lineDecorationsWidth\";\r\n    EditorOption[EditorOption[\"lineHeight\"] = 53] = \"lineHeight\";\r\n    EditorOption[EditorOption[\"lineNumbers\"] = 54] = \"lineNumbers\";\r\n    EditorOption[EditorOption[\"lineNumbersMinChars\"] = 55] = \"lineNumbersMinChars\";\r\n    EditorOption[EditorOption[\"linkedEditing\"] = 56] = \"linkedEditing\";\r\n    EditorOption[EditorOption[\"links\"] = 57] = \"links\";\r\n    EditorOption[EditorOption[\"matchBrackets\"] = 58] = \"matchBrackets\";\r\n    EditorOption[EditorOption[\"minimap\"] = 59] = \"minimap\";\r\n    EditorOption[EditorOption[\"mouseStyle\"] = 60] = \"mouseStyle\";\r\n    EditorOption[EditorOption[\"mouseWheelScrollSensitivity\"] = 61] = \"mouseWheelScrollSensitivity\";\r\n    EditorOption[EditorOption[\"mouseWheelZoom\"] = 62] = \"mouseWheelZoom\";\r\n    EditorOption[EditorOption[\"multiCursorMergeOverlapping\"] = 63] = \"multiCursorMergeOverlapping\";\r\n    EditorOption[EditorOption[\"multiCursorModifier\"] = 64] = \"multiCursorModifier\";\r\n    EditorOption[EditorOption[\"multiCursorPaste\"] = 65] = \"multiCursorPaste\";\r\n    EditorOption[EditorOption[\"occurrencesHighlight\"] = 66] = \"occurrencesHighlight\";\r\n    EditorOption[EditorOption[\"overviewRulerBorder\"] = 67] = \"overviewRulerBorder\";\r\n    EditorOption[EditorOption[\"overviewRulerLanes\"] = 68] = \"overviewRulerLanes\";\r\n    EditorOption[EditorOption[\"padding\"] = 69] = \"padding\";\r\n    EditorOption[EditorOption[\"parameterHints\"] = 70] = \"parameterHints\";\r\n    EditorOption[EditorOption[\"peekWidgetDefaultFocus\"] = 71] = \"peekWidgetDefaultFocus\";\r\n    EditorOption[EditorOption[\"definitionLinkOpensInPeek\"] = 72] = \"definitionLinkOpensInPeek\";\r\n    EditorOption[EditorOption[\"quickSuggestions\"] = 73] = \"quickSuggestions\";\r\n    EditorOption[EditorOption[\"quickSuggestionsDelay\"] = 74] = \"quickSuggestionsDelay\";\r\n    EditorOption[EditorOption[\"readOnly\"] = 75] = \"readOnly\";\r\n    EditorOption[EditorOption[\"renameOnType\"] = 76] = \"renameOnType\";\r\n    EditorOption[EditorOption[\"renderControlCharacters\"] = 77] = \"renderControlCharacters\";\r\n    EditorOption[EditorOption[\"renderIndentGuides\"] = 78] = \"renderIndentGuides\";\r\n    EditorOption[EditorOption[\"renderFinalNewline\"] = 79] = \"renderFinalNewline\";\r\n    EditorOption[EditorOption[\"renderLineHighlight\"] = 80] = \"renderLineHighlight\";\r\n    EditorOption[EditorOption[\"renderLineHighlightOnlyWhenFocus\"] = 81] = \"renderLineHighlightOnlyWhenFocus\";\r\n    EditorOption[EditorOption[\"renderValidationDecorations\"] = 82] = \"renderValidationDecorations\";\r\n    EditorOption[EditorOption[\"renderWhitespace\"] = 83] = \"renderWhitespace\";\r\n    EditorOption[EditorOption[\"revealHorizontalRightPadding\"] = 84] = \"revealHorizontalRightPadding\";\r\n    EditorOption[EditorOption[\"roundedSelection\"] = 85] = \"roundedSelection\";\r\n    EditorOption[EditorOption[\"rulers\"] = 86] = \"rulers\";\r\n    EditorOption[EditorOption[\"scrollbar\"] = 87] = \"scrollbar\";\r\n    EditorOption[EditorOption[\"scrollBeyondLastColumn\"] = 88] = \"scrollBeyondLastColumn\";\r\n    EditorOption[EditorOption[\"scrollBeyondLastLine\"] = 89] = \"scrollBeyondLastLine\";\r\n    EditorOption[EditorOption[\"scrollPredominantAxis\"] = 90] = \"scrollPredominantAxis\";\r\n    EditorOption[EditorOption[\"selectionClipboard\"] = 91] = \"selectionClipboard\";\r\n    EditorOption[EditorOption[\"selectionHighlight\"] = 92] = \"selectionHighlight\";\r\n    EditorOption[EditorOption[\"selectOnLineNumbers\"] = 93] = \"selectOnLineNumbers\";\r\n    EditorOption[EditorOption[\"showFoldingControls\"] = 94] = \"showFoldingControls\";\r\n    EditorOption[EditorOption[\"showUnused\"] = 95] = \"showUnused\";\r\n    EditorOption[EditorOption[\"snippetSuggestions\"] = 96] = \"snippetSuggestions\";\r\n    EditorOption[EditorOption[\"smartSelect\"] = 97] = \"smartSelect\";\r\n    EditorOption[EditorOption[\"smoothScrolling\"] = 98] = \"smoothScrolling\";\r\n    EditorOption[EditorOption[\"stickyTabStops\"] = 99] = \"stickyTabStops\";\r\n    EditorOption[EditorOption[\"stopRenderingLineAfter\"] = 100] = \"stopRenderingLineAfter\";\r\n    EditorOption[EditorOption[\"suggest\"] = 101] = \"suggest\";\r\n    EditorOption[EditorOption[\"suggestFontSize\"] = 102] = \"suggestFontSize\";\r\n    EditorOption[EditorOption[\"suggestLineHeight\"] = 103] = \"suggestLineHeight\";\r\n    EditorOption[EditorOption[\"suggestOnTriggerCharacters\"] = 104] = \"suggestOnTriggerCharacters\";\r\n    EditorOption[EditorOption[\"suggestSelection\"] = 105] = \"suggestSelection\";\r\n    EditorOption[EditorOption[\"tabCompletion\"] = 106] = \"tabCompletion\";\r\n    EditorOption[EditorOption[\"tabIndex\"] = 107] = \"tabIndex\";\r\n    EditorOption[EditorOption[\"unusualLineTerminators\"] = 108] = \"unusualLineTerminators\";\r\n    EditorOption[EditorOption[\"useTabStops\"] = 109] = \"useTabStops\";\r\n    EditorOption[EditorOption[\"wordSeparators\"] = 110] = \"wordSeparators\";\r\n    EditorOption[EditorOption[\"wordWrap\"] = 111] = \"wordWrap\";\r\n    EditorOption[EditorOption[\"wordWrapBreakAfterCharacters\"] = 112] = \"wordWrapBreakAfterCharacters\";\r\n    EditorOption[EditorOption[\"wordWrapBreakBeforeCharacters\"] = 113] = \"wordWrapBreakBeforeCharacters\";\r\n    EditorOption[EditorOption[\"wordWrapColumn\"] = 114] = \"wordWrapColumn\";\r\n    EditorOption[EditorOption[\"wordWrapOverride1\"] = 115] = \"wordWrapOverride1\";\r\n    EditorOption[EditorOption[\"wordWrapOverride2\"] = 116] = \"wordWrapOverride2\";\r\n    EditorOption[EditorOption[\"wrappingIndent\"] = 117] = \"wrappingIndent\";\r\n    EditorOption[EditorOption[\"wrappingStrategy\"] = 118] = \"wrappingStrategy\";\r\n    EditorOption[EditorOption[\"showDeprecated\"] = 119] = \"showDeprecated\";\r\n    EditorOption[EditorOption[\"inlineHints\"] = 120] = \"inlineHints\";\r\n    EditorOption[EditorOption[\"editorClassName\"] = 121] = \"editorClassName\";\r\n    EditorOption[EditorOption[\"pixelRatio\"] = 122] = \"pixelRatio\";\r\n    EditorOption[EditorOption[\"tabFocusMode\"] = 123] = \"tabFocusMode\";\r\n    EditorOption[EditorOption[\"layoutInfo\"] = 124] = \"layoutInfo\";\r\n    EditorOption[EditorOption[\"wrappingInfo\"] = 125] = \"wrappingInfo\";\r\n})(EditorOption || (EditorOption = {}));\r\n/**\r\n * End of line character preference.\r\n */\r\nvar EndOfLinePreference;\r\n(function (EndOfLinePreference) {\r\n    /**\r\n     * Use the end of line character identified in the text buffer.\r\n     */\r\n    EndOfLinePreference[EndOfLinePreference[\"TextDefined\"] = 0] = \"TextDefined\";\r\n    /**\r\n     * Use line feed (\\n) as the end of line character.\r\n     */\r\n    EndOfLinePreference[EndOfLinePreference[\"LF\"] = 1] = \"LF\";\r\n    /**\r\n     * Use carriage return and line feed (\\r\\n) as the end of line character.\r\n     */\r\n    EndOfLinePreference[EndOfLinePreference[\"CRLF\"] = 2] = \"CRLF\";\r\n})(EndOfLinePreference || (EndOfLinePreference = {}));\r\n/**\r\n * End of line character preference.\r\n */\r\nvar EndOfLineSequence;\r\n(function (EndOfLineSequence) {\r\n    /**\r\n     * Use line feed (\\n) as the end of line character.\r\n     */\r\n    EndOfLineSequence[EndOfLineSequence[\"LF\"] = 0] = \"LF\";\r\n    /**\r\n     * Use carriage return and line feed (\\r\\n) as the end of line character.\r\n     */\r\n    EndOfLineSequence[EndOfLineSequence[\"CRLF\"] = 1] = \"CRLF\";\r\n})(EndOfLineSequence || (EndOfLineSequence = {}));\r\n/**\r\n * Describes what to do with the indentation when pressing Enter.\r\n */\r\nvar IndentAction;\r\n(function (IndentAction) {\r\n    /**\r\n     * Insert new line and copy the previous line's indentation.\r\n     */\r\n    IndentAction[IndentAction[\"None\"] = 0] = \"None\";\r\n    /**\r\n     * Insert new line and indent once (relative to the previous line's indentation).\r\n     */\r\n    IndentAction[IndentAction[\"Indent\"] = 1] = \"Indent\";\r\n    /**\r\n     * Insert two new lines:\r\n     *  - the first one indented which will hold the cursor\r\n     *  - the second one at the same indentation level\r\n     */\r\n    IndentAction[IndentAction[\"IndentOutdent\"] = 2] = \"IndentOutdent\";\r\n    /**\r\n     * Insert new line and outdent once (relative to the previous line's indentation).\r\n     */\r\n    IndentAction[IndentAction[\"Outdent\"] = 3] = \"Outdent\";\r\n})(IndentAction || (IndentAction = {}));\r\nvar InlineHintKind;\r\n(function (InlineHintKind) {\r\n    InlineHintKind[InlineHintKind[\"Other\"] = 0] = \"Other\";\r\n    InlineHintKind[InlineHintKind[\"Type\"] = 1] = \"Type\";\r\n    InlineHintKind[InlineHintKind[\"Parameter\"] = 2] = \"Parameter\";\r\n})(InlineHintKind || (InlineHintKind = {}));\r\n/**\r\n * Virtual Key Codes, the value does not hold any inherent meaning.\r\n * Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx\r\n * But these are \"more general\", as they should work across browsers & OS`s.\r\n */\r\nvar KeyCode;\r\n(function (KeyCode) {\r\n    /**\r\n     * Placed first to cover the 0 value of the enum.\r\n     */\r\n    KeyCode[KeyCode[\"Unknown\"] = 0] = \"Unknown\";\r\n    KeyCode[KeyCode[\"Backspace\"] = 1] = \"Backspace\";\r\n    KeyCode[KeyCode[\"Tab\"] = 2] = \"Tab\";\r\n    KeyCode[KeyCode[\"Enter\"] = 3] = \"Enter\";\r\n    KeyCode[KeyCode[\"Shift\"] = 4] = \"Shift\";\r\n    KeyCode[KeyCode[\"Ctrl\"] = 5] = \"Ctrl\";\r\n    KeyCode[KeyCode[\"Alt\"] = 6] = \"Alt\";\r\n    KeyCode[KeyCode[\"PauseBreak\"] = 7] = \"PauseBreak\";\r\n    KeyCode[KeyCode[\"CapsLock\"] = 8] = \"CapsLock\";\r\n    KeyCode[KeyCode[\"Escape\"] = 9] = \"Escape\";\r\n    KeyCode[KeyCode[\"Space\"] = 10] = \"Space\";\r\n    KeyCode[KeyCode[\"PageUp\"] = 11] = \"PageUp\";\r\n    KeyCode[KeyCode[\"PageDown\"] = 12] = \"PageDown\";\r\n    KeyCode[KeyCode[\"End\"] = 13] = \"End\";\r\n    KeyCode[KeyCode[\"Home\"] = 14] = \"Home\";\r\n    KeyCode[KeyCode[\"LeftArrow\"] = 15] = \"LeftArrow\";\r\n    KeyCode[KeyCode[\"UpArrow\"] = 16] = \"UpArrow\";\r\n    KeyCode[KeyCode[\"RightArrow\"] = 17] = \"RightArrow\";\r\n    KeyCode[KeyCode[\"DownArrow\"] = 18] = \"DownArrow\";\r\n    KeyCode[KeyCode[\"Insert\"] = 19] = \"Insert\";\r\n    KeyCode[KeyCode[\"Delete\"] = 20] = \"Delete\";\r\n    KeyCode[KeyCode[\"KEY_0\"] = 21] = \"KEY_0\";\r\n    KeyCode[KeyCode[\"KEY_1\"] = 22] = \"KEY_1\";\r\n    KeyCode[KeyCode[\"KEY_2\"] = 23] = \"KEY_2\";\r\n    KeyCode[KeyCode[\"KEY_3\"] = 24] = \"KEY_3\";\r\n    KeyCode[KeyCode[\"KEY_4\"] = 25] = \"KEY_4\";\r\n    KeyCode[KeyCode[\"KEY_5\"] = 26] = \"KEY_5\";\r\n    KeyCode[KeyCode[\"KEY_6\"] = 27] = \"KEY_6\";\r\n    KeyCode[KeyCode[\"KEY_7\"] = 28] = \"KEY_7\";\r\n    KeyCode[KeyCode[\"KEY_8\"] = 29] = \"KEY_8\";\r\n    KeyCode[KeyCode[\"KEY_9\"] = 30] = \"KEY_9\";\r\n    KeyCode[KeyCode[\"KEY_A\"] = 31] = \"KEY_A\";\r\n    KeyCode[KeyCode[\"KEY_B\"] = 32] = \"KEY_B\";\r\n    KeyCode[KeyCode[\"KEY_C\"] = 33] = \"KEY_C\";\r\n    KeyCode[KeyCode[\"KEY_D\"] = 34] = \"KEY_D\";\r\n    KeyCode[KeyCode[\"KEY_E\"] = 35] = \"KEY_E\";\r\n    KeyCode[KeyCode[\"KEY_F\"] = 36] = \"KEY_F\";\r\n    KeyCode[KeyCode[\"KEY_G\"] = 37] = \"KEY_G\";\r\n    KeyCode[KeyCode[\"KEY_H\"] = 38] = \"KEY_H\";\r\n    KeyCode[KeyCode[\"KEY_I\"] = 39] = \"KEY_I\";\r\n    KeyCode[KeyCode[\"KEY_J\"] = 40] = \"KEY_J\";\r\n    KeyCode[KeyCode[\"KEY_K\"] = 41] = \"KEY_K\";\r\n    KeyCode[KeyCode[\"KEY_L\"] = 42] = \"KEY_L\";\r\n    KeyCode[KeyCode[\"KEY_M\"] = 43] = \"KEY_M\";\r\n    KeyCode[KeyCode[\"KEY_N\"] = 44] = \"KEY_N\";\r\n    KeyCode[KeyCode[\"KEY_O\"] = 45] = \"KEY_O\";\r\n    KeyCode[KeyCode[\"KEY_P\"] = 46] = \"KEY_P\";\r\n    KeyCode[KeyCode[\"KEY_Q\"] = 47] = \"KEY_Q\";\r\n    KeyCode[KeyCode[\"KEY_R\"] = 48] = \"KEY_R\";\r\n    KeyCode[KeyCode[\"KEY_S\"] = 49] = \"KEY_S\";\r\n    KeyCode[KeyCode[\"KEY_T\"] = 50] = \"KEY_T\";\r\n    KeyCode[KeyCode[\"KEY_U\"] = 51] = \"KEY_U\";\r\n    KeyCode[KeyCode[\"KEY_V\"] = 52] = \"KEY_V\";\r\n    KeyCode[KeyCode[\"KEY_W\"] = 53] = \"KEY_W\";\r\n    KeyCode[KeyCode[\"KEY_X\"] = 54] = \"KEY_X\";\r\n    KeyCode[KeyCode[\"KEY_Y\"] = 55] = \"KEY_Y\";\r\n    KeyCode[KeyCode[\"KEY_Z\"] = 56] = \"KEY_Z\";\r\n    KeyCode[KeyCode[\"Meta\"] = 57] = \"Meta\";\r\n    KeyCode[KeyCode[\"ContextMenu\"] = 58] = \"ContextMenu\";\r\n    KeyCode[KeyCode[\"F1\"] = 59] = \"F1\";\r\n    KeyCode[KeyCode[\"F2\"] = 60] = \"F2\";\r\n    KeyCode[KeyCode[\"F3\"] = 61] = \"F3\";\r\n    KeyCode[KeyCode[\"F4\"] = 62] = \"F4\";\r\n    KeyCode[KeyCode[\"F5\"] = 63] = \"F5\";\r\n    KeyCode[KeyCode[\"F6\"] = 64] = \"F6\";\r\n    KeyCode[KeyCode[\"F7\"] = 65] = \"F7\";\r\n    KeyCode[KeyCode[\"F8\"] = 66] = \"F8\";\r\n    KeyCode[KeyCode[\"F9\"] = 67] = \"F9\";\r\n    KeyCode[KeyCode[\"F10\"] = 68] = \"F10\";\r\n    KeyCode[KeyCode[\"F11\"] = 69] = \"F11\";\r\n    KeyCode[KeyCode[\"F12\"] = 70] = \"F12\";\r\n    KeyCode[KeyCode[\"F13\"] = 71] = \"F13\";\r\n    KeyCode[KeyCode[\"F14\"] = 72] = \"F14\";\r\n    KeyCode[KeyCode[\"F15\"] = 73] = \"F15\";\r\n    KeyCode[KeyCode[\"F16\"] = 74] = \"F16\";\r\n    KeyCode[KeyCode[\"F17\"] = 75] = \"F17\";\r\n    KeyCode[KeyCode[\"F18\"] = 76] = \"F18\";\r\n    KeyCode[KeyCode[\"F19\"] = 77] = \"F19\";\r\n    KeyCode[KeyCode[\"NumLock\"] = 78] = \"NumLock\";\r\n    KeyCode[KeyCode[\"ScrollLock\"] = 79] = \"ScrollLock\";\r\n    /**\r\n     * Used for miscellaneous characters; it can vary by keyboard.\r\n     * For the US standard keyboard, the ';:' key\r\n     */\r\n    KeyCode[KeyCode[\"US_SEMICOLON\"] = 80] = \"US_SEMICOLON\";\r\n    /**\r\n     * For any country/region, the '+' key\r\n     * For the US standard keyboard, the '=+' key\r\n     */\r\n    KeyCode[KeyCode[\"US_EQUAL\"] = 81] = \"US_EQUAL\";\r\n    /**\r\n     * For any country/region, the ',' key\r\n     * For the US standard keyboard, the ',<' key\r\n     */\r\n    KeyCode[KeyCode[\"US_COMMA\"] = 82] = \"US_COMMA\";\r\n    /**\r\n     * For any country/region, the '-' key\r\n     * For the US standard keyboard, the '-_' key\r\n     */\r\n    KeyCode[KeyCode[\"US_MINUS\"] = 83] = \"US_MINUS\";\r\n    /**\r\n     * For any country/region, the '.' key\r\n     * For the US standard keyboard, the '.>' key\r\n     */\r\n    KeyCode[KeyCode[\"US_DOT\"] = 84] = \"US_DOT\";\r\n    /**\r\n     * Used for miscellaneous characters; it can vary by keyboard.\r\n     * For the US standard keyboard, the '/?' key\r\n     */\r\n    KeyCode[KeyCode[\"US_SLASH\"] = 85] = \"US_SLASH\";\r\n    /**\r\n     * Used for miscellaneous characters; it can vary by keyboard.\r\n     * For the US standard keyboard, the '`~' key\r\n     */\r\n    KeyCode[KeyCode[\"US_BACKTICK\"] = 86] = \"US_BACKTICK\";\r\n    /**\r\n     * Used for miscellaneous characters; it can vary by keyboard.\r\n     * For the US standard keyboard, the '[{' key\r\n     */\r\n    KeyCode[KeyCode[\"US_OPEN_SQUARE_BRACKET\"] = 87] = \"US_OPEN_SQUARE_BRACKET\";\r\n    /**\r\n     * Used for miscellaneous characters; it can vary by keyboard.\r\n     * For the US standard keyboard, the '\\|' key\r\n     */\r\n    KeyCode[KeyCode[\"US_BACKSLASH\"] = 88] = \"US_BACKSLASH\";\r\n    /**\r\n     * Used for miscellaneous characters; it can vary by keyboard.\r\n     * For the US standard keyboard, the ']}' key\r\n     */\r\n    KeyCode[KeyCode[\"US_CLOSE_SQUARE_BRACKET\"] = 89] = \"US_CLOSE_SQUARE_BRACKET\";\r\n    /**\r\n     * Used for miscellaneous characters; it can vary by keyboard.\r\n     * For the US standard keyboard, the ''\"' key\r\n     */\r\n    KeyCode[KeyCode[\"US_QUOTE\"] = 90] = \"US_QUOTE\";\r\n    /**\r\n     * Used for miscellaneous characters; it can vary by keyboard.\r\n     */\r\n    KeyCode[KeyCode[\"OEM_8\"] = 91] = \"OEM_8\";\r\n    /**\r\n     * Either the angle bracket key or the backslash key on the RT 102-key keyboard.\r\n     */\r\n    KeyCode[KeyCode[\"OEM_102\"] = 92] = \"OEM_102\";\r\n    KeyCode[KeyCode[\"NUMPAD_0\"] = 93] = \"NUMPAD_0\";\r\n    KeyCode[KeyCode[\"NUMPAD_1\"] = 94] = \"NUMPAD_1\";\r\n    KeyCode[KeyCode[\"NUMPAD_2\"] = 95] = \"NUMPAD_2\";\r\n    KeyCode[KeyCode[\"NUMPAD_3\"] = 96] = \"NUMPAD_3\";\r\n    KeyCode[KeyCode[\"NUMPAD_4\"] = 97] = \"NUMPAD_4\";\r\n    KeyCode[KeyCode[\"NUMPAD_5\"] = 98] = \"NUMPAD_5\";\r\n    KeyCode[KeyCode[\"NUMPAD_6\"] = 99] = \"NUMPAD_6\";\r\n    KeyCode[KeyCode[\"NUMPAD_7\"] = 100] = \"NUMPAD_7\";\r\n    KeyCode[KeyCode[\"NUMPAD_8\"] = 101] = \"NUMPAD_8\";\r\n    KeyCode[KeyCode[\"NUMPAD_9\"] = 102] = \"NUMPAD_9\";\r\n    KeyCode[KeyCode[\"NUMPAD_MULTIPLY\"] = 103] = \"NUMPAD_MULTIPLY\";\r\n    KeyCode[KeyCode[\"NUMPAD_ADD\"] = 104] = \"NUMPAD_ADD\";\r\n    KeyCode[KeyCode[\"NUMPAD_SEPARATOR\"] = 105] = \"NUMPAD_SEPARATOR\";\r\n    KeyCode[KeyCode[\"NUMPAD_SUBTRACT\"] = 106] = \"NUMPAD_SUBTRACT\";\r\n    KeyCode[KeyCode[\"NUMPAD_DECIMAL\"] = 107] = \"NUMPAD_DECIMAL\";\r\n    KeyCode[KeyCode[\"NUMPAD_DIVIDE\"] = 108] = \"NUMPAD_DIVIDE\";\r\n    /**\r\n     * Cover all key codes when IME is processing input.\r\n     */\r\n    KeyCode[KeyCode[\"KEY_IN_COMPOSITION\"] = 109] = \"KEY_IN_COMPOSITION\";\r\n    KeyCode[KeyCode[\"ABNT_C1\"] = 110] = \"ABNT_C1\";\r\n    KeyCode[KeyCode[\"ABNT_C2\"] = 111] = \"ABNT_C2\";\r\n    /**\r\n     * Placed last to cover the length of the enum.\r\n     * Please do not depend on this value!\r\n     */\r\n    KeyCode[KeyCode[\"MAX_VALUE\"] = 112] = \"MAX_VALUE\";\r\n})(KeyCode || (KeyCode = {}));\r\nvar MarkerSeverity;\r\n(function (MarkerSeverity) {\r\n    MarkerSeverity[MarkerSeverity[\"Hint\"] = 1] = \"Hint\";\r\n    MarkerSeverity[MarkerSeverity[\"Info\"] = 2] = \"Info\";\r\n    MarkerSeverity[MarkerSeverity[\"Warning\"] = 4] = \"Warning\";\r\n    MarkerSeverity[MarkerSeverity[\"Error\"] = 8] = \"Error\";\r\n})(MarkerSeverity || (MarkerSeverity = {}));\r\nvar MarkerTag;\r\n(function (MarkerTag) {\r\n    MarkerTag[MarkerTag[\"Unnecessary\"] = 1] = \"Unnecessary\";\r\n    MarkerTag[MarkerTag[\"Deprecated\"] = 2] = \"Deprecated\";\r\n})(MarkerTag || (MarkerTag = {}));\r\n/**\r\n * Position in the minimap to render the decoration.\r\n */\r\nvar MinimapPosition;\r\n(function (MinimapPosition) {\r\n    MinimapPosition[MinimapPosition[\"Inline\"] = 1] = \"Inline\";\r\n    MinimapPosition[MinimapPosition[\"Gutter\"] = 2] = \"Gutter\";\r\n})(MinimapPosition || (MinimapPosition = {}));\r\n/**\r\n * Type of hit element with the mouse in the editor.\r\n */\r\nvar MouseTargetType;\r\n(function (MouseTargetType) {\r\n    /**\r\n     * Mouse is on top of an unknown element.\r\n     */\r\n    MouseTargetType[MouseTargetType[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\r\n    /**\r\n     * Mouse is on top of the textarea used for input.\r\n     */\r\n    MouseTargetType[MouseTargetType[\"TEXTAREA\"] = 1] = \"TEXTAREA\";\r\n    /**\r\n     * Mouse is on top of the glyph margin\r\n     */\r\n    MouseTargetType[MouseTargetType[\"GUTTER_GLYPH_MARGIN\"] = 2] = \"GUTTER_GLYPH_MARGIN\";\r\n    /**\r\n     * Mouse is on top of the line numbers\r\n     */\r\n    MouseTargetType[MouseTargetType[\"GUTTER_LINE_NUMBERS\"] = 3] = \"GUTTER_LINE_NUMBERS\";\r\n    /**\r\n     * Mouse is on top of the line decorations\r\n     */\r\n    MouseTargetType[MouseTargetType[\"GUTTER_LINE_DECORATIONS\"] = 4] = \"GUTTER_LINE_DECORATIONS\";\r\n    /**\r\n     * Mouse is on top of the whitespace left in the gutter by a view zone.\r\n     */\r\n    MouseTargetType[MouseTargetType[\"GUTTER_VIEW_ZONE\"] = 5] = \"GUTTER_VIEW_ZONE\";\r\n    /**\r\n     * Mouse is on top of text in the content.\r\n     */\r\n    MouseTargetType[MouseTargetType[\"CONTENT_TEXT\"] = 6] = \"CONTENT_TEXT\";\r\n    /**\r\n     * Mouse is on top of empty space in the content (e.g. after line text or below last line)\r\n     */\r\n    MouseTargetType[MouseTargetType[\"CONTENT_EMPTY\"] = 7] = \"CONTENT_EMPTY\";\r\n    /**\r\n     * Mouse is on top of a view zone in the content.\r\n     */\r\n    MouseTargetType[MouseTargetType[\"CONTENT_VIEW_ZONE\"] = 8] = \"CONTENT_VIEW_ZONE\";\r\n    /**\r\n     * Mouse is on top of a content widget.\r\n     */\r\n    MouseTargetType[MouseTargetType[\"CONTENT_WIDGET\"] = 9] = \"CONTENT_WIDGET\";\r\n    /**\r\n     * Mouse is on top of the decorations overview ruler.\r\n     */\r\n    MouseTargetType[MouseTargetType[\"OVERVIEW_RULER\"] = 10] = \"OVERVIEW_RULER\";\r\n    /**\r\n     * Mouse is on top of a scrollbar.\r\n     */\r\n    MouseTargetType[MouseTargetType[\"SCROLLBAR\"] = 11] = \"SCROLLBAR\";\r\n    /**\r\n     * Mouse is on top of an overlay widget.\r\n     */\r\n    MouseTargetType[MouseTargetType[\"OVERLAY_WIDGET\"] = 12] = \"OVERLAY_WIDGET\";\r\n    /**\r\n     * Mouse is outside of the editor.\r\n     */\r\n    MouseTargetType[MouseTargetType[\"OUTSIDE_EDITOR\"] = 13] = \"OUTSIDE_EDITOR\";\r\n})(MouseTargetType || (MouseTargetType = {}));\r\n/**\r\n * A positioning preference for rendering overlay widgets.\r\n */\r\nvar OverlayWidgetPositionPreference;\r\n(function (OverlayWidgetPositionPreference) {\r\n    /**\r\n     * Position the overlay widget in the top right corner\r\n     */\r\n    OverlayWidgetPositionPreference[OverlayWidgetPositionPreference[\"TOP_RIGHT_CORNER\"] = 0] = \"TOP_RIGHT_CORNER\";\r\n    /**\r\n     * Position the overlay widget in the bottom right corner\r\n     */\r\n    OverlayWidgetPositionPreference[OverlayWidgetPositionPreference[\"BOTTOM_RIGHT_CORNER\"] = 1] = \"BOTTOM_RIGHT_CORNER\";\r\n    /**\r\n     * Position the overlay widget in the top center\r\n     */\r\n    OverlayWidgetPositionPreference[OverlayWidgetPositionPreference[\"TOP_CENTER\"] = 2] = \"TOP_CENTER\";\r\n})(OverlayWidgetPositionPreference || (OverlayWidgetPositionPreference = {}));\r\n/**\r\n * Vertical Lane in the overview ruler of the editor.\r\n */\r\nvar OverviewRulerLane;\r\n(function (OverviewRulerLane) {\r\n    OverviewRulerLane[OverviewRulerLane[\"Left\"] = 1] = \"Left\";\r\n    OverviewRulerLane[OverviewRulerLane[\"Center\"] = 2] = \"Center\";\r\n    OverviewRulerLane[OverviewRulerLane[\"Right\"] = 4] = \"Right\";\r\n    OverviewRulerLane[OverviewRulerLane[\"Full\"] = 7] = \"Full\";\r\n})(OverviewRulerLane || (OverviewRulerLane = {}));\r\nvar RenderLineNumbersType;\r\n(function (RenderLineNumbersType) {\r\n    RenderLineNumbersType[RenderLineNumbersType[\"Off\"] = 0] = \"Off\";\r\n    RenderLineNumbersType[RenderLineNumbersType[\"On\"] = 1] = \"On\";\r\n    RenderLineNumbersType[RenderLineNumbersType[\"Relative\"] = 2] = \"Relative\";\r\n    RenderLineNumbersType[RenderLineNumbersType[\"Interval\"] = 3] = \"Interval\";\r\n    RenderLineNumbersType[RenderLineNumbersType[\"Custom\"] = 4] = \"Custom\";\r\n})(RenderLineNumbersType || (RenderLineNumbersType = {}));\r\nvar RenderMinimap;\r\n(function (RenderMinimap) {\r\n    RenderMinimap[RenderMinimap[\"None\"] = 0] = \"None\";\r\n    RenderMinimap[RenderMinimap[\"Text\"] = 1] = \"Text\";\r\n    RenderMinimap[RenderMinimap[\"Blocks\"] = 2] = \"Blocks\";\r\n})(RenderMinimap || (RenderMinimap = {}));\r\nvar ScrollType;\r\n(function (ScrollType) {\r\n    ScrollType[ScrollType[\"Smooth\"] = 0] = \"Smooth\";\r\n    ScrollType[ScrollType[\"Immediate\"] = 1] = \"Immediate\";\r\n})(ScrollType || (ScrollType = {}));\r\nvar ScrollbarVisibility;\r\n(function (ScrollbarVisibility) {\r\n    ScrollbarVisibility[ScrollbarVisibility[\"Auto\"] = 1] = \"Auto\";\r\n    ScrollbarVisibility[ScrollbarVisibility[\"Hidden\"] = 2] = \"Hidden\";\r\n    ScrollbarVisibility[ScrollbarVisibility[\"Visible\"] = 3] = \"Visible\";\r\n})(ScrollbarVisibility || (ScrollbarVisibility = {}));\r\n/**\r\n * The direction of a selection.\r\n */\r\nvar SelectionDirection;\r\n(function (SelectionDirection) {\r\n    /**\r\n     * The selection starts above where it ends.\r\n     */\r\n    SelectionDirection[SelectionDirection[\"LTR\"] = 0] = \"LTR\";\r\n    /**\r\n     * The selection starts below where it ends.\r\n     */\r\n    SelectionDirection[SelectionDirection[\"RTL\"] = 1] = \"RTL\";\r\n})(SelectionDirection || (SelectionDirection = {}));\r\nvar SignatureHelpTriggerKind;\r\n(function (SignatureHelpTriggerKind) {\r\n    SignatureHelpTriggerKind[SignatureHelpTriggerKind[\"Invoke\"] = 1] = \"Invoke\";\r\n    SignatureHelpTriggerKind[SignatureHelpTriggerKind[\"TriggerCharacter\"] = 2] = \"TriggerCharacter\";\r\n    SignatureHelpTriggerKind[SignatureHelpTriggerKind[\"ContentChange\"] = 3] = \"ContentChange\";\r\n})(SignatureHelpTriggerKind || (SignatureHelpTriggerKind = {}));\r\n/**\r\n * A symbol kind.\r\n */\r\nvar SymbolKind;\r\n(function (SymbolKind) {\r\n    SymbolKind[SymbolKind[\"File\"] = 0] = \"File\";\r\n    SymbolKind[SymbolKind[\"Module\"] = 1] = \"Module\";\r\n    SymbolKind[SymbolKind[\"Namespace\"] = 2] = \"Namespace\";\r\n    SymbolKind[SymbolKind[\"Package\"] = 3] = \"Package\";\r\n    SymbolKind[SymbolKind[\"Class\"] = 4] = \"Class\";\r\n    SymbolKind[SymbolKind[\"Method\"] = 5] = \"Method\";\r\n    SymbolKind[SymbolKind[\"Property\"] = 6] = \"Property\";\r\n    SymbolKind[SymbolKind[\"Field\"] = 7] = \"Field\";\r\n    SymbolKind[SymbolKind[\"Constructor\"] = 8] = \"Constructor\";\r\n    SymbolKind[SymbolKind[\"Enum\"] = 9] = \"Enum\";\r\n    SymbolKind[SymbolKind[\"Interface\"] = 10] = \"Interface\";\r\n    SymbolKind[SymbolKind[\"Function\"] = 11] = \"Function\";\r\n    SymbolKind[SymbolKind[\"Variable\"] = 12] = \"Variable\";\r\n    SymbolKind[SymbolKind[\"Constant\"] = 13] = \"Constant\";\r\n    SymbolKind[SymbolKind[\"String\"] = 14] = \"String\";\r\n    SymbolKind[SymbolKind[\"Number\"] = 15] = \"Number\";\r\n    SymbolKind[SymbolKind[\"Boolean\"] = 16] = \"Boolean\";\r\n    SymbolKind[SymbolKind[\"Array\"] = 17] = \"Array\";\r\n    SymbolKind[SymbolKind[\"Object\"] = 18] = \"Object\";\r\n    SymbolKind[SymbolKind[\"Key\"] = 19] = \"Key\";\r\n    SymbolKind[SymbolKind[\"Null\"] = 20] = \"Null\";\r\n    SymbolKind[SymbolKind[\"EnumMember\"] = 21] = \"EnumMember\";\r\n    SymbolKind[SymbolKind[\"Struct\"] = 22] = \"Struct\";\r\n    SymbolKind[SymbolKind[\"Event\"] = 23] = \"Event\";\r\n    SymbolKind[SymbolKind[\"Operator\"] = 24] = \"Operator\";\r\n    SymbolKind[SymbolKind[\"TypeParameter\"] = 25] = \"TypeParameter\";\r\n})(SymbolKind || (SymbolKind = {}));\r\nvar SymbolTag;\r\n(function (SymbolTag) {\r\n    SymbolTag[SymbolTag[\"Deprecated\"] = 1] = \"Deprecated\";\r\n})(SymbolTag || (SymbolTag = {}));\r\n/**\r\n * The kind of animation in which the editor's cursor should be rendered.\r\n */\r\nvar TextEditorCursorBlinkingStyle;\r\n(function (TextEditorCursorBlinkingStyle) {\r\n    /**\r\n     * Hidden\r\n     */\r\n    TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Hidden\"] = 0] = \"Hidden\";\r\n    /**\r\n     * Blinking\r\n     */\r\n    TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Blink\"] = 1] = \"Blink\";\r\n    /**\r\n     * Blinking with smooth fading\r\n     */\r\n    TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Smooth\"] = 2] = \"Smooth\";\r\n    /**\r\n     * Blinking with prolonged filled state and smooth fading\r\n     */\r\n    TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Phase\"] = 3] = \"Phase\";\r\n    /**\r\n     * Expand collapse animation on the y axis\r\n     */\r\n    TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Expand\"] = 4] = \"Expand\";\r\n    /**\r\n     * No-Blinking\r\n     */\r\n    TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Solid\"] = 5] = \"Solid\";\r\n})(TextEditorCursorBlinkingStyle || (TextEditorCursorBlinkingStyle = {}));\r\n/**\r\n * The style in which the editor's cursor should be rendered.\r\n */\r\nvar TextEditorCursorStyle;\r\n(function (TextEditorCursorStyle) {\r\n    /**\r\n     * As a vertical line (sitting between two characters).\r\n     */\r\n    TextEditorCursorStyle[TextEditorCursorStyle[\"Line\"] = 1] = \"Line\";\r\n    /**\r\n     * As a block (sitting on top of a character).\r\n     */\r\n    TextEditorCursorStyle[TextEditorCursorStyle[\"Block\"] = 2] = \"Block\";\r\n    /**\r\n     * As a horizontal line (sitting under a character).\r\n     */\r\n    TextEditorCursorStyle[TextEditorCursorStyle[\"Underline\"] = 3] = \"Underline\";\r\n    /**\r\n     * As a thin vertical line (sitting between two characters).\r\n     */\r\n    TextEditorCursorStyle[TextEditorCursorStyle[\"LineThin\"] = 4] = \"LineThin\";\r\n    /**\r\n     * As an outlined block (sitting on top of a character).\r\n     */\r\n    TextEditorCursorStyle[TextEditorCursorStyle[\"BlockOutline\"] = 5] = \"BlockOutline\";\r\n    /**\r\n     * As a thin horizontal line (sitting under a character).\r\n     */\r\n    TextEditorCursorStyle[TextEditorCursorStyle[\"UnderlineThin\"] = 6] = \"UnderlineThin\";\r\n})(TextEditorCursorStyle || (TextEditorCursorStyle = {}));\r\n/**\r\n * Describes the behavior of decorations when typing/editing near their edges.\r\n * Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior`\r\n */\r\nvar TrackedRangeStickiness;\r\n(function (TrackedRangeStickiness) {\r\n    TrackedRangeStickiness[TrackedRangeStickiness[\"AlwaysGrowsWhenTypingAtEdges\"] = 0] = \"AlwaysGrowsWhenTypingAtEdges\";\r\n    TrackedRangeStickiness[TrackedRangeStickiness[\"NeverGrowsWhenTypingAtEdges\"] = 1] = \"NeverGrowsWhenTypingAtEdges\";\r\n    TrackedRangeStickiness[TrackedRangeStickiness[\"GrowsOnlyWhenTypingBefore\"] = 2] = \"GrowsOnlyWhenTypingBefore\";\r\n    TrackedRangeStickiness[TrackedRangeStickiness[\"GrowsOnlyWhenTypingAfter\"] = 3] = \"GrowsOnlyWhenTypingAfter\";\r\n})(TrackedRangeStickiness || (TrackedRangeStickiness = {}));\r\n/**\r\n * Describes how to indent wrapped lines.\r\n */\r\nvar WrappingIndent;\r\n(function (WrappingIndent) {\r\n    /**\r\n     * No indentation => wrapped lines begin at column 1.\r\n     */\r\n    WrappingIndent[WrappingIndent[\"None\"] = 0] = \"None\";\r\n    /**\r\n     * Same => wrapped lines get the same indentation as the parent.\r\n     */\r\n    WrappingIndent[WrappingIndent[\"Same\"] = 1] = \"Same\";\r\n    /**\r\n     * Indent => wrapped lines get +1 indentation toward the parent.\r\n     */\r\n    WrappingIndent[WrappingIndent[\"Indent\"] = 2] = \"Indent\";\r\n    /**\r\n     * DeepIndent => wrapped lines get +2 indentation toward the parent.\r\n     */\r\n    WrappingIndent[WrappingIndent[\"DeepIndent\"] = 3] = \"DeepIndent\";\r\n})(WrappingIndent || (WrappingIndent = {}));\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js":
/*!****************************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js ***!
  \****************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"PrefixSumIndexOfResult\": () => (/* binding */ PrefixSumIndexOfResult),\n/* harmony export */   \"PrefixSumComputer\": () => (/* binding */ PrefixSumComputer)\n/* harmony export */ });\n/* harmony import */ var _base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/uint.js */ \"./node_modules/monaco-editor/esm/vs/base/common/uint.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nclass PrefixSumIndexOfResult {\r\n    constructor(index, remainder) {\r\n        this.index = index;\r\n        this.remainder = remainder;\r\n    }\r\n}\r\nclass PrefixSumComputer {\r\n    constructor(values) {\r\n        this.values = values;\r\n        this.prefixSum = new Uint32Array(values.length);\r\n        this.prefixSumValidIndex = new Int32Array(1);\r\n        this.prefixSumValidIndex[0] = -1;\r\n    }\r\n    insertValues(insertIndex, insertValues) {\r\n        insertIndex = (0,_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__.toUint32)(insertIndex);\r\n        const oldValues = this.values;\r\n        const oldPrefixSum = this.prefixSum;\r\n        const insertValuesLen = insertValues.length;\r\n        if (insertValuesLen === 0) {\r\n            return false;\r\n        }\r\n        this.values = new Uint32Array(oldValues.length + insertValuesLen);\r\n        this.values.set(oldValues.subarray(0, insertIndex), 0);\r\n        this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen);\r\n        this.values.set(insertValues, insertIndex);\r\n        if (insertIndex - 1 < this.prefixSumValidIndex[0]) {\r\n            this.prefixSumValidIndex[0] = insertIndex - 1;\r\n        }\r\n        this.prefixSum = new Uint32Array(this.values.length);\r\n        if (this.prefixSumValidIndex[0] >= 0) {\r\n            this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));\r\n        }\r\n        return true;\r\n    }\r\n    changeValue(index, value) {\r\n        index = (0,_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__.toUint32)(index);\r\n        value = (0,_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__.toUint32)(value);\r\n        if (this.values[index] === value) {\r\n            return false;\r\n        }\r\n        this.values[index] = value;\r\n        if (index - 1 < this.prefixSumValidIndex[0]) {\r\n            this.prefixSumValidIndex[0] = index - 1;\r\n        }\r\n        return true;\r\n    }\r\n    removeValues(startIndex, cnt) {\r\n        startIndex = (0,_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__.toUint32)(startIndex);\r\n        cnt = (0,_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__.toUint32)(cnt);\r\n        const oldValues = this.values;\r\n        const oldPrefixSum = this.prefixSum;\r\n        if (startIndex >= oldValues.length) {\r\n            return false;\r\n        }\r\n        let maxCnt = oldValues.length - startIndex;\r\n        if (cnt >= maxCnt) {\r\n            cnt = maxCnt;\r\n        }\r\n        if (cnt === 0) {\r\n            return false;\r\n        }\r\n        this.values = new Uint32Array(oldValues.length - cnt);\r\n        this.values.set(oldValues.subarray(0, startIndex), 0);\r\n        this.values.set(oldValues.subarray(startIndex + cnt), startIndex);\r\n        this.prefixSum = new Uint32Array(this.values.length);\r\n        if (startIndex - 1 < this.prefixSumValidIndex[0]) {\r\n            this.prefixSumValidIndex[0] = startIndex - 1;\r\n        }\r\n        if (this.prefixSumValidIndex[0] >= 0) {\r\n            this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));\r\n        }\r\n        return true;\r\n    }\r\n    getTotalValue() {\r\n        if (this.values.length === 0) {\r\n            return 0;\r\n        }\r\n        return this._getAccumulatedValue(this.values.length - 1);\r\n    }\r\n    getAccumulatedValue(index) {\r\n        if (index < 0) {\r\n            return 0;\r\n        }\r\n        index = (0,_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__.toUint32)(index);\r\n        return this._getAccumulatedValue(index);\r\n    }\r\n    _getAccumulatedValue(index) {\r\n        if (index <= this.prefixSumValidIndex[0]) {\r\n            return this.prefixSum[index];\r\n        }\r\n        let startIndex = this.prefixSumValidIndex[0] + 1;\r\n        if (startIndex === 0) {\r\n            this.prefixSum[0] = this.values[0];\r\n            startIndex++;\r\n        }\r\n        if (index >= this.values.length) {\r\n            index = this.values.length - 1;\r\n        }\r\n        for (let i = startIndex; i <= index; i++) {\r\n            this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i];\r\n        }\r\n        this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index);\r\n        return this.prefixSum[index];\r\n    }\r\n    getIndexOf(accumulatedValue) {\r\n        accumulatedValue = Math.floor(accumulatedValue); //@perf\r\n        // Compute all sums (to get a fully valid prefixSum)\r\n        this.getTotalValue();\r\n        let low = 0;\r\n        let high = this.values.length - 1;\r\n        let mid = 0;\r\n        let midStop = 0;\r\n        let midStart = 0;\r\n        while (low <= high) {\r\n            mid = low + ((high - low) / 2) | 0;\r\n            midStop = this.prefixSum[mid];\r\n            midStart = midStop - this.values[mid];\r\n            if (accumulatedValue < midStart) {\r\n                high = mid - 1;\r\n            }\r\n            else if (accumulatedValue >= midStop) {\r\n                low = mid + 1;\r\n            }\r\n            else {\r\n                break;\r\n            }\r\n        }\r\n        return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart);\r\n    }\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/editor/editor.worker.js":
/*!*******************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/editor/editor.worker.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"initialize\": () => (/* binding */ initialize)\n/* harmony export */ });\n/* harmony import */ var _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/common/worker/simpleWorker.js */ \"./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js\");\n/* harmony import */ var _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/services/editorSimpleWorker.js */ \"./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n\r\nlet initialized = false;\r\nfunction initialize(foreignModule) {\r\n    if (initialized) {\r\n        return;\r\n    }\r\n    initialized = true;\r\n    const simpleWorker = new _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__.SimpleWorkerServer((msg) => {\r\n        self.postMessage(msg);\r\n    }, (host) => new _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__.EditorSimpleWorker(host, foreignModule));\r\n    self.onmessage = (e) => {\r\n        simpleWorker.onmessage(e.data);\r\n    };\r\n}\r\nself.onmessage = (e) => {\r\n    // Ignore first message in this case and initialize if not yet initialized\r\n    if (!initialized) {\r\n        initialize(null);\r\n    }\r\n};\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/editor/editor.worker.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/language/typescript/lib/lib.js":
/*!**************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/language/typescript/lib/lib.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"libFileMap\": () => (/* binding */ libFileMap)\n/* harmony export */ });\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n//\r\n// **NOTE**: Do not edit directly! This file is generated using `npm run import-typescript`\r\n//\r\n/** Contains all the lib files */\r\nvar libFileMap = {};\r\nlibFileMap['lib.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es5\\\" />\\n/// <reference lib=\\\"dom\\\" />\\n/// <reference lib=\\\"webworker.importscripts\\\" />\\n/// <reference lib=\\\"scripthost\\\" />\\n\";\r\nlibFileMap['lib.dom.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/////////////////////////////\\n/// DOM APIs\\n/////////////////////////////\\n\\ninterface Account {\\n    displayName: string;\\n    id: string;\\n    imageURL?: string;\\n    name?: string;\\n    rpDisplayName: string;\\n}\\n\\ninterface AddEventListenerOptions extends EventListenerOptions {\\n    once?: boolean;\\n    passive?: boolean;\\n}\\n\\ninterface AesCbcParams extends Algorithm {\\n    iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n}\\n\\ninterface AesCtrParams extends Algorithm {\\n    counter: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n    length: number;\\n}\\n\\ninterface AesDerivedKeyParams extends Algorithm {\\n    length: number;\\n}\\n\\ninterface AesGcmParams extends Algorithm {\\n    additionalData?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n    iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n    tagLength?: number;\\n}\\n\\ninterface AesKeyAlgorithm extends KeyAlgorithm {\\n    length: number;\\n}\\n\\ninterface AesKeyGenParams extends Algorithm {\\n    length: number;\\n}\\n\\ninterface Algorithm {\\n    name: string;\\n}\\n\\ninterface AnalyserOptions extends AudioNodeOptions {\\n    fftSize?: number;\\n    maxDecibels?: number;\\n    minDecibels?: number;\\n    smoothingTimeConstant?: number;\\n}\\n\\ninterface AnimationEventInit extends EventInit {\\n    animationName?: string;\\n    elapsedTime?: number;\\n    pseudoElement?: string;\\n}\\n\\ninterface AnimationPlaybackEventInit extends EventInit {\\n    currentTime?: number | null;\\n    timelineTime?: number | null;\\n}\\n\\ninterface AssertionOptions {\\n    allowList?: ScopedCredentialDescriptor[];\\n    extensions?: WebAuthnExtensions;\\n    rpId?: string;\\n    timeoutSeconds?: number;\\n}\\n\\ninterface AssignedNodesOptions {\\n    flatten?: boolean;\\n}\\n\\ninterface AudioBufferOptions {\\n    length: number;\\n    numberOfChannels?: number;\\n    sampleRate: number;\\n}\\n\\ninterface AudioBufferSourceOptions {\\n    buffer?: AudioBuffer | null;\\n    detune?: number;\\n    loop?: boolean;\\n    loopEnd?: number;\\n    loopStart?: number;\\n    playbackRate?: number;\\n}\\n\\ninterface AudioContextInfo {\\n    currentTime?: number;\\n    sampleRate?: number;\\n}\\n\\ninterface AudioContextOptions {\\n    latencyHint?: AudioContextLatencyCategory | number;\\n    sampleRate?: number;\\n}\\n\\ninterface AudioNodeOptions {\\n    channelCount?: number;\\n    channelCountMode?: ChannelCountMode;\\n    channelInterpretation?: ChannelInterpretation;\\n}\\n\\ninterface AudioParamDescriptor {\\n    automationRate?: AutomationRate;\\n    defaultValue?: number;\\n    maxValue?: number;\\n    minValue?: number;\\n    name: string;\\n}\\n\\ninterface AudioProcessingEventInit extends EventInit {\\n    inputBuffer: AudioBuffer;\\n    outputBuffer: AudioBuffer;\\n    playbackTime: number;\\n}\\n\\ninterface AudioTimestamp {\\n    contextTime?: number;\\n    performanceTime?: number;\\n}\\n\\ninterface AudioWorkletNodeOptions extends AudioNodeOptions {\\n    numberOfInputs?: number;\\n    numberOfOutputs?: number;\\n    outputChannelCount?: number[];\\n    parameterData?: Record<string, number>;\\n    processorOptions?: any;\\n}\\n\\ninterface AuthenticationExtensionsClientInputs {\\n    appid?: string;\\n    appidExclude?: string;\\n    credProps?: boolean;\\n    uvm?: boolean;\\n}\\n\\ninterface AuthenticationExtensionsClientOutputs {\\n    appid?: boolean;\\n    credProps?: CredentialPropertiesOutput;\\n    uvm?: UvmEntries;\\n}\\n\\ninterface AuthenticatorSelectionCriteria {\\n    authenticatorAttachment?: AuthenticatorAttachment;\\n    requireResidentKey?: boolean;\\n    residentKey?: ResidentKeyRequirement;\\n    userVerification?: UserVerificationRequirement;\\n}\\n\\ninterface BiquadFilterOptions extends AudioNodeOptions {\\n    Q?: number;\\n    detune?: number;\\n    frequency?: number;\\n    gain?: number;\\n    type?: BiquadFilterType;\\n}\\n\\ninterface BlobPropertyBag {\\n    endings?: EndingType;\\n    type?: string;\\n}\\n\\ninterface ByteLengthChunk {\\n    byteLength?: number;\\n}\\n\\ninterface CacheQueryOptions {\\n    ignoreMethod?: boolean;\\n    ignoreSearch?: boolean;\\n    ignoreVary?: boolean;\\n}\\n\\ninterface CanvasRenderingContext2DSettings {\\n    alpha?: boolean;\\n    desynchronized?: boolean;\\n}\\n\\ninterface ChannelMergerOptions extends AudioNodeOptions {\\n    numberOfInputs?: number;\\n}\\n\\ninterface ChannelSplitterOptions extends AudioNodeOptions {\\n    numberOfOutputs?: number;\\n}\\n\\ninterface ClientData {\\n    challenge: string;\\n    extensions?: WebAuthnExtensions;\\n    hashAlg: string | Algorithm;\\n    origin: string;\\n    rpId: string;\\n    tokenBinding?: string;\\n}\\n\\ninterface ClientQueryOptions {\\n    includeUncontrolled?: boolean;\\n    type?: ClientTypes;\\n}\\n\\ninterface ClipboardEventInit extends EventInit {\\n    clipboardData?: DataTransfer | null;\\n}\\n\\ninterface CloseEventInit extends EventInit {\\n    code?: number;\\n    reason?: string;\\n    wasClean?: boolean;\\n}\\n\\ninterface CompositionEventInit extends UIEventInit {\\n    data?: string;\\n}\\n\\ninterface ComputedEffectTiming extends EffectTiming {\\n    activeDuration?: number;\\n    currentIteration?: number | null;\\n    endTime?: number;\\n    localTime?: number | null;\\n    progress?: number | null;\\n}\\n\\ninterface ComputedKeyframe {\\n    composite: CompositeOperationOrAuto;\\n    computedOffset: number;\\n    easing: string;\\n    offset: number | null;\\n    [property: string]: string | number | null | undefined;\\n}\\n\\ninterface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation {\\n    arrayOfDomainStrings?: string[];\\n}\\n\\ninterface ConstantSourceOptions {\\n    offset?: number;\\n}\\n\\ninterface ConstrainBooleanParameters {\\n    exact?: boolean;\\n    ideal?: boolean;\\n}\\n\\ninterface ConstrainDOMStringParameters {\\n    exact?: string | string[];\\n    ideal?: string | string[];\\n}\\n\\ninterface ConstrainDoubleRange extends DoubleRange {\\n    exact?: number;\\n    ideal?: number;\\n}\\n\\ninterface ConstrainULongRange extends ULongRange {\\n    exact?: number;\\n    ideal?: number;\\n}\\n\\ninterface ConstrainVideoFacingModeParameters {\\n    exact?: VideoFacingModeEnum | VideoFacingModeEnum[];\\n    ideal?: VideoFacingModeEnum | VideoFacingModeEnum[];\\n}\\n\\ninterface ConvolverOptions extends AudioNodeOptions {\\n    buffer?: AudioBuffer | null;\\n    disableNormalization?: boolean;\\n}\\n\\ninterface CredentialCreationOptions {\\n    publicKey?: PublicKeyCredentialCreationOptions;\\n    signal?: AbortSignal;\\n}\\n\\ninterface CredentialPropertiesOutput {\\n    rk?: boolean;\\n}\\n\\ninterface CredentialRequestOptions {\\n    mediation?: CredentialMediationRequirement;\\n    publicKey?: PublicKeyCredentialRequestOptions;\\n    signal?: AbortSignal;\\n}\\n\\ninterface CustomEventInit<T = any> extends EventInit {\\n    detail?: T;\\n}\\n\\ninterface DOMMatrix2DInit {\\n    a?: number;\\n    b?: number;\\n    c?: number;\\n    d?: number;\\n    e?: number;\\n    f?: number;\\n    m11?: number;\\n    m12?: number;\\n    m21?: number;\\n    m22?: number;\\n    m41?: number;\\n    m42?: number;\\n}\\n\\ninterface DOMMatrixInit extends DOMMatrix2DInit {\\n    is2D?: boolean;\\n    m13?: number;\\n    m14?: number;\\n    m23?: number;\\n    m24?: number;\\n    m31?: number;\\n    m32?: number;\\n    m33?: number;\\n    m34?: number;\\n    m43?: number;\\n    m44?: number;\\n}\\n\\ninterface DOMPointInit {\\n    w?: number;\\n    x?: number;\\n    y?: number;\\n    z?: number;\\n}\\n\\ninterface DOMQuadInit {\\n    p1?: DOMPointInit;\\n    p2?: DOMPointInit;\\n    p3?: DOMPointInit;\\n    p4?: DOMPointInit;\\n}\\n\\ninterface DOMRectInit {\\n    height?: number;\\n    width?: number;\\n    x?: number;\\n    y?: number;\\n}\\n\\ninterface DelayOptions extends AudioNodeOptions {\\n    delayTime?: number;\\n    maxDelayTime?: number;\\n}\\n\\ninterface DeviceLightEventInit extends EventInit {\\n    value?: number;\\n}\\n\\ninterface DeviceMotionEventAccelerationInit {\\n    x?: number | null;\\n    y?: number | null;\\n    z?: number | null;\\n}\\n\\ninterface DeviceMotionEventInit extends EventInit {\\n    acceleration?: DeviceMotionEventAccelerationInit;\\n    accelerationIncludingGravity?: DeviceMotionEventAccelerationInit;\\n    interval?: number;\\n    rotationRate?: DeviceMotionEventRotationRateInit;\\n}\\n\\ninterface DeviceMotionEventRotationRateInit {\\n    alpha?: number | null;\\n    beta?: number | null;\\n    gamma?: number | null;\\n}\\n\\ninterface DeviceOrientationEventInit extends EventInit {\\n    absolute?: boolean;\\n    alpha?: number | null;\\n    beta?: number | null;\\n    gamma?: number | null;\\n}\\n\\ninterface DevicePermissionDescriptor extends PermissionDescriptor {\\n    deviceId?: string;\\n    name: \\\"camera\\\" | \\\"microphone\\\" | \\\"speaker\\\";\\n}\\n\\ninterface DocumentTimelineOptions {\\n    originTime?: number;\\n}\\n\\ninterface DoubleRange {\\n    max?: number;\\n    min?: number;\\n}\\n\\ninterface DragEventInit extends MouseEventInit {\\n    dataTransfer?: DataTransfer | null;\\n}\\n\\ninterface DynamicsCompressorOptions extends AudioNodeOptions {\\n    attack?: number;\\n    knee?: number;\\n    ratio?: number;\\n    release?: number;\\n    threshold?: number;\\n}\\n\\ninterface EcKeyAlgorithm extends KeyAlgorithm {\\n    namedCurve: NamedCurve;\\n}\\n\\ninterface EcKeyGenParams extends Algorithm {\\n    namedCurve: NamedCurve;\\n}\\n\\ninterface EcKeyImportParams extends Algorithm {\\n    namedCurve: NamedCurve;\\n}\\n\\ninterface EcdhKeyDeriveParams extends Algorithm {\\n    public: CryptoKey;\\n}\\n\\ninterface EcdsaParams extends Algorithm {\\n    hash: HashAlgorithmIdentifier;\\n}\\n\\ninterface EffectTiming {\\n    delay?: number;\\n    direction?: PlaybackDirection;\\n    duration?: number | string;\\n    easing?: string;\\n    endDelay?: number;\\n    fill?: FillMode;\\n    iterationStart?: number;\\n    iterations?: number;\\n}\\n\\ninterface ElementCreationOptions {\\n    is?: string;\\n}\\n\\ninterface ElementDefinitionOptions {\\n    extends?: string;\\n}\\n\\ninterface ErrorEventInit extends EventInit {\\n    colno?: number;\\n    error?: any;\\n    filename?: string;\\n    lineno?: number;\\n    message?: string;\\n}\\n\\ninterface EventInit {\\n    bubbles?: boolean;\\n    cancelable?: boolean;\\n    composed?: boolean;\\n}\\n\\ninterface EventListenerOptions {\\n    capture?: boolean;\\n}\\n\\ninterface EventModifierInit extends UIEventInit {\\n    altKey?: boolean;\\n    ctrlKey?: boolean;\\n    metaKey?: boolean;\\n    modifierAltGraph?: boolean;\\n    modifierCapsLock?: boolean;\\n    modifierFn?: boolean;\\n    modifierFnLock?: boolean;\\n    modifierHyper?: boolean;\\n    modifierNumLock?: boolean;\\n    modifierScrollLock?: boolean;\\n    modifierSuper?: boolean;\\n    modifierSymbol?: boolean;\\n    modifierSymbolLock?: boolean;\\n    shiftKey?: boolean;\\n}\\n\\ninterface EventSourceInit {\\n    withCredentials?: boolean;\\n}\\n\\ninterface ExceptionInformation {\\n    domain?: string | null;\\n}\\n\\ninterface FilePropertyBag extends BlobPropertyBag {\\n    lastModified?: number;\\n}\\n\\ninterface FocusEventInit extends UIEventInit {\\n    relatedTarget?: EventTarget | null;\\n}\\n\\ninterface FocusNavigationEventInit extends EventInit {\\n    navigationReason?: string | null;\\n    originHeight?: number;\\n    originLeft?: number;\\n    originTop?: number;\\n    originWidth?: number;\\n}\\n\\ninterface FocusNavigationOrigin {\\n    originHeight?: number;\\n    originLeft?: number;\\n    originTop?: number;\\n    originWidth?: number;\\n}\\n\\ninterface FocusOptions {\\n    preventScroll?: boolean;\\n}\\n\\ninterface FullscreenOptions {\\n    navigationUI?: FullscreenNavigationUI;\\n}\\n\\ninterface GainOptions extends AudioNodeOptions {\\n    gain?: number;\\n}\\n\\ninterface GamepadEventInit extends EventInit {\\n    gamepad: Gamepad;\\n}\\n\\ninterface GetNotificationOptions {\\n    tag?: string;\\n}\\n\\ninterface GetRootNodeOptions {\\n    composed?: boolean;\\n}\\n\\ninterface HashChangeEventInit extends EventInit {\\n    newURL?: string;\\n    oldURL?: string;\\n}\\n\\ninterface HkdfParams extends Algorithm {\\n    hash: HashAlgorithmIdentifier;\\n    info: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n    salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n}\\n\\ninterface HmacImportParams extends Algorithm {\\n    hash: HashAlgorithmIdentifier;\\n    length?: number;\\n}\\n\\ninterface HmacKeyAlgorithm extends KeyAlgorithm {\\n    hash: KeyAlgorithm;\\n    length: number;\\n}\\n\\ninterface HmacKeyGenParams extends Algorithm {\\n    hash: HashAlgorithmIdentifier;\\n    length?: number;\\n}\\n\\ninterface IDBIndexParameters {\\n    multiEntry?: boolean;\\n    unique?: boolean;\\n}\\n\\ninterface IDBObjectStoreParameters {\\n    autoIncrement?: boolean;\\n    keyPath?: string | string[] | null;\\n}\\n\\ninterface IDBVersionChangeEventInit extends EventInit {\\n    newVersion?: number | null;\\n    oldVersion?: number;\\n}\\n\\ninterface IIRFilterOptions extends AudioNodeOptions {\\n    feedback: number[];\\n    feedforward: number[];\\n}\\n\\ninterface ImageBitmapOptions {\\n    colorSpaceConversion?: ColorSpaceConversion;\\n    imageOrientation?: ImageOrientation;\\n    premultiplyAlpha?: PremultiplyAlpha;\\n    resizeHeight?: number;\\n    resizeQuality?: ResizeQuality;\\n    resizeWidth?: number;\\n}\\n\\ninterface ImageBitmapRenderingContextSettings {\\n    alpha?: boolean;\\n}\\n\\ninterface ImageEncodeOptions {\\n    quality?: number;\\n    type?: string;\\n}\\n\\ninterface ImportMeta {\\n    url: string;\\n}\\n\\ninterface InputEventInit extends UIEventInit {\\n    data?: string | null;\\n    inputType?: string;\\n    isComposing?: boolean;\\n}\\n\\ninterface IntersectionObserverEntryInit {\\n    boundingClientRect: DOMRectInit;\\n    intersectionRatio: number;\\n    intersectionRect: DOMRectInit;\\n    isIntersecting: boolean;\\n    rootBounds: DOMRectInit | null;\\n    target: Element;\\n    time: number;\\n}\\n\\ninterface IntersectionObserverInit {\\n    root?: Element | Document | null;\\n    rootMargin?: string;\\n    threshold?: number | number[];\\n}\\n\\ninterface JsonWebKey {\\n    alg?: string;\\n    crv?: string;\\n    d?: string;\\n    dp?: string;\\n    dq?: string;\\n    e?: string;\\n    ext?: boolean;\\n    k?: string;\\n    key_ops?: string[];\\n    kty?: string;\\n    n?: string;\\n    oth?: RsaOtherPrimesInfo[];\\n    p?: string;\\n    q?: string;\\n    qi?: string;\\n    use?: string;\\n    x?: string;\\n    y?: string;\\n}\\n\\ninterface KeyAlgorithm {\\n    name: string;\\n}\\n\\ninterface KeyboardEventInit extends EventModifierInit {\\n    /** @deprecated */\\n    charCode?: number;\\n    code?: string;\\n    isComposing?: boolean;\\n    key?: string;\\n    /** @deprecated */\\n    keyCode?: number;\\n    location?: number;\\n    repeat?: boolean;\\n}\\n\\ninterface Keyframe {\\n    composite?: CompositeOperationOrAuto;\\n    easing?: string;\\n    offset?: number | null;\\n    [property: string]: string | number | null | undefined;\\n}\\n\\ninterface KeyframeAnimationOptions extends KeyframeEffectOptions {\\n    id?: string;\\n}\\n\\ninterface KeyframeEffectOptions extends EffectTiming {\\n    composite?: CompositeOperation;\\n    iterationComposite?: IterationCompositeOperation;\\n}\\n\\ninterface MediaElementAudioSourceOptions {\\n    mediaElement: HTMLMediaElement;\\n}\\n\\ninterface MediaEncryptedEventInit extends EventInit {\\n    initData?: ArrayBuffer | null;\\n    initDataType?: string;\\n}\\n\\ninterface MediaKeyMessageEventInit extends EventInit {\\n    message: ArrayBuffer;\\n    messageType: MediaKeyMessageType;\\n}\\n\\ninterface MediaKeySystemConfiguration {\\n    audioCapabilities?: MediaKeySystemMediaCapability[];\\n    distinctiveIdentifier?: MediaKeysRequirement;\\n    initDataTypes?: string[];\\n    label?: string;\\n    persistentState?: MediaKeysRequirement;\\n    sessionTypes?: string[];\\n    videoCapabilities?: MediaKeySystemMediaCapability[];\\n}\\n\\ninterface MediaKeySystemMediaCapability {\\n    contentType?: string;\\n    robustness?: string;\\n}\\n\\ninterface MediaQueryListEventInit extends EventInit {\\n    matches?: boolean;\\n    media?: string;\\n}\\n\\ninterface MediaStreamAudioSourceOptions {\\n    mediaStream: MediaStream;\\n}\\n\\ninterface MediaStreamConstraints {\\n    audio?: boolean | MediaTrackConstraints;\\n    peerIdentity?: string;\\n    video?: boolean | MediaTrackConstraints;\\n}\\n\\ninterface MediaStreamErrorEventInit extends EventInit {\\n    error?: MediaStreamError | null;\\n}\\n\\ninterface MediaStreamEventInit extends EventInit {\\n    stream?: MediaStream;\\n}\\n\\ninterface MediaStreamTrackAudioSourceOptions {\\n    mediaStreamTrack: MediaStreamTrack;\\n}\\n\\ninterface MediaStreamTrackEventInit extends EventInit {\\n    track: MediaStreamTrack;\\n}\\n\\ninterface MediaTrackCapabilities {\\n    aspectRatio?: DoubleRange;\\n    autoGainControl?: boolean[];\\n    channelCount?: ULongRange;\\n    deviceId?: string;\\n    echoCancellation?: boolean[];\\n    facingMode?: string[];\\n    frameRate?: DoubleRange;\\n    groupId?: string;\\n    height?: ULongRange;\\n    latency?: DoubleRange;\\n    noiseSuppression?: boolean[];\\n    resizeMode?: string[];\\n    sampleRate?: ULongRange;\\n    sampleSize?: ULongRange;\\n    width?: ULongRange;\\n}\\n\\ninterface MediaTrackConstraintSet {\\n    aspectRatio?: ConstrainDouble;\\n    autoGainControl?: ConstrainBoolean;\\n    channelCount?: ConstrainULong;\\n    deviceId?: ConstrainDOMString;\\n    echoCancellation?: ConstrainBoolean;\\n    facingMode?: ConstrainDOMString;\\n    frameRate?: ConstrainDouble;\\n    groupId?: ConstrainDOMString;\\n    height?: ConstrainULong;\\n    latency?: ConstrainDouble;\\n    noiseSuppression?: ConstrainBoolean;\\n    resizeMode?: ConstrainDOMString;\\n    sampleRate?: ConstrainULong;\\n    sampleSize?: ConstrainULong;\\n    width?: ConstrainULong;\\n}\\n\\ninterface MediaTrackConstraints extends MediaTrackConstraintSet {\\n    advanced?: MediaTrackConstraintSet[];\\n}\\n\\ninterface MediaTrackSettings {\\n    aspectRatio?: number;\\n    autoGainControl?: boolean;\\n    channelCount?: number;\\n    deviceId?: string;\\n    echoCancellation?: boolean;\\n    facingMode?: string;\\n    frameRate?: number;\\n    groupId?: string;\\n    height?: number;\\n    latency?: number;\\n    noiseSuppression?: boolean;\\n    resizeMode?: string;\\n    sampleRate?: number;\\n    sampleSize?: number;\\n    width?: number;\\n}\\n\\ninterface MediaTrackSupportedConstraints {\\n    aspectRatio?: boolean;\\n    autoGainControl?: boolean;\\n    channelCount?: boolean;\\n    deviceId?: boolean;\\n    echoCancellation?: boolean;\\n    facingMode?: boolean;\\n    frameRate?: boolean;\\n    groupId?: boolean;\\n    height?: boolean;\\n    latency?: boolean;\\n    noiseSuppression?: boolean;\\n    resizeMode?: boolean;\\n    sampleRate?: boolean;\\n    sampleSize?: boolean;\\n    width?: boolean;\\n}\\n\\ninterface MessageEventInit<T = any> extends EventInit {\\n    data?: T;\\n    lastEventId?: string;\\n    origin?: string;\\n    ports?: MessagePort[];\\n    source?: MessageEventSource | null;\\n}\\n\\ninterface MidiPermissionDescriptor extends PermissionDescriptor {\\n    name: \\\"midi\\\";\\n    sysex?: boolean;\\n}\\n\\ninterface MouseEventInit extends EventModifierInit {\\n    button?: number;\\n    buttons?: number;\\n    clientX?: number;\\n    clientY?: number;\\n    movementX?: number;\\n    movementY?: number;\\n    relatedTarget?: EventTarget | null;\\n    screenX?: number;\\n    screenY?: number;\\n}\\n\\ninterface MultiCacheQueryOptions extends CacheQueryOptions {\\n    cacheName?: string;\\n}\\n\\ninterface MutationObserverInit {\\n    /**\\n     * Set to a list of attribute local names (without namespace) if not all attribute mutations need to be observed and attributes is true or omitted.\\n     */\\n    attributeFilter?: string[];\\n    /**\\n     * Set to true if attributes is true or omitted and target's attribute value before the mutation needs to be recorded.\\n     */\\n    attributeOldValue?: boolean;\\n    /**\\n     * Set to true if mutations to target's attributes are to be observed. Can be omitted if attributeOldValue or attributeFilter is specified.\\n     */\\n    attributes?: boolean;\\n    /**\\n     * Set to true if mutations to target's data are to be observed. Can be omitted if characterDataOldValue is specified.\\n     */\\n    characterData?: boolean;\\n    /**\\n     * Set to true if characterData is set to true or omitted and target's data before the mutation needs to be recorded.\\n     */\\n    characterDataOldValue?: boolean;\\n    /**\\n     * Set to true if mutations to target's children are to be observed.\\n     */\\n    childList?: boolean;\\n    /**\\n     * Set to true if mutations to not just target, but also target's descendants are to be observed.\\n     */\\n    subtree?: boolean;\\n}\\n\\ninterface NavigationPreloadState {\\n    enabled?: boolean;\\n    headerValue?: string;\\n}\\n\\ninterface NotificationAction {\\n    action: string;\\n    icon?: string;\\n    title: string;\\n}\\n\\ninterface NotificationOptions {\\n    actions?: NotificationAction[];\\n    badge?: string;\\n    body?: string;\\n    data?: any;\\n    dir?: NotificationDirection;\\n    icon?: string;\\n    image?: string;\\n    lang?: string;\\n    renotify?: boolean;\\n    requireInteraction?: boolean;\\n    silent?: boolean;\\n    tag?: string;\\n    timestamp?: number;\\n    vibrate?: VibratePattern;\\n}\\n\\ninterface OfflineAudioCompletionEventInit extends EventInit {\\n    renderedBuffer: AudioBuffer;\\n}\\n\\ninterface OfflineAudioContextOptions {\\n    length: number;\\n    numberOfChannels?: number;\\n    sampleRate: number;\\n}\\n\\ninterface OptionalEffectTiming {\\n    delay?: number;\\n    direction?: PlaybackDirection;\\n    duration?: number | string;\\n    easing?: string;\\n    endDelay?: number;\\n    fill?: FillMode;\\n    iterationStart?: number;\\n    iterations?: number;\\n}\\n\\ninterface OscillatorOptions extends AudioNodeOptions {\\n    detune?: number;\\n    frequency?: number;\\n    periodicWave?: PeriodicWave;\\n    type?: OscillatorType;\\n}\\n\\ninterface PageTransitionEventInit extends EventInit {\\n    persisted?: boolean;\\n}\\n\\ninterface PannerOptions extends AudioNodeOptions {\\n    coneInnerAngle?: number;\\n    coneOuterAngle?: number;\\n    coneOuterGain?: number;\\n    distanceModel?: DistanceModelType;\\n    maxDistance?: number;\\n    orientationX?: number;\\n    orientationY?: number;\\n    orientationZ?: number;\\n    panningModel?: PanningModelType;\\n    positionX?: number;\\n    positionY?: number;\\n    positionZ?: number;\\n    refDistance?: number;\\n    rolloffFactor?: number;\\n}\\n\\ninterface PaymentCurrencyAmount {\\n    currency: string;\\n    currencySystem?: string;\\n    value: string;\\n}\\n\\ninterface PaymentDetailsBase {\\n    displayItems?: PaymentItem[];\\n    modifiers?: PaymentDetailsModifier[];\\n    shippingOptions?: PaymentShippingOption[];\\n}\\n\\ninterface PaymentDetailsInit extends PaymentDetailsBase {\\n    id?: string;\\n    total: PaymentItem;\\n}\\n\\ninterface PaymentDetailsModifier {\\n    additionalDisplayItems?: PaymentItem[];\\n    data?: any;\\n    supportedMethods: string | string[];\\n    total?: PaymentItem;\\n}\\n\\ninterface PaymentDetailsUpdate extends PaymentDetailsBase {\\n    error?: string;\\n    total?: PaymentItem;\\n}\\n\\ninterface PaymentItem {\\n    amount: PaymentCurrencyAmount;\\n    label: string;\\n    pending?: boolean;\\n}\\n\\ninterface PaymentMethodData {\\n    data?: any;\\n    supportedMethods: string | string[];\\n}\\n\\ninterface PaymentOptions {\\n    requestPayerEmail?: boolean;\\n    requestPayerName?: boolean;\\n    requestPayerPhone?: boolean;\\n    requestShipping?: boolean;\\n    shippingType?: string;\\n}\\n\\ninterface PaymentRequestUpdateEventInit extends EventInit {\\n}\\n\\ninterface PaymentShippingOption {\\n    amount: PaymentCurrencyAmount;\\n    id: string;\\n    label: string;\\n    selected?: boolean;\\n}\\n\\ninterface Pbkdf2Params extends Algorithm {\\n    hash: HashAlgorithmIdentifier;\\n    iterations: number;\\n    salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n}\\n\\ninterface PerformanceObserverInit {\\n    buffered?: boolean;\\n    entryTypes?: string[];\\n    type?: string;\\n}\\n\\ninterface PeriodicWaveConstraints {\\n    disableNormalization?: boolean;\\n}\\n\\ninterface PeriodicWaveOptions extends PeriodicWaveConstraints {\\n    imag?: number[] | Float32Array;\\n    real?: number[] | Float32Array;\\n}\\n\\ninterface PermissionDescriptor {\\n    name: PermissionName;\\n}\\n\\ninterface PointerEventInit extends MouseEventInit {\\n    coalescedEvents?: PointerEvent[];\\n    height?: number;\\n    isPrimary?: boolean;\\n    pointerId?: number;\\n    pointerType?: string;\\n    predictedEvents?: PointerEvent[];\\n    pressure?: number;\\n    tangentialPressure?: number;\\n    tiltX?: number;\\n    tiltY?: number;\\n    twist?: number;\\n    width?: number;\\n}\\n\\ninterface PopStateEventInit extends EventInit {\\n    state?: any;\\n}\\n\\ninterface PositionOptions {\\n    enableHighAccuracy?: boolean;\\n    maximumAge?: number;\\n    timeout?: number;\\n}\\n\\ninterface PostMessageOptions {\\n    transfer?: any[];\\n}\\n\\ninterface ProgressEventInit extends EventInit {\\n    lengthComputable?: boolean;\\n    loaded?: number;\\n    total?: number;\\n}\\n\\ninterface PromiseRejectionEventInit extends EventInit {\\n    promise: Promise<any>;\\n    reason?: any;\\n}\\n\\ninterface PropertyIndexedKeyframes {\\n    composite?: CompositeOperationOrAuto | CompositeOperationOrAuto[];\\n    easing?: string | string[];\\n    offset?: number | (number | null)[];\\n    [property: string]: string | string[] | number | null | (number | null)[] | undefined;\\n}\\n\\ninterface PublicKeyCredentialCreationOptions {\\n    attestation?: AttestationConveyancePreference;\\n    authenticatorSelection?: AuthenticatorSelectionCriteria;\\n    challenge: BufferSource;\\n    excludeCredentials?: PublicKeyCredentialDescriptor[];\\n    extensions?: AuthenticationExtensionsClientInputs;\\n    pubKeyCredParams: PublicKeyCredentialParameters[];\\n    rp: PublicKeyCredentialRpEntity;\\n    timeout?: number;\\n    user: PublicKeyCredentialUserEntity;\\n}\\n\\ninterface PublicKeyCredentialDescriptor {\\n    id: BufferSource;\\n    transports?: AuthenticatorTransport[];\\n    type: PublicKeyCredentialType;\\n}\\n\\ninterface PublicKeyCredentialEntity {\\n    name: string;\\n}\\n\\ninterface PublicKeyCredentialParameters {\\n    alg: COSEAlgorithmIdentifier;\\n    type: PublicKeyCredentialType;\\n}\\n\\ninterface PublicKeyCredentialRequestOptions {\\n    allowCredentials?: PublicKeyCredentialDescriptor[];\\n    challenge: BufferSource;\\n    extensions?: AuthenticationExtensionsClientInputs;\\n    rpId?: string;\\n    timeout?: number;\\n    userVerification?: UserVerificationRequirement;\\n}\\n\\ninterface PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity {\\n    id?: string;\\n}\\n\\ninterface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity {\\n    displayName: string;\\n    id: BufferSource;\\n}\\n\\ninterface PushPermissionDescriptor extends PermissionDescriptor {\\n    name: \\\"push\\\";\\n    userVisibleOnly?: boolean;\\n}\\n\\ninterface PushSubscriptionJSON {\\n    endpoint?: string;\\n    expirationTime?: number | null;\\n    keys?: Record<string, string>;\\n}\\n\\ninterface PushSubscriptionOptionsInit {\\n    applicationServerKey?: BufferSource | string | null;\\n    userVisibleOnly?: boolean;\\n}\\n\\ninterface QueuingStrategy<T = any> {\\n    highWaterMark?: number;\\n    size?: QueuingStrategySize<T>;\\n}\\n\\ninterface QueuingStrategyInit {\\n    /**\\n     * Creates a new ByteLengthQueuingStrategy with the provided high water mark.\\n     * \\n     * Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw.\\n     */\\n    highWaterMark: number;\\n}\\n\\ninterface RTCAnswerOptions extends RTCOfferAnswerOptions {\\n}\\n\\ninterface RTCCertificateExpiration {\\n    expires?: number;\\n}\\n\\ninterface RTCConfiguration {\\n    bundlePolicy?: RTCBundlePolicy;\\n    certificates?: RTCCertificate[];\\n    iceCandidatePoolSize?: number;\\n    iceServers?: RTCIceServer[];\\n    iceTransportPolicy?: RTCIceTransportPolicy;\\n    peerIdentity?: string;\\n    rtcpMuxPolicy?: RTCRtcpMuxPolicy;\\n}\\n\\ninterface RTCDTMFToneChangeEventInit extends EventInit {\\n    tone: string;\\n}\\n\\ninterface RTCDataChannelEventInit extends EventInit {\\n    channel: RTCDataChannel;\\n}\\n\\ninterface RTCDataChannelInit {\\n    id?: number;\\n    maxPacketLifeTime?: number;\\n    maxRetransmits?: number;\\n    negotiated?: boolean;\\n    ordered?: boolean;\\n    priority?: RTCPriorityType;\\n    protocol?: string;\\n}\\n\\ninterface RTCDtlsFingerprint {\\n    algorithm?: string;\\n    value?: string;\\n}\\n\\ninterface RTCDtlsParameters {\\n    fingerprints?: RTCDtlsFingerprint[];\\n    role?: RTCDtlsRole;\\n}\\n\\ninterface RTCErrorEventInit extends EventInit {\\n    error: RTCError;\\n}\\n\\ninterface RTCErrorInit {\\n    errorDetail: RTCErrorDetailType;\\n    httpRequestStatusCode?: number;\\n    receivedAlert?: number;\\n    sctpCauseCode?: number;\\n    sdpLineNumber?: number;\\n    sentAlert?: number;\\n}\\n\\ninterface RTCIceCandidateAttributes extends RTCStats {\\n    addressSourceUrl?: string;\\n    candidateType?: RTCStatsIceCandidateType;\\n    ipAddress?: string;\\n    portNumber?: number;\\n    priority?: number;\\n    transport?: string;\\n}\\n\\ninterface RTCIceCandidateComplete {\\n}\\n\\ninterface RTCIceCandidateDictionary {\\n    foundation?: string;\\n    ip?: string;\\n    msMTurnSessionId?: string;\\n    port?: number;\\n    priority?: number;\\n    protocol?: RTCIceProtocol;\\n    relatedAddress?: string;\\n    relatedPort?: number;\\n    tcpType?: RTCIceTcpCandidateType;\\n    type?: RTCIceCandidateType;\\n}\\n\\ninterface RTCIceCandidateInit {\\n    candidate?: string;\\n    sdpMLineIndex?: number | null;\\n    sdpMid?: string | null;\\n    usernameFragment?: string | null;\\n}\\n\\ninterface RTCIceCandidatePair {\\n    local?: RTCIceCandidate;\\n    remote?: RTCIceCandidate;\\n}\\n\\ninterface RTCIceCandidatePairStats extends RTCStats {\\n    availableIncomingBitrate?: number;\\n    availableOutgoingBitrate?: number;\\n    bytesDiscardedOnSend?: number;\\n    bytesReceived?: number;\\n    bytesSent?: number;\\n    circuitBreakerTriggerCount?: number;\\n    consentExpiredTimestamp?: number;\\n    consentRequestsSent?: number;\\n    currentRoundTripTime?: number;\\n    currentRtt?: number;\\n    firstRequestTimestamp?: number;\\n    lastPacketReceivedTimestamp?: number;\\n    lastPacketSentTimestamp?: number;\\n    lastRequestTimestamp?: number;\\n    lastResponseTimestamp?: number;\\n    localCandidateId?: string;\\n    nominated?: boolean;\\n    packetsDiscardedOnSend?: number;\\n    packetsReceived?: number;\\n    packetsSent?: number;\\n    priority?: number;\\n    remoteCandidateId?: string;\\n    requestsReceived?: number;\\n    requestsSent?: number;\\n    responsesReceived?: number;\\n    responsesSent?: number;\\n    retransmissionsReceived?: number;\\n    retransmissionsSent?: number;\\n    state?: RTCStatsIceCandidatePairState;\\n    totalRoundTripTime?: number;\\n    totalRtt?: number;\\n    transportId?: string;\\n}\\n\\ninterface RTCIceGatherOptions {\\n    gatherPolicy?: RTCIceGatherPolicy;\\n    iceservers?: RTCIceServer[];\\n}\\n\\ninterface RTCIceParameters {\\n    password?: string;\\n    usernameFragment?: string;\\n}\\n\\ninterface RTCIceServer {\\n    credential?: string | RTCOAuthCredential;\\n    credentialType?: RTCIceCredentialType;\\n    urls: string | string[];\\n    username?: string;\\n}\\n\\ninterface RTCIdentityProviderOptions {\\n    peerIdentity?: string;\\n    protocol?: string;\\n    usernameHint?: string;\\n}\\n\\ninterface RTCInboundRTPStreamStats extends RTCRTPStreamStats {\\n    bytesReceived?: number;\\n    fractionLost?: number;\\n    jitter?: number;\\n    packetsLost?: number;\\n    packetsReceived?: number;\\n}\\n\\ninterface RTCMediaStreamTrackStats extends RTCStats {\\n    audioLevel?: number;\\n    echoReturnLoss?: number;\\n    echoReturnLossEnhancement?: number;\\n    frameHeight?: number;\\n    frameWidth?: number;\\n    framesCorrupted?: number;\\n    framesDecoded?: number;\\n    framesDropped?: number;\\n    framesPerSecond?: number;\\n    framesReceived?: number;\\n    framesSent?: number;\\n    remoteSource?: boolean;\\n    ssrcIds?: string[];\\n    trackIdentifier?: string;\\n}\\n\\ninterface RTCOAuthCredential {\\n    accessToken: string;\\n    macKey: string;\\n}\\n\\ninterface RTCOfferAnswerOptions {\\n    voiceActivityDetection?: boolean;\\n}\\n\\ninterface RTCOfferOptions extends RTCOfferAnswerOptions {\\n    iceRestart?: boolean;\\n    offerToReceiveAudio?: boolean;\\n    offerToReceiveVideo?: boolean;\\n}\\n\\ninterface RTCOutboundRTPStreamStats extends RTCRTPStreamStats {\\n    bytesSent?: number;\\n    packetsSent?: number;\\n    roundTripTime?: number;\\n    targetBitrate?: number;\\n}\\n\\ninterface RTCPeerConnectionIceErrorEventInit extends EventInit {\\n    errorCode: number;\\n    hostCandidate?: string;\\n    statusText?: string;\\n    url?: string;\\n}\\n\\ninterface RTCPeerConnectionIceEventInit extends EventInit {\\n    candidate?: RTCIceCandidate | null;\\n    url?: string | null;\\n}\\n\\ninterface RTCRTPStreamStats extends RTCStats {\\n    associateStatsId?: string;\\n    codecId?: string;\\n    firCount?: number;\\n    isRemote?: boolean;\\n    mediaTrackId?: string;\\n    mediaType?: string;\\n    nackCount?: number;\\n    pliCount?: number;\\n    sliCount?: number;\\n    ssrc?: string;\\n    transportId?: string;\\n}\\n\\ninterface RTCRtcpFeedback {\\n    parameter?: string;\\n    type?: string;\\n}\\n\\ninterface RTCRtcpParameters {\\n    cname?: string;\\n    reducedSize?: boolean;\\n}\\n\\ninterface RTCRtpCapabilities {\\n    codecs: RTCRtpCodecCapability[];\\n    headerExtensions: RTCRtpHeaderExtensionCapability[];\\n}\\n\\ninterface RTCRtpCodecCapability {\\n    channels?: number;\\n    clockRate: number;\\n    mimeType: string;\\n    sdpFmtpLine?: string;\\n}\\n\\ninterface RTCRtpCodecParameters {\\n    channels?: number;\\n    clockRate: number;\\n    mimeType: string;\\n    payloadType: number;\\n    sdpFmtpLine?: string;\\n}\\n\\ninterface RTCRtpCodingParameters {\\n    rid?: string;\\n}\\n\\ninterface RTCRtpContributingSource {\\n    audioLevel?: number;\\n    rtpTimestamp: number;\\n    source: number;\\n    timestamp: number;\\n}\\n\\ninterface RTCRtpDecodingParameters extends RTCRtpCodingParameters {\\n}\\n\\ninterface RTCRtpEncodingParameters extends RTCRtpCodingParameters {\\n    active?: boolean;\\n    codecPayloadType?: number;\\n    dtx?: RTCDtxStatus;\\n    maxBitrate?: number;\\n    maxFramerate?: number;\\n    ptime?: number;\\n    scaleResolutionDownBy?: number;\\n}\\n\\ninterface RTCRtpFecParameters {\\n    mechanism?: string;\\n    ssrc?: number;\\n}\\n\\ninterface RTCRtpHeaderExtension {\\n    kind?: string;\\n    preferredEncrypt?: boolean;\\n    preferredId?: number;\\n    uri?: string;\\n}\\n\\ninterface RTCRtpHeaderExtensionCapability {\\n    uri?: string;\\n}\\n\\ninterface RTCRtpHeaderExtensionParameters {\\n    encrypted?: boolean;\\n    id: number;\\n    uri: string;\\n}\\n\\ninterface RTCRtpParameters {\\n    codecs: RTCRtpCodecParameters[];\\n    headerExtensions: RTCRtpHeaderExtensionParameters[];\\n    rtcp: RTCRtcpParameters;\\n}\\n\\ninterface RTCRtpReceiveParameters extends RTCRtpParameters {\\n    encodings: RTCRtpDecodingParameters[];\\n}\\n\\ninterface RTCRtpRtxParameters {\\n    ssrc?: number;\\n}\\n\\ninterface RTCRtpSendParameters extends RTCRtpParameters {\\n    degradationPreference?: RTCDegradationPreference;\\n    encodings: RTCRtpEncodingParameters[];\\n    priority?: RTCPriorityType;\\n    transactionId: string;\\n}\\n\\ninterface RTCRtpSynchronizationSource extends RTCRtpContributingSource {\\n    voiceActivityFlag?: boolean;\\n}\\n\\ninterface RTCRtpTransceiverInit {\\n    direction?: RTCRtpTransceiverDirection;\\n    sendEncodings?: RTCRtpEncodingParameters[];\\n    streams?: MediaStream[];\\n}\\n\\ninterface RTCRtpUnhandled {\\n    muxId?: string;\\n    payloadType?: number;\\n    ssrc?: number;\\n}\\n\\ninterface RTCSessionDescriptionInit {\\n    sdp?: string;\\n    type?: RTCSdpType;\\n}\\n\\ninterface RTCSrtpKeyParam {\\n    keyMethod?: string;\\n    keySalt?: string;\\n    lifetime?: string;\\n    mkiLength?: number;\\n    mkiValue?: number;\\n}\\n\\ninterface RTCSrtpSdesParameters {\\n    cryptoSuite?: string;\\n    keyParams?: RTCSrtpKeyParam[];\\n    sessionParams?: string[];\\n    tag?: number;\\n}\\n\\ninterface RTCSsrcRange {\\n    max?: number;\\n    min?: number;\\n}\\n\\ninterface RTCStats {\\n    id?: string;\\n    timestamp?: number;\\n    type?: RTCStatsType;\\n}\\n\\ninterface RTCStatsEventInit extends EventInit {\\n    report: RTCStatsReport;\\n}\\n\\ninterface RTCStatsReport {\\n}\\n\\ninterface RTCTrackEventInit extends EventInit {\\n    receiver: RTCRtpReceiver;\\n    streams?: MediaStream[];\\n    track: MediaStreamTrack;\\n    transceiver: RTCRtpTransceiver;\\n}\\n\\ninterface RTCTransportStats extends RTCStats {\\n    bytesReceived?: number;\\n    bytesSent?: number;\\n    dtlsCipher?: string;\\n    dtlsState?: RTCDtlsTransportState;\\n    iceRole?: RTCIceRole;\\n    localCertificateId?: string;\\n    packetsReceived?: number;\\n    packetsSent?: number;\\n    remoteCertificateId?: string;\\n    rtcpTransportStatsId?: string;\\n    selectedCandidatePairChanges?: number;\\n    selectedCandidatePairId?: string;\\n    srtpCipher?: string;\\n    tlsGroup?: string;\\n    tlsVersion?: string;\\n}\\n\\ninterface ReadableStreamDefaultReadDoneResult {\\n    done: true;\\n    value?: undefined;\\n}\\n\\ninterface ReadableStreamDefaultReadValueResult<T> {\\n    done: false;\\n    value: T;\\n}\\n\\ninterface ReadableWritablePair<R = any, W = any> {\\n    readable: ReadableStream<R>;\\n    /**\\n     * Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.\\n     * \\n     * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.\\n     */\\n    writable: WritableStream<W>;\\n}\\n\\ninterface RegistrationOptions {\\n    scope?: string;\\n    type?: WorkerType;\\n    updateViaCache?: ServiceWorkerUpdateViaCache;\\n}\\n\\ninterface RequestInit {\\n    /**\\n     * A BodyInit object or null to set request's body.\\n     */\\n    body?: BodyInit | null;\\n    /**\\n     * A string indicating how the request will interact with the browser's cache to set request's cache.\\n     */\\n    cache?: RequestCache;\\n    /**\\n     * A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials.\\n     */\\n    credentials?: RequestCredentials;\\n    /**\\n     * A Headers object, an object literal, or an array of two-item arrays to set request's headers.\\n     */\\n    headers?: HeadersInit;\\n    /**\\n     * A cryptographic hash of the resource to be fetched by request. Sets request's integrity.\\n     */\\n    integrity?: string;\\n    /**\\n     * A boolean to set request's keepalive.\\n     */\\n    keepalive?: boolean;\\n    /**\\n     * A string to set request's method.\\n     */\\n    method?: string;\\n    /**\\n     * A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode.\\n     */\\n    mode?: RequestMode;\\n    /**\\n     * A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect.\\n     */\\n    redirect?: RequestRedirect;\\n    /**\\n     * A string whose value is a same-origin URL, \\\"about:client\\\", or the empty string, to set request's referrer.\\n     */\\n    referrer?: string;\\n    /**\\n     * A referrer policy to set request's referrerPolicy.\\n     */\\n    referrerPolicy?: ReferrerPolicy;\\n    /**\\n     * An AbortSignal to set request's signal.\\n     */\\n    signal?: AbortSignal | null;\\n    /**\\n     * Can only be null. Used to disassociate request from any Window.\\n     */\\n    window?: any;\\n}\\n\\ninterface ResizeObserverOptions {\\n    box?: ResizeObserverBoxOptions;\\n}\\n\\ninterface ResponseInit {\\n    headers?: HeadersInit;\\n    status?: number;\\n    statusText?: string;\\n}\\n\\ninterface RsaHashedImportParams extends Algorithm {\\n    hash: HashAlgorithmIdentifier;\\n}\\n\\ninterface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm {\\n    hash: KeyAlgorithm;\\n}\\n\\ninterface RsaHashedKeyGenParams extends RsaKeyGenParams {\\n    hash: HashAlgorithmIdentifier;\\n}\\n\\ninterface RsaKeyAlgorithm extends KeyAlgorithm {\\n    modulusLength: number;\\n    publicExponent: BigInteger;\\n}\\n\\ninterface RsaKeyGenParams extends Algorithm {\\n    modulusLength: number;\\n    publicExponent: BigInteger;\\n}\\n\\ninterface RsaOaepParams extends Algorithm {\\n    label?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n}\\n\\ninterface RsaOtherPrimesInfo {\\n    d?: string;\\n    r?: string;\\n    t?: string;\\n}\\n\\ninterface RsaPssParams extends Algorithm {\\n    saltLength: number;\\n}\\n\\ninterface SVGBoundingBoxOptions {\\n    clipped?: boolean;\\n    fill?: boolean;\\n    markers?: boolean;\\n    stroke?: boolean;\\n}\\n\\ninterface ScopedCredentialDescriptor {\\n    id: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\\n    transports?: Transport[];\\n    type: ScopedCredentialType;\\n}\\n\\ninterface ScopedCredentialOptions {\\n    excludeList?: ScopedCredentialDescriptor[];\\n    extensions?: WebAuthnExtensions;\\n    rpId?: string;\\n    timeoutSeconds?: number;\\n}\\n\\ninterface ScopedCredentialParameters {\\n    algorithm: string | Algorithm;\\n    type: ScopedCredentialType;\\n}\\n\\ninterface ScrollIntoViewOptions extends ScrollOptions {\\n    block?: ScrollLogicalPosition;\\n    inline?: ScrollLogicalPosition;\\n}\\n\\ninterface ScrollOptions {\\n    behavior?: ScrollBehavior;\\n}\\n\\ninterface ScrollToOptions extends ScrollOptions {\\n    left?: number;\\n    top?: number;\\n}\\n\\ninterface SecurityPolicyViolationEventInit extends EventInit {\\n    blockedURI?: string;\\n    columnNumber?: number;\\n    documentURI?: string;\\n    effectiveDirective?: string;\\n    lineNumber?: number;\\n    originalPolicy?: string;\\n    referrer?: string;\\n    sourceFile?: string;\\n    statusCode?: number;\\n    violatedDirective?: string;\\n}\\n\\ninterface ServiceWorkerMessageEventInit extends EventInit {\\n    data?: any;\\n    lastEventId?: string;\\n    origin?: string;\\n    ports?: MessagePort[] | null;\\n    source?: ServiceWorker | MessagePort | null;\\n}\\n\\ninterface ShadowRootInit {\\n    delegatesFocus?: boolean;\\n    mode: ShadowRootMode;\\n}\\n\\ninterface ShareData {\\n    text?: string;\\n    title?: string;\\n    url?: string;\\n}\\n\\ninterface SpeechRecognitionErrorEventInit extends EventInit {\\n    error: SpeechRecognitionErrorCode;\\n    message?: string;\\n}\\n\\ninterface SpeechRecognitionEventInit extends EventInit {\\n    resultIndex?: number;\\n    results: SpeechRecognitionResultList;\\n}\\n\\ninterface SpeechSynthesisErrorEventInit extends SpeechSynthesisEventInit {\\n    error: SpeechSynthesisErrorCode;\\n}\\n\\ninterface SpeechSynthesisEventInit extends EventInit {\\n    charIndex?: number;\\n    charLength?: number;\\n    elapsedTime?: number;\\n    name?: string;\\n    utterance: SpeechSynthesisUtterance;\\n}\\n\\ninterface StaticRangeInit {\\n    endContainer: Node;\\n    endOffset: number;\\n    startContainer: Node;\\n    startOffset: number;\\n}\\n\\ninterface StereoPannerOptions extends AudioNodeOptions {\\n    pan?: number;\\n}\\n\\ninterface StorageEstimate {\\n    quota?: number;\\n    usage?: number;\\n}\\n\\ninterface StorageEventInit extends EventInit {\\n    key?: string | null;\\n    newValue?: string | null;\\n    oldValue?: string | null;\\n    storageArea?: Storage | null;\\n    url?: string;\\n}\\n\\ninterface StoreExceptionsInformation extends ExceptionInformation {\\n    detailURI?: string | null;\\n    explanationString?: string | null;\\n    siteName?: string | null;\\n}\\n\\ninterface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation {\\n    arrayOfDomainStrings?: string[];\\n}\\n\\ninterface StreamPipeOptions {\\n    preventAbort?: boolean;\\n    preventCancel?: boolean;\\n    /**\\n     * Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.\\n     * \\n     * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.\\n     * \\n     * Errors and closures of the source and destination streams propagate as follows:\\n     * \\n     * An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination.\\n     * \\n     * An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source.\\n     * \\n     * When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error.\\n     * \\n     * If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source.\\n     * \\n     * The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set.\\n     */\\n    preventClose?: boolean;\\n    signal?: AbortSignal;\\n}\\n\\ninterface TextDecodeOptions {\\n    stream?: boolean;\\n}\\n\\ninterface TextDecoderOptions {\\n    fatal?: boolean;\\n    ignoreBOM?: boolean;\\n}\\n\\ninterface TextEncoderEncodeIntoResult {\\n    read?: number;\\n    written?: number;\\n}\\n\\ninterface TouchEventInit extends EventModifierInit {\\n    changedTouches?: Touch[];\\n    targetTouches?: Touch[];\\n    touches?: Touch[];\\n}\\n\\ninterface TouchInit {\\n    altitudeAngle?: number;\\n    azimuthAngle?: number;\\n    clientX?: number;\\n    clientY?: number;\\n    force?: number;\\n    identifier: number;\\n    pageX?: number;\\n    pageY?: number;\\n    radiusX?: number;\\n    radiusY?: number;\\n    rotationAngle?: number;\\n    screenX?: number;\\n    screenY?: number;\\n    target: EventTarget;\\n    touchType?: TouchType;\\n}\\n\\ninterface TrackEventInit extends EventInit {\\n    track?: TextTrack | null;\\n}\\n\\ninterface Transformer<I = any, O = any> {\\n    flush?: TransformerFlushCallback<O>;\\n    readableType?: undefined;\\n    start?: TransformerStartCallback<O>;\\n    transform?: TransformerTransformCallback<I, O>;\\n    writableType?: undefined;\\n}\\n\\ninterface TransitionEventInit extends EventInit {\\n    elapsedTime?: number;\\n    propertyName?: string;\\n    pseudoElement?: string;\\n}\\n\\ninterface UIEventInit extends EventInit {\\n    detail?: number;\\n    view?: Window | null;\\n}\\n\\ninterface ULongRange {\\n    max?: number;\\n    min?: number;\\n}\\n\\ninterface UnderlyingSink<W = any> {\\n    abort?: UnderlyingSinkAbortCallback;\\n    close?: UnderlyingSinkCloseCallback;\\n    start?: UnderlyingSinkStartCallback;\\n    type?: undefined;\\n    write?: UnderlyingSinkWriteCallback<W>;\\n}\\n\\ninterface UnderlyingSource<R = any> {\\n    cancel?: UnderlyingSourceCancelCallback;\\n    pull?: UnderlyingSourcePullCallback<R>;\\n    start?: UnderlyingSourceStartCallback<R>;\\n    type?: undefined;\\n}\\n\\ninterface VRDisplayEventInit extends EventInit {\\n    display: VRDisplay;\\n    reason?: VRDisplayEventReason;\\n}\\n\\ninterface VRLayer {\\n    leftBounds?: number[] | Float32Array | null;\\n    rightBounds?: number[] | Float32Array | null;\\n    source?: HTMLCanvasElement | null;\\n}\\n\\ninterface VRStageParameters {\\n    sittingToStandingTransform?: Float32Array;\\n    sizeX?: number;\\n    sizeY?: number;\\n}\\n\\ninterface WaveShaperOptions extends AudioNodeOptions {\\n    curve?: number[] | Float32Array;\\n    oversample?: OverSampleType;\\n}\\n\\ninterface WebAuthnExtensions {\\n}\\n\\ninterface WebGLContextAttributes {\\n    alpha?: boolean;\\n    antialias?: boolean;\\n    depth?: boolean;\\n    desynchronized?: boolean;\\n    failIfMajorPerformanceCaveat?: boolean;\\n    powerPreference?: WebGLPowerPreference;\\n    premultipliedAlpha?: boolean;\\n    preserveDrawingBuffer?: boolean;\\n    stencil?: boolean;\\n}\\n\\ninterface WebGLContextEventInit extends EventInit {\\n    statusMessage?: string;\\n}\\n\\ninterface WheelEventInit extends MouseEventInit {\\n    deltaMode?: number;\\n    deltaX?: number;\\n    deltaY?: number;\\n    deltaZ?: number;\\n}\\n\\ninterface WorkerOptions {\\n    credentials?: RequestCredentials;\\n    name?: string;\\n    type?: WorkerType;\\n}\\n\\ninterface WorkletOptions {\\n    credentials?: RequestCredentials;\\n}\\n\\ninterface EventListener {\\n    (evt: Event): void;\\n}\\n\\ntype XPathNSResolver = ((prefix: string | null) => string | null) | { lookupNamespaceURI(prefix: string | null): string | null; };\\n\\n/** The ANGLE_instanced_arrays extension is part of the WebGL API and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type. */\\ninterface ANGLE_instanced_arrays {\\n    drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void;\\n    drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei): void;\\n    vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint): void;\\n    readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum;\\n}\\n\\n/** A controller object that allows you to abort one or more DOM requests as and when desired. */\\ninterface AbortController {\\n    /**\\n     * Returns the AbortSignal object associated with this object.\\n     */\\n    readonly signal: AbortSignal;\\n    /**\\n     * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.\\n     */\\n    abort(): void;\\n}\\n\\ndeclare var AbortController: {\\n    prototype: AbortController;\\n    new(): AbortController;\\n};\\n\\ninterface AbortSignalEventMap {\\n    \\\"abort\\\": Event;\\n}\\n\\n/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */\\ninterface AbortSignal extends EventTarget {\\n    /**\\n     * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.\\n     */\\n    readonly aborted: boolean;\\n    onabort: ((this: AbortSignal, ev: Event) => any) | null;\\n    addEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var AbortSignal: {\\n    prototype: AbortSignal;\\n    new(): AbortSignal;\\n};\\n\\ninterface AbstractRange {\\n    /**\\n     * Returns true if range is collapsed, and false otherwise.\\n     */\\n    readonly collapsed: boolean;\\n    /**\\n     * Returns range's end node.\\n     */\\n    readonly endContainer: Node;\\n    /**\\n     * Returns range's end offset.\\n     */\\n    readonly endOffset: number;\\n    /**\\n     * Returns range's start node.\\n     */\\n    readonly startContainer: Node;\\n    /**\\n     * Returns range's start offset.\\n     */\\n    readonly startOffset: number;\\n}\\n\\ndeclare var AbstractRange: {\\n    prototype: AbstractRange;\\n    new(): AbstractRange;\\n};\\n\\ninterface AbstractWorkerEventMap {\\n    \\\"error\\\": ErrorEvent;\\n}\\n\\ninterface AbstractWorker {\\n    onerror: ((this: AbstractWorker, ev: ErrorEvent) => any) | null;\\n    addEventListener<K extends keyof AbstractWorkerEventMap>(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof AbstractWorkerEventMap>(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ninterface AesCfbParams extends Algorithm {\\n    iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n}\\n\\ninterface AesCmacParams extends Algorithm {\\n    length: number;\\n}\\n\\n/** A node able to provide real-time frequency and time-domain analysis information. It is an AudioNode that passes the audio stream unchanged from the input to the output, but allows you to take the generated data, process it, and create audio visualizations. */\\ninterface AnalyserNode extends AudioNode {\\n    fftSize: number;\\n    readonly frequencyBinCount: number;\\n    maxDecibels: number;\\n    minDecibels: number;\\n    smoothingTimeConstant: number;\\n    getByteFrequencyData(array: Uint8Array): void;\\n    getByteTimeDomainData(array: Uint8Array): void;\\n    getFloatFrequencyData(array: Float32Array): void;\\n    getFloatTimeDomainData(array: Float32Array): void;\\n}\\n\\ndeclare var AnalyserNode: {\\n    prototype: AnalyserNode;\\n    new(context: BaseAudioContext, options?: AnalyserOptions): AnalyserNode;\\n};\\n\\ninterface Animatable {\\n    animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation;\\n    getAnimations(): Animation[];\\n}\\n\\ninterface AnimationEventMap {\\n    \\\"cancel\\\": AnimationPlaybackEvent;\\n    \\\"finish\\\": AnimationPlaybackEvent;\\n}\\n\\ninterface Animation extends EventTarget {\\n    currentTime: number | null;\\n    effect: AnimationEffect | null;\\n    readonly finished: Promise<Animation>;\\n    id: string;\\n    oncancel: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null;\\n    onfinish: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null;\\n    readonly pending: boolean;\\n    readonly playState: AnimationPlayState;\\n    playbackRate: number;\\n    readonly ready: Promise<Animation>;\\n    startTime: number | null;\\n    timeline: AnimationTimeline | null;\\n    cancel(): void;\\n    finish(): void;\\n    pause(): void;\\n    play(): void;\\n    reverse(): void;\\n    updatePlaybackRate(playbackRate: number): void;\\n    addEventListener<K extends keyof AnimationEventMap>(type: K, listener: (this: Animation, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof AnimationEventMap>(type: K, listener: (this: Animation, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var Animation: {\\n    prototype: Animation;\\n    new(effect?: AnimationEffect | null, timeline?: AnimationTimeline | null): Animation;\\n};\\n\\ninterface AnimationEffect {\\n    getComputedTiming(): ComputedEffectTiming;\\n    getTiming(): EffectTiming;\\n    updateTiming(timing?: OptionalEffectTiming): void;\\n}\\n\\ndeclare var AnimationEffect: {\\n    prototype: AnimationEffect;\\n    new(): AnimationEffect;\\n};\\n\\n/** Events providing information related to animations. */\\ninterface AnimationEvent extends Event {\\n    readonly animationName: string;\\n    readonly elapsedTime: number;\\n    readonly pseudoElement: string;\\n}\\n\\ndeclare var AnimationEvent: {\\n    prototype: AnimationEvent;\\n    new(type: string, animationEventInitDict?: AnimationEventInit): AnimationEvent;\\n};\\n\\ninterface AnimationFrameProvider {\\n    cancelAnimationFrame(handle: number): void;\\n    requestAnimationFrame(callback: FrameRequestCallback): number;\\n}\\n\\ninterface AnimationPlaybackEvent extends Event {\\n    readonly currentTime: number | null;\\n    readonly timelineTime: number | null;\\n}\\n\\ndeclare var AnimationPlaybackEvent: {\\n    prototype: AnimationPlaybackEvent;\\n    new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent;\\n};\\n\\ninterface AnimationTimeline {\\n    readonly currentTime: number | null;\\n}\\n\\ndeclare var AnimationTimeline: {\\n    prototype: AnimationTimeline;\\n    new(): AnimationTimeline;\\n};\\n\\ninterface ApplicationCacheEventMap {\\n    \\\"cached\\\": Event;\\n    \\\"checking\\\": Event;\\n    \\\"downloading\\\": Event;\\n    \\\"error\\\": Event;\\n    \\\"noupdate\\\": Event;\\n    \\\"obsolete\\\": Event;\\n    \\\"progress\\\": ProgressEvent<ApplicationCache>;\\n    \\\"updateready\\\": Event;\\n}\\n\\ninterface ApplicationCache extends EventTarget {\\n    /** @deprecated */\\n    oncached: ((this: ApplicationCache, ev: Event) => any) | null;\\n    /** @deprecated */\\n    onchecking: ((this: ApplicationCache, ev: Event) => any) | null;\\n    /** @deprecated */\\n    ondownloading: ((this: ApplicationCache, ev: Event) => any) | null;\\n    /** @deprecated */\\n    onerror: ((this: ApplicationCache, ev: Event) => any) | null;\\n    /** @deprecated */\\n    onnoupdate: ((this: ApplicationCache, ev: Event) => any) | null;\\n    /** @deprecated */\\n    onobsolete: ((this: ApplicationCache, ev: Event) => any) | null;\\n    /** @deprecated */\\n    onprogress: ((this: ApplicationCache, ev: ProgressEvent<ApplicationCache>) => any) | null;\\n    /** @deprecated */\\n    onupdateready: ((this: ApplicationCache, ev: Event) => any) | null;\\n    /** @deprecated */\\n    readonly status: number;\\n    /** @deprecated */\\n    abort(): void;\\n    /** @deprecated */\\n    swapCache(): void;\\n    /** @deprecated */\\n    update(): void;\\n    readonly CHECKING: number;\\n    readonly DOWNLOADING: number;\\n    readonly IDLE: number;\\n    readonly OBSOLETE: number;\\n    readonly UNCACHED: number;\\n    readonly UPDATEREADY: number;\\n    addEventListener<K extends keyof ApplicationCacheEventMap>(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof ApplicationCacheEventMap>(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var ApplicationCache: {\\n    prototype: ApplicationCache;\\n    new(): ApplicationCache;\\n    readonly CHECKING: number;\\n    readonly DOWNLOADING: number;\\n    readonly IDLE: number;\\n    readonly OBSOLETE: number;\\n    readonly UNCACHED: number;\\n    readonly UPDATEREADY: number;\\n};\\n\\n/** A DOM element's attribute as an object. In most DOM methods, you will probably directly retrieve the attribute as a string (e.g., Element.getAttribute(), but certain functions (e.g., Element.getAttributeNode()) or means of iterating give Attr types. */\\ninterface Attr extends Node {\\n    readonly localName: string;\\n    readonly name: string;\\n    readonly namespaceURI: string | null;\\n    readonly ownerDocument: Document;\\n    readonly ownerElement: Element | null;\\n    readonly prefix: string | null;\\n    readonly specified: boolean;\\n    value: string;\\n}\\n\\ndeclare var Attr: {\\n    prototype: Attr;\\n    new(): Attr;\\n};\\n\\n/** A short audio asset residing in memory, created from an audio file using the AudioContext.decodeAudioData() method, or from raw data using AudioContext.createBuffer(). Once put into an AudioBuffer, the audio can then be played by being passed into an AudioBufferSourceNode. */\\ninterface AudioBuffer {\\n    readonly duration: number;\\n    readonly length: number;\\n    readonly numberOfChannels: number;\\n    readonly sampleRate: number;\\n    copyFromChannel(destination: Float32Array, channelNumber: number, bufferOffset?: number): void;\\n    copyToChannel(source: Float32Array, channelNumber: number, bufferOffset?: number): void;\\n    getChannelData(channel: number): Float32Array;\\n}\\n\\ndeclare var AudioBuffer: {\\n    prototype: AudioBuffer;\\n    new(options: AudioBufferOptions): AudioBuffer;\\n};\\n\\n/** An AudioScheduledSourceNode which represents an audio source consisting of in-memory audio data, stored in an AudioBuffer. It's especially useful for playing back audio which has particularly stringent timing accuracy requirements, such as for sounds that must match a specific rhythm and can be kept in memory rather than being played from disk or the network. */\\ninterface AudioBufferSourceNode extends AudioScheduledSourceNode {\\n    buffer: AudioBuffer | null;\\n    readonly detune: AudioParam;\\n    loop: boolean;\\n    loopEnd: number;\\n    loopStart: number;\\n    readonly playbackRate: AudioParam;\\n    start(when?: number, offset?: number, duration?: number): void;\\n    addEventListener<K extends keyof AudioScheduledSourceNodeEventMap>(type: K, listener: (this: AudioBufferSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof AudioScheduledSourceNodeEventMap>(type: K, listener: (this: AudioBufferSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var AudioBufferSourceNode: {\\n    prototype: AudioBufferSourceNode;\\n    new(context: BaseAudioContext, options?: AudioBufferSourceOptions): AudioBufferSourceNode;\\n};\\n\\n/** An audio-processing graph built from audio modules linked together, each represented by an AudioNode. */\\ninterface AudioContext extends BaseAudioContext {\\n    readonly baseLatency: number;\\n    readonly outputLatency: number;\\n    close(): Promise<void>;\\n    createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode;\\n    createMediaStreamDestination(): MediaStreamAudioDestinationNode;\\n    createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode;\\n    createMediaStreamTrackSource(mediaStreamTrack: MediaStreamTrack): MediaStreamTrackAudioSourceNode;\\n    getOutputTimestamp(): AudioTimestamp;\\n    resume(): Promise<void>;\\n    suspend(): Promise<void>;\\n    addEventListener<K extends keyof BaseAudioContextEventMap>(type: K, listener: (this: AudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof BaseAudioContextEventMap>(type: K, listener: (this: AudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var AudioContext: {\\n    prototype: AudioContext;\\n    new(contextOptions?: AudioContextOptions): AudioContext;\\n};\\n\\n/** AudioDestinationNode has no output (as it is the output, no more AudioNode can be linked after it in the audio graph) and one input. The number of channels in the input must be between 0 and the maxChannelCount value or an exception is raised. */\\ninterface AudioDestinationNode extends AudioNode {\\n    readonly maxChannelCount: number;\\n}\\n\\ndeclare var AudioDestinationNode: {\\n    prototype: AudioDestinationNode;\\n    new(): AudioDestinationNode;\\n};\\n\\n/** The position and orientation of the unique person listening to the audio scene, and is used in audio spatialization. All PannerNodes spatialize in relation to the AudioListener stored in the BaseAudioContext.listener attribute. */\\ninterface AudioListener {\\n    readonly forwardX: AudioParam;\\n    readonly forwardY: AudioParam;\\n    readonly forwardZ: AudioParam;\\n    readonly positionX: AudioParam;\\n    readonly positionY: AudioParam;\\n    readonly positionZ: AudioParam;\\n    readonly upX: AudioParam;\\n    readonly upY: AudioParam;\\n    readonly upZ: AudioParam;\\n    /** @deprecated */\\n    setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void;\\n    /** @deprecated */\\n    setPosition(x: number, y: number, z: number): void;\\n}\\n\\ndeclare var AudioListener: {\\n    prototype: AudioListener;\\n    new(): AudioListener;\\n};\\n\\n/** A generic interface for representing an audio processing module. Examples include: */\\ninterface AudioNode extends EventTarget {\\n    channelCount: number;\\n    channelCountMode: ChannelCountMode;\\n    channelInterpretation: ChannelInterpretation;\\n    readonly context: BaseAudioContext;\\n    readonly numberOfInputs: number;\\n    readonly numberOfOutputs: number;\\n    connect(destinationNode: AudioNode, output?: number, input?: number): AudioNode;\\n    connect(destinationParam: AudioParam, output?: number): void;\\n    disconnect(): void;\\n    disconnect(output: number): void;\\n    disconnect(destinationNode: AudioNode): void;\\n    disconnect(destinationNode: AudioNode, output: number): void;\\n    disconnect(destinationNode: AudioNode, output: number, input: number): void;\\n    disconnect(destinationParam: AudioParam): void;\\n    disconnect(destinationParam: AudioParam, output: number): void;\\n}\\n\\ndeclare var AudioNode: {\\n    prototype: AudioNode;\\n    new(): AudioNode;\\n};\\n\\n/** The Web Audio API's AudioParam interface represents an audio-related parameter, usually a parameter of an AudioNode (such as GainNode.gain). */\\ninterface AudioParam {\\n    automationRate: AutomationRate;\\n    readonly defaultValue: number;\\n    readonly maxValue: number;\\n    readonly minValue: number;\\n    value: number;\\n    cancelAndHoldAtTime(cancelTime: number): AudioParam;\\n    cancelScheduledValues(cancelTime: number): AudioParam;\\n    exponentialRampToValueAtTime(value: number, endTime: number): AudioParam;\\n    linearRampToValueAtTime(value: number, endTime: number): AudioParam;\\n    setTargetAtTime(target: number, startTime: number, timeConstant: number): AudioParam;\\n    setValueAtTime(value: number, startTime: number): AudioParam;\\n    setValueCurveAtTime(values: number[] | Float32Array, startTime: number, duration: number): AudioParam;\\n}\\n\\ndeclare var AudioParam: {\\n    prototype: AudioParam;\\n    new(): AudioParam;\\n};\\n\\ninterface AudioParamMap {\\n    forEach(callbackfn: (value: AudioParam, key: string, parent: AudioParamMap) => void, thisArg?: any): void;\\n}\\n\\ndeclare var AudioParamMap: {\\n    prototype: AudioParamMap;\\n    new(): AudioParamMap;\\n};\\n\\n/** The Web Audio API events that occur when a ScriptProcessorNode input buffer is ready to be processed.\\n * @deprecated As of the August 29 2014 Web Audio API spec publication, this feature has been marked as deprecated, and is soon to be replaced by AudioWorklet.\\n */\\ninterface AudioProcessingEvent extends Event {\\n    readonly inputBuffer: AudioBuffer;\\n    readonly outputBuffer: AudioBuffer;\\n    readonly playbackTime: number;\\n}\\n\\ndeclare var AudioProcessingEvent: {\\n    prototype: AudioProcessingEvent;\\n    new(type: string, eventInitDict: AudioProcessingEventInit): AudioProcessingEvent;\\n};\\n\\ninterface AudioScheduledSourceNodeEventMap {\\n    \\\"ended\\\": Event;\\n}\\n\\ninterface AudioScheduledSourceNode extends AudioNode {\\n    onended: ((this: AudioScheduledSourceNode, ev: Event) => any) | null;\\n    start(when?: number): void;\\n    stop(when?: number): void;\\n    addEventListener<K extends keyof AudioScheduledSourceNodeEventMap>(type: K, listener: (this: AudioScheduledSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof AudioScheduledSourceNodeEventMap>(type: K, listener: (this: AudioScheduledSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var AudioScheduledSourceNode: {\\n    prototype: AudioScheduledSourceNode;\\n    new(): AudioScheduledSourceNode;\\n};\\n\\ninterface AudioWorklet extends Worklet {\\n}\\n\\ndeclare var AudioWorklet: {\\n    prototype: AudioWorklet;\\n    new(): AudioWorklet;\\n};\\n\\ninterface AudioWorkletNodeEventMap {\\n    \\\"processorerror\\\": Event;\\n}\\n\\ninterface AudioWorkletNode extends AudioNode {\\n    onprocessorerror: ((this: AudioWorkletNode, ev: Event) => any) | null;\\n    readonly parameters: AudioParamMap;\\n    readonly port: MessagePort;\\n    addEventListener<K extends keyof AudioWorkletNodeEventMap>(type: K, listener: (this: AudioWorkletNode, ev: AudioWorkletNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof AudioWorkletNodeEventMap>(type: K, listener: (this: AudioWorkletNode, ev: AudioWorkletNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var AudioWorkletNode: {\\n    prototype: AudioWorkletNode;\\n    new(context: BaseAudioContext, name: string, options?: AudioWorkletNodeOptions): AudioWorkletNode;\\n};\\n\\ninterface AuthenticatorAssertionResponse extends AuthenticatorResponse {\\n    readonly authenticatorData: ArrayBuffer;\\n    readonly signature: ArrayBuffer;\\n    readonly userHandle: ArrayBuffer | null;\\n}\\n\\ndeclare var AuthenticatorAssertionResponse: {\\n    prototype: AuthenticatorAssertionResponse;\\n    new(): AuthenticatorAssertionResponse;\\n};\\n\\ninterface AuthenticatorAttestationResponse extends AuthenticatorResponse {\\n    readonly attestationObject: ArrayBuffer;\\n}\\n\\ndeclare var AuthenticatorAttestationResponse: {\\n    prototype: AuthenticatorAttestationResponse;\\n    new(): AuthenticatorAttestationResponse;\\n};\\n\\ninterface AuthenticatorResponse {\\n    readonly clientDataJSON: ArrayBuffer;\\n}\\n\\ndeclare var AuthenticatorResponse: {\\n    prototype: AuthenticatorResponse;\\n    new(): AuthenticatorResponse;\\n};\\n\\ninterface BarProp {\\n    readonly visible: boolean;\\n}\\n\\ndeclare var BarProp: {\\n    prototype: BarProp;\\n    new(): BarProp;\\n};\\n\\ninterface BaseAudioContextEventMap {\\n    \\\"statechange\\\": Event;\\n}\\n\\ninterface BaseAudioContext extends EventTarget {\\n    readonly audioWorklet: AudioWorklet;\\n    readonly currentTime: number;\\n    readonly destination: AudioDestinationNode;\\n    readonly listener: AudioListener;\\n    onstatechange: ((this: BaseAudioContext, ev: Event) => any) | null;\\n    readonly sampleRate: number;\\n    readonly state: AudioContextState;\\n    createAnalyser(): AnalyserNode;\\n    createBiquadFilter(): BiquadFilterNode;\\n    createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer;\\n    createBufferSource(): AudioBufferSourceNode;\\n    createChannelMerger(numberOfInputs?: number): ChannelMergerNode;\\n    createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode;\\n    createConstantSource(): ConstantSourceNode;\\n    createConvolver(): ConvolverNode;\\n    createDelay(maxDelayTime?: number): DelayNode;\\n    createDynamicsCompressor(): DynamicsCompressorNode;\\n    createGain(): GainNode;\\n    createIIRFilter(feedforward: number[], feedback: number[]): IIRFilterNode;\\n    createOscillator(): OscillatorNode;\\n    createPanner(): PannerNode;\\n    createPeriodicWave(real: number[] | Float32Array, imag: number[] | Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave;\\n    createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode;\\n    createStereoPanner(): StereoPannerNode;\\n    createWaveShaper(): WaveShaperNode;\\n    decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback | null, errorCallback?: DecodeErrorCallback | null): Promise<AudioBuffer>;\\n    addEventListener<K extends keyof BaseAudioContextEventMap>(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof BaseAudioContextEventMap>(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var BaseAudioContext: {\\n    prototype: BaseAudioContext;\\n    new(): BaseAudioContext;\\n};\\n\\n/** The beforeunload event is fired when the window, the document and its resources are about to be unloaded. */\\ninterface BeforeUnloadEvent extends Event {\\n    returnValue: any;\\n}\\n\\ndeclare var BeforeUnloadEvent: {\\n    prototype: BeforeUnloadEvent;\\n    new(): BeforeUnloadEvent;\\n};\\n\\ninterface BhxBrowser {\\n    readonly lastError: DOMException;\\n    checkMatchesGlobExpression(pattern: string, value: string): boolean;\\n    checkMatchesUriExpression(pattern: string, value: string): boolean;\\n    clearLastError(): void;\\n    currentWindowId(): number;\\n    fireExtensionApiTelemetry(functionName: string, isSucceeded: boolean, isSupported: boolean, errorString: string): void;\\n    genericFunction(functionId: number, destination: any, parameters?: string, callbackId?: number): void;\\n    genericSynchronousFunction(functionId: number, parameters?: string): string;\\n    getExtensionId(): string;\\n    getThisAddress(): any;\\n    registerGenericFunctionCallbackHandler(callbackHandler: Function): void;\\n    registerGenericListenerHandler(eventHandler: Function): void;\\n    setLastError(parameters: string): void;\\n    webPlatformGenericFunction(destination: any, parameters?: string, callbackId?: number): void;\\n}\\n\\ndeclare var BhxBrowser: {\\n    prototype: BhxBrowser;\\n    new(): BhxBrowser;\\n};\\n\\n/** A simple low-order filter, and is created using the AudioContext.createBiquadFilter() method. It is an AudioNode that can represent different kinds of filters, tone control devices, and graphic equalizers. */\\ninterface BiquadFilterNode extends AudioNode {\\n    readonly Q: AudioParam;\\n    readonly detune: AudioParam;\\n    readonly frequency: AudioParam;\\n    readonly gain: AudioParam;\\n    type: BiquadFilterType;\\n    getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;\\n}\\n\\ndeclare var BiquadFilterNode: {\\n    prototype: BiquadFilterNode;\\n    new(context: BaseAudioContext, options?: BiquadFilterOptions): BiquadFilterNode;\\n};\\n\\n/** A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system. */\\ninterface Blob {\\n    readonly size: number;\\n    readonly type: string;\\n    arrayBuffer(): Promise<ArrayBuffer>;\\n    slice(start?: number, end?: number, contentType?: string): Blob;\\n    stream(): ReadableStream;\\n    text(): Promise<string>;\\n}\\n\\ndeclare var Blob: {\\n    prototype: Blob;\\n    new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;\\n};\\n\\ninterface Body {\\n    readonly body: ReadableStream<Uint8Array> | null;\\n    readonly bodyUsed: boolean;\\n    arrayBuffer(): Promise<ArrayBuffer>;\\n    blob(): Promise<Blob>;\\n    formData(): Promise<FormData>;\\n    json(): Promise<any>;\\n    text(): Promise<string>;\\n}\\n\\ninterface BroadcastChannelEventMap {\\n    \\\"message\\\": MessageEvent;\\n    \\\"messageerror\\\": MessageEvent;\\n}\\n\\ninterface BroadcastChannel extends EventTarget {\\n    /**\\n     * Returns the channel name (as passed to the constructor).\\n     */\\n    readonly name: string;\\n    onmessage: ((this: BroadcastChannel, ev: MessageEvent) => any) | null;\\n    onmessageerror: ((this: BroadcastChannel, ev: MessageEvent) => any) | null;\\n    /**\\n     * Closes the BroadcastChannel object, opening it up to garbage collection.\\n     */\\n    close(): void;\\n    /**\\n     * Sends the given message to other BroadcastChannel objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays.\\n     */\\n    postMessage(message: any): void;\\n    addEventListener<K extends keyof BroadcastChannelEventMap>(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof BroadcastChannelEventMap>(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var BroadcastChannel: {\\n    prototype: BroadcastChannel;\\n    new(name: string): BroadcastChannel;\\n};\\n\\n/** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */\\ninterface ByteLengthQueuingStrategy extends QueuingStrategy<ArrayBufferView> {\\n    readonly highWaterMark: number;\\n    readonly size: QueuingStrategySize<ArrayBufferView>;\\n}\\n\\ndeclare var ByteLengthQueuingStrategy: {\\n    prototype: ByteLengthQueuingStrategy;\\n    new(init: QueuingStrategyInit): ByteLengthQueuingStrategy;\\n};\\n\\n/** A CDATA section that can be used within XML to include extended portions of unescaped text. The symbols < and & don’t need escaping as they normally do when inside a CDATA section. */\\ninterface CDATASection extends Text {\\n}\\n\\ndeclare var CDATASection: {\\n    prototype: CDATASection;\\n    new(): CDATASection;\\n};\\n\\n/** A single condition CSS at-rule, which consists of a condition and a statement block. It is a child of CSSGroupingRule. */\\ninterface CSSConditionRule extends CSSGroupingRule {\\n    conditionText: string;\\n}\\n\\ndeclare var CSSConditionRule: {\\n    prototype: CSSConditionRule;\\n    new(): CSSConditionRule;\\n};\\n\\ninterface CSSFontFaceRule extends CSSRule {\\n    readonly style: CSSStyleDeclaration;\\n}\\n\\ndeclare var CSSFontFaceRule: {\\n    prototype: CSSFontFaceRule;\\n    new(): CSSFontFaceRule;\\n};\\n\\n/** Any CSS at-rule that contains other rules nested within it. */\\ninterface CSSGroupingRule extends CSSRule {\\n    readonly cssRules: CSSRuleList;\\n    deleteRule(index: number): void;\\n    insertRule(rule: string, index?: number): number;\\n}\\n\\ndeclare var CSSGroupingRule: {\\n    prototype: CSSGroupingRule;\\n    new(): CSSGroupingRule;\\n};\\n\\ninterface CSSImportRule extends CSSRule {\\n    readonly href: string;\\n    readonly media: MediaList;\\n    readonly styleSheet: CSSStyleSheet;\\n}\\n\\ndeclare var CSSImportRule: {\\n    prototype: CSSImportRule;\\n    new(): CSSImportRule;\\n};\\n\\n/** An object representing a set of style for a given keyframe. It corresponds to the contains of a single keyframe of a @keyframes at-rule. It implements the CSSRule interface with a type value of 8 (CSSRule.KEYFRAME_RULE). */\\ninterface CSSKeyframeRule extends CSSRule {\\n    keyText: string;\\n    readonly style: CSSStyleDeclaration;\\n}\\n\\ndeclare var CSSKeyframeRule: {\\n    prototype: CSSKeyframeRule;\\n    new(): CSSKeyframeRule;\\n};\\n\\n/** An object representing a complete set of keyframes for a CSS animation. It corresponds to the contains of a whole @keyframes at-rule. It implements the CSSRule interface with a type value of 7 (CSSRule.KEYFRAMES_RULE). */\\ninterface CSSKeyframesRule extends CSSRule {\\n    readonly cssRules: CSSRuleList;\\n    name: string;\\n    appendRule(rule: string): void;\\n    deleteRule(select: string): void;\\n    findRule(select: string): CSSKeyframeRule | null;\\n}\\n\\ndeclare var CSSKeyframesRule: {\\n    prototype: CSSKeyframesRule;\\n    new(): CSSKeyframesRule;\\n};\\n\\n/** A single CSS @media rule. It implements the CSSConditionRule interface, and therefore the CSSGroupingRule and the CSSRule interface with a type value of 4 (CSSRule.MEDIA_RULE). */\\ninterface CSSMediaRule extends CSSConditionRule {\\n    readonly media: MediaList;\\n}\\n\\ndeclare var CSSMediaRule: {\\n    prototype: CSSMediaRule;\\n    new(): CSSMediaRule;\\n};\\n\\n/** An object representing a single CSS @namespace at-rule. It implements the CSSRule interface, with a type value of 10 (CSSRule.NAMESPACE_RULE). */\\ninterface CSSNamespaceRule extends CSSRule {\\n    readonly namespaceURI: string;\\n    readonly prefix: string;\\n}\\n\\ndeclare var CSSNamespaceRule: {\\n    prototype: CSSNamespaceRule;\\n    new(): CSSNamespaceRule;\\n};\\n\\n/** CSSPageRule is an interface representing a single CSS @page rule. It implements the CSSRule interface with a type value of 6 (CSSRule.PAGE_RULE). */\\ninterface CSSPageRule extends CSSGroupingRule {\\n    selectorText: string;\\n    readonly style: CSSStyleDeclaration;\\n}\\n\\ndeclare var CSSPageRule: {\\n    prototype: CSSPageRule;\\n    new(): CSSPageRule;\\n};\\n\\n/** A single CSS rule. There are several types of rules, listed in the Type constants section below. */\\ninterface CSSRule {\\n    cssText: string;\\n    readonly parentRule: CSSRule | null;\\n    readonly parentStyleSheet: CSSStyleSheet | null;\\n    readonly type: number;\\n    readonly CHARSET_RULE: number;\\n    readonly FONT_FACE_RULE: number;\\n    readonly IMPORT_RULE: number;\\n    readonly KEYFRAMES_RULE: number;\\n    readonly KEYFRAME_RULE: number;\\n    readonly MEDIA_RULE: number;\\n    readonly NAMESPACE_RULE: number;\\n    readonly PAGE_RULE: number;\\n    readonly STYLE_RULE: number;\\n    readonly SUPPORTS_RULE: number;\\n}\\n\\ndeclare var CSSRule: {\\n    prototype: CSSRule;\\n    new(): CSSRule;\\n    readonly CHARSET_RULE: number;\\n    readonly FONT_FACE_RULE: number;\\n    readonly IMPORT_RULE: number;\\n    readonly KEYFRAMES_RULE: number;\\n    readonly KEYFRAME_RULE: number;\\n    readonly MEDIA_RULE: number;\\n    readonly NAMESPACE_RULE: number;\\n    readonly PAGE_RULE: number;\\n    readonly STYLE_RULE: number;\\n    readonly SUPPORTS_RULE: number;\\n};\\n\\n/** A CSSRuleList is an (indirect-modify only) array-like object containing an ordered collection of CSSRule objects. */\\ninterface CSSRuleList {\\n    readonly length: number;\\n    item(index: number): CSSRule | null;\\n    [index: number]: CSSRule;\\n}\\n\\ndeclare var CSSRuleList: {\\n    prototype: CSSRuleList;\\n    new(): CSSRuleList;\\n};\\n\\n/** An object that is a CSS declaration block, and exposes style information and various style-related methods and properties. */\\ninterface CSSStyleDeclaration {\\n    alignContent: string;\\n    alignItems: string;\\n    alignSelf: string;\\n    alignmentBaseline: string;\\n    all: string;\\n    animation: string;\\n    animationDelay: string;\\n    animationDirection: string;\\n    animationDuration: string;\\n    animationFillMode: string;\\n    animationIterationCount: string;\\n    animationName: string;\\n    animationPlayState: string;\\n    animationTimingFunction: string;\\n    backfaceVisibility: string;\\n    background: string;\\n    backgroundAttachment: string;\\n    backgroundClip: string;\\n    backgroundColor: string;\\n    backgroundImage: string;\\n    backgroundOrigin: string;\\n    backgroundPosition: string;\\n    backgroundPositionX: string;\\n    backgroundPositionY: string;\\n    backgroundRepeat: string;\\n    backgroundSize: string;\\n    baselineShift: string;\\n    blockSize: string;\\n    border: string;\\n    borderBlockEnd: string;\\n    borderBlockEndColor: string;\\n    borderBlockEndStyle: string;\\n    borderBlockEndWidth: string;\\n    borderBlockStart: string;\\n    borderBlockStartColor: string;\\n    borderBlockStartStyle: string;\\n    borderBlockStartWidth: string;\\n    borderBottom: string;\\n    borderBottomColor: string;\\n    borderBottomLeftRadius: string;\\n    borderBottomRightRadius: string;\\n    borderBottomStyle: string;\\n    borderBottomWidth: string;\\n    borderCollapse: string;\\n    borderColor: string;\\n    borderImage: string;\\n    borderImageOutset: string;\\n    borderImageRepeat: string;\\n    borderImageSlice: string;\\n    borderImageSource: string;\\n    borderImageWidth: string;\\n    borderInlineEnd: string;\\n    borderInlineEndColor: string;\\n    borderInlineEndStyle: string;\\n    borderInlineEndWidth: string;\\n    borderInlineStart: string;\\n    borderInlineStartColor: string;\\n    borderInlineStartStyle: string;\\n    borderInlineStartWidth: string;\\n    borderLeft: string;\\n    borderLeftColor: string;\\n    borderLeftStyle: string;\\n    borderLeftWidth: string;\\n    borderRadius: string;\\n    borderRight: string;\\n    borderRightColor: string;\\n    borderRightStyle: string;\\n    borderRightWidth: string;\\n    borderSpacing: string;\\n    borderStyle: string;\\n    borderTop: string;\\n    borderTopColor: string;\\n    borderTopLeftRadius: string;\\n    borderTopRightRadius: string;\\n    borderTopStyle: string;\\n    borderTopWidth: string;\\n    borderWidth: string;\\n    bottom: string;\\n    boxShadow: string;\\n    boxSizing: string;\\n    breakAfter: string;\\n    breakBefore: string;\\n    breakInside: string;\\n    captionSide: string;\\n    caretColor: string;\\n    clear: string;\\n    clip: string;\\n    clipPath: string;\\n    clipRule: string;\\n    color: string;\\n    colorInterpolation: string;\\n    colorInterpolationFilters: string;\\n    columnCount: string;\\n    columnFill: string;\\n    columnGap: string;\\n    columnRule: string;\\n    columnRuleColor: string;\\n    columnRuleStyle: string;\\n    columnRuleWidth: string;\\n    columnSpan: string;\\n    columnWidth: string;\\n    columns: string;\\n    content: string;\\n    counterIncrement: string;\\n    counterReset: string;\\n    cssFloat: string;\\n    cssText: string;\\n    cursor: string;\\n    direction: string;\\n    display: string;\\n    dominantBaseline: string;\\n    emptyCells: string;\\n    fill: string;\\n    fillOpacity: string;\\n    fillRule: string;\\n    filter: string;\\n    flex: string;\\n    flexBasis: string;\\n    flexDirection: string;\\n    flexFlow: string;\\n    flexGrow: string;\\n    flexShrink: string;\\n    flexWrap: string;\\n    float: string;\\n    floodColor: string;\\n    floodOpacity: string;\\n    font: string;\\n    fontFamily: string;\\n    fontFeatureSettings: string;\\n    fontKerning: string;\\n    fontSize: string;\\n    fontSizeAdjust: string;\\n    fontStretch: string;\\n    fontStyle: string;\\n    fontSynthesis: string;\\n    fontVariant: string;\\n    fontVariantCaps: string;\\n    fontVariantEastAsian: string;\\n    fontVariantLigatures: string;\\n    fontVariantNumeric: string;\\n    fontVariantPosition: string;\\n    fontWeight: string;\\n    gap: string;\\n    glyphOrientationVertical: string;\\n    grid: string;\\n    gridArea: string;\\n    gridAutoColumns: string;\\n    gridAutoFlow: string;\\n    gridAutoRows: string;\\n    gridColumn: string;\\n    gridColumnEnd: string;\\n    gridColumnGap: string;\\n    gridColumnStart: string;\\n    gridGap: string;\\n    gridRow: string;\\n    gridRowEnd: string;\\n    gridRowGap: string;\\n    gridRowStart: string;\\n    gridTemplate: string;\\n    gridTemplateAreas: string;\\n    gridTemplateColumns: string;\\n    gridTemplateRows: string;\\n    height: string;\\n    hyphens: string;\\n    imageOrientation: string;\\n    imageRendering: string;\\n    inlineSize: string;\\n    justifyContent: string;\\n    justifyItems: string;\\n    justifySelf: string;\\n    left: string;\\n    readonly length: number;\\n    letterSpacing: string;\\n    lightingColor: string;\\n    lineBreak: string;\\n    lineHeight: string;\\n    listStyle: string;\\n    listStyleImage: string;\\n    listStylePosition: string;\\n    listStyleType: string;\\n    margin: string;\\n    marginBlockEnd: string;\\n    marginBlockStart: string;\\n    marginBottom: string;\\n    marginInlineEnd: string;\\n    marginInlineStart: string;\\n    marginLeft: string;\\n    marginRight: string;\\n    marginTop: string;\\n    marker: string;\\n    markerEnd: string;\\n    markerMid: string;\\n    markerStart: string;\\n    mask: string;\\n    maskComposite: string;\\n    maskImage: string;\\n    maskPosition: string;\\n    maskRepeat: string;\\n    maskSize: string;\\n    maskType: string;\\n    maxBlockSize: string;\\n    maxHeight: string;\\n    maxInlineSize: string;\\n    maxWidth: string;\\n    minBlockSize: string;\\n    minHeight: string;\\n    minInlineSize: string;\\n    minWidth: string;\\n    objectFit: string;\\n    objectPosition: string;\\n    opacity: string;\\n    order: string;\\n    orphans: string;\\n    outline: string;\\n    outlineColor: string;\\n    outlineOffset: string;\\n    outlineStyle: string;\\n    outlineWidth: string;\\n    overflow: string;\\n    overflowAnchor: string;\\n    overflowWrap: string;\\n    overflowX: string;\\n    overflowY: string;\\n    overscrollBehavior: string;\\n    overscrollBehaviorBlock: string;\\n    overscrollBehaviorInline: string;\\n    overscrollBehaviorX: string;\\n    overscrollBehaviorY: string;\\n    padding: string;\\n    paddingBlockEnd: string;\\n    paddingBlockStart: string;\\n    paddingBottom: string;\\n    paddingInlineEnd: string;\\n    paddingInlineStart: string;\\n    paddingLeft: string;\\n    paddingRight: string;\\n    paddingTop: string;\\n    pageBreakAfter: string;\\n    pageBreakBefore: string;\\n    pageBreakInside: string;\\n    paintOrder: string;\\n    readonly parentRule: CSSRule | null;\\n    perspective: string;\\n    perspectiveOrigin: string;\\n    placeContent: string;\\n    placeItems: string;\\n    placeSelf: string;\\n    pointerEvents: string;\\n    position: string;\\n    quotes: string;\\n    resize: string;\\n    right: string;\\n    rotate: string;\\n    rowGap: string;\\n    rubyAlign: string;\\n    rubyPosition: string;\\n    scale: string;\\n    scrollBehavior: string;\\n    shapeRendering: string;\\n    stopColor: string;\\n    stopOpacity: string;\\n    stroke: string;\\n    strokeDasharray: string;\\n    strokeDashoffset: string;\\n    strokeLinecap: string;\\n    strokeLinejoin: string;\\n    strokeMiterlimit: string;\\n    strokeOpacity: string;\\n    strokeWidth: string;\\n    tabSize: string;\\n    tableLayout: string;\\n    textAlign: string;\\n    textAlignLast: string;\\n    textAnchor: string;\\n    textCombineUpright: string;\\n    textDecoration: string;\\n    textDecorationColor: string;\\n    textDecorationLine: string;\\n    textDecorationStyle: string;\\n    textEmphasis: string;\\n    textEmphasisColor: string;\\n    textEmphasisPosition: string;\\n    textEmphasisStyle: string;\\n    textIndent: string;\\n    textJustify: string;\\n    textOrientation: string;\\n    textOverflow: string;\\n    textRendering: string;\\n    textShadow: string;\\n    textTransform: string;\\n    textUnderlinePosition: string;\\n    top: string;\\n    touchAction: string;\\n    transform: string;\\n    transformBox: string;\\n    transformOrigin: string;\\n    transformStyle: string;\\n    transition: string;\\n    transitionDelay: string;\\n    transitionDuration: string;\\n    transitionProperty: string;\\n    transitionTimingFunction: string;\\n    translate: string;\\n    unicodeBidi: string;\\n    userSelect: string;\\n    verticalAlign: string;\\n    visibility: string;\\n    /** @deprecated */\\n    webkitAlignContent: string;\\n    /** @deprecated */\\n    webkitAlignItems: string;\\n    /** @deprecated */\\n    webkitAlignSelf: string;\\n    /** @deprecated */\\n    webkitAnimation: string;\\n    /** @deprecated */\\n    webkitAnimationDelay: string;\\n    /** @deprecated */\\n    webkitAnimationDirection: string;\\n    /** @deprecated */\\n    webkitAnimationDuration: string;\\n    /** @deprecated */\\n    webkitAnimationFillMode: string;\\n    /** @deprecated */\\n    webkitAnimationIterationCount: string;\\n    /** @deprecated */\\n    webkitAnimationName: string;\\n    /** @deprecated */\\n    webkitAnimationPlayState: string;\\n    /** @deprecated */\\n    webkitAnimationTimingFunction: string;\\n    /** @deprecated */\\n    webkitAppearance: string;\\n    /** @deprecated */\\n    webkitBackfaceVisibility: string;\\n    /** @deprecated */\\n    webkitBackgroundClip: string;\\n    /** @deprecated */\\n    webkitBackgroundOrigin: string;\\n    /** @deprecated */\\n    webkitBackgroundSize: string;\\n    /** @deprecated */\\n    webkitBorderBottomLeftRadius: string;\\n    /** @deprecated */\\n    webkitBorderBottomRightRadius: string;\\n    /** @deprecated */\\n    webkitBorderRadius: string;\\n    /** @deprecated */\\n    webkitBorderTopLeftRadius: string;\\n    /** @deprecated */\\n    webkitBorderTopRightRadius: string;\\n    /** @deprecated */\\n    webkitBoxAlign: string;\\n    /** @deprecated */\\n    webkitBoxFlex: string;\\n    /** @deprecated */\\n    webkitBoxOrdinalGroup: string;\\n    /** @deprecated */\\n    webkitBoxOrient: string;\\n    /** @deprecated */\\n    webkitBoxPack: string;\\n    /** @deprecated */\\n    webkitBoxShadow: string;\\n    /** @deprecated */\\n    webkitBoxSizing: string;\\n    /** @deprecated */\\n    webkitFilter: string;\\n    /** @deprecated */\\n    webkitFlex: string;\\n    /** @deprecated */\\n    webkitFlexBasis: string;\\n    /** @deprecated */\\n    webkitFlexDirection: string;\\n    /** @deprecated */\\n    webkitFlexFlow: string;\\n    /** @deprecated */\\n    webkitFlexGrow: string;\\n    /** @deprecated */\\n    webkitFlexShrink: string;\\n    /** @deprecated */\\n    webkitFlexWrap: string;\\n    /** @deprecated */\\n    webkitJustifyContent: string;\\n    webkitLineClamp: string;\\n    /** @deprecated */\\n    webkitMask: string;\\n    /** @deprecated */\\n    webkitMaskBoxImage: string;\\n    /** @deprecated */\\n    webkitMaskBoxImageOutset: string;\\n    /** @deprecated */\\n    webkitMaskBoxImageRepeat: string;\\n    /** @deprecated */\\n    webkitMaskBoxImageSlice: string;\\n    /** @deprecated */\\n    webkitMaskBoxImageSource: string;\\n    /** @deprecated */\\n    webkitMaskBoxImageWidth: string;\\n    /** @deprecated */\\n    webkitMaskClip: string;\\n    /** @deprecated */\\n    webkitMaskComposite: string;\\n    /** @deprecated */\\n    webkitMaskImage: string;\\n    /** @deprecated */\\n    webkitMaskOrigin: string;\\n    /** @deprecated */\\n    webkitMaskPosition: string;\\n    /** @deprecated */\\n    webkitMaskRepeat: string;\\n    /** @deprecated */\\n    webkitMaskSize: string;\\n    /** @deprecated */\\n    webkitOrder: string;\\n    /** @deprecated */\\n    webkitPerspective: string;\\n    /** @deprecated */\\n    webkitPerspectiveOrigin: string;\\n    webkitTapHighlightColor: string;\\n    /** @deprecated */\\n    webkitTextFillColor: string;\\n    /** @deprecated */\\n    webkitTextSizeAdjust: string;\\n    /** @deprecated */\\n    webkitTextStroke: string;\\n    /** @deprecated */\\n    webkitTextStrokeColor: string;\\n    /** @deprecated */\\n    webkitTextStrokeWidth: string;\\n    /** @deprecated */\\n    webkitTransform: string;\\n    /** @deprecated */\\n    webkitTransformOrigin: string;\\n    /** @deprecated */\\n    webkitTransformStyle: string;\\n    /** @deprecated */\\n    webkitTransition: string;\\n    /** @deprecated */\\n    webkitTransitionDelay: string;\\n    /** @deprecated */\\n    webkitTransitionDuration: string;\\n    /** @deprecated */\\n    webkitTransitionProperty: string;\\n    /** @deprecated */\\n    webkitTransitionTimingFunction: string;\\n    /** @deprecated */\\n    webkitUserSelect: string;\\n    whiteSpace: string;\\n    widows: string;\\n    width: string;\\n    willChange: string;\\n    wordBreak: string;\\n    wordSpacing: string;\\n    wordWrap: string;\\n    writingMode: string;\\n    zIndex: string;\\n    /** @deprecated */\\n    zoom: string;\\n    getPropertyPriority(property: string): string;\\n    getPropertyValue(property: string): string;\\n    item(index: number): string;\\n    removeProperty(property: string): string;\\n    setProperty(property: string, value: string | null, priority?: string): void;\\n    [index: number]: string;\\n}\\n\\ndeclare var CSSStyleDeclaration: {\\n    prototype: CSSStyleDeclaration;\\n    new(): CSSStyleDeclaration;\\n};\\n\\n/** CSSStyleRule represents a single CSS style rule. It implements the CSSRule interface with a type value of 1 (CSSRule.STYLE_RULE). */\\ninterface CSSStyleRule extends CSSRule {\\n    selectorText: string;\\n    readonly style: CSSStyleDeclaration;\\n}\\n\\ndeclare var CSSStyleRule: {\\n    prototype: CSSStyleRule;\\n    new(): CSSStyleRule;\\n};\\n\\n/** A single CSS style sheet. It inherits properties and methods from its parent, StyleSheet. */\\ninterface CSSStyleSheet extends StyleSheet {\\n    readonly cssRules: CSSRuleList;\\n    readonly ownerRule: CSSRule | null;\\n    readonly rules: CSSRuleList;\\n    addRule(selector?: string, style?: string, index?: number): number;\\n    deleteRule(index: number): void;\\n    insertRule(rule: string, index?: number): number;\\n    removeRule(index?: number): void;\\n}\\n\\ndeclare var CSSStyleSheet: {\\n    prototype: CSSStyleSheet;\\n    new(): CSSStyleSheet;\\n};\\n\\n/** An object representing a single CSS @supports at-rule. It implements the CSSConditionRule interface, and therefore the CSSRule and CSSGroupingRule interfaces with a type value of 12 (CSSRule.SUPPORTS_RULE). */\\ninterface CSSSupportsRule extends CSSConditionRule {\\n}\\n\\ndeclare var CSSSupportsRule: {\\n    prototype: CSSSupportsRule;\\n    new(): CSSSupportsRule;\\n};\\n\\n/** Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. */\\ninterface Cache {\\n    add(request: RequestInfo): Promise<void>;\\n    addAll(requests: RequestInfo[]): Promise<void>;\\n    delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;\\n    keys(request?: RequestInfo, options?: CacheQueryOptions): Promise<ReadonlyArray<Request>>;\\n    match(request: RequestInfo, options?: CacheQueryOptions): Promise<Response | undefined>;\\n    matchAll(request?: RequestInfo, options?: CacheQueryOptions): Promise<ReadonlyArray<Response>>;\\n    put(request: RequestInfo, response: Response): Promise<void>;\\n}\\n\\ndeclare var Cache: {\\n    prototype: Cache;\\n    new(): Cache;\\n};\\n\\n/** The storage for Cache objects. */\\ninterface CacheStorage {\\n    delete(cacheName: string): Promise<boolean>;\\n    has(cacheName: string): Promise<boolean>;\\n    keys(): Promise<string[]>;\\n    match(request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response | undefined>;\\n    open(cacheName: string): Promise<Cache>;\\n}\\n\\ndeclare var CacheStorage: {\\n    prototype: CacheStorage;\\n    new(): CacheStorage;\\n};\\n\\ninterface CanvasCompositing {\\n    globalAlpha: number;\\n    globalCompositeOperation: string;\\n}\\n\\ninterface CanvasDrawImage {\\n    drawImage(image: CanvasImageSource, dx: number, dy: number): void;\\n    drawImage(image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number): void;\\n    drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void;\\n}\\n\\ninterface CanvasDrawPath {\\n    beginPath(): void;\\n    clip(fillRule?: CanvasFillRule): void;\\n    clip(path: Path2D, fillRule?: CanvasFillRule): void;\\n    fill(fillRule?: CanvasFillRule): void;\\n    fill(path: Path2D, fillRule?: CanvasFillRule): void;\\n    isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean;\\n    isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean;\\n    isPointInStroke(x: number, y: number): boolean;\\n    isPointInStroke(path: Path2D, x: number, y: number): boolean;\\n    stroke(): void;\\n    stroke(path: Path2D): void;\\n}\\n\\ninterface CanvasFillStrokeStyles {\\n    fillStyle: string | CanvasGradient | CanvasPattern;\\n    strokeStyle: string | CanvasGradient | CanvasPattern;\\n    createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;\\n    createPattern(image: CanvasImageSource, repetition: string | null): CanvasPattern | null;\\n    createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;\\n}\\n\\ninterface CanvasFilters {\\n    filter: string;\\n}\\n\\n/** An opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient(). */\\ninterface CanvasGradient {\\n    /**\\n     * Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end.\\n     * \\n     * Throws an \\\"IndexSizeError\\\" DOMException if the offset is out of range. Throws a \\\"SyntaxError\\\" DOMException if the color cannot be parsed.\\n     */\\n    addColorStop(offset: number, color: string): void;\\n}\\n\\ndeclare var CanvasGradient: {\\n    prototype: CanvasGradient;\\n    new(): CanvasGradient;\\n};\\n\\ninterface CanvasImageData {\\n    createImageData(sw: number, sh: number): ImageData;\\n    createImageData(imagedata: ImageData): ImageData;\\n    getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;\\n    putImageData(imagedata: ImageData, dx: number, dy: number): void;\\n    putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number): void;\\n}\\n\\ninterface CanvasImageSmoothing {\\n    imageSmoothingEnabled: boolean;\\n    imageSmoothingQuality: ImageSmoothingQuality;\\n}\\n\\ninterface CanvasPath {\\n    arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\\n    arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;\\n    bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;\\n    closePath(): void;\\n    ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\\n    lineTo(x: number, y: number): void;\\n    moveTo(x: number, y: number): void;\\n    quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;\\n    rect(x: number, y: number, w: number, h: number): void;\\n}\\n\\ninterface CanvasPathDrawingStyles {\\n    lineCap: CanvasLineCap;\\n    lineDashOffset: number;\\n    lineJoin: CanvasLineJoin;\\n    lineWidth: number;\\n    miterLimit: number;\\n    getLineDash(): number[];\\n    setLineDash(segments: number[]): void;\\n}\\n\\n/** An opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method. */\\ninterface CanvasPattern {\\n    /**\\n     * Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation.\\n     */\\n    setTransform(transform?: DOMMatrix2DInit): void;\\n}\\n\\ndeclare var CanvasPattern: {\\n    prototype: CanvasPattern;\\n    new(): CanvasPattern;\\n};\\n\\ninterface CanvasRect {\\n    clearRect(x: number, y: number, w: number, h: number): void;\\n    fillRect(x: number, y: number, w: number, h: number): void;\\n    strokeRect(x: number, y: number, w: number, h: number): void;\\n}\\n\\n/** The CanvasRenderingContext2D interface, part of the Canvas API, provides the 2D rendering context for the drawing surface of a <canvas> element. It is used for drawing shapes, text, images, and other objects. */\\ninterface CanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform, CanvasUserInterface {\\n    readonly canvas: HTMLCanvasElement;\\n}\\n\\ndeclare var CanvasRenderingContext2D: {\\n    prototype: CanvasRenderingContext2D;\\n    new(): CanvasRenderingContext2D;\\n};\\n\\ninterface CanvasShadowStyles {\\n    shadowBlur: number;\\n    shadowColor: string;\\n    shadowOffsetX: number;\\n    shadowOffsetY: number;\\n}\\n\\ninterface CanvasState {\\n    restore(): void;\\n    save(): void;\\n}\\n\\ninterface CanvasText {\\n    fillText(text: string, x: number, y: number, maxWidth?: number): void;\\n    measureText(text: string): TextMetrics;\\n    strokeText(text: string, x: number, y: number, maxWidth?: number): void;\\n}\\n\\ninterface CanvasTextDrawingStyles {\\n    direction: CanvasDirection;\\n    font: string;\\n    textAlign: CanvasTextAlign;\\n    textBaseline: CanvasTextBaseline;\\n}\\n\\ninterface CanvasTransform {\\n    getTransform(): DOMMatrix;\\n    resetTransform(): void;\\n    rotate(angle: number): void;\\n    scale(x: number, y: number): void;\\n    setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;\\n    setTransform(transform?: DOMMatrix2DInit): void;\\n    transform(a: number, b: number, c: number, d: number, e: number, f: number): void;\\n    translate(x: number, y: number): void;\\n}\\n\\ninterface CanvasUserInterface {\\n    drawFocusIfNeeded(element: Element): void;\\n    drawFocusIfNeeded(path: Path2D, element: Element): void;\\n    scrollPathIntoView(): void;\\n    scrollPathIntoView(path: Path2D): void;\\n}\\n\\ninterface CaretPosition {\\n    readonly offset: number;\\n    readonly offsetNode: Node;\\n    getClientRect(): DOMRect | null;\\n}\\n\\ndeclare var CaretPosition: {\\n    prototype: CaretPosition;\\n    new(): CaretPosition;\\n};\\n\\n/** The ChannelMergerNode interface, often used in conjunction with its opposite, ChannelSplitterNode, reunites different mono inputs into a single output. Each input is used to fill a channel of the output. This is useful for accessing each channels separately, e.g. for performing channel mixing where gain must be separately controlled on each channel. */\\ninterface ChannelMergerNode extends AudioNode {\\n}\\n\\ndeclare var ChannelMergerNode: {\\n    prototype: ChannelMergerNode;\\n    new(context: BaseAudioContext, options?: ChannelMergerOptions): ChannelMergerNode;\\n};\\n\\n/** The ChannelSplitterNode interface, often used in conjunction with its opposite, ChannelMergerNode, separates the different channels of an audio source into a set of mono outputs. This is useful for accessing each channel separately, e.g. for performing channel mixing where gain must be separately controlled on each channel. */\\ninterface ChannelSplitterNode extends AudioNode {\\n}\\n\\ndeclare var ChannelSplitterNode: {\\n    prototype: ChannelSplitterNode;\\n    new(context: BaseAudioContext, options?: ChannelSplitterOptions): ChannelSplitterNode;\\n};\\n\\n/** The CharacterData abstract interface represents a Node object that contains characters. This is an abstract interface, meaning there aren't any object of type CharacterData: it is implemented by other interfaces, like Text, Comment, or ProcessingInstruction which aren't abstract. */\\ninterface CharacterData extends Node, ChildNode, NonDocumentTypeChildNode {\\n    data: string;\\n    readonly length: number;\\n    readonly ownerDocument: Document;\\n    appendData(data: string): void;\\n    deleteData(offset: number, count: number): void;\\n    insertData(offset: number, data: string): void;\\n    replaceData(offset: number, count: number, data: string): void;\\n    substringData(offset: number, count: number): string;\\n}\\n\\ndeclare var CharacterData: {\\n    prototype: CharacterData;\\n    new(): CharacterData;\\n};\\n\\ninterface ChildNode extends Node {\\n    /**\\n     * Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.\\n     * \\n     * Throws a \\\"HierarchyRequestError\\\" DOMException if the constraints of the node tree are violated.\\n     */\\n    after(...nodes: (Node | string)[]): void;\\n    /**\\n     * Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.\\n     * \\n     * Throws a \\\"HierarchyRequestError\\\" DOMException if the constraints of the node tree are violated.\\n     */\\n    before(...nodes: (Node | string)[]): void;\\n    /**\\n     * Removes node.\\n     */\\n    remove(): void;\\n    /**\\n     * Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.\\n     * \\n     * Throws a \\\"HierarchyRequestError\\\" DOMException if the constraints of the node tree are violated.\\n     */\\n    replaceWith(...nodes: (Node | string)[]): void;\\n}\\n\\ninterface ClientRect {\\n    bottom: number;\\n    readonly height: number;\\n    left: number;\\n    right: number;\\n    top: number;\\n    readonly width: number;\\n}\\n\\ndeclare var ClientRect: {\\n    prototype: ClientRect;\\n    new(): ClientRect;\\n};\\n\\ninterface ClientRectList {\\n    readonly length: number;\\n    item(index: number): ClientRect;\\n    [index: number]: ClientRect;\\n}\\n\\ndeclare var ClientRectList: {\\n    prototype: ClientRectList;\\n    new(): ClientRectList;\\n};\\n\\ninterface Clipboard extends EventTarget {\\n    readText(): Promise<string>;\\n    writeText(data: string): Promise<void>;\\n}\\n\\ndeclare var Clipboard: {\\n    prototype: Clipboard;\\n    new(): Clipboard;\\n};\\n\\n/** Events providing information related to modification of the clipboard, that is cut, copy, and paste events. */\\ninterface ClipboardEvent extends Event {\\n    readonly clipboardData: DataTransfer | null;\\n}\\n\\ndeclare var ClipboardEvent: {\\n    prototype: ClipboardEvent;\\n    new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent;\\n};\\n\\n/** A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. */\\ninterface CloseEvent extends Event {\\n    /**\\n     * Returns the WebSocket connection close code provided by the server.\\n     */\\n    readonly code: number;\\n    /**\\n     * Returns the WebSocket connection close reason provided by the server.\\n     */\\n    readonly reason: string;\\n    /**\\n     * Returns true if the connection closed cleanly; false otherwise.\\n     */\\n    readonly wasClean: boolean;\\n}\\n\\ndeclare var CloseEvent: {\\n    prototype: CloseEvent;\\n    new(type: string, eventInitDict?: CloseEventInit): CloseEvent;\\n};\\n\\n/** Textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view. */\\ninterface Comment extends CharacterData {\\n}\\n\\ndeclare var Comment: {\\n    prototype: Comment;\\n    new(data?: string): Comment;\\n};\\n\\n/** The DOM CompositionEvent represents events that occur due to the user indirectly entering text. */\\ninterface CompositionEvent extends UIEvent {\\n    readonly data: string;\\n}\\n\\ndeclare var CompositionEvent: {\\n    prototype: CompositionEvent;\\n    new(type: string, eventInitDict?: CompositionEventInit): CompositionEvent;\\n};\\n\\ninterface ConcatParams extends Algorithm {\\n    algorithmId: Uint8Array;\\n    hash?: string | Algorithm;\\n    partyUInfo: Uint8Array;\\n    partyVInfo: Uint8Array;\\n    privateInfo?: Uint8Array;\\n    publicInfo?: Uint8Array;\\n}\\n\\ninterface ConstantSourceNode extends AudioScheduledSourceNode {\\n    readonly offset: AudioParam;\\n    addEventListener<K extends keyof AudioScheduledSourceNodeEventMap>(type: K, listener: (this: ConstantSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof AudioScheduledSourceNodeEventMap>(type: K, listener: (this: ConstantSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var ConstantSourceNode: {\\n    prototype: ConstantSourceNode;\\n    new(context: BaseAudioContext, options?: ConstantSourceOptions): ConstantSourceNode;\\n};\\n\\n/** An AudioNode that performs a Linear Convolution on a given AudioBuffer, often used to achieve a reverb effect. A ConvolverNode always has exactly one input and one output. */\\ninterface ConvolverNode extends AudioNode {\\n    buffer: AudioBuffer | null;\\n    normalize: boolean;\\n}\\n\\ndeclare var ConvolverNode: {\\n    prototype: ConvolverNode;\\n    new(context: BaseAudioContext, options?: ConvolverOptions): ConvolverNode;\\n};\\n\\n/** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */\\ninterface CountQueuingStrategy extends QueuingStrategy {\\n    readonly highWaterMark: number;\\n    readonly size: QueuingStrategySize;\\n}\\n\\ndeclare var CountQueuingStrategy: {\\n    prototype: CountQueuingStrategy;\\n    new(init: QueuingStrategyInit): CountQueuingStrategy;\\n};\\n\\ninterface Credential {\\n    readonly id: string;\\n    readonly type: string;\\n}\\n\\ndeclare var Credential: {\\n    prototype: Credential;\\n    new(): Credential;\\n};\\n\\ninterface CredentialsContainer {\\n    create(options?: CredentialCreationOptions): Promise<Credential | null>;\\n    get(options?: CredentialRequestOptions): Promise<Credential | null>;\\n    preventSilentAccess(): Promise<void>;\\n    store(credential: Credential): Promise<Credential>;\\n}\\n\\ndeclare var CredentialsContainer: {\\n    prototype: CredentialsContainer;\\n    new(): CredentialsContainer;\\n};\\n\\n/** Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives. */\\ninterface Crypto {\\n    readonly subtle: SubtleCrypto;\\n    getRandomValues<T extends Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null>(array: T): T;\\n}\\n\\ndeclare var Crypto: {\\n    prototype: Crypto;\\n    new(): Crypto;\\n};\\n\\n/** The CryptoKey dictionary of the Web Crypto API represents a cryptographic key. */\\ninterface CryptoKey {\\n    readonly algorithm: KeyAlgorithm;\\n    readonly extractable: boolean;\\n    readonly type: KeyType;\\n    readonly usages: KeyUsage[];\\n}\\n\\ndeclare var CryptoKey: {\\n    prototype: CryptoKey;\\n    new(): CryptoKey;\\n};\\n\\n/** The CryptoKeyPair dictionary of the Web Crypto API represents a key pair for an asymmetric cryptography algorithm, also known as a public-key algorithm. */\\ninterface CryptoKeyPair {\\n    privateKey: CryptoKey;\\n    publicKey: CryptoKey;\\n}\\n\\ndeclare var CryptoKeyPair: {\\n    prototype: CryptoKeyPair;\\n    new(): CryptoKeyPair;\\n};\\n\\ninterface CustomElementRegistry {\\n    define(name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions): void;\\n    get(name: string): any;\\n    upgrade(root: Node): void;\\n    whenDefined(name: string): Promise<void>;\\n}\\n\\ndeclare var CustomElementRegistry: {\\n    prototype: CustomElementRegistry;\\n    new(): CustomElementRegistry;\\n};\\n\\ninterface CustomEvent<T = any> extends Event {\\n    /**\\n     * Returns any custom data event was created with. Typically used for synthetic events.\\n     */\\n    readonly detail: T;\\n    initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: T): void;\\n}\\n\\ndeclare var CustomEvent: {\\n    prototype: CustomEvent;\\n    new<T>(typeArg: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;\\n};\\n\\n/** An error object that contains an error name. */\\ninterface DOMError {\\n    readonly name: string;\\n    toString(): string;\\n}\\n\\ndeclare var DOMError: {\\n    prototype: DOMError;\\n    new(): DOMError;\\n};\\n\\n/** An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. */\\ninterface DOMException {\\n    readonly code: number;\\n    readonly message: string;\\n    readonly name: string;\\n    readonly ABORT_ERR: number;\\n    readonly DATA_CLONE_ERR: number;\\n    readonly DOMSTRING_SIZE_ERR: number;\\n    readonly HIERARCHY_REQUEST_ERR: number;\\n    readonly INDEX_SIZE_ERR: number;\\n    readonly INUSE_ATTRIBUTE_ERR: number;\\n    readonly INVALID_ACCESS_ERR: number;\\n    readonly INVALID_CHARACTER_ERR: number;\\n    readonly INVALID_MODIFICATION_ERR: number;\\n    readonly INVALID_NODE_TYPE_ERR: number;\\n    readonly INVALID_STATE_ERR: number;\\n    readonly NAMESPACE_ERR: number;\\n    readonly NETWORK_ERR: number;\\n    readonly NOT_FOUND_ERR: number;\\n    readonly NOT_SUPPORTED_ERR: number;\\n    readonly NO_DATA_ALLOWED_ERR: number;\\n    readonly NO_MODIFICATION_ALLOWED_ERR: number;\\n    readonly QUOTA_EXCEEDED_ERR: number;\\n    readonly SECURITY_ERR: number;\\n    readonly SYNTAX_ERR: number;\\n    readonly TIMEOUT_ERR: number;\\n    readonly TYPE_MISMATCH_ERR: number;\\n    readonly URL_MISMATCH_ERR: number;\\n    readonly VALIDATION_ERR: number;\\n    readonly WRONG_DOCUMENT_ERR: number;\\n}\\n\\ndeclare var DOMException: {\\n    prototype: DOMException;\\n    new(message?: string, name?: string): DOMException;\\n    readonly ABORT_ERR: number;\\n    readonly DATA_CLONE_ERR: number;\\n    readonly DOMSTRING_SIZE_ERR: number;\\n    readonly HIERARCHY_REQUEST_ERR: number;\\n    readonly INDEX_SIZE_ERR: number;\\n    readonly INUSE_ATTRIBUTE_ERR: number;\\n    readonly INVALID_ACCESS_ERR: number;\\n    readonly INVALID_CHARACTER_ERR: number;\\n    readonly INVALID_MODIFICATION_ERR: number;\\n    readonly INVALID_NODE_TYPE_ERR: number;\\n    readonly INVALID_STATE_ERR: number;\\n    readonly NAMESPACE_ERR: number;\\n    readonly NETWORK_ERR: number;\\n    readonly NOT_FOUND_ERR: number;\\n    readonly NOT_SUPPORTED_ERR: number;\\n    readonly NO_DATA_ALLOWED_ERR: number;\\n    readonly NO_MODIFICATION_ALLOWED_ERR: number;\\n    readonly QUOTA_EXCEEDED_ERR: number;\\n    readonly SECURITY_ERR: number;\\n    readonly SYNTAX_ERR: number;\\n    readonly TIMEOUT_ERR: number;\\n    readonly TYPE_MISMATCH_ERR: number;\\n    readonly URL_MISMATCH_ERR: number;\\n    readonly VALIDATION_ERR: number;\\n    readonly WRONG_DOCUMENT_ERR: number;\\n};\\n\\n/** An object providing methods which are not dependent on any particular document. Such an object is returned by the Document.implementation property. */\\ninterface DOMImplementation {\\n    createDocument(namespace: string | null, qualifiedName: string | null, doctype?: DocumentType | null): XMLDocument;\\n    createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType;\\n    createHTMLDocument(title?: string): Document;\\n    /** @deprecated */\\n    hasFeature(...args: any[]): true;\\n}\\n\\ndeclare var DOMImplementation: {\\n    prototype: DOMImplementation;\\n    new(): DOMImplementation;\\n};\\n\\ninterface DOML2DeprecatedColorProperty {\\n    color: string;\\n}\\n\\ninterface DOMMatrix extends DOMMatrixReadOnly {\\n    a: number;\\n    b: number;\\n    c: number;\\n    d: number;\\n    e: number;\\n    f: number;\\n    m11: number;\\n    m12: number;\\n    m13: number;\\n    m14: number;\\n    m21: number;\\n    m22: number;\\n    m23: number;\\n    m24: number;\\n    m31: number;\\n    m32: number;\\n    m33: number;\\n    m34: number;\\n    m41: number;\\n    m42: number;\\n    m43: number;\\n    m44: number;\\n    invertSelf(): DOMMatrix;\\n    multiplySelf(other?: DOMMatrixInit): DOMMatrix;\\n    preMultiplySelf(other?: DOMMatrixInit): DOMMatrix;\\n    rotateAxisAngleSelf(x?: number, y?: number, z?: number, angle?: number): DOMMatrix;\\n    rotateFromVectorSelf(x?: number, y?: number): DOMMatrix;\\n    rotateSelf(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;\\n    scale3dSelf(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;\\n    scaleSelf(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;\\n    setMatrixValue(transformList: string): DOMMatrix;\\n    skewXSelf(sx?: number): DOMMatrix;\\n    skewYSelf(sy?: number): DOMMatrix;\\n    translateSelf(tx?: number, ty?: number, tz?: number): DOMMatrix;\\n}\\n\\ndeclare var DOMMatrix: {\\n    prototype: DOMMatrix;\\n    new(init?: string | number[]): DOMMatrix;\\n    fromFloat32Array(array32: Float32Array): DOMMatrix;\\n    fromFloat64Array(array64: Float64Array): DOMMatrix;\\n    fromMatrix(other?: DOMMatrixInit): DOMMatrix;\\n};\\n\\ntype SVGMatrix = DOMMatrix;\\ndeclare var SVGMatrix: typeof DOMMatrix;\\n\\ntype WebKitCSSMatrix = DOMMatrix;\\ndeclare var WebKitCSSMatrix: typeof DOMMatrix;\\n\\ninterface DOMMatrixReadOnly {\\n    readonly a: number;\\n    readonly b: number;\\n    readonly c: number;\\n    readonly d: number;\\n    readonly e: number;\\n    readonly f: number;\\n    readonly is2D: boolean;\\n    readonly isIdentity: boolean;\\n    readonly m11: number;\\n    readonly m12: number;\\n    readonly m13: number;\\n    readonly m14: number;\\n    readonly m21: number;\\n    readonly m22: number;\\n    readonly m23: number;\\n    readonly m24: number;\\n    readonly m31: number;\\n    readonly m32: number;\\n    readonly m33: number;\\n    readonly m34: number;\\n    readonly m41: number;\\n    readonly m42: number;\\n    readonly m43: number;\\n    readonly m44: number;\\n    flipX(): DOMMatrix;\\n    flipY(): DOMMatrix;\\n    inverse(): DOMMatrix;\\n    multiply(other?: DOMMatrixInit): DOMMatrix;\\n    rotate(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;\\n    rotateAxisAngle(x?: number, y?: number, z?: number, angle?: number): DOMMatrix;\\n    rotateFromVector(x?: number, y?: number): DOMMatrix;\\n    scale(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;\\n    scale3d(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;\\n    /** @deprecated */\\n    scaleNonUniform(scaleX?: number, scaleY?: number): DOMMatrix;\\n    skewX(sx?: number): DOMMatrix;\\n    skewY(sy?: number): DOMMatrix;\\n    toFloat32Array(): Float32Array;\\n    toFloat64Array(): Float64Array;\\n    toJSON(): any;\\n    transformPoint(point?: DOMPointInit): DOMPoint;\\n    translate(tx?: number, ty?: number, tz?: number): DOMMatrix;\\n    toString(): string;\\n}\\n\\ndeclare var DOMMatrixReadOnly: {\\n    prototype: DOMMatrixReadOnly;\\n    new(init?: string | number[]): DOMMatrixReadOnly;\\n    fromFloat32Array(array32: Float32Array): DOMMatrixReadOnly;\\n    fromFloat64Array(array64: Float64Array): DOMMatrixReadOnly;\\n    fromMatrix(other?: DOMMatrixInit): DOMMatrixReadOnly;\\n    toString(): string;\\n};\\n\\n/** Provides the ability to parse XML or HTML source code from a string into a DOM Document. */\\ninterface DOMParser {\\n    /**\\n     * Parses string using either the HTML or XML parser, according to type, and returns the resulting Document. type can be \\\"text/html\\\" (which will invoke the HTML parser), or any of \\\"text/xml\\\", \\\"application/xml\\\", \\\"application/xhtml+xml\\\", or \\\"image/svg+xml\\\" (which will invoke the XML parser).\\n     * \\n     * For the XML parser, if string cannot be parsed, then the returned Document will contain elements describing the resulting error.\\n     * \\n     * Note that script elements are not evaluated during parsing, and the resulting document's encoding will always be UTF-8.\\n     * \\n     * Values other than the above for type will cause a TypeError exception to be thrown.\\n     */\\n    parseFromString(string: string, type: DOMParserSupportedType): Document;\\n}\\n\\ndeclare var DOMParser: {\\n    prototype: DOMParser;\\n    new(): DOMParser;\\n};\\n\\ninterface DOMPoint extends DOMPointReadOnly {\\n    w: number;\\n    x: number;\\n    y: number;\\n    z: number;\\n}\\n\\ndeclare var DOMPoint: {\\n    prototype: DOMPoint;\\n    new(x?: number, y?: number, z?: number, w?: number): DOMPoint;\\n    fromPoint(other?: DOMPointInit): DOMPoint;\\n};\\n\\ntype SVGPoint = DOMPoint;\\ndeclare var SVGPoint: typeof DOMPoint;\\n\\ninterface DOMPointReadOnly {\\n    readonly w: number;\\n    readonly x: number;\\n    readonly y: number;\\n    readonly z: number;\\n    matrixTransform(matrix?: DOMMatrixInit): DOMPoint;\\n    toJSON(): any;\\n}\\n\\ndeclare var DOMPointReadOnly: {\\n    prototype: DOMPointReadOnly;\\n    new(x?: number, y?: number, z?: number, w?: number): DOMPointReadOnly;\\n    fromPoint(other?: DOMPointInit): DOMPointReadOnly;\\n};\\n\\ninterface DOMQuad {\\n    readonly p1: DOMPoint;\\n    readonly p2: DOMPoint;\\n    readonly p3: DOMPoint;\\n    readonly p4: DOMPoint;\\n    getBounds(): DOMRect;\\n    toJSON(): any;\\n}\\n\\ndeclare var DOMQuad: {\\n    prototype: DOMQuad;\\n    new(p1?: DOMPointInit, p2?: DOMPointInit, p3?: DOMPointInit, p4?: DOMPointInit): DOMQuad;\\n    fromQuad(other?: DOMQuadInit): DOMQuad;\\n    fromRect(other?: DOMRectInit): DOMQuad;\\n};\\n\\ninterface DOMRect extends DOMRectReadOnly {\\n    height: number;\\n    width: number;\\n    x: number;\\n    y: number;\\n}\\n\\ndeclare var DOMRect: {\\n    prototype: DOMRect;\\n    new(x?: number, y?: number, width?: number, height?: number): DOMRect;\\n    fromRect(other?: DOMRectInit): DOMRect;\\n};\\n\\ntype SVGRect = DOMRect;\\ndeclare var SVGRect: typeof DOMRect;\\n\\ninterface DOMRectList {\\n    readonly length: number;\\n    item(index: number): DOMRect | null;\\n    [index: number]: DOMRect;\\n}\\n\\ndeclare var DOMRectList: {\\n    prototype: DOMRectList;\\n    new(): DOMRectList;\\n};\\n\\ninterface DOMRectReadOnly {\\n    readonly bottom: number;\\n    readonly height: number;\\n    readonly left: number;\\n    readonly right: number;\\n    readonly top: number;\\n    readonly width: number;\\n    readonly x: number;\\n    readonly y: number;\\n    toJSON(): any;\\n}\\n\\ndeclare var DOMRectReadOnly: {\\n    prototype: DOMRectReadOnly;\\n    new(x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly;\\n    fromRect(other?: DOMRectInit): DOMRectReadOnly;\\n};\\n\\ninterface DOMSettableTokenList extends DOMTokenList {\\n    value: string;\\n}\\n\\ndeclare var DOMSettableTokenList: {\\n    prototype: DOMSettableTokenList;\\n    new(): DOMSettableTokenList;\\n};\\n\\n/** A type returned by some APIs which contains a list of DOMString (strings). */\\ninterface DOMStringList {\\n    /**\\n     * Returns the number of strings in strings.\\n     */\\n    readonly length: number;\\n    /**\\n     * Returns true if strings contains string, and false otherwise.\\n     */\\n    contains(string: string): boolean;\\n    /**\\n     * Returns the string with index index from strings.\\n     */\\n    item(index: number): string | null;\\n    [index: number]: string;\\n}\\n\\ndeclare var DOMStringList: {\\n    prototype: DOMStringList;\\n    new(): DOMStringList;\\n};\\n\\n/** Used by the dataset HTML attribute to represent data for custom attributes added to elements. */\\ninterface DOMStringMap {\\n    [name: string]: string | undefined;\\n}\\n\\ndeclare var DOMStringMap: {\\n    prototype: DOMStringMap;\\n    new(): DOMStringMap;\\n};\\n\\n/** A set of space-separated tokens. Such a set is returned by Element.classList, HTMLLinkElement.relList, HTMLAnchorElement.relList, HTMLAreaElement.relList, HTMLIframeElement.sandbox, or HTMLOutputElement.htmlFor. It is indexed beginning with 0 as with JavaScript Array objects. DOMTokenList is always case-sensitive. */\\ninterface DOMTokenList {\\n    /**\\n     * Returns the number of tokens.\\n     */\\n    readonly length: number;\\n    /**\\n     * Returns the associated set as string.\\n     * \\n     * Can be set, to change the associated attribute.\\n     */\\n    value: string;\\n    toString(): string;\\n    /**\\n     * Adds all arguments passed, except those already present.\\n     * \\n     * Throws a \\\"SyntaxError\\\" DOMException if one of the arguments is the empty string.\\n     * \\n     * Throws an \\\"InvalidCharacterError\\\" DOMException if one of the arguments contains any ASCII whitespace.\\n     */\\n    add(...tokens: string[]): void;\\n    /**\\n     * Returns true if token is present, and false otherwise.\\n     */\\n    contains(token: string): boolean;\\n    /**\\n     * Returns the token with index index.\\n     */\\n    item(index: number): string | null;\\n    /**\\n     * Removes arguments passed, if they are present.\\n     * \\n     * Throws a \\\"SyntaxError\\\" DOMException if one of the arguments is the empty string.\\n     * \\n     * Throws an \\\"InvalidCharacterError\\\" DOMException if one of the arguments contains any ASCII whitespace.\\n     */\\n    remove(...tokens: string[]): void;\\n    /**\\n     * Replaces token with newToken.\\n     * \\n     * Returns true if token was replaced with newToken, and false otherwise.\\n     * \\n     * Throws a \\\"SyntaxError\\\" DOMException if one of the arguments is the empty string.\\n     * \\n     * Throws an \\\"InvalidCharacterError\\\" DOMException if one of the arguments contains any ASCII whitespace.\\n     */\\n    replace(oldToken: string, newToken: string): void;\\n    /**\\n     * Returns true if token is in the associated attribute's supported tokens. Returns false otherwise.\\n     * \\n     * Throws a TypeError if the associated attribute has no supported tokens defined.\\n     */\\n    supports(token: string): boolean;\\n    /**\\n     * If force is not given, \\\"toggles\\\" token, removing it if it's present and adding it if it's not present. If force is true, adds token (same as add()). If force is false, removes token (same as remove()).\\n     * \\n     * Returns true if token is now present, and false otherwise.\\n     * \\n     * Throws a \\\"SyntaxError\\\" DOMException if token is empty.\\n     * \\n     * Throws an \\\"InvalidCharacterError\\\" DOMException if token contains any spaces.\\n     */\\n    toggle(token: string, force?: boolean): boolean;\\n    forEach(callbackfn: (value: string, key: number, parent: DOMTokenList) => void, thisArg?: any): void;\\n    [index: number]: string;\\n}\\n\\ndeclare var DOMTokenList: {\\n    prototype: DOMTokenList;\\n    new(): DOMTokenList;\\n};\\n\\ninterface DataCue extends TextTrackCue {\\n    data: ArrayBuffer;\\n    addEventListener<K extends keyof TextTrackCueEventMap>(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof TextTrackCueEventMap>(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var DataCue: {\\n    prototype: DataCue;\\n    new(): DataCue;\\n};\\n\\n/** Used to hold the data that is being dragged during a drag and drop operation. It may hold one or more data items, each of one or more data types. For more information about drag and drop, see HTML Drag and Drop API. */\\ninterface DataTransfer {\\n    /**\\n     * Returns the kind of operation that is currently selected. If the kind of operation isn't one of those that is allowed by the effectAllowed attribute, then the operation will fail.\\n     * \\n     * Can be set, to change the selected operation.\\n     * \\n     * The possible values are \\\"none\\\", \\\"copy\\\", \\\"link\\\", and \\\"move\\\".\\n     */\\n    dropEffect: \\\"none\\\" | \\\"copy\\\" | \\\"link\\\" | \\\"move\\\";\\n    /**\\n     * Returns the kinds of operations that are to be allowed.\\n     * \\n     * Can be set (during the dragstart event), to change the allowed operations.\\n     * \\n     * The possible values are \\\"none\\\", \\\"copy\\\", \\\"copyLink\\\", \\\"copyMove\\\", \\\"link\\\", \\\"linkMove\\\", \\\"move\\\", \\\"all\\\", and \\\"uninitialized\\\",\\n     */\\n    effectAllowed: \\\"none\\\" | \\\"copy\\\" | \\\"copyLink\\\" | \\\"copyMove\\\" | \\\"link\\\" | \\\"linkMove\\\" | \\\"move\\\" | \\\"all\\\" | \\\"uninitialized\\\";\\n    /**\\n     * Returns a FileList of the files being dragged, if any.\\n     */\\n    readonly files: FileList;\\n    /**\\n     * Returns a DataTransferItemList object, with the drag data.\\n     */\\n    readonly items: DataTransferItemList;\\n    /**\\n     * Returns a frozen array listing the formats that were set in the dragstart event. In addition, if any files are being dragged, then one of the types will be the string \\\"Files\\\".\\n     */\\n    readonly types: ReadonlyArray<string>;\\n    /**\\n     * Removes the data of the specified formats. Removes all data if the argument is omitted.\\n     */\\n    clearData(format?: string): void;\\n    /**\\n     * Returns the specified data. If there is no such data, returns the empty string.\\n     */\\n    getData(format: string): string;\\n    /**\\n     * Adds the specified data.\\n     */\\n    setData(format: string, data: string): void;\\n    /**\\n     * Uses the given element to update the drag feedback, replacing any previously specified feedback.\\n     */\\n    setDragImage(image: Element, x: number, y: number): void;\\n}\\n\\ndeclare var DataTransfer: {\\n    prototype: DataTransfer;\\n    new(): DataTransfer;\\n};\\n\\n/** One drag data item. During a drag operation, each drag event has a dataTransfer property which contains a list of drag data items. Each item in the list is a DataTransferItem object. */\\ninterface DataTransferItem {\\n    /**\\n     * Returns the drag data item kind, one of: \\\"string\\\", \\\"file\\\".\\n     */\\n    readonly kind: string;\\n    /**\\n     * Returns the drag data item type string.\\n     */\\n    readonly type: string;\\n    /**\\n     * Returns a File object, if the drag data item kind is File.\\n     */\\n    getAsFile(): File | null;\\n    /**\\n     * Invokes the callback with the string data as the argument, if the drag data item kind is text.\\n     */\\n    getAsString(callback: FunctionStringCallback | null): void;\\n    webkitGetAsEntry(): any;\\n}\\n\\ndeclare var DataTransferItem: {\\n    prototype: DataTransferItem;\\n    new(): DataTransferItem;\\n};\\n\\n/** A list of DataTransferItem objects representing items being dragged. During a drag operation, each DragEvent has a dataTransfer property and that property is a DataTransferItemList. */\\ninterface DataTransferItemList {\\n    /**\\n     * Returns the number of items in the drag data store.\\n     */\\n    readonly length: number;\\n    /**\\n     * Adds a new entry for the given data to the drag data store. If the data is plain text then a type string has to be provided also.\\n     */\\n    add(data: string, type: string): DataTransferItem | null;\\n    add(data: File): DataTransferItem | null;\\n    /**\\n     * Removes all the entries in the drag data store.\\n     */\\n    clear(): void;\\n    item(index: number): DataTransferItem;\\n    /**\\n     * Removes the indexth entry in the drag data store.\\n     */\\n    remove(index: number): void;\\n    [name: number]: DataTransferItem;\\n}\\n\\ndeclare var DataTransferItemList: {\\n    prototype: DataTransferItemList;\\n    new(): DataTransferItemList;\\n};\\n\\ninterface DeferredPermissionRequest {\\n    readonly id: number;\\n    readonly type: MSWebViewPermissionType;\\n    readonly uri: string;\\n    allow(): void;\\n    deny(): void;\\n}\\n\\ndeclare var DeferredPermissionRequest: {\\n    prototype: DeferredPermissionRequest;\\n    new(): DeferredPermissionRequest;\\n};\\n\\n/** A delay-line; an AudioNode audio-processing module that causes a delay between the arrival of an input data and its propagation to the output. */\\ninterface DelayNode extends AudioNode {\\n    readonly delayTime: AudioParam;\\n}\\n\\ndeclare var DelayNode: {\\n    prototype: DelayNode;\\n    new(context: BaseAudioContext, options?: DelayOptions): DelayNode;\\n};\\n\\n/** Provides information about the amount of acceleration the device is experiencing along all three axes. */\\ninterface DeviceAcceleration {\\n    readonly x: number | null;\\n    readonly y: number | null;\\n    readonly z: number | null;\\n}\\n\\ndeclare var DeviceAcceleration: {\\n    prototype: DeviceAcceleration;\\n    new(): DeviceAcceleration;\\n};\\n\\n/** The DeviceLightEvent provides web developers with information from photo sensors or similiar detectors about ambient light levels near the device. For example this may be useful to adjust the screen's brightness based on the current ambient light level in order to save energy or provide better readability. */\\ninterface DeviceLightEvent extends Event {\\n    readonly value: number;\\n}\\n\\ndeclare var DeviceLightEvent: {\\n    prototype: DeviceLightEvent;\\n    new(typeArg: string, eventInitDict?: DeviceLightEventInit): DeviceLightEvent;\\n};\\n\\n/** The DeviceMotionEvent provides web developers with information about the speed of changes for the device's position and orientation. */\\ninterface DeviceMotionEvent extends Event {\\n    readonly acceleration: DeviceMotionEventAcceleration | null;\\n    readonly accelerationIncludingGravity: DeviceMotionEventAcceleration | null;\\n    readonly interval: number;\\n    readonly rotationRate: DeviceMotionEventRotationRate | null;\\n}\\n\\ndeclare var DeviceMotionEvent: {\\n    prototype: DeviceMotionEvent;\\n    new(type: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent;\\n    requestPermission(): Promise<PermissionState>;\\n};\\n\\ninterface DeviceMotionEventAcceleration {\\n    readonly x: number | null;\\n    readonly y: number | null;\\n    readonly z: number | null;\\n}\\n\\ninterface DeviceMotionEventRotationRate {\\n    readonly alpha: number | null;\\n    readonly beta: number | null;\\n    readonly gamma: number | null;\\n}\\n\\n/** The DeviceOrientationEvent provides web developers with information from the physical orientation of the device running the web page. */\\ninterface DeviceOrientationEvent extends Event {\\n    readonly absolute: boolean;\\n    readonly alpha: number | null;\\n    readonly beta: number | null;\\n    readonly gamma: number | null;\\n}\\n\\ndeclare var DeviceOrientationEvent: {\\n    prototype: DeviceOrientationEvent;\\n    new(type: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent;\\n    requestPermission(): Promise<PermissionState>;\\n};\\n\\n/** Provides information about the rate at which the device is rotating around all three axes. */\\ninterface DeviceRotationRate {\\n    readonly alpha: number | null;\\n    readonly beta: number | null;\\n    readonly gamma: number | null;\\n}\\n\\ndeclare var DeviceRotationRate: {\\n    prototype: DeviceRotationRate;\\n    new(): DeviceRotationRate;\\n};\\n\\ninterface DhImportKeyParams extends Algorithm {\\n    generator: Uint8Array;\\n    prime: Uint8Array;\\n}\\n\\ninterface DhKeyAlgorithm extends KeyAlgorithm {\\n    generator: Uint8Array;\\n    prime: Uint8Array;\\n}\\n\\ninterface DhKeyDeriveParams extends Algorithm {\\n    public: CryptoKey;\\n}\\n\\ninterface DhKeyGenParams extends Algorithm {\\n    generator: Uint8Array;\\n    prime: Uint8Array;\\n}\\n\\ninterface DocumentEventMap extends GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap {\\n    \\\"fullscreenchange\\\": Event;\\n    \\\"fullscreenerror\\\": Event;\\n    \\\"pointerlockchange\\\": Event;\\n    \\\"pointerlockerror\\\": Event;\\n    \\\"readystatechange\\\": Event;\\n    \\\"visibilitychange\\\": Event;\\n}\\n\\n/** Any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree. */\\ninterface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShadowRoot, GlobalEventHandlers, NonElementParentNode, ParentNode, XPathEvaluatorBase {\\n    /**\\n     * Sets or gets the URL for the current document.\\n     */\\n    readonly URL: string;\\n    /**\\n     * Sets or gets the color of all active links in the document.\\n     */\\n    /** @deprecated */\\n    alinkColor: string;\\n    /**\\n     * Returns a reference to the collection of elements contained by the object.\\n     */\\n    /** @deprecated */\\n    readonly all: HTMLAllCollection;\\n    /**\\n     * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.\\n     */\\n    /** @deprecated */\\n    readonly anchors: HTMLCollectionOf<HTMLAnchorElement>;\\n    /**\\n     * Retrieves a collection of all applet objects in the document.\\n     */\\n    /** @deprecated */\\n    readonly applets: HTMLCollectionOf<HTMLAppletElement>;\\n    /**\\n     * Deprecated. Sets or retrieves a value that indicates the background color behind the object.\\n     */\\n    /** @deprecated */\\n    bgColor: string;\\n    /**\\n     * Specifies the beginning and end of the document body.\\n     */\\n    body: HTMLElement;\\n    /**\\n     * Returns document's encoding.\\n     */\\n    readonly characterSet: string;\\n    /**\\n     * Gets or sets the character set used to encode the object.\\n     */\\n    readonly charset: string;\\n    /**\\n     * Gets a value that indicates whether standards-compliant mode is switched on for the object.\\n     */\\n    readonly compatMode: string;\\n    /**\\n     * Returns document's content type.\\n     */\\n    readonly contentType: string;\\n    /**\\n     * Returns the HTTP cookies that apply to the Document. If there are no cookies or cookies can't be applied to this resource, the empty string will be returned.\\n     * \\n     * Can be set, to add a new cookie to the element's set of HTTP cookies.\\n     * \\n     * If the contents are sandboxed into a unique origin (e.g. in an iframe with the sandbox attribute), a \\\"SecurityError\\\" DOMException will be thrown on getting and setting.\\n     */\\n    cookie: string;\\n    /**\\n     * Returns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script. In the case of reentrant script execution, returns the one that most recently started executing amongst those that have not yet finished executing.\\n     * \\n     * Returns null if the Document is not currently executing a script or SVG script element (e.g., because the running script is an event handler, or a timeout), or if the currently executing script or SVG script element represents a module script.\\n     */\\n    readonly currentScript: HTMLOrSVGScriptElement | null;\\n    readonly defaultView: (WindowProxy & typeof globalThis) | null;\\n    /**\\n     * Sets or gets a value that indicates whether the document can be edited.\\n     */\\n    designMode: string;\\n    /**\\n     * Sets or retrieves a value that indicates the reading order of the object.\\n     */\\n    dir: string;\\n    /**\\n     * Gets an object representing the document type declaration associated with the current document.\\n     */\\n    readonly doctype: DocumentType | null;\\n    /**\\n     * Gets a reference to the root node of the document.\\n     */\\n    readonly documentElement: HTMLElement;\\n    /**\\n     * Returns document's URL.\\n     */\\n    readonly documentURI: string;\\n    /**\\n     * Sets or gets the security domain of the document.\\n     */\\n    domain: string;\\n    /**\\n     * Retrieves a collection of all embed objects in the document.\\n     */\\n    readonly embeds: HTMLCollectionOf<HTMLEmbedElement>;\\n    /**\\n     * Sets or gets the foreground (text) color of the document.\\n     */\\n    /** @deprecated */\\n    fgColor: string;\\n    /**\\n     * Retrieves a collection, in source order, of all form objects in the document.\\n     */\\n    readonly forms: HTMLCollectionOf<HTMLFormElement>;\\n    /** @deprecated */\\n    readonly fullscreen: boolean;\\n    /**\\n     * Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise.\\n     */\\n    readonly fullscreenEnabled: boolean;\\n    /**\\n     * Returns the head element.\\n     */\\n    readonly head: HTMLHeadElement;\\n    readonly hidden: boolean;\\n    /**\\n     * Retrieves a collection, in source order, of img objects in the document.\\n     */\\n    readonly images: HTMLCollectionOf<HTMLImageElement>;\\n    /**\\n     * Gets the implementation object of the current document.\\n     */\\n    readonly implementation: DOMImplementation;\\n    /**\\n     * Returns the character encoding used to create the webpage that is loaded into the document object.\\n     */\\n    readonly inputEncoding: string;\\n    /**\\n     * Gets the date that the page was last modified, if the page supplies one.\\n     */\\n    readonly lastModified: string;\\n    /**\\n     * Sets or gets the color of the document links.\\n     */\\n    /** @deprecated */\\n    linkColor: string;\\n    /**\\n     * Retrieves a collection of all a objects that specify the href property and all area objects in the document.\\n     */\\n    readonly links: HTMLCollectionOf<HTMLAnchorElement | HTMLAreaElement>;\\n    /**\\n     * Contains information about the current URL.\\n     */\\n    location: Location;\\n    onfullscreenchange: ((this: Document, ev: Event) => any) | null;\\n    onfullscreenerror: ((this: Document, ev: Event) => any) | null;\\n    onpointerlockchange: ((this: Document, ev: Event) => any) | null;\\n    onpointerlockerror: ((this: Document, ev: Event) => any) | null;\\n    /**\\n     * Fires when the state of the object has changed.\\n     * @param ev The event\\n     */\\n    onreadystatechange: ((this: Document, ev: Event) => any) | null;\\n    onvisibilitychange: ((this: Document, ev: Event) => any) | null;\\n    readonly ownerDocument: null;\\n    /**\\n     * Return an HTMLCollection of the embed elements in the Document.\\n     */\\n    readonly plugins: HTMLCollectionOf<HTMLEmbedElement>;\\n    /**\\n     * Retrieves a value that indicates the current state of the object.\\n     */\\n    readonly readyState: DocumentReadyState;\\n    /**\\n     * Gets the URL of the location that referred the user to the current page.\\n     */\\n    readonly referrer: string;\\n    /**\\n     * Retrieves a collection of all script objects in the document.\\n     */\\n    readonly scripts: HTMLCollectionOf<HTMLScriptElement>;\\n    readonly scrollingElement: Element | null;\\n    readonly timeline: DocumentTimeline;\\n    /**\\n     * Contains the title of the document.\\n     */\\n    title: string;\\n    readonly visibilityState: VisibilityState;\\n    /**\\n     * Sets or gets the color of the links that the user has visited.\\n     */\\n    /** @deprecated */\\n    vlinkColor: string;\\n    /**\\n     * Moves node from another document and returns it.\\n     * \\n     * If node is a document, throws a \\\"NotSupportedError\\\" DOMException or, if node is a shadow root, throws a \\\"HierarchyRequestError\\\" DOMException.\\n     */\\n    adoptNode<T extends Node>(source: T): T;\\n    /** @deprecated */\\n    captureEvents(): void;\\n    caretPositionFromPoint(x: number, y: number): CaretPosition | null;\\n    /** @deprecated */\\n    caretRangeFromPoint(x: number, y: number): Range;\\n    /** @deprecated */\\n    clear(): void;\\n    /**\\n     * Closes an output stream and forces the sent data to display.\\n     */\\n    close(): void;\\n    /**\\n     * Creates an attribute object with a specified name.\\n     * @param name String that sets the attribute object's name.\\n     */\\n    createAttribute(localName: string): Attr;\\n    createAttributeNS(namespace: string | null, qualifiedName: string): Attr;\\n    /**\\n     * Returns a CDATASection node whose data is data.\\n     */\\n    createCDATASection(data: string): CDATASection;\\n    /**\\n     * Creates a comment object with the specified data.\\n     * @param data Sets the comment object's data.\\n     */\\n    createComment(data: string): Comment;\\n    /**\\n     * Creates a new document.\\n     */\\n    createDocumentFragment(): DocumentFragment;\\n    /**\\n     * Creates an instance of the element for the specified tag.\\n     * @param tagName The name of an element.\\n     */\\n    createElement<K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K];\\n    /** @deprecated */\\n    createElement<K extends keyof HTMLElementDeprecatedTagNameMap>(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K];\\n    createElement(tagName: string, options?: ElementCreationOptions): HTMLElement;\\n    /**\\n     * Returns an element with namespace namespace. Its namespace prefix will be everything before \\\":\\\" (U+003E) in qualifiedName or null. Its local name will be everything after \\\":\\\" (U+003E) in qualifiedName or qualifiedName.\\n     * \\n     * If localName does not match the Name production an \\\"InvalidCharacterError\\\" DOMException will be thrown.\\n     * \\n     * If one of the following conditions is true a \\\"NamespaceError\\\" DOMException will be thrown:\\n     * \\n     * localName does not match the QName production.\\n     * Namespace prefix is not null and namespace is the empty string.\\n     * Namespace prefix is \\\"xml\\\" and namespace is not the XML namespace.\\n     * qualifiedName or namespace prefix is \\\"xmlns\\\" and namespace is not the XMLNS namespace.\\n     * namespace is the XMLNS namespace and neither qualifiedName nor namespace prefix is \\\"xmlns\\\".\\n     * \\n     * When supplied, options's is can be used to create a customized built-in element.\\n     */\\n    createElementNS(namespaceURI: \\\"http://www.w3.org/1999/xhtml\\\", qualifiedName: string): HTMLElement;\\n    createElementNS<K extends keyof SVGElementTagNameMap>(namespaceURI: \\\"http://www.w3.org/2000/svg\\\", qualifiedName: K): SVGElementTagNameMap[K];\\n    createElementNS(namespaceURI: \\\"http://www.w3.org/2000/svg\\\", qualifiedName: string): SVGElement;\\n    createElementNS(namespaceURI: string | null, qualifiedName: string, options?: ElementCreationOptions): Element;\\n    createElementNS(namespace: string | null, qualifiedName: string, options?: string | ElementCreationOptions): Element;\\n    createEvent(eventInterface: \\\"AnimationEvent\\\"): AnimationEvent;\\n    createEvent(eventInterface: \\\"AnimationPlaybackEvent\\\"): AnimationPlaybackEvent;\\n    createEvent(eventInterface: \\\"AudioProcessingEvent\\\"): AudioProcessingEvent;\\n    createEvent(eventInterface: \\\"BeforeUnloadEvent\\\"): BeforeUnloadEvent;\\n    createEvent(eventInterface: \\\"ClipboardEvent\\\"): ClipboardEvent;\\n    createEvent(eventInterface: \\\"CloseEvent\\\"): CloseEvent;\\n    createEvent(eventInterface: \\\"CompositionEvent\\\"): CompositionEvent;\\n    createEvent(eventInterface: \\\"CustomEvent\\\"): CustomEvent;\\n    createEvent(eventInterface: \\\"DeviceLightEvent\\\"): DeviceLightEvent;\\n    createEvent(eventInterface: \\\"DeviceMotionEvent\\\"): DeviceMotionEvent;\\n    createEvent(eventInterface: \\\"DeviceOrientationEvent\\\"): DeviceOrientationEvent;\\n    createEvent(eventInterface: \\\"DragEvent\\\"): DragEvent;\\n    createEvent(eventInterface: \\\"ErrorEvent\\\"): ErrorEvent;\\n    createEvent(eventInterface: \\\"Event\\\"): Event;\\n    createEvent(eventInterface: \\\"Events\\\"): Event;\\n    createEvent(eventInterface: \\\"FocusEvent\\\"): FocusEvent;\\n    createEvent(eventInterface: \\\"FocusNavigationEvent\\\"): FocusNavigationEvent;\\n    createEvent(eventInterface: \\\"GamepadEvent\\\"): GamepadEvent;\\n    createEvent(eventInterface: \\\"HashChangeEvent\\\"): HashChangeEvent;\\n    createEvent(eventInterface: \\\"IDBVersionChangeEvent\\\"): IDBVersionChangeEvent;\\n    createEvent(eventInterface: \\\"InputEvent\\\"): InputEvent;\\n    createEvent(eventInterface: \\\"KeyboardEvent\\\"): KeyboardEvent;\\n    createEvent(eventInterface: \\\"ListeningStateChangedEvent\\\"): ListeningStateChangedEvent;\\n    createEvent(eventInterface: \\\"MSGestureEvent\\\"): MSGestureEvent;\\n    createEvent(eventInterface: \\\"MSMediaKeyMessageEvent\\\"): MSMediaKeyMessageEvent;\\n    createEvent(eventInterface: \\\"MSMediaKeyNeededEvent\\\"): MSMediaKeyNeededEvent;\\n    createEvent(eventInterface: \\\"MSPointerEvent\\\"): MSPointerEvent;\\n    createEvent(eventInterface: \\\"MediaEncryptedEvent\\\"): MediaEncryptedEvent;\\n    createEvent(eventInterface: \\\"MediaKeyMessageEvent\\\"): MediaKeyMessageEvent;\\n    createEvent(eventInterface: \\\"MediaQueryListEvent\\\"): MediaQueryListEvent;\\n    createEvent(eventInterface: \\\"MediaStreamErrorEvent\\\"): MediaStreamErrorEvent;\\n    createEvent(eventInterface: \\\"MediaStreamEvent\\\"): MediaStreamEvent;\\n    createEvent(eventInterface: \\\"MediaStreamTrackEvent\\\"): MediaStreamTrackEvent;\\n    createEvent(eventInterface: \\\"MessageEvent\\\"): MessageEvent;\\n    createEvent(eventInterface: \\\"MouseEvent\\\"): MouseEvent;\\n    createEvent(eventInterface: \\\"MouseEvents\\\"): MouseEvent;\\n    createEvent(eventInterface: \\\"MutationEvent\\\"): MutationEvent;\\n    createEvent(eventInterface: \\\"MutationEvents\\\"): MutationEvent;\\n    createEvent(eventInterface: \\\"OfflineAudioCompletionEvent\\\"): OfflineAudioCompletionEvent;\\n    createEvent(eventInterface: \\\"OverflowEvent\\\"): OverflowEvent;\\n    createEvent(eventInterface: \\\"PageTransitionEvent\\\"): PageTransitionEvent;\\n    createEvent(eventInterface: \\\"PaymentRequestUpdateEvent\\\"): PaymentRequestUpdateEvent;\\n    createEvent(eventInterface: \\\"PermissionRequestedEvent\\\"): PermissionRequestedEvent;\\n    createEvent(eventInterface: \\\"PointerEvent\\\"): PointerEvent;\\n    createEvent(eventInterface: \\\"PopStateEvent\\\"): PopStateEvent;\\n    createEvent(eventInterface: \\\"ProgressEvent\\\"): ProgressEvent;\\n    createEvent(eventInterface: \\\"PromiseRejectionEvent\\\"): PromiseRejectionEvent;\\n    createEvent(eventInterface: \\\"RTCDTMFToneChangeEvent\\\"): RTCDTMFToneChangeEvent;\\n    createEvent(eventInterface: \\\"RTCDataChannelEvent\\\"): RTCDataChannelEvent;\\n    createEvent(eventInterface: \\\"RTCDtlsTransportStateChangedEvent\\\"): RTCDtlsTransportStateChangedEvent;\\n    createEvent(eventInterface: \\\"RTCErrorEvent\\\"): RTCErrorEvent;\\n    createEvent(eventInterface: \\\"RTCIceCandidatePairChangedEvent\\\"): RTCIceCandidatePairChangedEvent;\\n    createEvent(eventInterface: \\\"RTCIceGathererEvent\\\"): RTCIceGathererEvent;\\n    createEvent(eventInterface: \\\"RTCIceTransportStateChangedEvent\\\"): RTCIceTransportStateChangedEvent;\\n    createEvent(eventInterface: \\\"RTCPeerConnectionIceErrorEvent\\\"): RTCPeerConnectionIceErrorEvent;\\n    createEvent(eventInterface: \\\"RTCPeerConnectionIceEvent\\\"): RTCPeerConnectionIceEvent;\\n    createEvent(eventInterface: \\\"RTCSsrcConflictEvent\\\"): RTCSsrcConflictEvent;\\n    createEvent(eventInterface: \\\"RTCStatsEvent\\\"): RTCStatsEvent;\\n    createEvent(eventInterface: \\\"RTCTrackEvent\\\"): RTCTrackEvent;\\n    createEvent(eventInterface: \\\"SVGZoomEvent\\\"): SVGZoomEvent;\\n    createEvent(eventInterface: \\\"SVGZoomEvents\\\"): SVGZoomEvent;\\n    createEvent(eventInterface: \\\"SecurityPolicyViolationEvent\\\"): SecurityPolicyViolationEvent;\\n    createEvent(eventInterface: \\\"ServiceWorkerMessageEvent\\\"): ServiceWorkerMessageEvent;\\n    createEvent(eventInterface: \\\"SpeechRecognitionErrorEvent\\\"): SpeechRecognitionErrorEvent;\\n    createEvent(eventInterface: \\\"SpeechRecognitionEvent\\\"): SpeechRecognitionEvent;\\n    createEvent(eventInterface: \\\"SpeechSynthesisErrorEvent\\\"): SpeechSynthesisErrorEvent;\\n    createEvent(eventInterface: \\\"SpeechSynthesisEvent\\\"): SpeechSynthesisEvent;\\n    createEvent(eventInterface: \\\"StorageEvent\\\"): StorageEvent;\\n    createEvent(eventInterface: \\\"TextEvent\\\"): TextEvent;\\n    createEvent(eventInterface: \\\"TouchEvent\\\"): TouchEvent;\\n    createEvent(eventInterface: \\\"TrackEvent\\\"): TrackEvent;\\n    createEvent(eventInterface: \\\"TransitionEvent\\\"): TransitionEvent;\\n    createEvent(eventInterface: \\\"UIEvent\\\"): UIEvent;\\n    createEvent(eventInterface: \\\"UIEvents\\\"): UIEvent;\\n    createEvent(eventInterface: \\\"VRDisplayEvent\\\"): VRDisplayEvent;\\n    createEvent(eventInterface: \\\"VRDisplayEvent \\\"): VRDisplayEvent ;\\n    createEvent(eventInterface: \\\"WebGLContextEvent\\\"): WebGLContextEvent;\\n    createEvent(eventInterface: \\\"WheelEvent\\\"): WheelEvent;\\n    createEvent(eventInterface: string): Event;\\n    /**\\n     * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\\n     * @param root The root element or node to start traversing on.\\n     * @param whatToShow The type of nodes or elements to appear in the node list\\n     * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter.\\n     * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.\\n     */\\n    createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter | null): NodeIterator;\\n    /**\\n     * Returns a ProcessingInstruction node whose target is target and data is data. If target does not match the Name production an \\\"InvalidCharacterError\\\" DOMException will be thrown. If data contains \\\"?>\\\" an \\\"InvalidCharacterError\\\" DOMException will be thrown.\\n     */\\n    createProcessingInstruction(target: string, data: string): ProcessingInstruction;\\n    /**\\n     *  Returns an empty range object that has both of its boundary points positioned at the beginning of the document.\\n     */\\n    createRange(): Range;\\n    /**\\n     * Creates a text string from the specified value.\\n     * @param data String that specifies the nodeValue property of the text node.\\n     */\\n    createTextNode(data: string): Text;\\n    /**\\n     * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document.\\n     * @param root The root element or node to start traversing on.\\n     * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow.\\n     * @param filter A custom NodeFilter function to use.\\n     * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.\\n     */\\n    createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker;\\n    /** @deprecated */\\n    createTreeWalker(root: Node, whatToShow: number, filter: NodeFilter | null, entityReferenceExpansion?: boolean): TreeWalker;\\n    /**\\n     * Returns the element for the specified x coordinate and the specified y coordinate.\\n     * @param x The x-offset\\n     * @param y The y-offset\\n     */\\n    elementFromPoint(x: number, y: number): Element | null;\\n    elementsFromPoint(x: number, y: number): Element[];\\n    /**\\n     * Executes a command on the current document, current selection, or the given range.\\n     * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.\\n     * @param showUI Display the user interface, defaults to false.\\n     * @param value Value to assign.\\n     */\\n    execCommand(commandId: string, showUI?: boolean, value?: string): boolean;\\n    /**\\n     * Stops document's fullscreen element from being displayed fullscreen and resolves promise when done.\\n     */\\n    exitFullscreen(): Promise<void>;\\n    exitPointerLock(): void;\\n    getAnimations(): Animation[];\\n    /**\\n     * Returns a reference to the first object with the specified value of the ID attribute.\\n     * @param elementId String that specifies the ID value.\\n     */\\n    getElementById(elementId: string): HTMLElement | null;\\n    /**\\n     * Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.\\n     */\\n    getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;\\n    /**\\n     * Gets a collection of objects based on the value of the NAME or ID attribute.\\n     * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute.\\n     */\\n    getElementsByName(elementName: string): NodeListOf<HTMLElement>;\\n    /**\\n     * Retrieves a collection of objects based on the specified element name.\\n     * @param name Specifies the name of an element.\\n     */\\n    getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;\\n    getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;\\n    getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;\\n    /**\\n     * If namespace and localName are \\\"*\\\" returns a HTMLCollection of all descendant elements.\\n     * \\n     * If only namespace is \\\"*\\\" returns a HTMLCollection of all descendant elements whose local name is localName.\\n     * \\n     * If only localName is \\\"*\\\" returns a HTMLCollection of all descendant elements whose namespace is namespace.\\n     * \\n     * Otherwise, returns a HTMLCollection of all descendant elements whose namespace is namespace and local name is localName.\\n     */\\n    getElementsByTagNameNS(namespaceURI: \\\"http://www.w3.org/1999/xhtml\\\", localName: string): HTMLCollectionOf<HTMLElement>;\\n    getElementsByTagNameNS(namespaceURI: \\\"http://www.w3.org/2000/svg\\\", localName: string): HTMLCollectionOf<SVGElement>;\\n    getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf<Element>;\\n    /**\\n     * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.\\n     */\\n    getSelection(): Selection | null;\\n    /**\\n     * Gets a value indicating whether the object currently has focus.\\n     */\\n    hasFocus(): boolean;\\n    /**\\n     * Returns a copy of node. If deep is true, the copy also includes the node's descendants.\\n     * \\n     * If node is a document or a shadow root, throws a \\\"NotSupportedError\\\" DOMException.\\n     */\\n    importNode<T extends Node>(importedNode: T, deep: boolean): T;\\n    /**\\n     * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.\\n     * @param url Specifies a MIME type for the document.\\n     * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element.\\n     * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, \\\"fullscreen=yes, toolbar=yes\\\"). The following values are supported.\\n     * @param replace Specifies whether the existing entry for the document is replaced in the history list.\\n     */\\n    open(url?: string, name?: string, features?: string, replace?: boolean): Document;\\n    /**\\n     * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.\\n     * @param commandId Specifies a command identifier.\\n     */\\n    queryCommandEnabled(commandId: string): boolean;\\n    /**\\n     * Returns a Boolean value that indicates whether the specified command is in the indeterminate state.\\n     * @param commandId String that specifies a command identifier.\\n     */\\n    queryCommandIndeterm(commandId: string): boolean;\\n    /**\\n     * Returns a Boolean value that indicates the current state of the command.\\n     * @param commandId String that specifies a command identifier.\\n     */\\n    queryCommandState(commandId: string): boolean;\\n    /**\\n     * Returns a Boolean value that indicates whether the current command is supported on the current range.\\n     * @param commandId Specifies a command identifier.\\n     */\\n    queryCommandSupported(commandId: string): boolean;\\n    /**\\n     * Returns the current value of the document, range, or current selection for the given command.\\n     * @param commandId String that specifies a command identifier.\\n     */\\n    queryCommandValue(commandId: string): string;\\n    /** @deprecated */\\n    releaseEvents(): void;\\n    /**\\n     * Writes one or more HTML expressions to a document in the specified window.\\n     * @param content Specifies the text and HTML tags to write.\\n     */\\n    write(...text: string[]): void;\\n    /**\\n     * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.\\n     * @param content The text and HTML tags to write.\\n     */\\n    writeln(...text: string[]): void;\\n    addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var Document: {\\n    prototype: Document;\\n    new(): Document;\\n};\\n\\ninterface DocumentAndElementEventHandlersEventMap {\\n    \\\"copy\\\": ClipboardEvent;\\n    \\\"cut\\\": ClipboardEvent;\\n    \\\"paste\\\": ClipboardEvent;\\n}\\n\\ninterface DocumentAndElementEventHandlers {\\n    oncopy: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;\\n    oncut: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;\\n    onpaste: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;\\n    addEventListener<K extends keyof DocumentAndElementEventHandlersEventMap>(type: K, listener: (this: DocumentAndElementEventHandlers, ev: DocumentAndElementEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof DocumentAndElementEventHandlersEventMap>(type: K, listener: (this: DocumentAndElementEventHandlers, ev: DocumentAndElementEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ninterface DocumentEvent {\\n    createEvent(eventInterface: \\\"AnimationEvent\\\"): AnimationEvent;\\n    createEvent(eventInterface: \\\"AnimationPlaybackEvent\\\"): AnimationPlaybackEvent;\\n    createEvent(eventInterface: \\\"AudioProcessingEvent\\\"): AudioProcessingEvent;\\n    createEvent(eventInterface: \\\"BeforeUnloadEvent\\\"): BeforeUnloadEvent;\\n    createEvent(eventInterface: \\\"ClipboardEvent\\\"): ClipboardEvent;\\n    createEvent(eventInterface: \\\"CloseEvent\\\"): CloseEvent;\\n    createEvent(eventInterface: \\\"CompositionEvent\\\"): CompositionEvent;\\n    createEvent(eventInterface: \\\"CustomEvent\\\"): CustomEvent;\\n    createEvent(eventInterface: \\\"DeviceLightEvent\\\"): DeviceLightEvent;\\n    createEvent(eventInterface: \\\"DeviceMotionEvent\\\"): DeviceMotionEvent;\\n    createEvent(eventInterface: \\\"DeviceOrientationEvent\\\"): DeviceOrientationEvent;\\n    createEvent(eventInterface: \\\"DragEvent\\\"): DragEvent;\\n    createEvent(eventInterface: \\\"ErrorEvent\\\"): ErrorEvent;\\n    createEvent(eventInterface: \\\"Event\\\"): Event;\\n    createEvent(eventInterface: \\\"Events\\\"): Event;\\n    createEvent(eventInterface: \\\"FocusEvent\\\"): FocusEvent;\\n    createEvent(eventInterface: \\\"FocusNavigationEvent\\\"): FocusNavigationEvent;\\n    createEvent(eventInterface: \\\"GamepadEvent\\\"): GamepadEvent;\\n    createEvent(eventInterface: \\\"HashChangeEvent\\\"): HashChangeEvent;\\n    createEvent(eventInterface: \\\"IDBVersionChangeEvent\\\"): IDBVersionChangeEvent;\\n    createEvent(eventInterface: \\\"InputEvent\\\"): InputEvent;\\n    createEvent(eventInterface: \\\"KeyboardEvent\\\"): KeyboardEvent;\\n    createEvent(eventInterface: \\\"ListeningStateChangedEvent\\\"): ListeningStateChangedEvent;\\n    createEvent(eventInterface: \\\"MSGestureEvent\\\"): MSGestureEvent;\\n    createEvent(eventInterface: \\\"MSMediaKeyMessageEvent\\\"): MSMediaKeyMessageEvent;\\n    createEvent(eventInterface: \\\"MSMediaKeyNeededEvent\\\"): MSMediaKeyNeededEvent;\\n    createEvent(eventInterface: \\\"MSPointerEvent\\\"): MSPointerEvent;\\n    createEvent(eventInterface: \\\"MediaEncryptedEvent\\\"): MediaEncryptedEvent;\\n    createEvent(eventInterface: \\\"MediaKeyMessageEvent\\\"): MediaKeyMessageEvent;\\n    createEvent(eventInterface: \\\"MediaQueryListEvent\\\"): MediaQueryListEvent;\\n    createEvent(eventInterface: \\\"MediaStreamErrorEvent\\\"): MediaStreamErrorEvent;\\n    createEvent(eventInterface: \\\"MediaStreamEvent\\\"): MediaStreamEvent;\\n    createEvent(eventInterface: \\\"MediaStreamTrackEvent\\\"): MediaStreamTrackEvent;\\n    createEvent(eventInterface: \\\"MessageEvent\\\"): MessageEvent;\\n    createEvent(eventInterface: \\\"MouseEvent\\\"): MouseEvent;\\n    createEvent(eventInterface: \\\"MouseEvents\\\"): MouseEvent;\\n    createEvent(eventInterface: \\\"MutationEvent\\\"): MutationEvent;\\n    createEvent(eventInterface: \\\"MutationEvents\\\"): MutationEvent;\\n    createEvent(eventInterface: \\\"OfflineAudioCompletionEvent\\\"): OfflineAudioCompletionEvent;\\n    createEvent(eventInterface: \\\"OverflowEvent\\\"): OverflowEvent;\\n    createEvent(eventInterface: \\\"PageTransitionEvent\\\"): PageTransitionEvent;\\n    createEvent(eventInterface: \\\"PaymentRequestUpdateEvent\\\"): PaymentRequestUpdateEvent;\\n    createEvent(eventInterface: \\\"PermissionRequestedEvent\\\"): PermissionRequestedEvent;\\n    createEvent(eventInterface: \\\"PointerEvent\\\"): PointerEvent;\\n    createEvent(eventInterface: \\\"PopStateEvent\\\"): PopStateEvent;\\n    createEvent(eventInterface: \\\"ProgressEvent\\\"): ProgressEvent;\\n    createEvent(eventInterface: \\\"PromiseRejectionEvent\\\"): PromiseRejectionEvent;\\n    createEvent(eventInterface: \\\"RTCDTMFToneChangeEvent\\\"): RTCDTMFToneChangeEvent;\\n    createEvent(eventInterface: \\\"RTCDataChannelEvent\\\"): RTCDataChannelEvent;\\n    createEvent(eventInterface: \\\"RTCDtlsTransportStateChangedEvent\\\"): RTCDtlsTransportStateChangedEvent;\\n    createEvent(eventInterface: \\\"RTCErrorEvent\\\"): RTCErrorEvent;\\n    createEvent(eventInterface: \\\"RTCIceCandidatePairChangedEvent\\\"): RTCIceCandidatePairChangedEvent;\\n    createEvent(eventInterface: \\\"RTCIceGathererEvent\\\"): RTCIceGathererEvent;\\n    createEvent(eventInterface: \\\"RTCIceTransportStateChangedEvent\\\"): RTCIceTransportStateChangedEvent;\\n    createEvent(eventInterface: \\\"RTCPeerConnectionIceErrorEvent\\\"): RTCPeerConnectionIceErrorEvent;\\n    createEvent(eventInterface: \\\"RTCPeerConnectionIceEvent\\\"): RTCPeerConnectionIceEvent;\\n    createEvent(eventInterface: \\\"RTCSsrcConflictEvent\\\"): RTCSsrcConflictEvent;\\n    createEvent(eventInterface: \\\"RTCStatsEvent\\\"): RTCStatsEvent;\\n    createEvent(eventInterface: \\\"RTCTrackEvent\\\"): RTCTrackEvent;\\n    createEvent(eventInterface: \\\"SVGZoomEvent\\\"): SVGZoomEvent;\\n    createEvent(eventInterface: \\\"SVGZoomEvents\\\"): SVGZoomEvent;\\n    createEvent(eventInterface: \\\"SecurityPolicyViolationEvent\\\"): SecurityPolicyViolationEvent;\\n    createEvent(eventInterface: \\\"ServiceWorkerMessageEvent\\\"): ServiceWorkerMessageEvent;\\n    createEvent(eventInterface: \\\"SpeechRecognitionErrorEvent\\\"): SpeechRecognitionErrorEvent;\\n    createEvent(eventInterface: \\\"SpeechRecognitionEvent\\\"): SpeechRecognitionEvent;\\n    createEvent(eventInterface: \\\"SpeechSynthesisErrorEvent\\\"): SpeechSynthesisErrorEvent;\\n    createEvent(eventInterface: \\\"SpeechSynthesisEvent\\\"): SpeechSynthesisEvent;\\n    createEvent(eventInterface: \\\"StorageEvent\\\"): StorageEvent;\\n    createEvent(eventInterface: \\\"TextEvent\\\"): TextEvent;\\n    createEvent(eventInterface: \\\"TouchEvent\\\"): TouchEvent;\\n    createEvent(eventInterface: \\\"TrackEvent\\\"): TrackEvent;\\n    createEvent(eventInterface: \\\"TransitionEvent\\\"): TransitionEvent;\\n    createEvent(eventInterface: \\\"UIEvent\\\"): UIEvent;\\n    createEvent(eventInterface: \\\"UIEvents\\\"): UIEvent;\\n    createEvent(eventInterface: \\\"VRDisplayEvent\\\"): VRDisplayEvent;\\n    createEvent(eventInterface: \\\"VRDisplayEvent \\\"): VRDisplayEvent ;\\n    createEvent(eventInterface: \\\"WebGLContextEvent\\\"): WebGLContextEvent;\\n    createEvent(eventInterface: \\\"WheelEvent\\\"): WheelEvent;\\n    createEvent(eventInterface: string): Event;\\n}\\n\\n/** A minimal document object that has no parent. It is used as a lightweight version of Document that stores a segment of a document structure comprised of nodes just like a standard document. The key difference is that because the document fragment isn't part of the active document tree structure, changes made to the fragment don't affect the document, cause reflow, or incur any performance impact that can occur when changes are made. */\\ninterface DocumentFragment extends Node, NonElementParentNode, ParentNode {\\n    readonly ownerDocument: Document;\\n    getElementById(elementId: string): HTMLElement | null;\\n}\\n\\ndeclare var DocumentFragment: {\\n    prototype: DocumentFragment;\\n    new(): DocumentFragment;\\n};\\n\\ninterface DocumentOrShadowRoot {\\n    readonly activeElement: Element | null;\\n    /**\\n     * Returns document's fullscreen element.\\n     */\\n    readonly fullscreenElement: Element | null;\\n    readonly pointerLockElement: Element | null;\\n    /**\\n     * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.\\n     */\\n    readonly styleSheets: StyleSheetList;\\n    caretPositionFromPoint(x: number, y: number): CaretPosition | null;\\n    /** @deprecated */\\n    caretRangeFromPoint(x: number, y: number): Range;\\n    elementFromPoint(x: number, y: number): Element | null;\\n    elementsFromPoint(x: number, y: number): Element[];\\n    getSelection(): Selection | null;\\n}\\n\\ninterface DocumentTimeline extends AnimationTimeline {\\n}\\n\\ndeclare var DocumentTimeline: {\\n    prototype: DocumentTimeline;\\n    new(options?: DocumentTimelineOptions): DocumentTimeline;\\n};\\n\\n/** A Node containing a doctype. */\\ninterface DocumentType extends Node, ChildNode {\\n    readonly name: string;\\n    readonly ownerDocument: Document;\\n    readonly publicId: string;\\n    readonly systemId: string;\\n}\\n\\ndeclare var DocumentType: {\\n    prototype: DocumentType;\\n    new(): DocumentType;\\n};\\n\\n/** A DOM event that represents a drag and drop interaction. The user initiates a drag by placing a pointer device (such as a mouse) on the touch surface and then dragging the pointer to a new location (such as another DOM element). Applications are free to interpret a drag and drop interaction in an application-specific way. */\\ninterface DragEvent extends MouseEvent {\\n    /**\\n     * Returns the DataTransfer object for the event.\\n     */\\n    readonly dataTransfer: DataTransfer | null;\\n}\\n\\ndeclare var DragEvent: {\\n    prototype: DragEvent;\\n    new(type: string, eventInitDict?: DragEventInit): DragEvent;\\n};\\n\\n/** Inherits properties from its parent, AudioNode. */\\ninterface DynamicsCompressorNode extends AudioNode {\\n    readonly attack: AudioParam;\\n    readonly knee: AudioParam;\\n    readonly ratio: AudioParam;\\n    readonly reduction: number;\\n    readonly release: AudioParam;\\n    readonly threshold: AudioParam;\\n}\\n\\ndeclare var DynamicsCompressorNode: {\\n    prototype: DynamicsCompressorNode;\\n    new(context: BaseAudioContext, options?: DynamicsCompressorOptions): DynamicsCompressorNode;\\n};\\n\\ninterface EXT_blend_minmax {\\n    readonly MAX_EXT: GLenum;\\n    readonly MIN_EXT: GLenum;\\n}\\n\\n/** The EXT_frag_depth extension is part of the WebGL API and enables to set a depth value of a fragment from within the fragment shader. */\\ninterface EXT_frag_depth {\\n}\\n\\ninterface EXT_sRGB {\\n    readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: GLenum;\\n    readonly SRGB8_ALPHA8_EXT: GLenum;\\n    readonly SRGB_ALPHA_EXT: GLenum;\\n    readonly SRGB_EXT: GLenum;\\n}\\n\\ninterface EXT_shader_texture_lod {\\n}\\n\\n/** The EXT_texture_filter_anisotropic extension is part of the WebGL API and exposes two constants for anisotropic filtering (AF). */\\ninterface EXT_texture_filter_anisotropic {\\n    readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum;\\n    readonly TEXTURE_MAX_ANISOTROPY_EXT: GLenum;\\n}\\n\\ninterface ElementEventMap {\\n    \\\"fullscreenchange\\\": Event;\\n    \\\"fullscreenerror\\\": Event;\\n}\\n\\n/** Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element. */\\ninterface Element extends Node, Animatable, ChildNode, InnerHTML, NonDocumentTypeChildNode, ParentNode, Slottable {\\n    readonly attributes: NamedNodeMap;\\n    /**\\n     * Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.\\n     */\\n    readonly classList: DOMTokenList;\\n    /**\\n     * Returns the value of element's class content attribute. Can be set to change it.\\n     */\\n    className: string;\\n    readonly clientHeight: number;\\n    readonly clientLeft: number;\\n    readonly clientTop: number;\\n    readonly clientWidth: number;\\n    /**\\n     * Returns the value of element's id content attribute. Can be set to change it.\\n     */\\n    id: string;\\n    /**\\n     * Returns the local name.\\n     */\\n    readonly localName: string;\\n    /**\\n     * Returns the namespace.\\n     */\\n    readonly namespaceURI: string | null;\\n    onfullscreenchange: ((this: Element, ev: Event) => any) | null;\\n    onfullscreenerror: ((this: Element, ev: Event) => any) | null;\\n    outerHTML: string;\\n    readonly ownerDocument: Document;\\n    /**\\n     * Returns the namespace prefix.\\n     */\\n    readonly prefix: string | null;\\n    readonly scrollHeight: number;\\n    scrollLeft: number;\\n    scrollTop: number;\\n    readonly scrollWidth: number;\\n    /**\\n     * Returns element's shadow root, if any, and if shadow root's mode is \\\"open\\\", and null otherwise.\\n     */\\n    readonly shadowRoot: ShadowRoot | null;\\n    /**\\n     * Returns the value of element's slot content attribute. Can be set to change it.\\n     */\\n    slot: string;\\n    /**\\n     * Returns the HTML-uppercased qualified name.\\n     */\\n    readonly tagName: string;\\n    /**\\n     * Creates a shadow root for element and returns it.\\n     */\\n    attachShadow(init: ShadowRootInit): ShadowRoot;\\n    /**\\n     * Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.\\n     */\\n    closest<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;\\n    closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K] | null;\\n    closest<E extends Element = Element>(selector: string): E | null;\\n    /**\\n     * Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.\\n     */\\n    getAttribute(qualifiedName: string): string | null;\\n    /**\\n     * Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.\\n     */\\n    getAttributeNS(namespace: string | null, localName: string): string | null;\\n    /**\\n     * Returns the qualified names of all element's attributes. Can contain duplicates.\\n     */\\n    getAttributeNames(): string[];\\n    getAttributeNode(qualifiedName: string): Attr | null;\\n    getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;\\n    getBoundingClientRect(): DOMRect;\\n    getClientRects(): DOMRectList;\\n    /**\\n     * Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.\\n     */\\n    getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;\\n    getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;\\n    getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;\\n    getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;\\n    getElementsByTagNameNS(namespaceURI: \\\"http://www.w3.org/1999/xhtml\\\", localName: string): HTMLCollectionOf<HTMLElement>;\\n    getElementsByTagNameNS(namespaceURI: \\\"http://www.w3.org/2000/svg\\\", localName: string): HTMLCollectionOf<SVGElement>;\\n    getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf<Element>;\\n    /**\\n     * Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.\\n     */\\n    hasAttribute(qualifiedName: string): boolean;\\n    /**\\n     * Returns true if element has an attribute whose namespace is namespace and local name is localName.\\n     */\\n    hasAttributeNS(namespace: string | null, localName: string): boolean;\\n    /**\\n     * Returns true if element has attributes, and false otherwise.\\n     */\\n    hasAttributes(): boolean;\\n    hasPointerCapture(pointerId: number): boolean;\\n    insertAdjacentElement(position: InsertPosition, insertedElement: Element): Element | null;\\n    insertAdjacentHTML(where: InsertPosition, html: string): void;\\n    insertAdjacentText(where: InsertPosition, text: string): void;\\n    /**\\n     * Returns true if matching selectors against element's root yields element, and false otherwise.\\n     */\\n    matches(selectors: string): boolean;\\n    msGetRegionContent(): any;\\n    releasePointerCapture(pointerId: number): void;\\n    /**\\n     * Removes element's first attribute whose qualified name is qualifiedName.\\n     */\\n    removeAttribute(qualifiedName: string): void;\\n    /**\\n     * Removes element's attribute whose namespace is namespace and local name is localName.\\n     */\\n    removeAttributeNS(namespace: string | null, localName: string): void;\\n    removeAttributeNode(attr: Attr): Attr;\\n    /**\\n     * Displays element fullscreen and resolves promise when done.\\n     * \\n     * When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to \\\"show\\\", navigation simplicity is preferred over screen space, and if set to \\\"hide\\\", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value \\\"auto\\\" indicates no application preference.\\n     */\\n    requestFullscreen(options?: FullscreenOptions): Promise<void>;\\n    requestPointerLock(): void;\\n    scroll(options?: ScrollToOptions): void;\\n    scroll(x: number, y: number): void;\\n    scrollBy(options?: ScrollToOptions): void;\\n    scrollBy(x: number, y: number): void;\\n    scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;\\n    scrollTo(options?: ScrollToOptions): void;\\n    scrollTo(x: number, y: number): void;\\n    /**\\n     * Sets the value of element's first attribute whose qualified name is qualifiedName to value.\\n     */\\n    setAttribute(qualifiedName: string, value: string): void;\\n    /**\\n     * Sets the value of element's attribute whose namespace is namespace and local name is localName to value.\\n     */\\n    setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;\\n    setAttributeNode(attr: Attr): Attr | null;\\n    setAttributeNodeNS(attr: Attr): Attr | null;\\n    setPointerCapture(pointerId: number): void;\\n    /**\\n     * If force is not given, \\\"toggles\\\" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.\\n     * \\n     * Returns true if qualifiedName is now present, and false otherwise.\\n     */\\n    toggleAttribute(qualifiedName: string, force?: boolean): boolean;\\n    webkitMatchesSelector(selectors: string): boolean;\\n    addEventListener<K extends keyof ElementEventMap>(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof ElementEventMap>(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var Element: {\\n    prototype: Element;\\n    new(): Element;\\n};\\n\\ninterface ElementCSSInlineStyle {\\n    readonly style: CSSStyleDeclaration;\\n}\\n\\ninterface ElementContentEditable {\\n    contentEditable: string;\\n    enterKeyHint: string;\\n    inputMode: string;\\n    readonly isContentEditable: boolean;\\n}\\n\\n/** Events providing information related to errors in scripts or in files. */\\ninterface ErrorEvent extends Event {\\n    readonly colno: number;\\n    readonly error: any;\\n    readonly filename: string;\\n    readonly lineno: number;\\n    readonly message: string;\\n}\\n\\ndeclare var ErrorEvent: {\\n    prototype: ErrorEvent;\\n    new(type: string, eventInitDict?: ErrorEventInit): ErrorEvent;\\n};\\n\\n/** An event which takes place in the DOM. */\\ninterface Event {\\n    /**\\n     * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.\\n     */\\n    readonly bubbles: boolean;\\n    cancelBubble: boolean;\\n    /**\\n     * Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method.\\n     */\\n    readonly cancelable: boolean;\\n    /**\\n     * Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise.\\n     */\\n    readonly composed: boolean;\\n    /**\\n     * Returns the object whose event listener's callback is currently being invoked.\\n     */\\n    readonly currentTarget: EventTarget | null;\\n    /**\\n     * Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.\\n     */\\n    readonly defaultPrevented: boolean;\\n    /**\\n     * Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.\\n     */\\n    readonly eventPhase: number;\\n    /**\\n     * Returns true if event was dispatched by the user agent, and false otherwise.\\n     */\\n    readonly isTrusted: boolean;\\n    returnValue: boolean;\\n    /** @deprecated */\\n    readonly srcElement: EventTarget | null;\\n    /**\\n     * Returns the object to which event is dispatched (its target).\\n     */\\n    readonly target: EventTarget | null;\\n    /**\\n     * Returns the event's timestamp as the number of milliseconds measured relative to the time origin.\\n     */\\n    readonly timeStamp: number;\\n    /**\\n     * Returns the type of event, e.g. \\\"click\\\", \\\"hashchange\\\", or \\\"submit\\\".\\n     */\\n    readonly type: string;\\n    /**\\n     * Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is \\\"closed\\\" that are not reachable from event's currentTarget.\\n     */\\n    composedPath(): EventTarget[];\\n    initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;\\n    /**\\n     * If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.\\n     */\\n    preventDefault(): void;\\n    /**\\n     * Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.\\n     */\\n    stopImmediatePropagation(): void;\\n    /**\\n     * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.\\n     */\\n    stopPropagation(): void;\\n    readonly AT_TARGET: number;\\n    readonly BUBBLING_PHASE: number;\\n    readonly CAPTURING_PHASE: number;\\n    readonly NONE: number;\\n}\\n\\ndeclare var Event: {\\n    prototype: Event;\\n    new(type: string, eventInitDict?: EventInit): Event;\\n    readonly AT_TARGET: number;\\n    readonly BUBBLING_PHASE: number;\\n    readonly CAPTURING_PHASE: number;\\n    readonly NONE: number;\\n};\\n\\ninterface EventListenerObject {\\n    handleEvent(evt: Event): void;\\n}\\n\\ninterface EventSourceEventMap {\\n    \\\"error\\\": Event;\\n    \\\"message\\\": MessageEvent;\\n    \\\"open\\\": Event;\\n}\\n\\ninterface EventSource extends EventTarget {\\n    onerror: ((this: EventSource, ev: Event) => any) | null;\\n    onmessage: ((this: EventSource, ev: MessageEvent) => any) | null;\\n    onopen: ((this: EventSource, ev: Event) => any) | null;\\n    /**\\n     * Returns the state of this EventSource object's connection. It can have the values described below.\\n     */\\n    readonly readyState: number;\\n    /**\\n     * Returns the URL providing the event stream.\\n     */\\n    readonly url: string;\\n    /**\\n     * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to \\\"include\\\", and false otherwise.\\n     */\\n    readonly withCredentials: boolean;\\n    /**\\n     * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.\\n     */\\n    close(): void;\\n    readonly CLOSED: number;\\n    readonly CONNECTING: number;\\n    readonly OPEN: number;\\n    addEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var EventSource: {\\n    prototype: EventSource;\\n    new(url: string, eventSourceInitDict?: EventSourceInit): EventSource;\\n    readonly CLOSED: number;\\n    readonly CONNECTING: number;\\n    readonly OPEN: number;\\n};\\n\\n/** EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. */\\ninterface EventTarget {\\n    /**\\n     * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.\\n     * \\n     * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.\\n     * \\n     * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.\\n     * \\n     * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.\\n     * \\n     * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.\\n     * \\n     * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.\\n     */\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;\\n    /**\\n     * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.\\n     */\\n    dispatchEvent(event: Event): boolean;\\n    /**\\n     * Removes the event listener in target's event listener list with the same type, callback, and options.\\n     */\\n    removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;\\n}\\n\\ndeclare var EventTarget: {\\n    prototype: EventTarget;\\n    new(): EventTarget;\\n};\\n\\ninterface ExtensionScriptApis {\\n    extensionIdToShortId(extensionId: string): number;\\n    fireExtensionApiTelemetry(functionName: string, isSucceeded: boolean, isSupported: boolean, errorString: string): void;\\n    genericFunction(routerAddress: any, parameters?: string, callbackId?: number): void;\\n    genericSynchronousFunction(functionId: number, parameters?: string): string;\\n    genericWebRuntimeCallout(to: any, from: any, payload: string): void;\\n    getExtensionId(): string;\\n    registerGenericFunctionCallbackHandler(callbackHandler: Function): void;\\n    registerGenericPersistentCallbackHandler(callbackHandler: Function): void;\\n    registerWebRuntimeCallbackHandler(handler: Function): any;\\n}\\n\\ndeclare var ExtensionScriptApis: {\\n    prototype: ExtensionScriptApis;\\n    new(): ExtensionScriptApis;\\n};\\n\\ninterface External {\\n    /** @deprecated */\\n    AddSearchProvider(): void;\\n    /** @deprecated */\\n    IsSearchProviderInstalled(): void;\\n}\\n\\ndeclare var External: {\\n    prototype: External;\\n    new(): External;\\n};\\n\\n/** Provides information about files and allows JavaScript in a web page to access their content. */\\ninterface File extends Blob {\\n    readonly lastModified: number;\\n    readonly name: string;\\n}\\n\\ndeclare var File: {\\n    prototype: File;\\n    new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;\\n};\\n\\n/** An object of this type is returned by the files property of the HTML <input> element; this lets you access the list of files selected with the <input type=\\\"file\\\"> element. It's also used for a list of files dropped into web content when using the drag and drop API; see the DataTransfer object for details on this usage. */\\ninterface FileList {\\n    readonly length: number;\\n    item(index: number): File | null;\\n    [index: number]: File;\\n}\\n\\ndeclare var FileList: {\\n    prototype: FileList;\\n    new(): FileList;\\n};\\n\\ninterface FileReaderEventMap {\\n    \\\"abort\\\": ProgressEvent<FileReader>;\\n    \\\"error\\\": ProgressEvent<FileReader>;\\n    \\\"load\\\": ProgressEvent<FileReader>;\\n    \\\"loadend\\\": ProgressEvent<FileReader>;\\n    \\\"loadstart\\\": ProgressEvent<FileReader>;\\n    \\\"progress\\\": ProgressEvent<FileReader>;\\n}\\n\\n/** Lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read. */\\ninterface FileReader extends EventTarget {\\n    readonly error: DOMException | null;\\n    onabort: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;\\n    onerror: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;\\n    onload: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;\\n    onloadend: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;\\n    onloadstart: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;\\n    onprogress: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;\\n    readonly readyState: number;\\n    readonly result: string | ArrayBuffer | null;\\n    abort(): void;\\n    readAsArrayBuffer(blob: Blob): void;\\n    readAsBinaryString(blob: Blob): void;\\n    readAsDataURL(blob: Blob): void;\\n    readAsText(blob: Blob, encoding?: string): void;\\n    readonly DONE: number;\\n    readonly EMPTY: number;\\n    readonly LOADING: number;\\n    addEventListener<K extends keyof FileReaderEventMap>(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof FileReaderEventMap>(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var FileReader: {\\n    prototype: FileReader;\\n    new(): FileReader;\\n    readonly DONE: number;\\n    readonly EMPTY: number;\\n    readonly LOADING: number;\\n};\\n\\n/** Focus-related events like focus, blur, focusin, or focusout. */\\ninterface FocusEvent extends UIEvent {\\n    readonly relatedTarget: EventTarget | null;\\n}\\n\\ndeclare var FocusEvent: {\\n    prototype: FocusEvent;\\n    new(type: string, eventInitDict?: FocusEventInit): FocusEvent;\\n};\\n\\ninterface FocusNavigationEvent extends Event {\\n    readonly navigationReason: NavigationReason;\\n    readonly originHeight: number;\\n    readonly originLeft: number;\\n    readonly originTop: number;\\n    readonly originWidth: number;\\n    requestFocus(): void;\\n}\\n\\ndeclare var FocusNavigationEvent: {\\n    prototype: FocusNavigationEvent;\\n    new(type: string, eventInitDict?: FocusNavigationEventInit): FocusNavigationEvent;\\n};\\n\\n/** Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to \\\"multipart/form-data\\\". */\\ninterface FormData {\\n    append(name: string, value: string | Blob, fileName?: string): void;\\n    delete(name: string): void;\\n    get(name: string): FormDataEntryValue | null;\\n    getAll(name: string): FormDataEntryValue[];\\n    has(name: string): boolean;\\n    set(name: string, value: string | Blob, fileName?: string): void;\\n    forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;\\n}\\n\\ndeclare var FormData: {\\n    prototype: FormData;\\n    new(form?: HTMLFormElement): FormData;\\n};\\n\\n/** A change in volume. It is an AudioNode audio-processing module that causes a given gain to be applied to the input data before its propagation to the output. A GainNode always has exactly one input and one output, both with the same number of channels. */\\ninterface GainNode extends AudioNode {\\n    readonly gain: AudioParam;\\n}\\n\\ndeclare var GainNode: {\\n    prototype: GainNode;\\n    new(context: BaseAudioContext, options?: GainOptions): GainNode;\\n};\\n\\n/** This Gamepad API interface defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id. */\\ninterface Gamepad {\\n    readonly axes: ReadonlyArray<number>;\\n    readonly buttons: ReadonlyArray<GamepadButton>;\\n    readonly connected: boolean;\\n    readonly hand: GamepadHand;\\n    readonly hapticActuators: ReadonlyArray<GamepadHapticActuator>;\\n    readonly id: string;\\n    readonly index: number;\\n    readonly mapping: GamepadMappingType;\\n    readonly pose: GamepadPose | null;\\n    readonly timestamp: number;\\n}\\n\\ndeclare var Gamepad: {\\n    prototype: Gamepad;\\n    new(): Gamepad;\\n};\\n\\n/** An individual button of a gamepad or other controller, allowing access to the current state of different types of buttons available on the control device. */\\ninterface GamepadButton {\\n    readonly pressed: boolean;\\n    readonly touched: boolean;\\n    readonly value: number;\\n}\\n\\ndeclare var GamepadButton: {\\n    prototype: GamepadButton;\\n    new(): GamepadButton;\\n};\\n\\n/** This Gamepad API interface contains references to gamepads connected to the system, which is what the gamepad events Window.gamepadconnected and Window.gamepaddisconnected are fired in response to. */\\ninterface GamepadEvent extends Event {\\n    readonly gamepad: Gamepad;\\n}\\n\\ndeclare var GamepadEvent: {\\n    prototype: GamepadEvent;\\n    new(type: string, eventInitDict: GamepadEventInit): GamepadEvent;\\n};\\n\\n/** This Gamepad API interface represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware. */\\ninterface GamepadHapticActuator {\\n    readonly type: GamepadHapticActuatorType;\\n    pulse(value: number, duration: number): Promise<boolean>;\\n}\\n\\ndeclare var GamepadHapticActuator: {\\n    prototype: GamepadHapticActuator;\\n    new(): GamepadHapticActuator;\\n};\\n\\n/** This Gamepad API interface represents the pose of a WebVR controller at a given timestamp (which includes orientation, position, velocity, and acceleration information.) */\\ninterface GamepadPose {\\n    readonly angularAcceleration: Float32Array | null;\\n    readonly angularVelocity: Float32Array | null;\\n    readonly hasOrientation: boolean;\\n    readonly hasPosition: boolean;\\n    readonly linearAcceleration: Float32Array | null;\\n    readonly linearVelocity: Float32Array | null;\\n    readonly orientation: Float32Array | null;\\n    readonly position: Float32Array | null;\\n}\\n\\ndeclare var GamepadPose: {\\n    prototype: GamepadPose;\\n    new(): GamepadPose;\\n};\\n\\ninterface GenericTransformStream {\\n    readonly readable: ReadableStream;\\n    readonly writable: WritableStream;\\n}\\n\\n/** An object able to programmatically obtain the position of the device. It gives Web content access to the location of the device. This allows a Web site or app to offer customized results based on the user's location. */\\ninterface Geolocation {\\n    clearWatch(watchId: number): void;\\n    getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void;\\n    watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number;\\n}\\n\\ndeclare var Geolocation: {\\n    prototype: Geolocation;\\n    new(): Geolocation;\\n};\\n\\ninterface GeolocationCoordinates {\\n    readonly accuracy: number;\\n    readonly altitude: number | null;\\n    readonly altitudeAccuracy: number | null;\\n    readonly heading: number | null;\\n    readonly latitude: number;\\n    readonly longitude: number;\\n    readonly speed: number | null;\\n}\\n\\ndeclare var GeolocationCoordinates: {\\n    prototype: GeolocationCoordinates;\\n    new(): GeolocationCoordinates;\\n};\\n\\ninterface GeolocationPosition {\\n    readonly coords: GeolocationCoordinates;\\n    readonly timestamp: number;\\n}\\n\\ndeclare var GeolocationPosition: {\\n    prototype: GeolocationPosition;\\n    new(): GeolocationPosition;\\n};\\n\\ninterface GeolocationPositionError {\\n    readonly code: number;\\n    readonly message: string;\\n    readonly PERMISSION_DENIED: number;\\n    readonly POSITION_UNAVAILABLE: number;\\n    readonly TIMEOUT: number;\\n}\\n\\ndeclare var GeolocationPositionError: {\\n    prototype: GeolocationPositionError;\\n    new(): GeolocationPositionError;\\n    readonly PERMISSION_DENIED: number;\\n    readonly POSITION_UNAVAILABLE: number;\\n    readonly TIMEOUT: number;\\n};\\n\\ninterface GlobalEventHandlersEventMap {\\n    \\\"abort\\\": UIEvent;\\n    \\\"animationcancel\\\": AnimationEvent;\\n    \\\"animationend\\\": AnimationEvent;\\n    \\\"animationiteration\\\": AnimationEvent;\\n    \\\"animationstart\\\": AnimationEvent;\\n    \\\"auxclick\\\": MouseEvent;\\n    \\\"beforeinput\\\": InputEvent;\\n    \\\"blur\\\": FocusEvent;\\n    \\\"cancel\\\": Event;\\n    \\\"canplay\\\": Event;\\n    \\\"canplaythrough\\\": Event;\\n    \\\"change\\\": Event;\\n    \\\"click\\\": MouseEvent;\\n    \\\"close\\\": Event;\\n    \\\"compositionend\\\": CompositionEvent;\\n    \\\"compositionstart\\\": CompositionEvent;\\n    \\\"compositionupdate\\\": CompositionEvent;\\n    \\\"contextmenu\\\": MouseEvent;\\n    \\\"cuechange\\\": Event;\\n    \\\"dblclick\\\": MouseEvent;\\n    \\\"drag\\\": DragEvent;\\n    \\\"dragend\\\": DragEvent;\\n    \\\"dragenter\\\": DragEvent;\\n    \\\"dragexit\\\": Event;\\n    \\\"dragleave\\\": DragEvent;\\n    \\\"dragover\\\": DragEvent;\\n    \\\"dragstart\\\": DragEvent;\\n    \\\"drop\\\": DragEvent;\\n    \\\"durationchange\\\": Event;\\n    \\\"emptied\\\": Event;\\n    \\\"ended\\\": Event;\\n    \\\"error\\\": ErrorEvent;\\n    \\\"focus\\\": FocusEvent;\\n    \\\"focusin\\\": FocusEvent;\\n    \\\"focusout\\\": FocusEvent;\\n    \\\"gotpointercapture\\\": PointerEvent;\\n    \\\"input\\\": Event;\\n    \\\"invalid\\\": Event;\\n    \\\"keydown\\\": KeyboardEvent;\\n    \\\"keypress\\\": KeyboardEvent;\\n    \\\"keyup\\\": KeyboardEvent;\\n    \\\"load\\\": Event;\\n    \\\"loadeddata\\\": Event;\\n    \\\"loadedmetadata\\\": Event;\\n    \\\"loadstart\\\": Event;\\n    \\\"lostpointercapture\\\": PointerEvent;\\n    \\\"mousedown\\\": MouseEvent;\\n    \\\"mouseenter\\\": MouseEvent;\\n    \\\"mouseleave\\\": MouseEvent;\\n    \\\"mousemove\\\": MouseEvent;\\n    \\\"mouseout\\\": MouseEvent;\\n    \\\"mouseover\\\": MouseEvent;\\n    \\\"mouseup\\\": MouseEvent;\\n    \\\"pause\\\": Event;\\n    \\\"play\\\": Event;\\n    \\\"playing\\\": Event;\\n    \\\"pointercancel\\\": PointerEvent;\\n    \\\"pointerdown\\\": PointerEvent;\\n    \\\"pointerenter\\\": PointerEvent;\\n    \\\"pointerleave\\\": PointerEvent;\\n    \\\"pointermove\\\": PointerEvent;\\n    \\\"pointerout\\\": PointerEvent;\\n    \\\"pointerover\\\": PointerEvent;\\n    \\\"pointerup\\\": PointerEvent;\\n    \\\"progress\\\": ProgressEvent;\\n    \\\"ratechange\\\": Event;\\n    \\\"reset\\\": Event;\\n    \\\"resize\\\": UIEvent;\\n    \\\"scroll\\\": Event;\\n    \\\"securitypolicyviolation\\\": SecurityPolicyViolationEvent;\\n    \\\"seeked\\\": Event;\\n    \\\"seeking\\\": Event;\\n    \\\"select\\\": Event;\\n    \\\"selectionchange\\\": Event;\\n    \\\"selectstart\\\": Event;\\n    \\\"stalled\\\": Event;\\n    \\\"submit\\\": Event;\\n    \\\"suspend\\\": Event;\\n    \\\"timeupdate\\\": Event;\\n    \\\"toggle\\\": Event;\\n    \\\"touchcancel\\\": TouchEvent;\\n    \\\"touchend\\\": TouchEvent;\\n    \\\"touchmove\\\": TouchEvent;\\n    \\\"touchstart\\\": TouchEvent;\\n    \\\"transitioncancel\\\": TransitionEvent;\\n    \\\"transitionend\\\": TransitionEvent;\\n    \\\"transitionrun\\\": TransitionEvent;\\n    \\\"transitionstart\\\": TransitionEvent;\\n    \\\"volumechange\\\": Event;\\n    \\\"waiting\\\": Event;\\n    \\\"wheel\\\": WheelEvent;\\n}\\n\\ninterface GlobalEventHandlers {\\n    /**\\n     * Fires when the user aborts the download.\\n     * @param ev The event.\\n     */\\n    onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;\\n    onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;\\n    onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;\\n    onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;\\n    onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;\\n    onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\\n    /**\\n     * Fires when the object loses the input focus.\\n     * @param ev The focus event.\\n     */\\n    onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;\\n    oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Occurs when playback is possible, but would require further buffering.\\n     * @param ev The event.\\n     */\\n    oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Fires when the contents of the object or selection have changed.\\n     * @param ev The event.\\n     */\\n    onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Fires when the user clicks the left mouse button on the object\\n     * @param ev The mouse event.\\n     */\\n    onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\\n    onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Fires when the user clicks the right mouse button in the client area, opening the context menu.\\n     * @param ev The mouse event.\\n     */\\n    oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\\n    oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Fires when the user double-clicks the object.\\n     * @param ev The mouse event.\\n     */\\n    ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\\n    /**\\n     * Fires on the source object continuously during a drag operation.\\n     * @param ev The event.\\n     */\\n    ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;\\n    /**\\n     * Fires on the source object when the user releases the mouse at the close of a drag operation.\\n     * @param ev The event.\\n     */\\n    ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;\\n    /**\\n     * Fires on the target element when the user drags the object to a valid drop target.\\n     * @param ev The drag event.\\n     */\\n    ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;\\n    ondragexit: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.\\n     * @param ev The drag event.\\n     */\\n    ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;\\n    /**\\n     * Fires on the target element continuously while the user drags the object over a valid drop target.\\n     * @param ev The event.\\n     */\\n    ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;\\n    /**\\n     * Fires on the source object when the user starts to drag a text selection or selected object.\\n     * @param ev The event.\\n     */\\n    ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;\\n    ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;\\n    /**\\n     * Occurs when the duration attribute is updated.\\n     * @param ev The event.\\n     */\\n    ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Occurs when the media element is reset to its initial state.\\n     * @param ev The event.\\n     */\\n    onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Occurs when the end of playback is reached.\\n     * @param ev The event\\n     */\\n    onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Fires when an error occurs during object loading.\\n     * @param ev The event.\\n     */\\n    onerror: OnErrorEventHandler;\\n    /**\\n     * Fires when the object receives focus.\\n     * @param ev The event.\\n     */\\n    onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;\\n    ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\\n    oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Fires when the user presses a key.\\n     * @param ev The keyboard event\\n     */\\n    onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;\\n    /**\\n     * Fires when the user presses an alphanumeric key.\\n     * @param ev The event.\\n     */\\n    onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;\\n    /**\\n     * Fires when the user releases a key.\\n     * @param ev The keyboard event\\n     */\\n    onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;\\n    /**\\n     * Fires immediately after the browser loads the object.\\n     * @param ev The event.\\n     */\\n    onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Occurs when media data is loaded at the current playback position.\\n     * @param ev The event.\\n     */\\n    onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Occurs when the duration and dimensions of the media have been determined.\\n     * @param ev The event.\\n     */\\n    onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Occurs when Internet Explorer begins looking for media data.\\n     * @param ev The event.\\n     */\\n    onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\\n    /**\\n     * Fires when the user clicks the object with either mouse button.\\n     * @param ev The mouse event.\\n     */\\n    onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\\n    onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\\n    onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\\n    /**\\n     * Fires when the user moves the mouse over the object.\\n     * @param ev The mouse event.\\n     */\\n    onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\\n    /**\\n     * Fires when the user moves the mouse pointer outside the boundaries of the object.\\n     * @param ev The mouse event.\\n     */\\n    onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\\n    /**\\n     * Fires when the user moves the mouse pointer into the object.\\n     * @param ev The mouse event.\\n     */\\n    onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\\n    /**\\n     * Fires when the user releases a mouse button while the mouse is over the object.\\n     * @param ev The mouse event.\\n     */\\n    onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\\n    /**\\n     * Occurs when playback is paused.\\n     * @param ev The event.\\n     */\\n    onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Occurs when the play method is requested.\\n     * @param ev The event.\\n     */\\n    onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Occurs when the audio or video has started playing.\\n     * @param ev The event.\\n     */\\n    onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\\n    onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\\n    onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\\n    onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\\n    onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\\n    onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\\n    onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\\n    onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\\n    /**\\n     * Occurs to indicate progress while downloading media data.\\n     * @param ev The event.\\n     */\\n    onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;\\n    /**\\n     * Occurs when the playback rate is increased or decreased.\\n     * @param ev The event.\\n     */\\n    onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Fires when the user resets a form.\\n     * @param ev The event.\\n     */\\n    onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;\\n    /**\\n     * Fires when the user repositions the scroll box in the scroll bar on the object.\\n     * @param ev The event.\\n     */\\n    onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;\\n    /**\\n     * Occurs when the seek operation ends.\\n     * @param ev The event.\\n     */\\n    onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Occurs when the current playback position is moved.\\n     * @param ev The event.\\n     */\\n    onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Fires when the current selection changes.\\n     * @param ev The event.\\n     */\\n    onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Occurs when the download has stopped.\\n     * @param ev The event.\\n     */\\n    onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    onsubmit: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Occurs if the load operation has been intentionally halted.\\n     * @param ev The event.\\n     */\\n    onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Occurs to indicate the current playback position.\\n     * @param ev The event.\\n     */\\n    ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;\\n    ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;\\n    ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;\\n    ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;\\n    ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;\\n    ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;\\n    ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;\\n    ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;\\n    /**\\n     * Occurs when the volume is changed, or playback is muted or unmuted.\\n     * @param ev The event.\\n     */\\n    onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    /**\\n     * Occurs when playback stops because the next frame of a video resource is not available.\\n     * @param ev The event.\\n     */\\n    onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;\\n    onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;\\n    addEventListener<K extends keyof GlobalEventHandlersEventMap>(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof GlobalEventHandlersEventMap>(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ninterface HTMLAllCollection {\\n    /**\\n     * Returns the number of elements in the collection.\\n     */\\n    readonly length: number;\\n    /**\\n     * Returns the item with index index from the collection (determined by tree order).\\n     */\\n    item(nameOrIndex?: string): HTMLCollection | Element | null;\\n    /**\\n     * Returns the item with ID or name name from the collection.\\n     * \\n     * If there are multiple matching items, then an HTMLCollection object containing all those elements is returned.\\n     * \\n     * Only button, form, iframe, input, map, meta, object, select, and textarea elements can have a name for the purpose of this method; their name is given by the value of their name attribute.\\n     */\\n    namedItem(name: string): HTMLCollection | Element | null;\\n    [index: number]: Element;\\n}\\n\\ndeclare var HTMLAllCollection: {\\n    prototype: HTMLAllCollection;\\n    new(): HTMLAllCollection;\\n};\\n\\n/** Hyperlink elements and provides special properties and methods (beyond those of the regular HTMLElement object interface that they inherit from) for manipulating the layout and presentation of such elements. */\\ninterface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils {\\n    /**\\n     * Sets or retrieves the character set used to encode the object.\\n     */\\n    /** @deprecated */\\n    charset: string;\\n    /**\\n     * Sets or retrieves the coordinates of the object.\\n     */\\n    /** @deprecated */\\n    coords: string;\\n    download: string;\\n    /**\\n     * Sets or retrieves the language code of the object.\\n     */\\n    hreflang: string;\\n    /**\\n     * Sets or retrieves the shape of the object.\\n     */\\n    /** @deprecated */\\n    name: string;\\n    ping: string;\\n    referrerPolicy: string;\\n    /**\\n     * Sets or retrieves the relationship between the object and the destination of the link.\\n     */\\n    rel: string;\\n    readonly relList: DOMTokenList;\\n    /**\\n     * Sets or retrieves the relationship between the object and the destination of the link.\\n     */\\n    /** @deprecated */\\n    rev: string;\\n    /**\\n     * Sets or retrieves the shape of the object.\\n     */\\n    /** @deprecated */\\n    shape: string;\\n    /**\\n     * Sets or retrieves the window or frame at which to target content.\\n     */\\n    target: string;\\n    /**\\n     * Retrieves or sets the text of the object as a string.\\n     */\\n    text: string;\\n    type: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLAnchorElement: {\\n    prototype: HTMLAnchorElement;\\n    new(): HTMLAnchorElement;\\n};\\n\\ninterface HTMLAppletElement extends HTMLElement {\\n    /** @deprecated */\\n    align: string;\\n    /**\\n     * Sets or retrieves a text alternative to the graphic.\\n     */\\n    /** @deprecated */\\n    alt: string;\\n    /**\\n     * Sets or retrieves a character string that can be used to implement your own archive functionality for the object.\\n     */\\n    /** @deprecated */\\n    archive: string;\\n    /** @deprecated */\\n    code: string;\\n    /**\\n     * Sets or retrieves the URL of the component.\\n     */\\n    /** @deprecated */\\n    codeBase: string;\\n    readonly form: HTMLFormElement | null;\\n    /**\\n     * Sets or retrieves the height of the object.\\n     */\\n    /** @deprecated */\\n    height: string;\\n    /** @deprecated */\\n    hspace: number;\\n    /**\\n     * Sets or retrieves the shape of the object.\\n     */\\n    /** @deprecated */\\n    name: string;\\n    /** @deprecated */\\n    object: string;\\n    /** @deprecated */\\n    vspace: number;\\n    /** @deprecated */\\n    width: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLAppletElement: {\\n    prototype: HTMLAppletElement;\\n    new(): HTMLAppletElement;\\n};\\n\\n/** Provides special properties and methods (beyond those of the regular object HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of <area> elements. */\\ninterface HTMLAreaElement extends HTMLElement, HTMLHyperlinkElementUtils {\\n    /**\\n     * Sets or retrieves a text alternative to the graphic.\\n     */\\n    alt: string;\\n    /**\\n     * Sets or retrieves the coordinates of the object.\\n     */\\n    coords: string;\\n    download: string;\\n    /**\\n     * Sets or gets whether clicks in this region cause action.\\n     */\\n    /** @deprecated */\\n    noHref: boolean;\\n    ping: string;\\n    referrerPolicy: string;\\n    rel: string;\\n    readonly relList: DOMTokenList;\\n    /**\\n     * Sets or retrieves the shape of the object.\\n     */\\n    shape: string;\\n    /**\\n     * Sets or retrieves the window or frame at which to target content.\\n     */\\n    target: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLAreaElement: {\\n    prototype: HTMLAreaElement;\\n    new(): HTMLAreaElement;\\n};\\n\\n/** Provides access to the properties of <audio> elements, as well as methods to manipulate them. It derives from the HTMLMediaElement interface. */\\ninterface HTMLAudioElement extends HTMLMediaElement {\\n    addEventListener<K extends keyof HTMLMediaElementEventMap>(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLMediaElementEventMap>(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLAudioElement: {\\n    prototype: HTMLAudioElement;\\n    new(): HTMLAudioElement;\\n};\\n\\n/** A HTML line break element (<br>). It inherits from HTMLElement. */\\ninterface HTMLBRElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document.\\n     */\\n    /** @deprecated */\\n    clear: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLBRElement: {\\n    prototype: HTMLBRElement;\\n    new(): HTMLBRElement;\\n};\\n\\n/** Contains the base URI for a document. This object inherits all of the properties and methods as described in the HTMLElement interface. */\\ninterface HTMLBaseElement extends HTMLElement {\\n    /**\\n     * Gets or sets the baseline URL on which relative links are based.\\n     */\\n    href: string;\\n    /**\\n     * Sets or retrieves the window or frame at which to target content.\\n     */\\n    target: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLBaseElement: {\\n    prototype: HTMLBaseElement;\\n    new(): HTMLBaseElement;\\n};\\n\\n/** Provides special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating <basefont> elements. */\\ninterface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty {\\n    /**\\n     * Sets or retrieves the current typeface family.\\n     */\\n    /** @deprecated */\\n    face: string;\\n    /**\\n     * Sets or retrieves the font size of the object.\\n     */\\n    /** @deprecated */\\n    size: number;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLBaseFontElement: {\\n    prototype: HTMLBaseFontElement;\\n    new(): HTMLBaseFontElement;\\n};\\n\\ninterface HTMLBodyElementEventMap extends HTMLElementEventMap, WindowEventHandlersEventMap {\\n    \\\"orientationchange\\\": Event;\\n}\\n\\n/** Provides special properties (beyond those inherited from the regular HTMLElement interface) for manipulating <body> elements. */\\ninterface HTMLBodyElement extends HTMLElement, WindowEventHandlers {\\n    /** @deprecated */\\n    aLink: string;\\n    /** @deprecated */\\n    background: string;\\n    /** @deprecated */\\n    bgColor: string;\\n    /** @deprecated */\\n    link: string;\\n    /** @deprecated */\\n    onorientationchange: ((this: HTMLBodyElement, ev: Event) => any) | null;\\n    /** @deprecated */\\n    text: string;\\n    /** @deprecated */\\n    vLink: string;\\n    addEventListener<K extends keyof HTMLBodyElementEventMap>(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLBodyElementEventMap>(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLBodyElement: {\\n    prototype: HTMLBodyElement;\\n    new(): HTMLBodyElement;\\n};\\n\\n/** Provides properties and methods (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating <button> elements. */\\ninterface HTMLButtonElement extends HTMLElement {\\n    disabled: boolean;\\n    /**\\n     * Retrieves a reference to the form that the object is embedded in.\\n     */\\n    readonly form: HTMLFormElement | null;\\n    /**\\n     * Overrides the action attribute (where the data on a form is sent) on the parent form element.\\n     */\\n    formAction: string;\\n    /**\\n     * Used to override the encoding (formEnctype attribute) specified on the form element.\\n     */\\n    formEnctype: string;\\n    /**\\n     * Overrides the submit method attribute previously specified on a form element.\\n     */\\n    formMethod: string;\\n    /**\\n     * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a \\\"save draft\\\"-type submit option.\\n     */\\n    formNoValidate: boolean;\\n    /**\\n     * Overrides the target attribute on a form element.\\n     */\\n    formTarget: string;\\n    readonly labels: NodeListOf<HTMLLabelElement>;\\n    /**\\n     * Sets or retrieves the name of the object.\\n     */\\n    name: string;\\n    /**\\n     * Gets the classification and default behavior of the button.\\n     */\\n    type: string;\\n    /**\\n     * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \\\"this is a required field\\\". The result is that the user sees validation messages without actually submitting.\\n     */\\n    readonly validationMessage: string;\\n    /**\\n     * Returns a  ValidityState object that represents the validity states of an element.\\n     */\\n    readonly validity: ValidityState;\\n    /**\\n     * Sets or retrieves the default or selected value of the control.\\n     */\\n    value: string;\\n    /**\\n     * Returns whether an element will successfully validate based on forms validation rules and constraints.\\n     */\\n    readonly willValidate: boolean;\\n    /**\\n     * Returns whether a form will validate when it is submitted, without having to submit it.\\n     */\\n    checkValidity(): boolean;\\n    reportValidity(): boolean;\\n    /**\\n     * Sets a custom error message that is displayed when a form is submitted.\\n     * @param error Sets a custom error message that is displayed when a form is submitted.\\n     */\\n    setCustomValidity(error: string): void;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLButtonElement: {\\n    prototype: HTMLButtonElement;\\n    new(): HTMLButtonElement;\\n};\\n\\n/** Provides properties and methods for manipulating the layout and presentation of <canvas> elements. The HTMLCanvasElement interface also inherits the properties and methods of the HTMLElement interface. */\\ninterface HTMLCanvasElement extends HTMLElement {\\n    /**\\n     * Gets or sets the height of a canvas element on a document.\\n     */\\n    height: number;\\n    /**\\n     * Gets or sets the width of a canvas element on a document.\\n     */\\n    width: number;\\n    /**\\n     * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas.\\n     * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext(\\\"2d\\\"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext(\\\"experimental-webgl\\\");\\n     */\\n    getContext(contextId: \\\"2d\\\", options?: CanvasRenderingContext2DSettings): CanvasRenderingContext2D | null;\\n    getContext(contextId: \\\"bitmaprenderer\\\", options?: ImageBitmapRenderingContextSettings): ImageBitmapRenderingContext | null;\\n    getContext(contextId: \\\"webgl\\\", options?: WebGLContextAttributes): WebGLRenderingContext | null;\\n    getContext(contextId: \\\"webgl2\\\", options?: WebGLContextAttributes): WebGL2RenderingContext | null;\\n    getContext(contextId: string, options?: any): RenderingContext | null;\\n    toBlob(callback: BlobCallback, type?: string, quality?: any): void;\\n    /**\\n     * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.\\n     * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image.\\n     */\\n    toDataURL(type?: string, quality?: any): string;\\n    transferControlToOffscreen(): OffscreenCanvas;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLCanvasElement: {\\n    prototype: HTMLCanvasElement;\\n    new(): HTMLCanvasElement;\\n};\\n\\n/** A generic collection (array-like object similar to arguments) of elements (in document order) and offers methods and properties for selecting from the list. */\\ninterface HTMLCollectionBase {\\n    /**\\n     * Sets or retrieves the number of objects in a collection.\\n     */\\n    readonly length: number;\\n    /**\\n     * Retrieves an object from various collections.\\n     */\\n    item(index: number): Element | null;\\n    [index: number]: Element;\\n}\\n\\ninterface HTMLCollection extends HTMLCollectionBase {\\n    /**\\n     * Retrieves a select object or an object from an options collection.\\n     */\\n    namedItem(name: string): Element | null;\\n}\\n\\ndeclare var HTMLCollection: {\\n    prototype: HTMLCollection;\\n    new(): HTMLCollection;\\n};\\n\\ninterface HTMLCollectionOf<T extends Element> extends HTMLCollectionBase {\\n    item(index: number): T | null;\\n    namedItem(name: string): T | null;\\n    [index: number]: T;\\n}\\n\\n/** Provides special properties (beyond those of the regular HTMLElement interface it also has available to it by inheritance) for manipulating definition list (<dl>) elements. */\\ninterface HTMLDListElement extends HTMLElement {\\n    /** @deprecated */\\n    compact: boolean;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLDListElement: {\\n    prototype: HTMLDListElement;\\n    new(): HTMLDListElement;\\n};\\n\\n/** Provides special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating <data> elements. */\\ninterface HTMLDataElement extends HTMLElement {\\n    value: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLDataElement: {\\n    prototype: HTMLDataElement;\\n    new(): HTMLDataElement;\\n};\\n\\n/** Provides special properties (beyond the HTMLElement object interface it also has available to it by inheritance) to manipulate <datalist> elements and their content. */\\ninterface HTMLDataListElement extends HTMLElement {\\n    readonly options: HTMLCollectionOf<HTMLOptionElement>;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLDataListElement: {\\n    prototype: HTMLDataListElement;\\n    new(): HTMLDataListElement;\\n};\\n\\ninterface HTMLDetailsElement extends HTMLElement {\\n    open: boolean;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDetailsElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDetailsElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLDetailsElement: {\\n    prototype: HTMLDetailsElement;\\n    new(): HTMLDetailsElement;\\n};\\n\\ninterface HTMLDialogElement extends HTMLElement {\\n    open: boolean;\\n    returnValue: string;\\n    close(returnValue?: string): void;\\n    show(): void;\\n    showModal(): void;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDialogElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDialogElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLDialogElement: {\\n    prototype: HTMLDialogElement;\\n    new(): HTMLDialogElement;\\n};\\n\\ninterface HTMLDirectoryElement extends HTMLElement {\\n    /** @deprecated */\\n    compact: boolean;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLDirectoryElement: {\\n    prototype: HTMLDirectoryElement;\\n    new(): HTMLDirectoryElement;\\n};\\n\\n/** Provides special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating <div> elements. */\\ninterface HTMLDivElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves how the object is aligned with adjacent text.\\n     */\\n    /** @deprecated */\\n    align: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLDivElement: {\\n    prototype: HTMLDivElement;\\n    new(): HTMLDivElement;\\n};\\n\\n/** The HTMLDocument property of Window objects is an alias that browsers expose for the Document interface object. */\\ninterface HTMLDocument extends Document {\\n    addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLDocument: {\\n    prototype: HTMLDocument;\\n    new(): HTMLDocument;\\n};\\n\\ninterface HTMLElementEventMap extends ElementEventMap, GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap {\\n}\\n\\n/** Any HTML element. Some elements directly implement this interface, while others implement it via an interface that inherits it. */\\ninterface HTMLElement extends Element, DocumentAndElementEventHandlers, ElementCSSInlineStyle, ElementCSSInlineStyle, ElementContentEditable, GlobalEventHandlers, HTMLOrSVGElement {\\n    accessKey: string;\\n    readonly accessKeyLabel: string;\\n    autocapitalize: string;\\n    dir: string;\\n    draggable: boolean;\\n    hidden: boolean;\\n    innerText: string;\\n    lang: string;\\n    readonly offsetHeight: number;\\n    readonly offsetLeft: number;\\n    readonly offsetParent: Element | null;\\n    readonly offsetTop: number;\\n    readonly offsetWidth: number;\\n    spellcheck: boolean;\\n    title: string;\\n    translate: boolean;\\n    click(): void;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLElement: {\\n    prototype: HTMLElement;\\n    new(): HTMLElement;\\n};\\n\\n/** Provides special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating <embed> elements. */\\ninterface HTMLEmbedElement extends HTMLElement {\\n    /** @deprecated */\\n    align: string;\\n    /**\\n     * Sets or retrieves the height of the object.\\n     */\\n    height: string;\\n    /**\\n     * Sets or retrieves the name of the object.\\n     */\\n    /** @deprecated */\\n    name: string;\\n    /**\\n     * Sets or retrieves a URL to be loaded by the object.\\n     */\\n    src: string;\\n    type: string;\\n    /**\\n     * Sets or retrieves the width of the object.\\n     */\\n    width: string;\\n    getSVGDocument(): Document | null;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLEmbedElement: {\\n    prototype: HTMLEmbedElement;\\n    new(): HTMLEmbedElement;\\n};\\n\\n/** Provides special properties and methods (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of <fieldset> elements. */\\ninterface HTMLFieldSetElement extends HTMLElement {\\n    disabled: boolean;\\n    readonly elements: HTMLCollection;\\n    /**\\n     * Retrieves a reference to the form that the object is embedded in.\\n     */\\n    readonly form: HTMLFormElement | null;\\n    name: string;\\n    readonly type: string;\\n    /**\\n     * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \\\"this is a required field\\\". The result is that the user sees validation messages without actually submitting.\\n     */\\n    readonly validationMessage: string;\\n    /**\\n     * Returns a  ValidityState object that represents the validity states of an element.\\n     */\\n    readonly validity: ValidityState;\\n    /**\\n     * Returns whether an element will successfully validate based on forms validation rules and constraints.\\n     */\\n    readonly willValidate: boolean;\\n    /**\\n     * Returns whether a form will validate when it is submitted, without having to submit it.\\n     */\\n    checkValidity(): boolean;\\n    reportValidity(): boolean;\\n    /**\\n     * Sets a custom error message that is displayed when a form is submitted.\\n     * @param error Sets a custom error message that is displayed when a form is submitted.\\n     */\\n    setCustomValidity(error: string): void;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLFieldSetElement: {\\n    prototype: HTMLFieldSetElement;\\n    new(): HTMLFieldSetElement;\\n};\\n\\n/** Implements the document object model (DOM) representation of the font element. The HTML Font Element <font> defines the font size, font face and color of text. */\\ninterface HTMLFontElement extends HTMLElement {\\n    /** @deprecated */\\n    color: string;\\n    /**\\n     * Sets or retrieves the current typeface family.\\n     */\\n    /** @deprecated */\\n    face: string;\\n    /** @deprecated */\\n    size: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLFontElement: {\\n    prototype: HTMLFontElement;\\n    new(): HTMLFontElement;\\n};\\n\\n/** A collection of HTML form control elements.  */\\ninterface HTMLFormControlsCollection extends HTMLCollectionBase {\\n    /**\\n     * Returns the item with ID or name name from the collection.\\n     * \\n     * If there are multiple matching items, then a RadioNodeList object containing all those elements is returned.\\n     */\\n    namedItem(name: string): RadioNodeList | Element | null;\\n}\\n\\ndeclare var HTMLFormControlsCollection: {\\n    prototype: HTMLFormControlsCollection;\\n    new(): HTMLFormControlsCollection;\\n};\\n\\n/** A <form> element in the DOM; it allows access to and in some cases modification of aspects of the form, as well as access to its component elements. */\\ninterface HTMLFormElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form.\\n     */\\n    acceptCharset: string;\\n    /**\\n     * Sets or retrieves the URL to which the form content is sent for processing.\\n     */\\n    action: string;\\n    /**\\n     * Specifies whether autocomplete is applied to an editable text field.\\n     */\\n    autocomplete: string;\\n    /**\\n     * Retrieves a collection, in source order, of all controls in a given form.\\n     */\\n    readonly elements: HTMLFormControlsCollection;\\n    /**\\n     * Sets or retrieves the MIME encoding for the form.\\n     */\\n    encoding: string;\\n    /**\\n     * Sets or retrieves the encoding type for the form.\\n     */\\n    enctype: string;\\n    /**\\n     * Sets or retrieves the number of objects in a collection.\\n     */\\n    readonly length: number;\\n    /**\\n     * Sets or retrieves how to send the form data to the server.\\n     */\\n    method: string;\\n    /**\\n     * Sets or retrieves the name of the object.\\n     */\\n    name: string;\\n    /**\\n     * Designates a form that is not validated when submitted.\\n     */\\n    noValidate: boolean;\\n    /**\\n     * Sets or retrieves the window or frame at which to target content.\\n     */\\n    target: string;\\n    /**\\n     * Returns whether a form will validate when it is submitted, without having to submit it.\\n     */\\n    checkValidity(): boolean;\\n    reportValidity(): boolean;\\n    /**\\n     * Fires when the user resets a form.\\n     */\\n    reset(): void;\\n    /**\\n     * Fires when a FORM is about to be submitted.\\n     */\\n    submit(): void;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n    [index: number]: Element;\\n    [name: string]: any;\\n}\\n\\ndeclare var HTMLFormElement: {\\n    prototype: HTMLFormElement;\\n    new(): HTMLFormElement;\\n};\\n\\ninterface HTMLFrameElement extends HTMLElement {\\n    /**\\n     * Retrieves the document object of the page or frame.\\n     */\\n    /** @deprecated */\\n    readonly contentDocument: Document | null;\\n    /**\\n     * Retrieves the object of the specified.\\n     */\\n    /** @deprecated */\\n    readonly contentWindow: WindowProxy | null;\\n    /**\\n     * Sets or retrieves whether to display a border for the frame.\\n     */\\n    /** @deprecated */\\n    frameBorder: string;\\n    /**\\n     * Sets or retrieves a URI to a long description of the object.\\n     */\\n    /** @deprecated */\\n    longDesc: string;\\n    /**\\n     * Sets or retrieves the top and bottom margin heights before displaying the text in a frame.\\n     */\\n    /** @deprecated */\\n    marginHeight: string;\\n    /**\\n     * Sets or retrieves the left and right margin widths before displaying the text in a frame.\\n     */\\n    /** @deprecated */\\n    marginWidth: string;\\n    /**\\n     * Sets or retrieves the frame name.\\n     */\\n    /** @deprecated */\\n    name: string;\\n    /**\\n     * Sets or retrieves whether the user can resize the frame.\\n     */\\n    /** @deprecated */\\n    noResize: boolean;\\n    /**\\n     * Sets or retrieves whether the frame can be scrolled.\\n     */\\n    /** @deprecated */\\n    scrolling: string;\\n    /**\\n     * Sets or retrieves a URL to be loaded by the object.\\n     */\\n    /** @deprecated */\\n    src: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLFrameElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLFrameElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLFrameElement: {\\n    prototype: HTMLFrameElement;\\n    new(): HTMLFrameElement;\\n};\\n\\ninterface HTMLFrameSetElementEventMap extends HTMLElementEventMap, WindowEventHandlersEventMap {\\n}\\n\\n/** Provides special properties (beyond those of the regular HTMLElement interface they also inherit) for manipulating <frameset> elements. */\\ninterface HTMLFrameSetElement extends HTMLElement, WindowEventHandlers {\\n    /**\\n     * Sets or retrieves the frame widths of the object.\\n     */\\n    /** @deprecated */\\n    cols: string;\\n    /**\\n     * Sets or retrieves the frame heights of the object.\\n     */\\n    /** @deprecated */\\n    rows: string;\\n    addEventListener<K extends keyof HTMLFrameSetElementEventMap>(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLFrameSetElementEventMap>(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLFrameSetElement: {\\n    prototype: HTMLFrameSetElement;\\n    new(): HTMLFrameSetElement;\\n};\\n\\n/** Provides special properties (beyond those of the HTMLElement interface it also has available to it by inheritance) for manipulating <hr> elements. */\\ninterface HTMLHRElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves how the object is aligned with adjacent text.\\n     */\\n    /** @deprecated */\\n    align: string;\\n    /** @deprecated */\\n    color: string;\\n    /**\\n     * Sets or retrieves whether the horizontal rule is drawn with 3-D shading.\\n     */\\n    /** @deprecated */\\n    noShade: boolean;\\n    /** @deprecated */\\n    size: string;\\n    /**\\n     * Sets or retrieves the width of the object.\\n     */\\n    /** @deprecated */\\n    width: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLHRElement: {\\n    prototype: HTMLHRElement;\\n    new(): HTMLHRElement;\\n};\\n\\n/** Contains the descriptive information, or metadata, for a document. This object inherits all of the properties and methods described in the HTMLElement interface. */\\ninterface HTMLHeadElement extends HTMLElement {\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLHeadElement: {\\n    prototype: HTMLHeadElement;\\n    new(): HTMLHeadElement;\\n};\\n\\n/** The different heading elements. It inherits methods and properties from the HTMLElement interface. */\\ninterface HTMLHeadingElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves a value that indicates the table alignment.\\n     */\\n    /** @deprecated */\\n    align: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLHeadingElement: {\\n    prototype: HTMLHeadingElement;\\n    new(): HTMLHeadingElement;\\n};\\n\\n/** Serves as the root node for a given HTML document. This object inherits the properties and methods described in the HTMLElement interface. */\\ninterface HTMLHtmlElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves the DTD version that governs the current document.\\n     */\\n    /** @deprecated */\\n    version: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLHtmlElement: {\\n    prototype: HTMLHtmlElement;\\n    new(): HTMLHtmlElement;\\n};\\n\\ninterface HTMLHyperlinkElementUtils {\\n    hash: string;\\n    host: string;\\n    hostname: string;\\n    href: string;\\n    toString(): string;\\n    readonly origin: string;\\n    password: string;\\n    pathname: string;\\n    port: string;\\n    protocol: string;\\n    search: string;\\n    username: string;\\n}\\n\\n/** Provides special properties and methods (beyond those of the HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of inline frame elements. */\\ninterface HTMLIFrameElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves how the object is aligned with adjacent text.\\n     */\\n    /** @deprecated */\\n    align: string;\\n    allow: string;\\n    allowFullscreen: boolean;\\n    allowPaymentRequest: boolean;\\n    /**\\n     * Retrieves the document object of the page or frame.\\n     */\\n    readonly contentDocument: Document | null;\\n    /**\\n     * Retrieves the object of the specified.\\n     */\\n    readonly contentWindow: WindowProxy | null;\\n    /**\\n     * Sets or retrieves whether to display a border for the frame.\\n     */\\n    /** @deprecated */\\n    frameBorder: string;\\n    /**\\n     * Sets or retrieves the height of the object.\\n     */\\n    height: string;\\n    /**\\n     * Sets or retrieves a URI to a long description of the object.\\n     */\\n    /** @deprecated */\\n    longDesc: string;\\n    /**\\n     * Sets or retrieves the top and bottom margin heights before displaying the text in a frame.\\n     */\\n    /** @deprecated */\\n    marginHeight: string;\\n    /**\\n     * Sets or retrieves the left and right margin widths before displaying the text in a frame.\\n     */\\n    /** @deprecated */\\n    marginWidth: string;\\n    /**\\n     * Sets or retrieves the frame name.\\n     */\\n    name: string;\\n    referrerPolicy: ReferrerPolicy;\\n    readonly sandbox: DOMTokenList;\\n    /**\\n     * Sets or retrieves whether the frame can be scrolled.\\n     */\\n    /** @deprecated */\\n    scrolling: string;\\n    /**\\n     * Sets or retrieves a URL to be loaded by the object.\\n     */\\n    src: string;\\n    /**\\n     * Sets or retrives the content of the page that is to contain.\\n     */\\n    srcdoc: string;\\n    /**\\n     * Sets or retrieves the width of the object.\\n     */\\n    width: string;\\n    getSVGDocument(): Document | null;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLIFrameElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLIFrameElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLIFrameElement: {\\n    prototype: HTMLIFrameElement;\\n    new(): HTMLIFrameElement;\\n};\\n\\n/** Provides special properties and methods for manipulating <img> elements. */\\ninterface HTMLImageElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves how the object is aligned with adjacent text.\\n     */\\n    /** @deprecated */\\n    align: string;\\n    /**\\n     * Sets or retrieves a text alternative to the graphic.\\n     */\\n    alt: string;\\n    /**\\n     * Specifies the properties of a border drawn around an object.\\n     */\\n    /** @deprecated */\\n    border: string;\\n    /**\\n     * Retrieves whether the object is fully loaded.\\n     */\\n    readonly complete: boolean;\\n    crossOrigin: string | null;\\n    readonly currentSrc: string;\\n    decoding: \\\"async\\\" | \\\"sync\\\" | \\\"auto\\\";\\n    /**\\n     * Sets or retrieves the height of the object.\\n     */\\n    height: number;\\n    /**\\n     * Sets or retrieves the width of the border to draw around the object.\\n     */\\n    /** @deprecated */\\n    hspace: number;\\n    /**\\n     * Sets or retrieves whether the image is a server-side image map.\\n     */\\n    isMap: boolean;\\n    loading: string;\\n    /**\\n     * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object.\\n     */\\n    /** @deprecated */\\n    longDesc: string;\\n    /** @deprecated */\\n    lowsrc: string;\\n    /**\\n     * Sets or retrieves the name of the object.\\n     */\\n    /** @deprecated */\\n    name: string;\\n    /**\\n     * The original height of the image resource before sizing.\\n     */\\n    readonly naturalHeight: number;\\n    /**\\n     * The original width of the image resource before sizing.\\n     */\\n    readonly naturalWidth: number;\\n    referrerPolicy: string;\\n    sizes: string;\\n    /**\\n     * The address or URL of the a media resource that is to be considered.\\n     */\\n    src: string;\\n    srcset: string;\\n    /**\\n     * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\\n     */\\n    useMap: string;\\n    /**\\n     * Sets or retrieves the vertical margin for the object.\\n     */\\n    /** @deprecated */\\n    vspace: number;\\n    /**\\n     * Sets or retrieves the width of the object.\\n     */\\n    width: number;\\n    readonly x: number;\\n    readonly y: number;\\n    decode(): Promise<void>;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLImageElement: {\\n    prototype: HTMLImageElement;\\n    new(): HTMLImageElement;\\n};\\n\\n/** Provides special properties and methods for manipulating the options, layout, and presentation of <input> elements. */\\ninterface HTMLInputElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves a comma-separated list of content types.\\n     */\\n    accept: string;\\n    /**\\n     * Sets or retrieves how the object is aligned with adjacent text.\\n     */\\n    /** @deprecated */\\n    align: string;\\n    /**\\n     * Sets or retrieves a text alternative to the graphic.\\n     */\\n    alt: string;\\n    /**\\n     * Specifies whether autocomplete is applied to an editable text field.\\n     */\\n    autocomplete: string;\\n    /**\\n     * Sets or retrieves the state of the check box or radio button.\\n     */\\n    checked: boolean;\\n    /**\\n     * Sets or retrieves the state of the check box or radio button.\\n     */\\n    defaultChecked: boolean;\\n    /**\\n     * Sets or retrieves the initial contents of the object.\\n     */\\n    defaultValue: string;\\n    dirName: string;\\n    disabled: boolean;\\n    /**\\n     * Returns a FileList object on a file type input object.\\n     */\\n    files: FileList | null;\\n    /**\\n     * Retrieves a reference to the form that the object is embedded in.\\n     */\\n    readonly form: HTMLFormElement | null;\\n    /**\\n     * Overrides the action attribute (where the data on a form is sent) on the parent form element.\\n     */\\n    formAction: string;\\n    /**\\n     * Used to override the encoding (formEnctype attribute) specified on the form element.\\n     */\\n    formEnctype: string;\\n    /**\\n     * Overrides the submit method attribute previously specified on a form element.\\n     */\\n    formMethod: string;\\n    /**\\n     * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a \\\"save draft\\\"-type submit option.\\n     */\\n    formNoValidate: boolean;\\n    /**\\n     * Overrides the target attribute on a form element.\\n     */\\n    formTarget: string;\\n    /**\\n     * Sets or retrieves the height of the object.\\n     */\\n    height: number;\\n    indeterminate: boolean;\\n    readonly labels: NodeListOf<HTMLLabelElement> | null;\\n    /**\\n     * Specifies the ID of a pre-defined datalist of options for an input element.\\n     */\\n    readonly list: HTMLElement | null;\\n    /**\\n     * Defines the maximum acceptable value for an input element with type=\\\"number\\\".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field.\\n     */\\n    max: string;\\n    /**\\n     * Sets or retrieves the maximum number of characters that the user can enter in a text control.\\n     */\\n    maxLength: number;\\n    /**\\n     * Defines the minimum acceptable value for an input element with type=\\\"number\\\". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field.\\n     */\\n    min: string;\\n    minLength: number;\\n    /**\\n     * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.\\n     */\\n    multiple: boolean;\\n    /**\\n     * Sets or retrieves the name of the object.\\n     */\\n    name: string;\\n    /**\\n     * Gets or sets a string containing a regular expression that the user's input must match.\\n     */\\n    pattern: string;\\n    /**\\n     * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.\\n     */\\n    placeholder: string;\\n    readOnly: boolean;\\n    /**\\n     * When present, marks an element that can't be submitted without a value.\\n     */\\n    required: boolean;\\n    selectionDirection: \\\"forward\\\" | \\\"backward\\\" | \\\"none\\\" | null;\\n    /**\\n     * Gets or sets the end position or offset of a text selection.\\n     */\\n    selectionEnd: number | null;\\n    /**\\n     * Gets or sets the starting position or offset of a text selection.\\n     */\\n    selectionStart: number | null;\\n    size: number;\\n    /**\\n     * The address or URL of the a media resource that is to be considered.\\n     */\\n    src: string;\\n    /**\\n     * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field.\\n     */\\n    step: string;\\n    /**\\n     * Returns the content type of the object.\\n     */\\n    type: string;\\n    /**\\n     * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\\n     */\\n    /** @deprecated */\\n    useMap: string;\\n    /**\\n     * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \\\"this is a required field\\\". The result is that the user sees validation messages without actually submitting.\\n     */\\n    readonly validationMessage: string;\\n    /**\\n     * Returns a  ValidityState object that represents the validity states of an element.\\n     */\\n    readonly validity: ValidityState;\\n    /**\\n     * Returns the value of the data at the cursor's current position.\\n     */\\n    value: string;\\n    /**\\n     * Returns a Date object representing the form control's value, if applicable; otherwise, returns null. Can be set, to change the value. Throws an \\\"InvalidStateError\\\" DOMException if the control isn't date- or time-based.\\n     */\\n    valueAsDate: Date | null;\\n    /**\\n     * Returns the input field value as a number.\\n     */\\n    valueAsNumber: number;\\n    /**\\n     * Sets or retrieves the width of the object.\\n     */\\n    width: number;\\n    /**\\n     * Returns whether an element will successfully validate based on forms validation rules and constraints.\\n     */\\n    readonly willValidate: boolean;\\n    /**\\n     * Returns whether a form will validate when it is submitted, without having to submit it.\\n     */\\n    checkValidity(): boolean;\\n    reportValidity(): boolean;\\n    /**\\n     * Makes the selection equal to the current object.\\n     */\\n    select(): void;\\n    /**\\n     * Sets a custom error message that is displayed when a form is submitted.\\n     * @param error Sets a custom error message that is displayed when a form is submitted.\\n     */\\n    setCustomValidity(error: string): void;\\n    setRangeText(replacement: string): void;\\n    setRangeText(replacement: string, start: number, end: number, selectionMode?: SelectionMode): void;\\n    /**\\n     * Sets the start and end positions of a selection in a text field.\\n     * @param start The offset into the text field for the start of the selection.\\n     * @param end The offset into the text field for the end of the selection.\\n     * @param direction The direction in which the selection is performed.\\n     */\\n    setSelectionRange(start: number | null, end: number | null, direction?: \\\"forward\\\" | \\\"backward\\\" | \\\"none\\\"): void;\\n    /**\\n     * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value.\\n     * @param n Value to decrement the value by.\\n     */\\n    stepDown(n?: number): void;\\n    /**\\n     * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value.\\n     * @param n Value to increment the value by.\\n     */\\n    stepUp(n?: number): void;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLInputElement: {\\n    prototype: HTMLInputElement;\\n    new(): HTMLInputElement;\\n};\\n\\n/** Exposes specific properties and methods (beyond those defined by regular HTMLElement interface it also has available to it by inheritance) for manipulating list elements. */\\ninterface HTMLLIElement extends HTMLElement {\\n    /** @deprecated */\\n    type: string;\\n    /**\\n     * Sets or retrieves the value of a list item.\\n     */\\n    value: number;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLLIElement: {\\n    prototype: HTMLLIElement;\\n    new(): HTMLLIElement;\\n};\\n\\n/** Gives access to properties specific to <label> elements. It inherits methods and properties from the base HTMLElement interface. */\\ninterface HTMLLabelElement extends HTMLElement {\\n    readonly control: HTMLElement | null;\\n    /**\\n     * Retrieves a reference to the form that the object is embedded in.\\n     */\\n    readonly form: HTMLFormElement | null;\\n    /**\\n     * Sets or retrieves the object to which the given label object is assigned.\\n     */\\n    htmlFor: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLLabelElement: {\\n    prototype: HTMLLabelElement;\\n    new(): HTMLLabelElement;\\n};\\n\\n/** The HTMLLegendElement is an interface allowing to access properties of the <legend> elements. It inherits properties and methods from the HTMLElement interface. */\\ninterface HTMLLegendElement extends HTMLElement {\\n    /** @deprecated */\\n    align: string;\\n    /**\\n     * Retrieves a reference to the form that the object is embedded in.\\n     */\\n    readonly form: HTMLFormElement | null;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLLegendElement: {\\n    prototype: HTMLLegendElement;\\n    new(): HTMLLegendElement;\\n};\\n\\n/** Reference information for external resources and the relationship of those resources to a document and vice-versa. This object inherits all of the properties and methods of the HTMLElement interface. */\\ninterface HTMLLinkElement extends HTMLElement, LinkStyle {\\n    as: string;\\n    /**\\n     * Sets or retrieves the character set used to encode the object.\\n     */\\n    /** @deprecated */\\n    charset: string;\\n    crossOrigin: string | null;\\n    disabled: boolean;\\n    /**\\n     * Sets or retrieves a destination URL or an anchor point.\\n     */\\n    href: string;\\n    /**\\n     * Sets or retrieves the language code of the object.\\n     */\\n    hreflang: string;\\n    imageSizes: string;\\n    imageSrcset: string;\\n    integrity: string;\\n    /**\\n     * Sets or retrieves the media type.\\n     */\\n    media: string;\\n    referrerPolicy: string;\\n    /**\\n     * Sets or retrieves the relationship between the object and the destination of the link.\\n     */\\n    rel: string;\\n    readonly relList: DOMTokenList;\\n    /**\\n     * Sets or retrieves the relationship between the object and the destination of the link.\\n     */\\n    /** @deprecated */\\n    rev: string;\\n    readonly sizes: DOMTokenList;\\n    /**\\n     * Sets or retrieves the window or frame at which to target content.\\n     */\\n    /** @deprecated */\\n    target: string;\\n    /**\\n     * Sets or retrieves the MIME type of the object.\\n     */\\n    type: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLLinkElement: {\\n    prototype: HTMLLinkElement;\\n    new(): HTMLLinkElement;\\n};\\n\\n/** Provides special properties and methods (beyond those of the regular object HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of map elements. */\\ninterface HTMLMapElement extends HTMLElement {\\n    /**\\n     * Retrieves a collection of the area objects defined for the given map object.\\n     */\\n    readonly areas: HTMLCollection;\\n    /**\\n     * Sets or retrieves the name of the object.\\n     */\\n    name: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLMapElement: {\\n    prototype: HTMLMapElement;\\n    new(): HTMLMapElement;\\n};\\n\\ninterface HTMLMarqueeElementEventMap extends HTMLElementEventMap {\\n    \\\"bounce\\\": Event;\\n    \\\"finish\\\": Event;\\n    \\\"start\\\": Event;\\n}\\n\\n/** Provides methods to manipulate <marquee> elements. */\\ninterface HTMLMarqueeElement extends HTMLElement {\\n    /** @deprecated */\\n    behavior: string;\\n    /** @deprecated */\\n    bgColor: string;\\n    /** @deprecated */\\n    direction: string;\\n    /** @deprecated */\\n    height: string;\\n    /** @deprecated */\\n    hspace: number;\\n    /** @deprecated */\\n    loop: number;\\n    /** @deprecated */\\n    onbounce: ((this: HTMLMarqueeElement, ev: Event) => any) | null;\\n    /** @deprecated */\\n    onfinish: ((this: HTMLMarqueeElement, ev: Event) => any) | null;\\n    /** @deprecated */\\n    onstart: ((this: HTMLMarqueeElement, ev: Event) => any) | null;\\n    /** @deprecated */\\n    scrollAmount: number;\\n    /** @deprecated */\\n    scrollDelay: number;\\n    /** @deprecated */\\n    trueSpeed: boolean;\\n    /** @deprecated */\\n    vspace: number;\\n    /** @deprecated */\\n    width: string;\\n    /** @deprecated */\\n    start(): void;\\n    /** @deprecated */\\n    stop(): void;\\n    addEventListener<K extends keyof HTMLMarqueeElementEventMap>(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLMarqueeElementEventMap>(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLMarqueeElement: {\\n    prototype: HTMLMarqueeElement;\\n    new(): HTMLMarqueeElement;\\n};\\n\\ninterface HTMLMediaElementEventMap extends HTMLElementEventMap {\\n    \\\"encrypted\\\": MediaEncryptedEvent;\\n    \\\"waitingforkey\\\": Event;\\n}\\n\\n/** Adds to HTMLElement the properties and methods needed to support basic media-related capabilities that are common to audio and video. */\\ninterface HTMLMediaElement extends HTMLElement {\\n    /**\\n     * Gets or sets a value that indicates whether to start playing the media automatically.\\n     */\\n    autoplay: boolean;\\n    /**\\n     * Gets a collection of buffered time ranges.\\n     */\\n    readonly buffered: TimeRanges;\\n    /**\\n     * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player).\\n     */\\n    controls: boolean;\\n    crossOrigin: string | null;\\n    /**\\n     * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement.\\n     */\\n    readonly currentSrc: string;\\n    /**\\n     * Gets or sets the current playback position, in seconds.\\n     */\\n    currentTime: number;\\n    defaultMuted: boolean;\\n    /**\\n     * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource.\\n     */\\n    defaultPlaybackRate: number;\\n    /**\\n     * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming.\\n     */\\n    readonly duration: number;\\n    /**\\n     * Gets information about whether the playback has ended or not.\\n     */\\n    readonly ended: boolean;\\n    /**\\n     * Returns an object representing the current error state of the audio or video element.\\n     */\\n    readonly error: MediaError | null;\\n    /**\\n     * Gets or sets a flag to specify whether playback should restart after it completes.\\n     */\\n    loop: boolean;\\n    readonly mediaKeys: MediaKeys | null;\\n    /**\\n     * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted.\\n     */\\n    muted: boolean;\\n    /**\\n     * Gets the current network activity for the element.\\n     */\\n    readonly networkState: number;\\n    onencrypted: ((this: HTMLMediaElement, ev: MediaEncryptedEvent) => any) | null;\\n    onwaitingforkey: ((this: HTMLMediaElement, ev: Event) => any) | null;\\n    /**\\n     * Gets a flag that specifies whether playback is paused.\\n     */\\n    readonly paused: boolean;\\n    /**\\n     * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource.\\n     */\\n    playbackRate: number;\\n    /**\\n     * Gets TimeRanges for the current media resource that has been played.\\n     */\\n    readonly played: TimeRanges;\\n    /**\\n     * Gets or sets the current playback position, in seconds.\\n     */\\n    preload: string;\\n    readonly readyState: number;\\n    /**\\n     * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked.\\n     */\\n    readonly seekable: TimeRanges;\\n    /**\\n     * Gets a flag that indicates whether the client is currently moving to a new playback position in the media resource.\\n     */\\n    readonly seeking: boolean;\\n    /**\\n     * The address or URL of the a media resource that is to be considered.\\n     */\\n    src: string;\\n    srcObject: MediaProvider | null;\\n    readonly textTracks: TextTrackList;\\n    /**\\n     * Gets or sets the volume level for audio portions of the media element.\\n     */\\n    volume: number;\\n    addTextTrack(kind: TextTrackKind, label?: string, language?: string): TextTrack;\\n    /**\\n     * Returns a string that specifies whether the client can play a given media resource type.\\n     */\\n    canPlayType(type: string): CanPlayTypeResult;\\n    fastSeek(time: number): void;\\n    /**\\n     * Resets the audio or video object and loads a new media resource.\\n     */\\n    load(): void;\\n    /**\\n     * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not.\\n     */\\n    pause(): void;\\n    /**\\n     * Loads and starts playback of a media resource.\\n     */\\n    play(): Promise<void>;\\n    setMediaKeys(mediaKeys: MediaKeys | null): Promise<void>;\\n    readonly HAVE_CURRENT_DATA: number;\\n    readonly HAVE_ENOUGH_DATA: number;\\n    readonly HAVE_FUTURE_DATA: number;\\n    readonly HAVE_METADATA: number;\\n    readonly HAVE_NOTHING: number;\\n    readonly NETWORK_EMPTY: number;\\n    readonly NETWORK_IDLE: number;\\n    readonly NETWORK_LOADING: number;\\n    readonly NETWORK_NO_SOURCE: number;\\n    addEventListener<K extends keyof HTMLMediaElementEventMap>(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLMediaElementEventMap>(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLMediaElement: {\\n    prototype: HTMLMediaElement;\\n    new(): HTMLMediaElement;\\n    readonly HAVE_CURRENT_DATA: number;\\n    readonly HAVE_ENOUGH_DATA: number;\\n    readonly HAVE_FUTURE_DATA: number;\\n    readonly HAVE_METADATA: number;\\n    readonly HAVE_NOTHING: number;\\n    readonly NETWORK_EMPTY: number;\\n    readonly NETWORK_IDLE: number;\\n    readonly NETWORK_LOADING: number;\\n    readonly NETWORK_NO_SOURCE: number;\\n};\\n\\ninterface HTMLMenuElement extends HTMLElement {\\n    /** @deprecated */\\n    compact: boolean;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLMenuElement: {\\n    prototype: HTMLMenuElement;\\n    new(): HTMLMenuElement;\\n};\\n\\n/** Contains descriptive metadata about a document. It inherits all of the properties and methods described in the HTMLElement interface. */\\ninterface HTMLMetaElement extends HTMLElement {\\n    /**\\n     * Gets or sets meta-information to associate with httpEquiv or name.\\n     */\\n    content: string;\\n    /**\\n     * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header.\\n     */\\n    httpEquiv: string;\\n    /**\\n     * Sets or retrieves the value specified in the content attribute of the meta object.\\n     */\\n    name: string;\\n    /**\\n     * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object.\\n     */\\n    /** @deprecated */\\n    scheme: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLMetaElement: {\\n    prototype: HTMLMetaElement;\\n    new(): HTMLMetaElement;\\n};\\n\\n/** The HTML <meter> elements expose the HTMLMeterElement interface, which provides special properties and methods (beyond the HTMLElement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <meter> elements. */\\ninterface HTMLMeterElement extends HTMLElement {\\n    high: number;\\n    readonly labels: NodeListOf<HTMLLabelElement>;\\n    low: number;\\n    max: number;\\n    min: number;\\n    optimum: number;\\n    value: number;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLMeterElement: {\\n    prototype: HTMLMeterElement;\\n    new(): HTMLMeterElement;\\n};\\n\\n/** Provides special properties (beyond the regular methods and properties available through the HTMLElement interface they also have available to them by inheritance) for manipulating modification elements, that is <del> and <ins>. */\\ninterface HTMLModElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves reference information about the object.\\n     */\\n    cite: string;\\n    /**\\n     * Sets or retrieves the date and time of a modification to the object.\\n     */\\n    dateTime: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLModElement: {\\n    prototype: HTMLModElement;\\n    new(): HTMLModElement;\\n};\\n\\n/** Provides special properties (beyond those defined on the regular HTMLElement interface it also has available to it by inheritance) for manipulating ordered list elements. */\\ninterface HTMLOListElement extends HTMLElement {\\n    /** @deprecated */\\n    compact: boolean;\\n    reversed: boolean;\\n    /**\\n     * The starting number.\\n     */\\n    start: number;\\n    type: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLOListElement: {\\n    prototype: HTMLOListElement;\\n    new(): HTMLOListElement;\\n};\\n\\n/** Provides special properties and methods (beyond those on the HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of <object> element, representing external resources. */\\ninterface HTMLObjectElement extends HTMLElement {\\n    /** @deprecated */\\n    align: string;\\n    /**\\n     * Sets or retrieves a character string that can be used to implement your own archive functionality for the object.\\n     */\\n    /** @deprecated */\\n    archive: string;\\n    /** @deprecated */\\n    border: string;\\n    /**\\n     * Sets or retrieves the URL of the file containing the compiled Java class.\\n     */\\n    /** @deprecated */\\n    code: string;\\n    /**\\n     * Sets or retrieves the URL of the component.\\n     */\\n    /** @deprecated */\\n    codeBase: string;\\n    /**\\n     * Sets or retrieves the Internet media type for the code associated with the object.\\n     */\\n    /** @deprecated */\\n    codeType: string;\\n    /**\\n     * Retrieves the document object of the page or frame.\\n     */\\n    readonly contentDocument: Document | null;\\n    readonly contentWindow: WindowProxy | null;\\n    /**\\n     * Sets or retrieves the URL that references the data of the object.\\n     */\\n    data: string;\\n    /** @deprecated */\\n    declare: boolean;\\n    /**\\n     * Retrieves a reference to the form that the object is embedded in.\\n     */\\n    readonly form: HTMLFormElement | null;\\n    /**\\n     * Sets or retrieves the height of the object.\\n     */\\n    height: string;\\n    /** @deprecated */\\n    hspace: number;\\n    /**\\n     * Sets or retrieves the name of the object.\\n     */\\n    name: string;\\n    /**\\n     * Sets or retrieves a message to be displayed while an object is loading.\\n     */\\n    /** @deprecated */\\n    standby: string;\\n    /**\\n     * Sets or retrieves the MIME type of the object.\\n     */\\n    type: string;\\n    /**\\n     * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\\n     */\\n    useMap: string;\\n    /**\\n     * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \\\"this is a required field\\\". The result is that the user sees validation messages without actually submitting.\\n     */\\n    readonly validationMessage: string;\\n    /**\\n     * Returns a  ValidityState object that represents the validity states of an element.\\n     */\\n    readonly validity: ValidityState;\\n    /** @deprecated */\\n    vspace: number;\\n    /**\\n     * Sets or retrieves the width of the object.\\n     */\\n    width: string;\\n    /**\\n     * Returns whether an element will successfully validate based on forms validation rules and constraints.\\n     */\\n    readonly willValidate: boolean;\\n    /**\\n     * Returns whether a form will validate when it is submitted, without having to submit it.\\n     */\\n    checkValidity(): boolean;\\n    getSVGDocument(): Document | null;\\n    reportValidity(): boolean;\\n    /**\\n     * Sets a custom error message that is displayed when a form is submitted.\\n     * @param error Sets a custom error message that is displayed when a form is submitted.\\n     */\\n    setCustomValidity(error: string): void;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLObjectElement: {\\n    prototype: HTMLObjectElement;\\n    new(): HTMLObjectElement;\\n};\\n\\n/** Provides special properties and methods (beyond the regular HTMLElement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <optgroup> elements. */\\ninterface HTMLOptGroupElement extends HTMLElement {\\n    disabled: boolean;\\n    /**\\n     * Retrieves a reference to the form that the object is embedded in.\\n     */\\n    readonly form: HTMLFormElement | null;\\n    /**\\n     * Sets or retrieves a value that you can use to implement your own label functionality for the object.\\n     */\\n    label: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLOptGroupElement: {\\n    prototype: HTMLOptGroupElement;\\n    new(): HTMLOptGroupElement;\\n};\\n\\n/** <option> elements and inherits all classes and methods of the HTMLElement interface. */\\ninterface HTMLOptionElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves the status of an option.\\n     */\\n    defaultSelected: boolean;\\n    disabled: boolean;\\n    /**\\n     * Retrieves a reference to the form that the object is embedded in.\\n     */\\n    readonly form: HTMLFormElement | null;\\n    /**\\n     * Sets or retrieves the ordinal position of an option in a list box.\\n     */\\n    readonly index: number;\\n    /**\\n     * Sets or retrieves a value that you can use to implement your own label functionality for the object.\\n     */\\n    label: string;\\n    /**\\n     * Sets or retrieves whether the option in the list box is the default item.\\n     */\\n    selected: boolean;\\n    /**\\n     * Sets or retrieves the text string specified by the option tag.\\n     */\\n    text: string;\\n    /**\\n     * Sets or retrieves the value which is returned to the server when the form control is submitted.\\n     */\\n    value: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLOptionElement: {\\n    prototype: HTMLOptionElement;\\n    new(): HTMLOptionElement;\\n};\\n\\n/** HTMLOptionsCollection is an interface representing a collection of HTML option elements (in document order) and offers methods and properties for traversing the list as well as optionally altering its items. This type is returned solely by the \\\"options\\\" property of select. */\\ninterface HTMLOptionsCollection extends HTMLCollectionOf<HTMLOptionElement> {\\n    /**\\n     * Returns the number of elements in the collection.\\n     * \\n     * When set to a smaller number, truncates the number of option elements in the corresponding container.\\n     * \\n     * When set to a greater number, adds new blank option elements to that container.\\n     */\\n    length: number;\\n    /**\\n     * Returns the index of the first selected item, if any, or −1 if there is no selected item.\\n     * \\n     * Can be set, to change the selection.\\n     */\\n    selectedIndex: number;\\n    /**\\n     * Inserts element before the node given by before.\\n     * \\n     * The before argument can be a number, in which case element is inserted before the item with that number, or an element from the collection, in which case element is inserted before that element.\\n     * \\n     * If before is omitted, null, or a number out of range, then element will be added at the end of the list.\\n     * \\n     * This method will throw a \\\"HierarchyRequestError\\\" DOMException if element is an ancestor of the element into which it is to be inserted.\\n     */\\n    add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number | null): void;\\n    /**\\n     * Removes the item with index index from the collection.\\n     */\\n    remove(index: number): void;\\n}\\n\\ndeclare var HTMLOptionsCollection: {\\n    prototype: HTMLOptionsCollection;\\n    new(): HTMLOptionsCollection;\\n};\\n\\ninterface HTMLOrSVGElement {\\n    autofocus: boolean;\\n    readonly dataset: DOMStringMap;\\n    nonce?: string;\\n    tabIndex: number;\\n    blur(): void;\\n    focus(options?: FocusOptions): void;\\n}\\n\\n/** Provides properties and methods (beyond those inherited from HTMLElement) for manipulating the layout and presentation of <output> elements. */\\ninterface HTMLOutputElement extends HTMLElement {\\n    defaultValue: string;\\n    readonly form: HTMLFormElement | null;\\n    readonly htmlFor: DOMTokenList;\\n    readonly labels: NodeListOf<HTMLLabelElement>;\\n    name: string;\\n    readonly type: string;\\n    readonly validationMessage: string;\\n    readonly validity: ValidityState;\\n    value: string;\\n    readonly willValidate: boolean;\\n    checkValidity(): boolean;\\n    reportValidity(): boolean;\\n    setCustomValidity(error: string): void;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLOutputElement: {\\n    prototype: HTMLOutputElement;\\n    new(): HTMLOutputElement;\\n};\\n\\n/** Provides special properties (beyond those of the regular HTMLElement object interface it inherits) for manipulating <p> elements. */\\ninterface HTMLParagraphElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves how the object is aligned with adjacent text.\\n     */\\n    /** @deprecated */\\n    align: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLParagraphElement: {\\n    prototype: HTMLParagraphElement;\\n    new(): HTMLParagraphElement;\\n};\\n\\n/** Provides special properties (beyond those of the regular HTMLElement object interface it inherits) for manipulating <param> elements, representing a pair of a key and a value that acts as a parameter for an <object> element. */\\ninterface HTMLParamElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves the name of an input parameter for an element.\\n     */\\n    name: string;\\n    /**\\n     * Sets or retrieves the content type of the resource designated by the value attribute.\\n     */\\n    /** @deprecated */\\n    type: string;\\n    /**\\n     * Sets or retrieves the value of an input parameter for an element.\\n     */\\n    value: string;\\n    /**\\n     * Sets or retrieves the data type of the value attribute.\\n     */\\n    /** @deprecated */\\n    valueType: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLParamElement: {\\n    prototype: HTMLParamElement;\\n    new(): HTMLParamElement;\\n};\\n\\n/** A <picture> HTML element. It doesn't implement specific properties or methods. */\\ninterface HTMLPictureElement extends HTMLElement {\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLPictureElement: {\\n    prototype: HTMLPictureElement;\\n    new(): HTMLPictureElement;\\n};\\n\\n/** Exposes specific properties and methods (beyond those of the HTMLElement interface it also has available to it by inheritance) for manipulating a block of preformatted text (<pre>). */\\ninterface HTMLPreElement extends HTMLElement {\\n    /**\\n     * Sets or gets a value that you can use to implement your own width functionality for the object.\\n     */\\n    /** @deprecated */\\n    width: number;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLPreElement: {\\n    prototype: HTMLPreElement;\\n    new(): HTMLPreElement;\\n};\\n\\n/** Provides special properties and methods (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of <progress> elements. */\\ninterface HTMLProgressElement extends HTMLElement {\\n    readonly labels: NodeListOf<HTMLLabelElement>;\\n    /**\\n     * Defines the maximum, or \\\"done\\\" value for a progress element.\\n     */\\n    max: number;\\n    /**\\n     * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar).\\n     */\\n    readonly position: number;\\n    /**\\n     * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value.\\n     */\\n    value: number;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLProgressElement: {\\n    prototype: HTMLProgressElement;\\n    new(): HTMLProgressElement;\\n};\\n\\n/** Provides special properties and methods (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating quoting elements, like <blockquote> and <q>, but not the <cite> element. */\\ninterface HTMLQuoteElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves reference information about the object.\\n     */\\n    cite: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLQuoteElement: {\\n    prototype: HTMLQuoteElement;\\n    new(): HTMLQuoteElement;\\n};\\n\\n/** HTML <script> elements expose the HTMLScriptElement interface, which provides special properties and methods for manipulating the behavior and execution of <script> elements (beyond the inherited HTMLElement interface). */\\ninterface HTMLScriptElement extends HTMLElement {\\n    async: boolean;\\n    /**\\n     * Sets or retrieves the character set used to encode the object.\\n     */\\n    /** @deprecated */\\n    charset: string;\\n    crossOrigin: string | null;\\n    /**\\n     * Sets or retrieves the status of the script.\\n     */\\n    defer: boolean;\\n    /**\\n     * Sets or retrieves the event for which the script is written.\\n     */\\n    /** @deprecated */\\n    event: string;\\n    /**\\n     * Sets or retrieves the object that is bound to the event script.\\n     */\\n    /** @deprecated */\\n    htmlFor: string;\\n    integrity: string;\\n    noModule: boolean;\\n    referrerPolicy: string;\\n    /**\\n     * Retrieves the URL to an external file that contains the source code or data.\\n     */\\n    src: string;\\n    /**\\n     * Retrieves or sets the text of the object as a string.\\n     */\\n    text: string;\\n    /**\\n     * Sets or retrieves the MIME type for the associated scripting engine.\\n     */\\n    type: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLScriptElement: {\\n    prototype: HTMLScriptElement;\\n    new(): HTMLScriptElement;\\n};\\n\\n/** A <select> HTML Element. These elements also share all of the properties and methods of other HTML elements via the HTMLElement interface. */\\ninterface HTMLSelectElement extends HTMLElement {\\n    autocomplete: string;\\n    disabled: boolean;\\n    /**\\n     * Retrieves a reference to the form that the object is embedded in.\\n     */\\n    readonly form: HTMLFormElement | null;\\n    readonly labels: NodeListOf<HTMLLabelElement>;\\n    /**\\n     * Sets or retrieves the number of objects in a collection.\\n     */\\n    length: number;\\n    /**\\n     * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.\\n     */\\n    multiple: boolean;\\n    /**\\n     * Sets or retrieves the name of the object.\\n     */\\n    name: string;\\n    readonly options: HTMLOptionsCollection;\\n    /**\\n     * When present, marks an element that can't be submitted without a value.\\n     */\\n    required: boolean;\\n    /**\\n     * Sets or retrieves the index of the selected option in a select object.\\n     */\\n    selectedIndex: number;\\n    readonly selectedOptions: HTMLCollectionOf<HTMLOptionElement>;\\n    /**\\n     * Sets or retrieves the number of rows in the list box.\\n     */\\n    size: number;\\n    /**\\n     * Retrieves the type of select control based on the value of the MULTIPLE attribute.\\n     */\\n    readonly type: string;\\n    /**\\n     * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \\\"this is a required field\\\". The result is that the user sees validation messages without actually submitting.\\n     */\\n    readonly validationMessage: string;\\n    /**\\n     * Returns a  ValidityState object that represents the validity states of an element.\\n     */\\n    readonly validity: ValidityState;\\n    /**\\n     * Sets or retrieves the value which is returned to the server when the form control is submitted.\\n     */\\n    value: string;\\n    /**\\n     * Returns whether an element will successfully validate based on forms validation rules and constraints.\\n     */\\n    readonly willValidate: boolean;\\n    /**\\n     * Adds an element to the areas, controlRange, or options collection.\\n     * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection.\\n     * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection.\\n     */\\n    add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number | null): void;\\n    /**\\n     * Returns whether a form will validate when it is submitted, without having to submit it.\\n     */\\n    checkValidity(): boolean;\\n    /**\\n     * Retrieves a select object or an object from an options collection.\\n     * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made.\\n     * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.\\n     */\\n    item(index: number): Element | null;\\n    /**\\n     * Retrieves a select object or an object from an options collection.\\n     * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made.\\n     */\\n    namedItem(name: string): HTMLOptionElement | null;\\n    /**\\n     * Removes an element from the collection.\\n     * @param index Number that specifies the zero-based index of the element to remove from the collection.\\n     */\\n    remove(): void;\\n    remove(index: number): void;\\n    reportValidity(): boolean;\\n    /**\\n     * Sets a custom error message that is displayed when a form is submitted.\\n     * @param error Sets a custom error message that is displayed when a form is submitted.\\n     */\\n    setCustomValidity(error: string): void;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n    [name: number]: HTMLOptionElement | HTMLOptGroupElement;\\n}\\n\\ndeclare var HTMLSelectElement: {\\n    prototype: HTMLSelectElement;\\n    new(): HTMLSelectElement;\\n};\\n\\ninterface HTMLSlotElement extends HTMLElement {\\n    name: string;\\n    assignedElements(options?: AssignedNodesOptions): Element[];\\n    assignedNodes(options?: AssignedNodesOptions): Node[];\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLSlotElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLSlotElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLSlotElement: {\\n    prototype: HTMLSlotElement;\\n    new(): HTMLSlotElement;\\n};\\n\\n/** Provides special properties (beyond the regular HTMLElement object interface it also has available to it by inheritance) for manipulating <source> elements. */\\ninterface HTMLSourceElement extends HTMLElement {\\n    /**\\n     * Gets or sets the intended media type of the media source.\\n     */\\n    media: string;\\n    sizes: string;\\n    /**\\n     * The address or URL of the a media resource that is to be considered.\\n     */\\n    src: string;\\n    srcset: string;\\n    /**\\n     * Gets or sets the MIME type of a media resource.\\n     */\\n    type: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLSourceElement: {\\n    prototype: HTMLSourceElement;\\n    new(): HTMLSourceElement;\\n};\\n\\n/** A <span> element and derives from the HTMLElement interface, but without implementing any additional properties or methods. */\\ninterface HTMLSpanElement extends HTMLElement {\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLSpanElement: {\\n    prototype: HTMLSpanElement;\\n    new(): HTMLSpanElement;\\n};\\n\\n/** A <style> element. It inherits properties and methods from its parent, HTMLElement, and from LinkStyle. */\\ninterface HTMLStyleElement extends HTMLElement, LinkStyle {\\n    /**\\n     * Sets or retrieves the media type.\\n     */\\n    media: string;\\n    /**\\n     * Retrieves the CSS language in which the style sheet is written.\\n     */\\n    /** @deprecated */\\n    type: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLStyleElement: {\\n    prototype: HTMLStyleElement;\\n    new(): HTMLStyleElement;\\n};\\n\\n/** Special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating table caption elements. */\\ninterface HTMLTableCaptionElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves the alignment of the caption or legend.\\n     */\\n    /** @deprecated */\\n    align: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLTableCaptionElement: {\\n    prototype: HTMLTableCaptionElement;\\n    new(): HTMLTableCaptionElement;\\n};\\n\\n/** Provides special properties and methods (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of table cells, either header or data cells, in an HTML document. */\\ninterface HTMLTableCellElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves abbreviated text for the object.\\n     */\\n    abbr: string;\\n    /**\\n     * Sets or retrieves how the object is aligned with adjacent text.\\n     */\\n    /** @deprecated */\\n    align: string;\\n    /**\\n     * Sets or retrieves a comma-delimited list of conceptual categories associated with the object.\\n     */\\n    /** @deprecated */\\n    axis: string;\\n    /** @deprecated */\\n    bgColor: string;\\n    /**\\n     * Retrieves the position of the object in the cells collection of a row.\\n     */\\n    readonly cellIndex: number;\\n    /** @deprecated */\\n    ch: string;\\n    /** @deprecated */\\n    chOff: string;\\n    /**\\n     * Sets or retrieves the number columns in the table that the object should span.\\n     */\\n    colSpan: number;\\n    /**\\n     * Sets or retrieves a list of header cells that provide information for the object.\\n     */\\n    headers: string;\\n    /**\\n     * Sets or retrieves the height of the object.\\n     */\\n    /** @deprecated */\\n    height: string;\\n    /**\\n     * Sets or retrieves whether the browser automatically performs wordwrap.\\n     */\\n    /** @deprecated */\\n    noWrap: boolean;\\n    /**\\n     * Sets or retrieves how many rows in a table the cell should span.\\n     */\\n    rowSpan: number;\\n    /**\\n     * Sets or retrieves the group of cells in a table to which the object's information applies.\\n     */\\n    scope: string;\\n    /** @deprecated */\\n    vAlign: string;\\n    /**\\n     * Sets or retrieves the width of the object.\\n     */\\n    /** @deprecated */\\n    width: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLTableCellElement: {\\n    prototype: HTMLTableCellElement;\\n    new(): HTMLTableCellElement;\\n};\\n\\n/** Provides special properties (beyond the HTMLElement interface it also has available to it inheritance) for manipulating single or grouped table column elements. */\\ninterface HTMLTableColElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves the alignment of the object relative to the display or table.\\n     */\\n    /** @deprecated */\\n    align: string;\\n    /** @deprecated */\\n    ch: string;\\n    /** @deprecated */\\n    chOff: string;\\n    /**\\n     * Sets or retrieves the number of columns in the group.\\n     */\\n    span: number;\\n    /** @deprecated */\\n    vAlign: string;\\n    /**\\n     * Sets or retrieves the width of the object.\\n     */\\n    /** @deprecated */\\n    width: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLTableColElement: {\\n    prototype: HTMLTableColElement;\\n    new(): HTMLTableColElement;\\n};\\n\\ninterface HTMLTableDataCellElement extends HTMLTableCellElement {\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLTableDataCellElement: {\\n    prototype: HTMLTableDataCellElement;\\n    new(): HTMLTableDataCellElement;\\n};\\n\\n/** Provides special properties and methods (beyond the regular HTMLElement object interface it also has available to it by inheritance) for manipulating the layout and presentation of tables in an HTML document. */\\ninterface HTMLTableElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves a value that indicates the table alignment.\\n     */\\n    /** @deprecated */\\n    align: string;\\n    /** @deprecated */\\n    bgColor: string;\\n    /**\\n     * Sets or retrieves the width of the border to draw around the object.\\n     */\\n    /** @deprecated */\\n    border: string;\\n    /**\\n     * Retrieves the caption object of a table.\\n     */\\n    caption: HTMLTableCaptionElement | null;\\n    /**\\n     * Sets or retrieves the amount of space between the border of the cell and the content of the cell.\\n     */\\n    /** @deprecated */\\n    cellPadding: string;\\n    /**\\n     * Sets or retrieves the amount of space between cells in a table.\\n     */\\n    /** @deprecated */\\n    cellSpacing: string;\\n    /**\\n     * Sets or retrieves the way the border frame around the table is displayed.\\n     */\\n    /** @deprecated */\\n    frame: string;\\n    /**\\n     * Sets or retrieves the number of horizontal rows contained in the object.\\n     */\\n    readonly rows: HTMLCollectionOf<HTMLTableRowElement>;\\n    /**\\n     * Sets or retrieves which dividing lines (inner borders) are displayed.\\n     */\\n    /** @deprecated */\\n    rules: string;\\n    /**\\n     * Sets or retrieves a description and/or structure of the object.\\n     */\\n    /** @deprecated */\\n    summary: string;\\n    /**\\n     * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order.\\n     */\\n    readonly tBodies: HTMLCollectionOf<HTMLTableSectionElement>;\\n    /**\\n     * Retrieves the tFoot object of the table.\\n     */\\n    tFoot: HTMLTableSectionElement | null;\\n    /**\\n     * Retrieves the tHead object of the table.\\n     */\\n    tHead: HTMLTableSectionElement | null;\\n    /**\\n     * Sets or retrieves the width of the object.\\n     */\\n    /** @deprecated */\\n    width: string;\\n    /**\\n     * Creates an empty caption element in the table.\\n     */\\n    createCaption(): HTMLTableCaptionElement;\\n    /**\\n     * Creates an empty tBody element in the table.\\n     */\\n    createTBody(): HTMLTableSectionElement;\\n    /**\\n     * Creates an empty tFoot element in the table.\\n     */\\n    createTFoot(): HTMLTableSectionElement;\\n    /**\\n     * Returns the tHead element object if successful, or null otherwise.\\n     */\\n    createTHead(): HTMLTableSectionElement;\\n    /**\\n     * Deletes the caption element and its contents from the table.\\n     */\\n    deleteCaption(): void;\\n    /**\\n     * Removes the specified row (tr) from the element and from the rows collection.\\n     * @param index Number that specifies the zero-based position in the rows collection of the row to remove.\\n     */\\n    deleteRow(index: number): void;\\n    /**\\n     * Deletes the tFoot element and its contents from the table.\\n     */\\n    deleteTFoot(): void;\\n    /**\\n     * Deletes the tHead element and its contents from the table.\\n     */\\n    deleteTHead(): void;\\n    /**\\n     * Creates a new row (tr) in the table, and adds the row to the rows collection.\\n     * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.\\n     */\\n    insertRow(index?: number): HTMLTableRowElement;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLTableElement: {\\n    prototype: HTMLTableElement;\\n    new(): HTMLTableElement;\\n};\\n\\ninterface HTMLTableHeaderCellElement extends HTMLTableCellElement {\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLTableHeaderCellElement: {\\n    prototype: HTMLTableHeaderCellElement;\\n    new(): HTMLTableHeaderCellElement;\\n};\\n\\n/** Provides special properties and methods (beyond the HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of rows in an HTML table. */\\ninterface HTMLTableRowElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves how the object is aligned with adjacent text.\\n     */\\n    /** @deprecated */\\n    align: string;\\n    /** @deprecated */\\n    bgColor: string;\\n    /**\\n     * Retrieves a collection of all cells in the table row.\\n     */\\n    readonly cells: HTMLCollectionOf<HTMLTableDataCellElement | HTMLTableHeaderCellElement>;\\n    /** @deprecated */\\n    ch: string;\\n    /** @deprecated */\\n    chOff: string;\\n    /**\\n     * Retrieves the position of the object in the rows collection for the table.\\n     */\\n    readonly rowIndex: number;\\n    /**\\n     * Retrieves the position of the object in the collection.\\n     */\\n    readonly sectionRowIndex: number;\\n    /** @deprecated */\\n    vAlign: string;\\n    /**\\n     * Removes the specified cell from the table row, as well as from the cells collection.\\n     * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted.\\n     */\\n    deleteCell(index: number): void;\\n    /**\\n     * Creates a new cell in the table row, and adds the cell to the cells collection.\\n     * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection.\\n     */\\n    insertCell(index?: number): HTMLTableDataCellElement;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLTableRowElement: {\\n    prototype: HTMLTableRowElement;\\n    new(): HTMLTableRowElement;\\n};\\n\\n/** Provides special properties and methods (beyond the HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of sections, that is headers, footers and bodies, in an HTML table. */\\ninterface HTMLTableSectionElement extends HTMLElement {\\n    /**\\n     * Sets or retrieves a value that indicates the table alignment.\\n     */\\n    /** @deprecated */\\n    align: string;\\n    /** @deprecated */\\n    ch: string;\\n    /** @deprecated */\\n    chOff: string;\\n    /**\\n     * Sets or retrieves the number of horizontal rows contained in the object.\\n     */\\n    readonly rows: HTMLCollectionOf<HTMLTableRowElement>;\\n    /** @deprecated */\\n    vAlign: string;\\n    /**\\n     * Removes the specified row (tr) from the element and from the rows collection.\\n     * @param index Number that specifies the zero-based position in the rows collection of the row to remove.\\n     */\\n    deleteRow(index: number): void;\\n    /**\\n     * Creates a new row (tr) in the table, and adds the row to the rows collection.\\n     * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.\\n     */\\n    insertRow(index?: number): HTMLTableRowElement;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLTableSectionElement: {\\n    prototype: HTMLTableSectionElement;\\n    new(): HTMLTableSectionElement;\\n};\\n\\n/** Enables access to the contents of an HTML <template> element. */\\ninterface HTMLTemplateElement extends HTMLElement {\\n    readonly content: DocumentFragment;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLTemplateElement: {\\n    prototype: HTMLTemplateElement;\\n    new(): HTMLTemplateElement;\\n};\\n\\n/** Provides special properties and methods for manipulating the layout and presentation of <textarea> elements. */\\ninterface HTMLTextAreaElement extends HTMLElement {\\n    autocomplete: string;\\n    /**\\n     * Sets or retrieves the width of the object.\\n     */\\n    cols: number;\\n    /**\\n     * Sets or retrieves the initial contents of the object.\\n     */\\n    defaultValue: string;\\n    dirName: string;\\n    disabled: boolean;\\n    /**\\n     * Retrieves a reference to the form that the object is embedded in.\\n     */\\n    readonly form: HTMLFormElement | null;\\n    readonly labels: NodeListOf<HTMLLabelElement>;\\n    /**\\n     * Sets or retrieves the maximum number of characters that the user can enter in a text control.\\n     */\\n    maxLength: number;\\n    minLength: number;\\n    /**\\n     * Sets or retrieves the name of the object.\\n     */\\n    name: string;\\n    /**\\n     * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.\\n     */\\n    placeholder: string;\\n    /**\\n     * Sets or retrieves the value indicated whether the content of the object is read-only.\\n     */\\n    readOnly: boolean;\\n    /**\\n     * When present, marks an element that can't be submitted without a value.\\n     */\\n    required: boolean;\\n    /**\\n     * Sets or retrieves the number of horizontal rows contained in the object.\\n     */\\n    rows: number;\\n    selectionDirection: \\\"forward\\\" | \\\"backward\\\" | \\\"none\\\";\\n    /**\\n     * Gets or sets the end position or offset of a text selection.\\n     */\\n    selectionEnd: number;\\n    /**\\n     * Gets or sets the starting position or offset of a text selection.\\n     */\\n    selectionStart: number;\\n    readonly textLength: number;\\n    /**\\n     * Retrieves the type of control.\\n     */\\n    readonly type: string;\\n    /**\\n     * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \\\"this is a required field\\\". The result is that the user sees validation messages without actually submitting.\\n     */\\n    readonly validationMessage: string;\\n    /**\\n     * Returns a  ValidityState object that represents the validity states of an element.\\n     */\\n    readonly validity: ValidityState;\\n    /**\\n     * Retrieves or sets the text in the entry field of the textArea element.\\n     */\\n    value: string;\\n    /**\\n     * Returns whether an element will successfully validate based on forms validation rules and constraints.\\n     */\\n    readonly willValidate: boolean;\\n    /**\\n     * Sets or retrieves how to handle wordwrapping in the object.\\n     */\\n    wrap: string;\\n    /**\\n     * Returns whether a form will validate when it is submitted, without having to submit it.\\n     */\\n    checkValidity(): boolean;\\n    reportValidity(): boolean;\\n    /**\\n     * Highlights the input area of a form element.\\n     */\\n    select(): void;\\n    /**\\n     * Sets a custom error message that is displayed when a form is submitted.\\n     * @param error Sets a custom error message that is displayed when a form is submitted.\\n     */\\n    setCustomValidity(error: string): void;\\n    setRangeText(replacement: string): void;\\n    setRangeText(replacement: string, start: number, end: number, selectionMode?: SelectionMode): void;\\n    /**\\n     * Sets the start and end positions of a selection in a text field.\\n     * @param start The offset into the text field for the start of the selection.\\n     * @param end The offset into the text field for the end of the selection.\\n     * @param direction The direction in which the selection is performed.\\n     */\\n    setSelectionRange(start: number | null, end: number | null, direction?: \\\"forward\\\" | \\\"backward\\\" | \\\"none\\\"): void;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLTextAreaElement: {\\n    prototype: HTMLTextAreaElement;\\n    new(): HTMLTextAreaElement;\\n};\\n\\n/** Provides special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating <time> elements. */\\ninterface HTMLTimeElement extends HTMLElement {\\n    dateTime: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLTimeElement: {\\n    prototype: HTMLTimeElement;\\n    new(): HTMLTimeElement;\\n};\\n\\n/** Contains the title for a document. This element inherits all of the properties and methods of the HTMLElement interface. */\\ninterface HTMLTitleElement extends HTMLElement {\\n    /**\\n     * Retrieves or sets the text of the object as a string.\\n     */\\n    text: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLTitleElement: {\\n    prototype: HTMLTitleElement;\\n    new(): HTMLTitleElement;\\n};\\n\\n/** The HTMLTrackElement */\\ninterface HTMLTrackElement extends HTMLElement {\\n    default: boolean;\\n    kind: string;\\n    label: string;\\n    readonly readyState: number;\\n    src: string;\\n    srclang: string;\\n    readonly track: TextTrack;\\n    readonly ERROR: number;\\n    readonly LOADED: number;\\n    readonly LOADING: number;\\n    readonly NONE: number;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLTrackElement: {\\n    prototype: HTMLTrackElement;\\n    new(): HTMLTrackElement;\\n    readonly ERROR: number;\\n    readonly LOADED: number;\\n    readonly LOADING: number;\\n    readonly NONE: number;\\n};\\n\\n/** Provides special properties (beyond those defined on the regular HTMLElement interface it also has available to it by inheritance) for manipulating unordered list elements. */\\ninterface HTMLUListElement extends HTMLElement {\\n    /** @deprecated */\\n    compact: boolean;\\n    /** @deprecated */\\n    type: string;\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLUListElement: {\\n    prototype: HTMLUListElement;\\n    new(): HTMLUListElement;\\n};\\n\\n/** An invalid HTML element and derives from the HTMLElement interface, but without implementing any additional properties or methods. */\\ninterface HTMLUnknownElement extends HTMLElement {\\n    addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLUnknownElement: {\\n    prototype: HTMLUnknownElement;\\n    new(): HTMLUnknownElement;\\n};\\n\\n/** Provides special properties and methods for manipulating video objects. It also inherits properties and methods of HTMLMediaElement and HTMLElement. */\\ninterface HTMLVideoElement extends HTMLMediaElement {\\n    /**\\n     * Gets or sets the height of the video element.\\n     */\\n    height: number;\\n    /**\\n     * Gets or sets the playsinline of the video element. for example, On iPhone, video elements will now be allowed to play inline, and will not automatically enter fullscreen mode when playback begins.\\n     */\\n    playsInline: boolean;\\n    /**\\n     * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available.\\n     */\\n    poster: string;\\n    /**\\n     * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known.\\n     */\\n    readonly videoHeight: number;\\n    /**\\n     * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known.\\n     */\\n    readonly videoWidth: number;\\n    /**\\n     * Gets or sets the width of the video element.\\n     */\\n    width: number;\\n    getVideoPlaybackQuality(): VideoPlaybackQuality;\\n    addEventListener<K extends keyof HTMLMediaElementEventMap>(type: K, listener: (this: HTMLVideoElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof HTMLMediaElementEventMap>(type: K, listener: (this: HTMLVideoElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var HTMLVideoElement: {\\n    prototype: HTMLVideoElement;\\n    new(): HTMLVideoElement;\\n};\\n\\n/** Events that fire when the fragment identifier of the URL has changed. */\\ninterface HashChangeEvent extends Event {\\n    /**\\n     * Returns the URL of the session history entry that is now current.\\n     */\\n    readonly newURL: string;\\n    /**\\n     * Returns the URL of the session history entry that was previously current.\\n     */\\n    readonly oldURL: string;\\n}\\n\\ndeclare var HashChangeEvent: {\\n    prototype: HashChangeEvent;\\n    new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent;\\n};\\n\\n/** This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.  You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence. */\\ninterface Headers {\\n    append(name: string, value: string): void;\\n    delete(name: string): void;\\n    get(name: string): string | null;\\n    has(name: string): boolean;\\n    set(name: string, value: string): void;\\n    forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;\\n}\\n\\ndeclare var Headers: {\\n    prototype: Headers;\\n    new(init?: HeadersInit): Headers;\\n};\\n\\n/** Allows manipulation of the browser session history, that is the pages visited in the tab or frame that the current page is loaded in. */\\ninterface History {\\n    readonly length: number;\\n    scrollRestoration: ScrollRestoration;\\n    readonly state: any;\\n    back(): void;\\n    forward(): void;\\n    go(delta?: number): void;\\n    pushState(data: any, title: string, url?: string | null): void;\\n    replaceState(data: any, title: string, url?: string | null): void;\\n}\\n\\ndeclare var History: {\\n    prototype: History;\\n    new(): History;\\n};\\n\\ninterface IDBArrayKey extends Array<IDBValidKey> {\\n}\\n\\n/** This IndexedDB API interface represents a cursor for traversing or iterating over multiple records in a database. */\\ninterface IDBCursor {\\n    /**\\n     * Returns the direction (\\\"next\\\", \\\"nextunique\\\", \\\"prev\\\" or \\\"prevunique\\\") of the cursor.\\n     */\\n    readonly direction: IDBCursorDirection;\\n    /**\\n     * Returns the key of the cursor. Throws a \\\"InvalidStateError\\\" DOMException if the cursor is advancing or is finished.\\n     */\\n    readonly key: IDBValidKey;\\n    /**\\n     * Returns the effective key of the cursor. Throws a \\\"InvalidStateError\\\" DOMException if the cursor is advancing or is finished.\\n     */\\n    readonly primaryKey: IDBValidKey;\\n    /**\\n     * Returns the IDBObjectStore or IDBIndex the cursor was opened from.\\n     */\\n    readonly source: IDBObjectStore | IDBIndex;\\n    /**\\n     * Advances the cursor through the next count records in range.\\n     */\\n    advance(count: number): void;\\n    /**\\n     * Advances the cursor to the next record in range.\\n     */\\n    continue(key?: IDBValidKey): void;\\n    /**\\n     * Advances the cursor to the next record in range matching or after key and primaryKey. Throws an \\\"InvalidAccessError\\\" DOMException if the source is not an index.\\n     */\\n    continuePrimaryKey(key: IDBValidKey, primaryKey: IDBValidKey): void;\\n    /**\\n     * Delete the record pointed at by the cursor with a new value.\\n     * \\n     * If successful, request's result will be undefined.\\n     */\\n    delete(): IDBRequest<undefined>;\\n    /**\\n     * Updated the record pointed at by the cursor with a new value.\\n     * \\n     * Throws a \\\"DataError\\\" DOMException if the effective object store uses in-line keys and the key would have changed.\\n     * \\n     * If successful, request's result will be the record's key.\\n     */\\n    update(value: any): IDBRequest<IDBValidKey>;\\n}\\n\\ndeclare var IDBCursor: {\\n    prototype: IDBCursor;\\n    new(): IDBCursor;\\n};\\n\\n/** This IndexedDB API interface represents a cursor for traversing or iterating over multiple records in a database. It is the same as the IDBCursor, except that it includes the value property. */\\ninterface IDBCursorWithValue extends IDBCursor {\\n    /**\\n     * Returns the cursor's current value.\\n     */\\n    readonly value: any;\\n}\\n\\ndeclare var IDBCursorWithValue: {\\n    prototype: IDBCursorWithValue;\\n    new(): IDBCursorWithValue;\\n};\\n\\ninterface IDBDatabaseEventMap {\\n    \\\"abort\\\": Event;\\n    \\\"close\\\": Event;\\n    \\\"error\\\": Event;\\n    \\\"versionchange\\\": IDBVersionChangeEvent;\\n}\\n\\n/** This IndexedDB API interface provides a connection to a database; you can use an IDBDatabase object to open a transaction on your database then create, manipulate, and delete objects (data) in that database. The interface provides the only way to get and manage versions of the database. */\\ninterface IDBDatabase extends EventTarget {\\n    /**\\n     * Returns the name of the database.\\n     */\\n    readonly name: string;\\n    /**\\n     * Returns a list of the names of object stores in the database.\\n     */\\n    readonly objectStoreNames: DOMStringList;\\n    onabort: ((this: IDBDatabase, ev: Event) => any) | null;\\n    onclose: ((this: IDBDatabase, ev: Event) => any) | null;\\n    onerror: ((this: IDBDatabase, ev: Event) => any) | null;\\n    onversionchange: ((this: IDBDatabase, ev: IDBVersionChangeEvent) => any) | null;\\n    /**\\n     * Returns the version of the database.\\n     */\\n    readonly version: number;\\n    /**\\n     * Closes the connection once all running transactions have finished.\\n     */\\n    close(): void;\\n    /**\\n     * Creates a new object store with the given name and options and returns a new IDBObjectStore.\\n     * \\n     * Throws a \\\"InvalidStateError\\\" DOMException if not called within an upgrade transaction.\\n     */\\n    createObjectStore(name: string, options?: IDBObjectStoreParameters): IDBObjectStore;\\n    /**\\n     * Deletes the object store with the given name.\\n     * \\n     * Throws a \\\"InvalidStateError\\\" DOMException if not called within an upgrade transaction.\\n     */\\n    deleteObjectStore(name: string): void;\\n    /**\\n     * Returns a new transaction with the given mode (\\\"readonly\\\" or \\\"readwrite\\\") and scope which can be a single object store name or an array of names.\\n     */\\n    transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;\\n    addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var IDBDatabase: {\\n    prototype: IDBDatabase;\\n    new(): IDBDatabase;\\n};\\n\\n/** In the following code snippet, we make a request to open a database, and include handlers for the success and error cases. For a full working example, see our To-do Notifications app (view example live.) */\\ninterface IDBFactory {\\n    /**\\n     * Compares two values as keys. Returns -1 if key1 precedes key2, 1 if key2 precedes key1, and 0 if the keys are equal.\\n     * \\n     * Throws a \\\"DataError\\\" DOMException if either input is not a valid key.\\n     */\\n    cmp(first: any, second: any): number;\\n    /**\\n     * Attempts to delete the named database. If the database already exists and there are open connections that don't close in response to a versionchange event, the request will be blocked until all they close. If the request is successful request's result will be null.\\n     */\\n    deleteDatabase(name: string): IDBOpenDBRequest;\\n    /**\\n     * Attempts to open a connection to the named database with the current version, or 1 if it does not already exist. If the request is successful request's result will be the connection.\\n     */\\n    open(name: string, version?: number): IDBOpenDBRequest;\\n}\\n\\ndeclare var IDBFactory: {\\n    prototype: IDBFactory;\\n    new(): IDBFactory;\\n};\\n\\n/** IDBIndex interface of the IndexedDB API provides asynchronous access to an index in a database. An index is a kind of object store for looking up records in another object store, called the referenced object store. You use this interface to retrieve data. */\\ninterface IDBIndex {\\n    readonly keyPath: string | string[];\\n    readonly multiEntry: boolean;\\n    /**\\n     * Returns the name of the index.\\n     */\\n    name: string;\\n    /**\\n     * Returns the IDBObjectStore the index belongs to.\\n     */\\n    readonly objectStore: IDBObjectStore;\\n    readonly unique: boolean;\\n    /**\\n     * Retrieves the number of records matching the given key or key range in query.\\n     * \\n     * If successful, request's result will be the count.\\n     */\\n    count(key?: IDBValidKey | IDBKeyRange): IDBRequest<number>;\\n    /**\\n     * Retrieves the value of the first record matching the given key or key range in query.\\n     * \\n     * If successful, request's result will be the value, or undefined if there was no matching record.\\n     */\\n    get(key: IDBValidKey | IDBKeyRange): IDBRequest<any | undefined>;\\n    /**\\n     * Retrieves the values of the records matching the given key or key range in query (up to count if given).\\n     * \\n     * If successful, request's result will be an Array of the values.\\n     */\\n    getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<any[]>;\\n    /**\\n     * Retrieves the keys of records matching the given key or key range in query (up to count if given).\\n     * \\n     * If successful, request's result will be an Array of the keys.\\n     */\\n    getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<IDBValidKey[]>;\\n    /**\\n     * Retrieves the key of the first record matching the given key or key range in query.\\n     * \\n     * If successful, request's result will be the key, or undefined if there was no matching record.\\n     */\\n    getKey(key: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey | undefined>;\\n    /**\\n     * Opens a cursor over the records matching query, ordered by direction. If query is null, all records in index are matched.\\n     * \\n     * If successful, request's result will be an IDBCursorWithValue, or null if there were no matching records.\\n     */\\n    openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>;\\n    /**\\n     * Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in index are matched.\\n     * \\n     * If successful, request's result will be an IDBCursor, or null if there were no matching records.\\n     */\\n    openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;\\n}\\n\\ndeclare var IDBIndex: {\\n    prototype: IDBIndex;\\n    new(): IDBIndex;\\n};\\n\\n/** A key range can be a single value or a range with upper and lower bounds or endpoints. If the key range has both upper and lower bounds, then it is bounded; if it has no bounds, it is unbounded. A bounded key range can either be open (the endpoints are excluded) or closed (the endpoints are included). To retrieve all keys within a certain range, you can use the following code constructs: */\\ninterface IDBKeyRange {\\n    /**\\n     * Returns lower bound, or undefined if none.\\n     */\\n    readonly lower: any;\\n    /**\\n     * Returns true if the lower open flag is set, and false otherwise.\\n     */\\n    readonly lowerOpen: boolean;\\n    /**\\n     * Returns upper bound, or undefined if none.\\n     */\\n    readonly upper: any;\\n    /**\\n     * Returns true if the upper open flag is set, and false otherwise.\\n     */\\n    readonly upperOpen: boolean;\\n    /**\\n     * Returns true if key is included in the range, and false otherwise.\\n     */\\n    includes(key: any): boolean;\\n}\\n\\ndeclare var IDBKeyRange: {\\n    prototype: IDBKeyRange;\\n    new(): IDBKeyRange;\\n    /**\\n     * Returns a new IDBKeyRange spanning from lower to upper. If lowerOpen is true, lower is not included in the range. If upperOpen is true, upper is not included in the range.\\n     */\\n    bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange;\\n    /**\\n     * Returns a new IDBKeyRange starting at key with no upper bound. If open is true, key is not included in the range.\\n     */\\n    lowerBound(lower: any, open?: boolean): IDBKeyRange;\\n    /**\\n     * Returns a new IDBKeyRange spanning only key.\\n     */\\n    only(value: any): IDBKeyRange;\\n    /**\\n     * Returns a new IDBKeyRange with no lower bound and ending at key. If open is true, key is not included in the range.\\n     */\\n    upperBound(upper: any, open?: boolean): IDBKeyRange;\\n};\\n\\n/** This example shows a variety of different uses of object stores, from updating the data structure with IDBObjectStore.createIndex inside an onupgradeneeded function, to adding a new item to our object store with IDBObjectStore.add. For a full working example, see our To-do Notifications app (view example live.) */\\ninterface IDBObjectStore {\\n    /**\\n     * Returns true if the store has a key generator, and false otherwise.\\n     */\\n    readonly autoIncrement: boolean;\\n    /**\\n     * Returns a list of the names of indexes in the store.\\n     */\\n    readonly indexNames: DOMStringList;\\n    /**\\n     * Returns the key path of the store, or null if none.\\n     */\\n    readonly keyPath: string | string[];\\n    /**\\n     * Returns the name of the store.\\n     */\\n    name: string;\\n    /**\\n     * Returns the associated transaction.\\n     */\\n    readonly transaction: IDBTransaction;\\n    /**\\n     * Adds or updates a record in store with the given value and key.\\n     * \\n     * If the store uses in-line keys and key is specified a \\\"DataError\\\" DOMException will be thrown.\\n     * \\n     * If put() is used, any existing record with the key will be replaced. If add() is used, and if a record with the key already exists the request will fail, with request's error set to a \\\"ConstraintError\\\" DOMException.\\n     * \\n     * If successful, request's result will be the record's key.\\n     */\\n    add(value: any, key?: IDBValidKey): IDBRequest<IDBValidKey>;\\n    /**\\n     * Deletes all records in store.\\n     * \\n     * If successful, request's result will be undefined.\\n     */\\n    clear(): IDBRequest<undefined>;\\n    /**\\n     * Retrieves the number of records matching the given key or key range in query.\\n     * \\n     * If successful, request's result will be the count.\\n     */\\n    count(key?: IDBValidKey | IDBKeyRange): IDBRequest<number>;\\n    /**\\n     * Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a \\\"ConstraintError\\\" DOMException.\\n     * \\n     * Throws an \\\"InvalidStateError\\\" DOMException if not called within an upgrade transaction.\\n     */\\n    createIndex(name: string, keyPath: string | string[], options?: IDBIndexParameters): IDBIndex;\\n    /**\\n     * Deletes records in store with the given key or in the given key range in query.\\n     * \\n     * If successful, request's result will be undefined.\\n     */\\n    delete(key: IDBValidKey | IDBKeyRange): IDBRequest<undefined>;\\n    /**\\n     * Deletes the index in store with the given name.\\n     * \\n     * Throws an \\\"InvalidStateError\\\" DOMException if not called within an upgrade transaction.\\n     */\\n    deleteIndex(name: string): void;\\n    /**\\n     * Retrieves the value of the first record matching the given key or key range in query.\\n     * \\n     * If successful, request's result will be the value, or undefined if there was no matching record.\\n     */\\n    get(query: IDBValidKey | IDBKeyRange): IDBRequest<any | undefined>;\\n    /**\\n     * Retrieves the values of the records matching the given key or key range in query (up to count if given).\\n     * \\n     * If successful, request's result will be an Array of the values.\\n     */\\n    getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<any[]>;\\n    /**\\n     * Retrieves the keys of records matching the given key or key range in query (up to count if given).\\n     * \\n     * If successful, request's result will be an Array of the keys.\\n     */\\n    getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<IDBValidKey[]>;\\n    /**\\n     * Retrieves the key of the first record matching the given key or key range in query.\\n     * \\n     * If successful, request's result will be the key, or undefined if there was no matching record.\\n     */\\n    getKey(query: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey | undefined>;\\n    index(name: string): IDBIndex;\\n    /**\\n     * Opens a cursor over the records matching query, ordered by direction. If query is null, all records in store are matched.\\n     * \\n     * If successful, request's result will be an IDBCursorWithValue pointing at the first matching record, or null if there were no matching records.\\n     */\\n    openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>;\\n    /**\\n     * Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in store are matched.\\n     * \\n     * If successful, request's result will be an IDBCursor pointing at the first matching record, or null if there were no matching records.\\n     */\\n    openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;\\n    /**\\n     * Adds or updates a record in store with the given value and key.\\n     * \\n     * If the store uses in-line keys and key is specified a \\\"DataError\\\" DOMException will be thrown.\\n     * \\n     * If put() is used, any existing record with the key will be replaced. If add() is used, and if a record with the key already exists the request will fail, with request's error set to a \\\"ConstraintError\\\" DOMException.\\n     * \\n     * If successful, request's result will be the record's key.\\n     */\\n    put(value: any, key?: IDBValidKey): IDBRequest<IDBValidKey>;\\n}\\n\\ndeclare var IDBObjectStore: {\\n    prototype: IDBObjectStore;\\n    new(): IDBObjectStore;\\n};\\n\\ninterface IDBOpenDBRequestEventMap extends IDBRequestEventMap {\\n    \\\"blocked\\\": Event;\\n    \\\"upgradeneeded\\\": IDBVersionChangeEvent;\\n}\\n\\n/** Also inherits methods from its parents IDBRequest and EventTarget. */\\ninterface IDBOpenDBRequest extends IDBRequest<IDBDatabase> {\\n    onblocked: ((this: IDBOpenDBRequest, ev: Event) => any) | null;\\n    onupgradeneeded: ((this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any) | null;\\n    addEventListener<K extends keyof IDBOpenDBRequestEventMap>(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof IDBOpenDBRequestEventMap>(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var IDBOpenDBRequest: {\\n    prototype: IDBOpenDBRequest;\\n    new(): IDBOpenDBRequest;\\n};\\n\\ninterface IDBRequestEventMap {\\n    \\\"error\\\": Event;\\n    \\\"success\\\": Event;\\n}\\n\\n/** The request object does not initially contain any information about the result of the operation, but once information becomes available, an event is fired on the request, and the information becomes available through the properties of the IDBRequest instance. */\\ninterface IDBRequest<T = any> extends EventTarget {\\n    /**\\n     * When a request is completed, returns the error (a DOMException), or null if the request succeeded. Throws a \\\"InvalidStateError\\\" DOMException if the request is still pending.\\n     */\\n    readonly error: DOMException | null;\\n    onerror: ((this: IDBRequest<T>, ev: Event) => any) | null;\\n    onsuccess: ((this: IDBRequest<T>, ev: Event) => any) | null;\\n    /**\\n     * Returns \\\"pending\\\" until a request is complete, then returns \\\"done\\\".\\n     */\\n    readonly readyState: IDBRequestReadyState;\\n    /**\\n     * When a request is completed, returns the result, or undefined if the request failed. Throws a \\\"InvalidStateError\\\" DOMException if the request is still pending.\\n     */\\n    readonly result: T;\\n    /**\\n     * Returns the IDBObjectStore, IDBIndex, or IDBCursor the request was made against, or null if is was an open request.\\n     */\\n    readonly source: IDBObjectStore | IDBIndex | IDBCursor;\\n    /**\\n     * Returns the IDBTransaction the request was made within. If this as an open request, then it returns an upgrade transaction while it is running, or null otherwise.\\n     */\\n    readonly transaction: IDBTransaction | null;\\n    addEventListener<K extends keyof IDBRequestEventMap>(type: K, listener: (this: IDBRequest<T>, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof IDBRequestEventMap>(type: K, listener: (this: IDBRequest<T>, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var IDBRequest: {\\n    prototype: IDBRequest;\\n    new(): IDBRequest;\\n};\\n\\ninterface IDBTransactionEventMap {\\n    \\\"abort\\\": Event;\\n    \\\"complete\\\": Event;\\n    \\\"error\\\": Event;\\n}\\n\\ninterface IDBTransaction extends EventTarget {\\n    /**\\n     * Returns the transaction's connection.\\n     */\\n    readonly db: IDBDatabase;\\n    /**\\n     * If the transaction was aborted, returns the error (a DOMException) providing the reason.\\n     */\\n    readonly error: DOMException;\\n    /**\\n     * Returns the mode the transaction was created with (\\\"readonly\\\" or \\\"readwrite\\\"), or \\\"versionchange\\\" for an upgrade transaction.\\n     */\\n    readonly mode: IDBTransactionMode;\\n    /**\\n     * Returns a list of the names of object stores in the transaction's scope. For an upgrade transaction this is all object stores in the database.\\n     */\\n    readonly objectStoreNames: DOMStringList;\\n    onabort: ((this: IDBTransaction, ev: Event) => any) | null;\\n    oncomplete: ((this: IDBTransaction, ev: Event) => any) | null;\\n    onerror: ((this: IDBTransaction, ev: Event) => any) | null;\\n    /**\\n     * Aborts the transaction. All pending requests will fail with a \\\"AbortError\\\" DOMException and all changes made to the database will be reverted.\\n     */\\n    abort(): void;\\n    /**\\n     * Returns an IDBObjectStore in the transaction's scope.\\n     */\\n    objectStore(name: string): IDBObjectStore;\\n    addEventListener<K extends keyof IDBTransactionEventMap>(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof IDBTransactionEventMap>(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var IDBTransaction: {\\n    prototype: IDBTransaction;\\n    new(): IDBTransaction;\\n};\\n\\n/** This IndexedDB API interface indicates that the version of the database has changed, as the result of an IDBOpenDBRequest.onupgradeneeded event handler function. */\\ninterface IDBVersionChangeEvent extends Event {\\n    readonly newVersion: number | null;\\n    readonly oldVersion: number;\\n}\\n\\ndeclare var IDBVersionChangeEvent: {\\n    prototype: IDBVersionChangeEvent;\\n    new(type: string, eventInitDict?: IDBVersionChangeEventInit): IDBVersionChangeEvent;\\n};\\n\\n/** The IIRFilterNode interface of the Web Audio API is a AudioNode processor which implements a general infinite impulse response (IIR)  filter; this type of filter can be used to implement tone control devices and graphic equalizers as well. It lets the parameters of the filter response be specified, so that it can be tuned as needed. */\\ninterface IIRFilterNode extends AudioNode {\\n    getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;\\n}\\n\\ndeclare var IIRFilterNode: {\\n    prototype: IIRFilterNode;\\n    new(context: BaseAudioContext, options: IIRFilterOptions): IIRFilterNode;\\n};\\n\\ninterface ImageBitmap {\\n    /**\\n     * Returns the intrinsic height of the image, in CSS pixels.\\n     */\\n    readonly height: number;\\n    /**\\n     * Returns the intrinsic width of the image, in CSS pixels.\\n     */\\n    readonly width: number;\\n    /**\\n     * Releases imageBitmap's underlying bitmap data.\\n     */\\n    close(): void;\\n}\\n\\ndeclare var ImageBitmap: {\\n    prototype: ImageBitmap;\\n    new(): ImageBitmap;\\n};\\n\\ninterface ImageBitmapRenderingContext {\\n    /**\\n     * Returns the canvas element that the context is bound to.\\n     */\\n    readonly canvas: HTMLCanvasElement | OffscreenCanvas;\\n    /**\\n     * Transfers the underlying bitmap data from imageBitmap to context, and the bitmap becomes the contents of the canvas element to which context is bound.\\n     */\\n    transferFromImageBitmap(bitmap: ImageBitmap | null): void;\\n}\\n\\ndeclare var ImageBitmapRenderingContext: {\\n    prototype: ImageBitmapRenderingContext;\\n    new(): ImageBitmapRenderingContext;\\n};\\n\\n/** The underlying pixel data of an area of a <canvas> element. It is created using the ImageData() constructor or creator methods on the CanvasRenderingContext2D object associated with a canvas: createImageData() and getImageData(). It can also be used to set a part of the canvas by using putImageData(). */\\ninterface ImageData {\\n    /**\\n     * Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255.\\n     */\\n    readonly data: Uint8ClampedArray;\\n    /**\\n     * Returns the actual dimensions of the data in the ImageData object, in pixels.\\n     */\\n    readonly height: number;\\n    /**\\n     * Returns the actual dimensions of the data in the ImageData object, in pixels.\\n     */\\n    readonly width: number;\\n}\\n\\ndeclare var ImageData: {\\n    prototype: ImageData;\\n    new(sw: number, sh: number): ImageData;\\n    new(data: Uint8ClampedArray, sw: number, sh?: number): ImageData;\\n};\\n\\ninterface InnerHTML {\\n    innerHTML: string;\\n}\\n\\ninterface InputDeviceInfo extends MediaDeviceInfo {\\n    getCapabilities(): MediaTrackCapabilities;\\n}\\n\\ndeclare var InputDeviceInfo: {\\n    prototype: InputDeviceInfo;\\n    new(): InputDeviceInfo;\\n};\\n\\ninterface InputEvent extends UIEvent {\\n    readonly data: string | null;\\n    readonly inputType: string;\\n    readonly isComposing: boolean;\\n}\\n\\ndeclare var InputEvent: {\\n    prototype: InputEvent;\\n    new(type: string, eventInitDict?: InputEventInit): InputEvent;\\n};\\n\\n/** provides a way to asynchronously observe changes in the intersection of a target element with an ancestor element or with a top-level document's viewport. */\\ninterface IntersectionObserver {\\n    readonly root: Element | Document | null;\\n    readonly rootMargin: string;\\n    readonly thresholds: ReadonlyArray<number>;\\n    disconnect(): void;\\n    observe(target: Element): void;\\n    takeRecords(): IntersectionObserverEntry[];\\n    unobserve(target: Element): void;\\n}\\n\\ndeclare var IntersectionObserver: {\\n    prototype: IntersectionObserver;\\n    new(callback: IntersectionObserverCallback, options?: IntersectionObserverInit): IntersectionObserver;\\n};\\n\\n/** This Intersection Observer API interface describes the intersection between the target element and its root container at a specific moment of transition. */\\ninterface IntersectionObserverEntry {\\n    readonly boundingClientRect: DOMRectReadOnly;\\n    readonly intersectionRatio: number;\\n    readonly intersectionRect: DOMRectReadOnly;\\n    readonly isIntersecting: boolean;\\n    readonly rootBounds: DOMRectReadOnly | null;\\n    readonly target: Element;\\n    readonly time: number;\\n}\\n\\ndeclare var IntersectionObserverEntry: {\\n    prototype: IntersectionObserverEntry;\\n    new(intersectionObserverEntryInit: IntersectionObserverEntryInit): IntersectionObserverEntry;\\n};\\n\\n/** KeyboardEvent objects describe a user interaction with the keyboard; each event describes a single interaction between the user and a key (or combination of a key with modifier keys) on the keyboard. */\\ninterface KeyboardEvent extends UIEvent {\\n    readonly altKey: boolean;\\n    /** @deprecated */\\n    char: string;\\n    /** @deprecated */\\n    readonly charCode: number;\\n    readonly code: string;\\n    readonly ctrlKey: boolean;\\n    readonly isComposing: boolean;\\n    readonly key: string;\\n    /** @deprecated */\\n    readonly keyCode: number;\\n    readonly location: number;\\n    readonly metaKey: boolean;\\n    readonly repeat: boolean;\\n    readonly shiftKey: boolean;\\n    getModifierState(keyArg: string): boolean;\\n    readonly DOM_KEY_LOCATION_LEFT: number;\\n    readonly DOM_KEY_LOCATION_NUMPAD: number;\\n    readonly DOM_KEY_LOCATION_RIGHT: number;\\n    readonly DOM_KEY_LOCATION_STANDARD: number;\\n}\\n\\ndeclare var KeyboardEvent: {\\n    prototype: KeyboardEvent;\\n    new(type: string, eventInitDict?: KeyboardEventInit): KeyboardEvent;\\n    readonly DOM_KEY_LOCATION_LEFT: number;\\n    readonly DOM_KEY_LOCATION_NUMPAD: number;\\n    readonly DOM_KEY_LOCATION_RIGHT: number;\\n    readonly DOM_KEY_LOCATION_STANDARD: number;\\n};\\n\\ninterface KeyframeEffect extends AnimationEffect {\\n    composite: CompositeOperation;\\n    iterationComposite: IterationCompositeOperation;\\n    target: Element | null;\\n    getKeyframes(): ComputedKeyframe[];\\n    setKeyframes(keyframes: Keyframe[] | PropertyIndexedKeyframes | null): void;\\n}\\n\\ndeclare var KeyframeEffect: {\\n    prototype: KeyframeEffect;\\n    new(target: Element | null, keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeEffectOptions): KeyframeEffect;\\n    new(source: KeyframeEffect): KeyframeEffect;\\n};\\n\\ninterface LinkStyle {\\n    readonly sheet: CSSStyleSheet | null;\\n}\\n\\ninterface ListeningStateChangedEvent extends Event {\\n    readonly label: string;\\n    readonly state: ListeningState;\\n}\\n\\ndeclare var ListeningStateChangedEvent: {\\n    prototype: ListeningStateChangedEvent;\\n    new(): ListeningStateChangedEvent;\\n};\\n\\n/** The location (URL) of the object it is linked to. Changes done on it are reflected on the object it relates to. Both the Document and Window interface have such a linked Location, accessible via Document.location and Window.location respectively. */\\ninterface Location {\\n    /**\\n     * Returns a DOMStringList object listing the origins of the ancestor browsing contexts, from the parent browsing context to the top-level browsing context.\\n     */\\n    readonly ancestorOrigins: DOMStringList;\\n    /**\\n     * Returns the Location object's URL's fragment (includes leading \\\"#\\\" if non-empty).\\n     * \\n     * Can be set, to navigate to the same URL with a changed fragment (ignores leading \\\"#\\\").\\n     */\\n    hash: string;\\n    /**\\n     * Returns the Location object's URL's host and port (if different from the default port for the scheme).\\n     * \\n     * Can be set, to navigate to the same URL with a changed host and port.\\n     */\\n    host: string;\\n    /**\\n     * Returns the Location object's URL's host.\\n     * \\n     * Can be set, to navigate to the same URL with a changed host.\\n     */\\n    hostname: string;\\n    /**\\n     * Returns the Location object's URL.\\n     * \\n     * Can be set, to navigate to the given URL.\\n     */\\n    href: string;\\n    toString(): string;\\n    /**\\n     * Returns the Location object's URL's origin.\\n     */\\n    readonly origin: string;\\n    /**\\n     * Returns the Location object's URL's path.\\n     * \\n     * Can be set, to navigate to the same URL with a changed path.\\n     */\\n    pathname: string;\\n    /**\\n     * Returns the Location object's URL's port.\\n     * \\n     * Can be set, to navigate to the same URL with a changed port.\\n     */\\n    port: string;\\n    /**\\n     * Returns the Location object's URL's scheme.\\n     * \\n     * Can be set, to navigate to the same URL with a changed scheme.\\n     */\\n    protocol: string;\\n    /**\\n     * Returns the Location object's URL's query (includes leading \\\"?\\\" if non-empty).\\n     * \\n     * Can be set, to navigate to the same URL with a changed query (ignores leading \\\"?\\\").\\n     */\\n    search: string;\\n    /**\\n     * Navigates to the given URL.\\n     */\\n    assign(url: string): void;\\n    /**\\n     * Reloads the current page.\\n     */\\n    reload(): void;\\n    /** @deprecated */\\n    reload(forcedReload: boolean): void;\\n    /**\\n     * Removes the current page from the session history and navigates to the given URL.\\n     */\\n    replace(url: string): void;\\n}\\n\\ndeclare var Location: {\\n    prototype: Location;\\n    new(): Location;\\n};\\n\\ninterface MSAssertion {\\n    readonly id: string;\\n    readonly type: MSCredentialType;\\n}\\n\\ndeclare var MSAssertion: {\\n    prototype: MSAssertion;\\n    new(): MSAssertion;\\n};\\n\\ninterface MSBlobBuilder {\\n    append(data: any, endings?: string): void;\\n    getBlob(contentType?: string): Blob;\\n}\\n\\ndeclare var MSBlobBuilder: {\\n    prototype: MSBlobBuilder;\\n    new(): MSBlobBuilder;\\n};\\n\\ninterface MSFIDOCredentialAssertion extends MSAssertion {\\n    readonly algorithm: string | Algorithm;\\n    readonly attestation: any;\\n    readonly publicKey: string;\\n    readonly transportHints: MSTransportType[];\\n}\\n\\ndeclare var MSFIDOCredentialAssertion: {\\n    prototype: MSFIDOCredentialAssertion;\\n    new(): MSFIDOCredentialAssertion;\\n};\\n\\ninterface MSFIDOSignature {\\n    readonly authnrData: string;\\n    readonly clientData: string;\\n    readonly signature: string;\\n}\\n\\ndeclare var MSFIDOSignature: {\\n    prototype: MSFIDOSignature;\\n    new(): MSFIDOSignature;\\n};\\n\\ninterface MSFIDOSignatureAssertion extends MSAssertion {\\n    readonly signature: MSFIDOSignature;\\n}\\n\\ndeclare var MSFIDOSignatureAssertion: {\\n    prototype: MSFIDOSignatureAssertion;\\n    new(): MSFIDOSignatureAssertion;\\n};\\n\\ninterface MSFileSaver {\\n    msSaveBlob(blob: any, defaultName?: string): boolean;\\n    msSaveOrOpenBlob(blob: any, defaultName?: string): boolean;\\n}\\n\\ninterface MSGesture {\\n    target: Element;\\n    addPointer(pointerId: number): void;\\n    stop(): void;\\n}\\n\\ndeclare var MSGesture: {\\n    prototype: MSGesture;\\n    new(): MSGesture;\\n};\\n\\n/** The MSGestureEvent is a proprietary interface specific to Internet Explorer and Microsoft Edge which represents events that occur due to touch gestures. Events using this interface include MSGestureStart, MSGestureEnd, MSGestureTap, MSGestureHold, MSGestureChange, and MSInertiaStart. */\\ninterface MSGestureEvent extends UIEvent {\\n    readonly clientX: number;\\n    readonly clientY: number;\\n    readonly expansion: number;\\n    readonly gestureObject: any;\\n    readonly hwTimestamp: number;\\n    readonly offsetX: number;\\n    readonly offsetY: number;\\n    readonly rotation: number;\\n    readonly scale: number;\\n    readonly screenX: number;\\n    readonly screenY: number;\\n    readonly translationX: number;\\n    readonly translationY: number;\\n    readonly velocityAngular: number;\\n    readonly velocityExpansion: number;\\n    readonly velocityX: number;\\n    readonly velocityY: number;\\n    initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void;\\n    readonly MSGESTURE_FLAG_BEGIN: number;\\n    readonly MSGESTURE_FLAG_CANCEL: number;\\n    readonly MSGESTURE_FLAG_END: number;\\n    readonly MSGESTURE_FLAG_INERTIA: number;\\n    readonly MSGESTURE_FLAG_NONE: number;\\n}\\n\\ndeclare var MSGestureEvent: {\\n    prototype: MSGestureEvent;\\n    new(): MSGestureEvent;\\n    readonly MSGESTURE_FLAG_BEGIN: number;\\n    readonly MSGESTURE_FLAG_CANCEL: number;\\n    readonly MSGESTURE_FLAG_END: number;\\n    readonly MSGESTURE_FLAG_INERTIA: number;\\n    readonly MSGESTURE_FLAG_NONE: number;\\n};\\n\\n/** The msGraphicsTrust() constructor returns an object that provides properties for info on protected video playback. */\\ninterface MSGraphicsTrust {\\n    readonly constrictionActive: boolean;\\n    readonly status: string;\\n}\\n\\ndeclare var MSGraphicsTrust: {\\n    prototype: MSGraphicsTrust;\\n    new(): MSGraphicsTrust;\\n};\\n\\ninterface MSInputMethodContextEventMap {\\n    \\\"MSCandidateWindowHide\\\": Event;\\n    \\\"MSCandidateWindowShow\\\": Event;\\n    \\\"MSCandidateWindowUpdate\\\": Event;\\n}\\n\\ninterface MSInputMethodContext extends EventTarget {\\n    readonly compositionEndOffset: number;\\n    readonly compositionStartOffset: number;\\n    oncandidatewindowhide: ((this: MSInputMethodContext, ev: Event) => any) | null;\\n    oncandidatewindowshow: ((this: MSInputMethodContext, ev: Event) => any) | null;\\n    oncandidatewindowupdate: ((this: MSInputMethodContext, ev: Event) => any) | null;\\n    readonly target: HTMLElement;\\n    getCandidateWindowClientRect(): ClientRect;\\n    getCompositionAlternatives(): string[];\\n    hasComposition(): boolean;\\n    isCandidateWindowVisible(): boolean;\\n    addEventListener<K extends keyof MSInputMethodContextEventMap>(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof MSInputMethodContextEventMap>(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var MSInputMethodContext: {\\n    prototype: MSInputMethodContext;\\n    new(): MSInputMethodContext;\\n};\\n\\ninterface MSMediaKeyError {\\n    readonly code: number;\\n    readonly systemCode: number;\\n    readonly MS_MEDIA_KEYERR_CLIENT: number;\\n    readonly MS_MEDIA_KEYERR_DOMAIN: number;\\n    readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number;\\n    readonly MS_MEDIA_KEYERR_OUTPUT: number;\\n    readonly MS_MEDIA_KEYERR_SERVICE: number;\\n    readonly MS_MEDIA_KEYERR_UNKNOWN: number;\\n}\\n\\ndeclare var MSMediaKeyError: {\\n    prototype: MSMediaKeyError;\\n    new(): MSMediaKeyError;\\n    readonly MS_MEDIA_KEYERR_CLIENT: number;\\n    readonly MS_MEDIA_KEYERR_DOMAIN: number;\\n    readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number;\\n    readonly MS_MEDIA_KEYERR_OUTPUT: number;\\n    readonly MS_MEDIA_KEYERR_SERVICE: number;\\n    readonly MS_MEDIA_KEYERR_UNKNOWN: number;\\n};\\n\\ninterface MSMediaKeyMessageEvent extends Event {\\n    readonly destinationURL: string | null;\\n    readonly message: Uint8Array;\\n}\\n\\ndeclare var MSMediaKeyMessageEvent: {\\n    prototype: MSMediaKeyMessageEvent;\\n    new(): MSMediaKeyMessageEvent;\\n};\\n\\ninterface MSMediaKeyNeededEvent extends Event {\\n    readonly initData: Uint8Array | null;\\n}\\n\\ndeclare var MSMediaKeyNeededEvent: {\\n    prototype: MSMediaKeyNeededEvent;\\n    new(): MSMediaKeyNeededEvent;\\n};\\n\\ninterface MSMediaKeySession extends EventTarget {\\n    readonly error: MSMediaKeyError | null;\\n    readonly keySystem: string;\\n    readonly sessionId: string;\\n    close(): void;\\n    update(key: Uint8Array): void;\\n}\\n\\ndeclare var MSMediaKeySession: {\\n    prototype: MSMediaKeySession;\\n    new(): MSMediaKeySession;\\n};\\n\\ninterface MSMediaKeys {\\n    readonly keySystem: string;\\n    createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array | null): MSMediaKeySession;\\n}\\n\\ndeclare var MSMediaKeys: {\\n    prototype: MSMediaKeys;\\n    new(keySystem: string): MSMediaKeys;\\n    isTypeSupported(keySystem: string, type?: string | null): boolean;\\n    isTypeSupportedWithFeatures(keySystem: string, type?: string | null): string;\\n};\\n\\ninterface MSNavigatorDoNotTrack {\\n    confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean;\\n    confirmWebWideTrackingException(args: ExceptionInformation): boolean;\\n    removeSiteSpecificTrackingException(args: ExceptionInformation): void;\\n    removeWebWideTrackingException(args: ExceptionInformation): void;\\n    storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void;\\n    storeWebWideTrackingException(args: StoreExceptionsInformation): void;\\n}\\n\\ninterface MSPointerEvent extends MouseEvent {\\n    readonly currentPoint: any;\\n    readonly height: number;\\n    readonly hwTimestamp: number;\\n    readonly intermediatePoints: any;\\n    readonly isPrimary: boolean;\\n    readonly pointerId: number;\\n    readonly pointerType: any;\\n    readonly pressure: number;\\n    readonly rotation: number;\\n    readonly tiltX: number;\\n    readonly tiltY: number;\\n    readonly width: number;\\n    getCurrentPoint(element: Element): void;\\n    getIntermediatePoints(element: Element): void;\\n    initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void;\\n}\\n\\ndeclare var MSPointerEvent: {\\n    prototype: MSPointerEvent;\\n    new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent;\\n};\\n\\ninterface MSStream {\\n    readonly type: string;\\n    msClose(): void;\\n    msDetachStream(): any;\\n}\\n\\ndeclare var MSStream: {\\n    prototype: MSStream;\\n    new(): MSStream;\\n};\\n\\n/** The MediaDevicesInfo interface contains information that describes a single media input or output device. */\\ninterface MediaDeviceInfo {\\n    readonly deviceId: string;\\n    readonly groupId: string;\\n    readonly kind: MediaDeviceKind;\\n    readonly label: string;\\n    toJSON(): any;\\n}\\n\\ndeclare var MediaDeviceInfo: {\\n    prototype: MediaDeviceInfo;\\n    new(): MediaDeviceInfo;\\n};\\n\\ninterface MediaDevicesEventMap {\\n    \\\"devicechange\\\": Event;\\n}\\n\\n/** Provides access to connected media input devices like cameras and microphones, as well as screen sharing. In essence, it lets you obtain access to any hardware source of media data. */\\ninterface MediaDevices extends EventTarget {\\n    ondevicechange: ((this: MediaDevices, ev: Event) => any) | null;\\n    enumerateDevices(): Promise<MediaDeviceInfo[]>;\\n    getSupportedConstraints(): MediaTrackSupportedConstraints;\\n    getUserMedia(constraints?: MediaStreamConstraints): Promise<MediaStream>;\\n    addEventListener<K extends keyof MediaDevicesEventMap>(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof MediaDevicesEventMap>(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var MediaDevices: {\\n    prototype: MediaDevices;\\n    new(): MediaDevices;\\n};\\n\\n/** A MediaElementSourceNode has no inputs and exactly one output, and is created using the AudioContext.createMediaElementSource method. The amount of channels in the output equals the number of channels of the audio referenced by the HTMLMediaElement used in the creation of the node, or is 1 if the HTMLMediaElement has no audio. */\\ninterface MediaElementAudioSourceNode extends AudioNode {\\n    readonly mediaElement: HTMLMediaElement;\\n}\\n\\ndeclare var MediaElementAudioSourceNode: {\\n    prototype: MediaElementAudioSourceNode;\\n    new(context: AudioContext, options: MediaElementAudioSourceOptions): MediaElementAudioSourceNode;\\n};\\n\\ninterface MediaEncryptedEvent extends Event {\\n    readonly initData: ArrayBuffer | null;\\n    readonly initDataType: string;\\n}\\n\\ndeclare var MediaEncryptedEvent: {\\n    prototype: MediaEncryptedEvent;\\n    new(type: string, eventInitDict?: MediaEncryptedEventInit): MediaEncryptedEvent;\\n};\\n\\n/** An error which occurred while handling media in an HTML media element based on HTMLMediaElement, such as <audio> or <video>. */\\ninterface MediaError {\\n    readonly code: number;\\n    readonly message: string;\\n    readonly MEDIA_ERR_ABORTED: number;\\n    readonly MEDIA_ERR_DECODE: number;\\n    readonly MEDIA_ERR_NETWORK: number;\\n    readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number;\\n}\\n\\ndeclare var MediaError: {\\n    prototype: MediaError;\\n    new(): MediaError;\\n    readonly MEDIA_ERR_ABORTED: number;\\n    readonly MEDIA_ERR_DECODE: number;\\n    readonly MEDIA_ERR_NETWORK: number;\\n    readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number;\\n};\\n\\n/** This EncryptedMediaExtensions API interface contains the content and related data when the content decryption module generates a message for the session. */\\ninterface MediaKeyMessageEvent extends Event {\\n    readonly message: ArrayBuffer;\\n    readonly messageType: MediaKeyMessageType;\\n}\\n\\ndeclare var MediaKeyMessageEvent: {\\n    prototype: MediaKeyMessageEvent;\\n    new(type: string, eventInitDict: MediaKeyMessageEventInit): MediaKeyMessageEvent;\\n};\\n\\ninterface MediaKeySessionEventMap {\\n    \\\"keystatuseschange\\\": Event;\\n    \\\"message\\\": MediaKeyMessageEvent;\\n}\\n\\n/** This EncryptedMediaExtensions API interface represents a context for message exchange with a content decryption module (CDM). */\\ninterface MediaKeySession extends EventTarget {\\n    readonly closed: Promise<void>;\\n    readonly expiration: number;\\n    readonly keyStatuses: MediaKeyStatusMap;\\n    onkeystatuseschange: ((this: MediaKeySession, ev: Event) => any) | null;\\n    onmessage: ((this: MediaKeySession, ev: MediaKeyMessageEvent) => any) | null;\\n    readonly sessionId: string;\\n    close(): Promise<void>;\\n    generateRequest(initDataType: string, initData: BufferSource): Promise<void>;\\n    load(sessionId: string): Promise<boolean>;\\n    remove(): Promise<void>;\\n    update(response: BufferSource): Promise<void>;\\n    addEventListener<K extends keyof MediaKeySessionEventMap>(type: K, listener: (this: MediaKeySession, ev: MediaKeySessionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof MediaKeySessionEventMap>(type: K, listener: (this: MediaKeySession, ev: MediaKeySessionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var MediaKeySession: {\\n    prototype: MediaKeySession;\\n    new(): MediaKeySession;\\n};\\n\\n/** This EncryptedMediaExtensions API interface is a read-only map of media key statuses by key IDs. */\\ninterface MediaKeyStatusMap {\\n    readonly size: number;\\n    get(keyId: BufferSource): MediaKeyStatus | undefined;\\n    has(keyId: BufferSource): boolean;\\n    forEach(callbackfn: (value: MediaKeyStatus, key: BufferSource, parent: MediaKeyStatusMap) => void, thisArg?: any): void;\\n}\\n\\ndeclare var MediaKeyStatusMap: {\\n    prototype: MediaKeyStatusMap;\\n    new(): MediaKeyStatusMap;\\n};\\n\\n/** This EncryptedMediaExtensions API interface provides access to a Key System for decryption and/or a content protection provider. You can request an instance of this object using the Navigator.requestMediaKeySystemAccess method. */\\ninterface MediaKeySystemAccess {\\n    readonly keySystem: string;\\n    createMediaKeys(): Promise<MediaKeys>;\\n    getConfiguration(): MediaKeySystemConfiguration;\\n}\\n\\ndeclare var MediaKeySystemAccess: {\\n    prototype: MediaKeySystemAccess;\\n    new(): MediaKeySystemAccess;\\n};\\n\\n/** This EncryptedMediaExtensions API interface the represents a set of keys that an associated HTMLMediaElement can use for decryption of media data during playback. */\\ninterface MediaKeys {\\n    createSession(sessionType?: MediaKeySessionType): MediaKeySession;\\n    setServerCertificate(serverCertificate: BufferSource): Promise<boolean>;\\n}\\n\\ndeclare var MediaKeys: {\\n    prototype: MediaKeys;\\n    new(): MediaKeys;\\n};\\n\\ninterface MediaList {\\n    readonly length: number;\\n    mediaText: string;\\n    toString(): string;\\n    appendMedium(medium: string): void;\\n    deleteMedium(medium: string): void;\\n    item(index: number): string | null;\\n    [index: number]: string;\\n}\\n\\ndeclare var MediaList: {\\n    prototype: MediaList;\\n    new(): MediaList;\\n};\\n\\ninterface MediaQueryListEventMap {\\n    \\\"change\\\": MediaQueryListEvent;\\n}\\n\\n/** Stores information on a media query applied to a document, and handles sending notifications to listeners when the media query state change (i.e. when the media query test starts or stops evaluating to true). */\\ninterface MediaQueryList extends EventTarget {\\n    readonly matches: boolean;\\n    readonly media: string;\\n    onchange: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null;\\n    /** @deprecated */\\n    addListener(listener: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null): void;\\n    /** @deprecated */\\n    removeListener(listener: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null): void;\\n    addEventListener<K extends keyof MediaQueryListEventMap>(type: K, listener: (this: MediaQueryList, ev: MediaQueryListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof MediaQueryListEventMap>(type: K, listener: (this: MediaQueryList, ev: MediaQueryListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var MediaQueryList: {\\n    prototype: MediaQueryList;\\n    new(): MediaQueryList;\\n};\\n\\ninterface MediaQueryListEvent extends Event {\\n    readonly matches: boolean;\\n    readonly media: string;\\n}\\n\\ndeclare var MediaQueryListEvent: {\\n    prototype: MediaQueryListEvent;\\n    new(type: string, eventInitDict?: MediaQueryListEventInit): MediaQueryListEvent;\\n};\\n\\ninterface MediaSourceEventMap {\\n    \\\"sourceclose\\\": Event;\\n    \\\"sourceended\\\": Event;\\n    \\\"sourceopen\\\": Event;\\n}\\n\\n/** This Media Source Extensions API interface represents a source of media data for an HTMLMediaElement object. A MediaSource object can be attached to a HTMLMediaElement to be played in the user agent. */\\ninterface MediaSource extends EventTarget {\\n    readonly activeSourceBuffers: SourceBufferList;\\n    duration: number;\\n    onsourceclose: ((this: MediaSource, ev: Event) => any) | null;\\n    onsourceended: ((this: MediaSource, ev: Event) => any) | null;\\n    onsourceopen: ((this: MediaSource, ev: Event) => any) | null;\\n    readonly readyState: ReadyState;\\n    readonly sourceBuffers: SourceBufferList;\\n    addSourceBuffer(type: string): SourceBuffer;\\n    clearLiveSeekableRange(): void;\\n    endOfStream(error?: EndOfStreamError): void;\\n    removeSourceBuffer(sourceBuffer: SourceBuffer): void;\\n    setLiveSeekableRange(start: number, end: number): void;\\n    addEventListener<K extends keyof MediaSourceEventMap>(type: K, listener: (this: MediaSource, ev: MediaSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof MediaSourceEventMap>(type: K, listener: (this: MediaSource, ev: MediaSourceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var MediaSource: {\\n    prototype: MediaSource;\\n    new(): MediaSource;\\n    isTypeSupported(type: string): boolean;\\n};\\n\\ninterface MediaStreamEventMap {\\n    \\\"addtrack\\\": MediaStreamTrackEvent;\\n    \\\"removetrack\\\": MediaStreamTrackEvent;\\n}\\n\\n/** A stream of media content. A stream consists of several tracks such as video or audio tracks. Each track is specified as an instance of MediaStreamTrack. */\\ninterface MediaStream extends EventTarget {\\n    readonly active: boolean;\\n    readonly id: string;\\n    onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;\\n    onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;\\n    addTrack(track: MediaStreamTrack): void;\\n    clone(): MediaStream;\\n    getAudioTracks(): MediaStreamTrack[];\\n    getTrackById(trackId: string): MediaStreamTrack | null;\\n    getTracks(): MediaStreamTrack[];\\n    getVideoTracks(): MediaStreamTrack[];\\n    removeTrack(track: MediaStreamTrack): void;\\n    addEventListener<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof MediaStreamEventMap>(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var MediaStream: {\\n    prototype: MediaStream;\\n    new(): MediaStream;\\n    new(stream: MediaStream): MediaStream;\\n    new(tracks: MediaStreamTrack[]): MediaStream;\\n};\\n\\ninterface MediaStreamAudioDestinationNode extends AudioNode {\\n    readonly stream: MediaStream;\\n}\\n\\ndeclare var MediaStreamAudioDestinationNode: {\\n    prototype: MediaStreamAudioDestinationNode;\\n    new(context: AudioContext, options?: AudioNodeOptions): MediaStreamAudioDestinationNode;\\n};\\n\\n/** A type of AudioNode which operates as an audio source whose media is received from a MediaStream obtained using the WebRTC or Media Capture and Streams APIs. */\\ninterface MediaStreamAudioSourceNode extends AudioNode {\\n    readonly mediaStream: MediaStream;\\n}\\n\\ndeclare var MediaStreamAudioSourceNode: {\\n    prototype: MediaStreamAudioSourceNode;\\n    new(context: AudioContext, options: MediaStreamAudioSourceOptions): MediaStreamAudioSourceNode;\\n};\\n\\ninterface MediaStreamError {\\n    readonly constraintName: string | null;\\n    readonly message: string | null;\\n    readonly name: string;\\n}\\n\\ndeclare var MediaStreamError: {\\n    prototype: MediaStreamError;\\n    new(): MediaStreamError;\\n};\\n\\ninterface MediaStreamErrorEvent extends Event {\\n    readonly error: MediaStreamError | null;\\n}\\n\\ndeclare var MediaStreamErrorEvent: {\\n    prototype: MediaStreamErrorEvent;\\n    new(typeArg: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent;\\n};\\n\\n/** Events that occurs in relation to a MediaStream. Two events of this type can be thrown: addstream and removestream. */\\ninterface MediaStreamEvent extends Event {\\n    readonly stream: MediaStream | null;\\n}\\n\\ndeclare var MediaStreamEvent: {\\n    prototype: MediaStreamEvent;\\n    new(type: string, eventInitDict: MediaStreamEventInit): MediaStreamEvent;\\n};\\n\\ninterface MediaStreamTrackEventMap {\\n    \\\"ended\\\": Event;\\n    \\\"isolationchange\\\": Event;\\n    \\\"mute\\\": Event;\\n    \\\"unmute\\\": Event;\\n}\\n\\n/** A single media track within a stream; typically, these are audio or video tracks, but other track types may exist as well. */\\ninterface MediaStreamTrack extends EventTarget {\\n    enabled: boolean;\\n    readonly id: string;\\n    readonly isolated: boolean;\\n    readonly kind: string;\\n    readonly label: string;\\n    readonly muted: boolean;\\n    onended: ((this: MediaStreamTrack, ev: Event) => any) | null;\\n    onisolationchange: ((this: MediaStreamTrack, ev: Event) => any) | null;\\n    onmute: ((this: MediaStreamTrack, ev: Event) => any) | null;\\n    onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null;\\n    readonly readyState: MediaStreamTrackState;\\n    applyConstraints(constraints?: MediaTrackConstraints): Promise<void>;\\n    clone(): MediaStreamTrack;\\n    getCapabilities(): MediaTrackCapabilities;\\n    getConstraints(): MediaTrackConstraints;\\n    getSettings(): MediaTrackSettings;\\n    stop(): void;\\n    addEventListener<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var MediaStreamTrack: {\\n    prototype: MediaStreamTrack;\\n    new(): MediaStreamTrack;\\n};\\n\\ninterface MediaStreamTrackAudioSourceNode extends AudioNode {\\n}\\n\\ndeclare var MediaStreamTrackAudioSourceNode: {\\n    prototype: MediaStreamTrackAudioSourceNode;\\n    new(context: AudioContext, options: MediaStreamTrackAudioSourceOptions): MediaStreamTrackAudioSourceNode;\\n};\\n\\n/** Events which indicate that a MediaStream has had tracks added to or removed from the stream through calls to Media Stream API methods. These events are sent to the stream when these changes occur. */\\ninterface MediaStreamTrackEvent extends Event {\\n    readonly track: MediaStreamTrack;\\n}\\n\\ndeclare var MediaStreamTrackEvent: {\\n    prototype: MediaStreamTrackEvent;\\n    new(type: string, eventInitDict: MediaStreamTrackEventInit): MediaStreamTrackEvent;\\n};\\n\\n/** This Channel Messaging API interface allows us to create a new message channel and send data through it via its two MessagePort properties. */\\ninterface MessageChannel {\\n    /**\\n     * Returns the first MessagePort object.\\n     */\\n    readonly port1: MessagePort;\\n    /**\\n     * Returns the second MessagePort object.\\n     */\\n    readonly port2: MessagePort;\\n}\\n\\ndeclare var MessageChannel: {\\n    prototype: MessageChannel;\\n    new(): MessageChannel;\\n};\\n\\n/** A message received by a target object. */\\ninterface MessageEvent<T = any> extends Event {\\n    /**\\n     * Returns the data of the message.\\n     */\\n    readonly data: T;\\n    /**\\n     * Returns the last event ID string, for server-sent events.\\n     */\\n    readonly lastEventId: string;\\n    /**\\n     * Returns the origin of the message, for server-sent events and cross-document messaging.\\n     */\\n    readonly origin: string;\\n    /**\\n     * Returns the MessagePort array sent with the message, for cross-document messaging and channel messaging.\\n     */\\n    readonly ports: ReadonlyArray<MessagePort>;\\n    /**\\n     * Returns the WindowProxy of the source window, for cross-document messaging, and the MessagePort being attached, in the connect event fired at SharedWorkerGlobalScope objects.\\n     */\\n    readonly source: MessageEventSource | null;\\n}\\n\\ndeclare var MessageEvent: {\\n    prototype: MessageEvent;\\n    new<T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent<T>;\\n};\\n\\ninterface MessagePortEventMap {\\n    \\\"message\\\": MessageEvent;\\n    \\\"messageerror\\\": MessageEvent;\\n}\\n\\n/** This Channel Messaging API interface represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other. */\\ninterface MessagePort extends EventTarget {\\n    onmessage: ((this: MessagePort, ev: MessageEvent) => any) | null;\\n    onmessageerror: ((this: MessagePort, ev: MessageEvent) => any) | null;\\n    /**\\n     * Disconnects the port, so that it is no longer active.\\n     */\\n    close(): void;\\n    /**\\n     * Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side.\\n     * \\n     * Throws a \\\"DataCloneError\\\" DOMException if transfer contains duplicate objects or port, or if message could not be cloned.\\n     */\\n    postMessage(message: any, transfer: Transferable[]): void;\\n    postMessage(message: any, options?: PostMessageOptions): void;\\n    /**\\n     * Begins dispatching messages received on the port.\\n     */\\n    start(): void;\\n    addEventListener<K extends keyof MessagePortEventMap>(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof MessagePortEventMap>(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var MessagePort: {\\n    prototype: MessagePort;\\n    new(): MessagePort;\\n};\\n\\n/** Provides contains information about a MIME type associated with a particular plugin. NavigatorPlugins.mimeTypes returns an array of this object. */\\ninterface MimeType {\\n    /**\\n     * Returns the MIME type's description.\\n     */\\n    readonly description: string;\\n    /**\\n     * Returns the Plugin object that implements this MIME type.\\n     */\\n    readonly enabledPlugin: Plugin;\\n    /**\\n     * Returns the MIME type's typical file extensions, in a comma-separated list.\\n     */\\n    readonly suffixes: string;\\n    /**\\n     * Returns the MIME type.\\n     */\\n    readonly type: string;\\n}\\n\\ndeclare var MimeType: {\\n    prototype: MimeType;\\n    new(): MimeType;\\n};\\n\\n/** Returns an array of MimeType instances, each of which contains information about a supported browser plugins. This object is returned by NavigatorPlugins.mimeTypes. */\\ninterface MimeTypeArray {\\n    readonly length: number;\\n    item(index: number): MimeType | null;\\n    namedItem(name: string): MimeType | null;\\n    [index: number]: MimeType;\\n}\\n\\ndeclare var MimeTypeArray: {\\n    prototype: MimeTypeArray;\\n    new(): MimeTypeArray;\\n};\\n\\n/** Events that occur due to the user interacting with a pointing device (such as a mouse). Common events using this interface include click, dblclick, mouseup, mousedown. */\\ninterface MouseEvent extends UIEvent {\\n    readonly altKey: boolean;\\n    readonly button: number;\\n    readonly buttons: number;\\n    readonly clientX: number;\\n    readonly clientY: number;\\n    readonly ctrlKey: boolean;\\n    readonly metaKey: boolean;\\n    readonly movementX: number;\\n    readonly movementY: number;\\n    readonly offsetX: number;\\n    readonly offsetY: number;\\n    readonly pageX: number;\\n    readonly pageY: number;\\n    readonly relatedTarget: EventTarget | null;\\n    readonly screenX: number;\\n    readonly screenY: number;\\n    readonly shiftKey: boolean;\\n    readonly x: number;\\n    readonly y: number;\\n    getModifierState(keyArg: string): boolean;\\n    initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget | null): void;\\n}\\n\\ndeclare var MouseEvent: {\\n    prototype: MouseEvent;\\n    new(type: string, eventInitDict?: MouseEventInit): MouseEvent;\\n};\\n\\n/** Provides event properties that are specific to modifications to the Document Object Model (DOM) hierarchy and nodes.\\n * @deprecated DOM4 [DOM] provides a new mechanism using a MutationObserver interface which addresses the use cases that mutation events solve, but in a more performant manner. Thus, this specification describes mutation events for reference and completeness of legacy behavior, but deprecates the use of the MutationEvent interface. */\\ninterface MutationEvent extends Event {\\n    readonly attrChange: number;\\n    readonly attrName: string;\\n    readonly newValue: string;\\n    readonly prevValue: string;\\n    readonly relatedNode: Node;\\n    initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void;\\n    readonly ADDITION: number;\\n    readonly MODIFICATION: number;\\n    readonly REMOVAL: number;\\n}\\n\\ndeclare var MutationEvent: {\\n    prototype: MutationEvent;\\n    new(): MutationEvent;\\n    readonly ADDITION: number;\\n    readonly MODIFICATION: number;\\n    readonly REMOVAL: number;\\n};\\n\\n/** Provides the ability to watch for changes being made to the DOM tree. It is designed as a replacement for the older Mutation Events feature which was part of the DOM3 Events specification. */\\ninterface MutationObserver {\\n    /**\\n     * Stops observer from observing any mutations. Until the observe() method is used again, observer's callback will not be invoked.\\n     */\\n    disconnect(): void;\\n    /**\\n     * Instructs the user agent to observe a given target (a node) and report any mutations based on the criteria given by options (an object).\\n     * \\n     * The options argument allows for setting mutation observation options via object members.\\n     */\\n    observe(target: Node, options?: MutationObserverInit): void;\\n    /**\\n     * Empties the record queue and returns what was in there.\\n     */\\n    takeRecords(): MutationRecord[];\\n}\\n\\ndeclare var MutationObserver: {\\n    prototype: MutationObserver;\\n    new(callback: MutationCallback): MutationObserver;\\n};\\n\\n/** A MutationRecord represents an individual DOM mutation. It is the object that is passed to MutationObserver's callback. */\\ninterface MutationRecord {\\n    /**\\n     * Return the nodes added and removed respectively.\\n     */\\n    readonly addedNodes: NodeList;\\n    /**\\n     * Returns the local name of the changed attribute, and null otherwise.\\n     */\\n    readonly attributeName: string | null;\\n    /**\\n     * Returns the namespace of the changed attribute, and null otherwise.\\n     */\\n    readonly attributeNamespace: string | null;\\n    /**\\n     * Return the previous and next sibling respectively of the added or removed nodes, and null otherwise.\\n     */\\n    readonly nextSibling: Node | null;\\n    /**\\n     * The return value depends on type. For \\\"attributes\\\", it is the value of the changed attribute before the change. For \\\"characterData\\\", it is the data of the changed node before the change. For \\\"childList\\\", it is null.\\n     */\\n    readonly oldValue: string | null;\\n    /**\\n     * Return the previous and next sibling respectively of the added or removed nodes, and null otherwise.\\n     */\\n    readonly previousSibling: Node | null;\\n    /**\\n     * Return the nodes added and removed respectively.\\n     */\\n    readonly removedNodes: NodeList;\\n    /**\\n     * Returns the node the mutation affected, depending on the type. For \\\"attributes\\\", it is the element whose attribute changed. For \\\"characterData\\\", it is the CharacterData node. For \\\"childList\\\", it is the node whose children changed.\\n     */\\n    readonly target: Node;\\n    /**\\n     * Returns \\\"attributes\\\" if it was an attribute mutation. \\\"characterData\\\" if it was a mutation to a CharacterData node. And \\\"childList\\\" if it was a mutation to the tree of nodes.\\n     */\\n    readonly type: MutationRecordType;\\n}\\n\\ndeclare var MutationRecord: {\\n    prototype: MutationRecord;\\n    new(): MutationRecord;\\n};\\n\\n/** A collection of Attr objects. Objects inside a NamedNodeMap are not in any particular order, unlike NodeList, although they may be accessed by an index as in an array. */\\ninterface NamedNodeMap {\\n    readonly length: number;\\n    getNamedItem(qualifiedName: string): Attr | null;\\n    getNamedItemNS(namespace: string | null, localName: string): Attr | null;\\n    item(index: number): Attr | null;\\n    removeNamedItem(qualifiedName: string): Attr;\\n    removeNamedItemNS(namespace: string | null, localName: string): Attr;\\n    setNamedItem(attr: Attr): Attr | null;\\n    setNamedItemNS(attr: Attr): Attr | null;\\n    [index: number]: Attr;\\n}\\n\\ndeclare var NamedNodeMap: {\\n    prototype: NamedNodeMap;\\n    new(): NamedNodeMap;\\n};\\n\\ninterface NavigationPreloadManager {\\n    disable(): Promise<void>;\\n    enable(): Promise<void>;\\n    getState(): Promise<NavigationPreloadState>;\\n    setHeaderValue(value: string): Promise<void>;\\n}\\n\\ndeclare var NavigationPreloadManager: {\\n    prototype: NavigationPreloadManager;\\n    new(): NavigationPreloadManager;\\n};\\n\\n/** The state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities. */\\ninterface Navigator extends MSFileSaver, MSNavigatorDoNotTrack, NavigatorAutomationInformation, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorContentUtils, NavigatorCookies, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorPlugins, NavigatorStorage {\\n    readonly activeVRDisplays: ReadonlyArray<VRDisplay>;\\n    readonly clipboard: Clipboard;\\n    readonly credentials: CredentialsContainer;\\n    readonly doNotTrack: string | null;\\n    readonly geolocation: Geolocation;\\n    readonly maxTouchPoints: number;\\n    readonly mediaDevices: MediaDevices;\\n    readonly msManipulationViewsEnabled: boolean;\\n    readonly msMaxTouchPoints: number;\\n    readonly msPointerEnabled: boolean;\\n    readonly permissions: Permissions;\\n    readonly pointerEnabled: boolean;\\n    readonly serviceWorker: ServiceWorkerContainer;\\n    getGamepads(): (Gamepad | null)[];\\n    getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void;\\n    getVRDisplays(): Promise<VRDisplay[]>;\\n    msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void;\\n    requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise<MediaKeySystemAccess>;\\n    sendBeacon(url: string, data?: BodyInit | null): boolean;\\n    share(data?: ShareData): Promise<void>;\\n    vibrate(pattern: number | number[]): boolean;\\n}\\n\\ndeclare var Navigator: {\\n    prototype: Navigator;\\n    new(): Navigator;\\n};\\n\\ninterface NavigatorAutomationInformation {\\n    readonly webdriver: boolean;\\n}\\n\\ninterface NavigatorBeacon {\\n    sendBeacon(url: string, data?: Blob | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | FormData | string | null): boolean;\\n}\\n\\ninterface NavigatorConcurrentHardware {\\n    readonly hardwareConcurrency: number;\\n}\\n\\ninterface NavigatorContentUtils {\\n    registerProtocolHandler(scheme: string, url: string, title: string): void;\\n    unregisterProtocolHandler(scheme: string, url: string): void;\\n}\\n\\ninterface NavigatorCookies {\\n    readonly cookieEnabled: boolean;\\n}\\n\\ninterface NavigatorID {\\n    readonly appCodeName: string;\\n    readonly appName: string;\\n    readonly appVersion: string;\\n    readonly platform: string;\\n    readonly product: string;\\n    readonly productSub: string;\\n    readonly userAgent: string;\\n    readonly vendor: string;\\n    readonly vendorSub: string;\\n}\\n\\ninterface NavigatorLanguage {\\n    readonly language: string;\\n    readonly languages: ReadonlyArray<string>;\\n}\\n\\ninterface NavigatorOnLine {\\n    readonly onLine: boolean;\\n}\\n\\ninterface NavigatorPlugins {\\n    readonly mimeTypes: MimeTypeArray;\\n    readonly plugins: PluginArray;\\n    javaEnabled(): boolean;\\n}\\n\\ninterface NavigatorStorage {\\n    readonly storage: StorageManager;\\n}\\n\\n/** Node is an interface from which a number of DOM API object types inherit. It allows those types to be treated similarly; for example, inheriting the same set of methods, or being tested in the same way. */\\ninterface Node extends EventTarget {\\n    /**\\n     * Returns node's node document's document base URL.\\n     */\\n    readonly baseURI: string;\\n    /**\\n     * Returns the children.\\n     */\\n    readonly childNodes: NodeListOf<ChildNode>;\\n    /**\\n     * Returns the first child.\\n     */\\n    readonly firstChild: ChildNode | null;\\n    /**\\n     * Returns true if node is connected and false otherwise.\\n     */\\n    readonly isConnected: boolean;\\n    /**\\n     * Returns the last child.\\n     */\\n    readonly lastChild: ChildNode | null;\\n    /** @deprecated */\\n    readonly namespaceURI: string | null;\\n    /**\\n     * Returns the next sibling.\\n     */\\n    readonly nextSibling: ChildNode | null;\\n    /**\\n     * Returns a string appropriate for the type of node.\\n     */\\n    readonly nodeName: string;\\n    /**\\n     * Returns the type of node.\\n     */\\n    readonly nodeType: number;\\n    nodeValue: string | null;\\n    /**\\n     * Returns the node document. Returns null for documents.\\n     */\\n    readonly ownerDocument: Document | null;\\n    /**\\n     * Returns the parent element.\\n     */\\n    readonly parentElement: HTMLElement | null;\\n    /**\\n     * Returns the parent.\\n     */\\n    readonly parentNode: Node & ParentNode | null;\\n    /**\\n     * Returns the previous sibling.\\n     */\\n    readonly previousSibling: ChildNode | null;\\n    textContent: string | null;\\n    appendChild<T extends Node>(newChild: T): T;\\n    /**\\n     * Returns a copy of node. If deep is true, the copy also includes the node's descendants.\\n     */\\n    cloneNode(deep?: boolean): Node;\\n    /**\\n     * Returns a bitmask indicating the position of other relative to node.\\n     */\\n    compareDocumentPosition(other: Node): number;\\n    /**\\n     * Returns true if other is an inclusive descendant of node, and false otherwise.\\n     */\\n    contains(other: Node | null): boolean;\\n    /**\\n     * Returns node's root.\\n     */\\n    getRootNode(options?: GetRootNodeOptions): Node;\\n    /**\\n     * Returns whether node has children.\\n     */\\n    hasChildNodes(): boolean;\\n    insertBefore<T extends Node>(newChild: T, refChild: Node | null): T;\\n    isDefaultNamespace(namespace: string | null): boolean;\\n    /**\\n     * Returns whether node and otherNode have the same properties.\\n     */\\n    isEqualNode(otherNode: Node | null): boolean;\\n    isSameNode(otherNode: Node | null): boolean;\\n    lookupNamespaceURI(prefix: string | null): string | null;\\n    lookupPrefix(namespace: string | null): string | null;\\n    /**\\n     * Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.\\n     */\\n    normalize(): void;\\n    removeChild<T extends Node>(oldChild: T): T;\\n    replaceChild<T extends Node>(newChild: Node, oldChild: T): T;\\n    readonly ATTRIBUTE_NODE: number;\\n    /**\\n     * node is a CDATASection node.\\n     */\\n    readonly CDATA_SECTION_NODE: number;\\n    /**\\n     * node is a Comment node.\\n     */\\n    readonly COMMENT_NODE: number;\\n    /**\\n     * node is a DocumentFragment node.\\n     */\\n    readonly DOCUMENT_FRAGMENT_NODE: number;\\n    /**\\n     * node is a document.\\n     */\\n    readonly DOCUMENT_NODE: number;\\n    /**\\n     * Set when other is a descendant of node.\\n     */\\n    readonly DOCUMENT_POSITION_CONTAINED_BY: number;\\n    /**\\n     * Set when other is an ancestor of node.\\n     */\\n    readonly DOCUMENT_POSITION_CONTAINS: number;\\n    /**\\n     * Set when node and other are not in the same tree.\\n     */\\n    readonly DOCUMENT_POSITION_DISCONNECTED: number;\\n    /**\\n     * Set when other is following node.\\n     */\\n    readonly DOCUMENT_POSITION_FOLLOWING: number;\\n    readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;\\n    /**\\n     * Set when other is preceding node.\\n     */\\n    readonly DOCUMENT_POSITION_PRECEDING: number;\\n    /**\\n     * node is a doctype.\\n     */\\n    readonly DOCUMENT_TYPE_NODE: number;\\n    /**\\n     * node is an element.\\n     */\\n    readonly ELEMENT_NODE: number;\\n    readonly ENTITY_NODE: number;\\n    readonly ENTITY_REFERENCE_NODE: number;\\n    readonly NOTATION_NODE: number;\\n    /**\\n     * node is a ProcessingInstruction node.\\n     */\\n    readonly PROCESSING_INSTRUCTION_NODE: number;\\n    /**\\n     * node is a Text node.\\n     */\\n    readonly TEXT_NODE: number;\\n}\\n\\ndeclare var Node: {\\n    prototype: Node;\\n    new(): Node;\\n    readonly ATTRIBUTE_NODE: number;\\n    /**\\n     * node is a CDATASection node.\\n     */\\n    readonly CDATA_SECTION_NODE: number;\\n    /**\\n     * node is a Comment node.\\n     */\\n    readonly COMMENT_NODE: number;\\n    /**\\n     * node is a DocumentFragment node.\\n     */\\n    readonly DOCUMENT_FRAGMENT_NODE: number;\\n    /**\\n     * node is a document.\\n     */\\n    readonly DOCUMENT_NODE: number;\\n    /**\\n     * Set when other is a descendant of node.\\n     */\\n    readonly DOCUMENT_POSITION_CONTAINED_BY: number;\\n    /**\\n     * Set when other is an ancestor of node.\\n     */\\n    readonly DOCUMENT_POSITION_CONTAINS: number;\\n    /**\\n     * Set when node and other are not in the same tree.\\n     */\\n    readonly DOCUMENT_POSITION_DISCONNECTED: number;\\n    /**\\n     * Set when other is following node.\\n     */\\n    readonly DOCUMENT_POSITION_FOLLOWING: number;\\n    readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;\\n    /**\\n     * Set when other is preceding node.\\n     */\\n    readonly DOCUMENT_POSITION_PRECEDING: number;\\n    /**\\n     * node is a doctype.\\n     */\\n    readonly DOCUMENT_TYPE_NODE: number;\\n    /**\\n     * node is an element.\\n     */\\n    readonly ELEMENT_NODE: number;\\n    readonly ENTITY_NODE: number;\\n    readonly ENTITY_REFERENCE_NODE: number;\\n    readonly NOTATION_NODE: number;\\n    /**\\n     * node is a ProcessingInstruction node.\\n     */\\n    readonly PROCESSING_INSTRUCTION_NODE: number;\\n    /**\\n     * node is a Text node.\\n     */\\n    readonly TEXT_NODE: number;\\n};\\n\\n/** An object used to filter the nodes in a NodeIterator or TreeWalker. They don't know anything about the DOM or how to traverse nodes; they just know how to evaluate a single node against the provided filter. */\\ninterface NodeFilter {\\n    acceptNode(node: Node): number;\\n}\\n\\ndeclare var NodeFilter: {\\n    readonly FILTER_ACCEPT: number;\\n    readonly FILTER_REJECT: number;\\n    readonly FILTER_SKIP: number;\\n    readonly SHOW_ALL: number;\\n    readonly SHOW_ATTRIBUTE: number;\\n    readonly SHOW_CDATA_SECTION: number;\\n    readonly SHOW_COMMENT: number;\\n    readonly SHOW_DOCUMENT: number;\\n    readonly SHOW_DOCUMENT_FRAGMENT: number;\\n    readonly SHOW_DOCUMENT_TYPE: number;\\n    readonly SHOW_ELEMENT: number;\\n    readonly SHOW_ENTITY: number;\\n    readonly SHOW_ENTITY_REFERENCE: number;\\n    readonly SHOW_NOTATION: number;\\n    readonly SHOW_PROCESSING_INSTRUCTION: number;\\n    readonly SHOW_TEXT: number;\\n};\\n\\n/** An iterator over the members of a list of the nodes in a subtree of the DOM. The nodes will be returned in document order. */\\ninterface NodeIterator {\\n    readonly filter: NodeFilter | null;\\n    readonly pointerBeforeReferenceNode: boolean;\\n    readonly referenceNode: Node;\\n    readonly root: Node;\\n    readonly whatToShow: number;\\n    detach(): void;\\n    nextNode(): Node | null;\\n    previousNode(): Node | null;\\n}\\n\\ndeclare var NodeIterator: {\\n    prototype: NodeIterator;\\n    new(): NodeIterator;\\n};\\n\\n/** NodeList objects are collections of nodes, usually returned by properties such as Node.childNodes and methods such as document.querySelectorAll(). */\\ninterface NodeList {\\n    /**\\n     * Returns the number of nodes in the collection.\\n     */\\n    readonly length: number;\\n    /**\\n     * Returns the node with index index from the collection. The nodes are sorted in tree order.\\n     */\\n    item(index: number): Node | null;\\n    /**\\n     * Performs the specified action for each node in an list.\\n     * @param callbackfn  A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.\\n     * @param thisArg  An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\\n     */\\n    forEach(callbackfn: (value: Node, key: number, parent: NodeList) => void, thisArg?: any): void;\\n    [index: number]: Node;\\n}\\n\\ndeclare var NodeList: {\\n    prototype: NodeList;\\n    new(): NodeList;\\n};\\n\\ninterface NodeListOf<TNode extends Node> extends NodeList {\\n    item(index: number): TNode;\\n    /**\\n     * Performs the specified action for each node in an list.\\n     * @param callbackfn  A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.\\n     * @param thisArg  An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\\n     */\\n    forEach(callbackfn: (value: TNode, key: number, parent: NodeListOf<TNode>) => void, thisArg?: any): void;\\n    [index: number]: TNode;\\n}\\n\\ninterface NonDocumentTypeChildNode {\\n    /**\\n     * Returns the first following sibling that is an element, and null otherwise.\\n     */\\n    readonly nextElementSibling: Element | null;\\n    /**\\n     * Returns the first preceding sibling that is an element, and null otherwise.\\n     */\\n    readonly previousElementSibling: Element | null;\\n}\\n\\ninterface NonElementParentNode {\\n    /**\\n     * Returns the first element within node's descendants whose ID is elementId.\\n     */\\n    getElementById(elementId: string): Element | null;\\n}\\n\\ninterface NotificationEventMap {\\n    \\\"click\\\": Event;\\n    \\\"close\\\": Event;\\n    \\\"error\\\": Event;\\n    \\\"show\\\": Event;\\n}\\n\\n/** This Notifications API interface is used to configure and display desktop notifications to the user. */\\ninterface Notification extends EventTarget {\\n    readonly actions: ReadonlyArray<NotificationAction>;\\n    readonly badge: string;\\n    readonly body: string;\\n    readonly data: any;\\n    readonly dir: NotificationDirection;\\n    readonly icon: string;\\n    readonly image: string;\\n    readonly lang: string;\\n    onclick: ((this: Notification, ev: Event) => any) | null;\\n    onclose: ((this: Notification, ev: Event) => any) | null;\\n    onerror: ((this: Notification, ev: Event) => any) | null;\\n    onshow: ((this: Notification, ev: Event) => any) | null;\\n    readonly renotify: boolean;\\n    readonly requireInteraction: boolean;\\n    readonly silent: boolean;\\n    readonly tag: string;\\n    readonly timestamp: number;\\n    readonly title: string;\\n    readonly vibrate: ReadonlyArray<number>;\\n    close(): void;\\n    addEventListener<K extends keyof NotificationEventMap>(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof NotificationEventMap>(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var Notification: {\\n    prototype: Notification;\\n    new(title: string, options?: NotificationOptions): Notification;\\n    readonly maxActions: number;\\n    readonly permission: NotificationPermission;\\n    requestPermission(deprecatedCallback?: NotificationPermissionCallback): Promise<NotificationPermission>;\\n};\\n\\n/** The OES_element_index_uint extension is part of the WebGL API and adds support for gl.UNSIGNED_INT types to WebGLRenderingContext.drawElements(). */\\ninterface OES_element_index_uint {\\n}\\n\\n/** The OES_standard_derivatives extension is part of the WebGL API and adds the GLSL derivative functions dFdx, dFdy, and fwidth. */\\ninterface OES_standard_derivatives {\\n    readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: GLenum;\\n}\\n\\n/** The OES_texture_float extension is part of the WebGL API and exposes floating-point pixel types for textures. */\\ninterface OES_texture_float {\\n}\\n\\n/** The OES_texture_float_linear extension is part of the WebGL API and allows linear filtering with floating-point pixel types for textures. */\\ninterface OES_texture_float_linear {\\n}\\n\\n/** The OES_texture_half_float extension is part of the WebGL API and adds texture formats with 16- (aka half float) and 32-bit floating-point components. */\\ninterface OES_texture_half_float {\\n    readonly HALF_FLOAT_OES: GLenum;\\n}\\n\\n/** The OES_texture_half_float_linear extension is part of the WebGL API and allows linear filtering with half floating-point pixel types for textures. */\\ninterface OES_texture_half_float_linear {\\n}\\n\\ninterface OES_vertex_array_object {\\n    bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void;\\n    createVertexArrayOES(): WebGLVertexArrayObjectOES | null;\\n    deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void;\\n    isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): GLboolean;\\n    readonly VERTEX_ARRAY_BINDING_OES: GLenum;\\n}\\n\\n/** The Web Audio API OfflineAudioCompletionEvent interface represents events that occur when the processing of an OfflineAudioContext is terminated. The complete event implements this interface. */\\ninterface OfflineAudioCompletionEvent extends Event {\\n    readonly renderedBuffer: AudioBuffer;\\n}\\n\\ndeclare var OfflineAudioCompletionEvent: {\\n    prototype: OfflineAudioCompletionEvent;\\n    new(type: string, eventInitDict: OfflineAudioCompletionEventInit): OfflineAudioCompletionEvent;\\n};\\n\\ninterface OfflineAudioContextEventMap extends BaseAudioContextEventMap {\\n    \\\"complete\\\": OfflineAudioCompletionEvent;\\n}\\n\\n/** An AudioContext interface representing an audio-processing graph built from linked together AudioNodes. In contrast with a standard AudioContext, an OfflineAudioContext doesn't render the audio to the device hardware; instead, it generates it, as fast as it can, and outputs the result to an AudioBuffer. */\\ninterface OfflineAudioContext extends BaseAudioContext {\\n    readonly length: number;\\n    oncomplete: ((this: OfflineAudioContext, ev: OfflineAudioCompletionEvent) => any) | null;\\n    resume(): Promise<void>;\\n    startRendering(): Promise<AudioBuffer>;\\n    suspend(suspendTime: number): Promise<void>;\\n    addEventListener<K extends keyof OfflineAudioContextEventMap>(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof OfflineAudioContextEventMap>(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var OfflineAudioContext: {\\n    prototype: OfflineAudioContext;\\n    new(contextOptions: OfflineAudioContextOptions): OfflineAudioContext;\\n    new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext;\\n};\\n\\ninterface OffscreenCanvas extends EventTarget {\\n    /**\\n     * These attributes return the dimensions of the OffscreenCanvas object's bitmap.\\n     * \\n     * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).\\n     */\\n    height: number;\\n    /**\\n     * These attributes return the dimensions of the OffscreenCanvas object's bitmap.\\n     * \\n     * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).\\n     */\\n    width: number;\\n    /**\\n     * Returns a promise that will fulfill with a new Blob object representing a file containing the image in the OffscreenCanvas object.\\n     * \\n     * The argument, if provided, is a dictionary that controls the encoding options of the image file to be created. The type field specifies the file format and has a default value of \\\"image/png\\\"; that type is also used if the requested type isn't supported. If the image format supports variable quality (such as \\\"image/jpeg\\\"), then the quality field is a number in the range 0.0 to 1.0 inclusive indicating the desired quality level for the resulting image.\\n     */\\n    convertToBlob(options?: ImageEncodeOptions): Promise<Blob>;\\n    /**\\n     * Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: \\\"2d\\\", \\\"bitmaprenderer\\\", \\\"webgl\\\", or \\\"webgl2\\\". options is handled by that API.\\n     * \\n     * This specification defines the \\\"2d\\\" context below, which is similar but distinct from the \\\"2d\\\" context that is created from a canvas element. The WebGL specifications define the \\\"webgl\\\" and \\\"webgl2\\\" contexts. [WEBGL]\\n     * \\n     * Returns null if the canvas has already been initialized with another context type (e.g., trying to get a \\\"2d\\\" context after getting a \\\"webgl\\\" context).\\n     */\\n    getContext(contextId: \\\"2d\\\", options?: CanvasRenderingContext2DSettings): OffscreenCanvasRenderingContext2D | null;\\n    getContext(contextId: \\\"bitmaprenderer\\\", options?: ImageBitmapRenderingContextSettings): ImageBitmapRenderingContext | null;\\n    getContext(contextId: \\\"webgl\\\", options?: WebGLContextAttributes): WebGLRenderingContext | null;\\n    getContext(contextId: \\\"webgl2\\\", options?: WebGLContextAttributes): WebGL2RenderingContext | null;\\n    getContext(contextId: OffscreenRenderingContextId, options?: any): OffscreenRenderingContext | null;\\n    /**\\n     * Returns a newly created ImageBitmap object with the image in the OffscreenCanvas object. The image in the OffscreenCanvas object is replaced with a new blank image.\\n     */\\n    transferToImageBitmap(): ImageBitmap;\\n}\\n\\ndeclare var OffscreenCanvas: {\\n    prototype: OffscreenCanvas;\\n    new(width: number, height: number): OffscreenCanvas;\\n};\\n\\ninterface OffscreenCanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform {\\n    readonly canvas: OffscreenCanvas;\\n    commit(): void;\\n}\\n\\ndeclare var OffscreenCanvasRenderingContext2D: {\\n    prototype: OffscreenCanvasRenderingContext2D;\\n    new(): OffscreenCanvasRenderingContext2D;\\n};\\n\\n/** The OscillatorNode interface represents a periodic waveform, such as a sine wave. It is an AudioScheduledSourceNode audio-processing module that causes a specified frequency of a given wave to be created—in effect, a constant tone. */\\ninterface OscillatorNode extends AudioScheduledSourceNode {\\n    readonly detune: AudioParam;\\n    readonly frequency: AudioParam;\\n    type: OscillatorType;\\n    setPeriodicWave(periodicWave: PeriodicWave): void;\\n    addEventListener<K extends keyof AudioScheduledSourceNodeEventMap>(type: K, listener: (this: OscillatorNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof AudioScheduledSourceNodeEventMap>(type: K, listener: (this: OscillatorNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var OscillatorNode: {\\n    prototype: OscillatorNode;\\n    new(context: BaseAudioContext, options?: OscillatorOptions): OscillatorNode;\\n};\\n\\ninterface OverconstrainedError extends Error {\\n    constraint: string;\\n}\\n\\ndeclare var OverconstrainedError: {\\n    prototype: OverconstrainedError;\\n    new(): OverconstrainedError;\\n};\\n\\ninterface OverflowEvent extends UIEvent {\\n    readonly horizontalOverflow: boolean;\\n    readonly orient: number;\\n    readonly verticalOverflow: boolean;\\n    readonly BOTH: number;\\n    readonly HORIZONTAL: number;\\n    readonly VERTICAL: number;\\n}\\n\\ndeclare var OverflowEvent: {\\n    prototype: OverflowEvent;\\n    new(): OverflowEvent;\\n    readonly BOTH: number;\\n    readonly HORIZONTAL: number;\\n    readonly VERTICAL: number;\\n};\\n\\n/** The PageTransitionEvent is fired when a document is being loaded or unloaded. */\\ninterface PageTransitionEvent extends Event {\\n    /**\\n     * For the pageshow event, returns false if the page is newly being loaded (and the load event will fire). Otherwise, returns true.\\n     * \\n     * For the pagehide event, returns false if the page is going away for the last time. Otherwise, returns true, meaning that (if nothing conspires to make the page unsalvageable) the page might be reused if the user navigates back to this page.\\n     * \\n     * Things that can cause the page to be unsalvageable include:\\n     * \\n     * Listening for beforeunload events\\n     * Listening for unload events\\n     * Having iframes that are not salvageable\\n     * Active WebSocket objects\\n     * Aborting a Document\\n     */\\n    readonly persisted: boolean;\\n}\\n\\ndeclare var PageTransitionEvent: {\\n    prototype: PageTransitionEvent;\\n    new(type: string, eventInitDict?: PageTransitionEventInit): PageTransitionEvent;\\n};\\n\\n/** A PannerNode always has exactly one input and one output: the input can be mono or stereo but the output is always stereo (2 channels); you can't have panning effects without at least two audio channels! */\\ninterface PannerNode extends AudioNode {\\n    coneInnerAngle: number;\\n    coneOuterAngle: number;\\n    coneOuterGain: number;\\n    distanceModel: DistanceModelType;\\n    maxDistance: number;\\n    readonly orientationX: AudioParam;\\n    readonly orientationY: AudioParam;\\n    readonly orientationZ: AudioParam;\\n    panningModel: PanningModelType;\\n    readonly positionX: AudioParam;\\n    readonly positionY: AudioParam;\\n    readonly positionZ: AudioParam;\\n    refDistance: number;\\n    rolloffFactor: number;\\n    /** @deprecated */\\n    setOrientation(x: number, y: number, z: number): void;\\n    /** @deprecated */\\n    setPosition(x: number, y: number, z: number): void;\\n}\\n\\ndeclare var PannerNode: {\\n    prototype: PannerNode;\\n    new(context: BaseAudioContext, options?: PannerOptions): PannerNode;\\n};\\n\\ninterface ParentNode {\\n    readonly childElementCount: number;\\n    /**\\n     * Returns the child elements.\\n     */\\n    readonly children: HTMLCollection;\\n    /**\\n     * Returns the first child that is an element, and null otherwise.\\n     */\\n    readonly firstElementChild: Element | null;\\n    /**\\n     * Returns the last child that is an element, and null otherwise.\\n     */\\n    readonly lastElementChild: Element | null;\\n    /**\\n     * Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.\\n     * \\n     * Throws a \\\"HierarchyRequestError\\\" DOMException if the constraints of the node tree are violated.\\n     */\\n    append(...nodes: (Node | string)[]): void;\\n    /**\\n     * Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.\\n     * \\n     * Throws a \\\"HierarchyRequestError\\\" DOMException if the constraints of the node tree are violated.\\n     */\\n    prepend(...nodes: (Node | string)[]): void;\\n    /**\\n     * Returns the first element that is a descendant of node that matches selectors.\\n     */\\n    querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;\\n    querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;\\n    querySelector<E extends Element = Element>(selectors: string): E | null;\\n    /**\\n     * Returns all element descendants of node that match selectors.\\n     */\\n    querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;\\n    querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;\\n    querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;\\n}\\n\\n/** This Canvas 2D API interface is used to declare a path that can then be used on a CanvasRenderingContext2D object. The path methods of the CanvasRenderingContext2D interface are also present on this interface, which gives you the convenience of being able to retain and replay your path whenever desired. */\\ninterface Path2D extends CanvasPath {\\n    /**\\n     * Adds to the path the path given by the argument.\\n     */\\n    addPath(path: Path2D, transform?: DOMMatrix2DInit): void;\\n}\\n\\ndeclare var Path2D: {\\n    prototype: Path2D;\\n    new(path?: Path2D | string): Path2D;\\n};\\n\\n/** This Payment Request API interface is used to store shipping or payment address information. */\\ninterface PaymentAddress {\\n    readonly addressLine: string[];\\n    readonly city: string;\\n    readonly country: string;\\n    readonly dependentLocality: string;\\n    readonly languageCode: string;\\n    readonly organization: string;\\n    readonly phone: string;\\n    readonly postalCode: string;\\n    readonly recipient: string;\\n    readonly region: string;\\n    readonly sortingCode: string;\\n    toJSON(): any;\\n}\\n\\ndeclare var PaymentAddress: {\\n    prototype: PaymentAddress;\\n    new(): PaymentAddress;\\n};\\n\\ninterface PaymentRequestEventMap {\\n    \\\"shippingaddresschange\\\": Event;\\n    \\\"shippingoptionchange\\\": Event;\\n}\\n\\n/** This Payment Request API interface is the primary access point into the API, and lets web content and apps accept payments from the end user. */\\ninterface PaymentRequest extends EventTarget {\\n    readonly id: string;\\n    onshippingaddresschange: ((this: PaymentRequest, ev: Event) => any) | null;\\n    onshippingoptionchange: ((this: PaymentRequest, ev: Event) => any) | null;\\n    readonly shippingAddress: PaymentAddress | null;\\n    readonly shippingOption: string | null;\\n    readonly shippingType: PaymentShippingType | null;\\n    abort(): Promise<void>;\\n    canMakePayment(): Promise<boolean>;\\n    show(): Promise<PaymentResponse>;\\n    addEventListener<K extends keyof PaymentRequestEventMap>(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof PaymentRequestEventMap>(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var PaymentRequest: {\\n    prototype: PaymentRequest;\\n    new(methodData: PaymentMethodData[], details: PaymentDetailsInit, options?: PaymentOptions): PaymentRequest;\\n};\\n\\n/** This Payment Request API interface enables a web page to update the details of a PaymentRequest in response to a user action. */\\ninterface PaymentRequestUpdateEvent extends Event {\\n    updateWith(detailsPromise: PaymentDetailsUpdate | Promise<PaymentDetailsUpdate>): void;\\n}\\n\\ndeclare var PaymentRequestUpdateEvent: {\\n    prototype: PaymentRequestUpdateEvent;\\n    new(type: string, eventInitDict?: PaymentRequestUpdateEventInit): PaymentRequestUpdateEvent;\\n};\\n\\n/** This Payment Request API interface is returned after a user selects a payment method and approves a payment request. */\\ninterface PaymentResponse {\\n    readonly details: any;\\n    readonly methodName: string;\\n    readonly payerEmail: string | null;\\n    readonly payerName: string | null;\\n    readonly payerPhone: string | null;\\n    readonly requestId: string;\\n    readonly shippingAddress: PaymentAddress | null;\\n    readonly shippingOption: string | null;\\n    complete(result?: PaymentComplete): Promise<void>;\\n    toJSON(): any;\\n}\\n\\ndeclare var PaymentResponse: {\\n    prototype: PaymentResponse;\\n    new(): PaymentResponse;\\n};\\n\\ninterface PerfWidgetExternal {\\n    readonly activeNetworkRequestCount: number;\\n    readonly averageFrameTime: number;\\n    readonly averagePaintTime: number;\\n    readonly extraInformationEnabled: boolean;\\n    readonly independentRenderingEnabled: boolean;\\n    readonly irDisablingContentString: string;\\n    readonly irStatusAvailable: boolean;\\n    readonly maxCpuSpeed: number;\\n    readonly paintRequestsPerSecond: number;\\n    readonly performanceCounter: number;\\n    readonly performanceCounterFrequency: number;\\n    addEventListener(eventType: string, callback: Function): void;\\n    getMemoryUsage(): number;\\n    getProcessCpuUsage(): number;\\n    getRecentCpuUsage(last: number | null): any;\\n    getRecentFrames(last: number | null): any;\\n    getRecentMemoryUsage(last: number | null): any;\\n    getRecentPaintRequests(last: number | null): any;\\n    removeEventListener(eventType: string, callback: Function): void;\\n    repositionWindow(x: number, y: number): void;\\n    resizeWindow(width: number, height: number): void;\\n}\\n\\ndeclare var PerfWidgetExternal: {\\n    prototype: PerfWidgetExternal;\\n    new(): PerfWidgetExternal;\\n};\\n\\ninterface PerformanceEventMap {\\n    \\\"resourcetimingbufferfull\\\": Event;\\n}\\n\\n/** Provides access to performance-related information for the current page. It's part of the High Resolution Time API, but is enhanced by the Performance Timeline API, the Navigation Timing API, the User Timing API, and the Resource Timing API. */\\ninterface Performance extends EventTarget {\\n    /** @deprecated */\\n    readonly navigation: PerformanceNavigation;\\n    onresourcetimingbufferfull: ((this: Performance, ev: Event) => any) | null;\\n    readonly timeOrigin: number;\\n    /** @deprecated */\\n    readonly timing: PerformanceTiming;\\n    clearMarks(markName?: string): void;\\n    clearMeasures(measureName?: string): void;\\n    clearResourceTimings(): void;\\n    getEntries(): PerformanceEntryList;\\n    getEntriesByName(name: string, type?: string): PerformanceEntryList;\\n    getEntriesByType(type: string): PerformanceEntryList;\\n    mark(markName: string): void;\\n    measure(measureName: string, startMark?: string, endMark?: string): void;\\n    now(): number;\\n    setResourceTimingBufferSize(maxSize: number): void;\\n    toJSON(): any;\\n    addEventListener<K extends keyof PerformanceEventMap>(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof PerformanceEventMap>(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var Performance: {\\n    prototype: Performance;\\n    new(): Performance;\\n};\\n\\n/** Encapsulates a single performance metric that is part of the performance timeline. A performance entry can be directly created by making a performance mark or measure (for example by calling the mark() method) at an explicit point in an application. Performance entries are also created in indirect ways such as loading a resource (such as an image). */\\ninterface PerformanceEntry {\\n    readonly duration: number;\\n    readonly entryType: string;\\n    readonly name: string;\\n    readonly startTime: number;\\n    toJSON(): any;\\n}\\n\\ndeclare var PerformanceEntry: {\\n    prototype: PerformanceEntry;\\n    new(): PerformanceEntry;\\n};\\n\\n/** PerformanceMark is an abstract interface for PerformanceEntry objects with an entryType of \\\"mark\\\". Entries of this type are created by calling performance.mark() to add a named DOMHighResTimeStamp (the mark) to the browser's performance timeline. */\\ninterface PerformanceMark extends PerformanceEntry {\\n}\\n\\ndeclare var PerformanceMark: {\\n    prototype: PerformanceMark;\\n    new(): PerformanceMark;\\n};\\n\\n/** PerformanceMeasure is an abstract interface for PerformanceEntry objects with an entryType of \\\"measure\\\". Entries of this type are created by calling performance.measure() to add a named DOMHighResTimeStamp (the measure) between two marks to the browser's performance timeline. */\\ninterface PerformanceMeasure extends PerformanceEntry {\\n}\\n\\ndeclare var PerformanceMeasure: {\\n    prototype: PerformanceMeasure;\\n    new(): PerformanceMeasure;\\n};\\n\\n/** The legacy PerformanceNavigation interface represents information about how the navigation to the current document was done.\\n * @deprecated This interface is deprecated in the Navigation Timing Level 2 specification. Please use the PerformanceNavigationTiming interface instead.\\n */\\ninterface PerformanceNavigation {\\n    readonly redirectCount: number;\\n    readonly type: number;\\n    toJSON(): any;\\n    readonly TYPE_BACK_FORWARD: number;\\n    readonly TYPE_NAVIGATE: number;\\n    readonly TYPE_RELOAD: number;\\n    readonly TYPE_RESERVED: number;\\n}\\n\\ndeclare var PerformanceNavigation: {\\n    prototype: PerformanceNavigation;\\n    new(): PerformanceNavigation;\\n    readonly TYPE_BACK_FORWARD: number;\\n    readonly TYPE_NAVIGATE: number;\\n    readonly TYPE_RELOAD: number;\\n    readonly TYPE_RESERVED: number;\\n};\\n\\n/** Provides methods and properties to store and retrieve metrics regarding the browser's document navigation events. For example, this interface can be used to determine how much time it takes to load or unload a document. */\\ninterface PerformanceNavigationTiming extends PerformanceResourceTiming {\\n    readonly domComplete: number;\\n    readonly domContentLoadedEventEnd: number;\\n    readonly domContentLoadedEventStart: number;\\n    readonly domInteractive: number;\\n    readonly loadEventEnd: number;\\n    readonly loadEventStart: number;\\n    readonly redirectCount: number;\\n    readonly type: NavigationType;\\n    readonly unloadEventEnd: number;\\n    readonly unloadEventStart: number;\\n    toJSON(): any;\\n}\\n\\ndeclare var PerformanceNavigationTiming: {\\n    prototype: PerformanceNavigationTiming;\\n    new(): PerformanceNavigationTiming;\\n};\\n\\ninterface PerformanceObserver {\\n    disconnect(): void;\\n    observe(options?: PerformanceObserverInit): void;\\n    takeRecords(): PerformanceEntryList;\\n}\\n\\ndeclare var PerformanceObserver: {\\n    prototype: PerformanceObserver;\\n    new(callback: PerformanceObserverCallback): PerformanceObserver;\\n    readonly supportedEntryTypes: ReadonlyArray<string>;\\n};\\n\\ninterface PerformanceObserverEntryList {\\n    getEntries(): PerformanceEntryList;\\n    getEntriesByName(name: string, type?: string): PerformanceEntryList;\\n    getEntriesByType(type: string): PerformanceEntryList;\\n}\\n\\ndeclare var PerformanceObserverEntryList: {\\n    prototype: PerformanceObserverEntryList;\\n    new(): PerformanceObserverEntryList;\\n};\\n\\n/** Enables retrieval and analysis of detailed network timing data regarding the loading of an application's resources. An application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource, such as an XMLHttpRequest, <SVG>, image, or script. */\\ninterface PerformanceResourceTiming extends PerformanceEntry {\\n    readonly connectEnd: number;\\n    readonly connectStart: number;\\n    readonly decodedBodySize: number;\\n    readonly domainLookupEnd: number;\\n    readonly domainLookupStart: number;\\n    readonly encodedBodySize: number;\\n    readonly fetchStart: number;\\n    readonly initiatorType: string;\\n    readonly nextHopProtocol: string;\\n    readonly redirectEnd: number;\\n    readonly redirectStart: number;\\n    readonly requestStart: number;\\n    readonly responseEnd: number;\\n    readonly responseStart: number;\\n    readonly secureConnectionStart: number;\\n    readonly transferSize: number;\\n    readonly workerStart: number;\\n    toJSON(): any;\\n}\\n\\ndeclare var PerformanceResourceTiming: {\\n    prototype: PerformanceResourceTiming;\\n    new(): PerformanceResourceTiming;\\n};\\n\\n/** A legacy interface kept for backwards compatibility and contains properties that offer performance timing information for various events which occur during the loading and use of the current page. You get a PerformanceTiming object describing your page using the window.performance.timing property.\\n * @deprecated This interface is deprecated in the Navigation Timing Level 2 specification. Please use the PerformanceNavigationTiming interface instead.\\n */\\ninterface PerformanceTiming {\\n    readonly connectEnd: number;\\n    readonly connectStart: number;\\n    readonly domComplete: number;\\n    readonly domContentLoadedEventEnd: number;\\n    readonly domContentLoadedEventStart: number;\\n    readonly domInteractive: number;\\n    readonly domLoading: number;\\n    readonly domainLookupEnd: number;\\n    readonly domainLookupStart: number;\\n    readonly fetchStart: number;\\n    readonly loadEventEnd: number;\\n    readonly loadEventStart: number;\\n    readonly navigationStart: number;\\n    readonly redirectEnd: number;\\n    readonly redirectStart: number;\\n    readonly requestStart: number;\\n    readonly responseEnd: number;\\n    readonly responseStart: number;\\n    readonly secureConnectionStart: number;\\n    readonly unloadEventEnd: number;\\n    readonly unloadEventStart: number;\\n    toJSON(): any;\\n}\\n\\ndeclare var PerformanceTiming: {\\n    prototype: PerformanceTiming;\\n    new(): PerformanceTiming;\\n};\\n\\n/** PeriodicWave has no inputs or outputs; it is used to define custom oscillators when calling OscillatorNode.setPeriodicWave(). The PeriodicWave itself is created/returned by AudioContext.createPeriodicWave(). */\\ninterface PeriodicWave {\\n}\\n\\ndeclare var PeriodicWave: {\\n    prototype: PeriodicWave;\\n    new(context: BaseAudioContext, options?: PeriodicWaveOptions): PeriodicWave;\\n};\\n\\ninterface PermissionRequest extends DeferredPermissionRequest {\\n    readonly state: MSWebViewPermissionState;\\n    defer(): void;\\n}\\n\\ndeclare var PermissionRequest: {\\n    prototype: PermissionRequest;\\n    new(): PermissionRequest;\\n};\\n\\ninterface PermissionRequestedEvent extends Event {\\n    readonly permissionRequest: PermissionRequest;\\n}\\n\\ndeclare var PermissionRequestedEvent: {\\n    prototype: PermissionRequestedEvent;\\n    new(): PermissionRequestedEvent;\\n};\\n\\ninterface PermissionStatusEventMap {\\n    \\\"change\\\": Event;\\n}\\n\\ninterface PermissionStatus extends EventTarget {\\n    onchange: ((this: PermissionStatus, ev: Event) => any) | null;\\n    readonly state: PermissionState;\\n    addEventListener<K extends keyof PermissionStatusEventMap>(type: K, listener: (this: PermissionStatus, ev: PermissionStatusEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof PermissionStatusEventMap>(type: K, listener: (this: PermissionStatus, ev: PermissionStatusEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var PermissionStatus: {\\n    prototype: PermissionStatus;\\n    new(): PermissionStatus;\\n};\\n\\ninterface Permissions {\\n    query(permissionDesc: PermissionDescriptor | DevicePermissionDescriptor | MidiPermissionDescriptor | PushPermissionDescriptor): Promise<PermissionStatus>;\\n}\\n\\ndeclare var Permissions: {\\n    prototype: Permissions;\\n    new(): Permissions;\\n};\\n\\n/** Provides information about a browser plugin. */\\ninterface Plugin {\\n    /**\\n     * Returns the plugin's description.\\n     */\\n    readonly description: string;\\n    /**\\n     * Returns the plugin library's filename, if applicable on the current platform.\\n     */\\n    readonly filename: string;\\n    /**\\n     * Returns the number of MIME types, represented by MimeType objects, supported by the plugin.\\n     */\\n    readonly length: number;\\n    /**\\n     * Returns the plugin's name.\\n     */\\n    readonly name: string;\\n    /**\\n     * Returns the specified MimeType object.\\n     */\\n    item(index: number): MimeType | null;\\n    namedItem(name: string): MimeType | null;\\n    [index: number]: MimeType;\\n}\\n\\ndeclare var Plugin: {\\n    prototype: Plugin;\\n    new(): Plugin;\\n};\\n\\n/** Used to store a list of Plugin objects describing the available plugins; it's returned by the window.navigator.plugins property. The PluginArray is not a JavaScript array, but has the length property and supports accessing individual items using bracket notation (plugins[2]), as well as via item(index) and namedItem(\\\"name\\\") methods. */\\ninterface PluginArray {\\n    readonly length: number;\\n    item(index: number): Plugin | null;\\n    namedItem(name: string): Plugin | null;\\n    refresh(reload?: boolean): void;\\n    [index: number]: Plugin;\\n}\\n\\ndeclare var PluginArray: {\\n    prototype: PluginArray;\\n    new(): PluginArray;\\n};\\n\\n/** The state of a DOM event produced by a pointer such as the geometry of the contact point, the device type that generated the event, the amount of pressure that was applied on the contact surface, etc. */\\ninterface PointerEvent extends MouseEvent {\\n    readonly height: number;\\n    readonly isPrimary: boolean;\\n    readonly pointerId: number;\\n    readonly pointerType: string;\\n    readonly pressure: number;\\n    readonly tangentialPressure: number;\\n    readonly tiltX: number;\\n    readonly tiltY: number;\\n    readonly twist: number;\\n    readonly width: number;\\n    getCoalescedEvents(): PointerEvent[];\\n    getPredictedEvents(): PointerEvent[];\\n}\\n\\ndeclare var PointerEvent: {\\n    prototype: PointerEvent;\\n    new(type: string, eventInitDict?: PointerEventInit): PointerEvent;\\n};\\n\\n/** PopStateEvent is an event handler for the popstate event on the window. */\\ninterface PopStateEvent extends Event {\\n    /**\\n     * Returns a copy of the information that was provided to pushState() or replaceState().\\n     */\\n    readonly state: any;\\n}\\n\\ndeclare var PopStateEvent: {\\n    prototype: PopStateEvent;\\n    new(type: string, eventInitDict?: PopStateEventInit): PopStateEvent;\\n};\\n\\n/** A processing instruction embeds application-specific instructions in XML which can be ignored by other applications that don't recognize them. */\\ninterface ProcessingInstruction extends CharacterData, LinkStyle {\\n    readonly ownerDocument: Document;\\n    readonly target: string;\\n}\\n\\ndeclare var ProcessingInstruction: {\\n    prototype: ProcessingInstruction;\\n    new(): ProcessingInstruction;\\n};\\n\\n/** Events measuring progress of an underlying process, like an HTTP request (for an XMLHttpRequest, or the loading of the underlying resource of an <img>, <audio>, <video>, <style> or <link>). */\\ninterface ProgressEvent<T extends EventTarget = EventTarget> extends Event {\\n    readonly lengthComputable: boolean;\\n    readonly loaded: number;\\n    readonly target: T | null;\\n    readonly total: number;\\n}\\n\\ndeclare var ProgressEvent: {\\n    prototype: ProgressEvent;\\n    new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent;\\n};\\n\\ninterface PromiseRejectionEvent extends Event {\\n    readonly promise: Promise<any>;\\n    readonly reason: any;\\n}\\n\\ndeclare var PromiseRejectionEvent: {\\n    prototype: PromiseRejectionEvent;\\n    new(type: string, eventInitDict: PromiseRejectionEventInit): PromiseRejectionEvent;\\n};\\n\\ninterface PublicKeyCredential extends Credential {\\n    readonly rawId: ArrayBuffer;\\n    readonly response: AuthenticatorResponse;\\n    getClientExtensionResults(): AuthenticationExtensionsClientOutputs;\\n}\\n\\ndeclare var PublicKeyCredential: {\\n    prototype: PublicKeyCredential;\\n    new(): PublicKeyCredential;\\n    isUserVerifyingPlatformAuthenticatorAvailable(): Promise<boolean>;\\n};\\n\\n/** This Push API interface provides a way to receive notifications from third-party servers as well as request URLs for push notifications. */\\ninterface PushManager {\\n    getSubscription(): Promise<PushSubscription | null>;\\n    permissionState(options?: PushSubscriptionOptionsInit): Promise<PushPermissionState>;\\n    subscribe(options?: PushSubscriptionOptionsInit): Promise<PushSubscription>;\\n}\\n\\ndeclare var PushManager: {\\n    prototype: PushManager;\\n    new(): PushManager;\\n    readonly supportedContentEncodings: ReadonlyArray<string>;\\n};\\n\\n/** This Push API interface provides a subcription's URL endpoint and allows unsubscription from a push service. */\\ninterface PushSubscription {\\n    readonly endpoint: string;\\n    readonly expirationTime: number | null;\\n    readonly options: PushSubscriptionOptions;\\n    getKey(name: PushEncryptionKeyName): ArrayBuffer | null;\\n    toJSON(): PushSubscriptionJSON;\\n    unsubscribe(): Promise<boolean>;\\n}\\n\\ndeclare var PushSubscription: {\\n    prototype: PushSubscription;\\n    new(): PushSubscription;\\n};\\n\\ninterface PushSubscriptionOptions {\\n    readonly applicationServerKey: ArrayBuffer | null;\\n    readonly userVisibleOnly: boolean;\\n}\\n\\ndeclare var PushSubscriptionOptions: {\\n    prototype: PushSubscriptionOptions;\\n    new(): PushSubscriptionOptions;\\n};\\n\\ninterface RTCCertificate {\\n    readonly expires: number;\\n    getFingerprints(): RTCDtlsFingerprint[];\\n}\\n\\ndeclare var RTCCertificate: {\\n    prototype: RTCCertificate;\\n    new(): RTCCertificate;\\n    getSupportedAlgorithms(): AlgorithmIdentifier[];\\n};\\n\\ninterface RTCDTMFSenderEventMap {\\n    \\\"tonechange\\\": RTCDTMFToneChangeEvent;\\n}\\n\\ninterface RTCDTMFSender extends EventTarget {\\n    readonly canInsertDTMF: boolean;\\n    ontonechange: ((this: RTCDTMFSender, ev: RTCDTMFToneChangeEvent) => any) | null;\\n    readonly toneBuffer: string;\\n    insertDTMF(tones: string, duration?: number, interToneGap?: number): void;\\n    addEventListener<K extends keyof RTCDTMFSenderEventMap>(type: K, listener: (this: RTCDTMFSender, ev: RTCDTMFSenderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof RTCDTMFSenderEventMap>(type: K, listener: (this: RTCDTMFSender, ev: RTCDTMFSenderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var RTCDTMFSender: {\\n    prototype: RTCDTMFSender;\\n    new(): RTCDTMFSender;\\n};\\n\\n/** Events sent to indicate that DTMF tones have started or finished playing. This interface is used by the tonechange event. */\\ninterface RTCDTMFToneChangeEvent extends Event {\\n    readonly tone: string;\\n}\\n\\ndeclare var RTCDTMFToneChangeEvent: {\\n    prototype: RTCDTMFToneChangeEvent;\\n    new(type: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent;\\n};\\n\\ninterface RTCDataChannelEventMap {\\n    \\\"bufferedamountlow\\\": Event;\\n    \\\"close\\\": Event;\\n    \\\"error\\\": RTCErrorEvent;\\n    \\\"message\\\": MessageEvent;\\n    \\\"open\\\": Event;\\n}\\n\\ninterface RTCDataChannel extends EventTarget {\\n    binaryType: string;\\n    readonly bufferedAmount: number;\\n    bufferedAmountLowThreshold: number;\\n    readonly id: number | null;\\n    readonly label: string;\\n    readonly maxPacketLifeTime: number | null;\\n    readonly maxRetransmits: number | null;\\n    readonly negotiated: boolean;\\n    onbufferedamountlow: ((this: RTCDataChannel, ev: Event) => any) | null;\\n    onclose: ((this: RTCDataChannel, ev: Event) => any) | null;\\n    onerror: ((this: RTCDataChannel, ev: RTCErrorEvent) => any) | null;\\n    onmessage: ((this: RTCDataChannel, ev: MessageEvent) => any) | null;\\n    onopen: ((this: RTCDataChannel, ev: Event) => any) | null;\\n    readonly ordered: boolean;\\n    readonly priority: RTCPriorityType;\\n    readonly protocol: string;\\n    readonly readyState: RTCDataChannelState;\\n    close(): void;\\n    send(data: string): void;\\n    send(data: Blob): void;\\n    send(data: ArrayBuffer): void;\\n    send(data: ArrayBufferView): void;\\n    addEventListener<K extends keyof RTCDataChannelEventMap>(type: K, listener: (this: RTCDataChannel, ev: RTCDataChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof RTCDataChannelEventMap>(type: K, listener: (this: RTCDataChannel, ev: RTCDataChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var RTCDataChannel: {\\n    prototype: RTCDataChannel;\\n    new(): RTCDataChannel;\\n};\\n\\ninterface RTCDataChannelEvent extends Event {\\n    readonly channel: RTCDataChannel;\\n}\\n\\ndeclare var RTCDataChannelEvent: {\\n    prototype: RTCDataChannelEvent;\\n    new(type: string, eventInitDict: RTCDataChannelEventInit): RTCDataChannelEvent;\\n};\\n\\ninterface RTCDtlsTransportEventMap {\\n    \\\"error\\\": RTCErrorEvent;\\n    \\\"statechange\\\": Event;\\n}\\n\\ninterface RTCDtlsTransport extends EventTarget {\\n    readonly iceTransport: RTCIceTransport;\\n    onerror: ((this: RTCDtlsTransport, ev: RTCErrorEvent) => any) | null;\\n    onstatechange: ((this: RTCDtlsTransport, ev: Event) => any) | null;\\n    readonly state: RTCDtlsTransportState;\\n    getRemoteCertificates(): ArrayBuffer[];\\n    addEventListener<K extends keyof RTCDtlsTransportEventMap>(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof RTCDtlsTransportEventMap>(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var RTCDtlsTransport: {\\n    prototype: RTCDtlsTransport;\\n    new(): RTCDtlsTransport;\\n};\\n\\ninterface RTCDtlsTransportStateChangedEvent extends Event {\\n    readonly state: RTCDtlsTransportState;\\n}\\n\\ndeclare var RTCDtlsTransportStateChangedEvent: {\\n    prototype: RTCDtlsTransportStateChangedEvent;\\n    new(): RTCDtlsTransportStateChangedEvent;\\n};\\n\\ninterface RTCDtmfSenderEventMap {\\n    \\\"tonechange\\\": RTCDTMFToneChangeEvent;\\n}\\n\\ninterface RTCDtmfSender extends EventTarget {\\n    readonly canInsertDTMF: boolean;\\n    readonly duration: number;\\n    readonly interToneGap: number;\\n    ontonechange: ((this: RTCDtmfSender, ev: RTCDTMFToneChangeEvent) => any) | null;\\n    readonly sender: RTCRtpSender;\\n    readonly toneBuffer: string;\\n    insertDTMF(tones: string, duration?: number, interToneGap?: number): void;\\n    addEventListener<K extends keyof RTCDtmfSenderEventMap>(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof RTCDtmfSenderEventMap>(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var RTCDtmfSender: {\\n    prototype: RTCDtmfSender;\\n    new(sender: RTCRtpSender): RTCDtmfSender;\\n};\\n\\ninterface RTCError extends DOMException {\\n    readonly errorDetail: RTCErrorDetailType;\\n    readonly httpRequestStatusCode: number | null;\\n    readonly receivedAlert: number | null;\\n    readonly sctpCauseCode: number | null;\\n    readonly sdpLineNumber: number | null;\\n    readonly sentAlert: number | null;\\n}\\n\\ndeclare var RTCError: {\\n    prototype: RTCError;\\n    new(init: RTCErrorInit, message?: string): RTCError;\\n};\\n\\ninterface RTCErrorEvent extends Event {\\n    readonly error: RTCError;\\n}\\n\\ndeclare var RTCErrorEvent: {\\n    prototype: RTCErrorEvent;\\n    new(type: string, eventInitDict: RTCErrorEventInit): RTCErrorEvent;\\n};\\n\\n/** The RTCIceCandidate interface—part of the WebRTC API—represents a candidate Internet Connectivity Establishment (ICE) configuration which may be used to establish an RTCPeerConnection. */\\ninterface RTCIceCandidate {\\n    readonly candidate: string;\\n    readonly component: RTCIceComponent | null;\\n    readonly foundation: string | null;\\n    readonly port: number | null;\\n    readonly priority: number | null;\\n    readonly protocol: RTCIceProtocol | null;\\n    readonly relatedAddress: string | null;\\n    readonly relatedPort: number | null;\\n    readonly sdpMLineIndex: number | null;\\n    readonly sdpMid: string | null;\\n    readonly tcpType: RTCIceTcpCandidateType | null;\\n    readonly type: RTCIceCandidateType | null;\\n    readonly usernameFragment: string | null;\\n    toJSON(): RTCIceCandidateInit;\\n}\\n\\ndeclare var RTCIceCandidate: {\\n    prototype: RTCIceCandidate;\\n    new(candidateInitDict?: RTCIceCandidateInit): RTCIceCandidate;\\n};\\n\\ninterface RTCIceCandidatePairChangedEvent extends Event {\\n    readonly pair: RTCIceCandidatePair;\\n}\\n\\ndeclare var RTCIceCandidatePairChangedEvent: {\\n    prototype: RTCIceCandidatePairChangedEvent;\\n    new(): RTCIceCandidatePairChangedEvent;\\n};\\n\\ninterface RTCIceGathererEventMap {\\n    \\\"error\\\": Event;\\n    \\\"localcandidate\\\": RTCIceGathererEvent;\\n}\\n\\ninterface RTCIceGatherer extends RTCStatsProvider {\\n    readonly component: RTCIceComponent;\\n    onerror: ((this: RTCIceGatherer, ev: Event) => any) | null;\\n    onlocalcandidate: ((this: RTCIceGatherer, ev: RTCIceGathererEvent) => any) | null;\\n    createAssociatedGatherer(): RTCIceGatherer;\\n    getLocalCandidates(): RTCIceCandidateDictionary[];\\n    getLocalParameters(): RTCIceParameters;\\n    addEventListener<K extends keyof RTCIceGathererEventMap>(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof RTCIceGathererEventMap>(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var RTCIceGatherer: {\\n    prototype: RTCIceGatherer;\\n    new(options: RTCIceGatherOptions): RTCIceGatherer;\\n};\\n\\ninterface RTCIceGathererEvent extends Event {\\n    readonly candidate: RTCIceCandidateDictionary | RTCIceCandidateComplete;\\n}\\n\\ndeclare var RTCIceGathererEvent: {\\n    prototype: RTCIceGathererEvent;\\n    new(): RTCIceGathererEvent;\\n};\\n\\ninterface RTCIceTransportEventMap {\\n    \\\"gatheringstatechange\\\": Event;\\n    \\\"selectedcandidatepairchange\\\": Event;\\n    \\\"statechange\\\": Event;\\n}\\n\\n/** Provides access to information about the ICE transport layer over which the data is being sent and received. */\\ninterface RTCIceTransport extends EventTarget {\\n    readonly component: RTCIceComponent;\\n    readonly gatheringState: RTCIceGathererState;\\n    ongatheringstatechange: ((this: RTCIceTransport, ev: Event) => any) | null;\\n    onselectedcandidatepairchange: ((this: RTCIceTransport, ev: Event) => any) | null;\\n    onstatechange: ((this: RTCIceTransport, ev: Event) => any) | null;\\n    readonly role: RTCIceRole;\\n    readonly state: RTCIceTransportState;\\n    getLocalCandidates(): RTCIceCandidate[];\\n    getLocalParameters(): RTCIceParameters | null;\\n    getRemoteCandidates(): RTCIceCandidate[];\\n    getRemoteParameters(): RTCIceParameters | null;\\n    getSelectedCandidatePair(): RTCIceCandidatePair | null;\\n    addEventListener<K extends keyof RTCIceTransportEventMap>(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof RTCIceTransportEventMap>(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var RTCIceTransport: {\\n    prototype: RTCIceTransport;\\n    new(): RTCIceTransport;\\n};\\n\\ninterface RTCIceTransportStateChangedEvent extends Event {\\n    readonly state: RTCIceTransportState;\\n}\\n\\ndeclare var RTCIceTransportStateChangedEvent: {\\n    prototype: RTCIceTransportStateChangedEvent;\\n    new(): RTCIceTransportStateChangedEvent;\\n};\\n\\ninterface RTCIdentityAssertion {\\n    idp: string;\\n    name: string;\\n}\\n\\ndeclare var RTCIdentityAssertion: {\\n    prototype: RTCIdentityAssertion;\\n    new(idp: string, name: string): RTCIdentityAssertion;\\n};\\n\\ninterface RTCPeerConnectionEventMap {\\n    \\\"connectionstatechange\\\": Event;\\n    \\\"datachannel\\\": RTCDataChannelEvent;\\n    \\\"icecandidate\\\": RTCPeerConnectionIceEvent;\\n    \\\"icecandidateerror\\\": RTCPeerConnectionIceErrorEvent;\\n    \\\"iceconnectionstatechange\\\": Event;\\n    \\\"icegatheringstatechange\\\": Event;\\n    \\\"negotiationneeded\\\": Event;\\n    \\\"signalingstatechange\\\": Event;\\n    \\\"statsended\\\": RTCStatsEvent;\\n    \\\"track\\\": RTCTrackEvent;\\n}\\n\\n/** A WebRTC connection between the local computer and a remote peer. It provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed. */\\ninterface RTCPeerConnection extends EventTarget {\\n    readonly canTrickleIceCandidates: boolean | null;\\n    readonly connectionState: RTCPeerConnectionState;\\n    readonly currentLocalDescription: RTCSessionDescription | null;\\n    readonly currentRemoteDescription: RTCSessionDescription | null;\\n    readonly iceConnectionState: RTCIceConnectionState;\\n    readonly iceGatheringState: RTCIceGatheringState;\\n    readonly idpErrorInfo: string | null;\\n    readonly idpLoginUrl: string | null;\\n    readonly localDescription: RTCSessionDescription | null;\\n    onconnectionstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;\\n    ondatachannel: ((this: RTCPeerConnection, ev: RTCDataChannelEvent) => any) | null;\\n    onicecandidate: ((this: RTCPeerConnection, ev: RTCPeerConnectionIceEvent) => any) | null;\\n    onicecandidateerror: ((this: RTCPeerConnection, ev: RTCPeerConnectionIceErrorEvent) => any) | null;\\n    oniceconnectionstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;\\n    onicegatheringstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;\\n    onnegotiationneeded: ((this: RTCPeerConnection, ev: Event) => any) | null;\\n    onsignalingstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;\\n    onstatsended: ((this: RTCPeerConnection, ev: RTCStatsEvent) => any) | null;\\n    ontrack: ((this: RTCPeerConnection, ev: RTCTrackEvent) => any) | null;\\n    readonly peerIdentity: Promise<RTCIdentityAssertion>;\\n    readonly pendingLocalDescription: RTCSessionDescription | null;\\n    readonly pendingRemoteDescription: RTCSessionDescription | null;\\n    readonly remoteDescription: RTCSessionDescription | null;\\n    readonly sctp: RTCSctpTransport | null;\\n    readonly signalingState: RTCSignalingState;\\n    addIceCandidate(candidate: RTCIceCandidateInit | RTCIceCandidate): Promise<void>;\\n    addTrack(track: MediaStreamTrack, ...streams: MediaStream[]): RTCRtpSender;\\n    addTransceiver(trackOrKind: MediaStreamTrack | string, init?: RTCRtpTransceiverInit): RTCRtpTransceiver;\\n    close(): void;\\n    createAnswer(options?: RTCOfferOptions): Promise<RTCSessionDescriptionInit>;\\n    createDataChannel(label: string, dataChannelDict?: RTCDataChannelInit): RTCDataChannel;\\n    createOffer(options?: RTCOfferOptions): Promise<RTCSessionDescriptionInit>;\\n    getConfiguration(): RTCConfiguration;\\n    getIdentityAssertion(): Promise<string>;\\n    getReceivers(): RTCRtpReceiver[];\\n    getSenders(): RTCRtpSender[];\\n    getStats(selector?: MediaStreamTrack | null): Promise<RTCStatsReport>;\\n    getTransceivers(): RTCRtpTransceiver[];\\n    removeTrack(sender: RTCRtpSender): void;\\n    setConfiguration(configuration: RTCConfiguration): void;\\n    setIdentityProvider(provider: string, options?: RTCIdentityProviderOptions): void;\\n    setLocalDescription(description: RTCSessionDescriptionInit): Promise<void>;\\n    setRemoteDescription(description: RTCSessionDescriptionInit): Promise<void>;\\n    addEventListener<K extends keyof RTCPeerConnectionEventMap>(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof RTCPeerConnectionEventMap>(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var RTCPeerConnection: {\\n    prototype: RTCPeerConnection;\\n    new(configuration?: RTCConfiguration): RTCPeerConnection;\\n    generateCertificate(keygenAlgorithm: AlgorithmIdentifier): Promise<RTCCertificate>;\\n    getDefaultIceServers(): RTCIceServer[];\\n};\\n\\ninterface RTCPeerConnectionIceErrorEvent extends Event {\\n    readonly errorCode: number;\\n    readonly errorText: string;\\n    readonly hostCandidate: string;\\n    readonly url: string;\\n}\\n\\ndeclare var RTCPeerConnectionIceErrorEvent: {\\n    prototype: RTCPeerConnectionIceErrorEvent;\\n    new(type: string, eventInitDict: RTCPeerConnectionIceErrorEventInit): RTCPeerConnectionIceErrorEvent;\\n};\\n\\n/** Events that occurs in relation to ICE candidates with the target, usually an RTCPeerConnection. Only one event is of this type: icecandidate. */\\ninterface RTCPeerConnectionIceEvent extends Event {\\n    readonly candidate: RTCIceCandidate | null;\\n    readonly url: string | null;\\n}\\n\\ndeclare var RTCPeerConnectionIceEvent: {\\n    prototype: RTCPeerConnectionIceEvent;\\n    new(type: string, eventInitDict?: RTCPeerConnectionIceEventInit): RTCPeerConnectionIceEvent;\\n};\\n\\n/** This WebRTC API interface manages the reception and decoding of data for a MediaStreamTrack on an RTCPeerConnection. */\\ninterface RTCRtpReceiver {\\n    readonly rtcpTransport: RTCDtlsTransport | null;\\n    readonly track: MediaStreamTrack;\\n    readonly transport: RTCDtlsTransport | null;\\n    getContributingSources(): RTCRtpContributingSource[];\\n    getParameters(): RTCRtpReceiveParameters;\\n    getStats(): Promise<RTCStatsReport>;\\n    getSynchronizationSources(): RTCRtpSynchronizationSource[];\\n}\\n\\ndeclare var RTCRtpReceiver: {\\n    prototype: RTCRtpReceiver;\\n    new(): RTCRtpReceiver;\\n    getCapabilities(kind: string): RTCRtpCapabilities | null;\\n};\\n\\n/** Provides the ability to control and obtain details about how a particular MediaStreamTrack is encoded and sent to a remote peer. */\\ninterface RTCRtpSender {\\n    readonly dtmf: RTCDTMFSender | null;\\n    readonly rtcpTransport: RTCDtlsTransport | null;\\n    readonly track: MediaStreamTrack | null;\\n    readonly transport: RTCDtlsTransport | null;\\n    getParameters(): RTCRtpSendParameters;\\n    getStats(): Promise<RTCStatsReport>;\\n    replaceTrack(withTrack: MediaStreamTrack | null): Promise<void>;\\n    setParameters(parameters: RTCRtpSendParameters): Promise<void>;\\n    setStreams(...streams: MediaStream[]): void;\\n}\\n\\ndeclare var RTCRtpSender: {\\n    prototype: RTCRtpSender;\\n    new(): RTCRtpSender;\\n    getCapabilities(kind: string): RTCRtpCapabilities | null;\\n};\\n\\ninterface RTCRtpTransceiver {\\n    readonly currentDirection: RTCRtpTransceiverDirection | null;\\n    direction: RTCRtpTransceiverDirection;\\n    readonly mid: string | null;\\n    readonly receiver: RTCRtpReceiver;\\n    readonly sender: RTCRtpSender;\\n    setCodecPreferences(codecs: RTCRtpCodecCapability[]): void;\\n    stop(): void;\\n}\\n\\ndeclare var RTCRtpTransceiver: {\\n    prototype: RTCRtpTransceiver;\\n    new(): RTCRtpTransceiver;\\n};\\n\\ninterface RTCSctpTransportEventMap {\\n    \\\"statechange\\\": Event;\\n}\\n\\ninterface RTCSctpTransport extends EventTarget {\\n    readonly maxChannels: number | null;\\n    readonly maxMessageSize: number;\\n    onstatechange: ((this: RTCSctpTransport, ev: Event) => any) | null;\\n    readonly state: RTCSctpTransportState;\\n    readonly transport: RTCDtlsTransport;\\n    addEventListener<K extends keyof RTCSctpTransportEventMap>(type: K, listener: (this: RTCSctpTransport, ev: RTCSctpTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof RTCSctpTransportEventMap>(type: K, listener: (this: RTCSctpTransport, ev: RTCSctpTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var RTCSctpTransport: {\\n    prototype: RTCSctpTransport;\\n    new(): RTCSctpTransport;\\n};\\n\\n/** One end of a connection—or potential connection—and how it's configured. Each RTCSessionDescription consists of a description type indicating which part of the offer/answer negotiation process it describes and of the SDP descriptor of the session. */\\ninterface RTCSessionDescription {\\n    readonly sdp: string;\\n    readonly type: RTCSdpType;\\n    toJSON(): any;\\n}\\n\\ndeclare var RTCSessionDescription: {\\n    prototype: RTCSessionDescription;\\n    new(descriptionInitDict?: RTCSessionDescriptionInit): RTCSessionDescription;\\n};\\n\\ninterface RTCSrtpSdesTransportEventMap {\\n    \\\"error\\\": Event;\\n}\\n\\ninterface RTCSrtpSdesTransport extends EventTarget {\\n    onerror: ((this: RTCSrtpSdesTransport, ev: Event) => any) | null;\\n    readonly transport: RTCIceTransport;\\n    addEventListener<K extends keyof RTCSrtpSdesTransportEventMap>(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof RTCSrtpSdesTransportEventMap>(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var RTCSrtpSdesTransport: {\\n    prototype: RTCSrtpSdesTransport;\\n    new(transport: RTCIceTransport, encryptParameters: RTCSrtpSdesParameters, decryptParameters: RTCSrtpSdesParameters): RTCSrtpSdesTransport;\\n    getLocalParameters(): RTCSrtpSdesParameters[];\\n};\\n\\ninterface RTCSsrcConflictEvent extends Event {\\n    readonly ssrc: number;\\n}\\n\\ndeclare var RTCSsrcConflictEvent: {\\n    prototype: RTCSsrcConflictEvent;\\n    new(): RTCSsrcConflictEvent;\\n};\\n\\ninterface RTCStatsEvent extends Event {\\n    readonly report: RTCStatsReport;\\n}\\n\\ndeclare var RTCStatsEvent: {\\n    prototype: RTCStatsEvent;\\n    new(type: string, eventInitDict: RTCStatsEventInit): RTCStatsEvent;\\n};\\n\\ninterface RTCStatsProvider extends EventTarget {\\n    getStats(): Promise<RTCStatsReport>;\\n    msGetStats(): Promise<RTCStatsReport>;\\n}\\n\\ndeclare var RTCStatsProvider: {\\n    prototype: RTCStatsProvider;\\n    new(): RTCStatsProvider;\\n};\\n\\ninterface RTCStatsReport {\\n    forEach(callbackfn: (value: any, key: string, parent: RTCStatsReport) => void, thisArg?: any): void;\\n}\\n\\ndeclare var RTCStatsReport: {\\n    prototype: RTCStatsReport;\\n    new(): RTCStatsReport;\\n};\\n\\ninterface RTCTrackEvent extends Event {\\n    readonly receiver: RTCRtpReceiver;\\n    readonly streams: ReadonlyArray<MediaStream>;\\n    readonly track: MediaStreamTrack;\\n    readonly transceiver: RTCRtpTransceiver;\\n}\\n\\ndeclare var RTCTrackEvent: {\\n    prototype: RTCTrackEvent;\\n    new(type: string, eventInitDict: RTCTrackEventInit): RTCTrackEvent;\\n};\\n\\ninterface RadioNodeList extends NodeList {\\n    value: string;\\n}\\n\\ndeclare var RadioNodeList: {\\n    prototype: RadioNodeList;\\n    new(): RadioNodeList;\\n};\\n\\ninterface RandomSource {\\n    getRandomValues<T extends Int8Array | Uint8ClampedArray | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array>(array: T): T;\\n}\\n\\ndeclare var RandomSource: {\\n    prototype: RandomSource;\\n    new(): RandomSource;\\n};\\n\\n/** A fragment of a document that can contain nodes and parts of text nodes. */\\ninterface Range extends AbstractRange {\\n    /**\\n     * Returns the node, furthest away from the document, that is an ancestor of both range's start node and end node.\\n     */\\n    readonly commonAncestorContainer: Node;\\n    cloneContents(): DocumentFragment;\\n    cloneRange(): Range;\\n    collapse(toStart?: boolean): void;\\n    compareBoundaryPoints(how: number, sourceRange: Range): number;\\n    /**\\n     * Returns −1 if the point is before the range, 0 if the point is in the range, and 1 if the point is after the range.\\n     */\\n    comparePoint(node: Node, offset: number): number;\\n    createContextualFragment(fragment: string): DocumentFragment;\\n    deleteContents(): void;\\n    detach(): void;\\n    extractContents(): DocumentFragment;\\n    getBoundingClientRect(): DOMRect;\\n    getClientRects(): DOMRectList;\\n    insertNode(node: Node): void;\\n    /**\\n     * Returns whether range intersects node.\\n     */\\n    intersectsNode(node: Node): boolean;\\n    isPointInRange(node: Node, offset: number): boolean;\\n    selectNode(node: Node): void;\\n    selectNodeContents(node: Node): void;\\n    setEnd(node: Node, offset: number): void;\\n    setEndAfter(node: Node): void;\\n    setEndBefore(node: Node): void;\\n    setStart(node: Node, offset: number): void;\\n    setStartAfter(node: Node): void;\\n    setStartBefore(node: Node): void;\\n    surroundContents(newParent: Node): void;\\n    toString(): string;\\n    readonly END_TO_END: number;\\n    readonly END_TO_START: number;\\n    readonly START_TO_END: number;\\n    readonly START_TO_START: number;\\n}\\n\\ndeclare var Range: {\\n    prototype: Range;\\n    new(): Range;\\n    readonly END_TO_END: number;\\n    readonly END_TO_START: number;\\n    readonly START_TO_END: number;\\n    readonly START_TO_START: number;\\n    toString(): string;\\n};\\n\\n/** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */\\ninterface ReadableStream<R = any> {\\n    readonly locked: boolean;\\n    cancel(reason?: any): Promise<void>;\\n    getReader(): ReadableStreamDefaultReader<R>;\\n    pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;\\n    pipeTo(dest: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;\\n    tee(): [ReadableStream<R>, ReadableStream<R>];\\n}\\n\\ndeclare var ReadableStream: {\\n    prototype: ReadableStream;\\n    new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;\\n};\\n\\ninterface ReadableStreamDefaultController<R = any> {\\n    readonly desiredSize: number | null;\\n    close(): void;\\n    enqueue(chunk: R): void;\\n    error(e?: any): void;\\n}\\n\\ndeclare var ReadableStreamDefaultController: {\\n    prototype: ReadableStreamDefaultController;\\n    new(): ReadableStreamDefaultController;\\n};\\n\\ninterface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {\\n    read(): Promise<ReadableStreamDefaultReadResult<R>>;\\n    releaseLock(): void;\\n}\\n\\ndeclare var ReadableStreamDefaultReader: {\\n    prototype: ReadableStreamDefaultReader;\\n    new<R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;\\n};\\n\\ninterface ReadableStreamGenericReader {\\n    readonly closed: Promise<undefined>;\\n    cancel(reason?: any): Promise<void>;\\n}\\n\\n/** This Fetch API interface represents a resource request. */\\ninterface Request extends Body {\\n    /**\\n     * Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.\\n     */\\n    readonly cache: RequestCache;\\n    /**\\n     * Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL.\\n     */\\n    readonly credentials: RequestCredentials;\\n    /**\\n     * Returns the kind of resource requested by request, e.g., \\\"document\\\" or \\\"script\\\".\\n     */\\n    readonly destination: RequestDestination;\\n    /**\\n     * Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the \\\"Host\\\" header.\\n     */\\n    readonly headers: Headers;\\n    /**\\n     * Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]\\n     */\\n    readonly integrity: string;\\n    /**\\n     * Returns a boolean indicating whether or not request is for a history navigation (a.k.a. back-foward navigation).\\n     */\\n    readonly isHistoryNavigation: boolean;\\n    /**\\n     * Returns a boolean indicating whether or not request is for a reload navigation.\\n     */\\n    readonly isReloadNavigation: boolean;\\n    /**\\n     * Returns a boolean indicating whether or not request can outlive the global in which it was created.\\n     */\\n    readonly keepalive: boolean;\\n    /**\\n     * Returns request's HTTP method, which is \\\"GET\\\" by default.\\n     */\\n    readonly method: string;\\n    /**\\n     * Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs.\\n     */\\n    readonly mode: RequestMode;\\n    /**\\n     * Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.\\n     */\\n    readonly redirect: RequestRedirect;\\n    /**\\n     * Returns the referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and \\\"about:client\\\" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made.\\n     */\\n    readonly referrer: string;\\n    /**\\n     * Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer.\\n     */\\n    readonly referrerPolicy: ReferrerPolicy;\\n    /**\\n     * Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.\\n     */\\n    readonly signal: AbortSignal;\\n    /**\\n     * Returns the URL of request as a string.\\n     */\\n    readonly url: string;\\n    clone(): Request;\\n}\\n\\ndeclare var Request: {\\n    prototype: Request;\\n    new(input: RequestInfo, init?: RequestInit): Request;\\n};\\n\\ninterface ResizeObserver {\\n    disconnect(): void;\\n    observe(target: Element, options?: ResizeObserverOptions): void;\\n    unobserve(target: Element): void;\\n}\\n\\ndeclare var ResizeObserver: {\\n    prototype: ResizeObserver;\\n    new(callback: ResizeObserverCallback): ResizeObserver;\\n};\\n\\ninterface ResizeObserverEntry {\\n    readonly borderBoxSize: ReadonlyArray<ResizeObserverSize>;\\n    readonly contentBoxSize: ReadonlyArray<ResizeObserverSize>;\\n    readonly contentRect: DOMRectReadOnly;\\n    readonly target: Element;\\n}\\n\\ndeclare var ResizeObserverEntry: {\\n    prototype: ResizeObserverEntry;\\n    new(): ResizeObserverEntry;\\n};\\n\\ninterface ResizeObserverSize {\\n    readonly blockSize: number;\\n    readonly inlineSize: number;\\n}\\n\\ndeclare var ResizeObserverSize: {\\n    prototype: ResizeObserverSize;\\n    new(): ResizeObserverSize;\\n};\\n\\n/** This Fetch API interface represents the response to a request. */\\ninterface Response extends Body {\\n    readonly headers: Headers;\\n    readonly ok: boolean;\\n    readonly redirected: boolean;\\n    readonly status: number;\\n    readonly statusText: string;\\n    readonly trailer: Promise<Headers>;\\n    readonly type: ResponseType;\\n    readonly url: string;\\n    clone(): Response;\\n}\\n\\ndeclare var Response: {\\n    prototype: Response;\\n    new(body?: BodyInit | null, init?: ResponseInit): Response;\\n    error(): Response;\\n    redirect(url: string, status?: number): Response;\\n};\\n\\n/** Provides access to the properties of <a> element, as well as methods to manipulate them. */\\ninterface SVGAElement extends SVGGraphicsElement, SVGURIReference {\\n    readonly target: SVGAnimatedString;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGAElement: {\\n    prototype: SVGAElement;\\n    new(): SVGAElement;\\n};\\n\\n/** Used to represent a value that can be an <angle> or <number> value. An SVGAngle reflected through the animVal attribute is always read only. */\\ninterface SVGAngle {\\n    readonly unitType: number;\\n    value: number;\\n    valueAsString: string;\\n    valueInSpecifiedUnits: number;\\n    convertToSpecifiedUnits(unitType: number): void;\\n    newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void;\\n    readonly SVG_ANGLETYPE_DEG: number;\\n    readonly SVG_ANGLETYPE_GRAD: number;\\n    readonly SVG_ANGLETYPE_RAD: number;\\n    readonly SVG_ANGLETYPE_UNKNOWN: number;\\n    readonly SVG_ANGLETYPE_UNSPECIFIED: number;\\n}\\n\\ndeclare var SVGAngle: {\\n    prototype: SVGAngle;\\n    new(): SVGAngle;\\n    readonly SVG_ANGLETYPE_DEG: number;\\n    readonly SVG_ANGLETYPE_GRAD: number;\\n    readonly SVG_ANGLETYPE_RAD: number;\\n    readonly SVG_ANGLETYPE_UNKNOWN: number;\\n    readonly SVG_ANGLETYPE_UNSPECIFIED: number;\\n};\\n\\ninterface SVGAnimateElement extends SVGAnimationElement {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGAnimateElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGAnimateElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGAnimateElement: {\\n    prototype: SVGAnimateElement;\\n    new(): SVGAnimateElement;\\n};\\n\\ninterface SVGAnimateMotionElement extends SVGAnimationElement {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGAnimateMotionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGAnimateMotionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGAnimateMotionElement: {\\n    prototype: SVGAnimateMotionElement;\\n    new(): SVGAnimateMotionElement;\\n};\\n\\ninterface SVGAnimateTransformElement extends SVGAnimationElement {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGAnimateTransformElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGAnimateTransformElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGAnimateTransformElement: {\\n    prototype: SVGAnimateTransformElement;\\n    new(): SVGAnimateTransformElement;\\n};\\n\\n/** Used for attributes of basic type <angle> which can be animated. */\\ninterface SVGAnimatedAngle {\\n    readonly animVal: SVGAngle;\\n    readonly baseVal: SVGAngle;\\n}\\n\\ndeclare var SVGAnimatedAngle: {\\n    prototype: SVGAnimatedAngle;\\n    new(): SVGAnimatedAngle;\\n};\\n\\n/** Used for attributes of type boolean which can be animated. */\\ninterface SVGAnimatedBoolean {\\n    readonly animVal: boolean;\\n    baseVal: boolean;\\n}\\n\\ndeclare var SVGAnimatedBoolean: {\\n    prototype: SVGAnimatedBoolean;\\n    new(): SVGAnimatedBoolean;\\n};\\n\\n/** Used for attributes whose value must be a constant from a particular enumeration and which can be animated. */\\ninterface SVGAnimatedEnumeration {\\n    readonly animVal: number;\\n    baseVal: number;\\n}\\n\\ndeclare var SVGAnimatedEnumeration: {\\n    prototype: SVGAnimatedEnumeration;\\n    new(): SVGAnimatedEnumeration;\\n};\\n\\n/** Used for attributes of basic type <integer> which can be animated. */\\ninterface SVGAnimatedInteger {\\n    readonly animVal: number;\\n    baseVal: number;\\n}\\n\\ndeclare var SVGAnimatedInteger: {\\n    prototype: SVGAnimatedInteger;\\n    new(): SVGAnimatedInteger;\\n};\\n\\n/** Used for attributes of basic type <length> which can be animated. */\\ninterface SVGAnimatedLength {\\n    readonly animVal: SVGLength;\\n    readonly baseVal: SVGLength;\\n}\\n\\ndeclare var SVGAnimatedLength: {\\n    prototype: SVGAnimatedLength;\\n    new(): SVGAnimatedLength;\\n};\\n\\n/** Used for attributes of type SVGLengthList which can be animated. */\\ninterface SVGAnimatedLengthList {\\n    readonly animVal: SVGLengthList;\\n    readonly baseVal: SVGLengthList;\\n}\\n\\ndeclare var SVGAnimatedLengthList: {\\n    prototype: SVGAnimatedLengthList;\\n    new(): SVGAnimatedLengthList;\\n};\\n\\n/** Used for attributes of basic type <Number> which can be animated. */\\ninterface SVGAnimatedNumber {\\n    readonly animVal: number;\\n    baseVal: number;\\n}\\n\\ndeclare var SVGAnimatedNumber: {\\n    prototype: SVGAnimatedNumber;\\n    new(): SVGAnimatedNumber;\\n};\\n\\n/** The SVGAnimatedNumber interface is used for attributes which take a list of numbers and which can be animated. */\\ninterface SVGAnimatedNumberList {\\n    readonly animVal: SVGNumberList;\\n    readonly baseVal: SVGNumberList;\\n}\\n\\ndeclare var SVGAnimatedNumberList: {\\n    prototype: SVGAnimatedNumberList;\\n    new(): SVGAnimatedNumberList;\\n};\\n\\ninterface SVGAnimatedPoints {\\n    readonly animatedPoints: SVGPointList;\\n    readonly points: SVGPointList;\\n}\\n\\n/** Used for attributes of type SVGPreserveAspectRatio which can be animated. */\\ninterface SVGAnimatedPreserveAspectRatio {\\n    readonly animVal: SVGPreserveAspectRatio;\\n    readonly baseVal: SVGPreserveAspectRatio;\\n}\\n\\ndeclare var SVGAnimatedPreserveAspectRatio: {\\n    prototype: SVGAnimatedPreserveAspectRatio;\\n    new(): SVGAnimatedPreserveAspectRatio;\\n};\\n\\n/** Used for attributes of basic SVGRect which can be animated. */\\ninterface SVGAnimatedRect {\\n    readonly animVal: DOMRectReadOnly;\\n    readonly baseVal: DOMRect;\\n}\\n\\ndeclare var SVGAnimatedRect: {\\n    prototype: SVGAnimatedRect;\\n    new(): SVGAnimatedRect;\\n};\\n\\n/** The SVGAnimatedString interface represents string attributes which can be animated from each SVG declaration. You need to create SVG attribute before doing anything else, everything should be declared inside this. */\\ninterface SVGAnimatedString {\\n    readonly animVal: string;\\n    baseVal: string;\\n}\\n\\ndeclare var SVGAnimatedString: {\\n    prototype: SVGAnimatedString;\\n    new(): SVGAnimatedString;\\n};\\n\\n/** Used for attributes which take a list of numbers and which can be animated. */\\ninterface SVGAnimatedTransformList {\\n    readonly animVal: SVGTransformList;\\n    readonly baseVal: SVGTransformList;\\n}\\n\\ndeclare var SVGAnimatedTransformList: {\\n    prototype: SVGAnimatedTransformList;\\n    new(): SVGAnimatedTransformList;\\n};\\n\\ninterface SVGAnimationElement extends SVGElement {\\n    readonly targetElement: SVGElement;\\n    getCurrentTime(): number;\\n    getSimpleDuration(): number;\\n    getStartTime(): number;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGAnimationElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGAnimationElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGAnimationElement: {\\n    prototype: SVGAnimationElement;\\n    new(): SVGAnimationElement;\\n};\\n\\n/** An interface for the <circle> element. The circle element is defined by the cx and cy attributes that denote the coordinates of the centre of the circle. */\\ninterface SVGCircleElement extends SVGGeometryElement {\\n    readonly cx: SVGAnimatedLength;\\n    readonly cy: SVGAnimatedLength;\\n    readonly r: SVGAnimatedLength;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGCircleElement: {\\n    prototype: SVGCircleElement;\\n    new(): SVGCircleElement;\\n};\\n\\n/** Provides access to the properties of <clipPath> elements, as well as methods to manipulate them. */\\ninterface SVGClipPathElement extends SVGElement {\\n    readonly clipPathUnits: SVGAnimatedEnumeration;\\n    readonly transform: SVGAnimatedTransformList;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGClipPathElement: {\\n    prototype: SVGClipPathElement;\\n    new(): SVGClipPathElement;\\n};\\n\\n/** A base interface used by the component transfer function interfaces. */\\ninterface SVGComponentTransferFunctionElement extends SVGElement {\\n    readonly amplitude: SVGAnimatedNumber;\\n    readonly exponent: SVGAnimatedNumber;\\n    readonly intercept: SVGAnimatedNumber;\\n    readonly offset: SVGAnimatedNumber;\\n    readonly slope: SVGAnimatedNumber;\\n    readonly tableValues: SVGAnimatedNumberList;\\n    readonly type: SVGAnimatedEnumeration;\\n    readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number;\\n    readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number;\\n    readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number;\\n    readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number;\\n    readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number;\\n    readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGComponentTransferFunctionElement: {\\n    prototype: SVGComponentTransferFunctionElement;\\n    new(): SVGComponentTransferFunctionElement;\\n    readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number;\\n    readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number;\\n    readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number;\\n    readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number;\\n    readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number;\\n    readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;\\n};\\n\\ninterface SVGCursorElement extends SVGElement {\\n    readonly x: SVGAnimatedLength;\\n    readonly y: SVGAnimatedLength;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGCursorElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGCursorElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGCursorElement: {\\n    prototype: SVGCursorElement;\\n    new(): SVGCursorElement;\\n};\\n\\n/** Corresponds to the <defs> element. */\\ninterface SVGDefsElement extends SVGGraphicsElement {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGDefsElement: {\\n    prototype: SVGDefsElement;\\n    new(): SVGDefsElement;\\n};\\n\\n/** Corresponds to the <desc> element. */\\ninterface SVGDescElement extends SVGElement {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGDescElement: {\\n    prototype: SVGDescElement;\\n    new(): SVGDescElement;\\n};\\n\\ninterface SVGElementEventMap extends ElementEventMap, GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap {\\n}\\n\\n/** All of the SVG DOM interfaces that correspond directly to elements in the SVG language derive from the SVGElement interface. */\\ninterface SVGElement extends Element, DocumentAndElementEventHandlers, DocumentAndElementEventHandlers, ElementCSSInlineStyle, GlobalEventHandlers, GlobalEventHandlers, HTMLOrSVGElement, SVGElementInstance {\\n    /** @deprecated */\\n    readonly className: any;\\n    readonly ownerSVGElement: SVGSVGElement | null;\\n    readonly viewportElement: SVGElement | null;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGElement: {\\n    prototype: SVGElement;\\n    new(): SVGElement;\\n};\\n\\ninterface SVGElementInstance extends EventTarget {\\n    readonly correspondingElement: SVGElement;\\n    readonly correspondingUseElement: SVGUseElement;\\n}\\n\\ndeclare var SVGElementInstance: {\\n    prototype: SVGElementInstance;\\n    new(): SVGElementInstance;\\n};\\n\\ninterface SVGElementInstanceList {\\n    /** @deprecated */\\n    readonly length: number;\\n    /** @deprecated */\\n    item(index: number): SVGElementInstance;\\n}\\n\\ndeclare var SVGElementInstanceList: {\\n    prototype: SVGElementInstanceList;\\n    new(): SVGElementInstanceList;\\n};\\n\\n/** Provides access to the properties of <ellipse> elements. */\\ninterface SVGEllipseElement extends SVGGeometryElement {\\n    readonly cx: SVGAnimatedLength;\\n    readonly cy: SVGAnimatedLength;\\n    readonly rx: SVGAnimatedLength;\\n    readonly ry: SVGAnimatedLength;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGEllipseElement: {\\n    prototype: SVGEllipseElement;\\n    new(): SVGEllipseElement;\\n};\\n\\n/** Corresponds to the <feBlend> element. */\\ninterface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\\n    readonly in1: SVGAnimatedString;\\n    readonly in2: SVGAnimatedString;\\n    readonly mode: SVGAnimatedEnumeration;\\n    readonly SVG_FEBLEND_MODE_COLOR: number;\\n    readonly SVG_FEBLEND_MODE_COLOR_BURN: number;\\n    readonly SVG_FEBLEND_MODE_COLOR_DODGE: number;\\n    readonly SVG_FEBLEND_MODE_DARKEN: number;\\n    readonly SVG_FEBLEND_MODE_DIFFERENCE: number;\\n    readonly SVG_FEBLEND_MODE_EXCLUSION: number;\\n    readonly SVG_FEBLEND_MODE_HARD_LIGHT: number;\\n    readonly SVG_FEBLEND_MODE_HUE: number;\\n    readonly SVG_FEBLEND_MODE_LIGHTEN: number;\\n    readonly SVG_FEBLEND_MODE_LUMINOSITY: number;\\n    readonly SVG_FEBLEND_MODE_MULTIPLY: number;\\n    readonly SVG_FEBLEND_MODE_NORMAL: number;\\n    readonly SVG_FEBLEND_MODE_OVERLAY: number;\\n    readonly SVG_FEBLEND_MODE_SATURATION: number;\\n    readonly SVG_FEBLEND_MODE_SCREEN: number;\\n    readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number;\\n    readonly SVG_FEBLEND_MODE_UNKNOWN: number;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEBlendElement: {\\n    prototype: SVGFEBlendElement;\\n    new(): SVGFEBlendElement;\\n    readonly SVG_FEBLEND_MODE_COLOR: number;\\n    readonly SVG_FEBLEND_MODE_COLOR_BURN: number;\\n    readonly SVG_FEBLEND_MODE_COLOR_DODGE: number;\\n    readonly SVG_FEBLEND_MODE_DARKEN: number;\\n    readonly SVG_FEBLEND_MODE_DIFFERENCE: number;\\n    readonly SVG_FEBLEND_MODE_EXCLUSION: number;\\n    readonly SVG_FEBLEND_MODE_HARD_LIGHT: number;\\n    readonly SVG_FEBLEND_MODE_HUE: number;\\n    readonly SVG_FEBLEND_MODE_LIGHTEN: number;\\n    readonly SVG_FEBLEND_MODE_LUMINOSITY: number;\\n    readonly SVG_FEBLEND_MODE_MULTIPLY: number;\\n    readonly SVG_FEBLEND_MODE_NORMAL: number;\\n    readonly SVG_FEBLEND_MODE_OVERLAY: number;\\n    readonly SVG_FEBLEND_MODE_SATURATION: number;\\n    readonly SVG_FEBLEND_MODE_SCREEN: number;\\n    readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number;\\n    readonly SVG_FEBLEND_MODE_UNKNOWN: number;\\n};\\n\\n/** Corresponds to the <feColorMatrix> element. */\\ninterface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\\n    readonly in1: SVGAnimatedString;\\n    readonly type: SVGAnimatedEnumeration;\\n    readonly values: SVGAnimatedNumberList;\\n    readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number;\\n    readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number;\\n    readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number;\\n    readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number;\\n    readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEColorMatrixElement: {\\n    prototype: SVGFEColorMatrixElement;\\n    new(): SVGFEColorMatrixElement;\\n    readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number;\\n    readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number;\\n    readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number;\\n    readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number;\\n    readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;\\n};\\n\\n/** Corresponds to the <feComponentTransfer> element. */\\ninterface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\\n    readonly in1: SVGAnimatedString;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEComponentTransferElement: {\\n    prototype: SVGFEComponentTransferElement;\\n    new(): SVGFEComponentTransferElement;\\n};\\n\\n/** Corresponds to the <feComposite> element. */\\ninterface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\\n    readonly in1: SVGAnimatedString;\\n    readonly in2: SVGAnimatedString;\\n    readonly k1: SVGAnimatedNumber;\\n    readonly k2: SVGAnimatedNumber;\\n    readonly k3: SVGAnimatedNumber;\\n    readonly k4: SVGAnimatedNumber;\\n    readonly operator: SVGAnimatedEnumeration;\\n    readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number;\\n    readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number;\\n    readonly SVG_FECOMPOSITE_OPERATOR_IN: number;\\n    readonly SVG_FECOMPOSITE_OPERATOR_OUT: number;\\n    readonly SVG_FECOMPOSITE_OPERATOR_OVER: number;\\n    readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number;\\n    readonly SVG_FECOMPOSITE_OPERATOR_XOR: number;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFECompositeElement: {\\n    prototype: SVGFECompositeElement;\\n    new(): SVGFECompositeElement;\\n    readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number;\\n    readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number;\\n    readonly SVG_FECOMPOSITE_OPERATOR_IN: number;\\n    readonly SVG_FECOMPOSITE_OPERATOR_OUT: number;\\n    readonly SVG_FECOMPOSITE_OPERATOR_OVER: number;\\n    readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number;\\n    readonly SVG_FECOMPOSITE_OPERATOR_XOR: number;\\n};\\n\\n/** Corresponds to the <feConvolveMatrix> element. */\\ninterface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\\n    readonly bias: SVGAnimatedNumber;\\n    readonly divisor: SVGAnimatedNumber;\\n    readonly edgeMode: SVGAnimatedEnumeration;\\n    readonly in1: SVGAnimatedString;\\n    readonly kernelMatrix: SVGAnimatedNumberList;\\n    readonly kernelUnitLengthX: SVGAnimatedNumber;\\n    readonly kernelUnitLengthY: SVGAnimatedNumber;\\n    readonly orderX: SVGAnimatedInteger;\\n    readonly orderY: SVGAnimatedInteger;\\n    readonly preserveAlpha: SVGAnimatedBoolean;\\n    readonly targetX: SVGAnimatedInteger;\\n    readonly targetY: SVGAnimatedInteger;\\n    readonly SVG_EDGEMODE_DUPLICATE: number;\\n    readonly SVG_EDGEMODE_NONE: number;\\n    readonly SVG_EDGEMODE_UNKNOWN: number;\\n    readonly SVG_EDGEMODE_WRAP: number;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEConvolveMatrixElement: {\\n    prototype: SVGFEConvolveMatrixElement;\\n    new(): SVGFEConvolveMatrixElement;\\n    readonly SVG_EDGEMODE_DUPLICATE: number;\\n    readonly SVG_EDGEMODE_NONE: number;\\n    readonly SVG_EDGEMODE_UNKNOWN: number;\\n    readonly SVG_EDGEMODE_WRAP: number;\\n};\\n\\n/** Corresponds to the <feDiffuseLighting> element. */\\ninterface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\\n    readonly diffuseConstant: SVGAnimatedNumber;\\n    readonly in1: SVGAnimatedString;\\n    readonly kernelUnitLengthX: SVGAnimatedNumber;\\n    readonly kernelUnitLengthY: SVGAnimatedNumber;\\n    readonly surfaceScale: SVGAnimatedNumber;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEDiffuseLightingElement: {\\n    prototype: SVGFEDiffuseLightingElement;\\n    new(): SVGFEDiffuseLightingElement;\\n};\\n\\n/** Corresponds to the <feDisplacementMap> element. */\\ninterface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\\n    readonly in1: SVGAnimatedString;\\n    readonly in2: SVGAnimatedString;\\n    readonly scale: SVGAnimatedNumber;\\n    readonly xChannelSelector: SVGAnimatedEnumeration;\\n    readonly yChannelSelector: SVGAnimatedEnumeration;\\n    readonly SVG_CHANNEL_A: number;\\n    readonly SVG_CHANNEL_B: number;\\n    readonly SVG_CHANNEL_G: number;\\n    readonly SVG_CHANNEL_R: number;\\n    readonly SVG_CHANNEL_UNKNOWN: number;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEDisplacementMapElement: {\\n    prototype: SVGFEDisplacementMapElement;\\n    new(): SVGFEDisplacementMapElement;\\n    readonly SVG_CHANNEL_A: number;\\n    readonly SVG_CHANNEL_B: number;\\n    readonly SVG_CHANNEL_G: number;\\n    readonly SVG_CHANNEL_R: number;\\n    readonly SVG_CHANNEL_UNKNOWN: number;\\n};\\n\\n/** Corresponds to the <feDistantLight> element. */\\ninterface SVGFEDistantLightElement extends SVGElement {\\n    readonly azimuth: SVGAnimatedNumber;\\n    readonly elevation: SVGAnimatedNumber;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEDistantLightElement: {\\n    prototype: SVGFEDistantLightElement;\\n    new(): SVGFEDistantLightElement;\\n};\\n\\ninterface SVGFEDropShadowElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\\n    readonly dx: SVGAnimatedNumber;\\n    readonly dy: SVGAnimatedNumber;\\n    readonly in1: SVGAnimatedString;\\n    readonly stdDeviationX: SVGAnimatedNumber;\\n    readonly stdDeviationY: SVGAnimatedNumber;\\n    setStdDeviation(stdDeviationX: number, stdDeviationY: number): void;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEDropShadowElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEDropShadowElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEDropShadowElement: {\\n    prototype: SVGFEDropShadowElement;\\n    new(): SVGFEDropShadowElement;\\n};\\n\\n/** Corresponds to the <feFlood> element. */\\ninterface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEFloodElement: {\\n    prototype: SVGFEFloodElement;\\n    new(): SVGFEFloodElement;\\n};\\n\\n/** Corresponds to the <feFuncA> element. */\\ninterface SVGFEFuncAElement extends SVGComponentTransferFunctionElement {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEFuncAElement: {\\n    prototype: SVGFEFuncAElement;\\n    new(): SVGFEFuncAElement;\\n};\\n\\n/** Corresponds to the <feFuncB> element. */\\ninterface SVGFEFuncBElement extends SVGComponentTransferFunctionElement {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEFuncBElement: {\\n    prototype: SVGFEFuncBElement;\\n    new(): SVGFEFuncBElement;\\n};\\n\\n/** Corresponds to the <feFuncG> element. */\\ninterface SVGFEFuncGElement extends SVGComponentTransferFunctionElement {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEFuncGElement: {\\n    prototype: SVGFEFuncGElement;\\n    new(): SVGFEFuncGElement;\\n};\\n\\n/** Corresponds to the <feFuncR> element. */\\ninterface SVGFEFuncRElement extends SVGComponentTransferFunctionElement {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEFuncRElement: {\\n    prototype: SVGFEFuncRElement;\\n    new(): SVGFEFuncRElement;\\n};\\n\\n/** Corresponds to the <feGaussianBlur> element. */\\ninterface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\\n    readonly in1: SVGAnimatedString;\\n    readonly stdDeviationX: SVGAnimatedNumber;\\n    readonly stdDeviationY: SVGAnimatedNumber;\\n    setStdDeviation(stdDeviationX: number, stdDeviationY: number): void;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEGaussianBlurElement: {\\n    prototype: SVGFEGaussianBlurElement;\\n    new(): SVGFEGaussianBlurElement;\\n};\\n\\n/** Corresponds to the <feImage> element. */\\ninterface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference {\\n    readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEImageElement: {\\n    prototype: SVGFEImageElement;\\n    new(): SVGFEImageElement;\\n};\\n\\n/** Corresponds to the <feMerge> element. */\\ninterface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEMergeElement: {\\n    prototype: SVGFEMergeElement;\\n    new(): SVGFEMergeElement;\\n};\\n\\n/** Corresponds to the <feMergeNode> element. */\\ninterface SVGFEMergeNodeElement extends SVGElement {\\n    readonly in1: SVGAnimatedString;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEMergeNodeElement: {\\n    prototype: SVGFEMergeNodeElement;\\n    new(): SVGFEMergeNodeElement;\\n};\\n\\n/** Corresponds to the <feMorphology> element. */\\ninterface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\\n    readonly in1: SVGAnimatedString;\\n    readonly operator: SVGAnimatedEnumeration;\\n    readonly radiusX: SVGAnimatedNumber;\\n    readonly radiusY: SVGAnimatedNumber;\\n    readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number;\\n    readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number;\\n    readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEMorphologyElement: {\\n    prototype: SVGFEMorphologyElement;\\n    new(): SVGFEMorphologyElement;\\n    readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number;\\n    readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number;\\n    readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;\\n};\\n\\n/** Corresponds to the <feOffset> element. */\\ninterface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\\n    readonly dx: SVGAnimatedNumber;\\n    readonly dy: SVGAnimatedNumber;\\n    readonly in1: SVGAnimatedString;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEOffsetElement: {\\n    prototype: SVGFEOffsetElement;\\n    new(): SVGFEOffsetElement;\\n};\\n\\n/** Corresponds to the <fePointLight> element. */\\ninterface SVGFEPointLightElement extends SVGElement {\\n    readonly x: SVGAnimatedNumber;\\n    readonly y: SVGAnimatedNumber;\\n    readonly z: SVGAnimatedNumber;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFEPointLightElement: {\\n    prototype: SVGFEPointLightElement;\\n    new(): SVGFEPointLightElement;\\n};\\n\\n/** Corresponds to the <feSpecularLighting> element. */\\ninterface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\\n    readonly in1: SVGAnimatedString;\\n    readonly kernelUnitLengthX: SVGAnimatedNumber;\\n    readonly kernelUnitLengthY: SVGAnimatedNumber;\\n    readonly specularConstant: SVGAnimatedNumber;\\n    readonly specularExponent: SVGAnimatedNumber;\\n    readonly surfaceScale: SVGAnimatedNumber;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFESpecularLightingElement: {\\n    prototype: SVGFESpecularLightingElement;\\n    new(): SVGFESpecularLightingElement;\\n};\\n\\n/** Corresponds to the <feSpotLight> element. */\\ninterface SVGFESpotLightElement extends SVGElement {\\n    readonly limitingConeAngle: SVGAnimatedNumber;\\n    readonly pointsAtX: SVGAnimatedNumber;\\n    readonly pointsAtY: SVGAnimatedNumber;\\n    readonly pointsAtZ: SVGAnimatedNumber;\\n    readonly specularExponent: SVGAnimatedNumber;\\n    readonly x: SVGAnimatedNumber;\\n    readonly y: SVGAnimatedNumber;\\n    readonly z: SVGAnimatedNumber;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFESpotLightElement: {\\n    prototype: SVGFESpotLightElement;\\n    new(): SVGFESpotLightElement;\\n};\\n\\n/** Corresponds to the <feTile> element. */\\ninterface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\\n    readonly in1: SVGAnimatedString;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFETileElement: {\\n    prototype: SVGFETileElement;\\n    new(): SVGFETileElement;\\n};\\n\\n/** Corresponds to the <feTurbulence> element. */\\ninterface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\\n    readonly baseFrequencyX: SVGAnimatedNumber;\\n    readonly baseFrequencyY: SVGAnimatedNumber;\\n    readonly numOctaves: SVGAnimatedInteger;\\n    readonly seed: SVGAnimatedNumber;\\n    readonly stitchTiles: SVGAnimatedEnumeration;\\n    readonly type: SVGAnimatedEnumeration;\\n    readonly SVG_STITCHTYPE_NOSTITCH: number;\\n    readonly SVG_STITCHTYPE_STITCH: number;\\n    readonly SVG_STITCHTYPE_UNKNOWN: number;\\n    readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number;\\n    readonly SVG_TURBULENCE_TYPE_TURBULENCE: number;\\n    readonly SVG_TURBULENCE_TYPE_UNKNOWN: number;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFETurbulenceElement: {\\n    prototype: SVGFETurbulenceElement;\\n    new(): SVGFETurbulenceElement;\\n    readonly SVG_STITCHTYPE_NOSTITCH: number;\\n    readonly SVG_STITCHTYPE_STITCH: number;\\n    readonly SVG_STITCHTYPE_UNKNOWN: number;\\n    readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number;\\n    readonly SVG_TURBULENCE_TYPE_TURBULENCE: number;\\n    readonly SVG_TURBULENCE_TYPE_UNKNOWN: number;\\n};\\n\\n/** Provides access to the properties of <filter> elements, as well as methods to manipulate them. */\\ninterface SVGFilterElement extends SVGElement, SVGURIReference {\\n    readonly filterUnits: SVGAnimatedEnumeration;\\n    readonly height: SVGAnimatedLength;\\n    readonly primitiveUnits: SVGAnimatedEnumeration;\\n    readonly width: SVGAnimatedLength;\\n    readonly x: SVGAnimatedLength;\\n    readonly y: SVGAnimatedLength;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGFilterElement: {\\n    prototype: SVGFilterElement;\\n    new(): SVGFilterElement;\\n};\\n\\ninterface SVGFilterPrimitiveStandardAttributes {\\n    readonly height: SVGAnimatedLength;\\n    readonly result: SVGAnimatedString;\\n    readonly width: SVGAnimatedLength;\\n    readonly x: SVGAnimatedLength;\\n    readonly y: SVGAnimatedLength;\\n}\\n\\ninterface SVGFitToViewBox {\\n    readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\\n    readonly viewBox: SVGAnimatedRect;\\n}\\n\\n/** Provides access to the properties of <foreignObject> elements, as well as methods to manipulate them. */\\ninterface SVGForeignObjectElement extends SVGGraphicsElement {\\n    readonly height: SVGAnimatedLength;\\n    readonly width: SVGAnimatedLength;\\n    readonly x: SVGAnimatedLength;\\n    readonly y: SVGAnimatedLength;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGForeignObjectElement: {\\n    prototype: SVGForeignObjectElement;\\n    new(): SVGForeignObjectElement;\\n};\\n\\n/** Corresponds to the <g> element. */\\ninterface SVGGElement extends SVGGraphicsElement {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGGElement: {\\n    prototype: SVGGElement;\\n    new(): SVGGElement;\\n};\\n\\ninterface SVGGeometryElement extends SVGGraphicsElement {\\n    readonly pathLength: SVGAnimatedNumber;\\n    getPointAtLength(distance: number): DOMPoint;\\n    getTotalLength(): number;\\n    isPointInFill(point?: DOMPointInit): boolean;\\n    isPointInStroke(point?: DOMPointInit): boolean;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGGeometryElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGGeometryElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGGeometryElement: {\\n    prototype: SVGGeometryElement;\\n    new(): SVGGeometryElement;\\n};\\n\\n/** The SVGGradient interface is a base interface used by SVGLinearGradientElement and SVGRadialGradientElement. */\\ninterface SVGGradientElement extends SVGElement, SVGURIReference {\\n    readonly gradientTransform: SVGAnimatedTransformList;\\n    readonly gradientUnits: SVGAnimatedEnumeration;\\n    readonly spreadMethod: SVGAnimatedEnumeration;\\n    readonly SVG_SPREADMETHOD_PAD: number;\\n    readonly SVG_SPREADMETHOD_REFLECT: number;\\n    readonly SVG_SPREADMETHOD_REPEAT: number;\\n    readonly SVG_SPREADMETHOD_UNKNOWN: number;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGGradientElement: {\\n    prototype: SVGGradientElement;\\n    new(): SVGGradientElement;\\n    readonly SVG_SPREADMETHOD_PAD: number;\\n    readonly SVG_SPREADMETHOD_REFLECT: number;\\n    readonly SVG_SPREADMETHOD_REPEAT: number;\\n    readonly SVG_SPREADMETHOD_UNKNOWN: number;\\n};\\n\\n/** SVG elements whose primary purpose is to directly render graphics into a group. */\\ninterface SVGGraphicsElement extends SVGElement, SVGTests {\\n    readonly transform: SVGAnimatedTransformList;\\n    getBBox(options?: SVGBoundingBoxOptions): DOMRect;\\n    getCTM(): DOMMatrix | null;\\n    getScreenCTM(): DOMMatrix | null;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGGraphicsElement: {\\n    prototype: SVGGraphicsElement;\\n    new(): SVGGraphicsElement;\\n};\\n\\n/** Corresponds to the <image> element. */\\ninterface SVGImageElement extends SVGGraphicsElement, SVGURIReference {\\n    readonly height: SVGAnimatedLength;\\n    readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\\n    readonly width: SVGAnimatedLength;\\n    readonly x: SVGAnimatedLength;\\n    readonly y: SVGAnimatedLength;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGImageElement: {\\n    prototype: SVGImageElement;\\n    new(): SVGImageElement;\\n};\\n\\n/** Correspond to the <length> basic data type. */\\ninterface SVGLength {\\n    readonly unitType: number;\\n    value: number;\\n    valueAsString: string;\\n    valueInSpecifiedUnits: number;\\n    convertToSpecifiedUnits(unitType: number): void;\\n    newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void;\\n    readonly SVG_LENGTHTYPE_CM: number;\\n    readonly SVG_LENGTHTYPE_EMS: number;\\n    readonly SVG_LENGTHTYPE_EXS: number;\\n    readonly SVG_LENGTHTYPE_IN: number;\\n    readonly SVG_LENGTHTYPE_MM: number;\\n    readonly SVG_LENGTHTYPE_NUMBER: number;\\n    readonly SVG_LENGTHTYPE_PC: number;\\n    readonly SVG_LENGTHTYPE_PERCENTAGE: number;\\n    readonly SVG_LENGTHTYPE_PT: number;\\n    readonly SVG_LENGTHTYPE_PX: number;\\n    readonly SVG_LENGTHTYPE_UNKNOWN: number;\\n}\\n\\ndeclare var SVGLength: {\\n    prototype: SVGLength;\\n    new(): SVGLength;\\n    readonly SVG_LENGTHTYPE_CM: number;\\n    readonly SVG_LENGTHTYPE_EMS: number;\\n    readonly SVG_LENGTHTYPE_EXS: number;\\n    readonly SVG_LENGTHTYPE_IN: number;\\n    readonly SVG_LENGTHTYPE_MM: number;\\n    readonly SVG_LENGTHTYPE_NUMBER: number;\\n    readonly SVG_LENGTHTYPE_PC: number;\\n    readonly SVG_LENGTHTYPE_PERCENTAGE: number;\\n    readonly SVG_LENGTHTYPE_PT: number;\\n    readonly SVG_LENGTHTYPE_PX: number;\\n    readonly SVG_LENGTHTYPE_UNKNOWN: number;\\n};\\n\\n/** The SVGLengthList defines a list of SVGLength objects. */\\ninterface SVGLengthList {\\n    readonly length: number;\\n    readonly numberOfItems: number;\\n    appendItem(newItem: SVGLength): SVGLength;\\n    clear(): void;\\n    getItem(index: number): SVGLength;\\n    initialize(newItem: SVGLength): SVGLength;\\n    insertItemBefore(newItem: SVGLength, index: number): SVGLength;\\n    removeItem(index: number): SVGLength;\\n    replaceItem(newItem: SVGLength, index: number): SVGLength;\\n    [index: number]: SVGLength;\\n}\\n\\ndeclare var SVGLengthList: {\\n    prototype: SVGLengthList;\\n    new(): SVGLengthList;\\n};\\n\\n/** Provides access to the properties of <line> elements, as well as methods to manipulate them. */\\ninterface SVGLineElement extends SVGGeometryElement {\\n    readonly x1: SVGAnimatedLength;\\n    readonly x2: SVGAnimatedLength;\\n    readonly y1: SVGAnimatedLength;\\n    readonly y2: SVGAnimatedLength;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGLineElement: {\\n    prototype: SVGLineElement;\\n    new(): SVGLineElement;\\n};\\n\\n/** Corresponds to the <linearGradient> element. */\\ninterface SVGLinearGradientElement extends SVGGradientElement {\\n    readonly x1: SVGAnimatedLength;\\n    readonly x2: SVGAnimatedLength;\\n    readonly y1: SVGAnimatedLength;\\n    readonly y2: SVGAnimatedLength;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGLinearGradientElement: {\\n    prototype: SVGLinearGradientElement;\\n    new(): SVGLinearGradientElement;\\n};\\n\\ninterface SVGMarkerElement extends SVGElement, SVGFitToViewBox {\\n    readonly markerHeight: SVGAnimatedLength;\\n    readonly markerUnits: SVGAnimatedEnumeration;\\n    readonly markerWidth: SVGAnimatedLength;\\n    readonly orientAngle: SVGAnimatedAngle;\\n    readonly orientType: SVGAnimatedEnumeration;\\n    readonly refX: SVGAnimatedLength;\\n    readonly refY: SVGAnimatedLength;\\n    setOrientToAngle(angle: SVGAngle): void;\\n    setOrientToAuto(): void;\\n    readonly SVG_MARKERUNITS_STROKEWIDTH: number;\\n    readonly SVG_MARKERUNITS_UNKNOWN: number;\\n    readonly SVG_MARKERUNITS_USERSPACEONUSE: number;\\n    readonly SVG_MARKER_ORIENT_ANGLE: number;\\n    readonly SVG_MARKER_ORIENT_AUTO: number;\\n    readonly SVG_MARKER_ORIENT_UNKNOWN: number;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGMarkerElement: {\\n    prototype: SVGMarkerElement;\\n    new(): SVGMarkerElement;\\n    readonly SVG_MARKERUNITS_STROKEWIDTH: number;\\n    readonly SVG_MARKERUNITS_UNKNOWN: number;\\n    readonly SVG_MARKERUNITS_USERSPACEONUSE: number;\\n    readonly SVG_MARKER_ORIENT_ANGLE: number;\\n    readonly SVG_MARKER_ORIENT_AUTO: number;\\n    readonly SVG_MARKER_ORIENT_UNKNOWN: number;\\n};\\n\\n/** Provides access to the properties of <mask> elements, as well as methods to manipulate them. */\\ninterface SVGMaskElement extends SVGElement {\\n    readonly height: SVGAnimatedLength;\\n    readonly maskContentUnits: SVGAnimatedEnumeration;\\n    readonly maskUnits: SVGAnimatedEnumeration;\\n    readonly width: SVGAnimatedLength;\\n    readonly x: SVGAnimatedLength;\\n    readonly y: SVGAnimatedLength;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGMaskElement: {\\n    prototype: SVGMaskElement;\\n    new(): SVGMaskElement;\\n};\\n\\n/** Corresponds to the <metadata> element. */\\ninterface SVGMetadataElement extends SVGElement {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGMetadataElement: {\\n    prototype: SVGMetadataElement;\\n    new(): SVGMetadataElement;\\n};\\n\\n/** Corresponds to the <number> basic data type. */\\ninterface SVGNumber {\\n    value: number;\\n}\\n\\ndeclare var SVGNumber: {\\n    prototype: SVGNumber;\\n    new(): SVGNumber;\\n};\\n\\n/** The SVGNumberList defines a list of SVGNumber objects. */\\ninterface SVGNumberList {\\n    readonly length: number;\\n    readonly numberOfItems: number;\\n    appendItem(newItem: SVGNumber): SVGNumber;\\n    clear(): void;\\n    getItem(index: number): SVGNumber;\\n    initialize(newItem: SVGNumber): SVGNumber;\\n    insertItemBefore(newItem: SVGNumber, index: number): SVGNumber;\\n    removeItem(index: number): SVGNumber;\\n    replaceItem(newItem: SVGNumber, index: number): SVGNumber;\\n    [index: number]: SVGNumber;\\n}\\n\\ndeclare var SVGNumberList: {\\n    prototype: SVGNumberList;\\n    new(): SVGNumberList;\\n};\\n\\n/** Corresponds to the <path> element. */\\ninterface SVGPathElement extends SVGGraphicsElement {\\n    /** @deprecated */\\n    readonly pathSegList: SVGPathSegList;\\n    /** @deprecated */\\n    createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs;\\n    /** @deprecated */\\n    createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel;\\n    /** @deprecated */\\n    createSVGPathSegClosePath(): SVGPathSegClosePath;\\n    /** @deprecated */\\n    createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs;\\n    /** @deprecated */\\n    createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel;\\n    /** @deprecated */\\n    createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs;\\n    /** @deprecated */\\n    createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel;\\n    /** @deprecated */\\n    createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs;\\n    /** @deprecated */\\n    createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel;\\n    /** @deprecated */\\n    createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs;\\n    /** @deprecated */\\n    createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel;\\n    /** @deprecated */\\n    createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs;\\n    /** @deprecated */\\n    createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs;\\n    /** @deprecated */\\n    createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel;\\n    /** @deprecated */\\n    createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel;\\n    /** @deprecated */\\n    createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs;\\n    /** @deprecated */\\n    createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel;\\n    /** @deprecated */\\n    createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs;\\n    /** @deprecated */\\n    createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel;\\n    /** @deprecated */\\n    getPathSegAtLength(distance: number): number;\\n    getPointAtLength(distance: number): SVGPoint;\\n    getTotalLength(): number;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGPathElement: {\\n    prototype: SVGPathElement;\\n    new(): SVGPathElement;\\n};\\n\\ninterface SVGPathSeg {\\n    readonly pathSegType: number;\\n    readonly pathSegTypeAsLetter: string;\\n    readonly PATHSEG_ARC_ABS: number;\\n    readonly PATHSEG_ARC_REL: number;\\n    readonly PATHSEG_CLOSEPATH: number;\\n    readonly PATHSEG_CURVETO_CUBIC_ABS: number;\\n    readonly PATHSEG_CURVETO_CUBIC_REL: number;\\n    readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number;\\n    readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number;\\n    readonly PATHSEG_CURVETO_QUADRATIC_ABS: number;\\n    readonly PATHSEG_CURVETO_QUADRATIC_REL: number;\\n    readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number;\\n    readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number;\\n    readonly PATHSEG_LINETO_ABS: number;\\n    readonly PATHSEG_LINETO_HORIZONTAL_ABS: number;\\n    readonly PATHSEG_LINETO_HORIZONTAL_REL: number;\\n    readonly PATHSEG_LINETO_REL: number;\\n    readonly PATHSEG_LINETO_VERTICAL_ABS: number;\\n    readonly PATHSEG_LINETO_VERTICAL_REL: number;\\n    readonly PATHSEG_MOVETO_ABS: number;\\n    readonly PATHSEG_MOVETO_REL: number;\\n    readonly PATHSEG_UNKNOWN: number;\\n}\\n\\ndeclare var SVGPathSeg: {\\n    prototype: SVGPathSeg;\\n    new(): SVGPathSeg;\\n    readonly PATHSEG_ARC_ABS: number;\\n    readonly PATHSEG_ARC_REL: number;\\n    readonly PATHSEG_CLOSEPATH: number;\\n    readonly PATHSEG_CURVETO_CUBIC_ABS: number;\\n    readonly PATHSEG_CURVETO_CUBIC_REL: number;\\n    readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number;\\n    readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number;\\n    readonly PATHSEG_CURVETO_QUADRATIC_ABS: number;\\n    readonly PATHSEG_CURVETO_QUADRATIC_REL: number;\\n    readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number;\\n    readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number;\\n    readonly PATHSEG_LINETO_ABS: number;\\n    readonly PATHSEG_LINETO_HORIZONTAL_ABS: number;\\n    readonly PATHSEG_LINETO_HORIZONTAL_REL: number;\\n    readonly PATHSEG_LINETO_REL: number;\\n    readonly PATHSEG_LINETO_VERTICAL_ABS: number;\\n    readonly PATHSEG_LINETO_VERTICAL_REL: number;\\n    readonly PATHSEG_MOVETO_ABS: number;\\n    readonly PATHSEG_MOVETO_REL: number;\\n    readonly PATHSEG_UNKNOWN: number;\\n};\\n\\ninterface SVGPathSegArcAbs extends SVGPathSeg {\\n    angle: number;\\n    largeArcFlag: boolean;\\n    r1: number;\\n    r2: number;\\n    sweepFlag: boolean;\\n    x: number;\\n    y: number;\\n}\\n\\ndeclare var SVGPathSegArcAbs: {\\n    prototype: SVGPathSegArcAbs;\\n    new(): SVGPathSegArcAbs;\\n};\\n\\ninterface SVGPathSegArcRel extends SVGPathSeg {\\n    angle: number;\\n    largeArcFlag: boolean;\\n    r1: number;\\n    r2: number;\\n    sweepFlag: boolean;\\n    x: number;\\n    y: number;\\n}\\n\\ndeclare var SVGPathSegArcRel: {\\n    prototype: SVGPathSegArcRel;\\n    new(): SVGPathSegArcRel;\\n};\\n\\ninterface SVGPathSegClosePath extends SVGPathSeg {\\n}\\n\\ndeclare var SVGPathSegClosePath: {\\n    prototype: SVGPathSegClosePath;\\n    new(): SVGPathSegClosePath;\\n};\\n\\ninterface SVGPathSegCurvetoCubicAbs extends SVGPathSeg {\\n    x: number;\\n    x1: number;\\n    x2: number;\\n    y: number;\\n    y1: number;\\n    y2: number;\\n}\\n\\ndeclare var SVGPathSegCurvetoCubicAbs: {\\n    prototype: SVGPathSegCurvetoCubicAbs;\\n    new(): SVGPathSegCurvetoCubicAbs;\\n};\\n\\ninterface SVGPathSegCurvetoCubicRel extends SVGPathSeg {\\n    x: number;\\n    x1: number;\\n    x2: number;\\n    y: number;\\n    y1: number;\\n    y2: number;\\n}\\n\\ndeclare var SVGPathSegCurvetoCubicRel: {\\n    prototype: SVGPathSegCurvetoCubicRel;\\n    new(): SVGPathSegCurvetoCubicRel;\\n};\\n\\ninterface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg {\\n    x: number;\\n    x2: number;\\n    y: number;\\n    y2: number;\\n}\\n\\ndeclare var SVGPathSegCurvetoCubicSmoothAbs: {\\n    prototype: SVGPathSegCurvetoCubicSmoothAbs;\\n    new(): SVGPathSegCurvetoCubicSmoothAbs;\\n};\\n\\ninterface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg {\\n    x: number;\\n    x2: number;\\n    y: number;\\n    y2: number;\\n}\\n\\ndeclare var SVGPathSegCurvetoCubicSmoothRel: {\\n    prototype: SVGPathSegCurvetoCubicSmoothRel;\\n    new(): SVGPathSegCurvetoCubicSmoothRel;\\n};\\n\\ninterface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg {\\n    x: number;\\n    x1: number;\\n    y: number;\\n    y1: number;\\n}\\n\\ndeclare var SVGPathSegCurvetoQuadraticAbs: {\\n    prototype: SVGPathSegCurvetoQuadraticAbs;\\n    new(): SVGPathSegCurvetoQuadraticAbs;\\n};\\n\\ninterface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg {\\n    x: number;\\n    x1: number;\\n    y: number;\\n    y1: number;\\n}\\n\\ndeclare var SVGPathSegCurvetoQuadraticRel: {\\n    prototype: SVGPathSegCurvetoQuadraticRel;\\n    new(): SVGPathSegCurvetoQuadraticRel;\\n};\\n\\ninterface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg {\\n    x: number;\\n    y: number;\\n}\\n\\ndeclare var SVGPathSegCurvetoQuadraticSmoothAbs: {\\n    prototype: SVGPathSegCurvetoQuadraticSmoothAbs;\\n    new(): SVGPathSegCurvetoQuadraticSmoothAbs;\\n};\\n\\ninterface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg {\\n    x: number;\\n    y: number;\\n}\\n\\ndeclare var SVGPathSegCurvetoQuadraticSmoothRel: {\\n    prototype: SVGPathSegCurvetoQuadraticSmoothRel;\\n    new(): SVGPathSegCurvetoQuadraticSmoothRel;\\n};\\n\\ninterface SVGPathSegLinetoAbs extends SVGPathSeg {\\n    x: number;\\n    y: number;\\n}\\n\\ndeclare var SVGPathSegLinetoAbs: {\\n    prototype: SVGPathSegLinetoAbs;\\n    new(): SVGPathSegLinetoAbs;\\n};\\n\\ninterface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg {\\n    x: number;\\n}\\n\\ndeclare var SVGPathSegLinetoHorizontalAbs: {\\n    prototype: SVGPathSegLinetoHorizontalAbs;\\n    new(): SVGPathSegLinetoHorizontalAbs;\\n};\\n\\ninterface SVGPathSegLinetoHorizontalRel extends SVGPathSeg {\\n    x: number;\\n}\\n\\ndeclare var SVGPathSegLinetoHorizontalRel: {\\n    prototype: SVGPathSegLinetoHorizontalRel;\\n    new(): SVGPathSegLinetoHorizontalRel;\\n};\\n\\ninterface SVGPathSegLinetoRel extends SVGPathSeg {\\n    x: number;\\n    y: number;\\n}\\n\\ndeclare var SVGPathSegLinetoRel: {\\n    prototype: SVGPathSegLinetoRel;\\n    new(): SVGPathSegLinetoRel;\\n};\\n\\ninterface SVGPathSegLinetoVerticalAbs extends SVGPathSeg {\\n    y: number;\\n}\\n\\ndeclare var SVGPathSegLinetoVerticalAbs: {\\n    prototype: SVGPathSegLinetoVerticalAbs;\\n    new(): SVGPathSegLinetoVerticalAbs;\\n};\\n\\ninterface SVGPathSegLinetoVerticalRel extends SVGPathSeg {\\n    y: number;\\n}\\n\\ndeclare var SVGPathSegLinetoVerticalRel: {\\n    prototype: SVGPathSegLinetoVerticalRel;\\n    new(): SVGPathSegLinetoVerticalRel;\\n};\\n\\ninterface SVGPathSegList {\\n    readonly numberOfItems: number;\\n    appendItem(newItem: SVGPathSeg): SVGPathSeg;\\n    clear(): void;\\n    getItem(index: number): SVGPathSeg;\\n    initialize(newItem: SVGPathSeg): SVGPathSeg;\\n    insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg;\\n    removeItem(index: number): SVGPathSeg;\\n    replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg;\\n}\\n\\ndeclare var SVGPathSegList: {\\n    prototype: SVGPathSegList;\\n    new(): SVGPathSegList;\\n};\\n\\ninterface SVGPathSegMovetoAbs extends SVGPathSeg {\\n    x: number;\\n    y: number;\\n}\\n\\ndeclare var SVGPathSegMovetoAbs: {\\n    prototype: SVGPathSegMovetoAbs;\\n    new(): SVGPathSegMovetoAbs;\\n};\\n\\ninterface SVGPathSegMovetoRel extends SVGPathSeg {\\n    x: number;\\n    y: number;\\n}\\n\\ndeclare var SVGPathSegMovetoRel: {\\n    prototype: SVGPathSegMovetoRel;\\n    new(): SVGPathSegMovetoRel;\\n};\\n\\n/** Corresponds to the <pattern> element. */\\ninterface SVGPatternElement extends SVGElement, SVGFitToViewBox, SVGURIReference {\\n    readonly height: SVGAnimatedLength;\\n    readonly patternContentUnits: SVGAnimatedEnumeration;\\n    readonly patternTransform: SVGAnimatedTransformList;\\n    readonly patternUnits: SVGAnimatedEnumeration;\\n    readonly width: SVGAnimatedLength;\\n    readonly x: SVGAnimatedLength;\\n    readonly y: SVGAnimatedLength;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGPatternElement: {\\n    prototype: SVGPatternElement;\\n    new(): SVGPatternElement;\\n};\\n\\ninterface SVGPointList {\\n    readonly length: number;\\n    readonly numberOfItems: number;\\n    appendItem(newItem: DOMPoint): DOMPoint;\\n    clear(): void;\\n    getItem(index: number): DOMPoint;\\n    initialize(newItem: DOMPoint): DOMPoint;\\n    insertItemBefore(newItem: DOMPoint, index: number): DOMPoint;\\n    removeItem(index: number): DOMPoint;\\n    replaceItem(newItem: DOMPoint, index: number): DOMPoint;\\n    [index: number]: DOMPoint;\\n}\\n\\ndeclare var SVGPointList: {\\n    prototype: SVGPointList;\\n    new(): SVGPointList;\\n};\\n\\n/** Provides access to the properties of <polygon> elements, as well as methods to manipulate them. */\\ninterface SVGPolygonElement extends SVGGeometryElement, SVGAnimatedPoints {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGPolygonElement: {\\n    prototype: SVGPolygonElement;\\n    new(): SVGPolygonElement;\\n};\\n\\n/** Provides access to the properties of <polyline> elements, as well as methods to manipulate them. */\\ninterface SVGPolylineElement extends SVGGeometryElement, SVGAnimatedPoints {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGPolylineElement: {\\n    prototype: SVGPolylineElement;\\n    new(): SVGPolylineElement;\\n};\\n\\n/** Corresponds to the preserveAspectRatio attribute, which is available for some of SVG's elements. */\\ninterface SVGPreserveAspectRatio {\\n    align: number;\\n    meetOrSlice: number;\\n    readonly SVG_MEETORSLICE_MEET: number;\\n    readonly SVG_MEETORSLICE_SLICE: number;\\n    readonly SVG_MEETORSLICE_UNKNOWN: number;\\n    readonly SVG_PRESERVEASPECTRATIO_NONE: number;\\n    readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number;\\n}\\n\\ndeclare var SVGPreserveAspectRatio: {\\n    prototype: SVGPreserveAspectRatio;\\n    new(): SVGPreserveAspectRatio;\\n    readonly SVG_MEETORSLICE_MEET: number;\\n    readonly SVG_MEETORSLICE_SLICE: number;\\n    readonly SVG_MEETORSLICE_UNKNOWN: number;\\n    readonly SVG_PRESERVEASPECTRATIO_NONE: number;\\n    readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number;\\n    readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number;\\n};\\n\\n/** Corresponds to the <RadialGradient> element. */\\ninterface SVGRadialGradientElement extends SVGGradientElement {\\n    readonly cx: SVGAnimatedLength;\\n    readonly cy: SVGAnimatedLength;\\n    readonly fr: SVGAnimatedLength;\\n    readonly fx: SVGAnimatedLength;\\n    readonly fy: SVGAnimatedLength;\\n    readonly r: SVGAnimatedLength;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGRadialGradientElement: {\\n    prototype: SVGRadialGradientElement;\\n    new(): SVGRadialGradientElement;\\n};\\n\\n/** Provides access to the properties of <rect> elements, as well as methods to manipulate them. */\\ninterface SVGRectElement extends SVGGeometryElement {\\n    readonly height: SVGAnimatedLength;\\n    readonly rx: SVGAnimatedLength;\\n    readonly ry: SVGAnimatedLength;\\n    readonly width: SVGAnimatedLength;\\n    readonly x: SVGAnimatedLength;\\n    readonly y: SVGAnimatedLength;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGRectElement: {\\n    prototype: SVGRectElement;\\n    new(): SVGRectElement;\\n};\\n\\ninterface SVGSVGElementEventMap extends SVGElementEventMap {\\n    \\\"SVGUnload\\\": Event;\\n    \\\"SVGZoom\\\": SVGZoomEvent;\\n}\\n\\n/** Provides access to the properties of <svg> elements, as well as methods to manipulate them. This interface contains also various miscellaneous commonly-used utility methods, such as matrix operations and the ability to control the time of redraw on visual rendering devices. */\\ninterface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewBox, SVGZoomAndPan {\\n    /** @deprecated */\\n    contentScriptType: string;\\n    /** @deprecated */\\n    contentStyleType: string;\\n    currentScale: number;\\n    readonly currentTranslate: SVGPoint;\\n    readonly height: SVGAnimatedLength;\\n    onunload: ((this: SVGSVGElement, ev: Event) => any) | null;\\n    onzoom: ((this: SVGSVGElement, ev: SVGZoomEvent) => any) | null;\\n    /** @deprecated */\\n    readonly pixelUnitToMillimeterX: number;\\n    /** @deprecated */\\n    readonly pixelUnitToMillimeterY: number;\\n    /** @deprecated */\\n    readonly screenPixelToMillimeterX: number;\\n    /** @deprecated */\\n    readonly screenPixelToMillimeterY: number;\\n    /** @deprecated */\\n    readonly viewport: SVGRect;\\n    readonly width: SVGAnimatedLength;\\n    readonly x: SVGAnimatedLength;\\n    readonly y: SVGAnimatedLength;\\n    animationsPaused(): boolean;\\n    checkEnclosure(element: SVGElement, rect: SVGRect): boolean;\\n    checkIntersection(element: SVGElement, rect: SVGRect): boolean;\\n    createSVGAngle(): SVGAngle;\\n    createSVGLength(): SVGLength;\\n    createSVGMatrix(): SVGMatrix;\\n    createSVGNumber(): SVGNumber;\\n    createSVGPoint(): SVGPoint;\\n    createSVGRect(): SVGRect;\\n    createSVGTransform(): SVGTransform;\\n    createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform;\\n    deselectAll(): void;\\n    /** @deprecated */\\n    forceRedraw(): void;\\n    getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;\\n    getCurrentTime(): number;\\n    getElementById(elementId: string): Element;\\n    getEnclosureList(rect: SVGRect, referenceElement: SVGElement | null): NodeListOf<SVGCircleElement | SVGEllipseElement | SVGImageElement | SVGLineElement | SVGPathElement | SVGPolygonElement | SVGPolylineElement | SVGRectElement | SVGTextElement | SVGUseElement>;\\n    getIntersectionList(rect: SVGRect, referenceElement: SVGElement | null): NodeListOf<SVGCircleElement | SVGEllipseElement | SVGImageElement | SVGLineElement | SVGPathElement | SVGPolygonElement | SVGPolylineElement | SVGRectElement | SVGTextElement | SVGUseElement>;\\n    pauseAnimations(): void;\\n    setCurrentTime(seconds: number): void;\\n    /** @deprecated */\\n    suspendRedraw(maxWaitMilliseconds: number): number;\\n    unpauseAnimations(): void;\\n    /** @deprecated */\\n    unsuspendRedraw(suspendHandleID: number): void;\\n    /** @deprecated */\\n    unsuspendRedrawAll(): void;\\n    addEventListener<K extends keyof SVGSVGElementEventMap>(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGSVGElementEventMap>(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGSVGElement: {\\n    prototype: SVGSVGElement;\\n    new(): SVGSVGElement;\\n    readonly SVG_ZOOMANDPAN_DISABLE: number;\\n    readonly SVG_ZOOMANDPAN_MAGNIFY: number;\\n    readonly SVG_ZOOMANDPAN_UNKNOWN: number;\\n};\\n\\n/** Corresponds to the SVG <script> element. */\\ninterface SVGScriptElement extends SVGElement, SVGURIReference {\\n    type: string;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGScriptElement: {\\n    prototype: SVGScriptElement;\\n    new(): SVGScriptElement;\\n};\\n\\n/** Corresponds to the <stop> element. */\\ninterface SVGStopElement extends SVGElement {\\n    readonly offset: SVGAnimatedNumber;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGStopElement: {\\n    prototype: SVGStopElement;\\n    new(): SVGStopElement;\\n};\\n\\n/** The SVGStringList defines a list of DOMString objects. */\\ninterface SVGStringList {\\n    readonly length: number;\\n    readonly numberOfItems: number;\\n    appendItem(newItem: string): string;\\n    clear(): void;\\n    getItem(index: number): string;\\n    initialize(newItem: string): string;\\n    insertItemBefore(newItem: string, index: number): string;\\n    removeItem(index: number): string;\\n    replaceItem(newItem: string, index: number): string;\\n    [index: number]: string;\\n}\\n\\ndeclare var SVGStringList: {\\n    prototype: SVGStringList;\\n    new(): SVGStringList;\\n};\\n\\n/** Corresponds to the SVG <style> element. */\\ninterface SVGStyleElement extends SVGElement, LinkStyle {\\n    disabled: boolean;\\n    media: string;\\n    title: string;\\n    type: string;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGStyleElement: {\\n    prototype: SVGStyleElement;\\n    new(): SVGStyleElement;\\n};\\n\\n/** Corresponds to the <switch> element. */\\ninterface SVGSwitchElement extends SVGGraphicsElement {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGSwitchElement: {\\n    prototype: SVGSwitchElement;\\n    new(): SVGSwitchElement;\\n};\\n\\n/** Corresponds to the <symbol> element. */\\ninterface SVGSymbolElement extends SVGElement, SVGFitToViewBox {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGSymbolElement: {\\n    prototype: SVGSymbolElement;\\n    new(): SVGSymbolElement;\\n};\\n\\n/** A <tspan> element. */\\ninterface SVGTSpanElement extends SVGTextPositioningElement {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGTSpanElement: {\\n    prototype: SVGTSpanElement;\\n    new(): SVGTSpanElement;\\n};\\n\\ninterface SVGTests {\\n    readonly requiredExtensions: SVGStringList;\\n    readonly systemLanguage: SVGStringList;\\n}\\n\\n/** Implemented by elements that support rendering child text content. It is inherited by various text-related interfaces, such as SVGTextElement, SVGTSpanElement, SVGTRefElement, SVGAltGlyphElement and SVGTextPathElement. */\\ninterface SVGTextContentElement extends SVGGraphicsElement {\\n    readonly lengthAdjust: SVGAnimatedEnumeration;\\n    readonly textLength: SVGAnimatedLength;\\n    getCharNumAtPosition(point?: DOMPointInit): number;\\n    getComputedTextLength(): number;\\n    getEndPositionOfChar(charnum: number): DOMPoint;\\n    getExtentOfChar(charnum: number): DOMRect;\\n    getNumberOfChars(): number;\\n    getRotationOfChar(charnum: number): number;\\n    getStartPositionOfChar(charnum: number): DOMPoint;\\n    getSubStringLength(charnum: number, nchars: number): number;\\n    selectSubString(charnum: number, nchars: number): void;\\n    readonly LENGTHADJUST_SPACING: number;\\n    readonly LENGTHADJUST_SPACINGANDGLYPHS: number;\\n    readonly LENGTHADJUST_UNKNOWN: number;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGTextContentElement: {\\n    prototype: SVGTextContentElement;\\n    new(): SVGTextContentElement;\\n    readonly LENGTHADJUST_SPACING: number;\\n    readonly LENGTHADJUST_SPACINGANDGLYPHS: number;\\n    readonly LENGTHADJUST_UNKNOWN: number;\\n};\\n\\n/** Corresponds to the <text> elements. */\\ninterface SVGTextElement extends SVGTextPositioningElement {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGTextElement: {\\n    prototype: SVGTextElement;\\n    new(): SVGTextElement;\\n};\\n\\n/** Corresponds to the <textPath> element. */\\ninterface SVGTextPathElement extends SVGTextContentElement, SVGURIReference {\\n    readonly method: SVGAnimatedEnumeration;\\n    readonly spacing: SVGAnimatedEnumeration;\\n    readonly startOffset: SVGAnimatedLength;\\n    readonly TEXTPATH_METHODTYPE_ALIGN: number;\\n    readonly TEXTPATH_METHODTYPE_STRETCH: number;\\n    readonly TEXTPATH_METHODTYPE_UNKNOWN: number;\\n    readonly TEXTPATH_SPACINGTYPE_AUTO: number;\\n    readonly TEXTPATH_SPACINGTYPE_EXACT: number;\\n    readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGTextPathElement: {\\n    prototype: SVGTextPathElement;\\n    new(): SVGTextPathElement;\\n    readonly TEXTPATH_METHODTYPE_ALIGN: number;\\n    readonly TEXTPATH_METHODTYPE_STRETCH: number;\\n    readonly TEXTPATH_METHODTYPE_UNKNOWN: number;\\n    readonly TEXTPATH_SPACINGTYPE_AUTO: number;\\n    readonly TEXTPATH_SPACINGTYPE_EXACT: number;\\n    readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number;\\n};\\n\\n/** Implemented by elements that support attributes that position individual text glyphs. It is inherited by SVGTextElement, SVGTSpanElement, SVGTRefElement and SVGAltGlyphElement. */\\ninterface SVGTextPositioningElement extends SVGTextContentElement {\\n    readonly dx: SVGAnimatedLengthList;\\n    readonly dy: SVGAnimatedLengthList;\\n    readonly rotate: SVGAnimatedNumberList;\\n    readonly x: SVGAnimatedLengthList;\\n    readonly y: SVGAnimatedLengthList;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGTextPositioningElement: {\\n    prototype: SVGTextPositioningElement;\\n    new(): SVGTextPositioningElement;\\n};\\n\\n/** Corresponds to the <title> element. */\\ninterface SVGTitleElement extends SVGElement {\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGTitleElement: {\\n    prototype: SVGTitleElement;\\n    new(): SVGTitleElement;\\n};\\n\\n/** SVGTransform is the interface for one of the component transformations within an SVGTransformList; thus, an SVGTransform object corresponds to a single component (e.g., scale(…) or matrix(…)) within a transform attribute. */\\ninterface SVGTransform {\\n    readonly angle: number;\\n    readonly matrix: SVGMatrix;\\n    readonly type: number;\\n    setMatrix(matrix: SVGMatrix): void;\\n    setRotate(angle: number, cx: number, cy: number): void;\\n    setScale(sx: number, sy: number): void;\\n    setSkewX(angle: number): void;\\n    setSkewY(angle: number): void;\\n    setTranslate(tx: number, ty: number): void;\\n    readonly SVG_TRANSFORM_MATRIX: number;\\n    readonly SVG_TRANSFORM_ROTATE: number;\\n    readonly SVG_TRANSFORM_SCALE: number;\\n    readonly SVG_TRANSFORM_SKEWX: number;\\n    readonly SVG_TRANSFORM_SKEWY: number;\\n    readonly SVG_TRANSFORM_TRANSLATE: number;\\n    readonly SVG_TRANSFORM_UNKNOWN: number;\\n}\\n\\ndeclare var SVGTransform: {\\n    prototype: SVGTransform;\\n    new(): SVGTransform;\\n    readonly SVG_TRANSFORM_MATRIX: number;\\n    readonly SVG_TRANSFORM_ROTATE: number;\\n    readonly SVG_TRANSFORM_SCALE: number;\\n    readonly SVG_TRANSFORM_SKEWX: number;\\n    readonly SVG_TRANSFORM_SKEWY: number;\\n    readonly SVG_TRANSFORM_TRANSLATE: number;\\n    readonly SVG_TRANSFORM_UNKNOWN: number;\\n};\\n\\n/** The SVGTransformList defines a list of SVGTransform objects. */\\ninterface SVGTransformList {\\n    readonly numberOfItems: number;\\n    appendItem(newItem: SVGTransform): SVGTransform;\\n    clear(): void;\\n    consolidate(): SVGTransform;\\n    createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform;\\n    getItem(index: number): SVGTransform;\\n    initialize(newItem: SVGTransform): SVGTransform;\\n    insertItemBefore(newItem: SVGTransform, index: number): SVGTransform;\\n    removeItem(index: number): SVGTransform;\\n    replaceItem(newItem: SVGTransform, index: number): SVGTransform;\\n}\\n\\ndeclare var SVGTransformList: {\\n    prototype: SVGTransformList;\\n    new(): SVGTransformList;\\n};\\n\\ninterface SVGURIReference {\\n    readonly href: SVGAnimatedString;\\n}\\n\\n/** A commonly used set of constants used for reflecting gradientUnits, patternContentUnits and other similar attributes. */\\ninterface SVGUnitTypes {\\n    readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number;\\n    readonly SVG_UNIT_TYPE_UNKNOWN: number;\\n    readonly SVG_UNIT_TYPE_USERSPACEONUSE: number;\\n}\\n\\ndeclare var SVGUnitTypes: {\\n    prototype: SVGUnitTypes;\\n    new(): SVGUnitTypes;\\n    readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number;\\n    readonly SVG_UNIT_TYPE_UNKNOWN: number;\\n    readonly SVG_UNIT_TYPE_USERSPACEONUSE: number;\\n};\\n\\n/** Corresponds to the <use> element. */\\ninterface SVGUseElement extends SVGGraphicsElement, SVGURIReference {\\n    readonly animatedInstanceRoot: SVGElementInstance | null;\\n    readonly height: SVGAnimatedLength;\\n    readonly instanceRoot: SVGElementInstance | null;\\n    readonly width: SVGAnimatedLength;\\n    readonly x: SVGAnimatedLength;\\n    readonly y: SVGAnimatedLength;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGUseElement: {\\n    prototype: SVGUseElement;\\n    new(): SVGUseElement;\\n};\\n\\n/** Provides access to the properties of <view> elements, as well as methods to manipulate them. */\\ninterface SVGViewElement extends SVGElement, SVGFitToViewBox, SVGZoomAndPan {\\n    /** @deprecated */\\n    readonly viewTarget: SVGStringList;\\n    addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SVGViewElement: {\\n    prototype: SVGViewElement;\\n    new(): SVGViewElement;\\n    readonly SVG_ZOOMANDPAN_DISABLE: number;\\n    readonly SVG_ZOOMANDPAN_MAGNIFY: number;\\n    readonly SVG_ZOOMANDPAN_UNKNOWN: number;\\n};\\n\\n/** Used to reflect the zoomAndPan attribute, and is mixed in to other interfaces for elements that support this attribute. */\\ninterface SVGZoomAndPan {\\n    readonly zoomAndPan: number;\\n}\\n\\ndeclare var SVGZoomAndPan: {\\n    readonly SVG_ZOOMANDPAN_DISABLE: number;\\n    readonly SVG_ZOOMANDPAN_MAGNIFY: number;\\n    readonly SVG_ZOOMANDPAN_UNKNOWN: number;\\n};\\n\\ninterface SVGZoomEvent extends UIEvent {\\n    readonly newScale: number;\\n    readonly newTranslate: SVGPoint;\\n    readonly previousScale: number;\\n    readonly previousTranslate: SVGPoint;\\n    readonly zoomRectScreen: SVGRect;\\n}\\n\\ndeclare var SVGZoomEvent: {\\n    prototype: SVGZoomEvent;\\n    new(): SVGZoomEvent;\\n};\\n\\ninterface ScopedCredential {\\n    readonly id: ArrayBuffer;\\n    readonly type: ScopedCredentialType;\\n}\\n\\ndeclare var ScopedCredential: {\\n    prototype: ScopedCredential;\\n    new(): ScopedCredential;\\n};\\n\\ninterface ScopedCredentialInfo {\\n    readonly credential: ScopedCredential;\\n    readonly publicKey: CryptoKey;\\n}\\n\\ndeclare var ScopedCredentialInfo: {\\n    prototype: ScopedCredentialInfo;\\n    new(): ScopedCredentialInfo;\\n};\\n\\n/** A screen, usually the one on which the current window is being rendered, and is obtained using window.screen. */\\ninterface Screen {\\n    readonly availHeight: number;\\n    readonly availWidth: number;\\n    readonly colorDepth: number;\\n    readonly height: number;\\n    readonly orientation: ScreenOrientation;\\n    readonly pixelDepth: number;\\n    readonly width: number;\\n}\\n\\ndeclare var Screen: {\\n    prototype: Screen;\\n    new(): Screen;\\n};\\n\\ninterface ScreenOrientationEventMap {\\n    \\\"change\\\": Event;\\n}\\n\\ninterface ScreenOrientation extends EventTarget {\\n    readonly angle: number;\\n    onchange: ((this: ScreenOrientation, ev: Event) => any) | null;\\n    readonly type: OrientationType;\\n    lock(orientation: OrientationLockType): Promise<void>;\\n    unlock(): void;\\n    addEventListener<K extends keyof ScreenOrientationEventMap>(type: K, listener: (this: ScreenOrientation, ev: ScreenOrientationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof ScreenOrientationEventMap>(type: K, listener: (this: ScreenOrientation, ev: ScreenOrientationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var ScreenOrientation: {\\n    prototype: ScreenOrientation;\\n    new(): ScreenOrientation;\\n};\\n\\ninterface ScriptProcessorNodeEventMap {\\n    \\\"audioprocess\\\": AudioProcessingEvent;\\n}\\n\\n/** Allows the generation, processing, or analyzing of audio using JavaScript.\\n * @deprecated As of the August 29 2014 Web Audio API spec publication, this feature has been marked as deprecated, and was replaced by AudioWorklet (see AudioWorkletNode).\\n */\\ninterface ScriptProcessorNode extends AudioNode {\\n    /** @deprecated */\\n    readonly bufferSize: number;\\n    /** @deprecated */\\n    onaudioprocess: ((this: ScriptProcessorNode, ev: AudioProcessingEvent) => any) | null;\\n    addEventListener<K extends keyof ScriptProcessorNodeEventMap>(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof ScriptProcessorNodeEventMap>(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var ScriptProcessorNode: {\\n    prototype: ScriptProcessorNode;\\n    new(): ScriptProcessorNode;\\n};\\n\\n/** Inherits from Event, and represents the event object of an event sent on a document or worker when its content security policy is violated. */\\ninterface SecurityPolicyViolationEvent extends Event {\\n    readonly blockedURI: string;\\n    readonly columnNumber: number;\\n    readonly documentURI: string;\\n    readonly effectiveDirective: string;\\n    readonly lineNumber: number;\\n    readonly originalPolicy: string;\\n    readonly referrer: string;\\n    readonly sourceFile: string;\\n    readonly statusCode: number;\\n    readonly violatedDirective: string;\\n}\\n\\ndeclare var SecurityPolicyViolationEvent: {\\n    prototype: SecurityPolicyViolationEvent;\\n    new(type: string, eventInitDict?: SecurityPolicyViolationEventInit): SecurityPolicyViolationEvent;\\n};\\n\\n/** A Selection object represents the range of text selected by the user or the current position of the caret. To obtain a Selection object for examination or modification, call Window.getSelection(). */\\ninterface Selection {\\n    readonly anchorNode: Node | null;\\n    readonly anchorOffset: number;\\n    readonly focusNode: Node | null;\\n    readonly focusOffset: number;\\n    readonly isCollapsed: boolean;\\n    readonly rangeCount: number;\\n    readonly type: string;\\n    addRange(range: Range): void;\\n    collapse(node: Node | null, offset?: number): void;\\n    collapseToEnd(): void;\\n    collapseToStart(): void;\\n    containsNode(node: Node, allowPartialContainment?: boolean): boolean;\\n    deleteFromDocument(): void;\\n    empty(): void;\\n    extend(node: Node, offset?: number): void;\\n    getRangeAt(index: number): Range;\\n    removeAllRanges(): void;\\n    removeRange(range: Range): void;\\n    selectAllChildren(node: Node): void;\\n    setBaseAndExtent(anchorNode: Node, anchorOffset: number, focusNode: Node, focusOffset: number): void;\\n    setPosition(node: Node | null, offset?: number): void;\\n    toString(): string;\\n}\\n\\ndeclare var Selection: {\\n    prototype: Selection;\\n    new(): Selection;\\n    toString(): string;\\n};\\n\\ninterface ServiceUIFrameContext {\\n    getCachedFrameMessage(key: string): string;\\n    postFrameMessage(key: string, data: string): void;\\n}\\ndeclare var ServiceUIFrameContext: ServiceUIFrameContext;\\n\\ninterface ServiceWorkerEventMap extends AbstractWorkerEventMap {\\n    \\\"statechange\\\": Event;\\n}\\n\\n/** This ServiceWorker API interface provides a reference to a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique ServiceWorker object. */\\ninterface ServiceWorker extends EventTarget, AbstractWorker {\\n    onstatechange: ((this: ServiceWorker, ev: Event) => any) | null;\\n    readonly scriptURL: string;\\n    readonly state: ServiceWorkerState;\\n    postMessage(message: any, transfer: Transferable[]): void;\\n    postMessage(message: any, options?: PostMessageOptions): void;\\n    addEventListener<K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var ServiceWorker: {\\n    prototype: ServiceWorker;\\n    new(): ServiceWorker;\\n};\\n\\ninterface ServiceWorkerContainerEventMap {\\n    \\\"controllerchange\\\": Event;\\n    \\\"message\\\": MessageEvent;\\n    \\\"messageerror\\\": MessageEvent;\\n}\\n\\n/** The ServiceWorkerContainer interface of the ServiceWorker API provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations. */\\ninterface ServiceWorkerContainer extends EventTarget {\\n    readonly controller: ServiceWorker | null;\\n    oncontrollerchange: ((this: ServiceWorkerContainer, ev: Event) => any) | null;\\n    onmessage: ((this: ServiceWorkerContainer, ev: MessageEvent) => any) | null;\\n    onmessageerror: ((this: ServiceWorkerContainer, ev: MessageEvent) => any) | null;\\n    readonly ready: Promise<ServiceWorkerRegistration>;\\n    getRegistration(clientURL?: string): Promise<ServiceWorkerRegistration | undefined>;\\n    getRegistrations(): Promise<ReadonlyArray<ServiceWorkerRegistration>>;\\n    register(scriptURL: string | URL, options?: RegistrationOptions): Promise<ServiceWorkerRegistration>;\\n    startMessages(): void;\\n    addEventListener<K extends keyof ServiceWorkerContainerEventMap>(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof ServiceWorkerContainerEventMap>(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var ServiceWorkerContainer: {\\n    prototype: ServiceWorkerContainer;\\n    new(): ServiceWorkerContainer;\\n};\\n\\n/** This ServiceWorker API interface contains information about an event sent to a ServiceWorkerContainer target. This extends the default message event to allow setting a ServiceWorker object as the source of a message. The event object is accessed via the handler function of a message event, when fired by a message received from a service worker.\\n * @deprecated In modern browsers, this interface has been deprecated. Service worker messages will now use the MessageEvent interface, for consistency with other web messaging features.\\n */\\ninterface ServiceWorkerMessageEvent extends Event {\\n    readonly data: any;\\n    readonly lastEventId: string;\\n    readonly origin: string;\\n    readonly ports: ReadonlyArray<MessagePort> | null;\\n    readonly source: ServiceWorker | MessagePort | null;\\n}\\n\\ndeclare var ServiceWorkerMessageEvent: {\\n    prototype: ServiceWorkerMessageEvent;\\n    new(type: string, eventInitDict?: ServiceWorkerMessageEventInit): ServiceWorkerMessageEvent;\\n};\\n\\ninterface ServiceWorkerRegistrationEventMap {\\n    \\\"updatefound\\\": Event;\\n}\\n\\n/** This ServiceWorker API interface represents the service worker registration. You register a service worker to control one or more pages that share the same origin. */\\ninterface ServiceWorkerRegistration extends EventTarget {\\n    readonly active: ServiceWorker | null;\\n    readonly installing: ServiceWorker | null;\\n    readonly navigationPreload: NavigationPreloadManager;\\n    onupdatefound: ((this: ServiceWorkerRegistration, ev: Event) => any) | null;\\n    readonly pushManager: PushManager;\\n    readonly scope: string;\\n    readonly sync: SyncManager;\\n    readonly updateViaCache: ServiceWorkerUpdateViaCache;\\n    readonly waiting: ServiceWorker | null;\\n    getNotifications(filter?: GetNotificationOptions): Promise<Notification[]>;\\n    showNotification(title: string, options?: NotificationOptions): Promise<void>;\\n    unregister(): Promise<boolean>;\\n    update(): Promise<void>;\\n    addEventListener<K extends keyof ServiceWorkerRegistrationEventMap>(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof ServiceWorkerRegistrationEventMap>(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var ServiceWorkerRegistration: {\\n    prototype: ServiceWorkerRegistration;\\n    new(): ServiceWorkerRegistration;\\n};\\n\\ninterface ShadowRoot extends DocumentFragment, DocumentOrShadowRoot, InnerHTML {\\n    readonly host: Element;\\n    readonly mode: ShadowRootMode;\\n    /**\\n     * Throws a \\\"NotSupportedError\\\" DOMException if context object is a shadow root.\\n     */\\n}\\n\\ndeclare var ShadowRoot: {\\n    prototype: ShadowRoot;\\n    new(): ShadowRoot;\\n};\\n\\ninterface SharedWorker extends EventTarget, AbstractWorker {\\n    /**\\n     * Returns sharedWorker's MessagePort object which can be used to communicate with the global environment.\\n     */\\n    readonly port: MessagePort;\\n    addEventListener<K extends keyof AbstractWorkerEventMap>(type: K, listener: (this: SharedWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof AbstractWorkerEventMap>(type: K, listener: (this: SharedWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SharedWorker: {\\n    prototype: SharedWorker;\\n    new(scriptURL: string, options?: string | WorkerOptions): SharedWorker;\\n};\\n\\ninterface Slottable {\\n    readonly assignedSlot: HTMLSlotElement | null;\\n}\\n\\ninterface SourceBufferEventMap {\\n    \\\"abort\\\": Event;\\n    \\\"error\\\": Event;\\n    \\\"update\\\": Event;\\n    \\\"updateend\\\": Event;\\n    \\\"updatestart\\\": Event;\\n}\\n\\n/** A chunk of media to be passed into an HTMLMediaElement and played, via a MediaSource object. This can be made up of one or several media segments. */\\ninterface SourceBuffer extends EventTarget {\\n    appendWindowEnd: number;\\n    appendWindowStart: number;\\n    readonly buffered: TimeRanges;\\n    mode: AppendMode;\\n    onabort: ((this: SourceBuffer, ev: Event) => any) | null;\\n    onerror: ((this: SourceBuffer, ev: Event) => any) | null;\\n    onupdate: ((this: SourceBuffer, ev: Event) => any) | null;\\n    onupdateend: ((this: SourceBuffer, ev: Event) => any) | null;\\n    onupdatestart: ((this: SourceBuffer, ev: Event) => any) | null;\\n    timestampOffset: number;\\n    readonly updating: boolean;\\n    abort(): void;\\n    appendBuffer(data: BufferSource): void;\\n    remove(start: number, end: number): void;\\n    addEventListener<K extends keyof SourceBufferEventMap>(type: K, listener: (this: SourceBuffer, ev: SourceBufferEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SourceBufferEventMap>(type: K, listener: (this: SourceBuffer, ev: SourceBufferEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SourceBuffer: {\\n    prototype: SourceBuffer;\\n    new(): SourceBuffer;\\n};\\n\\ninterface SourceBufferListEventMap {\\n    \\\"addsourcebuffer\\\": Event;\\n    \\\"removesourcebuffer\\\": Event;\\n}\\n\\n/** A simple container list for multiple SourceBuffer objects. */\\ninterface SourceBufferList extends EventTarget {\\n    readonly length: number;\\n    onaddsourcebuffer: ((this: SourceBufferList, ev: Event) => any) | null;\\n    onremovesourcebuffer: ((this: SourceBufferList, ev: Event) => any) | null;\\n    addEventListener<K extends keyof SourceBufferListEventMap>(type: K, listener: (this: SourceBufferList, ev: SourceBufferListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SourceBufferListEventMap>(type: K, listener: (this: SourceBufferList, ev: SourceBufferListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n    [index: number]: SourceBuffer;\\n}\\n\\ndeclare var SourceBufferList: {\\n    prototype: SourceBufferList;\\n    new(): SourceBufferList;\\n};\\n\\ninterface SpeechGrammar {\\n    src: string;\\n    weight: number;\\n}\\n\\ndeclare var SpeechGrammar: {\\n    prototype: SpeechGrammar;\\n    new(): SpeechGrammar;\\n};\\n\\ninterface SpeechGrammarList {\\n    readonly length: number;\\n    addFromString(string: string, weight?: number): void;\\n    addFromURI(src: string, weight?: number): void;\\n    item(index: number): SpeechGrammar;\\n    [index: number]: SpeechGrammar;\\n}\\n\\ndeclare var SpeechGrammarList: {\\n    prototype: SpeechGrammarList;\\n    new(): SpeechGrammarList;\\n};\\n\\ninterface SpeechRecognitionEventMap {\\n    \\\"audioend\\\": Event;\\n    \\\"audiostart\\\": Event;\\n    \\\"end\\\": Event;\\n    \\\"error\\\": SpeechRecognitionErrorEvent;\\n    \\\"nomatch\\\": SpeechRecognitionEvent;\\n    \\\"result\\\": SpeechRecognitionEvent;\\n    \\\"soundend\\\": Event;\\n    \\\"soundstart\\\": Event;\\n    \\\"speechend\\\": Event;\\n    \\\"speechstart\\\": Event;\\n    \\\"start\\\": Event;\\n}\\n\\ninterface SpeechRecognition extends EventTarget {\\n    continuous: boolean;\\n    grammars: SpeechGrammarList;\\n    interimResults: boolean;\\n    lang: string;\\n    maxAlternatives: number;\\n    onaudioend: ((this: SpeechRecognition, ev: Event) => any) | null;\\n    onaudiostart: ((this: SpeechRecognition, ev: Event) => any) | null;\\n    onend: ((this: SpeechRecognition, ev: Event) => any) | null;\\n    onerror: ((this: SpeechRecognition, ev: SpeechRecognitionErrorEvent) => any) | null;\\n    onnomatch: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null;\\n    onresult: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null;\\n    onsoundend: ((this: SpeechRecognition, ev: Event) => any) | null;\\n    onsoundstart: ((this: SpeechRecognition, ev: Event) => any) | null;\\n    onspeechend: ((this: SpeechRecognition, ev: Event) => any) | null;\\n    onspeechstart: ((this: SpeechRecognition, ev: Event) => any) | null;\\n    onstart: ((this: SpeechRecognition, ev: Event) => any) | null;\\n    abort(): void;\\n    start(): void;\\n    stop(): void;\\n    addEventListener<K extends keyof SpeechRecognitionEventMap>(type: K, listener: (this: SpeechRecognition, ev: SpeechRecognitionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SpeechRecognitionEventMap>(type: K, listener: (this: SpeechRecognition, ev: SpeechRecognitionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SpeechRecognition: {\\n    prototype: SpeechRecognition;\\n    new(): SpeechRecognition;\\n};\\n\\ninterface SpeechRecognitionAlternative {\\n    readonly confidence: number;\\n    readonly transcript: string;\\n}\\n\\ndeclare var SpeechRecognitionAlternative: {\\n    prototype: SpeechRecognitionAlternative;\\n    new(): SpeechRecognitionAlternative;\\n};\\n\\ninterface SpeechRecognitionErrorEvent extends Event {\\n    readonly error: SpeechRecognitionErrorCode;\\n    readonly message: string;\\n}\\n\\ndeclare var SpeechRecognitionErrorEvent: {\\n    prototype: SpeechRecognitionErrorEvent;\\n    new(type: string, eventInitDict: SpeechRecognitionErrorEventInit): SpeechRecognitionErrorEvent;\\n};\\n\\ninterface SpeechRecognitionEvent extends Event {\\n    readonly resultIndex: number;\\n    readonly results: SpeechRecognitionResultList;\\n}\\n\\ndeclare var SpeechRecognitionEvent: {\\n    prototype: SpeechRecognitionEvent;\\n    new(type: string, eventInitDict: SpeechRecognitionEventInit): SpeechRecognitionEvent;\\n};\\n\\ninterface SpeechRecognitionResult {\\n    readonly isFinal: boolean;\\n    readonly length: number;\\n    item(index: number): SpeechRecognitionAlternative;\\n    [index: number]: SpeechRecognitionAlternative;\\n}\\n\\ndeclare var SpeechRecognitionResult: {\\n    prototype: SpeechRecognitionResult;\\n    new(): SpeechRecognitionResult;\\n};\\n\\ninterface SpeechRecognitionResultList {\\n    readonly length: number;\\n    item(index: number): SpeechRecognitionResult;\\n    [index: number]: SpeechRecognitionResult;\\n}\\n\\ndeclare var SpeechRecognitionResultList: {\\n    prototype: SpeechRecognitionResultList;\\n    new(): SpeechRecognitionResultList;\\n};\\n\\ninterface SpeechSynthesisEventMap {\\n    \\\"voiceschanged\\\": Event;\\n}\\n\\n/** This Web Speech API interface is the controller interface for the speech service; this can be used to retrieve information about the synthesis voices available on the device, start and pause speech, and other commands besides. */\\ninterface SpeechSynthesis extends EventTarget {\\n    onvoiceschanged: ((this: SpeechSynthesis, ev: Event) => any) | null;\\n    readonly paused: boolean;\\n    readonly pending: boolean;\\n    readonly speaking: boolean;\\n    cancel(): void;\\n    getVoices(): SpeechSynthesisVoice[];\\n    pause(): void;\\n    resume(): void;\\n    speak(utterance: SpeechSynthesisUtterance): void;\\n    addEventListener<K extends keyof SpeechSynthesisEventMap>(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SpeechSynthesisEventMap>(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SpeechSynthesis: {\\n    prototype: SpeechSynthesis;\\n    new(): SpeechSynthesis;\\n};\\n\\ninterface SpeechSynthesisErrorEvent extends SpeechSynthesisEvent {\\n    readonly error: SpeechSynthesisErrorCode;\\n}\\n\\ndeclare var SpeechSynthesisErrorEvent: {\\n    prototype: SpeechSynthesisErrorEvent;\\n    new(type: string, eventInitDict: SpeechSynthesisErrorEventInit): SpeechSynthesisErrorEvent;\\n};\\n\\n/** This Web Speech API interface contains information about the current state of SpeechSynthesisUtterance objects that have been processed in the speech service. */\\ninterface SpeechSynthesisEvent extends Event {\\n    readonly charIndex: number;\\n    readonly charLength: number;\\n    readonly elapsedTime: number;\\n    readonly name: string;\\n    readonly utterance: SpeechSynthesisUtterance;\\n}\\n\\ndeclare var SpeechSynthesisEvent: {\\n    prototype: SpeechSynthesisEvent;\\n    new(type: string, eventInitDict: SpeechSynthesisEventInit): SpeechSynthesisEvent;\\n};\\n\\ninterface SpeechSynthesisUtteranceEventMap {\\n    \\\"boundary\\\": SpeechSynthesisEvent;\\n    \\\"end\\\": SpeechSynthesisEvent;\\n    \\\"error\\\": SpeechSynthesisErrorEvent;\\n    \\\"mark\\\": SpeechSynthesisEvent;\\n    \\\"pause\\\": SpeechSynthesisEvent;\\n    \\\"resume\\\": SpeechSynthesisEvent;\\n    \\\"start\\\": SpeechSynthesisEvent;\\n}\\n\\n/** This Web Speech API interface represents a speech request. It contains the content the speech service should read and information about how to read it (e.g. language, pitch and volume.) */\\ninterface SpeechSynthesisUtterance extends EventTarget {\\n    lang: string;\\n    onboundary: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null;\\n    onend: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null;\\n    onerror: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisErrorEvent) => any) | null;\\n    onmark: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null;\\n    onpause: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null;\\n    onresume: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null;\\n    onstart: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null;\\n    pitch: number;\\n    rate: number;\\n    text: string;\\n    voice: SpeechSynthesisVoice | null;\\n    volume: number;\\n    addEventListener<K extends keyof SpeechSynthesisUtteranceEventMap>(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SpeechSynthesisUtteranceEventMap>(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SpeechSynthesisUtterance: {\\n    prototype: SpeechSynthesisUtterance;\\n    new(text?: string): SpeechSynthesisUtterance;\\n};\\n\\n/** This Web Speech API interface represents a voice that the system supports. Every SpeechSynthesisVoice has its own relative speech service including information about language, name and URI. */\\ninterface SpeechSynthesisVoice {\\n    readonly default: boolean;\\n    readonly lang: string;\\n    readonly localService: boolean;\\n    readonly name: string;\\n    readonly voiceURI: string;\\n}\\n\\ndeclare var SpeechSynthesisVoice: {\\n    prototype: SpeechSynthesisVoice;\\n    new(): SpeechSynthesisVoice;\\n};\\n\\ninterface StaticRange extends AbstractRange {\\n}\\n\\ndeclare var StaticRange: {\\n    prototype: StaticRange;\\n    new(init: StaticRangeInit): StaticRange;\\n};\\n\\n/** The pan property takes a unitless value between -1 (full left pan) and 1 (full right pan). This interface was introduced as a much simpler way to apply a simple panning effect than having to use a full PannerNode. */\\ninterface StereoPannerNode extends AudioNode {\\n    readonly pan: AudioParam;\\n}\\n\\ndeclare var StereoPannerNode: {\\n    prototype: StereoPannerNode;\\n    new(context: BaseAudioContext, options?: StereoPannerOptions): StereoPannerNode;\\n};\\n\\n/** This Web Storage API interface provides access to a particular domain's session or local storage. It allows, for example, the addition, modification, or deletion of stored data items. */\\ninterface Storage {\\n    /**\\n     * Returns the number of key/value pairs currently present in the list associated with the object.\\n     */\\n    readonly length: number;\\n    /**\\n     * Empties the list associated with the object of all key/value pairs, if there are any.\\n     */\\n    clear(): void;\\n    /**\\n     * Returns the current value associated with the given key, or null if the given key does not exist in the list associated with the object.\\n     */\\n    getItem(key: string): string | null;\\n    /**\\n     * Returns the name of the nth key in the list, or null if n is greater than or equal to the number of key/value pairs in the object.\\n     */\\n    key(index: number): string | null;\\n    /**\\n     * Removes the key/value pair with the given key from the list associated with the object, if a key/value pair with the given key exists.\\n     */\\n    removeItem(key: string): void;\\n    /**\\n     * Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.\\n     * \\n     * Throws a \\\"QuotaExceededError\\\" DOMException exception if the new value couldn't be set. (Setting could fail if, e.g., the user has disabled storage for the site, or if the quota has been exceeded.)\\n     */\\n    setItem(key: string, value: string): void;\\n    [name: string]: any;\\n}\\n\\ndeclare var Storage: {\\n    prototype: Storage;\\n    new(): Storage;\\n};\\n\\n/** A StorageEvent is sent to a window when a storage area it has access to is changed within the context of another document. */\\ninterface StorageEvent extends Event {\\n    /**\\n     * Returns the key of the storage item being changed.\\n     */\\n    readonly key: string | null;\\n    /**\\n     * Returns the new value of the key of the storage item whose value is being changed.\\n     */\\n    readonly newValue: string | null;\\n    /**\\n     * Returns the old value of the key of the storage item whose value is being changed.\\n     */\\n    readonly oldValue: string | null;\\n    /**\\n     * Returns the Storage object that was affected.\\n     */\\n    readonly storageArea: Storage | null;\\n    /**\\n     * Returns the URL of the document whose storage item changed.\\n     */\\n    readonly url: string;\\n}\\n\\ndeclare var StorageEvent: {\\n    prototype: StorageEvent;\\n    new(type: string, eventInitDict?: StorageEventInit): StorageEvent;\\n};\\n\\ninterface StorageManager {\\n    estimate(): Promise<StorageEstimate>;\\n    persist(): Promise<boolean>;\\n    persisted(): Promise<boolean>;\\n}\\n\\ndeclare var StorageManager: {\\n    prototype: StorageManager;\\n    new(): StorageManager;\\n};\\n\\ninterface StyleMedia {\\n    readonly type: string;\\n    matchMedium(mediaquery: string): boolean;\\n}\\n\\ndeclare var StyleMedia: {\\n    prototype: StyleMedia;\\n    new(): StyleMedia;\\n};\\n\\n/** A single style sheet. CSS style sheets will further implement the more specialized CSSStyleSheet interface. */\\ninterface StyleSheet {\\n    disabled: boolean;\\n    readonly href: string | null;\\n    readonly media: MediaList;\\n    readonly ownerNode: Element | ProcessingInstruction | null;\\n    readonly parentStyleSheet: CSSStyleSheet | null;\\n    readonly title: string | null;\\n    readonly type: string;\\n}\\n\\ndeclare var StyleSheet: {\\n    prototype: StyleSheet;\\n    new(): StyleSheet;\\n};\\n\\n/** A list of StyleSheet. */\\ninterface StyleSheetList {\\n    readonly length: number;\\n    item(index: number): CSSStyleSheet | null;\\n    [index: number]: CSSStyleSheet;\\n}\\n\\ndeclare var StyleSheetList: {\\n    prototype: StyleSheetList;\\n    new(): StyleSheetList;\\n};\\n\\n/** This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto). */\\ninterface SubtleCrypto {\\n    decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<ArrayBuffer>;\\n    deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;\\n    deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;\\n    digest(algorithm: AlgorithmIdentifier, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<ArrayBuffer>;\\n    encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<ArrayBuffer>;\\n    exportKey(format: \\\"jwk\\\", key: CryptoKey): Promise<JsonWebKey>;\\n    exportKey(format: \\\"raw\\\" | \\\"pkcs8\\\" | \\\"spki\\\", key: CryptoKey): Promise<ArrayBuffer>;\\n    exportKey(format: string, key: CryptoKey): Promise<JsonWebKey | ArrayBuffer>;\\n    generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;\\n    generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;\\n    generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;\\n    importKey(format: \\\"jwk\\\", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;\\n    importKey(format: \\\"raw\\\" | \\\"pkcs8\\\" | \\\"spki\\\", keyData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;\\n    importKey(format: string, keyData: JsonWebKey | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;\\n    sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<ArrayBuffer>;\\n    unwrapKey(format: \\\"raw\\\" | \\\"pkcs8\\\" | \\\"spki\\\" | \\\"jwk\\\" | string, wrappedKey: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;\\n    verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<boolean>;\\n    wrapKey(format: \\\"raw\\\" | \\\"pkcs8\\\" | \\\"spki\\\" | \\\"jwk\\\" | string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams): Promise<ArrayBuffer>;\\n}\\n\\ndeclare var SubtleCrypto: {\\n    prototype: SubtleCrypto;\\n    new(): SubtleCrypto;\\n};\\n\\n/** This ServiceWorker API interface provides an interface for registering and listing sync registrations. */\\ninterface SyncManager {\\n    getTags(): Promise<string[]>;\\n    register(tag: string): Promise<void>;\\n}\\n\\ndeclare var SyncManager: {\\n    prototype: SyncManager;\\n    new(): SyncManager;\\n};\\n\\n/** The textual content of Element or Attr. If an element has no markup within its content, it has a single child implementing Text that contains the element's text. However, if the element contains markup, it is parsed into information items and Text nodes that form its children. */\\ninterface Text extends CharacterData, Slottable {\\n    readonly assignedSlot: HTMLSlotElement | null;\\n    /**\\n     * Returns the combined data of all direct Text node siblings.\\n     */\\n    readonly wholeText: string;\\n    /**\\n     * Splits data at the given offset and returns the remainder as Text node.\\n     */\\n    splitText(offset: number): Text;\\n}\\n\\ndeclare var Text: {\\n    prototype: Text;\\n    new(data?: string): Text;\\n};\\n\\n/** A decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc. A decoder takes a stream of bytes as input and emits a stream of code points. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays. */\\ninterface TextDecoder extends TextDecoderCommon {\\n    /**\\n     * Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented input. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.\\n     * \\n     * ```\\n     * var string = \\\"\\\", decoder = new TextDecoder(encoding), buffer;\\n     * while(buffer = next_chunk()) {\\n     *   string += decoder.decode(buffer, {stream:true});\\n     * }\\n     * string += decoder.decode(); // end-of-queue\\n     * ```\\n     * \\n     * If the error mode is \\\"fatal\\\" and encoding's decoder returns error, throws a TypeError.\\n     */\\n    decode(input?: BufferSource, options?: TextDecodeOptions): string;\\n}\\n\\ndeclare var TextDecoder: {\\n    prototype: TextDecoder;\\n    new(label?: string, options?: TextDecoderOptions): TextDecoder;\\n};\\n\\ninterface TextDecoderCommon {\\n    /**\\n     * Returns encoding's name, lowercased.\\n     */\\n    readonly encoding: string;\\n    /**\\n     * Returns true if error mode is \\\"fatal\\\", otherwise false.\\n     */\\n    readonly fatal: boolean;\\n    /**\\n     * Returns the value of ignore BOM.\\n     */\\n    readonly ignoreBOM: boolean;\\n}\\n\\ninterface TextDecoderStream extends GenericTransformStream, TextDecoderCommon {\\n    readonly readable: ReadableStream<string>;\\n    readonly writable: WritableStream<BufferSource>;\\n}\\n\\ndeclare var TextDecoderStream: {\\n    prototype: TextDecoderStream;\\n    new(label?: string, options?: TextDecoderOptions): TextDecoderStream;\\n};\\n\\n/** TextEncoder takes a stream of code points as input and emits a stream of bytes. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays. */\\ninterface TextEncoder extends TextEncoderCommon {\\n    /**\\n     * Returns the result of running UTF-8's encoder.\\n     */\\n    encode(input?: string): Uint8Array;\\n    /**\\n     * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination.\\n     */\\n    encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult;\\n}\\n\\ndeclare var TextEncoder: {\\n    prototype: TextEncoder;\\n    new(): TextEncoder;\\n};\\n\\ninterface TextEncoderCommon {\\n    /**\\n     * Returns \\\"utf-8\\\".\\n     */\\n    readonly encoding: string;\\n}\\n\\ninterface TextEncoderStream extends GenericTransformStream, TextEncoderCommon {\\n    readonly readable: ReadableStream<Uint8Array>;\\n    readonly writable: WritableStream<string>;\\n}\\n\\ndeclare var TextEncoderStream: {\\n    prototype: TextEncoderStream;\\n    new(): TextEncoderStream;\\n};\\n\\ninterface TextEvent extends UIEvent {\\n    readonly data: string;\\n    initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void;\\n    readonly DOM_INPUT_METHOD_DROP: number;\\n    readonly DOM_INPUT_METHOD_HANDWRITING: number;\\n    readonly DOM_INPUT_METHOD_IME: number;\\n    readonly DOM_INPUT_METHOD_KEYBOARD: number;\\n    readonly DOM_INPUT_METHOD_MULTIMODAL: number;\\n    readonly DOM_INPUT_METHOD_OPTION: number;\\n    readonly DOM_INPUT_METHOD_PASTE: number;\\n    readonly DOM_INPUT_METHOD_SCRIPT: number;\\n    readonly DOM_INPUT_METHOD_UNKNOWN: number;\\n    readonly DOM_INPUT_METHOD_VOICE: number;\\n}\\n\\ndeclare var TextEvent: {\\n    prototype: TextEvent;\\n    new(): TextEvent;\\n    readonly DOM_INPUT_METHOD_DROP: number;\\n    readonly DOM_INPUT_METHOD_HANDWRITING: number;\\n    readonly DOM_INPUT_METHOD_IME: number;\\n    readonly DOM_INPUT_METHOD_KEYBOARD: number;\\n    readonly DOM_INPUT_METHOD_MULTIMODAL: number;\\n    readonly DOM_INPUT_METHOD_OPTION: number;\\n    readonly DOM_INPUT_METHOD_PASTE: number;\\n    readonly DOM_INPUT_METHOD_SCRIPT: number;\\n    readonly DOM_INPUT_METHOD_UNKNOWN: number;\\n    readonly DOM_INPUT_METHOD_VOICE: number;\\n};\\n\\n/** The dimensions of a piece of text in the canvas, as created by the CanvasRenderingContext2D.measureText() method. */\\ninterface TextMetrics {\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly actualBoundingBoxAscent: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly actualBoundingBoxDescent: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly actualBoundingBoxLeft: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly actualBoundingBoxRight: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly alphabeticBaseline: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly emHeightAscent: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly emHeightDescent: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly fontBoundingBoxAscent: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly fontBoundingBoxDescent: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly hangingBaseline: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly ideographicBaseline: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly width: number;\\n}\\n\\ndeclare var TextMetrics: {\\n    prototype: TextMetrics;\\n    new(): TextMetrics;\\n};\\n\\ninterface TextTrackEventMap {\\n    \\\"cuechange\\\": Event;\\n}\\n\\n/** This interface also inherits properties from EventTarget. */\\ninterface TextTrack extends EventTarget {\\n    /**\\n     * Returns the text track cues from the text track list of cues that are currently active (i.e. that start before the current playback position and end after it), as a TextTrackCueList object.\\n     */\\n    readonly activeCues: TextTrackCueList | null;\\n    /**\\n     * Returns the text track list of cues, as a TextTrackCueList object.\\n     */\\n    readonly cues: TextTrackCueList | null;\\n    /**\\n     * Returns the ID of the given track.\\n     * \\n     * For in-band tracks, this is the ID that can be used with a fragment if the format supports media fragment syntax, and that can be used with the getTrackById() method.\\n     * \\n     * For TextTrack objects corresponding to track elements, this is the ID of the track element.\\n     */\\n    readonly id: string;\\n    /**\\n     * Returns the text track in-band metadata track dispatch type string.\\n     */\\n    readonly inBandMetadataTrackDispatchType: string;\\n    /**\\n     * Returns the text track kind string.\\n     */\\n    readonly kind: TextTrackKind;\\n    /**\\n     * Returns the text track label, if there is one, or the empty string otherwise (indicating that a custom label probably needs to be generated from the other attributes of the object if the object is exposed to the user).\\n     */\\n    readonly label: string;\\n    /**\\n     * Returns the text track language string.\\n     */\\n    readonly language: string;\\n    /**\\n     * Returns the text track mode, represented by a string from the following list:\\n     * \\n     * Can be set, to change the mode.\\n     */\\n    mode: TextTrackMode;\\n    oncuechange: ((this: TextTrack, ev: Event) => any) | null;\\n    readonly sourceBuffer: SourceBuffer | null;\\n    /**\\n     * Adds the given cue to textTrack's text track list of cues.\\n     */\\n    addCue(cue: TextTrackCue): void;\\n    /**\\n     * Removes the given cue from textTrack's text track list of cues.\\n     */\\n    removeCue(cue: TextTrackCue): void;\\n    addEventListener<K extends keyof TextTrackEventMap>(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof TextTrackEventMap>(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var TextTrack: {\\n    prototype: TextTrack;\\n    new(): TextTrack;\\n};\\n\\ninterface TextTrackCueEventMap {\\n    \\\"enter\\\": Event;\\n    \\\"exit\\\": Event;\\n}\\n\\n/** TextTrackCues represent a string of text that will be displayed for some duration of time on a TextTrack. This includes the start and end times that the cue will be displayed. A TextTrackCue cannot be used directly, instead one of the derived types (e.g. VTTCue) must be used. */\\ninterface TextTrackCue extends EventTarget {\\n    /**\\n     * Returns the text track cue end time, in seconds.\\n     * \\n     * Can be set.\\n     */\\n    endTime: number;\\n    /**\\n     * Returns the text track cue identifier.\\n     * \\n     * Can be set.\\n     */\\n    id: string;\\n    onenter: ((this: TextTrackCue, ev: Event) => any) | null;\\n    onexit: ((this: TextTrackCue, ev: Event) => any) | null;\\n    /**\\n     * Returns true if the text track cue pause-on-exit flag is set, false otherwise.\\n     * \\n     * Can be set.\\n     */\\n    pauseOnExit: boolean;\\n    /**\\n     * Returns the text track cue start time, in seconds.\\n     * \\n     * Can be set.\\n     */\\n    startTime: number;\\n    /**\\n     * Returns the TextTrack object to which this text track cue belongs, if any, or null otherwise.\\n     */\\n    readonly track: TextTrack | null;\\n    addEventListener<K extends keyof TextTrackCueEventMap>(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof TextTrackCueEventMap>(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var TextTrackCue: {\\n    prototype: TextTrackCue;\\n    new(): TextTrackCue;\\n};\\n\\ninterface TextTrackCueList {\\n    /**\\n     * Returns the number of cues in the list.\\n     */\\n    readonly length: number;\\n    /**\\n     * Returns the first text track cue (in text track cue order) with text track cue identifier id.\\n     * \\n     * Returns null if none of the cues have the given identifier or if the argument is the empty string.\\n     */\\n    getCueById(id: string): TextTrackCue | null;\\n    [index: number]: TextTrackCue;\\n}\\n\\ndeclare var TextTrackCueList: {\\n    prototype: TextTrackCueList;\\n    new(): TextTrackCueList;\\n};\\n\\ninterface TextTrackListEventMap {\\n    \\\"addtrack\\\": TrackEvent;\\n    \\\"change\\\": Event;\\n    \\\"removetrack\\\": TrackEvent;\\n}\\n\\ninterface TextTrackList extends EventTarget {\\n    readonly length: number;\\n    onaddtrack: ((this: TextTrackList, ev: TrackEvent) => any) | null;\\n    onchange: ((this: TextTrackList, ev: Event) => any) | null;\\n    onremovetrack: ((this: TextTrackList, ev: TrackEvent) => any) | null;\\n    getTrackById(id: string): TextTrack | null;\\n    addEventListener<K extends keyof TextTrackListEventMap>(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof TextTrackListEventMap>(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n    [index: number]: TextTrack;\\n}\\n\\ndeclare var TextTrackList: {\\n    prototype: TextTrackList;\\n    new(): TextTrackList;\\n};\\n\\n/** Used to represent a set of time ranges, primarily for the purpose of tracking which portions of media have been buffered when loading it for use by the <audio> and <video> elements. */\\ninterface TimeRanges {\\n    /**\\n     * Returns the number of ranges in the object.\\n     */\\n    readonly length: number;\\n    /**\\n     * Returns the time for the end of the range with the given index.\\n     * \\n     * Throws an \\\"IndexSizeError\\\" DOMException if the index is out of range.\\n     */\\n    end(index: number): number;\\n    /**\\n     * Returns the time for the start of the range with the given index.\\n     * \\n     * Throws an \\\"IndexSizeError\\\" DOMException if the index is out of range.\\n     */\\n    start(index: number): number;\\n}\\n\\ndeclare var TimeRanges: {\\n    prototype: TimeRanges;\\n    new(): TimeRanges;\\n};\\n\\n/** A single contact point on a touch-sensitive device. The contact point is commonly a finger or stylus and the device may be a touchscreen or trackpad. */\\ninterface Touch {\\n    readonly altitudeAngle: number;\\n    readonly azimuthAngle: number;\\n    readonly clientX: number;\\n    readonly clientY: number;\\n    readonly force: number;\\n    readonly identifier: number;\\n    readonly pageX: number;\\n    readonly pageY: number;\\n    readonly radiusX: number;\\n    readonly radiusY: number;\\n    readonly rotationAngle: number;\\n    readonly screenX: number;\\n    readonly screenY: number;\\n    readonly target: EventTarget;\\n    readonly touchType: TouchType;\\n}\\n\\ndeclare var Touch: {\\n    prototype: Touch;\\n    new(touchInitDict: TouchInit): Touch;\\n};\\n\\n/** An event sent when the state of contacts with a touch-sensitive surface changes. This surface can be a touch screen or trackpad, for example. The event can describe one or more points of contact with the screen and includes support for detecting movement, addition and removal of contact points, and so forth. */\\ninterface TouchEvent extends UIEvent {\\n    readonly altKey: boolean;\\n    readonly changedTouches: TouchList;\\n    readonly ctrlKey: boolean;\\n    readonly metaKey: boolean;\\n    readonly shiftKey: boolean;\\n    readonly targetTouches: TouchList;\\n    readonly touches: TouchList;\\n}\\n\\ndeclare var TouchEvent: {\\n    prototype: TouchEvent;\\n    new(type: string, eventInitDict?: TouchEventInit): TouchEvent;\\n};\\n\\n/** A list of contact points on a touch surface. For example, if the user has three fingers on the touch surface (such as a screen or trackpad), the corresponding TouchList object would have one Touch object for each finger, for a total of three entries. */\\ninterface TouchList {\\n    readonly length: number;\\n    item(index: number): Touch | null;\\n    [index: number]: Touch;\\n}\\n\\ndeclare var TouchList: {\\n    prototype: TouchList;\\n    new(): TouchList;\\n};\\n\\n/** The TrackEvent interface, part of the HTML DOM specification, is used for events which represent changes to the set of available tracks on an HTML media element; these events are addtrack and removetrack. */\\ninterface TrackEvent extends Event {\\n    /**\\n     * Returns the track object (TextTrack, AudioTrack, or VideoTrack) to which the event relates.\\n     */\\n    readonly track: TextTrack | null;\\n}\\n\\ndeclare var TrackEvent: {\\n    prototype: TrackEvent;\\n    new(type: string, eventInitDict?: TrackEventInit): TrackEvent;\\n};\\n\\ninterface TransformStream<I = any, O = any> {\\n    readonly readable: ReadableStream<O>;\\n    readonly writable: WritableStream<I>;\\n}\\n\\ndeclare var TransformStream: {\\n    prototype: TransformStream;\\n    new<I = any, O = any>(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>): TransformStream<I, O>;\\n};\\n\\ninterface TransformStreamDefaultController<O = any> {\\n    readonly desiredSize: number | null;\\n    enqueue(chunk: O): void;\\n    error(reason?: any): void;\\n    terminate(): void;\\n}\\n\\ndeclare var TransformStreamDefaultController: {\\n    prototype: TransformStreamDefaultController;\\n    new(): TransformStreamDefaultController;\\n};\\n\\n/** Events providing information related to transitions. */\\ninterface TransitionEvent extends Event {\\n    readonly elapsedTime: number;\\n    readonly propertyName: string;\\n    readonly pseudoElement: string;\\n}\\n\\ndeclare var TransitionEvent: {\\n    prototype: TransitionEvent;\\n    new(type: string, transitionEventInitDict?: TransitionEventInit): TransitionEvent;\\n};\\n\\n/** The nodes of a document subtree and a position within them. */\\ninterface TreeWalker {\\n    currentNode: Node;\\n    readonly filter: NodeFilter | null;\\n    readonly root: Node;\\n    readonly whatToShow: number;\\n    firstChild(): Node | null;\\n    lastChild(): Node | null;\\n    nextNode(): Node | null;\\n    nextSibling(): Node | null;\\n    parentNode(): Node | null;\\n    previousNode(): Node | null;\\n    previousSibling(): Node | null;\\n}\\n\\ndeclare var TreeWalker: {\\n    prototype: TreeWalker;\\n    new(): TreeWalker;\\n};\\n\\n/** Simple user interface events. */\\ninterface UIEvent extends Event {\\n    readonly detail: number;\\n    readonly view: Window | null;\\n    /** @deprecated */\\n    readonly which: number;\\n}\\n\\ndeclare var UIEvent: {\\n    prototype: UIEvent;\\n    new(type: string, eventInitDict?: UIEventInit): UIEvent;\\n};\\n\\n/** The URL interface represents an object providing static methods used for creating object URLs. */\\ninterface URL {\\n    hash: string;\\n    host: string;\\n    hostname: string;\\n    href: string;\\n    toString(): string;\\n    readonly origin: string;\\n    password: string;\\n    pathname: string;\\n    port: string;\\n    protocol: string;\\n    search: string;\\n    readonly searchParams: URLSearchParams;\\n    username: string;\\n    toJSON(): string;\\n}\\n\\ndeclare var URL: {\\n    prototype: URL;\\n    new(url: string, base?: string | URL): URL;\\n    createObjectURL(object: any): string;\\n    revokeObjectURL(url: string): void;\\n};\\n\\ntype webkitURL = URL;\\ndeclare var webkitURL: typeof URL;\\n\\ninterface URLSearchParams {\\n    /**\\n     * Appends a specified key/value pair as a new search parameter.\\n     */\\n    append(name: string, value: string): void;\\n    /**\\n     * Deletes the given search parameter, and its associated value, from the list of all search parameters.\\n     */\\n    delete(name: string): void;\\n    /**\\n     * Returns the first value associated to the given search parameter.\\n     */\\n    get(name: string): string | null;\\n    /**\\n     * Returns all the values association with a given search parameter.\\n     */\\n    getAll(name: string): string[];\\n    /**\\n     * Returns a Boolean indicating if such a search parameter exists.\\n     */\\n    has(name: string): boolean;\\n    /**\\n     * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.\\n     */\\n    set(name: string, value: string): void;\\n    sort(): void;\\n    /**\\n     * Returns a string containing a query string suitable for use in a URL. Does not include the question mark.\\n     */\\n    toString(): string;\\n    forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void;\\n}\\n\\ndeclare var URLSearchParams: {\\n    prototype: URLSearchParams;\\n    new(init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;\\n    toString(): string;\\n};\\n\\n/** This WebVR API interface represents any VR device supported by this API. It includes generic information such as device IDs and descriptions, as well as methods for starting to present a VR scene, retrieving eye parameters and display capabilities, and other important functionality. */\\ninterface VRDisplay extends EventTarget {\\n    readonly capabilities: VRDisplayCapabilities;\\n    depthFar: number;\\n    depthNear: number;\\n    readonly displayId: number;\\n    readonly displayName: string;\\n    readonly isConnected: boolean;\\n    readonly isPresenting: boolean;\\n    readonly stageParameters: VRStageParameters | null;\\n    cancelAnimationFrame(handle: number): void;\\n    exitPresent(): Promise<void>;\\n    getEyeParameters(whichEye: string): VREyeParameters;\\n    getFrameData(frameData: VRFrameData): boolean;\\n    getLayers(): VRLayer[];\\n    /** @deprecated */\\n    getPose(): VRPose;\\n    requestAnimationFrame(callback: FrameRequestCallback): number;\\n    requestPresent(layers: VRLayer[]): Promise<void>;\\n    resetPose(): void;\\n    submitFrame(pose?: VRPose): void;\\n}\\n\\ndeclare var VRDisplay: {\\n    prototype: VRDisplay;\\n    new(): VRDisplay;\\n};\\n\\n/** This WebVR API interface describes the capabilities of a VRDisplay — its features can be used to perform VR device capability tests, for example can it return position information. */\\ninterface VRDisplayCapabilities {\\n    readonly canPresent: boolean;\\n    readonly hasExternalDisplay: boolean;\\n    readonly hasOrientation: boolean;\\n    readonly hasPosition: boolean;\\n    readonly maxLayers: number;\\n}\\n\\ndeclare var VRDisplayCapabilities: {\\n    prototype: VRDisplayCapabilities;\\n    new(): VRDisplayCapabilities;\\n};\\n\\n/** This WebVR API interface represents represents the event object of WebVR-related events (see the list of WebVR window extensions). */\\ninterface VRDisplayEvent extends Event {\\n    readonly display: VRDisplay;\\n    readonly reason: VRDisplayEventReason | null;\\n}\\n\\ndeclare var VRDisplayEvent: {\\n    prototype: VRDisplayEvent;\\n    new(type: string, eventInitDict: VRDisplayEventInit): VRDisplayEvent;\\n};\\n\\n/** This WebVR API interface represents all the information required to correctly render a scene for a given eye, including field of view information. */\\ninterface VREyeParameters {\\n    /** @deprecated */\\n    readonly fieldOfView: VRFieldOfView;\\n    readonly offset: Float32Array;\\n    readonly renderHeight: number;\\n    readonly renderWidth: number;\\n}\\n\\ndeclare var VREyeParameters: {\\n    prototype: VREyeParameters;\\n    new(): VREyeParameters;\\n};\\n\\n/** This WebVR API interface represents a field of view defined by 4 different degree values describing the view from a center point. */\\ninterface VRFieldOfView {\\n    readonly downDegrees: number;\\n    readonly leftDegrees: number;\\n    readonly rightDegrees: number;\\n    readonly upDegrees: number;\\n}\\n\\ndeclare var VRFieldOfView: {\\n    prototype: VRFieldOfView;\\n    new(): VRFieldOfView;\\n};\\n\\n/** This WebVR API interface represents all the information needed to render a single frame of a VR scene; constructed by VRDisplay.getFrameData(). */\\ninterface VRFrameData {\\n    readonly leftProjectionMatrix: Float32Array;\\n    readonly leftViewMatrix: Float32Array;\\n    readonly pose: VRPose;\\n    readonly rightProjectionMatrix: Float32Array;\\n    readonly rightViewMatrix: Float32Array;\\n    readonly timestamp: number;\\n}\\n\\ndeclare var VRFrameData: {\\n    prototype: VRFrameData;\\n    new(): VRFrameData;\\n};\\n\\n/** This WebVR API interface represents the state of a VR sensor at a given timestamp (which includes orientation, position, velocity, and acceleration information.) */\\ninterface VRPose {\\n    readonly angularAcceleration: Float32Array | null;\\n    readonly angularVelocity: Float32Array | null;\\n    readonly linearAcceleration: Float32Array | null;\\n    readonly linearVelocity: Float32Array | null;\\n    readonly orientation: Float32Array | null;\\n    readonly position: Float32Array | null;\\n    readonly timestamp: number;\\n}\\n\\ndeclare var VRPose: {\\n    prototype: VRPose;\\n    new(): VRPose;\\n};\\n\\ninterface VTTCue extends TextTrackCue {\\n    align: AlignSetting;\\n    line: LineAndPositionSetting;\\n    lineAlign: LineAlignSetting;\\n    position: LineAndPositionSetting;\\n    positionAlign: PositionAlignSetting;\\n    region: VTTRegion | null;\\n    size: number;\\n    snapToLines: boolean;\\n    text: string;\\n    vertical: DirectionSetting;\\n    getCueAsHTML(): DocumentFragment;\\n    addEventListener<K extends keyof TextTrackCueEventMap>(type: K, listener: (this: VTTCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof TextTrackCueEventMap>(type: K, listener: (this: VTTCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var VTTCue: {\\n    prototype: VTTCue;\\n    new(startTime: number, endTime: number, text: string): VTTCue;\\n};\\n\\ninterface VTTRegion {\\n    id: string;\\n    lines: number;\\n    regionAnchorX: number;\\n    regionAnchorY: number;\\n    scroll: ScrollSetting;\\n    viewportAnchorX: number;\\n    viewportAnchorY: number;\\n    width: number;\\n}\\n\\ndeclare var VTTRegion: {\\n    prototype: VTTRegion;\\n    new(): VTTRegion;\\n};\\n\\n/** The validity states that an element can be in, with respect to constraint validation. Together, they help explain why an element's value fails to validate, if it's not valid. */\\ninterface ValidityState {\\n    readonly badInput: boolean;\\n    readonly customError: boolean;\\n    readonly patternMismatch: boolean;\\n    readonly rangeOverflow: boolean;\\n    readonly rangeUnderflow: boolean;\\n    readonly stepMismatch: boolean;\\n    readonly tooLong: boolean;\\n    readonly tooShort: boolean;\\n    readonly typeMismatch: boolean;\\n    readonly valid: boolean;\\n    readonly valueMissing: boolean;\\n}\\n\\ndeclare var ValidityState: {\\n    prototype: ValidityState;\\n    new(): ValidityState;\\n};\\n\\n/** Returned by the HTMLVideoElement.getVideoPlaybackQuality() method and contains metrics that can be used to determine the playback quality of a video. */\\ninterface VideoPlaybackQuality {\\n    readonly creationTime: number;\\n    readonly droppedVideoFrames: number;\\n    readonly totalVideoFrames: number;\\n}\\n\\ndeclare var VideoPlaybackQuality: {\\n    prototype: VideoPlaybackQuality;\\n    new(): VideoPlaybackQuality;\\n};\\n\\ninterface VisualViewportEventMap {\\n    \\\"resize\\\": UIEvent;\\n    \\\"scroll\\\": Event;\\n}\\n\\ninterface VisualViewport extends EventTarget {\\n    readonly height: number;\\n    readonly offsetLeft: number;\\n    readonly offsetTop: number;\\n    onresize: ((this: VisualViewport, ev: UIEvent) => any) | null;\\n    onscroll: ((this: VisualViewport, ev: Event) => any) | null;\\n    readonly pageLeft: number;\\n    readonly pageTop: number;\\n    readonly scale: number;\\n    readonly width: number;\\n    addEventListener<K extends keyof VisualViewportEventMap>(type: K, listener: (this: VisualViewport, ev: VisualViewportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof VisualViewportEventMap>(type: K, listener: (this: VisualViewport, ev: VisualViewportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var VisualViewport: {\\n    prototype: VisualViewport;\\n    new(): VisualViewport;\\n};\\n\\ninterface WEBGL_color_buffer_float {\\n    readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum;\\n    readonly RGBA32F_EXT: GLenum;\\n    readonly UNSIGNED_NORMALIZED_EXT: GLenum;\\n}\\n\\ninterface WEBGL_compressed_texture_astc {\\n    getSupportedProfiles(): string[];\\n    readonly COMPRESSED_RGBA_ASTC_10x10_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_10x5_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_10x6_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_10x8_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_12x10_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_12x12_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_4x4_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_5x4_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_5x5_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_6x5_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_6x6_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_8x5_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_8x6_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_8x8_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: GLenum;\\n}\\n\\n/** The WEBGL_compressed_texture_s3tc extension is part of the WebGL API and exposes four S3TC compressed texture formats. */\\ninterface WEBGL_compressed_texture_s3tc {\\n    readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: GLenum;\\n    readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: GLenum;\\n    readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: GLenum;\\n    readonly COMPRESSED_RGB_S3TC_DXT1_EXT: GLenum;\\n}\\n\\ninterface WEBGL_compressed_texture_s3tc_srgb {\\n    readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: GLenum;\\n    readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: GLenum;\\n    readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: GLenum;\\n    readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: GLenum;\\n}\\n\\n/** The WEBGL_debug_renderer_info extension is part of the WebGL API and exposes two constants with information about the graphics driver for debugging purposes. */\\ninterface WEBGL_debug_renderer_info {\\n    readonly UNMASKED_RENDERER_WEBGL: GLenum;\\n    readonly UNMASKED_VENDOR_WEBGL: GLenum;\\n}\\n\\ninterface WEBGL_debug_shaders {\\n    getTranslatedShaderSource(shader: WebGLShader): string;\\n}\\n\\n/** The WEBGL_depth_texture extension is part of the WebGL API and defines 2D depth and depth-stencil textures. */\\ninterface WEBGL_depth_texture {\\n    readonly UNSIGNED_INT_24_8_WEBGL: GLenum;\\n}\\n\\ninterface WEBGL_draw_buffers {\\n    drawBuffersWEBGL(buffers: GLenum[]): void;\\n    readonly COLOR_ATTACHMENT0_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT10_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT11_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT12_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT13_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT14_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT15_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT1_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT2_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT3_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT4_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT5_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT6_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT7_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT8_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT9_WEBGL: GLenum;\\n    readonly DRAW_BUFFER0_WEBGL: GLenum;\\n    readonly DRAW_BUFFER10_WEBGL: GLenum;\\n    readonly DRAW_BUFFER11_WEBGL: GLenum;\\n    readonly DRAW_BUFFER12_WEBGL: GLenum;\\n    readonly DRAW_BUFFER13_WEBGL: GLenum;\\n    readonly DRAW_BUFFER14_WEBGL: GLenum;\\n    readonly DRAW_BUFFER15_WEBGL: GLenum;\\n    readonly DRAW_BUFFER1_WEBGL: GLenum;\\n    readonly DRAW_BUFFER2_WEBGL: GLenum;\\n    readonly DRAW_BUFFER3_WEBGL: GLenum;\\n    readonly DRAW_BUFFER4_WEBGL: GLenum;\\n    readonly DRAW_BUFFER5_WEBGL: GLenum;\\n    readonly DRAW_BUFFER6_WEBGL: GLenum;\\n    readonly DRAW_BUFFER7_WEBGL: GLenum;\\n    readonly DRAW_BUFFER8_WEBGL: GLenum;\\n    readonly DRAW_BUFFER9_WEBGL: GLenum;\\n    readonly MAX_COLOR_ATTACHMENTS_WEBGL: GLenum;\\n    readonly MAX_DRAW_BUFFERS_WEBGL: GLenum;\\n}\\n\\ninterface WEBGL_lose_context {\\n    loseContext(): void;\\n    restoreContext(): void;\\n}\\n\\n/** A WaveShaperNode always has exactly one input and one output. */\\ninterface WaveShaperNode extends AudioNode {\\n    curve: Float32Array | null;\\n    oversample: OverSampleType;\\n}\\n\\ndeclare var WaveShaperNode: {\\n    prototype: WaveShaperNode;\\n    new(context: BaseAudioContext, options?: WaveShaperOptions): WaveShaperNode;\\n};\\n\\ninterface WebAuthentication {\\n    getAssertion(assertionChallenge: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: AssertionOptions): Promise<WebAuthnAssertion>;\\n    makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: ScopedCredentialOptions): Promise<ScopedCredentialInfo>;\\n}\\n\\ndeclare var WebAuthentication: {\\n    prototype: WebAuthentication;\\n    new(): WebAuthentication;\\n};\\n\\ninterface WebAuthnAssertion {\\n    readonly authenticatorData: ArrayBuffer;\\n    readonly clientData: ArrayBuffer;\\n    readonly credential: ScopedCredential;\\n    readonly signature: ArrayBuffer;\\n}\\n\\ndeclare var WebAuthnAssertion: {\\n    prototype: WebAuthnAssertion;\\n    new(): WebAuthnAssertion;\\n};\\n\\ninterface WebGL2RenderingContext extends WebGL2RenderingContextBase, WebGL2RenderingContextOverloads, WebGLRenderingContextBase {\\n}\\n\\ndeclare var WebGL2RenderingContext: {\\n    prototype: WebGL2RenderingContext;\\n    new(): WebGL2RenderingContext;\\n    readonly ACTIVE_ATTRIBUTES: GLenum;\\n    readonly ACTIVE_TEXTURE: GLenum;\\n    readonly ACTIVE_UNIFORMS: GLenum;\\n    readonly ALIASED_LINE_WIDTH_RANGE: GLenum;\\n    readonly ALIASED_POINT_SIZE_RANGE: GLenum;\\n    readonly ALPHA: GLenum;\\n    readonly ALPHA_BITS: GLenum;\\n    readonly ALWAYS: GLenum;\\n    readonly ARRAY_BUFFER: GLenum;\\n    readonly ARRAY_BUFFER_BINDING: GLenum;\\n    readonly ATTACHED_SHADERS: GLenum;\\n    readonly BACK: GLenum;\\n    readonly BLEND: GLenum;\\n    readonly BLEND_COLOR: GLenum;\\n    readonly BLEND_DST_ALPHA: GLenum;\\n    readonly BLEND_DST_RGB: GLenum;\\n    readonly BLEND_EQUATION: GLenum;\\n    readonly BLEND_EQUATION_ALPHA: GLenum;\\n    readonly BLEND_EQUATION_RGB: GLenum;\\n    readonly BLEND_SRC_ALPHA: GLenum;\\n    readonly BLEND_SRC_RGB: GLenum;\\n    readonly BLUE_BITS: GLenum;\\n    readonly BOOL: GLenum;\\n    readonly BOOL_VEC2: GLenum;\\n    readonly BOOL_VEC3: GLenum;\\n    readonly BOOL_VEC4: GLenum;\\n    readonly BROWSER_DEFAULT_WEBGL: GLenum;\\n    readonly BUFFER_SIZE: GLenum;\\n    readonly BUFFER_USAGE: GLenum;\\n    readonly BYTE: GLenum;\\n    readonly CCW: GLenum;\\n    readonly CLAMP_TO_EDGE: GLenum;\\n    readonly COLOR_ATTACHMENT0: GLenum;\\n    readonly COLOR_BUFFER_BIT: GLenum;\\n    readonly COLOR_CLEAR_VALUE: GLenum;\\n    readonly COLOR_WRITEMASK: GLenum;\\n    readonly COMPILE_STATUS: GLenum;\\n    readonly COMPRESSED_TEXTURE_FORMATS: GLenum;\\n    readonly CONSTANT_ALPHA: GLenum;\\n    readonly CONSTANT_COLOR: GLenum;\\n    readonly CONTEXT_LOST_WEBGL: GLenum;\\n    readonly CULL_FACE: GLenum;\\n    readonly CULL_FACE_MODE: GLenum;\\n    readonly CURRENT_PROGRAM: GLenum;\\n    readonly CURRENT_VERTEX_ATTRIB: GLenum;\\n    readonly CW: GLenum;\\n    readonly DECR: GLenum;\\n    readonly DECR_WRAP: GLenum;\\n    readonly DELETE_STATUS: GLenum;\\n    readonly DEPTH_ATTACHMENT: GLenum;\\n    readonly DEPTH_BITS: GLenum;\\n    readonly DEPTH_BUFFER_BIT: GLenum;\\n    readonly DEPTH_CLEAR_VALUE: GLenum;\\n    readonly DEPTH_COMPONENT: GLenum;\\n    readonly DEPTH_COMPONENT16: GLenum;\\n    readonly DEPTH_FUNC: GLenum;\\n    readonly DEPTH_RANGE: GLenum;\\n    readonly DEPTH_STENCIL: GLenum;\\n    readonly DEPTH_STENCIL_ATTACHMENT: GLenum;\\n    readonly DEPTH_TEST: GLenum;\\n    readonly DEPTH_WRITEMASK: GLenum;\\n    readonly DITHER: GLenum;\\n    readonly DONT_CARE: GLenum;\\n    readonly DST_ALPHA: GLenum;\\n    readonly DST_COLOR: GLenum;\\n    readonly DYNAMIC_DRAW: GLenum;\\n    readonly ELEMENT_ARRAY_BUFFER: GLenum;\\n    readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum;\\n    readonly EQUAL: GLenum;\\n    readonly FASTEST: GLenum;\\n    readonly FLOAT: GLenum;\\n    readonly FLOAT_MAT2: GLenum;\\n    readonly FLOAT_MAT3: GLenum;\\n    readonly FLOAT_MAT4: GLenum;\\n    readonly FLOAT_VEC2: GLenum;\\n    readonly FLOAT_VEC3: GLenum;\\n    readonly FLOAT_VEC4: GLenum;\\n    readonly FRAGMENT_SHADER: GLenum;\\n    readonly FRAMEBUFFER: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum;\\n    readonly FRAMEBUFFER_BINDING: GLenum;\\n    readonly FRAMEBUFFER_COMPLETE: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum;\\n    readonly FRAMEBUFFER_UNSUPPORTED: GLenum;\\n    readonly FRONT: GLenum;\\n    readonly FRONT_AND_BACK: GLenum;\\n    readonly FRONT_FACE: GLenum;\\n    readonly FUNC_ADD: GLenum;\\n    readonly FUNC_REVERSE_SUBTRACT: GLenum;\\n    readonly FUNC_SUBTRACT: GLenum;\\n    readonly GENERATE_MIPMAP_HINT: GLenum;\\n    readonly GEQUAL: GLenum;\\n    readonly GREATER: GLenum;\\n    readonly GREEN_BITS: GLenum;\\n    readonly HIGH_FLOAT: GLenum;\\n    readonly HIGH_INT: GLenum;\\n    readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum;\\n    readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum;\\n    readonly INCR: GLenum;\\n    readonly INCR_WRAP: GLenum;\\n    readonly INT: GLenum;\\n    readonly INT_VEC2: GLenum;\\n    readonly INT_VEC3: GLenum;\\n    readonly INT_VEC4: GLenum;\\n    readonly INVALID_ENUM: GLenum;\\n    readonly INVALID_FRAMEBUFFER_OPERATION: GLenum;\\n    readonly INVALID_OPERATION: GLenum;\\n    readonly INVALID_VALUE: GLenum;\\n    readonly INVERT: GLenum;\\n    readonly KEEP: GLenum;\\n    readonly LEQUAL: GLenum;\\n    readonly LESS: GLenum;\\n    readonly LINEAR: GLenum;\\n    readonly LINEAR_MIPMAP_LINEAR: GLenum;\\n    readonly LINEAR_MIPMAP_NEAREST: GLenum;\\n    readonly LINES: GLenum;\\n    readonly LINE_LOOP: GLenum;\\n    readonly LINE_STRIP: GLenum;\\n    readonly LINE_WIDTH: GLenum;\\n    readonly LINK_STATUS: GLenum;\\n    readonly LOW_FLOAT: GLenum;\\n    readonly LOW_INT: GLenum;\\n    readonly LUMINANCE: GLenum;\\n    readonly LUMINANCE_ALPHA: GLenum;\\n    readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum;\\n    readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum;\\n    readonly MAX_RENDERBUFFER_SIZE: GLenum;\\n    readonly MAX_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_TEXTURE_SIZE: GLenum;\\n    readonly MAX_VARYING_VECTORS: GLenum;\\n    readonly MAX_VERTEX_ATTRIBS: GLenum;\\n    readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum;\\n    readonly MAX_VIEWPORT_DIMS: GLenum;\\n    readonly MEDIUM_FLOAT: GLenum;\\n    readonly MEDIUM_INT: GLenum;\\n    readonly MIRRORED_REPEAT: GLenum;\\n    readonly NEAREST: GLenum;\\n    readonly NEAREST_MIPMAP_LINEAR: GLenum;\\n    readonly NEAREST_MIPMAP_NEAREST: GLenum;\\n    readonly NEVER: GLenum;\\n    readonly NICEST: GLenum;\\n    readonly NONE: GLenum;\\n    readonly NOTEQUAL: GLenum;\\n    readonly NO_ERROR: GLenum;\\n    readonly ONE: GLenum;\\n    readonly ONE_MINUS_CONSTANT_ALPHA: GLenum;\\n    readonly ONE_MINUS_CONSTANT_COLOR: GLenum;\\n    readonly ONE_MINUS_DST_ALPHA: GLenum;\\n    readonly ONE_MINUS_DST_COLOR: GLenum;\\n    readonly ONE_MINUS_SRC_ALPHA: GLenum;\\n    readonly ONE_MINUS_SRC_COLOR: GLenum;\\n    readonly OUT_OF_MEMORY: GLenum;\\n    readonly PACK_ALIGNMENT: GLenum;\\n    readonly POINTS: GLenum;\\n    readonly POLYGON_OFFSET_FACTOR: GLenum;\\n    readonly POLYGON_OFFSET_FILL: GLenum;\\n    readonly POLYGON_OFFSET_UNITS: GLenum;\\n    readonly RED_BITS: GLenum;\\n    readonly RENDERBUFFER: GLenum;\\n    readonly RENDERBUFFER_ALPHA_SIZE: GLenum;\\n    readonly RENDERBUFFER_BINDING: GLenum;\\n    readonly RENDERBUFFER_BLUE_SIZE: GLenum;\\n    readonly RENDERBUFFER_DEPTH_SIZE: GLenum;\\n    readonly RENDERBUFFER_GREEN_SIZE: GLenum;\\n    readonly RENDERBUFFER_HEIGHT: GLenum;\\n    readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum;\\n    readonly RENDERBUFFER_RED_SIZE: GLenum;\\n    readonly RENDERBUFFER_STENCIL_SIZE: GLenum;\\n    readonly RENDERBUFFER_WIDTH: GLenum;\\n    readonly RENDERER: GLenum;\\n    readonly REPEAT: GLenum;\\n    readonly REPLACE: GLenum;\\n    readonly RGB: GLenum;\\n    readonly RGB565: GLenum;\\n    readonly RGB5_A1: GLenum;\\n    readonly RGBA: GLenum;\\n    readonly RGBA4: GLenum;\\n    readonly SAMPLER_2D: GLenum;\\n    readonly SAMPLER_CUBE: GLenum;\\n    readonly SAMPLES: GLenum;\\n    readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum;\\n    readonly SAMPLE_BUFFERS: GLenum;\\n    readonly SAMPLE_COVERAGE: GLenum;\\n    readonly SAMPLE_COVERAGE_INVERT: GLenum;\\n    readonly SAMPLE_COVERAGE_VALUE: GLenum;\\n    readonly SCISSOR_BOX: GLenum;\\n    readonly SCISSOR_TEST: GLenum;\\n    readonly SHADER_TYPE: GLenum;\\n    readonly SHADING_LANGUAGE_VERSION: GLenum;\\n    readonly SHORT: GLenum;\\n    readonly SRC_ALPHA: GLenum;\\n    readonly SRC_ALPHA_SATURATE: GLenum;\\n    readonly SRC_COLOR: GLenum;\\n    readonly STATIC_DRAW: GLenum;\\n    readonly STENCIL_ATTACHMENT: GLenum;\\n    readonly STENCIL_BACK_FAIL: GLenum;\\n    readonly STENCIL_BACK_FUNC: GLenum;\\n    readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum;\\n    readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum;\\n    readonly STENCIL_BACK_REF: GLenum;\\n    readonly STENCIL_BACK_VALUE_MASK: GLenum;\\n    readonly STENCIL_BACK_WRITEMASK: GLenum;\\n    readonly STENCIL_BITS: GLenum;\\n    readonly STENCIL_BUFFER_BIT: GLenum;\\n    readonly STENCIL_CLEAR_VALUE: GLenum;\\n    readonly STENCIL_FAIL: GLenum;\\n    readonly STENCIL_FUNC: GLenum;\\n    readonly STENCIL_INDEX8: GLenum;\\n    readonly STENCIL_PASS_DEPTH_FAIL: GLenum;\\n    readonly STENCIL_PASS_DEPTH_PASS: GLenum;\\n    readonly STENCIL_REF: GLenum;\\n    readonly STENCIL_TEST: GLenum;\\n    readonly STENCIL_VALUE_MASK: GLenum;\\n    readonly STENCIL_WRITEMASK: GLenum;\\n    readonly STREAM_DRAW: GLenum;\\n    readonly SUBPIXEL_BITS: GLenum;\\n    readonly TEXTURE: GLenum;\\n    readonly TEXTURE0: GLenum;\\n    readonly TEXTURE1: GLenum;\\n    readonly TEXTURE10: GLenum;\\n    readonly TEXTURE11: GLenum;\\n    readonly TEXTURE12: GLenum;\\n    readonly TEXTURE13: GLenum;\\n    readonly TEXTURE14: GLenum;\\n    readonly TEXTURE15: GLenum;\\n    readonly TEXTURE16: GLenum;\\n    readonly TEXTURE17: GLenum;\\n    readonly TEXTURE18: GLenum;\\n    readonly TEXTURE19: GLenum;\\n    readonly TEXTURE2: GLenum;\\n    readonly TEXTURE20: GLenum;\\n    readonly TEXTURE21: GLenum;\\n    readonly TEXTURE22: GLenum;\\n    readonly TEXTURE23: GLenum;\\n    readonly TEXTURE24: GLenum;\\n    readonly TEXTURE25: GLenum;\\n    readonly TEXTURE26: GLenum;\\n    readonly TEXTURE27: GLenum;\\n    readonly TEXTURE28: GLenum;\\n    readonly TEXTURE29: GLenum;\\n    readonly TEXTURE3: GLenum;\\n    readonly TEXTURE30: GLenum;\\n    readonly TEXTURE31: GLenum;\\n    readonly TEXTURE4: GLenum;\\n    readonly TEXTURE5: GLenum;\\n    readonly TEXTURE6: GLenum;\\n    readonly TEXTURE7: GLenum;\\n    readonly TEXTURE8: GLenum;\\n    readonly TEXTURE9: GLenum;\\n    readonly TEXTURE_2D: GLenum;\\n    readonly TEXTURE_BINDING_2D: GLenum;\\n    readonly TEXTURE_BINDING_CUBE_MAP: GLenum;\\n    readonly TEXTURE_CUBE_MAP: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum;\\n    readonly TEXTURE_MAG_FILTER: GLenum;\\n    readonly TEXTURE_MIN_FILTER: GLenum;\\n    readonly TEXTURE_WRAP_S: GLenum;\\n    readonly TEXTURE_WRAP_T: GLenum;\\n    readonly TRIANGLES: GLenum;\\n    readonly TRIANGLE_FAN: GLenum;\\n    readonly TRIANGLE_STRIP: GLenum;\\n    readonly UNPACK_ALIGNMENT: GLenum;\\n    readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum;\\n    readonly UNPACK_FLIP_Y_WEBGL: GLenum;\\n    readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum;\\n    readonly UNSIGNED_BYTE: GLenum;\\n    readonly UNSIGNED_INT: GLenum;\\n    readonly UNSIGNED_SHORT: GLenum;\\n    readonly UNSIGNED_SHORT_4_4_4_4: GLenum;\\n    readonly UNSIGNED_SHORT_5_5_5_1: GLenum;\\n    readonly UNSIGNED_SHORT_5_6_5: GLenum;\\n    readonly VALIDATE_STATUS: GLenum;\\n    readonly VENDOR: GLenum;\\n    readonly VERSION: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum;\\n    readonly VERTEX_SHADER: GLenum;\\n    readonly VIEWPORT: GLenum;\\n    readonly ZERO: GLenum;\\n    readonly ACTIVE_UNIFORM_BLOCKS: GLenum;\\n    readonly ALREADY_SIGNALED: GLenum;\\n    readonly ANY_SAMPLES_PASSED: GLenum;\\n    readonly ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum;\\n    readonly COLOR: GLenum;\\n    readonly COLOR_ATTACHMENT1: GLenum;\\n    readonly COLOR_ATTACHMENT10: GLenum;\\n    readonly COLOR_ATTACHMENT11: GLenum;\\n    readonly COLOR_ATTACHMENT12: GLenum;\\n    readonly COLOR_ATTACHMENT13: GLenum;\\n    readonly COLOR_ATTACHMENT14: GLenum;\\n    readonly COLOR_ATTACHMENT15: GLenum;\\n    readonly COLOR_ATTACHMENT2: GLenum;\\n    readonly COLOR_ATTACHMENT3: GLenum;\\n    readonly COLOR_ATTACHMENT4: GLenum;\\n    readonly COLOR_ATTACHMENT5: GLenum;\\n    readonly COLOR_ATTACHMENT6: GLenum;\\n    readonly COLOR_ATTACHMENT7: GLenum;\\n    readonly COLOR_ATTACHMENT8: GLenum;\\n    readonly COLOR_ATTACHMENT9: GLenum;\\n    readonly COMPARE_REF_TO_TEXTURE: GLenum;\\n    readonly CONDITION_SATISFIED: GLenum;\\n    readonly COPY_READ_BUFFER: GLenum;\\n    readonly COPY_READ_BUFFER_BINDING: GLenum;\\n    readonly COPY_WRITE_BUFFER: GLenum;\\n    readonly COPY_WRITE_BUFFER_BINDING: GLenum;\\n    readonly CURRENT_QUERY: GLenum;\\n    readonly DEPTH: GLenum;\\n    readonly DEPTH24_STENCIL8: GLenum;\\n    readonly DEPTH32F_STENCIL8: GLenum;\\n    readonly DEPTH_COMPONENT24: GLenum;\\n    readonly DEPTH_COMPONENT32F: GLenum;\\n    readonly DRAW_BUFFER0: GLenum;\\n    readonly DRAW_BUFFER1: GLenum;\\n    readonly DRAW_BUFFER10: GLenum;\\n    readonly DRAW_BUFFER11: GLenum;\\n    readonly DRAW_BUFFER12: GLenum;\\n    readonly DRAW_BUFFER13: GLenum;\\n    readonly DRAW_BUFFER14: GLenum;\\n    readonly DRAW_BUFFER15: GLenum;\\n    readonly DRAW_BUFFER2: GLenum;\\n    readonly DRAW_BUFFER3: GLenum;\\n    readonly DRAW_BUFFER4: GLenum;\\n    readonly DRAW_BUFFER5: GLenum;\\n    readonly DRAW_BUFFER6: GLenum;\\n    readonly DRAW_BUFFER7: GLenum;\\n    readonly DRAW_BUFFER8: GLenum;\\n    readonly DRAW_BUFFER9: GLenum;\\n    readonly DRAW_FRAMEBUFFER: GLenum;\\n    readonly DRAW_FRAMEBUFFER_BINDING: GLenum;\\n    readonly DYNAMIC_COPY: GLenum;\\n    readonly DYNAMIC_READ: GLenum;\\n    readonly FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum;\\n    readonly FLOAT_MAT2x3: GLenum;\\n    readonly FLOAT_MAT2x4: GLenum;\\n    readonly FLOAT_MAT3x2: GLenum;\\n    readonly FLOAT_MAT3x4: GLenum;\\n    readonly FLOAT_MAT4x2: GLenum;\\n    readonly FLOAT_MAT4x3: GLenum;\\n    readonly FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum;\\n    readonly FRAMEBUFFER_DEFAULT: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum;\\n    readonly HALF_FLOAT: GLenum;\\n    readonly INTERLEAVED_ATTRIBS: GLenum;\\n    readonly INT_2_10_10_10_REV: GLenum;\\n    readonly INT_SAMPLER_2D: GLenum;\\n    readonly INT_SAMPLER_2D_ARRAY: GLenum;\\n    readonly INT_SAMPLER_3D: GLenum;\\n    readonly INT_SAMPLER_CUBE: GLenum;\\n    readonly INVALID_INDEX: GLenum;\\n    readonly MAX: GLenum;\\n    readonly MAX_3D_TEXTURE_SIZE: GLenum;\\n    readonly MAX_ARRAY_TEXTURE_LAYERS: GLenum;\\n    readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum;\\n    readonly MAX_COLOR_ATTACHMENTS: GLenum;\\n    readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum;\\n    readonly MAX_COMBINED_UNIFORM_BLOCKS: GLenum;\\n    readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum;\\n    readonly MAX_DRAW_BUFFERS: GLenum;\\n    readonly MAX_ELEMENTS_INDICES: GLenum;\\n    readonly MAX_ELEMENTS_VERTICES: GLenum;\\n    readonly MAX_ELEMENT_INDEX: GLenum;\\n    readonly MAX_FRAGMENT_INPUT_COMPONENTS: GLenum;\\n    readonly MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum;\\n    readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum;\\n    readonly MAX_PROGRAM_TEXEL_OFFSET: GLenum;\\n    readonly MAX_SAMPLES: GLenum;\\n    readonly MAX_SERVER_WAIT_TIMEOUT: GLenum;\\n    readonly MAX_TEXTURE_LOD_BIAS: GLenum;\\n    readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum;\\n    readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum;\\n    readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum;\\n    readonly MAX_UNIFORM_BLOCK_SIZE: GLenum;\\n    readonly MAX_UNIFORM_BUFFER_BINDINGS: GLenum;\\n    readonly MAX_VARYING_COMPONENTS: GLenum;\\n    readonly MAX_VERTEX_OUTPUT_COMPONENTS: GLenum;\\n    readonly MAX_VERTEX_UNIFORM_BLOCKS: GLenum;\\n    readonly MAX_VERTEX_UNIFORM_COMPONENTS: GLenum;\\n    readonly MIN: GLenum;\\n    readonly MIN_PROGRAM_TEXEL_OFFSET: GLenum;\\n    readonly OBJECT_TYPE: GLenum;\\n    readonly PACK_ROW_LENGTH: GLenum;\\n    readonly PACK_SKIP_PIXELS: GLenum;\\n    readonly PACK_SKIP_ROWS: GLenum;\\n    readonly PIXEL_PACK_BUFFER: GLenum;\\n    readonly PIXEL_PACK_BUFFER_BINDING: GLenum;\\n    readonly PIXEL_UNPACK_BUFFER: GLenum;\\n    readonly PIXEL_UNPACK_BUFFER_BINDING: GLenum;\\n    readonly QUERY_RESULT: GLenum;\\n    readonly QUERY_RESULT_AVAILABLE: GLenum;\\n    readonly R11F_G11F_B10F: GLenum;\\n    readonly R16F: GLenum;\\n    readonly R16I: GLenum;\\n    readonly R16UI: GLenum;\\n    readonly R32F: GLenum;\\n    readonly R32I: GLenum;\\n    readonly R32UI: GLenum;\\n    readonly R8: GLenum;\\n    readonly R8I: GLenum;\\n    readonly R8UI: GLenum;\\n    readonly R8_SNORM: GLenum;\\n    readonly RASTERIZER_DISCARD: GLenum;\\n    readonly READ_BUFFER: GLenum;\\n    readonly READ_FRAMEBUFFER: GLenum;\\n    readonly READ_FRAMEBUFFER_BINDING: GLenum;\\n    readonly RED: GLenum;\\n    readonly RED_INTEGER: GLenum;\\n    readonly RENDERBUFFER_SAMPLES: GLenum;\\n    readonly RG: GLenum;\\n    readonly RG16F: GLenum;\\n    readonly RG16I: GLenum;\\n    readonly RG16UI: GLenum;\\n    readonly RG32F: GLenum;\\n    readonly RG32I: GLenum;\\n    readonly RG32UI: GLenum;\\n    readonly RG8: GLenum;\\n    readonly RG8I: GLenum;\\n    readonly RG8UI: GLenum;\\n    readonly RG8_SNORM: GLenum;\\n    readonly RGB10_A2: GLenum;\\n    readonly RGB10_A2UI: GLenum;\\n    readonly RGB16F: GLenum;\\n    readonly RGB16I: GLenum;\\n    readonly RGB16UI: GLenum;\\n    readonly RGB32F: GLenum;\\n    readonly RGB32I: GLenum;\\n    readonly RGB32UI: GLenum;\\n    readonly RGB8: GLenum;\\n    readonly RGB8I: GLenum;\\n    readonly RGB8UI: GLenum;\\n    readonly RGB8_SNORM: GLenum;\\n    readonly RGB9_E5: GLenum;\\n    readonly RGBA16F: GLenum;\\n    readonly RGBA16I: GLenum;\\n    readonly RGBA16UI: GLenum;\\n    readonly RGBA32F: GLenum;\\n    readonly RGBA32I: GLenum;\\n    readonly RGBA32UI: GLenum;\\n    readonly RGBA8: GLenum;\\n    readonly RGBA8I: GLenum;\\n    readonly RGBA8UI: GLenum;\\n    readonly RGBA8_SNORM: GLenum;\\n    readonly RGBA_INTEGER: GLenum;\\n    readonly RGB_INTEGER: GLenum;\\n    readonly RG_INTEGER: GLenum;\\n    readonly SAMPLER_2D_ARRAY: GLenum;\\n    readonly SAMPLER_2D_ARRAY_SHADOW: GLenum;\\n    readonly SAMPLER_2D_SHADOW: GLenum;\\n    readonly SAMPLER_3D: GLenum;\\n    readonly SAMPLER_BINDING: GLenum;\\n    readonly SAMPLER_CUBE_SHADOW: GLenum;\\n    readonly SEPARATE_ATTRIBS: GLenum;\\n    readonly SIGNALED: GLenum;\\n    readonly SIGNED_NORMALIZED: GLenum;\\n    readonly SRGB: GLenum;\\n    readonly SRGB8: GLenum;\\n    readonly SRGB8_ALPHA8: GLenum;\\n    readonly STATIC_COPY: GLenum;\\n    readonly STATIC_READ: GLenum;\\n    readonly STENCIL: GLenum;\\n    readonly STREAM_COPY: GLenum;\\n    readonly STREAM_READ: GLenum;\\n    readonly SYNC_CONDITION: GLenum;\\n    readonly SYNC_FENCE: GLenum;\\n    readonly SYNC_FLAGS: GLenum;\\n    readonly SYNC_FLUSH_COMMANDS_BIT: GLenum;\\n    readonly SYNC_GPU_COMMANDS_COMPLETE: GLenum;\\n    readonly SYNC_STATUS: GLenum;\\n    readonly TEXTURE_2D_ARRAY: GLenum;\\n    readonly TEXTURE_3D: GLenum;\\n    readonly TEXTURE_BASE_LEVEL: GLenum;\\n    readonly TEXTURE_BINDING_2D_ARRAY: GLenum;\\n    readonly TEXTURE_BINDING_3D: GLenum;\\n    readonly TEXTURE_COMPARE_FUNC: GLenum;\\n    readonly TEXTURE_COMPARE_MODE: GLenum;\\n    readonly TEXTURE_IMMUTABLE_FORMAT: GLenum;\\n    readonly TEXTURE_IMMUTABLE_LEVELS: GLenum;\\n    readonly TEXTURE_MAX_LEVEL: GLenum;\\n    readonly TEXTURE_MAX_LOD: GLenum;\\n    readonly TEXTURE_MIN_LOD: GLenum;\\n    readonly TEXTURE_WRAP_R: GLenum;\\n    readonly TIMEOUT_EXPIRED: GLenum;\\n    readonly TIMEOUT_IGNORED: GLint64;\\n    readonly TRANSFORM_FEEDBACK: GLenum;\\n    readonly TRANSFORM_FEEDBACK_ACTIVE: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BINDING: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER_START: GLenum;\\n    readonly TRANSFORM_FEEDBACK_PAUSED: GLenum;\\n    readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum;\\n    readonly TRANSFORM_FEEDBACK_VARYINGS: GLenum;\\n    readonly UNIFORM_ARRAY_STRIDE: GLenum;\\n    readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum;\\n    readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum;\\n    readonly UNIFORM_BLOCK_BINDING: GLenum;\\n    readonly UNIFORM_BLOCK_DATA_SIZE: GLenum;\\n    readonly UNIFORM_BLOCK_INDEX: GLenum;\\n    readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum;\\n    readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum;\\n    readonly UNIFORM_BUFFER: GLenum;\\n    readonly UNIFORM_BUFFER_BINDING: GLenum;\\n    readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum;\\n    readonly UNIFORM_BUFFER_SIZE: GLenum;\\n    readonly UNIFORM_BUFFER_START: GLenum;\\n    readonly UNIFORM_IS_ROW_MAJOR: GLenum;\\n    readonly UNIFORM_MATRIX_STRIDE: GLenum;\\n    readonly UNIFORM_OFFSET: GLenum;\\n    readonly UNIFORM_SIZE: GLenum;\\n    readonly UNIFORM_TYPE: GLenum;\\n    readonly UNPACK_IMAGE_HEIGHT: GLenum;\\n    readonly UNPACK_ROW_LENGTH: GLenum;\\n    readonly UNPACK_SKIP_IMAGES: GLenum;\\n    readonly UNPACK_SKIP_PIXELS: GLenum;\\n    readonly UNPACK_SKIP_ROWS: GLenum;\\n    readonly UNSIGNALED: GLenum;\\n    readonly UNSIGNED_INT_10F_11F_11F_REV: GLenum;\\n    readonly UNSIGNED_INT_24_8: GLenum;\\n    readonly UNSIGNED_INT_2_10_10_10_REV: GLenum;\\n    readonly UNSIGNED_INT_5_9_9_9_REV: GLenum;\\n    readonly UNSIGNED_INT_SAMPLER_2D: GLenum;\\n    readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum;\\n    readonly UNSIGNED_INT_SAMPLER_3D: GLenum;\\n    readonly UNSIGNED_INT_SAMPLER_CUBE: GLenum;\\n    readonly UNSIGNED_INT_VEC2: GLenum;\\n    readonly UNSIGNED_INT_VEC3: GLenum;\\n    readonly UNSIGNED_INT_VEC4: GLenum;\\n    readonly UNSIGNED_NORMALIZED: GLenum;\\n    readonly VERTEX_ARRAY_BINDING: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_INTEGER: GLenum;\\n    readonly WAIT_FAILED: GLenum;\\n};\\n\\ninterface WebGL2RenderingContextBase {\\n    beginQuery(target: GLenum, query: WebGLQuery): void;\\n    beginTransformFeedback(primitiveMode: GLenum): void;\\n    bindBufferBase(target: GLenum, index: GLuint, buffer: WebGLBuffer | null): void;\\n    bindBufferRange(target: GLenum, index: GLuint, buffer: WebGLBuffer | null, offset: GLintptr, size: GLsizeiptr): void;\\n    bindSampler(unit: GLuint, sampler: WebGLSampler | null): void;\\n    bindTransformFeedback(target: GLenum, tf: WebGLTransformFeedback | null): void;\\n    bindVertexArray(array: WebGLVertexArrayObject | null): void;\\n    blitFramebuffer(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum): void;\\n    clearBufferfi(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint): void;\\n    clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Float32List, srcOffset?: GLuint): void;\\n    clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Int32List, srcOffset?: GLuint): void;\\n    clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Uint32List, srcOffset?: GLuint): void;\\n    clientWaitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLuint64): GLenum;\\n    compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr): void;\\n    compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint): void;\\n    compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr): void;\\n    compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint): void;\\n    copyBufferSubData(readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr): void;\\n    copyTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;\\n    createQuery(): WebGLQuery | null;\\n    createSampler(): WebGLSampler | null;\\n    createTransformFeedback(): WebGLTransformFeedback | null;\\n    createVertexArray(): WebGLVertexArrayObject | null;\\n    deleteQuery(query: WebGLQuery | null): void;\\n    deleteSampler(sampler: WebGLSampler | null): void;\\n    deleteSync(sync: WebGLSync | null): void;\\n    deleteTransformFeedback(tf: WebGLTransformFeedback | null): void;\\n    deleteVertexArray(vertexArray: WebGLVertexArrayObject | null): void;\\n    drawArraysInstanced(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei): void;\\n    drawBuffers(buffers: GLenum[]): void;\\n    drawElementsInstanced(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei): void;\\n    drawRangeElements(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type: GLenum, offset: GLintptr): void;\\n    endQuery(target: GLenum): void;\\n    endTransformFeedback(): void;\\n    fenceSync(condition: GLenum, flags: GLbitfield): WebGLSync | null;\\n    framebufferTextureLayer(target: GLenum, attachment: GLenum, texture: WebGLTexture | null, level: GLint, layer: GLint): void;\\n    getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: GLuint): string | null;\\n    getActiveUniformBlockParameter(program: WebGLProgram, uniformBlockIndex: GLuint, pname: GLenum): any;\\n    getActiveUniforms(program: WebGLProgram, uniformIndices: GLuint[], pname: GLenum): any;\\n    getBufferSubData(target: GLenum, srcByteOffset: GLintptr, dstBuffer: ArrayBufferView, dstOffset?: GLuint, length?: GLuint): void;\\n    getFragDataLocation(program: WebGLProgram, name: string): GLint;\\n    getIndexedParameter(target: GLenum, index: GLuint): any;\\n    getInternalformatParameter(target: GLenum, internalformat: GLenum, pname: GLenum): any;\\n    getQuery(target: GLenum, pname: GLenum): WebGLQuery | null;\\n    getQueryParameter(query: WebGLQuery, pname: GLenum): any;\\n    getSamplerParameter(sampler: WebGLSampler, pname: GLenum): any;\\n    getSyncParameter(sync: WebGLSync, pname: GLenum): any;\\n    getTransformFeedbackVarying(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;\\n    getUniformBlockIndex(program: WebGLProgram, uniformBlockName: string): GLuint;\\n    getUniformIndices(program: WebGLProgram, uniformNames: string[]): GLuint[] | null;\\n    invalidateFramebuffer(target: GLenum, attachments: GLenum[]): void;\\n    invalidateSubFramebuffer(target: GLenum, attachments: GLenum[], x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;\\n    isQuery(query: WebGLQuery | null): GLboolean;\\n    isSampler(sampler: WebGLSampler | null): GLboolean;\\n    isSync(sync: WebGLSync | null): GLboolean;\\n    isTransformFeedback(tf: WebGLTransformFeedback | null): GLboolean;\\n    isVertexArray(vertexArray: WebGLVertexArrayObject | null): GLboolean;\\n    pauseTransformFeedback(): void;\\n    readBuffer(src: GLenum): void;\\n    renderbufferStorageMultisample(target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei): void;\\n    resumeTransformFeedback(): void;\\n    samplerParameterf(sampler: WebGLSampler, pname: GLenum, param: GLfloat): void;\\n    samplerParameteri(sampler: WebGLSampler, pname: GLenum, param: GLint): void;\\n    texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr): void;\\n    texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;\\n    texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView | null): void;\\n    texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint): void;\\n    texStorage2D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei): void;\\n    texStorage3D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei): void;\\n    texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr): void;\\n    texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: TexImageSource): void;\\n    texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView | null, srcOffset?: GLuint): void;\\n    transformFeedbackVaryings(program: WebGLProgram, varyings: string[], bufferMode: GLenum): void;\\n    uniform1ui(location: WebGLUniformLocation | null, v0: GLuint): void;\\n    uniform1uiv(location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform2ui(location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint): void;\\n    uniform2uiv(location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform3ui(location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint, v2: GLuint): void;\\n    uniform3uiv(location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform4ui(location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint): void;\\n    uniform4uiv(location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint): void;\\n    uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    vertexAttribDivisor(index: GLuint, divisor: GLuint): void;\\n    vertexAttribI4i(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint): void;\\n    vertexAttribI4iv(index: GLuint, values: Int32List): void;\\n    vertexAttribI4ui(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint): void;\\n    vertexAttribI4uiv(index: GLuint, values: Uint32List): void;\\n    vertexAttribIPointer(index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr): void;\\n    waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64): void;\\n    readonly ACTIVE_UNIFORM_BLOCKS: GLenum;\\n    readonly ALREADY_SIGNALED: GLenum;\\n    readonly ANY_SAMPLES_PASSED: GLenum;\\n    readonly ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum;\\n    readonly COLOR: GLenum;\\n    readonly COLOR_ATTACHMENT1: GLenum;\\n    readonly COLOR_ATTACHMENT10: GLenum;\\n    readonly COLOR_ATTACHMENT11: GLenum;\\n    readonly COLOR_ATTACHMENT12: GLenum;\\n    readonly COLOR_ATTACHMENT13: GLenum;\\n    readonly COLOR_ATTACHMENT14: GLenum;\\n    readonly COLOR_ATTACHMENT15: GLenum;\\n    readonly COLOR_ATTACHMENT2: GLenum;\\n    readonly COLOR_ATTACHMENT3: GLenum;\\n    readonly COLOR_ATTACHMENT4: GLenum;\\n    readonly COLOR_ATTACHMENT5: GLenum;\\n    readonly COLOR_ATTACHMENT6: GLenum;\\n    readonly COLOR_ATTACHMENT7: GLenum;\\n    readonly COLOR_ATTACHMENT8: GLenum;\\n    readonly COLOR_ATTACHMENT9: GLenum;\\n    readonly COMPARE_REF_TO_TEXTURE: GLenum;\\n    readonly CONDITION_SATISFIED: GLenum;\\n    readonly COPY_READ_BUFFER: GLenum;\\n    readonly COPY_READ_BUFFER_BINDING: GLenum;\\n    readonly COPY_WRITE_BUFFER: GLenum;\\n    readonly COPY_WRITE_BUFFER_BINDING: GLenum;\\n    readonly CURRENT_QUERY: GLenum;\\n    readonly DEPTH: GLenum;\\n    readonly DEPTH24_STENCIL8: GLenum;\\n    readonly DEPTH32F_STENCIL8: GLenum;\\n    readonly DEPTH_COMPONENT24: GLenum;\\n    readonly DEPTH_COMPONENT32F: GLenum;\\n    readonly DRAW_BUFFER0: GLenum;\\n    readonly DRAW_BUFFER1: GLenum;\\n    readonly DRAW_BUFFER10: GLenum;\\n    readonly DRAW_BUFFER11: GLenum;\\n    readonly DRAW_BUFFER12: GLenum;\\n    readonly DRAW_BUFFER13: GLenum;\\n    readonly DRAW_BUFFER14: GLenum;\\n    readonly DRAW_BUFFER15: GLenum;\\n    readonly DRAW_BUFFER2: GLenum;\\n    readonly DRAW_BUFFER3: GLenum;\\n    readonly DRAW_BUFFER4: GLenum;\\n    readonly DRAW_BUFFER5: GLenum;\\n    readonly DRAW_BUFFER6: GLenum;\\n    readonly DRAW_BUFFER7: GLenum;\\n    readonly DRAW_BUFFER8: GLenum;\\n    readonly DRAW_BUFFER9: GLenum;\\n    readonly DRAW_FRAMEBUFFER: GLenum;\\n    readonly DRAW_FRAMEBUFFER_BINDING: GLenum;\\n    readonly DYNAMIC_COPY: GLenum;\\n    readonly DYNAMIC_READ: GLenum;\\n    readonly FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum;\\n    readonly FLOAT_MAT2x3: GLenum;\\n    readonly FLOAT_MAT2x4: GLenum;\\n    readonly FLOAT_MAT3x2: GLenum;\\n    readonly FLOAT_MAT3x4: GLenum;\\n    readonly FLOAT_MAT4x2: GLenum;\\n    readonly FLOAT_MAT4x3: GLenum;\\n    readonly FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum;\\n    readonly FRAMEBUFFER_DEFAULT: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum;\\n    readonly HALF_FLOAT: GLenum;\\n    readonly INTERLEAVED_ATTRIBS: GLenum;\\n    readonly INT_2_10_10_10_REV: GLenum;\\n    readonly INT_SAMPLER_2D: GLenum;\\n    readonly INT_SAMPLER_2D_ARRAY: GLenum;\\n    readonly INT_SAMPLER_3D: GLenum;\\n    readonly INT_SAMPLER_CUBE: GLenum;\\n    readonly INVALID_INDEX: GLenum;\\n    readonly MAX: GLenum;\\n    readonly MAX_3D_TEXTURE_SIZE: GLenum;\\n    readonly MAX_ARRAY_TEXTURE_LAYERS: GLenum;\\n    readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum;\\n    readonly MAX_COLOR_ATTACHMENTS: GLenum;\\n    readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum;\\n    readonly MAX_COMBINED_UNIFORM_BLOCKS: GLenum;\\n    readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum;\\n    readonly MAX_DRAW_BUFFERS: GLenum;\\n    readonly MAX_ELEMENTS_INDICES: GLenum;\\n    readonly MAX_ELEMENTS_VERTICES: GLenum;\\n    readonly MAX_ELEMENT_INDEX: GLenum;\\n    readonly MAX_FRAGMENT_INPUT_COMPONENTS: GLenum;\\n    readonly MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum;\\n    readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum;\\n    readonly MAX_PROGRAM_TEXEL_OFFSET: GLenum;\\n    readonly MAX_SAMPLES: GLenum;\\n    readonly MAX_SERVER_WAIT_TIMEOUT: GLenum;\\n    readonly MAX_TEXTURE_LOD_BIAS: GLenum;\\n    readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum;\\n    readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum;\\n    readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum;\\n    readonly MAX_UNIFORM_BLOCK_SIZE: GLenum;\\n    readonly MAX_UNIFORM_BUFFER_BINDINGS: GLenum;\\n    readonly MAX_VARYING_COMPONENTS: GLenum;\\n    readonly MAX_VERTEX_OUTPUT_COMPONENTS: GLenum;\\n    readonly MAX_VERTEX_UNIFORM_BLOCKS: GLenum;\\n    readonly MAX_VERTEX_UNIFORM_COMPONENTS: GLenum;\\n    readonly MIN: GLenum;\\n    readonly MIN_PROGRAM_TEXEL_OFFSET: GLenum;\\n    readonly OBJECT_TYPE: GLenum;\\n    readonly PACK_ROW_LENGTH: GLenum;\\n    readonly PACK_SKIP_PIXELS: GLenum;\\n    readonly PACK_SKIP_ROWS: GLenum;\\n    readonly PIXEL_PACK_BUFFER: GLenum;\\n    readonly PIXEL_PACK_BUFFER_BINDING: GLenum;\\n    readonly PIXEL_UNPACK_BUFFER: GLenum;\\n    readonly PIXEL_UNPACK_BUFFER_BINDING: GLenum;\\n    readonly QUERY_RESULT: GLenum;\\n    readonly QUERY_RESULT_AVAILABLE: GLenum;\\n    readonly R11F_G11F_B10F: GLenum;\\n    readonly R16F: GLenum;\\n    readonly R16I: GLenum;\\n    readonly R16UI: GLenum;\\n    readonly R32F: GLenum;\\n    readonly R32I: GLenum;\\n    readonly R32UI: GLenum;\\n    readonly R8: GLenum;\\n    readonly R8I: GLenum;\\n    readonly R8UI: GLenum;\\n    readonly R8_SNORM: GLenum;\\n    readonly RASTERIZER_DISCARD: GLenum;\\n    readonly READ_BUFFER: GLenum;\\n    readonly READ_FRAMEBUFFER: GLenum;\\n    readonly READ_FRAMEBUFFER_BINDING: GLenum;\\n    readonly RED: GLenum;\\n    readonly RED_INTEGER: GLenum;\\n    readonly RENDERBUFFER_SAMPLES: GLenum;\\n    readonly RG: GLenum;\\n    readonly RG16F: GLenum;\\n    readonly RG16I: GLenum;\\n    readonly RG16UI: GLenum;\\n    readonly RG32F: GLenum;\\n    readonly RG32I: GLenum;\\n    readonly RG32UI: GLenum;\\n    readonly RG8: GLenum;\\n    readonly RG8I: GLenum;\\n    readonly RG8UI: GLenum;\\n    readonly RG8_SNORM: GLenum;\\n    readonly RGB10_A2: GLenum;\\n    readonly RGB10_A2UI: GLenum;\\n    readonly RGB16F: GLenum;\\n    readonly RGB16I: GLenum;\\n    readonly RGB16UI: GLenum;\\n    readonly RGB32F: GLenum;\\n    readonly RGB32I: GLenum;\\n    readonly RGB32UI: GLenum;\\n    readonly RGB8: GLenum;\\n    readonly RGB8I: GLenum;\\n    readonly RGB8UI: GLenum;\\n    readonly RGB8_SNORM: GLenum;\\n    readonly RGB9_E5: GLenum;\\n    readonly RGBA16F: GLenum;\\n    readonly RGBA16I: GLenum;\\n    readonly RGBA16UI: GLenum;\\n    readonly RGBA32F: GLenum;\\n    readonly RGBA32I: GLenum;\\n    readonly RGBA32UI: GLenum;\\n    readonly RGBA8: GLenum;\\n    readonly RGBA8I: GLenum;\\n    readonly RGBA8UI: GLenum;\\n    readonly RGBA8_SNORM: GLenum;\\n    readonly RGBA_INTEGER: GLenum;\\n    readonly RGB_INTEGER: GLenum;\\n    readonly RG_INTEGER: GLenum;\\n    readonly SAMPLER_2D_ARRAY: GLenum;\\n    readonly SAMPLER_2D_ARRAY_SHADOW: GLenum;\\n    readonly SAMPLER_2D_SHADOW: GLenum;\\n    readonly SAMPLER_3D: GLenum;\\n    readonly SAMPLER_BINDING: GLenum;\\n    readonly SAMPLER_CUBE_SHADOW: GLenum;\\n    readonly SEPARATE_ATTRIBS: GLenum;\\n    readonly SIGNALED: GLenum;\\n    readonly SIGNED_NORMALIZED: GLenum;\\n    readonly SRGB: GLenum;\\n    readonly SRGB8: GLenum;\\n    readonly SRGB8_ALPHA8: GLenum;\\n    readonly STATIC_COPY: GLenum;\\n    readonly STATIC_READ: GLenum;\\n    readonly STENCIL: GLenum;\\n    readonly STREAM_COPY: GLenum;\\n    readonly STREAM_READ: GLenum;\\n    readonly SYNC_CONDITION: GLenum;\\n    readonly SYNC_FENCE: GLenum;\\n    readonly SYNC_FLAGS: GLenum;\\n    readonly SYNC_FLUSH_COMMANDS_BIT: GLenum;\\n    readonly SYNC_GPU_COMMANDS_COMPLETE: GLenum;\\n    readonly SYNC_STATUS: GLenum;\\n    readonly TEXTURE_2D_ARRAY: GLenum;\\n    readonly TEXTURE_3D: GLenum;\\n    readonly TEXTURE_BASE_LEVEL: GLenum;\\n    readonly TEXTURE_BINDING_2D_ARRAY: GLenum;\\n    readonly TEXTURE_BINDING_3D: GLenum;\\n    readonly TEXTURE_COMPARE_FUNC: GLenum;\\n    readonly TEXTURE_COMPARE_MODE: GLenum;\\n    readonly TEXTURE_IMMUTABLE_FORMAT: GLenum;\\n    readonly TEXTURE_IMMUTABLE_LEVELS: GLenum;\\n    readonly TEXTURE_MAX_LEVEL: GLenum;\\n    readonly TEXTURE_MAX_LOD: GLenum;\\n    readonly TEXTURE_MIN_LOD: GLenum;\\n    readonly TEXTURE_WRAP_R: GLenum;\\n    readonly TIMEOUT_EXPIRED: GLenum;\\n    readonly TIMEOUT_IGNORED: GLint64;\\n    readonly TRANSFORM_FEEDBACK: GLenum;\\n    readonly TRANSFORM_FEEDBACK_ACTIVE: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BINDING: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER_START: GLenum;\\n    readonly TRANSFORM_FEEDBACK_PAUSED: GLenum;\\n    readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum;\\n    readonly TRANSFORM_FEEDBACK_VARYINGS: GLenum;\\n    readonly UNIFORM_ARRAY_STRIDE: GLenum;\\n    readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum;\\n    readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum;\\n    readonly UNIFORM_BLOCK_BINDING: GLenum;\\n    readonly UNIFORM_BLOCK_DATA_SIZE: GLenum;\\n    readonly UNIFORM_BLOCK_INDEX: GLenum;\\n    readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum;\\n    readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum;\\n    readonly UNIFORM_BUFFER: GLenum;\\n    readonly UNIFORM_BUFFER_BINDING: GLenum;\\n    readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum;\\n    readonly UNIFORM_BUFFER_SIZE: GLenum;\\n    readonly UNIFORM_BUFFER_START: GLenum;\\n    readonly UNIFORM_IS_ROW_MAJOR: GLenum;\\n    readonly UNIFORM_MATRIX_STRIDE: GLenum;\\n    readonly UNIFORM_OFFSET: GLenum;\\n    readonly UNIFORM_SIZE: GLenum;\\n    readonly UNIFORM_TYPE: GLenum;\\n    readonly UNPACK_IMAGE_HEIGHT: GLenum;\\n    readonly UNPACK_ROW_LENGTH: GLenum;\\n    readonly UNPACK_SKIP_IMAGES: GLenum;\\n    readonly UNPACK_SKIP_PIXELS: GLenum;\\n    readonly UNPACK_SKIP_ROWS: GLenum;\\n    readonly UNSIGNALED: GLenum;\\n    readonly UNSIGNED_INT_10F_11F_11F_REV: GLenum;\\n    readonly UNSIGNED_INT_24_8: GLenum;\\n    readonly UNSIGNED_INT_2_10_10_10_REV: GLenum;\\n    readonly UNSIGNED_INT_5_9_9_9_REV: GLenum;\\n    readonly UNSIGNED_INT_SAMPLER_2D: GLenum;\\n    readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum;\\n    readonly UNSIGNED_INT_SAMPLER_3D: GLenum;\\n    readonly UNSIGNED_INT_SAMPLER_CUBE: GLenum;\\n    readonly UNSIGNED_INT_VEC2: GLenum;\\n    readonly UNSIGNED_INT_VEC3: GLenum;\\n    readonly UNSIGNED_INT_VEC4: GLenum;\\n    readonly UNSIGNED_NORMALIZED: GLenum;\\n    readonly VERTEX_ARRAY_BINDING: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_INTEGER: GLenum;\\n    readonly WAIT_FAILED: GLenum;\\n}\\n\\ninterface WebGL2RenderingContextOverloads {\\n    bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum): void;\\n    bufferData(target: GLenum, srcData: BufferSource | null, usage: GLenum): void;\\n    bufferData(target: GLenum, srcData: ArrayBufferView, usage: GLenum, srcOffset: GLuint, length?: GLuint): void;\\n    bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: BufferSource): void;\\n    bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView, srcOffset: GLuint, length?: GLuint): void;\\n    compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr): void;\\n    compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint): void;\\n    compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr): void;\\n    compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint): void;\\n    readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView | null): void;\\n    readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, offset: GLintptr): void;\\n    readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView, dstOffset: GLuint): void;\\n    texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;\\n    texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;\\n    texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr): void;\\n    texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;\\n    texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint): void;\\n    texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;\\n    texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;\\n    texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr): void;\\n    texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: TexImageSource): void;\\n    texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint): void;\\n    uniform1fv(location: WebGLUniformLocation | null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform1iv(location: WebGLUniformLocation | null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform2fv(location: WebGLUniformLocation | null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform2iv(location: WebGLUniformLocation | null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform3fv(location: WebGLUniformLocation | null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform3iv(location: WebGLUniformLocation | null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform4fv(location: WebGLUniformLocation | null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform4iv(location: WebGLUniformLocation | null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n}\\n\\n/** Part of the WebGL API and represents the information returned by calling the WebGLRenderingContext.getActiveAttrib() and WebGLRenderingContext.getActiveUniform() methods. */\\ninterface WebGLActiveInfo {\\n    readonly name: string;\\n    readonly size: GLint;\\n    readonly type: GLenum;\\n}\\n\\ndeclare var WebGLActiveInfo: {\\n    prototype: WebGLActiveInfo;\\n    new(): WebGLActiveInfo;\\n};\\n\\n/** Part of the WebGL API and represents an opaque buffer object storing data such as vertices or colors. */\\ninterface WebGLBuffer extends WebGLObject {\\n}\\n\\ndeclare var WebGLBuffer: {\\n    prototype: WebGLBuffer;\\n    new(): WebGLBuffer;\\n};\\n\\n/** The WebContextEvent interface is part of the WebGL API and is an interface for an event that is generated in response to a status change to the WebGL rendering context. */\\ninterface WebGLContextEvent extends Event {\\n    readonly statusMessage: string;\\n}\\n\\ndeclare var WebGLContextEvent: {\\n    prototype: WebGLContextEvent;\\n    new(type: string, eventInit?: WebGLContextEventInit): WebGLContextEvent;\\n};\\n\\n/** Part of the WebGL API and represents a collection of buffers that serve as a rendering destination. */\\ninterface WebGLFramebuffer extends WebGLObject {\\n}\\n\\ndeclare var WebGLFramebuffer: {\\n    prototype: WebGLFramebuffer;\\n    new(): WebGLFramebuffer;\\n};\\n\\ninterface WebGLObject {\\n}\\n\\ndeclare var WebGLObject: {\\n    prototype: WebGLObject;\\n    new(): WebGLObject;\\n};\\n\\n/** The WebGLProgram is part of the WebGL API and is a combination of two compiled WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL). */\\ninterface WebGLProgram extends WebGLObject {\\n}\\n\\ndeclare var WebGLProgram: {\\n    prototype: WebGLProgram;\\n    new(): WebGLProgram;\\n};\\n\\ninterface WebGLQuery extends WebGLObject {\\n}\\n\\ndeclare var WebGLQuery: {\\n    prototype: WebGLQuery;\\n    new(): WebGLQuery;\\n};\\n\\n/** Part of the WebGL API and represents a buffer that can contain an image, or can be source or target of an rendering operation. */\\ninterface WebGLRenderbuffer extends WebGLObject {\\n}\\n\\ndeclare var WebGLRenderbuffer: {\\n    prototype: WebGLRenderbuffer;\\n    new(): WebGLRenderbuffer;\\n};\\n\\n/** Provides an interface to the OpenGL ES 2.0 graphics rendering context for the drawing surface of an HTML <canvas> element. */\\ninterface WebGLRenderingContext extends WebGLRenderingContextBase, WebGLRenderingContextOverloads {\\n}\\n\\ndeclare var WebGLRenderingContext: {\\n    prototype: WebGLRenderingContext;\\n    new(): WebGLRenderingContext;\\n    readonly ACTIVE_ATTRIBUTES: GLenum;\\n    readonly ACTIVE_TEXTURE: GLenum;\\n    readonly ACTIVE_UNIFORMS: GLenum;\\n    readonly ALIASED_LINE_WIDTH_RANGE: GLenum;\\n    readonly ALIASED_POINT_SIZE_RANGE: GLenum;\\n    readonly ALPHA: GLenum;\\n    readonly ALPHA_BITS: GLenum;\\n    readonly ALWAYS: GLenum;\\n    readonly ARRAY_BUFFER: GLenum;\\n    readonly ARRAY_BUFFER_BINDING: GLenum;\\n    readonly ATTACHED_SHADERS: GLenum;\\n    readonly BACK: GLenum;\\n    readonly BLEND: GLenum;\\n    readonly BLEND_COLOR: GLenum;\\n    readonly BLEND_DST_ALPHA: GLenum;\\n    readonly BLEND_DST_RGB: GLenum;\\n    readonly BLEND_EQUATION: GLenum;\\n    readonly BLEND_EQUATION_ALPHA: GLenum;\\n    readonly BLEND_EQUATION_RGB: GLenum;\\n    readonly BLEND_SRC_ALPHA: GLenum;\\n    readonly BLEND_SRC_RGB: GLenum;\\n    readonly BLUE_BITS: GLenum;\\n    readonly BOOL: GLenum;\\n    readonly BOOL_VEC2: GLenum;\\n    readonly BOOL_VEC3: GLenum;\\n    readonly BOOL_VEC4: GLenum;\\n    readonly BROWSER_DEFAULT_WEBGL: GLenum;\\n    readonly BUFFER_SIZE: GLenum;\\n    readonly BUFFER_USAGE: GLenum;\\n    readonly BYTE: GLenum;\\n    readonly CCW: GLenum;\\n    readonly CLAMP_TO_EDGE: GLenum;\\n    readonly COLOR_ATTACHMENT0: GLenum;\\n    readonly COLOR_BUFFER_BIT: GLenum;\\n    readonly COLOR_CLEAR_VALUE: GLenum;\\n    readonly COLOR_WRITEMASK: GLenum;\\n    readonly COMPILE_STATUS: GLenum;\\n    readonly COMPRESSED_TEXTURE_FORMATS: GLenum;\\n    readonly CONSTANT_ALPHA: GLenum;\\n    readonly CONSTANT_COLOR: GLenum;\\n    readonly CONTEXT_LOST_WEBGL: GLenum;\\n    readonly CULL_FACE: GLenum;\\n    readonly CULL_FACE_MODE: GLenum;\\n    readonly CURRENT_PROGRAM: GLenum;\\n    readonly CURRENT_VERTEX_ATTRIB: GLenum;\\n    readonly CW: GLenum;\\n    readonly DECR: GLenum;\\n    readonly DECR_WRAP: GLenum;\\n    readonly DELETE_STATUS: GLenum;\\n    readonly DEPTH_ATTACHMENT: GLenum;\\n    readonly DEPTH_BITS: GLenum;\\n    readonly DEPTH_BUFFER_BIT: GLenum;\\n    readonly DEPTH_CLEAR_VALUE: GLenum;\\n    readonly DEPTH_COMPONENT: GLenum;\\n    readonly DEPTH_COMPONENT16: GLenum;\\n    readonly DEPTH_FUNC: GLenum;\\n    readonly DEPTH_RANGE: GLenum;\\n    readonly DEPTH_STENCIL: GLenum;\\n    readonly DEPTH_STENCIL_ATTACHMENT: GLenum;\\n    readonly DEPTH_TEST: GLenum;\\n    readonly DEPTH_WRITEMASK: GLenum;\\n    readonly DITHER: GLenum;\\n    readonly DONT_CARE: GLenum;\\n    readonly DST_ALPHA: GLenum;\\n    readonly DST_COLOR: GLenum;\\n    readonly DYNAMIC_DRAW: GLenum;\\n    readonly ELEMENT_ARRAY_BUFFER: GLenum;\\n    readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum;\\n    readonly EQUAL: GLenum;\\n    readonly FASTEST: GLenum;\\n    readonly FLOAT: GLenum;\\n    readonly FLOAT_MAT2: GLenum;\\n    readonly FLOAT_MAT3: GLenum;\\n    readonly FLOAT_MAT4: GLenum;\\n    readonly FLOAT_VEC2: GLenum;\\n    readonly FLOAT_VEC3: GLenum;\\n    readonly FLOAT_VEC4: GLenum;\\n    readonly FRAGMENT_SHADER: GLenum;\\n    readonly FRAMEBUFFER: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum;\\n    readonly FRAMEBUFFER_BINDING: GLenum;\\n    readonly FRAMEBUFFER_COMPLETE: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum;\\n    readonly FRAMEBUFFER_UNSUPPORTED: GLenum;\\n    readonly FRONT: GLenum;\\n    readonly FRONT_AND_BACK: GLenum;\\n    readonly FRONT_FACE: GLenum;\\n    readonly FUNC_ADD: GLenum;\\n    readonly FUNC_REVERSE_SUBTRACT: GLenum;\\n    readonly FUNC_SUBTRACT: GLenum;\\n    readonly GENERATE_MIPMAP_HINT: GLenum;\\n    readonly GEQUAL: GLenum;\\n    readonly GREATER: GLenum;\\n    readonly GREEN_BITS: GLenum;\\n    readonly HIGH_FLOAT: GLenum;\\n    readonly HIGH_INT: GLenum;\\n    readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum;\\n    readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum;\\n    readonly INCR: GLenum;\\n    readonly INCR_WRAP: GLenum;\\n    readonly INT: GLenum;\\n    readonly INT_VEC2: GLenum;\\n    readonly INT_VEC3: GLenum;\\n    readonly INT_VEC4: GLenum;\\n    readonly INVALID_ENUM: GLenum;\\n    readonly INVALID_FRAMEBUFFER_OPERATION: GLenum;\\n    readonly INVALID_OPERATION: GLenum;\\n    readonly INVALID_VALUE: GLenum;\\n    readonly INVERT: GLenum;\\n    readonly KEEP: GLenum;\\n    readonly LEQUAL: GLenum;\\n    readonly LESS: GLenum;\\n    readonly LINEAR: GLenum;\\n    readonly LINEAR_MIPMAP_LINEAR: GLenum;\\n    readonly LINEAR_MIPMAP_NEAREST: GLenum;\\n    readonly LINES: GLenum;\\n    readonly LINE_LOOP: GLenum;\\n    readonly LINE_STRIP: GLenum;\\n    readonly LINE_WIDTH: GLenum;\\n    readonly LINK_STATUS: GLenum;\\n    readonly LOW_FLOAT: GLenum;\\n    readonly LOW_INT: GLenum;\\n    readonly LUMINANCE: GLenum;\\n    readonly LUMINANCE_ALPHA: GLenum;\\n    readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum;\\n    readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum;\\n    readonly MAX_RENDERBUFFER_SIZE: GLenum;\\n    readonly MAX_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_TEXTURE_SIZE: GLenum;\\n    readonly MAX_VARYING_VECTORS: GLenum;\\n    readonly MAX_VERTEX_ATTRIBS: GLenum;\\n    readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum;\\n    readonly MAX_VIEWPORT_DIMS: GLenum;\\n    readonly MEDIUM_FLOAT: GLenum;\\n    readonly MEDIUM_INT: GLenum;\\n    readonly MIRRORED_REPEAT: GLenum;\\n    readonly NEAREST: GLenum;\\n    readonly NEAREST_MIPMAP_LINEAR: GLenum;\\n    readonly NEAREST_MIPMAP_NEAREST: GLenum;\\n    readonly NEVER: GLenum;\\n    readonly NICEST: GLenum;\\n    readonly NONE: GLenum;\\n    readonly NOTEQUAL: GLenum;\\n    readonly NO_ERROR: GLenum;\\n    readonly ONE: GLenum;\\n    readonly ONE_MINUS_CONSTANT_ALPHA: GLenum;\\n    readonly ONE_MINUS_CONSTANT_COLOR: GLenum;\\n    readonly ONE_MINUS_DST_ALPHA: GLenum;\\n    readonly ONE_MINUS_DST_COLOR: GLenum;\\n    readonly ONE_MINUS_SRC_ALPHA: GLenum;\\n    readonly ONE_MINUS_SRC_COLOR: GLenum;\\n    readonly OUT_OF_MEMORY: GLenum;\\n    readonly PACK_ALIGNMENT: GLenum;\\n    readonly POINTS: GLenum;\\n    readonly POLYGON_OFFSET_FACTOR: GLenum;\\n    readonly POLYGON_OFFSET_FILL: GLenum;\\n    readonly POLYGON_OFFSET_UNITS: GLenum;\\n    readonly RED_BITS: GLenum;\\n    readonly RENDERBUFFER: GLenum;\\n    readonly RENDERBUFFER_ALPHA_SIZE: GLenum;\\n    readonly RENDERBUFFER_BINDING: GLenum;\\n    readonly RENDERBUFFER_BLUE_SIZE: GLenum;\\n    readonly RENDERBUFFER_DEPTH_SIZE: GLenum;\\n    readonly RENDERBUFFER_GREEN_SIZE: GLenum;\\n    readonly RENDERBUFFER_HEIGHT: GLenum;\\n    readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum;\\n    readonly RENDERBUFFER_RED_SIZE: GLenum;\\n    readonly RENDERBUFFER_STENCIL_SIZE: GLenum;\\n    readonly RENDERBUFFER_WIDTH: GLenum;\\n    readonly RENDERER: GLenum;\\n    readonly REPEAT: GLenum;\\n    readonly REPLACE: GLenum;\\n    readonly RGB: GLenum;\\n    readonly RGB565: GLenum;\\n    readonly RGB5_A1: GLenum;\\n    readonly RGBA: GLenum;\\n    readonly RGBA4: GLenum;\\n    readonly SAMPLER_2D: GLenum;\\n    readonly SAMPLER_CUBE: GLenum;\\n    readonly SAMPLES: GLenum;\\n    readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum;\\n    readonly SAMPLE_BUFFERS: GLenum;\\n    readonly SAMPLE_COVERAGE: GLenum;\\n    readonly SAMPLE_COVERAGE_INVERT: GLenum;\\n    readonly SAMPLE_COVERAGE_VALUE: GLenum;\\n    readonly SCISSOR_BOX: GLenum;\\n    readonly SCISSOR_TEST: GLenum;\\n    readonly SHADER_TYPE: GLenum;\\n    readonly SHADING_LANGUAGE_VERSION: GLenum;\\n    readonly SHORT: GLenum;\\n    readonly SRC_ALPHA: GLenum;\\n    readonly SRC_ALPHA_SATURATE: GLenum;\\n    readonly SRC_COLOR: GLenum;\\n    readonly STATIC_DRAW: GLenum;\\n    readonly STENCIL_ATTACHMENT: GLenum;\\n    readonly STENCIL_BACK_FAIL: GLenum;\\n    readonly STENCIL_BACK_FUNC: GLenum;\\n    readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum;\\n    readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum;\\n    readonly STENCIL_BACK_REF: GLenum;\\n    readonly STENCIL_BACK_VALUE_MASK: GLenum;\\n    readonly STENCIL_BACK_WRITEMASK: GLenum;\\n    readonly STENCIL_BITS: GLenum;\\n    readonly STENCIL_BUFFER_BIT: GLenum;\\n    readonly STENCIL_CLEAR_VALUE: GLenum;\\n    readonly STENCIL_FAIL: GLenum;\\n    readonly STENCIL_FUNC: GLenum;\\n    readonly STENCIL_INDEX8: GLenum;\\n    readonly STENCIL_PASS_DEPTH_FAIL: GLenum;\\n    readonly STENCIL_PASS_DEPTH_PASS: GLenum;\\n    readonly STENCIL_REF: GLenum;\\n    readonly STENCIL_TEST: GLenum;\\n    readonly STENCIL_VALUE_MASK: GLenum;\\n    readonly STENCIL_WRITEMASK: GLenum;\\n    readonly STREAM_DRAW: GLenum;\\n    readonly SUBPIXEL_BITS: GLenum;\\n    readonly TEXTURE: GLenum;\\n    readonly TEXTURE0: GLenum;\\n    readonly TEXTURE1: GLenum;\\n    readonly TEXTURE10: GLenum;\\n    readonly TEXTURE11: GLenum;\\n    readonly TEXTURE12: GLenum;\\n    readonly TEXTURE13: GLenum;\\n    readonly TEXTURE14: GLenum;\\n    readonly TEXTURE15: GLenum;\\n    readonly TEXTURE16: GLenum;\\n    readonly TEXTURE17: GLenum;\\n    readonly TEXTURE18: GLenum;\\n    readonly TEXTURE19: GLenum;\\n    readonly TEXTURE2: GLenum;\\n    readonly TEXTURE20: GLenum;\\n    readonly TEXTURE21: GLenum;\\n    readonly TEXTURE22: GLenum;\\n    readonly TEXTURE23: GLenum;\\n    readonly TEXTURE24: GLenum;\\n    readonly TEXTURE25: GLenum;\\n    readonly TEXTURE26: GLenum;\\n    readonly TEXTURE27: GLenum;\\n    readonly TEXTURE28: GLenum;\\n    readonly TEXTURE29: GLenum;\\n    readonly TEXTURE3: GLenum;\\n    readonly TEXTURE30: GLenum;\\n    readonly TEXTURE31: GLenum;\\n    readonly TEXTURE4: GLenum;\\n    readonly TEXTURE5: GLenum;\\n    readonly TEXTURE6: GLenum;\\n    readonly TEXTURE7: GLenum;\\n    readonly TEXTURE8: GLenum;\\n    readonly TEXTURE9: GLenum;\\n    readonly TEXTURE_2D: GLenum;\\n    readonly TEXTURE_BINDING_2D: GLenum;\\n    readonly TEXTURE_BINDING_CUBE_MAP: GLenum;\\n    readonly TEXTURE_CUBE_MAP: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum;\\n    readonly TEXTURE_MAG_FILTER: GLenum;\\n    readonly TEXTURE_MIN_FILTER: GLenum;\\n    readonly TEXTURE_WRAP_S: GLenum;\\n    readonly TEXTURE_WRAP_T: GLenum;\\n    readonly TRIANGLES: GLenum;\\n    readonly TRIANGLE_FAN: GLenum;\\n    readonly TRIANGLE_STRIP: GLenum;\\n    readonly UNPACK_ALIGNMENT: GLenum;\\n    readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum;\\n    readonly UNPACK_FLIP_Y_WEBGL: GLenum;\\n    readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum;\\n    readonly UNSIGNED_BYTE: GLenum;\\n    readonly UNSIGNED_INT: GLenum;\\n    readonly UNSIGNED_SHORT: GLenum;\\n    readonly UNSIGNED_SHORT_4_4_4_4: GLenum;\\n    readonly UNSIGNED_SHORT_5_5_5_1: GLenum;\\n    readonly UNSIGNED_SHORT_5_6_5: GLenum;\\n    readonly VALIDATE_STATUS: GLenum;\\n    readonly VENDOR: GLenum;\\n    readonly VERSION: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum;\\n    readonly VERTEX_SHADER: GLenum;\\n    readonly VIEWPORT: GLenum;\\n    readonly ZERO: GLenum;\\n};\\n\\ninterface WebGLRenderingContextBase {\\n    readonly canvas: HTMLCanvasElement | OffscreenCanvas;\\n    readonly drawingBufferHeight: GLsizei;\\n    readonly drawingBufferWidth: GLsizei;\\n    activeTexture(texture: GLenum): void;\\n    attachShader(program: WebGLProgram, shader: WebGLShader): void;\\n    bindAttribLocation(program: WebGLProgram, index: GLuint, name: string): void;\\n    bindBuffer(target: GLenum, buffer: WebGLBuffer | null): void;\\n    bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer | null): void;\\n    bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer | null): void;\\n    bindTexture(target: GLenum, texture: WebGLTexture | null): void;\\n    blendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf): void;\\n    blendEquation(mode: GLenum): void;\\n    blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum): void;\\n    blendFunc(sfactor: GLenum, dfactor: GLenum): void;\\n    blendFuncSeparate(srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum): void;\\n    checkFramebufferStatus(target: GLenum): GLenum;\\n    clear(mask: GLbitfield): void;\\n    clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf): void;\\n    clearDepth(depth: GLclampf): void;\\n    clearStencil(s: GLint): void;\\n    colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean): void;\\n    compileShader(shader: WebGLShader): void;\\n    copyTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint): void;\\n    copyTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;\\n    createBuffer(): WebGLBuffer | null;\\n    createFramebuffer(): WebGLFramebuffer | null;\\n    createProgram(): WebGLProgram | null;\\n    createRenderbuffer(): WebGLRenderbuffer | null;\\n    createShader(type: GLenum): WebGLShader | null;\\n    createTexture(): WebGLTexture | null;\\n    cullFace(mode: GLenum): void;\\n    deleteBuffer(buffer: WebGLBuffer | null): void;\\n    deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void;\\n    deleteProgram(program: WebGLProgram | null): void;\\n    deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void;\\n    deleteShader(shader: WebGLShader | null): void;\\n    deleteTexture(texture: WebGLTexture | null): void;\\n    depthFunc(func: GLenum): void;\\n    depthMask(flag: GLboolean): void;\\n    depthRange(zNear: GLclampf, zFar: GLclampf): void;\\n    detachShader(program: WebGLProgram, shader: WebGLShader): void;\\n    disable(cap: GLenum): void;\\n    disableVertexAttribArray(index: GLuint): void;\\n    drawArrays(mode: GLenum, first: GLint, count: GLsizei): void;\\n    drawElements(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr): void;\\n    enable(cap: GLenum): void;\\n    enableVertexAttribArray(index: GLuint): void;\\n    finish(): void;\\n    flush(): void;\\n    framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: WebGLRenderbuffer | null): void;\\n    framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture | null, level: GLint): void;\\n    frontFace(mode: GLenum): void;\\n    generateMipmap(target: GLenum): void;\\n    getActiveAttrib(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;\\n    getActiveUniform(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;\\n    getAttachedShaders(program: WebGLProgram): WebGLShader[] | null;\\n    getAttribLocation(program: WebGLProgram, name: string): GLint;\\n    getBufferParameter(target: GLenum, pname: GLenum): any;\\n    getContextAttributes(): WebGLContextAttributes | null;\\n    getError(): GLenum;\\n    getExtension(extensionName: \\\"EXT_blend_minmax\\\"): EXT_blend_minmax | null;\\n    getExtension(extensionName: \\\"EXT_texture_filter_anisotropic\\\"): EXT_texture_filter_anisotropic | null;\\n    getExtension(extensionName: \\\"EXT_frag_depth\\\"): EXT_frag_depth | null;\\n    getExtension(extensionName: \\\"EXT_shader_texture_lod\\\"): EXT_shader_texture_lod | null;\\n    getExtension(extensionName: \\\"EXT_sRGB\\\"): EXT_sRGB | null;\\n    getExtension(extensionName: \\\"OES_vertex_array_object\\\"): OES_vertex_array_object | null;\\n    getExtension(extensionName: \\\"WEBGL_color_buffer_float\\\"): WEBGL_color_buffer_float | null;\\n    getExtension(extensionName: \\\"WEBGL_compressed_texture_astc\\\"): WEBGL_compressed_texture_astc | null;\\n    getExtension(extensionName: \\\"WEBGL_compressed_texture_s3tc_srgb\\\"): WEBGL_compressed_texture_s3tc_srgb | null;\\n    getExtension(extensionName: \\\"WEBGL_debug_shaders\\\"): WEBGL_debug_shaders | null;\\n    getExtension(extensionName: \\\"WEBGL_draw_buffers\\\"): WEBGL_draw_buffers | null;\\n    getExtension(extensionName: \\\"WEBGL_lose_context\\\"): WEBGL_lose_context | null;\\n    getExtension(extensionName: \\\"WEBGL_depth_texture\\\"): WEBGL_depth_texture | null;\\n    getExtension(extensionName: \\\"WEBGL_debug_renderer_info\\\"): WEBGL_debug_renderer_info | null;\\n    getExtension(extensionName: \\\"WEBGL_compressed_texture_s3tc\\\"): WEBGL_compressed_texture_s3tc | null;\\n    getExtension(extensionName: \\\"OES_texture_half_float_linear\\\"): OES_texture_half_float_linear | null;\\n    getExtension(extensionName: \\\"OES_texture_half_float\\\"): OES_texture_half_float | null;\\n    getExtension(extensionName: \\\"OES_texture_float_linear\\\"): OES_texture_float_linear | null;\\n    getExtension(extensionName: \\\"OES_texture_float\\\"): OES_texture_float | null;\\n    getExtension(extensionName: \\\"OES_standard_derivatives\\\"): OES_standard_derivatives | null;\\n    getExtension(extensionName: \\\"OES_element_index_uint\\\"): OES_element_index_uint | null;\\n    getExtension(extensionName: \\\"ANGLE_instanced_arrays\\\"): ANGLE_instanced_arrays | null;\\n    getExtension(extensionName: string): any;\\n    getFramebufferAttachmentParameter(target: GLenum, attachment: GLenum, pname: GLenum): any;\\n    getParameter(pname: GLenum): any;\\n    getProgramInfoLog(program: WebGLProgram): string | null;\\n    getProgramParameter(program: WebGLProgram, pname: GLenum): any;\\n    getRenderbufferParameter(target: GLenum, pname: GLenum): any;\\n    getShaderInfoLog(shader: WebGLShader): string | null;\\n    getShaderParameter(shader: WebGLShader, pname: GLenum): any;\\n    getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum): WebGLShaderPrecisionFormat | null;\\n    getShaderSource(shader: WebGLShader): string | null;\\n    getSupportedExtensions(): string[] | null;\\n    getTexParameter(target: GLenum, pname: GLenum): any;\\n    getUniform(program: WebGLProgram, location: WebGLUniformLocation): any;\\n    getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation | null;\\n    getVertexAttrib(index: GLuint, pname: GLenum): any;\\n    getVertexAttribOffset(index: GLuint, pname: GLenum): GLintptr;\\n    hint(target: GLenum, mode: GLenum): void;\\n    isBuffer(buffer: WebGLBuffer | null): GLboolean;\\n    isContextLost(): boolean;\\n    isEnabled(cap: GLenum): GLboolean;\\n    isFramebuffer(framebuffer: WebGLFramebuffer | null): GLboolean;\\n    isProgram(program: WebGLProgram | null): GLboolean;\\n    isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): GLboolean;\\n    isShader(shader: WebGLShader | null): GLboolean;\\n    isTexture(texture: WebGLTexture | null): GLboolean;\\n    lineWidth(width: GLfloat): void;\\n    linkProgram(program: WebGLProgram): void;\\n    pixelStorei(pname: GLenum, param: GLint | GLboolean): void;\\n    polygonOffset(factor: GLfloat, units: GLfloat): void;\\n    renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei): void;\\n    sampleCoverage(value: GLclampf, invert: GLboolean): void;\\n    scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;\\n    shaderSource(shader: WebGLShader, source: string): void;\\n    stencilFunc(func: GLenum, ref: GLint, mask: GLuint): void;\\n    stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint): void;\\n    stencilMask(mask: GLuint): void;\\n    stencilMaskSeparate(face: GLenum, mask: GLuint): void;\\n    stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum): void;\\n    stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum): void;\\n    texParameterf(target: GLenum, pname: GLenum, param: GLfloat): void;\\n    texParameteri(target: GLenum, pname: GLenum, param: GLint): void;\\n    uniform1f(location: WebGLUniformLocation | null, x: GLfloat): void;\\n    uniform1i(location: WebGLUniformLocation | null, x: GLint): void;\\n    uniform2f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat): void;\\n    uniform2i(location: WebGLUniformLocation | null, x: GLint, y: GLint): void;\\n    uniform3f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat): void;\\n    uniform3i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint): void;\\n    uniform4f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void;\\n    uniform4i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint, w: GLint): void;\\n    useProgram(program: WebGLProgram | null): void;\\n    validateProgram(program: WebGLProgram): void;\\n    vertexAttrib1f(index: GLuint, x: GLfloat): void;\\n    vertexAttrib1fv(index: GLuint, values: Float32List): void;\\n    vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat): void;\\n    vertexAttrib2fv(index: GLuint, values: Float32List): void;\\n    vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat): void;\\n    vertexAttrib3fv(index: GLuint, values: Float32List): void;\\n    vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void;\\n    vertexAttrib4fv(index: GLuint, values: Float32List): void;\\n    vertexAttribPointer(index: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr): void;\\n    viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;\\n    readonly ACTIVE_ATTRIBUTES: GLenum;\\n    readonly ACTIVE_TEXTURE: GLenum;\\n    readonly ACTIVE_UNIFORMS: GLenum;\\n    readonly ALIASED_LINE_WIDTH_RANGE: GLenum;\\n    readonly ALIASED_POINT_SIZE_RANGE: GLenum;\\n    readonly ALPHA: GLenum;\\n    readonly ALPHA_BITS: GLenum;\\n    readonly ALWAYS: GLenum;\\n    readonly ARRAY_BUFFER: GLenum;\\n    readonly ARRAY_BUFFER_BINDING: GLenum;\\n    readonly ATTACHED_SHADERS: GLenum;\\n    readonly BACK: GLenum;\\n    readonly BLEND: GLenum;\\n    readonly BLEND_COLOR: GLenum;\\n    readonly BLEND_DST_ALPHA: GLenum;\\n    readonly BLEND_DST_RGB: GLenum;\\n    readonly BLEND_EQUATION: GLenum;\\n    readonly BLEND_EQUATION_ALPHA: GLenum;\\n    readonly BLEND_EQUATION_RGB: GLenum;\\n    readonly BLEND_SRC_ALPHA: GLenum;\\n    readonly BLEND_SRC_RGB: GLenum;\\n    readonly BLUE_BITS: GLenum;\\n    readonly BOOL: GLenum;\\n    readonly BOOL_VEC2: GLenum;\\n    readonly BOOL_VEC3: GLenum;\\n    readonly BOOL_VEC4: GLenum;\\n    readonly BROWSER_DEFAULT_WEBGL: GLenum;\\n    readonly BUFFER_SIZE: GLenum;\\n    readonly BUFFER_USAGE: GLenum;\\n    readonly BYTE: GLenum;\\n    readonly CCW: GLenum;\\n    readonly CLAMP_TO_EDGE: GLenum;\\n    readonly COLOR_ATTACHMENT0: GLenum;\\n    readonly COLOR_BUFFER_BIT: GLenum;\\n    readonly COLOR_CLEAR_VALUE: GLenum;\\n    readonly COLOR_WRITEMASK: GLenum;\\n    readonly COMPILE_STATUS: GLenum;\\n    readonly COMPRESSED_TEXTURE_FORMATS: GLenum;\\n    readonly CONSTANT_ALPHA: GLenum;\\n    readonly CONSTANT_COLOR: GLenum;\\n    readonly CONTEXT_LOST_WEBGL: GLenum;\\n    readonly CULL_FACE: GLenum;\\n    readonly CULL_FACE_MODE: GLenum;\\n    readonly CURRENT_PROGRAM: GLenum;\\n    readonly CURRENT_VERTEX_ATTRIB: GLenum;\\n    readonly CW: GLenum;\\n    readonly DECR: GLenum;\\n    readonly DECR_WRAP: GLenum;\\n    readonly DELETE_STATUS: GLenum;\\n    readonly DEPTH_ATTACHMENT: GLenum;\\n    readonly DEPTH_BITS: GLenum;\\n    readonly DEPTH_BUFFER_BIT: GLenum;\\n    readonly DEPTH_CLEAR_VALUE: GLenum;\\n    readonly DEPTH_COMPONENT: GLenum;\\n    readonly DEPTH_COMPONENT16: GLenum;\\n    readonly DEPTH_FUNC: GLenum;\\n    readonly DEPTH_RANGE: GLenum;\\n    readonly DEPTH_STENCIL: GLenum;\\n    readonly DEPTH_STENCIL_ATTACHMENT: GLenum;\\n    readonly DEPTH_TEST: GLenum;\\n    readonly DEPTH_WRITEMASK: GLenum;\\n    readonly DITHER: GLenum;\\n    readonly DONT_CARE: GLenum;\\n    readonly DST_ALPHA: GLenum;\\n    readonly DST_COLOR: GLenum;\\n    readonly DYNAMIC_DRAW: GLenum;\\n    readonly ELEMENT_ARRAY_BUFFER: GLenum;\\n    readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum;\\n    readonly EQUAL: GLenum;\\n    readonly FASTEST: GLenum;\\n    readonly FLOAT: GLenum;\\n    readonly FLOAT_MAT2: GLenum;\\n    readonly FLOAT_MAT3: GLenum;\\n    readonly FLOAT_MAT4: GLenum;\\n    readonly FLOAT_VEC2: GLenum;\\n    readonly FLOAT_VEC3: GLenum;\\n    readonly FLOAT_VEC4: GLenum;\\n    readonly FRAGMENT_SHADER: GLenum;\\n    readonly FRAMEBUFFER: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum;\\n    readonly FRAMEBUFFER_BINDING: GLenum;\\n    readonly FRAMEBUFFER_COMPLETE: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum;\\n    readonly FRAMEBUFFER_UNSUPPORTED: GLenum;\\n    readonly FRONT: GLenum;\\n    readonly FRONT_AND_BACK: GLenum;\\n    readonly FRONT_FACE: GLenum;\\n    readonly FUNC_ADD: GLenum;\\n    readonly FUNC_REVERSE_SUBTRACT: GLenum;\\n    readonly FUNC_SUBTRACT: GLenum;\\n    readonly GENERATE_MIPMAP_HINT: GLenum;\\n    readonly GEQUAL: GLenum;\\n    readonly GREATER: GLenum;\\n    readonly GREEN_BITS: GLenum;\\n    readonly HIGH_FLOAT: GLenum;\\n    readonly HIGH_INT: GLenum;\\n    readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum;\\n    readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum;\\n    readonly INCR: GLenum;\\n    readonly INCR_WRAP: GLenum;\\n    readonly INT: GLenum;\\n    readonly INT_VEC2: GLenum;\\n    readonly INT_VEC3: GLenum;\\n    readonly INT_VEC4: GLenum;\\n    readonly INVALID_ENUM: GLenum;\\n    readonly INVALID_FRAMEBUFFER_OPERATION: GLenum;\\n    readonly INVALID_OPERATION: GLenum;\\n    readonly INVALID_VALUE: GLenum;\\n    readonly INVERT: GLenum;\\n    readonly KEEP: GLenum;\\n    readonly LEQUAL: GLenum;\\n    readonly LESS: GLenum;\\n    readonly LINEAR: GLenum;\\n    readonly LINEAR_MIPMAP_LINEAR: GLenum;\\n    readonly LINEAR_MIPMAP_NEAREST: GLenum;\\n    readonly LINES: GLenum;\\n    readonly LINE_LOOP: GLenum;\\n    readonly LINE_STRIP: GLenum;\\n    readonly LINE_WIDTH: GLenum;\\n    readonly LINK_STATUS: GLenum;\\n    readonly LOW_FLOAT: GLenum;\\n    readonly LOW_INT: GLenum;\\n    readonly LUMINANCE: GLenum;\\n    readonly LUMINANCE_ALPHA: GLenum;\\n    readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum;\\n    readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum;\\n    readonly MAX_RENDERBUFFER_SIZE: GLenum;\\n    readonly MAX_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_TEXTURE_SIZE: GLenum;\\n    readonly MAX_VARYING_VECTORS: GLenum;\\n    readonly MAX_VERTEX_ATTRIBS: GLenum;\\n    readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum;\\n    readonly MAX_VIEWPORT_DIMS: GLenum;\\n    readonly MEDIUM_FLOAT: GLenum;\\n    readonly MEDIUM_INT: GLenum;\\n    readonly MIRRORED_REPEAT: GLenum;\\n    readonly NEAREST: GLenum;\\n    readonly NEAREST_MIPMAP_LINEAR: GLenum;\\n    readonly NEAREST_MIPMAP_NEAREST: GLenum;\\n    readonly NEVER: GLenum;\\n    readonly NICEST: GLenum;\\n    readonly NONE: GLenum;\\n    readonly NOTEQUAL: GLenum;\\n    readonly NO_ERROR: GLenum;\\n    readonly ONE: GLenum;\\n    readonly ONE_MINUS_CONSTANT_ALPHA: GLenum;\\n    readonly ONE_MINUS_CONSTANT_COLOR: GLenum;\\n    readonly ONE_MINUS_DST_ALPHA: GLenum;\\n    readonly ONE_MINUS_DST_COLOR: GLenum;\\n    readonly ONE_MINUS_SRC_ALPHA: GLenum;\\n    readonly ONE_MINUS_SRC_COLOR: GLenum;\\n    readonly OUT_OF_MEMORY: GLenum;\\n    readonly PACK_ALIGNMENT: GLenum;\\n    readonly POINTS: GLenum;\\n    readonly POLYGON_OFFSET_FACTOR: GLenum;\\n    readonly POLYGON_OFFSET_FILL: GLenum;\\n    readonly POLYGON_OFFSET_UNITS: GLenum;\\n    readonly RED_BITS: GLenum;\\n    readonly RENDERBUFFER: GLenum;\\n    readonly RENDERBUFFER_ALPHA_SIZE: GLenum;\\n    readonly RENDERBUFFER_BINDING: GLenum;\\n    readonly RENDERBUFFER_BLUE_SIZE: GLenum;\\n    readonly RENDERBUFFER_DEPTH_SIZE: GLenum;\\n    readonly RENDERBUFFER_GREEN_SIZE: GLenum;\\n    readonly RENDERBUFFER_HEIGHT: GLenum;\\n    readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum;\\n    readonly RENDERBUFFER_RED_SIZE: GLenum;\\n    readonly RENDERBUFFER_STENCIL_SIZE: GLenum;\\n    readonly RENDERBUFFER_WIDTH: GLenum;\\n    readonly RENDERER: GLenum;\\n    readonly REPEAT: GLenum;\\n    readonly REPLACE: GLenum;\\n    readonly RGB: GLenum;\\n    readonly RGB565: GLenum;\\n    readonly RGB5_A1: GLenum;\\n    readonly RGBA: GLenum;\\n    readonly RGBA4: GLenum;\\n    readonly SAMPLER_2D: GLenum;\\n    readonly SAMPLER_CUBE: GLenum;\\n    readonly SAMPLES: GLenum;\\n    readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum;\\n    readonly SAMPLE_BUFFERS: GLenum;\\n    readonly SAMPLE_COVERAGE: GLenum;\\n    readonly SAMPLE_COVERAGE_INVERT: GLenum;\\n    readonly SAMPLE_COVERAGE_VALUE: GLenum;\\n    readonly SCISSOR_BOX: GLenum;\\n    readonly SCISSOR_TEST: GLenum;\\n    readonly SHADER_TYPE: GLenum;\\n    readonly SHADING_LANGUAGE_VERSION: GLenum;\\n    readonly SHORT: GLenum;\\n    readonly SRC_ALPHA: GLenum;\\n    readonly SRC_ALPHA_SATURATE: GLenum;\\n    readonly SRC_COLOR: GLenum;\\n    readonly STATIC_DRAW: GLenum;\\n    readonly STENCIL_ATTACHMENT: GLenum;\\n    readonly STENCIL_BACK_FAIL: GLenum;\\n    readonly STENCIL_BACK_FUNC: GLenum;\\n    readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum;\\n    readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum;\\n    readonly STENCIL_BACK_REF: GLenum;\\n    readonly STENCIL_BACK_VALUE_MASK: GLenum;\\n    readonly STENCIL_BACK_WRITEMASK: GLenum;\\n    readonly STENCIL_BITS: GLenum;\\n    readonly STENCIL_BUFFER_BIT: GLenum;\\n    readonly STENCIL_CLEAR_VALUE: GLenum;\\n    readonly STENCIL_FAIL: GLenum;\\n    readonly STENCIL_FUNC: GLenum;\\n    readonly STENCIL_INDEX8: GLenum;\\n    readonly STENCIL_PASS_DEPTH_FAIL: GLenum;\\n    readonly STENCIL_PASS_DEPTH_PASS: GLenum;\\n    readonly STENCIL_REF: GLenum;\\n    readonly STENCIL_TEST: GLenum;\\n    readonly STENCIL_VALUE_MASK: GLenum;\\n    readonly STENCIL_WRITEMASK: GLenum;\\n    readonly STREAM_DRAW: GLenum;\\n    readonly SUBPIXEL_BITS: GLenum;\\n    readonly TEXTURE: GLenum;\\n    readonly TEXTURE0: GLenum;\\n    readonly TEXTURE1: GLenum;\\n    readonly TEXTURE10: GLenum;\\n    readonly TEXTURE11: GLenum;\\n    readonly TEXTURE12: GLenum;\\n    readonly TEXTURE13: GLenum;\\n    readonly TEXTURE14: GLenum;\\n    readonly TEXTURE15: GLenum;\\n    readonly TEXTURE16: GLenum;\\n    readonly TEXTURE17: GLenum;\\n    readonly TEXTURE18: GLenum;\\n    readonly TEXTURE19: GLenum;\\n    readonly TEXTURE2: GLenum;\\n    readonly TEXTURE20: GLenum;\\n    readonly TEXTURE21: GLenum;\\n    readonly TEXTURE22: GLenum;\\n    readonly TEXTURE23: GLenum;\\n    readonly TEXTURE24: GLenum;\\n    readonly TEXTURE25: GLenum;\\n    readonly TEXTURE26: GLenum;\\n    readonly TEXTURE27: GLenum;\\n    readonly TEXTURE28: GLenum;\\n    readonly TEXTURE29: GLenum;\\n    readonly TEXTURE3: GLenum;\\n    readonly TEXTURE30: GLenum;\\n    readonly TEXTURE31: GLenum;\\n    readonly TEXTURE4: GLenum;\\n    readonly TEXTURE5: GLenum;\\n    readonly TEXTURE6: GLenum;\\n    readonly TEXTURE7: GLenum;\\n    readonly TEXTURE8: GLenum;\\n    readonly TEXTURE9: GLenum;\\n    readonly TEXTURE_2D: GLenum;\\n    readonly TEXTURE_BINDING_2D: GLenum;\\n    readonly TEXTURE_BINDING_CUBE_MAP: GLenum;\\n    readonly TEXTURE_CUBE_MAP: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum;\\n    readonly TEXTURE_MAG_FILTER: GLenum;\\n    readonly TEXTURE_MIN_FILTER: GLenum;\\n    readonly TEXTURE_WRAP_S: GLenum;\\n    readonly TEXTURE_WRAP_T: GLenum;\\n    readonly TRIANGLES: GLenum;\\n    readonly TRIANGLE_FAN: GLenum;\\n    readonly TRIANGLE_STRIP: GLenum;\\n    readonly UNPACK_ALIGNMENT: GLenum;\\n    readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum;\\n    readonly UNPACK_FLIP_Y_WEBGL: GLenum;\\n    readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum;\\n    readonly UNSIGNED_BYTE: GLenum;\\n    readonly UNSIGNED_INT: GLenum;\\n    readonly UNSIGNED_SHORT: GLenum;\\n    readonly UNSIGNED_SHORT_4_4_4_4: GLenum;\\n    readonly UNSIGNED_SHORT_5_5_5_1: GLenum;\\n    readonly UNSIGNED_SHORT_5_6_5: GLenum;\\n    readonly VALIDATE_STATUS: GLenum;\\n    readonly VENDOR: GLenum;\\n    readonly VERSION: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum;\\n    readonly VERTEX_SHADER: GLenum;\\n    readonly VIEWPORT: GLenum;\\n    readonly ZERO: GLenum;\\n}\\n\\ninterface WebGLRenderingContextOverloads {\\n    bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum): void;\\n    bufferData(target: GLenum, data: BufferSource | null, usage: GLenum): void;\\n    bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource): void;\\n    compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: ArrayBufferView): void;\\n    compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: ArrayBufferView): void;\\n    readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;\\n    texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;\\n    texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;\\n    texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;\\n    texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;\\n    uniform1fv(location: WebGLUniformLocation | null, v: Float32List): void;\\n    uniform1iv(location: WebGLUniformLocation | null, v: Int32List): void;\\n    uniform2fv(location: WebGLUniformLocation | null, v: Float32List): void;\\n    uniform2iv(location: WebGLUniformLocation | null, v: Int32List): void;\\n    uniform3fv(location: WebGLUniformLocation | null, v: Float32List): void;\\n    uniform3iv(location: WebGLUniformLocation | null, v: Int32List): void;\\n    uniform4fv(location: WebGLUniformLocation | null, v: Float32List): void;\\n    uniform4iv(location: WebGLUniformLocation | null, v: Int32List): void;\\n    uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;\\n    uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;\\n    uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;\\n}\\n\\ninterface WebGLSampler extends WebGLObject {\\n}\\n\\ndeclare var WebGLSampler: {\\n    prototype: WebGLSampler;\\n    new(): WebGLSampler;\\n};\\n\\n/** The WebGLShader is part of the WebGL API and can either be a vertex or a fragment shader. A WebGLProgram requires both types of shaders. */\\ninterface WebGLShader extends WebGLObject {\\n}\\n\\ndeclare var WebGLShader: {\\n    prototype: WebGLShader;\\n    new(): WebGLShader;\\n};\\n\\n/** Part of the WebGL API and represents the information returned by calling the WebGLRenderingContext.getShaderPrecisionFormat() method. */\\ninterface WebGLShaderPrecisionFormat {\\n    readonly precision: GLint;\\n    readonly rangeMax: GLint;\\n    readonly rangeMin: GLint;\\n}\\n\\ndeclare var WebGLShaderPrecisionFormat: {\\n    prototype: WebGLShaderPrecisionFormat;\\n    new(): WebGLShaderPrecisionFormat;\\n};\\n\\ninterface WebGLSync extends WebGLObject {\\n}\\n\\ndeclare var WebGLSync: {\\n    prototype: WebGLSync;\\n    new(): WebGLSync;\\n};\\n\\n/** Part of the WebGL API and represents an opaque texture object providing storage and state for texturing operations. */\\ninterface WebGLTexture extends WebGLObject {\\n}\\n\\ndeclare var WebGLTexture: {\\n    prototype: WebGLTexture;\\n    new(): WebGLTexture;\\n};\\n\\ninterface WebGLTransformFeedback extends WebGLObject {\\n}\\n\\ndeclare var WebGLTransformFeedback: {\\n    prototype: WebGLTransformFeedback;\\n    new(): WebGLTransformFeedback;\\n};\\n\\n/** Part of the WebGL API and represents the location of a uniform variable in a shader program. */\\ninterface WebGLUniformLocation {\\n}\\n\\ndeclare var WebGLUniformLocation: {\\n    prototype: WebGLUniformLocation;\\n    new(): WebGLUniformLocation;\\n};\\n\\ninterface WebGLVertexArrayObject extends WebGLObject {\\n}\\n\\ndeclare var WebGLVertexArrayObject: {\\n    prototype: WebGLVertexArrayObject;\\n    new(): WebGLVertexArrayObject;\\n};\\n\\ninterface WebGLVertexArrayObjectOES extends WebGLObject {\\n}\\n\\ninterface WebKitPoint {\\n    x: number;\\n    y: number;\\n}\\n\\ndeclare var WebKitPoint: {\\n    prototype: WebKitPoint;\\n    new(x?: number, y?: number): WebKitPoint;\\n};\\n\\ninterface WebSocketEventMap {\\n    \\\"close\\\": CloseEvent;\\n    \\\"error\\\": Event;\\n    \\\"message\\\": MessageEvent;\\n    \\\"open\\\": Event;\\n}\\n\\n/** Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection. */\\ninterface WebSocket extends EventTarget {\\n    /**\\n     * Returns a string that indicates how binary data from the WebSocket object is exposed to scripts:\\n     * \\n     * Can be set, to change how binary data is returned. The default is \\\"blob\\\".\\n     */\\n    binaryType: BinaryType;\\n    /**\\n     * Returns the number of bytes of application data (UTF-8 text and binary data) that have been queued using send() but not yet been transmitted to the network.\\n     * \\n     * If the WebSocket connection is closed, this attribute's value will only increase with each call to the send() method. (The number does not reset to zero once the connection closes.)\\n     */\\n    readonly bufferedAmount: number;\\n    /**\\n     * Returns the extensions selected by the server, if any.\\n     */\\n    readonly extensions: string;\\n    onclose: ((this: WebSocket, ev: CloseEvent) => any) | null;\\n    onerror: ((this: WebSocket, ev: Event) => any) | null;\\n    onmessage: ((this: WebSocket, ev: MessageEvent) => any) | null;\\n    onopen: ((this: WebSocket, ev: Event) => any) | null;\\n    /**\\n     * Returns the subprotocol selected by the server, if any. It can be used in conjunction with the array form of the constructor's second argument to perform subprotocol negotiation.\\n     */\\n    readonly protocol: string;\\n    /**\\n     * Returns the state of the WebSocket object's connection. It can have the values described below.\\n     */\\n    readonly readyState: number;\\n    /**\\n     * Returns the URL that was used to establish the WebSocket connection.\\n     */\\n    readonly url: string;\\n    /**\\n     * Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.\\n     */\\n    close(code?: number, reason?: string): void;\\n    /**\\n     * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.\\n     */\\n    send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;\\n    readonly CLOSED: number;\\n    readonly CLOSING: number;\\n    readonly CONNECTING: number;\\n    readonly OPEN: number;\\n    addEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var WebSocket: {\\n    prototype: WebSocket;\\n    new(url: string, protocols?: string | string[]): WebSocket;\\n    readonly CLOSED: number;\\n    readonly CLOSING: number;\\n    readonly CONNECTING: number;\\n    readonly OPEN: number;\\n};\\n\\n/** Events that occur due to the user moving a mouse wheel or similar input device. */\\ninterface WheelEvent extends MouseEvent {\\n    readonly deltaMode: number;\\n    readonly deltaX: number;\\n    readonly deltaY: number;\\n    readonly deltaZ: number;\\n    readonly DOM_DELTA_LINE: number;\\n    readonly DOM_DELTA_PAGE: number;\\n    readonly DOM_DELTA_PIXEL: number;\\n}\\n\\ndeclare var WheelEvent: {\\n    prototype: WheelEvent;\\n    new(type: string, eventInitDict?: WheelEventInit): WheelEvent;\\n    readonly DOM_DELTA_LINE: number;\\n    readonly DOM_DELTA_PAGE: number;\\n    readonly DOM_DELTA_PIXEL: number;\\n};\\n\\ninterface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandlersEventMap {\\n    \\\"abort\\\": UIEvent;\\n    \\\"afterprint\\\": Event;\\n    \\\"beforeprint\\\": Event;\\n    \\\"beforeunload\\\": BeforeUnloadEvent;\\n    \\\"blur\\\": FocusEvent;\\n    \\\"canplay\\\": Event;\\n    \\\"canplaythrough\\\": Event;\\n    \\\"change\\\": Event;\\n    \\\"click\\\": MouseEvent;\\n    \\\"compassneedscalibration\\\": Event;\\n    \\\"contextmenu\\\": MouseEvent;\\n    \\\"dblclick\\\": MouseEvent;\\n    \\\"devicelight\\\": DeviceLightEvent;\\n    \\\"devicemotion\\\": DeviceMotionEvent;\\n    \\\"deviceorientation\\\": DeviceOrientationEvent;\\n    \\\"deviceorientationabsolute\\\": DeviceOrientationEvent;\\n    \\\"drag\\\": DragEvent;\\n    \\\"dragend\\\": DragEvent;\\n    \\\"dragenter\\\": DragEvent;\\n    \\\"dragleave\\\": DragEvent;\\n    \\\"dragover\\\": DragEvent;\\n    \\\"dragstart\\\": DragEvent;\\n    \\\"drop\\\": DragEvent;\\n    \\\"durationchange\\\": Event;\\n    \\\"emptied\\\": Event;\\n    \\\"ended\\\": Event;\\n    \\\"error\\\": ErrorEvent;\\n    \\\"focus\\\": FocusEvent;\\n    \\\"gamepadconnected\\\": GamepadEvent;\\n    \\\"gamepaddisconnected\\\": GamepadEvent;\\n    \\\"hashchange\\\": HashChangeEvent;\\n    \\\"input\\\": Event;\\n    \\\"invalid\\\": Event;\\n    \\\"keydown\\\": KeyboardEvent;\\n    \\\"keypress\\\": KeyboardEvent;\\n    \\\"keyup\\\": KeyboardEvent;\\n    \\\"load\\\": Event;\\n    \\\"loadeddata\\\": Event;\\n    \\\"loadedmetadata\\\": Event;\\n    \\\"loadstart\\\": Event;\\n    \\\"message\\\": MessageEvent;\\n    \\\"mousedown\\\": MouseEvent;\\n    \\\"mouseenter\\\": MouseEvent;\\n    \\\"mouseleave\\\": MouseEvent;\\n    \\\"mousemove\\\": MouseEvent;\\n    \\\"mouseout\\\": MouseEvent;\\n    \\\"mouseover\\\": MouseEvent;\\n    \\\"mouseup\\\": MouseEvent;\\n    \\\"mousewheel\\\": Event;\\n    \\\"MSGestureChange\\\": Event;\\n    \\\"MSGestureDoubleTap\\\": Event;\\n    \\\"MSGestureEnd\\\": Event;\\n    \\\"MSGestureHold\\\": Event;\\n    \\\"MSGestureStart\\\": Event;\\n    \\\"MSGestureTap\\\": Event;\\n    \\\"MSInertiaStart\\\": Event;\\n    \\\"MSPointerCancel\\\": Event;\\n    \\\"MSPointerDown\\\": Event;\\n    \\\"MSPointerEnter\\\": Event;\\n    \\\"MSPointerLeave\\\": Event;\\n    \\\"MSPointerMove\\\": Event;\\n    \\\"MSPointerOut\\\": Event;\\n    \\\"MSPointerOver\\\": Event;\\n    \\\"MSPointerUp\\\": Event;\\n    \\\"offline\\\": Event;\\n    \\\"online\\\": Event;\\n    \\\"orientationchange\\\": Event;\\n    \\\"pagehide\\\": PageTransitionEvent;\\n    \\\"pageshow\\\": PageTransitionEvent;\\n    \\\"pause\\\": Event;\\n    \\\"play\\\": Event;\\n    \\\"playing\\\": Event;\\n    \\\"popstate\\\": PopStateEvent;\\n    \\\"progress\\\": ProgressEvent<Window>;\\n    \\\"ratechange\\\": Event;\\n    \\\"readystatechange\\\": ProgressEvent<Window>;\\n    \\\"reset\\\": Event;\\n    \\\"resize\\\": UIEvent;\\n    \\\"scroll\\\": Event;\\n    \\\"seeked\\\": Event;\\n    \\\"seeking\\\": Event;\\n    \\\"select\\\": Event;\\n    \\\"stalled\\\": Event;\\n    \\\"storage\\\": StorageEvent;\\n    \\\"submit\\\": Event;\\n    \\\"suspend\\\": Event;\\n    \\\"timeupdate\\\": Event;\\n    \\\"unload\\\": Event;\\n    \\\"volumechange\\\": Event;\\n    \\\"vrdisplayactivate\\\": Event;\\n    \\\"vrdisplayblur\\\": Event;\\n    \\\"vrdisplayconnect\\\": Event;\\n    \\\"vrdisplaydeactivate\\\": Event;\\n    \\\"vrdisplaydisconnect\\\": Event;\\n    \\\"vrdisplayfocus\\\": Event;\\n    \\\"vrdisplaypointerrestricted\\\": Event;\\n    \\\"vrdisplaypointerunrestricted\\\": Event;\\n    \\\"vrdisplaypresentchange\\\": Event;\\n    \\\"waiting\\\": Event;\\n}\\n\\n/** A window containing a DOM document; the document property points to the DOM document loaded in that window. */\\ninterface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandlers, WindowEventHandlers, WindowLocalStorage, WindowOrWorkerGlobalScope, WindowSessionStorage {\\n    readonly applicationCache: ApplicationCache;\\n    readonly clientInformation: Navigator;\\n    readonly closed: boolean;\\n    customElements: CustomElementRegistry;\\n    defaultStatus: string;\\n    readonly devicePixelRatio: number;\\n    readonly doNotTrack: string;\\n    readonly document: Document;\\n    /** @deprecated */\\n    readonly event: Event | undefined;\\n    /** @deprecated */\\n    readonly external: External;\\n    readonly frameElement: Element | null;\\n    readonly frames: Window;\\n    readonly history: History;\\n    readonly innerHeight: number;\\n    readonly innerWidth: number;\\n    readonly length: number;\\n    location: Location;\\n    readonly locationbar: BarProp;\\n    readonly menubar: BarProp;\\n    readonly msContentScript: ExtensionScriptApis;\\n    name: string;\\n    readonly navigator: Navigator;\\n    offscreenBuffering: string | boolean;\\n    oncompassneedscalibration: ((this: Window, ev: Event) => any) | null;\\n    ondevicelight: ((this: Window, ev: DeviceLightEvent) => any) | null;\\n    ondevicemotion: ((this: Window, ev: DeviceMotionEvent) => any) | null;\\n    ondeviceorientation: ((this: Window, ev: DeviceOrientationEvent) => any) | null;\\n    ondeviceorientationabsolute: ((this: Window, ev: DeviceOrientationEvent) => any) | null;\\n    ongamepadconnected: ((this: Window, ev: GamepadEvent) => any) | null;\\n    ongamepaddisconnected: ((this: Window, ev: GamepadEvent) => any) | null;\\n    onmousewheel: ((this: Window, ev: Event) => any) | null;\\n    onmsgesturechange: ((this: Window, ev: Event) => any) | null;\\n    onmsgesturedoubletap: ((this: Window, ev: Event) => any) | null;\\n    onmsgestureend: ((this: Window, ev: Event) => any) | null;\\n    onmsgesturehold: ((this: Window, ev: Event) => any) | null;\\n    onmsgesturestart: ((this: Window, ev: Event) => any) | null;\\n    onmsgesturetap: ((this: Window, ev: Event) => any) | null;\\n    onmsinertiastart: ((this: Window, ev: Event) => any) | null;\\n    onmspointercancel: ((this: Window, ev: Event) => any) | null;\\n    onmspointerdown: ((this: Window, ev: Event) => any) | null;\\n    onmspointerenter: ((this: Window, ev: Event) => any) | null;\\n    onmspointerleave: ((this: Window, ev: Event) => any) | null;\\n    onmspointermove: ((this: Window, ev: Event) => any) | null;\\n    onmspointerout: ((this: Window, ev: Event) => any) | null;\\n    onmspointerover: ((this: Window, ev: Event) => any) | null;\\n    onmspointerup: ((this: Window, ev: Event) => any) | null;\\n    /** @deprecated */\\n    onorientationchange: ((this: Window, ev: Event) => any) | null;\\n    onreadystatechange: ((this: Window, ev: ProgressEvent<Window>) => any) | null;\\n    onvrdisplayactivate: ((this: Window, ev: Event) => any) | null;\\n    onvrdisplayblur: ((this: Window, ev: Event) => any) | null;\\n    onvrdisplayconnect: ((this: Window, ev: Event) => any) | null;\\n    onvrdisplaydeactivate: ((this: Window, ev: Event) => any) | null;\\n    onvrdisplaydisconnect: ((this: Window, ev: Event) => any) | null;\\n    onvrdisplayfocus: ((this: Window, ev: Event) => any) | null;\\n    onvrdisplaypointerrestricted: ((this: Window, ev: Event) => any) | null;\\n    onvrdisplaypointerunrestricted: ((this: Window, ev: Event) => any) | null;\\n    onvrdisplaypresentchange: ((this: Window, ev: Event) => any) | null;\\n    opener: any;\\n    /** @deprecated */\\n    readonly orientation: string | number;\\n    readonly outerHeight: number;\\n    readonly outerWidth: number;\\n    readonly pageXOffset: number;\\n    readonly pageYOffset: number;\\n    readonly parent: Window;\\n    readonly personalbar: BarProp;\\n    readonly screen: Screen;\\n    readonly screenLeft: number;\\n    readonly screenTop: number;\\n    readonly screenX: number;\\n    readonly screenY: number;\\n    readonly scrollX: number;\\n    readonly scrollY: number;\\n    readonly scrollbars: BarProp;\\n    readonly self: Window & typeof globalThis;\\n    readonly speechSynthesis: SpeechSynthesis;\\n    status: string;\\n    readonly statusbar: BarProp;\\n    readonly styleMedia: StyleMedia;\\n    readonly toolbar: BarProp;\\n    readonly top: Window;\\n    readonly visualViewport: VisualViewport;\\n    readonly window: Window & typeof globalThis;\\n    alert(message?: any): void;\\n    blur(): void;\\n    /** @deprecated */\\n    captureEvents(): void;\\n    close(): void;\\n    confirm(message?: string): boolean;\\n    departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;\\n    focus(): void;\\n    getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;\\n    getMatchedCSSRules(elt: Element, pseudoElt?: string | null): CSSRuleList;\\n    getSelection(): Selection | null;\\n    matchMedia(query: string): MediaQueryList;\\n    moveBy(x: number, y: number): void;\\n    moveTo(x: number, y: number): void;\\n    msWriteProfilerMark(profilerMarkName: string): void;\\n    open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;\\n    postMessage(message: any, targetOrigin: string, transfer?: Transferable[]): void;\\n    print(): void;\\n    prompt(message?: string, _default?: string): string | null;\\n    /** @deprecated */\\n    releaseEvents(): void;\\n    resizeBy(x: number, y: number): void;\\n    resizeTo(width: number, height: number): void;\\n    scroll(options?: ScrollToOptions): void;\\n    scroll(x: number, y: number): void;\\n    scrollBy(options?: ScrollToOptions): void;\\n    scrollBy(x: number, y: number): void;\\n    scrollTo(options?: ScrollToOptions): void;\\n    scrollTo(x: number, y: number): void;\\n    stop(): void;\\n    webkitCancelAnimationFrame(handle: number): void;\\n    webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;\\n    webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;\\n    webkitRequestAnimationFrame(callback: FrameRequestCallback): number;\\n    addEventListener<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n    [index: number]: Window;\\n}\\n\\ndeclare var Window: {\\n    prototype: Window;\\n    new(): Window;\\n};\\n\\ninterface WindowEventHandlersEventMap {\\n    \\\"afterprint\\\": Event;\\n    \\\"beforeprint\\\": Event;\\n    \\\"beforeunload\\\": BeforeUnloadEvent;\\n    \\\"hashchange\\\": HashChangeEvent;\\n    \\\"languagechange\\\": Event;\\n    \\\"message\\\": MessageEvent;\\n    \\\"messageerror\\\": MessageEvent;\\n    \\\"offline\\\": Event;\\n    \\\"online\\\": Event;\\n    \\\"pagehide\\\": PageTransitionEvent;\\n    \\\"pageshow\\\": PageTransitionEvent;\\n    \\\"popstate\\\": PopStateEvent;\\n    \\\"rejectionhandled\\\": PromiseRejectionEvent;\\n    \\\"storage\\\": StorageEvent;\\n    \\\"unhandledrejection\\\": PromiseRejectionEvent;\\n    \\\"unload\\\": Event;\\n}\\n\\ninterface WindowEventHandlers {\\n    onafterprint: ((this: WindowEventHandlers, ev: Event) => any) | null;\\n    onbeforeprint: ((this: WindowEventHandlers, ev: Event) => any) | null;\\n    onbeforeunload: ((this: WindowEventHandlers, ev: BeforeUnloadEvent) => any) | null;\\n    onhashchange: ((this: WindowEventHandlers, ev: HashChangeEvent) => any) | null;\\n    onlanguagechange: ((this: WindowEventHandlers, ev: Event) => any) | null;\\n    onmessage: ((this: WindowEventHandlers, ev: MessageEvent) => any) | null;\\n    onmessageerror: ((this: WindowEventHandlers, ev: MessageEvent) => any) | null;\\n    onoffline: ((this: WindowEventHandlers, ev: Event) => any) | null;\\n    ononline: ((this: WindowEventHandlers, ev: Event) => any) | null;\\n    onpagehide: ((this: WindowEventHandlers, ev: PageTransitionEvent) => any) | null;\\n    onpageshow: ((this: WindowEventHandlers, ev: PageTransitionEvent) => any) | null;\\n    onpopstate: ((this: WindowEventHandlers, ev: PopStateEvent) => any) | null;\\n    onrejectionhandled: ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any) | null;\\n    onstorage: ((this: WindowEventHandlers, ev: StorageEvent) => any) | null;\\n    onunhandledrejection: ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any) | null;\\n    onunload: ((this: WindowEventHandlers, ev: Event) => any) | null;\\n    addEventListener<K extends keyof WindowEventHandlersEventMap>(type: K, listener: (this: WindowEventHandlers, ev: WindowEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof WindowEventHandlersEventMap>(type: K, listener: (this: WindowEventHandlers, ev: WindowEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ninterface WindowLocalStorage {\\n    readonly localStorage: Storage;\\n}\\n\\ninterface WindowOrWorkerGlobalScope {\\n    readonly caches: CacheStorage;\\n    readonly crypto: Crypto;\\n    readonly indexedDB: IDBFactory;\\n    readonly isSecureContext: boolean;\\n    readonly origin: string;\\n    readonly performance: Performance;\\n    atob(data: string): string;\\n    btoa(data: string): string;\\n    clearInterval(handle?: number): void;\\n    clearTimeout(handle?: number): void;\\n    createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;\\n    createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;\\n    fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;\\n    queueMicrotask(callback: VoidFunction): void;\\n    setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;\\n    setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;\\n}\\n\\ninterface WindowSessionStorage {\\n    readonly sessionStorage: Storage;\\n}\\n\\ninterface WorkerEventMap extends AbstractWorkerEventMap {\\n    \\\"message\\\": MessageEvent;\\n    \\\"messageerror\\\": MessageEvent;\\n}\\n\\n/** This Web Workers API interface represents a background task that can be easily created and can send messages back to its creator. Creating a worker is as simple as calling the Worker() constructor and specifying a script to be run in the worker thread. */\\ninterface Worker extends EventTarget, AbstractWorker {\\n    onmessage: ((this: Worker, ev: MessageEvent) => any) | null;\\n    onmessageerror: ((this: Worker, ev: MessageEvent) => any) | null;\\n    /**\\n     * Clones message and transmits it to worker's global environment. transfer can be passed as a list of objects that are to be transferred rather than cloned.\\n     */\\n    postMessage(message: any, transfer: Transferable[]): void;\\n    postMessage(message: any, options?: PostMessageOptions): void;\\n    /**\\n     * Aborts worker's associated global environment.\\n     */\\n    terminate(): void;\\n    addEventListener<K extends keyof WorkerEventMap>(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof WorkerEventMap>(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var Worker: {\\n    prototype: Worker;\\n    new(stringUrl: string | URL, options?: WorkerOptions): Worker;\\n};\\n\\ninterface Worklet {\\n    addModule(moduleURL: string, options?: WorkletOptions): Promise<void>;\\n}\\n\\ndeclare var Worklet: {\\n    prototype: Worklet;\\n    new(): Worklet;\\n};\\n\\n/** This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing. */\\ninterface WritableStream<W = any> {\\n    readonly locked: boolean;\\n    abort(reason?: any): Promise<void>;\\n    getWriter(): WritableStreamDefaultWriter<W>;\\n}\\n\\ndeclare var WritableStream: {\\n    prototype: WritableStream;\\n    new<W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;\\n};\\n\\n/** This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate. */\\ninterface WritableStreamDefaultController {\\n    error(e?: any): void;\\n}\\n\\ndeclare var WritableStreamDefaultController: {\\n    prototype: WritableStreamDefaultController;\\n    new(): WritableStreamDefaultController;\\n};\\n\\n/** This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink. */\\ninterface WritableStreamDefaultWriter<W = any> {\\n    readonly closed: Promise<undefined>;\\n    readonly desiredSize: number | null;\\n    readonly ready: Promise<undefined>;\\n    abort(reason?: any): Promise<void>;\\n    close(): Promise<void>;\\n    releaseLock(): void;\\n    write(chunk: W): Promise<void>;\\n}\\n\\ndeclare var WritableStreamDefaultWriter: {\\n    prototype: WritableStreamDefaultWriter;\\n    new<W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;\\n};\\n\\n/** An XML document. It inherits from the generic Document and does not add any specific methods or properties to it: nevertheless, several algorithms behave differently with the two types of documents. */\\ninterface XMLDocument extends Document {\\n    addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var XMLDocument: {\\n    prototype: XMLDocument;\\n    new(): XMLDocument;\\n};\\n\\ninterface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap {\\n    \\\"readystatechange\\\": Event;\\n}\\n\\n/** Use XMLHttpRequest (XHR) objects to interact with servers. You can retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just part of a page without disrupting what the user is doing. */\\ninterface XMLHttpRequest extends XMLHttpRequestEventTarget {\\n    onreadystatechange: ((this: XMLHttpRequest, ev: Event) => any) | null;\\n    /**\\n     * Returns client's state.\\n     */\\n    readonly readyState: number;\\n    /**\\n     * Returns the response's body.\\n     */\\n    readonly response: any;\\n    /**\\n     * Returns the text response.\\n     * \\n     * Throws an \\\"InvalidStateError\\\" DOMException if responseType is not the empty string or \\\"text\\\".\\n     */\\n    readonly responseText: string;\\n    /**\\n     * Returns the response type.\\n     * \\n     * Can be set to change the response type. Values are: the empty string (default), \\\"arraybuffer\\\", \\\"blob\\\", \\\"document\\\", \\\"json\\\", and \\\"text\\\".\\n     * \\n     * When set: setting to \\\"document\\\" is ignored if current global object is not a Window object.\\n     * \\n     * When set: throws an \\\"InvalidStateError\\\" DOMException if state is loading or done.\\n     * \\n     * When set: throws an \\\"InvalidAccessError\\\" DOMException if the synchronous flag is set and current global object is a Window object.\\n     */\\n    responseType: XMLHttpRequestResponseType;\\n    readonly responseURL: string;\\n    /**\\n     * Returns the document response.\\n     * \\n     * Throws an \\\"InvalidStateError\\\" DOMException if responseType is not the empty string or \\\"document\\\".\\n     */\\n    readonly responseXML: Document | null;\\n    readonly status: number;\\n    readonly statusText: string;\\n    /**\\n     * Can be set to a time in milliseconds. When set to a non-zero value will cause fetching to terminate after the given time has passed. When the time has passed, the request has not yet completed, and the synchronous flag is unset, a timeout event will then be dispatched, or a \\\"TimeoutError\\\" DOMException will be thrown otherwise (for the send() method).\\n     * \\n     * When set: throws an \\\"InvalidAccessError\\\" DOMException if the synchronous flag is set and current global object is a Window object.\\n     */\\n    timeout: number;\\n    /**\\n     * Returns the associated XMLHttpRequestUpload object. It can be used to gather transmission information when data is transferred to a server.\\n     */\\n    readonly upload: XMLHttpRequestUpload;\\n    /**\\n     * True when credentials are to be included in a cross-origin request. False when they are to be excluded in a cross-origin request and when cookies are to be ignored in its response. Initially false.\\n     * \\n     * When set: throws an \\\"InvalidStateError\\\" DOMException if state is not unsent or opened, or if the send() flag is set.\\n     */\\n    withCredentials: boolean;\\n    /**\\n     * Cancels any network activity.\\n     */\\n    abort(): void;\\n    getAllResponseHeaders(): string;\\n    getResponseHeader(name: string): string | null;\\n    /**\\n     * Sets the request method, request URL, and synchronous flag.\\n     * \\n     * Throws a \\\"SyntaxError\\\" DOMException if either method is not a valid HTTP method or url cannot be parsed.\\n     * \\n     * Throws a \\\"SecurityError\\\" DOMException if method is a case-insensitive match for `CONNECT`, `TRACE`, or `TRACK`.\\n     * \\n     * Throws an \\\"InvalidAccessError\\\" DOMException if async is false, current global object is a Window object, and the timeout attribute is not zero or the responseType attribute is not the empty string.\\n     */\\n    open(method: string, url: string): void;\\n    open(method: string, url: string, async: boolean, username?: string | null, password?: string | null): void;\\n    /**\\n     * Acts as if the `Content-Type` header value for response is mime. (It does not actually change the header though.)\\n     * \\n     * Throws an \\\"InvalidStateError\\\" DOMException if state is loading or done.\\n     */\\n    overrideMimeType(mime: string): void;\\n    /**\\n     * Initiates the request. The body argument provides the request body, if any, and is ignored if the request method is GET or HEAD.\\n     * \\n     * Throws an \\\"InvalidStateError\\\" DOMException if either state is not opened or the send() flag is set.\\n     */\\n    send(body?: Document | BodyInit | null): void;\\n    /**\\n     * Combines a header in author request headers.\\n     * \\n     * Throws an \\\"InvalidStateError\\\" DOMException if either state is not opened or the send() flag is set.\\n     * \\n     * Throws a \\\"SyntaxError\\\" DOMException if name is not a header name or if value is not a header value.\\n     */\\n    setRequestHeader(name: string, value: string): void;\\n    readonly DONE: number;\\n    readonly HEADERS_RECEIVED: number;\\n    readonly LOADING: number;\\n    readonly OPENED: number;\\n    readonly UNSENT: number;\\n    addEventListener<K extends keyof XMLHttpRequestEventMap>(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof XMLHttpRequestEventMap>(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var XMLHttpRequest: {\\n    prototype: XMLHttpRequest;\\n    new(): XMLHttpRequest;\\n    readonly DONE: number;\\n    readonly HEADERS_RECEIVED: number;\\n    readonly LOADING: number;\\n    readonly OPENED: number;\\n    readonly UNSENT: number;\\n};\\n\\ninterface XMLHttpRequestEventTargetEventMap {\\n    \\\"abort\\\": ProgressEvent<XMLHttpRequestEventTarget>;\\n    \\\"error\\\": ProgressEvent<XMLHttpRequestEventTarget>;\\n    \\\"load\\\": ProgressEvent<XMLHttpRequestEventTarget>;\\n    \\\"loadend\\\": ProgressEvent<XMLHttpRequestEventTarget>;\\n    \\\"loadstart\\\": ProgressEvent<XMLHttpRequestEventTarget>;\\n    \\\"progress\\\": ProgressEvent<XMLHttpRequestEventTarget>;\\n    \\\"timeout\\\": ProgressEvent<XMLHttpRequestEventTarget>;\\n}\\n\\ninterface XMLHttpRequestEventTarget extends EventTarget {\\n    onabort: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\\n    onerror: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\\n    onload: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\\n    onloadend: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\\n    onloadstart: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\\n    onprogress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\\n    ontimeout: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\\n    addEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var XMLHttpRequestEventTarget: {\\n    prototype: XMLHttpRequestEventTarget;\\n    new(): XMLHttpRequestEventTarget;\\n};\\n\\ninterface XMLHttpRequestUpload extends XMLHttpRequestEventTarget {\\n    addEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var XMLHttpRequestUpload: {\\n    prototype: XMLHttpRequestUpload;\\n    new(): XMLHttpRequestUpload;\\n};\\n\\n/** Provides the serializeToString() method to construct an XML string representing a DOM tree. */\\ninterface XMLSerializer {\\n    serializeToString(root: Node): string;\\n}\\n\\ndeclare var XMLSerializer: {\\n    prototype: XMLSerializer;\\n    new(): XMLSerializer;\\n};\\n\\n/** The XPathEvaluator interface allows to compile and evaluate XPath expressions. */\\ninterface XPathEvaluator extends XPathEvaluatorBase {\\n}\\n\\ndeclare var XPathEvaluator: {\\n    prototype: XPathEvaluator;\\n    new(): XPathEvaluator;\\n};\\n\\ninterface XPathEvaluatorBase {\\n    createExpression(expression: string, resolver?: XPathNSResolver | null): XPathExpression;\\n    createNSResolver(nodeResolver: Node): XPathNSResolver;\\n    evaluate(expression: string, contextNode: Node, resolver?: XPathNSResolver | null, type?: number, result?: XPathResult | null): XPathResult;\\n}\\n\\n/** This interface is a compiled XPath expression that can be evaluated on a document or specific node to return information its DOM tree. */\\ninterface XPathExpression {\\n    evaluate(contextNode: Node, type?: number, result?: XPathResult | null): XPathResult;\\n}\\n\\ndeclare var XPathExpression: {\\n    prototype: XPathExpression;\\n    new(): XPathExpression;\\n};\\n\\n/** The results generated by evaluating an XPath expression within the context of a given node. */\\ninterface XPathResult {\\n    readonly booleanValue: boolean;\\n    readonly invalidIteratorState: boolean;\\n    readonly numberValue: number;\\n    readonly resultType: number;\\n    readonly singleNodeValue: Node | null;\\n    readonly snapshotLength: number;\\n    readonly stringValue: string;\\n    iterateNext(): Node | null;\\n    snapshotItem(index: number): Node | null;\\n    readonly ANY_TYPE: number;\\n    readonly ANY_UNORDERED_NODE_TYPE: number;\\n    readonly BOOLEAN_TYPE: number;\\n    readonly FIRST_ORDERED_NODE_TYPE: number;\\n    readonly NUMBER_TYPE: number;\\n    readonly ORDERED_NODE_ITERATOR_TYPE: number;\\n    readonly ORDERED_NODE_SNAPSHOT_TYPE: number;\\n    readonly STRING_TYPE: number;\\n    readonly UNORDERED_NODE_ITERATOR_TYPE: number;\\n    readonly UNORDERED_NODE_SNAPSHOT_TYPE: number;\\n}\\n\\ndeclare var XPathResult: {\\n    prototype: XPathResult;\\n    new(): XPathResult;\\n    readonly ANY_TYPE: number;\\n    readonly ANY_UNORDERED_NODE_TYPE: number;\\n    readonly BOOLEAN_TYPE: number;\\n    readonly FIRST_ORDERED_NODE_TYPE: number;\\n    readonly NUMBER_TYPE: number;\\n    readonly ORDERED_NODE_ITERATOR_TYPE: number;\\n    readonly ORDERED_NODE_SNAPSHOT_TYPE: number;\\n    readonly STRING_TYPE: number;\\n    readonly UNORDERED_NODE_ITERATOR_TYPE: number;\\n    readonly UNORDERED_NODE_SNAPSHOT_TYPE: number;\\n};\\n\\n/** An XSLTProcessor applies an XSLT stylesheet transformation to an XML document to produce a new XML document as output. It has methods to load the XSLT stylesheet, to manipulate <xsl:param> parameter values, and to apply the transformation to documents. */\\ninterface XSLTProcessor {\\n    clearParameters(): void;\\n    getParameter(namespaceURI: string, localName: string): any;\\n    importStylesheet(style: Node): void;\\n    removeParameter(namespaceURI: string, localName: string): void;\\n    reset(): void;\\n    setParameter(namespaceURI: string, localName: string, value: any): void;\\n    transformToDocument(source: Node): Document;\\n    transformToFragment(source: Node, document: Document): DocumentFragment;\\n}\\n\\ndeclare var XSLTProcessor: {\\n    prototype: XSLTProcessor;\\n    new(): XSLTProcessor;\\n};\\n\\ninterface webkitRTCPeerConnection extends RTCPeerConnection {\\n    addEventListener<K extends keyof RTCPeerConnectionEventMap>(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof RTCPeerConnectionEventMap>(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var webkitRTCPeerConnection: {\\n    prototype: webkitRTCPeerConnection;\\n    new(configuration: RTCConfiguration): webkitRTCPeerConnection;\\n};\\n\\ndeclare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;\\n\\ninterface Console {\\n    memory: any;\\n    assert(condition?: boolean, ...data: any[]): void;\\n    clear(): void;\\n    count(label?: string): void;\\n    countReset(label?: string): void;\\n    debug(...data: any[]): void;\\n    dir(item?: any, options?: any): void;\\n    dirxml(...data: any[]): void;\\n    error(...data: any[]): void;\\n    exception(message?: string, ...optionalParams: any[]): void;\\n    group(...data: any[]): void;\\n    groupCollapsed(...data: any[]): void;\\n    groupEnd(): void;\\n    info(...data: any[]): void;\\n    log(...data: any[]): void;\\n    table(tabularData?: any, properties?: string[]): void;\\n    time(label?: string): void;\\n    timeEnd(label?: string): void;\\n    timeLog(label?: string, ...data: any[]): void;\\n    timeStamp(label?: string): void;\\n    trace(...data: any[]): void;\\n    warn(...data: any[]): void;\\n}\\n\\ndeclare var console: Console;\\n\\n/** Holds useful CSS-related methods. No object with this interface are implemented: it contains only static methods and therefore is a utilitarian interface. */\\ndeclare namespace CSS {\\n    function escape(ident: string): string;\\n    function supports(property: string, value: string): boolean;\\n    function supports(conditionText: string): boolean;\\n}\\n\\ndeclare namespace WebAssembly {\\n    interface CompileError {\\n    }\\n    \\n    var CompileError: {\\n        prototype: CompileError;\\n        new(): CompileError;\\n    };\\n    \\n    interface Global {\\n        value: any;\\n        valueOf(): any;\\n    }\\n    \\n    var Global: {\\n        prototype: Global;\\n        new(descriptor: GlobalDescriptor, v?: any): Global;\\n    };\\n    \\n    interface Instance {\\n        readonly exports: Exports;\\n    }\\n    \\n    var Instance: {\\n        prototype: Instance;\\n        new(module: Module, importObject?: Imports): Instance;\\n    };\\n    \\n    interface LinkError {\\n    }\\n    \\n    var LinkError: {\\n        prototype: LinkError;\\n        new(): LinkError;\\n    };\\n    \\n    interface Memory {\\n        readonly buffer: ArrayBuffer;\\n        grow(delta: number): number;\\n    }\\n    \\n    var Memory: {\\n        prototype: Memory;\\n        new(descriptor: MemoryDescriptor): Memory;\\n    };\\n    \\n    interface Module {\\n    }\\n    \\n    var Module: {\\n        prototype: Module;\\n        new(bytes: BufferSource): Module;\\n        customSections(moduleObject: Module, sectionName: string): ArrayBuffer[];\\n        exports(moduleObject: Module): ModuleExportDescriptor[];\\n        imports(moduleObject: Module): ModuleImportDescriptor[];\\n    };\\n    \\n    interface RuntimeError {\\n    }\\n    \\n    var RuntimeError: {\\n        prototype: RuntimeError;\\n        new(): RuntimeError;\\n    };\\n    \\n    interface Table {\\n        readonly length: number;\\n        get(index: number): Function | null;\\n        grow(delta: number): number;\\n        set(index: number, value: Function | null): void;\\n    }\\n    \\n    var Table: {\\n        prototype: Table;\\n        new(descriptor: TableDescriptor): Table;\\n    };\\n    \\n    interface GlobalDescriptor {\\n        mutable?: boolean;\\n        value: ValueType;\\n    }\\n    \\n    interface MemoryDescriptor {\\n        initial: number;\\n        maximum?: number;\\n    }\\n    \\n    interface ModuleExportDescriptor {\\n        kind: ImportExportKind;\\n        name: string;\\n    }\\n    \\n    interface ModuleImportDescriptor {\\n        kind: ImportExportKind;\\n        module: string;\\n        name: string;\\n    }\\n    \\n    interface TableDescriptor {\\n        element: TableKind;\\n        initial: number;\\n        maximum?: number;\\n    }\\n    \\n    interface WebAssemblyInstantiatedSource {\\n        instance: Instance;\\n        module: Module;\\n    }\\n    \\n    type ImportExportKind = \\\"function\\\" | \\\"global\\\" | \\\"memory\\\" | \\\"table\\\";\\n    type TableKind = \\\"anyfunc\\\";\\n    type ValueType = \\\"f32\\\" | \\\"f64\\\" | \\\"i32\\\" | \\\"i64\\\";\\n    type ExportValue = Function | Global | Memory | Table;\\n    type Exports = Record<string, ExportValue>;\\n    type ImportValue = ExportValue | number;\\n    type ModuleImports = Record<string, ImportValue>;\\n    type Imports = Record<string, ModuleImports>;\\n    function compile(bytes: BufferSource): Promise<Module>;\\n    function compileStreaming(source: Response | Promise<Response>): Promise<Module>;\\n    function instantiate(bytes: BufferSource, importObject?: Imports): Promise<WebAssemblyInstantiatedSource>;\\n    function instantiate(moduleObject: Module, importObject?: Imports): Promise<Instance>;\\n    function instantiateStreaming(response: Response | PromiseLike<Response>, importObject?: Imports): Promise<WebAssemblyInstantiatedSource>;\\n    function validate(bytes: BufferSource): boolean;\\n}\\n\\ninterface BlobCallback {\\n    (blob: Blob | null): void;\\n}\\n\\ninterface CustomElementConstructor {\\n    new (...params: any[]): HTMLElement;\\n}\\n\\ninterface DecodeErrorCallback {\\n    (error: DOMException): void;\\n}\\n\\ninterface DecodeSuccessCallback {\\n    (decodedData: AudioBuffer): void;\\n}\\n\\ninterface EventHandlerNonNull {\\n    (event: Event): any;\\n}\\n\\ninterface ForEachCallback {\\n    (keyId: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, status: MediaKeyStatus): void;\\n}\\n\\ninterface FrameRequestCallback {\\n    (time: number): void;\\n}\\n\\ninterface FunctionStringCallback {\\n    (data: string): void;\\n}\\n\\ninterface IntersectionObserverCallback {\\n    (entries: IntersectionObserverEntry[], observer: IntersectionObserver): void;\\n}\\n\\ninterface MSLaunchUriCallback {\\n    (): void;\\n}\\n\\ninterface MutationCallback {\\n    (mutations: MutationRecord[], observer: MutationObserver): void;\\n}\\n\\ninterface NavigatorUserMediaErrorCallback {\\n    (error: MediaStreamError): void;\\n}\\n\\ninterface NavigatorUserMediaSuccessCallback {\\n    (stream: MediaStream): void;\\n}\\n\\ninterface NotificationPermissionCallback {\\n    (permission: NotificationPermission): void;\\n}\\n\\ninterface OnBeforeUnloadEventHandlerNonNull {\\n    (event: Event): string | null;\\n}\\n\\ninterface OnErrorEventHandlerNonNull {\\n    (event: Event | string, source?: string, lineno?: number, colno?: number, error?: Error): any;\\n}\\n\\ninterface PerformanceObserverCallback {\\n    (entries: PerformanceObserverEntryList, observer: PerformanceObserver): void;\\n}\\n\\ninterface PositionCallback {\\n    (position: GeolocationPosition): void;\\n}\\n\\ninterface PositionErrorCallback {\\n    (positionError: GeolocationPositionError): void;\\n}\\n\\ninterface QueuingStrategySize<T = any> {\\n    (chunk: T): number;\\n}\\n\\ninterface RTCPeerConnectionErrorCallback {\\n    (error: DOMException): void;\\n}\\n\\ninterface RTCSessionDescriptionCallback {\\n    (description: RTCSessionDescriptionInit): void;\\n}\\n\\ninterface RTCStatsCallback {\\n    (report: RTCStatsReport): void;\\n}\\n\\ninterface ResizeObserverCallback {\\n    (entries: ResizeObserverEntry[], observer: ResizeObserver): void;\\n}\\n\\ninterface TransformerFlushCallback<O> {\\n    (controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;\\n}\\n\\ninterface TransformerStartCallback<O> {\\n    (controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;\\n}\\n\\ninterface TransformerTransformCallback<I, O> {\\n    (chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;\\n}\\n\\ninterface UnderlyingSinkAbortCallback {\\n    (reason: any): void | PromiseLike<void>;\\n}\\n\\ninterface UnderlyingSinkCloseCallback {\\n    (): void | PromiseLike<void>;\\n}\\n\\ninterface UnderlyingSinkStartCallback {\\n    (controller: WritableStreamDefaultController): void | PromiseLike<void>;\\n}\\n\\ninterface UnderlyingSinkWriteCallback<W> {\\n    (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike<void>;\\n}\\n\\ninterface UnderlyingSourceCancelCallback {\\n    (reason: any): void | PromiseLike<void>;\\n}\\n\\ninterface UnderlyingSourcePullCallback<R> {\\n    (controller: ReadableStreamController<R>): void | PromiseLike<void>;\\n}\\n\\ninterface UnderlyingSourceStartCallback<R> {\\n    (controller: ReadableStreamController<R>): void | PromiseLike<void>;\\n}\\n\\ninterface VoidFunction {\\n    (): void;\\n}\\n\\ninterface HTMLElementTagNameMap {\\n    \\\"a\\\": HTMLAnchorElement;\\n    \\\"abbr\\\": HTMLElement;\\n    \\\"address\\\": HTMLElement;\\n    \\\"applet\\\": HTMLAppletElement;\\n    \\\"area\\\": HTMLAreaElement;\\n    \\\"article\\\": HTMLElement;\\n    \\\"aside\\\": HTMLElement;\\n    \\\"audio\\\": HTMLAudioElement;\\n    \\\"b\\\": HTMLElement;\\n    \\\"base\\\": HTMLBaseElement;\\n    \\\"basefont\\\": HTMLBaseFontElement;\\n    \\\"bdi\\\": HTMLElement;\\n    \\\"bdo\\\": HTMLElement;\\n    \\\"blockquote\\\": HTMLQuoteElement;\\n    \\\"body\\\": HTMLBodyElement;\\n    \\\"br\\\": HTMLBRElement;\\n    \\\"button\\\": HTMLButtonElement;\\n    \\\"canvas\\\": HTMLCanvasElement;\\n    \\\"caption\\\": HTMLTableCaptionElement;\\n    \\\"cite\\\": HTMLElement;\\n    \\\"code\\\": HTMLElement;\\n    \\\"col\\\": HTMLTableColElement;\\n    \\\"colgroup\\\": HTMLTableColElement;\\n    \\\"data\\\": HTMLDataElement;\\n    \\\"datalist\\\": HTMLDataListElement;\\n    \\\"dd\\\": HTMLElement;\\n    \\\"del\\\": HTMLModElement;\\n    \\\"details\\\": HTMLDetailsElement;\\n    \\\"dfn\\\": HTMLElement;\\n    \\\"dialog\\\": HTMLDialogElement;\\n    \\\"dir\\\": HTMLDirectoryElement;\\n    \\\"div\\\": HTMLDivElement;\\n    \\\"dl\\\": HTMLDListElement;\\n    \\\"dt\\\": HTMLElement;\\n    \\\"em\\\": HTMLElement;\\n    \\\"embed\\\": HTMLEmbedElement;\\n    \\\"fieldset\\\": HTMLFieldSetElement;\\n    \\\"figcaption\\\": HTMLElement;\\n    \\\"figure\\\": HTMLElement;\\n    \\\"font\\\": HTMLFontElement;\\n    \\\"footer\\\": HTMLElement;\\n    \\\"form\\\": HTMLFormElement;\\n    \\\"frame\\\": HTMLFrameElement;\\n    \\\"frameset\\\": HTMLFrameSetElement;\\n    \\\"h1\\\": HTMLHeadingElement;\\n    \\\"h2\\\": HTMLHeadingElement;\\n    \\\"h3\\\": HTMLHeadingElement;\\n    \\\"h4\\\": HTMLHeadingElement;\\n    \\\"h5\\\": HTMLHeadingElement;\\n    \\\"h6\\\": HTMLHeadingElement;\\n    \\\"head\\\": HTMLHeadElement;\\n    \\\"header\\\": HTMLElement;\\n    \\\"hgroup\\\": HTMLElement;\\n    \\\"hr\\\": HTMLHRElement;\\n    \\\"html\\\": HTMLHtmlElement;\\n    \\\"i\\\": HTMLElement;\\n    \\\"iframe\\\": HTMLIFrameElement;\\n    \\\"img\\\": HTMLImageElement;\\n    \\\"input\\\": HTMLInputElement;\\n    \\\"ins\\\": HTMLModElement;\\n    \\\"kbd\\\": HTMLElement;\\n    \\\"label\\\": HTMLLabelElement;\\n    \\\"legend\\\": HTMLLegendElement;\\n    \\\"li\\\": HTMLLIElement;\\n    \\\"link\\\": HTMLLinkElement;\\n    \\\"main\\\": HTMLElement;\\n    \\\"map\\\": HTMLMapElement;\\n    \\\"mark\\\": HTMLElement;\\n    \\\"marquee\\\": HTMLMarqueeElement;\\n    \\\"menu\\\": HTMLMenuElement;\\n    \\\"meta\\\": HTMLMetaElement;\\n    \\\"meter\\\": HTMLMeterElement;\\n    \\\"nav\\\": HTMLElement;\\n    \\\"noscript\\\": HTMLElement;\\n    \\\"object\\\": HTMLObjectElement;\\n    \\\"ol\\\": HTMLOListElement;\\n    \\\"optgroup\\\": HTMLOptGroupElement;\\n    \\\"option\\\": HTMLOptionElement;\\n    \\\"output\\\": HTMLOutputElement;\\n    \\\"p\\\": HTMLParagraphElement;\\n    \\\"param\\\": HTMLParamElement;\\n    \\\"picture\\\": HTMLPictureElement;\\n    \\\"pre\\\": HTMLPreElement;\\n    \\\"progress\\\": HTMLProgressElement;\\n    \\\"q\\\": HTMLQuoteElement;\\n    \\\"rp\\\": HTMLElement;\\n    \\\"rt\\\": HTMLElement;\\n    \\\"ruby\\\": HTMLElement;\\n    \\\"s\\\": HTMLElement;\\n    \\\"samp\\\": HTMLElement;\\n    \\\"script\\\": HTMLScriptElement;\\n    \\\"section\\\": HTMLElement;\\n    \\\"select\\\": HTMLSelectElement;\\n    \\\"slot\\\": HTMLSlotElement;\\n    \\\"small\\\": HTMLElement;\\n    \\\"source\\\": HTMLSourceElement;\\n    \\\"span\\\": HTMLSpanElement;\\n    \\\"strong\\\": HTMLElement;\\n    \\\"style\\\": HTMLStyleElement;\\n    \\\"sub\\\": HTMLElement;\\n    \\\"summary\\\": HTMLElement;\\n    \\\"sup\\\": HTMLElement;\\n    \\\"table\\\": HTMLTableElement;\\n    \\\"tbody\\\": HTMLTableSectionElement;\\n    \\\"td\\\": HTMLTableDataCellElement;\\n    \\\"template\\\": HTMLTemplateElement;\\n    \\\"textarea\\\": HTMLTextAreaElement;\\n    \\\"tfoot\\\": HTMLTableSectionElement;\\n    \\\"th\\\": HTMLTableHeaderCellElement;\\n    \\\"thead\\\": HTMLTableSectionElement;\\n    \\\"time\\\": HTMLTimeElement;\\n    \\\"title\\\": HTMLTitleElement;\\n    \\\"tr\\\": HTMLTableRowElement;\\n    \\\"track\\\": HTMLTrackElement;\\n    \\\"u\\\": HTMLElement;\\n    \\\"ul\\\": HTMLUListElement;\\n    \\\"var\\\": HTMLElement;\\n    \\\"video\\\": HTMLVideoElement;\\n    \\\"wbr\\\": HTMLElement;\\n}\\n\\ninterface HTMLElementDeprecatedTagNameMap {\\n    \\\"listing\\\": HTMLPreElement;\\n    \\\"xmp\\\": HTMLPreElement;\\n}\\n\\ninterface SVGElementTagNameMap {\\n    \\\"a\\\": SVGAElement;\\n    \\\"circle\\\": SVGCircleElement;\\n    \\\"clipPath\\\": SVGClipPathElement;\\n    \\\"defs\\\": SVGDefsElement;\\n    \\\"desc\\\": SVGDescElement;\\n    \\\"ellipse\\\": SVGEllipseElement;\\n    \\\"feBlend\\\": SVGFEBlendElement;\\n    \\\"feColorMatrix\\\": SVGFEColorMatrixElement;\\n    \\\"feComponentTransfer\\\": SVGFEComponentTransferElement;\\n    \\\"feComposite\\\": SVGFECompositeElement;\\n    \\\"feConvolveMatrix\\\": SVGFEConvolveMatrixElement;\\n    \\\"feDiffuseLighting\\\": SVGFEDiffuseLightingElement;\\n    \\\"feDisplacementMap\\\": SVGFEDisplacementMapElement;\\n    \\\"feDistantLight\\\": SVGFEDistantLightElement;\\n    \\\"feFlood\\\": SVGFEFloodElement;\\n    \\\"feFuncA\\\": SVGFEFuncAElement;\\n    \\\"feFuncB\\\": SVGFEFuncBElement;\\n    \\\"feFuncG\\\": SVGFEFuncGElement;\\n    \\\"feFuncR\\\": SVGFEFuncRElement;\\n    \\\"feGaussianBlur\\\": SVGFEGaussianBlurElement;\\n    \\\"feImage\\\": SVGFEImageElement;\\n    \\\"feMerge\\\": SVGFEMergeElement;\\n    \\\"feMergeNode\\\": SVGFEMergeNodeElement;\\n    \\\"feMorphology\\\": SVGFEMorphologyElement;\\n    \\\"feOffset\\\": SVGFEOffsetElement;\\n    \\\"fePointLight\\\": SVGFEPointLightElement;\\n    \\\"feSpecularLighting\\\": SVGFESpecularLightingElement;\\n    \\\"feSpotLight\\\": SVGFESpotLightElement;\\n    \\\"feTile\\\": SVGFETileElement;\\n    \\\"feTurbulence\\\": SVGFETurbulenceElement;\\n    \\\"filter\\\": SVGFilterElement;\\n    \\\"foreignObject\\\": SVGForeignObjectElement;\\n    \\\"g\\\": SVGGElement;\\n    \\\"image\\\": SVGImageElement;\\n    \\\"line\\\": SVGLineElement;\\n    \\\"linearGradient\\\": SVGLinearGradientElement;\\n    \\\"marker\\\": SVGMarkerElement;\\n    \\\"mask\\\": SVGMaskElement;\\n    \\\"metadata\\\": SVGMetadataElement;\\n    \\\"path\\\": SVGPathElement;\\n    \\\"pattern\\\": SVGPatternElement;\\n    \\\"polygon\\\": SVGPolygonElement;\\n    \\\"polyline\\\": SVGPolylineElement;\\n    \\\"radialGradient\\\": SVGRadialGradientElement;\\n    \\\"rect\\\": SVGRectElement;\\n    \\\"script\\\": SVGScriptElement;\\n    \\\"stop\\\": SVGStopElement;\\n    \\\"style\\\": SVGStyleElement;\\n    \\\"svg\\\": SVGSVGElement;\\n    \\\"switch\\\": SVGSwitchElement;\\n    \\\"symbol\\\": SVGSymbolElement;\\n    \\\"text\\\": SVGTextElement;\\n    \\\"textPath\\\": SVGTextPathElement;\\n    \\\"title\\\": SVGTitleElement;\\n    \\\"tspan\\\": SVGTSpanElement;\\n    \\\"use\\\": SVGUseElement;\\n    \\\"view\\\": SVGViewElement;\\n}\\n\\n/** @deprecated Directly use HTMLElementTagNameMap or SVGElementTagNameMap as appropriate, instead. */\\ntype ElementTagNameMap = HTMLElementTagNameMap & Pick<SVGElementTagNameMap, Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>>;\\n\\ndeclare var Audio: {\\n    new(src?: string): HTMLAudioElement;\\n};\\ndeclare var Image: {\\n    new(width?: number, height?: number): HTMLImageElement;\\n};\\ndeclare var Option: {\\n    new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement;\\n};\\ndeclare var applicationCache: ApplicationCache;\\ndeclare var clientInformation: Navigator;\\ndeclare var closed: boolean;\\ndeclare var customElements: CustomElementRegistry;\\ndeclare var defaultStatus: string;\\ndeclare var devicePixelRatio: number;\\ndeclare var doNotTrack: string;\\ndeclare var document: Document;\\n/** @deprecated */\\ndeclare var event: Event | undefined;\\n/** @deprecated */\\ndeclare var external: External;\\ndeclare var frameElement: Element | null;\\ndeclare var frames: Window;\\ndeclare var history: History;\\ndeclare var innerHeight: number;\\ndeclare var innerWidth: number;\\ndeclare var length: number;\\ndeclare var location: Location;\\ndeclare var locationbar: BarProp;\\ndeclare var menubar: BarProp;\\ndeclare var msContentScript: ExtensionScriptApis;\\n/** @deprecated */\\ndeclare const name: void;\\ndeclare var navigator: Navigator;\\ndeclare var offscreenBuffering: string | boolean;\\ndeclare var oncompassneedscalibration: ((this: Window, ev: Event) => any) | null;\\ndeclare var ondevicelight: ((this: Window, ev: DeviceLightEvent) => any) | null;\\ndeclare var ondevicemotion: ((this: Window, ev: DeviceMotionEvent) => any) | null;\\ndeclare var ondeviceorientation: ((this: Window, ev: DeviceOrientationEvent) => any) | null;\\ndeclare var ondeviceorientationabsolute: ((this: Window, ev: DeviceOrientationEvent) => any) | null;\\ndeclare var ongamepadconnected: ((this: Window, ev: GamepadEvent) => any) | null;\\ndeclare var ongamepaddisconnected: ((this: Window, ev: GamepadEvent) => any) | null;\\ndeclare var onmousewheel: ((this: Window, ev: Event) => any) | null;\\ndeclare var onmsgesturechange: ((this: Window, ev: Event) => any) | null;\\ndeclare var onmsgesturedoubletap: ((this: Window, ev: Event) => any) | null;\\ndeclare var onmsgestureend: ((this: Window, ev: Event) => any) | null;\\ndeclare var onmsgesturehold: ((this: Window, ev: Event) => any) | null;\\ndeclare var onmsgesturestart: ((this: Window, ev: Event) => any) | null;\\ndeclare var onmsgesturetap: ((this: Window, ev: Event) => any) | null;\\ndeclare var onmsinertiastart: ((this: Window, ev: Event) => any) | null;\\ndeclare var onmspointercancel: ((this: Window, ev: Event) => any) | null;\\ndeclare var onmspointerdown: ((this: Window, ev: Event) => any) | null;\\ndeclare var onmspointerenter: ((this: Window, ev: Event) => any) | null;\\ndeclare var onmspointerleave: ((this: Window, ev: Event) => any) | null;\\ndeclare var onmspointermove: ((this: Window, ev: Event) => any) | null;\\ndeclare var onmspointerout: ((this: Window, ev: Event) => any) | null;\\ndeclare var onmspointerover: ((this: Window, ev: Event) => any) | null;\\ndeclare var onmspointerup: ((this: Window, ev: Event) => any) | null;\\n/** @deprecated */\\ndeclare var onorientationchange: ((this: Window, ev: Event) => any) | null;\\ndeclare var onreadystatechange: ((this: Window, ev: ProgressEvent<Window>) => any) | null;\\ndeclare var onvrdisplayactivate: ((this: Window, ev: Event) => any) | null;\\ndeclare var onvrdisplayblur: ((this: Window, ev: Event) => any) | null;\\ndeclare var onvrdisplayconnect: ((this: Window, ev: Event) => any) | null;\\ndeclare var onvrdisplaydeactivate: ((this: Window, ev: Event) => any) | null;\\ndeclare var onvrdisplaydisconnect: ((this: Window, ev: Event) => any) | null;\\ndeclare var onvrdisplayfocus: ((this: Window, ev: Event) => any) | null;\\ndeclare var onvrdisplaypointerrestricted: ((this: Window, ev: Event) => any) | null;\\ndeclare var onvrdisplaypointerunrestricted: ((this: Window, ev: Event) => any) | null;\\ndeclare var onvrdisplaypresentchange: ((this: Window, ev: Event) => any) | null;\\ndeclare var opener: any;\\n/** @deprecated */\\ndeclare var orientation: string | number;\\ndeclare var outerHeight: number;\\ndeclare var outerWidth: number;\\ndeclare var pageXOffset: number;\\ndeclare var pageYOffset: number;\\ndeclare var parent: Window;\\ndeclare var personalbar: BarProp;\\ndeclare var screen: Screen;\\ndeclare var screenLeft: number;\\ndeclare var screenTop: number;\\ndeclare var screenX: number;\\ndeclare var screenY: number;\\ndeclare var scrollX: number;\\ndeclare var scrollY: number;\\ndeclare var scrollbars: BarProp;\\ndeclare var self: Window & typeof globalThis;\\ndeclare var speechSynthesis: SpeechSynthesis;\\ndeclare var status: string;\\ndeclare var statusbar: BarProp;\\ndeclare var styleMedia: StyleMedia;\\ndeclare var toolbar: BarProp;\\ndeclare var top: Window;\\ndeclare var visualViewport: VisualViewport;\\ndeclare var window: Window & typeof globalThis;\\ndeclare function alert(message?: any): void;\\ndeclare function blur(): void;\\n/** @deprecated */\\ndeclare function captureEvents(): void;\\ndeclare function close(): void;\\ndeclare function confirm(message?: string): boolean;\\ndeclare function departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;\\ndeclare function focus(): void;\\ndeclare function getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;\\ndeclare function getMatchedCSSRules(elt: Element, pseudoElt?: string | null): CSSRuleList;\\ndeclare function getSelection(): Selection | null;\\ndeclare function matchMedia(query: string): MediaQueryList;\\ndeclare function moveBy(x: number, y: number): void;\\ndeclare function moveTo(x: number, y: number): void;\\ndeclare function msWriteProfilerMark(profilerMarkName: string): void;\\ndeclare function open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;\\ndeclare function postMessage(message: any, targetOrigin: string, transfer?: Transferable[]): void;\\ndeclare function print(): void;\\ndeclare function prompt(message?: string, _default?: string): string | null;\\n/** @deprecated */\\ndeclare function releaseEvents(): void;\\ndeclare function resizeBy(x: number, y: number): void;\\ndeclare function resizeTo(width: number, height: number): void;\\ndeclare function scroll(options?: ScrollToOptions): void;\\ndeclare function scroll(x: number, y: number): void;\\ndeclare function scrollBy(options?: ScrollToOptions): void;\\ndeclare function scrollBy(x: number, y: number): void;\\ndeclare function scrollTo(options?: ScrollToOptions): void;\\ndeclare function scrollTo(x: number, y: number): void;\\ndeclare function stop(): void;\\ndeclare function webkitCancelAnimationFrame(handle: number): void;\\ndeclare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;\\ndeclare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;\\ndeclare function webkitRequestAnimationFrame(callback: FrameRequestCallback): number;\\ndeclare function toString(): string;\\n/**\\n * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.\\n */\\ndeclare function dispatchEvent(event: Event): boolean;\\ndeclare var sessionStorage: Storage;\\ndeclare var localStorage: Storage;\\n/**\\n * Fires when the user aborts the download.\\n * @param ev The event.\\n */\\ndeclare var onabort: ((this: Window, ev: UIEvent) => any) | null;\\ndeclare var onanimationcancel: ((this: Window, ev: AnimationEvent) => any) | null;\\ndeclare var onanimationend: ((this: Window, ev: AnimationEvent) => any) | null;\\ndeclare var onanimationiteration: ((this: Window, ev: AnimationEvent) => any) | null;\\ndeclare var onanimationstart: ((this: Window, ev: AnimationEvent) => any) | null;\\ndeclare var onauxclick: ((this: Window, ev: MouseEvent) => any) | null;\\n/**\\n * Fires when the object loses the input focus.\\n * @param ev The focus event.\\n */\\ndeclare var onblur: ((this: Window, ev: FocusEvent) => any) | null;\\ndeclare var oncancel: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Occurs when playback is possible, but would require further buffering.\\n * @param ev The event.\\n */\\ndeclare var oncanplay: ((this: Window, ev: Event) => any) | null;\\ndeclare var oncanplaythrough: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Fires when the contents of the object or selection have changed.\\n * @param ev The event.\\n */\\ndeclare var onchange: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Fires when the user clicks the left mouse button on the object\\n * @param ev The mouse event.\\n */\\ndeclare var onclick: ((this: Window, ev: MouseEvent) => any) | null;\\ndeclare var onclose: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Fires when the user clicks the right mouse button in the client area, opening the context menu.\\n * @param ev The mouse event.\\n */\\ndeclare var oncontextmenu: ((this: Window, ev: MouseEvent) => any) | null;\\ndeclare var oncuechange: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Fires when the user double-clicks the object.\\n * @param ev The mouse event.\\n */\\ndeclare var ondblclick: ((this: Window, ev: MouseEvent) => any) | null;\\n/**\\n * Fires on the source object continuously during a drag operation.\\n * @param ev The event.\\n */\\ndeclare var ondrag: ((this: Window, ev: DragEvent) => any) | null;\\n/**\\n * Fires on the source object when the user releases the mouse at the close of a drag operation.\\n * @param ev The event.\\n */\\ndeclare var ondragend: ((this: Window, ev: DragEvent) => any) | null;\\n/**\\n * Fires on the target element when the user drags the object to a valid drop target.\\n * @param ev The drag event.\\n */\\ndeclare var ondragenter: ((this: Window, ev: DragEvent) => any) | null;\\ndeclare var ondragexit: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.\\n * @param ev The drag event.\\n */\\ndeclare var ondragleave: ((this: Window, ev: DragEvent) => any) | null;\\n/**\\n * Fires on the target element continuously while the user drags the object over a valid drop target.\\n * @param ev The event.\\n */\\ndeclare var ondragover: ((this: Window, ev: DragEvent) => any) | null;\\n/**\\n * Fires on the source object when the user starts to drag a text selection or selected object.\\n * @param ev The event.\\n */\\ndeclare var ondragstart: ((this: Window, ev: DragEvent) => any) | null;\\ndeclare var ondrop: ((this: Window, ev: DragEvent) => any) | null;\\n/**\\n * Occurs when the duration attribute is updated.\\n * @param ev The event.\\n */\\ndeclare var ondurationchange: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Occurs when the media element is reset to its initial state.\\n * @param ev The event.\\n */\\ndeclare var onemptied: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Occurs when the end of playback is reached.\\n * @param ev The event\\n */\\ndeclare var onended: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Fires when an error occurs during object loading.\\n * @param ev The event.\\n */\\ndeclare var onerror: OnErrorEventHandler;\\n/**\\n * Fires when the object receives focus.\\n * @param ev The event.\\n */\\ndeclare var onfocus: ((this: Window, ev: FocusEvent) => any) | null;\\ndeclare var ongotpointercapture: ((this: Window, ev: PointerEvent) => any) | null;\\ndeclare var oninput: ((this: Window, ev: Event) => any) | null;\\ndeclare var oninvalid: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Fires when the user presses a key.\\n * @param ev The keyboard event\\n */\\ndeclare var onkeydown: ((this: Window, ev: KeyboardEvent) => any) | null;\\n/**\\n * Fires when the user presses an alphanumeric key.\\n * @param ev The event.\\n */\\ndeclare var onkeypress: ((this: Window, ev: KeyboardEvent) => any) | null;\\n/**\\n * Fires when the user releases a key.\\n * @param ev The keyboard event\\n */\\ndeclare var onkeyup: ((this: Window, ev: KeyboardEvent) => any) | null;\\n/**\\n * Fires immediately after the browser loads the object.\\n * @param ev The event.\\n */\\ndeclare var onload: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Occurs when media data is loaded at the current playback position.\\n * @param ev The event.\\n */\\ndeclare var onloadeddata: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Occurs when the duration and dimensions of the media have been determined.\\n * @param ev The event.\\n */\\ndeclare var onloadedmetadata: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Occurs when Internet Explorer begins looking for media data.\\n * @param ev The event.\\n */\\ndeclare var onloadstart: ((this: Window, ev: Event) => any) | null;\\ndeclare var onlostpointercapture: ((this: Window, ev: PointerEvent) => any) | null;\\n/**\\n * Fires when the user clicks the object with either mouse button.\\n * @param ev The mouse event.\\n */\\ndeclare var onmousedown: ((this: Window, ev: MouseEvent) => any) | null;\\ndeclare var onmouseenter: ((this: Window, ev: MouseEvent) => any) | null;\\ndeclare var onmouseleave: ((this: Window, ev: MouseEvent) => any) | null;\\n/**\\n * Fires when the user moves the mouse over the object.\\n * @param ev The mouse event.\\n */\\ndeclare var onmousemove: ((this: Window, ev: MouseEvent) => any) | null;\\n/**\\n * Fires when the user moves the mouse pointer outside the boundaries of the object.\\n * @param ev The mouse event.\\n */\\ndeclare var onmouseout: ((this: Window, ev: MouseEvent) => any) | null;\\n/**\\n * Fires when the user moves the mouse pointer into the object.\\n * @param ev The mouse event.\\n */\\ndeclare var onmouseover: ((this: Window, ev: MouseEvent) => any) | null;\\n/**\\n * Fires when the user releases a mouse button while the mouse is over the object.\\n * @param ev The mouse event.\\n */\\ndeclare var onmouseup: ((this: Window, ev: MouseEvent) => any) | null;\\n/**\\n * Occurs when playback is paused.\\n * @param ev The event.\\n */\\ndeclare var onpause: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Occurs when the play method is requested.\\n * @param ev The event.\\n */\\ndeclare var onplay: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Occurs when the audio or video has started playing.\\n * @param ev The event.\\n */\\ndeclare var onplaying: ((this: Window, ev: Event) => any) | null;\\ndeclare var onpointercancel: ((this: Window, ev: PointerEvent) => any) | null;\\ndeclare var onpointerdown: ((this: Window, ev: PointerEvent) => any) | null;\\ndeclare var onpointerenter: ((this: Window, ev: PointerEvent) => any) | null;\\ndeclare var onpointerleave: ((this: Window, ev: PointerEvent) => any) | null;\\ndeclare var onpointermove: ((this: Window, ev: PointerEvent) => any) | null;\\ndeclare var onpointerout: ((this: Window, ev: PointerEvent) => any) | null;\\ndeclare var onpointerover: ((this: Window, ev: PointerEvent) => any) | null;\\ndeclare var onpointerup: ((this: Window, ev: PointerEvent) => any) | null;\\n/**\\n * Occurs to indicate progress while downloading media data.\\n * @param ev The event.\\n */\\ndeclare var onprogress: ((this: Window, ev: ProgressEvent) => any) | null;\\n/**\\n * Occurs when the playback rate is increased or decreased.\\n * @param ev The event.\\n */\\ndeclare var onratechange: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Fires when the user resets a form.\\n * @param ev The event.\\n */\\ndeclare var onreset: ((this: Window, ev: Event) => any) | null;\\ndeclare var onresize: ((this: Window, ev: UIEvent) => any) | null;\\n/**\\n * Fires when the user repositions the scroll box in the scroll bar on the object.\\n * @param ev The event.\\n */\\ndeclare var onscroll: ((this: Window, ev: Event) => any) | null;\\ndeclare var onsecuritypolicyviolation: ((this: Window, ev: SecurityPolicyViolationEvent) => any) | null;\\n/**\\n * Occurs when the seek operation ends.\\n * @param ev The event.\\n */\\ndeclare var onseeked: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Occurs when the current playback position is moved.\\n * @param ev The event.\\n */\\ndeclare var onseeking: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Fires when the current selection changes.\\n * @param ev The event.\\n */\\ndeclare var onselect: ((this: Window, ev: Event) => any) | null;\\ndeclare var onselectionchange: ((this: Window, ev: Event) => any) | null;\\ndeclare var onselectstart: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Occurs when the download has stopped.\\n * @param ev The event.\\n */\\ndeclare var onstalled: ((this: Window, ev: Event) => any) | null;\\ndeclare var onsubmit: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Occurs if the load operation has been intentionally halted.\\n * @param ev The event.\\n */\\ndeclare var onsuspend: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Occurs to indicate the current playback position.\\n * @param ev The event.\\n */\\ndeclare var ontimeupdate: ((this: Window, ev: Event) => any) | null;\\ndeclare var ontoggle: ((this: Window, ev: Event) => any) | null;\\ndeclare var ontouchcancel: ((this: Window, ev: TouchEvent) => any) | null | undefined;\\ndeclare var ontouchend: ((this: Window, ev: TouchEvent) => any) | null | undefined;\\ndeclare var ontouchmove: ((this: Window, ev: TouchEvent) => any) | null | undefined;\\ndeclare var ontouchstart: ((this: Window, ev: TouchEvent) => any) | null | undefined;\\ndeclare var ontransitioncancel: ((this: Window, ev: TransitionEvent) => any) | null;\\ndeclare var ontransitionend: ((this: Window, ev: TransitionEvent) => any) | null;\\ndeclare var ontransitionrun: ((this: Window, ev: TransitionEvent) => any) | null;\\ndeclare var ontransitionstart: ((this: Window, ev: TransitionEvent) => any) | null;\\n/**\\n * Occurs when the volume is changed, or playback is muted or unmuted.\\n * @param ev The event.\\n */\\ndeclare var onvolumechange: ((this: Window, ev: Event) => any) | null;\\n/**\\n * Occurs when playback stops because the next frame of a video resource is not available.\\n * @param ev The event.\\n */\\ndeclare var onwaiting: ((this: Window, ev: Event) => any) | null;\\ndeclare var onwheel: ((this: Window, ev: WheelEvent) => any) | null;\\ndeclare function cancelAnimationFrame(handle: number): void;\\ndeclare function requestAnimationFrame(callback: FrameRequestCallback): number;\\ndeclare var caches: CacheStorage;\\ndeclare var crypto: Crypto;\\ndeclare var indexedDB: IDBFactory;\\ndeclare var isSecureContext: boolean;\\ndeclare var origin: string;\\ndeclare var performance: Performance;\\ndeclare function atob(data: string): string;\\ndeclare function btoa(data: string): string;\\ndeclare function clearInterval(handle?: number): void;\\ndeclare function clearTimeout(handle?: number): void;\\ndeclare function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;\\ndeclare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;\\ndeclare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;\\ndeclare function queueMicrotask(callback: VoidFunction): void;\\ndeclare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;\\ndeclare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;\\ndeclare var onafterprint: ((this: Window, ev: Event) => any) | null;\\ndeclare var onbeforeprint: ((this: Window, ev: Event) => any) | null;\\ndeclare var onbeforeunload: ((this: Window, ev: BeforeUnloadEvent) => any) | null;\\ndeclare var onhashchange: ((this: Window, ev: HashChangeEvent) => any) | null;\\ndeclare var onlanguagechange: ((this: Window, ev: Event) => any) | null;\\ndeclare var onmessage: ((this: Window, ev: MessageEvent) => any) | null;\\ndeclare var onmessageerror: ((this: Window, ev: MessageEvent) => any) | null;\\ndeclare var onoffline: ((this: Window, ev: Event) => any) | null;\\ndeclare var ononline: ((this: Window, ev: Event) => any) | null;\\ndeclare var onpagehide: ((this: Window, ev: PageTransitionEvent) => any) | null;\\ndeclare var onpageshow: ((this: Window, ev: PageTransitionEvent) => any) | null;\\ndeclare var onpopstate: ((this: Window, ev: PopStateEvent) => any) | null;\\ndeclare var onrejectionhandled: ((this: Window, ev: PromiseRejectionEvent) => any) | null;\\ndeclare var onstorage: ((this: Window, ev: StorageEvent) => any) | null;\\ndeclare var onunhandledrejection: ((this: Window, ev: PromiseRejectionEvent) => any) | null;\\ndeclare var onunload: ((this: Window, ev: Event) => any) | null;\\ndeclare function addEventListener<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\ndeclare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\ndeclare function removeEventListener<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\ndeclare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\ntype HeadersInit = Headers | string[][] | Record<string, string>;\\ntype BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream<Uint8Array> | string;\\ntype RequestInfo = Request | string;\\ntype BlobPart = BufferSource | Blob | string;\\ntype DOMHighResTimeStamp = number;\\ntype RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;\\ntype HTMLOrSVGImageElement = HTMLImageElement | SVGImageElement;\\ntype CanvasImageSource = HTMLOrSVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas;\\ntype OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;\\ntype MessageEventSource = WindowProxy | MessagePort | ServiceWorker;\\ntype HTMLOrSVGScriptElement = HTMLScriptElement | SVGScriptElement;\\ntype ImageBitmapSource = CanvasImageSource | Blob | ImageData;\\ntype MediaProvider = MediaStream | MediaSource | Blob;\\ntype OnErrorEventHandler = OnErrorEventHandlerNonNull | null;\\ntype OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull | null;\\ntype TimerHandler = string | Function;\\ntype ConstrainULong = number | ConstrainULongRange;\\ntype ConstrainDouble = number | ConstrainDoubleRange;\\ntype ConstrainBoolean = boolean | ConstrainBooleanParameters;\\ntype ConstrainDOMString = string | string[] | ConstrainDOMStringParameters;\\ntype PerformanceEntryList = PerformanceEntry[];\\ntype ReadableStreamReader<T> = ReadableStreamDefaultReader<T>;\\ntype ReadableStreamController<T> = ReadableStreamDefaultController<T>;\\ntype VibratePattern = number | number[];\\ntype COSEAlgorithmIdentifier = number;\\ntype UvmEntry = number[];\\ntype UvmEntries = UvmEntry[];\\ntype AlgorithmIdentifier = string | Algorithm;\\ntype HashAlgorithmIdentifier = AlgorithmIdentifier;\\ntype BigInteger = Uint8Array;\\ntype NamedCurve = string;\\ntype GLenum = number;\\ntype GLboolean = boolean;\\ntype GLbitfield = number;\\ntype GLint = number;\\ntype GLsizei = number;\\ntype GLintptr = number;\\ntype GLsizeiptr = number;\\ntype GLuint = number;\\ntype GLfloat = number;\\ntype GLclampf = number;\\ntype TexImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | OffscreenCanvas;\\ntype Float32List = Float32Array | GLfloat[];\\ntype Int32List = Int32Array | GLint[];\\ntype GLint64 = number;\\ntype GLuint64 = number;\\ntype Uint32List = Uint32Array | GLuint[];\\ntype BufferSource = ArrayBufferView | ArrayBuffer;\\ntype DOMTimeStamp = number;\\ntype LineAndPositionSetting = number | AutoKeyword;\\ntype FormDataEntryValue = File | string;\\ntype InsertPosition = \\\"beforebegin\\\" | \\\"afterbegin\\\" | \\\"beforeend\\\" | \\\"afterend\\\";\\ntype IDBValidKey = number | string | Date | BufferSource | IDBArrayKey;\\ntype MutationRecordType = \\\"attributes\\\" | \\\"characterData\\\" | \\\"childList\\\";\\ntype IDBKeyPath = string;\\ntype Transferable = ArrayBuffer | MessagePort | ImageBitmap | OffscreenCanvas;\\ntype RTCIceGatherCandidate = RTCIceCandidateDictionary | RTCIceCandidateComplete;\\ntype RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport;\\n/** @deprecated */\\ntype MouseWheelEvent = WheelEvent;\\ntype WindowProxy = Window;\\ntype ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult;\\ntype AlignSetting = \\\"center\\\" | \\\"end\\\" | \\\"left\\\" | \\\"right\\\" | \\\"start\\\";\\ntype AnimationPlayState = \\\"finished\\\" | \\\"idle\\\" | \\\"paused\\\" | \\\"running\\\";\\ntype AppendMode = \\\"segments\\\" | \\\"sequence\\\";\\ntype AttestationConveyancePreference = \\\"direct\\\" | \\\"enterprise\\\" | \\\"indirect\\\" | \\\"none\\\";\\ntype AudioContextLatencyCategory = \\\"balanced\\\" | \\\"interactive\\\" | \\\"playback\\\";\\ntype AudioContextState = \\\"closed\\\" | \\\"running\\\" | \\\"suspended\\\";\\ntype AuthenticatorAttachment = \\\"cross-platform\\\" | \\\"platform\\\";\\ntype AuthenticatorTransport = \\\"ble\\\" | \\\"internal\\\" | \\\"nfc\\\" | \\\"usb\\\";\\ntype AutoKeyword = \\\"auto\\\";\\ntype AutomationRate = \\\"a-rate\\\" | \\\"k-rate\\\";\\ntype BinaryType = \\\"arraybuffer\\\" | \\\"blob\\\";\\ntype BiquadFilterType = \\\"allpass\\\" | \\\"bandpass\\\" | \\\"highpass\\\" | \\\"highshelf\\\" | \\\"lowpass\\\" | \\\"lowshelf\\\" | \\\"notch\\\" | \\\"peaking\\\";\\ntype CanPlayTypeResult = \\\"\\\" | \\\"maybe\\\" | \\\"probably\\\";\\ntype CanvasDirection = \\\"inherit\\\" | \\\"ltr\\\" | \\\"rtl\\\";\\ntype CanvasFillRule = \\\"evenodd\\\" | \\\"nonzero\\\";\\ntype CanvasLineCap = \\\"butt\\\" | \\\"round\\\" | \\\"square\\\";\\ntype CanvasLineJoin = \\\"bevel\\\" | \\\"miter\\\" | \\\"round\\\";\\ntype CanvasTextAlign = \\\"center\\\" | \\\"end\\\" | \\\"left\\\" | \\\"right\\\" | \\\"start\\\";\\ntype CanvasTextBaseline = \\\"alphabetic\\\" | \\\"bottom\\\" | \\\"hanging\\\" | \\\"ideographic\\\" | \\\"middle\\\" | \\\"top\\\";\\ntype ChannelCountMode = \\\"clamped-max\\\" | \\\"explicit\\\" | \\\"max\\\";\\ntype ChannelInterpretation = \\\"discrete\\\" | \\\"speakers\\\";\\ntype ClientTypes = \\\"all\\\" | \\\"sharedworker\\\" | \\\"window\\\" | \\\"worker\\\";\\ntype ColorSpaceConversion = \\\"default\\\" | \\\"none\\\";\\ntype CompositeOperation = \\\"accumulate\\\" | \\\"add\\\" | \\\"replace\\\";\\ntype CompositeOperationOrAuto = \\\"accumulate\\\" | \\\"add\\\" | \\\"auto\\\" | \\\"replace\\\";\\ntype CredentialMediationRequirement = \\\"optional\\\" | \\\"required\\\" | \\\"silent\\\";\\ntype DOMParserSupportedType = \\\"application/xhtml+xml\\\" | \\\"application/xml\\\" | \\\"image/svg+xml\\\" | \\\"text/html\\\" | \\\"text/xml\\\";\\ntype DirectionSetting = \\\"\\\" | \\\"lr\\\" | \\\"rl\\\";\\ntype DisplayCaptureSurfaceType = \\\"application\\\" | \\\"browser\\\" | \\\"monitor\\\" | \\\"window\\\";\\ntype DistanceModelType = \\\"exponential\\\" | \\\"inverse\\\" | \\\"linear\\\";\\ntype DocumentReadyState = \\\"complete\\\" | \\\"interactive\\\" | \\\"loading\\\";\\ntype EndOfStreamError = \\\"decode\\\" | \\\"network\\\";\\ntype EndingType = \\\"native\\\" | \\\"transparent\\\";\\ntype FillMode = \\\"auto\\\" | \\\"backwards\\\" | \\\"both\\\" | \\\"forwards\\\" | \\\"none\\\";\\ntype FullscreenNavigationUI = \\\"auto\\\" | \\\"hide\\\" | \\\"show\\\";\\ntype GamepadHand = \\\"\\\" | \\\"left\\\" | \\\"right\\\";\\ntype GamepadHapticActuatorType = \\\"vibration\\\";\\ntype GamepadMappingType = \\\"\\\" | \\\"standard\\\";\\ntype IDBCursorDirection = \\\"next\\\" | \\\"nextunique\\\" | \\\"prev\\\" | \\\"prevunique\\\";\\ntype IDBRequestReadyState = \\\"done\\\" | \\\"pending\\\";\\ntype IDBTransactionMode = \\\"readonly\\\" | \\\"readwrite\\\" | \\\"versionchange\\\";\\ntype ImageOrientation = \\\"flipY\\\" | \\\"none\\\";\\ntype ImageSmoothingQuality = \\\"high\\\" | \\\"low\\\" | \\\"medium\\\";\\ntype IterationCompositeOperation = \\\"accumulate\\\" | \\\"replace\\\";\\ntype KeyFormat = \\\"jwk\\\" | \\\"pkcs8\\\" | \\\"raw\\\" | \\\"spki\\\";\\ntype KeyType = \\\"private\\\" | \\\"public\\\" | \\\"secret\\\";\\ntype KeyUsage = \\\"decrypt\\\" | \\\"deriveBits\\\" | \\\"deriveKey\\\" | \\\"encrypt\\\" | \\\"sign\\\" | \\\"unwrapKey\\\" | \\\"verify\\\" | \\\"wrapKey\\\";\\ntype LineAlignSetting = \\\"center\\\" | \\\"end\\\" | \\\"start\\\";\\ntype ListeningState = \\\"active\\\" | \\\"disambiguation\\\" | \\\"inactive\\\";\\ntype MSCredentialType = \\\"FIDO_2_0\\\";\\ntype MSTransportType = \\\"BT\\\" | \\\"Embedded\\\" | \\\"NFC\\\" | \\\"USB\\\";\\ntype MSWebViewPermissionState = \\\"allow\\\" | \\\"defer\\\" | \\\"deny\\\" | \\\"unknown\\\";\\ntype MSWebViewPermissionType = \\\"geolocation\\\" | \\\"media\\\" | \\\"pointerlock\\\" | \\\"unlimitedIndexedDBQuota\\\" | \\\"webnotifications\\\";\\ntype MediaDeviceKind = \\\"audioinput\\\" | \\\"audiooutput\\\" | \\\"videoinput\\\";\\ntype MediaKeyMessageType = \\\"individualization-request\\\" | \\\"license-release\\\" | \\\"license-renewal\\\" | \\\"license-request\\\";\\ntype MediaKeySessionType = \\\"persistent-license\\\" | \\\"temporary\\\";\\ntype MediaKeyStatus = \\\"expired\\\" | \\\"internal-error\\\" | \\\"output-downscaled\\\" | \\\"output-restricted\\\" | \\\"released\\\" | \\\"status-pending\\\" | \\\"usable\\\";\\ntype MediaKeysRequirement = \\\"not-allowed\\\" | \\\"optional\\\" | \\\"required\\\";\\ntype MediaStreamTrackState = \\\"ended\\\" | \\\"live\\\";\\ntype NavigationReason = \\\"down\\\" | \\\"left\\\" | \\\"right\\\" | \\\"up\\\";\\ntype NavigationType = \\\"back_forward\\\" | \\\"navigate\\\" | \\\"prerender\\\" | \\\"reload\\\";\\ntype NotificationDirection = \\\"auto\\\" | \\\"ltr\\\" | \\\"rtl\\\";\\ntype NotificationPermission = \\\"default\\\" | \\\"denied\\\" | \\\"granted\\\";\\ntype OffscreenRenderingContextId = \\\"2d\\\" | \\\"bitmaprenderer\\\" | \\\"webgl\\\" | \\\"webgl2\\\";\\ntype OrientationLockType = \\\"any\\\" | \\\"landscape\\\" | \\\"landscape-primary\\\" | \\\"landscape-secondary\\\" | \\\"natural\\\" | \\\"portrait\\\" | \\\"portrait-primary\\\" | \\\"portrait-secondary\\\";\\ntype OrientationType = \\\"landscape-primary\\\" | \\\"landscape-secondary\\\" | \\\"portrait-primary\\\" | \\\"portrait-secondary\\\";\\ntype OscillatorType = \\\"custom\\\" | \\\"sawtooth\\\" | \\\"sine\\\" | \\\"square\\\" | \\\"triangle\\\";\\ntype OverSampleType = \\\"2x\\\" | \\\"4x\\\" | \\\"none\\\";\\ntype PanningModelType = \\\"HRTF\\\" | \\\"equalpower\\\";\\ntype PaymentComplete = \\\"fail\\\" | \\\"success\\\" | \\\"unknown\\\";\\ntype PaymentShippingType = \\\"delivery\\\" | \\\"pickup\\\" | \\\"shipping\\\";\\ntype PermissionName = \\\"accelerometer\\\" | \\\"ambient-light-sensor\\\" | \\\"background-fetch\\\" | \\\"background-sync\\\" | \\\"bluetooth\\\" | \\\"camera\\\" | \\\"clipboard-read\\\" | \\\"clipboard-write\\\" | \\\"device-info\\\" | \\\"display-capture\\\" | \\\"geolocation\\\" | \\\"gyroscope\\\" | \\\"magnetometer\\\" | \\\"microphone\\\" | \\\"midi\\\" | \\\"nfc\\\" | \\\"notifications\\\" | \\\"persistent-storage\\\" | \\\"push\\\" | \\\"speaker\\\";\\ntype PermissionState = \\\"denied\\\" | \\\"granted\\\" | \\\"prompt\\\";\\ntype PlaybackDirection = \\\"alternate\\\" | \\\"alternate-reverse\\\" | \\\"normal\\\" | \\\"reverse\\\";\\ntype PositionAlignSetting = \\\"auto\\\" | \\\"center\\\" | \\\"line-left\\\" | \\\"line-right\\\";\\ntype PremultiplyAlpha = \\\"default\\\" | \\\"none\\\" | \\\"premultiply\\\";\\ntype PublicKeyCredentialType = \\\"public-key\\\";\\ntype PushEncryptionKeyName = \\\"auth\\\" | \\\"p256dh\\\";\\ntype PushPermissionState = \\\"denied\\\" | \\\"granted\\\" | \\\"prompt\\\";\\ntype RTCBundlePolicy = \\\"balanced\\\" | \\\"max-bundle\\\" | \\\"max-compat\\\";\\ntype RTCDataChannelState = \\\"closed\\\" | \\\"closing\\\" | \\\"connecting\\\" | \\\"open\\\";\\ntype RTCDegradationPreference = \\\"balanced\\\" | \\\"maintain-framerate\\\" | \\\"maintain-resolution\\\";\\ntype RTCDtlsRole = \\\"auto\\\" | \\\"client\\\" | \\\"server\\\";\\ntype RTCDtlsTransportState = \\\"closed\\\" | \\\"connected\\\" | \\\"connecting\\\" | \\\"failed\\\" | \\\"new\\\";\\ntype RTCDtxStatus = \\\"disabled\\\" | \\\"enabled\\\";\\ntype RTCErrorDetailType = \\\"data-channel-failure\\\" | \\\"dtls-failure\\\" | \\\"fingerprint-failure\\\" | \\\"hardware-encoder-error\\\" | \\\"hardware-encoder-not-available\\\" | \\\"idp-bad-script-failure\\\" | \\\"idp-execution-failure\\\" | \\\"idp-load-failure\\\" | \\\"idp-need-login\\\" | \\\"idp-timeout\\\" | \\\"idp-tls-failure\\\" | \\\"idp-token-expired\\\" | \\\"idp-token-invalid\\\" | \\\"sctp-failure\\\" | \\\"sdp-syntax-error\\\";\\ntype RTCIceCandidateType = \\\"host\\\" | \\\"prflx\\\" | \\\"relay\\\" | \\\"srflx\\\";\\ntype RTCIceComponent = \\\"rtcp\\\" | \\\"rtp\\\";\\ntype RTCIceConnectionState = \\\"checking\\\" | \\\"closed\\\" | \\\"completed\\\" | \\\"connected\\\" | \\\"disconnected\\\" | \\\"failed\\\" | \\\"new\\\";\\ntype RTCIceCredentialType = \\\"oauth\\\" | \\\"password\\\";\\ntype RTCIceGatherPolicy = \\\"all\\\" | \\\"nohost\\\" | \\\"relay\\\";\\ntype RTCIceGathererState = \\\"complete\\\" | \\\"gathering\\\" | \\\"new\\\";\\ntype RTCIceGatheringState = \\\"complete\\\" | \\\"gathering\\\" | \\\"new\\\";\\ntype RTCIceProtocol = \\\"tcp\\\" | \\\"udp\\\";\\ntype RTCIceRole = \\\"controlled\\\" | \\\"controlling\\\" | \\\"unknown\\\";\\ntype RTCIceTcpCandidateType = \\\"active\\\" | \\\"passive\\\" | \\\"so\\\";\\ntype RTCIceTransportPolicy = \\\"all\\\" | \\\"relay\\\";\\ntype RTCIceTransportState = \\\"checking\\\" | \\\"closed\\\" | \\\"completed\\\" | \\\"connected\\\" | \\\"disconnected\\\" | \\\"failed\\\" | \\\"new\\\";\\ntype RTCPeerConnectionState = \\\"closed\\\" | \\\"connected\\\" | \\\"connecting\\\" | \\\"disconnected\\\" | \\\"failed\\\" | \\\"new\\\";\\ntype RTCPriorityType = \\\"high\\\" | \\\"low\\\" | \\\"medium\\\" | \\\"very-low\\\";\\ntype RTCRtcpMuxPolicy = \\\"negotiate\\\" | \\\"require\\\";\\ntype RTCRtpTransceiverDirection = \\\"inactive\\\" | \\\"recvonly\\\" | \\\"sendonly\\\" | \\\"sendrecv\\\" | \\\"stopped\\\";\\ntype RTCSctpTransportState = \\\"closed\\\" | \\\"connected\\\" | \\\"connecting\\\";\\ntype RTCSdpType = \\\"answer\\\" | \\\"offer\\\" | \\\"pranswer\\\" | \\\"rollback\\\";\\ntype RTCSignalingState = \\\"closed\\\" | \\\"have-local-offer\\\" | \\\"have-local-pranswer\\\" | \\\"have-remote-offer\\\" | \\\"have-remote-pranswer\\\" | \\\"stable\\\";\\ntype RTCStatsIceCandidatePairState = \\\"failed\\\" | \\\"frozen\\\" | \\\"in-progress\\\" | \\\"succeeded\\\" | \\\"waiting\\\";\\ntype RTCStatsIceCandidateType = \\\"host\\\" | \\\"peerreflexive\\\" | \\\"relayed\\\" | \\\"serverreflexive\\\";\\ntype RTCStatsType = \\\"candidate-pair\\\" | \\\"certificate\\\" | \\\"codec\\\" | \\\"csrc\\\" | \\\"data-channel\\\" | \\\"ice-server\\\" | \\\"inbound-rtp\\\" | \\\"local-candidate\\\" | \\\"media-source\\\" | \\\"outbound-rtp\\\" | \\\"peer-connection\\\" | \\\"receiver\\\" | \\\"remote-candidate\\\" | \\\"remote-inbound-rtp\\\" | \\\"remote-outbound-rtp\\\" | \\\"sctp-transport\\\" | \\\"sender\\\" | \\\"stream\\\" | \\\"track\\\" | \\\"transceiver\\\" | \\\"transport\\\";\\ntype ReadyState = \\\"closed\\\" | \\\"ended\\\" | \\\"open\\\";\\ntype ReferrerPolicy = \\\"\\\" | \\\"no-referrer\\\" | \\\"no-referrer-when-downgrade\\\" | \\\"origin\\\" | \\\"origin-when-cross-origin\\\" | \\\"same-origin\\\" | \\\"strict-origin\\\" | \\\"strict-origin-when-cross-origin\\\" | \\\"unsafe-url\\\";\\ntype RequestCache = \\\"default\\\" | \\\"force-cache\\\" | \\\"no-cache\\\" | \\\"no-store\\\" | \\\"only-if-cached\\\" | \\\"reload\\\";\\ntype RequestCredentials = \\\"include\\\" | \\\"omit\\\" | \\\"same-origin\\\";\\ntype RequestDestination = \\\"\\\" | \\\"audio\\\" | \\\"audioworklet\\\" | \\\"document\\\" | \\\"embed\\\" | \\\"font\\\" | \\\"image\\\" | \\\"manifest\\\" | \\\"object\\\" | \\\"paintworklet\\\" | \\\"report\\\" | \\\"script\\\" | \\\"sharedworker\\\" | \\\"style\\\" | \\\"track\\\" | \\\"video\\\" | \\\"worker\\\" | \\\"xslt\\\";\\ntype RequestMode = \\\"cors\\\" | \\\"navigate\\\" | \\\"no-cors\\\" | \\\"same-origin\\\";\\ntype RequestRedirect = \\\"error\\\" | \\\"follow\\\" | \\\"manual\\\";\\ntype ResidentKeyRequirement = \\\"discouraged\\\" | \\\"preferred\\\" | \\\"required\\\";\\ntype ResizeObserverBoxOptions = \\\"border-box\\\" | \\\"content-box\\\" | \\\"device-pixel-content-box\\\";\\ntype ResizeQuality = \\\"high\\\" | \\\"low\\\" | \\\"medium\\\" | \\\"pixelated\\\";\\ntype ResponseType = \\\"basic\\\" | \\\"cors\\\" | \\\"default\\\" | \\\"error\\\" | \\\"opaque\\\" | \\\"opaqueredirect\\\";\\ntype ScopedCredentialType = \\\"ScopedCred\\\";\\ntype ScrollBehavior = \\\"auto\\\" | \\\"smooth\\\";\\ntype ScrollLogicalPosition = \\\"center\\\" | \\\"end\\\" | \\\"nearest\\\" | \\\"start\\\";\\ntype ScrollRestoration = \\\"auto\\\" | \\\"manual\\\";\\ntype ScrollSetting = \\\"\\\" | \\\"up\\\";\\ntype SelectionMode = \\\"end\\\" | \\\"preserve\\\" | \\\"select\\\" | \\\"start\\\";\\ntype ServiceWorkerState = \\\"activated\\\" | \\\"activating\\\" | \\\"installed\\\" | \\\"installing\\\" | \\\"parsed\\\" | \\\"redundant\\\";\\ntype ServiceWorkerUpdateViaCache = \\\"all\\\" | \\\"imports\\\" | \\\"none\\\";\\ntype ShadowRootMode = \\\"closed\\\" | \\\"open\\\";\\ntype SpeechRecognitionErrorCode = \\\"aborted\\\" | \\\"audio-capture\\\" | \\\"bad-grammar\\\" | \\\"language-not-supported\\\" | \\\"network\\\" | \\\"no-speech\\\" | \\\"not-allowed\\\" | \\\"service-not-allowed\\\";\\ntype SpeechSynthesisErrorCode = \\\"audio-busy\\\" | \\\"audio-hardware\\\" | \\\"canceled\\\" | \\\"interrupted\\\" | \\\"invalid-argument\\\" | \\\"language-unavailable\\\" | \\\"network\\\" | \\\"not-allowed\\\" | \\\"synthesis-failed\\\" | \\\"synthesis-unavailable\\\" | \\\"text-too-long\\\" | \\\"voice-unavailable\\\";\\ntype TextTrackKind = \\\"captions\\\" | \\\"chapters\\\" | \\\"descriptions\\\" | \\\"metadata\\\" | \\\"subtitles\\\";\\ntype TextTrackMode = \\\"disabled\\\" | \\\"hidden\\\" | \\\"showing\\\";\\ntype TouchType = \\\"direct\\\" | \\\"stylus\\\";\\ntype Transport = \\\"ble\\\" | \\\"nfc\\\" | \\\"usb\\\";\\ntype UserVerificationRequirement = \\\"discouraged\\\" | \\\"preferred\\\" | \\\"required\\\";\\ntype VRDisplayEventReason = \\\"mounted\\\" | \\\"navigation\\\" | \\\"requested\\\" | \\\"unmounted\\\";\\ntype VideoFacingModeEnum = \\\"environment\\\" | \\\"left\\\" | \\\"right\\\" | \\\"user\\\";\\ntype VisibilityState = \\\"hidden\\\" | \\\"visible\\\";\\ntype WebGLPowerPreference = \\\"default\\\" | \\\"high-performance\\\" | \\\"low-power\\\";\\ntype WorkerType = \\\"classic\\\" | \\\"module\\\";\\ntype XMLHttpRequestResponseType = \\\"\\\" | \\\"arraybuffer\\\" | \\\"blob\\\" | \\\"document\\\" | \\\"json\\\" | \\\"text\\\";\\n\";\r\nlibFileMap['lib.dom.iterable.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/////////////////////////////\\n/// DOM Iterable APIs\\n/////////////////////////////\\n\\ninterface AudioParam {\\n    setValueCurveAtTime(values: Iterable<number>, startTime: number, duration: number): AudioParam;\\n}\\n\\ninterface AudioParamMap extends ReadonlyMap<string, AudioParam> {\\n}\\n\\ninterface BaseAudioContext {\\n    createIIRFilter(feedforward: Iterable<number>, feedback: Iterable<number>): IIRFilterNode;\\n    createPeriodicWave(real: Iterable<number>, imag: Iterable<number>, constraints?: PeriodicWaveConstraints): PeriodicWave;\\n}\\n\\ninterface CSSRuleList {\\n    [Symbol.iterator](): IterableIterator<CSSRule>;\\n}\\n\\ninterface CSSStyleDeclaration {\\n    [Symbol.iterator](): IterableIterator<string>;\\n}\\n\\ninterface Cache {\\n    addAll(requests: Iterable<RequestInfo>): Promise<void>;\\n}\\n\\ninterface CanvasPathDrawingStyles {\\n    setLineDash(segments: Iterable<number>): void;\\n}\\n\\ninterface ClientRectList {\\n    [Symbol.iterator](): IterableIterator<ClientRect>;\\n}\\n\\ninterface DOMRectList {\\n    [Symbol.iterator](): IterableIterator<DOMRect>;\\n}\\n\\ninterface DOMStringList {\\n    [Symbol.iterator](): IterableIterator<string>;\\n}\\n\\ninterface DOMTokenList {\\n    [Symbol.iterator](): IterableIterator<string>;\\n    entries(): IterableIterator<[number, string]>;\\n    keys(): IterableIterator<number>;\\n    values(): IterableIterator<string>;\\n}\\n\\ninterface DataTransferItemList {\\n    [Symbol.iterator](): IterableIterator<DataTransferItem>;\\n}\\n\\ninterface FileList {\\n    [Symbol.iterator](): IterableIterator<File>;\\n}\\n\\ninterface FormData {\\n    [Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;\\n    /**\\n     * Returns an array of key, value pairs for every entry in the list.\\n     */\\n    entries(): IterableIterator<[string, FormDataEntryValue]>;\\n    /**\\n     * Returns a list of keys in the list.\\n     */\\n    keys(): IterableIterator<string>;\\n    /**\\n     * Returns a list of values in the list.\\n     */\\n    values(): IterableIterator<FormDataEntryValue>;\\n}\\n\\ninterface HTMLAllCollection {\\n    [Symbol.iterator](): IterableIterator<Element>;\\n}\\n\\ninterface HTMLCollectionBase {\\n    [Symbol.iterator](): IterableIterator<Element>;\\n}\\n\\ninterface HTMLCollectionOf<T extends Element> {\\n    [Symbol.iterator](): IterableIterator<T>;\\n}\\n\\ninterface HTMLFormElement {\\n    [Symbol.iterator](): IterableIterator<Element>;\\n}\\n\\ninterface HTMLSelectElement {\\n    [Symbol.iterator](): IterableIterator<Element>;\\n}\\n\\ninterface Headers {\\n    [Symbol.iterator](): IterableIterator<[string, string]>;\\n    /**\\n     * Returns an iterator allowing to go through all key/value pairs contained in this object.\\n     */\\n    entries(): IterableIterator<[string, string]>;\\n    /**\\n     * Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.\\n     */\\n    keys(): IterableIterator<string>;\\n    /**\\n     * Returns an iterator allowing to go through all values of the key/value pairs contained in this object.\\n     */\\n    values(): IterableIterator<string>;\\n}\\n\\ninterface IDBDatabase {\\n    /**\\n     * Returns a new transaction with the given mode (\\\"readonly\\\" or \\\"readwrite\\\") and scope which can be a single object store name or an array of names.\\n     */\\n    transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;\\n}\\n\\ninterface IDBObjectStore {\\n    /**\\n     * Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a \\\"ConstraintError\\\" DOMException.\\n     * \\n     * Throws an \\\"InvalidStateError\\\" DOMException if not called within an upgrade transaction.\\n     */\\n    createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;\\n}\\n\\ninterface MediaKeyStatusMap {\\n    [Symbol.iterator](): IterableIterator<[BufferSource, MediaKeyStatus]>;\\n    entries(): IterableIterator<[BufferSource, MediaKeyStatus]>;\\n    keys(): IterableIterator<BufferSource>;\\n    values(): IterableIterator<MediaKeyStatus>;\\n}\\n\\ninterface MediaList {\\n    [Symbol.iterator](): IterableIterator<string>;\\n}\\n\\ninterface MimeTypeArray {\\n    [Symbol.iterator](): IterableIterator<MimeType>;\\n}\\n\\ninterface NamedNodeMap {\\n    [Symbol.iterator](): IterableIterator<Attr>;\\n}\\n\\ninterface Navigator {\\n    requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: Iterable<MediaKeySystemConfiguration>): Promise<MediaKeySystemAccess>;\\n}\\n\\ninterface NodeList {\\n    [Symbol.iterator](): IterableIterator<Node>;\\n    /**\\n     * Returns an array of key, value pairs for every entry in the list.\\n     */\\n    entries(): IterableIterator<[number, Node]>;\\n    /**\\n     * Returns an list of keys in the list.\\n     */\\n    keys(): IterableIterator<number>;\\n    /**\\n     * Returns an list of values in the list.\\n     */\\n    values(): IterableIterator<Node>;\\n}\\n\\ninterface NodeListOf<TNode extends Node> {\\n    [Symbol.iterator](): IterableIterator<TNode>;\\n    /**\\n     * Returns an array of key, value pairs for every entry in the list.\\n     */\\n    entries(): IterableIterator<[number, TNode]>;\\n    /**\\n     * Returns an list of keys in the list.\\n     */\\n    keys(): IterableIterator<number>;\\n    /**\\n     * Returns an list of values in the list.\\n     */\\n    values(): IterableIterator<TNode>;\\n}\\n\\ninterface Plugin {\\n    [Symbol.iterator](): IterableIterator<MimeType>;\\n}\\n\\ninterface PluginArray {\\n    [Symbol.iterator](): IterableIterator<Plugin>;\\n}\\n\\ninterface RTCRtpTransceiver {\\n    setCodecPreferences(codecs: Iterable<RTCRtpCodecCapability>): void;\\n}\\n\\ninterface RTCStatsReport extends ReadonlyMap<string, any> {\\n}\\n\\ninterface SVGLengthList {\\n    [Symbol.iterator](): IterableIterator<SVGLength>;\\n}\\n\\ninterface SVGNumberList {\\n    [Symbol.iterator](): IterableIterator<SVGNumber>;\\n}\\n\\ninterface SVGPointList {\\n    [Symbol.iterator](): IterableIterator<DOMPoint>;\\n}\\n\\ninterface SVGStringList {\\n    [Symbol.iterator](): IterableIterator<string>;\\n}\\n\\ninterface SourceBufferList {\\n    [Symbol.iterator](): IterableIterator<SourceBuffer>;\\n}\\n\\ninterface SpeechGrammarList {\\n    [Symbol.iterator](): IterableIterator<SpeechGrammar>;\\n}\\n\\ninterface SpeechRecognitionResult {\\n    [Symbol.iterator](): IterableIterator<SpeechRecognitionAlternative>;\\n}\\n\\ninterface SpeechRecognitionResultList {\\n    [Symbol.iterator](): IterableIterator<SpeechRecognitionResult>;\\n}\\n\\ninterface StyleSheetList {\\n    [Symbol.iterator](): IterableIterator<CSSStyleSheet>;\\n}\\n\\ninterface TextTrackCueList {\\n    [Symbol.iterator](): IterableIterator<TextTrackCue>;\\n}\\n\\ninterface TextTrackList {\\n    [Symbol.iterator](): IterableIterator<TextTrack>;\\n}\\n\\ninterface TouchList {\\n    [Symbol.iterator](): IterableIterator<Touch>;\\n}\\n\\ninterface URLSearchParams {\\n    [Symbol.iterator](): IterableIterator<[string, string]>;\\n    /**\\n     * Returns an array of key, value pairs for every entry in the search params.\\n     */\\n    entries(): IterableIterator<[string, string]>;\\n    /**\\n     * Returns a list of keys in the search params.\\n     */\\n    keys(): IterableIterator<string>;\\n    /**\\n     * Returns a list of values in the search params.\\n     */\\n    values(): IterableIterator<string>;\\n}\\n\\ninterface VRDisplay {\\n    requestPresent(layers: Iterable<VRLayer>): Promise<void>;\\n}\\n\\ninterface WEBGL_draw_buffers {\\n    drawBuffersWEBGL(buffers: Iterable<GLenum>): void;\\n}\\n\\ninterface WebAuthentication {\\n    makeCredential(accountInformation: Account, cryptoParameters: Iterable<ScopedCredentialParameters>, attestationChallenge: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: ScopedCredentialOptions): Promise<ScopedCredentialInfo>;\\n}\\n\\ninterface WebGL2RenderingContextBase {\\n    clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: GLuint): void;\\n    clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: GLuint): void;\\n    clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLuint>, srcOffset?: GLuint): void;\\n    drawBuffers(buffers: Iterable<GLenum>): void;\\n    getActiveUniforms(program: WebGLProgram, uniformIndices: Iterable<GLuint>, pname: GLenum): any;\\n    getUniformIndices(program: WebGLProgram, uniformNames: Iterable<string>): Iterable<GLuint> | null;\\n    invalidateFramebuffer(target: GLenum, attachments: Iterable<GLenum>): void;\\n    invalidateSubFramebuffer(target: GLenum, attachments: Iterable<GLenum>, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;\\n    transformFeedbackVaryings(program: WebGLProgram, varyings: Iterable<string>, bufferMode: GLenum): void;\\n    uniform1uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform2uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform3uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform4uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    vertexAttribI4iv(index: GLuint, values: Iterable<GLint>): void;\\n    vertexAttribI4uiv(index: GLuint, values: Iterable<GLuint>): void;\\n}\\n\\ninterface WebGL2RenderingContextOverloads {\\n    uniform1fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform1iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform2fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform2iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform3fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform3iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform4fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform4iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n}\\n\\ninterface WebGLRenderingContextBase {\\n    vertexAttrib1fv(index: GLuint, values: Iterable<GLfloat>): void;\\n    vertexAttrib2fv(index: GLuint, values: Iterable<GLfloat>): void;\\n    vertexAttrib3fv(index: GLuint, values: Iterable<GLfloat>): void;\\n    vertexAttrib4fv(index: GLuint, values: Iterable<GLfloat>): void;\\n}\\n\\ninterface WebGLRenderingContextOverloads {\\n    uniform1fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;\\n    uniform1iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;\\n    uniform2fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;\\n    uniform2iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;\\n    uniform3fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;\\n    uniform3iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;\\n    uniform4fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;\\n    uniform4iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;\\n    uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;\\n    uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;\\n    uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;\\n}\\n\";\r\nlibFileMap['lib.es2015.collection.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface Map<K, V> {\\n    clear(): void;\\n    delete(key: K): boolean;\\n    forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;\\n    get(key: K): V | undefined;\\n    has(key: K): boolean;\\n    set(key: K, value: V): this;\\n    readonly size: number;\\n}\\n\\ninterface MapConstructor {\\n    new(): Map<any, any>;\\n    new<K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;\\n    readonly prototype: Map<any, any>;\\n}\\ndeclare var Map: MapConstructor;\\n\\ninterface ReadonlyMap<K, V> {\\n    forEach(callbackfn: (value: V, key: K, map: ReadonlyMap<K, V>) => void, thisArg?: any): void;\\n    get(key: K): V | undefined;\\n    has(key: K): boolean;\\n    readonly size: number;\\n}\\n\\ninterface WeakMap<K extends object, V> {\\n    delete(key: K): boolean;\\n    get(key: K): V | undefined;\\n    has(key: K): boolean;\\n    set(key: K, value: V): this;\\n}\\n\\ninterface WeakMapConstructor {\\n    new <K extends object = object, V = any>(entries?: readonly [K, V][] | null): WeakMap<K, V>;\\n    readonly prototype: WeakMap<object, any>;\\n}\\ndeclare var WeakMap: WeakMapConstructor;\\n\\ninterface Set<T> {\\n    add(value: T): this;\\n    clear(): void;\\n    delete(value: T): boolean;\\n    forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;\\n    has(value: T): boolean;\\n    readonly size: number;\\n}\\n\\ninterface SetConstructor {\\n    new <T = any>(values?: readonly T[] | null): Set<T>;\\n    readonly prototype: Set<any>;\\n}\\ndeclare var Set: SetConstructor;\\n\\ninterface ReadonlySet<T> {\\n    forEach(callbackfn: (value: T, value2: T, set: ReadonlySet<T>) => void, thisArg?: any): void;\\n    has(value: T): boolean;\\n    readonly size: number;\\n}\\n\\ninterface WeakSet<T extends object> {\\n    add(value: T): this;\\n    delete(value: T): boolean;\\n    has(value: T): boolean;\\n}\\n\\ninterface WeakSetConstructor {\\n    new <T extends object = object>(values?: readonly T[] | null): WeakSet<T>;\\n    readonly prototype: WeakSet<object>;\\n}\\ndeclare var WeakSet: WeakSetConstructor;\\n\";\r\nlibFileMap['lib.es2015.core.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface Array<T> {\\n    /**\\n     * Returns the value of the first element in the array where predicate is true, and undefined\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found, find\\n     * immediately returns that element value. Otherwise, find returns undefined.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    find<S extends T>(predicate: (this: void, value: T, index: number, obj: T[]) => value is S, thisArg?: any): S | undefined;\\n    find(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T | undefined;\\n\\n    /**\\n     * Returns the index of the first element in the array where predicate is true, and -1\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found,\\n     * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    findIndex(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): number;\\n\\n    /**\\n     * Returns the this object after filling the section identified by start and end with value\\n     * @param value value to fill array section with\\n     * @param start index to start filling the array at. If start is negative, it is treated as\\n     * length+start where length is the length of the array.\\n     * @param end index to stop filling the array at. If end is negative, it is treated as\\n     * length+end.\\n     */\\n    fill(value: T, start?: number, end?: number): this;\\n\\n    /**\\n     * Returns the this object after copying a section of the array identified by start and end\\n     * to the same array starting at position target\\n     * @param target If target is negative, it is treated as length+target where length is the\\n     * length of the array.\\n     * @param start If start is negative, it is treated as length+start. If end is negative, it\\n     * is treated as length+end.\\n     * @param end If not specified, length of the this object is used as its default value.\\n     */\\n    copyWithin(target: number, start: number, end?: number): this;\\n}\\n\\ninterface ArrayConstructor {\\n    /**\\n     * Creates an array from an array-like object.\\n     * @param arrayLike An array-like object to convert to an array.\\n     */\\n    from<T>(arrayLike: ArrayLike<T>): T[];\\n\\n    /**\\n     * Creates an array from an iterable object.\\n     * @param arrayLike An array-like object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];\\n\\n    /**\\n     * Returns a new array from a set of elements.\\n     * @param items A set of elements to include in the new array object.\\n     */\\n    of<T>(...items: T[]): T[];\\n}\\n\\ninterface DateConstructor {\\n    new (value: number | string | Date): Date;\\n}\\n\\ninterface Function {\\n    /**\\n     * Returns the name of the function. Function names are read-only and can not be changed.\\n     */\\n    readonly name: string;\\n}\\n\\ninterface Math {\\n    /**\\n     * Returns the number of leading zero bits in the 32-bit binary representation of a number.\\n     * @param x A numeric expression.\\n     */\\n    clz32(x: number): number;\\n\\n    /**\\n     * Returns the result of 32-bit multiplication of two numbers.\\n     * @param x First number\\n     * @param y Second number\\n     */\\n    imul(x: number, y: number): number;\\n\\n    /**\\n     * Returns the sign of the x, indicating whether x is positive, negative or zero.\\n     * @param x The numeric expression to test\\n     */\\n    sign(x: number): number;\\n\\n    /**\\n     * Returns the base 10 logarithm of a number.\\n     * @param x A numeric expression.\\n     */\\n    log10(x: number): number;\\n\\n    /**\\n     * Returns the base 2 logarithm of a number.\\n     * @param x A numeric expression.\\n     */\\n    log2(x: number): number;\\n\\n    /**\\n     * Returns the natural logarithm of 1 + x.\\n     * @param x A numeric expression.\\n     */\\n    log1p(x: number): number;\\n\\n    /**\\n     * Returns the result of (e^x - 1), which is an implementation-dependent approximation to\\n     * subtracting 1 from the exponential function of x (e raised to the power of x, where e\\n     * is the base of the natural logarithms).\\n     * @param x A numeric expression.\\n     */\\n    expm1(x: number): number;\\n\\n    /**\\n     * Returns the hyperbolic cosine of a number.\\n     * @param x A numeric expression that contains an angle measured in radians.\\n     */\\n    cosh(x: number): number;\\n\\n    /**\\n     * Returns the hyperbolic sine of a number.\\n     * @param x A numeric expression that contains an angle measured in radians.\\n     */\\n    sinh(x: number): number;\\n\\n    /**\\n     * Returns the hyperbolic tangent of a number.\\n     * @param x A numeric expression that contains an angle measured in radians.\\n     */\\n    tanh(x: number): number;\\n\\n    /**\\n     * Returns the inverse hyperbolic cosine of a number.\\n     * @param x A numeric expression that contains an angle measured in radians.\\n     */\\n    acosh(x: number): number;\\n\\n    /**\\n     * Returns the inverse hyperbolic sine of a number.\\n     * @param x A numeric expression that contains an angle measured in radians.\\n     */\\n    asinh(x: number): number;\\n\\n    /**\\n     * Returns the inverse hyperbolic tangent of a number.\\n     * @param x A numeric expression that contains an angle measured in radians.\\n     */\\n    atanh(x: number): number;\\n\\n    /**\\n     * Returns the square root of the sum of squares of its arguments.\\n     * @param values Values to compute the square root for.\\n     *     If no arguments are passed, the result is +0.\\n     *     If there is only one argument, the result is the absolute value.\\n     *     If any argument is +Infinity or -Infinity, the result is +Infinity.\\n     *     If any argument is NaN, the result is NaN.\\n     *     If all arguments are either +0 or −0, the result is +0.\\n     */\\n    hypot(...values: number[]): number;\\n\\n    /**\\n     * Returns the integral part of the a numeric expression, x, removing any fractional digits.\\n     * If x is already an integer, the result is x.\\n     * @param x A numeric expression.\\n     */\\n    trunc(x: number): number;\\n\\n    /**\\n     * Returns the nearest single precision float representation of a number.\\n     * @param x A numeric expression.\\n     */\\n    fround(x: number): number;\\n\\n    /**\\n     * Returns an implementation-dependent approximation to the cube root of number.\\n     * @param x A numeric expression.\\n     */\\n    cbrt(x: number): number;\\n}\\n\\ninterface NumberConstructor {\\n    /**\\n     * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1\\n     * that is representable as a Number value, which is approximately:\\n     * 2.2204460492503130808472633361816 x 10‍−‍16.\\n     */\\n    readonly EPSILON: number;\\n\\n    /**\\n     * Returns true if passed value is finite.\\n     * Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a\\n     * number. Only finite values of the type number, result in true.\\n     * @param number A numeric value.\\n     */\\n    isFinite(number: unknown): boolean;\\n\\n    /**\\n     * Returns true if the value passed is an integer, false otherwise.\\n     * @param number A numeric value.\\n     */\\n    isInteger(number: unknown): boolean;\\n\\n    /**\\n     * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a\\n     * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter\\n     * to a number. Only values of the type number, that are also NaN, result in true.\\n     * @param number A numeric value.\\n     */\\n    isNaN(number: unknown): boolean;\\n\\n    /**\\n     * Returns true if the value passed is a safe integer.\\n     * @param number A numeric value.\\n     */\\n    isSafeInteger(number: unknown): boolean;\\n\\n    /**\\n     * The value of the largest integer n such that n and n + 1 are both exactly representable as\\n     * a Number value.\\n     * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1.\\n     */\\n    readonly MAX_SAFE_INTEGER: number;\\n\\n    /**\\n     * The value of the smallest integer n such that n and n − 1 are both exactly representable as\\n     * a Number value.\\n     * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).\\n     */\\n    readonly MIN_SAFE_INTEGER: number;\\n\\n    /**\\n     * Converts a string to a floating-point number.\\n     * @param string A string that contains a floating-point number.\\n     */\\n    parseFloat(string: string): number;\\n\\n    /**\\n     * Converts A string to an integer.\\n     * @param s A string to convert into a number.\\n     * @param radix A value between 2 and 36 that specifies the base of the number in numString.\\n     * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\\n     * All other strings are considered decimal.\\n     */\\n    parseInt(string: string, radix?: number): number;\\n}\\n\\ninterface ObjectConstructor {\\n    /**\\n     * Copy the values of all of the enumerable own properties from one or more source objects to a\\n     * target object. Returns the target object.\\n     * @param target The target object to copy to.\\n     * @param source The source object from which to copy properties.\\n     */\\n    assign<T, U>(target: T, source: U): T & U;\\n\\n    /**\\n     * Copy the values of all of the enumerable own properties from one or more source objects to a\\n     * target object. Returns the target object.\\n     * @param target The target object to copy to.\\n     * @param source1 The first source object from which to copy properties.\\n     * @param source2 The second source object from which to copy properties.\\n     */\\n    assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;\\n\\n    /**\\n     * Copy the values of all of the enumerable own properties from one or more source objects to a\\n     * target object. Returns the target object.\\n     * @param target The target object to copy to.\\n     * @param source1 The first source object from which to copy properties.\\n     * @param source2 The second source object from which to copy properties.\\n     * @param source3 The third source object from which to copy properties.\\n     */\\n    assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;\\n\\n    /**\\n     * Copy the values of all of the enumerable own properties from one or more source objects to a\\n     * target object. Returns the target object.\\n     * @param target The target object to copy to.\\n     * @param sources One or more source objects from which to copy properties\\n     */\\n    assign(target: object, ...sources: any[]): any;\\n\\n    /**\\n     * Returns an array of all symbol properties found directly on object o.\\n     * @param o Object to retrieve the symbols from.\\n     */\\n    getOwnPropertySymbols(o: any): symbol[];\\n\\n    /**\\n     * Returns the names of the enumerable string properties and methods of an object.\\n     * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\\n     */\\n    keys(o: {}): string[];\\n\\n    /**\\n     * Returns true if the values are the same value, false otherwise.\\n     * @param value1 The first value.\\n     * @param value2 The second value.\\n     */\\n    is(value1: any, value2: any): boolean;\\n\\n    /**\\n     * Sets the prototype of a specified object o to object proto or null. Returns the object o.\\n     * @param o The object to change its prototype.\\n     * @param proto The value of the new prototype or null.\\n     */\\n    setPrototypeOf(o: any, proto: object | null): any;\\n}\\n\\ninterface ReadonlyArray<T> {\\n    /**\\n     * Returns the value of the first element in the array where predicate is true, and undefined\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found, find\\n     * immediately returns that element value. Otherwise, find returns undefined.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    find<S extends T>(predicate: (this: void, value: T, index: number, obj: readonly T[]) => value is S, thisArg?: any): S | undefined;\\n    find(predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): T | undefined;\\n\\n    /**\\n     * Returns the index of the first element in the array where predicate is true, and -1\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found,\\n     * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    findIndex(predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): number;\\n}\\n\\ninterface RegExp {\\n    /**\\n     * Returns a string indicating the flags of the regular expression in question. This field is read-only.\\n     * The characters in this string are sequenced and concatenated in the following order:\\n     *\\n     *    - \\\"g\\\" for global\\n     *    - \\\"i\\\" for ignoreCase\\n     *    - \\\"m\\\" for multiline\\n     *    - \\\"u\\\" for unicode\\n     *    - \\\"y\\\" for sticky\\n     *\\n     * If no flags are set, the value is the empty string.\\n     */\\n    readonly flags: string;\\n\\n    /**\\n     * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular\\n     * expression. Default is false. Read-only.\\n     */\\n    readonly sticky: boolean;\\n\\n    /**\\n     * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular\\n     * expression. Default is false. Read-only.\\n     */\\n    readonly unicode: boolean;\\n}\\n\\ninterface RegExpConstructor {\\n    new (pattern: RegExp | string, flags?: string): RegExp;\\n    (pattern: RegExp | string, flags?: string): RegExp;\\n}\\n\\ninterface String {\\n    /**\\n     * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point\\n     * value of the UTF-16 encoded code point starting at the string element at position pos in\\n     * the String resulting from converting this object to a String.\\n     * If there is no element at that position, the result is undefined.\\n     * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.\\n     */\\n    codePointAt(pos: number): number | undefined;\\n\\n    /**\\n     * Returns true if searchString appears as a substring of the result of converting this\\n     * object to a String, at one or more positions that are\\n     * greater than or equal to position; otherwise, returns false.\\n     * @param searchString search string\\n     * @param position If position is undefined, 0 is assumed, so as to search all of the String.\\n     */\\n    includes(searchString: string, position?: number): boolean;\\n\\n    /**\\n     * Returns true if the sequence of elements of searchString converted to a String is the\\n     * same as the corresponding elements of this object (converted to a String) starting at\\n     * endPosition – length(this). Otherwise returns false.\\n     */\\n    endsWith(searchString: string, endPosition?: number): boolean;\\n\\n    /**\\n     * Returns the String value result of normalizing the string into the normalization form\\n     * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\\n     * @param form Applicable values: \\\"NFC\\\", \\\"NFD\\\", \\\"NFKC\\\", or \\\"NFKD\\\", If not specified default\\n     * is \\\"NFC\\\"\\n     */\\n    normalize(form: \\\"NFC\\\" | \\\"NFD\\\" | \\\"NFKC\\\" | \\\"NFKD\\\"): string;\\n\\n    /**\\n     * Returns the String value result of normalizing the string into the normalization form\\n     * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\\n     * @param form Applicable values: \\\"NFC\\\", \\\"NFD\\\", \\\"NFKC\\\", or \\\"NFKD\\\", If not specified default\\n     * is \\\"NFC\\\"\\n     */\\n    normalize(form?: string): string;\\n\\n    /**\\n     * Returns a String value that is made from count copies appended together. If count is 0,\\n     * the empty string is returned.\\n     * @param count number of copies to append\\n     */\\n    repeat(count: number): string;\\n\\n    /**\\n     * Returns true if the sequence of elements of searchString converted to a String is the\\n     * same as the corresponding elements of this object (converted to a String) starting at\\n     * position. Otherwise returns false.\\n     */\\n    startsWith(searchString: string, position?: number): boolean;\\n\\n    /**\\n     * Returns an `<a>` HTML anchor element and sets the name attribute to the text value\\n     * @param name\\n     */\\n    anchor(name: string): string;\\n\\n    /** Returns a `<big>` HTML element */\\n    big(): string;\\n\\n    /** Returns a `<blink>` HTML element */\\n    blink(): string;\\n\\n    /** Returns a `<b>` HTML element */\\n    bold(): string;\\n\\n    /** Returns a `<tt>` HTML element */\\n    fixed(): string;\\n\\n    /** Returns a `<font>` HTML element and sets the color attribute value */\\n    fontcolor(color: string): string;\\n\\n    /** Returns a `<font>` HTML element and sets the size attribute value */\\n    fontsize(size: number): string;\\n\\n    /** Returns a `<font>` HTML element and sets the size attribute value */\\n    fontsize(size: string): string;\\n\\n    /** Returns an `<i>` HTML element */\\n    italics(): string;\\n\\n    /** Returns an `<a>` HTML element and sets the href attribute value */\\n    link(url: string): string;\\n\\n    /** Returns a `<small>` HTML element */\\n    small(): string;\\n\\n    /** Returns a `<strike>` HTML element */\\n    strike(): string;\\n\\n    /** Returns a `<sub>` HTML element */\\n    sub(): string;\\n\\n    /** Returns a `<sup>` HTML element */\\n    sup(): string;\\n}\\n\\ninterface StringConstructor {\\n    /**\\n     * Return the String value whose elements are, in order, the elements in the List elements.\\n     * If length is 0, the empty string is returned.\\n     */\\n    fromCodePoint(...codePoints: number[]): string;\\n\\n    /**\\n     * String.raw is intended for use as a tag function of a Tagged Template String. When called\\n     * as such the first argument will be a well formed template call site object and the rest\\n     * parameter will contain the substitution values.\\n     * @param template A well-formed template string call site representation.\\n     * @param substitutions A set of substitution values.\\n     */\\n    raw(template: TemplateStringsArray, ...substitutions: any[]): string;\\n}\\n\";\r\nlibFileMap['lib.es2015.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es5\\\" />\\n/// <reference lib=\\\"es2015.core\\\" />\\n/// <reference lib=\\\"es2015.collection\\\" />\\n/// <reference lib=\\\"es2015.iterable\\\" />\\n/// <reference lib=\\\"es2015.generator\\\" />\\n/// <reference lib=\\\"es2015.promise\\\" />\\n/// <reference lib=\\\"es2015.proxy\\\" />\\n/// <reference lib=\\\"es2015.reflect\\\" />\\n/// <reference lib=\\\"es2015.symbol\\\" />\\n/// <reference lib=\\\"es2015.symbol.wellknown\\\" />\\n\";\r\nlibFileMap['lib.es2015.generator.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2015.iterable\\\" />\\n\\ninterface Generator<T = unknown, TReturn = any, TNext = unknown> extends Iterator<T, TReturn, TNext> {\\n    // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.\\n    next(...args: [] | [TNext]): IteratorResult<T, TReturn>;\\n    return(value: TReturn): IteratorResult<T, TReturn>;\\n    throw(e: any): IteratorResult<T, TReturn>;\\n    [Symbol.iterator](): Generator<T, TReturn, TNext>;\\n}\\n\\ninterface GeneratorFunction {\\n    /**\\n     * Creates a new Generator object.\\n     * @param args A list of arguments the function accepts.\\n     */\\n    new (...args: any[]): Generator;\\n    /**\\n     * Creates a new Generator object.\\n     * @param args A list of arguments the function accepts.\\n     */\\n    (...args: any[]): Generator;\\n    /**\\n     * The length of the arguments.\\n     */\\n    readonly length: number;\\n    /**\\n     * Returns the name of the function.\\n     */\\n    readonly name: string;\\n    /**\\n     * A reference to the prototype.\\n     */\\n    readonly prototype: Generator;\\n}\\n\\ninterface GeneratorFunctionConstructor {\\n    /**\\n     * Creates a new Generator function.\\n     * @param args A list of arguments the function accepts.\\n     */\\n    new (...args: string[]): GeneratorFunction;\\n    /**\\n     * Creates a new Generator function.\\n     * @param args A list of arguments the function accepts.\\n     */\\n    (...args: string[]): GeneratorFunction;\\n    /**\\n     * The length of the arguments.\\n     */\\n    readonly length: number;\\n    /**\\n     * Returns the name of the function.\\n     */\\n    readonly name: string;\\n    /**\\n     * A reference to the prototype.\\n     */\\n    readonly prototype: GeneratorFunction;\\n}\\n\";\r\nlibFileMap['lib.es2015.iterable.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2015.symbol\\\" />\\n\\ninterface SymbolConstructor {\\n    /**\\n     * A method that returns the default iterator for an object. Called by the semantics of the\\n     * for-of statement.\\n     */\\n    readonly iterator: symbol;\\n}\\n\\ninterface IteratorYieldResult<TYield> {\\n    done?: false;\\n    value: TYield;\\n}\\n\\ninterface IteratorReturnResult<TReturn> {\\n    done: true;\\n    value: TReturn;\\n}\\n\\ntype IteratorResult<T, TReturn = any> = IteratorYieldResult<T> | IteratorReturnResult<TReturn>;\\n\\ninterface Iterator<T, TReturn = any, TNext = undefined> {\\n    // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.\\n    next(...args: [] | [TNext]): IteratorResult<T, TReturn>;\\n    return?(value?: TReturn): IteratorResult<T, TReturn>;\\n    throw?(e?: any): IteratorResult<T, TReturn>;\\n}\\n\\ninterface Iterable<T> {\\n    [Symbol.iterator](): Iterator<T>;\\n}\\n\\ninterface IterableIterator<T> extends Iterator<T> {\\n    [Symbol.iterator](): IterableIterator<T>;\\n}\\n\\ninterface Array<T> {\\n    /** Iterator */\\n    [Symbol.iterator](): IterableIterator<T>;\\n\\n    /**\\n     * Returns an iterable of key, value pairs for every entry in the array\\n     */\\n    entries(): IterableIterator<[number, T]>;\\n\\n    /**\\n     * Returns an iterable of keys in the array\\n     */\\n    keys(): IterableIterator<number>;\\n\\n    /**\\n     * Returns an iterable of values in the array\\n     */\\n    values(): IterableIterator<T>;\\n}\\n\\ninterface ArrayConstructor {\\n    /**\\n     * Creates an array from an iterable object.\\n     * @param iterable An iterable object to convert to an array.\\n     */\\n    from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];\\n\\n    /**\\n     * Creates an array from an iterable object.\\n     * @param iterable An iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];\\n}\\n\\ninterface ReadonlyArray<T> {\\n    /** Iterator of values in the array. */\\n    [Symbol.iterator](): IterableIterator<T>;\\n\\n    /**\\n     * Returns an iterable of key, value pairs for every entry in the array\\n     */\\n    entries(): IterableIterator<[number, T]>;\\n\\n    /**\\n     * Returns an iterable of keys in the array\\n     */\\n    keys(): IterableIterator<number>;\\n\\n    /**\\n     * Returns an iterable of values in the array\\n     */\\n    values(): IterableIterator<T>;\\n}\\n\\ninterface IArguments {\\n    /** Iterator */\\n    [Symbol.iterator](): IterableIterator<any>;\\n}\\n\\ninterface Map<K, V> {\\n    /** Returns an iterable of entries in the map. */\\n    [Symbol.iterator](): IterableIterator<[K, V]>;\\n\\n    /**\\n     * Returns an iterable of key, value pairs for every entry in the map.\\n     */\\n    entries(): IterableIterator<[K, V]>;\\n\\n    /**\\n     * Returns an iterable of keys in the map\\n     */\\n    keys(): IterableIterator<K>;\\n\\n    /**\\n     * Returns an iterable of values in the map\\n     */\\n    values(): IterableIterator<V>;\\n}\\n\\ninterface ReadonlyMap<K, V> {\\n    /** Returns an iterable of entries in the map. */\\n    [Symbol.iterator](): IterableIterator<[K, V]>;\\n\\n    /**\\n     * Returns an iterable of key, value pairs for every entry in the map.\\n     */\\n    entries(): IterableIterator<[K, V]>;\\n\\n    /**\\n     * Returns an iterable of keys in the map\\n     */\\n    keys(): IterableIterator<K>;\\n\\n    /**\\n     * Returns an iterable of values in the map\\n     */\\n    values(): IterableIterator<V>;\\n}\\n\\ninterface MapConstructor {\\n    new <K, V>(iterable: Iterable<readonly [K, V]>): Map<K, V>;\\n}\\n\\ninterface WeakMap<K extends object, V> { }\\n\\ninterface WeakMapConstructor {\\n    new <K extends object, V>(iterable: Iterable<[K, V]>): WeakMap<K, V>;\\n}\\n\\ninterface Set<T> {\\n    /** Iterates over values in the set. */\\n    [Symbol.iterator](): IterableIterator<T>;\\n    /**\\n     * Returns an iterable of [v,v] pairs for every value `v` in the set.\\n     */\\n    entries(): IterableIterator<[T, T]>;\\n    /**\\n     * Despite its name, returns an iterable of the values in the set.\\n     */\\n    keys(): IterableIterator<T>;\\n\\n    /**\\n     * Returns an iterable of values in the set.\\n     */\\n    values(): IterableIterator<T>;\\n}\\n\\ninterface ReadonlySet<T> {\\n    /** Iterates over values in the set. */\\n    [Symbol.iterator](): IterableIterator<T>;\\n\\n    /**\\n     * Returns an iterable of [v,v] pairs for every value `v` in the set.\\n     */\\n    entries(): IterableIterator<[T, T]>;\\n\\n    /**\\n     * Despite its name, returns an iterable of the values in the set.\\n     */\\n    keys(): IterableIterator<T>;\\n\\n    /**\\n     * Returns an iterable of values in the set.\\n     */\\n    values(): IterableIterator<T>;\\n}\\n\\ninterface SetConstructor {\\n    new <T>(iterable?: Iterable<T> | null): Set<T>;\\n}\\n\\ninterface WeakSet<T extends object> { }\\n\\ninterface WeakSetConstructor {\\n    new <T extends object = object>(iterable: Iterable<T>): WeakSet<T>;\\n}\\n\\ninterface Promise<T> { }\\n\\ninterface PromiseConstructor {\\n    /**\\n     * Creates a Promise that is resolved with an array of results when all of the provided Promises\\n     * resolve, or rejected when any Promise is rejected.\\n     * @param values An iterable of Promises.\\n     * @returns A new Promise.\\n     */\\n    all<T>(values: Iterable<T | PromiseLike<T>>): Promise<T[]>;\\n\\n    /**\\n     * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\\n     * or rejected.\\n     * @param values An iterable of Promises.\\n     * @returns A new Promise.\\n     */\\n    race<T>(values: Iterable<T>): Promise<T extends PromiseLike<infer U> ? U : T>;\\n\\n    /**\\n     * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\\n     * or rejected.\\n     * @param values An iterable of Promises.\\n     * @returns A new Promise.\\n     */\\n    race<T>(values: Iterable<T | PromiseLike<T>>): Promise<T>;\\n}\\n\\ninterface String {\\n    /** Iterator */\\n    [Symbol.iterator](): IterableIterator<string>;\\n}\\n\\ninterface Int8Array {\\n    [Symbol.iterator](): IterableIterator<number>;\\n    /**\\n     * Returns an array of key, value pairs for every entry in the array\\n     */\\n    entries(): IterableIterator<[number, number]>;\\n    /**\\n     * Returns an list of keys in the array\\n     */\\n    keys(): IterableIterator<number>;\\n    /**\\n     * Returns an list of values in the array\\n     */\\n    values(): IterableIterator<number>;\\n}\\n\\ninterface Int8ArrayConstructor {\\n    new (elements: Iterable<number>): Int8Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array;\\n}\\n\\ninterface Uint8Array {\\n    [Symbol.iterator](): IterableIterator<number>;\\n    /**\\n     * Returns an array of key, value pairs for every entry in the array\\n     */\\n    entries(): IterableIterator<[number, number]>;\\n    /**\\n     * Returns an list of keys in the array\\n     */\\n    keys(): IterableIterator<number>;\\n    /**\\n     * Returns an list of values in the array\\n     */\\n    values(): IterableIterator<number>;\\n}\\n\\ninterface Uint8ArrayConstructor {\\n    new (elements: Iterable<number>): Uint8Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array;\\n}\\n\\ninterface Uint8ClampedArray {\\n    [Symbol.iterator](): IterableIterator<number>;\\n    /**\\n     * Returns an array of key, value pairs for every entry in the array\\n     */\\n    entries(): IterableIterator<[number, number]>;\\n\\n    /**\\n     * Returns an list of keys in the array\\n     */\\n    keys(): IterableIterator<number>;\\n\\n    /**\\n     * Returns an list of values in the array\\n     */\\n    values(): IterableIterator<number>;\\n}\\n\\ninterface Uint8ClampedArrayConstructor {\\n    new (elements: Iterable<number>): Uint8ClampedArray;\\n\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray;\\n}\\n\\ninterface Int16Array {\\n    [Symbol.iterator](): IterableIterator<number>;\\n    /**\\n     * Returns an array of key, value pairs for every entry in the array\\n     */\\n    entries(): IterableIterator<[number, number]>;\\n\\n    /**\\n     * Returns an list of keys in the array\\n     */\\n    keys(): IterableIterator<number>;\\n\\n    /**\\n     * Returns an list of values in the array\\n     */\\n    values(): IterableIterator<number>;\\n}\\n\\ninterface Int16ArrayConstructor {\\n    new (elements: Iterable<number>): Int16Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array;\\n}\\n\\ninterface Uint16Array {\\n    [Symbol.iterator](): IterableIterator<number>;\\n    /**\\n     * Returns an array of key, value pairs for every entry in the array\\n     */\\n    entries(): IterableIterator<[number, number]>;\\n    /**\\n     * Returns an list of keys in the array\\n     */\\n    keys(): IterableIterator<number>;\\n    /**\\n     * Returns an list of values in the array\\n     */\\n    values(): IterableIterator<number>;\\n}\\n\\ninterface Uint16ArrayConstructor {\\n    new (elements: Iterable<number>): Uint16Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array;\\n}\\n\\ninterface Int32Array {\\n    [Symbol.iterator](): IterableIterator<number>;\\n    /**\\n     * Returns an array of key, value pairs for every entry in the array\\n     */\\n    entries(): IterableIterator<[number, number]>;\\n    /**\\n     * Returns an list of keys in the array\\n     */\\n    keys(): IterableIterator<number>;\\n    /**\\n     * Returns an list of values in the array\\n     */\\n    values(): IterableIterator<number>;\\n}\\n\\ninterface Int32ArrayConstructor {\\n    new (elements: Iterable<number>): Int32Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array;\\n}\\n\\ninterface Uint32Array {\\n    [Symbol.iterator](): IterableIterator<number>;\\n    /**\\n     * Returns an array of key, value pairs for every entry in the array\\n     */\\n    entries(): IterableIterator<[number, number]>;\\n    /**\\n     * Returns an list of keys in the array\\n     */\\n    keys(): IterableIterator<number>;\\n    /**\\n     * Returns an list of values in the array\\n     */\\n    values(): IterableIterator<number>;\\n}\\n\\ninterface Uint32ArrayConstructor {\\n    new (elements: Iterable<number>): Uint32Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array;\\n}\\n\\ninterface Float32Array {\\n    [Symbol.iterator](): IterableIterator<number>;\\n    /**\\n     * Returns an array of key, value pairs for every entry in the array\\n     */\\n    entries(): IterableIterator<[number, number]>;\\n    /**\\n     * Returns an list of keys in the array\\n     */\\n    keys(): IterableIterator<number>;\\n    /**\\n     * Returns an list of values in the array\\n     */\\n    values(): IterableIterator<number>;\\n}\\n\\ninterface Float32ArrayConstructor {\\n    new (elements: Iterable<number>): Float32Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array;\\n}\\n\\ninterface Float64Array {\\n    [Symbol.iterator](): IterableIterator<number>;\\n    /**\\n     * Returns an array of key, value pairs for every entry in the array\\n     */\\n    entries(): IterableIterator<[number, number]>;\\n    /**\\n     * Returns an list of keys in the array\\n     */\\n    keys(): IterableIterator<number>;\\n    /**\\n     * Returns an list of values in the array\\n     */\\n    values(): IterableIterator<number>;\\n}\\n\\ninterface Float64ArrayConstructor {\\n    new (elements: Iterable<number>): Float64Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;\\n}\\n\";\r\nlibFileMap['lib.es2015.promise.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface PromiseConstructor {\\n    /**\\n     * A reference to the prototype.\\n     */\\n    readonly prototype: Promise<any>;\\n\\n    /**\\n     * Creates a new Promise.\\n     * @param executor A callback used to initialize the promise. This callback is passed two arguments:\\n     * a resolve callback used to resolve the promise with a value or the result of another promise,\\n     * and a reject callback used to reject the promise with a provided reason or error.\\n     */\\n    new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;\\n\\n    /**\\n     * Creates a Promise that is resolved with an array of results when all of the provided Promises\\n     * resolve, or rejected when any Promise is rejected.\\n     * @param values An array of Promises.\\n     * @returns A new Promise.\\n     */\\n    all<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(values: readonly [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>, T9 | PromiseLike<T9>, T10 | PromiseLike<T10>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>;\\n\\n    /**\\n     * Creates a Promise that is resolved with an array of results when all of the provided Promises\\n     * resolve, or rejected when any Promise is rejected.\\n     * @param values An array of Promises.\\n     * @returns A new Promise.\\n     */\\n    all<T1, T2, T3, T4, T5, T6, T7, T8, T9>(values: readonly [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>, T9 | PromiseLike<T9>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;\\n\\n    /**\\n     * Creates a Promise that is resolved with an array of results when all of the provided Promises\\n     * resolve, or rejected when any Promise is rejected.\\n     * @param values An array of Promises.\\n     * @returns A new Promise.\\n     */\\n    all<T1, T2, T3, T4, T5, T6, T7, T8>(values: readonly [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>;\\n\\n    /**\\n     * Creates a Promise that is resolved with an array of results when all of the provided Promises\\n     * resolve, or rejected when any Promise is rejected.\\n     * @param values An array of Promises.\\n     * @returns A new Promise.\\n     */\\n    all<T1, T2, T3, T4, T5, T6, T7>(values: readonly [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>]): Promise<[T1, T2, T3, T4, T5, T6, T7]>;\\n\\n    /**\\n     * Creates a Promise that is resolved with an array of results when all of the provided Promises\\n     * resolve, or rejected when any Promise is rejected.\\n     * @param values An array of Promises.\\n     * @returns A new Promise.\\n     */\\n    all<T1, T2, T3, T4, T5, T6>(values: readonly [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>]): Promise<[T1, T2, T3, T4, T5, T6]>;\\n\\n    /**\\n     * Creates a Promise that is resolved with an array of results when all of the provided Promises\\n     * resolve, or rejected when any Promise is rejected.\\n     * @param values An array of Promises.\\n     * @returns A new Promise.\\n     */\\n    all<T1, T2, T3, T4, T5>(values: readonly [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>, T5 | PromiseLike<T5>]): Promise<[T1, T2, T3, T4, T5]>;\\n\\n    /**\\n     * Creates a Promise that is resolved with an array of results when all of the provided Promises\\n     * resolve, or rejected when any Promise is rejected.\\n     * @param values An array of Promises.\\n     * @returns A new Promise.\\n     */\\n    all<T1, T2, T3, T4>(values: readonly [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>]): Promise<[T1, T2, T3, T4]>;\\n\\n    /**\\n     * Creates a Promise that is resolved with an array of results when all of the provided Promises\\n     * resolve, or rejected when any Promise is rejected.\\n     * @param values An array of Promises.\\n     * @returns A new Promise.\\n     */\\n    all<T1, T2, T3>(values: readonly [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>]): Promise<[T1, T2, T3]>;\\n\\n    /**\\n     * Creates a Promise that is resolved with an array of results when all of the provided Promises\\n     * resolve, or rejected when any Promise is rejected.\\n     * @param values An array of Promises.\\n     * @returns A new Promise.\\n     */\\n    all<T1, T2>(values: readonly [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]): Promise<[T1, T2]>;\\n\\n    /**\\n     * Creates a Promise that is resolved with an array of results when all of the provided Promises\\n     * resolve, or rejected when any Promise is rejected.\\n     * @param values An array of Promises.\\n     * @returns A new Promise.\\n     */\\n    all<T>(values: readonly (T | PromiseLike<T>)[]): Promise<T[]>;\\n\\n    // see: lib.es2015.iterable.d.ts\\n    // all<T>(values: Iterable<T | PromiseLike<T>>): Promise<T[]>;\\n\\n    /**\\n     * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\\n     * or rejected.\\n     * @param values An array of Promises.\\n     * @returns A new Promise.\\n     */\\n    race<T>(values: readonly T[]): Promise<T extends PromiseLike<infer U> ? U : T>;\\n\\n    // see: lib.es2015.iterable.d.ts\\n    // race<T>(values: Iterable<T>): Promise<T extends PromiseLike<infer U> ? U : T>;\\n\\n    /**\\n     * Creates a new rejected promise for the provided reason.\\n     * @param reason The reason the promise was rejected.\\n     * @returns A new rejected Promise.\\n     */\\n    reject<T = never>(reason?: any): Promise<T>;\\n\\n    /**\\n     * Creates a new resolved promise.\\n     * @returns A resolved promise.\\n     */\\n    resolve(): Promise<void>;\\n\\n    /**\\n     * Creates a new resolved promise for the provided value.\\n     * @param value A promise.\\n     * @returns A promise whose internal state matches the provided promise.\\n     */\\n    resolve<T>(value: T | PromiseLike<T>): Promise<T>;\\n}\\n\\ndeclare var Promise: PromiseConstructor;\\n\";\r\nlibFileMap['lib.es2015.proxy.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface ProxyHandler<T extends object> {\\n    apply?(target: T, thisArg: any, argArray: any[]): any;\\n    construct?(target: T, argArray: any[], newTarget: Function): object;\\n    defineProperty?(target: T, p: string | symbol, attributes: PropertyDescriptor): boolean;\\n    deleteProperty?(target: T, p: string | symbol): boolean;\\n    get?(target: T, p: string | symbol, receiver: any): any;\\n    getOwnPropertyDescriptor?(target: T, p: string | symbol): PropertyDescriptor | undefined;\\n    getPrototypeOf?(target: T): object | null;\\n    has?(target: T, p: string | symbol): boolean;\\n    isExtensible?(target: T): boolean;\\n    ownKeys?(target: T): ArrayLike<string | symbol>;\\n    preventExtensions?(target: T): boolean;\\n    set?(target: T, p: string | symbol, value: any, receiver: any): boolean;\\n    setPrototypeOf?(target: T, v: object | null): boolean;\\n}\\n\\ninterface ProxyConstructor {\\n    revocable<T extends object>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };\\n    new <T extends object>(target: T, handler: ProxyHandler<T>): T;\\n}\\ndeclare var Proxy: ProxyConstructor;\\n\";\r\nlibFileMap['lib.es2015.reflect.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ndeclare namespace Reflect {\\n    /**\\n     * Calls the function with the specified object as the this value\\n     * and the elements of specified array as the arguments.\\n     * @param target The function to call.\\n     * @param thisArgument The object to be used as the this object.\\n     * @param argumentsList An array of argument values to be passed to the function.\\n     */\\n    function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;\\n\\n    /**\\n     * Constructs the target with the elements of specified array as the arguments\\n     * and the specified constructor as the `new.target` value.\\n     * @param target The constructor to invoke.\\n     * @param argumentsList An array of argument values to be passed to the constructor.\\n     * @param newTarget The constructor to be used as the `new.target` object.\\n     */\\n    function construct(target: Function, argumentsList: ArrayLike<any>, newTarget?: Function): any;\\n\\n    /**\\n     * Adds a property to an object, or modifies attributes of an existing property.\\n     * @param target Object on which to add or modify the property. This can be a native JavaScript object\\n     *        (that is, a user-defined object or a built in object) or a DOM object.\\n     * @param propertyKey The property name.\\n     * @param attributes Descriptor for the property. It can be for a data property or an accessor property.\\n     */\\n    function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;\\n\\n    /**\\n     * Removes a property from an object, equivalent to `delete target[propertyKey]`,\\n     * except it won't throw if `target[propertyKey]` is non-configurable.\\n     * @param target Object from which to remove the own property.\\n     * @param propertyKey The property name.\\n     */\\n    function deleteProperty(target: object, propertyKey: PropertyKey): boolean;\\n\\n    /**\\n     * Gets the property of target, equivalent to `target[propertyKey]` when `receiver === target`.\\n     * @param target Object that contains the property on itself or in its prototype chain.\\n     * @param propertyKey The property name.\\n     * @param receiver The reference to use as the `this` value in the getter function,\\n     *        if `target[propertyKey]` is an accessor property.\\n     */\\n    function get(target: object, propertyKey: PropertyKey, receiver?: any): any;\\n\\n    /**\\n     * Gets the own property descriptor of the specified object.\\n     * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.\\n     * @param target Object that contains the property.\\n     * @param propertyKey The property name.\\n     */\\n    function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor | undefined;\\n\\n    /**\\n     * Returns the prototype of an object.\\n     * @param target The object that references the prototype.\\n     */\\n    function getPrototypeOf(target: object): object | null;\\n\\n    /**\\n     * Equivalent to `propertyKey in target`.\\n     * @param target Object that contains the property on itself or in its prototype chain.\\n     * @param propertyKey Name of the property.\\n     */\\n    function has(target: object, propertyKey: PropertyKey): boolean;\\n\\n    /**\\n     * Returns a value that indicates whether new properties can be added to an object.\\n     * @param target Object to test.\\n     */\\n    function isExtensible(target: object): boolean;\\n\\n    /**\\n     * Returns the string and symbol keys of the own properties of an object. The own properties of an object\\n     * are those that are defined directly on that object, and are not inherited from the object's prototype.\\n     * @param target Object that contains the own properties.\\n     */\\n    function ownKeys(target: object): (string | symbol)[];\\n\\n    /**\\n     * Prevents the addition of new properties to an object.\\n     * @param target Object to make non-extensible.\\n     * @return Whether the object has been made non-extensible.\\n     */\\n    function preventExtensions(target: object): boolean;\\n\\n    /**\\n     * Sets the property of target, equivalent to `target[propertyKey] = value` when `receiver === target`.\\n     * @param target Object that contains the property on itself or in its prototype chain.\\n     * @param propertyKey Name of the property.\\n     * @param receiver The reference to use as the `this` value in the setter function,\\n     *        if `target[propertyKey]` is an accessor property.\\n     */\\n    function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean;\\n\\n    /**\\n     * Sets the prototype of a specified object o to object proto or null.\\n     * @param target The object to change its prototype.\\n     * @param proto The value of the new prototype or null.\\n     * @return Whether setting the prototype was successful.\\n     */\\n    function setPrototypeOf(target: object, proto: object | null): boolean;\\n}\\n\";\r\nlibFileMap['lib.es2015.symbol.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface SymbolConstructor {\\n    /**\\n     * A reference to the prototype.\\n     */\\n    readonly prototype: Symbol;\\n\\n    /**\\n     * Returns a new unique Symbol value.\\n     * @param  description Description of the new Symbol object.\\n     */\\n    (description?: string | number): symbol;\\n\\n    /**\\n     * Returns a Symbol object from the global symbol registry matching the given key if found.\\n     * Otherwise, returns a new symbol with this key.\\n     * @param key key to search for.\\n     */\\n    for(key: string): symbol;\\n\\n    /**\\n     * Returns a key from the global symbol registry matching the given Symbol if found.\\n     * Otherwise, returns a undefined.\\n     * @param sym Symbol to find the key for.\\n     */\\n    keyFor(sym: symbol): string | undefined;\\n}\\n\\ndeclare var Symbol: SymbolConstructor;\";\r\nlibFileMap['lib.es2015.symbol.wellknown.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2015.symbol\\\" />\\n\\ninterface SymbolConstructor {\\n    /**\\n     * A method that determines if a constructor object recognizes an object as one of the\\n     * constructor’s instances. Called by the semantics of the instanceof operator.\\n     */\\n    readonly hasInstance: symbol;\\n\\n    /**\\n     * A Boolean value that if true indicates that an object should flatten to its array elements\\n     * by Array.prototype.concat.\\n     */\\n    readonly isConcatSpreadable: symbol;\\n\\n    /**\\n     * A regular expression method that matches the regular expression against a string. Called\\n     * by the String.prototype.match method.\\n     */\\n    readonly match: symbol;\\n\\n    /**\\n     * A regular expression method that replaces matched substrings of a string. Called by the\\n     * String.prototype.replace method.\\n     */\\n    readonly replace: symbol;\\n\\n    /**\\n     * A regular expression method that returns the index within a string that matches the\\n     * regular expression. Called by the String.prototype.search method.\\n     */\\n    readonly search: symbol;\\n\\n    /**\\n     * A function valued property that is the constructor function that is used to create\\n     * derived objects.\\n     */\\n    readonly species: symbol;\\n\\n    /**\\n     * A regular expression method that splits a string at the indices that match the regular\\n     * expression. Called by the String.prototype.split method.\\n     */\\n    readonly split: symbol;\\n\\n    /**\\n     * A method that converts an object to a corresponding primitive value.\\n     * Called by the ToPrimitive abstract operation.\\n     */\\n    readonly toPrimitive: symbol;\\n\\n    /**\\n     * A String value that is used in the creation of the default string description of an object.\\n     * Called by the built-in method Object.prototype.toString.\\n     */\\n    readonly toStringTag: symbol;\\n\\n    /**\\n     * An Object whose own property names are property names that are excluded from the 'with'\\n     * environment bindings of the associated objects.\\n     */\\n    readonly unscopables: symbol;\\n}\\n\\ninterface Symbol {\\n    /**\\n     * Converts a Symbol object to a symbol.\\n     */\\n    [Symbol.toPrimitive](hint: string): symbol;\\n\\n    readonly [Symbol.toStringTag]: string;\\n}\\n\\ninterface Array<T> {\\n    /**\\n     * Returns an object whose properties have the value 'true'\\n     * when they will be absent when used in a 'with' statement.\\n     */\\n    [Symbol.unscopables](): {\\n        copyWithin: boolean;\\n        entries: boolean;\\n        fill: boolean;\\n        find: boolean;\\n        findIndex: boolean;\\n        keys: boolean;\\n        values: boolean;\\n    };\\n}\\n\\ninterface Date {\\n    /**\\n     * Converts a Date object to a string.\\n     */\\n    [Symbol.toPrimitive](hint: \\\"default\\\"): string;\\n    /**\\n     * Converts a Date object to a string.\\n     */\\n    [Symbol.toPrimitive](hint: \\\"string\\\"): string;\\n    /**\\n     * Converts a Date object to a number.\\n     */\\n    [Symbol.toPrimitive](hint: \\\"number\\\"): number;\\n    /**\\n     * Converts a Date object to a string or number.\\n     *\\n     * @param hint The strings \\\"number\\\", \\\"string\\\", or \\\"default\\\" to specify what primitive to return.\\n     *\\n     * @throws {TypeError} If 'hint' was given something other than \\\"number\\\", \\\"string\\\", or \\\"default\\\".\\n     * @returns A number if 'hint' was \\\"number\\\", a string if 'hint' was \\\"string\\\" or \\\"default\\\".\\n     */\\n    [Symbol.toPrimitive](hint: string): string | number;\\n}\\n\\ninterface Map<K, V> {\\n    readonly [Symbol.toStringTag]: string;\\n}\\n\\ninterface WeakMap<K extends object, V> {\\n    readonly [Symbol.toStringTag]: string;\\n}\\n\\ninterface Set<T> {\\n    readonly [Symbol.toStringTag]: string;\\n}\\n\\ninterface WeakSet<T extends object> {\\n    readonly [Symbol.toStringTag]: string;\\n}\\n\\ninterface JSON {\\n    readonly [Symbol.toStringTag]: string;\\n}\\n\\ninterface Function {\\n    /**\\n     * Determines whether the given value inherits from this function if this function was used\\n     * as a constructor function.\\n     *\\n     * A constructor function can control which objects are recognized as its instances by\\n     * 'instanceof' by overriding this method.\\n     */\\n    [Symbol.hasInstance](value: any): boolean;\\n}\\n\\ninterface GeneratorFunction {\\n    readonly [Symbol.toStringTag]: string;\\n}\\n\\ninterface Math {\\n    readonly [Symbol.toStringTag]: string;\\n}\\n\\ninterface Promise<T> {\\n    readonly [Symbol.toStringTag]: string;\\n}\\n\\ninterface PromiseConstructor {\\n    readonly [Symbol.species]: PromiseConstructor;\\n}\\n\\ninterface RegExp {\\n    /**\\n     * Matches a string with this regular expression, and returns an array containing the results of\\n     * that search.\\n     * @param string A string to search within.\\n     */\\n    [Symbol.match](string: string): RegExpMatchArray | null;\\n\\n    /**\\n     * Replaces text in a string, using this regular expression.\\n     * @param string A String object or string literal whose contents matching against\\n     *               this regular expression will be replaced\\n     * @param replaceValue A String object or string literal containing the text to replace for every\\n     *                     successful match of this regular expression.\\n     */\\n    [Symbol.replace](string: string, replaceValue: string): string;\\n\\n    /**\\n     * Replaces text in a string, using this regular expression.\\n     * @param string A String object or string literal whose contents matching against\\n     *               this regular expression will be replaced\\n     * @param replacer A function that returns the replacement text.\\n     */\\n    [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string;\\n\\n    /**\\n     * Finds the position beginning first substring match in a regular expression search\\n     * using this regular expression.\\n     *\\n     * @param string The string to search within.\\n     */\\n    [Symbol.search](string: string): number;\\n\\n    /**\\n     * Returns an array of substrings that were delimited by strings in the original input that\\n     * match against this regular expression.\\n     *\\n     * If the regular expression contains capturing parentheses, then each time this\\n     * regular expression matches, the results (including any undefined results) of the\\n     * capturing parentheses are spliced.\\n     *\\n     * @param string string value to split\\n     * @param limit if not undefined, the output array is truncated so that it contains no more\\n     * than 'limit' elements.\\n     */\\n    [Symbol.split](string: string, limit?: number): string[];\\n}\\n\\ninterface RegExpConstructor {\\n    readonly [Symbol.species]: RegExpConstructor;\\n}\\n\\ninterface String {\\n    /**\\n     * Matches a string or an object that supports being matched against, and returns an array\\n     * containing the results of that search, or null if no matches are found.\\n     * @param matcher An object that supports being matched against.\\n     */\\n    match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null;\\n\\n    /**\\n     * Replaces text in a string, using an object that supports replacement within a string.\\n     * @param searchValue A object can search for and replace matches within a string.\\n     * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\\n     */\\n    replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string;\\n\\n    /**\\n     * Replaces text in a string, using an object that supports replacement within a string.\\n     * @param searchValue A object can search for and replace matches within a string.\\n     * @param replacer A function that returns the replacement text.\\n     */\\n    replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string;\\n\\n    /**\\n     * Finds the first substring match in a regular expression search.\\n     * @param searcher An object which supports searching within a string.\\n     */\\n    search(searcher: { [Symbol.search](string: string): number; }): number;\\n\\n    /**\\n     * Split a string into substrings using the specified separator and return them as an array.\\n     * @param splitter An object that can split a string.\\n     * @param limit A value used to limit the number of elements returned in the array.\\n     */\\n    split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[];\\n}\\n\\ninterface ArrayBuffer {\\n    readonly [Symbol.toStringTag]: string;\\n}\\n\\ninterface DataView {\\n    readonly [Symbol.toStringTag]: string;\\n}\\n\\ninterface Int8Array {\\n    readonly [Symbol.toStringTag]: \\\"Int8Array\\\";\\n}\\n\\ninterface Uint8Array {\\n    readonly [Symbol.toStringTag]: \\\"Uint8Array\\\";\\n}\\n\\ninterface Uint8ClampedArray {\\n    readonly [Symbol.toStringTag]: \\\"Uint8ClampedArray\\\";\\n}\\n\\ninterface Int16Array {\\n    readonly [Symbol.toStringTag]: \\\"Int16Array\\\";\\n}\\n\\ninterface Uint16Array {\\n    readonly [Symbol.toStringTag]: \\\"Uint16Array\\\";\\n}\\n\\ninterface Int32Array {\\n    readonly [Symbol.toStringTag]: \\\"Int32Array\\\";\\n}\\n\\ninterface Uint32Array {\\n    readonly [Symbol.toStringTag]: \\\"Uint32Array\\\";\\n}\\n\\ninterface Float32Array {\\n    readonly [Symbol.toStringTag]: \\\"Float32Array\\\";\\n}\\n\\ninterface Float64Array {\\n    readonly [Symbol.toStringTag]: \\\"Float64Array\\\";\\n}\\n\\ninterface ArrayConstructor {\\n    readonly [Symbol.species]: ArrayConstructor;\\n}\\ninterface MapConstructor {\\n    readonly [Symbol.species]: MapConstructor;\\n}\\ninterface SetConstructor {\\n    readonly [Symbol.species]: SetConstructor;\\n}\\ninterface ArrayBufferConstructor {\\n    readonly [Symbol.species]: ArrayBufferConstructor;\\n}\\n\";\r\nlibFileMap['lib.es2016.array.include.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface Array<T> {\\n    /**\\n     * Determines whether an array includes a certain element, returning true or false as appropriate.\\n     * @param searchElement The element to search for.\\n     * @param fromIndex The position in this array at which to begin searching for searchElement.\\n     */\\n    includes(searchElement: T, fromIndex?: number): boolean;\\n}\\n\\ninterface ReadonlyArray<T> {\\n    /**\\n     * Determines whether an array includes a certain element, returning true or false as appropriate.\\n     * @param searchElement The element to search for.\\n     * @param fromIndex The position in this array at which to begin searching for searchElement.\\n     */\\n    includes(searchElement: T, fromIndex?: number): boolean;\\n}\\n\\ninterface Int8Array {\\n    /**\\n     * Determines whether an array includes a certain element, returning true or false as appropriate.\\n     * @param searchElement The element to search for.\\n     * @param fromIndex The position in this array at which to begin searching for searchElement.\\n     */\\n    includes(searchElement: number, fromIndex?: number): boolean;\\n}\\n\\ninterface Uint8Array {\\n    /**\\n     * Determines whether an array includes a certain element, returning true or false as appropriate.\\n     * @param searchElement The element to search for.\\n     * @param fromIndex The position in this array at which to begin searching for searchElement.\\n     */\\n    includes(searchElement: number, fromIndex?: number): boolean;\\n}\\n\\ninterface Uint8ClampedArray {\\n    /**\\n     * Determines whether an array includes a certain element, returning true or false as appropriate.\\n     * @param searchElement The element to search for.\\n     * @param fromIndex The position in this array at which to begin searching for searchElement.\\n     */\\n    includes(searchElement: number, fromIndex?: number): boolean;\\n}\\n\\ninterface Int16Array {\\n    /**\\n     * Determines whether an array includes a certain element, returning true or false as appropriate.\\n     * @param searchElement The element to search for.\\n     * @param fromIndex The position in this array at which to begin searching for searchElement.\\n     */\\n    includes(searchElement: number, fromIndex?: number): boolean;\\n}\\n\\ninterface Uint16Array {\\n    /**\\n     * Determines whether an array includes a certain element, returning true or false as appropriate.\\n     * @param searchElement The element to search for.\\n     * @param fromIndex The position in this array at which to begin searching for searchElement.\\n     */\\n    includes(searchElement: number, fromIndex?: number): boolean;\\n}\\n\\ninterface Int32Array {\\n    /**\\n     * Determines whether an array includes a certain element, returning true or false as appropriate.\\n     * @param searchElement The element to search for.\\n     * @param fromIndex The position in this array at which to begin searching for searchElement.\\n     */\\n    includes(searchElement: number, fromIndex?: number): boolean;\\n}\\n\\ninterface Uint32Array {\\n    /**\\n     * Determines whether an array includes a certain element, returning true or false as appropriate.\\n     * @param searchElement The element to search for.\\n     * @param fromIndex The position in this array at which to begin searching for searchElement.\\n     */\\n    includes(searchElement: number, fromIndex?: number): boolean;\\n}\\n\\ninterface Float32Array {\\n    /**\\n     * Determines whether an array includes a certain element, returning true or false as appropriate.\\n     * @param searchElement The element to search for.\\n     * @param fromIndex The position in this array at which to begin searching for searchElement.\\n     */\\n    includes(searchElement: number, fromIndex?: number): boolean;\\n}\\n\\ninterface Float64Array {\\n    /**\\n     * Determines whether an array includes a certain element, returning true or false as appropriate.\\n     * @param searchElement The element to search for.\\n     * @param fromIndex The position in this array at which to begin searching for searchElement.\\n     */\\n    includes(searchElement: number, fromIndex?: number): boolean;\\n}\";\r\nlibFileMap['lib.es2016.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2015\\\" />\\n/// <reference lib=\\\"es2016.array.include\\\" />\";\r\nlibFileMap['lib.es2016.full.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2016\\\" />\\n/// <reference lib=\\\"dom\\\" />\\n/// <reference lib=\\\"webworker.importscripts\\\" />\\n/// <reference lib=\\\"scripthost\\\" />\\n/// <reference lib=\\\"dom.iterable\\\" />\";\r\nlibFileMap['lib.es2017.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2016\\\" />\\n/// <reference lib=\\\"es2017.object\\\" />\\n/// <reference lib=\\\"es2017.sharedmemory\\\" />\\n/// <reference lib=\\\"es2017.string\\\" />\\n/// <reference lib=\\\"es2017.intl\\\" />\\n/// <reference lib=\\\"es2017.typedarrays\\\" />\\n\";\r\nlibFileMap['lib.es2017.full.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2017\\\" />\\n/// <reference lib=\\\"dom\\\" />\\n/// <reference lib=\\\"webworker.importscripts\\\" />\\n/// <reference lib=\\\"scripthost\\\" />\\n/// <reference lib=\\\"dom.iterable\\\" />\";\r\nlibFileMap['lib.es2017.intl.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ndeclare namespace Intl {\\n    type DateTimeFormatPartTypes = \\\"day\\\" | \\\"dayPeriod\\\" | \\\"era\\\" | \\\"hour\\\" | \\\"literal\\\" | \\\"minute\\\" | \\\"month\\\" | \\\"second\\\" | \\\"timeZoneName\\\" | \\\"weekday\\\" | \\\"year\\\";\\n\\n    interface DateTimeFormatPart {\\n        type: DateTimeFormatPartTypes;\\n        value: string;\\n    }\\n\\n    interface DateTimeFormat {\\n        formatToParts(date?: Date | number): DateTimeFormatPart[];\\n    }\\n}\\n\";\r\nlibFileMap['lib.es2017.object.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface ObjectConstructor {\\n    /**\\n     * Returns an array of values of the enumerable properties of an object\\n     * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\\n     */\\n    values<T>(o: { [s: string]: T } | ArrayLike<T>): T[];\\n\\n    /**\\n     * Returns an array of values of the enumerable properties of an object\\n     * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\\n     */\\n    values(o: {}): any[];\\n\\n    /**\\n     * Returns an array of key/values of the enumerable properties of an object\\n     * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\\n     */\\n    entries<T>(o: { [s: string]: T } | ArrayLike<T>): [string, T][];\\n\\n    /**\\n     * Returns an array of key/values of the enumerable properties of an object\\n     * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\\n     */\\n    entries(o: {}): [string, any][];\\n\\n    /**\\n     * Returns an object containing all own property descriptors of an object\\n     * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\\n     */\\n    getOwnPropertyDescriptors<T>(o: T): {[P in keyof T]: TypedPropertyDescriptor<T[P]>} & { [x: string]: PropertyDescriptor };\\n}\\n\";\r\nlibFileMap['lib.es2017.sharedmemory.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2015.symbol\\\" />\\n/// <reference lib=\\\"es2015.symbol.wellknown\\\" />\\n\\ninterface SharedArrayBuffer {\\n    /**\\n     * Read-only. The length of the ArrayBuffer (in bytes).\\n     */\\n    readonly byteLength: number;\\n\\n    /**\\n     * Returns a section of an SharedArrayBuffer.\\n     */\\n    slice(begin: number, end?: number): SharedArrayBuffer;\\n    readonly [Symbol.species]: SharedArrayBuffer;\\n    readonly [Symbol.toStringTag]: \\\"SharedArrayBuffer\\\";\\n}\\n\\ninterface SharedArrayBufferConstructor {\\n    readonly prototype: SharedArrayBuffer;\\n    new (byteLength: number): SharedArrayBuffer;\\n}\\ndeclare var SharedArrayBuffer: SharedArrayBufferConstructor;\\n\\ninterface ArrayBufferTypes {\\n    SharedArrayBuffer: SharedArrayBuffer;\\n}\\n\\ninterface Atomics {\\n    /**\\n     * Adds a value to the value at the given position in the array, returning the original value.\\n     * Until this atomic operation completes, any other read or write operation against the array\\n     * will block.\\n     */\\n    add(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number;\\n\\n    /**\\n     * Stores the bitwise AND of a value with the value at the given position in the array,\\n     * returning the original value. Until this atomic operation completes, any other read or\\n     * write operation against the array will block.\\n     */\\n    and(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number;\\n\\n    /**\\n     * Replaces the value at the given position in the array if the original value equals the given\\n     * expected value, returning the original value. Until this atomic operation completes, any\\n     * other read or write operation against the array will block.\\n     */\\n    compareExchange(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, expectedValue: number, replacementValue: number): number;\\n\\n    /**\\n     * Replaces the value at the given position in the array, returning the original value. Until\\n     * this atomic operation completes, any other read or write operation against the array will\\n     * block.\\n     */\\n    exchange(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number;\\n\\n    /**\\n     * Returns a value indicating whether high-performance algorithms can use atomic operations\\n     * (`true`) or must use locks (`false`) for the given number of bytes-per-element of a typed\\n     * array.\\n     */\\n    isLockFree(size: number): boolean;\\n\\n    /**\\n     * Returns the value at the given position in the array. Until this atomic operation completes,\\n     * any other read or write operation against the array will block.\\n     */\\n    load(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number): number;\\n\\n    /**\\n     * Stores the bitwise OR of a value with the value at the given position in the array,\\n     * returning the original value. Until this atomic operation completes, any other read or write\\n     * operation against the array will block.\\n     */\\n    or(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number;\\n\\n    /**\\n     * Stores a value at the given position in the array, returning the new value. Until this\\n     * atomic operation completes, any other read or write operation against the array will block.\\n     */\\n    store(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number;\\n\\n    /**\\n     * Subtracts a value from the value at the given position in the array, returning the original\\n     * value. Until this atomic operation completes, any other read or write operation against the\\n     * array will block.\\n     */\\n    sub(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number;\\n\\n    /**\\n     * If the value at the given position in the array is equal to the provided value, the current\\n     * agent is put to sleep causing execution to suspend until the timeout expires (returning\\n     * `\\\"timed-out\\\"`) or until the agent is awoken (returning `\\\"ok\\\"`); otherwise, returns\\n     * `\\\"not-equal\\\"`.\\n     */\\n    wait(typedArray: Int32Array, index: number, value: number, timeout?: number): \\\"ok\\\" | \\\"not-equal\\\" | \\\"timed-out\\\";\\n\\n    /**\\n     * Wakes up sleeping agents that are waiting on the given index of the array, returning the\\n     * number of agents that were awoken.\\n     * @param typedArray A shared Int32Array.\\n     * @param index The position in the typedArray to wake up on.\\n     * @param count The number of sleeping agents to notify. Defaults to +Infinity.\\n     */\\n    notify(typedArray: Int32Array, index: number, count?: number): number;\\n\\n    /**\\n     * Stores the bitwise XOR of a value with the value at the given position in the array,\\n     * returning the original value. Until this atomic operation completes, any other read or write\\n     * operation against the array will block.\\n     */\\n    xor(typedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, index: number, value: number): number;\\n\\n    readonly [Symbol.toStringTag]: \\\"Atomics\\\";\\n}\\n\\ndeclare var Atomics: Atomics;\\n\";\r\nlibFileMap['lib.es2017.string.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface String {\\n    /**\\n     * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.\\n     * The padding is applied from the start (left) of the current string.\\n     *\\n     * @param maxLength The length of the resulting string once the current string has been padded.\\n     *        If this parameter is smaller than the current string's length, the current string will be returned as it is.\\n     *\\n     * @param fillString The string to pad the current string with.\\n     *        If this string is too long, it will be truncated and the left-most part will be applied.\\n     *        The default value for this parameter is \\\" \\\" (U+0020).\\n     */\\n    padStart(maxLength: number, fillString?: string): string;\\n\\n    /**\\n     * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.\\n     * The padding is applied from the end (right) of the current string.\\n     *\\n     * @param maxLength The length of the resulting string once the current string has been padded.\\n     *        If this parameter is smaller than the current string's length, the current string will be returned as it is.\\n     *\\n     * @param fillString The string to pad the current string with.\\n     *        If this string is too long, it will be truncated and the left-most part will be applied.\\n     *        The default value for this parameter is \\\" \\\" (U+0020).\\n     */\\n    padEnd(maxLength: number, fillString?: string): string;\\n}\\n\";\r\nlibFileMap['lib.es2017.typedarrays.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface Int8ArrayConstructor {\\n    new (): Int8Array;\\n}\\n\\ninterface Uint8ArrayConstructor {\\n    new (): Uint8Array;\\n}\\n\\ninterface Uint8ClampedArrayConstructor {\\n    new (): Uint8ClampedArray;\\n}\\n\\ninterface Int16ArrayConstructor {\\n    new (): Int16Array;\\n}\\n\\ninterface Uint16ArrayConstructor {\\n    new (): Uint16Array;\\n}\\n\\ninterface Int32ArrayConstructor {\\n    new (): Int32Array;\\n}\\n\\ninterface Uint32ArrayConstructor {\\n    new (): Uint32Array;\\n}\\n\\ninterface Float32ArrayConstructor {\\n    new (): Float32Array;\\n}\\n\\ninterface Float64ArrayConstructor {\\n    new (): Float64Array;\\n}\\n\";\r\nlibFileMap['lib.es2018.asyncgenerator.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2018.asynciterable\\\" />\\n\\ninterface AsyncGenerator<T = unknown, TReturn = any, TNext = unknown> extends AsyncIterator<T, TReturn, TNext> {\\n    // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.\\n    next(...args: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;\\n    return(value: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;\\n    throw(e: any): Promise<IteratorResult<T, TReturn>>;\\n    [Symbol.asyncIterator](): AsyncGenerator<T, TReturn, TNext>;\\n}\\n\\ninterface AsyncGeneratorFunction {\\n    /**\\n     * Creates a new AsyncGenerator object.\\n     * @param args A list of arguments the function accepts.\\n     */\\n    new (...args: any[]): AsyncGenerator;\\n    /**\\n     * Creates a new AsyncGenerator object.\\n     * @param args A list of arguments the function accepts.\\n     */\\n    (...args: any[]): AsyncGenerator;\\n    /**\\n     * The length of the arguments.\\n     */\\n    readonly length: number;\\n    /**\\n     * Returns the name of the function.\\n     */\\n    readonly name: string;\\n    /**\\n     * A reference to the prototype.\\n     */\\n    readonly prototype: AsyncGenerator;\\n}\\n\\ninterface AsyncGeneratorFunctionConstructor {\\n    /**\\n     * Creates a new AsyncGenerator function.\\n     * @param args A list of arguments the function accepts.\\n     */\\n    new (...args: string[]): AsyncGeneratorFunction;\\n    /**\\n     * Creates a new AsyncGenerator function.\\n     * @param args A list of arguments the function accepts.\\n     */\\n    (...args: string[]): AsyncGeneratorFunction;\\n    /**\\n     * The length of the arguments.\\n     */\\n    readonly length: number;\\n    /**\\n     * Returns the name of the function.\\n     */\\n    readonly name: string;\\n    /**\\n     * A reference to the prototype.\\n     */\\n    readonly prototype: AsyncGeneratorFunction;\\n}\\n\";\r\nlibFileMap['lib.es2018.asynciterable.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2015.symbol\\\" />\\n/// <reference lib=\\\"es2015.iterable\\\" />\\n\\ninterface SymbolConstructor {\\n    /**\\n     * A method that returns the default async iterator for an object. Called by the semantics of\\n     * the for-await-of statement.\\n     */\\n    readonly asyncIterator: symbol;\\n}\\n\\ninterface AsyncIterator<T, TReturn = any, TNext = undefined> {\\n    // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.\\n    next(...args: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;\\n    return?(value?: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;\\n    throw?(e?: any): Promise<IteratorResult<T, TReturn>>;\\n}\\n\\ninterface AsyncIterable<T> {\\n    [Symbol.asyncIterator](): AsyncIterator<T>;\\n}\\n\\ninterface AsyncIterableIterator<T> extends AsyncIterator<T> {\\n    [Symbol.asyncIterator](): AsyncIterableIterator<T>;\\n}\";\r\nlibFileMap['lib.es2018.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2017\\\" />\\n/// <reference lib=\\\"es2018.asynciterable\\\" />\\n/// <reference lib=\\\"es2018.asyncgenerator\\\" />\\n/// <reference lib=\\\"es2018.promise\\\" />\\n/// <reference lib=\\\"es2018.regexp\\\" />\\n/// <reference lib=\\\"es2018.intl\\\" />\\n\";\r\nlibFileMap['lib.es2018.full.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2018\\\" />\\n/// <reference lib=\\\"dom\\\" />\\n/// <reference lib=\\\"webworker.importscripts\\\" />\\n/// <reference lib=\\\"scripthost\\\" />\\n/// <reference lib=\\\"dom.iterable\\\" />\";\r\nlibFileMap['lib.es2018.intl.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ndeclare namespace Intl {\\n\\n    // http://cldr.unicode.org/index/cldr-spec/plural-rules#TOC-Determining-Plural-Categories\\n    type LDMLPluralRule = \\\"zero\\\" | \\\"one\\\" | \\\"two\\\" | \\\"few\\\" | \\\"many\\\" | \\\"other\\\";\\n    type PluralRuleType = \\\"cardinal\\\" | \\\"ordinal\\\";\\n\\n    interface PluralRulesOptions {\\n        localeMatcher?: \\\"lookup\\\" | \\\"best fit\\\";\\n        type?: PluralRuleType;\\n        minimumIntegerDigits?: number;\\n        minimumFractionDigits?: number;\\n        maximumFractionDigits?: number;\\n        minimumSignificantDigits?: number;\\n        maximumSignificantDigits?: number;\\n    }\\n\\n    interface ResolvedPluralRulesOptions {\\n        locale: string;\\n        pluralCategories: LDMLPluralRule[];\\n        type: PluralRuleType;\\n        minimumIntegerDigits: number;\\n        minimumFractionDigits: number;\\n        maximumFractionDigits: number;\\n        minimumSignificantDigits?: number;\\n        maximumSignificantDigits?: number;\\n    }\\n\\n    interface PluralRules {\\n        resolvedOptions(): ResolvedPluralRulesOptions;\\n        select(n: number): LDMLPluralRule;\\n    }\\n\\n    const PluralRules: {\\n        new (locales?: string | string[], options?: PluralRulesOptions): PluralRules;\\n        (locales?: string | string[], options?: PluralRulesOptions): PluralRules;\\n        supportedLocalesOf(\\n            locales: string | string[],\\n            options?: PluralRulesOptions,\\n        ): string[];\\n    };\\n}\\n\";\r\nlibFileMap['lib.es2018.promise.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/**\\n * Represents the completion of an asynchronous operation\\n */\\ninterface Promise<T> {\\n    /**\\n     * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The\\n     * resolved value cannot be modified from the callback.\\n     * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).\\n     * @returns A Promise for the completion of the callback.\\n     */\\n    finally(onfinally?: (() => void) | undefined | null): Promise<T>\\n}\\n\";\r\nlibFileMap['lib.es2018.regexp.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface RegExpMatchArray {\\n    groups?: {\\n        [key: string]: string\\n    }\\n}\\n\\ninterface RegExpExecArray {\\n    groups?: {\\n        [key: string]: string\\n    }\\n}\\n\\ninterface RegExp {\\n    /**\\n     * Returns a Boolean value indicating the state of the dotAll flag (s) used with a regular expression.\\n     * Default is false. Read-only.\\n     */\\n    readonly dotAll: boolean;\\n}\";\r\nlibFileMap['lib.es2019.array.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ntype FlatArray<Arr, Depth extends number> = {\\n    \\\"done\\\": Arr,\\n    \\\"recur\\\": Arr extends ReadonlyArray<infer InnerArr>\\n        ? FlatArray<InnerArr, [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]>\\n        : Arr\\n}[Depth extends -1 ? \\\"done\\\" : \\\"recur\\\"];\\n\\ninterface ReadonlyArray<T> {\\n\\n    /**\\n     * Calls a defined callback function on each element of an array. Then, flattens the result into\\n     * a new array.\\n     * This is identical to a map followed by flat with depth 1.\\n     *\\n     * @param callback A function that accepts up to three arguments. The flatMap method calls the\\n     * callback function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callback function. If\\n     * thisArg is omitted, undefined is used as the this value.\\n     */\\n    flatMap<U, This = undefined> (\\n        callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray<U>,\\n        thisArg?: This\\n    ): U[]\\n\\n\\n    /**\\n     * Returns a new array with all sub-array elements concatenated into it recursively up to the\\n     * specified depth.\\n     *\\n     * @param depth The maximum recursion depth\\n     */\\n    flat<A, D extends number = 1>(\\n        this: A,\\n        depth?: D\\n    ): FlatArray<A, D>[]\\n  }\\n\\ninterface Array<T> {\\n\\n    /**\\n     * Calls a defined callback function on each element of an array. Then, flattens the result into\\n     * a new array.\\n     * This is identical to a map followed by flat with depth 1.\\n     *\\n     * @param callback A function that accepts up to three arguments. The flatMap method calls the\\n     * callback function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callback function. If\\n     * thisArg is omitted, undefined is used as the this value.\\n     */\\n    flatMap<U, This = undefined> (\\n        callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray<U>,\\n        thisArg?: This\\n    ): U[]\\n\\n    /**\\n     * Returns a new array with all sub-array elements concatenated into it recursively up to the\\n     * specified depth.\\n     *\\n     * @param depth The maximum recursion depth\\n     */\\n    flat<A, D extends number = 1>(\\n        this: A,\\n        depth?: D\\n    ): FlatArray<A, D>[]\\n}\\n\";\r\nlibFileMap['lib.es2019.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2018\\\" />\\n/// <reference lib=\\\"es2019.array\\\" />\\n/// <reference lib=\\\"es2019.object\\\" />\\n/// <reference lib=\\\"es2019.string\\\" />\\n/// <reference lib=\\\"es2019.symbol\\\" />\\n\";\r\nlibFileMap['lib.es2019.full.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2019\\\" />\\n/// <reference lib=\\\"dom\\\" />\\n/// <reference lib=\\\"webworker.importscripts\\\" />\\n/// <reference lib=\\\"scripthost\\\" />\\n/// <reference lib=\\\"dom.iterable\\\" />\\n\";\r\nlibFileMap['lib.es2019.object.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2015.iterable\\\" />\\n\\ninterface ObjectConstructor {\\n    /**\\n     * Returns an object created by key-value entries for properties and methods\\n     * @param entries An iterable object that contains key-value entries for properties and methods.\\n     */\\n    fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): { [k: string]: T };\\n\\n    /**\\n     * Returns an object created by key-value entries for properties and methods\\n     * @param entries An iterable object that contains key-value entries for properties and methods.\\n     */\\n    fromEntries(entries: Iterable<readonly any[]>): any;\\n}\\n\";\r\nlibFileMap['lib.es2019.string.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface String {\\n    /** Removes the trailing white space and line terminator characters from a string. */\\n    trimEnd(): string;\\n\\n    /** Removes the leading white space and line terminator characters from a string. */\\n    trimStart(): string;\\n\\n    /** Removes the leading white space and line terminator characters from a string. */\\n    trimLeft(): string;\\n\\n    /** Removes the trailing white space and line terminator characters from a string. */\\n    trimRight(): string;\\n}\\n\";\r\nlibFileMap['lib.es2019.symbol.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface Symbol {\\n    /**\\n     * Expose the [[Description]] internal slot of a symbol directly.\\n     */\\n    readonly description: string | undefined;\\n}\\n\";\r\nlibFileMap['lib.es2020.bigint.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface BigIntToLocaleStringOptions {\\n    /**\\n     * The locale matching algorithm to use.The default is \\\"best fit\\\". For information about this option, see the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation Intl page}.\\n     */\\n    localeMatcher?: string;\\n    /**\\n     * The formatting style to use , the default is \\\"decimal\\\".\\n     */\\n    style?: string;\\n\\n    numberingSystem?: string;\\n    /**\\n     * The unit to use in unit formatting, Possible values are core unit identifiers, defined in UTS #35, Part 2, Section 6. A subset of units from the full list was selected for use in ECMAScript. Pairs of simple units can be concatenated with \\\"-per-\\\" to make a compound unit. There is no default value; if the style is \\\"unit\\\", the unit property must be provided.\\n     */\\n    unit?: string;\\n\\n    /**\\n     * The unit formatting style to use in unit formatting, the defaults is \\\"short\\\".\\n     */\\n    unitDisplay?: string;\\n\\n    /**\\n     * The currency to use in currency formatting. Possible values are the ISO 4217 currency codes, such as \\\"USD\\\" for the US dollar, \\\"EUR\\\" for the euro, or \\\"CNY\\\" for the Chinese RMB — see the Current currency & funds code list. There is no default value; if the style is \\\"currency\\\", the currency property must be provided. It is only used when [[Style]] has the value \\\"currency\\\".\\n     */\\n    currency?: string;\\n\\n    /**\\n     * How to display the currency in currency formatting. It is only used when [[Style]] has the value \\\"currency\\\". The default is \\\"symbol\\\".\\n     *\\n     * \\\"symbol\\\" to use a localized currency symbol such as €,\\n     *\\n     * \\\"code\\\" to use the ISO currency code,\\n     *\\n     * \\\"name\\\" to use a localized currency name such as \\\"dollar\\\"\\n     */\\n    currencyDisplay?: string;\\n\\n    /**\\n     * Whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators. The default is true.\\n     */\\n    useGrouping?: boolean;\\n\\n    /**\\n     * The minimum number of integer digits to use. Possible values are from 1 to 21; the default is 1.\\n     */\\n    minimumIntegerDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;\\n\\n    /**\\n     * The minimum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number and percent formatting is 0; the default for currency formatting is the number of minor unit digits provided by the {@link http://www.currency-iso.org/en/home/tables/table-a1.html ISO 4217 currency codes list} (2 if the list doesn't provide that information).\\n     */\\n    minimumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;\\n\\n    /**\\n     * The maximum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number formatting is the larger of minimumFractionDigits and 3; the default for currency formatting is the larger of minimumFractionDigits and the number of minor unit digits provided by the {@link http://www.currency-iso.org/en/home/tables/table-a1.html ISO 4217 currency codes list} (2 if the list doesn't provide that information); the default for percent formatting is the larger of minimumFractionDigits and 0.\\n     */\\n    maximumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;\\n\\n    /**\\n     * The minimum number of significant digits to use. Possible values are from 1 to 21; the default is 1.\\n     */\\n    minimumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;\\n\\n    /**\\n     * The maximum number of significant digits to use. Possible values are from 1 to 21; the default is 21.\\n     */\\n    maximumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;\\n\\n    /**\\n     * The formatting that should be displayed for the number, the defaults is \\\"standard\\\"\\n     *\\n     *     \\\"standard\\\" plain number formatting\\n     *\\n     *     \\\"scientific\\\" return the order-of-magnitude for formatted number.\\n     *\\n     *     \\\"engineering\\\" return the exponent of ten when divisible by three\\n     *\\n     *     \\\"compact\\\" string representing exponent, defaults is using the \\\"short\\\" form\\n     */\\n    notation?: string;\\n\\n    /**\\n     * used only when notation is \\\"compact\\\"\\n     */\\n    compactDisplay?: string;\\n}\\n\\ninterface BigInt {\\n    /**\\n     * Returns a string representation of an object.\\n     * @param radix Specifies a radix for converting numeric values to strings.\\n     */\\n    toString(radix?: number): string;\\n\\n    /** Returns a string representation appropriate to the host environment's current locale. */\\n    toLocaleString(locales?: string, options?: BigIntToLocaleStringOptions): string;\\n\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): bigint;\\n\\n    readonly [Symbol.toStringTag]: \\\"BigInt\\\";\\n}\\n\\ninterface BigIntConstructor {\\n    (value?: any): bigint;\\n    readonly prototype: BigInt;\\n\\n    /**\\n     * Interprets the low bits of a BigInt as a 2's-complement signed integer.\\n     * All higher bits are discarded.\\n     * @param bits The number of low bits to use\\n     * @param int The BigInt whose bits to extract\\n     */\\n    asIntN(bits: number, int: bigint): bigint;\\n    /**\\n     * Interprets the low bits of a BigInt as an unsigned integer.\\n     * All higher bits are discarded.\\n     * @param bits The number of low bits to use\\n     * @param int The BigInt whose bits to extract\\n     */\\n    asUintN(bits: number, int: bigint): bigint;\\n}\\n\\ndeclare var BigInt: BigIntConstructor;\\n\\n/**\\n * A typed array of 64-bit signed integer values. The contents are initialized to 0. If the\\n * requested number of bytes could not be allocated, an exception is raised.\\n */\\ninterface BigInt64Array {\\n    /** The size in bytes of each element in the array. */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /** The ArrayBuffer instance referenced by the array. */\\n    readonly buffer: ArrayBufferLike;\\n\\n    /** The length in bytes of the array. */\\n    readonly byteLength: number;\\n\\n    /** The offset in bytes of the array. */\\n    readonly byteOffset: number;\\n\\n    /**\\n     * Returns the this object after copying a section of the array identified by start and end\\n     * to the same array starting at position target\\n     * @param target If target is negative, it is treated as length+target where length is the\\n     * length of the array.\\n     * @param start If start is negative, it is treated as length+start. If end is negative, it\\n     * is treated as length+end.\\n     * @param end If not specified, length of the this object is used as its default value.\\n     */\\n    copyWithin(target: number, start: number, end?: number): this;\\n\\n    /** Yields index, value pairs for every entry in the array. */\\n    entries(): IterableIterator<[number, bigint]>;\\n\\n    /**\\n     * Determines whether all the members of an array satisfy the specified test.\\n     * @param predicate A function that accepts up to three arguments. The every method calls\\n     * the predicate function for each element in the array until the predicate returns false,\\n     * or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    every(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean;\\n\\n    /**\\n     * Returns the this object after filling the section identified by start and end with value\\n     * @param value value to fill array section with\\n     * @param start index to start filling the array at. If start is negative, it is treated as\\n     * length+start where length is the length of the array.\\n     * @param end index to stop filling the array at. If end is negative, it is treated as\\n     * length+end.\\n     */\\n    fill(value: bigint, start?: number, end?: number): this;\\n\\n    /**\\n     * Returns the elements of an array that meet the condition specified in a callback function.\\n     * @param predicate A function that accepts up to three arguments. The filter method calls\\n     * the predicate function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    filter(predicate: (value: bigint, index: number, array: BigInt64Array) => any, thisArg?: any): BigInt64Array;\\n\\n    /**\\n     * Returns the value of the first element in the array where predicate is true, and undefined\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found, find\\n     * immediately returns that element value. Otherwise, find returns undefined.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    find(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): bigint | undefined;\\n\\n    /**\\n     * Returns the index of the first element in the array where predicate is true, and -1\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found,\\n     * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    findIndex(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): number;\\n\\n    /**\\n     * Performs the specified action for each element in an array.\\n     * @param callbackfn A function that accepts up to three arguments. forEach calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    forEach(callbackfn: (value: bigint, index: number, array: BigInt64Array) => void, thisArg?: any): void;\\n\\n    /**\\n     * Determines whether an array includes a certain element, returning true or false as appropriate.\\n     * @param searchElement The element to search for.\\n     * @param fromIndex The position in this array at which to begin searching for searchElement.\\n     */\\n    includes(searchElement: bigint, fromIndex?: number): boolean;\\n\\n    /**\\n     * Returns the index of the first occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     * search starts at index 0.\\n     */\\n    indexOf(searchElement: bigint, fromIndex?: number): number;\\n\\n    /**\\n     * Adds all the elements of an array separated by the specified separator string.\\n     * @param separator A string used to separate one element of an array from the next in the\\n     * resulting String. If omitted, the array elements are separated with a comma.\\n     */\\n    join(separator?: string): string;\\n\\n    /** Yields each index in the array. */\\n    keys(): IterableIterator<number>;\\n\\n    /**\\n     * Returns the index of the last occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     * search starts at index 0.\\n     */\\n    lastIndexOf(searchElement: bigint, fromIndex?: number): number;\\n\\n    /** The length of the array. */\\n    readonly length: number;\\n\\n    /**\\n     * Calls a defined callback function on each element of an array, and returns an array that\\n     * contains the results.\\n     * @param callbackfn A function that accepts up to three arguments. The map method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    map(callbackfn: (value: bigint, index: number, array: BigInt64Array) => bigint, thisArg?: any): BigInt64Array;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint): bigint;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce<U>(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigInt64Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an\\n     * argument instead of an array value.\\n     */\\n    reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint): bigint;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduceRight<U>(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigInt64Array) => U, initialValue: U): U;\\n\\n    /** Reverses the elements in the array. */\\n    reverse(): this;\\n\\n    /**\\n     * Sets a value or an array of values.\\n     * @param array A typed or untyped array of values to set.\\n     * @param offset The index in the current array at which the values are to be written.\\n     */\\n    set(array: ArrayLike<bigint>, offset?: number): void;\\n\\n    /**\\n     * Returns a section of an array.\\n     * @param start The beginning of the specified portion of the array.\\n     * @param end The end of the specified portion of the array.\\n     */\\n    slice(start?: number, end?: number): BigInt64Array;\\n\\n    /**\\n     * Determines whether the specified callback function returns true for any element of an array.\\n     * @param predicate A function that accepts up to three arguments. The some method calls the\\n     * predicate function for each element in the array until the predicate returns true, or until\\n     * the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    some(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean;\\n\\n    /**\\n     * Sorts the array.\\n     * @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order.\\n     */\\n    sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this;\\n\\n    /**\\n     * Gets a new BigInt64Array view of the ArrayBuffer store for this array, referencing the elements\\n     * at begin, inclusive, up to end, exclusive.\\n     * @param begin The index of the beginning of the array.\\n     * @param end The index of the end of the array.\\n     */\\n    subarray(begin?: number, end?: number): BigInt64Array;\\n\\n    /** Converts the array to a string by using the current locale. */\\n    toLocaleString(): string;\\n\\n    /** Returns a string representation of the array. */\\n    toString(): string;\\n\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): BigInt64Array;\\n\\n    /** Yields each value in the array. */\\n    values(): IterableIterator<bigint>;\\n\\n    [Symbol.iterator](): IterableIterator<bigint>;\\n\\n    readonly [Symbol.toStringTag]: \\\"BigInt64Array\\\";\\n\\n    [index: number]: bigint;\\n}\\n\\ninterface BigInt64ArrayConstructor {\\n    readonly prototype: BigInt64Array;\\n    new(length?: number): BigInt64Array;\\n    new(array: Iterable<bigint>): BigInt64Array;\\n    new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigInt64Array;\\n\\n    /** The size in bytes of each element in the array. */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * Returns a new array from a set of elements.\\n     * @param items A set of elements to include in the new array object.\\n     */\\n    of(...items: bigint[]): BigInt64Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from(arrayLike: ArrayLike<bigint>): BigInt64Array;\\n    from<U>(arrayLike: ArrayLike<U>, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigInt64Array;\\n}\\n\\ndeclare var BigInt64Array: BigInt64ArrayConstructor;\\n\\n/**\\n * A typed array of 64-bit unsigned integer values. The contents are initialized to 0. If the\\n * requested number of bytes could not be allocated, an exception is raised.\\n */\\ninterface BigUint64Array {\\n    /** The size in bytes of each element in the array. */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /** The ArrayBuffer instance referenced by the array. */\\n    readonly buffer: ArrayBufferLike;\\n\\n    /** The length in bytes of the array. */\\n    readonly byteLength: number;\\n\\n    /** The offset in bytes of the array. */\\n    readonly byteOffset: number;\\n\\n    /**\\n     * Returns the this object after copying a section of the array identified by start and end\\n     * to the same array starting at position target\\n     * @param target If target is negative, it is treated as length+target where length is the\\n     * length of the array.\\n     * @param start If start is negative, it is treated as length+start. If end is negative, it\\n     * is treated as length+end.\\n     * @param end If not specified, length of the this object is used as its default value.\\n     */\\n    copyWithin(target: number, start: number, end?: number): this;\\n\\n    /** Yields index, value pairs for every entry in the array. */\\n    entries(): IterableIterator<[number, bigint]>;\\n\\n    /**\\n     * Determines whether all the members of an array satisfy the specified test.\\n     * @param predicate A function that accepts up to three arguments. The every method calls\\n     * the predicate function for each element in the array until the predicate returns false,\\n     * or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    every(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean;\\n\\n    /**\\n     * Returns the this object after filling the section identified by start and end with value\\n     * @param value value to fill array section with\\n     * @param start index to start filling the array at. If start is negative, it is treated as\\n     * length+start where length is the length of the array.\\n     * @param end index to stop filling the array at. If end is negative, it is treated as\\n     * length+end.\\n     */\\n    fill(value: bigint, start?: number, end?: number): this;\\n\\n    /**\\n     * Returns the elements of an array that meet the condition specified in a callback function.\\n     * @param predicate A function that accepts up to three arguments. The filter method calls\\n     * the predicate function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    filter(predicate: (value: bigint, index: number, array: BigUint64Array) => any, thisArg?: any): BigUint64Array;\\n\\n    /**\\n     * Returns the value of the first element in the array where predicate is true, and undefined\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found, find\\n     * immediately returns that element value. Otherwise, find returns undefined.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    find(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): bigint | undefined;\\n\\n    /**\\n     * Returns the index of the first element in the array where predicate is true, and -1\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found,\\n     * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    findIndex(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): number;\\n\\n    /**\\n     * Performs the specified action for each element in an array.\\n     * @param callbackfn A function that accepts up to three arguments. forEach calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    forEach(callbackfn: (value: bigint, index: number, array: BigUint64Array) => void, thisArg?: any): void;\\n\\n    /**\\n     * Determines whether an array includes a certain element, returning true or false as appropriate.\\n     * @param searchElement The element to search for.\\n     * @param fromIndex The position in this array at which to begin searching for searchElement.\\n     */\\n    includes(searchElement: bigint, fromIndex?: number): boolean;\\n\\n    /**\\n     * Returns the index of the first occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     * search starts at index 0.\\n     */\\n    indexOf(searchElement: bigint, fromIndex?: number): number;\\n\\n    /**\\n     * Adds all the elements of an array separated by the specified separator string.\\n     * @param separator A string used to separate one element of an array from the next in the\\n     * resulting String. If omitted, the array elements are separated with a comma.\\n     */\\n    join(separator?: string): string;\\n\\n    /** Yields each index in the array. */\\n    keys(): IterableIterator<number>;\\n\\n    /**\\n     * Returns the index of the last occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     * search starts at index 0.\\n     */\\n    lastIndexOf(searchElement: bigint, fromIndex?: number): number;\\n\\n    /** The length of the array. */\\n    readonly length: number;\\n\\n    /**\\n     * Calls a defined callback function on each element of an array, and returns an array that\\n     * contains the results.\\n     * @param callbackfn A function that accepts up to three arguments. The map method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    map(callbackfn: (value: bigint, index: number, array: BigUint64Array) => bigint, thisArg?: any): BigUint64Array;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint): bigint;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce<U>(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigUint64Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an\\n     * argument instead of an array value.\\n     */\\n    reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint): bigint;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduceRight<U>(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigUint64Array) => U, initialValue: U): U;\\n\\n    /** Reverses the elements in the array. */\\n    reverse(): this;\\n\\n    /**\\n     * Sets a value or an array of values.\\n     * @param array A typed or untyped array of values to set.\\n     * @param offset The index in the current array at which the values are to be written.\\n     */\\n    set(array: ArrayLike<bigint>, offset?: number): void;\\n\\n    /**\\n     * Returns a section of an array.\\n     * @param start The beginning of the specified portion of the array.\\n     * @param end The end of the specified portion of the array.\\n     */\\n    slice(start?: number, end?: number): BigUint64Array;\\n\\n    /**\\n     * Determines whether the specified callback function returns true for any element of an array.\\n     * @param predicate A function that accepts up to three arguments. The some method calls the\\n     * predicate function for each element in the array until the predicate returns true, or until\\n     * the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    some(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean;\\n\\n    /**\\n     * Sorts the array.\\n     * @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order.\\n     */\\n    sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this;\\n\\n    /**\\n     * Gets a new BigUint64Array view of the ArrayBuffer store for this array, referencing the elements\\n     * at begin, inclusive, up to end, exclusive.\\n     * @param begin The index of the beginning of the array.\\n     * @param end The index of the end of the array.\\n     */\\n    subarray(begin?: number, end?: number): BigUint64Array;\\n\\n    /** Converts the array to a string by using the current locale. */\\n    toLocaleString(): string;\\n\\n    /** Returns a string representation of the array. */\\n    toString(): string;\\n\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): BigUint64Array;\\n\\n    /** Yields each value in the array. */\\n    values(): IterableIterator<bigint>;\\n\\n    [Symbol.iterator](): IterableIterator<bigint>;\\n\\n    readonly [Symbol.toStringTag]: \\\"BigUint64Array\\\";\\n\\n    [index: number]: bigint;\\n}\\n\\ninterface BigUint64ArrayConstructor {\\n    readonly prototype: BigUint64Array;\\n    new(length?: number): BigUint64Array;\\n    new(array: Iterable<bigint>): BigUint64Array;\\n    new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigUint64Array;\\n\\n    /** The size in bytes of each element in the array. */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * Returns a new array from a set of elements.\\n     * @param items A set of elements to include in the new array object.\\n     */\\n    of(...items: bigint[]): BigUint64Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from(arrayLike: ArrayLike<bigint>): BigUint64Array;\\n    from<U>(arrayLike: ArrayLike<U>, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigUint64Array;\\n}\\n\\ndeclare var BigUint64Array: BigUint64ArrayConstructor;\\n\\ninterface DataView {\\n    /**\\n     * Gets the BigInt64 value at the specified byte offset from the start of the view. There is\\n     * no alignment constraint; multi-byte values may be fetched from any offset.\\n     * @param byteOffset The place in the buffer at which the value should be retrieved.\\n     */\\n    getBigInt64(byteOffset: number, littleEndian?: boolean): bigint;\\n\\n    /**\\n     * Gets the BigUint64 value at the specified byte offset from the start of the view. There is\\n     * no alignment constraint; multi-byte values may be fetched from any offset.\\n     * @param byteOffset The place in the buffer at which the value should be retrieved.\\n     */\\n    getBigUint64(byteOffset: number, littleEndian?: boolean): bigint;\\n\\n    /**\\n     * Stores a BigInt64 value at the specified byte offset from the start of the view.\\n     * @param byteOffset The place in the buffer at which the value should be set.\\n     * @param value The value to set.\\n     * @param littleEndian If false or undefined, a big-endian value should be written,\\n     * otherwise a little-endian value should be written.\\n     */\\n    setBigInt64(byteOffset: number, value: bigint, littleEndian?: boolean): void;\\n\\n    /**\\n     * Stores a BigUint64 value at the specified byte offset from the start of the view.\\n     * @param byteOffset The place in the buffer at which the value should be set.\\n     * @param value The value to set.\\n     * @param littleEndian If false or undefined, a big-endian value should be written,\\n     * otherwise a little-endian value should be written.\\n     */\\n    setBigUint64(byteOffset: number, value: bigint, littleEndian?: boolean): void;\\n}\\n\\ndeclare namespace Intl{\\n    interface NumberFormat {\\n        format(value: number | bigint): string;\\n        resolvedOptions(): ResolvedNumberFormatOptions;\\n    }\\n}\\n\";\r\nlibFileMap['lib.es2020.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2019\\\" />\\n/// <reference lib=\\\"es2020.bigint\\\" />\\n/// <reference lib=\\\"es2020.promise\\\" />\\n/// <reference lib=\\\"es2020.sharedmemory\\\" />\\n/// <reference lib=\\\"es2020.string\\\" />\\n/// <reference lib=\\\"es2020.symbol.wellknown\\\" />\\n/// <reference lib=\\\"es2020.intl\\\" />\\n\";\r\nlibFileMap['lib.es2020.full.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2020\\\" />\\n/// <reference lib=\\\"dom\\\" />\\n/// <reference lib=\\\"webworker.importscripts\\\" />\\n/// <reference lib=\\\"scripthost\\\" />\\n/// <reference lib=\\\"dom.iterable\\\" />\\n\";\r\nlibFileMap['lib.es2020.intl.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ndeclare namespace Intl {\\n\\n    /**\\n     * [BCP 47 language tag](http://tools.ietf.org/html/rfc5646) definition.\\n     *\\n     * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).\\n     *\\n     * [Wikipedia](https://en.wikipedia.org/wiki/IETF_language_tag).\\n     */\\n    type BCP47LanguageTag = string;\\n\\n    /**\\n     * Unit to use in the relative time internationalized message.\\n     *\\n     * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/format#Parameters).\\n     *\\n     * [Specification](https://tc39.es/ecma402/#sec-singularrelativetimeunit).\\n     */\\n    type RelativeTimeFormatUnit =\\n        | \\\"year\\\" | \\\"years\\\"\\n        | \\\"quarter\\\" | \\\"quarters\\\"\\n        | \\\"month\\\" | \\\"months\\\"\\n        | \\\"week\\\" | \\\"weeks\\\"\\n        | \\\"day\\\" | \\\"days\\\"\\n        | \\\"hour\\\" | \\\"hours\\\"\\n        | \\\"minute\\\" | \\\"minutes\\\"\\n        | \\\"second\\\" | \\\"seconds\\\"\\n        ;\\n\\n    /**\\n     * The locale matching algorithm to use.\\n     *\\n     * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation).\\n     *\\n     * [Specification](https://tc39.es/ecma402/#sec-InitializeRelativeTimeFormat).\\n     */\\n    type RelativeTimeFormatLocaleMatcher = \\\"lookup\\\" | \\\"best fit\\\";\\n\\n    /**\\n     * The format of output message.\\n     *\\n     * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters).\\n     *\\n     * [Specification](https://tc39.es/ecma402/#sec-InitializeRelativeTimeFormat).\\n     */\\n    type RelativeTimeFormatNumeric = \\\"always\\\" | \\\"auto\\\";\\n\\n    /**\\n     * The length of the internationalized message.\\n     *\\n     * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters).\\n     *\\n     * [Specification](https://tc39.es/ecma402/#sec-InitializeRelativeTimeFormat).\\n     */\\n    type RelativeTimeFormatStyle = \\\"long\\\" | \\\"short\\\" | \\\"narrow\\\";\\n\\n    /**\\n     * An object with some or all of properties of `options` parameter\\n     * of `Intl.RelativeTimeFormat` constructor.\\n     *\\n     * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters).\\n     *\\n     * [Specification](https://tc39.es/ecma402/#sec-InitializeRelativeTimeFormat).\\n     */\\n    interface RelativeTimeFormatOptions {\\n        localeMatcher?: RelativeTimeFormatLocaleMatcher;\\n        numeric?: RelativeTimeFormatNumeric;\\n        style?: RelativeTimeFormatStyle;\\n    }\\n\\n    /**\\n     * An object with properties reflecting the locale\\n     * and formatting options computed during initialization\\n     * of the `Intel.RelativeTimeFormat` object\\n     *\\n     * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/resolvedOptions#Description).\\n     *\\n     * [Specification](https://tc39.es/ecma402/#table-relativetimeformat-resolvedoptions-properties)\\n     */\\n    interface ResolvedRelativeTimeFormatOptions {\\n        locale: BCP47LanguageTag;\\n        style: RelativeTimeFormatStyle;\\n        numeric: RelativeTimeFormatNumeric;\\n        numberingSystem: string;\\n    }\\n\\n    /**\\n     * An object representing the relative time format in parts\\n     * that can be used for custom locale-aware formatting.\\n     *\\n     * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts).\\n     *\\n     * [Specification](https://tc39.es/ecma402/#sec-FormatRelativeTimeToParts).\\n     */\\n    interface RelativeTimeFormatPart {\\n        type: string;\\n        value: string;\\n        unit?: RelativeTimeFormatUnit;\\n    }\\n\\n    interface RelativeTimeFormat {\\n        /**\\n         * Formats a value and a unit according to the locale\\n         * and formatting options of the given\\n         * [`Intl.RelativeTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat)\\n         * object.\\n         *\\n         * While this method automatically provides the correct plural forms,\\n         * the grammatical form is otherwise as neutral as possible.\\n         * It is the caller's responsibility to handle cut-off logic\\n         * such as deciding between displaying \\\"in 7 days\\\" or \\\"in 1 week\\\".\\n         * This API does not support relative dates involving compound units.\\n         * e.g \\\"in 5 days and 4 hours\\\".\\n         *\\n         * @param value -  Numeric value to use in the internationalized relative time message\\n         *\\n         * @param unit - [Unit](https://tc39.es/ecma402/#sec-singularrelativetimeunit)\\n         *  to use in the relative time internationalized message.\\n         *  Possible values are: `\\\"year\\\"`, `\\\"quarter\\\"`, `\\\"month\\\"`, `\\\"week\\\"`,\\n         *  `\\\"day\\\"`, `\\\"hour\\\"`, `\\\"minute\\\"`, `\\\"second\\\"`.\\n         *  Plural forms are also permitted.\\n         *\\n         * @throws `RangeError` if `unit` was given something other than `unit` possible values\\n         *\\n         * @returns Internationalized relative time message as string\\n         *\\n         * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/format).\\n         *\\n         * [Specification](https://tc39.es/ecma402/#sec-Intl.RelativeTimeFormat.prototype.format).\\n         */\\n        format(\\n            value: number,\\n            unit: RelativeTimeFormatUnit,\\n        ): string;\\n\\n        /**\\n         *  A version of the format method which it returns an array of objects\\n         *  which represent \\\"parts\\\" of the object,\\n         *  separating the formatted number into its constituent parts\\n         *  and separating it from other surrounding text.\\n         *  These objects have two properties:\\n         * `type` a NumberFormat formatToParts type, and `value`,\\n         *  which is the String which is the component of the output.\\n         *  If a \\\"part\\\" came from NumberFormat,\\n         *  it will have a unit property which indicates the `unit` being formatted;\\n         *  literals which are part of the larger frame will not have this property.\\n         *\\n         *  @param value - Numeric value to use in the internationalized relative time message\\n         *\\n         *  @param unit - [Unit](https://tc39.es/ecma402/#sec-singularrelativetimeunit)\\n         *   to use in the relative time internationalized message.\\n         *   Possible values are: `\\\"year\\\"`, `\\\"quarter\\\"`, `\\\"month\\\"`, `\\\"week\\\"`,\\n         *   `\\\"day\\\"`, `\\\"hour\\\"`, `\\\"minute\\\"`, `\\\"second\\\"`.\\n         *   Plural forms are also permitted.\\n         *\\n         *  @throws `RangeError` if `unit` was given something other than `unit` possible values\\n         *\\n         *  @returns Array of [FormatRelativeTimeToParts](https://tc39.es/ecma402/#sec-FormatRelativeTimeToParts)\\n         *\\n         *  [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts).\\n         *\\n         *  [Specification](https://tc39.es/ecma402/#sec-Intl.RelativeTimeFormat.prototype.formatToParts).\\n         */\\n        formatToParts(\\n            value: number,\\n            unit: RelativeTimeFormatUnit,\\n        ): RelativeTimeFormatPart[];\\n\\n        /**\\n         * Provides access to the locale and options computed during initialization of this `Intl.RelativeTimeFormat` object.\\n         *\\n         * @returns A new object with properties reflecting the locale\\n         *  and formatting options computed during initialization\\n         *  of the `Intel.RelativeTimeFormat` object.\\n         *\\n         * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/resolvedOptions).\\n         *\\n         * [Specification](https://tc39.es/ecma402/#sec-intl.relativetimeformat.prototype.resolvedoptions)\\n         */\\n        resolvedOptions(): ResolvedRelativeTimeFormatOptions;\\n    }\\n\\n    /**\\n     * The [`Intl.RelativeTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat)\\n     * object is a constructor for objects that enable language-sensitive relative time formatting.\\n     *\\n     * Part of [Intl object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl)\\n     * namespace and the [ECMAScript Internationalization API](https://www.ecma-international.org/publications/standards/Ecma-402.htm).\\n     *\\n     * [Compatibility](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat#Browser_compatibility).\\n     *\\n     * [Polyfills](https://github.com/tc39/proposal-intl-relative-time#polyfills).\\n     */\\n    const RelativeTimeFormat: {\\n        /**\\n         * Constructor creates [Intl.RelativeTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat)\\n         * objects\\n         *\\n         * @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.\\n         *  For the general form and interpretation of the locales argument,\\n         *  see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).\\n         *\\n         * @param options - An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters)\\n         *  with some or all of options of the formatting.\\n         *  An object with some or all of the following properties:\\n         *  - `localeMatcher` - The locale matching algorithm to use.\\n         *    Possible values are `\\\"lookup\\\"` and `\\\"best fit\\\"`; the default is `\\\"best fit\\\"`.\\n         *    For information about this option, see [Intl page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation).\\n         *  - `numeric` - The format of output message.\\n         *    Possible values are: `\\\"always\\\"` (default, e.g., `1 day ago`) or `\\\"auto\\\"` (e.g., `yesterday`).\\n         *    The `\\\"auto\\\"` value allows to not always have to use numeric values in the output.\\n         *  - `style` - The length of the internationalized message. Possible values are:\\n         *    `\\\"long\\\"` (default, e.g., in 1 month),\\n         *    `\\\"short\\\"` (e.g., in 1 mo.)\\n         *    or `\\\"narrow\\\"` (e.g., in 1 mo.). The narrow style could be similar to the short style for some locales.\\n         *\\n         * @returns [Intl.RelativeTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat) object.\\n         *\\n         * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat).\\n         *\\n         * [Specification](https://tc39.es/ecma402/#sec-intl-relativetimeformat-constructor).\\n         */\\n        new(\\n            locales?: BCP47LanguageTag | BCP47LanguageTag[],\\n            options?: RelativeTimeFormatOptions,\\n        ): RelativeTimeFormat;\\n\\n        /**\\n         * Returns an array containing those of the provided locales\\n         * that are supported in date and time formatting\\n         * without having to fall back to the runtime's default locale.\\n         *\\n         * @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.\\n         *  For the general form and interpretation of the locales argument,\\n         *  see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).\\n         *\\n         * @param options - An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters)\\n         *  with some or all of options of the formatting.\\n         *  An object with some or all of the following properties:\\n         *  - `localeMatcher` - The locale matching algorithm to use.\\n         *    Possible values are `\\\"lookup\\\"` and `\\\"best fit\\\"`; the default is `\\\"best fit\\\"`.\\n         *    For information about this option, see [Intl page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation).\\n         *  - `numeric` - The format of output message.\\n         *    Possible values are: `\\\"always\\\"` (default, e.g., `1 day ago`) or `\\\"auto\\\"` (e.g., `yesterday`).\\n         *    The `\\\"auto\\\"` value allows to not always have to use numeric values in the output.\\n         *  - `style` - The length of the internationalized message. Possible values are:\\n         *    `\\\"long\\\"` (default, e.g., in 1 month),\\n         *    `\\\"short\\\"` (e.g., in 1 mo.)\\n         *    or `\\\"narrow\\\"` (e.g., in 1 mo.). The narrow style could be similar to the short style for some locales.\\n         *\\n         * @returns An array containing those of the provided locales\\n         *  that are supported in date and time formatting\\n         *  without having to fall back to the runtime's default locale.\\n         *\\n         * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/supportedLocalesOf).\\n         *\\n         * [Specification](https://tc39.es/ecma402/#sec-Intl.RelativeTimeFormat.supportedLocalesOf).\\n         */\\n        supportedLocalesOf(\\n            locales: BCP47LanguageTag | BCP47LanguageTag[],\\n            options?: RelativeTimeFormatOptions,\\n        ): BCP47LanguageTag[];\\n    };\\n\\n    interface NumberFormatOptions {\\n        compactDisplay?: string;\\n        notation?: string;\\n        signDisplay?: string;\\n        unit?: string;\\n        unitDisplay?: string;\\n    }\\n\\n    interface ResolvedNumberFormatOptions {\\n        compactDisplay?: string;\\n        notation?: string;\\n        signDisplay?: string;\\n        unit?: string;\\n        unitDisplay?: string;\\n    }\\n\\n    interface DateTimeFormatOptions {\\n        dateStyle?: \\\"full\\\" | \\\"long\\\" | \\\"medium\\\" | \\\"short\\\";\\n        timeStyle?: \\\"full\\\" | \\\"long\\\" | \\\"medium\\\" | \\\"short\\\";\\n        calendar?: string;\\n        dayPeriod?: \\\"narrow\\\" | \\\"short\\\" | \\\"long\\\";\\n        numberingSystem?: string;\\n        hourCycle?: \\\"h11\\\" | \\\"h12\\\" | \\\"h23\\\" | \\\"h24\\\";\\n        fractionalSecondDigits?: 0 | 1 | 2 | 3;\\n    }\\n}\\n\";\r\nlibFileMap['lib.es2020.promise.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface PromiseFulfilledResult<T> {\\n    status: \\\"fulfilled\\\";\\n    value: T;\\n}\\n\\ninterface PromiseRejectedResult {\\n    status: \\\"rejected\\\";\\n    reason: any;\\n}\\n\\ntype PromiseSettledResult<T> = PromiseFulfilledResult<T> | PromiseRejectedResult;\\n\\ninterface PromiseConstructor {\\n    /**\\n     * Creates a Promise that is resolved with an array of results when all\\n     * of the provided Promises resolve or reject.\\n     * @param values An array of Promises.\\n     * @returns A new Promise.\\n     */\\n    allSettled<T extends readonly unknown[] | readonly [unknown]>(values: T):\\n        Promise<{ -readonly [P in keyof T]: PromiseSettledResult<T[P] extends PromiseLike<infer U> ? U : T[P]> }>;\\n\\n    /**\\n     * Creates a Promise that is resolved with an array of results when all\\n     * of the provided Promises resolve or reject.\\n     * @param values An array of Promises.\\n     * @returns A new Promise.\\n     */\\n    allSettled<T>(values: Iterable<T>): Promise<PromiseSettledResult<T extends PromiseLike<infer U> ? U : T>[]>;\\n}\\n\";\r\nlibFileMap['lib.es2020.sharedmemory.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface Atomics {\\n    /**\\n     * Adds a value to the value at the given position in the array, returning the original value.\\n     * Until this atomic operation completes, any other read or write operation against the array\\n     * will block.\\n     */\\n    add(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;\\n\\n    /**\\n     * Stores the bitwise AND of a value with the value at the given position in the array,\\n     * returning the original value. Until this atomic operation completes, any other read or\\n     * write operation against the array will block.\\n     */\\n    and(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;\\n\\n    /**\\n     * Replaces the value at the given position in the array if the original value equals the given\\n     * expected value, returning the original value. Until this atomic operation completes, any\\n     * other read or write operation against the array will block.\\n     */\\n    compareExchange(typedArray: BigInt64Array | BigUint64Array, index: number, expectedValue: bigint, replacementValue: bigint): bigint;\\n\\n    /**\\n     * Replaces the value at the given position in the array, returning the original value. Until\\n     * this atomic operation completes, any other read or write operation against the array will\\n     * block.\\n     */\\n    exchange(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;\\n\\n    /**\\n     * Returns the value at the given position in the array. Until this atomic operation completes,\\n     * any other read or write operation against the array will block.\\n     */\\n    load(typedArray: BigInt64Array | BigUint64Array, index: number): bigint;\\n\\n    /**\\n     * Stores the bitwise OR of a value with the value at the given position in the array,\\n     * returning the original value. Until this atomic operation completes, any other read or write\\n     * operation against the array will block.\\n     */\\n    or(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;\\n\\n    /**\\n     * Stores a value at the given position in the array, returning the new value. Until this\\n     * atomic operation completes, any other read or write operation against the array will block.\\n     */\\n    store(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;\\n\\n    /**\\n     * Subtracts a value from the value at the given position in the array, returning the original\\n     * value. Until this atomic operation completes, any other read or write operation against the\\n     * array will block.\\n     */\\n    sub(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;\\n\\n    /**\\n     * If the value at the given position in the array is equal to the provided value, the current\\n     * agent is put to sleep causing execution to suspend until the timeout expires (returning\\n     * `\\\"timed-out\\\"`) or until the agent is awoken (returning `\\\"ok\\\"`); otherwise, returns\\n     * `\\\"not-equal\\\"`.\\n     */\\n    wait(typedArray: BigInt64Array, index: number, value: bigint, timeout?: number): \\\"ok\\\" | \\\"not-equal\\\" | \\\"timed-out\\\";\\n\\n    /**\\n     * Wakes up sleeping agents that are waiting on the given index of the array, returning the\\n     * number of agents that were awoken.\\n     * @param typedArray A shared BigInt64Array.\\n     * @param index The position in the typedArray to wake up on.\\n     * @param count The number of sleeping agents to notify. Defaults to +Infinity.\\n     */\\n    notify(typedArray: BigInt64Array, index: number, count?: number): number;\\n\\n    /**\\n     * Stores the bitwise XOR of a value with the value at the given position in the array,\\n     * returning the original value. Until this atomic operation completes, any other read or write\\n     * operation against the array will block.\\n     */\\n    xor(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;\\n}\\n\";\r\nlibFileMap['lib.es2020.string.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2015.iterable\\\" />\\n\\ninterface String {\\n    /**\\n     * Matches a string with a regular expression, and returns an iterable of matches\\n     * containing the results of that search.\\n     * @param regexp A variable name or string literal containing the regular expression pattern and flags.\\n     */\\n    matchAll(regexp: RegExp): IterableIterator<RegExpMatchArray>;\\n}\\n\";\r\nlibFileMap['lib.es2020.symbol.wellknown.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2015.iterable\\\" />\\n/// <reference lib=\\\"es2015.symbol\\\" />\\n\\ninterface SymbolConstructor {\\n    /**\\n     * A regular expression method that matches the regular expression against a string. Called\\n     * by the String.prototype.matchAll method.\\n     */\\n    readonly matchAll: symbol;\\n}\\n\\ninterface RegExp {\\n    /**\\n     * Matches a string with this regular expression, and returns an iterable of matches\\n     * containing the results of that search.\\n     * @param string A string to search within.\\n     */\\n    [Symbol.matchAll](str: string): IterableIterator<RegExpMatchArray>;\\n}\\n\";\r\nlibFileMap['lib.es5.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/////////////////////////////\\n/// ECMAScript APIs\\n/////////////////////////////\\n\\ndeclare var NaN: number;\\ndeclare var Infinity: number;\\n\\n/**\\n * Evaluates JavaScript code and executes it.\\n * @param x A String value that contains valid JavaScript code.\\n */\\ndeclare function eval(x: string): any;\\n\\n/**\\n * Converts a string to an integer.\\n * @param s A string to convert into a number.\\n * @param radix A value between 2 and 36 that specifies the base of the number in numString.\\n * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\\n * All other strings are considered decimal.\\n */\\ndeclare function parseInt(s: string, radix?: number): number;\\n\\n/**\\n * Converts a string to a floating-point number.\\n * @param string A string that contains a floating-point number.\\n */\\ndeclare function parseFloat(string: string): number;\\n\\n/**\\n * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).\\n * @param number A numeric value.\\n */\\ndeclare function isNaN(number: number): boolean;\\n\\n/**\\n * Determines whether a supplied number is finite.\\n * @param number Any numeric value.\\n */\\ndeclare function isFinite(number: number): boolean;\\n\\n/**\\n * Gets the unencoded version of an encoded Uniform Resource Identifier (URI).\\n * @param encodedURI A value representing an encoded URI.\\n */\\ndeclare function decodeURI(encodedURI: string): string;\\n\\n/**\\n * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).\\n * @param encodedURIComponent A value representing an encoded URI component.\\n */\\ndeclare function decodeURIComponent(encodedURIComponent: string): string;\\n\\n/**\\n * Encodes a text string as a valid Uniform Resource Identifier (URI)\\n * @param uri A value representing an encoded URI.\\n */\\ndeclare function encodeURI(uri: string): string;\\n\\n/**\\n * Encodes a text string as a valid component of a Uniform Resource Identifier (URI).\\n * @param uriComponent A value representing an encoded URI component.\\n */\\ndeclare function encodeURIComponent(uriComponent: string | number | boolean): string;\\n\\n/**\\n * Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.\\n * @param string A string value\\n */\\ndeclare function escape(string: string): string;\\n\\n/**\\n * Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.\\n * @param string A string value\\n */\\ndeclare function unescape(string: string): string;\\n\\ninterface Symbol {\\n    /** Returns a string representation of an object. */\\n    toString(): string;\\n\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): symbol;\\n}\\n\\ndeclare type PropertyKey = string | number | symbol;\\n\\ninterface PropertyDescriptor {\\n    configurable?: boolean;\\n    enumerable?: boolean;\\n    value?: any;\\n    writable?: boolean;\\n    get?(): any;\\n    set?(v: any): void;\\n}\\n\\ninterface PropertyDescriptorMap {\\n    [s: string]: PropertyDescriptor;\\n}\\n\\ninterface Object {\\n    /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */\\n    constructor: Function;\\n\\n    /** Returns a string representation of an object. */\\n    toString(): string;\\n\\n    /** Returns a date converted to a string using the current locale. */\\n    toLocaleString(): string;\\n\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): Object;\\n\\n    /**\\n     * Determines whether an object has a property with the specified name.\\n     * @param v A property name.\\n     */\\n    hasOwnProperty(v: PropertyKey): boolean;\\n\\n    /**\\n     * Determines whether an object exists in another object's prototype chain.\\n     * @param v Another object whose prototype chain is to be checked.\\n     */\\n    isPrototypeOf(v: Object): boolean;\\n\\n    /**\\n     * Determines whether a specified property is enumerable.\\n     * @param v A property name.\\n     */\\n    propertyIsEnumerable(v: PropertyKey): boolean;\\n}\\n\\ninterface ObjectConstructor {\\n    new(value?: any): Object;\\n    (): any;\\n    (value: any): any;\\n\\n    /** A reference to the prototype for a class of objects. */\\n    readonly prototype: Object;\\n\\n    /**\\n     * Returns the prototype of an object.\\n     * @param o The object that references the prototype.\\n     */\\n    getPrototypeOf(o: any): any;\\n\\n    /**\\n     * Gets the own property descriptor of the specified object.\\n     * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.\\n     * @param o Object that contains the property.\\n     * @param p Name of the property.\\n     */\\n    getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;\\n\\n    /**\\n     * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly\\n     * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.\\n     * @param o Object that contains the own properties.\\n     */\\n    getOwnPropertyNames(o: any): string[];\\n\\n    /**\\n     * Creates an object that has the specified prototype or that has null prototype.\\n     * @param o Object to use as a prototype. May be null.\\n     */\\n    create(o: object | null): any;\\n\\n    /**\\n     * Creates an object that has the specified prototype, and that optionally contains specified properties.\\n     * @param o Object to use as a prototype. May be null\\n     * @param properties JavaScript object that contains one or more property descriptors.\\n     */\\n    create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;\\n\\n    /**\\n     * Adds a property to an object, or modifies attributes of an existing property.\\n     * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.\\n     * @param p The property name.\\n     * @param attributes Descriptor for the property. It can be for a data property or an accessor property.\\n     */\\n    defineProperty(o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): any;\\n\\n    /**\\n     * Adds one or more properties to an object, and/or modifies attributes of existing properties.\\n     * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.\\n     * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.\\n     */\\n    defineProperties(o: any, properties: PropertyDescriptorMap & ThisType<any>): any;\\n\\n    /**\\n     * Prevents the modification of attributes of existing properties, and prevents the addition of new properties.\\n     * @param o Object on which to lock the attributes.\\n     */\\n    seal<T>(o: T): T;\\n\\n    /**\\n     * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\\n     * @param o Object on which to lock the attributes.\\n     */\\n    freeze<T>(a: T[]): readonly T[];\\n\\n    /**\\n     * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\\n     * @param o Object on which to lock the attributes.\\n     */\\n    freeze<T extends Function>(f: T): T;\\n\\n    /**\\n     * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\\n     * @param o Object on which to lock the attributes.\\n     */\\n    freeze<T>(o: T): Readonly<T>;\\n\\n    /**\\n     * Prevents the addition of new properties to an object.\\n     * @param o Object to make non-extensible.\\n     */\\n    preventExtensions<T>(o: T): T;\\n\\n    /**\\n     * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.\\n     * @param o Object to test.\\n     */\\n    isSealed(o: any): boolean;\\n\\n    /**\\n     * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.\\n     * @param o Object to test.\\n     */\\n    isFrozen(o: any): boolean;\\n\\n    /**\\n     * Returns a value that indicates whether new properties can be added to an object.\\n     * @param o Object to test.\\n     */\\n    isExtensible(o: any): boolean;\\n\\n    /**\\n     * Returns the names of the enumerable string properties and methods of an object.\\n     * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\\n     */\\n    keys(o: object): string[];\\n}\\n\\n/**\\n * Provides functionality common to all JavaScript objects.\\n */\\ndeclare var Object: ObjectConstructor;\\n\\n/**\\n * Creates a new function.\\n */\\ninterface Function {\\n    /**\\n     * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.\\n     * @param thisArg The object to be used as the this object.\\n     * @param argArray A set of arguments to be passed to the function.\\n     */\\n    apply(this: Function, thisArg: any, argArray?: any): any;\\n\\n    /**\\n     * Calls a method of an object, substituting another object for the current object.\\n     * @param thisArg The object to be used as the current object.\\n     * @param argArray A list of arguments to be passed to the method.\\n     */\\n    call(this: Function, thisArg: any, ...argArray: any[]): any;\\n\\n    /**\\n     * For a given function, creates a bound function that has the same body as the original function.\\n     * The this object of the bound function is associated with the specified object, and has the specified initial parameters.\\n     * @param thisArg An object to which the this keyword can refer inside the new function.\\n     * @param argArray A list of arguments to be passed to the new function.\\n     */\\n    bind(this: Function, thisArg: any, ...argArray: any[]): any;\\n\\n    /** Returns a string representation of a function. */\\n    toString(): string;\\n\\n    prototype: any;\\n    readonly length: number;\\n\\n    // Non-standard extensions\\n    arguments: any;\\n    caller: Function;\\n}\\n\\ninterface FunctionConstructor {\\n    /**\\n     * Creates a new function.\\n     * @param args A list of arguments the function accepts.\\n     */\\n    new(...args: string[]): Function;\\n    (...args: string[]): Function;\\n    readonly prototype: Function;\\n}\\n\\ndeclare var Function: FunctionConstructor;\\n\\n/**\\n * Extracts the type of the 'this' parameter of a function type, or 'unknown' if the function type has no 'this' parameter.\\n */\\ntype ThisParameterType<T> = T extends (this: infer U, ...args: any[]) => any ? U : unknown;\\n\\n/**\\n * Removes the 'this' parameter from a function type.\\n */\\ntype OmitThisParameter<T> = unknown extends ThisParameterType<T> ? T : T extends (...args: infer A) => infer R ? (...args: A) => R : T;\\n\\ninterface CallableFunction extends Function {\\n    /**\\n     * Calls the function with the specified object as the this value and the elements of specified array as the arguments.\\n     * @param thisArg The object to be used as the this object.\\n     * @param args An array of argument values to be passed to the function.\\n     */\\n    apply<T, R>(this: (this: T) => R, thisArg: T): R;\\n    apply<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, args: A): R;\\n\\n    /**\\n     * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.\\n     * @param thisArg The object to be used as the this object.\\n     * @param args Argument values to be passed to the function.\\n     */\\n    call<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, ...args: A): R;\\n\\n    /**\\n     * For a given function, creates a bound function that has the same body as the original function.\\n     * The this object of the bound function is associated with the specified object, and has the specified initial parameters.\\n     * @param thisArg The object to be used as the this object.\\n     * @param args Arguments to bind to the parameters of the function.\\n     */\\n    bind<T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>;\\n    bind<T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R;\\n    bind<T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R;\\n    bind<T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R;\\n    bind<T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R;\\n    bind<T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R;\\n}\\n\\ninterface NewableFunction extends Function {\\n    /**\\n     * Calls the function with the specified object as the this value and the elements of specified array as the arguments.\\n     * @param thisArg The object to be used as the this object.\\n     * @param args An array of argument values to be passed to the function.\\n     */\\n    apply<T>(this: new () => T, thisArg: T): void;\\n    apply<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, args: A): void;\\n\\n    /**\\n     * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.\\n     * @param thisArg The object to be used as the this object.\\n     * @param args Argument values to be passed to the function.\\n     */\\n    call<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, ...args: A): void;\\n\\n    /**\\n     * For a given function, creates a bound function that has the same body as the original function.\\n     * The this object of the bound function is associated with the specified object, and has the specified initial parameters.\\n     * @param thisArg The object to be used as the this object.\\n     * @param args Arguments to bind to the parameters of the function.\\n     */\\n    bind<T>(this: T, thisArg: any): T;\\n    bind<A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R;\\n    bind<A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R;\\n    bind<A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R;\\n    bind<A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R;\\n    bind<AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R;\\n}\\n\\ninterface IArguments {\\n    [index: number]: any;\\n    length: number;\\n    callee: Function;\\n}\\n\\ninterface String {\\n    /** Returns a string representation of a string. */\\n    toString(): string;\\n\\n    /**\\n     * Returns the character at the specified index.\\n     * @param pos The zero-based index of the desired character.\\n     */\\n    charAt(pos: number): string;\\n\\n    /**\\n     * Returns the Unicode value of the character at the specified location.\\n     * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.\\n     */\\n    charCodeAt(index: number): number;\\n\\n    /**\\n     * Returns a string that contains the concatenation of two or more strings.\\n     * @param strings The strings to append to the end of the string.\\n     */\\n    concat(...strings: string[]): string;\\n\\n    /**\\n     * Returns the position of the first occurrence of a substring.\\n     * @param searchString The substring to search for in the string\\n     * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.\\n     */\\n    indexOf(searchString: string, position?: number): number;\\n\\n    /**\\n     * Returns the last occurrence of a substring in the string.\\n     * @param searchString The substring to search for.\\n     * @param position The index at which to begin searching. If omitted, the search begins at the end of the string.\\n     */\\n    lastIndexOf(searchString: string, position?: number): number;\\n\\n    /**\\n     * Determines whether two strings are equivalent in the current locale.\\n     * @param that String to compare to target string\\n     */\\n    localeCompare(that: string): number;\\n\\n    /**\\n     * Matches a string with a regular expression, and returns an array containing the results of that search.\\n     * @param regexp A variable name or string literal containing the regular expression pattern and flags.\\n     */\\n    match(regexp: string | RegExp): RegExpMatchArray | null;\\n\\n    /**\\n     * Replaces text in a string, using a regular expression or search string.\\n     * @param searchValue A string to search for.\\n     * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\\n     */\\n    replace(searchValue: string | RegExp, replaceValue: string): string;\\n\\n    /**\\n     * Replaces text in a string, using a regular expression or search string.\\n     * @param searchValue A string to search for.\\n     * @param replacer A function that returns the replacement text.\\n     */\\n    replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;\\n\\n    /**\\n     * Finds the first substring match in a regular expression search.\\n     * @param regexp The regular expression pattern and applicable flags.\\n     */\\n    search(regexp: string | RegExp): number;\\n\\n    /**\\n     * Returns a section of a string.\\n     * @param start The index to the beginning of the specified portion of stringObj.\\n     * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.\\n     * If this value is not specified, the substring continues to the end of stringObj.\\n     */\\n    slice(start?: number, end?: number): string;\\n\\n    /**\\n     * Split a string into substrings using the specified separator and return them as an array.\\n     * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.\\n     * @param limit A value used to limit the number of elements returned in the array.\\n     */\\n    split(separator: string | RegExp, limit?: number): string[];\\n\\n    /**\\n     * Returns the substring at the specified location within a String object.\\n     * @param start The zero-based index number indicating the beginning of the substring.\\n     * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\\n     * If end is omitted, the characters from start through the end of the original string are returned.\\n     */\\n    substring(start: number, end?: number): string;\\n\\n    /** Converts all the alphabetic characters in a string to lowercase. */\\n    toLowerCase(): string;\\n\\n    /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */\\n    toLocaleLowerCase(locales?: string | string[]): string;\\n\\n    /** Converts all the alphabetic characters in a string to uppercase. */\\n    toUpperCase(): string;\\n\\n    /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */\\n    toLocaleUpperCase(locales?: string | string[]): string;\\n\\n    /** Removes the leading and trailing white space and line terminator characters from a string. */\\n    trim(): string;\\n\\n    /** Returns the length of a String object. */\\n    readonly length: number;\\n\\n    // IE extensions\\n    /**\\n     * Gets a substring beginning at the specified location and having the specified length.\\n     * @param from The starting position of the desired substring. The index of the first character in the string is zero.\\n     * @param length The number of characters to include in the returned substring.\\n     */\\n    substr(from: number, length?: number): string;\\n\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): string;\\n\\n    readonly [index: number]: string;\\n}\\n\\ninterface StringConstructor {\\n    new(value?: any): String;\\n    (value?: any): string;\\n    readonly prototype: String;\\n    fromCharCode(...codes: number[]): string;\\n}\\n\\n/**\\n * Allows manipulation and formatting of text strings and determination and location of substrings within strings.\\n */\\ndeclare var String: StringConstructor;\\n\\ninterface Boolean {\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): boolean;\\n}\\n\\ninterface BooleanConstructor {\\n    new(value?: any): Boolean;\\n    <T>(value?: T): boolean;\\n    readonly prototype: Boolean;\\n}\\n\\ndeclare var Boolean: BooleanConstructor;\\n\\ninterface Number {\\n    /**\\n     * Returns a string representation of an object.\\n     * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.\\n     */\\n    toString(radix?: number): string;\\n\\n    /**\\n     * Returns a string representing a number in fixed-point notation.\\n     * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\\n     */\\n    toFixed(fractionDigits?: number): string;\\n\\n    /**\\n     * Returns a string containing a number represented in exponential notation.\\n     * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\\n     */\\n    toExponential(fractionDigits?: number): string;\\n\\n    /**\\n     * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.\\n     * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.\\n     */\\n    toPrecision(precision?: number): string;\\n\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): number;\\n}\\n\\ninterface NumberConstructor {\\n    new(value?: any): Number;\\n    (value?: any): number;\\n    readonly prototype: Number;\\n\\n    /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */\\n    readonly MAX_VALUE: number;\\n\\n    /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */\\n    readonly MIN_VALUE: number;\\n\\n    /**\\n     * A value that is not a number.\\n     * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.\\n     */\\n    readonly NaN: number;\\n\\n    /**\\n     * A value that is less than the largest negative number that can be represented in JavaScript.\\n     * JavaScript displays NEGATIVE_INFINITY values as -infinity.\\n     */\\n    readonly NEGATIVE_INFINITY: number;\\n\\n    /**\\n     * A value greater than the largest number that can be represented in JavaScript.\\n     * JavaScript displays POSITIVE_INFINITY values as infinity.\\n     */\\n    readonly POSITIVE_INFINITY: number;\\n}\\n\\n/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */\\ndeclare var Number: NumberConstructor;\\n\\ninterface TemplateStringsArray extends ReadonlyArray<string> {\\n    readonly raw: readonly string[];\\n}\\n\\n/**\\n * The type of `import.meta`.\\n *\\n * If you need to declare that a given property exists on `import.meta`,\\n * this type may be augmented via interface merging.\\n */\\ninterface ImportMeta {\\n}\\n\\ninterface Math {\\n    /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */\\n    readonly E: number;\\n    /** The natural logarithm of 10. */\\n    readonly LN10: number;\\n    /** The natural logarithm of 2. */\\n    readonly LN2: number;\\n    /** The base-2 logarithm of e. */\\n    readonly LOG2E: number;\\n    /** The base-10 logarithm of e. */\\n    readonly LOG10E: number;\\n    /** Pi. This is the ratio of the circumference of a circle to its diameter. */\\n    readonly PI: number;\\n    /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */\\n    readonly SQRT1_2: number;\\n    /** The square root of 2. */\\n    readonly SQRT2: number;\\n    /**\\n     * Returns the absolute value of a number (the value without regard to whether it is positive or negative).\\n     * For example, the absolute value of -5 is the same as the absolute value of 5.\\n     * @param x A numeric expression for which the absolute value is needed.\\n     */\\n    abs(x: number): number;\\n    /**\\n     * Returns the arc cosine (or inverse cosine) of a number.\\n     * @param x A numeric expression.\\n     */\\n    acos(x: number): number;\\n    /**\\n     * Returns the arcsine of a number.\\n     * @param x A numeric expression.\\n     */\\n    asin(x: number): number;\\n    /**\\n     * Returns the arctangent of a number.\\n     * @param x A numeric expression for which the arctangent is needed.\\n     */\\n    atan(x: number): number;\\n    /**\\n     * Returns the angle (in radians) from the X axis to a point.\\n     * @param y A numeric expression representing the cartesian y-coordinate.\\n     * @param x A numeric expression representing the cartesian x-coordinate.\\n     */\\n    atan2(y: number, x: number): number;\\n    /**\\n     * Returns the smallest integer greater than or equal to its numeric argument.\\n     * @param x A numeric expression.\\n     */\\n    ceil(x: number): number;\\n    /**\\n     * Returns the cosine of a number.\\n     * @param x A numeric expression that contains an angle measured in radians.\\n     */\\n    cos(x: number): number;\\n    /**\\n     * Returns e (the base of natural logarithms) raised to a power.\\n     * @param x A numeric expression representing the power of e.\\n     */\\n    exp(x: number): number;\\n    /**\\n     * Returns the greatest integer less than or equal to its numeric argument.\\n     * @param x A numeric expression.\\n     */\\n    floor(x: number): number;\\n    /**\\n     * Returns the natural logarithm (base e) of a number.\\n     * @param x A numeric expression.\\n     */\\n    log(x: number): number;\\n    /**\\n     * Returns the larger of a set of supplied numeric expressions.\\n     * @param values Numeric expressions to be evaluated.\\n     */\\n    max(...values: number[]): number;\\n    /**\\n     * Returns the smaller of a set of supplied numeric expressions.\\n     * @param values Numeric expressions to be evaluated.\\n     */\\n    min(...values: number[]): number;\\n    /**\\n     * Returns the value of a base expression taken to a specified power.\\n     * @param x The base value of the expression.\\n     * @param y The exponent value of the expression.\\n     */\\n    pow(x: number, y: number): number;\\n    /** Returns a pseudorandom number between 0 and 1. */\\n    random(): number;\\n    /**\\n     * Returns a supplied numeric expression rounded to the nearest integer.\\n     * @param x The value to be rounded to the nearest integer.\\n     */\\n    round(x: number): number;\\n    /**\\n     * Returns the sine of a number.\\n     * @param x A numeric expression that contains an angle measured in radians.\\n     */\\n    sin(x: number): number;\\n    /**\\n     * Returns the square root of a number.\\n     * @param x A numeric expression.\\n     */\\n    sqrt(x: number): number;\\n    /**\\n     * Returns the tangent of a number.\\n     * @param x A numeric expression that contains an angle measured in radians.\\n     */\\n    tan(x: number): number;\\n}\\n/** An intrinsic object that provides basic mathematics functionality and constants. */\\ndeclare var Math: Math;\\n\\n/** Enables basic storage and retrieval of dates and times. */\\ninterface Date {\\n    /** Returns a string representation of a date. The format of the string depends on the locale. */\\n    toString(): string;\\n    /** Returns a date as a string value. */\\n    toDateString(): string;\\n    /** Returns a time as a string value. */\\n    toTimeString(): string;\\n    /** Returns a value as a string value appropriate to the host environment's current locale. */\\n    toLocaleString(): string;\\n    /** Returns a date as a string value appropriate to the host environment's current locale. */\\n    toLocaleDateString(): string;\\n    /** Returns a time as a string value appropriate to the host environment's current locale. */\\n    toLocaleTimeString(): string;\\n    /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */\\n    valueOf(): number;\\n    /** Gets the time value in milliseconds. */\\n    getTime(): number;\\n    /** Gets the year, using local time. */\\n    getFullYear(): number;\\n    /** Gets the year using Universal Coordinated Time (UTC). */\\n    getUTCFullYear(): number;\\n    /** Gets the month, using local time. */\\n    getMonth(): number;\\n    /** Gets the month of a Date object using Universal Coordinated Time (UTC). */\\n    getUTCMonth(): number;\\n    /** Gets the day-of-the-month, using local time. */\\n    getDate(): number;\\n    /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */\\n    getUTCDate(): number;\\n    /** Gets the day of the week, using local time. */\\n    getDay(): number;\\n    /** Gets the day of the week using Universal Coordinated Time (UTC). */\\n    getUTCDay(): number;\\n    /** Gets the hours in a date, using local time. */\\n    getHours(): number;\\n    /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */\\n    getUTCHours(): number;\\n    /** Gets the minutes of a Date object, using local time. */\\n    getMinutes(): number;\\n    /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */\\n    getUTCMinutes(): number;\\n    /** Gets the seconds of a Date object, using local time. */\\n    getSeconds(): number;\\n    /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */\\n    getUTCSeconds(): number;\\n    /** Gets the milliseconds of a Date, using local time. */\\n    getMilliseconds(): number;\\n    /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */\\n    getUTCMilliseconds(): number;\\n    /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */\\n    getTimezoneOffset(): number;\\n    /**\\n     * Sets the date and time value in the Date object.\\n     * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.\\n     */\\n    setTime(time: number): number;\\n    /**\\n     * Sets the milliseconds value in the Date object using local time.\\n     * @param ms A numeric value equal to the millisecond value.\\n     */\\n    setMilliseconds(ms: number): number;\\n    /**\\n     * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).\\n     * @param ms A numeric value equal to the millisecond value.\\n     */\\n    setUTCMilliseconds(ms: number): number;\\n\\n    /**\\n     * Sets the seconds value in the Date object using local time.\\n     * @param sec A numeric value equal to the seconds value.\\n     * @param ms A numeric value equal to the milliseconds value.\\n     */\\n    setSeconds(sec: number, ms?: number): number;\\n    /**\\n     * Sets the seconds value in the Date object using Universal Coordinated Time (UTC).\\n     * @param sec A numeric value equal to the seconds value.\\n     * @param ms A numeric value equal to the milliseconds value.\\n     */\\n    setUTCSeconds(sec: number, ms?: number): number;\\n    /**\\n     * Sets the minutes value in the Date object using local time.\\n     * @param min A numeric value equal to the minutes value.\\n     * @param sec A numeric value equal to the seconds value.\\n     * @param ms A numeric value equal to the milliseconds value.\\n     */\\n    setMinutes(min: number, sec?: number, ms?: number): number;\\n    /**\\n     * Sets the minutes value in the Date object using Universal Coordinated Time (UTC).\\n     * @param min A numeric value equal to the minutes value.\\n     * @param sec A numeric value equal to the seconds value.\\n     * @param ms A numeric value equal to the milliseconds value.\\n     */\\n    setUTCMinutes(min: number, sec?: number, ms?: number): number;\\n    /**\\n     * Sets the hour value in the Date object using local time.\\n     * @param hours A numeric value equal to the hours value.\\n     * @param min A numeric value equal to the minutes value.\\n     * @param sec A numeric value equal to the seconds value.\\n     * @param ms A numeric value equal to the milliseconds value.\\n     */\\n    setHours(hours: number, min?: number, sec?: number, ms?: number): number;\\n    /**\\n     * Sets the hours value in the Date object using Universal Coordinated Time (UTC).\\n     * @param hours A numeric value equal to the hours value.\\n     * @param min A numeric value equal to the minutes value.\\n     * @param sec A numeric value equal to the seconds value.\\n     * @param ms A numeric value equal to the milliseconds value.\\n     */\\n    setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;\\n    /**\\n     * Sets the numeric day-of-the-month value of the Date object using local time.\\n     * @param date A numeric value equal to the day of the month.\\n     */\\n    setDate(date: number): number;\\n    /**\\n     * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).\\n     * @param date A numeric value equal to the day of the month.\\n     */\\n    setUTCDate(date: number): number;\\n    /**\\n     * Sets the month value in the Date object using local time.\\n     * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.\\n     * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.\\n     */\\n    setMonth(month: number, date?: number): number;\\n    /**\\n     * Sets the month value in the Date object using Universal Coordinated Time (UTC).\\n     * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.\\n     * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.\\n     */\\n    setUTCMonth(month: number, date?: number): number;\\n    /**\\n     * Sets the year of the Date object using local time.\\n     * @param year A numeric value for the year.\\n     * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.\\n     * @param date A numeric value equal for the day of the month.\\n     */\\n    setFullYear(year: number, month?: number, date?: number): number;\\n    /**\\n     * Sets the year value in the Date object using Universal Coordinated Time (UTC).\\n     * @param year A numeric value equal to the year.\\n     * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.\\n     * @param date A numeric value equal to the day of the month.\\n     */\\n    setUTCFullYear(year: number, month?: number, date?: number): number;\\n    /** Returns a date converted to a string using Universal Coordinated Time (UTC). */\\n    toUTCString(): string;\\n    /** Returns a date as a string value in ISO format. */\\n    toISOString(): string;\\n    /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */\\n    toJSON(key?: any): string;\\n}\\n\\ninterface DateConstructor {\\n    new(): Date;\\n    new(value: number | string): Date;\\n    new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;\\n    (): string;\\n    readonly prototype: Date;\\n    /**\\n     * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.\\n     * @param s A date string\\n     */\\n    parse(s: string): number;\\n    /**\\n     * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.\\n     * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.\\n     * @param month The month as a number between 0 and 11 (January to December).\\n     * @param date The date as a number between 1 and 31.\\n     * @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.\\n     * @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.\\n     * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.\\n     * @param ms A number from 0 to 999 that specifies the milliseconds.\\n     */\\n    UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;\\n    now(): number;\\n}\\n\\ndeclare var Date: DateConstructor;\\n\\ninterface RegExpMatchArray extends Array<string> {\\n    index?: number;\\n    input?: string;\\n}\\n\\ninterface RegExpExecArray extends Array<string> {\\n    index: number;\\n    input: string;\\n}\\n\\ninterface RegExp {\\n    /**\\n     * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.\\n     * @param string The String object or string literal on which to perform the search.\\n     */\\n    exec(string: string): RegExpExecArray | null;\\n\\n    /**\\n     * Returns a Boolean value that indicates whether or not a pattern exists in a searched string.\\n     * @param string String on which to perform the search.\\n     */\\n    test(string: string): boolean;\\n\\n    /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */\\n    readonly source: string;\\n\\n    /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */\\n    readonly global: boolean;\\n\\n    /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */\\n    readonly ignoreCase: boolean;\\n\\n    /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */\\n    readonly multiline: boolean;\\n\\n    lastIndex: number;\\n\\n    // Non-standard extensions\\n    compile(): this;\\n}\\n\\ninterface RegExpConstructor {\\n    new(pattern: RegExp | string): RegExp;\\n    new(pattern: string, flags?: string): RegExp;\\n    (pattern: RegExp | string): RegExp;\\n    (pattern: string, flags?: string): RegExp;\\n    readonly prototype: RegExp;\\n\\n    // Non-standard extensions\\n    $1: string;\\n    $2: string;\\n    $3: string;\\n    $4: string;\\n    $5: string;\\n    $6: string;\\n    $7: string;\\n    $8: string;\\n    $9: string;\\n    lastMatch: string;\\n}\\n\\ndeclare var RegExp: RegExpConstructor;\\n\\ninterface Error {\\n    name: string;\\n    message: string;\\n    stack?: string;\\n}\\n\\ninterface ErrorConstructor {\\n    new(message?: string): Error;\\n    (message?: string): Error;\\n    readonly prototype: Error;\\n}\\n\\ndeclare var Error: ErrorConstructor;\\n\\ninterface EvalError extends Error {\\n}\\n\\ninterface EvalErrorConstructor extends ErrorConstructor {\\n    new(message?: string): EvalError;\\n    (message?: string): EvalError;\\n    readonly prototype: EvalError;\\n}\\n\\ndeclare var EvalError: EvalErrorConstructor;\\n\\ninterface RangeError extends Error {\\n}\\n\\ninterface RangeErrorConstructor extends ErrorConstructor {\\n    new(message?: string): RangeError;\\n    (message?: string): RangeError;\\n    readonly prototype: RangeError;\\n}\\n\\ndeclare var RangeError: RangeErrorConstructor;\\n\\ninterface ReferenceError extends Error {\\n}\\n\\ninterface ReferenceErrorConstructor extends ErrorConstructor {\\n    new(message?: string): ReferenceError;\\n    (message?: string): ReferenceError;\\n    readonly prototype: ReferenceError;\\n}\\n\\ndeclare var ReferenceError: ReferenceErrorConstructor;\\n\\ninterface SyntaxError extends Error {\\n}\\n\\ninterface SyntaxErrorConstructor extends ErrorConstructor {\\n    new(message?: string): SyntaxError;\\n    (message?: string): SyntaxError;\\n    readonly prototype: SyntaxError;\\n}\\n\\ndeclare var SyntaxError: SyntaxErrorConstructor;\\n\\ninterface TypeError extends Error {\\n}\\n\\ninterface TypeErrorConstructor extends ErrorConstructor {\\n    new(message?: string): TypeError;\\n    (message?: string): TypeError;\\n    readonly prototype: TypeError;\\n}\\n\\ndeclare var TypeError: TypeErrorConstructor;\\n\\ninterface URIError extends Error {\\n}\\n\\ninterface URIErrorConstructor extends ErrorConstructor {\\n    new(message?: string): URIError;\\n    (message?: string): URIError;\\n    readonly prototype: URIError;\\n}\\n\\ndeclare var URIError: URIErrorConstructor;\\n\\ninterface JSON {\\n    /**\\n     * Converts a JavaScript Object Notation (JSON) string into an object.\\n     * @param text A valid JSON string.\\n     * @param reviver A function that transforms the results. This function is called for each member of the object.\\n     * If a member contains nested objects, the nested objects are transformed before the parent object is.\\n     */\\n    parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;\\n    /**\\n     * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\\n     * @param value A JavaScript value, usually an object or array, to be converted.\\n     * @param replacer A function that transforms the results.\\n     * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\\n     */\\n    stringify(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;\\n    /**\\n     * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\\n     * @param value A JavaScript value, usually an object or array, to be converted.\\n     * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.\\n     * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\\n     */\\n    stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;\\n}\\n\\n/**\\n * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.\\n */\\ndeclare var JSON: JSON;\\n\\n\\n/////////////////////////////\\n/// ECMAScript Array API (specially handled by compiler)\\n/////////////////////////////\\n\\ninterface ReadonlyArray<T> {\\n    /**\\n     * Gets the length of the array. This is a number one higher than the highest element defined in an array.\\n     */\\n    readonly length: number;\\n    /**\\n     * Returns a string representation of an array.\\n     */\\n    toString(): string;\\n    /**\\n     * Returns a string representation of an array. The elements are converted to string using their toLocalString methods.\\n     */\\n    toLocaleString(): string;\\n    /**\\n     * Combines two or more arrays.\\n     * @param items Additional items to add to the end of array1.\\n     */\\n    concat(...items: ConcatArray<T>[]): T[];\\n    /**\\n     * Combines two or more arrays.\\n     * @param items Additional items to add to the end of array1.\\n     */\\n    concat(...items: (T | ConcatArray<T>)[]): T[];\\n    /**\\n     * Adds all the elements of an array separated by the specified separator string.\\n     * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.\\n     */\\n    join(separator?: string): string;\\n    /**\\n     * Returns a section of an array.\\n     * @param start The beginning of the specified portion of the array.\\n     * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\\n     */\\n    slice(start?: number, end?: number): T[];\\n    /**\\n     * Returns the index of the first occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\\n     */\\n    indexOf(searchElement: T, fromIndex?: number): number;\\n    /**\\n     * Returns the index of the last occurrence of a specified value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.\\n     */\\n    lastIndexOf(searchElement: T, fromIndex?: number): number;\\n    /**\\n     * Determines whether all the members of an array satisfy the specified test.\\n     * @param predicate A function that accepts up to three arguments. The every method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value false, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    every<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): this is readonly S[];\\n    /**\\n     * Determines whether all the members of an array satisfy the specified test.\\n     * @param predicate A function that accepts up to three arguments. The every method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value false, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    every(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;\\n    /**\\n     * Determines whether the specified callback function returns true for any element of an array.\\n     * @param predicate A function that accepts up to three arguments. The some method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value true, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    some(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;\\n    /**\\n     * Performs the specified action for each element in an array.\\n     * @param callbackfn  A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\\n     * @param thisArg  An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\\n     */\\n    forEach(callbackfn: (value: T, index: number, array: readonly T[]) => void, thisArg?: any): void;\\n    /**\\n     * Calls a defined callback function on each element of an array, and returns an array that contains the results.\\n     * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\\n     */\\n    map<U>(callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any): U[];\\n    /**\\n     * Returns the elements of an array that meet the condition specified in a callback function.\\n     * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.\\n     */\\n    filter<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): S[];\\n    /**\\n     * Returns the elements of an array that meet the condition specified in a callback function.\\n     * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.\\n     */\\n    filter(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T[];\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\\n     */\\n    reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T;\\n    reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\\n     */\\n    reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U;\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\\n     */\\n    reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T;\\n    reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\\n     */\\n    reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U;\\n\\n    readonly [n: number]: T;\\n}\\n\\ninterface ConcatArray<T> {\\n    readonly length: number;\\n    readonly [n: number]: T;\\n    join(separator?: string): string;\\n    slice(start?: number, end?: number): T[];\\n}\\n\\ninterface Array<T> {\\n    /**\\n     * Gets or sets the length of the array. This is a number one higher than the highest index in the array.\\n     */\\n    length: number;\\n    /**\\n     * Returns a string representation of an array.\\n     */\\n    toString(): string;\\n    /**\\n     * Returns a string representation of an array. The elements are converted to string using their toLocalString methods.\\n     */\\n    toLocaleString(): string;\\n    /**\\n     * Removes the last element from an array and returns it.\\n     * If the array is empty, undefined is returned and the array is not modified.\\n     */\\n    pop(): T | undefined;\\n    /**\\n     * Appends new elements to the end of an array, and returns the new length of the array.\\n     * @param items New elements to add to the array.\\n     */\\n    push(...items: T[]): number;\\n    /**\\n     * Combines two or more arrays.\\n     * This method returns a new array without modifying any existing arrays.\\n     * @param items Additional arrays and/or items to add to the end of the array.\\n     */\\n    concat(...items: ConcatArray<T>[]): T[];\\n    /**\\n     * Combines two or more arrays.\\n     * This method returns a new array without modifying any existing arrays.\\n     * @param items Additional arrays and/or items to add to the end of the array.\\n     */\\n    concat(...items: (T | ConcatArray<T>)[]): T[];\\n    /**\\n     * Adds all the elements of an array into a string, separated by the specified separator string.\\n     * @param separator A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma.\\n     */\\n    join(separator?: string): string;\\n    /**\\n     * Reverses the elements in an array in place.\\n     * This method mutates the array and returns a reference to the same array.\\n     */\\n    reverse(): T[];\\n    /**\\n     * Removes the first element from an array and returns it.\\n     * If the array is empty, undefined is returned and the array is not modified.\\n     */\\n    shift(): T | undefined;\\n    /**\\n     * Returns a copy of a section of an array.\\n     * For both start and end, a negative index can be used to indicate an offset from the end of the array.\\n     * For example, -2 refers to the second to last element of the array.\\n     * @param start The beginning index of the specified portion of the array.\\n     * If start is undefined, then the slice begins at index 0.\\n     * @param end The end index of the specified portion of the array. This is exclusive of the element at the index 'end'.\\n     * If end is undefined, then the slice extends to the end of the array.\\n     */\\n    slice(start?: number, end?: number): T[];\\n    /**\\n     * Sorts an array in place.\\n     * This method mutates the array and returns a reference to the same array.\\n     * @param compareFn Function used to determine the order of the elements. It is expected to return\\n     * a negative value if first argument is less than second argument, zero if they're equal and a positive\\n     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\\n     * ```ts\\n     * [11,2,22,1].sort((a, b) => a - b)\\n     * ```\\n     */\\n    sort(compareFn?: (a: T, b: T) => number): this;\\n    /**\\n     * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\\n     * @param start The zero-based location in the array from which to start removing elements.\\n     * @param deleteCount The number of elements to remove.\\n     * @returns An array containing the elements that were deleted.\\n     */\\n    splice(start: number, deleteCount?: number): T[];\\n    /**\\n     * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\\n     * @param start The zero-based location in the array from which to start removing elements.\\n     * @param deleteCount The number of elements to remove.\\n     * @param items Elements to insert into the array in place of the deleted elements.\\n     * @returns An array containing the elements that were deleted.\\n     */\\n    splice(start: number, deleteCount: number, ...items: T[]): T[];\\n    /**\\n     * Inserts new elements at the start of an array, and returns the new length of the array.\\n     * @param items Elements to insert at the start of the array.\\n     */\\n    unshift(...items: T[]): number;\\n    /**\\n     * Returns the index of the first occurrence of a value in an array, or -1 if it is not present.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\\n     */\\n    indexOf(searchElement: T, fromIndex?: number): number;\\n    /**\\n     * Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array.\\n     */\\n    lastIndexOf(searchElement: T, fromIndex?: number): number;\\n    /**\\n     * Determines whether all the members of an array satisfy the specified test.\\n     * @param predicate A function that accepts up to three arguments. The every method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value false, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    every<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[];\\n    /**\\n     * Determines whether all the members of an array satisfy the specified test.\\n     * @param predicate A function that accepts up to three arguments. The every method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value false, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    every(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;\\n    /**\\n     * Determines whether the specified callback function returns true for any element of an array.\\n     * @param predicate A function that accepts up to three arguments. The some method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value true, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    some(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;\\n    /**\\n     * Performs the specified action for each element in an array.\\n     * @param callbackfn  A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\\n     * @param thisArg  An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\\n     */\\n    forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;\\n    /**\\n     * Calls a defined callback function on each element of an array, and returns an array that contains the results.\\n     * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\\n     */\\n    map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];\\n    /**\\n     * Returns the elements of an array that meet the condition specified in a callback function.\\n     * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.\\n     */\\n    filter<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];\\n    /**\\n     * Returns the elements of an array that meet the condition specified in a callback function.\\n     * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.\\n     */\\n    filter(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\\n     */\\n    reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;\\n    reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\\n     */\\n    reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\\n     */\\n    reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;\\n    reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\\n     */\\n    reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;\\n\\n    [n: number]: T;\\n}\\n\\ninterface ArrayConstructor {\\n    new(arrayLength?: number): any[];\\n    new <T>(arrayLength: number): T[];\\n    new <T>(...items: T[]): T[];\\n    (arrayLength?: number): any[];\\n    <T>(arrayLength: number): T[];\\n    <T>(...items: T[]): T[];\\n    isArray(arg: any): arg is any[];\\n    readonly prototype: any[];\\n}\\n\\ndeclare var Array: ArrayConstructor;\\n\\ninterface TypedPropertyDescriptor<T> {\\n    enumerable?: boolean;\\n    configurable?: boolean;\\n    writable?: boolean;\\n    value?: T;\\n    get?: () => T;\\n    set?: (value: T) => void;\\n}\\n\\ndeclare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;\\ndeclare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;\\ndeclare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;\\ndeclare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;\\n\\ndeclare type PromiseConstructorLike = new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void) => PromiseLike<T>;\\n\\ninterface PromiseLike<T> {\\n    /**\\n     * Attaches callbacks for the resolution and/or rejection of the Promise.\\n     * @param onfulfilled The callback to execute when the Promise is resolved.\\n     * @param onrejected The callback to execute when the Promise is rejected.\\n     * @returns A Promise for the completion of which ever callback is executed.\\n     */\\n    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;\\n}\\n\\n/**\\n * Represents the completion of an asynchronous operation\\n */\\ninterface Promise<T> {\\n    /**\\n     * Attaches callbacks for the resolution and/or rejection of the Promise.\\n     * @param onfulfilled The callback to execute when the Promise is resolved.\\n     * @param onrejected The callback to execute when the Promise is rejected.\\n     * @returns A Promise for the completion of which ever callback is executed.\\n     */\\n    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;\\n\\n    /**\\n     * Attaches a callback for only the rejection of the Promise.\\n     * @param onrejected The callback to execute when the Promise is rejected.\\n     * @returns A Promise for the completion of the callback.\\n     */\\n    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;\\n}\\n\\ninterface ArrayLike<T> {\\n    readonly length: number;\\n    readonly [n: number]: T;\\n}\\n\\n/**\\n * Make all properties in T optional\\n */\\ntype Partial<T> = {\\n    [P in keyof T]?: T[P];\\n};\\n\\n/**\\n * Make all properties in T required\\n */\\ntype Required<T> = {\\n    [P in keyof T]-?: T[P];\\n};\\n\\n/**\\n * Make all properties in T readonly\\n */\\ntype Readonly<T> = {\\n    readonly [P in keyof T]: T[P];\\n};\\n\\n/**\\n * From T, pick a set of properties whose keys are in the union K\\n */\\ntype Pick<T, K extends keyof T> = {\\n    [P in K]: T[P];\\n};\\n\\n/**\\n * Construct a type with a set of properties K of type T\\n */\\ntype Record<K extends keyof any, T> = {\\n    [P in K]: T;\\n};\\n\\n/**\\n * Exclude from T those types that are assignable to U\\n */\\ntype Exclude<T, U> = T extends U ? never : T;\\n\\n/**\\n * Extract from T those types that are assignable to U\\n */\\ntype Extract<T, U> = T extends U ? T : never;\\n\\n/**\\n * Construct a type with the properties of T except for those in type K.\\n */\\ntype Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;\\n\\n/**\\n * Exclude null and undefined from T\\n */\\ntype NonNullable<T> = T extends null | undefined ? never : T;\\n\\n/**\\n * Obtain the parameters of a function type in a tuple\\n */\\ntype Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never;\\n\\n/**\\n * Obtain the parameters of a constructor function type in a tuple\\n */\\ntype ConstructorParameters<T extends new (...args: any) => any> = T extends new (...args: infer P) => any ? P : never;\\n\\n/**\\n * Obtain the return type of a function type\\n */\\ntype ReturnType<T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any;\\n\\n/**\\n * Obtain the return type of a constructor function type\\n */\\ntype InstanceType<T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any;\\n\\n/**\\n * Convert string literal type to uppercase\\n */\\ntype Uppercase<S extends string> = intrinsic;\\n\\n/**\\n * Convert string literal type to lowercase\\n */\\ntype Lowercase<S extends string> = intrinsic;\\n\\n/**\\n * Convert first character of string literal type to uppercase\\n */\\ntype Capitalize<S extends string> = intrinsic;\\n\\n/**\\n * Convert first character of string literal type to lowercase\\n */\\ntype Uncapitalize<S extends string> = intrinsic;\\n\\n/**\\n * Marker for contextual 'this' type\\n */\\ninterface ThisType<T> { }\\n\\n/**\\n * Represents a raw buffer of binary data, which is used to store data for the\\n * different typed arrays. ArrayBuffers cannot be read from or written to directly,\\n * but can be passed to a typed array or DataView Object to interpret the raw\\n * buffer as needed.\\n */\\ninterface ArrayBuffer {\\n    /**\\n     * Read-only. The length of the ArrayBuffer (in bytes).\\n     */\\n    readonly byteLength: number;\\n\\n    /**\\n     * Returns a section of an ArrayBuffer.\\n     */\\n    slice(begin: number, end?: number): ArrayBuffer;\\n}\\n\\n/**\\n * Allowed ArrayBuffer types for the buffer of an ArrayBufferView and related Typed Arrays.\\n */\\ninterface ArrayBufferTypes {\\n    ArrayBuffer: ArrayBuffer;\\n}\\ntype ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];\\n\\ninterface ArrayBufferConstructor {\\n    readonly prototype: ArrayBuffer;\\n    new(byteLength: number): ArrayBuffer;\\n    isView(arg: any): arg is ArrayBufferView;\\n}\\ndeclare var ArrayBuffer: ArrayBufferConstructor;\\n\\ninterface ArrayBufferView {\\n    /**\\n     * The ArrayBuffer instance referenced by the array.\\n     */\\n    buffer: ArrayBufferLike;\\n\\n    /**\\n     * The length in bytes of the array.\\n     */\\n    byteLength: number;\\n\\n    /**\\n     * The offset in bytes of the array.\\n     */\\n    byteOffset: number;\\n}\\n\\ninterface DataView {\\n    readonly buffer: ArrayBuffer;\\n    readonly byteLength: number;\\n    readonly byteOffset: number;\\n    /**\\n     * Gets the Float32 value at the specified byte offset from the start of the view. There is\\n     * no alignment constraint; multi-byte values may be fetched from any offset.\\n     * @param byteOffset The place in the buffer at which the value should be retrieved.\\n     */\\n    getFloat32(byteOffset: number, littleEndian?: boolean): number;\\n\\n    /**\\n     * Gets the Float64 value at the specified byte offset from the start of the view. There is\\n     * no alignment constraint; multi-byte values may be fetched from any offset.\\n     * @param byteOffset The place in the buffer at which the value should be retrieved.\\n     */\\n    getFloat64(byteOffset: number, littleEndian?: boolean): number;\\n\\n    /**\\n     * Gets the Int8 value at the specified byte offset from the start of the view. There is\\n     * no alignment constraint; multi-byte values may be fetched from any offset.\\n     * @param byteOffset The place in the buffer at which the value should be retrieved.\\n     */\\n    getInt8(byteOffset: number): number;\\n\\n    /**\\n     * Gets the Int16 value at the specified byte offset from the start of the view. There is\\n     * no alignment constraint; multi-byte values may be fetched from any offset.\\n     * @param byteOffset The place in the buffer at which the value should be retrieved.\\n     */\\n    getInt16(byteOffset: number, littleEndian?: boolean): number;\\n    /**\\n     * Gets the Int32 value at the specified byte offset from the start of the view. There is\\n     * no alignment constraint; multi-byte values may be fetched from any offset.\\n     * @param byteOffset The place in the buffer at which the value should be retrieved.\\n     */\\n    getInt32(byteOffset: number, littleEndian?: boolean): number;\\n\\n    /**\\n     * Gets the Uint8 value at the specified byte offset from the start of the view. There is\\n     * no alignment constraint; multi-byte values may be fetched from any offset.\\n     * @param byteOffset The place in the buffer at which the value should be retrieved.\\n     */\\n    getUint8(byteOffset: number): number;\\n\\n    /**\\n     * Gets the Uint16 value at the specified byte offset from the start of the view. There is\\n     * no alignment constraint; multi-byte values may be fetched from any offset.\\n     * @param byteOffset The place in the buffer at which the value should be retrieved.\\n     */\\n    getUint16(byteOffset: number, littleEndian?: boolean): number;\\n\\n    /**\\n     * Gets the Uint32 value at the specified byte offset from the start of the view. There is\\n     * no alignment constraint; multi-byte values may be fetched from any offset.\\n     * @param byteOffset The place in the buffer at which the value should be retrieved.\\n     */\\n    getUint32(byteOffset: number, littleEndian?: boolean): number;\\n\\n    /**\\n     * Stores an Float32 value at the specified byte offset from the start of the view.\\n     * @param byteOffset The place in the buffer at which the value should be set.\\n     * @param value The value to set.\\n     * @param littleEndian If false or undefined, a big-endian value should be written,\\n     * otherwise a little-endian value should be written.\\n     */\\n    setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;\\n\\n    /**\\n     * Stores an Float64 value at the specified byte offset from the start of the view.\\n     * @param byteOffset The place in the buffer at which the value should be set.\\n     * @param value The value to set.\\n     * @param littleEndian If false or undefined, a big-endian value should be written,\\n     * otherwise a little-endian value should be written.\\n     */\\n    setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;\\n\\n    /**\\n     * Stores an Int8 value at the specified byte offset from the start of the view.\\n     * @param byteOffset The place in the buffer at which the value should be set.\\n     * @param value The value to set.\\n     */\\n    setInt8(byteOffset: number, value: number): void;\\n\\n    /**\\n     * Stores an Int16 value at the specified byte offset from the start of the view.\\n     * @param byteOffset The place in the buffer at which the value should be set.\\n     * @param value The value to set.\\n     * @param littleEndian If false or undefined, a big-endian value should be written,\\n     * otherwise a little-endian value should be written.\\n     */\\n    setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;\\n\\n    /**\\n     * Stores an Int32 value at the specified byte offset from the start of the view.\\n     * @param byteOffset The place in the buffer at which the value should be set.\\n     * @param value The value to set.\\n     * @param littleEndian If false or undefined, a big-endian value should be written,\\n     * otherwise a little-endian value should be written.\\n     */\\n    setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;\\n\\n    /**\\n     * Stores an Uint8 value at the specified byte offset from the start of the view.\\n     * @param byteOffset The place in the buffer at which the value should be set.\\n     * @param value The value to set.\\n     */\\n    setUint8(byteOffset: number, value: number): void;\\n\\n    /**\\n     * Stores an Uint16 value at the specified byte offset from the start of the view.\\n     * @param byteOffset The place in the buffer at which the value should be set.\\n     * @param value The value to set.\\n     * @param littleEndian If false or undefined, a big-endian value should be written,\\n     * otherwise a little-endian value should be written.\\n     */\\n    setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;\\n\\n    /**\\n     * Stores an Uint32 value at the specified byte offset from the start of the view.\\n     * @param byteOffset The place in the buffer at which the value should be set.\\n     * @param value The value to set.\\n     * @param littleEndian If false or undefined, a big-endian value should be written,\\n     * otherwise a little-endian value should be written.\\n     */\\n    setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;\\n}\\n\\ninterface DataViewConstructor {\\n    readonly prototype: DataView;\\n    new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView;\\n}\\ndeclare var DataView: DataViewConstructor;\\n\\n/**\\n * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested\\n * number of bytes could not be allocated an exception is raised.\\n */\\ninterface Int8Array {\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * The ArrayBuffer instance referenced by the array.\\n     */\\n    readonly buffer: ArrayBufferLike;\\n\\n    /**\\n     * The length in bytes of the array.\\n     */\\n    readonly byteLength: number;\\n\\n    /**\\n     * The offset in bytes of the array.\\n     */\\n    readonly byteOffset: number;\\n\\n    /**\\n     * Returns the this object after copying a section of the array identified by start and end\\n     * to the same array starting at position target\\n     * @param target If target is negative, it is treated as length+target where length is the\\n     * length of the array.\\n     * @param start If start is negative, it is treated as length+start. If end is negative, it\\n     * is treated as length+end.\\n     * @param end If not specified, length of the this object is used as its default value.\\n     */\\n    copyWithin(target: number, start: number, end?: number): this;\\n\\n    /**\\n     * Determines whether all the members of an array satisfy the specified test.\\n     * @param predicate A function that accepts up to three arguments. The every method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value false, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    every(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Returns the this object after filling the section identified by start and end with value\\n     * @param value value to fill array section with\\n     * @param start index to start filling the array at. If start is negative, it is treated as\\n     * length+start where length is the length of the array.\\n     * @param end index to stop filling the array at. If end is negative, it is treated as\\n     * length+end.\\n     */\\n    fill(value: number, start?: number, end?: number): this;\\n\\n    /**\\n     * Returns the elements of an array that meet the condition specified in a callback function.\\n     * @param predicate A function that accepts up to three arguments. The filter method calls\\n     * the predicate function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    filter(predicate: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array;\\n\\n    /**\\n     * Returns the value of the first element in the array where predicate is true, and undefined\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found, find\\n     * immediately returns that element value. Otherwise, find returns undefined.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    find(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined;\\n\\n    /**\\n     * Returns the index of the first element in the array where predicate is true, and -1\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found,\\n     * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    findIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number;\\n\\n    /**\\n     * Performs the specified action for each element in an array.\\n     * @param callbackfn  A function that accepts up to three arguments. forEach calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;\\n\\n    /**\\n     * Returns the index of the first occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     *  search starts at index 0.\\n     */\\n    indexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * Adds all the elements of an array separated by the specified separator string.\\n     * @param separator A string used to separate one element of an array from the next in the\\n     * resulting String. If omitted, the array elements are separated with a comma.\\n     */\\n    join(separator?: string): string;\\n\\n    /**\\n     * Returns the index of the last occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     * search starts at index 0.\\n     */\\n    lastIndexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * The length of the array.\\n     */\\n    readonly length: number;\\n\\n    /**\\n     * Calls a defined callback function on each element of an array, and returns an array that\\n     * contains the results.\\n     * @param callbackfn A function that accepts up to three arguments. The map method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an\\n     * argument instead of an array value.\\n     */\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Reverses the elements in an Array.\\n     */\\n    reverse(): Int8Array;\\n\\n    /**\\n     * Sets a value or an array of values.\\n     * @param array A typed or untyped array of values to set.\\n     * @param offset The index in the current array at which the values are to be written.\\n     */\\n    set(array: ArrayLike<number>, offset?: number): void;\\n\\n    /**\\n     * Returns a section of an array.\\n     * @param start The beginning of the specified portion of the array.\\n     * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\\n     */\\n    slice(start?: number, end?: number): Int8Array;\\n\\n    /**\\n     * Determines whether the specified callback function returns true for any element of an array.\\n     * @param predicate A function that accepts up to three arguments. The some method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value true, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    some(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Sorts an array.\\n     * @param compareFn Function used to determine the order of the elements. It is expected to return\\n     * a negative value if first argument is less than second argument, zero if they're equal and a positive\\n     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\\n     * ```ts\\n     * [11,2,22,1].sort((a, b) => a - b)\\n     * ```\\n     */\\n    sort(compareFn?: (a: number, b: number) => number): this;\\n\\n    /**\\n     * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements\\n     * at begin, inclusive, up to end, exclusive.\\n     * @param begin The index of the beginning of the array.\\n     * @param end The index of the end of the array.\\n     */\\n    subarray(begin?: number, end?: number): Int8Array;\\n\\n    /**\\n     * Converts a number to a string by using the current locale.\\n     */\\n    toLocaleString(): string;\\n\\n    /**\\n     * Returns a string representation of an array.\\n     */\\n    toString(): string;\\n\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): Int8Array;\\n\\n    [index: number]: number;\\n}\\ninterface Int8ArrayConstructor {\\n    readonly prototype: Int8Array;\\n    new(length: number): Int8Array;\\n    new(array: ArrayLike<number> | ArrayBufferLike): Int8Array;\\n    new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int8Array;\\n\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * Returns a new array from a set of elements.\\n     * @param items A set of elements to include in the new array object.\\n     */\\n    of(...items: number[]): Int8Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     */\\n    from(arrayLike: ArrayLike<number>): Int8Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array;\\n\\n\\n}\\ndeclare var Int8Array: Int8ArrayConstructor;\\n\\n/**\\n * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\\n * requested number of bytes could not be allocated an exception is raised.\\n */\\ninterface Uint8Array {\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * The ArrayBuffer instance referenced by the array.\\n     */\\n    readonly buffer: ArrayBufferLike;\\n\\n    /**\\n     * The length in bytes of the array.\\n     */\\n    readonly byteLength: number;\\n\\n    /**\\n     * The offset in bytes of the array.\\n     */\\n    readonly byteOffset: number;\\n\\n    /**\\n     * Returns the this object after copying a section of the array identified by start and end\\n     * to the same array starting at position target\\n     * @param target If target is negative, it is treated as length+target where length is the\\n     * length of the array.\\n     * @param start If start is negative, it is treated as length+start. If end is negative, it\\n     * is treated as length+end.\\n     * @param end If not specified, length of the this object is used as its default value.\\n     */\\n    copyWithin(target: number, start: number, end?: number): this;\\n\\n    /**\\n     * Determines whether all the members of an array satisfy the specified test.\\n     * @param predicate A function that accepts up to three arguments. The every method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value false, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    every(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Returns the this object after filling the section identified by start and end with value\\n     * @param value value to fill array section with\\n     * @param start index to start filling the array at. If start is negative, it is treated as\\n     * length+start where length is the length of the array.\\n     * @param end index to stop filling the array at. If end is negative, it is treated as\\n     * length+end.\\n     */\\n    fill(value: number, start?: number, end?: number): this;\\n\\n    /**\\n     * Returns the elements of an array that meet the condition specified in a callback function.\\n     * @param predicate A function that accepts up to three arguments. The filter method calls\\n     * the predicate function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    filter(predicate: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array;\\n\\n    /**\\n     * Returns the value of the first element in the array where predicate is true, and undefined\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found, find\\n     * immediately returns that element value. Otherwise, find returns undefined.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    find(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined;\\n\\n    /**\\n     * Returns the index of the first element in the array where predicate is true, and -1\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found,\\n     * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    findIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number;\\n\\n    /**\\n     * Performs the specified action for each element in an array.\\n     * @param callbackfn  A function that accepts up to three arguments. forEach calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;\\n\\n    /**\\n     * Returns the index of the first occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     *  search starts at index 0.\\n     */\\n    indexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * Adds all the elements of an array separated by the specified separator string.\\n     * @param separator A string used to separate one element of an array from the next in the\\n     * resulting String. If omitted, the array elements are separated with a comma.\\n     */\\n    join(separator?: string): string;\\n\\n    /**\\n     * Returns the index of the last occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     * search starts at index 0.\\n     */\\n    lastIndexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * The length of the array.\\n     */\\n    readonly length: number;\\n\\n    /**\\n     * Calls a defined callback function on each element of an array, and returns an array that\\n     * contains the results.\\n     * @param callbackfn A function that accepts up to three arguments. The map method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an\\n     * argument instead of an array value.\\n     */\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Reverses the elements in an Array.\\n     */\\n    reverse(): Uint8Array;\\n\\n    /**\\n     * Sets a value or an array of values.\\n     * @param array A typed or untyped array of values to set.\\n     * @param offset The index in the current array at which the values are to be written.\\n     */\\n    set(array: ArrayLike<number>, offset?: number): void;\\n\\n    /**\\n     * Returns a section of an array.\\n     * @param start The beginning of the specified portion of the array.\\n     * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\\n     */\\n    slice(start?: number, end?: number): Uint8Array;\\n\\n    /**\\n     * Determines whether the specified callback function returns true for any element of an array.\\n     * @param predicate A function that accepts up to three arguments. The some method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value true, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    some(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Sorts an array.\\n     * @param compareFn Function used to determine the order of the elements. It is expected to return\\n     * a negative value if first argument is less than second argument, zero if they're equal and a positive\\n     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\\n     * ```ts\\n     * [11,2,22,1].sort((a, b) => a - b)\\n     * ```\\n     */\\n    sort(compareFn?: (a: number, b: number) => number): this;\\n\\n    /**\\n     * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements\\n     * at begin, inclusive, up to end, exclusive.\\n     * @param begin The index of the beginning of the array.\\n     * @param end The index of the end of the array.\\n     */\\n    subarray(begin?: number, end?: number): Uint8Array;\\n\\n    /**\\n     * Converts a number to a string by using the current locale.\\n     */\\n    toLocaleString(): string;\\n\\n    /**\\n     * Returns a string representation of an array.\\n     */\\n    toString(): string;\\n\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): Uint8Array;\\n\\n    [index: number]: number;\\n}\\n\\ninterface Uint8ArrayConstructor {\\n    readonly prototype: Uint8Array;\\n    new(length: number): Uint8Array;\\n    new(array: ArrayLike<number> | ArrayBufferLike): Uint8Array;\\n    new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8Array;\\n\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * Returns a new array from a set of elements.\\n     * @param items A set of elements to include in the new array object.\\n     */\\n    of(...items: number[]): Uint8Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     */\\n    from(arrayLike: ArrayLike<number>): Uint8Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array;\\n\\n}\\ndeclare var Uint8Array: Uint8ArrayConstructor;\\n\\n/**\\n * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.\\n * If the requested number of bytes could not be allocated an exception is raised.\\n */\\ninterface Uint8ClampedArray {\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * The ArrayBuffer instance referenced by the array.\\n     */\\n    readonly buffer: ArrayBufferLike;\\n\\n    /**\\n     * The length in bytes of the array.\\n     */\\n    readonly byteLength: number;\\n\\n    /**\\n     * The offset in bytes of the array.\\n     */\\n    readonly byteOffset: number;\\n\\n    /**\\n     * Returns the this object after copying a section of the array identified by start and end\\n     * to the same array starting at position target\\n     * @param target If target is negative, it is treated as length+target where length is the\\n     * length of the array.\\n     * @param start If start is negative, it is treated as length+start. If end is negative, it\\n     * is treated as length+end.\\n     * @param end If not specified, length of the this object is used as its default value.\\n     */\\n    copyWithin(target: number, start: number, end?: number): this;\\n\\n    /**\\n     * Determines whether all the members of an array satisfy the specified test.\\n     * @param predicate A function that accepts up to three arguments. The every method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value false, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    every(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Returns the this object after filling the section identified by start and end with value\\n     * @param value value to fill array section with\\n     * @param start index to start filling the array at. If start is negative, it is treated as\\n     * length+start where length is the length of the array.\\n     * @param end index to stop filling the array at. If end is negative, it is treated as\\n     * length+end.\\n     */\\n    fill(value: number, start?: number, end?: number): this;\\n\\n    /**\\n     * Returns the elements of an array that meet the condition specified in a callback function.\\n     * @param predicate A function that accepts up to three arguments. The filter method calls\\n     * the predicate function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    filter(predicate: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray;\\n\\n    /**\\n     * Returns the value of the first element in the array where predicate is true, and undefined\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found, find\\n     * immediately returns that element value. Otherwise, find returns undefined.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined;\\n\\n    /**\\n     * Returns the index of the first element in the array where predicate is true, and -1\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found,\\n     * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number;\\n\\n    /**\\n     * Performs the specified action for each element in an array.\\n     * @param callbackfn  A function that accepts up to three arguments. forEach calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;\\n\\n    /**\\n     * Returns the index of the first occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     *  search starts at index 0.\\n     */\\n    indexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * Adds all the elements of an array separated by the specified separator string.\\n     * @param separator A string used to separate one element of an array from the next in the\\n     * resulting String. If omitted, the array elements are separated with a comma.\\n     */\\n    join(separator?: string): string;\\n\\n    /**\\n     * Returns the index of the last occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     * search starts at index 0.\\n     */\\n    lastIndexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * The length of the array.\\n     */\\n    readonly length: number;\\n\\n    /**\\n     * Calls a defined callback function on each element of an array, and returns an array that\\n     * contains the results.\\n     * @param callbackfn A function that accepts up to three arguments. The map method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an\\n     * argument instead of an array value.\\n     */\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;\\n\\n    /**\\n     * Reverses the elements in an Array.\\n     */\\n    reverse(): Uint8ClampedArray;\\n\\n    /**\\n     * Sets a value or an array of values.\\n     * @param array A typed or untyped array of values to set.\\n     * @param offset The index in the current array at which the values are to be written.\\n     */\\n    set(array: ArrayLike<number>, offset?: number): void;\\n\\n    /**\\n     * Returns a section of an array.\\n     * @param start The beginning of the specified portion of the array.\\n     * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\\n     */\\n    slice(start?: number, end?: number): Uint8ClampedArray;\\n\\n    /**\\n     * Determines whether the specified callback function returns true for any element of an array.\\n     * @param predicate A function that accepts up to three arguments. The some method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value true, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    some(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Sorts an array.\\n     * @param compareFn Function used to determine the order of the elements. It is expected to return\\n     * a negative value if first argument is less than second argument, zero if they're equal and a positive\\n     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\\n     * ```ts\\n     * [11,2,22,1].sort((a, b) => a - b)\\n     * ```\\n     */\\n    sort(compareFn?: (a: number, b: number) => number): this;\\n\\n    /**\\n     * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements\\n     * at begin, inclusive, up to end, exclusive.\\n     * @param begin The index of the beginning of the array.\\n     * @param end The index of the end of the array.\\n     */\\n    subarray(begin?: number, end?: number): Uint8ClampedArray;\\n\\n    /**\\n     * Converts a number to a string by using the current locale.\\n     */\\n    toLocaleString(): string;\\n\\n    /**\\n     * Returns a string representation of an array.\\n     */\\n    toString(): string;\\n\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): Uint8ClampedArray;\\n\\n    [index: number]: number;\\n}\\n\\ninterface Uint8ClampedArrayConstructor {\\n    readonly prototype: Uint8ClampedArray;\\n    new(length: number): Uint8ClampedArray;\\n    new(array: ArrayLike<number> | ArrayBufferLike): Uint8ClampedArray;\\n    new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8ClampedArray;\\n\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * Returns a new array from a set of elements.\\n     * @param items A set of elements to include in the new array object.\\n     */\\n    of(...items: number[]): Uint8ClampedArray;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     */\\n    from(arrayLike: ArrayLike<number>): Uint8ClampedArray;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray;\\n}\\ndeclare var Uint8ClampedArray: Uint8ClampedArrayConstructor;\\n\\n/**\\n * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the\\n * requested number of bytes could not be allocated an exception is raised.\\n */\\ninterface Int16Array {\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * The ArrayBuffer instance referenced by the array.\\n     */\\n    readonly buffer: ArrayBufferLike;\\n\\n    /**\\n     * The length in bytes of the array.\\n     */\\n    readonly byteLength: number;\\n\\n    /**\\n     * The offset in bytes of the array.\\n     */\\n    readonly byteOffset: number;\\n\\n    /**\\n     * Returns the this object after copying a section of the array identified by start and end\\n     * to the same array starting at position target\\n     * @param target If target is negative, it is treated as length+target where length is the\\n     * length of the array.\\n     * @param start If start is negative, it is treated as length+start. If end is negative, it\\n     * is treated as length+end.\\n     * @param end If not specified, length of the this object is used as its default value.\\n     */\\n    copyWithin(target: number, start: number, end?: number): this;\\n\\n    /**\\n     * Determines whether all the members of an array satisfy the specified test.\\n     * @param predicate A function that accepts up to three arguments. The every method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value false, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    every(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Returns the this object after filling the section identified by start and end with value\\n     * @param value value to fill array section with\\n     * @param start index to start filling the array at. If start is negative, it is treated as\\n     * length+start where length is the length of the array.\\n     * @param end index to stop filling the array at. If end is negative, it is treated as\\n     * length+end.\\n     */\\n    fill(value: number, start?: number, end?: number): this;\\n\\n    /**\\n     * Returns the elements of an array that meet the condition specified in a callback function.\\n     * @param predicate A function that accepts up to three arguments. The filter method calls\\n     * the predicate function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    filter(predicate: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array;\\n\\n    /**\\n     * Returns the value of the first element in the array where predicate is true, and undefined\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found, find\\n     * immediately returns that element value. Otherwise, find returns undefined.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    find(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined;\\n\\n    /**\\n     * Returns the index of the first element in the array where predicate is true, and -1\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found,\\n     * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    findIndex(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number;\\n\\n    /**\\n     * Performs the specified action for each element in an array.\\n     * @param callbackfn  A function that accepts up to three arguments. forEach calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;\\n    /**\\n     * Returns the index of the first occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     *  search starts at index 0.\\n     */\\n    indexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * Adds all the elements of an array separated by the specified separator string.\\n     * @param separator A string used to separate one element of an array from the next in the\\n     * resulting String. If omitted, the array elements are separated with a comma.\\n     */\\n    join(separator?: string): string;\\n\\n    /**\\n     * Returns the index of the last occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     * search starts at index 0.\\n     */\\n    lastIndexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * The length of the array.\\n     */\\n    readonly length: number;\\n\\n    /**\\n     * Calls a defined callback function on each element of an array, and returns an array that\\n     * contains the results.\\n     * @param callbackfn A function that accepts up to three arguments. The map method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an\\n     * argument instead of an array value.\\n     */\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Reverses the elements in an Array.\\n     */\\n    reverse(): Int16Array;\\n\\n    /**\\n     * Sets a value or an array of values.\\n     * @param array A typed or untyped array of values to set.\\n     * @param offset The index in the current array at which the values are to be written.\\n     */\\n    set(array: ArrayLike<number>, offset?: number): void;\\n\\n    /**\\n     * Returns a section of an array.\\n     * @param start The beginning of the specified portion of the array.\\n     * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\\n     */\\n    slice(start?: number, end?: number): Int16Array;\\n\\n    /**\\n     * Determines whether the specified callback function returns true for any element of an array.\\n     * @param predicate A function that accepts up to three arguments. The some method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value true, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    some(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Sorts an array.\\n     * @param compareFn Function used to determine the order of the elements. It is expected to return\\n     * a negative value if first argument is less than second argument, zero if they're equal and a positive\\n     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\\n     * ```ts\\n     * [11,2,22,1].sort((a, b) => a - b)\\n     * ```\\n     */\\n    sort(compareFn?: (a: number, b: number) => number): this;\\n\\n    /**\\n     * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements\\n     * at begin, inclusive, up to end, exclusive.\\n     * @param begin The index of the beginning of the array.\\n     * @param end The index of the end of the array.\\n     */\\n    subarray(begin?: number, end?: number): Int16Array;\\n\\n    /**\\n     * Converts a number to a string by using the current locale.\\n     */\\n    toLocaleString(): string;\\n\\n    /**\\n     * Returns a string representation of an array.\\n     */\\n    toString(): string;\\n\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): Int16Array;\\n\\n    [index: number]: number;\\n}\\n\\ninterface Int16ArrayConstructor {\\n    readonly prototype: Int16Array;\\n    new(length: number): Int16Array;\\n    new(array: ArrayLike<number> | ArrayBufferLike): Int16Array;\\n    new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int16Array;\\n\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * Returns a new array from a set of elements.\\n     * @param items A set of elements to include in the new array object.\\n     */\\n    of(...items: number[]): Int16Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     */\\n    from(arrayLike: ArrayLike<number>): Int16Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array;\\n\\n\\n}\\ndeclare var Int16Array: Int16ArrayConstructor;\\n\\n/**\\n * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the\\n * requested number of bytes could not be allocated an exception is raised.\\n */\\ninterface Uint16Array {\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * The ArrayBuffer instance referenced by the array.\\n     */\\n    readonly buffer: ArrayBufferLike;\\n\\n    /**\\n     * The length in bytes of the array.\\n     */\\n    readonly byteLength: number;\\n\\n    /**\\n     * The offset in bytes of the array.\\n     */\\n    readonly byteOffset: number;\\n\\n    /**\\n     * Returns the this object after copying a section of the array identified by start and end\\n     * to the same array starting at position target\\n     * @param target If target is negative, it is treated as length+target where length is the\\n     * length of the array.\\n     * @param start If start is negative, it is treated as length+start. If end is negative, it\\n     * is treated as length+end.\\n     * @param end If not specified, length of the this object is used as its default value.\\n     */\\n    copyWithin(target: number, start: number, end?: number): this;\\n\\n    /**\\n     * Determines whether all the members of an array satisfy the specified test.\\n     * @param predicate A function that accepts up to three arguments. The every method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value false, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    every(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Returns the this object after filling the section identified by start and end with value\\n     * @param value value to fill array section with\\n     * @param start index to start filling the array at. If start is negative, it is treated as\\n     * length+start where length is the length of the array.\\n     * @param end index to stop filling the array at. If end is negative, it is treated as\\n     * length+end.\\n     */\\n    fill(value: number, start?: number, end?: number): this;\\n\\n    /**\\n     * Returns the elements of an array that meet the condition specified in a callback function.\\n     * @param predicate A function that accepts up to three arguments. The filter method calls\\n     * the predicate function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    filter(predicate: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array;\\n\\n    /**\\n     * Returns the value of the first element in the array where predicate is true, and undefined\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found, find\\n     * immediately returns that element value. Otherwise, find returns undefined.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    find(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined;\\n\\n    /**\\n     * Returns the index of the first element in the array where predicate is true, and -1\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found,\\n     * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    findIndex(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number;\\n\\n    /**\\n     * Performs the specified action for each element in an array.\\n     * @param callbackfn  A function that accepts up to three arguments. forEach calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;\\n\\n    /**\\n     * Returns the index of the first occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     *  search starts at index 0.\\n     */\\n    indexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * Adds all the elements of an array separated by the specified separator string.\\n     * @param separator A string used to separate one element of an array from the next in the\\n     * resulting String. If omitted, the array elements are separated with a comma.\\n     */\\n    join(separator?: string): string;\\n\\n    /**\\n     * Returns the index of the last occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     * search starts at index 0.\\n     */\\n    lastIndexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * The length of the array.\\n     */\\n    readonly length: number;\\n\\n    /**\\n     * Calls a defined callback function on each element of an array, and returns an array that\\n     * contains the results.\\n     * @param callbackfn A function that accepts up to three arguments. The map method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an\\n     * argument instead of an array value.\\n     */\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Reverses the elements in an Array.\\n     */\\n    reverse(): Uint16Array;\\n\\n    /**\\n     * Sets a value or an array of values.\\n     * @param array A typed or untyped array of values to set.\\n     * @param offset The index in the current array at which the values are to be written.\\n     */\\n    set(array: ArrayLike<number>, offset?: number): void;\\n\\n    /**\\n     * Returns a section of an array.\\n     * @param start The beginning of the specified portion of the array.\\n     * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\\n     */\\n    slice(start?: number, end?: number): Uint16Array;\\n\\n    /**\\n     * Determines whether the specified callback function returns true for any element of an array.\\n     * @param predicate A function that accepts up to three arguments. The some method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value true, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    some(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Sorts an array.\\n     * @param compareFn Function used to determine the order of the elements. It is expected to return\\n     * a negative value if first argument is less than second argument, zero if they're equal and a positive\\n     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\\n     * ```ts\\n     * [11,2,22,1].sort((a, b) => a - b)\\n     * ```\\n     */\\n    sort(compareFn?: (a: number, b: number) => number): this;\\n\\n    /**\\n     * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements\\n     * at begin, inclusive, up to end, exclusive.\\n     * @param begin The index of the beginning of the array.\\n     * @param end The index of the end of the array.\\n     */\\n    subarray(begin?: number, end?: number): Uint16Array;\\n\\n    /**\\n     * Converts a number to a string by using the current locale.\\n     */\\n    toLocaleString(): string;\\n\\n    /**\\n     * Returns a string representation of an array.\\n     */\\n    toString(): string;\\n\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): Uint16Array;\\n\\n    [index: number]: number;\\n}\\n\\ninterface Uint16ArrayConstructor {\\n    readonly prototype: Uint16Array;\\n    new(length: number): Uint16Array;\\n    new(array: ArrayLike<number> | ArrayBufferLike): Uint16Array;\\n    new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint16Array;\\n\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * Returns a new array from a set of elements.\\n     * @param items A set of elements to include in the new array object.\\n     */\\n    of(...items: number[]): Uint16Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     */\\n    from(arrayLike: ArrayLike<number>): Uint16Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array;\\n\\n\\n}\\ndeclare var Uint16Array: Uint16ArrayConstructor;\\n/**\\n * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the\\n * requested number of bytes could not be allocated an exception is raised.\\n */\\ninterface Int32Array {\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * The ArrayBuffer instance referenced by the array.\\n     */\\n    readonly buffer: ArrayBufferLike;\\n\\n    /**\\n     * The length in bytes of the array.\\n     */\\n    readonly byteLength: number;\\n\\n    /**\\n     * The offset in bytes of the array.\\n     */\\n    readonly byteOffset: number;\\n\\n    /**\\n     * Returns the this object after copying a section of the array identified by start and end\\n     * to the same array starting at position target\\n     * @param target If target is negative, it is treated as length+target where length is the\\n     * length of the array.\\n     * @param start If start is negative, it is treated as length+start. If end is negative, it\\n     * is treated as length+end.\\n     * @param end If not specified, length of the this object is used as its default value.\\n     */\\n    copyWithin(target: number, start: number, end?: number): this;\\n\\n    /**\\n     * Determines whether all the members of an array satisfy the specified test.\\n     * @param predicate A function that accepts up to three arguments. The every method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value false, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    every(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Returns the this object after filling the section identified by start and end with value\\n     * @param value value to fill array section with\\n     * @param start index to start filling the array at. If start is negative, it is treated as\\n     * length+start where length is the length of the array.\\n     * @param end index to stop filling the array at. If end is negative, it is treated as\\n     * length+end.\\n     */\\n    fill(value: number, start?: number, end?: number): this;\\n\\n    /**\\n     * Returns the elements of an array that meet the condition specified in a callback function.\\n     * @param predicate A function that accepts up to three arguments. The filter method calls\\n     * the predicate function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    filter(predicate: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array;\\n\\n    /**\\n     * Returns the value of the first element in the array where predicate is true, and undefined\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found, find\\n     * immediately returns that element value. Otherwise, find returns undefined.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    find(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined;\\n\\n    /**\\n     * Returns the index of the first element in the array where predicate is true, and -1\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found,\\n     * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    findIndex(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number;\\n\\n    /**\\n     * Performs the specified action for each element in an array.\\n     * @param callbackfn  A function that accepts up to three arguments. forEach calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;\\n\\n    /**\\n     * Returns the index of the first occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     *  search starts at index 0.\\n     */\\n    indexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * Adds all the elements of an array separated by the specified separator string.\\n     * @param separator A string used to separate one element of an array from the next in the\\n     * resulting String. If omitted, the array elements are separated with a comma.\\n     */\\n    join(separator?: string): string;\\n\\n    /**\\n     * Returns the index of the last occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     * search starts at index 0.\\n     */\\n    lastIndexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * The length of the array.\\n     */\\n    readonly length: number;\\n\\n    /**\\n     * Calls a defined callback function on each element of an array, and returns an array that\\n     * contains the results.\\n     * @param callbackfn A function that accepts up to three arguments. The map method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an\\n     * argument instead of an array value.\\n     */\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Reverses the elements in an Array.\\n     */\\n    reverse(): Int32Array;\\n\\n    /**\\n     * Sets a value or an array of values.\\n     * @param array A typed or untyped array of values to set.\\n     * @param offset The index in the current array at which the values are to be written.\\n     */\\n    set(array: ArrayLike<number>, offset?: number): void;\\n\\n    /**\\n     * Returns a section of an array.\\n     * @param start The beginning of the specified portion of the array.\\n     * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\\n     */\\n    slice(start?: number, end?: number): Int32Array;\\n\\n    /**\\n     * Determines whether the specified callback function returns true for any element of an array.\\n     * @param predicate A function that accepts up to three arguments. The some method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value true, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    some(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Sorts an array.\\n     * @param compareFn Function used to determine the order of the elements. It is expected to return\\n     * a negative value if first argument is less than second argument, zero if they're equal and a positive\\n     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\\n     * ```ts\\n     * [11,2,22,1].sort((a, b) => a - b)\\n     * ```\\n     */\\n    sort(compareFn?: (a: number, b: number) => number): this;\\n\\n    /**\\n     * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements\\n     * at begin, inclusive, up to end, exclusive.\\n     * @param begin The index of the beginning of the array.\\n     * @param end The index of the end of the array.\\n     */\\n    subarray(begin?: number, end?: number): Int32Array;\\n\\n    /**\\n     * Converts a number to a string by using the current locale.\\n     */\\n    toLocaleString(): string;\\n\\n    /**\\n     * Returns a string representation of an array.\\n     */\\n    toString(): string;\\n\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): Int32Array;\\n\\n    [index: number]: number;\\n}\\n\\ninterface Int32ArrayConstructor {\\n    readonly prototype: Int32Array;\\n    new(length: number): Int32Array;\\n    new(array: ArrayLike<number> | ArrayBufferLike): Int32Array;\\n    new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int32Array;\\n\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * Returns a new array from a set of elements.\\n     * @param items A set of elements to include in the new array object.\\n     */\\n    of(...items: number[]): Int32Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     */\\n    from(arrayLike: ArrayLike<number>): Int32Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array;\\n\\n}\\ndeclare var Int32Array: Int32ArrayConstructor;\\n\\n/**\\n * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the\\n * requested number of bytes could not be allocated an exception is raised.\\n */\\ninterface Uint32Array {\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * The ArrayBuffer instance referenced by the array.\\n     */\\n    readonly buffer: ArrayBufferLike;\\n\\n    /**\\n     * The length in bytes of the array.\\n     */\\n    readonly byteLength: number;\\n\\n    /**\\n     * The offset in bytes of the array.\\n     */\\n    readonly byteOffset: number;\\n\\n    /**\\n     * Returns the this object after copying a section of the array identified by start and end\\n     * to the same array starting at position target\\n     * @param target If target is negative, it is treated as length+target where length is the\\n     * length of the array.\\n     * @param start If start is negative, it is treated as length+start. If end is negative, it\\n     * is treated as length+end.\\n     * @param end If not specified, length of the this object is used as its default value.\\n     */\\n    copyWithin(target: number, start: number, end?: number): this;\\n\\n    /**\\n     * Determines whether all the members of an array satisfy the specified test.\\n     * @param predicate A function that accepts up to three arguments. The every method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value false, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    every(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Returns the this object after filling the section identified by start and end with value\\n     * @param value value to fill array section with\\n     * @param start index to start filling the array at. If start is negative, it is treated as\\n     * length+start where length is the length of the array.\\n     * @param end index to stop filling the array at. If end is negative, it is treated as\\n     * length+end.\\n     */\\n    fill(value: number, start?: number, end?: number): this;\\n\\n    /**\\n     * Returns the elements of an array that meet the condition specified in a callback function.\\n     * @param predicate A function that accepts up to three arguments. The filter method calls\\n     * the predicate function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    filter(predicate: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array;\\n\\n    /**\\n     * Returns the value of the first element in the array where predicate is true, and undefined\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found, find\\n     * immediately returns that element value. Otherwise, find returns undefined.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    find(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined;\\n\\n    /**\\n     * Returns the index of the first element in the array where predicate is true, and -1\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found,\\n     * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    findIndex(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number;\\n\\n    /**\\n     * Performs the specified action for each element in an array.\\n     * @param callbackfn  A function that accepts up to three arguments. forEach calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;\\n    /**\\n     * Returns the index of the first occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     *  search starts at index 0.\\n     */\\n    indexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * Adds all the elements of an array separated by the specified separator string.\\n     * @param separator A string used to separate one element of an array from the next in the\\n     * resulting String. If omitted, the array elements are separated with a comma.\\n     */\\n    join(separator?: string): string;\\n\\n    /**\\n     * Returns the index of the last occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     * search starts at index 0.\\n     */\\n    lastIndexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * The length of the array.\\n     */\\n    readonly length: number;\\n\\n    /**\\n     * Calls a defined callback function on each element of an array, and returns an array that\\n     * contains the results.\\n     * @param callbackfn A function that accepts up to three arguments. The map method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an\\n     * argument instead of an array value.\\n     */\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Reverses the elements in an Array.\\n     */\\n    reverse(): Uint32Array;\\n\\n    /**\\n     * Sets a value or an array of values.\\n     * @param array A typed or untyped array of values to set.\\n     * @param offset The index in the current array at which the values are to be written.\\n     */\\n    set(array: ArrayLike<number>, offset?: number): void;\\n\\n    /**\\n     * Returns a section of an array.\\n     * @param start The beginning of the specified portion of the array.\\n     * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\\n     */\\n    slice(start?: number, end?: number): Uint32Array;\\n\\n    /**\\n     * Determines whether the specified callback function returns true for any element of an array.\\n     * @param predicate A function that accepts up to three arguments. The some method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value true, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    some(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Sorts an array.\\n     * @param compareFn Function used to determine the order of the elements. It is expected to return\\n     * a negative value if first argument is less than second argument, zero if they're equal and a positive\\n     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\\n     * ```ts\\n     * [11,2,22,1].sort((a, b) => a - b)\\n     * ```\\n     */\\n    sort(compareFn?: (a: number, b: number) => number): this;\\n\\n    /**\\n     * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements\\n     * at begin, inclusive, up to end, exclusive.\\n     * @param begin The index of the beginning of the array.\\n     * @param end The index of the end of the array.\\n     */\\n    subarray(begin?: number, end?: number): Uint32Array;\\n\\n    /**\\n     * Converts a number to a string by using the current locale.\\n     */\\n    toLocaleString(): string;\\n\\n    /**\\n     * Returns a string representation of an array.\\n     */\\n    toString(): string;\\n\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): Uint32Array;\\n\\n    [index: number]: number;\\n}\\n\\ninterface Uint32ArrayConstructor {\\n    readonly prototype: Uint32Array;\\n    new(length: number): Uint32Array;\\n    new(array: ArrayLike<number> | ArrayBufferLike): Uint32Array;\\n    new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint32Array;\\n\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * Returns a new array from a set of elements.\\n     * @param items A set of elements to include in the new array object.\\n     */\\n    of(...items: number[]): Uint32Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     */\\n    from(arrayLike: ArrayLike<number>): Uint32Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array;\\n\\n}\\ndeclare var Uint32Array: Uint32ArrayConstructor;\\n\\n/**\\n * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number\\n * of bytes could not be allocated an exception is raised.\\n */\\ninterface Float32Array {\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * The ArrayBuffer instance referenced by the array.\\n     */\\n    readonly buffer: ArrayBufferLike;\\n\\n    /**\\n     * The length in bytes of the array.\\n     */\\n    readonly byteLength: number;\\n\\n    /**\\n     * The offset in bytes of the array.\\n     */\\n    readonly byteOffset: number;\\n\\n    /**\\n     * Returns the this object after copying a section of the array identified by start and end\\n     * to the same array starting at position target\\n     * @param target If target is negative, it is treated as length+target where length is the\\n     * length of the array.\\n     * @param start If start is negative, it is treated as length+start. If end is negative, it\\n     * is treated as length+end.\\n     * @param end If not specified, length of the this object is used as its default value.\\n     */\\n    copyWithin(target: number, start: number, end?: number): this;\\n\\n    /**\\n     * Determines whether all the members of an array satisfy the specified test.\\n     * @param predicate A function that accepts up to three arguments. The every method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value false, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    every(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Returns the this object after filling the section identified by start and end with value\\n     * @param value value to fill array section with\\n     * @param start index to start filling the array at. If start is negative, it is treated as\\n     * length+start where length is the length of the array.\\n     * @param end index to stop filling the array at. If end is negative, it is treated as\\n     * length+end.\\n     */\\n    fill(value: number, start?: number, end?: number): this;\\n\\n    /**\\n     * Returns the elements of an array that meet the condition specified in a callback function.\\n     * @param predicate A function that accepts up to three arguments. The filter method calls\\n     * the predicate function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    filter(predicate: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array;\\n\\n    /**\\n     * Returns the value of the first element in the array where predicate is true, and undefined\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found, find\\n     * immediately returns that element value. Otherwise, find returns undefined.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    find(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined;\\n\\n    /**\\n     * Returns the index of the first element in the array where predicate is true, and -1\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found,\\n     * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    findIndex(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number;\\n\\n    /**\\n     * Performs the specified action for each element in an array.\\n     * @param callbackfn  A function that accepts up to three arguments. forEach calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;\\n\\n    /**\\n     * Returns the index of the first occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     *  search starts at index 0.\\n     */\\n    indexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * Adds all the elements of an array separated by the specified separator string.\\n     * @param separator A string used to separate one element of an array from the next in the\\n     * resulting String. If omitted, the array elements are separated with a comma.\\n     */\\n    join(separator?: string): string;\\n\\n    /**\\n     * Returns the index of the last occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     * search starts at index 0.\\n     */\\n    lastIndexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * The length of the array.\\n     */\\n    readonly length: number;\\n\\n    /**\\n     * Calls a defined callback function on each element of an array, and returns an array that\\n     * contains the results.\\n     * @param callbackfn A function that accepts up to three arguments. The map method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an\\n     * argument instead of an array value.\\n     */\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Reverses the elements in an Array.\\n     */\\n    reverse(): Float32Array;\\n\\n    /**\\n     * Sets a value or an array of values.\\n     * @param array A typed or untyped array of values to set.\\n     * @param offset The index in the current array at which the values are to be written.\\n     */\\n    set(array: ArrayLike<number>, offset?: number): void;\\n\\n    /**\\n     * Returns a section of an array.\\n     * @param start The beginning of the specified portion of the array.\\n     * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\\n     */\\n    slice(start?: number, end?: number): Float32Array;\\n\\n    /**\\n     * Determines whether the specified callback function returns true for any element of an array.\\n     * @param predicate A function that accepts up to three arguments. The some method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value true, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    some(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Sorts an array.\\n     * @param compareFn Function used to determine the order of the elements. It is expected to return\\n     * a negative value if first argument is less than second argument, zero if they're equal and a positive\\n     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\\n     * ```ts\\n     * [11,2,22,1].sort((a, b) => a - b)\\n     * ```\\n     */\\n    sort(compareFn?: (a: number, b: number) => number): this;\\n\\n    /**\\n     * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements\\n     * at begin, inclusive, up to end, exclusive.\\n     * @param begin The index of the beginning of the array.\\n     * @param end The index of the end of the array.\\n     */\\n    subarray(begin?: number, end?: number): Float32Array;\\n\\n    /**\\n     * Converts a number to a string by using the current locale.\\n     */\\n    toLocaleString(): string;\\n\\n    /**\\n     * Returns a string representation of an array.\\n     */\\n    toString(): string;\\n\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): Float32Array;\\n\\n    [index: number]: number;\\n}\\n\\ninterface Float32ArrayConstructor {\\n    readonly prototype: Float32Array;\\n    new(length: number): Float32Array;\\n    new(array: ArrayLike<number> | ArrayBufferLike): Float32Array;\\n    new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float32Array;\\n\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * Returns a new array from a set of elements.\\n     * @param items A set of elements to include in the new array object.\\n     */\\n    of(...items: number[]): Float32Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     */\\n    from(arrayLike: ArrayLike<number>): Float32Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array;\\n\\n\\n}\\ndeclare var Float32Array: Float32ArrayConstructor;\\n\\n/**\\n * A typed array of 64-bit float values. The contents are initialized to 0. If the requested\\n * number of bytes could not be allocated an exception is raised.\\n */\\ninterface Float64Array {\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * The ArrayBuffer instance referenced by the array.\\n     */\\n    readonly buffer: ArrayBufferLike;\\n\\n    /**\\n     * The length in bytes of the array.\\n     */\\n    readonly byteLength: number;\\n\\n    /**\\n     * The offset in bytes of the array.\\n     */\\n    readonly byteOffset: number;\\n\\n    /**\\n     * Returns the this object after copying a section of the array identified by start and end\\n     * to the same array starting at position target\\n     * @param target If target is negative, it is treated as length+target where length is the\\n     * length of the array.\\n     * @param start If start is negative, it is treated as length+start. If end is negative, it\\n     * is treated as length+end.\\n     * @param end If not specified, length of the this object is used as its default value.\\n     */\\n    copyWithin(target: number, start: number, end?: number): this;\\n\\n    /**\\n     * Determines whether all the members of an array satisfy the specified test.\\n     * @param predicate A function that accepts up to three arguments. The every method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value false, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    every(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Returns the this object after filling the section identified by start and end with value\\n     * @param value value to fill array section with\\n     * @param start index to start filling the array at. If start is negative, it is treated as\\n     * length+start where length is the length of the array.\\n     * @param end index to stop filling the array at. If end is negative, it is treated as\\n     * length+end.\\n     */\\n    fill(value: number, start?: number, end?: number): this;\\n\\n    /**\\n     * Returns the elements of an array that meet the condition specified in a callback function.\\n     * @param predicate A function that accepts up to three arguments. The filter method calls\\n     * the predicate function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    filter(predicate: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array;\\n\\n    /**\\n     * Returns the value of the first element in the array where predicate is true, and undefined\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found, find\\n     * immediately returns that element value. Otherwise, find returns undefined.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    find(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined;\\n\\n    /**\\n     * Returns the index of the first element in the array where predicate is true, and -1\\n     * otherwise.\\n     * @param predicate find calls predicate once for each element of the array, in ascending\\n     * order, until it finds one where predicate returns true. If such an element is found,\\n     * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\\n     * @param thisArg If provided, it will be used as the this value for each invocation of\\n     * predicate. If it is not provided, undefined is used instead.\\n     */\\n    findIndex(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number;\\n\\n    /**\\n     * Performs the specified action for each element in an array.\\n     * @param callbackfn  A function that accepts up to three arguments. forEach calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg  An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;\\n\\n    /**\\n     * Returns the index of the first occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     *  search starts at index 0.\\n     */\\n    indexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * Adds all the elements of an array separated by the specified separator string.\\n     * @param separator A string used to separate one element of an array from the next in the\\n     * resulting String. If omitted, the array elements are separated with a comma.\\n     */\\n    join(separator?: string): string;\\n\\n    /**\\n     * Returns the index of the last occurrence of a value in an array.\\n     * @param searchElement The value to locate in the array.\\n     * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\\n     * search starts at index 0.\\n     */\\n    lastIndexOf(searchElement: number, fromIndex?: number): number;\\n\\n    /**\\n     * The length of the array.\\n     */\\n    readonly length: number;\\n\\n    /**\\n     * Calls a defined callback function on each element of an array, and returns an array that\\n     * contains the results.\\n     * @param callbackfn A function that accepts up to three arguments. The map method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param thisArg An object to which the this keyword can refer in the callbackfn function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;\\n    reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array. The return value of\\n     * the callback function is the accumulated result, and is provided as an argument in the next\\n     * call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\\n     * callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an\\n     * argument instead of an array value.\\n     */\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;\\n    reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;\\n\\n    /**\\n     * Calls the specified callback function for all the elements in an array, in descending order.\\n     * The return value of the callback function is the accumulated result, and is provided as an\\n     * argument in the next call to the callback function.\\n     * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\\n     * the callbackfn function one time for each element in the array.\\n     * @param initialValue If initialValue is specified, it is used as the initial value to start\\n     * the accumulation. The first call to the callbackfn function provides this value as an argument\\n     * instead of an array value.\\n     */\\n    reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;\\n\\n    /**\\n     * Reverses the elements in an Array.\\n     */\\n    reverse(): Float64Array;\\n\\n    /**\\n     * Sets a value or an array of values.\\n     * @param array A typed or untyped array of values to set.\\n     * @param offset The index in the current array at which the values are to be written.\\n     */\\n    set(array: ArrayLike<number>, offset?: number): void;\\n\\n    /**\\n     * Returns a section of an array.\\n     * @param start The beginning of the specified portion of the array.\\n     * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.\\n     */\\n    slice(start?: number, end?: number): Float64Array;\\n\\n    /**\\n     * Determines whether the specified callback function returns true for any element of an array.\\n     * @param predicate A function that accepts up to three arguments. The some method calls\\n     * the predicate function for each element in the array until the predicate returns a value\\n     * which is coercible to the Boolean value true, or until the end of the array.\\n     * @param thisArg An object to which the this keyword can refer in the predicate function.\\n     * If thisArg is omitted, undefined is used as the this value.\\n     */\\n    some(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean;\\n\\n    /**\\n     * Sorts an array.\\n     * @param compareFn Function used to determine the order of the elements. It is expected to return\\n     * a negative value if first argument is less than second argument, zero if they're equal and a positive\\n     * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\\n     * ```ts\\n     * [11,2,22,1].sort((a, b) => a - b)\\n     * ```\\n     */\\n    sort(compareFn?: (a: number, b: number) => number): this;\\n\\n    /**\\n     * at begin, inclusive, up to end, exclusive.\\n     * @param begin The index of the beginning of the array.\\n     * @param end The index of the end of the array.\\n     */\\n    subarray(begin?: number, end?: number): Float64Array;\\n\\n    toString(): string;\\n\\n    /** Returns the primitive value of the specified object. */\\n    valueOf(): Float64Array;\\n\\n    [index: number]: number;\\n}\\n\\ninterface Float64ArrayConstructor {\\n    readonly prototype: Float64Array;\\n    new(length: number): Float64Array;\\n    new(array: ArrayLike<number> | ArrayBufferLike): Float64Array;\\n    new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float64Array;\\n\\n    /**\\n     * The size in bytes of each element in the array.\\n     */\\n    readonly BYTES_PER_ELEMENT: number;\\n\\n    /**\\n     * Returns a new array from a set of elements.\\n     * @param items A set of elements to include in the new array object.\\n     */\\n    of(...items: number[]): Float64Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     */\\n    from(arrayLike: ArrayLike<number>): Float64Array;\\n\\n    /**\\n     * Creates an array from an array-like or iterable object.\\n     * @param arrayLike An array-like or iterable object to convert to an array.\\n     * @param mapfn A mapping function to call on every element of the array.\\n     * @param thisArg Value of 'this' used to invoke the mapfn.\\n     */\\n    from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array;\\n\\n}\\ndeclare var Float64Array: Float64ArrayConstructor;\\n\\n/////////////////////////////\\n/// ECMAScript Internationalization API\\n/////////////////////////////\\n\\ndeclare namespace Intl {\\n    interface CollatorOptions {\\n        usage?: string;\\n        localeMatcher?: string;\\n        numeric?: boolean;\\n        caseFirst?: string;\\n        sensitivity?: string;\\n        ignorePunctuation?: boolean;\\n    }\\n\\n    interface ResolvedCollatorOptions {\\n        locale: string;\\n        usage: string;\\n        sensitivity: string;\\n        ignorePunctuation: boolean;\\n        collation: string;\\n        caseFirst: string;\\n        numeric: boolean;\\n    }\\n\\n    interface Collator {\\n        compare(x: string, y: string): number;\\n        resolvedOptions(): ResolvedCollatorOptions;\\n    }\\n    var Collator: {\\n        new(locales?: string | string[], options?: CollatorOptions): Collator;\\n        (locales?: string | string[], options?: CollatorOptions): Collator;\\n        supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[];\\n    };\\n\\n    interface NumberFormatOptions {\\n        localeMatcher?: string;\\n        style?: string;\\n        currency?: string;\\n        currencyDisplay?: string;\\n        currencySign?: string;\\n        useGrouping?: boolean;\\n        minimumIntegerDigits?: number;\\n        minimumFractionDigits?: number;\\n        maximumFractionDigits?: number;\\n        minimumSignificantDigits?: number;\\n        maximumSignificantDigits?: number;\\n    }\\n\\n    interface ResolvedNumberFormatOptions {\\n        locale: string;\\n        numberingSystem: string;\\n        style: string;\\n        currency?: string;\\n        currencyDisplay?: string;\\n        minimumIntegerDigits: number;\\n        minimumFractionDigits: number;\\n        maximumFractionDigits: number;\\n        minimumSignificantDigits?: number;\\n        maximumSignificantDigits?: number;\\n        useGrouping: boolean;\\n    }\\n\\n    interface NumberFormat {\\n        format(value: number): string;\\n        resolvedOptions(): ResolvedNumberFormatOptions;\\n    }\\n    var NumberFormat: {\\n        new(locales?: string | string[], options?: NumberFormatOptions): NumberFormat;\\n        (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;\\n        supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];\\n    };\\n\\n    interface DateTimeFormatOptions {\\n        localeMatcher?: \\\"best fit\\\" | \\\"lookup\\\";\\n        weekday?: \\\"long\\\" | \\\"short\\\" | \\\"narrow\\\";\\n        era?: \\\"long\\\" | \\\"short\\\" | \\\"narrow\\\";\\n        year?: \\\"numeric\\\" | \\\"2-digit\\\";\\n        month?: \\\"numeric\\\" | \\\"2-digit\\\" | \\\"long\\\" | \\\"short\\\" | \\\"narrow\\\";\\n        day?: \\\"numeric\\\" | \\\"2-digit\\\";\\n        hour?: \\\"numeric\\\" | \\\"2-digit\\\";\\n        minute?: \\\"numeric\\\" | \\\"2-digit\\\";\\n        second?: \\\"numeric\\\" | \\\"2-digit\\\";\\n        timeZoneName?: \\\"long\\\" | \\\"short\\\";\\n        formatMatcher?: \\\"best fit\\\" | \\\"basic\\\";\\n        hour12?: boolean;\\n        timeZone?: string;\\n    }\\n\\n    interface ResolvedDateTimeFormatOptions {\\n        locale: string;\\n        calendar: string;\\n        numberingSystem: string;\\n        timeZone: string;\\n        hour12?: boolean;\\n        weekday?: string;\\n        era?: string;\\n        year?: string;\\n        month?: string;\\n        day?: string;\\n        hour?: string;\\n        minute?: string;\\n        second?: string;\\n        timeZoneName?: string;\\n    }\\n\\n    interface DateTimeFormat {\\n        format(date?: Date | number): string;\\n        resolvedOptions(): ResolvedDateTimeFormatOptions;\\n    }\\n    var DateTimeFormat: {\\n        new(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;\\n        (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;\\n        supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];\\n    };\\n}\\n\\ninterface String {\\n    /**\\n     * Determines whether two strings are equivalent in the current or specified locale.\\n     * @param that String to compare to target string\\n     * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.\\n     * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.\\n     */\\n    localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number;\\n}\\n\\ninterface Number {\\n    /**\\n     * Converts a number to a string by using the current or specified locale.\\n     * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\\n     * @param options An object that contains one or more properties that specify comparison options.\\n     */\\n    toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;\\n}\\n\\ninterface Date {\\n    /**\\n     * Converts a date and time to a string by using the current or specified locale.\\n     * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\\n     * @param options An object that contains one or more properties that specify comparison options.\\n     */\\n    toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\\n    /**\\n     * Converts a date to a string by using the current or specified locale.\\n     * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\\n     * @param options An object that contains one or more properties that specify comparison options.\\n     */\\n    toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\\n\\n    /**\\n     * Converts a time to a string by using the current or specified locale.\\n     * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\\n     * @param options An object that contains one or more properties that specify comparison options.\\n     */\\n    toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\\n}\\n\";\r\nlibFileMap['lib.es6.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2015\\\" />\\n/// <reference lib=\\\"dom\\\" />\\n/// <reference lib=\\\"dom.iterable\\\" />\\n/// <reference lib=\\\"webworker.importscripts\\\" />\\n/// <reference lib=\\\"scripthost\\\" />\\n\";\r\nlibFileMap['lib.esnext.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"es2020\\\" />\\n/// <reference lib=\\\"esnext.intl\\\" />\\n/// <reference lib=\\\"esnext.string\\\" />\\n/// <reference lib=\\\"esnext.promise\\\" />\\n/// <reference lib=\\\"esnext.weakref\\\" />\\n\";\r\nlibFileMap['lib.esnext.full.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/// <reference lib=\\\"esnext\\\" />\\n/// <reference lib=\\\"dom\\\" />\\n/// <reference lib=\\\"webworker.importscripts\\\" />\\n/// <reference lib=\\\"scripthost\\\" />\\n/// <reference lib=\\\"dom.iterable\\\" />\";\r\nlibFileMap['lib.esnext.intl.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ndeclare namespace Intl {\\n    type NumberFormatPartTypes = \\\"compact\\\" | \\\"currency\\\" | \\\"decimal\\\" | \\\"exponentInteger\\\" | \\\"exponentMinusSign\\\" | \\\"exponentSeparator\\\" | \\\"fraction\\\" | \\\"group\\\" | \\\"infinity\\\" | \\\"integer\\\" | \\\"literal\\\" | \\\"minusSign\\\" | \\\"nan\\\" | \\\"plusSign\\\" | \\\"percentSign\\\" | \\\"unit\\\" | \\\"unknown\\\";\\n\\n    interface NumberFormatPart {\\n        type: NumberFormatPartTypes;\\n        value: string;\\n    }\\n\\n    interface NumberFormat {\\n        formatToParts(number?: number): NumberFormatPart[];\\n    }\\n}\\n\";\r\nlibFileMap['lib.esnext.promise.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface AggregateError extends Error {\\n    errors: any[]\\n}\\n\\ninterface AggregateErrorConstructor {\\n    new(errors: Iterable<any>, message?: string): AggregateError;\\n    (errors: Iterable<any>, message?: string): AggregateError;\\n    readonly prototype: AggregateError;\\n}\\n\\ndeclare var AggregateError: AggregateErrorConstructor;\\n\\n/**\\n * Represents the completion of an asynchronous operation\\n */\\ninterface PromiseConstructor {\\n    /**\\n     * The any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.\\n     * @param values An array or iterable of Promises.\\n     * @returns A new Promise.\\n     */\\n    any<T>(values: (T | PromiseLike<T>)[] | Iterable<T | PromiseLike<T>>): Promise<T>\\n}\\n\";\r\nlibFileMap['lib.esnext.string.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface String {\\n    /**\\n     * Replace all instances of a substring in a string, using a regular expression or search string.\\n     * @param searchValue A string to search for.\\n     * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\\n     */\\n    replaceAll(searchValue: string | RegExp, replaceValue: string): string;\\n\\n    /**\\n     * Replace all instances of a substring in a string, using a regular expression or search string.\\n     * @param searchValue A string to search for.\\n     * @param replacer A function that returns the replacement text.\\n     */\\n    replaceAll(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;\\n}\\n\";\r\nlibFileMap['lib.esnext.weakref.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\ninterface WeakRef<T extends object> {\\n    readonly [Symbol.toStringTag]: \\\"WeakRef\\\";\\n\\n    /**\\n     * Returns the WeakRef instance's target object, or undefined if the target object has been\\n     * reclaimed.\\n     */\\n    deref(): T | undefined;\\n}\\n\\ninterface WeakRefConstructor {\\n    readonly prototype: WeakRef<any>;\\n\\n    /**\\n     * Creates a WeakRef instance for the given target object.\\n     * @param target The target object for the WeakRef instance.\\n     */\\n    new<T extends object>(target?: T): WeakRef<T>;\\n}\\n\\ndeclare var WeakRef: WeakRefConstructor;\\n\\ninterface FinalizationRegistry {\\n    readonly [Symbol.toStringTag]: \\\"FinalizationRegistry\\\";\\n\\n    /**\\n     * Registers an object with the registry.\\n     * @param target The target object to register.\\n     * @param heldValue The value to pass to the finalizer for this object. This cannot be the\\n     * target object.\\n     * @param unregisterToken The token to pass to the unregister method to unregister the target\\n     * object. If provided (and not undefined), this must be an object. If not provided, the target\\n     * cannot be unregistered.\\n     */\\n    register(target: object, heldValue: any, unregisterToken?: object): void;\\n\\n    /**\\n     * Unregisters an object from the registry.\\n     * @param unregisterToken The token that was used as the unregisterToken argument when calling\\n     * register to register the target object.\\n     */\\n    unregister(unregisterToken: object): void;\\n}\\n\\ninterface FinalizationRegistryConstructor {\\n    readonly prototype: FinalizationRegistry;\\n\\n    /**\\n     * Creates a finalization registry with an associated cleanup callback\\n     * @param cleanupCallback The callback to call after an object in the registry has been reclaimed.\\n     */\\n    new(cleanupCallback: (heldValue: any) => void): FinalizationRegistry;\\n}\\n\\ndeclare var FinalizationRegistry: FinalizationRegistryConstructor;\\n\";\r\nlibFileMap['lib.scripthost.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n\\n\\n/////////////////////////////\\n/// Windows Script Host APIS\\n/////////////////////////////\\n\\n\\ninterface ActiveXObject {\\n    new (s: string): any;\\n}\\ndeclare var ActiveXObject: ActiveXObject;\\n\\ninterface ITextWriter {\\n    Write(s: string): void;\\n    WriteLine(s: string): void;\\n    Close(): void;\\n}\\n\\ninterface TextStreamBase {\\n    /**\\n     * The column number of the current character position in an input stream.\\n     */\\n    Column: number;\\n\\n    /**\\n     * The current line number in an input stream.\\n     */\\n    Line: number;\\n\\n    /**\\n     * Closes a text stream.\\n     * It is not necessary to close standard streams; they close automatically when the process ends. If\\n     * you close a standard stream, be aware that any other pointers to that standard stream become invalid.\\n     */\\n    Close(): void;\\n}\\n\\ninterface TextStreamWriter extends TextStreamBase {\\n    /**\\n     * Sends a string to an output stream.\\n     */\\n    Write(s: string): void;\\n\\n    /**\\n     * Sends a specified number of blank lines (newline characters) to an output stream.\\n     */\\n    WriteBlankLines(intLines: number): void;\\n\\n    /**\\n     * Sends a string followed by a newline character to an output stream.\\n     */\\n    WriteLine(s: string): void;\\n}\\n\\ninterface TextStreamReader extends TextStreamBase {\\n    /**\\n     * Returns a specified number of characters from an input stream, starting at the current pointer position.\\n     * Does not return until the ENTER key is pressed.\\n     * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\\n     */\\n    Read(characters: number): string;\\n\\n    /**\\n     * Returns all characters from an input stream.\\n     * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\\n     */\\n    ReadAll(): string;\\n\\n    /**\\n     * Returns an entire line from an input stream.\\n     * Although this method extracts the newline character, it does not add it to the returned string.\\n     * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\\n     */\\n    ReadLine(): string;\\n\\n    /**\\n     * Skips a specified number of characters when reading from an input text stream.\\n     * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\\n     * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.)\\n     */\\n    Skip(characters: number): void;\\n\\n    /**\\n     * Skips the next line when reading from an input text stream.\\n     * Can only be used on a stream in reading mode, not writing or appending mode.\\n     */\\n    SkipLine(): void;\\n\\n    /**\\n     * Indicates whether the stream pointer position is at the end of a line.\\n     */\\n    AtEndOfLine: boolean;\\n\\n    /**\\n     * Indicates whether the stream pointer position is at the end of a stream.\\n     */\\n    AtEndOfStream: boolean;\\n}\\n\\ndeclare var WScript: {\\n    /**\\n     * Outputs text to either a message box (under WScript.exe) or the command console window followed by\\n     * a newline (under CScript.exe).\\n     */\\n    Echo(s: any): void;\\n\\n    /**\\n     * Exposes the write-only error output stream for the current script.\\n     * Can be accessed only while using CScript.exe.\\n     */\\n    StdErr: TextStreamWriter;\\n\\n    /**\\n     * Exposes the write-only output stream for the current script.\\n     * Can be accessed only while using CScript.exe.\\n     */\\n    StdOut: TextStreamWriter;\\n    Arguments: { length: number; Item(n: number): string; };\\n\\n    /**\\n     *  The full path of the currently running script.\\n     */\\n    ScriptFullName: string;\\n\\n    /**\\n     * Forces the script to stop immediately, with an optional exit code.\\n     */\\n    Quit(exitCode?: number): number;\\n\\n    /**\\n     * The Windows Script Host build version number.\\n     */\\n    BuildVersion: number;\\n\\n    /**\\n     * Fully qualified path of the host executable.\\n     */\\n    FullName: string;\\n\\n    /**\\n     * Gets/sets the script mode - interactive(true) or batch(false).\\n     */\\n    Interactive: boolean;\\n\\n    /**\\n     * The name of the host executable (WScript.exe or CScript.exe).\\n     */\\n    Name: string;\\n\\n    /**\\n     * Path of the directory containing the host executable.\\n     */\\n    Path: string;\\n\\n    /**\\n     * The filename of the currently running script.\\n     */\\n    ScriptName: string;\\n\\n    /**\\n     * Exposes the read-only input stream for the current script.\\n     * Can be accessed only while using CScript.exe.\\n     */\\n    StdIn: TextStreamReader;\\n\\n    /**\\n     * Windows Script Host version\\n     */\\n    Version: string;\\n\\n    /**\\n     * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event.\\n     */\\n    ConnectObject(objEventSource: any, strPrefix: string): void;\\n\\n    /**\\n     * Creates a COM object.\\n     * @param strProgiID\\n     * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.\\n     */\\n    CreateObject(strProgID: string, strPrefix?: string): any;\\n\\n    /**\\n     * Disconnects a COM object from its event sources.\\n     */\\n    DisconnectObject(obj: any): void;\\n\\n    /**\\n     * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file.\\n     * @param strPathname Fully qualified path to the file containing the object persisted to disk.\\n     *                       For objects in memory, pass a zero-length string.\\n     * @param strProgID\\n     * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.\\n     */\\n    GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any;\\n\\n    /**\\n     * Suspends script execution for a specified length of time, then continues execution.\\n     * @param intTime Interval (in milliseconds) to suspend script execution.\\n     */\\n    Sleep(intTime: number): void;\\n};\\n\\n/**\\n * WSH is an alias for WScript under Windows Script Host\\n */\\ndeclare var WSH: typeof WScript;\\n\\n/**\\n * Represents an Automation SAFEARRAY\\n */\\ndeclare class SafeArray<T = any> {\\n    private constructor();\\n    private SafeArray_typekey: SafeArray<T>;\\n}\\n\\n/**\\n * Allows enumerating over a COM collection, which may not have indexed item access.\\n */\\ninterface Enumerator<T = any> {\\n    /**\\n     * Returns true if the current item is the last one in the collection, or the collection is empty,\\n     * or the current item is undefined.\\n     */\\n    atEnd(): boolean;\\n\\n    /**\\n     * Returns the current item in the collection\\n     */\\n    item(): T;\\n\\n    /**\\n     * Resets the current item in the collection to the first item. If there are no items in the collection,\\n     * the current item is set to undefined.\\n     */\\n    moveFirst(): void;\\n\\n    /**\\n     * Moves the current item to the next item in the collection. If the enumerator is at the end of\\n     * the collection or the collection is empty, the current item is set to undefined.\\n     */\\n    moveNext(): void;\\n}\\n\\ninterface EnumeratorConstructor {\\n    new <T = any>(safearray: SafeArray<T>): Enumerator<T>;\\n    new <T = any>(collection: { Item(index: any): T }): Enumerator<T>;\\n    new <T = any>(collection: any): Enumerator<T>;\\n}\\n\\ndeclare var Enumerator: EnumeratorConstructor;\\n\\n/**\\n * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions.\\n */\\ninterface VBArray<T = any> {\\n    /**\\n     * Returns the number of dimensions (1-based).\\n     */\\n    dimensions(): number;\\n\\n    /**\\n     * Takes an index for each dimension in the array, and returns the item at the corresponding location.\\n     */\\n    getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T;\\n\\n    /**\\n     * Returns the smallest available index for a given dimension.\\n     * @param dimension 1-based dimension (defaults to 1)\\n     */\\n    lbound(dimension?: number): number;\\n\\n    /**\\n     * Returns the largest available index for a given dimension.\\n     * @param dimension 1-based dimension (defaults to 1)\\n     */\\n    ubound(dimension?: number): number;\\n\\n    /**\\n     * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions,\\n     * each successive dimension is appended to the end of the array.\\n     * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6]\\n     */\\n    toArray(): T[];\\n}\\n\\ninterface VBArrayConstructor {\\n    new <T = any>(safeArray: SafeArray<T>): VBArray<T>;\\n}\\n\\ndeclare var VBArray: VBArrayConstructor;\\n\\n/**\\n * Automation date (VT_DATE)\\n */\\ndeclare class VarDate {\\n    private constructor();\\n    private VarDate_typekey: VarDate;\\n}\\n\\ninterface DateConstructor {\\n    new (vd: VarDate): Date;\\n}\\n\\ninterface Date {\\n    getVarDate: () => VarDate;\\n}\\n\";\r\nlibFileMap['lib.webworker.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/////////////////////////////\\n/// Worker APIs\\n/////////////////////////////\\n\\ninterface AddEventListenerOptions extends EventListenerOptions {\\n    once?: boolean;\\n    passive?: boolean;\\n}\\n\\ninterface AesCbcParams extends Algorithm {\\n    iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n}\\n\\ninterface AesCtrParams extends Algorithm {\\n    counter: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n    length: number;\\n}\\n\\ninterface AesDerivedKeyParams extends Algorithm {\\n    length: number;\\n}\\n\\ninterface AesGcmParams extends Algorithm {\\n    additionalData?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n    iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n    tagLength?: number;\\n}\\n\\ninterface AesKeyAlgorithm extends KeyAlgorithm {\\n    length: number;\\n}\\n\\ninterface AesKeyGenParams extends Algorithm {\\n    length: number;\\n}\\n\\ninterface Algorithm {\\n    name: string;\\n}\\n\\ninterface BlobPropertyBag {\\n    endings?: EndingType;\\n    type?: string;\\n}\\n\\ninterface CacheQueryOptions {\\n    ignoreMethod?: boolean;\\n    ignoreSearch?: boolean;\\n    ignoreVary?: boolean;\\n}\\n\\ninterface CanvasRenderingContext2DSettings {\\n    alpha?: boolean;\\n    desynchronized?: boolean;\\n}\\n\\ninterface ClientQueryOptions {\\n    includeUncontrolled?: boolean;\\n    type?: ClientTypes;\\n}\\n\\ninterface CloseEventInit extends EventInit {\\n    code?: number;\\n    reason?: string;\\n    wasClean?: boolean;\\n}\\n\\ninterface CryptoKeyPair {\\n    privateKey?: CryptoKey;\\n    publicKey?: CryptoKey;\\n}\\n\\ninterface CustomEventInit<T = any> extends EventInit {\\n    detail?: T;\\n}\\n\\ninterface DOMMatrix2DInit {\\n    a?: number;\\n    b?: number;\\n    c?: number;\\n    d?: number;\\n    e?: number;\\n    f?: number;\\n    m11?: number;\\n    m12?: number;\\n    m21?: number;\\n    m22?: number;\\n    m41?: number;\\n    m42?: number;\\n}\\n\\ninterface DOMMatrixInit extends DOMMatrix2DInit {\\n    is2D?: boolean;\\n    m13?: number;\\n    m14?: number;\\n    m23?: number;\\n    m24?: number;\\n    m31?: number;\\n    m32?: number;\\n    m33?: number;\\n    m34?: number;\\n    m43?: number;\\n    m44?: number;\\n}\\n\\ninterface DOMPointInit {\\n    w?: number;\\n    x?: number;\\n    y?: number;\\n    z?: number;\\n}\\n\\ninterface DOMQuadInit {\\n    p1?: DOMPointInit;\\n    p2?: DOMPointInit;\\n    p3?: DOMPointInit;\\n    p4?: DOMPointInit;\\n}\\n\\ninterface DOMRectInit {\\n    height?: number;\\n    width?: number;\\n    x?: number;\\n    y?: number;\\n}\\n\\ninterface DevicePermissionDescriptor extends PermissionDescriptor {\\n    deviceId?: string;\\n    name: \\\"camera\\\" | \\\"microphone\\\" | \\\"speaker\\\";\\n}\\n\\ninterface EcKeyGenParams extends Algorithm {\\n    namedCurve: NamedCurve;\\n}\\n\\ninterface EcKeyImportParams extends Algorithm {\\n    namedCurve: NamedCurve;\\n}\\n\\ninterface EcdhKeyDeriveParams extends Algorithm {\\n    public: CryptoKey;\\n}\\n\\ninterface EcdsaParams extends Algorithm {\\n    hash: HashAlgorithmIdentifier;\\n}\\n\\ninterface ErrorEventInit extends EventInit {\\n    colno?: number;\\n    error?: any;\\n    filename?: string;\\n    lineno?: number;\\n    message?: string;\\n}\\n\\ninterface EventInit {\\n    bubbles?: boolean;\\n    cancelable?: boolean;\\n    composed?: boolean;\\n}\\n\\ninterface EventListenerOptions {\\n    capture?: boolean;\\n}\\n\\ninterface EventSourceInit {\\n    withCredentials?: boolean;\\n}\\n\\ninterface ExtendableEventInit extends EventInit {\\n}\\n\\ninterface ExtendableMessageEventInit extends ExtendableEventInit {\\n    data?: any;\\n    lastEventId?: string;\\n    origin?: string;\\n    ports?: MessagePort[];\\n    source?: Client | ServiceWorker | MessagePort | null;\\n}\\n\\ninterface FetchEventInit extends ExtendableEventInit {\\n    clientId?: string;\\n    preloadResponse?: Promise<any>;\\n    replacesClientId?: string;\\n    request: Request;\\n    resultingClientId?: string;\\n}\\n\\ninterface FilePropertyBag extends BlobPropertyBag {\\n    lastModified?: number;\\n}\\n\\ninterface GetNotificationOptions {\\n    tag?: string;\\n}\\n\\ninterface HkdfParams extends Algorithm {\\n    hash: HashAlgorithmIdentifier;\\n    info: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n    salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n}\\n\\ninterface HmacImportParams extends Algorithm {\\n    hash: HashAlgorithmIdentifier;\\n    length?: number;\\n}\\n\\ninterface HmacKeyGenParams extends Algorithm {\\n    hash: HashAlgorithmIdentifier;\\n    length?: number;\\n}\\n\\ninterface IDBIndexParameters {\\n    multiEntry?: boolean;\\n    unique?: boolean;\\n}\\n\\ninterface IDBObjectStoreParameters {\\n    autoIncrement?: boolean;\\n    keyPath?: string | string[] | null;\\n}\\n\\ninterface IDBVersionChangeEventInit extends EventInit {\\n    newVersion?: number | null;\\n    oldVersion?: number;\\n}\\n\\ninterface ImageBitmapOptions {\\n    colorSpaceConversion?: ColorSpaceConversion;\\n    imageOrientation?: ImageOrientation;\\n    premultiplyAlpha?: PremultiplyAlpha;\\n    resizeHeight?: number;\\n    resizeQuality?: ResizeQuality;\\n    resizeWidth?: number;\\n}\\n\\ninterface ImageBitmapRenderingContextSettings {\\n    alpha?: boolean;\\n}\\n\\ninterface ImageEncodeOptions {\\n    quality?: number;\\n    type?: string;\\n}\\n\\ninterface ImportMeta {\\n    url: string;\\n}\\n\\ninterface JsonWebKey {\\n    alg?: string;\\n    crv?: string;\\n    d?: string;\\n    dp?: string;\\n    dq?: string;\\n    e?: string;\\n    ext?: boolean;\\n    k?: string;\\n    key_ops?: string[];\\n    kty?: string;\\n    n?: string;\\n    oth?: RsaOtherPrimesInfo[];\\n    p?: string;\\n    q?: string;\\n    qi?: string;\\n    use?: string;\\n    x?: string;\\n    y?: string;\\n}\\n\\ninterface KeyAlgorithm {\\n    name: string;\\n}\\n\\ninterface MessageEventInit<T = any> extends EventInit {\\n    data?: T;\\n    lastEventId?: string;\\n    origin?: string;\\n    ports?: MessagePort[];\\n    source?: MessageEventSource | null;\\n}\\n\\ninterface MidiPermissionDescriptor extends PermissionDescriptor {\\n    name: \\\"midi\\\";\\n    sysex?: boolean;\\n}\\n\\ninterface MultiCacheQueryOptions extends CacheQueryOptions {\\n    cacheName?: string;\\n}\\n\\ninterface NavigationPreloadState {\\n    enabled?: boolean;\\n    headerValue?: string;\\n}\\n\\ninterface NotificationAction {\\n    action: string;\\n    icon?: string;\\n    title: string;\\n}\\n\\ninterface NotificationEventInit extends ExtendableEventInit {\\n    action?: string;\\n    notification: Notification;\\n}\\n\\ninterface NotificationOptions {\\n    actions?: NotificationAction[];\\n    badge?: string;\\n    body?: string;\\n    data?: any;\\n    dir?: NotificationDirection;\\n    icon?: string;\\n    image?: string;\\n    lang?: string;\\n    renotify?: boolean;\\n    requireInteraction?: boolean;\\n    silent?: boolean;\\n    tag?: string;\\n    timestamp?: number;\\n    vibrate?: VibratePattern;\\n}\\n\\ninterface Pbkdf2Params extends Algorithm {\\n    hash: HashAlgorithmIdentifier;\\n    iterations: number;\\n    salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n}\\n\\ninterface PerformanceObserverInit {\\n    buffered?: boolean;\\n    entryTypes?: string[];\\n    type?: string;\\n}\\n\\ninterface PermissionDescriptor {\\n    name: PermissionName;\\n}\\n\\ninterface PostMessageOptions {\\n    transfer?: any[];\\n}\\n\\ninterface ProgressEventInit extends EventInit {\\n    lengthComputable?: boolean;\\n    loaded?: number;\\n    total?: number;\\n}\\n\\ninterface PromiseRejectionEventInit extends EventInit {\\n    promise: Promise<any>;\\n    reason?: any;\\n}\\n\\ninterface PushEventInit extends ExtendableEventInit {\\n    data?: PushMessageDataInit;\\n}\\n\\ninterface PushPermissionDescriptor extends PermissionDescriptor {\\n    name: \\\"push\\\";\\n    userVisibleOnly?: boolean;\\n}\\n\\ninterface PushSubscriptionChangeEventInit extends ExtendableEventInit {\\n    newSubscription?: PushSubscription;\\n    oldSubscription?: PushSubscription;\\n}\\n\\ninterface PushSubscriptionJSON {\\n    endpoint?: string;\\n    expirationTime?: number | null;\\n    keys?: Record<string, string>;\\n}\\n\\ninterface PushSubscriptionOptionsInit {\\n    applicationServerKey?: BufferSource | string | null;\\n    userVisibleOnly?: boolean;\\n}\\n\\ninterface QueuingStrategy<T = any> {\\n    highWaterMark?: number;\\n    size?: QueuingStrategySize<T>;\\n}\\n\\ninterface QueuingStrategyInit {\\n    /**\\n     * Creates a new ByteLengthQueuingStrategy with the provided high water mark.\\n     * \\n     * Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw.\\n     */\\n    highWaterMark: number;\\n}\\n\\ninterface ReadableStreamDefaultReadDoneResult {\\n    done: true;\\n    value?: undefined;\\n}\\n\\ninterface ReadableStreamDefaultReadValueResult<T> {\\n    done: false;\\n    value: T;\\n}\\n\\ninterface ReadableWritablePair<R = any, W = any> {\\n    readable: ReadableStream<R>;\\n    /**\\n     * Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.\\n     * \\n     * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.\\n     */\\n    writable: WritableStream<W>;\\n}\\n\\ninterface RegistrationOptions {\\n    scope?: string;\\n    type?: WorkerType;\\n    updateViaCache?: ServiceWorkerUpdateViaCache;\\n}\\n\\ninterface RequestInit {\\n    /**\\n     * A BodyInit object or null to set request's body.\\n     */\\n    body?: BodyInit | null;\\n    /**\\n     * A string indicating how the request will interact with the browser's cache to set request's cache.\\n     */\\n    cache?: RequestCache;\\n    /**\\n     * A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials.\\n     */\\n    credentials?: RequestCredentials;\\n    /**\\n     * A Headers object, an object literal, or an array of two-item arrays to set request's headers.\\n     */\\n    headers?: HeadersInit;\\n    /**\\n     * A cryptographic hash of the resource to be fetched by request. Sets request's integrity.\\n     */\\n    integrity?: string;\\n    /**\\n     * A boolean to set request's keepalive.\\n     */\\n    keepalive?: boolean;\\n    /**\\n     * A string to set request's method.\\n     */\\n    method?: string;\\n    /**\\n     * A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode.\\n     */\\n    mode?: RequestMode;\\n    /**\\n     * A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect.\\n     */\\n    redirect?: RequestRedirect;\\n    /**\\n     * A string whose value is a same-origin URL, \\\"about:client\\\", or the empty string, to set request's referrer.\\n     */\\n    referrer?: string;\\n    /**\\n     * A referrer policy to set request's referrerPolicy.\\n     */\\n    referrerPolicy?: ReferrerPolicy;\\n    /**\\n     * An AbortSignal to set request's signal.\\n     */\\n    signal?: AbortSignal | null;\\n    /**\\n     * Can only be null. Used to disassociate request from any Window.\\n     */\\n    window?: any;\\n}\\n\\ninterface ResponseInit {\\n    headers?: HeadersInit;\\n    status?: number;\\n    statusText?: string;\\n}\\n\\ninterface RsaHashedImportParams extends Algorithm {\\n    hash: HashAlgorithmIdentifier;\\n}\\n\\ninterface RsaHashedKeyGenParams extends RsaKeyGenParams {\\n    hash: HashAlgorithmIdentifier;\\n}\\n\\ninterface RsaKeyGenParams extends Algorithm {\\n    modulusLength: number;\\n    publicExponent: BigInteger;\\n}\\n\\ninterface RsaOaepParams extends Algorithm {\\n    label?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n}\\n\\ninterface RsaOtherPrimesInfo {\\n    d?: string;\\n    r?: string;\\n    t?: string;\\n}\\n\\ninterface RsaPssParams extends Algorithm {\\n    saltLength: number;\\n}\\n\\ninterface StorageEstimate {\\n    quota?: number;\\n    usage?: number;\\n}\\n\\ninterface StreamPipeOptions {\\n    preventAbort?: boolean;\\n    preventCancel?: boolean;\\n    /**\\n     * Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.\\n     * \\n     * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.\\n     * \\n     * Errors and closures of the source and destination streams propagate as follows:\\n     * \\n     * An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination.\\n     * \\n     * An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source.\\n     * \\n     * When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error.\\n     * \\n     * If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source.\\n     * \\n     * The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set.\\n     */\\n    preventClose?: boolean;\\n    signal?: AbortSignal;\\n}\\n\\ninterface SyncEventInit extends ExtendableEventInit {\\n    lastChance?: boolean;\\n    tag: string;\\n}\\n\\ninterface TextDecodeOptions {\\n    stream?: boolean;\\n}\\n\\ninterface TextDecoderOptions {\\n    fatal?: boolean;\\n    ignoreBOM?: boolean;\\n}\\n\\ninterface TextEncoderEncodeIntoResult {\\n    read?: number;\\n    written?: number;\\n}\\n\\ninterface Transformer<I = any, O = any> {\\n    flush?: TransformerFlushCallback<O>;\\n    readableType?: undefined;\\n    start?: TransformerStartCallback<O>;\\n    transform?: TransformerTransformCallback<I, O>;\\n    writableType?: undefined;\\n}\\n\\ninterface UnderlyingSink<W = any> {\\n    abort?: UnderlyingSinkAbortCallback;\\n    close?: UnderlyingSinkCloseCallback;\\n    start?: UnderlyingSinkStartCallback;\\n    type?: undefined;\\n    write?: UnderlyingSinkWriteCallback<W>;\\n}\\n\\ninterface UnderlyingSource<R = any> {\\n    cancel?: UnderlyingSourceCancelCallback;\\n    pull?: UnderlyingSourcePullCallback<R>;\\n    start?: UnderlyingSourceStartCallback<R>;\\n    type?: undefined;\\n}\\n\\ninterface WebGLContextAttributes {\\n    alpha?: boolean;\\n    antialias?: boolean;\\n    depth?: boolean;\\n    desynchronized?: boolean;\\n    failIfMajorPerformanceCaveat?: boolean;\\n    powerPreference?: WebGLPowerPreference;\\n    premultipliedAlpha?: boolean;\\n    preserveDrawingBuffer?: boolean;\\n    stencil?: boolean;\\n}\\n\\ninterface WebGLContextEventInit extends EventInit {\\n    statusMessage?: string;\\n}\\n\\ninterface WorkerOptions {\\n    credentials?: RequestCredentials;\\n    name?: string;\\n    type?: WorkerType;\\n}\\n\\ninterface EventListener {\\n    (evt: Event): void;\\n}\\n\\n/** The ANGLE_instanced_arrays extension is part of the WebGL API and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type. */\\ninterface ANGLE_instanced_arrays {\\n    drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void;\\n    drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei): void;\\n    vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint): void;\\n    readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum;\\n}\\n\\n/** A controller object that allows you to abort one or more DOM requests as and when desired. */\\ninterface AbortController {\\n    /**\\n     * Returns the AbortSignal object associated with this object.\\n     */\\n    readonly signal: AbortSignal;\\n    /**\\n     * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.\\n     */\\n    abort(): void;\\n}\\n\\ndeclare var AbortController: {\\n    prototype: AbortController;\\n    new(): AbortController;\\n};\\n\\ninterface AbortSignalEventMap {\\n    \\\"abort\\\": Event;\\n}\\n\\n/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */\\ninterface AbortSignal extends EventTarget {\\n    /**\\n     * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.\\n     */\\n    readonly aborted: boolean;\\n    onabort: ((this: AbortSignal, ev: Event) => any) | null;\\n    addEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var AbortSignal: {\\n    prototype: AbortSignal;\\n    new(): AbortSignal;\\n};\\n\\ninterface AbstractWorkerEventMap {\\n    \\\"error\\\": ErrorEvent;\\n}\\n\\ninterface AbstractWorker {\\n    onerror: ((this: AbstractWorker, ev: ErrorEvent) => any) | null;\\n    addEventListener<K extends keyof AbstractWorkerEventMap>(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof AbstractWorkerEventMap>(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ninterface AesCfbParams extends Algorithm {\\n    iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\\n}\\n\\ninterface AesCmacParams extends Algorithm {\\n    length: number;\\n}\\n\\ninterface AnimationFrameProvider {\\n    cancelAnimationFrame(handle: number): void;\\n    requestAnimationFrame(callback: FrameRequestCallback): number;\\n}\\n\\n/** A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system. */\\ninterface Blob {\\n    readonly size: number;\\n    readonly type: string;\\n    arrayBuffer(): Promise<ArrayBuffer>;\\n    slice(start?: number, end?: number, contentType?: string): Blob;\\n    stream(): ReadableStream;\\n    text(): Promise<string>;\\n}\\n\\ndeclare var Blob: {\\n    prototype: Blob;\\n    new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;\\n};\\n\\ninterface Body {\\n    readonly body: ReadableStream<Uint8Array> | null;\\n    readonly bodyUsed: boolean;\\n    arrayBuffer(): Promise<ArrayBuffer>;\\n    blob(): Promise<Blob>;\\n    formData(): Promise<FormData>;\\n    json(): Promise<any>;\\n    text(): Promise<string>;\\n}\\n\\ninterface BroadcastChannelEventMap {\\n    \\\"message\\\": MessageEvent;\\n    \\\"messageerror\\\": MessageEvent;\\n}\\n\\ninterface BroadcastChannel extends EventTarget {\\n    /**\\n     * Returns the channel name (as passed to the constructor).\\n     */\\n    readonly name: string;\\n    onmessage: ((this: BroadcastChannel, ev: MessageEvent) => any) | null;\\n    onmessageerror: ((this: BroadcastChannel, ev: MessageEvent) => any) | null;\\n    /**\\n     * Closes the BroadcastChannel object, opening it up to garbage collection.\\n     */\\n    close(): void;\\n    /**\\n     * Sends the given message to other BroadcastChannel objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays.\\n     */\\n    postMessage(message: any): void;\\n    addEventListener<K extends keyof BroadcastChannelEventMap>(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof BroadcastChannelEventMap>(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var BroadcastChannel: {\\n    prototype: BroadcastChannel;\\n    new(name: string): BroadcastChannel;\\n};\\n\\n/** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */\\ninterface ByteLengthQueuingStrategy extends QueuingStrategy<ArrayBufferView> {\\n    readonly highWaterMark: number;\\n    readonly size: QueuingStrategySize<ArrayBufferView>;\\n}\\n\\ndeclare var ByteLengthQueuingStrategy: {\\n    prototype: ByteLengthQueuingStrategy;\\n    new(init: QueuingStrategyInit): ByteLengthQueuingStrategy;\\n};\\n\\n/** Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. */\\ninterface Cache {\\n    add(request: RequestInfo): Promise<void>;\\n    addAll(requests: RequestInfo[]): Promise<void>;\\n    delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;\\n    keys(request?: RequestInfo, options?: CacheQueryOptions): Promise<ReadonlyArray<Request>>;\\n    match(request: RequestInfo, options?: CacheQueryOptions): Promise<Response | undefined>;\\n    matchAll(request?: RequestInfo, options?: CacheQueryOptions): Promise<ReadonlyArray<Response>>;\\n    put(request: RequestInfo, response: Response): Promise<void>;\\n}\\n\\ndeclare var Cache: {\\n    prototype: Cache;\\n    new(): Cache;\\n};\\n\\n/** The storage for Cache objects. */\\ninterface CacheStorage {\\n    delete(cacheName: string): Promise<boolean>;\\n    has(cacheName: string): Promise<boolean>;\\n    keys(): Promise<string[]>;\\n    match(request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response | undefined>;\\n    open(cacheName: string): Promise<Cache>;\\n}\\n\\ndeclare var CacheStorage: {\\n    prototype: CacheStorage;\\n    new(): CacheStorage;\\n};\\n\\ninterface CanvasCompositing {\\n    globalAlpha: number;\\n    globalCompositeOperation: string;\\n}\\n\\ninterface CanvasDrawImage {\\n    drawImage(image: CanvasImageSource, dx: number, dy: number): void;\\n    drawImage(image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number): void;\\n    drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void;\\n}\\n\\ninterface CanvasDrawPath {\\n    beginPath(): void;\\n    clip(fillRule?: CanvasFillRule): void;\\n    clip(path: Path2D, fillRule?: CanvasFillRule): void;\\n    fill(fillRule?: CanvasFillRule): void;\\n    fill(path: Path2D, fillRule?: CanvasFillRule): void;\\n    isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean;\\n    isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean;\\n    isPointInStroke(x: number, y: number): boolean;\\n    isPointInStroke(path: Path2D, x: number, y: number): boolean;\\n    stroke(): void;\\n    stroke(path: Path2D): void;\\n}\\n\\ninterface CanvasFillStrokeStyles {\\n    fillStyle: string | CanvasGradient | CanvasPattern;\\n    strokeStyle: string | CanvasGradient | CanvasPattern;\\n    createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;\\n    createPattern(image: CanvasImageSource, repetition: string | null): CanvasPattern | null;\\n    createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;\\n}\\n\\ninterface CanvasFilters {\\n    filter: string;\\n}\\n\\n/** An opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient(). */\\ninterface CanvasGradient {\\n    /**\\n     * Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end.\\n     * \\n     * Throws an \\\"IndexSizeError\\\" DOMException if the offset is out of range. Throws a \\\"SyntaxError\\\" DOMException if the color cannot be parsed.\\n     */\\n    addColorStop(offset: number, color: string): void;\\n}\\n\\ndeclare var CanvasGradient: {\\n    prototype: CanvasGradient;\\n    new(): CanvasGradient;\\n};\\n\\ninterface CanvasImageData {\\n    createImageData(sw: number, sh: number): ImageData;\\n    createImageData(imagedata: ImageData): ImageData;\\n    getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;\\n    putImageData(imagedata: ImageData, dx: number, dy: number): void;\\n    putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number): void;\\n}\\n\\ninterface CanvasImageSmoothing {\\n    imageSmoothingEnabled: boolean;\\n    imageSmoothingQuality: ImageSmoothingQuality;\\n}\\n\\ninterface CanvasPath {\\n    arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\\n    arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;\\n    bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;\\n    closePath(): void;\\n    ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\\n    lineTo(x: number, y: number): void;\\n    moveTo(x: number, y: number): void;\\n    quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;\\n    rect(x: number, y: number, w: number, h: number): void;\\n}\\n\\ninterface CanvasPathDrawingStyles {\\n    lineCap: CanvasLineCap;\\n    lineDashOffset: number;\\n    lineJoin: CanvasLineJoin;\\n    lineWidth: number;\\n    miterLimit: number;\\n    getLineDash(): number[];\\n    setLineDash(segments: number[]): void;\\n}\\n\\n/** An opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method. */\\ninterface CanvasPattern {\\n    /**\\n     * Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation.\\n     */\\n    setTransform(transform?: DOMMatrix2DInit): void;\\n}\\n\\ndeclare var CanvasPattern: {\\n    prototype: CanvasPattern;\\n    new(): CanvasPattern;\\n};\\n\\ninterface CanvasRect {\\n    clearRect(x: number, y: number, w: number, h: number): void;\\n    fillRect(x: number, y: number, w: number, h: number): void;\\n    strokeRect(x: number, y: number, w: number, h: number): void;\\n}\\n\\ninterface CanvasShadowStyles {\\n    shadowBlur: number;\\n    shadowColor: string;\\n    shadowOffsetX: number;\\n    shadowOffsetY: number;\\n}\\n\\ninterface CanvasState {\\n    restore(): void;\\n    save(): void;\\n}\\n\\ninterface CanvasText {\\n    fillText(text: string, x: number, y: number, maxWidth?: number): void;\\n    measureText(text: string): TextMetrics;\\n    strokeText(text: string, x: number, y: number, maxWidth?: number): void;\\n}\\n\\ninterface CanvasTextDrawingStyles {\\n    direction: CanvasDirection;\\n    font: string;\\n    textAlign: CanvasTextAlign;\\n    textBaseline: CanvasTextBaseline;\\n}\\n\\ninterface CanvasTransform {\\n    getTransform(): DOMMatrix;\\n    resetTransform(): void;\\n    rotate(angle: number): void;\\n    scale(x: number, y: number): void;\\n    setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;\\n    setTransform(transform?: DOMMatrix2DInit): void;\\n    transform(a: number, b: number, c: number, d: number, e: number, f: number): void;\\n    translate(x: number, y: number): void;\\n}\\n\\n/** The Client interface represents an executable context such as a Worker, or a SharedWorker. Window clients are represented by the more-specific WindowClient. You can get Client/WindowClient objects from methods such as Clients.matchAll() and Clients.get(). */\\ninterface Client {\\n    readonly frameType: FrameType;\\n    readonly id: string;\\n    readonly type: ClientTypes;\\n    readonly url: string;\\n    postMessage(message: any, transfer?: Transferable[]): void;\\n}\\n\\ndeclare var Client: {\\n    prototype: Client;\\n    new(): Client;\\n};\\n\\n/** Provides access to Client objects. Access it via self.clients within a service worker. */\\ninterface Clients {\\n    claim(): Promise<void>;\\n    get(id: string): Promise<Client | undefined>;\\n    matchAll<T extends ClientQueryOptions>(options?: T): Promise<ReadonlyArray<T[\\\"type\\\"] extends \\\"window\\\" ? WindowClient : Client>>;\\n    openWindow(url: string): Promise<WindowClient | null>;\\n}\\n\\ndeclare var Clients: {\\n    prototype: Clients;\\n    new(): Clients;\\n};\\n\\n/** A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. */\\ninterface CloseEvent extends Event {\\n    /**\\n     * Returns the WebSocket connection close code provided by the server.\\n     */\\n    readonly code: number;\\n    /**\\n     * Returns the WebSocket connection close reason provided by the server.\\n     */\\n    readonly reason: string;\\n    /**\\n     * Returns true if the connection closed cleanly; false otherwise.\\n     */\\n    readonly wasClean: boolean;\\n}\\n\\ndeclare var CloseEvent: {\\n    prototype: CloseEvent;\\n    new(type: string, eventInitDict?: CloseEventInit): CloseEvent;\\n};\\n\\ninterface ConcatParams extends Algorithm {\\n    algorithmId: Uint8Array;\\n    hash?: string | Algorithm;\\n    partyUInfo: Uint8Array;\\n    partyVInfo: Uint8Array;\\n    privateInfo?: Uint8Array;\\n    publicInfo?: Uint8Array;\\n}\\n\\n/** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */\\ninterface CountQueuingStrategy extends QueuingStrategy {\\n    readonly highWaterMark: number;\\n    readonly size: QueuingStrategySize;\\n}\\n\\ndeclare var CountQueuingStrategy: {\\n    prototype: CountQueuingStrategy;\\n    new(init: QueuingStrategyInit): CountQueuingStrategy;\\n};\\n\\n/** Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives. */\\ninterface Crypto {\\n    readonly subtle: SubtleCrypto;\\n    getRandomValues<T extends Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null>(array: T): T;\\n}\\n\\ndeclare var Crypto: {\\n    prototype: Crypto;\\n    new(): Crypto;\\n};\\n\\n/** The CryptoKey dictionary of the Web Crypto API represents a cryptographic key. */\\ninterface CryptoKey {\\n    readonly algorithm: KeyAlgorithm;\\n    readonly extractable: boolean;\\n    readonly type: KeyType;\\n    readonly usages: KeyUsage[];\\n}\\n\\ndeclare var CryptoKey: {\\n    prototype: CryptoKey;\\n    new(): CryptoKey;\\n};\\n\\ninterface CustomEvent<T = any> extends Event {\\n    /**\\n     * Returns any custom data event was created with. Typically used for synthetic events.\\n     */\\n    readonly detail: T;\\n    initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: T): void;\\n}\\n\\ndeclare var CustomEvent: {\\n    prototype: CustomEvent;\\n    new<T>(typeArg: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;\\n};\\n\\n/** An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. */\\ninterface DOMException {\\n    readonly code: number;\\n    readonly message: string;\\n    readonly name: string;\\n    readonly ABORT_ERR: number;\\n    readonly DATA_CLONE_ERR: number;\\n    readonly DOMSTRING_SIZE_ERR: number;\\n    readonly HIERARCHY_REQUEST_ERR: number;\\n    readonly INDEX_SIZE_ERR: number;\\n    readonly INUSE_ATTRIBUTE_ERR: number;\\n    readonly INVALID_ACCESS_ERR: number;\\n    readonly INVALID_CHARACTER_ERR: number;\\n    readonly INVALID_MODIFICATION_ERR: number;\\n    readonly INVALID_NODE_TYPE_ERR: number;\\n    readonly INVALID_STATE_ERR: number;\\n    readonly NAMESPACE_ERR: number;\\n    readonly NETWORK_ERR: number;\\n    readonly NOT_FOUND_ERR: number;\\n    readonly NOT_SUPPORTED_ERR: number;\\n    readonly NO_DATA_ALLOWED_ERR: number;\\n    readonly NO_MODIFICATION_ALLOWED_ERR: number;\\n    readonly QUOTA_EXCEEDED_ERR: number;\\n    readonly SECURITY_ERR: number;\\n    readonly SYNTAX_ERR: number;\\n    readonly TIMEOUT_ERR: number;\\n    readonly TYPE_MISMATCH_ERR: number;\\n    readonly URL_MISMATCH_ERR: number;\\n    readonly VALIDATION_ERR: number;\\n    readonly WRONG_DOCUMENT_ERR: number;\\n}\\n\\ndeclare var DOMException: {\\n    prototype: DOMException;\\n    new(message?: string, name?: string): DOMException;\\n    readonly ABORT_ERR: number;\\n    readonly DATA_CLONE_ERR: number;\\n    readonly DOMSTRING_SIZE_ERR: number;\\n    readonly HIERARCHY_REQUEST_ERR: number;\\n    readonly INDEX_SIZE_ERR: number;\\n    readonly INUSE_ATTRIBUTE_ERR: number;\\n    readonly INVALID_ACCESS_ERR: number;\\n    readonly INVALID_CHARACTER_ERR: number;\\n    readonly INVALID_MODIFICATION_ERR: number;\\n    readonly INVALID_NODE_TYPE_ERR: number;\\n    readonly INVALID_STATE_ERR: number;\\n    readonly NAMESPACE_ERR: number;\\n    readonly NETWORK_ERR: number;\\n    readonly NOT_FOUND_ERR: number;\\n    readonly NOT_SUPPORTED_ERR: number;\\n    readonly NO_DATA_ALLOWED_ERR: number;\\n    readonly NO_MODIFICATION_ALLOWED_ERR: number;\\n    readonly QUOTA_EXCEEDED_ERR: number;\\n    readonly SECURITY_ERR: number;\\n    readonly SYNTAX_ERR: number;\\n    readonly TIMEOUT_ERR: number;\\n    readonly TYPE_MISMATCH_ERR: number;\\n    readonly URL_MISMATCH_ERR: number;\\n    readonly VALIDATION_ERR: number;\\n    readonly WRONG_DOCUMENT_ERR: number;\\n};\\n\\ninterface DOMMatrix extends DOMMatrixReadOnly {\\n    a: number;\\n    b: number;\\n    c: number;\\n    d: number;\\n    e: number;\\n    f: number;\\n    m11: number;\\n    m12: number;\\n    m13: number;\\n    m14: number;\\n    m21: number;\\n    m22: number;\\n    m23: number;\\n    m24: number;\\n    m31: number;\\n    m32: number;\\n    m33: number;\\n    m34: number;\\n    m41: number;\\n    m42: number;\\n    m43: number;\\n    m44: number;\\n    invertSelf(): DOMMatrix;\\n    multiplySelf(other?: DOMMatrixInit): DOMMatrix;\\n    preMultiplySelf(other?: DOMMatrixInit): DOMMatrix;\\n    rotateAxisAngleSelf(x?: number, y?: number, z?: number, angle?: number): DOMMatrix;\\n    rotateFromVectorSelf(x?: number, y?: number): DOMMatrix;\\n    rotateSelf(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;\\n    scale3dSelf(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;\\n    scaleSelf(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;\\n    skewXSelf(sx?: number): DOMMatrix;\\n    skewYSelf(sy?: number): DOMMatrix;\\n    translateSelf(tx?: number, ty?: number, tz?: number): DOMMatrix;\\n}\\n\\ndeclare var DOMMatrix: {\\n    prototype: DOMMatrix;\\n    new(init?: string | number[]): DOMMatrix;\\n    fromFloat32Array(array32: Float32Array): DOMMatrix;\\n    fromFloat64Array(array64: Float64Array): DOMMatrix;\\n    fromMatrix(other?: DOMMatrixInit): DOMMatrix;\\n};\\n\\ninterface DOMMatrixReadOnly {\\n    readonly a: number;\\n    readonly b: number;\\n    readonly c: number;\\n    readonly d: number;\\n    readonly e: number;\\n    readonly f: number;\\n    readonly is2D: boolean;\\n    readonly isIdentity: boolean;\\n    readonly m11: number;\\n    readonly m12: number;\\n    readonly m13: number;\\n    readonly m14: number;\\n    readonly m21: number;\\n    readonly m22: number;\\n    readonly m23: number;\\n    readonly m24: number;\\n    readonly m31: number;\\n    readonly m32: number;\\n    readonly m33: number;\\n    readonly m34: number;\\n    readonly m41: number;\\n    readonly m42: number;\\n    readonly m43: number;\\n    readonly m44: number;\\n    flipX(): DOMMatrix;\\n    flipY(): DOMMatrix;\\n    inverse(): DOMMatrix;\\n    multiply(other?: DOMMatrixInit): DOMMatrix;\\n    rotate(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;\\n    rotateAxisAngle(x?: number, y?: number, z?: number, angle?: number): DOMMatrix;\\n    rotateFromVector(x?: number, y?: number): DOMMatrix;\\n    scale(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;\\n    scale3d(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;\\n    /** @deprecated */\\n    scaleNonUniform(scaleX?: number, scaleY?: number): DOMMatrix;\\n    skewX(sx?: number): DOMMatrix;\\n    skewY(sy?: number): DOMMatrix;\\n    toFloat32Array(): Float32Array;\\n    toFloat64Array(): Float64Array;\\n    toJSON(): any;\\n    transformPoint(point?: DOMPointInit): DOMPoint;\\n    translate(tx?: number, ty?: number, tz?: number): DOMMatrix;\\n}\\n\\ndeclare var DOMMatrixReadOnly: {\\n    prototype: DOMMatrixReadOnly;\\n    new(init?: string | number[]): DOMMatrixReadOnly;\\n    fromFloat32Array(array32: Float32Array): DOMMatrixReadOnly;\\n    fromFloat64Array(array64: Float64Array): DOMMatrixReadOnly;\\n    fromMatrix(other?: DOMMatrixInit): DOMMatrixReadOnly;\\n};\\n\\ninterface DOMPoint extends DOMPointReadOnly {\\n    w: number;\\n    x: number;\\n    y: number;\\n    z: number;\\n}\\n\\ndeclare var DOMPoint: {\\n    prototype: DOMPoint;\\n    new(x?: number, y?: number, z?: number, w?: number): DOMPoint;\\n    fromPoint(other?: DOMPointInit): DOMPoint;\\n};\\n\\ninterface DOMPointReadOnly {\\n    readonly w: number;\\n    readonly x: number;\\n    readonly y: number;\\n    readonly z: number;\\n    matrixTransform(matrix?: DOMMatrixInit): DOMPoint;\\n    toJSON(): any;\\n}\\n\\ndeclare var DOMPointReadOnly: {\\n    prototype: DOMPointReadOnly;\\n    new(x?: number, y?: number, z?: number, w?: number): DOMPointReadOnly;\\n    fromPoint(other?: DOMPointInit): DOMPointReadOnly;\\n};\\n\\ninterface DOMQuad {\\n    readonly p1: DOMPoint;\\n    readonly p2: DOMPoint;\\n    readonly p3: DOMPoint;\\n    readonly p4: DOMPoint;\\n    getBounds(): DOMRect;\\n    toJSON(): any;\\n}\\n\\ndeclare var DOMQuad: {\\n    prototype: DOMQuad;\\n    new(p1?: DOMPointInit, p2?: DOMPointInit, p3?: DOMPointInit, p4?: DOMPointInit): DOMQuad;\\n    fromQuad(other?: DOMQuadInit): DOMQuad;\\n    fromRect(other?: DOMRectInit): DOMQuad;\\n};\\n\\ninterface DOMRect extends DOMRectReadOnly {\\n    height: number;\\n    width: number;\\n    x: number;\\n    y: number;\\n}\\n\\ndeclare var DOMRect: {\\n    prototype: DOMRect;\\n    new(x?: number, y?: number, width?: number, height?: number): DOMRect;\\n    fromRect(other?: DOMRectInit): DOMRect;\\n};\\n\\ninterface DOMRectReadOnly {\\n    readonly bottom: number;\\n    readonly height: number;\\n    readonly left: number;\\n    readonly right: number;\\n    readonly top: number;\\n    readonly width: number;\\n    readonly x: number;\\n    readonly y: number;\\n    toJSON(): any;\\n}\\n\\ndeclare var DOMRectReadOnly: {\\n    prototype: DOMRectReadOnly;\\n    new(x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly;\\n    fromRect(other?: DOMRectInit): DOMRectReadOnly;\\n};\\n\\n/** A type returned by some APIs which contains a list of DOMString (strings). */\\ninterface DOMStringList {\\n    /**\\n     * Returns the number of strings in strings.\\n     */\\n    readonly length: number;\\n    /**\\n     * Returns true if strings contains string, and false otherwise.\\n     */\\n    contains(string: string): boolean;\\n    /**\\n     * Returns the string with index index from strings.\\n     */\\n    item(index: number): string | null;\\n    [index: number]: string;\\n}\\n\\ndeclare var DOMStringList: {\\n    prototype: DOMStringList;\\n    new(): DOMStringList;\\n};\\n\\ninterface DedicatedWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap {\\n    \\\"message\\\": MessageEvent;\\n    \\\"messageerror\\\": MessageEvent;\\n}\\n\\n/** (the Worker global scope) is accessible through the self keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See also: Functions available to workers. */\\ninterface DedicatedWorkerGlobalScope extends WorkerGlobalScope, AnimationFrameProvider {\\n    /**\\n     * Returns dedicatedWorkerGlobal's name, i.e. the value given to the Worker constructor. Primarily useful for debugging.\\n     */\\n    readonly name: string;\\n    onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;\\n    onmessageerror: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;\\n    /**\\n     * Aborts dedicatedWorkerGlobal.\\n     */\\n    close(): void;\\n    /**\\n     * Clones message and transmits it to the Worker object associated with dedicatedWorkerGlobal. transfer can be passed as a list of objects that are to be transferred rather than cloned.\\n     */\\n    postMessage(message: any, transfer: Transferable[]): void;\\n    postMessage(message: any, options?: PostMessageOptions): void;\\n    addEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var DedicatedWorkerGlobalScope: {\\n    prototype: DedicatedWorkerGlobalScope;\\n    new(): DedicatedWorkerGlobalScope;\\n};\\n\\ninterface DhImportKeyParams extends Algorithm {\\n    generator: Uint8Array;\\n    prime: Uint8Array;\\n}\\n\\ninterface DhKeyAlgorithm extends KeyAlgorithm {\\n    generator: Uint8Array;\\n    prime: Uint8Array;\\n}\\n\\ninterface DhKeyDeriveParams extends Algorithm {\\n    public: CryptoKey;\\n}\\n\\ninterface DhKeyGenParams extends Algorithm {\\n    generator: Uint8Array;\\n    prime: Uint8Array;\\n}\\n\\ninterface EXT_blend_minmax {\\n    readonly MAX_EXT: GLenum;\\n    readonly MIN_EXT: GLenum;\\n}\\n\\n/** The EXT_frag_depth extension is part of the WebGL API and enables to set a depth value of a fragment from within the fragment shader. */\\ninterface EXT_frag_depth {\\n}\\n\\ninterface EXT_sRGB {\\n    readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: GLenum;\\n    readonly SRGB8_ALPHA8_EXT: GLenum;\\n    readonly SRGB_ALPHA_EXT: GLenum;\\n    readonly SRGB_EXT: GLenum;\\n}\\n\\ninterface EXT_shader_texture_lod {\\n}\\n\\n/** The EXT_texture_filter_anisotropic extension is part of the WebGL API and exposes two constants for anisotropic filtering (AF). */\\ninterface EXT_texture_filter_anisotropic {\\n    readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum;\\n    readonly TEXTURE_MAX_ANISOTROPY_EXT: GLenum;\\n}\\n\\n/** Events providing information related to errors in scripts or in files. */\\ninterface ErrorEvent extends Event {\\n    readonly colno: number;\\n    readonly error: any;\\n    readonly filename: string;\\n    readonly lineno: number;\\n    readonly message: string;\\n}\\n\\ndeclare var ErrorEvent: {\\n    prototype: ErrorEvent;\\n    new(type: string, eventInitDict?: ErrorEventInit): ErrorEvent;\\n};\\n\\n/** An event which takes place in the DOM. */\\ninterface Event {\\n    /**\\n     * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.\\n     */\\n    readonly bubbles: boolean;\\n    cancelBubble: boolean;\\n    /**\\n     * Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method.\\n     */\\n    readonly cancelable: boolean;\\n    /**\\n     * Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise.\\n     */\\n    readonly composed: boolean;\\n    /**\\n     * Returns the object whose event listener's callback is currently being invoked.\\n     */\\n    readonly currentTarget: EventTarget | null;\\n    /**\\n     * Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.\\n     */\\n    readonly defaultPrevented: boolean;\\n    /**\\n     * Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.\\n     */\\n    readonly eventPhase: number;\\n    /**\\n     * Returns true if event was dispatched by the user agent, and false otherwise.\\n     */\\n    readonly isTrusted: boolean;\\n    returnValue: boolean;\\n    /** @deprecated */\\n    readonly srcElement: EventTarget | null;\\n    /**\\n     * Returns the object to which event is dispatched (its target).\\n     */\\n    readonly target: EventTarget | null;\\n    /**\\n     * Returns the event's timestamp as the number of milliseconds measured relative to the time origin.\\n     */\\n    readonly timeStamp: number;\\n    /**\\n     * Returns the type of event, e.g. \\\"click\\\", \\\"hashchange\\\", or \\\"submit\\\".\\n     */\\n    readonly type: string;\\n    /**\\n     * Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is \\\"closed\\\" that are not reachable from event's currentTarget.\\n     */\\n    composedPath(): EventTarget[];\\n    initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;\\n    /**\\n     * If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.\\n     */\\n    preventDefault(): void;\\n    /**\\n     * Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.\\n     */\\n    stopImmediatePropagation(): void;\\n    /**\\n     * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.\\n     */\\n    stopPropagation(): void;\\n    readonly AT_TARGET: number;\\n    readonly BUBBLING_PHASE: number;\\n    readonly CAPTURING_PHASE: number;\\n    readonly NONE: number;\\n}\\n\\ndeclare var Event: {\\n    prototype: Event;\\n    new(type: string, eventInitDict?: EventInit): Event;\\n    readonly AT_TARGET: number;\\n    readonly BUBBLING_PHASE: number;\\n    readonly CAPTURING_PHASE: number;\\n    readonly NONE: number;\\n};\\n\\ninterface EventListenerObject {\\n    handleEvent(evt: Event): void;\\n}\\n\\ninterface EventSourceEventMap {\\n    \\\"error\\\": Event;\\n    \\\"message\\\": MessageEvent;\\n    \\\"open\\\": Event;\\n}\\n\\ninterface EventSource extends EventTarget {\\n    onerror: ((this: EventSource, ev: Event) => any) | null;\\n    onmessage: ((this: EventSource, ev: MessageEvent) => any) | null;\\n    onopen: ((this: EventSource, ev: Event) => any) | null;\\n    /**\\n     * Returns the state of this EventSource object's connection. It can have the values described below.\\n     */\\n    readonly readyState: number;\\n    /**\\n     * Returns the URL providing the event stream.\\n     */\\n    readonly url: string;\\n    /**\\n     * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to \\\"include\\\", and false otherwise.\\n     */\\n    readonly withCredentials: boolean;\\n    /**\\n     * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.\\n     */\\n    close(): void;\\n    readonly CLOSED: number;\\n    readonly CONNECTING: number;\\n    readonly OPEN: number;\\n    addEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var EventSource: {\\n    prototype: EventSource;\\n    new(url: string, eventSourceInitDict?: EventSourceInit): EventSource;\\n    readonly CLOSED: number;\\n    readonly CONNECTING: number;\\n    readonly OPEN: number;\\n};\\n\\n/** EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. */\\ninterface EventTarget {\\n    /**\\n     * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.\\n     * \\n     * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.\\n     * \\n     * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.\\n     * \\n     * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.\\n     * \\n     * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.\\n     * \\n     * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.\\n     */\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;\\n    /**\\n     * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.\\n     */\\n    dispatchEvent(event: Event): boolean;\\n    /**\\n     * Removes the event listener in target's event listener list with the same type, callback, and options.\\n     */\\n    removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;\\n}\\n\\ndeclare var EventTarget: {\\n    prototype: EventTarget;\\n    new(): EventTarget;\\n};\\n\\n/** Extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries. */\\ninterface ExtendableEvent extends Event {\\n    waitUntil(f: any): void;\\n}\\n\\ndeclare var ExtendableEvent: {\\n    prototype: ExtendableEvent;\\n    new(type: string, eventInitDict?: ExtendableEventInit): ExtendableEvent;\\n};\\n\\n/** This ServiceWorker API interface represents the event object of a message event fired on a service worker (when a channel message is received on the ServiceWorkerGlobalScope from another context) — extends the lifetime of such events. */\\ninterface ExtendableMessageEvent extends ExtendableEvent {\\n    readonly data: any;\\n    readonly lastEventId: string;\\n    readonly origin: string;\\n    readonly ports: ReadonlyArray<MessagePort>;\\n    readonly source: Client | ServiceWorker | MessagePort | null;\\n}\\n\\ndeclare var ExtendableMessageEvent: {\\n    prototype: ExtendableMessageEvent;\\n    new(type: string, eventInitDict?: ExtendableMessageEventInit): ExtendableMessageEvent;\\n};\\n\\n/** This is the event type for fetch events dispatched on the service worker global scope. It contains information about the fetch, including the request and how the receiver will treat the response. It provides the event.respondWith() method, which allows us to provide a response to this fetch. */\\ninterface FetchEvent extends ExtendableEvent {\\n    readonly clientId: string;\\n    readonly preloadResponse: Promise<any>;\\n    readonly replacesClientId: string;\\n    readonly request: Request;\\n    readonly resultingClientId: string;\\n    respondWith(r: Response | Promise<Response>): void;\\n}\\n\\ndeclare var FetchEvent: {\\n    prototype: FetchEvent;\\n    new(type: string, eventInitDict: FetchEventInit): FetchEvent;\\n};\\n\\n/** Provides information about files and allows JavaScript in a web page to access their content. */\\ninterface File extends Blob {\\n    readonly lastModified: number;\\n    readonly name: string;\\n}\\n\\ndeclare var File: {\\n    prototype: File;\\n    new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;\\n};\\n\\n/** An object of this type is returned by the files property of the HTML <input> element; this lets you access the list of files selected with the <input type=\\\"file\\\"> element. It's also used for a list of files dropped into web content when using the drag and drop API; see the DataTransfer object for details on this usage. */\\ninterface FileList {\\n    readonly length: number;\\n    item(index: number): File | null;\\n    [index: number]: File;\\n}\\n\\ndeclare var FileList: {\\n    prototype: FileList;\\n    new(): FileList;\\n};\\n\\ninterface FileReaderEventMap {\\n    \\\"abort\\\": ProgressEvent<FileReader>;\\n    \\\"error\\\": ProgressEvent<FileReader>;\\n    \\\"load\\\": ProgressEvent<FileReader>;\\n    \\\"loadend\\\": ProgressEvent<FileReader>;\\n    \\\"loadstart\\\": ProgressEvent<FileReader>;\\n    \\\"progress\\\": ProgressEvent<FileReader>;\\n}\\n\\n/** Lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read. */\\ninterface FileReader extends EventTarget {\\n    readonly error: DOMException | null;\\n    onabort: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;\\n    onerror: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;\\n    onload: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;\\n    onloadend: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;\\n    onloadstart: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;\\n    onprogress: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;\\n    readonly readyState: number;\\n    readonly result: string | ArrayBuffer | null;\\n    abort(): void;\\n    readAsArrayBuffer(blob: Blob): void;\\n    readAsBinaryString(blob: Blob): void;\\n    readAsDataURL(blob: Blob): void;\\n    readAsText(blob: Blob, encoding?: string): void;\\n    readonly DONE: number;\\n    readonly EMPTY: number;\\n    readonly LOADING: number;\\n    addEventListener<K extends keyof FileReaderEventMap>(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof FileReaderEventMap>(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var FileReader: {\\n    prototype: FileReader;\\n    new(): FileReader;\\n    readonly DONE: number;\\n    readonly EMPTY: number;\\n    readonly LOADING: number;\\n};\\n\\n/** Allows to read File or Blob objects in a synchronous way. */\\ninterface FileReaderSync {\\n    readAsArrayBuffer(blob: Blob): ArrayBuffer;\\n    readAsBinaryString(blob: Blob): string;\\n    readAsDataURL(blob: Blob): string;\\n    readAsText(blob: Blob, encoding?: string): string;\\n}\\n\\ndeclare var FileReaderSync: {\\n    prototype: FileReaderSync;\\n    new(): FileReaderSync;\\n};\\n\\n/** Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to \\\"multipart/form-data\\\". */\\ninterface FormData {\\n    append(name: string, value: string | Blob, fileName?: string): void;\\n    delete(name: string): void;\\n    get(name: string): FormDataEntryValue | null;\\n    getAll(name: string): FormDataEntryValue[];\\n    has(name: string): boolean;\\n    set(name: string, value: string | Blob, fileName?: string): void;\\n    forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;\\n}\\n\\ndeclare var FormData: {\\n    prototype: FormData;\\n    new(): FormData;\\n};\\n\\ninterface GenericTransformStream {\\n    readonly readable: ReadableStream;\\n    readonly writable: WritableStream;\\n}\\n\\n/** This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.  You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence. */\\ninterface Headers {\\n    append(name: string, value: string): void;\\n    delete(name: string): void;\\n    get(name: string): string | null;\\n    has(name: string): boolean;\\n    set(name: string, value: string): void;\\n    forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;\\n}\\n\\ndeclare var Headers: {\\n    prototype: Headers;\\n    new(init?: HeadersInit): Headers;\\n};\\n\\ninterface IDBArrayKey extends Array<IDBValidKey> {\\n}\\n\\n/** This IndexedDB API interface represents a cursor for traversing or iterating over multiple records in a database. */\\ninterface IDBCursor {\\n    /**\\n     * Returns the direction (\\\"next\\\", \\\"nextunique\\\", \\\"prev\\\" or \\\"prevunique\\\") of the cursor.\\n     */\\n    readonly direction: IDBCursorDirection;\\n    /**\\n     * Returns the key of the cursor. Throws a \\\"InvalidStateError\\\" DOMException if the cursor is advancing or is finished.\\n     */\\n    readonly key: IDBValidKey;\\n    /**\\n     * Returns the effective key of the cursor. Throws a \\\"InvalidStateError\\\" DOMException if the cursor is advancing or is finished.\\n     */\\n    readonly primaryKey: IDBValidKey;\\n    /**\\n     * Returns the IDBObjectStore or IDBIndex the cursor was opened from.\\n     */\\n    readonly source: IDBObjectStore | IDBIndex;\\n    /**\\n     * Advances the cursor through the next count records in range.\\n     */\\n    advance(count: number): void;\\n    /**\\n     * Advances the cursor to the next record in range.\\n     */\\n    continue(key?: IDBValidKey): void;\\n    /**\\n     * Advances the cursor to the next record in range matching or after key and primaryKey. Throws an \\\"InvalidAccessError\\\" DOMException if the source is not an index.\\n     */\\n    continuePrimaryKey(key: IDBValidKey, primaryKey: IDBValidKey): void;\\n    /**\\n     * Delete the record pointed at by the cursor with a new value.\\n     * \\n     * If successful, request's result will be undefined.\\n     */\\n    delete(): IDBRequest<undefined>;\\n    /**\\n     * Updated the record pointed at by the cursor with a new value.\\n     * \\n     * Throws a \\\"DataError\\\" DOMException if the effective object store uses in-line keys and the key would have changed.\\n     * \\n     * If successful, request's result will be the record's key.\\n     */\\n    update(value: any): IDBRequest<IDBValidKey>;\\n}\\n\\ndeclare var IDBCursor: {\\n    prototype: IDBCursor;\\n    new(): IDBCursor;\\n};\\n\\n/** This IndexedDB API interface represents a cursor for traversing or iterating over multiple records in a database. It is the same as the IDBCursor, except that it includes the value property. */\\ninterface IDBCursorWithValue extends IDBCursor {\\n    /**\\n     * Returns the cursor's current value.\\n     */\\n    readonly value: any;\\n}\\n\\ndeclare var IDBCursorWithValue: {\\n    prototype: IDBCursorWithValue;\\n    new(): IDBCursorWithValue;\\n};\\n\\ninterface IDBDatabaseEventMap {\\n    \\\"abort\\\": Event;\\n    \\\"close\\\": Event;\\n    \\\"error\\\": Event;\\n    \\\"versionchange\\\": IDBVersionChangeEvent;\\n}\\n\\n/** This IndexedDB API interface provides a connection to a database; you can use an IDBDatabase object to open a transaction on your database then create, manipulate, and delete objects (data) in that database. The interface provides the only way to get and manage versions of the database. */\\ninterface IDBDatabase extends EventTarget {\\n    /**\\n     * Returns the name of the database.\\n     */\\n    readonly name: string;\\n    /**\\n     * Returns a list of the names of object stores in the database.\\n     */\\n    readonly objectStoreNames: DOMStringList;\\n    onabort: ((this: IDBDatabase, ev: Event) => any) | null;\\n    onclose: ((this: IDBDatabase, ev: Event) => any) | null;\\n    onerror: ((this: IDBDatabase, ev: Event) => any) | null;\\n    onversionchange: ((this: IDBDatabase, ev: IDBVersionChangeEvent) => any) | null;\\n    /**\\n     * Returns the version of the database.\\n     */\\n    readonly version: number;\\n    /**\\n     * Closes the connection once all running transactions have finished.\\n     */\\n    close(): void;\\n    /**\\n     * Creates a new object store with the given name and options and returns a new IDBObjectStore.\\n     * \\n     * Throws a \\\"InvalidStateError\\\" DOMException if not called within an upgrade transaction.\\n     */\\n    createObjectStore(name: string, options?: IDBObjectStoreParameters): IDBObjectStore;\\n    /**\\n     * Deletes the object store with the given name.\\n     * \\n     * Throws a \\\"InvalidStateError\\\" DOMException if not called within an upgrade transaction.\\n     */\\n    deleteObjectStore(name: string): void;\\n    /**\\n     * Returns a new transaction with the given mode (\\\"readonly\\\" or \\\"readwrite\\\") and scope which can be a single object store name or an array of names.\\n     */\\n    transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;\\n    addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var IDBDatabase: {\\n    prototype: IDBDatabase;\\n    new(): IDBDatabase;\\n};\\n\\n/** In the following code snippet, we make a request to open a database, and include handlers for the success and error cases. For a full working example, see our To-do Notifications app (view example live.) */\\ninterface IDBFactory {\\n    /**\\n     * Compares two values as keys. Returns -1 if key1 precedes key2, 1 if key2 precedes key1, and 0 if the keys are equal.\\n     * \\n     * Throws a \\\"DataError\\\" DOMException if either input is not a valid key.\\n     */\\n    cmp(first: any, second: any): number;\\n    /**\\n     * Attempts to delete the named database. If the database already exists and there are open connections that don't close in response to a versionchange event, the request will be blocked until all they close. If the request is successful request's result will be null.\\n     */\\n    deleteDatabase(name: string): IDBOpenDBRequest;\\n    /**\\n     * Attempts to open a connection to the named database with the current version, or 1 if it does not already exist. If the request is successful request's result will be the connection.\\n     */\\n    open(name: string, version?: number): IDBOpenDBRequest;\\n}\\n\\ndeclare var IDBFactory: {\\n    prototype: IDBFactory;\\n    new(): IDBFactory;\\n};\\n\\n/** IDBIndex interface of the IndexedDB API provides asynchronous access to an index in a database. An index is a kind of object store for looking up records in another object store, called the referenced object store. You use this interface to retrieve data. */\\ninterface IDBIndex {\\n    readonly keyPath: string | string[];\\n    readonly multiEntry: boolean;\\n    /**\\n     * Returns the name of the index.\\n     */\\n    name: string;\\n    /**\\n     * Returns the IDBObjectStore the index belongs to.\\n     */\\n    readonly objectStore: IDBObjectStore;\\n    readonly unique: boolean;\\n    /**\\n     * Retrieves the number of records matching the given key or key range in query.\\n     * \\n     * If successful, request's result will be the count.\\n     */\\n    count(key?: IDBValidKey | IDBKeyRange): IDBRequest<number>;\\n    /**\\n     * Retrieves the value of the first record matching the given key or key range in query.\\n     * \\n     * If successful, request's result will be the value, or undefined if there was no matching record.\\n     */\\n    get(key: IDBValidKey | IDBKeyRange): IDBRequest<any | undefined>;\\n    /**\\n     * Retrieves the values of the records matching the given key or key range in query (up to count if given).\\n     * \\n     * If successful, request's result will be an Array of the values.\\n     */\\n    getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<any[]>;\\n    /**\\n     * Retrieves the keys of records matching the given key or key range in query (up to count if given).\\n     * \\n     * If successful, request's result will be an Array of the keys.\\n     */\\n    getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<IDBValidKey[]>;\\n    /**\\n     * Retrieves the key of the first record matching the given key or key range in query.\\n     * \\n     * If successful, request's result will be the key, or undefined if there was no matching record.\\n     */\\n    getKey(key: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey | undefined>;\\n    /**\\n     * Opens a cursor over the records matching query, ordered by direction. If query is null, all records in index are matched.\\n     * \\n     * If successful, request's result will be an IDBCursorWithValue, or null if there were no matching records.\\n     */\\n    openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>;\\n    /**\\n     * Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in index are matched.\\n     * \\n     * If successful, request's result will be an IDBCursor, or null if there were no matching records.\\n     */\\n    openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;\\n}\\n\\ndeclare var IDBIndex: {\\n    prototype: IDBIndex;\\n    new(): IDBIndex;\\n};\\n\\n/** A key range can be a single value or a range with upper and lower bounds or endpoints. If the key range has both upper and lower bounds, then it is bounded; if it has no bounds, it is unbounded. A bounded key range can either be open (the endpoints are excluded) or closed (the endpoints are included). To retrieve all keys within a certain range, you can use the following code constructs: */\\ninterface IDBKeyRange {\\n    /**\\n     * Returns lower bound, or undefined if none.\\n     */\\n    readonly lower: any;\\n    /**\\n     * Returns true if the lower open flag is set, and false otherwise.\\n     */\\n    readonly lowerOpen: boolean;\\n    /**\\n     * Returns upper bound, or undefined if none.\\n     */\\n    readonly upper: any;\\n    /**\\n     * Returns true if the upper open flag is set, and false otherwise.\\n     */\\n    readonly upperOpen: boolean;\\n    /**\\n     * Returns true if key is included in the range, and false otherwise.\\n     */\\n    includes(key: any): boolean;\\n}\\n\\ndeclare var IDBKeyRange: {\\n    prototype: IDBKeyRange;\\n    new(): IDBKeyRange;\\n    /**\\n     * Returns a new IDBKeyRange spanning from lower to upper. If lowerOpen is true, lower is not included in the range. If upperOpen is true, upper is not included in the range.\\n     */\\n    bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange;\\n    /**\\n     * Returns a new IDBKeyRange starting at key with no upper bound. If open is true, key is not included in the range.\\n     */\\n    lowerBound(lower: any, open?: boolean): IDBKeyRange;\\n    /**\\n     * Returns a new IDBKeyRange spanning only key.\\n     */\\n    only(value: any): IDBKeyRange;\\n    /**\\n     * Returns a new IDBKeyRange with no lower bound and ending at key. If open is true, key is not included in the range.\\n     */\\n    upperBound(upper: any, open?: boolean): IDBKeyRange;\\n};\\n\\n/** This example shows a variety of different uses of object stores, from updating the data structure with IDBObjectStore.createIndex inside an onupgradeneeded function, to adding a new item to our object store with IDBObjectStore.add. For a full working example, see our To-do Notifications app (view example live.) */\\ninterface IDBObjectStore {\\n    /**\\n     * Returns true if the store has a key generator, and false otherwise.\\n     */\\n    readonly autoIncrement: boolean;\\n    /**\\n     * Returns a list of the names of indexes in the store.\\n     */\\n    readonly indexNames: DOMStringList;\\n    /**\\n     * Returns the key path of the store, or null if none.\\n     */\\n    readonly keyPath: string | string[];\\n    /**\\n     * Returns the name of the store.\\n     */\\n    name: string;\\n    /**\\n     * Returns the associated transaction.\\n     */\\n    readonly transaction: IDBTransaction;\\n    /**\\n     * Adds or updates a record in store with the given value and key.\\n     * \\n     * If the store uses in-line keys and key is specified a \\\"DataError\\\" DOMException will be thrown.\\n     * \\n     * If put() is used, any existing record with the key will be replaced. If add() is used, and if a record with the key already exists the request will fail, with request's error set to a \\\"ConstraintError\\\" DOMException.\\n     * \\n     * If successful, request's result will be the record's key.\\n     */\\n    add(value: any, key?: IDBValidKey): IDBRequest<IDBValidKey>;\\n    /**\\n     * Deletes all records in store.\\n     * \\n     * If successful, request's result will be undefined.\\n     */\\n    clear(): IDBRequest<undefined>;\\n    /**\\n     * Retrieves the number of records matching the given key or key range in query.\\n     * \\n     * If successful, request's result will be the count.\\n     */\\n    count(key?: IDBValidKey | IDBKeyRange): IDBRequest<number>;\\n    /**\\n     * Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a \\\"ConstraintError\\\" DOMException.\\n     * \\n     * Throws an \\\"InvalidStateError\\\" DOMException if not called within an upgrade transaction.\\n     */\\n    createIndex(name: string, keyPath: string | string[], options?: IDBIndexParameters): IDBIndex;\\n    /**\\n     * Deletes records in store with the given key or in the given key range in query.\\n     * \\n     * If successful, request's result will be undefined.\\n     */\\n    delete(key: IDBValidKey | IDBKeyRange): IDBRequest<undefined>;\\n    /**\\n     * Deletes the index in store with the given name.\\n     * \\n     * Throws an \\\"InvalidStateError\\\" DOMException if not called within an upgrade transaction.\\n     */\\n    deleteIndex(name: string): void;\\n    /**\\n     * Retrieves the value of the first record matching the given key or key range in query.\\n     * \\n     * If successful, request's result will be the value, or undefined if there was no matching record.\\n     */\\n    get(query: IDBValidKey | IDBKeyRange): IDBRequest<any | undefined>;\\n    /**\\n     * Retrieves the values of the records matching the given key or key range in query (up to count if given).\\n     * \\n     * If successful, request's result will be an Array of the values.\\n     */\\n    getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<any[]>;\\n    /**\\n     * Retrieves the keys of records matching the given key or key range in query (up to count if given).\\n     * \\n     * If successful, request's result will be an Array of the keys.\\n     */\\n    getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<IDBValidKey[]>;\\n    /**\\n     * Retrieves the key of the first record matching the given key or key range in query.\\n     * \\n     * If successful, request's result will be the key, or undefined if there was no matching record.\\n     */\\n    getKey(query: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey | undefined>;\\n    index(name: string): IDBIndex;\\n    /**\\n     * Opens a cursor over the records matching query, ordered by direction. If query is null, all records in store are matched.\\n     * \\n     * If successful, request's result will be an IDBCursorWithValue pointing at the first matching record, or null if there were no matching records.\\n     */\\n    openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>;\\n    /**\\n     * Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in store are matched.\\n     * \\n     * If successful, request's result will be an IDBCursor pointing at the first matching record, or null if there were no matching records.\\n     */\\n    openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;\\n    /**\\n     * Adds or updates a record in store with the given value and key.\\n     * \\n     * If the store uses in-line keys and key is specified a \\\"DataError\\\" DOMException will be thrown.\\n     * \\n     * If put() is used, any existing record with the key will be replaced. If add() is used, and if a record with the key already exists the request will fail, with request's error set to a \\\"ConstraintError\\\" DOMException.\\n     * \\n     * If successful, request's result will be the record's key.\\n     */\\n    put(value: any, key?: IDBValidKey): IDBRequest<IDBValidKey>;\\n}\\n\\ndeclare var IDBObjectStore: {\\n    prototype: IDBObjectStore;\\n    new(): IDBObjectStore;\\n};\\n\\ninterface IDBOpenDBRequestEventMap extends IDBRequestEventMap {\\n    \\\"blocked\\\": Event;\\n    \\\"upgradeneeded\\\": IDBVersionChangeEvent;\\n}\\n\\n/** Also inherits methods from its parents IDBRequest and EventTarget. */\\ninterface IDBOpenDBRequest extends IDBRequest<IDBDatabase> {\\n    onblocked: ((this: IDBOpenDBRequest, ev: Event) => any) | null;\\n    onupgradeneeded: ((this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any) | null;\\n    addEventListener<K extends keyof IDBOpenDBRequestEventMap>(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof IDBOpenDBRequestEventMap>(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var IDBOpenDBRequest: {\\n    prototype: IDBOpenDBRequest;\\n    new(): IDBOpenDBRequest;\\n};\\n\\ninterface IDBRequestEventMap {\\n    \\\"error\\\": Event;\\n    \\\"success\\\": Event;\\n}\\n\\n/** The request object does not initially contain any information about the result of the operation, but once information becomes available, an event is fired on the request, and the information becomes available through the properties of the IDBRequest instance. */\\ninterface IDBRequest<T = any> extends EventTarget {\\n    /**\\n     * When a request is completed, returns the error (a DOMException), or null if the request succeeded. Throws a \\\"InvalidStateError\\\" DOMException if the request is still pending.\\n     */\\n    readonly error: DOMException | null;\\n    onerror: ((this: IDBRequest<T>, ev: Event) => any) | null;\\n    onsuccess: ((this: IDBRequest<T>, ev: Event) => any) | null;\\n    /**\\n     * Returns \\\"pending\\\" until a request is complete, then returns \\\"done\\\".\\n     */\\n    readonly readyState: IDBRequestReadyState;\\n    /**\\n     * When a request is completed, returns the result, or undefined if the request failed. Throws a \\\"InvalidStateError\\\" DOMException if the request is still pending.\\n     */\\n    readonly result: T;\\n    /**\\n     * Returns the IDBObjectStore, IDBIndex, or IDBCursor the request was made against, or null if is was an open request.\\n     */\\n    readonly source: IDBObjectStore | IDBIndex | IDBCursor;\\n    /**\\n     * Returns the IDBTransaction the request was made within. If this as an open request, then it returns an upgrade transaction while it is running, or null otherwise.\\n     */\\n    readonly transaction: IDBTransaction | null;\\n    addEventListener<K extends keyof IDBRequestEventMap>(type: K, listener: (this: IDBRequest<T>, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof IDBRequestEventMap>(type: K, listener: (this: IDBRequest<T>, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var IDBRequest: {\\n    prototype: IDBRequest;\\n    new(): IDBRequest;\\n};\\n\\ninterface IDBTransactionEventMap {\\n    \\\"abort\\\": Event;\\n    \\\"complete\\\": Event;\\n    \\\"error\\\": Event;\\n}\\n\\ninterface IDBTransaction extends EventTarget {\\n    /**\\n     * Returns the transaction's connection.\\n     */\\n    readonly db: IDBDatabase;\\n    /**\\n     * If the transaction was aborted, returns the error (a DOMException) providing the reason.\\n     */\\n    readonly error: DOMException;\\n    /**\\n     * Returns the mode the transaction was created with (\\\"readonly\\\" or \\\"readwrite\\\"), or \\\"versionchange\\\" for an upgrade transaction.\\n     */\\n    readonly mode: IDBTransactionMode;\\n    /**\\n     * Returns a list of the names of object stores in the transaction's scope. For an upgrade transaction this is all object stores in the database.\\n     */\\n    readonly objectStoreNames: DOMStringList;\\n    onabort: ((this: IDBTransaction, ev: Event) => any) | null;\\n    oncomplete: ((this: IDBTransaction, ev: Event) => any) | null;\\n    onerror: ((this: IDBTransaction, ev: Event) => any) | null;\\n    /**\\n     * Aborts the transaction. All pending requests will fail with a \\\"AbortError\\\" DOMException and all changes made to the database will be reverted.\\n     */\\n    abort(): void;\\n    /**\\n     * Returns an IDBObjectStore in the transaction's scope.\\n     */\\n    objectStore(name: string): IDBObjectStore;\\n    addEventListener<K extends keyof IDBTransactionEventMap>(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof IDBTransactionEventMap>(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var IDBTransaction: {\\n    prototype: IDBTransaction;\\n    new(): IDBTransaction;\\n};\\n\\n/** This IndexedDB API interface indicates that the version of the database has changed, as the result of an IDBOpenDBRequest.onupgradeneeded event handler function. */\\ninterface IDBVersionChangeEvent extends Event {\\n    readonly newVersion: number | null;\\n    readonly oldVersion: number;\\n}\\n\\ndeclare var IDBVersionChangeEvent: {\\n    prototype: IDBVersionChangeEvent;\\n    new(type: string, eventInitDict?: IDBVersionChangeEventInit): IDBVersionChangeEvent;\\n};\\n\\ninterface ImageBitmap {\\n    /**\\n     * Returns the intrinsic height of the image, in CSS pixels.\\n     */\\n    readonly height: number;\\n    /**\\n     * Returns the intrinsic width of the image, in CSS pixels.\\n     */\\n    readonly width: number;\\n    /**\\n     * Releases imageBitmap's underlying bitmap data.\\n     */\\n    close(): void;\\n}\\n\\ndeclare var ImageBitmap: {\\n    prototype: ImageBitmap;\\n    new(): ImageBitmap;\\n};\\n\\ninterface ImageBitmapRenderingContext {\\n    /**\\n     * Returns the canvas element that the context is bound to.\\n     */\\n    readonly canvas: OffscreenCanvas;\\n    /**\\n     * Transfers the underlying bitmap data from imageBitmap to context, and the bitmap becomes the contents of the canvas element to which context is bound.\\n     */\\n    transferFromImageBitmap(bitmap: ImageBitmap | null): void;\\n}\\n\\ndeclare var ImageBitmapRenderingContext: {\\n    prototype: ImageBitmapRenderingContext;\\n    new(): ImageBitmapRenderingContext;\\n};\\n\\n/** The underlying pixel data of an area of a <canvas> element. It is created using the ImageData() constructor or creator methods on the CanvasRenderingContext2D object associated with a canvas: createImageData() and getImageData(). It can also be used to set a part of the canvas by using putImageData(). */\\ninterface ImageData {\\n    /**\\n     * Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255.\\n     */\\n    readonly data: Uint8ClampedArray;\\n    /**\\n     * Returns the actual dimensions of the data in the ImageData object, in pixels.\\n     */\\n    readonly height: number;\\n    /**\\n     * Returns the actual dimensions of the data in the ImageData object, in pixels.\\n     */\\n    readonly width: number;\\n}\\n\\ndeclare var ImageData: {\\n    prototype: ImageData;\\n    new(sw: number, sh: number): ImageData;\\n    new(data: Uint8ClampedArray, sw: number, sh?: number): ImageData;\\n};\\n\\n/** This Channel Messaging API interface allows us to create a new message channel and send data through it via its two MessagePort properties. */\\ninterface MessageChannel {\\n    /**\\n     * Returns the first MessagePort object.\\n     */\\n    readonly port1: MessagePort;\\n    /**\\n     * Returns the second MessagePort object.\\n     */\\n    readonly port2: MessagePort;\\n}\\n\\ndeclare var MessageChannel: {\\n    prototype: MessageChannel;\\n    new(): MessageChannel;\\n};\\n\\n/** A message received by a target object. */\\ninterface MessageEvent<T = any> extends Event {\\n    /**\\n     * Returns the data of the message.\\n     */\\n    readonly data: T;\\n    /**\\n     * Returns the last event ID string, for server-sent events.\\n     */\\n    readonly lastEventId: string;\\n    /**\\n     * Returns the origin of the message, for server-sent events and cross-document messaging.\\n     */\\n    readonly origin: string;\\n    /**\\n     * Returns the MessagePort array sent with the message, for cross-document messaging and channel messaging.\\n     */\\n    readonly ports: ReadonlyArray<MessagePort>;\\n    /**\\n     * Returns the WindowProxy of the source window, for cross-document messaging, and the MessagePort being attached, in the connect event fired at SharedWorkerGlobalScope objects.\\n     */\\n    readonly source: MessageEventSource | null;\\n}\\n\\ndeclare var MessageEvent: {\\n    prototype: MessageEvent;\\n    new<T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent<T>;\\n};\\n\\ninterface MessagePortEventMap {\\n    \\\"message\\\": MessageEvent;\\n    \\\"messageerror\\\": MessageEvent;\\n}\\n\\n/** This Channel Messaging API interface represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other. */\\ninterface MessagePort extends EventTarget {\\n    onmessage: ((this: MessagePort, ev: MessageEvent) => any) | null;\\n    onmessageerror: ((this: MessagePort, ev: MessageEvent) => any) | null;\\n    /**\\n     * Disconnects the port, so that it is no longer active.\\n     */\\n    close(): void;\\n    /**\\n     * Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side.\\n     * \\n     * Throws a \\\"DataCloneError\\\" DOMException if transfer contains duplicate objects or port, or if message could not be cloned.\\n     */\\n    postMessage(message: any, transfer: Transferable[]): void;\\n    postMessage(message: any, options?: PostMessageOptions): void;\\n    /**\\n     * Begins dispatching messages received on the port.\\n     */\\n    start(): void;\\n    addEventListener<K extends keyof MessagePortEventMap>(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof MessagePortEventMap>(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var MessagePort: {\\n    prototype: MessagePort;\\n    new(): MessagePort;\\n};\\n\\ninterface NavigationPreloadManager {\\n    disable(): Promise<void>;\\n    enable(): Promise<void>;\\n    getState(): Promise<NavigationPreloadState>;\\n    setHeaderValue(value: string): Promise<void>;\\n}\\n\\ndeclare var NavigationPreloadManager: {\\n    prototype: NavigationPreloadManager;\\n    new(): NavigationPreloadManager;\\n};\\n\\ninterface NavigatorConcurrentHardware {\\n    readonly hardwareConcurrency: number;\\n}\\n\\ninterface NavigatorID {\\n    readonly appCodeName: string;\\n    readonly appName: string;\\n    readonly appVersion: string;\\n    readonly platform: string;\\n    readonly product: string;\\n    readonly userAgent: string;\\n}\\n\\ninterface NavigatorLanguage {\\n    readonly language: string;\\n    readonly languages: ReadonlyArray<string>;\\n}\\n\\ninterface NavigatorOnLine {\\n    readonly onLine: boolean;\\n}\\n\\ninterface NavigatorStorage {\\n    readonly storage: StorageManager;\\n}\\n\\ninterface NotificationEventMap {\\n    \\\"click\\\": Event;\\n    \\\"close\\\": Event;\\n    \\\"error\\\": Event;\\n    \\\"show\\\": Event;\\n}\\n\\n/** This Notifications API interface is used to configure and display desktop notifications to the user. */\\ninterface Notification extends EventTarget {\\n    readonly actions: ReadonlyArray<NotificationAction>;\\n    readonly badge: string;\\n    readonly body: string;\\n    readonly data: any;\\n    readonly dir: NotificationDirection;\\n    readonly icon: string;\\n    readonly image: string;\\n    readonly lang: string;\\n    onclick: ((this: Notification, ev: Event) => any) | null;\\n    onclose: ((this: Notification, ev: Event) => any) | null;\\n    onerror: ((this: Notification, ev: Event) => any) | null;\\n    onshow: ((this: Notification, ev: Event) => any) | null;\\n    readonly renotify: boolean;\\n    readonly requireInteraction: boolean;\\n    readonly silent: boolean;\\n    readonly tag: string;\\n    readonly timestamp: number;\\n    readonly title: string;\\n    readonly vibrate: ReadonlyArray<number>;\\n    close(): void;\\n    addEventListener<K extends keyof NotificationEventMap>(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof NotificationEventMap>(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var Notification: {\\n    prototype: Notification;\\n    new(title: string, options?: NotificationOptions): Notification;\\n    readonly maxActions: number;\\n    readonly permission: NotificationPermission;\\n};\\n\\n/** The parameter passed into the onnotificationclick handler, the NotificationEvent interface represents a notification click event that is dispatched on the ServiceWorkerGlobalScope of a ServiceWorker. */\\ninterface NotificationEvent extends ExtendableEvent {\\n    readonly action: string;\\n    readonly notification: Notification;\\n}\\n\\ndeclare var NotificationEvent: {\\n    prototype: NotificationEvent;\\n    new(type: string, eventInitDict: NotificationEventInit): NotificationEvent;\\n};\\n\\n/** The OES_element_index_uint extension is part of the WebGL API and adds support for gl.UNSIGNED_INT types to WebGLRenderingContext.drawElements(). */\\ninterface OES_element_index_uint {\\n}\\n\\n/** The OES_standard_derivatives extension is part of the WebGL API and adds the GLSL derivative functions dFdx, dFdy, and fwidth. */\\ninterface OES_standard_derivatives {\\n    readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: GLenum;\\n}\\n\\n/** The OES_texture_float extension is part of the WebGL API and exposes floating-point pixel types for textures. */\\ninterface OES_texture_float {\\n}\\n\\n/** The OES_texture_float_linear extension is part of the WebGL API and allows linear filtering with floating-point pixel types for textures. */\\ninterface OES_texture_float_linear {\\n}\\n\\n/** The OES_texture_half_float extension is part of the WebGL API and adds texture formats with 16- (aka half float) and 32-bit floating-point components. */\\ninterface OES_texture_half_float {\\n    readonly HALF_FLOAT_OES: GLenum;\\n}\\n\\n/** The OES_texture_half_float_linear extension is part of the WebGL API and allows linear filtering with half floating-point pixel types for textures. */\\ninterface OES_texture_half_float_linear {\\n}\\n\\ninterface OES_vertex_array_object {\\n    bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void;\\n    createVertexArrayOES(): WebGLVertexArrayObjectOES | null;\\n    deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void;\\n    isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): GLboolean;\\n    readonly VERTEX_ARRAY_BINDING_OES: GLenum;\\n}\\n\\ninterface OffscreenCanvas extends EventTarget {\\n    /**\\n     * These attributes return the dimensions of the OffscreenCanvas object's bitmap.\\n     * \\n     * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).\\n     */\\n    height: number;\\n    /**\\n     * These attributes return the dimensions of the OffscreenCanvas object's bitmap.\\n     * \\n     * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).\\n     */\\n    width: number;\\n    /**\\n     * Returns a promise that will fulfill with a new Blob object representing a file containing the image in the OffscreenCanvas object.\\n     * \\n     * The argument, if provided, is a dictionary that controls the encoding options of the image file to be created. The type field specifies the file format and has a default value of \\\"image/png\\\"; that type is also used if the requested type isn't supported. If the image format supports variable quality (such as \\\"image/jpeg\\\"), then the quality field is a number in the range 0.0 to 1.0 inclusive indicating the desired quality level for the resulting image.\\n     */\\n    convertToBlob(options?: ImageEncodeOptions): Promise<Blob>;\\n    /**\\n     * Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: \\\"2d\\\", \\\"bitmaprenderer\\\", \\\"webgl\\\", or \\\"webgl2\\\". options is handled by that API.\\n     * \\n     * This specification defines the \\\"2d\\\" context below, which is similar but distinct from the \\\"2d\\\" context that is created from a canvas element. The WebGL specifications define the \\\"webgl\\\" and \\\"webgl2\\\" contexts. [WEBGL]\\n     * \\n     * Returns null if the canvas has already been initialized with another context type (e.g., trying to get a \\\"2d\\\" context after getting a \\\"webgl\\\" context).\\n     */\\n    getContext(contextId: \\\"2d\\\", options?: CanvasRenderingContext2DSettings): OffscreenCanvasRenderingContext2D | null;\\n    getContext(contextId: \\\"bitmaprenderer\\\", options?: ImageBitmapRenderingContextSettings): ImageBitmapRenderingContext | null;\\n    getContext(contextId: \\\"webgl\\\", options?: WebGLContextAttributes): WebGLRenderingContext | null;\\n    getContext(contextId: \\\"webgl2\\\", options?: WebGLContextAttributes): WebGL2RenderingContext | null;\\n    getContext(contextId: OffscreenRenderingContextId, options?: any): OffscreenRenderingContext | null;\\n    /**\\n     * Returns a newly created ImageBitmap object with the image in the OffscreenCanvas object. The image in the OffscreenCanvas object is replaced with a new blank image.\\n     */\\n    transferToImageBitmap(): ImageBitmap;\\n}\\n\\ndeclare var OffscreenCanvas: {\\n    prototype: OffscreenCanvas;\\n    new(width: number, height: number): OffscreenCanvas;\\n};\\n\\ninterface OffscreenCanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform {\\n    readonly canvas: OffscreenCanvas;\\n    commit(): void;\\n}\\n\\ndeclare var OffscreenCanvasRenderingContext2D: {\\n    prototype: OffscreenCanvasRenderingContext2D;\\n    new(): OffscreenCanvasRenderingContext2D;\\n};\\n\\n/** This Canvas 2D API interface is used to declare a path that can then be used on a CanvasRenderingContext2D object. The path methods of the CanvasRenderingContext2D interface are also present on this interface, which gives you the convenience of being able to retain and replay your path whenever desired. */\\ninterface Path2D extends CanvasPath {\\n    /**\\n     * Adds to the path the path given by the argument.\\n     */\\n    addPath(path: Path2D, transform?: DOMMatrix2DInit): void;\\n}\\n\\ndeclare var Path2D: {\\n    prototype: Path2D;\\n    new(path?: Path2D | string): Path2D;\\n};\\n\\ninterface PerformanceEventMap {\\n    \\\"resourcetimingbufferfull\\\": Event;\\n}\\n\\n/** Provides access to performance-related information for the current page. It's part of the High Resolution Time API, but is enhanced by the Performance Timeline API, the Navigation Timing API, the User Timing API, and the Resource Timing API. */\\ninterface Performance extends EventTarget {\\n    onresourcetimingbufferfull: ((this: Performance, ev: Event) => any) | null;\\n    readonly timeOrigin: number;\\n    clearMarks(markName?: string): void;\\n    clearMeasures(measureName?: string): void;\\n    clearResourceTimings(): void;\\n    getEntries(): PerformanceEntryList;\\n    getEntriesByName(name: string, type?: string): PerformanceEntryList;\\n    getEntriesByType(type: string): PerformanceEntryList;\\n    mark(markName: string): void;\\n    measure(measureName: string, startMark?: string, endMark?: string): void;\\n    now(): number;\\n    setResourceTimingBufferSize(maxSize: number): void;\\n    toJSON(): any;\\n    addEventListener<K extends keyof PerformanceEventMap>(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof PerformanceEventMap>(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var Performance: {\\n    prototype: Performance;\\n    new(): Performance;\\n};\\n\\n/** Encapsulates a single performance metric that is part of the performance timeline. A performance entry can be directly created by making a performance mark or measure (for example by calling the mark() method) at an explicit point in an application. Performance entries are also created in indirect ways such as loading a resource (such as an image). */\\ninterface PerformanceEntry {\\n    readonly duration: number;\\n    readonly entryType: string;\\n    readonly name: string;\\n    readonly startTime: number;\\n    toJSON(): any;\\n}\\n\\ndeclare var PerformanceEntry: {\\n    prototype: PerformanceEntry;\\n    new(): PerformanceEntry;\\n};\\n\\n/** PerformanceMark is an abstract interface for PerformanceEntry objects with an entryType of \\\"mark\\\". Entries of this type are created by calling performance.mark() to add a named DOMHighResTimeStamp (the mark) to the browser's performance timeline. */\\ninterface PerformanceMark extends PerformanceEntry {\\n}\\n\\ndeclare var PerformanceMark: {\\n    prototype: PerformanceMark;\\n    new(): PerformanceMark;\\n};\\n\\n/** PerformanceMeasure is an abstract interface for PerformanceEntry objects with an entryType of \\\"measure\\\". Entries of this type are created by calling performance.measure() to add a named DOMHighResTimeStamp (the measure) between two marks to the browser's performance timeline. */\\ninterface PerformanceMeasure extends PerformanceEntry {\\n}\\n\\ndeclare var PerformanceMeasure: {\\n    prototype: PerformanceMeasure;\\n    new(): PerformanceMeasure;\\n};\\n\\ninterface PerformanceObserver {\\n    disconnect(): void;\\n    observe(options?: PerformanceObserverInit): void;\\n    takeRecords(): PerformanceEntryList;\\n}\\n\\ndeclare var PerformanceObserver: {\\n    prototype: PerformanceObserver;\\n    new(callback: PerformanceObserverCallback): PerformanceObserver;\\n    readonly supportedEntryTypes: ReadonlyArray<string>;\\n};\\n\\ninterface PerformanceObserverEntryList {\\n    getEntries(): PerformanceEntryList;\\n    getEntriesByName(name: string, type?: string): PerformanceEntryList;\\n    getEntriesByType(type: string): PerformanceEntryList;\\n}\\n\\ndeclare var PerformanceObserverEntryList: {\\n    prototype: PerformanceObserverEntryList;\\n    new(): PerformanceObserverEntryList;\\n};\\n\\n/** Enables retrieval and analysis of detailed network timing data regarding the loading of an application's resources. An application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource, such as an XMLHttpRequest, <SVG>, image, or script. */\\ninterface PerformanceResourceTiming extends PerformanceEntry {\\n    readonly connectEnd: number;\\n    readonly connectStart: number;\\n    readonly decodedBodySize: number;\\n    readonly domainLookupEnd: number;\\n    readonly domainLookupStart: number;\\n    readonly encodedBodySize: number;\\n    readonly fetchStart: number;\\n    readonly initiatorType: string;\\n    readonly nextHopProtocol: string;\\n    readonly redirectEnd: number;\\n    readonly redirectStart: number;\\n    readonly requestStart: number;\\n    readonly responseEnd: number;\\n    readonly responseStart: number;\\n    readonly secureConnectionStart: number;\\n    readonly transferSize: number;\\n    readonly workerStart: number;\\n    toJSON(): any;\\n}\\n\\ndeclare var PerformanceResourceTiming: {\\n    prototype: PerformanceResourceTiming;\\n    new(): PerformanceResourceTiming;\\n};\\n\\ninterface PermissionStatusEventMap {\\n    \\\"change\\\": Event;\\n}\\n\\ninterface PermissionStatus extends EventTarget {\\n    onchange: ((this: PermissionStatus, ev: Event) => any) | null;\\n    readonly state: PermissionState;\\n    addEventListener<K extends keyof PermissionStatusEventMap>(type: K, listener: (this: PermissionStatus, ev: PermissionStatusEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof PermissionStatusEventMap>(type: K, listener: (this: PermissionStatus, ev: PermissionStatusEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var PermissionStatus: {\\n    prototype: PermissionStatus;\\n    new(): PermissionStatus;\\n};\\n\\ninterface Permissions {\\n    query(permissionDesc: PermissionDescriptor | DevicePermissionDescriptor | MidiPermissionDescriptor | PushPermissionDescriptor): Promise<PermissionStatus>;\\n}\\n\\ndeclare var Permissions: {\\n    prototype: Permissions;\\n    new(): Permissions;\\n};\\n\\n/** Events measuring progress of an underlying process, like an HTTP request (for an XMLHttpRequest, or the loading of the underlying resource of an <img>, <audio>, <video>, <style> or <link>). */\\ninterface ProgressEvent<T extends EventTarget = EventTarget> extends Event {\\n    readonly lengthComputable: boolean;\\n    readonly loaded: number;\\n    readonly target: T | null;\\n    readonly total: number;\\n}\\n\\ndeclare var ProgressEvent: {\\n    prototype: ProgressEvent;\\n    new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent;\\n};\\n\\ninterface PromiseRejectionEvent extends Event {\\n    readonly promise: Promise<any>;\\n    readonly reason: any;\\n}\\n\\ndeclare var PromiseRejectionEvent: {\\n    prototype: PromiseRejectionEvent;\\n    new(type: string, eventInitDict: PromiseRejectionEventInit): PromiseRejectionEvent;\\n};\\n\\n/** This Push API interface represents a push message that has been received. This event is sent to the global scope of a ServiceWorker. It contains the information sent from an application server to a PushSubscription. */\\ninterface PushEvent extends ExtendableEvent {\\n    readonly data: PushMessageData | null;\\n}\\n\\ndeclare var PushEvent: {\\n    prototype: PushEvent;\\n    new(type: string, eventInitDict?: PushEventInit): PushEvent;\\n};\\n\\n/** This Push API interface provides a way to receive notifications from third-party servers as well as request URLs for push notifications. */\\ninterface PushManager {\\n    getSubscription(): Promise<PushSubscription | null>;\\n    permissionState(options?: PushSubscriptionOptionsInit): Promise<PushPermissionState>;\\n    subscribe(options?: PushSubscriptionOptionsInit): Promise<PushSubscription>;\\n}\\n\\ndeclare var PushManager: {\\n    prototype: PushManager;\\n    new(): PushManager;\\n    readonly supportedContentEncodings: ReadonlyArray<string>;\\n};\\n\\n/** This Push API interface provides methods which let you retrieve the push data sent by a server in various formats. */\\ninterface PushMessageData {\\n    arrayBuffer(): ArrayBuffer;\\n    blob(): Blob;\\n    json(): any;\\n    text(): string;\\n}\\n\\ndeclare var PushMessageData: {\\n    prototype: PushMessageData;\\n    new(): PushMessageData;\\n};\\n\\n/** This Push API interface provides a subcription's URL endpoint and allows unsubscription from a push service. */\\ninterface PushSubscription {\\n    readonly endpoint: string;\\n    readonly expirationTime: number | null;\\n    readonly options: PushSubscriptionOptions;\\n    getKey(name: PushEncryptionKeyName): ArrayBuffer | null;\\n    toJSON(): PushSubscriptionJSON;\\n    unsubscribe(): Promise<boolean>;\\n}\\n\\ndeclare var PushSubscription: {\\n    prototype: PushSubscription;\\n    new(): PushSubscription;\\n};\\n\\ninterface PushSubscriptionChangeEvent extends ExtendableEvent {\\n    readonly newSubscription: PushSubscription | null;\\n    readonly oldSubscription: PushSubscription | null;\\n}\\n\\ndeclare var PushSubscriptionChangeEvent: {\\n    prototype: PushSubscriptionChangeEvent;\\n    new(type: string, eventInitDict?: PushSubscriptionChangeEventInit): PushSubscriptionChangeEvent;\\n};\\n\\ninterface PushSubscriptionOptions {\\n    readonly applicationServerKey: ArrayBuffer | null;\\n    readonly userVisibleOnly: boolean;\\n}\\n\\ndeclare var PushSubscriptionOptions: {\\n    prototype: PushSubscriptionOptions;\\n    new(): PushSubscriptionOptions;\\n};\\n\\n/** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */\\ninterface ReadableStream<R = any> {\\n    readonly locked: boolean;\\n    cancel(reason?: any): Promise<void>;\\n    getReader(): ReadableStreamDefaultReader<R>;\\n    pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;\\n    pipeTo(dest: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;\\n    tee(): [ReadableStream<R>, ReadableStream<R>];\\n}\\n\\ndeclare var ReadableStream: {\\n    prototype: ReadableStream;\\n    new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;\\n};\\n\\ninterface ReadableStreamDefaultController<R = any> {\\n    readonly desiredSize: number | null;\\n    close(): void;\\n    enqueue(chunk: R): void;\\n    error(e?: any): void;\\n}\\n\\ndeclare var ReadableStreamDefaultController: {\\n    prototype: ReadableStreamDefaultController;\\n    new(): ReadableStreamDefaultController;\\n};\\n\\ninterface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {\\n    read(): Promise<ReadableStreamDefaultReadResult<R>>;\\n    releaseLock(): void;\\n}\\n\\ndeclare var ReadableStreamDefaultReader: {\\n    prototype: ReadableStreamDefaultReader;\\n    new<R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;\\n};\\n\\ninterface ReadableStreamGenericReader {\\n    readonly closed: Promise<undefined>;\\n    cancel(reason?: any): Promise<void>;\\n}\\n\\n/** This Fetch API interface represents a resource request. */\\ninterface Request extends Body {\\n    /**\\n     * Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.\\n     */\\n    readonly cache: RequestCache;\\n    /**\\n     * Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL.\\n     */\\n    readonly credentials: RequestCredentials;\\n    /**\\n     * Returns the kind of resource requested by request, e.g., \\\"document\\\" or \\\"script\\\".\\n     */\\n    readonly destination: RequestDestination;\\n    /**\\n     * Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the \\\"Host\\\" header.\\n     */\\n    readonly headers: Headers;\\n    /**\\n     * Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]\\n     */\\n    readonly integrity: string;\\n    /**\\n     * Returns a boolean indicating whether or not request is for a history navigation (a.k.a. back-foward navigation).\\n     */\\n    readonly isHistoryNavigation: boolean;\\n    /**\\n     * Returns a boolean indicating whether or not request is for a reload navigation.\\n     */\\n    readonly isReloadNavigation: boolean;\\n    /**\\n     * Returns a boolean indicating whether or not request can outlive the global in which it was created.\\n     */\\n    readonly keepalive: boolean;\\n    /**\\n     * Returns request's HTTP method, which is \\\"GET\\\" by default.\\n     */\\n    readonly method: string;\\n    /**\\n     * Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs.\\n     */\\n    readonly mode: RequestMode;\\n    /**\\n     * Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.\\n     */\\n    readonly redirect: RequestRedirect;\\n    /**\\n     * Returns the referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and \\\"about:client\\\" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made.\\n     */\\n    readonly referrer: string;\\n    /**\\n     * Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer.\\n     */\\n    readonly referrerPolicy: ReferrerPolicy;\\n    /**\\n     * Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.\\n     */\\n    readonly signal: AbortSignal;\\n    /**\\n     * Returns the URL of request as a string.\\n     */\\n    readonly url: string;\\n    clone(): Request;\\n}\\n\\ndeclare var Request: {\\n    prototype: Request;\\n    new(input: RequestInfo, init?: RequestInit): Request;\\n};\\n\\n/** This Fetch API interface represents the response to a request. */\\ninterface Response extends Body {\\n    readonly headers: Headers;\\n    readonly ok: boolean;\\n    readonly redirected: boolean;\\n    readonly status: number;\\n    readonly statusText: string;\\n    readonly trailer: Promise<Headers>;\\n    readonly type: ResponseType;\\n    readonly url: string;\\n    clone(): Response;\\n}\\n\\ndeclare var Response: {\\n    prototype: Response;\\n    new(body?: BodyInit | null, init?: ResponseInit): Response;\\n    error(): Response;\\n    redirect(url: string, status?: number): Response;\\n};\\n\\ninterface ServiceWorkerEventMap extends AbstractWorkerEventMap {\\n    \\\"statechange\\\": Event;\\n}\\n\\n/** This ServiceWorker API interface provides a reference to a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique ServiceWorker object. */\\ninterface ServiceWorker extends EventTarget, AbstractWorker {\\n    onstatechange: ((this: ServiceWorker, ev: Event) => any) | null;\\n    readonly scriptURL: string;\\n    readonly state: ServiceWorkerState;\\n    postMessage(message: any, transfer: Transferable[]): void;\\n    postMessage(message: any, options?: PostMessageOptions): void;\\n    addEventListener<K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var ServiceWorker: {\\n    prototype: ServiceWorker;\\n    new(): ServiceWorker;\\n};\\n\\ninterface ServiceWorkerContainerEventMap {\\n    \\\"controllerchange\\\": Event;\\n    \\\"message\\\": MessageEvent;\\n    \\\"messageerror\\\": MessageEvent;\\n}\\n\\n/** The ServiceWorkerContainer interface of the ServiceWorker API provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations. */\\ninterface ServiceWorkerContainer extends EventTarget {\\n    readonly controller: ServiceWorker | null;\\n    oncontrollerchange: ((this: ServiceWorkerContainer, ev: Event) => any) | null;\\n    onmessage: ((this: ServiceWorkerContainer, ev: MessageEvent) => any) | null;\\n    onmessageerror: ((this: ServiceWorkerContainer, ev: MessageEvent) => any) | null;\\n    readonly ready: Promise<ServiceWorkerRegistration>;\\n    getRegistration(clientURL?: string): Promise<ServiceWorkerRegistration | undefined>;\\n    getRegistrations(): Promise<ReadonlyArray<ServiceWorkerRegistration>>;\\n    register(scriptURL: string | URL, options?: RegistrationOptions): Promise<ServiceWorkerRegistration>;\\n    startMessages(): void;\\n    addEventListener<K extends keyof ServiceWorkerContainerEventMap>(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof ServiceWorkerContainerEventMap>(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var ServiceWorkerContainer: {\\n    prototype: ServiceWorkerContainer;\\n    new(): ServiceWorkerContainer;\\n};\\n\\ninterface ServiceWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap {\\n    \\\"activate\\\": ExtendableEvent;\\n    \\\"fetch\\\": FetchEvent;\\n    \\\"install\\\": ExtendableEvent;\\n    \\\"message\\\": ExtendableMessageEvent;\\n    \\\"messageerror\\\": MessageEvent;\\n    \\\"notificationclick\\\": NotificationEvent;\\n    \\\"notificationclose\\\": NotificationEvent;\\n    \\\"push\\\": PushEvent;\\n    \\\"pushsubscriptionchange\\\": PushSubscriptionChangeEvent;\\n    \\\"sync\\\": SyncEvent;\\n}\\n\\n/** This ServiceWorker API interface represents the global execution context of a service worker. */\\ninterface ServiceWorkerGlobalScope extends WorkerGlobalScope {\\n    readonly clients: Clients;\\n    onactivate: ((this: ServiceWorkerGlobalScope, ev: ExtendableEvent) => any) | null;\\n    onfetch: ((this: ServiceWorkerGlobalScope, ev: FetchEvent) => any) | null;\\n    oninstall: ((this: ServiceWorkerGlobalScope, ev: ExtendableEvent) => any) | null;\\n    onmessage: ((this: ServiceWorkerGlobalScope, ev: ExtendableMessageEvent) => any) | null;\\n    onmessageerror: ((this: ServiceWorkerGlobalScope, ev: MessageEvent) => any) | null;\\n    onnotificationclick: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null;\\n    onnotificationclose: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null;\\n    onpush: ((this: ServiceWorkerGlobalScope, ev: PushEvent) => any) | null;\\n    onpushsubscriptionchange: ((this: ServiceWorkerGlobalScope, ev: PushSubscriptionChangeEvent) => any) | null;\\n    onsync: ((this: ServiceWorkerGlobalScope, ev: SyncEvent) => any) | null;\\n    readonly registration: ServiceWorkerRegistration;\\n    readonly serviceWorker: ServiceWorker;\\n    skipWaiting(): Promise<void>;\\n    addEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var ServiceWorkerGlobalScope: {\\n    prototype: ServiceWorkerGlobalScope;\\n    new(): ServiceWorkerGlobalScope;\\n};\\n\\ninterface ServiceWorkerRegistrationEventMap {\\n    \\\"updatefound\\\": Event;\\n}\\n\\n/** This ServiceWorker API interface represents the service worker registration. You register a service worker to control one or more pages that share the same origin. */\\ninterface ServiceWorkerRegistration extends EventTarget {\\n    readonly active: ServiceWorker | null;\\n    readonly installing: ServiceWorker | null;\\n    readonly navigationPreload: NavigationPreloadManager;\\n    onupdatefound: ((this: ServiceWorkerRegistration, ev: Event) => any) | null;\\n    readonly pushManager: PushManager;\\n    readonly scope: string;\\n    readonly sync: SyncManager;\\n    readonly updateViaCache: ServiceWorkerUpdateViaCache;\\n    readonly waiting: ServiceWorker | null;\\n    getNotifications(filter?: GetNotificationOptions): Promise<Notification[]>;\\n    showNotification(title: string, options?: NotificationOptions): Promise<void>;\\n    unregister(): Promise<boolean>;\\n    update(): Promise<void>;\\n    addEventListener<K extends keyof ServiceWorkerRegistrationEventMap>(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof ServiceWorkerRegistrationEventMap>(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var ServiceWorkerRegistration: {\\n    prototype: ServiceWorkerRegistration;\\n    new(): ServiceWorkerRegistration;\\n};\\n\\ninterface SharedWorker extends EventTarget, AbstractWorker {\\n    /**\\n     * Returns sharedWorker's MessagePort object which can be used to communicate with the global environment.\\n     */\\n    readonly port: MessagePort;\\n    addEventListener<K extends keyof AbstractWorkerEventMap>(type: K, listener: (this: SharedWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof AbstractWorkerEventMap>(type: K, listener: (this: SharedWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SharedWorker: {\\n    prototype: SharedWorker;\\n    new(scriptURL: string, options?: string | WorkerOptions): SharedWorker;\\n};\\n\\ninterface SharedWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap {\\n    \\\"connect\\\": MessageEvent;\\n}\\n\\ninterface SharedWorkerGlobalScope extends WorkerGlobalScope {\\n    /**\\n     * Returns sharedWorkerGlobal's name, i.e. the value given to the SharedWorker constructor. Multiple SharedWorker objects can correspond to the same shared worker (and SharedWorkerGlobalScope), by reusing the same name.\\n     */\\n    readonly name: string;\\n    onconnect: ((this: SharedWorkerGlobalScope, ev: MessageEvent) => any) | null;\\n    /**\\n     * Aborts sharedWorkerGlobal.\\n     */\\n    close(): void;\\n    addEventListener<K extends keyof SharedWorkerGlobalScopeEventMap>(type: K, listener: (this: SharedWorkerGlobalScope, ev: SharedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof SharedWorkerGlobalScopeEventMap>(type: K, listener: (this: SharedWorkerGlobalScope, ev: SharedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var SharedWorkerGlobalScope: {\\n    prototype: SharedWorkerGlobalScope;\\n    new(): SharedWorkerGlobalScope;\\n};\\n\\ninterface StorageManager {\\n    estimate(): Promise<StorageEstimate>;\\n    persisted(): Promise<boolean>;\\n}\\n\\ndeclare var StorageManager: {\\n    prototype: StorageManager;\\n    new(): StorageManager;\\n};\\n\\n/** This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto). */\\ninterface SubtleCrypto {\\n    decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<ArrayBuffer>;\\n    deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;\\n    deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;\\n    digest(algorithm: AlgorithmIdentifier, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<ArrayBuffer>;\\n    encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<ArrayBuffer>;\\n    exportKey(format: \\\"jwk\\\", key: CryptoKey): Promise<JsonWebKey>;\\n    exportKey(format: \\\"raw\\\" | \\\"pkcs8\\\" | \\\"spki\\\", key: CryptoKey): Promise<ArrayBuffer>;\\n    exportKey(format: string, key: CryptoKey): Promise<JsonWebKey | ArrayBuffer>;\\n    generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;\\n    generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;\\n    generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;\\n    importKey(format: \\\"jwk\\\", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;\\n    importKey(format: \\\"raw\\\" | \\\"pkcs8\\\" | \\\"spki\\\", keyData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;\\n    importKey(format: string, keyData: JsonWebKey | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;\\n    sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<ArrayBuffer>;\\n    unwrapKey(format: \\\"raw\\\" | \\\"pkcs8\\\" | \\\"spki\\\" | \\\"jwk\\\" | string, wrappedKey: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;\\n    verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise<boolean>;\\n    wrapKey(format: \\\"raw\\\" | \\\"pkcs8\\\" | \\\"spki\\\" | \\\"jwk\\\" | string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams): Promise<ArrayBuffer>;\\n}\\n\\ndeclare var SubtleCrypto: {\\n    prototype: SubtleCrypto;\\n    new(): SubtleCrypto;\\n};\\n\\n/** A sync action that is dispatched on the ServiceWorkerGlobalScope of a ServiceWorker.  */\\ninterface SyncEvent extends ExtendableEvent {\\n    readonly lastChance: boolean;\\n    readonly tag: string;\\n}\\n\\ndeclare var SyncEvent: {\\n    prototype: SyncEvent;\\n    new(type: string, init: SyncEventInit): SyncEvent;\\n};\\n\\n/** This ServiceWorker API interface provides an interface for registering and listing sync registrations. */\\ninterface SyncManager {\\n    getTags(): Promise<string[]>;\\n    register(tag: string): Promise<void>;\\n}\\n\\ndeclare var SyncManager: {\\n    prototype: SyncManager;\\n    new(): SyncManager;\\n};\\n\\n/** A decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc. A decoder takes a stream of bytes as input and emits a stream of code points. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays. */\\ninterface TextDecoder extends TextDecoderCommon {\\n    /**\\n     * Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented input. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.\\n     * \\n     * ```\\n     * var string = \\\"\\\", decoder = new TextDecoder(encoding), buffer;\\n     * while(buffer = next_chunk()) {\\n     *   string += decoder.decode(buffer, {stream:true});\\n     * }\\n     * string += decoder.decode(); // end-of-queue\\n     * ```\\n     * \\n     * If the error mode is \\\"fatal\\\" and encoding's decoder returns error, throws a TypeError.\\n     */\\n    decode(input?: BufferSource, options?: TextDecodeOptions): string;\\n}\\n\\ndeclare var TextDecoder: {\\n    prototype: TextDecoder;\\n    new(label?: string, options?: TextDecoderOptions): TextDecoder;\\n};\\n\\ninterface TextDecoderCommon {\\n    /**\\n     * Returns encoding's name, lowercased.\\n     */\\n    readonly encoding: string;\\n    /**\\n     * Returns true if error mode is \\\"fatal\\\", otherwise false.\\n     */\\n    readonly fatal: boolean;\\n    /**\\n     * Returns the value of ignore BOM.\\n     */\\n    readonly ignoreBOM: boolean;\\n}\\n\\ninterface TextDecoderStream extends GenericTransformStream, TextDecoderCommon {\\n    readonly readable: ReadableStream<string>;\\n    readonly writable: WritableStream<BufferSource>;\\n}\\n\\ndeclare var TextDecoderStream: {\\n    prototype: TextDecoderStream;\\n    new(label?: string, options?: TextDecoderOptions): TextDecoderStream;\\n};\\n\\n/** TextEncoder takes a stream of code points as input and emits a stream of bytes. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays. */\\ninterface TextEncoder extends TextEncoderCommon {\\n    /**\\n     * Returns the result of running UTF-8's encoder.\\n     */\\n    encode(input?: string): Uint8Array;\\n    /**\\n     * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination.\\n     */\\n    encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult;\\n}\\n\\ndeclare var TextEncoder: {\\n    prototype: TextEncoder;\\n    new(): TextEncoder;\\n};\\n\\ninterface TextEncoderCommon {\\n    /**\\n     * Returns \\\"utf-8\\\".\\n     */\\n    readonly encoding: string;\\n}\\n\\ninterface TextEncoderStream extends GenericTransformStream, TextEncoderCommon {\\n    readonly readable: ReadableStream<Uint8Array>;\\n    readonly writable: WritableStream<string>;\\n}\\n\\ndeclare var TextEncoderStream: {\\n    prototype: TextEncoderStream;\\n    new(): TextEncoderStream;\\n};\\n\\n/** The dimensions of a piece of text in the canvas, as created by the CanvasRenderingContext2D.measureText() method. */\\ninterface TextMetrics {\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly actualBoundingBoxAscent: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly actualBoundingBoxDescent: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly actualBoundingBoxLeft: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly actualBoundingBoxRight: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly alphabeticBaseline: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly emHeightAscent: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly emHeightDescent: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly fontBoundingBoxAscent: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly fontBoundingBoxDescent: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly hangingBaseline: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly ideographicBaseline: number;\\n    /**\\n     * Returns the measurement described below.\\n     */\\n    readonly width: number;\\n}\\n\\ndeclare var TextMetrics: {\\n    prototype: TextMetrics;\\n    new(): TextMetrics;\\n};\\n\\ninterface TransformStream<I = any, O = any> {\\n    readonly readable: ReadableStream<O>;\\n    readonly writable: WritableStream<I>;\\n}\\n\\ndeclare var TransformStream: {\\n    prototype: TransformStream;\\n    new<I = any, O = any>(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>): TransformStream<I, O>;\\n};\\n\\ninterface TransformStreamDefaultController<O = any> {\\n    readonly desiredSize: number | null;\\n    enqueue(chunk: O): void;\\n    error(reason?: any): void;\\n    terminate(): void;\\n}\\n\\ndeclare var TransformStreamDefaultController: {\\n    prototype: TransformStreamDefaultController;\\n    new(): TransformStreamDefaultController;\\n};\\n\\n/** The URL interface represents an object providing static methods used for creating object URLs. */\\ninterface URL {\\n    hash: string;\\n    host: string;\\n    hostname: string;\\n    href: string;\\n    toString(): string;\\n    readonly origin: string;\\n    password: string;\\n    pathname: string;\\n    port: string;\\n    protocol: string;\\n    search: string;\\n    readonly searchParams: URLSearchParams;\\n    username: string;\\n    toJSON(): string;\\n}\\n\\ndeclare var URL: {\\n    prototype: URL;\\n    new(url: string, base?: string | URL): URL;\\n    createObjectURL(object: any): string;\\n    revokeObjectURL(url: string): void;\\n};\\n\\ninterface URLSearchParams {\\n    /**\\n     * Appends a specified key/value pair as a new search parameter.\\n     */\\n    append(name: string, value: string): void;\\n    /**\\n     * Deletes the given search parameter, and its associated value, from the list of all search parameters.\\n     */\\n    delete(name: string): void;\\n    /**\\n     * Returns the first value associated to the given search parameter.\\n     */\\n    get(name: string): string | null;\\n    /**\\n     * Returns all the values association with a given search parameter.\\n     */\\n    getAll(name: string): string[];\\n    /**\\n     * Returns a Boolean indicating if such a search parameter exists.\\n     */\\n    has(name: string): boolean;\\n    /**\\n     * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.\\n     */\\n    set(name: string, value: string): void;\\n    sort(): void;\\n    /**\\n     * Returns a string containing a query string suitable for use in a URL. Does not include the question mark.\\n     */\\n    toString(): string;\\n    forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void;\\n}\\n\\ndeclare var URLSearchParams: {\\n    prototype: URLSearchParams;\\n    new(init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;\\n    toString(): string;\\n};\\n\\ninterface WEBGL_color_buffer_float {\\n    readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum;\\n    readonly RGBA32F_EXT: GLenum;\\n    readonly UNSIGNED_NORMALIZED_EXT: GLenum;\\n}\\n\\ninterface WEBGL_compressed_texture_astc {\\n    getSupportedProfiles(): string[];\\n    readonly COMPRESSED_RGBA_ASTC_10x10_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_10x5_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_10x6_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_10x8_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_12x10_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_12x12_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_4x4_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_5x4_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_5x5_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_6x5_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_6x6_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_8x5_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_8x6_KHR: GLenum;\\n    readonly COMPRESSED_RGBA_ASTC_8x8_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: GLenum;\\n    readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: GLenum;\\n}\\n\\n/** The WEBGL_compressed_texture_s3tc extension is part of the WebGL API and exposes four S3TC compressed texture formats. */\\ninterface WEBGL_compressed_texture_s3tc {\\n    readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: GLenum;\\n    readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: GLenum;\\n    readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: GLenum;\\n    readonly COMPRESSED_RGB_S3TC_DXT1_EXT: GLenum;\\n}\\n\\ninterface WEBGL_compressed_texture_s3tc_srgb {\\n    readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: GLenum;\\n    readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: GLenum;\\n    readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: GLenum;\\n    readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: GLenum;\\n}\\n\\n/** The WEBGL_debug_renderer_info extension is part of the WebGL API and exposes two constants with information about the graphics driver for debugging purposes. */\\ninterface WEBGL_debug_renderer_info {\\n    readonly UNMASKED_RENDERER_WEBGL: GLenum;\\n    readonly UNMASKED_VENDOR_WEBGL: GLenum;\\n}\\n\\ninterface WEBGL_debug_shaders {\\n    getTranslatedShaderSource(shader: WebGLShader): string;\\n}\\n\\n/** The WEBGL_depth_texture extension is part of the WebGL API and defines 2D depth and depth-stencil textures. */\\ninterface WEBGL_depth_texture {\\n    readonly UNSIGNED_INT_24_8_WEBGL: GLenum;\\n}\\n\\ninterface WEBGL_draw_buffers {\\n    drawBuffersWEBGL(buffers: GLenum[]): void;\\n    readonly COLOR_ATTACHMENT0_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT10_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT11_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT12_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT13_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT14_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT15_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT1_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT2_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT3_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT4_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT5_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT6_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT7_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT8_WEBGL: GLenum;\\n    readonly COLOR_ATTACHMENT9_WEBGL: GLenum;\\n    readonly DRAW_BUFFER0_WEBGL: GLenum;\\n    readonly DRAW_BUFFER10_WEBGL: GLenum;\\n    readonly DRAW_BUFFER11_WEBGL: GLenum;\\n    readonly DRAW_BUFFER12_WEBGL: GLenum;\\n    readonly DRAW_BUFFER13_WEBGL: GLenum;\\n    readonly DRAW_BUFFER14_WEBGL: GLenum;\\n    readonly DRAW_BUFFER15_WEBGL: GLenum;\\n    readonly DRAW_BUFFER1_WEBGL: GLenum;\\n    readonly DRAW_BUFFER2_WEBGL: GLenum;\\n    readonly DRAW_BUFFER3_WEBGL: GLenum;\\n    readonly DRAW_BUFFER4_WEBGL: GLenum;\\n    readonly DRAW_BUFFER5_WEBGL: GLenum;\\n    readonly DRAW_BUFFER6_WEBGL: GLenum;\\n    readonly DRAW_BUFFER7_WEBGL: GLenum;\\n    readonly DRAW_BUFFER8_WEBGL: GLenum;\\n    readonly DRAW_BUFFER9_WEBGL: GLenum;\\n    readonly MAX_COLOR_ATTACHMENTS_WEBGL: GLenum;\\n    readonly MAX_DRAW_BUFFERS_WEBGL: GLenum;\\n}\\n\\ninterface WEBGL_lose_context {\\n    loseContext(): void;\\n    restoreContext(): void;\\n}\\n\\ninterface WebGL2RenderingContext extends WebGL2RenderingContextBase, WebGL2RenderingContextOverloads, WebGLRenderingContextBase {\\n}\\n\\ndeclare var WebGL2RenderingContext: {\\n    prototype: WebGL2RenderingContext;\\n    new(): WebGL2RenderingContext;\\n    readonly ACTIVE_ATTRIBUTES: GLenum;\\n    readonly ACTIVE_TEXTURE: GLenum;\\n    readonly ACTIVE_UNIFORMS: GLenum;\\n    readonly ALIASED_LINE_WIDTH_RANGE: GLenum;\\n    readonly ALIASED_POINT_SIZE_RANGE: GLenum;\\n    readonly ALPHA: GLenum;\\n    readonly ALPHA_BITS: GLenum;\\n    readonly ALWAYS: GLenum;\\n    readonly ARRAY_BUFFER: GLenum;\\n    readonly ARRAY_BUFFER_BINDING: GLenum;\\n    readonly ATTACHED_SHADERS: GLenum;\\n    readonly BACK: GLenum;\\n    readonly BLEND: GLenum;\\n    readonly BLEND_COLOR: GLenum;\\n    readonly BLEND_DST_ALPHA: GLenum;\\n    readonly BLEND_DST_RGB: GLenum;\\n    readonly BLEND_EQUATION: GLenum;\\n    readonly BLEND_EQUATION_ALPHA: GLenum;\\n    readonly BLEND_EQUATION_RGB: GLenum;\\n    readonly BLEND_SRC_ALPHA: GLenum;\\n    readonly BLEND_SRC_RGB: GLenum;\\n    readonly BLUE_BITS: GLenum;\\n    readonly BOOL: GLenum;\\n    readonly BOOL_VEC2: GLenum;\\n    readonly BOOL_VEC3: GLenum;\\n    readonly BOOL_VEC4: GLenum;\\n    readonly BROWSER_DEFAULT_WEBGL: GLenum;\\n    readonly BUFFER_SIZE: GLenum;\\n    readonly BUFFER_USAGE: GLenum;\\n    readonly BYTE: GLenum;\\n    readonly CCW: GLenum;\\n    readonly CLAMP_TO_EDGE: GLenum;\\n    readonly COLOR_ATTACHMENT0: GLenum;\\n    readonly COLOR_BUFFER_BIT: GLenum;\\n    readonly COLOR_CLEAR_VALUE: GLenum;\\n    readonly COLOR_WRITEMASK: GLenum;\\n    readonly COMPILE_STATUS: GLenum;\\n    readonly COMPRESSED_TEXTURE_FORMATS: GLenum;\\n    readonly CONSTANT_ALPHA: GLenum;\\n    readonly CONSTANT_COLOR: GLenum;\\n    readonly CONTEXT_LOST_WEBGL: GLenum;\\n    readonly CULL_FACE: GLenum;\\n    readonly CULL_FACE_MODE: GLenum;\\n    readonly CURRENT_PROGRAM: GLenum;\\n    readonly CURRENT_VERTEX_ATTRIB: GLenum;\\n    readonly CW: GLenum;\\n    readonly DECR: GLenum;\\n    readonly DECR_WRAP: GLenum;\\n    readonly DELETE_STATUS: GLenum;\\n    readonly DEPTH_ATTACHMENT: GLenum;\\n    readonly DEPTH_BITS: GLenum;\\n    readonly DEPTH_BUFFER_BIT: GLenum;\\n    readonly DEPTH_CLEAR_VALUE: GLenum;\\n    readonly DEPTH_COMPONENT: GLenum;\\n    readonly DEPTH_COMPONENT16: GLenum;\\n    readonly DEPTH_FUNC: GLenum;\\n    readonly DEPTH_RANGE: GLenum;\\n    readonly DEPTH_STENCIL: GLenum;\\n    readonly DEPTH_STENCIL_ATTACHMENT: GLenum;\\n    readonly DEPTH_TEST: GLenum;\\n    readonly DEPTH_WRITEMASK: GLenum;\\n    readonly DITHER: GLenum;\\n    readonly DONT_CARE: GLenum;\\n    readonly DST_ALPHA: GLenum;\\n    readonly DST_COLOR: GLenum;\\n    readonly DYNAMIC_DRAW: GLenum;\\n    readonly ELEMENT_ARRAY_BUFFER: GLenum;\\n    readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum;\\n    readonly EQUAL: GLenum;\\n    readonly FASTEST: GLenum;\\n    readonly FLOAT: GLenum;\\n    readonly FLOAT_MAT2: GLenum;\\n    readonly FLOAT_MAT3: GLenum;\\n    readonly FLOAT_MAT4: GLenum;\\n    readonly FLOAT_VEC2: GLenum;\\n    readonly FLOAT_VEC3: GLenum;\\n    readonly FLOAT_VEC4: GLenum;\\n    readonly FRAGMENT_SHADER: GLenum;\\n    readonly FRAMEBUFFER: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum;\\n    readonly FRAMEBUFFER_BINDING: GLenum;\\n    readonly FRAMEBUFFER_COMPLETE: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum;\\n    readonly FRAMEBUFFER_UNSUPPORTED: GLenum;\\n    readonly FRONT: GLenum;\\n    readonly FRONT_AND_BACK: GLenum;\\n    readonly FRONT_FACE: GLenum;\\n    readonly FUNC_ADD: GLenum;\\n    readonly FUNC_REVERSE_SUBTRACT: GLenum;\\n    readonly FUNC_SUBTRACT: GLenum;\\n    readonly GENERATE_MIPMAP_HINT: GLenum;\\n    readonly GEQUAL: GLenum;\\n    readonly GREATER: GLenum;\\n    readonly GREEN_BITS: GLenum;\\n    readonly HIGH_FLOAT: GLenum;\\n    readonly HIGH_INT: GLenum;\\n    readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum;\\n    readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum;\\n    readonly INCR: GLenum;\\n    readonly INCR_WRAP: GLenum;\\n    readonly INT: GLenum;\\n    readonly INT_VEC2: GLenum;\\n    readonly INT_VEC3: GLenum;\\n    readonly INT_VEC4: GLenum;\\n    readonly INVALID_ENUM: GLenum;\\n    readonly INVALID_FRAMEBUFFER_OPERATION: GLenum;\\n    readonly INVALID_OPERATION: GLenum;\\n    readonly INVALID_VALUE: GLenum;\\n    readonly INVERT: GLenum;\\n    readonly KEEP: GLenum;\\n    readonly LEQUAL: GLenum;\\n    readonly LESS: GLenum;\\n    readonly LINEAR: GLenum;\\n    readonly LINEAR_MIPMAP_LINEAR: GLenum;\\n    readonly LINEAR_MIPMAP_NEAREST: GLenum;\\n    readonly LINES: GLenum;\\n    readonly LINE_LOOP: GLenum;\\n    readonly LINE_STRIP: GLenum;\\n    readonly LINE_WIDTH: GLenum;\\n    readonly LINK_STATUS: GLenum;\\n    readonly LOW_FLOAT: GLenum;\\n    readonly LOW_INT: GLenum;\\n    readonly LUMINANCE: GLenum;\\n    readonly LUMINANCE_ALPHA: GLenum;\\n    readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum;\\n    readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum;\\n    readonly MAX_RENDERBUFFER_SIZE: GLenum;\\n    readonly MAX_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_TEXTURE_SIZE: GLenum;\\n    readonly MAX_VARYING_VECTORS: GLenum;\\n    readonly MAX_VERTEX_ATTRIBS: GLenum;\\n    readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum;\\n    readonly MAX_VIEWPORT_DIMS: GLenum;\\n    readonly MEDIUM_FLOAT: GLenum;\\n    readonly MEDIUM_INT: GLenum;\\n    readonly MIRRORED_REPEAT: GLenum;\\n    readonly NEAREST: GLenum;\\n    readonly NEAREST_MIPMAP_LINEAR: GLenum;\\n    readonly NEAREST_MIPMAP_NEAREST: GLenum;\\n    readonly NEVER: GLenum;\\n    readonly NICEST: GLenum;\\n    readonly NONE: GLenum;\\n    readonly NOTEQUAL: GLenum;\\n    readonly NO_ERROR: GLenum;\\n    readonly ONE: GLenum;\\n    readonly ONE_MINUS_CONSTANT_ALPHA: GLenum;\\n    readonly ONE_MINUS_CONSTANT_COLOR: GLenum;\\n    readonly ONE_MINUS_DST_ALPHA: GLenum;\\n    readonly ONE_MINUS_DST_COLOR: GLenum;\\n    readonly ONE_MINUS_SRC_ALPHA: GLenum;\\n    readonly ONE_MINUS_SRC_COLOR: GLenum;\\n    readonly OUT_OF_MEMORY: GLenum;\\n    readonly PACK_ALIGNMENT: GLenum;\\n    readonly POINTS: GLenum;\\n    readonly POLYGON_OFFSET_FACTOR: GLenum;\\n    readonly POLYGON_OFFSET_FILL: GLenum;\\n    readonly POLYGON_OFFSET_UNITS: GLenum;\\n    readonly RED_BITS: GLenum;\\n    readonly RENDERBUFFER: GLenum;\\n    readonly RENDERBUFFER_ALPHA_SIZE: GLenum;\\n    readonly RENDERBUFFER_BINDING: GLenum;\\n    readonly RENDERBUFFER_BLUE_SIZE: GLenum;\\n    readonly RENDERBUFFER_DEPTH_SIZE: GLenum;\\n    readonly RENDERBUFFER_GREEN_SIZE: GLenum;\\n    readonly RENDERBUFFER_HEIGHT: GLenum;\\n    readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum;\\n    readonly RENDERBUFFER_RED_SIZE: GLenum;\\n    readonly RENDERBUFFER_STENCIL_SIZE: GLenum;\\n    readonly RENDERBUFFER_WIDTH: GLenum;\\n    readonly RENDERER: GLenum;\\n    readonly REPEAT: GLenum;\\n    readonly REPLACE: GLenum;\\n    readonly RGB: GLenum;\\n    readonly RGB565: GLenum;\\n    readonly RGB5_A1: GLenum;\\n    readonly RGBA: GLenum;\\n    readonly RGBA4: GLenum;\\n    readonly SAMPLER_2D: GLenum;\\n    readonly SAMPLER_CUBE: GLenum;\\n    readonly SAMPLES: GLenum;\\n    readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum;\\n    readonly SAMPLE_BUFFERS: GLenum;\\n    readonly SAMPLE_COVERAGE: GLenum;\\n    readonly SAMPLE_COVERAGE_INVERT: GLenum;\\n    readonly SAMPLE_COVERAGE_VALUE: GLenum;\\n    readonly SCISSOR_BOX: GLenum;\\n    readonly SCISSOR_TEST: GLenum;\\n    readonly SHADER_TYPE: GLenum;\\n    readonly SHADING_LANGUAGE_VERSION: GLenum;\\n    readonly SHORT: GLenum;\\n    readonly SRC_ALPHA: GLenum;\\n    readonly SRC_ALPHA_SATURATE: GLenum;\\n    readonly SRC_COLOR: GLenum;\\n    readonly STATIC_DRAW: GLenum;\\n    readonly STENCIL_ATTACHMENT: GLenum;\\n    readonly STENCIL_BACK_FAIL: GLenum;\\n    readonly STENCIL_BACK_FUNC: GLenum;\\n    readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum;\\n    readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum;\\n    readonly STENCIL_BACK_REF: GLenum;\\n    readonly STENCIL_BACK_VALUE_MASK: GLenum;\\n    readonly STENCIL_BACK_WRITEMASK: GLenum;\\n    readonly STENCIL_BITS: GLenum;\\n    readonly STENCIL_BUFFER_BIT: GLenum;\\n    readonly STENCIL_CLEAR_VALUE: GLenum;\\n    readonly STENCIL_FAIL: GLenum;\\n    readonly STENCIL_FUNC: GLenum;\\n    readonly STENCIL_INDEX8: GLenum;\\n    readonly STENCIL_PASS_DEPTH_FAIL: GLenum;\\n    readonly STENCIL_PASS_DEPTH_PASS: GLenum;\\n    readonly STENCIL_REF: GLenum;\\n    readonly STENCIL_TEST: GLenum;\\n    readonly STENCIL_VALUE_MASK: GLenum;\\n    readonly STENCIL_WRITEMASK: GLenum;\\n    readonly STREAM_DRAW: GLenum;\\n    readonly SUBPIXEL_BITS: GLenum;\\n    readonly TEXTURE: GLenum;\\n    readonly TEXTURE0: GLenum;\\n    readonly TEXTURE1: GLenum;\\n    readonly TEXTURE10: GLenum;\\n    readonly TEXTURE11: GLenum;\\n    readonly TEXTURE12: GLenum;\\n    readonly TEXTURE13: GLenum;\\n    readonly TEXTURE14: GLenum;\\n    readonly TEXTURE15: GLenum;\\n    readonly TEXTURE16: GLenum;\\n    readonly TEXTURE17: GLenum;\\n    readonly TEXTURE18: GLenum;\\n    readonly TEXTURE19: GLenum;\\n    readonly TEXTURE2: GLenum;\\n    readonly TEXTURE20: GLenum;\\n    readonly TEXTURE21: GLenum;\\n    readonly TEXTURE22: GLenum;\\n    readonly TEXTURE23: GLenum;\\n    readonly TEXTURE24: GLenum;\\n    readonly TEXTURE25: GLenum;\\n    readonly TEXTURE26: GLenum;\\n    readonly TEXTURE27: GLenum;\\n    readonly TEXTURE28: GLenum;\\n    readonly TEXTURE29: GLenum;\\n    readonly TEXTURE3: GLenum;\\n    readonly TEXTURE30: GLenum;\\n    readonly TEXTURE31: GLenum;\\n    readonly TEXTURE4: GLenum;\\n    readonly TEXTURE5: GLenum;\\n    readonly TEXTURE6: GLenum;\\n    readonly TEXTURE7: GLenum;\\n    readonly TEXTURE8: GLenum;\\n    readonly TEXTURE9: GLenum;\\n    readonly TEXTURE_2D: GLenum;\\n    readonly TEXTURE_BINDING_2D: GLenum;\\n    readonly TEXTURE_BINDING_CUBE_MAP: GLenum;\\n    readonly TEXTURE_CUBE_MAP: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum;\\n    readonly TEXTURE_MAG_FILTER: GLenum;\\n    readonly TEXTURE_MIN_FILTER: GLenum;\\n    readonly TEXTURE_WRAP_S: GLenum;\\n    readonly TEXTURE_WRAP_T: GLenum;\\n    readonly TRIANGLES: GLenum;\\n    readonly TRIANGLE_FAN: GLenum;\\n    readonly TRIANGLE_STRIP: GLenum;\\n    readonly UNPACK_ALIGNMENT: GLenum;\\n    readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum;\\n    readonly UNPACK_FLIP_Y_WEBGL: GLenum;\\n    readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum;\\n    readonly UNSIGNED_BYTE: GLenum;\\n    readonly UNSIGNED_INT: GLenum;\\n    readonly UNSIGNED_SHORT: GLenum;\\n    readonly UNSIGNED_SHORT_4_4_4_4: GLenum;\\n    readonly UNSIGNED_SHORT_5_5_5_1: GLenum;\\n    readonly UNSIGNED_SHORT_5_6_5: GLenum;\\n    readonly VALIDATE_STATUS: GLenum;\\n    readonly VENDOR: GLenum;\\n    readonly VERSION: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum;\\n    readonly VERTEX_SHADER: GLenum;\\n    readonly VIEWPORT: GLenum;\\n    readonly ZERO: GLenum;\\n    readonly ACTIVE_UNIFORM_BLOCKS: GLenum;\\n    readonly ALREADY_SIGNALED: GLenum;\\n    readonly ANY_SAMPLES_PASSED: GLenum;\\n    readonly ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum;\\n    readonly COLOR: GLenum;\\n    readonly COLOR_ATTACHMENT1: GLenum;\\n    readonly COLOR_ATTACHMENT10: GLenum;\\n    readonly COLOR_ATTACHMENT11: GLenum;\\n    readonly COLOR_ATTACHMENT12: GLenum;\\n    readonly COLOR_ATTACHMENT13: GLenum;\\n    readonly COLOR_ATTACHMENT14: GLenum;\\n    readonly COLOR_ATTACHMENT15: GLenum;\\n    readonly COLOR_ATTACHMENT2: GLenum;\\n    readonly COLOR_ATTACHMENT3: GLenum;\\n    readonly COLOR_ATTACHMENT4: GLenum;\\n    readonly COLOR_ATTACHMENT5: GLenum;\\n    readonly COLOR_ATTACHMENT6: GLenum;\\n    readonly COLOR_ATTACHMENT7: GLenum;\\n    readonly COLOR_ATTACHMENT8: GLenum;\\n    readonly COLOR_ATTACHMENT9: GLenum;\\n    readonly COMPARE_REF_TO_TEXTURE: GLenum;\\n    readonly CONDITION_SATISFIED: GLenum;\\n    readonly COPY_READ_BUFFER: GLenum;\\n    readonly COPY_READ_BUFFER_BINDING: GLenum;\\n    readonly COPY_WRITE_BUFFER: GLenum;\\n    readonly COPY_WRITE_BUFFER_BINDING: GLenum;\\n    readonly CURRENT_QUERY: GLenum;\\n    readonly DEPTH: GLenum;\\n    readonly DEPTH24_STENCIL8: GLenum;\\n    readonly DEPTH32F_STENCIL8: GLenum;\\n    readonly DEPTH_COMPONENT24: GLenum;\\n    readonly DEPTH_COMPONENT32F: GLenum;\\n    readonly DRAW_BUFFER0: GLenum;\\n    readonly DRAW_BUFFER1: GLenum;\\n    readonly DRAW_BUFFER10: GLenum;\\n    readonly DRAW_BUFFER11: GLenum;\\n    readonly DRAW_BUFFER12: GLenum;\\n    readonly DRAW_BUFFER13: GLenum;\\n    readonly DRAW_BUFFER14: GLenum;\\n    readonly DRAW_BUFFER15: GLenum;\\n    readonly DRAW_BUFFER2: GLenum;\\n    readonly DRAW_BUFFER3: GLenum;\\n    readonly DRAW_BUFFER4: GLenum;\\n    readonly DRAW_BUFFER5: GLenum;\\n    readonly DRAW_BUFFER6: GLenum;\\n    readonly DRAW_BUFFER7: GLenum;\\n    readonly DRAW_BUFFER8: GLenum;\\n    readonly DRAW_BUFFER9: GLenum;\\n    readonly DRAW_FRAMEBUFFER: GLenum;\\n    readonly DRAW_FRAMEBUFFER_BINDING: GLenum;\\n    readonly DYNAMIC_COPY: GLenum;\\n    readonly DYNAMIC_READ: GLenum;\\n    readonly FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum;\\n    readonly FLOAT_MAT2x3: GLenum;\\n    readonly FLOAT_MAT2x4: GLenum;\\n    readonly FLOAT_MAT3x2: GLenum;\\n    readonly FLOAT_MAT3x4: GLenum;\\n    readonly FLOAT_MAT4x2: GLenum;\\n    readonly FLOAT_MAT4x3: GLenum;\\n    readonly FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum;\\n    readonly FRAMEBUFFER_DEFAULT: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum;\\n    readonly HALF_FLOAT: GLenum;\\n    readonly INTERLEAVED_ATTRIBS: GLenum;\\n    readonly INT_2_10_10_10_REV: GLenum;\\n    readonly INT_SAMPLER_2D: GLenum;\\n    readonly INT_SAMPLER_2D_ARRAY: GLenum;\\n    readonly INT_SAMPLER_3D: GLenum;\\n    readonly INT_SAMPLER_CUBE: GLenum;\\n    readonly INVALID_INDEX: GLenum;\\n    readonly MAX: GLenum;\\n    readonly MAX_3D_TEXTURE_SIZE: GLenum;\\n    readonly MAX_ARRAY_TEXTURE_LAYERS: GLenum;\\n    readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum;\\n    readonly MAX_COLOR_ATTACHMENTS: GLenum;\\n    readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum;\\n    readonly MAX_COMBINED_UNIFORM_BLOCKS: GLenum;\\n    readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum;\\n    readonly MAX_DRAW_BUFFERS: GLenum;\\n    readonly MAX_ELEMENTS_INDICES: GLenum;\\n    readonly MAX_ELEMENTS_VERTICES: GLenum;\\n    readonly MAX_ELEMENT_INDEX: GLenum;\\n    readonly MAX_FRAGMENT_INPUT_COMPONENTS: GLenum;\\n    readonly MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum;\\n    readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum;\\n    readonly MAX_PROGRAM_TEXEL_OFFSET: GLenum;\\n    readonly MAX_SAMPLES: GLenum;\\n    readonly MAX_SERVER_WAIT_TIMEOUT: GLenum;\\n    readonly MAX_TEXTURE_LOD_BIAS: GLenum;\\n    readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum;\\n    readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum;\\n    readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum;\\n    readonly MAX_UNIFORM_BLOCK_SIZE: GLenum;\\n    readonly MAX_UNIFORM_BUFFER_BINDINGS: GLenum;\\n    readonly MAX_VARYING_COMPONENTS: GLenum;\\n    readonly MAX_VERTEX_OUTPUT_COMPONENTS: GLenum;\\n    readonly MAX_VERTEX_UNIFORM_BLOCKS: GLenum;\\n    readonly MAX_VERTEX_UNIFORM_COMPONENTS: GLenum;\\n    readonly MIN: GLenum;\\n    readonly MIN_PROGRAM_TEXEL_OFFSET: GLenum;\\n    readonly OBJECT_TYPE: GLenum;\\n    readonly PACK_ROW_LENGTH: GLenum;\\n    readonly PACK_SKIP_PIXELS: GLenum;\\n    readonly PACK_SKIP_ROWS: GLenum;\\n    readonly PIXEL_PACK_BUFFER: GLenum;\\n    readonly PIXEL_PACK_BUFFER_BINDING: GLenum;\\n    readonly PIXEL_UNPACK_BUFFER: GLenum;\\n    readonly PIXEL_UNPACK_BUFFER_BINDING: GLenum;\\n    readonly QUERY_RESULT: GLenum;\\n    readonly QUERY_RESULT_AVAILABLE: GLenum;\\n    readonly R11F_G11F_B10F: GLenum;\\n    readonly R16F: GLenum;\\n    readonly R16I: GLenum;\\n    readonly R16UI: GLenum;\\n    readonly R32F: GLenum;\\n    readonly R32I: GLenum;\\n    readonly R32UI: GLenum;\\n    readonly R8: GLenum;\\n    readonly R8I: GLenum;\\n    readonly R8UI: GLenum;\\n    readonly R8_SNORM: GLenum;\\n    readonly RASTERIZER_DISCARD: GLenum;\\n    readonly READ_BUFFER: GLenum;\\n    readonly READ_FRAMEBUFFER: GLenum;\\n    readonly READ_FRAMEBUFFER_BINDING: GLenum;\\n    readonly RED: GLenum;\\n    readonly RED_INTEGER: GLenum;\\n    readonly RENDERBUFFER_SAMPLES: GLenum;\\n    readonly RG: GLenum;\\n    readonly RG16F: GLenum;\\n    readonly RG16I: GLenum;\\n    readonly RG16UI: GLenum;\\n    readonly RG32F: GLenum;\\n    readonly RG32I: GLenum;\\n    readonly RG32UI: GLenum;\\n    readonly RG8: GLenum;\\n    readonly RG8I: GLenum;\\n    readonly RG8UI: GLenum;\\n    readonly RG8_SNORM: GLenum;\\n    readonly RGB10_A2: GLenum;\\n    readonly RGB10_A2UI: GLenum;\\n    readonly RGB16F: GLenum;\\n    readonly RGB16I: GLenum;\\n    readonly RGB16UI: GLenum;\\n    readonly RGB32F: GLenum;\\n    readonly RGB32I: GLenum;\\n    readonly RGB32UI: GLenum;\\n    readonly RGB8: GLenum;\\n    readonly RGB8I: GLenum;\\n    readonly RGB8UI: GLenum;\\n    readonly RGB8_SNORM: GLenum;\\n    readonly RGB9_E5: GLenum;\\n    readonly RGBA16F: GLenum;\\n    readonly RGBA16I: GLenum;\\n    readonly RGBA16UI: GLenum;\\n    readonly RGBA32F: GLenum;\\n    readonly RGBA32I: GLenum;\\n    readonly RGBA32UI: GLenum;\\n    readonly RGBA8: GLenum;\\n    readonly RGBA8I: GLenum;\\n    readonly RGBA8UI: GLenum;\\n    readonly RGBA8_SNORM: GLenum;\\n    readonly RGBA_INTEGER: GLenum;\\n    readonly RGB_INTEGER: GLenum;\\n    readonly RG_INTEGER: GLenum;\\n    readonly SAMPLER_2D_ARRAY: GLenum;\\n    readonly SAMPLER_2D_ARRAY_SHADOW: GLenum;\\n    readonly SAMPLER_2D_SHADOW: GLenum;\\n    readonly SAMPLER_3D: GLenum;\\n    readonly SAMPLER_BINDING: GLenum;\\n    readonly SAMPLER_CUBE_SHADOW: GLenum;\\n    readonly SEPARATE_ATTRIBS: GLenum;\\n    readonly SIGNALED: GLenum;\\n    readonly SIGNED_NORMALIZED: GLenum;\\n    readonly SRGB: GLenum;\\n    readonly SRGB8: GLenum;\\n    readonly SRGB8_ALPHA8: GLenum;\\n    readonly STATIC_COPY: GLenum;\\n    readonly STATIC_READ: GLenum;\\n    readonly STENCIL: GLenum;\\n    readonly STREAM_COPY: GLenum;\\n    readonly STREAM_READ: GLenum;\\n    readonly SYNC_CONDITION: GLenum;\\n    readonly SYNC_FENCE: GLenum;\\n    readonly SYNC_FLAGS: GLenum;\\n    readonly SYNC_FLUSH_COMMANDS_BIT: GLenum;\\n    readonly SYNC_GPU_COMMANDS_COMPLETE: GLenum;\\n    readonly SYNC_STATUS: GLenum;\\n    readonly TEXTURE_2D_ARRAY: GLenum;\\n    readonly TEXTURE_3D: GLenum;\\n    readonly TEXTURE_BASE_LEVEL: GLenum;\\n    readonly TEXTURE_BINDING_2D_ARRAY: GLenum;\\n    readonly TEXTURE_BINDING_3D: GLenum;\\n    readonly TEXTURE_COMPARE_FUNC: GLenum;\\n    readonly TEXTURE_COMPARE_MODE: GLenum;\\n    readonly TEXTURE_IMMUTABLE_FORMAT: GLenum;\\n    readonly TEXTURE_IMMUTABLE_LEVELS: GLenum;\\n    readonly TEXTURE_MAX_LEVEL: GLenum;\\n    readonly TEXTURE_MAX_LOD: GLenum;\\n    readonly TEXTURE_MIN_LOD: GLenum;\\n    readonly TEXTURE_WRAP_R: GLenum;\\n    readonly TIMEOUT_EXPIRED: GLenum;\\n    readonly TIMEOUT_IGNORED: GLint64;\\n    readonly TRANSFORM_FEEDBACK: GLenum;\\n    readonly TRANSFORM_FEEDBACK_ACTIVE: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BINDING: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER_START: GLenum;\\n    readonly TRANSFORM_FEEDBACK_PAUSED: GLenum;\\n    readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum;\\n    readonly TRANSFORM_FEEDBACK_VARYINGS: GLenum;\\n    readonly UNIFORM_ARRAY_STRIDE: GLenum;\\n    readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum;\\n    readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum;\\n    readonly UNIFORM_BLOCK_BINDING: GLenum;\\n    readonly UNIFORM_BLOCK_DATA_SIZE: GLenum;\\n    readonly UNIFORM_BLOCK_INDEX: GLenum;\\n    readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum;\\n    readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum;\\n    readonly UNIFORM_BUFFER: GLenum;\\n    readonly UNIFORM_BUFFER_BINDING: GLenum;\\n    readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum;\\n    readonly UNIFORM_BUFFER_SIZE: GLenum;\\n    readonly UNIFORM_BUFFER_START: GLenum;\\n    readonly UNIFORM_IS_ROW_MAJOR: GLenum;\\n    readonly UNIFORM_MATRIX_STRIDE: GLenum;\\n    readonly UNIFORM_OFFSET: GLenum;\\n    readonly UNIFORM_SIZE: GLenum;\\n    readonly UNIFORM_TYPE: GLenum;\\n    readonly UNPACK_IMAGE_HEIGHT: GLenum;\\n    readonly UNPACK_ROW_LENGTH: GLenum;\\n    readonly UNPACK_SKIP_IMAGES: GLenum;\\n    readonly UNPACK_SKIP_PIXELS: GLenum;\\n    readonly UNPACK_SKIP_ROWS: GLenum;\\n    readonly UNSIGNALED: GLenum;\\n    readonly UNSIGNED_INT_10F_11F_11F_REV: GLenum;\\n    readonly UNSIGNED_INT_24_8: GLenum;\\n    readonly UNSIGNED_INT_2_10_10_10_REV: GLenum;\\n    readonly UNSIGNED_INT_5_9_9_9_REV: GLenum;\\n    readonly UNSIGNED_INT_SAMPLER_2D: GLenum;\\n    readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum;\\n    readonly UNSIGNED_INT_SAMPLER_3D: GLenum;\\n    readonly UNSIGNED_INT_SAMPLER_CUBE: GLenum;\\n    readonly UNSIGNED_INT_VEC2: GLenum;\\n    readonly UNSIGNED_INT_VEC3: GLenum;\\n    readonly UNSIGNED_INT_VEC4: GLenum;\\n    readonly UNSIGNED_NORMALIZED: GLenum;\\n    readonly VERTEX_ARRAY_BINDING: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_INTEGER: GLenum;\\n    readonly WAIT_FAILED: GLenum;\\n};\\n\\ninterface WebGL2RenderingContextBase {\\n    beginQuery(target: GLenum, query: WebGLQuery): void;\\n    beginTransformFeedback(primitiveMode: GLenum): void;\\n    bindBufferBase(target: GLenum, index: GLuint, buffer: WebGLBuffer | null): void;\\n    bindBufferRange(target: GLenum, index: GLuint, buffer: WebGLBuffer | null, offset: GLintptr, size: GLsizeiptr): void;\\n    bindSampler(unit: GLuint, sampler: WebGLSampler | null): void;\\n    bindTransformFeedback(target: GLenum, tf: WebGLTransformFeedback | null): void;\\n    bindVertexArray(array: WebGLVertexArrayObject | null): void;\\n    blitFramebuffer(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum): void;\\n    clearBufferfi(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint): void;\\n    clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Float32List, srcOffset?: GLuint): void;\\n    clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Int32List, srcOffset?: GLuint): void;\\n    clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Uint32List, srcOffset?: GLuint): void;\\n    clientWaitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLuint64): GLenum;\\n    compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr): void;\\n    compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint): void;\\n    compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr): void;\\n    compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint): void;\\n    copyBufferSubData(readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr): void;\\n    copyTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;\\n    createQuery(): WebGLQuery | null;\\n    createSampler(): WebGLSampler | null;\\n    createTransformFeedback(): WebGLTransformFeedback | null;\\n    createVertexArray(): WebGLVertexArrayObject | null;\\n    deleteQuery(query: WebGLQuery | null): void;\\n    deleteSampler(sampler: WebGLSampler | null): void;\\n    deleteSync(sync: WebGLSync | null): void;\\n    deleteTransformFeedback(tf: WebGLTransformFeedback | null): void;\\n    deleteVertexArray(vertexArray: WebGLVertexArrayObject | null): void;\\n    drawArraysInstanced(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei): void;\\n    drawBuffers(buffers: GLenum[]): void;\\n    drawElementsInstanced(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei): void;\\n    drawRangeElements(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type: GLenum, offset: GLintptr): void;\\n    endQuery(target: GLenum): void;\\n    endTransformFeedback(): void;\\n    fenceSync(condition: GLenum, flags: GLbitfield): WebGLSync | null;\\n    framebufferTextureLayer(target: GLenum, attachment: GLenum, texture: WebGLTexture | null, level: GLint, layer: GLint): void;\\n    getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: GLuint): string | null;\\n    getActiveUniformBlockParameter(program: WebGLProgram, uniformBlockIndex: GLuint, pname: GLenum): any;\\n    getActiveUniforms(program: WebGLProgram, uniformIndices: GLuint[], pname: GLenum): any;\\n    getBufferSubData(target: GLenum, srcByteOffset: GLintptr, dstBuffer: ArrayBufferView, dstOffset?: GLuint, length?: GLuint): void;\\n    getFragDataLocation(program: WebGLProgram, name: string): GLint;\\n    getIndexedParameter(target: GLenum, index: GLuint): any;\\n    getInternalformatParameter(target: GLenum, internalformat: GLenum, pname: GLenum): any;\\n    getQuery(target: GLenum, pname: GLenum): WebGLQuery | null;\\n    getQueryParameter(query: WebGLQuery, pname: GLenum): any;\\n    getSamplerParameter(sampler: WebGLSampler, pname: GLenum): any;\\n    getSyncParameter(sync: WebGLSync, pname: GLenum): any;\\n    getTransformFeedbackVarying(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;\\n    getUniformBlockIndex(program: WebGLProgram, uniformBlockName: string): GLuint;\\n    getUniformIndices(program: WebGLProgram, uniformNames: string[]): GLuint[] | null;\\n    invalidateFramebuffer(target: GLenum, attachments: GLenum[]): void;\\n    invalidateSubFramebuffer(target: GLenum, attachments: GLenum[], x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;\\n    isQuery(query: WebGLQuery | null): GLboolean;\\n    isSampler(sampler: WebGLSampler | null): GLboolean;\\n    isSync(sync: WebGLSync | null): GLboolean;\\n    isTransformFeedback(tf: WebGLTransformFeedback | null): GLboolean;\\n    isVertexArray(vertexArray: WebGLVertexArrayObject | null): GLboolean;\\n    pauseTransformFeedback(): void;\\n    readBuffer(src: GLenum): void;\\n    renderbufferStorageMultisample(target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei): void;\\n    resumeTransformFeedback(): void;\\n    samplerParameterf(sampler: WebGLSampler, pname: GLenum, param: GLfloat): void;\\n    samplerParameteri(sampler: WebGLSampler, pname: GLenum, param: GLint): void;\\n    texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr): void;\\n    texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;\\n    texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView | null): void;\\n    texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint): void;\\n    texStorage2D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei): void;\\n    texStorage3D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei): void;\\n    texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr): void;\\n    texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: TexImageSource): void;\\n    texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView | null, srcOffset?: GLuint): void;\\n    transformFeedbackVaryings(program: WebGLProgram, varyings: string[], bufferMode: GLenum): void;\\n    uniform1ui(location: WebGLUniformLocation | null, v0: GLuint): void;\\n    uniform1uiv(location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform2ui(location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint): void;\\n    uniform2uiv(location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform3ui(location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint, v2: GLuint): void;\\n    uniform3uiv(location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform4ui(location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint): void;\\n    uniform4uiv(location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint): void;\\n    uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    vertexAttribDivisor(index: GLuint, divisor: GLuint): void;\\n    vertexAttribI4i(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint): void;\\n    vertexAttribI4iv(index: GLuint, values: Int32List): void;\\n    vertexAttribI4ui(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint): void;\\n    vertexAttribI4uiv(index: GLuint, values: Uint32List): void;\\n    vertexAttribIPointer(index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr): void;\\n    waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64): void;\\n    readonly ACTIVE_UNIFORM_BLOCKS: GLenum;\\n    readonly ALREADY_SIGNALED: GLenum;\\n    readonly ANY_SAMPLES_PASSED: GLenum;\\n    readonly ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum;\\n    readonly COLOR: GLenum;\\n    readonly COLOR_ATTACHMENT1: GLenum;\\n    readonly COLOR_ATTACHMENT10: GLenum;\\n    readonly COLOR_ATTACHMENT11: GLenum;\\n    readonly COLOR_ATTACHMENT12: GLenum;\\n    readonly COLOR_ATTACHMENT13: GLenum;\\n    readonly COLOR_ATTACHMENT14: GLenum;\\n    readonly COLOR_ATTACHMENT15: GLenum;\\n    readonly COLOR_ATTACHMENT2: GLenum;\\n    readonly COLOR_ATTACHMENT3: GLenum;\\n    readonly COLOR_ATTACHMENT4: GLenum;\\n    readonly COLOR_ATTACHMENT5: GLenum;\\n    readonly COLOR_ATTACHMENT6: GLenum;\\n    readonly COLOR_ATTACHMENT7: GLenum;\\n    readonly COLOR_ATTACHMENT8: GLenum;\\n    readonly COLOR_ATTACHMENT9: GLenum;\\n    readonly COMPARE_REF_TO_TEXTURE: GLenum;\\n    readonly CONDITION_SATISFIED: GLenum;\\n    readonly COPY_READ_BUFFER: GLenum;\\n    readonly COPY_READ_BUFFER_BINDING: GLenum;\\n    readonly COPY_WRITE_BUFFER: GLenum;\\n    readonly COPY_WRITE_BUFFER_BINDING: GLenum;\\n    readonly CURRENT_QUERY: GLenum;\\n    readonly DEPTH: GLenum;\\n    readonly DEPTH24_STENCIL8: GLenum;\\n    readonly DEPTH32F_STENCIL8: GLenum;\\n    readonly DEPTH_COMPONENT24: GLenum;\\n    readonly DEPTH_COMPONENT32F: GLenum;\\n    readonly DRAW_BUFFER0: GLenum;\\n    readonly DRAW_BUFFER1: GLenum;\\n    readonly DRAW_BUFFER10: GLenum;\\n    readonly DRAW_BUFFER11: GLenum;\\n    readonly DRAW_BUFFER12: GLenum;\\n    readonly DRAW_BUFFER13: GLenum;\\n    readonly DRAW_BUFFER14: GLenum;\\n    readonly DRAW_BUFFER15: GLenum;\\n    readonly DRAW_BUFFER2: GLenum;\\n    readonly DRAW_BUFFER3: GLenum;\\n    readonly DRAW_BUFFER4: GLenum;\\n    readonly DRAW_BUFFER5: GLenum;\\n    readonly DRAW_BUFFER6: GLenum;\\n    readonly DRAW_BUFFER7: GLenum;\\n    readonly DRAW_BUFFER8: GLenum;\\n    readonly DRAW_BUFFER9: GLenum;\\n    readonly DRAW_FRAMEBUFFER: GLenum;\\n    readonly DRAW_FRAMEBUFFER_BINDING: GLenum;\\n    readonly DYNAMIC_COPY: GLenum;\\n    readonly DYNAMIC_READ: GLenum;\\n    readonly FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum;\\n    readonly FLOAT_MAT2x3: GLenum;\\n    readonly FLOAT_MAT2x4: GLenum;\\n    readonly FLOAT_MAT3x2: GLenum;\\n    readonly FLOAT_MAT3x4: GLenum;\\n    readonly FLOAT_MAT4x2: GLenum;\\n    readonly FLOAT_MAT4x3: GLenum;\\n    readonly FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum;\\n    readonly FRAMEBUFFER_DEFAULT: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum;\\n    readonly HALF_FLOAT: GLenum;\\n    readonly INTERLEAVED_ATTRIBS: GLenum;\\n    readonly INT_2_10_10_10_REV: GLenum;\\n    readonly INT_SAMPLER_2D: GLenum;\\n    readonly INT_SAMPLER_2D_ARRAY: GLenum;\\n    readonly INT_SAMPLER_3D: GLenum;\\n    readonly INT_SAMPLER_CUBE: GLenum;\\n    readonly INVALID_INDEX: GLenum;\\n    readonly MAX: GLenum;\\n    readonly MAX_3D_TEXTURE_SIZE: GLenum;\\n    readonly MAX_ARRAY_TEXTURE_LAYERS: GLenum;\\n    readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum;\\n    readonly MAX_COLOR_ATTACHMENTS: GLenum;\\n    readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum;\\n    readonly MAX_COMBINED_UNIFORM_BLOCKS: GLenum;\\n    readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum;\\n    readonly MAX_DRAW_BUFFERS: GLenum;\\n    readonly MAX_ELEMENTS_INDICES: GLenum;\\n    readonly MAX_ELEMENTS_VERTICES: GLenum;\\n    readonly MAX_ELEMENT_INDEX: GLenum;\\n    readonly MAX_FRAGMENT_INPUT_COMPONENTS: GLenum;\\n    readonly MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum;\\n    readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum;\\n    readonly MAX_PROGRAM_TEXEL_OFFSET: GLenum;\\n    readonly MAX_SAMPLES: GLenum;\\n    readonly MAX_SERVER_WAIT_TIMEOUT: GLenum;\\n    readonly MAX_TEXTURE_LOD_BIAS: GLenum;\\n    readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum;\\n    readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum;\\n    readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum;\\n    readonly MAX_UNIFORM_BLOCK_SIZE: GLenum;\\n    readonly MAX_UNIFORM_BUFFER_BINDINGS: GLenum;\\n    readonly MAX_VARYING_COMPONENTS: GLenum;\\n    readonly MAX_VERTEX_OUTPUT_COMPONENTS: GLenum;\\n    readonly MAX_VERTEX_UNIFORM_BLOCKS: GLenum;\\n    readonly MAX_VERTEX_UNIFORM_COMPONENTS: GLenum;\\n    readonly MIN: GLenum;\\n    readonly MIN_PROGRAM_TEXEL_OFFSET: GLenum;\\n    readonly OBJECT_TYPE: GLenum;\\n    readonly PACK_ROW_LENGTH: GLenum;\\n    readonly PACK_SKIP_PIXELS: GLenum;\\n    readonly PACK_SKIP_ROWS: GLenum;\\n    readonly PIXEL_PACK_BUFFER: GLenum;\\n    readonly PIXEL_PACK_BUFFER_BINDING: GLenum;\\n    readonly PIXEL_UNPACK_BUFFER: GLenum;\\n    readonly PIXEL_UNPACK_BUFFER_BINDING: GLenum;\\n    readonly QUERY_RESULT: GLenum;\\n    readonly QUERY_RESULT_AVAILABLE: GLenum;\\n    readonly R11F_G11F_B10F: GLenum;\\n    readonly R16F: GLenum;\\n    readonly R16I: GLenum;\\n    readonly R16UI: GLenum;\\n    readonly R32F: GLenum;\\n    readonly R32I: GLenum;\\n    readonly R32UI: GLenum;\\n    readonly R8: GLenum;\\n    readonly R8I: GLenum;\\n    readonly R8UI: GLenum;\\n    readonly R8_SNORM: GLenum;\\n    readonly RASTERIZER_DISCARD: GLenum;\\n    readonly READ_BUFFER: GLenum;\\n    readonly READ_FRAMEBUFFER: GLenum;\\n    readonly READ_FRAMEBUFFER_BINDING: GLenum;\\n    readonly RED: GLenum;\\n    readonly RED_INTEGER: GLenum;\\n    readonly RENDERBUFFER_SAMPLES: GLenum;\\n    readonly RG: GLenum;\\n    readonly RG16F: GLenum;\\n    readonly RG16I: GLenum;\\n    readonly RG16UI: GLenum;\\n    readonly RG32F: GLenum;\\n    readonly RG32I: GLenum;\\n    readonly RG32UI: GLenum;\\n    readonly RG8: GLenum;\\n    readonly RG8I: GLenum;\\n    readonly RG8UI: GLenum;\\n    readonly RG8_SNORM: GLenum;\\n    readonly RGB10_A2: GLenum;\\n    readonly RGB10_A2UI: GLenum;\\n    readonly RGB16F: GLenum;\\n    readonly RGB16I: GLenum;\\n    readonly RGB16UI: GLenum;\\n    readonly RGB32F: GLenum;\\n    readonly RGB32I: GLenum;\\n    readonly RGB32UI: GLenum;\\n    readonly RGB8: GLenum;\\n    readonly RGB8I: GLenum;\\n    readonly RGB8UI: GLenum;\\n    readonly RGB8_SNORM: GLenum;\\n    readonly RGB9_E5: GLenum;\\n    readonly RGBA16F: GLenum;\\n    readonly RGBA16I: GLenum;\\n    readonly RGBA16UI: GLenum;\\n    readonly RGBA32F: GLenum;\\n    readonly RGBA32I: GLenum;\\n    readonly RGBA32UI: GLenum;\\n    readonly RGBA8: GLenum;\\n    readonly RGBA8I: GLenum;\\n    readonly RGBA8UI: GLenum;\\n    readonly RGBA8_SNORM: GLenum;\\n    readonly RGBA_INTEGER: GLenum;\\n    readonly RGB_INTEGER: GLenum;\\n    readonly RG_INTEGER: GLenum;\\n    readonly SAMPLER_2D_ARRAY: GLenum;\\n    readonly SAMPLER_2D_ARRAY_SHADOW: GLenum;\\n    readonly SAMPLER_2D_SHADOW: GLenum;\\n    readonly SAMPLER_3D: GLenum;\\n    readonly SAMPLER_BINDING: GLenum;\\n    readonly SAMPLER_CUBE_SHADOW: GLenum;\\n    readonly SEPARATE_ATTRIBS: GLenum;\\n    readonly SIGNALED: GLenum;\\n    readonly SIGNED_NORMALIZED: GLenum;\\n    readonly SRGB: GLenum;\\n    readonly SRGB8: GLenum;\\n    readonly SRGB8_ALPHA8: GLenum;\\n    readonly STATIC_COPY: GLenum;\\n    readonly STATIC_READ: GLenum;\\n    readonly STENCIL: GLenum;\\n    readonly STREAM_COPY: GLenum;\\n    readonly STREAM_READ: GLenum;\\n    readonly SYNC_CONDITION: GLenum;\\n    readonly SYNC_FENCE: GLenum;\\n    readonly SYNC_FLAGS: GLenum;\\n    readonly SYNC_FLUSH_COMMANDS_BIT: GLenum;\\n    readonly SYNC_GPU_COMMANDS_COMPLETE: GLenum;\\n    readonly SYNC_STATUS: GLenum;\\n    readonly TEXTURE_2D_ARRAY: GLenum;\\n    readonly TEXTURE_3D: GLenum;\\n    readonly TEXTURE_BASE_LEVEL: GLenum;\\n    readonly TEXTURE_BINDING_2D_ARRAY: GLenum;\\n    readonly TEXTURE_BINDING_3D: GLenum;\\n    readonly TEXTURE_COMPARE_FUNC: GLenum;\\n    readonly TEXTURE_COMPARE_MODE: GLenum;\\n    readonly TEXTURE_IMMUTABLE_FORMAT: GLenum;\\n    readonly TEXTURE_IMMUTABLE_LEVELS: GLenum;\\n    readonly TEXTURE_MAX_LEVEL: GLenum;\\n    readonly TEXTURE_MAX_LOD: GLenum;\\n    readonly TEXTURE_MIN_LOD: GLenum;\\n    readonly TEXTURE_WRAP_R: GLenum;\\n    readonly TIMEOUT_EXPIRED: GLenum;\\n    readonly TIMEOUT_IGNORED: GLint64;\\n    readonly TRANSFORM_FEEDBACK: GLenum;\\n    readonly TRANSFORM_FEEDBACK_ACTIVE: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BINDING: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum;\\n    readonly TRANSFORM_FEEDBACK_BUFFER_START: GLenum;\\n    readonly TRANSFORM_FEEDBACK_PAUSED: GLenum;\\n    readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum;\\n    readonly TRANSFORM_FEEDBACK_VARYINGS: GLenum;\\n    readonly UNIFORM_ARRAY_STRIDE: GLenum;\\n    readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum;\\n    readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum;\\n    readonly UNIFORM_BLOCK_BINDING: GLenum;\\n    readonly UNIFORM_BLOCK_DATA_SIZE: GLenum;\\n    readonly UNIFORM_BLOCK_INDEX: GLenum;\\n    readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum;\\n    readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum;\\n    readonly UNIFORM_BUFFER: GLenum;\\n    readonly UNIFORM_BUFFER_BINDING: GLenum;\\n    readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum;\\n    readonly UNIFORM_BUFFER_SIZE: GLenum;\\n    readonly UNIFORM_BUFFER_START: GLenum;\\n    readonly UNIFORM_IS_ROW_MAJOR: GLenum;\\n    readonly UNIFORM_MATRIX_STRIDE: GLenum;\\n    readonly UNIFORM_OFFSET: GLenum;\\n    readonly UNIFORM_SIZE: GLenum;\\n    readonly UNIFORM_TYPE: GLenum;\\n    readonly UNPACK_IMAGE_HEIGHT: GLenum;\\n    readonly UNPACK_ROW_LENGTH: GLenum;\\n    readonly UNPACK_SKIP_IMAGES: GLenum;\\n    readonly UNPACK_SKIP_PIXELS: GLenum;\\n    readonly UNPACK_SKIP_ROWS: GLenum;\\n    readonly UNSIGNALED: GLenum;\\n    readonly UNSIGNED_INT_10F_11F_11F_REV: GLenum;\\n    readonly UNSIGNED_INT_24_8: GLenum;\\n    readonly UNSIGNED_INT_2_10_10_10_REV: GLenum;\\n    readonly UNSIGNED_INT_5_9_9_9_REV: GLenum;\\n    readonly UNSIGNED_INT_SAMPLER_2D: GLenum;\\n    readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum;\\n    readonly UNSIGNED_INT_SAMPLER_3D: GLenum;\\n    readonly UNSIGNED_INT_SAMPLER_CUBE: GLenum;\\n    readonly UNSIGNED_INT_VEC2: GLenum;\\n    readonly UNSIGNED_INT_VEC3: GLenum;\\n    readonly UNSIGNED_INT_VEC4: GLenum;\\n    readonly UNSIGNED_NORMALIZED: GLenum;\\n    readonly VERTEX_ARRAY_BINDING: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_INTEGER: GLenum;\\n    readonly WAIT_FAILED: GLenum;\\n}\\n\\ninterface WebGL2RenderingContextOverloads {\\n    bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum): void;\\n    bufferData(target: GLenum, srcData: BufferSource | null, usage: GLenum): void;\\n    bufferData(target: GLenum, srcData: ArrayBufferView, usage: GLenum, srcOffset: GLuint, length?: GLuint): void;\\n    bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: BufferSource): void;\\n    bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView, srcOffset: GLuint, length?: GLuint): void;\\n    compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr): void;\\n    compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint): void;\\n    compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr): void;\\n    compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint): void;\\n    readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView | null): void;\\n    readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, offset: GLintptr): void;\\n    readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView, dstOffset: GLuint): void;\\n    texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;\\n    texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;\\n    texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr): void;\\n    texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;\\n    texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint): void;\\n    texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;\\n    texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;\\n    texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr): void;\\n    texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: TexImageSource): void;\\n    texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint): void;\\n    uniform1fv(location: WebGLUniformLocation | null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform1iv(location: WebGLUniformLocation | null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform2fv(location: WebGLUniformLocation | null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform2iv(location: WebGLUniformLocation | null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform3fv(location: WebGLUniformLocation | null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform3iv(location: WebGLUniformLocation | null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform4fv(location: WebGLUniformLocation | null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform4iv(location: WebGLUniformLocation | null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void;\\n}\\n\\n/** Part of the WebGL API and represents the information returned by calling the WebGLRenderingContext.getActiveAttrib() and WebGLRenderingContext.getActiveUniform() methods. */\\ninterface WebGLActiveInfo {\\n    readonly name: string;\\n    readonly size: GLint;\\n    readonly type: GLenum;\\n}\\n\\ndeclare var WebGLActiveInfo: {\\n    prototype: WebGLActiveInfo;\\n    new(): WebGLActiveInfo;\\n};\\n\\n/** Part of the WebGL API and represents an opaque buffer object storing data such as vertices or colors. */\\ninterface WebGLBuffer extends WebGLObject {\\n}\\n\\ndeclare var WebGLBuffer: {\\n    prototype: WebGLBuffer;\\n    new(): WebGLBuffer;\\n};\\n\\n/** The WebContextEvent interface is part of the WebGL API and is an interface for an event that is generated in response to a status change to the WebGL rendering context. */\\ninterface WebGLContextEvent extends Event {\\n    readonly statusMessage: string;\\n}\\n\\ndeclare var WebGLContextEvent: {\\n    prototype: WebGLContextEvent;\\n    new(type: string, eventInit?: WebGLContextEventInit): WebGLContextEvent;\\n};\\n\\n/** Part of the WebGL API and represents a collection of buffers that serve as a rendering destination. */\\ninterface WebGLFramebuffer extends WebGLObject {\\n}\\n\\ndeclare var WebGLFramebuffer: {\\n    prototype: WebGLFramebuffer;\\n    new(): WebGLFramebuffer;\\n};\\n\\ninterface WebGLObject {\\n}\\n\\ndeclare var WebGLObject: {\\n    prototype: WebGLObject;\\n    new(): WebGLObject;\\n};\\n\\n/** The WebGLProgram is part of the WebGL API and is a combination of two compiled WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL). */\\ninterface WebGLProgram extends WebGLObject {\\n}\\n\\ndeclare var WebGLProgram: {\\n    prototype: WebGLProgram;\\n    new(): WebGLProgram;\\n};\\n\\ninterface WebGLQuery extends WebGLObject {\\n}\\n\\ndeclare var WebGLQuery: {\\n    prototype: WebGLQuery;\\n    new(): WebGLQuery;\\n};\\n\\n/** Part of the WebGL API and represents a buffer that can contain an image, or can be source or target of an rendering operation. */\\ninterface WebGLRenderbuffer extends WebGLObject {\\n}\\n\\ndeclare var WebGLRenderbuffer: {\\n    prototype: WebGLRenderbuffer;\\n    new(): WebGLRenderbuffer;\\n};\\n\\n/** Provides an interface to the OpenGL ES 2.0 graphics rendering context for the drawing surface of an HTML <canvas> element. */\\ninterface WebGLRenderingContext extends WebGLRenderingContextBase, WebGLRenderingContextOverloads {\\n}\\n\\ndeclare var WebGLRenderingContext: {\\n    prototype: WebGLRenderingContext;\\n    new(): WebGLRenderingContext;\\n    readonly ACTIVE_ATTRIBUTES: GLenum;\\n    readonly ACTIVE_TEXTURE: GLenum;\\n    readonly ACTIVE_UNIFORMS: GLenum;\\n    readonly ALIASED_LINE_WIDTH_RANGE: GLenum;\\n    readonly ALIASED_POINT_SIZE_RANGE: GLenum;\\n    readonly ALPHA: GLenum;\\n    readonly ALPHA_BITS: GLenum;\\n    readonly ALWAYS: GLenum;\\n    readonly ARRAY_BUFFER: GLenum;\\n    readonly ARRAY_BUFFER_BINDING: GLenum;\\n    readonly ATTACHED_SHADERS: GLenum;\\n    readonly BACK: GLenum;\\n    readonly BLEND: GLenum;\\n    readonly BLEND_COLOR: GLenum;\\n    readonly BLEND_DST_ALPHA: GLenum;\\n    readonly BLEND_DST_RGB: GLenum;\\n    readonly BLEND_EQUATION: GLenum;\\n    readonly BLEND_EQUATION_ALPHA: GLenum;\\n    readonly BLEND_EQUATION_RGB: GLenum;\\n    readonly BLEND_SRC_ALPHA: GLenum;\\n    readonly BLEND_SRC_RGB: GLenum;\\n    readonly BLUE_BITS: GLenum;\\n    readonly BOOL: GLenum;\\n    readonly BOOL_VEC2: GLenum;\\n    readonly BOOL_VEC3: GLenum;\\n    readonly BOOL_VEC4: GLenum;\\n    readonly BROWSER_DEFAULT_WEBGL: GLenum;\\n    readonly BUFFER_SIZE: GLenum;\\n    readonly BUFFER_USAGE: GLenum;\\n    readonly BYTE: GLenum;\\n    readonly CCW: GLenum;\\n    readonly CLAMP_TO_EDGE: GLenum;\\n    readonly COLOR_ATTACHMENT0: GLenum;\\n    readonly COLOR_BUFFER_BIT: GLenum;\\n    readonly COLOR_CLEAR_VALUE: GLenum;\\n    readonly COLOR_WRITEMASK: GLenum;\\n    readonly COMPILE_STATUS: GLenum;\\n    readonly COMPRESSED_TEXTURE_FORMATS: GLenum;\\n    readonly CONSTANT_ALPHA: GLenum;\\n    readonly CONSTANT_COLOR: GLenum;\\n    readonly CONTEXT_LOST_WEBGL: GLenum;\\n    readonly CULL_FACE: GLenum;\\n    readonly CULL_FACE_MODE: GLenum;\\n    readonly CURRENT_PROGRAM: GLenum;\\n    readonly CURRENT_VERTEX_ATTRIB: GLenum;\\n    readonly CW: GLenum;\\n    readonly DECR: GLenum;\\n    readonly DECR_WRAP: GLenum;\\n    readonly DELETE_STATUS: GLenum;\\n    readonly DEPTH_ATTACHMENT: GLenum;\\n    readonly DEPTH_BITS: GLenum;\\n    readonly DEPTH_BUFFER_BIT: GLenum;\\n    readonly DEPTH_CLEAR_VALUE: GLenum;\\n    readonly DEPTH_COMPONENT: GLenum;\\n    readonly DEPTH_COMPONENT16: GLenum;\\n    readonly DEPTH_FUNC: GLenum;\\n    readonly DEPTH_RANGE: GLenum;\\n    readonly DEPTH_STENCIL: GLenum;\\n    readonly DEPTH_STENCIL_ATTACHMENT: GLenum;\\n    readonly DEPTH_TEST: GLenum;\\n    readonly DEPTH_WRITEMASK: GLenum;\\n    readonly DITHER: GLenum;\\n    readonly DONT_CARE: GLenum;\\n    readonly DST_ALPHA: GLenum;\\n    readonly DST_COLOR: GLenum;\\n    readonly DYNAMIC_DRAW: GLenum;\\n    readonly ELEMENT_ARRAY_BUFFER: GLenum;\\n    readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum;\\n    readonly EQUAL: GLenum;\\n    readonly FASTEST: GLenum;\\n    readonly FLOAT: GLenum;\\n    readonly FLOAT_MAT2: GLenum;\\n    readonly FLOAT_MAT3: GLenum;\\n    readonly FLOAT_MAT4: GLenum;\\n    readonly FLOAT_VEC2: GLenum;\\n    readonly FLOAT_VEC3: GLenum;\\n    readonly FLOAT_VEC4: GLenum;\\n    readonly FRAGMENT_SHADER: GLenum;\\n    readonly FRAMEBUFFER: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum;\\n    readonly FRAMEBUFFER_BINDING: GLenum;\\n    readonly FRAMEBUFFER_COMPLETE: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum;\\n    readonly FRAMEBUFFER_UNSUPPORTED: GLenum;\\n    readonly FRONT: GLenum;\\n    readonly FRONT_AND_BACK: GLenum;\\n    readonly FRONT_FACE: GLenum;\\n    readonly FUNC_ADD: GLenum;\\n    readonly FUNC_REVERSE_SUBTRACT: GLenum;\\n    readonly FUNC_SUBTRACT: GLenum;\\n    readonly GENERATE_MIPMAP_HINT: GLenum;\\n    readonly GEQUAL: GLenum;\\n    readonly GREATER: GLenum;\\n    readonly GREEN_BITS: GLenum;\\n    readonly HIGH_FLOAT: GLenum;\\n    readonly HIGH_INT: GLenum;\\n    readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum;\\n    readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum;\\n    readonly INCR: GLenum;\\n    readonly INCR_WRAP: GLenum;\\n    readonly INT: GLenum;\\n    readonly INT_VEC2: GLenum;\\n    readonly INT_VEC3: GLenum;\\n    readonly INT_VEC4: GLenum;\\n    readonly INVALID_ENUM: GLenum;\\n    readonly INVALID_FRAMEBUFFER_OPERATION: GLenum;\\n    readonly INVALID_OPERATION: GLenum;\\n    readonly INVALID_VALUE: GLenum;\\n    readonly INVERT: GLenum;\\n    readonly KEEP: GLenum;\\n    readonly LEQUAL: GLenum;\\n    readonly LESS: GLenum;\\n    readonly LINEAR: GLenum;\\n    readonly LINEAR_MIPMAP_LINEAR: GLenum;\\n    readonly LINEAR_MIPMAP_NEAREST: GLenum;\\n    readonly LINES: GLenum;\\n    readonly LINE_LOOP: GLenum;\\n    readonly LINE_STRIP: GLenum;\\n    readonly LINE_WIDTH: GLenum;\\n    readonly LINK_STATUS: GLenum;\\n    readonly LOW_FLOAT: GLenum;\\n    readonly LOW_INT: GLenum;\\n    readonly LUMINANCE: GLenum;\\n    readonly LUMINANCE_ALPHA: GLenum;\\n    readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum;\\n    readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum;\\n    readonly MAX_RENDERBUFFER_SIZE: GLenum;\\n    readonly MAX_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_TEXTURE_SIZE: GLenum;\\n    readonly MAX_VARYING_VECTORS: GLenum;\\n    readonly MAX_VERTEX_ATTRIBS: GLenum;\\n    readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum;\\n    readonly MAX_VIEWPORT_DIMS: GLenum;\\n    readonly MEDIUM_FLOAT: GLenum;\\n    readonly MEDIUM_INT: GLenum;\\n    readonly MIRRORED_REPEAT: GLenum;\\n    readonly NEAREST: GLenum;\\n    readonly NEAREST_MIPMAP_LINEAR: GLenum;\\n    readonly NEAREST_MIPMAP_NEAREST: GLenum;\\n    readonly NEVER: GLenum;\\n    readonly NICEST: GLenum;\\n    readonly NONE: GLenum;\\n    readonly NOTEQUAL: GLenum;\\n    readonly NO_ERROR: GLenum;\\n    readonly ONE: GLenum;\\n    readonly ONE_MINUS_CONSTANT_ALPHA: GLenum;\\n    readonly ONE_MINUS_CONSTANT_COLOR: GLenum;\\n    readonly ONE_MINUS_DST_ALPHA: GLenum;\\n    readonly ONE_MINUS_DST_COLOR: GLenum;\\n    readonly ONE_MINUS_SRC_ALPHA: GLenum;\\n    readonly ONE_MINUS_SRC_COLOR: GLenum;\\n    readonly OUT_OF_MEMORY: GLenum;\\n    readonly PACK_ALIGNMENT: GLenum;\\n    readonly POINTS: GLenum;\\n    readonly POLYGON_OFFSET_FACTOR: GLenum;\\n    readonly POLYGON_OFFSET_FILL: GLenum;\\n    readonly POLYGON_OFFSET_UNITS: GLenum;\\n    readonly RED_BITS: GLenum;\\n    readonly RENDERBUFFER: GLenum;\\n    readonly RENDERBUFFER_ALPHA_SIZE: GLenum;\\n    readonly RENDERBUFFER_BINDING: GLenum;\\n    readonly RENDERBUFFER_BLUE_SIZE: GLenum;\\n    readonly RENDERBUFFER_DEPTH_SIZE: GLenum;\\n    readonly RENDERBUFFER_GREEN_SIZE: GLenum;\\n    readonly RENDERBUFFER_HEIGHT: GLenum;\\n    readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum;\\n    readonly RENDERBUFFER_RED_SIZE: GLenum;\\n    readonly RENDERBUFFER_STENCIL_SIZE: GLenum;\\n    readonly RENDERBUFFER_WIDTH: GLenum;\\n    readonly RENDERER: GLenum;\\n    readonly REPEAT: GLenum;\\n    readonly REPLACE: GLenum;\\n    readonly RGB: GLenum;\\n    readonly RGB565: GLenum;\\n    readonly RGB5_A1: GLenum;\\n    readonly RGBA: GLenum;\\n    readonly RGBA4: GLenum;\\n    readonly SAMPLER_2D: GLenum;\\n    readonly SAMPLER_CUBE: GLenum;\\n    readonly SAMPLES: GLenum;\\n    readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum;\\n    readonly SAMPLE_BUFFERS: GLenum;\\n    readonly SAMPLE_COVERAGE: GLenum;\\n    readonly SAMPLE_COVERAGE_INVERT: GLenum;\\n    readonly SAMPLE_COVERAGE_VALUE: GLenum;\\n    readonly SCISSOR_BOX: GLenum;\\n    readonly SCISSOR_TEST: GLenum;\\n    readonly SHADER_TYPE: GLenum;\\n    readonly SHADING_LANGUAGE_VERSION: GLenum;\\n    readonly SHORT: GLenum;\\n    readonly SRC_ALPHA: GLenum;\\n    readonly SRC_ALPHA_SATURATE: GLenum;\\n    readonly SRC_COLOR: GLenum;\\n    readonly STATIC_DRAW: GLenum;\\n    readonly STENCIL_ATTACHMENT: GLenum;\\n    readonly STENCIL_BACK_FAIL: GLenum;\\n    readonly STENCIL_BACK_FUNC: GLenum;\\n    readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum;\\n    readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum;\\n    readonly STENCIL_BACK_REF: GLenum;\\n    readonly STENCIL_BACK_VALUE_MASK: GLenum;\\n    readonly STENCIL_BACK_WRITEMASK: GLenum;\\n    readonly STENCIL_BITS: GLenum;\\n    readonly STENCIL_BUFFER_BIT: GLenum;\\n    readonly STENCIL_CLEAR_VALUE: GLenum;\\n    readonly STENCIL_FAIL: GLenum;\\n    readonly STENCIL_FUNC: GLenum;\\n    readonly STENCIL_INDEX8: GLenum;\\n    readonly STENCIL_PASS_DEPTH_FAIL: GLenum;\\n    readonly STENCIL_PASS_DEPTH_PASS: GLenum;\\n    readonly STENCIL_REF: GLenum;\\n    readonly STENCIL_TEST: GLenum;\\n    readonly STENCIL_VALUE_MASK: GLenum;\\n    readonly STENCIL_WRITEMASK: GLenum;\\n    readonly STREAM_DRAW: GLenum;\\n    readonly SUBPIXEL_BITS: GLenum;\\n    readonly TEXTURE: GLenum;\\n    readonly TEXTURE0: GLenum;\\n    readonly TEXTURE1: GLenum;\\n    readonly TEXTURE10: GLenum;\\n    readonly TEXTURE11: GLenum;\\n    readonly TEXTURE12: GLenum;\\n    readonly TEXTURE13: GLenum;\\n    readonly TEXTURE14: GLenum;\\n    readonly TEXTURE15: GLenum;\\n    readonly TEXTURE16: GLenum;\\n    readonly TEXTURE17: GLenum;\\n    readonly TEXTURE18: GLenum;\\n    readonly TEXTURE19: GLenum;\\n    readonly TEXTURE2: GLenum;\\n    readonly TEXTURE20: GLenum;\\n    readonly TEXTURE21: GLenum;\\n    readonly TEXTURE22: GLenum;\\n    readonly TEXTURE23: GLenum;\\n    readonly TEXTURE24: GLenum;\\n    readonly TEXTURE25: GLenum;\\n    readonly TEXTURE26: GLenum;\\n    readonly TEXTURE27: GLenum;\\n    readonly TEXTURE28: GLenum;\\n    readonly TEXTURE29: GLenum;\\n    readonly TEXTURE3: GLenum;\\n    readonly TEXTURE30: GLenum;\\n    readonly TEXTURE31: GLenum;\\n    readonly TEXTURE4: GLenum;\\n    readonly TEXTURE5: GLenum;\\n    readonly TEXTURE6: GLenum;\\n    readonly TEXTURE7: GLenum;\\n    readonly TEXTURE8: GLenum;\\n    readonly TEXTURE9: GLenum;\\n    readonly TEXTURE_2D: GLenum;\\n    readonly TEXTURE_BINDING_2D: GLenum;\\n    readonly TEXTURE_BINDING_CUBE_MAP: GLenum;\\n    readonly TEXTURE_CUBE_MAP: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum;\\n    readonly TEXTURE_MAG_FILTER: GLenum;\\n    readonly TEXTURE_MIN_FILTER: GLenum;\\n    readonly TEXTURE_WRAP_S: GLenum;\\n    readonly TEXTURE_WRAP_T: GLenum;\\n    readonly TRIANGLES: GLenum;\\n    readonly TRIANGLE_FAN: GLenum;\\n    readonly TRIANGLE_STRIP: GLenum;\\n    readonly UNPACK_ALIGNMENT: GLenum;\\n    readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum;\\n    readonly UNPACK_FLIP_Y_WEBGL: GLenum;\\n    readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum;\\n    readonly UNSIGNED_BYTE: GLenum;\\n    readonly UNSIGNED_INT: GLenum;\\n    readonly UNSIGNED_SHORT: GLenum;\\n    readonly UNSIGNED_SHORT_4_4_4_4: GLenum;\\n    readonly UNSIGNED_SHORT_5_5_5_1: GLenum;\\n    readonly UNSIGNED_SHORT_5_6_5: GLenum;\\n    readonly VALIDATE_STATUS: GLenum;\\n    readonly VENDOR: GLenum;\\n    readonly VERSION: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum;\\n    readonly VERTEX_SHADER: GLenum;\\n    readonly VIEWPORT: GLenum;\\n    readonly ZERO: GLenum;\\n};\\n\\ninterface WebGLRenderingContextBase {\\n    readonly canvas: OffscreenCanvas;\\n    readonly drawingBufferHeight: GLsizei;\\n    readonly drawingBufferWidth: GLsizei;\\n    activeTexture(texture: GLenum): void;\\n    attachShader(program: WebGLProgram, shader: WebGLShader): void;\\n    bindAttribLocation(program: WebGLProgram, index: GLuint, name: string): void;\\n    bindBuffer(target: GLenum, buffer: WebGLBuffer | null): void;\\n    bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer | null): void;\\n    bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer | null): void;\\n    bindTexture(target: GLenum, texture: WebGLTexture | null): void;\\n    blendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf): void;\\n    blendEquation(mode: GLenum): void;\\n    blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum): void;\\n    blendFunc(sfactor: GLenum, dfactor: GLenum): void;\\n    blendFuncSeparate(srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum): void;\\n    checkFramebufferStatus(target: GLenum): GLenum;\\n    clear(mask: GLbitfield): void;\\n    clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf): void;\\n    clearDepth(depth: GLclampf): void;\\n    clearStencil(s: GLint): void;\\n    colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean): void;\\n    compileShader(shader: WebGLShader): void;\\n    copyTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint): void;\\n    copyTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;\\n    createBuffer(): WebGLBuffer | null;\\n    createFramebuffer(): WebGLFramebuffer | null;\\n    createProgram(): WebGLProgram | null;\\n    createRenderbuffer(): WebGLRenderbuffer | null;\\n    createShader(type: GLenum): WebGLShader | null;\\n    createTexture(): WebGLTexture | null;\\n    cullFace(mode: GLenum): void;\\n    deleteBuffer(buffer: WebGLBuffer | null): void;\\n    deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void;\\n    deleteProgram(program: WebGLProgram | null): void;\\n    deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void;\\n    deleteShader(shader: WebGLShader | null): void;\\n    deleteTexture(texture: WebGLTexture | null): void;\\n    depthFunc(func: GLenum): void;\\n    depthMask(flag: GLboolean): void;\\n    depthRange(zNear: GLclampf, zFar: GLclampf): void;\\n    detachShader(program: WebGLProgram, shader: WebGLShader): void;\\n    disable(cap: GLenum): void;\\n    disableVertexAttribArray(index: GLuint): void;\\n    drawArrays(mode: GLenum, first: GLint, count: GLsizei): void;\\n    drawElements(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr): void;\\n    enable(cap: GLenum): void;\\n    enableVertexAttribArray(index: GLuint): void;\\n    finish(): void;\\n    flush(): void;\\n    framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: WebGLRenderbuffer | null): void;\\n    framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture | null, level: GLint): void;\\n    frontFace(mode: GLenum): void;\\n    generateMipmap(target: GLenum): void;\\n    getActiveAttrib(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;\\n    getActiveUniform(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;\\n    getAttachedShaders(program: WebGLProgram): WebGLShader[] | null;\\n    getAttribLocation(program: WebGLProgram, name: string): GLint;\\n    getBufferParameter(target: GLenum, pname: GLenum): any;\\n    getContextAttributes(): WebGLContextAttributes | null;\\n    getError(): GLenum;\\n    getExtension(extensionName: \\\"EXT_blend_minmax\\\"): EXT_blend_minmax | null;\\n    getExtension(extensionName: \\\"EXT_texture_filter_anisotropic\\\"): EXT_texture_filter_anisotropic | null;\\n    getExtension(extensionName: \\\"EXT_frag_depth\\\"): EXT_frag_depth | null;\\n    getExtension(extensionName: \\\"EXT_shader_texture_lod\\\"): EXT_shader_texture_lod | null;\\n    getExtension(extensionName: \\\"EXT_sRGB\\\"): EXT_sRGB | null;\\n    getExtension(extensionName: \\\"OES_vertex_array_object\\\"): OES_vertex_array_object | null;\\n    getExtension(extensionName: \\\"WEBGL_color_buffer_float\\\"): WEBGL_color_buffer_float | null;\\n    getExtension(extensionName: \\\"WEBGL_compressed_texture_astc\\\"): WEBGL_compressed_texture_astc | null;\\n    getExtension(extensionName: \\\"WEBGL_compressed_texture_s3tc_srgb\\\"): WEBGL_compressed_texture_s3tc_srgb | null;\\n    getExtension(extensionName: \\\"WEBGL_debug_shaders\\\"): WEBGL_debug_shaders | null;\\n    getExtension(extensionName: \\\"WEBGL_draw_buffers\\\"): WEBGL_draw_buffers | null;\\n    getExtension(extensionName: \\\"WEBGL_lose_context\\\"): WEBGL_lose_context | null;\\n    getExtension(extensionName: \\\"WEBGL_depth_texture\\\"): WEBGL_depth_texture | null;\\n    getExtension(extensionName: \\\"WEBGL_debug_renderer_info\\\"): WEBGL_debug_renderer_info | null;\\n    getExtension(extensionName: \\\"WEBGL_compressed_texture_s3tc\\\"): WEBGL_compressed_texture_s3tc | null;\\n    getExtension(extensionName: \\\"OES_texture_half_float_linear\\\"): OES_texture_half_float_linear | null;\\n    getExtension(extensionName: \\\"OES_texture_half_float\\\"): OES_texture_half_float | null;\\n    getExtension(extensionName: \\\"OES_texture_float_linear\\\"): OES_texture_float_linear | null;\\n    getExtension(extensionName: \\\"OES_texture_float\\\"): OES_texture_float | null;\\n    getExtension(extensionName: \\\"OES_standard_derivatives\\\"): OES_standard_derivatives | null;\\n    getExtension(extensionName: \\\"OES_element_index_uint\\\"): OES_element_index_uint | null;\\n    getExtension(extensionName: \\\"ANGLE_instanced_arrays\\\"): ANGLE_instanced_arrays | null;\\n    getExtension(extensionName: string): any;\\n    getFramebufferAttachmentParameter(target: GLenum, attachment: GLenum, pname: GLenum): any;\\n    getParameter(pname: GLenum): any;\\n    getProgramInfoLog(program: WebGLProgram): string | null;\\n    getProgramParameter(program: WebGLProgram, pname: GLenum): any;\\n    getRenderbufferParameter(target: GLenum, pname: GLenum): any;\\n    getShaderInfoLog(shader: WebGLShader): string | null;\\n    getShaderParameter(shader: WebGLShader, pname: GLenum): any;\\n    getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum): WebGLShaderPrecisionFormat | null;\\n    getShaderSource(shader: WebGLShader): string | null;\\n    getSupportedExtensions(): string[] | null;\\n    getTexParameter(target: GLenum, pname: GLenum): any;\\n    getUniform(program: WebGLProgram, location: WebGLUniformLocation): any;\\n    getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation | null;\\n    getVertexAttrib(index: GLuint, pname: GLenum): any;\\n    getVertexAttribOffset(index: GLuint, pname: GLenum): GLintptr;\\n    hint(target: GLenum, mode: GLenum): void;\\n    isBuffer(buffer: WebGLBuffer | null): GLboolean;\\n    isContextLost(): boolean;\\n    isEnabled(cap: GLenum): GLboolean;\\n    isFramebuffer(framebuffer: WebGLFramebuffer | null): GLboolean;\\n    isProgram(program: WebGLProgram | null): GLboolean;\\n    isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): GLboolean;\\n    isShader(shader: WebGLShader | null): GLboolean;\\n    isTexture(texture: WebGLTexture | null): GLboolean;\\n    lineWidth(width: GLfloat): void;\\n    linkProgram(program: WebGLProgram): void;\\n    pixelStorei(pname: GLenum, param: GLint | GLboolean): void;\\n    polygonOffset(factor: GLfloat, units: GLfloat): void;\\n    renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei): void;\\n    sampleCoverage(value: GLclampf, invert: GLboolean): void;\\n    scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;\\n    shaderSource(shader: WebGLShader, source: string): void;\\n    stencilFunc(func: GLenum, ref: GLint, mask: GLuint): void;\\n    stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint): void;\\n    stencilMask(mask: GLuint): void;\\n    stencilMaskSeparate(face: GLenum, mask: GLuint): void;\\n    stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum): void;\\n    stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum): void;\\n    texParameterf(target: GLenum, pname: GLenum, param: GLfloat): void;\\n    texParameteri(target: GLenum, pname: GLenum, param: GLint): void;\\n    uniform1f(location: WebGLUniformLocation | null, x: GLfloat): void;\\n    uniform1i(location: WebGLUniformLocation | null, x: GLint): void;\\n    uniform2f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat): void;\\n    uniform2i(location: WebGLUniformLocation | null, x: GLint, y: GLint): void;\\n    uniform3f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat): void;\\n    uniform3i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint): void;\\n    uniform4f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void;\\n    uniform4i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint, w: GLint): void;\\n    useProgram(program: WebGLProgram | null): void;\\n    validateProgram(program: WebGLProgram): void;\\n    vertexAttrib1f(index: GLuint, x: GLfloat): void;\\n    vertexAttrib1fv(index: GLuint, values: Float32List): void;\\n    vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat): void;\\n    vertexAttrib2fv(index: GLuint, values: Float32List): void;\\n    vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat): void;\\n    vertexAttrib3fv(index: GLuint, values: Float32List): void;\\n    vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void;\\n    vertexAttrib4fv(index: GLuint, values: Float32List): void;\\n    vertexAttribPointer(index: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr): void;\\n    viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;\\n    readonly ACTIVE_ATTRIBUTES: GLenum;\\n    readonly ACTIVE_TEXTURE: GLenum;\\n    readonly ACTIVE_UNIFORMS: GLenum;\\n    readonly ALIASED_LINE_WIDTH_RANGE: GLenum;\\n    readonly ALIASED_POINT_SIZE_RANGE: GLenum;\\n    readonly ALPHA: GLenum;\\n    readonly ALPHA_BITS: GLenum;\\n    readonly ALWAYS: GLenum;\\n    readonly ARRAY_BUFFER: GLenum;\\n    readonly ARRAY_BUFFER_BINDING: GLenum;\\n    readonly ATTACHED_SHADERS: GLenum;\\n    readonly BACK: GLenum;\\n    readonly BLEND: GLenum;\\n    readonly BLEND_COLOR: GLenum;\\n    readonly BLEND_DST_ALPHA: GLenum;\\n    readonly BLEND_DST_RGB: GLenum;\\n    readonly BLEND_EQUATION: GLenum;\\n    readonly BLEND_EQUATION_ALPHA: GLenum;\\n    readonly BLEND_EQUATION_RGB: GLenum;\\n    readonly BLEND_SRC_ALPHA: GLenum;\\n    readonly BLEND_SRC_RGB: GLenum;\\n    readonly BLUE_BITS: GLenum;\\n    readonly BOOL: GLenum;\\n    readonly BOOL_VEC2: GLenum;\\n    readonly BOOL_VEC3: GLenum;\\n    readonly BOOL_VEC4: GLenum;\\n    readonly BROWSER_DEFAULT_WEBGL: GLenum;\\n    readonly BUFFER_SIZE: GLenum;\\n    readonly BUFFER_USAGE: GLenum;\\n    readonly BYTE: GLenum;\\n    readonly CCW: GLenum;\\n    readonly CLAMP_TO_EDGE: GLenum;\\n    readonly COLOR_ATTACHMENT0: GLenum;\\n    readonly COLOR_BUFFER_BIT: GLenum;\\n    readonly COLOR_CLEAR_VALUE: GLenum;\\n    readonly COLOR_WRITEMASK: GLenum;\\n    readonly COMPILE_STATUS: GLenum;\\n    readonly COMPRESSED_TEXTURE_FORMATS: GLenum;\\n    readonly CONSTANT_ALPHA: GLenum;\\n    readonly CONSTANT_COLOR: GLenum;\\n    readonly CONTEXT_LOST_WEBGL: GLenum;\\n    readonly CULL_FACE: GLenum;\\n    readonly CULL_FACE_MODE: GLenum;\\n    readonly CURRENT_PROGRAM: GLenum;\\n    readonly CURRENT_VERTEX_ATTRIB: GLenum;\\n    readonly CW: GLenum;\\n    readonly DECR: GLenum;\\n    readonly DECR_WRAP: GLenum;\\n    readonly DELETE_STATUS: GLenum;\\n    readonly DEPTH_ATTACHMENT: GLenum;\\n    readonly DEPTH_BITS: GLenum;\\n    readonly DEPTH_BUFFER_BIT: GLenum;\\n    readonly DEPTH_CLEAR_VALUE: GLenum;\\n    readonly DEPTH_COMPONENT: GLenum;\\n    readonly DEPTH_COMPONENT16: GLenum;\\n    readonly DEPTH_FUNC: GLenum;\\n    readonly DEPTH_RANGE: GLenum;\\n    readonly DEPTH_STENCIL: GLenum;\\n    readonly DEPTH_STENCIL_ATTACHMENT: GLenum;\\n    readonly DEPTH_TEST: GLenum;\\n    readonly DEPTH_WRITEMASK: GLenum;\\n    readonly DITHER: GLenum;\\n    readonly DONT_CARE: GLenum;\\n    readonly DST_ALPHA: GLenum;\\n    readonly DST_COLOR: GLenum;\\n    readonly DYNAMIC_DRAW: GLenum;\\n    readonly ELEMENT_ARRAY_BUFFER: GLenum;\\n    readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum;\\n    readonly EQUAL: GLenum;\\n    readonly FASTEST: GLenum;\\n    readonly FLOAT: GLenum;\\n    readonly FLOAT_MAT2: GLenum;\\n    readonly FLOAT_MAT3: GLenum;\\n    readonly FLOAT_MAT4: GLenum;\\n    readonly FLOAT_VEC2: GLenum;\\n    readonly FLOAT_VEC3: GLenum;\\n    readonly FLOAT_VEC4: GLenum;\\n    readonly FRAGMENT_SHADER: GLenum;\\n    readonly FRAMEBUFFER: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum;\\n    readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum;\\n    readonly FRAMEBUFFER_BINDING: GLenum;\\n    readonly FRAMEBUFFER_COMPLETE: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum;\\n    readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum;\\n    readonly FRAMEBUFFER_UNSUPPORTED: GLenum;\\n    readonly FRONT: GLenum;\\n    readonly FRONT_AND_BACK: GLenum;\\n    readonly FRONT_FACE: GLenum;\\n    readonly FUNC_ADD: GLenum;\\n    readonly FUNC_REVERSE_SUBTRACT: GLenum;\\n    readonly FUNC_SUBTRACT: GLenum;\\n    readonly GENERATE_MIPMAP_HINT: GLenum;\\n    readonly GEQUAL: GLenum;\\n    readonly GREATER: GLenum;\\n    readonly GREEN_BITS: GLenum;\\n    readonly HIGH_FLOAT: GLenum;\\n    readonly HIGH_INT: GLenum;\\n    readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum;\\n    readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum;\\n    readonly INCR: GLenum;\\n    readonly INCR_WRAP: GLenum;\\n    readonly INT: GLenum;\\n    readonly INT_VEC2: GLenum;\\n    readonly INT_VEC3: GLenum;\\n    readonly INT_VEC4: GLenum;\\n    readonly INVALID_ENUM: GLenum;\\n    readonly INVALID_FRAMEBUFFER_OPERATION: GLenum;\\n    readonly INVALID_OPERATION: GLenum;\\n    readonly INVALID_VALUE: GLenum;\\n    readonly INVERT: GLenum;\\n    readonly KEEP: GLenum;\\n    readonly LEQUAL: GLenum;\\n    readonly LESS: GLenum;\\n    readonly LINEAR: GLenum;\\n    readonly LINEAR_MIPMAP_LINEAR: GLenum;\\n    readonly LINEAR_MIPMAP_NEAREST: GLenum;\\n    readonly LINES: GLenum;\\n    readonly LINE_LOOP: GLenum;\\n    readonly LINE_STRIP: GLenum;\\n    readonly LINE_WIDTH: GLenum;\\n    readonly LINK_STATUS: GLenum;\\n    readonly LOW_FLOAT: GLenum;\\n    readonly LOW_INT: GLenum;\\n    readonly LUMINANCE: GLenum;\\n    readonly LUMINANCE_ALPHA: GLenum;\\n    readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum;\\n    readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum;\\n    readonly MAX_RENDERBUFFER_SIZE: GLenum;\\n    readonly MAX_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_TEXTURE_SIZE: GLenum;\\n    readonly MAX_VARYING_VECTORS: GLenum;\\n    readonly MAX_VERTEX_ATTRIBS: GLenum;\\n    readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum;\\n    readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum;\\n    readonly MAX_VIEWPORT_DIMS: GLenum;\\n    readonly MEDIUM_FLOAT: GLenum;\\n    readonly MEDIUM_INT: GLenum;\\n    readonly MIRRORED_REPEAT: GLenum;\\n    readonly NEAREST: GLenum;\\n    readonly NEAREST_MIPMAP_LINEAR: GLenum;\\n    readonly NEAREST_MIPMAP_NEAREST: GLenum;\\n    readonly NEVER: GLenum;\\n    readonly NICEST: GLenum;\\n    readonly NONE: GLenum;\\n    readonly NOTEQUAL: GLenum;\\n    readonly NO_ERROR: GLenum;\\n    readonly ONE: GLenum;\\n    readonly ONE_MINUS_CONSTANT_ALPHA: GLenum;\\n    readonly ONE_MINUS_CONSTANT_COLOR: GLenum;\\n    readonly ONE_MINUS_DST_ALPHA: GLenum;\\n    readonly ONE_MINUS_DST_COLOR: GLenum;\\n    readonly ONE_MINUS_SRC_ALPHA: GLenum;\\n    readonly ONE_MINUS_SRC_COLOR: GLenum;\\n    readonly OUT_OF_MEMORY: GLenum;\\n    readonly PACK_ALIGNMENT: GLenum;\\n    readonly POINTS: GLenum;\\n    readonly POLYGON_OFFSET_FACTOR: GLenum;\\n    readonly POLYGON_OFFSET_FILL: GLenum;\\n    readonly POLYGON_OFFSET_UNITS: GLenum;\\n    readonly RED_BITS: GLenum;\\n    readonly RENDERBUFFER: GLenum;\\n    readonly RENDERBUFFER_ALPHA_SIZE: GLenum;\\n    readonly RENDERBUFFER_BINDING: GLenum;\\n    readonly RENDERBUFFER_BLUE_SIZE: GLenum;\\n    readonly RENDERBUFFER_DEPTH_SIZE: GLenum;\\n    readonly RENDERBUFFER_GREEN_SIZE: GLenum;\\n    readonly RENDERBUFFER_HEIGHT: GLenum;\\n    readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum;\\n    readonly RENDERBUFFER_RED_SIZE: GLenum;\\n    readonly RENDERBUFFER_STENCIL_SIZE: GLenum;\\n    readonly RENDERBUFFER_WIDTH: GLenum;\\n    readonly RENDERER: GLenum;\\n    readonly REPEAT: GLenum;\\n    readonly REPLACE: GLenum;\\n    readonly RGB: GLenum;\\n    readonly RGB565: GLenum;\\n    readonly RGB5_A1: GLenum;\\n    readonly RGBA: GLenum;\\n    readonly RGBA4: GLenum;\\n    readonly SAMPLER_2D: GLenum;\\n    readonly SAMPLER_CUBE: GLenum;\\n    readonly SAMPLES: GLenum;\\n    readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum;\\n    readonly SAMPLE_BUFFERS: GLenum;\\n    readonly SAMPLE_COVERAGE: GLenum;\\n    readonly SAMPLE_COVERAGE_INVERT: GLenum;\\n    readonly SAMPLE_COVERAGE_VALUE: GLenum;\\n    readonly SCISSOR_BOX: GLenum;\\n    readonly SCISSOR_TEST: GLenum;\\n    readonly SHADER_TYPE: GLenum;\\n    readonly SHADING_LANGUAGE_VERSION: GLenum;\\n    readonly SHORT: GLenum;\\n    readonly SRC_ALPHA: GLenum;\\n    readonly SRC_ALPHA_SATURATE: GLenum;\\n    readonly SRC_COLOR: GLenum;\\n    readonly STATIC_DRAW: GLenum;\\n    readonly STENCIL_ATTACHMENT: GLenum;\\n    readonly STENCIL_BACK_FAIL: GLenum;\\n    readonly STENCIL_BACK_FUNC: GLenum;\\n    readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum;\\n    readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum;\\n    readonly STENCIL_BACK_REF: GLenum;\\n    readonly STENCIL_BACK_VALUE_MASK: GLenum;\\n    readonly STENCIL_BACK_WRITEMASK: GLenum;\\n    readonly STENCIL_BITS: GLenum;\\n    readonly STENCIL_BUFFER_BIT: GLenum;\\n    readonly STENCIL_CLEAR_VALUE: GLenum;\\n    readonly STENCIL_FAIL: GLenum;\\n    readonly STENCIL_FUNC: GLenum;\\n    readonly STENCIL_INDEX8: GLenum;\\n    readonly STENCIL_PASS_DEPTH_FAIL: GLenum;\\n    readonly STENCIL_PASS_DEPTH_PASS: GLenum;\\n    readonly STENCIL_REF: GLenum;\\n    readonly STENCIL_TEST: GLenum;\\n    readonly STENCIL_VALUE_MASK: GLenum;\\n    readonly STENCIL_WRITEMASK: GLenum;\\n    readonly STREAM_DRAW: GLenum;\\n    readonly SUBPIXEL_BITS: GLenum;\\n    readonly TEXTURE: GLenum;\\n    readonly TEXTURE0: GLenum;\\n    readonly TEXTURE1: GLenum;\\n    readonly TEXTURE10: GLenum;\\n    readonly TEXTURE11: GLenum;\\n    readonly TEXTURE12: GLenum;\\n    readonly TEXTURE13: GLenum;\\n    readonly TEXTURE14: GLenum;\\n    readonly TEXTURE15: GLenum;\\n    readonly TEXTURE16: GLenum;\\n    readonly TEXTURE17: GLenum;\\n    readonly TEXTURE18: GLenum;\\n    readonly TEXTURE19: GLenum;\\n    readonly TEXTURE2: GLenum;\\n    readonly TEXTURE20: GLenum;\\n    readonly TEXTURE21: GLenum;\\n    readonly TEXTURE22: GLenum;\\n    readonly TEXTURE23: GLenum;\\n    readonly TEXTURE24: GLenum;\\n    readonly TEXTURE25: GLenum;\\n    readonly TEXTURE26: GLenum;\\n    readonly TEXTURE27: GLenum;\\n    readonly TEXTURE28: GLenum;\\n    readonly TEXTURE29: GLenum;\\n    readonly TEXTURE3: GLenum;\\n    readonly TEXTURE30: GLenum;\\n    readonly TEXTURE31: GLenum;\\n    readonly TEXTURE4: GLenum;\\n    readonly TEXTURE5: GLenum;\\n    readonly TEXTURE6: GLenum;\\n    readonly TEXTURE7: GLenum;\\n    readonly TEXTURE8: GLenum;\\n    readonly TEXTURE9: GLenum;\\n    readonly TEXTURE_2D: GLenum;\\n    readonly TEXTURE_BINDING_2D: GLenum;\\n    readonly TEXTURE_BINDING_CUBE_MAP: GLenum;\\n    readonly TEXTURE_CUBE_MAP: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum;\\n    readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum;\\n    readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum;\\n    readonly TEXTURE_MAG_FILTER: GLenum;\\n    readonly TEXTURE_MIN_FILTER: GLenum;\\n    readonly TEXTURE_WRAP_S: GLenum;\\n    readonly TEXTURE_WRAP_T: GLenum;\\n    readonly TRIANGLES: GLenum;\\n    readonly TRIANGLE_FAN: GLenum;\\n    readonly TRIANGLE_STRIP: GLenum;\\n    readonly UNPACK_ALIGNMENT: GLenum;\\n    readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum;\\n    readonly UNPACK_FLIP_Y_WEBGL: GLenum;\\n    readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum;\\n    readonly UNSIGNED_BYTE: GLenum;\\n    readonly UNSIGNED_INT: GLenum;\\n    readonly UNSIGNED_SHORT: GLenum;\\n    readonly UNSIGNED_SHORT_4_4_4_4: GLenum;\\n    readonly UNSIGNED_SHORT_5_5_5_1: GLenum;\\n    readonly UNSIGNED_SHORT_5_6_5: GLenum;\\n    readonly VALIDATE_STATUS: GLenum;\\n    readonly VENDOR: GLenum;\\n    readonly VERSION: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum;\\n    readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum;\\n    readonly VERTEX_SHADER: GLenum;\\n    readonly VIEWPORT: GLenum;\\n    readonly ZERO: GLenum;\\n}\\n\\ninterface WebGLRenderingContextOverloads {\\n    bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum): void;\\n    bufferData(target: GLenum, data: BufferSource | null, usage: GLenum): void;\\n    bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource): void;\\n    compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: ArrayBufferView): void;\\n    compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: ArrayBufferView): void;\\n    readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;\\n    texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;\\n    texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;\\n    texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;\\n    texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;\\n    uniform1fv(location: WebGLUniformLocation | null, v: Float32List): void;\\n    uniform1iv(location: WebGLUniformLocation | null, v: Int32List): void;\\n    uniform2fv(location: WebGLUniformLocation | null, v: Float32List): void;\\n    uniform2iv(location: WebGLUniformLocation | null, v: Int32List): void;\\n    uniform3fv(location: WebGLUniformLocation | null, v: Float32List): void;\\n    uniform3iv(location: WebGLUniformLocation | null, v: Int32List): void;\\n    uniform4fv(location: WebGLUniformLocation | null, v: Float32List): void;\\n    uniform4iv(location: WebGLUniformLocation | null, v: Int32List): void;\\n    uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;\\n    uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;\\n    uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;\\n}\\n\\ninterface WebGLSampler extends WebGLObject {\\n}\\n\\ndeclare var WebGLSampler: {\\n    prototype: WebGLSampler;\\n    new(): WebGLSampler;\\n};\\n\\n/** The WebGLShader is part of the WebGL API and can either be a vertex or a fragment shader. A WebGLProgram requires both types of shaders. */\\ninterface WebGLShader extends WebGLObject {\\n}\\n\\ndeclare var WebGLShader: {\\n    prototype: WebGLShader;\\n    new(): WebGLShader;\\n};\\n\\n/** Part of the WebGL API and represents the information returned by calling the WebGLRenderingContext.getShaderPrecisionFormat() method. */\\ninterface WebGLShaderPrecisionFormat {\\n    readonly precision: GLint;\\n    readonly rangeMax: GLint;\\n    readonly rangeMin: GLint;\\n}\\n\\ndeclare var WebGLShaderPrecisionFormat: {\\n    prototype: WebGLShaderPrecisionFormat;\\n    new(): WebGLShaderPrecisionFormat;\\n};\\n\\ninterface WebGLSync extends WebGLObject {\\n}\\n\\ndeclare var WebGLSync: {\\n    prototype: WebGLSync;\\n    new(): WebGLSync;\\n};\\n\\n/** Part of the WebGL API and represents an opaque texture object providing storage and state for texturing operations. */\\ninterface WebGLTexture extends WebGLObject {\\n}\\n\\ndeclare var WebGLTexture: {\\n    prototype: WebGLTexture;\\n    new(): WebGLTexture;\\n};\\n\\ninterface WebGLTransformFeedback extends WebGLObject {\\n}\\n\\ndeclare var WebGLTransformFeedback: {\\n    prototype: WebGLTransformFeedback;\\n    new(): WebGLTransformFeedback;\\n};\\n\\n/** Part of the WebGL API and represents the location of a uniform variable in a shader program. */\\ninterface WebGLUniformLocation {\\n}\\n\\ndeclare var WebGLUniformLocation: {\\n    prototype: WebGLUniformLocation;\\n    new(): WebGLUniformLocation;\\n};\\n\\ninterface WebGLVertexArrayObject extends WebGLObject {\\n}\\n\\ndeclare var WebGLVertexArrayObject: {\\n    prototype: WebGLVertexArrayObject;\\n    new(): WebGLVertexArrayObject;\\n};\\n\\ninterface WebGLVertexArrayObjectOES extends WebGLObject {\\n}\\n\\ninterface WebSocketEventMap {\\n    \\\"close\\\": CloseEvent;\\n    \\\"error\\\": Event;\\n    \\\"message\\\": MessageEvent;\\n    \\\"open\\\": Event;\\n}\\n\\n/** Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection. */\\ninterface WebSocket extends EventTarget {\\n    /**\\n     * Returns a string that indicates how binary data from the WebSocket object is exposed to scripts:\\n     * \\n     * Can be set, to change how binary data is returned. The default is \\\"blob\\\".\\n     */\\n    binaryType: BinaryType;\\n    /**\\n     * Returns the number of bytes of application data (UTF-8 text and binary data) that have been queued using send() but not yet been transmitted to the network.\\n     * \\n     * If the WebSocket connection is closed, this attribute's value will only increase with each call to the send() method. (The number does not reset to zero once the connection closes.)\\n     */\\n    readonly bufferedAmount: number;\\n    /**\\n     * Returns the extensions selected by the server, if any.\\n     */\\n    readonly extensions: string;\\n    onclose: ((this: WebSocket, ev: CloseEvent) => any) | null;\\n    onerror: ((this: WebSocket, ev: Event) => any) | null;\\n    onmessage: ((this: WebSocket, ev: MessageEvent) => any) | null;\\n    onopen: ((this: WebSocket, ev: Event) => any) | null;\\n    /**\\n     * Returns the subprotocol selected by the server, if any. It can be used in conjunction with the array form of the constructor's second argument to perform subprotocol negotiation.\\n     */\\n    readonly protocol: string;\\n    /**\\n     * Returns the state of the WebSocket object's connection. It can have the values described below.\\n     */\\n    readonly readyState: number;\\n    /**\\n     * Returns the URL that was used to establish the WebSocket connection.\\n     */\\n    readonly url: string;\\n    /**\\n     * Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.\\n     */\\n    close(code?: number, reason?: string): void;\\n    /**\\n     * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.\\n     */\\n    send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;\\n    readonly CLOSED: number;\\n    readonly CLOSING: number;\\n    readonly CONNECTING: number;\\n    readonly OPEN: number;\\n    addEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var WebSocket: {\\n    prototype: WebSocket;\\n    new(url: string, protocols?: string | string[]): WebSocket;\\n    readonly CLOSED: number;\\n    readonly CLOSING: number;\\n    readonly CONNECTING: number;\\n    readonly OPEN: number;\\n};\\n\\n/** This ServiceWorker API interface represents the scope of a service worker client that is a document in a browser context, controlled by an active worker. The service worker client independently selects and uses a service worker for its own loading and sub-resources. */\\ninterface WindowClient extends Client {\\n    readonly ancestorOrigins: ReadonlyArray<string>;\\n    readonly focused: boolean;\\n    readonly visibilityState: VisibilityState;\\n    focus(): Promise<WindowClient>;\\n    navigate(url: string): Promise<WindowClient | null>;\\n}\\n\\ndeclare var WindowClient: {\\n    prototype: WindowClient;\\n    new(): WindowClient;\\n};\\n\\ninterface WindowOrWorkerGlobalScope {\\n    readonly caches: CacheStorage;\\n    readonly crypto: Crypto;\\n    readonly indexedDB: IDBFactory;\\n    readonly isSecureContext: boolean;\\n    readonly origin: string;\\n    readonly performance: Performance;\\n    atob(data: string): string;\\n    btoa(data: string): string;\\n    clearInterval(handle?: number): void;\\n    clearTimeout(handle?: number): void;\\n    createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;\\n    createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;\\n    fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;\\n    queueMicrotask(callback: VoidFunction): void;\\n    setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;\\n    setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;\\n}\\n\\ninterface WorkerEventMap extends AbstractWorkerEventMap {\\n    \\\"message\\\": MessageEvent;\\n    \\\"messageerror\\\": MessageEvent;\\n}\\n\\n/** This Web Workers API interface represents a background task that can be easily created and can send messages back to its creator. Creating a worker is as simple as calling the Worker() constructor and specifying a script to be run in the worker thread. */\\ninterface Worker extends EventTarget, AbstractWorker {\\n    onmessage: ((this: Worker, ev: MessageEvent) => any) | null;\\n    onmessageerror: ((this: Worker, ev: MessageEvent) => any) | null;\\n    /**\\n     * Clones message and transmits it to worker's global environment. transfer can be passed as a list of objects that are to be transferred rather than cloned.\\n     */\\n    postMessage(message: any, transfer: Transferable[]): void;\\n    postMessage(message: any, options?: PostMessageOptions): void;\\n    /**\\n     * Aborts worker's associated global environment.\\n     */\\n    terminate(): void;\\n    addEventListener<K extends keyof WorkerEventMap>(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof WorkerEventMap>(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var Worker: {\\n    prototype: Worker;\\n    new(stringUrl: string | URL, options?: WorkerOptions): Worker;\\n};\\n\\ninterface WorkerGlobalScopeEventMap {\\n    \\\"error\\\": ErrorEvent;\\n    \\\"languagechange\\\": Event;\\n    \\\"offline\\\": Event;\\n    \\\"online\\\": Event;\\n    \\\"rejectionhandled\\\": PromiseRejectionEvent;\\n    \\\"unhandledrejection\\\": PromiseRejectionEvent;\\n}\\n\\n/** This Web Workers API interface is an interface representing the scope of any worker. Workers have no browsing context; this scope contains the information usually conveyed by Window objects — in this case event handlers, the console or the associated WorkerNavigator object. Each WorkerGlobalScope has its own event loop. */\\ninterface WorkerGlobalScope extends EventTarget, WindowOrWorkerGlobalScope {\\n    /**\\n     * Returns workerGlobal's WorkerLocation object.\\n     */\\n    readonly location: WorkerLocation;\\n    readonly navigator: WorkerNavigator;\\n    onerror: ((this: WorkerGlobalScope, ev: ErrorEvent) => any) | null;\\n    onlanguagechange: ((this: WorkerGlobalScope, ev: Event) => any) | null;\\n    onoffline: ((this: WorkerGlobalScope, ev: Event) => any) | null;\\n    ononline: ((this: WorkerGlobalScope, ev: Event) => any) | null;\\n    onrejectionhandled: ((this: WorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null;\\n    onunhandledrejection: ((this: WorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null;\\n    /**\\n     * Returns workerGlobal.\\n     */\\n    readonly self: WorkerGlobalScope & typeof globalThis;\\n    /**\\n     * Fetches each URL in urls, executes them one-by-one in the order they are passed, and then returns (or throws if something went amiss).\\n     */\\n    importScripts(...urls: string[]): void;\\n    addEventListener<K extends keyof WorkerGlobalScopeEventMap>(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof WorkerGlobalScopeEventMap>(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var WorkerGlobalScope: {\\n    prototype: WorkerGlobalScope;\\n    new(): WorkerGlobalScope;\\n};\\n\\n/** The absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.location property obtained by calling self.location. */\\ninterface WorkerLocation {\\n    readonly hash: string;\\n    readonly host: string;\\n    readonly hostname: string;\\n    readonly href: string;\\n    toString(): string;\\n    readonly origin: string;\\n    readonly pathname: string;\\n    readonly port: string;\\n    readonly protocol: string;\\n    readonly search: string;\\n}\\n\\ndeclare var WorkerLocation: {\\n    prototype: WorkerLocation;\\n    new(): WorkerLocation;\\n};\\n\\n/** A subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property obtained by calling window.self.navigator. */\\ninterface WorkerNavigator extends NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorStorage {\\n    readonly permissions: Permissions;\\n    readonly serviceWorker: ServiceWorkerContainer;\\n}\\n\\ndeclare var WorkerNavigator: {\\n    prototype: WorkerNavigator;\\n    new(): WorkerNavigator;\\n};\\n\\n/** This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing. */\\ninterface WritableStream<W = any> {\\n    readonly locked: boolean;\\n    abort(reason?: any): Promise<void>;\\n    getWriter(): WritableStreamDefaultWriter<W>;\\n}\\n\\ndeclare var WritableStream: {\\n    prototype: WritableStream;\\n    new<W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;\\n};\\n\\n/** This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate. */\\ninterface WritableStreamDefaultController {\\n    error(e?: any): void;\\n}\\n\\ndeclare var WritableStreamDefaultController: {\\n    prototype: WritableStreamDefaultController;\\n    new(): WritableStreamDefaultController;\\n};\\n\\n/** This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink. */\\ninterface WritableStreamDefaultWriter<W = any> {\\n    readonly closed: Promise<undefined>;\\n    readonly desiredSize: number | null;\\n    readonly ready: Promise<undefined>;\\n    abort(reason?: any): Promise<void>;\\n    close(): Promise<void>;\\n    releaseLock(): void;\\n    write(chunk: W): Promise<void>;\\n}\\n\\ndeclare var WritableStreamDefaultWriter: {\\n    prototype: WritableStreamDefaultWriter;\\n    new<W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;\\n};\\n\\ninterface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap {\\n    \\\"readystatechange\\\": Event;\\n}\\n\\n/** Use XMLHttpRequest (XHR) objects to interact with servers. You can retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just part of a page without disrupting what the user is doing. */\\ninterface XMLHttpRequest extends XMLHttpRequestEventTarget {\\n    onreadystatechange: ((this: XMLHttpRequest, ev: Event) => any) | null;\\n    /**\\n     * Returns client's state.\\n     */\\n    readonly readyState: number;\\n    /**\\n     * Returns the response's body.\\n     */\\n    readonly response: any;\\n    /**\\n     * Returns the text response.\\n     * \\n     * Throws an \\\"InvalidStateError\\\" DOMException if responseType is not the empty string or \\\"text\\\".\\n     */\\n    readonly responseText: string;\\n    /**\\n     * Returns the response type.\\n     * \\n     * Can be set to change the response type. Values are: the empty string (default), \\\"arraybuffer\\\", \\\"blob\\\", \\\"document\\\", \\\"json\\\", and \\\"text\\\".\\n     * \\n     * When set: setting to \\\"document\\\" is ignored if current global object is not a Window object.\\n     * \\n     * When set: throws an \\\"InvalidStateError\\\" DOMException if state is loading or done.\\n     * \\n     * When set: throws an \\\"InvalidAccessError\\\" DOMException if the synchronous flag is set and current global object is a Window object.\\n     */\\n    responseType: XMLHttpRequestResponseType;\\n    readonly responseURL: string;\\n    readonly status: number;\\n    readonly statusText: string;\\n    /**\\n     * Can be set to a time in milliseconds. When set to a non-zero value will cause fetching to terminate after the given time has passed. When the time has passed, the request has not yet completed, and the synchronous flag is unset, a timeout event will then be dispatched, or a \\\"TimeoutError\\\" DOMException will be thrown otherwise (for the send() method).\\n     * \\n     * When set: throws an \\\"InvalidAccessError\\\" DOMException if the synchronous flag is set and current global object is a Window object.\\n     */\\n    timeout: number;\\n    /**\\n     * Returns the associated XMLHttpRequestUpload object. It can be used to gather transmission information when data is transferred to a server.\\n     */\\n    readonly upload: XMLHttpRequestUpload;\\n    /**\\n     * True when credentials are to be included in a cross-origin request. False when they are to be excluded in a cross-origin request and when cookies are to be ignored in its response. Initially false.\\n     * \\n     * When set: throws an \\\"InvalidStateError\\\" DOMException if state is not unsent or opened, or if the send() flag is set.\\n     */\\n    withCredentials: boolean;\\n    /**\\n     * Cancels any network activity.\\n     */\\n    abort(): void;\\n    getAllResponseHeaders(): string;\\n    getResponseHeader(name: string): string | null;\\n    /**\\n     * Sets the request method, request URL, and synchronous flag.\\n     * \\n     * Throws a \\\"SyntaxError\\\" DOMException if either method is not a valid HTTP method or url cannot be parsed.\\n     * \\n     * Throws a \\\"SecurityError\\\" DOMException if method is a case-insensitive match for `CONNECT`, `TRACE`, or `TRACK`.\\n     * \\n     * Throws an \\\"InvalidAccessError\\\" DOMException if async is false, current global object is a Window object, and the timeout attribute is not zero or the responseType attribute is not the empty string.\\n     */\\n    open(method: string, url: string): void;\\n    open(method: string, url: string, async: boolean, username?: string | null, password?: string | null): void;\\n    /**\\n     * Acts as if the `Content-Type` header value for response is mime. (It does not actually change the header though.)\\n     * \\n     * Throws an \\\"InvalidStateError\\\" DOMException if state is loading or done.\\n     */\\n    overrideMimeType(mime: string): void;\\n    /**\\n     * Initiates the request. The body argument provides the request body, if any, and is ignored if the request method is GET or HEAD.\\n     * \\n     * Throws an \\\"InvalidStateError\\\" DOMException if either state is not opened or the send() flag is set.\\n     */\\n    send(body?: BodyInit | null): void;\\n    /**\\n     * Combines a header in author request headers.\\n     * \\n     * Throws an \\\"InvalidStateError\\\" DOMException if either state is not opened or the send() flag is set.\\n     * \\n     * Throws a \\\"SyntaxError\\\" DOMException if name is not a header name or if value is not a header value.\\n     */\\n    setRequestHeader(name: string, value: string): void;\\n    readonly DONE: number;\\n    readonly HEADERS_RECEIVED: number;\\n    readonly LOADING: number;\\n    readonly OPENED: number;\\n    readonly UNSENT: number;\\n    addEventListener<K extends keyof XMLHttpRequestEventMap>(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof XMLHttpRequestEventMap>(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var XMLHttpRequest: {\\n    prototype: XMLHttpRequest;\\n    new(): XMLHttpRequest;\\n    readonly DONE: number;\\n    readonly HEADERS_RECEIVED: number;\\n    readonly LOADING: number;\\n    readonly OPENED: number;\\n    readonly UNSENT: number;\\n};\\n\\ninterface XMLHttpRequestEventTargetEventMap {\\n    \\\"abort\\\": ProgressEvent<XMLHttpRequestEventTarget>;\\n    \\\"error\\\": ProgressEvent<XMLHttpRequestEventTarget>;\\n    \\\"load\\\": ProgressEvent<XMLHttpRequestEventTarget>;\\n    \\\"loadend\\\": ProgressEvent<XMLHttpRequestEventTarget>;\\n    \\\"loadstart\\\": ProgressEvent<XMLHttpRequestEventTarget>;\\n    \\\"progress\\\": ProgressEvent<XMLHttpRequestEventTarget>;\\n    \\\"timeout\\\": ProgressEvent<XMLHttpRequestEventTarget>;\\n}\\n\\ninterface XMLHttpRequestEventTarget extends EventTarget {\\n    onabort: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\\n    onerror: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\\n    onload: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\\n    onloadend: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\\n    onloadstart: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\\n    onprogress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\\n    ontimeout: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\\n    addEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var XMLHttpRequestEventTarget: {\\n    prototype: XMLHttpRequestEventTarget;\\n    new(): XMLHttpRequestEventTarget;\\n};\\n\\ninterface XMLHttpRequestUpload extends XMLHttpRequestEventTarget {\\n    addEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\n    removeEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\n}\\n\\ndeclare var XMLHttpRequestUpload: {\\n    prototype: XMLHttpRequestUpload;\\n    new(): XMLHttpRequestUpload;\\n};\\n\\ndeclare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;\\n\\ninterface Console {\\n    memory: any;\\n    assert(condition?: boolean, ...data: any[]): void;\\n    clear(): void;\\n    count(label?: string): void;\\n    countReset(label?: string): void;\\n    debug(...data: any[]): void;\\n    dir(item?: any, options?: any): void;\\n    dirxml(...data: any[]): void;\\n    error(...data: any[]): void;\\n    exception(message?: string, ...optionalParams: any[]): void;\\n    group(...data: any[]): void;\\n    groupCollapsed(...data: any[]): void;\\n    groupEnd(): void;\\n    info(...data: any[]): void;\\n    log(...data: any[]): void;\\n    table(tabularData?: any, properties?: string[]): void;\\n    time(label?: string): void;\\n    timeEnd(label?: string): void;\\n    timeLog(label?: string, ...data: any[]): void;\\n    timeStamp(label?: string): void;\\n    trace(...data: any[]): void;\\n    warn(...data: any[]): void;\\n}\\n\\ndeclare var console: Console;\\n\\ndeclare namespace WebAssembly {\\n    interface Global {\\n        value: any;\\n        valueOf(): any;\\n    }\\n    \\n    var Global: {\\n        prototype: Global;\\n        new(descriptor: GlobalDescriptor, v?: any): Global;\\n    };\\n    \\n    interface Instance {\\n        readonly exports: Exports;\\n    }\\n    \\n    var Instance: {\\n        prototype: Instance;\\n        new(module: Module, importObject?: Imports): Instance;\\n    };\\n    \\n    interface Memory {\\n        readonly buffer: ArrayBuffer;\\n        grow(delta: number): number;\\n    }\\n    \\n    var Memory: {\\n        prototype: Memory;\\n        new(descriptor: MemoryDescriptor): Memory;\\n    };\\n    \\n    interface Module {\\n    }\\n    \\n    var Module: {\\n        prototype: Module;\\n        new(bytes: BufferSource): Module;\\n        customSections(moduleObject: Module, sectionName: string): ArrayBuffer[];\\n        exports(moduleObject: Module): ModuleExportDescriptor[];\\n        imports(moduleObject: Module): ModuleImportDescriptor[];\\n    };\\n    \\n    interface Table {\\n        readonly length: number;\\n        get(index: number): Function | null;\\n        grow(delta: number): number;\\n        set(index: number, value: Function | null): void;\\n    }\\n    \\n    var Table: {\\n        prototype: Table;\\n        new(descriptor: TableDescriptor): Table;\\n    };\\n    \\n    interface GlobalDescriptor {\\n        mutable?: boolean;\\n        value: ValueType;\\n    }\\n    \\n    interface MemoryDescriptor {\\n        initial: number;\\n        maximum?: number;\\n    }\\n    \\n    interface ModuleExportDescriptor {\\n        kind: ImportExportKind;\\n        name: string;\\n    }\\n    \\n    interface ModuleImportDescriptor {\\n        kind: ImportExportKind;\\n        module: string;\\n        name: string;\\n    }\\n    \\n    interface TableDescriptor {\\n        element: TableKind;\\n        initial: number;\\n        maximum?: number;\\n    }\\n    \\n    interface WebAssemblyInstantiatedSource {\\n        instance: Instance;\\n        module: Module;\\n    }\\n    \\n    type ImportExportKind = \\\"function\\\" | \\\"global\\\" | \\\"memory\\\" | \\\"table\\\";\\n    type TableKind = \\\"anyfunc\\\";\\n    type ValueType = \\\"f32\\\" | \\\"f64\\\" | \\\"i32\\\" | \\\"i64\\\";\\n    type ExportValue = Function | Global | Memory | Table;\\n    type Exports = Record<string, ExportValue>;\\n    type ImportValue = ExportValue | number;\\n    type ModuleImports = Record<string, ImportValue>;\\n    type Imports = Record<string, ModuleImports>;\\n    function compile(bytes: BufferSource): Promise<Module>;\\n    function compileStreaming(source: Response | Promise<Response>): Promise<Module>;\\n    function instantiate(bytes: BufferSource, importObject?: Imports): Promise<WebAssemblyInstantiatedSource>;\\n    function instantiate(moduleObject: Module, importObject?: Imports): Promise<Instance>;\\n    function instantiateStreaming(response: Response | PromiseLike<Response>, importObject?: Imports): Promise<WebAssemblyInstantiatedSource>;\\n    function validate(bytes: BufferSource): boolean;\\n}\\n\\ninterface FrameRequestCallback {\\n    (time: number): void;\\n}\\n\\ninterface OnErrorEventHandlerNonNull {\\n    (event: Event | string, source?: string, lineno?: number, colno?: number, error?: Error): any;\\n}\\n\\ninterface PerformanceObserverCallback {\\n    (entries: PerformanceObserverEntryList, observer: PerformanceObserver): void;\\n}\\n\\ninterface QueuingStrategySize<T = any> {\\n    (chunk: T): number;\\n}\\n\\ninterface TransformerFlushCallback<O> {\\n    (controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;\\n}\\n\\ninterface TransformerStartCallback<O> {\\n    (controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;\\n}\\n\\ninterface TransformerTransformCallback<I, O> {\\n    (chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;\\n}\\n\\ninterface UnderlyingSinkAbortCallback {\\n    (reason: any): void | PromiseLike<void>;\\n}\\n\\ninterface UnderlyingSinkCloseCallback {\\n    (): void | PromiseLike<void>;\\n}\\n\\ninterface UnderlyingSinkStartCallback {\\n    (controller: WritableStreamDefaultController): void | PromiseLike<void>;\\n}\\n\\ninterface UnderlyingSinkWriteCallback<W> {\\n    (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike<void>;\\n}\\n\\ninterface UnderlyingSourceCancelCallback {\\n    (reason: any): void | PromiseLike<void>;\\n}\\n\\ninterface UnderlyingSourcePullCallback<R> {\\n    (controller: ReadableStreamController<R>): void | PromiseLike<void>;\\n}\\n\\ninterface UnderlyingSourceStartCallback<R> {\\n    (controller: ReadableStreamController<R>): void | PromiseLike<void>;\\n}\\n\\ninterface VoidFunction {\\n    (): void;\\n}\\n\\n/**\\n * Returns dedicatedWorkerGlobal's name, i.e. the value given to the Worker constructor. Primarily useful for debugging.\\n */\\ndeclare var name: string;\\ndeclare var onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;\\ndeclare var onmessageerror: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;\\n/**\\n * Aborts dedicatedWorkerGlobal.\\n */\\ndeclare function close(): void;\\n/**\\n * Clones message and transmits it to the Worker object associated with dedicatedWorkerGlobal. transfer can be passed as a list of objects that are to be transferred rather than cloned.\\n */\\ndeclare function postMessage(message: any, transfer: Transferable[]): void;\\ndeclare function postMessage(message: any, options?: PostMessageOptions): void;\\n/**\\n * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.\\n */\\ndeclare function dispatchEvent(event: Event): boolean;\\n/**\\n * Returns workerGlobal's WorkerLocation object.\\n */\\ndeclare var location: WorkerLocation;\\ndeclare var navigator: WorkerNavigator;\\ndeclare var onerror: ((this: DedicatedWorkerGlobalScope, ev: ErrorEvent) => any) | null;\\ndeclare var onlanguagechange: ((this: DedicatedWorkerGlobalScope, ev: Event) => any) | null;\\ndeclare var onoffline: ((this: DedicatedWorkerGlobalScope, ev: Event) => any) | null;\\ndeclare var ononline: ((this: DedicatedWorkerGlobalScope, ev: Event) => any) | null;\\ndeclare var onrejectionhandled: ((this: DedicatedWorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null;\\ndeclare var onunhandledrejection: ((this: DedicatedWorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null;\\n/**\\n * Returns workerGlobal.\\n */\\ndeclare var self: WorkerGlobalScope & typeof globalThis;\\n/**\\n * Fetches each URL in urls, executes them one-by-one in the order they are passed, and then returns (or throws if something went amiss).\\n */\\ndeclare function importScripts(...urls: string[]): void;\\n/**\\n * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.\\n */\\ndeclare function dispatchEvent(event: Event): boolean;\\ndeclare var caches: CacheStorage;\\ndeclare var crypto: Crypto;\\ndeclare var indexedDB: IDBFactory;\\ndeclare var isSecureContext: boolean;\\ndeclare var origin: string;\\ndeclare var performance: Performance;\\ndeclare function atob(data: string): string;\\ndeclare function btoa(data: string): string;\\ndeclare function clearInterval(handle?: number): void;\\ndeclare function clearTimeout(handle?: number): void;\\ndeclare function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;\\ndeclare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;\\ndeclare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;\\ndeclare function queueMicrotask(callback: VoidFunction): void;\\ndeclare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;\\ndeclare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;\\ndeclare function cancelAnimationFrame(handle: number): void;\\ndeclare function requestAnimationFrame(callback: FrameRequestCallback): number;\\ndeclare function addEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\\ndeclare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\\ndeclare function removeEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\\ndeclare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\\ntype HeadersInit = Headers | string[][] | Record<string, string>;\\ntype BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream<Uint8Array> | string;\\ntype RequestInfo = Request | string;\\ntype BlobPart = BufferSource | Blob | string;\\ntype DOMHighResTimeStamp = number;\\ntype CanvasImageSource = ImageBitmap | OffscreenCanvas;\\ntype OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;\\ntype MessageEventSource = MessagePort | ServiceWorker;\\ntype ImageBitmapSource = CanvasImageSource | Blob | ImageData;\\ntype OnErrorEventHandler = OnErrorEventHandlerNonNull | null;\\ntype TimerHandler = string | Function;\\ntype PerformanceEntryList = PerformanceEntry[];\\ntype PushMessageDataInit = BufferSource | string;\\ntype ReadableStreamReader<T> = ReadableStreamDefaultReader<T>;\\ntype ReadableStreamController<T> = ReadableStreamDefaultController<T>;\\ntype VibratePattern = number | number[];\\ntype AlgorithmIdentifier = string | Algorithm;\\ntype HashAlgorithmIdentifier = AlgorithmIdentifier;\\ntype BigInteger = Uint8Array;\\ntype NamedCurve = string;\\ntype GLenum = number;\\ntype GLboolean = boolean;\\ntype GLbitfield = number;\\ntype GLint = number;\\ntype GLsizei = number;\\ntype GLintptr = number;\\ntype GLsizeiptr = number;\\ntype GLuint = number;\\ntype GLfloat = number;\\ntype GLclampf = number;\\ntype TexImageSource = ImageBitmap | ImageData | OffscreenCanvas;\\ntype Float32List = Float32Array | GLfloat[];\\ntype Int32List = Int32Array | GLint[];\\ntype GLint64 = number;\\ntype GLuint64 = number;\\ntype Uint32List = Uint32Array | GLuint[];\\ntype BufferSource = ArrayBufferView | ArrayBuffer;\\ntype DOMTimeStamp = number;\\ntype FormDataEntryValue = File | string;\\ntype IDBValidKey = number | string | Date | BufferSource | IDBArrayKey;\\ntype Transferable = ArrayBuffer | MessagePort | ImageBitmap | OffscreenCanvas;\\ntype ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult;\\ntype BinaryType = \\\"arraybuffer\\\" | \\\"blob\\\";\\ntype CanvasDirection = \\\"inherit\\\" | \\\"ltr\\\" | \\\"rtl\\\";\\ntype CanvasFillRule = \\\"evenodd\\\" | \\\"nonzero\\\";\\ntype CanvasLineCap = \\\"butt\\\" | \\\"round\\\" | \\\"square\\\";\\ntype CanvasLineJoin = \\\"bevel\\\" | \\\"miter\\\" | \\\"round\\\";\\ntype CanvasTextAlign = \\\"center\\\" | \\\"end\\\" | \\\"left\\\" | \\\"right\\\" | \\\"start\\\";\\ntype CanvasTextBaseline = \\\"alphabetic\\\" | \\\"bottom\\\" | \\\"hanging\\\" | \\\"ideographic\\\" | \\\"middle\\\" | \\\"top\\\";\\ntype ClientTypes = \\\"all\\\" | \\\"sharedworker\\\" | \\\"window\\\" | \\\"worker\\\";\\ntype ColorSpaceConversion = \\\"default\\\" | \\\"none\\\";\\ntype EndingType = \\\"native\\\" | \\\"transparent\\\";\\ntype FrameType = \\\"auxiliary\\\" | \\\"nested\\\" | \\\"none\\\" | \\\"top-level\\\";\\ntype IDBCursorDirection = \\\"next\\\" | \\\"nextunique\\\" | \\\"prev\\\" | \\\"prevunique\\\";\\ntype IDBRequestReadyState = \\\"done\\\" | \\\"pending\\\";\\ntype IDBTransactionMode = \\\"readonly\\\" | \\\"readwrite\\\" | \\\"versionchange\\\";\\ntype ImageOrientation = \\\"flipY\\\" | \\\"none\\\";\\ntype ImageSmoothingQuality = \\\"high\\\" | \\\"low\\\" | \\\"medium\\\";\\ntype KeyFormat = \\\"jwk\\\" | \\\"pkcs8\\\" | \\\"raw\\\" | \\\"spki\\\";\\ntype KeyType = \\\"private\\\" | \\\"public\\\" | \\\"secret\\\";\\ntype KeyUsage = \\\"decrypt\\\" | \\\"deriveBits\\\" | \\\"deriveKey\\\" | \\\"encrypt\\\" | \\\"sign\\\" | \\\"unwrapKey\\\" | \\\"verify\\\" | \\\"wrapKey\\\";\\ntype NotificationDirection = \\\"auto\\\" | \\\"ltr\\\" | \\\"rtl\\\";\\ntype NotificationPermission = \\\"default\\\" | \\\"denied\\\" | \\\"granted\\\";\\ntype OffscreenRenderingContextId = \\\"2d\\\" | \\\"bitmaprenderer\\\" | \\\"webgl\\\" | \\\"webgl2\\\";\\ntype PermissionName = \\\"accelerometer\\\" | \\\"ambient-light-sensor\\\" | \\\"background-fetch\\\" | \\\"background-sync\\\" | \\\"bluetooth\\\" | \\\"camera\\\" | \\\"clipboard-read\\\" | \\\"clipboard-write\\\" | \\\"device-info\\\" | \\\"display-capture\\\" | \\\"geolocation\\\" | \\\"gyroscope\\\" | \\\"magnetometer\\\" | \\\"microphone\\\" | \\\"midi\\\" | \\\"nfc\\\" | \\\"notifications\\\" | \\\"persistent-storage\\\" | \\\"push\\\" | \\\"speaker\\\";\\ntype PermissionState = \\\"denied\\\" | \\\"granted\\\" | \\\"prompt\\\";\\ntype PremultiplyAlpha = \\\"default\\\" | \\\"none\\\" | \\\"premultiply\\\";\\ntype PushEncryptionKeyName = \\\"auth\\\" | \\\"p256dh\\\";\\ntype PushPermissionState = \\\"denied\\\" | \\\"granted\\\" | \\\"prompt\\\";\\ntype ReferrerPolicy = \\\"\\\" | \\\"no-referrer\\\" | \\\"no-referrer-when-downgrade\\\" | \\\"origin\\\" | \\\"origin-when-cross-origin\\\" | \\\"same-origin\\\" | \\\"strict-origin\\\" | \\\"strict-origin-when-cross-origin\\\" | \\\"unsafe-url\\\";\\ntype RequestCache = \\\"default\\\" | \\\"force-cache\\\" | \\\"no-cache\\\" | \\\"no-store\\\" | \\\"only-if-cached\\\" | \\\"reload\\\";\\ntype RequestCredentials = \\\"include\\\" | \\\"omit\\\" | \\\"same-origin\\\";\\ntype RequestDestination = \\\"\\\" | \\\"audio\\\" | \\\"audioworklet\\\" | \\\"document\\\" | \\\"embed\\\" | \\\"font\\\" | \\\"image\\\" | \\\"manifest\\\" | \\\"object\\\" | \\\"paintworklet\\\" | \\\"report\\\" | \\\"script\\\" | \\\"sharedworker\\\" | \\\"style\\\" | \\\"track\\\" | \\\"video\\\" | \\\"worker\\\" | \\\"xslt\\\";\\ntype RequestMode = \\\"cors\\\" | \\\"navigate\\\" | \\\"no-cors\\\" | \\\"same-origin\\\";\\ntype RequestRedirect = \\\"error\\\" | \\\"follow\\\" | \\\"manual\\\";\\ntype ResizeQuality = \\\"high\\\" | \\\"low\\\" | \\\"medium\\\" | \\\"pixelated\\\";\\ntype ResponseType = \\\"basic\\\" | \\\"cors\\\" | \\\"default\\\" | \\\"error\\\" | \\\"opaque\\\" | \\\"opaqueredirect\\\";\\ntype ServiceWorkerState = \\\"activated\\\" | \\\"activating\\\" | \\\"installed\\\" | \\\"installing\\\" | \\\"parsed\\\" | \\\"redundant\\\";\\ntype ServiceWorkerUpdateViaCache = \\\"all\\\" | \\\"imports\\\" | \\\"none\\\";\\ntype VisibilityState = \\\"hidden\\\" | \\\"visible\\\";\\ntype WebGLPowerPreference = \\\"default\\\" | \\\"high-performance\\\" | \\\"low-power\\\";\\ntype WorkerType = \\\"classic\\\" | \\\"module\\\";\\ntype XMLHttpRequestResponseType = \\\"\\\" | \\\"arraybuffer\\\" | \\\"blob\\\" | \\\"document\\\" | \\\"json\\\" | \\\"text\\\";\\n\";\r\nlibFileMap['lib.webworker.importscripts.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n\\n/////////////////////////////\\n/// WorkerGlobalScope APIs\\n/////////////////////////////\\n// These are only available in a Web Worker\\ndeclare function importScripts(...urls: string[]): void;\\n\";\r\nlibFileMap['lib.webworker.iterable.d.ts'] = \"/*! *****************************************************************************\\nCopyright (c) Microsoft Corporation. All rights reserved.\\nLicensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\nthis file except in compliance with the License. You may obtain a copy of the\\nLicense at http://www.apache.org/licenses/LICENSE-2.0\\n\\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\\nMERCHANTABLITY OR NON-INFRINGEMENT.\\n\\nSee the Apache Version 2.0 License for specific language governing permissions\\nand limitations under the License.\\n***************************************************************************** */\\n\\n\\n\\n/// <reference no-default-lib=\\\"true\\\"/>\\n\\n\\n/////////////////////////////\\n/// Worker Iterable APIs\\n/////////////////////////////\\n\\ninterface Cache {\\n    addAll(requests: Iterable<RequestInfo>): Promise<void>;\\n}\\n\\ninterface CanvasPathDrawingStyles {\\n    setLineDash(segments: Iterable<number>): void;\\n}\\n\\ninterface DOMStringList {\\n    [Symbol.iterator](): IterableIterator<string>;\\n}\\n\\ninterface FileList {\\n    [Symbol.iterator](): IterableIterator<File>;\\n}\\n\\ninterface FormData {\\n    [Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;\\n    /**\\n     * Returns an array of key, value pairs for every entry in the list.\\n     */\\n    entries(): IterableIterator<[string, FormDataEntryValue]>;\\n    /**\\n     * Returns a list of keys in the list.\\n     */\\n    keys(): IterableIterator<string>;\\n    /**\\n     * Returns a list of values in the list.\\n     */\\n    values(): IterableIterator<FormDataEntryValue>;\\n}\\n\\ninterface Headers {\\n    [Symbol.iterator](): IterableIterator<[string, string]>;\\n    /**\\n     * Returns an iterator allowing to go through all key/value pairs contained in this object.\\n     */\\n    entries(): IterableIterator<[string, string]>;\\n    /**\\n     * Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.\\n     */\\n    keys(): IterableIterator<string>;\\n    /**\\n     * Returns an iterator allowing to go through all values of the key/value pairs contained in this object.\\n     */\\n    values(): IterableIterator<string>;\\n}\\n\\ninterface IDBDatabase {\\n    /**\\n     * Returns a new transaction with the given mode (\\\"readonly\\\" or \\\"readwrite\\\") and scope which can be a single object store name or an array of names.\\n     */\\n    transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;\\n}\\n\\ninterface IDBObjectStore {\\n    /**\\n     * Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a \\\"ConstraintError\\\" DOMException.\\n     * \\n     * Throws an \\\"InvalidStateError\\\" DOMException if not called within an upgrade transaction.\\n     */\\n    createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;\\n}\\n\\ninterface URLSearchParams {\\n    [Symbol.iterator](): IterableIterator<[string, string]>;\\n    /**\\n     * Returns an array of key, value pairs for every entry in the search params.\\n     */\\n    entries(): IterableIterator<[string, string]>;\\n    /**\\n     * Returns a list of keys in the search params.\\n     */\\n    keys(): IterableIterator<string>;\\n    /**\\n     * Returns a list of values in the search params.\\n     */\\n    values(): IterableIterator<string>;\\n}\\n\\ninterface WEBGL_draw_buffers {\\n    drawBuffersWEBGL(buffers: Iterable<GLenum>): void;\\n}\\n\\ninterface WebGL2RenderingContextBase {\\n    clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: GLuint): void;\\n    clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: GLuint): void;\\n    clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLuint>, srcOffset?: GLuint): void;\\n    drawBuffers(buffers: Iterable<GLenum>): void;\\n    getActiveUniforms(program: WebGLProgram, uniformIndices: Iterable<GLuint>, pname: GLenum): any;\\n    getUniformIndices(program: WebGLProgram, uniformNames: Iterable<string>): Iterable<GLuint> | null;\\n    invalidateFramebuffer(target: GLenum, attachments: Iterable<GLenum>): void;\\n    invalidateSubFramebuffer(target: GLenum, attachments: Iterable<GLenum>, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;\\n    transformFeedbackVaryings(program: WebGLProgram, varyings: Iterable<string>, bufferMode: GLenum): void;\\n    uniform1uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform2uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform3uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform4uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    vertexAttribI4iv(index: GLuint, values: Iterable<GLint>): void;\\n    vertexAttribI4uiv(index: GLuint, values: Iterable<GLuint>): void;\\n}\\n\\ninterface WebGL2RenderingContextOverloads {\\n    uniform1fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform1iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform2fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform2iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform3fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform3iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform4fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniform4iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n    uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;\\n}\\n\\ninterface WebGLRenderingContextBase {\\n    vertexAttrib1fv(index: GLuint, values: Iterable<GLfloat>): void;\\n    vertexAttrib2fv(index: GLuint, values: Iterable<GLfloat>): void;\\n    vertexAttrib3fv(index: GLuint, values: Iterable<GLfloat>): void;\\n    vertexAttrib4fv(index: GLuint, values: Iterable<GLfloat>): void;\\n}\\n\\ninterface WebGLRenderingContextOverloads {\\n    uniform1fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;\\n    uniform1iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;\\n    uniform2fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;\\n    uniform2iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;\\n    uniform3fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;\\n    uniform3iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;\\n    uniform4fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;\\n    uniform4iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;\\n    uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;\\n    uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;\\n    uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;\\n}\\n\";\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/language/typescript/lib/lib.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/language/typescript/lib/typescriptServices.js":
/*!*****************************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/language/typescript/lib/typescriptServices.js ***!
  \*****************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

eval("var __dirname = \"/\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"createClassifier\": () => (/* binding */ createClassifier),\n/* harmony export */   \"createLanguageService\": () => (/* binding */ createLanguageService),\n/* harmony export */   \"displayPartsToString\": () => (/* binding */ displayPartsToString),\n/* harmony export */   \"EndOfLineState\": () => (/* binding */ EndOfLineState),\n/* harmony export */   \"flattenDiagnosticMessageText\": () => (/* binding */ flattenDiagnosticMessageText),\n/* harmony export */   \"IndentStyle\": () => (/* binding */ IndentStyle),\n/* harmony export */   \"ScriptKind\": () => (/* binding */ ScriptKind),\n/* harmony export */   \"ScriptTarget\": () => (/* binding */ ScriptTarget),\n/* harmony export */   \"TokenClass\": () => (/* binding */ TokenClass)\n/* harmony export */ });\n/* module decorator */ module = __webpack_require__.hmd(module);\n//\n// **NOTE**: Do not edit directly! This file is generated using `npm run import-typescript`\n//\n/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\nvar __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) {\n    for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n        to[j] = from[i];\n    return to;\n};\nvar __assign = (undefined && undefined.__assign) || function () {\n    __assign = Object.assign || function(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))\n                t[p] = s[p];\n        }\n        return t;\n    };\n    return __assign.apply(this, arguments);\n};\nvar __makeTemplateObject = (undefined && undefined.__makeTemplateObject) || function (cooked, raw) {\n    if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n    return cooked;\n};\nvar __generator = (undefined && undefined.__generator) || function (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 (_) 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};\nvar __rest = (undefined && undefined.__rest) || function (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};\nvar __extends = (undefined && undefined.__extends) || (function () {\n    var 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    return function (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})();\n/* @internal */\nvar ts;\n(function (ts) {\n    function createMapData() {\n        var sentinel = {};\n        sentinel.prev = sentinel;\n        return { head: sentinel, tail: sentinel, size: 0 };\n    }\n    function createMapEntry(key, value) {\n        return { key: key, value: value, next: undefined, prev: undefined };\n    }\n    function sameValueZero(x, y) {\n        // Treats -0 === 0 and NaN === NaN\n        return x === y || x !== x && y !== y;\n    }\n    function getPrev(entry) {\n        var prev = entry.prev;\n        // Entries without a 'prev' have been removed from the map.\n        // An entry whose 'prev' points to itself is the head of the list and is invalid here.\n        if (!prev || prev === entry)\n            throw new Error(\"Illegal state\");\n        return prev;\n    }\n    function getNext(entry) {\n        while (entry) {\n            // Entries without a 'prev' have been removed from the map. Their 'next'\n            // pointer should point to the previous entry prior to deletion and\n            // that entry should be skipped to resume iteration.\n            var skipNext = !entry.prev;\n            entry = entry.next;\n            if (skipNext) {\n                continue;\n            }\n            return entry;\n        }\n    }\n    function getEntry(data, key) {\n        // We walk backwards from 'tail' to prioritize recently added entries.\n        // We skip 'head' because it is an empty entry used to track iteration start.\n        for (var entry = data.tail; entry !== data.head; entry = getPrev(entry)) {\n            if (sameValueZero(entry.key, key)) {\n                return entry;\n            }\n        }\n    }\n    function addOrUpdateEntry(data, key, value) {\n        var existing = getEntry(data, key);\n        if (existing) {\n            existing.value = value;\n            return;\n        }\n        var entry = createMapEntry(key, value);\n        entry.prev = data.tail;\n        data.tail.next = entry;\n        data.tail = entry;\n        data.size++;\n        return entry;\n    }\n    function deleteEntry(data, key) {\n        // We walk backwards from 'tail' to prioritize recently added entries.\n        // We skip 'head' because it is an empty entry used to track iteration start.\n        for (var entry = data.tail; entry !== data.head; entry = getPrev(entry)) {\n            // all entries in the map should have a 'prev' pointer.\n            if (entry.prev === undefined)\n                throw new Error(\"Illegal state\");\n            if (sameValueZero(entry.key, key)) {\n                if (entry.next) {\n                    entry.next.prev = entry.prev;\n                }\n                else {\n                    // an entry in the map without a 'next' pointer must be the 'tail'.\n                    if (data.tail !== entry)\n                        throw new Error(\"Illegal state\");\n                    data.tail = entry.prev;\n                }\n                entry.prev.next = entry.next;\n                entry.next = entry.prev;\n                entry.prev = undefined;\n                data.size--;\n                return entry;\n            }\n        }\n    }\n    function clearEntries(data) {\n        var node = data.tail;\n        while (node !== data.head) {\n            var prev = getPrev(node);\n            node.next = data.head;\n            node.prev = undefined;\n            node = prev;\n        }\n        data.head.next = undefined;\n        data.tail = data.head;\n        data.size = 0;\n    }\n    function forEachEntry(data, action) {\n        var entry = data.head;\n        while (entry) {\n            entry = getNext(entry);\n            if (entry) {\n                action(entry.value, entry.key);\n            }\n        }\n    }\n    function forEachIteration(iterator, action) {\n        if (iterator) {\n            for (var step = iterator.next(); !step.done; step = iterator.next()) {\n                action(step.value);\n            }\n        }\n    }\n    function createIteratorData(data, selector) {\n        return { current: data.head, selector: selector };\n    }\n    function iteratorNext(data) {\n        // Navigate to the next entry.\n        data.current = getNext(data.current);\n        if (data.current) {\n            return { value: data.selector(data.current.key, data.current.value), done: false };\n        }\n        else {\n            return { value: undefined, done: true };\n        }\n    }\n    /* @internal */\n    var ShimCollections;\n    (function (ShimCollections) {\n        function createMapShim(getIterator) {\n            var MapIterator = /** @class */ (function () {\n                function MapIterator(data, selector) {\n                    this._data = createIteratorData(data, selector);\n                }\n                MapIterator.prototype.next = function () { return iteratorNext(this._data); };\n                return MapIterator;\n            }());\n            return /** @class */ (function () {\n                function Map(iterable) {\n                    var _this = this;\n                    this._mapData = createMapData();\n                    forEachIteration(getIterator(iterable), function (_a) {\n                        var key = _a[0], value = _a[1];\n                        return _this.set(key, value);\n                    });\n                }\n                Object.defineProperty(Map.prototype, \"size\", {\n                    get: function () { return this._mapData.size; },\n                    enumerable: false,\n                    configurable: true\n                });\n                Map.prototype.get = function (key) { var _a; return (_a = getEntry(this._mapData, key)) === null || _a === void 0 ? void 0 : _a.value; };\n                Map.prototype.set = function (key, value) { return addOrUpdateEntry(this._mapData, key, value), this; };\n                Map.prototype.has = function (key) { return !!getEntry(this._mapData, key); };\n                Map.prototype.delete = function (key) { return !!deleteEntry(this._mapData, key); };\n                Map.prototype.clear = function () { clearEntries(this._mapData); };\n                Map.prototype.keys = function () { return new MapIterator(this._mapData, function (key, _value) { return key; }); };\n                Map.prototype.values = function () { return new MapIterator(this._mapData, function (_key, value) { return value; }); };\n                Map.prototype.entries = function () { return new MapIterator(this._mapData, function (key, value) { return [key, value]; }); };\n                Map.prototype.forEach = function (action) { forEachEntry(this._mapData, action); };\n                return Map;\n            }());\n        }\n        ShimCollections.createMapShim = createMapShim;\n        function createSetShim(getIterator) {\n            var SetIterator = /** @class */ (function () {\n                function SetIterator(data, selector) {\n                    this._data = createIteratorData(data, selector);\n                }\n                SetIterator.prototype.next = function () { return iteratorNext(this._data); };\n                return SetIterator;\n            }());\n            return /** @class */ (function () {\n                function Set(iterable) {\n                    var _this = this;\n                    this._mapData = createMapData();\n                    forEachIteration(getIterator(iterable), function (value) { return _this.add(value); });\n                }\n                Object.defineProperty(Set.prototype, \"size\", {\n                    get: function () { return this._mapData.size; },\n                    enumerable: false,\n                    configurable: true\n                });\n                Set.prototype.add = function (value) { return addOrUpdateEntry(this._mapData, value, value), this; };\n                Set.prototype.has = function (value) { return !!getEntry(this._mapData, value); };\n                Set.prototype.delete = function (value) { return !!deleteEntry(this._mapData, value); };\n                Set.prototype.clear = function () { clearEntries(this._mapData); };\n                Set.prototype.keys = function () { return new SetIterator(this._mapData, function (key, _value) { return key; }); };\n                Set.prototype.values = function () { return new SetIterator(this._mapData, function (_key, value) { return value; }); };\n                Set.prototype.entries = function () { return new SetIterator(this._mapData, function (key, value) { return [key, value]; }); };\n                Set.prototype.forEach = function (action) { forEachEntry(this._mapData, action); };\n                return Set;\n            }());\n        }\n        ShimCollections.createSetShim = createSetShim;\n    })(ShimCollections = ts.ShimCollections || (ts.ShimCollections = {}));\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    // WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values.\n    // If changing the text in this section, be sure to test `configurePrerelease` too.\n    ts.versionMajorMinor = \"4.2\";\n    // The following is baselined as a literal template type without intervention\n    /** The version of the TypeScript compiler release */\n    // eslint-disable-next-line @typescript-eslint/no-inferrable-types\n    ts.version = \"4.2.3\";\n    /* @internal */\n    var Comparison;\n    (function (Comparison) {\n        Comparison[Comparison[\"LessThan\"] = -1] = \"LessThan\";\n        Comparison[Comparison[\"EqualTo\"] = 0] = \"EqualTo\";\n        Comparison[Comparison[\"GreaterThan\"] = 1] = \"GreaterThan\";\n    })(Comparison = ts.Comparison || (ts.Comparison = {}));\n    /* @internal */\n    var NativeCollections;\n    (function (NativeCollections) {\n        /**\n         * Returns the native Map implementation if it is available and compatible (i.e. supports iteration).\n         */\n        function tryGetNativeMap() {\n            // Internet Explorer's Map doesn't support iteration, so don't use it.\n            // eslint-disable-next-line no-in-operator\n            return typeof Map !== \"undefined\" && \"entries\" in Map.prototype && new Map([[0, 0]]).size === 1 ? Map : undefined;\n        }\n        NativeCollections.tryGetNativeMap = tryGetNativeMap;\n        /**\n         * Returns the native Set implementation if it is available and compatible (i.e. supports iteration).\n         */\n        function tryGetNativeSet() {\n            // Internet Explorer's Set doesn't support iteration, so don't use it.\n            // eslint-disable-next-line no-in-operator\n            return typeof Set !== \"undefined\" && \"entries\" in Set.prototype && new Set([0]).size === 1 ? Set : undefined;\n        }\n        NativeCollections.tryGetNativeSet = tryGetNativeSet;\n    })(NativeCollections = ts.NativeCollections || (ts.NativeCollections = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    function getCollectionImplementation(name, nativeFactory, shimFactory) {\n        var _a;\n        // NOTE: ts.ShimCollections will be defined for typescriptServices.js but not for tsc.js, so we must test for it.\n        var constructor = (_a = ts.NativeCollections[nativeFactory]()) !== null && _a !== void 0 ? _a : ts.ShimCollections === null || ts.ShimCollections === void 0 ? void 0 : ts.ShimCollections[shimFactory](getIterator);\n        if (constructor)\n            return constructor;\n        throw new Error(\"TypeScript requires an environment that provides a compatible native \" + name + \" implementation.\");\n    }\n    ts.Map = getCollectionImplementation(\"Map\", \"tryGetNativeMap\", \"createMapShim\");\n    ts.Set = getCollectionImplementation(\"Set\", \"tryGetNativeSet\", \"createSetShim\");\n    function getIterator(iterable) {\n        if (iterable) {\n            if (isArray(iterable))\n                return arrayIterator(iterable);\n            if (iterable instanceof ts.Map)\n                return iterable.entries();\n            if (iterable instanceof ts.Set)\n                return iterable.values();\n            throw new Error(\"Iteration not supported.\");\n        }\n    }\n    ts.getIterator = getIterator;\n    ts.emptyArray = [];\n    ts.emptyMap = new ts.Map();\n    ts.emptySet = new ts.Set();\n    function createMap() {\n        return new ts.Map();\n    }\n    ts.createMap = createMap;\n    /**\n     * Create a new map from a template object is provided, the map will copy entries from it.\n     * @deprecated Use `new Map(getEntries(template))` instead.\n     */\n    function createMapFromTemplate(template) {\n        var map = new ts.Map();\n        // Copies keys/values from template. Note that for..in will not throw if\n        // template is undefined, and instead will just exit the loop.\n        for (var key in template) {\n            if (hasOwnProperty.call(template, key)) {\n                map.set(key, template[key]);\n            }\n        }\n        return map;\n    }\n    ts.createMapFromTemplate = createMapFromTemplate;\n    function length(array) {\n        return array ? array.length : 0;\n    }\n    ts.length = length;\n    /**\n     * Iterates through 'array' by index and performs the callback on each element of array until the callback\n     * returns a truthy value, then returns that value.\n     * If no such value is found, the callback is applied to each element of array and undefined is returned.\n     */\n    function forEach(array, callback) {\n        if (array) {\n            for (var i = 0; i < array.length; i++) {\n                var result = callback(array[i], i);\n                if (result) {\n                    return result;\n                }\n            }\n        }\n        return undefined;\n    }\n    ts.forEach = forEach;\n    /**\n     * Like `forEach`, but iterates in reverse order.\n     */\n    function forEachRight(array, callback) {\n        if (array) {\n            for (var i = array.length - 1; i >= 0; i--) {\n                var result = callback(array[i], i);\n                if (result) {\n                    return result;\n                }\n            }\n        }\n        return undefined;\n    }\n    ts.forEachRight = forEachRight;\n    /** Like `forEach`, but suitable for use with numbers and strings (which may be falsy). */\n    function firstDefined(array, callback) {\n        if (array === undefined) {\n            return undefined;\n        }\n        for (var i = 0; i < array.length; i++) {\n            var result = callback(array[i], i);\n            if (result !== undefined) {\n                return result;\n            }\n        }\n        return undefined;\n    }\n    ts.firstDefined = firstDefined;\n    function firstDefinedIterator(iter, callback) {\n        while (true) {\n            var iterResult = iter.next();\n            if (iterResult.done) {\n                return undefined;\n            }\n            var result = callback(iterResult.value);\n            if (result !== undefined) {\n                return result;\n            }\n        }\n    }\n    ts.firstDefinedIterator = firstDefinedIterator;\n    function reduceLeftIterator(iterator, f, initial) {\n        var result = initial;\n        if (iterator) {\n            for (var step = iterator.next(), pos = 0; !step.done; step = iterator.next(), pos++) {\n                result = f(result, step.value, pos);\n            }\n        }\n        return result;\n    }\n    ts.reduceLeftIterator = reduceLeftIterator;\n    function zipWith(arrayA, arrayB, callback) {\n        var result = [];\n        ts.Debug.assertEqual(arrayA.length, arrayB.length);\n        for (var i = 0; i < arrayA.length; i++) {\n            result.push(callback(arrayA[i], arrayB[i], i));\n        }\n        return result;\n    }\n    ts.zipWith = zipWith;\n    function zipToIterator(arrayA, arrayB) {\n        ts.Debug.assertEqual(arrayA.length, arrayB.length);\n        var i = 0;\n        return {\n            next: function () {\n                if (i === arrayA.length) {\n                    return { value: undefined, done: true };\n                }\n                i++;\n                return { value: [arrayA[i - 1], arrayB[i - 1]], done: false };\n            }\n        };\n    }\n    ts.zipToIterator = zipToIterator;\n    function zipToMap(keys, values) {\n        ts.Debug.assert(keys.length === values.length);\n        var map = new ts.Map();\n        for (var i = 0; i < keys.length; ++i) {\n            map.set(keys[i], values[i]);\n        }\n        return map;\n    }\n    ts.zipToMap = zipToMap;\n    /**\n     * Creates a new array with `element` interspersed in between each element of `input`\n     * if there is more than 1 value in `input`. Otherwise, returns the existing array.\n     */\n    function intersperse(input, element) {\n        if (input.length <= 1) {\n            return input;\n        }\n        var result = [];\n        for (var i = 0, n = input.length; i < n; i++) {\n            if (i)\n                result.push(element);\n            result.push(input[i]);\n        }\n        return result;\n    }\n    ts.intersperse = intersperse;\n    /**\n     * Iterates through `array` by index and performs the callback on each element of array until the callback\n     * returns a falsey value, then returns false.\n     * If no such value is found, the callback is applied to each element of array and `true` is returned.\n     */\n    function every(array, callback) {\n        if (array) {\n            for (var i = 0; i < array.length; i++) {\n                if (!callback(array[i], i)) {\n                    return false;\n                }\n            }\n        }\n        return true;\n    }\n    ts.every = every;\n    function find(array, predicate) {\n        for (var i = 0; i < array.length; i++) {\n            var value = array[i];\n            if (predicate(value, i)) {\n                return value;\n            }\n        }\n        return undefined;\n    }\n    ts.find = find;\n    function findLast(array, predicate) {\n        for (var i = array.length - 1; i >= 0; i--) {\n            var value = array[i];\n            if (predicate(value, i)) {\n                return value;\n            }\n        }\n        return undefined;\n    }\n    ts.findLast = findLast;\n    /** Works like Array.prototype.findIndex, returning `-1` if no element satisfying the predicate is found. */\n    function findIndex(array, predicate, startIndex) {\n        for (var i = startIndex || 0; i < array.length; i++) {\n            if (predicate(array[i], i)) {\n                return i;\n            }\n        }\n        return -1;\n    }\n    ts.findIndex = findIndex;\n    function findLastIndex(array, predicate, startIndex) {\n        for (var i = startIndex === undefined ? array.length - 1 : startIndex; i >= 0; i--) {\n            if (predicate(array[i], i)) {\n                return i;\n            }\n        }\n        return -1;\n    }\n    ts.findLastIndex = findLastIndex;\n    /**\n     * Returns the first truthy result of `callback`, or else fails.\n     * This is like `forEach`, but never returns undefined.\n     */\n    function findMap(array, callback) {\n        for (var i = 0; i < array.length; i++) {\n            var result = callback(array[i], i);\n            if (result) {\n                return result;\n            }\n        }\n        return ts.Debug.fail();\n    }\n    ts.findMap = findMap;\n    function contains(array, value, equalityComparer) {\n        if (equalityComparer === void 0) { equalityComparer = equateValues; }\n        if (array) {\n            for (var _i = 0, array_1 = array; _i < array_1.length; _i++) {\n                var v = array_1[_i];\n                if (equalityComparer(v, value)) {\n                    return true;\n                }\n            }\n        }\n        return false;\n    }\n    ts.contains = contains;\n    function arraysEqual(a, b, equalityComparer) {\n        if (equalityComparer === void 0) { equalityComparer = equateValues; }\n        return a.length === b.length && a.every(function (x, i) { return equalityComparer(x, b[i]); });\n    }\n    ts.arraysEqual = arraysEqual;\n    function indexOfAnyCharCode(text, charCodes, start) {\n        for (var i = start || 0; i < text.length; i++) {\n            if (contains(charCodes, text.charCodeAt(i))) {\n                return i;\n            }\n        }\n        return -1;\n    }\n    ts.indexOfAnyCharCode = indexOfAnyCharCode;\n    function countWhere(array, predicate) {\n        var count = 0;\n        if (array) {\n            for (var i = 0; i < array.length; i++) {\n                var v = array[i];\n                if (predicate(v, i)) {\n                    count++;\n                }\n            }\n        }\n        return count;\n    }\n    ts.countWhere = countWhere;\n    function filter(array, f) {\n        if (array) {\n            var len = array.length;\n            var i = 0;\n            while (i < len && f(array[i]))\n                i++;\n            if (i < len) {\n                var result = array.slice(0, i);\n                i++;\n                while (i < len) {\n                    var item = array[i];\n                    if (f(item)) {\n                        result.push(item);\n                    }\n                    i++;\n                }\n                return result;\n            }\n        }\n        return array;\n    }\n    ts.filter = filter;\n    function filterMutate(array, f) {\n        var outIndex = 0;\n        for (var i = 0; i < array.length; i++) {\n            if (f(array[i], i, array)) {\n                array[outIndex] = array[i];\n                outIndex++;\n            }\n        }\n        array.length = outIndex;\n    }\n    ts.filterMutate = filterMutate;\n    function clear(array) {\n        array.length = 0;\n    }\n    ts.clear = clear;\n    function map(array, f) {\n        var result;\n        if (array) {\n            result = [];\n            for (var i = 0; i < array.length; i++) {\n                result.push(f(array[i], i));\n            }\n        }\n        return result;\n    }\n    ts.map = map;\n    function mapIterator(iter, mapFn) {\n        return {\n            next: function () {\n                var iterRes = iter.next();\n                return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false };\n            }\n        };\n    }\n    ts.mapIterator = mapIterator;\n    function sameMap(array, f) {\n        if (array) {\n            for (var i = 0; i < array.length; i++) {\n                var item = array[i];\n                var mapped = f(item, i);\n                if (item !== mapped) {\n                    var result = array.slice(0, i);\n                    result.push(mapped);\n                    for (i++; i < array.length; i++) {\n                        result.push(f(array[i], i));\n                    }\n                    return result;\n                }\n            }\n        }\n        return array;\n    }\n    ts.sameMap = sameMap;\n    /**\n     * Flattens an array containing a mix of array or non-array elements.\n     *\n     * @param array The array to flatten.\n     */\n    function flatten(array) {\n        var result = [];\n        for (var _i = 0, array_2 = array; _i < array_2.length; _i++) {\n            var v = array_2[_i];\n            if (v) {\n                if (isArray(v)) {\n                    addRange(result, v);\n                }\n                else {\n                    result.push(v);\n                }\n            }\n        }\n        return result;\n    }\n    ts.flatten = flatten;\n    /**\n     * Maps an array. If the mapped value is an array, it is spread into the result.\n     *\n     * @param array The array to map.\n     * @param mapfn The callback used to map the result into one or more values.\n     */\n    function flatMap(array, mapfn) {\n        var result;\n        if (array) {\n            for (var i = 0; i < array.length; i++) {\n                var v = mapfn(array[i], i);\n                if (v) {\n                    if (isArray(v)) {\n                        result = addRange(result, v);\n                    }\n                    else {\n                        result = append(result, v);\n                    }\n                }\n            }\n        }\n        return result || ts.emptyArray;\n    }\n    ts.flatMap = flatMap;\n    function flatMapToMutable(array, mapfn) {\n        var result = [];\n        if (array) {\n            for (var i = 0; i < array.length; i++) {\n                var v = mapfn(array[i], i);\n                if (v) {\n                    if (isArray(v)) {\n                        addRange(result, v);\n                    }\n                    else {\n                        result.push(v);\n                    }\n                }\n            }\n        }\n        return result;\n    }\n    ts.flatMapToMutable = flatMapToMutable;\n    function flatMapIterator(iter, mapfn) {\n        var first = iter.next();\n        if (first.done) {\n            return ts.emptyIterator;\n        }\n        var currentIter = getIterator(first.value);\n        return {\n            next: function () {\n                while (true) {\n                    var currentRes = currentIter.next();\n                    if (!currentRes.done) {\n                        return currentRes;\n                    }\n                    var iterRes = iter.next();\n                    if (iterRes.done) {\n                        return iterRes;\n                    }\n                    currentIter = getIterator(iterRes.value);\n                }\n            },\n        };\n        function getIterator(x) {\n            var res = mapfn(x);\n            return res === undefined ? ts.emptyIterator : isArray(res) ? arrayIterator(res) : res;\n        }\n    }\n    ts.flatMapIterator = flatMapIterator;\n    function sameFlatMap(array, mapfn) {\n        var result;\n        if (array) {\n            for (var i = 0; i < array.length; i++) {\n                var item = array[i];\n                var mapped = mapfn(item, i);\n                if (result || item !== mapped || isArray(mapped)) {\n                    if (!result) {\n                        result = array.slice(0, i);\n                    }\n                    if (isArray(mapped)) {\n                        addRange(result, mapped);\n                    }\n                    else {\n                        result.push(mapped);\n                    }\n                }\n            }\n        }\n        return result || array;\n    }\n    ts.sameFlatMap = sameFlatMap;\n    function mapAllOrFail(array, mapFn) {\n        var result = [];\n        for (var i = 0; i < array.length; i++) {\n            var mapped = mapFn(array[i], i);\n            if (mapped === undefined) {\n                return undefined;\n            }\n            result.push(mapped);\n        }\n        return result;\n    }\n    ts.mapAllOrFail = mapAllOrFail;\n    function mapDefined(array, mapFn) {\n        var result = [];\n        if (array) {\n            for (var i = 0; i < array.length; i++) {\n                var mapped = mapFn(array[i], i);\n                if (mapped !== undefined) {\n                    result.push(mapped);\n                }\n            }\n        }\n        return result;\n    }\n    ts.mapDefined = mapDefined;\n    function mapDefinedIterator(iter, mapFn) {\n        return {\n            next: function () {\n                while (true) {\n                    var res = iter.next();\n                    if (res.done) {\n                        return res;\n                    }\n                    var value = mapFn(res.value);\n                    if (value !== undefined) {\n                        return { value: value, done: false };\n                    }\n                }\n            }\n        };\n    }\n    ts.mapDefinedIterator = mapDefinedIterator;\n    function mapDefinedEntries(map, f) {\n        if (!map) {\n            return undefined;\n        }\n        var result = new ts.Map();\n        map.forEach(function (value, key) {\n            var entry = f(key, value);\n            if (entry !== undefined) {\n                var newKey = entry[0], newValue = entry[1];\n                if (newKey !== undefined && newValue !== undefined) {\n                    result.set(newKey, newValue);\n                }\n            }\n        });\n        return result;\n    }\n    ts.mapDefinedEntries = mapDefinedEntries;\n    function mapDefinedValues(set, f) {\n        if (set) {\n            var result_1 = new ts.Set();\n            set.forEach(function (value) {\n                var newValue = f(value);\n                if (newValue !== undefined) {\n                    result_1.add(newValue);\n                }\n            });\n            return result_1;\n        }\n    }\n    ts.mapDefinedValues = mapDefinedValues;\n    function getOrUpdate(map, key, callback) {\n        if (map.has(key)) {\n            return map.get(key);\n        }\n        var value = callback();\n        map.set(key, value);\n        return value;\n    }\n    ts.getOrUpdate = getOrUpdate;\n    function tryAddToSet(set, value) {\n        if (!set.has(value)) {\n            set.add(value);\n            return true;\n        }\n        return false;\n    }\n    ts.tryAddToSet = tryAddToSet;\n    ts.emptyIterator = { next: function () { return ({ value: undefined, done: true }); } };\n    function singleIterator(value) {\n        var done = false;\n        return {\n            next: function () {\n                var wasDone = done;\n                done = true;\n                return wasDone ? { value: undefined, done: true } : { value: value, done: false };\n            }\n        };\n    }\n    ts.singleIterator = singleIterator;\n    function spanMap(array, keyfn, mapfn) {\n        var result;\n        if (array) {\n            result = [];\n            var len = array.length;\n            var previousKey = void 0;\n            var key = void 0;\n            var start = 0;\n            var pos = 0;\n            while (start < len) {\n                while (pos < len) {\n                    var value = array[pos];\n                    key = keyfn(value, pos);\n                    if (pos === 0) {\n                        previousKey = key;\n                    }\n                    else if (key !== previousKey) {\n                        break;\n                    }\n                    pos++;\n                }\n                if (start < pos) {\n                    var v = mapfn(array.slice(start, pos), previousKey, start, pos);\n                    if (v) {\n                        result.push(v);\n                    }\n                    start = pos;\n                }\n                previousKey = key;\n                pos++;\n            }\n        }\n        return result;\n    }\n    ts.spanMap = spanMap;\n    function mapEntries(map, f) {\n        if (!map) {\n            return undefined;\n        }\n        var result = new ts.Map();\n        map.forEach(function (value, key) {\n            var _a = f(key, value), newKey = _a[0], newValue = _a[1];\n            result.set(newKey, newValue);\n        });\n        return result;\n    }\n    ts.mapEntries = mapEntries;\n    function some(array, predicate) {\n        if (array) {\n            if (predicate) {\n                for (var _i = 0, array_3 = array; _i < array_3.length; _i++) {\n                    var v = array_3[_i];\n                    if (predicate(v)) {\n                        return true;\n                    }\n                }\n            }\n            else {\n                return array.length > 0;\n            }\n        }\n        return false;\n    }\n    ts.some = some;\n    /** Calls the callback with (start, afterEnd) index pairs for each range where 'pred' is true. */\n    function getRangesWhere(arr, pred, cb) {\n        var start;\n        for (var i = 0; i < arr.length; i++) {\n            if (pred(arr[i])) {\n                start = start === undefined ? i : start;\n            }\n            else {\n                if (start !== undefined) {\n                    cb(start, i);\n                    start = undefined;\n                }\n            }\n        }\n        if (start !== undefined)\n            cb(start, arr.length);\n    }\n    ts.getRangesWhere = getRangesWhere;\n    function concatenate(array1, array2) {\n        if (!some(array2))\n            return array1;\n        if (!some(array1))\n            return array2;\n        return __spreadArray(__spreadArray([], array1), array2);\n    }\n    ts.concatenate = concatenate;\n    function selectIndex(_, i) {\n        return i;\n    }\n    function indicesOf(array) {\n        return array.map(selectIndex);\n    }\n    ts.indicesOf = indicesOf;\n    function deduplicateRelational(array, equalityComparer, comparer) {\n        // Perform a stable sort of the array. This ensures the first entry in a list of\n        // duplicates remains the first entry in the result.\n        var indices = indicesOf(array);\n        stableSortIndices(array, indices, comparer);\n        var last = array[indices[0]];\n        var deduplicated = [indices[0]];\n        for (var i = 1; i < indices.length; i++) {\n            var index = indices[i];\n            var item = array[index];\n            if (!equalityComparer(last, item)) {\n                deduplicated.push(index);\n                last = item;\n            }\n        }\n        // restore original order\n        deduplicated.sort();\n        return deduplicated.map(function (i) { return array[i]; });\n    }\n    function deduplicateEquality(array, equalityComparer) {\n        var result = [];\n        for (var _i = 0, array_4 = array; _i < array_4.length; _i++) {\n            var item = array_4[_i];\n            pushIfUnique(result, item, equalityComparer);\n        }\n        return result;\n    }\n    /**\n     * Deduplicates an unsorted array.\n     * @param equalityComparer An `EqualityComparer` used to determine if two values are duplicates.\n     * @param comparer An optional `Comparer` used to sort entries before comparison, though the\n     * result will remain in the original order in `array`.\n     */\n    function deduplicate(array, equalityComparer, comparer) {\n        return array.length === 0 ? [] :\n            array.length === 1 ? array.slice() :\n                comparer ? deduplicateRelational(array, equalityComparer, comparer) :\n                    deduplicateEquality(array, equalityComparer);\n    }\n    ts.deduplicate = deduplicate;\n    /**\n     * Deduplicates an array that has already been sorted.\n     */\n    function deduplicateSorted(array, comparer) {\n        if (array.length === 0)\n            return ts.emptyArray;\n        var last = array[0];\n        var deduplicated = [last];\n        for (var i = 1; i < array.length; i++) {\n            var next = array[i];\n            switch (comparer(next, last)) {\n                // equality comparison\n                case true:\n                // relational comparison\n                // falls through\n                case 0 /* EqualTo */:\n                    continue;\n                case -1 /* LessThan */:\n                    // If `array` is sorted, `next` should **never** be less than `last`.\n                    return ts.Debug.fail(\"Array is unsorted.\");\n            }\n            deduplicated.push(last = next);\n        }\n        return deduplicated;\n    }\n    function insertSorted(array, insert, compare) {\n        if (array.length === 0) {\n            array.push(insert);\n            return;\n        }\n        var insertIndex = binarySearch(array, insert, identity, compare);\n        if (insertIndex < 0) {\n            array.splice(~insertIndex, 0, insert);\n        }\n    }\n    ts.insertSorted = insertSorted;\n    function sortAndDeduplicate(array, comparer, equalityComparer) {\n        return deduplicateSorted(sort(array, comparer), equalityComparer || comparer || compareStringsCaseSensitive);\n    }\n    ts.sortAndDeduplicate = sortAndDeduplicate;\n    function arrayIsSorted(array, comparer) {\n        if (array.length < 2)\n            return true;\n        var prevElement = array[0];\n        for (var _i = 0, _a = array.slice(1); _i < _a.length; _i++) {\n            var element = _a[_i];\n            if (comparer(prevElement, element) === 1 /* GreaterThan */) {\n                return false;\n            }\n            prevElement = element;\n        }\n        return true;\n    }\n    ts.arrayIsSorted = arrayIsSorted;\n    function arrayIsEqualTo(array1, array2, equalityComparer) {\n        if (equalityComparer === void 0) { equalityComparer = equateValues; }\n        if (!array1 || !array2) {\n            return array1 === array2;\n        }\n        if (array1.length !== array2.length) {\n            return false;\n        }\n        for (var i = 0; i < array1.length; i++) {\n            if (!equalityComparer(array1[i], array2[i], i)) {\n                return false;\n            }\n        }\n        return true;\n    }\n    ts.arrayIsEqualTo = arrayIsEqualTo;\n    function compact(array) {\n        var result;\n        if (array) {\n            for (var i = 0; i < array.length; i++) {\n                var v = array[i];\n                if (result || !v) {\n                    if (!result) {\n                        result = array.slice(0, i);\n                    }\n                    if (v) {\n                        result.push(v);\n                    }\n                }\n            }\n        }\n        return result || array;\n    }\n    ts.compact = compact;\n    /**\n     * Gets the relative complement of `arrayA` with respect to `arrayB`, returning the elements that\n     * are not present in `arrayA` but are present in `arrayB`. Assumes both arrays are sorted\n     * based on the provided comparer.\n     */\n    function relativeComplement(arrayA, arrayB, comparer) {\n        if (!arrayB || !arrayA || arrayB.length === 0 || arrayA.length === 0)\n            return arrayB;\n        var result = [];\n        loopB: for (var offsetA = 0, offsetB = 0; offsetB < arrayB.length; offsetB++) {\n            if (offsetB > 0) {\n                // Ensure `arrayB` is properly sorted.\n                ts.Debug.assertGreaterThanOrEqual(comparer(arrayB[offsetB], arrayB[offsetB - 1]), 0 /* EqualTo */);\n            }\n            loopA: for (var startA = offsetA; offsetA < arrayA.length; offsetA++) {\n                if (offsetA > startA) {\n                    // Ensure `arrayA` is properly sorted. We only need to perform this check if\n                    // `offsetA` has changed since we entered the loop.\n                    ts.Debug.assertGreaterThanOrEqual(comparer(arrayA[offsetA], arrayA[offsetA - 1]), 0 /* EqualTo */);\n                }\n                switch (comparer(arrayB[offsetB], arrayA[offsetA])) {\n                    case -1 /* LessThan */:\n                        // If B is less than A, B does not exist in arrayA. Add B to the result and\n                        // move to the next element in arrayB without changing the current position\n                        // in arrayA.\n                        result.push(arrayB[offsetB]);\n                        continue loopB;\n                    case 0 /* EqualTo */:\n                        // If B is equal to A, B exists in arrayA. Move to the next element in\n                        // arrayB without adding B to the result or changing the current position\n                        // in arrayA.\n                        continue loopB;\n                    case 1 /* GreaterThan */:\n                        // If B is greater than A, we need to keep looking for B in arrayA. Move to\n                        // the next element in arrayA and recheck.\n                        continue loopA;\n                }\n            }\n        }\n        return result;\n    }\n    ts.relativeComplement = relativeComplement;\n    function sum(array, prop) {\n        var result = 0;\n        for (var _i = 0, array_5 = array; _i < array_5.length; _i++) {\n            var v = array_5[_i];\n            result += v[prop];\n        }\n        return result;\n    }\n    ts.sum = sum;\n    function append(to, value) {\n        if (value === undefined)\n            return to;\n        if (to === undefined)\n            return [value];\n        to.push(value);\n        return to;\n    }\n    ts.append = append;\n    function combine(xs, ys) {\n        if (xs === undefined)\n            return ys;\n        if (ys === undefined)\n            return xs;\n        if (isArray(xs))\n            return isArray(ys) ? concatenate(xs, ys) : append(xs, ys);\n        if (isArray(ys))\n            return append(ys, xs);\n        return [xs, ys];\n    }\n    ts.combine = combine;\n    /**\n     * Gets the actual offset into an array for a relative offset. Negative offsets indicate a\n     * position offset from the end of the array.\n     */\n    function toOffset(array, offset) {\n        return offset < 0 ? array.length + offset : offset;\n    }\n    function addRange(to, from, start, end) {\n        if (from === undefined || from.length === 0)\n            return to;\n        if (to === undefined)\n            return from.slice(start, end);\n        start = start === undefined ? 0 : toOffset(from, start);\n        end = end === undefined ? from.length : toOffset(from, end);\n        for (var i = start; i < end && i < from.length; i++) {\n            if (from[i] !== undefined) {\n                to.push(from[i]);\n            }\n        }\n        return to;\n    }\n    ts.addRange = addRange;\n    /**\n     * @return Whether the value was added.\n     */\n    function pushIfUnique(array, toAdd, equalityComparer) {\n        if (contains(array, toAdd, equalityComparer)) {\n            return false;\n        }\n        else {\n            array.push(toAdd);\n            return true;\n        }\n    }\n    ts.pushIfUnique = pushIfUnique;\n    /**\n     * Unlike `pushIfUnique`, this can take `undefined` as an input, and returns a new array.\n     */\n    function appendIfUnique(array, toAdd, equalityComparer) {\n        if (array) {\n            pushIfUnique(array, toAdd, equalityComparer);\n            return array;\n        }\n        else {\n            return [toAdd];\n        }\n    }\n    ts.appendIfUnique = appendIfUnique;\n    function stableSortIndices(array, indices, comparer) {\n        // sort indices by value then position\n        indices.sort(function (x, y) { return comparer(array[x], array[y]) || compareValues(x, y); });\n    }\n    /**\n     * Returns a new sorted array.\n     */\n    function sort(array, comparer) {\n        return (array.length === 0 ? array : array.slice().sort(comparer));\n    }\n    ts.sort = sort;\n    function arrayIterator(array) {\n        var i = 0;\n        return { next: function () {\n                if (i === array.length) {\n                    return { value: undefined, done: true };\n                }\n                else {\n                    i++;\n                    return { value: array[i - 1], done: false };\n                }\n            } };\n    }\n    ts.arrayIterator = arrayIterator;\n    function arrayReverseIterator(array) {\n        var i = array.length;\n        return {\n            next: function () {\n                if (i === 0) {\n                    return { value: undefined, done: true };\n                }\n                else {\n                    i--;\n                    return { value: array[i], done: false };\n                }\n            }\n        };\n    }\n    ts.arrayReverseIterator = arrayReverseIterator;\n    /**\n     * Stable sort of an array. Elements equal to each other maintain their relative position in the array.\n     */\n    function stableSort(array, comparer) {\n        var indices = indicesOf(array);\n        stableSortIndices(array, indices, comparer);\n        return indices.map(function (i) { return array[i]; });\n    }\n    ts.stableSort = stableSort;\n    function rangeEquals(array1, array2, pos, end) {\n        while (pos < end) {\n            if (array1[pos] !== array2[pos]) {\n                return false;\n            }\n            pos++;\n        }\n        return true;\n    }\n    ts.rangeEquals = rangeEquals;\n    /**\n     * Returns the element at a specific offset in an array if non-empty, `undefined` otherwise.\n     * A negative offset indicates the element should be retrieved from the end of the array.\n     */\n    function elementAt(array, offset) {\n        if (array) {\n            offset = toOffset(array, offset);\n            if (offset < array.length) {\n                return array[offset];\n            }\n        }\n        return undefined;\n    }\n    ts.elementAt = elementAt;\n    /**\n     * Returns the first element of an array if non-empty, `undefined` otherwise.\n     */\n    function firstOrUndefined(array) {\n        return array.length === 0 ? undefined : array[0];\n    }\n    ts.firstOrUndefined = firstOrUndefined;\n    function first(array) {\n        ts.Debug.assert(array.length !== 0);\n        return array[0];\n    }\n    ts.first = first;\n    /**\n     * Returns the last element of an array if non-empty, `undefined` otherwise.\n     */\n    function lastOrUndefined(array) {\n        return array.length === 0 ? undefined : array[array.length - 1];\n    }\n    ts.lastOrUndefined = lastOrUndefined;\n    function last(array) {\n        ts.Debug.assert(array.length !== 0);\n        return array[array.length - 1];\n    }\n    ts.last = last;\n    /**\n     * Returns the only element of an array if it contains only one element, `undefined` otherwise.\n     */\n    function singleOrUndefined(array) {\n        return array && array.length === 1\n            ? array[0]\n            : undefined;\n    }\n    ts.singleOrUndefined = singleOrUndefined;\n    function singleOrMany(array) {\n        return array && array.length === 1\n            ? array[0]\n            : array;\n    }\n    ts.singleOrMany = singleOrMany;\n    function replaceElement(array, index, value) {\n        var result = array.slice(0);\n        result[index] = value;\n        return result;\n    }\n    ts.replaceElement = replaceElement;\n    /**\n     * Performs a binary search, finding the index at which `value` occurs in `array`.\n     * If no such index is found, returns the 2's-complement of first index at which\n     * `array[index]` exceeds `value`.\n     * @param array A sorted array whose first element must be no larger than number\n     * @param value The value to be searched for in the array.\n     * @param keySelector A callback used to select the search key from `value` and each element of\n     * `array`.\n     * @param keyComparer A callback used to compare two keys in a sorted array.\n     * @param offset An offset into `array` at which to start the search.\n     */\n    function binarySearch(array, value, keySelector, keyComparer, offset) {\n        return binarySearchKey(array, keySelector(value), keySelector, keyComparer, offset);\n    }\n    ts.binarySearch = binarySearch;\n    /**\n     * Performs a binary search, finding the index at which an object with `key` occurs in `array`.\n     * If no such index is found, returns the 2's-complement of first index at which\n     * `array[index]` exceeds `key`.\n     * @param array A sorted array whose first element must be no larger than number\n     * @param key The key to be searched for in the array.\n     * @param keySelector A callback used to select the search key from each element of `array`.\n     * @param keyComparer A callback used to compare two keys in a sorted array.\n     * @param offset An offset into `array` at which to start the search.\n     */\n    function binarySearchKey(array, key, keySelector, keyComparer, offset) {\n        if (!some(array)) {\n            return -1;\n        }\n        var low = offset || 0;\n        var high = array.length - 1;\n        while (low <= high) {\n            var middle = low + ((high - low) >> 1);\n            var midKey = keySelector(array[middle], middle);\n            switch (keyComparer(midKey, key)) {\n                case -1 /* LessThan */:\n                    low = middle + 1;\n                    break;\n                case 0 /* EqualTo */:\n                    return middle;\n                case 1 /* GreaterThan */:\n                    high = middle - 1;\n                    break;\n            }\n        }\n        return ~low;\n    }\n    ts.binarySearchKey = binarySearchKey;\n    function reduceLeft(array, f, initial, start, count) {\n        if (array && array.length > 0) {\n            var size = array.length;\n            if (size > 0) {\n                var pos = start === undefined || start < 0 ? 0 : start;\n                var end = count === undefined || pos + count > size - 1 ? size - 1 : pos + count;\n                var result = void 0;\n                if (arguments.length <= 2) {\n                    result = array[pos];\n                    pos++;\n                }\n                else {\n                    result = initial;\n                }\n                while (pos <= end) {\n                    result = f(result, array[pos], pos);\n                    pos++;\n                }\n                return result;\n            }\n        }\n        return initial;\n    }\n    ts.reduceLeft = reduceLeft;\n    var hasOwnProperty = Object.prototype.hasOwnProperty;\n    /**\n     * Indicates whether a map-like contains an own property with the specified key.\n     *\n     * @param map A map-like.\n     * @param key A property key.\n     */\n    function hasProperty(map, key) {\n        return hasOwnProperty.call(map, key);\n    }\n    ts.hasProperty = hasProperty;\n    /**\n     * Gets the value of an owned property in a map-like.\n     *\n     * @param map A map-like.\n     * @param key A property key.\n     */\n    function getProperty(map, key) {\n        return hasOwnProperty.call(map, key) ? map[key] : undefined;\n    }\n    ts.getProperty = getProperty;\n    /**\n     * Gets the owned, enumerable property keys of a map-like.\n     */\n    function getOwnKeys(map) {\n        var keys = [];\n        for (var key in map) {\n            if (hasOwnProperty.call(map, key)) {\n                keys.push(key);\n            }\n        }\n        return keys;\n    }\n    ts.getOwnKeys = getOwnKeys;\n    function getAllKeys(obj) {\n        var result = [];\n        do {\n            var names = Object.getOwnPropertyNames(obj);\n            for (var _i = 0, names_1 = names; _i < names_1.length; _i++) {\n                var name = names_1[_i];\n                pushIfUnique(result, name);\n            }\n        } while (obj = Object.getPrototypeOf(obj));\n        return result;\n    }\n    ts.getAllKeys = getAllKeys;\n    function getOwnValues(sparseArray) {\n        var values = [];\n        for (var key in sparseArray) {\n            if (hasOwnProperty.call(sparseArray, key)) {\n                values.push(sparseArray[key]);\n            }\n        }\n        return values;\n    }\n    ts.getOwnValues = getOwnValues;\n    var _entries = Object.entries || (function (obj) {\n        var keys = getOwnKeys(obj);\n        var result = Array(keys.length);\n        for (var i = 0; i < keys.length; i++) {\n            result[i] = [keys[i], obj[keys[i]]];\n        }\n        return result;\n    });\n    function getEntries(obj) {\n        return obj ? _entries(obj) : [];\n    }\n    ts.getEntries = getEntries;\n    function arrayOf(count, f) {\n        var result = new Array(count);\n        for (var i = 0; i < count; i++) {\n            result[i] = f(i);\n        }\n        return result;\n    }\n    ts.arrayOf = arrayOf;\n    function arrayFrom(iterator, map) {\n        var result = [];\n        for (var iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) {\n            result.push(map ? map(iterResult.value) : iterResult.value);\n        }\n        return result;\n    }\n    ts.arrayFrom = arrayFrom;\n    function assign(t) {\n        var args = [];\n        for (var _i = 1; _i < arguments.length; _i++) {\n            args[_i - 1] = arguments[_i];\n        }\n        for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n            var arg = args_1[_a];\n            if (arg === undefined)\n                continue;\n            for (var p in arg) {\n                if (hasProperty(arg, p)) {\n                    t[p] = arg[p];\n                }\n            }\n        }\n        return t;\n    }\n    ts.assign = assign;\n    /**\n     * Performs a shallow equality comparison of the contents of two map-likes.\n     *\n     * @param left A map-like whose properties should be compared.\n     * @param right A map-like whose properties should be compared.\n     */\n    function equalOwnProperties(left, right, equalityComparer) {\n        if (equalityComparer === void 0) { equalityComparer = equateValues; }\n        if (left === right)\n            return true;\n        if (!left || !right)\n            return false;\n        for (var key in left) {\n            if (hasOwnProperty.call(left, key)) {\n                if (!hasOwnProperty.call(right, key))\n                    return false;\n                if (!equalityComparer(left[key], right[key]))\n                    return false;\n            }\n        }\n        for (var key in right) {\n            if (hasOwnProperty.call(right, key)) {\n                if (!hasOwnProperty.call(left, key))\n                    return false;\n            }\n        }\n        return true;\n    }\n    ts.equalOwnProperties = equalOwnProperties;\n    function arrayToMap(array, makeKey, makeValue) {\n        if (makeValue === void 0) { makeValue = identity; }\n        var result = new ts.Map();\n        for (var _i = 0, array_6 = array; _i < array_6.length; _i++) {\n            var value = array_6[_i];\n            var key = makeKey(value);\n            if (key !== undefined)\n                result.set(key, makeValue(value));\n        }\n        return result;\n    }\n    ts.arrayToMap = arrayToMap;\n    function arrayToNumericMap(array, makeKey, makeValue) {\n        if (makeValue === void 0) { makeValue = identity; }\n        var result = [];\n        for (var _i = 0, array_7 = array; _i < array_7.length; _i++) {\n            var value = array_7[_i];\n            result[makeKey(value)] = makeValue(value);\n        }\n        return result;\n    }\n    ts.arrayToNumericMap = arrayToNumericMap;\n    function arrayToMultiMap(values, makeKey, makeValue) {\n        if (makeValue === void 0) { makeValue = identity; }\n        var result = createMultiMap();\n        for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {\n            var value = values_1[_i];\n            result.add(makeKey(value), makeValue(value));\n        }\n        return result;\n    }\n    ts.arrayToMultiMap = arrayToMultiMap;\n    function group(values, getGroupId, resultSelector) {\n        if (resultSelector === void 0) { resultSelector = identity; }\n        return arrayFrom(arrayToMultiMap(values, getGroupId).values(), resultSelector);\n    }\n    ts.group = group;\n    function clone(object) {\n        var result = {};\n        for (var id in object) {\n            if (hasOwnProperty.call(object, id)) {\n                result[id] = object[id];\n            }\n        }\n        return result;\n    }\n    ts.clone = clone;\n    /**\n     * Creates a new object by adding the own properties of `second`, then the own properties of `first`.\n     *\n     * NOTE: This means that if a property exists in both `first` and `second`, the property in `first` will be chosen.\n     */\n    function extend(first, second) {\n        var result = {};\n        for (var id in second) {\n            if (hasOwnProperty.call(second, id)) {\n                result[id] = second[id];\n            }\n        }\n        for (var id in first) {\n            if (hasOwnProperty.call(first, id)) {\n                result[id] = first[id];\n            }\n        }\n        return result;\n    }\n    ts.extend = extend;\n    function copyProperties(first, second) {\n        for (var id in second) {\n            if (hasOwnProperty.call(second, id)) {\n                first[id] = second[id];\n            }\n        }\n    }\n    ts.copyProperties = copyProperties;\n    function maybeBind(obj, fn) {\n        return fn ? fn.bind(obj) : undefined;\n    }\n    ts.maybeBind = maybeBind;\n    function createMultiMap() {\n        var map = new ts.Map();\n        map.add = multiMapAdd;\n        map.remove = multiMapRemove;\n        return map;\n    }\n    ts.createMultiMap = createMultiMap;\n    function multiMapAdd(key, value) {\n        var values = this.get(key);\n        if (values) {\n            values.push(value);\n        }\n        else {\n            this.set(key, values = [value]);\n        }\n        return values;\n    }\n    function multiMapRemove(key, value) {\n        var values = this.get(key);\n        if (values) {\n            unorderedRemoveItem(values, value);\n            if (!values.length) {\n                this.delete(key);\n            }\n        }\n    }\n    function createUnderscoreEscapedMultiMap() {\n        return createMultiMap();\n    }\n    ts.createUnderscoreEscapedMultiMap = createUnderscoreEscapedMultiMap;\n    /**\n     * Tests whether a value is an array.\n     */\n    function isArray(value) {\n        return Array.isArray ? Array.isArray(value) : value instanceof Array;\n    }\n    ts.isArray = isArray;\n    function toArray(value) {\n        return isArray(value) ? value : [value];\n    }\n    ts.toArray = toArray;\n    /**\n     * Tests whether a value is string\n     */\n    function isString(text) {\n        return typeof text === \"string\";\n    }\n    ts.isString = isString;\n    function isNumber(x) {\n        return typeof x === \"number\";\n    }\n    ts.isNumber = isNumber;\n    function tryCast(value, test) {\n        return value !== undefined && test(value) ? value : undefined;\n    }\n    ts.tryCast = tryCast;\n    function cast(value, test) {\n        if (value !== undefined && test(value))\n            return value;\n        return ts.Debug.fail(\"Invalid cast. The supplied value \" + value + \" did not pass the test '\" + ts.Debug.getFunctionName(test) + \"'.\");\n    }\n    ts.cast = cast;\n    /** Does nothing. */\n    function noop(_) { }\n    ts.noop = noop;\n    /** Do nothing and return false */\n    function returnFalse() { return false; }\n    ts.returnFalse = returnFalse;\n    /** Do nothing and return true */\n    function returnTrue() { return true; }\n    ts.returnTrue = returnTrue;\n    /** Do nothing and return undefined */\n    function returnUndefined() { return undefined; }\n    ts.returnUndefined = returnUndefined;\n    /** Returns its argument. */\n    function identity(x) { return x; }\n    ts.identity = identity;\n    /** Returns lower case string */\n    function toLowerCase(x) { return x.toLowerCase(); }\n    ts.toLowerCase = toLowerCase;\n    // We convert the file names to lower case as key for file name on case insensitive file system\n    // While doing so we need to handle special characters (eg \\u0130) to ensure that we dont convert\n    // it to lower case, fileName with its lowercase form can exist along side it.\n    // Handle special characters and make those case sensitive instead\n    //\n    // |-#--|-Unicode--|-Char code-|-Desc-------------------------------------------------------------------|\n    // | 1. | i        | 105       | Ascii i                                                                |\n    // | 2. | I        | 73        | Ascii I                                                                |\n    // |-------- Special characters ------------------------------------------------------------------------|\n    // | 3. | \\u0130   | 304       | Upper case I with dot above                                            |\n    // | 4. | i,\\u0307 | 105,775   | i, followed by 775: Lower case of (3rd item)                           |\n    // | 5. | I,\\u0307 | 73,775    | I, followed by 775: Upper case of (4th item), lower case is (4th item) |\n    // | 6. | \\u0131   | 305       | Lower case i without dot, upper case is I (2nd item)                   |\n    // | 7. | \\u00DF   | 223       | Lower case sharp s                                                     |\n    //\n    // Because item 3 is special where in its lowercase character has its own\n    // upper case form we cant convert its case.\n    // Rest special characters are either already in lower case format or\n    // they have corresponding upper case character so they dont need special handling\n    //\n    // But to avoid having to do string building for most common cases, also ignore\n    // a-z, 0-9, \\u0131, \\u00DF, \\, /, ., : and space\n    var fileNameLowerCaseRegExp = /[^\\u0130\\u0131\\u00DFa-z0-9\\\\/:\\-_\\. ]+/g;\n    /**\n     * Case insensitive file systems have descripencies in how they handle some characters (eg. turkish Upper case I with dot on top - \\u0130)\n     * This function is used in places where we want to make file name as a key on these systems\n     * It is possible on mac to be able to refer to file name with I with dot on top as a fileName with its lower case form\n     * But on windows we cannot. Windows can have fileName with I with dot on top next to its lower case and they can not each be referred with the lowercase forms\n     * Technically we would want this function to be platform sepcific as well but\n     * our api has till now only taken caseSensitive as the only input and just for some characters we dont want to update API and ensure all customers use those api\n     * We could use upper case and we would still need to deal with the descripencies but\n     * we want to continue using lower case since in most cases filenames are lowercasewe and wont need any case changes and avoid having to store another string for the key\n     * So for this function purpose, we go ahead and assume character I with dot on top it as case sensitive since its very unlikely to use lower case form of that special character\n     */\n    function toFileNameLowerCase(x) {\n        return fileNameLowerCaseRegExp.test(x) ?\n            x.replace(fileNameLowerCaseRegExp, toLowerCase) :\n            x;\n    }\n    ts.toFileNameLowerCase = toFileNameLowerCase;\n    /** Throws an error because a function is not implemented. */\n    function notImplemented() {\n        throw new Error(\"Not implemented\");\n    }\n    ts.notImplemented = notImplemented;\n    function memoize(callback) {\n        var value;\n        return function () {\n            if (callback) {\n                value = callback();\n                callback = undefined;\n            }\n            return value;\n        };\n    }\n    ts.memoize = memoize;\n    /** A version of `memoize` that supports a single primitive argument */\n    function memoizeOne(callback) {\n        var map = new ts.Map();\n        return function (arg) {\n            var key = typeof arg + \":\" + arg;\n            var value = map.get(key);\n            if (value === undefined && !map.has(key)) {\n                value = callback(arg);\n                map.set(key, value);\n            }\n            return value;\n        };\n    }\n    ts.memoizeOne = memoizeOne;\n    function compose(a, b, c, d, e) {\n        if (!!e) {\n            var args_2 = [];\n            for (var i = 0; i < arguments.length; i++) {\n                args_2[i] = arguments[i];\n            }\n            return function (t) { return reduceLeft(args_2, function (u, f) { return f(u); }, t); };\n        }\n        else if (d) {\n            return function (t) { return d(c(b(a(t)))); };\n        }\n        else if (c) {\n            return function (t) { return c(b(a(t))); };\n        }\n        else if (b) {\n            return function (t) { return b(a(t)); };\n        }\n        else if (a) {\n            return function (t) { return a(t); };\n        }\n        else {\n            return function (t) { return t; };\n        }\n    }\n    ts.compose = compose;\n    var AssertionLevel;\n    (function (AssertionLevel) {\n        AssertionLevel[AssertionLevel[\"None\"] = 0] = \"None\";\n        AssertionLevel[AssertionLevel[\"Normal\"] = 1] = \"Normal\";\n        AssertionLevel[AssertionLevel[\"Aggressive\"] = 2] = \"Aggressive\";\n        AssertionLevel[AssertionLevel[\"VeryAggressive\"] = 3] = \"VeryAggressive\";\n    })(AssertionLevel = ts.AssertionLevel || (ts.AssertionLevel = {}));\n    function equateValues(a, b) {\n        return a === b;\n    }\n    ts.equateValues = equateValues;\n    /**\n     * Compare the equality of two strings using a case-sensitive ordinal comparison.\n     *\n     * Case-sensitive comparisons compare both strings one code-point at a time using the integer\n     * value of each code-point after applying `toUpperCase` to each string. We always map both\n     * strings to their upper-case form as some unicode characters do not properly round-trip to\n     * lowercase (such as `ẞ` (German sharp capital s)).\n     */\n    function equateStringsCaseInsensitive(a, b) {\n        return a === b\n            || a !== undefined\n                && b !== undefined\n                && a.toUpperCase() === b.toUpperCase();\n    }\n    ts.equateStringsCaseInsensitive = equateStringsCaseInsensitive;\n    /**\n     * Compare the equality of two strings using a case-sensitive ordinal comparison.\n     *\n     * Case-sensitive comparisons compare both strings one code-point at a time using the\n     * integer value of each code-point.\n     */\n    function equateStringsCaseSensitive(a, b) {\n        return equateValues(a, b);\n    }\n    ts.equateStringsCaseSensitive = equateStringsCaseSensitive;\n    function compareComparableValues(a, b) {\n        return a === b ? 0 /* EqualTo */ :\n            a === undefined ? -1 /* LessThan */ :\n                b === undefined ? 1 /* GreaterThan */ :\n                    a < b ? -1 /* LessThan */ :\n                        1 /* GreaterThan */;\n    }\n    /**\n     * Compare two numeric values for their order relative to each other.\n     * To compare strings, use any of the `compareStrings` functions.\n     */\n    function compareValues(a, b) {\n        return compareComparableValues(a, b);\n    }\n    ts.compareValues = compareValues;\n    /**\n     * Compare two TextSpans, first by `start`, then by `length`.\n     */\n    function compareTextSpans(a, b) {\n        return compareValues(a === null || a === void 0 ? void 0 : a.start, b === null || b === void 0 ? void 0 : b.start) || compareValues(a === null || a === void 0 ? void 0 : a.length, b === null || b === void 0 ? void 0 : b.length);\n    }\n    ts.compareTextSpans = compareTextSpans;\n    function min(a, b, compare) {\n        return compare(a, b) === -1 /* LessThan */ ? a : b;\n    }\n    ts.min = min;\n    /**\n     * Compare two strings using a case-insensitive ordinal comparison.\n     *\n     * Ordinal comparisons are based on the difference between the unicode code points of both\n     * strings. Characters with multiple unicode representations are considered unequal. Ordinal\n     * comparisons provide predictable ordering, but place \"a\" after \"B\".\n     *\n     * Case-insensitive comparisons compare both strings one code-point at a time using the integer\n     * value of each code-point after applying `toUpperCase` to each string. We always map both\n     * strings to their upper-case form as some unicode characters do not properly round-trip to\n     * lowercase (such as `ẞ` (German sharp capital s)).\n     */\n    function compareStringsCaseInsensitive(a, b) {\n        if (a === b)\n            return 0 /* EqualTo */;\n        if (a === undefined)\n            return -1 /* LessThan */;\n        if (b === undefined)\n            return 1 /* GreaterThan */;\n        a = a.toUpperCase();\n        b = b.toUpperCase();\n        return a < b ? -1 /* LessThan */ : a > b ? 1 /* GreaterThan */ : 0 /* EqualTo */;\n    }\n    ts.compareStringsCaseInsensitive = compareStringsCaseInsensitive;\n    /**\n     * Compare two strings using a case-sensitive ordinal comparison.\n     *\n     * Ordinal comparisons are based on the difference between the unicode code points of both\n     * strings. Characters with multiple unicode representations are considered unequal. Ordinal\n     * comparisons provide predictable ordering, but place \"a\" after \"B\".\n     *\n     * Case-sensitive comparisons compare both strings one code-point at a time using the integer\n     * value of each code-point.\n     */\n    function compareStringsCaseSensitive(a, b) {\n        return compareComparableValues(a, b);\n    }\n    ts.compareStringsCaseSensitive = compareStringsCaseSensitive;\n    function getStringComparer(ignoreCase) {\n        return ignoreCase ? compareStringsCaseInsensitive : compareStringsCaseSensitive;\n    }\n    ts.getStringComparer = getStringComparer;\n    /**\n     * Creates a string comparer for use with string collation in the UI.\n     */\n    var createUIStringComparer = (function () {\n        var defaultComparer;\n        var enUSComparer;\n        var stringComparerFactory = getStringComparerFactory();\n        return createStringComparer;\n        function compareWithCallback(a, b, comparer) {\n            if (a === b)\n                return 0 /* EqualTo */;\n            if (a === undefined)\n                return -1 /* LessThan */;\n            if (b === undefined)\n                return 1 /* GreaterThan */;\n            var value = comparer(a, b);\n            return value < 0 ? -1 /* LessThan */ : value > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */;\n        }\n        function createIntlCollatorStringComparer(locale) {\n            // Intl.Collator.prototype.compare is bound to the collator. See NOTE in\n            // http://www.ecma-international.org/ecma-402/2.0/#sec-Intl.Collator.prototype.compare\n            var comparer = new Intl.Collator(locale, { usage: \"sort\", sensitivity: \"variant\" }).compare;\n            return function (a, b) { return compareWithCallback(a, b, comparer); };\n        }\n        function createLocaleCompareStringComparer(locale) {\n            // if the locale is not the default locale (`undefined`), use the fallback comparer.\n            if (locale !== undefined)\n                return createFallbackStringComparer();\n            return function (a, b) { return compareWithCallback(a, b, compareStrings); };\n            function compareStrings(a, b) {\n                return a.localeCompare(b);\n            }\n        }\n        function createFallbackStringComparer() {\n            // An ordinal comparison puts \"A\" after \"b\", but for the UI we want \"A\" before \"b\".\n            // We first sort case insensitively.  So \"Aaa\" will come before \"baa\".\n            // Then we sort case sensitively, so \"aaa\" will come before \"Aaa\".\n            //\n            // For case insensitive comparisons we always map both strings to their\n            // upper-case form as some unicode characters do not properly round-trip to\n            // lowercase (such as `Ã¡ÂºÅ¾` (German sharp capital s)).\n            return function (a, b) { return compareWithCallback(a, b, compareDictionaryOrder); };\n            function compareDictionaryOrder(a, b) {\n                return compareStrings(a.toUpperCase(), b.toUpperCase()) || compareStrings(a, b);\n            }\n            function compareStrings(a, b) {\n                return a < b ? -1 /* LessThan */ : a > b ? 1 /* GreaterThan */ : 0 /* EqualTo */;\n            }\n        }\n        function getStringComparerFactory() {\n            // If the host supports Intl, we use it for comparisons using the default locale.\n            if (typeof Intl === \"object\" && typeof Intl.Collator === \"function\") {\n                return createIntlCollatorStringComparer;\n            }\n            // If the host does not support Intl, we fall back to localeCompare.\n            // localeCompare in Node v0.10 is just an ordinal comparison, so don't use it.\n            if (typeof String.prototype.localeCompare === \"function\" &&\n                typeof String.prototype.toLocaleUpperCase === \"function\" &&\n                \"a\".localeCompare(\"B\") < 0) {\n                return createLocaleCompareStringComparer;\n            }\n            // Otherwise, fall back to ordinal comparison:\n            return createFallbackStringComparer;\n        }\n        function createStringComparer(locale) {\n            // Hold onto common string comparers. This avoids constantly reallocating comparers during\n            // tests.\n            if (locale === undefined) {\n                return defaultComparer || (defaultComparer = stringComparerFactory(locale));\n            }\n            else if (locale === \"en-US\") {\n                return enUSComparer || (enUSComparer = stringComparerFactory(locale));\n            }\n            else {\n                return stringComparerFactory(locale);\n            }\n        }\n    })();\n    var uiComparerCaseSensitive;\n    var uiLocale;\n    function getUILocale() {\n        return uiLocale;\n    }\n    ts.getUILocale = getUILocale;\n    function setUILocale(value) {\n        if (uiLocale !== value) {\n            uiLocale = value;\n            uiComparerCaseSensitive = undefined;\n        }\n    }\n    ts.setUILocale = setUILocale;\n    /**\n     * Compare two strings in a using the case-sensitive sort behavior of the UI locale.\n     *\n     * Ordering is not predictable between different host locales, but is best for displaying\n     * ordered data for UI presentation. Characters with multiple unicode representations may\n     * be considered equal.\n     *\n     * Case-sensitive comparisons compare strings that differ in base characters, or\n     * accents/diacritic marks, or case as unequal.\n     */\n    function compareStringsCaseSensitiveUI(a, b) {\n        var comparer = uiComparerCaseSensitive || (uiComparerCaseSensitive = createUIStringComparer(uiLocale));\n        return comparer(a, b);\n    }\n    ts.compareStringsCaseSensitiveUI = compareStringsCaseSensitiveUI;\n    function compareProperties(a, b, key, comparer) {\n        return a === b ? 0 /* EqualTo */ :\n            a === undefined ? -1 /* LessThan */ :\n                b === undefined ? 1 /* GreaterThan */ :\n                    comparer(a[key], b[key]);\n    }\n    ts.compareProperties = compareProperties;\n    /** True is greater than false. */\n    function compareBooleans(a, b) {\n        return compareValues(a ? 1 : 0, b ? 1 : 0);\n    }\n    ts.compareBooleans = compareBooleans;\n    /**\n     * Given a name and a list of names that are *not* equal to the name, return a spelling suggestion if there is one that is close enough.\n     * Names less than length 3 only check for case-insensitive equality.\n     *\n     * find the candidate with the smallest Levenshtein distance,\n     *    except for candidates:\n     *      * With no name\n     *      * Whose length differs from the target name by more than 0.34 of the length of the name.\n     *      * Whose levenshtein distance is more than 0.4 of the length of the name\n     *        (0.4 allows 1 substitution/transposition for every 5 characters,\n     *         and 1 insertion/deletion at 3 characters)\n     */\n    function getSpellingSuggestion(name, candidates, getName) {\n        var maximumLengthDifference = Math.min(2, Math.floor(name.length * 0.34));\n        var bestDistance = Math.floor(name.length * 0.4) + 1; // If the best result is worse than this, don't bother.\n        var bestCandidate;\n        for (var _i = 0, candidates_1 = candidates; _i < candidates_1.length; _i++) {\n            var candidate = candidates_1[_i];\n            var candidateName = getName(candidate);\n            if (candidateName !== undefined && Math.abs(candidateName.length - name.length) <= maximumLengthDifference) {\n                if (candidateName === name) {\n                    continue;\n                }\n                // Only consider candidates less than 3 characters long when they differ by case.\n                // Otherwise, don't bother, since a user would usually notice differences of a 2-character name.\n                if (candidateName.length < 3 && candidateName.toLowerCase() !== name.toLowerCase()) {\n                    continue;\n                }\n                var distance = levenshteinWithMax(name, candidateName, bestDistance - 0.1);\n                if (distance === undefined) {\n                    continue;\n                }\n                ts.Debug.assert(distance < bestDistance); // Else `levenshteinWithMax` should return undefined\n                bestDistance = distance;\n                bestCandidate = candidate;\n            }\n        }\n        return bestCandidate;\n    }\n    ts.getSpellingSuggestion = getSpellingSuggestion;\n    function levenshteinWithMax(s1, s2, max) {\n        var previous = new Array(s2.length + 1);\n        var current = new Array(s2.length + 1);\n        /** Represents any value > max. We don't care about the particular value. */\n        var big = max + 0.01;\n        for (var i = 0; i <= s2.length; i++) {\n            previous[i] = i;\n        }\n        for (var i = 1; i <= s1.length; i++) {\n            var c1 = s1.charCodeAt(i - 1);\n            var minJ = Math.ceil(i > max ? i - max : 1);\n            var maxJ = Math.floor(s2.length > max + i ? max + i : s2.length);\n            current[0] = i;\n            /** Smallest value of the matrix in the ith column. */\n            var colMin = i;\n            for (var j = 1; j < minJ; j++) {\n                current[j] = big;\n            }\n            for (var j = minJ; j <= maxJ; j++) {\n                // case difference should be significantly cheaper than other differences\n                var substitutionDistance = s1[i - 1].toLowerCase() === s2[j - 1].toLowerCase()\n                    ? (previous[j - 1] + 0.1)\n                    : (previous[j - 1] + 2);\n                var dist = c1 === s2.charCodeAt(j - 1)\n                    ? previous[j - 1]\n                    : Math.min(/*delete*/ previous[j] + 1, /*insert*/ current[j - 1] + 1, /*substitute*/ substitutionDistance);\n                current[j] = dist;\n                colMin = Math.min(colMin, dist);\n            }\n            for (var j = maxJ + 1; j <= s2.length; j++) {\n                current[j] = big;\n            }\n            if (colMin > max) {\n                // Give up -- everything in this column is > max and it can't get better in future columns.\n                return undefined;\n            }\n            var temp = previous;\n            previous = current;\n            current = temp;\n        }\n        var res = previous[s2.length];\n        return res > max ? undefined : res;\n    }\n    function endsWith(str, suffix) {\n        var expectedPos = str.length - suffix.length;\n        return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos;\n    }\n    ts.endsWith = endsWith;\n    function removeSuffix(str, suffix) {\n        return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : str;\n    }\n    ts.removeSuffix = removeSuffix;\n    function tryRemoveSuffix(str, suffix) {\n        return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : undefined;\n    }\n    ts.tryRemoveSuffix = tryRemoveSuffix;\n    function stringContains(str, substring) {\n        return str.indexOf(substring) !== -1;\n    }\n    ts.stringContains = stringContains;\n    /**\n     * Takes a string like \"jquery-min.4.2.3\" and returns \"jquery\"\n     */\n    function removeMinAndVersionNumbers(fileName) {\n        // Match a \".\" or \"-\" followed by a version number or 'min' at the end of the name\n        var trailingMinOrVersion = /[.-]((min)|(\\d+(\\.\\d+)*))$/;\n        // The \"min\" or version may both be present, in either order, so try applying the above twice.\n        return fileName.replace(trailingMinOrVersion, \"\").replace(trailingMinOrVersion, \"\");\n    }\n    ts.removeMinAndVersionNumbers = removeMinAndVersionNumbers;\n    /** Remove an item from an array, moving everything to its right one space left. */\n    function orderedRemoveItem(array, item) {\n        for (var i = 0; i < array.length; i++) {\n            if (array[i] === item) {\n                orderedRemoveItemAt(array, i);\n                return true;\n            }\n        }\n        return false;\n    }\n    ts.orderedRemoveItem = orderedRemoveItem;\n    /** Remove an item by index from an array, moving everything to its right one space left. */\n    function orderedRemoveItemAt(array, index) {\n        // This seems to be faster than either `array.splice(i, 1)` or `array.copyWithin(i, i+ 1)`.\n        for (var i = index; i < array.length - 1; i++) {\n            array[i] = array[i + 1];\n        }\n        array.pop();\n    }\n    ts.orderedRemoveItemAt = orderedRemoveItemAt;\n    function unorderedRemoveItemAt(array, index) {\n        // Fill in the \"hole\" left at `index`.\n        array[index] = array[array.length - 1];\n        array.pop();\n    }\n    ts.unorderedRemoveItemAt = unorderedRemoveItemAt;\n    /** Remove the *first* occurrence of `item` from the array. */\n    function unorderedRemoveItem(array, item) {\n        return unorderedRemoveFirstItemWhere(array, function (element) { return element === item; });\n    }\n    ts.unorderedRemoveItem = unorderedRemoveItem;\n    /** Remove the *first* element satisfying `predicate`. */\n    function unorderedRemoveFirstItemWhere(array, predicate) {\n        for (var i = 0; i < array.length; i++) {\n            if (predicate(array[i])) {\n                unorderedRemoveItemAt(array, i);\n                return true;\n            }\n        }\n        return false;\n    }\n    function createGetCanonicalFileName(useCaseSensitiveFileNames) {\n        return useCaseSensitiveFileNames ? identity : toFileNameLowerCase;\n    }\n    ts.createGetCanonicalFileName = createGetCanonicalFileName;\n    function patternText(_a) {\n        var prefix = _a.prefix, suffix = _a.suffix;\n        return prefix + \"*\" + suffix;\n    }\n    ts.patternText = patternText;\n    /**\n     * Given that candidate matches pattern, returns the text matching the '*'.\n     * E.g.: matchedText(tryParsePattern(\"foo*baz\"), \"foobarbaz\") === \"bar\"\n     */\n    function matchedText(pattern, candidate) {\n        ts.Debug.assert(isPatternMatch(pattern, candidate));\n        return candidate.substring(pattern.prefix.length, candidate.length - pattern.suffix.length);\n    }\n    ts.matchedText = matchedText;\n    /** Return the object corresponding to the best pattern to match `candidate`. */\n    function findBestPatternMatch(values, getPattern, candidate) {\n        var matchedValue;\n        // use length of prefix as betterness criteria\n        var longestMatchPrefixLength = -1;\n        for (var _i = 0, values_2 = values; _i < values_2.length; _i++) {\n            var v = values_2[_i];\n            var pattern = getPattern(v);\n            if (isPatternMatch(pattern, candidate) && pattern.prefix.length > longestMatchPrefixLength) {\n                longestMatchPrefixLength = pattern.prefix.length;\n                matchedValue = v;\n            }\n        }\n        return matchedValue;\n    }\n    ts.findBestPatternMatch = findBestPatternMatch;\n    function startsWith(str, prefix) {\n        return str.lastIndexOf(prefix, 0) === 0;\n    }\n    ts.startsWith = startsWith;\n    function removePrefix(str, prefix) {\n        return startsWith(str, prefix) ? str.substr(prefix.length) : str;\n    }\n    ts.removePrefix = removePrefix;\n    function tryRemovePrefix(str, prefix, getCanonicalFileName) {\n        if (getCanonicalFileName === void 0) { getCanonicalFileName = identity; }\n        return startsWith(getCanonicalFileName(str), getCanonicalFileName(prefix)) ? str.substring(prefix.length) : undefined;\n    }\n    ts.tryRemovePrefix = tryRemovePrefix;\n    function isPatternMatch(_a, candidate) {\n        var prefix = _a.prefix, suffix = _a.suffix;\n        return candidate.length >= prefix.length + suffix.length &&\n            startsWith(candidate, prefix) &&\n            endsWith(candidate, suffix);\n    }\n    function and(f, g) {\n        return function (arg) { return f(arg) && g(arg); };\n    }\n    ts.and = and;\n    function or() {\n        var fs = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            fs[_i] = arguments[_i];\n        }\n        return function () {\n            var args = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                args[_i] = arguments[_i];\n            }\n            for (var _a = 0, fs_1 = fs; _a < fs_1.length; _a++) {\n                var f = fs_1[_a];\n                if (f.apply(void 0, args)) {\n                    return true;\n                }\n            }\n            return false;\n        };\n    }\n    ts.or = or;\n    function not(fn) {\n        return function () {\n            var args = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                args[_i] = arguments[_i];\n            }\n            return !fn.apply(void 0, args);\n        };\n    }\n    ts.not = not;\n    function assertType(_) { }\n    ts.assertType = assertType;\n    function singleElementArray(t) {\n        return t === undefined ? undefined : [t];\n    }\n    ts.singleElementArray = singleElementArray;\n    function enumerateInsertsAndDeletes(newItems, oldItems, comparer, inserted, deleted, unchanged) {\n        unchanged = unchanged || noop;\n        var newIndex = 0;\n        var oldIndex = 0;\n        var newLen = newItems.length;\n        var oldLen = oldItems.length;\n        var hasChanges = false;\n        while (newIndex < newLen && oldIndex < oldLen) {\n            var newItem = newItems[newIndex];\n            var oldItem = oldItems[oldIndex];\n            var compareResult = comparer(newItem, oldItem);\n            if (compareResult === -1 /* LessThan */) {\n                inserted(newItem);\n                newIndex++;\n                hasChanges = true;\n            }\n            else if (compareResult === 1 /* GreaterThan */) {\n                deleted(oldItem);\n                oldIndex++;\n                hasChanges = true;\n            }\n            else {\n                unchanged(oldItem, newItem);\n                newIndex++;\n                oldIndex++;\n            }\n        }\n        while (newIndex < newLen) {\n            inserted(newItems[newIndex++]);\n            hasChanges = true;\n        }\n        while (oldIndex < oldLen) {\n            deleted(oldItems[oldIndex++]);\n            hasChanges = true;\n        }\n        return hasChanges;\n    }\n    ts.enumerateInsertsAndDeletes = enumerateInsertsAndDeletes;\n    function fill(length, cb) {\n        var result = Array(length);\n        for (var i = 0; i < length; i++) {\n            result[i] = cb(i);\n        }\n        return result;\n    }\n    ts.fill = fill;\n    function cartesianProduct(arrays) {\n        var result = [];\n        cartesianProductWorker(arrays, result, /*outer*/ undefined, 0);\n        return result;\n    }\n    ts.cartesianProduct = cartesianProduct;\n    function cartesianProductWorker(arrays, result, outer, index) {\n        for (var _i = 0, _a = arrays[index]; _i < _a.length; _i++) {\n            var element = _a[_i];\n            var inner = void 0;\n            if (outer) {\n                inner = outer.slice();\n                inner.push(element);\n            }\n            else {\n                inner = [element];\n            }\n            if (index === arrays.length - 1) {\n                result.push(inner);\n            }\n            else {\n                cartesianProductWorker(arrays, result, inner, index + 1);\n            }\n        }\n    }\n    /**\n     * Returns string left-padded with spaces or zeros until it reaches the given length.\n     *\n     * @param s String to pad.\n     * @param length Final padded length. If less than or equal to 's.length', returns 's' unchanged.\n     * @param padString Character to use as padding (default \" \").\n     */\n    function padLeft(s, length, padString) {\n        if (padString === void 0) { padString = \" \"; }\n        return length <= s.length ? s : padString.repeat(length - s.length) + s;\n    }\n    ts.padLeft = padLeft;\n    /**\n     * Returns string right-padded with spaces until it reaches the given length.\n     *\n     * @param s String to pad.\n     * @param length Final padded length. If less than or equal to 's.length', returns 's' unchanged.\n     * @param padString Character to use as padding (default \" \").\n     */\n    function padRight(s, length, padString) {\n        if (padString === void 0) { padString = \" \"; }\n        return length <= s.length ? s : s + padString.repeat(length - s.length);\n    }\n    ts.padRight = padRight;\n    function takeWhile(array, predicate) {\n        var len = array.length;\n        var index = 0;\n        while (index < len && predicate(array[index])) {\n            index++;\n        }\n        return array.slice(0, index);\n    }\n    ts.takeWhile = takeWhile;\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var LogLevel;\n    (function (LogLevel) {\n        LogLevel[LogLevel[\"Off\"] = 0] = \"Off\";\n        LogLevel[LogLevel[\"Error\"] = 1] = \"Error\";\n        LogLevel[LogLevel[\"Warning\"] = 2] = \"Warning\";\n        LogLevel[LogLevel[\"Info\"] = 3] = \"Info\";\n        LogLevel[LogLevel[\"Verbose\"] = 4] = \"Verbose\";\n    })(LogLevel = ts.LogLevel || (ts.LogLevel = {}));\n    var Debug;\n    (function (Debug) {\n        var typeScriptVersion;\n        /* eslint-disable prefer-const */\n        var currentAssertionLevel = 0 /* None */;\n        Debug.currentLogLevel = LogLevel.Warning;\n        Debug.isDebugging = false;\n        function getTypeScriptVersion() {\n            return typeScriptVersion !== null && typeScriptVersion !== void 0 ? typeScriptVersion : (typeScriptVersion = new ts.Version(ts.version));\n        }\n        Debug.getTypeScriptVersion = getTypeScriptVersion;\n        function shouldLog(level) {\n            return Debug.currentLogLevel <= level;\n        }\n        Debug.shouldLog = shouldLog;\n        function logMessage(level, s) {\n            if (Debug.loggingHost && shouldLog(level)) {\n                Debug.loggingHost.log(level, s);\n            }\n        }\n        function log(s) {\n            logMessage(LogLevel.Info, s);\n        }\n        Debug.log = log;\n        (function (log_1) {\n            function error(s) {\n                logMessage(LogLevel.Error, s);\n            }\n            log_1.error = error;\n            function warn(s) {\n                logMessage(LogLevel.Warning, s);\n            }\n            log_1.warn = warn;\n            function log(s) {\n                logMessage(LogLevel.Info, s);\n            }\n            log_1.log = log;\n            function trace(s) {\n                logMessage(LogLevel.Verbose, s);\n            }\n            log_1.trace = trace;\n        })(log = Debug.log || (Debug.log = {}));\n        var assertionCache = {};\n        function getAssertionLevel() {\n            return currentAssertionLevel;\n        }\n        Debug.getAssertionLevel = getAssertionLevel;\n        function setAssertionLevel(level) {\n            var prevAssertionLevel = currentAssertionLevel;\n            currentAssertionLevel = level;\n            if (level > prevAssertionLevel) {\n                // restore assertion functions for the current assertion level (see `shouldAssertFunction`).\n                for (var _i = 0, _a = ts.getOwnKeys(assertionCache); _i < _a.length; _i++) {\n                    var key = _a[_i];\n                    var cachedFunc = assertionCache[key];\n                    if (cachedFunc !== undefined && Debug[key] !== cachedFunc.assertion && level >= cachedFunc.level) {\n                        Debug[key] = cachedFunc;\n                        assertionCache[key] = undefined;\n                    }\n                }\n            }\n        }\n        Debug.setAssertionLevel = setAssertionLevel;\n        function shouldAssert(level) {\n            return currentAssertionLevel >= level;\n        }\n        Debug.shouldAssert = shouldAssert;\n        /**\n         * Tests whether an assertion function should be executed. If it shouldn't, it is cached and replaced with `ts.noop`.\n         * Replaced assertion functions are restored when `Debug.setAssertionLevel` is set to a high enough level.\n         * @param level The minimum assertion level required.\n         * @param name The name of the current assertion function.\n         */\n        function shouldAssertFunction(level, name) {\n            if (!shouldAssert(level)) {\n                assertionCache[name] = { level: level, assertion: Debug[name] };\n                Debug[name] = ts.noop;\n                return false;\n            }\n            return true;\n        }\n        function fail(message, stackCrawlMark) {\n            // MONACOCHANGE\n            // debugger;\n            // END MONACOCHANGE\n            var e = new Error(message ? \"Debug Failure. \" + message : \"Debug Failure.\");\n            if (Error.captureStackTrace) {\n                Error.captureStackTrace(e, stackCrawlMark || fail);\n            }\n            throw e;\n        }\n        Debug.fail = fail;\n        function failBadSyntaxKind(node, message, stackCrawlMark) {\n            return fail((message || \"Unexpected node.\") + \"\\r\\nNode \" + formatSyntaxKind(node.kind) + \" was unexpected.\", stackCrawlMark || failBadSyntaxKind);\n        }\n        Debug.failBadSyntaxKind = failBadSyntaxKind;\n        function assert(expression, message, verboseDebugInfo, stackCrawlMark) {\n            if (!expression) {\n                message = message ? \"False expression: \" + message : \"False expression.\";\n                if (verboseDebugInfo) {\n                    message += \"\\r\\nVerbose Debug Information: \" + (typeof verboseDebugInfo === \"string\" ? verboseDebugInfo : verboseDebugInfo());\n                }\n                fail(message, stackCrawlMark || assert);\n            }\n        }\n        Debug.assert = assert;\n        function assertEqual(a, b, msg, msg2, stackCrawlMark) {\n            if (a !== b) {\n                var message = msg ? msg2 ? msg + \" \" + msg2 : msg : \"\";\n                fail(\"Expected \" + a + \" === \" + b + \". \" + message, stackCrawlMark || assertEqual);\n            }\n        }\n        Debug.assertEqual = assertEqual;\n        function assertLessThan(a, b, msg, stackCrawlMark) {\n            if (a >= b) {\n                fail(\"Expected \" + a + \" < \" + b + \". \" + (msg || \"\"), stackCrawlMark || assertLessThan);\n            }\n        }\n        Debug.assertLessThan = assertLessThan;\n        function assertLessThanOrEqual(a, b, stackCrawlMark) {\n            if (a > b) {\n                fail(\"Expected \" + a + \" <= \" + b, stackCrawlMark || assertLessThanOrEqual);\n            }\n        }\n        Debug.assertLessThanOrEqual = assertLessThanOrEqual;\n        function assertGreaterThanOrEqual(a, b, stackCrawlMark) {\n            if (a < b) {\n                fail(\"Expected \" + a + \" >= \" + b, stackCrawlMark || assertGreaterThanOrEqual);\n            }\n        }\n        Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual;\n        function assertIsDefined(value, message, stackCrawlMark) {\n            // eslint-disable-next-line no-null/no-null\n            if (value === undefined || value === null) {\n                fail(message, stackCrawlMark || assertIsDefined);\n            }\n        }\n        Debug.assertIsDefined = assertIsDefined;\n        function checkDefined(value, message, stackCrawlMark) {\n            assertIsDefined(value, message, stackCrawlMark || checkDefined);\n            return value;\n        }\n        Debug.checkDefined = checkDefined;\n        /**\n         * @deprecated Use `checkDefined` to check whether a value is defined inline. Use `assertIsDefined` to check whether\n         * a value is defined at the statement level.\n         */\n        Debug.assertDefined = checkDefined;\n        function assertEachIsDefined(value, message, stackCrawlMark) {\n            for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {\n                var v = value_1[_i];\n                assertIsDefined(v, message, stackCrawlMark || assertEachIsDefined);\n            }\n        }\n        Debug.assertEachIsDefined = assertEachIsDefined;\n        function checkEachDefined(value, message, stackCrawlMark) {\n            assertEachIsDefined(value, message, stackCrawlMark || checkEachDefined);\n            return value;\n        }\n        Debug.checkEachDefined = checkEachDefined;\n        /**\n         * @deprecated Use `checkEachDefined` to check whether the elements of an array are defined inline. Use `assertEachIsDefined` to check whether\n         * the elements of an array are defined at the statement level.\n         */\n        Debug.assertEachDefined = checkEachDefined;\n        function assertNever(member, message, stackCrawlMark) {\n            if (message === void 0) { message = \"Illegal value:\"; }\n            var detail = typeof member === \"object\" && ts.hasProperty(member, \"kind\") && ts.hasProperty(member, \"pos\") && formatSyntaxKind ? \"SyntaxKind: \" + formatSyntaxKind(member.kind) : JSON.stringify(member);\n            return fail(message + \" \" + detail, stackCrawlMark || assertNever);\n        }\n        Debug.assertNever = assertNever;\n        function assertEachNode(nodes, test, message, stackCrawlMark) {\n            if (shouldAssertFunction(1 /* Normal */, \"assertEachNode\")) {\n                assert(test === undefined || ts.every(nodes, test), message || \"Unexpected node.\", function () { return \"Node array did not pass test '\" + getFunctionName(test) + \"'.\"; }, stackCrawlMark || assertEachNode);\n            }\n        }\n        Debug.assertEachNode = assertEachNode;\n        function assertNode(node, test, message, stackCrawlMark) {\n            if (shouldAssertFunction(1 /* Normal */, \"assertNode\")) {\n                assert(node !== undefined && (test === undefined || test(node)), message || \"Unexpected node.\", function () { return \"Node \" + formatSyntaxKind(node.kind) + \" did not pass test '\" + getFunctionName(test) + \"'.\"; }, stackCrawlMark || assertNode);\n            }\n        }\n        Debug.assertNode = assertNode;\n        function assertNotNode(node, test, message, stackCrawlMark) {\n            if (shouldAssertFunction(1 /* Normal */, \"assertNotNode\")) {\n                assert(node === undefined || test === undefined || !test(node), message || \"Unexpected node.\", function () { return \"Node \" + formatSyntaxKind(node.kind) + \" should not have passed test '\" + getFunctionName(test) + \"'.\"; }, stackCrawlMark || assertNotNode);\n            }\n        }\n        Debug.assertNotNode = assertNotNode;\n        function assertOptionalNode(node, test, message, stackCrawlMark) {\n            if (shouldAssertFunction(1 /* Normal */, \"assertOptionalNode\")) {\n                assert(test === undefined || node === undefined || test(node), message || \"Unexpected node.\", function () { return \"Node \" + formatSyntaxKind(node.kind) + \" did not pass test '\" + getFunctionName(test) + \"'.\"; }, stackCrawlMark || assertOptionalNode);\n            }\n        }\n        Debug.assertOptionalNode = assertOptionalNode;\n        function assertOptionalToken(node, kind, message, stackCrawlMark) {\n            if (shouldAssertFunction(1 /* Normal */, \"assertOptionalToken\")) {\n                assert(kind === undefined || node === undefined || node.kind === kind, message || \"Unexpected node.\", function () { return \"Node \" + formatSyntaxKind(node.kind) + \" was not a '\" + formatSyntaxKind(kind) + \"' token.\"; }, stackCrawlMark || assertOptionalToken);\n            }\n        }\n        Debug.assertOptionalToken = assertOptionalToken;\n        function assertMissingNode(node, message, stackCrawlMark) {\n            if (shouldAssertFunction(1 /* Normal */, \"assertMissingNode\")) {\n                assert(node === undefined, message || \"Unexpected node.\", function () { return \"Node \" + formatSyntaxKind(node.kind) + \" was unexpected'.\"; }, stackCrawlMark || assertMissingNode);\n            }\n        }\n        Debug.assertMissingNode = assertMissingNode;\n        function getFunctionName(func) {\n            if (typeof func !== \"function\") {\n                return \"\";\n            }\n            else if (func.hasOwnProperty(\"name\")) {\n                return func.name;\n            }\n            else {\n                var text = Function.prototype.toString.call(func);\n                var match = /^function\\s+([\\w\\$]+)\\s*\\(/.exec(text);\n                return match ? match[1] : \"\";\n            }\n        }\n        Debug.getFunctionName = getFunctionName;\n        function formatSymbol(symbol) {\n            return \"{ name: \" + ts.unescapeLeadingUnderscores(symbol.escapedName) + \"; flags: \" + formatSymbolFlags(symbol.flags) + \"; declarations: \" + ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }) + \" }\";\n        }\n        Debug.formatSymbol = formatSymbol;\n        /**\n         * Formats an enum value as a string for debugging and debug assertions.\n         */\n        function formatEnum(value, enumObject, isFlags) {\n            if (value === void 0) { value = 0; }\n            var members = getEnumMembers(enumObject);\n            if (value === 0) {\n                return members.length > 0 && members[0][0] === 0 ? members[0][1] : \"0\";\n            }\n            if (isFlags) {\n                var result = \"\";\n                var remainingFlags = value;\n                for (var _i = 0, members_1 = members; _i < members_1.length; _i++) {\n                    var _a = members_1[_i], enumValue = _a[0], enumName = _a[1];\n                    if (enumValue > value) {\n                        break;\n                    }\n                    if (enumValue !== 0 && enumValue & value) {\n                        result = \"\" + result + (result ? \"|\" : \"\") + enumName;\n                        remainingFlags &= ~enumValue;\n                    }\n                }\n                if (remainingFlags === 0) {\n                    return result;\n                }\n            }\n            else {\n                for (var _b = 0, members_2 = members; _b < members_2.length; _b++) {\n                    var _c = members_2[_b], enumValue = _c[0], enumName = _c[1];\n                    if (enumValue === value) {\n                        return enumName;\n                    }\n                }\n            }\n            return value.toString();\n        }\n        Debug.formatEnum = formatEnum;\n        function getEnumMembers(enumObject) {\n            var result = [];\n            for (var name in enumObject) {\n                var value = enumObject[name];\n                if (typeof value === \"number\") {\n                    result.push([value, name]);\n                }\n            }\n            return ts.stableSort(result, function (x, y) { return ts.compareValues(x[0], y[0]); });\n        }\n        function formatSyntaxKind(kind) {\n            return formatEnum(kind, ts.SyntaxKind, /*isFlags*/ false);\n        }\n        Debug.formatSyntaxKind = formatSyntaxKind;\n        function formatNodeFlags(flags) {\n            return formatEnum(flags, ts.NodeFlags, /*isFlags*/ true);\n        }\n        Debug.formatNodeFlags = formatNodeFlags;\n        function formatModifierFlags(flags) {\n            return formatEnum(flags, ts.ModifierFlags, /*isFlags*/ true);\n        }\n        Debug.formatModifierFlags = formatModifierFlags;\n        function formatTransformFlags(flags) {\n            return formatEnum(flags, ts.TransformFlags, /*isFlags*/ true);\n        }\n        Debug.formatTransformFlags = formatTransformFlags;\n        function formatEmitFlags(flags) {\n            return formatEnum(flags, ts.EmitFlags, /*isFlags*/ true);\n        }\n        Debug.formatEmitFlags = formatEmitFlags;\n        function formatSymbolFlags(flags) {\n            return formatEnum(flags, ts.SymbolFlags, /*isFlags*/ true);\n        }\n        Debug.formatSymbolFlags = formatSymbolFlags;\n        function formatTypeFlags(flags) {\n            return formatEnum(flags, ts.TypeFlags, /*isFlags*/ true);\n        }\n        Debug.formatTypeFlags = formatTypeFlags;\n        function formatSignatureFlags(flags) {\n            return formatEnum(flags, ts.SignatureFlags, /*isFlags*/ true);\n        }\n        Debug.formatSignatureFlags = formatSignatureFlags;\n        function formatObjectFlags(flags) {\n            return formatEnum(flags, ts.ObjectFlags, /*isFlags*/ true);\n        }\n        Debug.formatObjectFlags = formatObjectFlags;\n        function formatFlowFlags(flags) {\n            return formatEnum(flags, ts.FlowFlags, /*isFlags*/ true);\n        }\n        Debug.formatFlowFlags = formatFlowFlags;\n        var isDebugInfoEnabled = false;\n        var extendedDebugModule;\n        function extendedDebug() {\n            enableDebugInfo();\n            if (!extendedDebugModule) {\n                throw new Error(\"Debugging helpers could not be loaded.\");\n            }\n            return extendedDebugModule;\n        }\n        function printControlFlowGraph(flowNode) {\n            return console.log(formatControlFlowGraph(flowNode));\n        }\n        Debug.printControlFlowGraph = printControlFlowGraph;\n        function formatControlFlowGraph(flowNode) {\n            return extendedDebug().formatControlFlowGraph(flowNode);\n        }\n        Debug.formatControlFlowGraph = formatControlFlowGraph;\n        var flowNodeProto;\n        function attachFlowNodeDebugInfoWorker(flowNode) {\n            if (!(\"__debugFlowFlags\" in flowNode)) { // eslint-disable-line no-in-operator\n                Object.defineProperties(flowNode, {\n                    // for use with vscode-js-debug's new customDescriptionGenerator in launch.json\n                    __tsDebuggerDisplay: {\n                        value: function () {\n                            var flowHeader = this.flags & 2 /* Start */ ? \"FlowStart\" :\n                                this.flags & 4 /* BranchLabel */ ? \"FlowBranchLabel\" :\n                                    this.flags & 8 /* LoopLabel */ ? \"FlowLoopLabel\" :\n                                        this.flags & 16 /* Assignment */ ? \"FlowAssignment\" :\n                                            this.flags & 32 /* TrueCondition */ ? \"FlowTrueCondition\" :\n                                                this.flags & 64 /* FalseCondition */ ? \"FlowFalseCondition\" :\n                                                    this.flags & 128 /* SwitchClause */ ? \"FlowSwitchClause\" :\n                                                        this.flags & 256 /* ArrayMutation */ ? \"FlowArrayMutation\" :\n                                                            this.flags & 512 /* Call */ ? \"FlowCall\" :\n                                                                this.flags & 1024 /* ReduceLabel */ ? \"FlowReduceLabel\" :\n                                                                    this.flags & 1 /* Unreachable */ ? \"FlowUnreachable\" :\n                                                                        \"UnknownFlow\";\n                            var remainingFlags = this.flags & ~(2048 /* Referenced */ - 1);\n                            return \"\" + flowHeader + (remainingFlags ? \" (\" + formatFlowFlags(remainingFlags) + \")\" : \"\");\n                        }\n                    },\n                    __debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } },\n                    __debugToString: { value: function () { return formatControlFlowGraph(this); } }\n                });\n            }\n        }\n        function attachFlowNodeDebugInfo(flowNode) {\n            if (isDebugInfoEnabled) {\n                if (typeof Object.setPrototypeOf === \"function\") {\n                    // if we're in es2015, attach the method to a shared prototype for `FlowNode`\n                    // so the method doesn't show up in the watch window.\n                    if (!flowNodeProto) {\n                        flowNodeProto = Object.create(Object.prototype);\n                        attachFlowNodeDebugInfoWorker(flowNodeProto);\n                    }\n                    Object.setPrototypeOf(flowNode, flowNodeProto);\n                }\n                else {\n                    // not running in an es2015 environment, attach the method directly.\n                    attachFlowNodeDebugInfoWorker(flowNode);\n                }\n            }\n        }\n        Debug.attachFlowNodeDebugInfo = attachFlowNodeDebugInfo;\n        var nodeArrayProto;\n        function attachNodeArrayDebugInfoWorker(array) {\n            if (!(\"__tsDebuggerDisplay\" in array)) { // eslint-disable-line no-in-operator\n                Object.defineProperties(array, {\n                    __tsDebuggerDisplay: {\n                        value: function (defaultValue) {\n                            // An `Array` with extra properties is rendered as `[A, B, prop1: 1, prop2: 2]`. Most of\n                            // these aren't immediately useful so we trim off the `prop1: ..., prop2: ...` part from the\n                            // formatted string.\n                            defaultValue = String(defaultValue).replace(/(?:,[\\s\\w\\d_]+:[^,]+)+\\]$/, \"]\");\n                            return \"NodeArray \" + defaultValue;\n                        }\n                    }\n                });\n            }\n        }\n        function attachNodeArrayDebugInfo(array) {\n            if (isDebugInfoEnabled) {\n                if (typeof Object.setPrototypeOf === \"function\") {\n                    // if we're in es2015, attach the method to a shared prototype for `NodeArray`\n                    // so the method doesn't show up in the watch window.\n                    if (!nodeArrayProto) {\n                        nodeArrayProto = Object.create(Array.prototype);\n                        attachNodeArrayDebugInfoWorker(nodeArrayProto);\n                    }\n                    Object.setPrototypeOf(array, nodeArrayProto);\n                }\n                else {\n                    // not running in an es2015 environment, attach the method directly.\n                    attachNodeArrayDebugInfoWorker(array);\n                }\n            }\n        }\n        Debug.attachNodeArrayDebugInfo = attachNodeArrayDebugInfo;\n        /**\n         * Injects debug information into frequently used types.\n         */\n        function enableDebugInfo() {\n            if (isDebugInfoEnabled)\n                return;\n            // avoid recomputing\n            var weakTypeTextMap;\n            var weakNodeTextMap;\n            function getWeakTypeTextMap() {\n                if (weakTypeTextMap === undefined) {\n                    if (typeof WeakMap === \"function\")\n                        weakTypeTextMap = new WeakMap();\n                }\n                return weakTypeTextMap;\n            }\n            function getWeakNodeTextMap() {\n                if (weakNodeTextMap === undefined) {\n                    if (typeof WeakMap === \"function\")\n                        weakNodeTextMap = new WeakMap();\n                }\n                return weakNodeTextMap;\n            }\n            // Add additional properties in debug mode to assist with debugging.\n            Object.defineProperties(ts.objectAllocator.getSymbolConstructor().prototype, {\n                // for use with vscode-js-debug's new customDescriptionGenerator in launch.json\n                __tsDebuggerDisplay: {\n                    value: function () {\n                        var symbolHeader = this.flags & 33554432 /* Transient */ ? \"TransientSymbol\" :\n                            \"Symbol\";\n                        var remainingSymbolFlags = this.flags & ~33554432 /* Transient */;\n                        return symbolHeader + \" '\" + ts.symbolName(this) + \"'\" + (remainingSymbolFlags ? \" (\" + formatSymbolFlags(remainingSymbolFlags) + \")\" : \"\");\n                    }\n                },\n                __debugFlags: { get: function () { return formatSymbolFlags(this.flags); } }\n            });\n            Object.defineProperties(ts.objectAllocator.getTypeConstructor().prototype, {\n                // for use with vscode-js-debug's new customDescriptionGenerator in launch.json\n                __tsDebuggerDisplay: {\n                    value: function () {\n                        var typeHeader = this.flags & 98304 /* Nullable */ ? \"NullableType\" :\n                            this.flags & 384 /* StringOrNumberLiteral */ ? \"LiteralType \" + JSON.stringify(this.value) :\n                                this.flags & 2048 /* BigIntLiteral */ ? \"LiteralType \" + (this.value.negative ? \"-\" : \"\") + this.value.base10Value + \"n\" :\n                                    this.flags & 8192 /* UniqueESSymbol */ ? \"UniqueESSymbolType\" :\n                                        this.flags & 32 /* Enum */ ? \"EnumType\" :\n                                            this.flags & 67359327 /* Intrinsic */ ? \"IntrinsicType \" + this.intrinsicName :\n                                                this.flags & 1048576 /* Union */ ? \"UnionType\" :\n                                                    this.flags & 2097152 /* Intersection */ ? \"IntersectionType\" :\n                                                        this.flags & 4194304 /* Index */ ? \"IndexType\" :\n                                                            this.flags & 8388608 /* IndexedAccess */ ? \"IndexedAccessType\" :\n                                                                this.flags & 16777216 /* Conditional */ ? \"ConditionalType\" :\n                                                                    this.flags & 33554432 /* Substitution */ ? \"SubstitutionType\" :\n                                                                        this.flags & 262144 /* TypeParameter */ ? \"TypeParameter\" :\n                                                                            this.flags & 524288 /* Object */ ?\n                                                                                this.objectFlags & 3 /* ClassOrInterface */ ? \"InterfaceType\" :\n                                                                                    this.objectFlags & 4 /* Reference */ ? \"TypeReference\" :\n                                                                                        this.objectFlags & 8 /* Tuple */ ? \"TupleType\" :\n                                                                                            this.objectFlags & 16 /* Anonymous */ ? \"AnonymousType\" :\n                                                                                                this.objectFlags & 32 /* Mapped */ ? \"MappedType\" :\n                                                                                                    this.objectFlags & 2048 /* ReverseMapped */ ? \"ReverseMappedType\" :\n                                                                                                        this.objectFlags & 256 /* EvolvingArray */ ? \"EvolvingArrayType\" :\n                                                                                                            \"ObjectType\" :\n                                                                                \"Type\";\n                        var remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~2367 /* ObjectTypeKindMask */ : 0;\n                        return \"\" + typeHeader + (this.symbol ? \" '\" + ts.symbolName(this.symbol) + \"'\" : \"\") + (remainingObjectFlags ? \" (\" + formatObjectFlags(remainingObjectFlags) + \")\" : \"\");\n                    }\n                },\n                __debugFlags: { get: function () { return formatTypeFlags(this.flags); } },\n                __debugObjectFlags: { get: function () { return this.flags & 524288 /* Object */ ? formatObjectFlags(this.objectFlags) : \"\"; } },\n                __debugTypeToString: {\n                    value: function () {\n                        // avoid recomputing\n                        var map = getWeakTypeTextMap();\n                        var text = map === null || map === void 0 ? void 0 : map.get(this);\n                        if (text === undefined) {\n                            text = this.checker.typeToString(this);\n                            map === null || map === void 0 ? void 0 : map.set(this, text);\n                        }\n                        return text;\n                    }\n                },\n            });\n            Object.defineProperties(ts.objectAllocator.getSignatureConstructor().prototype, {\n                __debugFlags: { get: function () { return formatSignatureFlags(this.flags); } },\n                __debugSignatureToString: { value: function () { var _a; return (_a = this.checker) === null || _a === void 0 ? void 0 : _a.signatureToString(this); } }\n            });\n            var nodeConstructors = [\n                ts.objectAllocator.getNodeConstructor(),\n                ts.objectAllocator.getIdentifierConstructor(),\n                ts.objectAllocator.getTokenConstructor(),\n                ts.objectAllocator.getSourceFileConstructor()\n            ];\n            for (var _i = 0, nodeConstructors_1 = nodeConstructors; _i < nodeConstructors_1.length; _i++) {\n                var ctor = nodeConstructors_1[_i];\n                if (!ctor.prototype.hasOwnProperty(\"__debugKind\")) {\n                    Object.defineProperties(ctor.prototype, {\n                        // for use with vscode-js-debug's new customDescriptionGenerator in launch.json\n                        __tsDebuggerDisplay: {\n                            value: function () {\n                                var nodeHeader = ts.isGeneratedIdentifier(this) ? \"GeneratedIdentifier\" :\n                                    ts.isIdentifier(this) ? \"Identifier '\" + ts.idText(this) + \"'\" :\n                                        ts.isPrivateIdentifier(this) ? \"PrivateIdentifier '\" + ts.idText(this) + \"'\" :\n                                            ts.isStringLiteral(this) ? \"StringLiteral \" + JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + \"...\") :\n                                                ts.isNumericLiteral(this) ? \"NumericLiteral \" + this.text :\n                                                    ts.isBigIntLiteral(this) ? \"BigIntLiteral \" + this.text + \"n\" :\n                                                        ts.isTypeParameterDeclaration(this) ? \"TypeParameterDeclaration\" :\n                                                            ts.isParameter(this) ? \"ParameterDeclaration\" :\n                                                                ts.isConstructorDeclaration(this) ? \"ConstructorDeclaration\" :\n                                                                    ts.isGetAccessorDeclaration(this) ? \"GetAccessorDeclaration\" :\n                                                                        ts.isSetAccessorDeclaration(this) ? \"SetAccessorDeclaration\" :\n                                                                            ts.isCallSignatureDeclaration(this) ? \"CallSignatureDeclaration\" :\n                                                                                ts.isConstructSignatureDeclaration(this) ? \"ConstructSignatureDeclaration\" :\n                                                                                    ts.isIndexSignatureDeclaration(this) ? \"IndexSignatureDeclaration\" :\n                                                                                        ts.isTypePredicateNode(this) ? \"TypePredicateNode\" :\n                                                                                            ts.isTypeReferenceNode(this) ? \"TypeReferenceNode\" :\n                                                                                                ts.isFunctionTypeNode(this) ? \"FunctionTypeNode\" :\n                                                                                                    ts.isConstructorTypeNode(this) ? \"ConstructorTypeNode\" :\n                                                                                                        ts.isTypeQueryNode(this) ? \"TypeQueryNode\" :\n                                                                                                            ts.isTypeLiteralNode(this) ? \"TypeLiteralNode\" :\n                                                                                                                ts.isArrayTypeNode(this) ? \"ArrayTypeNode\" :\n                                                                                                                    ts.isTupleTypeNode(this) ? \"TupleTypeNode\" :\n                                                                                                                        ts.isOptionalTypeNode(this) ? \"OptionalTypeNode\" :\n                                                                                                                            ts.isRestTypeNode(this) ? \"RestTypeNode\" :\n                                                                                                                                ts.isUnionTypeNode(this) ? \"UnionTypeNode\" :\n                                                                                                                                    ts.isIntersectionTypeNode(this) ? \"IntersectionTypeNode\" :\n                                                                                                                                        ts.isConditionalTypeNode(this) ? \"ConditionalTypeNode\" :\n                                                                                                                                            ts.isInferTypeNode(this) ? \"InferTypeNode\" :\n                                                                                                                                                ts.isParenthesizedTypeNode(this) ? \"ParenthesizedTypeNode\" :\n                                                                                                                                                    ts.isThisTypeNode(this) ? \"ThisTypeNode\" :\n                                                                                                                                                        ts.isTypeOperatorNode(this) ? \"TypeOperatorNode\" :\n                                                                                                                                                            ts.isIndexedAccessTypeNode(this) ? \"IndexedAccessTypeNode\" :\n                                                                                                                                                                ts.isMappedTypeNode(this) ? \"MappedTypeNode\" :\n                                                                                                                                                                    ts.isLiteralTypeNode(this) ? \"LiteralTypeNode\" :\n                                                                                                                                                                        ts.isNamedTupleMember(this) ? \"NamedTupleMember\" :\n                                                                                                                                                                            ts.isImportTypeNode(this) ? \"ImportTypeNode\" :\n                                                                                                                                                                                formatSyntaxKind(this.kind);\n                                return \"\" + nodeHeader + (this.flags ? \" (\" + formatNodeFlags(this.flags) + \")\" : \"\");\n                            }\n                        },\n                        __debugKind: { get: function () { return formatSyntaxKind(this.kind); } },\n                        __debugNodeFlags: { get: function () { return formatNodeFlags(this.flags); } },\n                        __debugModifierFlags: { get: function () { return formatModifierFlags(ts.getEffectiveModifierFlagsNoCache(this)); } },\n                        __debugTransformFlags: { get: function () { return formatTransformFlags(this.transformFlags); } },\n                        __debugIsParseTreeNode: { get: function () { return ts.isParseTreeNode(this); } },\n                        __debugEmitFlags: { get: function () { return formatEmitFlags(ts.getEmitFlags(this)); } },\n                        __debugGetText: {\n                            value: function (includeTrivia) {\n                                if (ts.nodeIsSynthesized(this))\n                                    return \"\";\n                                // avoid recomputing\n                                var map = getWeakNodeTextMap();\n                                var text = map === null || map === void 0 ? void 0 : map.get(this);\n                                if (text === undefined) {\n                                    var parseNode = ts.getParseTreeNode(this);\n                                    var sourceFile = parseNode && ts.getSourceFileOfNode(parseNode);\n                                    text = sourceFile ? ts.getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : \"\";\n                                    map === null || map === void 0 ? void 0 : map.set(this, text);\n                                }\n                                return text;\n                            }\n                        }\n                    });\n                }\n            }\n            // attempt to load extended debugging information\n            try {\n                if (ts.sys && ts.sys.require) {\n                    var basePath = ts.getDirectoryPath(ts.resolvePath(ts.sys.getExecutingFilePath()));\n                    // MONACOCHANGE\n                    var result = undefined;\n                    // END MONACOCHANGE\n                    if (!result.error) {\n                        result.module.init(ts);\n                        extendedDebugModule = result.module;\n                    }\n                }\n            }\n            catch (_a) {\n                // do nothing\n            }\n            isDebugInfoEnabled = true;\n        }\n        Debug.enableDebugInfo = enableDebugInfo;\n        function formatDeprecationMessage(name, error, errorAfter, since, message) {\n            var deprecationMessage = error ? \"DeprecationError: \" : \"DeprecationWarning: \";\n            deprecationMessage += \"'\" + name + \"' \";\n            deprecationMessage += since ? \"has been deprecated since v\" + since : \"is deprecated\";\n            deprecationMessage += error ? \" and can no longer be used.\" : errorAfter ? \" and will no longer be usable after v\" + errorAfter + \".\" : \".\";\n            deprecationMessage += message ? \" \" + ts.formatStringFromArgs(message, [name], 0) : \"\";\n            return deprecationMessage;\n        }\n        function createErrorDeprecation(name, errorAfter, since, message) {\n            var deprecationMessage = formatDeprecationMessage(name, /*error*/ true, errorAfter, since, message);\n            return function () {\n                throw new TypeError(deprecationMessage);\n            };\n        }\n        function createWarningDeprecation(name, errorAfter, since, message) {\n            var hasWrittenDeprecation = false;\n            return function () {\n                if (!hasWrittenDeprecation) {\n                    log.warn(formatDeprecationMessage(name, /*error*/ false, errorAfter, since, message));\n                    hasWrittenDeprecation = true;\n                }\n            };\n        }\n        function createDeprecation(name, options) {\n            var _a, _b;\n            if (options === void 0) { options = {}; }\n            var version = typeof options.typeScriptVersion === \"string\" ? new ts.Version(options.typeScriptVersion) : (_a = options.typeScriptVersion) !== null && _a !== void 0 ? _a : getTypeScriptVersion();\n            var errorAfter = typeof options.errorAfter === \"string\" ? new ts.Version(options.errorAfter) : options.errorAfter;\n            var warnAfter = typeof options.warnAfter === \"string\" ? new ts.Version(options.warnAfter) : options.warnAfter;\n            var since = typeof options.since === \"string\" ? new ts.Version(options.since) : (_b = options.since) !== null && _b !== void 0 ? _b : warnAfter;\n            var error = options.error || errorAfter && version.compareTo(errorAfter) <= 0;\n            var warn = !warnAfter || version.compareTo(warnAfter) >= 0;\n            return error ? createErrorDeprecation(name, errorAfter, since, options.message) :\n                warn ? createWarningDeprecation(name, errorAfter, since, options.message) :\n                    ts.noop;\n        }\n        function wrapFunction(deprecation, func) {\n            return function () {\n                deprecation();\n                return func.apply(this, arguments);\n            };\n        }\n        function deprecate(func, options) {\n            var deprecation = createDeprecation(getFunctionName(func), options);\n            return wrapFunction(deprecation, func);\n        }\n        Debug.deprecate = deprecate;\n    })(Debug = ts.Debug || (ts.Debug = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    // https://semver.org/#spec-item-2\n    // > A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative\n    // > integers, and MUST NOT contain leading zeroes. X is the major version, Y is the minor\n    // > version, and Z is the patch version. Each element MUST increase numerically.\n    //\n    // NOTE: We differ here in that we allow X and X.Y, with missing parts having the default\n    // value of `0`.\n    var versionRegExp = /^(0|[1-9]\\d*)(?:\\.(0|[1-9]\\d*)(?:\\.(0|[1-9]\\d*)(?:\\-([a-z0-9-.]+))?(?:\\+([a-z0-9-.]+))?)?)?$/i;\n    // https://semver.org/#spec-item-9\n    // > A pre-release version MAY be denoted by appending a hyphen and a series of dot separated\n    // > identifiers immediately following the patch version. Identifiers MUST comprise only ASCII\n    // > alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers\n    // > MUST NOT include leading zeroes.\n    var prereleaseRegExp = /^(?:0|[1-9]\\d*|[a-z-][a-z0-9-]*)(?:\\.(?:0|[1-9]\\d*|[a-z-][a-z0-9-]*))*$/i;\n    // https://semver.org/#spec-item-10\n    // > Build metadata MAY be denoted by appending a plus sign and a series of dot separated\n    // > identifiers immediately following the patch or pre-release version. Identifiers MUST\n    // > comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty.\n    var buildRegExp = /^[a-z0-9-]+(?:\\.[a-z0-9-]+)*$/i;\n    // https://semver.org/#spec-item-9\n    // > Numeric identifiers MUST NOT include leading zeroes.\n    var numericIdentifierRegExp = /^(0|[1-9]\\d*)$/;\n    /**\n     * Describes a precise semantic version number, https://semver.org\n     */\n    var Version = /** @class */ (function () {\n        function Version(major, minor, patch, prerelease, build) {\n            if (minor === void 0) { minor = 0; }\n            if (patch === void 0) { patch = 0; }\n            if (prerelease === void 0) { prerelease = \"\"; }\n            if (build === void 0) { build = \"\"; }\n            if (typeof major === \"string\") {\n                var result = ts.Debug.checkDefined(tryParseComponents(major), \"Invalid version\");\n                (major = result.major, minor = result.minor, patch = result.patch, prerelease = result.prerelease, build = result.build);\n            }\n            ts.Debug.assert(major >= 0, \"Invalid argument: major\");\n            ts.Debug.assert(minor >= 0, \"Invalid argument: minor\");\n            ts.Debug.assert(patch >= 0, \"Invalid argument: patch\");\n            ts.Debug.assert(!prerelease || prereleaseRegExp.test(prerelease), \"Invalid argument: prerelease\");\n            ts.Debug.assert(!build || buildRegExp.test(build), \"Invalid argument: build\");\n            this.major = major;\n            this.minor = minor;\n            this.patch = patch;\n            this.prerelease = prerelease ? prerelease.split(\".\") : ts.emptyArray;\n            this.build = build ? build.split(\".\") : ts.emptyArray;\n        }\n        Version.tryParse = function (text) {\n            var result = tryParseComponents(text);\n            if (!result)\n                return undefined;\n            var major = result.major, minor = result.minor, patch = result.patch, prerelease = result.prerelease, build = result.build;\n            return new Version(major, minor, patch, prerelease, build);\n        };\n        Version.prototype.compareTo = function (other) {\n            // https://semver.org/#spec-item-11\n            // > Precedence is determined by the first difference when comparing each of these\n            // > identifiers from left to right as follows: Major, minor, and patch versions are\n            // > always compared numerically.\n            //\n            // https://semver.org/#spec-item-11\n            // > Precedence for two pre-release versions with the same major, minor, and patch version\n            // > MUST be determined by comparing each dot separated identifier from left to right until\n            // > a difference is found [...]\n            //\n            // https://semver.org/#spec-item-11\n            // > Build metadata does not figure into precedence\n            if (this === other)\n                return 0 /* EqualTo */;\n            if (other === undefined)\n                return 1 /* GreaterThan */;\n            return ts.compareValues(this.major, other.major)\n                || ts.compareValues(this.minor, other.minor)\n                || ts.compareValues(this.patch, other.patch)\n                || comparePrereleaseIdentifiers(this.prerelease, other.prerelease);\n        };\n        Version.prototype.increment = function (field) {\n            switch (field) {\n                case \"major\": return new Version(this.major + 1, 0, 0);\n                case \"minor\": return new Version(this.major, this.minor + 1, 0);\n                case \"patch\": return new Version(this.major, this.minor, this.patch + 1);\n                default: return ts.Debug.assertNever(field);\n            }\n        };\n        Version.prototype.toString = function () {\n            var result = this.major + \".\" + this.minor + \".\" + this.patch;\n            if (ts.some(this.prerelease))\n                result += \"-\" + this.prerelease.join(\".\");\n            if (ts.some(this.build))\n                result += \"+\" + this.build.join(\".\");\n            return result;\n        };\n        Version.zero = new Version(0, 0, 0);\n        return Version;\n    }());\n    ts.Version = Version;\n    function tryParseComponents(text) {\n        var match = versionRegExp.exec(text);\n        if (!match)\n            return undefined;\n        var major = match[1], _a = match[2], minor = _a === void 0 ? \"0\" : _a, _b = match[3], patch = _b === void 0 ? \"0\" : _b, _c = match[4], prerelease = _c === void 0 ? \"\" : _c, _d = match[5], build = _d === void 0 ? \"\" : _d;\n        if (prerelease && !prereleaseRegExp.test(prerelease))\n            return undefined;\n        if (build && !buildRegExp.test(build))\n            return undefined;\n        return {\n            major: parseInt(major, 10),\n            minor: parseInt(minor, 10),\n            patch: parseInt(patch, 10),\n            prerelease: prerelease,\n            build: build\n        };\n    }\n    function comparePrereleaseIdentifiers(left, right) {\n        // https://semver.org/#spec-item-11\n        // > When major, minor, and patch are equal, a pre-release version has lower precedence\n        // > than a normal version.\n        if (left === right)\n            return 0 /* EqualTo */;\n        if (left.length === 0)\n            return right.length === 0 ? 0 /* EqualTo */ : 1 /* GreaterThan */;\n        if (right.length === 0)\n            return -1 /* LessThan */;\n        // https://semver.org/#spec-item-11\n        // > Precedence for two pre-release versions with the same major, minor, and patch version\n        // > MUST be determined by comparing each dot separated identifier from left to right until\n        // > a difference is found [...]\n        var length = Math.min(left.length, right.length);\n        for (var i = 0; i < length; i++) {\n            var leftIdentifier = left[i];\n            var rightIdentifier = right[i];\n            if (leftIdentifier === rightIdentifier)\n                continue;\n            var leftIsNumeric = numericIdentifierRegExp.test(leftIdentifier);\n            var rightIsNumeric = numericIdentifierRegExp.test(rightIdentifier);\n            if (leftIsNumeric || rightIsNumeric) {\n                // https://semver.org/#spec-item-11\n                // > Numeric identifiers always have lower precedence than non-numeric identifiers.\n                if (leftIsNumeric !== rightIsNumeric)\n                    return leftIsNumeric ? -1 /* LessThan */ : 1 /* GreaterThan */;\n                // https://semver.org/#spec-item-11\n                // > identifiers consisting of only digits are compared numerically\n                var result = ts.compareValues(+leftIdentifier, +rightIdentifier);\n                if (result)\n                    return result;\n            }\n            else {\n                // https://semver.org/#spec-item-11\n                // > identifiers with letters or hyphens are compared lexically in ASCII sort order.\n                var result = ts.compareStringsCaseSensitive(leftIdentifier, rightIdentifier);\n                if (result)\n                    return result;\n            }\n        }\n        // https://semver.org/#spec-item-11\n        // > A larger set of pre-release fields has a higher precedence than a smaller set, if all\n        // > of the preceding identifiers are equal.\n        return ts.compareValues(left.length, right.length);\n    }\n    /**\n     * Describes a semantic version range, per https://github.com/npm/node-semver#ranges\n     */\n    var VersionRange = /** @class */ (function () {\n        function VersionRange(spec) {\n            this._alternatives = spec ? ts.Debug.checkDefined(parseRange(spec), \"Invalid range spec.\") : ts.emptyArray;\n        }\n        VersionRange.tryParse = function (text) {\n            var sets = parseRange(text);\n            if (sets) {\n                var range = new VersionRange(\"\");\n                range._alternatives = sets;\n                return range;\n            }\n            return undefined;\n        };\n        VersionRange.prototype.test = function (version) {\n            if (typeof version === \"string\")\n                version = new Version(version);\n            return testDisjunction(version, this._alternatives);\n        };\n        VersionRange.prototype.toString = function () {\n            return formatDisjunction(this._alternatives);\n        };\n        return VersionRange;\n    }());\n    ts.VersionRange = VersionRange;\n    // https://github.com/npm/node-semver#range-grammar\n    //\n    // range-set    ::= range ( logical-or range ) *\n    // range        ::= hyphen | simple ( ' ' simple ) * | ''\n    // logical-or   ::= ( ' ' ) * '||' ( ' ' ) *\n    var logicalOrRegExp = /\\s*\\|\\|\\s*/g;\n    var whitespaceRegExp = /\\s+/g;\n    // https://github.com/npm/node-semver#range-grammar\n    //\n    // partial      ::= xr ( '.' xr ( '.' xr qualifier ? )? )?\n    // xr           ::= 'x' | 'X' | '*' | nr\n    // nr           ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *\n    // qualifier    ::= ( '-' pre )? ( '+' build )?\n    // pre          ::= parts\n    // build        ::= parts\n    // parts        ::= part ( '.' part ) *\n    // part         ::= nr | [-0-9A-Za-z]+\n    var partialRegExp = /^([xX*0]|[1-9]\\d*)(?:\\.([xX*0]|[1-9]\\d*)(?:\\.([xX*0]|[1-9]\\d*)(?:-([a-z0-9-.]+))?(?:\\+([a-z0-9-.]+))?)?)?$/i;\n    // https://github.com/npm/node-semver#range-grammar\n    //\n    // hyphen       ::= partial ' - ' partial\n    var hyphenRegExp = /^\\s*([a-z0-9-+.*]+)\\s+-\\s+([a-z0-9-+.*]+)\\s*$/i;\n    // https://github.com/npm/node-semver#range-grammar\n    //\n    // simple       ::= primitive | partial | tilde | caret\n    // primitive    ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial\n    // tilde        ::= '~' partial\n    // caret        ::= '^' partial\n    var rangeRegExp = /^\\s*(~|\\^|<|<=|>|>=|=)?\\s*([a-z0-9-+.*]+)$/i;\n    function parseRange(text) {\n        var alternatives = [];\n        for (var _i = 0, _a = text.trim().split(logicalOrRegExp); _i < _a.length; _i++) {\n            var range = _a[_i];\n            if (!range)\n                continue;\n            var comparators = [];\n            var match = hyphenRegExp.exec(range);\n            if (match) {\n                if (!parseHyphen(match[1], match[2], comparators))\n                    return undefined;\n            }\n            else {\n                for (var _b = 0, _c = range.split(whitespaceRegExp); _b < _c.length; _b++) {\n                    var simple = _c[_b];\n                    var match_1 = rangeRegExp.exec(simple);\n                    if (!match_1 || !parseComparator(match_1[1], match_1[2], comparators))\n                        return undefined;\n                }\n            }\n            alternatives.push(comparators);\n        }\n        return alternatives;\n    }\n    function parsePartial(text) {\n        var match = partialRegExp.exec(text);\n        if (!match)\n            return undefined;\n        var major = match[1], _a = match[2], minor = _a === void 0 ? \"*\" : _a, _b = match[3], patch = _b === void 0 ? \"*\" : _b, prerelease = match[4], build = match[5];\n        var version = new Version(isWildcard(major) ? 0 : parseInt(major, 10), isWildcard(major) || isWildcard(minor) ? 0 : parseInt(minor, 10), isWildcard(major) || isWildcard(minor) || isWildcard(patch) ? 0 : parseInt(patch, 10), prerelease, build);\n        return { version: version, major: major, minor: minor, patch: patch };\n    }\n    function parseHyphen(left, right, comparators) {\n        var leftResult = parsePartial(left);\n        if (!leftResult)\n            return false;\n        var rightResult = parsePartial(right);\n        if (!rightResult)\n            return false;\n        if (!isWildcard(leftResult.major)) {\n            comparators.push(createComparator(\">=\", leftResult.version));\n        }\n        if (!isWildcard(rightResult.major)) {\n            comparators.push(isWildcard(rightResult.minor) ? createComparator(\"<\", rightResult.version.increment(\"major\")) :\n                isWildcard(rightResult.patch) ? createComparator(\"<\", rightResult.version.increment(\"minor\")) :\n                    createComparator(\"<=\", rightResult.version));\n        }\n        return true;\n    }\n    function parseComparator(operator, text, comparators) {\n        var result = parsePartial(text);\n        if (!result)\n            return false;\n        var version = result.version, major = result.major, minor = result.minor, patch = result.patch;\n        if (!isWildcard(major)) {\n            switch (operator) {\n                case \"~\":\n                    comparators.push(createComparator(\">=\", version));\n                    comparators.push(createComparator(\"<\", version.increment(isWildcard(minor) ? \"major\" :\n                        \"minor\")));\n                    break;\n                case \"^\":\n                    comparators.push(createComparator(\">=\", version));\n                    comparators.push(createComparator(\"<\", version.increment(version.major > 0 || isWildcard(minor) ? \"major\" :\n                        version.minor > 0 || isWildcard(patch) ? \"minor\" :\n                            \"patch\")));\n                    break;\n                case \"<\":\n                case \">=\":\n                    comparators.push(createComparator(operator, version));\n                    break;\n                case \"<=\":\n                case \">\":\n                    comparators.push(isWildcard(minor) ? createComparator(operator === \"<=\" ? \"<\" : \">=\", version.increment(\"major\")) :\n                        isWildcard(patch) ? createComparator(operator === \"<=\" ? \"<\" : \">=\", version.increment(\"minor\")) :\n                            createComparator(operator, version));\n                    break;\n                case \"=\":\n                case undefined:\n                    if (isWildcard(minor) || isWildcard(patch)) {\n                        comparators.push(createComparator(\">=\", version));\n                        comparators.push(createComparator(\"<\", version.increment(isWildcard(minor) ? \"major\" : \"minor\")));\n                    }\n                    else {\n                        comparators.push(createComparator(\"=\", version));\n                    }\n                    break;\n                default:\n                    // unrecognized\n                    return false;\n            }\n        }\n        else if (operator === \"<\" || operator === \">\") {\n            comparators.push(createComparator(\"<\", Version.zero));\n        }\n        return true;\n    }\n    function isWildcard(part) {\n        return part === \"*\" || part === \"x\" || part === \"X\";\n    }\n    function createComparator(operator, operand) {\n        return { operator: operator, operand: operand };\n    }\n    function testDisjunction(version, alternatives) {\n        // an empty disjunction is treated as \"*\" (all versions)\n        if (alternatives.length === 0)\n            return true;\n        for (var _i = 0, alternatives_1 = alternatives; _i < alternatives_1.length; _i++) {\n            var alternative = alternatives_1[_i];\n            if (testAlternative(version, alternative))\n                return true;\n        }\n        return false;\n    }\n    function testAlternative(version, comparators) {\n        for (var _i = 0, comparators_1 = comparators; _i < comparators_1.length; _i++) {\n            var comparator = comparators_1[_i];\n            if (!testComparator(version, comparator.operator, comparator.operand))\n                return false;\n        }\n        return true;\n    }\n    function testComparator(version, operator, operand) {\n        var cmp = version.compareTo(operand);\n        switch (operator) {\n            case \"<\": return cmp < 0;\n            case \"<=\": return cmp <= 0;\n            case \">\": return cmp > 0;\n            case \">=\": return cmp >= 0;\n            case \"=\": return cmp === 0;\n            default: return ts.Debug.assertNever(operator);\n        }\n    }\n    function formatDisjunction(alternatives) {\n        return ts.map(alternatives, formatAlternative).join(\" || \") || \"*\";\n    }\n    function formatAlternative(comparators) {\n        return ts.map(comparators, formatComparator).join(\" \");\n    }\n    function formatComparator(comparator) {\n        return \"\" + comparator.operator + comparator.operand;\n    }\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    // The following definitions provide the minimum compatible support for the Web Performance User Timings API\n    // between browsers and NodeJS:\n    // eslint-disable-next-line @typescript-eslint/naming-convention\n    function hasRequiredAPI(performance, PerformanceObserver) {\n        return typeof performance === \"object\" &&\n            typeof performance.timeOrigin === \"number\" &&\n            typeof performance.mark === \"function\" &&\n            typeof performance.measure === \"function\" &&\n            typeof performance.now === \"function\" &&\n            typeof PerformanceObserver === \"function\";\n    }\n    function tryGetWebPerformanceHooks() {\n        if (typeof performance === \"object\" &&\n            typeof PerformanceObserver === \"function\" &&\n            hasRequiredAPI(performance, PerformanceObserver)) {\n            return {\n                // For now we always write native performance events when running in the browser. We may\n                // make this conditional in the future if we find that native web performance hooks\n                // in the browser also slow down compilation.\n                shouldWriteNativeEvents: true,\n                performance: performance,\n                PerformanceObserver: PerformanceObserver\n            };\n        }\n    }\n    function tryGetNodePerformanceHooks() {\n        if (typeof process !== \"undefined\" && process.nextTick && !process.browser && \"object\" === \"object\" && \"function\" === \"function\") {\n            try {\n                var performance_1;\n                var _a /* MONACOCHANGE */= {}/* END MONACOCHANGE */, nodePerformance_1 = _a.performance, PerformanceObserver_1 = _a.PerformanceObserver;\n                if (hasRequiredAPI(nodePerformance_1, PerformanceObserver_1)) {\n                    performance_1 = nodePerformance_1;\n                    // There is a bug in Node's performance.measure prior to 12.16.3/13.13.0 that does not\n                    // match the Web Performance API specification. Node's implementation did not allow\n                    // optional `start` and `end` arguments for `performance.measure`.\n                    // See https://github.com/nodejs/node/pull/32651 for more information.\n                    var version_1 = new ts.Version(process.versions.node);\n                    var range = new ts.VersionRange(\"<12.16.3 || 13 <13.13\");\n                    if (range.test(version_1)) {\n                        performance_1 = {\n                            get timeOrigin() { return nodePerformance_1.timeOrigin; },\n                            now: function () { return nodePerformance_1.now(); },\n                            mark: function (name) { return nodePerformance_1.mark(name); },\n                            measure: function (name, start, end) {\n                                if (start === void 0) { start = \"nodeStart\"; }\n                                if (end === undefined) {\n                                    end = \"__performance.measure-fix__\";\n                                    nodePerformance_1.mark(end);\n                                }\n                                nodePerformance_1.measure(name, start, end);\n                                if (end === \"__performance.measure-fix__\") {\n                                    nodePerformance_1.clearMarks(\"__performance.measure-fix__\");\n                                }\n                            }\n                        };\n                    }\n                    return {\n                        // By default, only write native events when generating a cpu profile or using the v8 profiler.\n                        shouldWriteNativeEvents: false,\n                        performance: performance_1,\n                        PerformanceObserver: PerformanceObserver_1\n                    };\n                }\n            }\n            catch (_b) {\n                // ignore errors\n            }\n        }\n    }\n    // Unlike with the native Map/Set 'tryGet' functions in corePublic.ts, we eagerly evaluate these\n    // since we will need them for `timestamp`, below.\n    var nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks();\n    var nativePerformance = nativePerformanceHooks === null || nativePerformanceHooks === void 0 ? void 0 : nativePerformanceHooks.performance;\n    function tryGetNativePerformanceHooks() {\n        return nativePerformanceHooks;\n    }\n    ts.tryGetNativePerformanceHooks = tryGetNativePerformanceHooks;\n    /** Gets a timestamp with (at least) ms resolution */\n    ts.timestamp = nativePerformance ? function () { return nativePerformance.now(); } :\n        Date.now ? Date.now :\n            function () { return +(new Date()); };\n})(ts || (ts = {}));\n/*@internal*/\n/** Performance measurements for the compiler. */\nvar ts;\n(function (ts) {\n    var performance;\n    (function (performance) {\n        var perfHooks;\n        // when set, indicates the implementation of `Performance` to use for user timing.\n        // when unset, indicates user timing is unavailable or disabled.\n        var performanceImpl;\n        function createTimerIf(condition, measureName, startMarkName, endMarkName) {\n            return condition ? createTimer(measureName, startMarkName, endMarkName) : performance.nullTimer;\n        }\n        performance.createTimerIf = createTimerIf;\n        function createTimer(measureName, startMarkName, endMarkName) {\n            var enterCount = 0;\n            return {\n                enter: enter,\n                exit: exit\n            };\n            function enter() {\n                if (++enterCount === 1) {\n                    mark(startMarkName);\n                }\n            }\n            function exit() {\n                if (--enterCount === 0) {\n                    mark(endMarkName);\n                    measure(measureName, startMarkName, endMarkName);\n                }\n                else if (enterCount < 0) {\n                    ts.Debug.fail(\"enter/exit count does not match.\");\n                }\n            }\n        }\n        performance.createTimer = createTimer;\n        performance.nullTimer = { enter: ts.noop, exit: ts.noop };\n        var enabled = false;\n        var timeorigin = ts.timestamp();\n        var marks = new ts.Map();\n        var counts = new ts.Map();\n        var durations = new ts.Map();\n        /**\n         * Marks a performance event.\n         *\n         * @param markName The name of the mark.\n         */\n        function mark(markName) {\n            var _a;\n            if (enabled) {\n                var count = (_a = counts.get(markName)) !== null && _a !== void 0 ? _a : 0;\n                counts.set(markName, count + 1);\n                marks.set(markName, ts.timestamp());\n                performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.mark(markName);\n            }\n        }\n        performance.mark = mark;\n        /**\n         * Adds a performance measurement with the specified name.\n         *\n         * @param measureName The name of the performance measurement.\n         * @param startMarkName The name of the starting mark. If not supplied, the point at which the\n         *      profiler was enabled is used.\n         * @param endMarkName The name of the ending mark. If not supplied, the current timestamp is\n         *      used.\n         */\n        function measure(measureName, startMarkName, endMarkName) {\n            var _a, _b;\n            if (enabled) {\n                var end = (_a = (endMarkName !== undefined ? marks.get(endMarkName) : undefined)) !== null && _a !== void 0 ? _a : ts.timestamp();\n                var start = (_b = (startMarkName !== undefined ? marks.get(startMarkName) : undefined)) !== null && _b !== void 0 ? _b : timeorigin;\n                var previousDuration = durations.get(measureName) || 0;\n                durations.set(measureName, previousDuration + (end - start));\n                performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.measure(measureName, startMarkName, endMarkName);\n            }\n        }\n        performance.measure = measure;\n        /**\n         * Gets the number of times a marker was encountered.\n         *\n         * @param markName The name of the mark.\n         */\n        function getCount(markName) {\n            return counts.get(markName) || 0;\n        }\n        performance.getCount = getCount;\n        /**\n         * Gets the total duration of all measurements with the supplied name.\n         *\n         * @param measureName The name of the measure whose durations should be accumulated.\n         */\n        function getDuration(measureName) {\n            return durations.get(measureName) || 0;\n        }\n        performance.getDuration = getDuration;\n        /**\n         * Iterate over each measure, performing some action\n         *\n         * @param cb The action to perform for each measure\n         */\n        function forEachMeasure(cb) {\n            durations.forEach(function (duration, measureName) { return cb(measureName, duration); });\n        }\n        performance.forEachMeasure = forEachMeasure;\n        /**\n         * Indicates whether the performance API is enabled.\n         */\n        function isEnabled() {\n            return enabled;\n        }\n        performance.isEnabled = isEnabled;\n        /** Enables (and resets) performance measurements for the compiler. */\n        function enable(system) {\n            var _a;\n            if (system === void 0) { system = ts.sys; }\n            if (!enabled) {\n                enabled = true;\n                perfHooks || (perfHooks = ts.tryGetNativePerformanceHooks());\n                if (perfHooks) {\n                    timeorigin = perfHooks.performance.timeOrigin;\n                    // NodeJS's Web Performance API is currently slower than expected, but we'd still like\n                    // to be able to leverage native trace events when node is run with either `--cpu-prof`\n                    // or `--prof`, if we're running with our own `--generateCpuProfile` flag, or when\n                    // running in debug mode (since its possible to generate a cpu profile while debugging).\n                    if (perfHooks.shouldWriteNativeEvents || ((_a = system === null || system === void 0 ? void 0 : system.cpuProfilingEnabled) === null || _a === void 0 ? void 0 : _a.call(system)) || (system === null || system === void 0 ? void 0 : system.debugMode)) {\n                        performanceImpl = perfHooks.performance;\n                    }\n                }\n            }\n            return true;\n        }\n        performance.enable = enable;\n        /** Disables performance measurements for the compiler. */\n        function disable() {\n            if (enabled) {\n                marks.clear();\n                counts.clear();\n                durations.clear();\n                performanceImpl = undefined;\n                enabled = false;\n            }\n        }\n        performance.disable = disable;\n    })(performance = ts.performance || (ts.performance = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var _a;\n    var nullLogger = {\n        logEvent: ts.noop,\n        logErrEvent: ts.noop,\n        logPerfEvent: ts.noop,\n        logInfoEvent: ts.noop,\n        logStartCommand: ts.noop,\n        logStopCommand: ts.noop,\n        logStartUpdateProgram: ts.noop,\n        logStopUpdateProgram: ts.noop,\n        logStartUpdateGraph: ts.noop,\n        logStopUpdateGraph: ts.noop,\n        logStartResolveModule: ts.noop,\n        logStopResolveModule: ts.noop,\n        logStartParseSourceFile: ts.noop,\n        logStopParseSourceFile: ts.noop,\n        logStartReadFile: ts.noop,\n        logStopReadFile: ts.noop,\n        logStartBindFile: ts.noop,\n        logStopBindFile: ts.noop,\n        logStartScheduledOperation: ts.noop,\n        logStopScheduledOperation: ts.noop,\n    };\n    // Load optional module to enable Event Tracing for Windows\n    // See https://github.com/microsoft/typescript-etw for more information\n    var etwModule;\n    try {\n        var etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) !== null && _a !== void 0 ? _a : \"./node_modules/@microsoft/typescript-etw\";\n        // require() will throw an exception if the module is not found\n        // It may also return undefined if not installed properly\n        // MONACOCHANGE\n        etwModule = undefined;\n        // END MONACOCHANGE\n    }\n    catch (e) {\n        etwModule = undefined;\n    }\n    /** Performance logger that will generate ETW events if possible - check for `logEvent` member, as `etwModule` will be `{}` when browserified */\n    ts.perfLogger = etwModule && etwModule.logEvent ? etwModule : nullLogger;\n})(ts || (ts = {}));\n/* Tracing events for the compiler. */\n/*@internal*/\nvar ts;\n(function (ts) {\n    // enable the above using startTracing()\n})(ts || (ts = {}));\n// `tracingEnabled` should never be used directly, only through the above\n/* @internal */\n(function (ts) {\n    var tracingEnabled;\n    (function (tracingEnabled) {\n        var Mode;\n        (function (Mode) {\n            Mode[Mode[\"Project\"] = 0] = \"Project\";\n            Mode[Mode[\"Build\"] = 1] = \"Build\";\n            Mode[Mode[\"Server\"] = 2] = \"Server\";\n        })(Mode = tracingEnabled.Mode || (tracingEnabled.Mode = {}));\n        var fs;\n        var traceCount = 0;\n        var traceFd = 0;\n        var mode;\n        var legendPath;\n        var legend = [];\n        ;\n        /** Starts tracing for the given project. */\n        function startTracing(tracingMode, traceDir, configFilePath) {\n            ts.Debug.assert(!ts.tracing, \"Tracing already started\");\n            if (fs === undefined) {\n                try {\n                    // MONACOCHANGE\n                    fs = undefined;\n                    // END MONACOCHANGE\n                }\n                catch (e) {\n                    throw new Error(\"tracing requires having fs\\n(original error: \" + (e.message || e) + \")\");\n                }\n            }\n            mode = tracingMode;\n            if (legendPath === undefined) {\n                legendPath = ts.combinePaths(traceDir, \"legend.json\");\n            }\n            // Note that writing will fail later on if it exists and is not a directory\n            if (!fs.existsSync(traceDir)) {\n                fs.mkdirSync(traceDir, { recursive: true });\n            }\n            var countPart = mode === 1 /* Build */ ? \".\" + process.pid + \"-\" + ++traceCount\n                : mode === 2 /* Server */ ? \".\" + process.pid\n                    : \"\";\n            var tracePath = ts.combinePaths(traceDir, \"trace\" + countPart + \".json\");\n            var typesPath = ts.combinePaths(traceDir, \"types\" + countPart + \".json\");\n            legend.push({\n                configFilePath: configFilePath,\n                tracePath: tracePath,\n                typesPath: typesPath,\n            });\n            traceFd = fs.openSync(tracePath, \"w\");\n            ts.tracing = tracingEnabled; // only when traceFd is properly set\n            // Start with a prefix that contains some metadata that the devtools profiler expects (also avoids a warning on import)\n            var meta = { cat: \"__metadata\", ph: \"M\", ts: 1000 * ts.timestamp(), pid: 1, tid: 1 };\n            fs.writeSync(traceFd, \"[\\n\"\n                + [__assign({ name: \"process_name\", args: { name: \"tsc\" } }, meta), __assign({ name: \"thread_name\", args: { name: \"Main\" } }, meta), __assign(__assign({ name: \"TracingStartedInBrowser\" }, meta), { cat: \"disabled-by-default-devtools.timeline\" })]\n                    .map(function (v) { return JSON.stringify(v); }).join(\",\\n\"));\n        }\n        tracingEnabled.startTracing = startTracing;\n        /** Stops tracing for the in-progress project and dumps the type catalog. */\n        function stopTracing(typeCatalog) {\n            ts.Debug.assert(ts.tracing, \"Tracing is not in progress\");\n            ts.Debug.assert(!!typeCatalog === (mode !== 2 /* Server */)); // Have a type catalog iff not in server mode\n            fs.writeSync(traceFd, \"\\n]\\n\");\n            fs.closeSync(traceFd);\n            ts.tracing = undefined;\n            if (typeCatalog) {\n                dumpTypes(typeCatalog);\n            }\n            else {\n                // We pre-computed this path for convenience, but clear it\n                // now that the file won't be created.\n                legend[legend.length - 1].typesPath = undefined;\n            }\n        }\n        tracingEnabled.stopTracing = stopTracing;\n        var Phase;\n        (function (Phase) {\n            Phase[\"Parse\"] = \"parse\";\n            Phase[\"Program\"] = \"program\";\n            Phase[\"Bind\"] = \"bind\";\n            Phase[\"Check\"] = \"check\";\n            Phase[\"CheckTypes\"] = \"checkTypes\";\n            Phase[\"Emit\"] = \"emit\";\n            Phase[\"Session\"] = \"session\";\n        })(Phase = tracingEnabled.Phase || (tracingEnabled.Phase = {}));\n        function instant(phase, name, args) {\n            writeEvent(\"I\", phase, name, args, \"\\\"s\\\":\\\"g\\\"\");\n        }\n        tracingEnabled.instant = instant;\n        var eventStack = [];\n        /**\n         * @param separateBeginAndEnd - used for special cases where we need the trace point even if the event\n         * never terminates (typically for reducing a scenario too big to trace to one that can be completed).\n         * In the future we might implement an exit handler to dump unfinished events which would deprecate\n         * these operations.\n         */\n        function push(phase, name, args, separateBeginAndEnd) {\n            if (separateBeginAndEnd === void 0) { separateBeginAndEnd = false; }\n            if (separateBeginAndEnd) {\n                writeEvent(\"B\", phase, name, args);\n            }\n            eventStack.push({ phase: phase, name: name, args: args, time: 1000 * ts.timestamp(), separateBeginAndEnd: separateBeginAndEnd });\n        }\n        tracingEnabled.push = push;\n        function pop() {\n            ts.Debug.assert(eventStack.length > 0);\n            writeStackEvent(eventStack.length - 1, 1000 * ts.timestamp());\n            eventStack.length--;\n        }\n        tracingEnabled.pop = pop;\n        function popAll() {\n            var endTime = 1000 * ts.timestamp();\n            for (var i = eventStack.length - 1; i >= 0; i--) {\n                writeStackEvent(i, endTime);\n            }\n            eventStack.length = 0;\n        }\n        tracingEnabled.popAll = popAll;\n        // sample every 10ms\n        var sampleInterval = 1000 * 10;\n        function writeStackEvent(index, endTime) {\n            var _a = eventStack[index], phase = _a.phase, name = _a.name, args = _a.args, time = _a.time, separateBeginAndEnd = _a.separateBeginAndEnd;\n            if (separateBeginAndEnd) {\n                writeEvent(\"E\", phase, name, args, /*extras*/ undefined, endTime);\n            }\n            // test if [time,endTime) straddles a sampling point\n            else if (sampleInterval - (time % sampleInterval) <= endTime - time) {\n                writeEvent(\"X\", phase, name, args, \"\\\"dur\\\":\" + (endTime - time), time);\n            }\n        }\n        function writeEvent(eventType, phase, name, args, extras, time) {\n            if (time === void 0) { time = 1000 * ts.timestamp(); }\n            // In server mode, there's no easy way to dump type information, so we drop events that would require it.\n            if (mode === 2 /* Server */ && phase === \"checkTypes\" /* CheckTypes */)\n                return;\n            ts.performance.mark(\"beginTracing\");\n            fs.writeSync(traceFd, \",\\n{\\\"pid\\\":1,\\\"tid\\\":1,\\\"ph\\\":\\\"\" + eventType + \"\\\",\\\"cat\\\":\\\"\" + phase + \"\\\",\\\"ts\\\":\" + time + \",\\\"name\\\":\\\"\" + name + \"\\\"\");\n            if (extras)\n                fs.writeSync(traceFd, \",\" + extras);\n            if (args)\n                fs.writeSync(traceFd, \",\\\"args\\\":\" + JSON.stringify(args));\n            fs.writeSync(traceFd, \"}\");\n            ts.performance.mark(\"endTracing\");\n            ts.performance.measure(\"Tracing\", \"beginTracing\", \"endTracing\");\n        }\n        function indexFromOne(lc) {\n            return {\n                line: lc.line + 1,\n                character: lc.character + 1,\n            };\n        }\n        function dumpTypes(types) {\n            var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;\n            ts.performance.mark(\"beginDumpTypes\");\n            var typesPath = legend[legend.length - 1].typesPath;\n            var typesFd = fs.openSync(typesPath, \"w\");\n            var recursionIdentityMap = new ts.Map();\n            // Cleverness: no line break here so that the type ID will match the line number\n            fs.writeSync(typesFd, \"[\");\n            var numTypes = types.length;\n            for (var i = 0; i < numTypes; i++) {\n                var type = types[i];\n                var objectFlags = type.objectFlags;\n                var symbol = (_a = type.aliasSymbol) !== null && _a !== void 0 ? _a : type.symbol;\n                var firstDeclaration = (_b = symbol === null || symbol === void 0 ? void 0 : symbol.declarations) === null || _b === void 0 ? void 0 : _b[0];\n                var firstFile = firstDeclaration && ts.getSourceFileOfNode(firstDeclaration);\n                // It's slow to compute the display text, so skip it unless it's really valuable (or cheap)\n                var display = void 0;\n                if ((objectFlags & 16 /* Anonymous */) | (type.flags & 2944 /* Literal */)) {\n                    try {\n                        display = (_c = type.checker) === null || _c === void 0 ? void 0 : _c.typeToString(type);\n                    }\n                    catch (_s) {\n                        display = undefined;\n                    }\n                }\n                var indexedAccessProperties = {};\n                if (type.flags & 8388608 /* IndexedAccess */) {\n                    var indexedAccessType = type;\n                    indexedAccessProperties = {\n                        indexedAccessObjectType: (_d = indexedAccessType.objectType) === null || _d === void 0 ? void 0 : _d.id,\n                        indexedAccessIndexType: (_e = indexedAccessType.indexType) === null || _e === void 0 ? void 0 : _e.id,\n                    };\n                }\n                var referenceProperties = {};\n                if (objectFlags & 4 /* Reference */) {\n                    var referenceType = type;\n                    referenceProperties = {\n                        instantiatedType: (_f = referenceType.target) === null || _f === void 0 ? void 0 : _f.id,\n                        typeArguments: (_g = referenceType.resolvedTypeArguments) === null || _g === void 0 ? void 0 : _g.map(function (t) { return t.id; }),\n                    };\n                }\n                var conditionalProperties = {};\n                if (type.flags & 16777216 /* Conditional */) {\n                    var conditionalType = type;\n                    conditionalProperties = {\n                        conditionalCheckType: (_h = conditionalType.checkType) === null || _h === void 0 ? void 0 : _h.id,\n                        conditionalExtendsType: (_j = conditionalType.extendsType) === null || _j === void 0 ? void 0 : _j.id,\n                        conditionalTrueType: (_l = (_k = conditionalType.resolvedTrueType) === null || _k === void 0 ? void 0 : _k.id) !== null && _l !== void 0 ? _l : -1,\n                        conditionalFalseType: (_o = (_m = conditionalType.resolvedFalseType) === null || _m === void 0 ? void 0 : _m.id) !== null && _o !== void 0 ? _o : -1,\n                    };\n                }\n                // We can't print out an arbitrary object, so just assign each one a unique number.\n                // Don't call it an \"id\" so people don't treat it as a type id.\n                var recursionToken = void 0;\n                var recursionIdentity = type.checker.getRecursionIdentity(type);\n                if (recursionIdentity) {\n                    recursionToken = recursionIdentityMap.get(recursionIdentity);\n                    if (!recursionToken) {\n                        recursionToken = recursionIdentityMap.size;\n                        recursionIdentityMap.set(recursionIdentity, recursionToken);\n                    }\n                }\n                var descriptor = __assign(__assign(__assign(__assign({ id: type.id, intrinsicName: type.intrinsicName, symbolName: (symbol === null || symbol === void 0 ? void 0 : symbol.escapedName) && ts.unescapeLeadingUnderscores(symbol.escapedName), recursionId: recursionToken, unionTypes: (type.flags & 1048576 /* Union */) ? (_p = type.types) === null || _p === void 0 ? void 0 : _p.map(function (t) { return t.id; }) : undefined, intersectionTypes: (type.flags & 2097152 /* Intersection */) ? type.types.map(function (t) { return t.id; }) : undefined, aliasTypeArguments: (_q = type.aliasTypeArguments) === null || _q === void 0 ? void 0 : _q.map(function (t) { return t.id; }), keyofType: (type.flags & 4194304 /* Index */) ? (_r = type.type) === null || _r === void 0 ? void 0 : _r.id : undefined }, indexedAccessProperties), referenceProperties), conditionalProperties), { firstDeclaration: firstDeclaration && {\n                        path: firstFile.path,\n                        start: indexFromOne(ts.getLineAndCharacterOfPosition(firstFile, firstDeclaration.pos)),\n                        end: indexFromOne(ts.getLineAndCharacterOfPosition(ts.getSourceFileOfNode(firstDeclaration), firstDeclaration.end)),\n                    }, flags: ts.Debug.formatTypeFlags(type.flags).split(\"|\"), display: display });\n                fs.writeSync(typesFd, JSON.stringify(descriptor));\n                if (i < numTypes - 1) {\n                    fs.writeSync(typesFd, \",\\n\");\n                }\n            }\n            fs.writeSync(typesFd, \"]\\n\");\n            fs.closeSync(typesFd);\n            ts.performance.mark(\"endDumpTypes\");\n            ts.performance.measure(\"Dump types\", \"beginDumpTypes\", \"endDumpTypes\");\n        }\n        function dumpLegend() {\n            if (!legendPath) {\n                return;\n            }\n            fs.writeFileSync(legendPath, JSON.stringify(legend));\n        }\n        tracingEnabled.dumpLegend = dumpLegend;\n    })(tracingEnabled = ts.tracingEnabled || (ts.tracingEnabled = {}));\n})(ts || (ts = {}));\n/*@internal*/\n(function (ts) {\n    // define after tracingEnabled is initialized\n    ts.startTracing = ts.tracingEnabled.startTracing;\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    // token > SyntaxKind.Identifier => token is a keyword\n    // Also, If you add a new SyntaxKind be sure to keep the `Markers` section at the bottom in sync\n    var SyntaxKind;\n    (function (SyntaxKind) {\n        SyntaxKind[SyntaxKind[\"Unknown\"] = 0] = \"Unknown\";\n        SyntaxKind[SyntaxKind[\"EndOfFileToken\"] = 1] = \"EndOfFileToken\";\n        SyntaxKind[SyntaxKind[\"SingleLineCommentTrivia\"] = 2] = \"SingleLineCommentTrivia\";\n        SyntaxKind[SyntaxKind[\"MultiLineCommentTrivia\"] = 3] = \"MultiLineCommentTrivia\";\n        SyntaxKind[SyntaxKind[\"NewLineTrivia\"] = 4] = \"NewLineTrivia\";\n        SyntaxKind[SyntaxKind[\"WhitespaceTrivia\"] = 5] = \"WhitespaceTrivia\";\n        // We detect and preserve #! on the first line\n        SyntaxKind[SyntaxKind[\"ShebangTrivia\"] = 6] = \"ShebangTrivia\";\n        // We detect and provide better error recovery when we encounter a git merge marker.  This\n        // allows us to edit files with git-conflict markers in them in a much more pleasant manner.\n        SyntaxKind[SyntaxKind[\"ConflictMarkerTrivia\"] = 7] = \"ConflictMarkerTrivia\";\n        // Literals\n        SyntaxKind[SyntaxKind[\"NumericLiteral\"] = 8] = \"NumericLiteral\";\n        SyntaxKind[SyntaxKind[\"BigIntLiteral\"] = 9] = \"BigIntLiteral\";\n        SyntaxKind[SyntaxKind[\"StringLiteral\"] = 10] = \"StringLiteral\";\n        SyntaxKind[SyntaxKind[\"JsxText\"] = 11] = \"JsxText\";\n        SyntaxKind[SyntaxKind[\"JsxTextAllWhiteSpaces\"] = 12] = \"JsxTextAllWhiteSpaces\";\n        SyntaxKind[SyntaxKind[\"RegularExpressionLiteral\"] = 13] = \"RegularExpressionLiteral\";\n        SyntaxKind[SyntaxKind[\"NoSubstitutionTemplateLiteral\"] = 14] = \"NoSubstitutionTemplateLiteral\";\n        // Pseudo-literals\n        SyntaxKind[SyntaxKind[\"TemplateHead\"] = 15] = \"TemplateHead\";\n        SyntaxKind[SyntaxKind[\"TemplateMiddle\"] = 16] = \"TemplateMiddle\";\n        SyntaxKind[SyntaxKind[\"TemplateTail\"] = 17] = \"TemplateTail\";\n        // Punctuation\n        SyntaxKind[SyntaxKind[\"OpenBraceToken\"] = 18] = \"OpenBraceToken\";\n        SyntaxKind[SyntaxKind[\"CloseBraceToken\"] = 19] = \"CloseBraceToken\";\n        SyntaxKind[SyntaxKind[\"OpenParenToken\"] = 20] = \"OpenParenToken\";\n        SyntaxKind[SyntaxKind[\"CloseParenToken\"] = 21] = \"CloseParenToken\";\n        SyntaxKind[SyntaxKind[\"OpenBracketToken\"] = 22] = \"OpenBracketToken\";\n        SyntaxKind[SyntaxKind[\"CloseBracketToken\"] = 23] = \"CloseBracketToken\";\n        SyntaxKind[SyntaxKind[\"DotToken\"] = 24] = \"DotToken\";\n        SyntaxKind[SyntaxKind[\"DotDotDotToken\"] = 25] = \"DotDotDotToken\";\n        SyntaxKind[SyntaxKind[\"SemicolonToken\"] = 26] = \"SemicolonToken\";\n        SyntaxKind[SyntaxKind[\"CommaToken\"] = 27] = \"CommaToken\";\n        SyntaxKind[SyntaxKind[\"QuestionDotToken\"] = 28] = \"QuestionDotToken\";\n        SyntaxKind[SyntaxKind[\"LessThanToken\"] = 29] = \"LessThanToken\";\n        SyntaxKind[SyntaxKind[\"LessThanSlashToken\"] = 30] = \"LessThanSlashToken\";\n        SyntaxKind[SyntaxKind[\"GreaterThanToken\"] = 31] = \"GreaterThanToken\";\n        SyntaxKind[SyntaxKind[\"LessThanEqualsToken\"] = 32] = \"LessThanEqualsToken\";\n        SyntaxKind[SyntaxKind[\"GreaterThanEqualsToken\"] = 33] = \"GreaterThanEqualsToken\";\n        SyntaxKind[SyntaxKind[\"EqualsEqualsToken\"] = 34] = \"EqualsEqualsToken\";\n        SyntaxKind[SyntaxKind[\"ExclamationEqualsToken\"] = 35] = \"ExclamationEqualsToken\";\n        SyntaxKind[SyntaxKind[\"EqualsEqualsEqualsToken\"] = 36] = \"EqualsEqualsEqualsToken\";\n        SyntaxKind[SyntaxKind[\"ExclamationEqualsEqualsToken\"] = 37] = \"ExclamationEqualsEqualsToken\";\n        SyntaxKind[SyntaxKind[\"EqualsGreaterThanToken\"] = 38] = \"EqualsGreaterThanToken\";\n        SyntaxKind[SyntaxKind[\"PlusToken\"] = 39] = \"PlusToken\";\n        SyntaxKind[SyntaxKind[\"MinusToken\"] = 40] = \"MinusToken\";\n        SyntaxKind[SyntaxKind[\"AsteriskToken\"] = 41] = \"AsteriskToken\";\n        SyntaxKind[SyntaxKind[\"AsteriskAsteriskToken\"] = 42] = \"AsteriskAsteriskToken\";\n        SyntaxKind[SyntaxKind[\"SlashToken\"] = 43] = \"SlashToken\";\n        SyntaxKind[SyntaxKind[\"PercentToken\"] = 44] = \"PercentToken\";\n        SyntaxKind[SyntaxKind[\"PlusPlusToken\"] = 45] = \"PlusPlusToken\";\n        SyntaxKind[SyntaxKind[\"MinusMinusToken\"] = 46] = \"MinusMinusToken\";\n        SyntaxKind[SyntaxKind[\"LessThanLessThanToken\"] = 47] = \"LessThanLessThanToken\";\n        SyntaxKind[SyntaxKind[\"GreaterThanGreaterThanToken\"] = 48] = \"GreaterThanGreaterThanToken\";\n        SyntaxKind[SyntaxKind[\"GreaterThanGreaterThanGreaterThanToken\"] = 49] = \"GreaterThanGreaterThanGreaterThanToken\";\n        SyntaxKind[SyntaxKind[\"AmpersandToken\"] = 50] = \"AmpersandToken\";\n        SyntaxKind[SyntaxKind[\"BarToken\"] = 51] = \"BarToken\";\n        SyntaxKind[SyntaxKind[\"CaretToken\"] = 52] = \"CaretToken\";\n        SyntaxKind[SyntaxKind[\"ExclamationToken\"] = 53] = \"ExclamationToken\";\n        SyntaxKind[SyntaxKind[\"TildeToken\"] = 54] = \"TildeToken\";\n        SyntaxKind[SyntaxKind[\"AmpersandAmpersandToken\"] = 55] = \"AmpersandAmpersandToken\";\n        SyntaxKind[SyntaxKind[\"BarBarToken\"] = 56] = \"BarBarToken\";\n        SyntaxKind[SyntaxKind[\"QuestionToken\"] = 57] = \"QuestionToken\";\n        SyntaxKind[SyntaxKind[\"ColonToken\"] = 58] = \"ColonToken\";\n        SyntaxKind[SyntaxKind[\"AtToken\"] = 59] = \"AtToken\";\n        SyntaxKind[SyntaxKind[\"QuestionQuestionToken\"] = 60] = \"QuestionQuestionToken\";\n        /** Only the JSDoc scanner produces BacktickToken. The normal scanner produces NoSubstitutionTemplateLiteral and related kinds. */\n        SyntaxKind[SyntaxKind[\"BacktickToken\"] = 61] = \"BacktickToken\";\n        // Assignments\n        SyntaxKind[SyntaxKind[\"EqualsToken\"] = 62] = \"EqualsToken\";\n        SyntaxKind[SyntaxKind[\"PlusEqualsToken\"] = 63] = \"PlusEqualsToken\";\n        SyntaxKind[SyntaxKind[\"MinusEqualsToken\"] = 64] = \"MinusEqualsToken\";\n        SyntaxKind[SyntaxKind[\"AsteriskEqualsToken\"] = 65] = \"AsteriskEqualsToken\";\n        SyntaxKind[SyntaxKind[\"AsteriskAsteriskEqualsToken\"] = 66] = \"AsteriskAsteriskEqualsToken\";\n        SyntaxKind[SyntaxKind[\"SlashEqualsToken\"] = 67] = \"SlashEqualsToken\";\n        SyntaxKind[SyntaxKind[\"PercentEqualsToken\"] = 68] = \"PercentEqualsToken\";\n        SyntaxKind[SyntaxKind[\"LessThanLessThanEqualsToken\"] = 69] = \"LessThanLessThanEqualsToken\";\n        SyntaxKind[SyntaxKind[\"GreaterThanGreaterThanEqualsToken\"] = 70] = \"GreaterThanGreaterThanEqualsToken\";\n        SyntaxKind[SyntaxKind[\"GreaterThanGreaterThanGreaterThanEqualsToken\"] = 71] = \"GreaterThanGreaterThanGreaterThanEqualsToken\";\n        SyntaxKind[SyntaxKind[\"AmpersandEqualsToken\"] = 72] = \"AmpersandEqualsToken\";\n        SyntaxKind[SyntaxKind[\"BarEqualsToken\"] = 73] = \"BarEqualsToken\";\n        SyntaxKind[SyntaxKind[\"BarBarEqualsToken\"] = 74] = \"BarBarEqualsToken\";\n        SyntaxKind[SyntaxKind[\"AmpersandAmpersandEqualsToken\"] = 75] = \"AmpersandAmpersandEqualsToken\";\n        SyntaxKind[SyntaxKind[\"QuestionQuestionEqualsToken\"] = 76] = \"QuestionQuestionEqualsToken\";\n        SyntaxKind[SyntaxKind[\"CaretEqualsToken\"] = 77] = \"CaretEqualsToken\";\n        // Identifiers and PrivateIdentifiers\n        SyntaxKind[SyntaxKind[\"Identifier\"] = 78] = \"Identifier\";\n        SyntaxKind[SyntaxKind[\"PrivateIdentifier\"] = 79] = \"PrivateIdentifier\";\n        // Reserved words\n        SyntaxKind[SyntaxKind[\"BreakKeyword\"] = 80] = \"BreakKeyword\";\n        SyntaxKind[SyntaxKind[\"CaseKeyword\"] = 81] = \"CaseKeyword\";\n        SyntaxKind[SyntaxKind[\"CatchKeyword\"] = 82] = \"CatchKeyword\";\n        SyntaxKind[SyntaxKind[\"ClassKeyword\"] = 83] = \"ClassKeyword\";\n        SyntaxKind[SyntaxKind[\"ConstKeyword\"] = 84] = \"ConstKeyword\";\n        SyntaxKind[SyntaxKind[\"ContinueKeyword\"] = 85] = \"ContinueKeyword\";\n        SyntaxKind[SyntaxKind[\"DebuggerKeyword\"] = 86] = \"DebuggerKeyword\";\n        SyntaxKind[SyntaxKind[\"DefaultKeyword\"] = 87] = \"DefaultKeyword\";\n        SyntaxKind[SyntaxKind[\"DeleteKeyword\"] = 88] = \"DeleteKeyword\";\n        SyntaxKind[SyntaxKind[\"DoKeyword\"] = 89] = \"DoKeyword\";\n        SyntaxKind[SyntaxKind[\"ElseKeyword\"] = 90] = \"ElseKeyword\";\n        SyntaxKind[SyntaxKind[\"EnumKeyword\"] = 91] = \"EnumKeyword\";\n        SyntaxKind[SyntaxKind[\"ExportKeyword\"] = 92] = \"ExportKeyword\";\n        SyntaxKind[SyntaxKind[\"ExtendsKeyword\"] = 93] = \"ExtendsKeyword\";\n        SyntaxKind[SyntaxKind[\"FalseKeyword\"] = 94] = \"FalseKeyword\";\n        SyntaxKind[SyntaxKind[\"FinallyKeyword\"] = 95] = \"FinallyKeyword\";\n        SyntaxKind[SyntaxKind[\"ForKeyword\"] = 96] = \"ForKeyword\";\n        SyntaxKind[SyntaxKind[\"FunctionKeyword\"] = 97] = \"FunctionKeyword\";\n        SyntaxKind[SyntaxKind[\"IfKeyword\"] = 98] = \"IfKeyword\";\n        SyntaxKind[SyntaxKind[\"ImportKeyword\"] = 99] = \"ImportKeyword\";\n        SyntaxKind[SyntaxKind[\"InKeyword\"] = 100] = \"InKeyword\";\n        SyntaxKind[SyntaxKind[\"InstanceOfKeyword\"] = 101] = \"InstanceOfKeyword\";\n        SyntaxKind[SyntaxKind[\"NewKeyword\"] = 102] = \"NewKeyword\";\n        SyntaxKind[SyntaxKind[\"NullKeyword\"] = 103] = \"NullKeyword\";\n        SyntaxKind[SyntaxKind[\"ReturnKeyword\"] = 104] = \"ReturnKeyword\";\n        SyntaxKind[SyntaxKind[\"SuperKeyword\"] = 105] = \"SuperKeyword\";\n        SyntaxKind[SyntaxKind[\"SwitchKeyword\"] = 106] = \"SwitchKeyword\";\n        SyntaxKind[SyntaxKind[\"ThisKeyword\"] = 107] = \"ThisKeyword\";\n        SyntaxKind[SyntaxKind[\"ThrowKeyword\"] = 108] = \"ThrowKeyword\";\n        SyntaxKind[SyntaxKind[\"TrueKeyword\"] = 109] = \"TrueKeyword\";\n        SyntaxKind[SyntaxKind[\"TryKeyword\"] = 110] = \"TryKeyword\";\n        SyntaxKind[SyntaxKind[\"TypeOfKeyword\"] = 111] = \"TypeOfKeyword\";\n        SyntaxKind[SyntaxKind[\"VarKeyword\"] = 112] = \"VarKeyword\";\n        SyntaxKind[SyntaxKind[\"VoidKeyword\"] = 113] = \"VoidKeyword\";\n        SyntaxKind[SyntaxKind[\"WhileKeyword\"] = 114] = \"WhileKeyword\";\n        SyntaxKind[SyntaxKind[\"WithKeyword\"] = 115] = \"WithKeyword\";\n        // Strict mode reserved words\n        SyntaxKind[SyntaxKind[\"ImplementsKeyword\"] = 116] = \"ImplementsKeyword\";\n        SyntaxKind[SyntaxKind[\"InterfaceKeyword\"] = 117] = \"InterfaceKeyword\";\n        SyntaxKind[SyntaxKind[\"LetKeyword\"] = 118] = \"LetKeyword\";\n        SyntaxKind[SyntaxKind[\"PackageKeyword\"] = 119] = \"PackageKeyword\";\n        SyntaxKind[SyntaxKind[\"PrivateKeyword\"] = 120] = \"PrivateKeyword\";\n        SyntaxKind[SyntaxKind[\"ProtectedKeyword\"] = 121] = \"ProtectedKeyword\";\n        SyntaxKind[SyntaxKind[\"PublicKeyword\"] = 122] = \"PublicKeyword\";\n        SyntaxKind[SyntaxKind[\"StaticKeyword\"] = 123] = \"StaticKeyword\";\n        SyntaxKind[SyntaxKind[\"YieldKeyword\"] = 124] = \"YieldKeyword\";\n        // Contextual keywords\n        SyntaxKind[SyntaxKind[\"AbstractKeyword\"] = 125] = \"AbstractKeyword\";\n        SyntaxKind[SyntaxKind[\"AsKeyword\"] = 126] = \"AsKeyword\";\n        SyntaxKind[SyntaxKind[\"AssertsKeyword\"] = 127] = \"AssertsKeyword\";\n        SyntaxKind[SyntaxKind[\"AnyKeyword\"] = 128] = \"AnyKeyword\";\n        SyntaxKind[SyntaxKind[\"AsyncKeyword\"] = 129] = \"AsyncKeyword\";\n        SyntaxKind[SyntaxKind[\"AwaitKeyword\"] = 130] = \"AwaitKeyword\";\n        SyntaxKind[SyntaxKind[\"BooleanKeyword\"] = 131] = \"BooleanKeyword\";\n        SyntaxKind[SyntaxKind[\"ConstructorKeyword\"] = 132] = \"ConstructorKeyword\";\n        SyntaxKind[SyntaxKind[\"DeclareKeyword\"] = 133] = \"DeclareKeyword\";\n        SyntaxKind[SyntaxKind[\"GetKeyword\"] = 134] = \"GetKeyword\";\n        SyntaxKind[SyntaxKind[\"InferKeyword\"] = 135] = \"InferKeyword\";\n        SyntaxKind[SyntaxKind[\"IntrinsicKeyword\"] = 136] = \"IntrinsicKeyword\";\n        SyntaxKind[SyntaxKind[\"IsKeyword\"] = 137] = \"IsKeyword\";\n        SyntaxKind[SyntaxKind[\"KeyOfKeyword\"] = 138] = \"KeyOfKeyword\";\n        SyntaxKind[SyntaxKind[\"ModuleKeyword\"] = 139] = \"ModuleKeyword\";\n        SyntaxKind[SyntaxKind[\"NamespaceKeyword\"] = 140] = \"NamespaceKeyword\";\n        SyntaxKind[SyntaxKind[\"NeverKeyword\"] = 141] = \"NeverKeyword\";\n        SyntaxKind[SyntaxKind[\"ReadonlyKeyword\"] = 142] = \"ReadonlyKeyword\";\n        SyntaxKind[SyntaxKind[\"RequireKeyword\"] = 143] = \"RequireKeyword\";\n        SyntaxKind[SyntaxKind[\"NumberKeyword\"] = 144] = \"NumberKeyword\";\n        SyntaxKind[SyntaxKind[\"ObjectKeyword\"] = 145] = \"ObjectKeyword\";\n        SyntaxKind[SyntaxKind[\"SetKeyword\"] = 146] = \"SetKeyword\";\n        SyntaxKind[SyntaxKind[\"StringKeyword\"] = 147] = \"StringKeyword\";\n        SyntaxKind[SyntaxKind[\"SymbolKeyword\"] = 148] = \"SymbolKeyword\";\n        SyntaxKind[SyntaxKind[\"TypeKeyword\"] = 149] = \"TypeKeyword\";\n        SyntaxKind[SyntaxKind[\"UndefinedKeyword\"] = 150] = \"UndefinedKeyword\";\n        SyntaxKind[SyntaxKind[\"UniqueKeyword\"] = 151] = \"UniqueKeyword\";\n        SyntaxKind[SyntaxKind[\"UnknownKeyword\"] = 152] = \"UnknownKeyword\";\n        SyntaxKind[SyntaxKind[\"FromKeyword\"] = 153] = \"FromKeyword\";\n        SyntaxKind[SyntaxKind[\"GlobalKeyword\"] = 154] = \"GlobalKeyword\";\n        SyntaxKind[SyntaxKind[\"BigIntKeyword\"] = 155] = \"BigIntKeyword\";\n        SyntaxKind[SyntaxKind[\"OfKeyword\"] = 156] = \"OfKeyword\";\n        // Parse tree nodes\n        // Names\n        SyntaxKind[SyntaxKind[\"QualifiedName\"] = 157] = \"QualifiedName\";\n        SyntaxKind[SyntaxKind[\"ComputedPropertyName\"] = 158] = \"ComputedPropertyName\";\n        // Signature elements\n        SyntaxKind[SyntaxKind[\"TypeParameter\"] = 159] = \"TypeParameter\";\n        SyntaxKind[SyntaxKind[\"Parameter\"] = 160] = \"Parameter\";\n        SyntaxKind[SyntaxKind[\"Decorator\"] = 161] = \"Decorator\";\n        // TypeMember\n        SyntaxKind[SyntaxKind[\"PropertySignature\"] = 162] = \"PropertySignature\";\n        SyntaxKind[SyntaxKind[\"PropertyDeclaration\"] = 163] = \"PropertyDeclaration\";\n        SyntaxKind[SyntaxKind[\"MethodSignature\"] = 164] = \"MethodSignature\";\n        SyntaxKind[SyntaxKind[\"MethodDeclaration\"] = 165] = \"MethodDeclaration\";\n        SyntaxKind[SyntaxKind[\"Constructor\"] = 166] = \"Constructor\";\n        SyntaxKind[SyntaxKind[\"GetAccessor\"] = 167] = \"GetAccessor\";\n        SyntaxKind[SyntaxKind[\"SetAccessor\"] = 168] = \"SetAccessor\";\n        SyntaxKind[SyntaxKind[\"CallSignature\"] = 169] = \"CallSignature\";\n        SyntaxKind[SyntaxKind[\"ConstructSignature\"] = 170] = \"ConstructSignature\";\n        SyntaxKind[SyntaxKind[\"IndexSignature\"] = 171] = \"IndexSignature\";\n        // Type\n        SyntaxKind[SyntaxKind[\"TypePredicate\"] = 172] = \"TypePredicate\";\n        SyntaxKind[SyntaxKind[\"TypeReference\"] = 173] = \"TypeReference\";\n        SyntaxKind[SyntaxKind[\"FunctionType\"] = 174] = \"FunctionType\";\n        SyntaxKind[SyntaxKind[\"ConstructorType\"] = 175] = \"ConstructorType\";\n        SyntaxKind[SyntaxKind[\"TypeQuery\"] = 176] = \"TypeQuery\";\n        SyntaxKind[SyntaxKind[\"TypeLiteral\"] = 177] = \"TypeLiteral\";\n        SyntaxKind[SyntaxKind[\"ArrayType\"] = 178] = \"ArrayType\";\n        SyntaxKind[SyntaxKind[\"TupleType\"] = 179] = \"TupleType\";\n        SyntaxKind[SyntaxKind[\"OptionalType\"] = 180] = \"OptionalType\";\n        SyntaxKind[SyntaxKind[\"RestType\"] = 181] = \"RestType\";\n        SyntaxKind[SyntaxKind[\"UnionType\"] = 182] = \"UnionType\";\n        SyntaxKind[SyntaxKind[\"IntersectionType\"] = 183] = \"IntersectionType\";\n        SyntaxKind[SyntaxKind[\"ConditionalType\"] = 184] = \"ConditionalType\";\n        SyntaxKind[SyntaxKind[\"InferType\"] = 185] = \"InferType\";\n        SyntaxKind[SyntaxKind[\"ParenthesizedType\"] = 186] = \"ParenthesizedType\";\n        SyntaxKind[SyntaxKind[\"ThisType\"] = 187] = \"ThisType\";\n        SyntaxKind[SyntaxKind[\"TypeOperator\"] = 188] = \"TypeOperator\";\n        SyntaxKind[SyntaxKind[\"IndexedAccessType\"] = 189] = \"IndexedAccessType\";\n        SyntaxKind[SyntaxKind[\"MappedType\"] = 190] = \"MappedType\";\n        SyntaxKind[SyntaxKind[\"LiteralType\"] = 191] = \"LiteralType\";\n        SyntaxKind[SyntaxKind[\"NamedTupleMember\"] = 192] = \"NamedTupleMember\";\n        SyntaxKind[SyntaxKind[\"TemplateLiteralType\"] = 193] = \"TemplateLiteralType\";\n        SyntaxKind[SyntaxKind[\"TemplateLiteralTypeSpan\"] = 194] = \"TemplateLiteralTypeSpan\";\n        SyntaxKind[SyntaxKind[\"ImportType\"] = 195] = \"ImportType\";\n        // Binding patterns\n        SyntaxKind[SyntaxKind[\"ObjectBindingPattern\"] = 196] = \"ObjectBindingPattern\";\n        SyntaxKind[SyntaxKind[\"ArrayBindingPattern\"] = 197] = \"ArrayBindingPattern\";\n        SyntaxKind[SyntaxKind[\"BindingElement\"] = 198] = \"BindingElement\";\n        // Expression\n        SyntaxKind[SyntaxKind[\"ArrayLiteralExpression\"] = 199] = \"ArrayLiteralExpression\";\n        SyntaxKind[SyntaxKind[\"ObjectLiteralExpression\"] = 200] = \"ObjectLiteralExpression\";\n        SyntaxKind[SyntaxKind[\"PropertyAccessExpression\"] = 201] = \"PropertyAccessExpression\";\n        SyntaxKind[SyntaxKind[\"ElementAccessExpression\"] = 202] = \"ElementAccessExpression\";\n        SyntaxKind[SyntaxKind[\"CallExpression\"] = 203] = \"CallExpression\";\n        SyntaxKind[SyntaxKind[\"NewExpression\"] = 204] = \"NewExpression\";\n        SyntaxKind[SyntaxKind[\"TaggedTemplateExpression\"] = 205] = \"TaggedTemplateExpression\";\n        SyntaxKind[SyntaxKind[\"TypeAssertionExpression\"] = 206] = \"TypeAssertionExpression\";\n        SyntaxKind[SyntaxKind[\"ParenthesizedExpression\"] = 207] = \"ParenthesizedExpression\";\n        SyntaxKind[SyntaxKind[\"FunctionExpression\"] = 208] = \"FunctionExpression\";\n        SyntaxKind[SyntaxKind[\"ArrowFunction\"] = 209] = \"ArrowFunction\";\n        SyntaxKind[SyntaxKind[\"DeleteExpression\"] = 210] = \"DeleteExpression\";\n        SyntaxKind[SyntaxKind[\"TypeOfExpression\"] = 211] = \"TypeOfExpression\";\n        SyntaxKind[SyntaxKind[\"VoidExpression\"] = 212] = \"VoidExpression\";\n        SyntaxKind[SyntaxKind[\"AwaitExpression\"] = 213] = \"AwaitExpression\";\n        SyntaxKind[SyntaxKind[\"PrefixUnaryExpression\"] = 214] = \"PrefixUnaryExpression\";\n        SyntaxKind[SyntaxKind[\"PostfixUnaryExpression\"] = 215] = \"PostfixUnaryExpression\";\n        SyntaxKind[SyntaxKind[\"BinaryExpression\"] = 216] = \"BinaryExpression\";\n        SyntaxKind[SyntaxKind[\"ConditionalExpression\"] = 217] = \"ConditionalExpression\";\n        SyntaxKind[SyntaxKind[\"TemplateExpression\"] = 218] = \"TemplateExpression\";\n        SyntaxKind[SyntaxKind[\"YieldExpression\"] = 219] = \"YieldExpression\";\n        SyntaxKind[SyntaxKind[\"SpreadElement\"] = 220] = \"SpreadElement\";\n        SyntaxKind[SyntaxKind[\"ClassExpression\"] = 221] = \"ClassExpression\";\n        SyntaxKind[SyntaxKind[\"OmittedExpression\"] = 222] = \"OmittedExpression\";\n        SyntaxKind[SyntaxKind[\"ExpressionWithTypeArguments\"] = 223] = \"ExpressionWithTypeArguments\";\n        SyntaxKind[SyntaxKind[\"AsExpression\"] = 224] = \"AsExpression\";\n        SyntaxKind[SyntaxKind[\"NonNullExpression\"] = 225] = \"NonNullExpression\";\n        SyntaxKind[SyntaxKind[\"MetaProperty\"] = 226] = \"MetaProperty\";\n        SyntaxKind[SyntaxKind[\"SyntheticExpression\"] = 227] = \"SyntheticExpression\";\n        // Misc\n        SyntaxKind[SyntaxKind[\"TemplateSpan\"] = 228] = \"TemplateSpan\";\n        SyntaxKind[SyntaxKind[\"SemicolonClassElement\"] = 229] = \"SemicolonClassElement\";\n        // Element\n        SyntaxKind[SyntaxKind[\"Block\"] = 230] = \"Block\";\n        SyntaxKind[SyntaxKind[\"EmptyStatement\"] = 231] = \"EmptyStatement\";\n        SyntaxKind[SyntaxKind[\"VariableStatement\"] = 232] = \"VariableStatement\";\n        SyntaxKind[SyntaxKind[\"ExpressionStatement\"] = 233] = \"ExpressionStatement\";\n        SyntaxKind[SyntaxKind[\"IfStatement\"] = 234] = \"IfStatement\";\n        SyntaxKind[SyntaxKind[\"DoStatement\"] = 235] = \"DoStatement\";\n        SyntaxKind[SyntaxKind[\"WhileStatement\"] = 236] = \"WhileStatement\";\n        SyntaxKind[SyntaxKind[\"ForStatement\"] = 237] = \"ForStatement\";\n        SyntaxKind[SyntaxKind[\"ForInStatement\"] = 238] = \"ForInStatement\";\n        SyntaxKind[SyntaxKind[\"ForOfStatement\"] = 239] = \"ForOfStatement\";\n        SyntaxKind[SyntaxKind[\"ContinueStatement\"] = 240] = \"ContinueStatement\";\n        SyntaxKind[SyntaxKind[\"BreakStatement\"] = 241] = \"BreakStatement\";\n        SyntaxKind[SyntaxKind[\"ReturnStatement\"] = 242] = \"ReturnStatement\";\n        SyntaxKind[SyntaxKind[\"WithStatement\"] = 243] = \"WithStatement\";\n        SyntaxKind[SyntaxKind[\"SwitchStatement\"] = 244] = \"SwitchStatement\";\n        SyntaxKind[SyntaxKind[\"LabeledStatement\"] = 245] = \"LabeledStatement\";\n        SyntaxKind[SyntaxKind[\"ThrowStatement\"] = 246] = \"ThrowStatement\";\n        SyntaxKind[SyntaxKind[\"TryStatement\"] = 247] = \"TryStatement\";\n        SyntaxKind[SyntaxKind[\"DebuggerStatement\"] = 248] = \"DebuggerStatement\";\n        SyntaxKind[SyntaxKind[\"VariableDeclaration\"] = 249] = \"VariableDeclaration\";\n        SyntaxKind[SyntaxKind[\"VariableDeclarationList\"] = 250] = \"VariableDeclarationList\";\n        SyntaxKind[SyntaxKind[\"FunctionDeclaration\"] = 251] = \"FunctionDeclaration\";\n        SyntaxKind[SyntaxKind[\"ClassDeclaration\"] = 252] = \"ClassDeclaration\";\n        SyntaxKind[SyntaxKind[\"InterfaceDeclaration\"] = 253] = \"InterfaceDeclaration\";\n        SyntaxKind[SyntaxKind[\"TypeAliasDeclaration\"] = 254] = \"TypeAliasDeclaration\";\n        SyntaxKind[SyntaxKind[\"EnumDeclaration\"] = 255] = \"EnumDeclaration\";\n        SyntaxKind[SyntaxKind[\"ModuleDeclaration\"] = 256] = \"ModuleDeclaration\";\n        SyntaxKind[SyntaxKind[\"ModuleBlock\"] = 257] = \"ModuleBlock\";\n        SyntaxKind[SyntaxKind[\"CaseBlock\"] = 258] = \"CaseBlock\";\n        SyntaxKind[SyntaxKind[\"NamespaceExportDeclaration\"] = 259] = \"NamespaceExportDeclaration\";\n        SyntaxKind[SyntaxKind[\"ImportEqualsDeclaration\"] = 260] = \"ImportEqualsDeclaration\";\n        SyntaxKind[SyntaxKind[\"ImportDeclaration\"] = 261] = \"ImportDeclaration\";\n        SyntaxKind[SyntaxKind[\"ImportClause\"] = 262] = \"ImportClause\";\n        SyntaxKind[SyntaxKind[\"NamespaceImport\"] = 263] = \"NamespaceImport\";\n        SyntaxKind[SyntaxKind[\"NamedImports\"] = 264] = \"NamedImports\";\n        SyntaxKind[SyntaxKind[\"ImportSpecifier\"] = 265] = \"ImportSpecifier\";\n        SyntaxKind[SyntaxKind[\"ExportAssignment\"] = 266] = \"ExportAssignment\";\n        SyntaxKind[SyntaxKind[\"ExportDeclaration\"] = 267] = \"ExportDeclaration\";\n        SyntaxKind[SyntaxKind[\"NamedExports\"] = 268] = \"NamedExports\";\n        SyntaxKind[SyntaxKind[\"NamespaceExport\"] = 269] = \"NamespaceExport\";\n        SyntaxKind[SyntaxKind[\"ExportSpecifier\"] = 270] = \"ExportSpecifier\";\n        SyntaxKind[SyntaxKind[\"MissingDeclaration\"] = 271] = \"MissingDeclaration\";\n        // Module references\n        SyntaxKind[SyntaxKind[\"ExternalModuleReference\"] = 272] = \"ExternalModuleReference\";\n        // JSX\n        SyntaxKind[SyntaxKind[\"JsxElement\"] = 273] = \"JsxElement\";\n        SyntaxKind[SyntaxKind[\"JsxSelfClosingElement\"] = 274] = \"JsxSelfClosingElement\";\n        SyntaxKind[SyntaxKind[\"JsxOpeningElement\"] = 275] = \"JsxOpeningElement\";\n        SyntaxKind[SyntaxKind[\"JsxClosingElement\"] = 276] = \"JsxClosingElement\";\n        SyntaxKind[SyntaxKind[\"JsxFragment\"] = 277] = \"JsxFragment\";\n        SyntaxKind[SyntaxKind[\"JsxOpeningFragment\"] = 278] = \"JsxOpeningFragment\";\n        SyntaxKind[SyntaxKind[\"JsxClosingFragment\"] = 279] = \"JsxClosingFragment\";\n        SyntaxKind[SyntaxKind[\"JsxAttribute\"] = 280] = \"JsxAttribute\";\n        SyntaxKind[SyntaxKind[\"JsxAttributes\"] = 281] = \"JsxAttributes\";\n        SyntaxKind[SyntaxKind[\"JsxSpreadAttribute\"] = 282] = \"JsxSpreadAttribute\";\n        SyntaxKind[SyntaxKind[\"JsxExpression\"] = 283] = \"JsxExpression\";\n        // Clauses\n        SyntaxKind[SyntaxKind[\"CaseClause\"] = 284] = \"CaseClause\";\n        SyntaxKind[SyntaxKind[\"DefaultClause\"] = 285] = \"DefaultClause\";\n        SyntaxKind[SyntaxKind[\"HeritageClause\"] = 286] = \"HeritageClause\";\n        SyntaxKind[SyntaxKind[\"CatchClause\"] = 287] = \"CatchClause\";\n        // Property assignments\n        SyntaxKind[SyntaxKind[\"PropertyAssignment\"] = 288] = \"PropertyAssignment\";\n        SyntaxKind[SyntaxKind[\"ShorthandPropertyAssignment\"] = 289] = \"ShorthandPropertyAssignment\";\n        SyntaxKind[SyntaxKind[\"SpreadAssignment\"] = 290] = \"SpreadAssignment\";\n        // Enum\n        SyntaxKind[SyntaxKind[\"EnumMember\"] = 291] = \"EnumMember\";\n        // Unparsed\n        SyntaxKind[SyntaxKind[\"UnparsedPrologue\"] = 292] = \"UnparsedPrologue\";\n        SyntaxKind[SyntaxKind[\"UnparsedPrepend\"] = 293] = \"UnparsedPrepend\";\n        SyntaxKind[SyntaxKind[\"UnparsedText\"] = 294] = \"UnparsedText\";\n        SyntaxKind[SyntaxKind[\"UnparsedInternalText\"] = 295] = \"UnparsedInternalText\";\n        SyntaxKind[SyntaxKind[\"UnparsedSyntheticReference\"] = 296] = \"UnparsedSyntheticReference\";\n        // Top-level nodes\n        SyntaxKind[SyntaxKind[\"SourceFile\"] = 297] = \"SourceFile\";\n        SyntaxKind[SyntaxKind[\"Bundle\"] = 298] = \"Bundle\";\n        SyntaxKind[SyntaxKind[\"UnparsedSource\"] = 299] = \"UnparsedSource\";\n        SyntaxKind[SyntaxKind[\"InputFiles\"] = 300] = \"InputFiles\";\n        // JSDoc nodes\n        SyntaxKind[SyntaxKind[\"JSDocTypeExpression\"] = 301] = \"JSDocTypeExpression\";\n        SyntaxKind[SyntaxKind[\"JSDocNameReference\"] = 302] = \"JSDocNameReference\";\n        // The * type\n        SyntaxKind[SyntaxKind[\"JSDocAllType\"] = 303] = \"JSDocAllType\";\n        // The ? type\n        SyntaxKind[SyntaxKind[\"JSDocUnknownType\"] = 304] = \"JSDocUnknownType\";\n        SyntaxKind[SyntaxKind[\"JSDocNullableType\"] = 305] = \"JSDocNullableType\";\n        SyntaxKind[SyntaxKind[\"JSDocNonNullableType\"] = 306] = \"JSDocNonNullableType\";\n        SyntaxKind[SyntaxKind[\"JSDocOptionalType\"] = 307] = \"JSDocOptionalType\";\n        SyntaxKind[SyntaxKind[\"JSDocFunctionType\"] = 308] = \"JSDocFunctionType\";\n        SyntaxKind[SyntaxKind[\"JSDocVariadicType\"] = 309] = \"JSDocVariadicType\";\n        // https://jsdoc.app/about-namepaths.html\n        SyntaxKind[SyntaxKind[\"JSDocNamepathType\"] = 310] = \"JSDocNamepathType\";\n        SyntaxKind[SyntaxKind[\"JSDocComment\"] = 311] = \"JSDocComment\";\n        SyntaxKind[SyntaxKind[\"JSDocTypeLiteral\"] = 312] = \"JSDocTypeLiteral\";\n        SyntaxKind[SyntaxKind[\"JSDocSignature\"] = 313] = \"JSDocSignature\";\n        SyntaxKind[SyntaxKind[\"JSDocTag\"] = 314] = \"JSDocTag\";\n        SyntaxKind[SyntaxKind[\"JSDocAugmentsTag\"] = 315] = \"JSDocAugmentsTag\";\n        SyntaxKind[SyntaxKind[\"JSDocImplementsTag\"] = 316] = \"JSDocImplementsTag\";\n        SyntaxKind[SyntaxKind[\"JSDocAuthorTag\"] = 317] = \"JSDocAuthorTag\";\n        SyntaxKind[SyntaxKind[\"JSDocDeprecatedTag\"] = 318] = \"JSDocDeprecatedTag\";\n        SyntaxKind[SyntaxKind[\"JSDocClassTag\"] = 319] = \"JSDocClassTag\";\n        SyntaxKind[SyntaxKind[\"JSDocPublicTag\"] = 320] = \"JSDocPublicTag\";\n        SyntaxKind[SyntaxKind[\"JSDocPrivateTag\"] = 321] = \"JSDocPrivateTag\";\n        SyntaxKind[SyntaxKind[\"JSDocProtectedTag\"] = 322] = \"JSDocProtectedTag\";\n        SyntaxKind[SyntaxKind[\"JSDocReadonlyTag\"] = 323] = \"JSDocReadonlyTag\";\n        SyntaxKind[SyntaxKind[\"JSDocCallbackTag\"] = 324] = \"JSDocCallbackTag\";\n        SyntaxKind[SyntaxKind[\"JSDocEnumTag\"] = 325] = \"JSDocEnumTag\";\n        SyntaxKind[SyntaxKind[\"JSDocParameterTag\"] = 326] = \"JSDocParameterTag\";\n        SyntaxKind[SyntaxKind[\"JSDocReturnTag\"] = 327] = \"JSDocReturnTag\";\n        SyntaxKind[SyntaxKind[\"JSDocThisTag\"] = 328] = \"JSDocThisTag\";\n        SyntaxKind[SyntaxKind[\"JSDocTypeTag\"] = 329] = \"JSDocTypeTag\";\n        SyntaxKind[SyntaxKind[\"JSDocTemplateTag\"] = 330] = \"JSDocTemplateTag\";\n        SyntaxKind[SyntaxKind[\"JSDocTypedefTag\"] = 331] = \"JSDocTypedefTag\";\n        SyntaxKind[SyntaxKind[\"JSDocSeeTag\"] = 332] = \"JSDocSeeTag\";\n        SyntaxKind[SyntaxKind[\"JSDocPropertyTag\"] = 333] = \"JSDocPropertyTag\";\n        // Synthesized list\n        SyntaxKind[SyntaxKind[\"SyntaxList\"] = 334] = \"SyntaxList\";\n        // Transformation nodes\n        SyntaxKind[SyntaxKind[\"NotEmittedStatement\"] = 335] = \"NotEmittedStatement\";\n        SyntaxKind[SyntaxKind[\"PartiallyEmittedExpression\"] = 336] = \"PartiallyEmittedExpression\";\n        SyntaxKind[SyntaxKind[\"CommaListExpression\"] = 337] = \"CommaListExpression\";\n        SyntaxKind[SyntaxKind[\"MergeDeclarationMarker\"] = 338] = \"MergeDeclarationMarker\";\n        SyntaxKind[SyntaxKind[\"EndOfDeclarationMarker\"] = 339] = \"EndOfDeclarationMarker\";\n        SyntaxKind[SyntaxKind[\"SyntheticReferenceExpression\"] = 340] = \"SyntheticReferenceExpression\";\n        // Enum value count\n        SyntaxKind[SyntaxKind[\"Count\"] = 341] = \"Count\";\n        // Markers\n        SyntaxKind[SyntaxKind[\"FirstAssignment\"] = 62] = \"FirstAssignment\";\n        SyntaxKind[SyntaxKind[\"LastAssignment\"] = 77] = \"LastAssignment\";\n        SyntaxKind[SyntaxKind[\"FirstCompoundAssignment\"] = 63] = \"FirstCompoundAssignment\";\n        SyntaxKind[SyntaxKind[\"LastCompoundAssignment\"] = 77] = \"LastCompoundAssignment\";\n        SyntaxKind[SyntaxKind[\"FirstReservedWord\"] = 80] = \"FirstReservedWord\";\n        SyntaxKind[SyntaxKind[\"LastReservedWord\"] = 115] = \"LastReservedWord\";\n        SyntaxKind[SyntaxKind[\"FirstKeyword\"] = 80] = \"FirstKeyword\";\n        SyntaxKind[SyntaxKind[\"LastKeyword\"] = 156] = \"LastKeyword\";\n        SyntaxKind[SyntaxKind[\"FirstFutureReservedWord\"] = 116] = \"FirstFutureReservedWord\";\n        SyntaxKind[SyntaxKind[\"LastFutureReservedWord\"] = 124] = \"LastFutureReservedWord\";\n        SyntaxKind[SyntaxKind[\"FirstTypeNode\"] = 172] = \"FirstTypeNode\";\n        SyntaxKind[SyntaxKind[\"LastTypeNode\"] = 195] = \"LastTypeNode\";\n        SyntaxKind[SyntaxKind[\"FirstPunctuation\"] = 18] = \"FirstPunctuation\";\n        SyntaxKind[SyntaxKind[\"LastPunctuation\"] = 77] = \"LastPunctuation\";\n        SyntaxKind[SyntaxKind[\"FirstToken\"] = 0] = \"FirstToken\";\n        SyntaxKind[SyntaxKind[\"LastToken\"] = 156] = \"LastToken\";\n        SyntaxKind[SyntaxKind[\"FirstTriviaToken\"] = 2] = \"FirstTriviaToken\";\n        SyntaxKind[SyntaxKind[\"LastTriviaToken\"] = 7] = \"LastTriviaToken\";\n        SyntaxKind[SyntaxKind[\"FirstLiteralToken\"] = 8] = \"FirstLiteralToken\";\n        SyntaxKind[SyntaxKind[\"LastLiteralToken\"] = 14] = \"LastLiteralToken\";\n        SyntaxKind[SyntaxKind[\"FirstTemplateToken\"] = 14] = \"FirstTemplateToken\";\n        SyntaxKind[SyntaxKind[\"LastTemplateToken\"] = 17] = \"LastTemplateToken\";\n        SyntaxKind[SyntaxKind[\"FirstBinaryOperator\"] = 29] = \"FirstBinaryOperator\";\n        SyntaxKind[SyntaxKind[\"LastBinaryOperator\"] = 77] = \"LastBinaryOperator\";\n        SyntaxKind[SyntaxKind[\"FirstStatement\"] = 232] = \"FirstStatement\";\n        SyntaxKind[SyntaxKind[\"LastStatement\"] = 248] = \"LastStatement\";\n        SyntaxKind[SyntaxKind[\"FirstNode\"] = 157] = \"FirstNode\";\n        SyntaxKind[SyntaxKind[\"FirstJSDocNode\"] = 301] = \"FirstJSDocNode\";\n        SyntaxKind[SyntaxKind[\"LastJSDocNode\"] = 333] = \"LastJSDocNode\";\n        SyntaxKind[SyntaxKind[\"FirstJSDocTagNode\"] = 314] = \"FirstJSDocTagNode\";\n        SyntaxKind[SyntaxKind[\"LastJSDocTagNode\"] = 333] = \"LastJSDocTagNode\";\n        /* @internal */ SyntaxKind[SyntaxKind[\"FirstContextualKeyword\"] = 125] = \"FirstContextualKeyword\";\n        /* @internal */ SyntaxKind[SyntaxKind[\"LastContextualKeyword\"] = 156] = \"LastContextualKeyword\";\n    })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {}));\n    var NodeFlags;\n    (function (NodeFlags) {\n        NodeFlags[NodeFlags[\"None\"] = 0] = \"None\";\n        NodeFlags[NodeFlags[\"Let\"] = 1] = \"Let\";\n        NodeFlags[NodeFlags[\"Const\"] = 2] = \"Const\";\n        NodeFlags[NodeFlags[\"NestedNamespace\"] = 4] = \"NestedNamespace\";\n        NodeFlags[NodeFlags[\"Synthesized\"] = 8] = \"Synthesized\";\n        NodeFlags[NodeFlags[\"Namespace\"] = 16] = \"Namespace\";\n        NodeFlags[NodeFlags[\"OptionalChain\"] = 32] = \"OptionalChain\";\n        NodeFlags[NodeFlags[\"ExportContext\"] = 64] = \"ExportContext\";\n        NodeFlags[NodeFlags[\"ContainsThis\"] = 128] = \"ContainsThis\";\n        NodeFlags[NodeFlags[\"HasImplicitReturn\"] = 256] = \"HasImplicitReturn\";\n        NodeFlags[NodeFlags[\"HasExplicitReturn\"] = 512] = \"HasExplicitReturn\";\n        NodeFlags[NodeFlags[\"GlobalAugmentation\"] = 1024] = \"GlobalAugmentation\";\n        NodeFlags[NodeFlags[\"HasAsyncFunctions\"] = 2048] = \"HasAsyncFunctions\";\n        NodeFlags[NodeFlags[\"DisallowInContext\"] = 4096] = \"DisallowInContext\";\n        NodeFlags[NodeFlags[\"YieldContext\"] = 8192] = \"YieldContext\";\n        NodeFlags[NodeFlags[\"DecoratorContext\"] = 16384] = \"DecoratorContext\";\n        NodeFlags[NodeFlags[\"AwaitContext\"] = 32768] = \"AwaitContext\";\n        NodeFlags[NodeFlags[\"ThisNodeHasError\"] = 65536] = \"ThisNodeHasError\";\n        NodeFlags[NodeFlags[\"JavaScriptFile\"] = 131072] = \"JavaScriptFile\";\n        NodeFlags[NodeFlags[\"ThisNodeOrAnySubNodesHasError\"] = 262144] = \"ThisNodeOrAnySubNodesHasError\";\n        NodeFlags[NodeFlags[\"HasAggregatedChildData\"] = 524288] = \"HasAggregatedChildData\";\n        // These flags will be set when the parser encounters a dynamic import expression or 'import.meta' to avoid\n        // walking the tree if the flags are not set. However, these flags are just a approximation\n        // (hence why it's named \"PossiblyContainsDynamicImport\") because once set, the flags never get cleared.\n        // During editing, if a dynamic import is removed, incremental parsing will *NOT* clear this flag.\n        // This means that the tree will always be traversed during module resolution, or when looking for external module indicators.\n        // However, the removal operation should not occur often and in the case of the\n        // removal, it is likely that users will add the import anyway.\n        // The advantage of this approach is its simplicity. For the case of batch compilation,\n        // we guarantee that users won't have to pay the price of walking the tree if a dynamic import isn't used.\n        /* @internal */ NodeFlags[NodeFlags[\"PossiblyContainsDynamicImport\"] = 1048576] = \"PossiblyContainsDynamicImport\";\n        /* @internal */ NodeFlags[NodeFlags[\"PossiblyContainsImportMeta\"] = 2097152] = \"PossiblyContainsImportMeta\";\n        NodeFlags[NodeFlags[\"JSDoc\"] = 4194304] = \"JSDoc\";\n        /* @internal */ NodeFlags[NodeFlags[\"Ambient\"] = 8388608] = \"Ambient\";\n        /* @internal */ NodeFlags[NodeFlags[\"InWithStatement\"] = 16777216] = \"InWithStatement\";\n        NodeFlags[NodeFlags[\"JsonFile\"] = 33554432] = \"JsonFile\";\n        /* @internal */ NodeFlags[NodeFlags[\"TypeCached\"] = 67108864] = \"TypeCached\";\n        /* @internal */ NodeFlags[NodeFlags[\"Deprecated\"] = 134217728] = \"Deprecated\";\n        NodeFlags[NodeFlags[\"BlockScoped\"] = 3] = \"BlockScoped\";\n        NodeFlags[NodeFlags[\"ReachabilityCheckFlags\"] = 768] = \"ReachabilityCheckFlags\";\n        NodeFlags[NodeFlags[\"ReachabilityAndEmitFlags\"] = 2816] = \"ReachabilityAndEmitFlags\";\n        // Parsing context flags\n        NodeFlags[NodeFlags[\"ContextFlags\"] = 25358336] = \"ContextFlags\";\n        // Exclude these flags when parsing a Type\n        NodeFlags[NodeFlags[\"TypeExcludesFlags\"] = 40960] = \"TypeExcludesFlags\";\n        // Represents all flags that are potentially set once and\n        // never cleared on SourceFiles which get re-used in between incremental parses.\n        // See the comment above on `PossiblyContainsDynamicImport` and `PossiblyContainsImportMeta`.\n        /* @internal */ NodeFlags[NodeFlags[\"PermanentlySetIncrementalFlags\"] = 3145728] = \"PermanentlySetIncrementalFlags\";\n    })(NodeFlags = ts.NodeFlags || (ts.NodeFlags = {}));\n    var ModifierFlags;\n    (function (ModifierFlags) {\n        ModifierFlags[ModifierFlags[\"None\"] = 0] = \"None\";\n        ModifierFlags[ModifierFlags[\"Export\"] = 1] = \"Export\";\n        ModifierFlags[ModifierFlags[\"Ambient\"] = 2] = \"Ambient\";\n        ModifierFlags[ModifierFlags[\"Public\"] = 4] = \"Public\";\n        ModifierFlags[ModifierFlags[\"Private\"] = 8] = \"Private\";\n        ModifierFlags[ModifierFlags[\"Protected\"] = 16] = \"Protected\";\n        ModifierFlags[ModifierFlags[\"Static\"] = 32] = \"Static\";\n        ModifierFlags[ModifierFlags[\"Readonly\"] = 64] = \"Readonly\";\n        ModifierFlags[ModifierFlags[\"Abstract\"] = 128] = \"Abstract\";\n        ModifierFlags[ModifierFlags[\"Async\"] = 256] = \"Async\";\n        ModifierFlags[ModifierFlags[\"Default\"] = 512] = \"Default\";\n        ModifierFlags[ModifierFlags[\"Const\"] = 2048] = \"Const\";\n        ModifierFlags[ModifierFlags[\"HasComputedJSDocModifiers\"] = 4096] = \"HasComputedJSDocModifiers\";\n        ModifierFlags[ModifierFlags[\"Deprecated\"] = 8192] = \"Deprecated\";\n        ModifierFlags[ModifierFlags[\"HasComputedFlags\"] = 536870912] = \"HasComputedFlags\";\n        ModifierFlags[ModifierFlags[\"AccessibilityModifier\"] = 28] = \"AccessibilityModifier\";\n        // Accessibility modifiers and 'readonly' can be attached to a parameter in a constructor to make it a property.\n        ModifierFlags[ModifierFlags[\"ParameterPropertyModifier\"] = 92] = \"ParameterPropertyModifier\";\n        ModifierFlags[ModifierFlags[\"NonPublicAccessibilityModifier\"] = 24] = \"NonPublicAccessibilityModifier\";\n        ModifierFlags[ModifierFlags[\"TypeScriptModifier\"] = 2270] = \"TypeScriptModifier\";\n        ModifierFlags[ModifierFlags[\"ExportDefault\"] = 513] = \"ExportDefault\";\n        ModifierFlags[ModifierFlags[\"All\"] = 11263] = \"All\";\n    })(ModifierFlags = ts.ModifierFlags || (ts.ModifierFlags = {}));\n    var JsxFlags;\n    (function (JsxFlags) {\n        JsxFlags[JsxFlags[\"None\"] = 0] = \"None\";\n        /** An element from a named property of the JSX.IntrinsicElements interface */\n        JsxFlags[JsxFlags[\"IntrinsicNamedElement\"] = 1] = \"IntrinsicNamedElement\";\n        /** An element inferred from the string index signature of the JSX.IntrinsicElements interface */\n        JsxFlags[JsxFlags[\"IntrinsicIndexedElement\"] = 2] = \"IntrinsicIndexedElement\";\n        JsxFlags[JsxFlags[\"IntrinsicElement\"] = 3] = \"IntrinsicElement\";\n    })(JsxFlags = ts.JsxFlags || (ts.JsxFlags = {}));\n    /* @internal */\n    var RelationComparisonResult;\n    (function (RelationComparisonResult) {\n        RelationComparisonResult[RelationComparisonResult[\"Succeeded\"] = 1] = \"Succeeded\";\n        RelationComparisonResult[RelationComparisonResult[\"Failed\"] = 2] = \"Failed\";\n        RelationComparisonResult[RelationComparisonResult[\"Reported\"] = 4] = \"Reported\";\n        RelationComparisonResult[RelationComparisonResult[\"ReportsUnmeasurable\"] = 8] = \"ReportsUnmeasurable\";\n        RelationComparisonResult[RelationComparisonResult[\"ReportsUnreliable\"] = 16] = \"ReportsUnreliable\";\n        RelationComparisonResult[RelationComparisonResult[\"ReportsMask\"] = 24] = \"ReportsMask\";\n    })(RelationComparisonResult = ts.RelationComparisonResult || (ts.RelationComparisonResult = {}));\n    var GeneratedIdentifierFlags;\n    (function (GeneratedIdentifierFlags) {\n        // Kinds\n        GeneratedIdentifierFlags[GeneratedIdentifierFlags[\"None\"] = 0] = \"None\";\n        /*@internal*/ GeneratedIdentifierFlags[GeneratedIdentifierFlags[\"Auto\"] = 1] = \"Auto\";\n        /*@internal*/ GeneratedIdentifierFlags[GeneratedIdentifierFlags[\"Loop\"] = 2] = \"Loop\";\n        /*@internal*/ GeneratedIdentifierFlags[GeneratedIdentifierFlags[\"Unique\"] = 3] = \"Unique\";\n        /*@internal*/ GeneratedIdentifierFlags[GeneratedIdentifierFlags[\"Node\"] = 4] = \"Node\";\n        /*@internal*/ GeneratedIdentifierFlags[GeneratedIdentifierFlags[\"KindMask\"] = 7] = \"KindMask\";\n        // Flags\n        GeneratedIdentifierFlags[GeneratedIdentifierFlags[\"ReservedInNestedScopes\"] = 8] = \"ReservedInNestedScopes\";\n        GeneratedIdentifierFlags[GeneratedIdentifierFlags[\"Optimistic\"] = 16] = \"Optimistic\";\n        GeneratedIdentifierFlags[GeneratedIdentifierFlags[\"FileLevel\"] = 32] = \"FileLevel\";\n        GeneratedIdentifierFlags[GeneratedIdentifierFlags[\"AllowNameSubstitution\"] = 64] = \"AllowNameSubstitution\";\n    })(GeneratedIdentifierFlags = ts.GeneratedIdentifierFlags || (ts.GeneratedIdentifierFlags = {}));\n    var TokenFlags;\n    (function (TokenFlags) {\n        TokenFlags[TokenFlags[\"None\"] = 0] = \"None\";\n        /* @internal */\n        TokenFlags[TokenFlags[\"PrecedingLineBreak\"] = 1] = \"PrecedingLineBreak\";\n        /* @internal */\n        TokenFlags[TokenFlags[\"PrecedingJSDocComment\"] = 2] = \"PrecedingJSDocComment\";\n        /* @internal */\n        TokenFlags[TokenFlags[\"Unterminated\"] = 4] = \"Unterminated\";\n        /* @internal */\n        TokenFlags[TokenFlags[\"ExtendedUnicodeEscape\"] = 8] = \"ExtendedUnicodeEscape\";\n        TokenFlags[TokenFlags[\"Scientific\"] = 16] = \"Scientific\";\n        TokenFlags[TokenFlags[\"Octal\"] = 32] = \"Octal\";\n        TokenFlags[TokenFlags[\"HexSpecifier\"] = 64] = \"HexSpecifier\";\n        TokenFlags[TokenFlags[\"BinarySpecifier\"] = 128] = \"BinarySpecifier\";\n        TokenFlags[TokenFlags[\"OctalSpecifier\"] = 256] = \"OctalSpecifier\";\n        /* @internal */\n        TokenFlags[TokenFlags[\"ContainsSeparator\"] = 512] = \"ContainsSeparator\";\n        /* @internal */\n        TokenFlags[TokenFlags[\"UnicodeEscape\"] = 1024] = \"UnicodeEscape\";\n        /* @internal */\n        TokenFlags[TokenFlags[\"ContainsInvalidEscape\"] = 2048] = \"ContainsInvalidEscape\";\n        /* @internal */\n        TokenFlags[TokenFlags[\"BinaryOrOctalSpecifier\"] = 384] = \"BinaryOrOctalSpecifier\";\n        /* @internal */\n        TokenFlags[TokenFlags[\"NumericLiteralFlags\"] = 1008] = \"NumericLiteralFlags\";\n        /* @internal */\n        TokenFlags[TokenFlags[\"TemplateLiteralLikeFlags\"] = 2048] = \"TemplateLiteralLikeFlags\";\n    })(TokenFlags = ts.TokenFlags || (ts.TokenFlags = {}));\n    // NOTE: Ensure this is up-to-date with src/debug/debug.ts\n    var FlowFlags;\n    (function (FlowFlags) {\n        FlowFlags[FlowFlags[\"Unreachable\"] = 1] = \"Unreachable\";\n        FlowFlags[FlowFlags[\"Start\"] = 2] = \"Start\";\n        FlowFlags[FlowFlags[\"BranchLabel\"] = 4] = \"BranchLabel\";\n        FlowFlags[FlowFlags[\"LoopLabel\"] = 8] = \"LoopLabel\";\n        FlowFlags[FlowFlags[\"Assignment\"] = 16] = \"Assignment\";\n        FlowFlags[FlowFlags[\"TrueCondition\"] = 32] = \"TrueCondition\";\n        FlowFlags[FlowFlags[\"FalseCondition\"] = 64] = \"FalseCondition\";\n        FlowFlags[FlowFlags[\"SwitchClause\"] = 128] = \"SwitchClause\";\n        FlowFlags[FlowFlags[\"ArrayMutation\"] = 256] = \"ArrayMutation\";\n        FlowFlags[FlowFlags[\"Call\"] = 512] = \"Call\";\n        FlowFlags[FlowFlags[\"ReduceLabel\"] = 1024] = \"ReduceLabel\";\n        FlowFlags[FlowFlags[\"Referenced\"] = 2048] = \"Referenced\";\n        FlowFlags[FlowFlags[\"Shared\"] = 4096] = \"Shared\";\n        FlowFlags[FlowFlags[\"Label\"] = 12] = \"Label\";\n        FlowFlags[FlowFlags[\"Condition\"] = 96] = \"Condition\";\n    })(FlowFlags = ts.FlowFlags || (ts.FlowFlags = {}));\n    /* @internal */\n    var CommentDirectiveType;\n    (function (CommentDirectiveType) {\n        CommentDirectiveType[CommentDirectiveType[\"ExpectError\"] = 0] = \"ExpectError\";\n        CommentDirectiveType[CommentDirectiveType[\"Ignore\"] = 1] = \"Ignore\";\n    })(CommentDirectiveType = ts.CommentDirectiveType || (ts.CommentDirectiveType = {}));\n    var OperationCanceledException = /** @class */ (function () {\n        function OperationCanceledException() {\n        }\n        return OperationCanceledException;\n    }());\n    ts.OperationCanceledException = OperationCanceledException;\n    /*@internal*/\n    var FileIncludeKind;\n    (function (FileIncludeKind) {\n        FileIncludeKind[FileIncludeKind[\"RootFile\"] = 0] = \"RootFile\";\n        FileIncludeKind[FileIncludeKind[\"SourceFromProjectReference\"] = 1] = \"SourceFromProjectReference\";\n        FileIncludeKind[FileIncludeKind[\"OutputFromProjectReference\"] = 2] = \"OutputFromProjectReference\";\n        FileIncludeKind[FileIncludeKind[\"Import\"] = 3] = \"Import\";\n        FileIncludeKind[FileIncludeKind[\"ReferenceFile\"] = 4] = \"ReferenceFile\";\n        FileIncludeKind[FileIncludeKind[\"TypeReferenceDirective\"] = 5] = \"TypeReferenceDirective\";\n        FileIncludeKind[FileIncludeKind[\"LibFile\"] = 6] = \"LibFile\";\n        FileIncludeKind[FileIncludeKind[\"LibReferenceDirective\"] = 7] = \"LibReferenceDirective\";\n        FileIncludeKind[FileIncludeKind[\"AutomaticTypeDirectiveFile\"] = 8] = \"AutomaticTypeDirectiveFile\";\n    })(FileIncludeKind = ts.FileIncludeKind || (ts.FileIncludeKind = {}));\n    /*@internal*/\n    var FilePreprocessingDiagnosticsKind;\n    (function (FilePreprocessingDiagnosticsKind) {\n        FilePreprocessingDiagnosticsKind[FilePreprocessingDiagnosticsKind[\"FilePreprocessingReferencedDiagnostic\"] = 0] = \"FilePreprocessingReferencedDiagnostic\";\n        FilePreprocessingDiagnosticsKind[FilePreprocessingDiagnosticsKind[\"FilePreprocessingFileExplainingDiagnostic\"] = 1] = \"FilePreprocessingFileExplainingDiagnostic\";\n    })(FilePreprocessingDiagnosticsKind = ts.FilePreprocessingDiagnosticsKind || (ts.FilePreprocessingDiagnosticsKind = {}));\n    /* @internal */\n    var StructureIsReused;\n    (function (StructureIsReused) {\n        StructureIsReused[StructureIsReused[\"Not\"] = 0] = \"Not\";\n        StructureIsReused[StructureIsReused[\"SafeModules\"] = 1] = \"SafeModules\";\n        StructureIsReused[StructureIsReused[\"Completely\"] = 2] = \"Completely\";\n    })(StructureIsReused = ts.StructureIsReused || (ts.StructureIsReused = {}));\n    /** Return code used by getEmitOutput function to indicate status of the function */\n    var ExitStatus;\n    (function (ExitStatus) {\n        // Compiler ran successfully.  Either this was a simple do-nothing compilation (for example,\n        // when -version or -help was provided, or this was a normal compilation, no diagnostics\n        // were produced, and all outputs were generated successfully.\n        ExitStatus[ExitStatus[\"Success\"] = 0] = \"Success\";\n        // Diagnostics were produced and because of them no code was generated.\n        ExitStatus[ExitStatus[\"DiagnosticsPresent_OutputsSkipped\"] = 1] = \"DiagnosticsPresent_OutputsSkipped\";\n        // Diagnostics were produced and outputs were generated in spite of them.\n        ExitStatus[ExitStatus[\"DiagnosticsPresent_OutputsGenerated\"] = 2] = \"DiagnosticsPresent_OutputsGenerated\";\n        // When build skipped because passed in project is invalid\n        ExitStatus[ExitStatus[\"InvalidProject_OutputsSkipped\"] = 3] = \"InvalidProject_OutputsSkipped\";\n        // When build is skipped because project references form cycle\n        ExitStatus[ExitStatus[\"ProjectReferenceCycle_OutputsSkipped\"] = 4] = \"ProjectReferenceCycle_OutputsSkipped\";\n        /** @deprecated Use ProjectReferenceCycle_OutputsSkipped instead. */\n        ExitStatus[ExitStatus[\"ProjectReferenceCycle_OutputsSkupped\"] = 4] = \"ProjectReferenceCycle_OutputsSkupped\";\n    })(ExitStatus = ts.ExitStatus || (ts.ExitStatus = {}));\n    /* @internal */\n    var UnionReduction;\n    (function (UnionReduction) {\n        UnionReduction[UnionReduction[\"None\"] = 0] = \"None\";\n        UnionReduction[UnionReduction[\"Literal\"] = 1] = \"Literal\";\n        UnionReduction[UnionReduction[\"Subtype\"] = 2] = \"Subtype\";\n    })(UnionReduction = ts.UnionReduction || (ts.UnionReduction = {}));\n    /* @internal */\n    var ContextFlags;\n    (function (ContextFlags) {\n        ContextFlags[ContextFlags[\"None\"] = 0] = \"None\";\n        ContextFlags[ContextFlags[\"Signature\"] = 1] = \"Signature\";\n        ContextFlags[ContextFlags[\"NoConstraints\"] = 2] = \"NoConstraints\";\n        ContextFlags[ContextFlags[\"Completions\"] = 4] = \"Completions\";\n        ContextFlags[ContextFlags[\"SkipBindingPatterns\"] = 8] = \"SkipBindingPatterns\";\n    })(ContextFlags = ts.ContextFlags || (ts.ContextFlags = {}));\n    // NOTE: If modifying this enum, must modify `TypeFormatFlags` too!\n    var NodeBuilderFlags;\n    (function (NodeBuilderFlags) {\n        NodeBuilderFlags[NodeBuilderFlags[\"None\"] = 0] = \"None\";\n        // Options\n        NodeBuilderFlags[NodeBuilderFlags[\"NoTruncation\"] = 1] = \"NoTruncation\";\n        NodeBuilderFlags[NodeBuilderFlags[\"WriteArrayAsGenericType\"] = 2] = \"WriteArrayAsGenericType\";\n        NodeBuilderFlags[NodeBuilderFlags[\"GenerateNamesForShadowedTypeParams\"] = 4] = \"GenerateNamesForShadowedTypeParams\";\n        NodeBuilderFlags[NodeBuilderFlags[\"UseStructuralFallback\"] = 8] = \"UseStructuralFallback\";\n        NodeBuilderFlags[NodeBuilderFlags[\"ForbidIndexedAccessSymbolReferences\"] = 16] = \"ForbidIndexedAccessSymbolReferences\";\n        NodeBuilderFlags[NodeBuilderFlags[\"WriteTypeArgumentsOfSignature\"] = 32] = \"WriteTypeArgumentsOfSignature\";\n        NodeBuilderFlags[NodeBuilderFlags[\"UseFullyQualifiedType\"] = 64] = \"UseFullyQualifiedType\";\n        NodeBuilderFlags[NodeBuilderFlags[\"UseOnlyExternalAliasing\"] = 128] = \"UseOnlyExternalAliasing\";\n        NodeBuilderFlags[NodeBuilderFlags[\"SuppressAnyReturnType\"] = 256] = \"SuppressAnyReturnType\";\n        NodeBuilderFlags[NodeBuilderFlags[\"WriteTypeParametersInQualifiedName\"] = 512] = \"WriteTypeParametersInQualifiedName\";\n        NodeBuilderFlags[NodeBuilderFlags[\"MultilineObjectLiterals\"] = 1024] = \"MultilineObjectLiterals\";\n        NodeBuilderFlags[NodeBuilderFlags[\"WriteClassExpressionAsTypeLiteral\"] = 2048] = \"WriteClassExpressionAsTypeLiteral\";\n        NodeBuilderFlags[NodeBuilderFlags[\"UseTypeOfFunction\"] = 4096] = \"UseTypeOfFunction\";\n        NodeBuilderFlags[NodeBuilderFlags[\"OmitParameterModifiers\"] = 8192] = \"OmitParameterModifiers\";\n        NodeBuilderFlags[NodeBuilderFlags[\"UseAliasDefinedOutsideCurrentScope\"] = 16384] = \"UseAliasDefinedOutsideCurrentScope\";\n        NodeBuilderFlags[NodeBuilderFlags[\"UseSingleQuotesForStringLiteralType\"] = 268435456] = \"UseSingleQuotesForStringLiteralType\";\n        NodeBuilderFlags[NodeBuilderFlags[\"NoTypeReduction\"] = 536870912] = \"NoTypeReduction\";\n        NodeBuilderFlags[NodeBuilderFlags[\"NoUndefinedOptionalParameterType\"] = 1073741824] = \"NoUndefinedOptionalParameterType\";\n        // Error handling\n        NodeBuilderFlags[NodeBuilderFlags[\"AllowThisInObjectLiteral\"] = 32768] = \"AllowThisInObjectLiteral\";\n        NodeBuilderFlags[NodeBuilderFlags[\"AllowQualifedNameInPlaceOfIdentifier\"] = 65536] = \"AllowQualifedNameInPlaceOfIdentifier\";\n        NodeBuilderFlags[NodeBuilderFlags[\"AllowAnonymousIdentifier\"] = 131072] = \"AllowAnonymousIdentifier\";\n        NodeBuilderFlags[NodeBuilderFlags[\"AllowEmptyUnionOrIntersection\"] = 262144] = \"AllowEmptyUnionOrIntersection\";\n        NodeBuilderFlags[NodeBuilderFlags[\"AllowEmptyTuple\"] = 524288] = \"AllowEmptyTuple\";\n        NodeBuilderFlags[NodeBuilderFlags[\"AllowUniqueESSymbolType\"] = 1048576] = \"AllowUniqueESSymbolType\";\n        NodeBuilderFlags[NodeBuilderFlags[\"AllowEmptyIndexInfoType\"] = 2097152] = \"AllowEmptyIndexInfoType\";\n        // Errors (cont.)\n        NodeBuilderFlags[NodeBuilderFlags[\"AllowNodeModulesRelativePaths\"] = 67108864] = \"AllowNodeModulesRelativePaths\";\n        /* @internal */ NodeBuilderFlags[NodeBuilderFlags[\"DoNotIncludeSymbolChain\"] = 134217728] = \"DoNotIncludeSymbolChain\";\n        NodeBuilderFlags[NodeBuilderFlags[\"IgnoreErrors\"] = 70221824] = \"IgnoreErrors\";\n        // State\n        NodeBuilderFlags[NodeBuilderFlags[\"InObjectTypeLiteral\"] = 4194304] = \"InObjectTypeLiteral\";\n        NodeBuilderFlags[NodeBuilderFlags[\"InTypeAlias\"] = 8388608] = \"InTypeAlias\";\n        NodeBuilderFlags[NodeBuilderFlags[\"InInitialEntityName\"] = 16777216] = \"InInitialEntityName\";\n        NodeBuilderFlags[NodeBuilderFlags[\"InReverseMappedType\"] = 33554432] = \"InReverseMappedType\";\n    })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {}));\n    // Ensure the shared flags between this and `NodeBuilderFlags` stay in alignment\n    var TypeFormatFlags;\n    (function (TypeFormatFlags) {\n        TypeFormatFlags[TypeFormatFlags[\"None\"] = 0] = \"None\";\n        TypeFormatFlags[TypeFormatFlags[\"NoTruncation\"] = 1] = \"NoTruncation\";\n        TypeFormatFlags[TypeFormatFlags[\"WriteArrayAsGenericType\"] = 2] = \"WriteArrayAsGenericType\";\n        // hole because there's a hole in node builder flags\n        TypeFormatFlags[TypeFormatFlags[\"UseStructuralFallback\"] = 8] = \"UseStructuralFallback\";\n        // hole because there's a hole in node builder flags\n        TypeFormatFlags[TypeFormatFlags[\"WriteTypeArgumentsOfSignature\"] = 32] = \"WriteTypeArgumentsOfSignature\";\n        TypeFormatFlags[TypeFormatFlags[\"UseFullyQualifiedType\"] = 64] = \"UseFullyQualifiedType\";\n        // hole because `UseOnlyExternalAliasing` is here in node builder flags, but functions which take old flags use `SymbolFormatFlags` instead\n        TypeFormatFlags[TypeFormatFlags[\"SuppressAnyReturnType\"] = 256] = \"SuppressAnyReturnType\";\n        // hole because `WriteTypeParametersInQualifiedName` is here in node builder flags, but functions which take old flags use `SymbolFormatFlags` for this instead\n        TypeFormatFlags[TypeFormatFlags[\"MultilineObjectLiterals\"] = 1024] = \"MultilineObjectLiterals\";\n        TypeFormatFlags[TypeFormatFlags[\"WriteClassExpressionAsTypeLiteral\"] = 2048] = \"WriteClassExpressionAsTypeLiteral\";\n        TypeFormatFlags[TypeFormatFlags[\"UseTypeOfFunction\"] = 4096] = \"UseTypeOfFunction\";\n        TypeFormatFlags[TypeFormatFlags[\"OmitParameterModifiers\"] = 8192] = \"OmitParameterModifiers\";\n        TypeFormatFlags[TypeFormatFlags[\"UseAliasDefinedOutsideCurrentScope\"] = 16384] = \"UseAliasDefinedOutsideCurrentScope\";\n        TypeFormatFlags[TypeFormatFlags[\"UseSingleQuotesForStringLiteralType\"] = 268435456] = \"UseSingleQuotesForStringLiteralType\";\n        TypeFormatFlags[TypeFormatFlags[\"NoTypeReduction\"] = 536870912] = \"NoTypeReduction\";\n        // Error Handling\n        TypeFormatFlags[TypeFormatFlags[\"AllowUniqueESSymbolType\"] = 1048576] = \"AllowUniqueESSymbolType\";\n        // TypeFormatFlags exclusive\n        TypeFormatFlags[TypeFormatFlags[\"AddUndefined\"] = 131072] = \"AddUndefined\";\n        TypeFormatFlags[TypeFormatFlags[\"WriteArrowStyleSignature\"] = 262144] = \"WriteArrowStyleSignature\";\n        // State\n        TypeFormatFlags[TypeFormatFlags[\"InArrayType\"] = 524288] = \"InArrayType\";\n        TypeFormatFlags[TypeFormatFlags[\"InElementType\"] = 2097152] = \"InElementType\";\n        TypeFormatFlags[TypeFormatFlags[\"InFirstTypeArgument\"] = 4194304] = \"InFirstTypeArgument\";\n        TypeFormatFlags[TypeFormatFlags[\"InTypeAlias\"] = 8388608] = \"InTypeAlias\";\n        /** @deprecated */ TypeFormatFlags[TypeFormatFlags[\"WriteOwnNameForAnyLike\"] = 0] = \"WriteOwnNameForAnyLike\";\n        TypeFormatFlags[TypeFormatFlags[\"NodeBuilderFlagsMask\"] = 814775659] = \"NodeBuilderFlagsMask\";\n    })(TypeFormatFlags = ts.TypeFormatFlags || (ts.TypeFormatFlags = {}));\n    var SymbolFormatFlags;\n    (function (SymbolFormatFlags) {\n        SymbolFormatFlags[SymbolFormatFlags[\"None\"] = 0] = \"None\";\n        // Write symbols's type argument if it is instantiated symbol\n        // eg. class C<T> { p: T }   <-- Show p as C<T>.p here\n        //     var a: C<number>;\n        //     var p = a.p; <--- Here p is property of C<number> so show it as C<number>.p instead of just C.p\n        SymbolFormatFlags[SymbolFormatFlags[\"WriteTypeParametersOrArguments\"] = 1] = \"WriteTypeParametersOrArguments\";\n        // Use only external alias information to get the symbol name in the given context\n        // eg.  module m { export class c { } } import x = m.c;\n        // When this flag is specified m.c will be used to refer to the class instead of alias symbol x\n        SymbolFormatFlags[SymbolFormatFlags[\"UseOnlyExternalAliasing\"] = 2] = \"UseOnlyExternalAliasing\";\n        // Build symbol name using any nodes needed, instead of just components of an entity name\n        SymbolFormatFlags[SymbolFormatFlags[\"AllowAnyNodeKind\"] = 4] = \"AllowAnyNodeKind\";\n        // Prefer aliases which are not directly visible\n        SymbolFormatFlags[SymbolFormatFlags[\"UseAliasDefinedOutsideCurrentScope\"] = 8] = \"UseAliasDefinedOutsideCurrentScope\";\n        // Skip building an accessible symbol chain\n        /* @internal */ SymbolFormatFlags[SymbolFormatFlags[\"DoNotIncludeSymbolChain\"] = 16] = \"DoNotIncludeSymbolChain\";\n    })(SymbolFormatFlags = ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {}));\n    /* @internal */\n    var SymbolAccessibility;\n    (function (SymbolAccessibility) {\n        SymbolAccessibility[SymbolAccessibility[\"Accessible\"] = 0] = \"Accessible\";\n        SymbolAccessibility[SymbolAccessibility[\"NotAccessible\"] = 1] = \"NotAccessible\";\n        SymbolAccessibility[SymbolAccessibility[\"CannotBeNamed\"] = 2] = \"CannotBeNamed\";\n    })(SymbolAccessibility = ts.SymbolAccessibility || (ts.SymbolAccessibility = {}));\n    /* @internal */\n    var SyntheticSymbolKind;\n    (function (SyntheticSymbolKind) {\n        SyntheticSymbolKind[SyntheticSymbolKind[\"UnionOrIntersection\"] = 0] = \"UnionOrIntersection\";\n        SyntheticSymbolKind[SyntheticSymbolKind[\"Spread\"] = 1] = \"Spread\";\n    })(SyntheticSymbolKind = ts.SyntheticSymbolKind || (ts.SyntheticSymbolKind = {}));\n    var TypePredicateKind;\n    (function (TypePredicateKind) {\n        TypePredicateKind[TypePredicateKind[\"This\"] = 0] = \"This\";\n        TypePredicateKind[TypePredicateKind[\"Identifier\"] = 1] = \"Identifier\";\n        TypePredicateKind[TypePredicateKind[\"AssertsThis\"] = 2] = \"AssertsThis\";\n        TypePredicateKind[TypePredicateKind[\"AssertsIdentifier\"] = 3] = \"AssertsIdentifier\";\n    })(TypePredicateKind = ts.TypePredicateKind || (ts.TypePredicateKind = {}));\n    /** Indicates how to serialize the name for a TypeReferenceNode when emitting decorator metadata */\n    /* @internal */\n    var TypeReferenceSerializationKind;\n    (function (TypeReferenceSerializationKind) {\n        // The TypeReferenceNode could not be resolved.\n        // The type name should be emitted using a safe fallback.\n        TypeReferenceSerializationKind[TypeReferenceSerializationKind[\"Unknown\"] = 0] = \"Unknown\";\n        // The TypeReferenceNode resolves to a type with a constructor\n        // function that can be reached at runtime (e.g. a `class`\n        // declaration or a `var` declaration for the static side\n        // of a type, such as the global `Promise` type in lib.d.ts).\n        TypeReferenceSerializationKind[TypeReferenceSerializationKind[\"TypeWithConstructSignatureAndValue\"] = 1] = \"TypeWithConstructSignatureAndValue\";\n        // The TypeReferenceNode resolves to a Void-like, Nullable, or Never type.\n        TypeReferenceSerializationKind[TypeReferenceSerializationKind[\"VoidNullableOrNeverType\"] = 2] = \"VoidNullableOrNeverType\";\n        // The TypeReferenceNode resolves to a Number-like type.\n        TypeReferenceSerializationKind[TypeReferenceSerializationKind[\"NumberLikeType\"] = 3] = \"NumberLikeType\";\n        // The TypeReferenceNode resolves to a BigInt-like type.\n        TypeReferenceSerializationKind[TypeReferenceSerializationKind[\"BigIntLikeType\"] = 4] = \"BigIntLikeType\";\n        // The TypeReferenceNode resolves to a String-like type.\n        TypeReferenceSerializationKind[TypeReferenceSerializationKind[\"StringLikeType\"] = 5] = \"StringLikeType\";\n        // The TypeReferenceNode resolves to a Boolean-like type.\n        TypeReferenceSerializationKind[TypeReferenceSerializationKind[\"BooleanType\"] = 6] = \"BooleanType\";\n        // The TypeReferenceNode resolves to an Array-like type.\n        TypeReferenceSerializationKind[TypeReferenceSerializationKind[\"ArrayLikeType\"] = 7] = \"ArrayLikeType\";\n        // The TypeReferenceNode resolves to the ESSymbol type.\n        TypeReferenceSerializationKind[TypeReferenceSerializationKind[\"ESSymbolType\"] = 8] = \"ESSymbolType\";\n        // The TypeReferenceNode resolved to the global Promise constructor symbol.\n        TypeReferenceSerializationKind[TypeReferenceSerializationKind[\"Promise\"] = 9] = \"Promise\";\n        // The TypeReferenceNode resolves to a Function type or a type with call signatures.\n        TypeReferenceSerializationKind[TypeReferenceSerializationKind[\"TypeWithCallSignature\"] = 10] = \"TypeWithCallSignature\";\n        // The TypeReferenceNode resolves to any other type.\n        TypeReferenceSerializationKind[TypeReferenceSerializationKind[\"ObjectType\"] = 11] = \"ObjectType\";\n    })(TypeReferenceSerializationKind = ts.TypeReferenceSerializationKind || (ts.TypeReferenceSerializationKind = {}));\n    var SymbolFlags;\n    (function (SymbolFlags) {\n        SymbolFlags[SymbolFlags[\"None\"] = 0] = \"None\";\n        SymbolFlags[SymbolFlags[\"FunctionScopedVariable\"] = 1] = \"FunctionScopedVariable\";\n        SymbolFlags[SymbolFlags[\"BlockScopedVariable\"] = 2] = \"BlockScopedVariable\";\n        SymbolFlags[SymbolFlags[\"Property\"] = 4] = \"Property\";\n        SymbolFlags[SymbolFlags[\"EnumMember\"] = 8] = \"EnumMember\";\n        SymbolFlags[SymbolFlags[\"Function\"] = 16] = \"Function\";\n        SymbolFlags[SymbolFlags[\"Class\"] = 32] = \"Class\";\n        SymbolFlags[SymbolFlags[\"Interface\"] = 64] = \"Interface\";\n        SymbolFlags[SymbolFlags[\"ConstEnum\"] = 128] = \"ConstEnum\";\n        SymbolFlags[SymbolFlags[\"RegularEnum\"] = 256] = \"RegularEnum\";\n        SymbolFlags[SymbolFlags[\"ValueModule\"] = 512] = \"ValueModule\";\n        SymbolFlags[SymbolFlags[\"NamespaceModule\"] = 1024] = \"NamespaceModule\";\n        SymbolFlags[SymbolFlags[\"TypeLiteral\"] = 2048] = \"TypeLiteral\";\n        SymbolFlags[SymbolFlags[\"ObjectLiteral\"] = 4096] = \"ObjectLiteral\";\n        SymbolFlags[SymbolFlags[\"Method\"] = 8192] = \"Method\";\n        SymbolFlags[SymbolFlags[\"Constructor\"] = 16384] = \"Constructor\";\n        SymbolFlags[SymbolFlags[\"GetAccessor\"] = 32768] = \"GetAccessor\";\n        SymbolFlags[SymbolFlags[\"SetAccessor\"] = 65536] = \"SetAccessor\";\n        SymbolFlags[SymbolFlags[\"Signature\"] = 131072] = \"Signature\";\n        SymbolFlags[SymbolFlags[\"TypeParameter\"] = 262144] = \"TypeParameter\";\n        SymbolFlags[SymbolFlags[\"TypeAlias\"] = 524288] = \"TypeAlias\";\n        SymbolFlags[SymbolFlags[\"ExportValue\"] = 1048576] = \"ExportValue\";\n        SymbolFlags[SymbolFlags[\"Alias\"] = 2097152] = \"Alias\";\n        SymbolFlags[SymbolFlags[\"Prototype\"] = 4194304] = \"Prototype\";\n        SymbolFlags[SymbolFlags[\"ExportStar\"] = 8388608] = \"ExportStar\";\n        SymbolFlags[SymbolFlags[\"Optional\"] = 16777216] = \"Optional\";\n        SymbolFlags[SymbolFlags[\"Transient\"] = 33554432] = \"Transient\";\n        SymbolFlags[SymbolFlags[\"Assignment\"] = 67108864] = \"Assignment\";\n        SymbolFlags[SymbolFlags[\"ModuleExports\"] = 134217728] = \"ModuleExports\";\n        /* @internal */\n        SymbolFlags[SymbolFlags[\"All\"] = 67108863] = \"All\";\n        SymbolFlags[SymbolFlags[\"Enum\"] = 384] = \"Enum\";\n        SymbolFlags[SymbolFlags[\"Variable\"] = 3] = \"Variable\";\n        SymbolFlags[SymbolFlags[\"Value\"] = 111551] = \"Value\";\n        SymbolFlags[SymbolFlags[\"Type\"] = 788968] = \"Type\";\n        SymbolFlags[SymbolFlags[\"Namespace\"] = 1920] = \"Namespace\";\n        SymbolFlags[SymbolFlags[\"Module\"] = 1536] = \"Module\";\n        SymbolFlags[SymbolFlags[\"Accessor\"] = 98304] = \"Accessor\";\n        // Variables can be redeclared, but can not redeclare a block-scoped declaration with the\n        // same name, or any other value that is not a variable, e.g. ValueModule or Class\n        SymbolFlags[SymbolFlags[\"FunctionScopedVariableExcludes\"] = 111550] = \"FunctionScopedVariableExcludes\";\n        // Block-scoped declarations are not allowed to be re-declared\n        // they can not merge with anything in the value space\n        SymbolFlags[SymbolFlags[\"BlockScopedVariableExcludes\"] = 111551] = \"BlockScopedVariableExcludes\";\n        SymbolFlags[SymbolFlags[\"ParameterExcludes\"] = 111551] = \"ParameterExcludes\";\n        SymbolFlags[SymbolFlags[\"PropertyExcludes\"] = 0] = \"PropertyExcludes\";\n        SymbolFlags[SymbolFlags[\"EnumMemberExcludes\"] = 900095] = \"EnumMemberExcludes\";\n        SymbolFlags[SymbolFlags[\"FunctionExcludes\"] = 110991] = \"FunctionExcludes\";\n        SymbolFlags[SymbolFlags[\"ClassExcludes\"] = 899503] = \"ClassExcludes\";\n        SymbolFlags[SymbolFlags[\"InterfaceExcludes\"] = 788872] = \"InterfaceExcludes\";\n        SymbolFlags[SymbolFlags[\"RegularEnumExcludes\"] = 899327] = \"RegularEnumExcludes\";\n        SymbolFlags[SymbolFlags[\"ConstEnumExcludes\"] = 899967] = \"ConstEnumExcludes\";\n        SymbolFlags[SymbolFlags[\"ValueModuleExcludes\"] = 110735] = \"ValueModuleExcludes\";\n        SymbolFlags[SymbolFlags[\"NamespaceModuleExcludes\"] = 0] = \"NamespaceModuleExcludes\";\n        SymbolFlags[SymbolFlags[\"MethodExcludes\"] = 103359] = \"MethodExcludes\";\n        SymbolFlags[SymbolFlags[\"GetAccessorExcludes\"] = 46015] = \"GetAccessorExcludes\";\n        SymbolFlags[SymbolFlags[\"SetAccessorExcludes\"] = 78783] = \"SetAccessorExcludes\";\n        SymbolFlags[SymbolFlags[\"TypeParameterExcludes\"] = 526824] = \"TypeParameterExcludes\";\n        SymbolFlags[SymbolFlags[\"TypeAliasExcludes\"] = 788968] = \"TypeAliasExcludes\";\n        SymbolFlags[SymbolFlags[\"AliasExcludes\"] = 2097152] = \"AliasExcludes\";\n        SymbolFlags[SymbolFlags[\"ModuleMember\"] = 2623475] = \"ModuleMember\";\n        SymbolFlags[SymbolFlags[\"ExportHasLocal\"] = 944] = \"ExportHasLocal\";\n        SymbolFlags[SymbolFlags[\"BlockScoped\"] = 418] = \"BlockScoped\";\n        SymbolFlags[SymbolFlags[\"PropertyOrAccessor\"] = 98308] = \"PropertyOrAccessor\";\n        SymbolFlags[SymbolFlags[\"ClassMember\"] = 106500] = \"ClassMember\";\n        /* @internal */\n        SymbolFlags[SymbolFlags[\"ExportSupportsDefaultModifier\"] = 112] = \"ExportSupportsDefaultModifier\";\n        /* @internal */\n        SymbolFlags[SymbolFlags[\"ExportDoesNotSupportDefaultModifier\"] = -113] = \"ExportDoesNotSupportDefaultModifier\";\n        /* @internal */\n        // The set of things we consider semantically classifiable.  Used to speed up the LS during\n        // classification.\n        SymbolFlags[SymbolFlags[\"Classifiable\"] = 2885600] = \"Classifiable\";\n        /* @internal */\n        SymbolFlags[SymbolFlags[\"LateBindingContainer\"] = 6256] = \"LateBindingContainer\";\n    })(SymbolFlags = ts.SymbolFlags || (ts.SymbolFlags = {}));\n    /* @internal */\n    var EnumKind;\n    (function (EnumKind) {\n        EnumKind[EnumKind[\"Numeric\"] = 0] = \"Numeric\";\n        EnumKind[EnumKind[\"Literal\"] = 1] = \"Literal\"; // Literal enum (each member has a TypeFlags.EnumLiteral type)\n    })(EnumKind = ts.EnumKind || (ts.EnumKind = {}));\n    /* @internal */\n    var CheckFlags;\n    (function (CheckFlags) {\n        CheckFlags[CheckFlags[\"Instantiated\"] = 1] = \"Instantiated\";\n        CheckFlags[CheckFlags[\"SyntheticProperty\"] = 2] = \"SyntheticProperty\";\n        CheckFlags[CheckFlags[\"SyntheticMethod\"] = 4] = \"SyntheticMethod\";\n        CheckFlags[CheckFlags[\"Readonly\"] = 8] = \"Readonly\";\n        CheckFlags[CheckFlags[\"ReadPartial\"] = 16] = \"ReadPartial\";\n        CheckFlags[CheckFlags[\"WritePartial\"] = 32] = \"WritePartial\";\n        CheckFlags[CheckFlags[\"HasNonUniformType\"] = 64] = \"HasNonUniformType\";\n        CheckFlags[CheckFlags[\"HasLiteralType\"] = 128] = \"HasLiteralType\";\n        CheckFlags[CheckFlags[\"ContainsPublic\"] = 256] = \"ContainsPublic\";\n        CheckFlags[CheckFlags[\"ContainsProtected\"] = 512] = \"ContainsProtected\";\n        CheckFlags[CheckFlags[\"ContainsPrivate\"] = 1024] = \"ContainsPrivate\";\n        CheckFlags[CheckFlags[\"ContainsStatic\"] = 2048] = \"ContainsStatic\";\n        CheckFlags[CheckFlags[\"Late\"] = 4096] = \"Late\";\n        CheckFlags[CheckFlags[\"ReverseMapped\"] = 8192] = \"ReverseMapped\";\n        CheckFlags[CheckFlags[\"OptionalParameter\"] = 16384] = \"OptionalParameter\";\n        CheckFlags[CheckFlags[\"RestParameter\"] = 32768] = \"RestParameter\";\n        CheckFlags[CheckFlags[\"DeferredType\"] = 65536] = \"DeferredType\";\n        CheckFlags[CheckFlags[\"HasNeverType\"] = 131072] = \"HasNeverType\";\n        CheckFlags[CheckFlags[\"Mapped\"] = 262144] = \"Mapped\";\n        CheckFlags[CheckFlags[\"StripOptional\"] = 524288] = \"StripOptional\";\n        CheckFlags[CheckFlags[\"Synthetic\"] = 6] = \"Synthetic\";\n        CheckFlags[CheckFlags[\"Discriminant\"] = 192] = \"Discriminant\";\n        CheckFlags[CheckFlags[\"Partial\"] = 48] = \"Partial\";\n    })(CheckFlags = ts.CheckFlags || (ts.CheckFlags = {}));\n    var InternalSymbolName;\n    (function (InternalSymbolName) {\n        InternalSymbolName[\"Call\"] = \"__call\";\n        InternalSymbolName[\"Constructor\"] = \"__constructor\";\n        InternalSymbolName[\"New\"] = \"__new\";\n        InternalSymbolName[\"Index\"] = \"__index\";\n        InternalSymbolName[\"ExportStar\"] = \"__export\";\n        InternalSymbolName[\"Global\"] = \"__global\";\n        InternalSymbolName[\"Missing\"] = \"__missing\";\n        InternalSymbolName[\"Type\"] = \"__type\";\n        InternalSymbolName[\"Object\"] = \"__object\";\n        InternalSymbolName[\"JSXAttributes\"] = \"__jsxAttributes\";\n        InternalSymbolName[\"Class\"] = \"__class\";\n        InternalSymbolName[\"Function\"] = \"__function\";\n        InternalSymbolName[\"Computed\"] = \"__computed\";\n        InternalSymbolName[\"Resolving\"] = \"__resolving__\";\n        InternalSymbolName[\"ExportEquals\"] = \"export=\";\n        InternalSymbolName[\"Default\"] = \"default\";\n        InternalSymbolName[\"This\"] = \"this\";\n    })(InternalSymbolName = ts.InternalSymbolName || (ts.InternalSymbolName = {}));\n    /* @internal */\n    var NodeCheckFlags;\n    (function (NodeCheckFlags) {\n        NodeCheckFlags[NodeCheckFlags[\"TypeChecked\"] = 1] = \"TypeChecked\";\n        NodeCheckFlags[NodeCheckFlags[\"LexicalThis\"] = 2] = \"LexicalThis\";\n        NodeCheckFlags[NodeCheckFlags[\"CaptureThis\"] = 4] = \"CaptureThis\";\n        NodeCheckFlags[NodeCheckFlags[\"CaptureNewTarget\"] = 8] = \"CaptureNewTarget\";\n        NodeCheckFlags[NodeCheckFlags[\"SuperInstance\"] = 256] = \"SuperInstance\";\n        NodeCheckFlags[NodeCheckFlags[\"SuperStatic\"] = 512] = \"SuperStatic\";\n        NodeCheckFlags[NodeCheckFlags[\"ContextChecked\"] = 1024] = \"ContextChecked\";\n        NodeCheckFlags[NodeCheckFlags[\"AsyncMethodWithSuper\"] = 2048] = \"AsyncMethodWithSuper\";\n        NodeCheckFlags[NodeCheckFlags[\"AsyncMethodWithSuperBinding\"] = 4096] = \"AsyncMethodWithSuperBinding\";\n        NodeCheckFlags[NodeCheckFlags[\"CaptureArguments\"] = 8192] = \"CaptureArguments\";\n        NodeCheckFlags[NodeCheckFlags[\"EnumValuesComputed\"] = 16384] = \"EnumValuesComputed\";\n        NodeCheckFlags[NodeCheckFlags[\"LexicalModuleMergesWithClass\"] = 32768] = \"LexicalModuleMergesWithClass\";\n        NodeCheckFlags[NodeCheckFlags[\"LoopWithCapturedBlockScopedBinding\"] = 65536] = \"LoopWithCapturedBlockScopedBinding\";\n        NodeCheckFlags[NodeCheckFlags[\"ContainsCapturedBlockScopeBinding\"] = 131072] = \"ContainsCapturedBlockScopeBinding\";\n        NodeCheckFlags[NodeCheckFlags[\"CapturedBlockScopedBinding\"] = 262144] = \"CapturedBlockScopedBinding\";\n        NodeCheckFlags[NodeCheckFlags[\"BlockScopedBindingInLoop\"] = 524288] = \"BlockScopedBindingInLoop\";\n        NodeCheckFlags[NodeCheckFlags[\"ClassWithBodyScopedClassBinding\"] = 1048576] = \"ClassWithBodyScopedClassBinding\";\n        NodeCheckFlags[NodeCheckFlags[\"BodyScopedClassBinding\"] = 2097152] = \"BodyScopedClassBinding\";\n        NodeCheckFlags[NodeCheckFlags[\"NeedsLoopOutParameter\"] = 4194304] = \"NeedsLoopOutParameter\";\n        NodeCheckFlags[NodeCheckFlags[\"AssignmentsMarked\"] = 8388608] = \"AssignmentsMarked\";\n        NodeCheckFlags[NodeCheckFlags[\"ClassWithConstructorReference\"] = 16777216] = \"ClassWithConstructorReference\";\n        NodeCheckFlags[NodeCheckFlags[\"ConstructorReferenceInClass\"] = 33554432] = \"ConstructorReferenceInClass\";\n        NodeCheckFlags[NodeCheckFlags[\"ContainsClassWithPrivateIdentifiers\"] = 67108864] = \"ContainsClassWithPrivateIdentifiers\";\n    })(NodeCheckFlags = ts.NodeCheckFlags || (ts.NodeCheckFlags = {}));\n    var TypeFlags;\n    (function (TypeFlags) {\n        TypeFlags[TypeFlags[\"Any\"] = 1] = \"Any\";\n        TypeFlags[TypeFlags[\"Unknown\"] = 2] = \"Unknown\";\n        TypeFlags[TypeFlags[\"String\"] = 4] = \"String\";\n        TypeFlags[TypeFlags[\"Number\"] = 8] = \"Number\";\n        TypeFlags[TypeFlags[\"Boolean\"] = 16] = \"Boolean\";\n        TypeFlags[TypeFlags[\"Enum\"] = 32] = \"Enum\";\n        TypeFlags[TypeFlags[\"BigInt\"] = 64] = \"BigInt\";\n        TypeFlags[TypeFlags[\"StringLiteral\"] = 128] = \"StringLiteral\";\n        TypeFlags[TypeFlags[\"NumberLiteral\"] = 256] = \"NumberLiteral\";\n        TypeFlags[TypeFlags[\"BooleanLiteral\"] = 512] = \"BooleanLiteral\";\n        TypeFlags[TypeFlags[\"EnumLiteral\"] = 1024] = \"EnumLiteral\";\n        TypeFlags[TypeFlags[\"BigIntLiteral\"] = 2048] = \"BigIntLiteral\";\n        TypeFlags[TypeFlags[\"ESSymbol\"] = 4096] = \"ESSymbol\";\n        TypeFlags[TypeFlags[\"UniqueESSymbol\"] = 8192] = \"UniqueESSymbol\";\n        TypeFlags[TypeFlags[\"Void\"] = 16384] = \"Void\";\n        TypeFlags[TypeFlags[\"Undefined\"] = 32768] = \"Undefined\";\n        TypeFlags[TypeFlags[\"Null\"] = 65536] = \"Null\";\n        TypeFlags[TypeFlags[\"Never\"] = 131072] = \"Never\";\n        TypeFlags[TypeFlags[\"TypeParameter\"] = 262144] = \"TypeParameter\";\n        TypeFlags[TypeFlags[\"Object\"] = 524288] = \"Object\";\n        TypeFlags[TypeFlags[\"Union\"] = 1048576] = \"Union\";\n        TypeFlags[TypeFlags[\"Intersection\"] = 2097152] = \"Intersection\";\n        TypeFlags[TypeFlags[\"Index\"] = 4194304] = \"Index\";\n        TypeFlags[TypeFlags[\"IndexedAccess\"] = 8388608] = \"IndexedAccess\";\n        TypeFlags[TypeFlags[\"Conditional\"] = 16777216] = \"Conditional\";\n        TypeFlags[TypeFlags[\"Substitution\"] = 33554432] = \"Substitution\";\n        TypeFlags[TypeFlags[\"NonPrimitive\"] = 67108864] = \"NonPrimitive\";\n        TypeFlags[TypeFlags[\"TemplateLiteral\"] = 134217728] = \"TemplateLiteral\";\n        TypeFlags[TypeFlags[\"StringMapping\"] = 268435456] = \"StringMapping\";\n        /* @internal */\n        TypeFlags[TypeFlags[\"AnyOrUnknown\"] = 3] = \"AnyOrUnknown\";\n        /* @internal */\n        TypeFlags[TypeFlags[\"Nullable\"] = 98304] = \"Nullable\";\n        TypeFlags[TypeFlags[\"Literal\"] = 2944] = \"Literal\";\n        TypeFlags[TypeFlags[\"Unit\"] = 109440] = \"Unit\";\n        TypeFlags[TypeFlags[\"StringOrNumberLiteral\"] = 384] = \"StringOrNumberLiteral\";\n        /* @internal */\n        TypeFlags[TypeFlags[\"StringOrNumberLiteralOrUnique\"] = 8576] = \"StringOrNumberLiteralOrUnique\";\n        /* @internal */\n        TypeFlags[TypeFlags[\"DefinitelyFalsy\"] = 117632] = \"DefinitelyFalsy\";\n        TypeFlags[TypeFlags[\"PossiblyFalsy\"] = 117724] = \"PossiblyFalsy\";\n        /* @internal */\n        TypeFlags[TypeFlags[\"Intrinsic\"] = 67359327] = \"Intrinsic\";\n        /* @internal */\n        TypeFlags[TypeFlags[\"Primitive\"] = 131068] = \"Primitive\";\n        TypeFlags[TypeFlags[\"StringLike\"] = 402653316] = \"StringLike\";\n        TypeFlags[TypeFlags[\"NumberLike\"] = 296] = \"NumberLike\";\n        TypeFlags[TypeFlags[\"BigIntLike\"] = 2112] = \"BigIntLike\";\n        TypeFlags[TypeFlags[\"BooleanLike\"] = 528] = \"BooleanLike\";\n        TypeFlags[TypeFlags[\"EnumLike\"] = 1056] = \"EnumLike\";\n        TypeFlags[TypeFlags[\"ESSymbolLike\"] = 12288] = \"ESSymbolLike\";\n        TypeFlags[TypeFlags[\"VoidLike\"] = 49152] = \"VoidLike\";\n        /* @internal */\n        TypeFlags[TypeFlags[\"DisjointDomains\"] = 469892092] = \"DisjointDomains\";\n        TypeFlags[TypeFlags[\"UnionOrIntersection\"] = 3145728] = \"UnionOrIntersection\";\n        TypeFlags[TypeFlags[\"StructuredType\"] = 3670016] = \"StructuredType\";\n        TypeFlags[TypeFlags[\"TypeVariable\"] = 8650752] = \"TypeVariable\";\n        TypeFlags[TypeFlags[\"InstantiableNonPrimitive\"] = 58982400] = \"InstantiableNonPrimitive\";\n        TypeFlags[TypeFlags[\"InstantiablePrimitive\"] = 406847488] = \"InstantiablePrimitive\";\n        TypeFlags[TypeFlags[\"Instantiable\"] = 465829888] = \"Instantiable\";\n        TypeFlags[TypeFlags[\"StructuredOrInstantiable\"] = 469499904] = \"StructuredOrInstantiable\";\n        /* @internal */\n        TypeFlags[TypeFlags[\"ObjectFlagsType\"] = 3899393] = \"ObjectFlagsType\";\n        /* @internal */\n        TypeFlags[TypeFlags[\"Simplifiable\"] = 25165824] = \"Simplifiable\";\n        /* @internal */\n        TypeFlags[TypeFlags[\"Substructure\"] = 469237760] = \"Substructure\";\n        // 'Narrowable' types are types where narrowing actually narrows.\n        // This *should* be every type other than null, undefined, void, and never\n        TypeFlags[TypeFlags[\"Narrowable\"] = 536624127] = \"Narrowable\";\n        /* @internal */\n        TypeFlags[TypeFlags[\"NotPrimitiveUnion\"] = 468598819] = \"NotPrimitiveUnion\";\n        // The following flags are aggregated during union and intersection type construction\n        /* @internal */\n        TypeFlags[TypeFlags[\"IncludesMask\"] = 205258751] = \"IncludesMask\";\n        // The following flags are used for different purposes during union and intersection type construction\n        /* @internal */\n        TypeFlags[TypeFlags[\"IncludesStructuredOrInstantiable\"] = 262144] = \"IncludesStructuredOrInstantiable\";\n        /* @internal */\n        TypeFlags[TypeFlags[\"IncludesNonWideningType\"] = 4194304] = \"IncludesNonWideningType\";\n        /* @internal */\n        TypeFlags[TypeFlags[\"IncludesWildcard\"] = 8388608] = \"IncludesWildcard\";\n        /* @internal */\n        TypeFlags[TypeFlags[\"IncludesEmptyObject\"] = 16777216] = \"IncludesEmptyObject\";\n    })(TypeFlags = ts.TypeFlags || (ts.TypeFlags = {}));\n    var ObjectFlags;\n    (function (ObjectFlags) {\n        ObjectFlags[ObjectFlags[\"Class\"] = 1] = \"Class\";\n        ObjectFlags[ObjectFlags[\"Interface\"] = 2] = \"Interface\";\n        ObjectFlags[ObjectFlags[\"Reference\"] = 4] = \"Reference\";\n        ObjectFlags[ObjectFlags[\"Tuple\"] = 8] = \"Tuple\";\n        ObjectFlags[ObjectFlags[\"Anonymous\"] = 16] = \"Anonymous\";\n        ObjectFlags[ObjectFlags[\"Mapped\"] = 32] = \"Mapped\";\n        ObjectFlags[ObjectFlags[\"Instantiated\"] = 64] = \"Instantiated\";\n        ObjectFlags[ObjectFlags[\"ObjectLiteral\"] = 128] = \"ObjectLiteral\";\n        ObjectFlags[ObjectFlags[\"EvolvingArray\"] = 256] = \"EvolvingArray\";\n        ObjectFlags[ObjectFlags[\"ObjectLiteralPatternWithComputedProperties\"] = 512] = \"ObjectLiteralPatternWithComputedProperties\";\n        ObjectFlags[ObjectFlags[\"ContainsSpread\"] = 1024] = \"ContainsSpread\";\n        ObjectFlags[ObjectFlags[\"ReverseMapped\"] = 2048] = \"ReverseMapped\";\n        ObjectFlags[ObjectFlags[\"JsxAttributes\"] = 4096] = \"JsxAttributes\";\n        ObjectFlags[ObjectFlags[\"MarkerType\"] = 8192] = \"MarkerType\";\n        ObjectFlags[ObjectFlags[\"JSLiteral\"] = 16384] = \"JSLiteral\";\n        ObjectFlags[ObjectFlags[\"FreshLiteral\"] = 32768] = \"FreshLiteral\";\n        ObjectFlags[ObjectFlags[\"ArrayLiteral\"] = 65536] = \"ArrayLiteral\";\n        ObjectFlags[ObjectFlags[\"ObjectRestType\"] = 131072] = \"ObjectRestType\";\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"PrimitiveUnion\"] = 262144] = \"PrimitiveUnion\";\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"ContainsWideningType\"] = 524288] = \"ContainsWideningType\";\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"ContainsObjectOrArrayLiteral\"] = 1048576] = \"ContainsObjectOrArrayLiteral\";\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"NonInferrableType\"] = 2097152] = \"NonInferrableType\";\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"IsGenericObjectTypeComputed\"] = 4194304] = \"IsGenericObjectTypeComputed\";\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"IsGenericObjectType\"] = 8388608] = \"IsGenericObjectType\";\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"IsGenericIndexTypeComputed\"] = 16777216] = \"IsGenericIndexTypeComputed\";\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"IsGenericIndexType\"] = 33554432] = \"IsGenericIndexType\";\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"CouldContainTypeVariablesComputed\"] = 67108864] = \"CouldContainTypeVariablesComputed\";\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"CouldContainTypeVariables\"] = 134217728] = \"CouldContainTypeVariables\";\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"ContainsIntersections\"] = 268435456] = \"ContainsIntersections\";\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"IsNeverIntersectionComputed\"] = 268435456] = \"IsNeverIntersectionComputed\";\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"IsNeverIntersection\"] = 536870912] = \"IsNeverIntersection\";\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"IsClassInstanceClone\"] = 1073741824] = \"IsClassInstanceClone\";\n        ObjectFlags[ObjectFlags[\"ClassOrInterface\"] = 3] = \"ClassOrInterface\";\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"RequiresWidening\"] = 1572864] = \"RequiresWidening\";\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"PropagatingFlags\"] = 3670016] = \"PropagatingFlags\";\n        // Object flags that uniquely identify the kind of ObjectType\n        /* @internal */\n        ObjectFlags[ObjectFlags[\"ObjectTypeKindMask\"] = 2367] = \"ObjectTypeKindMask\";\n    })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {}));\n    /* @internal */\n    var VarianceFlags;\n    (function (VarianceFlags) {\n        VarianceFlags[VarianceFlags[\"Invariant\"] = 0] = \"Invariant\";\n        VarianceFlags[VarianceFlags[\"Covariant\"] = 1] = \"Covariant\";\n        VarianceFlags[VarianceFlags[\"Contravariant\"] = 2] = \"Contravariant\";\n        VarianceFlags[VarianceFlags[\"Bivariant\"] = 3] = \"Bivariant\";\n        VarianceFlags[VarianceFlags[\"Independent\"] = 4] = \"Independent\";\n        VarianceFlags[VarianceFlags[\"VarianceMask\"] = 7] = \"VarianceMask\";\n        VarianceFlags[VarianceFlags[\"Unmeasurable\"] = 8] = \"Unmeasurable\";\n        VarianceFlags[VarianceFlags[\"Unreliable\"] = 16] = \"Unreliable\";\n        VarianceFlags[VarianceFlags[\"AllowsStructuralFallback\"] = 24] = \"AllowsStructuralFallback\";\n    })(VarianceFlags = ts.VarianceFlags || (ts.VarianceFlags = {}));\n    var ElementFlags;\n    (function (ElementFlags) {\n        ElementFlags[ElementFlags[\"Required\"] = 1] = \"Required\";\n        ElementFlags[ElementFlags[\"Optional\"] = 2] = \"Optional\";\n        ElementFlags[ElementFlags[\"Rest\"] = 4] = \"Rest\";\n        ElementFlags[ElementFlags[\"Variadic\"] = 8] = \"Variadic\";\n        ElementFlags[ElementFlags[\"Fixed\"] = 3] = \"Fixed\";\n        ElementFlags[ElementFlags[\"Variable\"] = 12] = \"Variable\";\n        ElementFlags[ElementFlags[\"NonRequired\"] = 14] = \"NonRequired\";\n        ElementFlags[ElementFlags[\"NonRest\"] = 11] = \"NonRest\";\n    })(ElementFlags = ts.ElementFlags || (ts.ElementFlags = {}));\n    /* @internal */\n    var JsxReferenceKind;\n    (function (JsxReferenceKind) {\n        JsxReferenceKind[JsxReferenceKind[\"Component\"] = 0] = \"Component\";\n        JsxReferenceKind[JsxReferenceKind[\"Function\"] = 1] = \"Function\";\n        JsxReferenceKind[JsxReferenceKind[\"Mixed\"] = 2] = \"Mixed\";\n    })(JsxReferenceKind = ts.JsxReferenceKind || (ts.JsxReferenceKind = {}));\n    var SignatureKind;\n    (function (SignatureKind) {\n        SignatureKind[SignatureKind[\"Call\"] = 0] = \"Call\";\n        SignatureKind[SignatureKind[\"Construct\"] = 1] = \"Construct\";\n    })(SignatureKind = ts.SignatureKind || (ts.SignatureKind = {}));\n    /* @internal */\n    var SignatureFlags;\n    (function (SignatureFlags) {\n        SignatureFlags[SignatureFlags[\"None\"] = 0] = \"None\";\n        // Propagating flags\n        SignatureFlags[SignatureFlags[\"HasRestParameter\"] = 1] = \"HasRestParameter\";\n        SignatureFlags[SignatureFlags[\"HasLiteralTypes\"] = 2] = \"HasLiteralTypes\";\n        SignatureFlags[SignatureFlags[\"Abstract\"] = 4] = \"Abstract\";\n        // Non-propagating flags\n        SignatureFlags[SignatureFlags[\"IsInnerCallChain\"] = 8] = \"IsInnerCallChain\";\n        SignatureFlags[SignatureFlags[\"IsOuterCallChain\"] = 16] = \"IsOuterCallChain\";\n        SignatureFlags[SignatureFlags[\"IsUntypedSignatureInJSFile\"] = 32] = \"IsUntypedSignatureInJSFile\";\n        // We do not propagate `IsInnerCallChain` or `IsOuterCallChain` to instantiated signatures, as that would result in us\n        // attempting to add `| undefined` on each recursive call to `getReturnTypeOfSignature` when\n        // instantiating the return type.\n        SignatureFlags[SignatureFlags[\"PropagatingFlags\"] = 39] = \"PropagatingFlags\";\n        SignatureFlags[SignatureFlags[\"CallChainFlags\"] = 24] = \"CallChainFlags\";\n    })(SignatureFlags = ts.SignatureFlags || (ts.SignatureFlags = {}));\n    var IndexKind;\n    (function (IndexKind) {\n        IndexKind[IndexKind[\"String\"] = 0] = \"String\";\n        IndexKind[IndexKind[\"Number\"] = 1] = \"Number\";\n    })(IndexKind = ts.IndexKind || (ts.IndexKind = {}));\n    /* @internal */\n    var TypeMapKind;\n    (function (TypeMapKind) {\n        TypeMapKind[TypeMapKind[\"Simple\"] = 0] = \"Simple\";\n        TypeMapKind[TypeMapKind[\"Array\"] = 1] = \"Array\";\n        TypeMapKind[TypeMapKind[\"Function\"] = 2] = \"Function\";\n        TypeMapKind[TypeMapKind[\"Composite\"] = 3] = \"Composite\";\n        TypeMapKind[TypeMapKind[\"Merged\"] = 4] = \"Merged\";\n    })(TypeMapKind = ts.TypeMapKind || (ts.TypeMapKind = {}));\n    var InferencePriority;\n    (function (InferencePriority) {\n        InferencePriority[InferencePriority[\"NakedTypeVariable\"] = 1] = \"NakedTypeVariable\";\n        InferencePriority[InferencePriority[\"SpeculativeTuple\"] = 2] = \"SpeculativeTuple\";\n        InferencePriority[InferencePriority[\"HomomorphicMappedType\"] = 4] = \"HomomorphicMappedType\";\n        InferencePriority[InferencePriority[\"PartialHomomorphicMappedType\"] = 8] = \"PartialHomomorphicMappedType\";\n        InferencePriority[InferencePriority[\"MappedTypeConstraint\"] = 16] = \"MappedTypeConstraint\";\n        InferencePriority[InferencePriority[\"ContravariantConditional\"] = 32] = \"ContravariantConditional\";\n        InferencePriority[InferencePriority[\"ReturnType\"] = 64] = \"ReturnType\";\n        InferencePriority[InferencePriority[\"LiteralKeyof\"] = 128] = \"LiteralKeyof\";\n        InferencePriority[InferencePriority[\"NoConstraints\"] = 256] = \"NoConstraints\";\n        InferencePriority[InferencePriority[\"AlwaysStrict\"] = 512] = \"AlwaysStrict\";\n        InferencePriority[InferencePriority[\"MaxValue\"] = 1024] = \"MaxValue\";\n        InferencePriority[InferencePriority[\"PriorityImpliesCombination\"] = 208] = \"PriorityImpliesCombination\";\n        InferencePriority[InferencePriority[\"Circularity\"] = -1] = \"Circularity\";\n    })(InferencePriority = ts.InferencePriority || (ts.InferencePriority = {}));\n    /* @internal */\n    var InferenceFlags;\n    (function (InferenceFlags) {\n        InferenceFlags[InferenceFlags[\"None\"] = 0] = \"None\";\n        InferenceFlags[InferenceFlags[\"NoDefault\"] = 1] = \"NoDefault\";\n        InferenceFlags[InferenceFlags[\"AnyDefault\"] = 2] = \"AnyDefault\";\n        InferenceFlags[InferenceFlags[\"SkippedGenericFunction\"] = 4] = \"SkippedGenericFunction\";\n    })(InferenceFlags = ts.InferenceFlags || (ts.InferenceFlags = {}));\n    /**\n     * Ternary values are defined such that\n     * x & y picks the lesser in the order False < Unknown < Maybe < True, and\n     * x | y picks the greater in the order False < Unknown < Maybe < True.\n     * Generally, Ternary.Maybe is used as the result of a relation that depends on itself, and\n     * Ternary.Unknown is used as the result of a variance check that depends on itself. We make\n     * a distinction because we don't want to cache circular variance check results.\n     */\n    /* @internal */\n    var Ternary;\n    (function (Ternary) {\n        Ternary[Ternary[\"False\"] = 0] = \"False\";\n        Ternary[Ternary[\"Unknown\"] = 1] = \"Unknown\";\n        Ternary[Ternary[\"Maybe\"] = 3] = \"Maybe\";\n        Ternary[Ternary[\"True\"] = -1] = \"True\";\n    })(Ternary = ts.Ternary || (ts.Ternary = {}));\n    /* @internal */\n    var AssignmentDeclarationKind;\n    (function (AssignmentDeclarationKind) {\n        AssignmentDeclarationKind[AssignmentDeclarationKind[\"None\"] = 0] = \"None\";\n        /// exports.name = expr\n        /// module.exports.name = expr\n        AssignmentDeclarationKind[AssignmentDeclarationKind[\"ExportsProperty\"] = 1] = \"ExportsProperty\";\n        /// module.exports = expr\n        AssignmentDeclarationKind[AssignmentDeclarationKind[\"ModuleExports\"] = 2] = \"ModuleExports\";\n        /// className.prototype.name = expr\n        AssignmentDeclarationKind[AssignmentDeclarationKind[\"PrototypeProperty\"] = 3] = \"PrototypeProperty\";\n        /// this.name = expr\n        AssignmentDeclarationKind[AssignmentDeclarationKind[\"ThisProperty\"] = 4] = \"ThisProperty\";\n        // F.name = expr\n        AssignmentDeclarationKind[AssignmentDeclarationKind[\"Property\"] = 5] = \"Property\";\n        // F.prototype = { ... }\n        AssignmentDeclarationKind[AssignmentDeclarationKind[\"Prototype\"] = 6] = \"Prototype\";\n        // Object.defineProperty(x, 'name', { value: any, writable?: boolean (false by default) });\n        // Object.defineProperty(x, 'name', { get: Function, set: Function });\n        // Object.defineProperty(x, 'name', { get: Function });\n        // Object.defineProperty(x, 'name', { set: Function });\n        AssignmentDeclarationKind[AssignmentDeclarationKind[\"ObjectDefinePropertyValue\"] = 7] = \"ObjectDefinePropertyValue\";\n        // Object.defineProperty(exports || module.exports, 'name', ...);\n        AssignmentDeclarationKind[AssignmentDeclarationKind[\"ObjectDefinePropertyExports\"] = 8] = \"ObjectDefinePropertyExports\";\n        // Object.defineProperty(Foo.prototype, 'name', ...);\n        AssignmentDeclarationKind[AssignmentDeclarationKind[\"ObjectDefinePrototypeProperty\"] = 9] = \"ObjectDefinePrototypeProperty\";\n    })(AssignmentDeclarationKind = ts.AssignmentDeclarationKind || (ts.AssignmentDeclarationKind = {}));\n    var DiagnosticCategory;\n    (function (DiagnosticCategory) {\n        DiagnosticCategory[DiagnosticCategory[\"Warning\"] = 0] = \"Warning\";\n        DiagnosticCategory[DiagnosticCategory[\"Error\"] = 1] = \"Error\";\n        DiagnosticCategory[DiagnosticCategory[\"Suggestion\"] = 2] = \"Suggestion\";\n        DiagnosticCategory[DiagnosticCategory[\"Message\"] = 3] = \"Message\";\n    })(DiagnosticCategory = ts.DiagnosticCategory || (ts.DiagnosticCategory = {}));\n    /* @internal */\n    function diagnosticCategoryName(d, lowerCase) {\n        if (lowerCase === void 0) { lowerCase = true; }\n        var name = DiagnosticCategory[d.category];\n        return lowerCase ? name.toLowerCase() : name;\n    }\n    ts.diagnosticCategoryName = diagnosticCategoryName;\n    var ModuleResolutionKind;\n    (function (ModuleResolutionKind) {\n        ModuleResolutionKind[ModuleResolutionKind[\"Classic\"] = 1] = \"Classic\";\n        ModuleResolutionKind[ModuleResolutionKind[\"NodeJs\"] = 2] = \"NodeJs\";\n    })(ModuleResolutionKind = ts.ModuleResolutionKind || (ts.ModuleResolutionKind = {}));\n    var WatchFileKind;\n    (function (WatchFileKind) {\n        WatchFileKind[WatchFileKind[\"FixedPollingInterval\"] = 0] = \"FixedPollingInterval\";\n        WatchFileKind[WatchFileKind[\"PriorityPollingInterval\"] = 1] = \"PriorityPollingInterval\";\n        WatchFileKind[WatchFileKind[\"DynamicPriorityPolling\"] = 2] = \"DynamicPriorityPolling\";\n        WatchFileKind[WatchFileKind[\"UseFsEvents\"] = 3] = \"UseFsEvents\";\n        WatchFileKind[WatchFileKind[\"UseFsEventsOnParentDirectory\"] = 4] = \"UseFsEventsOnParentDirectory\";\n    })(WatchFileKind = ts.WatchFileKind || (ts.WatchFileKind = {}));\n    var WatchDirectoryKind;\n    (function (WatchDirectoryKind) {\n        WatchDirectoryKind[WatchDirectoryKind[\"UseFsEvents\"] = 0] = \"UseFsEvents\";\n        WatchDirectoryKind[WatchDirectoryKind[\"FixedPollingInterval\"] = 1] = \"FixedPollingInterval\";\n        WatchDirectoryKind[WatchDirectoryKind[\"DynamicPriorityPolling\"] = 2] = \"DynamicPriorityPolling\";\n    })(WatchDirectoryKind = ts.WatchDirectoryKind || (ts.WatchDirectoryKind = {}));\n    var PollingWatchKind;\n    (function (PollingWatchKind) {\n        PollingWatchKind[PollingWatchKind[\"FixedInterval\"] = 0] = \"FixedInterval\";\n        PollingWatchKind[PollingWatchKind[\"PriorityInterval\"] = 1] = \"PriorityInterval\";\n        PollingWatchKind[PollingWatchKind[\"DynamicPriority\"] = 2] = \"DynamicPriority\";\n    })(PollingWatchKind = ts.PollingWatchKind || (ts.PollingWatchKind = {}));\n    var ModuleKind;\n    (function (ModuleKind) {\n        ModuleKind[ModuleKind[\"None\"] = 0] = \"None\";\n        ModuleKind[ModuleKind[\"CommonJS\"] = 1] = \"CommonJS\";\n        ModuleKind[ModuleKind[\"AMD\"] = 2] = \"AMD\";\n        ModuleKind[ModuleKind[\"UMD\"] = 3] = \"UMD\";\n        ModuleKind[ModuleKind[\"System\"] = 4] = \"System\";\n        // NOTE: ES module kinds should be contiguous to more easily check whether a module kind is *any* ES module kind.\n        //       Non-ES module kinds should not come between ES2015 (the earliest ES module kind) and ESNext (the last ES\n        //       module kind).\n        ModuleKind[ModuleKind[\"ES2015\"] = 5] = \"ES2015\";\n        ModuleKind[ModuleKind[\"ES2020\"] = 6] = \"ES2020\";\n        ModuleKind[ModuleKind[\"ESNext\"] = 99] = \"ESNext\";\n    })(ModuleKind = ts.ModuleKind || (ts.ModuleKind = {}));\n    var JsxEmit;\n    (function (JsxEmit) {\n        JsxEmit[JsxEmit[\"None\"] = 0] = \"None\";\n        JsxEmit[JsxEmit[\"Preserve\"] = 1] = \"Preserve\";\n        JsxEmit[JsxEmit[\"React\"] = 2] = \"React\";\n        JsxEmit[JsxEmit[\"ReactNative\"] = 3] = \"ReactNative\";\n        JsxEmit[JsxEmit[\"ReactJSX\"] = 4] = \"ReactJSX\";\n        JsxEmit[JsxEmit[\"ReactJSXDev\"] = 5] = \"ReactJSXDev\";\n    })(JsxEmit = ts.JsxEmit || (ts.JsxEmit = {}));\n    var ImportsNotUsedAsValues;\n    (function (ImportsNotUsedAsValues) {\n        ImportsNotUsedAsValues[ImportsNotUsedAsValues[\"Remove\"] = 0] = \"Remove\";\n        ImportsNotUsedAsValues[ImportsNotUsedAsValues[\"Preserve\"] = 1] = \"Preserve\";\n        ImportsNotUsedAsValues[ImportsNotUsedAsValues[\"Error\"] = 2] = \"Error\";\n    })(ImportsNotUsedAsValues = ts.ImportsNotUsedAsValues || (ts.ImportsNotUsedAsValues = {}));\n    var NewLineKind;\n    (function (NewLineKind) {\n        NewLineKind[NewLineKind[\"CarriageReturnLineFeed\"] = 0] = \"CarriageReturnLineFeed\";\n        NewLineKind[NewLineKind[\"LineFeed\"] = 1] = \"LineFeed\";\n    })(NewLineKind = ts.NewLineKind || (ts.NewLineKind = {}));\n    var ScriptKind;\n    (function (ScriptKind) {\n        ScriptKind[ScriptKind[\"Unknown\"] = 0] = \"Unknown\";\n        ScriptKind[ScriptKind[\"JS\"] = 1] = \"JS\";\n        ScriptKind[ScriptKind[\"JSX\"] = 2] = \"JSX\";\n        ScriptKind[ScriptKind[\"TS\"] = 3] = \"TS\";\n        ScriptKind[ScriptKind[\"TSX\"] = 4] = \"TSX\";\n        ScriptKind[ScriptKind[\"External\"] = 5] = \"External\";\n        ScriptKind[ScriptKind[\"JSON\"] = 6] = \"JSON\";\n        /**\n         * Used on extensions that doesn't define the ScriptKind but the content defines it.\n         * Deferred extensions are going to be included in all project contexts.\n         */\n        ScriptKind[ScriptKind[\"Deferred\"] = 7] = \"Deferred\";\n    })(ScriptKind = ts.ScriptKind || (ts.ScriptKind = {}));\n    var ScriptTarget;\n    (function (ScriptTarget) {\n        ScriptTarget[ScriptTarget[\"ES3\"] = 0] = \"ES3\";\n        ScriptTarget[ScriptTarget[\"ES5\"] = 1] = \"ES5\";\n        ScriptTarget[ScriptTarget[\"ES2015\"] = 2] = \"ES2015\";\n        ScriptTarget[ScriptTarget[\"ES2016\"] = 3] = \"ES2016\";\n        ScriptTarget[ScriptTarget[\"ES2017\"] = 4] = \"ES2017\";\n        ScriptTarget[ScriptTarget[\"ES2018\"] = 5] = \"ES2018\";\n        ScriptTarget[ScriptTarget[\"ES2019\"] = 6] = \"ES2019\";\n        ScriptTarget[ScriptTarget[\"ES2020\"] = 7] = \"ES2020\";\n        ScriptTarget[ScriptTarget[\"ESNext\"] = 99] = \"ESNext\";\n        ScriptTarget[ScriptTarget[\"JSON\"] = 100] = \"JSON\";\n        ScriptTarget[ScriptTarget[\"Latest\"] = 99] = \"Latest\";\n    })(ScriptTarget = ts.ScriptTarget || (ts.ScriptTarget = {}));\n    var LanguageVariant;\n    (function (LanguageVariant) {\n        LanguageVariant[LanguageVariant[\"Standard\"] = 0] = \"Standard\";\n        LanguageVariant[LanguageVariant[\"JSX\"] = 1] = \"JSX\";\n    })(LanguageVariant = ts.LanguageVariant || (ts.LanguageVariant = {}));\n    var WatchDirectoryFlags;\n    (function (WatchDirectoryFlags) {\n        WatchDirectoryFlags[WatchDirectoryFlags[\"None\"] = 0] = \"None\";\n        WatchDirectoryFlags[WatchDirectoryFlags[\"Recursive\"] = 1] = \"Recursive\";\n    })(WatchDirectoryFlags = ts.WatchDirectoryFlags || (ts.WatchDirectoryFlags = {}));\n    /* @internal */\n    var CharacterCodes;\n    (function (CharacterCodes) {\n        CharacterCodes[CharacterCodes[\"nullCharacter\"] = 0] = \"nullCharacter\";\n        CharacterCodes[CharacterCodes[\"maxAsciiCharacter\"] = 127] = \"maxAsciiCharacter\";\n        CharacterCodes[CharacterCodes[\"lineFeed\"] = 10] = \"lineFeed\";\n        CharacterCodes[CharacterCodes[\"carriageReturn\"] = 13] = \"carriageReturn\";\n        CharacterCodes[CharacterCodes[\"lineSeparator\"] = 8232] = \"lineSeparator\";\n        CharacterCodes[CharacterCodes[\"paragraphSeparator\"] = 8233] = \"paragraphSeparator\";\n        CharacterCodes[CharacterCodes[\"nextLine\"] = 133] = \"nextLine\";\n        // Unicode 3.0 space characters\n        CharacterCodes[CharacterCodes[\"space\"] = 32] = \"space\";\n        CharacterCodes[CharacterCodes[\"nonBreakingSpace\"] = 160] = \"nonBreakingSpace\";\n        CharacterCodes[CharacterCodes[\"enQuad\"] = 8192] = \"enQuad\";\n        CharacterCodes[CharacterCodes[\"emQuad\"] = 8193] = \"emQuad\";\n        CharacterCodes[CharacterCodes[\"enSpace\"] = 8194] = \"enSpace\";\n        CharacterCodes[CharacterCodes[\"emSpace\"] = 8195] = \"emSpace\";\n        CharacterCodes[CharacterCodes[\"threePerEmSpace\"] = 8196] = \"threePerEmSpace\";\n        CharacterCodes[CharacterCodes[\"fourPerEmSpace\"] = 8197] = \"fourPerEmSpace\";\n        CharacterCodes[CharacterCodes[\"sixPerEmSpace\"] = 8198] = \"sixPerEmSpace\";\n        CharacterCodes[CharacterCodes[\"figureSpace\"] = 8199] = \"figureSpace\";\n        CharacterCodes[CharacterCodes[\"punctuationSpace\"] = 8200] = \"punctuationSpace\";\n        CharacterCodes[CharacterCodes[\"thinSpace\"] = 8201] = \"thinSpace\";\n        CharacterCodes[CharacterCodes[\"hairSpace\"] = 8202] = \"hairSpace\";\n        CharacterCodes[CharacterCodes[\"zeroWidthSpace\"] = 8203] = \"zeroWidthSpace\";\n        CharacterCodes[CharacterCodes[\"narrowNoBreakSpace\"] = 8239] = \"narrowNoBreakSpace\";\n        CharacterCodes[CharacterCodes[\"ideographicSpace\"] = 12288] = \"ideographicSpace\";\n        CharacterCodes[CharacterCodes[\"mathematicalSpace\"] = 8287] = \"mathematicalSpace\";\n        CharacterCodes[CharacterCodes[\"ogham\"] = 5760] = \"ogham\";\n        CharacterCodes[CharacterCodes[\"_\"] = 95] = \"_\";\n        CharacterCodes[CharacterCodes[\"$\"] = 36] = \"$\";\n        CharacterCodes[CharacterCodes[\"_0\"] = 48] = \"_0\";\n        CharacterCodes[CharacterCodes[\"_1\"] = 49] = \"_1\";\n        CharacterCodes[CharacterCodes[\"_2\"] = 50] = \"_2\";\n        CharacterCodes[CharacterCodes[\"_3\"] = 51] = \"_3\";\n        CharacterCodes[CharacterCodes[\"_4\"] = 52] = \"_4\";\n        CharacterCodes[CharacterCodes[\"_5\"] = 53] = \"_5\";\n        CharacterCodes[CharacterCodes[\"_6\"] = 54] = \"_6\";\n        CharacterCodes[CharacterCodes[\"_7\"] = 55] = \"_7\";\n        CharacterCodes[CharacterCodes[\"_8\"] = 56] = \"_8\";\n        CharacterCodes[CharacterCodes[\"_9\"] = 57] = \"_9\";\n        CharacterCodes[CharacterCodes[\"a\"] = 97] = \"a\";\n        CharacterCodes[CharacterCodes[\"b\"] = 98] = \"b\";\n        CharacterCodes[CharacterCodes[\"c\"] = 99] = \"c\";\n        CharacterCodes[CharacterCodes[\"d\"] = 100] = \"d\";\n        CharacterCodes[CharacterCodes[\"e\"] = 101] = \"e\";\n        CharacterCodes[CharacterCodes[\"f\"] = 102] = \"f\";\n        CharacterCodes[CharacterCodes[\"g\"] = 103] = \"g\";\n        CharacterCodes[CharacterCodes[\"h\"] = 104] = \"h\";\n        CharacterCodes[CharacterCodes[\"i\"] = 105] = \"i\";\n        CharacterCodes[CharacterCodes[\"j\"] = 106] = \"j\";\n        CharacterCodes[CharacterCodes[\"k\"] = 107] = \"k\";\n        CharacterCodes[CharacterCodes[\"l\"] = 108] = \"l\";\n        CharacterCodes[CharacterCodes[\"m\"] = 109] = \"m\";\n        CharacterCodes[CharacterCodes[\"n\"] = 110] = \"n\";\n        CharacterCodes[CharacterCodes[\"o\"] = 111] = \"o\";\n        CharacterCodes[CharacterCodes[\"p\"] = 112] = \"p\";\n        CharacterCodes[CharacterCodes[\"q\"] = 113] = \"q\";\n        CharacterCodes[CharacterCodes[\"r\"] = 114] = \"r\";\n        CharacterCodes[CharacterCodes[\"s\"] = 115] = \"s\";\n        CharacterCodes[CharacterCodes[\"t\"] = 116] = \"t\";\n        CharacterCodes[CharacterCodes[\"u\"] = 117] = \"u\";\n        CharacterCodes[CharacterCodes[\"v\"] = 118] = \"v\";\n        CharacterCodes[CharacterCodes[\"w\"] = 119] = \"w\";\n        CharacterCodes[CharacterCodes[\"x\"] = 120] = \"x\";\n        CharacterCodes[CharacterCodes[\"y\"] = 121] = \"y\";\n        CharacterCodes[CharacterCodes[\"z\"] = 122] = \"z\";\n        CharacterCodes[CharacterCodes[\"A\"] = 65] = \"A\";\n        CharacterCodes[CharacterCodes[\"B\"] = 66] = \"B\";\n        CharacterCodes[CharacterCodes[\"C\"] = 67] = \"C\";\n        CharacterCodes[CharacterCodes[\"D\"] = 68] = \"D\";\n        CharacterCodes[CharacterCodes[\"E\"] = 69] = \"E\";\n        CharacterCodes[CharacterCodes[\"F\"] = 70] = \"F\";\n        CharacterCodes[CharacterCodes[\"G\"] = 71] = \"G\";\n        CharacterCodes[CharacterCodes[\"H\"] = 72] = \"H\";\n        CharacterCodes[CharacterCodes[\"I\"] = 73] = \"I\";\n        CharacterCodes[CharacterCodes[\"J\"] = 74] = \"J\";\n        CharacterCodes[CharacterCodes[\"K\"] = 75] = \"K\";\n        CharacterCodes[CharacterCodes[\"L\"] = 76] = \"L\";\n        CharacterCodes[CharacterCodes[\"M\"] = 77] = \"M\";\n        CharacterCodes[CharacterCodes[\"N\"] = 78] = \"N\";\n        CharacterCodes[CharacterCodes[\"O\"] = 79] = \"O\";\n        CharacterCodes[CharacterCodes[\"P\"] = 80] = \"P\";\n        CharacterCodes[CharacterCodes[\"Q\"] = 81] = \"Q\";\n        CharacterCodes[CharacterCodes[\"R\"] = 82] = \"R\";\n        CharacterCodes[CharacterCodes[\"S\"] = 83] = \"S\";\n        CharacterCodes[CharacterCodes[\"T\"] = 84] = \"T\";\n        CharacterCodes[CharacterCodes[\"U\"] = 85] = \"U\";\n        CharacterCodes[CharacterCodes[\"V\"] = 86] = \"V\";\n        CharacterCodes[CharacterCodes[\"W\"] = 87] = \"W\";\n        CharacterCodes[CharacterCodes[\"X\"] = 88] = \"X\";\n        CharacterCodes[CharacterCodes[\"Y\"] = 89] = \"Y\";\n        CharacterCodes[CharacterCodes[\"Z\"] = 90] = \"Z\";\n        CharacterCodes[CharacterCodes[\"ampersand\"] = 38] = \"ampersand\";\n        CharacterCodes[CharacterCodes[\"asterisk\"] = 42] = \"asterisk\";\n        CharacterCodes[CharacterCodes[\"at\"] = 64] = \"at\";\n        CharacterCodes[CharacterCodes[\"backslash\"] = 92] = \"backslash\";\n        CharacterCodes[CharacterCodes[\"backtick\"] = 96] = \"backtick\";\n        CharacterCodes[CharacterCodes[\"bar\"] = 124] = \"bar\";\n        CharacterCodes[CharacterCodes[\"caret\"] = 94] = \"caret\";\n        CharacterCodes[CharacterCodes[\"closeBrace\"] = 125] = \"closeBrace\";\n        CharacterCodes[CharacterCodes[\"closeBracket\"] = 93] = \"closeBracket\";\n        CharacterCodes[CharacterCodes[\"closeParen\"] = 41] = \"closeParen\";\n        CharacterCodes[CharacterCodes[\"colon\"] = 58] = \"colon\";\n        CharacterCodes[CharacterCodes[\"comma\"] = 44] = \"comma\";\n        CharacterCodes[CharacterCodes[\"dot\"] = 46] = \"dot\";\n        CharacterCodes[CharacterCodes[\"doubleQuote\"] = 34] = \"doubleQuote\";\n        CharacterCodes[CharacterCodes[\"equals\"] = 61] = \"equals\";\n        CharacterCodes[CharacterCodes[\"exclamation\"] = 33] = \"exclamation\";\n        CharacterCodes[CharacterCodes[\"greaterThan\"] = 62] = \"greaterThan\";\n        CharacterCodes[CharacterCodes[\"hash\"] = 35] = \"hash\";\n        CharacterCodes[CharacterCodes[\"lessThan\"] = 60] = \"lessThan\";\n        CharacterCodes[CharacterCodes[\"minus\"] = 45] = \"minus\";\n        CharacterCodes[CharacterCodes[\"openBrace\"] = 123] = \"openBrace\";\n        CharacterCodes[CharacterCodes[\"openBracket\"] = 91] = \"openBracket\";\n        CharacterCodes[CharacterCodes[\"openParen\"] = 40] = \"openParen\";\n        CharacterCodes[CharacterCodes[\"percent\"] = 37] = \"percent\";\n        CharacterCodes[CharacterCodes[\"plus\"] = 43] = \"plus\";\n        CharacterCodes[CharacterCodes[\"question\"] = 63] = \"question\";\n        CharacterCodes[CharacterCodes[\"semicolon\"] = 59] = \"semicolon\";\n        CharacterCodes[CharacterCodes[\"singleQuote\"] = 39] = \"singleQuote\";\n        CharacterCodes[CharacterCodes[\"slash\"] = 47] = \"slash\";\n        CharacterCodes[CharacterCodes[\"tilde\"] = 126] = \"tilde\";\n        CharacterCodes[CharacterCodes[\"backspace\"] = 8] = \"backspace\";\n        CharacterCodes[CharacterCodes[\"formFeed\"] = 12] = \"formFeed\";\n        CharacterCodes[CharacterCodes[\"byteOrderMark\"] = 65279] = \"byteOrderMark\";\n        CharacterCodes[CharacterCodes[\"tab\"] = 9] = \"tab\";\n        CharacterCodes[CharacterCodes[\"verticalTab\"] = 11] = \"verticalTab\";\n    })(CharacterCodes = ts.CharacterCodes || (ts.CharacterCodes = {}));\n    var Extension;\n    (function (Extension) {\n        Extension[\"Ts\"] = \".ts\";\n        Extension[\"Tsx\"] = \".tsx\";\n        Extension[\"Dts\"] = \".d.ts\";\n        Extension[\"Js\"] = \".js\";\n        Extension[\"Jsx\"] = \".jsx\";\n        Extension[\"Json\"] = \".json\";\n        Extension[\"TsBuildInfo\"] = \".tsbuildinfo\";\n    })(Extension = ts.Extension || (ts.Extension = {}));\n    /* @internal */\n    var TransformFlags;\n    (function (TransformFlags) {\n        TransformFlags[TransformFlags[\"None\"] = 0] = \"None\";\n        // Facts\n        // - Flags used to indicate that a node or subtree contains syntax that requires transformation.\n        TransformFlags[TransformFlags[\"ContainsTypeScript\"] = 1] = \"ContainsTypeScript\";\n        TransformFlags[TransformFlags[\"ContainsJsx\"] = 2] = \"ContainsJsx\";\n        TransformFlags[TransformFlags[\"ContainsESNext\"] = 4] = \"ContainsESNext\";\n        TransformFlags[TransformFlags[\"ContainsES2020\"] = 8] = \"ContainsES2020\";\n        TransformFlags[TransformFlags[\"ContainsES2019\"] = 16] = \"ContainsES2019\";\n        TransformFlags[TransformFlags[\"ContainsES2018\"] = 32] = \"ContainsES2018\";\n        TransformFlags[TransformFlags[\"ContainsES2017\"] = 64] = \"ContainsES2017\";\n        TransformFlags[TransformFlags[\"ContainsES2016\"] = 128] = \"ContainsES2016\";\n        TransformFlags[TransformFlags[\"ContainsES2015\"] = 256] = \"ContainsES2015\";\n        TransformFlags[TransformFlags[\"ContainsGenerator\"] = 512] = \"ContainsGenerator\";\n        TransformFlags[TransformFlags[\"ContainsDestructuringAssignment\"] = 1024] = \"ContainsDestructuringAssignment\";\n        // Markers\n        // - Flags used to indicate that a subtree contains a specific transformation.\n        TransformFlags[TransformFlags[\"ContainsTypeScriptClassSyntax\"] = 2048] = \"ContainsTypeScriptClassSyntax\";\n        TransformFlags[TransformFlags[\"ContainsLexicalThis\"] = 4096] = \"ContainsLexicalThis\";\n        TransformFlags[TransformFlags[\"ContainsRestOrSpread\"] = 8192] = \"ContainsRestOrSpread\";\n        TransformFlags[TransformFlags[\"ContainsObjectRestOrSpread\"] = 16384] = \"ContainsObjectRestOrSpread\";\n        TransformFlags[TransformFlags[\"ContainsComputedPropertyName\"] = 32768] = \"ContainsComputedPropertyName\";\n        TransformFlags[TransformFlags[\"ContainsBlockScopedBinding\"] = 65536] = \"ContainsBlockScopedBinding\";\n        TransformFlags[TransformFlags[\"ContainsBindingPattern\"] = 131072] = \"ContainsBindingPattern\";\n        TransformFlags[TransformFlags[\"ContainsYield\"] = 262144] = \"ContainsYield\";\n        TransformFlags[TransformFlags[\"ContainsAwait\"] = 524288] = \"ContainsAwait\";\n        TransformFlags[TransformFlags[\"ContainsHoistedDeclarationOrCompletion\"] = 1048576] = \"ContainsHoistedDeclarationOrCompletion\";\n        TransformFlags[TransformFlags[\"ContainsDynamicImport\"] = 2097152] = \"ContainsDynamicImport\";\n        TransformFlags[TransformFlags[\"ContainsClassFields\"] = 4194304] = \"ContainsClassFields\";\n        TransformFlags[TransformFlags[\"ContainsPossibleTopLevelAwait\"] = 8388608] = \"ContainsPossibleTopLevelAwait\";\n        // Please leave this as 1 << 29.\n        // It is the maximum bit we can set before we outgrow the size of a v8 small integer (SMI) on an x86 system.\n        // It is a good reminder of how much room we have left\n        TransformFlags[TransformFlags[\"HasComputedFlags\"] = 536870912] = \"HasComputedFlags\";\n        // Assertions\n        // - Bitmasks that are used to assert facts about the syntax of a node and its subtree.\n        TransformFlags[TransformFlags[\"AssertTypeScript\"] = 1] = \"AssertTypeScript\";\n        TransformFlags[TransformFlags[\"AssertJsx\"] = 2] = \"AssertJsx\";\n        TransformFlags[TransformFlags[\"AssertESNext\"] = 4] = \"AssertESNext\";\n        TransformFlags[TransformFlags[\"AssertES2020\"] = 8] = \"AssertES2020\";\n        TransformFlags[TransformFlags[\"AssertES2019\"] = 16] = \"AssertES2019\";\n        TransformFlags[TransformFlags[\"AssertES2018\"] = 32] = \"AssertES2018\";\n        TransformFlags[TransformFlags[\"AssertES2017\"] = 64] = \"AssertES2017\";\n        TransformFlags[TransformFlags[\"AssertES2016\"] = 128] = \"AssertES2016\";\n        TransformFlags[TransformFlags[\"AssertES2015\"] = 256] = \"AssertES2015\";\n        TransformFlags[TransformFlags[\"AssertGenerator\"] = 512] = \"AssertGenerator\";\n        TransformFlags[TransformFlags[\"AssertDestructuringAssignment\"] = 1024] = \"AssertDestructuringAssignment\";\n        // Scope Exclusions\n        // - Bitmasks that exclude flags from propagating out of a specific context\n        //   into the subtree flags of their container.\n        TransformFlags[TransformFlags[\"OuterExpressionExcludes\"] = 536870912] = \"OuterExpressionExcludes\";\n        TransformFlags[TransformFlags[\"PropertyAccessExcludes\"] = 536870912] = \"PropertyAccessExcludes\";\n        TransformFlags[TransformFlags[\"NodeExcludes\"] = 536870912] = \"NodeExcludes\";\n        TransformFlags[TransformFlags[\"ArrowFunctionExcludes\"] = 547309568] = \"ArrowFunctionExcludes\";\n        TransformFlags[TransformFlags[\"FunctionExcludes\"] = 547313664] = \"FunctionExcludes\";\n        TransformFlags[TransformFlags[\"ConstructorExcludes\"] = 547311616] = \"ConstructorExcludes\";\n        TransformFlags[TransformFlags[\"MethodOrAccessorExcludes\"] = 538923008] = \"MethodOrAccessorExcludes\";\n        TransformFlags[TransformFlags[\"PropertyExcludes\"] = 536875008] = \"PropertyExcludes\";\n        TransformFlags[TransformFlags[\"ClassExcludes\"] = 536905728] = \"ClassExcludes\";\n        TransformFlags[TransformFlags[\"ModuleExcludes\"] = 546379776] = \"ModuleExcludes\";\n        TransformFlags[TransformFlags[\"TypeExcludes\"] = -2] = \"TypeExcludes\";\n        TransformFlags[TransformFlags[\"ObjectLiteralExcludes\"] = 536922112] = \"ObjectLiteralExcludes\";\n        TransformFlags[TransformFlags[\"ArrayLiteralOrCallOrNewExcludes\"] = 536879104] = \"ArrayLiteralOrCallOrNewExcludes\";\n        TransformFlags[TransformFlags[\"VariableDeclarationListExcludes\"] = 537018368] = \"VariableDeclarationListExcludes\";\n        TransformFlags[TransformFlags[\"ParameterExcludes\"] = 536870912] = \"ParameterExcludes\";\n        TransformFlags[TransformFlags[\"CatchClauseExcludes\"] = 536887296] = \"CatchClauseExcludes\";\n        TransformFlags[TransformFlags[\"BindingPatternExcludes\"] = 536879104] = \"BindingPatternExcludes\";\n        // Propagating flags\n        // - Bitmasks for flags that should propagate from a child\n        TransformFlags[TransformFlags[\"PropertyNamePropagatingFlags\"] = 4096] = \"PropertyNamePropagatingFlags\";\n        // Masks\n        // - Additional bitmasks\n    })(TransformFlags = ts.TransformFlags || (ts.TransformFlags = {}));\n    var EmitFlags;\n    (function (EmitFlags) {\n        EmitFlags[EmitFlags[\"None\"] = 0] = \"None\";\n        EmitFlags[EmitFlags[\"SingleLine\"] = 1] = \"SingleLine\";\n        EmitFlags[EmitFlags[\"AdviseOnEmitNode\"] = 2] = \"AdviseOnEmitNode\";\n        EmitFlags[EmitFlags[\"NoSubstitution\"] = 4] = \"NoSubstitution\";\n        EmitFlags[EmitFlags[\"CapturesThis\"] = 8] = \"CapturesThis\";\n        EmitFlags[EmitFlags[\"NoLeadingSourceMap\"] = 16] = \"NoLeadingSourceMap\";\n        EmitFlags[EmitFlags[\"NoTrailingSourceMap\"] = 32] = \"NoTrailingSourceMap\";\n        EmitFlags[EmitFlags[\"NoSourceMap\"] = 48] = \"NoSourceMap\";\n        EmitFlags[EmitFlags[\"NoNestedSourceMaps\"] = 64] = \"NoNestedSourceMaps\";\n        EmitFlags[EmitFlags[\"NoTokenLeadingSourceMaps\"] = 128] = \"NoTokenLeadingSourceMaps\";\n        EmitFlags[EmitFlags[\"NoTokenTrailingSourceMaps\"] = 256] = \"NoTokenTrailingSourceMaps\";\n        EmitFlags[EmitFlags[\"NoTokenSourceMaps\"] = 384] = \"NoTokenSourceMaps\";\n        EmitFlags[EmitFlags[\"NoLeadingComments\"] = 512] = \"NoLeadingComments\";\n        EmitFlags[EmitFlags[\"NoTrailingComments\"] = 1024] = \"NoTrailingComments\";\n        EmitFlags[EmitFlags[\"NoComments\"] = 1536] = \"NoComments\";\n        EmitFlags[EmitFlags[\"NoNestedComments\"] = 2048] = \"NoNestedComments\";\n        EmitFlags[EmitFlags[\"HelperName\"] = 4096] = \"HelperName\";\n        EmitFlags[EmitFlags[\"ExportName\"] = 8192] = \"ExportName\";\n        EmitFlags[EmitFlags[\"LocalName\"] = 16384] = \"LocalName\";\n        EmitFlags[EmitFlags[\"InternalName\"] = 32768] = \"InternalName\";\n        EmitFlags[EmitFlags[\"Indented\"] = 65536] = \"Indented\";\n        EmitFlags[EmitFlags[\"NoIndentation\"] = 131072] = \"NoIndentation\";\n        EmitFlags[EmitFlags[\"AsyncFunctionBody\"] = 262144] = \"AsyncFunctionBody\";\n        EmitFlags[EmitFlags[\"ReuseTempVariableScope\"] = 524288] = \"ReuseTempVariableScope\";\n        EmitFlags[EmitFlags[\"CustomPrologue\"] = 1048576] = \"CustomPrologue\";\n        EmitFlags[EmitFlags[\"NoHoisting\"] = 2097152] = \"NoHoisting\";\n        EmitFlags[EmitFlags[\"HasEndOfDeclarationMarker\"] = 4194304] = \"HasEndOfDeclarationMarker\";\n        EmitFlags[EmitFlags[\"Iterator\"] = 8388608] = \"Iterator\";\n        EmitFlags[EmitFlags[\"NoAsciiEscaping\"] = 16777216] = \"NoAsciiEscaping\";\n        /*@internal*/ EmitFlags[EmitFlags[\"TypeScriptClassWrapper\"] = 33554432] = \"TypeScriptClassWrapper\";\n        /*@internal*/ EmitFlags[EmitFlags[\"NeverApplyImportHelper\"] = 67108864] = \"NeverApplyImportHelper\";\n        /*@internal*/ EmitFlags[EmitFlags[\"IgnoreSourceNewlines\"] = 134217728] = \"IgnoreSourceNewlines\";\n    })(EmitFlags = ts.EmitFlags || (ts.EmitFlags = {}));\n    /**\n     * Used by the checker, this enum keeps track of external emit helpers that should be type\n     * checked.\n     */\n    /* @internal */\n    var ExternalEmitHelpers;\n    (function (ExternalEmitHelpers) {\n        ExternalEmitHelpers[ExternalEmitHelpers[\"Extends\"] = 1] = \"Extends\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"Assign\"] = 2] = \"Assign\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"Rest\"] = 4] = \"Rest\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"Decorate\"] = 8] = \"Decorate\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"Metadata\"] = 16] = \"Metadata\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"Param\"] = 32] = \"Param\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"Awaiter\"] = 64] = \"Awaiter\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"Generator\"] = 128] = \"Generator\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"Values\"] = 256] = \"Values\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"Read\"] = 512] = \"Read\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"SpreadArray\"] = 1024] = \"SpreadArray\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"Await\"] = 2048] = \"Await\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"AsyncGenerator\"] = 4096] = \"AsyncGenerator\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"AsyncDelegator\"] = 8192] = \"AsyncDelegator\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"AsyncValues\"] = 16384] = \"AsyncValues\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"ExportStar\"] = 32768] = \"ExportStar\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"ImportStar\"] = 65536] = \"ImportStar\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"ImportDefault\"] = 131072] = \"ImportDefault\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"MakeTemplateObject\"] = 262144] = \"MakeTemplateObject\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"ClassPrivateFieldGet\"] = 524288] = \"ClassPrivateFieldGet\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"ClassPrivateFieldSet\"] = 1048576] = \"ClassPrivateFieldSet\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"CreateBinding\"] = 2097152] = \"CreateBinding\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"FirstEmitHelper\"] = 1] = \"FirstEmitHelper\";\n        ExternalEmitHelpers[ExternalEmitHelpers[\"LastEmitHelper\"] = 2097152] = \"LastEmitHelper\";\n        // Helpers included by ES2015 for..of\n        ExternalEmitHelpers[ExternalEmitHelpers[\"ForOfIncludes\"] = 256] = \"ForOfIncludes\";\n        // Helpers included by ES2017 for..await..of\n        ExternalEmitHelpers[ExternalEmitHelpers[\"ForAwaitOfIncludes\"] = 16384] = \"ForAwaitOfIncludes\";\n        // Helpers included by ES2017 async generators\n        ExternalEmitHelpers[ExternalEmitHelpers[\"AsyncGeneratorIncludes\"] = 6144] = \"AsyncGeneratorIncludes\";\n        // Helpers included by yield* in ES2017 async generators\n        ExternalEmitHelpers[ExternalEmitHelpers[\"AsyncDelegatorIncludes\"] = 26624] = \"AsyncDelegatorIncludes\";\n        // Helpers included by ES2015 spread\n        ExternalEmitHelpers[ExternalEmitHelpers[\"SpreadIncludes\"] = 1536] = \"SpreadIncludes\";\n    })(ExternalEmitHelpers = ts.ExternalEmitHelpers || (ts.ExternalEmitHelpers = {}));\n    var EmitHint;\n    (function (EmitHint) {\n        EmitHint[EmitHint[\"SourceFile\"] = 0] = \"SourceFile\";\n        EmitHint[EmitHint[\"Expression\"] = 1] = \"Expression\";\n        EmitHint[EmitHint[\"IdentifierName\"] = 2] = \"IdentifierName\";\n        EmitHint[EmitHint[\"MappedTypeParameter\"] = 3] = \"MappedTypeParameter\";\n        EmitHint[EmitHint[\"Unspecified\"] = 4] = \"Unspecified\";\n        EmitHint[EmitHint[\"EmbeddedStatement\"] = 5] = \"EmbeddedStatement\";\n        EmitHint[EmitHint[\"JsxAttributeValue\"] = 6] = \"JsxAttributeValue\";\n    })(EmitHint = ts.EmitHint || (ts.EmitHint = {}));\n    var OuterExpressionKinds;\n    (function (OuterExpressionKinds) {\n        OuterExpressionKinds[OuterExpressionKinds[\"Parentheses\"] = 1] = \"Parentheses\";\n        OuterExpressionKinds[OuterExpressionKinds[\"TypeAssertions\"] = 2] = \"TypeAssertions\";\n        OuterExpressionKinds[OuterExpressionKinds[\"NonNullAssertions\"] = 4] = \"NonNullAssertions\";\n        OuterExpressionKinds[OuterExpressionKinds[\"PartiallyEmittedExpressions\"] = 8] = \"PartiallyEmittedExpressions\";\n        OuterExpressionKinds[OuterExpressionKinds[\"Assertions\"] = 6] = \"Assertions\";\n        OuterExpressionKinds[OuterExpressionKinds[\"All\"] = 15] = \"All\";\n    })(OuterExpressionKinds = ts.OuterExpressionKinds || (ts.OuterExpressionKinds = {}));\n    /* @internal */\n    var LexicalEnvironmentFlags;\n    (function (LexicalEnvironmentFlags) {\n        LexicalEnvironmentFlags[LexicalEnvironmentFlags[\"None\"] = 0] = \"None\";\n        LexicalEnvironmentFlags[LexicalEnvironmentFlags[\"InParameters\"] = 1] = \"InParameters\";\n        LexicalEnvironmentFlags[LexicalEnvironmentFlags[\"VariablesHoistedInParameters\"] = 2] = \"VariablesHoistedInParameters\"; // a temp variable was hoisted while visiting a parameter list\n    })(LexicalEnvironmentFlags = ts.LexicalEnvironmentFlags || (ts.LexicalEnvironmentFlags = {}));\n    /*@internal*/\n    var BundleFileSectionKind;\n    (function (BundleFileSectionKind) {\n        BundleFileSectionKind[\"Prologue\"] = \"prologue\";\n        BundleFileSectionKind[\"EmitHelpers\"] = \"emitHelpers\";\n        BundleFileSectionKind[\"NoDefaultLib\"] = \"no-default-lib\";\n        BundleFileSectionKind[\"Reference\"] = \"reference\";\n        BundleFileSectionKind[\"Type\"] = \"type\";\n        BundleFileSectionKind[\"Lib\"] = \"lib\";\n        BundleFileSectionKind[\"Prepend\"] = \"prepend\";\n        BundleFileSectionKind[\"Text\"] = \"text\";\n        BundleFileSectionKind[\"Internal\"] = \"internal\";\n        // comments?\n    })(BundleFileSectionKind = ts.BundleFileSectionKind || (ts.BundleFileSectionKind = {}));\n    var ListFormat;\n    (function (ListFormat) {\n        ListFormat[ListFormat[\"None\"] = 0] = \"None\";\n        // Line separators\n        ListFormat[ListFormat[\"SingleLine\"] = 0] = \"SingleLine\";\n        ListFormat[ListFormat[\"MultiLine\"] = 1] = \"MultiLine\";\n        ListFormat[ListFormat[\"PreserveLines\"] = 2] = \"PreserveLines\";\n        ListFormat[ListFormat[\"LinesMask\"] = 3] = \"LinesMask\";\n        // Delimiters\n        ListFormat[ListFormat[\"NotDelimited\"] = 0] = \"NotDelimited\";\n        ListFormat[ListFormat[\"BarDelimited\"] = 4] = \"BarDelimited\";\n        ListFormat[ListFormat[\"AmpersandDelimited\"] = 8] = \"AmpersandDelimited\";\n        ListFormat[ListFormat[\"CommaDelimited\"] = 16] = \"CommaDelimited\";\n        ListFormat[ListFormat[\"AsteriskDelimited\"] = 32] = \"AsteriskDelimited\";\n        ListFormat[ListFormat[\"DelimitersMask\"] = 60] = \"DelimitersMask\";\n        ListFormat[ListFormat[\"AllowTrailingComma\"] = 64] = \"AllowTrailingComma\";\n        // Whitespace\n        ListFormat[ListFormat[\"Indented\"] = 128] = \"Indented\";\n        ListFormat[ListFormat[\"SpaceBetweenBraces\"] = 256] = \"SpaceBetweenBraces\";\n        ListFormat[ListFormat[\"SpaceBetweenSiblings\"] = 512] = \"SpaceBetweenSiblings\";\n        // Brackets/Braces\n        ListFormat[ListFormat[\"Braces\"] = 1024] = \"Braces\";\n        ListFormat[ListFormat[\"Parenthesis\"] = 2048] = \"Parenthesis\";\n        ListFormat[ListFormat[\"AngleBrackets\"] = 4096] = \"AngleBrackets\";\n        ListFormat[ListFormat[\"SquareBrackets\"] = 8192] = \"SquareBrackets\";\n        ListFormat[ListFormat[\"BracketsMask\"] = 15360] = \"BracketsMask\";\n        ListFormat[ListFormat[\"OptionalIfUndefined\"] = 16384] = \"OptionalIfUndefined\";\n        ListFormat[ListFormat[\"OptionalIfEmpty\"] = 32768] = \"OptionalIfEmpty\";\n        ListFormat[ListFormat[\"Optional\"] = 49152] = \"Optional\";\n        // Other\n        ListFormat[ListFormat[\"PreferNewLine\"] = 65536] = \"PreferNewLine\";\n        ListFormat[ListFormat[\"NoTrailingNewLine\"] = 131072] = \"NoTrailingNewLine\";\n        ListFormat[ListFormat[\"NoInterveningComments\"] = 262144] = \"NoInterveningComments\";\n        ListFormat[ListFormat[\"NoSpaceIfEmpty\"] = 524288] = \"NoSpaceIfEmpty\";\n        ListFormat[ListFormat[\"SingleElement\"] = 1048576] = \"SingleElement\";\n        ListFormat[ListFormat[\"SpaceAfterList\"] = 2097152] = \"SpaceAfterList\";\n        // Precomputed Formats\n        ListFormat[ListFormat[\"Modifiers\"] = 262656] = \"Modifiers\";\n        ListFormat[ListFormat[\"HeritageClauses\"] = 512] = \"HeritageClauses\";\n        ListFormat[ListFormat[\"SingleLineTypeLiteralMembers\"] = 768] = \"SingleLineTypeLiteralMembers\";\n        ListFormat[ListFormat[\"MultiLineTypeLiteralMembers\"] = 32897] = \"MultiLineTypeLiteralMembers\";\n        ListFormat[ListFormat[\"SingleLineTupleTypeElements\"] = 528] = \"SingleLineTupleTypeElements\";\n        ListFormat[ListFormat[\"MultiLineTupleTypeElements\"] = 657] = \"MultiLineTupleTypeElements\";\n        ListFormat[ListFormat[\"UnionTypeConstituents\"] = 516] = \"UnionTypeConstituents\";\n        ListFormat[ListFormat[\"IntersectionTypeConstituents\"] = 520] = \"IntersectionTypeConstituents\";\n        ListFormat[ListFormat[\"ObjectBindingPatternElements\"] = 525136] = \"ObjectBindingPatternElements\";\n        ListFormat[ListFormat[\"ArrayBindingPatternElements\"] = 524880] = \"ArrayBindingPatternElements\";\n        ListFormat[ListFormat[\"ObjectLiteralExpressionProperties\"] = 526226] = \"ObjectLiteralExpressionProperties\";\n        ListFormat[ListFormat[\"ArrayLiteralExpressionElements\"] = 8914] = \"ArrayLiteralExpressionElements\";\n        ListFormat[ListFormat[\"CommaListElements\"] = 528] = \"CommaListElements\";\n        ListFormat[ListFormat[\"CallExpressionArguments\"] = 2576] = \"CallExpressionArguments\";\n        ListFormat[ListFormat[\"NewExpressionArguments\"] = 18960] = \"NewExpressionArguments\";\n        ListFormat[ListFormat[\"TemplateExpressionSpans\"] = 262144] = \"TemplateExpressionSpans\";\n        ListFormat[ListFormat[\"SingleLineBlockStatements\"] = 768] = \"SingleLineBlockStatements\";\n        ListFormat[ListFormat[\"MultiLineBlockStatements\"] = 129] = \"MultiLineBlockStatements\";\n        ListFormat[ListFormat[\"VariableDeclarationList\"] = 528] = \"VariableDeclarationList\";\n        ListFormat[ListFormat[\"SingleLineFunctionBodyStatements\"] = 768] = \"SingleLineFunctionBodyStatements\";\n        ListFormat[ListFormat[\"MultiLineFunctionBodyStatements\"] = 1] = \"MultiLineFunctionBodyStatements\";\n        ListFormat[ListFormat[\"ClassHeritageClauses\"] = 0] = \"ClassHeritageClauses\";\n        ListFormat[ListFormat[\"ClassMembers\"] = 129] = \"ClassMembers\";\n        ListFormat[ListFormat[\"InterfaceMembers\"] = 129] = \"InterfaceMembers\";\n        ListFormat[ListFormat[\"EnumMembers\"] = 145] = \"EnumMembers\";\n        ListFormat[ListFormat[\"CaseBlockClauses\"] = 129] = \"CaseBlockClauses\";\n        ListFormat[ListFormat[\"NamedImportsOrExportsElements\"] = 525136] = \"NamedImportsOrExportsElements\";\n        ListFormat[ListFormat[\"JsxElementOrFragmentChildren\"] = 262144] = \"JsxElementOrFragmentChildren\";\n        ListFormat[ListFormat[\"JsxElementAttributes\"] = 262656] = \"JsxElementAttributes\";\n        ListFormat[ListFormat[\"CaseOrDefaultClauseStatements\"] = 163969] = \"CaseOrDefaultClauseStatements\";\n        ListFormat[ListFormat[\"HeritageClauseTypes\"] = 528] = \"HeritageClauseTypes\";\n        ListFormat[ListFormat[\"SourceFileStatements\"] = 131073] = \"SourceFileStatements\";\n        ListFormat[ListFormat[\"Decorators\"] = 2146305] = \"Decorators\";\n        ListFormat[ListFormat[\"TypeArguments\"] = 53776] = \"TypeArguments\";\n        ListFormat[ListFormat[\"TypeParameters\"] = 53776] = \"TypeParameters\";\n        ListFormat[ListFormat[\"Parameters\"] = 2576] = \"Parameters\";\n        ListFormat[ListFormat[\"IndexSignatureParameters\"] = 8848] = \"IndexSignatureParameters\";\n        ListFormat[ListFormat[\"JSDocComment\"] = 33] = \"JSDocComment\";\n    })(ListFormat = ts.ListFormat || (ts.ListFormat = {}));\n    /* @internal */\n    var PragmaKindFlags;\n    (function (PragmaKindFlags) {\n        PragmaKindFlags[PragmaKindFlags[\"None\"] = 0] = \"None\";\n        /**\n         * Triple slash comment of the form\n         * /// <pragma-name argname=\"value\" />\n         */\n        PragmaKindFlags[PragmaKindFlags[\"TripleSlashXML\"] = 1] = \"TripleSlashXML\";\n        /**\n         * Single line comment of the form\n         * // @pragma-name argval1 argval2\n         * or\n         * /// @pragma-name argval1 argval2\n         */\n        PragmaKindFlags[PragmaKindFlags[\"SingleLine\"] = 2] = \"SingleLine\";\n        /**\n         * Multiline non-jsdoc pragma of the form\n         * /* @pragma-name argval1 argval2 * /\n         */\n        PragmaKindFlags[PragmaKindFlags[\"MultiLine\"] = 4] = \"MultiLine\";\n        PragmaKindFlags[PragmaKindFlags[\"All\"] = 7] = \"All\";\n        PragmaKindFlags[PragmaKindFlags[\"Default\"] = 7] = \"Default\";\n    })(PragmaKindFlags = ts.PragmaKindFlags || (ts.PragmaKindFlags = {}));\n    // While not strictly a type, this is here because `PragmaMap` needs to be here to be used with `SourceFile`, and we don't\n    //  fancy effectively defining it twice, once in value-space and once in type-space\n    /* @internal */\n    ts.commentPragmas = {\n        \"reference\": {\n            args: [\n                { name: \"types\", optional: true, captureSpan: true },\n                { name: \"lib\", optional: true, captureSpan: true },\n                { name: \"path\", optional: true, captureSpan: true },\n                { name: \"no-default-lib\", optional: true }\n            ],\n            kind: 1 /* TripleSlashXML */\n        },\n        \"amd-dependency\": {\n            args: [{ name: \"path\" }, { name: \"name\", optional: true }],\n            kind: 1 /* TripleSlashXML */\n        },\n        \"amd-module\": {\n            args: [{ name: \"name\" }],\n            kind: 1 /* TripleSlashXML */\n        },\n        \"ts-check\": {\n            kind: 2 /* SingleLine */\n        },\n        \"ts-nocheck\": {\n            kind: 2 /* SingleLine */\n        },\n        \"jsx\": {\n            args: [{ name: \"factory\" }],\n            kind: 4 /* MultiLine */\n        },\n        \"jsxfrag\": {\n            args: [{ name: \"factory\" }],\n            kind: 4 /* MultiLine */\n        },\n        \"jsximportsource\": {\n            args: [{ name: \"factory\" }],\n            kind: 4 /* MultiLine */\n        },\n        \"jsxruntime\": {\n            args: [{ name: \"factory\" }],\n            kind: 4 /* MultiLine */\n        },\n    };\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    /**\n     * Internally, we represent paths as strings with '/' as the directory separator.\n     * When we make system calls (eg: LanguageServiceHost.getDirectory()),\n     * we expect the host to correctly handle paths in our specified format.\n     */\n    ts.directorySeparator = \"/\";\n    ts.altDirectorySeparator = \"\\\\\";\n    var urlSchemeSeparator = \"://\";\n    var backslashRegExp = /\\\\/g;\n    //// Path Tests\n    /**\n     * Determines whether a charCode corresponds to `/` or `\\`.\n     */\n    function isAnyDirectorySeparator(charCode) {\n        return charCode === 47 /* slash */ || charCode === 92 /* backslash */;\n    }\n    ts.isAnyDirectorySeparator = isAnyDirectorySeparator;\n    /**\n     * Determines whether a path starts with a URL scheme (e.g. starts with `http://`, `ftp://`, `file://`, etc.).\n     */\n    function isUrl(path) {\n        return getEncodedRootLength(path) < 0;\n    }\n    ts.isUrl = isUrl;\n    /**\n     * Determines whether a path is an absolute disk path (e.g. starts with `/`, or a dos path\n     * like `c:`, `c:\\` or `c:/`).\n     */\n    function isRootedDiskPath(path) {\n        return getEncodedRootLength(path) > 0;\n    }\n    ts.isRootedDiskPath = isRootedDiskPath;\n    /**\n     * Determines whether a path consists only of a path root.\n     */\n    function isDiskPathRoot(path) {\n        var rootLength = getEncodedRootLength(path);\n        return rootLength > 0 && rootLength === path.length;\n    }\n    ts.isDiskPathRoot = isDiskPathRoot;\n    /**\n     * Determines whether a path starts with an absolute path component (i.e. `/`, `c:/`, `file://`, etc.).\n     *\n     * ```ts\n     * // POSIX\n     * pathIsAbsolute(\"/path/to/file.ext\") === true\n     * // DOS\n     * pathIsAbsolute(\"c:/path/to/file.ext\") === true\n     * // URL\n     * pathIsAbsolute(\"file:///path/to/file.ext\") === true\n     * // Non-absolute\n     * pathIsAbsolute(\"path/to/file.ext\") === false\n     * pathIsAbsolute(\"./path/to/file.ext\") === false\n     * ```\n     */\n    function pathIsAbsolute(path) {\n        return getEncodedRootLength(path) !== 0;\n    }\n    ts.pathIsAbsolute = pathIsAbsolute;\n    /**\n     * Determines whether a path starts with a relative path component (i.e. `.` or `..`).\n     */\n    function pathIsRelative(path) {\n        return /^\\.\\.?($|[\\\\/])/.test(path);\n    }\n    ts.pathIsRelative = pathIsRelative;\n    /**\n     * Determines whether a path is neither relative nor absolute, e.g. \"path/to/file\".\n     * Also known misleadingly as \"non-relative\".\n     */\n    function pathIsBareSpecifier(path) {\n        return !pathIsAbsolute(path) && !pathIsRelative(path);\n    }\n    ts.pathIsBareSpecifier = pathIsBareSpecifier;\n    function hasExtension(fileName) {\n        return ts.stringContains(getBaseFileName(fileName), \".\");\n    }\n    ts.hasExtension = hasExtension;\n    function fileExtensionIs(path, extension) {\n        return path.length > extension.length && ts.endsWith(path, extension);\n    }\n    ts.fileExtensionIs = fileExtensionIs;\n    function fileExtensionIsOneOf(path, extensions) {\n        for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) {\n            var extension = extensions_1[_i];\n            if (fileExtensionIs(path, extension)) {\n                return true;\n            }\n        }\n        return false;\n    }\n    ts.fileExtensionIsOneOf = fileExtensionIsOneOf;\n    /**\n     * Determines whether a path has a trailing separator (`/` or `\\\\`).\n     */\n    function hasTrailingDirectorySeparator(path) {\n        return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1));\n    }\n    ts.hasTrailingDirectorySeparator = hasTrailingDirectorySeparator;\n    //// Path Parsing\n    function isVolumeCharacter(charCode) {\n        return (charCode >= 97 /* a */ && charCode <= 122 /* z */) ||\n            (charCode >= 65 /* A */ && charCode <= 90 /* Z */);\n    }\n    function getFileUrlVolumeSeparatorEnd(url, start) {\n        var ch0 = url.charCodeAt(start);\n        if (ch0 === 58 /* colon */)\n            return start + 1;\n        if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) {\n            var ch2 = url.charCodeAt(start + 2);\n            if (ch2 === 97 /* a */ || ch2 === 65 /* A */)\n                return start + 3;\n        }\n        return -1;\n    }\n    /**\n     * Returns length of the root part of a path or URL (i.e. length of \"/\", \"x:/\", \"//server/share/, file:///user/files\").\n     * If the root is part of a URL, the twos-complement of the root length is returned.\n     */\n    function getEncodedRootLength(path) {\n        if (!path)\n            return 0;\n        var ch0 = path.charCodeAt(0);\n        // POSIX or UNC\n        if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) {\n            if (path.charCodeAt(1) !== ch0)\n                return 1; // POSIX: \"/\" (or non-normalized \"\\\")\n            var p1 = path.indexOf(ch0 === 47 /* slash */ ? ts.directorySeparator : ts.altDirectorySeparator, 2);\n            if (p1 < 0)\n                return path.length; // UNC: \"//server\" or \"\\\\server\"\n            return p1 + 1; // UNC: \"//server/\" or \"\\\\server\\\"\n        }\n        // DOS\n        if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) {\n            var ch2 = path.charCodeAt(2);\n            if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */)\n                return 3; // DOS: \"c:/\" or \"c:\\\"\n            if (path.length === 2)\n                return 2; // DOS: \"c:\" (but not \"c:d\")\n        }\n        // URL\n        var schemeEnd = path.indexOf(urlSchemeSeparator);\n        if (schemeEnd !== -1) {\n            var authorityStart = schemeEnd + urlSchemeSeparator.length;\n            var authorityEnd = path.indexOf(ts.directorySeparator, authorityStart);\n            if (authorityEnd !== -1) { // URL: \"file:///\", \"file://server/\", \"file://server/path\"\n                // For local \"file\" URLs, include the leading DOS volume (if present).\n                // Per https://www.ietf.org/rfc/rfc1738.txt, a host of \"\" or \"localhost\" is a\n                // special case interpreted as \"the machine from which the URL is being interpreted\".\n                var scheme = path.slice(0, schemeEnd);\n                var authority = path.slice(authorityStart, authorityEnd);\n                if (scheme === \"file\" && (authority === \"\" || authority === \"localhost\") &&\n                    isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) {\n                    var volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2);\n                    if (volumeSeparatorEnd !== -1) {\n                        if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) {\n                            // URL: \"file:///c:/\", \"file://localhost/c:/\", \"file:///c%3a/\", \"file://localhost/c%3a/\"\n                            return ~(volumeSeparatorEnd + 1);\n                        }\n                        if (volumeSeparatorEnd === path.length) {\n                            // URL: \"file:///c:\", \"file://localhost/c:\", \"file:///c$3a\", \"file://localhost/c%3a\"\n                            // but not \"file:///c:d\" or \"file:///c%3ad\"\n                            return ~volumeSeparatorEnd;\n                        }\n                    }\n                }\n                return ~(authorityEnd + 1); // URL: \"file://server/\", \"http://server/\"\n            }\n            return ~path.length; // URL: \"file://server\", \"http://server\"\n        }\n        // relative\n        return 0;\n    }\n    /**\n     * Returns length of the root part of a path or URL (i.e. length of \"/\", \"x:/\", \"//server/share/, file:///user/files\").\n     *\n     * For example:\n     * ```ts\n     * getRootLength(\"a\") === 0                   // \"\"\n     * getRootLength(\"/\") === 1                   // \"/\"\n     * getRootLength(\"c:\") === 2                  // \"c:\"\n     * getRootLength(\"c:d\") === 0                 // \"\"\n     * getRootLength(\"c:/\") === 3                 // \"c:/\"\n     * getRootLength(\"c:\\\\\") === 3                // \"c:\\\\\"\n     * getRootLength(\"//server\") === 7            // \"//server\"\n     * getRootLength(\"//server/share\") === 8      // \"//server/\"\n     * getRootLength(\"\\\\\\\\server\") === 7          // \"\\\\\\\\server\"\n     * getRootLength(\"\\\\\\\\server\\\\share\") === 8   // \"\\\\\\\\server\\\\\"\n     * getRootLength(\"file:///path\") === 8        // \"file:///\"\n     * getRootLength(\"file:///c:\") === 10         // \"file:///c:\"\n     * getRootLength(\"file:///c:d\") === 8         // \"file:///\"\n     * getRootLength(\"file:///c:/path\") === 11    // \"file:///c:/\"\n     * getRootLength(\"file://server\") === 13      // \"file://server\"\n     * getRootLength(\"file://server/path\") === 14 // \"file://server/\"\n     * getRootLength(\"http://server\") === 13      // \"http://server\"\n     * getRootLength(\"http://server/path\") === 14 // \"http://server/\"\n     * ```\n     */\n    function getRootLength(path) {\n        var rootLength = getEncodedRootLength(path);\n        return rootLength < 0 ? ~rootLength : rootLength;\n    }\n    ts.getRootLength = getRootLength;\n    function getDirectoryPath(path) {\n        path = normalizeSlashes(path);\n        // If the path provided is itself the root, then return it.\n        var rootLength = getRootLength(path);\n        if (rootLength === path.length)\n            return path;\n        // return the leading portion of the path up to the last (non-terminal) directory separator\n        // but not including any trailing directory separator.\n        path = removeTrailingDirectorySeparator(path);\n        return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator)));\n    }\n    ts.getDirectoryPath = getDirectoryPath;\n    function getBaseFileName(path, extensions, ignoreCase) {\n        path = normalizeSlashes(path);\n        // if the path provided is itself the root, then it has not file name.\n        var rootLength = getRootLength(path);\n        if (rootLength === path.length)\n            return \"\";\n        // return the trailing portion of the path starting after the last (non-terminal) directory\n        // separator but not including any trailing directory separator.\n        path = removeTrailingDirectorySeparator(path);\n        var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1));\n        var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined;\n        return extension ? name.slice(0, name.length - extension.length) : name;\n    }\n    ts.getBaseFileName = getBaseFileName;\n    function tryGetExtensionFromPath(path, extension, stringEqualityComparer) {\n        if (!ts.startsWith(extension, \".\"))\n            extension = \".\" + extension;\n        if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46 /* dot */) {\n            var pathExtension = path.slice(path.length - extension.length);\n            if (stringEqualityComparer(pathExtension, extension)) {\n                return pathExtension;\n            }\n        }\n    }\n    function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) {\n        if (typeof extensions === \"string\") {\n            return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || \"\";\n        }\n        for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) {\n            var extension = extensions_2[_i];\n            var result = tryGetExtensionFromPath(path, extension, stringEqualityComparer);\n            if (result)\n                return result;\n        }\n        return \"\";\n    }\n    function getAnyExtensionFromPath(path, extensions, ignoreCase) {\n        // Retrieves any string from the final \".\" onwards from a base file name.\n        // Unlike extensionFromPath, which throws an exception on unrecognized extensions.\n        if (extensions) {\n            return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive);\n        }\n        var baseFileName = getBaseFileName(path);\n        var extensionIndex = baseFileName.lastIndexOf(\".\");\n        if (extensionIndex >= 0) {\n            return baseFileName.substring(extensionIndex);\n        }\n        return \"\";\n    }\n    ts.getAnyExtensionFromPath = getAnyExtensionFromPath;\n    function pathComponents(path, rootLength) {\n        var root = path.substring(0, rootLength);\n        var rest = path.substring(rootLength).split(ts.directorySeparator);\n        if (rest.length && !ts.lastOrUndefined(rest))\n            rest.pop();\n        return __spreadArray([root], rest);\n    }\n    /**\n     * Parse a path into an array containing a root component (at index 0) and zero or more path\n     * components (at indices > 0). The result is not normalized.\n     * If the path is relative, the root component is `\"\"`.\n     * If the path is absolute, the root component includes the first path separator (`/`).\n     *\n     * ```ts\n     * // POSIX\n     * getPathComponents(\"/path/to/file.ext\") === [\"/\", \"path\", \"to\", \"file.ext\"]\n     * getPathComponents(\"/path/to/\") === [\"/\", \"path\", \"to\"]\n     * getPathComponents(\"/\") === [\"/\"]\n     * // DOS\n     * getPathComponents(\"c:/path/to/file.ext\") === [\"c:/\", \"path\", \"to\", \"file.ext\"]\n     * getPathComponents(\"c:/path/to/\") === [\"c:/\", \"path\", \"to\"]\n     * getPathComponents(\"c:/\") === [\"c:/\"]\n     * getPathComponents(\"c:\") === [\"c:\"]\n     * // URL\n     * getPathComponents(\"http://typescriptlang.org/path/to/file.ext\") === [\"http://typescriptlang.org/\", \"path\", \"to\", \"file.ext\"]\n     * getPathComponents(\"http://typescriptlang.org/path/to/\") === [\"http://typescriptlang.org/\", \"path\", \"to\"]\n     * getPathComponents(\"http://typescriptlang.org/\") === [\"http://typescriptlang.org/\"]\n     * getPathComponents(\"http://typescriptlang.org\") === [\"http://typescriptlang.org\"]\n     * getPathComponents(\"file://server/path/to/file.ext\") === [\"file://server/\", \"path\", \"to\", \"file.ext\"]\n     * getPathComponents(\"file://server/path/to/\") === [\"file://server/\", \"path\", \"to\"]\n     * getPathComponents(\"file://server/\") === [\"file://server/\"]\n     * getPathComponents(\"file://server\") === [\"file://server\"]\n     * getPathComponents(\"file:///path/to/file.ext\") === [\"file:///\", \"path\", \"to\", \"file.ext\"]\n     * getPathComponents(\"file:///path/to/\") === [\"file:///\", \"path\", \"to\"]\n     * getPathComponents(\"file:///\") === [\"file:///\"]\n     * getPathComponents(\"file://\") === [\"file://\"]\n     */\n    function getPathComponents(path, currentDirectory) {\n        if (currentDirectory === void 0) { currentDirectory = \"\"; }\n        path = combinePaths(currentDirectory, path);\n        return pathComponents(path, getRootLength(path));\n    }\n    ts.getPathComponents = getPathComponents;\n    //// Path Formatting\n    /**\n     * Formats a parsed path consisting of a root component (at index 0) and zero or more path\n     * segments (at indices > 0).\n     *\n     * ```ts\n     * getPathFromPathComponents([\"/\", \"path\", \"to\", \"file.ext\"]) === \"/path/to/file.ext\"\n     * ```\n     */\n    function getPathFromPathComponents(pathComponents) {\n        if (pathComponents.length === 0)\n            return \"\";\n        var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]);\n        return root + pathComponents.slice(1).join(ts.directorySeparator);\n    }\n    ts.getPathFromPathComponents = getPathFromPathComponents;\n    //// Path Normalization\n    /**\n     * Normalize path separators, converting `\\` into `/`.\n     */\n    function normalizeSlashes(path) {\n        return path.replace(backslashRegExp, ts.directorySeparator);\n    }\n    ts.normalizeSlashes = normalizeSlashes;\n    /**\n     * Reduce an array of path components to a more simplified path by navigating any\n     * `\".\"` or `\"..\"` entries in the path.\n     */\n    function reducePathComponents(components) {\n        if (!ts.some(components))\n            return [];\n        var reduced = [components[0]];\n        for (var i = 1; i < components.length; i++) {\n            var component = components[i];\n            if (!component)\n                continue;\n            if (component === \".\")\n                continue;\n            if (component === \"..\") {\n                if (reduced.length > 1) {\n                    if (reduced[reduced.length - 1] !== \"..\") {\n                        reduced.pop();\n                        continue;\n                    }\n                }\n                else if (reduced[0])\n                    continue;\n            }\n            reduced.push(component);\n        }\n        return reduced;\n    }\n    ts.reducePathComponents = reducePathComponents;\n    /**\n     * Combines paths. If a path is absolute, it replaces any previous path. Relative paths are not simplified.\n     *\n     * ```ts\n     * // Non-rooted\n     * combinePaths(\"path\", \"to\", \"file.ext\") === \"path/to/file.ext\"\n     * combinePaths(\"path\", \"dir\", \"..\", \"to\", \"file.ext\") === \"path/dir/../to/file.ext\"\n     * // POSIX\n     * combinePaths(\"/path\", \"to\", \"file.ext\") === \"/path/to/file.ext\"\n     * combinePaths(\"/path\", \"/to\", \"file.ext\") === \"/to/file.ext\"\n     * // DOS\n     * combinePaths(\"c:/path\", \"to\", \"file.ext\") === \"c:/path/to/file.ext\"\n     * combinePaths(\"c:/path\", \"c:/to\", \"file.ext\") === \"c:/to/file.ext\"\n     * // URL\n     * combinePaths(\"file:///path\", \"to\", \"file.ext\") === \"file:///path/to/file.ext\"\n     * combinePaths(\"file:///path\", \"file:///to\", \"file.ext\") === \"file:///to/file.ext\"\n     * ```\n     */\n    function combinePaths(path) {\n        var paths = [];\n        for (var _i = 1; _i < arguments.length; _i++) {\n            paths[_i - 1] = arguments[_i];\n        }\n        if (path)\n            path = normalizeSlashes(path);\n        for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) {\n            var relativePath = paths_1[_a];\n            if (!relativePath)\n                continue;\n            relativePath = normalizeSlashes(relativePath);\n            if (!path || getRootLength(relativePath) !== 0) {\n                path = relativePath;\n            }\n            else {\n                path = ensureTrailingDirectorySeparator(path) + relativePath;\n            }\n        }\n        return path;\n    }\n    ts.combinePaths = combinePaths;\n    /**\n     * Combines and resolves paths. If a path is absolute, it replaces any previous path. Any\n     * `.` and `..` path components are resolved. Trailing directory separators are preserved.\n     *\n     * ```ts\n     * resolvePath(\"/path\", \"to\", \"file.ext\") === \"path/to/file.ext\"\n     * resolvePath(\"/path\", \"to\", \"file.ext/\") === \"path/to/file.ext/\"\n     * resolvePath(\"/path\", \"dir\", \"..\", \"to\", \"file.ext\") === \"path/to/file.ext\"\n     * ```\n     */\n    function resolvePath(path) {\n        var paths = [];\n        for (var _i = 1; _i < arguments.length; _i++) {\n            paths[_i - 1] = arguments[_i];\n        }\n        return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArray([path], paths)) : normalizeSlashes(path));\n    }\n    ts.resolvePath = resolvePath;\n    /**\n     * Parse a path into an array containing a root component (at index 0) and zero or more path\n     * components (at indices > 0). The result is normalized.\n     * If the path is relative, the root component is `\"\"`.\n     * If the path is absolute, the root component includes the first path separator (`/`).\n     *\n     * ```ts\n     * getNormalizedPathComponents(\"to/dir/../file.ext\", \"/path/\") === [\"/\", \"path\", \"to\", \"file.ext\"]\n     * ```\n     */\n    function getNormalizedPathComponents(path, currentDirectory) {\n        return reducePathComponents(getPathComponents(path, currentDirectory));\n    }\n    ts.getNormalizedPathComponents = getNormalizedPathComponents;\n    function getNormalizedAbsolutePath(fileName, currentDirectory) {\n        return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory));\n    }\n    ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath;\n    function normalizePath(path) {\n        path = normalizeSlashes(path);\n        var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path)));\n        return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized;\n    }\n    ts.normalizePath = normalizePath;\n    function getPathWithoutRoot(pathComponents) {\n        if (pathComponents.length === 0)\n            return \"\";\n        return pathComponents.slice(1).join(ts.directorySeparator);\n    }\n    function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) {\n        return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory));\n    }\n    ts.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot;\n    function toPath(fileName, basePath, getCanonicalFileName) {\n        var nonCanonicalizedPath = isRootedDiskPath(fileName)\n            ? normalizePath(fileName)\n            : getNormalizedAbsolutePath(fileName, basePath);\n        return getCanonicalFileName(nonCanonicalizedPath);\n    }\n    ts.toPath = toPath;\n    function normalizePathAndParts(path) {\n        path = normalizeSlashes(path);\n        var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1);\n        if (parts.length) {\n            var joinedParts = root + parts.join(ts.directorySeparator);\n            return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts };\n        }\n        else {\n            return { path: root, parts: parts };\n        }\n    }\n    ts.normalizePathAndParts = normalizePathAndParts;\n    function removeTrailingDirectorySeparator(path) {\n        if (hasTrailingDirectorySeparator(path)) {\n            return path.substr(0, path.length - 1);\n        }\n        return path;\n    }\n    ts.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator;\n    function ensureTrailingDirectorySeparator(path) {\n        if (!hasTrailingDirectorySeparator(path)) {\n            return path + ts.directorySeparator;\n        }\n        return path;\n    }\n    ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator;\n    /**\n     * Ensures a path is either absolute (prefixed with `/` or `c:`) or dot-relative (prefixed\n     * with `./` or `../`) so as not to be confused with an unprefixed module name.\n     *\n     * ```ts\n     * ensurePathIsNonModuleName(\"/path/to/file.ext\") === \"/path/to/file.ext\"\n     * ensurePathIsNonModuleName(\"./path/to/file.ext\") === \"./path/to/file.ext\"\n     * ensurePathIsNonModuleName(\"../path/to/file.ext\") === \"../path/to/file.ext\"\n     * ensurePathIsNonModuleName(\"path/to/file.ext\") === \"./path/to/file.ext\"\n     * ```\n     */\n    function ensurePathIsNonModuleName(path) {\n        return !pathIsAbsolute(path) && !pathIsRelative(path) ? \"./\" + path : path;\n    }\n    ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName;\n    function changeAnyExtension(path, ext, extensions, ignoreCase) {\n        var pathext = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path);\n        return pathext ? path.slice(0, path.length - pathext.length) + (ts.startsWith(ext, \".\") ? ext : \".\" + ext) : path;\n    }\n    ts.changeAnyExtension = changeAnyExtension;\n    //// Path Comparisons\n    // check path for these segments: '', '.'. '..'\n    var relativePathSegmentRegExp = /(^|\\/)\\.{0,2}($|\\/)/;\n    function comparePathsWorker(a, b, componentComparer) {\n        if (a === b)\n            return 0 /* EqualTo */;\n        if (a === undefined)\n            return -1 /* LessThan */;\n        if (b === undefined)\n            return 1 /* GreaterThan */;\n        // NOTE: Performance optimization - shortcut if the root segments differ as there would be no\n        //       need to perform path reduction.\n        var aRoot = a.substring(0, getRootLength(a));\n        var bRoot = b.substring(0, getRootLength(b));\n        var result = ts.compareStringsCaseInsensitive(aRoot, bRoot);\n        if (result !== 0 /* EqualTo */) {\n            return result;\n        }\n        // NOTE: Performance optimization - shortcut if there are no relative path segments in\n        //       the non-root portion of the path\n        var aRest = a.substring(aRoot.length);\n        var bRest = b.substring(bRoot.length);\n        if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) {\n            return componentComparer(aRest, bRest);\n        }\n        // The path contains a relative path segment. Normalize the paths and perform a slower component\n        // by component comparison.\n        var aComponents = reducePathComponents(getPathComponents(a));\n        var bComponents = reducePathComponents(getPathComponents(b));\n        var sharedLength = Math.min(aComponents.length, bComponents.length);\n        for (var i = 1; i < sharedLength; i++) {\n            var result_2 = componentComparer(aComponents[i], bComponents[i]);\n            if (result_2 !== 0 /* EqualTo */) {\n                return result_2;\n            }\n        }\n        return ts.compareValues(aComponents.length, bComponents.length);\n    }\n    /**\n     * Performs a case-sensitive comparison of two paths. Path roots are always compared case-insensitively.\n     */\n    function comparePathsCaseSensitive(a, b) {\n        return comparePathsWorker(a, b, ts.compareStringsCaseSensitive);\n    }\n    ts.comparePathsCaseSensitive = comparePathsCaseSensitive;\n    /**\n     * Performs a case-insensitive comparison of two paths.\n     */\n    function comparePathsCaseInsensitive(a, b) {\n        return comparePathsWorker(a, b, ts.compareStringsCaseInsensitive);\n    }\n    ts.comparePathsCaseInsensitive = comparePathsCaseInsensitive;\n    function comparePaths(a, b, currentDirectory, ignoreCase) {\n        if (typeof currentDirectory === \"string\") {\n            a = combinePaths(currentDirectory, a);\n            b = combinePaths(currentDirectory, b);\n        }\n        else if (typeof currentDirectory === \"boolean\") {\n            ignoreCase = currentDirectory;\n        }\n        return comparePathsWorker(a, b, ts.getStringComparer(ignoreCase));\n    }\n    ts.comparePaths = comparePaths;\n    function containsPath(parent, child, currentDirectory, ignoreCase) {\n        if (typeof currentDirectory === \"string\") {\n            parent = combinePaths(currentDirectory, parent);\n            child = combinePaths(currentDirectory, child);\n        }\n        else if (typeof currentDirectory === \"boolean\") {\n            ignoreCase = currentDirectory;\n        }\n        if (parent === undefined || child === undefined)\n            return false;\n        if (parent === child)\n            return true;\n        var parentComponents = reducePathComponents(getPathComponents(parent));\n        var childComponents = reducePathComponents(getPathComponents(child));\n        if (childComponents.length < parentComponents.length) {\n            return false;\n        }\n        var componentEqualityComparer = ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive;\n        for (var i = 0; i < parentComponents.length; i++) {\n            var equalityComparer = i === 0 ? ts.equateStringsCaseInsensitive : componentEqualityComparer;\n            if (!equalityComparer(parentComponents[i], childComponents[i])) {\n                return false;\n            }\n        }\n        return true;\n    }\n    ts.containsPath = containsPath;\n    /**\n     * Determines whether `fileName` starts with the specified `directoryName` using the provided path canonicalization callback.\n     * Comparison is case-sensitive between the canonical paths.\n     *\n     * Use `containsPath` if file names are not already reduced and absolute.\n     */\n    function startsWithDirectory(fileName, directoryName, getCanonicalFileName) {\n        var canonicalFileName = getCanonicalFileName(fileName);\n        var canonicalDirectoryName = getCanonicalFileName(directoryName);\n        return ts.startsWith(canonicalFileName, canonicalDirectoryName + \"/\") || ts.startsWith(canonicalFileName, canonicalDirectoryName + \"\\\\\");\n    }\n    ts.startsWithDirectory = startsWithDirectory;\n    //// Relative Paths\n    function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) {\n        var fromComponents = reducePathComponents(getPathComponents(from));\n        var toComponents = reducePathComponents(getPathComponents(to));\n        var start;\n        for (start = 0; start < fromComponents.length && start < toComponents.length; start++) {\n            var fromComponent = getCanonicalFileName(fromComponents[start]);\n            var toComponent = getCanonicalFileName(toComponents[start]);\n            var comparer = start === 0 ? ts.equateStringsCaseInsensitive : stringEqualityComparer;\n            if (!comparer(fromComponent, toComponent))\n                break;\n        }\n        if (start === 0) {\n            return toComponents;\n        }\n        var components = toComponents.slice(start);\n        var relative = [];\n        for (; start < fromComponents.length; start++) {\n            relative.push(\"..\");\n        }\n        return __spreadArray(__spreadArray([\"\"], relative), components);\n    }\n    ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo;\n    function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) {\n        ts.Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), \"Paths must either both be absolute or both be relative\");\n        var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === \"function\" ? getCanonicalFileNameOrIgnoreCase : ts.identity;\n        var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === \"boolean\" ? getCanonicalFileNameOrIgnoreCase : false;\n        var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName);\n        return getPathFromPathComponents(pathComponents);\n    }\n    ts.getRelativePathFromDirectory = getRelativePathFromDirectory;\n    function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) {\n        return !isRootedDiskPath(absoluteOrRelativePath)\n            ? absoluteOrRelativePath\n            : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false);\n    }\n    ts.convertToRelativePath = convertToRelativePath;\n    function getRelativePathFromFile(from, to, getCanonicalFileName) {\n        return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName));\n    }\n    ts.getRelativePathFromFile = getRelativePathFromFile;\n    function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) {\n        var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName);\n        var firstComponent = pathComponents[0];\n        if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) {\n            var prefix = firstComponent.charAt(0) === ts.directorySeparator ? \"file://\" : \"file:///\";\n            pathComponents[0] = prefix + firstComponent;\n        }\n        return getPathFromPathComponents(pathComponents);\n    }\n    ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl;\n    function forEachAncestorDirectory(directory, callback) {\n        while (true) {\n            var result = callback(directory);\n            if (result !== undefined) {\n                return result;\n            }\n            var parentPath = getDirectoryPath(directory);\n            if (parentPath === directory) {\n                return undefined;\n            }\n            directory = parentPath;\n        }\n    }\n    ts.forEachAncestorDirectory = forEachAncestorDirectory;\n    function isNodeModulesDirectory(dirPath) {\n        return ts.endsWith(dirPath, \"/node_modules\");\n    }\n    ts.isNodeModulesDirectory = isNodeModulesDirectory;\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    /**\n     * djb2 hashing algorithm\n     * http://www.cse.yorku.ca/~oz/hash.html\n     */\n    /* @internal */\n    function generateDjb2Hash(data) {\n        var acc = 5381;\n        for (var i = 0; i < data.length; i++) {\n            acc = ((acc << 5) + acc) + data.charCodeAt(i);\n        }\n        return acc.toString();\n    }\n    ts.generateDjb2Hash = generateDjb2Hash;\n    /**\n     * Set a high stack trace limit to provide more information in case of an error.\n     * Called for command-line and server use cases.\n     * Not called if TypeScript is used as a library.\n     */\n    /* @internal */\n    function setStackTraceLimit() {\n        if (Error.stackTraceLimit < 100) { // Also tests that we won't set the property if it doesn't exist.\n            Error.stackTraceLimit = 100;\n        }\n    }\n    ts.setStackTraceLimit = setStackTraceLimit;\n    var FileWatcherEventKind;\n    (function (FileWatcherEventKind) {\n        FileWatcherEventKind[FileWatcherEventKind[\"Created\"] = 0] = \"Created\";\n        FileWatcherEventKind[FileWatcherEventKind[\"Changed\"] = 1] = \"Changed\";\n        FileWatcherEventKind[FileWatcherEventKind[\"Deleted\"] = 2] = \"Deleted\";\n    })(FileWatcherEventKind = ts.FileWatcherEventKind || (ts.FileWatcherEventKind = {}));\n    /* @internal */\n    var PollingInterval;\n    (function (PollingInterval) {\n        PollingInterval[PollingInterval[\"High\"] = 2000] = \"High\";\n        PollingInterval[PollingInterval[\"Medium\"] = 500] = \"Medium\";\n        PollingInterval[PollingInterval[\"Low\"] = 250] = \"Low\";\n    })(PollingInterval = ts.PollingInterval || (ts.PollingInterval = {}));\n    /* @internal */\n    ts.missingFileModifiedTime = new Date(0); // Any subsequent modification will occur after this time\n    function createPollingIntervalBasedLevels(levels) {\n        var _a;\n        return _a = {},\n            _a[PollingInterval.Low] = levels.Low,\n            _a[PollingInterval.Medium] = levels.Medium,\n            _a[PollingInterval.High] = levels.High,\n            _a;\n    }\n    var defaultChunkLevels = { Low: 32, Medium: 64, High: 256 };\n    var pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels);\n    /* @internal */\n    ts.unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels);\n    /* @internal */\n    function setCustomPollingValues(system) {\n        if (!system.getEnvironmentVariable) {\n            return;\n        }\n        var pollingIntervalChanged = setCustomLevels(\"TSC_WATCH_POLLINGINTERVAL\", PollingInterval);\n        pollingChunkSize = getCustomPollingBasedLevels(\"TSC_WATCH_POLLINGCHUNKSIZE\", defaultChunkLevels) || pollingChunkSize;\n        ts.unchangedPollThresholds = getCustomPollingBasedLevels(\"TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS\", defaultChunkLevels) || ts.unchangedPollThresholds;\n        function getLevel(envVar, level) {\n            return system.getEnvironmentVariable(envVar + \"_\" + level.toUpperCase());\n        }\n        function getCustomLevels(baseVariable) {\n            var customLevels;\n            setCustomLevel(\"Low\");\n            setCustomLevel(\"Medium\");\n            setCustomLevel(\"High\");\n            return customLevels;\n            function setCustomLevel(level) {\n                var customLevel = getLevel(baseVariable, level);\n                if (customLevel) {\n                    (customLevels || (customLevels = {}))[level] = Number(customLevel);\n                }\n            }\n        }\n        function setCustomLevels(baseVariable, levels) {\n            var customLevels = getCustomLevels(baseVariable);\n            if (customLevels) {\n                setLevel(\"Low\");\n                setLevel(\"Medium\");\n                setLevel(\"High\");\n                return true;\n            }\n            return false;\n            function setLevel(level) {\n                levels[level] = customLevels[level] || levels[level];\n            }\n        }\n        function getCustomPollingBasedLevels(baseVariable, defaultLevels) {\n            var customLevels = getCustomLevels(baseVariable);\n            return (pollingIntervalChanged || customLevels) &&\n                createPollingIntervalBasedLevels(customLevels ? __assign(__assign({}, defaultLevels), customLevels) : defaultLevels);\n        }\n    }\n    ts.setCustomPollingValues = setCustomPollingValues;\n    /* @internal */\n    function createDynamicPriorityPollingWatchFile(host) {\n        var watchedFiles = [];\n        var changedFilesInLastPoll = [];\n        var lowPollingIntervalQueue = createPollingIntervalQueue(PollingInterval.Low);\n        var mediumPollingIntervalQueue = createPollingIntervalQueue(PollingInterval.Medium);\n        var highPollingIntervalQueue = createPollingIntervalQueue(PollingInterval.High);\n        return watchFile;\n        function watchFile(fileName, callback, defaultPollingInterval) {\n            var file = {\n                fileName: fileName,\n                callback: callback,\n                unchangedPolls: 0,\n                mtime: getModifiedTime(fileName)\n            };\n            watchedFiles.push(file);\n            addToPollingIntervalQueue(file, defaultPollingInterval);\n            return {\n                close: function () {\n                    file.isClosed = true;\n                    // Remove from watchedFiles\n                    ts.unorderedRemoveItem(watchedFiles, file);\n                    // Do not update polling interval queue since that will happen as part of polling\n                }\n            };\n        }\n        function createPollingIntervalQueue(pollingInterval) {\n            var queue = [];\n            queue.pollingInterval = pollingInterval;\n            queue.pollIndex = 0;\n            queue.pollScheduled = false;\n            return queue;\n        }\n        function pollPollingIntervalQueue(queue) {\n            queue.pollIndex = pollQueue(queue, queue.pollingInterval, queue.pollIndex, pollingChunkSize[queue.pollingInterval]);\n            // Set the next polling index and timeout\n            if (queue.length) {\n                scheduleNextPoll(queue.pollingInterval);\n            }\n            else {\n                ts.Debug.assert(queue.pollIndex === 0);\n                queue.pollScheduled = false;\n            }\n        }\n        function pollLowPollingIntervalQueue(queue) {\n            // Always poll complete list of changedFilesInLastPoll\n            pollQueue(changedFilesInLastPoll, PollingInterval.Low, /*pollIndex*/ 0, changedFilesInLastPoll.length);\n            // Finally do the actual polling of the queue\n            pollPollingIntervalQueue(queue);\n            // Schedule poll if there are files in changedFilesInLastPoll but no files in the actual queue\n            // as pollPollingIntervalQueue wont schedule for next poll\n            if (!queue.pollScheduled && changedFilesInLastPoll.length) {\n                scheduleNextPoll(PollingInterval.Low);\n            }\n        }\n        function pollQueue(queue, pollingInterval, pollIndex, chunkSize) {\n            // Max visit would be all elements of the queue\n            var needsVisit = queue.length;\n            var definedValueCopyToIndex = pollIndex;\n            for (var polled = 0; polled < chunkSize && needsVisit > 0; nextPollIndex(), needsVisit--) {\n                var watchedFile = queue[pollIndex];\n                if (!watchedFile) {\n                    continue;\n                }\n                else if (watchedFile.isClosed) {\n                    queue[pollIndex] = undefined;\n                    continue;\n                }\n                polled++;\n                var fileChanged = onWatchedFileStat(watchedFile, getModifiedTime(watchedFile.fileName));\n                if (watchedFile.isClosed) {\n                    // Closed watcher as part of callback\n                    queue[pollIndex] = undefined;\n                }\n                else if (fileChanged) {\n                    watchedFile.unchangedPolls = 0;\n                    // Changed files go to changedFilesInLastPoll queue\n                    if (queue !== changedFilesInLastPoll) {\n                        queue[pollIndex] = undefined;\n                        addChangedFileToLowPollingIntervalQueue(watchedFile);\n                    }\n                }\n                else if (watchedFile.unchangedPolls !== ts.unchangedPollThresholds[pollingInterval]) {\n                    watchedFile.unchangedPolls++;\n                }\n                else if (queue === changedFilesInLastPoll) {\n                    // Restart unchangedPollCount for unchanged file and move to low polling interval queue\n                    watchedFile.unchangedPolls = 1;\n                    queue[pollIndex] = undefined;\n                    addToPollingIntervalQueue(watchedFile, PollingInterval.Low);\n                }\n                else if (pollingInterval !== PollingInterval.High) {\n                    watchedFile.unchangedPolls++;\n                    queue[pollIndex] = undefined;\n                    addToPollingIntervalQueue(watchedFile, pollingInterval === PollingInterval.Low ? PollingInterval.Medium : PollingInterval.High);\n                }\n                if (queue[pollIndex]) {\n                    // Copy this file to the non hole location\n                    if (definedValueCopyToIndex < pollIndex) {\n                        queue[definedValueCopyToIndex] = watchedFile;\n                        queue[pollIndex] = undefined;\n                    }\n                    definedValueCopyToIndex++;\n                }\n            }\n            // Return next poll index\n            return pollIndex;\n            function nextPollIndex() {\n                pollIndex++;\n                if (pollIndex === queue.length) {\n                    if (definedValueCopyToIndex < pollIndex) {\n                        // There are holes from nextDefinedValueIndex to end of queue, change queue size\n                        queue.length = definedValueCopyToIndex;\n                    }\n                    pollIndex = 0;\n                    definedValueCopyToIndex = 0;\n                }\n            }\n        }\n        function pollingIntervalQueue(pollingInterval) {\n            switch (pollingInterval) {\n                case PollingInterval.Low:\n                    return lowPollingIntervalQueue;\n                case PollingInterval.Medium:\n                    return mediumPollingIntervalQueue;\n                case PollingInterval.High:\n                    return highPollingIntervalQueue;\n            }\n        }\n        function addToPollingIntervalQueue(file, pollingInterval) {\n            pollingIntervalQueue(pollingInterval).push(file);\n            scheduleNextPollIfNotAlreadyScheduled(pollingInterval);\n        }\n        function addChangedFileToLowPollingIntervalQueue(file) {\n            changedFilesInLastPoll.push(file);\n            scheduleNextPollIfNotAlreadyScheduled(PollingInterval.Low);\n        }\n        function scheduleNextPollIfNotAlreadyScheduled(pollingInterval) {\n            if (!pollingIntervalQueue(pollingInterval).pollScheduled) {\n                scheduleNextPoll(pollingInterval);\n            }\n        }\n        function scheduleNextPoll(pollingInterval) {\n            pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === PollingInterval.Low ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingIntervalQueue(pollingInterval));\n        }\n        function getModifiedTime(fileName) {\n            return host.getModifiedTime(fileName) || ts.missingFileModifiedTime;\n        }\n    }\n    ts.createDynamicPriorityPollingWatchFile = createDynamicPriorityPollingWatchFile;\n    function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames) {\n        // One file can have multiple watchers\n        var fileWatcherCallbacks = ts.createMultiMap();\n        var dirWatchers = new ts.Map();\n        var toCanonicalName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);\n        return nonPollingWatchFile;\n        function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {\n            var filePath = toCanonicalName(fileName);\n            fileWatcherCallbacks.add(filePath, callback);\n            var dirPath = ts.getDirectoryPath(filePath) || \".\";\n            var watcher = dirWatchers.get(dirPath) ||\n                createDirectoryWatcher(ts.getDirectoryPath(fileName) || \".\", dirPath, fallbackOptions);\n            watcher.referenceCount++;\n            return {\n                close: function () {\n                    if (watcher.referenceCount === 1) {\n                        watcher.close();\n                        dirWatchers.delete(dirPath);\n                    }\n                    else {\n                        watcher.referenceCount--;\n                    }\n                    fileWatcherCallbacks.remove(filePath, callback);\n                }\n            };\n        }\n        function createDirectoryWatcher(dirName, dirPath, fallbackOptions) {\n            var watcher = fsWatch(dirName, 1 /* Directory */, function (_eventName, relativeFileName) {\n                // When files are deleted from disk, the triggered \"rename\" event would have a relativefileName of \"undefined\"\n                if (!ts.isString(relativeFileName)) {\n                    return;\n                }\n                var fileName = ts.getNormalizedAbsolutePath(relativeFileName, dirName);\n                // Some applications save a working file via rename operations\n                var callbacks = fileName && fileWatcherCallbacks.get(toCanonicalName(fileName));\n                if (callbacks) {\n                    for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) {\n                        var fileCallback = callbacks_1[_i];\n                        fileCallback(fileName, FileWatcherEventKind.Changed);\n                    }\n                }\n            }, \n            /*recursive*/ false, PollingInterval.Medium, fallbackOptions);\n            watcher.referenceCount = 0;\n            dirWatchers.set(dirPath, watcher);\n            return watcher;\n        }\n    }\n    /* @internal */\n    function createSingleFileWatcherPerName(watchFile, useCaseSensitiveFileNames) {\n        var cache = new ts.Map();\n        var callbacksCache = ts.createMultiMap();\n        var toCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);\n        return function (fileName, callback, pollingInterval, options) {\n            var path = toCanonicalFileName(fileName);\n            var existing = cache.get(path);\n            if (existing) {\n                existing.refCount++;\n            }\n            else {\n                cache.set(path, {\n                    watcher: watchFile(fileName, function (fileName, eventKind) { return ts.forEach(callbacksCache.get(path), function (cb) { return cb(fileName, eventKind); }); }, pollingInterval, options),\n                    refCount: 1\n                });\n            }\n            callbacksCache.add(path, callback);\n            return {\n                close: function () {\n                    var watcher = ts.Debug.checkDefined(cache.get(path));\n                    callbacksCache.remove(path, callback);\n                    watcher.refCount--;\n                    if (watcher.refCount)\n                        return;\n                    cache.delete(path);\n                    ts.closeFileWatcherOf(watcher);\n                }\n            };\n        };\n    }\n    ts.createSingleFileWatcherPerName = createSingleFileWatcherPerName;\n    /**\n     * Returns true if file status changed\n     */\n    /*@internal*/\n    function onWatchedFileStat(watchedFile, modifiedTime) {\n        var oldTime = watchedFile.mtime.getTime();\n        var newTime = modifiedTime.getTime();\n        if (oldTime !== newTime) {\n            watchedFile.mtime = modifiedTime;\n            watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime));\n            return true;\n        }\n        return false;\n    }\n    ts.onWatchedFileStat = onWatchedFileStat;\n    /*@internal*/\n    function getFileWatcherEventKind(oldTime, newTime) {\n        return oldTime === 0\n            ? FileWatcherEventKind.Created\n            : newTime === 0\n                ? FileWatcherEventKind.Deleted\n                : FileWatcherEventKind.Changed;\n    }\n    ts.getFileWatcherEventKind = getFileWatcherEventKind;\n    /*@internal*/\n    ts.ignoredPaths = [\"/node_modules/.\", \"/.git\", \"/.#\"];\n    /*@internal*/\n    ts.sysLog = ts.noop; // eslint-disable-line prefer-const\n    /*@internal*/\n    function setSysLog(logger) {\n        ts.sysLog = logger;\n    }\n    ts.setSysLog = setSysLog;\n    /**\n     * Watch the directory recursively using host provided method to watch child directories\n     * that means if this is recursive watcher, watch the children directories as well\n     * (eg on OS that dont support recursive watch using fs.watch use fs.watchFile)\n     */\n    /*@internal*/\n    function createDirectoryWatcherSupportingRecursive(_a) {\n        var watchDirectory = _a.watchDirectory, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, directoryExists = _a.directoryExists, realpath = _a.realpath, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout;\n        var cache = new ts.Map();\n        var callbackCache = ts.createMultiMap();\n        var cacheToUpdateChildWatches = new ts.Map();\n        var timerToUpdateChildWatches;\n        var filePathComparer = ts.getStringComparer(!useCaseSensitiveFileNames);\n        var toCanonicalFilePath = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);\n        return function (dirName, callback, recursive, options) { return recursive ?\n            createDirectoryWatcher(dirName, options, callback) :\n            watchDirectory(dirName, callback, recursive, options); };\n        /**\n         * Create the directory watcher for the dirPath.\n         */\n        function createDirectoryWatcher(dirName, options, callback) {\n            var dirPath = toCanonicalFilePath(dirName);\n            var directoryWatcher = cache.get(dirPath);\n            if (directoryWatcher) {\n                directoryWatcher.refCount++;\n            }\n            else {\n                directoryWatcher = {\n                    watcher: watchDirectory(dirName, function (fileName) {\n                        if (isIgnoredPath(fileName, options))\n                            return;\n                        if (options === null || options === void 0 ? void 0 : options.synchronousWatchDirectory) {\n                            // Call the actual callback\n                            invokeCallbacks(dirPath, fileName);\n                            // Iterate through existing children and update the watches if needed\n                            updateChildWatches(dirName, dirPath, options);\n                        }\n                        else {\n                            nonSyncUpdateChildWatches(dirName, dirPath, fileName, options);\n                        }\n                    }, /*recursive*/ false, options),\n                    refCount: 1,\n                    childWatches: ts.emptyArray\n                };\n                cache.set(dirPath, directoryWatcher);\n                updateChildWatches(dirName, dirPath, options);\n            }\n            var callbackToAdd = callback && { dirName: dirName, callback: callback };\n            if (callbackToAdd) {\n                callbackCache.add(dirPath, callbackToAdd);\n            }\n            return {\n                dirName: dirName,\n                close: function () {\n                    var directoryWatcher = ts.Debug.checkDefined(cache.get(dirPath));\n                    if (callbackToAdd)\n                        callbackCache.remove(dirPath, callbackToAdd);\n                    directoryWatcher.refCount--;\n                    if (directoryWatcher.refCount)\n                        return;\n                    cache.delete(dirPath);\n                    ts.closeFileWatcherOf(directoryWatcher);\n                    directoryWatcher.childWatches.forEach(ts.closeFileWatcher);\n                }\n            };\n        }\n        function invokeCallbacks(dirPath, fileNameOrInvokeMap, fileNames) {\n            var fileName;\n            var invokeMap;\n            if (ts.isString(fileNameOrInvokeMap)) {\n                fileName = fileNameOrInvokeMap;\n            }\n            else {\n                invokeMap = fileNameOrInvokeMap;\n            }\n            // Call the actual callback\n            callbackCache.forEach(function (callbacks, rootDirName) {\n                var _a;\n                if (invokeMap && invokeMap.get(rootDirName) === true)\n                    return;\n                if (rootDirName === dirPath || (ts.startsWith(dirPath, rootDirName) && dirPath[rootDirName.length] === ts.directorySeparator)) {\n                    if (invokeMap) {\n                        if (fileNames) {\n                            var existing = invokeMap.get(rootDirName);\n                            if (existing) {\n                                (_a = existing).push.apply(_a, fileNames);\n                            }\n                            else {\n                                invokeMap.set(rootDirName, fileNames.slice());\n                            }\n                        }\n                        else {\n                            invokeMap.set(rootDirName, true);\n                        }\n                    }\n                    else {\n                        callbacks.forEach(function (_a) {\n                            var callback = _a.callback;\n                            return callback(fileName);\n                        });\n                    }\n                }\n            });\n        }\n        function nonSyncUpdateChildWatches(dirName, dirPath, fileName, options) {\n            // Iterate through existing children and update the watches if needed\n            var parentWatcher = cache.get(dirPath);\n            if (parentWatcher && directoryExists(dirName)) {\n                // Schedule the update and postpone invoke for callbacks\n                scheduleUpdateChildWatches(dirName, dirPath, fileName, options);\n                return;\n            }\n            // Call the actual callbacks and remove child watches\n            invokeCallbacks(dirPath, fileName);\n            removeChildWatches(parentWatcher);\n        }\n        function scheduleUpdateChildWatches(dirName, dirPath, fileName, options) {\n            var existing = cacheToUpdateChildWatches.get(dirPath);\n            if (existing) {\n                existing.fileNames.push(fileName);\n            }\n            else {\n                cacheToUpdateChildWatches.set(dirPath, { dirName: dirName, options: options, fileNames: [fileName] });\n            }\n            if (timerToUpdateChildWatches) {\n                clearTimeout(timerToUpdateChildWatches);\n                timerToUpdateChildWatches = undefined;\n            }\n            timerToUpdateChildWatches = setTimeout(onTimerToUpdateChildWatches, 1000);\n        }\n        function onTimerToUpdateChildWatches() {\n            timerToUpdateChildWatches = undefined;\n            ts.sysLog(\"sysLog:: onTimerToUpdateChildWatches:: \" + cacheToUpdateChildWatches.size);\n            var start = ts.timestamp();\n            var invokeMap = new ts.Map();\n            while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {\n                var result = cacheToUpdateChildWatches.entries().next();\n                ts.Debug.assert(!result.done);\n                var _a = result.value, dirPath = _a[0], _b = _a[1], dirName = _b.dirName, options = _b.options, fileNames = _b.fileNames;\n                cacheToUpdateChildWatches.delete(dirPath);\n                // Because the child refresh is fresh, we would need to invalidate whole root directory being watched\n                // to ensure that all the changes are reflected at this time\n                var hasChanges = updateChildWatches(dirName, dirPath, options);\n                invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);\n            }\n            ts.sysLog(\"sysLog:: invokingWatchers:: Elapsed:: \" + (ts.timestamp() - start) + \"ms:: \" + cacheToUpdateChildWatches.size);\n            callbackCache.forEach(function (callbacks, rootDirName) {\n                var existing = invokeMap.get(rootDirName);\n                if (existing) {\n                    callbacks.forEach(function (_a) {\n                        var callback = _a.callback, dirName = _a.dirName;\n                        if (ts.isArray(existing)) {\n                            existing.forEach(callback);\n                        }\n                        else {\n                            callback(dirName);\n                        }\n                    });\n                }\n            });\n            var elapsed = ts.timestamp() - start;\n            ts.sysLog(\"sysLog:: Elapsed:: \" + elapsed + \"ms:: onTimerToUpdateChildWatches:: \" + cacheToUpdateChildWatches.size + \" \" + timerToUpdateChildWatches);\n        }\n        function removeChildWatches(parentWatcher) {\n            if (!parentWatcher)\n                return;\n            var existingChildWatches = parentWatcher.childWatches;\n            parentWatcher.childWatches = ts.emptyArray;\n            for (var _i = 0, existingChildWatches_1 = existingChildWatches; _i < existingChildWatches_1.length; _i++) {\n                var childWatcher = existingChildWatches_1[_i];\n                childWatcher.close();\n                removeChildWatches(cache.get(toCanonicalFilePath(childWatcher.dirName)));\n            }\n        }\n        function updateChildWatches(parentDir, parentDirPath, options) {\n            // Iterate through existing children and update the watches if needed\n            var parentWatcher = cache.get(parentDirPath);\n            if (!parentWatcher)\n                return false;\n            var newChildWatches;\n            var hasChanges = ts.enumerateInsertsAndDeletes(directoryExists(parentDir) ? ts.mapDefined(getAccessibleSortedChildDirectories(parentDir), function (child) {\n                var childFullName = ts.getNormalizedAbsolutePath(child, parentDir);\n                // Filter our the symbolic link directories since those arent included in recursive watch\n                // which is same behaviour when recursive: true is passed to fs.watch\n                return !isIgnoredPath(childFullName, options) && filePathComparer(childFullName, ts.normalizePath(realpath(childFullName))) === 0 /* EqualTo */ ? childFullName : undefined;\n            }) : ts.emptyArray, parentWatcher.childWatches, function (child, childWatcher) { return filePathComparer(child, childWatcher.dirName); }, createAndAddChildDirectoryWatcher, ts.closeFileWatcher, addChildDirectoryWatcher);\n            parentWatcher.childWatches = newChildWatches || ts.emptyArray;\n            return hasChanges;\n            /**\n             * Create new childDirectoryWatcher and add it to the new ChildDirectoryWatcher list\n             */\n            function createAndAddChildDirectoryWatcher(childName) {\n                var result = createDirectoryWatcher(childName, options);\n                addChildDirectoryWatcher(result);\n            }\n            /**\n             * Add child directory watcher to the new ChildDirectoryWatcher list\n             */\n            function addChildDirectoryWatcher(childWatcher) {\n                (newChildWatches || (newChildWatches = [])).push(childWatcher);\n            }\n        }\n        function isIgnoredPath(path, options) {\n            return ts.some(ts.ignoredPaths, function (searchPath) { return isInPath(path, searchPath); }) ||\n                isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames, getCurrentDirectory);\n        }\n        function isInPath(path, searchPath) {\n            if (ts.stringContains(path, searchPath))\n                return true;\n            if (useCaseSensitiveFileNames)\n                return false;\n            return ts.stringContains(toCanonicalFilePath(path), searchPath);\n        }\n    }\n    ts.createDirectoryWatcherSupportingRecursive = createDirectoryWatcherSupportingRecursive;\n    /*@internal*/\n    var FileSystemEntryKind;\n    (function (FileSystemEntryKind) {\n        FileSystemEntryKind[FileSystemEntryKind[\"File\"] = 0] = \"File\";\n        FileSystemEntryKind[FileSystemEntryKind[\"Directory\"] = 1] = \"Directory\";\n    })(FileSystemEntryKind = ts.FileSystemEntryKind || (ts.FileSystemEntryKind = {}));\n    /*@internal*/\n    function createFileWatcherCallback(callback) {\n        return function (_fileName, eventKind) { return callback(eventKind === FileWatcherEventKind.Changed ? \"change\" : \"rename\", \"\"); };\n    }\n    ts.createFileWatcherCallback = createFileWatcherCallback;\n    function createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists) {\n        return function (eventName) {\n            if (eventName === \"rename\") {\n                callback(fileName, fileExists(fileName) ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted);\n            }\n            else {\n                // Change\n                callback(fileName, FileWatcherEventKind.Changed);\n            }\n        };\n    }\n    function isIgnoredByWatchOptions(pathToCheck, options, useCaseSensitiveFileNames, getCurrentDirectory) {\n        return ((options === null || options === void 0 ? void 0 : options.excludeDirectories) || (options === null || options === void 0 ? void 0 : options.excludeFiles)) && (ts.matchesExclude(pathToCheck, options === null || options === void 0 ? void 0 : options.excludeFiles, useCaseSensitiveFileNames, getCurrentDirectory()) ||\n            ts.matchesExclude(pathToCheck, options === null || options === void 0 ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames, getCurrentDirectory()));\n    }\n    function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory) {\n        return function (eventName, relativeFileName) {\n            // In watchDirectory we only care about adding and removing files (when event name is\n            // \"rename\"); changes made within files are handled by corresponding fileWatchers (when\n            // event name is \"change\")\n            if (eventName === \"rename\") {\n                // When deleting a file, the passed baseFileName is null\n                var fileName = !relativeFileName ? directoryName : ts.normalizePath(ts.combinePaths(directoryName, relativeFileName));\n                if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames, getCurrentDirectory)) {\n                    callback(fileName);\n                }\n            }\n        };\n    }\n    /*@internal*/\n    function createSystemWatchFunctions(_a) {\n        var pollingWatchFile = _a.pollingWatchFile, getModifiedTime = _a.getModifiedTime, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout, fsWatch = _a.fsWatch, fileExists = _a.fileExists, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, fsSupportsRecursiveFsWatch = _a.fsSupportsRecursiveFsWatch, directoryExists = _a.directoryExists, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, realpath = _a.realpath, tscWatchFile = _a.tscWatchFile, useNonPollingWatchers = _a.useNonPollingWatchers, tscWatchDirectory = _a.tscWatchDirectory;\n        var dynamicPollingWatchFile;\n        var nonPollingWatchFile;\n        var hostRecursiveDirectoryWatcher;\n        return {\n            watchFile: watchFile,\n            watchDirectory: watchDirectory\n        };\n        function watchFile(fileName, callback, pollingInterval, options) {\n            options = updateOptionsForWatchFile(options, useNonPollingWatchers);\n            var watchFileKind = ts.Debug.checkDefined(options.watchFile);\n            switch (watchFileKind) {\n                case ts.WatchFileKind.FixedPollingInterval:\n                    return pollingWatchFile(fileName, callback, PollingInterval.Low, /*options*/ undefined);\n                case ts.WatchFileKind.PriorityPollingInterval:\n                    return pollingWatchFile(fileName, callback, pollingInterval, /*options*/ undefined);\n                case ts.WatchFileKind.DynamicPriorityPolling:\n                    return ensureDynamicPollingWatchFile()(fileName, callback, pollingInterval, /*options*/ undefined);\n                case ts.WatchFileKind.UseFsEvents:\n                    return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback, fileExists), \n                    /*recursive*/ false, pollingInterval, ts.getFallbackOptions(options));\n                case ts.WatchFileKind.UseFsEventsOnParentDirectory:\n                    if (!nonPollingWatchFile) {\n                        nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames);\n                    }\n                    return nonPollingWatchFile(fileName, callback, pollingInterval, ts.getFallbackOptions(options));\n                default:\n                    ts.Debug.assertNever(watchFileKind);\n            }\n        }\n        function ensureDynamicPollingWatchFile() {\n            return dynamicPollingWatchFile ||\n                (dynamicPollingWatchFile = createDynamicPriorityPollingWatchFile({ getModifiedTime: getModifiedTime, setTimeout: setTimeout }));\n        }\n        function updateOptionsForWatchFile(options, useNonPollingWatchers) {\n            if (options && options.watchFile !== undefined)\n                return options;\n            switch (tscWatchFile) {\n                case \"PriorityPollingInterval\":\n                    // Use polling interval based on priority when create watch using host.watchFile\n                    return { watchFile: ts.WatchFileKind.PriorityPollingInterval };\n                case \"DynamicPriorityPolling\":\n                    // Use polling interval but change the interval depending on file changes and their default polling interval\n                    return { watchFile: ts.WatchFileKind.DynamicPriorityPolling };\n                case \"UseFsEvents\":\n                    // Use notifications from FS to watch with falling back to fs.watchFile\n                    return generateWatchFileOptions(ts.WatchFileKind.UseFsEvents, ts.PollingWatchKind.PriorityInterval, options);\n                case \"UseFsEventsWithFallbackDynamicPolling\":\n                    // Use notifications from FS to watch with falling back to dynamic watch file\n                    return generateWatchFileOptions(ts.WatchFileKind.UseFsEvents, ts.PollingWatchKind.DynamicPriority, options);\n                case \"UseFsEventsOnParentDirectory\":\n                    useNonPollingWatchers = true;\n                // fall through\n                default:\n                    return useNonPollingWatchers ?\n                        // Use notifications from FS to watch with falling back to fs.watchFile\n                        generateWatchFileOptions(ts.WatchFileKind.UseFsEventsOnParentDirectory, ts.PollingWatchKind.PriorityInterval, options) :\n                        // Default to do not use fixed polling interval\n                        { watchFile: ts.WatchFileKind.FixedPollingInterval };\n            }\n        }\n        function generateWatchFileOptions(watchFile, fallbackPolling, options) {\n            var defaultFallbackPolling = options === null || options === void 0 ? void 0 : options.fallbackPolling;\n            return {\n                watchFile: watchFile,\n                fallbackPolling: defaultFallbackPolling === undefined ?\n                    fallbackPolling :\n                    defaultFallbackPolling\n            };\n        }\n        function watchDirectory(directoryName, callback, recursive, options) {\n            if (fsSupportsRecursiveFsWatch) {\n                return fsWatch(directoryName, 1 /* Directory */, createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory), recursive, PollingInterval.Medium, ts.getFallbackOptions(options));\n            }\n            if (!hostRecursiveDirectoryWatcher) {\n                hostRecursiveDirectoryWatcher = createDirectoryWatcherSupportingRecursive({\n                    useCaseSensitiveFileNames: useCaseSensitiveFileNames,\n                    getCurrentDirectory: getCurrentDirectory,\n                    directoryExists: directoryExists,\n                    getAccessibleSortedChildDirectories: getAccessibleSortedChildDirectories,\n                    watchDirectory: nonRecursiveWatchDirectory,\n                    realpath: realpath,\n                    setTimeout: setTimeout,\n                    clearTimeout: clearTimeout\n                });\n            }\n            return hostRecursiveDirectoryWatcher(directoryName, callback, recursive, options);\n        }\n        function nonRecursiveWatchDirectory(directoryName, callback, recursive, options) {\n            ts.Debug.assert(!recursive);\n            var watchDirectoryOptions = updateOptionsForWatchDirectory(options);\n            var watchDirectoryKind = ts.Debug.checkDefined(watchDirectoryOptions.watchDirectory);\n            switch (watchDirectoryKind) {\n                case ts.WatchDirectoryKind.FixedPollingInterval:\n                    return pollingWatchFile(directoryName, function () { return callback(directoryName); }, PollingInterval.Medium, \n                    /*options*/ undefined);\n                case ts.WatchDirectoryKind.DynamicPriorityPolling:\n                    return ensureDynamicPollingWatchFile()(directoryName, function () { return callback(directoryName); }, PollingInterval.Medium, \n                    /*options*/ undefined);\n                case ts.WatchDirectoryKind.UseFsEvents:\n                    return fsWatch(directoryName, 1 /* Directory */, createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory), recursive, PollingInterval.Medium, ts.getFallbackOptions(watchDirectoryOptions));\n                default:\n                    ts.Debug.assertNever(watchDirectoryKind);\n            }\n        }\n        function updateOptionsForWatchDirectory(options) {\n            if (options && options.watchDirectory !== undefined)\n                return options;\n            switch (tscWatchDirectory) {\n                case \"RecursiveDirectoryUsingFsWatchFile\":\n                    // Use polling interval based on priority when create watch using host.watchFile\n                    return { watchDirectory: ts.WatchDirectoryKind.FixedPollingInterval };\n                case \"RecursiveDirectoryUsingDynamicPriorityPolling\":\n                    // Use polling interval but change the interval depending on file changes and their default polling interval\n                    return { watchDirectory: ts.WatchDirectoryKind.DynamicPriorityPolling };\n                default:\n                    var defaultFallbackPolling = options === null || options === void 0 ? void 0 : options.fallbackPolling;\n                    return {\n                        watchDirectory: ts.WatchDirectoryKind.UseFsEvents,\n                        fallbackPolling: defaultFallbackPolling !== undefined ?\n                            defaultFallbackPolling :\n                            undefined\n                    };\n            }\n        }\n    }\n    ts.createSystemWatchFunctions = createSystemWatchFunctions;\n    /**\n     * patch writefile to create folder before writing the file\n     */\n    /*@internal*/\n    function patchWriteFileEnsuringDirectory(sys) {\n        // patch writefile to create folder before writing the file\n        var originalWriteFile = sys.writeFile;\n        sys.writeFile = function (path, data, writeBom) {\n            return ts.writeFileEnsuringDirectories(path, data, !!writeBom, function (path, data, writeByteOrderMark) { return originalWriteFile.call(sys, path, data, writeByteOrderMark); }, function (path) { return sys.createDirectory(path); }, function (path) { return sys.directoryExists(path); });\n        };\n    }\n    ts.patchWriteFileEnsuringDirectory = patchWriteFileEnsuringDirectory;\n    function getNodeMajorVersion() {\n        if (typeof process === \"undefined\") {\n            return undefined;\n        }\n        var version = process.version;\n        if (!version) {\n            return undefined;\n        }\n        var dot = version.indexOf(\".\");\n        if (dot === -1) {\n            return undefined;\n        }\n        return parseInt(version.substring(1, dot));\n    }\n    ts.getNodeMajorVersion = getNodeMajorVersion;\n    // TODO: GH#18217 this is used as if it's certainly defined in many places.\n    // eslint-disable-next-line prefer-const\n    // MONACOCHANGE\n    ts.sys = undefined;\n    // END MONACOCHANGE\n    if (ts.sys && ts.sys.getEnvironmentVariable) {\n        setCustomPollingValues(ts.sys);\n        ts.Debug.setAssertionLevel(/^development$/i.test(ts.sys.getEnvironmentVariable(\"NODE_ENV\"))\n            ? 1 /* Normal */\n            : 0 /* None */);\n    }\n    if (ts.sys && ts.sys.debugMode) {\n        ts.Debug.isDebugging = true;\n    }\n})(ts || (ts = {}));\n// <auto-generated />\n// generated from './diagnosticInformationMap.generated.ts' by 'src/compiler'\n/* @internal */\nvar ts;\n(function (ts) {\n    function diag(code, category, key, message, reportsUnnecessary, elidedInCompatabilityPyramid, reportsDeprecated) {\n        return { code: code, category: category, key: key, message: message, reportsUnnecessary: reportsUnnecessary, elidedInCompatabilityPyramid: elidedInCompatabilityPyramid, reportsDeprecated: reportsDeprecated };\n    }\n    ts.Diagnostics = {\n        Unterminated_string_literal: diag(1002, ts.DiagnosticCategory.Error, \"Unterminated_string_literal_1002\", \"Unterminated string literal.\"),\n        Identifier_expected: diag(1003, ts.DiagnosticCategory.Error, \"Identifier_expected_1003\", \"Identifier expected.\"),\n        _0_expected: diag(1005, ts.DiagnosticCategory.Error, \"_0_expected_1005\", \"'{0}' expected.\"),\n        A_file_cannot_have_a_reference_to_itself: diag(1006, ts.DiagnosticCategory.Error, \"A_file_cannot_have_a_reference_to_itself_1006\", \"A file cannot have a reference to itself.\"),\n        The_parser_expected_to_find_a_to_match_the_token_here: diag(1007, ts.DiagnosticCategory.Error, \"The_parser_expected_to_find_a_to_match_the_token_here_1007\", \"The parser expected to find a '}' to match the '{' token here.\"),\n        Trailing_comma_not_allowed: diag(1009, ts.DiagnosticCategory.Error, \"Trailing_comma_not_allowed_1009\", \"Trailing comma not allowed.\"),\n        Asterisk_Slash_expected: diag(1010, ts.DiagnosticCategory.Error, \"Asterisk_Slash_expected_1010\", \"'*/' expected.\"),\n        An_element_access_expression_should_take_an_argument: diag(1011, ts.DiagnosticCategory.Error, \"An_element_access_expression_should_take_an_argument_1011\", \"An element access expression should take an argument.\"),\n        Unexpected_token: diag(1012, ts.DiagnosticCategory.Error, \"Unexpected_token_1012\", \"Unexpected token.\"),\n        A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma: diag(1013, ts.DiagnosticCategory.Error, \"A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013\", \"A rest parameter or binding pattern may not have a trailing comma.\"),\n        A_rest_parameter_must_be_last_in_a_parameter_list: diag(1014, ts.DiagnosticCategory.Error, \"A_rest_parameter_must_be_last_in_a_parameter_list_1014\", \"A rest parameter must be last in a parameter list.\"),\n        Parameter_cannot_have_question_mark_and_initializer: diag(1015, ts.DiagnosticCategory.Error, \"Parameter_cannot_have_question_mark_and_initializer_1015\", \"Parameter cannot have question mark and initializer.\"),\n        A_required_parameter_cannot_follow_an_optional_parameter: diag(1016, ts.DiagnosticCategory.Error, \"A_required_parameter_cannot_follow_an_optional_parameter_1016\", \"A required parameter cannot follow an optional parameter.\"),\n        An_index_signature_cannot_have_a_rest_parameter: diag(1017, ts.DiagnosticCategory.Error, \"An_index_signature_cannot_have_a_rest_parameter_1017\", \"An index signature cannot have a rest parameter.\"),\n        An_index_signature_parameter_cannot_have_an_accessibility_modifier: diag(1018, ts.DiagnosticCategory.Error, \"An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018\", \"An index signature parameter cannot have an accessibility modifier.\"),\n        An_index_signature_parameter_cannot_have_a_question_mark: diag(1019, ts.DiagnosticCategory.Error, \"An_index_signature_parameter_cannot_have_a_question_mark_1019\", \"An index signature parameter cannot have a question mark.\"),\n        An_index_signature_parameter_cannot_have_an_initializer: diag(1020, ts.DiagnosticCategory.Error, \"An_index_signature_parameter_cannot_have_an_initializer_1020\", \"An index signature parameter cannot have an initializer.\"),\n        An_index_signature_must_have_a_type_annotation: diag(1021, ts.DiagnosticCategory.Error, \"An_index_signature_must_have_a_type_annotation_1021\", \"An index signature must have a type annotation.\"),\n        An_index_signature_parameter_must_have_a_type_annotation: diag(1022, ts.DiagnosticCategory.Error, \"An_index_signature_parameter_must_have_a_type_annotation_1022\", \"An index signature parameter must have a type annotation.\"),\n        An_index_signature_parameter_type_must_be_either_string_or_number: diag(1023, ts.DiagnosticCategory.Error, \"An_index_signature_parameter_type_must_be_either_string_or_number_1023\", \"An index signature parameter type must be either 'string' or 'number'.\"),\n        readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature: diag(1024, ts.DiagnosticCategory.Error, \"readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024\", \"'readonly' modifier can only appear on a property declaration or index signature.\"),\n        An_index_signature_cannot_have_a_trailing_comma: diag(1025, ts.DiagnosticCategory.Error, \"An_index_signature_cannot_have_a_trailing_comma_1025\", \"An index signature cannot have a trailing comma.\"),\n        Accessibility_modifier_already_seen: diag(1028, ts.DiagnosticCategory.Error, \"Accessibility_modifier_already_seen_1028\", \"Accessibility modifier already seen.\"),\n        _0_modifier_must_precede_1_modifier: diag(1029, ts.DiagnosticCategory.Error, \"_0_modifier_must_precede_1_modifier_1029\", \"'{0}' modifier must precede '{1}' modifier.\"),\n        _0_modifier_already_seen: diag(1030, ts.DiagnosticCategory.Error, \"_0_modifier_already_seen_1030\", \"'{0}' modifier already seen.\"),\n        _0_modifier_cannot_appear_on_class_elements_of_this_kind: diag(1031, ts.DiagnosticCategory.Error, \"_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031\", \"'{0}' modifier cannot appear on class elements of this kind.\"),\n        super_must_be_followed_by_an_argument_list_or_member_access: diag(1034, ts.DiagnosticCategory.Error, \"super_must_be_followed_by_an_argument_list_or_member_access_1034\", \"'super' must be followed by an argument list or member access.\"),\n        Only_ambient_modules_can_use_quoted_names: diag(1035, ts.DiagnosticCategory.Error, \"Only_ambient_modules_can_use_quoted_names_1035\", \"Only ambient modules can use quoted names.\"),\n        Statements_are_not_allowed_in_ambient_contexts: diag(1036, ts.DiagnosticCategory.Error, \"Statements_are_not_allowed_in_ambient_contexts_1036\", \"Statements are not allowed in ambient contexts.\"),\n        A_declare_modifier_cannot_be_used_in_an_already_ambient_context: diag(1038, ts.DiagnosticCategory.Error, \"A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038\", \"A 'declare' modifier cannot be used in an already ambient context.\"),\n        Initializers_are_not_allowed_in_ambient_contexts: diag(1039, ts.DiagnosticCategory.Error, \"Initializers_are_not_allowed_in_ambient_contexts_1039\", \"Initializers are not allowed in ambient contexts.\"),\n        _0_modifier_cannot_be_used_in_an_ambient_context: diag(1040, ts.DiagnosticCategory.Error, \"_0_modifier_cannot_be_used_in_an_ambient_context_1040\", \"'{0}' modifier cannot be used in an ambient context.\"),\n        _0_modifier_cannot_be_used_with_a_class_declaration: diag(1041, ts.DiagnosticCategory.Error, \"_0_modifier_cannot_be_used_with_a_class_declaration_1041\", \"'{0}' modifier cannot be used with a class declaration.\"),\n        _0_modifier_cannot_be_used_here: diag(1042, ts.DiagnosticCategory.Error, \"_0_modifier_cannot_be_used_here_1042\", \"'{0}' modifier cannot be used here.\"),\n        _0_modifier_cannot_appear_on_a_data_property: diag(1043, ts.DiagnosticCategory.Error, \"_0_modifier_cannot_appear_on_a_data_property_1043\", \"'{0}' modifier cannot appear on a data property.\"),\n        _0_modifier_cannot_appear_on_a_module_or_namespace_element: diag(1044, ts.DiagnosticCategory.Error, \"_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044\", \"'{0}' modifier cannot appear on a module or namespace element.\"),\n        A_0_modifier_cannot_be_used_with_an_interface_declaration: diag(1045, ts.DiagnosticCategory.Error, \"A_0_modifier_cannot_be_used_with_an_interface_declaration_1045\", \"A '{0}' modifier cannot be used with an interface declaration.\"),\n        Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier: diag(1046, ts.DiagnosticCategory.Error, \"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046\", \"Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.\"),\n        A_rest_parameter_cannot_be_optional: diag(1047, ts.DiagnosticCategory.Error, \"A_rest_parameter_cannot_be_optional_1047\", \"A rest parameter cannot be optional.\"),\n        A_rest_parameter_cannot_have_an_initializer: diag(1048, ts.DiagnosticCategory.Error, \"A_rest_parameter_cannot_have_an_initializer_1048\", \"A rest parameter cannot have an initializer.\"),\n        A_set_accessor_must_have_exactly_one_parameter: diag(1049, ts.DiagnosticCategory.Error, \"A_set_accessor_must_have_exactly_one_parameter_1049\", \"A 'set' accessor must have exactly one parameter.\"),\n        A_set_accessor_cannot_have_an_optional_parameter: diag(1051, ts.DiagnosticCategory.Error, \"A_set_accessor_cannot_have_an_optional_parameter_1051\", \"A 'set' accessor cannot have an optional parameter.\"),\n        A_set_accessor_parameter_cannot_have_an_initializer: diag(1052, ts.DiagnosticCategory.Error, \"A_set_accessor_parameter_cannot_have_an_initializer_1052\", \"A 'set' accessor parameter cannot have an initializer.\"),\n        A_set_accessor_cannot_have_rest_parameter: diag(1053, ts.DiagnosticCategory.Error, \"A_set_accessor_cannot_have_rest_parameter_1053\", \"A 'set' accessor cannot have rest parameter.\"),\n        A_get_accessor_cannot_have_parameters: diag(1054, ts.DiagnosticCategory.Error, \"A_get_accessor_cannot_have_parameters_1054\", \"A 'get' accessor cannot have parameters.\"),\n        Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: diag(1055, ts.DiagnosticCategory.Error, \"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055\", \"Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value.\"),\n        Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: diag(1056, ts.DiagnosticCategory.Error, \"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056\", \"Accessors are only available when targeting ECMAScript 5 and higher.\"),\n        An_async_function_or_method_must_have_a_valid_awaitable_return_type: diag(1057, ts.DiagnosticCategory.Error, \"An_async_function_or_method_must_have_a_valid_awaitable_return_type_1057\", \"An async function or method must have a valid awaitable return type.\"),\n        The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1058, ts.DiagnosticCategory.Error, \"The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058\", \"The return type of an async function must either be a valid promise or must not contain a callable 'then' member.\"),\n        A_promise_must_have_a_then_method: diag(1059, ts.DiagnosticCategory.Error, \"A_promise_must_have_a_then_method_1059\", \"A promise must have a 'then' method.\"),\n        The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback: diag(1060, ts.DiagnosticCategory.Error, \"The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060\", \"The first parameter of the 'then' method of a promise must be a callback.\"),\n        Enum_member_must_have_initializer: diag(1061, ts.DiagnosticCategory.Error, \"Enum_member_must_have_initializer_1061\", \"Enum member must have initializer.\"),\n        Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: diag(1062, ts.DiagnosticCategory.Error, \"Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062\", \"Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method.\"),\n        An_export_assignment_cannot_be_used_in_a_namespace: diag(1063, ts.DiagnosticCategory.Error, \"An_export_assignment_cannot_be_used_in_a_namespace_1063\", \"An export assignment cannot be used in a namespace.\"),\n        The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0: diag(1064, ts.DiagnosticCategory.Error, \"The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064\", \"The return type of an async function or method must be the global Promise<T> type. Did you mean to write 'Promise<{0}>'?\"),\n        In_ambient_enum_declarations_member_initializer_must_be_constant_expression: diag(1066, ts.DiagnosticCategory.Error, \"In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066\", \"In ambient enum declarations member initializer must be constant expression.\"),\n        Unexpected_token_A_constructor_method_accessor_or_property_was_expected: diag(1068, ts.DiagnosticCategory.Error, \"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068\", \"Unexpected token. A constructor, method, accessor, or property was expected.\"),\n        Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces: diag(1069, ts.DiagnosticCategory.Error, \"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069\", \"Unexpected token. A type parameter name was expected without curly braces.\"),\n        _0_modifier_cannot_appear_on_a_type_member: diag(1070, ts.DiagnosticCategory.Error, \"_0_modifier_cannot_appear_on_a_type_member_1070\", \"'{0}' modifier cannot appear on a type member.\"),\n        _0_modifier_cannot_appear_on_an_index_signature: diag(1071, ts.DiagnosticCategory.Error, \"_0_modifier_cannot_appear_on_an_index_signature_1071\", \"'{0}' modifier cannot appear on an index signature.\"),\n        A_0_modifier_cannot_be_used_with_an_import_declaration: diag(1079, ts.DiagnosticCategory.Error, \"A_0_modifier_cannot_be_used_with_an_import_declaration_1079\", \"A '{0}' modifier cannot be used with an import declaration.\"),\n        Invalid_reference_directive_syntax: diag(1084, ts.DiagnosticCategory.Error, \"Invalid_reference_directive_syntax_1084\", \"Invalid 'reference' directive syntax.\"),\n        Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0: diag(1085, ts.DiagnosticCategory.Error, \"Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0_1085\", \"Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'.\"),\n        _0_modifier_cannot_appear_on_a_constructor_declaration: diag(1089, ts.DiagnosticCategory.Error, \"_0_modifier_cannot_appear_on_a_constructor_declaration_1089\", \"'{0}' modifier cannot appear on a constructor declaration.\"),\n        _0_modifier_cannot_appear_on_a_parameter: diag(1090, ts.DiagnosticCategory.Error, \"_0_modifier_cannot_appear_on_a_parameter_1090\", \"'{0}' modifier cannot appear on a parameter.\"),\n        Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: diag(1091, ts.DiagnosticCategory.Error, \"Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091\", \"Only a single variable declaration is allowed in a 'for...in' statement.\"),\n        Type_parameters_cannot_appear_on_a_constructor_declaration: diag(1092, ts.DiagnosticCategory.Error, \"Type_parameters_cannot_appear_on_a_constructor_declaration_1092\", \"Type parameters cannot appear on a constructor declaration.\"),\n        Type_annotation_cannot_appear_on_a_constructor_declaration: diag(1093, ts.DiagnosticCategory.Error, \"Type_annotation_cannot_appear_on_a_constructor_declaration_1093\", \"Type annotation cannot appear on a constructor declaration.\"),\n        An_accessor_cannot_have_type_parameters: diag(1094, ts.DiagnosticCategory.Error, \"An_accessor_cannot_have_type_parameters_1094\", \"An accessor cannot have type parameters.\"),\n        A_set_accessor_cannot_have_a_return_type_annotation: diag(1095, ts.DiagnosticCategory.Error, \"A_set_accessor_cannot_have_a_return_type_annotation_1095\", \"A 'set' accessor cannot have a return type annotation.\"),\n        An_index_signature_must_have_exactly_one_parameter: diag(1096, ts.DiagnosticCategory.Error, \"An_index_signature_must_have_exactly_one_parameter_1096\", \"An index signature must have exactly one parameter.\"),\n        _0_list_cannot_be_empty: diag(1097, ts.DiagnosticCategory.Error, \"_0_list_cannot_be_empty_1097\", \"'{0}' list cannot be empty.\"),\n        Type_parameter_list_cannot_be_empty: diag(1098, ts.DiagnosticCategory.Error, \"Type_parameter_list_cannot_be_empty_1098\", \"Type parameter list cannot be empty.\"),\n        Type_argument_list_cannot_be_empty: diag(1099, ts.DiagnosticCategory.Error, \"Type_argument_list_cannot_be_empty_1099\", \"Type argument list cannot be empty.\"),\n        Invalid_use_of_0_in_strict_mode: diag(1100, ts.DiagnosticCategory.Error, \"Invalid_use_of_0_in_strict_mode_1100\", \"Invalid use of '{0}' in strict mode.\"),\n        with_statements_are_not_allowed_in_strict_mode: diag(1101, ts.DiagnosticCategory.Error, \"with_statements_are_not_allowed_in_strict_mode_1101\", \"'with' statements are not allowed in strict mode.\"),\n        delete_cannot_be_called_on_an_identifier_in_strict_mode: diag(1102, ts.DiagnosticCategory.Error, \"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102\", \"'delete' cannot be called on an identifier in strict mode.\"),\n        for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1103, ts.DiagnosticCategory.Error, \"for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103\", \"'for await' loops are only allowed within async functions and at the top levels of modules.\"),\n        A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: diag(1104, ts.DiagnosticCategory.Error, \"A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104\", \"A 'continue' statement can only be used within an enclosing iteration statement.\"),\n        A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: diag(1105, ts.DiagnosticCategory.Error, \"A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105\", \"A 'break' statement can only be used within an enclosing iteration or switch statement.\"),\n        Jump_target_cannot_cross_function_boundary: diag(1107, ts.DiagnosticCategory.Error, \"Jump_target_cannot_cross_function_boundary_1107\", \"Jump target cannot cross function boundary.\"),\n        A_return_statement_can_only_be_used_within_a_function_body: diag(1108, ts.DiagnosticCategory.Error, \"A_return_statement_can_only_be_used_within_a_function_body_1108\", \"A 'return' statement can only be used within a function body.\"),\n        Expression_expected: diag(1109, ts.DiagnosticCategory.Error, \"Expression_expected_1109\", \"Expression expected.\"),\n        Type_expected: diag(1110, ts.DiagnosticCategory.Error, \"Type_expected_1110\", \"Type expected.\"),\n        A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: diag(1113, ts.DiagnosticCategory.Error, \"A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113\", \"A 'default' clause cannot appear more than once in a 'switch' statement.\"),\n        Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, \"Duplicate_label_0_1114\", \"Duplicate label '{0}'.\"),\n        A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, \"A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115\", \"A 'continue' statement can only jump to a label of an enclosing iteration statement.\"),\n        A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, \"A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116\", \"A 'break' statement can only jump to a label of an enclosing statement.\"),\n        An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: diag(1117, ts.DiagnosticCategory.Error, \"An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117\", \"An object literal cannot have multiple properties with the same name in strict mode.\"),\n        An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, \"An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118\", \"An object literal cannot have multiple get/set accessors with the same name.\"),\n        An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, \"An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119\", \"An object literal cannot have property and accessor with the same name.\"),\n        An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, \"An_export_assignment_cannot_have_modifiers_1120\", \"An export assignment cannot have modifiers.\"),\n        Octal_literals_are_not_allowed_in_strict_mode: diag(1121, ts.DiagnosticCategory.Error, \"Octal_literals_are_not_allowed_in_strict_mode_1121\", \"Octal literals are not allowed in strict mode.\"),\n        Variable_declaration_list_cannot_be_empty: diag(1123, ts.DiagnosticCategory.Error, \"Variable_declaration_list_cannot_be_empty_1123\", \"Variable declaration list cannot be empty.\"),\n        Digit_expected: diag(1124, ts.DiagnosticCategory.Error, \"Digit_expected_1124\", \"Digit expected.\"),\n        Hexadecimal_digit_expected: diag(1125, ts.DiagnosticCategory.Error, \"Hexadecimal_digit_expected_1125\", \"Hexadecimal digit expected.\"),\n        Unexpected_end_of_text: diag(1126, ts.DiagnosticCategory.Error, \"Unexpected_end_of_text_1126\", \"Unexpected end of text.\"),\n        Invalid_character: diag(1127, ts.DiagnosticCategory.Error, \"Invalid_character_1127\", \"Invalid character.\"),\n        Declaration_or_statement_expected: diag(1128, ts.DiagnosticCategory.Error, \"Declaration_or_statement_expected_1128\", \"Declaration or statement expected.\"),\n        Statement_expected: diag(1129, ts.DiagnosticCategory.Error, \"Statement_expected_1129\", \"Statement expected.\"),\n        case_or_default_expected: diag(1130, ts.DiagnosticCategory.Error, \"case_or_default_expected_1130\", \"'case' or 'default' expected.\"),\n        Property_or_signature_expected: diag(1131, ts.DiagnosticCategory.Error, \"Property_or_signature_expected_1131\", \"Property or signature expected.\"),\n        Enum_member_expected: diag(1132, ts.DiagnosticCategory.Error, \"Enum_member_expected_1132\", \"Enum member expected.\"),\n        Variable_declaration_expected: diag(1134, ts.DiagnosticCategory.Error, \"Variable_declaration_expected_1134\", \"Variable declaration expected.\"),\n        Argument_expression_expected: diag(1135, ts.DiagnosticCategory.Error, \"Argument_expression_expected_1135\", \"Argument expression expected.\"),\n        Property_assignment_expected: diag(1136, ts.DiagnosticCategory.Error, \"Property_assignment_expected_1136\", \"Property assignment expected.\"),\n        Expression_or_comma_expected: diag(1137, ts.DiagnosticCategory.Error, \"Expression_or_comma_expected_1137\", \"Expression or comma expected.\"),\n        Parameter_declaration_expected: diag(1138, ts.DiagnosticCategory.Error, \"Parameter_declaration_expected_1138\", \"Parameter declaration expected.\"),\n        Type_parameter_declaration_expected: diag(1139, ts.DiagnosticCategory.Error, \"Type_parameter_declaration_expected_1139\", \"Type parameter declaration expected.\"),\n        Type_argument_expected: diag(1140, ts.DiagnosticCategory.Error, \"Type_argument_expected_1140\", \"Type argument expected.\"),\n        String_literal_expected: diag(1141, ts.DiagnosticCategory.Error, \"String_literal_expected_1141\", \"String literal expected.\"),\n        Line_break_not_permitted_here: diag(1142, ts.DiagnosticCategory.Error, \"Line_break_not_permitted_here_1142\", \"Line break not permitted here.\"),\n        or_expected: diag(1144, ts.DiagnosticCategory.Error, \"or_expected_1144\", \"'{' or ';' expected.\"),\n        Declaration_expected: diag(1146, ts.DiagnosticCategory.Error, \"Declaration_expected_1146\", \"Declaration expected.\"),\n        Import_declarations_in_a_namespace_cannot_reference_a_module: diag(1147, ts.DiagnosticCategory.Error, \"Import_declarations_in_a_namespace_cannot_reference_a_module_1147\", \"Import declarations in a namespace cannot reference a module.\"),\n        Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: diag(1148, ts.DiagnosticCategory.Error, \"Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148\", \"Cannot use imports, exports, or module augmentations when '--module' is 'none'.\"),\n        File_name_0_differs_from_already_included_file_name_1_only_in_casing: diag(1149, ts.DiagnosticCategory.Error, \"File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149\", \"File name '{0}' differs from already included file name '{1}' only in casing.\"),\n        const_declarations_must_be_initialized: diag(1155, ts.DiagnosticCategory.Error, \"const_declarations_must_be_initialized_1155\", \"'const' declarations must be initialized.\"),\n        const_declarations_can_only_be_declared_inside_a_block: diag(1156, ts.DiagnosticCategory.Error, \"const_declarations_can_only_be_declared_inside_a_block_1156\", \"'const' declarations can only be declared inside a block.\"),\n        let_declarations_can_only_be_declared_inside_a_block: diag(1157, ts.DiagnosticCategory.Error, \"let_declarations_can_only_be_declared_inside_a_block_1157\", \"'let' declarations can only be declared inside a block.\"),\n        Unterminated_template_literal: diag(1160, ts.DiagnosticCategory.Error, \"Unterminated_template_literal_1160\", \"Unterminated template literal.\"),\n        Unterminated_regular_expression_literal: diag(1161, ts.DiagnosticCategory.Error, \"Unterminated_regular_expression_literal_1161\", \"Unterminated regular expression literal.\"),\n        An_object_member_cannot_be_declared_optional: diag(1162, ts.DiagnosticCategory.Error, \"An_object_member_cannot_be_declared_optional_1162\", \"An object member cannot be declared optional.\"),\n        A_yield_expression_is_only_allowed_in_a_generator_body: diag(1163, ts.DiagnosticCategory.Error, \"A_yield_expression_is_only_allowed_in_a_generator_body_1163\", \"A 'yield' expression is only allowed in a generator body.\"),\n        Computed_property_names_are_not_allowed_in_enums: diag(1164, ts.DiagnosticCategory.Error, \"Computed_property_names_are_not_allowed_in_enums_1164\", \"Computed property names are not allowed in enums.\"),\n        A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1165, ts.DiagnosticCategory.Error, \"A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165\", \"A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.\"),\n        A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1166, ts.DiagnosticCategory.Error, \"A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166\", \"A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.\"),\n        A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1168, ts.DiagnosticCategory.Error, \"A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168\", \"A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type.\"),\n        A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1169, ts.DiagnosticCategory.Error, \"A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169\", \"A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.\"),\n        A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1170, ts.DiagnosticCategory.Error, \"A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170\", \"A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.\"),\n        A_comma_expression_is_not_allowed_in_a_computed_property_name: diag(1171, ts.DiagnosticCategory.Error, \"A_comma_expression_is_not_allowed_in_a_computed_property_name_1171\", \"A comma expression is not allowed in a computed property name.\"),\n        extends_clause_already_seen: diag(1172, ts.DiagnosticCategory.Error, \"extends_clause_already_seen_1172\", \"'extends' clause already seen.\"),\n        extends_clause_must_precede_implements_clause: diag(1173, ts.DiagnosticCategory.Error, \"extends_clause_must_precede_implements_clause_1173\", \"'extends' clause must precede 'implements' clause.\"),\n        Classes_can_only_extend_a_single_class: diag(1174, ts.DiagnosticCategory.Error, \"Classes_can_only_extend_a_single_class_1174\", \"Classes can only extend a single class.\"),\n        implements_clause_already_seen: diag(1175, ts.DiagnosticCategory.Error, \"implements_clause_already_seen_1175\", \"'implements' clause already seen.\"),\n        Interface_declaration_cannot_have_implements_clause: diag(1176, ts.DiagnosticCategory.Error, \"Interface_declaration_cannot_have_implements_clause_1176\", \"Interface declaration cannot have 'implements' clause.\"),\n        Binary_digit_expected: diag(1177, ts.DiagnosticCategory.Error, \"Binary_digit_expected_1177\", \"Binary digit expected.\"),\n        Octal_digit_expected: diag(1178, ts.DiagnosticCategory.Error, \"Octal_digit_expected_1178\", \"Octal digit expected.\"),\n        Unexpected_token_expected: diag(1179, ts.DiagnosticCategory.Error, \"Unexpected_token_expected_1179\", \"Unexpected token. '{' expected.\"),\n        Property_destructuring_pattern_expected: diag(1180, ts.DiagnosticCategory.Error, \"Property_destructuring_pattern_expected_1180\", \"Property destructuring pattern expected.\"),\n        Array_element_destructuring_pattern_expected: diag(1181, ts.DiagnosticCategory.Error, \"Array_element_destructuring_pattern_expected_1181\", \"Array element destructuring pattern expected.\"),\n        A_destructuring_declaration_must_have_an_initializer: diag(1182, ts.DiagnosticCategory.Error, \"A_destructuring_declaration_must_have_an_initializer_1182\", \"A destructuring declaration must have an initializer.\"),\n        An_implementation_cannot_be_declared_in_ambient_contexts: diag(1183, ts.DiagnosticCategory.Error, \"An_implementation_cannot_be_declared_in_ambient_contexts_1183\", \"An implementation cannot be declared in ambient contexts.\"),\n        Modifiers_cannot_appear_here: diag(1184, ts.DiagnosticCategory.Error, \"Modifiers_cannot_appear_here_1184\", \"Modifiers cannot appear here.\"),\n        Merge_conflict_marker_encountered: diag(1185, ts.DiagnosticCategory.Error, \"Merge_conflict_marker_encountered_1185\", \"Merge conflict marker encountered.\"),\n        A_rest_element_cannot_have_an_initializer: diag(1186, ts.DiagnosticCategory.Error, \"A_rest_element_cannot_have_an_initializer_1186\", \"A rest element cannot have an initializer.\"),\n        A_parameter_property_may_not_be_declared_using_a_binding_pattern: diag(1187, ts.DiagnosticCategory.Error, \"A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187\", \"A parameter property may not be declared using a binding pattern.\"),\n        Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: diag(1188, ts.DiagnosticCategory.Error, \"Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188\", \"Only a single variable declaration is allowed in a 'for...of' statement.\"),\n        The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: diag(1189, ts.DiagnosticCategory.Error, \"The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189\", \"The variable declaration of a 'for...in' statement cannot have an initializer.\"),\n        The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: diag(1190, ts.DiagnosticCategory.Error, \"The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190\", \"The variable declaration of a 'for...of' statement cannot have an initializer.\"),\n        An_import_declaration_cannot_have_modifiers: diag(1191, ts.DiagnosticCategory.Error, \"An_import_declaration_cannot_have_modifiers_1191\", \"An import declaration cannot have modifiers.\"),\n        Module_0_has_no_default_export: diag(1192, ts.DiagnosticCategory.Error, \"Module_0_has_no_default_export_1192\", \"Module '{0}' has no default export.\"),\n        An_export_declaration_cannot_have_modifiers: diag(1193, ts.DiagnosticCategory.Error, \"An_export_declaration_cannot_have_modifiers_1193\", \"An export declaration cannot have modifiers.\"),\n        Export_declarations_are_not_permitted_in_a_namespace: diag(1194, ts.DiagnosticCategory.Error, \"Export_declarations_are_not_permitted_in_a_namespace_1194\", \"Export declarations are not permitted in a namespace.\"),\n        export_Asterisk_does_not_re_export_a_default: diag(1195, ts.DiagnosticCategory.Error, \"export_Asterisk_does_not_re_export_a_default_1195\", \"'export *' does not re-export a default.\"),\n        Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified: diag(1196, ts.DiagnosticCategory.Error, \"Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196\", \"Catch clause variable type annotation must be 'any' or 'unknown' if specified.\"),\n        Catch_clause_variable_cannot_have_an_initializer: diag(1197, ts.DiagnosticCategory.Error, \"Catch_clause_variable_cannot_have_an_initializer_1197\", \"Catch clause variable cannot have an initializer.\"),\n        An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: diag(1198, ts.DiagnosticCategory.Error, \"An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198\", \"An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.\"),\n        Unterminated_Unicode_escape_sequence: diag(1199, ts.DiagnosticCategory.Error, \"Unterminated_Unicode_escape_sequence_1199\", \"Unterminated Unicode escape sequence.\"),\n        Line_terminator_not_permitted_before_arrow: diag(1200, ts.DiagnosticCategory.Error, \"Line_terminator_not_permitted_before_arrow_1200\", \"Line terminator not permitted before arrow.\"),\n        Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(1202, ts.DiagnosticCategory.Error, \"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202\", \"Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from \\\"mod\\\"', 'import {a} from \\\"mod\\\"', 'import d from \\\"mod\\\"', or another module format instead.\"),\n        Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead: diag(1203, ts.DiagnosticCategory.Error, \"Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203\", \"Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.\"),\n        Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type: diag(1205, ts.DiagnosticCategory.Error, \"Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205\", \"Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.\"),\n        Decorators_are_not_valid_here: diag(1206, ts.DiagnosticCategory.Error, \"Decorators_are_not_valid_here_1206\", \"Decorators are not valid here.\"),\n        Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, ts.DiagnosticCategory.Error, \"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207\", \"Decorators cannot be applied to multiple get/set accessors of the same name.\"),\n        _0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module: diag(1208, ts.DiagnosticCategory.Error, \"_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208\", \"'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module.\"),\n        Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: diag(1210, ts.DiagnosticCategory.Error, \"Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210\", \"Invalid use of '{0}'. Class definitions are automatically in strict mode.\"),\n        A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, ts.DiagnosticCategory.Error, \"A_class_declaration_without_the_default_modifier_must_have_a_name_1211\", \"A class declaration without the 'default' modifier must have a name.\"),\n        Identifier_expected_0_is_a_reserved_word_in_strict_mode: diag(1212, ts.DiagnosticCategory.Error, \"Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212\", \"Identifier expected. '{0}' is a reserved word in strict mode.\"),\n        Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: diag(1213, ts.DiagnosticCategory.Error, \"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213\", \"Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode.\"),\n        Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: diag(1214, ts.DiagnosticCategory.Error, \"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214\", \"Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode.\"),\n        Invalid_use_of_0_Modules_are_automatically_in_strict_mode: diag(1215, ts.DiagnosticCategory.Error, \"Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215\", \"Invalid use of '{0}'. Modules are automatically in strict mode.\"),\n        Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: diag(1216, ts.DiagnosticCategory.Error, \"Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216\", \"Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules.\"),\n        Export_assignment_is_not_supported_when_module_flag_is_system: diag(1218, ts.DiagnosticCategory.Error, \"Export_assignment_is_not_supported_when_module_flag_is_system_1218\", \"Export assignment is not supported when '--module' flag is 'system'.\"),\n        Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning: diag(1219, ts.DiagnosticCategory.Error, \"Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219\", \"Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.\"),\n        Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher: diag(1220, ts.DiagnosticCategory.Error, \"Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher_1220\", \"Generators are only available when targeting ECMAScript 2015 or higher.\"),\n        Generators_are_not_allowed_in_an_ambient_context: diag(1221, ts.DiagnosticCategory.Error, \"Generators_are_not_allowed_in_an_ambient_context_1221\", \"Generators are not allowed in an ambient context.\"),\n        An_overload_signature_cannot_be_declared_as_a_generator: diag(1222, ts.DiagnosticCategory.Error, \"An_overload_signature_cannot_be_declared_as_a_generator_1222\", \"An overload signature cannot be declared as a generator.\"),\n        _0_tag_already_specified: diag(1223, ts.DiagnosticCategory.Error, \"_0_tag_already_specified_1223\", \"'{0}' tag already specified.\"),\n        Signature_0_must_be_a_type_predicate: diag(1224, ts.DiagnosticCategory.Error, \"Signature_0_must_be_a_type_predicate_1224\", \"Signature '{0}' must be a type predicate.\"),\n        Cannot_find_parameter_0: diag(1225, ts.DiagnosticCategory.Error, \"Cannot_find_parameter_0_1225\", \"Cannot find parameter '{0}'.\"),\n        Type_predicate_0_is_not_assignable_to_1: diag(1226, ts.DiagnosticCategory.Error, \"Type_predicate_0_is_not_assignable_to_1_1226\", \"Type predicate '{0}' is not assignable to '{1}'.\"),\n        Parameter_0_is_not_in_the_same_position_as_parameter_1: diag(1227, ts.DiagnosticCategory.Error, \"Parameter_0_is_not_in_the_same_position_as_parameter_1_1227\", \"Parameter '{0}' is not in the same position as parameter '{1}'.\"),\n        A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods: diag(1228, ts.DiagnosticCategory.Error, \"A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228\", \"A type predicate is only allowed in return type position for functions and methods.\"),\n        A_type_predicate_cannot_reference_a_rest_parameter: diag(1229, ts.DiagnosticCategory.Error, \"A_type_predicate_cannot_reference_a_rest_parameter_1229\", \"A type predicate cannot reference a rest parameter.\"),\n        A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: diag(1230, ts.DiagnosticCategory.Error, \"A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230\", \"A type predicate cannot reference element '{0}' in a binding pattern.\"),\n        An_export_assignment_can_only_be_used_in_a_module: diag(1231, ts.DiagnosticCategory.Error, \"An_export_assignment_can_only_be_used_in_a_module_1231\", \"An export assignment can only be used in a module.\"),\n        An_import_declaration_can_only_be_used_in_a_namespace_or_module: diag(1232, ts.DiagnosticCategory.Error, \"An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232\", \"An import declaration can only be used in a namespace or module.\"),\n        An_export_declaration_can_only_be_used_in_a_module: diag(1233, ts.DiagnosticCategory.Error, \"An_export_declaration_can_only_be_used_in_a_module_1233\", \"An export declaration can only be used in a module.\"),\n        An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file: diag(1234, ts.DiagnosticCategory.Error, \"An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234\", \"An ambient module declaration is only allowed at the top level in a file.\"),\n        A_namespace_declaration_is_only_allowed_in_a_namespace_or_module: diag(1235, ts.DiagnosticCategory.Error, \"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235\", \"A namespace declaration is only allowed in a namespace or module.\"),\n        The_return_type_of_a_property_decorator_function_must_be_either_void_or_any: diag(1236, ts.DiagnosticCategory.Error, \"The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236\", \"The return type of a property decorator function must be either 'void' or 'any'.\"),\n        The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any: diag(1237, ts.DiagnosticCategory.Error, \"The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237\", \"The return type of a parameter decorator function must be either 'void' or 'any'.\"),\n        Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression: diag(1238, ts.DiagnosticCategory.Error, \"Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238\", \"Unable to resolve signature of class decorator when called as an expression.\"),\n        Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression: diag(1239, ts.DiagnosticCategory.Error, \"Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239\", \"Unable to resolve signature of parameter decorator when called as an expression.\"),\n        Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression: diag(1240, ts.DiagnosticCategory.Error, \"Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240\", \"Unable to resolve signature of property decorator when called as an expression.\"),\n        Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression: diag(1241, ts.DiagnosticCategory.Error, \"Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241\", \"Unable to resolve signature of method decorator when called as an expression.\"),\n        abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration: diag(1242, ts.DiagnosticCategory.Error, \"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242\", \"'abstract' modifier can only appear on a class, method, or property declaration.\"),\n        _0_modifier_cannot_be_used_with_1_modifier: diag(1243, ts.DiagnosticCategory.Error, \"_0_modifier_cannot_be_used_with_1_modifier_1243\", \"'{0}' modifier cannot be used with '{1}' modifier.\"),\n        Abstract_methods_can_only_appear_within_an_abstract_class: diag(1244, ts.DiagnosticCategory.Error, \"Abstract_methods_can_only_appear_within_an_abstract_class_1244\", \"Abstract methods can only appear within an abstract class.\"),\n        Method_0_cannot_have_an_implementation_because_it_is_marked_abstract: diag(1245, ts.DiagnosticCategory.Error, \"Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245\", \"Method '{0}' cannot have an implementation because it is marked abstract.\"),\n        An_interface_property_cannot_have_an_initializer: diag(1246, ts.DiagnosticCategory.Error, \"An_interface_property_cannot_have_an_initializer_1246\", \"An interface property cannot have an initializer.\"),\n        A_type_literal_property_cannot_have_an_initializer: diag(1247, ts.DiagnosticCategory.Error, \"A_type_literal_property_cannot_have_an_initializer_1247\", \"A type literal property cannot have an initializer.\"),\n        A_class_member_cannot_have_the_0_keyword: diag(1248, ts.DiagnosticCategory.Error, \"A_class_member_cannot_have_the_0_keyword_1248\", \"A class member cannot have the '{0}' keyword.\"),\n        A_decorator_can_only_decorate_a_method_implementation_not_an_overload: diag(1249, ts.DiagnosticCategory.Error, \"A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249\", \"A decorator can only decorate a method implementation, not an overload.\"),\n        Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5: diag(1250, ts.DiagnosticCategory.Error, \"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250\", \"Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.\"),\n        Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode: diag(1251, ts.DiagnosticCategory.Error, \"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251\", \"Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode.\"),\n        Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode: diag(1252, ts.DiagnosticCategory.Error, \"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252\", \"Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode.\"),\n        _0_tag_cannot_be_used_independently_as_a_top_level_JSDoc_tag: diag(1253, ts.DiagnosticCategory.Error, \"_0_tag_cannot_be_used_independently_as_a_top_level_JSDoc_tag_1253\", \"'{0}' tag cannot be used independently as a top level JSDoc tag.\"),\n        A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference: diag(1254, ts.DiagnosticCategory.Error, \"A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254\", \"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.\"),\n        A_definite_assignment_assertion_is_not_permitted_in_this_context: diag(1255, ts.DiagnosticCategory.Error, \"A_definite_assignment_assertion_is_not_permitted_in_this_context_1255\", \"A definite assignment assertion '!' is not permitted in this context.\"),\n        A_required_element_cannot_follow_an_optional_element: diag(1257, ts.DiagnosticCategory.Error, \"A_required_element_cannot_follow_an_optional_element_1257\", \"A required element cannot follow an optional element.\"),\n        Module_0_can_only_be_default_imported_using_the_1_flag: diag(1259, ts.DiagnosticCategory.Error, \"Module_0_can_only_be_default_imported_using_the_1_flag_1259\", \"Module '{0}' can only be default-imported using the '{1}' flag\"),\n        Keywords_cannot_contain_escape_characters: diag(1260, ts.DiagnosticCategory.Error, \"Keywords_cannot_contain_escape_characters_1260\", \"Keywords cannot contain escape characters.\"),\n        Already_included_file_name_0_differs_from_file_name_1_only_in_casing: diag(1261, ts.DiagnosticCategory.Error, \"Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261\", \"Already included file name '{0}' differs from file name '{1}' only in casing.\"),\n        Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module: diag(1262, ts.DiagnosticCategory.Error, \"Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262\", \"Identifier expected. '{0}' is a reserved word at the top-level of a module.\"),\n        Declarations_with_initializers_cannot_also_have_definite_assignment_assertions: diag(1263, ts.DiagnosticCategory.Error, \"Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263\", \"Declarations with initializers cannot also have definite assignment assertions.\"),\n        Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: diag(1264, ts.DiagnosticCategory.Error, \"Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264\", \"Declarations with definite assignment assertions must also have type annotations.\"),\n        A_rest_element_cannot_follow_another_rest_element: diag(1265, ts.DiagnosticCategory.Error, \"A_rest_element_cannot_follow_another_rest_element_1265\", \"A rest element cannot follow another rest element.\"),\n        An_optional_element_cannot_follow_a_rest_element: diag(1266, ts.DiagnosticCategory.Error, \"An_optional_element_cannot_follow_a_rest_element_1266\", \"An optional element cannot follow a rest element.\"),\n        with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, \"with_statements_are_not_allowed_in_an_async_function_block_1300\", \"'with' statements are not allowed in an async function block.\"),\n        await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, \"await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308\", \"'await' expressions are only allowed within async functions and at the top levels of modules.\"),\n        Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, \"Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312\", \"Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern.\"),\n        The_body_of_an_if_statement_cannot_be_the_empty_statement: diag(1313, ts.DiagnosticCategory.Error, \"The_body_of_an_if_statement_cannot_be_the_empty_statement_1313\", \"The body of an 'if' statement cannot be the empty statement.\"),\n        Global_module_exports_may_only_appear_in_module_files: diag(1314, ts.DiagnosticCategory.Error, \"Global_module_exports_may_only_appear_in_module_files_1314\", \"Global module exports may only appear in module files.\"),\n        Global_module_exports_may_only_appear_in_declaration_files: diag(1315, ts.DiagnosticCategory.Error, \"Global_module_exports_may_only_appear_in_declaration_files_1315\", \"Global module exports may only appear in declaration files.\"),\n        Global_module_exports_may_only_appear_at_top_level: diag(1316, ts.DiagnosticCategory.Error, \"Global_module_exports_may_only_appear_at_top_level_1316\", \"Global module exports may only appear at top level.\"),\n        A_parameter_property_cannot_be_declared_using_a_rest_parameter: diag(1317, ts.DiagnosticCategory.Error, \"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317\", \"A parameter property cannot be declared using a rest parameter.\"),\n        An_abstract_accessor_cannot_have_an_implementation: diag(1318, ts.DiagnosticCategory.Error, \"An_abstract_accessor_cannot_have_an_implementation_1318\", \"An abstract accessor cannot have an implementation.\"),\n        A_default_export_can_only_be_used_in_an_ECMAScript_style_module: diag(1319, ts.DiagnosticCategory.Error, \"A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319\", \"A default export can only be used in an ECMAScript-style module.\"),\n        Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, ts.DiagnosticCategory.Error, \"Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320\", \"Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member.\"),\n        Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, ts.DiagnosticCategory.Error, \"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321\", \"Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member.\"),\n        Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1322, ts.DiagnosticCategory.Error, \"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322\", \"Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member.\"),\n        Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_or_umd: diag(1323, ts.DiagnosticCategory.Error, \"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323\", \"Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'esnext', 'commonjs', 'amd', 'system', or 'umd'.\"),\n        Dynamic_import_must_have_one_specifier_as_an_argument: diag(1324, ts.DiagnosticCategory.Error, \"Dynamic_import_must_have_one_specifier_as_an_argument_1324\", \"Dynamic import must have one specifier as an argument.\"),\n        Specifier_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, \"Specifier_of_dynamic_import_cannot_be_spread_element_1325\", \"Specifier of dynamic import cannot be spread element.\"),\n        Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, \"Dynamic_import_cannot_have_type_arguments_1326\", \"Dynamic import cannot have type arguments.\"),\n        String_literal_with_double_quotes_expected: diag(1327, ts.DiagnosticCategory.Error, \"String_literal_with_double_quotes_expected_1327\", \"String literal with double quotes expected.\"),\n        Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal: diag(1328, ts.DiagnosticCategory.Error, \"Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328\", \"Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.\"),\n        _0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0: diag(1329, ts.DiagnosticCategory.Error, \"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329\", \"'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?\"),\n        A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly: diag(1330, ts.DiagnosticCategory.Error, \"A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330\", \"A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'.\"),\n        A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly: diag(1331, ts.DiagnosticCategory.Error, \"A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331\", \"A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'.\"),\n        A_variable_whose_type_is_a_unique_symbol_type_must_be_const: diag(1332, ts.DiagnosticCategory.Error, \"A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332\", \"A variable whose type is a 'unique symbol' type must be 'const'.\"),\n        unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name: diag(1333, ts.DiagnosticCategory.Error, \"unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333\", \"'unique symbol' types may not be used on a variable declaration with a binding name.\"),\n        unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement: diag(1334, ts.DiagnosticCategory.Error, \"unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334\", \"'unique symbol' types are only allowed on variables in a variable statement.\"),\n        unique_symbol_types_are_not_allowed_here: diag(1335, ts.DiagnosticCategory.Error, \"unique_symbol_types_are_not_allowed_here_1335\", \"'unique symbol' types are not allowed here.\"),\n        An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead: diag(1336, ts.DiagnosticCategory.Error, \"An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336\", \"An index signature parameter type cannot be a type alias. Consider writing '[{0}: {1}]: {2}' instead.\"),\n        An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead: diag(1337, ts.DiagnosticCategory.Error, \"An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337\", \"An index signature parameter type cannot be a union type. Consider using a mapped object type instead.\"),\n        infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: diag(1338, ts.DiagnosticCategory.Error, \"infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338\", \"'infer' declarations are only permitted in the 'extends' clause of a conditional type.\"),\n        Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, ts.DiagnosticCategory.Error, \"Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339\", \"Module '{0}' does not refer to a value, but is used as a value here.\"),\n        Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, ts.DiagnosticCategory.Error, \"Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340\", \"Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?\"),\n        Type_arguments_cannot_be_used_here: diag(1342, ts.DiagnosticCategory.Error, \"Type_arguments_cannot_be_used_here_1342\", \"Type arguments cannot be used here.\"),\n        The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system: diag(1343, ts.DiagnosticCategory.Error, \"The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system_1343\", \"The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.\"),\n        A_label_is_not_allowed_here: diag(1344, ts.DiagnosticCategory.Error, \"A_label_is_not_allowed_here_1344\", \"'A label is not allowed here.\"),\n        An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, \"An_expression_of_type_void_cannot_be_tested_for_truthiness_1345\", \"An expression of type 'void' cannot be tested for truthiness.\"),\n        This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, ts.DiagnosticCategory.Error, \"This_parameter_is_not_allowed_with_use_strict_directive_1346\", \"This parameter is not allowed with 'use strict' directive.\"),\n        use_strict_directive_cannot_be_used_with_non_simple_parameter_list: diag(1347, ts.DiagnosticCategory.Error, \"use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347\", \"'use strict' directive cannot be used with non-simple parameter list.\"),\n        Non_simple_parameter_declared_here: diag(1348, ts.DiagnosticCategory.Error, \"Non_simple_parameter_declared_here_1348\", \"Non-simple parameter declared here.\"),\n        use_strict_directive_used_here: diag(1349, ts.DiagnosticCategory.Error, \"use_strict_directive_used_here_1349\", \"'use strict' directive used here.\"),\n        Print_the_final_configuration_instead_of_building: diag(1350, ts.DiagnosticCategory.Message, \"Print_the_final_configuration_instead_of_building_1350\", \"Print the final configuration instead of building.\"),\n        An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal: diag(1351, ts.DiagnosticCategory.Error, \"An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351\", \"An identifier or keyword cannot immediately follow a numeric literal.\"),\n        A_bigint_literal_cannot_use_exponential_notation: diag(1352, ts.DiagnosticCategory.Error, \"A_bigint_literal_cannot_use_exponential_notation_1352\", \"A bigint literal cannot use exponential notation.\"),\n        A_bigint_literal_must_be_an_integer: diag(1353, ts.DiagnosticCategory.Error, \"A_bigint_literal_must_be_an_integer_1353\", \"A bigint literal must be an integer.\"),\n        readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types: diag(1354, ts.DiagnosticCategory.Error, \"readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354\", \"'readonly' type modifier is only permitted on array and tuple literal types.\"),\n        A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals: diag(1355, ts.DiagnosticCategory.Error, \"A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355\", \"A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals.\"),\n        Did_you_mean_to_mark_this_function_as_async: diag(1356, ts.DiagnosticCategory.Error, \"Did_you_mean_to_mark_this_function_as_async_1356\", \"Did you mean to mark this function as 'async'?\"),\n        An_enum_member_name_must_be_followed_by_a_or: diag(1357, ts.DiagnosticCategory.Error, \"An_enum_member_name_must_be_followed_by_a_or_1357\", \"An enum member name must be followed by a ',', '=', or '}'.\"),\n        Tagged_template_expressions_are_not_permitted_in_an_optional_chain: diag(1358, ts.DiagnosticCategory.Error, \"Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358\", \"Tagged template expressions are not permitted in an optional chain.\"),\n        Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here: diag(1359, ts.DiagnosticCategory.Error, \"Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359\", \"Identifier expected. '{0}' is a reserved word that cannot be used here.\"),\n        Did_you_mean_to_parenthesize_this_function_type: diag(1360, ts.DiagnosticCategory.Error, \"Did_you_mean_to_parenthesize_this_function_type_1360\", \"Did you mean to parenthesize this function type?\"),\n        _0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type: diag(1361, ts.DiagnosticCategory.Error, \"_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361\", \"'{0}' cannot be used as a value because it was imported using 'import type'.\"),\n        _0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type: diag(1362, ts.DiagnosticCategory.Error, \"_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362\", \"'{0}' cannot be used as a value because it was exported using 'export type'.\"),\n        A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both: diag(1363, ts.DiagnosticCategory.Error, \"A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363\", \"A type-only import can specify a default import or named bindings, but not both.\"),\n        Convert_to_type_only_export: diag(1364, ts.DiagnosticCategory.Message, \"Convert_to_type_only_export_1364\", \"Convert to type-only export\"),\n        Convert_all_re_exported_types_to_type_only_exports: diag(1365, ts.DiagnosticCategory.Message, \"Convert_all_re_exported_types_to_type_only_exports_1365\", \"Convert all re-exported types to type-only exports\"),\n        Split_into_two_separate_import_declarations: diag(1366, ts.DiagnosticCategory.Message, \"Split_into_two_separate_import_declarations_1366\", \"Split into two separate import declarations\"),\n        Split_all_invalid_type_only_imports: diag(1367, ts.DiagnosticCategory.Message, \"Split_all_invalid_type_only_imports_1367\", \"Split all invalid type-only imports\"),\n        Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(1368, ts.DiagnosticCategory.Message, \"Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_1368\", \"Specify emit/checking behavior for imports that are only used for types\"),\n        Did_you_mean_0: diag(1369, ts.DiagnosticCategory.Message, \"Did_you_mean_0_1369\", \"Did you mean '{0}'?\"),\n        This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error: diag(1371, ts.DiagnosticCategory.Error, \"This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set__1371\", \"This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.\"),\n        Convert_to_type_only_import: diag(1373, ts.DiagnosticCategory.Message, \"Convert_to_type_only_import_1373\", \"Convert to type-only import\"),\n        Convert_all_imports_not_used_as_a_value_to_type_only_imports: diag(1374, ts.DiagnosticCategory.Message, \"Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374\", \"Convert all imports not used as a value to type-only imports\"),\n        await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1375, ts.DiagnosticCategory.Error, \"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375\", \"'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.\"),\n        _0_was_imported_here: diag(1376, ts.DiagnosticCategory.Message, \"_0_was_imported_here_1376\", \"'{0}' was imported here.\"),\n        _0_was_exported_here: diag(1377, ts.DiagnosticCategory.Message, \"_0_was_exported_here_1377\", \"'{0}' was exported here.\"),\n        Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_esnext_or_system_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, ts.DiagnosticCategory.Error, \"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_esnext_or_system_and_t_1378\", \"Top-level 'await' expressions are only allowed when the 'module' option is set to 'esnext' or 'system', and the 'target' option is set to 'es2017' or higher.\"),\n        An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, ts.DiagnosticCategory.Error, \"An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379\", \"An import alias cannot reference a declaration that was exported using 'export type'.\"),\n        An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, ts.DiagnosticCategory.Error, \"An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380\", \"An import alias cannot reference a declaration that was imported using 'import type'.\"),\n        Unexpected_token_Did_you_mean_or_rbrace: diag(1381, ts.DiagnosticCategory.Error, \"Unexpected_token_Did_you_mean_or_rbrace_1381\", \"Unexpected token. Did you mean `{'}'}` or `&rbrace;`?\"),\n        Unexpected_token_Did_you_mean_or_gt: diag(1382, ts.DiagnosticCategory.Error, \"Unexpected_token_Did_you_mean_or_gt_1382\", \"Unexpected token. Did you mean `{'>'}` or `&gt;`?\"),\n        Only_named_exports_may_use_export_type: diag(1383, ts.DiagnosticCategory.Error, \"Only_named_exports_may_use_export_type_1383\", \"Only named exports may use 'export type'.\"),\n        A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list: diag(1384, ts.DiagnosticCategory.Error, \"A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384\", \"A 'new' expression with type arguments must always be followed by a parenthesized argument list.\"),\n        Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1385, ts.DiagnosticCategory.Error, \"Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385\", \"Function type notation must be parenthesized when used in a union type.\"),\n        Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, ts.DiagnosticCategory.Error, \"Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386\", \"Constructor type notation must be parenthesized when used in a union type.\"),\n        Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, ts.DiagnosticCategory.Error, \"Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387\", \"Function type notation must be parenthesized when used in an intersection type.\"),\n        Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1388, ts.DiagnosticCategory.Error, \"Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388\", \"Constructor type notation must be parenthesized when used in an intersection type.\"),\n        _0_is_not_allowed_as_a_variable_declaration_name: diag(1389, ts.DiagnosticCategory.Error, \"_0_is_not_allowed_as_a_variable_declaration_name_1389\", \"'{0}' is not allowed as a variable declaration name.\"),\n        Provides_a_root_package_name_when_using_outFile_with_declarations: diag(1390, ts.DiagnosticCategory.Message, \"Provides_a_root_package_name_when_using_outFile_with_declarations_1390\", \"Provides a root package name when using outFile with declarations.\"),\n        The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_declaration_emit: diag(1391, ts.DiagnosticCategory.Error, \"The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391\", \"The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit.\"),\n        An_import_alias_cannot_use_import_type: diag(1392, ts.DiagnosticCategory.Error, \"An_import_alias_cannot_use_import_type_1392\", \"An import alias cannot use 'import type'\"),\n        Imported_via_0_from_file_1: diag(1393, ts.DiagnosticCategory.Message, \"Imported_via_0_from_file_1_1393\", \"Imported via {0} from file '{1}'\"),\n        Imported_via_0_from_file_1_with_packageId_2: diag(1394, ts.DiagnosticCategory.Message, \"Imported_via_0_from_file_1_with_packageId_2_1394\", \"Imported via {0} from file '{1}' with packageId '{2}'\"),\n        Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions: diag(1395, ts.DiagnosticCategory.Message, \"Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395\", \"Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions\"),\n        Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions: diag(1396, ts.DiagnosticCategory.Message, \"Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396\", \"Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions\"),\n        Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions: diag(1397, ts.DiagnosticCategory.Message, \"Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397\", \"Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions\"),\n        Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions: diag(1398, ts.DiagnosticCategory.Message, \"Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398\", \"Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions\"),\n        File_is_included_via_import_here: diag(1399, ts.DiagnosticCategory.Message, \"File_is_included_via_import_here_1399\", \"File is included via import here.\"),\n        Referenced_via_0_from_file_1: diag(1400, ts.DiagnosticCategory.Message, \"Referenced_via_0_from_file_1_1400\", \"Referenced via '{0}' from file '{1}'\"),\n        File_is_included_via_reference_here: diag(1401, ts.DiagnosticCategory.Message, \"File_is_included_via_reference_here_1401\", \"File is included via reference here.\"),\n        Type_library_referenced_via_0_from_file_1: diag(1402, ts.DiagnosticCategory.Message, \"Type_library_referenced_via_0_from_file_1_1402\", \"Type library referenced via '{0}' from file '{1}'\"),\n        Type_library_referenced_via_0_from_file_1_with_packageId_2: diag(1403, ts.DiagnosticCategory.Message, \"Type_library_referenced_via_0_from_file_1_with_packageId_2_1403\", \"Type library referenced via '{0}' from file '{1}' with packageId '{2}'\"),\n        File_is_included_via_type_library_reference_here: diag(1404, ts.DiagnosticCategory.Message, \"File_is_included_via_type_library_reference_here_1404\", \"File is included via type library reference here.\"),\n        Library_referenced_via_0_from_file_1: diag(1405, ts.DiagnosticCategory.Message, \"Library_referenced_via_0_from_file_1_1405\", \"Library referenced via '{0}' from file '{1}'\"),\n        File_is_included_via_library_reference_here: diag(1406, ts.DiagnosticCategory.Message, \"File_is_included_via_library_reference_here_1406\", \"File is included via library reference here.\"),\n        Matched_by_include_pattern_0_in_1: diag(1407, ts.DiagnosticCategory.Message, \"Matched_by_include_pattern_0_in_1_1407\", \"Matched by include pattern '{0}' in '{1}'\"),\n        File_is_matched_by_include_pattern_specified_here: diag(1408, ts.DiagnosticCategory.Message, \"File_is_matched_by_include_pattern_specified_here_1408\", \"File is matched by include pattern specified here.\"),\n        Part_of_files_list_in_tsconfig_json: diag(1409, ts.DiagnosticCategory.Message, \"Part_of_files_list_in_tsconfig_json_1409\", \"Part of 'files' list in tsconfig.json\"),\n        File_is_matched_by_files_list_specified_here: diag(1410, ts.DiagnosticCategory.Message, \"File_is_matched_by_files_list_specified_here_1410\", \"File is matched by 'files' list specified here.\"),\n        Output_from_referenced_project_0_included_because_1_specified: diag(1411, ts.DiagnosticCategory.Message, \"Output_from_referenced_project_0_included_because_1_specified_1411\", \"Output from referenced project '{0}' included because '{1}' specified\"),\n        Output_from_referenced_project_0_included_because_module_is_specified_as_none: diag(1412, ts.DiagnosticCategory.Message, \"Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412\", \"Output from referenced project '{0}' included because '--module' is specified as 'none'\"),\n        File_is_output_from_referenced_project_specified_here: diag(1413, ts.DiagnosticCategory.Message, \"File_is_output_from_referenced_project_specified_here_1413\", \"File is output from referenced project specified here.\"),\n        Source_from_referenced_project_0_included_because_1_specified: diag(1414, ts.DiagnosticCategory.Message, \"Source_from_referenced_project_0_included_because_1_specified_1414\", \"Source from referenced project '{0}' included because '{1}' specified\"),\n        Source_from_referenced_project_0_included_because_module_is_specified_as_none: diag(1415, ts.DiagnosticCategory.Message, \"Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415\", \"Source from referenced project '{0}' included because '--module' is specified as 'none'\"),\n        File_is_source_from_referenced_project_specified_here: diag(1416, ts.DiagnosticCategory.Message, \"File_is_source_from_referenced_project_specified_here_1416\", \"File is source from referenced project specified here.\"),\n        Entry_point_of_type_library_0_specified_in_compilerOptions: diag(1417, ts.DiagnosticCategory.Message, \"Entry_point_of_type_library_0_specified_in_compilerOptions_1417\", \"Entry point of type library '{0}' specified in compilerOptions\"),\n        Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1: diag(1418, ts.DiagnosticCategory.Message, \"Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418\", \"Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'\"),\n        File_is_entry_point_of_type_library_specified_here: diag(1419, ts.DiagnosticCategory.Message, \"File_is_entry_point_of_type_library_specified_here_1419\", \"File is entry point of type library specified here.\"),\n        Entry_point_for_implicit_type_library_0: diag(1420, ts.DiagnosticCategory.Message, \"Entry_point_for_implicit_type_library_0_1420\", \"Entry point for implicit type library '{0}'\"),\n        Entry_point_for_implicit_type_library_0_with_packageId_1: diag(1421, ts.DiagnosticCategory.Message, \"Entry_point_for_implicit_type_library_0_with_packageId_1_1421\", \"Entry point for implicit type library '{0}' with packageId '{1}'\"),\n        Library_0_specified_in_compilerOptions: diag(1422, ts.DiagnosticCategory.Message, \"Library_0_specified_in_compilerOptions_1422\", \"Library '{0}' specified in compilerOptions\"),\n        File_is_library_specified_here: diag(1423, ts.DiagnosticCategory.Message, \"File_is_library_specified_here_1423\", \"File is library specified here.\"),\n        Default_library: diag(1424, ts.DiagnosticCategory.Message, \"Default_library_1424\", \"Default library\"),\n        Default_library_for_target_0: diag(1425, ts.DiagnosticCategory.Message, \"Default_library_for_target_0_1425\", \"Default library for target '{0}'\"),\n        File_is_default_library_for_target_specified_here: diag(1426, ts.DiagnosticCategory.Message, \"File_is_default_library_for_target_specified_here_1426\", \"File is default library for target specified here.\"),\n        Root_file_specified_for_compilation: diag(1427, ts.DiagnosticCategory.Message, \"Root_file_specified_for_compilation_1427\", \"Root file specified for compilation\"),\n        File_is_output_of_project_reference_source_0: diag(1428, ts.DiagnosticCategory.Message, \"File_is_output_of_project_reference_source_0_1428\", \"File is output of project reference source '{0}'\"),\n        File_redirects_to_file_0: diag(1429, ts.DiagnosticCategory.Message, \"File_redirects_to_file_0_1429\", \"File redirects to file '{0}'\"),\n        The_file_is_in_the_program_because_Colon: diag(1430, ts.DiagnosticCategory.Message, \"The_file_is_in_the_program_because_Colon_1430\", \"The file is in the program because:\"),\n        for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, ts.DiagnosticCategory.Error, \"for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431\", \"'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.\"),\n        Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_esnext_or_system_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, ts.DiagnosticCategory.Error, \"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_esnext_or_system_and_the_1432\", \"Top-level 'for await' loops are only allowed when the 'module' option is set to 'esnext' or 'system', and the 'target' option is set to 'es2017' or higher.\"),\n        The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, \"The_types_of_0_are_incompatible_between_these_types_2200\", \"The types of '{0}' are incompatible between these types.\"),\n        The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, \"The_types_returned_by_0_are_incompatible_between_these_types_2201\", \"The types returned by '{0}' are incompatible between these types.\"),\n        Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, \"Call_signature_return_types_0_and_1_are_incompatible_2202\", \"Call signature return types '{0}' and '{1}' are incompatible.\", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),\n        Construct_signature_return_types_0_and_1_are_incompatible: diag(2203, ts.DiagnosticCategory.Error, \"Construct_signature_return_types_0_and_1_are_incompatible_2203\", \"Construct signature return types '{0}' and '{1}' are incompatible.\", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),\n        Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2204, ts.DiagnosticCategory.Error, \"Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204\", \"Call signatures with no arguments have incompatible return types '{0}' and '{1}'.\", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),\n        Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2205, ts.DiagnosticCategory.Error, \"Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205\", \"Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.\", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),\n        Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, \"Duplicate_identifier_0_2300\", \"Duplicate identifier '{0}'.\"),\n        Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, \"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301\", \"Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.\"),\n        Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, \"Static_members_cannot_reference_class_type_parameters_2302\", \"Static members cannot reference class type parameters.\"),\n        Circular_definition_of_import_alias_0: diag(2303, ts.DiagnosticCategory.Error, \"Circular_definition_of_import_alias_0_2303\", \"Circular definition of import alias '{0}'.\"),\n        Cannot_find_name_0: diag(2304, ts.DiagnosticCategory.Error, \"Cannot_find_name_0_2304\", \"Cannot find name '{0}'.\"),\n        Module_0_has_no_exported_member_1: diag(2305, ts.DiagnosticCategory.Error, \"Module_0_has_no_exported_member_1_2305\", \"Module '{0}' has no exported member '{1}'.\"),\n        File_0_is_not_a_module: diag(2306, ts.DiagnosticCategory.Error, \"File_0_is_not_a_module_2306\", \"File '{0}' is not a module.\"),\n        Cannot_find_module_0_or_its_corresponding_type_declarations: diag(2307, ts.DiagnosticCategory.Error, \"Cannot_find_module_0_or_its_corresponding_type_declarations_2307\", \"Cannot find module '{0}' or its corresponding type declarations.\"),\n        Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: diag(2308, ts.DiagnosticCategory.Error, \"Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308\", \"Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity.\"),\n        An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, ts.DiagnosticCategory.Error, \"An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309\", \"An export assignment cannot be used in a module with other exported elements.\"),\n        Type_0_recursively_references_itself_as_a_base_type: diag(2310, ts.DiagnosticCategory.Error, \"Type_0_recursively_references_itself_as_a_base_type_2310\", \"Type '{0}' recursively references itself as a base type.\"),\n        A_class_may_only_extend_another_class: diag(2311, ts.DiagnosticCategory.Error, \"A_class_may_only_extend_another_class_2311\", \"A class may only extend another class.\"),\n        An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2312, ts.DiagnosticCategory.Error, \"An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312\", \"An interface can only extend an object type or intersection of object types with statically known members.\"),\n        Type_parameter_0_has_a_circular_constraint: diag(2313, ts.DiagnosticCategory.Error, \"Type_parameter_0_has_a_circular_constraint_2313\", \"Type parameter '{0}' has a circular constraint.\"),\n        Generic_type_0_requires_1_type_argument_s: diag(2314, ts.DiagnosticCategory.Error, \"Generic_type_0_requires_1_type_argument_s_2314\", \"Generic type '{0}' requires {1} type argument(s).\"),\n        Type_0_is_not_generic: diag(2315, ts.DiagnosticCategory.Error, \"Type_0_is_not_generic_2315\", \"Type '{0}' is not generic.\"),\n        Global_type_0_must_be_a_class_or_interface_type: diag(2316, ts.DiagnosticCategory.Error, \"Global_type_0_must_be_a_class_or_interface_type_2316\", \"Global type '{0}' must be a class or interface type.\"),\n        Global_type_0_must_have_1_type_parameter_s: diag(2317, ts.DiagnosticCategory.Error, \"Global_type_0_must_have_1_type_parameter_s_2317\", \"Global type '{0}' must have {1} type parameter(s).\"),\n        Cannot_find_global_type_0: diag(2318, ts.DiagnosticCategory.Error, \"Cannot_find_global_type_0_2318\", \"Cannot find global type '{0}'.\"),\n        Named_property_0_of_types_1_and_2_are_not_identical: diag(2319, ts.DiagnosticCategory.Error, \"Named_property_0_of_types_1_and_2_are_not_identical_2319\", \"Named property '{0}' of types '{1}' and '{2}' are not identical.\"),\n        Interface_0_cannot_simultaneously_extend_types_1_and_2: diag(2320, ts.DiagnosticCategory.Error, \"Interface_0_cannot_simultaneously_extend_types_1_and_2_2320\", \"Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'.\"),\n        Excessive_stack_depth_comparing_types_0_and_1: diag(2321, ts.DiagnosticCategory.Error, \"Excessive_stack_depth_comparing_types_0_and_1_2321\", \"Excessive stack depth comparing types '{0}' and '{1}'.\"),\n        Type_0_is_not_assignable_to_type_1: diag(2322, ts.DiagnosticCategory.Error, \"Type_0_is_not_assignable_to_type_1_2322\", \"Type '{0}' is not assignable to type '{1}'.\"),\n        Cannot_redeclare_exported_variable_0: diag(2323, ts.DiagnosticCategory.Error, \"Cannot_redeclare_exported_variable_0_2323\", \"Cannot redeclare exported variable '{0}'.\"),\n        Property_0_is_missing_in_type_1: diag(2324, ts.DiagnosticCategory.Error, \"Property_0_is_missing_in_type_1_2324\", \"Property '{0}' is missing in type '{1}'.\"),\n        Property_0_is_private_in_type_1_but_not_in_type_2: diag(2325, ts.DiagnosticCategory.Error, \"Property_0_is_private_in_type_1_but_not_in_type_2_2325\", \"Property '{0}' is private in type '{1}' but not in type '{2}'.\"),\n        Types_of_property_0_are_incompatible: diag(2326, ts.DiagnosticCategory.Error, \"Types_of_property_0_are_incompatible_2326\", \"Types of property '{0}' are incompatible.\"),\n        Property_0_is_optional_in_type_1_but_required_in_type_2: diag(2327, ts.DiagnosticCategory.Error, \"Property_0_is_optional_in_type_1_but_required_in_type_2_2327\", \"Property '{0}' is optional in type '{1}' but required in type '{2}'.\"),\n        Types_of_parameters_0_and_1_are_incompatible: diag(2328, ts.DiagnosticCategory.Error, \"Types_of_parameters_0_and_1_are_incompatible_2328\", \"Types of parameters '{0}' and '{1}' are incompatible.\"),\n        Index_signature_is_missing_in_type_0: diag(2329, ts.DiagnosticCategory.Error, \"Index_signature_is_missing_in_type_0_2329\", \"Index signature is missing in type '{0}'.\"),\n        Index_signatures_are_incompatible: diag(2330, ts.DiagnosticCategory.Error, \"Index_signatures_are_incompatible_2330\", \"Index signatures are incompatible.\"),\n        this_cannot_be_referenced_in_a_module_or_namespace_body: diag(2331, ts.DiagnosticCategory.Error, \"this_cannot_be_referenced_in_a_module_or_namespace_body_2331\", \"'this' cannot be referenced in a module or namespace body.\"),\n        this_cannot_be_referenced_in_current_location: diag(2332, ts.DiagnosticCategory.Error, \"this_cannot_be_referenced_in_current_location_2332\", \"'this' cannot be referenced in current location.\"),\n        this_cannot_be_referenced_in_constructor_arguments: diag(2333, ts.DiagnosticCategory.Error, \"this_cannot_be_referenced_in_constructor_arguments_2333\", \"'this' cannot be referenced in constructor arguments.\"),\n        this_cannot_be_referenced_in_a_static_property_initializer: diag(2334, ts.DiagnosticCategory.Error, \"this_cannot_be_referenced_in_a_static_property_initializer_2334\", \"'this' cannot be referenced in a static property initializer.\"),\n        super_can_only_be_referenced_in_a_derived_class: diag(2335, ts.DiagnosticCategory.Error, \"super_can_only_be_referenced_in_a_derived_class_2335\", \"'super' can only be referenced in a derived class.\"),\n        super_cannot_be_referenced_in_constructor_arguments: diag(2336, ts.DiagnosticCategory.Error, \"super_cannot_be_referenced_in_constructor_arguments_2336\", \"'super' cannot be referenced in constructor arguments.\"),\n        Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: diag(2337, ts.DiagnosticCategory.Error, \"Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337\", \"Super calls are not permitted outside constructors or in nested functions inside constructors.\"),\n        super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: diag(2338, ts.DiagnosticCategory.Error, \"super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338\", \"'super' property access is permitted only in a constructor, member function, or member accessor of a derived class.\"),\n        Property_0_does_not_exist_on_type_1: diag(2339, ts.DiagnosticCategory.Error, \"Property_0_does_not_exist_on_type_1_2339\", \"Property '{0}' does not exist on type '{1}'.\"),\n        Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: diag(2340, ts.DiagnosticCategory.Error, \"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340\", \"Only public and protected methods of the base class are accessible via the 'super' keyword.\"),\n        Property_0_is_private_and_only_accessible_within_class_1: diag(2341, ts.DiagnosticCategory.Error, \"Property_0_is_private_and_only_accessible_within_class_1_2341\", \"Property '{0}' is private and only accessible within class '{1}'.\"),\n        An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: diag(2342, ts.DiagnosticCategory.Error, \"An_index_expression_argument_must_be_of_type_string_number_symbol_or_any_2342\", \"An index expression argument must be of type 'string', 'number', 'symbol', or 'any'.\"),\n        This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0: diag(2343, ts.DiagnosticCategory.Error, \"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343\", \"This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'.\"),\n        Type_0_does_not_satisfy_the_constraint_1: diag(2344, ts.DiagnosticCategory.Error, \"Type_0_does_not_satisfy_the_constraint_1_2344\", \"Type '{0}' does not satisfy the constraint '{1}'.\"),\n        Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: diag(2345, ts.DiagnosticCategory.Error, \"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345\", \"Argument of type '{0}' is not assignable to parameter of type '{1}'.\"),\n        Call_target_does_not_contain_any_signatures: diag(2346, ts.DiagnosticCategory.Error, \"Call_target_does_not_contain_any_signatures_2346\", \"Call target does not contain any signatures.\"),\n        Untyped_function_calls_may_not_accept_type_arguments: diag(2347, ts.DiagnosticCategory.Error, \"Untyped_function_calls_may_not_accept_type_arguments_2347\", \"Untyped function calls may not accept type arguments.\"),\n        Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: diag(2348, ts.DiagnosticCategory.Error, \"Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348\", \"Value of type '{0}' is not callable. Did you mean to include 'new'?\"),\n        This_expression_is_not_callable: diag(2349, ts.DiagnosticCategory.Error, \"This_expression_is_not_callable_2349\", \"This expression is not callable.\"),\n        Only_a_void_function_can_be_called_with_the_new_keyword: diag(2350, ts.DiagnosticCategory.Error, \"Only_a_void_function_can_be_called_with_the_new_keyword_2350\", \"Only a void function can be called with the 'new' keyword.\"),\n        This_expression_is_not_constructable: diag(2351, ts.DiagnosticCategory.Error, \"This_expression_is_not_constructable_2351\", \"This expression is not constructable.\"),\n        Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first: diag(2352, ts.DiagnosticCategory.Error, \"Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352\", \"Conversion of type '{0}' to type '{1}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.\"),\n        Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: diag(2353, ts.DiagnosticCategory.Error, \"Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353\", \"Object literal may only specify known properties, and '{0}' does not exist in type '{1}'.\"),\n        This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found: diag(2354, ts.DiagnosticCategory.Error, \"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354\", \"This syntax requires an imported helper but module '{0}' cannot be found.\"),\n        A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value: diag(2355, ts.DiagnosticCategory.Error, \"A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355\", \"A function whose declared type is neither 'void' nor 'any' must return a value.\"),\n        An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2356, ts.DiagnosticCategory.Error, \"An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356\", \"An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type.\"),\n        The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: diag(2357, ts.DiagnosticCategory.Error, \"The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357\", \"The operand of an increment or decrement operator must be a variable or a property access.\"),\n        The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: diag(2358, ts.DiagnosticCategory.Error, \"The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358\", \"The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.\"),\n        The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: diag(2359, ts.DiagnosticCategory.Error, \"The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359\", \"The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.\"),\n        The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: diag(2360, ts.DiagnosticCategory.Error, \"The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360\", \"The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.\"),\n        The_right_hand_side_of_an_in_expression_must_not_be_a_primitive: diag(2361, ts.DiagnosticCategory.Error, \"The_right_hand_side_of_an_in_expression_must_not_be_a_primitive_2361\", \"The right-hand side of an 'in' expression must not be a primitive.\"),\n        The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2362, ts.DiagnosticCategory.Error, \"The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362\", \"The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.\"),\n        The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2363, ts.DiagnosticCategory.Error, \"The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363\", \"The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.\"),\n        The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: diag(2364, ts.DiagnosticCategory.Error, \"The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364\", \"The left-hand side of an assignment expression must be a variable or a property access.\"),\n        Operator_0_cannot_be_applied_to_types_1_and_2: diag(2365, ts.DiagnosticCategory.Error, \"Operator_0_cannot_be_applied_to_types_1_and_2_2365\", \"Operator '{0}' cannot be applied to types '{1}' and '{2}'.\"),\n        Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: diag(2366, ts.DiagnosticCategory.Error, \"Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366\", \"Function lacks ending return statement and return type does not include 'undefined'.\"),\n        This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap: diag(2367, ts.DiagnosticCategory.Error, \"This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap_2367\", \"This condition will always return '{0}' since the types '{1}' and '{2}' have no overlap.\"),\n        Type_parameter_name_cannot_be_0: diag(2368, ts.DiagnosticCategory.Error, \"Type_parameter_name_cannot_be_0_2368\", \"Type parameter name cannot be '{0}'.\"),\n        A_parameter_property_is_only_allowed_in_a_constructor_implementation: diag(2369, ts.DiagnosticCategory.Error, \"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369\", \"A parameter property is only allowed in a constructor implementation.\"),\n        A_rest_parameter_must_be_of_an_array_type: diag(2370, ts.DiagnosticCategory.Error, \"A_rest_parameter_must_be_of_an_array_type_2370\", \"A rest parameter must be of an array type.\"),\n        A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: diag(2371, ts.DiagnosticCategory.Error, \"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371\", \"A parameter initializer is only allowed in a function or constructor implementation.\"),\n        Parameter_0_cannot_reference_itself: diag(2372, ts.DiagnosticCategory.Error, \"Parameter_0_cannot_reference_itself_2372\", \"Parameter '{0}' cannot reference itself.\"),\n        Parameter_0_cannot_reference_identifier_1_declared_after_it: diag(2373, ts.DiagnosticCategory.Error, \"Parameter_0_cannot_reference_identifier_1_declared_after_it_2373\", \"Parameter '{0}' cannot reference identifier '{1}' declared after it.\"),\n        Duplicate_string_index_signature: diag(2374, ts.DiagnosticCategory.Error, \"Duplicate_string_index_signature_2374\", \"Duplicate string index signature.\"),\n        Duplicate_number_index_signature: diag(2375, ts.DiagnosticCategory.Error, \"Duplicate_number_index_signature_2375\", \"Duplicate number index signature.\"),\n        A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_parameter_properties_or_private_identifiers: diag(2376, ts.DiagnosticCategory.Error, \"A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_proper_2376\", \"A 'super' call must be the first statement in the constructor when a class contains initialized properties, parameter properties, or private identifiers.\"),\n        Constructors_for_derived_classes_must_contain_a_super_call: diag(2377, ts.DiagnosticCategory.Error, \"Constructors_for_derived_classes_must_contain_a_super_call_2377\", \"Constructors for derived classes must contain a 'super' call.\"),\n        A_get_accessor_must_return_a_value: diag(2378, ts.DiagnosticCategory.Error, \"A_get_accessor_must_return_a_value_2378\", \"A 'get' accessor must return a value.\"),\n        Getter_and_setter_accessors_do_not_agree_in_visibility: diag(2379, ts.DiagnosticCategory.Error, \"Getter_and_setter_accessors_do_not_agree_in_visibility_2379\", \"Getter and setter accessors do not agree in visibility.\"),\n        get_and_set_accessor_must_have_the_same_type: diag(2380, ts.DiagnosticCategory.Error, \"get_and_set_accessor_must_have_the_same_type_2380\", \"'get' and 'set' accessor must have the same type.\"),\n        A_signature_with_an_implementation_cannot_use_a_string_literal_type: diag(2381, ts.DiagnosticCategory.Error, \"A_signature_with_an_implementation_cannot_use_a_string_literal_type_2381\", \"A signature with an implementation cannot use a string literal type.\"),\n        Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: diag(2382, ts.DiagnosticCategory.Error, \"Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382\", \"Specialized overload signature is not assignable to any non-specialized signature.\"),\n        Overload_signatures_must_all_be_exported_or_non_exported: diag(2383, ts.DiagnosticCategory.Error, \"Overload_signatures_must_all_be_exported_or_non_exported_2383\", \"Overload signatures must all be exported or non-exported.\"),\n        Overload_signatures_must_all_be_ambient_or_non_ambient: diag(2384, ts.DiagnosticCategory.Error, \"Overload_signatures_must_all_be_ambient_or_non_ambient_2384\", \"Overload signatures must all be ambient or non-ambient.\"),\n        Overload_signatures_must_all_be_public_private_or_protected: diag(2385, ts.DiagnosticCategory.Error, \"Overload_signatures_must_all_be_public_private_or_protected_2385\", \"Overload signatures must all be public, private or protected.\"),\n        Overload_signatures_must_all_be_optional_or_required: diag(2386, ts.DiagnosticCategory.Error, \"Overload_signatures_must_all_be_optional_or_required_2386\", \"Overload signatures must all be optional or required.\"),\n        Function_overload_must_be_static: diag(2387, ts.DiagnosticCategory.Error, \"Function_overload_must_be_static_2387\", \"Function overload must be static.\"),\n        Function_overload_must_not_be_static: diag(2388, ts.DiagnosticCategory.Error, \"Function_overload_must_not_be_static_2388\", \"Function overload must not be static.\"),\n        Function_implementation_name_must_be_0: diag(2389, ts.DiagnosticCategory.Error, \"Function_implementation_name_must_be_0_2389\", \"Function implementation name must be '{0}'.\"),\n        Constructor_implementation_is_missing: diag(2390, ts.DiagnosticCategory.Error, \"Constructor_implementation_is_missing_2390\", \"Constructor implementation is missing.\"),\n        Function_implementation_is_missing_or_not_immediately_following_the_declaration: diag(2391, ts.DiagnosticCategory.Error, \"Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391\", \"Function implementation is missing or not immediately following the declaration.\"),\n        Multiple_constructor_implementations_are_not_allowed: diag(2392, ts.DiagnosticCategory.Error, \"Multiple_constructor_implementations_are_not_allowed_2392\", \"Multiple constructor implementations are not allowed.\"),\n        Duplicate_function_implementation: diag(2393, ts.DiagnosticCategory.Error, \"Duplicate_function_implementation_2393\", \"Duplicate function implementation.\"),\n        This_overload_signature_is_not_compatible_with_its_implementation_signature: diag(2394, ts.DiagnosticCategory.Error, \"This_overload_signature_is_not_compatible_with_its_implementation_signature_2394\", \"This overload signature is not compatible with its implementation signature.\"),\n        Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: diag(2395, ts.DiagnosticCategory.Error, \"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395\", \"Individual declarations in merged declaration '{0}' must be all exported or all local.\"),\n        Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: diag(2396, ts.DiagnosticCategory.Error, \"Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396\", \"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.\"),\n        Declaration_name_conflicts_with_built_in_global_identifier_0: diag(2397, ts.DiagnosticCategory.Error, \"Declaration_name_conflicts_with_built_in_global_identifier_0_2397\", \"Declaration name conflicts with built-in global identifier '{0}'.\"),\n        constructor_cannot_be_used_as_a_parameter_property_name: diag(2398, ts.DiagnosticCategory.Error, \"constructor_cannot_be_used_as_a_parameter_property_name_2398\", \"'constructor' cannot be used as a parameter property name.\"),\n        Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: diag(2399, ts.DiagnosticCategory.Error, \"Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399\", \"Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.\"),\n        Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: diag(2400, ts.DiagnosticCategory.Error, \"Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400\", \"Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.\"),\n        Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: diag(2401, ts.DiagnosticCategory.Error, \"Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference_2401\", \"Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.\"),\n        Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: diag(2402, ts.DiagnosticCategory.Error, \"Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402\", \"Expression resolves to '_super' that compiler uses to capture base class reference.\"),\n        Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: diag(2403, ts.DiagnosticCategory.Error, \"Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403\", \"Subsequent variable declarations must have the same type.  Variable '{0}' must be of type '{1}', but here has type '{2}'.\"),\n        The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: diag(2404, ts.DiagnosticCategory.Error, \"The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404\", \"The left-hand side of a 'for...in' statement cannot use a type annotation.\"),\n        The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: diag(2405, ts.DiagnosticCategory.Error, \"The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405\", \"The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.\"),\n        The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access: diag(2406, ts.DiagnosticCategory.Error, \"The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406\", \"The left-hand side of a 'for...in' statement must be a variable or a property access.\"),\n        The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0: diag(2407, ts.DiagnosticCategory.Error, \"The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407\", \"The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'.\"),\n        Setters_cannot_return_a_value: diag(2408, ts.DiagnosticCategory.Error, \"Setters_cannot_return_a_value_2408\", \"Setters cannot return a value.\"),\n        Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: diag(2409, ts.DiagnosticCategory.Error, \"Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409\", \"Return type of constructor signature must be assignable to the instance type of the class.\"),\n        The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any: diag(2410, ts.DiagnosticCategory.Error, \"The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410\", \"The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.\"),\n        Property_0_of_type_1_is_not_assignable_to_string_index_type_2: diag(2411, ts.DiagnosticCategory.Error, \"Property_0_of_type_1_is_not_assignable_to_string_index_type_2_2411\", \"Property '{0}' of type '{1}' is not assignable to string index type '{2}'.\"),\n        Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: diag(2412, ts.DiagnosticCategory.Error, \"Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2_2412\", \"Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'.\"),\n        Numeric_index_type_0_is_not_assignable_to_string_index_type_1: diag(2413, ts.DiagnosticCategory.Error, \"Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413\", \"Numeric index type '{0}' is not assignable to string index type '{1}'.\"),\n        Class_name_cannot_be_0: diag(2414, ts.DiagnosticCategory.Error, \"Class_name_cannot_be_0_2414\", \"Class name cannot be '{0}'.\"),\n        Class_0_incorrectly_extends_base_class_1: diag(2415, ts.DiagnosticCategory.Error, \"Class_0_incorrectly_extends_base_class_1_2415\", \"Class '{0}' incorrectly extends base class '{1}'.\"),\n        Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, ts.DiagnosticCategory.Error, \"Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416\", \"Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'.\"),\n        Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, \"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417\", \"Class static side '{0}' incorrectly extends base class static side '{1}'.\"),\n        Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, ts.DiagnosticCategory.Error, \"Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418\", \"Type of computed property's value is '{0}', which is not assignable to type '{1}'.\"),\n        Types_of_construct_signatures_are_incompatible: diag(2419, ts.DiagnosticCategory.Error, \"Types_of_construct_signatures_are_incompatible_2419\", \"Types of construct signatures are incompatible.\"),\n        Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, \"Class_0_incorrectly_implements_interface_1_2420\", \"Class '{0}' incorrectly implements interface '{1}'.\"),\n        A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, ts.DiagnosticCategory.Error, \"A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422\", \"A class can only implement an object type or intersection of object types with statically known members.\"),\n        Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, ts.DiagnosticCategory.Error, \"Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423\", \"Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.\"),\n        Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: diag(2425, ts.DiagnosticCategory.Error, \"Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425\", \"Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.\"),\n        Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: diag(2426, ts.DiagnosticCategory.Error, \"Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426\", \"Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.\"),\n        Interface_name_cannot_be_0: diag(2427, ts.DiagnosticCategory.Error, \"Interface_name_cannot_be_0_2427\", \"Interface name cannot be '{0}'.\"),\n        All_declarations_of_0_must_have_identical_type_parameters: diag(2428, ts.DiagnosticCategory.Error, \"All_declarations_of_0_must_have_identical_type_parameters_2428\", \"All declarations of '{0}' must have identical type parameters.\"),\n        Interface_0_incorrectly_extends_interface_1: diag(2430, ts.DiagnosticCategory.Error, \"Interface_0_incorrectly_extends_interface_1_2430\", \"Interface '{0}' incorrectly extends interface '{1}'.\"),\n        Enum_name_cannot_be_0: diag(2431, ts.DiagnosticCategory.Error, \"Enum_name_cannot_be_0_2431\", \"Enum name cannot be '{0}'.\"),\n        In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: diag(2432, ts.DiagnosticCategory.Error, \"In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432\", \"In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.\"),\n        A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: diag(2433, ts.DiagnosticCategory.Error, \"A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433\", \"A namespace declaration cannot be in a different file from a class or function with which it is merged.\"),\n        A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: diag(2434, ts.DiagnosticCategory.Error, \"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434\", \"A namespace declaration cannot be located prior to a class or function with which it is merged.\"),\n        Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces: diag(2435, ts.DiagnosticCategory.Error, \"Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435\", \"Ambient modules cannot be nested in other modules or namespaces.\"),\n        Ambient_module_declaration_cannot_specify_relative_module_name: diag(2436, ts.DiagnosticCategory.Error, \"Ambient_module_declaration_cannot_specify_relative_module_name_2436\", \"Ambient module declaration cannot specify relative module name.\"),\n        Module_0_is_hidden_by_a_local_declaration_with_the_same_name: diag(2437, ts.DiagnosticCategory.Error, \"Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437\", \"Module '{0}' is hidden by a local declaration with the same name.\"),\n        Import_name_cannot_be_0: diag(2438, ts.DiagnosticCategory.Error, \"Import_name_cannot_be_0_2438\", \"Import name cannot be '{0}'.\"),\n        Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: diag(2439, ts.DiagnosticCategory.Error, \"Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439\", \"Import or export declaration in an ambient module declaration cannot reference module through relative module name.\"),\n        Import_declaration_conflicts_with_local_declaration_of_0: diag(2440, ts.DiagnosticCategory.Error, \"Import_declaration_conflicts_with_local_declaration_of_0_2440\", \"Import declaration conflicts with local declaration of '{0}'.\"),\n        Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: diag(2441, ts.DiagnosticCategory.Error, \"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441\", \"Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module.\"),\n        Types_have_separate_declarations_of_a_private_property_0: diag(2442, ts.DiagnosticCategory.Error, \"Types_have_separate_declarations_of_a_private_property_0_2442\", \"Types have separate declarations of a private property '{0}'.\"),\n        Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: diag(2443, ts.DiagnosticCategory.Error, \"Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443\", \"Property '{0}' is protected but type '{1}' is not a class derived from '{2}'.\"),\n        Property_0_is_protected_in_type_1_but_public_in_type_2: diag(2444, ts.DiagnosticCategory.Error, \"Property_0_is_protected_in_type_1_but_public_in_type_2_2444\", \"Property '{0}' is protected in type '{1}' but public in type '{2}'.\"),\n        Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: diag(2445, ts.DiagnosticCategory.Error, \"Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445\", \"Property '{0}' is protected and only accessible within class '{1}' and its subclasses.\"),\n        Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: diag(2446, ts.DiagnosticCategory.Error, \"Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_2446\", \"Property '{0}' is protected and only accessible through an instance of class '{1}'.\"),\n        The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: diag(2447, ts.DiagnosticCategory.Error, \"The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447\", \"The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead.\"),\n        Block_scoped_variable_0_used_before_its_declaration: diag(2448, ts.DiagnosticCategory.Error, \"Block_scoped_variable_0_used_before_its_declaration_2448\", \"Block-scoped variable '{0}' used before its declaration.\"),\n        Class_0_used_before_its_declaration: diag(2449, ts.DiagnosticCategory.Error, \"Class_0_used_before_its_declaration_2449\", \"Class '{0}' used before its declaration.\"),\n        Enum_0_used_before_its_declaration: diag(2450, ts.DiagnosticCategory.Error, \"Enum_0_used_before_its_declaration_2450\", \"Enum '{0}' used before its declaration.\"),\n        Cannot_redeclare_block_scoped_variable_0: diag(2451, ts.DiagnosticCategory.Error, \"Cannot_redeclare_block_scoped_variable_0_2451\", \"Cannot redeclare block-scoped variable '{0}'.\"),\n        An_enum_member_cannot_have_a_numeric_name: diag(2452, ts.DiagnosticCategory.Error, \"An_enum_member_cannot_have_a_numeric_name_2452\", \"An enum member cannot have a numeric name.\"),\n        The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: diag(2453, ts.DiagnosticCategory.Error, \"The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_typ_2453\", \"The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly.\"),\n        Variable_0_is_used_before_being_assigned: diag(2454, ts.DiagnosticCategory.Error, \"Variable_0_is_used_before_being_assigned_2454\", \"Variable '{0}' is used before being assigned.\"),\n        Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: diag(2455, ts.DiagnosticCategory.Error, \"Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0_2455\", \"Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'.\"),\n        Type_alias_0_circularly_references_itself: diag(2456, ts.DiagnosticCategory.Error, \"Type_alias_0_circularly_references_itself_2456\", \"Type alias '{0}' circularly references itself.\"),\n        Type_alias_name_cannot_be_0: diag(2457, ts.DiagnosticCategory.Error, \"Type_alias_name_cannot_be_0_2457\", \"Type alias name cannot be '{0}'.\"),\n        An_AMD_module_cannot_have_multiple_name_assignments: diag(2458, ts.DiagnosticCategory.Error, \"An_AMD_module_cannot_have_multiple_name_assignments_2458\", \"An AMD module cannot have multiple name assignments.\"),\n        Module_0_declares_1_locally_but_it_is_not_exported: diag(2459, ts.DiagnosticCategory.Error, \"Module_0_declares_1_locally_but_it_is_not_exported_2459\", \"Module '{0}' declares '{1}' locally, but it is not exported.\"),\n        Module_0_declares_1_locally_but_it_is_exported_as_2: diag(2460, ts.DiagnosticCategory.Error, \"Module_0_declares_1_locally_but_it_is_exported_as_2_2460\", \"Module '{0}' declares '{1}' locally, but it is exported as '{2}'.\"),\n        Type_0_is_not_an_array_type: diag(2461, ts.DiagnosticCategory.Error, \"Type_0_is_not_an_array_type_2461\", \"Type '{0}' is not an array type.\"),\n        A_rest_element_must_be_last_in_a_destructuring_pattern: diag(2462, ts.DiagnosticCategory.Error, \"A_rest_element_must_be_last_in_a_destructuring_pattern_2462\", \"A rest element must be last in a destructuring pattern.\"),\n        A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: diag(2463, ts.DiagnosticCategory.Error, \"A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463\", \"A binding pattern parameter cannot be optional in an implementation signature.\"),\n        A_computed_property_name_must_be_of_type_string_number_symbol_or_any: diag(2464, ts.DiagnosticCategory.Error, \"A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464\", \"A computed property name must be of type 'string', 'number', 'symbol', or 'any'.\"),\n        this_cannot_be_referenced_in_a_computed_property_name: diag(2465, ts.DiagnosticCategory.Error, \"this_cannot_be_referenced_in_a_computed_property_name_2465\", \"'this' cannot be referenced in a computed property name.\"),\n        super_cannot_be_referenced_in_a_computed_property_name: diag(2466, ts.DiagnosticCategory.Error, \"super_cannot_be_referenced_in_a_computed_property_name_2466\", \"'super' cannot be referenced in a computed property name.\"),\n        A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: diag(2467, ts.DiagnosticCategory.Error, \"A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467\", \"A computed property name cannot reference a type parameter from its containing type.\"),\n        Cannot_find_global_value_0: diag(2468, ts.DiagnosticCategory.Error, \"Cannot_find_global_value_0_2468\", \"Cannot find global value '{0}'.\"),\n        The_0_operator_cannot_be_applied_to_type_symbol: diag(2469, ts.DiagnosticCategory.Error, \"The_0_operator_cannot_be_applied_to_type_symbol_2469\", \"The '{0}' operator cannot be applied to type 'symbol'.\"),\n        Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: diag(2470, ts.DiagnosticCategory.Error, \"Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470\", \"'Symbol' reference does not refer to the global Symbol constructor object.\"),\n        A_computed_property_name_of_the_form_0_must_be_of_type_symbol: diag(2471, ts.DiagnosticCategory.Error, \"A_computed_property_name_of_the_form_0_must_be_of_type_symbol_2471\", \"A computed property name of the form '{0}' must be of type 'symbol'.\"),\n        Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: diag(2472, ts.DiagnosticCategory.Error, \"Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472\", \"Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.\"),\n        Enum_declarations_must_all_be_const_or_non_const: diag(2473, ts.DiagnosticCategory.Error, \"Enum_declarations_must_all_be_const_or_non_const_2473\", \"Enum declarations must all be const or non-const.\"),\n        const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values: diag(2474, ts.DiagnosticCategory.Error, \"const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values_2474\", \"const enum member initializers can only contain literal values and other computed enum values.\"),\n        const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query: diag(2475, ts.DiagnosticCategory.Error, \"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475\", \"'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query.\"),\n        A_const_enum_member_can_only_be_accessed_using_a_string_literal: diag(2476, ts.DiagnosticCategory.Error, \"A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476\", \"A const enum member can only be accessed using a string literal.\"),\n        const_enum_member_initializer_was_evaluated_to_a_non_finite_value: diag(2477, ts.DiagnosticCategory.Error, \"const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477\", \"'const' enum member initializer was evaluated to a non-finite value.\"),\n        const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: diag(2478, ts.DiagnosticCategory.Error, \"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478\", \"'const' enum member initializer was evaluated to disallowed value 'NaN'.\"),\n        Property_0_does_not_exist_on_const_enum_1: diag(2479, ts.DiagnosticCategory.Error, \"Property_0_does_not_exist_on_const_enum_1_2479\", \"Property '{0}' does not exist on 'const' enum '{1}'.\"),\n        let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: diag(2480, ts.DiagnosticCategory.Error, \"let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480\", \"'let' is not allowed to be used as a name in 'let' or 'const' declarations.\"),\n        Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: diag(2481, ts.DiagnosticCategory.Error, \"Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481\", \"Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'.\"),\n        The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: diag(2483, ts.DiagnosticCategory.Error, \"The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483\", \"The left-hand side of a 'for...of' statement cannot use a type annotation.\"),\n        Export_declaration_conflicts_with_exported_declaration_of_0: diag(2484, ts.DiagnosticCategory.Error, \"Export_declaration_conflicts_with_exported_declaration_of_0_2484\", \"Export declaration conflicts with exported declaration of '{0}'.\"),\n        The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access: diag(2487, ts.DiagnosticCategory.Error, \"The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487\", \"The left-hand side of a 'for...of' statement must be a variable or a property access.\"),\n        Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2488, ts.DiagnosticCategory.Error, \"Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488\", \"Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator.\"),\n        An_iterator_must_have_a_next_method: diag(2489, ts.DiagnosticCategory.Error, \"An_iterator_must_have_a_next_method_2489\", \"An iterator must have a 'next()' method.\"),\n        The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property: diag(2490, ts.DiagnosticCategory.Error, \"The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490\", \"The type returned by the '{0}()' method of an iterator must have a 'value' property.\"),\n        The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: diag(2491, ts.DiagnosticCategory.Error, \"The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491\", \"The left-hand side of a 'for...in' statement cannot be a destructuring pattern.\"),\n        Cannot_redeclare_identifier_0_in_catch_clause: diag(2492, ts.DiagnosticCategory.Error, \"Cannot_redeclare_identifier_0_in_catch_clause_2492\", \"Cannot redeclare identifier '{0}' in catch clause.\"),\n        Tuple_type_0_of_length_1_has_no_element_at_index_2: diag(2493, ts.DiagnosticCategory.Error, \"Tuple_type_0_of_length_1_has_no_element_at_index_2_2493\", \"Tuple type '{0}' of length '{1}' has no element at index '{2}'.\"),\n        Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: diag(2494, ts.DiagnosticCategory.Error, \"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494\", \"Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher.\"),\n        Type_0_is_not_an_array_type_or_a_string_type: diag(2495, ts.DiagnosticCategory.Error, \"Type_0_is_not_an_array_type_or_a_string_type_2495\", \"Type '{0}' is not an array type or a string type.\"),\n        The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: diag(2496, ts.DiagnosticCategory.Error, \"The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496\", \"The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.\"),\n        This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export: diag(2497, ts.DiagnosticCategory.Error, \"This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497\", \"This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export.\"),\n        Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: diag(2498, ts.DiagnosticCategory.Error, \"Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498\", \"Module '{0}' uses 'export =' and cannot be used with 'export *'.\"),\n        An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: diag(2499, ts.DiagnosticCategory.Error, \"An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499\", \"An interface can only extend an identifier/qualified-name with optional type arguments.\"),\n        A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: diag(2500, ts.DiagnosticCategory.Error, \"A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500\", \"A class can only implement an identifier/qualified-name with optional type arguments.\"),\n        A_rest_element_cannot_contain_a_binding_pattern: diag(2501, ts.DiagnosticCategory.Error, \"A_rest_element_cannot_contain_a_binding_pattern_2501\", \"A rest element cannot contain a binding pattern.\"),\n        _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: diag(2502, ts.DiagnosticCategory.Error, \"_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502\", \"'{0}' is referenced directly or indirectly in its own type annotation.\"),\n        Cannot_find_namespace_0: diag(2503, ts.DiagnosticCategory.Error, \"Cannot_find_namespace_0_2503\", \"Cannot find namespace '{0}'.\"),\n        Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator: diag(2504, ts.DiagnosticCategory.Error, \"Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504\", \"Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator.\"),\n        A_generator_cannot_have_a_void_type_annotation: diag(2505, ts.DiagnosticCategory.Error, \"A_generator_cannot_have_a_void_type_annotation_2505\", \"A generator cannot have a 'void' type annotation.\"),\n        _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: diag(2506, ts.DiagnosticCategory.Error, \"_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506\", \"'{0}' is referenced directly or indirectly in its own base expression.\"),\n        Type_0_is_not_a_constructor_function_type: diag(2507, ts.DiagnosticCategory.Error, \"Type_0_is_not_a_constructor_function_type_2507\", \"Type '{0}' is not a constructor function type.\"),\n        No_base_constructor_has_the_specified_number_of_type_arguments: diag(2508, ts.DiagnosticCategory.Error, \"No_base_constructor_has_the_specified_number_of_type_arguments_2508\", \"No base constructor has the specified number of type arguments.\"),\n        Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2509, ts.DiagnosticCategory.Error, \"Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509\", \"Base constructor return type '{0}' is not an object type or intersection of object types with statically known members.\"),\n        Base_constructors_must_all_have_the_same_return_type: diag(2510, ts.DiagnosticCategory.Error, \"Base_constructors_must_all_have_the_same_return_type_2510\", \"Base constructors must all have the same return type.\"),\n        Cannot_create_an_instance_of_an_abstract_class: diag(2511, ts.DiagnosticCategory.Error, \"Cannot_create_an_instance_of_an_abstract_class_2511\", \"Cannot create an instance of an abstract class.\"),\n        Overload_signatures_must_all_be_abstract_or_non_abstract: diag(2512, ts.DiagnosticCategory.Error, \"Overload_signatures_must_all_be_abstract_or_non_abstract_2512\", \"Overload signatures must all be abstract or non-abstract.\"),\n        Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression: diag(2513, ts.DiagnosticCategory.Error, \"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513\", \"Abstract method '{0}' in class '{1}' cannot be accessed via super expression.\"),\n        Classes_containing_abstract_methods_must_be_marked_abstract: diag(2514, ts.DiagnosticCategory.Error, \"Classes_containing_abstract_methods_must_be_marked_abstract_2514\", \"Classes containing abstract methods must be marked abstract.\"),\n        Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: diag(2515, ts.DiagnosticCategory.Error, \"Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515\", \"Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'.\"),\n        All_declarations_of_an_abstract_method_must_be_consecutive: diag(2516, ts.DiagnosticCategory.Error, \"All_declarations_of_an_abstract_method_must_be_consecutive_2516\", \"All declarations of an abstract method must be consecutive.\"),\n        Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: diag(2517, ts.DiagnosticCategory.Error, \"Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517\", \"Cannot assign an abstract constructor type to a non-abstract constructor type.\"),\n        A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: diag(2518, ts.DiagnosticCategory.Error, \"A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518\", \"A 'this'-based type guard is not compatible with a parameter-based type guard.\"),\n        An_async_iterator_must_have_a_next_method: diag(2519, ts.DiagnosticCategory.Error, \"An_async_iterator_must_have_a_next_method_2519\", \"An async iterator must have a 'next()' method.\"),\n        Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: diag(2520, ts.DiagnosticCategory.Error, \"Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520\", \"Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions.\"),\n        Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: diag(2521, ts.DiagnosticCategory.Error, \"Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521\", \"Expression resolves to variable declaration '{0}' that compiler uses to support async functions.\"),\n        The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method: diag(2522, ts.DiagnosticCategory.Error, \"The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522\", \"The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method.\"),\n        yield_expressions_cannot_be_used_in_a_parameter_initializer: diag(2523, ts.DiagnosticCategory.Error, \"yield_expressions_cannot_be_used_in_a_parameter_initializer_2523\", \"'yield' expressions cannot be used in a parameter initializer.\"),\n        await_expressions_cannot_be_used_in_a_parameter_initializer: diag(2524, ts.DiagnosticCategory.Error, \"await_expressions_cannot_be_used_in_a_parameter_initializer_2524\", \"'await' expressions cannot be used in a parameter initializer.\"),\n        Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value: diag(2525, ts.DiagnosticCategory.Error, \"Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525\", \"Initializer provides no value for this binding element and the binding element has no default value.\"),\n        A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface: diag(2526, ts.DiagnosticCategory.Error, \"A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526\", \"A 'this' type is available only in a non-static member of a class or interface.\"),\n        The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary: diag(2527, ts.DiagnosticCategory.Error, \"The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527\", \"The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary.\"),\n        A_module_cannot_have_multiple_default_exports: diag(2528, ts.DiagnosticCategory.Error, \"A_module_cannot_have_multiple_default_exports_2528\", \"A module cannot have multiple default exports.\"),\n        Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions: diag(2529, ts.DiagnosticCategory.Error, \"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529\", \"Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions.\"),\n        Property_0_is_incompatible_with_index_signature: diag(2530, ts.DiagnosticCategory.Error, \"Property_0_is_incompatible_with_index_signature_2530\", \"Property '{0}' is incompatible with index signature.\"),\n        Object_is_possibly_null: diag(2531, ts.DiagnosticCategory.Error, \"Object_is_possibly_null_2531\", \"Object is possibly 'null'.\"),\n        Object_is_possibly_undefined: diag(2532, ts.DiagnosticCategory.Error, \"Object_is_possibly_undefined_2532\", \"Object is possibly 'undefined'.\"),\n        Object_is_possibly_null_or_undefined: diag(2533, ts.DiagnosticCategory.Error, \"Object_is_possibly_null_or_undefined_2533\", \"Object is possibly 'null' or 'undefined'.\"),\n        A_function_returning_never_cannot_have_a_reachable_end_point: diag(2534, ts.DiagnosticCategory.Error, \"A_function_returning_never_cannot_have_a_reachable_end_point_2534\", \"A function returning 'never' cannot have a reachable end point.\"),\n        Enum_type_0_has_members_with_initializers_that_are_not_literals: diag(2535, ts.DiagnosticCategory.Error, \"Enum_type_0_has_members_with_initializers_that_are_not_literals_2535\", \"Enum type '{0}' has members with initializers that are not literals.\"),\n        Type_0_cannot_be_used_to_index_type_1: diag(2536, ts.DiagnosticCategory.Error, \"Type_0_cannot_be_used_to_index_type_1_2536\", \"Type '{0}' cannot be used to index type '{1}'.\"),\n        Type_0_has_no_matching_index_signature_for_type_1: diag(2537, ts.DiagnosticCategory.Error, \"Type_0_has_no_matching_index_signature_for_type_1_2537\", \"Type '{0}' has no matching index signature for type '{1}'.\"),\n        Type_0_cannot_be_used_as_an_index_type: diag(2538, ts.DiagnosticCategory.Error, \"Type_0_cannot_be_used_as_an_index_type_2538\", \"Type '{0}' cannot be used as an index type.\"),\n        Cannot_assign_to_0_because_it_is_not_a_variable: diag(2539, ts.DiagnosticCategory.Error, \"Cannot_assign_to_0_because_it_is_not_a_variable_2539\", \"Cannot assign to '{0}' because it is not a variable.\"),\n        Cannot_assign_to_0_because_it_is_a_read_only_property: diag(2540, ts.DiagnosticCategory.Error, \"Cannot_assign_to_0_because_it_is_a_read_only_property_2540\", \"Cannot assign to '{0}' because it is a read-only property.\"),\n        The_target_of_an_assignment_must_be_a_variable_or_a_property_access: diag(2541, ts.DiagnosticCategory.Error, \"The_target_of_an_assignment_must_be_a_variable_or_a_property_access_2541\", \"The target of an assignment must be a variable or a property access.\"),\n        Index_signature_in_type_0_only_permits_reading: diag(2542, ts.DiagnosticCategory.Error, \"Index_signature_in_type_0_only_permits_reading_2542\", \"Index signature in type '{0}' only permits reading.\"),\n        Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: diag(2543, ts.DiagnosticCategory.Error, \"Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543\", \"Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference.\"),\n        Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference: diag(2544, ts.DiagnosticCategory.Error, \"Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544\", \"Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference.\"),\n        A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any: diag(2545, ts.DiagnosticCategory.Error, \"A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545\", \"A mixin class must have a constructor with a single rest parameter of type 'any[]'.\"),\n        The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: diag(2547, ts.DiagnosticCategory.Error, \"The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547\", \"The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property.\"),\n        Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2548, ts.DiagnosticCategory.Error, \"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548\", \"Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator.\"),\n        Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2549, ts.DiagnosticCategory.Error, \"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549\", \"Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator.\"),\n        Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later: diag(2550, ts.DiagnosticCategory.Error, \"Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550\", \"Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.\"),\n        Property_0_does_not_exist_on_type_1_Did_you_mean_2: diag(2551, ts.DiagnosticCategory.Error, \"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551\", \"Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?\"),\n        Cannot_find_name_0_Did_you_mean_1: diag(2552, ts.DiagnosticCategory.Error, \"Cannot_find_name_0_Did_you_mean_1_2552\", \"Cannot find name '{0}'. Did you mean '{1}'?\"),\n        Computed_values_are_not_permitted_in_an_enum_with_string_valued_members: diag(2553, ts.DiagnosticCategory.Error, \"Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553\", \"Computed values are not permitted in an enum with string valued members.\"),\n        Expected_0_arguments_but_got_1: diag(2554, ts.DiagnosticCategory.Error, \"Expected_0_arguments_but_got_1_2554\", \"Expected {0} arguments, but got {1}.\"),\n        Expected_at_least_0_arguments_but_got_1: diag(2555, ts.DiagnosticCategory.Error, \"Expected_at_least_0_arguments_but_got_1_2555\", \"Expected at least {0} arguments, but got {1}.\"),\n        Expected_0_arguments_but_got_1_or_more: diag(2556, ts.DiagnosticCategory.Error, \"Expected_0_arguments_but_got_1_or_more_2556\", \"Expected {0} arguments, but got {1} or more.\"),\n        Expected_at_least_0_arguments_but_got_1_or_more: diag(2557, ts.DiagnosticCategory.Error, \"Expected_at_least_0_arguments_but_got_1_or_more_2557\", \"Expected at least {0} arguments, but got {1} or more.\"),\n        Expected_0_type_arguments_but_got_1: diag(2558, ts.DiagnosticCategory.Error, \"Expected_0_type_arguments_but_got_1_2558\", \"Expected {0} type arguments, but got {1}.\"),\n        Type_0_has_no_properties_in_common_with_type_1: diag(2559, ts.DiagnosticCategory.Error, \"Type_0_has_no_properties_in_common_with_type_1_2559\", \"Type '{0}' has no properties in common with type '{1}'.\"),\n        Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it: diag(2560, ts.DiagnosticCategory.Error, \"Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560\", \"Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?\"),\n        Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2: diag(2561, ts.DiagnosticCategory.Error, \"Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561\", \"Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?\"),\n        Base_class_expressions_cannot_reference_class_type_parameters: diag(2562, ts.DiagnosticCategory.Error, \"Base_class_expressions_cannot_reference_class_type_parameters_2562\", \"Base class expressions cannot reference class type parameters.\"),\n        The_containing_function_or_module_body_is_too_large_for_control_flow_analysis: diag(2563, ts.DiagnosticCategory.Error, \"The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563\", \"The containing function or module body is too large for control flow analysis.\"),\n        Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: diag(2564, ts.DiagnosticCategory.Error, \"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564\", \"Property '{0}' has no initializer and is not definitely assigned in the constructor.\"),\n        Property_0_is_used_before_being_assigned: diag(2565, ts.DiagnosticCategory.Error, \"Property_0_is_used_before_being_assigned_2565\", \"Property '{0}' is used before being assigned.\"),\n        A_rest_element_cannot_have_a_property_name: diag(2566, ts.DiagnosticCategory.Error, \"A_rest_element_cannot_have_a_property_name_2566\", \"A rest element cannot have a property name.\"),\n        Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, ts.DiagnosticCategory.Error, \"Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567\", \"Enum declarations can only merge with namespace or other enum declarations.\"),\n        Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators: diag(2569, ts.DiagnosticCategory.Error, \"Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569\", \"Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.\"),\n        Object_is_of_type_unknown: diag(2571, ts.DiagnosticCategory.Error, \"Object_is_of_type_unknown_2571\", \"Object is of type 'unknown'.\"),\n        Rest_signatures_are_incompatible: diag(2572, ts.DiagnosticCategory.Error, \"Rest_signatures_are_incompatible_2572\", \"Rest signatures are incompatible.\"),\n        Property_0_is_incompatible_with_rest_element_type: diag(2573, ts.DiagnosticCategory.Error, \"Property_0_is_incompatible_with_rest_element_type_2573\", \"Property '{0}' is incompatible with rest element type.\"),\n        A_rest_element_type_must_be_an_array_type: diag(2574, ts.DiagnosticCategory.Error, \"A_rest_element_type_must_be_an_array_type_2574\", \"A rest element type must be an array type.\"),\n        No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts.DiagnosticCategory.Error, \"No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575\", \"No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments.\"),\n        Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead: diag(2576, ts.DiagnosticCategory.Error, \"Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576\", \"Property '{0}' does not exist on type '{1}'. Did you mean to access the static member '{2}' instead?\"),\n        Return_type_annotation_circularly_references_itself: diag(2577, ts.DiagnosticCategory.Error, \"Return_type_annotation_circularly_references_itself_2577\", \"Return type annotation circularly references itself.\"),\n        Unused_ts_expect_error_directive: diag(2578, ts.DiagnosticCategory.Error, \"Unused_ts_expect_error_directive_2578\", \"Unused '@ts-expect-error' directive.\"),\n        Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, \"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580\", \"Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.\"),\n        Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, \"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581\", \"Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.\"),\n        Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, \"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582\", \"Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.\"),\n        Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later: diag(2583, ts.DiagnosticCategory.Error, \"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583\", \"Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later.\"),\n        Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom: diag(2584, ts.DiagnosticCategory.Error, \"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584\", \"Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.\"),\n        _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts.DiagnosticCategory.Error, \"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585\", \"'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.\"),\n        Enum_type_0_circularly_references_itself: diag(2586, ts.DiagnosticCategory.Error, \"Enum_type_0_circularly_references_itself_2586\", \"Enum type '{0}' circularly references itself.\"),\n        JSDoc_type_0_circularly_references_itself: diag(2587, ts.DiagnosticCategory.Error, \"JSDoc_type_0_circularly_references_itself_2587\", \"JSDoc type '{0}' circularly references itself.\"),\n        Cannot_assign_to_0_because_it_is_a_constant: diag(2588, ts.DiagnosticCategory.Error, \"Cannot_assign_to_0_because_it_is_a_constant_2588\", \"Cannot assign to '{0}' because it is a constant.\"),\n        Type_instantiation_is_excessively_deep_and_possibly_infinite: diag(2589, ts.DiagnosticCategory.Error, \"Type_instantiation_is_excessively_deep_and_possibly_infinite_2589\", \"Type instantiation is excessively deep and possibly infinite.\"),\n        Expression_produces_a_union_type_that_is_too_complex_to_represent: diag(2590, ts.DiagnosticCategory.Error, \"Expression_produces_a_union_type_that_is_too_complex_to_represent_2590\", \"Expression produces a union type that is too complex to represent.\"),\n        Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, \"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591\", \"Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig.\"),\n        Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, \"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592\", \"Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig.\"),\n        Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, \"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593\", \"Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.\"),\n        This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: diag(2594, ts.DiagnosticCategory.Error, \"This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594\", \"This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag.\"),\n        _0_can_only_be_imported_by_using_a_default_import: diag(2595, ts.DiagnosticCategory.Error, \"_0_can_only_be_imported_by_using_a_default_import_2595\", \"'{0}' can only be imported by using a default import.\"),\n        _0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2596, ts.DiagnosticCategory.Error, \"_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596\", \"'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import.\"),\n        _0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import: diag(2597, ts.DiagnosticCategory.Error, \"_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597\", \"'{0}' can only be imported by using a 'require' call or by using a default import.\"),\n        _0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2598, ts.DiagnosticCategory.Error, \"_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598\", \"'{0}' can only be imported by using a 'require' call or by turning on the 'esModuleInterop' flag and using a default import.\"),\n        JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, \"JSX_element_attributes_type_0_may_not_be_a_union_type_2600\", \"JSX element attributes type '{0}' may not be a union type.\"),\n        The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, \"The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601\", \"The return type of a JSX element constructor must return an object type.\"),\n        JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, \"JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602\", \"JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist.\"),\n        Property_0_in_type_1_is_not_assignable_to_type_2: diag(2603, ts.DiagnosticCategory.Error, \"Property_0_in_type_1_is_not_assignable_to_type_2_2603\", \"Property '{0}' in type '{1}' is not assignable to type '{2}'.\"),\n        JSX_element_type_0_does_not_have_any_construct_or_call_signatures: diag(2604, ts.DiagnosticCategory.Error, \"JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604\", \"JSX element type '{0}' does not have any construct or call signatures.\"),\n        JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements: diag(2605, ts.DiagnosticCategory.Error, \"JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements_2605\", \"JSX element type '{0}' is not a constructor function for JSX elements.\"),\n        Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: diag(2606, ts.DiagnosticCategory.Error, \"Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606\", \"Property '{0}' of JSX spread attribute is not assignable to target property.\"),\n        JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: diag(2607, ts.DiagnosticCategory.Error, \"JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607\", \"JSX element class does not support attributes because it does not have a '{0}' property.\"),\n        The_global_type_JSX_0_may_not_have_more_than_one_property: diag(2608, ts.DiagnosticCategory.Error, \"The_global_type_JSX_0_may_not_have_more_than_one_property_2608\", \"The global type 'JSX.{0}' may not have more than one property.\"),\n        JSX_spread_child_must_be_an_array_type: diag(2609, ts.DiagnosticCategory.Error, \"JSX_spread_child_must_be_an_array_type_2609\", \"JSX spread child must be an array type.\"),\n        _0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property: diag(2610, ts.DiagnosticCategory.Error, \"_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610\", \"'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property.\"),\n        _0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor: diag(2611, ts.DiagnosticCategory.Error, \"_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611\", \"'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor.\"),\n        Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration: diag(2612, ts.DiagnosticCategory.Error, \"Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612\", \"Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.\"),\n        Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead: diag(2613, ts.DiagnosticCategory.Error, \"Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613\", \"Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?\"),\n        Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead: diag(2614, ts.DiagnosticCategory.Error, \"Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614\", \"Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?\"),\n        Type_of_property_0_circularly_references_itself_in_mapped_type_1: diag(2615, ts.DiagnosticCategory.Error, \"Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615\", \"Type of property '{0}' circularly references itself in mapped type '{1}'.\"),\n        _0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import: diag(2616, ts.DiagnosticCategory.Error, \"_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616\", \"'{0}' can only be imported by using 'import {1} = require({2})' or a default import.\"),\n        _0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2617, ts.DiagnosticCategory.Error, \"_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617\", \"'{0}' can only be imported by using 'import {1} = require({2})' or by turning on the 'esModuleInterop' flag and using a default import.\"),\n        Source_has_0_element_s_but_target_requires_1: diag(2618, ts.DiagnosticCategory.Error, \"Source_has_0_element_s_but_target_requires_1_2618\", \"Source has {0} element(s) but target requires {1}.\"),\n        Source_has_0_element_s_but_target_allows_only_1: diag(2619, ts.DiagnosticCategory.Error, \"Source_has_0_element_s_but_target_allows_only_1_2619\", \"Source has {0} element(s) but target allows only {1}.\"),\n        Target_requires_0_element_s_but_source_may_have_fewer: diag(2620, ts.DiagnosticCategory.Error, \"Target_requires_0_element_s_but_source_may_have_fewer_2620\", \"Target requires {0} element(s) but source may have fewer.\"),\n        Target_allows_only_0_element_s_but_source_may_have_more: diag(2621, ts.DiagnosticCategory.Error, \"Target_allows_only_0_element_s_but_source_may_have_more_2621\", \"Target allows only {0} element(s) but source may have more.\"),\n        Source_provides_no_match_for_required_element_at_position_0_in_target: diag(2623, ts.DiagnosticCategory.Error, \"Source_provides_no_match_for_required_element_at_position_0_in_target_2623\", \"Source provides no match for required element at position {0} in target.\"),\n        Source_provides_no_match_for_variadic_element_at_position_0_in_target: diag(2624, ts.DiagnosticCategory.Error, \"Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624\", \"Source provides no match for variadic element at position {0} in target.\"),\n        Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target: diag(2625, ts.DiagnosticCategory.Error, \"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625\", \"Variadic element at position {0} in source does not match element at position {1} in target.\"),\n        Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target: diag(2626, ts.DiagnosticCategory.Error, \"Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626\", \"Type at position {0} in source is not compatible with type at position {1} in target.\"),\n        Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target: diag(2627, ts.DiagnosticCategory.Error, \"Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627\", \"Type at positions {0} through {1} in source is not compatible with type at position {2} in target.\"),\n        Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, ts.DiagnosticCategory.Error, \"Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649\", \"Cannot augment module '{0}' with value exports because it resolves to a non-module entity.\"),\n        A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, ts.DiagnosticCategory.Error, \"A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651\", \"A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums.\"),\n        Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, ts.DiagnosticCategory.Error, \"Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652\", \"Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead.\"),\n        Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: diag(2653, ts.DiagnosticCategory.Error, \"Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653\", \"Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'.\"),\n        Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: diag(2654, ts.DiagnosticCategory.Error, \"Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_pack_2654\", \"Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition.\"),\n        Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition: diag(2656, ts.DiagnosticCategory.Error, \"Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_2656\", \"Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition.\"),\n        JSX_expressions_must_have_one_parent_element: diag(2657, ts.DiagnosticCategory.Error, \"JSX_expressions_must_have_one_parent_element_2657\", \"JSX expressions must have one parent element.\"),\n        Type_0_provides_no_match_for_the_signature_1: diag(2658, ts.DiagnosticCategory.Error, \"Type_0_provides_no_match_for_the_signature_1_2658\", \"Type '{0}' provides no match for the signature '{1}'.\"),\n        super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: diag(2659, ts.DiagnosticCategory.Error, \"super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659\", \"'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher.\"),\n        super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: diag(2660, ts.DiagnosticCategory.Error, \"super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660\", \"'super' can only be referenced in members of derived classes or object literal expressions.\"),\n        Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module: diag(2661, ts.DiagnosticCategory.Error, \"Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661\", \"Cannot export '{0}'. Only local declarations can be exported from a module.\"),\n        Cannot_find_name_0_Did_you_mean_the_static_member_1_0: diag(2662, ts.DiagnosticCategory.Error, \"Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662\", \"Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?\"),\n        Cannot_find_name_0_Did_you_mean_the_instance_member_this_0: diag(2663, ts.DiagnosticCategory.Error, \"Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663\", \"Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?\"),\n        Invalid_module_name_in_augmentation_module_0_cannot_be_found: diag(2664, ts.DiagnosticCategory.Error, \"Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664\", \"Invalid module name in augmentation, module '{0}' cannot be found.\"),\n        Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented: diag(2665, ts.DiagnosticCategory.Error, \"Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665\", \"Invalid module name in augmentation. Module '{0}' resolves to an untyped module at '{1}', which cannot be augmented.\"),\n        Exports_and_export_assignments_are_not_permitted_in_module_augmentations: diag(2666, ts.DiagnosticCategory.Error, \"Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666\", \"Exports and export assignments are not permitted in module augmentations.\"),\n        Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module: diag(2667, ts.DiagnosticCategory.Error, \"Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667\", \"Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.\"),\n        export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible: diag(2668, ts.DiagnosticCategory.Error, \"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668\", \"'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible.\"),\n        Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations: diag(2669, ts.DiagnosticCategory.Error, \"Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669\", \"Augmentations for the global scope can only be directly nested in external modules or ambient module declarations.\"),\n        Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context: diag(2670, ts.DiagnosticCategory.Error, \"Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670\", \"Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context.\"),\n        Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity: diag(2671, ts.DiagnosticCategory.Error, \"Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671\", \"Cannot augment module '{0}' because it resolves to a non-module entity.\"),\n        Cannot_assign_a_0_constructor_type_to_a_1_constructor_type: diag(2672, ts.DiagnosticCategory.Error, \"Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672\", \"Cannot assign a '{0}' constructor type to a '{1}' constructor type.\"),\n        Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration: diag(2673, ts.DiagnosticCategory.Error, \"Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673\", \"Constructor of class '{0}' is private and only accessible within the class declaration.\"),\n        Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration: diag(2674, ts.DiagnosticCategory.Error, \"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674\", \"Constructor of class '{0}' is protected and only accessible within the class declaration.\"),\n        Cannot_extend_a_class_0_Class_constructor_is_marked_as_private: diag(2675, ts.DiagnosticCategory.Error, \"Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675\", \"Cannot extend a class '{0}'. Class constructor is marked as private.\"),\n        Accessors_must_both_be_abstract_or_non_abstract: diag(2676, ts.DiagnosticCategory.Error, \"Accessors_must_both_be_abstract_or_non_abstract_2676\", \"Accessors must both be abstract or non-abstract.\"),\n        A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type: diag(2677, ts.DiagnosticCategory.Error, \"A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677\", \"A type predicate's type must be assignable to its parameter's type.\"),\n        Type_0_is_not_comparable_to_type_1: diag(2678, ts.DiagnosticCategory.Error, \"Type_0_is_not_comparable_to_type_1_2678\", \"Type '{0}' is not comparable to type '{1}'.\"),\n        A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void: diag(2679, ts.DiagnosticCategory.Error, \"A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679\", \"A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'.\"),\n        A_0_parameter_must_be_the_first_parameter: diag(2680, ts.DiagnosticCategory.Error, \"A_0_parameter_must_be_the_first_parameter_2680\", \"A '{0}' parameter must be the first parameter.\"),\n        A_constructor_cannot_have_a_this_parameter: diag(2681, ts.DiagnosticCategory.Error, \"A_constructor_cannot_have_a_this_parameter_2681\", \"A constructor cannot have a 'this' parameter.\"),\n        get_and_set_accessor_must_have_the_same_this_type: diag(2682, ts.DiagnosticCategory.Error, \"get_and_set_accessor_must_have_the_same_this_type_2682\", \"'get' and 'set' accessor must have the same 'this' type.\"),\n        this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation: diag(2683, ts.DiagnosticCategory.Error, \"this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683\", \"'this' implicitly has type 'any' because it does not have a type annotation.\"),\n        The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1: diag(2684, ts.DiagnosticCategory.Error, \"The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684\", \"The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'.\"),\n        The_this_types_of_each_signature_are_incompatible: diag(2685, ts.DiagnosticCategory.Error, \"The_this_types_of_each_signature_are_incompatible_2685\", \"The 'this' types of each signature are incompatible.\"),\n        _0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead: diag(2686, ts.DiagnosticCategory.Error, \"_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686\", \"'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead.\"),\n        All_declarations_of_0_must_have_identical_modifiers: diag(2687, ts.DiagnosticCategory.Error, \"All_declarations_of_0_must_have_identical_modifiers_2687\", \"All declarations of '{0}' must have identical modifiers.\"),\n        Cannot_find_type_definition_file_for_0: diag(2688, ts.DiagnosticCategory.Error, \"Cannot_find_type_definition_file_for_0_2688\", \"Cannot find type definition file for '{0}'.\"),\n        Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, ts.DiagnosticCategory.Error, \"Cannot_extend_an_interface_0_Did_you_mean_implements_2689\", \"Cannot extend an interface '{0}'. Did you mean 'implements'?\"),\n        _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, ts.DiagnosticCategory.Error, \"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690\", \"'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?\"),\n        An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: diag(2691, ts.DiagnosticCategory.Error, \"An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691\", \"An import path cannot end with a '{0}' extension. Consider importing '{1}' instead.\"),\n        _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, ts.DiagnosticCategory.Error, \"_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692\", \"'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible.\"),\n        _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, ts.DiagnosticCategory.Error, \"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693\", \"'{0}' only refers to a type, but is being used as a value here.\"),\n        Namespace_0_has_no_exported_member_1: diag(2694, ts.DiagnosticCategory.Error, \"Namespace_0_has_no_exported_member_1_2694\", \"Namespace '{0}' has no exported member '{1}'.\"),\n        Left_side_of_comma_operator_is_unused_and_has_no_side_effects: diag(2695, ts.DiagnosticCategory.Error, \"Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695\", \"Left side of comma operator is unused and has no side effects.\", /*reportsUnnecessary*/ true),\n        The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: diag(2696, ts.DiagnosticCategory.Error, \"The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696\", \"The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?\"),\n        An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: diag(2697, ts.DiagnosticCategory.Error, \"An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697\", \"An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option.\"),\n        Spread_types_may_only_be_created_from_object_types: diag(2698, ts.DiagnosticCategory.Error, \"Spread_types_may_only_be_created_from_object_types_2698\", \"Spread types may only be created from object types.\"),\n        Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1: diag(2699, ts.DiagnosticCategory.Error, \"Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699\", \"Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'.\"),\n        Rest_types_may_only_be_created_from_object_types: diag(2700, ts.DiagnosticCategory.Error, \"Rest_types_may_only_be_created_from_object_types_2700\", \"Rest types may only be created from object types.\"),\n        The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: diag(2701, ts.DiagnosticCategory.Error, \"The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701\", \"The target of an object rest assignment must be a variable or a property access.\"),\n        _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: diag(2702, ts.DiagnosticCategory.Error, \"_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702\", \"'{0}' only refers to a type, but is being used as a namespace here.\"),\n        The_operand_of_a_delete_operator_must_be_a_property_reference: diag(2703, ts.DiagnosticCategory.Error, \"The_operand_of_a_delete_operator_must_be_a_property_reference_2703\", \"The operand of a 'delete' operator must be a property reference.\"),\n        The_operand_of_a_delete_operator_cannot_be_a_read_only_property: diag(2704, ts.DiagnosticCategory.Error, \"The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704\", \"The operand of a 'delete' operator cannot be a read-only property.\"),\n        An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: diag(2705, ts.DiagnosticCategory.Error, \"An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705\", \"An async function or method in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.\"),\n        Required_type_parameters_may_not_follow_optional_type_parameters: diag(2706, ts.DiagnosticCategory.Error, \"Required_type_parameters_may_not_follow_optional_type_parameters_2706\", \"Required type parameters may not follow optional type parameters.\"),\n        Generic_type_0_requires_between_1_and_2_type_arguments: diag(2707, ts.DiagnosticCategory.Error, \"Generic_type_0_requires_between_1_and_2_type_arguments_2707\", \"Generic type '{0}' requires between {1} and {2} type arguments.\"),\n        Cannot_use_namespace_0_as_a_value: diag(2708, ts.DiagnosticCategory.Error, \"Cannot_use_namespace_0_as_a_value_2708\", \"Cannot use namespace '{0}' as a value.\"),\n        Cannot_use_namespace_0_as_a_type: diag(2709, ts.DiagnosticCategory.Error, \"Cannot_use_namespace_0_as_a_type_2709\", \"Cannot use namespace '{0}' as a type.\"),\n        _0_are_specified_twice_The_attribute_named_0_will_be_overwritten: diag(2710, ts.DiagnosticCategory.Error, \"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710\", \"'{0}' are specified twice. The attribute named '{0}' will be overwritten.\"),\n        A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: diag(2711, ts.DiagnosticCategory.Error, \"A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711\", \"A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option.\"),\n        A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: diag(2712, ts.DiagnosticCategory.Error, \"A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declarat_2712\", \"A dynamic import call in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.\"),\n        Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1: diag(2713, ts.DiagnosticCategory.Error, \"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713\", \"Cannot access '{0}.{1}' because '{0}' is a type, but not a namespace. Did you mean to retrieve the type of the property '{1}' in '{0}' with '{0}[\\\"{1}\\\"]'?\"),\n        The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context: diag(2714, ts.DiagnosticCategory.Error, \"The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714\", \"The expression of an export assignment must be an identifier or qualified name in an ambient context.\"),\n        Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor: diag(2715, ts.DiagnosticCategory.Error, \"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715\", \"Abstract property '{0}' in class '{1}' cannot be accessed in the constructor.\"),\n        Type_parameter_0_has_a_circular_default: diag(2716, ts.DiagnosticCategory.Error, \"Type_parameter_0_has_a_circular_default_2716\", \"Type parameter '{0}' has a circular default.\"),\n        Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2: diag(2717, ts.DiagnosticCategory.Error, \"Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717\", \"Subsequent property declarations must have the same type.  Property '{0}' must be of type '{1}', but here has type '{2}'.\"),\n        Duplicate_property_0: diag(2718, ts.DiagnosticCategory.Error, \"Duplicate_property_0_2718\", \"Duplicate property '{0}'.\"),\n        Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: diag(2719, ts.DiagnosticCategory.Error, \"Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719\", \"Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.\"),\n        Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass: diag(2720, ts.DiagnosticCategory.Error, \"Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720\", \"Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?\"),\n        Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, \"Cannot_invoke_an_object_which_is_possibly_null_2721\", \"Cannot invoke an object which is possibly 'null'.\"),\n        Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, \"Cannot_invoke_an_object_which_is_possibly_undefined_2722\", \"Cannot invoke an object which is possibly 'undefined'.\"),\n        Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, \"Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723\", \"Cannot invoke an object which is possibly 'null' or 'undefined'.\"),\n        _0_has_no_exported_member_named_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, \"_0_has_no_exported_member_named_1_Did_you_mean_2_2724\", \"'{0}' has no exported member named '{1}'. Did you mean '{2}'?\"),\n        Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, ts.DiagnosticCategory.Error, \"Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725\", \"Class name cannot be 'Object' when targeting ES5 with module {0}.\"),\n        Cannot_find_lib_definition_for_0: diag(2726, ts.DiagnosticCategory.Error, \"Cannot_find_lib_definition_for_0_2726\", \"Cannot find lib definition for '{0}'.\"),\n        Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, ts.DiagnosticCategory.Error, \"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727\", \"Cannot find lib definition for '{0}'. Did you mean '{1}'?\"),\n        _0_is_declared_here: diag(2728, ts.DiagnosticCategory.Message, \"_0_is_declared_here_2728\", \"'{0}' is declared here.\"),\n        Property_0_is_used_before_its_initialization: diag(2729, ts.DiagnosticCategory.Error, \"Property_0_is_used_before_its_initialization_2729\", \"Property '{0}' is used before its initialization.\"),\n        An_arrow_function_cannot_have_a_this_parameter: diag(2730, ts.DiagnosticCategory.Error, \"An_arrow_function_cannot_have_a_this_parameter_2730\", \"An arrow function cannot have a 'this' parameter.\"),\n        Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, ts.DiagnosticCategory.Error, \"Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731\", \"Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'.\"),\n        Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, \"Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732\", \"Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension.\"),\n        Property_0_was_also_declared_here: diag(2733, ts.DiagnosticCategory.Error, \"Property_0_was_also_declared_here_2733\", \"Property '{0}' was also declared here.\"),\n        Are_you_missing_a_semicolon: diag(2734, ts.DiagnosticCategory.Error, \"Are_you_missing_a_semicolon_2734\", \"Are you missing a semicolon?\"),\n        Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, ts.DiagnosticCategory.Error, \"Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735\", \"Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?\"),\n        Operator_0_cannot_be_applied_to_type_1: diag(2736, ts.DiagnosticCategory.Error, \"Operator_0_cannot_be_applied_to_type_1_2736\", \"Operator '{0}' cannot be applied to type '{1}'.\"),\n        BigInt_literals_are_not_available_when_targeting_lower_than_ES2020: diag(2737, ts.DiagnosticCategory.Error, \"BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737\", \"BigInt literals are not available when targeting lower than ES2020.\"),\n        An_outer_value_of_this_is_shadowed_by_this_container: diag(2738, ts.DiagnosticCategory.Message, \"An_outer_value_of_this_is_shadowed_by_this_container_2738\", \"An outer value of 'this' is shadowed by this container.\"),\n        Type_0_is_missing_the_following_properties_from_type_1_Colon_2: diag(2739, ts.DiagnosticCategory.Error, \"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739\", \"Type '{0}' is missing the following properties from type '{1}': {2}\"),\n        Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more: diag(2740, ts.DiagnosticCategory.Error, \"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740\", \"Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more.\"),\n        Property_0_is_missing_in_type_1_but_required_in_type_2: diag(2741, ts.DiagnosticCategory.Error, \"Property_0_is_missing_in_type_1_but_required_in_type_2_2741\", \"Property '{0}' is missing in type '{1}' but required in type '{2}'.\"),\n        The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary: diag(2742, ts.DiagnosticCategory.Error, \"The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742\", \"The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary.\"),\n        No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments: diag(2743, ts.DiagnosticCategory.Error, \"No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743\", \"No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments.\"),\n        Type_parameter_defaults_can_only_reference_previously_declared_type_parameters: diag(2744, ts.DiagnosticCategory.Error, \"Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744\", \"Type parameter defaults can only reference previously declared type parameters.\"),\n        This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided: diag(2745, ts.DiagnosticCategory.Error, \"This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745\", \"This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided.\"),\n        This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, ts.DiagnosticCategory.Error, \"This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746\", \"This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided.\"),\n        _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, ts.DiagnosticCategory.Error, \"_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747\", \"'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'.\"),\n        Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided: diag(2748, ts.DiagnosticCategory.Error, \"Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748\", \"Cannot access ambient const enums when the '--isolatedModules' flag is provided.\"),\n        _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, ts.DiagnosticCategory.Error, \"_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749\", \"'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?\"),\n        The_implementation_signature_is_declared_here: diag(2750, ts.DiagnosticCategory.Error, \"The_implementation_signature_is_declared_here_2750\", \"The implementation signature is declared here.\"),\n        Circularity_originates_in_type_at_this_location: diag(2751, ts.DiagnosticCategory.Error, \"Circularity_originates_in_type_at_this_location_2751\", \"Circularity originates in type at this location.\"),\n        The_first_export_default_is_here: diag(2752, ts.DiagnosticCategory.Error, \"The_first_export_default_is_here_2752\", \"The first export default is here.\"),\n        Another_export_default_is_here: diag(2753, ts.DiagnosticCategory.Error, \"Another_export_default_is_here_2753\", \"Another export default is here.\"),\n        super_may_not_use_type_arguments: diag(2754, ts.DiagnosticCategory.Error, \"super_may_not_use_type_arguments_2754\", \"'super' may not use type arguments.\"),\n        No_constituent_of_type_0_is_callable: diag(2755, ts.DiagnosticCategory.Error, \"No_constituent_of_type_0_is_callable_2755\", \"No constituent of type '{0}' is callable.\"),\n        Not_all_constituents_of_type_0_are_callable: diag(2756, ts.DiagnosticCategory.Error, \"Not_all_constituents_of_type_0_are_callable_2756\", \"Not all constituents of type '{0}' are callable.\"),\n        Type_0_has_no_call_signatures: diag(2757, ts.DiagnosticCategory.Error, \"Type_0_has_no_call_signatures_2757\", \"Type '{0}' has no call signatures.\"),\n        Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other: diag(2758, ts.DiagnosticCategory.Error, \"Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758\", \"Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other.\"),\n        No_constituent_of_type_0_is_constructable: diag(2759, ts.DiagnosticCategory.Error, \"No_constituent_of_type_0_is_constructable_2759\", \"No constituent of type '{0}' is constructable.\"),\n        Not_all_constituents_of_type_0_are_constructable: diag(2760, ts.DiagnosticCategory.Error, \"Not_all_constituents_of_type_0_are_constructable_2760\", \"Not all constituents of type '{0}' are constructable.\"),\n        Type_0_has_no_construct_signatures: diag(2761, ts.DiagnosticCategory.Error, \"Type_0_has_no_construct_signatures_2761\", \"Type '{0}' has no construct signatures.\"),\n        Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other: diag(2762, ts.DiagnosticCategory.Error, \"Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762\", \"Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other.\"),\n        Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0: diag(2763, ts.DiagnosticCategory.Error, \"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763\", \"Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'.\"),\n        Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0: diag(2764, ts.DiagnosticCategory.Error, \"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764\", \"Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'.\"),\n        Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0: diag(2765, ts.DiagnosticCategory.Error, \"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765\", \"Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'.\"),\n        Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0: diag(2766, ts.DiagnosticCategory.Error, \"Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766\", \"Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'.\"),\n        The_0_property_of_an_iterator_must_be_a_method: diag(2767, ts.DiagnosticCategory.Error, \"The_0_property_of_an_iterator_must_be_a_method_2767\", \"The '{0}' property of an iterator must be a method.\"),\n        The_0_property_of_an_async_iterator_must_be_a_method: diag(2768, ts.DiagnosticCategory.Error, \"The_0_property_of_an_async_iterator_must_be_a_method_2768\", \"The '{0}' property of an async iterator must be a method.\"),\n        No_overload_matches_this_call: diag(2769, ts.DiagnosticCategory.Error, \"No_overload_matches_this_call_2769\", \"No overload matches this call.\"),\n        The_last_overload_gave_the_following_error: diag(2770, ts.DiagnosticCategory.Error, \"The_last_overload_gave_the_following_error_2770\", \"The last overload gave the following error.\"),\n        The_last_overload_is_declared_here: diag(2771, ts.DiagnosticCategory.Error, \"The_last_overload_is_declared_here_2771\", \"The last overload is declared here.\"),\n        Overload_0_of_1_2_gave_the_following_error: diag(2772, ts.DiagnosticCategory.Error, \"Overload_0_of_1_2_gave_the_following_error_2772\", \"Overload {0} of {1}, '{2}', gave the following error.\"),\n        Did_you_forget_to_use_await: diag(2773, ts.DiagnosticCategory.Error, \"Did_you_forget_to_use_await_2773\", \"Did you forget to use 'await'?\"),\n        This_condition_will_always_return_true_since_the_function_is_always_defined_Did_you_mean_to_call_it_instead: diag(2774, ts.DiagnosticCategory.Error, \"This_condition_will_always_return_true_since_the_function_is_always_defined_Did_you_mean_to_call_it__2774\", \"This condition will always return true since the function is always defined. Did you mean to call it instead?\"),\n        Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation: diag(2775, ts.DiagnosticCategory.Error, \"Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775\", \"Assertions require every name in the call target to be declared with an explicit type annotation.\"),\n        Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name: diag(2776, ts.DiagnosticCategory.Error, \"Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776\", \"Assertions require the call target to be an identifier or qualified name.\"),\n        The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access: diag(2777, ts.DiagnosticCategory.Error, \"The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777\", \"The operand of an increment or decrement operator may not be an optional property access.\"),\n        The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access: diag(2778, ts.DiagnosticCategory.Error, \"The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778\", \"The target of an object rest assignment may not be an optional property access.\"),\n        The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access: diag(2779, ts.DiagnosticCategory.Error, \"The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779\", \"The left-hand side of an assignment expression may not be an optional property access.\"),\n        The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access: diag(2780, ts.DiagnosticCategory.Error, \"The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780\", \"The left-hand side of a 'for...in' statement may not be an optional property access.\"),\n        The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access: diag(2781, ts.DiagnosticCategory.Error, \"The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781\", \"The left-hand side of a 'for...of' statement may not be an optional property access.\"),\n        _0_needs_an_explicit_type_annotation: diag(2782, ts.DiagnosticCategory.Message, \"_0_needs_an_explicit_type_annotation_2782\", \"'{0}' needs an explicit type annotation.\"),\n        _0_is_specified_more_than_once_so_this_usage_will_be_overwritten: diag(2783, ts.DiagnosticCategory.Error, \"_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783\", \"'{0}' is specified more than once, so this usage will be overwritten.\"),\n        get_and_set_accessors_cannot_declare_this_parameters: diag(2784, ts.DiagnosticCategory.Error, \"get_and_set_accessors_cannot_declare_this_parameters_2784\", \"'get' and 'set' accessors cannot declare 'this' parameters.\"),\n        This_spread_always_overwrites_this_property: diag(2785, ts.DiagnosticCategory.Error, \"This_spread_always_overwrites_this_property_2785\", \"This spread always overwrites this property.\"),\n        _0_cannot_be_used_as_a_JSX_component: diag(2786, ts.DiagnosticCategory.Error, \"_0_cannot_be_used_as_a_JSX_component_2786\", \"'{0}' cannot be used as a JSX component.\"),\n        Its_return_type_0_is_not_a_valid_JSX_element: diag(2787, ts.DiagnosticCategory.Error, \"Its_return_type_0_is_not_a_valid_JSX_element_2787\", \"Its return type '{0}' is not a valid JSX element.\"),\n        Its_instance_type_0_is_not_a_valid_JSX_element: diag(2788, ts.DiagnosticCategory.Error, \"Its_instance_type_0_is_not_a_valid_JSX_element_2788\", \"Its instance type '{0}' is not a valid JSX element.\"),\n        Its_element_type_0_is_not_a_valid_JSX_element: diag(2789, ts.DiagnosticCategory.Error, \"Its_element_type_0_is_not_a_valid_JSX_element_2789\", \"Its element type '{0}' is not a valid JSX element.\"),\n        The_operand_of_a_delete_operator_must_be_optional: diag(2790, ts.DiagnosticCategory.Error, \"The_operand_of_a_delete_operator_must_be_optional_2790\", \"The operand of a 'delete' operator must be optional.\"),\n        Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later: diag(2791, ts.DiagnosticCategory.Error, \"Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791\", \"Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later.\"),\n        Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option: diag(2792, ts.DiagnosticCategory.Error, \"Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792\", \"Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?\"),\n        The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible: diag(2793, ts.DiagnosticCategory.Error, \"The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793\", \"The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.\"),\n        Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise: diag(2794, ts.DiagnosticCategory.Error, \"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794\", \"Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?\"),\n        The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types: diag(2795, ts.DiagnosticCategory.Error, \"The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795\", \"The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types.\"),\n        It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked: diag(2796, ts.DiagnosticCategory.Error, \"It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796\", \"It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked.\"),\n        A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract: diag(2797, ts.DiagnosticCategory.Error, \"A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797\", \"A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'.\"),\n        The_declaration_was_marked_as_deprecated_here: diag(2798, ts.DiagnosticCategory.Error, \"The_declaration_was_marked_as_deprecated_here_2798\", \"The declaration was marked as deprecated here.\"),\n        Type_produces_a_tuple_type_that_is_too_large_to_represent: diag(2799, ts.DiagnosticCategory.Error, \"Type_produces_a_tuple_type_that_is_too_large_to_represent_2799\", \"Type produces a tuple type that is too large to represent.\"),\n        Expression_produces_a_tuple_type_that_is_too_large_to_represent: diag(2800, ts.DiagnosticCategory.Error, \"Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800\", \"Expression produces a tuple type that is too large to represent.\"),\n        Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, \"Import_declaration_0_is_using_private_name_1_4000\", \"Import declaration '{0}' is using private name '{1}'.\"),\n        Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, \"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002\", \"Type parameter '{0}' of exported class has or is using private name '{1}'.\"),\n        Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, \"Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004\", \"Type parameter '{0}' of exported interface has or is using private name '{1}'.\"),\n        Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4006, ts.DiagnosticCategory.Error, \"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006\", \"Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.\"),\n        Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4008, ts.DiagnosticCategory.Error, \"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008\", \"Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.\"),\n        Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: diag(4010, ts.DiagnosticCategory.Error, \"Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010\", \"Type parameter '{0}' of public static method from exported class has or is using private name '{1}'.\"),\n        Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: diag(4012, ts.DiagnosticCategory.Error, \"Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012\", \"Type parameter '{0}' of public method from exported class has or is using private name '{1}'.\"),\n        Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: diag(4014, ts.DiagnosticCategory.Error, \"Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014\", \"Type parameter '{0}' of method from exported interface has or is using private name '{1}'.\"),\n        Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: diag(4016, ts.DiagnosticCategory.Error, \"Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016\", \"Type parameter '{0}' of exported function has or is using private name '{1}'.\"),\n        Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: diag(4019, ts.DiagnosticCategory.Error, \"Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019\", \"Implements clause of exported class '{0}' has or is using private name '{1}'.\"),\n        extends_clause_of_exported_class_0_has_or_is_using_private_name_1: diag(4020, ts.DiagnosticCategory.Error, \"extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020\", \"'extends' clause of exported class '{0}' has or is using private name '{1}'.\"),\n        extends_clause_of_exported_class_has_or_is_using_private_name_0: diag(4021, ts.DiagnosticCategory.Error, \"extends_clause_of_exported_class_has_or_is_using_private_name_0_4021\", \"'extends' clause of exported class has or is using private name '{0}'.\"),\n        extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: diag(4022, ts.DiagnosticCategory.Error, \"extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022\", \"'extends' clause of exported interface '{0}' has or is using private name '{1}'.\"),\n        Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4023, ts.DiagnosticCategory.Error, \"Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023\", \"Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named.\"),\n        Exported_variable_0_has_or_is_using_name_1_from_private_module_2: diag(4024, ts.DiagnosticCategory.Error, \"Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024\", \"Exported variable '{0}' has or is using name '{1}' from private module '{2}'.\"),\n        Exported_variable_0_has_or_is_using_private_name_1: diag(4025, ts.DiagnosticCategory.Error, \"Exported_variable_0_has_or_is_using_private_name_1_4025\", \"Exported variable '{0}' has or is using private name '{1}'.\"),\n        Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4026, ts.DiagnosticCategory.Error, \"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026\", \"Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named.\"),\n        Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4027, ts.DiagnosticCategory.Error, \"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027\", \"Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'.\"),\n        Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: diag(4028, ts.DiagnosticCategory.Error, \"Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028\", \"Public static property '{0}' of exported class has or is using private name '{1}'.\"),\n        Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4029, ts.DiagnosticCategory.Error, \"Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029\", \"Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named.\"),\n        Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4030, ts.DiagnosticCategory.Error, \"Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030\", \"Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'.\"),\n        Public_property_0_of_exported_class_has_or_is_using_private_name_1: diag(4031, ts.DiagnosticCategory.Error, \"Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031\", \"Public property '{0}' of exported class has or is using private name '{1}'.\"),\n        Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4032, ts.DiagnosticCategory.Error, \"Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032\", \"Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'.\"),\n        Property_0_of_exported_interface_has_or_is_using_private_name_1: diag(4033, ts.DiagnosticCategory.Error, \"Property_0_of_exported_interface_has_or_is_using_private_name_1_4033\", \"Property '{0}' of exported interface has or is using private name '{1}'.\"),\n        Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4034, ts.DiagnosticCategory.Error, \"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034\", \"Parameter type of public static setter '{0}' from exported class has or is using name '{1}' from private module '{2}'.\"),\n        Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1: diag(4035, ts.DiagnosticCategory.Error, \"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035\", \"Parameter type of public static setter '{0}' from exported class has or is using private name '{1}'.\"),\n        Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4036, ts.DiagnosticCategory.Error, \"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036\", \"Parameter type of public setter '{0}' from exported class has or is using name '{1}' from private module '{2}'.\"),\n        Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1: diag(4037, ts.DiagnosticCategory.Error, \"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037\", \"Parameter type of public setter '{0}' from exported class has or is using private name '{1}'.\"),\n        Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4038, ts.DiagnosticCategory.Error, \"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038\", \"Return type of public static getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named.\"),\n        Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4039, ts.DiagnosticCategory.Error, \"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039\", \"Return type of public static getter '{0}' from exported class has or is using name '{1}' from private module '{2}'.\"),\n        Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1: diag(4040, ts.DiagnosticCategory.Error, \"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040\", \"Return type of public static getter '{0}' from exported class has or is using private name '{1}'.\"),\n        Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4041, ts.DiagnosticCategory.Error, \"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041\", \"Return type of public getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named.\"),\n        Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4042, ts.DiagnosticCategory.Error, \"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042\", \"Return type of public getter '{0}' from exported class has or is using name '{1}' from private module '{2}'.\"),\n        Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1: diag(4043, ts.DiagnosticCategory.Error, \"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043\", \"Return type of public getter '{0}' from exported class has or is using private name '{1}'.\"),\n        Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4044, ts.DiagnosticCategory.Error, \"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044\", \"Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'.\"),\n        Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: diag(4045, ts.DiagnosticCategory.Error, \"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045\", \"Return type of constructor signature from exported interface has or is using private name '{0}'.\"),\n        Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4046, ts.DiagnosticCategory.Error, \"Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046\", \"Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'.\"),\n        Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: diag(4047, ts.DiagnosticCategory.Error, \"Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047\", \"Return type of call signature from exported interface has or is using private name '{0}'.\"),\n        Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4048, ts.DiagnosticCategory.Error, \"Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048\", \"Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'.\"),\n        Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: diag(4049, ts.DiagnosticCategory.Error, \"Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049\", \"Return type of index signature from exported interface has or is using private name '{0}'.\"),\n        Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: diag(4050, ts.DiagnosticCategory.Error, \"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050\", \"Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named.\"),\n        Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: diag(4051, ts.DiagnosticCategory.Error, \"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051\", \"Return type of public static method from exported class has or is using name '{0}' from private module '{1}'.\"),\n        Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: diag(4052, ts.DiagnosticCategory.Error, \"Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052\", \"Return type of public static method from exported class has or is using private name '{0}'.\"),\n        Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: diag(4053, ts.DiagnosticCategory.Error, \"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053\", \"Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named.\"),\n        Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: diag(4054, ts.DiagnosticCategory.Error, \"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054\", \"Return type of public method from exported class has or is using name '{0}' from private module '{1}'.\"),\n        Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: diag(4055, ts.DiagnosticCategory.Error, \"Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055\", \"Return type of public method from exported class has or is using private name '{0}'.\"),\n        Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4056, ts.DiagnosticCategory.Error, \"Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056\", \"Return type of method from exported interface has or is using name '{0}' from private module '{1}'.\"),\n        Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: diag(4057, ts.DiagnosticCategory.Error, \"Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057\", \"Return type of method from exported interface has or is using private name '{0}'.\"),\n        Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: diag(4058, ts.DiagnosticCategory.Error, \"Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058\", \"Return type of exported function has or is using name '{0}' from external module {1} but cannot be named.\"),\n        Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: diag(4059, ts.DiagnosticCategory.Error, \"Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059\", \"Return type of exported function has or is using name '{0}' from private module '{1}'.\"),\n        Return_type_of_exported_function_has_or_is_using_private_name_0: diag(4060, ts.DiagnosticCategory.Error, \"Return_type_of_exported_function_has_or_is_using_private_name_0_4060\", \"Return type of exported function has or is using private name '{0}'.\"),\n        Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4061, ts.DiagnosticCategory.Error, \"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061\", \"Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named.\"),\n        Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4062, ts.DiagnosticCategory.Error, \"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062\", \"Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'.\"),\n        Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: diag(4063, ts.DiagnosticCategory.Error, \"Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063\", \"Parameter '{0}' of constructor from exported class has or is using private name '{1}'.\"),\n        Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4064, ts.DiagnosticCategory.Error, \"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064\", \"Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'.\"),\n        Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4065, ts.DiagnosticCategory.Error, \"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065\", \"Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.\"),\n        Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4066, ts.DiagnosticCategory.Error, \"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066\", \"Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'.\"),\n        Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4067, ts.DiagnosticCategory.Error, \"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067\", \"Parameter '{0}' of call signature from exported interface has or is using private name '{1}'.\"),\n        Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4068, ts.DiagnosticCategory.Error, \"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068\", \"Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named.\"),\n        Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4069, ts.DiagnosticCategory.Error, \"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069\", \"Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'.\"),\n        Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: diag(4070, ts.DiagnosticCategory.Error, \"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070\", \"Parameter '{0}' of public static method from exported class has or is using private name '{1}'.\"),\n        Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4071, ts.DiagnosticCategory.Error, \"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071\", \"Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named.\"),\n        Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4072, ts.DiagnosticCategory.Error, \"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072\", \"Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'.\"),\n        Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: diag(4073, ts.DiagnosticCategory.Error, \"Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073\", \"Parameter '{0}' of public method from exported class has or is using private name '{1}'.\"),\n        Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4074, ts.DiagnosticCategory.Error, \"Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074\", \"Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'.\"),\n        Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: diag(4075, ts.DiagnosticCategory.Error, \"Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075\", \"Parameter '{0}' of method from exported interface has or is using private name '{1}'.\"),\n        Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4076, ts.DiagnosticCategory.Error, \"Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076\", \"Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named.\"),\n        Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: diag(4077, ts.DiagnosticCategory.Error, \"Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077\", \"Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'.\"),\n        Parameter_0_of_exported_function_has_or_is_using_private_name_1: diag(4078, ts.DiagnosticCategory.Error, \"Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078\", \"Parameter '{0}' of exported function has or is using private name '{1}'.\"),\n        Exported_type_alias_0_has_or_is_using_private_name_1: diag(4081, ts.DiagnosticCategory.Error, \"Exported_type_alias_0_has_or_is_using_private_name_1_4081\", \"Exported type alias '{0}' has or is using private name '{1}'.\"),\n        Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, ts.DiagnosticCategory.Error, \"Default_export_of_the_module_has_or_is_using_private_name_0_4082\", \"Default export of the module has or is using private name '{0}'.\"),\n        Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, ts.DiagnosticCategory.Error, \"Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083\", \"Type parameter '{0}' of exported type alias has or is using private name '{1}'.\"),\n        Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: diag(4084, ts.DiagnosticCategory.Error, \"Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084\", \"Exported type alias '{0}' has or is using private name '{1}' from module {2}.\"),\n        Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, ts.DiagnosticCategory.Error, \"Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090\", \"Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict.\"),\n        Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, ts.DiagnosticCategory.Error, \"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091\", \"Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'.\"),\n        Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, ts.DiagnosticCategory.Error, \"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092\", \"Parameter '{0}' of index signature from exported interface has or is using private name '{1}'.\"),\n        Property_0_of_exported_class_expression_may_not_be_private_or_protected: diag(4094, ts.DiagnosticCategory.Error, \"Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094\", \"Property '{0}' of exported class expression may not be private or protected.\"),\n        Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4095, ts.DiagnosticCategory.Error, \"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095\", \"Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named.\"),\n        Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4096, ts.DiagnosticCategory.Error, \"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096\", \"Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'.\"),\n        Public_static_method_0_of_exported_class_has_or_is_using_private_name_1: diag(4097, ts.DiagnosticCategory.Error, \"Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097\", \"Public static method '{0}' of exported class has or is using private name '{1}'.\"),\n        Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4098, ts.DiagnosticCategory.Error, \"Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098\", \"Public method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named.\"),\n        Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4099, ts.DiagnosticCategory.Error, \"Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099\", \"Public method '{0}' of exported class has or is using name '{1}' from private module '{2}'.\"),\n        Public_method_0_of_exported_class_has_or_is_using_private_name_1: diag(4100, ts.DiagnosticCategory.Error, \"Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100\", \"Public method '{0}' of exported class has or is using private name '{1}'.\"),\n        Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4101, ts.DiagnosticCategory.Error, \"Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101\", \"Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'.\"),\n        Method_0_of_exported_interface_has_or_is_using_private_name_1: diag(4102, ts.DiagnosticCategory.Error, \"Method_0_of_exported_interface_has_or_is_using_private_name_1_4102\", \"Method '{0}' of exported interface has or is using private name '{1}'.\"),\n        Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1: diag(4103, ts.DiagnosticCategory.Error, \"Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103\", \"Type parameter '{0}' of exported mapped object type is using private name '{1}'.\"),\n        The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1: diag(4104, ts.DiagnosticCategory.Error, \"The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104\", \"The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'.\"),\n        Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter: diag(4105, ts.DiagnosticCategory.Error, \"Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105\", \"Private or protected member '{0}' cannot be accessed on a type parameter.\"),\n        Parameter_0_of_accessor_has_or_is_using_private_name_1: diag(4106, ts.DiagnosticCategory.Error, \"Parameter_0_of_accessor_has_or_is_using_private_name_1_4106\", \"Parameter '{0}' of accessor has or is using private name '{1}'.\"),\n        Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2: diag(4107, ts.DiagnosticCategory.Error, \"Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107\", \"Parameter '{0}' of accessor has or is using name '{1}' from private module '{2}'.\"),\n        Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4108, ts.DiagnosticCategory.Error, \"Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108\", \"Parameter '{0}' of accessor has or is using name '{1}' from external module '{2}' but cannot be named.\"),\n        Type_arguments_for_0_circularly_reference_themselves: diag(4109, ts.DiagnosticCategory.Error, \"Type_arguments_for_0_circularly_reference_themselves_4109\", \"Type arguments for '{0}' circularly reference themselves.\"),\n        Tuple_type_arguments_circularly_reference_themselves: diag(4110, ts.DiagnosticCategory.Error, \"Tuple_type_arguments_circularly_reference_themselves_4110\", \"Tuple type arguments circularly reference themselves.\"),\n        Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0: diag(4111, ts.DiagnosticCategory.Error, \"Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111\", \"Property '{0}' comes from an index signature, so it must be accessed with ['{0}'].\"),\n        The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, \"The_current_host_does_not_support_the_0_option_5001\", \"The current host does not support the '{0}' option.\"),\n        Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, \"Cannot_find_the_common_subdirectory_path_for_the_input_files_5009\", \"Cannot find the common subdirectory path for the input files.\"),\n        File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, \"File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010\", \"File specification cannot end in a recursive directory wildcard ('**'): '{0}'.\"),\n        Cannot_read_file_0_Colon_1: diag(5012, ts.DiagnosticCategory.Error, \"Cannot_read_file_0_Colon_1_5012\", \"Cannot read file '{0}': {1}.\"),\n        Failed_to_parse_file_0_Colon_1: diag(5014, ts.DiagnosticCategory.Error, \"Failed_to_parse_file_0_Colon_1_5014\", \"Failed to parse file '{0}': {1}.\"),\n        Unknown_compiler_option_0: diag(5023, ts.DiagnosticCategory.Error, \"Unknown_compiler_option_0_5023\", \"Unknown compiler option '{0}'.\"),\n        Compiler_option_0_requires_a_value_of_type_1: diag(5024, ts.DiagnosticCategory.Error, \"Compiler_option_0_requires_a_value_of_type_1_5024\", \"Compiler option '{0}' requires a value of type {1}.\"),\n        Unknown_compiler_option_0_Did_you_mean_1: diag(5025, ts.DiagnosticCategory.Error, \"Unknown_compiler_option_0_Did_you_mean_1_5025\", \"Unknown compiler option '{0}'. Did you mean '{1}'?\"),\n        Could_not_write_file_0_Colon_1: diag(5033, ts.DiagnosticCategory.Error, \"Could_not_write_file_0_Colon_1_5033\", \"Could not write file '{0}': {1}.\"),\n        Option_project_cannot_be_mixed_with_source_files_on_a_command_line: diag(5042, ts.DiagnosticCategory.Error, \"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042\", \"Option 'project' cannot be mixed with source files on a command line.\"),\n        Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher: diag(5047, ts.DiagnosticCategory.Error, \"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047\", \"Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher.\"),\n        Option_0_cannot_be_specified_when_option_target_is_ES3: diag(5048, ts.DiagnosticCategory.Error, \"Option_0_cannot_be_specified_when_option_target_is_ES3_5048\", \"Option '{0}' cannot be specified when option 'target' is 'ES3'.\"),\n        Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: diag(5051, ts.DiagnosticCategory.Error, \"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051\", \"Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.\"),\n        Option_0_cannot_be_specified_without_specifying_option_1: diag(5052, ts.DiagnosticCategory.Error, \"Option_0_cannot_be_specified_without_specifying_option_1_5052\", \"Option '{0}' cannot be specified without specifying option '{1}'.\"),\n        Option_0_cannot_be_specified_with_option_1: diag(5053, ts.DiagnosticCategory.Error, \"Option_0_cannot_be_specified_with_option_1_5053\", \"Option '{0}' cannot be specified with option '{1}'.\"),\n        A_tsconfig_json_file_is_already_defined_at_Colon_0: diag(5054, ts.DiagnosticCategory.Error, \"A_tsconfig_json_file_is_already_defined_at_Colon_0_5054\", \"A 'tsconfig.json' file is already defined at: '{0}'.\"),\n        Cannot_write_file_0_because_it_would_overwrite_input_file: diag(5055, ts.DiagnosticCategory.Error, \"Cannot_write_file_0_because_it_would_overwrite_input_file_5055\", \"Cannot write file '{0}' because it would overwrite input file.\"),\n        Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: diag(5056, ts.DiagnosticCategory.Error, \"Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056\", \"Cannot write file '{0}' because it would be overwritten by multiple input files.\"),\n        Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: diag(5057, ts.DiagnosticCategory.Error, \"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057\", \"Cannot find a tsconfig.json file at the specified directory: '{0}'.\"),\n        The_specified_path_does_not_exist_Colon_0: diag(5058, ts.DiagnosticCategory.Error, \"The_specified_path_does_not_exist_Colon_0_5058\", \"The specified path does not exist: '{0}'.\"),\n        Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: diag(5059, ts.DiagnosticCategory.Error, \"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059\", \"Invalid value for '--reactNamespace'. '{0}' is not a valid identifier.\"),\n        Pattern_0_can_have_at_most_one_Asterisk_character: diag(5061, ts.DiagnosticCategory.Error, \"Pattern_0_can_have_at_most_one_Asterisk_character_5061\", \"Pattern '{0}' can have at most one '*' character.\"),\n        Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character: diag(5062, ts.DiagnosticCategory.Error, \"Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062\", \"Substitution '{0}' in pattern '{1}' can have at most one '*' character.\"),\n        Substitutions_for_pattern_0_should_be_an_array: diag(5063, ts.DiagnosticCategory.Error, \"Substitutions_for_pattern_0_should_be_an_array_5063\", \"Substitutions for pattern '{0}' should be an array.\"),\n        Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: diag(5064, ts.DiagnosticCategory.Error, \"Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064\", \"Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'.\"),\n        File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5065, ts.DiagnosticCategory.Error, \"File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065\", \"File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'.\"),\n        Substitutions_for_pattern_0_shouldn_t_be_an_empty_array: diag(5066, ts.DiagnosticCategory.Error, \"Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066\", \"Substitutions for pattern '{0}' shouldn't be an empty array.\"),\n        Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name: diag(5067, ts.DiagnosticCategory.Error, \"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067\", \"Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name.\"),\n        Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: diag(5068, ts.DiagnosticCategory.Error, \"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068\", \"Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.\"),\n        Option_0_cannot_be_specified_without_specifying_option_1_or_option_2: diag(5069, ts.DiagnosticCategory.Error, \"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069\", \"Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'.\"),\n        Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy: diag(5070, ts.DiagnosticCategory.Error, \"Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070\", \"Option '--resolveJsonModule' cannot be specified without 'node' module resolution strategy.\"),\n        Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext: diag(5071, ts.DiagnosticCategory.Error, \"Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071\", \"Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs', 'amd', 'es2015' or 'esNext'.\"),\n        Unknown_build_option_0: diag(5072, ts.DiagnosticCategory.Error, \"Unknown_build_option_0_5072\", \"Unknown build option '{0}'.\"),\n        Build_option_0_requires_a_value_of_type_1: diag(5073, ts.DiagnosticCategory.Error, \"Build_option_0_requires_a_value_of_type_1_5073\", \"Build option '{0}' requires a value of type {1}.\"),\n        Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified: diag(5074, ts.DiagnosticCategory.Error, \"Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074\", \"Option '--incremental' can only be specified using tsconfig, emitting to single file or when option `--tsBuildInfoFile` is specified.\"),\n        _0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2: diag(5075, ts.DiagnosticCategory.Error, \"_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075\", \"'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'.\"),\n        _0_and_1_operations_cannot_be_mixed_without_parentheses: diag(5076, ts.DiagnosticCategory.Error, \"_0_and_1_operations_cannot_be_mixed_without_parentheses_5076\", \"'{0}' and '{1}' operations cannot be mixed without parentheses.\"),\n        Unknown_build_option_0_Did_you_mean_1: diag(5077, ts.DiagnosticCategory.Error, \"Unknown_build_option_0_Did_you_mean_1_5077\", \"Unknown build option '{0}'. Did you mean '{1}'?\"),\n        Unknown_watch_option_0: diag(5078, ts.DiagnosticCategory.Error, \"Unknown_watch_option_0_5078\", \"Unknown watch option '{0}'.\"),\n        Unknown_watch_option_0_Did_you_mean_1: diag(5079, ts.DiagnosticCategory.Error, \"Unknown_watch_option_0_Did_you_mean_1_5079\", \"Unknown watch option '{0}'. Did you mean '{1}'?\"),\n        Watch_option_0_requires_a_value_of_type_1: diag(5080, ts.DiagnosticCategory.Error, \"Watch_option_0_requires_a_value_of_type_1_5080\", \"Watch option '{0}' requires a value of type {1}.\"),\n        Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0: diag(5081, ts.DiagnosticCategory.Error, \"Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081\", \"Cannot find a tsconfig.json file at the current directory: {0}.\"),\n        _0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1: diag(5082, ts.DiagnosticCategory.Error, \"_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082\", \"'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'.\"),\n        Cannot_read_file_0: diag(5083, ts.DiagnosticCategory.Error, \"Cannot_read_file_0_5083\", \"Cannot read file '{0}'.\"),\n        Tuple_members_must_all_have_names_or_all_not_have_names: diag(5084, ts.DiagnosticCategory.Error, \"Tuple_members_must_all_have_names_or_all_not_have_names_5084\", \"Tuple members must all have names or all not have names.\"),\n        A_tuple_member_cannot_be_both_optional_and_rest: diag(5085, ts.DiagnosticCategory.Error, \"A_tuple_member_cannot_be_both_optional_and_rest_5085\", \"A tuple member cannot be both optional and rest.\"),\n        A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type: diag(5086, ts.DiagnosticCategory.Error, \"A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086\", \"A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type.\"),\n        A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type: diag(5087, ts.DiagnosticCategory.Error, \"A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087\", \"A labeled tuple element is declared as rest with a `...` before the name, rather than before the type.\"),\n        The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, ts.DiagnosticCategory.Error, \"The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088\", \"The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary.\"),\n        Option_0_cannot_be_specified_when_option_jsx_is_1: diag(5089, ts.DiagnosticCategory.Error, \"Option_0_cannot_be_specified_when_option_jsx_is_1_5089\", \"Option '{0}' cannot be specified when option 'jsx' is '{1}'.\"),\n        Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: diag(5090, ts.DiagnosticCategory.Error, \"Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090\", \"Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?\"),\n        Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled: diag(5091, ts.DiagnosticCategory.Error, \"Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled_5091\", \"Option 'preserveConstEnums' cannot be disabled when 'isolatedModules' is enabled.\"),\n        Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6000, ts.DiagnosticCategory.Message, \"Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000\", \"Generates a sourcemap for each corresponding '.d.ts' file.\"),\n        Concatenate_and_emit_output_to_single_file: diag(6001, ts.DiagnosticCategory.Message, \"Concatenate_and_emit_output_to_single_file_6001\", \"Concatenate and emit output to single file.\"),\n        Generates_corresponding_d_ts_file: diag(6002, ts.DiagnosticCategory.Message, \"Generates_corresponding_d_ts_file_6002\", \"Generates corresponding '.d.ts' file.\"),\n        Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: diag(6003, ts.DiagnosticCategory.Message, \"Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003\", \"Specify the location where debugger should locate map files instead of generated locations.\"),\n        Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: diag(6004, ts.DiagnosticCategory.Message, \"Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004\", \"Specify the location where debugger should locate TypeScript files instead of source locations.\"),\n        Watch_input_files: diag(6005, ts.DiagnosticCategory.Message, \"Watch_input_files_6005\", \"Watch input files.\"),\n        Redirect_output_structure_to_the_directory: diag(6006, ts.DiagnosticCategory.Message, \"Redirect_output_structure_to_the_directory_6006\", \"Redirect output structure to the directory.\"),\n        Do_not_erase_const_enum_declarations_in_generated_code: diag(6007, ts.DiagnosticCategory.Message, \"Do_not_erase_const_enum_declarations_in_generated_code_6007\", \"Do not erase const enum declarations in generated code.\"),\n        Do_not_emit_outputs_if_any_errors_were_reported: diag(6008, ts.DiagnosticCategory.Message, \"Do_not_emit_outputs_if_any_errors_were_reported_6008\", \"Do not emit outputs if any errors were reported.\"),\n        Do_not_emit_comments_to_output: diag(6009, ts.DiagnosticCategory.Message, \"Do_not_emit_comments_to_output_6009\", \"Do not emit comments to output.\"),\n        Do_not_emit_outputs: diag(6010, ts.DiagnosticCategory.Message, \"Do_not_emit_outputs_6010\", \"Do not emit outputs.\"),\n        Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, ts.DiagnosticCategory.Message, \"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011\", \"Allow default imports from modules with no default export. This does not affect code emit, just typechecking.\"),\n        Skip_type_checking_of_declaration_files: diag(6012, ts.DiagnosticCategory.Message, \"Skip_type_checking_of_declaration_files_6012\", \"Skip type checking of declaration files.\"),\n        Do_not_resolve_the_real_path_of_symlinks: diag(6013, ts.DiagnosticCategory.Message, \"Do_not_resolve_the_real_path_of_symlinks_6013\", \"Do not resolve the real path of symlinks.\"),\n        Only_emit_d_ts_declaration_files: diag(6014, ts.DiagnosticCategory.Message, \"Only_emit_d_ts_declaration_files_6014\", \"Only emit '.d.ts' declaration files.\"),\n        Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_ES2019_ES2020_or_ESNEXT: diag(6015, ts.DiagnosticCategory.Message, \"Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_ES2019_ES2020_or_6015\", \"Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'.\"),\n        Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_es2020_or_ESNext: diag(6016, ts.DiagnosticCategory.Message, \"Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_es2020_or_ESNext_6016\", \"Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'.\"),\n        Print_this_message: diag(6017, ts.DiagnosticCategory.Message, \"Print_this_message_6017\", \"Print this message.\"),\n        Print_the_compiler_s_version: diag(6019, ts.DiagnosticCategory.Message, \"Print_the_compiler_s_version_6019\", \"Print the compiler's version.\"),\n        Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json: diag(6020, ts.DiagnosticCategory.Message, \"Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020\", \"Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'.\"),\n        Syntax_Colon_0: diag(6023, ts.DiagnosticCategory.Message, \"Syntax_Colon_0_6023\", \"Syntax: {0}\"),\n        options: diag(6024, ts.DiagnosticCategory.Message, \"options_6024\", \"options\"),\n        file: diag(6025, ts.DiagnosticCategory.Message, \"file_6025\", \"file\"),\n        Examples_Colon_0: diag(6026, ts.DiagnosticCategory.Message, \"Examples_Colon_0_6026\", \"Examples: {0}\"),\n        Options_Colon: diag(6027, ts.DiagnosticCategory.Message, \"Options_Colon_6027\", \"Options:\"),\n        Version_0: diag(6029, ts.DiagnosticCategory.Message, \"Version_0_6029\", \"Version {0}\"),\n        Insert_command_line_options_and_files_from_a_file: diag(6030, ts.DiagnosticCategory.Message, \"Insert_command_line_options_and_files_from_a_file_6030\", \"Insert command line options and files from a file.\"),\n        Starting_compilation_in_watch_mode: diag(6031, ts.DiagnosticCategory.Message, \"Starting_compilation_in_watch_mode_6031\", \"Starting compilation in watch mode...\"),\n        File_change_detected_Starting_incremental_compilation: diag(6032, ts.DiagnosticCategory.Message, \"File_change_detected_Starting_incremental_compilation_6032\", \"File change detected. Starting incremental compilation...\"),\n        KIND: diag(6034, ts.DiagnosticCategory.Message, \"KIND_6034\", \"KIND\"),\n        FILE: diag(6035, ts.DiagnosticCategory.Message, \"FILE_6035\", \"FILE\"),\n        VERSION: diag(6036, ts.DiagnosticCategory.Message, \"VERSION_6036\", \"VERSION\"),\n        LOCATION: diag(6037, ts.DiagnosticCategory.Message, \"LOCATION_6037\", \"LOCATION\"),\n        DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, \"DIRECTORY_6038\", \"DIRECTORY\"),\n        STRATEGY: diag(6039, ts.DiagnosticCategory.Message, \"STRATEGY_6039\", \"STRATEGY\"),\n        FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, \"FILE_OR_DIRECTORY_6040\", \"FILE OR DIRECTORY\"),\n        Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, \"Generates_corresponding_map_file_6043\", \"Generates corresponding '.map' file.\"),\n        Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, \"Compiler_option_0_expects_an_argument_6044\", \"Compiler option '{0}' expects an argument.\"),\n        Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, \"Unterminated_quoted_string_in_response_file_0_6045\", \"Unterminated quoted string in response file '{0}'.\"),\n        Argument_for_0_option_must_be_Colon_1: diag(6046, ts.DiagnosticCategory.Error, \"Argument_for_0_option_must_be_Colon_1_6046\", \"Argument for '{0}' option must be: {1}.\"),\n        Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: diag(6048, ts.DiagnosticCategory.Error, \"Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048\", \"Locale must be of the form <language> or <language>-<territory>. For example '{0}' or '{1}'.\"),\n        Unsupported_locale_0: diag(6049, ts.DiagnosticCategory.Error, \"Unsupported_locale_0_6049\", \"Unsupported locale '{0}'.\"),\n        Unable_to_open_file_0: diag(6050, ts.DiagnosticCategory.Error, \"Unable_to_open_file_0_6050\", \"Unable to open file '{0}'.\"),\n        Corrupted_locale_file_0: diag(6051, ts.DiagnosticCategory.Error, \"Corrupted_locale_file_0_6051\", \"Corrupted locale file {0}.\"),\n        Raise_error_on_expressions_and_declarations_with_an_implied_any_type: diag(6052, ts.DiagnosticCategory.Message, \"Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052\", \"Raise error on expressions and declarations with an implied 'any' type.\"),\n        File_0_not_found: diag(6053, ts.DiagnosticCategory.Error, \"File_0_not_found_6053\", \"File '{0}' not found.\"),\n        File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1: diag(6054, ts.DiagnosticCategory.Error, \"File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054\", \"File '{0}' has an unsupported extension. The only supported extensions are {1}.\"),\n        Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: diag(6055, ts.DiagnosticCategory.Message, \"Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055\", \"Suppress noImplicitAny errors for indexing objects lacking index signatures.\"),\n        Do_not_emit_declarations_for_code_that_has_an_internal_annotation: diag(6056, ts.DiagnosticCategory.Message, \"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056\", \"Do not emit declarations for code that has an '@internal' annotation.\"),\n        Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: diag(6058, ts.DiagnosticCategory.Message, \"Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058\", \"Specify the root directory of input files. Use to control the output directory structure with --outDir.\"),\n        File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: diag(6059, ts.DiagnosticCategory.Error, \"File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059\", \"File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files.\"),\n        Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: diag(6060, ts.DiagnosticCategory.Message, \"Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060\", \"Specify the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix).\"),\n        NEWLINE: diag(6061, ts.DiagnosticCategory.Message, \"NEWLINE_6061\", \"NEWLINE\"),\n        Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line: diag(6064, ts.DiagnosticCategory.Error, \"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064\", \"Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line.\"),\n        Enables_experimental_support_for_ES7_decorators: diag(6065, ts.DiagnosticCategory.Message, \"Enables_experimental_support_for_ES7_decorators_6065\", \"Enables experimental support for ES7 decorators.\"),\n        Enables_experimental_support_for_emitting_type_metadata_for_decorators: diag(6066, ts.DiagnosticCategory.Message, \"Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066\", \"Enables experimental support for emitting type metadata for decorators.\"),\n        Enables_experimental_support_for_ES7_async_functions: diag(6068, ts.DiagnosticCategory.Message, \"Enables_experimental_support_for_ES7_async_functions_6068\", \"Enables experimental support for ES7 async functions.\"),\n        Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6: diag(6069, ts.DiagnosticCategory.Message, \"Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069\", \"Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6).\"),\n        Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: diag(6070, ts.DiagnosticCategory.Message, \"Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070\", \"Initializes a TypeScript project and creates a tsconfig.json file.\"),\n        Successfully_created_a_tsconfig_json_file: diag(6071, ts.DiagnosticCategory.Message, \"Successfully_created_a_tsconfig_json_file_6071\", \"Successfully created a tsconfig.json file.\"),\n        Suppress_excess_property_checks_for_object_literals: diag(6072, ts.DiagnosticCategory.Message, \"Suppress_excess_property_checks_for_object_literals_6072\", \"Suppress excess property checks for object literals.\"),\n        Stylize_errors_and_messages_using_color_and_context_experimental: diag(6073, ts.DiagnosticCategory.Message, \"Stylize_errors_and_messages_using_color_and_context_experimental_6073\", \"Stylize errors and messages using color and context (experimental).\"),\n        Do_not_report_errors_on_unused_labels: diag(6074, ts.DiagnosticCategory.Message, \"Do_not_report_errors_on_unused_labels_6074\", \"Do not report errors on unused labels.\"),\n        Report_error_when_not_all_code_paths_in_function_return_a_value: diag(6075, ts.DiagnosticCategory.Message, \"Report_error_when_not_all_code_paths_in_function_return_a_value_6075\", \"Report error when not all code paths in function return a value.\"),\n        Report_errors_for_fallthrough_cases_in_switch_statement: diag(6076, ts.DiagnosticCategory.Message, \"Report_errors_for_fallthrough_cases_in_switch_statement_6076\", \"Report errors for fallthrough cases in switch statement.\"),\n        Do_not_report_errors_on_unreachable_code: diag(6077, ts.DiagnosticCategory.Message, \"Do_not_report_errors_on_unreachable_code_6077\", \"Do not report errors on unreachable code.\"),\n        Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, ts.DiagnosticCategory.Message, \"Disallow_inconsistently_cased_references_to_the_same_file_6078\", \"Disallow inconsistently-cased references to the same file.\"),\n        Specify_library_files_to_be_included_in_the_compilation: diag(6079, ts.DiagnosticCategory.Message, \"Specify_library_files_to_be_included_in_the_compilation_6079\", \"Specify library files to be included in the compilation.\"),\n        Specify_JSX_code_generation_Colon_preserve_react_native_react_react_jsx_or_react_jsxdev: diag(6080, ts.DiagnosticCategory.Message, \"Specify_JSX_code_generation_Colon_preserve_react_native_react_react_jsx_or_react_jsxdev_6080\", \"Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'.\"),\n        File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, ts.DiagnosticCategory.Message, \"File_0_has_an_unsupported_extension_so_skipping_it_6081\", \"File '{0}' has an unsupported extension, so skipping it.\"),\n        Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, ts.DiagnosticCategory.Error, \"Only_amd_and_system_modules_are_supported_alongside_0_6082\", \"Only 'amd' and 'system' modules are supported alongside --{0}.\"),\n        Base_directory_to_resolve_non_absolute_module_names: diag(6083, ts.DiagnosticCategory.Message, \"Base_directory_to_resolve_non_absolute_module_names_6083\", \"Base directory to resolve non-absolute module names.\"),\n        Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: diag(6084, ts.DiagnosticCategory.Message, \"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084\", \"[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit\"),\n        Enable_tracing_of_the_name_resolution_process: diag(6085, ts.DiagnosticCategory.Message, \"Enable_tracing_of_the_name_resolution_process_6085\", \"Enable tracing of the name resolution process.\"),\n        Resolving_module_0_from_1: diag(6086, ts.DiagnosticCategory.Message, \"Resolving_module_0_from_1_6086\", \"======== Resolving module '{0}' from '{1}'. ========\"),\n        Explicitly_specified_module_resolution_kind_Colon_0: diag(6087, ts.DiagnosticCategory.Message, \"Explicitly_specified_module_resolution_kind_Colon_0_6087\", \"Explicitly specified module resolution kind: '{0}'.\"),\n        Module_resolution_kind_is_not_specified_using_0: diag(6088, ts.DiagnosticCategory.Message, \"Module_resolution_kind_is_not_specified_using_0_6088\", \"Module resolution kind is not specified, using '{0}'.\"),\n        Module_name_0_was_successfully_resolved_to_1: diag(6089, ts.DiagnosticCategory.Message, \"Module_name_0_was_successfully_resolved_to_1_6089\", \"======== Module name '{0}' was successfully resolved to '{1}'. ========\"),\n        Module_name_0_was_not_resolved: diag(6090, ts.DiagnosticCategory.Message, \"Module_name_0_was_not_resolved_6090\", \"======== Module name '{0}' was not resolved. ========\"),\n        paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0: diag(6091, ts.DiagnosticCategory.Message, \"paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091\", \"'paths' option is specified, looking for a pattern to match module name '{0}'.\"),\n        Module_name_0_matched_pattern_1: diag(6092, ts.DiagnosticCategory.Message, \"Module_name_0_matched_pattern_1_6092\", \"Module name '{0}', matched pattern '{1}'.\"),\n        Trying_substitution_0_candidate_module_location_Colon_1: diag(6093, ts.DiagnosticCategory.Message, \"Trying_substitution_0_candidate_module_location_Colon_1_6093\", \"Trying substitution '{0}', candidate module location: '{1}'.\"),\n        Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, ts.DiagnosticCategory.Message, \"Resolving_module_name_0_relative_to_base_url_1_2_6094\", \"Resolving module name '{0}' relative to base url '{1}' - '{2}'.\"),\n        Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1: diag(6095, ts.DiagnosticCategory.Message, \"Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095\", \"Loading module as file / folder, candidate module location '{0}', target file type '{1}'.\"),\n        File_0_does_not_exist: diag(6096, ts.DiagnosticCategory.Message, \"File_0_does_not_exist_6096\", \"File '{0}' does not exist.\"),\n        File_0_exist_use_it_as_a_name_resolution_result: diag(6097, ts.DiagnosticCategory.Message, \"File_0_exist_use_it_as_a_name_resolution_result_6097\", \"File '{0}' exist - use it as a name resolution result.\"),\n        Loading_module_0_from_node_modules_folder_target_file_type_1: diag(6098, ts.DiagnosticCategory.Message, \"Loading_module_0_from_node_modules_folder_target_file_type_1_6098\", \"Loading module '{0}' from 'node_modules' folder, target file type '{1}'.\"),\n        Found_package_json_at_0: diag(6099, ts.DiagnosticCategory.Message, \"Found_package_json_at_0_6099\", \"Found 'package.json' at '{0}'.\"),\n        package_json_does_not_have_a_0_field: diag(6100, ts.DiagnosticCategory.Message, \"package_json_does_not_have_a_0_field_6100\", \"'package.json' does not have a '{0}' field.\"),\n        package_json_has_0_field_1_that_references_2: diag(6101, ts.DiagnosticCategory.Message, \"package_json_has_0_field_1_that_references_2_6101\", \"'package.json' has '{0}' field '{1}' that references '{2}'.\"),\n        Allow_javascript_files_to_be_compiled: diag(6102, ts.DiagnosticCategory.Message, \"Allow_javascript_files_to_be_compiled_6102\", \"Allow javascript files to be compiled.\"),\n        Option_0_should_have_array_of_strings_as_a_value: diag(6103, ts.DiagnosticCategory.Error, \"Option_0_should_have_array_of_strings_as_a_value_6103\", \"Option '{0}' should have array of strings as a value.\"),\n        Checking_if_0_is_the_longest_matching_prefix_for_1_2: diag(6104, ts.DiagnosticCategory.Message, \"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104\", \"Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'.\"),\n        Expected_type_of_0_field_in_package_json_to_be_1_got_2: diag(6105, ts.DiagnosticCategory.Message, \"Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105\", \"Expected type of '{0}' field in 'package.json' to be '{1}', got '{2}'.\"),\n        baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: diag(6106, ts.DiagnosticCategory.Message, \"baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106\", \"'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'.\"),\n        rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: diag(6107, ts.DiagnosticCategory.Message, \"rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107\", \"'rootDirs' option is set, using it to resolve relative module name '{0}'.\"),\n        Longest_matching_prefix_for_0_is_1: diag(6108, ts.DiagnosticCategory.Message, \"Longest_matching_prefix_for_0_is_1_6108\", \"Longest matching prefix for '{0}' is '{1}'.\"),\n        Loading_0_from_the_root_dir_1_candidate_location_2: diag(6109, ts.DiagnosticCategory.Message, \"Loading_0_from_the_root_dir_1_candidate_location_2_6109\", \"Loading '{0}' from the root dir '{1}', candidate location '{2}'.\"),\n        Trying_other_entries_in_rootDirs: diag(6110, ts.DiagnosticCategory.Message, \"Trying_other_entries_in_rootDirs_6110\", \"Trying other entries in 'rootDirs'.\"),\n        Module_resolution_using_rootDirs_has_failed: diag(6111, ts.DiagnosticCategory.Message, \"Module_resolution_using_rootDirs_has_failed_6111\", \"Module resolution using 'rootDirs' has failed.\"),\n        Do_not_emit_use_strict_directives_in_module_output: diag(6112, ts.DiagnosticCategory.Message, \"Do_not_emit_use_strict_directives_in_module_output_6112\", \"Do not emit 'use strict' directives in module output.\"),\n        Enable_strict_null_checks: diag(6113, ts.DiagnosticCategory.Message, \"Enable_strict_null_checks_6113\", \"Enable strict null checks.\"),\n        Unknown_option_excludes_Did_you_mean_exclude: diag(6114, ts.DiagnosticCategory.Error, \"Unknown_option_excludes_Did_you_mean_exclude_6114\", \"Unknown option 'excludes'. Did you mean 'exclude'?\"),\n        Raise_error_on_this_expressions_with_an_implied_any_type: diag(6115, ts.DiagnosticCategory.Message, \"Raise_error_on_this_expressions_with_an_implied_any_type_6115\", \"Raise error on 'this' expressions with an implied 'any' type.\"),\n        Resolving_type_reference_directive_0_containing_file_1_root_directory_2: diag(6116, ts.DiagnosticCategory.Message, \"Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116\", \"======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========\"),\n        Resolving_using_primary_search_paths: diag(6117, ts.DiagnosticCategory.Message, \"Resolving_using_primary_search_paths_6117\", \"Resolving using primary search paths...\"),\n        Resolving_from_node_modules_folder: diag(6118, ts.DiagnosticCategory.Message, \"Resolving_from_node_modules_folder_6118\", \"Resolving from node_modules folder...\"),\n        Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: diag(6119, ts.DiagnosticCategory.Message, \"Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119\", \"======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========\"),\n        Type_reference_directive_0_was_not_resolved: diag(6120, ts.DiagnosticCategory.Message, \"Type_reference_directive_0_was_not_resolved_6120\", \"======== Type reference directive '{0}' was not resolved. ========\"),\n        Resolving_with_primary_search_path_0: diag(6121, ts.DiagnosticCategory.Message, \"Resolving_with_primary_search_path_0_6121\", \"Resolving with primary search path '{0}'.\"),\n        Root_directory_cannot_be_determined_skipping_primary_search_paths: diag(6122, ts.DiagnosticCategory.Message, \"Root_directory_cannot_be_determined_skipping_primary_search_paths_6122\", \"Root directory cannot be determined, skipping primary search paths.\"),\n        Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set: diag(6123, ts.DiagnosticCategory.Message, \"Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123\", \"======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========\"),\n        Type_declaration_files_to_be_included_in_compilation: diag(6124, ts.DiagnosticCategory.Message, \"Type_declaration_files_to_be_included_in_compilation_6124\", \"Type declaration files to be included in compilation.\"),\n        Looking_up_in_node_modules_folder_initial_location_0: diag(6125, ts.DiagnosticCategory.Message, \"Looking_up_in_node_modules_folder_initial_location_0_6125\", \"Looking up in 'node_modules' folder, initial location '{0}'.\"),\n        Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder: diag(6126, ts.DiagnosticCategory.Message, \"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126\", \"Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder.\"),\n        Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1: diag(6127, ts.DiagnosticCategory.Message, \"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127\", \"======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========\"),\n        Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: diag(6128, ts.DiagnosticCategory.Message, \"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128\", \"======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========\"),\n        Resolving_real_path_for_0_result_1: diag(6130, ts.DiagnosticCategory.Message, \"Resolving_real_path_for_0_result_1_6130\", \"Resolving real path for '{0}', result '{1}'.\"),\n        Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: diag(6131, ts.DiagnosticCategory.Error, \"Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131\", \"Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'.\"),\n        File_name_0_has_a_1_extension_stripping_it: diag(6132, ts.DiagnosticCategory.Message, \"File_name_0_has_a_1_extension_stripping_it_6132\", \"File name '{0}' has a '{1}' extension - stripping it.\"),\n        _0_is_declared_but_its_value_is_never_read: diag(6133, ts.DiagnosticCategory.Error, \"_0_is_declared_but_its_value_is_never_read_6133\", \"'{0}' is declared but its value is never read.\", /*reportsUnnecessary*/ true),\n        Report_errors_on_unused_locals: diag(6134, ts.DiagnosticCategory.Message, \"Report_errors_on_unused_locals_6134\", \"Report errors on unused locals.\"),\n        Report_errors_on_unused_parameters: diag(6135, ts.DiagnosticCategory.Message, \"Report_errors_on_unused_parameters_6135\", \"Report errors on unused parameters.\"),\n        The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: diag(6136, ts.DiagnosticCategory.Message, \"The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136\", \"The maximum dependency depth to search under node_modules and load JavaScript files.\"),\n        Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1: diag(6137, ts.DiagnosticCategory.Error, \"Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137\", \"Cannot import type declaration files. Consider importing '{0}' instead of '{1}'.\"),\n        Property_0_is_declared_but_its_value_is_never_read: diag(6138, ts.DiagnosticCategory.Error, \"Property_0_is_declared_but_its_value_is_never_read_6138\", \"Property '{0}' is declared but its value is never read.\", /*reportsUnnecessary*/ true),\n        Import_emit_helpers_from_tslib: diag(6139, ts.DiagnosticCategory.Message, \"Import_emit_helpers_from_tslib_6139\", \"Import emit helpers from 'tslib'.\"),\n        Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2: diag(6140, ts.DiagnosticCategory.Error, \"Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140\", \"Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'.\"),\n        Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: diag(6141, ts.DiagnosticCategory.Message, \"Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141\", \"Parse in strict mode and emit \\\"use strict\\\" for each source file.\"),\n        Module_0_was_resolved_to_1_but_jsx_is_not_set: diag(6142, ts.DiagnosticCategory.Error, \"Module_0_was_resolved_to_1_but_jsx_is_not_set_6142\", \"Module '{0}' was resolved to '{1}', but '--jsx' is not set.\"),\n        Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: diag(6144, ts.DiagnosticCategory.Message, \"Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144\", \"Module '{0}' was resolved as locally declared ambient module in file '{1}'.\"),\n        Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified: diag(6145, ts.DiagnosticCategory.Message, \"Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145\", \"Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified.\"),\n        Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h: diag(6146, ts.DiagnosticCategory.Message, \"Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146\", \"Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'.\"),\n        Resolution_for_module_0_was_found_in_cache_from_location_1: diag(6147, ts.DiagnosticCategory.Message, \"Resolution_for_module_0_was_found_in_cache_from_location_1_6147\", \"Resolution for module '{0}' was found in cache from location '{1}'.\"),\n        Directory_0_does_not_exist_skipping_all_lookups_in_it: diag(6148, ts.DiagnosticCategory.Message, \"Directory_0_does_not_exist_skipping_all_lookups_in_it_6148\", \"Directory '{0}' does not exist, skipping all lookups in it.\"),\n        Show_diagnostic_information: diag(6149, ts.DiagnosticCategory.Message, \"Show_diagnostic_information_6149\", \"Show diagnostic information.\"),\n        Show_verbose_diagnostic_information: diag(6150, ts.DiagnosticCategory.Message, \"Show_verbose_diagnostic_information_6150\", \"Show verbose diagnostic information.\"),\n        Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file: diag(6151, ts.DiagnosticCategory.Message, \"Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151\", \"Emit a single file with source maps instead of having a separate file.\"),\n        Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set: diag(6152, ts.DiagnosticCategory.Message, \"Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152\", \"Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set.\"),\n        Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule: diag(6153, ts.DiagnosticCategory.Message, \"Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153\", \"Transpile each file as a separate module (similar to 'ts.transpileModule').\"),\n        Print_names_of_generated_files_part_of_the_compilation: diag(6154, ts.DiagnosticCategory.Message, \"Print_names_of_generated_files_part_of_the_compilation_6154\", \"Print names of generated files part of the compilation.\"),\n        Print_names_of_files_part_of_the_compilation: diag(6155, ts.DiagnosticCategory.Message, \"Print_names_of_files_part_of_the_compilation_6155\", \"Print names of files part of the compilation.\"),\n        The_locale_used_when_displaying_messages_to_the_user_e_g_en_us: diag(6156, ts.DiagnosticCategory.Message, \"The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156\", \"The locale used when displaying messages to the user (e.g. 'en-us')\"),\n        Do_not_generate_custom_helper_functions_like_extends_in_compiled_output: diag(6157, ts.DiagnosticCategory.Message, \"Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157\", \"Do not generate custom helper functions like '__extends' in compiled output.\"),\n        Do_not_include_the_default_library_file_lib_d_ts: diag(6158, ts.DiagnosticCategory.Message, \"Do_not_include_the_default_library_file_lib_d_ts_6158\", \"Do not include the default library file (lib.d.ts).\"),\n        Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files: diag(6159, ts.DiagnosticCategory.Message, \"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159\", \"Do not add triple-slash references or imported modules to the list of compiled files.\"),\n        Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files: diag(6160, ts.DiagnosticCategory.Message, \"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160\", \"[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files.\"),\n        List_of_folders_to_include_type_definitions_from: diag(6161, ts.DiagnosticCategory.Message, \"List_of_folders_to_include_type_definitions_from_6161\", \"List of folders to include type definitions from.\"),\n        Disable_size_limitations_on_JavaScript_projects: diag(6162, ts.DiagnosticCategory.Message, \"Disable_size_limitations_on_JavaScript_projects_6162\", \"Disable size limitations on JavaScript projects.\"),\n        The_character_set_of_the_input_files: diag(6163, ts.DiagnosticCategory.Message, \"The_character_set_of_the_input_files_6163\", \"The character set of the input files.\"),\n        Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: diag(6164, ts.DiagnosticCategory.Message, \"Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6164\", \"Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.\"),\n        Do_not_truncate_error_messages: diag(6165, ts.DiagnosticCategory.Message, \"Do_not_truncate_error_messages_6165\", \"Do not truncate error messages.\"),\n        Output_directory_for_generated_declaration_files: diag(6166, ts.DiagnosticCategory.Message, \"Output_directory_for_generated_declaration_files_6166\", \"Output directory for generated declaration files.\"),\n        A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl: diag(6167, ts.DiagnosticCategory.Message, \"A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167\", \"A series of entries which re-map imports to lookup locations relative to the 'baseUrl'.\"),\n        List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime: diag(6168, ts.DiagnosticCategory.Message, \"List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168\", \"List of root folders whose combined content represents the structure of the project at runtime.\"),\n        Show_all_compiler_options: diag(6169, ts.DiagnosticCategory.Message, \"Show_all_compiler_options_6169\", \"Show all compiler options.\"),\n        Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file: diag(6170, ts.DiagnosticCategory.Message, \"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170\", \"[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file\"),\n        Command_line_Options: diag(6171, ts.DiagnosticCategory.Message, \"Command_line_Options_6171\", \"Command-line Options\"),\n        Basic_Options: diag(6172, ts.DiagnosticCategory.Message, \"Basic_Options_6172\", \"Basic Options\"),\n        Strict_Type_Checking_Options: diag(6173, ts.DiagnosticCategory.Message, \"Strict_Type_Checking_Options_6173\", \"Strict Type-Checking Options\"),\n        Module_Resolution_Options: diag(6174, ts.DiagnosticCategory.Message, \"Module_Resolution_Options_6174\", \"Module Resolution Options\"),\n        Source_Map_Options: diag(6175, ts.DiagnosticCategory.Message, \"Source_Map_Options_6175\", \"Source Map Options\"),\n        Additional_Checks: diag(6176, ts.DiagnosticCategory.Message, \"Additional_Checks_6176\", \"Additional Checks\"),\n        Experimental_Options: diag(6177, ts.DiagnosticCategory.Message, \"Experimental_Options_6177\", \"Experimental Options\"),\n        Advanced_Options: diag(6178, ts.DiagnosticCategory.Message, \"Advanced_Options_6178\", \"Advanced Options\"),\n        Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3: diag(6179, ts.DiagnosticCategory.Message, \"Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179\", \"Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'.\"),\n        Enable_all_strict_type_checking_options: diag(6180, ts.DiagnosticCategory.Message, \"Enable_all_strict_type_checking_options_6180\", \"Enable all strict type-checking options.\"),\n        List_of_language_service_plugins: diag(6181, ts.DiagnosticCategory.Message, \"List_of_language_service_plugins_6181\", \"List of language service plugins.\"),\n        Scoped_package_detected_looking_in_0: diag(6182, ts.DiagnosticCategory.Message, \"Scoped_package_detected_looking_in_0_6182\", \"Scoped package detected, looking in '{0}'\"),\n        Reusing_resolution_of_module_0_to_file_1_from_old_program: diag(6183, ts.DiagnosticCategory.Message, \"Reusing_resolution_of_module_0_to_file_1_from_old_program_6183\", \"Reusing resolution of module '{0}' to file '{1}' from old program.\"),\n        Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program: diag(6184, ts.DiagnosticCategory.Message, \"Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program_6184\", \"Reusing module resolutions originating in '{0}' since resolutions are unchanged from old program.\"),\n        Disable_strict_checking_of_generic_signatures_in_function_types: diag(6185, ts.DiagnosticCategory.Message, \"Disable_strict_checking_of_generic_signatures_in_function_types_6185\", \"Disable strict checking of generic signatures in function types.\"),\n        Enable_strict_checking_of_function_types: diag(6186, ts.DiagnosticCategory.Message, \"Enable_strict_checking_of_function_types_6186\", \"Enable strict checking of function types.\"),\n        Enable_strict_checking_of_property_initialization_in_classes: diag(6187, ts.DiagnosticCategory.Message, \"Enable_strict_checking_of_property_initialization_in_classes_6187\", \"Enable strict checking of property initialization in classes.\"),\n        Numeric_separators_are_not_allowed_here: diag(6188, ts.DiagnosticCategory.Error, \"Numeric_separators_are_not_allowed_here_6188\", \"Numeric separators are not allowed here.\"),\n        Multiple_consecutive_numeric_separators_are_not_permitted: diag(6189, ts.DiagnosticCategory.Error, \"Multiple_consecutive_numeric_separators_are_not_permitted_6189\", \"Multiple consecutive numeric separators are not permitted.\"),\n        Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen: diag(6191, ts.DiagnosticCategory.Message, \"Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191\", \"Whether to keep outdated console output in watch mode instead of clearing the screen.\"),\n        All_imports_in_import_declaration_are_unused: diag(6192, ts.DiagnosticCategory.Error, \"All_imports_in_import_declaration_are_unused_6192\", \"All imports in import declaration are unused.\", /*reportsUnnecessary*/ true),\n        Found_1_error_Watching_for_file_changes: diag(6193, ts.DiagnosticCategory.Message, \"Found_1_error_Watching_for_file_changes_6193\", \"Found 1 error. Watching for file changes.\"),\n        Found_0_errors_Watching_for_file_changes: diag(6194, ts.DiagnosticCategory.Message, \"Found_0_errors_Watching_for_file_changes_6194\", \"Found {0} errors. Watching for file changes.\"),\n        Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols: diag(6195, ts.DiagnosticCategory.Message, \"Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195\", \"Resolve 'keyof' to string valued property names only (no numbers or symbols).\"),\n        _0_is_declared_but_never_used: diag(6196, ts.DiagnosticCategory.Error, \"_0_is_declared_but_never_used_6196\", \"'{0}' is declared but never used.\", /*reportsUnnecessary*/ true),\n        Include_modules_imported_with_json_extension: diag(6197, ts.DiagnosticCategory.Message, \"Include_modules_imported_with_json_extension_6197\", \"Include modules imported with '.json' extension\"),\n        All_destructured_elements_are_unused: diag(6198, ts.DiagnosticCategory.Error, \"All_destructured_elements_are_unused_6198\", \"All destructured elements are unused.\", /*reportsUnnecessary*/ true),\n        All_variables_are_unused: diag(6199, ts.DiagnosticCategory.Error, \"All_variables_are_unused_6199\", \"All variables are unused.\", /*reportsUnnecessary*/ true),\n        Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0: diag(6200, ts.DiagnosticCategory.Error, \"Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200\", \"Definitions of the following identifiers conflict with those in another file: {0}\"),\n        Conflicts_are_in_this_file: diag(6201, ts.DiagnosticCategory.Message, \"Conflicts_are_in_this_file_6201\", \"Conflicts are in this file.\"),\n        Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, ts.DiagnosticCategory.Error, \"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202\", \"Project references may not form a circular graph. Cycle detected: {0}\"),\n        _0_was_also_declared_here: diag(6203, ts.DiagnosticCategory.Message, \"_0_was_also_declared_here_6203\", \"'{0}' was also declared here.\"),\n        and_here: diag(6204, ts.DiagnosticCategory.Message, \"and_here_6204\", \"and here.\"),\n        All_type_parameters_are_unused: diag(6205, ts.DiagnosticCategory.Error, \"All_type_parameters_are_unused_6205\", \"All type parameters are unused.\"),\n        package_json_has_a_typesVersions_field_with_version_specific_path_mappings: diag(6206, ts.DiagnosticCategory.Message, \"package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206\", \"'package.json' has a 'typesVersions' field with version-specific path mappings.\"),\n        package_json_does_not_have_a_typesVersions_entry_that_matches_version_0: diag(6207, ts.DiagnosticCategory.Message, \"package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207\", \"'package.json' does not have a 'typesVersions' entry that matches version '{0}'.\"),\n        package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2: diag(6208, ts.DiagnosticCategory.Message, \"package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208\", \"'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'.\"),\n        package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range: diag(6209, ts.DiagnosticCategory.Message, \"package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209\", \"'package.json' has a 'typesVersions' entry '{0}' that is not a valid semver range.\"),\n        An_argument_for_0_was_not_provided: diag(6210, ts.DiagnosticCategory.Message, \"An_argument_for_0_was_not_provided_6210\", \"An argument for '{0}' was not provided.\"),\n        An_argument_matching_this_binding_pattern_was_not_provided: diag(6211, ts.DiagnosticCategory.Message, \"An_argument_matching_this_binding_pattern_was_not_provided_6211\", \"An argument matching this binding pattern was not provided.\"),\n        Did_you_mean_to_call_this_expression: diag(6212, ts.DiagnosticCategory.Message, \"Did_you_mean_to_call_this_expression_6212\", \"Did you mean to call this expression?\"),\n        Did_you_mean_to_use_new_with_this_expression: diag(6213, ts.DiagnosticCategory.Message, \"Did_you_mean_to_use_new_with_this_expression_6213\", \"Did you mean to use 'new' with this expression?\"),\n        Enable_strict_bind_call_and_apply_methods_on_functions: diag(6214, ts.DiagnosticCategory.Message, \"Enable_strict_bind_call_and_apply_methods_on_functions_6214\", \"Enable strict 'bind', 'call', and 'apply' methods on functions.\"),\n        Using_compiler_options_of_project_reference_redirect_0: diag(6215, ts.DiagnosticCategory.Message, \"Using_compiler_options_of_project_reference_redirect_0_6215\", \"Using compiler options of project reference redirect '{0}'.\"),\n        Found_1_error: diag(6216, ts.DiagnosticCategory.Message, \"Found_1_error_6216\", \"Found 1 error.\"),\n        Found_0_errors: diag(6217, ts.DiagnosticCategory.Message, \"Found_0_errors_6217\", \"Found {0} errors.\"),\n        Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2: diag(6218, ts.DiagnosticCategory.Message, \"Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218\", \"======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========\"),\n        Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3: diag(6219, ts.DiagnosticCategory.Message, \"Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219\", \"======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========\"),\n        package_json_had_a_falsy_0_field: diag(6220, ts.DiagnosticCategory.Message, \"package_json_had_a_falsy_0_field_6220\", \"'package.json' had a falsy '{0}' field.\"),\n        Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects: diag(6221, ts.DiagnosticCategory.Message, \"Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221\", \"Disable use of source files instead of declaration files from referenced projects.\"),\n        Emit_class_fields_with_Define_instead_of_Set: diag(6222, ts.DiagnosticCategory.Message, \"Emit_class_fields_with_Define_instead_of_Set_6222\", \"Emit class fields with Define instead of Set.\"),\n        Generates_a_CPU_profile: diag(6223, ts.DiagnosticCategory.Message, \"Generates_a_CPU_profile_6223\", \"Generates a CPU profile.\"),\n        Disable_solution_searching_for_this_project: diag(6224, ts.DiagnosticCategory.Message, \"Disable_solution_searching_for_this_project_6224\", \"Disable solution searching for this project.\"),\n        Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_UseFsEvents_UseFsEventsOnParentDirectory: diag(6225, ts.DiagnosticCategory.Message, \"Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225\", \"Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'.\"),\n        Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling: diag(6226, ts.DiagnosticCategory.Message, \"Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226\", \"Specify strategy for watching directory on platforms that don't support recursive watching natively: 'UseFsEvents' (default), 'FixedPollingInterval', 'DynamicPriorityPolling'.\"),\n        Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority: diag(6227, ts.DiagnosticCategory.Message, \"Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227\", \"Specify strategy for creating a polling watch when it fails to create using file system events: 'FixedInterval' (default), 'PriorityInterval', 'DynamicPriority'.\"),\n        Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively: diag(6228, ts.DiagnosticCategory.Message, \"Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228\", \"Synchronously call callbacks and update the state of directory watchers on platforms that don't support recursive watching natively.\"),\n        Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3: diag(6229, ts.DiagnosticCategory.Error, \"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229\", \"Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'.\"),\n        Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line: diag(6230, ts.DiagnosticCategory.Error, \"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230\", \"Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line.\"),\n        Could_not_resolve_the_path_0_with_the_extensions_Colon_1: diag(6231, ts.DiagnosticCategory.Error, \"Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231\", \"Could not resolve the path '{0}' with the extensions: {1}.\"),\n        Declaration_augments_declaration_in_another_file_This_cannot_be_serialized: diag(6232, ts.DiagnosticCategory.Error, \"Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232\", \"Declaration augments declaration in another file. This cannot be serialized.\"),\n        This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file: diag(6233, ts.DiagnosticCategory.Error, \"This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233\", \"This is the declaration being augmented. Consider moving the augmenting declaration into the same file.\"),\n        This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without: diag(6234, ts.DiagnosticCategory.Error, \"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234\", \"This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?\"),\n        Disable_loading_referenced_projects: diag(6235, ts.DiagnosticCategory.Message, \"Disable_loading_referenced_projects_6235\", \"Disable loading referenced projects.\"),\n        Arguments_for_the_rest_parameter_0_were_not_provided: diag(6236, ts.DiagnosticCategory.Error, \"Arguments_for_the_rest_parameter_0_were_not_provided_6236\", \"Arguments for the rest parameter '{0}' were not provided.\"),\n        Generates_an_event_trace_and_a_list_of_types: diag(6237, ts.DiagnosticCategory.Message, \"Generates_an_event_trace_and_a_list_of_types_6237\", \"Generates an event trace and a list of types.\"),\n        Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react: diag(6238, ts.DiagnosticCategory.Error, \"Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238\", \"Specify the module specifier to be used to import the `jsx` and `jsxs` factory functions from. eg, react\"),\n        Projects_to_reference: diag(6300, ts.DiagnosticCategory.Message, \"Projects_to_reference_6300\", \"Projects to reference\"),\n        Enable_project_compilation: diag(6302, ts.DiagnosticCategory.Message, \"Enable_project_compilation_6302\", \"Enable project compilation\"),\n        Composite_projects_may_not_disable_declaration_emit: diag(6304, ts.DiagnosticCategory.Error, \"Composite_projects_may_not_disable_declaration_emit_6304\", \"Composite projects may not disable declaration emit.\"),\n        Output_file_0_has_not_been_built_from_source_file_1: diag(6305, ts.DiagnosticCategory.Error, \"Output_file_0_has_not_been_built_from_source_file_1_6305\", \"Output file '{0}' has not been built from source file '{1}'.\"),\n        Referenced_project_0_must_have_setting_composite_Colon_true: diag(6306, ts.DiagnosticCategory.Error, \"Referenced_project_0_must_have_setting_composite_Colon_true_6306\", \"Referenced project '{0}' must have setting \\\"composite\\\": true.\"),\n        File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern: diag(6307, ts.DiagnosticCategory.Error, \"File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307\", \"File '{0}' is not listed within the file list of project '{1}'. Projects must list all files or use an 'include' pattern.\"),\n        Cannot_prepend_project_0_because_it_does_not_have_outFile_set: diag(6308, ts.DiagnosticCategory.Error, \"Cannot_prepend_project_0_because_it_does_not_have_outFile_set_6308\", \"Cannot prepend project '{0}' because it does not have 'outFile' set\"),\n        Output_file_0_from_project_1_does_not_exist: diag(6309, ts.DiagnosticCategory.Error, \"Output_file_0_from_project_1_does_not_exist_6309\", \"Output file '{0}' from project '{1}' does not exist\"),\n        Referenced_project_0_may_not_disable_emit: diag(6310, ts.DiagnosticCategory.Error, \"Referenced_project_0_may_not_disable_emit_6310\", \"Referenced project '{0}' may not disable emit.\"),\n        Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2: diag(6350, ts.DiagnosticCategory.Message, \"Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350\", \"Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'\"),\n        Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2: diag(6351, ts.DiagnosticCategory.Message, \"Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351\", \"Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'\"),\n        Project_0_is_out_of_date_because_output_file_1_does_not_exist: diag(6352, ts.DiagnosticCategory.Message, \"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352\", \"Project '{0}' is out of date because output file '{1}' does not exist\"),\n        Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date: diag(6353, ts.DiagnosticCategory.Message, \"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353\", \"Project '{0}' is out of date because its dependency '{1}' is out of date\"),\n        Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies: diag(6354, ts.DiagnosticCategory.Message, \"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354\", \"Project '{0}' is up to date with .d.ts files from its dependencies\"),\n        Projects_in_this_build_Colon_0: diag(6355, ts.DiagnosticCategory.Message, \"Projects_in_this_build_Colon_0_6355\", \"Projects in this build: {0}\"),\n        A_non_dry_build_would_delete_the_following_files_Colon_0: diag(6356, ts.DiagnosticCategory.Message, \"A_non_dry_build_would_delete_the_following_files_Colon_0_6356\", \"A non-dry build would delete the following files: {0}\"),\n        A_non_dry_build_would_build_project_0: diag(6357, ts.DiagnosticCategory.Message, \"A_non_dry_build_would_build_project_0_6357\", \"A non-dry build would build project '{0}'\"),\n        Building_project_0: diag(6358, ts.DiagnosticCategory.Message, \"Building_project_0_6358\", \"Building project '{0}'...\"),\n        Updating_output_timestamps_of_project_0: diag(6359, ts.DiagnosticCategory.Message, \"Updating_output_timestamps_of_project_0_6359\", \"Updating output timestamps of project '{0}'...\"),\n        delete_this_Project_0_is_up_to_date_because_it_was_previously_built: diag(6360, ts.DiagnosticCategory.Message, \"delete_this_Project_0_is_up_to_date_because_it_was_previously_built_6360\", \"delete this - Project '{0}' is up to date because it was previously built\"),\n        Project_0_is_up_to_date: diag(6361, ts.DiagnosticCategory.Message, \"Project_0_is_up_to_date_6361\", \"Project '{0}' is up to date\"),\n        Skipping_build_of_project_0_because_its_dependency_1_has_errors: diag(6362, ts.DiagnosticCategory.Message, \"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362\", \"Skipping build of project '{0}' because its dependency '{1}' has errors\"),\n        Project_0_can_t_be_built_because_its_dependency_1_has_errors: diag(6363, ts.DiagnosticCategory.Message, \"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363\", \"Project '{0}' can't be built because its dependency '{1}' has errors\"),\n        Build_one_or_more_projects_and_their_dependencies_if_out_of_date: diag(6364, ts.DiagnosticCategory.Message, \"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364\", \"Build one or more projects and their dependencies, if out of date\"),\n        Delete_the_outputs_of_all_projects: diag(6365, ts.DiagnosticCategory.Message, \"Delete_the_outputs_of_all_projects_6365\", \"Delete the outputs of all projects\"),\n        Enable_verbose_logging: diag(6366, ts.DiagnosticCategory.Message, \"Enable_verbose_logging_6366\", \"Enable verbose logging\"),\n        Show_what_would_be_built_or_deleted_if_specified_with_clean: diag(6367, ts.DiagnosticCategory.Message, \"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367\", \"Show what would be built (or deleted, if specified with '--clean')\"),\n        Build_all_projects_including_those_that_appear_to_be_up_to_date: diag(6368, ts.DiagnosticCategory.Message, \"Build_all_projects_including_those_that_appear_to_be_up_to_date_6368\", \"Build all projects, including those that appear to be up to date\"),\n        Option_build_must_be_the_first_command_line_argument: diag(6369, ts.DiagnosticCategory.Error, \"Option_build_must_be_the_first_command_line_argument_6369\", \"Option '--build' must be the first command line argument.\"),\n        Options_0_and_1_cannot_be_combined: diag(6370, ts.DiagnosticCategory.Error, \"Options_0_and_1_cannot_be_combined_6370\", \"Options '{0}' and '{1}' cannot be combined.\"),\n        Updating_unchanged_output_timestamps_of_project_0: diag(6371, ts.DiagnosticCategory.Message, \"Updating_unchanged_output_timestamps_of_project_0_6371\", \"Updating unchanged output timestamps of project '{0}'...\"),\n        Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed: diag(6372, ts.DiagnosticCategory.Message, \"Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372\", \"Project '{0}' is out of date because output of its dependency '{1}' has changed\"),\n        Updating_output_of_project_0: diag(6373, ts.DiagnosticCategory.Message, \"Updating_output_of_project_0_6373\", \"Updating output of project '{0}'...\"),\n        A_non_dry_build_would_update_timestamps_for_output_of_project_0: diag(6374, ts.DiagnosticCategory.Message, \"A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374\", \"A non-dry build would update timestamps for output of project '{0}'\"),\n        A_non_dry_build_would_update_output_of_project_0: diag(6375, ts.DiagnosticCategory.Message, \"A_non_dry_build_would_update_output_of_project_0_6375\", \"A non-dry build would update output of project '{0}'\"),\n        Cannot_update_output_of_project_0_because_there_was_error_reading_file_1: diag(6376, ts.DiagnosticCategory.Message, \"Cannot_update_output_of_project_0_because_there_was_error_reading_file_1_6376\", \"Cannot update output of project '{0}' because there was error reading file '{1}'\"),\n        Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1: diag(6377, ts.DiagnosticCategory.Error, \"Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377\", \"Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'\"),\n        Enable_incremental_compilation: diag(6378, ts.DiagnosticCategory.Message, \"Enable_incremental_compilation_6378\", \"Enable incremental compilation\"),\n        Composite_projects_may_not_disable_incremental_compilation: diag(6379, ts.DiagnosticCategory.Error, \"Composite_projects_may_not_disable_incremental_compilation_6379\", \"Composite projects may not disable incremental compilation.\"),\n        Specify_file_to_store_incremental_compilation_information: diag(6380, ts.DiagnosticCategory.Message, \"Specify_file_to_store_incremental_compilation_information_6380\", \"Specify file to store incremental compilation information\"),\n        Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2: diag(6381, ts.DiagnosticCategory.Message, \"Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381\", \"Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'\"),\n        Skipping_build_of_project_0_because_its_dependency_1_was_not_built: diag(6382, ts.DiagnosticCategory.Message, \"Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382\", \"Skipping build of project '{0}' because its dependency '{1}' was not built\"),\n        Project_0_can_t_be_built_because_its_dependency_1_was_not_built: diag(6383, ts.DiagnosticCategory.Message, \"Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383\", \"Project '{0}' can't be built because its dependency '{1}' was not built\"),\n        Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6384, ts.DiagnosticCategory.Message, \"Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384\", \"Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it.\"),\n        _0_is_deprecated: diag(6385, ts.DiagnosticCategory.Suggestion, \"_0_is_deprecated_6385\", \"'{0}' is deprecated.\", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ undefined, /*reportsDeprecated*/ true),\n        Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found: diag(6386, ts.DiagnosticCategory.Message, \"Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386\", \"Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found.\"),\n        The_signature_0_of_1_is_deprecated: diag(6387, ts.DiagnosticCategory.Suggestion, \"The_signature_0_of_1_is_deprecated_6387\", \"The signature '{0}' of '{1}' is deprecated.\", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ undefined, /*reportsDeprecated*/ true),\n        The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, ts.DiagnosticCategory.Message, \"The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500\", \"The expected type comes from property '{0}' which is declared here on type '{1}'\"),\n        The_expected_type_comes_from_this_index_signature: diag(6501, ts.DiagnosticCategory.Message, \"The_expected_type_comes_from_this_index_signature_6501\", \"The expected type comes from this index signature.\"),\n        The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, ts.DiagnosticCategory.Message, \"The_expected_type_comes_from_the_return_type_of_this_signature_6502\", \"The expected type comes from the return type of this signature.\"),\n        Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing: diag(6503, ts.DiagnosticCategory.Message, \"Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503\", \"Print names of files that are part of the compilation and then stop processing.\"),\n        File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: diag(6504, ts.DiagnosticCategory.Error, \"File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504\", \"File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?\"),\n        Print_names_of_files_and_the_reason_they_are_part_of_the_compilation: diag(6505, ts.DiagnosticCategory.Message, \"Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505\", \"Print names of files and the reason they are part of the compilation.\"),\n        Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6803, ts.DiagnosticCategory.Error, \"Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6803\", \"Require undeclared properties from index signatures to use element accesses.\"),\n        Include_undefined_in_index_signature_results: diag(6800, ts.DiagnosticCategory.Message, \"Include_undefined_in_index_signature_results_6800\", \"Include 'undefined' in index signature results\"),\n        Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, \"Variable_0_implicitly_has_an_1_type_7005\", \"Variable '{0}' implicitly has an '{1}' type.\"),\n        Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, \"Parameter_0_implicitly_has_an_1_type_7006\", \"Parameter '{0}' implicitly has an '{1}' type.\"),\n        Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, \"Member_0_implicitly_has_an_1_type_7008\", \"Member '{0}' implicitly has an '{1}' type.\"),\n        new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, ts.DiagnosticCategory.Error, \"new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009\", \"'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.\"),\n        _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, ts.DiagnosticCategory.Error, \"_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010\", \"'{0}', which lacks return-type annotation, implicitly has an '{1}' return type.\"),\n        Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, ts.DiagnosticCategory.Error, \"Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011\", \"Function expression, which lacks return-type annotation, implicitly has an '{0}' return type.\"),\n        Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, ts.DiagnosticCategory.Error, \"Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013\", \"Construct signature, which lacks return-type annotation, implicitly has an 'any' return type.\"),\n        Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, ts.DiagnosticCategory.Error, \"Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014\", \"Function type, which lacks return-type annotation, implicitly has an '{0}' return type.\"),\n        Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, ts.DiagnosticCategory.Error, \"Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015\", \"Element implicitly has an 'any' type because index expression is not of type 'number'.\"),\n        Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type: diag(7016, ts.DiagnosticCategory.Error, \"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016\", \"Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type.\"),\n        Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature: diag(7017, ts.DiagnosticCategory.Error, \"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017\", \"Element implicitly has an 'any' type because type '{0}' has no index signature.\"),\n        Object_literal_s_property_0_implicitly_has_an_1_type: diag(7018, ts.DiagnosticCategory.Error, \"Object_literal_s_property_0_implicitly_has_an_1_type_7018\", \"Object literal's property '{0}' implicitly has an '{1}' type.\"),\n        Rest_parameter_0_implicitly_has_an_any_type: diag(7019, ts.DiagnosticCategory.Error, \"Rest_parameter_0_implicitly_has_an_any_type_7019\", \"Rest parameter '{0}' implicitly has an 'any[]' type.\"),\n        Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7020, ts.DiagnosticCategory.Error, \"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020\", \"Call signature, which lacks return-type annotation, implicitly has an 'any' return type.\"),\n        _0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: diag(7022, ts.DiagnosticCategory.Error, \"_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022\", \"'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.\"),\n        _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: diag(7023, ts.DiagnosticCategory.Error, \"_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023\", \"'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.\"),\n        Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: diag(7024, ts.DiagnosticCategory.Error, \"Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024\", \"Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.\"),\n        Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation: diag(7025, ts.DiagnosticCategory.Error, \"Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025\", \"Generator implicitly has yield type '{0}' because it does not yield any values. Consider supplying a return type annotation.\"),\n        JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: diag(7026, ts.DiagnosticCategory.Error, \"JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026\", \"JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists.\"),\n        Unreachable_code_detected: diag(7027, ts.DiagnosticCategory.Error, \"Unreachable_code_detected_7027\", \"Unreachable code detected.\", /*reportsUnnecessary*/ true),\n        Unused_label: diag(7028, ts.DiagnosticCategory.Error, \"Unused_label_7028\", \"Unused label.\", /*reportsUnnecessary*/ true),\n        Fallthrough_case_in_switch: diag(7029, ts.DiagnosticCategory.Error, \"Fallthrough_case_in_switch_7029\", \"Fallthrough case in switch.\"),\n        Not_all_code_paths_return_a_value: diag(7030, ts.DiagnosticCategory.Error, \"Not_all_code_paths_return_a_value_7030\", \"Not all code paths return a value.\"),\n        Binding_element_0_implicitly_has_an_1_type: diag(7031, ts.DiagnosticCategory.Error, \"Binding_element_0_implicitly_has_an_1_type_7031\", \"Binding element '{0}' implicitly has an '{1}' type.\"),\n        Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: diag(7032, ts.DiagnosticCategory.Error, \"Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032\", \"Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation.\"),\n        Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: diag(7033, ts.DiagnosticCategory.Error, \"Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033\", \"Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation.\"),\n        Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, ts.DiagnosticCategory.Error, \"Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034\", \"Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined.\"),\n        Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, \"Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035\", \"Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`\"),\n        Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, ts.DiagnosticCategory.Error, \"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036\", \"Dynamic import's specifier must be of type 'string', but here has type '{0}'.\"),\n        Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, ts.DiagnosticCategory.Message, \"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037\", \"Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'.\"),\n        Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead: diag(7038, ts.DiagnosticCategory.Message, \"Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038\", \"Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead.\"),\n        Mapped_object_type_implicitly_has_an_any_template_type: diag(7039, ts.DiagnosticCategory.Error, \"Mapped_object_type_implicitly_has_an_any_template_type_7039\", \"Mapped object type implicitly has an 'any' template type.\"),\n        If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1: diag(7040, ts.DiagnosticCategory.Error, \"If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040\", \"If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}`\"),\n        The_containing_arrow_function_captures_the_global_value_of_this: diag(7041, ts.DiagnosticCategory.Error, \"The_containing_arrow_function_captures_the_global_value_of_this_7041\", \"The containing arrow function captures the global value of 'this'.\"),\n        Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used: diag(7042, ts.DiagnosticCategory.Error, \"Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042\", \"Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used.\"),\n        Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7043, ts.DiagnosticCategory.Suggestion, \"Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043\", \"Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage.\"),\n        Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7044, ts.DiagnosticCategory.Suggestion, \"Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044\", \"Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage.\"),\n        Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7045, ts.DiagnosticCategory.Suggestion, \"Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045\", \"Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage.\"),\n        Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage: diag(7046, ts.DiagnosticCategory.Suggestion, \"Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046\", \"Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage.\"),\n        Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage: diag(7047, ts.DiagnosticCategory.Suggestion, \"Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047\", \"Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage.\"),\n        Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage: diag(7048, ts.DiagnosticCategory.Suggestion, \"Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048\", \"Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage.\"),\n        Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage: diag(7049, ts.DiagnosticCategory.Suggestion, \"Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049\", \"Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage.\"),\n        _0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage: diag(7050, ts.DiagnosticCategory.Suggestion, \"_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050\", \"'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage.\"),\n        Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1: diag(7051, ts.DiagnosticCategory.Error, \"Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051\", \"Parameter has a name but no type. Did you mean '{0}: {1}'?\"),\n        Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1: diag(7052, ts.DiagnosticCategory.Error, \"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052\", \"Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?\"),\n        Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1: diag(7053, ts.DiagnosticCategory.Error, \"Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053\", \"Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'.\"),\n        No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1: diag(7054, ts.DiagnosticCategory.Error, \"No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054\", \"No index signature with a parameter of type '{0}' was found on type '{1}'.\"),\n        _0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type: diag(7055, ts.DiagnosticCategory.Error, \"_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055\", \"'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type.\"),\n        The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed: diag(7056, ts.DiagnosticCategory.Error, \"The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056\", \"The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.\"),\n        yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation: diag(7057, ts.DiagnosticCategory.Error, \"yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057\", \"'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation.\"),\n        You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, \"You_cannot_rename_this_element_8000\", \"You cannot rename this element.\"),\n        You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, \"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001\", \"You cannot rename elements that are defined in the standard TypeScript library.\"),\n        import_can_only_be_used_in_TypeScript_files: diag(8002, ts.DiagnosticCategory.Error, \"import_can_only_be_used_in_TypeScript_files_8002\", \"'import ... =' can only be used in TypeScript files.\"),\n        export_can_only_be_used_in_TypeScript_files: diag(8003, ts.DiagnosticCategory.Error, \"export_can_only_be_used_in_TypeScript_files_8003\", \"'export =' can only be used in TypeScript files.\"),\n        Type_parameter_declarations_can_only_be_used_in_TypeScript_files: diag(8004, ts.DiagnosticCategory.Error, \"Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004\", \"Type parameter declarations can only be used in TypeScript files.\"),\n        implements_clauses_can_only_be_used_in_TypeScript_files: diag(8005, ts.DiagnosticCategory.Error, \"implements_clauses_can_only_be_used_in_TypeScript_files_8005\", \"'implements' clauses can only be used in TypeScript files.\"),\n        _0_declarations_can_only_be_used_in_TypeScript_files: diag(8006, ts.DiagnosticCategory.Error, \"_0_declarations_can_only_be_used_in_TypeScript_files_8006\", \"'{0}' declarations can only be used in TypeScript files.\"),\n        Type_aliases_can_only_be_used_in_TypeScript_files: diag(8008, ts.DiagnosticCategory.Error, \"Type_aliases_can_only_be_used_in_TypeScript_files_8008\", \"Type aliases can only be used in TypeScript files.\"),\n        The_0_modifier_can_only_be_used_in_TypeScript_files: diag(8009, ts.DiagnosticCategory.Error, \"The_0_modifier_can_only_be_used_in_TypeScript_files_8009\", \"The '{0}' modifier can only be used in TypeScript files.\"),\n        Type_annotations_can_only_be_used_in_TypeScript_files: diag(8010, ts.DiagnosticCategory.Error, \"Type_annotations_can_only_be_used_in_TypeScript_files_8010\", \"Type annotations can only be used in TypeScript files.\"),\n        Type_arguments_can_only_be_used_in_TypeScript_files: diag(8011, ts.DiagnosticCategory.Error, \"Type_arguments_can_only_be_used_in_TypeScript_files_8011\", \"Type arguments can only be used in TypeScript files.\"),\n        Parameter_modifiers_can_only_be_used_in_TypeScript_files: diag(8012, ts.DiagnosticCategory.Error, \"Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012\", \"Parameter modifiers can only be used in TypeScript files.\"),\n        Non_null_assertions_can_only_be_used_in_TypeScript_files: diag(8013, ts.DiagnosticCategory.Error, \"Non_null_assertions_can_only_be_used_in_TypeScript_files_8013\", \"Non-null assertions can only be used in TypeScript files.\"),\n        Type_assertion_expressions_can_only_be_used_in_TypeScript_files: diag(8016, ts.DiagnosticCategory.Error, \"Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016\", \"Type assertion expressions can only be used in TypeScript files.\"),\n        Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0: diag(8017, ts.DiagnosticCategory.Error, \"Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017\", \"Octal literal types must use ES2015 syntax. Use the syntax '{0}'.\"),\n        Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0: diag(8018, ts.DiagnosticCategory.Error, \"Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018\", \"Octal literals are not allowed in enums members initializer. Use the syntax '{0}'.\"),\n        Report_errors_in_js_files: diag(8019, ts.DiagnosticCategory.Message, \"Report_errors_in_js_files_8019\", \"Report errors in .js files.\"),\n        JSDoc_types_can_only_be_used_inside_documentation_comments: diag(8020, ts.DiagnosticCategory.Error, \"JSDoc_types_can_only_be_used_inside_documentation_comments_8020\", \"JSDoc types can only be used inside documentation comments.\"),\n        JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags: diag(8021, ts.DiagnosticCategory.Error, \"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021\", \"JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags.\"),\n        JSDoc_0_is_not_attached_to_a_class: diag(8022, ts.DiagnosticCategory.Error, \"JSDoc_0_is_not_attached_to_a_class_8022\", \"JSDoc '@{0}' is not attached to a class.\"),\n        JSDoc_0_1_does_not_match_the_extends_2_clause: diag(8023, ts.DiagnosticCategory.Error, \"JSDoc_0_1_does_not_match_the_extends_2_clause_8023\", \"JSDoc '@{0} {1}' does not match the 'extends {2}' clause.\"),\n        JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name: diag(8024, ts.DiagnosticCategory.Error, \"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024\", \"JSDoc '@param' tag has name '{0}', but there is no parameter with that name.\"),\n        Class_declarations_cannot_have_more_than_one_augments_or_extends_tag: diag(8025, ts.DiagnosticCategory.Error, \"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025\", \"Class declarations cannot have more than one `@augments` or `@extends` tag.\"),\n        Expected_0_type_arguments_provide_these_with_an_extends_tag: diag(8026, ts.DiagnosticCategory.Error, \"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026\", \"Expected {0} type arguments; provide these with an '@extends' tag.\"),\n        Expected_0_1_type_arguments_provide_these_with_an_extends_tag: diag(8027, ts.DiagnosticCategory.Error, \"Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027\", \"Expected {0}-{1} type arguments; provide these with an '@extends' tag.\"),\n        JSDoc_may_only_appear_in_the_last_parameter_of_a_signature: diag(8028, ts.DiagnosticCategory.Error, \"JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028\", \"JSDoc '...' may only appear in the last parameter of a signature.\"),\n        JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type: diag(8029, ts.DiagnosticCategory.Error, \"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029\", \"JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type.\"),\n        The_type_of_a_function_declaration_must_match_the_function_s_signature: diag(8030, ts.DiagnosticCategory.Error, \"The_type_of_a_function_declaration_must_match_the_function_s_signature_8030\", \"The type of a function declaration must match the function's signature.\"),\n        You_cannot_rename_a_module_via_a_global_import: diag(8031, ts.DiagnosticCategory.Error, \"You_cannot_rename_a_module_via_a_global_import_8031\", \"You cannot rename a module via a global import.\"),\n        Qualified_name_0_is_not_allowed_without_a_leading_param_object_1: diag(8032, ts.DiagnosticCategory.Error, \"Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032\", \"Qualified name '{0}' is not allowed without a leading '@param {object} {1}'.\"),\n        A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags: diag(8033, ts.DiagnosticCategory.Error, \"A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033\", \"A JSDoc '@typedef' comment may not contain multiple '@type' tags.\"),\n        The_tag_was_first_specified_here: diag(8034, ts.DiagnosticCategory.Error, \"The_tag_was_first_specified_here_8034\", \"The tag was first specified here.\"),\n        Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clause: diag(9002, ts.DiagnosticCategory.Error, \"Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002\", \"Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clause.\"),\n        class_expressions_are_not_currently_supported: diag(9003, ts.DiagnosticCategory.Error, \"class_expressions_are_not_currently_supported_9003\", \"'class' expressions are not currently supported.\"),\n        Language_service_is_disabled: diag(9004, ts.DiagnosticCategory.Error, \"Language_service_is_disabled_9004\", \"Language service is disabled.\"),\n        Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, ts.DiagnosticCategory.Error, \"Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005\", \"Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit.\"),\n        Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, ts.DiagnosticCategory.Error, \"Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006\", \"Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit.\"),\n        JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17000, ts.DiagnosticCategory.Error, \"JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000\", \"JSX attributes must only be assigned a non-empty 'expression'.\"),\n        JSX_elements_cannot_have_multiple_attributes_with_the_same_name: diag(17001, ts.DiagnosticCategory.Error, \"JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001\", \"JSX elements cannot have multiple attributes with the same name.\"),\n        Expected_corresponding_JSX_closing_tag_for_0: diag(17002, ts.DiagnosticCategory.Error, \"Expected_corresponding_JSX_closing_tag_for_0_17002\", \"Expected corresponding JSX closing tag for '{0}'.\"),\n        JSX_attribute_expected: diag(17003, ts.DiagnosticCategory.Error, \"JSX_attribute_expected_17003\", \"JSX attribute expected.\"),\n        Cannot_use_JSX_unless_the_jsx_flag_is_provided: diag(17004, ts.DiagnosticCategory.Error, \"Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004\", \"Cannot use JSX unless the '--jsx' flag is provided.\"),\n        A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: diag(17005, ts.DiagnosticCategory.Error, \"A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005\", \"A constructor cannot contain a 'super' call when its class extends 'null'.\"),\n        An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: diag(17006, ts.DiagnosticCategory.Error, \"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006\", \"An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.\"),\n        A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: diag(17007, ts.DiagnosticCategory.Error, \"A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007\", \"A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.\"),\n        JSX_element_0_has_no_corresponding_closing_tag: diag(17008, ts.DiagnosticCategory.Error, \"JSX_element_0_has_no_corresponding_closing_tag_17008\", \"JSX element '{0}' has no corresponding closing tag.\"),\n        super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: diag(17009, ts.DiagnosticCategory.Error, \"super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009\", \"'super' must be called before accessing 'this' in the constructor of a derived class.\"),\n        Unknown_type_acquisition_option_0: diag(17010, ts.DiagnosticCategory.Error, \"Unknown_type_acquisition_option_0_17010\", \"Unknown type acquisition option '{0}'.\"),\n        super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class: diag(17011, ts.DiagnosticCategory.Error, \"super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011\", \"'super' must be called before accessing a property of 'super' in the constructor of a derived class.\"),\n        _0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2: diag(17012, ts.DiagnosticCategory.Error, \"_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012\", \"'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?\"),\n        Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor: diag(17013, ts.DiagnosticCategory.Error, \"Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013\", \"Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor.\"),\n        JSX_fragment_has_no_corresponding_closing_tag: diag(17014, ts.DiagnosticCategory.Error, \"JSX_fragment_has_no_corresponding_closing_tag_17014\", \"JSX fragment has no corresponding closing tag.\"),\n        Expected_corresponding_closing_tag_for_JSX_fragment: diag(17015, ts.DiagnosticCategory.Error, \"Expected_corresponding_closing_tag_for_JSX_fragment_17015\", \"Expected corresponding closing tag for JSX fragment.\"),\n        The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option: diag(17016, ts.DiagnosticCategory.Error, \"The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016\", \"The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.\"),\n        An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments: diag(17017, ts.DiagnosticCategory.Error, \"An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017\", \"An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments.\"),\n        Unknown_type_acquisition_option_0_Did_you_mean_1: diag(17018, ts.DiagnosticCategory.Error, \"Unknown_type_acquisition_option_0_Did_you_mean_1_17018\", \"Unknown type acquisition option '{0}'. Did you mean '{1}'?\"),\n        Circularity_detected_while_resolving_configuration_Colon_0: diag(18000, ts.DiagnosticCategory.Error, \"Circularity_detected_while_resolving_configuration_Colon_0_18000\", \"Circularity detected while resolving configuration: {0}\"),\n        A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not: diag(18001, ts.DiagnosticCategory.Error, \"A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001\", \"A path in an 'extends' option must be relative or rooted, but '{0}' is not.\"),\n        The_files_list_in_config_file_0_is_empty: diag(18002, ts.DiagnosticCategory.Error, \"The_files_list_in_config_file_0_is_empty_18002\", \"The 'files' list in config file '{0}' is empty.\"),\n        No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: diag(18003, ts.DiagnosticCategory.Error, \"No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003\", \"No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'.\"),\n        File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module: diag(80001, ts.DiagnosticCategory.Suggestion, \"File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module_80001\", \"File is a CommonJS module; it may be converted to an ES6 module.\"),\n        This_constructor_function_may_be_converted_to_a_class_declaration: diag(80002, ts.DiagnosticCategory.Suggestion, \"This_constructor_function_may_be_converted_to_a_class_declaration_80002\", \"This constructor function may be converted to a class declaration.\"),\n        Import_may_be_converted_to_a_default_import: diag(80003, ts.DiagnosticCategory.Suggestion, \"Import_may_be_converted_to_a_default_import_80003\", \"Import may be converted to a default import.\"),\n        JSDoc_types_may_be_moved_to_TypeScript_types: diag(80004, ts.DiagnosticCategory.Suggestion, \"JSDoc_types_may_be_moved_to_TypeScript_types_80004\", \"JSDoc types may be moved to TypeScript types.\"),\n        require_call_may_be_converted_to_an_import: diag(80005, ts.DiagnosticCategory.Suggestion, \"require_call_may_be_converted_to_an_import_80005\", \"'require' call may be converted to an import.\"),\n        This_may_be_converted_to_an_async_function: diag(80006, ts.DiagnosticCategory.Suggestion, \"This_may_be_converted_to_an_async_function_80006\", \"This may be converted to an async function.\"),\n        await_has_no_effect_on_the_type_of_this_expression: diag(80007, ts.DiagnosticCategory.Suggestion, \"await_has_no_effect_on_the_type_of_this_expression_80007\", \"'await' has no effect on the type of this expression.\"),\n        Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers: diag(80008, ts.DiagnosticCategory.Suggestion, \"Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008\", \"Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers.\"),\n        Add_missing_super_call: diag(90001, ts.DiagnosticCategory.Message, \"Add_missing_super_call_90001\", \"Add missing 'super()' call\"),\n        Make_super_call_the_first_statement_in_the_constructor: diag(90002, ts.DiagnosticCategory.Message, \"Make_super_call_the_first_statement_in_the_constructor_90002\", \"Make 'super()' call the first statement in the constructor\"),\n        Change_extends_to_implements: diag(90003, ts.DiagnosticCategory.Message, \"Change_extends_to_implements_90003\", \"Change 'extends' to 'implements'\"),\n        Remove_unused_declaration_for_Colon_0: diag(90004, ts.DiagnosticCategory.Message, \"Remove_unused_declaration_for_Colon_0_90004\", \"Remove unused declaration for: '{0}'\"),\n        Remove_import_from_0: diag(90005, ts.DiagnosticCategory.Message, \"Remove_import_from_0_90005\", \"Remove import from '{0}'\"),\n        Implement_interface_0: diag(90006, ts.DiagnosticCategory.Message, \"Implement_interface_0_90006\", \"Implement interface '{0}'\"),\n        Implement_inherited_abstract_class: diag(90007, ts.DiagnosticCategory.Message, \"Implement_inherited_abstract_class_90007\", \"Implement inherited abstract class\"),\n        Add_0_to_unresolved_variable: diag(90008, ts.DiagnosticCategory.Message, \"Add_0_to_unresolved_variable_90008\", \"Add '{0}.' to unresolved variable\"),\n        Remove_variable_statement: diag(90010, ts.DiagnosticCategory.Message, \"Remove_variable_statement_90010\", \"Remove variable statement\"),\n        Remove_template_tag: diag(90011, ts.DiagnosticCategory.Message, \"Remove_template_tag_90011\", \"Remove template tag\"),\n        Remove_type_parameters: diag(90012, ts.DiagnosticCategory.Message, \"Remove_type_parameters_90012\", \"Remove type parameters\"),\n        Import_0_from_module_1: diag(90013, ts.DiagnosticCategory.Message, \"Import_0_from_module_1_90013\", \"Import '{0}' from module \\\"{1}\\\"\"),\n        Change_0_to_1: diag(90014, ts.DiagnosticCategory.Message, \"Change_0_to_1_90014\", \"Change '{0}' to '{1}'\"),\n        Add_0_to_existing_import_declaration_from_1: diag(90015, ts.DiagnosticCategory.Message, \"Add_0_to_existing_import_declaration_from_1_90015\", \"Add '{0}' to existing import declaration from \\\"{1}\\\"\"),\n        Declare_property_0: diag(90016, ts.DiagnosticCategory.Message, \"Declare_property_0_90016\", \"Declare property '{0}'\"),\n        Add_index_signature_for_property_0: diag(90017, ts.DiagnosticCategory.Message, \"Add_index_signature_for_property_0_90017\", \"Add index signature for property '{0}'\"),\n        Disable_checking_for_this_file: diag(90018, ts.DiagnosticCategory.Message, \"Disable_checking_for_this_file_90018\", \"Disable checking for this file\"),\n        Ignore_this_error_message: diag(90019, ts.DiagnosticCategory.Message, \"Ignore_this_error_message_90019\", \"Ignore this error message\"),\n        Initialize_property_0_in_the_constructor: diag(90020, ts.DiagnosticCategory.Message, \"Initialize_property_0_in_the_constructor_90020\", \"Initialize property '{0}' in the constructor\"),\n        Initialize_static_property_0: diag(90021, ts.DiagnosticCategory.Message, \"Initialize_static_property_0_90021\", \"Initialize static property '{0}'\"),\n        Change_spelling_to_0: diag(90022, ts.DiagnosticCategory.Message, \"Change_spelling_to_0_90022\", \"Change spelling to '{0}'\"),\n        Declare_method_0: diag(90023, ts.DiagnosticCategory.Message, \"Declare_method_0_90023\", \"Declare method '{0}'\"),\n        Declare_static_method_0: diag(90024, ts.DiagnosticCategory.Message, \"Declare_static_method_0_90024\", \"Declare static method '{0}'\"),\n        Prefix_0_with_an_underscore: diag(90025, ts.DiagnosticCategory.Message, \"Prefix_0_with_an_underscore_90025\", \"Prefix '{0}' with an underscore\"),\n        Rewrite_as_the_indexed_access_type_0: diag(90026, ts.DiagnosticCategory.Message, \"Rewrite_as_the_indexed_access_type_0_90026\", \"Rewrite as the indexed access type '{0}'\"),\n        Declare_static_property_0: diag(90027, ts.DiagnosticCategory.Message, \"Declare_static_property_0_90027\", \"Declare static property '{0}'\"),\n        Call_decorator_expression: diag(90028, ts.DiagnosticCategory.Message, \"Call_decorator_expression_90028\", \"Call decorator expression\"),\n        Add_async_modifier_to_containing_function: diag(90029, ts.DiagnosticCategory.Message, \"Add_async_modifier_to_containing_function_90029\", \"Add async modifier to containing function\"),\n        Replace_infer_0_with_unknown: diag(90030, ts.DiagnosticCategory.Message, \"Replace_infer_0_with_unknown_90030\", \"Replace 'infer {0}' with 'unknown'\"),\n        Replace_all_unused_infer_with_unknown: diag(90031, ts.DiagnosticCategory.Message, \"Replace_all_unused_infer_with_unknown_90031\", \"Replace all unused 'infer' with 'unknown'\"),\n        Import_default_0_from_module_1: diag(90032, ts.DiagnosticCategory.Message, \"Import_default_0_from_module_1_90032\", \"Import default '{0}' from module \\\"{1}\\\"\"),\n        Add_default_import_0_to_existing_import_declaration_from_1: diag(90033, ts.DiagnosticCategory.Message, \"Add_default_import_0_to_existing_import_declaration_from_1_90033\", \"Add default import '{0}' to existing import declaration from \\\"{1}\\\"\"),\n        Add_parameter_name: diag(90034, ts.DiagnosticCategory.Message, \"Add_parameter_name_90034\", \"Add parameter name\"),\n        Declare_private_property_0: diag(90035, ts.DiagnosticCategory.Message, \"Declare_private_property_0_90035\", \"Declare private property '{0}'\"),\n        Replace_0_with_Promise_1: diag(90036, ts.DiagnosticCategory.Message, \"Replace_0_with_Promise_1_90036\", \"Replace '{0}' with 'Promise<{1}>'\"),\n        Fix_all_incorrect_return_type_of_an_async_functions: diag(90037, ts.DiagnosticCategory.Message, \"Fix_all_incorrect_return_type_of_an_async_functions_90037\", \"Fix all incorrect return type of an async functions\"),\n        Declare_private_method_0: diag(90038, ts.DiagnosticCategory.Message, \"Declare_private_method_0_90038\", \"Declare private method '{0}'\"),\n        Remove_unused_destructuring_declaration: diag(90039, ts.DiagnosticCategory.Message, \"Remove_unused_destructuring_declaration_90039\", \"Remove unused destructuring declaration\"),\n        Remove_unused_declarations_for_Colon_0: diag(90041, ts.DiagnosticCategory.Message, \"Remove_unused_declarations_for_Colon_0_90041\", \"Remove unused declarations for: '{0}'\"),\n        Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, \"Declare_a_private_field_named_0_90053\", \"Declare a private field named '{0}'.\"),\n        Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, \"Convert_function_to_an_ES2015_class_95001\", \"Convert function to an ES2015 class\"),\n        Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, \"Convert_function_0_to_class_95002\", \"Convert function '{0}' to class\"),\n        Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, \"Convert_0_to_1_in_0_95003\", \"Convert '{0}' to '{1} in {0}'\"),\n        Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, \"Extract_to_0_in_1_95004\", \"Extract to {0} in {1}\"),\n        Extract_function: diag(95005, ts.DiagnosticCategory.Message, \"Extract_function_95005\", \"Extract function\"),\n        Extract_constant: diag(95006, ts.DiagnosticCategory.Message, \"Extract_constant_95006\", \"Extract constant\"),\n        Extract_to_0_in_enclosing_scope: diag(95007, ts.DiagnosticCategory.Message, \"Extract_to_0_in_enclosing_scope_95007\", \"Extract to {0} in enclosing scope\"),\n        Extract_to_0_in_1_scope: diag(95008, ts.DiagnosticCategory.Message, \"Extract_to_0_in_1_scope_95008\", \"Extract to {0} in {1} scope\"),\n        Annotate_with_type_from_JSDoc: diag(95009, ts.DiagnosticCategory.Message, \"Annotate_with_type_from_JSDoc_95009\", \"Annotate with type from JSDoc\"),\n        Annotate_with_types_from_JSDoc: diag(95010, ts.DiagnosticCategory.Message, \"Annotate_with_types_from_JSDoc_95010\", \"Annotate with types from JSDoc\"),\n        Infer_type_of_0_from_usage: diag(95011, ts.DiagnosticCategory.Message, \"Infer_type_of_0_from_usage_95011\", \"Infer type of '{0}' from usage\"),\n        Infer_parameter_types_from_usage: diag(95012, ts.DiagnosticCategory.Message, \"Infer_parameter_types_from_usage_95012\", \"Infer parameter types from usage\"),\n        Convert_to_default_import: diag(95013, ts.DiagnosticCategory.Message, \"Convert_to_default_import_95013\", \"Convert to default import\"),\n        Install_0: diag(95014, ts.DiagnosticCategory.Message, \"Install_0_95014\", \"Install '{0}'\"),\n        Replace_import_with_0: diag(95015, ts.DiagnosticCategory.Message, \"Replace_import_with_0_95015\", \"Replace import with '{0}'.\"),\n        Use_synthetic_default_member: diag(95016, ts.DiagnosticCategory.Message, \"Use_synthetic_default_member_95016\", \"Use synthetic 'default' member.\"),\n        Convert_to_ES6_module: diag(95017, ts.DiagnosticCategory.Message, \"Convert_to_ES6_module_95017\", \"Convert to ES6 module\"),\n        Add_undefined_type_to_property_0: diag(95018, ts.DiagnosticCategory.Message, \"Add_undefined_type_to_property_0_95018\", \"Add 'undefined' type to property '{0}'\"),\n        Add_initializer_to_property_0: diag(95019, ts.DiagnosticCategory.Message, \"Add_initializer_to_property_0_95019\", \"Add initializer to property '{0}'\"),\n        Add_definite_assignment_assertion_to_property_0: diag(95020, ts.DiagnosticCategory.Message, \"Add_definite_assignment_assertion_to_property_0_95020\", \"Add definite assignment assertion to property '{0}'\"),\n        Convert_all_type_literals_to_mapped_type: diag(95021, ts.DiagnosticCategory.Message, \"Convert_all_type_literals_to_mapped_type_95021\", \"Convert all type literals to mapped type\"),\n        Add_all_missing_members: diag(95022, ts.DiagnosticCategory.Message, \"Add_all_missing_members_95022\", \"Add all missing members\"),\n        Infer_all_types_from_usage: diag(95023, ts.DiagnosticCategory.Message, \"Infer_all_types_from_usage_95023\", \"Infer all types from usage\"),\n        Delete_all_unused_declarations: diag(95024, ts.DiagnosticCategory.Message, \"Delete_all_unused_declarations_95024\", \"Delete all unused declarations\"),\n        Prefix_all_unused_declarations_with_where_possible: diag(95025, ts.DiagnosticCategory.Message, \"Prefix_all_unused_declarations_with_where_possible_95025\", \"Prefix all unused declarations with '_' where possible\"),\n        Fix_all_detected_spelling_errors: diag(95026, ts.DiagnosticCategory.Message, \"Fix_all_detected_spelling_errors_95026\", \"Fix all detected spelling errors\"),\n        Add_initializers_to_all_uninitialized_properties: diag(95027, ts.DiagnosticCategory.Message, \"Add_initializers_to_all_uninitialized_properties_95027\", \"Add initializers to all uninitialized properties\"),\n        Add_definite_assignment_assertions_to_all_uninitialized_properties: diag(95028, ts.DiagnosticCategory.Message, \"Add_definite_assignment_assertions_to_all_uninitialized_properties_95028\", \"Add definite assignment assertions to all uninitialized properties\"),\n        Add_undefined_type_to_all_uninitialized_properties: diag(95029, ts.DiagnosticCategory.Message, \"Add_undefined_type_to_all_uninitialized_properties_95029\", \"Add undefined type to all uninitialized properties\"),\n        Change_all_jsdoc_style_types_to_TypeScript: diag(95030, ts.DiagnosticCategory.Message, \"Change_all_jsdoc_style_types_to_TypeScript_95030\", \"Change all jsdoc-style types to TypeScript\"),\n        Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types: diag(95031, ts.DiagnosticCategory.Message, \"Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031\", \"Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)\"),\n        Implement_all_unimplemented_interfaces: diag(95032, ts.DiagnosticCategory.Message, \"Implement_all_unimplemented_interfaces_95032\", \"Implement all unimplemented interfaces\"),\n        Install_all_missing_types_packages: diag(95033, ts.DiagnosticCategory.Message, \"Install_all_missing_types_packages_95033\", \"Install all missing types packages\"),\n        Rewrite_all_as_indexed_access_types: diag(95034, ts.DiagnosticCategory.Message, \"Rewrite_all_as_indexed_access_types_95034\", \"Rewrite all as indexed access types\"),\n        Convert_all_to_default_imports: diag(95035, ts.DiagnosticCategory.Message, \"Convert_all_to_default_imports_95035\", \"Convert all to default imports\"),\n        Make_all_super_calls_the_first_statement_in_their_constructor: diag(95036, ts.DiagnosticCategory.Message, \"Make_all_super_calls_the_first_statement_in_their_constructor_95036\", \"Make all 'super()' calls the first statement in their constructor\"),\n        Add_qualifier_to_all_unresolved_variables_matching_a_member_name: diag(95037, ts.DiagnosticCategory.Message, \"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037\", \"Add qualifier to all unresolved variables matching a member name\"),\n        Change_all_extended_interfaces_to_implements: diag(95038, ts.DiagnosticCategory.Message, \"Change_all_extended_interfaces_to_implements_95038\", \"Change all extended interfaces to 'implements'\"),\n        Add_all_missing_super_calls: diag(95039, ts.DiagnosticCategory.Message, \"Add_all_missing_super_calls_95039\", \"Add all missing super calls\"),\n        Implement_all_inherited_abstract_classes: diag(95040, ts.DiagnosticCategory.Message, \"Implement_all_inherited_abstract_classes_95040\", \"Implement all inherited abstract classes\"),\n        Add_all_missing_async_modifiers: diag(95041, ts.DiagnosticCategory.Message, \"Add_all_missing_async_modifiers_95041\", \"Add all missing 'async' modifiers\"),\n        Add_ts_ignore_to_all_error_messages: diag(95042, ts.DiagnosticCategory.Message, \"Add_ts_ignore_to_all_error_messages_95042\", \"Add '@ts-ignore' to all error messages\"),\n        Annotate_everything_with_types_from_JSDoc: diag(95043, ts.DiagnosticCategory.Message, \"Annotate_everything_with_types_from_JSDoc_95043\", \"Annotate everything with types from JSDoc\"),\n        Add_to_all_uncalled_decorators: diag(95044, ts.DiagnosticCategory.Message, \"Add_to_all_uncalled_decorators_95044\", \"Add '()' to all uncalled decorators\"),\n        Convert_all_constructor_functions_to_classes: diag(95045, ts.DiagnosticCategory.Message, \"Convert_all_constructor_functions_to_classes_95045\", \"Convert all constructor functions to classes\"),\n        Generate_get_and_set_accessors: diag(95046, ts.DiagnosticCategory.Message, \"Generate_get_and_set_accessors_95046\", \"Generate 'get' and 'set' accessors\"),\n        Convert_require_to_import: diag(95047, ts.DiagnosticCategory.Message, \"Convert_require_to_import_95047\", \"Convert 'require' to 'import'\"),\n        Convert_all_require_to_import: diag(95048, ts.DiagnosticCategory.Message, \"Convert_all_require_to_import_95048\", \"Convert all 'require' to 'import'\"),\n        Move_to_a_new_file: diag(95049, ts.DiagnosticCategory.Message, \"Move_to_a_new_file_95049\", \"Move to a new file\"),\n        Remove_unreachable_code: diag(95050, ts.DiagnosticCategory.Message, \"Remove_unreachable_code_95050\", \"Remove unreachable code\"),\n        Remove_all_unreachable_code: diag(95051, ts.DiagnosticCategory.Message, \"Remove_all_unreachable_code_95051\", \"Remove all unreachable code\"),\n        Add_missing_typeof: diag(95052, ts.DiagnosticCategory.Message, \"Add_missing_typeof_95052\", \"Add missing 'typeof'\"),\n        Remove_unused_label: diag(95053, ts.DiagnosticCategory.Message, \"Remove_unused_label_95053\", \"Remove unused label\"),\n        Remove_all_unused_labels: diag(95054, ts.DiagnosticCategory.Message, \"Remove_all_unused_labels_95054\", \"Remove all unused labels\"),\n        Convert_0_to_mapped_object_type: diag(95055, ts.DiagnosticCategory.Message, \"Convert_0_to_mapped_object_type_95055\", \"Convert '{0}' to mapped object type\"),\n        Convert_namespace_import_to_named_imports: diag(95056, ts.DiagnosticCategory.Message, \"Convert_namespace_import_to_named_imports_95056\", \"Convert namespace import to named imports\"),\n        Convert_named_imports_to_namespace_import: diag(95057, ts.DiagnosticCategory.Message, \"Convert_named_imports_to_namespace_import_95057\", \"Convert named imports to namespace import\"),\n        Add_or_remove_braces_in_an_arrow_function: diag(95058, ts.DiagnosticCategory.Message, \"Add_or_remove_braces_in_an_arrow_function_95058\", \"Add or remove braces in an arrow function\"),\n        Add_braces_to_arrow_function: diag(95059, ts.DiagnosticCategory.Message, \"Add_braces_to_arrow_function_95059\", \"Add braces to arrow function\"),\n        Remove_braces_from_arrow_function: diag(95060, ts.DiagnosticCategory.Message, \"Remove_braces_from_arrow_function_95060\", \"Remove braces from arrow function\"),\n        Convert_default_export_to_named_export: diag(95061, ts.DiagnosticCategory.Message, \"Convert_default_export_to_named_export_95061\", \"Convert default export to named export\"),\n        Convert_named_export_to_default_export: diag(95062, ts.DiagnosticCategory.Message, \"Convert_named_export_to_default_export_95062\", \"Convert named export to default export\"),\n        Add_missing_enum_member_0: diag(95063, ts.DiagnosticCategory.Message, \"Add_missing_enum_member_0_95063\", \"Add missing enum member '{0}'\"),\n        Add_all_missing_imports: diag(95064, ts.DiagnosticCategory.Message, \"Add_all_missing_imports_95064\", \"Add all missing imports\"),\n        Convert_to_async_function: diag(95065, ts.DiagnosticCategory.Message, \"Convert_to_async_function_95065\", \"Convert to async function\"),\n        Convert_all_to_async_functions: diag(95066, ts.DiagnosticCategory.Message, \"Convert_all_to_async_functions_95066\", \"Convert all to async functions\"),\n        Add_missing_call_parentheses: diag(95067, ts.DiagnosticCategory.Message, \"Add_missing_call_parentheses_95067\", \"Add missing call parentheses\"),\n        Add_all_missing_call_parentheses: diag(95068, ts.DiagnosticCategory.Message, \"Add_all_missing_call_parentheses_95068\", \"Add all missing call parentheses\"),\n        Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts.DiagnosticCategory.Message, \"Add_unknown_conversion_for_non_overlapping_types_95069\", \"Add 'unknown' conversion for non-overlapping types\"),\n        Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts.DiagnosticCategory.Message, \"Add_unknown_to_all_conversions_of_non_overlapping_types_95070\", \"Add 'unknown' to all conversions of non-overlapping types\"),\n        Add_missing_new_operator_to_call: diag(95071, ts.DiagnosticCategory.Message, \"Add_missing_new_operator_to_call_95071\", \"Add missing 'new' operator to call\"),\n        Add_missing_new_operator_to_all_calls: diag(95072, ts.DiagnosticCategory.Message, \"Add_missing_new_operator_to_all_calls_95072\", \"Add missing 'new' operator to all calls\"),\n        Add_names_to_all_parameters_without_names: diag(95073, ts.DiagnosticCategory.Message, \"Add_names_to_all_parameters_without_names_95073\", \"Add names to all parameters without names\"),\n        Enable_the_experimentalDecorators_option_in_your_configuration_file: diag(95074, ts.DiagnosticCategory.Message, \"Enable_the_experimentalDecorators_option_in_your_configuration_file_95074\", \"Enable the 'experimentalDecorators' option in your configuration file\"),\n        Convert_parameters_to_destructured_object: diag(95075, ts.DiagnosticCategory.Message, \"Convert_parameters_to_destructured_object_95075\", \"Convert parameters to destructured object\"),\n        Allow_accessing_UMD_globals_from_modules: diag(95076, ts.DiagnosticCategory.Message, \"Allow_accessing_UMD_globals_from_modules_95076\", \"Allow accessing UMD globals from modules.\"),\n        Extract_type: diag(95077, ts.DiagnosticCategory.Message, \"Extract_type_95077\", \"Extract type\"),\n        Extract_to_type_alias: diag(95078, ts.DiagnosticCategory.Message, \"Extract_to_type_alias_95078\", \"Extract to type alias\"),\n        Extract_to_typedef: diag(95079, ts.DiagnosticCategory.Message, \"Extract_to_typedef_95079\", \"Extract to typedef\"),\n        Infer_this_type_of_0_from_usage: diag(95080, ts.DiagnosticCategory.Message, \"Infer_this_type_of_0_from_usage_95080\", \"Infer 'this' type of '{0}' from usage\"),\n        Add_const_to_unresolved_variable: diag(95081, ts.DiagnosticCategory.Message, \"Add_const_to_unresolved_variable_95081\", \"Add 'const' to unresolved variable\"),\n        Add_const_to_all_unresolved_variables: diag(95082, ts.DiagnosticCategory.Message, \"Add_const_to_all_unresolved_variables_95082\", \"Add 'const' to all unresolved variables\"),\n        Add_await: diag(95083, ts.DiagnosticCategory.Message, \"Add_await_95083\", \"Add 'await'\"),\n        Add_await_to_initializer_for_0: diag(95084, ts.DiagnosticCategory.Message, \"Add_await_to_initializer_for_0_95084\", \"Add 'await' to initializer for '{0}'\"),\n        Fix_all_expressions_possibly_missing_await: diag(95085, ts.DiagnosticCategory.Message, \"Fix_all_expressions_possibly_missing_await_95085\", \"Fix all expressions possibly missing 'await'\"),\n        Remove_unnecessary_await: diag(95086, ts.DiagnosticCategory.Message, \"Remove_unnecessary_await_95086\", \"Remove unnecessary 'await'\"),\n        Remove_all_unnecessary_uses_of_await: diag(95087, ts.DiagnosticCategory.Message, \"Remove_all_unnecessary_uses_of_await_95087\", \"Remove all unnecessary uses of 'await'\"),\n        Enable_the_jsx_flag_in_your_configuration_file: diag(95088, ts.DiagnosticCategory.Message, \"Enable_the_jsx_flag_in_your_configuration_file_95088\", \"Enable the '--jsx' flag in your configuration file\"),\n        Add_await_to_initializers: diag(95089, ts.DiagnosticCategory.Message, \"Add_await_to_initializers_95089\", \"Add 'await' to initializers\"),\n        Extract_to_interface: diag(95090, ts.DiagnosticCategory.Message, \"Extract_to_interface_95090\", \"Extract to interface\"),\n        Convert_to_a_bigint_numeric_literal: diag(95091, ts.DiagnosticCategory.Message, \"Convert_to_a_bigint_numeric_literal_95091\", \"Convert to a bigint numeric literal\"),\n        Convert_all_to_bigint_numeric_literals: diag(95092, ts.DiagnosticCategory.Message, \"Convert_all_to_bigint_numeric_literals_95092\", \"Convert all to bigint numeric literals\"),\n        Convert_const_to_let: diag(95093, ts.DiagnosticCategory.Message, \"Convert_const_to_let_95093\", \"Convert 'const' to 'let'\"),\n        Prefix_with_declare: diag(95094, ts.DiagnosticCategory.Message, \"Prefix_with_declare_95094\", \"Prefix with 'declare'\"),\n        Prefix_all_incorrect_property_declarations_with_declare: diag(95095, ts.DiagnosticCategory.Message, \"Prefix_all_incorrect_property_declarations_with_declare_95095\", \"Prefix all incorrect property declarations with 'declare'\"),\n        Convert_to_template_string: diag(95096, ts.DiagnosticCategory.Message, \"Convert_to_template_string_95096\", \"Convert to template string\"),\n        Add_export_to_make_this_file_into_a_module: diag(95097, ts.DiagnosticCategory.Message, \"Add_export_to_make_this_file_into_a_module_95097\", \"Add 'export {}' to make this file into a module\"),\n        Set_the_target_option_in_your_configuration_file_to_0: diag(95098, ts.DiagnosticCategory.Message, \"Set_the_target_option_in_your_configuration_file_to_0_95098\", \"Set the 'target' option in your configuration file to '{0}'\"),\n        Set_the_module_option_in_your_configuration_file_to_0: diag(95099, ts.DiagnosticCategory.Message, \"Set_the_module_option_in_your_configuration_file_to_0_95099\", \"Set the 'module' option in your configuration file to '{0}'\"),\n        Convert_invalid_character_to_its_html_entity_code: diag(95100, ts.DiagnosticCategory.Message, \"Convert_invalid_character_to_its_html_entity_code_95100\", \"Convert invalid character to its html entity code\"),\n        Convert_all_invalid_characters_to_HTML_entity_code: diag(95101, ts.DiagnosticCategory.Message, \"Convert_all_invalid_characters_to_HTML_entity_code_95101\", \"Convert all invalid characters to HTML entity code\"),\n        Add_class_tag: diag(95102, ts.DiagnosticCategory.Message, \"Add_class_tag_95102\", \"Add '@class' tag\"),\n        Add_this_tag: diag(95103, ts.DiagnosticCategory.Message, \"Add_this_tag_95103\", \"Add '@this' tag\"),\n        Add_this_parameter: diag(95104, ts.DiagnosticCategory.Message, \"Add_this_parameter_95104\", \"Add 'this' parameter.\"),\n        Convert_function_expression_0_to_arrow_function: diag(95105, ts.DiagnosticCategory.Message, \"Convert_function_expression_0_to_arrow_function_95105\", \"Convert function expression '{0}' to arrow function\"),\n        Convert_function_declaration_0_to_arrow_function: diag(95106, ts.DiagnosticCategory.Message, \"Convert_function_declaration_0_to_arrow_function_95106\", \"Convert function declaration '{0}' to arrow function\"),\n        Fix_all_implicit_this_errors: diag(95107, ts.DiagnosticCategory.Message, \"Fix_all_implicit_this_errors_95107\", \"Fix all implicit-'this' errors\"),\n        Wrap_invalid_character_in_an_expression_container: diag(95108, ts.DiagnosticCategory.Message, \"Wrap_invalid_character_in_an_expression_container_95108\", \"Wrap invalid character in an expression container\"),\n        Wrap_all_invalid_characters_in_an_expression_container: diag(95109, ts.DiagnosticCategory.Message, \"Wrap_all_invalid_characters_in_an_expression_container_95109\", \"Wrap all invalid characters in an expression container\"),\n        Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file: diag(95110, ts.DiagnosticCategory.Message, \"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file_95110\", \"Visit https://aka.ms/tsconfig.json to read more about this file\"),\n        Add_a_return_statement: diag(95111, ts.DiagnosticCategory.Message, \"Add_a_return_statement_95111\", \"Add a return statement\"),\n        Remove_braces_from_arrow_function_body: diag(95112, ts.DiagnosticCategory.Message, \"Remove_braces_from_arrow_function_body_95112\", \"Remove braces from arrow function body\"),\n        Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal: diag(95113, ts.DiagnosticCategory.Message, \"Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113\", \"Wrap the following body with parentheses which should be an object literal\"),\n        Add_all_missing_return_statement: diag(95114, ts.DiagnosticCategory.Message, \"Add_all_missing_return_statement_95114\", \"Add all missing return statement\"),\n        Remove_braces_from_all_arrow_function_bodies_with_relevant_issues: diag(95115, ts.DiagnosticCategory.Message, \"Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115\", \"Remove braces from all arrow function bodies with relevant issues\"),\n        Wrap_all_object_literal_with_parentheses: diag(95116, ts.DiagnosticCategory.Message, \"Wrap_all_object_literal_with_parentheses_95116\", \"Wrap all object literal with parentheses\"),\n        Move_labeled_tuple_element_modifiers_to_labels: diag(95117, ts.DiagnosticCategory.Message, \"Move_labeled_tuple_element_modifiers_to_labels_95117\", \"Move labeled tuple element modifiers to labels\"),\n        Convert_overload_list_to_single_signature: diag(95118, ts.DiagnosticCategory.Message, \"Convert_overload_list_to_single_signature_95118\", \"Convert overload list to single signature\"),\n        Generate_get_and_set_accessors_for_all_overriding_properties: diag(95119, ts.DiagnosticCategory.Message, \"Generate_get_and_set_accessors_for_all_overriding_properties_95119\", \"Generate 'get' and 'set' accessors for all overriding properties\"),\n        Wrap_in_JSX_fragment: diag(95120, ts.DiagnosticCategory.Message, \"Wrap_in_JSX_fragment_95120\", \"Wrap in JSX fragment\"),\n        Wrap_all_unparented_JSX_in_JSX_fragment: diag(95121, ts.DiagnosticCategory.Message, \"Wrap_all_unparented_JSX_in_JSX_fragment_95121\", \"Wrap all unparented JSX in JSX fragment\"),\n        Convert_arrow_function_or_function_expression: diag(95122, ts.DiagnosticCategory.Message, \"Convert_arrow_function_or_function_expression_95122\", \"Convert arrow function or function expression\"),\n        Convert_to_anonymous_function: diag(95123, ts.DiagnosticCategory.Message, \"Convert_to_anonymous_function_95123\", \"Convert to anonymous function\"),\n        Convert_to_named_function: diag(95124, ts.DiagnosticCategory.Message, \"Convert_to_named_function_95124\", \"Convert to named function\"),\n        Convert_to_arrow_function: diag(95125, ts.DiagnosticCategory.Message, \"Convert_to_arrow_function_95125\", \"Convert to arrow function\"),\n        Remove_parentheses: diag(95126, ts.DiagnosticCategory.Message, \"Remove_parentheses_95126\", \"Remove parentheses\"),\n        Could_not_find_a_containing_arrow_function: diag(95127, ts.DiagnosticCategory.Message, \"Could_not_find_a_containing_arrow_function_95127\", \"Could not find a containing arrow function\"),\n        Containing_function_is_not_an_arrow_function: diag(95128, ts.DiagnosticCategory.Message, \"Containing_function_is_not_an_arrow_function_95128\", \"Containing function is not an arrow function\"),\n        Could_not_find_export_statement: diag(95129, ts.DiagnosticCategory.Message, \"Could_not_find_export_statement_95129\", \"Could not find export statement\"),\n        This_file_already_has_a_default_export: diag(95130, ts.DiagnosticCategory.Message, \"This_file_already_has_a_default_export_95130\", \"This file already has a default export\"),\n        Could_not_find_import_clause: diag(95131, ts.DiagnosticCategory.Message, \"Could_not_find_import_clause_95131\", \"Could not find import clause\"),\n        Could_not_find_namespace_import_or_named_imports: diag(95132, ts.DiagnosticCategory.Message, \"Could_not_find_namespace_import_or_named_imports_95132\", \"Could not find namespace import or named imports\"),\n        Selection_is_not_a_valid_type_node: diag(95133, ts.DiagnosticCategory.Message, \"Selection_is_not_a_valid_type_node_95133\", \"Selection is not a valid type node\"),\n        No_type_could_be_extracted_from_this_type_node: diag(95134, ts.DiagnosticCategory.Message, \"No_type_could_be_extracted_from_this_type_node_95134\", \"No type could be extracted from this type node\"),\n        Could_not_find_property_for_which_to_generate_accessor: diag(95135, ts.DiagnosticCategory.Message, \"Could_not_find_property_for_which_to_generate_accessor_95135\", \"Could not find property for which to generate accessor\"),\n        Name_is_not_valid: diag(95136, ts.DiagnosticCategory.Message, \"Name_is_not_valid_95136\", \"Name is not valid\"),\n        Can_only_convert_property_with_modifier: diag(95137, ts.DiagnosticCategory.Message, \"Can_only_convert_property_with_modifier_95137\", \"Can only convert property with modifier\"),\n        Switch_each_misused_0_to_1: diag(95138, ts.DiagnosticCategory.Message, \"Switch_each_misused_0_to_1_95138\", \"Switch each misused '{0}' to '{1}'\"),\n        Convert_to_optional_chain_expression: diag(95139, ts.DiagnosticCategory.Message, \"Convert_to_optional_chain_expression_95139\", \"Convert to optional chain expression\"),\n        Could_not_find_convertible_access_expression: diag(95140, ts.DiagnosticCategory.Message, \"Could_not_find_convertible_access_expression_95140\", \"Could not find convertible access expression\"),\n        Could_not_find_matching_access_expressions: diag(95141, ts.DiagnosticCategory.Message, \"Could_not_find_matching_access_expressions_95141\", \"Could not find matching access expressions\"),\n        Can_only_convert_logical_AND_access_chains: diag(95142, ts.DiagnosticCategory.Message, \"Can_only_convert_logical_AND_access_chains_95142\", \"Can only convert logical AND access chains\"),\n        Add_void_to_Promise_resolved_without_a_value: diag(95143, ts.DiagnosticCategory.Message, \"Add_void_to_Promise_resolved_without_a_value_95143\", \"Add 'void' to Promise resolved without a value\"),\n        Add_void_to_all_Promises_resolved_without_a_value: diag(95144, ts.DiagnosticCategory.Message, \"Add_void_to_all_Promises_resolved_without_a_value_95144\", \"Add 'void' to all Promises resolved without a value\"),\n        Use_element_access_for_0: diag(95145, ts.DiagnosticCategory.Message, \"Use_element_access_for_0_95145\", \"Use element access for '{0}'\"),\n        Use_element_access_for_all_undeclared_properties: diag(95146, ts.DiagnosticCategory.Message, \"Use_element_access_for_all_undeclared_properties_95146\", \"Use element access for all undeclared properties.\"),\n        Delete_all_unused_imports: diag(95147, ts.DiagnosticCategory.Message, \"Delete_all_unused_imports_95147\", \"Delete all unused imports\"),\n        Infer_function_return_type: diag(95148, ts.DiagnosticCategory.Message, \"Infer_function_return_type_95148\", \"Infer function return type\"),\n        Return_type_must_be_inferred_from_a_function: diag(95149, ts.DiagnosticCategory.Message, \"Return_type_must_be_inferred_from_a_function_95149\", \"Return type must be inferred from a function\"),\n        Could_not_determine_function_return_type: diag(95150, ts.DiagnosticCategory.Message, \"Could_not_determine_function_return_type_95150\", \"Could not determine function return type\"),\n        Could_not_convert_to_arrow_function: diag(95151, ts.DiagnosticCategory.Message, \"Could_not_convert_to_arrow_function_95151\", \"Could not convert to arrow function\"),\n        Could_not_convert_to_named_function: diag(95152, ts.DiagnosticCategory.Message, \"Could_not_convert_to_named_function_95152\", \"Could not convert to named function\"),\n        Could_not_convert_to_anonymous_function: diag(95153, ts.DiagnosticCategory.Message, \"Could_not_convert_to_anonymous_function_95153\", \"Could not convert to anonymous function\"),\n        Can_only_convert_string_concatenation: diag(95154, ts.DiagnosticCategory.Message, \"Can_only_convert_string_concatenation_95154\", \"Can only convert string concatenation\"),\n        Selection_is_not_a_valid_statement_or_statements: diag(95155, ts.DiagnosticCategory.Message, \"Selection_is_not_a_valid_statement_or_statements_95155\", \"Selection is not a valid statement or statements\"),\n        Add_missing_function_declaration_0: diag(95156, ts.DiagnosticCategory.Message, \"Add_missing_function_declaration_0_95156\", \"Add missing function declaration '{0}'\"),\n        Add_all_missing_function_declarations: diag(95157, ts.DiagnosticCategory.Message, \"Add_all_missing_function_declarations_95157\", \"Add all missing function declarations\"),\n        Method_not_implemented: diag(95158, ts.DiagnosticCategory.Message, \"Method_not_implemented_95158\", \"Method not implemented.\"),\n        Function_not_implemented: diag(95159, ts.DiagnosticCategory.Message, \"Function_not_implemented_95159\", \"Function not implemented.\"),\n        No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, ts.DiagnosticCategory.Error, \"No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004\", \"No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer.\"),\n        Classes_may_not_have_a_field_named_constructor: diag(18006, ts.DiagnosticCategory.Error, \"Classes_may_not_have_a_field_named_constructor_18006\", \"Classes may not have a field named 'constructor'.\"),\n        JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, ts.DiagnosticCategory.Error, \"JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007\", \"JSX expressions may not use the comma operator. Did you mean to write an array?\"),\n        Private_identifiers_cannot_be_used_as_parameters: diag(18009, ts.DiagnosticCategory.Error, \"Private_identifiers_cannot_be_used_as_parameters_18009\", \"Private identifiers cannot be used as parameters.\"),\n        An_accessibility_modifier_cannot_be_used_with_a_private_identifier: diag(18010, ts.DiagnosticCategory.Error, \"An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010\", \"An accessibility modifier cannot be used with a private identifier.\"),\n        The_operand_of_a_delete_operator_cannot_be_a_private_identifier: diag(18011, ts.DiagnosticCategory.Error, \"The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011\", \"The operand of a 'delete' operator cannot be a private identifier.\"),\n        constructor_is_a_reserved_word: diag(18012, ts.DiagnosticCategory.Error, \"constructor_is_a_reserved_word_18012\", \"'#constructor' is a reserved word.\"),\n        Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier: diag(18013, ts.DiagnosticCategory.Error, \"Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013\", \"Property '{0}' is not accessible outside class '{1}' because it has a private identifier.\"),\n        The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling: diag(18014, ts.DiagnosticCategory.Error, \"The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014\", \"The property '{0}' cannot be accessed on type '{1}' within this class because it is shadowed by another private identifier with the same spelling.\"),\n        Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2: diag(18015, ts.DiagnosticCategory.Error, \"Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015\", \"Property '{0}' in type '{1}' refers to a different member that cannot be accessed from within type '{2}'.\"),\n        Private_identifiers_are_not_allowed_outside_class_bodies: diag(18016, ts.DiagnosticCategory.Error, \"Private_identifiers_are_not_allowed_outside_class_bodies_18016\", \"Private identifiers are not allowed outside class bodies.\"),\n        The_shadowing_declaration_of_0_is_defined_here: diag(18017, ts.DiagnosticCategory.Error, \"The_shadowing_declaration_of_0_is_defined_here_18017\", \"The shadowing declaration of '{0}' is defined here\"),\n        The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here: diag(18018, ts.DiagnosticCategory.Error, \"The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018\", \"The declaration of '{0}' that you probably intended to use is defined here\"),\n        _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, ts.DiagnosticCategory.Error, \"_0_modifier_cannot_be_used_with_a_private_identifier_18019\", \"'{0}' modifier cannot be used with a private identifier.\"),\n        A_method_cannot_be_named_with_a_private_identifier: diag(18022, ts.DiagnosticCategory.Error, \"A_method_cannot_be_named_with_a_private_identifier_18022\", \"A method cannot be named with a private identifier.\"),\n        An_accessor_cannot_be_named_with_a_private_identifier: diag(18023, ts.DiagnosticCategory.Error, \"An_accessor_cannot_be_named_with_a_private_identifier_18023\", \"An accessor cannot be named with a private identifier.\"),\n        An_enum_member_cannot_be_named_with_a_private_identifier: diag(18024, ts.DiagnosticCategory.Error, \"An_enum_member_cannot_be_named_with_a_private_identifier_18024\", \"An enum member cannot be named with a private identifier.\"),\n        can_only_be_used_at_the_start_of_a_file: diag(18026, ts.DiagnosticCategory.Error, \"can_only_be_used_at_the_start_of_a_file_18026\", \"'#!' can only be used at the start of a file.\"),\n        Compiler_reserves_name_0_when_emitting_private_identifier_downlevel: diag(18027, ts.DiagnosticCategory.Error, \"Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027\", \"Compiler reserves name '{0}' when emitting private identifier downlevel.\"),\n        Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher: diag(18028, ts.DiagnosticCategory.Error, \"Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028\", \"Private identifiers are only available when targeting ECMAScript 2015 and higher.\"),\n        Private_identifiers_are_not_allowed_in_variable_declarations: diag(18029, ts.DiagnosticCategory.Error, \"Private_identifiers_are_not_allowed_in_variable_declarations_18029\", \"Private identifiers are not allowed in variable declarations.\"),\n        An_optional_chain_cannot_contain_private_identifiers: diag(18030, ts.DiagnosticCategory.Error, \"An_optional_chain_cannot_contain_private_identifiers_18030\", \"An optional chain cannot contain private identifiers.\"),\n        The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents: diag(18031, ts.DiagnosticCategory.Error, \"The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031\", \"The intersection '{0}' was reduced to 'never' because property '{1}' has conflicting types in some constituents.\"),\n        The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some: diag(18032, ts.DiagnosticCategory.Error, \"The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032\", \"The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some.\"),\n        Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhaustiveness_checks_consider_using_an_object_literal_instead: diag(18033, ts.DiagnosticCategory.Error, \"Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhau_18033\", \"Only numeric enums can have computed members, but this expression has type '{0}'. If you do not need exhaustiveness checks, consider using an object literal instead.\"),\n        Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment: diag(18034, ts.DiagnosticCategory.Message, \"Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compi_18034\", \"Specify the JSX fragment factory function to use when targeting 'react' JSX emit with 'jsxFactory' compiler option is specified, e.g. 'Fragment'.\"),\n        Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name: diag(18035, ts.DiagnosticCategory.Error, \"Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035\", \"Invalid value for 'jsxFragmentFactory'. '{0}' is not a valid identifier or qualified-name.\"),\n    };\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    var _a;\n    /* @internal */\n    function tokenIsIdentifierOrKeyword(token) {\n        return token >= 78 /* Identifier */;\n    }\n    ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword;\n    /* @internal */\n    function tokenIsIdentifierOrKeywordOrGreaterThan(token) {\n        return token === 31 /* GreaterThanToken */ || tokenIsIdentifierOrKeyword(token);\n    }\n    ts.tokenIsIdentifierOrKeywordOrGreaterThan = tokenIsIdentifierOrKeywordOrGreaterThan;\n    var textToKeywordObj = (_a = {\n            abstract: 125 /* AbstractKeyword */,\n            any: 128 /* AnyKeyword */,\n            as: 126 /* AsKeyword */,\n            asserts: 127 /* AssertsKeyword */,\n            bigint: 155 /* BigIntKeyword */,\n            boolean: 131 /* BooleanKeyword */,\n            break: 80 /* BreakKeyword */,\n            case: 81 /* CaseKeyword */,\n            catch: 82 /* CatchKeyword */,\n            class: 83 /* ClassKeyword */,\n            continue: 85 /* ContinueKeyword */,\n            const: 84 /* ConstKeyword */\n        },\n        _a[\"\" + \"constructor\"] = 132 /* ConstructorKeyword */,\n        _a.debugger = 86 /* DebuggerKeyword */,\n        _a.declare = 133 /* DeclareKeyword */,\n        _a.default = 87 /* DefaultKeyword */,\n        _a.delete = 88 /* DeleteKeyword */,\n        _a.do = 89 /* DoKeyword */,\n        _a.else = 90 /* ElseKeyword */,\n        _a.enum = 91 /* EnumKeyword */,\n        _a.export = 92 /* ExportKeyword */,\n        _a.extends = 93 /* ExtendsKeyword */,\n        _a.false = 94 /* FalseKeyword */,\n        _a.finally = 95 /* FinallyKeyword */,\n        _a.for = 96 /* ForKeyword */,\n        _a.from = 153 /* FromKeyword */,\n        _a.function = 97 /* FunctionKeyword */,\n        _a.get = 134 /* GetKeyword */,\n        _a.if = 98 /* IfKeyword */,\n        _a.implements = 116 /* ImplementsKeyword */,\n        _a.import = 99 /* ImportKeyword */,\n        _a.in = 100 /* InKeyword */,\n        _a.infer = 135 /* InferKeyword */,\n        _a.instanceof = 101 /* InstanceOfKeyword */,\n        _a.interface = 117 /* InterfaceKeyword */,\n        _a.intrinsic = 136 /* IntrinsicKeyword */,\n        _a.is = 137 /* IsKeyword */,\n        _a.keyof = 138 /* KeyOfKeyword */,\n        _a.let = 118 /* LetKeyword */,\n        _a.module = 139 /* ModuleKeyword */,\n        _a.namespace = 140 /* NamespaceKeyword */,\n        _a.never = 141 /* NeverKeyword */,\n        _a.new = 102 /* NewKeyword */,\n        _a.null = 103 /* NullKeyword */,\n        _a.number = 144 /* NumberKeyword */,\n        _a.object = 145 /* ObjectKeyword */,\n        _a.package = 119 /* PackageKeyword */,\n        _a.private = 120 /* PrivateKeyword */,\n        _a.protected = 121 /* ProtectedKeyword */,\n        _a.public = 122 /* PublicKeyword */,\n        _a.readonly = 142 /* ReadonlyKeyword */,\n        _a.require = 143 /* RequireKeyword */,\n        _a.global = 154 /* GlobalKeyword */,\n        _a.return = 104 /* ReturnKeyword */,\n        _a.set = 146 /* SetKeyword */,\n        _a.static = 123 /* StaticKeyword */,\n        _a.string = 147 /* StringKeyword */,\n        _a.super = 105 /* SuperKeyword */,\n        _a.switch = 106 /* SwitchKeyword */,\n        _a.symbol = 148 /* SymbolKeyword */,\n        _a.this = 107 /* ThisKeyword */,\n        _a.throw = 108 /* ThrowKeyword */,\n        _a.true = 109 /* TrueKeyword */,\n        _a.try = 110 /* TryKeyword */,\n        _a.type = 149 /* TypeKeyword */,\n        _a.typeof = 111 /* TypeOfKeyword */,\n        _a.undefined = 150 /* UndefinedKeyword */,\n        _a.unique = 151 /* UniqueKeyword */,\n        _a.unknown = 152 /* UnknownKeyword */,\n        _a.var = 112 /* VarKeyword */,\n        _a.void = 113 /* VoidKeyword */,\n        _a.while = 114 /* WhileKeyword */,\n        _a.with = 115 /* WithKeyword */,\n        _a.yield = 124 /* YieldKeyword */,\n        _a.async = 129 /* AsyncKeyword */,\n        _a.await = 130 /* AwaitKeyword */,\n        _a.of = 156 /* OfKeyword */,\n        _a);\n    var textToKeyword = new ts.Map(ts.getEntries(textToKeywordObj));\n    var textToToken = new ts.Map(ts.getEntries(__assign(__assign({}, textToKeywordObj), { \"{\": 18 /* OpenBraceToken */, \"}\": 19 /* CloseBraceToken */, \"(\": 20 /* OpenParenToken */, \")\": 21 /* CloseParenToken */, \"[\": 22 /* OpenBracketToken */, \"]\": 23 /* CloseBracketToken */, \".\": 24 /* DotToken */, \"...\": 25 /* DotDotDotToken */, \";\": 26 /* SemicolonToken */, \",\": 27 /* CommaToken */, \"<\": 29 /* LessThanToken */, \">\": 31 /* GreaterThanToken */, \"<=\": 32 /* LessThanEqualsToken */, \">=\": 33 /* GreaterThanEqualsToken */, \"==\": 34 /* EqualsEqualsToken */, \"!=\": 35 /* ExclamationEqualsToken */, \"===\": 36 /* EqualsEqualsEqualsToken */, \"!==\": 37 /* ExclamationEqualsEqualsToken */, \"=>\": 38 /* EqualsGreaterThanToken */, \"+\": 39 /* PlusToken */, \"-\": 40 /* MinusToken */, \"**\": 42 /* AsteriskAsteriskToken */, \"*\": 41 /* AsteriskToken */, \"/\": 43 /* SlashToken */, \"%\": 44 /* PercentToken */, \"++\": 45 /* PlusPlusToken */, \"--\": 46 /* MinusMinusToken */, \"<<\": 47 /* LessThanLessThanToken */, \"</\": 30 /* LessThanSlashToken */, \">>\": 48 /* GreaterThanGreaterThanToken */, \">>>\": 49 /* GreaterThanGreaterThanGreaterThanToken */, \"&\": 50 /* AmpersandToken */, \"|\": 51 /* BarToken */, \"^\": 52 /* CaretToken */, \"!\": 53 /* ExclamationToken */, \"~\": 54 /* TildeToken */, \"&&\": 55 /* AmpersandAmpersandToken */, \"||\": 56 /* BarBarToken */, \"?\": 57 /* QuestionToken */, \"??\": 60 /* QuestionQuestionToken */, \"?.\": 28 /* QuestionDotToken */, \":\": 58 /* ColonToken */, \"=\": 62 /* EqualsToken */, \"+=\": 63 /* PlusEqualsToken */, \"-=\": 64 /* MinusEqualsToken */, \"*=\": 65 /* AsteriskEqualsToken */, \"**=\": 66 /* AsteriskAsteriskEqualsToken */, \"/=\": 67 /* SlashEqualsToken */, \"%=\": 68 /* PercentEqualsToken */, \"<<=\": 69 /* LessThanLessThanEqualsToken */, \">>=\": 70 /* GreaterThanGreaterThanEqualsToken */, \">>>=\": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, \"&=\": 72 /* AmpersandEqualsToken */, \"|=\": 73 /* BarEqualsToken */, \"^=\": 77 /* CaretEqualsToken */, \"||=\": 74 /* BarBarEqualsToken */, \"&&=\": 75 /* AmpersandAmpersandEqualsToken */, \"??=\": 76 /* QuestionQuestionEqualsToken */, \"@\": 59 /* AtToken */, \"`\": 61 /* BacktickToken */ })));\n    /*\n        As per ECMAScript Language Specification 3th Edition, Section 7.6: Identifiers\n        IdentifierStart ::\n            Can contain Unicode 3.0.0 categories:\n            Uppercase letter (Lu),\n            Lowercase letter (Ll),\n            Titlecase letter (Lt),\n            Modifier letter (Lm),\n            Other letter (Lo), or\n            Letter number (Nl).\n        IdentifierPart :: =\n            Can contain IdentifierStart + Unicode 3.0.0 categories:\n            Non-spacing mark (Mn),\n            Combining spacing mark (Mc),\n            Decimal number (Nd), or\n            Connector punctuation (Pc).\n\n        Codepoint ranges for ES3 Identifiers are extracted from the Unicode 3.0.0 specification at:\n        http://www.unicode.org/Public/3.0-Update/UnicodeData-3.0.0.txt\n    */\n    var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];\n    var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];\n    /*\n        As per ECMAScript Language Specification 5th Edition, Section 7.6: ISyntaxToken Names and Identifiers\n        IdentifierStart ::\n            Can contain Unicode 6.2 categories:\n            Uppercase letter (Lu),\n            Lowercase letter (Ll),\n            Titlecase letter (Lt),\n            Modifier letter (Lm),\n            Other letter (Lo), or\n            Letter number (Nl).\n        IdentifierPart ::\n            Can contain IdentifierStart + Unicode 6.2 categories:\n            Non-spacing mark (Mn),\n            Combining spacing mark (Mc),\n            Decimal number (Nd),\n            Connector punctuation (Pc),\n            <ZWNJ>, or\n            <ZWJ>.\n\n        Codepoint ranges for ES5 Identifiers are extracted from the Unicode 6.2 specification at:\n        http://www.unicode.org/Public/6.2.0/ucd/UnicodeData.txt\n    */\n    var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];\n    var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,];\n    /**\n     * Generated by scripts/regenerate-unicode-identifier-parts.js on node v12.4.0 with unicode 12.1\n     * based on http://www.unicode.org/reports/tr31/ and https://www.ecma-international.org/ecma-262/6.0/#sec-names-and-keywords\n     * unicodeESNextIdentifierStart corresponds to the ID_Start and Other_ID_Start property, and\n     * unicodeESNextIdentifierPart corresponds to ID_Continue, Other_ID_Continue, plus ID_Start and Other_ID_Start\n     */\n    var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 895, 895, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1488, 1514, 1519, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2144, 2154, 2208, 2228, 2230, 2237, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2432, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2556, 2556, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2809, 2809, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3133, 3160, 3162, 3168, 3169, 3200, 3200, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3412, 3414, 3423, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6264, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6430, 6480, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7401, 7404, 7406, 7411, 7413, 7414, 7418, 7418, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43261, 43262, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43488, 43492, 43494, 43503, 43514, 43518, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43646, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66335, 66349, 66378, 66384, 66421, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68096, 68112, 68115, 68117, 68119, 68121, 68149, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68324, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68899, 69376, 69404, 69415, 69415, 69424, 69445, 69600, 69622, 69635, 69687, 69763, 69807, 69840, 69864, 69891, 69926, 69956, 69956, 69968, 70002, 70006, 70006, 70019, 70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70366, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70461, 70461, 70480, 70480, 70493, 70497, 70656, 70708, 70727, 70730, 70751, 70751, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086, 71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424, 71450, 71680, 71723, 71840, 71903, 71935, 71935, 72096, 72103, 72106, 72144, 72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272, 72272, 72284, 72329, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72750, 72768, 72768, 72818, 72847, 72960, 72966, 72968, 72969, 72971, 73008, 73030, 73030, 73056, 73061, 73063, 73064, 73066, 73097, 73112, 73112, 73440, 73458, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92880, 92909, 92928, 92975, 92992, 92995, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94032, 94032, 94099, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 123136, 123180, 123191, 123197, 123214, 123214, 123584, 123627, 124928, 125124, 125184, 125251, 125259, 125259, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101];\n    var unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999];\n    /**\n     * Test for whether a single line comment's text contains a directive.\n     */\n    var commentDirectiveRegExSingleLine = /^\\s*\\/\\/\\/?\\s*@(ts-expect-error|ts-ignore)/;\n    /**\n     * Test for whether a multi-line comment's last line contains a directive.\n     */\n    var commentDirectiveRegExMultiLine = /^\\s*(?:\\/|\\*)*\\s*@(ts-expect-error|ts-ignore)/;\n    function lookupInUnicodeMap(code, map) {\n        // Bail out quickly if it couldn't possibly be in the map.\n        if (code < map[0]) {\n            return false;\n        }\n        // Perform binary search in one of the Unicode range maps\n        var lo = 0;\n        var hi = map.length;\n        var mid;\n        while (lo + 1 < hi) {\n            mid = lo + (hi - lo) / 2;\n            // mid has to be even to catch a range's beginning\n            mid -= mid % 2;\n            if (map[mid] <= code && code <= map[mid + 1]) {\n                return true;\n            }\n            if (code < map[mid]) {\n                hi = mid;\n            }\n            else {\n                lo = mid + 2;\n            }\n        }\n        return false;\n    }\n    /* @internal */ function isUnicodeIdentifierStart(code, languageVersion) {\n        return languageVersion >= 2 /* ES2015 */ ?\n            lookupInUnicodeMap(code, unicodeESNextIdentifierStart) :\n            languageVersion === 1 /* ES5 */ ? lookupInUnicodeMap(code, unicodeES5IdentifierStart) :\n                lookupInUnicodeMap(code, unicodeES3IdentifierStart);\n    }\n    ts.isUnicodeIdentifierStart = isUnicodeIdentifierStart;\n    function isUnicodeIdentifierPart(code, languageVersion) {\n        return languageVersion >= 2 /* ES2015 */ ?\n            lookupInUnicodeMap(code, unicodeESNextIdentifierPart) :\n            languageVersion === 1 /* ES5 */ ? lookupInUnicodeMap(code, unicodeES5IdentifierPart) :\n                lookupInUnicodeMap(code, unicodeES3IdentifierPart);\n    }\n    function makeReverseMap(source) {\n        var result = [];\n        source.forEach(function (value, name) {\n            result[value] = name;\n        });\n        return result;\n    }\n    var tokenStrings = makeReverseMap(textToToken);\n    function tokenToString(t) {\n        return tokenStrings[t];\n    }\n    ts.tokenToString = tokenToString;\n    /* @internal */\n    function stringToToken(s) {\n        return textToToken.get(s);\n    }\n    ts.stringToToken = stringToToken;\n    /* @internal */\n    function computeLineStarts(text) {\n        var result = new Array();\n        var pos = 0;\n        var lineStart = 0;\n        while (pos < text.length) {\n            var ch = text.charCodeAt(pos);\n            pos++;\n            switch (ch) {\n                case 13 /* carriageReturn */:\n                    if (text.charCodeAt(pos) === 10 /* lineFeed */) {\n                        pos++;\n                    }\n                // falls through\n                case 10 /* lineFeed */:\n                    result.push(lineStart);\n                    lineStart = pos;\n                    break;\n                default:\n                    if (ch > 127 /* maxAsciiCharacter */ && isLineBreak(ch)) {\n                        result.push(lineStart);\n                        lineStart = pos;\n                    }\n                    break;\n            }\n        }\n        result.push(lineStart);\n        return result;\n    }\n    ts.computeLineStarts = computeLineStarts;\n    function getPositionOfLineAndCharacter(sourceFile, line, character, allowEdits) {\n        return sourceFile.getPositionOfLineAndCharacter ?\n            sourceFile.getPositionOfLineAndCharacter(line, character, allowEdits) :\n            computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, allowEdits);\n    }\n    ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter;\n    /* @internal */\n    function computePositionOfLineAndCharacter(lineStarts, line, character, debugText, allowEdits) {\n        if (line < 0 || line >= lineStarts.length) {\n            if (allowEdits) {\n                // Clamp line to nearest allowable value\n                line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line;\n            }\n            else {\n                ts.Debug.fail(\"Bad line number. Line: \" + line + \", lineStarts.length: \" + lineStarts.length + \" , line map is correct? \" + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : \"unknown\"));\n            }\n        }\n        var res = lineStarts[line] + character;\n        if (allowEdits) {\n            // Clamp to nearest allowable values to allow the underlying to be edited without crashing (accuracy is lost, instead)\n            // TODO: Somehow track edits between file as it was during the creation of sourcemap we have and the current file and\n            // apply them to the computed position to improve accuracy\n            return res > lineStarts[line + 1] ? lineStarts[line + 1] : typeof debugText === \"string\" && res > debugText.length ? debugText.length : res;\n        }\n        if (line < lineStarts.length - 1) {\n            ts.Debug.assert(res < lineStarts[line + 1]);\n        }\n        else if (debugText !== undefined) {\n            ts.Debug.assert(res <= debugText.length); // Allow single character overflow for trailing newline\n        }\n        return res;\n    }\n    ts.computePositionOfLineAndCharacter = computePositionOfLineAndCharacter;\n    /* @internal */\n    function getLineStarts(sourceFile) {\n        return sourceFile.lineMap || (sourceFile.lineMap = computeLineStarts(sourceFile.text));\n    }\n    ts.getLineStarts = getLineStarts;\n    /* @internal */\n    function computeLineAndCharacterOfPosition(lineStarts, position) {\n        var lineNumber = computeLineOfPosition(lineStarts, position);\n        return {\n            line: lineNumber,\n            character: position - lineStarts[lineNumber]\n        };\n    }\n    ts.computeLineAndCharacterOfPosition = computeLineAndCharacterOfPosition;\n    /**\n     * @internal\n     * We assume the first line starts at position 0 and 'position' is non-negative.\n     */\n    function computeLineOfPosition(lineStarts, position, lowerBound) {\n        var lineNumber = ts.binarySearch(lineStarts, position, ts.identity, ts.compareValues, lowerBound);\n        if (lineNumber < 0) {\n            // If the actual position was not found,\n            // the binary search returns the 2's-complement of the next line start\n            // e.g. if the line starts at [5, 10, 23, 80] and the position requested was 20\n            // then the search will return -2.\n            //\n            // We want the index of the previous line start, so we subtract 1.\n            // Review 2's-complement if this is confusing.\n            lineNumber = ~lineNumber - 1;\n            ts.Debug.assert(lineNumber !== -1, \"position cannot precede the beginning of the file\");\n        }\n        return lineNumber;\n    }\n    ts.computeLineOfPosition = computeLineOfPosition;\n    /** @internal */\n    function getLinesBetweenPositions(sourceFile, pos1, pos2) {\n        if (pos1 === pos2)\n            return 0;\n        var lineStarts = getLineStarts(sourceFile);\n        var lower = Math.min(pos1, pos2);\n        var isNegative = lower === pos2;\n        var upper = isNegative ? pos1 : pos2;\n        var lowerLine = computeLineOfPosition(lineStarts, lower);\n        var upperLine = computeLineOfPosition(lineStarts, upper, lowerLine);\n        return isNegative ? lowerLine - upperLine : upperLine - lowerLine;\n    }\n    ts.getLinesBetweenPositions = getLinesBetweenPositions;\n    function getLineAndCharacterOfPosition(sourceFile, position) {\n        return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position);\n    }\n    ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition;\n    function isWhiteSpaceLike(ch) {\n        return isWhiteSpaceSingleLine(ch) || isLineBreak(ch);\n    }\n    ts.isWhiteSpaceLike = isWhiteSpaceLike;\n    /** Does not include line breaks. For that, see isWhiteSpaceLike. */\n    function isWhiteSpaceSingleLine(ch) {\n        // Note: nextLine is in the Zs space, and should be considered to be a whitespace.\n        // It is explicitly not a line-break as it isn't in the exact set specified by EcmaScript.\n        return ch === 32 /* space */ ||\n            ch === 9 /* tab */ ||\n            ch === 11 /* verticalTab */ ||\n            ch === 12 /* formFeed */ ||\n            ch === 160 /* nonBreakingSpace */ ||\n            ch === 133 /* nextLine */ ||\n            ch === 5760 /* ogham */ ||\n            ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ ||\n            ch === 8239 /* narrowNoBreakSpace */ ||\n            ch === 8287 /* mathematicalSpace */ ||\n            ch === 12288 /* ideographicSpace */ ||\n            ch === 65279 /* byteOrderMark */;\n    }\n    ts.isWhiteSpaceSingleLine = isWhiteSpaceSingleLine;\n    function isLineBreak(ch) {\n        // ES5 7.3:\n        // The ECMAScript line terminator characters are listed in Table 3.\n        //     Table 3: Line Terminator Characters\n        //     Code Unit Value     Name                    Formal Name\n        //     \\u000A              Line Feed               <LF>\n        //     \\u000D              Carriage Return         <CR>\n        //     \\u2028              Line separator          <LS>\n        //     \\u2029              Paragraph separator     <PS>\n        // Only the characters in Table 3 are treated as line terminators. Other new line or line\n        // breaking characters are treated as white space but not as line terminators.\n        return ch === 10 /* lineFeed */ ||\n            ch === 13 /* carriageReturn */ ||\n            ch === 8232 /* lineSeparator */ ||\n            ch === 8233 /* paragraphSeparator */;\n    }\n    ts.isLineBreak = isLineBreak;\n    function isDigit(ch) {\n        return ch >= 48 /* _0 */ && ch <= 57 /* _9 */;\n    }\n    function isHexDigit(ch) {\n        return isDigit(ch) || ch >= 65 /* A */ && ch <= 70 /* F */ || ch >= 97 /* a */ && ch <= 102 /* f */;\n    }\n    function isCodePoint(code) {\n        return code <= 0x10FFFF;\n    }\n    /* @internal */\n    function isOctalDigit(ch) {\n        return ch >= 48 /* _0 */ && ch <= 55 /* _7 */;\n    }\n    ts.isOctalDigit = isOctalDigit;\n    function couldStartTrivia(text, pos) {\n        // Keep in sync with skipTrivia\n        var ch = text.charCodeAt(pos);\n        switch (ch) {\n            case 13 /* carriageReturn */:\n            case 10 /* lineFeed */:\n            case 9 /* tab */:\n            case 11 /* verticalTab */:\n            case 12 /* formFeed */:\n            case 32 /* space */:\n            case 47 /* slash */:\n            // starts of normal trivia\n            // falls through\n            case 60 /* lessThan */:\n            case 124 /* bar */:\n            case 61 /* equals */:\n            case 62 /* greaterThan */:\n                // Starts of conflict marker trivia\n                return true;\n            case 35 /* hash */:\n                // Only if its the beginning can we have #! trivia\n                return pos === 0;\n            default:\n                return ch > 127 /* maxAsciiCharacter */;\n        }\n    }\n    ts.couldStartTrivia = couldStartTrivia;\n    /* @internal */\n    function skipTrivia(text, pos, stopAfterLineBreak, stopAtComments) {\n        if (stopAtComments === void 0) { stopAtComments = false; }\n        if (ts.positionIsSynthesized(pos)) {\n            return pos;\n        }\n        // Keep in sync with couldStartTrivia\n        while (true) {\n            var ch = text.charCodeAt(pos);\n            switch (ch) {\n                case 13 /* carriageReturn */:\n                    if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) {\n                        pos++;\n                    }\n                // falls through\n                case 10 /* lineFeed */:\n                    pos++;\n                    if (stopAfterLineBreak) {\n                        return pos;\n                    }\n                    continue;\n                case 9 /* tab */:\n                case 11 /* verticalTab */:\n                case 12 /* formFeed */:\n                case 32 /* space */:\n                    pos++;\n                    continue;\n                case 47 /* slash */:\n                    if (stopAtComments) {\n                        break;\n                    }\n                    if (text.charCodeAt(pos + 1) === 47 /* slash */) {\n                        pos += 2;\n                        while (pos < text.length) {\n                            if (isLineBreak(text.charCodeAt(pos))) {\n                                break;\n                            }\n                            pos++;\n                        }\n                        continue;\n                    }\n                    if (text.charCodeAt(pos + 1) === 42 /* asterisk */) {\n                        pos += 2;\n                        while (pos < text.length) {\n                            if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) {\n                                pos += 2;\n                                break;\n                            }\n                            pos++;\n                        }\n                        continue;\n                    }\n                    break;\n                case 60 /* lessThan */:\n                case 124 /* bar */:\n                case 61 /* equals */:\n                case 62 /* greaterThan */:\n                    if (isConflictMarkerTrivia(text, pos)) {\n                        pos = scanConflictMarkerTrivia(text, pos);\n                        continue;\n                    }\n                    break;\n                case 35 /* hash */:\n                    if (pos === 0 && isShebangTrivia(text, pos)) {\n                        pos = scanShebangTrivia(text, pos);\n                        continue;\n                    }\n                    break;\n                default:\n                    if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpaceLike(ch))) {\n                        pos++;\n                        continue;\n                    }\n                    break;\n            }\n            return pos;\n        }\n    }\n    ts.skipTrivia = skipTrivia;\n    // All conflict markers consist of the same character repeated seven times.  If it is\n    // a <<<<<<< or >>>>>>> marker then it is also followed by a space.\n    var mergeConflictMarkerLength = \"<<<<<<<\".length;\n    function isConflictMarkerTrivia(text, pos) {\n        ts.Debug.assert(pos >= 0);\n        // Conflict markers must be at the start of a line.\n        if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) {\n            var ch = text.charCodeAt(pos);\n            if ((pos + mergeConflictMarkerLength) < text.length) {\n                for (var i = 0; i < mergeConflictMarkerLength; i++) {\n                    if (text.charCodeAt(pos + i) !== ch) {\n                        return false;\n                    }\n                }\n                return ch === 61 /* equals */ ||\n                    text.charCodeAt(pos + mergeConflictMarkerLength) === 32 /* space */;\n            }\n        }\n        return false;\n    }\n    function scanConflictMarkerTrivia(text, pos, error) {\n        if (error) {\n            error(ts.Diagnostics.Merge_conflict_marker_encountered, pos, mergeConflictMarkerLength);\n        }\n        var ch = text.charCodeAt(pos);\n        var len = text.length;\n        if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) {\n            while (pos < len && !isLineBreak(text.charCodeAt(pos))) {\n                pos++;\n            }\n        }\n        else {\n            ts.Debug.assert(ch === 124 /* bar */ || ch === 61 /* equals */);\n            // Consume everything from the start of a ||||||| or ======= marker to the start\n            // of the next ======= or >>>>>>> marker.\n            while (pos < len) {\n                var currentChar = text.charCodeAt(pos);\n                if ((currentChar === 61 /* equals */ || currentChar === 62 /* greaterThan */) && currentChar !== ch && isConflictMarkerTrivia(text, pos)) {\n                    break;\n                }\n                pos++;\n            }\n        }\n        return pos;\n    }\n    var shebangTriviaRegex = /^#!.*/;\n    /*@internal*/\n    function isShebangTrivia(text, pos) {\n        // Shebangs check must only be done at the start of the file\n        ts.Debug.assert(pos === 0);\n        return shebangTriviaRegex.test(text);\n    }\n    ts.isShebangTrivia = isShebangTrivia;\n    /*@internal*/\n    function scanShebangTrivia(text, pos) {\n        var shebang = shebangTriviaRegex.exec(text)[0];\n        pos = pos + shebang.length;\n        return pos;\n    }\n    ts.scanShebangTrivia = scanShebangTrivia;\n    /**\n     * Invokes a callback for each comment range following the provided position.\n     *\n     * Single-line comment ranges include the leading double-slash characters but not the ending\n     * line break. Multi-line comment ranges include the leading slash-asterisk and trailing\n     * asterisk-slash characters.\n     *\n     * @param reduce If true, accumulates the result of calling the callback in a fashion similar\n     *      to reduceLeft. If false, iteration stops when the callback returns a truthy value.\n     * @param text The source text to scan.\n     * @param pos The position at which to start scanning.\n     * @param trailing If false, whitespace is skipped until the first line break and comments\n     *      between that location and the next token are returned. If true, comments occurring\n     *      between the given position and the next line break are returned.\n     * @param cb The callback to execute as each comment range is encountered.\n     * @param state A state value to pass to each iteration of the callback.\n     * @param initial An initial value to pass when accumulating results (when \"reduce\" is true).\n     * @returns If \"reduce\" is true, the accumulated value. If \"reduce\" is false, the first truthy\n     *      return value of the callback.\n     */\n    function iterateCommentRanges(reduce, text, pos, trailing, cb, state, initial) {\n        var pendingPos;\n        var pendingEnd;\n        var pendingKind;\n        var pendingHasTrailingNewLine;\n        var hasPendingCommentRange = false;\n        var collecting = trailing;\n        var accumulator = initial;\n        if (pos === 0) {\n            collecting = true;\n            var shebang = getShebang(text);\n            if (shebang) {\n                pos = shebang.length;\n            }\n        }\n        scan: while (pos >= 0 && pos < text.length) {\n            var ch = text.charCodeAt(pos);\n            switch (ch) {\n                case 13 /* carriageReturn */:\n                    if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) {\n                        pos++;\n                    }\n                // falls through\n                case 10 /* lineFeed */:\n                    pos++;\n                    if (trailing) {\n                        break scan;\n                    }\n                    collecting = true;\n                    if (hasPendingCommentRange) {\n                        pendingHasTrailingNewLine = true;\n                    }\n                    continue;\n                case 9 /* tab */:\n                case 11 /* verticalTab */:\n                case 12 /* formFeed */:\n                case 32 /* space */:\n                    pos++;\n                    continue;\n                case 47 /* slash */:\n                    var nextChar = text.charCodeAt(pos + 1);\n                    var hasTrailingNewLine = false;\n                    if (nextChar === 47 /* slash */ || nextChar === 42 /* asterisk */) {\n                        var kind = nextChar === 47 /* slash */ ? 2 /* SingleLineCommentTrivia */ : 3 /* MultiLineCommentTrivia */;\n                        var startPos = pos;\n                        pos += 2;\n                        if (nextChar === 47 /* slash */) {\n                            while (pos < text.length) {\n                                if (isLineBreak(text.charCodeAt(pos))) {\n                                    hasTrailingNewLine = true;\n                                    break;\n                                }\n                                pos++;\n                            }\n                        }\n                        else {\n                            while (pos < text.length) {\n                                if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) {\n                                    pos += 2;\n                                    break;\n                                }\n                                pos++;\n                            }\n                        }\n                        if (collecting) {\n                            if (hasPendingCommentRange) {\n                                accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator);\n                                if (!reduce && accumulator) {\n                                    // If we are not reducing and we have a truthy result, return it.\n                                    return accumulator;\n                                }\n                            }\n                            pendingPos = startPos;\n                            pendingEnd = pos;\n                            pendingKind = kind;\n                            pendingHasTrailingNewLine = hasTrailingNewLine;\n                            hasPendingCommentRange = true;\n                        }\n                        continue;\n                    }\n                    break scan;\n                default:\n                    if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpaceLike(ch))) {\n                        if (hasPendingCommentRange && isLineBreak(ch)) {\n                            pendingHasTrailingNewLine = true;\n                        }\n                        pos++;\n                        continue;\n                    }\n                    break scan;\n            }\n        }\n        if (hasPendingCommentRange) {\n            accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator);\n        }\n        return accumulator;\n    }\n    function forEachLeadingCommentRange(text, pos, cb, state) {\n        return iterateCommentRanges(/*reduce*/ false, text, pos, /*trailing*/ false, cb, state);\n    }\n    ts.forEachLeadingCommentRange = forEachLeadingCommentRange;\n    function forEachTrailingCommentRange(text, pos, cb, state) {\n        return iterateCommentRanges(/*reduce*/ false, text, pos, /*trailing*/ true, cb, state);\n    }\n    ts.forEachTrailingCommentRange = forEachTrailingCommentRange;\n    function reduceEachLeadingCommentRange(text, pos, cb, state, initial) {\n        return iterateCommentRanges(/*reduce*/ true, text, pos, /*trailing*/ false, cb, state, initial);\n    }\n    ts.reduceEachLeadingCommentRange = reduceEachLeadingCommentRange;\n    function reduceEachTrailingCommentRange(text, pos, cb, state, initial) {\n        return iterateCommentRanges(/*reduce*/ true, text, pos, /*trailing*/ true, cb, state, initial);\n    }\n    ts.reduceEachTrailingCommentRange = reduceEachTrailingCommentRange;\n    function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments) {\n        if (!comments) {\n            comments = [];\n        }\n        comments.push({ kind: kind, pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine });\n        return comments;\n    }\n    function getLeadingCommentRanges(text, pos) {\n        return reduceEachLeadingCommentRange(text, pos, appendCommentRange, /*state*/ undefined, /*initial*/ undefined);\n    }\n    ts.getLeadingCommentRanges = getLeadingCommentRanges;\n    function getTrailingCommentRanges(text, pos) {\n        return reduceEachTrailingCommentRange(text, pos, appendCommentRange, /*state*/ undefined, /*initial*/ undefined);\n    }\n    ts.getTrailingCommentRanges = getTrailingCommentRanges;\n    /** Optionally, get the shebang */\n    function getShebang(text) {\n        var match = shebangTriviaRegex.exec(text);\n        if (match) {\n            return match[0];\n        }\n    }\n    ts.getShebang = getShebang;\n    function isIdentifierStart(ch, languageVersion) {\n        return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ ||\n            ch === 36 /* $ */ || ch === 95 /* _ */ ||\n            ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);\n    }\n    ts.isIdentifierStart = isIdentifierStart;\n    function isIdentifierPart(ch, languageVersion, identifierVariant) {\n        return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ ||\n            ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ ||\n            // \"-\" and \":\" are valid in JSX Identifiers\n            (identifierVariant === 1 /* JSX */ ? (ch === 45 /* minus */ || ch === 58 /* colon */) : false) ||\n            ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);\n    }\n    ts.isIdentifierPart = isIdentifierPart;\n    /* @internal */\n    function isIdentifierText(name, languageVersion, identifierVariant) {\n        var ch = codePointAt(name, 0);\n        if (!isIdentifierStart(ch, languageVersion)) {\n            return false;\n        }\n        for (var i = charSize(ch); i < name.length; i += charSize(ch)) {\n            if (!isIdentifierPart(ch = codePointAt(name, i), languageVersion, identifierVariant)) {\n                return false;\n            }\n        }\n        return true;\n    }\n    ts.isIdentifierText = isIdentifierText;\n    // Creates a scanner over a (possibly unspecified) range of a piece of text.\n    function createScanner(languageVersion, skipTrivia, languageVariant, textInitial, onError, start, length) {\n        if (languageVariant === void 0) { languageVariant = 0 /* Standard */; }\n        var text = textInitial;\n        // Current position (end position of text of current token)\n        var pos;\n        // end of text\n        var end;\n        // Start position of whitespace before current token\n        var startPos;\n        // Start position of text of current token\n        var tokenPos;\n        var token;\n        var tokenValue;\n        var tokenFlags;\n        var commentDirectives;\n        var inJSDocType = 0;\n        setText(text, start, length);\n        var scanner = {\n            getStartPos: function () { return startPos; },\n            getTextPos: function () { return pos; },\n            getToken: function () { return token; },\n            getTokenPos: function () { return tokenPos; },\n            getTokenText: function () { return text.substring(tokenPos, pos); },\n            getTokenValue: function () { return tokenValue; },\n            hasUnicodeEscape: function () { return (tokenFlags & 1024 /* UnicodeEscape */) !== 0; },\n            hasExtendedUnicodeEscape: function () { return (tokenFlags & 8 /* ExtendedUnicodeEscape */) !== 0; },\n            hasPrecedingLineBreak: function () { return (tokenFlags & 1 /* PrecedingLineBreak */) !== 0; },\n            hasPrecedingJSDocComment: function () { return (tokenFlags & 2 /* PrecedingJSDocComment */) !== 0; },\n            isIdentifier: function () { return token === 78 /* Identifier */ || token > 115 /* LastReservedWord */; },\n            isReservedWord: function () { return token >= 80 /* FirstReservedWord */ && token <= 115 /* LastReservedWord */; },\n            isUnterminated: function () { return (tokenFlags & 4 /* Unterminated */) !== 0; },\n            getCommentDirectives: function () { return commentDirectives; },\n            getNumericLiteralFlags: function () { return tokenFlags & 1008 /* NumericLiteralFlags */; },\n            getTokenFlags: function () { return tokenFlags; },\n            reScanGreaterToken: reScanGreaterToken,\n            reScanAsteriskEqualsToken: reScanAsteriskEqualsToken,\n            reScanSlashToken: reScanSlashToken,\n            reScanTemplateToken: reScanTemplateToken,\n            reScanTemplateHeadOrNoSubstitutionTemplate: reScanTemplateHeadOrNoSubstitutionTemplate,\n            scanJsxIdentifier: scanJsxIdentifier,\n            scanJsxAttributeValue: scanJsxAttributeValue,\n            reScanJsxAttributeValue: reScanJsxAttributeValue,\n            reScanJsxToken: reScanJsxToken,\n            reScanLessThanToken: reScanLessThanToken,\n            reScanQuestionToken: reScanQuestionToken,\n            reScanInvalidIdentifier: reScanInvalidIdentifier,\n            scanJsxToken: scanJsxToken,\n            scanJsDocToken: scanJsDocToken,\n            scan: scan,\n            getText: getText,\n            clearCommentDirectives: clearCommentDirectives,\n            setText: setText,\n            setScriptTarget: setScriptTarget,\n            setLanguageVariant: setLanguageVariant,\n            setOnError: setOnError,\n            setTextPos: setTextPos,\n            setInJSDocType: setInJSDocType,\n            tryScan: tryScan,\n            lookAhead: lookAhead,\n            scanRange: scanRange,\n        };\n        if (ts.Debug.isDebugging) {\n            Object.defineProperty(scanner, \"__debugShowCurrentPositionInText\", {\n                get: function () {\n                    var text = scanner.getText();\n                    return text.slice(0, scanner.getStartPos()) + \"║\" + text.slice(scanner.getStartPos());\n                },\n            });\n        }\n        return scanner;\n        function error(message, errPos, length) {\n            if (errPos === void 0) { errPos = pos; }\n            if (onError) {\n                var oldPos = pos;\n                pos = errPos;\n                onError(message, length || 0);\n                pos = oldPos;\n            }\n        }\n        function scanNumberFragment() {\n            var start = pos;\n            var allowSeparator = false;\n            var isPreviousTokenSeparator = false;\n            var result = \"\";\n            while (true) {\n                var ch = text.charCodeAt(pos);\n                if (ch === 95 /* _ */) {\n                    tokenFlags |= 512 /* ContainsSeparator */;\n                    if (allowSeparator) {\n                        allowSeparator = false;\n                        isPreviousTokenSeparator = true;\n                        result += text.substring(start, pos);\n                    }\n                    else if (isPreviousTokenSeparator) {\n                        error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1);\n                    }\n                    else {\n                        error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1);\n                    }\n                    pos++;\n                    start = pos;\n                    continue;\n                }\n                if (isDigit(ch)) {\n                    allowSeparator = true;\n                    isPreviousTokenSeparator = false;\n                    pos++;\n                    continue;\n                }\n                break;\n            }\n            if (text.charCodeAt(pos - 1) === 95 /* _ */) {\n                error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1);\n            }\n            return result + text.substring(start, pos);\n        }\n        function scanNumber() {\n            var start = pos;\n            var mainFragment = scanNumberFragment();\n            var decimalFragment;\n            var scientificFragment;\n            if (text.charCodeAt(pos) === 46 /* dot */) {\n                pos++;\n                decimalFragment = scanNumberFragment();\n            }\n            var end = pos;\n            if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) {\n                pos++;\n                tokenFlags |= 16 /* Scientific */;\n                if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */)\n                    pos++;\n                var preNumericPart = pos;\n                var finalFragment = scanNumberFragment();\n                if (!finalFragment) {\n                    error(ts.Diagnostics.Digit_expected);\n                }\n                else {\n                    scientificFragment = text.substring(end, preNumericPart) + finalFragment;\n                    end = pos;\n                }\n            }\n            var result;\n            if (tokenFlags & 512 /* ContainsSeparator */) {\n                result = mainFragment;\n                if (decimalFragment) {\n                    result += \".\" + decimalFragment;\n                }\n                if (scientificFragment) {\n                    result += scientificFragment;\n                }\n            }\n            else {\n                result = text.substring(start, end); // No need to use all the fragments; no _ removal needed\n            }\n            if (decimalFragment !== undefined || tokenFlags & 16 /* Scientific */) {\n                checkForIdentifierStartAfterNumericLiteral(start, decimalFragment === undefined && !!(tokenFlags & 16 /* Scientific */));\n                return {\n                    type: 8 /* NumericLiteral */,\n                    value: \"\" + +result // if value is not an integer, it can be safely coerced to a number\n                };\n            }\n            else {\n                tokenValue = result;\n                var type = checkBigIntSuffix(); // if value is an integer, check whether it is a bigint\n                checkForIdentifierStartAfterNumericLiteral(start);\n                return { type: type, value: tokenValue };\n            }\n        }\n        function checkForIdentifierStartAfterNumericLiteral(numericStart, isScientific) {\n            if (!isIdentifierStart(codePointAt(text, pos), languageVersion)) {\n                return;\n            }\n            var identifierStart = pos;\n            var length = scanIdentifierParts().length;\n            if (length === 1 && text[identifierStart] === \"n\") {\n                if (isScientific) {\n                    error(ts.Diagnostics.A_bigint_literal_cannot_use_exponential_notation, numericStart, identifierStart - numericStart + 1);\n                }\n                else {\n                    error(ts.Diagnostics.A_bigint_literal_must_be_an_integer, numericStart, identifierStart - numericStart + 1);\n                }\n            }\n            else {\n                error(ts.Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal, identifierStart, length);\n                pos = identifierStart;\n            }\n        }\n        function scanOctalDigits() {\n            var start = pos;\n            while (isOctalDigit(text.charCodeAt(pos))) {\n                pos++;\n            }\n            return +(text.substring(start, pos));\n        }\n        /**\n         * Scans the given number of hexadecimal digits in the text,\n         * returning -1 if the given number is unavailable.\n         */\n        function scanExactNumberOfHexDigits(count, canHaveSeparators) {\n            var valueString = scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ false, canHaveSeparators);\n            return valueString ? parseInt(valueString, 16) : -1;\n        }\n        /**\n         * Scans as many hexadecimal digits as are available in the text,\n         * returning \"\" if the given number of digits was unavailable.\n         */\n        function scanMinimumNumberOfHexDigits(count, canHaveSeparators) {\n            return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ true, canHaveSeparators);\n        }\n        function scanHexDigits(minCount, scanAsManyAsPossible, canHaveSeparators) {\n            var valueChars = [];\n            var allowSeparator = false;\n            var isPreviousTokenSeparator = false;\n            while (valueChars.length < minCount || scanAsManyAsPossible) {\n                var ch = text.charCodeAt(pos);\n                if (canHaveSeparators && ch === 95 /* _ */) {\n                    tokenFlags |= 512 /* ContainsSeparator */;\n                    if (allowSeparator) {\n                        allowSeparator = false;\n                        isPreviousTokenSeparator = true;\n                    }\n                    else if (isPreviousTokenSeparator) {\n                        error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1);\n                    }\n                    else {\n                        error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1);\n                    }\n                    pos++;\n                    continue;\n                }\n                allowSeparator = canHaveSeparators;\n                if (ch >= 65 /* A */ && ch <= 70 /* F */) {\n                    ch += 97 /* a */ - 65 /* A */; // standardize hex literals to lowercase\n                }\n                else if (!((ch >= 48 /* _0 */ && ch <= 57 /* _9 */) ||\n                    (ch >= 97 /* a */ && ch <= 102 /* f */))) {\n                    break;\n                }\n                valueChars.push(ch);\n                pos++;\n                isPreviousTokenSeparator = false;\n            }\n            if (valueChars.length < minCount) {\n                valueChars = [];\n            }\n            if (text.charCodeAt(pos - 1) === 95 /* _ */) {\n                error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1);\n            }\n            return String.fromCharCode.apply(String, valueChars);\n        }\n        function scanString(jsxAttributeString) {\n            if (jsxAttributeString === void 0) { jsxAttributeString = false; }\n            var quote = text.charCodeAt(pos);\n            pos++;\n            var result = \"\";\n            var start = pos;\n            while (true) {\n                if (pos >= end) {\n                    result += text.substring(start, pos);\n                    tokenFlags |= 4 /* Unterminated */;\n                    error(ts.Diagnostics.Unterminated_string_literal);\n                    break;\n                }\n                var ch = text.charCodeAt(pos);\n                if (ch === quote) {\n                    result += text.substring(start, pos);\n                    pos++;\n                    break;\n                }\n                if (ch === 92 /* backslash */ && !jsxAttributeString) {\n                    result += text.substring(start, pos);\n                    result += scanEscapeSequence();\n                    start = pos;\n                    continue;\n                }\n                if (isLineBreak(ch) && !jsxAttributeString) {\n                    result += text.substring(start, pos);\n                    tokenFlags |= 4 /* Unterminated */;\n                    error(ts.Diagnostics.Unterminated_string_literal);\n                    break;\n                }\n                pos++;\n            }\n            return result;\n        }\n        /**\n         * Sets the current 'tokenValue' and returns a NoSubstitutionTemplateLiteral or\n         * a literal component of a TemplateExpression.\n         */\n        function scanTemplateAndSetTokenValue(isTaggedTemplate) {\n            var startedWithBacktick = text.charCodeAt(pos) === 96 /* backtick */;\n            pos++;\n            var start = pos;\n            var contents = \"\";\n            var resultingToken;\n            while (true) {\n                if (pos >= end) {\n                    contents += text.substring(start, pos);\n                    tokenFlags |= 4 /* Unterminated */;\n                    error(ts.Diagnostics.Unterminated_template_literal);\n                    resultingToken = startedWithBacktick ? 14 /* NoSubstitutionTemplateLiteral */ : 17 /* TemplateTail */;\n                    break;\n                }\n                var currChar = text.charCodeAt(pos);\n                // '`'\n                if (currChar === 96 /* backtick */) {\n                    contents += text.substring(start, pos);\n                    pos++;\n                    resultingToken = startedWithBacktick ? 14 /* NoSubstitutionTemplateLiteral */ : 17 /* TemplateTail */;\n                    break;\n                }\n                // '${'\n                if (currChar === 36 /* $ */ && pos + 1 < end && text.charCodeAt(pos + 1) === 123 /* openBrace */) {\n                    contents += text.substring(start, pos);\n                    pos += 2;\n                    resultingToken = startedWithBacktick ? 15 /* TemplateHead */ : 16 /* TemplateMiddle */;\n                    break;\n                }\n                // Escape character\n                if (currChar === 92 /* backslash */) {\n                    contents += text.substring(start, pos);\n                    contents += scanEscapeSequence(isTaggedTemplate);\n                    start = pos;\n                    continue;\n                }\n                // Speculated ECMAScript 6 Spec 11.8.6.1:\n                // <CR><LF> and <CR> LineTerminatorSequences are normalized to <LF> for Template Values\n                if (currChar === 13 /* carriageReturn */) {\n                    contents += text.substring(start, pos);\n                    pos++;\n                    if (pos < end && text.charCodeAt(pos) === 10 /* lineFeed */) {\n                        pos++;\n                    }\n                    contents += \"\\n\";\n                    start = pos;\n                    continue;\n                }\n                pos++;\n            }\n            ts.Debug.assert(resultingToken !== undefined);\n            tokenValue = contents;\n            return resultingToken;\n        }\n        function scanEscapeSequence(isTaggedTemplate) {\n            var start = pos;\n            pos++;\n            if (pos >= end) {\n                error(ts.Diagnostics.Unexpected_end_of_text);\n                return \"\";\n            }\n            var ch = text.charCodeAt(pos);\n            pos++;\n            switch (ch) {\n                case 48 /* _0 */:\n                    // '\\01'\n                    if (isTaggedTemplate && pos < end && isDigit(text.charCodeAt(pos))) {\n                        pos++;\n                        tokenFlags |= 2048 /* ContainsInvalidEscape */;\n                        return text.substring(start, pos);\n                    }\n                    return \"\\0\";\n                case 98 /* b */:\n                    return \"\\b\";\n                case 116 /* t */:\n                    return \"\\t\";\n                case 110 /* n */:\n                    return \"\\n\";\n                case 118 /* v */:\n                    return \"\\v\";\n                case 102 /* f */:\n                    return \"\\f\";\n                case 114 /* r */:\n                    return \"\\r\";\n                case 39 /* singleQuote */:\n                    return \"\\'\";\n                case 34 /* doubleQuote */:\n                    return \"\\\"\";\n                case 117 /* u */:\n                    if (isTaggedTemplate) {\n                        // '\\u' or '\\u0' or '\\u00' or '\\u000'\n                        for (var escapePos = pos; escapePos < pos + 4; escapePos++) {\n                            if (escapePos < end && !isHexDigit(text.charCodeAt(escapePos)) && text.charCodeAt(escapePos) !== 123 /* openBrace */) {\n                                pos = escapePos;\n                                tokenFlags |= 2048 /* ContainsInvalidEscape */;\n                                return text.substring(start, pos);\n                            }\n                        }\n                    }\n                    // '\\u{DDDDDDDD}'\n                    if (pos < end && text.charCodeAt(pos) === 123 /* openBrace */) {\n                        pos++;\n                        // '\\u{'\n                        if (isTaggedTemplate && !isHexDigit(text.charCodeAt(pos))) {\n                            tokenFlags |= 2048 /* ContainsInvalidEscape */;\n                            return text.substring(start, pos);\n                        }\n                        if (isTaggedTemplate) {\n                            var savePos = pos;\n                            var escapedValueString = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false);\n                            var escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;\n                            // '\\u{Not Code Point' or '\\u{CodePoint'\n                            if (!isCodePoint(escapedValue) || text.charCodeAt(pos) !== 125 /* closeBrace */) {\n                                tokenFlags |= 2048 /* ContainsInvalidEscape */;\n                                return text.substring(start, pos);\n                            }\n                            else {\n                                pos = savePos;\n                            }\n                        }\n                        tokenFlags |= 8 /* ExtendedUnicodeEscape */;\n                        return scanExtendedUnicodeEscape();\n                    }\n                    tokenFlags |= 1024 /* UnicodeEscape */;\n                    // '\\uDDDD'\n                    return scanHexadecimalEscape(/*numDigits*/ 4);\n                case 120 /* x */:\n                    if (isTaggedTemplate) {\n                        if (!isHexDigit(text.charCodeAt(pos))) {\n                            tokenFlags |= 2048 /* ContainsInvalidEscape */;\n                            return text.substring(start, pos);\n                        }\n                        else if (!isHexDigit(text.charCodeAt(pos + 1))) {\n                            pos++;\n                            tokenFlags |= 2048 /* ContainsInvalidEscape */;\n                            return text.substring(start, pos);\n                        }\n                    }\n                    // '\\xDD'\n                    return scanHexadecimalEscape(/*numDigits*/ 2);\n                // when encountering a LineContinuation (i.e. a backslash and a line terminator sequence),\n                // the line terminator is interpreted to be \"the empty code unit sequence\".\n                case 13 /* carriageReturn */:\n                    if (pos < end && text.charCodeAt(pos) === 10 /* lineFeed */) {\n                        pos++;\n                    }\n                // falls through\n                case 10 /* lineFeed */:\n                case 8232 /* lineSeparator */:\n                case 8233 /* paragraphSeparator */:\n                    return \"\";\n                default:\n                    return String.fromCharCode(ch);\n            }\n        }\n        function scanHexadecimalEscape(numDigits) {\n            var escapedValue = scanExactNumberOfHexDigits(numDigits, /*canHaveSeparators*/ false);\n            if (escapedValue >= 0) {\n                return String.fromCharCode(escapedValue);\n            }\n            else {\n                error(ts.Diagnostics.Hexadecimal_digit_expected);\n                return \"\";\n            }\n        }\n        function scanExtendedUnicodeEscape() {\n            var escapedValueString = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false);\n            var escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;\n            var isInvalidExtendedEscape = false;\n            // Validate the value of the digit\n            if (escapedValue < 0) {\n                error(ts.Diagnostics.Hexadecimal_digit_expected);\n                isInvalidExtendedEscape = true;\n            }\n            else if (escapedValue > 0x10FFFF) {\n                error(ts.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);\n                isInvalidExtendedEscape = true;\n            }\n            if (pos >= end) {\n                error(ts.Diagnostics.Unexpected_end_of_text);\n                isInvalidExtendedEscape = true;\n            }\n            else if (text.charCodeAt(pos) === 125 /* closeBrace */) {\n                // Only swallow the following character up if it's a '}'.\n                pos++;\n            }\n            else {\n                error(ts.Diagnostics.Unterminated_Unicode_escape_sequence);\n                isInvalidExtendedEscape = true;\n            }\n            if (isInvalidExtendedEscape) {\n                return \"\";\n            }\n            return utf16EncodeAsString(escapedValue);\n        }\n        // Current character is known to be a backslash. Check for Unicode escape of the form '\\uXXXX'\n        // and return code point value if valid Unicode escape is found. Otherwise return -1.\n        function peekUnicodeEscape() {\n            if (pos + 5 < end && text.charCodeAt(pos + 1) === 117 /* u */) {\n                var start_1 = pos;\n                pos += 2;\n                var value = scanExactNumberOfHexDigits(4, /*canHaveSeparators*/ false);\n                pos = start_1;\n                return value;\n            }\n            return -1;\n        }\n        function peekExtendedUnicodeEscape() {\n            if (languageVersion >= 2 /* ES2015 */ && codePointAt(text, pos + 1) === 117 /* u */ && codePointAt(text, pos + 2) === 123 /* openBrace */) {\n                var start_2 = pos;\n                pos += 3;\n                var escapedValueString = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false);\n                var escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;\n                pos = start_2;\n                return escapedValue;\n            }\n            return -1;\n        }\n        function scanIdentifierParts() {\n            var result = \"\";\n            var start = pos;\n            while (pos < end) {\n                var ch = codePointAt(text, pos);\n                if (isIdentifierPart(ch, languageVersion)) {\n                    pos += charSize(ch);\n                }\n                else if (ch === 92 /* backslash */) {\n                    ch = peekExtendedUnicodeEscape();\n                    if (ch >= 0 && isIdentifierPart(ch, languageVersion)) {\n                        pos += 3;\n                        tokenFlags |= 8 /* ExtendedUnicodeEscape */;\n                        result += scanExtendedUnicodeEscape();\n                        start = pos;\n                        continue;\n                    }\n                    ch = peekUnicodeEscape();\n                    if (!(ch >= 0 && isIdentifierPart(ch, languageVersion))) {\n                        break;\n                    }\n                    tokenFlags |= 1024 /* UnicodeEscape */;\n                    result += text.substring(start, pos);\n                    result += utf16EncodeAsString(ch);\n                    // Valid Unicode escape is always six characters\n                    pos += 6;\n                    start = pos;\n                }\n                else {\n                    break;\n                }\n            }\n            result += text.substring(start, pos);\n            return result;\n        }\n        function getIdentifierToken() {\n            // Reserved words are between 2 and 12 characters long and start with a lowercase letter\n            var len = tokenValue.length;\n            if (len >= 2 && len <= 12) {\n                var ch = tokenValue.charCodeAt(0);\n                if (ch >= 97 /* a */ && ch <= 122 /* z */) {\n                    var keyword = textToKeyword.get(tokenValue);\n                    if (keyword !== undefined) {\n                        return token = keyword;\n                    }\n                }\n            }\n            return token = 78 /* Identifier */;\n        }\n        function scanBinaryOrOctalDigits(base) {\n            var value = \"\";\n            // For counting number of digits; Valid binaryIntegerLiteral must have at least one binary digit following B or b.\n            // Similarly valid octalIntegerLiteral must have at least one octal digit following o or O.\n            var separatorAllowed = false;\n            var isPreviousTokenSeparator = false;\n            while (true) {\n                var ch = text.charCodeAt(pos);\n                // Numeric separators are allowed anywhere within a numeric literal, except not at the beginning, or following another separator\n                if (ch === 95 /* _ */) {\n                    tokenFlags |= 512 /* ContainsSeparator */;\n                    if (separatorAllowed) {\n                        separatorAllowed = false;\n                        isPreviousTokenSeparator = true;\n                    }\n                    else if (isPreviousTokenSeparator) {\n                        error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1);\n                    }\n                    else {\n                        error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1);\n                    }\n                    pos++;\n                    continue;\n                }\n                separatorAllowed = true;\n                if (!isDigit(ch) || ch - 48 /* _0 */ >= base) {\n                    break;\n                }\n                value += text[pos];\n                pos++;\n                isPreviousTokenSeparator = false;\n            }\n            if (text.charCodeAt(pos - 1) === 95 /* _ */) {\n                // Literal ends with underscore - not allowed\n                error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1);\n            }\n            return value;\n        }\n        function checkBigIntSuffix() {\n            if (text.charCodeAt(pos) === 110 /* n */) {\n                tokenValue += \"n\";\n                // Use base 10 instead of base 2 or base 8 for shorter literals\n                if (tokenFlags & 384 /* BinaryOrOctalSpecifier */) {\n                    tokenValue = ts.parsePseudoBigInt(tokenValue) + \"n\";\n                }\n                pos++;\n                return 9 /* BigIntLiteral */;\n            }\n            else { // not a bigint, so can convert to number in simplified form\n                // Number() may not support 0b or 0o, so use parseInt() instead\n                var numericValue = tokenFlags & 128 /* BinarySpecifier */\n                    ? parseInt(tokenValue.slice(2), 2) // skip \"0b\"\n                    : tokenFlags & 256 /* OctalSpecifier */\n                        ? parseInt(tokenValue.slice(2), 8) // skip \"0o\"\n                        : +tokenValue;\n                tokenValue = \"\" + numericValue;\n                return 8 /* NumericLiteral */;\n            }\n        }\n        function scan() {\n            var _a;\n            startPos = pos;\n            tokenFlags = 0 /* None */;\n            var asteriskSeen = false;\n            while (true) {\n                tokenPos = pos;\n                if (pos >= end) {\n                    return token = 1 /* EndOfFileToken */;\n                }\n                var ch = codePointAt(text, pos);\n                // Special handling for shebang\n                if (ch === 35 /* hash */ && pos === 0 && isShebangTrivia(text, pos)) {\n                    pos = scanShebangTrivia(text, pos);\n                    if (skipTrivia) {\n                        continue;\n                    }\n                    else {\n                        return token = 6 /* ShebangTrivia */;\n                    }\n                }\n                switch (ch) {\n                    case 10 /* lineFeed */:\n                    case 13 /* carriageReturn */:\n                        tokenFlags |= 1 /* PrecedingLineBreak */;\n                        if (skipTrivia) {\n                            pos++;\n                            continue;\n                        }\n                        else {\n                            if (ch === 13 /* carriageReturn */ && pos + 1 < end && text.charCodeAt(pos + 1) === 10 /* lineFeed */) {\n                                // consume both CR and LF\n                                pos += 2;\n                            }\n                            else {\n                                pos++;\n                            }\n                            return token = 4 /* NewLineTrivia */;\n                        }\n                    case 9 /* tab */:\n                    case 11 /* verticalTab */:\n                    case 12 /* formFeed */:\n                    case 32 /* space */:\n                    case 160 /* nonBreakingSpace */:\n                    case 5760 /* ogham */:\n                    case 8192 /* enQuad */:\n                    case 8193 /* emQuad */:\n                    case 8194 /* enSpace */:\n                    case 8195 /* emSpace */:\n                    case 8196 /* threePerEmSpace */:\n                    case 8197 /* fourPerEmSpace */:\n                    case 8198 /* sixPerEmSpace */:\n                    case 8199 /* figureSpace */:\n                    case 8200 /* punctuationSpace */:\n                    case 8201 /* thinSpace */:\n                    case 8202 /* hairSpace */:\n                    case 8203 /* zeroWidthSpace */:\n                    case 8239 /* narrowNoBreakSpace */:\n                    case 8287 /* mathematicalSpace */:\n                    case 12288 /* ideographicSpace */:\n                    case 65279 /* byteOrderMark */:\n                        if (skipTrivia) {\n                            pos++;\n                            continue;\n                        }\n                        else {\n                            while (pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos))) {\n                                pos++;\n                            }\n                            return token = 5 /* WhitespaceTrivia */;\n                        }\n                    case 33 /* exclamation */:\n                        if (text.charCodeAt(pos + 1) === 61 /* equals */) {\n                            if (text.charCodeAt(pos + 2) === 61 /* equals */) {\n                                return pos += 3, token = 37 /* ExclamationEqualsEqualsToken */;\n                            }\n                            return pos += 2, token = 35 /* ExclamationEqualsToken */;\n                        }\n                        pos++;\n                        return token = 53 /* ExclamationToken */;\n                    case 34 /* doubleQuote */:\n                    case 39 /* singleQuote */:\n                        tokenValue = scanString();\n                        return token = 10 /* StringLiteral */;\n                    case 96 /* backtick */:\n                        return token = scanTemplateAndSetTokenValue(/* isTaggedTemplate */ false);\n                    case 37 /* percent */:\n                        if (text.charCodeAt(pos + 1) === 61 /* equals */) {\n                            return pos += 2, token = 68 /* PercentEqualsToken */;\n                        }\n                        pos++;\n                        return token = 44 /* PercentToken */;\n                    case 38 /* ampersand */:\n                        if (text.charCodeAt(pos + 1) === 38 /* ampersand */) {\n                            if (text.charCodeAt(pos + 2) === 61 /* equals */) {\n                                return pos += 3, token = 75 /* AmpersandAmpersandEqualsToken */;\n                            }\n                            return pos += 2, token = 55 /* AmpersandAmpersandToken */;\n                        }\n                        if (text.charCodeAt(pos + 1) === 61 /* equals */) {\n                            return pos += 2, token = 72 /* AmpersandEqualsToken */;\n                        }\n                        pos++;\n                        return token = 50 /* AmpersandToken */;\n                    case 40 /* openParen */:\n                        pos++;\n                        return token = 20 /* OpenParenToken */;\n                    case 41 /* closeParen */:\n                        pos++;\n                        return token = 21 /* CloseParenToken */;\n                    case 42 /* asterisk */:\n                        if (text.charCodeAt(pos + 1) === 61 /* equals */) {\n                            return pos += 2, token = 65 /* AsteriskEqualsToken */;\n                        }\n                        if (text.charCodeAt(pos + 1) === 42 /* asterisk */) {\n                            if (text.charCodeAt(pos + 2) === 61 /* equals */) {\n                                return pos += 3, token = 66 /* AsteriskAsteriskEqualsToken */;\n                            }\n                            return pos += 2, token = 42 /* AsteriskAsteriskToken */;\n                        }\n                        pos++;\n                        if (inJSDocType && !asteriskSeen && (tokenFlags & 1 /* PrecedingLineBreak */)) {\n                            // decoration at the start of a JSDoc comment line\n                            asteriskSeen = true;\n                            continue;\n                        }\n                        return token = 41 /* AsteriskToken */;\n                    case 43 /* plus */:\n                        if (text.charCodeAt(pos + 1) === 43 /* plus */) {\n                            return pos += 2, token = 45 /* PlusPlusToken */;\n                        }\n                        if (text.charCodeAt(pos + 1) === 61 /* equals */) {\n                            return pos += 2, token = 63 /* PlusEqualsToken */;\n                        }\n                        pos++;\n                        return token = 39 /* PlusToken */;\n                    case 44 /* comma */:\n                        pos++;\n                        return token = 27 /* CommaToken */;\n                    case 45 /* minus */:\n                        if (text.charCodeAt(pos + 1) === 45 /* minus */) {\n                            return pos += 2, token = 46 /* MinusMinusToken */;\n                        }\n                        if (text.charCodeAt(pos + 1) === 61 /* equals */) {\n                            return pos += 2, token = 64 /* MinusEqualsToken */;\n                        }\n                        pos++;\n                        return token = 40 /* MinusToken */;\n                    case 46 /* dot */:\n                        if (isDigit(text.charCodeAt(pos + 1))) {\n                            tokenValue = scanNumber().value;\n                            return token = 8 /* NumericLiteral */;\n                        }\n                        if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) {\n                            return pos += 3, token = 25 /* DotDotDotToken */;\n                        }\n                        pos++;\n                        return token = 24 /* DotToken */;\n                    case 47 /* slash */:\n                        // Single-line comment\n                        if (text.charCodeAt(pos + 1) === 47 /* slash */) {\n                            pos += 2;\n                            while (pos < end) {\n                                if (isLineBreak(text.charCodeAt(pos))) {\n                                    break;\n                                }\n                                pos++;\n                            }\n                            commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(tokenPos, pos), commentDirectiveRegExSingleLine, tokenPos);\n                            if (skipTrivia) {\n                                continue;\n                            }\n                            else {\n                                return token = 2 /* SingleLineCommentTrivia */;\n                            }\n                        }\n                        // Multi-line comment\n                        if (text.charCodeAt(pos + 1) === 42 /* asterisk */) {\n                            pos += 2;\n                            if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) !== 47 /* slash */) {\n                                tokenFlags |= 2 /* PrecedingJSDocComment */;\n                            }\n                            var commentClosed = false;\n                            var lastLineStart = tokenPos;\n                            while (pos < end) {\n                                var ch_1 = text.charCodeAt(pos);\n                                if (ch_1 === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) {\n                                    pos += 2;\n                                    commentClosed = true;\n                                    break;\n                                }\n                                pos++;\n                                if (isLineBreak(ch_1)) {\n                                    lastLineStart = pos;\n                                    tokenFlags |= 1 /* PrecedingLineBreak */;\n                                }\n                            }\n                            commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart);\n                            if (!commentClosed) {\n                                error(ts.Diagnostics.Asterisk_Slash_expected);\n                            }\n                            if (skipTrivia) {\n                                continue;\n                            }\n                            else {\n                                if (!commentClosed) {\n                                    tokenFlags |= 4 /* Unterminated */;\n                                }\n                                return token = 3 /* MultiLineCommentTrivia */;\n                            }\n                        }\n                        if (text.charCodeAt(pos + 1) === 61 /* equals */) {\n                            return pos += 2, token = 67 /* SlashEqualsToken */;\n                        }\n                        pos++;\n                        return token = 43 /* SlashToken */;\n                    case 48 /* _0 */:\n                        if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) {\n                            pos += 2;\n                            tokenValue = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ true);\n                            if (!tokenValue) {\n                                error(ts.Diagnostics.Hexadecimal_digit_expected);\n                                tokenValue = \"0\";\n                            }\n                            tokenValue = \"0x\" + tokenValue;\n                            tokenFlags |= 64 /* HexSpecifier */;\n                            return token = checkBigIntSuffix();\n                        }\n                        else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 /* B */ || text.charCodeAt(pos + 1) === 98 /* b */)) {\n                            pos += 2;\n                            tokenValue = scanBinaryOrOctalDigits(/* base */ 2);\n                            if (!tokenValue) {\n                                error(ts.Diagnostics.Binary_digit_expected);\n                                tokenValue = \"0\";\n                            }\n                            tokenValue = \"0b\" + tokenValue;\n                            tokenFlags |= 128 /* BinarySpecifier */;\n                            return token = checkBigIntSuffix();\n                        }\n                        else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 /* O */ || text.charCodeAt(pos + 1) === 111 /* o */)) {\n                            pos += 2;\n                            tokenValue = scanBinaryOrOctalDigits(/* base */ 8);\n                            if (!tokenValue) {\n                                error(ts.Diagnostics.Octal_digit_expected);\n                                tokenValue = \"0\";\n                            }\n                            tokenValue = \"0o\" + tokenValue;\n                            tokenFlags |= 256 /* OctalSpecifier */;\n                            return token = checkBigIntSuffix();\n                        }\n                        // Try to parse as an octal\n                        if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) {\n                            tokenValue = \"\" + scanOctalDigits();\n                            tokenFlags |= 32 /* Octal */;\n                            return token = 8 /* NumericLiteral */;\n                        }\n                    // This fall-through is a deviation from the EcmaScript grammar. The grammar says that a leading zero\n                    // can only be followed by an octal digit, a dot, or the end of the number literal. However, we are being\n                    // permissive and allowing decimal digits of the form 08* and 09* (which many browsers also do).\n                    // falls through\n                    case 49 /* _1 */:\n                    case 50 /* _2 */:\n                    case 51 /* _3 */:\n                    case 52 /* _4 */:\n                    case 53 /* _5 */:\n                    case 54 /* _6 */:\n                    case 55 /* _7 */:\n                    case 56 /* _8 */:\n                    case 57 /* _9 */:\n                        (_a = scanNumber(), token = _a.type, tokenValue = _a.value);\n                        return token;\n                    case 58 /* colon */:\n                        pos++;\n                        return token = 58 /* ColonToken */;\n                    case 59 /* semicolon */:\n                        pos++;\n                        return token = 26 /* SemicolonToken */;\n                    case 60 /* lessThan */:\n                        if (isConflictMarkerTrivia(text, pos)) {\n                            pos = scanConflictMarkerTrivia(text, pos, error);\n                            if (skipTrivia) {\n                                continue;\n                            }\n                            else {\n                                return token = 7 /* ConflictMarkerTrivia */;\n                            }\n                        }\n                        if (text.charCodeAt(pos + 1) === 60 /* lessThan */) {\n                            if (text.charCodeAt(pos + 2) === 61 /* equals */) {\n                                return pos += 3, token = 69 /* LessThanLessThanEqualsToken */;\n                            }\n                            return pos += 2, token = 47 /* LessThanLessThanToken */;\n                        }\n                        if (text.charCodeAt(pos + 1) === 61 /* equals */) {\n                            return pos += 2, token = 32 /* LessThanEqualsToken */;\n                        }\n                        if (languageVariant === 1 /* JSX */ &&\n                            text.charCodeAt(pos + 1) === 47 /* slash */ &&\n                            text.charCodeAt(pos + 2) !== 42 /* asterisk */) {\n                            return pos += 2, token = 30 /* LessThanSlashToken */;\n                        }\n                        pos++;\n                        return token = 29 /* LessThanToken */;\n                    case 61 /* equals */:\n                        if (isConflictMarkerTrivia(text, pos)) {\n                            pos = scanConflictMarkerTrivia(text, pos, error);\n                            if (skipTrivia) {\n                                continue;\n                            }\n                            else {\n                                return token = 7 /* ConflictMarkerTrivia */;\n                            }\n                        }\n                        if (text.charCodeAt(pos + 1) === 61 /* equals */) {\n                            if (text.charCodeAt(pos + 2) === 61 /* equals */) {\n                                return pos += 3, token = 36 /* EqualsEqualsEqualsToken */;\n                            }\n                            return pos += 2, token = 34 /* EqualsEqualsToken */;\n                        }\n                        if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) {\n                            return pos += 2, token = 38 /* EqualsGreaterThanToken */;\n                        }\n                        pos++;\n                        return token = 62 /* EqualsToken */;\n                    case 62 /* greaterThan */:\n                        if (isConflictMarkerTrivia(text, pos)) {\n                            pos = scanConflictMarkerTrivia(text, pos, error);\n                            if (skipTrivia) {\n                                continue;\n                            }\n                            else {\n                                return token = 7 /* ConflictMarkerTrivia */;\n                            }\n                        }\n                        pos++;\n                        return token = 31 /* GreaterThanToken */;\n                    case 63 /* question */:\n                        if (text.charCodeAt(pos + 1) === 46 /* dot */ && !isDigit(text.charCodeAt(pos + 2))) {\n                            return pos += 2, token = 28 /* QuestionDotToken */;\n                        }\n                        if (text.charCodeAt(pos + 1) === 63 /* question */) {\n                            if (text.charCodeAt(pos + 2) === 61 /* equals */) {\n                                return pos += 3, token = 76 /* QuestionQuestionEqualsToken */;\n                            }\n                            return pos += 2, token = 60 /* QuestionQuestionToken */;\n                        }\n                        pos++;\n                        return token = 57 /* QuestionToken */;\n                    case 91 /* openBracket */:\n                        pos++;\n                        return token = 22 /* OpenBracketToken */;\n                    case 93 /* closeBracket */:\n                        pos++;\n                        return token = 23 /* CloseBracketToken */;\n                    case 94 /* caret */:\n                        if (text.charCodeAt(pos + 1) === 61 /* equals */) {\n                            return pos += 2, token = 77 /* CaretEqualsToken */;\n                        }\n                        pos++;\n                        return token = 52 /* CaretToken */;\n                    case 123 /* openBrace */:\n                        pos++;\n                        return token = 18 /* OpenBraceToken */;\n                    case 124 /* bar */:\n                        if (isConflictMarkerTrivia(text, pos)) {\n                            pos = scanConflictMarkerTrivia(text, pos, error);\n                            if (skipTrivia) {\n                                continue;\n                            }\n                            else {\n                                return token = 7 /* ConflictMarkerTrivia */;\n                            }\n                        }\n                        if (text.charCodeAt(pos + 1) === 124 /* bar */) {\n                            if (text.charCodeAt(pos + 2) === 61 /* equals */) {\n                                return pos += 3, token = 74 /* BarBarEqualsToken */;\n                            }\n                            return pos += 2, token = 56 /* BarBarToken */;\n                        }\n                        if (text.charCodeAt(pos + 1) === 61 /* equals */) {\n                            return pos += 2, token = 73 /* BarEqualsToken */;\n                        }\n                        pos++;\n                        return token = 51 /* BarToken */;\n                    case 125 /* closeBrace */:\n                        pos++;\n                        return token = 19 /* CloseBraceToken */;\n                    case 126 /* tilde */:\n                        pos++;\n                        return token = 54 /* TildeToken */;\n                    case 64 /* at */:\n                        pos++;\n                        return token = 59 /* AtToken */;\n                    case 92 /* backslash */:\n                        var extendedCookedChar = peekExtendedUnicodeEscape();\n                        if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {\n                            pos += 3;\n                            tokenFlags |= 8 /* ExtendedUnicodeEscape */;\n                            tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts();\n                            return token = getIdentifierToken();\n                        }\n                        var cookedChar = peekUnicodeEscape();\n                        if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) {\n                            pos += 6;\n                            tokenFlags |= 1024 /* UnicodeEscape */;\n                            tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts();\n                            return token = getIdentifierToken();\n                        }\n                        error(ts.Diagnostics.Invalid_character);\n                        pos++;\n                        return token = 0 /* Unknown */;\n                    case 35 /* hash */:\n                        if (pos !== 0 && text[pos + 1] === \"!\") {\n                            error(ts.Diagnostics.can_only_be_used_at_the_start_of_a_file);\n                            pos++;\n                            return token = 0 /* Unknown */;\n                        }\n                        pos++;\n                        if (isIdentifierStart(ch = text.charCodeAt(pos), languageVersion)) {\n                            pos++;\n                            while (pos < end && isIdentifierPart(ch = text.charCodeAt(pos), languageVersion))\n                                pos++;\n                            tokenValue = text.substring(tokenPos, pos);\n                            if (ch === 92 /* backslash */) {\n                                tokenValue += scanIdentifierParts();\n                            }\n                        }\n                        else {\n                            tokenValue = \"#\";\n                            error(ts.Diagnostics.Invalid_character);\n                        }\n                        return token = 79 /* PrivateIdentifier */;\n                    default:\n                        var identifierKind = scanIdentifier(ch, languageVersion);\n                        if (identifierKind) {\n                            return token = identifierKind;\n                        }\n                        else if (isWhiteSpaceSingleLine(ch)) {\n                            pos += charSize(ch);\n                            continue;\n                        }\n                        else if (isLineBreak(ch)) {\n                            tokenFlags |= 1 /* PrecedingLineBreak */;\n                            pos += charSize(ch);\n                            continue;\n                        }\n                        error(ts.Diagnostics.Invalid_character);\n                        pos += charSize(ch);\n                        return token = 0 /* Unknown */;\n                }\n            }\n        }\n        function reScanInvalidIdentifier() {\n            ts.Debug.assert(token === 0 /* Unknown */, \"'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'.\");\n            pos = tokenPos = startPos;\n            tokenFlags = 0;\n            var ch = codePointAt(text, pos);\n            var identifierKind = scanIdentifier(ch, 99 /* ESNext */);\n            if (identifierKind) {\n                return token = identifierKind;\n            }\n            pos += charSize(ch);\n            return token; // Still `SyntaKind.Unknown`\n        }\n        function scanIdentifier(startCharacter, languageVersion) {\n            var ch = startCharacter;\n            if (isIdentifierStart(ch, languageVersion)) {\n                pos += charSize(ch);\n                while (pos < end && isIdentifierPart(ch = codePointAt(text, pos), languageVersion))\n                    pos += charSize(ch);\n                tokenValue = text.substring(tokenPos, pos);\n                if (ch === 92 /* backslash */) {\n                    tokenValue += scanIdentifierParts();\n                }\n                return getIdentifierToken();\n            }\n        }\n        function reScanGreaterToken() {\n            if (token === 31 /* GreaterThanToken */) {\n                if (text.charCodeAt(pos) === 62 /* greaterThan */) {\n                    if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) {\n                        if (text.charCodeAt(pos + 2) === 61 /* equals */) {\n                            return pos += 3, token = 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */;\n                        }\n                        return pos += 2, token = 49 /* GreaterThanGreaterThanGreaterThanToken */;\n                    }\n                    if (text.charCodeAt(pos + 1) === 61 /* equals */) {\n                        return pos += 2, token = 70 /* GreaterThanGreaterThanEqualsToken */;\n                    }\n                    pos++;\n                    return token = 48 /* GreaterThanGreaterThanToken */;\n                }\n                if (text.charCodeAt(pos) === 61 /* equals */) {\n                    pos++;\n                    return token = 33 /* GreaterThanEqualsToken */;\n                }\n            }\n            return token;\n        }\n        function reScanAsteriskEqualsToken() {\n            ts.Debug.assert(token === 65 /* AsteriskEqualsToken */, \"'reScanAsteriskEqualsToken' should only be called on a '*='\");\n            pos = tokenPos + 1;\n            return token = 62 /* EqualsToken */;\n        }\n        function reScanSlashToken() {\n            if (token === 43 /* SlashToken */ || token === 67 /* SlashEqualsToken */) {\n                var p = tokenPos + 1;\n                var inEscape = false;\n                var inCharacterClass = false;\n                while (true) {\n                    // If we reach the end of a file, or hit a newline, then this is an unterminated\n                    // regex.  Report error and return what we have so far.\n                    if (p >= end) {\n                        tokenFlags |= 4 /* Unterminated */;\n                        error(ts.Diagnostics.Unterminated_regular_expression_literal);\n                        break;\n                    }\n                    var ch = text.charCodeAt(p);\n                    if (isLineBreak(ch)) {\n                        tokenFlags |= 4 /* Unterminated */;\n                        error(ts.Diagnostics.Unterminated_regular_expression_literal);\n                        break;\n                    }\n                    if (inEscape) {\n                        // Parsing an escape character;\n                        // reset the flag and just advance to the next char.\n                        inEscape = false;\n                    }\n                    else if (ch === 47 /* slash */ && !inCharacterClass) {\n                        // A slash within a character class is permissible,\n                        // but in general it signals the end of the regexp literal.\n                        p++;\n                        break;\n                    }\n                    else if (ch === 91 /* openBracket */) {\n                        inCharacterClass = true;\n                    }\n                    else if (ch === 92 /* backslash */) {\n                        inEscape = true;\n                    }\n                    else if (ch === 93 /* closeBracket */) {\n                        inCharacterClass = false;\n                    }\n                    p++;\n                }\n                while (p < end && isIdentifierPart(text.charCodeAt(p), languageVersion)) {\n                    p++;\n                }\n                pos = p;\n                tokenValue = text.substring(tokenPos, pos);\n                token = 13 /* RegularExpressionLiteral */;\n            }\n            return token;\n        }\n        function appendIfCommentDirective(commentDirectives, text, commentDirectiveRegEx, lineStart) {\n            var type = getDirectiveFromComment(text, commentDirectiveRegEx);\n            if (type === undefined) {\n                return commentDirectives;\n            }\n            return ts.append(commentDirectives, {\n                range: { pos: lineStart, end: pos },\n                type: type,\n            });\n        }\n        function getDirectiveFromComment(text, commentDirectiveRegEx) {\n            var match = commentDirectiveRegEx.exec(text);\n            if (!match) {\n                return undefined;\n            }\n            switch (match[1]) {\n                case \"ts-expect-error\":\n                    return 0 /* ExpectError */;\n                case \"ts-ignore\":\n                    return 1 /* Ignore */;\n            }\n            return undefined;\n        }\n        /**\n         * Unconditionally back up and scan a template expression portion.\n         */\n        function reScanTemplateToken(isTaggedTemplate) {\n            ts.Debug.assert(token === 19 /* CloseBraceToken */, \"'reScanTemplateToken' should only be called on a '}'\");\n            pos = tokenPos;\n            return token = scanTemplateAndSetTokenValue(isTaggedTemplate);\n        }\n        function reScanTemplateHeadOrNoSubstitutionTemplate() {\n            pos = tokenPos;\n            return token = scanTemplateAndSetTokenValue(/* isTaggedTemplate */ true);\n        }\n        function reScanJsxToken() {\n            pos = tokenPos = startPos;\n            return token = scanJsxToken();\n        }\n        function reScanLessThanToken() {\n            if (token === 47 /* LessThanLessThanToken */) {\n                pos = tokenPos + 1;\n                return token = 29 /* LessThanToken */;\n            }\n            return token;\n        }\n        function reScanQuestionToken() {\n            ts.Debug.assert(token === 60 /* QuestionQuestionToken */, \"'reScanQuestionToken' should only be called on a '??'\");\n            pos = tokenPos + 1;\n            return token = 57 /* QuestionToken */;\n        }\n        function scanJsxToken() {\n            startPos = tokenPos = pos;\n            if (pos >= end) {\n                return token = 1 /* EndOfFileToken */;\n            }\n            var char = text.charCodeAt(pos);\n            if (char === 60 /* lessThan */) {\n                if (text.charCodeAt(pos + 1) === 47 /* slash */) {\n                    pos += 2;\n                    return token = 30 /* LessThanSlashToken */;\n                }\n                pos++;\n                return token = 29 /* LessThanToken */;\n            }\n            if (char === 123 /* openBrace */) {\n                pos++;\n                return token = 18 /* OpenBraceToken */;\n            }\n            // First non-whitespace character on this line.\n            var firstNonWhitespace = 0;\n            var lastNonWhitespace = -1;\n            // These initial values are special because the first line is:\n            // firstNonWhitespace = 0 to indicate that we want leading whitespace,\n            while (pos < end) {\n                // We want to keep track of the last non-whitespace (but including\n                // newlines character for hitting the end of the JSX Text region)\n                if (!isWhiteSpaceSingleLine(char)) {\n                    lastNonWhitespace = pos;\n                }\n                char = text.charCodeAt(pos);\n                if (char === 123 /* openBrace */) {\n                    break;\n                }\n                if (char === 60 /* lessThan */) {\n                    if (isConflictMarkerTrivia(text, pos)) {\n                        pos = scanConflictMarkerTrivia(text, pos, error);\n                        return token = 7 /* ConflictMarkerTrivia */;\n                    }\n                    break;\n                }\n                if (char === 62 /* greaterThan */) {\n                    error(ts.Diagnostics.Unexpected_token_Did_you_mean_or_gt, pos, 1);\n                }\n                if (char === 125 /* closeBrace */) {\n                    error(ts.Diagnostics.Unexpected_token_Did_you_mean_or_rbrace, pos, 1);\n                }\n                if (lastNonWhitespace > 0)\n                    lastNonWhitespace++;\n                // FirstNonWhitespace is 0, then we only see whitespaces so far. If we see a linebreak, we want to ignore that whitespaces.\n                // i.e (- : whitespace)\n                //      <div>----\n                //      </div> becomes <div></div>\n                //\n                //      <div>----</div> becomes <div>----</div>\n                if (isLineBreak(char) && firstNonWhitespace === 0) {\n                    firstNonWhitespace = -1;\n                }\n                else if (!isWhiteSpaceLike(char)) {\n                    firstNonWhitespace = pos;\n                }\n                pos++;\n            }\n            var endPosition = lastNonWhitespace === -1 ? pos : lastNonWhitespace;\n            tokenValue = text.substring(startPos, endPosition);\n            return firstNonWhitespace === -1 ? 12 /* JsxTextAllWhiteSpaces */ : 11 /* JsxText */;\n        }\n        // Scans a JSX identifier; these differ from normal identifiers in that\n        // they allow dashes\n        function scanJsxIdentifier() {\n            if (tokenIsIdentifierOrKeyword(token)) {\n                // An identifier or keyword has already been parsed - check for a `-` or a single instance of `:` and then append it and\n                // everything after it to the token\n                // Do note that this means that `scanJsxIdentifier` effectively _mutates_ the visible token without advancing to a new token\n                // Any caller should be expecting this behavior and should only read the pos or token value after calling it.\n                var namespaceSeparator = false;\n                while (pos < end) {\n                    var ch = text.charCodeAt(pos);\n                    if (ch === 45 /* minus */) {\n                        tokenValue += \"-\";\n                        pos++;\n                        continue;\n                    }\n                    else if (ch === 58 /* colon */ && !namespaceSeparator) {\n                        tokenValue += \":\";\n                        pos++;\n                        namespaceSeparator = true;\n                        continue;\n                    }\n                    var oldPos = pos;\n                    tokenValue += scanIdentifierParts(); // reuse `scanIdentifierParts` so unicode escapes are handled\n                    if (pos === oldPos) {\n                        break;\n                    }\n                }\n                // Do not include a trailing namespace separator in the token, since this is against the spec.\n                if (tokenValue.slice(-1) === \":\") {\n                    tokenValue = tokenValue.slice(0, -1);\n                    pos--;\n                }\n            }\n            return token;\n        }\n        function scanJsxAttributeValue() {\n            startPos = pos;\n            switch (text.charCodeAt(pos)) {\n                case 34 /* doubleQuote */:\n                case 39 /* singleQuote */:\n                    tokenValue = scanString(/*jsxAttributeString*/ true);\n                    return token = 10 /* StringLiteral */;\n                default:\n                    // If this scans anything other than `{`, it's a parse error.\n                    return scan();\n            }\n        }\n        function reScanJsxAttributeValue() {\n            pos = tokenPos = startPos;\n            return scanJsxAttributeValue();\n        }\n        function scanJsDocToken() {\n            startPos = tokenPos = pos;\n            tokenFlags = 0 /* None */;\n            if (pos >= end) {\n                return token = 1 /* EndOfFileToken */;\n            }\n            var ch = codePointAt(text, pos);\n            pos += charSize(ch);\n            switch (ch) {\n                case 9 /* tab */:\n                case 11 /* verticalTab */:\n                case 12 /* formFeed */:\n                case 32 /* space */:\n                    while (pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos))) {\n                        pos++;\n                    }\n                    return token = 5 /* WhitespaceTrivia */;\n                case 64 /* at */:\n                    return token = 59 /* AtToken */;\n                case 13 /* carriageReturn */:\n                    if (text.charCodeAt(pos) === 10 /* lineFeed */) {\n                        pos++;\n                    }\n                // falls through\n                case 10 /* lineFeed */:\n                    tokenFlags |= 1 /* PrecedingLineBreak */;\n                    return token = 4 /* NewLineTrivia */;\n                case 42 /* asterisk */:\n                    return token = 41 /* AsteriskToken */;\n                case 123 /* openBrace */:\n                    return token = 18 /* OpenBraceToken */;\n                case 125 /* closeBrace */:\n                    return token = 19 /* CloseBraceToken */;\n                case 91 /* openBracket */:\n                    return token = 22 /* OpenBracketToken */;\n                case 93 /* closeBracket */:\n                    return token = 23 /* CloseBracketToken */;\n                case 60 /* lessThan */:\n                    return token = 29 /* LessThanToken */;\n                case 62 /* greaterThan */:\n                    return token = 31 /* GreaterThanToken */;\n                case 61 /* equals */:\n                    return token = 62 /* EqualsToken */;\n                case 44 /* comma */:\n                    return token = 27 /* CommaToken */;\n                case 46 /* dot */:\n                    return token = 24 /* DotToken */;\n                case 96 /* backtick */:\n                    return token = 61 /* BacktickToken */;\n                case 92 /* backslash */:\n                    pos--;\n                    var extendedCookedChar = peekExtendedUnicodeEscape();\n                    if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {\n                        pos += 3;\n                        tokenFlags |= 8 /* ExtendedUnicodeEscape */;\n                        tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts();\n                        return token = getIdentifierToken();\n                    }\n                    var cookedChar = peekUnicodeEscape();\n                    if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) {\n                        pos += 6;\n                        tokenFlags |= 1024 /* UnicodeEscape */;\n                        tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts();\n                        return token = getIdentifierToken();\n                    }\n                    pos++;\n                    return token = 0 /* Unknown */;\n            }\n            if (isIdentifierStart(ch, languageVersion)) {\n                var char = ch;\n                while (pos < end && isIdentifierPart(char = codePointAt(text, pos), languageVersion) || text.charCodeAt(pos) === 45 /* minus */)\n                    pos += charSize(char);\n                tokenValue = text.substring(tokenPos, pos);\n                if (char === 92 /* backslash */) {\n                    tokenValue += scanIdentifierParts();\n                }\n                return token = getIdentifierToken();\n            }\n            else {\n                return token = 0 /* Unknown */;\n            }\n        }\n        function speculationHelper(callback, isLookahead) {\n            var savePos = pos;\n            var saveStartPos = startPos;\n            var saveTokenPos = tokenPos;\n            var saveToken = token;\n            var saveTokenValue = tokenValue;\n            var saveTokenFlags = tokenFlags;\n            var result = callback();\n            // If our callback returned something 'falsy' or we're just looking ahead,\n            // then unconditionally restore us to where we were.\n            if (!result || isLookahead) {\n                pos = savePos;\n                startPos = saveStartPos;\n                tokenPos = saveTokenPos;\n                token = saveToken;\n                tokenValue = saveTokenValue;\n                tokenFlags = saveTokenFlags;\n            }\n            return result;\n        }\n        function scanRange(start, length, callback) {\n            var saveEnd = end;\n            var savePos = pos;\n            var saveStartPos = startPos;\n            var saveTokenPos = tokenPos;\n            var saveToken = token;\n            var saveTokenValue = tokenValue;\n            var saveTokenFlags = tokenFlags;\n            var saveErrorExpectations = commentDirectives;\n            setText(text, start, length);\n            var result = callback();\n            end = saveEnd;\n            pos = savePos;\n            startPos = saveStartPos;\n            tokenPos = saveTokenPos;\n            token = saveToken;\n            tokenValue = saveTokenValue;\n            tokenFlags = saveTokenFlags;\n            commentDirectives = saveErrorExpectations;\n            return result;\n        }\n        function lookAhead(callback) {\n            return speculationHelper(callback, /*isLookahead*/ true);\n        }\n        function tryScan(callback) {\n            return speculationHelper(callback, /*isLookahead*/ false);\n        }\n        function getText() {\n            return text;\n        }\n        function clearCommentDirectives() {\n            commentDirectives = undefined;\n        }\n        function setText(newText, start, length) {\n            text = newText || \"\";\n            end = length === undefined ? text.length : start + length;\n            setTextPos(start || 0);\n        }\n        function setOnError(errorCallback) {\n            onError = errorCallback;\n        }\n        function setScriptTarget(scriptTarget) {\n            languageVersion = scriptTarget;\n        }\n        function setLanguageVariant(variant) {\n            languageVariant = variant;\n        }\n        function setTextPos(textPos) {\n            ts.Debug.assert(textPos >= 0);\n            pos = textPos;\n            startPos = textPos;\n            tokenPos = textPos;\n            token = 0 /* Unknown */;\n            tokenValue = undefined;\n            tokenFlags = 0 /* None */;\n        }\n        function setInJSDocType(inType) {\n            inJSDocType += inType ? 1 : -1;\n        }\n    }\n    ts.createScanner = createScanner;\n    /* @internal */\n    var codePointAt = String.prototype.codePointAt ? function (s, i) { return s.codePointAt(i); } : function codePointAt(str, i) {\n        // from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt\n        var size = str.length;\n        // Account for out-of-bounds indices:\n        if (i < 0 || i >= size) {\n            return undefined; // String.codePointAt returns `undefined` for OOB indexes\n        }\n        // Get the first code unit\n        var first = str.charCodeAt(i);\n        // check if it’s the start of a surrogate pair\n        if (first >= 0xD800 && first <= 0xDBFF && size > i + 1) { // high surrogate and there is a next code unit\n            var second = str.charCodeAt(i + 1);\n            if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate\n                // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n                return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n            }\n        }\n        return first;\n    };\n    /* @internal */\n    function charSize(ch) {\n        if (ch >= 0x10000) {\n            return 2;\n        }\n        return 1;\n    }\n    // Derived from the 10.1.1 UTF16Encoding of the ES6 Spec.\n    function utf16EncodeAsStringFallback(codePoint) {\n        ts.Debug.assert(0x0 <= codePoint && codePoint <= 0x10FFFF);\n        if (codePoint <= 65535) {\n            return String.fromCharCode(codePoint);\n        }\n        var codeUnit1 = Math.floor((codePoint - 65536) / 1024) + 0xD800;\n        var codeUnit2 = ((codePoint - 65536) % 1024) + 0xDC00;\n        return String.fromCharCode(codeUnit1, codeUnit2);\n    }\n    var utf16EncodeAsStringWorker = String.fromCodePoint ? function (codePoint) { return String.fromCodePoint(codePoint); } : utf16EncodeAsStringFallback;\n    /* @internal */\n    function utf16EncodeAsString(codePoint) {\n        return utf16EncodeAsStringWorker(codePoint);\n    }\n    ts.utf16EncodeAsString = utf16EncodeAsString;\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    function isExternalModuleNameRelative(moduleName) {\n        // TypeScript 1.0 spec (April 2014): 11.2.1\n        // An external module name is \"relative\" if the first term is \".\" or \"..\".\n        // Update: We also consider a path like `C:\\foo.ts` \"relative\" because we do not search for it in `node_modules` or treat it as an ambient module.\n        return ts.pathIsRelative(moduleName) || ts.isRootedDiskPath(moduleName);\n    }\n    ts.isExternalModuleNameRelative = isExternalModuleNameRelative;\n    function sortAndDeduplicateDiagnostics(diagnostics) {\n        return ts.sortAndDeduplicate(diagnostics, ts.compareDiagnostics);\n    }\n    ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics;\n    function getDefaultLibFileName(options) {\n        switch (options.target) {\n            case 99 /* ESNext */:\n                return \"lib.esnext.full.d.ts\";\n            case 7 /* ES2020 */:\n                return \"lib.es2020.full.d.ts\";\n            case 6 /* ES2019 */:\n                return \"lib.es2019.full.d.ts\";\n            case 5 /* ES2018 */:\n                return \"lib.es2018.full.d.ts\";\n            case 4 /* ES2017 */:\n                return \"lib.es2017.full.d.ts\";\n            case 3 /* ES2016 */:\n                return \"lib.es2016.full.d.ts\";\n            case 2 /* ES2015 */:\n                return \"lib.es6.d.ts\"; // We don't use lib.es2015.full.d.ts due to breaking change.\n            default:\n                return \"lib.d.ts\";\n        }\n    }\n    ts.getDefaultLibFileName = getDefaultLibFileName;\n    function textSpanEnd(span) {\n        return span.start + span.length;\n    }\n    ts.textSpanEnd = textSpanEnd;\n    function textSpanIsEmpty(span) {\n        return span.length === 0;\n    }\n    ts.textSpanIsEmpty = textSpanIsEmpty;\n    function textSpanContainsPosition(span, position) {\n        return position >= span.start && position < textSpanEnd(span);\n    }\n    ts.textSpanContainsPosition = textSpanContainsPosition;\n    /* @internal */\n    function textRangeContainsPositionInclusive(span, position) {\n        return position >= span.pos && position <= span.end;\n    }\n    ts.textRangeContainsPositionInclusive = textRangeContainsPositionInclusive;\n    // Returns true if 'span' contains 'other'.\n    function textSpanContainsTextSpan(span, other) {\n        return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span);\n    }\n    ts.textSpanContainsTextSpan = textSpanContainsTextSpan;\n    function textSpanOverlapsWith(span, other) {\n        return textSpanOverlap(span, other) !== undefined;\n    }\n    ts.textSpanOverlapsWith = textSpanOverlapsWith;\n    function textSpanOverlap(span1, span2) {\n        var overlap = textSpanIntersection(span1, span2);\n        return overlap && overlap.length === 0 ? undefined : overlap;\n    }\n    ts.textSpanOverlap = textSpanOverlap;\n    function textSpanIntersectsWithTextSpan(span, other) {\n        return decodedTextSpanIntersectsWith(span.start, span.length, other.start, other.length);\n    }\n    ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan;\n    function textSpanIntersectsWith(span, start, length) {\n        return decodedTextSpanIntersectsWith(span.start, span.length, start, length);\n    }\n    ts.textSpanIntersectsWith = textSpanIntersectsWith;\n    function decodedTextSpanIntersectsWith(start1, length1, start2, length2) {\n        var end1 = start1 + length1;\n        var end2 = start2 + length2;\n        return start2 <= end1 && end2 >= start1;\n    }\n    ts.decodedTextSpanIntersectsWith = decodedTextSpanIntersectsWith;\n    function textSpanIntersectsWithPosition(span, position) {\n        return position <= textSpanEnd(span) && position >= span.start;\n    }\n    ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition;\n    function textSpanIntersection(span1, span2) {\n        var start = Math.max(span1.start, span2.start);\n        var end = Math.min(textSpanEnd(span1), textSpanEnd(span2));\n        return start <= end ? createTextSpanFromBounds(start, end) : undefined;\n    }\n    ts.textSpanIntersection = textSpanIntersection;\n    function createTextSpan(start, length) {\n        if (start < 0) {\n            throw new Error(\"start < 0\");\n        }\n        if (length < 0) {\n            throw new Error(\"length < 0\");\n        }\n        return { start: start, length: length };\n    }\n    ts.createTextSpan = createTextSpan;\n    function createTextSpanFromBounds(start, end) {\n        return createTextSpan(start, end - start);\n    }\n    ts.createTextSpanFromBounds = createTextSpanFromBounds;\n    function textChangeRangeNewSpan(range) {\n        return createTextSpan(range.span.start, range.newLength);\n    }\n    ts.textChangeRangeNewSpan = textChangeRangeNewSpan;\n    function textChangeRangeIsUnchanged(range) {\n        return textSpanIsEmpty(range.span) && range.newLength === 0;\n    }\n    ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged;\n    function createTextChangeRange(span, newLength) {\n        if (newLength < 0) {\n            throw new Error(\"newLength < 0\");\n        }\n        return { span: span, newLength: newLength };\n    }\n    ts.createTextChangeRange = createTextChangeRange;\n    ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); // eslint-disable-line prefer-const\n    /**\n     * Called to merge all the changes that occurred across several versions of a script snapshot\n     * into a single change.  i.e. if a user keeps making successive edits to a script we will\n     * have a text change from V1 to V2, V2 to V3, ..., Vn.\n     *\n     * This function will then merge those changes into a single change range valid between V1 and\n     * Vn.\n     */\n    function collapseTextChangeRangesAcrossMultipleVersions(changes) {\n        if (changes.length === 0) {\n            return ts.unchangedTextChangeRange;\n        }\n        if (changes.length === 1) {\n            return changes[0];\n        }\n        // We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd }\n        // as it makes things much easier to reason about.\n        var change0 = changes[0];\n        var oldStartN = change0.span.start;\n        var oldEndN = textSpanEnd(change0.span);\n        var newEndN = oldStartN + change0.newLength;\n        for (var i = 1; i < changes.length; i++) {\n            var nextChange = changes[i];\n            // Consider the following case:\n            // i.e. two edits.  The first represents the text change range { { 10, 50 }, 30 }.  i.e. The span starting\n            // at 10, with length 50 is reduced to length 30.  The second represents the text change range { { 30, 30 }, 40 }.\n            // i.e. the span starting at 30 with length 30 is increased to length 40.\n            //\n            //      0         10        20        30        40        50        60        70        80        90        100\n            //      -------------------------------------------------------------------------------------------------------\n            //                |                                                 /\n            //                |                                            /----\n            //  T1            |                                       /----\n            //                |                                  /----\n            //                |                             /----\n            //      -------------------------------------------------------------------------------------------------------\n            //                                     |                            \\\n            //                                     |                               \\\n            //   T2                                |                                 \\\n            //                                     |                                   \\\n            //                                     |                                      \\\n            //      -------------------------------------------------------------------------------------------------------\n            //\n            // Merging these turns out to not be too difficult.  First, determining the new start of the change is trivial\n            // it's just the min of the old and new starts.  i.e.:\n            //\n            //      0         10        20        30        40        50        60        70        80        90        100\n            //      ------------------------------------------------------------*------------------------------------------\n            //                |                                                 /\n            //                |                                            /----\n            //  T1            |                                       /----\n            //                |                                  /----\n            //                |                             /----\n            //      ----------------------------------------$-------------------$------------------------------------------\n            //                .                    |                            \\\n            //                .                    |                               \\\n            //   T2           .                    |                                 \\\n            //                .                    |                                   \\\n            //                .                    |                                      \\\n            //      ----------------------------------------------------------------------*--------------------------------\n            //\n            // (Note the dots represent the newly inferred start.\n            // Determining the new and old end is also pretty simple.  Basically it boils down to paying attention to the\n            // absolute positions at the asterisks, and the relative change between the dollar signs. Basically, we see\n            // which if the two $'s precedes the other, and we move that one forward until they line up.  in this case that\n            // means:\n            //\n            //      0         10        20        30        40        50        60        70        80        90        100\n            //      --------------------------------------------------------------------------------*----------------------\n            //                |                                                                     /\n            //                |                                                                /----\n            //  T1            |                                                           /----\n            //                |                                                      /----\n            //                |                                                 /----\n            //      ------------------------------------------------------------$------------------------------------------\n            //                .                    |                            \\\n            //                .                    |                               \\\n            //   T2           .                    |                                 \\\n            //                .                    |                                   \\\n            //                .                    |                                      \\\n            //      ----------------------------------------------------------------------*--------------------------------\n            //\n            // In other words (in this case), we're recognizing that the second edit happened after where the first edit\n            // ended with a delta of 20 characters (60 - 40).  Thus, if we go back in time to where the first edit started\n            // that's the same as if we started at char 80 instead of 60.\n            //\n            // As it so happens, the same logic applies if the second edit precedes the first edit.  In that case rather\n            // than pushing the first edit forward to match the second, we'll push the second edit forward to match the\n            // first.\n            //\n            // In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange\n            // semantics: { { start: 10, length: 70 }, newLength: 60 }\n            //\n            // The math then works out as follows.\n            // If we have { oldStart1, oldEnd1, newEnd1 } and { oldStart2, oldEnd2, newEnd2 } then we can compute the\n            // final result like so:\n            //\n            // {\n            //      oldStart3: Min(oldStart1, oldStart2),\n            //      oldEnd3: Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)),\n            //      newEnd3: Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2))\n            // }\n            var oldStart1 = oldStartN;\n            var oldEnd1 = oldEndN;\n            var newEnd1 = newEndN;\n            var oldStart2 = nextChange.span.start;\n            var oldEnd2 = textSpanEnd(nextChange.span);\n            var newEnd2 = oldStart2 + nextChange.newLength;\n            oldStartN = Math.min(oldStart1, oldStart2);\n            oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));\n            newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));\n        }\n        return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), /*newLength*/ newEndN - oldStartN);\n    }\n    ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;\n    function getTypeParameterOwner(d) {\n        if (d && d.kind === 159 /* TypeParameter */) {\n            for (var current = d; current; current = current.parent) {\n                if (isFunctionLike(current) || isClassLike(current) || current.kind === 253 /* InterfaceDeclaration */) {\n                    return current;\n                }\n            }\n        }\n    }\n    ts.getTypeParameterOwner = getTypeParameterOwner;\n    function isParameterPropertyDeclaration(node, parent) {\n        return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 166 /* Constructor */;\n    }\n    ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration;\n    function isEmptyBindingPattern(node) {\n        if (isBindingPattern(node)) {\n            return ts.every(node.elements, isEmptyBindingElement);\n        }\n        return false;\n    }\n    ts.isEmptyBindingPattern = isEmptyBindingPattern;\n    function isEmptyBindingElement(node) {\n        if (ts.isOmittedExpression(node)) {\n            return true;\n        }\n        return isEmptyBindingPattern(node.name);\n    }\n    ts.isEmptyBindingElement = isEmptyBindingElement;\n    function walkUpBindingElementsAndPatterns(binding) {\n        var node = binding.parent;\n        while (ts.isBindingElement(node.parent)) {\n            node = node.parent.parent;\n        }\n        return node.parent;\n    }\n    ts.walkUpBindingElementsAndPatterns = walkUpBindingElementsAndPatterns;\n    function getCombinedFlags(node, getFlags) {\n        if (ts.isBindingElement(node)) {\n            node = walkUpBindingElementsAndPatterns(node);\n        }\n        var flags = getFlags(node);\n        if (node.kind === 249 /* VariableDeclaration */) {\n            node = node.parent;\n        }\n        if (node && node.kind === 250 /* VariableDeclarationList */) {\n            flags |= getFlags(node);\n            node = node.parent;\n        }\n        if (node && node.kind === 232 /* VariableStatement */) {\n            flags |= getFlags(node);\n        }\n        return flags;\n    }\n    function getCombinedModifierFlags(node) {\n        return getCombinedFlags(node, ts.getEffectiveModifierFlags);\n    }\n    ts.getCombinedModifierFlags = getCombinedModifierFlags;\n    /* @internal */\n    function getCombinedNodeFlagsAlwaysIncludeJSDoc(node) {\n        return getCombinedFlags(node, ts.getEffectiveModifierFlagsAlwaysIncludeJSDoc);\n    }\n    ts.getCombinedNodeFlagsAlwaysIncludeJSDoc = getCombinedNodeFlagsAlwaysIncludeJSDoc;\n    // Returns the node flags for this node and all relevant parent nodes.  This is done so that\n    // nodes like variable declarations and binding elements can returned a view of their flags\n    // that includes the modifiers from their container.  i.e. flags like export/declare aren't\n    // stored on the variable declaration directly, but on the containing variable statement\n    // (if it has one).  Similarly, flags for let/const are stored on the variable declaration\n    // list.  By calling this function, all those flags are combined so that the client can treat\n    // the node as if it actually had those flags.\n    function getCombinedNodeFlags(node) {\n        return getCombinedFlags(node, function (n) { return n.flags; });\n    }\n    ts.getCombinedNodeFlags = getCombinedNodeFlags;\n    /* @internal */\n    ts.supportedLocaleDirectories = [\"cs\", \"de\", \"es\", \"fr\", \"it\", \"ja\", \"ko\", \"pl\", \"pt-br\", \"ru\", \"tr\", \"zh-cn\", \"zh-tw\"];\n    /**\n     * Checks to see if the locale is in the appropriate format,\n     * and if it is, attempts to set the appropriate language.\n     */\n    function validateLocaleAndSetLanguage(locale, sys, errors) {\n        var lowerCaseLocale = locale.toLowerCase();\n        var matchResult = /^([a-z]+)([_\\-]([a-z]+))?$/.exec(lowerCaseLocale);\n        if (!matchResult) {\n            if (errors) {\n                errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, \"en\", \"ja-jp\"));\n            }\n            return;\n        }\n        var language = matchResult[1];\n        var territory = matchResult[3];\n        // First try the entire locale, then fall back to just language if that's all we have.\n        // Either ways do not fail, and fallback to the English diagnostic strings.\n        if (ts.contains(ts.supportedLocaleDirectories, lowerCaseLocale) && !trySetLanguageAndTerritory(language, territory, errors)) {\n            trySetLanguageAndTerritory(language, /*territory*/ undefined, errors);\n        }\n        // Set the UI locale for string collation\n        ts.setUILocale(locale);\n        function trySetLanguageAndTerritory(language, territory, errors) {\n            var compilerFilePath = ts.normalizePath(sys.getExecutingFilePath());\n            var containingDirectoryPath = ts.getDirectoryPath(compilerFilePath);\n            var filePath = ts.combinePaths(containingDirectoryPath, language);\n            if (territory) {\n                filePath = filePath + \"-\" + territory;\n            }\n            filePath = sys.resolvePath(ts.combinePaths(filePath, \"diagnosticMessages.generated.json\"));\n            if (!sys.fileExists(filePath)) {\n                return false;\n            }\n            // TODO: Add codePage support for readFile?\n            var fileContents = \"\";\n            try {\n                fileContents = sys.readFile(filePath);\n            }\n            catch (e) {\n                if (errors) {\n                    errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unable_to_open_file_0, filePath));\n                }\n                return false;\n            }\n            try {\n                // this is a global mutation (or live binding update)!\n                ts.setLocalizedDiagnosticMessages(JSON.parse(fileContents));\n            }\n            catch (_a) {\n                if (errors) {\n                    errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Corrupted_locale_file_0, filePath));\n                }\n                return false;\n            }\n            return true;\n        }\n    }\n    ts.validateLocaleAndSetLanguage = validateLocaleAndSetLanguage;\n    function getOriginalNode(node, nodeTest) {\n        if (node) {\n            while (node.original !== undefined) {\n                node = node.original;\n            }\n        }\n        return !nodeTest || nodeTest(node) ? node : undefined;\n    }\n    ts.getOriginalNode = getOriginalNode;\n    function findAncestor(node, callback) {\n        while (node) {\n            var result = callback(node);\n            if (result === \"quit\") {\n                return undefined;\n            }\n            else if (result) {\n                return node;\n            }\n            node = node.parent;\n        }\n        return undefined;\n    }\n    ts.findAncestor = findAncestor;\n    /**\n     * Gets a value indicating whether a node originated in the parse tree.\n     *\n     * @param node The node to test.\n     */\n    function isParseTreeNode(node) {\n        return (node.flags & 8 /* Synthesized */) === 0;\n    }\n    ts.isParseTreeNode = isParseTreeNode;\n    function getParseTreeNode(node, nodeTest) {\n        if (node === undefined || isParseTreeNode(node)) {\n            return node;\n        }\n        node = node.original;\n        while (node) {\n            if (isParseTreeNode(node)) {\n                return !nodeTest || nodeTest(node) ? node : undefined;\n            }\n            node = node.original;\n        }\n    }\n    ts.getParseTreeNode = getParseTreeNode;\n    /** Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' */\n    function escapeLeadingUnderscores(identifier) {\n        return (identifier.length >= 2 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ ? \"_\" + identifier : identifier);\n    }\n    ts.escapeLeadingUnderscores = escapeLeadingUnderscores;\n    /**\n     * Remove extra underscore from escaped identifier text content.\n     *\n     * @param identifier The escaped identifier text.\n     * @returns The unescaped identifier text.\n     */\n    function unescapeLeadingUnderscores(identifier) {\n        var id = identifier;\n        return id.length >= 3 && id.charCodeAt(0) === 95 /* _ */ && id.charCodeAt(1) === 95 /* _ */ && id.charCodeAt(2) === 95 /* _ */ ? id.substr(1) : id;\n    }\n    ts.unescapeLeadingUnderscores = unescapeLeadingUnderscores;\n    function idText(identifierOrPrivateName) {\n        return unescapeLeadingUnderscores(identifierOrPrivateName.escapedText);\n    }\n    ts.idText = idText;\n    function symbolName(symbol) {\n        if (symbol.valueDeclaration && isPrivateIdentifierPropertyDeclaration(symbol.valueDeclaration)) {\n            return idText(symbol.valueDeclaration.name);\n        }\n        return unescapeLeadingUnderscores(symbol.escapedName);\n    }\n    ts.symbolName = symbolName;\n    /**\n     * A JSDocTypedef tag has an _optional_ name field - if a name is not directly present, we should\n     * attempt to draw the name from the node the declaration is on (as that declaration is what its' symbol\n     * will be merged with)\n     */\n    function nameForNamelessJSDocTypedef(declaration) {\n        var hostNode = declaration.parent.parent;\n        if (!hostNode) {\n            return undefined;\n        }\n        // Covers classes, functions - any named declaration host node\n        if (isDeclaration(hostNode)) {\n            return getDeclarationIdentifier(hostNode);\n        }\n        // Covers remaining cases (returning undefined if none match).\n        switch (hostNode.kind) {\n            case 232 /* VariableStatement */:\n                if (hostNode.declarationList && hostNode.declarationList.declarations[0]) {\n                    return getDeclarationIdentifier(hostNode.declarationList.declarations[0]);\n                }\n                break;\n            case 233 /* ExpressionStatement */:\n                var expr = hostNode.expression;\n                if (expr.kind === 216 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) {\n                    expr = expr.left;\n                }\n                switch (expr.kind) {\n                    case 201 /* PropertyAccessExpression */:\n                        return expr.name;\n                    case 202 /* ElementAccessExpression */:\n                        var arg = expr.argumentExpression;\n                        if (ts.isIdentifier(arg)) {\n                            return arg;\n                        }\n                }\n                break;\n            case 207 /* ParenthesizedExpression */: {\n                return getDeclarationIdentifier(hostNode.expression);\n            }\n            case 245 /* LabeledStatement */: {\n                if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) {\n                    return getDeclarationIdentifier(hostNode.statement);\n                }\n                break;\n            }\n        }\n    }\n    function getDeclarationIdentifier(node) {\n        var name = getNameOfDeclaration(node);\n        return name && ts.isIdentifier(name) ? name : undefined;\n    }\n    /** @internal */\n    function nodeHasName(statement, name) {\n        if (isNamedDeclaration(statement) && ts.isIdentifier(statement.name) && idText(statement.name) === idText(name)) {\n            return true;\n        }\n        if (ts.isVariableStatement(statement) && ts.some(statement.declarationList.declarations, function (d) { return nodeHasName(d, name); })) {\n            return true;\n        }\n        return false;\n    }\n    ts.nodeHasName = nodeHasName;\n    function getNameOfJSDocTypedef(declaration) {\n        return declaration.name || nameForNamelessJSDocTypedef(declaration);\n    }\n    ts.getNameOfJSDocTypedef = getNameOfJSDocTypedef;\n    /** @internal */\n    function isNamedDeclaration(node) {\n        return !!node.name; // A 'name' property should always be a DeclarationName.\n    }\n    ts.isNamedDeclaration = isNamedDeclaration;\n    /** @internal */\n    function getNonAssignedNameOfDeclaration(declaration) {\n        switch (declaration.kind) {\n            case 78 /* Identifier */:\n                return declaration;\n            case 333 /* JSDocPropertyTag */:\n            case 326 /* JSDocParameterTag */: {\n                var name = declaration.name;\n                if (name.kind === 157 /* QualifiedName */) {\n                    return name.right;\n                }\n                break;\n            }\n            case 203 /* CallExpression */:\n            case 216 /* BinaryExpression */: {\n                var expr_1 = declaration;\n                switch (ts.getAssignmentDeclarationKind(expr_1)) {\n                    case 1 /* ExportsProperty */:\n                    case 4 /* ThisProperty */:\n                    case 5 /* Property */:\n                    case 3 /* PrototypeProperty */:\n                        return ts.getElementOrPropertyAccessArgumentExpressionOrName(expr_1.left);\n                    case 7 /* ObjectDefinePropertyValue */:\n                    case 8 /* ObjectDefinePropertyExports */:\n                    case 9 /* ObjectDefinePrototypeProperty */:\n                        return expr_1.arguments[1];\n                    default:\n                        return undefined;\n                }\n            }\n            case 331 /* JSDocTypedefTag */:\n                return getNameOfJSDocTypedef(declaration);\n            case 325 /* JSDocEnumTag */:\n                return nameForNamelessJSDocTypedef(declaration);\n            case 266 /* ExportAssignment */: {\n                var expression = declaration.expression;\n                return ts.isIdentifier(expression) ? expression : undefined;\n            }\n            case 202 /* ElementAccessExpression */:\n                var expr = declaration;\n                if (ts.isBindableStaticElementAccessExpression(expr)) {\n                    return expr.argumentExpression;\n                }\n        }\n        return declaration.name;\n    }\n    ts.getNonAssignedNameOfDeclaration = getNonAssignedNameOfDeclaration;\n    function getNameOfDeclaration(declaration) {\n        if (declaration === undefined)\n            return undefined;\n        return getNonAssignedNameOfDeclaration(declaration) ||\n            (ts.isFunctionExpression(declaration) || ts.isClassExpression(declaration) ? getAssignedName(declaration) : undefined);\n    }\n    ts.getNameOfDeclaration = getNameOfDeclaration;\n    /*@internal*/\n    function getAssignedName(node) {\n        if (!node.parent) {\n            return undefined;\n        }\n        else if (ts.isPropertyAssignment(node.parent) || ts.isBindingElement(node.parent)) {\n            return node.parent.name;\n        }\n        else if (ts.isBinaryExpression(node.parent) && node === node.parent.right) {\n            if (ts.isIdentifier(node.parent.left)) {\n                return node.parent.left;\n            }\n            else if (ts.isAccessExpression(node.parent.left)) {\n                return ts.getElementOrPropertyAccessArgumentExpressionOrName(node.parent.left);\n            }\n        }\n        else if (ts.isVariableDeclaration(node.parent) && ts.isIdentifier(node.parent.name)) {\n            return node.parent.name;\n        }\n    }\n    ts.getAssignedName = getAssignedName;\n    function getJSDocParameterTagsWorker(param, noCache) {\n        if (param.name) {\n            if (ts.isIdentifier(param.name)) {\n                var name_1 = param.name.escapedText;\n                return getJSDocTagsWorker(param.parent, noCache).filter(function (tag) { return ts.isJSDocParameterTag(tag) && ts.isIdentifier(tag.name) && tag.name.escapedText === name_1; });\n            }\n            else {\n                var i = param.parent.parameters.indexOf(param);\n                ts.Debug.assert(i > -1, \"Parameters should always be in their parents' parameter list\");\n                var paramTags = getJSDocTagsWorker(param.parent, noCache).filter(ts.isJSDocParameterTag);\n                if (i < paramTags.length) {\n                    return [paramTags[i]];\n                }\n            }\n        }\n        // return empty array for: out-of-order binding patterns and JSDoc function syntax, which has un-named parameters\n        return ts.emptyArray;\n    }\n    /**\n     * Gets the JSDoc parameter tags for the node if present.\n     *\n     * @remarks Returns any JSDoc param tag whose name matches the provided\n     * parameter, whether a param tag on a containing function\n     * expression, or a param tag on a variable declaration whose\n     * initializer is the containing function. The tags closest to the\n     * node are returned first, so in the previous example, the param\n     * tag on the containing function expression would be first.\n     *\n     * For binding patterns, parameter tags are matched by position.\n     */\n    function getJSDocParameterTags(param) {\n        return getJSDocParameterTagsWorker(param, /*noCache*/ false);\n    }\n    ts.getJSDocParameterTags = getJSDocParameterTags;\n    /* @internal */\n    function getJSDocParameterTagsNoCache(param) {\n        return getJSDocParameterTagsWorker(param, /*noCache*/ true);\n    }\n    ts.getJSDocParameterTagsNoCache = getJSDocParameterTagsNoCache;\n    function getJSDocTypeParameterTagsWorker(param, noCache) {\n        var name = param.name.escapedText;\n        return getJSDocTagsWorker(param.parent, noCache).filter(function (tag) {\n            return ts.isJSDocTemplateTag(tag) && tag.typeParameters.some(function (tp) { return tp.name.escapedText === name; });\n        });\n    }\n    /**\n     * Gets the JSDoc type parameter tags for the node if present.\n     *\n     * @remarks Returns any JSDoc template tag whose names match the provided\n     * parameter, whether a template tag on a containing function\n     * expression, or a template tag on a variable declaration whose\n     * initializer is the containing function. The tags closest to the\n     * node are returned first, so in the previous example, the template\n     * tag on the containing function expression would be first.\n     */\n    function getJSDocTypeParameterTags(param) {\n        return getJSDocTypeParameterTagsWorker(param, /*noCache*/ false);\n    }\n    ts.getJSDocTypeParameterTags = getJSDocTypeParameterTags;\n    /* @internal */\n    function getJSDocTypeParameterTagsNoCache(param) {\n        return getJSDocTypeParameterTagsWorker(param, /*noCache*/ true);\n    }\n    ts.getJSDocTypeParameterTagsNoCache = getJSDocTypeParameterTagsNoCache;\n    /**\n     * Return true if the node has JSDoc parameter tags.\n     *\n     * @remarks Includes parameter tags that are not directly on the node,\n     * for example on a variable declaration whose initializer is a function expression.\n     */\n    function hasJSDocParameterTags(node) {\n        return !!getFirstJSDocTag(node, ts.isJSDocParameterTag);\n    }\n    ts.hasJSDocParameterTags = hasJSDocParameterTags;\n    /** Gets the JSDoc augments tag for the node if present */\n    function getJSDocAugmentsTag(node) {\n        return getFirstJSDocTag(node, ts.isJSDocAugmentsTag);\n    }\n    ts.getJSDocAugmentsTag = getJSDocAugmentsTag;\n    /** Gets the JSDoc implements tags for the node if present */\n    function getJSDocImplementsTags(node) {\n        return getAllJSDocTags(node, ts.isJSDocImplementsTag);\n    }\n    ts.getJSDocImplementsTags = getJSDocImplementsTags;\n    /** Gets the JSDoc class tag for the node if present */\n    function getJSDocClassTag(node) {\n        return getFirstJSDocTag(node, ts.isJSDocClassTag);\n    }\n    ts.getJSDocClassTag = getJSDocClassTag;\n    /** Gets the JSDoc public tag for the node if present */\n    function getJSDocPublicTag(node) {\n        return getFirstJSDocTag(node, ts.isJSDocPublicTag);\n    }\n    ts.getJSDocPublicTag = getJSDocPublicTag;\n    /*@internal*/\n    function getJSDocPublicTagNoCache(node) {\n        return getFirstJSDocTag(node, ts.isJSDocPublicTag, /*noCache*/ true);\n    }\n    ts.getJSDocPublicTagNoCache = getJSDocPublicTagNoCache;\n    /** Gets the JSDoc private tag for the node if present */\n    function getJSDocPrivateTag(node) {\n        return getFirstJSDocTag(node, ts.isJSDocPrivateTag);\n    }\n    ts.getJSDocPrivateTag = getJSDocPrivateTag;\n    /*@internal*/\n    function getJSDocPrivateTagNoCache(node) {\n        return getFirstJSDocTag(node, ts.isJSDocPrivateTag, /*noCache*/ true);\n    }\n    ts.getJSDocPrivateTagNoCache = getJSDocPrivateTagNoCache;\n    /** Gets the JSDoc protected tag for the node if present */\n    function getJSDocProtectedTag(node) {\n        return getFirstJSDocTag(node, ts.isJSDocProtectedTag);\n    }\n    ts.getJSDocProtectedTag = getJSDocProtectedTag;\n    /*@internal*/\n    function getJSDocProtectedTagNoCache(node) {\n        return getFirstJSDocTag(node, ts.isJSDocProtectedTag, /*noCache*/ true);\n    }\n    ts.getJSDocProtectedTagNoCache = getJSDocProtectedTagNoCache;\n    /** Gets the JSDoc protected tag for the node if present */\n    function getJSDocReadonlyTag(node) {\n        return getFirstJSDocTag(node, ts.isJSDocReadonlyTag);\n    }\n    ts.getJSDocReadonlyTag = getJSDocReadonlyTag;\n    /*@internal*/\n    function getJSDocReadonlyTagNoCache(node) {\n        return getFirstJSDocTag(node, ts.isJSDocReadonlyTag, /*noCache*/ true);\n    }\n    ts.getJSDocReadonlyTagNoCache = getJSDocReadonlyTagNoCache;\n    /** Gets the JSDoc deprecated tag for the node if present */\n    function getJSDocDeprecatedTag(node) {\n        return getFirstJSDocTag(node, ts.isJSDocDeprecatedTag);\n    }\n    ts.getJSDocDeprecatedTag = getJSDocDeprecatedTag;\n    /*@internal */\n    function getJSDocDeprecatedTagNoCache(node) {\n        return getFirstJSDocTag(node, ts.isJSDocDeprecatedTag, /*noCache*/ true);\n    }\n    ts.getJSDocDeprecatedTagNoCache = getJSDocDeprecatedTagNoCache;\n    /** Gets the JSDoc enum tag for the node if present */\n    function getJSDocEnumTag(node) {\n        return getFirstJSDocTag(node, ts.isJSDocEnumTag);\n    }\n    ts.getJSDocEnumTag = getJSDocEnumTag;\n    /** Gets the JSDoc this tag for the node if present */\n    function getJSDocThisTag(node) {\n        return getFirstJSDocTag(node, ts.isJSDocThisTag);\n    }\n    ts.getJSDocThisTag = getJSDocThisTag;\n    /** Gets the JSDoc return tag for the node if present */\n    function getJSDocReturnTag(node) {\n        return getFirstJSDocTag(node, ts.isJSDocReturnTag);\n    }\n    ts.getJSDocReturnTag = getJSDocReturnTag;\n    /** Gets the JSDoc template tag for the node if present */\n    function getJSDocTemplateTag(node) {\n        return getFirstJSDocTag(node, ts.isJSDocTemplateTag);\n    }\n    ts.getJSDocTemplateTag = getJSDocTemplateTag;\n    /** Gets the JSDoc type tag for the node if present and valid */\n    function getJSDocTypeTag(node) {\n        // We should have already issued an error if there were multiple type jsdocs, so just use the first one.\n        var tag = getFirstJSDocTag(node, ts.isJSDocTypeTag);\n        if (tag && tag.typeExpression && tag.typeExpression.type) {\n            return tag;\n        }\n        return undefined;\n    }\n    ts.getJSDocTypeTag = getJSDocTypeTag;\n    /**\n     * Gets the type node for the node if provided via JSDoc.\n     *\n     * @remarks The search includes any JSDoc param tag that relates\n     * to the provided parameter, for example a type tag on the\n     * parameter itself, or a param tag on a containing function\n     * expression, or a param tag on a variable declaration whose\n     * initializer is the containing function. The tags closest to the\n     * node are examined first, so in the previous example, the type\n     * tag directly on the node would be returned.\n     */\n    function getJSDocType(node) {\n        var tag = getFirstJSDocTag(node, ts.isJSDocTypeTag);\n        if (!tag && ts.isParameter(node)) {\n            tag = ts.find(getJSDocParameterTags(node), function (tag) { return !!tag.typeExpression; });\n        }\n        return tag && tag.typeExpression && tag.typeExpression.type;\n    }\n    ts.getJSDocType = getJSDocType;\n    /**\n     * Gets the return type node for the node if provided via JSDoc return tag or type tag.\n     *\n     * @remarks `getJSDocReturnTag` just gets the whole JSDoc tag. This function\n     * gets the type from inside the braces, after the fat arrow, etc.\n     */\n    function getJSDocReturnType(node) {\n        var returnTag = getJSDocReturnTag(node);\n        if (returnTag && returnTag.typeExpression) {\n            return returnTag.typeExpression.type;\n        }\n        var typeTag = getJSDocTypeTag(node);\n        if (typeTag && typeTag.typeExpression) {\n            var type = typeTag.typeExpression.type;\n            if (ts.isTypeLiteralNode(type)) {\n                var sig = ts.find(type.members, ts.isCallSignatureDeclaration);\n                return sig && sig.type;\n            }\n            if (ts.isFunctionTypeNode(type) || ts.isJSDocFunctionType(type)) {\n                return type.type;\n            }\n        }\n    }\n    ts.getJSDocReturnType = getJSDocReturnType;\n    function getJSDocTagsWorker(node, noCache) {\n        var tags = node.jsDocCache;\n        // If cache is 'null', that means we did the work of searching for JSDoc tags and came up with nothing.\n        if (tags === undefined || noCache) {\n            var comments = ts.getJSDocCommentsAndTags(node, noCache);\n            ts.Debug.assert(comments.length < 2 || comments[0] !== comments[1]);\n            tags = ts.flatMap(comments, function (j) { return ts.isJSDoc(j) ? j.tags : j; });\n            if (!noCache) {\n                node.jsDocCache = tags;\n            }\n        }\n        return tags;\n    }\n    /** Get all JSDoc tags related to a node, including those on parent nodes. */\n    function getJSDocTags(node) {\n        return getJSDocTagsWorker(node, /*noCache*/ false);\n    }\n    ts.getJSDocTags = getJSDocTags;\n    /* @internal */\n    function getJSDocTagsNoCache(node) {\n        return getJSDocTagsWorker(node, /*noCache*/ true);\n    }\n    ts.getJSDocTagsNoCache = getJSDocTagsNoCache;\n    /** Get the first JSDoc tag of a specified kind, or undefined if not present. */\n    function getFirstJSDocTag(node, predicate, noCache) {\n        return ts.find(getJSDocTagsWorker(node, noCache), predicate);\n    }\n    /** Gets all JSDoc tags that match a specified predicate */\n    function getAllJSDocTags(node, predicate) {\n        return getJSDocTags(node).filter(predicate);\n    }\n    ts.getAllJSDocTags = getAllJSDocTags;\n    /** Gets all JSDoc tags of a specified kind */\n    function getAllJSDocTagsOfKind(node, kind) {\n        return getJSDocTags(node).filter(function (doc) { return doc.kind === kind; });\n    }\n    ts.getAllJSDocTagsOfKind = getAllJSDocTagsOfKind;\n    /**\n     * Gets the effective type parameters. If the node was parsed in a\n     * JavaScript file, gets the type parameters from the `@template` tag from JSDoc.\n     */\n    function getEffectiveTypeParameterDeclarations(node) {\n        if (ts.isJSDocSignature(node)) {\n            return ts.emptyArray;\n        }\n        if (ts.isJSDocTypeAlias(node)) {\n            ts.Debug.assert(node.parent.kind === 311 /* JSDocComment */);\n            return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; });\n        }\n        if (node.typeParameters) {\n            return node.typeParameters;\n        }\n        if (ts.isInJSFile(node)) {\n            var decls = ts.getJSDocTypeParameterDeclarations(node);\n            if (decls.length) {\n                return decls;\n            }\n            var typeTag = getJSDocType(node);\n            if (typeTag && ts.isFunctionTypeNode(typeTag) && typeTag.typeParameters) {\n                return typeTag.typeParameters;\n            }\n        }\n        return ts.emptyArray;\n    }\n    ts.getEffectiveTypeParameterDeclarations = getEffectiveTypeParameterDeclarations;\n    function getEffectiveConstraintOfTypeParameter(node) {\n        return node.constraint ? node.constraint :\n            ts.isJSDocTemplateTag(node.parent) && node === node.parent.typeParameters[0] ? node.parent.constraint :\n                undefined;\n    }\n    ts.getEffectiveConstraintOfTypeParameter = getEffectiveConstraintOfTypeParameter;\n    // #region\n    function isIdentifierOrPrivateIdentifier(node) {\n        return node.kind === 78 /* Identifier */ || node.kind === 79 /* PrivateIdentifier */;\n    }\n    ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier;\n    /* @internal */\n    function isGetOrSetAccessorDeclaration(node) {\n        return node.kind === 168 /* SetAccessor */ || node.kind === 167 /* GetAccessor */;\n    }\n    ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration;\n    function isPropertyAccessChain(node) {\n        return ts.isPropertyAccessExpression(node) && !!(node.flags & 32 /* OptionalChain */);\n    }\n    ts.isPropertyAccessChain = isPropertyAccessChain;\n    function isElementAccessChain(node) {\n        return ts.isElementAccessExpression(node) && !!(node.flags & 32 /* OptionalChain */);\n    }\n    ts.isElementAccessChain = isElementAccessChain;\n    function isCallChain(node) {\n        return ts.isCallExpression(node) && !!(node.flags & 32 /* OptionalChain */);\n    }\n    ts.isCallChain = isCallChain;\n    function isOptionalChain(node) {\n        var kind = node.kind;\n        return !!(node.flags & 32 /* OptionalChain */) &&\n            (kind === 201 /* PropertyAccessExpression */\n                || kind === 202 /* ElementAccessExpression */\n                || kind === 203 /* CallExpression */\n                || kind === 225 /* NonNullExpression */);\n    }\n    ts.isOptionalChain = isOptionalChain;\n    /* @internal */\n    function isOptionalChainRoot(node) {\n        return isOptionalChain(node) && !ts.isNonNullExpression(node) && !!node.questionDotToken;\n    }\n    ts.isOptionalChainRoot = isOptionalChainRoot;\n    /**\n     * Determines whether a node is the expression preceding an optional chain (i.e. `a` in `a?.b`).\n     */\n    /* @internal */\n    function isExpressionOfOptionalChainRoot(node) {\n        return isOptionalChainRoot(node.parent) && node.parent.expression === node;\n    }\n    ts.isExpressionOfOptionalChainRoot = isExpressionOfOptionalChainRoot;\n    /**\n     * Determines whether a node is the outermost `OptionalChain` in an ECMAScript `OptionalExpression`:\n     *\n     * 1. For `a?.b.c`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.`)\n     * 2. For `a?.b!`, the outermost chain is `a?.b` (`b` is the end of the chain starting at `a?.`)\n     * 3. For `(a?.b.c).d`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.` since parens end the chain)\n     * 4. For `a?.b.c?.d`, both `a?.b.c` and `a?.b.c?.d` are outermost (`c` is the end of the chain starting at `a?.`, and `d` is\n     *   the end of the chain starting at `c?.`)\n     * 5. For `a?.(b?.c).d`, both `b?.c` and `a?.(b?.c)d` are outermost (`c` is the end of the chain starting at `b`, and `d` is\n     *   the end of the chain starting at `a?.`)\n     */\n    /* @internal */\n    function isOutermostOptionalChain(node) {\n        return !isOptionalChain(node.parent) // cases 1, 2, and 3\n            || isOptionalChainRoot(node.parent) // case 4\n            || node !== node.parent.expression; // case 5\n    }\n    ts.isOutermostOptionalChain = isOutermostOptionalChain;\n    function isNullishCoalesce(node) {\n        return node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;\n    }\n    ts.isNullishCoalesce = isNullishCoalesce;\n    function isConstTypeReference(node) {\n        return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) &&\n            node.typeName.escapedText === \"const\" && !node.typeArguments;\n    }\n    ts.isConstTypeReference = isConstTypeReference;\n    function skipPartiallyEmittedExpressions(node) {\n        return ts.skipOuterExpressions(node, 8 /* PartiallyEmittedExpressions */);\n    }\n    ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions;\n    function isNonNullChain(node) {\n        return ts.isNonNullExpression(node) && !!(node.flags & 32 /* OptionalChain */);\n    }\n    ts.isNonNullChain = isNonNullChain;\n    function isBreakOrContinueStatement(node) {\n        return node.kind === 241 /* BreakStatement */ || node.kind === 240 /* ContinueStatement */;\n    }\n    ts.isBreakOrContinueStatement = isBreakOrContinueStatement;\n    function isNamedExportBindings(node) {\n        return node.kind === 269 /* NamespaceExport */ || node.kind === 268 /* NamedExports */;\n    }\n    ts.isNamedExportBindings = isNamedExportBindings;\n    function isUnparsedTextLike(node) {\n        switch (node.kind) {\n            case 294 /* UnparsedText */:\n            case 295 /* UnparsedInternalText */:\n                return true;\n            default:\n                return false;\n        }\n    }\n    ts.isUnparsedTextLike = isUnparsedTextLike;\n    function isUnparsedNode(node) {\n        return isUnparsedTextLike(node) ||\n            node.kind === 292 /* UnparsedPrologue */ ||\n            node.kind === 296 /* UnparsedSyntheticReference */;\n    }\n    ts.isUnparsedNode = isUnparsedNode;\n    function isJSDocPropertyLikeTag(node) {\n        return node.kind === 333 /* JSDocPropertyTag */ || node.kind === 326 /* JSDocParameterTag */;\n    }\n    ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag;\n    // #endregion\n    // #region\n    // Node tests\n    //\n    // All node tests in the following list should *not* reference parent pointers so that\n    // they may be used with transformations.\n    /* @internal */\n    function isNode(node) {\n        return isNodeKind(node.kind);\n    }\n    ts.isNode = isNode;\n    /* @internal */\n    function isNodeKind(kind) {\n        return kind >= 157 /* FirstNode */;\n    }\n    ts.isNodeKind = isNodeKind;\n    /**\n     * True if node is of some token syntax kind.\n     * For example, this is true for an IfKeyword but not for an IfStatement.\n     * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail.\n     */\n    function isToken(n) {\n        return n.kind >= 0 /* FirstToken */ && n.kind <= 156 /* LastToken */;\n    }\n    ts.isToken = isToken;\n    // Node Arrays\n    /* @internal */\n    function isNodeArray(array) {\n        return array.hasOwnProperty(\"pos\") && array.hasOwnProperty(\"end\");\n    }\n    ts.isNodeArray = isNodeArray;\n    // Literals\n    /* @internal */\n    function isLiteralKind(kind) {\n        return 8 /* FirstLiteralToken */ <= kind && kind <= 14 /* LastLiteralToken */;\n    }\n    ts.isLiteralKind = isLiteralKind;\n    function isLiteralExpression(node) {\n        return isLiteralKind(node.kind);\n    }\n    ts.isLiteralExpression = isLiteralExpression;\n    // Pseudo-literals\n    /* @internal */\n    function isTemplateLiteralKind(kind) {\n        return 14 /* FirstTemplateToken */ <= kind && kind <= 17 /* LastTemplateToken */;\n    }\n    ts.isTemplateLiteralKind = isTemplateLiteralKind;\n    function isTemplateLiteralToken(node) {\n        return isTemplateLiteralKind(node.kind);\n    }\n    ts.isTemplateLiteralToken = isTemplateLiteralToken;\n    function isTemplateMiddleOrTemplateTail(node) {\n        var kind = node.kind;\n        return kind === 16 /* TemplateMiddle */\n            || kind === 17 /* TemplateTail */;\n    }\n    ts.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail;\n    function isImportOrExportSpecifier(node) {\n        return ts.isImportSpecifier(node) || ts.isExportSpecifier(node);\n    }\n    ts.isImportOrExportSpecifier = isImportOrExportSpecifier;\n    function isTypeOnlyImportOrExportDeclaration(node) {\n        switch (node.kind) {\n            case 265 /* ImportSpecifier */:\n            case 270 /* ExportSpecifier */:\n                return node.parent.parent.isTypeOnly;\n            case 263 /* NamespaceImport */:\n                return node.parent.isTypeOnly;\n            case 262 /* ImportClause */:\n            case 260 /* ImportEqualsDeclaration */:\n                return node.isTypeOnly;\n            default:\n                return false;\n        }\n    }\n    ts.isTypeOnlyImportOrExportDeclaration = isTypeOnlyImportOrExportDeclaration;\n    function isStringTextContainingNode(node) {\n        return node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind);\n    }\n    ts.isStringTextContainingNode = isStringTextContainingNode;\n    // Identifiers\n    /* @internal */\n    function isGeneratedIdentifier(node) {\n        return ts.isIdentifier(node) && (node.autoGenerateFlags & 7 /* KindMask */) > 0 /* None */;\n    }\n    ts.isGeneratedIdentifier = isGeneratedIdentifier;\n    // Private Identifiers\n    /*@internal*/\n    function isPrivateIdentifierPropertyDeclaration(node) {\n        return ts.isPropertyDeclaration(node) && ts.isPrivateIdentifier(node.name);\n    }\n    ts.isPrivateIdentifierPropertyDeclaration = isPrivateIdentifierPropertyDeclaration;\n    /*@internal*/\n    function isPrivateIdentifierPropertyAccessExpression(node) {\n        return ts.isPropertyAccessExpression(node) && ts.isPrivateIdentifier(node.name);\n    }\n    ts.isPrivateIdentifierPropertyAccessExpression = isPrivateIdentifierPropertyAccessExpression;\n    // Keywords\n    /* @internal */\n    function isModifierKind(token) {\n        switch (token) {\n            case 125 /* AbstractKeyword */:\n            case 129 /* AsyncKeyword */:\n            case 84 /* ConstKeyword */:\n            case 133 /* DeclareKeyword */:\n            case 87 /* DefaultKeyword */:\n            case 92 /* ExportKeyword */:\n            case 122 /* PublicKeyword */:\n            case 120 /* PrivateKeyword */:\n            case 121 /* ProtectedKeyword */:\n            case 142 /* ReadonlyKeyword */:\n            case 123 /* StaticKeyword */:\n                return true;\n        }\n        return false;\n    }\n    ts.isModifierKind = isModifierKind;\n    /* @internal */\n    function isParameterPropertyModifier(kind) {\n        return !!(ts.modifierToFlag(kind) & 92 /* ParameterPropertyModifier */);\n    }\n    ts.isParameterPropertyModifier = isParameterPropertyModifier;\n    /* @internal */\n    function isClassMemberModifier(idToken) {\n        return isParameterPropertyModifier(idToken) || idToken === 123 /* StaticKeyword */;\n    }\n    ts.isClassMemberModifier = isClassMemberModifier;\n    function isModifier(node) {\n        return isModifierKind(node.kind);\n    }\n    ts.isModifier = isModifier;\n    function isEntityName(node) {\n        var kind = node.kind;\n        return kind === 157 /* QualifiedName */\n            || kind === 78 /* Identifier */;\n    }\n    ts.isEntityName = isEntityName;\n    function isPropertyName(node) {\n        var kind = node.kind;\n        return kind === 78 /* Identifier */\n            || kind === 79 /* PrivateIdentifier */\n            || kind === 10 /* StringLiteral */\n            || kind === 8 /* NumericLiteral */\n            || kind === 158 /* ComputedPropertyName */;\n    }\n    ts.isPropertyName = isPropertyName;\n    function isBindingName(node) {\n        var kind = node.kind;\n        return kind === 78 /* Identifier */\n            || kind === 196 /* ObjectBindingPattern */\n            || kind === 197 /* ArrayBindingPattern */;\n    }\n    ts.isBindingName = isBindingName;\n    // Functions\n    function isFunctionLike(node) {\n        return node && isFunctionLikeKind(node.kind);\n    }\n    ts.isFunctionLike = isFunctionLike;\n    /* @internal */\n    function isFunctionLikeDeclaration(node) {\n        return node && isFunctionLikeDeclarationKind(node.kind);\n    }\n    ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration;\n    function isFunctionLikeDeclarationKind(kind) {\n        switch (kind) {\n            case 251 /* FunctionDeclaration */:\n            case 165 /* MethodDeclaration */:\n            case 166 /* Constructor */:\n            case 167 /* GetAccessor */:\n            case 168 /* SetAccessor */:\n            case 208 /* FunctionExpression */:\n            case 209 /* ArrowFunction */:\n                return true;\n            default:\n                return false;\n        }\n    }\n    /* @internal */\n    function isFunctionLikeKind(kind) {\n        switch (kind) {\n            case 164 /* MethodSignature */:\n            case 169 /* CallSignature */:\n            case 313 /* JSDocSignature */:\n            case 170 /* ConstructSignature */:\n            case 171 /* IndexSignature */:\n            case 174 /* FunctionType */:\n            case 308 /* JSDocFunctionType */:\n            case 175 /* ConstructorType */:\n                return true;\n            default:\n                return isFunctionLikeDeclarationKind(kind);\n        }\n    }\n    ts.isFunctionLikeKind = isFunctionLikeKind;\n    /* @internal */\n    function isFunctionOrModuleBlock(node) {\n        return ts.isSourceFile(node) || ts.isModuleBlock(node) || ts.isBlock(node) && isFunctionLike(node.parent);\n    }\n    ts.isFunctionOrModuleBlock = isFunctionOrModuleBlock;\n    // Classes\n    function isClassElement(node) {\n        var kind = node.kind;\n        return kind === 166 /* Constructor */\n            || kind === 163 /* PropertyDeclaration */\n            || kind === 165 /* MethodDeclaration */\n            || kind === 167 /* GetAccessor */\n            || kind === 168 /* SetAccessor */\n            || kind === 171 /* IndexSignature */\n            || kind === 229 /* SemicolonClassElement */;\n    }\n    ts.isClassElement = isClassElement;\n    function isClassLike(node) {\n        return node && (node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */);\n    }\n    ts.isClassLike = isClassLike;\n    function isAccessor(node) {\n        return node && (node.kind === 167 /* GetAccessor */ || node.kind === 168 /* SetAccessor */);\n    }\n    ts.isAccessor = isAccessor;\n    /* @internal */\n    function isMethodOrAccessor(node) {\n        switch (node.kind) {\n            case 165 /* MethodDeclaration */:\n            case 167 /* GetAccessor */:\n            case 168 /* SetAccessor */:\n                return true;\n            default:\n                return false;\n        }\n    }\n    ts.isMethodOrAccessor = isMethodOrAccessor;\n    // Type members\n    function isTypeElement(node) {\n        var kind = node.kind;\n        return kind === 170 /* ConstructSignature */\n            || kind === 169 /* CallSignature */\n            || kind === 162 /* PropertySignature */\n            || kind === 164 /* MethodSignature */\n            || kind === 171 /* IndexSignature */;\n    }\n    ts.isTypeElement = isTypeElement;\n    function isClassOrTypeElement(node) {\n        return isTypeElement(node) || isClassElement(node);\n    }\n    ts.isClassOrTypeElement = isClassOrTypeElement;\n    function isObjectLiteralElementLike(node) {\n        var kind = node.kind;\n        return kind === 288 /* PropertyAssignment */\n            || kind === 289 /* ShorthandPropertyAssignment */\n            || kind === 290 /* SpreadAssignment */\n            || kind === 165 /* MethodDeclaration */\n            || kind === 167 /* GetAccessor */\n            || kind === 168 /* SetAccessor */;\n    }\n    ts.isObjectLiteralElementLike = isObjectLiteralElementLike;\n    // Type\n    /**\n     * Node test that determines whether a node is a valid type node.\n     * This differs from the `isPartOfTypeNode` function which determines whether a node is *part*\n     * of a TypeNode.\n     */\n    function isTypeNode(node) {\n        return ts.isTypeNodeKind(node.kind);\n    }\n    ts.isTypeNode = isTypeNode;\n    function isFunctionOrConstructorTypeNode(node) {\n        switch (node.kind) {\n            case 174 /* FunctionType */:\n            case 175 /* ConstructorType */:\n                return true;\n        }\n        return false;\n    }\n    ts.isFunctionOrConstructorTypeNode = isFunctionOrConstructorTypeNode;\n    // Binding patterns\n    /* @internal */\n    function isBindingPattern(node) {\n        if (node) {\n            var kind = node.kind;\n            return kind === 197 /* ArrayBindingPattern */\n                || kind === 196 /* ObjectBindingPattern */;\n        }\n        return false;\n    }\n    ts.isBindingPattern = isBindingPattern;\n    /* @internal */\n    function isAssignmentPattern(node) {\n        var kind = node.kind;\n        return kind === 199 /* ArrayLiteralExpression */\n            || kind === 200 /* ObjectLiteralExpression */;\n    }\n    ts.isAssignmentPattern = isAssignmentPattern;\n    /* @internal */\n    function isArrayBindingElement(node) {\n        var kind = node.kind;\n        return kind === 198 /* BindingElement */\n            || kind === 222 /* OmittedExpression */;\n    }\n    ts.isArrayBindingElement = isArrayBindingElement;\n    /**\n     * Determines whether the BindingOrAssignmentElement is a BindingElement-like declaration\n     */\n    /* @internal */\n    function isDeclarationBindingElement(bindingElement) {\n        switch (bindingElement.kind) {\n            case 249 /* VariableDeclaration */:\n            case 160 /* Parameter */:\n            case 198 /* BindingElement */:\n                return true;\n        }\n        return false;\n    }\n    ts.isDeclarationBindingElement = isDeclarationBindingElement;\n    /**\n     * Determines whether a node is a BindingOrAssignmentPattern\n     */\n    /* @internal */\n    function isBindingOrAssignmentPattern(node) {\n        return isObjectBindingOrAssignmentPattern(node)\n            || isArrayBindingOrAssignmentPattern(node);\n    }\n    ts.isBindingOrAssignmentPattern = isBindingOrAssignmentPattern;\n    /**\n     * Determines whether a node is an ObjectBindingOrAssignmentPattern\n     */\n    /* @internal */\n    function isObjectBindingOrAssignmentPattern(node) {\n        switch (node.kind) {\n            case 196 /* ObjectBindingPattern */:\n            case 200 /* ObjectLiteralExpression */:\n                return true;\n        }\n        return false;\n    }\n    ts.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern;\n    /**\n     * Determines whether a node is an ArrayBindingOrAssignmentPattern\n     */\n    /* @internal */\n    function isArrayBindingOrAssignmentPattern(node) {\n        switch (node.kind) {\n            case 197 /* ArrayBindingPattern */:\n            case 199 /* ArrayLiteralExpression */:\n                return true;\n        }\n        return false;\n    }\n    ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern;\n    /* @internal */\n    function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {\n        var kind = node.kind;\n        return kind === 201 /* PropertyAccessExpression */\n            || kind === 157 /* QualifiedName */\n            || kind === 195 /* ImportType */;\n    }\n    ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode;\n    // Expression\n    function isPropertyAccessOrQualifiedName(node) {\n        var kind = node.kind;\n        return kind === 201 /* PropertyAccessExpression */\n            || kind === 157 /* QualifiedName */;\n    }\n    ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName;\n    function isCallLikeExpression(node) {\n        switch (node.kind) {\n            case 275 /* JsxOpeningElement */:\n            case 274 /* JsxSelfClosingElement */:\n            case 203 /* CallExpression */:\n            case 204 /* NewExpression */:\n            case 205 /* TaggedTemplateExpression */:\n            case 161 /* Decorator */:\n                return true;\n            default:\n                return false;\n        }\n    }\n    ts.isCallLikeExpression = isCallLikeExpression;\n    function isCallOrNewExpression(node) {\n        return node.kind === 203 /* CallExpression */ || node.kind === 204 /* NewExpression */;\n    }\n    ts.isCallOrNewExpression = isCallOrNewExpression;\n    function isTemplateLiteral(node) {\n        var kind = node.kind;\n        return kind === 218 /* TemplateExpression */\n            || kind === 14 /* NoSubstitutionTemplateLiteral */;\n    }\n    ts.isTemplateLiteral = isTemplateLiteral;\n    /* @internal */\n    function isLeftHandSideExpression(node) {\n        return isLeftHandSideExpressionKind(skipPartiallyEmittedExpressions(node).kind);\n    }\n    ts.isLeftHandSideExpression = isLeftHandSideExpression;\n    function isLeftHandSideExpressionKind(kind) {\n        switch (kind) {\n            case 201 /* PropertyAccessExpression */:\n            case 202 /* ElementAccessExpression */:\n            case 204 /* NewExpression */:\n            case 203 /* CallExpression */:\n            case 273 /* JsxElement */:\n            case 274 /* JsxSelfClosingElement */:\n            case 277 /* JsxFragment */:\n            case 205 /* TaggedTemplateExpression */:\n            case 199 /* ArrayLiteralExpression */:\n            case 207 /* ParenthesizedExpression */:\n            case 200 /* ObjectLiteralExpression */:\n            case 221 /* ClassExpression */:\n            case 208 /* FunctionExpression */:\n            case 78 /* Identifier */:\n            case 13 /* RegularExpressionLiteral */:\n            case 8 /* NumericLiteral */:\n            case 9 /* BigIntLiteral */:\n            case 10 /* StringLiteral */:\n            case 14 /* NoSubstitutionTemplateLiteral */:\n            case 218 /* TemplateExpression */:\n            case 94 /* FalseKeyword */:\n            case 103 /* NullKeyword */:\n            case 107 /* ThisKeyword */:\n            case 109 /* TrueKeyword */:\n            case 105 /* SuperKeyword */:\n            case 225 /* NonNullExpression */:\n            case 226 /* MetaProperty */:\n            case 99 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression\n                return true;\n            default:\n                return false;\n        }\n    }\n    /* @internal */\n    function isUnaryExpression(node) {\n        return isUnaryExpressionKind(skipPartiallyEmittedExpressions(node).kind);\n    }\n    ts.isUnaryExpression = isUnaryExpression;\n    function isUnaryExpressionKind(kind) {\n        switch (kind) {\n            case 214 /* PrefixUnaryExpression */:\n            case 215 /* PostfixUnaryExpression */:\n            case 210 /* DeleteExpression */:\n            case 211 /* TypeOfExpression */:\n            case 212 /* VoidExpression */:\n            case 213 /* AwaitExpression */:\n            case 206 /* TypeAssertionExpression */:\n                return true;\n            default:\n                return isLeftHandSideExpressionKind(kind);\n        }\n    }\n    /* @internal */\n    function isUnaryExpressionWithWrite(expr) {\n        switch (expr.kind) {\n            case 215 /* PostfixUnaryExpression */:\n                return true;\n            case 214 /* PrefixUnaryExpression */:\n                return expr.operator === 45 /* PlusPlusToken */ ||\n                    expr.operator === 46 /* MinusMinusToken */;\n            default:\n                return false;\n        }\n    }\n    ts.isUnaryExpressionWithWrite = isUnaryExpressionWithWrite;\n    /* @internal */\n    /**\n     * Determines whether a node is an expression based only on its kind.\n     * Use `isExpressionNode` if not in transforms.\n     */\n    function isExpression(node) {\n        return isExpressionKind(skipPartiallyEmittedExpressions(node).kind);\n    }\n    ts.isExpression = isExpression;\n    function isExpressionKind(kind) {\n        switch (kind) {\n            case 217 /* ConditionalExpression */:\n            case 219 /* YieldExpression */:\n            case 209 /* ArrowFunction */:\n            case 216 /* BinaryExpression */:\n            case 220 /* SpreadElement */:\n            case 224 /* AsExpression */:\n            case 222 /* OmittedExpression */:\n            case 337 /* CommaListExpression */:\n            case 336 /* PartiallyEmittedExpression */:\n                return true;\n            default:\n                return isUnaryExpressionKind(kind);\n        }\n    }\n    function isAssertionExpression(node) {\n        var kind = node.kind;\n        return kind === 206 /* TypeAssertionExpression */\n            || kind === 224 /* AsExpression */;\n    }\n    ts.isAssertionExpression = isAssertionExpression;\n    /* @internal */\n    function isNotEmittedOrPartiallyEmittedNode(node) {\n        return ts.isNotEmittedStatement(node)\n            || ts.isPartiallyEmittedExpression(node);\n    }\n    ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode;\n    function isIterationStatement(node, lookInLabeledStatements) {\n        switch (node.kind) {\n            case 237 /* ForStatement */:\n            case 238 /* ForInStatement */:\n            case 239 /* ForOfStatement */:\n            case 235 /* DoStatement */:\n            case 236 /* WhileStatement */:\n                return true;\n            case 245 /* LabeledStatement */:\n                return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements);\n        }\n        return false;\n    }\n    ts.isIterationStatement = isIterationStatement;\n    /* @internal */\n    function isScopeMarker(node) {\n        return ts.isExportAssignment(node) || ts.isExportDeclaration(node);\n    }\n    ts.isScopeMarker = isScopeMarker;\n    /* @internal */\n    function hasScopeMarker(statements) {\n        return ts.some(statements, isScopeMarker);\n    }\n    ts.hasScopeMarker = hasScopeMarker;\n    /* @internal */\n    function needsScopeMarker(result) {\n        return !ts.isAnyImportOrReExport(result) && !ts.isExportAssignment(result) && !ts.hasSyntacticModifier(result, 1 /* Export */) && !ts.isAmbientModule(result);\n    }\n    ts.needsScopeMarker = needsScopeMarker;\n    /* @internal */\n    function isExternalModuleIndicator(result) {\n        // Exported top-level member indicates moduleness\n        return ts.isAnyImportOrReExport(result) || ts.isExportAssignment(result) || ts.hasSyntacticModifier(result, 1 /* Export */);\n    }\n    ts.isExternalModuleIndicator = isExternalModuleIndicator;\n    /* @internal */\n    function isForInOrOfStatement(node) {\n        return node.kind === 238 /* ForInStatement */ || node.kind === 239 /* ForOfStatement */;\n    }\n    ts.isForInOrOfStatement = isForInOrOfStatement;\n    // Element\n    /* @internal */\n    function isConciseBody(node) {\n        return ts.isBlock(node)\n            || isExpression(node);\n    }\n    ts.isConciseBody = isConciseBody;\n    /* @internal */\n    function isFunctionBody(node) {\n        return ts.isBlock(node);\n    }\n    ts.isFunctionBody = isFunctionBody;\n    /* @internal */\n    function isForInitializer(node) {\n        return ts.isVariableDeclarationList(node)\n            || isExpression(node);\n    }\n    ts.isForInitializer = isForInitializer;\n    /* @internal */\n    function isModuleBody(node) {\n        var kind = node.kind;\n        return kind === 257 /* ModuleBlock */\n            || kind === 256 /* ModuleDeclaration */\n            || kind === 78 /* Identifier */;\n    }\n    ts.isModuleBody = isModuleBody;\n    /* @internal */\n    function isNamespaceBody(node) {\n        var kind = node.kind;\n        return kind === 257 /* ModuleBlock */\n            || kind === 256 /* ModuleDeclaration */;\n    }\n    ts.isNamespaceBody = isNamespaceBody;\n    /* @internal */\n    function isJSDocNamespaceBody(node) {\n        var kind = node.kind;\n        return kind === 78 /* Identifier */\n            || kind === 256 /* ModuleDeclaration */;\n    }\n    ts.isJSDocNamespaceBody = isJSDocNamespaceBody;\n    /* @internal */\n    function isNamedImportBindings(node) {\n        var kind = node.kind;\n        return kind === 264 /* NamedImports */\n            || kind === 263 /* NamespaceImport */;\n    }\n    ts.isNamedImportBindings = isNamedImportBindings;\n    /* @internal */\n    function isModuleOrEnumDeclaration(node) {\n        return node.kind === 256 /* ModuleDeclaration */ || node.kind === 255 /* EnumDeclaration */;\n    }\n    ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration;\n    function isDeclarationKind(kind) {\n        return kind === 209 /* ArrowFunction */\n            || kind === 198 /* BindingElement */\n            || kind === 252 /* ClassDeclaration */\n            || kind === 221 /* ClassExpression */\n            || kind === 166 /* Constructor */\n            || kind === 255 /* EnumDeclaration */\n            || kind === 291 /* EnumMember */\n            || kind === 270 /* ExportSpecifier */\n            || kind === 251 /* FunctionDeclaration */\n            || kind === 208 /* FunctionExpression */\n            || kind === 167 /* GetAccessor */\n            || kind === 262 /* ImportClause */\n            || kind === 260 /* ImportEqualsDeclaration */\n            || kind === 265 /* ImportSpecifier */\n            || kind === 253 /* InterfaceDeclaration */\n            || kind === 280 /* JsxAttribute */\n            || kind === 165 /* MethodDeclaration */\n            || kind === 164 /* MethodSignature */\n            || kind === 256 /* ModuleDeclaration */\n            || kind === 259 /* NamespaceExportDeclaration */\n            || kind === 263 /* NamespaceImport */\n            || kind === 269 /* NamespaceExport */\n            || kind === 160 /* Parameter */\n            || kind === 288 /* PropertyAssignment */\n            || kind === 163 /* PropertyDeclaration */\n            || kind === 162 /* PropertySignature */\n            || kind === 168 /* SetAccessor */\n            || kind === 289 /* ShorthandPropertyAssignment */\n            || kind === 254 /* TypeAliasDeclaration */\n            || kind === 159 /* TypeParameter */\n            || kind === 249 /* VariableDeclaration */\n            || kind === 331 /* JSDocTypedefTag */\n            || kind === 324 /* JSDocCallbackTag */\n            || kind === 333 /* JSDocPropertyTag */;\n    }\n    function isDeclarationStatementKind(kind) {\n        return kind === 251 /* FunctionDeclaration */\n            || kind === 271 /* MissingDeclaration */\n            || kind === 252 /* ClassDeclaration */\n            || kind === 253 /* InterfaceDeclaration */\n            || kind === 254 /* TypeAliasDeclaration */\n            || kind === 255 /* EnumDeclaration */\n            || kind === 256 /* ModuleDeclaration */\n            || kind === 261 /* ImportDeclaration */\n            || kind === 260 /* ImportEqualsDeclaration */\n            || kind === 267 /* ExportDeclaration */\n            || kind === 266 /* ExportAssignment */\n            || kind === 259 /* NamespaceExportDeclaration */;\n    }\n    function isStatementKindButNotDeclarationKind(kind) {\n        return kind === 241 /* BreakStatement */\n            || kind === 240 /* ContinueStatement */\n            || kind === 248 /* DebuggerStatement */\n            || kind === 235 /* DoStatement */\n            || kind === 233 /* ExpressionStatement */\n            || kind === 231 /* EmptyStatement */\n            || kind === 238 /* ForInStatement */\n            || kind === 239 /* ForOfStatement */\n            || kind === 237 /* ForStatement */\n            || kind === 234 /* IfStatement */\n            || kind === 245 /* LabeledStatement */\n            || kind === 242 /* ReturnStatement */\n            || kind === 244 /* SwitchStatement */\n            || kind === 246 /* ThrowStatement */\n            || kind === 247 /* TryStatement */\n            || kind === 232 /* VariableStatement */\n            || kind === 236 /* WhileStatement */\n            || kind === 243 /* WithStatement */\n            || kind === 335 /* NotEmittedStatement */\n            || kind === 339 /* EndOfDeclarationMarker */\n            || kind === 338 /* MergeDeclarationMarker */;\n    }\n    /* @internal */\n    function isDeclaration(node) {\n        if (node.kind === 159 /* TypeParameter */) {\n            return (node.parent && node.parent.kind !== 330 /* JSDocTemplateTag */) || ts.isInJSFile(node);\n        }\n        return isDeclarationKind(node.kind);\n    }\n    ts.isDeclaration = isDeclaration;\n    /* @internal */\n    function isDeclarationStatement(node) {\n        return isDeclarationStatementKind(node.kind);\n    }\n    ts.isDeclarationStatement = isDeclarationStatement;\n    /**\n     * Determines whether the node is a statement that is not also a declaration\n     */\n    /* @internal */\n    function isStatementButNotDeclaration(node) {\n        return isStatementKindButNotDeclarationKind(node.kind);\n    }\n    ts.isStatementButNotDeclaration = isStatementButNotDeclaration;\n    /* @internal */\n    function isStatement(node) {\n        var kind = node.kind;\n        return isStatementKindButNotDeclarationKind(kind)\n            || isDeclarationStatementKind(kind)\n            || isBlockStatement(node);\n    }\n    ts.isStatement = isStatement;\n    function isBlockStatement(node) {\n        if (node.kind !== 230 /* Block */)\n            return false;\n        if (node.parent !== undefined) {\n            if (node.parent.kind === 247 /* TryStatement */ || node.parent.kind === 287 /* CatchClause */) {\n                return false;\n            }\n        }\n        return !ts.isFunctionBlock(node);\n    }\n    /**\n     * NOTE: This is similar to `isStatement` but does not access parent pointers.\n     */\n    /* @internal */\n    function isStatementOrBlock(node) {\n        var kind = node.kind;\n        return isStatementKindButNotDeclarationKind(kind)\n            || isDeclarationStatementKind(kind)\n            || kind === 230 /* Block */;\n    }\n    ts.isStatementOrBlock = isStatementOrBlock;\n    // Module references\n    /* @internal */\n    function isModuleReference(node) {\n        var kind = node.kind;\n        return kind === 272 /* ExternalModuleReference */\n            || kind === 157 /* QualifiedName */\n            || kind === 78 /* Identifier */;\n    }\n    ts.isModuleReference = isModuleReference;\n    // JSX\n    /* @internal */\n    function isJsxTagNameExpression(node) {\n        var kind = node.kind;\n        return kind === 107 /* ThisKeyword */\n            || kind === 78 /* Identifier */\n            || kind === 201 /* PropertyAccessExpression */;\n    }\n    ts.isJsxTagNameExpression = isJsxTagNameExpression;\n    /* @internal */\n    function isJsxChild(node) {\n        var kind = node.kind;\n        return kind === 273 /* JsxElement */\n            || kind === 283 /* JsxExpression */\n            || kind === 274 /* JsxSelfClosingElement */\n            || kind === 11 /* JsxText */\n            || kind === 277 /* JsxFragment */;\n    }\n    ts.isJsxChild = isJsxChild;\n    /* @internal */\n    function isJsxAttributeLike(node) {\n        var kind = node.kind;\n        return kind === 280 /* JsxAttribute */\n            || kind === 282 /* JsxSpreadAttribute */;\n    }\n    ts.isJsxAttributeLike = isJsxAttributeLike;\n    /* @internal */\n    function isStringLiteralOrJsxExpression(node) {\n        var kind = node.kind;\n        return kind === 10 /* StringLiteral */\n            || kind === 283 /* JsxExpression */;\n    }\n    ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression;\n    function isJsxOpeningLikeElement(node) {\n        var kind = node.kind;\n        return kind === 275 /* JsxOpeningElement */\n            || kind === 274 /* JsxSelfClosingElement */;\n    }\n    ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement;\n    // Clauses\n    function isCaseOrDefaultClause(node) {\n        var kind = node.kind;\n        return kind === 284 /* CaseClause */\n            || kind === 285 /* DefaultClause */;\n    }\n    ts.isCaseOrDefaultClause = isCaseOrDefaultClause;\n    // JSDoc\n    /** True if node is of some JSDoc syntax kind. */\n    /* @internal */\n    function isJSDocNode(node) {\n        return node.kind >= 301 /* FirstJSDocNode */ && node.kind <= 333 /* LastJSDocNode */;\n    }\n    ts.isJSDocNode = isJSDocNode;\n    /** True if node is of a kind that may contain comment text. */\n    function isJSDocCommentContainingNode(node) {\n        return node.kind === 311 /* JSDocComment */ || node.kind === 310 /* JSDocNamepathType */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node);\n    }\n    ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode;\n    // TODO: determine what this does before making it public.\n    /* @internal */\n    function isJSDocTag(node) {\n        return node.kind >= 314 /* FirstJSDocTagNode */ && node.kind <= 333 /* LastJSDocTagNode */;\n    }\n    ts.isJSDocTag = isJSDocTag;\n    function isSetAccessor(node) {\n        return node.kind === 168 /* SetAccessor */;\n    }\n    ts.isSetAccessor = isSetAccessor;\n    function isGetAccessor(node) {\n        return node.kind === 167 /* GetAccessor */;\n    }\n    ts.isGetAccessor = isGetAccessor;\n    /** True if has jsdoc nodes attached to it. */\n    /* @internal */\n    // TODO: GH#19856 Would like to return `node is Node & { jsDoc: JSDoc[] }` but it causes long compile times\n    function hasJSDocNodes(node) {\n        var jsDoc = node.jsDoc;\n        return !!jsDoc && jsDoc.length > 0;\n    }\n    ts.hasJSDocNodes = hasJSDocNodes;\n    /** True if has type node attached to it. */\n    /* @internal */\n    function hasType(node) {\n        return !!node.type;\n    }\n    ts.hasType = hasType;\n    /** True if has initializer node attached to it. */\n    /* @internal */\n    function hasInitializer(node) {\n        return !!node.initializer;\n    }\n    ts.hasInitializer = hasInitializer;\n    /** True if has initializer node attached to it. */\n    function hasOnlyExpressionInitializer(node) {\n        switch (node.kind) {\n            case 249 /* VariableDeclaration */:\n            case 160 /* Parameter */:\n            case 198 /* BindingElement */:\n            case 162 /* PropertySignature */:\n            case 163 /* PropertyDeclaration */:\n            case 288 /* PropertyAssignment */:\n            case 291 /* EnumMember */:\n                return true;\n            default:\n                return false;\n        }\n    }\n    ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer;\n    function isObjectLiteralElement(node) {\n        return node.kind === 280 /* JsxAttribute */ || node.kind === 282 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node);\n    }\n    ts.isObjectLiteralElement = isObjectLiteralElement;\n    /* @internal */\n    function isTypeReferenceType(node) {\n        return node.kind === 173 /* TypeReference */ || node.kind === 223 /* ExpressionWithTypeArguments */;\n    }\n    ts.isTypeReferenceType = isTypeReferenceType;\n    var MAX_SMI_X86 = 1073741823;\n    /* @internal */\n    function guessIndentation(lines) {\n        var indentation = MAX_SMI_X86;\n        for (var _i = 0, lines_1 = lines; _i < lines_1.length; _i++) {\n            var line = lines_1[_i];\n            if (!line.length) {\n                continue;\n            }\n            var i = 0;\n            for (; i < line.length && i < indentation; i++) {\n                if (!ts.isWhiteSpaceLike(line.charCodeAt(i))) {\n                    break;\n                }\n            }\n            if (i < indentation) {\n                indentation = i;\n            }\n            if (indentation === 0) {\n                return 0;\n            }\n        }\n        return indentation === MAX_SMI_X86 ? undefined : indentation;\n    }\n    ts.guessIndentation = guessIndentation;\n    function isStringLiteralLike(node) {\n        return node.kind === 10 /* StringLiteral */ || node.kind === 14 /* NoSubstitutionTemplateLiteral */;\n    }\n    ts.isStringLiteralLike = isStringLiteralLike;\n    // #endregion\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    ts.resolvingEmptyArray = [];\n    ts.externalHelpersModuleNameText = \"tslib\";\n    ts.defaultMaximumTruncationLength = 160;\n    ts.noTruncationMaximumTruncationLength = 1000000;\n    function getDeclarationOfKind(symbol, kind) {\n        var declarations = symbol.declarations;\n        if (declarations) {\n            for (var _i = 0, declarations_1 = declarations; _i < declarations_1.length; _i++) {\n                var declaration = declarations_1[_i];\n                if (declaration.kind === kind) {\n                    return declaration;\n                }\n            }\n        }\n        return undefined;\n    }\n    ts.getDeclarationOfKind = getDeclarationOfKind;\n    /**\n     * Create a new escaped identifier map.\n     * @deprecated Use `new Map<__String, T>()` instead.\n     */\n    function createUnderscoreEscapedMap() {\n        return new ts.Map();\n    }\n    ts.createUnderscoreEscapedMap = createUnderscoreEscapedMap;\n    /**\n     * @deprecated Use `!!map?.size` instead\n     */\n    function hasEntries(map) {\n        return !!map && !!map.size;\n    }\n    ts.hasEntries = hasEntries;\n    function createSymbolTable(symbols) {\n        var result = new ts.Map();\n        if (symbols) {\n            for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) {\n                var symbol = symbols_1[_i];\n                result.set(symbol.escapedName, symbol);\n            }\n        }\n        return result;\n    }\n    ts.createSymbolTable = createSymbolTable;\n    function isTransientSymbol(symbol) {\n        return (symbol.flags & 33554432 /* Transient */) !== 0;\n    }\n    ts.isTransientSymbol = isTransientSymbol;\n    var stringWriter = createSingleLineStringWriter();\n    function createSingleLineStringWriter() {\n        var str = \"\";\n        var writeText = function (text) { return str += text; };\n        return {\n            getText: function () { return str; },\n            write: writeText,\n            rawWrite: writeText,\n            writeKeyword: writeText,\n            writeOperator: writeText,\n            writePunctuation: writeText,\n            writeSpace: writeText,\n            writeStringLiteral: writeText,\n            writeLiteral: writeText,\n            writeParameter: writeText,\n            writeProperty: writeText,\n            writeSymbol: function (s, _) { return writeText(s); },\n            writeTrailingSemicolon: writeText,\n            writeComment: writeText,\n            getTextPos: function () { return str.length; },\n            getLine: function () { return 0; },\n            getColumn: function () { return 0; },\n            getIndent: function () { return 0; },\n            isAtStartOfLine: function () { return false; },\n            hasTrailingComment: function () { return false; },\n            hasTrailingWhitespace: function () { return !!str.length && ts.isWhiteSpaceLike(str.charCodeAt(str.length - 1)); },\n            // Completely ignore indentation for string writers.  And map newlines to\n            // a single space.\n            writeLine: function () { return str += \" \"; },\n            increaseIndent: ts.noop,\n            decreaseIndent: ts.noop,\n            clear: function () { return str = \"\"; },\n            trackSymbol: ts.noop,\n            reportInaccessibleThisError: ts.noop,\n            reportInaccessibleUniqueSymbolError: ts.noop,\n            reportPrivateInBaseOfClassExpression: ts.noop,\n        };\n    }\n    function changesAffectModuleResolution(oldOptions, newOptions) {\n        return oldOptions.configFilePath !== newOptions.configFilePath ||\n            optionsHaveModuleResolutionChanges(oldOptions, newOptions);\n    }\n    ts.changesAffectModuleResolution = changesAffectModuleResolution;\n    function optionsHaveModuleResolutionChanges(oldOptions, newOptions) {\n        return ts.moduleResolutionOptionDeclarations.some(function (o) {\n            return !isJsonEqual(getCompilerOptionValue(oldOptions, o), getCompilerOptionValue(newOptions, o));\n        });\n    }\n    ts.optionsHaveModuleResolutionChanges = optionsHaveModuleResolutionChanges;\n    function forEachAncestor(node, callback) {\n        while (true) {\n            var res = callback(node);\n            if (res === \"quit\")\n                return undefined;\n            if (res !== undefined)\n                return res;\n            if (ts.isSourceFile(node))\n                return undefined;\n            node = node.parent;\n        }\n    }\n    ts.forEachAncestor = forEachAncestor;\n    /**\n     * Calls `callback` for each entry in the map, returning the first truthy result.\n     * Use `map.forEach` instead for normal iteration.\n     */\n    function forEachEntry(map, callback) {\n        var iterator = map.entries();\n        for (var iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) {\n            var _a = iterResult.value, key = _a[0], value = _a[1];\n            var result = callback(value, key);\n            if (result) {\n                return result;\n            }\n        }\n        return undefined;\n    }\n    ts.forEachEntry = forEachEntry;\n    /** `forEachEntry` for just keys. */\n    function forEachKey(map, callback) {\n        var iterator = map.keys();\n        for (var iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) {\n            var result = callback(iterResult.value);\n            if (result) {\n                return result;\n            }\n        }\n        return undefined;\n    }\n    ts.forEachKey = forEachKey;\n    /** Copy entries from `source` to `target`. */\n    function copyEntries(source, target) {\n        source.forEach(function (value, key) {\n            target.set(key, value);\n        });\n    }\n    ts.copyEntries = copyEntries;\n    function usingSingleLineStringWriter(action) {\n        var oldString = stringWriter.getText();\n        try {\n            action(stringWriter);\n            return stringWriter.getText();\n        }\n        finally {\n            stringWriter.clear();\n            stringWriter.writeKeyword(oldString);\n        }\n    }\n    ts.usingSingleLineStringWriter = usingSingleLineStringWriter;\n    function getFullWidth(node) {\n        return node.end - node.pos;\n    }\n    ts.getFullWidth = getFullWidth;\n    function getResolvedModule(sourceFile, moduleNameText) {\n        return sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules.get(moduleNameText);\n    }\n    ts.getResolvedModule = getResolvedModule;\n    function setResolvedModule(sourceFile, moduleNameText, resolvedModule) {\n        if (!sourceFile.resolvedModules) {\n            sourceFile.resolvedModules = new ts.Map();\n        }\n        sourceFile.resolvedModules.set(moduleNameText, resolvedModule);\n    }\n    ts.setResolvedModule = setResolvedModule;\n    function setResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, resolvedTypeReferenceDirective) {\n        if (!sourceFile.resolvedTypeReferenceDirectiveNames) {\n            sourceFile.resolvedTypeReferenceDirectiveNames = new ts.Map();\n        }\n        sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, resolvedTypeReferenceDirective);\n    }\n    ts.setResolvedTypeReferenceDirective = setResolvedTypeReferenceDirective;\n    function projectReferenceIsEqualTo(oldRef, newRef) {\n        return oldRef.path === newRef.path &&\n            !oldRef.prepend === !newRef.prepend &&\n            !oldRef.circular === !newRef.circular;\n    }\n    ts.projectReferenceIsEqualTo = projectReferenceIsEqualTo;\n    function moduleResolutionIsEqualTo(oldResolution, newResolution) {\n        return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport &&\n            oldResolution.extension === newResolution.extension &&\n            oldResolution.resolvedFileName === newResolution.resolvedFileName &&\n            oldResolution.originalPath === newResolution.originalPath &&\n            packageIdIsEqual(oldResolution.packageId, newResolution.packageId);\n    }\n    ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo;\n    function packageIdIsEqual(a, b) {\n        return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;\n    }\n    function packageIdToString(_a) {\n        var name = _a.name, subModuleName = _a.subModuleName, version = _a.version;\n        var fullName = subModuleName ? name + \"/\" + subModuleName : name;\n        return fullName + \"@\" + version;\n    }\n    ts.packageIdToString = packageIdToString;\n    function typeDirectiveIsEqualTo(oldResolution, newResolution) {\n        return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary;\n    }\n    ts.typeDirectiveIsEqualTo = typeDirectiveIsEqualTo;\n    function hasChangesInResolutions(names, newResolutions, oldResolutions, comparer) {\n        ts.Debug.assert(names.length === newResolutions.length);\n        for (var i = 0; i < names.length; i++) {\n            var newResolution = newResolutions[i];\n            var oldResolution = oldResolutions && oldResolutions.get(names[i]);\n            var changed = oldResolution\n                ? !newResolution || !comparer(oldResolution, newResolution)\n                : newResolution;\n            if (changed) {\n                return true;\n            }\n        }\n        return false;\n    }\n    ts.hasChangesInResolutions = hasChangesInResolutions;\n    // Returns true if this node contains a parse error anywhere underneath it.\n    function containsParseError(node) {\n        aggregateChildData(node);\n        return (node.flags & 262144 /* ThisNodeOrAnySubNodesHasError */) !== 0;\n    }\n    ts.containsParseError = containsParseError;\n    function aggregateChildData(node) {\n        if (!(node.flags & 524288 /* HasAggregatedChildData */)) {\n            // A node is considered to contain a parse error if:\n            //  a) the parser explicitly marked that it had an error\n            //  b) any of it's children reported that it had an error.\n            var thisNodeOrAnySubNodesHasError = ((node.flags & 65536 /* ThisNodeHasError */) !== 0) ||\n                ts.forEachChild(node, containsParseError);\n            // If so, mark ourselves accordingly.\n            if (thisNodeOrAnySubNodesHasError) {\n                node.flags |= 262144 /* ThisNodeOrAnySubNodesHasError */;\n            }\n            // Also mark that we've propagated the child information to this node.  This way we can\n            // always consult the bit directly on this node without needing to check its children\n            // again.\n            node.flags |= 524288 /* HasAggregatedChildData */;\n        }\n    }\n    function getSourceFileOfNode(node) {\n        while (node && node.kind !== 297 /* SourceFile */) {\n            node = node.parent;\n        }\n        return node;\n    }\n    ts.getSourceFileOfNode = getSourceFileOfNode;\n    function isStatementWithLocals(node) {\n        switch (node.kind) {\n            case 230 /* Block */:\n            case 258 /* CaseBlock */:\n            case 237 /* ForStatement */:\n            case 238 /* ForInStatement */:\n            case 239 /* ForOfStatement */:\n                return true;\n        }\n        return false;\n    }\n    ts.isStatementWithLocals = isStatementWithLocals;\n    function getStartPositionOfLine(line, sourceFile) {\n        ts.Debug.assert(line >= 0);\n        return ts.getLineStarts(sourceFile)[line];\n    }\n    ts.getStartPositionOfLine = getStartPositionOfLine;\n    // This is a useful function for debugging purposes.\n    function nodePosToString(node) {\n        var file = getSourceFileOfNode(node);\n        var loc = ts.getLineAndCharacterOfPosition(file, node.pos);\n        return file.fileName + \"(\" + (loc.line + 1) + \",\" + (loc.character + 1) + \")\";\n    }\n    ts.nodePosToString = nodePosToString;\n    function getEndLinePosition(line, sourceFile) {\n        ts.Debug.assert(line >= 0);\n        var lineStarts = ts.getLineStarts(sourceFile);\n        var lineIndex = line;\n        var sourceText = sourceFile.text;\n        if (lineIndex + 1 === lineStarts.length) {\n            // last line - return EOF\n            return sourceText.length - 1;\n        }\n        else {\n            // current line start\n            var start = lineStarts[lineIndex];\n            // take the start position of the next line - 1 = it should be some line break\n            var pos = lineStarts[lineIndex + 1] - 1;\n            ts.Debug.assert(ts.isLineBreak(sourceText.charCodeAt(pos)));\n            // walk backwards skipping line breaks, stop the the beginning of current line.\n            // i.e:\n            // <some text>\n            // $ <- end of line for this position should match the start position\n            while (start <= pos && ts.isLineBreak(sourceText.charCodeAt(pos))) {\n                pos--;\n            }\n            return pos;\n        }\n    }\n    ts.getEndLinePosition = getEndLinePosition;\n    /**\n     * Returns a value indicating whether a name is unique globally or within the current file.\n     * Note: This does not consider whether a name appears as a free identifier or not, so at the expression `x.y` this includes both `x` and `y`.\n     */\n    function isFileLevelUniqueName(sourceFile, name, hasGlobalName) {\n        return !(hasGlobalName && hasGlobalName(name)) && !sourceFile.identifiers.has(name);\n    }\n    ts.isFileLevelUniqueName = isFileLevelUniqueName;\n    // Returns true if this node is missing from the actual source code. A 'missing' node is different\n    // from 'undefined/defined'. When a node is undefined (which can happen for optional nodes\n    // in the tree), it is definitely missing. However, a node may be defined, but still be\n    // missing.  This happens whenever the parser knows it needs to parse something, but can't\n    // get anything in the source code that it expects at that location. For example:\n    //\n    //          let a: ;\n    //\n    // Here, the Type in the Type-Annotation is not-optional (as there is a colon in the source\n    // code). So the parser will attempt to parse out a type, and will create an actual node.\n    // However, this node will be 'missing' in the sense that no actual source-code/tokens are\n    // contained within it.\n    function nodeIsMissing(node) {\n        if (node === undefined) {\n            return true;\n        }\n        return node.pos === node.end && node.pos >= 0 && node.kind !== 1 /* EndOfFileToken */;\n    }\n    ts.nodeIsMissing = nodeIsMissing;\n    function nodeIsPresent(node) {\n        return !nodeIsMissing(node);\n    }\n    ts.nodeIsPresent = nodeIsPresent;\n    function insertStatementsAfterPrologue(to, from, isPrologueDirective) {\n        if (from === undefined || from.length === 0)\n            return to;\n        var statementIndex = 0;\n        // skip all prologue directives to insert at the correct position\n        for (; statementIndex < to.length; ++statementIndex) {\n            if (!isPrologueDirective(to[statementIndex])) {\n                break;\n            }\n        }\n        to.splice.apply(to, __spreadArray([statementIndex, 0], from));\n        return to;\n    }\n    function insertStatementAfterPrologue(to, statement, isPrologueDirective) {\n        if (statement === undefined)\n            return to;\n        var statementIndex = 0;\n        // skip all prologue directives to insert at the correct position\n        for (; statementIndex < to.length; ++statementIndex) {\n            if (!isPrologueDirective(to[statementIndex])) {\n                break;\n            }\n        }\n        to.splice(statementIndex, 0, statement);\n        return to;\n    }\n    function isAnyPrologueDirective(node) {\n        return isPrologueDirective(node) || !!(getEmitFlags(node) & 1048576 /* CustomPrologue */);\n    }\n    /**\n     * Prepends statements to an array while taking care of prologue directives.\n     */\n    function insertStatementsAfterStandardPrologue(to, from) {\n        return insertStatementsAfterPrologue(to, from, isPrologueDirective);\n    }\n    ts.insertStatementsAfterStandardPrologue = insertStatementsAfterStandardPrologue;\n    function insertStatementsAfterCustomPrologue(to, from) {\n        return insertStatementsAfterPrologue(to, from, isAnyPrologueDirective);\n    }\n    ts.insertStatementsAfterCustomPrologue = insertStatementsAfterCustomPrologue;\n    /**\n     * Prepends statements to an array while taking care of prologue directives.\n     */\n    function insertStatementAfterStandardPrologue(to, statement) {\n        return insertStatementAfterPrologue(to, statement, isPrologueDirective);\n    }\n    ts.insertStatementAfterStandardPrologue = insertStatementAfterStandardPrologue;\n    function insertStatementAfterCustomPrologue(to, statement) {\n        return insertStatementAfterPrologue(to, statement, isAnyPrologueDirective);\n    }\n    ts.insertStatementAfterCustomPrologue = insertStatementAfterCustomPrologue;\n    /**\n     * Determine if the given comment is a triple-slash\n     *\n     * @return true if the comment is a triple-slash comment else false\n     */\n    function isRecognizedTripleSlashComment(text, commentPos, commentEnd) {\n        // Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text\n        // so that we don't end up computing comment string and doing match for all // comments\n        if (text.charCodeAt(commentPos + 1) === 47 /* slash */ &&\n            commentPos + 2 < commentEnd &&\n            text.charCodeAt(commentPos + 2) === 47 /* slash */) {\n            var textSubStr = text.substring(commentPos, commentEnd);\n            return textSubStr.match(ts.fullTripleSlashReferencePathRegEx) ||\n                textSubStr.match(ts.fullTripleSlashAMDReferencePathRegEx) ||\n                textSubStr.match(fullTripleSlashReferenceTypeReferenceDirectiveRegEx) ||\n                textSubStr.match(defaultLibReferenceRegEx) ?\n                true : false;\n        }\n        return false;\n    }\n    ts.isRecognizedTripleSlashComment = isRecognizedTripleSlashComment;\n    function isPinnedComment(text, start) {\n        return text.charCodeAt(start + 1) === 42 /* asterisk */ &&\n            text.charCodeAt(start + 2) === 33 /* exclamation */;\n    }\n    ts.isPinnedComment = isPinnedComment;\n    function createCommentDirectivesMap(sourceFile, commentDirectives) {\n        var directivesByLine = new ts.Map(commentDirectives.map(function (commentDirective) { return ([\n            \"\" + ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line,\n            commentDirective,\n        ]); }));\n        var usedLines = new ts.Map();\n        return { getUnusedExpectations: getUnusedExpectations, markUsed: markUsed };\n        function getUnusedExpectations() {\n            return ts.arrayFrom(directivesByLine.entries())\n                .filter(function (_a) {\n                var line = _a[0], directive = _a[1];\n                return directive.type === 0 /* ExpectError */ && !usedLines.get(line);\n            })\n                .map(function (_a) {\n                var _ = _a[0], directive = _a[1];\n                return directive;\n            });\n        }\n        function markUsed(line) {\n            if (!directivesByLine.has(\"\" + line)) {\n                return false;\n            }\n            usedLines.set(\"\" + line, true);\n            return true;\n        }\n    }\n    ts.createCommentDirectivesMap = createCommentDirectivesMap;\n    function getTokenPosOfNode(node, sourceFile, includeJsDoc) {\n        // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't*\n        // want to skip trivia because this will launch us forward to the next token.\n        if (nodeIsMissing(node)) {\n            return node.pos;\n        }\n        if (ts.isJSDocNode(node) || node.kind === 11 /* JsxText */) {\n            // JsxText cannot actually contain comments, even though the scanner will think it sees comments\n            return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos, /*stopAfterLineBreak*/ false, /*stopAtComments*/ true);\n        }\n        if (includeJsDoc && ts.hasJSDocNodes(node)) {\n            return getTokenPosOfNode(node.jsDoc[0], sourceFile);\n        }\n        // For a syntax list, it is possible that one of its children has JSDocComment nodes, while\n        // the syntax list itself considers them as normal trivia. Therefore if we simply skip\n        // trivia for the list, we may have skipped the JSDocComment as well. So we should process its\n        // first child to determine the actual position of its first token.\n        if (node.kind === 334 /* SyntaxList */ && node._children.length > 0) {\n            return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);\n        }\n        return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos);\n    }\n    ts.getTokenPosOfNode = getTokenPosOfNode;\n    function getNonDecoratorTokenPosOfNode(node, sourceFile) {\n        if (nodeIsMissing(node) || !node.decorators) {\n            return getTokenPosOfNode(node, sourceFile);\n        }\n        return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.decorators.end);\n    }\n    ts.getNonDecoratorTokenPosOfNode = getNonDecoratorTokenPosOfNode;\n    function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia) {\n        if (includeTrivia === void 0) { includeTrivia = false; }\n        return getTextOfNodeFromSourceText(sourceFile.text, node, includeTrivia);\n    }\n    ts.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile;\n    function isJSDocTypeExpressionOrChild(node) {\n        return !!ts.findAncestor(node, ts.isJSDocTypeExpression);\n    }\n    function isExportNamespaceAsDefaultDeclaration(node) {\n        return !!(ts.isExportDeclaration(node) && node.exportClause && ts.isNamespaceExport(node.exportClause) && node.exportClause.name.escapedText === \"default\");\n    }\n    ts.isExportNamespaceAsDefaultDeclaration = isExportNamespaceAsDefaultDeclaration;\n    function getTextOfNodeFromSourceText(sourceText, node, includeTrivia) {\n        if (includeTrivia === void 0) { includeTrivia = false; }\n        if (nodeIsMissing(node)) {\n            return \"\";\n        }\n        var text = sourceText.substring(includeTrivia ? node.pos : ts.skipTrivia(sourceText, node.pos), node.end);\n        if (isJSDocTypeExpressionOrChild(node)) {\n            // strip space + asterisk at line start\n            text = text.replace(/(^|\\r?\\n|\\r)\\s*\\*\\s*/g, \"$1\");\n        }\n        return text;\n    }\n    ts.getTextOfNodeFromSourceText = getTextOfNodeFromSourceText;\n    function getTextOfNode(node, includeTrivia) {\n        if (includeTrivia === void 0) { includeTrivia = false; }\n        return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node, includeTrivia);\n    }\n    ts.getTextOfNode = getTextOfNode;\n    function getPos(range) {\n        return range.pos;\n    }\n    /**\n     * Note: it is expected that the `nodeArray` and the `node` are within the same file.\n     * For example, searching for a `SourceFile` in a `SourceFile[]` wouldn't work.\n     */\n    function indexOfNode(nodeArray, node) {\n        return ts.binarySearch(nodeArray, node, getPos, ts.compareValues);\n    }\n    ts.indexOfNode = indexOfNode;\n    /**\n     * Gets flags that control emit behavior of a node.\n     */\n    function getEmitFlags(node) {\n        var emitNode = node.emitNode;\n        return emitNode && emitNode.flags || 0;\n    }\n    ts.getEmitFlags = getEmitFlags;\n    ;\n    function getScriptTargetFeatures() {\n        return {\n            es2015: {\n                Array: [\"find\", \"findIndex\", \"fill\", \"copyWithin\", \"entries\", \"keys\", \"values\"],\n                RegExp: [\"flags\", \"sticky\", \"unicode\"],\n                Reflect: [\"apply\", \"construct\", \"defineProperty\", \"deleteProperty\", \"get\", \" getOwnPropertyDescriptor\", \"getPrototypeOf\", \"has\", \"isExtensible\", \"ownKeys\", \"preventExtensions\", \"set\", \"setPrototypeOf\"],\n                ArrayConstructor: [\"from\", \"of\"],\n                ObjectConstructor: [\"assign\", \"getOwnPropertySymbols\", \"keys\", \"is\", \"setPrototypeOf\"],\n                NumberConstructor: [\"isFinite\", \"isInteger\", \"isNaN\", \"isSafeInteger\", \"parseFloat\", \"parseInt\"],\n                Math: [\"clz32\", \"imul\", \"sign\", \"log10\", \"log2\", \"log1p\", \"expm1\", \"cosh\", \"sinh\", \"tanh\", \"acosh\", \"asinh\", \"atanh\", \"hypot\", \"trunc\", \"fround\", \"cbrt\"],\n                Map: [\"entries\", \"keys\", \"values\"],\n                Set: [\"entries\", \"keys\", \"values\"],\n                Promise: ts.emptyArray,\n                PromiseConstructor: [\"all\", \"race\", \"reject\", \"resolve\"],\n                Symbol: [\"for\", \"keyFor\"],\n                WeakMap: [\"entries\", \"keys\", \"values\"],\n                WeakSet: [\"entries\", \"keys\", \"values\"],\n                Iterator: ts.emptyArray,\n                AsyncIterator: ts.emptyArray,\n                String: [\"codePointAt\", \"includes\", \"endsWith\", \"normalize\", \"repeat\", \"startsWith\", \"anchor\", \"big\", \"blink\", \"bold\", \"fixed\", \"fontcolor\", \"fontsize\", \"italics\", \"link\", \"small\", \"strike\", \"sub\", \"sup\"],\n                StringConstructor: [\"fromCodePoint\", \"raw\"]\n            },\n            es2016: {\n                Array: [\"includes\"]\n            },\n            es2017: {\n                Atomics: ts.emptyArray,\n                SharedArrayBuffer: ts.emptyArray,\n                String: [\"padStart\", \"padEnd\"],\n                ObjectConstructor: [\"values\", \"entries\", \"getOwnPropertyDescriptors\"],\n                DateTimeFormat: [\"formatToParts\"]\n            },\n            es2018: {\n                Promise: [\"finally\"],\n                RegExpMatchArray: [\"groups\"],\n                RegExpExecArray: [\"groups\"],\n                RegExp: [\"dotAll\"],\n                Intl: [\"PluralRules\"],\n                AsyncIterable: ts.emptyArray,\n                AsyncIterableIterator: ts.emptyArray,\n                AsyncGenerator: ts.emptyArray,\n                AsyncGeneratorFunction: ts.emptyArray,\n            },\n            es2019: {\n                Array: [\"flat\", \"flatMap\"],\n                ObjectConstructor: [\"fromEntries\"],\n                String: [\"trimStart\", \"trimEnd\", \"trimLeft\", \"trimRight\"],\n                Symbol: [\"description\"]\n            },\n            es2020: {\n                BigInt: ts.emptyArray,\n                BigInt64Array: ts.emptyArray,\n                BigUint64Array: ts.emptyArray,\n                PromiseConstructor: [\"allSettled\"],\n                SymbolConstructor: [\"matchAll\"],\n                String: [\"matchAll\"],\n                DataView: [\"setBigInt64\", \"setBigUint64\", \"getBigInt64\", \"getBigUint64\"],\n                RelativeTimeFormat: [\"format\", \"formatToParts\", \"resolvedOptions\"]\n            },\n            esnext: {\n                PromiseConstructor: [\"any\"],\n                String: [\"replaceAll\"],\n                NumberFormat: [\"formatToParts\"]\n            }\n        };\n    }\n    ts.getScriptTargetFeatures = getScriptTargetFeatures;\n    var GetLiteralTextFlags;\n    (function (GetLiteralTextFlags) {\n        GetLiteralTextFlags[GetLiteralTextFlags[\"None\"] = 0] = \"None\";\n        GetLiteralTextFlags[GetLiteralTextFlags[\"NeverAsciiEscape\"] = 1] = \"NeverAsciiEscape\";\n        GetLiteralTextFlags[GetLiteralTextFlags[\"JsxAttributeEscape\"] = 2] = \"JsxAttributeEscape\";\n        GetLiteralTextFlags[GetLiteralTextFlags[\"TerminateUnterminatedLiterals\"] = 4] = \"TerminateUnterminatedLiterals\";\n        GetLiteralTextFlags[GetLiteralTextFlags[\"AllowNumericSeparator\"] = 8] = \"AllowNumericSeparator\";\n    })(GetLiteralTextFlags = ts.GetLiteralTextFlags || (ts.GetLiteralTextFlags = {}));\n    function getLiteralText(node, sourceFile, flags) {\n        // If we don't need to downlevel and we can reach the original source text using\n        // the node's parent reference, then simply get the text as it was originally written.\n        if (canUseOriginalText(node, flags)) {\n            return getSourceTextOfNodeFromSourceFile(sourceFile, node);\n        }\n        // If we can't reach the original source text, use the canonical form if it's a number,\n        // or a (possibly escaped) quoted form of the original text if it's string-like.\n        switch (node.kind) {\n            case 10 /* StringLiteral */: {\n                var escapeText = flags & 2 /* JsxAttributeEscape */ ? escapeJsxAttributeString :\n                    flags & 1 /* NeverAsciiEscape */ || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString :\n                        escapeNonAsciiString;\n                if (node.singleQuote) {\n                    return \"'\" + escapeText(node.text, 39 /* singleQuote */) + \"'\";\n                }\n                else {\n                    return '\"' + escapeText(node.text, 34 /* doubleQuote */) + '\"';\n                }\n            }\n            case 14 /* NoSubstitutionTemplateLiteral */:\n            case 15 /* TemplateHead */:\n            case 16 /* TemplateMiddle */:\n            case 17 /* TemplateTail */: {\n                // If a NoSubstitutionTemplateLiteral appears to have a substitution in it, the original text\n                // had to include a backslash: `not \\${a} substitution`.\n                var escapeText = flags & 1 /* NeverAsciiEscape */ || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString :\n                    escapeNonAsciiString;\n                var rawText = node.rawText || escapeTemplateSubstitution(escapeText(node.text, 96 /* backtick */));\n                switch (node.kind) {\n                    case 14 /* NoSubstitutionTemplateLiteral */:\n                        return \"`\" + rawText + \"`\";\n                    case 15 /* TemplateHead */:\n                        return \"`\" + rawText + \"${\";\n                    case 16 /* TemplateMiddle */:\n                        return \"}\" + rawText + \"${\";\n                    case 17 /* TemplateTail */:\n                        return \"}\" + rawText + \"`\";\n                }\n                break;\n            }\n            case 8 /* NumericLiteral */:\n            case 9 /* BigIntLiteral */:\n                return node.text;\n            case 13 /* RegularExpressionLiteral */:\n                if (flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) {\n                    return node.text + (node.text.charCodeAt(node.text.length - 1) === 92 /* backslash */ ? \" /\" : \"/\");\n                }\n                return node.text;\n        }\n        return ts.Debug.fail(\"Literal kind '\" + node.kind + \"' not accounted for.\");\n    }\n    ts.getLiteralText = getLiteralText;\n    function canUseOriginalText(node, flags) {\n        if (nodeIsSynthesized(node) || !node.parent || (flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated)) {\n            return false;\n        }\n        if (ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */) {\n            return !!(flags & 8 /* AllowNumericSeparator */);\n        }\n        return !ts.isBigIntLiteral(node);\n    }\n    function getTextOfConstantValue(value) {\n        return ts.isString(value) ? '\"' + escapeNonAsciiString(value) + '\"' : \"\" + value;\n    }\n    ts.getTextOfConstantValue = getTextOfConstantValue;\n    // Make an identifier from an external module name by extracting the string after the last \"/\" and replacing\n    // all non-alphanumeric characters with underscores\n    function makeIdentifierFromModuleName(moduleName) {\n        return ts.getBaseFileName(moduleName).replace(/^(\\d)/, \"_$1\").replace(/\\W/g, \"_\");\n    }\n    ts.makeIdentifierFromModuleName = makeIdentifierFromModuleName;\n    function isBlockOrCatchScoped(declaration) {\n        return (ts.getCombinedNodeFlags(declaration) & 3 /* BlockScoped */) !== 0 ||\n            isCatchClauseVariableDeclarationOrBindingElement(declaration);\n    }\n    ts.isBlockOrCatchScoped = isBlockOrCatchScoped;\n    function isCatchClauseVariableDeclarationOrBindingElement(declaration) {\n        var node = getRootDeclaration(declaration);\n        return node.kind === 249 /* VariableDeclaration */ && node.parent.kind === 287 /* CatchClause */;\n    }\n    ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement;\n    function isAmbientModule(node) {\n        return ts.isModuleDeclaration(node) && (node.name.kind === 10 /* StringLiteral */ || isGlobalScopeAugmentation(node));\n    }\n    ts.isAmbientModule = isAmbientModule;\n    function isModuleWithStringLiteralName(node) {\n        return ts.isModuleDeclaration(node) && node.name.kind === 10 /* StringLiteral */;\n    }\n    ts.isModuleWithStringLiteralName = isModuleWithStringLiteralName;\n    function isNonGlobalAmbientModule(node) {\n        return ts.isModuleDeclaration(node) && ts.isStringLiteral(node.name);\n    }\n    ts.isNonGlobalAmbientModule = isNonGlobalAmbientModule;\n    /**\n     * An effective module (namespace) declaration is either\n     * 1. An actual declaration: namespace X { ... }\n     * 2. A Javascript declaration, which is:\n     *    An identifier in a nested property access expression: Y in `X.Y.Z = { ... }`\n     */\n    function isEffectiveModuleDeclaration(node) {\n        return ts.isModuleDeclaration(node) || ts.isIdentifier(node);\n    }\n    ts.isEffectiveModuleDeclaration = isEffectiveModuleDeclaration;\n    /** Given a symbol for a module, checks that it is a shorthand ambient module. */\n    function isShorthandAmbientModuleSymbol(moduleSymbol) {\n        return isShorthandAmbientModule(moduleSymbol.valueDeclaration);\n    }\n    ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol;\n    function isShorthandAmbientModule(node) {\n        // The only kind of module that can be missing a body is a shorthand ambient module.\n        return node && node.kind === 256 /* ModuleDeclaration */ && (!node.body);\n    }\n    function isBlockScopedContainerTopLevel(node) {\n        return node.kind === 297 /* SourceFile */ ||\n            node.kind === 256 /* ModuleDeclaration */ ||\n            ts.isFunctionLike(node);\n    }\n    ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel;\n    function isGlobalScopeAugmentation(module) {\n        return !!(module.flags & 1024 /* GlobalAugmentation */);\n    }\n    ts.isGlobalScopeAugmentation = isGlobalScopeAugmentation;\n    function isExternalModuleAugmentation(node) {\n        return isAmbientModule(node) && isModuleAugmentationExternal(node);\n    }\n    ts.isExternalModuleAugmentation = isExternalModuleAugmentation;\n    function isModuleAugmentationExternal(node) {\n        // external module augmentation is a ambient module declaration that is either:\n        // - defined in the top level scope and source file is an external module\n        // - defined inside ambient module declaration located in the top level scope and source file not an external module\n        switch (node.parent.kind) {\n            case 297 /* SourceFile */:\n                return ts.isExternalModule(node.parent);\n            case 257 /* ModuleBlock */:\n                return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent);\n        }\n        return false;\n    }\n    ts.isModuleAugmentationExternal = isModuleAugmentationExternal;\n    function getNonAugmentationDeclaration(symbol) {\n        return ts.find(symbol.declarations, function (d) { return !isExternalModuleAugmentation(d) && !(ts.isModuleDeclaration(d) && isGlobalScopeAugmentation(d)); });\n    }\n    ts.getNonAugmentationDeclaration = getNonAugmentationDeclaration;\n    function isEffectiveExternalModule(node, compilerOptions) {\n        return ts.isExternalModule(node) || compilerOptions.isolatedModules || ((getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS) && !!node.commonJsModuleIndicator);\n    }\n    ts.isEffectiveExternalModule = isEffectiveExternalModule;\n    /**\n     * Returns whether the source file will be treated as if it were in strict mode at runtime.\n     */\n    function isEffectiveStrictModeSourceFile(node, compilerOptions) {\n        // We can only verify strict mode for JS/TS files\n        switch (node.scriptKind) {\n            case 1 /* JS */:\n            case 3 /* TS */:\n            case 2 /* JSX */:\n            case 4 /* TSX */:\n                break;\n            default:\n                return false;\n        }\n        // Strict mode does not matter for declaration files.\n        if (node.isDeclarationFile) {\n            return false;\n        }\n        // If `alwaysStrict` is set, then treat the file as strict.\n        if (getStrictOptionValue(compilerOptions, \"alwaysStrict\")) {\n            return true;\n        }\n        // Starting with a \"use strict\" directive indicates the file is strict.\n        if (ts.startsWithUseStrict(node.statements)) {\n            return true;\n        }\n        if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {\n            // ECMAScript Modules are always strict.\n            if (getEmitModuleKind(compilerOptions) >= ts.ModuleKind.ES2015) {\n                return true;\n            }\n            // Other modules are strict unless otherwise specified.\n            return !compilerOptions.noImplicitUseStrict;\n        }\n        return false;\n    }\n    ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile;\n    function isBlockScope(node, parentNode) {\n        switch (node.kind) {\n            case 297 /* SourceFile */:\n            case 258 /* CaseBlock */:\n            case 287 /* CatchClause */:\n            case 256 /* ModuleDeclaration */:\n            case 237 /* ForStatement */:\n            case 238 /* ForInStatement */:\n            case 239 /* ForOfStatement */:\n            case 166 /* Constructor */:\n            case 165 /* MethodDeclaration */:\n            case 167 /* GetAccessor */:\n            case 168 /* SetAccessor */:\n            case 251 /* FunctionDeclaration */:\n            case 208 /* FunctionExpression */:\n            case 209 /* ArrowFunction */:\n                return true;\n            case 230 /* Block */:\n                // function block is not considered block-scope container\n                // see comment in binder.ts: bind(...), case for SyntaxKind.Block\n                return !ts.isFunctionLike(parentNode);\n        }\n        return false;\n    }\n    ts.isBlockScope = isBlockScope;\n    function isDeclarationWithTypeParameters(node) {\n        switch (node.kind) {\n            case 324 /* JSDocCallbackTag */:\n            case 331 /* JSDocTypedefTag */:\n            case 313 /* JSDocSignature */:\n                return true;\n            default:\n                ts.assertType(node);\n                return isDeclarationWithTypeParameterChildren(node);\n        }\n    }\n    ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters;\n    function isDeclarationWithTypeParameterChildren(node) {\n        switch (node.kind) {\n            case 169 /* CallSignature */:\n            case 170 /* ConstructSignature */:\n            case 164 /* MethodSignature */:\n            case 171 /* IndexSignature */:\n            case 174 /* FunctionType */:\n            case 175 /* ConstructorType */:\n            case 308 /* JSDocFunctionType */:\n            case 252 /* ClassDeclaration */:\n            case 221 /* ClassExpression */:\n            case 253 /* InterfaceDeclaration */:\n            case 254 /* TypeAliasDeclaration */:\n            case 330 /* JSDocTemplateTag */:\n            case 251 /* FunctionDeclaration */:\n            case 165 /* MethodDeclaration */:\n            case 166 /* Constructor */:\n            case 167 /* GetAccessor */:\n            case 168 /* SetAccessor */:\n            case 208 /* FunctionExpression */:\n            case 209 /* ArrowFunction */:\n                return true;\n            default:\n                ts.assertType(node);\n                return false;\n        }\n    }\n    ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren;\n    function isAnyImportSyntax(node) {\n        switch (node.kind) {\n            case 261 /* ImportDeclaration */:\n            case 260 /* ImportEqualsDeclaration */:\n                return true;\n            default:\n                return false;\n        }\n    }\n    ts.isAnyImportSyntax = isAnyImportSyntax;\n    function isLateVisibilityPaintedStatement(node) {\n        switch (node.kind) {\n            case 261 /* ImportDeclaration */:\n            case 260 /* ImportEqualsDeclaration */:\n            case 232 /* VariableStatement */:\n            case 252 /* ClassDeclaration */:\n            case 251 /* FunctionDeclaration */:\n            case 256 /* ModuleDeclaration */:\n            case 254 /* TypeAliasDeclaration */:\n            case 253 /* InterfaceDeclaration */:\n            case 255 /* EnumDeclaration */:\n                return true;\n            default:\n                return false;\n        }\n    }\n    ts.isLateVisibilityPaintedStatement = isLateVisibilityPaintedStatement;\n    function hasPossibleExternalModuleReference(node) {\n        return isAnyImportOrReExport(node) || ts.isModuleDeclaration(node) || ts.isImportTypeNode(node) || isImportCall(node);\n    }\n    ts.hasPossibleExternalModuleReference = hasPossibleExternalModuleReference;\n    function isAnyImportOrReExport(node) {\n        return isAnyImportSyntax(node) || ts.isExportDeclaration(node);\n    }\n    ts.isAnyImportOrReExport = isAnyImportOrReExport;\n    // Gets the nearest enclosing block scope container that has the provided node\n    // as a descendant, that is not the provided node.\n    function getEnclosingBlockScopeContainer(node) {\n        return ts.findAncestor(node.parent, function (current) { return isBlockScope(current, current.parent); });\n    }\n    ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer;\n    // Return display name of an identifier\n    // Computed property names will just be emitted as \"[<expr>]\", where <expr> is the source\n    // text of the expression in the computed property.\n    function declarationNameToString(name) {\n        return !name || getFullWidth(name) === 0 ? \"(Missing)\" : getTextOfNode(name);\n    }\n    ts.declarationNameToString = declarationNameToString;\n    function getNameFromIndexInfo(info) {\n        return info.declaration ? declarationNameToString(info.declaration.parameters[0].name) : undefined;\n    }\n    ts.getNameFromIndexInfo = getNameFromIndexInfo;\n    function isComputedNonLiteralName(name) {\n        return name.kind === 158 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);\n    }\n    ts.isComputedNonLiteralName = isComputedNonLiteralName;\n    function getTextOfPropertyName(name) {\n        switch (name.kind) {\n            case 78 /* Identifier */:\n            case 79 /* PrivateIdentifier */:\n                return name.escapedText;\n            case 10 /* StringLiteral */:\n            case 8 /* NumericLiteral */:\n            case 14 /* NoSubstitutionTemplateLiteral */:\n                return ts.escapeLeadingUnderscores(name.text);\n            case 158 /* ComputedPropertyName */:\n                if (isStringOrNumericLiteralLike(name.expression))\n                    return ts.escapeLeadingUnderscores(name.expression.text);\n                return ts.Debug.fail(\"Text of property name cannot be read from non-literal-valued ComputedPropertyNames\");\n            default:\n                return ts.Debug.assertNever(name);\n        }\n    }\n    ts.getTextOfPropertyName = getTextOfPropertyName;\n    function entityNameToString(name) {\n        switch (name.kind) {\n            case 107 /* ThisKeyword */:\n                return \"this\";\n            case 79 /* PrivateIdentifier */:\n            case 78 /* Identifier */:\n                return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name);\n            case 157 /* QualifiedName */:\n                return entityNameToString(name.left) + \".\" + entityNameToString(name.right);\n            case 201 /* PropertyAccessExpression */:\n                if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) {\n                    return entityNameToString(name.expression) + \".\" + entityNameToString(name.name);\n                }\n                else {\n                    return ts.Debug.assertNever(name.name);\n                }\n            default:\n                return ts.Debug.assertNever(name);\n        }\n    }\n    ts.entityNameToString = entityNameToString;\n    function createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3) {\n        var sourceFile = getSourceFileOfNode(node);\n        return createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3);\n    }\n    ts.createDiagnosticForNode = createDiagnosticForNode;\n    function createDiagnosticForNodeArray(sourceFile, nodes, message, arg0, arg1, arg2, arg3) {\n        var start = ts.skipTrivia(sourceFile.text, nodes.pos);\n        return createFileDiagnostic(sourceFile, start, nodes.end - start, message, arg0, arg1, arg2, arg3);\n    }\n    ts.createDiagnosticForNodeArray = createDiagnosticForNodeArray;\n    function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3) {\n        var span = getErrorSpanForNode(sourceFile, node);\n        return createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3);\n    }\n    ts.createDiagnosticForNodeInSourceFile = createDiagnosticForNodeInSourceFile;\n    function createDiagnosticForNodeFromMessageChain(node, messageChain, relatedInformation) {\n        var sourceFile = getSourceFileOfNode(node);\n        var span = getErrorSpanForNode(sourceFile, node);\n        return createFileDiagnosticFromMessageChain(sourceFile, span.start, span.length, messageChain, relatedInformation);\n    }\n    ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain;\n    function assertDiagnosticLocation(file, start, length) {\n        ts.Debug.assertGreaterThanOrEqual(start, 0);\n        ts.Debug.assertGreaterThanOrEqual(length, 0);\n        if (file) {\n            ts.Debug.assertLessThanOrEqual(start, file.text.length);\n            ts.Debug.assertLessThanOrEqual(start + length, file.text.length);\n        }\n    }\n    function createFileDiagnosticFromMessageChain(file, start, length, messageChain, relatedInformation) {\n        assertDiagnosticLocation(file, start, length);\n        return {\n            file: file,\n            start: start,\n            length: length,\n            code: messageChain.code,\n            category: messageChain.category,\n            messageText: messageChain.next ? messageChain : messageChain.messageText,\n            relatedInformation: relatedInformation\n        };\n    }\n    ts.createFileDiagnosticFromMessageChain = createFileDiagnosticFromMessageChain;\n    function createDiagnosticForFileFromMessageChain(sourceFile, messageChain, relatedInformation) {\n        return {\n            file: sourceFile,\n            start: 0,\n            length: 0,\n            code: messageChain.code,\n            category: messageChain.category,\n            messageText: messageChain.next ? messageChain : messageChain.messageText,\n            relatedInformation: relatedInformation\n        };\n    }\n    ts.createDiagnosticForFileFromMessageChain = createDiagnosticForFileFromMessageChain;\n    function createDiagnosticForRange(sourceFile, range, message) {\n        return {\n            file: sourceFile,\n            start: range.pos,\n            length: range.end - range.pos,\n            code: message.code,\n            category: message.category,\n            messageText: message.message,\n        };\n    }\n    ts.createDiagnosticForRange = createDiagnosticForRange;\n    function getSpanOfTokenAtPosition(sourceFile, pos) {\n        var scanner = ts.createScanner(sourceFile.languageVersion, /*skipTrivia*/ true, sourceFile.languageVariant, sourceFile.text, /*onError:*/ undefined, pos);\n        scanner.scan();\n        var start = scanner.getTokenPos();\n        return ts.createTextSpanFromBounds(start, scanner.getTextPos());\n    }\n    ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition;\n    function getErrorSpanForArrowFunction(sourceFile, node) {\n        var pos = ts.skipTrivia(sourceFile.text, node.pos);\n        if (node.body && node.body.kind === 230 /* Block */) {\n            var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line;\n            var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line;\n            if (startLine < endLine) {\n                // The arrow function spans multiple lines,\n                // make the error span be the first line, inclusive.\n                return ts.createTextSpan(pos, getEndLinePosition(startLine, sourceFile) - pos + 1);\n            }\n        }\n        return ts.createTextSpanFromBounds(pos, node.end);\n    }\n    function getErrorSpanForNode(sourceFile, node) {\n        var errorNode = node;\n        switch (node.kind) {\n            case 297 /* SourceFile */:\n                var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false);\n                if (pos_1 === sourceFile.text.length) {\n                    // file is empty - return span for the beginning of the file\n                    return ts.createTextSpan(0, 0);\n                }\n                return getSpanOfTokenAtPosition(sourceFile, pos_1);\n            // This list is a work in progress. Add missing node kinds to improve their error\n            // spans.\n            case 249 /* VariableDeclaration */:\n            case 198 /* BindingElement */:\n            case 252 /* ClassDeclaration */:\n            case 221 /* ClassExpression */:\n            case 253 /* InterfaceDeclaration */:\n            case 256 /* ModuleDeclaration */:\n            case 255 /* EnumDeclaration */:\n            case 291 /* EnumMember */:\n            case 251 /* FunctionDeclaration */:\n            case 208 /* FunctionExpression */:\n            case 165 /* MethodDeclaration */:\n            case 167 /* GetAccessor */:\n            case 168 /* SetAccessor */:\n            case 254 /* TypeAliasDeclaration */:\n            case 163 /* PropertyDeclaration */:\n            case 162 /* PropertySignature */:\n                errorNode = node.name;\n                break;\n            case 209 /* ArrowFunction */:\n                return getErrorSpanForArrowFunction(sourceFile, node);\n            case 284 /* CaseClause */:\n            case 285 /* DefaultClause */:\n                var start = ts.skipTrivia(sourceFile.text, node.pos);\n                var end = node.statements.length > 0 ? node.statements[0].pos : node.end;\n                return ts.createTextSpanFromBounds(start, end);\n        }\n        if (errorNode === undefined) {\n            // If we don't have a better node, then just set the error on the first token of\n            // construct.\n            return getSpanOfTokenAtPosition(sourceFile, node.pos);\n        }\n        ts.Debug.assert(!ts.isJSDoc(errorNode));\n        var isMissing = nodeIsMissing(errorNode);\n        var pos = isMissing || ts.isJsxText(node)\n            ? errorNode.pos\n            : ts.skipTrivia(sourceFile.text, errorNode.pos);\n        // These asserts should all be satisfied for a properly constructed `errorNode`.\n        if (isMissing) {\n            ts.Debug.assert(pos === errorNode.pos, \"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809\");\n            ts.Debug.assert(pos === errorNode.end, \"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809\");\n        }\n        else {\n            ts.Debug.assert(pos >= errorNode.pos, \"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809\");\n            ts.Debug.assert(pos <= errorNode.end, \"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809\");\n        }\n        return ts.createTextSpanFromBounds(pos, errorNode.end);\n    }\n    ts.getErrorSpanForNode = getErrorSpanForNode;\n    function isExternalOrCommonJsModule(file) {\n        return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== undefined;\n    }\n    ts.isExternalOrCommonJsModule = isExternalOrCommonJsModule;\n    function isJsonSourceFile(file) {\n        return file.scriptKind === 6 /* JSON */;\n    }\n    ts.isJsonSourceFile = isJsonSourceFile;\n    function isEnumConst(node) {\n        return !!(ts.getCombinedModifierFlags(node) & 2048 /* Const */);\n    }\n    ts.isEnumConst = isEnumConst;\n    function isDeclarationReadonly(declaration) {\n        return !!(ts.getCombinedModifierFlags(declaration) & 64 /* Readonly */ && !ts.isParameterPropertyDeclaration(declaration, declaration.parent));\n    }\n    ts.isDeclarationReadonly = isDeclarationReadonly;\n    function isVarConst(node) {\n        return !!(ts.getCombinedNodeFlags(node) & 2 /* Const */);\n    }\n    ts.isVarConst = isVarConst;\n    function isLet(node) {\n        return !!(ts.getCombinedNodeFlags(node) & 1 /* Let */);\n    }\n    ts.isLet = isLet;\n    function isSuperCall(n) {\n        return n.kind === 203 /* CallExpression */ && n.expression.kind === 105 /* SuperKeyword */;\n    }\n    ts.isSuperCall = isSuperCall;\n    function isImportCall(n) {\n        return n.kind === 203 /* CallExpression */ && n.expression.kind === 99 /* ImportKeyword */;\n    }\n    ts.isImportCall = isImportCall;\n    function isImportMeta(n) {\n        return ts.isMetaProperty(n)\n            && n.keywordToken === 99 /* ImportKeyword */\n            && n.name.escapedText === \"meta\";\n    }\n    ts.isImportMeta = isImportMeta;\n    function isLiteralImportTypeNode(n) {\n        return ts.isImportTypeNode(n) && ts.isLiteralTypeNode(n.argument) && ts.isStringLiteral(n.argument.literal);\n    }\n    ts.isLiteralImportTypeNode = isLiteralImportTypeNode;\n    function isPrologueDirective(node) {\n        return node.kind === 233 /* ExpressionStatement */\n            && node.expression.kind === 10 /* StringLiteral */;\n    }\n    ts.isPrologueDirective = isPrologueDirective;\n    function isCustomPrologue(node) {\n        return !!(getEmitFlags(node) & 1048576 /* CustomPrologue */);\n    }\n    ts.isCustomPrologue = isCustomPrologue;\n    function isHoistedFunction(node) {\n        return isCustomPrologue(node)\n            && ts.isFunctionDeclaration(node);\n    }\n    ts.isHoistedFunction = isHoistedFunction;\n    function isHoistedVariable(node) {\n        return ts.isIdentifier(node.name)\n            && !node.initializer;\n    }\n    function isHoistedVariableStatement(node) {\n        return isCustomPrologue(node)\n            && ts.isVariableStatement(node)\n            && ts.every(node.declarationList.declarations, isHoistedVariable);\n    }\n    ts.isHoistedVariableStatement = isHoistedVariableStatement;\n    function getLeadingCommentRangesOfNode(node, sourceFileOfNode) {\n        return node.kind !== 11 /* JsxText */ ? ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : undefined;\n    }\n    ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode;\n    function getJSDocCommentRanges(node, text) {\n        var commentRanges = (node.kind === 160 /* Parameter */ ||\n            node.kind === 159 /* TypeParameter */ ||\n            node.kind === 208 /* FunctionExpression */ ||\n            node.kind === 209 /* ArrowFunction */ ||\n            node.kind === 207 /* ParenthesizedExpression */) ?\n            ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :\n            ts.getLeadingCommentRanges(text, node.pos);\n        // True if the comment starts with '/**' but not if it is '/**/'\n        return ts.filter(commentRanges, function (comment) {\n            return text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ &&\n                text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ &&\n                text.charCodeAt(comment.pos + 3) !== 47 /* slash */;\n        });\n    }\n    ts.getJSDocCommentRanges = getJSDocCommentRanges;\n    ts.fullTripleSlashReferencePathRegEx = /^(\\/\\/\\/\\s*<reference\\s+path\\s*=\\s*)('|\")(.+?)\\2.*?\\/>/;\n    var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\\/\\/\\/\\s*<reference\\s+types\\s*=\\s*)('|\")(.+?)\\2.*?\\/>/;\n    ts.fullTripleSlashAMDReferencePathRegEx = /^(\\/\\/\\/\\s*<amd-dependency\\s+path\\s*=\\s*)('|\")(.+?)\\2.*?\\/>/;\n    var defaultLibReferenceRegEx = /^(\\/\\/\\/\\s*<reference\\s+no-default-lib\\s*=\\s*)('|\")(.+?)\\2\\s*\\/>/;\n    function isPartOfTypeNode(node) {\n        if (172 /* FirstTypeNode */ <= node.kind && node.kind <= 195 /* LastTypeNode */) {\n            return true;\n        }\n        switch (node.kind) {\n            case 128 /* AnyKeyword */:\n            case 152 /* UnknownKeyword */:\n            case 144 /* NumberKeyword */:\n            case 155 /* BigIntKeyword */:\n            case 147 /* StringKeyword */:\n            case 131 /* BooleanKeyword */:\n            case 148 /* SymbolKeyword */:\n            case 145 /* ObjectKeyword */:\n            case 150 /* UndefinedKeyword */:\n            case 141 /* NeverKeyword */:\n                return true;\n            case 113 /* VoidKeyword */:\n                return node.parent.kind !== 212 /* VoidExpression */;\n            case 223 /* ExpressionWithTypeArguments */:\n                return !isExpressionWithTypeArgumentsInClassExtendsClause(node);\n            case 159 /* TypeParameter */:\n                return node.parent.kind === 190 /* MappedType */ || node.parent.kind === 185 /* InferType */;\n            // Identifiers and qualified names may be type nodes, depending on their context. Climb\n            // above them to find the lowest container\n            case 78 /* Identifier */:\n                // If the identifier is the RHS of a qualified name, then it's a type iff its parent is.\n                if (node.parent.kind === 157 /* QualifiedName */ && node.parent.right === node) {\n                    node = node.parent;\n                }\n                else if (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.name === node) {\n                    node = node.parent;\n                }\n                // At this point, node is either a qualified name or an identifier\n                ts.Debug.assert(node.kind === 78 /* Identifier */ || node.kind === 157 /* QualifiedName */ || node.kind === 201 /* PropertyAccessExpression */, \"'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.\");\n            // falls through\n            case 157 /* QualifiedName */:\n            case 201 /* PropertyAccessExpression */:\n            case 107 /* ThisKeyword */: {\n                var parent = node.parent;\n                if (parent.kind === 176 /* TypeQuery */) {\n                    return false;\n                }\n                if (parent.kind === 195 /* ImportType */) {\n                    return !parent.isTypeOf;\n                }\n                // Do not recursively call isPartOfTypeNode on the parent. In the example:\n                //\n                //     let a: A.B.C;\n                //\n                // Calling isPartOfTypeNode would consider the qualified name A.B a type node.\n                // Only C and A.B.C are type nodes.\n                if (172 /* FirstTypeNode */ <= parent.kind && parent.kind <= 195 /* LastTypeNode */) {\n                    return true;\n                }\n                switch (parent.kind) {\n                    case 223 /* ExpressionWithTypeArguments */:\n                        return !isExpressionWithTypeArgumentsInClassExtendsClause(parent);\n                    case 159 /* TypeParameter */:\n                        return node === parent.constraint;\n                    case 330 /* JSDocTemplateTag */:\n                        return node === parent.constraint;\n                    case 163 /* PropertyDeclaration */:\n                    case 162 /* PropertySignature */:\n                    case 160 /* Parameter */:\n                    case 249 /* VariableDeclaration */:\n                        return node === parent.type;\n                    case 251 /* FunctionDeclaration */:\n                    case 208 /* FunctionExpression */:\n                    case 209 /* ArrowFunction */:\n                    case 166 /* Constructor */:\n                    case 165 /* MethodDeclaration */:\n                    case 164 /* MethodSignature */:\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                        return node === parent.type;\n                    case 169 /* CallSignature */:\n                    case 170 /* ConstructSignature */:\n                    case 171 /* IndexSignature */:\n                        return node === parent.type;\n                    case 206 /* TypeAssertionExpression */:\n                        return node === parent.type;\n                    case 203 /* CallExpression */:\n                    case 204 /* NewExpression */:\n                        return ts.contains(parent.typeArguments, node);\n                    case 205 /* TaggedTemplateExpression */:\n                        // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments.\n                        return false;\n                }\n            }\n        }\n        return false;\n    }\n    ts.isPartOfTypeNode = isPartOfTypeNode;\n    function isChildOfNodeWithKind(node, kind) {\n        while (node) {\n            if (node.kind === kind) {\n                return true;\n            }\n            node = node.parent;\n        }\n        return false;\n    }\n    ts.isChildOfNodeWithKind = isChildOfNodeWithKind;\n    // Warning: This has the same semantics as the forEach family of functions,\n    //          in that traversal terminates in the event that 'visitor' supplies a truthy value.\n    function forEachReturnStatement(body, visitor) {\n        return traverse(body);\n        function traverse(node) {\n            switch (node.kind) {\n                case 242 /* ReturnStatement */:\n                    return visitor(node);\n                case 258 /* CaseBlock */:\n                case 230 /* Block */:\n                case 234 /* IfStatement */:\n                case 235 /* DoStatement */:\n                case 236 /* WhileStatement */:\n                case 237 /* ForStatement */:\n                case 238 /* ForInStatement */:\n                case 239 /* ForOfStatement */:\n                case 243 /* WithStatement */:\n                case 244 /* SwitchStatement */:\n                case 284 /* CaseClause */:\n                case 285 /* DefaultClause */:\n                case 245 /* LabeledStatement */:\n                case 247 /* TryStatement */:\n                case 287 /* CatchClause */:\n                    return ts.forEachChild(node, traverse);\n            }\n        }\n    }\n    ts.forEachReturnStatement = forEachReturnStatement;\n    function forEachYieldExpression(body, visitor) {\n        return traverse(body);\n        function traverse(node) {\n            switch (node.kind) {\n                case 219 /* YieldExpression */:\n                    visitor(node);\n                    var operand = node.expression;\n                    if (operand) {\n                        traverse(operand);\n                    }\n                    return;\n                case 255 /* EnumDeclaration */:\n                case 253 /* InterfaceDeclaration */:\n                case 256 /* ModuleDeclaration */:\n                case 254 /* TypeAliasDeclaration */:\n                    // These are not allowed inside a generator now, but eventually they may be allowed\n                    // as local types. Regardless, skip them to avoid the work.\n                    return;\n                default:\n                    if (ts.isFunctionLike(node)) {\n                        if (node.name && node.name.kind === 158 /* ComputedPropertyName */) {\n                            // Note that we will not include methods/accessors of a class because they would require\n                            // first descending into the class. This is by design.\n                            traverse(node.name.expression);\n                            return;\n                        }\n                    }\n                    else if (!isPartOfTypeNode(node)) {\n                        // This is the general case, which should include mostly expressions and statements.\n                        // Also includes NodeArrays.\n                        ts.forEachChild(node, traverse);\n                    }\n            }\n        }\n    }\n    ts.forEachYieldExpression = forEachYieldExpression;\n    /**\n     * Gets the most likely element type for a TypeNode. This is not an exhaustive test\n     * as it assumes a rest argument can only be an array type (either T[], or Array<T>).\n     *\n     * @param node The type node.\n     */\n    function getRestParameterElementType(node) {\n        if (node && node.kind === 178 /* ArrayType */) {\n            return node.elementType;\n        }\n        else if (node && node.kind === 173 /* TypeReference */) {\n            return ts.singleOrUndefined(node.typeArguments);\n        }\n        else {\n            return undefined;\n        }\n    }\n    ts.getRestParameterElementType = getRestParameterElementType;\n    function getMembersOfDeclaration(node) {\n        switch (node.kind) {\n            case 253 /* InterfaceDeclaration */:\n            case 252 /* ClassDeclaration */:\n            case 221 /* ClassExpression */:\n            case 177 /* TypeLiteral */:\n                return node.members;\n            case 200 /* ObjectLiteralExpression */:\n                return node.properties;\n        }\n    }\n    ts.getMembersOfDeclaration = getMembersOfDeclaration;\n    function isVariableLike(node) {\n        if (node) {\n            switch (node.kind) {\n                case 198 /* BindingElement */:\n                case 291 /* EnumMember */:\n                case 160 /* Parameter */:\n                case 288 /* PropertyAssignment */:\n                case 163 /* PropertyDeclaration */:\n                case 162 /* PropertySignature */:\n                case 289 /* ShorthandPropertyAssignment */:\n                case 249 /* VariableDeclaration */:\n                    return true;\n            }\n        }\n        return false;\n    }\n    ts.isVariableLike = isVariableLike;\n    function isVariableLikeOrAccessor(node) {\n        return isVariableLike(node) || ts.isAccessor(node);\n    }\n    ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor;\n    function isVariableDeclarationInVariableStatement(node) {\n        return node.parent.kind === 250 /* VariableDeclarationList */\n            && node.parent.parent.kind === 232 /* VariableStatement */;\n    }\n    ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement;\n    function isValidESSymbolDeclaration(node) {\n        return ts.isVariableDeclaration(node) ? isVarConst(node) && ts.isIdentifier(node.name) && isVariableDeclarationInVariableStatement(node) :\n            ts.isPropertyDeclaration(node) ? hasEffectiveReadonlyModifier(node) && hasStaticModifier(node) :\n                ts.isPropertySignature(node) && hasEffectiveReadonlyModifier(node);\n    }\n    ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration;\n    function introducesArgumentsExoticObject(node) {\n        switch (node.kind) {\n            case 165 /* MethodDeclaration */:\n            case 164 /* MethodSignature */:\n            case 166 /* Constructor */:\n            case 167 /* GetAccessor */:\n            case 168 /* SetAccessor */:\n            case 251 /* FunctionDeclaration */:\n            case 208 /* FunctionExpression */:\n                return true;\n        }\n        return false;\n    }\n    ts.introducesArgumentsExoticObject = introducesArgumentsExoticObject;\n    function unwrapInnermostStatementOfLabel(node, beforeUnwrapLabelCallback) {\n        while (true) {\n            if (beforeUnwrapLabelCallback) {\n                beforeUnwrapLabelCallback(node);\n            }\n            if (node.statement.kind !== 245 /* LabeledStatement */) {\n                return node.statement;\n            }\n            node = node.statement;\n        }\n    }\n    ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel;\n    function isFunctionBlock(node) {\n        return node && node.kind === 230 /* Block */ && ts.isFunctionLike(node.parent);\n    }\n    ts.isFunctionBlock = isFunctionBlock;\n    function isObjectLiteralMethod(node) {\n        return node && node.kind === 165 /* MethodDeclaration */ && node.parent.kind === 200 /* ObjectLiteralExpression */;\n    }\n    ts.isObjectLiteralMethod = isObjectLiteralMethod;\n    function isObjectLiteralOrClassExpressionMethod(node) {\n        return node.kind === 165 /* MethodDeclaration */ &&\n            (node.parent.kind === 200 /* ObjectLiteralExpression */ ||\n                node.parent.kind === 221 /* ClassExpression */);\n    }\n    ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod;\n    function isIdentifierTypePredicate(predicate) {\n        return predicate && predicate.kind === 1 /* Identifier */;\n    }\n    ts.isIdentifierTypePredicate = isIdentifierTypePredicate;\n    function isThisTypePredicate(predicate) {\n        return predicate && predicate.kind === 0 /* This */;\n    }\n    ts.isThisTypePredicate = isThisTypePredicate;\n    function getPropertyAssignment(objectLiteral, key, key2) {\n        return objectLiteral.properties.filter(function (property) {\n            if (property.kind === 288 /* PropertyAssignment */) {\n                var propName = getTextOfPropertyName(property.name);\n                return key === propName || (!!key2 && key2 === propName);\n            }\n            return false;\n        });\n    }\n    ts.getPropertyAssignment = getPropertyAssignment;\n    function getPropertyArrayElementValue(objectLiteral, propKey, elementValue) {\n        return ts.firstDefined(getPropertyAssignment(objectLiteral, propKey), function (property) {\n            return ts.isArrayLiteralExpression(property.initializer) ?\n                ts.find(property.initializer.elements, function (element) { return ts.isStringLiteral(element) && element.text === elementValue; }) :\n                undefined;\n        });\n    }\n    ts.getPropertyArrayElementValue = getPropertyArrayElementValue;\n    function getTsConfigObjectLiteralExpression(tsConfigSourceFile) {\n        if (tsConfigSourceFile && tsConfigSourceFile.statements.length) {\n            var expression = tsConfigSourceFile.statements[0].expression;\n            return ts.tryCast(expression, ts.isObjectLiteralExpression);\n        }\n    }\n    ts.getTsConfigObjectLiteralExpression = getTsConfigObjectLiteralExpression;\n    function getTsConfigPropArrayElementValue(tsConfigSourceFile, propKey, elementValue) {\n        return ts.firstDefined(getTsConfigPropArray(tsConfigSourceFile, propKey), function (property) {\n            return ts.isArrayLiteralExpression(property.initializer) ?\n                ts.find(property.initializer.elements, function (element) { return ts.isStringLiteral(element) && element.text === elementValue; }) :\n                undefined;\n        });\n    }\n    ts.getTsConfigPropArrayElementValue = getTsConfigPropArrayElementValue;\n    function getTsConfigPropArray(tsConfigSourceFile, propKey) {\n        var jsonObjectLiteral = getTsConfigObjectLiteralExpression(tsConfigSourceFile);\n        return jsonObjectLiteral ? getPropertyAssignment(jsonObjectLiteral, propKey) : ts.emptyArray;\n    }\n    ts.getTsConfigPropArray = getTsConfigPropArray;\n    function getContainingFunction(node) {\n        return ts.findAncestor(node.parent, ts.isFunctionLike);\n    }\n    ts.getContainingFunction = getContainingFunction;\n    function getContainingFunctionDeclaration(node) {\n        return ts.findAncestor(node.parent, ts.isFunctionLikeDeclaration);\n    }\n    ts.getContainingFunctionDeclaration = getContainingFunctionDeclaration;\n    function getContainingClass(node) {\n        return ts.findAncestor(node.parent, ts.isClassLike);\n    }\n    ts.getContainingClass = getContainingClass;\n    function getThisContainer(node, includeArrowFunctions) {\n        ts.Debug.assert(node.kind !== 297 /* SourceFile */);\n        while (true) {\n            node = node.parent;\n            if (!node) {\n                return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that.\n            }\n            switch (node.kind) {\n                case 158 /* ComputedPropertyName */:\n                    // If the grandparent node is an object literal (as opposed to a class),\n                    // then the computed property is not a 'this' container.\n                    // A computed property name in a class needs to be a this container\n                    // so that we can error on it.\n                    if (ts.isClassLike(node.parent.parent)) {\n                        return node;\n                    }\n                    // If this is a computed property, then the parent should not\n                    // make it a this container. The parent might be a property\n                    // in an object literal, like a method or accessor. But in order for\n                    // such a parent to be a this container, the reference must be in\n                    // the *body* of the container.\n                    node = node.parent;\n                    break;\n                case 161 /* Decorator */:\n                    // Decorators are always applied outside of the body of a class or method.\n                    if (node.parent.kind === 160 /* Parameter */ && ts.isClassElement(node.parent.parent)) {\n                        // If the decorator's parent is a Parameter, we resolve the this container from\n                        // the grandparent class declaration.\n                        node = node.parent.parent;\n                    }\n                    else if (ts.isClassElement(node.parent)) {\n                        // If the decorator's parent is a class element, we resolve the 'this' container\n                        // from the parent class declaration.\n                        node = node.parent;\n                    }\n                    break;\n                case 209 /* ArrowFunction */:\n                    if (!includeArrowFunctions) {\n                        continue;\n                    }\n                // falls through\n                case 251 /* FunctionDeclaration */:\n                case 208 /* FunctionExpression */:\n                case 256 /* ModuleDeclaration */:\n                case 163 /* PropertyDeclaration */:\n                case 162 /* PropertySignature */:\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                case 166 /* Constructor */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                case 169 /* CallSignature */:\n                case 170 /* ConstructSignature */:\n                case 171 /* IndexSignature */:\n                case 255 /* EnumDeclaration */:\n                case 297 /* SourceFile */:\n                    return node;\n            }\n        }\n    }\n    ts.getThisContainer = getThisContainer;\n    function isInTopLevelContext(node) {\n        // The name of a class or function declaration is a BindingIdentifier in its surrounding scope.\n        if (ts.isIdentifier(node) && (ts.isClassDeclaration(node.parent) || ts.isFunctionDeclaration(node.parent)) && node.parent.name === node) {\n            node = node.parent;\n        }\n        var container = getThisContainer(node, /*includeArrowFunctions*/ true);\n        return ts.isSourceFile(container);\n    }\n    ts.isInTopLevelContext = isInTopLevelContext;\n    function getNewTargetContainer(node) {\n        var container = getThisContainer(node, /*includeArrowFunctions*/ false);\n        if (container) {\n            switch (container.kind) {\n                case 166 /* Constructor */:\n                case 251 /* FunctionDeclaration */:\n                case 208 /* FunctionExpression */:\n                    return container;\n            }\n        }\n        return undefined;\n    }\n    ts.getNewTargetContainer = getNewTargetContainer;\n    /**\n     * Given an super call/property node, returns the closest node where\n     * - a super call/property access is legal in the node and not legal in the parent node the node.\n     *   i.e. super call is legal in constructor but not legal in the class body.\n     * - the container is an arrow function (so caller might need to call getSuperContainer again in case it needs to climb higher)\n     * - a super call/property is definitely illegal in the container (but might be legal in some subnode)\n     *   i.e. super property access is illegal in function declaration but can be legal in the statement list\n     */\n    function getSuperContainer(node, stopOnFunctions) {\n        while (true) {\n            node = node.parent;\n            if (!node) {\n                return node;\n            }\n            switch (node.kind) {\n                case 158 /* ComputedPropertyName */:\n                    node = node.parent;\n                    break;\n                case 251 /* FunctionDeclaration */:\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                    if (!stopOnFunctions) {\n                        continue;\n                    }\n                // falls through\n                case 163 /* PropertyDeclaration */:\n                case 162 /* PropertySignature */:\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                case 166 /* Constructor */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    return node;\n                case 161 /* Decorator */:\n                    // Decorators are always applied outside of the body of a class or method.\n                    if (node.parent.kind === 160 /* Parameter */ && ts.isClassElement(node.parent.parent)) {\n                        // If the decorator's parent is a Parameter, we resolve the this container from\n                        // the grandparent class declaration.\n                        node = node.parent.parent;\n                    }\n                    else if (ts.isClassElement(node.parent)) {\n                        // If the decorator's parent is a class element, we resolve the 'this' container\n                        // from the parent class declaration.\n                        node = node.parent;\n                    }\n                    break;\n            }\n        }\n    }\n    ts.getSuperContainer = getSuperContainer;\n    function getImmediatelyInvokedFunctionExpression(func) {\n        if (func.kind === 208 /* FunctionExpression */ || func.kind === 209 /* ArrowFunction */) {\n            var prev = func;\n            var parent = func.parent;\n            while (parent.kind === 207 /* ParenthesizedExpression */) {\n                prev = parent;\n                parent = parent.parent;\n            }\n            if (parent.kind === 203 /* CallExpression */ && parent.expression === prev) {\n                return parent;\n            }\n        }\n    }\n    ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression;\n    function isSuperOrSuperProperty(node) {\n        return node.kind === 105 /* SuperKeyword */\n            || isSuperProperty(node);\n    }\n    ts.isSuperOrSuperProperty = isSuperOrSuperProperty;\n    /**\n     * Determines whether a node is a property or element access expression for `super`.\n     */\n    function isSuperProperty(node) {\n        var kind = node.kind;\n        return (kind === 201 /* PropertyAccessExpression */ || kind === 202 /* ElementAccessExpression */)\n            && node.expression.kind === 105 /* SuperKeyword */;\n    }\n    ts.isSuperProperty = isSuperProperty;\n    /**\n     * Determines whether a node is a property or element access expression for `this`.\n     */\n    function isThisProperty(node) {\n        var kind = node.kind;\n        return (kind === 201 /* PropertyAccessExpression */ || kind === 202 /* ElementAccessExpression */)\n            && node.expression.kind === 107 /* ThisKeyword */;\n    }\n    ts.isThisProperty = isThisProperty;\n    function isThisInitializedDeclaration(node) {\n        var _a;\n        return !!node && ts.isVariableDeclaration(node) && ((_a = node.initializer) === null || _a === void 0 ? void 0 : _a.kind) === 107 /* ThisKeyword */;\n    }\n    ts.isThisInitializedDeclaration = isThisInitializedDeclaration;\n    function getEntityNameFromTypeNode(node) {\n        switch (node.kind) {\n            case 173 /* TypeReference */:\n                return node.typeName;\n            case 223 /* ExpressionWithTypeArguments */:\n                return isEntityNameExpression(node.expression)\n                    ? node.expression\n                    : undefined;\n            // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s.\n            case 78 /* Identifier */:\n            case 157 /* QualifiedName */:\n                return node;\n        }\n        return undefined;\n    }\n    ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode;\n    function getInvokedExpression(node) {\n        switch (node.kind) {\n            case 205 /* TaggedTemplateExpression */:\n                return node.tag;\n            case 275 /* JsxOpeningElement */:\n            case 274 /* JsxSelfClosingElement */:\n                return node.tagName;\n            default:\n                return node.expression;\n        }\n    }\n    ts.getInvokedExpression = getInvokedExpression;\n    function nodeCanBeDecorated(node, parent, grandparent) {\n        // private names cannot be used with decorators yet\n        if (ts.isNamedDeclaration(node) && ts.isPrivateIdentifier(node.name)) {\n            return false;\n        }\n        switch (node.kind) {\n            case 252 /* ClassDeclaration */:\n                // classes are valid targets\n                return true;\n            case 163 /* PropertyDeclaration */:\n                // property declarations are valid if their parent is a class declaration.\n                return parent.kind === 252 /* ClassDeclaration */;\n            case 167 /* GetAccessor */:\n            case 168 /* SetAccessor */:\n            case 165 /* MethodDeclaration */:\n                // if this method has a body and its parent is a class declaration, this is a valid target.\n                return node.body !== undefined\n                    && parent.kind === 252 /* ClassDeclaration */;\n            case 160 /* Parameter */:\n                // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target;\n                return parent.body !== undefined\n                    && (parent.kind === 166 /* Constructor */\n                        || parent.kind === 165 /* MethodDeclaration */\n                        || parent.kind === 168 /* SetAccessor */)\n                    && grandparent.kind === 252 /* ClassDeclaration */;\n        }\n        return false;\n    }\n    ts.nodeCanBeDecorated = nodeCanBeDecorated;\n    function nodeIsDecorated(node, parent, grandparent) {\n        return node.decorators !== undefined\n            && nodeCanBeDecorated(node, parent, grandparent); // TODO: GH#18217\n    }\n    ts.nodeIsDecorated = nodeIsDecorated;\n    function nodeOrChildIsDecorated(node, parent, grandparent) {\n        return nodeIsDecorated(node, parent, grandparent) || childIsDecorated(node, parent); // TODO: GH#18217\n    }\n    ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated;\n    function childIsDecorated(node, parent) {\n        switch (node.kind) {\n            case 252 /* ClassDeclaration */:\n                return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217\n            case 165 /* MethodDeclaration */:\n            case 168 /* SetAccessor */:\n                return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217\n            default:\n                return false;\n        }\n    }\n    ts.childIsDecorated = childIsDecorated;\n    function isJSXTagName(node) {\n        var parent = node.parent;\n        if (parent.kind === 275 /* JsxOpeningElement */ ||\n            parent.kind === 274 /* JsxSelfClosingElement */ ||\n            parent.kind === 276 /* JsxClosingElement */) {\n            return parent.tagName === node;\n        }\n        return false;\n    }\n    ts.isJSXTagName = isJSXTagName;\n    function isExpressionNode(node) {\n        switch (node.kind) {\n            case 105 /* SuperKeyword */:\n            case 103 /* NullKeyword */:\n            case 109 /* TrueKeyword */:\n            case 94 /* FalseKeyword */:\n            case 13 /* RegularExpressionLiteral */:\n            case 199 /* ArrayLiteralExpression */:\n            case 200 /* ObjectLiteralExpression */:\n            case 201 /* PropertyAccessExpression */:\n            case 202 /* ElementAccessExpression */:\n            case 203 /* CallExpression */:\n            case 204 /* NewExpression */:\n            case 205 /* TaggedTemplateExpression */:\n            case 224 /* AsExpression */:\n            case 206 /* TypeAssertionExpression */:\n            case 225 /* NonNullExpression */:\n            case 207 /* ParenthesizedExpression */:\n            case 208 /* FunctionExpression */:\n            case 221 /* ClassExpression */:\n            case 209 /* ArrowFunction */:\n            case 212 /* VoidExpression */:\n            case 210 /* DeleteExpression */:\n            case 211 /* TypeOfExpression */:\n            case 214 /* PrefixUnaryExpression */:\n            case 215 /* PostfixUnaryExpression */:\n            case 216 /* BinaryExpression */:\n            case 217 /* ConditionalExpression */:\n            case 220 /* SpreadElement */:\n            case 218 /* TemplateExpression */:\n            case 222 /* OmittedExpression */:\n            case 273 /* JsxElement */:\n            case 274 /* JsxSelfClosingElement */:\n            case 277 /* JsxFragment */:\n            case 219 /* YieldExpression */:\n            case 213 /* AwaitExpression */:\n            case 226 /* MetaProperty */:\n                return true;\n            case 157 /* QualifiedName */:\n                while (node.parent.kind === 157 /* QualifiedName */) {\n                    node = node.parent;\n                }\n                return node.parent.kind === 176 /* TypeQuery */ || isJSXTagName(node);\n            case 78 /* Identifier */:\n                if (node.parent.kind === 176 /* TypeQuery */ || isJSXTagName(node)) {\n                    return true;\n                }\n            // falls through\n            case 8 /* NumericLiteral */:\n            case 9 /* BigIntLiteral */:\n            case 10 /* StringLiteral */:\n            case 14 /* NoSubstitutionTemplateLiteral */:\n            case 107 /* ThisKeyword */:\n                return isInExpressionContext(node);\n            default:\n                return false;\n        }\n    }\n    ts.isExpressionNode = isExpressionNode;\n    function isInExpressionContext(node) {\n        var parent = node.parent;\n        switch (parent.kind) {\n            case 249 /* VariableDeclaration */:\n            case 160 /* Parameter */:\n            case 163 /* PropertyDeclaration */:\n            case 162 /* PropertySignature */:\n            case 291 /* EnumMember */:\n            case 288 /* PropertyAssignment */:\n            case 198 /* BindingElement */:\n                return parent.initializer === node;\n            case 233 /* ExpressionStatement */:\n            case 234 /* IfStatement */:\n            case 235 /* DoStatement */:\n            case 236 /* WhileStatement */:\n            case 242 /* ReturnStatement */:\n            case 243 /* WithStatement */:\n            case 244 /* SwitchStatement */:\n            case 284 /* CaseClause */:\n            case 246 /* ThrowStatement */:\n                return parent.expression === node;\n            case 237 /* ForStatement */:\n                var forStatement = parent;\n                return (forStatement.initializer === node && forStatement.initializer.kind !== 250 /* VariableDeclarationList */) ||\n                    forStatement.condition === node ||\n                    forStatement.incrementor === node;\n            case 238 /* ForInStatement */:\n            case 239 /* ForOfStatement */:\n                var forInStatement = parent;\n                return (forInStatement.initializer === node && forInStatement.initializer.kind !== 250 /* VariableDeclarationList */) ||\n                    forInStatement.expression === node;\n            case 206 /* TypeAssertionExpression */:\n            case 224 /* AsExpression */:\n                return node === parent.expression;\n            case 228 /* TemplateSpan */:\n                return node === parent.expression;\n            case 158 /* ComputedPropertyName */:\n                return node === parent.expression;\n            case 161 /* Decorator */:\n            case 283 /* JsxExpression */:\n            case 282 /* JsxSpreadAttribute */:\n            case 290 /* SpreadAssignment */:\n                return true;\n            case 223 /* ExpressionWithTypeArguments */:\n                return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent);\n            case 289 /* ShorthandPropertyAssignment */:\n                return parent.objectAssignmentInitializer === node;\n            default:\n                return isExpressionNode(parent);\n        }\n    }\n    ts.isInExpressionContext = isInExpressionContext;\n    function isPartOfTypeQuery(node) {\n        while (node.kind === 157 /* QualifiedName */ || node.kind === 78 /* Identifier */) {\n            node = node.parent;\n        }\n        return node.kind === 176 /* TypeQuery */;\n    }\n    ts.isPartOfTypeQuery = isPartOfTypeQuery;\n    function isExternalModuleImportEqualsDeclaration(node) {\n        return node.kind === 260 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 272 /* ExternalModuleReference */;\n    }\n    ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration;\n    function getExternalModuleImportEqualsDeclarationExpression(node) {\n        ts.Debug.assert(isExternalModuleImportEqualsDeclaration(node));\n        return node.moduleReference.expression;\n    }\n    ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;\n    function getExternalModuleRequireArgument(node) {\n        return isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true)\n            && getLeftmostAccessExpression(node.initializer).arguments[0];\n    }\n    ts.getExternalModuleRequireArgument = getExternalModuleRequireArgument;\n    function isInternalModuleImportEqualsDeclaration(node) {\n        return node.kind === 260 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 272 /* ExternalModuleReference */;\n    }\n    ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration;\n    function isSourceFileJS(file) {\n        return isInJSFile(file);\n    }\n    ts.isSourceFileJS = isSourceFileJS;\n    function isSourceFileNotJS(file) {\n        return !isInJSFile(file);\n    }\n    ts.isSourceFileNotJS = isSourceFileNotJS;\n    function isInJSFile(node) {\n        return !!node && !!(node.flags & 131072 /* JavaScriptFile */);\n    }\n    ts.isInJSFile = isInJSFile;\n    function isInJsonFile(node) {\n        return !!node && !!(node.flags & 33554432 /* JsonFile */);\n    }\n    ts.isInJsonFile = isInJsonFile;\n    function isSourceFileNotJson(file) {\n        return !isJsonSourceFile(file);\n    }\n    ts.isSourceFileNotJson = isSourceFileNotJson;\n    function isInJSDoc(node) {\n        return !!node && !!(node.flags & 4194304 /* JSDoc */);\n    }\n    ts.isInJSDoc = isInJSDoc;\n    function isJSDocIndexSignature(node) {\n        return ts.isTypeReferenceNode(node) &&\n            ts.isIdentifier(node.typeName) &&\n            node.typeName.escapedText === \"Object\" &&\n            node.typeArguments && node.typeArguments.length === 2 &&\n            (node.typeArguments[0].kind === 147 /* StringKeyword */ || node.typeArguments[0].kind === 144 /* NumberKeyword */);\n    }\n    ts.isJSDocIndexSignature = isJSDocIndexSignature;\n    function isRequireCall(callExpression, requireStringLiteralLikeArgument) {\n        if (callExpression.kind !== 203 /* CallExpression */) {\n            return false;\n        }\n        var _a = callExpression, expression = _a.expression, args = _a.arguments;\n        if (expression.kind !== 78 /* Identifier */ || expression.escapedText !== \"require\") {\n            return false;\n        }\n        if (args.length !== 1) {\n            return false;\n        }\n        var arg = args[0];\n        return !requireStringLiteralLikeArgument || ts.isStringLiteralLike(arg);\n    }\n    ts.isRequireCall = isRequireCall;\n    function isRequireVariableDeclaration(node, requireStringLiteralLikeArgument) {\n        if (node.kind === 198 /* BindingElement */) {\n            node = node.parent.parent;\n        }\n        return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(getLeftmostAccessExpression(node.initializer), requireStringLiteralLikeArgument);\n    }\n    ts.isRequireVariableDeclaration = isRequireVariableDeclaration;\n    function isRequireVariableStatement(node, requireStringLiteralLikeArgument) {\n        if (requireStringLiteralLikeArgument === void 0) { requireStringLiteralLikeArgument = true; }\n        return ts.isVariableStatement(node)\n            && node.declarationList.declarations.length > 0\n            && ts.every(node.declarationList.declarations, function (decl) { return isRequireVariableDeclaration(decl, requireStringLiteralLikeArgument); });\n    }\n    ts.isRequireVariableStatement = isRequireVariableStatement;\n    function isSingleOrDoubleQuote(charCode) {\n        return charCode === 39 /* singleQuote */ || charCode === 34 /* doubleQuote */;\n    }\n    ts.isSingleOrDoubleQuote = isSingleOrDoubleQuote;\n    function isStringDoubleQuoted(str, sourceFile) {\n        return getSourceTextOfNodeFromSourceFile(sourceFile, str).charCodeAt(0) === 34 /* doubleQuote */;\n    }\n    ts.isStringDoubleQuoted = isStringDoubleQuoted;\n    function isAssignmentDeclaration(decl) {\n        return ts.isBinaryExpression(decl) || isAccessExpression(decl) || ts.isIdentifier(decl) || ts.isCallExpression(decl);\n    }\n    ts.isAssignmentDeclaration = isAssignmentDeclaration;\n    /** Get the initializer, taking into account defaulted Javascript initializers */\n    function getEffectiveInitializer(node) {\n        if (isInJSFile(node) && node.initializer &&\n            ts.isBinaryExpression(node.initializer) &&\n            (node.initializer.operatorToken.kind === 56 /* BarBarToken */ || node.initializer.operatorToken.kind === 60 /* QuestionQuestionToken */) &&\n            node.name && isEntityNameExpression(node.name) && isSameEntityName(node.name, node.initializer.left)) {\n            return node.initializer.right;\n        }\n        return node.initializer;\n    }\n    ts.getEffectiveInitializer = getEffectiveInitializer;\n    /** Get the declaration initializer when it is container-like (See getExpandoInitializer). */\n    function getDeclaredExpandoInitializer(node) {\n        var init = getEffectiveInitializer(node);\n        return init && getExpandoInitializer(init, isPrototypeAccess(node.name));\n    }\n    ts.getDeclaredExpandoInitializer = getDeclaredExpandoInitializer;\n    function hasExpandoValueProperty(node, isPrototypeAssignment) {\n        return ts.forEach(node.properties, function (p) {\n            return ts.isPropertyAssignment(p) &&\n                ts.isIdentifier(p.name) &&\n                p.name.escapedText === \"value\" &&\n                p.initializer &&\n                getExpandoInitializer(p.initializer, isPrototypeAssignment);\n        });\n    }\n    /**\n     * Get the assignment 'initializer' -- the righthand side-- when the initializer is container-like (See getExpandoInitializer).\n     * We treat the right hand side of assignments with container-like initializers as declarations.\n     */\n    function getAssignedExpandoInitializer(node) {\n        if (node && node.parent && ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 62 /* EqualsToken */) {\n            var isPrototypeAssignment = isPrototypeAccess(node.parent.left);\n            return getExpandoInitializer(node.parent.right, isPrototypeAssignment) ||\n                getDefaultedExpandoInitializer(node.parent.left, node.parent.right, isPrototypeAssignment);\n        }\n        if (node && ts.isCallExpression(node) && isBindableObjectDefinePropertyCall(node)) {\n            var result = hasExpandoValueProperty(node.arguments[2], node.arguments[1].text === \"prototype\");\n            if (result) {\n                return result;\n            }\n        }\n    }\n    ts.getAssignedExpandoInitializer = getAssignedExpandoInitializer;\n    /**\n     * Recognized expando initializers are:\n     * 1. (function() {})() -- IIFEs\n     * 2. function() { } -- Function expressions\n     * 3. class { } -- Class expressions\n     * 4. {} -- Empty object literals\n     * 5. { ... } -- Non-empty object literals, when used to initialize a prototype, like `C.prototype = { m() { } }`\n     *\n     * This function returns the provided initializer, or undefined if it is not valid.\n     */\n    function getExpandoInitializer(initializer, isPrototypeAssignment) {\n        if (ts.isCallExpression(initializer)) {\n            var e = skipParentheses(initializer.expression);\n            return e.kind === 208 /* FunctionExpression */ || e.kind === 209 /* ArrowFunction */ ? initializer : undefined;\n        }\n        if (initializer.kind === 208 /* FunctionExpression */ ||\n            initializer.kind === 221 /* ClassExpression */ ||\n            initializer.kind === 209 /* ArrowFunction */) {\n            return initializer;\n        }\n        if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) {\n            return initializer;\n        }\n    }\n    ts.getExpandoInitializer = getExpandoInitializer;\n    /**\n     * A defaulted expando initializer matches the pattern\n     * `Lhs = Lhs || ExpandoInitializer`\n     * or `var Lhs = Lhs || ExpandoInitializer`\n     *\n     * The second Lhs is required to be the same as the first except that it may be prefixed with\n     * 'window.', 'global.' or 'self.' The second Lhs is otherwise ignored by the binder and checker.\n     */\n    function getDefaultedExpandoInitializer(name, initializer, isPrototypeAssignment) {\n        var e = ts.isBinaryExpression(initializer)\n            && (initializer.operatorToken.kind === 56 /* BarBarToken */ || initializer.operatorToken.kind === 60 /* QuestionQuestionToken */)\n            && getExpandoInitializer(initializer.right, isPrototypeAssignment);\n        if (e && isSameEntityName(name, initializer.left)) {\n            return e;\n        }\n    }\n    function isDefaultedExpandoInitializer(node) {\n        var name = ts.isVariableDeclaration(node.parent) ? node.parent.name :\n            ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 62 /* EqualsToken */ ? node.parent.left :\n                undefined;\n        return name && getExpandoInitializer(node.right, isPrototypeAccess(name)) && isEntityNameExpression(name) && isSameEntityName(name, node.left);\n    }\n    ts.isDefaultedExpandoInitializer = isDefaultedExpandoInitializer;\n    /** Given an expando initializer, return its declaration name, or the left-hand side of the assignment if it's part of an assignment declaration. */\n    function getNameOfExpando(node) {\n        if (ts.isBinaryExpression(node.parent)) {\n            var parent = ((node.parent.operatorToken.kind === 56 /* BarBarToken */ || node.parent.operatorToken.kind === 60 /* QuestionQuestionToken */) && ts.isBinaryExpression(node.parent.parent)) ? node.parent.parent : node.parent;\n            if (parent.operatorToken.kind === 62 /* EqualsToken */ && ts.isIdentifier(parent.left)) {\n                return parent.left;\n            }\n        }\n        else if (ts.isVariableDeclaration(node.parent)) {\n            return node.parent.name;\n        }\n    }\n    ts.getNameOfExpando = getNameOfExpando;\n    /**\n     * Is the 'declared' name the same as the one in the initializer?\n     * @return true for identical entity names, as well as ones where the initializer is prefixed with\n     * 'window', 'self' or 'global'. For example:\n     *\n     * var my = my || {}\n     * var min = window.min || {}\n     * my.app = self.my.app || class { }\n     */\n    function isSameEntityName(name, initializer) {\n        if (isPropertyNameLiteral(name) && isPropertyNameLiteral(initializer)) {\n            return getTextOfIdentifierOrLiteral(name) === getTextOfIdentifierOrLiteral(initializer);\n        }\n        if (ts.isIdentifier(name) && isLiteralLikeAccess(initializer) &&\n            (initializer.expression.kind === 107 /* ThisKeyword */ ||\n                ts.isIdentifier(initializer.expression) &&\n                    (initializer.expression.escapedText === \"window\" ||\n                        initializer.expression.escapedText === \"self\" ||\n                        initializer.expression.escapedText === \"global\"))) {\n            var nameOrArgument = getNameOrArgument(initializer);\n            if (ts.isPrivateIdentifier(nameOrArgument)) {\n                ts.Debug.fail(\"Unexpected PrivateIdentifier in name expression with literal-like access.\");\n            }\n            return isSameEntityName(name, nameOrArgument);\n        }\n        if (isLiteralLikeAccess(name) && isLiteralLikeAccess(initializer)) {\n            return getElementOrPropertyAccessName(name) === getElementOrPropertyAccessName(initializer)\n                && isSameEntityName(name.expression, initializer.expression);\n        }\n        return false;\n    }\n    ts.isSameEntityName = isSameEntityName;\n    function getRightMostAssignedExpression(node) {\n        while (isAssignmentExpression(node, /*excludeCompoundAssignments*/ true)) {\n            node = node.right;\n        }\n        return node;\n    }\n    ts.getRightMostAssignedExpression = getRightMostAssignedExpression;\n    function isExportsIdentifier(node) {\n        return ts.isIdentifier(node) && node.escapedText === \"exports\";\n    }\n    ts.isExportsIdentifier = isExportsIdentifier;\n    function isModuleIdentifier(node) {\n        return ts.isIdentifier(node) && node.escapedText === \"module\";\n    }\n    ts.isModuleIdentifier = isModuleIdentifier;\n    function isModuleExportsAccessExpression(node) {\n        return (ts.isPropertyAccessExpression(node) || isLiteralLikeElementAccess(node))\n            && isModuleIdentifier(node.expression)\n            && getElementOrPropertyAccessName(node) === \"exports\";\n    }\n    ts.isModuleExportsAccessExpression = isModuleExportsAccessExpression;\n    /// Given a BinaryExpression, returns SpecialPropertyAssignmentKind for the various kinds of property\n    /// assignments we treat as special in the binder\n    function getAssignmentDeclarationKind(expr) {\n        var special = getAssignmentDeclarationKindWorker(expr);\n        return special === 5 /* Property */ || isInJSFile(expr) ? special : 0 /* None */;\n    }\n    ts.getAssignmentDeclarationKind = getAssignmentDeclarationKind;\n    function isBindableObjectDefinePropertyCall(expr) {\n        return ts.length(expr.arguments) === 3 &&\n            ts.isPropertyAccessExpression(expr.expression) &&\n            ts.isIdentifier(expr.expression.expression) &&\n            ts.idText(expr.expression.expression) === \"Object\" &&\n            ts.idText(expr.expression.name) === \"defineProperty\" &&\n            isStringOrNumericLiteralLike(expr.arguments[1]) &&\n            isBindableStaticNameExpression(expr.arguments[0], /*excludeThisKeyword*/ true);\n    }\n    ts.isBindableObjectDefinePropertyCall = isBindableObjectDefinePropertyCall;\n    /** x.y OR x[0] */\n    function isLiteralLikeAccess(node) {\n        return ts.isPropertyAccessExpression(node) || isLiteralLikeElementAccess(node);\n    }\n    ts.isLiteralLikeAccess = isLiteralLikeAccess;\n    /** x[0] OR x['a'] OR x[Symbol.y] */\n    function isLiteralLikeElementAccess(node) {\n        return ts.isElementAccessExpression(node) && (isStringOrNumericLiteralLike(node.argumentExpression) ||\n            isWellKnownSymbolSyntactically(node.argumentExpression));\n    }\n    ts.isLiteralLikeElementAccess = isLiteralLikeElementAccess;\n    /** Any series of property and element accesses. */\n    function isBindableStaticAccessExpression(node, excludeThisKeyword) {\n        return ts.isPropertyAccessExpression(node) && (!excludeThisKeyword && node.expression.kind === 107 /* ThisKeyword */ || ts.isIdentifier(node.name) && isBindableStaticNameExpression(node.expression, /*excludeThisKeyword*/ true))\n            || isBindableStaticElementAccessExpression(node, excludeThisKeyword);\n    }\n    ts.isBindableStaticAccessExpression = isBindableStaticAccessExpression;\n    /** Any series of property and element accesses, ending in a literal element access */\n    function isBindableStaticElementAccessExpression(node, excludeThisKeyword) {\n        return isLiteralLikeElementAccess(node)\n            && ((!excludeThisKeyword && node.expression.kind === 107 /* ThisKeyword */) ||\n                isEntityNameExpression(node.expression) ||\n                isBindableStaticAccessExpression(node.expression, /*excludeThisKeyword*/ true));\n    }\n    ts.isBindableStaticElementAccessExpression = isBindableStaticElementAccessExpression;\n    function isBindableStaticNameExpression(node, excludeThisKeyword) {\n        return isEntityNameExpression(node) || isBindableStaticAccessExpression(node, excludeThisKeyword);\n    }\n    ts.isBindableStaticNameExpression = isBindableStaticNameExpression;\n    function getNameOrArgument(expr) {\n        if (ts.isPropertyAccessExpression(expr)) {\n            return expr.name;\n        }\n        return expr.argumentExpression;\n    }\n    ts.getNameOrArgument = getNameOrArgument;\n    function getAssignmentDeclarationKindWorker(expr) {\n        if (ts.isCallExpression(expr)) {\n            if (!isBindableObjectDefinePropertyCall(expr)) {\n                return 0 /* None */;\n            }\n            var entityName = expr.arguments[0];\n            if (isExportsIdentifier(entityName) || isModuleExportsAccessExpression(entityName)) {\n                return 8 /* ObjectDefinePropertyExports */;\n            }\n            if (isBindableStaticAccessExpression(entityName) && getElementOrPropertyAccessName(entityName) === \"prototype\") {\n                return 9 /* ObjectDefinePrototypeProperty */;\n            }\n            return 7 /* ObjectDefinePropertyValue */;\n        }\n        if (expr.operatorToken.kind !== 62 /* EqualsToken */ || !isAccessExpression(expr.left) || isVoidZero(getRightMostAssignedExpression(expr))) {\n            return 0 /* None */;\n        }\n        if (isBindableStaticNameExpression(expr.left.expression, /*excludeThisKeyword*/ true) && getElementOrPropertyAccessName(expr.left) === \"prototype\" && ts.isObjectLiteralExpression(getInitializerOfBinaryExpression(expr))) {\n            // F.prototype = { ... }\n            return 6 /* Prototype */;\n        }\n        return getAssignmentDeclarationPropertyAccessKind(expr.left);\n    }\n    function isVoidZero(node) {\n        return ts.isVoidExpression(node) && ts.isNumericLiteral(node.expression) && node.expression.text === \"0\";\n    }\n    /**\n     * Does not handle signed numeric names like `a[+0]` - handling those would require handling prefix unary expressions\n     * throughout late binding handling as well, which is awkward (but ultimately probably doable if there is demand)\n     */\n    /* @internal */\n    function getElementOrPropertyAccessArgumentExpressionOrName(node) {\n        if (ts.isPropertyAccessExpression(node)) {\n            return node.name;\n        }\n        var arg = skipParentheses(node.argumentExpression);\n        if (ts.isNumericLiteral(arg) || ts.isStringLiteralLike(arg)) {\n            return arg;\n        }\n        return node;\n    }\n    ts.getElementOrPropertyAccessArgumentExpressionOrName = getElementOrPropertyAccessArgumentExpressionOrName;\n    function getElementOrPropertyAccessName(node) {\n        var name = getElementOrPropertyAccessArgumentExpressionOrName(node);\n        if (name) {\n            if (ts.isIdentifier(name)) {\n                return name.escapedText;\n            }\n            if (ts.isStringLiteralLike(name) || ts.isNumericLiteral(name)) {\n                return ts.escapeLeadingUnderscores(name.text);\n            }\n        }\n        if (ts.isElementAccessExpression(node) && isWellKnownSymbolSyntactically(node.argumentExpression)) {\n            return getPropertyNameForKnownSymbolName(ts.idText(node.argumentExpression.name));\n        }\n        return undefined;\n    }\n    ts.getElementOrPropertyAccessName = getElementOrPropertyAccessName;\n    function getAssignmentDeclarationPropertyAccessKind(lhs) {\n        if (lhs.expression.kind === 107 /* ThisKeyword */) {\n            return 4 /* ThisProperty */;\n        }\n        else if (isModuleExportsAccessExpression(lhs)) {\n            // module.exports = expr\n            return 2 /* ModuleExports */;\n        }\n        else if (isBindableStaticNameExpression(lhs.expression, /*excludeThisKeyword*/ true)) {\n            if (isPrototypeAccess(lhs.expression)) {\n                // F.G....prototype.x = expr\n                return 3 /* PrototypeProperty */;\n            }\n            var nextToLast = lhs;\n            while (!ts.isIdentifier(nextToLast.expression)) {\n                nextToLast = nextToLast.expression;\n            }\n            var id = nextToLast.expression;\n            if ((id.escapedText === \"exports\" ||\n                id.escapedText === \"module\" && getElementOrPropertyAccessName(nextToLast) === \"exports\") &&\n                // ExportsProperty does not support binding with computed names\n                isBindableStaticAccessExpression(lhs)) {\n                // exports.name = expr OR module.exports.name = expr OR exports[\"name\"] = expr ...\n                return 1 /* ExportsProperty */;\n            }\n            if (isBindableStaticNameExpression(lhs, /*excludeThisKeyword*/ true) || (ts.isElementAccessExpression(lhs) && isDynamicName(lhs))) {\n                // F.G...x = expr\n                return 5 /* Property */;\n            }\n        }\n        return 0 /* None */;\n    }\n    ts.getAssignmentDeclarationPropertyAccessKind = getAssignmentDeclarationPropertyAccessKind;\n    function getInitializerOfBinaryExpression(expr) {\n        while (ts.isBinaryExpression(expr.right)) {\n            expr = expr.right;\n        }\n        return expr.right;\n    }\n    ts.getInitializerOfBinaryExpression = getInitializerOfBinaryExpression;\n    function isPrototypePropertyAssignment(node) {\n        return ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 3 /* PrototypeProperty */;\n    }\n    ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment;\n    function isSpecialPropertyDeclaration(expr) {\n        return isInJSFile(expr) &&\n            expr.parent && expr.parent.kind === 233 /* ExpressionStatement */ &&\n            (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) &&\n            !!ts.getJSDocTypeTag(expr.parent);\n    }\n    ts.isSpecialPropertyDeclaration = isSpecialPropertyDeclaration;\n    function setValueDeclaration(symbol, node) {\n        var valueDeclaration = symbol.valueDeclaration;\n        if (!valueDeclaration ||\n            !(node.flags & 8388608 /* Ambient */ && !(valueDeclaration.flags & 8388608 /* Ambient */)) &&\n                (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) ||\n            (valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration))) {\n            // other kinds of value declarations take precedence over modules and assignment declarations\n            symbol.valueDeclaration = node;\n        }\n    }\n    ts.setValueDeclaration = setValueDeclaration;\n    function isFunctionSymbol(symbol) {\n        if (!symbol || !symbol.valueDeclaration) {\n            return false;\n        }\n        var decl = symbol.valueDeclaration;\n        return decl.kind === 251 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer);\n    }\n    ts.isFunctionSymbol = isFunctionSymbol;\n    function importFromModuleSpecifier(node) {\n        return tryGetImportFromModuleSpecifier(node) || ts.Debug.failBadSyntaxKind(node.parent);\n    }\n    ts.importFromModuleSpecifier = importFromModuleSpecifier;\n    function tryGetImportFromModuleSpecifier(node) {\n        switch (node.parent.kind) {\n            case 261 /* ImportDeclaration */:\n            case 267 /* ExportDeclaration */:\n                return node.parent;\n            case 272 /* ExternalModuleReference */:\n                return node.parent.parent;\n            case 203 /* CallExpression */:\n                return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined;\n            case 191 /* LiteralType */:\n                ts.Debug.assert(ts.isStringLiteral(node));\n                return ts.tryCast(node.parent.parent, ts.isImportTypeNode);\n            default:\n                return undefined;\n        }\n    }\n    ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier;\n    function getExternalModuleName(node) {\n        switch (node.kind) {\n            case 261 /* ImportDeclaration */:\n            case 267 /* ExportDeclaration */:\n                return node.moduleSpecifier;\n            case 260 /* ImportEqualsDeclaration */:\n                return node.moduleReference.kind === 272 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined;\n            case 195 /* ImportType */:\n                return isLiteralImportTypeNode(node) ? node.argument.literal : undefined;\n            case 203 /* CallExpression */:\n                return node.arguments[0];\n            case 256 /* ModuleDeclaration */:\n                return node.name.kind === 10 /* StringLiteral */ ? node.name : undefined;\n            default:\n                return ts.Debug.assertNever(node);\n        }\n    }\n    ts.getExternalModuleName = getExternalModuleName;\n    function getNamespaceDeclarationNode(node) {\n        switch (node.kind) {\n            case 261 /* ImportDeclaration */:\n                return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport);\n            case 260 /* ImportEqualsDeclaration */:\n                return node;\n            case 267 /* ExportDeclaration */:\n                return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport);\n            default:\n                return ts.Debug.assertNever(node);\n        }\n    }\n    ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode;\n    function isDefaultImport(node) {\n        return node.kind === 261 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name;\n    }\n    ts.isDefaultImport = isDefaultImport;\n    function forEachImportClauseDeclaration(node, action) {\n        if (node.name) {\n            var result = action(node);\n            if (result)\n                return result;\n        }\n        if (node.namedBindings) {\n            var result = ts.isNamespaceImport(node.namedBindings)\n                ? action(node.namedBindings)\n                : ts.forEach(node.namedBindings.elements, action);\n            if (result)\n                return result;\n        }\n    }\n    ts.forEachImportClauseDeclaration = forEachImportClauseDeclaration;\n    function hasQuestionToken(node) {\n        if (node) {\n            switch (node.kind) {\n                case 160 /* Parameter */:\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                case 289 /* ShorthandPropertyAssignment */:\n                case 288 /* PropertyAssignment */:\n                case 163 /* PropertyDeclaration */:\n                case 162 /* PropertySignature */:\n                    return node.questionToken !== undefined;\n            }\n        }\n        return false;\n    }\n    ts.hasQuestionToken = hasQuestionToken;\n    function isJSDocConstructSignature(node) {\n        var param = ts.isJSDocFunctionType(node) ? ts.firstOrUndefined(node.parameters) : undefined;\n        var name = ts.tryCast(param && param.name, ts.isIdentifier);\n        return !!name && name.escapedText === \"new\";\n    }\n    ts.isJSDocConstructSignature = isJSDocConstructSignature;\n    function isJSDocTypeAlias(node) {\n        return node.kind === 331 /* JSDocTypedefTag */ || node.kind === 324 /* JSDocCallbackTag */ || node.kind === 325 /* JSDocEnumTag */;\n    }\n    ts.isJSDocTypeAlias = isJSDocTypeAlias;\n    function isTypeAlias(node) {\n        return isJSDocTypeAlias(node) || ts.isTypeAliasDeclaration(node);\n    }\n    ts.isTypeAlias = isTypeAlias;\n    function getSourceOfAssignment(node) {\n        return ts.isExpressionStatement(node) &&\n            ts.isBinaryExpression(node.expression) &&\n            node.expression.operatorToken.kind === 62 /* EqualsToken */\n            ? getRightMostAssignedExpression(node.expression)\n            : undefined;\n    }\n    function getSourceOfDefaultedAssignment(node) {\n        return ts.isExpressionStatement(node) &&\n            ts.isBinaryExpression(node.expression) &&\n            getAssignmentDeclarationKind(node.expression) !== 0 /* None */ &&\n            ts.isBinaryExpression(node.expression.right) &&\n            (node.expression.right.operatorToken.kind === 56 /* BarBarToken */ || node.expression.right.operatorToken.kind === 60 /* QuestionQuestionToken */)\n            ? node.expression.right.right\n            : undefined;\n    }\n    function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) {\n        switch (node.kind) {\n            case 232 /* VariableStatement */:\n                var v = getSingleVariableOfVariableStatement(node);\n                return v && v.initializer;\n            case 163 /* PropertyDeclaration */:\n                return node.initializer;\n            case 288 /* PropertyAssignment */:\n                return node.initializer;\n        }\n    }\n    ts.getSingleInitializerOfVariableStatementOrPropertyDeclaration = getSingleInitializerOfVariableStatementOrPropertyDeclaration;\n    function getSingleVariableOfVariableStatement(node) {\n        return ts.isVariableStatement(node) ? ts.firstOrUndefined(node.declarationList.declarations) : undefined;\n    }\n    ts.getSingleVariableOfVariableStatement = getSingleVariableOfVariableStatement;\n    function getNestedModuleDeclaration(node) {\n        return ts.isModuleDeclaration(node) &&\n            node.body &&\n            node.body.kind === 256 /* ModuleDeclaration */\n            ? node.body\n            : undefined;\n    }\n    function getJSDocCommentsAndTags(hostNode, noCache) {\n        var result;\n        // Pull parameter comments from declaring function as well\n        if (isVariableLike(hostNode) && ts.hasInitializer(hostNode) && ts.hasJSDocNodes(hostNode.initializer)) {\n            result = ts.append(result, ts.last(hostNode.initializer.jsDoc));\n        }\n        var node = hostNode;\n        while (node && node.parent) {\n            if (ts.hasJSDocNodes(node)) {\n                result = ts.append(result, ts.last(node.jsDoc));\n            }\n            if (node.kind === 160 /* Parameter */) {\n                result = ts.addRange(result, (noCache ? ts.getJSDocParameterTagsNoCache : ts.getJSDocParameterTags)(node));\n                break;\n            }\n            if (node.kind === 159 /* TypeParameter */) {\n                result = ts.addRange(result, (noCache ? ts.getJSDocTypeParameterTagsNoCache : ts.getJSDocTypeParameterTags)(node));\n                break;\n            }\n            node = getNextJSDocCommentLocation(node);\n        }\n        return result || ts.emptyArray;\n    }\n    ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags;\n    function getNextJSDocCommentLocation(node) {\n        var parent = node.parent;\n        if (parent.kind === 288 /* PropertyAssignment */ ||\n            parent.kind === 266 /* ExportAssignment */ ||\n            parent.kind === 163 /* PropertyDeclaration */ ||\n            parent.kind === 233 /* ExpressionStatement */ && node.kind === 201 /* PropertyAccessExpression */ ||\n            getNestedModuleDeclaration(parent) ||\n            ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) {\n            return parent;\n        }\n        // Try to recognize this pattern when node is initializer of variable declaration and JSDoc comments are on containing variable statement.\n        // /**\n        //   * @param {number} name\n        //   * @returns {number}\n        //   */\n        // var x = function(name) { return name.length; }\n        else if (parent.parent &&\n            (getSingleVariableOfVariableStatement(parent.parent) === node ||\n                ts.isBinaryExpression(parent) && parent.operatorToken.kind === 62 /* EqualsToken */)) {\n            return parent.parent;\n        }\n        else if (parent.parent && parent.parent.parent &&\n            (getSingleVariableOfVariableStatement(parent.parent.parent) ||\n                getSingleInitializerOfVariableStatementOrPropertyDeclaration(parent.parent.parent) === node ||\n                getSourceOfDefaultedAssignment(parent.parent.parent))) {\n            return parent.parent.parent;\n        }\n    }\n    ts.getNextJSDocCommentLocation = getNextJSDocCommentLocation;\n    /** Does the opposite of `getJSDocParameterTags`: given a JSDoc parameter, finds the parameter corresponding to it. */\n    function getParameterSymbolFromJSDoc(node) {\n        if (node.symbol) {\n            return node.symbol;\n        }\n        if (!ts.isIdentifier(node.name)) {\n            return undefined;\n        }\n        var name = node.name.escapedText;\n        var decl = getHostSignatureFromJSDoc(node);\n        if (!decl) {\n            return undefined;\n        }\n        var parameter = ts.find(decl.parameters, function (p) { return p.name.kind === 78 /* Identifier */ && p.name.escapedText === name; });\n        return parameter && parameter.symbol;\n    }\n    ts.getParameterSymbolFromJSDoc = getParameterSymbolFromJSDoc;\n    function getHostSignatureFromJSDoc(node) {\n        var host = getEffectiveJSDocHost(node);\n        return host && ts.isFunctionLike(host) ? host : undefined;\n    }\n    ts.getHostSignatureFromJSDoc = getHostSignatureFromJSDoc;\n    function getEffectiveJSDocHost(node) {\n        var host = getJSDocHost(node);\n        if (host) {\n            return getSourceOfDefaultedAssignment(host)\n                || getSourceOfAssignment(host)\n                || getSingleInitializerOfVariableStatementOrPropertyDeclaration(host)\n                || getSingleVariableOfVariableStatement(host)\n                || getNestedModuleDeclaration(host)\n                || host;\n        }\n    }\n    ts.getEffectiveJSDocHost = getEffectiveJSDocHost;\n    /** Use getEffectiveJSDocHost if you additionally need to look for jsdoc on parent nodes, like assignments. */\n    function getJSDocHost(node) {\n        var jsDoc = getJSDocRoot(node);\n        if (!jsDoc) {\n            return undefined;\n        }\n        var host = jsDoc.parent;\n        if (host && host.jsDoc && jsDoc === ts.lastOrUndefined(host.jsDoc)) {\n            return host;\n        }\n    }\n    ts.getJSDocHost = getJSDocHost;\n    function getJSDocRoot(node) {\n        return ts.findAncestor(node.parent, ts.isJSDoc);\n    }\n    ts.getJSDocRoot = getJSDocRoot;\n    function getTypeParameterFromJsDoc(node) {\n        var name = node.name.escapedText;\n        var typeParameters = node.parent.parent.parent.typeParameters;\n        return typeParameters && ts.find(typeParameters, function (p) { return p.name.escapedText === name; });\n    }\n    ts.getTypeParameterFromJsDoc = getTypeParameterFromJsDoc;\n    function hasRestParameter(s) {\n        var last = ts.lastOrUndefined(s.parameters);\n        return !!last && isRestParameter(last);\n    }\n    ts.hasRestParameter = hasRestParameter;\n    function isRestParameter(node) {\n        var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type;\n        return node.dotDotDotToken !== undefined || !!type && type.kind === 309 /* JSDocVariadicType */;\n    }\n    ts.isRestParameter = isRestParameter;\n    function hasTypeArguments(node) {\n        return !!node.typeArguments;\n    }\n    ts.hasTypeArguments = hasTypeArguments;\n    var AssignmentKind;\n    (function (AssignmentKind) {\n        AssignmentKind[AssignmentKind[\"None\"] = 0] = \"None\";\n        AssignmentKind[AssignmentKind[\"Definite\"] = 1] = \"Definite\";\n        AssignmentKind[AssignmentKind[\"Compound\"] = 2] = \"Compound\";\n    })(AssignmentKind = ts.AssignmentKind || (ts.AssignmentKind = {}));\n    function getAssignmentTargetKind(node) {\n        var parent = node.parent;\n        while (true) {\n            switch (parent.kind) {\n                case 216 /* BinaryExpression */:\n                    var binaryOperator = parent.operatorToken.kind;\n                    return isAssignmentOperator(binaryOperator) && parent.left === node ?\n                        binaryOperator === 62 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ :\n                        0 /* None */;\n                case 214 /* PrefixUnaryExpression */:\n                case 215 /* PostfixUnaryExpression */:\n                    var unaryOperator = parent.operator;\n                    return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;\n                case 238 /* ForInStatement */:\n                case 239 /* ForOfStatement */:\n                    return parent.initializer === node ? 1 /* Definite */ : 0 /* None */;\n                case 207 /* ParenthesizedExpression */:\n                case 199 /* ArrayLiteralExpression */:\n                case 220 /* SpreadElement */:\n                case 225 /* NonNullExpression */:\n                    node = parent;\n                    break;\n                case 289 /* ShorthandPropertyAssignment */:\n                    if (parent.name !== node) {\n                        return 0 /* None */;\n                    }\n                    node = parent.parent;\n                    break;\n                case 288 /* PropertyAssignment */:\n                    if (parent.name === node) {\n                        return 0 /* None */;\n                    }\n                    node = parent.parent;\n                    break;\n                default:\n                    return 0 /* None */;\n            }\n            parent = node.parent;\n        }\n    }\n    ts.getAssignmentTargetKind = getAssignmentTargetKind;\n    // A node is an assignment target if it is on the left hand side of an '=' token, if it is parented by a property\n    // assignment in an object literal that is an assignment target, or if it is parented by an array literal that is\n    // an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ a }] = xxx'.\n    // (Note that `p` is not a target in the above examples, only `a`.)\n    function isAssignmentTarget(node) {\n        return getAssignmentTargetKind(node) !== 0 /* None */;\n    }\n    ts.isAssignmentTarget = isAssignmentTarget;\n    /**\n     * Indicates whether a node could contain a `var` VariableDeclarationList that contributes to\n     * the same `var` declaration scope as the node's parent.\n     */\n    function isNodeWithPossibleHoistedDeclaration(node) {\n        switch (node.kind) {\n            case 230 /* Block */:\n            case 232 /* VariableStatement */:\n            case 243 /* WithStatement */:\n            case 234 /* IfStatement */:\n            case 244 /* SwitchStatement */:\n            case 258 /* CaseBlock */:\n            case 284 /* CaseClause */:\n            case 285 /* DefaultClause */:\n            case 245 /* LabeledStatement */:\n            case 237 /* ForStatement */:\n            case 238 /* ForInStatement */:\n            case 239 /* ForOfStatement */:\n            case 235 /* DoStatement */:\n            case 236 /* WhileStatement */:\n            case 247 /* TryStatement */:\n            case 287 /* CatchClause */:\n                return true;\n        }\n        return false;\n    }\n    ts.isNodeWithPossibleHoistedDeclaration = isNodeWithPossibleHoistedDeclaration;\n    function isValueSignatureDeclaration(node) {\n        return ts.isFunctionExpression(node) || ts.isArrowFunction(node) || ts.isMethodOrAccessor(node) || ts.isFunctionDeclaration(node) || ts.isConstructorDeclaration(node);\n    }\n    ts.isValueSignatureDeclaration = isValueSignatureDeclaration;\n    function walkUp(node, kind) {\n        while (node && node.kind === kind) {\n            node = node.parent;\n        }\n        return node;\n    }\n    function walkUpParenthesizedTypes(node) {\n        return walkUp(node, 186 /* ParenthesizedType */);\n    }\n    ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes;\n    function walkUpParenthesizedExpressions(node) {\n        return walkUp(node, 207 /* ParenthesizedExpression */);\n    }\n    ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions;\n    /**\n     * Walks up parenthesized types.\n     * It returns both the outermost parenthesized type and its parent.\n     * If given node is not a parenthesiezd type, undefined is return as the former.\n     */\n    function walkUpParenthesizedTypesAndGetParentAndChild(node) {\n        var child;\n        while (node && node.kind === 186 /* ParenthesizedType */) {\n            child = node;\n            node = node.parent;\n        }\n        return [child, node];\n    }\n    ts.walkUpParenthesizedTypesAndGetParentAndChild = walkUpParenthesizedTypesAndGetParentAndChild;\n    function skipParentheses(node) {\n        return ts.skipOuterExpressions(node, 1 /* Parentheses */);\n    }\n    ts.skipParentheses = skipParentheses;\n    function skipParenthesesUp(node) {\n        while (node.kind === 207 /* ParenthesizedExpression */) {\n            node = node.parent;\n        }\n        return node;\n    }\n    // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped\n    function isDeleteTarget(node) {\n        if (node.kind !== 201 /* PropertyAccessExpression */ && node.kind !== 202 /* ElementAccessExpression */) {\n            return false;\n        }\n        node = walkUpParenthesizedExpressions(node.parent);\n        return node && node.kind === 210 /* DeleteExpression */;\n    }\n    ts.isDeleteTarget = isDeleteTarget;\n    function isNodeDescendantOf(node, ancestor) {\n        while (node) {\n            if (node === ancestor)\n                return true;\n            node = node.parent;\n        }\n        return false;\n    }\n    ts.isNodeDescendantOf = isNodeDescendantOf;\n    // True if `name` is the name of a declaration node\n    function isDeclarationName(name) {\n        return !ts.isSourceFile(name) && !ts.isBindingPattern(name) && ts.isDeclaration(name.parent) && name.parent.name === name;\n    }\n    ts.isDeclarationName = isDeclarationName;\n    // See GH#16030\n    function getDeclarationFromName(name) {\n        var parent = name.parent;\n        switch (name.kind) {\n            case 10 /* StringLiteral */:\n            case 14 /* NoSubstitutionTemplateLiteral */:\n            case 8 /* NumericLiteral */:\n                if (ts.isComputedPropertyName(parent))\n                    return parent.parent;\n            // falls through\n            case 78 /* Identifier */:\n                if (ts.isDeclaration(parent)) {\n                    return parent.name === name ? parent : undefined;\n                }\n                else if (ts.isQualifiedName(parent)) {\n                    var tag = parent.parent;\n                    return ts.isJSDocParameterTag(tag) && tag.name === parent ? tag : undefined;\n                }\n                else {\n                    var binExp = parent.parent;\n                    return ts.isBinaryExpression(binExp) &&\n                        getAssignmentDeclarationKind(binExp) !== 0 /* None */ &&\n                        (binExp.left.symbol || binExp.symbol) &&\n                        ts.getNameOfDeclaration(binExp) === name\n                        ? binExp\n                        : undefined;\n                }\n            case 79 /* PrivateIdentifier */:\n                return ts.isDeclaration(parent) && parent.name === name ? parent : undefined;\n            default:\n                return undefined;\n        }\n    }\n    ts.getDeclarationFromName = getDeclarationFromName;\n    function isLiteralComputedPropertyDeclarationName(node) {\n        return isStringOrNumericLiteralLike(node) &&\n            node.parent.kind === 158 /* ComputedPropertyName */ &&\n            ts.isDeclaration(node.parent.parent);\n    }\n    ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName;\n    // Return true if the given identifier is classified as an IdentifierName\n    function isIdentifierName(node) {\n        var parent = node.parent;\n        switch (parent.kind) {\n            case 163 /* PropertyDeclaration */:\n            case 162 /* PropertySignature */:\n            case 165 /* MethodDeclaration */:\n            case 164 /* MethodSignature */:\n            case 167 /* GetAccessor */:\n            case 168 /* SetAccessor */:\n            case 291 /* EnumMember */:\n            case 288 /* PropertyAssignment */:\n            case 201 /* PropertyAccessExpression */:\n                // Name in member declaration or property name in property access\n                return parent.name === node;\n            case 157 /* QualifiedName */:\n                // Name on right hand side of dot in a type query or type reference\n                return parent.right === node;\n            case 198 /* BindingElement */:\n            case 265 /* ImportSpecifier */:\n                // Property name in binding element or import specifier\n                return parent.propertyName === node;\n            case 270 /* ExportSpecifier */:\n            case 280 /* JsxAttribute */:\n                // Any name in an export specifier or JSX Attribute\n                return true;\n        }\n        return false;\n    }\n    ts.isIdentifierName = isIdentifierName;\n    // An alias symbol is created by one of the following declarations:\n    // import <symbol> = ...\n    // import <symbol> from ...\n    // import * as <symbol> from ...\n    // import { x as <symbol> } from ...\n    // export { x as <symbol> } from ...\n    // export * as ns <symbol> from ...\n    // export = <EntityNameExpression>\n    // export default <EntityNameExpression>\n    // module.exports = <EntityNameExpression>\n    // {<Identifier>}\n    // {name: <EntityNameExpression>}\n    function isAliasSymbolDeclaration(node) {\n        return node.kind === 260 /* ImportEqualsDeclaration */ ||\n            node.kind === 259 /* NamespaceExportDeclaration */ ||\n            node.kind === 262 /* ImportClause */ && !!node.name ||\n            node.kind === 263 /* NamespaceImport */ ||\n            node.kind === 269 /* NamespaceExport */ ||\n            node.kind === 265 /* ImportSpecifier */ ||\n            node.kind === 270 /* ExportSpecifier */ ||\n            node.kind === 266 /* ExportAssignment */ && exportAssignmentIsAlias(node) ||\n            ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) ||\n            ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) ||\n            node.kind === 289 /* ShorthandPropertyAssignment */ ||\n            node.kind === 288 /* PropertyAssignment */ && isAliasableExpression(node.initializer);\n    }\n    ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration;\n    function getAliasDeclarationFromName(node) {\n        switch (node.parent.kind) {\n            case 262 /* ImportClause */:\n            case 265 /* ImportSpecifier */:\n            case 263 /* NamespaceImport */:\n            case 270 /* ExportSpecifier */:\n            case 266 /* ExportAssignment */:\n            case 260 /* ImportEqualsDeclaration */:\n                return node.parent;\n            case 157 /* QualifiedName */:\n                do {\n                    node = node.parent;\n                } while (node.parent.kind === 157 /* QualifiedName */);\n                return getAliasDeclarationFromName(node);\n        }\n    }\n    ts.getAliasDeclarationFromName = getAliasDeclarationFromName;\n    function isAliasableExpression(e) {\n        return isEntityNameExpression(e) || ts.isClassExpression(e);\n    }\n    ts.isAliasableExpression = isAliasableExpression;\n    function exportAssignmentIsAlias(node) {\n        var e = getExportAssignmentExpression(node);\n        return isAliasableExpression(e);\n    }\n    ts.exportAssignmentIsAlias = exportAssignmentIsAlias;\n    function getExportAssignmentExpression(node) {\n        return ts.isExportAssignment(node) ? node.expression : node.right;\n    }\n    ts.getExportAssignmentExpression = getExportAssignmentExpression;\n    function getPropertyAssignmentAliasLikeExpression(node) {\n        return node.kind === 289 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 288 /* PropertyAssignment */ ? node.initializer :\n            node.parent.right;\n    }\n    ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression;\n    function getEffectiveBaseTypeNode(node) {\n        var baseType = getClassExtendsHeritageElement(node);\n        if (baseType && isInJSFile(node)) {\n            // Prefer an @augments tag because it may have type parameters.\n            var tag = ts.getJSDocAugmentsTag(node);\n            if (tag) {\n                return tag.class;\n            }\n        }\n        return baseType;\n    }\n    ts.getEffectiveBaseTypeNode = getEffectiveBaseTypeNode;\n    function getClassExtendsHeritageElement(node) {\n        var heritageClause = getHeritageClause(node.heritageClauses, 93 /* ExtendsKeyword */);\n        return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined;\n    }\n    ts.getClassExtendsHeritageElement = getClassExtendsHeritageElement;\n    function getEffectiveImplementsTypeNodes(node) {\n        if (isInJSFile(node)) {\n            return ts.getJSDocImplementsTags(node).map(function (n) { return n.class; });\n        }\n        else {\n            var heritageClause = getHeritageClause(node.heritageClauses, 116 /* ImplementsKeyword */);\n            return heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.types;\n        }\n    }\n    ts.getEffectiveImplementsTypeNodes = getEffectiveImplementsTypeNodes;\n    /** Returns the node in an `extends` or `implements` clause of a class or interface. */\n    function getAllSuperTypeNodes(node) {\n        return ts.isInterfaceDeclaration(node) ? getInterfaceBaseTypeNodes(node) || ts.emptyArray :\n            ts.isClassLike(node) ? ts.concatenate(ts.singleElementArray(getEffectiveBaseTypeNode(node)), getEffectiveImplementsTypeNodes(node)) || ts.emptyArray :\n                ts.emptyArray;\n    }\n    ts.getAllSuperTypeNodes = getAllSuperTypeNodes;\n    function getInterfaceBaseTypeNodes(node) {\n        var heritageClause = getHeritageClause(node.heritageClauses, 93 /* ExtendsKeyword */);\n        return heritageClause ? heritageClause.types : undefined;\n    }\n    ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes;\n    function getHeritageClause(clauses, kind) {\n        if (clauses) {\n            for (var _i = 0, clauses_1 = clauses; _i < clauses_1.length; _i++) {\n                var clause = clauses_1[_i];\n                if (clause.token === kind) {\n                    return clause;\n                }\n            }\n        }\n        return undefined;\n    }\n    ts.getHeritageClause = getHeritageClause;\n    function getAncestor(node, kind) {\n        while (node) {\n            if (node.kind === kind) {\n                return node;\n            }\n            node = node.parent;\n        }\n        return undefined;\n    }\n    ts.getAncestor = getAncestor;\n    function isKeyword(token) {\n        return 80 /* FirstKeyword */ <= token && token <= 156 /* LastKeyword */;\n    }\n    ts.isKeyword = isKeyword;\n    function isContextualKeyword(token) {\n        return 125 /* FirstContextualKeyword */ <= token && token <= 156 /* LastContextualKeyword */;\n    }\n    ts.isContextualKeyword = isContextualKeyword;\n    function isNonContextualKeyword(token) {\n        return isKeyword(token) && !isContextualKeyword(token);\n    }\n    ts.isNonContextualKeyword = isNonContextualKeyword;\n    function isFutureReservedKeyword(token) {\n        return 116 /* FirstFutureReservedWord */ <= token && token <= 124 /* LastFutureReservedWord */;\n    }\n    ts.isFutureReservedKeyword = isFutureReservedKeyword;\n    function isStringANonContextualKeyword(name) {\n        var token = ts.stringToToken(name);\n        return token !== undefined && isNonContextualKeyword(token);\n    }\n    ts.isStringANonContextualKeyword = isStringANonContextualKeyword;\n    function isStringAKeyword(name) {\n        var token = ts.stringToToken(name);\n        return token !== undefined && isKeyword(token);\n    }\n    ts.isStringAKeyword = isStringAKeyword;\n    function isIdentifierANonContextualKeyword(_a) {\n        var originalKeywordKind = _a.originalKeywordKind;\n        return !!originalKeywordKind && !isContextualKeyword(originalKeywordKind);\n    }\n    ts.isIdentifierANonContextualKeyword = isIdentifierANonContextualKeyword;\n    function isTrivia(token) {\n        return 2 /* FirstTriviaToken */ <= token && token <= 7 /* LastTriviaToken */;\n    }\n    ts.isTrivia = isTrivia;\n    var FunctionFlags;\n    (function (FunctionFlags) {\n        FunctionFlags[FunctionFlags[\"Normal\"] = 0] = \"Normal\";\n        FunctionFlags[FunctionFlags[\"Generator\"] = 1] = \"Generator\";\n        FunctionFlags[FunctionFlags[\"Async\"] = 2] = \"Async\";\n        FunctionFlags[FunctionFlags[\"Invalid\"] = 4] = \"Invalid\";\n        FunctionFlags[FunctionFlags[\"AsyncGenerator\"] = 3] = \"AsyncGenerator\";\n    })(FunctionFlags = ts.FunctionFlags || (ts.FunctionFlags = {}));\n    function getFunctionFlags(node) {\n        if (!node) {\n            return 4 /* Invalid */;\n        }\n        var flags = 0 /* Normal */;\n        switch (node.kind) {\n            case 251 /* FunctionDeclaration */:\n            case 208 /* FunctionExpression */:\n            case 165 /* MethodDeclaration */:\n                if (node.asteriskToken) {\n                    flags |= 1 /* Generator */;\n                }\n            // falls through\n            case 209 /* ArrowFunction */:\n                if (hasSyntacticModifier(node, 256 /* Async */)) {\n                    flags |= 2 /* Async */;\n                }\n                break;\n        }\n        if (!node.body) {\n            flags |= 4 /* Invalid */;\n        }\n        return flags;\n    }\n    ts.getFunctionFlags = getFunctionFlags;\n    function isAsyncFunction(node) {\n        switch (node.kind) {\n            case 251 /* FunctionDeclaration */:\n            case 208 /* FunctionExpression */:\n            case 209 /* ArrowFunction */:\n            case 165 /* MethodDeclaration */:\n                return node.body !== undefined\n                    && node.asteriskToken === undefined\n                    && hasSyntacticModifier(node, 256 /* Async */);\n        }\n        return false;\n    }\n    ts.isAsyncFunction = isAsyncFunction;\n    function isStringOrNumericLiteralLike(node) {\n        return ts.isStringLiteralLike(node) || ts.isNumericLiteral(node);\n    }\n    ts.isStringOrNumericLiteralLike = isStringOrNumericLiteralLike;\n    function isSignedNumericLiteral(node) {\n        return ts.isPrefixUnaryExpression(node) && (node.operator === 39 /* PlusToken */ || node.operator === 40 /* MinusToken */) && ts.isNumericLiteral(node.operand);\n    }\n    ts.isSignedNumericLiteral = isSignedNumericLiteral;\n    /**\n     * A declaration has a dynamic name if all of the following are true:\n     *   1. The declaration has a computed property name.\n     *   2. The computed name is *not* expressed as a StringLiteral.\n     *   3. The computed name is *not* expressed as a NumericLiteral.\n     *   4. The computed name is *not* expressed as a PlusToken or MinusToken\n     *      immediately followed by a NumericLiteral.\n     *   5. The computed name is *not* expressed as `Symbol.<name>`, where `<name>`\n     *      is a property of the Symbol constructor that denotes a built-in\n     *      Symbol.\n     */\n    function hasDynamicName(declaration) {\n        var name = ts.getNameOfDeclaration(declaration);\n        return !!name && isDynamicName(name);\n    }\n    ts.hasDynamicName = hasDynamicName;\n    function isDynamicName(name) {\n        if (!(name.kind === 158 /* ComputedPropertyName */ || name.kind === 202 /* ElementAccessExpression */)) {\n            return false;\n        }\n        var expr = ts.isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression;\n        return !isStringOrNumericLiteralLike(expr) &&\n            !isSignedNumericLiteral(expr) &&\n            !isWellKnownSymbolSyntactically(expr);\n    }\n    ts.isDynamicName = isDynamicName;\n    /**\n     * Checks if the expression is of the form:\n     *    Symbol.name\n     * where Symbol is literally the word \"Symbol\", and name is any identifierName\n     */\n    function isWellKnownSymbolSyntactically(node) {\n        return ts.isPropertyAccessExpression(node) && isESSymbolIdentifier(node.expression);\n    }\n    ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically;\n    function getPropertyNameForPropertyNameNode(name) {\n        switch (name.kind) {\n            case 78 /* Identifier */:\n            case 79 /* PrivateIdentifier */:\n                return name.escapedText;\n            case 10 /* StringLiteral */:\n            case 8 /* NumericLiteral */:\n                return ts.escapeLeadingUnderscores(name.text);\n            case 158 /* ComputedPropertyName */:\n                var nameExpression = name.expression;\n                if (isWellKnownSymbolSyntactically(nameExpression)) {\n                    return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name));\n                }\n                else if (isStringOrNumericLiteralLike(nameExpression)) {\n                    return ts.escapeLeadingUnderscores(nameExpression.text);\n                }\n                else if (isSignedNumericLiteral(nameExpression)) {\n                    if (nameExpression.operator === 40 /* MinusToken */) {\n                        return ts.tokenToString(nameExpression.operator) + nameExpression.operand.text;\n                    }\n                    return nameExpression.operand.text;\n                }\n                return undefined;\n            default:\n                return ts.Debug.assertNever(name);\n        }\n    }\n    ts.getPropertyNameForPropertyNameNode = getPropertyNameForPropertyNameNode;\n    function isPropertyNameLiteral(node) {\n        switch (node.kind) {\n            case 78 /* Identifier */:\n            case 10 /* StringLiteral */:\n            case 14 /* NoSubstitutionTemplateLiteral */:\n            case 8 /* NumericLiteral */:\n                return true;\n            default:\n                return false;\n        }\n    }\n    ts.isPropertyNameLiteral = isPropertyNameLiteral;\n    function getTextOfIdentifierOrLiteral(node) {\n        return ts.isIdentifierOrPrivateIdentifier(node) ? ts.idText(node) : node.text;\n    }\n    ts.getTextOfIdentifierOrLiteral = getTextOfIdentifierOrLiteral;\n    function getEscapedTextOfIdentifierOrLiteral(node) {\n        return ts.isIdentifierOrPrivateIdentifier(node) ? node.escapedText : ts.escapeLeadingUnderscores(node.text);\n    }\n    ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral;\n    function getPropertyNameForUniqueESSymbol(symbol) {\n        return \"__@\" + ts.getSymbolId(symbol) + \"@\" + symbol.escapedName;\n    }\n    ts.getPropertyNameForUniqueESSymbol = getPropertyNameForUniqueESSymbol;\n    function getPropertyNameForKnownSymbolName(symbolName) {\n        return \"__@\" + symbolName;\n    }\n    ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName;\n    function getSymbolNameForPrivateIdentifier(containingClassSymbol, description) {\n        return \"__#\" + ts.getSymbolId(containingClassSymbol) + \"@\" + description;\n    }\n    ts.getSymbolNameForPrivateIdentifier = getSymbolNameForPrivateIdentifier;\n    function isKnownSymbol(symbol) {\n        return ts.startsWith(symbol.escapedName, \"__@\");\n    }\n    ts.isKnownSymbol = isKnownSymbol;\n    /**\n     * Includes the word \"Symbol\" with unicode escapes\n     */\n    function isESSymbolIdentifier(node) {\n        return node.kind === 78 /* Identifier */ && node.escapedText === \"Symbol\";\n    }\n    ts.isESSymbolIdentifier = isESSymbolIdentifier;\n    function isPushOrUnshiftIdentifier(node) {\n        return node.escapedText === \"push\" || node.escapedText === \"unshift\";\n    }\n    ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier;\n    function isParameterDeclaration(node) {\n        var root = getRootDeclaration(node);\n        return root.kind === 160 /* Parameter */;\n    }\n    ts.isParameterDeclaration = isParameterDeclaration;\n    function getRootDeclaration(node) {\n        while (node.kind === 198 /* BindingElement */) {\n            node = node.parent.parent;\n        }\n        return node;\n    }\n    ts.getRootDeclaration = getRootDeclaration;\n    function nodeStartsNewLexicalEnvironment(node) {\n        var kind = node.kind;\n        return kind === 166 /* Constructor */\n            || kind === 208 /* FunctionExpression */\n            || kind === 251 /* FunctionDeclaration */\n            || kind === 209 /* ArrowFunction */\n            || kind === 165 /* MethodDeclaration */\n            || kind === 167 /* GetAccessor */\n            || kind === 168 /* SetAccessor */\n            || kind === 256 /* ModuleDeclaration */\n            || kind === 297 /* SourceFile */;\n    }\n    ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment;\n    function nodeIsSynthesized(range) {\n        return positionIsSynthesized(range.pos)\n            || positionIsSynthesized(range.end);\n    }\n    ts.nodeIsSynthesized = nodeIsSynthesized;\n    function getOriginalSourceFile(sourceFile) {\n        return ts.getParseTreeNode(sourceFile, ts.isSourceFile) || sourceFile;\n    }\n    ts.getOriginalSourceFile = getOriginalSourceFile;\n    var Associativity;\n    (function (Associativity) {\n        Associativity[Associativity[\"Left\"] = 0] = \"Left\";\n        Associativity[Associativity[\"Right\"] = 1] = \"Right\";\n    })(Associativity = ts.Associativity || (ts.Associativity = {}));\n    function getExpressionAssociativity(expression) {\n        var operator = getOperator(expression);\n        var hasArguments = expression.kind === 204 /* NewExpression */ && expression.arguments !== undefined;\n        return getOperatorAssociativity(expression.kind, operator, hasArguments);\n    }\n    ts.getExpressionAssociativity = getExpressionAssociativity;\n    function getOperatorAssociativity(kind, operator, hasArguments) {\n        switch (kind) {\n            case 204 /* NewExpression */:\n                return hasArguments ? 0 /* Left */ : 1 /* Right */;\n            case 214 /* PrefixUnaryExpression */:\n            case 211 /* TypeOfExpression */:\n            case 212 /* VoidExpression */:\n            case 210 /* DeleteExpression */:\n            case 213 /* AwaitExpression */:\n            case 217 /* ConditionalExpression */:\n            case 219 /* YieldExpression */:\n                return 1 /* Right */;\n            case 216 /* BinaryExpression */:\n                switch (operator) {\n                    case 42 /* AsteriskAsteriskToken */:\n                    case 62 /* EqualsToken */:\n                    case 63 /* PlusEqualsToken */:\n                    case 64 /* MinusEqualsToken */:\n                    case 66 /* AsteriskAsteriskEqualsToken */:\n                    case 65 /* AsteriskEqualsToken */:\n                    case 67 /* SlashEqualsToken */:\n                    case 68 /* PercentEqualsToken */:\n                    case 69 /* LessThanLessThanEqualsToken */:\n                    case 70 /* GreaterThanGreaterThanEqualsToken */:\n                    case 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */:\n                    case 72 /* AmpersandEqualsToken */:\n                    case 77 /* CaretEqualsToken */:\n                    case 73 /* BarEqualsToken */:\n                    case 74 /* BarBarEqualsToken */:\n                    case 75 /* AmpersandAmpersandEqualsToken */:\n                    case 76 /* QuestionQuestionEqualsToken */:\n                        return 1 /* Right */;\n                }\n        }\n        return 0 /* Left */;\n    }\n    ts.getOperatorAssociativity = getOperatorAssociativity;\n    function getExpressionPrecedence(expression) {\n        var operator = getOperator(expression);\n        var hasArguments = expression.kind === 204 /* NewExpression */ && expression.arguments !== undefined;\n        return getOperatorPrecedence(expression.kind, operator, hasArguments);\n    }\n    ts.getExpressionPrecedence = getExpressionPrecedence;\n    function getOperator(expression) {\n        if (expression.kind === 216 /* BinaryExpression */) {\n            return expression.operatorToken.kind;\n        }\n        else if (expression.kind === 214 /* PrefixUnaryExpression */ || expression.kind === 215 /* PostfixUnaryExpression */) {\n            return expression.operator;\n        }\n        else {\n            return expression.kind;\n        }\n    }\n    ts.getOperator = getOperator;\n    var OperatorPrecedence;\n    (function (OperatorPrecedence) {\n        // Expression:\n        //     AssignmentExpression\n        //     Expression `,` AssignmentExpression\n        OperatorPrecedence[OperatorPrecedence[\"Comma\"] = 0] = \"Comma\";\n        // NOTE: `Spread` is higher than `Comma` due to how it is parsed in |ElementList|\n        // SpreadElement:\n        //     `...` AssignmentExpression\n        OperatorPrecedence[OperatorPrecedence[\"Spread\"] = 1] = \"Spread\";\n        // AssignmentExpression:\n        //     ConditionalExpression\n        //     YieldExpression\n        //     ArrowFunction\n        //     AsyncArrowFunction\n        //     LeftHandSideExpression `=` AssignmentExpression\n        //     LeftHandSideExpression AssignmentOperator AssignmentExpression\n        //\n        // NOTE: AssignmentExpression is broken down into several precedences due to the requirements\n        //       of the parenthesizer rules.\n        // AssignmentExpression: YieldExpression\n        // YieldExpression:\n        //     `yield`\n        //     `yield` AssignmentExpression\n        //     `yield` `*` AssignmentExpression\n        OperatorPrecedence[OperatorPrecedence[\"Yield\"] = 2] = \"Yield\";\n        // AssignmentExpression: LeftHandSideExpression `=` AssignmentExpression\n        // AssignmentExpression: LeftHandSideExpression AssignmentOperator AssignmentExpression\n        // AssignmentOperator: one of\n        //     `*=` `/=` `%=` `+=` `-=` `<<=` `>>=` `>>>=` `&=` `^=` `|=` `**=`\n        OperatorPrecedence[OperatorPrecedence[\"Assignment\"] = 3] = \"Assignment\";\n        // NOTE: `Conditional` is considered higher than `Assignment` here, but in reality they have\n        //       the same precedence.\n        // AssignmentExpression: ConditionalExpression\n        // ConditionalExpression:\n        //     ShortCircuitExpression\n        //     ShortCircuitExpression `?` AssignmentExpression `:` AssignmentExpression\n        // ShortCircuitExpression:\n        //     LogicalORExpression\n        //     CoalesceExpression\n        OperatorPrecedence[OperatorPrecedence[\"Conditional\"] = 4] = \"Conditional\";\n        // CoalesceExpression:\n        //     CoalesceExpressionHead `??` BitwiseORExpression\n        // CoalesceExpressionHead:\n        //     CoalesceExpression\n        //     BitwiseORExpression\n        OperatorPrecedence[OperatorPrecedence[\"Coalesce\"] = 4] = \"Coalesce\";\n        // LogicalORExpression:\n        //     LogicalANDExpression\n        //     LogicalORExpression `||` LogicalANDExpression\n        OperatorPrecedence[OperatorPrecedence[\"LogicalOR\"] = 5] = \"LogicalOR\";\n        // LogicalANDExpression:\n        //     BitwiseORExpression\n        //     LogicalANDExprerssion `&&` BitwiseORExpression\n        OperatorPrecedence[OperatorPrecedence[\"LogicalAND\"] = 6] = \"LogicalAND\";\n        // BitwiseORExpression:\n        //     BitwiseXORExpression\n        //     BitwiseORExpression `^` BitwiseXORExpression\n        OperatorPrecedence[OperatorPrecedence[\"BitwiseOR\"] = 7] = \"BitwiseOR\";\n        // BitwiseXORExpression:\n        //     BitwiseANDExpression\n        //     BitwiseXORExpression `^` BitwiseANDExpression\n        OperatorPrecedence[OperatorPrecedence[\"BitwiseXOR\"] = 8] = \"BitwiseXOR\";\n        // BitwiseANDExpression:\n        //     EqualityExpression\n        //     BitwiseANDExpression `^` EqualityExpression\n        OperatorPrecedence[OperatorPrecedence[\"BitwiseAND\"] = 9] = \"BitwiseAND\";\n        // EqualityExpression:\n        //     RelationalExpression\n        //     EqualityExpression `==` RelationalExpression\n        //     EqualityExpression `!=` RelationalExpression\n        //     EqualityExpression `===` RelationalExpression\n        //     EqualityExpression `!==` RelationalExpression\n        OperatorPrecedence[OperatorPrecedence[\"Equality\"] = 10] = \"Equality\";\n        // RelationalExpression:\n        //     ShiftExpression\n        //     RelationalExpression `<` ShiftExpression\n        //     RelationalExpression `>` ShiftExpression\n        //     RelationalExpression `<=` ShiftExpression\n        //     RelationalExpression `>=` ShiftExpression\n        //     RelationalExpression `instanceof` ShiftExpression\n        //     RelationalExpression `in` ShiftExpression\n        //     [+TypeScript] RelationalExpression `as` Type\n        OperatorPrecedence[OperatorPrecedence[\"Relational\"] = 11] = \"Relational\";\n        // ShiftExpression:\n        //     AdditiveExpression\n        //     ShiftExpression `<<` AdditiveExpression\n        //     ShiftExpression `>>` AdditiveExpression\n        //     ShiftExpression `>>>` AdditiveExpression\n        OperatorPrecedence[OperatorPrecedence[\"Shift\"] = 12] = \"Shift\";\n        // AdditiveExpression:\n        //     MultiplicativeExpression\n        //     AdditiveExpression `+` MultiplicativeExpression\n        //     AdditiveExpression `-` MultiplicativeExpression\n        OperatorPrecedence[OperatorPrecedence[\"Additive\"] = 13] = \"Additive\";\n        // MultiplicativeExpression:\n        //     ExponentiationExpression\n        //     MultiplicativeExpression MultiplicativeOperator ExponentiationExpression\n        // MultiplicativeOperator: one of `*`, `/`, `%`\n        OperatorPrecedence[OperatorPrecedence[\"Multiplicative\"] = 14] = \"Multiplicative\";\n        // ExponentiationExpression:\n        //     UnaryExpression\n        //     UpdateExpression `**` ExponentiationExpression\n        OperatorPrecedence[OperatorPrecedence[\"Exponentiation\"] = 15] = \"Exponentiation\";\n        // UnaryExpression:\n        //     UpdateExpression\n        //     `delete` UnaryExpression\n        //     `void` UnaryExpression\n        //     `typeof` UnaryExpression\n        //     `+` UnaryExpression\n        //     `-` UnaryExpression\n        //     `~` UnaryExpression\n        //     `!` UnaryExpression\n        //     AwaitExpression\n        // UpdateExpression:            // TODO: Do we need to investigate the precedence here?\n        //     `++` UnaryExpression\n        //     `--` UnaryExpression\n        OperatorPrecedence[OperatorPrecedence[\"Unary\"] = 16] = \"Unary\";\n        // UpdateExpression:\n        //     LeftHandSideExpression\n        //     LeftHandSideExpression `++`\n        //     LeftHandSideExpression `--`\n        OperatorPrecedence[OperatorPrecedence[\"Update\"] = 17] = \"Update\";\n        // LeftHandSideExpression:\n        //     NewExpression\n        //     CallExpression\n        // NewExpression:\n        //     MemberExpression\n        //     `new` NewExpression\n        OperatorPrecedence[OperatorPrecedence[\"LeftHandSide\"] = 18] = \"LeftHandSide\";\n        // CallExpression:\n        //     CoverCallExpressionAndAsyncArrowHead\n        //     SuperCall\n        //     ImportCall\n        //     CallExpression Arguments\n        //     CallExpression `[` Expression `]`\n        //     CallExpression `.` IdentifierName\n        //     CallExpression TemplateLiteral\n        // MemberExpression:\n        //     PrimaryExpression\n        //     MemberExpression `[` Expression `]`\n        //     MemberExpression `.` IdentifierName\n        //     MemberExpression TemplateLiteral\n        //     SuperProperty\n        //     MetaProperty\n        //     `new` MemberExpression Arguments\n        OperatorPrecedence[OperatorPrecedence[\"Member\"] = 19] = \"Member\";\n        // TODO: JSXElement?\n        // PrimaryExpression:\n        //     `this`\n        //     IdentifierReference\n        //     Literal\n        //     ArrayLiteral\n        //     ObjectLiteral\n        //     FunctionExpression\n        //     ClassExpression\n        //     GeneratorExpression\n        //     AsyncFunctionExpression\n        //     AsyncGeneratorExpression\n        //     RegularExpressionLiteral\n        //     TemplateLiteral\n        //     CoverParenthesizedExpressionAndArrowParameterList\n        OperatorPrecedence[OperatorPrecedence[\"Primary\"] = 20] = \"Primary\";\n        OperatorPrecedence[OperatorPrecedence[\"Highest\"] = 20] = \"Highest\";\n        OperatorPrecedence[OperatorPrecedence[\"Lowest\"] = 0] = \"Lowest\";\n        // -1 is lower than all other precedences. Returning it will cause binary expression\n        // parsing to stop.\n        OperatorPrecedence[OperatorPrecedence[\"Invalid\"] = -1] = \"Invalid\";\n    })(OperatorPrecedence = ts.OperatorPrecedence || (ts.OperatorPrecedence = {}));\n    function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {\n        switch (nodeKind) {\n            case 337 /* CommaListExpression */:\n                return 0 /* Comma */;\n            case 220 /* SpreadElement */:\n                return 1 /* Spread */;\n            case 219 /* YieldExpression */:\n                return 2 /* Yield */;\n            case 217 /* ConditionalExpression */:\n                return 4 /* Conditional */;\n            case 216 /* BinaryExpression */:\n                switch (operatorKind) {\n                    case 27 /* CommaToken */:\n                        return 0 /* Comma */;\n                    case 62 /* EqualsToken */:\n                    case 63 /* PlusEqualsToken */:\n                    case 64 /* MinusEqualsToken */:\n                    case 66 /* AsteriskAsteriskEqualsToken */:\n                    case 65 /* AsteriskEqualsToken */:\n                    case 67 /* SlashEqualsToken */:\n                    case 68 /* PercentEqualsToken */:\n                    case 69 /* LessThanLessThanEqualsToken */:\n                    case 70 /* GreaterThanGreaterThanEqualsToken */:\n                    case 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */:\n                    case 72 /* AmpersandEqualsToken */:\n                    case 77 /* CaretEqualsToken */:\n                    case 73 /* BarEqualsToken */:\n                    case 74 /* BarBarEqualsToken */:\n                    case 75 /* AmpersandAmpersandEqualsToken */:\n                    case 76 /* QuestionQuestionEqualsToken */:\n                        return 3 /* Assignment */;\n                    default:\n                        return getBinaryOperatorPrecedence(operatorKind);\n                }\n            // TODO: Should prefix `++` and `--` be moved to the `Update` precedence?\n            case 206 /* TypeAssertionExpression */:\n            case 225 /* NonNullExpression */:\n            case 214 /* PrefixUnaryExpression */:\n            case 211 /* TypeOfExpression */:\n            case 212 /* VoidExpression */:\n            case 210 /* DeleteExpression */:\n            case 213 /* AwaitExpression */:\n                return 16 /* Unary */;\n            case 215 /* PostfixUnaryExpression */:\n                return 17 /* Update */;\n            case 203 /* CallExpression */:\n                return 18 /* LeftHandSide */;\n            case 204 /* NewExpression */:\n                return hasArguments ? 19 /* Member */ : 18 /* LeftHandSide */;\n            case 205 /* TaggedTemplateExpression */:\n            case 201 /* PropertyAccessExpression */:\n            case 202 /* ElementAccessExpression */:\n                return 19 /* Member */;\n            case 224 /* AsExpression */:\n                return 11 /* Relational */;\n            case 107 /* ThisKeyword */:\n            case 105 /* SuperKeyword */:\n            case 78 /* Identifier */:\n            case 103 /* NullKeyword */:\n            case 109 /* TrueKeyword */:\n            case 94 /* FalseKeyword */:\n            case 8 /* NumericLiteral */:\n            case 9 /* BigIntLiteral */:\n            case 10 /* StringLiteral */:\n            case 199 /* ArrayLiteralExpression */:\n            case 200 /* ObjectLiteralExpression */:\n            case 208 /* FunctionExpression */:\n            case 209 /* ArrowFunction */:\n            case 221 /* ClassExpression */:\n            case 13 /* RegularExpressionLiteral */:\n            case 14 /* NoSubstitutionTemplateLiteral */:\n            case 218 /* TemplateExpression */:\n            case 207 /* ParenthesizedExpression */:\n            case 222 /* OmittedExpression */:\n            case 273 /* JsxElement */:\n            case 274 /* JsxSelfClosingElement */:\n            case 277 /* JsxFragment */:\n                return 20 /* Primary */;\n            default:\n                return -1 /* Invalid */;\n        }\n    }\n    ts.getOperatorPrecedence = getOperatorPrecedence;\n    function getBinaryOperatorPrecedence(kind) {\n        switch (kind) {\n            case 60 /* QuestionQuestionToken */:\n                return 4 /* Coalesce */;\n            case 56 /* BarBarToken */:\n                return 5 /* LogicalOR */;\n            case 55 /* AmpersandAmpersandToken */:\n                return 6 /* LogicalAND */;\n            case 51 /* BarToken */:\n                return 7 /* BitwiseOR */;\n            case 52 /* CaretToken */:\n                return 8 /* BitwiseXOR */;\n            case 50 /* AmpersandToken */:\n                return 9 /* BitwiseAND */;\n            case 34 /* EqualsEqualsToken */:\n            case 35 /* ExclamationEqualsToken */:\n            case 36 /* EqualsEqualsEqualsToken */:\n            case 37 /* ExclamationEqualsEqualsToken */:\n                return 10 /* Equality */;\n            case 29 /* LessThanToken */:\n            case 31 /* GreaterThanToken */:\n            case 32 /* LessThanEqualsToken */:\n            case 33 /* GreaterThanEqualsToken */:\n            case 101 /* InstanceOfKeyword */:\n            case 100 /* InKeyword */:\n            case 126 /* AsKeyword */:\n                return 11 /* Relational */;\n            case 47 /* LessThanLessThanToken */:\n            case 48 /* GreaterThanGreaterThanToken */:\n            case 49 /* GreaterThanGreaterThanGreaterThanToken */:\n                return 12 /* Shift */;\n            case 39 /* PlusToken */:\n            case 40 /* MinusToken */:\n                return 13 /* Additive */;\n            case 41 /* AsteriskToken */:\n            case 43 /* SlashToken */:\n            case 44 /* PercentToken */:\n                return 14 /* Multiplicative */;\n            case 42 /* AsteriskAsteriskToken */:\n                return 15 /* Exponentiation */;\n        }\n        // -1 is lower than all other precedences.  Returning it will cause binary expression\n        // parsing to stop.\n        return -1;\n    }\n    ts.getBinaryOperatorPrecedence = getBinaryOperatorPrecedence;\n    function getSemanticJsxChildren(children) {\n        return ts.filter(children, function (i) {\n            switch (i.kind) {\n                case 283 /* JsxExpression */:\n                    return !!i.expression;\n                case 11 /* JsxText */:\n                    return !i.containsOnlyTriviaWhiteSpaces;\n                default:\n                    return true;\n            }\n        });\n    }\n    ts.getSemanticJsxChildren = getSemanticJsxChildren;\n    function createDiagnosticCollection() {\n        var nonFileDiagnostics = []; // See GH#19873\n        var filesWithDiagnostics = [];\n        var fileDiagnostics = new ts.Map();\n        var hasReadNonFileDiagnostics = false;\n        return {\n            add: add,\n            lookup: lookup,\n            getGlobalDiagnostics: getGlobalDiagnostics,\n            getDiagnostics: getDiagnostics,\n        };\n        function lookup(diagnostic) {\n            var diagnostics;\n            if (diagnostic.file) {\n                diagnostics = fileDiagnostics.get(diagnostic.file.fileName);\n            }\n            else {\n                diagnostics = nonFileDiagnostics;\n            }\n            if (!diagnostics) {\n                return undefined;\n            }\n            var result = ts.binarySearch(diagnostics, diagnostic, ts.identity, compareDiagnosticsSkipRelatedInformation);\n            if (result >= 0) {\n                return diagnostics[result];\n            }\n            return undefined;\n        }\n        function add(diagnostic) {\n            var diagnostics;\n            if (diagnostic.file) {\n                diagnostics = fileDiagnostics.get(diagnostic.file.fileName);\n                if (!diagnostics) {\n                    diagnostics = []; // See GH#19873\n                    fileDiagnostics.set(diagnostic.file.fileName, diagnostics);\n                    ts.insertSorted(filesWithDiagnostics, diagnostic.file.fileName, ts.compareStringsCaseSensitive);\n                }\n            }\n            else {\n                // If we've already read the non-file diagnostics, do not modify the existing array.\n                if (hasReadNonFileDiagnostics) {\n                    hasReadNonFileDiagnostics = false;\n                    nonFileDiagnostics = nonFileDiagnostics.slice();\n                }\n                diagnostics = nonFileDiagnostics;\n            }\n            ts.insertSorted(diagnostics, diagnostic, compareDiagnostics);\n        }\n        function getGlobalDiagnostics() {\n            hasReadNonFileDiagnostics = true;\n            return nonFileDiagnostics;\n        }\n        function getDiagnostics(fileName) {\n            if (fileName) {\n                return fileDiagnostics.get(fileName) || [];\n            }\n            var fileDiags = ts.flatMapToMutable(filesWithDiagnostics, function (f) { return fileDiagnostics.get(f); });\n            if (!nonFileDiagnostics.length) {\n                return fileDiags;\n            }\n            fileDiags.unshift.apply(fileDiags, nonFileDiagnostics);\n            return fileDiags;\n        }\n    }\n    ts.createDiagnosticCollection = createDiagnosticCollection;\n    var templateSubstitutionRegExp = /\\$\\{/g;\n    function escapeTemplateSubstitution(str) {\n        return str.replace(templateSubstitutionRegExp, \"\\\\${\");\n    }\n    /** @internal */\n    function hasInvalidEscape(template) {\n        return template && !!(ts.isNoSubstitutionTemplateLiteral(template)\n            ? template.templateFlags\n            : (template.head.templateFlags || ts.some(template.templateSpans, function (span) { return !!span.literal.templateFlags; })));\n    }\n    ts.hasInvalidEscape = hasInvalidEscape;\n    // This consists of the first 19 unprintable ASCII characters, canonical escapes, lineSeparator,\n    // paragraphSeparator, and nextLine. The latter three are just desirable to suppress new lines in\n    // the language service. These characters should be escaped when printing, and if any characters are added,\n    // the map below must be updated. Note that this regexp *does not* include the 'delete' character.\n    // There is no reason for this other than that JSON.stringify does not handle it either.\n    var doubleQuoteEscapedCharsRegExp = /[\\\\\\\"\\u0000-\\u001f\\t\\v\\f\\b\\r\\n\\u2028\\u2029\\u0085]/g;\n    var singleQuoteEscapedCharsRegExp = /[\\\\\\'\\u0000-\\u001f\\t\\v\\f\\b\\r\\n\\u2028\\u2029\\u0085]/g;\n    // Template strings should be preserved as much as possible\n    var backtickQuoteEscapedCharsRegExp = /[\\\\`]/g;\n    var escapedCharsMap = new ts.Map(ts.getEntries({\n        \"\\t\": \"\\\\t\",\n        \"\\v\": \"\\\\v\",\n        \"\\f\": \"\\\\f\",\n        \"\\b\": \"\\\\b\",\n        \"\\r\": \"\\\\r\",\n        \"\\n\": \"\\\\n\",\n        \"\\\\\": \"\\\\\\\\\",\n        \"\\\"\": \"\\\\\\\"\",\n        \"\\'\": \"\\\\\\'\",\n        \"\\`\": \"\\\\\\`\",\n        \"\\u2028\": \"\\\\u2028\",\n        \"\\u2029\": \"\\\\u2029\",\n        \"\\u0085\": \"\\\\u0085\" // nextLine\n    }));\n    function encodeUtf16EscapeSequence(charCode) {\n        var hexCharCode = charCode.toString(16).toUpperCase();\n        var paddedHexCode = (\"0000\" + hexCharCode).slice(-4);\n        return \"\\\\u\" + paddedHexCode;\n    }\n    function getReplacement(c, offset, input) {\n        if (c.charCodeAt(0) === 0 /* nullCharacter */) {\n            var lookAhead = input.charCodeAt(offset + c.length);\n            if (lookAhead >= 48 /* _0 */ && lookAhead <= 57 /* _9 */) {\n                // If the null character is followed by digits, print as a hex escape to prevent the result from parsing as an octal (which is forbidden in strict mode)\n                return \"\\\\x00\";\n            }\n            // Otherwise, keep printing a literal \\0 for the null character\n            return \"\\\\0\";\n        }\n        return escapedCharsMap.get(c) || encodeUtf16EscapeSequence(c.charCodeAt(0));\n    }\n    /**\n     * Based heavily on the abstract 'Quote'/'QuoteJSONString' operation from ECMA-262 (24.3.2.2),\n     * but augmented for a few select characters (e.g. lineSeparator, paragraphSeparator, nextLine)\n     * Note that this doesn't actually wrap the input in double quotes.\n     */\n    function escapeString(s, quoteChar) {\n        var escapedCharsRegExp = quoteChar === 96 /* backtick */ ? backtickQuoteEscapedCharsRegExp :\n            quoteChar === 39 /* singleQuote */ ? singleQuoteEscapedCharsRegExp :\n                doubleQuoteEscapedCharsRegExp;\n        return s.replace(escapedCharsRegExp, getReplacement);\n    }\n    ts.escapeString = escapeString;\n    var nonAsciiCharacters = /[^\\u0000-\\u007F]/g;\n    function escapeNonAsciiString(s, quoteChar) {\n        s = escapeString(s, quoteChar);\n        // Replace non-ASCII characters with '\\uNNNN' escapes if any exist.\n        // Otherwise just return the original string.\n        return nonAsciiCharacters.test(s) ?\n            s.replace(nonAsciiCharacters, function (c) { return encodeUtf16EscapeSequence(c.charCodeAt(0)); }) :\n            s;\n    }\n    ts.escapeNonAsciiString = escapeNonAsciiString;\n    // This consists of the first 19 unprintable ASCII characters, JSX canonical escapes, lineSeparator,\n    // paragraphSeparator, and nextLine. The latter three are just desirable to suppress new lines in\n    // the language service. These characters should be escaped when printing, and if any characters are added,\n    // the map below must be updated.\n    var jsxDoubleQuoteEscapedCharsRegExp = /[\\\"\\u0000-\\u001f\\u2028\\u2029\\u0085]/g;\n    var jsxSingleQuoteEscapedCharsRegExp = /[\\'\\u0000-\\u001f\\u2028\\u2029\\u0085]/g;\n    var jsxEscapedCharsMap = new ts.Map(ts.getEntries({\n        \"\\\"\": \"&quot;\",\n        \"\\'\": \"&apos;\"\n    }));\n    function encodeJsxCharacterEntity(charCode) {\n        var hexCharCode = charCode.toString(16).toUpperCase();\n        return \"&#x\" + hexCharCode + \";\";\n    }\n    function getJsxAttributeStringReplacement(c) {\n        if (c.charCodeAt(0) === 0 /* nullCharacter */) {\n            return \"&#0;\";\n        }\n        return jsxEscapedCharsMap.get(c) || encodeJsxCharacterEntity(c.charCodeAt(0));\n    }\n    function escapeJsxAttributeString(s, quoteChar) {\n        var escapedCharsRegExp = quoteChar === 39 /* singleQuote */ ? jsxSingleQuoteEscapedCharsRegExp :\n            jsxDoubleQuoteEscapedCharsRegExp;\n        return s.replace(escapedCharsRegExp, getJsxAttributeStringReplacement);\n    }\n    ts.escapeJsxAttributeString = escapeJsxAttributeString;\n    /**\n     * Strip off existed surrounding single quotes, double quotes, or backticks from a given string\n     *\n     * @return non-quoted string\n     */\n    function stripQuotes(name) {\n        var length = name.length;\n        if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && isQuoteOrBacktick(name.charCodeAt(0))) {\n            return name.substring(1, length - 1);\n        }\n        return name;\n    }\n    ts.stripQuotes = stripQuotes;\n    function isQuoteOrBacktick(charCode) {\n        return charCode === 39 /* singleQuote */ ||\n            charCode === 34 /* doubleQuote */ ||\n            charCode === 96 /* backtick */;\n    }\n    function isIntrinsicJsxName(name) {\n        var ch = name.charCodeAt(0);\n        return (ch >= 97 /* a */ && ch <= 122 /* z */) || ts.stringContains(name, \"-\") || ts.stringContains(name, \":\");\n    }\n    ts.isIntrinsicJsxName = isIntrinsicJsxName;\n    var indentStrings = [\"\", \"    \"];\n    function getIndentString(level) {\n        // prepopulate cache\n        var singleLevel = indentStrings[1];\n        for (var current = indentStrings.length; current <= level; current++) {\n            indentStrings.push(indentStrings[current - 1] + singleLevel);\n        }\n        return indentStrings[level];\n    }\n    ts.getIndentString = getIndentString;\n    function getIndentSize() {\n        return indentStrings[1].length;\n    }\n    ts.getIndentSize = getIndentSize;\n    function createTextWriter(newLine) {\n        var output;\n        var indent;\n        var lineStart;\n        var lineCount;\n        var linePos;\n        var hasTrailingComment = false;\n        function updateLineCountAndPosFor(s) {\n            var lineStartsOfS = ts.computeLineStarts(s);\n            if (lineStartsOfS.length > 1) {\n                lineCount = lineCount + lineStartsOfS.length - 1;\n                linePos = output.length - s.length + ts.last(lineStartsOfS);\n                lineStart = (linePos - output.length) === 0;\n            }\n            else {\n                lineStart = false;\n            }\n        }\n        function writeText(s) {\n            if (s && s.length) {\n                if (lineStart) {\n                    s = getIndentString(indent) + s;\n                    lineStart = false;\n                }\n                output += s;\n                updateLineCountAndPosFor(s);\n            }\n        }\n        function write(s) {\n            if (s)\n                hasTrailingComment = false;\n            writeText(s);\n        }\n        function writeComment(s) {\n            if (s)\n                hasTrailingComment = true;\n            writeText(s);\n        }\n        function reset() {\n            output = \"\";\n            indent = 0;\n            lineStart = true;\n            lineCount = 0;\n            linePos = 0;\n            hasTrailingComment = false;\n        }\n        function rawWrite(s) {\n            if (s !== undefined) {\n                output += s;\n                updateLineCountAndPosFor(s);\n                hasTrailingComment = false;\n            }\n        }\n        function writeLiteral(s) {\n            if (s && s.length) {\n                write(s);\n            }\n        }\n        function writeLine(force) {\n            if (!lineStart || force) {\n                output += newLine;\n                lineCount++;\n                linePos = output.length;\n                lineStart = true;\n                hasTrailingComment = false;\n            }\n        }\n        function getTextPosWithWriteLine() {\n            return lineStart ? output.length : (output.length + newLine.length);\n        }\n        reset();\n        return {\n            write: write,\n            rawWrite: rawWrite,\n            writeLiteral: writeLiteral,\n            writeLine: writeLine,\n            increaseIndent: function () { indent++; },\n            decreaseIndent: function () { indent--; },\n            getIndent: function () { return indent; },\n            getTextPos: function () { return output.length; },\n            getLine: function () { return lineCount; },\n            getColumn: function () { return lineStart ? indent * getIndentSize() : output.length - linePos; },\n            getText: function () { return output; },\n            isAtStartOfLine: function () { return lineStart; },\n            hasTrailingComment: function () { return hasTrailingComment; },\n            hasTrailingWhitespace: function () { return !!output.length && ts.isWhiteSpaceLike(output.charCodeAt(output.length - 1)); },\n            clear: reset,\n            reportInaccessibleThisError: ts.noop,\n            reportPrivateInBaseOfClassExpression: ts.noop,\n            reportInaccessibleUniqueSymbolError: ts.noop,\n            trackSymbol: ts.noop,\n            writeKeyword: write,\n            writeOperator: write,\n            writeParameter: write,\n            writeProperty: write,\n            writePunctuation: write,\n            writeSpace: write,\n            writeStringLiteral: write,\n            writeSymbol: function (s, _) { return write(s); },\n            writeTrailingSemicolon: write,\n            writeComment: writeComment,\n            getTextPosWithWriteLine: getTextPosWithWriteLine\n        };\n    }\n    ts.createTextWriter = createTextWriter;\n    function getTrailingSemicolonDeferringWriter(writer) {\n        var pendingTrailingSemicolon = false;\n        function commitPendingTrailingSemicolon() {\n            if (pendingTrailingSemicolon) {\n                writer.writeTrailingSemicolon(\";\");\n                pendingTrailingSemicolon = false;\n            }\n        }\n        return __assign(__assign({}, writer), { writeTrailingSemicolon: function () {\n                pendingTrailingSemicolon = true;\n            },\n            writeLiteral: function (s) {\n                commitPendingTrailingSemicolon();\n                writer.writeLiteral(s);\n            },\n            writeStringLiteral: function (s) {\n                commitPendingTrailingSemicolon();\n                writer.writeStringLiteral(s);\n            },\n            writeSymbol: function (s, sym) {\n                commitPendingTrailingSemicolon();\n                writer.writeSymbol(s, sym);\n            },\n            writePunctuation: function (s) {\n                commitPendingTrailingSemicolon();\n                writer.writePunctuation(s);\n            },\n            writeKeyword: function (s) {\n                commitPendingTrailingSemicolon();\n                writer.writeKeyword(s);\n            },\n            writeOperator: function (s) {\n                commitPendingTrailingSemicolon();\n                writer.writeOperator(s);\n            },\n            writeParameter: function (s) {\n                commitPendingTrailingSemicolon();\n                writer.writeParameter(s);\n            },\n            writeSpace: function (s) {\n                commitPendingTrailingSemicolon();\n                writer.writeSpace(s);\n            },\n            writeProperty: function (s) {\n                commitPendingTrailingSemicolon();\n                writer.writeProperty(s);\n            },\n            writeComment: function (s) {\n                commitPendingTrailingSemicolon();\n                writer.writeComment(s);\n            },\n            writeLine: function () {\n                commitPendingTrailingSemicolon();\n                writer.writeLine();\n            },\n            increaseIndent: function () {\n                commitPendingTrailingSemicolon();\n                writer.increaseIndent();\n            },\n            decreaseIndent: function () {\n                commitPendingTrailingSemicolon();\n                writer.decreaseIndent();\n            } });\n    }\n    ts.getTrailingSemicolonDeferringWriter = getTrailingSemicolonDeferringWriter;\n    function hostUsesCaseSensitiveFileNames(host) {\n        return host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : false;\n    }\n    ts.hostUsesCaseSensitiveFileNames = hostUsesCaseSensitiveFileNames;\n    function hostGetCanonicalFileName(host) {\n        return ts.createGetCanonicalFileName(hostUsesCaseSensitiveFileNames(host));\n    }\n    ts.hostGetCanonicalFileName = hostGetCanonicalFileName;\n    function getResolvedExternalModuleName(host, file, referenceFile) {\n        return file.moduleName || getExternalModuleNameFromPath(host, file.fileName, referenceFile && referenceFile.fileName);\n    }\n    ts.getResolvedExternalModuleName = getResolvedExternalModuleName;\n    function getCanonicalAbsolutePath(host, path) {\n        return host.getCanonicalFileName(ts.getNormalizedAbsolutePath(path, host.getCurrentDirectory()));\n    }\n    function getExternalModuleNameFromDeclaration(host, resolver, declaration) {\n        var file = resolver.getExternalModuleFileFromDeclaration(declaration);\n        if (!file || file.isDeclarationFile) {\n            return undefined;\n        }\n        // If the declaration already uses a non-relative name, and is outside the common source directory, continue to use it\n        var specifier = getExternalModuleName(declaration);\n        if (specifier && ts.isStringLiteralLike(specifier) && !ts.pathIsRelative(specifier.text) &&\n            getCanonicalAbsolutePath(host, file.path).indexOf(getCanonicalAbsolutePath(host, ts.ensureTrailingDirectorySeparator(host.getCommonSourceDirectory()))) === -1) {\n            return undefined;\n        }\n        return getResolvedExternalModuleName(host, file);\n    }\n    ts.getExternalModuleNameFromDeclaration = getExternalModuleNameFromDeclaration;\n    /**\n     * Resolves a local path to a path which is absolute to the base of the emit\n     */\n    function getExternalModuleNameFromPath(host, fileName, referencePath) {\n        var getCanonicalFileName = function (f) { return host.getCanonicalFileName(f); };\n        var dir = ts.toPath(referencePath ? ts.getDirectoryPath(referencePath) : host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName);\n        var filePath = ts.getNormalizedAbsolutePath(fileName, host.getCurrentDirectory());\n        var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, filePath, dir, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false);\n        var extensionless = removeFileExtension(relativePath);\n        return referencePath ? ts.ensurePathIsNonModuleName(extensionless) : extensionless;\n    }\n    ts.getExternalModuleNameFromPath = getExternalModuleNameFromPath;\n    function getOwnEmitOutputFilePath(fileName, host, extension) {\n        var compilerOptions = host.getCompilerOptions();\n        var emitOutputFilePathWithoutExtension;\n        if (compilerOptions.outDir) {\n            emitOutputFilePathWithoutExtension = removeFileExtension(getSourceFilePathInNewDir(fileName, host, compilerOptions.outDir));\n        }\n        else {\n            emitOutputFilePathWithoutExtension = removeFileExtension(fileName);\n        }\n        return emitOutputFilePathWithoutExtension + extension;\n    }\n    ts.getOwnEmitOutputFilePath = getOwnEmitOutputFilePath;\n    function getDeclarationEmitOutputFilePath(fileName, host) {\n        return getDeclarationEmitOutputFilePathWorker(fileName, host.getCompilerOptions(), host.getCurrentDirectory(), host.getCommonSourceDirectory(), function (f) { return host.getCanonicalFileName(f); });\n    }\n    ts.getDeclarationEmitOutputFilePath = getDeclarationEmitOutputFilePath;\n    function getDeclarationEmitOutputFilePathWorker(fileName, options, currentDirectory, commonSourceDirectory, getCanonicalFileName) {\n        var outputDir = options.declarationDir || options.outDir; // Prefer declaration folder if specified\n        var path = outputDir\n            ? getSourceFilePathInNewDirWorker(fileName, outputDir, currentDirectory, commonSourceDirectory, getCanonicalFileName)\n            : fileName;\n        return removeFileExtension(path) + \".d.ts\" /* Dts */;\n    }\n    ts.getDeclarationEmitOutputFilePathWorker = getDeclarationEmitOutputFilePathWorker;\n    function outFile(options) {\n        return options.outFile || options.out;\n    }\n    ts.outFile = outFile;\n    /** Returns 'undefined' if and only if 'options.paths' is undefined. */\n    function getPathsBasePath(options, host) {\n        var _a, _b;\n        if (!options.paths)\n            return undefined;\n        return (_a = options.baseUrl) !== null && _a !== void 0 ? _a : ts.Debug.checkDefined(options.pathsBasePath || ((_b = host.getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(host)), \"Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'.\");\n    }\n    ts.getPathsBasePath = getPathsBasePath;\n    /**\n     * Gets the source files that are expected to have an emit output.\n     *\n     * Originally part of `forEachExpectedEmitFile`, this functionality was extracted to support\n     * transformations.\n     *\n     * @param host An EmitHost.\n     * @param targetSourceFile An optional target source file to emit.\n     */\n    function getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit) {\n        var options = host.getCompilerOptions();\n        if (outFile(options)) {\n            var moduleKind = getEmitModuleKind(options);\n            var moduleEmitEnabled_1 = options.emitDeclarationOnly || moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System;\n            // Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified\n            return ts.filter(host.getSourceFiles(), function (sourceFile) {\n                return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) &&\n                    sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit);\n            });\n        }\n        else {\n            var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile];\n            return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit); });\n        }\n    }\n    ts.getSourceFilesToEmit = getSourceFilesToEmit;\n    /** Don't call this for `--outFile`, just for `--outDir` or plain emit. `--outFile` needs additional checks. */\n    function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) {\n        var options = host.getCompilerOptions();\n        return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) &&\n            !sourceFile.isDeclarationFile &&\n            !host.isSourceFileFromExternalLibrary(sourceFile) &&\n            !(isJsonSourceFile(sourceFile) && host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) &&\n            (forceDtsEmit || !host.isSourceOfProjectReferenceRedirect(sourceFile.fileName));\n    }\n    ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted;\n    function getSourceFilePathInNewDir(fileName, host, newDirPath) {\n        return getSourceFilePathInNewDirWorker(fileName, newDirPath, host.getCurrentDirectory(), host.getCommonSourceDirectory(), function (f) { return host.getCanonicalFileName(f); });\n    }\n    ts.getSourceFilePathInNewDir = getSourceFilePathInNewDir;\n    function getSourceFilePathInNewDirWorker(fileName, newDirPath, currentDirectory, commonSourceDirectory, getCanonicalFileName) {\n        var sourceFilePath = ts.getNormalizedAbsolutePath(fileName, currentDirectory);\n        var isSourceFileInCommonSourceDirectory = getCanonicalFileName(sourceFilePath).indexOf(getCanonicalFileName(commonSourceDirectory)) === 0;\n        sourceFilePath = isSourceFileInCommonSourceDirectory ? sourceFilePath.substring(commonSourceDirectory.length) : sourceFilePath;\n        return ts.combinePaths(newDirPath, sourceFilePath);\n    }\n    ts.getSourceFilePathInNewDirWorker = getSourceFilePathInNewDirWorker;\n    function writeFile(host, diagnostics, fileName, data, writeByteOrderMark, sourceFiles) {\n        host.writeFile(fileName, data, writeByteOrderMark, function (hostErrorMessage) {\n            diagnostics.add(createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage));\n        }, sourceFiles);\n    }\n    ts.writeFile = writeFile;\n    function ensureDirectoriesExist(directoryPath, createDirectory, directoryExists) {\n        if (directoryPath.length > ts.getRootLength(directoryPath) && !directoryExists(directoryPath)) {\n            var parentDirectory = ts.getDirectoryPath(directoryPath);\n            ensureDirectoriesExist(parentDirectory, createDirectory, directoryExists);\n            createDirectory(directoryPath);\n        }\n    }\n    function writeFileEnsuringDirectories(path, data, writeByteOrderMark, writeFile, createDirectory, directoryExists) {\n        // PERF: Checking for directory existence is expensive.  Instead, assume the directory exists\n        // and fall back to creating it if the file write fails.\n        try {\n            writeFile(path, data, writeByteOrderMark);\n        }\n        catch (_a) {\n            ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(path)), createDirectory, directoryExists);\n            writeFile(path, data, writeByteOrderMark);\n        }\n    }\n    ts.writeFileEnsuringDirectories = writeFileEnsuringDirectories;\n    function getLineOfLocalPosition(sourceFile, pos) {\n        var lineStarts = ts.getLineStarts(sourceFile);\n        return ts.computeLineOfPosition(lineStarts, pos);\n    }\n    ts.getLineOfLocalPosition = getLineOfLocalPosition;\n    function getLineOfLocalPositionFromLineMap(lineMap, pos) {\n        return ts.computeLineOfPosition(lineMap, pos);\n    }\n    ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap;\n    function getFirstConstructorWithBody(node) {\n        return ts.find(node.members, function (member) { return ts.isConstructorDeclaration(member) && nodeIsPresent(member.body); });\n    }\n    ts.getFirstConstructorWithBody = getFirstConstructorWithBody;\n    function getSetAccessorValueParameter(accessor) {\n        if (accessor && accessor.parameters.length > 0) {\n            var hasThis = accessor.parameters.length === 2 && parameterIsThisKeyword(accessor.parameters[0]);\n            return accessor.parameters[hasThis ? 1 : 0];\n        }\n    }\n    ts.getSetAccessorValueParameter = getSetAccessorValueParameter;\n    /** Get the type annotation for the value parameter. */\n    function getSetAccessorTypeAnnotationNode(accessor) {\n        var parameter = getSetAccessorValueParameter(accessor);\n        return parameter && parameter.type;\n    }\n    ts.getSetAccessorTypeAnnotationNode = getSetAccessorTypeAnnotationNode;\n    function getThisParameter(signature) {\n        // callback tags do not currently support this parameters\n        if (signature.parameters.length && !ts.isJSDocSignature(signature)) {\n            var thisParameter = signature.parameters[0];\n            if (parameterIsThisKeyword(thisParameter)) {\n                return thisParameter;\n            }\n        }\n    }\n    ts.getThisParameter = getThisParameter;\n    function parameterIsThisKeyword(parameter) {\n        return isThisIdentifier(parameter.name);\n    }\n    ts.parameterIsThisKeyword = parameterIsThisKeyword;\n    function isThisIdentifier(node) {\n        return !!node && node.kind === 78 /* Identifier */ && identifierIsThisKeyword(node);\n    }\n    ts.isThisIdentifier = isThisIdentifier;\n    function identifierIsThisKeyword(id) {\n        return id.originalKeywordKind === 107 /* ThisKeyword */;\n    }\n    ts.identifierIsThisKeyword = identifierIsThisKeyword;\n    function getAllAccessorDeclarations(declarations, accessor) {\n        // TODO: GH#18217\n        var firstAccessor;\n        var secondAccessor;\n        var getAccessor;\n        var setAccessor;\n        if (hasDynamicName(accessor)) {\n            firstAccessor = accessor;\n            if (accessor.kind === 167 /* GetAccessor */) {\n                getAccessor = accessor;\n            }\n            else if (accessor.kind === 168 /* SetAccessor */) {\n                setAccessor = accessor;\n            }\n            else {\n                ts.Debug.fail(\"Accessor has wrong kind\");\n            }\n        }\n        else {\n            ts.forEach(declarations, function (member) {\n                if (ts.isAccessor(member)\n                    && hasSyntacticModifier(member, 32 /* Static */) === hasSyntacticModifier(accessor, 32 /* Static */)) {\n                    var memberName = getPropertyNameForPropertyNameNode(member.name);\n                    var accessorName = getPropertyNameForPropertyNameNode(accessor.name);\n                    if (memberName === accessorName) {\n                        if (!firstAccessor) {\n                            firstAccessor = member;\n                        }\n                        else if (!secondAccessor) {\n                            secondAccessor = member;\n                        }\n                        if (member.kind === 167 /* GetAccessor */ && !getAccessor) {\n                            getAccessor = member;\n                        }\n                        if (member.kind === 168 /* SetAccessor */ && !setAccessor) {\n                            setAccessor = member;\n                        }\n                    }\n                }\n            });\n        }\n        return {\n            firstAccessor: firstAccessor,\n            secondAccessor: secondAccessor,\n            getAccessor: getAccessor,\n            setAccessor: setAccessor\n        };\n    }\n    ts.getAllAccessorDeclarations = getAllAccessorDeclarations;\n    /**\n     * Gets the effective type annotation of a variable, parameter, or property. If the node was\n     * parsed in a JavaScript file, gets the type annotation from JSDoc.  Also gets the type of\n     * functions only the JSDoc case.\n     */\n    function getEffectiveTypeAnnotationNode(node) {\n        if (!isInJSFile(node) && ts.isFunctionDeclaration(node))\n            return undefined;\n        var type = node.type;\n        if (type || !isInJSFile(node))\n            return type;\n        return ts.isJSDocPropertyLikeTag(node) ? node.typeExpression && node.typeExpression.type : ts.getJSDocType(node);\n    }\n    ts.getEffectiveTypeAnnotationNode = getEffectiveTypeAnnotationNode;\n    function getTypeAnnotationNode(node) {\n        return node.type;\n    }\n    ts.getTypeAnnotationNode = getTypeAnnotationNode;\n    /**\n     * Gets the effective return type annotation of a signature. If the node was parsed in a\n     * JavaScript file, gets the return type annotation from JSDoc.\n     */\n    function getEffectiveReturnTypeNode(node) {\n        return ts.isJSDocSignature(node) ?\n            node.type && node.type.typeExpression && node.type.typeExpression.type :\n            node.type || (isInJSFile(node) ? ts.getJSDocReturnType(node) : undefined);\n    }\n    ts.getEffectiveReturnTypeNode = getEffectiveReturnTypeNode;\n    function getJSDocTypeParameterDeclarations(node) {\n        return ts.flatMap(ts.getJSDocTags(node), function (tag) { return isNonTypeAliasTemplate(tag) ? tag.typeParameters : undefined; });\n    }\n    ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations;\n    /** template tags are only available when a typedef isn't already using them */\n    function isNonTypeAliasTemplate(tag) {\n        return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 311 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias));\n    }\n    /**\n     * Gets the effective type annotation of the value parameter of a set accessor. If the node\n     * was parsed in a JavaScript file, gets the type annotation from JSDoc.\n     */\n    function getEffectiveSetAccessorTypeAnnotationNode(node) {\n        var parameter = getSetAccessorValueParameter(node);\n        return parameter && getEffectiveTypeAnnotationNode(parameter);\n    }\n    ts.getEffectiveSetAccessorTypeAnnotationNode = getEffectiveSetAccessorTypeAnnotationNode;\n    function emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments) {\n        emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, node.pos, leadingComments);\n    }\n    ts.emitNewLineBeforeLeadingComments = emitNewLineBeforeLeadingComments;\n    function emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, pos, leadingComments) {\n        // If the leading comments start on different line than the start of node, write new line\n        if (leadingComments && leadingComments.length && pos !== leadingComments[0].pos &&\n            getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, leadingComments[0].pos)) {\n            writer.writeLine();\n        }\n    }\n    ts.emitNewLineBeforeLeadingCommentsOfPosition = emitNewLineBeforeLeadingCommentsOfPosition;\n    function emitNewLineBeforeLeadingCommentOfPosition(lineMap, writer, pos, commentPos) {\n        // If the leading comments start on different line than the start of node, write new line\n        if (pos !== commentPos &&\n            getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, commentPos)) {\n            writer.writeLine();\n        }\n    }\n    ts.emitNewLineBeforeLeadingCommentOfPosition = emitNewLineBeforeLeadingCommentOfPosition;\n    function emitComments(text, lineMap, writer, comments, leadingSeparator, trailingSeparator, newLine, writeComment) {\n        if (comments && comments.length > 0) {\n            if (leadingSeparator) {\n                writer.writeSpace(\" \");\n            }\n            var emitInterveningSeparator = false;\n            for (var _i = 0, comments_1 = comments; _i < comments_1.length; _i++) {\n                var comment = comments_1[_i];\n                if (emitInterveningSeparator) {\n                    writer.writeSpace(\" \");\n                    emitInterveningSeparator = false;\n                }\n                writeComment(text, lineMap, writer, comment.pos, comment.end, newLine);\n                if (comment.hasTrailingNewLine) {\n                    writer.writeLine();\n                }\n                else {\n                    emitInterveningSeparator = true;\n                }\n            }\n            if (emitInterveningSeparator && trailingSeparator) {\n                writer.writeSpace(\" \");\n            }\n        }\n    }\n    ts.emitComments = emitComments;\n    /**\n     * Detached comment is a comment at the top of file or function body that is separated from\n     * the next statement by space.\n     */\n    function emitDetachedComments(text, lineMap, writer, writeComment, node, newLine, removeComments) {\n        var leadingComments;\n        var currentDetachedCommentInfo;\n        if (removeComments) {\n            // removeComments is true, only reserve pinned comment at the top of file\n            // For example:\n            //      /*! Pinned Comment */\n            //\n            //      var x = 10;\n            if (node.pos === 0) {\n                leadingComments = ts.filter(ts.getLeadingCommentRanges(text, node.pos), isPinnedCommentLocal);\n            }\n        }\n        else {\n            // removeComments is false, just get detached as normal and bypass the process to filter comment\n            leadingComments = ts.getLeadingCommentRanges(text, node.pos);\n        }\n        if (leadingComments) {\n            var detachedComments = [];\n            var lastComment = void 0;\n            for (var _i = 0, leadingComments_1 = leadingComments; _i < leadingComments_1.length; _i++) {\n                var comment = leadingComments_1[_i];\n                if (lastComment) {\n                    var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, lastComment.end);\n                    var commentLine = getLineOfLocalPositionFromLineMap(lineMap, comment.pos);\n                    if (commentLine >= lastCommentLine + 2) {\n                        // There was a blank line between the last comment and this comment.  This\n                        // comment is not part of the copyright comments.  Return what we have so\n                        // far.\n                        break;\n                    }\n                }\n                detachedComments.push(comment);\n                lastComment = comment;\n            }\n            if (detachedComments.length) {\n                // All comments look like they could have been part of the copyright header.  Make\n                // sure there is at least one blank line between it and the node.  If not, it's not\n                // a copyright header.\n                var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, ts.last(detachedComments).end);\n                var nodeLine = getLineOfLocalPositionFromLineMap(lineMap, ts.skipTrivia(text, node.pos));\n                if (nodeLine >= lastCommentLine + 2) {\n                    // Valid detachedComments\n                    emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments);\n                    emitComments(text, lineMap, writer, detachedComments, /*leadingSeparator*/ false, /*trailingSeparator*/ true, newLine, writeComment);\n                    currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.last(detachedComments).end };\n                }\n            }\n        }\n        return currentDetachedCommentInfo;\n        function isPinnedCommentLocal(comment) {\n            return isPinnedComment(text, comment.pos);\n        }\n    }\n    ts.emitDetachedComments = emitDetachedComments;\n    function writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine) {\n        if (text.charCodeAt(commentPos + 1) === 42 /* asterisk */) {\n            var firstCommentLineAndCharacter = ts.computeLineAndCharacterOfPosition(lineMap, commentPos);\n            var lineCount = lineMap.length;\n            var firstCommentLineIndent = void 0;\n            for (var pos = commentPos, currentLine = firstCommentLineAndCharacter.line; pos < commentEnd; currentLine++) {\n                var nextLineStart = (currentLine + 1) === lineCount\n                    ? text.length + 1\n                    : lineMap[currentLine + 1];\n                if (pos !== commentPos) {\n                    // If we are not emitting first line, we need to write the spaces to adjust the alignment\n                    if (firstCommentLineIndent === undefined) {\n                        firstCommentLineIndent = calculateIndent(text, lineMap[firstCommentLineAndCharacter.line], commentPos);\n                    }\n                    // These are number of spaces writer is going to write at current indent\n                    var currentWriterIndentSpacing = writer.getIndent() * getIndentSize();\n                    // Number of spaces we want to be writing\n                    // eg: Assume writer indent\n                    // module m {\n                    //         /* starts at character 9 this is line 1\n                    //    * starts at character pos 4 line                        --1  = 8 - 8 + 3\n                    //   More left indented comment */                            --2  = 8 - 8 + 2\n                    //     class c { }\n                    // }\n                    // module m {\n                    //     /* this is line 1 -- Assume current writer indent 8\n                    //      * line                                                --3 = 8 - 4 + 5\n                    //            More right indented comment */                  --4 = 8 - 4 + 11\n                    //     class c { }\n                    // }\n                    var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(text, pos, nextLineStart);\n                    if (spacesToEmit > 0) {\n                        var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize();\n                        var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize());\n                        // Write indent size string ( in eg 1: = \"\", 2: \"\" , 3: string with 8 spaces 4: string with 12 spaces\n                        writer.rawWrite(indentSizeSpaceString);\n                        // Emit the single spaces (in eg: 1: 3 spaces, 2: 2 spaces, 3: 1 space, 4: 3 spaces)\n                        while (numberOfSingleSpacesToEmit) {\n                            writer.rawWrite(\" \");\n                            numberOfSingleSpacesToEmit--;\n                        }\n                    }\n                    else {\n                        // No spaces to emit write empty string\n                        writer.rawWrite(\"\");\n                    }\n                }\n                // Write the comment line text\n                writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart);\n                pos = nextLineStart;\n            }\n        }\n        else {\n            // Single line comment of style //....\n            writer.writeComment(text.substring(commentPos, commentEnd));\n        }\n    }\n    ts.writeCommentRange = writeCommentRange;\n    function writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart) {\n        var end = Math.min(commentEnd, nextLineStart - 1);\n        var currentLineText = text.substring(pos, end).replace(/^\\s+|\\s+$/g, \"\");\n        if (currentLineText) {\n            // trimmed forward and ending spaces text\n            writer.writeComment(currentLineText);\n            if (end !== commentEnd) {\n                writer.writeLine();\n            }\n        }\n        else {\n            // Empty string - make sure we write empty line\n            writer.rawWrite(newLine);\n        }\n    }\n    function calculateIndent(text, pos, end) {\n        var currentLineIndent = 0;\n        for (; pos < end && ts.isWhiteSpaceSingleLine(text.charCodeAt(pos)); pos++) {\n            if (text.charCodeAt(pos) === 9 /* tab */) {\n                // Tabs = TabSize = indent size and go to next tabStop\n                currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize());\n            }\n            else {\n                // Single space\n                currentLineIndent++;\n            }\n        }\n        return currentLineIndent;\n    }\n    function hasEffectiveModifiers(node) {\n        return getEffectiveModifierFlags(node) !== 0 /* None */;\n    }\n    ts.hasEffectiveModifiers = hasEffectiveModifiers;\n    function hasSyntacticModifiers(node) {\n        return getSyntacticModifierFlags(node) !== 0 /* None */;\n    }\n    ts.hasSyntacticModifiers = hasSyntacticModifiers;\n    function hasEffectiveModifier(node, flags) {\n        return !!getSelectedEffectiveModifierFlags(node, flags);\n    }\n    ts.hasEffectiveModifier = hasEffectiveModifier;\n    function hasSyntacticModifier(node, flags) {\n        return !!getSelectedSyntacticModifierFlags(node, flags);\n    }\n    ts.hasSyntacticModifier = hasSyntacticModifier;\n    function hasStaticModifier(node) {\n        return hasSyntacticModifier(node, 32 /* Static */);\n    }\n    ts.hasStaticModifier = hasStaticModifier;\n    function hasEffectiveReadonlyModifier(node) {\n        return hasEffectiveModifier(node, 64 /* Readonly */);\n    }\n    ts.hasEffectiveReadonlyModifier = hasEffectiveReadonlyModifier;\n    function getSelectedEffectiveModifierFlags(node, flags) {\n        return getEffectiveModifierFlags(node) & flags;\n    }\n    ts.getSelectedEffectiveModifierFlags = getSelectedEffectiveModifierFlags;\n    function getSelectedSyntacticModifierFlags(node, flags) {\n        return getSyntacticModifierFlags(node) & flags;\n    }\n    ts.getSelectedSyntacticModifierFlags = getSelectedSyntacticModifierFlags;\n    function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) {\n        if (node.kind >= 0 /* FirstToken */ && node.kind <= 156 /* LastToken */) {\n            return 0 /* None */;\n        }\n        if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) {\n            node.modifierFlagsCache = getSyntacticModifierFlagsNoCache(node) | 536870912 /* HasComputedFlags */;\n        }\n        if (includeJSDoc && !(node.modifierFlagsCache & 4096 /* HasComputedJSDocModifiers */) && (alwaysIncludeJSDoc || isInJSFile(node)) && node.parent) {\n            node.modifierFlagsCache |= getJSDocModifierFlagsNoCache(node) | 4096 /* HasComputedJSDocModifiers */;\n        }\n        return node.modifierFlagsCache & ~(536870912 /* HasComputedFlags */ | 4096 /* HasComputedJSDocModifiers */);\n    }\n    /**\n     * Gets the effective ModifierFlags for the provided node, including JSDoc modifiers. The modifiers will be cached on the node to improve performance.\n     *\n     * NOTE: This function may use `parent` pointers.\n     */\n    function getEffectiveModifierFlags(node) {\n        return getModifierFlagsWorker(node, /*includeJSDoc*/ true);\n    }\n    ts.getEffectiveModifierFlags = getEffectiveModifierFlags;\n    function getEffectiveModifierFlagsAlwaysIncludeJSDoc(node) {\n        return getModifierFlagsWorker(node, /*includeJSDOc*/ true, /*alwaysIncludeJSDOc*/ true);\n    }\n    ts.getEffectiveModifierFlagsAlwaysIncludeJSDoc = getEffectiveModifierFlagsAlwaysIncludeJSDoc;\n    /**\n     * Gets the ModifierFlags for syntactic modifiers on the provided node. The modifiers will be cached on the node to improve performance.\n     *\n     * NOTE: This function does not use `parent` pointers and will not include modifiers from JSDoc.\n     */\n    function getSyntacticModifierFlags(node) {\n        return getModifierFlagsWorker(node, /*includeJSDoc*/ false);\n    }\n    ts.getSyntacticModifierFlags = getSyntacticModifierFlags;\n    function getJSDocModifierFlagsNoCache(node) {\n        var flags = 0 /* None */;\n        if (!!node.parent && !ts.isParameter(node)) {\n            if (isInJSFile(node)) {\n                if (ts.getJSDocPublicTagNoCache(node))\n                    flags |= 4 /* Public */;\n                if (ts.getJSDocPrivateTagNoCache(node))\n                    flags |= 8 /* Private */;\n                if (ts.getJSDocProtectedTagNoCache(node))\n                    flags |= 16 /* Protected */;\n                if (ts.getJSDocReadonlyTagNoCache(node))\n                    flags |= 64 /* Readonly */;\n            }\n            if (ts.getJSDocDeprecatedTagNoCache(node))\n                flags |= 8192 /* Deprecated */;\n        }\n        return flags;\n    }\n    /**\n     * Gets the effective ModifierFlags for the provided node, including JSDoc modifiers. The modifier flags cache on the node is ignored.\n     *\n     * NOTE: This function may use `parent` pointers.\n     */\n    function getEffectiveModifierFlagsNoCache(node) {\n        return getSyntacticModifierFlagsNoCache(node) | getJSDocModifierFlagsNoCache(node);\n    }\n    ts.getEffectiveModifierFlagsNoCache = getEffectiveModifierFlagsNoCache;\n    /**\n     * Gets the ModifierFlags for syntactic modifiers on the provided node. The modifier flags cache on the node is ignored.\n     *\n     * NOTE: This function does not use `parent` pointers and will not include modifiers from JSDoc.\n     */\n    function getSyntacticModifierFlagsNoCache(node) {\n        var flags = modifiersToFlags(node.modifiers);\n        if (node.flags & 4 /* NestedNamespace */ || (node.kind === 78 /* Identifier */ && node.isInJSDocNamespace)) {\n            flags |= 1 /* Export */;\n        }\n        return flags;\n    }\n    ts.getSyntacticModifierFlagsNoCache = getSyntacticModifierFlagsNoCache;\n    function modifiersToFlags(modifiers) {\n        var flags = 0 /* None */;\n        if (modifiers) {\n            for (var _i = 0, modifiers_1 = modifiers; _i < modifiers_1.length; _i++) {\n                var modifier = modifiers_1[_i];\n                flags |= modifierToFlag(modifier.kind);\n            }\n        }\n        return flags;\n    }\n    ts.modifiersToFlags = modifiersToFlags;\n    function modifierToFlag(token) {\n        switch (token) {\n            case 123 /* StaticKeyword */: return 32 /* Static */;\n            case 122 /* PublicKeyword */: return 4 /* Public */;\n            case 121 /* ProtectedKeyword */: return 16 /* Protected */;\n            case 120 /* PrivateKeyword */: return 8 /* Private */;\n            case 125 /* AbstractKeyword */: return 128 /* Abstract */;\n            case 92 /* ExportKeyword */: return 1 /* Export */;\n            case 133 /* DeclareKeyword */: return 2 /* Ambient */;\n            case 84 /* ConstKeyword */: return 2048 /* Const */;\n            case 87 /* DefaultKeyword */: return 512 /* Default */;\n            case 129 /* AsyncKeyword */: return 256 /* Async */;\n            case 142 /* ReadonlyKeyword */: return 64 /* Readonly */;\n        }\n        return 0 /* None */;\n    }\n    ts.modifierToFlag = modifierToFlag;\n    function isLogicalOperator(token) {\n        return token === 56 /* BarBarToken */\n            || token === 55 /* AmpersandAmpersandToken */\n            || token === 53 /* ExclamationToken */;\n    }\n    ts.isLogicalOperator = isLogicalOperator;\n    function isLogicalOrCoalescingAssignmentOperator(token) {\n        return token === 74 /* BarBarEqualsToken */\n            || token === 75 /* AmpersandAmpersandEqualsToken */\n            || token === 76 /* QuestionQuestionEqualsToken */;\n    }\n    ts.isLogicalOrCoalescingAssignmentOperator = isLogicalOrCoalescingAssignmentOperator;\n    function isLogicalOrCoalescingAssignmentExpression(expr) {\n        return isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind);\n    }\n    ts.isLogicalOrCoalescingAssignmentExpression = isLogicalOrCoalescingAssignmentExpression;\n    function isAssignmentOperator(token) {\n        return token >= 62 /* FirstAssignment */ && token <= 77 /* LastAssignment */;\n    }\n    ts.isAssignmentOperator = isAssignmentOperator;\n    /** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */\n    function tryGetClassExtendingExpressionWithTypeArguments(node) {\n        var cls = tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node);\n        return cls && !cls.isImplements ? cls.class : undefined;\n    }\n    ts.tryGetClassExtendingExpressionWithTypeArguments = tryGetClassExtendingExpressionWithTypeArguments;\n    function tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node) {\n        return ts.isExpressionWithTypeArguments(node)\n            && ts.isHeritageClause(node.parent)\n            && ts.isClassLike(node.parent.parent)\n            ? { class: node.parent.parent, isImplements: node.parent.token === 116 /* ImplementsKeyword */ }\n            : undefined;\n    }\n    ts.tryGetClassImplementingOrExtendingExpressionWithTypeArguments = tryGetClassImplementingOrExtendingExpressionWithTypeArguments;\n    function isAssignmentExpression(node, excludeCompoundAssignment) {\n        return ts.isBinaryExpression(node)\n            && (excludeCompoundAssignment\n                ? node.operatorToken.kind === 62 /* EqualsToken */\n                : isAssignmentOperator(node.operatorToken.kind))\n            && ts.isLeftHandSideExpression(node.left);\n    }\n    ts.isAssignmentExpression = isAssignmentExpression;\n    function isDestructuringAssignment(node) {\n        if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) {\n            var kind = node.left.kind;\n            return kind === 200 /* ObjectLiteralExpression */\n                || kind === 199 /* ArrayLiteralExpression */;\n        }\n        return false;\n    }\n    ts.isDestructuringAssignment = isDestructuringAssignment;\n    function isExpressionWithTypeArgumentsInClassExtendsClause(node) {\n        return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined;\n    }\n    ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause;\n    function isEntityNameExpression(node) {\n        return node.kind === 78 /* Identifier */ || isPropertyAccessEntityNameExpression(node);\n    }\n    ts.isEntityNameExpression = isEntityNameExpression;\n    function getFirstIdentifier(node) {\n        switch (node.kind) {\n            case 78 /* Identifier */:\n                return node;\n            case 157 /* QualifiedName */:\n                do {\n                    node = node.left;\n                } while (node.kind !== 78 /* Identifier */);\n                return node;\n            case 201 /* PropertyAccessExpression */:\n                do {\n                    node = node.expression;\n                } while (node.kind !== 78 /* Identifier */);\n                return node;\n        }\n    }\n    ts.getFirstIdentifier = getFirstIdentifier;\n    function isDottedName(node) {\n        return node.kind === 78 /* Identifier */ || node.kind === 107 /* ThisKeyword */ || node.kind === 105 /* SuperKeyword */ ||\n            node.kind === 201 /* PropertyAccessExpression */ && isDottedName(node.expression) ||\n            node.kind === 207 /* ParenthesizedExpression */ && isDottedName(node.expression);\n    }\n    ts.isDottedName = isDottedName;\n    function isPropertyAccessEntityNameExpression(node) {\n        return ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && isEntityNameExpression(node.expression);\n    }\n    ts.isPropertyAccessEntityNameExpression = isPropertyAccessEntityNameExpression;\n    function tryGetPropertyAccessOrIdentifierToString(expr) {\n        if (ts.isPropertyAccessExpression(expr)) {\n            var baseStr = tryGetPropertyAccessOrIdentifierToString(expr.expression);\n            if (baseStr !== undefined) {\n                return baseStr + \".\" + entityNameToString(expr.name);\n            }\n        }\n        else if (ts.isElementAccessExpression(expr)) {\n            var baseStr = tryGetPropertyAccessOrIdentifierToString(expr.expression);\n            if (baseStr !== undefined && ts.isPropertyName(expr.argumentExpression)) {\n                return baseStr + \".\" + getPropertyNameForPropertyNameNode(expr.argumentExpression);\n            }\n        }\n        else if (ts.isIdentifier(expr)) {\n            return ts.unescapeLeadingUnderscores(expr.escapedText);\n        }\n        return undefined;\n    }\n    ts.tryGetPropertyAccessOrIdentifierToString = tryGetPropertyAccessOrIdentifierToString;\n    function isPrototypeAccess(node) {\n        return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === \"prototype\";\n    }\n    ts.isPrototypeAccess = isPrototypeAccess;\n    function isRightSideOfQualifiedNameOrPropertyAccess(node) {\n        return (node.parent.kind === 157 /* QualifiedName */ && node.parent.right === node) ||\n            (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.name === node);\n    }\n    ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess;\n    function isEmptyObjectLiteral(expression) {\n        return expression.kind === 200 /* ObjectLiteralExpression */ &&\n            expression.properties.length === 0;\n    }\n    ts.isEmptyObjectLiteral = isEmptyObjectLiteral;\n    function isEmptyArrayLiteral(expression) {\n        return expression.kind === 199 /* ArrayLiteralExpression */ &&\n            expression.elements.length === 0;\n    }\n    ts.isEmptyArrayLiteral = isEmptyArrayLiteral;\n    function getLocalSymbolForExportDefault(symbol) {\n        if (!isExportDefaultSymbol(symbol))\n            return undefined;\n        for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n            var decl = _a[_i];\n            if (decl.localSymbol)\n                return decl.localSymbol;\n        }\n        return undefined;\n    }\n    ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault;\n    function isExportDefaultSymbol(symbol) {\n        return symbol && ts.length(symbol.declarations) > 0 && hasSyntacticModifier(symbol.declarations[0], 512 /* Default */);\n    }\n    /** Return \".ts\", \".d.ts\", or \".tsx\", if that is the extension. */\n    function tryExtractTSExtension(fileName) {\n        return ts.find(ts.supportedTSExtensionsForExtractExtension, function (extension) { return ts.fileExtensionIs(fileName, extension); });\n    }\n    ts.tryExtractTSExtension = tryExtractTSExtension;\n    /**\n     * Replace each instance of non-ascii characters by one, two, three, or four escape sequences\n     * representing the UTF-8 encoding of the character, and return the expanded char code list.\n     */\n    function getExpandedCharCodes(input) {\n        var output = [];\n        var length = input.length;\n        for (var i = 0; i < length; i++) {\n            var charCode = input.charCodeAt(i);\n            // handle utf8\n            if (charCode < 0x80) {\n                output.push(charCode);\n            }\n            else if (charCode < 0x800) {\n                output.push((charCode >> 6) | 192);\n                output.push((charCode & 63) | 128);\n            }\n            else if (charCode < 0x10000) {\n                output.push((charCode >> 12) | 224);\n                output.push(((charCode >> 6) & 63) | 128);\n                output.push((charCode & 63) | 128);\n            }\n            else if (charCode < 0x20000) {\n                output.push((charCode >> 18) | 240);\n                output.push(((charCode >> 12) & 63) | 128);\n                output.push(((charCode >> 6) & 63) | 128);\n                output.push((charCode & 63) | 128);\n            }\n            else {\n                ts.Debug.assert(false, \"Unexpected code point\");\n            }\n        }\n        return output;\n    }\n    var base64Digits = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n    /**\n     * Converts a string to a base-64 encoded ASCII string.\n     */\n    function convertToBase64(input) {\n        var result = \"\";\n        var charCodes = getExpandedCharCodes(input);\n        var i = 0;\n        var length = charCodes.length;\n        var byte1, byte2, byte3, byte4;\n        while (i < length) {\n            // Convert every 6-bits in the input 3 character points\n            // into a base64 digit\n            byte1 = charCodes[i] >> 2;\n            byte2 = (charCodes[i] & 3) << 4 | charCodes[i + 1] >> 4;\n            byte3 = (charCodes[i + 1] & 15) << 2 | charCodes[i + 2] >> 6;\n            byte4 = charCodes[i + 2] & 63;\n            // We are out of characters in the input, set the extra\n            // digits to 64 (padding character).\n            if (i + 1 >= length) {\n                byte3 = byte4 = 64;\n            }\n            else if (i + 2 >= length) {\n                byte4 = 64;\n            }\n            // Write to the output\n            result += base64Digits.charAt(byte1) + base64Digits.charAt(byte2) + base64Digits.charAt(byte3) + base64Digits.charAt(byte4);\n            i += 3;\n        }\n        return result;\n    }\n    ts.convertToBase64 = convertToBase64;\n    function getStringFromExpandedCharCodes(codes) {\n        var output = \"\";\n        var i = 0;\n        var length = codes.length;\n        while (i < length) {\n            var charCode = codes[i];\n            if (charCode < 0x80) {\n                output += String.fromCharCode(charCode);\n                i++;\n            }\n            else if ((charCode & 192) === 192) {\n                var value = charCode & 63;\n                i++;\n                var nextCode = codes[i];\n                while ((nextCode & 192) === 128) {\n                    value = (value << 6) | (nextCode & 63);\n                    i++;\n                    nextCode = codes[i];\n                }\n                // `value` may be greater than 10FFFF (the maximum unicode codepoint) - JS will just make this into an invalid character for us\n                output += String.fromCharCode(value);\n            }\n            else {\n                // We don't want to kill the process when decoding fails (due to a following char byte not\n                // following a leading char), so we just print the (bad) value\n                output += String.fromCharCode(charCode);\n                i++;\n            }\n        }\n        return output;\n    }\n    function base64encode(host, input) {\n        if (host && host.base64encode) {\n            return host.base64encode(input);\n        }\n        return convertToBase64(input);\n    }\n    ts.base64encode = base64encode;\n    function base64decode(host, input) {\n        if (host && host.base64decode) {\n            return host.base64decode(input);\n        }\n        var length = input.length;\n        var expandedCharCodes = [];\n        var i = 0;\n        while (i < length) {\n            // Stop decoding once padding characters are present\n            if (input.charCodeAt(i) === base64Digits.charCodeAt(64)) {\n                break;\n            }\n            // convert 4 input digits into three characters, ignoring padding characters at the end\n            var ch1 = base64Digits.indexOf(input[i]);\n            var ch2 = base64Digits.indexOf(input[i + 1]);\n            var ch3 = base64Digits.indexOf(input[i + 2]);\n            var ch4 = base64Digits.indexOf(input[i + 3]);\n            var code1 = ((ch1 & 63) << 2) | ((ch2 >> 4) & 3);\n            var code2 = ((ch2 & 15) << 4) | ((ch3 >> 2) & 15);\n            var code3 = ((ch3 & 3) << 6) | (ch4 & 63);\n            if (code2 === 0 && ch3 !== 0) { // code2 decoded to zero, but ch3 was padding - elide code2 and code3\n                expandedCharCodes.push(code1);\n            }\n            else if (code3 === 0 && ch4 !== 0) { // code3 decoded to zero, but ch4 was padding, elide code3\n                expandedCharCodes.push(code1, code2);\n            }\n            else {\n                expandedCharCodes.push(code1, code2, code3);\n            }\n            i += 4;\n        }\n        return getStringFromExpandedCharCodes(expandedCharCodes);\n    }\n    ts.base64decode = base64decode;\n    function readJson(path, host) {\n        try {\n            var jsonText = host.readFile(path);\n            if (!jsonText)\n                return {};\n            var result = ts.parseConfigFileTextToJson(path, jsonText);\n            if (result.error) {\n                return {};\n            }\n            return result.config;\n        }\n        catch (e) {\n            // gracefully handle if readFile fails or returns not JSON\n            return {};\n        }\n    }\n    ts.readJson = readJson;\n    function directoryProbablyExists(directoryName, host) {\n        // if host does not support 'directoryExists' assume that directory will exist\n        return !host.directoryExists || host.directoryExists(directoryName);\n    }\n    ts.directoryProbablyExists = directoryProbablyExists;\n    var carriageReturnLineFeed = \"\\r\\n\";\n    var lineFeed = \"\\n\";\n    function getNewLineCharacter(options, getNewLine) {\n        switch (options.newLine) {\n            case 0 /* CarriageReturnLineFeed */:\n                return carriageReturnLineFeed;\n            case 1 /* LineFeed */:\n                return lineFeed;\n        }\n        return getNewLine ? getNewLine() : ts.sys ? ts.sys.newLine : carriageReturnLineFeed;\n    }\n    ts.getNewLineCharacter = getNewLineCharacter;\n    /**\n     * Creates a new TextRange from the provided pos and end.\n     *\n     * @param pos The start position.\n     * @param end The end position.\n     */\n    function createRange(pos, end) {\n        if (end === void 0) { end = pos; }\n        ts.Debug.assert(end >= pos || end === -1);\n        return { pos: pos, end: end };\n    }\n    ts.createRange = createRange;\n    /**\n     * Creates a new TextRange from a provided range with a new end position.\n     *\n     * @param range A TextRange.\n     * @param end The new end position.\n     */\n    function moveRangeEnd(range, end) {\n        return createRange(range.pos, end);\n    }\n    ts.moveRangeEnd = moveRangeEnd;\n    /**\n     * Creates a new TextRange from a provided range with a new start position.\n     *\n     * @param range A TextRange.\n     * @param pos The new Start position.\n     */\n    function moveRangePos(range, pos) {\n        return createRange(pos, range.end);\n    }\n    ts.moveRangePos = moveRangePos;\n    /**\n     * Moves the start position of a range past any decorators.\n     */\n    function moveRangePastDecorators(node) {\n        return node.decorators && node.decorators.length > 0\n            ? moveRangePos(node, node.decorators.end)\n            : node;\n    }\n    ts.moveRangePastDecorators = moveRangePastDecorators;\n    /**\n     * Moves the start position of a range past any decorators or modifiers.\n     */\n    function moveRangePastModifiers(node) {\n        return node.modifiers && node.modifiers.length > 0\n            ? moveRangePos(node, node.modifiers.end)\n            : moveRangePastDecorators(node);\n    }\n    ts.moveRangePastModifiers = moveRangePastModifiers;\n    /**\n     * Determines whether a TextRange has the same start and end positions.\n     *\n     * @param range A TextRange.\n     */\n    function isCollapsedRange(range) {\n        return range.pos === range.end;\n    }\n    ts.isCollapsedRange = isCollapsedRange;\n    /**\n     * Creates a new TextRange for a token at the provides start position.\n     *\n     * @param pos The start position.\n     * @param token The token.\n     */\n    function createTokenRange(pos, token) {\n        return createRange(pos, pos + ts.tokenToString(token).length);\n    }\n    ts.createTokenRange = createTokenRange;\n    function rangeIsOnSingleLine(range, sourceFile) {\n        return rangeStartIsOnSameLineAsRangeEnd(range, range, sourceFile);\n    }\n    ts.rangeIsOnSingleLine = rangeIsOnSingleLine;\n    function rangeStartPositionsAreOnSameLine(range1, range2, sourceFile) {\n        return positionsAreOnSameLine(getStartPositionOfRange(range1, sourceFile, /*includeComments*/ false), getStartPositionOfRange(range2, sourceFile, /*includeComments*/ false), sourceFile);\n    }\n    ts.rangeStartPositionsAreOnSameLine = rangeStartPositionsAreOnSameLine;\n    function rangeEndPositionsAreOnSameLine(range1, range2, sourceFile) {\n        return positionsAreOnSameLine(range1.end, range2.end, sourceFile);\n    }\n    ts.rangeEndPositionsAreOnSameLine = rangeEndPositionsAreOnSameLine;\n    function rangeStartIsOnSameLineAsRangeEnd(range1, range2, sourceFile) {\n        return positionsAreOnSameLine(getStartPositionOfRange(range1, sourceFile, /*includeComments*/ false), range2.end, sourceFile);\n    }\n    ts.rangeStartIsOnSameLineAsRangeEnd = rangeStartIsOnSameLineAsRangeEnd;\n    function rangeEndIsOnSameLineAsRangeStart(range1, range2, sourceFile) {\n        return positionsAreOnSameLine(range1.end, getStartPositionOfRange(range2, sourceFile, /*includeComments*/ false), sourceFile);\n    }\n    ts.rangeEndIsOnSameLineAsRangeStart = rangeEndIsOnSameLineAsRangeStart;\n    function getLinesBetweenRangeEndAndRangeStart(range1, range2, sourceFile, includeSecondRangeComments) {\n        var range2Start = getStartPositionOfRange(range2, sourceFile, includeSecondRangeComments);\n        return ts.getLinesBetweenPositions(sourceFile, range1.end, range2Start);\n    }\n    ts.getLinesBetweenRangeEndAndRangeStart = getLinesBetweenRangeEndAndRangeStart;\n    function getLinesBetweenRangeEndPositions(range1, range2, sourceFile) {\n        return ts.getLinesBetweenPositions(sourceFile, range1.end, range2.end);\n    }\n    ts.getLinesBetweenRangeEndPositions = getLinesBetweenRangeEndPositions;\n    function isNodeArrayMultiLine(list, sourceFile) {\n        return !positionsAreOnSameLine(list.pos, list.end, sourceFile);\n    }\n    ts.isNodeArrayMultiLine = isNodeArrayMultiLine;\n    function positionsAreOnSameLine(pos1, pos2, sourceFile) {\n        return ts.getLinesBetweenPositions(sourceFile, pos1, pos2) === 0;\n    }\n    ts.positionsAreOnSameLine = positionsAreOnSameLine;\n    function getStartPositionOfRange(range, sourceFile, includeComments) {\n        return positionIsSynthesized(range.pos) ? -1 : ts.skipTrivia(sourceFile.text, range.pos, /*stopAfterLineBreak*/ false, includeComments);\n    }\n    ts.getStartPositionOfRange = getStartPositionOfRange;\n    function getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter(pos, stopPos, sourceFile, includeComments) {\n        var startPos = ts.skipTrivia(sourceFile.text, pos, /*stopAfterLineBreak*/ false, includeComments);\n        var prevPos = getPreviousNonWhitespacePosition(startPos, stopPos, sourceFile);\n        return ts.getLinesBetweenPositions(sourceFile, prevPos !== null && prevPos !== void 0 ? prevPos : stopPos, startPos);\n    }\n    ts.getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter = getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter;\n    function getLinesBetweenPositionAndNextNonWhitespaceCharacter(pos, stopPos, sourceFile, includeComments) {\n        var nextPos = ts.skipTrivia(sourceFile.text, pos, /*stopAfterLineBreak*/ false, includeComments);\n        return ts.getLinesBetweenPositions(sourceFile, pos, Math.min(stopPos, nextPos));\n    }\n    ts.getLinesBetweenPositionAndNextNonWhitespaceCharacter = getLinesBetweenPositionAndNextNonWhitespaceCharacter;\n    function getPreviousNonWhitespacePosition(pos, stopPos, sourceFile) {\n        if (stopPos === void 0) { stopPos = 0; }\n        while (pos-- > stopPos) {\n            if (!ts.isWhiteSpaceLike(sourceFile.text.charCodeAt(pos))) {\n                return pos;\n            }\n        }\n    }\n    /**\n     * Determines whether a name was originally the declaration name of an enum or namespace\n     * declaration.\n     */\n    function isDeclarationNameOfEnumOrNamespace(node) {\n        var parseNode = ts.getParseTreeNode(node);\n        if (parseNode) {\n            switch (parseNode.parent.kind) {\n                case 255 /* EnumDeclaration */:\n                case 256 /* ModuleDeclaration */:\n                    return parseNode === parseNode.parent.name;\n            }\n        }\n        return false;\n    }\n    ts.isDeclarationNameOfEnumOrNamespace = isDeclarationNameOfEnumOrNamespace;\n    function getInitializedVariables(node) {\n        return ts.filter(node.declarations, isInitializedVariable);\n    }\n    ts.getInitializedVariables = getInitializedVariables;\n    function isInitializedVariable(node) {\n        return node.initializer !== undefined;\n    }\n    function isWatchSet(options) {\n        // Firefox has Object.prototype.watch\n        return options.watch && options.hasOwnProperty(\"watch\");\n    }\n    ts.isWatchSet = isWatchSet;\n    function closeFileWatcher(watcher) {\n        watcher.close();\n    }\n    ts.closeFileWatcher = closeFileWatcher;\n    function getCheckFlags(symbol) {\n        return symbol.flags & 33554432 /* Transient */ ? symbol.checkFlags : 0;\n    }\n    ts.getCheckFlags = getCheckFlags;\n    function getDeclarationModifierFlagsFromSymbol(s) {\n        if (s.valueDeclaration) {\n            var flags = ts.getCombinedModifierFlags(s.valueDeclaration);\n            return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~28 /* AccessibilityModifier */;\n        }\n        if (getCheckFlags(s) & 6 /* Synthetic */) {\n            var checkFlags = s.checkFlags;\n            var accessModifier = checkFlags & 1024 /* ContainsPrivate */ ? 8 /* Private */ :\n                checkFlags & 256 /* ContainsPublic */ ? 4 /* Public */ :\n                    16 /* Protected */;\n            var staticModifier = checkFlags & 2048 /* ContainsStatic */ ? 32 /* Static */ : 0;\n            return accessModifier | staticModifier;\n        }\n        if (s.flags & 4194304 /* Prototype */) {\n            return 4 /* Public */ | 32 /* Static */;\n        }\n        return 0;\n    }\n    ts.getDeclarationModifierFlagsFromSymbol = getDeclarationModifierFlagsFromSymbol;\n    function skipAlias(symbol, checker) {\n        return symbol.flags & 2097152 /* Alias */ ? checker.getAliasedSymbol(symbol) : symbol;\n    }\n    ts.skipAlias = skipAlias;\n    /** See comment on `declareModuleMember` in `binder.ts`. */\n    function getCombinedLocalAndExportSymbolFlags(symbol) {\n        return symbol.exportSymbol ? symbol.exportSymbol.flags | symbol.flags : symbol.flags;\n    }\n    ts.getCombinedLocalAndExportSymbolFlags = getCombinedLocalAndExportSymbolFlags;\n    function isWriteOnlyAccess(node) {\n        return accessKind(node) === 1 /* Write */;\n    }\n    ts.isWriteOnlyAccess = isWriteOnlyAccess;\n    function isWriteAccess(node) {\n        return accessKind(node) !== 0 /* Read */;\n    }\n    ts.isWriteAccess = isWriteAccess;\n    var AccessKind;\n    (function (AccessKind) {\n        /** Only reads from a variable. */\n        AccessKind[AccessKind[\"Read\"] = 0] = \"Read\";\n        /** Only writes to a variable without using the result. E.g.: `x++;`. */\n        AccessKind[AccessKind[\"Write\"] = 1] = \"Write\";\n        /** Writes to a variable and uses the result as an expression. E.g.: `f(x++);`. */\n        AccessKind[AccessKind[\"ReadWrite\"] = 2] = \"ReadWrite\";\n    })(AccessKind || (AccessKind = {}));\n    function accessKind(node) {\n        var parent = node.parent;\n        if (!parent)\n            return 0 /* Read */;\n        switch (parent.kind) {\n            case 207 /* ParenthesizedExpression */:\n                return accessKind(parent);\n            case 215 /* PostfixUnaryExpression */:\n            case 214 /* PrefixUnaryExpression */:\n                var operator = parent.operator;\n                return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */;\n            case 216 /* BinaryExpression */:\n                var _a = parent, left = _a.left, operatorToken = _a.operatorToken;\n                return left === node && isAssignmentOperator(operatorToken.kind) ?\n                    operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite()\n                    : 0 /* Read */;\n            case 201 /* PropertyAccessExpression */:\n                return parent.name !== node ? 0 /* Read */ : accessKind(parent);\n            case 288 /* PropertyAssignment */: {\n                var parentAccess = accessKind(parent.parent);\n                // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write.\n                return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess;\n            }\n            case 289 /* ShorthandPropertyAssignment */:\n                // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals.\n                return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent);\n            case 199 /* ArrayLiteralExpression */:\n                return accessKind(parent);\n            default:\n                return 0 /* Read */;\n        }\n        function writeOrReadWrite() {\n            // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect.\n            return parent.parent && skipParenthesesUp(parent.parent).kind === 233 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;\n        }\n    }\n    function reverseAccessKind(a) {\n        switch (a) {\n            case 0 /* Read */:\n                return 1 /* Write */;\n            case 1 /* Write */:\n                return 0 /* Read */;\n            case 2 /* ReadWrite */:\n                return 2 /* ReadWrite */;\n            default:\n                return ts.Debug.assertNever(a);\n        }\n    }\n    function compareDataObjects(dst, src) {\n        if (!dst || !src || Object.keys(dst).length !== Object.keys(src).length) {\n            return false;\n        }\n        for (var e in dst) {\n            if (typeof dst[e] === \"object\") {\n                if (!compareDataObjects(dst[e], src[e])) {\n                    return false;\n                }\n            }\n            else if (typeof dst[e] !== \"function\") {\n                if (dst[e] !== src[e]) {\n                    return false;\n                }\n            }\n        }\n        return true;\n    }\n    ts.compareDataObjects = compareDataObjects;\n    /**\n     * clears already present map by calling onDeleteExistingValue callback before deleting that key/value\n     */\n    function clearMap(map, onDeleteValue) {\n        // Remove all\n        map.forEach(onDeleteValue);\n        map.clear();\n    }\n    ts.clearMap = clearMap;\n    /**\n     * Mutates the map with newMap such that keys in map will be same as newMap.\n     */\n    function mutateMapSkippingNewValues(map, newMap, options) {\n        var onDeleteValue = options.onDeleteValue, onExistingValue = options.onExistingValue;\n        // Needs update\n        map.forEach(function (existingValue, key) {\n            var valueInNewMap = newMap.get(key);\n            // Not present any more in new map, remove it\n            if (valueInNewMap === undefined) {\n                map.delete(key);\n                onDeleteValue(existingValue, key);\n            }\n            // If present notify about existing values\n            else if (onExistingValue) {\n                onExistingValue(existingValue, valueInNewMap, key);\n            }\n        });\n    }\n    ts.mutateMapSkippingNewValues = mutateMapSkippingNewValues;\n    /**\n     * Mutates the map with newMap such that keys in map will be same as newMap.\n     */\n    function mutateMap(map, newMap, options) {\n        // Needs update\n        mutateMapSkippingNewValues(map, newMap, options);\n        var createNewValue = options.createNewValue;\n        // Add new values that are not already present\n        newMap.forEach(function (valueInNewMap, key) {\n            if (!map.has(key)) {\n                // New values\n                map.set(key, createNewValue(key, valueInNewMap));\n            }\n        });\n    }\n    ts.mutateMap = mutateMap;\n    function isAbstractConstructorSymbol(symbol) {\n        if (symbol.flags & 32 /* Class */) {\n            var declaration = getClassLikeDeclarationOfSymbol(symbol);\n            return !!declaration && hasSyntacticModifier(declaration, 128 /* Abstract */);\n        }\n        return false;\n    }\n    ts.isAbstractConstructorSymbol = isAbstractConstructorSymbol;\n    function getClassLikeDeclarationOfSymbol(symbol) {\n        return ts.find(symbol.declarations, ts.isClassLike);\n    }\n    ts.getClassLikeDeclarationOfSymbol = getClassLikeDeclarationOfSymbol;\n    function getObjectFlags(type) {\n        return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0;\n    }\n    ts.getObjectFlags = getObjectFlags;\n    function typeHasCallOrConstructSignatures(type, checker) {\n        return checker.getSignaturesOfType(type, 0 /* Call */).length !== 0 || checker.getSignaturesOfType(type, 1 /* Construct */).length !== 0;\n    }\n    ts.typeHasCallOrConstructSignatures = typeHasCallOrConstructSignatures;\n    function forSomeAncestorDirectory(directory, callback) {\n        return !!ts.forEachAncestorDirectory(directory, function (d) { return callback(d) ? true : undefined; });\n    }\n    ts.forSomeAncestorDirectory = forSomeAncestorDirectory;\n    function isUMDExportSymbol(symbol) {\n        return !!symbol && !!symbol.declarations && !!symbol.declarations[0] && ts.isNamespaceExportDeclaration(symbol.declarations[0]);\n    }\n    ts.isUMDExportSymbol = isUMDExportSymbol;\n    function showModuleSpecifier(_a) {\n        var moduleSpecifier = _a.moduleSpecifier;\n        return ts.isStringLiteral(moduleSpecifier) ? moduleSpecifier.text : getTextOfNode(moduleSpecifier);\n    }\n    ts.showModuleSpecifier = showModuleSpecifier;\n    function getLastChild(node) {\n        var lastChild;\n        ts.forEachChild(node, function (child) {\n            if (nodeIsPresent(child))\n                lastChild = child;\n        }, function (children) {\n            // As an optimization, jump straight to the end of the list.\n            for (var i = children.length - 1; i >= 0; i--) {\n                if (nodeIsPresent(children[i])) {\n                    lastChild = children[i];\n                    break;\n                }\n            }\n        });\n        return lastChild;\n    }\n    ts.getLastChild = getLastChild;\n    function addToSeen(seen, key, value) {\n        if (value === void 0) { value = true; }\n        key = String(key);\n        if (seen.has(key)) {\n            return false;\n        }\n        seen.set(key, value);\n        return true;\n    }\n    ts.addToSeen = addToSeen;\n    function isObjectTypeDeclaration(node) {\n        return ts.isClassLike(node) || ts.isInterfaceDeclaration(node) || ts.isTypeLiteralNode(node);\n    }\n    ts.isObjectTypeDeclaration = isObjectTypeDeclaration;\n    function isTypeNodeKind(kind) {\n        return (kind >= 172 /* FirstTypeNode */ && kind <= 195 /* LastTypeNode */)\n            || kind === 128 /* AnyKeyword */\n            || kind === 152 /* UnknownKeyword */\n            || kind === 144 /* NumberKeyword */\n            || kind === 155 /* BigIntKeyword */\n            || kind === 145 /* ObjectKeyword */\n            || kind === 131 /* BooleanKeyword */\n            || kind === 147 /* StringKeyword */\n            || kind === 148 /* SymbolKeyword */\n            || kind === 113 /* VoidKeyword */\n            || kind === 150 /* UndefinedKeyword */\n            || kind === 141 /* NeverKeyword */\n            || kind === 223 /* ExpressionWithTypeArguments */\n            || kind === 303 /* JSDocAllType */\n            || kind === 304 /* JSDocUnknownType */\n            || kind === 305 /* JSDocNullableType */\n            || kind === 306 /* JSDocNonNullableType */\n            || kind === 307 /* JSDocOptionalType */\n            || kind === 308 /* JSDocFunctionType */\n            || kind === 309 /* JSDocVariadicType */;\n    }\n    ts.isTypeNodeKind = isTypeNodeKind;\n    function isAccessExpression(node) {\n        return node.kind === 201 /* PropertyAccessExpression */ || node.kind === 202 /* ElementAccessExpression */;\n    }\n    ts.isAccessExpression = isAccessExpression;\n    function getNameOfAccessExpression(node) {\n        if (node.kind === 201 /* PropertyAccessExpression */) {\n            return node.name;\n        }\n        ts.Debug.assert(node.kind === 202 /* ElementAccessExpression */);\n        return node.argumentExpression;\n    }\n    ts.getNameOfAccessExpression = getNameOfAccessExpression;\n    function isBundleFileTextLike(section) {\n        switch (section.kind) {\n            case \"text\" /* Text */:\n            case \"internal\" /* Internal */:\n                return true;\n            default:\n                return false;\n        }\n    }\n    ts.isBundleFileTextLike = isBundleFileTextLike;\n    function isNamedImportsOrExports(node) {\n        return node.kind === 264 /* NamedImports */ || node.kind === 268 /* NamedExports */;\n    }\n    ts.isNamedImportsOrExports = isNamedImportsOrExports;\n    function getLeftmostAccessExpression(expr) {\n        while (isAccessExpression(expr)) {\n            expr = expr.expression;\n        }\n        return expr;\n    }\n    ts.getLeftmostAccessExpression = getLeftmostAccessExpression;\n    function getLeftmostExpression(node, stopAtCallExpressions) {\n        while (true) {\n            switch (node.kind) {\n                case 215 /* PostfixUnaryExpression */:\n                    node = node.operand;\n                    continue;\n                case 216 /* BinaryExpression */:\n                    node = node.left;\n                    continue;\n                case 217 /* ConditionalExpression */:\n                    node = node.condition;\n                    continue;\n                case 205 /* TaggedTemplateExpression */:\n                    node = node.tag;\n                    continue;\n                case 203 /* CallExpression */:\n                    if (stopAtCallExpressions) {\n                        return node;\n                    }\n                // falls through\n                case 224 /* AsExpression */:\n                case 202 /* ElementAccessExpression */:\n                case 201 /* PropertyAccessExpression */:\n                case 225 /* NonNullExpression */:\n                case 336 /* PartiallyEmittedExpression */:\n                    node = node.expression;\n                    continue;\n            }\n            return node;\n        }\n    }\n    ts.getLeftmostExpression = getLeftmostExpression;\n    function Symbol(flags, name) {\n        this.flags = flags;\n        this.escapedName = name;\n        this.declarations = undefined;\n        this.valueDeclaration = undefined;\n        this.id = undefined;\n        this.mergeId = undefined;\n        this.parent = undefined;\n    }\n    function Type(checker, flags) {\n        this.flags = flags;\n        if (ts.Debug.isDebugging || ts.tracing) {\n            this.checker = checker;\n        }\n    }\n    function Signature(checker, flags) {\n        this.flags = flags;\n        if (ts.Debug.isDebugging) {\n            this.checker = checker;\n        }\n    }\n    function Node(kind, pos, end) {\n        this.pos = pos;\n        this.end = end;\n        this.kind = kind;\n        this.id = 0;\n        this.flags = 0 /* None */;\n        this.modifierFlagsCache = 0 /* None */;\n        this.transformFlags = 0 /* None */;\n        this.parent = undefined;\n        this.original = undefined;\n    }\n    function Token(kind, pos, end) {\n        this.pos = pos;\n        this.end = end;\n        this.kind = kind;\n        this.id = 0;\n        this.flags = 0 /* None */;\n        this.transformFlags = 0 /* None */;\n        this.parent = undefined;\n    }\n    function Identifier(kind, pos, end) {\n        this.pos = pos;\n        this.end = end;\n        this.kind = kind;\n        this.id = 0;\n        this.flags = 0 /* None */;\n        this.transformFlags = 0 /* None */;\n        this.parent = undefined;\n        this.original = undefined;\n        this.flowNode = undefined;\n    }\n    function SourceMapSource(fileName, text, skipTrivia) {\n        this.fileName = fileName;\n        this.text = text;\n        this.skipTrivia = skipTrivia || (function (pos) { return pos; });\n    }\n    // eslint-disable-next-line prefer-const\n    ts.objectAllocator = {\n        getNodeConstructor: function () { return Node; },\n        getTokenConstructor: function () { return Token; },\n        getIdentifierConstructor: function () { return Identifier; },\n        getPrivateIdentifierConstructor: function () { return Node; },\n        getSourceFileConstructor: function () { return Node; },\n        getSymbolConstructor: function () { return Symbol; },\n        getTypeConstructor: function () { return Type; },\n        getSignatureConstructor: function () { return Signature; },\n        getSourceMapSourceConstructor: function () { return SourceMapSource; },\n    };\n    function setObjectAllocator(alloc) {\n        ts.objectAllocator = alloc;\n    }\n    ts.setObjectAllocator = setObjectAllocator;\n    function formatStringFromArgs(text, args, baseIndex) {\n        if (baseIndex === void 0) { baseIndex = 0; }\n        return text.replace(/{(\\d+)}/g, function (_match, index) { return \"\" + ts.Debug.checkDefined(args[+index + baseIndex]); });\n    }\n    ts.formatStringFromArgs = formatStringFromArgs;\n    /* @internal */\n    function setLocalizedDiagnosticMessages(messages) {\n        ts.localizedDiagnosticMessages = messages;\n    }\n    ts.setLocalizedDiagnosticMessages = setLocalizedDiagnosticMessages;\n    function getLocaleSpecificMessage(message) {\n        return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message.key] || message.message;\n    }\n    ts.getLocaleSpecificMessage = getLocaleSpecificMessage;\n    function createDetachedDiagnostic(fileName, start, length, message) {\n        assertDiagnosticLocation(/*file*/ undefined, start, length);\n        var text = getLocaleSpecificMessage(message);\n        if (arguments.length > 4) {\n            text = formatStringFromArgs(text, arguments, 4);\n        }\n        return {\n            file: undefined,\n            start: start,\n            length: length,\n            messageText: text,\n            category: message.category,\n            code: message.code,\n            reportsUnnecessary: message.reportsUnnecessary,\n            fileName: fileName,\n        };\n    }\n    ts.createDetachedDiagnostic = createDetachedDiagnostic;\n    function isDiagnosticWithDetachedLocation(diagnostic) {\n        return diagnostic.file === undefined\n            && diagnostic.start !== undefined\n            && diagnostic.length !== undefined\n            && typeof diagnostic.fileName === \"string\";\n    }\n    function attachFileToDiagnostic(diagnostic, file) {\n        var fileName = file.fileName || \"\";\n        var length = file.text.length;\n        ts.Debug.assertEqual(diagnostic.fileName, fileName);\n        ts.Debug.assertLessThanOrEqual(diagnostic.start, length);\n        ts.Debug.assertLessThanOrEqual(diagnostic.start + diagnostic.length, length);\n        var diagnosticWithLocation = {\n            file: file,\n            start: diagnostic.start,\n            length: diagnostic.length,\n            messageText: diagnostic.messageText,\n            category: diagnostic.category,\n            code: diagnostic.code,\n            reportsUnnecessary: diagnostic.reportsUnnecessary\n        };\n        if (diagnostic.relatedInformation) {\n            diagnosticWithLocation.relatedInformation = [];\n            for (var _i = 0, _a = diagnostic.relatedInformation; _i < _a.length; _i++) {\n                var related = _a[_i];\n                if (isDiagnosticWithDetachedLocation(related) && related.fileName === fileName) {\n                    ts.Debug.assertLessThanOrEqual(related.start, length);\n                    ts.Debug.assertLessThanOrEqual(related.start + related.length, length);\n                    diagnosticWithLocation.relatedInformation.push(attachFileToDiagnostic(related, file));\n                }\n                else {\n                    diagnosticWithLocation.relatedInformation.push(related);\n                }\n            }\n        }\n        return diagnosticWithLocation;\n    }\n    function attachFileToDiagnostics(diagnostics, file) {\n        var diagnosticsWithLocation = [];\n        for (var _i = 0, diagnostics_1 = diagnostics; _i < diagnostics_1.length; _i++) {\n            var diagnostic = diagnostics_1[_i];\n            diagnosticsWithLocation.push(attachFileToDiagnostic(diagnostic, file));\n        }\n        return diagnosticsWithLocation;\n    }\n    ts.attachFileToDiagnostics = attachFileToDiagnostics;\n    function createFileDiagnostic(file, start, length, message) {\n        assertDiagnosticLocation(file, start, length);\n        var text = getLocaleSpecificMessage(message);\n        if (arguments.length > 4) {\n            text = formatStringFromArgs(text, arguments, 4);\n        }\n        return {\n            file: file,\n            start: start,\n            length: length,\n            messageText: text,\n            category: message.category,\n            code: message.code,\n            reportsUnnecessary: message.reportsUnnecessary,\n            reportsDeprecated: message.reportsDeprecated\n        };\n    }\n    ts.createFileDiagnostic = createFileDiagnostic;\n    function formatMessage(_dummy, message) {\n        var text = getLocaleSpecificMessage(message);\n        if (arguments.length > 2) {\n            text = formatStringFromArgs(text, arguments, 2);\n        }\n        return text;\n    }\n    ts.formatMessage = formatMessage;\n    function createCompilerDiagnostic(message) {\n        var text = getLocaleSpecificMessage(message);\n        if (arguments.length > 1) {\n            text = formatStringFromArgs(text, arguments, 1);\n        }\n        return {\n            file: undefined,\n            start: undefined,\n            length: undefined,\n            messageText: text,\n            category: message.category,\n            code: message.code,\n            reportsUnnecessary: message.reportsUnnecessary,\n            reportsDeprecated: message.reportsDeprecated\n        };\n    }\n    ts.createCompilerDiagnostic = createCompilerDiagnostic;\n    function createCompilerDiagnosticFromMessageChain(chain, relatedInformation) {\n        return {\n            file: undefined,\n            start: undefined,\n            length: undefined,\n            code: chain.code,\n            category: chain.category,\n            messageText: chain.next ? chain : chain.messageText,\n            relatedInformation: relatedInformation\n        };\n    }\n    ts.createCompilerDiagnosticFromMessageChain = createCompilerDiagnosticFromMessageChain;\n    function chainDiagnosticMessages(details, message) {\n        var text = getLocaleSpecificMessage(message);\n        if (arguments.length > 2) {\n            text = formatStringFromArgs(text, arguments, 2);\n        }\n        return {\n            messageText: text,\n            category: message.category,\n            code: message.code,\n            next: details === undefined || Array.isArray(details) ? details : [details]\n        };\n    }\n    ts.chainDiagnosticMessages = chainDiagnosticMessages;\n    function concatenateDiagnosticMessageChains(headChain, tailChain) {\n        var lastChain = headChain;\n        while (lastChain.next) {\n            lastChain = lastChain.next[0];\n        }\n        lastChain.next = [tailChain];\n    }\n    ts.concatenateDiagnosticMessageChains = concatenateDiagnosticMessageChains;\n    function getDiagnosticFilePath(diagnostic) {\n        return diagnostic.file ? diagnostic.file.path : undefined;\n    }\n    function compareDiagnostics(d1, d2) {\n        return compareDiagnosticsSkipRelatedInformation(d1, d2) ||\n            compareRelatedInformation(d1, d2) ||\n            0 /* EqualTo */;\n    }\n    ts.compareDiagnostics = compareDiagnostics;\n    function compareDiagnosticsSkipRelatedInformation(d1, d2) {\n        return ts.compareStringsCaseSensitive(getDiagnosticFilePath(d1), getDiagnosticFilePath(d2)) ||\n            ts.compareValues(d1.start, d2.start) ||\n            ts.compareValues(d1.length, d2.length) ||\n            ts.compareValues(d1.code, d2.code) ||\n            compareMessageText(d1.messageText, d2.messageText) ||\n            0 /* EqualTo */;\n    }\n    ts.compareDiagnosticsSkipRelatedInformation = compareDiagnosticsSkipRelatedInformation;\n    function compareRelatedInformation(d1, d2) {\n        if (!d1.relatedInformation && !d2.relatedInformation) {\n            return 0 /* EqualTo */;\n        }\n        if (d1.relatedInformation && d2.relatedInformation) {\n            return ts.compareValues(d1.relatedInformation.length, d2.relatedInformation.length) || ts.forEach(d1.relatedInformation, function (d1i, index) {\n                var d2i = d2.relatedInformation[index];\n                return compareDiagnostics(d1i, d2i); // EqualTo is 0, so falsy, and will cause the next item to be compared\n            }) || 0 /* EqualTo */;\n        }\n        return d1.relatedInformation ? -1 /* LessThan */ : 1 /* GreaterThan */;\n    }\n    function compareMessageText(t1, t2) {\n        if (typeof t1 === \"string\" && typeof t2 === \"string\") {\n            return ts.compareStringsCaseSensitive(t1, t2);\n        }\n        else if (typeof t1 === \"string\") {\n            return -1 /* LessThan */;\n        }\n        else if (typeof t2 === \"string\") {\n            return 1 /* GreaterThan */;\n        }\n        var res = ts.compareStringsCaseSensitive(t1.messageText, t2.messageText);\n        if (res) {\n            return res;\n        }\n        if (!t1.next && !t2.next) {\n            return 0 /* EqualTo */;\n        }\n        if (!t1.next) {\n            return -1 /* LessThan */;\n        }\n        if (!t2.next) {\n            return 1 /* GreaterThan */;\n        }\n        var len = Math.min(t1.next.length, t2.next.length);\n        for (var i = 0; i < len; i++) {\n            res = compareMessageText(t1.next[i], t2.next[i]);\n            if (res) {\n                return res;\n            }\n        }\n        if (t1.next.length < t2.next.length) {\n            return -1 /* LessThan */;\n        }\n        else if (t1.next.length > t2.next.length) {\n            return 1 /* GreaterThan */;\n        }\n        return 0 /* EqualTo */;\n    }\n    function getLanguageVariant(scriptKind) {\n        // .tsx and .jsx files are treated as jsx language variant.\n        return scriptKind === 4 /* TSX */ || scriptKind === 2 /* JSX */ || scriptKind === 1 /* JS */ || scriptKind === 6 /* JSON */ ? 1 /* JSX */ : 0 /* Standard */;\n    }\n    ts.getLanguageVariant = getLanguageVariant;\n    function getEmitScriptTarget(compilerOptions) {\n        return compilerOptions.target || 0 /* ES3 */;\n    }\n    ts.getEmitScriptTarget = getEmitScriptTarget;\n    function getEmitModuleKind(compilerOptions) {\n        return typeof compilerOptions.module === \"number\" ?\n            compilerOptions.module :\n            getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? ts.ModuleKind.ES2015 : ts.ModuleKind.CommonJS;\n    }\n    ts.getEmitModuleKind = getEmitModuleKind;\n    function getEmitModuleResolutionKind(compilerOptions) {\n        var moduleResolution = compilerOptions.moduleResolution;\n        if (moduleResolution === undefined) {\n            moduleResolution = getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic;\n        }\n        return moduleResolution;\n    }\n    ts.getEmitModuleResolutionKind = getEmitModuleResolutionKind;\n    function hasJsonModuleEmitEnabled(options) {\n        switch (getEmitModuleKind(options)) {\n            case ts.ModuleKind.CommonJS:\n            case ts.ModuleKind.AMD:\n            case ts.ModuleKind.ES2015:\n            case ts.ModuleKind.ES2020:\n            case ts.ModuleKind.ESNext:\n                return true;\n            default:\n                return false;\n        }\n    }\n    ts.hasJsonModuleEmitEnabled = hasJsonModuleEmitEnabled;\n    function unreachableCodeIsError(options) {\n        return options.allowUnreachableCode === false;\n    }\n    ts.unreachableCodeIsError = unreachableCodeIsError;\n    function unusedLabelIsError(options) {\n        return options.allowUnusedLabels === false;\n    }\n    ts.unusedLabelIsError = unusedLabelIsError;\n    function getAreDeclarationMapsEnabled(options) {\n        return !!(getEmitDeclarations(options) && options.declarationMap);\n    }\n    ts.getAreDeclarationMapsEnabled = getAreDeclarationMapsEnabled;\n    function getAllowSyntheticDefaultImports(compilerOptions) {\n        var moduleKind = getEmitModuleKind(compilerOptions);\n        return compilerOptions.allowSyntheticDefaultImports !== undefined\n            ? compilerOptions.allowSyntheticDefaultImports\n            : compilerOptions.esModuleInterop ||\n                moduleKind === ts.ModuleKind.System;\n    }\n    ts.getAllowSyntheticDefaultImports = getAllowSyntheticDefaultImports;\n    function getEmitDeclarations(compilerOptions) {\n        return !!(compilerOptions.declaration || compilerOptions.composite);\n    }\n    ts.getEmitDeclarations = getEmitDeclarations;\n    function shouldPreserveConstEnums(compilerOptions) {\n        return !!(compilerOptions.preserveConstEnums || compilerOptions.isolatedModules);\n    }\n    ts.shouldPreserveConstEnums = shouldPreserveConstEnums;\n    function isIncrementalCompilation(options) {\n        return !!(options.incremental || options.composite);\n    }\n    ts.isIncrementalCompilation = isIncrementalCompilation;\n    function getStrictOptionValue(compilerOptions, flag) {\n        return compilerOptions[flag] === undefined ? !!compilerOptions.strict : !!compilerOptions[flag];\n    }\n    ts.getStrictOptionValue = getStrictOptionValue;\n    function getAllowJSCompilerOption(compilerOptions) {\n        return compilerOptions.allowJs === undefined ? !!compilerOptions.checkJs : compilerOptions.allowJs;\n    }\n    ts.getAllowJSCompilerOption = getAllowJSCompilerOption;\n    function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) {\n        return oldOptions !== newOptions &&\n            ts.semanticDiagnosticsOptionDeclarations.some(function (option) { return !isJsonEqual(getCompilerOptionValue(oldOptions, option), getCompilerOptionValue(newOptions, option)); });\n    }\n    ts.compilerOptionsAffectSemanticDiagnostics = compilerOptionsAffectSemanticDiagnostics;\n    function compilerOptionsAffectEmit(newOptions, oldOptions) {\n        return oldOptions !== newOptions &&\n            ts.affectsEmitOptionDeclarations.some(function (option) { return !isJsonEqual(getCompilerOptionValue(oldOptions, option), getCompilerOptionValue(newOptions, option)); });\n    }\n    ts.compilerOptionsAffectEmit = compilerOptionsAffectEmit;\n    function getCompilerOptionValue(options, option) {\n        return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name];\n    }\n    ts.getCompilerOptionValue = getCompilerOptionValue;\n    function getJSXTransformEnabled(options) {\n        var jsx = options.jsx;\n        return jsx === 2 /* React */ || jsx === 4 /* ReactJSX */ || jsx === 5 /* ReactJSXDev */;\n    }\n    ts.getJSXTransformEnabled = getJSXTransformEnabled;\n    function getJSXImplicitImportBase(compilerOptions, file) {\n        var jsxImportSourcePragmas = file === null || file === void 0 ? void 0 : file.pragmas.get(\"jsximportsource\");\n        var jsxImportSourcePragma = ts.isArray(jsxImportSourcePragmas) ? jsxImportSourcePragmas[0] : jsxImportSourcePragmas;\n        return compilerOptions.jsx === 4 /* ReactJSX */ ||\n            compilerOptions.jsx === 5 /* ReactJSXDev */ ||\n            compilerOptions.jsxImportSource ||\n            jsxImportSourcePragma ?\n            (jsxImportSourcePragma === null || jsxImportSourcePragma === void 0 ? void 0 : jsxImportSourcePragma.arguments.factory) || compilerOptions.jsxImportSource || \"react\" :\n            undefined;\n    }\n    ts.getJSXImplicitImportBase = getJSXImplicitImportBase;\n    function getJSXRuntimeImport(base, options) {\n        return base ? base + \"/\" + (options.jsx === 5 /* ReactJSXDev */ ? \"jsx-dev-runtime\" : \"jsx-runtime\") : undefined;\n    }\n    ts.getJSXRuntimeImport = getJSXRuntimeImport;\n    function hasZeroOrOneAsteriskCharacter(str) {\n        var seenAsterisk = false;\n        for (var i = 0; i < str.length; i++) {\n            if (str.charCodeAt(i) === 42 /* asterisk */) {\n                if (!seenAsterisk) {\n                    seenAsterisk = true;\n                }\n                else {\n                    // have already seen asterisk\n                    return false;\n                }\n            }\n        }\n        return true;\n    }\n    ts.hasZeroOrOneAsteriskCharacter = hasZeroOrOneAsteriskCharacter;\n    function createSymlinkCache(cwd, getCanonicalFileName) {\n        var symlinkedDirectories;\n        var symlinkedDirectoriesByRealpath;\n        var symlinkedFiles;\n        return {\n            getSymlinkedFiles: function () { return symlinkedFiles; },\n            getSymlinkedDirectories: function () { return symlinkedDirectories; },\n            getSymlinkedDirectoriesByRealpath: function () { return symlinkedDirectoriesByRealpath; },\n            setSymlinkedFile: function (path, real) { return (symlinkedFiles || (symlinkedFiles = new ts.Map())).set(path, real); },\n            setSymlinkedDirectory: function (symlink, real) {\n                // Large, interconnected dependency graphs in pnpm will have a huge number of symlinks\n                // where both the realpath and the symlink path are inside node_modules/.pnpm. Since\n                // this path is never a candidate for a module specifier, we can ignore it entirely.\n                var symlinkPath = ts.toPath(symlink, cwd, getCanonicalFileName);\n                if (!containsIgnoredPath(symlinkPath)) {\n                    symlinkPath = ts.ensureTrailingDirectorySeparator(symlinkPath);\n                    if (real !== false && !(symlinkedDirectories === null || symlinkedDirectories === void 0 ? void 0 : symlinkedDirectories.has(symlinkPath))) {\n                        (symlinkedDirectoriesByRealpath || (symlinkedDirectoriesByRealpath = ts.createMultiMap())).add(ts.ensureTrailingDirectorySeparator(real.realPath), symlink);\n                    }\n                    (symlinkedDirectories || (symlinkedDirectories = new ts.Map())).set(symlinkPath, real);\n                }\n            }\n        };\n    }\n    ts.createSymlinkCache = createSymlinkCache;\n    function discoverProbableSymlinks(files, getCanonicalFileName, cwd) {\n        var cache = createSymlinkCache(cwd, getCanonicalFileName);\n        var symlinks = ts.flatten(ts.mapDefined(files, function (sf) {\n            return sf.resolvedModules && ts.compact(ts.arrayFrom(ts.mapIterator(sf.resolvedModules.values(), function (res) {\n                return res && res.originalPath && res.resolvedFileName !== res.originalPath ? [res.resolvedFileName, res.originalPath] : undefined;\n            })));\n        }));\n        for (var _i = 0, symlinks_1 = symlinks; _i < symlinks_1.length; _i++) {\n            var _a = symlinks_1[_i], resolvedPath = _a[0], originalPath = _a[1];\n            var _b = guessDirectorySymlink(resolvedPath, originalPath, cwd, getCanonicalFileName) || ts.emptyArray, commonResolved = _b[0], commonOriginal = _b[1];\n            if (commonResolved && commonOriginal) {\n                cache.setSymlinkedDirectory(commonOriginal, { real: commonResolved, realPath: ts.toPath(commonResolved, cwd, getCanonicalFileName) });\n            }\n        }\n        return cache;\n    }\n    ts.discoverProbableSymlinks = discoverProbableSymlinks;\n    function guessDirectorySymlink(a, b, cwd, getCanonicalFileName) {\n        var aParts = ts.getPathComponents(ts.getNormalizedAbsolutePath(a, cwd));\n        var bParts = ts.getPathComponents(ts.getNormalizedAbsolutePath(b, cwd));\n        var isDirectory = false;\n        while (!isNodeModulesOrScopedPackageDirectory(aParts[aParts.length - 2], getCanonicalFileName) &&\n            !isNodeModulesOrScopedPackageDirectory(bParts[bParts.length - 2], getCanonicalFileName) &&\n            getCanonicalFileName(aParts[aParts.length - 1]) === getCanonicalFileName(bParts[bParts.length - 1])) {\n            aParts.pop();\n            bParts.pop();\n            isDirectory = true;\n        }\n        return isDirectory ? [ts.getPathFromPathComponents(aParts), ts.getPathFromPathComponents(bParts)] : undefined;\n    }\n    // KLUDGE: Don't assume one 'node_modules' links to another. More likely a single directory inside the node_modules is the symlink.\n    // ALso, don't assume that an `@foo` directory is linked. More likely the contents of that are linked.\n    function isNodeModulesOrScopedPackageDirectory(s, getCanonicalFileName) {\n        return getCanonicalFileName(s) === \"node_modules\" || ts.startsWith(s, \"@\");\n    }\n    function stripLeadingDirectorySeparator(s) {\n        return ts.isAnyDirectorySeparator(s.charCodeAt(0)) ? s.slice(1) : undefined;\n    }\n    function tryRemoveDirectoryPrefix(path, dirPath, getCanonicalFileName) {\n        var withoutPrefix = ts.tryRemovePrefix(path, dirPath, getCanonicalFileName);\n        return withoutPrefix === undefined ? undefined : stripLeadingDirectorySeparator(withoutPrefix);\n    }\n    ts.tryRemoveDirectoryPrefix = tryRemoveDirectoryPrefix;\n    // Reserved characters, forces escaping of any non-word (or digit), non-whitespace character.\n    // It may be inefficient (we could just match (/[-[\\]{}()*+?.,\\\\^$|#\\s]/g), but this is future\n    // proof.\n    var reservedCharacterPattern = /[^\\w\\s\\/]/g;\n    function regExpEscape(text) {\n        return text.replace(reservedCharacterPattern, escapeRegExpCharacter);\n    }\n    ts.regExpEscape = regExpEscape;\n    function escapeRegExpCharacter(match) {\n        return \"\\\\\" + match;\n    }\n    var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];\n    ts.commonPackageFolders = [\"node_modules\", \"bower_components\", \"jspm_packages\"];\n    var implicitExcludePathRegexPattern = \"(?!(\" + ts.commonPackageFolders.join(\"|\") + \")(/|$))\";\n    var filesMatcher = {\n        /**\n         * Matches any single directory segment unless it is the last segment and a .min.js file\n         * Breakdown:\n         *  [^./]                   # matches everything up to the first . character (excluding directory separators)\n         *  (\\\\.(?!min\\\\.js$))?     # matches . characters but not if they are part of the .min.js file extension\n         */\n        singleAsteriskRegexFragment: \"([^./]|(\\\\.(?!min\\\\.js$))?)*\",\n        /**\n         * Regex for the ** wildcard. Matches any number of subdirectories. When used for including\n         * files or directories, does not match subdirectories that start with a . character\n         */\n        doubleAsteriskRegexFragment: \"(/\" + implicitExcludePathRegexPattern + \"[^/.][^/]*)*?\",\n        replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); }\n    };\n    var directoriesMatcher = {\n        singleAsteriskRegexFragment: \"[^/]*\",\n        /**\n         * Regex for the ** wildcard. Matches any number of subdirectories. When used for including\n         * files or directories, does not match subdirectories that start with a . character\n         */\n        doubleAsteriskRegexFragment: \"(/\" + implicitExcludePathRegexPattern + \"[^/.][^/]*)*?\",\n        replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); }\n    };\n    var excludeMatcher = {\n        singleAsteriskRegexFragment: \"[^/]*\",\n        doubleAsteriskRegexFragment: \"(/.+?)?\",\n        replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment); }\n    };\n    var wildcardMatchers = {\n        files: filesMatcher,\n        directories: directoriesMatcher,\n        exclude: excludeMatcher\n    };\n    function getRegularExpressionForWildcard(specs, basePath, usage) {\n        var patterns = getRegularExpressionsForWildcards(specs, basePath, usage);\n        if (!patterns || !patterns.length) {\n            return undefined;\n        }\n        var pattern = patterns.map(function (pattern) { return \"(\" + pattern + \")\"; }).join(\"|\");\n        // If excluding, match \"foo/bar/baz...\", but if including, only allow \"foo\".\n        var terminator = usage === \"exclude\" ? \"($|/)\" : \"$\";\n        return \"^(\" + pattern + \")\" + terminator;\n    }\n    ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard;\n    function getRegularExpressionsForWildcards(specs, basePath, usage) {\n        if (specs === undefined || specs.length === 0) {\n            return undefined;\n        }\n        return ts.flatMap(specs, function (spec) {\n            return spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);\n        });\n    }\n    ts.getRegularExpressionsForWildcards = getRegularExpressionsForWildcards;\n    /**\n     * An \"includes\" path \"foo\" is implicitly a glob \"foo/** /*\" (without the space) if its last component has no extension,\n     * and does not contain any glob characters itself.\n     */\n    function isImplicitGlob(lastPathComponent) {\n        return !/[.*?]/.test(lastPathComponent);\n    }\n    ts.isImplicitGlob = isImplicitGlob;\n    function getPatternFromSpec(spec, basePath, usage) {\n        var pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);\n        return pattern && \"^(\" + pattern + \")\" + (usage === \"exclude\" ? \"($|/)\" : \"$\");\n    }\n    ts.getPatternFromSpec = getPatternFromSpec;\n    function getSubPatternFromSpec(spec, basePath, usage, _a) {\n        var singleAsteriskRegexFragment = _a.singleAsteriskRegexFragment, doubleAsteriskRegexFragment = _a.doubleAsteriskRegexFragment, replaceWildcardCharacter = _a.replaceWildcardCharacter;\n        var subpattern = \"\";\n        var hasWrittenComponent = false;\n        var components = ts.getNormalizedPathComponents(spec, basePath);\n        var lastComponent = ts.last(components);\n        if (usage !== \"exclude\" && lastComponent === \"**\") {\n            return undefined;\n        }\n        // getNormalizedPathComponents includes the separator for the root component.\n        // We need to remove to create our regex correctly.\n        components[0] = ts.removeTrailingDirectorySeparator(components[0]);\n        if (isImplicitGlob(lastComponent)) {\n            components.push(\"**\", \"*\");\n        }\n        var optionalCount = 0;\n        for (var _i = 0, components_1 = components; _i < components_1.length; _i++) {\n            var component = components_1[_i];\n            if (component === \"**\") {\n                subpattern += doubleAsteriskRegexFragment;\n            }\n            else {\n                if (usage === \"directories\") {\n                    subpattern += \"(\";\n                    optionalCount++;\n                }\n                if (hasWrittenComponent) {\n                    subpattern += ts.directorySeparator;\n                }\n                if (usage !== \"exclude\") {\n                    var componentPattern = \"\";\n                    // The * and ? wildcards should not match directories or files that start with . if they\n                    // appear first in a component. Dotted directories and files can be included explicitly\n                    // like so: **/.*/.*\n                    if (component.charCodeAt(0) === 42 /* asterisk */) {\n                        componentPattern += \"([^./]\" + singleAsteriskRegexFragment + \")?\";\n                        component = component.substr(1);\n                    }\n                    else if (component.charCodeAt(0) === 63 /* question */) {\n                        componentPattern += \"[^./]\";\n                        component = component.substr(1);\n                    }\n                    componentPattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter);\n                    // Patterns should not include subfolders like node_modules unless they are\n                    // explicitly included as part of the path.\n                    //\n                    // As an optimization, if the component pattern is the same as the component,\n                    // then there definitely were no wildcard characters and we do not need to\n                    // add the exclusion pattern.\n                    if (componentPattern !== component) {\n                        subpattern += implicitExcludePathRegexPattern;\n                    }\n                    subpattern += componentPattern;\n                }\n                else {\n                    subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter);\n                }\n            }\n            hasWrittenComponent = true;\n        }\n        while (optionalCount > 0) {\n            subpattern += \")?\";\n            optionalCount--;\n        }\n        return subpattern;\n    }\n    function replaceWildcardCharacter(match, singleAsteriskRegexFragment) {\n        return match === \"*\" ? singleAsteriskRegexFragment : match === \"?\" ? \"[^/]\" : \"\\\\\" + match;\n    }\n    /** @param path directory of the tsconfig.json */\n    function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory) {\n        path = ts.normalizePath(path);\n        currentDirectory = ts.normalizePath(currentDirectory);\n        var absolutePath = ts.combinePaths(currentDirectory, path);\n        return {\n            includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, \"files\"), function (pattern) { return \"^\" + pattern + \"$\"; }),\n            includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, \"files\"),\n            includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, \"directories\"),\n            excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, \"exclude\"),\n            basePaths: getBasePaths(path, includes, useCaseSensitiveFileNames)\n        };\n    }\n    ts.getFileMatcherPatterns = getFileMatcherPatterns;\n    function getRegexFromPattern(pattern, useCaseSensitiveFileNames) {\n        return new RegExp(pattern, useCaseSensitiveFileNames ? \"\" : \"i\");\n    }\n    ts.getRegexFromPattern = getRegexFromPattern;\n    /** @param path directory of the tsconfig.json */\n    function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath) {\n        path = ts.normalizePath(path);\n        currentDirectory = ts.normalizePath(currentDirectory);\n        var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);\n        var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return getRegexFromPattern(pattern, useCaseSensitiveFileNames); });\n        var includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames);\n        var excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames);\n        // Associate an array of results with each include regex. This keeps results in order of the \"include\" order.\n        // If there are no \"includes\", then just put everything in results[0].\n        var results = includeFileRegexes ? includeFileRegexes.map(function () { return []; }) : [[]];\n        var visited = new ts.Map();\n        var toCanonical = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);\n        for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) {\n            var basePath = _a[_i];\n            visitDirectory(basePath, ts.combinePaths(currentDirectory, basePath), depth);\n        }\n        return ts.flatten(results);\n        function visitDirectory(path, absolutePath, depth) {\n            var canonicalPath = toCanonical(realpath(absolutePath));\n            if (visited.has(canonicalPath))\n                return;\n            visited.set(canonicalPath, true);\n            var _a = getFileSystemEntries(path), files = _a.files, directories = _a.directories;\n            var _loop_1 = function (current) {\n                var name = ts.combinePaths(path, current);\n                var absoluteName = ts.combinePaths(absolutePath, current);\n                if (extensions && !ts.fileExtensionIsOneOf(name, extensions))\n                    return \"continue\";\n                if (excludeRegex && excludeRegex.test(absoluteName))\n                    return \"continue\";\n                if (!includeFileRegexes) {\n                    results[0].push(name);\n                }\n                else {\n                    var includeIndex = ts.findIndex(includeFileRegexes, function (re) { return re.test(absoluteName); });\n                    if (includeIndex !== -1) {\n                        results[includeIndex].push(name);\n                    }\n                }\n            };\n            for (var _i = 0, _b = ts.sort(files, ts.compareStringsCaseSensitive); _i < _b.length; _i++) {\n                var current = _b[_i];\n                _loop_1(current);\n            }\n            if (depth !== undefined) {\n                depth--;\n                if (depth === 0) {\n                    return;\n                }\n            }\n            for (var _c = 0, _d = ts.sort(directories, ts.compareStringsCaseSensitive); _c < _d.length; _c++) {\n                var current = _d[_c];\n                var name = ts.combinePaths(path, current);\n                var absoluteName = ts.combinePaths(absolutePath, current);\n                if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) &&\n                    (!excludeRegex || !excludeRegex.test(absoluteName))) {\n                    visitDirectory(name, absoluteName, depth);\n                }\n            }\n        }\n    }\n    ts.matchFiles = matchFiles;\n    /**\n     * Computes the unique non-wildcard base paths amongst the provided include patterns.\n     */\n    function getBasePaths(path, includes, useCaseSensitiveFileNames) {\n        // Storage for our results in the form of literal paths (e.g. the paths as written by the user).\n        var basePaths = [path];\n        if (includes) {\n            // Storage for literal base paths amongst the include patterns.\n            var includeBasePaths = [];\n            for (var _i = 0, includes_1 = includes; _i < includes_1.length; _i++) {\n                var include = includes_1[_i];\n                // We also need to check the relative paths by converting them to absolute and normalizing\n                // in case they escape the base path (e.g \"..\\somedirectory\")\n                var absolute = ts.isRootedDiskPath(include) ? include : ts.normalizePath(ts.combinePaths(path, include));\n                // Append the literal and canonical candidate base paths.\n                includeBasePaths.push(getIncludeBasePath(absolute));\n            }\n            // Sort the offsets array using either the literal or canonical path representations.\n            includeBasePaths.sort(ts.getStringComparer(!useCaseSensitiveFileNames));\n            var _loop_2 = function (includeBasePath) {\n                if (ts.every(basePaths, function (basePath) { return !ts.containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames); })) {\n                    basePaths.push(includeBasePath);\n                }\n            };\n            // Iterate over each include base path and include unique base paths that are not a\n            // subpath of an existing base path\n            for (var _a = 0, includeBasePaths_1 = includeBasePaths; _a < includeBasePaths_1.length; _a++) {\n                var includeBasePath = includeBasePaths_1[_a];\n                _loop_2(includeBasePath);\n            }\n        }\n        return basePaths;\n    }\n    function getIncludeBasePath(absolute) {\n        var wildcardOffset = ts.indexOfAnyCharCode(absolute, wildcardCharCodes);\n        if (wildcardOffset < 0) {\n            // No \"*\" or \"?\" in the path\n            return !ts.hasExtension(absolute)\n                ? absolute\n                : ts.removeTrailingDirectorySeparator(ts.getDirectoryPath(absolute));\n        }\n        return absolute.substring(0, absolute.lastIndexOf(ts.directorySeparator, wildcardOffset));\n    }\n    function ensureScriptKind(fileName, scriptKind) {\n        // Using scriptKind as a condition handles both:\n        // - 'scriptKind' is unspecified and thus it is `undefined`\n        // - 'scriptKind' is set and it is `Unknown` (0)\n        // If the 'scriptKind' is 'undefined' or 'Unknown' then we attempt\n        // to get the ScriptKind from the file name. If it cannot be resolved\n        // from the file name then the default 'TS' script kind is returned.\n        return scriptKind || getScriptKindFromFileName(fileName) || 3 /* TS */;\n    }\n    ts.ensureScriptKind = ensureScriptKind;\n    function getScriptKindFromFileName(fileName) {\n        var ext = fileName.substr(fileName.lastIndexOf(\".\"));\n        switch (ext.toLowerCase()) {\n            case \".js\" /* Js */:\n                return 1 /* JS */;\n            case \".jsx\" /* Jsx */:\n                return 2 /* JSX */;\n            case \".ts\" /* Ts */:\n                return 3 /* TS */;\n            case \".tsx\" /* Tsx */:\n                return 4 /* TSX */;\n            case \".json\" /* Json */:\n                return 6 /* JSON */;\n            default:\n                return 0 /* Unknown */;\n        }\n    }\n    ts.getScriptKindFromFileName = getScriptKindFromFileName;\n    /**\n     *  List of supported extensions in order of file resolution precedence.\n     */\n    ts.supportedTSExtensions = [\".ts\" /* Ts */, \".tsx\" /* Tsx */, \".d.ts\" /* Dts */];\n    ts.supportedTSExtensionsWithJson = [\".ts\" /* Ts */, \".tsx\" /* Tsx */, \".d.ts\" /* Dts */, \".json\" /* Json */];\n    /** Must have \".d.ts\" first because if \".ts\" goes first, that will be detected as the extension instead of \".d.ts\". */\n    ts.supportedTSExtensionsForExtractExtension = [\".d.ts\" /* Dts */, \".ts\" /* Ts */, \".tsx\" /* Tsx */];\n    ts.supportedJSExtensions = [\".js\" /* Js */, \".jsx\" /* Jsx */];\n    ts.supportedJSAndJsonExtensions = [\".js\" /* Js */, \".jsx\" /* Jsx */, \".json\" /* Json */];\n    var allSupportedExtensions = __spreadArray(__spreadArray([], ts.supportedTSExtensions), ts.supportedJSExtensions);\n    var allSupportedExtensionsWithJson = __spreadArray(__spreadArray(__spreadArray([], ts.supportedTSExtensions), ts.supportedJSExtensions), [\".json\" /* Json */]);\n    function getSupportedExtensions(options, extraFileExtensions) {\n        var needJsExtensions = options && getAllowJSCompilerOption(options);\n        if (!extraFileExtensions || extraFileExtensions.length === 0) {\n            return needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions;\n        }\n        var extensions = __spreadArray(__spreadArray([], needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions), ts.mapDefined(extraFileExtensions, function (x) { return x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) ? x.extension : undefined; }));\n        return ts.deduplicate(extensions, ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);\n    }\n    ts.getSupportedExtensions = getSupportedExtensions;\n    function getSuppoertedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions) {\n        if (!options || !options.resolveJsonModule) {\n            return supportedExtensions;\n        }\n        if (supportedExtensions === allSupportedExtensions) {\n            return allSupportedExtensionsWithJson;\n        }\n        if (supportedExtensions === ts.supportedTSExtensions) {\n            return ts.supportedTSExtensionsWithJson;\n        }\n        return __spreadArray(__spreadArray([], supportedExtensions), [\".json\" /* Json */]);\n    }\n    ts.getSuppoertedExtensionsWithJsonIfResolveJsonModule = getSuppoertedExtensionsWithJsonIfResolveJsonModule;\n    function isJSLike(scriptKind) {\n        return scriptKind === 1 /* JS */ || scriptKind === 2 /* JSX */;\n    }\n    function hasJSFileExtension(fileName) {\n        return ts.some(ts.supportedJSExtensions, function (extension) { return ts.fileExtensionIs(fileName, extension); });\n    }\n    ts.hasJSFileExtension = hasJSFileExtension;\n    function hasTSFileExtension(fileName) {\n        return ts.some(ts.supportedTSExtensions, function (extension) { return ts.fileExtensionIs(fileName, extension); });\n    }\n    ts.hasTSFileExtension = hasTSFileExtension;\n    function isSupportedSourceFileName(fileName, compilerOptions, extraFileExtensions) {\n        if (!fileName) {\n            return false;\n        }\n        var supportedExtensions = getSupportedExtensions(compilerOptions, extraFileExtensions);\n        for (var _i = 0, _a = getSuppoertedExtensionsWithJsonIfResolveJsonModule(compilerOptions, supportedExtensions); _i < _a.length; _i++) {\n            var extension = _a[_i];\n            if (ts.fileExtensionIs(fileName, extension)) {\n                return true;\n            }\n        }\n        return false;\n    }\n    ts.isSupportedSourceFileName = isSupportedSourceFileName;\n    function numberOfDirectorySeparators(str) {\n        var match = str.match(/\\//g);\n        return match ? match.length : 0;\n    }\n    function compareNumberOfDirectorySeparators(path1, path2) {\n        return ts.compareValues(numberOfDirectorySeparators(path1), numberOfDirectorySeparators(path2));\n    }\n    ts.compareNumberOfDirectorySeparators = compareNumberOfDirectorySeparators;\n    /**\n     * Extension boundaries by priority. Lower numbers indicate higher priorities, and are\n     * aligned to the offset of the highest priority extension in the\n     * allSupportedExtensions array.\n     */\n    var ExtensionPriority;\n    (function (ExtensionPriority) {\n        ExtensionPriority[ExtensionPriority[\"TypeScriptFiles\"] = 0] = \"TypeScriptFiles\";\n        ExtensionPriority[ExtensionPriority[\"DeclarationAndJavaScriptFiles\"] = 2] = \"DeclarationAndJavaScriptFiles\";\n        ExtensionPriority[ExtensionPriority[\"Highest\"] = 0] = \"Highest\";\n        ExtensionPriority[ExtensionPriority[\"Lowest\"] = 2] = \"Lowest\";\n    })(ExtensionPriority = ts.ExtensionPriority || (ts.ExtensionPriority = {}));\n    function getExtensionPriority(path, supportedExtensions) {\n        for (var i = supportedExtensions.length - 1; i >= 0; i--) {\n            if (ts.fileExtensionIs(path, supportedExtensions[i])) {\n                return adjustExtensionPriority(i, supportedExtensions);\n            }\n        }\n        // If its not in the list of supported extensions, this is likely a\n        // TypeScript file with a non-ts extension\n        return 0 /* Highest */;\n    }\n    ts.getExtensionPriority = getExtensionPriority;\n    /**\n     * Adjusts an extension priority to be the highest priority within the same range.\n     */\n    function adjustExtensionPriority(extensionPriority, supportedExtensions) {\n        if (extensionPriority < 2 /* DeclarationAndJavaScriptFiles */) {\n            return 0 /* TypeScriptFiles */;\n        }\n        else if (extensionPriority < supportedExtensions.length) {\n            return 2 /* DeclarationAndJavaScriptFiles */;\n        }\n        else {\n            return supportedExtensions.length;\n        }\n    }\n    ts.adjustExtensionPriority = adjustExtensionPriority;\n    /**\n     * Gets the next lowest extension priority for a given priority.\n     */\n    function getNextLowestExtensionPriority(extensionPriority, supportedExtensions) {\n        if (extensionPriority < 2 /* DeclarationAndJavaScriptFiles */) {\n            return 2 /* DeclarationAndJavaScriptFiles */;\n        }\n        else {\n            return supportedExtensions.length;\n        }\n    }\n    ts.getNextLowestExtensionPriority = getNextLowestExtensionPriority;\n    var extensionsToRemove = [\".d.ts\" /* Dts */, \".ts\" /* Ts */, \".js\" /* Js */, \".tsx\" /* Tsx */, \".jsx\" /* Jsx */, \".json\" /* Json */];\n    function removeFileExtension(path) {\n        for (var _i = 0, extensionsToRemove_1 = extensionsToRemove; _i < extensionsToRemove_1.length; _i++) {\n            var ext = extensionsToRemove_1[_i];\n            var extensionless = tryRemoveExtension(path, ext);\n            if (extensionless !== undefined) {\n                return extensionless;\n            }\n        }\n        return path;\n    }\n    ts.removeFileExtension = removeFileExtension;\n    function tryRemoveExtension(path, extension) {\n        return ts.fileExtensionIs(path, extension) ? removeExtension(path, extension) : undefined;\n    }\n    ts.tryRemoveExtension = tryRemoveExtension;\n    function removeExtension(path, extension) {\n        return path.substring(0, path.length - extension.length);\n    }\n    ts.removeExtension = removeExtension;\n    function changeExtension(path, newExtension) {\n        return ts.changeAnyExtension(path, newExtension, extensionsToRemove, /*ignoreCase*/ false);\n    }\n    ts.changeExtension = changeExtension;\n    function tryParsePattern(pattern) {\n        // This should be verified outside of here and a proper error thrown.\n        ts.Debug.assert(hasZeroOrOneAsteriskCharacter(pattern));\n        var indexOfStar = pattern.indexOf(\"*\");\n        return indexOfStar === -1 ? undefined : {\n            prefix: pattern.substr(0, indexOfStar),\n            suffix: pattern.substr(indexOfStar + 1)\n        };\n    }\n    ts.tryParsePattern = tryParsePattern;\n    function positionIsSynthesized(pos) {\n        // This is a fast way of testing the following conditions:\n        //  pos === undefined || pos === null || isNaN(pos) || pos < 0;\n        return !(pos >= 0);\n    }\n    ts.positionIsSynthesized = positionIsSynthesized;\n    /** True if an extension is one of the supported TypeScript extensions. */\n    function extensionIsTS(ext) {\n        return ext === \".ts\" /* Ts */ || ext === \".tsx\" /* Tsx */ || ext === \".d.ts\" /* Dts */;\n    }\n    ts.extensionIsTS = extensionIsTS;\n    function resolutionExtensionIsTSOrJson(ext) {\n        return extensionIsTS(ext) || ext === \".json\" /* Json */;\n    }\n    ts.resolutionExtensionIsTSOrJson = resolutionExtensionIsTSOrJson;\n    /**\n     * Gets the extension from a path.\n     * Path must have a valid extension.\n     */\n    function extensionFromPath(path) {\n        var ext = tryGetExtensionFromPath(path);\n        return ext !== undefined ? ext : ts.Debug.fail(\"File \" + path + \" has unknown extension.\");\n    }\n    ts.extensionFromPath = extensionFromPath;\n    function isAnySupportedFileExtension(path) {\n        return tryGetExtensionFromPath(path) !== undefined;\n    }\n    ts.isAnySupportedFileExtension = isAnySupportedFileExtension;\n    function tryGetExtensionFromPath(path) {\n        return ts.find(extensionsToRemove, function (e) { return ts.fileExtensionIs(path, e); });\n    }\n    ts.tryGetExtensionFromPath = tryGetExtensionFromPath;\n    function isCheckJsEnabledForFile(sourceFile, compilerOptions) {\n        return sourceFile.checkJsDirective ? sourceFile.checkJsDirective.enabled : compilerOptions.checkJs;\n    }\n    ts.isCheckJsEnabledForFile = isCheckJsEnabledForFile;\n    ts.emptyFileSystemEntries = {\n        files: ts.emptyArray,\n        directories: ts.emptyArray\n    };\n    /**\n     * patternStrings contains both pattern strings (containing \"*\") and regular strings.\n     * Return an exact match if possible, or a pattern match, or undefined.\n     * (These are verified by verifyCompilerOptions to have 0 or 1 \"*\" characters.)\n     */\n    function matchPatternOrExact(patternStrings, candidate) {\n        var patterns = [];\n        for (var _i = 0, patternStrings_1 = patternStrings; _i < patternStrings_1.length; _i++) {\n            var patternString = patternStrings_1[_i];\n            if (!hasZeroOrOneAsteriskCharacter(patternString))\n                continue;\n            var pattern = tryParsePattern(patternString);\n            if (pattern) {\n                patterns.push(pattern);\n            }\n            else if (patternString === candidate) {\n                // pattern was matched as is - no need to search further\n                return patternString;\n            }\n        }\n        return ts.findBestPatternMatch(patterns, function (_) { return _; }, candidate);\n    }\n    ts.matchPatternOrExact = matchPatternOrExact;\n    function sliceAfter(arr, value) {\n        var index = arr.indexOf(value);\n        ts.Debug.assert(index !== -1);\n        return arr.slice(index);\n    }\n    ts.sliceAfter = sliceAfter;\n    function addRelatedInfo(diagnostic) {\n        var _a;\n        var relatedInformation = [];\n        for (var _i = 1; _i < arguments.length; _i++) {\n            relatedInformation[_i - 1] = arguments[_i];\n        }\n        if (!relatedInformation.length) {\n            return diagnostic;\n        }\n        if (!diagnostic.relatedInformation) {\n            diagnostic.relatedInformation = [];\n        }\n        ts.Debug.assert(diagnostic.relatedInformation !== ts.emptyArray, \"Diagnostic had empty array singleton for related info, but is still being constructed!\");\n        (_a = diagnostic.relatedInformation).push.apply(_a, relatedInformation);\n        return diagnostic;\n    }\n    ts.addRelatedInfo = addRelatedInfo;\n    function minAndMax(arr, getValue) {\n        ts.Debug.assert(arr.length !== 0);\n        var min = getValue(arr[0]);\n        var max = min;\n        for (var i = 1; i < arr.length; i++) {\n            var value = getValue(arr[i]);\n            if (value < min) {\n                min = value;\n            }\n            else if (value > max) {\n                max = value;\n            }\n        }\n        return { min: min, max: max };\n    }\n    ts.minAndMax = minAndMax;\n    function rangeOfNode(node) {\n        return { pos: getTokenPosOfNode(node), end: node.end };\n    }\n    ts.rangeOfNode = rangeOfNode;\n    function rangeOfTypeParameters(sourceFile, typeParameters) {\n        // Include the `<>`\n        var pos = typeParameters.pos - 1;\n        var end = ts.skipTrivia(sourceFile.text, typeParameters.end) + 1;\n        return { pos: pos, end: end };\n    }\n    ts.rangeOfTypeParameters = rangeOfTypeParameters;\n    function skipTypeChecking(sourceFile, options, host) {\n        // If skipLibCheck is enabled, skip reporting errors if file is a declaration file.\n        // If skipDefaultLibCheck is enabled, skip reporting errors if file contains a\n        // '/// <reference no-default-lib=\"true\"/>' directive.\n        return (options.skipLibCheck && sourceFile.isDeclarationFile ||\n            options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib) ||\n            host.isSourceOfProjectReferenceRedirect(sourceFile.fileName);\n    }\n    ts.skipTypeChecking = skipTypeChecking;\n    function isJsonEqual(a, b) {\n        // eslint-disable-next-line no-null/no-null\n        return a === b || typeof a === \"object\" && a !== null && typeof b === \"object\" && b !== null && ts.equalOwnProperties(a, b, isJsonEqual);\n    }\n    ts.isJsonEqual = isJsonEqual;\n    /**\n     * Converts a bigint literal string, e.g. `0x1234n`,\n     * to its decimal string representation, e.g. `4660`.\n     */\n    function parsePseudoBigInt(stringValue) {\n        var log2Base;\n        switch (stringValue.charCodeAt(1)) { // \"x\" in \"0x123\"\n            case 98 /* b */:\n            case 66 /* B */: // 0b or 0B\n                log2Base = 1;\n                break;\n            case 111 /* o */:\n            case 79 /* O */: // 0o or 0O\n                log2Base = 3;\n                break;\n            case 120 /* x */:\n            case 88 /* X */: // 0x or 0X\n                log2Base = 4;\n                break;\n            default: // already in decimal; omit trailing \"n\"\n                var nIndex = stringValue.length - 1;\n                // Skip leading 0s\n                var nonZeroStart = 0;\n                while (stringValue.charCodeAt(nonZeroStart) === 48 /* _0 */) {\n                    nonZeroStart++;\n                }\n                return stringValue.slice(nonZeroStart, nIndex) || \"0\";\n        }\n        // Omit leading \"0b\", \"0o\", or \"0x\", and trailing \"n\"\n        var startIndex = 2, endIndex = stringValue.length - 1;\n        var bitsNeeded = (endIndex - startIndex) * log2Base;\n        // Stores the value specified by the string as a LE array of 16-bit integers\n        // using Uint16 instead of Uint32 so combining steps can use bitwise operators\n        var segments = new Uint16Array((bitsNeeded >>> 4) + (bitsNeeded & 15 ? 1 : 0));\n        // Add the digits, one at a time\n        for (var i = endIndex - 1, bitOffset = 0; i >= startIndex; i--, bitOffset += log2Base) {\n            var segment = bitOffset >>> 4;\n            var digitChar = stringValue.charCodeAt(i);\n            // Find character range: 0-9 < A-F < a-f\n            var digit = digitChar <= 57 /* _9 */\n                ? digitChar - 48 /* _0 */\n                : 10 + digitChar -\n                    (digitChar <= 70 /* F */ ? 65 /* A */ : 97 /* a */);\n            var shiftedDigit = digit << (bitOffset & 15);\n            segments[segment] |= shiftedDigit;\n            var residual = shiftedDigit >>> 16;\n            if (residual)\n                segments[segment + 1] |= residual; // overflows segment\n        }\n        // Repeatedly divide segments by 10 and add remainder to base10Value\n        var base10Value = \"\";\n        var firstNonzeroSegment = segments.length - 1;\n        var segmentsRemaining = true;\n        while (segmentsRemaining) {\n            var mod10 = 0;\n            segmentsRemaining = false;\n            for (var segment = firstNonzeroSegment; segment >= 0; segment--) {\n                var newSegment = mod10 << 16 | segments[segment];\n                var segmentValue = (newSegment / 10) | 0;\n                segments[segment] = segmentValue;\n                mod10 = newSegment - segmentValue * 10;\n                if (segmentValue && !segmentsRemaining) {\n                    firstNonzeroSegment = segment;\n                    segmentsRemaining = true;\n                }\n            }\n            base10Value = mod10 + base10Value;\n        }\n        return base10Value;\n    }\n    ts.parsePseudoBigInt = parsePseudoBigInt;\n    function pseudoBigIntToString(_a) {\n        var negative = _a.negative, base10Value = _a.base10Value;\n        return (negative && base10Value !== \"0\" ? \"-\" : \"\") + base10Value;\n    }\n    ts.pseudoBigIntToString = pseudoBigIntToString;\n    function isValidTypeOnlyAliasUseSite(useSite) {\n        return !!(useSite.flags & 8388608 /* Ambient */)\n            || isPartOfTypeQuery(useSite)\n            || isIdentifierInNonEmittingHeritageClause(useSite)\n            || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite)\n            || !isExpressionNode(useSite);\n    }\n    ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite;\n    function typeOnlyDeclarationIsExport(typeOnlyDeclaration) {\n        return typeOnlyDeclaration.kind === 270 /* ExportSpecifier */;\n    }\n    ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport;\n    function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) {\n        while (node.kind === 78 /* Identifier */ || node.kind === 201 /* PropertyAccessExpression */) {\n            node = node.parent;\n        }\n        if (node.kind !== 158 /* ComputedPropertyName */) {\n            return false;\n        }\n        if (hasSyntacticModifier(node.parent, 128 /* Abstract */)) {\n            return true;\n        }\n        var containerKind = node.parent.parent.kind;\n        return containerKind === 253 /* InterfaceDeclaration */ || containerKind === 177 /* TypeLiteral */;\n    }\n    /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */\n    function isIdentifierInNonEmittingHeritageClause(node) {\n        if (node.kind !== 78 /* Identifier */)\n            return false;\n        var heritageClause = ts.findAncestor(node.parent, function (parent) {\n            switch (parent.kind) {\n                case 286 /* HeritageClause */:\n                    return true;\n                case 201 /* PropertyAccessExpression */:\n                case 223 /* ExpressionWithTypeArguments */:\n                    return false;\n                default:\n                    return \"quit\";\n            }\n        });\n        return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 116 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 253 /* InterfaceDeclaration */;\n    }\n    function isIdentifierTypeReference(node) {\n        return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName);\n    }\n    ts.isIdentifierTypeReference = isIdentifierTypeReference;\n    function arrayIsHomogeneous(array, comparer) {\n        if (comparer === void 0) { comparer = ts.equateValues; }\n        if (array.length < 2)\n            return true;\n        var first = array[0];\n        for (var i = 1, length_1 = array.length; i < length_1; i++) {\n            var target = array[i];\n            if (!comparer(first, target))\n                return false;\n        }\n        return true;\n    }\n    ts.arrayIsHomogeneous = arrayIsHomogeneous;\n    /**\n     * Bypasses immutability and directly sets the `pos` property of a `TextRange` or `Node`.\n     */\n    /* @internal */\n    function setTextRangePos(range, pos) {\n        range.pos = pos;\n        return range;\n    }\n    ts.setTextRangePos = setTextRangePos;\n    /**\n     * Bypasses immutability and directly sets the `end` property of a `TextRange` or `Node`.\n     */\n    /* @internal */\n    function setTextRangeEnd(range, end) {\n        range.end = end;\n        return range;\n    }\n    ts.setTextRangeEnd = setTextRangeEnd;\n    /**\n     * Bypasses immutability and directly sets the `pos` and `end` properties of a `TextRange` or `Node`.\n     */\n    /* @internal */\n    function setTextRangePosEnd(range, pos, end) {\n        return setTextRangeEnd(setTextRangePos(range, pos), end);\n    }\n    ts.setTextRangePosEnd = setTextRangePosEnd;\n    /**\n     * Bypasses immutability and directly sets the `pos` and `end` properties of a `TextRange` or `Node` from the\n     * provided position and width.\n     */\n    /* @internal */\n    function setTextRangePosWidth(range, pos, width) {\n        return setTextRangePosEnd(range, pos, pos + width);\n    }\n    ts.setTextRangePosWidth = setTextRangePosWidth;\n    function setNodeFlags(node, newFlags) {\n        if (node) {\n            node.flags = newFlags;\n        }\n        return node;\n    }\n    ts.setNodeFlags = setNodeFlags;\n    function setParent(child, parent) {\n        if (child && parent) {\n            child.parent = parent;\n        }\n        return child;\n    }\n    ts.setParent = setParent;\n    function setEachParent(children, parent) {\n        if (children) {\n            for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {\n                var child = children_1[_i];\n                setParent(child, parent);\n            }\n        }\n        return children;\n    }\n    ts.setEachParent = setEachParent;\n    function setParentRecursive(rootNode, incremental) {\n        if (!rootNode)\n            return rootNode;\n        ts.forEachChildRecursively(rootNode, ts.isJSDocNode(rootNode) ? bindParentToChildIgnoringJSDoc : bindParentToChild);\n        return rootNode;\n        function bindParentToChildIgnoringJSDoc(child, parent) {\n            if (incremental && child.parent === parent) {\n                return \"skip\";\n            }\n            setParent(child, parent);\n        }\n        function bindJSDoc(child) {\n            if (ts.hasJSDocNodes(child)) {\n                for (var _i = 0, _a = child.jsDoc; _i < _a.length; _i++) {\n                    var doc = _a[_i];\n                    bindParentToChildIgnoringJSDoc(doc, child);\n                    ts.forEachChildRecursively(doc, bindParentToChildIgnoringJSDoc);\n                }\n            }\n        }\n        function bindParentToChild(child, parent) {\n            return bindParentToChildIgnoringJSDoc(child, parent) || bindJSDoc(child);\n        }\n    }\n    ts.setParentRecursive = setParentRecursive;\n    function isPackedElement(node) {\n        return !ts.isOmittedExpression(node);\n    }\n    /**\n     * Determines whether the provided node is an ArrayLiteralExpression that contains no missing elements.\n     */\n    function isPackedArrayLiteral(node) {\n        return ts.isArrayLiteralExpression(node) && ts.every(node.elements, isPackedElement);\n    }\n    ts.isPackedArrayLiteral = isPackedArrayLiteral;\n    /**\n     * Indicates whether the result of an `Expression` will be unused.\n     *\n     * NOTE: This requires a node with a valid `parent` pointer.\n     */\n    function expressionResultIsUnused(node) {\n        ts.Debug.assertIsDefined(node.parent);\n        while (true) {\n            var parent = node.parent;\n            // walk up parenthesized expressions, but keep a pointer to the top-most parenthesized expression\n            if (ts.isParenthesizedExpression(parent)) {\n                node = parent;\n                continue;\n            }\n            // result is unused in an expression statement, `void` expression, or the initializer or incrementer of a `for` loop\n            if (ts.isExpressionStatement(parent) ||\n                ts.isVoidExpression(parent) ||\n                ts.isForStatement(parent) && (parent.initializer === node || parent.incrementor === node)) {\n                return true;\n            }\n            if (ts.isCommaListExpression(parent)) {\n                // left side of comma is always unused\n                if (node !== ts.last(parent.elements))\n                    return true;\n                // right side of comma is unused if parent is unused\n                node = parent;\n                continue;\n            }\n            if (ts.isBinaryExpression(parent) && parent.operatorToken.kind === 27 /* CommaToken */) {\n                // left side of comma is always unused\n                if (node === parent.left)\n                    return true;\n                // right side of comma is unused if parent is unused\n                node = parent;\n                continue;\n            }\n            return false;\n        }\n    }\n    ts.expressionResultIsUnused = expressionResultIsUnused;\n    function containsIgnoredPath(path) {\n        return ts.some(ts.ignoredPaths, function (p) { return ts.stringContains(path, p); });\n    }\n    ts.containsIgnoredPath = containsIgnoredPath;\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    /**\n     * Creates a `BaseNodeFactory` which can be used to create `Node` instances from the constructors provided by the object allocator.\n     */\n    function createBaseNodeFactory() {\n        // tslint:disable variable-name\n        var NodeConstructor;\n        var TokenConstructor;\n        var IdentifierConstructor;\n        var PrivateIdentifierConstructor;\n        var SourceFileConstructor;\n        // tslint:enable variable-name\n        return {\n            createBaseSourceFileNode: createBaseSourceFileNode,\n            createBaseIdentifierNode: createBaseIdentifierNode,\n            createBasePrivateIdentifierNode: createBasePrivateIdentifierNode,\n            createBaseTokenNode: createBaseTokenNode,\n            createBaseNode: createBaseNode\n        };\n        function createBaseSourceFileNode(kind) {\n            return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, /*pos*/ -1, /*end*/ -1);\n        }\n        function createBaseIdentifierNode(kind) {\n            return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, /*pos*/ -1, /*end*/ -1);\n        }\n        function createBasePrivateIdentifierNode(kind) {\n            return new (PrivateIdentifierConstructor || (PrivateIdentifierConstructor = ts.objectAllocator.getPrivateIdentifierConstructor()))(kind, /*pos*/ -1, /*end*/ -1);\n        }\n        function createBaseTokenNode(kind) {\n            return new (TokenConstructor || (TokenConstructor = ts.objectAllocator.getTokenConstructor()))(kind, /*pos*/ -1, /*end*/ -1);\n        }\n        function createBaseNode(kind) {\n            return new (NodeConstructor || (NodeConstructor = ts.objectAllocator.getNodeConstructor()))(kind, /*pos*/ -1, /*end*/ -1);\n        }\n    }\n    ts.createBaseNodeFactory = createBaseNodeFactory;\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    function createParenthesizerRules(factory) {\n        return {\n            parenthesizeLeftSideOfBinary: parenthesizeLeftSideOfBinary,\n            parenthesizeRightSideOfBinary: parenthesizeRightSideOfBinary,\n            parenthesizeExpressionOfComputedPropertyName: parenthesizeExpressionOfComputedPropertyName,\n            parenthesizeConditionOfConditionalExpression: parenthesizeConditionOfConditionalExpression,\n            parenthesizeBranchOfConditionalExpression: parenthesizeBranchOfConditionalExpression,\n            parenthesizeExpressionOfExportDefault: parenthesizeExpressionOfExportDefault,\n            parenthesizeExpressionOfNew: parenthesizeExpressionOfNew,\n            parenthesizeLeftSideOfAccess: parenthesizeLeftSideOfAccess,\n            parenthesizeOperandOfPostfixUnary: parenthesizeOperandOfPostfixUnary,\n            parenthesizeOperandOfPrefixUnary: parenthesizeOperandOfPrefixUnary,\n            parenthesizeExpressionsOfCommaDelimitedList: parenthesizeExpressionsOfCommaDelimitedList,\n            parenthesizeExpressionForDisallowedComma: parenthesizeExpressionForDisallowedComma,\n            parenthesizeExpressionOfExpressionStatement: parenthesizeExpressionOfExpressionStatement,\n            parenthesizeConciseBodyOfArrowFunction: parenthesizeConciseBodyOfArrowFunction,\n            parenthesizeMemberOfConditionalType: parenthesizeMemberOfConditionalType,\n            parenthesizeMemberOfElementType: parenthesizeMemberOfElementType,\n            parenthesizeElementTypeOfArrayType: parenthesizeElementTypeOfArrayType,\n            parenthesizeConstituentTypesOfUnionOrIntersectionType: parenthesizeConstituentTypesOfUnionOrIntersectionType,\n            parenthesizeTypeArguments: parenthesizeTypeArguments,\n        };\n        /**\n         * Determines whether the operand to a BinaryExpression needs to be parenthesized.\n         *\n         * @param binaryOperator The operator for the BinaryExpression.\n         * @param operand The operand for the BinaryExpression.\n         * @param isLeftSideOfBinary A value indicating whether the operand is the left side of the\n         *                           BinaryExpression.\n         */\n        function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {\n            // If the operand has lower precedence, then it needs to be parenthesized to preserve the\n            // intent of the expression. For example, if the operand is `a + b` and the operator is\n            // `*`, then we need to parenthesize the operand to preserve the intended order of\n            // operations: `(a + b) * x`.\n            //\n            // If the operand has higher precedence, then it does not need to be parenthesized. For\n            // example, if the operand is `a * b` and the operator is `+`, then we do not need to\n            // parenthesize to preserve the intended order of operations: `a * b + x`.\n            //\n            // If the operand has the same precedence, then we need to check the associativity of\n            // the operator based on whether this is the left or right operand of the expression.\n            //\n            // For example, if `a / d` is on the right of operator `*`, we need to parenthesize\n            // to preserve the intended order of operations: `x * (a / d)`\n            //\n            // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve\n            // the intended order of operations: `(a ** b) ** c`\n            var binaryOperatorPrecedence = ts.getOperatorPrecedence(216 /* BinaryExpression */, binaryOperator);\n            var binaryOperatorAssociativity = ts.getOperatorAssociativity(216 /* BinaryExpression */, binaryOperator);\n            var emittedOperand = ts.skipPartiallyEmittedExpressions(operand);\n            if (!isLeftSideOfBinary && operand.kind === 209 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) {\n                // We need to parenthesize arrow functions on the right side to avoid it being\n                // parsed as parenthesized expression: `a && (() => {})`\n                return true;\n            }\n            var operandPrecedence = ts.getExpressionPrecedence(emittedOperand);\n            switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) {\n                case -1 /* LessThan */:\n                    // If the operand is the right side of a right-associative binary operation\n                    // and is a yield expression, then we do not need parentheses.\n                    if (!isLeftSideOfBinary\n                        && binaryOperatorAssociativity === 1 /* Right */\n                        && operand.kind === 219 /* YieldExpression */) {\n                        return false;\n                    }\n                    return true;\n                case 1 /* GreaterThan */:\n                    return false;\n                case 0 /* EqualTo */:\n                    if (isLeftSideOfBinary) {\n                        // No need to parenthesize the left operand when the binary operator is\n                        // left associative:\n                        //  (a*b)/x    -> a*b/x\n                        //  (a**b)/x   -> a**b/x\n                        //\n                        // Parentheses are needed for the left operand when the binary operator is\n                        // right associative:\n                        //  (a/b)**x   -> (a/b)**x\n                        //  (a**b)**x  -> (a**b)**x\n                        return binaryOperatorAssociativity === 1 /* Right */;\n                    }\n                    else {\n                        if (ts.isBinaryExpression(emittedOperand)\n                            && emittedOperand.operatorToken.kind === binaryOperator) {\n                            // No need to parenthesize the right operand when the binary operator and\n                            // operand are the same and one of the following:\n                            //  x*(a*b)     => x*a*b\n                            //  x|(a|b)     => x|a|b\n                            //  x&(a&b)     => x&a&b\n                            //  x^(a^b)     => x^a^b\n                            if (operatorHasAssociativeProperty(binaryOperator)) {\n                                return false;\n                            }\n                            // No need to parenthesize the right operand when the binary operator\n                            // is plus (+) if both the left and right operands consist solely of either\n                            // literals of the same kind or binary plus (+) expressions for literals of\n                            // the same kind (recursively).\n                            //  \"a\"+(1+2)       => \"a\"+(1+2)\n                            //  \"a\"+(\"b\"+\"c\")   => \"a\"+\"b\"+\"c\"\n                            if (binaryOperator === 39 /* PlusToken */) {\n                                var leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0 /* Unknown */;\n                                if (ts.isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) {\n                                    return false;\n                                }\n                            }\n                        }\n                        // No need to parenthesize the right operand when the operand is right\n                        // associative:\n                        //  x/(a**b)    -> x/a**b\n                        //  x**(a**b)   -> x**a**b\n                        //\n                        // Parentheses are needed for the right operand when the operand is left\n                        // associative:\n                        //  x/(a*b)     -> x/(a*b)\n                        //  x**(a/b)    -> x**(a/b)\n                        var operandAssociativity = ts.getExpressionAssociativity(emittedOperand);\n                        return operandAssociativity === 0 /* Left */;\n                    }\n            }\n        }\n        /**\n         * Determines whether a binary operator is mathematically associative.\n         *\n         * @param binaryOperator The binary operator.\n         */\n        function operatorHasAssociativeProperty(binaryOperator) {\n            // The following operators are associative in JavaScript:\n            //  (a*b)*c     -> a*(b*c)  -> a*b*c\n            //  (a|b)|c     -> a|(b|c)  -> a|b|c\n            //  (a&b)&c     -> a&(b&c)  -> a&b&c\n            //  (a^b)^c     -> a^(b^c)  -> a^b^c\n            //\n            // While addition is associative in mathematics, JavaScript's `+` is not\n            // guaranteed to be associative as it is overloaded with string concatenation.\n            return binaryOperator === 41 /* AsteriskToken */\n                || binaryOperator === 51 /* BarToken */\n                || binaryOperator === 50 /* AmpersandToken */\n                || binaryOperator === 52 /* CaretToken */;\n        }\n        /**\n         * This function determines whether an expression consists of a homogeneous set of\n         * literal expressions or binary plus expressions that all share the same literal kind.\n         * It is used to determine whether the right-hand operand of a binary plus expression can be\n         * emitted without parentheses.\n         */\n        function getLiteralKindOfBinaryPlusOperand(node) {\n            node = ts.skipPartiallyEmittedExpressions(node);\n            if (ts.isLiteralKind(node.kind)) {\n                return node.kind;\n            }\n            if (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) {\n                if (node.cachedLiteralKind !== undefined) {\n                    return node.cachedLiteralKind;\n                }\n                var leftKind = getLiteralKindOfBinaryPlusOperand(node.left);\n                var literalKind = ts.isLiteralKind(leftKind)\n                    && leftKind === getLiteralKindOfBinaryPlusOperand(node.right)\n                    ? leftKind\n                    : 0 /* Unknown */;\n                node.cachedLiteralKind = literalKind;\n                return literalKind;\n            }\n            return 0 /* Unknown */;\n        }\n        /**\n         * Wraps the operand to a BinaryExpression in parentheses if they are needed to preserve the intended\n         * order of operations.\n         *\n         * @param binaryOperator The operator for the BinaryExpression.\n         * @param operand The operand for the BinaryExpression.\n         * @param isLeftSideOfBinary A value indicating whether the operand is the left side of the\n         *                           BinaryExpression.\n         */\n        function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {\n            var skipped = ts.skipPartiallyEmittedExpressions(operand);\n            // If the resulting expression is already parenthesized, we do not need to do any further processing.\n            if (skipped.kind === 207 /* ParenthesizedExpression */) {\n                return operand;\n            }\n            return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand)\n                ? factory.createParenthesizedExpression(operand)\n                : operand;\n        }\n        function parenthesizeLeftSideOfBinary(binaryOperator, leftSide) {\n            return parenthesizeBinaryOperand(binaryOperator, leftSide, /*isLeftSideOfBinary*/ true);\n        }\n        function parenthesizeRightSideOfBinary(binaryOperator, leftSide, rightSide) {\n            return parenthesizeBinaryOperand(binaryOperator, rightSide, /*isLeftSideOfBinary*/ false, leftSide);\n        }\n        function parenthesizeExpressionOfComputedPropertyName(expression) {\n            return ts.isCommaSequence(expression) ? factory.createParenthesizedExpression(expression) : expression;\n        }\n        function parenthesizeConditionOfConditionalExpression(condition) {\n            var conditionalPrecedence = ts.getOperatorPrecedence(217 /* ConditionalExpression */, 57 /* QuestionToken */);\n            var emittedCondition = ts.skipPartiallyEmittedExpressions(condition);\n            var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition);\n            if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) {\n                return factory.createParenthesizedExpression(condition);\n            }\n            return condition;\n        }\n        function parenthesizeBranchOfConditionalExpression(branch) {\n            // per ES grammar both 'whenTrue' and 'whenFalse' parts of conditional expression are assignment expressions\n            // so in case when comma expression is introduced as a part of previous transformations\n            // if should be wrapped in parens since comma operator has the lowest precedence\n            var emittedExpression = ts.skipPartiallyEmittedExpressions(branch);\n            return ts.isCommaSequence(emittedExpression)\n                ? factory.createParenthesizedExpression(branch)\n                : branch;\n        }\n        /**\n         *  [Per the spec](https://tc39.github.io/ecma262/#prod-ExportDeclaration), `export default` accepts _AssigmentExpression_ but\n         *  has a lookahead restriction for `function`, `async function`, and `class`.\n         *\n         * Basically, that means we need to parenthesize in the following cases:\n         *\n         * - BinaryExpression of CommaToken\n         * - CommaList (synthetic list of multiple comma expressions)\n         * - FunctionExpression\n         * - ClassExpression\n         */\n        function parenthesizeExpressionOfExportDefault(expression) {\n            var check = ts.skipPartiallyEmittedExpressions(expression);\n            var needsParens = ts.isCommaSequence(check);\n            if (!needsParens) {\n                switch (ts.getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) {\n                    case 221 /* ClassExpression */:\n                    case 208 /* FunctionExpression */:\n                        needsParens = true;\n                }\n            }\n            return needsParens ? factory.createParenthesizedExpression(expression) : expression;\n        }\n        /**\n         * Wraps an expression in parentheses if it is needed in order to use the expression\n         * as the expression of a `NewExpression` node.\n         */\n        function parenthesizeExpressionOfNew(expression) {\n            var leftmostExpr = ts.getLeftmostExpression(expression, /*stopAtCallExpressions*/ true);\n            switch (leftmostExpr.kind) {\n                case 203 /* CallExpression */:\n                    return factory.createParenthesizedExpression(expression);\n                case 204 /* NewExpression */:\n                    return !leftmostExpr.arguments\n                        ? factory.createParenthesizedExpression(expression)\n                        : expression; // TODO(rbuckton): Verify this assertion holds\n            }\n            return parenthesizeLeftSideOfAccess(expression);\n        }\n        /**\n         * Wraps an expression in parentheses if it is needed in order to use the expression for\n         * property or element access.\n         */\n        function parenthesizeLeftSideOfAccess(expression) {\n            // isLeftHandSideExpression is almost the correct criterion for when it is not necessary\n            // to parenthesize the expression before a dot. The known exception is:\n            //\n            //    NewExpression:\n            //       new C.x        -> not the same as (new C).x\n            //\n            var emittedExpression = ts.skipPartiallyEmittedExpressions(expression);\n            if (ts.isLeftHandSideExpression(emittedExpression)\n                && (emittedExpression.kind !== 204 /* NewExpression */ || emittedExpression.arguments)) {\n                // TODO(rbuckton): Verify whether this assertion holds.\n                return expression;\n            }\n            // TODO(rbuckton): Verifiy whether `setTextRange` is needed.\n            return ts.setTextRange(factory.createParenthesizedExpression(expression), expression);\n        }\n        function parenthesizeOperandOfPostfixUnary(operand) {\n            // TODO(rbuckton): Verifiy whether `setTextRange` is needed.\n            return ts.isLeftHandSideExpression(operand) ? operand : ts.setTextRange(factory.createParenthesizedExpression(operand), operand);\n        }\n        function parenthesizeOperandOfPrefixUnary(operand) {\n            // TODO(rbuckton): Verifiy whether `setTextRange` is needed.\n            return ts.isUnaryExpression(operand) ? operand : ts.setTextRange(factory.createParenthesizedExpression(operand), operand);\n        }\n        function parenthesizeExpressionsOfCommaDelimitedList(elements) {\n            var result = ts.sameMap(elements, parenthesizeExpressionForDisallowedComma);\n            return ts.setTextRange(factory.createNodeArray(result, elements.hasTrailingComma), elements);\n        }\n        function parenthesizeExpressionForDisallowedComma(expression) {\n            var emittedExpression = ts.skipPartiallyEmittedExpressions(expression);\n            var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression);\n            var commaPrecedence = ts.getOperatorPrecedence(216 /* BinaryExpression */, 27 /* CommaToken */);\n            // TODO(rbuckton): Verifiy whether `setTextRange` is needed.\n            return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(factory.createParenthesizedExpression(expression), expression);\n        }\n        function parenthesizeExpressionOfExpressionStatement(expression) {\n            var emittedExpression = ts.skipPartiallyEmittedExpressions(expression);\n            if (ts.isCallExpression(emittedExpression)) {\n                var callee = emittedExpression.expression;\n                var kind = ts.skipPartiallyEmittedExpressions(callee).kind;\n                if (kind === 208 /* FunctionExpression */ || kind === 209 /* ArrowFunction */) {\n                    // TODO(rbuckton): Verifiy whether `setTextRange` is needed.\n                    var updated = factory.updateCallExpression(emittedExpression, ts.setTextRange(factory.createParenthesizedExpression(callee), callee), emittedExpression.typeArguments, emittedExpression.arguments);\n                    return factory.restoreOuterExpressions(expression, updated, 8 /* PartiallyEmittedExpressions */);\n                }\n            }\n            var leftmostExpressionKind = ts.getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind;\n            if (leftmostExpressionKind === 200 /* ObjectLiteralExpression */ || leftmostExpressionKind === 208 /* FunctionExpression */) {\n                // TODO(rbuckton): Verifiy whether `setTextRange` is needed.\n                return ts.setTextRange(factory.createParenthesizedExpression(expression), expression);\n            }\n            return expression;\n        }\n        function parenthesizeConciseBodyOfArrowFunction(body) {\n            if (!ts.isBlock(body) && (ts.isCommaSequence(body) || ts.getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 200 /* ObjectLiteralExpression */)) {\n                // TODO(rbuckton): Verifiy whether `setTextRange` is needed.\n                return ts.setTextRange(factory.createParenthesizedExpression(body), body);\n            }\n            return body;\n        }\n        function parenthesizeMemberOfConditionalType(member) {\n            return member.kind === 184 /* ConditionalType */ ? factory.createParenthesizedType(member) : member;\n        }\n        function parenthesizeMemberOfElementType(member) {\n            switch (member.kind) {\n                case 182 /* UnionType */:\n                case 183 /* IntersectionType */:\n                case 174 /* FunctionType */:\n                case 175 /* ConstructorType */:\n                    return factory.createParenthesizedType(member);\n            }\n            return parenthesizeMemberOfConditionalType(member);\n        }\n        function parenthesizeElementTypeOfArrayType(member) {\n            switch (member.kind) {\n                case 176 /* TypeQuery */:\n                case 188 /* TypeOperator */:\n                case 185 /* InferType */:\n                    return factory.createParenthesizedType(member);\n            }\n            return parenthesizeMemberOfElementType(member);\n        }\n        function parenthesizeConstituentTypesOfUnionOrIntersectionType(members) {\n            return factory.createNodeArray(ts.sameMap(members, parenthesizeMemberOfElementType));\n        }\n        function parenthesizeOrdinalTypeArgument(node, i) {\n            return i === 0 && ts.isFunctionOrConstructorTypeNode(node) && node.typeParameters ? factory.createParenthesizedType(node) : node;\n        }\n        function parenthesizeTypeArguments(typeArguments) {\n            if (ts.some(typeArguments)) {\n                return factory.createNodeArray(ts.sameMap(typeArguments, parenthesizeOrdinalTypeArgument));\n            }\n        }\n    }\n    ts.createParenthesizerRules = createParenthesizerRules;\n    ts.nullParenthesizerRules = {\n        parenthesizeLeftSideOfBinary: function (_binaryOperator, leftSide) { return leftSide; },\n        parenthesizeRightSideOfBinary: function (_binaryOperator, _leftSide, rightSide) { return rightSide; },\n        parenthesizeExpressionOfComputedPropertyName: ts.identity,\n        parenthesizeConditionOfConditionalExpression: ts.identity,\n        parenthesizeBranchOfConditionalExpression: ts.identity,\n        parenthesizeExpressionOfExportDefault: ts.identity,\n        parenthesizeExpressionOfNew: function (expression) { return ts.cast(expression, ts.isLeftHandSideExpression); },\n        parenthesizeLeftSideOfAccess: function (expression) { return ts.cast(expression, ts.isLeftHandSideExpression); },\n        parenthesizeOperandOfPostfixUnary: function (operand) { return ts.cast(operand, ts.isLeftHandSideExpression); },\n        parenthesizeOperandOfPrefixUnary: function (operand) { return ts.cast(operand, ts.isUnaryExpression); },\n        parenthesizeExpressionsOfCommaDelimitedList: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },\n        parenthesizeExpressionForDisallowedComma: ts.identity,\n        parenthesizeExpressionOfExpressionStatement: ts.identity,\n        parenthesizeConciseBodyOfArrowFunction: ts.identity,\n        parenthesizeMemberOfConditionalType: ts.identity,\n        parenthesizeMemberOfElementType: ts.identity,\n        parenthesizeElementTypeOfArrayType: ts.identity,\n        parenthesizeConstituentTypesOfUnionOrIntersectionType: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },\n        parenthesizeTypeArguments: function (nodes) { return nodes && ts.cast(nodes, ts.isNodeArray); },\n    };\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    function createNodeConverters(factory) {\n        return {\n            convertToFunctionBlock: convertToFunctionBlock,\n            convertToFunctionExpression: convertToFunctionExpression,\n            convertToArrayAssignmentElement: convertToArrayAssignmentElement,\n            convertToObjectAssignmentElement: convertToObjectAssignmentElement,\n            convertToAssignmentPattern: convertToAssignmentPattern,\n            convertToObjectAssignmentPattern: convertToObjectAssignmentPattern,\n            convertToArrayAssignmentPattern: convertToArrayAssignmentPattern,\n            convertToAssignmentElementTarget: convertToAssignmentElementTarget,\n        };\n        function convertToFunctionBlock(node, multiLine) {\n            if (ts.isBlock(node))\n                return node;\n            var returnStatement = factory.createReturnStatement(node);\n            ts.setTextRange(returnStatement, node);\n            var body = factory.createBlock([returnStatement], multiLine);\n            ts.setTextRange(body, node);\n            return body;\n        }\n        function convertToFunctionExpression(node) {\n            if (!node.body)\n                return ts.Debug.fail(\"Cannot convert a FunctionDeclaration without a body\");\n            var updated = factory.createFunctionExpression(node.modifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body);\n            ts.setOriginalNode(updated, node);\n            ts.setTextRange(updated, node);\n            if (ts.getStartsOnNewLine(node)) {\n                ts.setStartsOnNewLine(updated, /*newLine*/ true);\n            }\n            return updated;\n        }\n        function convertToArrayAssignmentElement(element) {\n            if (ts.isBindingElement(element)) {\n                if (element.dotDotDotToken) {\n                    ts.Debug.assertNode(element.name, ts.isIdentifier);\n                    return ts.setOriginalNode(ts.setTextRange(factory.createSpreadElement(element.name), element), element);\n                }\n                var expression = convertToAssignmentElementTarget(element.name);\n                return element.initializer\n                    ? ts.setOriginalNode(ts.setTextRange(factory.createAssignment(expression, element.initializer), element), element)\n                    : expression;\n            }\n            return ts.cast(element, ts.isExpression);\n        }\n        function convertToObjectAssignmentElement(element) {\n            if (ts.isBindingElement(element)) {\n                if (element.dotDotDotToken) {\n                    ts.Debug.assertNode(element.name, ts.isIdentifier);\n                    return ts.setOriginalNode(ts.setTextRange(factory.createSpreadAssignment(element.name), element), element);\n                }\n                if (element.propertyName) {\n                    var expression = convertToAssignmentElementTarget(element.name);\n                    return ts.setOriginalNode(ts.setTextRange(factory.createPropertyAssignment(element.propertyName, element.initializer ? factory.createAssignment(expression, element.initializer) : expression), element), element);\n                }\n                ts.Debug.assertNode(element.name, ts.isIdentifier);\n                return ts.setOriginalNode(ts.setTextRange(factory.createShorthandPropertyAssignment(element.name, element.initializer), element), element);\n            }\n            return ts.cast(element, ts.isObjectLiteralElementLike);\n        }\n        function convertToAssignmentPattern(node) {\n            switch (node.kind) {\n                case 197 /* ArrayBindingPattern */:\n                case 199 /* ArrayLiteralExpression */:\n                    return convertToArrayAssignmentPattern(node);\n                case 196 /* ObjectBindingPattern */:\n                case 200 /* ObjectLiteralExpression */:\n                    return convertToObjectAssignmentPattern(node);\n            }\n        }\n        function convertToObjectAssignmentPattern(node) {\n            if (ts.isObjectBindingPattern(node)) {\n                return ts.setOriginalNode(ts.setTextRange(factory.createObjectLiteralExpression(ts.map(node.elements, convertToObjectAssignmentElement)), node), node);\n            }\n            return ts.cast(node, ts.isObjectLiteralExpression);\n        }\n        function convertToArrayAssignmentPattern(node) {\n            if (ts.isArrayBindingPattern(node)) {\n                return ts.setOriginalNode(ts.setTextRange(factory.createArrayLiteralExpression(ts.map(node.elements, convertToArrayAssignmentElement)), node), node);\n            }\n            return ts.cast(node, ts.isArrayLiteralExpression);\n        }\n        function convertToAssignmentElementTarget(node) {\n            if (ts.isBindingPattern(node)) {\n                return convertToAssignmentPattern(node);\n            }\n            return ts.cast(node, ts.isExpression);\n        }\n    }\n    ts.createNodeConverters = createNodeConverters;\n    ts.nullNodeConverters = {\n        convertToFunctionBlock: ts.notImplemented,\n        convertToFunctionExpression: ts.notImplemented,\n        convertToArrayAssignmentElement: ts.notImplemented,\n        convertToObjectAssignmentElement: ts.notImplemented,\n        convertToAssignmentPattern: ts.notImplemented,\n        convertToObjectAssignmentPattern: ts.notImplemented,\n        convertToArrayAssignmentPattern: ts.notImplemented,\n        convertToAssignmentElementTarget: ts.notImplemented,\n    };\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    var nextAutoGenerateId = 0;\n    /* @internal */\n    var NodeFactoryFlags;\n    (function (NodeFactoryFlags) {\n        NodeFactoryFlags[NodeFactoryFlags[\"None\"] = 0] = \"None\";\n        // Disables the parenthesizer rules for the factory.\n        NodeFactoryFlags[NodeFactoryFlags[\"NoParenthesizerRules\"] = 1] = \"NoParenthesizerRules\";\n        // Disables the node converters for the factory.\n        NodeFactoryFlags[NodeFactoryFlags[\"NoNodeConverters\"] = 2] = \"NoNodeConverters\";\n        // Ensures new `PropertyAccessExpression` nodes are created with the `NoIndentation` emit flag set.\n        NodeFactoryFlags[NodeFactoryFlags[\"NoIndentationOnFreshPropertyAccess\"] = 4] = \"NoIndentationOnFreshPropertyAccess\";\n        // Do not set an `original` pointer when updating a node.\n        NodeFactoryFlags[NodeFactoryFlags[\"NoOriginalNode\"] = 8] = \"NoOriginalNode\";\n    })(NodeFactoryFlags = ts.NodeFactoryFlags || (ts.NodeFactoryFlags = {}));\n    /**\n     * Creates a `NodeFactory` that can be used to create and update a syntax tree.\n     * @param flags Flags that control factory behavior.\n     * @param baseFactory A `BaseNodeFactory` used to create the base `Node` objects.\n     */\n    /* @internal */\n    function createNodeFactory(flags, baseFactory) {\n        var update = flags & 8 /* NoOriginalNode */ ? updateWithoutOriginal : updateWithOriginal;\n        // Lazily load the parenthesizer, node converters, and some factory methods until they are used.\n        var parenthesizerRules = ts.memoize(function () { return flags & 1 /* NoParenthesizerRules */ ? ts.nullParenthesizerRules : ts.createParenthesizerRules(factory); });\n        var converters = ts.memoize(function () { return flags & 2 /* NoNodeConverters */ ? ts.nullNodeConverters : ts.createNodeConverters(factory); });\n        // lazy initializaton of common operator factories\n        var getBinaryCreateFunction = ts.memoizeOne(function (operator) { return function (left, right) { return createBinaryExpression(left, operator, right); }; });\n        var getPrefixUnaryCreateFunction = ts.memoizeOne(function (operator) { return function (operand) { return createPrefixUnaryExpression(operator, operand); }; });\n        var getPostfixUnaryCreateFunction = ts.memoizeOne(function (operator) { return function (operand) { return createPostfixUnaryExpression(operand, operator); }; });\n        var getJSDocPrimaryTypeCreateFunction = ts.memoizeOne(function (kind) { return function () { return createJSDocPrimaryTypeWorker(kind); }; });\n        var getJSDocUnaryTypeCreateFunction = ts.memoizeOne(function (kind) { return function (type) { return createJSDocUnaryTypeWorker(kind, type); }; });\n        var getJSDocUnaryTypeUpdateFunction = ts.memoizeOne(function (kind) { return function (node, type) { return updateJSDocUnaryTypeWorker(kind, node, type); }; });\n        var getJSDocSimpleTagCreateFunction = ts.memoizeOne(function (kind) { return function (tagName, comment) { return createJSDocSimpleTagWorker(kind, tagName, comment); }; });\n        var getJSDocSimpleTagUpdateFunction = ts.memoizeOne(function (kind) { return function (node, tagName, comment) { return updateJSDocSimpleTagWorker(kind, node, tagName, comment); }; });\n        var getJSDocTypeLikeTagCreateFunction = ts.memoizeOne(function (kind) { return function (tagName, typeExpression, comment) { return createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment); }; });\n        var getJSDocTypeLikeTagUpdateFunction = ts.memoizeOne(function (kind) { return function (node, tagName, typeExpression, comment) { return updateJSDocTypeLikeTagWorker(kind, node, tagName, typeExpression, comment); }; });\n        var factory = {\n            get parenthesizer() { return parenthesizerRules(); },\n            get converters() { return converters(); },\n            createNodeArray: createNodeArray,\n            createNumericLiteral: createNumericLiteral,\n            createBigIntLiteral: createBigIntLiteral,\n            createStringLiteral: createStringLiteral,\n            createStringLiteralFromNode: createStringLiteralFromNode,\n            createRegularExpressionLiteral: createRegularExpressionLiteral,\n            createLiteralLikeNode: createLiteralLikeNode,\n            createIdentifier: createIdentifier,\n            updateIdentifier: updateIdentifier,\n            createTempVariable: createTempVariable,\n            createLoopVariable: createLoopVariable,\n            createUniqueName: createUniqueName,\n            getGeneratedNameForNode: getGeneratedNameForNode,\n            createPrivateIdentifier: createPrivateIdentifier,\n            createToken: createToken,\n            createSuper: createSuper,\n            createThis: createThis,\n            createNull: createNull,\n            createTrue: createTrue,\n            createFalse: createFalse,\n            createModifier: createModifier,\n            createModifiersFromModifierFlags: createModifiersFromModifierFlags,\n            createQualifiedName: createQualifiedName,\n            updateQualifiedName: updateQualifiedName,\n            createComputedPropertyName: createComputedPropertyName,\n            updateComputedPropertyName: updateComputedPropertyName,\n            createTypeParameterDeclaration: createTypeParameterDeclaration,\n            updateTypeParameterDeclaration: updateTypeParameterDeclaration,\n            createParameterDeclaration: createParameterDeclaration,\n            updateParameterDeclaration: updateParameterDeclaration,\n            createDecorator: createDecorator,\n            updateDecorator: updateDecorator,\n            createPropertySignature: createPropertySignature,\n            updatePropertySignature: updatePropertySignature,\n            createPropertyDeclaration: createPropertyDeclaration,\n            updatePropertyDeclaration: updatePropertyDeclaration,\n            createMethodSignature: createMethodSignature,\n            updateMethodSignature: updateMethodSignature,\n            createMethodDeclaration: createMethodDeclaration,\n            updateMethodDeclaration: updateMethodDeclaration,\n            createConstructorDeclaration: createConstructorDeclaration,\n            updateConstructorDeclaration: updateConstructorDeclaration,\n            createGetAccessorDeclaration: createGetAccessorDeclaration,\n            updateGetAccessorDeclaration: updateGetAccessorDeclaration,\n            createSetAccessorDeclaration: createSetAccessorDeclaration,\n            updateSetAccessorDeclaration: updateSetAccessorDeclaration,\n            createCallSignature: createCallSignature,\n            updateCallSignature: updateCallSignature,\n            createConstructSignature: createConstructSignature,\n            updateConstructSignature: updateConstructSignature,\n            createIndexSignature: createIndexSignature,\n            updateIndexSignature: updateIndexSignature,\n            createTemplateLiteralTypeSpan: createTemplateLiteralTypeSpan,\n            updateTemplateLiteralTypeSpan: updateTemplateLiteralTypeSpan,\n            createKeywordTypeNode: createKeywordTypeNode,\n            createTypePredicateNode: createTypePredicateNode,\n            updateTypePredicateNode: updateTypePredicateNode,\n            createTypeReferenceNode: createTypeReferenceNode,\n            updateTypeReferenceNode: updateTypeReferenceNode,\n            createFunctionTypeNode: createFunctionTypeNode,\n            updateFunctionTypeNode: updateFunctionTypeNode,\n            createConstructorTypeNode: createConstructorTypeNode,\n            updateConstructorTypeNode: updateConstructorTypeNode,\n            createTypeQueryNode: createTypeQueryNode,\n            updateTypeQueryNode: updateTypeQueryNode,\n            createTypeLiteralNode: createTypeLiteralNode,\n            updateTypeLiteralNode: updateTypeLiteralNode,\n            createArrayTypeNode: createArrayTypeNode,\n            updateArrayTypeNode: updateArrayTypeNode,\n            createTupleTypeNode: createTupleTypeNode,\n            updateTupleTypeNode: updateTupleTypeNode,\n            createNamedTupleMember: createNamedTupleMember,\n            updateNamedTupleMember: updateNamedTupleMember,\n            createOptionalTypeNode: createOptionalTypeNode,\n            updateOptionalTypeNode: updateOptionalTypeNode,\n            createRestTypeNode: createRestTypeNode,\n            updateRestTypeNode: updateRestTypeNode,\n            createUnionTypeNode: createUnionTypeNode,\n            updateUnionTypeNode: updateUnionTypeNode,\n            createIntersectionTypeNode: createIntersectionTypeNode,\n            updateIntersectionTypeNode: updateIntersectionTypeNode,\n            createConditionalTypeNode: createConditionalTypeNode,\n            updateConditionalTypeNode: updateConditionalTypeNode,\n            createInferTypeNode: createInferTypeNode,\n            updateInferTypeNode: updateInferTypeNode,\n            createImportTypeNode: createImportTypeNode,\n            updateImportTypeNode: updateImportTypeNode,\n            createParenthesizedType: createParenthesizedType,\n            updateParenthesizedType: updateParenthesizedType,\n            createThisTypeNode: createThisTypeNode,\n            createTypeOperatorNode: createTypeOperatorNode,\n            updateTypeOperatorNode: updateTypeOperatorNode,\n            createIndexedAccessTypeNode: createIndexedAccessTypeNode,\n            updateIndexedAccessTypeNode: updateIndexedAccessTypeNode,\n            createMappedTypeNode: createMappedTypeNode,\n            updateMappedTypeNode: updateMappedTypeNode,\n            createLiteralTypeNode: createLiteralTypeNode,\n            updateLiteralTypeNode: updateLiteralTypeNode,\n            createTemplateLiteralType: createTemplateLiteralType,\n            updateTemplateLiteralType: updateTemplateLiteralType,\n            createObjectBindingPattern: createObjectBindingPattern,\n            updateObjectBindingPattern: updateObjectBindingPattern,\n            createArrayBindingPattern: createArrayBindingPattern,\n            updateArrayBindingPattern: updateArrayBindingPattern,\n            createBindingElement: createBindingElement,\n            updateBindingElement: updateBindingElement,\n            createArrayLiteralExpression: createArrayLiteralExpression,\n            updateArrayLiteralExpression: updateArrayLiteralExpression,\n            createObjectLiteralExpression: createObjectLiteralExpression,\n            updateObjectLiteralExpression: updateObjectLiteralExpression,\n            createPropertyAccessExpression: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ?\n                function (expression, name) { return ts.setEmitFlags(createPropertyAccessExpression(expression, name), 131072 /* NoIndentation */); } :\n                createPropertyAccessExpression,\n            updatePropertyAccessExpression: updatePropertyAccessExpression,\n            createPropertyAccessChain: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ?\n                function (expression, questionDotToken, name) { return ts.setEmitFlags(createPropertyAccessChain(expression, questionDotToken, name), 131072 /* NoIndentation */); } :\n                createPropertyAccessChain,\n            updatePropertyAccessChain: updatePropertyAccessChain,\n            createElementAccessExpression: createElementAccessExpression,\n            updateElementAccessExpression: updateElementAccessExpression,\n            createElementAccessChain: createElementAccessChain,\n            updateElementAccessChain: updateElementAccessChain,\n            createCallExpression: createCallExpression,\n            updateCallExpression: updateCallExpression,\n            createCallChain: createCallChain,\n            updateCallChain: updateCallChain,\n            createNewExpression: createNewExpression,\n            updateNewExpression: updateNewExpression,\n            createTaggedTemplateExpression: createTaggedTemplateExpression,\n            updateTaggedTemplateExpression: updateTaggedTemplateExpression,\n            createTypeAssertion: createTypeAssertion,\n            updateTypeAssertion: updateTypeAssertion,\n            createParenthesizedExpression: createParenthesizedExpression,\n            updateParenthesizedExpression: updateParenthesizedExpression,\n            createFunctionExpression: createFunctionExpression,\n            updateFunctionExpression: updateFunctionExpression,\n            createArrowFunction: createArrowFunction,\n            updateArrowFunction: updateArrowFunction,\n            createDeleteExpression: createDeleteExpression,\n            updateDeleteExpression: updateDeleteExpression,\n            createTypeOfExpression: createTypeOfExpression,\n            updateTypeOfExpression: updateTypeOfExpression,\n            createVoidExpression: createVoidExpression,\n            updateVoidExpression: updateVoidExpression,\n            createAwaitExpression: createAwaitExpression,\n            updateAwaitExpression: updateAwaitExpression,\n            createPrefixUnaryExpression: createPrefixUnaryExpression,\n            updatePrefixUnaryExpression: updatePrefixUnaryExpression,\n            createPostfixUnaryExpression: createPostfixUnaryExpression,\n            updatePostfixUnaryExpression: updatePostfixUnaryExpression,\n            createBinaryExpression: createBinaryExpression,\n            updateBinaryExpression: updateBinaryExpression,\n            createConditionalExpression: createConditionalExpression,\n            updateConditionalExpression: updateConditionalExpression,\n            createTemplateExpression: createTemplateExpression,\n            updateTemplateExpression: updateTemplateExpression,\n            createTemplateHead: createTemplateHead,\n            createTemplateMiddle: createTemplateMiddle,\n            createTemplateTail: createTemplateTail,\n            createNoSubstitutionTemplateLiteral: createNoSubstitutionTemplateLiteral,\n            createTemplateLiteralLikeNode: createTemplateLiteralLikeNode,\n            createYieldExpression: createYieldExpression,\n            updateYieldExpression: updateYieldExpression,\n            createSpreadElement: createSpreadElement,\n            updateSpreadElement: updateSpreadElement,\n            createClassExpression: createClassExpression,\n            updateClassExpression: updateClassExpression,\n            createOmittedExpression: createOmittedExpression,\n            createExpressionWithTypeArguments: createExpressionWithTypeArguments,\n            updateExpressionWithTypeArguments: updateExpressionWithTypeArguments,\n            createAsExpression: createAsExpression,\n            updateAsExpression: updateAsExpression,\n            createNonNullExpression: createNonNullExpression,\n            updateNonNullExpression: updateNonNullExpression,\n            createNonNullChain: createNonNullChain,\n            updateNonNullChain: updateNonNullChain,\n            createMetaProperty: createMetaProperty,\n            updateMetaProperty: updateMetaProperty,\n            createTemplateSpan: createTemplateSpan,\n            updateTemplateSpan: updateTemplateSpan,\n            createSemicolonClassElement: createSemicolonClassElement,\n            createBlock: createBlock,\n            updateBlock: updateBlock,\n            createVariableStatement: createVariableStatement,\n            updateVariableStatement: updateVariableStatement,\n            createEmptyStatement: createEmptyStatement,\n            createExpressionStatement: createExpressionStatement,\n            updateExpressionStatement: updateExpressionStatement,\n            createIfStatement: createIfStatement,\n            updateIfStatement: updateIfStatement,\n            createDoStatement: createDoStatement,\n            updateDoStatement: updateDoStatement,\n            createWhileStatement: createWhileStatement,\n            updateWhileStatement: updateWhileStatement,\n            createForStatement: createForStatement,\n            updateForStatement: updateForStatement,\n            createForInStatement: createForInStatement,\n            updateForInStatement: updateForInStatement,\n            createForOfStatement: createForOfStatement,\n            updateForOfStatement: updateForOfStatement,\n            createContinueStatement: createContinueStatement,\n            updateContinueStatement: updateContinueStatement,\n            createBreakStatement: createBreakStatement,\n            updateBreakStatement: updateBreakStatement,\n            createReturnStatement: createReturnStatement,\n            updateReturnStatement: updateReturnStatement,\n            createWithStatement: createWithStatement,\n            updateWithStatement: updateWithStatement,\n            createSwitchStatement: createSwitchStatement,\n            updateSwitchStatement: updateSwitchStatement,\n            createLabeledStatement: createLabeledStatement,\n            updateLabeledStatement: updateLabeledStatement,\n            createThrowStatement: createThrowStatement,\n            updateThrowStatement: updateThrowStatement,\n            createTryStatement: createTryStatement,\n            updateTryStatement: updateTryStatement,\n            createDebuggerStatement: createDebuggerStatement,\n            createVariableDeclaration: createVariableDeclaration,\n            updateVariableDeclaration: updateVariableDeclaration,\n            createVariableDeclarationList: createVariableDeclarationList,\n            updateVariableDeclarationList: updateVariableDeclarationList,\n            createFunctionDeclaration: createFunctionDeclaration,\n            updateFunctionDeclaration: updateFunctionDeclaration,\n            createClassDeclaration: createClassDeclaration,\n            updateClassDeclaration: updateClassDeclaration,\n            createInterfaceDeclaration: createInterfaceDeclaration,\n            updateInterfaceDeclaration: updateInterfaceDeclaration,\n            createTypeAliasDeclaration: createTypeAliasDeclaration,\n            updateTypeAliasDeclaration: updateTypeAliasDeclaration,\n            createEnumDeclaration: createEnumDeclaration,\n            updateEnumDeclaration: updateEnumDeclaration,\n            createModuleDeclaration: createModuleDeclaration,\n            updateModuleDeclaration: updateModuleDeclaration,\n            createModuleBlock: createModuleBlock,\n            updateModuleBlock: updateModuleBlock,\n            createCaseBlock: createCaseBlock,\n            updateCaseBlock: updateCaseBlock,\n            createNamespaceExportDeclaration: createNamespaceExportDeclaration,\n            updateNamespaceExportDeclaration: updateNamespaceExportDeclaration,\n            createImportEqualsDeclaration: createImportEqualsDeclaration,\n            updateImportEqualsDeclaration: updateImportEqualsDeclaration,\n            createImportDeclaration: createImportDeclaration,\n            updateImportDeclaration: updateImportDeclaration,\n            createImportClause: createImportClause,\n            updateImportClause: updateImportClause,\n            createNamespaceImport: createNamespaceImport,\n            updateNamespaceImport: updateNamespaceImport,\n            createNamespaceExport: createNamespaceExport,\n            updateNamespaceExport: updateNamespaceExport,\n            createNamedImports: createNamedImports,\n            updateNamedImports: updateNamedImports,\n            createImportSpecifier: createImportSpecifier,\n            updateImportSpecifier: updateImportSpecifier,\n            createExportAssignment: createExportAssignment,\n            updateExportAssignment: updateExportAssignment,\n            createExportDeclaration: createExportDeclaration,\n            updateExportDeclaration: updateExportDeclaration,\n            createNamedExports: createNamedExports,\n            updateNamedExports: updateNamedExports,\n            createExportSpecifier: createExportSpecifier,\n            updateExportSpecifier: updateExportSpecifier,\n            createMissingDeclaration: createMissingDeclaration,\n            createExternalModuleReference: createExternalModuleReference,\n            updateExternalModuleReference: updateExternalModuleReference,\n            // lazily load factory members for JSDoc types with similar structure\n            get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(303 /* JSDocAllType */); },\n            get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(304 /* JSDocUnknownType */); },\n            get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(306 /* JSDocNonNullableType */); },\n            get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(306 /* JSDocNonNullableType */); },\n            get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(305 /* JSDocNullableType */); },\n            get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(305 /* JSDocNullableType */); },\n            get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(307 /* JSDocOptionalType */); },\n            get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(307 /* JSDocOptionalType */); },\n            get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(309 /* JSDocVariadicType */); },\n            get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(309 /* JSDocVariadicType */); },\n            get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(310 /* JSDocNamepathType */); },\n            get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(310 /* JSDocNamepathType */); },\n            createJSDocFunctionType: createJSDocFunctionType,\n            updateJSDocFunctionType: updateJSDocFunctionType,\n            createJSDocTypeLiteral: createJSDocTypeLiteral,\n            updateJSDocTypeLiteral: updateJSDocTypeLiteral,\n            createJSDocTypeExpression: createJSDocTypeExpression,\n            updateJSDocTypeExpression: updateJSDocTypeExpression,\n            createJSDocSignature: createJSDocSignature,\n            updateJSDocSignature: updateJSDocSignature,\n            createJSDocTemplateTag: createJSDocTemplateTag,\n            updateJSDocTemplateTag: updateJSDocTemplateTag,\n            createJSDocTypedefTag: createJSDocTypedefTag,\n            updateJSDocTypedefTag: updateJSDocTypedefTag,\n            createJSDocParameterTag: createJSDocParameterTag,\n            updateJSDocParameterTag: updateJSDocParameterTag,\n            createJSDocPropertyTag: createJSDocPropertyTag,\n            updateJSDocPropertyTag: updateJSDocPropertyTag,\n            createJSDocCallbackTag: createJSDocCallbackTag,\n            updateJSDocCallbackTag: updateJSDocCallbackTag,\n            createJSDocAugmentsTag: createJSDocAugmentsTag,\n            updateJSDocAugmentsTag: updateJSDocAugmentsTag,\n            createJSDocImplementsTag: createJSDocImplementsTag,\n            updateJSDocImplementsTag: updateJSDocImplementsTag,\n            createJSDocSeeTag: createJSDocSeeTag,\n            updateJSDocSeeTag: updateJSDocSeeTag,\n            createJSDocNameReference: createJSDocNameReference,\n            updateJSDocNameReference: updateJSDocNameReference,\n            // lazily load factory members for JSDoc tags with similar structure\n            get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(329 /* JSDocTypeTag */); },\n            get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(329 /* JSDocTypeTag */); },\n            get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(327 /* JSDocReturnTag */); },\n            get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(327 /* JSDocReturnTag */); },\n            get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(328 /* JSDocThisTag */); },\n            get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(328 /* JSDocThisTag */); },\n            get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(325 /* JSDocEnumTag */); },\n            get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(325 /* JSDocEnumTag */); },\n            get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(317 /* JSDocAuthorTag */); },\n            get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(317 /* JSDocAuthorTag */); },\n            get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(319 /* JSDocClassTag */); },\n            get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(319 /* JSDocClassTag */); },\n            get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(320 /* JSDocPublicTag */); },\n            get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(320 /* JSDocPublicTag */); },\n            get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(321 /* JSDocPrivateTag */); },\n            get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(321 /* JSDocPrivateTag */); },\n            get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(322 /* JSDocProtectedTag */); },\n            get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(322 /* JSDocProtectedTag */); },\n            get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(323 /* JSDocReadonlyTag */); },\n            get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(323 /* JSDocReadonlyTag */); },\n            get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(318 /* JSDocDeprecatedTag */); },\n            get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(318 /* JSDocDeprecatedTag */); },\n            createJSDocUnknownTag: createJSDocUnknownTag,\n            updateJSDocUnknownTag: updateJSDocUnknownTag,\n            createJSDocComment: createJSDocComment,\n            updateJSDocComment: updateJSDocComment,\n            createJsxElement: createJsxElement,\n            updateJsxElement: updateJsxElement,\n            createJsxSelfClosingElement: createJsxSelfClosingElement,\n            updateJsxSelfClosingElement: updateJsxSelfClosingElement,\n            createJsxOpeningElement: createJsxOpeningElement,\n            updateJsxOpeningElement: updateJsxOpeningElement,\n            createJsxClosingElement: createJsxClosingElement,\n            updateJsxClosingElement: updateJsxClosingElement,\n            createJsxFragment: createJsxFragment,\n            createJsxText: createJsxText,\n            updateJsxText: updateJsxText,\n            createJsxOpeningFragment: createJsxOpeningFragment,\n            createJsxJsxClosingFragment: createJsxJsxClosingFragment,\n            updateJsxFragment: updateJsxFragment,\n            createJsxAttribute: createJsxAttribute,\n            updateJsxAttribute: updateJsxAttribute,\n            createJsxAttributes: createJsxAttributes,\n            updateJsxAttributes: updateJsxAttributes,\n            createJsxSpreadAttribute: createJsxSpreadAttribute,\n            updateJsxSpreadAttribute: updateJsxSpreadAttribute,\n            createJsxExpression: createJsxExpression,\n            updateJsxExpression: updateJsxExpression,\n            createCaseClause: createCaseClause,\n            updateCaseClause: updateCaseClause,\n            createDefaultClause: createDefaultClause,\n            updateDefaultClause: updateDefaultClause,\n            createHeritageClause: createHeritageClause,\n            updateHeritageClause: updateHeritageClause,\n            createCatchClause: createCatchClause,\n            updateCatchClause: updateCatchClause,\n            createPropertyAssignment: createPropertyAssignment,\n            updatePropertyAssignment: updatePropertyAssignment,\n            createShorthandPropertyAssignment: createShorthandPropertyAssignment,\n            updateShorthandPropertyAssignment: updateShorthandPropertyAssignment,\n            createSpreadAssignment: createSpreadAssignment,\n            updateSpreadAssignment: updateSpreadAssignment,\n            createEnumMember: createEnumMember,\n            updateEnumMember: updateEnumMember,\n            createSourceFile: createSourceFile,\n            updateSourceFile: updateSourceFile,\n            createBundle: createBundle,\n            updateBundle: updateBundle,\n            createUnparsedSource: createUnparsedSource,\n            createUnparsedPrologue: createUnparsedPrologue,\n            createUnparsedPrepend: createUnparsedPrepend,\n            createUnparsedTextLike: createUnparsedTextLike,\n            createUnparsedSyntheticReference: createUnparsedSyntheticReference,\n            createInputFiles: createInputFiles,\n            createSyntheticExpression: createSyntheticExpression,\n            createSyntaxList: createSyntaxList,\n            createNotEmittedStatement: createNotEmittedStatement,\n            createPartiallyEmittedExpression: createPartiallyEmittedExpression,\n            updatePartiallyEmittedExpression: updatePartiallyEmittedExpression,\n            createCommaListExpression: createCommaListExpression,\n            updateCommaListExpression: updateCommaListExpression,\n            createEndOfDeclarationMarker: createEndOfDeclarationMarker,\n            createMergeDeclarationMarker: createMergeDeclarationMarker,\n            createSyntheticReferenceExpression: createSyntheticReferenceExpression,\n            updateSyntheticReferenceExpression: updateSyntheticReferenceExpression,\n            cloneNode: cloneNode,\n            // Lazily load factory methods for common operator factories and utilities\n            get createComma() { return getBinaryCreateFunction(27 /* CommaToken */); },\n            get createAssignment() { return getBinaryCreateFunction(62 /* EqualsToken */); },\n            get createLogicalOr() { return getBinaryCreateFunction(56 /* BarBarToken */); },\n            get createLogicalAnd() { return getBinaryCreateFunction(55 /* AmpersandAmpersandToken */); },\n            get createBitwiseOr() { return getBinaryCreateFunction(51 /* BarToken */); },\n            get createBitwiseXor() { return getBinaryCreateFunction(52 /* CaretToken */); },\n            get createBitwiseAnd() { return getBinaryCreateFunction(50 /* AmpersandToken */); },\n            get createStrictEquality() { return getBinaryCreateFunction(36 /* EqualsEqualsEqualsToken */); },\n            get createStrictInequality() { return getBinaryCreateFunction(37 /* ExclamationEqualsEqualsToken */); },\n            get createEquality() { return getBinaryCreateFunction(34 /* EqualsEqualsToken */); },\n            get createInequality() { return getBinaryCreateFunction(35 /* ExclamationEqualsToken */); },\n            get createLessThan() { return getBinaryCreateFunction(29 /* LessThanToken */); },\n            get createLessThanEquals() { return getBinaryCreateFunction(32 /* LessThanEqualsToken */); },\n            get createGreaterThan() { return getBinaryCreateFunction(31 /* GreaterThanToken */); },\n            get createGreaterThanEquals() { return getBinaryCreateFunction(33 /* GreaterThanEqualsToken */); },\n            get createLeftShift() { return getBinaryCreateFunction(47 /* LessThanLessThanToken */); },\n            get createRightShift() { return getBinaryCreateFunction(48 /* GreaterThanGreaterThanToken */); },\n            get createUnsignedRightShift() { return getBinaryCreateFunction(49 /* GreaterThanGreaterThanGreaterThanToken */); },\n            get createAdd() { return getBinaryCreateFunction(39 /* PlusToken */); },\n            get createSubtract() { return getBinaryCreateFunction(40 /* MinusToken */); },\n            get createMultiply() { return getBinaryCreateFunction(41 /* AsteriskToken */); },\n            get createDivide() { return getBinaryCreateFunction(43 /* SlashToken */); },\n            get createModulo() { return getBinaryCreateFunction(44 /* PercentToken */); },\n            get createExponent() { return getBinaryCreateFunction(42 /* AsteriskAsteriskToken */); },\n            get createPrefixPlus() { return getPrefixUnaryCreateFunction(39 /* PlusToken */); },\n            get createPrefixMinus() { return getPrefixUnaryCreateFunction(40 /* MinusToken */); },\n            get createPrefixIncrement() { return getPrefixUnaryCreateFunction(45 /* PlusPlusToken */); },\n            get createPrefixDecrement() { return getPrefixUnaryCreateFunction(46 /* MinusMinusToken */); },\n            get createBitwiseNot() { return getPrefixUnaryCreateFunction(54 /* TildeToken */); },\n            get createLogicalNot() { return getPrefixUnaryCreateFunction(53 /* ExclamationToken */); },\n            get createPostfixIncrement() { return getPostfixUnaryCreateFunction(45 /* PlusPlusToken */); },\n            get createPostfixDecrement() { return getPostfixUnaryCreateFunction(46 /* MinusMinusToken */); },\n            // Compound nodes\n            createImmediatelyInvokedFunctionExpression: createImmediatelyInvokedFunctionExpression,\n            createImmediatelyInvokedArrowFunction: createImmediatelyInvokedArrowFunction,\n            createVoidZero: createVoidZero,\n            createExportDefault: createExportDefault,\n            createExternalModuleExport: createExternalModuleExport,\n            createTypeCheck: createTypeCheck,\n            createMethodCall: createMethodCall,\n            createGlobalMethodCall: createGlobalMethodCall,\n            createFunctionBindCall: createFunctionBindCall,\n            createFunctionCallCall: createFunctionCallCall,\n            createFunctionApplyCall: createFunctionApplyCall,\n            createArraySliceCall: createArraySliceCall,\n            createArrayConcatCall: createArrayConcatCall,\n            createObjectDefinePropertyCall: createObjectDefinePropertyCall,\n            createPropertyDescriptor: createPropertyDescriptor,\n            createCallBinding: createCallBinding,\n            // Utilities\n            inlineExpressions: inlineExpressions,\n            getInternalName: getInternalName,\n            getLocalName: getLocalName,\n            getExportName: getExportName,\n            getDeclarationName: getDeclarationName,\n            getNamespaceMemberName: getNamespaceMemberName,\n            getExternalModuleOrNamespaceExportName: getExternalModuleOrNamespaceExportName,\n            restoreOuterExpressions: restoreOuterExpressions,\n            restoreEnclosingLabel: restoreEnclosingLabel,\n            createUseStrictPrologue: createUseStrictPrologue,\n            copyPrologue: copyPrologue,\n            copyStandardPrologue: copyStandardPrologue,\n            copyCustomPrologue: copyCustomPrologue,\n            ensureUseStrict: ensureUseStrict,\n            liftToBlock: liftToBlock,\n            mergeLexicalEnvironment: mergeLexicalEnvironment,\n            updateModifiers: updateModifiers,\n        };\n        return factory;\n        // @api\n        function createNodeArray(elements, hasTrailingComma) {\n            if (elements === undefined || elements === ts.emptyArray) {\n                elements = [];\n            }\n            else if (ts.isNodeArray(elements)) {\n                // Ensure the transform flags have been aggregated for this NodeArray\n                if (elements.transformFlags === undefined) {\n                    aggregateChildrenFlags(elements);\n                }\n                ts.Debug.attachNodeArrayDebugInfo(elements);\n                return elements;\n            }\n            // Since the element list of a node array is typically created by starting with an empty array and\n            // repeatedly calling push(), the list may not have the optimal memory layout. We invoke slice() for\n            // small arrays (1 to 4 elements) to give the VM a chance to allocate an optimal representation.\n            var length = elements.length;\n            var array = (length >= 1 && length <= 4 ? elements.slice() : elements);\n            ts.setTextRangePosEnd(array, -1, -1);\n            array.hasTrailingComma = !!hasTrailingComma;\n            aggregateChildrenFlags(array);\n            ts.Debug.attachNodeArrayDebugInfo(array);\n            return array;\n        }\n        function createBaseNode(kind) {\n            return baseFactory.createBaseNode(kind);\n        }\n        function createBaseDeclaration(kind, decorators, modifiers) {\n            var node = createBaseNode(kind);\n            node.decorators = asNodeArray(decorators);\n            node.modifiers = asNodeArray(modifiers);\n            node.transformFlags |=\n                propagateChildrenFlags(node.decorators) |\n                    propagateChildrenFlags(node.modifiers);\n            // NOTE: The following properties are commonly set by the binder and are added here to\n            // ensure declarations have a stable shape.\n            node.symbol = undefined; // initialized by binder\n            node.localSymbol = undefined; // initialized by binder\n            node.locals = undefined; // initialized by binder\n            node.nextContainer = undefined; // initialized by binder\n            return node;\n        }\n        function createBaseNamedDeclaration(kind, decorators, modifiers, name) {\n            var node = createBaseDeclaration(kind, decorators, modifiers);\n            name = asName(name);\n            node.name = name;\n            // The PropertyName of a member is allowed to be `await`.\n            // We don't need to exclude `await` for type signatures since types\n            // don't propagate child flags.\n            if (name) {\n                switch (node.kind) {\n                    case 165 /* MethodDeclaration */:\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                    case 163 /* PropertyDeclaration */:\n                    case 288 /* PropertyAssignment */:\n                        if (ts.isIdentifier(name)) {\n                            node.transformFlags |= propagateIdentifierNameFlags(name);\n                            break;\n                        }\n                    // fall through\n                    default:\n                        node.transformFlags |= propagateChildFlags(name);\n                        break;\n                }\n            }\n            return node;\n        }\n        function createBaseGenericNamedDeclaration(kind, decorators, modifiers, name, typeParameters) {\n            var node = createBaseNamedDeclaration(kind, decorators, modifiers, name);\n            node.typeParameters = asNodeArray(typeParameters);\n            node.transformFlags |= propagateChildrenFlags(node.typeParameters);\n            if (typeParameters)\n                node.transformFlags |= 1 /* ContainsTypeScript */;\n            return node;\n        }\n        function createBaseSignatureDeclaration(kind, decorators, modifiers, name, typeParameters, parameters, type) {\n            var node = createBaseGenericNamedDeclaration(kind, decorators, modifiers, name, typeParameters);\n            node.parameters = createNodeArray(parameters);\n            node.type = type;\n            node.transformFlags |=\n                propagateChildrenFlags(node.parameters) |\n                    propagateChildFlags(node.type);\n            if (type)\n                node.transformFlags |= 1 /* ContainsTypeScript */;\n            return node;\n        }\n        function updateBaseSignatureDeclaration(updated, original) {\n            // copy children used only for error reporting\n            if (original.typeArguments)\n                updated.typeArguments = original.typeArguments;\n            return update(updated, original);\n        }\n        function createBaseFunctionLikeDeclaration(kind, decorators, modifiers, name, typeParameters, parameters, type, body) {\n            var node = createBaseSignatureDeclaration(kind, decorators, modifiers, name, typeParameters, parameters, type);\n            node.body = body;\n            node.transformFlags |= propagateChildFlags(node.body) & ~8388608 /* ContainsPossibleTopLevelAwait */;\n            if (!body)\n                node.transformFlags |= 1 /* ContainsTypeScript */;\n            return node;\n        }\n        function updateBaseFunctionLikeDeclaration(updated, original) {\n            // copy children used only for error reporting\n            if (original.exclamationToken)\n                updated.exclamationToken = original.exclamationToken;\n            if (original.typeArguments)\n                updated.typeArguments = original.typeArguments;\n            return updateBaseSignatureDeclaration(updated, original);\n        }\n        function createBaseInterfaceOrClassLikeDeclaration(kind, decorators, modifiers, name, typeParameters, heritageClauses) {\n            var node = createBaseGenericNamedDeclaration(kind, decorators, modifiers, name, typeParameters);\n            node.heritageClauses = asNodeArray(heritageClauses);\n            node.transformFlags |= propagateChildrenFlags(node.heritageClauses);\n            return node;\n        }\n        function createBaseClassLikeDeclaration(kind, decorators, modifiers, name, typeParameters, heritageClauses, members) {\n            var node = createBaseInterfaceOrClassLikeDeclaration(kind, decorators, modifiers, name, typeParameters, heritageClauses);\n            node.members = createNodeArray(members);\n            node.transformFlags |= propagateChildrenFlags(node.members);\n            return node;\n        }\n        function createBaseBindingLikeDeclaration(kind, decorators, modifiers, name, initializer) {\n            var node = createBaseNamedDeclaration(kind, decorators, modifiers, name);\n            node.initializer = initializer;\n            node.transformFlags |= propagateChildFlags(node.initializer);\n            return node;\n        }\n        function createBaseVariableLikeDeclaration(kind, decorators, modifiers, name, type, initializer) {\n            var node = createBaseBindingLikeDeclaration(kind, decorators, modifiers, name, initializer);\n            node.type = type;\n            node.transformFlags |= propagateChildFlags(type);\n            if (type)\n                node.transformFlags |= 1 /* ContainsTypeScript */;\n            return node;\n        }\n        //\n        // Literals\n        //\n        function createBaseLiteral(kind, text) {\n            var node = createBaseToken(kind);\n            node.text = text;\n            return node;\n        }\n        // @api\n        function createNumericLiteral(value, numericLiteralFlags) {\n            if (numericLiteralFlags === void 0) { numericLiteralFlags = 0 /* None */; }\n            var node = createBaseLiteral(8 /* NumericLiteral */, typeof value === \"number\" ? value + \"\" : value);\n            node.numericLiteralFlags = numericLiteralFlags;\n            if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)\n                node.transformFlags |= 256 /* ContainsES2015 */;\n            return node;\n        }\n        // @api\n        function createBigIntLiteral(value) {\n            var node = createBaseLiteral(9 /* BigIntLiteral */, typeof value === \"string\" ? value : ts.pseudoBigIntToString(value) + \"n\");\n            node.transformFlags |= 4 /* ContainsESNext */;\n            return node;\n        }\n        function createBaseStringLiteral(text, isSingleQuote) {\n            var node = createBaseLiteral(10 /* StringLiteral */, text);\n            node.singleQuote = isSingleQuote;\n            return node;\n        }\n        // @api\n        function createStringLiteral(text, isSingleQuote, hasExtendedUnicodeEscape) {\n            var node = createBaseStringLiteral(text, isSingleQuote);\n            node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;\n            if (hasExtendedUnicodeEscape)\n                node.transformFlags |= 256 /* ContainsES2015 */;\n            return node;\n        }\n        // @api\n        function createStringLiteralFromNode(sourceNode) {\n            var node = createBaseStringLiteral(ts.getTextOfIdentifierOrLiteral(sourceNode), /*isSingleQuote*/ undefined);\n            node.textSourceNode = sourceNode;\n            return node;\n        }\n        // @api\n        function createRegularExpressionLiteral(text) {\n            var node = createBaseLiteral(13 /* RegularExpressionLiteral */, text);\n            return node;\n        }\n        // @api\n        function createLiteralLikeNode(kind, text) {\n            switch (kind) {\n                case 8 /* NumericLiteral */: return createNumericLiteral(text, /*numericLiteralFlags*/ 0);\n                case 9 /* BigIntLiteral */: return createBigIntLiteral(text);\n                case 10 /* StringLiteral */: return createStringLiteral(text, /*isSingleQuote*/ undefined);\n                case 11 /* JsxText */: return createJsxText(text, /*containsOnlyTriviaWhiteSpaces*/ false);\n                case 12 /* JsxTextAllWhiteSpaces */: return createJsxText(text, /*containsOnlyTriviaWhiteSpaces*/ true);\n                case 13 /* RegularExpressionLiteral */: return createRegularExpressionLiteral(text);\n                case 14 /* NoSubstitutionTemplateLiteral */: return createTemplateLiteralLikeNode(kind, text, /*rawText*/ undefined, /*templateFlags*/ 0);\n            }\n        }\n        //\n        // Identifiers\n        //\n        function createBaseIdentifier(text, originalKeywordKind) {\n            if (originalKeywordKind === undefined && text) {\n                originalKeywordKind = ts.stringToToken(text);\n            }\n            if (originalKeywordKind === 78 /* Identifier */) {\n                originalKeywordKind = undefined;\n            }\n            var node = baseFactory.createBaseIdentifierNode(78 /* Identifier */);\n            node.originalKeywordKind = originalKeywordKind;\n            node.escapedText = ts.escapeLeadingUnderscores(text);\n            return node;\n        }\n        function createBaseGeneratedIdentifier(text, autoGenerateFlags) {\n            var node = createBaseIdentifier(text, /*originalKeywordKind*/ undefined);\n            node.autoGenerateFlags = autoGenerateFlags;\n            node.autoGenerateId = nextAutoGenerateId;\n            nextAutoGenerateId++;\n            return node;\n        }\n        // @api\n        function createIdentifier(text, typeArguments, originalKeywordKind) {\n            var node = createBaseIdentifier(text, originalKeywordKind);\n            if (typeArguments) {\n                // NOTE: we do not use `setChildren` here because typeArguments in an identifier do not contribute to transformations\n                node.typeArguments = createNodeArray(typeArguments);\n            }\n            if (node.originalKeywordKind === 130 /* AwaitKeyword */) {\n                node.transformFlags |= 8388608 /* ContainsPossibleTopLevelAwait */;\n            }\n            return node;\n        }\n        // @api\n        function updateIdentifier(node, typeArguments) {\n            return node.typeArguments !== typeArguments\n                ? update(createIdentifier(ts.idText(node), typeArguments), node)\n                : node;\n        }\n        // @api\n        function createTempVariable(recordTempVariable, reservedInNestedScopes) {\n            var flags = 1 /* Auto */;\n            if (reservedInNestedScopes)\n                flags |= 8 /* ReservedInNestedScopes */;\n            var name = createBaseGeneratedIdentifier(\"\", flags);\n            if (recordTempVariable) {\n                recordTempVariable(name);\n            }\n            return name;\n        }\n        /** Create a unique temporary variable for use in a loop. */\n        // @api\n        function createLoopVariable() {\n            return createBaseGeneratedIdentifier(\"\", 2 /* Loop */);\n        }\n        /** Create a unique name based on the supplied text. */\n        // @api\n        function createUniqueName(text, flags) {\n            if (flags === void 0) { flags = 0 /* None */; }\n            ts.Debug.assert(!(flags & 7 /* KindMask */), \"Argument out of range: flags\");\n            ts.Debug.assert((flags & (16 /* Optimistic */ | 32 /* FileLevel */)) !== 32 /* FileLevel */, \"GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic\");\n            return createBaseGeneratedIdentifier(text, 3 /* Unique */ | flags);\n        }\n        /** Create a unique name generated for a node. */\n        // @api\n        function getGeneratedNameForNode(node, flags) {\n            if (flags === void 0) { flags = 0; }\n            ts.Debug.assert(!(flags & 7 /* KindMask */), \"Argument out of range: flags\");\n            var name = createBaseGeneratedIdentifier(node && ts.isIdentifier(node) ? ts.idText(node) : \"\", 4 /* Node */ | flags);\n            name.original = node;\n            return name;\n        }\n        // @api\n        function createPrivateIdentifier(text) {\n            if (!ts.startsWith(text, \"#\"))\n                ts.Debug.fail(\"First character of private identifier must be #: \" + text);\n            var node = baseFactory.createBasePrivateIdentifierNode(79 /* PrivateIdentifier */);\n            node.escapedText = ts.escapeLeadingUnderscores(text);\n            node.transformFlags |= 4194304 /* ContainsClassFields */;\n            return node;\n        }\n        //\n        // Punctuation\n        //\n        function createBaseToken(kind) {\n            return baseFactory.createBaseTokenNode(kind);\n        }\n        function createToken(token) {\n            ts.Debug.assert(token >= 0 /* FirstToken */ && token <= 156 /* LastToken */, \"Invalid token\");\n            ts.Debug.assert(token <= 14 /* FirstTemplateToken */ || token >= 17 /* LastTemplateToken */, \"Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals.\");\n            ts.Debug.assert(token <= 8 /* FirstLiteralToken */ || token >= 14 /* LastLiteralToken */, \"Invalid token. Use 'createLiteralLikeNode' to create literals.\");\n            ts.Debug.assert(token !== 78 /* Identifier */, \"Invalid token. Use 'createIdentifier' to create identifiers\");\n            var node = createBaseToken(token);\n            var transformFlags = 0 /* None */;\n            switch (token) {\n                case 129 /* AsyncKeyword */:\n                    // 'async' modifier is ES2017 (async functions) or ES2018 (async generators)\n                    transformFlags =\n                        64 /* ContainsES2017 */ |\n                            32 /* ContainsES2018 */;\n                    break;\n                case 122 /* PublicKeyword */:\n                case 120 /* PrivateKeyword */:\n                case 121 /* ProtectedKeyword */:\n                case 142 /* ReadonlyKeyword */:\n                case 125 /* AbstractKeyword */:\n                case 133 /* DeclareKeyword */:\n                case 84 /* ConstKeyword */:\n                case 128 /* AnyKeyword */:\n                case 144 /* NumberKeyword */:\n                case 155 /* BigIntKeyword */:\n                case 141 /* NeverKeyword */:\n                case 145 /* ObjectKeyword */:\n                case 147 /* StringKeyword */:\n                case 131 /* BooleanKeyword */:\n                case 148 /* SymbolKeyword */:\n                case 113 /* VoidKeyword */:\n                case 152 /* UnknownKeyword */:\n                case 150 /* UndefinedKeyword */: // `undefined` is an Identifier in the expression case.\n                    transformFlags = 1 /* ContainsTypeScript */;\n                    break;\n                case 123 /* StaticKeyword */:\n                case 105 /* SuperKeyword */:\n                    transformFlags = 256 /* ContainsES2015 */;\n                    break;\n                case 107 /* ThisKeyword */:\n                    // 'this' indicates a lexical 'this'\n                    transformFlags = 4096 /* ContainsLexicalThis */;\n                    break;\n            }\n            if (transformFlags) {\n                node.transformFlags |= transformFlags;\n            }\n            return node;\n        }\n        //\n        // Reserved words\n        //\n        // @api\n        function createSuper() {\n            return createToken(105 /* SuperKeyword */);\n        }\n        // @api\n        function createThis() {\n            return createToken(107 /* ThisKeyword */);\n        }\n        // @api\n        function createNull() {\n            return createToken(103 /* NullKeyword */);\n        }\n        // @api\n        function createTrue() {\n            return createToken(109 /* TrueKeyword */);\n        }\n        // @api\n        function createFalse() {\n            return createToken(94 /* FalseKeyword */);\n        }\n        //\n        // Modifiers\n        //\n        // @api\n        function createModifier(kind) {\n            return createToken(kind);\n        }\n        // @api\n        function createModifiersFromModifierFlags(flags) {\n            var result = [];\n            if (flags & 1 /* Export */) {\n                result.push(createModifier(92 /* ExportKeyword */));\n            }\n            if (flags & 2 /* Ambient */) {\n                result.push(createModifier(133 /* DeclareKeyword */));\n            }\n            if (flags & 512 /* Default */) {\n                result.push(createModifier(87 /* DefaultKeyword */));\n            }\n            if (flags & 2048 /* Const */) {\n                result.push(createModifier(84 /* ConstKeyword */));\n            }\n            if (flags & 4 /* Public */) {\n                result.push(createModifier(122 /* PublicKeyword */));\n            }\n            if (flags & 8 /* Private */) {\n                result.push(createModifier(120 /* PrivateKeyword */));\n            }\n            if (flags & 16 /* Protected */) {\n                result.push(createModifier(121 /* ProtectedKeyword */));\n            }\n            if (flags & 128 /* Abstract */) {\n                result.push(createModifier(125 /* AbstractKeyword */));\n            }\n            if (flags & 32 /* Static */) {\n                result.push(createModifier(123 /* StaticKeyword */));\n            }\n            if (flags & 64 /* Readonly */) {\n                result.push(createModifier(142 /* ReadonlyKeyword */));\n            }\n            if (flags & 256 /* Async */) {\n                result.push(createModifier(129 /* AsyncKeyword */));\n            }\n            return result;\n        }\n        //\n        // Names\n        //\n        // @api\n        function createQualifiedName(left, right) {\n            var node = createBaseNode(157 /* QualifiedName */);\n            node.left = left;\n            node.right = asName(right);\n            node.transformFlags |=\n                propagateChildFlags(node.left) |\n                    propagateIdentifierNameFlags(node.right);\n            return node;\n        }\n        // @api\n        function updateQualifiedName(node, left, right) {\n            return node.left !== left\n                || node.right !== right\n                ? update(createQualifiedName(left, right), node)\n                : node;\n        }\n        // @api\n        function createComputedPropertyName(expression) {\n            var node = createBaseNode(158 /* ComputedPropertyName */);\n            node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression);\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    256 /* ContainsES2015 */ |\n                    32768 /* ContainsComputedPropertyName */;\n            return node;\n        }\n        // @api\n        function updateComputedPropertyName(node, expression) {\n            return node.expression !== expression\n                ? update(createComputedPropertyName(expression), node)\n                : node;\n        }\n        //\n        // Signature elements\n        //\n        // @api\n        function createTypeParameterDeclaration(name, constraint, defaultType) {\n            var node = createBaseNamedDeclaration(159 /* TypeParameter */, \n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, name);\n            node.constraint = constraint;\n            node.default = defaultType;\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateTypeParameterDeclaration(node, name, constraint, defaultType) {\n            return node.name !== name\n                || node.constraint !== constraint\n                || node.default !== defaultType\n                ? update(createTypeParameterDeclaration(name, constraint, defaultType), node)\n                : node;\n        }\n        // @api\n        function createParameterDeclaration(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) {\n            var node = createBaseVariableLikeDeclaration(160 /* Parameter */, decorators, modifiers, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer));\n            node.dotDotDotToken = dotDotDotToken;\n            node.questionToken = questionToken;\n            if (ts.isThisIdentifier(node.name)) {\n                node.transformFlags = 1 /* ContainsTypeScript */;\n            }\n            else {\n                node.transformFlags |=\n                    propagateChildFlags(node.dotDotDotToken) |\n                        propagateChildFlags(node.questionToken);\n                if (questionToken)\n                    node.transformFlags |= 1 /* ContainsTypeScript */;\n                if (ts.modifiersToFlags(node.modifiers) & 92 /* ParameterPropertyModifier */)\n                    node.transformFlags |= 2048 /* ContainsTypeScriptClassSyntax */;\n                if (initializer || dotDotDotToken)\n                    node.transformFlags |= 256 /* ContainsES2015 */;\n            }\n            return node;\n        }\n        // @api\n        function updateParameterDeclaration(node, decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.dotDotDotToken !== dotDotDotToken\n                || node.name !== name\n                || node.questionToken !== questionToken\n                || node.type !== type\n                || node.initializer !== initializer\n                ? update(createParameterDeclaration(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer), node)\n                : node;\n        }\n        // @api\n        function createDecorator(expression) {\n            var node = createBaseNode(161 /* Decorator */);\n            node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    1 /* ContainsTypeScript */ |\n                    2048 /* ContainsTypeScriptClassSyntax */;\n            return node;\n        }\n        // @api\n        function updateDecorator(node, expression) {\n            return node.expression !== expression\n                ? update(createDecorator(expression), node)\n                : node;\n        }\n        //\n        // Type Elements\n        //\n        // @api\n        function createPropertySignature(modifiers, name, questionToken, type) {\n            var node = createBaseNamedDeclaration(162 /* PropertySignature */, \n            /*decorators*/ undefined, modifiers, name);\n            node.type = type;\n            node.questionToken = questionToken;\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updatePropertySignature(node, modifiers, name, questionToken, type) {\n            return node.modifiers !== modifiers\n                || node.name !== name\n                || node.questionToken !== questionToken\n                || node.type !== type\n                ? update(createPropertySignature(modifiers, name, questionToken, type), node)\n                : node;\n        }\n        // @api\n        function createPropertyDeclaration(decorators, modifiers, name, questionOrExclamationToken, type, initializer) {\n            var node = createBaseVariableLikeDeclaration(163 /* PropertyDeclaration */, decorators, modifiers, name, type, initializer);\n            node.questionToken = questionOrExclamationToken && ts.isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined;\n            node.exclamationToken = questionOrExclamationToken && ts.isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined;\n            node.transformFlags |=\n                propagateChildFlags(node.questionToken) |\n                    propagateChildFlags(node.exclamationToken) |\n                    4194304 /* ContainsClassFields */;\n            if (ts.isComputedPropertyName(node.name) || (ts.hasStaticModifier(node) && node.initializer)) {\n                node.transformFlags |= 2048 /* ContainsTypeScriptClassSyntax */;\n            }\n            if (questionOrExclamationToken || ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) {\n                node.transformFlags |= 1 /* ContainsTypeScript */;\n            }\n            return node;\n        }\n        // @api\n        function updatePropertyDeclaration(node, decorators, modifiers, name, questionOrExclamationToken, type, initializer) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.name !== name\n                || node.questionToken !== (questionOrExclamationToken !== undefined && ts.isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined)\n                || node.exclamationToken !== (questionOrExclamationToken !== undefined && ts.isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined)\n                || node.type !== type\n                || node.initializer !== initializer\n                ? update(createPropertyDeclaration(decorators, modifiers, name, questionOrExclamationToken, type, initializer), node)\n                : node;\n        }\n        // @api\n        function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) {\n            var node = createBaseSignatureDeclaration(164 /* MethodSignature */, \n            /*decorators*/ undefined, modifiers, name, typeParameters, parameters, type);\n            node.questionToken = questionToken;\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateMethodSignature(node, modifiers, name, questionToken, typeParameters, parameters, type) {\n            return node.modifiers !== modifiers\n                || node.name !== name\n                || node.questionToken !== questionToken\n                || node.typeParameters !== typeParameters\n                || node.parameters !== parameters\n                || node.type !== type\n                ? updateBaseSignatureDeclaration(createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type), node)\n                : node;\n        }\n        // @api\n        function createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {\n            var node = createBaseFunctionLikeDeclaration(165 /* MethodDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body);\n            node.asteriskToken = asteriskToken;\n            node.questionToken = questionToken;\n            node.transformFlags |=\n                propagateChildFlags(node.asteriskToken) |\n                    propagateChildFlags(node.questionToken) |\n                    256 /* ContainsES2015 */;\n            if (questionToken) {\n                node.transformFlags |= 1 /* ContainsTypeScript */;\n            }\n            if (ts.modifiersToFlags(node.modifiers) & 256 /* Async */) {\n                if (asteriskToken) {\n                    node.transformFlags |= 32 /* ContainsES2018 */;\n                }\n                else {\n                    node.transformFlags |= 64 /* ContainsES2017 */;\n                }\n            }\n            else if (asteriskToken) {\n                node.transformFlags |= 512 /* ContainsGenerator */;\n            }\n            return node;\n        }\n        // @api\n        function updateMethodDeclaration(node, decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.asteriskToken !== asteriskToken\n                || node.name !== name\n                || node.questionToken !== questionToken\n                || node.typeParameters !== typeParameters\n                || node.parameters !== parameters\n                || node.type !== type\n                || node.body !== body\n                ? updateBaseFunctionLikeDeclaration(createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body), node)\n                : node;\n        }\n        // @api\n        function createConstructorDeclaration(decorators, modifiers, parameters, body) {\n            var node = createBaseFunctionLikeDeclaration(166 /* Constructor */, decorators, modifiers, \n            /*name*/ undefined, \n            /*typeParameters*/ undefined, parameters, \n            /*type*/ undefined, body);\n            node.transformFlags |= 256 /* ContainsES2015 */;\n            return node;\n        }\n        // @api\n        function updateConstructorDeclaration(node, decorators, modifiers, parameters, body) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.parameters !== parameters\n                || node.body !== body\n                ? updateBaseFunctionLikeDeclaration(createConstructorDeclaration(decorators, modifiers, parameters, body), node)\n                : node;\n        }\n        // @api\n        function createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body) {\n            return createBaseFunctionLikeDeclaration(167 /* GetAccessor */, decorators, modifiers, name, \n            /*typeParameters*/ undefined, parameters, type, body);\n        }\n        // @api\n        function updateGetAccessorDeclaration(node, decorators, modifiers, name, parameters, type, body) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.name !== name\n                || node.parameters !== parameters\n                || node.type !== type\n                || node.body !== body\n                ? updateBaseFunctionLikeDeclaration(createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body), node)\n                : node;\n        }\n        // @api\n        function createSetAccessorDeclaration(decorators, modifiers, name, parameters, body) {\n            return createBaseFunctionLikeDeclaration(168 /* SetAccessor */, decorators, modifiers, name, \n            /*typeParameters*/ undefined, parameters, \n            /*type*/ undefined, body);\n        }\n        // @api\n        function updateSetAccessorDeclaration(node, decorators, modifiers, name, parameters, body) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.name !== name\n                || node.parameters !== parameters\n                || node.body !== body\n                ? updateBaseFunctionLikeDeclaration(createSetAccessorDeclaration(decorators, modifiers, name, parameters, body), node)\n                : node;\n        }\n        // @api\n        function createCallSignature(typeParameters, parameters, type) {\n            var node = createBaseSignatureDeclaration(169 /* CallSignature */, \n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, \n            /*name*/ undefined, typeParameters, parameters, type);\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateCallSignature(node, typeParameters, parameters, type) {\n            return node.typeParameters !== typeParameters\n                || node.parameters !== parameters\n                || node.type !== type\n                ? updateBaseSignatureDeclaration(createCallSignature(typeParameters, parameters, type), node)\n                : node;\n        }\n        // @api\n        function createConstructSignature(typeParameters, parameters, type) {\n            var node = createBaseSignatureDeclaration(170 /* ConstructSignature */, \n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, \n            /*name*/ undefined, typeParameters, parameters, type);\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateConstructSignature(node, typeParameters, parameters, type) {\n            return node.typeParameters !== typeParameters\n                || node.parameters !== parameters\n                || node.type !== type\n                ? updateBaseSignatureDeclaration(createConstructSignature(typeParameters, parameters, type), node)\n                : node;\n        }\n        // @api\n        function createIndexSignature(decorators, modifiers, parameters, type) {\n            var node = createBaseSignatureDeclaration(171 /* IndexSignature */, decorators, modifiers, \n            /*name*/ undefined, \n            /*typeParameters*/ undefined, parameters, type);\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateIndexSignature(node, decorators, modifiers, parameters, type) {\n            return node.parameters !== parameters\n                || node.type !== type\n                || node.decorators !== decorators\n                || node.modifiers !== modifiers\n                ? updateBaseSignatureDeclaration(createIndexSignature(decorators, modifiers, parameters, type), node)\n                : node;\n        }\n        // @api\n        function createTemplateLiteralTypeSpan(type, literal) {\n            var node = createBaseNode(194 /* TemplateLiteralTypeSpan */);\n            node.type = type;\n            node.literal = literal;\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateTemplateLiteralTypeSpan(node, type, literal) {\n            return node.type !== type\n                || node.literal !== literal\n                ? update(createTemplateLiteralTypeSpan(type, literal), node)\n                : node;\n        }\n        //\n        // Types\n        //\n        // @api\n        function createKeywordTypeNode(kind) {\n            return createToken(kind);\n        }\n        // @api\n        function createTypePredicateNode(assertsModifier, parameterName, type) {\n            var node = createBaseNode(172 /* TypePredicate */);\n            node.assertsModifier = assertsModifier;\n            node.parameterName = asName(parameterName);\n            node.type = type;\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateTypePredicateNode(node, assertsModifier, parameterName, type) {\n            return node.assertsModifier !== assertsModifier\n                || node.parameterName !== parameterName\n                || node.type !== type\n                ? update(createTypePredicateNode(assertsModifier, parameterName, type), node)\n                : node;\n        }\n        // @api\n        function createTypeReferenceNode(typeName, typeArguments) {\n            var node = createBaseNode(173 /* TypeReference */);\n            node.typeName = asName(typeName);\n            node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments));\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateTypeReferenceNode(node, typeName, typeArguments) {\n            return node.typeName !== typeName\n                || node.typeArguments !== typeArguments\n                ? update(createTypeReferenceNode(typeName, typeArguments), node)\n                : node;\n        }\n        // @api\n        function createFunctionTypeNode(typeParameters, parameters, type) {\n            var node = createBaseSignatureDeclaration(174 /* FunctionType */, \n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, \n            /*name*/ undefined, typeParameters, parameters, type);\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateFunctionTypeNode(node, typeParameters, parameters, type) {\n            return node.typeParameters !== typeParameters\n                || node.parameters !== parameters\n                || node.type !== type\n                ? updateBaseSignatureDeclaration(createFunctionTypeNode(typeParameters, parameters, type), node)\n                : node;\n        }\n        // @api\n        function createConstructorTypeNode() {\n            var args = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                args[_i] = arguments[_i];\n            }\n            return args.length === 4 ? createConstructorTypeNode1.apply(void 0, args) :\n                args.length === 3 ? createConstructorTypeNode2.apply(void 0, args) :\n                    ts.Debug.fail(\"Incorrect number of arguments specified.\");\n        }\n        function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) {\n            var node = createBaseSignatureDeclaration(175 /* ConstructorType */, \n            /*decorators*/ undefined, modifiers, \n            /*name*/ undefined, typeParameters, parameters, type);\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        /** @deprecated */\n        function createConstructorTypeNode2(typeParameters, parameters, type) {\n            return createConstructorTypeNode1(/*modifiers*/ undefined, typeParameters, parameters, type);\n        }\n        // @api\n        function updateConstructorTypeNode() {\n            var args = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                args[_i] = arguments[_i];\n            }\n            return args.length === 5 ? updateConstructorTypeNode1.apply(void 0, args) :\n                args.length === 4 ? updateConstructorTypeNode2.apply(void 0, args) :\n                    ts.Debug.fail(\"Incorrect number of arguments specified.\");\n        }\n        function updateConstructorTypeNode1(node, modifiers, typeParameters, parameters, type) {\n            return node.modifiers !== modifiers\n                || node.typeParameters !== typeParameters\n                || node.parameters !== parameters\n                || node.type !== type\n                ? updateBaseSignatureDeclaration(createConstructorTypeNode(modifiers, typeParameters, parameters, type), node)\n                : node;\n        }\n        /** @deprecated */\n        function updateConstructorTypeNode2(node, typeParameters, parameters, type) {\n            return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type);\n        }\n        // @api\n        function createTypeQueryNode(exprName) {\n            var node = createBaseNode(176 /* TypeQuery */);\n            node.exprName = exprName;\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateTypeQueryNode(node, exprName) {\n            return node.exprName !== exprName\n                ? update(createTypeQueryNode(exprName), node)\n                : node;\n        }\n        // @api\n        function createTypeLiteralNode(members) {\n            var node = createBaseNode(177 /* TypeLiteral */);\n            node.members = createNodeArray(members);\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateTypeLiteralNode(node, members) {\n            return node.members !== members\n                ? update(createTypeLiteralNode(members), node)\n                : node;\n        }\n        // @api\n        function createArrayTypeNode(elementType) {\n            var node = createBaseNode(178 /* ArrayType */);\n            node.elementType = parenthesizerRules().parenthesizeElementTypeOfArrayType(elementType);\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateArrayTypeNode(node, elementType) {\n            return node.elementType !== elementType\n                ? update(createArrayTypeNode(elementType), node)\n                : node;\n        }\n        // @api\n        function createTupleTypeNode(elements) {\n            var node = createBaseNode(179 /* TupleType */);\n            node.elements = createNodeArray(elements);\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateTupleTypeNode(node, elements) {\n            return node.elements !== elements\n                ? update(createTupleTypeNode(elements), node)\n                : node;\n        }\n        // @api\n        function createNamedTupleMember(dotDotDotToken, name, questionToken, type) {\n            var node = createBaseNode(192 /* NamedTupleMember */);\n            node.dotDotDotToken = dotDotDotToken;\n            node.name = name;\n            node.questionToken = questionToken;\n            node.type = type;\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateNamedTupleMember(node, dotDotDotToken, name, questionToken, type) {\n            return node.dotDotDotToken !== dotDotDotToken\n                || node.name !== name\n                || node.questionToken !== questionToken\n                || node.type !== type\n                ? update(createNamedTupleMember(dotDotDotToken, name, questionToken, type), node)\n                : node;\n        }\n        // @api\n        function createOptionalTypeNode(type) {\n            var node = createBaseNode(180 /* OptionalType */);\n            node.type = parenthesizerRules().parenthesizeElementTypeOfArrayType(type);\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateOptionalTypeNode(node, type) {\n            return node.type !== type\n                ? update(createOptionalTypeNode(type), node)\n                : node;\n        }\n        // @api\n        function createRestTypeNode(type) {\n            var node = createBaseNode(181 /* RestType */);\n            node.type = type;\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateRestTypeNode(node, type) {\n            return node.type !== type\n                ? update(createRestTypeNode(type), node)\n                : node;\n        }\n        function createUnionOrIntersectionTypeNode(kind, types) {\n            var node = createBaseNode(kind);\n            node.types = parenthesizerRules().parenthesizeConstituentTypesOfUnionOrIntersectionType(types);\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        function updateUnionOrIntersectionTypeNode(node, types) {\n            return node.types !== types\n                ? update(createUnionOrIntersectionTypeNode(node.kind, types), node)\n                : node;\n        }\n        // @api\n        function createUnionTypeNode(types) {\n            return createUnionOrIntersectionTypeNode(182 /* UnionType */, types);\n        }\n        // @api\n        function updateUnionTypeNode(node, types) {\n            return updateUnionOrIntersectionTypeNode(node, types);\n        }\n        // @api\n        function createIntersectionTypeNode(types) {\n            return createUnionOrIntersectionTypeNode(183 /* IntersectionType */, types);\n        }\n        // @api\n        function updateIntersectionTypeNode(node, types) {\n            return updateUnionOrIntersectionTypeNode(node, types);\n        }\n        // @api\n        function createConditionalTypeNode(checkType, extendsType, trueType, falseType) {\n            var node = createBaseNode(184 /* ConditionalType */);\n            node.checkType = parenthesizerRules().parenthesizeMemberOfConditionalType(checkType);\n            node.extendsType = parenthesizerRules().parenthesizeMemberOfConditionalType(extendsType);\n            node.trueType = trueType;\n            node.falseType = falseType;\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) {\n            return node.checkType !== checkType\n                || node.extendsType !== extendsType\n                || node.trueType !== trueType\n                || node.falseType !== falseType\n                ? update(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node)\n                : node;\n        }\n        // @api\n        function createInferTypeNode(typeParameter) {\n            var node = createBaseNode(185 /* InferType */);\n            node.typeParameter = typeParameter;\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateInferTypeNode(node, typeParameter) {\n            return node.typeParameter !== typeParameter\n                ? update(createInferTypeNode(typeParameter), node)\n                : node;\n        }\n        // @api\n        function createTemplateLiteralType(head, templateSpans) {\n            var node = createBaseNode(193 /* TemplateLiteralType */);\n            node.head = head;\n            node.templateSpans = createNodeArray(templateSpans);\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateTemplateLiteralType(node, head, templateSpans) {\n            return node.head !== head\n                || node.templateSpans !== templateSpans\n                ? update(createTemplateLiteralType(head, templateSpans), node)\n                : node;\n        }\n        // @api\n        function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) {\n            if (isTypeOf === void 0) { isTypeOf = false; }\n            var node = createBaseNode(195 /* ImportType */);\n            node.argument = argument;\n            node.qualifier = qualifier;\n            node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);\n            node.isTypeOf = isTypeOf;\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateImportTypeNode(node, argument, qualifier, typeArguments, isTypeOf) {\n            if (isTypeOf === void 0) { isTypeOf = node.isTypeOf; }\n            return node.argument !== argument\n                || node.qualifier !== qualifier\n                || node.typeArguments !== typeArguments\n                || node.isTypeOf !== isTypeOf\n                ? update(createImportTypeNode(argument, qualifier, typeArguments, isTypeOf), node)\n                : node;\n        }\n        // @api\n        function createParenthesizedType(type) {\n            var node = createBaseNode(186 /* ParenthesizedType */);\n            node.type = type;\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateParenthesizedType(node, type) {\n            return node.type !== type\n                ? update(createParenthesizedType(type), node)\n                : node;\n        }\n        // @api\n        function createThisTypeNode() {\n            var node = createBaseNode(187 /* ThisType */);\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function createTypeOperatorNode(operator, type) {\n            var node = createBaseNode(188 /* TypeOperator */);\n            node.operator = operator;\n            node.type = parenthesizerRules().parenthesizeMemberOfElementType(type);\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateTypeOperatorNode(node, type) {\n            return node.type !== type\n                ? update(createTypeOperatorNode(node.operator, type), node)\n                : node;\n        }\n        // @api\n        function createIndexedAccessTypeNode(objectType, indexType) {\n            var node = createBaseNode(189 /* IndexedAccessType */);\n            node.objectType = parenthesizerRules().parenthesizeMemberOfElementType(objectType);\n            node.indexType = indexType;\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateIndexedAccessTypeNode(node, objectType, indexType) {\n            return node.objectType !== objectType\n                || node.indexType !== indexType\n                ? update(createIndexedAccessTypeNode(objectType, indexType), node)\n                : node;\n        }\n        // @api\n        function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type) {\n            var node = createBaseNode(190 /* MappedType */);\n            node.readonlyToken = readonlyToken;\n            node.typeParameter = typeParameter;\n            node.nameType = nameType;\n            node.questionToken = questionToken;\n            node.type = type;\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type) {\n            return node.readonlyToken !== readonlyToken\n                || node.typeParameter !== typeParameter\n                || node.nameType !== nameType\n                || node.questionToken !== questionToken\n                || node.type !== type\n                ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type), node)\n                : node;\n        }\n        // @api\n        function createLiteralTypeNode(literal) {\n            var node = createBaseNode(191 /* LiteralType */);\n            node.literal = literal;\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateLiteralTypeNode(node, literal) {\n            return node.literal !== literal\n                ? update(createLiteralTypeNode(literal), node)\n                : node;\n        }\n        //\n        // Binding Patterns\n        //\n        // @api\n        function createObjectBindingPattern(elements) {\n            var node = createBaseNode(196 /* ObjectBindingPattern */);\n            node.elements = createNodeArray(elements);\n            node.transformFlags |=\n                propagateChildrenFlags(node.elements) |\n                    256 /* ContainsES2015 */ |\n                    131072 /* ContainsBindingPattern */;\n            if (node.transformFlags & 8192 /* ContainsRestOrSpread */) {\n                node.transformFlags |=\n                    32 /* ContainsES2018 */ |\n                        16384 /* ContainsObjectRestOrSpread */;\n            }\n            return node;\n        }\n        // @api\n        function updateObjectBindingPattern(node, elements) {\n            return node.elements !== elements\n                ? update(createObjectBindingPattern(elements), node)\n                : node;\n        }\n        // @api\n        function createArrayBindingPattern(elements) {\n            var node = createBaseNode(197 /* ArrayBindingPattern */);\n            node.elements = createNodeArray(elements);\n            node.transformFlags |=\n                propagateChildrenFlags(node.elements) |\n                    256 /* ContainsES2015 */ |\n                    131072 /* ContainsBindingPattern */;\n            return node;\n        }\n        // @api\n        function updateArrayBindingPattern(node, elements) {\n            return node.elements !== elements\n                ? update(createArrayBindingPattern(elements), node)\n                : node;\n        }\n        // @api\n        function createBindingElement(dotDotDotToken, propertyName, name, initializer) {\n            var node = createBaseBindingLikeDeclaration(198 /* BindingElement */, \n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, name, initializer);\n            node.propertyName = asName(propertyName);\n            node.dotDotDotToken = dotDotDotToken;\n            node.transformFlags |=\n                propagateChildFlags(node.dotDotDotToken) |\n                    256 /* ContainsES2015 */;\n            if (node.propertyName) {\n                node.transformFlags |= ts.isIdentifier(node.propertyName) ?\n                    propagateIdentifierNameFlags(node.propertyName) :\n                    propagateChildFlags(node.propertyName);\n            }\n            if (dotDotDotToken)\n                node.transformFlags |= 8192 /* ContainsRestOrSpread */;\n            return node;\n        }\n        // @api\n        function updateBindingElement(node, dotDotDotToken, propertyName, name, initializer) {\n            return node.propertyName !== propertyName\n                || node.dotDotDotToken !== dotDotDotToken\n                || node.name !== name\n                || node.initializer !== initializer\n                ? update(createBindingElement(dotDotDotToken, propertyName, name, initializer), node)\n                : node;\n        }\n        //\n        // Expression\n        //\n        function createBaseExpression(kind) {\n            var node = createBaseNode(kind);\n            // the following properties are commonly set by the checker/binder\n            return node;\n        }\n        // @api\n        function createArrayLiteralExpression(elements, multiLine) {\n            var node = createBaseExpression(199 /* ArrayLiteralExpression */);\n            node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(elements));\n            node.multiLine = multiLine;\n            node.transformFlags |= propagateChildrenFlags(node.elements);\n            return node;\n        }\n        // @api\n        function updateArrayLiteralExpression(node, elements) {\n            return node.elements !== elements\n                ? update(createArrayLiteralExpression(elements, node.multiLine), node)\n                : node;\n        }\n        // @api\n        function createObjectLiteralExpression(properties, multiLine) {\n            var node = createBaseExpression(200 /* ObjectLiteralExpression */);\n            node.properties = createNodeArray(properties);\n            node.multiLine = multiLine;\n            node.transformFlags |= propagateChildrenFlags(node.properties);\n            return node;\n        }\n        // @api\n        function updateObjectLiteralExpression(node, properties) {\n            return node.properties !== properties\n                ? update(createObjectLiteralExpression(properties, node.multiLine), node)\n                : node;\n        }\n        // @api\n        function createPropertyAccessExpression(expression, name) {\n            var node = createBaseExpression(201 /* PropertyAccessExpression */);\n            node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);\n            node.name = asName(name);\n            node.transformFlags =\n                propagateChildFlags(node.expression) |\n                    (ts.isIdentifier(node.name) ?\n                        propagateIdentifierNameFlags(node.name) :\n                        propagateChildFlags(node.name));\n            if (ts.isSuperKeyword(expression)) {\n                // super method calls require a lexical 'this'\n                // super method calls require 'super' hoisting in ES2017 and ES2018 async functions and async generators\n                node.transformFlags |=\n                    64 /* ContainsES2017 */ |\n                        32 /* ContainsES2018 */;\n            }\n            return node;\n        }\n        // @api\n        function updatePropertyAccessExpression(node, expression, name) {\n            if (ts.isPropertyAccessChain(node)) {\n                return updatePropertyAccessChain(node, expression, node.questionDotToken, ts.cast(name, ts.isIdentifier));\n            }\n            return node.expression !== expression\n                || node.name !== name\n                ? update(createPropertyAccessExpression(expression, name), node)\n                : node;\n        }\n        // @api\n        function createPropertyAccessChain(expression, questionDotToken, name) {\n            var node = createBaseExpression(201 /* PropertyAccessExpression */);\n            node.flags |= 32 /* OptionalChain */;\n            node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);\n            node.questionDotToken = questionDotToken;\n            node.name = asName(name);\n            node.transformFlags |=\n                8 /* ContainsES2020 */ |\n                    propagateChildFlags(node.expression) |\n                    propagateChildFlags(node.questionDotToken) |\n                    (ts.isIdentifier(node.name) ?\n                        propagateIdentifierNameFlags(node.name) :\n                        propagateChildFlags(node.name));\n            return node;\n        }\n        // @api\n        function updatePropertyAccessChain(node, expression, questionDotToken, name) {\n            ts.Debug.assert(!!(node.flags & 32 /* OptionalChain */), \"Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead.\");\n            // Because we are updating an existing PropertyAccessChain we want to inherit its emitFlags\n            // instead of using the default from createPropertyAccess\n            return node.expression !== expression\n                || node.questionDotToken !== questionDotToken\n                || node.name !== name\n                ? update(createPropertyAccessChain(expression, questionDotToken, name), node)\n                : node;\n        }\n        // @api\n        function createElementAccessExpression(expression, index) {\n            var node = createBaseExpression(202 /* ElementAccessExpression */);\n            node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);\n            node.argumentExpression = asExpression(index);\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    propagateChildFlags(node.argumentExpression);\n            if (ts.isSuperKeyword(expression)) {\n                // super method calls require a lexical 'this'\n                // super method calls require 'super' hoisting in ES2017 and ES2018 async functions and async generators\n                node.transformFlags |=\n                    64 /* ContainsES2017 */ |\n                        32 /* ContainsES2018 */;\n            }\n            return node;\n        }\n        // @api\n        function updateElementAccessExpression(node, expression, argumentExpression) {\n            if (ts.isElementAccessChain(node)) {\n                return updateElementAccessChain(node, expression, node.questionDotToken, argumentExpression);\n            }\n            return node.expression !== expression\n                || node.argumentExpression !== argumentExpression\n                ? update(createElementAccessExpression(expression, argumentExpression), node)\n                : node;\n        }\n        // @api\n        function createElementAccessChain(expression, questionDotToken, index) {\n            var node = createBaseExpression(202 /* ElementAccessExpression */);\n            node.flags |= 32 /* OptionalChain */;\n            node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);\n            node.questionDotToken = questionDotToken;\n            node.argumentExpression = asExpression(index);\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    propagateChildFlags(node.questionDotToken) |\n                    propagateChildFlags(node.argumentExpression) |\n                    8 /* ContainsES2020 */;\n            return node;\n        }\n        // @api\n        function updateElementAccessChain(node, expression, questionDotToken, argumentExpression) {\n            ts.Debug.assert(!!(node.flags & 32 /* OptionalChain */), \"Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead.\");\n            // Because we are updating an existing ElementAccessChain we want to inherit its emitFlags\n            // instead of using the default from createElementAccess\n            return node.expression !== expression\n                || node.questionDotToken !== questionDotToken\n                || node.argumentExpression !== argumentExpression\n                ? update(createElementAccessChain(expression, questionDotToken, argumentExpression), node)\n                : node;\n        }\n        // @api\n        function createCallExpression(expression, typeArguments, argumentsArray) {\n            var node = createBaseExpression(203 /* CallExpression */);\n            node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);\n            node.typeArguments = asNodeArray(typeArguments);\n            node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    propagateChildrenFlags(node.typeArguments) |\n                    propagateChildrenFlags(node.arguments);\n            if (node.typeArguments) {\n                node.transformFlags |= 1 /* ContainsTypeScript */;\n            }\n            if (ts.isImportKeyword(node.expression)) {\n                node.transformFlags |= 2097152 /* ContainsDynamicImport */;\n            }\n            else if (ts.isSuperProperty(node.expression)) {\n                node.transformFlags |= 4096 /* ContainsLexicalThis */;\n            }\n            return node;\n        }\n        // @api\n        function updateCallExpression(node, expression, typeArguments, argumentsArray) {\n            if (ts.isCallChain(node)) {\n                return updateCallChain(node, expression, node.questionDotToken, typeArguments, argumentsArray);\n            }\n            return node.expression !== expression\n                || node.typeArguments !== typeArguments\n                || node.arguments !== argumentsArray\n                ? update(createCallExpression(expression, typeArguments, argumentsArray), node)\n                : node;\n        }\n        // @api\n        function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) {\n            var node = createBaseExpression(203 /* CallExpression */);\n            node.flags |= 32 /* OptionalChain */;\n            node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);\n            node.questionDotToken = questionDotToken;\n            node.typeArguments = asNodeArray(typeArguments);\n            node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    propagateChildFlags(node.questionDotToken) |\n                    propagateChildrenFlags(node.typeArguments) |\n                    propagateChildrenFlags(node.arguments) |\n                    8 /* ContainsES2020 */;\n            if (node.typeArguments) {\n                node.transformFlags |= 1 /* ContainsTypeScript */;\n            }\n            if (ts.isSuperProperty(node.expression)) {\n                node.transformFlags |= 4096 /* ContainsLexicalThis */;\n            }\n            return node;\n        }\n        // @api\n        function updateCallChain(node, expression, questionDotToken, typeArguments, argumentsArray) {\n            ts.Debug.assert(!!(node.flags & 32 /* OptionalChain */), \"Cannot update a CallExpression using updateCallChain. Use updateCall instead.\");\n            return node.expression !== expression\n                || node.questionDotToken !== questionDotToken\n                || node.typeArguments !== typeArguments\n                || node.arguments !== argumentsArray\n                ? update(createCallChain(expression, questionDotToken, typeArguments, argumentsArray), node)\n                : node;\n        }\n        // @api\n        function createNewExpression(expression, typeArguments, argumentsArray) {\n            var node = createBaseExpression(204 /* NewExpression */);\n            node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression);\n            node.typeArguments = asNodeArray(typeArguments);\n            node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : undefined;\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    propagateChildrenFlags(node.typeArguments) |\n                    propagateChildrenFlags(node.arguments) |\n                    8 /* ContainsES2020 */;\n            if (node.typeArguments) {\n                node.transformFlags |= 1 /* ContainsTypeScript */;\n            }\n            return node;\n        }\n        // @api\n        function updateNewExpression(node, expression, typeArguments, argumentsArray) {\n            return node.expression !== expression\n                || node.typeArguments !== typeArguments\n                || node.arguments !== argumentsArray\n                ? update(createNewExpression(expression, typeArguments, argumentsArray), node)\n                : node;\n        }\n        // @api\n        function createTaggedTemplateExpression(tag, typeArguments, template) {\n            var node = createBaseExpression(205 /* TaggedTemplateExpression */);\n            node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag);\n            node.typeArguments = asNodeArray(typeArguments);\n            node.template = template;\n            node.transformFlags |=\n                propagateChildFlags(node.tag) |\n                    propagateChildrenFlags(node.typeArguments) |\n                    propagateChildFlags(node.template) |\n                    256 /* ContainsES2015 */;\n            if (node.typeArguments) {\n                node.transformFlags |= 1 /* ContainsTypeScript */;\n            }\n            if (ts.hasInvalidEscape(node.template)) {\n                node.transformFlags |= 32 /* ContainsES2018 */;\n            }\n            return node;\n        }\n        // @api\n        function updateTaggedTemplateExpression(node, tag, typeArguments, template) {\n            return node.tag !== tag\n                || node.typeArguments !== typeArguments\n                || node.template !== template\n                ? update(createTaggedTemplateExpression(tag, typeArguments, template), node)\n                : node;\n        }\n        // @api\n        function createTypeAssertion(type, expression) {\n            var node = createBaseExpression(206 /* TypeAssertionExpression */);\n            node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);\n            node.type = type;\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    propagateChildFlags(node.type) |\n                    1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateTypeAssertion(node, type, expression) {\n            return node.type !== type\n                || node.expression !== expression\n                ? update(createTypeAssertion(type, expression), node)\n                : node;\n        }\n        // @api\n        function createParenthesizedExpression(expression) {\n            var node = createBaseExpression(207 /* ParenthesizedExpression */);\n            node.expression = expression;\n            node.transformFlags = propagateChildFlags(node.expression);\n            return node;\n        }\n        // @api\n        function updateParenthesizedExpression(node, expression) {\n            return node.expression !== expression\n                ? update(createParenthesizedExpression(expression), node)\n                : node;\n        }\n        // @api\n        function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {\n            var node = createBaseFunctionLikeDeclaration(208 /* FunctionExpression */, \n            /*decorators*/ undefined, modifiers, name, typeParameters, parameters, type, body);\n            node.asteriskToken = asteriskToken;\n            node.transformFlags |= propagateChildFlags(node.asteriskToken);\n            if (node.typeParameters) {\n                node.transformFlags |= 1 /* ContainsTypeScript */;\n            }\n            if (ts.modifiersToFlags(node.modifiers) & 256 /* Async */) {\n                if (node.asteriskToken) {\n                    node.transformFlags |= 32 /* ContainsES2018 */;\n                }\n                else {\n                    node.transformFlags |= 64 /* ContainsES2017 */;\n                }\n            }\n            else if (node.asteriskToken) {\n                node.transformFlags |= 512 /* ContainsGenerator */;\n            }\n            return node;\n        }\n        // @api\n        function updateFunctionExpression(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) {\n            return node.name !== name\n                || node.modifiers !== modifiers\n                || node.asteriskToken !== asteriskToken\n                || node.typeParameters !== typeParameters\n                || node.parameters !== parameters\n                || node.type !== type\n                || node.body !== body\n                ? updateBaseFunctionLikeDeclaration(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node)\n                : node;\n        }\n        // @api\n        function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {\n            var node = createBaseFunctionLikeDeclaration(209 /* ArrowFunction */, \n            /*decorators*/ undefined, modifiers, \n            /*name*/ undefined, typeParameters, parameters, type, parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body));\n            node.equalsGreaterThanToken = equalsGreaterThanToken !== null && equalsGreaterThanToken !== void 0 ? equalsGreaterThanToken : createToken(38 /* EqualsGreaterThanToken */);\n            node.transformFlags |=\n                propagateChildFlags(node.equalsGreaterThanToken) |\n                    256 /* ContainsES2015 */;\n            if (ts.modifiersToFlags(node.modifiers) & 256 /* Async */) {\n                node.transformFlags |= 64 /* ContainsES2017 */;\n            }\n            return node;\n        }\n        // @api\n        function updateArrowFunction(node, modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {\n            return node.modifiers !== modifiers\n                || node.typeParameters !== typeParameters\n                || node.parameters !== parameters\n                || node.type !== type\n                || node.equalsGreaterThanToken !== equalsGreaterThanToken\n                || node.body !== body\n                ? updateBaseFunctionLikeDeclaration(createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node)\n                : node;\n        }\n        // @api\n        function createDeleteExpression(expression) {\n            var node = createBaseExpression(210 /* DeleteExpression */);\n            node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);\n            node.transformFlags |= propagateChildFlags(node.expression);\n            return node;\n        }\n        // @api\n        function updateDeleteExpression(node, expression) {\n            return node.expression !== expression\n                ? update(createDeleteExpression(expression), node)\n                : node;\n        }\n        // @api\n        function createTypeOfExpression(expression) {\n            var node = createBaseExpression(211 /* TypeOfExpression */);\n            node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);\n            node.transformFlags |= propagateChildFlags(node.expression);\n            return node;\n        }\n        // @api\n        function updateTypeOfExpression(node, expression) {\n            return node.expression !== expression\n                ? update(createTypeOfExpression(expression), node)\n                : node;\n        }\n        // @api\n        function createVoidExpression(expression) {\n            var node = createBaseExpression(212 /* VoidExpression */);\n            node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);\n            node.transformFlags |= propagateChildFlags(node.expression);\n            return node;\n        }\n        // @api\n        function updateVoidExpression(node, expression) {\n            return node.expression !== expression\n                ? update(createVoidExpression(expression), node)\n                : node;\n        }\n        // @api\n        function createAwaitExpression(expression) {\n            var node = createBaseExpression(213 /* AwaitExpression */);\n            node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    64 /* ContainsES2017 */ |\n                    32 /* ContainsES2018 */ |\n                    524288 /* ContainsAwait */;\n            return node;\n        }\n        // @api\n        function updateAwaitExpression(node, expression) {\n            return node.expression !== expression\n                ? update(createAwaitExpression(expression), node)\n                : node;\n        }\n        // @api\n        function createPrefixUnaryExpression(operator, operand) {\n            var node = createBaseExpression(214 /* PrefixUnaryExpression */);\n            node.operator = operator;\n            node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand);\n            node.transformFlags |= propagateChildFlags(node.operand);\n            return node;\n        }\n        // @api\n        function updatePrefixUnaryExpression(node, operand) {\n            return node.operand !== operand\n                ? update(createPrefixUnaryExpression(node.operator, operand), node)\n                : node;\n        }\n        // @api\n        function createPostfixUnaryExpression(operand, operator) {\n            var node = createBaseExpression(215 /* PostfixUnaryExpression */);\n            node.operator = operator;\n            node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand);\n            node.transformFlags = propagateChildFlags(node.operand);\n            return node;\n        }\n        // @api\n        function updatePostfixUnaryExpression(node, operand) {\n            return node.operand !== operand\n                ? update(createPostfixUnaryExpression(operand, node.operator), node)\n                : node;\n        }\n        // @api\n        function createBinaryExpression(left, operator, right) {\n            var node = createBaseExpression(216 /* BinaryExpression */);\n            var operatorToken = asToken(operator);\n            var operatorKind = operatorToken.kind;\n            node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left);\n            node.operatorToken = operatorToken;\n            node.right = parenthesizerRules().parenthesizeRightSideOfBinary(operatorKind, node.left, right);\n            node.transformFlags |=\n                propagateChildFlags(node.left) |\n                    propagateChildFlags(node.operatorToken) |\n                    propagateChildFlags(node.right);\n            if (operatorKind === 60 /* QuestionQuestionToken */) {\n                node.transformFlags |= 8 /* ContainsES2020 */;\n            }\n            else if (operatorKind === 62 /* EqualsToken */) {\n                if (ts.isObjectLiteralExpression(node.left)) {\n                    node.transformFlags |=\n                        256 /* ContainsES2015 */ |\n                            32 /* ContainsES2018 */ |\n                            1024 /* ContainsDestructuringAssignment */ |\n                            propagateAssignmentPatternFlags(node.left);\n                }\n                else if (ts.isArrayLiteralExpression(node.left)) {\n                    node.transformFlags |=\n                        256 /* ContainsES2015 */ |\n                            1024 /* ContainsDestructuringAssignment */ |\n                            propagateAssignmentPatternFlags(node.left);\n                }\n            }\n            else if (operatorKind === 42 /* AsteriskAsteriskToken */ || operatorKind === 66 /* AsteriskAsteriskEqualsToken */) {\n                node.transformFlags |= 128 /* ContainsES2016 */;\n            }\n            else if (ts.isLogicalOrCoalescingAssignmentOperator(operatorKind)) {\n                node.transformFlags |= 4 /* ContainsESNext */;\n            }\n            return node;\n        }\n        function propagateAssignmentPatternFlags(node) {\n            if (node.transformFlags & 16384 /* ContainsObjectRestOrSpread */)\n                return 16384 /* ContainsObjectRestOrSpread */;\n            if (node.transformFlags & 32 /* ContainsES2018 */) {\n                // check for nested spread assignments, otherwise '{ x: { a, ...b } = foo } = c'\n                // will not be correctly interpreted by the ES2018 transformer\n                for (var _i = 0, _a = ts.getElementsOfBindingOrAssignmentPattern(node); _i < _a.length; _i++) {\n                    var element = _a[_i];\n                    var target = ts.getTargetOfBindingOrAssignmentElement(element);\n                    if (target && ts.isAssignmentPattern(target)) {\n                        if (target.transformFlags & 16384 /* ContainsObjectRestOrSpread */) {\n                            return 16384 /* ContainsObjectRestOrSpread */;\n                        }\n                        if (target.transformFlags & 32 /* ContainsES2018 */) {\n                            var flags_1 = propagateAssignmentPatternFlags(target);\n                            if (flags_1)\n                                return flags_1;\n                        }\n                    }\n                }\n            }\n            return 0 /* None */;\n        }\n        // @api\n        function updateBinaryExpression(node, left, operator, right) {\n            return node.left !== left\n                || node.operatorToken !== operator\n                || node.right !== right\n                ? update(createBinaryExpression(left, operator, right), node)\n                : node;\n        }\n        // @api\n        function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) {\n            var node = createBaseExpression(217 /* ConditionalExpression */);\n            node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition);\n            node.questionToken = questionToken !== null && questionToken !== void 0 ? questionToken : createToken(57 /* QuestionToken */);\n            node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue);\n            node.colonToken = colonToken !== null && colonToken !== void 0 ? colonToken : createToken(58 /* ColonToken */);\n            node.whenFalse = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenFalse);\n            node.transformFlags |=\n                propagateChildFlags(node.condition) |\n                    propagateChildFlags(node.questionToken) |\n                    propagateChildFlags(node.whenTrue) |\n                    propagateChildFlags(node.colonToken) |\n                    propagateChildFlags(node.whenFalse);\n            return node;\n        }\n        // @api\n        function updateConditionalExpression(node, condition, questionToken, whenTrue, colonToken, whenFalse) {\n            return node.condition !== condition\n                || node.questionToken !== questionToken\n                || node.whenTrue !== whenTrue\n                || node.colonToken !== colonToken\n                || node.whenFalse !== whenFalse\n                ? update(createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse), node)\n                : node;\n        }\n        // @api\n        function createTemplateExpression(head, templateSpans) {\n            var node = createBaseExpression(218 /* TemplateExpression */);\n            node.head = head;\n            node.templateSpans = createNodeArray(templateSpans);\n            node.transformFlags |=\n                propagateChildFlags(node.head) |\n                    propagateChildrenFlags(node.templateSpans) |\n                    256 /* ContainsES2015 */;\n            return node;\n        }\n        // @api\n        function updateTemplateExpression(node, head, templateSpans) {\n            return node.head !== head\n                || node.templateSpans !== templateSpans\n                ? update(createTemplateExpression(head, templateSpans), node)\n                : node;\n        }\n        function createTemplateLiteralLikeNodeChecked(kind, text, rawText, templateFlags) {\n            if (templateFlags === void 0) { templateFlags = 0 /* None */; }\n            ts.Debug.assert(!(templateFlags & ~2048 /* TemplateLiteralLikeFlags */), \"Unsupported template flags.\");\n            // NOTE: without the assignment to `undefined`, we don't narrow the initial type of `cooked`.\n            // eslint-disable-next-line no-undef-init\n            var cooked = undefined;\n            if (rawText !== undefined && rawText !== text) {\n                cooked = getCookedText(kind, rawText);\n                if (typeof cooked === \"object\") {\n                    return ts.Debug.fail(\"Invalid raw text\");\n                }\n            }\n            if (text === undefined) {\n                if (cooked === undefined) {\n                    return ts.Debug.fail(\"Arguments 'text' and 'rawText' may not both be undefined.\");\n                }\n                text = cooked;\n            }\n            else if (cooked !== undefined) {\n                ts.Debug.assert(text === cooked, \"Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'.\");\n            }\n            return createTemplateLiteralLikeNode(kind, text, rawText, templateFlags);\n        }\n        // @api\n        function createTemplateLiteralLikeNode(kind, text, rawText, templateFlags) {\n            var node = createBaseToken(kind);\n            node.text = text;\n            node.rawText = rawText;\n            node.templateFlags = templateFlags & 2048 /* TemplateLiteralLikeFlags */;\n            node.transformFlags |= 256 /* ContainsES2015 */;\n            if (node.templateFlags) {\n                node.transformFlags |= 32 /* ContainsES2018 */;\n            }\n            return node;\n        }\n        // @api\n        function createTemplateHead(text, rawText, templateFlags) {\n            return createTemplateLiteralLikeNodeChecked(15 /* TemplateHead */, text, rawText, templateFlags);\n        }\n        // @api\n        function createTemplateMiddle(text, rawText, templateFlags) {\n            return createTemplateLiteralLikeNodeChecked(16 /* TemplateMiddle */, text, rawText, templateFlags);\n        }\n        // @api\n        function createTemplateTail(text, rawText, templateFlags) {\n            return createTemplateLiteralLikeNodeChecked(17 /* TemplateTail */, text, rawText, templateFlags);\n        }\n        // @api\n        function createNoSubstitutionTemplateLiteral(text, rawText, templateFlags) {\n            return createTemplateLiteralLikeNodeChecked(14 /* NoSubstitutionTemplateLiteral */, text, rawText, templateFlags);\n        }\n        // @api\n        function createYieldExpression(asteriskToken, expression) {\n            ts.Debug.assert(!asteriskToken || !!expression, \"A `YieldExpression` with an asteriskToken must have an expression.\");\n            var node = createBaseExpression(219 /* YieldExpression */);\n            node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);\n            node.asteriskToken = asteriskToken;\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    propagateChildFlags(node.asteriskToken) |\n                    256 /* ContainsES2015 */ |\n                    32 /* ContainsES2018 */ |\n                    262144 /* ContainsYield */;\n            return node;\n        }\n        // @api\n        function updateYieldExpression(node, asteriskToken, expression) {\n            return node.expression !== expression\n                || node.asteriskToken !== asteriskToken\n                ? update(createYieldExpression(asteriskToken, expression), node)\n                : node;\n        }\n        // @api\n        function createSpreadElement(expression) {\n            var node = createBaseExpression(220 /* SpreadElement */);\n            node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    256 /* ContainsES2015 */ |\n                    8192 /* ContainsRestOrSpread */;\n            return node;\n        }\n        // @api\n        function updateSpreadElement(node, expression) {\n            return node.expression !== expression\n                ? update(createSpreadElement(expression), node)\n                : node;\n        }\n        // @api\n        function createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members) {\n            var node = createBaseClassLikeDeclaration(221 /* ClassExpression */, decorators, modifiers, name, typeParameters, heritageClauses, members);\n            node.transformFlags |= 256 /* ContainsES2015 */;\n            return node;\n        }\n        // @api\n        function updateClassExpression(node, decorators, modifiers, name, typeParameters, heritageClauses, members) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.name !== name\n                || node.typeParameters !== typeParameters\n                || node.heritageClauses !== heritageClauses\n                || node.members !== members\n                ? update(createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members), node)\n                : node;\n        }\n        // @api\n        function createOmittedExpression() {\n            return createBaseExpression(222 /* OmittedExpression */);\n        }\n        // @api\n        function createExpressionWithTypeArguments(expression, typeArguments) {\n            var node = createBaseNode(223 /* ExpressionWithTypeArguments */);\n            node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);\n            node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    propagateChildrenFlags(node.typeArguments) |\n                    256 /* ContainsES2015 */;\n            return node;\n        }\n        // @api\n        function updateExpressionWithTypeArguments(node, expression, typeArguments) {\n            return node.expression !== expression\n                || node.typeArguments !== typeArguments\n                ? update(createExpressionWithTypeArguments(expression, typeArguments), node)\n                : node;\n        }\n        // @api\n        function createAsExpression(expression, type) {\n            var node = createBaseExpression(224 /* AsExpression */);\n            node.expression = expression;\n            node.type = type;\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    propagateChildFlags(node.type) |\n                    1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateAsExpression(node, expression, type) {\n            return node.expression !== expression\n                || node.type !== type\n                ? update(createAsExpression(expression, type), node)\n                : node;\n        }\n        // @api\n        function createNonNullExpression(expression) {\n            var node = createBaseExpression(225 /* NonNullExpression */);\n            node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateNonNullExpression(node, expression) {\n            if (ts.isNonNullChain(node)) {\n                return updateNonNullChain(node, expression);\n            }\n            return node.expression !== expression\n                ? update(createNonNullExpression(expression), node)\n                : node;\n        }\n        // @api\n        function createNonNullChain(expression) {\n            var node = createBaseExpression(225 /* NonNullExpression */);\n            node.flags |= 32 /* OptionalChain */;\n            node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateNonNullChain(node, expression) {\n            ts.Debug.assert(!!(node.flags & 32 /* OptionalChain */), \"Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead.\");\n            return node.expression !== expression\n                ? update(createNonNullChain(expression), node)\n                : node;\n        }\n        // @api\n        function createMetaProperty(keywordToken, name) {\n            var node = createBaseExpression(226 /* MetaProperty */);\n            node.keywordToken = keywordToken;\n            node.name = name;\n            node.transformFlags |= propagateChildFlags(node.name);\n            switch (keywordToken) {\n                case 102 /* NewKeyword */:\n                    node.transformFlags |= 256 /* ContainsES2015 */;\n                    break;\n                case 99 /* ImportKeyword */:\n                    node.transformFlags |= 4 /* ContainsESNext */;\n                    break;\n                default:\n                    return ts.Debug.assertNever(keywordToken);\n            }\n            return node;\n        }\n        // @api\n        function updateMetaProperty(node, name) {\n            return node.name !== name\n                ? update(createMetaProperty(node.keywordToken, name), node)\n                : node;\n        }\n        //\n        // Misc\n        //\n        // @api\n        function createTemplateSpan(expression, literal) {\n            var node = createBaseNode(228 /* TemplateSpan */);\n            node.expression = expression;\n            node.literal = literal;\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    propagateChildFlags(node.literal) |\n                    256 /* ContainsES2015 */;\n            return node;\n        }\n        // @api\n        function updateTemplateSpan(node, expression, literal) {\n            return node.expression !== expression\n                || node.literal !== literal\n                ? update(createTemplateSpan(expression, literal), node)\n                : node;\n        }\n        // @api\n        function createSemicolonClassElement() {\n            var node = createBaseNode(229 /* SemicolonClassElement */);\n            node.transformFlags |= 256 /* ContainsES2015 */;\n            return node;\n        }\n        //\n        // Element\n        //\n        // @api\n        function createBlock(statements, multiLine) {\n            var node = createBaseNode(230 /* Block */);\n            node.statements = createNodeArray(statements);\n            node.multiLine = multiLine;\n            node.transformFlags |= propagateChildrenFlags(node.statements);\n            return node;\n        }\n        // @api\n        function updateBlock(node, statements) {\n            return node.statements !== statements\n                ? update(createBlock(statements, node.multiLine), node)\n                : node;\n        }\n        // @api\n        function createVariableStatement(modifiers, declarationList) {\n            var node = createBaseDeclaration(232 /* VariableStatement */, /*decorators*/ undefined, modifiers);\n            node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;\n            node.transformFlags |=\n                propagateChildFlags(node.declarationList);\n            if (ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) {\n                node.transformFlags = 1 /* ContainsTypeScript */;\n            }\n            return node;\n        }\n        // @api\n        function updateVariableStatement(node, modifiers, declarationList) {\n            return node.modifiers !== modifiers\n                || node.declarationList !== declarationList\n                ? update(createVariableStatement(modifiers, declarationList), node)\n                : node;\n        }\n        // @api\n        function createEmptyStatement() {\n            return createBaseNode(231 /* EmptyStatement */);\n        }\n        // @api\n        function createExpressionStatement(expression) {\n            var node = createBaseNode(233 /* ExpressionStatement */);\n            node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression);\n            node.transformFlags |= propagateChildFlags(node.expression);\n            return node;\n        }\n        // @api\n        function updateExpressionStatement(node, expression) {\n            return node.expression !== expression\n                ? update(createExpressionStatement(expression), node)\n                : node;\n        }\n        // @api\n        function createIfStatement(expression, thenStatement, elseStatement) {\n            var node = createBaseNode(234 /* IfStatement */);\n            node.expression = expression;\n            node.thenStatement = asEmbeddedStatement(thenStatement);\n            node.elseStatement = asEmbeddedStatement(elseStatement);\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    propagateChildFlags(node.thenStatement) |\n                    propagateChildFlags(node.elseStatement);\n            return node;\n        }\n        // @api\n        function updateIfStatement(node, expression, thenStatement, elseStatement) {\n            return node.expression !== expression\n                || node.thenStatement !== thenStatement\n                || node.elseStatement !== elseStatement\n                ? update(createIfStatement(expression, thenStatement, elseStatement), node)\n                : node;\n        }\n        // @api\n        function createDoStatement(statement, expression) {\n            var node = createBaseNode(235 /* DoStatement */);\n            node.statement = asEmbeddedStatement(statement);\n            node.expression = expression;\n            node.transformFlags |=\n                propagateChildFlags(node.statement) |\n                    propagateChildFlags(node.expression);\n            return node;\n        }\n        // @api\n        function updateDoStatement(node, statement, expression) {\n            return node.statement !== statement\n                || node.expression !== expression\n                ? update(createDoStatement(statement, expression), node)\n                : node;\n        }\n        // @api\n        function createWhileStatement(expression, statement) {\n            var node = createBaseNode(236 /* WhileStatement */);\n            node.expression = expression;\n            node.statement = asEmbeddedStatement(statement);\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    propagateChildFlags(node.statement);\n            return node;\n        }\n        // @api\n        function updateWhileStatement(node, expression, statement) {\n            return node.expression !== expression\n                || node.statement !== statement\n                ? update(createWhileStatement(expression, statement), node)\n                : node;\n        }\n        // @api\n        function createForStatement(initializer, condition, incrementor, statement) {\n            var node = createBaseNode(237 /* ForStatement */);\n            node.initializer = initializer;\n            node.condition = condition;\n            node.incrementor = incrementor;\n            node.statement = asEmbeddedStatement(statement);\n            node.transformFlags |=\n                propagateChildFlags(node.initializer) |\n                    propagateChildFlags(node.condition) |\n                    propagateChildFlags(node.incrementor) |\n                    propagateChildFlags(node.statement);\n            return node;\n        }\n        // @api\n        function updateForStatement(node, initializer, condition, incrementor, statement) {\n            return node.initializer !== initializer\n                || node.condition !== condition\n                || node.incrementor !== incrementor\n                || node.statement !== statement\n                ? update(createForStatement(initializer, condition, incrementor, statement), node)\n                : node;\n        }\n        // @api\n        function createForInStatement(initializer, expression, statement) {\n            var node = createBaseNode(238 /* ForInStatement */);\n            node.initializer = initializer;\n            node.expression = expression;\n            node.statement = asEmbeddedStatement(statement);\n            node.transformFlags |=\n                propagateChildFlags(node.initializer) |\n                    propagateChildFlags(node.expression) |\n                    propagateChildFlags(node.statement);\n            return node;\n        }\n        // @api\n        function updateForInStatement(node, initializer, expression, statement) {\n            return node.initializer !== initializer\n                || node.expression !== expression\n                || node.statement !== statement\n                ? update(createForInStatement(initializer, expression, statement), node)\n                : node;\n        }\n        // @api\n        function createForOfStatement(awaitModifier, initializer, expression, statement) {\n            var node = createBaseNode(239 /* ForOfStatement */);\n            node.awaitModifier = awaitModifier;\n            node.initializer = initializer;\n            node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);\n            node.statement = asEmbeddedStatement(statement);\n            node.transformFlags |=\n                propagateChildFlags(node.awaitModifier) |\n                    propagateChildFlags(node.initializer) |\n                    propagateChildFlags(node.expression) |\n                    propagateChildFlags(node.statement) |\n                    256 /* ContainsES2015 */;\n            if (awaitModifier)\n                node.transformFlags |= 32 /* ContainsES2018 */;\n            return node;\n        }\n        // @api\n        function updateForOfStatement(node, awaitModifier, initializer, expression, statement) {\n            return node.awaitModifier !== awaitModifier\n                || node.initializer !== initializer\n                || node.expression !== expression\n                || node.statement !== statement\n                ? update(createForOfStatement(awaitModifier, initializer, expression, statement), node)\n                : node;\n        }\n        // @api\n        function createContinueStatement(label) {\n            var node = createBaseNode(240 /* ContinueStatement */);\n            node.label = asName(label);\n            node.transformFlags |=\n                propagateChildFlags(node.label) |\n                    1048576 /* ContainsHoistedDeclarationOrCompletion */;\n            return node;\n        }\n        // @api\n        function updateContinueStatement(node, label) {\n            return node.label !== label\n                ? update(createContinueStatement(label), node)\n                : node;\n        }\n        // @api\n        function createBreakStatement(label) {\n            var node = createBaseNode(241 /* BreakStatement */);\n            node.label = asName(label);\n            node.transformFlags |=\n                propagateChildFlags(node.label) |\n                    1048576 /* ContainsHoistedDeclarationOrCompletion */;\n            return node;\n        }\n        // @api\n        function updateBreakStatement(node, label) {\n            return node.label !== label\n                ? update(createBreakStatement(label), node)\n                : node;\n        }\n        // @api\n        function createReturnStatement(expression) {\n            var node = createBaseNode(242 /* ReturnStatement */);\n            node.expression = expression;\n            // return in an ES2018 async generator must be awaited\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    32 /* ContainsES2018 */ |\n                    1048576 /* ContainsHoistedDeclarationOrCompletion */;\n            return node;\n        }\n        // @api\n        function updateReturnStatement(node, expression) {\n            return node.expression !== expression\n                ? update(createReturnStatement(expression), node)\n                : node;\n        }\n        // @api\n        function createWithStatement(expression, statement) {\n            var node = createBaseNode(243 /* WithStatement */);\n            node.expression = expression;\n            node.statement = asEmbeddedStatement(statement);\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    propagateChildFlags(node.statement);\n            return node;\n        }\n        // @api\n        function updateWithStatement(node, expression, statement) {\n            return node.expression !== expression\n                || node.statement !== statement\n                ? update(createWithStatement(expression, statement), node)\n                : node;\n        }\n        // @api\n        function createSwitchStatement(expression, caseBlock) {\n            var node = createBaseNode(244 /* SwitchStatement */);\n            node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);\n            node.caseBlock = caseBlock;\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    propagateChildFlags(node.caseBlock);\n            return node;\n        }\n        // @api\n        function updateSwitchStatement(node, expression, caseBlock) {\n            return node.expression !== expression\n                || node.caseBlock !== caseBlock\n                ? update(createSwitchStatement(expression, caseBlock), node)\n                : node;\n        }\n        // @api\n        function createLabeledStatement(label, statement) {\n            var node = createBaseNode(245 /* LabeledStatement */);\n            node.label = asName(label);\n            node.statement = asEmbeddedStatement(statement);\n            node.transformFlags |=\n                propagateChildFlags(node.label) |\n                    propagateChildFlags(node.statement);\n            return node;\n        }\n        // @api\n        function updateLabeledStatement(node, label, statement) {\n            return node.label !== label\n                || node.statement !== statement\n                ? update(createLabeledStatement(label, statement), node)\n                : node;\n        }\n        // @api\n        function createThrowStatement(expression) {\n            var node = createBaseNode(246 /* ThrowStatement */);\n            node.expression = expression;\n            node.transformFlags |= propagateChildFlags(node.expression);\n            return node;\n        }\n        // @api\n        function updateThrowStatement(node, expression) {\n            return node.expression !== expression\n                ? update(createThrowStatement(expression), node)\n                : node;\n        }\n        // @api\n        function createTryStatement(tryBlock, catchClause, finallyBlock) {\n            var node = createBaseNode(247 /* TryStatement */);\n            node.tryBlock = tryBlock;\n            node.catchClause = catchClause;\n            node.finallyBlock = finallyBlock;\n            node.transformFlags |=\n                propagateChildFlags(node.tryBlock) |\n                    propagateChildFlags(node.catchClause) |\n                    propagateChildFlags(node.finallyBlock);\n            return node;\n        }\n        // @api\n        function updateTryStatement(node, tryBlock, catchClause, finallyBlock) {\n            return node.tryBlock !== tryBlock\n                || node.catchClause !== catchClause\n                || node.finallyBlock !== finallyBlock\n                ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node)\n                : node;\n        }\n        // @api\n        function createDebuggerStatement() {\n            return createBaseNode(248 /* DebuggerStatement */);\n        }\n        // @api\n        function createVariableDeclaration(name, exclamationToken, type, initializer) {\n            var node = createBaseVariableLikeDeclaration(249 /* VariableDeclaration */, \n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer));\n            node.exclamationToken = exclamationToken;\n            node.transformFlags |= propagateChildFlags(node.exclamationToken);\n            if (exclamationToken) {\n                node.transformFlags |= 1 /* ContainsTypeScript */;\n            }\n            return node;\n        }\n        // @api\n        function updateVariableDeclaration(node, name, exclamationToken, type, initializer) {\n            return node.name !== name\n                || node.type !== type\n                || node.exclamationToken !== exclamationToken\n                || node.initializer !== initializer\n                ? update(createVariableDeclaration(name, exclamationToken, type, initializer), node)\n                : node;\n        }\n        // @api\n        function createVariableDeclarationList(declarations, flags) {\n            if (flags === void 0) { flags = 0 /* None */; }\n            var node = createBaseNode(250 /* VariableDeclarationList */);\n            node.flags |= flags & 3 /* BlockScoped */;\n            node.declarations = createNodeArray(declarations);\n            node.transformFlags |=\n                propagateChildrenFlags(node.declarations) |\n                    1048576 /* ContainsHoistedDeclarationOrCompletion */;\n            if (flags & 3 /* BlockScoped */) {\n                node.transformFlags |=\n                    256 /* ContainsES2015 */ |\n                        65536 /* ContainsBlockScopedBinding */;\n            }\n            return node;\n        }\n        // @api\n        function updateVariableDeclarationList(node, declarations) {\n            return node.declarations !== declarations\n                ? update(createVariableDeclarationList(declarations, node.flags), node)\n                : node;\n        }\n        // @api\n        function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) {\n            var node = createBaseFunctionLikeDeclaration(251 /* FunctionDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body);\n            node.asteriskToken = asteriskToken;\n            if (!node.body || ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) {\n                node.transformFlags = 1 /* ContainsTypeScript */;\n            }\n            else {\n                node.transformFlags |=\n                    propagateChildFlags(node.asteriskToken) |\n                        1048576 /* ContainsHoistedDeclarationOrCompletion */;\n                if (ts.modifiersToFlags(node.modifiers) & 256 /* Async */) {\n                    if (node.asteriskToken) {\n                        node.transformFlags |= 32 /* ContainsES2018 */;\n                    }\n                    else {\n                        node.transformFlags |= 64 /* ContainsES2017 */;\n                    }\n                }\n                else if (node.asteriskToken) {\n                    node.transformFlags |= 512 /* ContainsGenerator */;\n                }\n            }\n            return node;\n        }\n        // @api\n        function updateFunctionDeclaration(node, decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.asteriskToken !== asteriskToken\n                || node.name !== name\n                || node.typeParameters !== typeParameters\n                || node.parameters !== parameters\n                || node.type !== type\n                || node.body !== body\n                ? updateBaseFunctionLikeDeclaration(createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body), node)\n                : node;\n        }\n        // @api\n        function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) {\n            var node = createBaseClassLikeDeclaration(252 /* ClassDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses, members);\n            if (ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) {\n                node.transformFlags = 1 /* ContainsTypeScript */;\n            }\n            else {\n                node.transformFlags |= 256 /* ContainsES2015 */;\n                if (node.transformFlags & 2048 /* ContainsTypeScriptClassSyntax */) {\n                    node.transformFlags |= 1 /* ContainsTypeScript */;\n                }\n            }\n            return node;\n        }\n        // @api\n        function updateClassDeclaration(node, decorators, modifiers, name, typeParameters, heritageClauses, members) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.name !== name\n                || node.typeParameters !== typeParameters\n                || node.heritageClauses !== heritageClauses\n                || node.members !== members\n                ? update(createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members), node)\n                : node;\n        }\n        // @api\n        function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) {\n            var node = createBaseInterfaceOrClassLikeDeclaration(253 /* InterfaceDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses);\n            node.members = createNodeArray(members);\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateInterfaceDeclaration(node, decorators, modifiers, name, typeParameters, heritageClauses, members) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.name !== name\n                || node.typeParameters !== typeParameters\n                || node.heritageClauses !== heritageClauses\n                || node.members !== members\n                ? update(createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members), node)\n                : node;\n        }\n        // @api\n        function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) {\n            var node = createBaseGenericNamedDeclaration(254 /* TypeAliasDeclaration */, decorators, modifiers, name, typeParameters);\n            node.type = type;\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateTypeAliasDeclaration(node, decorators, modifiers, name, typeParameters, type) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.name !== name\n                || node.typeParameters !== typeParameters\n                || node.type !== type\n                ? update(createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type), node)\n                : node;\n        }\n        // @api\n        function createEnumDeclaration(decorators, modifiers, name, members) {\n            var node = createBaseNamedDeclaration(255 /* EnumDeclaration */, decorators, modifiers, name);\n            node.members = createNodeArray(members);\n            node.transformFlags |=\n                propagateChildrenFlags(node.members) |\n                    1 /* ContainsTypeScript */;\n            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // Enum declarations cannot contain `await`\n            return node;\n        }\n        // @api\n        function updateEnumDeclaration(node, decorators, modifiers, name, members) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.name !== name\n                || node.members !== members\n                ? update(createEnumDeclaration(decorators, modifiers, name, members), node)\n                : node;\n        }\n        // @api\n        function createModuleDeclaration(decorators, modifiers, name, body, flags) {\n            if (flags === void 0) { flags = 0 /* None */; }\n            var node = createBaseDeclaration(256 /* ModuleDeclaration */, decorators, modifiers);\n            node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */);\n            node.name = name;\n            node.body = body;\n            if (ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) {\n                node.transformFlags = 1 /* ContainsTypeScript */;\n            }\n            else {\n                node.transformFlags |=\n                    propagateChildFlags(node.name) |\n                        propagateChildFlags(node.body) |\n                        1 /* ContainsTypeScript */;\n            }\n            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // Module declarations cannot contain `await`.\n            return node;\n        }\n        // @api\n        function updateModuleDeclaration(node, decorators, modifiers, name, body) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.name !== name\n                || node.body !== body\n                ? update(createModuleDeclaration(decorators, modifiers, name, body, node.flags), node)\n                : node;\n        }\n        // @api\n        function createModuleBlock(statements) {\n            var node = createBaseNode(257 /* ModuleBlock */);\n            node.statements = createNodeArray(statements);\n            node.transformFlags |= propagateChildrenFlags(node.statements);\n            return node;\n        }\n        // @api\n        function updateModuleBlock(node, statements) {\n            return node.statements !== statements\n                ? update(createModuleBlock(statements), node)\n                : node;\n        }\n        // @api\n        function createCaseBlock(clauses) {\n            var node = createBaseNode(258 /* CaseBlock */);\n            node.clauses = createNodeArray(clauses);\n            node.transformFlags |= propagateChildrenFlags(node.clauses);\n            return node;\n        }\n        // @api\n        function updateCaseBlock(node, clauses) {\n            return node.clauses !== clauses\n                ? update(createCaseBlock(clauses), node)\n                : node;\n        }\n        // @api\n        function createNamespaceExportDeclaration(name) {\n            var node = createBaseNamedDeclaration(259 /* NamespaceExportDeclaration */, \n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, name);\n            node.transformFlags = 1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateNamespaceExportDeclaration(node, name) {\n            return node.name !== name\n                ? update(createNamespaceExportDeclaration(name), node)\n                : node;\n        }\n        // @api\n        function createImportEqualsDeclaration(decorators, modifiers, isTypeOnly, name, moduleReference) {\n            var node = createBaseNamedDeclaration(260 /* ImportEqualsDeclaration */, decorators, modifiers, name);\n            node.isTypeOnly = isTypeOnly;\n            node.moduleReference = moduleReference;\n            node.transformFlags |= propagateChildFlags(node.moduleReference);\n            if (!ts.isExternalModuleReference(node.moduleReference))\n                node.transformFlags |= 1 /* ContainsTypeScript */;\n            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // Import= declaration is always parsed in an Await context\n            return node;\n        }\n        // @api\n        function updateImportEqualsDeclaration(node, decorators, modifiers, isTypeOnly, name, moduleReference) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.isTypeOnly !== isTypeOnly\n                || node.name !== name\n                || node.moduleReference !== moduleReference\n                ? update(createImportEqualsDeclaration(decorators, modifiers, isTypeOnly, name, moduleReference), node)\n                : node;\n        }\n        // @api\n        function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) {\n            var node = createBaseDeclaration(261 /* ImportDeclaration */, decorators, modifiers);\n            node.importClause = importClause;\n            node.moduleSpecifier = moduleSpecifier;\n            node.transformFlags |=\n                propagateChildFlags(node.importClause) |\n                    propagateChildFlags(node.moduleSpecifier);\n            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context\n            return node;\n        }\n        // @api\n        function updateImportDeclaration(node, decorators, modifiers, importClause, moduleSpecifier) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.importClause !== importClause\n                || node.moduleSpecifier !== moduleSpecifier\n                ? update(createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier), node)\n                : node;\n        }\n        // @api\n        function createImportClause(isTypeOnly, name, namedBindings) {\n            var node = createBaseNode(262 /* ImportClause */);\n            node.isTypeOnly = isTypeOnly;\n            node.name = name;\n            node.namedBindings = namedBindings;\n            node.transformFlags |=\n                propagateChildFlags(node.name) |\n                    propagateChildFlags(node.namedBindings);\n            if (isTypeOnly) {\n                node.transformFlags |= 1 /* ContainsTypeScript */;\n            }\n            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context\n            return node;\n        }\n        // @api\n        function updateImportClause(node, isTypeOnly, name, namedBindings) {\n            return node.isTypeOnly !== isTypeOnly\n                || node.name !== name\n                || node.namedBindings !== namedBindings\n                ? update(createImportClause(isTypeOnly, name, namedBindings), node)\n                : node;\n        }\n        // @api\n        function createNamespaceImport(name) {\n            var node = createBaseNode(263 /* NamespaceImport */);\n            node.name = name;\n            node.transformFlags |= propagateChildFlags(node.name);\n            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context\n            return node;\n        }\n        // @api\n        function updateNamespaceImport(node, name) {\n            return node.name !== name\n                ? update(createNamespaceImport(name), node)\n                : node;\n        }\n        // @api\n        function createNamespaceExport(name) {\n            var node = createBaseNode(269 /* NamespaceExport */);\n            node.name = name;\n            node.transformFlags |=\n                propagateChildFlags(node.name) |\n                    4 /* ContainsESNext */;\n            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context\n            return node;\n        }\n        // @api\n        function updateNamespaceExport(node, name) {\n            return node.name !== name\n                ? update(createNamespaceExport(name), node)\n                : node;\n        }\n        // @api\n        function createNamedImports(elements) {\n            var node = createBaseNode(264 /* NamedImports */);\n            node.elements = createNodeArray(elements);\n            node.transformFlags |= propagateChildrenFlags(node.elements);\n            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context\n            return node;\n        }\n        // @api\n        function updateNamedImports(node, elements) {\n            return node.elements !== elements\n                ? update(createNamedImports(elements), node)\n                : node;\n        }\n        // @api\n        function createImportSpecifier(propertyName, name) {\n            var node = createBaseNode(265 /* ImportSpecifier */);\n            node.propertyName = propertyName;\n            node.name = name;\n            node.transformFlags |=\n                propagateChildFlags(node.propertyName) |\n                    propagateChildFlags(node.name);\n            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context\n            return node;\n        }\n        // @api\n        function updateImportSpecifier(node, propertyName, name) {\n            return node.propertyName !== propertyName\n                || node.name !== name\n                ? update(createImportSpecifier(propertyName, name), node)\n                : node;\n        }\n        // @api\n        function createExportAssignment(decorators, modifiers, isExportEquals, expression) {\n            var node = createBaseDeclaration(266 /* ExportAssignment */, decorators, modifiers);\n            node.isExportEquals = isExportEquals;\n            node.expression = isExportEquals\n                ? parenthesizerRules().parenthesizeRightSideOfBinary(62 /* EqualsToken */, /*leftSide*/ undefined, expression)\n                : parenthesizerRules().parenthesizeExpressionOfExportDefault(expression);\n            node.transformFlags |= propagateChildFlags(node.expression);\n            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context\n            return node;\n        }\n        // @api\n        function updateExportAssignment(node, decorators, modifiers, expression) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.expression !== expression\n                ? update(createExportAssignment(decorators, modifiers, node.isExportEquals, expression), node)\n                : node;\n        }\n        // @api\n        function createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier) {\n            var node = createBaseDeclaration(267 /* ExportDeclaration */, decorators, modifiers);\n            node.isTypeOnly = isTypeOnly;\n            node.exportClause = exportClause;\n            node.moduleSpecifier = moduleSpecifier;\n            node.transformFlags |=\n                propagateChildFlags(node.exportClause) |\n                    propagateChildFlags(node.moduleSpecifier);\n            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context\n            return node;\n        }\n        // @api\n        function updateExportDeclaration(node, decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier) {\n            return node.decorators !== decorators\n                || node.modifiers !== modifiers\n                || node.isTypeOnly !== isTypeOnly\n                || node.exportClause !== exportClause\n                || node.moduleSpecifier !== moduleSpecifier\n                ? update(createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier), node)\n                : node;\n        }\n        // @api\n        function createNamedExports(elements) {\n            var node = createBaseNode(268 /* NamedExports */);\n            node.elements = createNodeArray(elements);\n            node.transformFlags |= propagateChildrenFlags(node.elements);\n            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context\n            return node;\n        }\n        // @api\n        function updateNamedExports(node, elements) {\n            return node.elements !== elements\n                ? update(createNamedExports(elements), node)\n                : node;\n        }\n        // @api\n        function createExportSpecifier(propertyName, name) {\n            var node = createBaseNode(270 /* ExportSpecifier */);\n            node.propertyName = asName(propertyName);\n            node.name = asName(name);\n            node.transformFlags |=\n                propagateChildFlags(node.propertyName) |\n                    propagateChildFlags(node.name);\n            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context\n            return node;\n        }\n        // @api\n        function updateExportSpecifier(node, propertyName, name) {\n            return node.propertyName !== propertyName\n                || node.name !== name\n                ? update(createExportSpecifier(propertyName, name), node)\n                : node;\n        }\n        // @api\n        function createMissingDeclaration() {\n            var node = createBaseDeclaration(271 /* MissingDeclaration */, \n            /*decorators*/ undefined, \n            /*modifiers*/ undefined);\n            return node;\n        }\n        //\n        // Module references\n        //\n        // @api\n        function createExternalModuleReference(expression) {\n            var node = createBaseNode(272 /* ExternalModuleReference */);\n            node.expression = expression;\n            node.transformFlags |= propagateChildFlags(node.expression);\n            node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context\n            return node;\n        }\n        // @api\n        function updateExternalModuleReference(node, expression) {\n            return node.expression !== expression\n                ? update(createExternalModuleReference(expression), node)\n                : node;\n        }\n        //\n        // JSDoc\n        //\n        // @api\n        // createJSDocAllType\n        // createJSDocUnknownType\n        function createJSDocPrimaryTypeWorker(kind) {\n            return createBaseNode(kind);\n        }\n        // @api\n        // createJSDocNonNullableType\n        // createJSDocNullableType\n        // createJSDocOptionalType\n        // createJSDocVariadicType\n        // createJSDocNamepathType\n        function createJSDocUnaryTypeWorker(kind, type) {\n            var node = createBaseNode(kind);\n            node.type = type;\n            return node;\n        }\n        // @api\n        // updateJSDocNonNullableType\n        // updateJSDocNullableType\n        // updateJSDocOptionalType\n        // updateJSDocVariadicType\n        // updateJSDocNamepathType\n        function updateJSDocUnaryTypeWorker(kind, node, type) {\n            return node.type !== type\n                ? update(createJSDocUnaryTypeWorker(kind, type), node)\n                : node;\n        }\n        // @api\n        function createJSDocFunctionType(parameters, type) {\n            var node = createBaseSignatureDeclaration(308 /* JSDocFunctionType */, \n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, \n            /*name*/ undefined, \n            /*typeParameters*/ undefined, parameters, type);\n            return node;\n        }\n        // @api\n        function updateJSDocFunctionType(node, parameters, type) {\n            return node.parameters !== parameters\n                || node.type !== type\n                ? update(createJSDocFunctionType(parameters, type), node)\n                : node;\n        }\n        // @api\n        function createJSDocTypeLiteral(propertyTags, isArrayType) {\n            if (isArrayType === void 0) { isArrayType = false; }\n            var node = createBaseNode(312 /* JSDocTypeLiteral */);\n            node.jsDocPropertyTags = asNodeArray(propertyTags);\n            node.isArrayType = isArrayType;\n            return node;\n        }\n        // @api\n        function updateJSDocTypeLiteral(node, propertyTags, isArrayType) {\n            return node.jsDocPropertyTags !== propertyTags\n                || node.isArrayType !== isArrayType\n                ? update(createJSDocTypeLiteral(propertyTags, isArrayType), node)\n                : node;\n        }\n        // @api\n        function createJSDocTypeExpression(type) {\n            var node = createBaseNode(301 /* JSDocTypeExpression */);\n            node.type = type;\n            return node;\n        }\n        // @api\n        function updateJSDocTypeExpression(node, type) {\n            return node.type !== type\n                ? update(createJSDocTypeExpression(type), node)\n                : node;\n        }\n        // @api\n        function createJSDocSignature(typeParameters, parameters, type) {\n            var node = createBaseNode(313 /* JSDocSignature */);\n            node.typeParameters = asNodeArray(typeParameters);\n            node.parameters = createNodeArray(parameters);\n            node.type = type;\n            return node;\n        }\n        // @api\n        function updateJSDocSignature(node, typeParameters, parameters, type) {\n            return node.typeParameters !== typeParameters\n                || node.parameters !== parameters\n                || node.type !== type\n                ? update(createJSDocSignature(typeParameters, parameters, type), node)\n                : node;\n        }\n        function getDefaultTagName(node) {\n            var defaultTagName = getDefaultTagNameForKind(node.kind);\n            return node.tagName.escapedText === ts.escapeLeadingUnderscores(defaultTagName)\n                ? node.tagName\n                : createIdentifier(defaultTagName);\n        }\n        // @api\n        function createBaseJSDocTag(kind, tagName, comment) {\n            var node = createBaseNode(kind);\n            node.tagName = tagName;\n            node.comment = comment;\n            return node;\n        }\n        // @api\n        function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) {\n            var node = createBaseJSDocTag(330 /* JSDocTemplateTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier(\"template\"), comment);\n            node.constraint = constraint;\n            node.typeParameters = createNodeArray(typeParameters);\n            return node;\n        }\n        // @api\n        function updateJSDocTemplateTag(node, tagName, constraint, typeParameters, comment) {\n            if (tagName === void 0) { tagName = getDefaultTagName(node); }\n            return node.tagName !== tagName\n                || node.constraint !== constraint\n                || node.typeParameters !== typeParameters\n                || node.comment !== comment\n                ? update(createJSDocTemplateTag(tagName, constraint, typeParameters, comment), node)\n                : node;\n        }\n        // @api\n        function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) {\n            var node = createBaseJSDocTag(331 /* JSDocTypedefTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier(\"typedef\"), comment);\n            node.typeExpression = typeExpression;\n            node.fullName = fullName;\n            node.name = ts.getJSDocTypeAliasName(fullName);\n            return node;\n        }\n        // @api\n        function updateJSDocTypedefTag(node, tagName, typeExpression, fullName, comment) {\n            if (tagName === void 0) { tagName = getDefaultTagName(node); }\n            return node.tagName !== tagName\n                || node.typeExpression !== typeExpression\n                || node.fullName !== fullName\n                || node.comment !== comment\n                ? update(createJSDocTypedefTag(tagName, typeExpression, fullName, comment), node)\n                : node;\n        }\n        // @api\n        function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {\n            var node = createBaseJSDocTag(326 /* JSDocParameterTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier(\"param\"), comment);\n            node.typeExpression = typeExpression;\n            node.name = name;\n            node.isNameFirst = !!isNameFirst;\n            node.isBracketed = isBracketed;\n            return node;\n        }\n        // @api\n        function updateJSDocParameterTag(node, tagName, name, isBracketed, typeExpression, isNameFirst, comment) {\n            if (tagName === void 0) { tagName = getDefaultTagName(node); }\n            return node.tagName !== tagName\n                || node.name !== name\n                || node.isBracketed !== isBracketed\n                || node.typeExpression !== typeExpression\n                || node.isNameFirst !== isNameFirst\n                || node.comment !== comment\n                ? update(createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node)\n                : node;\n        }\n        // @api\n        function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {\n            var node = createBaseJSDocTag(333 /* JSDocPropertyTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier(\"prop\"), comment);\n            node.typeExpression = typeExpression;\n            node.name = name;\n            node.isNameFirst = !!isNameFirst;\n            node.isBracketed = isBracketed;\n            return node;\n        }\n        // @api\n        function updateJSDocPropertyTag(node, tagName, name, isBracketed, typeExpression, isNameFirst, comment) {\n            if (tagName === void 0) { tagName = getDefaultTagName(node); }\n            return node.tagName !== tagName\n                || node.name !== name\n                || node.isBracketed !== isBracketed\n                || node.typeExpression !== typeExpression\n                || node.isNameFirst !== isNameFirst\n                || node.comment !== comment\n                ? update(createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node)\n                : node;\n        }\n        // @api\n        function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) {\n            var node = createBaseJSDocTag(324 /* JSDocCallbackTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier(\"callback\"), comment);\n            node.typeExpression = typeExpression;\n            node.fullName = fullName;\n            node.name = ts.getJSDocTypeAliasName(fullName);\n            return node;\n        }\n        // @api\n        function updateJSDocCallbackTag(node, tagName, typeExpression, fullName, comment) {\n            if (tagName === void 0) { tagName = getDefaultTagName(node); }\n            return node.tagName !== tagName\n                || node.typeExpression !== typeExpression\n                || node.fullName !== fullName\n                || node.comment !== comment\n                ? update(createJSDocCallbackTag(tagName, typeExpression, fullName, comment), node)\n                : node;\n        }\n        // @api\n        function createJSDocAugmentsTag(tagName, className, comment) {\n            var node = createBaseJSDocTag(315 /* JSDocAugmentsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier(\"augments\"), comment);\n            node.class = className;\n            return node;\n        }\n        // @api\n        function updateJSDocAugmentsTag(node, tagName, className, comment) {\n            if (tagName === void 0) { tagName = getDefaultTagName(node); }\n            return node.tagName !== tagName\n                || node.class !== className\n                || node.comment !== comment\n                ? update(createJSDocAugmentsTag(tagName, className, comment), node)\n                : node;\n        }\n        // @api\n        function createJSDocImplementsTag(tagName, className, comment) {\n            var node = createBaseJSDocTag(316 /* JSDocImplementsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier(\"implements\"), comment);\n            node.class = className;\n            return node;\n        }\n        // @api\n        function createJSDocSeeTag(tagName, name, comment) {\n            var node = createBaseJSDocTag(332 /* JSDocSeeTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier(\"see\"), comment);\n            node.name = name;\n            return node;\n        }\n        // @api\n        function updateJSDocSeeTag(node, tagName, name, comment) {\n            return node.tagName !== tagName\n                || node.name !== name\n                || node.comment !== comment\n                ? update(createJSDocSeeTag(tagName, name, comment), node)\n                : node;\n        }\n        // @api\n        function createJSDocNameReference(name) {\n            var node = createBaseNode(302 /* JSDocNameReference */);\n            node.name = name;\n            return node;\n        }\n        // @api\n        function updateJSDocNameReference(node, name) {\n            return node.name !== name\n                ? update(createJSDocNameReference(name), node)\n                : node;\n        }\n        // @api\n        function updateJSDocImplementsTag(node, tagName, className, comment) {\n            if (tagName === void 0) { tagName = getDefaultTagName(node); }\n            return node.tagName !== tagName\n                || node.class !== className\n                || node.comment !== comment\n                ? update(createJSDocImplementsTag(tagName, className, comment), node)\n                : node;\n        }\n        // @api\n        // createJSDocAuthorTag\n        // createJSDocClassTag\n        // createJSDocPublicTag\n        // createJSDocPrivateTag\n        // createJSDocProtectedTag\n        // createJSDocReadonlyTag\n        // createJSDocDeprecatedTag\n        function createJSDocSimpleTagWorker(kind, tagName, comment) {\n            var node = createBaseJSDocTag(kind, tagName !== null && tagName !== void 0 ? tagName : createIdentifier(getDefaultTagNameForKind(kind)), comment);\n            return node;\n        }\n        // @api\n        // updateJSDocAuthorTag\n        // updateJSDocClassTag\n        // updateJSDocPublicTag\n        // updateJSDocPrivateTag\n        // updateJSDocProtectedTag\n        // updateJSDocReadonlyTag\n        // updateJSDocDeprecatedTag\n        function updateJSDocSimpleTagWorker(kind, node, tagName, comment) {\n            if (tagName === void 0) { tagName = getDefaultTagName(node); }\n            return node.tagName !== tagName\n                || node.comment !== comment\n                ? update(createJSDocSimpleTagWorker(kind, tagName, comment), node) :\n                node;\n        }\n        // @api\n        // createJSDocTypeTag\n        // createJSDocReturnTag\n        // createJSDocThisTag\n        // createJSDocEnumTag\n        function createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment) {\n            var node = createBaseJSDocTag(kind, tagName !== null && tagName !== void 0 ? tagName : createIdentifier(getDefaultTagNameForKind(kind)), comment);\n            node.typeExpression = typeExpression;\n            return node;\n        }\n        // @api\n        // updateJSDocTypeTag\n        // updateJSDocReturnTag\n        // updateJSDocThisTag\n        // updateJSDocEnumTag\n        function updateJSDocTypeLikeTagWorker(kind, node, tagName, typeExpression, comment) {\n            if (tagName === void 0) { tagName = getDefaultTagName(node); }\n            return node.tagName !== tagName\n                || node.typeExpression !== typeExpression\n                || node.comment !== comment\n                ? update(createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment), node)\n                : node;\n        }\n        // @api\n        function createJSDocUnknownTag(tagName, comment) {\n            var node = createBaseJSDocTag(314 /* JSDocTag */, tagName, comment);\n            return node;\n        }\n        // @api\n        function updateJSDocUnknownTag(node, tagName, comment) {\n            return node.tagName !== tagName\n                || node.comment !== comment\n                ? update(createJSDocUnknownTag(tagName, comment), node)\n                : node;\n        }\n        // @api\n        function createJSDocComment(comment, tags) {\n            var node = createBaseNode(311 /* JSDocComment */);\n            node.comment = comment;\n            node.tags = asNodeArray(tags);\n            return node;\n        }\n        // @api\n        function updateJSDocComment(node, comment, tags) {\n            return node.comment !== comment\n                || node.tags !== tags\n                ? update(createJSDocComment(comment, tags), node)\n                : node;\n        }\n        //\n        // JSX\n        //\n        // @api\n        function createJsxElement(openingElement, children, closingElement) {\n            var node = createBaseNode(273 /* JsxElement */);\n            node.openingElement = openingElement;\n            node.children = createNodeArray(children);\n            node.closingElement = closingElement;\n            node.transformFlags |=\n                propagateChildFlags(node.openingElement) |\n                    propagateChildrenFlags(node.children) |\n                    propagateChildFlags(node.closingElement) |\n                    2 /* ContainsJsx */;\n            return node;\n        }\n        // @api\n        function updateJsxElement(node, openingElement, children, closingElement) {\n            return node.openingElement !== openingElement\n                || node.children !== children\n                || node.closingElement !== closingElement\n                ? update(createJsxElement(openingElement, children, closingElement), node)\n                : node;\n        }\n        // @api\n        function createJsxSelfClosingElement(tagName, typeArguments, attributes) {\n            var node = createBaseNode(274 /* JsxSelfClosingElement */);\n            node.tagName = tagName;\n            node.typeArguments = asNodeArray(typeArguments);\n            node.attributes = attributes;\n            node.transformFlags |=\n                propagateChildFlags(node.tagName) |\n                    propagateChildrenFlags(node.typeArguments) |\n                    propagateChildFlags(node.attributes) |\n                    2 /* ContainsJsx */;\n            if (node.typeArguments) {\n                node.transformFlags |= 1 /* ContainsTypeScript */;\n            }\n            return node;\n        }\n        // @api\n        function updateJsxSelfClosingElement(node, tagName, typeArguments, attributes) {\n            return node.tagName !== tagName\n                || node.typeArguments !== typeArguments\n                || node.attributes !== attributes\n                ? update(createJsxSelfClosingElement(tagName, typeArguments, attributes), node)\n                : node;\n        }\n        // @api\n        function createJsxOpeningElement(tagName, typeArguments, attributes) {\n            var node = createBaseNode(275 /* JsxOpeningElement */);\n            node.tagName = tagName;\n            node.typeArguments = asNodeArray(typeArguments);\n            node.attributes = attributes;\n            node.transformFlags |=\n                propagateChildFlags(node.tagName) |\n                    propagateChildrenFlags(node.typeArguments) |\n                    propagateChildFlags(node.attributes) |\n                    2 /* ContainsJsx */;\n            if (typeArguments) {\n                node.transformFlags |= 1 /* ContainsTypeScript */;\n            }\n            return node;\n        }\n        // @api\n        function updateJsxOpeningElement(node, tagName, typeArguments, attributes) {\n            return node.tagName !== tagName\n                || node.typeArguments !== typeArguments\n                || node.attributes !== attributes\n                ? update(createJsxOpeningElement(tagName, typeArguments, attributes), node)\n                : node;\n        }\n        // @api\n        function createJsxClosingElement(tagName) {\n            var node = createBaseNode(276 /* JsxClosingElement */);\n            node.tagName = tagName;\n            node.transformFlags |=\n                propagateChildFlags(node.tagName) |\n                    2 /* ContainsJsx */;\n            return node;\n        }\n        // @api\n        function updateJsxClosingElement(node, tagName) {\n            return node.tagName !== tagName\n                ? update(createJsxClosingElement(tagName), node)\n                : node;\n        }\n        // @api\n        function createJsxFragment(openingFragment, children, closingFragment) {\n            var node = createBaseNode(277 /* JsxFragment */);\n            node.openingFragment = openingFragment;\n            node.children = createNodeArray(children);\n            node.closingFragment = closingFragment;\n            node.transformFlags |=\n                propagateChildFlags(node.openingFragment) |\n                    propagateChildrenFlags(node.children) |\n                    propagateChildFlags(node.closingFragment) |\n                    2 /* ContainsJsx */;\n            return node;\n        }\n        // @api\n        function updateJsxFragment(node, openingFragment, children, closingFragment) {\n            return node.openingFragment !== openingFragment\n                || node.children !== children\n                || node.closingFragment !== closingFragment\n                ? update(createJsxFragment(openingFragment, children, closingFragment), node)\n                : node;\n        }\n        // @api\n        function createJsxText(text, containsOnlyTriviaWhiteSpaces) {\n            var node = createBaseNode(11 /* JsxText */);\n            node.text = text;\n            node.containsOnlyTriviaWhiteSpaces = !!containsOnlyTriviaWhiteSpaces;\n            node.transformFlags |= 2 /* ContainsJsx */;\n            return node;\n        }\n        // @api\n        function updateJsxText(node, text, containsOnlyTriviaWhiteSpaces) {\n            return node.text !== text\n                || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces\n                ? update(createJsxText(text, containsOnlyTriviaWhiteSpaces), node)\n                : node;\n        }\n        // @api\n        function createJsxOpeningFragment() {\n            var node = createBaseNode(278 /* JsxOpeningFragment */);\n            node.transformFlags |= 2 /* ContainsJsx */;\n            return node;\n        }\n        // @api\n        function createJsxJsxClosingFragment() {\n            var node = createBaseNode(279 /* JsxClosingFragment */);\n            node.transformFlags |= 2 /* ContainsJsx */;\n            return node;\n        }\n        // @api\n        function createJsxAttribute(name, initializer) {\n            var node = createBaseNode(280 /* JsxAttribute */);\n            node.name = name;\n            node.initializer = initializer;\n            node.transformFlags |=\n                propagateChildFlags(node.name) |\n                    propagateChildFlags(node.initializer) |\n                    2 /* ContainsJsx */;\n            return node;\n        }\n        // @api\n        function updateJsxAttribute(node, name, initializer) {\n            return node.name !== name\n                || node.initializer !== initializer\n                ? update(createJsxAttribute(name, initializer), node)\n                : node;\n        }\n        // @api\n        function createJsxAttributes(properties) {\n            var node = createBaseNode(281 /* JsxAttributes */);\n            node.properties = createNodeArray(properties);\n            node.transformFlags |=\n                propagateChildrenFlags(node.properties) |\n                    2 /* ContainsJsx */;\n            return node;\n        }\n        // @api\n        function updateJsxAttributes(node, properties) {\n            return node.properties !== properties\n                ? update(createJsxAttributes(properties), node)\n                : node;\n        }\n        // @api\n        function createJsxSpreadAttribute(expression) {\n            var node = createBaseNode(282 /* JsxSpreadAttribute */);\n            node.expression = expression;\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    2 /* ContainsJsx */;\n            return node;\n        }\n        // @api\n        function updateJsxSpreadAttribute(node, expression) {\n            return node.expression !== expression\n                ? update(createJsxSpreadAttribute(expression), node)\n                : node;\n        }\n        // @api\n        function createJsxExpression(dotDotDotToken, expression) {\n            var node = createBaseNode(283 /* JsxExpression */);\n            node.dotDotDotToken = dotDotDotToken;\n            node.expression = expression;\n            node.transformFlags |=\n                propagateChildFlags(node.dotDotDotToken) |\n                    propagateChildFlags(node.expression) |\n                    2 /* ContainsJsx */;\n            return node;\n        }\n        // @api\n        function updateJsxExpression(node, expression) {\n            return node.expression !== expression\n                ? update(createJsxExpression(node.dotDotDotToken, expression), node)\n                : node;\n        }\n        //\n        // Clauses\n        //\n        // @api\n        function createCaseClause(expression, statements) {\n            var node = createBaseNode(284 /* CaseClause */);\n            node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);\n            node.statements = createNodeArray(statements);\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    propagateChildrenFlags(node.statements);\n            return node;\n        }\n        // @api\n        function updateCaseClause(node, expression, statements) {\n            return node.expression !== expression\n                || node.statements !== statements\n                ? update(createCaseClause(expression, statements), node)\n                : node;\n        }\n        // @api\n        function createDefaultClause(statements) {\n            var node = createBaseNode(285 /* DefaultClause */);\n            node.statements = createNodeArray(statements);\n            node.transformFlags = propagateChildrenFlags(node.statements);\n            return node;\n        }\n        // @api\n        function updateDefaultClause(node, statements) {\n            return node.statements !== statements\n                ? update(createDefaultClause(statements), node)\n                : node;\n        }\n        // @api\n        function createHeritageClause(token, types) {\n            var node = createBaseNode(286 /* HeritageClause */);\n            node.token = token;\n            node.types = createNodeArray(types);\n            node.transformFlags |= propagateChildrenFlags(node.types);\n            switch (token) {\n                case 93 /* ExtendsKeyword */:\n                    node.transformFlags |= 256 /* ContainsES2015 */;\n                    break;\n                case 116 /* ImplementsKeyword */:\n                    node.transformFlags |= 1 /* ContainsTypeScript */;\n                    break;\n                default:\n                    return ts.Debug.assertNever(token);\n            }\n            return node;\n        }\n        // @api\n        function updateHeritageClause(node, types) {\n            return node.types !== types\n                ? update(createHeritageClause(node.token, types), node)\n                : node;\n        }\n        // @api\n        function createCatchClause(variableDeclaration, block) {\n            var node = createBaseNode(287 /* CatchClause */);\n            variableDeclaration = !ts.isString(variableDeclaration) ? variableDeclaration : createVariableDeclaration(variableDeclaration, \n            /*exclamationToken*/ undefined, \n            /*type*/ undefined, \n            /*initializer*/ undefined);\n            node.variableDeclaration = variableDeclaration;\n            node.block = block;\n            node.transformFlags |=\n                propagateChildFlags(node.variableDeclaration) |\n                    propagateChildFlags(node.block);\n            if (!variableDeclaration)\n                node.transformFlags |= 16 /* ContainsES2019 */;\n            return node;\n        }\n        // @api\n        function updateCatchClause(node, variableDeclaration, block) {\n            return node.variableDeclaration !== variableDeclaration\n                || node.block !== block\n                ? update(createCatchClause(variableDeclaration, block), node)\n                : node;\n        }\n        //\n        // Property assignments\n        //\n        // @api\n        function createPropertyAssignment(name, initializer) {\n            var node = createBaseNamedDeclaration(288 /* PropertyAssignment */, \n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, name);\n            node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);\n            node.transformFlags |=\n                propagateChildFlags(node.name) |\n                    propagateChildFlags(node.initializer);\n            return node;\n        }\n        function finishUpdatePropertyAssignment(updated, original) {\n            // copy children used only for error reporting\n            if (original.decorators)\n                updated.decorators = original.decorators;\n            if (original.modifiers)\n                updated.modifiers = original.modifiers;\n            if (original.questionToken)\n                updated.questionToken = original.questionToken;\n            if (original.exclamationToken)\n                updated.exclamationToken = original.exclamationToken;\n            return update(updated, original);\n        }\n        // @api\n        function updatePropertyAssignment(node, name, initializer) {\n            return node.name !== name\n                || node.initializer !== initializer\n                ? finishUpdatePropertyAssignment(createPropertyAssignment(name, initializer), node)\n                : node;\n        }\n        // @api\n        function createShorthandPropertyAssignment(name, objectAssignmentInitializer) {\n            var node = createBaseNamedDeclaration(289 /* ShorthandPropertyAssignment */, \n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, name);\n            node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer);\n            node.transformFlags |=\n                propagateChildFlags(node.objectAssignmentInitializer) |\n                    256 /* ContainsES2015 */;\n            return node;\n        }\n        function finishUpdateShorthandPropertyAssignment(updated, original) {\n            // copy children used only for error reporting\n            if (original.decorators)\n                updated.decorators = original.decorators;\n            if (original.modifiers)\n                updated.modifiers = original.modifiers;\n            if (original.equalsToken)\n                updated.equalsToken = original.equalsToken;\n            if (original.questionToken)\n                updated.questionToken = original.questionToken;\n            if (original.exclamationToken)\n                updated.exclamationToken = original.exclamationToken;\n            return update(updated, original);\n        }\n        // @api\n        function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) {\n            return node.name !== name\n                || node.objectAssignmentInitializer !== objectAssignmentInitializer\n                ? finishUpdateShorthandPropertyAssignment(createShorthandPropertyAssignment(name, objectAssignmentInitializer), node)\n                : node;\n        }\n        // @api\n        function createSpreadAssignment(expression) {\n            var node = createBaseNode(290 /* SpreadAssignment */);\n            node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    32 /* ContainsES2018 */ |\n                    16384 /* ContainsObjectRestOrSpread */;\n            return node;\n        }\n        // @api\n        function updateSpreadAssignment(node, expression) {\n            return node.expression !== expression\n                ? update(createSpreadAssignment(expression), node)\n                : node;\n        }\n        //\n        // Enum\n        //\n        // @api\n        function createEnumMember(name, initializer) {\n            var node = createBaseNode(291 /* EnumMember */);\n            node.name = asName(name);\n            node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);\n            node.transformFlags |=\n                propagateChildFlags(node.name) |\n                    propagateChildFlags(node.initializer) |\n                    1 /* ContainsTypeScript */;\n            return node;\n        }\n        // @api\n        function updateEnumMember(node, name, initializer) {\n            return node.name !== name\n                || node.initializer !== initializer\n                ? update(createEnumMember(name, initializer), node)\n                : node;\n        }\n        //\n        // Top-level nodes\n        //\n        // @api\n        function createSourceFile(statements, endOfFileToken, flags) {\n            var node = baseFactory.createBaseSourceFileNode(297 /* SourceFile */);\n            node.statements = createNodeArray(statements);\n            node.endOfFileToken = endOfFileToken;\n            node.flags |= flags;\n            node.fileName = \"\";\n            node.text = \"\";\n            node.languageVersion = 0;\n            node.languageVariant = 0;\n            node.scriptKind = 0;\n            node.isDeclarationFile = false;\n            node.hasNoDefaultLib = false;\n            node.transformFlags |=\n                propagateChildrenFlags(node.statements) |\n                    propagateChildFlags(node.endOfFileToken);\n            return node;\n        }\n        function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {\n            var node = baseFactory.createBaseSourceFileNode(297 /* SourceFile */);\n            for (var p in source) {\n                if (p === \"emitNode\" || ts.hasProperty(node, p) || !ts.hasProperty(source, p))\n                    continue;\n                node[p] = source[p];\n            }\n            node.flags |= source.flags;\n            node.statements = createNodeArray(statements);\n            node.endOfFileToken = source.endOfFileToken;\n            node.isDeclarationFile = isDeclarationFile;\n            node.referencedFiles = referencedFiles;\n            node.typeReferenceDirectives = typeReferences;\n            node.hasNoDefaultLib = hasNoDefaultLib;\n            node.libReferenceDirectives = libReferences;\n            node.transformFlags =\n                propagateChildrenFlags(node.statements) |\n                    propagateChildFlags(node.endOfFileToken);\n            return node;\n        }\n        // @api\n        function updateSourceFile(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives) {\n            if (isDeclarationFile === void 0) { isDeclarationFile = node.isDeclarationFile; }\n            if (referencedFiles === void 0) { referencedFiles = node.referencedFiles; }\n            if (typeReferenceDirectives === void 0) { typeReferenceDirectives = node.typeReferenceDirectives; }\n            if (hasNoDefaultLib === void 0) { hasNoDefaultLib = node.hasNoDefaultLib; }\n            if (libReferenceDirectives === void 0) { libReferenceDirectives = node.libReferenceDirectives; }\n            return node.statements !== statements\n                || node.isDeclarationFile !== isDeclarationFile\n                || node.referencedFiles !== referencedFiles\n                || node.typeReferenceDirectives !== typeReferenceDirectives\n                || node.hasNoDefaultLib !== hasNoDefaultLib\n                || node.libReferenceDirectives !== libReferenceDirectives\n                ? update(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives), node)\n                : node;\n        }\n        // @api\n        function createBundle(sourceFiles, prepends) {\n            if (prepends === void 0) { prepends = ts.emptyArray; }\n            var node = createBaseNode(298 /* Bundle */);\n            node.prepends = prepends;\n            node.sourceFiles = sourceFiles;\n            return node;\n        }\n        // @api\n        function updateBundle(node, sourceFiles, prepends) {\n            if (prepends === void 0) { prepends = ts.emptyArray; }\n            return node.sourceFiles !== sourceFiles\n                || node.prepends !== prepends\n                ? update(createBundle(sourceFiles, prepends), node)\n                : node;\n        }\n        // @api\n        function createUnparsedSource(prologues, syntheticReferences, texts) {\n            var node = createBaseNode(299 /* UnparsedSource */);\n            node.prologues = prologues;\n            node.syntheticReferences = syntheticReferences;\n            node.texts = texts;\n            node.fileName = \"\";\n            node.text = \"\";\n            node.referencedFiles = ts.emptyArray;\n            node.libReferenceDirectives = ts.emptyArray;\n            node.getLineAndCharacterOfPosition = function (pos) { return ts.getLineAndCharacterOfPosition(node, pos); };\n            return node;\n        }\n        function createBaseUnparsedNode(kind, data) {\n            var node = createBaseNode(kind);\n            node.data = data;\n            return node;\n        }\n        // @api\n        function createUnparsedPrologue(data) {\n            return createBaseUnparsedNode(292 /* UnparsedPrologue */, data);\n        }\n        // @api\n        function createUnparsedPrepend(data, texts) {\n            var node = createBaseUnparsedNode(293 /* UnparsedPrepend */, data);\n            node.texts = texts;\n            return node;\n        }\n        // @api\n        function createUnparsedTextLike(data, internal) {\n            return createBaseUnparsedNode(internal ? 295 /* UnparsedInternalText */ : 294 /* UnparsedText */, data);\n        }\n        // @api\n        function createUnparsedSyntheticReference(section) {\n            var node = createBaseNode(296 /* UnparsedSyntheticReference */);\n            node.data = section.data;\n            node.section = section;\n            return node;\n        }\n        // @api\n        function createInputFiles() {\n            var node = createBaseNode(300 /* InputFiles */);\n            node.javascriptText = \"\";\n            node.declarationText = \"\";\n            return node;\n        }\n        //\n        // Synthetic Nodes (used by checker)\n        //\n        // @api\n        function createSyntheticExpression(type, isSpread, tupleNameSource) {\n            if (isSpread === void 0) { isSpread = false; }\n            var node = createBaseNode(227 /* SyntheticExpression */);\n            node.type = type;\n            node.isSpread = isSpread;\n            node.tupleNameSource = tupleNameSource;\n            return node;\n        }\n        // @api\n        function createSyntaxList(children) {\n            var node = createBaseNode(334 /* SyntaxList */);\n            node._children = children;\n            return node;\n        }\n        //\n        // Transformation nodes\n        //\n        /**\n         * Creates a synthetic statement to act as a placeholder for a not-emitted statement in\n         * order to preserve comments.\n         *\n         * @param original The original statement.\n         */\n        // @api\n        function createNotEmittedStatement(original) {\n            var node = createBaseNode(335 /* NotEmittedStatement */);\n            node.original = original;\n            ts.setTextRange(node, original);\n            return node;\n        }\n        /**\n         * Creates a synthetic expression to act as a placeholder for a not-emitted expression in\n         * order to preserve comments or sourcemap positions.\n         *\n         * @param expression The inner expression to emit.\n         * @param original The original outer expression.\n         */\n        // @api\n        function createPartiallyEmittedExpression(expression, original) {\n            var node = createBaseNode(336 /* PartiallyEmittedExpression */);\n            node.expression = expression;\n            node.original = original;\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    1 /* ContainsTypeScript */;\n            ts.setTextRange(node, original);\n            return node;\n        }\n        // @api\n        function updatePartiallyEmittedExpression(node, expression) {\n            return node.expression !== expression\n                ? update(createPartiallyEmittedExpression(expression, node.original), node)\n                : node;\n        }\n        function flattenCommaElements(node) {\n            if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) {\n                if (ts.isCommaListExpression(node)) {\n                    return node.elements;\n                }\n                if (ts.isBinaryExpression(node) && ts.isCommaToken(node.operatorToken)) {\n                    return [node.left, node.right];\n                }\n            }\n            return node;\n        }\n        // @api\n        function createCommaListExpression(elements) {\n            var node = createBaseNode(337 /* CommaListExpression */);\n            node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements));\n            node.transformFlags |= propagateChildrenFlags(node.elements);\n            return node;\n        }\n        // @api\n        function updateCommaListExpression(node, elements) {\n            return node.elements !== elements\n                ? update(createCommaListExpression(elements), node)\n                : node;\n        }\n        /**\n         * Creates a synthetic element to act as a placeholder for the end of an emitted declaration in\n         * order to properly emit exports.\n         */\n        // @api\n        function createEndOfDeclarationMarker(original) {\n            var node = createBaseNode(339 /* EndOfDeclarationMarker */);\n            node.emitNode = {};\n            node.original = original;\n            return node;\n        }\n        /**\n         * Creates a synthetic element to act as a placeholder for the beginning of a merged declaration in\n         * order to properly emit exports.\n         */\n        // @api\n        function createMergeDeclarationMarker(original) {\n            var node = createBaseNode(338 /* MergeDeclarationMarker */);\n            node.emitNode = {};\n            node.original = original;\n            return node;\n        }\n        // @api\n        function createSyntheticReferenceExpression(expression, thisArg) {\n            var node = createBaseNode(340 /* SyntheticReferenceExpression */);\n            node.expression = expression;\n            node.thisArg = thisArg;\n            node.transformFlags |=\n                propagateChildFlags(node.expression) |\n                    propagateChildFlags(node.thisArg);\n            return node;\n        }\n        // @api\n        function updateSyntheticReferenceExpression(node, expression, thisArg) {\n            return node.expression !== expression\n                || node.thisArg !== thisArg\n                ? update(createSyntheticReferenceExpression(expression, thisArg), node)\n                : node;\n        }\n        function cloneNode(node) {\n            // We don't use \"clone\" from core.ts here, as we need to preserve the prototype chain of\n            // the original node. We also need to exclude specific properties and only include own-\n            // properties (to skip members already defined on the shared prototype).\n            if (node === undefined) {\n                return node;\n            }\n            var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(297 /* SourceFile */) :\n                ts.isIdentifier(node) ? baseFactory.createBaseIdentifierNode(78 /* Identifier */) :\n                    ts.isPrivateIdentifier(node) ? baseFactory.createBasePrivateIdentifierNode(79 /* PrivateIdentifier */) :\n                        !ts.isNodeKind(node.kind) ? baseFactory.createBaseTokenNode(node.kind) :\n                            baseFactory.createBaseNode(node.kind);\n            clone.flags |= (node.flags & ~8 /* Synthesized */);\n            clone.transformFlags = node.transformFlags;\n            setOriginalNode(clone, node);\n            for (var key in node) {\n                if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) {\n                    continue;\n                }\n                clone[key] = node[key];\n            }\n            return clone;\n        }\n        function createImmediatelyInvokedFunctionExpression(statements, param, paramValue) {\n            return createCallExpression(createFunctionExpression(\n            /*modifiers*/ undefined, \n            /*asteriskToken*/ undefined, \n            /*name*/ undefined, \n            /*typeParameters*/ undefined, \n            /*parameters*/ param ? [param] : [], \n            /*type*/ undefined, createBlock(statements, /*multiLine*/ true)), \n            /*typeArguments*/ undefined, \n            /*argumentsArray*/ paramValue ? [paramValue] : []);\n        }\n        function createImmediatelyInvokedArrowFunction(statements, param, paramValue) {\n            return createCallExpression(createArrowFunction(\n            /*modifiers*/ undefined, \n            /*typeParameters*/ undefined, \n            /*parameters*/ param ? [param] : [], \n            /*type*/ undefined, \n            /*equalsGreaterThanToken*/ undefined, createBlock(statements, /*multiLine*/ true)), \n            /*typeArguments*/ undefined, \n            /*argumentsArray*/ paramValue ? [paramValue] : []);\n        }\n        function createVoidZero() {\n            return createVoidExpression(createNumericLiteral(\"0\"));\n        }\n        function createExportDefault(expression) {\n            return createExportAssignment(\n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, \n            /*isExportEquals*/ false, expression);\n        }\n        function createExternalModuleExport(exportName) {\n            return createExportDeclaration(\n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, \n            /*isTypeOnly*/ false, createNamedExports([\n                createExportSpecifier(/*propertyName*/ undefined, exportName)\n            ]));\n        }\n        //\n        // Utilities\n        //\n        function createTypeCheck(value, tag) {\n            return tag === \"undefined\"\n                ? factory.createStrictEquality(value, createVoidZero())\n                : factory.createStrictEquality(createTypeOfExpression(value), createStringLiteral(tag));\n        }\n        function createMethodCall(object, methodName, argumentsList) {\n            return createCallExpression(createPropertyAccessExpression(object, methodName), \n            /*typeArguments*/ undefined, argumentsList);\n        }\n        function createFunctionBindCall(target, thisArg, argumentsList) {\n            return createMethodCall(target, \"bind\", __spreadArray([thisArg], argumentsList));\n        }\n        function createFunctionCallCall(target, thisArg, argumentsList) {\n            return createMethodCall(target, \"call\", __spreadArray([thisArg], argumentsList));\n        }\n        function createFunctionApplyCall(target, thisArg, argumentsExpression) {\n            return createMethodCall(target, \"apply\", [thisArg, argumentsExpression]);\n        }\n        function createGlobalMethodCall(globalObjectName, methodName, argumentsList) {\n            return createMethodCall(createIdentifier(globalObjectName), methodName, argumentsList);\n        }\n        function createArraySliceCall(array, start) {\n            return createMethodCall(array, \"slice\", start === undefined ? [] : [asExpression(start)]);\n        }\n        function createArrayConcatCall(array, argumentsList) {\n            return createMethodCall(array, \"concat\", argumentsList);\n        }\n        function createObjectDefinePropertyCall(target, propertyName, attributes) {\n            return createGlobalMethodCall(\"Object\", \"defineProperty\", [target, asExpression(propertyName), attributes]);\n        }\n        function tryAddPropertyAssignment(properties, propertyName, expression) {\n            if (expression) {\n                properties.push(createPropertyAssignment(propertyName, expression));\n                return true;\n            }\n            return false;\n        }\n        function createPropertyDescriptor(attributes, singleLine) {\n            var properties = [];\n            tryAddPropertyAssignment(properties, \"enumerable\", asExpression(attributes.enumerable));\n            tryAddPropertyAssignment(properties, \"configurable\", asExpression(attributes.configurable));\n            var isData = tryAddPropertyAssignment(properties, \"writable\", asExpression(attributes.writable));\n            isData = tryAddPropertyAssignment(properties, \"value\", attributes.value) || isData;\n            var isAccessor = tryAddPropertyAssignment(properties, \"get\", attributes.get);\n            isAccessor = tryAddPropertyAssignment(properties, \"set\", attributes.set) || isAccessor;\n            ts.Debug.assert(!(isData && isAccessor), \"A PropertyDescriptor may not be both an accessor descriptor and a data descriptor.\");\n            return createObjectLiteralExpression(properties, !singleLine);\n        }\n        function updateOuterExpression(outerExpression, expression) {\n            switch (outerExpression.kind) {\n                case 207 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression);\n                case 206 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression);\n                case 224 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type);\n                case 225 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression);\n                case 336 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression);\n            }\n        }\n        /**\n         * Determines whether a node is a parenthesized expression that can be ignored when recreating outer expressions.\n         *\n         * A parenthesized expression can be ignored when all of the following are true:\n         *\n         * - It's `pos` and `end` are not -1\n         * - It does not have a custom source map range\n         * - It does not have a custom comment range\n         * - It does not have synthetic leading or trailing comments\n         *\n         * If an outermost parenthesized expression is ignored, but the containing expression requires a parentheses around\n         * the expression to maintain precedence, a new parenthesized expression should be created automatically when\n         * the containing expression is created/updated.\n         */\n        function isIgnorableParen(node) {\n            return ts.isParenthesizedExpression(node)\n                && ts.nodeIsSynthesized(node)\n                && ts.nodeIsSynthesized(ts.getSourceMapRange(node))\n                && ts.nodeIsSynthesized(ts.getCommentRange(node))\n                && !ts.some(ts.getSyntheticLeadingComments(node))\n                && !ts.some(ts.getSyntheticTrailingComments(node));\n        }\n        function restoreOuterExpressions(outerExpression, innerExpression, kinds) {\n            if (kinds === void 0) { kinds = 15 /* All */; }\n            if (outerExpression && ts.isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) {\n                return updateOuterExpression(outerExpression, restoreOuterExpressions(outerExpression.expression, innerExpression));\n            }\n            return innerExpression;\n        }\n        function restoreEnclosingLabel(node, outermostLabeledStatement, afterRestoreLabelCallback) {\n            if (!outermostLabeledStatement) {\n                return node;\n            }\n            var updated = updateLabeledStatement(outermostLabeledStatement, outermostLabeledStatement.label, ts.isLabeledStatement(outermostLabeledStatement.statement)\n                ? restoreEnclosingLabel(node, outermostLabeledStatement.statement)\n                : node);\n            if (afterRestoreLabelCallback) {\n                afterRestoreLabelCallback(outermostLabeledStatement);\n            }\n            return updated;\n        }\n        function shouldBeCapturedInTempVariable(node, cacheIdentifiers) {\n            var target = ts.skipParentheses(node);\n            switch (target.kind) {\n                case 78 /* Identifier */:\n                    return cacheIdentifiers;\n                case 107 /* ThisKeyword */:\n                case 8 /* NumericLiteral */:\n                case 9 /* BigIntLiteral */:\n                case 10 /* StringLiteral */:\n                    return false;\n                case 199 /* ArrayLiteralExpression */:\n                    var elements = target.elements;\n                    if (elements.length === 0) {\n                        return false;\n                    }\n                    return true;\n                case 200 /* ObjectLiteralExpression */:\n                    return target.properties.length > 0;\n                default:\n                    return true;\n            }\n        }\n        function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) {\n            if (cacheIdentifiers === void 0) { cacheIdentifiers = false; }\n            var callee = ts.skipOuterExpressions(expression, 15 /* All */);\n            var thisArg;\n            var target;\n            if (ts.isSuperProperty(callee)) {\n                thisArg = createThis();\n                target = callee;\n            }\n            else if (ts.isSuperKeyword(callee)) {\n                thisArg = createThis();\n                target = languageVersion !== undefined && languageVersion < 2 /* ES2015 */\n                    ? ts.setTextRange(createIdentifier(\"_super\"), callee)\n                    : callee;\n            }\n            else if (ts.getEmitFlags(callee) & 4096 /* HelperName */) {\n                thisArg = createVoidZero();\n                target = parenthesizerRules().parenthesizeLeftSideOfAccess(callee);\n            }\n            else if (ts.isPropertyAccessExpression(callee)) {\n                if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {\n                    // for `a.b()` target is `(_a = a).b` and thisArg is `_a`\n                    thisArg = createTempVariable(recordTempVariable);\n                    target = createPropertyAccessExpression(ts.setTextRange(factory.createAssignment(thisArg, callee.expression), callee.expression), callee.name);\n                    ts.setTextRange(target, callee);\n                }\n                else {\n                    thisArg = callee.expression;\n                    target = callee;\n                }\n            }\n            else if (ts.isElementAccessExpression(callee)) {\n                if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {\n                    // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a`\n                    thisArg = createTempVariable(recordTempVariable);\n                    target = createElementAccessExpression(ts.setTextRange(factory.createAssignment(thisArg, callee.expression), callee.expression), callee.argumentExpression);\n                    ts.setTextRange(target, callee);\n                }\n                else {\n                    thisArg = callee.expression;\n                    target = callee;\n                }\n            }\n            else {\n                // for `a()` target is `a` and thisArg is `void 0`\n                thisArg = createVoidZero();\n                target = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);\n            }\n            return { target: target, thisArg: thisArg };\n        }\n        function inlineExpressions(expressions) {\n            // Avoid deeply nested comma expressions as traversing them during emit can result in \"Maximum call\n            // stack size exceeded\" errors.\n            return expressions.length > 10\n                ? createCommaListExpression(expressions)\n                : ts.reduceLeft(expressions, factory.createComma);\n        }\n        function getName(node, allowComments, allowSourceMaps, emitFlags) {\n            if (emitFlags === void 0) { emitFlags = 0; }\n            var nodeName = ts.getNameOfDeclaration(node);\n            if (nodeName && ts.isIdentifier(nodeName) && !ts.isGeneratedIdentifier(nodeName)) {\n                // TODO(rbuckton): Does this need to be parented?\n                var name = ts.setParent(ts.setTextRange(cloneNode(nodeName), nodeName), nodeName.parent);\n                emitFlags |= ts.getEmitFlags(nodeName);\n                if (!allowSourceMaps)\n                    emitFlags |= 48 /* NoSourceMap */;\n                if (!allowComments)\n                    emitFlags |= 1536 /* NoComments */;\n                if (emitFlags)\n                    ts.setEmitFlags(name, emitFlags);\n                return name;\n            }\n            return getGeneratedNameForNode(node);\n        }\n        /**\n         * Gets the internal name of a declaration. This is primarily used for declarations that can be\n         * referred to by name in the body of an ES5 class function body. An internal name will *never*\n         * be prefixed with an module or namespace export modifier like \"exports.\" when emitted as an\n         * expression. An internal name will also *never* be renamed due to a collision with a block\n         * scoped variable.\n         *\n         * @param node The declaration.\n         * @param allowComments A value indicating whether comments may be emitted for the name.\n         * @param allowSourceMaps A value indicating whether source maps may be emitted for the name.\n         */\n        function getInternalName(node, allowComments, allowSourceMaps) {\n            return getName(node, allowComments, allowSourceMaps, 16384 /* LocalName */ | 32768 /* InternalName */);\n        }\n        /**\n         * Gets the local name of a declaration. This is primarily used for declarations that can be\n         * referred to by name in the declaration's immediate scope (classes, enums, namespaces). A\n         * local name will *never* be prefixed with an module or namespace export modifier like\n         * \"exports.\" when emitted as an expression.\n         *\n         * @param node The declaration.\n         * @param allowComments A value indicating whether comments may be emitted for the name.\n         * @param allowSourceMaps A value indicating whether source maps may be emitted for the name.\n         */\n        function getLocalName(node, allowComments, allowSourceMaps) {\n            return getName(node, allowComments, allowSourceMaps, 16384 /* LocalName */);\n        }\n        /**\n         * Gets the export name of a declaration. This is primarily used for declarations that can be\n         * referred to by name in the declaration's immediate scope (classes, enums, namespaces). An\n         * export name will *always* be prefixed with an module or namespace export modifier like\n         * `\"exports.\"` when emitted as an expression if the name points to an exported symbol.\n         *\n         * @param node The declaration.\n         * @param allowComments A value indicating whether comments may be emitted for the name.\n         * @param allowSourceMaps A value indicating whether source maps may be emitted for the name.\n         */\n        function getExportName(node, allowComments, allowSourceMaps) {\n            return getName(node, allowComments, allowSourceMaps, 8192 /* ExportName */);\n        }\n        /**\n         * Gets the name of a declaration for use in declarations.\n         *\n         * @param node The declaration.\n         * @param allowComments A value indicating whether comments may be emitted for the name.\n         * @param allowSourceMaps A value indicating whether source maps may be emitted for the name.\n         */\n        function getDeclarationName(node, allowComments, allowSourceMaps) {\n            return getName(node, allowComments, allowSourceMaps);\n        }\n        /**\n         * Gets a namespace-qualified name for use in expressions.\n         *\n         * @param ns The namespace identifier.\n         * @param name The name.\n         * @param allowComments A value indicating whether comments may be emitted for the name.\n         * @param allowSourceMaps A value indicating whether source maps may be emitted for the name.\n         */\n        function getNamespaceMemberName(ns, name, allowComments, allowSourceMaps) {\n            var qualifiedName = createPropertyAccessExpression(ns, ts.nodeIsSynthesized(name) ? name : cloneNode(name));\n            ts.setTextRange(qualifiedName, name);\n            var emitFlags = 0;\n            if (!allowSourceMaps)\n                emitFlags |= 48 /* NoSourceMap */;\n            if (!allowComments)\n                emitFlags |= 1536 /* NoComments */;\n            if (emitFlags)\n                ts.setEmitFlags(qualifiedName, emitFlags);\n            return qualifiedName;\n        }\n        /**\n         * Gets the exported name of a declaration for use in expressions.\n         *\n         * An exported name will *always* be prefixed with an module or namespace export modifier like\n         * \"exports.\" if the name points to an exported symbol.\n         *\n         * @param ns The namespace identifier.\n         * @param node The declaration.\n         * @param allowComments A value indicating whether comments may be emitted for the name.\n         * @param allowSourceMaps A value indicating whether source maps may be emitted for the name.\n         */\n        function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) {\n            if (ns && ts.hasSyntacticModifier(node, 1 /* Export */)) {\n                return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps);\n            }\n            return getExportName(node, allowComments, allowSourceMaps);\n        }\n        /**\n         * Copies any necessary standard and custom prologue-directives into target array.\n         * @param source origin statements array\n         * @param target result statements array\n         * @param ensureUseStrict boolean determining whether the function need to add prologue-directives\n         * @param visitor Optional callback used to visit any custom prologue directives.\n         */\n        function copyPrologue(source, target, ensureUseStrict, visitor) {\n            var offset = copyStandardPrologue(source, target, ensureUseStrict);\n            return copyCustomPrologue(source, target, offset, visitor);\n        }\n        function isUseStrictPrologue(node) {\n            return ts.isStringLiteral(node.expression) && node.expression.text === \"use strict\";\n        }\n        function createUseStrictPrologue() {\n            return ts.startOnNewLine(createExpressionStatement(createStringLiteral(\"use strict\")));\n        }\n        /**\n         * Copies only the standard (string-expression) prologue-directives into the target statement-array.\n         * @param source origin statements array\n         * @param target result statements array\n         * @param ensureUseStrict boolean determining whether the function need to add prologue-directives\n         */\n        function copyStandardPrologue(source, target, ensureUseStrict) {\n            ts.Debug.assert(target.length === 0, \"Prologue directives should be at the first statement in the target statements array\");\n            var foundUseStrict = false;\n            var statementOffset = 0;\n            var numStatements = source.length;\n            while (statementOffset < numStatements) {\n                var statement = source[statementOffset];\n                if (ts.isPrologueDirective(statement)) {\n                    if (isUseStrictPrologue(statement)) {\n                        foundUseStrict = true;\n                    }\n                    target.push(statement);\n                }\n                else {\n                    break;\n                }\n                statementOffset++;\n            }\n            if (ensureUseStrict && !foundUseStrict) {\n                target.push(createUseStrictPrologue());\n            }\n            return statementOffset;\n        }\n        function copyCustomPrologue(source, target, statementOffset, visitor, filter) {\n            if (filter === void 0) { filter = ts.returnTrue; }\n            var numStatements = source.length;\n            while (statementOffset !== undefined && statementOffset < numStatements) {\n                var statement = source[statementOffset];\n                if (ts.getEmitFlags(statement) & 1048576 /* CustomPrologue */ && filter(statement)) {\n                    ts.append(target, visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement);\n                }\n                else {\n                    break;\n                }\n                statementOffset++;\n            }\n            return statementOffset;\n        }\n        /**\n         * Ensures \"use strict\" directive is added\n         *\n         * @param statements An array of statements\n         */\n        function ensureUseStrict(statements) {\n            var foundUseStrict = ts.findUseStrictPrologue(statements);\n            if (!foundUseStrict) {\n                return ts.setTextRange(createNodeArray(__spreadArray([createUseStrictPrologue()], statements)), statements);\n            }\n            return statements;\n        }\n        /**\n         * Lifts a NodeArray containing only Statement nodes to a block.\n         *\n         * @param nodes The NodeArray.\n         */\n        function liftToBlock(nodes) {\n            ts.Debug.assert(ts.every(nodes, ts.isStatementOrBlock), \"Cannot lift nodes to a Block.\");\n            return ts.singleOrUndefined(nodes) || createBlock(nodes);\n        }\n        function findSpanEnd(array, test, start) {\n            var i = start;\n            while (i < array.length && test(array[i])) {\n                i++;\n            }\n            return i;\n        }\n        function mergeLexicalEnvironment(statements, declarations) {\n            if (!ts.some(declarations)) {\n                return statements;\n            }\n            // When we merge new lexical statements into an existing statement list, we merge them in the following manner:\n            //\n            // Given:\n            //\n            // | Left                               | Right                               |\n            // |------------------------------------|-------------------------------------|\n            // | [standard prologues (left)]        | [standard prologues (right)]        |\n            // | [hoisted functions (left)]         | [hoisted functions (right)]         |\n            // | [hoisted variables (left)]         | [hoisted variables (right)]         |\n            // | [lexical init statements (left)]   | [lexical init statements (right)]   |\n            // | [other statements (left)]          |                                     |\n            //\n            // The resulting statement list will be:\n            //\n            // | Result                              |\n            // |-------------------------------------|\n            // | [standard prologues (right)]        |\n            // | [standard prologues (left)]         |\n            // | [hoisted functions (right)]         |\n            // | [hoisted functions (left)]          |\n            // | [hoisted variables (right)]         |\n            // | [hoisted variables (left)]          |\n            // | [lexical init statements (right)]   |\n            // | [lexical init statements (left)]    |\n            // | [other statements (left)]           |\n            //\n            // NOTE: It is expected that new lexical init statements must be evaluated before existing lexical init statements,\n            // as the prior transformation may depend on the evaluation of the lexical init statements to be in the correct state.\n            // find standard prologues on left in the following order: standard directives, hoisted functions, hoisted variables, other custom\n            var leftStandardPrologueEnd = findSpanEnd(statements, ts.isPrologueDirective, 0);\n            var leftHoistedFunctionsEnd = findSpanEnd(statements, ts.isHoistedFunction, leftStandardPrologueEnd);\n            var leftHoistedVariablesEnd = findSpanEnd(statements, ts.isHoistedVariableStatement, leftHoistedFunctionsEnd);\n            // find standard prologues on right in the following order: standard directives, hoisted functions, hoisted variables, other custom\n            var rightStandardPrologueEnd = findSpanEnd(declarations, ts.isPrologueDirective, 0);\n            var rightHoistedFunctionsEnd = findSpanEnd(declarations, ts.isHoistedFunction, rightStandardPrologueEnd);\n            var rightHoistedVariablesEnd = findSpanEnd(declarations, ts.isHoistedVariableStatement, rightHoistedFunctionsEnd);\n            var rightCustomPrologueEnd = findSpanEnd(declarations, ts.isCustomPrologue, rightHoistedVariablesEnd);\n            ts.Debug.assert(rightCustomPrologueEnd === declarations.length, \"Expected declarations to be valid standard or custom prologues\");\n            // splice prologues from the right into the left. We do this in reverse order\n            // so that we don't need to recompute the index on the left when we insert items.\n            var left = ts.isNodeArray(statements) ? statements.slice() : statements;\n            // splice other custom prologues from right into left\n            if (rightCustomPrologueEnd > rightHoistedVariablesEnd) {\n                left.splice.apply(left, __spreadArray([leftHoistedVariablesEnd, 0], declarations.slice(rightHoistedVariablesEnd, rightCustomPrologueEnd)));\n            }\n            // splice hoisted variables from right into left\n            if (rightHoistedVariablesEnd > rightHoistedFunctionsEnd) {\n                left.splice.apply(left, __spreadArray([leftHoistedFunctionsEnd, 0], declarations.slice(rightHoistedFunctionsEnd, rightHoistedVariablesEnd)));\n            }\n            // splice hoisted functions from right into left\n            if (rightHoistedFunctionsEnd > rightStandardPrologueEnd) {\n                left.splice.apply(left, __spreadArray([leftStandardPrologueEnd, 0], declarations.slice(rightStandardPrologueEnd, rightHoistedFunctionsEnd)));\n            }\n            // splice standard prologues from right into left (that are not already in left)\n            if (rightStandardPrologueEnd > 0) {\n                if (leftStandardPrologueEnd === 0) {\n                    left.splice.apply(left, __spreadArray([0, 0], declarations.slice(0, rightStandardPrologueEnd)));\n                }\n                else {\n                    var leftPrologues = new ts.Map();\n                    for (var i = 0; i < leftStandardPrologueEnd; i++) {\n                        var leftPrologue = statements[i];\n                        leftPrologues.set(leftPrologue.expression.text, true);\n                    }\n                    for (var i = rightStandardPrologueEnd - 1; i >= 0; i--) {\n                        var rightPrologue = declarations[i];\n                        if (!leftPrologues.has(rightPrologue.expression.text)) {\n                            left.unshift(rightPrologue);\n                        }\n                    }\n                }\n            }\n            if (ts.isNodeArray(statements)) {\n                return ts.setTextRange(createNodeArray(left, statements.hasTrailingComma), statements);\n            }\n            return statements;\n        }\n        function updateModifiers(node, modifiers) {\n            var _a;\n            if (typeof modifiers === \"number\") {\n                modifiers = createModifiersFromModifierFlags(modifiers);\n            }\n            return ts.isParameter(node) ? updateParameterDeclaration(node, node.decorators, modifiers, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) :\n                ts.isPropertySignature(node) ? updatePropertySignature(node, modifiers, node.name, node.questionToken, node.type) :\n                    ts.isPropertyDeclaration(node) ? updatePropertyDeclaration(node, node.decorators, modifiers, node.name, (_a = node.questionToken) !== null && _a !== void 0 ? _a : node.exclamationToken, node.type, node.initializer) :\n                        ts.isMethodSignature(node) ? updateMethodSignature(node, modifiers, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) :\n                            ts.isMethodDeclaration(node) ? updateMethodDeclaration(node, node.decorators, modifiers, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) :\n                                ts.isConstructorDeclaration(node) ? updateConstructorDeclaration(node, node.decorators, modifiers, node.parameters, node.body) :\n                                    ts.isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, node.decorators, modifiers, node.name, node.parameters, node.type, node.body) :\n                                        ts.isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, node.decorators, modifiers, node.name, node.parameters, node.body) :\n                                            ts.isIndexSignatureDeclaration(node) ? updateIndexSignature(node, node.decorators, modifiers, node.parameters, node.type) :\n                                                ts.isFunctionExpression(node) ? updateFunctionExpression(node, modifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :\n                                                    ts.isArrowFunction(node) ? updateArrowFunction(node, modifiers, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) :\n                                                        ts.isClassExpression(node) ? updateClassExpression(node, node.decorators, modifiers, node.name, node.typeParameters, node.heritageClauses, node.members) :\n                                                            ts.isVariableStatement(node) ? updateVariableStatement(node, modifiers, node.declarationList) :\n                                                                ts.isFunctionDeclaration(node) ? updateFunctionDeclaration(node, node.decorators, modifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :\n                                                                    ts.isClassDeclaration(node) ? updateClassDeclaration(node, node.decorators, modifiers, node.name, node.typeParameters, node.heritageClauses, node.members) :\n                                                                        ts.isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, node.decorators, modifiers, node.name, node.typeParameters, node.heritageClauses, node.members) :\n                                                                            ts.isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, node.decorators, modifiers, node.name, node.typeParameters, node.type) :\n                                                                                ts.isEnumDeclaration(node) ? updateEnumDeclaration(node, node.decorators, modifiers, node.name, node.members) :\n                                                                                    ts.isModuleDeclaration(node) ? updateModuleDeclaration(node, node.decorators, modifiers, node.name, node.body) :\n                                                                                        ts.isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, node.decorators, modifiers, node.isTypeOnly, node.name, node.moduleReference) :\n                                                                                            ts.isImportDeclaration(node) ? updateImportDeclaration(node, node.decorators, modifiers, node.importClause, node.moduleSpecifier) :\n                                                                                                ts.isExportAssignment(node) ? updateExportAssignment(node, node.decorators, modifiers, node.expression) :\n                                                                                                    ts.isExportDeclaration(node) ? updateExportDeclaration(node, node.decorators, modifiers, node.isTypeOnly, node.exportClause, node.moduleSpecifier) :\n                                                                                                        ts.Debug.assertNever(node);\n        }\n        function asNodeArray(array) {\n            return array ? createNodeArray(array) : undefined;\n        }\n        function asName(name) {\n            return typeof name === \"string\" ? createIdentifier(name) :\n                name;\n        }\n        function asExpression(value) {\n            return typeof value === \"string\" ? createStringLiteral(value) :\n                typeof value === \"number\" ? createNumericLiteral(value) :\n                    typeof value === \"boolean\" ? value ? createTrue() : createFalse() :\n                        value;\n        }\n        function asToken(value) {\n            return typeof value === \"number\" ? createToken(value) : value;\n        }\n        function asEmbeddedStatement(statement) {\n            return statement && ts.isNotEmittedStatement(statement) ? ts.setTextRange(setOriginalNode(createEmptyStatement(), statement), statement) : statement;\n        }\n    }\n    ts.createNodeFactory = createNodeFactory;\n    function updateWithoutOriginal(updated, original) {\n        if (updated !== original) {\n            ts.setTextRange(updated, original);\n        }\n        return updated;\n    }\n    function updateWithOriginal(updated, original) {\n        if (updated !== original) {\n            setOriginalNode(updated, original);\n            ts.setTextRange(updated, original);\n        }\n        return updated;\n    }\n    function getDefaultTagNameForKind(kind) {\n        switch (kind) {\n            case 329 /* JSDocTypeTag */: return \"type\";\n            case 327 /* JSDocReturnTag */: return \"returns\";\n            case 328 /* JSDocThisTag */: return \"this\";\n            case 325 /* JSDocEnumTag */: return \"enum\";\n            case 317 /* JSDocAuthorTag */: return \"author\";\n            case 319 /* JSDocClassTag */: return \"class\";\n            case 320 /* JSDocPublicTag */: return \"public\";\n            case 321 /* JSDocPrivateTag */: return \"private\";\n            case 322 /* JSDocProtectedTag */: return \"protected\";\n            case 323 /* JSDocReadonlyTag */: return \"readonly\";\n            case 330 /* JSDocTemplateTag */: return \"template\";\n            case 331 /* JSDocTypedefTag */: return \"typedef\";\n            case 326 /* JSDocParameterTag */: return \"param\";\n            case 333 /* JSDocPropertyTag */: return \"prop\";\n            case 324 /* JSDocCallbackTag */: return \"callback\";\n            case 315 /* JSDocAugmentsTag */: return \"augments\";\n            case 316 /* JSDocImplementsTag */: return \"implements\";\n            default:\n                return ts.Debug.fail(\"Unsupported kind: \" + ts.Debug.formatSyntaxKind(kind));\n        }\n    }\n    var rawTextScanner;\n    var invalidValueSentinel = {};\n    function getCookedText(kind, rawText) {\n        if (!rawTextScanner) {\n            rawTextScanner = ts.createScanner(99 /* Latest */, /*skipTrivia*/ false, 0 /* Standard */);\n        }\n        switch (kind) {\n            case 14 /* NoSubstitutionTemplateLiteral */:\n                rawTextScanner.setText(\"`\" + rawText + \"`\");\n                break;\n            case 15 /* TemplateHead */:\n                // tslint:disable-next-line no-invalid-template-strings\n                rawTextScanner.setText(\"`\" + rawText + \"${\");\n                break;\n            case 16 /* TemplateMiddle */:\n                // tslint:disable-next-line no-invalid-template-strings\n                rawTextScanner.setText(\"}\" + rawText + \"${\");\n                break;\n            case 17 /* TemplateTail */:\n                rawTextScanner.setText(\"}\" + rawText + \"`\");\n                break;\n        }\n        var token = rawTextScanner.scan();\n        if (token === 23 /* CloseBracketToken */) {\n            token = rawTextScanner.reScanTemplateToken(/*isTaggedTemplate*/ false);\n        }\n        if (rawTextScanner.isUnterminated()) {\n            rawTextScanner.setText(undefined);\n            return invalidValueSentinel;\n        }\n        var tokenValue;\n        switch (token) {\n            case 14 /* NoSubstitutionTemplateLiteral */:\n            case 15 /* TemplateHead */:\n            case 16 /* TemplateMiddle */:\n            case 17 /* TemplateTail */:\n                tokenValue = rawTextScanner.getTokenValue();\n                break;\n        }\n        if (tokenValue === undefined || rawTextScanner.scan() !== 1 /* EndOfFileToken */) {\n            rawTextScanner.setText(undefined);\n            return invalidValueSentinel;\n        }\n        rawTextScanner.setText(undefined);\n        return tokenValue;\n    }\n    function propagateIdentifierNameFlags(node) {\n        // An IdentifierName is allowed to be `await`\n        return propagateChildFlags(node) & ~8388608 /* ContainsPossibleTopLevelAwait */;\n    }\n    function propagatePropertyNameFlagsOfChild(node, transformFlags) {\n        return transformFlags | (node.transformFlags & 4096 /* PropertyNamePropagatingFlags */);\n    }\n    function propagateChildFlags(child) {\n        if (!child)\n            return 0 /* None */;\n        var childFlags = child.transformFlags & ~getTransformFlagsSubtreeExclusions(child.kind);\n        return ts.isNamedDeclaration(child) && ts.isPropertyName(child.name) ? propagatePropertyNameFlagsOfChild(child.name, childFlags) : childFlags;\n    }\n    function propagateChildrenFlags(children) {\n        return children ? children.transformFlags : 0 /* None */;\n    }\n    function aggregateChildrenFlags(children) {\n        var subtreeFlags = 0 /* None */;\n        for (var _i = 0, children_2 = children; _i < children_2.length; _i++) {\n            var child = children_2[_i];\n            subtreeFlags |= propagateChildFlags(child);\n        }\n        children.transformFlags = subtreeFlags;\n    }\n    /**\n     * Gets the transform flags to exclude when unioning the transform flags of a subtree.\n     */\n    /* @internal */\n    function getTransformFlagsSubtreeExclusions(kind) {\n        if (kind >= 172 /* FirstTypeNode */ && kind <= 195 /* LastTypeNode */) {\n            return -2 /* TypeExcludes */;\n        }\n        switch (kind) {\n            case 203 /* CallExpression */:\n            case 204 /* NewExpression */:\n            case 199 /* ArrayLiteralExpression */:\n                return 536879104 /* ArrayLiteralOrCallOrNewExcludes */;\n            case 256 /* ModuleDeclaration */:\n                return 546379776 /* ModuleExcludes */;\n            case 160 /* Parameter */:\n                return 536870912 /* ParameterExcludes */;\n            case 209 /* ArrowFunction */:\n                return 547309568 /* ArrowFunctionExcludes */;\n            case 208 /* FunctionExpression */:\n            case 251 /* FunctionDeclaration */:\n                return 547313664 /* FunctionExcludes */;\n            case 250 /* VariableDeclarationList */:\n                return 537018368 /* VariableDeclarationListExcludes */;\n            case 252 /* ClassDeclaration */:\n            case 221 /* ClassExpression */:\n                return 536905728 /* ClassExcludes */;\n            case 166 /* Constructor */:\n                return 547311616 /* ConstructorExcludes */;\n            case 163 /* PropertyDeclaration */:\n                return 536875008 /* PropertyExcludes */;\n            case 165 /* MethodDeclaration */:\n            case 167 /* GetAccessor */:\n            case 168 /* SetAccessor */:\n                return 538923008 /* MethodOrAccessorExcludes */;\n            case 128 /* AnyKeyword */:\n            case 144 /* NumberKeyword */:\n            case 155 /* BigIntKeyword */:\n            case 141 /* NeverKeyword */:\n            case 147 /* StringKeyword */:\n            case 145 /* ObjectKeyword */:\n            case 131 /* BooleanKeyword */:\n            case 148 /* SymbolKeyword */:\n            case 113 /* VoidKeyword */:\n            case 159 /* TypeParameter */:\n            case 162 /* PropertySignature */:\n            case 164 /* MethodSignature */:\n            case 169 /* CallSignature */:\n            case 170 /* ConstructSignature */:\n            case 171 /* IndexSignature */:\n            case 253 /* InterfaceDeclaration */:\n            case 254 /* TypeAliasDeclaration */:\n                return -2 /* TypeExcludes */;\n            case 200 /* ObjectLiteralExpression */:\n                return 536922112 /* ObjectLiteralExcludes */;\n            case 287 /* CatchClause */:\n                return 536887296 /* CatchClauseExcludes */;\n            case 196 /* ObjectBindingPattern */:\n            case 197 /* ArrayBindingPattern */:\n                return 536879104 /* BindingPatternExcludes */;\n            case 206 /* TypeAssertionExpression */:\n            case 224 /* AsExpression */:\n            case 336 /* PartiallyEmittedExpression */:\n            case 207 /* ParenthesizedExpression */:\n            case 105 /* SuperKeyword */:\n                return 536870912 /* OuterExpressionExcludes */;\n            case 201 /* PropertyAccessExpression */:\n            case 202 /* ElementAccessExpression */:\n                return 536870912 /* PropertyAccessExcludes */;\n            default:\n                return 536870912 /* NodeExcludes */;\n        }\n    }\n    ts.getTransformFlagsSubtreeExclusions = getTransformFlagsSubtreeExclusions;\n    var baseFactory = ts.createBaseNodeFactory();\n    function makeSynthetic(node) {\n        node.flags |= 8 /* Synthesized */;\n        return node;\n    }\n    var syntheticFactory = {\n        createBaseSourceFileNode: function (kind) { return makeSynthetic(baseFactory.createBaseSourceFileNode(kind)); },\n        createBaseIdentifierNode: function (kind) { return makeSynthetic(baseFactory.createBaseIdentifierNode(kind)); },\n        createBasePrivateIdentifierNode: function (kind) { return makeSynthetic(baseFactory.createBasePrivateIdentifierNode(kind)); },\n        createBaseTokenNode: function (kind) { return makeSynthetic(baseFactory.createBaseTokenNode(kind)); },\n        createBaseNode: function (kind) { return makeSynthetic(baseFactory.createBaseNode(kind)); },\n    };\n    ts.factory = createNodeFactory(4 /* NoIndentationOnFreshPropertyAccess */, syntheticFactory);\n    function createUnparsedSourceFile(textOrInputFiles, mapPathOrType, mapTextOrStripInternal) {\n        var stripInternal;\n        var bundleFileInfo;\n        var fileName;\n        var text;\n        var length;\n        var sourceMapPath;\n        var sourceMapText;\n        var getText;\n        var getSourceMapText;\n        var oldFileOfCurrentEmit;\n        if (!ts.isString(textOrInputFiles)) {\n            ts.Debug.assert(mapPathOrType === \"js\" || mapPathOrType === \"dts\");\n            fileName = (mapPathOrType === \"js\" ? textOrInputFiles.javascriptPath : textOrInputFiles.declarationPath) || \"\";\n            sourceMapPath = mapPathOrType === \"js\" ? textOrInputFiles.javascriptMapPath : textOrInputFiles.declarationMapPath;\n            getText = function () { return mapPathOrType === \"js\" ? textOrInputFiles.javascriptText : textOrInputFiles.declarationText; };\n            getSourceMapText = function () { return mapPathOrType === \"js\" ? textOrInputFiles.javascriptMapText : textOrInputFiles.declarationMapText; };\n            length = function () { return getText().length; };\n            if (textOrInputFiles.buildInfo && textOrInputFiles.buildInfo.bundle) {\n                ts.Debug.assert(mapTextOrStripInternal === undefined || typeof mapTextOrStripInternal === \"boolean\");\n                stripInternal = mapTextOrStripInternal;\n                bundleFileInfo = mapPathOrType === \"js\" ? textOrInputFiles.buildInfo.bundle.js : textOrInputFiles.buildInfo.bundle.dts;\n                oldFileOfCurrentEmit = textOrInputFiles.oldFileOfCurrentEmit;\n            }\n        }\n        else {\n            fileName = \"\";\n            text = textOrInputFiles;\n            length = textOrInputFiles.length;\n            sourceMapPath = mapPathOrType;\n            sourceMapText = mapTextOrStripInternal;\n        }\n        var node = oldFileOfCurrentEmit ?\n            parseOldFileOfCurrentEmit(ts.Debug.assertDefined(bundleFileInfo)) :\n            parseUnparsedSourceFile(bundleFileInfo, stripInternal, length);\n        node.fileName = fileName;\n        node.sourceMapPath = sourceMapPath;\n        node.oldFileOfCurrentEmit = oldFileOfCurrentEmit;\n        if (getText && getSourceMapText) {\n            Object.defineProperty(node, \"text\", { get: getText });\n            Object.defineProperty(node, \"sourceMapText\", { get: getSourceMapText });\n        }\n        else {\n            ts.Debug.assert(!oldFileOfCurrentEmit);\n            node.text = text !== null && text !== void 0 ? text : \"\";\n            node.sourceMapText = sourceMapText;\n        }\n        return node;\n    }\n    ts.createUnparsedSourceFile = createUnparsedSourceFile;\n    function parseUnparsedSourceFile(bundleFileInfo, stripInternal, length) {\n        var prologues;\n        var helpers;\n        var referencedFiles;\n        var typeReferenceDirectives;\n        var libReferenceDirectives;\n        var prependChildren;\n        var texts;\n        var hasNoDefaultLib;\n        for (var _i = 0, _a = bundleFileInfo ? bundleFileInfo.sections : ts.emptyArray; _i < _a.length; _i++) {\n            var section = _a[_i];\n            switch (section.kind) {\n                case \"prologue\" /* Prologue */:\n                    prologues = ts.append(prologues, ts.setTextRange(ts.factory.createUnparsedPrologue(section.data), section));\n                    break;\n                case \"emitHelpers\" /* EmitHelpers */:\n                    helpers = ts.append(helpers, ts.getAllUnscopedEmitHelpers().get(section.data));\n                    break;\n                case \"no-default-lib\" /* NoDefaultLib */:\n                    hasNoDefaultLib = true;\n                    break;\n                case \"reference\" /* Reference */:\n                    referencedFiles = ts.append(referencedFiles, { pos: -1, end: -1, fileName: section.data });\n                    break;\n                case \"type\" /* Type */:\n                    typeReferenceDirectives = ts.append(typeReferenceDirectives, section.data);\n                    break;\n                case \"lib\" /* Lib */:\n                    libReferenceDirectives = ts.append(libReferenceDirectives, { pos: -1, end: -1, fileName: section.data });\n                    break;\n                case \"prepend\" /* Prepend */:\n                    var prependTexts = void 0;\n                    for (var _b = 0, _c = section.texts; _b < _c.length; _b++) {\n                        var text = _c[_b];\n                        if (!stripInternal || text.kind !== \"internal\" /* Internal */) {\n                            prependTexts = ts.append(prependTexts, ts.setTextRange(ts.factory.createUnparsedTextLike(text.data, text.kind === \"internal\" /* Internal */), text));\n                        }\n                    }\n                    prependChildren = ts.addRange(prependChildren, prependTexts);\n                    texts = ts.append(texts, ts.factory.createUnparsedPrepend(section.data, prependTexts !== null && prependTexts !== void 0 ? prependTexts : ts.emptyArray));\n                    break;\n                case \"internal\" /* Internal */:\n                    if (stripInternal) {\n                        if (!texts)\n                            texts = [];\n                        break;\n                    }\n                // falls through\n                case \"text\" /* Text */:\n                    texts = ts.append(texts, ts.setTextRange(ts.factory.createUnparsedTextLike(section.data, section.kind === \"internal\" /* Internal */), section));\n                    break;\n                default:\n                    ts.Debug.assertNever(section);\n            }\n        }\n        if (!texts) {\n            var textNode = ts.factory.createUnparsedTextLike(/*data*/ undefined, /*internal*/ false);\n            ts.setTextRangePosWidth(textNode, 0, typeof length === \"function\" ? length() : length);\n            texts = [textNode];\n        }\n        var node = ts.parseNodeFactory.createUnparsedSource(prologues !== null && prologues !== void 0 ? prologues : ts.emptyArray, /*syntheticReferences*/ undefined, texts);\n        ts.setEachParent(prologues, node);\n        ts.setEachParent(texts, node);\n        ts.setEachParent(prependChildren, node);\n        node.hasNoDefaultLib = hasNoDefaultLib;\n        node.helpers = helpers;\n        node.referencedFiles = referencedFiles || ts.emptyArray;\n        node.typeReferenceDirectives = typeReferenceDirectives;\n        node.libReferenceDirectives = libReferenceDirectives || ts.emptyArray;\n        return node;\n    }\n    function parseOldFileOfCurrentEmit(bundleFileInfo) {\n        var texts;\n        var syntheticReferences;\n        for (var _i = 0, _a = bundleFileInfo.sections; _i < _a.length; _i++) {\n            var section = _a[_i];\n            switch (section.kind) {\n                case \"internal\" /* Internal */:\n                case \"text\" /* Text */:\n                    texts = ts.append(texts, ts.setTextRange(ts.factory.createUnparsedTextLike(section.data, section.kind === \"internal\" /* Internal */), section));\n                    break;\n                case \"no-default-lib\" /* NoDefaultLib */:\n                case \"reference\" /* Reference */:\n                case \"type\" /* Type */:\n                case \"lib\" /* Lib */:\n                    syntheticReferences = ts.append(syntheticReferences, ts.setTextRange(ts.factory.createUnparsedSyntheticReference(section), section));\n                    break;\n                // Ignore\n                case \"prologue\" /* Prologue */:\n                case \"emitHelpers\" /* EmitHelpers */:\n                case \"prepend\" /* Prepend */:\n                    break;\n                default:\n                    ts.Debug.assertNever(section);\n            }\n        }\n        var node = ts.factory.createUnparsedSource(ts.emptyArray, syntheticReferences, texts !== null && texts !== void 0 ? texts : ts.emptyArray);\n        ts.setEachParent(syntheticReferences, node);\n        ts.setEachParent(texts, node);\n        node.helpers = ts.map(bundleFileInfo.sources && bundleFileInfo.sources.helpers, function (name) { return ts.getAllUnscopedEmitHelpers().get(name); });\n        return node;\n    }\n    function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) {\n        var node = ts.parseNodeFactory.createInputFiles();\n        if (!ts.isString(javascriptTextOrReadFileText)) {\n            var cache_1 = new ts.Map();\n            var textGetter_1 = function (path) {\n                if (path === undefined)\n                    return undefined;\n                var value = cache_1.get(path);\n                if (value === undefined) {\n                    value = javascriptTextOrReadFileText(path);\n                    cache_1.set(path, value !== undefined ? value : false);\n                }\n                return value !== false ? value : undefined;\n            };\n            var definedTextGetter_1 = function (path) {\n                var result = textGetter_1(path);\n                return result !== undefined ? result : \"/* Input file \" + path + \" was missing */\\r\\n\";\n            };\n            var buildInfo_1;\n            var getAndCacheBuildInfo_1 = function (getText) {\n                if (buildInfo_1 === undefined) {\n                    var result = getText();\n                    buildInfo_1 = result !== undefined ? ts.getBuildInfo(result) : false;\n                }\n                return buildInfo_1 || undefined;\n            };\n            node.javascriptPath = declarationTextOrJavascriptPath;\n            node.javascriptMapPath = javascriptMapPath;\n            node.declarationPath = ts.Debug.assertDefined(javascriptMapTextOrDeclarationPath);\n            node.declarationMapPath = declarationMapPath;\n            node.buildInfoPath = declarationMapTextOrBuildInfoPath;\n            Object.defineProperties(node, {\n                javascriptText: { get: function () { return definedTextGetter_1(declarationTextOrJavascriptPath); } },\n                javascriptMapText: { get: function () { return textGetter_1(javascriptMapPath); } },\n                declarationText: { get: function () { return definedTextGetter_1(ts.Debug.assertDefined(javascriptMapTextOrDeclarationPath)); } },\n                declarationMapText: { get: function () { return textGetter_1(declarationMapPath); } },\n                buildInfo: { get: function () { return getAndCacheBuildInfo_1(function () { return textGetter_1(declarationMapTextOrBuildInfoPath); }); } }\n            });\n        }\n        else {\n            node.javascriptText = javascriptTextOrReadFileText;\n            node.javascriptMapPath = javascriptMapPath;\n            node.javascriptMapText = javascriptMapTextOrDeclarationPath;\n            node.declarationText = declarationTextOrJavascriptPath;\n            node.declarationMapPath = declarationMapPath;\n            node.declarationMapText = declarationMapTextOrBuildInfoPath;\n            node.javascriptPath = javascriptPath;\n            node.declarationPath = declarationPath;\n            node.buildInfoPath = buildInfoPath;\n            node.buildInfo = buildInfo;\n            node.oldFileOfCurrentEmit = oldFileOfCurrentEmit;\n        }\n        return node;\n    }\n    ts.createInputFiles = createInputFiles;\n    // tslint:disable-next-line variable-name\n    var SourceMapSource;\n    /**\n     * Create an external source map source file reference\n     */\n    function createSourceMapSource(fileName, text, skipTrivia) {\n        return new (SourceMapSource || (SourceMapSource = ts.objectAllocator.getSourceMapSourceConstructor()))(fileName, text, skipTrivia);\n    }\n    ts.createSourceMapSource = createSourceMapSource;\n    // Utilities\n    function setOriginalNode(node, original) {\n        node.original = original;\n        if (original) {\n            var emitNode = original.emitNode;\n            if (emitNode)\n                node.emitNode = mergeEmitNode(emitNode, node.emitNode);\n        }\n        return node;\n    }\n    ts.setOriginalNode = setOriginalNode;\n    function mergeEmitNode(sourceEmitNode, destEmitNode) {\n        var flags = sourceEmitNode.flags, leadingComments = sourceEmitNode.leadingComments, trailingComments = sourceEmitNode.trailingComments, commentRange = sourceEmitNode.commentRange, sourceMapRange = sourceEmitNode.sourceMapRange, tokenSourceMapRanges = sourceEmitNode.tokenSourceMapRanges, constantValue = sourceEmitNode.constantValue, helpers = sourceEmitNode.helpers, startsOnNewLine = sourceEmitNode.startsOnNewLine;\n        if (!destEmitNode)\n            destEmitNode = {};\n        // We are using `.slice()` here in case `destEmitNode.leadingComments` is pushed to later.\n        if (leadingComments)\n            destEmitNode.leadingComments = ts.addRange(leadingComments.slice(), destEmitNode.leadingComments);\n        if (trailingComments)\n            destEmitNode.trailingComments = ts.addRange(trailingComments.slice(), destEmitNode.trailingComments);\n        if (flags)\n            destEmitNode.flags = flags;\n        if (commentRange)\n            destEmitNode.commentRange = commentRange;\n        if (sourceMapRange)\n            destEmitNode.sourceMapRange = sourceMapRange;\n        if (tokenSourceMapRanges)\n            destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges);\n        if (constantValue !== undefined)\n            destEmitNode.constantValue = constantValue;\n        if (helpers) {\n            for (var _i = 0, helpers_1 = helpers; _i < helpers_1.length; _i++) {\n                var helper = helpers_1[_i];\n                destEmitNode.helpers = ts.appendIfUnique(destEmitNode.helpers, helper);\n            }\n        }\n        if (startsOnNewLine !== undefined)\n            destEmitNode.startsOnNewLine = startsOnNewLine;\n        return destEmitNode;\n    }\n    function mergeTokenSourceMapRanges(sourceRanges, destRanges) {\n        if (!destRanges)\n            destRanges = [];\n        for (var key in sourceRanges) {\n            destRanges[key] = sourceRanges[key];\n        }\n        return destRanges;\n    }\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    /**\n     * Associates a node with the current transformation, initializing\n     * various transient transformation properties.\n     * @internal\n     */\n    function getOrCreateEmitNode(node) {\n        var _a;\n        if (!node.emitNode) {\n            if (ts.isParseTreeNode(node)) {\n                // To avoid holding onto transformation artifacts, we keep track of any\n                // parse tree node we are annotating. This allows us to clean them up after\n                // all transformations have completed.\n                if (node.kind === 297 /* SourceFile */) {\n                    return node.emitNode = { annotatedNodes: [node] };\n                }\n                var sourceFile = (_a = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node)))) !== null && _a !== void 0 ? _a : ts.Debug.fail(\"Could not determine parsed source file.\");\n                getOrCreateEmitNode(sourceFile).annotatedNodes.push(node);\n            }\n            node.emitNode = {};\n        }\n        return node.emitNode;\n    }\n    ts.getOrCreateEmitNode = getOrCreateEmitNode;\n    /**\n     * Clears any `EmitNode` entries from parse-tree nodes.\n     * @param sourceFile A source file.\n     */\n    function disposeEmitNodes(sourceFile) {\n        var _a, _b;\n        // During transformation we may need to annotate a parse tree node with transient\n        // transformation properties. As parse tree nodes live longer than transformation\n        // nodes, we need to make sure we reclaim any memory allocated for custom ranges\n        // from these nodes to ensure we do not hold onto entire subtrees just for position\n        // information. We also need to reset these nodes to a pre-transformation state\n        // for incremental parsing scenarios so that we do not impact later emit.\n        var annotatedNodes = (_b = (_a = ts.getSourceFileOfNode(ts.getParseTreeNode(sourceFile))) === null || _a === void 0 ? void 0 : _a.emitNode) === null || _b === void 0 ? void 0 : _b.annotatedNodes;\n        if (annotatedNodes) {\n            for (var _i = 0, annotatedNodes_1 = annotatedNodes; _i < annotatedNodes_1.length; _i++) {\n                var node = annotatedNodes_1[_i];\n                node.emitNode = undefined;\n            }\n        }\n    }\n    ts.disposeEmitNodes = disposeEmitNodes;\n    /**\n     * Sets `EmitFlags.NoComments` on a node and removes any leading and trailing synthetic comments.\n     * @internal\n     */\n    function removeAllComments(node) {\n        var emitNode = getOrCreateEmitNode(node);\n        emitNode.flags |= 1536 /* NoComments */;\n        emitNode.leadingComments = undefined;\n        emitNode.trailingComments = undefined;\n        return node;\n    }\n    ts.removeAllComments = removeAllComments;\n    /**\n     * Sets flags that control emit behavior of a node.\n     */\n    function setEmitFlags(node, emitFlags) {\n        getOrCreateEmitNode(node).flags = emitFlags;\n        return node;\n    }\n    ts.setEmitFlags = setEmitFlags;\n    /**\n     * Sets flags that control emit behavior of a node.\n     */\n    /* @internal */\n    function addEmitFlags(node, emitFlags) {\n        var emitNode = getOrCreateEmitNode(node);\n        emitNode.flags = emitNode.flags | emitFlags;\n        return node;\n    }\n    ts.addEmitFlags = addEmitFlags;\n    /**\n     * Gets a custom text range to use when emitting source maps.\n     */\n    function getSourceMapRange(node) {\n        var _a, _b;\n        return (_b = (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.sourceMapRange) !== null && _b !== void 0 ? _b : node;\n    }\n    ts.getSourceMapRange = getSourceMapRange;\n    /**\n     * Sets a custom text range to use when emitting source maps.\n     */\n    function setSourceMapRange(node, range) {\n        getOrCreateEmitNode(node).sourceMapRange = range;\n        return node;\n    }\n    ts.setSourceMapRange = setSourceMapRange;\n    /**\n     * Gets the TextRange to use for source maps for a token of a node.\n     */\n    function getTokenSourceMapRange(node, token) {\n        var _a, _b;\n        return (_b = (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.tokenSourceMapRanges) === null || _b === void 0 ? void 0 : _b[token];\n    }\n    ts.getTokenSourceMapRange = getTokenSourceMapRange;\n    /**\n     * Sets the TextRange to use for source maps for a token of a node.\n     */\n    function setTokenSourceMapRange(node, token, range) {\n        var _a;\n        var emitNode = getOrCreateEmitNode(node);\n        var tokenSourceMapRanges = (_a = emitNode.tokenSourceMapRanges) !== null && _a !== void 0 ? _a : (emitNode.tokenSourceMapRanges = []);\n        tokenSourceMapRanges[token] = range;\n        return node;\n    }\n    ts.setTokenSourceMapRange = setTokenSourceMapRange;\n    /**\n     * Gets a custom text range to use when emitting comments.\n     */\n    /*@internal*/\n    function getStartsOnNewLine(node) {\n        var _a;\n        return (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.startsOnNewLine;\n    }\n    ts.getStartsOnNewLine = getStartsOnNewLine;\n    /**\n     * Sets a custom text range to use when emitting comments.\n     */\n    /*@internal*/\n    function setStartsOnNewLine(node, newLine) {\n        getOrCreateEmitNode(node).startsOnNewLine = newLine;\n        return node;\n    }\n    ts.setStartsOnNewLine = setStartsOnNewLine;\n    /**\n     * Gets a custom text range to use when emitting comments.\n     */\n    function getCommentRange(node) {\n        var _a, _b;\n        return (_b = (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.commentRange) !== null && _b !== void 0 ? _b : node;\n    }\n    ts.getCommentRange = getCommentRange;\n    /**\n     * Sets a custom text range to use when emitting comments.\n     */\n    function setCommentRange(node, range) {\n        getOrCreateEmitNode(node).commentRange = range;\n        return node;\n    }\n    ts.setCommentRange = setCommentRange;\n    function getSyntheticLeadingComments(node) {\n        var _a;\n        return (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.leadingComments;\n    }\n    ts.getSyntheticLeadingComments = getSyntheticLeadingComments;\n    function setSyntheticLeadingComments(node, comments) {\n        getOrCreateEmitNode(node).leadingComments = comments;\n        return node;\n    }\n    ts.setSyntheticLeadingComments = setSyntheticLeadingComments;\n    function addSyntheticLeadingComment(node, kind, text, hasTrailingNewLine) {\n        return setSyntheticLeadingComments(node, ts.append(getSyntheticLeadingComments(node), { kind: kind, pos: -1, end: -1, hasTrailingNewLine: hasTrailingNewLine, text: text }));\n    }\n    ts.addSyntheticLeadingComment = addSyntheticLeadingComment;\n    function getSyntheticTrailingComments(node) {\n        var _a;\n        return (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.trailingComments;\n    }\n    ts.getSyntheticTrailingComments = getSyntheticTrailingComments;\n    function setSyntheticTrailingComments(node, comments) {\n        getOrCreateEmitNode(node).trailingComments = comments;\n        return node;\n    }\n    ts.setSyntheticTrailingComments = setSyntheticTrailingComments;\n    function addSyntheticTrailingComment(node, kind, text, hasTrailingNewLine) {\n        return setSyntheticTrailingComments(node, ts.append(getSyntheticTrailingComments(node), { kind: kind, pos: -1, end: -1, hasTrailingNewLine: hasTrailingNewLine, text: text }));\n    }\n    ts.addSyntheticTrailingComment = addSyntheticTrailingComment;\n    function moveSyntheticComments(node, original) {\n        setSyntheticLeadingComments(node, getSyntheticLeadingComments(original));\n        setSyntheticTrailingComments(node, getSyntheticTrailingComments(original));\n        var emit = getOrCreateEmitNode(original);\n        emit.leadingComments = undefined;\n        emit.trailingComments = undefined;\n        return node;\n    }\n    ts.moveSyntheticComments = moveSyntheticComments;\n    /**\n     * Gets the constant value to emit for an expression representing an enum.\n     */\n    function getConstantValue(node) {\n        var _a;\n        return (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.constantValue;\n    }\n    ts.getConstantValue = getConstantValue;\n    /**\n     * Sets the constant value to emit for an expression.\n     */\n    function setConstantValue(node, value) {\n        var emitNode = getOrCreateEmitNode(node);\n        emitNode.constantValue = value;\n        return node;\n    }\n    ts.setConstantValue = setConstantValue;\n    /**\n     * Adds an EmitHelper to a node.\n     */\n    function addEmitHelper(node, helper) {\n        var emitNode = getOrCreateEmitNode(node);\n        emitNode.helpers = ts.append(emitNode.helpers, helper);\n        return node;\n    }\n    ts.addEmitHelper = addEmitHelper;\n    /**\n     * Add EmitHelpers to a node.\n     */\n    function addEmitHelpers(node, helpers) {\n        if (ts.some(helpers)) {\n            var emitNode = getOrCreateEmitNode(node);\n            for (var _i = 0, helpers_2 = helpers; _i < helpers_2.length; _i++) {\n                var helper = helpers_2[_i];\n                emitNode.helpers = ts.appendIfUnique(emitNode.helpers, helper);\n            }\n        }\n        return node;\n    }\n    ts.addEmitHelpers = addEmitHelpers;\n    /**\n     * Removes an EmitHelper from a node.\n     */\n    function removeEmitHelper(node, helper) {\n        var _a;\n        var helpers = (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.helpers;\n        if (helpers) {\n            return ts.orderedRemoveItem(helpers, helper);\n        }\n        return false;\n    }\n    ts.removeEmitHelper = removeEmitHelper;\n    /**\n     * Gets the EmitHelpers of a node.\n     */\n    function getEmitHelpers(node) {\n        var _a;\n        return (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.helpers;\n    }\n    ts.getEmitHelpers = getEmitHelpers;\n    /**\n     * Moves matching emit helpers from a source node to a target node.\n     */\n    function moveEmitHelpers(source, target, predicate) {\n        var sourceEmitNode = source.emitNode;\n        var sourceEmitHelpers = sourceEmitNode && sourceEmitNode.helpers;\n        if (!ts.some(sourceEmitHelpers))\n            return;\n        var targetEmitNode = getOrCreateEmitNode(target);\n        var helpersRemoved = 0;\n        for (var i = 0; i < sourceEmitHelpers.length; i++) {\n            var helper = sourceEmitHelpers[i];\n            if (predicate(helper)) {\n                helpersRemoved++;\n                targetEmitNode.helpers = ts.appendIfUnique(targetEmitNode.helpers, helper);\n            }\n            else if (helpersRemoved > 0) {\n                sourceEmitHelpers[i - helpersRemoved] = helper;\n            }\n        }\n        if (helpersRemoved > 0) {\n            sourceEmitHelpers.length -= helpersRemoved;\n        }\n    }\n    ts.moveEmitHelpers = moveEmitHelpers;\n    /* @internal */\n    function ignoreSourceNewlines(node) {\n        getOrCreateEmitNode(node).flags |= 134217728 /* IgnoreSourceNewlines */;\n        return node;\n    }\n    ts.ignoreSourceNewlines = ignoreSourceNewlines;\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    function createEmitHelperFactory(context) {\n        var factory = context.factory;\n        return {\n            getUnscopedHelperName: getUnscopedHelperName,\n            // TypeScript Helpers\n            createDecorateHelper: createDecorateHelper,\n            createMetadataHelper: createMetadataHelper,\n            createParamHelper: createParamHelper,\n            // ES2018 Helpers\n            createAssignHelper: createAssignHelper,\n            createAwaitHelper: createAwaitHelper,\n            createAsyncGeneratorHelper: createAsyncGeneratorHelper,\n            createAsyncDelegatorHelper: createAsyncDelegatorHelper,\n            createAsyncValuesHelper: createAsyncValuesHelper,\n            // ES2018 Destructuring Helpers\n            createRestHelper: createRestHelper,\n            // ES2017 Helpers\n            createAwaiterHelper: createAwaiterHelper,\n            // ES2015 Helpers\n            createExtendsHelper: createExtendsHelper,\n            createTemplateObjectHelper: createTemplateObjectHelper,\n            createSpreadArrayHelper: createSpreadArrayHelper,\n            // ES2015 Destructuring Helpers\n            createValuesHelper: createValuesHelper,\n            createReadHelper: createReadHelper,\n            // ES2015 Generator Helpers\n            createGeneratorHelper: createGeneratorHelper,\n            // ES Module Helpers\n            createCreateBindingHelper: createCreateBindingHelper,\n            createImportStarHelper: createImportStarHelper,\n            createImportStarCallbackHelper: createImportStarCallbackHelper,\n            createImportDefaultHelper: createImportDefaultHelper,\n            createExportStarHelper: createExportStarHelper,\n            // Class Fields Helpers\n            createClassPrivateFieldGetHelper: createClassPrivateFieldGetHelper,\n            createClassPrivateFieldSetHelper: createClassPrivateFieldSetHelper,\n        };\n        /**\n         * Gets an identifier for the name of an *unscoped* emit helper.\n         */\n        function getUnscopedHelperName(name) {\n            return ts.setEmitFlags(factory.createIdentifier(name), 4096 /* HelperName */ | 2 /* AdviseOnEmitNode */);\n        }\n        // TypeScript Helpers\n        function createDecorateHelper(decoratorExpressions, target, memberName, descriptor) {\n            context.requestEmitHelper(ts.decorateHelper);\n            var argumentsArray = [];\n            argumentsArray.push(factory.createArrayLiteralExpression(decoratorExpressions, /*multiLine*/ true));\n            argumentsArray.push(target);\n            if (memberName) {\n                argumentsArray.push(memberName);\n                if (descriptor) {\n                    argumentsArray.push(descriptor);\n                }\n            }\n            return factory.createCallExpression(getUnscopedHelperName(\"__decorate\"), \n            /*typeArguments*/ undefined, argumentsArray);\n        }\n        function createMetadataHelper(metadataKey, metadataValue) {\n            context.requestEmitHelper(ts.metadataHelper);\n            return factory.createCallExpression(getUnscopedHelperName(\"__metadata\"), \n            /*typeArguments*/ undefined, [\n                factory.createStringLiteral(metadataKey),\n                metadataValue\n            ]);\n        }\n        function createParamHelper(expression, parameterOffset, location) {\n            context.requestEmitHelper(ts.paramHelper);\n            return ts.setTextRange(factory.createCallExpression(getUnscopedHelperName(\"__param\"), \n            /*typeArguments*/ undefined, [\n                factory.createNumericLiteral(parameterOffset + \"\"),\n                expression\n            ]), location);\n        }\n        // ES2018 Helpers\n        function createAssignHelper(attributesSegments) {\n            if (context.getCompilerOptions().target >= 2 /* ES2015 */) {\n                return factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier(\"Object\"), \"assign\"), \n                /*typeArguments*/ undefined, attributesSegments);\n            }\n            context.requestEmitHelper(ts.assignHelper);\n            return factory.createCallExpression(getUnscopedHelperName(\"__assign\"), \n            /*typeArguments*/ undefined, attributesSegments);\n        }\n        function createAwaitHelper(expression) {\n            context.requestEmitHelper(ts.awaitHelper);\n            return factory.createCallExpression(getUnscopedHelperName(\"__await\"), /*typeArguments*/ undefined, [expression]);\n        }\n        function createAsyncGeneratorHelper(generatorFunc, hasLexicalThis) {\n            context.requestEmitHelper(ts.awaitHelper);\n            context.requestEmitHelper(ts.asyncGeneratorHelper);\n            // Mark this node as originally an async function\n            (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 262144 /* AsyncFunctionBody */ | 524288 /* ReuseTempVariableScope */;\n            return factory.createCallExpression(getUnscopedHelperName(\"__asyncGenerator\"), \n            /*typeArguments*/ undefined, [\n                hasLexicalThis ? factory.createThis() : factory.createVoidZero(),\n                factory.createIdentifier(\"arguments\"),\n                generatorFunc\n            ]);\n        }\n        function createAsyncDelegatorHelper(expression) {\n            context.requestEmitHelper(ts.awaitHelper);\n            context.requestEmitHelper(ts.asyncDelegator);\n            return factory.createCallExpression(getUnscopedHelperName(\"__asyncDelegator\"), \n            /*typeArguments*/ undefined, [expression]);\n        }\n        function createAsyncValuesHelper(expression) {\n            context.requestEmitHelper(ts.asyncValues);\n            return factory.createCallExpression(getUnscopedHelperName(\"__asyncValues\"), \n            /*typeArguments*/ undefined, [expression]);\n        }\n        // ES2018 Destructuring Helpers\n        /** Given value: o, propName: p, pattern: { a, b, ...p } from the original statement\n         * `{ a, b, ...p } = o`, create `p = __rest(o, [\"a\", \"b\"]);`\n         */\n        function createRestHelper(value, elements, computedTempVariables, location) {\n            context.requestEmitHelper(ts.restHelper);\n            var propertyNames = [];\n            var computedTempVariableOffset = 0;\n            for (var i = 0; i < elements.length - 1; i++) {\n                var propertyName = ts.getPropertyNameOfBindingOrAssignmentElement(elements[i]);\n                if (propertyName) {\n                    if (ts.isComputedPropertyName(propertyName)) {\n                        ts.Debug.assertIsDefined(computedTempVariables, \"Encountered computed property name but 'computedTempVariables' argument was not provided.\");\n                        var temp = computedTempVariables[computedTempVariableOffset];\n                        computedTempVariableOffset++;\n                        // typeof _tmp === \"symbol\" ? _tmp : _tmp + \"\"\n                        propertyNames.push(factory.createConditionalExpression(factory.createTypeCheck(temp, \"symbol\"), \n                        /*questionToken*/ undefined, temp, \n                        /*colonToken*/ undefined, factory.createAdd(temp, factory.createStringLiteral(\"\"))));\n                    }\n                    else {\n                        propertyNames.push(factory.createStringLiteralFromNode(propertyName));\n                    }\n                }\n            }\n            return factory.createCallExpression(getUnscopedHelperName(\"__rest\"), \n            /*typeArguments*/ undefined, [\n                value,\n                ts.setTextRange(factory.createArrayLiteralExpression(propertyNames), location)\n            ]);\n        }\n        // ES2017 Helpers\n        function createAwaiterHelper(hasLexicalThis, hasLexicalArguments, promiseConstructor, body) {\n            context.requestEmitHelper(ts.awaiterHelper);\n            var generatorFunc = factory.createFunctionExpression(\n            /*modifiers*/ undefined, factory.createToken(41 /* AsteriskToken */), \n            /*name*/ undefined, \n            /*typeParameters*/ undefined, \n            /*parameters*/ [], \n            /*type*/ undefined, body);\n            // Mark this node as originally an async function\n            (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 262144 /* AsyncFunctionBody */ | 524288 /* ReuseTempVariableScope */;\n            return factory.createCallExpression(getUnscopedHelperName(\"__awaiter\"), \n            /*typeArguments*/ undefined, [\n                hasLexicalThis ? factory.createThis() : factory.createVoidZero(),\n                hasLexicalArguments ? factory.createIdentifier(\"arguments\") : factory.createVoidZero(),\n                promiseConstructor ? ts.createExpressionFromEntityName(factory, promiseConstructor) : factory.createVoidZero(),\n                generatorFunc\n            ]);\n        }\n        // ES2015 Helpers\n        function createExtendsHelper(name) {\n            context.requestEmitHelper(ts.extendsHelper);\n            return factory.createCallExpression(getUnscopedHelperName(\"__extends\"), \n            /*typeArguments*/ undefined, [name, factory.createUniqueName(\"_super\", 16 /* Optimistic */ | 32 /* FileLevel */)]);\n        }\n        function createTemplateObjectHelper(cooked, raw) {\n            context.requestEmitHelper(ts.templateObjectHelper);\n            return factory.createCallExpression(getUnscopedHelperName(\"__makeTemplateObject\"), \n            /*typeArguments*/ undefined, [cooked, raw]);\n        }\n        function createSpreadArrayHelper(to, from) {\n            context.requestEmitHelper(ts.spreadArrayHelper);\n            return factory.createCallExpression(getUnscopedHelperName(\"__spreadArray\"), \n            /*typeArguments*/ undefined, [to, from]);\n        }\n        // ES2015 Destructuring Helpers\n        function createValuesHelper(expression) {\n            context.requestEmitHelper(ts.valuesHelper);\n            return factory.createCallExpression(getUnscopedHelperName(\"__values\"), \n            /*typeArguments*/ undefined, [expression]);\n        }\n        function createReadHelper(iteratorRecord, count) {\n            context.requestEmitHelper(ts.readHelper);\n            return factory.createCallExpression(getUnscopedHelperName(\"__read\"), \n            /*typeArguments*/ undefined, count !== undefined\n                ? [iteratorRecord, factory.createNumericLiteral(count + \"\")]\n                : [iteratorRecord]);\n        }\n        // ES2015 Generator Helpers\n        function createGeneratorHelper(body) {\n            context.requestEmitHelper(ts.generatorHelper);\n            return factory.createCallExpression(getUnscopedHelperName(\"__generator\"), \n            /*typeArguments*/ undefined, [factory.createThis(), body]);\n        }\n        // ES Module Helpers\n        function createCreateBindingHelper(module, inputName, outputName) {\n            context.requestEmitHelper(ts.createBindingHelper);\n            return factory.createCallExpression(getUnscopedHelperName(\"__createBinding\"), \n            /*typeArguments*/ undefined, __spreadArray([factory.createIdentifier(\"exports\"), module, inputName], (outputName ? [outputName] : [])));\n        }\n        function createImportStarHelper(expression) {\n            context.requestEmitHelper(ts.importStarHelper);\n            return factory.createCallExpression(getUnscopedHelperName(\"__importStar\"), \n            /*typeArguments*/ undefined, [expression]);\n        }\n        function createImportStarCallbackHelper() {\n            context.requestEmitHelper(ts.importStarHelper);\n            return getUnscopedHelperName(\"__importStar\");\n        }\n        function createImportDefaultHelper(expression) {\n            context.requestEmitHelper(ts.importDefaultHelper);\n            return factory.createCallExpression(getUnscopedHelperName(\"__importDefault\"), \n            /*typeArguments*/ undefined, [expression]);\n        }\n        function createExportStarHelper(moduleExpression, exportsExpression) {\n            if (exportsExpression === void 0) { exportsExpression = factory.createIdentifier(\"exports\"); }\n            context.requestEmitHelper(ts.exportStarHelper);\n            context.requestEmitHelper(ts.createBindingHelper);\n            return factory.createCallExpression(getUnscopedHelperName(\"__exportStar\"), \n            /*typeArguments*/ undefined, [moduleExpression, exportsExpression]);\n        }\n        // Class Fields Helpers\n        function createClassPrivateFieldGetHelper(receiver, privateField) {\n            context.requestEmitHelper(ts.classPrivateFieldGetHelper);\n            return factory.createCallExpression(getUnscopedHelperName(\"__classPrivateFieldGet\"), /*typeArguments*/ undefined, [receiver, privateField]);\n        }\n        function createClassPrivateFieldSetHelper(receiver, privateField, value) {\n            context.requestEmitHelper(ts.classPrivateFieldSetHelper);\n            return factory.createCallExpression(getUnscopedHelperName(\"__classPrivateFieldSet\"), /*typeArguments*/ undefined, [receiver, privateField, value]);\n        }\n    }\n    ts.createEmitHelperFactory = createEmitHelperFactory;\n    /* @internal */\n    function compareEmitHelpers(x, y) {\n        if (x === y)\n            return 0 /* EqualTo */;\n        if (x.priority === y.priority)\n            return 0 /* EqualTo */;\n        if (x.priority === undefined)\n            return 1 /* GreaterThan */;\n        if (y.priority === undefined)\n            return -1 /* LessThan */;\n        return ts.compareValues(x.priority, y.priority);\n    }\n    ts.compareEmitHelpers = compareEmitHelpers;\n    /**\n     * @param input Template string input strings\n     * @param args Names which need to be made file-level unique\n     */\n    function helperString(input) {\n        var args = [];\n        for (var _i = 1; _i < arguments.length; _i++) {\n            args[_i - 1] = arguments[_i];\n        }\n        return function (uniqueName) {\n            var result = \"\";\n            for (var i = 0; i < args.length; i++) {\n                result += input[i];\n                result += uniqueName(args[i]);\n            }\n            result += input[input.length - 1];\n            return result;\n        };\n    }\n    ts.helperString = helperString;\n    // TypeScript Helpers\n    ts.decorateHelper = {\n        name: \"typescript:decorate\",\n        importName: \"__decorate\",\n        scoped: false,\n        priority: 2,\n        text: \"\\n            var __decorate = (this && this.__decorate) || function (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    };\n    ts.metadataHelper = {\n        name: \"typescript:metadata\",\n        importName: \"__metadata\",\n        scoped: false,\n        priority: 3,\n        text: \"\\n            var __metadata = (this && this.__metadata) || function (k, v) {\\n                if (typeof Reflect === \\\"object\\\" && typeof Reflect.metadata === \\\"function\\\") return Reflect.metadata(k, v);\\n            };\"\n    };\n    ts.paramHelper = {\n        name: \"typescript:param\",\n        importName: \"__param\",\n        scoped: false,\n        priority: 4,\n        text: \"\\n            var __param = (this && this.__param) || function (paramIndex, decorator) {\\n                return function (target, key) { decorator(target, key, paramIndex); }\\n            };\"\n    };\n    // ES2018 Helpers\n    ts.assignHelper = {\n        name: \"typescript:assign\",\n        importName: \"__assign\",\n        scoped: false,\n        priority: 1,\n        text: \"\\n            var __assign = (this && this.__assign) || function () {\\n                __assign = Object.assign || function(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))\\n                            t[p] = s[p];\\n                    }\\n                    return t;\\n                };\\n                return __assign.apply(this, arguments);\\n            };\"\n    };\n    ts.awaitHelper = {\n        name: \"typescript:await\",\n        importName: \"__await\",\n        scoped: false,\n        text: \"\\n            var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\"\n    };\n    ts.asyncGeneratorHelper = {\n        name: \"typescript:asyncGenerator\",\n        importName: \"__asyncGenerator\",\n        scoped: false,\n        dependencies: [ts.awaitHelper],\n        text: \"\\n            var __asyncGenerator = (this && this.__asyncGenerator) || function (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    };\n    ts.asyncDelegator = {\n        name: \"typescript:asyncDelegator\",\n        importName: \"__asyncDelegator\",\n        scoped: false,\n        dependencies: [ts.awaitHelper],\n        text: \"\\n            var __asyncDelegator = (this && this.__asyncDelegator) || function (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: n === \\\"return\\\" } : f ? f(v) : v; } : f; }\\n            };\"\n    };\n    ts.asyncValues = {\n        name: \"typescript:asyncValues\",\n        importName: \"__asyncValues\",\n        scoped: false,\n        text: \"\\n            var __asyncValues = (this && this.__asyncValues) || function (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    };\n    // ES2018 Destructuring Helpers\n    ts.restHelper = {\n        name: \"typescript:rest\",\n        importName: \"__rest\",\n        scoped: false,\n        text: \"\\n            var __rest = (this && this.__rest) || function (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    };\n    // ES2017 Helpers\n    ts.awaiterHelper = {\n        name: \"typescript:awaiter\",\n        importName: \"__awaiter\",\n        scoped: false,\n        priority: 5,\n        text: \"\\n            var __awaiter = (this && this.__awaiter) || function (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    };\n    // ES2015 Helpers\n    ts.extendsHelper = {\n        name: \"typescript:extends\",\n        importName: \"__extends\",\n        scoped: false,\n        priority: 0,\n        text: \"\\n            var __extends = (this && this.__extends) || (function () {\\n                var 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\\n                return function (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            })();\"\n    };\n    ts.templateObjectHelper = {\n        name: \"typescript:makeTemplateObject\",\n        importName: \"__makeTemplateObject\",\n        scoped: false,\n        priority: 0,\n        text: \"\\n            var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\\n                if (Object.defineProperty) { Object.defineProperty(cooked, \\\"raw\\\", { value: raw }); } else { cooked.raw = raw; }\\n                return cooked;\\n            };\"\n    };\n    ts.readHelper = {\n        name: \"typescript:read\",\n        importName: \"__read\",\n        scoped: false,\n        text: \"\\n            var __read = (this && this.__read) || function (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    ts.spreadArrayHelper = {\n        name: \"typescript:spreadArray\",\n        importName: \"__spreadArray\",\n        scoped: false,\n        text: \"\\n            var __spreadArray = (this && this.__spreadArray) || function (to, from) {\\n                for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\\n                    to[j] = from[i];\\n                return to;\\n            };\"\n    };\n    // ES2015 Destructuring Helpers\n    ts.valuesHelper = {\n        name: \"typescript:values\",\n        importName: \"__values\",\n        scoped: false,\n        text: \"\\n            var __values = (this && this.__values) || function(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    };\n    // ES2015 Generator Helpers\n    // The __generator helper is used by down-level transformations to emulate the runtime\n    // semantics of an ES2015 generator function. When called, this helper returns an\n    // object that implements the Iterator protocol, in that it has `next`, `return`, and\n    // `throw` methods that step through the generator when invoked.\n    //\n    // parameters:\n    //  @param thisArg  The value to use as the `this` binding for the transformed generator body.\n    //  @param body     A function that acts as the transformed generator body.\n    //\n    // variables:\n    //  _       Persistent state for the generator that is shared between the helper and the\n    //          generator body. The state object has the following members:\n    //            sent() - A method that returns or throws the current completion value.\n    //            label  - The next point at which to resume evaluation of the generator body.\n    //            trys   - A stack of protected regions (try/catch/finally blocks).\n    //            ops    - A stack of pending instructions when inside of a finally block.\n    //  f       A value indicating whether the generator is executing.\n    //  y       An iterator to delegate for a yield*.\n    //  t       A temporary variable that holds one of the following values (note that these\n    //          cases do not overlap):\n    //          - The completion value when resuming from a `yield` or `yield*`.\n    //          - The error value for a catch block.\n    //          - The current protected region (array of try/catch/finally/end labels).\n    //          - The verb (`next`, `throw`, or `return` method) to delegate to the expression\n    //            of a `yield*`.\n    //          - The result of evaluating the verb delegated to the expression of a `yield*`.\n    //\n    // functions:\n    //  verb(n)     Creates a bound callback to the `step` function for opcode `n`.\n    //  step(op)    Evaluates opcodes in a generator body until execution is suspended or\n    //              completed.\n    //\n    // The __generator helper understands a limited set of instructions:\n    //  0: next(value?)     - Start or resume the generator with the specified value.\n    //  1: throw(error)     - Resume the generator with an exception. If the generator is\n    //                        suspended inside of one or more protected regions, evaluates\n    //                        any intervening finally blocks between the current label and\n    //                        the nearest catch block or function boundary. If uncaught, the\n    //                        exception is thrown to the caller.\n    //  2: return(value?)   - Resume the generator as if with a return. If the generator is\n    //                        suspended inside of one or more protected regions, evaluates any\n    //                        intervening finally blocks.\n    //  3: break(label)     - Jump to the specified label. If the label is outside of the\n    //                        current protected region, evaluates any intervening finally\n    //                        blocks.\n    //  4: yield(value?)    - Yield execution to the caller with an optional value. When\n    //                        resumed, the generator will continue at the next label.\n    //  5: yield*(value)    - Delegates evaluation to the supplied iterator. When\n    //                        delegation completes, the generator will continue at the next\n    //                        label.\n    //  6: catch(error)     - Handles an exception thrown from within the generator body. If\n    //                        the current label is inside of one or more protected regions,\n    //                        evaluates any intervening finally blocks between the current\n    //                        label and the nearest catch block or function boundary. If\n    //                        uncaught, the exception is thrown to the caller.\n    //  7: endfinally       - Ends a finally block, resuming the last instruction prior to\n    //                        entering a finally block.\n    //\n    // For examples of how these are used, see the comments in ./transformers/generators.ts\n    ts.generatorHelper = {\n        name: \"typescript:generator\",\n        importName: \"__generator\",\n        scoped: false,\n        priority: 6,\n        text: \"\\n            var __generator = (this && this.__generator) || function (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 (_) 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    };\n    // ES Module Helpers\n    ts.createBindingHelper = {\n        name: \"typescript:commonjscreatebinding\",\n        importName: \"__createBinding\",\n        scoped: false,\n        priority: 1,\n        text: \"\\n            var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\\n                if (k2 === undefined) k2 = k;\\n                Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\\n            }) : (function(o, m, k, k2) {\\n                if (k2 === undefined) k2 = k;\\n                o[k2] = m[k];\\n            }));\"\n    };\n    ts.setModuleDefaultHelper = {\n        name: \"typescript:commonjscreatevalue\",\n        importName: \"__setModuleDefault\",\n        scoped: false,\n        priority: 1,\n        text: \"\\n            var __setModuleDefault = (this && this.__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    };\n    // emit helper for `import * as Name from \"foo\"`\n    ts.importStarHelper = {\n        name: \"typescript:commonjsimportstar\",\n        importName: \"__importStar\",\n        scoped: false,\n        dependencies: [ts.createBindingHelper, ts.setModuleDefaultHelper],\n        priority: 2,\n        text: \"\\n            var __importStar = (this && this.__importStar) || function (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    };\n    // emit helper for `import Name from \"foo\"`\n    ts.importDefaultHelper = {\n        name: \"typescript:commonjsimportdefault\",\n        importName: \"__importDefault\",\n        scoped: false,\n        text: \"\\n            var __importDefault = (this && this.__importDefault) || function (mod) {\\n                return (mod && mod.__esModule) ? mod : { \\\"default\\\": mod };\\n            };\"\n    };\n    // emit output for the __export helper function\n    ts.exportStarHelper = {\n        name: \"typescript:export-star\",\n        importName: \"__exportStar\",\n        scoped: false,\n        dependencies: [ts.createBindingHelper],\n        priority: 2,\n        text: \"\\n            var __exportStar = (this && this.__exportStar) || function(m, exports) {\\n                for (var p in m) if (p !== \\\"default\\\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\\n            };\"\n    };\n    // Class fields helpers\n    ts.classPrivateFieldGetHelper = {\n        name: \"typescript:classPrivateFieldGet\",\n        importName: \"__classPrivateFieldGet\",\n        scoped: false,\n        text: \"\\n            var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {\\n                if (!privateMap.has(receiver)) {\\n                    throw new TypeError(\\\"attempted to get private field on non-instance\\\");\\n                }\\n                return privateMap.get(receiver);\\n            };\"\n    };\n    ts.classPrivateFieldSetHelper = {\n        name: \"typescript:classPrivateFieldSet\",\n        importName: \"__classPrivateFieldSet\",\n        scoped: false,\n        text: \"\\n            var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {\\n                if (!privateMap.has(receiver)) {\\n                    throw new TypeError(\\\"attempted to set private field on non-instance\\\");\\n                }\\n                privateMap.set(receiver, value);\\n                return value;\\n            };\"\n    };\n    var allUnscopedEmitHelpers;\n    function getAllUnscopedEmitHelpers() {\n        return allUnscopedEmitHelpers || (allUnscopedEmitHelpers = ts.arrayToMap([\n            ts.decorateHelper,\n            ts.metadataHelper,\n            ts.paramHelper,\n            ts.assignHelper,\n            ts.awaitHelper,\n            ts.asyncGeneratorHelper,\n            ts.asyncDelegator,\n            ts.asyncValues,\n            ts.restHelper,\n            ts.awaiterHelper,\n            ts.extendsHelper,\n            ts.templateObjectHelper,\n            ts.spreadArrayHelper,\n            ts.valuesHelper,\n            ts.readHelper,\n            ts.generatorHelper,\n            ts.importStarHelper,\n            ts.importDefaultHelper,\n            ts.exportStarHelper,\n            ts.classPrivateFieldGetHelper,\n            ts.classPrivateFieldSetHelper,\n            ts.createBindingHelper,\n            ts.setModuleDefaultHelper\n        ], function (helper) { return helper.name; }));\n    }\n    ts.getAllUnscopedEmitHelpers = getAllUnscopedEmitHelpers;\n    ts.asyncSuperHelper = {\n        name: \"typescript:async-super\",\n        scoped: true,\n        text: helperString(__makeTemplateObject([\"\\n            const \", \" = name => super[name];\"], [\"\\n            const \", \" = name => super[name];\"]), \"_superIndex\")\n    };\n    ts.advancedAsyncSuperHelper = {\n        name: \"typescript:advanced-async-super\",\n        scoped: true,\n        text: helperString(__makeTemplateObject([\"\\n            const \", \" = (function (geti, seti) {\\n                const cache = Object.create(null);\\n                return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\\n            })(name => super[name], (name, value) => super[name] = value);\"], [\"\\n            const \", \" = (function (geti, seti) {\\n                const cache = Object.create(null);\\n                return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\\n            })(name => super[name], (name, value) => super[name] = value);\"]), \"_superIndex\")\n    };\n    function isCallToHelper(firstSegment, helperName) {\n        return ts.isCallExpression(firstSegment)\n            && ts.isIdentifier(firstSegment.expression)\n            && (ts.getEmitFlags(firstSegment.expression) & 4096 /* HelperName */)\n            && firstSegment.expression.escapedText === helperName;\n    }\n    ts.isCallToHelper = isCallToHelper;\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    // Literals\n    function isNumericLiteral(node) {\n        return node.kind === 8 /* NumericLiteral */;\n    }\n    ts.isNumericLiteral = isNumericLiteral;\n    function isBigIntLiteral(node) {\n        return node.kind === 9 /* BigIntLiteral */;\n    }\n    ts.isBigIntLiteral = isBigIntLiteral;\n    function isStringLiteral(node) {\n        return node.kind === 10 /* StringLiteral */;\n    }\n    ts.isStringLiteral = isStringLiteral;\n    function isJsxText(node) {\n        return node.kind === 11 /* JsxText */;\n    }\n    ts.isJsxText = isJsxText;\n    function isRegularExpressionLiteral(node) {\n        return node.kind === 13 /* RegularExpressionLiteral */;\n    }\n    ts.isRegularExpressionLiteral = isRegularExpressionLiteral;\n    function isNoSubstitutionTemplateLiteral(node) {\n        return node.kind === 14 /* NoSubstitutionTemplateLiteral */;\n    }\n    ts.isNoSubstitutionTemplateLiteral = isNoSubstitutionTemplateLiteral;\n    // Pseudo-literals\n    function isTemplateHead(node) {\n        return node.kind === 15 /* TemplateHead */;\n    }\n    ts.isTemplateHead = isTemplateHead;\n    function isTemplateMiddle(node) {\n        return node.kind === 16 /* TemplateMiddle */;\n    }\n    ts.isTemplateMiddle = isTemplateMiddle;\n    function isTemplateTail(node) {\n        return node.kind === 17 /* TemplateTail */;\n    }\n    ts.isTemplateTail = isTemplateTail;\n    // Identifiers\n    function isIdentifier(node) {\n        return node.kind === 78 /* Identifier */;\n    }\n    ts.isIdentifier = isIdentifier;\n    // Names\n    function isQualifiedName(node) {\n        return node.kind === 157 /* QualifiedName */;\n    }\n    ts.isQualifiedName = isQualifiedName;\n    function isComputedPropertyName(node) {\n        return node.kind === 158 /* ComputedPropertyName */;\n    }\n    ts.isComputedPropertyName = isComputedPropertyName;\n    function isPrivateIdentifier(node) {\n        return node.kind === 79 /* PrivateIdentifier */;\n    }\n    ts.isPrivateIdentifier = isPrivateIdentifier;\n    // Tokens\n    /*@internal*/\n    function isSuperKeyword(node) {\n        return node.kind === 105 /* SuperKeyword */;\n    }\n    ts.isSuperKeyword = isSuperKeyword;\n    /*@internal*/\n    function isImportKeyword(node) {\n        return node.kind === 99 /* ImportKeyword */;\n    }\n    ts.isImportKeyword = isImportKeyword;\n    /*@internal*/\n    function isCommaToken(node) {\n        return node.kind === 27 /* CommaToken */;\n    }\n    ts.isCommaToken = isCommaToken;\n    /*@internal*/\n    function isQuestionToken(node) {\n        return node.kind === 57 /* QuestionToken */;\n    }\n    ts.isQuestionToken = isQuestionToken;\n    /*@internal*/\n    function isExclamationToken(node) {\n        return node.kind === 53 /* ExclamationToken */;\n    }\n    ts.isExclamationToken = isExclamationToken;\n    // Signature elements\n    function isTypeParameterDeclaration(node) {\n        return node.kind === 159 /* TypeParameter */;\n    }\n    ts.isTypeParameterDeclaration = isTypeParameterDeclaration;\n    // TODO(rbuckton): Rename to 'isParameterDeclaration'\n    function isParameter(node) {\n        return node.kind === 160 /* Parameter */;\n    }\n    ts.isParameter = isParameter;\n    function isDecorator(node) {\n        return node.kind === 161 /* Decorator */;\n    }\n    ts.isDecorator = isDecorator;\n    // TypeMember\n    function isPropertySignature(node) {\n        return node.kind === 162 /* PropertySignature */;\n    }\n    ts.isPropertySignature = isPropertySignature;\n    function isPropertyDeclaration(node) {\n        return node.kind === 163 /* PropertyDeclaration */;\n    }\n    ts.isPropertyDeclaration = isPropertyDeclaration;\n    function isMethodSignature(node) {\n        return node.kind === 164 /* MethodSignature */;\n    }\n    ts.isMethodSignature = isMethodSignature;\n    function isMethodDeclaration(node) {\n        return node.kind === 165 /* MethodDeclaration */;\n    }\n    ts.isMethodDeclaration = isMethodDeclaration;\n    function isConstructorDeclaration(node) {\n        return node.kind === 166 /* Constructor */;\n    }\n    ts.isConstructorDeclaration = isConstructorDeclaration;\n    function isGetAccessorDeclaration(node) {\n        return node.kind === 167 /* GetAccessor */;\n    }\n    ts.isGetAccessorDeclaration = isGetAccessorDeclaration;\n    function isSetAccessorDeclaration(node) {\n        return node.kind === 168 /* SetAccessor */;\n    }\n    ts.isSetAccessorDeclaration = isSetAccessorDeclaration;\n    function isCallSignatureDeclaration(node) {\n        return node.kind === 169 /* CallSignature */;\n    }\n    ts.isCallSignatureDeclaration = isCallSignatureDeclaration;\n    function isConstructSignatureDeclaration(node) {\n        return node.kind === 170 /* ConstructSignature */;\n    }\n    ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration;\n    function isIndexSignatureDeclaration(node) {\n        return node.kind === 171 /* IndexSignature */;\n    }\n    ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration;\n    // Type\n    function isTypePredicateNode(node) {\n        return node.kind === 172 /* TypePredicate */;\n    }\n    ts.isTypePredicateNode = isTypePredicateNode;\n    function isTypeReferenceNode(node) {\n        return node.kind === 173 /* TypeReference */;\n    }\n    ts.isTypeReferenceNode = isTypeReferenceNode;\n    function isFunctionTypeNode(node) {\n        return node.kind === 174 /* FunctionType */;\n    }\n    ts.isFunctionTypeNode = isFunctionTypeNode;\n    function isConstructorTypeNode(node) {\n        return node.kind === 175 /* ConstructorType */;\n    }\n    ts.isConstructorTypeNode = isConstructorTypeNode;\n    function isTypeQueryNode(node) {\n        return node.kind === 176 /* TypeQuery */;\n    }\n    ts.isTypeQueryNode = isTypeQueryNode;\n    function isTypeLiteralNode(node) {\n        return node.kind === 177 /* TypeLiteral */;\n    }\n    ts.isTypeLiteralNode = isTypeLiteralNode;\n    function isArrayTypeNode(node) {\n        return node.kind === 178 /* ArrayType */;\n    }\n    ts.isArrayTypeNode = isArrayTypeNode;\n    function isTupleTypeNode(node) {\n        return node.kind === 179 /* TupleType */;\n    }\n    ts.isTupleTypeNode = isTupleTypeNode;\n    function isNamedTupleMember(node) {\n        return node.kind === 192 /* NamedTupleMember */;\n    }\n    ts.isNamedTupleMember = isNamedTupleMember;\n    function isOptionalTypeNode(node) {\n        return node.kind === 180 /* OptionalType */;\n    }\n    ts.isOptionalTypeNode = isOptionalTypeNode;\n    function isRestTypeNode(node) {\n        return node.kind === 181 /* RestType */;\n    }\n    ts.isRestTypeNode = isRestTypeNode;\n    function isUnionTypeNode(node) {\n        return node.kind === 182 /* UnionType */;\n    }\n    ts.isUnionTypeNode = isUnionTypeNode;\n    function isIntersectionTypeNode(node) {\n        return node.kind === 183 /* IntersectionType */;\n    }\n    ts.isIntersectionTypeNode = isIntersectionTypeNode;\n    function isConditionalTypeNode(node) {\n        return node.kind === 184 /* ConditionalType */;\n    }\n    ts.isConditionalTypeNode = isConditionalTypeNode;\n    function isInferTypeNode(node) {\n        return node.kind === 185 /* InferType */;\n    }\n    ts.isInferTypeNode = isInferTypeNode;\n    function isParenthesizedTypeNode(node) {\n        return node.kind === 186 /* ParenthesizedType */;\n    }\n    ts.isParenthesizedTypeNode = isParenthesizedTypeNode;\n    function isThisTypeNode(node) {\n        return node.kind === 187 /* ThisType */;\n    }\n    ts.isThisTypeNode = isThisTypeNode;\n    function isTypeOperatorNode(node) {\n        return node.kind === 188 /* TypeOperator */;\n    }\n    ts.isTypeOperatorNode = isTypeOperatorNode;\n    function isIndexedAccessTypeNode(node) {\n        return node.kind === 189 /* IndexedAccessType */;\n    }\n    ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode;\n    function isMappedTypeNode(node) {\n        return node.kind === 190 /* MappedType */;\n    }\n    ts.isMappedTypeNode = isMappedTypeNode;\n    function isLiteralTypeNode(node) {\n        return node.kind === 191 /* LiteralType */;\n    }\n    ts.isLiteralTypeNode = isLiteralTypeNode;\n    function isImportTypeNode(node) {\n        return node.kind === 195 /* ImportType */;\n    }\n    ts.isImportTypeNode = isImportTypeNode;\n    function isTemplateLiteralTypeSpan(node) {\n        return node.kind === 194 /* TemplateLiteralTypeSpan */;\n    }\n    ts.isTemplateLiteralTypeSpan = isTemplateLiteralTypeSpan;\n    function isTemplateLiteralTypeNode(node) {\n        return node.kind === 193 /* TemplateLiteralType */;\n    }\n    ts.isTemplateLiteralTypeNode = isTemplateLiteralTypeNode;\n    // Binding patterns\n    function isObjectBindingPattern(node) {\n        return node.kind === 196 /* ObjectBindingPattern */;\n    }\n    ts.isObjectBindingPattern = isObjectBindingPattern;\n    function isArrayBindingPattern(node) {\n        return node.kind === 197 /* ArrayBindingPattern */;\n    }\n    ts.isArrayBindingPattern = isArrayBindingPattern;\n    function isBindingElement(node) {\n        return node.kind === 198 /* BindingElement */;\n    }\n    ts.isBindingElement = isBindingElement;\n    // Expression\n    function isArrayLiteralExpression(node) {\n        return node.kind === 199 /* ArrayLiteralExpression */;\n    }\n    ts.isArrayLiteralExpression = isArrayLiteralExpression;\n    function isObjectLiteralExpression(node) {\n        return node.kind === 200 /* ObjectLiteralExpression */;\n    }\n    ts.isObjectLiteralExpression = isObjectLiteralExpression;\n    function isPropertyAccessExpression(node) {\n        return node.kind === 201 /* PropertyAccessExpression */;\n    }\n    ts.isPropertyAccessExpression = isPropertyAccessExpression;\n    function isElementAccessExpression(node) {\n        return node.kind === 202 /* ElementAccessExpression */;\n    }\n    ts.isElementAccessExpression = isElementAccessExpression;\n    function isCallExpression(node) {\n        return node.kind === 203 /* CallExpression */;\n    }\n    ts.isCallExpression = isCallExpression;\n    function isNewExpression(node) {\n        return node.kind === 204 /* NewExpression */;\n    }\n    ts.isNewExpression = isNewExpression;\n    function isTaggedTemplateExpression(node) {\n        return node.kind === 205 /* TaggedTemplateExpression */;\n    }\n    ts.isTaggedTemplateExpression = isTaggedTemplateExpression;\n    function isTypeAssertionExpression(node) {\n        return node.kind === 206 /* TypeAssertionExpression */;\n    }\n    ts.isTypeAssertionExpression = isTypeAssertionExpression;\n    function isParenthesizedExpression(node) {\n        return node.kind === 207 /* ParenthesizedExpression */;\n    }\n    ts.isParenthesizedExpression = isParenthesizedExpression;\n    function isFunctionExpression(node) {\n        return node.kind === 208 /* FunctionExpression */;\n    }\n    ts.isFunctionExpression = isFunctionExpression;\n    function isArrowFunction(node) {\n        return node.kind === 209 /* ArrowFunction */;\n    }\n    ts.isArrowFunction = isArrowFunction;\n    function isDeleteExpression(node) {\n        return node.kind === 210 /* DeleteExpression */;\n    }\n    ts.isDeleteExpression = isDeleteExpression;\n    function isTypeOfExpression(node) {\n        return node.kind === 211 /* TypeOfExpression */;\n    }\n    ts.isTypeOfExpression = isTypeOfExpression;\n    function isVoidExpression(node) {\n        return node.kind === 212 /* VoidExpression */;\n    }\n    ts.isVoidExpression = isVoidExpression;\n    function isAwaitExpression(node) {\n        return node.kind === 213 /* AwaitExpression */;\n    }\n    ts.isAwaitExpression = isAwaitExpression;\n    function isPrefixUnaryExpression(node) {\n        return node.kind === 214 /* PrefixUnaryExpression */;\n    }\n    ts.isPrefixUnaryExpression = isPrefixUnaryExpression;\n    function isPostfixUnaryExpression(node) {\n        return node.kind === 215 /* PostfixUnaryExpression */;\n    }\n    ts.isPostfixUnaryExpression = isPostfixUnaryExpression;\n    function isBinaryExpression(node) {\n        return node.kind === 216 /* BinaryExpression */;\n    }\n    ts.isBinaryExpression = isBinaryExpression;\n    function isConditionalExpression(node) {\n        return node.kind === 217 /* ConditionalExpression */;\n    }\n    ts.isConditionalExpression = isConditionalExpression;\n    function isTemplateExpression(node) {\n        return node.kind === 218 /* TemplateExpression */;\n    }\n    ts.isTemplateExpression = isTemplateExpression;\n    function isYieldExpression(node) {\n        return node.kind === 219 /* YieldExpression */;\n    }\n    ts.isYieldExpression = isYieldExpression;\n    function isSpreadElement(node) {\n        return node.kind === 220 /* SpreadElement */;\n    }\n    ts.isSpreadElement = isSpreadElement;\n    function isClassExpression(node) {\n        return node.kind === 221 /* ClassExpression */;\n    }\n    ts.isClassExpression = isClassExpression;\n    function isOmittedExpression(node) {\n        return node.kind === 222 /* OmittedExpression */;\n    }\n    ts.isOmittedExpression = isOmittedExpression;\n    function isExpressionWithTypeArguments(node) {\n        return node.kind === 223 /* ExpressionWithTypeArguments */;\n    }\n    ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments;\n    function isAsExpression(node) {\n        return node.kind === 224 /* AsExpression */;\n    }\n    ts.isAsExpression = isAsExpression;\n    function isNonNullExpression(node) {\n        return node.kind === 225 /* NonNullExpression */;\n    }\n    ts.isNonNullExpression = isNonNullExpression;\n    function isMetaProperty(node) {\n        return node.kind === 226 /* MetaProperty */;\n    }\n    ts.isMetaProperty = isMetaProperty;\n    function isSyntheticExpression(node) {\n        return node.kind === 227 /* SyntheticExpression */;\n    }\n    ts.isSyntheticExpression = isSyntheticExpression;\n    function isPartiallyEmittedExpression(node) {\n        return node.kind === 336 /* PartiallyEmittedExpression */;\n    }\n    ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression;\n    function isCommaListExpression(node) {\n        return node.kind === 337 /* CommaListExpression */;\n    }\n    ts.isCommaListExpression = isCommaListExpression;\n    // Misc\n    function isTemplateSpan(node) {\n        return node.kind === 228 /* TemplateSpan */;\n    }\n    ts.isTemplateSpan = isTemplateSpan;\n    function isSemicolonClassElement(node) {\n        return node.kind === 229 /* SemicolonClassElement */;\n    }\n    ts.isSemicolonClassElement = isSemicolonClassElement;\n    // Elements\n    function isBlock(node) {\n        return node.kind === 230 /* Block */;\n    }\n    ts.isBlock = isBlock;\n    function isVariableStatement(node) {\n        return node.kind === 232 /* VariableStatement */;\n    }\n    ts.isVariableStatement = isVariableStatement;\n    function isEmptyStatement(node) {\n        return node.kind === 231 /* EmptyStatement */;\n    }\n    ts.isEmptyStatement = isEmptyStatement;\n    function isExpressionStatement(node) {\n        return node.kind === 233 /* ExpressionStatement */;\n    }\n    ts.isExpressionStatement = isExpressionStatement;\n    function isIfStatement(node) {\n        return node.kind === 234 /* IfStatement */;\n    }\n    ts.isIfStatement = isIfStatement;\n    function isDoStatement(node) {\n        return node.kind === 235 /* DoStatement */;\n    }\n    ts.isDoStatement = isDoStatement;\n    function isWhileStatement(node) {\n        return node.kind === 236 /* WhileStatement */;\n    }\n    ts.isWhileStatement = isWhileStatement;\n    function isForStatement(node) {\n        return node.kind === 237 /* ForStatement */;\n    }\n    ts.isForStatement = isForStatement;\n    function isForInStatement(node) {\n        return node.kind === 238 /* ForInStatement */;\n    }\n    ts.isForInStatement = isForInStatement;\n    function isForOfStatement(node) {\n        return node.kind === 239 /* ForOfStatement */;\n    }\n    ts.isForOfStatement = isForOfStatement;\n    function isContinueStatement(node) {\n        return node.kind === 240 /* ContinueStatement */;\n    }\n    ts.isContinueStatement = isContinueStatement;\n    function isBreakStatement(node) {\n        return node.kind === 241 /* BreakStatement */;\n    }\n    ts.isBreakStatement = isBreakStatement;\n    function isReturnStatement(node) {\n        return node.kind === 242 /* ReturnStatement */;\n    }\n    ts.isReturnStatement = isReturnStatement;\n    function isWithStatement(node) {\n        return node.kind === 243 /* WithStatement */;\n    }\n    ts.isWithStatement = isWithStatement;\n    function isSwitchStatement(node) {\n        return node.kind === 244 /* SwitchStatement */;\n    }\n    ts.isSwitchStatement = isSwitchStatement;\n    function isLabeledStatement(node) {\n        return node.kind === 245 /* LabeledStatement */;\n    }\n    ts.isLabeledStatement = isLabeledStatement;\n    function isThrowStatement(node) {\n        return node.kind === 246 /* ThrowStatement */;\n    }\n    ts.isThrowStatement = isThrowStatement;\n    function isTryStatement(node) {\n        return node.kind === 247 /* TryStatement */;\n    }\n    ts.isTryStatement = isTryStatement;\n    function isDebuggerStatement(node) {\n        return node.kind === 248 /* DebuggerStatement */;\n    }\n    ts.isDebuggerStatement = isDebuggerStatement;\n    function isVariableDeclaration(node) {\n        return node.kind === 249 /* VariableDeclaration */;\n    }\n    ts.isVariableDeclaration = isVariableDeclaration;\n    function isVariableDeclarationList(node) {\n        return node.kind === 250 /* VariableDeclarationList */;\n    }\n    ts.isVariableDeclarationList = isVariableDeclarationList;\n    function isFunctionDeclaration(node) {\n        return node.kind === 251 /* FunctionDeclaration */;\n    }\n    ts.isFunctionDeclaration = isFunctionDeclaration;\n    function isClassDeclaration(node) {\n        return node.kind === 252 /* ClassDeclaration */;\n    }\n    ts.isClassDeclaration = isClassDeclaration;\n    function isInterfaceDeclaration(node) {\n        return node.kind === 253 /* InterfaceDeclaration */;\n    }\n    ts.isInterfaceDeclaration = isInterfaceDeclaration;\n    function isTypeAliasDeclaration(node) {\n        return node.kind === 254 /* TypeAliasDeclaration */;\n    }\n    ts.isTypeAliasDeclaration = isTypeAliasDeclaration;\n    function isEnumDeclaration(node) {\n        return node.kind === 255 /* EnumDeclaration */;\n    }\n    ts.isEnumDeclaration = isEnumDeclaration;\n    function isModuleDeclaration(node) {\n        return node.kind === 256 /* ModuleDeclaration */;\n    }\n    ts.isModuleDeclaration = isModuleDeclaration;\n    function isModuleBlock(node) {\n        return node.kind === 257 /* ModuleBlock */;\n    }\n    ts.isModuleBlock = isModuleBlock;\n    function isCaseBlock(node) {\n        return node.kind === 258 /* CaseBlock */;\n    }\n    ts.isCaseBlock = isCaseBlock;\n    function isNamespaceExportDeclaration(node) {\n        return node.kind === 259 /* NamespaceExportDeclaration */;\n    }\n    ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration;\n    function isImportEqualsDeclaration(node) {\n        return node.kind === 260 /* ImportEqualsDeclaration */;\n    }\n    ts.isImportEqualsDeclaration = isImportEqualsDeclaration;\n    function isImportDeclaration(node) {\n        return node.kind === 261 /* ImportDeclaration */;\n    }\n    ts.isImportDeclaration = isImportDeclaration;\n    function isImportClause(node) {\n        return node.kind === 262 /* ImportClause */;\n    }\n    ts.isImportClause = isImportClause;\n    function isNamespaceImport(node) {\n        return node.kind === 263 /* NamespaceImport */;\n    }\n    ts.isNamespaceImport = isNamespaceImport;\n    function isNamespaceExport(node) {\n        return node.kind === 269 /* NamespaceExport */;\n    }\n    ts.isNamespaceExport = isNamespaceExport;\n    function isNamedImports(node) {\n        return node.kind === 264 /* NamedImports */;\n    }\n    ts.isNamedImports = isNamedImports;\n    function isImportSpecifier(node) {\n        return node.kind === 265 /* ImportSpecifier */;\n    }\n    ts.isImportSpecifier = isImportSpecifier;\n    function isExportAssignment(node) {\n        return node.kind === 266 /* ExportAssignment */;\n    }\n    ts.isExportAssignment = isExportAssignment;\n    function isExportDeclaration(node) {\n        return node.kind === 267 /* ExportDeclaration */;\n    }\n    ts.isExportDeclaration = isExportDeclaration;\n    function isNamedExports(node) {\n        return node.kind === 268 /* NamedExports */;\n    }\n    ts.isNamedExports = isNamedExports;\n    function isExportSpecifier(node) {\n        return node.kind === 270 /* ExportSpecifier */;\n    }\n    ts.isExportSpecifier = isExportSpecifier;\n    function isMissingDeclaration(node) {\n        return node.kind === 271 /* MissingDeclaration */;\n    }\n    ts.isMissingDeclaration = isMissingDeclaration;\n    function isNotEmittedStatement(node) {\n        return node.kind === 335 /* NotEmittedStatement */;\n    }\n    ts.isNotEmittedStatement = isNotEmittedStatement;\n    /* @internal */\n    function isSyntheticReference(node) {\n        return node.kind === 340 /* SyntheticReferenceExpression */;\n    }\n    ts.isSyntheticReference = isSyntheticReference;\n    /* @internal */\n    function isMergeDeclarationMarker(node) {\n        return node.kind === 338 /* MergeDeclarationMarker */;\n    }\n    ts.isMergeDeclarationMarker = isMergeDeclarationMarker;\n    /* @internal */\n    function isEndOfDeclarationMarker(node) {\n        return node.kind === 339 /* EndOfDeclarationMarker */;\n    }\n    ts.isEndOfDeclarationMarker = isEndOfDeclarationMarker;\n    // Module References\n    function isExternalModuleReference(node) {\n        return node.kind === 272 /* ExternalModuleReference */;\n    }\n    ts.isExternalModuleReference = isExternalModuleReference;\n    // JSX\n    function isJsxElement(node) {\n        return node.kind === 273 /* JsxElement */;\n    }\n    ts.isJsxElement = isJsxElement;\n    function isJsxSelfClosingElement(node) {\n        return node.kind === 274 /* JsxSelfClosingElement */;\n    }\n    ts.isJsxSelfClosingElement = isJsxSelfClosingElement;\n    function isJsxOpeningElement(node) {\n        return node.kind === 275 /* JsxOpeningElement */;\n    }\n    ts.isJsxOpeningElement = isJsxOpeningElement;\n    function isJsxClosingElement(node) {\n        return node.kind === 276 /* JsxClosingElement */;\n    }\n    ts.isJsxClosingElement = isJsxClosingElement;\n    function isJsxFragment(node) {\n        return node.kind === 277 /* JsxFragment */;\n    }\n    ts.isJsxFragment = isJsxFragment;\n    function isJsxOpeningFragment(node) {\n        return node.kind === 278 /* JsxOpeningFragment */;\n    }\n    ts.isJsxOpeningFragment = isJsxOpeningFragment;\n    function isJsxClosingFragment(node) {\n        return node.kind === 279 /* JsxClosingFragment */;\n    }\n    ts.isJsxClosingFragment = isJsxClosingFragment;\n    function isJsxAttribute(node) {\n        return node.kind === 280 /* JsxAttribute */;\n    }\n    ts.isJsxAttribute = isJsxAttribute;\n    function isJsxAttributes(node) {\n        return node.kind === 281 /* JsxAttributes */;\n    }\n    ts.isJsxAttributes = isJsxAttributes;\n    function isJsxSpreadAttribute(node) {\n        return node.kind === 282 /* JsxSpreadAttribute */;\n    }\n    ts.isJsxSpreadAttribute = isJsxSpreadAttribute;\n    function isJsxExpression(node) {\n        return node.kind === 283 /* JsxExpression */;\n    }\n    ts.isJsxExpression = isJsxExpression;\n    // Clauses\n    function isCaseClause(node) {\n        return node.kind === 284 /* CaseClause */;\n    }\n    ts.isCaseClause = isCaseClause;\n    function isDefaultClause(node) {\n        return node.kind === 285 /* DefaultClause */;\n    }\n    ts.isDefaultClause = isDefaultClause;\n    function isHeritageClause(node) {\n        return node.kind === 286 /* HeritageClause */;\n    }\n    ts.isHeritageClause = isHeritageClause;\n    function isCatchClause(node) {\n        return node.kind === 287 /* CatchClause */;\n    }\n    ts.isCatchClause = isCatchClause;\n    // Property assignments\n    function isPropertyAssignment(node) {\n        return node.kind === 288 /* PropertyAssignment */;\n    }\n    ts.isPropertyAssignment = isPropertyAssignment;\n    function isShorthandPropertyAssignment(node) {\n        return node.kind === 289 /* ShorthandPropertyAssignment */;\n    }\n    ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment;\n    function isSpreadAssignment(node) {\n        return node.kind === 290 /* SpreadAssignment */;\n    }\n    ts.isSpreadAssignment = isSpreadAssignment;\n    // Enum\n    function isEnumMember(node) {\n        return node.kind === 291 /* EnumMember */;\n    }\n    ts.isEnumMember = isEnumMember;\n    // Unparsed\n    // TODO(rbuckton): isUnparsedPrologue\n    function isUnparsedPrepend(node) {\n        return node.kind === 293 /* UnparsedPrepend */;\n    }\n    ts.isUnparsedPrepend = isUnparsedPrepend;\n    // TODO(rbuckton): isUnparsedText\n    // TODO(rbuckton): isUnparsedInternalText\n    // TODO(rbuckton): isUnparsedSyntheticReference\n    // Top-level nodes\n    function isSourceFile(node) {\n        return node.kind === 297 /* SourceFile */;\n    }\n    ts.isSourceFile = isSourceFile;\n    function isBundle(node) {\n        return node.kind === 298 /* Bundle */;\n    }\n    ts.isBundle = isBundle;\n    function isUnparsedSource(node) {\n        return node.kind === 299 /* UnparsedSource */;\n    }\n    ts.isUnparsedSource = isUnparsedSource;\n    // TODO(rbuckton): isInputFiles\n    // JSDoc Elements\n    function isJSDocTypeExpression(node) {\n        return node.kind === 301 /* JSDocTypeExpression */;\n    }\n    ts.isJSDocTypeExpression = isJSDocTypeExpression;\n    function isJSDocNameReference(node) {\n        return node.kind === 302 /* JSDocNameReference */;\n    }\n    ts.isJSDocNameReference = isJSDocNameReference;\n    function isJSDocAllType(node) {\n        return node.kind === 303 /* JSDocAllType */;\n    }\n    ts.isJSDocAllType = isJSDocAllType;\n    function isJSDocUnknownType(node) {\n        return node.kind === 304 /* JSDocUnknownType */;\n    }\n    ts.isJSDocUnknownType = isJSDocUnknownType;\n    function isJSDocNullableType(node) {\n        return node.kind === 305 /* JSDocNullableType */;\n    }\n    ts.isJSDocNullableType = isJSDocNullableType;\n    function isJSDocNonNullableType(node) {\n        return node.kind === 306 /* JSDocNonNullableType */;\n    }\n    ts.isJSDocNonNullableType = isJSDocNonNullableType;\n    function isJSDocOptionalType(node) {\n        return node.kind === 307 /* JSDocOptionalType */;\n    }\n    ts.isJSDocOptionalType = isJSDocOptionalType;\n    function isJSDocFunctionType(node) {\n        return node.kind === 308 /* JSDocFunctionType */;\n    }\n    ts.isJSDocFunctionType = isJSDocFunctionType;\n    function isJSDocVariadicType(node) {\n        return node.kind === 309 /* JSDocVariadicType */;\n    }\n    ts.isJSDocVariadicType = isJSDocVariadicType;\n    function isJSDocNamepathType(node) {\n        return node.kind === 310 /* JSDocNamepathType */;\n    }\n    ts.isJSDocNamepathType = isJSDocNamepathType;\n    function isJSDoc(node) {\n        return node.kind === 311 /* JSDocComment */;\n    }\n    ts.isJSDoc = isJSDoc;\n    function isJSDocTypeLiteral(node) {\n        return node.kind === 312 /* JSDocTypeLiteral */;\n    }\n    ts.isJSDocTypeLiteral = isJSDocTypeLiteral;\n    function isJSDocSignature(node) {\n        return node.kind === 313 /* JSDocSignature */;\n    }\n    ts.isJSDocSignature = isJSDocSignature;\n    // JSDoc Tags\n    function isJSDocAugmentsTag(node) {\n        return node.kind === 315 /* JSDocAugmentsTag */;\n    }\n    ts.isJSDocAugmentsTag = isJSDocAugmentsTag;\n    function isJSDocAuthorTag(node) {\n        return node.kind === 317 /* JSDocAuthorTag */;\n    }\n    ts.isJSDocAuthorTag = isJSDocAuthorTag;\n    function isJSDocClassTag(node) {\n        return node.kind === 319 /* JSDocClassTag */;\n    }\n    ts.isJSDocClassTag = isJSDocClassTag;\n    function isJSDocCallbackTag(node) {\n        return node.kind === 324 /* JSDocCallbackTag */;\n    }\n    ts.isJSDocCallbackTag = isJSDocCallbackTag;\n    function isJSDocPublicTag(node) {\n        return node.kind === 320 /* JSDocPublicTag */;\n    }\n    ts.isJSDocPublicTag = isJSDocPublicTag;\n    function isJSDocPrivateTag(node) {\n        return node.kind === 321 /* JSDocPrivateTag */;\n    }\n    ts.isJSDocPrivateTag = isJSDocPrivateTag;\n    function isJSDocProtectedTag(node) {\n        return node.kind === 322 /* JSDocProtectedTag */;\n    }\n    ts.isJSDocProtectedTag = isJSDocProtectedTag;\n    function isJSDocReadonlyTag(node) {\n        return node.kind === 323 /* JSDocReadonlyTag */;\n    }\n    ts.isJSDocReadonlyTag = isJSDocReadonlyTag;\n    function isJSDocDeprecatedTag(node) {\n        return node.kind === 318 /* JSDocDeprecatedTag */;\n    }\n    ts.isJSDocDeprecatedTag = isJSDocDeprecatedTag;\n    function isJSDocSeeTag(node) {\n        return node.kind === 332 /* JSDocSeeTag */;\n    }\n    ts.isJSDocSeeTag = isJSDocSeeTag;\n    function isJSDocEnumTag(node) {\n        return node.kind === 325 /* JSDocEnumTag */;\n    }\n    ts.isJSDocEnumTag = isJSDocEnumTag;\n    function isJSDocParameterTag(node) {\n        return node.kind === 326 /* JSDocParameterTag */;\n    }\n    ts.isJSDocParameterTag = isJSDocParameterTag;\n    function isJSDocReturnTag(node) {\n        return node.kind === 327 /* JSDocReturnTag */;\n    }\n    ts.isJSDocReturnTag = isJSDocReturnTag;\n    function isJSDocThisTag(node) {\n        return node.kind === 328 /* JSDocThisTag */;\n    }\n    ts.isJSDocThisTag = isJSDocThisTag;\n    function isJSDocTypeTag(node) {\n        return node.kind === 329 /* JSDocTypeTag */;\n    }\n    ts.isJSDocTypeTag = isJSDocTypeTag;\n    function isJSDocTemplateTag(node) {\n        return node.kind === 330 /* JSDocTemplateTag */;\n    }\n    ts.isJSDocTemplateTag = isJSDocTemplateTag;\n    function isJSDocTypedefTag(node) {\n        return node.kind === 331 /* JSDocTypedefTag */;\n    }\n    ts.isJSDocTypedefTag = isJSDocTypedefTag;\n    function isJSDocUnknownTag(node) {\n        return node.kind === 314 /* JSDocTag */;\n    }\n    ts.isJSDocUnknownTag = isJSDocUnknownTag;\n    function isJSDocPropertyTag(node) {\n        return node.kind === 333 /* JSDocPropertyTag */;\n    }\n    ts.isJSDocPropertyTag = isJSDocPropertyTag;\n    function isJSDocImplementsTag(node) {\n        return node.kind === 316 /* JSDocImplementsTag */;\n    }\n    ts.isJSDocImplementsTag = isJSDocImplementsTag;\n    // Synthesized list\n    /* @internal */\n    function isSyntaxList(n) {\n        return n.kind === 334 /* SyntaxList */;\n    }\n    ts.isSyntaxList = isSyntaxList;\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    // Compound nodes\n    function createEmptyExports(factory) {\n        return factory.createExportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ false, factory.createNamedExports([]), /*moduleSpecifier*/ undefined);\n    }\n    ts.createEmptyExports = createEmptyExports;\n    function createMemberAccessForPropertyName(factory, target, memberName, location) {\n        if (ts.isComputedPropertyName(memberName)) {\n            return ts.setTextRange(factory.createElementAccessExpression(target, memberName.expression), location);\n        }\n        else {\n            var expression = ts.setTextRange(ts.isIdentifierOrPrivateIdentifier(memberName)\n                ? factory.createPropertyAccessExpression(target, memberName)\n                : factory.createElementAccessExpression(target, memberName), memberName);\n            ts.getOrCreateEmitNode(expression).flags |= 64 /* NoNestedSourceMaps */;\n            return expression;\n        }\n    }\n    ts.createMemberAccessForPropertyName = createMemberAccessForPropertyName;\n    function createReactNamespace(reactNamespace, parent) {\n        // To ensure the emit resolver can properly resolve the namespace, we need to\n        // treat this identifier as if it were a source tree node by clearing the `Synthesized`\n        // flag and setting a parent node.\n        var react = ts.parseNodeFactory.createIdentifier(reactNamespace || \"React\");\n        // Set the parent that is in parse tree\n        // this makes sure that parent chain is intact for checker to traverse complete scope tree\n        ts.setParent(react, ts.getParseTreeNode(parent));\n        return react;\n    }\n    function createJsxFactoryExpressionFromEntityName(factory, jsxFactory, parent) {\n        if (ts.isQualifiedName(jsxFactory)) {\n            var left = createJsxFactoryExpressionFromEntityName(factory, jsxFactory.left, parent);\n            var right = factory.createIdentifier(ts.idText(jsxFactory.right));\n            right.escapedText = jsxFactory.right.escapedText;\n            return factory.createPropertyAccessExpression(left, right);\n        }\n        else {\n            return createReactNamespace(ts.idText(jsxFactory), parent);\n        }\n    }\n    function createJsxFactoryExpression(factory, jsxFactoryEntity, reactNamespace, parent) {\n        return jsxFactoryEntity ?\n            createJsxFactoryExpressionFromEntityName(factory, jsxFactoryEntity, parent) :\n            factory.createPropertyAccessExpression(createReactNamespace(reactNamespace, parent), \"createElement\");\n    }\n    ts.createJsxFactoryExpression = createJsxFactoryExpression;\n    function createJsxFragmentFactoryExpression(factory, jsxFragmentFactoryEntity, reactNamespace, parent) {\n        return jsxFragmentFactoryEntity ?\n            createJsxFactoryExpressionFromEntityName(factory, jsxFragmentFactoryEntity, parent) :\n            factory.createPropertyAccessExpression(createReactNamespace(reactNamespace, parent), \"Fragment\");\n    }\n    function createExpressionForJsxElement(factory, callee, tagName, props, children, location) {\n        var argumentsList = [tagName];\n        if (props) {\n            argumentsList.push(props);\n        }\n        if (children && children.length > 0) {\n            if (!props) {\n                argumentsList.push(factory.createNull());\n            }\n            if (children.length > 1) {\n                for (var _i = 0, children_3 = children; _i < children_3.length; _i++) {\n                    var child = children_3[_i];\n                    startOnNewLine(child);\n                    argumentsList.push(child);\n                }\n            }\n            else {\n                argumentsList.push(children[0]);\n            }\n        }\n        return ts.setTextRange(factory.createCallExpression(callee, \n        /*typeArguments*/ undefined, argumentsList), location);\n    }\n    ts.createExpressionForJsxElement = createExpressionForJsxElement;\n    function createExpressionForJsxFragment(factory, jsxFactoryEntity, jsxFragmentFactoryEntity, reactNamespace, children, parentElement, location) {\n        var tagName = createJsxFragmentFactoryExpression(factory, jsxFragmentFactoryEntity, reactNamespace, parentElement);\n        var argumentsList = [tagName, factory.createNull()];\n        if (children && children.length > 0) {\n            if (children.length > 1) {\n                for (var _i = 0, children_4 = children; _i < children_4.length; _i++) {\n                    var child = children_4[_i];\n                    startOnNewLine(child);\n                    argumentsList.push(child);\n                }\n            }\n            else {\n                argumentsList.push(children[0]);\n            }\n        }\n        return ts.setTextRange(factory.createCallExpression(createJsxFactoryExpression(factory, jsxFactoryEntity, reactNamespace, parentElement), \n        /*typeArguments*/ undefined, argumentsList), location);\n    }\n    ts.createExpressionForJsxFragment = createExpressionForJsxFragment;\n    // Utilities\n    function createForOfBindingStatement(factory, node, boundValue) {\n        if (ts.isVariableDeclarationList(node)) {\n            var firstDeclaration = ts.first(node.declarations);\n            var updatedDeclaration = factory.updateVariableDeclaration(firstDeclaration, firstDeclaration.name, \n            /*exclamationToken*/ undefined, \n            /*type*/ undefined, boundValue);\n            return ts.setTextRange(factory.createVariableStatement(\n            /*modifiers*/ undefined, factory.updateVariableDeclarationList(node, [updatedDeclaration])), \n            /*location*/ node);\n        }\n        else {\n            var updatedExpression = ts.setTextRange(factory.createAssignment(node, boundValue), /*location*/ node);\n            return ts.setTextRange(factory.createExpressionStatement(updatedExpression), /*location*/ node);\n        }\n    }\n    ts.createForOfBindingStatement = createForOfBindingStatement;\n    function insertLeadingStatement(factory, dest, source) {\n        if (ts.isBlock(dest)) {\n            return factory.updateBlock(dest, ts.setTextRange(factory.createNodeArray(__spreadArray([source], dest.statements)), dest.statements));\n        }\n        else {\n            return factory.createBlock(factory.createNodeArray([dest, source]), /*multiLine*/ true);\n        }\n    }\n    ts.insertLeadingStatement = insertLeadingStatement;\n    function createExpressionFromEntityName(factory, node) {\n        if (ts.isQualifiedName(node)) {\n            var left = createExpressionFromEntityName(factory, node.left);\n            // TODO(rbuckton): Does this need to be parented?\n            var right = ts.setParent(ts.setTextRange(factory.cloneNode(node.right), node.right), node.right.parent);\n            return ts.setTextRange(factory.createPropertyAccessExpression(left, right), node);\n        }\n        else {\n            // TODO(rbuckton): Does this need to be parented?\n            return ts.setParent(ts.setTextRange(factory.cloneNode(node), node), node.parent);\n        }\n    }\n    ts.createExpressionFromEntityName = createExpressionFromEntityName;\n    function createExpressionForPropertyName(factory, memberName) {\n        if (ts.isIdentifier(memberName)) {\n            return factory.createStringLiteralFromNode(memberName);\n        }\n        else if (ts.isComputedPropertyName(memberName)) {\n            // TODO(rbuckton): Does this need to be parented?\n            return ts.setParent(ts.setTextRange(factory.cloneNode(memberName.expression), memberName.expression), memberName.expression.parent);\n        }\n        else {\n            // TODO(rbuckton): Does this need to be parented?\n            return ts.setParent(ts.setTextRange(factory.cloneNode(memberName), memberName), memberName.parent);\n        }\n    }\n    ts.createExpressionForPropertyName = createExpressionForPropertyName;\n    function createExpressionForAccessorDeclaration(factory, properties, property, receiver, multiLine) {\n        var _a = ts.getAllAccessorDeclarations(properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor;\n        if (property === firstAccessor) {\n            return ts.setTextRange(factory.createObjectDefinePropertyCall(receiver, createExpressionForPropertyName(factory, property.name), factory.createPropertyDescriptor({\n                enumerable: factory.createFalse(),\n                configurable: true,\n                get: getAccessor && ts.setTextRange(ts.setOriginalNode(factory.createFunctionExpression(getAccessor.modifiers, \n                /*asteriskToken*/ undefined, \n                /*name*/ undefined, \n                /*typeParameters*/ undefined, getAccessor.parameters, \n                /*type*/ undefined, getAccessor.body // TODO: GH#18217\n                ), getAccessor), getAccessor),\n                set: setAccessor && ts.setTextRange(ts.setOriginalNode(factory.createFunctionExpression(setAccessor.modifiers, \n                /*asteriskToken*/ undefined, \n                /*name*/ undefined, \n                /*typeParameters*/ undefined, setAccessor.parameters, \n                /*type*/ undefined, setAccessor.body // TODO: GH#18217\n                ), setAccessor), setAccessor)\n            }, !multiLine)), firstAccessor);\n        }\n        return undefined;\n    }\n    function createExpressionForPropertyAssignment(factory, property, receiver) {\n        return ts.setOriginalNode(ts.setTextRange(factory.createAssignment(createMemberAccessForPropertyName(factory, receiver, property.name, /*location*/ property.name), property.initializer), property), property);\n    }\n    function createExpressionForShorthandPropertyAssignment(factory, property, receiver) {\n        return ts.setOriginalNode(ts.setTextRange(factory.createAssignment(createMemberAccessForPropertyName(factory, receiver, property.name, /*location*/ property.name), factory.cloneNode(property.name)), \n        /*location*/ property), \n        /*original*/ property);\n    }\n    function createExpressionForMethodDeclaration(factory, method, receiver) {\n        return ts.setOriginalNode(ts.setTextRange(factory.createAssignment(createMemberAccessForPropertyName(factory, receiver, method.name, /*location*/ method.name), ts.setOriginalNode(ts.setTextRange(factory.createFunctionExpression(method.modifiers, method.asteriskToken, \n        /*name*/ undefined, \n        /*typeParameters*/ undefined, method.parameters, \n        /*type*/ undefined, method.body // TODO: GH#18217\n        ), \n        /*location*/ method), \n        /*original*/ method)), \n        /*location*/ method), \n        /*original*/ method);\n    }\n    function createExpressionForObjectLiteralElementLike(factory, node, property, receiver) {\n        if (property.name && ts.isPrivateIdentifier(property.name)) {\n            ts.Debug.failBadSyntaxKind(property.name, \"Private identifiers are not allowed in object literals.\");\n        }\n        switch (property.kind) {\n            case 167 /* GetAccessor */:\n            case 168 /* SetAccessor */:\n                return createExpressionForAccessorDeclaration(factory, node.properties, property, receiver, !!node.multiLine);\n            case 288 /* PropertyAssignment */:\n                return createExpressionForPropertyAssignment(factory, property, receiver);\n            case 289 /* ShorthandPropertyAssignment */:\n                return createExpressionForShorthandPropertyAssignment(factory, property, receiver);\n            case 165 /* MethodDeclaration */:\n                return createExpressionForMethodDeclaration(factory, property, receiver);\n        }\n    }\n    ts.createExpressionForObjectLiteralElementLike = createExpressionForObjectLiteralElementLike;\n    /**\n     * Gets whether an identifier should only be referred to by its internal name.\n     */\n    function isInternalName(node) {\n        return (ts.getEmitFlags(node) & 32768 /* InternalName */) !== 0;\n    }\n    ts.isInternalName = isInternalName;\n    /**\n     * Gets whether an identifier should only be referred to by its local name.\n     */\n    function isLocalName(node) {\n        return (ts.getEmitFlags(node) & 16384 /* LocalName */) !== 0;\n    }\n    ts.isLocalName = isLocalName;\n    /**\n     * Gets whether an identifier should only be referred to by its export representation if the\n     * name points to an exported symbol.\n     */\n    function isExportName(node) {\n        return (ts.getEmitFlags(node) & 8192 /* ExportName */) !== 0;\n    }\n    ts.isExportName = isExportName;\n    function isUseStrictPrologue(node) {\n        return ts.isStringLiteral(node.expression) && node.expression.text === \"use strict\";\n    }\n    function findUseStrictPrologue(statements) {\n        for (var _i = 0, statements_1 = statements; _i < statements_1.length; _i++) {\n            var statement = statements_1[_i];\n            if (ts.isPrologueDirective(statement)) {\n                if (isUseStrictPrologue(statement)) {\n                    return statement;\n                }\n            }\n            else {\n                break;\n            }\n        }\n        return undefined;\n    }\n    ts.findUseStrictPrologue = findUseStrictPrologue;\n    function startsWithUseStrict(statements) {\n        var firstStatement = ts.firstOrUndefined(statements);\n        return firstStatement !== undefined\n            && ts.isPrologueDirective(firstStatement)\n            && isUseStrictPrologue(firstStatement);\n    }\n    ts.startsWithUseStrict = startsWithUseStrict;\n    function isCommaSequence(node) {\n        return node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ ||\n            node.kind === 337 /* CommaListExpression */;\n    }\n    ts.isCommaSequence = isCommaSequence;\n    function isOuterExpression(node, kinds) {\n        if (kinds === void 0) { kinds = 15 /* All */; }\n        switch (node.kind) {\n            case 207 /* ParenthesizedExpression */:\n                return (kinds & 1 /* Parentheses */) !== 0;\n            case 206 /* TypeAssertionExpression */:\n            case 224 /* AsExpression */:\n                return (kinds & 2 /* TypeAssertions */) !== 0;\n            case 225 /* NonNullExpression */:\n                return (kinds & 4 /* NonNullAssertions */) !== 0;\n            case 336 /* PartiallyEmittedExpression */:\n                return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;\n        }\n        return false;\n    }\n    ts.isOuterExpression = isOuterExpression;\n    function skipOuterExpressions(node, kinds) {\n        if (kinds === void 0) { kinds = 15 /* All */; }\n        while (isOuterExpression(node, kinds)) {\n            node = node.expression;\n        }\n        return node;\n    }\n    ts.skipOuterExpressions = skipOuterExpressions;\n    function skipAssertions(node) {\n        return skipOuterExpressions(node, 6 /* Assertions */);\n    }\n    ts.skipAssertions = skipAssertions;\n    function startOnNewLine(node) {\n        return ts.setStartsOnNewLine(node, /*newLine*/ true);\n    }\n    ts.startOnNewLine = startOnNewLine;\n    function getExternalHelpersModuleName(node) {\n        var parseNode = ts.getOriginalNode(node, ts.isSourceFile);\n        var emitNode = parseNode && parseNode.emitNode;\n        return emitNode && emitNode.externalHelpersModuleName;\n    }\n    ts.getExternalHelpersModuleName = getExternalHelpersModuleName;\n    function hasRecordedExternalHelpers(sourceFile) {\n        var parseNode = ts.getOriginalNode(sourceFile, ts.isSourceFile);\n        var emitNode = parseNode && parseNode.emitNode;\n        return !!emitNode && (!!emitNode.externalHelpersModuleName || !!emitNode.externalHelpers);\n    }\n    ts.hasRecordedExternalHelpers = hasRecordedExternalHelpers;\n    function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFactory, sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar, hasImportDefault) {\n        if (compilerOptions.importHelpers && ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {\n            var namedBindings = void 0;\n            var moduleKind = ts.getEmitModuleKind(compilerOptions);\n            if (moduleKind >= ts.ModuleKind.ES2015 && moduleKind <= ts.ModuleKind.ESNext) {\n                // use named imports\n                var helpers = ts.getEmitHelpers(sourceFile);\n                if (helpers) {\n                    var helperNames = [];\n                    for (var _i = 0, helpers_3 = helpers; _i < helpers_3.length; _i++) {\n                        var helper = helpers_3[_i];\n                        if (!helper.scoped) {\n                            var importName = helper.importName;\n                            if (importName) {\n                                ts.pushIfUnique(helperNames, importName);\n                            }\n                        }\n                    }\n                    if (ts.some(helperNames)) {\n                        helperNames.sort(ts.compareStringsCaseSensitive);\n                        // Alias the imports if the names are used somewhere in the file.\n                        // NOTE: We don't need to care about global import collisions as this is a module.\n                        namedBindings = nodeFactory.createNamedImports(ts.map(helperNames, function (name) { return ts.isFileLevelUniqueName(sourceFile, name)\n                            ? nodeFactory.createImportSpecifier(/*propertyName*/ undefined, nodeFactory.createIdentifier(name))\n                            : nodeFactory.createImportSpecifier(nodeFactory.createIdentifier(name), helperFactory.getUnscopedHelperName(name)); }));\n                        var parseNode = ts.getOriginalNode(sourceFile, ts.isSourceFile);\n                        var emitNode = ts.getOrCreateEmitNode(parseNode);\n                        emitNode.externalHelpers = true;\n                    }\n                }\n            }\n            else {\n                // use a namespace import\n                var externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(nodeFactory, sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar || hasImportDefault);\n                if (externalHelpersModuleName) {\n                    namedBindings = nodeFactory.createNamespaceImport(externalHelpersModuleName);\n                }\n            }\n            if (namedBindings) {\n                var externalHelpersImportDeclaration = nodeFactory.createImportDeclaration(\n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, nodeFactory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, namedBindings), nodeFactory.createStringLiteral(ts.externalHelpersModuleNameText));\n                ts.addEmitFlags(externalHelpersImportDeclaration, 67108864 /* NeverApplyImportHelper */);\n                return externalHelpersImportDeclaration;\n            }\n        }\n    }\n    ts.createExternalHelpersImportDeclarationIfNeeded = createExternalHelpersImportDeclarationIfNeeded;\n    function getOrCreateExternalHelpersModuleNameIfNeeded(factory, node, compilerOptions, hasExportStarsToExportValues, hasImportStarOrImportDefault) {\n        if (compilerOptions.importHelpers && ts.isEffectiveExternalModule(node, compilerOptions)) {\n            var externalHelpersModuleName = getExternalHelpersModuleName(node);\n            if (externalHelpersModuleName) {\n                return externalHelpersModuleName;\n            }\n            var moduleKind = ts.getEmitModuleKind(compilerOptions);\n            var create = (hasExportStarsToExportValues || (compilerOptions.esModuleInterop && hasImportStarOrImportDefault))\n                && moduleKind !== ts.ModuleKind.System\n                && moduleKind < ts.ModuleKind.ES2015;\n            if (!create) {\n                var helpers = ts.getEmitHelpers(node);\n                if (helpers) {\n                    for (var _i = 0, helpers_4 = helpers; _i < helpers_4.length; _i++) {\n                        var helper = helpers_4[_i];\n                        if (!helper.scoped) {\n                            create = true;\n                            break;\n                        }\n                    }\n                }\n            }\n            if (create) {\n                var parseNode = ts.getOriginalNode(node, ts.isSourceFile);\n                var emitNode = ts.getOrCreateEmitNode(parseNode);\n                return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = factory.createUniqueName(ts.externalHelpersModuleNameText));\n            }\n        }\n    }\n    ts.getOrCreateExternalHelpersModuleNameIfNeeded = getOrCreateExternalHelpersModuleNameIfNeeded;\n    /**\n     * Get the name of that target module from an import or export declaration\n     */\n    function getLocalNameForExternalImport(factory, node, sourceFile) {\n        var namespaceDeclaration = ts.getNamespaceDeclarationNode(node);\n        if (namespaceDeclaration && !ts.isDefaultImport(node) && !ts.isExportNamespaceAsDefaultDeclaration(node)) {\n            var name = namespaceDeclaration.name;\n            return ts.isGeneratedIdentifier(name) ? name : factory.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name));\n        }\n        if (node.kind === 261 /* ImportDeclaration */ && node.importClause) {\n            return factory.getGeneratedNameForNode(node);\n        }\n        if (node.kind === 267 /* ExportDeclaration */ && node.moduleSpecifier) {\n            return factory.getGeneratedNameForNode(node);\n        }\n        return undefined;\n    }\n    ts.getLocalNameForExternalImport = getLocalNameForExternalImport;\n    /**\n     * Get the name of a target module from an import/export declaration as should be written in the emitted output.\n     * The emitted output name can be different from the input if:\n     *  1. The module has a /// <amd-module name=\"<new name>\" />\n     *  2. --out or --outFile is used, making the name relative to the rootDir\n     *  3- The containing SourceFile has an entry in renamedDependencies for the import as requested by some module loaders (e.g. System).\n     * Otherwise, a new StringLiteral node representing the module name will be returned.\n     */\n    function getExternalModuleNameLiteral(factory, importNode, sourceFile, host, resolver, compilerOptions) {\n        var moduleName = ts.getExternalModuleName(importNode);\n        if (moduleName && ts.isStringLiteral(moduleName)) {\n            return tryGetModuleNameFromDeclaration(importNode, host, factory, resolver, compilerOptions)\n                || tryRenameExternalModule(factory, moduleName, sourceFile)\n                || factory.cloneNode(moduleName);\n        }\n        return undefined;\n    }\n    ts.getExternalModuleNameLiteral = getExternalModuleNameLiteral;\n    /**\n     * Some bundlers (SystemJS builder) sometimes want to rename dependencies.\n     * Here we check if alternative name was provided for a given moduleName and return it if possible.\n     */\n    function tryRenameExternalModule(factory, moduleName, sourceFile) {\n        var rename = sourceFile.renamedDependencies && sourceFile.renamedDependencies.get(moduleName.text);\n        return rename ? factory.createStringLiteral(rename) : undefined;\n    }\n    /**\n     * Get the name of a module as should be written in the emitted output.\n     * The emitted output name can be different from the input if:\n     *  1. The module has a /// <amd-module name=\"<new name>\" />\n     *  2. --out or --outFile is used, making the name relative to the rootDir\n     * Otherwise, a new StringLiteral node representing the module name will be returned.\n     */\n    function tryGetModuleNameFromFile(factory, file, host, options) {\n        if (!file) {\n            return undefined;\n        }\n        if (file.moduleName) {\n            return factory.createStringLiteral(file.moduleName);\n        }\n        if (!file.isDeclarationFile && ts.outFile(options)) {\n            return factory.createStringLiteral(ts.getExternalModuleNameFromPath(host, file.fileName));\n        }\n        return undefined;\n    }\n    ts.tryGetModuleNameFromFile = tryGetModuleNameFromFile;\n    function tryGetModuleNameFromDeclaration(declaration, host, factory, resolver, compilerOptions) {\n        return tryGetModuleNameFromFile(factory, resolver.getExternalModuleFileFromDeclaration(declaration), host, compilerOptions);\n    }\n    /**\n     * Gets the initializer of an BindingOrAssignmentElement.\n     */\n    function getInitializerOfBindingOrAssignmentElement(bindingElement) {\n        if (ts.isDeclarationBindingElement(bindingElement)) {\n            // `1` in `let { a = 1 } = ...`\n            // `1` in `let { a: b = 1 } = ...`\n            // `1` in `let { a: {b} = 1 } = ...`\n            // `1` in `let { a: [b] = 1 } = ...`\n            // `1` in `let [a = 1] = ...`\n            // `1` in `let [{a} = 1] = ...`\n            // `1` in `let [[a] = 1] = ...`\n            return bindingElement.initializer;\n        }\n        if (ts.isPropertyAssignment(bindingElement)) {\n            // `1` in `({ a: b = 1 } = ...)`\n            // `1` in `({ a: {b} = 1 } = ...)`\n            // `1` in `({ a: [b] = 1 } = ...)`\n            var initializer = bindingElement.initializer;\n            return ts.isAssignmentExpression(initializer, /*excludeCompoundAssignment*/ true)\n                ? initializer.right\n                : undefined;\n        }\n        if (ts.isShorthandPropertyAssignment(bindingElement)) {\n            // `1` in `({ a = 1 } = ...)`\n            return bindingElement.objectAssignmentInitializer;\n        }\n        if (ts.isAssignmentExpression(bindingElement, /*excludeCompoundAssignment*/ true)) {\n            // `1` in `[a = 1] = ...`\n            // `1` in `[{a} = 1] = ...`\n            // `1` in `[[a] = 1] = ...`\n            return bindingElement.right;\n        }\n        if (ts.isSpreadElement(bindingElement)) {\n            // Recovery consistent with existing emit.\n            return getInitializerOfBindingOrAssignmentElement(bindingElement.expression);\n        }\n    }\n    ts.getInitializerOfBindingOrAssignmentElement = getInitializerOfBindingOrAssignmentElement;\n    /**\n     * Gets the name of an BindingOrAssignmentElement.\n     */\n    function getTargetOfBindingOrAssignmentElement(bindingElement) {\n        if (ts.isDeclarationBindingElement(bindingElement)) {\n            // `a` in `let { a } = ...`\n            // `a` in `let { a = 1 } = ...`\n            // `b` in `let { a: b } = ...`\n            // `b` in `let { a: b = 1 } = ...`\n            // `a` in `let { ...a } = ...`\n            // `{b}` in `let { a: {b} } = ...`\n            // `{b}` in `let { a: {b} = 1 } = ...`\n            // `[b]` in `let { a: [b] } = ...`\n            // `[b]` in `let { a: [b] = 1 } = ...`\n            // `a` in `let [a] = ...`\n            // `a` in `let [a = 1] = ...`\n            // `a` in `let [...a] = ...`\n            // `{a}` in `let [{a}] = ...`\n            // `{a}` in `let [{a} = 1] = ...`\n            // `[a]` in `let [[a]] = ...`\n            // `[a]` in `let [[a] = 1] = ...`\n            return bindingElement.name;\n        }\n        if (ts.isObjectLiteralElementLike(bindingElement)) {\n            switch (bindingElement.kind) {\n                case 288 /* PropertyAssignment */:\n                    // `b` in `({ a: b } = ...)`\n                    // `b` in `({ a: b = 1 } = ...)`\n                    // `{b}` in `({ a: {b} } = ...)`\n                    // `{b}` in `({ a: {b} = 1 } = ...)`\n                    // `[b]` in `({ a: [b] } = ...)`\n                    // `[b]` in `({ a: [b] = 1 } = ...)`\n                    // `b.c` in `({ a: b.c } = ...)`\n                    // `b.c` in `({ a: b.c = 1 } = ...)`\n                    // `b[0]` in `({ a: b[0] } = ...)`\n                    // `b[0]` in `({ a: b[0] = 1 } = ...)`\n                    return getTargetOfBindingOrAssignmentElement(bindingElement.initializer);\n                case 289 /* ShorthandPropertyAssignment */:\n                    // `a` in `({ a } = ...)`\n                    // `a` in `({ a = 1 } = ...)`\n                    return bindingElement.name;\n                case 290 /* SpreadAssignment */:\n                    // `a` in `({ ...a } = ...)`\n                    return getTargetOfBindingOrAssignmentElement(bindingElement.expression);\n            }\n            // no target\n            return undefined;\n        }\n        if (ts.isAssignmentExpression(bindingElement, /*excludeCompoundAssignment*/ true)) {\n            // `a` in `[a = 1] = ...`\n            // `{a}` in `[{a} = 1] = ...`\n            // `[a]` in `[[a] = 1] = ...`\n            // `a.b` in `[a.b = 1] = ...`\n            // `a[0]` in `[a[0] = 1] = ...`\n            return getTargetOfBindingOrAssignmentElement(bindingElement.left);\n        }\n        if (ts.isSpreadElement(bindingElement)) {\n            // `a` in `[...a] = ...`\n            return getTargetOfBindingOrAssignmentElement(bindingElement.expression);\n        }\n        // `a` in `[a] = ...`\n        // `{a}` in `[{a}] = ...`\n        // `[a]` in `[[a]] = ...`\n        // `a.b` in `[a.b] = ...`\n        // `a[0]` in `[a[0]] = ...`\n        return bindingElement;\n    }\n    ts.getTargetOfBindingOrAssignmentElement = getTargetOfBindingOrAssignmentElement;\n    /**\n     * Determines whether an BindingOrAssignmentElement is a rest element.\n     */\n    function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) {\n        switch (bindingElement.kind) {\n            case 160 /* Parameter */:\n            case 198 /* BindingElement */:\n                // `...` in `let [...a] = ...`\n                return bindingElement.dotDotDotToken;\n            case 220 /* SpreadElement */:\n            case 290 /* SpreadAssignment */:\n                // `...` in `[...a] = ...`\n                return bindingElement;\n        }\n        return undefined;\n    }\n    ts.getRestIndicatorOfBindingOrAssignmentElement = getRestIndicatorOfBindingOrAssignmentElement;\n    /**\n     * Gets the property name of a BindingOrAssignmentElement\n     */\n    function getPropertyNameOfBindingOrAssignmentElement(bindingElement) {\n        var propertyName = tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement);\n        ts.Debug.assert(!!propertyName || ts.isSpreadAssignment(bindingElement), \"Invalid property name for binding element.\");\n        return propertyName;\n    }\n    ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement;\n    function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) {\n        switch (bindingElement.kind) {\n            case 198 /* BindingElement */:\n                // `a` in `let { a: b } = ...`\n                // `[a]` in `let { [a]: b } = ...`\n                // `\"a\"` in `let { \"a\": b } = ...`\n                // `1` in `let { 1: b } = ...`\n                if (bindingElement.propertyName) {\n                    var propertyName = bindingElement.propertyName;\n                    if (ts.isPrivateIdentifier(propertyName)) {\n                        return ts.Debug.failBadSyntaxKind(propertyName);\n                    }\n                    return ts.isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression)\n                        ? propertyName.expression\n                        : propertyName;\n                }\n                break;\n            case 288 /* PropertyAssignment */:\n                // `a` in `({ a: b } = ...)`\n                // `[a]` in `({ [a]: b } = ...)`\n                // `\"a\"` in `({ \"a\": b } = ...)`\n                // `1` in `({ 1: b } = ...)`\n                if (bindingElement.name) {\n                    var propertyName = bindingElement.name;\n                    if (ts.isPrivateIdentifier(propertyName)) {\n                        return ts.Debug.failBadSyntaxKind(propertyName);\n                    }\n                    return ts.isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression)\n                        ? propertyName.expression\n                        : propertyName;\n                }\n                break;\n            case 290 /* SpreadAssignment */:\n                // `a` in `({ ...a } = ...)`\n                if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) {\n                    return ts.Debug.failBadSyntaxKind(bindingElement.name);\n                }\n                return bindingElement.name;\n        }\n        var target = getTargetOfBindingOrAssignmentElement(bindingElement);\n        if (target && ts.isPropertyName(target)) {\n            return target;\n        }\n    }\n    ts.tryGetPropertyNameOfBindingOrAssignmentElement = tryGetPropertyNameOfBindingOrAssignmentElement;\n    function isStringOrNumericLiteral(node) {\n        var kind = node.kind;\n        return kind === 10 /* StringLiteral */\n            || kind === 8 /* NumericLiteral */;\n    }\n    /**\n     * Gets the elements of a BindingOrAssignmentPattern\n     */\n    function getElementsOfBindingOrAssignmentPattern(name) {\n        switch (name.kind) {\n            case 196 /* ObjectBindingPattern */:\n            case 197 /* ArrayBindingPattern */:\n            case 199 /* ArrayLiteralExpression */:\n                // `a` in `{a}`\n                // `a` in `[a]`\n                return name.elements;\n            case 200 /* ObjectLiteralExpression */:\n                // `a` in `{a}`\n                return name.properties;\n        }\n    }\n    ts.getElementsOfBindingOrAssignmentPattern = getElementsOfBindingOrAssignmentPattern;\n    /* @internal */\n    function getJSDocTypeAliasName(fullName) {\n        if (fullName) {\n            var rightNode = fullName;\n            while (true) {\n                if (ts.isIdentifier(rightNode) || !rightNode.body) {\n                    return ts.isIdentifier(rightNode) ? rightNode : rightNode.name;\n                }\n                rightNode = rightNode.body;\n            }\n        }\n    }\n    ts.getJSDocTypeAliasName = getJSDocTypeAliasName;\n    function canHaveModifiers(node) {\n        var kind = node.kind;\n        return kind === 160 /* Parameter */\n            || kind === 162 /* PropertySignature */\n            || kind === 163 /* PropertyDeclaration */\n            || kind === 164 /* MethodSignature */\n            || kind === 165 /* MethodDeclaration */\n            || kind === 166 /* Constructor */\n            || kind === 167 /* GetAccessor */\n            || kind === 168 /* SetAccessor */\n            || kind === 171 /* IndexSignature */\n            || kind === 208 /* FunctionExpression */\n            || kind === 209 /* ArrowFunction */\n            || kind === 221 /* ClassExpression */\n            || kind === 232 /* VariableStatement */\n            || kind === 251 /* FunctionDeclaration */\n            || kind === 252 /* ClassDeclaration */\n            || kind === 253 /* InterfaceDeclaration */\n            || kind === 254 /* TypeAliasDeclaration */\n            || kind === 255 /* EnumDeclaration */\n            || kind === 256 /* ModuleDeclaration */\n            || kind === 260 /* ImportEqualsDeclaration */\n            || kind === 261 /* ImportDeclaration */\n            || kind === 266 /* ExportAssignment */\n            || kind === 267 /* ExportDeclaration */;\n    }\n    ts.canHaveModifiers = canHaveModifiers;\n    /* @internal */\n    function isExportModifier(node) {\n        return node.kind === 92 /* ExportKeyword */;\n    }\n    ts.isExportModifier = isExportModifier;\n    /* @internal */\n    function isAsyncModifier(node) {\n        return node.kind === 129 /* AsyncKeyword */;\n    }\n    ts.isAsyncModifier = isAsyncModifier;\n    /* @internal */\n    function isStaticModifier(node) {\n        return node.kind === 123 /* StaticKeyword */;\n    }\n    ts.isStaticModifier = isStaticModifier;\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    function setTextRange(range, location) {\n        return location ? ts.setTextRangePosEnd(range, location.pos, location.end) : range;\n    }\n    ts.setTextRange = setTextRange;\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    var SignatureFlags;\n    (function (SignatureFlags) {\n        SignatureFlags[SignatureFlags[\"None\"] = 0] = \"None\";\n        SignatureFlags[SignatureFlags[\"Yield\"] = 1] = \"Yield\";\n        SignatureFlags[SignatureFlags[\"Await\"] = 2] = \"Await\";\n        SignatureFlags[SignatureFlags[\"Type\"] = 4] = \"Type\";\n        SignatureFlags[SignatureFlags[\"IgnoreMissingOpenBrace\"] = 16] = \"IgnoreMissingOpenBrace\";\n        SignatureFlags[SignatureFlags[\"JSDoc\"] = 32] = \"JSDoc\";\n    })(SignatureFlags || (SignatureFlags = {}));\n    var SpeculationKind;\n    (function (SpeculationKind) {\n        SpeculationKind[SpeculationKind[\"TryParse\"] = 0] = \"TryParse\";\n        SpeculationKind[SpeculationKind[\"Lookahead\"] = 1] = \"Lookahead\";\n        SpeculationKind[SpeculationKind[\"Reparse\"] = 2] = \"Reparse\";\n    })(SpeculationKind || (SpeculationKind = {}));\n    var NodeConstructor;\n    var TokenConstructor;\n    var IdentifierConstructor;\n    var PrivateIdentifierConstructor;\n    var SourceFileConstructor;\n    /**\n     * NOTE: You should not use this, it is only exported to support `createNode` in `~/src/deprecatedCompat/deprecations.ts`.\n     */\n    /* @internal */\n    ts.parseBaseNodeFactory = {\n        createBaseSourceFileNode: function (kind) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, -1, -1); },\n        createBaseIdentifierNode: function (kind) { return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, -1, -1); },\n        createBasePrivateIdentifierNode: function (kind) { return new (PrivateIdentifierConstructor || (PrivateIdentifierConstructor = ts.objectAllocator.getPrivateIdentifierConstructor()))(kind, -1, -1); },\n        createBaseTokenNode: function (kind) { return new (TokenConstructor || (TokenConstructor = ts.objectAllocator.getTokenConstructor()))(kind, -1, -1); },\n        createBaseNode: function (kind) { return new (NodeConstructor || (NodeConstructor = ts.objectAllocator.getNodeConstructor()))(kind, -1, -1); },\n    };\n    /* @internal */\n    ts.parseNodeFactory = ts.createNodeFactory(1 /* NoParenthesizerRules */, ts.parseBaseNodeFactory);\n    function visitNode(cbNode, node) {\n        return node && cbNode(node);\n    }\n    function visitNodes(cbNode, cbNodes, nodes) {\n        if (nodes) {\n            if (cbNodes) {\n                return cbNodes(nodes);\n            }\n            for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {\n                var node = nodes_1[_i];\n                var result = cbNode(node);\n                if (result) {\n                    return result;\n                }\n            }\n        }\n    }\n    /*@internal*/\n    function isJSDocLikeText(text, start) {\n        return text.charCodeAt(start + 1) === 42 /* asterisk */ &&\n            text.charCodeAt(start + 2) === 42 /* asterisk */ &&\n            text.charCodeAt(start + 3) !== 47 /* slash */;\n    }\n    ts.isJSDocLikeText = isJSDocLikeText;\n    /**\n     * Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes\n     * stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise,\n     * embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns\n     * a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned.\n     *\n     * @param node a given node to visit its children\n     * @param cbNode a callback to be invoked for all child nodes\n     * @param cbNodes a callback to be invoked for embedded array\n     *\n     * @remarks `forEachChild` must visit the children of a node in the order\n     * that they appear in the source code. The language service depends on this property to locate nodes by position.\n     */\n    function forEachChild(node, cbNode, cbNodes) {\n        if (!node || node.kind <= 156 /* LastToken */) {\n            return;\n        }\n        switch (node.kind) {\n            case 157 /* QualifiedName */:\n                return visitNode(cbNode, node.left) ||\n                    visitNode(cbNode, node.right);\n            case 159 /* TypeParameter */:\n                return visitNode(cbNode, node.name) ||\n                    visitNode(cbNode, node.constraint) ||\n                    visitNode(cbNode, node.default) ||\n                    visitNode(cbNode, node.expression);\n            case 289 /* ShorthandPropertyAssignment */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.name) ||\n                    visitNode(cbNode, node.questionToken) ||\n                    visitNode(cbNode, node.exclamationToken) ||\n                    visitNode(cbNode, node.equalsToken) ||\n                    visitNode(cbNode, node.objectAssignmentInitializer);\n            case 290 /* SpreadAssignment */:\n                return visitNode(cbNode, node.expression);\n            case 160 /* Parameter */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.dotDotDotToken) ||\n                    visitNode(cbNode, node.name) ||\n                    visitNode(cbNode, node.questionToken) ||\n                    visitNode(cbNode, node.type) ||\n                    visitNode(cbNode, node.initializer);\n            case 163 /* PropertyDeclaration */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.name) ||\n                    visitNode(cbNode, node.questionToken) ||\n                    visitNode(cbNode, node.exclamationToken) ||\n                    visitNode(cbNode, node.type) ||\n                    visitNode(cbNode, node.initializer);\n            case 162 /* PropertySignature */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.name) ||\n                    visitNode(cbNode, node.questionToken) ||\n                    visitNode(cbNode, node.type) ||\n                    visitNode(cbNode, node.initializer);\n            case 288 /* PropertyAssignment */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.name) ||\n                    visitNode(cbNode, node.questionToken) ||\n                    visitNode(cbNode, node.initializer);\n            case 249 /* VariableDeclaration */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.name) ||\n                    visitNode(cbNode, node.exclamationToken) ||\n                    visitNode(cbNode, node.type) ||\n                    visitNode(cbNode, node.initializer);\n            case 198 /* BindingElement */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.dotDotDotToken) ||\n                    visitNode(cbNode, node.propertyName) ||\n                    visitNode(cbNode, node.name) ||\n                    visitNode(cbNode, node.initializer);\n            case 174 /* FunctionType */:\n            case 175 /* ConstructorType */:\n            case 169 /* CallSignature */:\n            case 170 /* ConstructSignature */:\n            case 171 /* IndexSignature */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNodes(cbNode, cbNodes, node.typeParameters) ||\n                    visitNodes(cbNode, cbNodes, node.parameters) ||\n                    visitNode(cbNode, node.type);\n            case 165 /* MethodDeclaration */:\n            case 164 /* MethodSignature */:\n            case 166 /* Constructor */:\n            case 167 /* GetAccessor */:\n            case 168 /* SetAccessor */:\n            case 208 /* FunctionExpression */:\n            case 251 /* FunctionDeclaration */:\n            case 209 /* ArrowFunction */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.asteriskToken) ||\n                    visitNode(cbNode, node.name) ||\n                    visitNode(cbNode, node.questionToken) ||\n                    visitNode(cbNode, node.exclamationToken) ||\n                    visitNodes(cbNode, cbNodes, node.typeParameters) ||\n                    visitNodes(cbNode, cbNodes, node.parameters) ||\n                    visitNode(cbNode, node.type) ||\n                    visitNode(cbNode, node.equalsGreaterThanToken) ||\n                    visitNode(cbNode, node.body);\n            case 173 /* TypeReference */:\n                return visitNode(cbNode, node.typeName) ||\n                    visitNodes(cbNode, cbNodes, node.typeArguments);\n            case 172 /* TypePredicate */:\n                return visitNode(cbNode, node.assertsModifier) ||\n                    visitNode(cbNode, node.parameterName) ||\n                    visitNode(cbNode, node.type);\n            case 176 /* TypeQuery */:\n                return visitNode(cbNode, node.exprName);\n            case 177 /* TypeLiteral */:\n                return visitNodes(cbNode, cbNodes, node.members);\n            case 178 /* ArrayType */:\n                return visitNode(cbNode, node.elementType);\n            case 179 /* TupleType */:\n                return visitNodes(cbNode, cbNodes, node.elements);\n            case 182 /* UnionType */:\n            case 183 /* IntersectionType */:\n                return visitNodes(cbNode, cbNodes, node.types);\n            case 184 /* ConditionalType */:\n                return visitNode(cbNode, node.checkType) ||\n                    visitNode(cbNode, node.extendsType) ||\n                    visitNode(cbNode, node.trueType) ||\n                    visitNode(cbNode, node.falseType);\n            case 185 /* InferType */:\n                return visitNode(cbNode, node.typeParameter);\n            case 195 /* ImportType */:\n                return visitNode(cbNode, node.argument) ||\n                    visitNode(cbNode, node.qualifier) ||\n                    visitNodes(cbNode, cbNodes, node.typeArguments);\n            case 186 /* ParenthesizedType */:\n            case 188 /* TypeOperator */:\n                return visitNode(cbNode, node.type);\n            case 189 /* IndexedAccessType */:\n                return visitNode(cbNode, node.objectType) ||\n                    visitNode(cbNode, node.indexType);\n            case 190 /* MappedType */:\n                return visitNode(cbNode, node.readonlyToken) ||\n                    visitNode(cbNode, node.typeParameter) ||\n                    visitNode(cbNode, node.nameType) ||\n                    visitNode(cbNode, node.questionToken) ||\n                    visitNode(cbNode, node.type);\n            case 191 /* LiteralType */:\n                return visitNode(cbNode, node.literal);\n            case 192 /* NamedTupleMember */:\n                return visitNode(cbNode, node.dotDotDotToken) ||\n                    visitNode(cbNode, node.name) ||\n                    visitNode(cbNode, node.questionToken) ||\n                    visitNode(cbNode, node.type);\n            case 196 /* ObjectBindingPattern */:\n            case 197 /* ArrayBindingPattern */:\n                return visitNodes(cbNode, cbNodes, node.elements);\n            case 199 /* ArrayLiteralExpression */:\n                return visitNodes(cbNode, cbNodes, node.elements);\n            case 200 /* ObjectLiteralExpression */:\n                return visitNodes(cbNode, cbNodes, node.properties);\n            case 201 /* PropertyAccessExpression */:\n                return visitNode(cbNode, node.expression) ||\n                    visitNode(cbNode, node.questionDotToken) ||\n                    visitNode(cbNode, node.name);\n            case 202 /* ElementAccessExpression */:\n                return visitNode(cbNode, node.expression) ||\n                    visitNode(cbNode, node.questionDotToken) ||\n                    visitNode(cbNode, node.argumentExpression);\n            case 203 /* CallExpression */:\n            case 204 /* NewExpression */:\n                return visitNode(cbNode, node.expression) ||\n                    visitNode(cbNode, node.questionDotToken) ||\n                    visitNodes(cbNode, cbNodes, node.typeArguments) ||\n                    visitNodes(cbNode, cbNodes, node.arguments);\n            case 205 /* TaggedTemplateExpression */:\n                return visitNode(cbNode, node.tag) ||\n                    visitNode(cbNode, node.questionDotToken) ||\n                    visitNodes(cbNode, cbNodes, node.typeArguments) ||\n                    visitNode(cbNode, node.template);\n            case 206 /* TypeAssertionExpression */:\n                return visitNode(cbNode, node.type) ||\n                    visitNode(cbNode, node.expression);\n            case 207 /* ParenthesizedExpression */:\n                return visitNode(cbNode, node.expression);\n            case 210 /* DeleteExpression */:\n                return visitNode(cbNode, node.expression);\n            case 211 /* TypeOfExpression */:\n                return visitNode(cbNode, node.expression);\n            case 212 /* VoidExpression */:\n                return visitNode(cbNode, node.expression);\n            case 214 /* PrefixUnaryExpression */:\n                return visitNode(cbNode, node.operand);\n            case 219 /* YieldExpression */:\n                return visitNode(cbNode, node.asteriskToken) ||\n                    visitNode(cbNode, node.expression);\n            case 213 /* AwaitExpression */:\n                return visitNode(cbNode, node.expression);\n            case 215 /* PostfixUnaryExpression */:\n                return visitNode(cbNode, node.operand);\n            case 216 /* BinaryExpression */:\n                return visitNode(cbNode, node.left) ||\n                    visitNode(cbNode, node.operatorToken) ||\n                    visitNode(cbNode, node.right);\n            case 224 /* AsExpression */:\n                return visitNode(cbNode, node.expression) ||\n                    visitNode(cbNode, node.type);\n            case 225 /* NonNullExpression */:\n                return visitNode(cbNode, node.expression);\n            case 226 /* MetaProperty */:\n                return visitNode(cbNode, node.name);\n            case 217 /* ConditionalExpression */:\n                return visitNode(cbNode, node.condition) ||\n                    visitNode(cbNode, node.questionToken) ||\n                    visitNode(cbNode, node.whenTrue) ||\n                    visitNode(cbNode, node.colonToken) ||\n                    visitNode(cbNode, node.whenFalse);\n            case 220 /* SpreadElement */:\n                return visitNode(cbNode, node.expression);\n            case 230 /* Block */:\n            case 257 /* ModuleBlock */:\n                return visitNodes(cbNode, cbNodes, node.statements);\n            case 297 /* SourceFile */:\n                return visitNodes(cbNode, cbNodes, node.statements) ||\n                    visitNode(cbNode, node.endOfFileToken);\n            case 232 /* VariableStatement */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.declarationList);\n            case 250 /* VariableDeclarationList */:\n                return visitNodes(cbNode, cbNodes, node.declarations);\n            case 233 /* ExpressionStatement */:\n                return visitNode(cbNode, node.expression);\n            case 234 /* IfStatement */:\n                return visitNode(cbNode, node.expression) ||\n                    visitNode(cbNode, node.thenStatement) ||\n                    visitNode(cbNode, node.elseStatement);\n            case 235 /* DoStatement */:\n                return visitNode(cbNode, node.statement) ||\n                    visitNode(cbNode, node.expression);\n            case 236 /* WhileStatement */:\n                return visitNode(cbNode, node.expression) ||\n                    visitNode(cbNode, node.statement);\n            case 237 /* ForStatement */:\n                return visitNode(cbNode, node.initializer) ||\n                    visitNode(cbNode, node.condition) ||\n                    visitNode(cbNode, node.incrementor) ||\n                    visitNode(cbNode, node.statement);\n            case 238 /* ForInStatement */:\n                return visitNode(cbNode, node.initializer) ||\n                    visitNode(cbNode, node.expression) ||\n                    visitNode(cbNode, node.statement);\n            case 239 /* ForOfStatement */:\n                return visitNode(cbNode, node.awaitModifier) ||\n                    visitNode(cbNode, node.initializer) ||\n                    visitNode(cbNode, node.expression) ||\n                    visitNode(cbNode, node.statement);\n            case 240 /* ContinueStatement */:\n            case 241 /* BreakStatement */:\n                return visitNode(cbNode, node.label);\n            case 242 /* ReturnStatement */:\n                return visitNode(cbNode, node.expression);\n            case 243 /* WithStatement */:\n                return visitNode(cbNode, node.expression) ||\n                    visitNode(cbNode, node.statement);\n            case 244 /* SwitchStatement */:\n                return visitNode(cbNode, node.expression) ||\n                    visitNode(cbNode, node.caseBlock);\n            case 258 /* CaseBlock */:\n                return visitNodes(cbNode, cbNodes, node.clauses);\n            case 284 /* CaseClause */:\n                return visitNode(cbNode, node.expression) ||\n                    visitNodes(cbNode, cbNodes, node.statements);\n            case 285 /* DefaultClause */:\n                return visitNodes(cbNode, cbNodes, node.statements);\n            case 245 /* LabeledStatement */:\n                return visitNode(cbNode, node.label) ||\n                    visitNode(cbNode, node.statement);\n            case 246 /* ThrowStatement */:\n                return visitNode(cbNode, node.expression);\n            case 247 /* TryStatement */:\n                return visitNode(cbNode, node.tryBlock) ||\n                    visitNode(cbNode, node.catchClause) ||\n                    visitNode(cbNode, node.finallyBlock);\n            case 287 /* CatchClause */:\n                return visitNode(cbNode, node.variableDeclaration) ||\n                    visitNode(cbNode, node.block);\n            case 161 /* Decorator */:\n                return visitNode(cbNode, node.expression);\n            case 252 /* ClassDeclaration */:\n            case 221 /* ClassExpression */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.name) ||\n                    visitNodes(cbNode, cbNodes, node.typeParameters) ||\n                    visitNodes(cbNode, cbNodes, node.heritageClauses) ||\n                    visitNodes(cbNode, cbNodes, node.members);\n            case 253 /* InterfaceDeclaration */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.name) ||\n                    visitNodes(cbNode, cbNodes, node.typeParameters) ||\n                    visitNodes(cbNode, cbNodes, node.heritageClauses) ||\n                    visitNodes(cbNode, cbNodes, node.members);\n            case 254 /* TypeAliasDeclaration */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.name) ||\n                    visitNodes(cbNode, cbNodes, node.typeParameters) ||\n                    visitNode(cbNode, node.type);\n            case 255 /* EnumDeclaration */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.name) ||\n                    visitNodes(cbNode, cbNodes, node.members);\n            case 291 /* EnumMember */:\n                return visitNode(cbNode, node.name) ||\n                    visitNode(cbNode, node.initializer);\n            case 256 /* ModuleDeclaration */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.name) ||\n                    visitNode(cbNode, node.body);\n            case 260 /* ImportEqualsDeclaration */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.name) ||\n                    visitNode(cbNode, node.moduleReference);\n            case 261 /* ImportDeclaration */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.importClause) ||\n                    visitNode(cbNode, node.moduleSpecifier);\n            case 262 /* ImportClause */:\n                return visitNode(cbNode, node.name) ||\n                    visitNode(cbNode, node.namedBindings);\n            case 259 /* NamespaceExportDeclaration */:\n                return visitNode(cbNode, node.name);\n            case 263 /* NamespaceImport */:\n                return visitNode(cbNode, node.name);\n            case 269 /* NamespaceExport */:\n                return visitNode(cbNode, node.name);\n            case 264 /* NamedImports */:\n            case 268 /* NamedExports */:\n                return visitNodes(cbNode, cbNodes, node.elements);\n            case 267 /* ExportDeclaration */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.exportClause) ||\n                    visitNode(cbNode, node.moduleSpecifier);\n            case 265 /* ImportSpecifier */:\n            case 270 /* ExportSpecifier */:\n                return visitNode(cbNode, node.propertyName) ||\n                    visitNode(cbNode, node.name);\n            case 266 /* ExportAssignment */:\n                return visitNodes(cbNode, cbNodes, node.decorators) ||\n                    visitNodes(cbNode, cbNodes, node.modifiers) ||\n                    visitNode(cbNode, node.expression);\n            case 218 /* TemplateExpression */:\n                return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);\n            case 228 /* TemplateSpan */:\n                return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal);\n            case 193 /* TemplateLiteralType */:\n                return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);\n            case 194 /* TemplateLiteralTypeSpan */:\n                return visitNode(cbNode, node.type) || visitNode(cbNode, node.literal);\n            case 158 /* ComputedPropertyName */:\n                return visitNode(cbNode, node.expression);\n            case 286 /* HeritageClause */:\n                return visitNodes(cbNode, cbNodes, node.types);\n            case 223 /* ExpressionWithTypeArguments */:\n                return visitNode(cbNode, node.expression) ||\n                    visitNodes(cbNode, cbNodes, node.typeArguments);\n            case 272 /* ExternalModuleReference */:\n                return visitNode(cbNode, node.expression);\n            case 271 /* MissingDeclaration */:\n                return visitNodes(cbNode, cbNodes, node.decorators);\n            case 337 /* CommaListExpression */:\n                return visitNodes(cbNode, cbNodes, node.elements);\n            case 273 /* JsxElement */:\n                return visitNode(cbNode, node.openingElement) ||\n                    visitNodes(cbNode, cbNodes, node.children) ||\n                    visitNode(cbNode, node.closingElement);\n            case 277 /* JsxFragment */:\n                return visitNode(cbNode, node.openingFragment) ||\n                    visitNodes(cbNode, cbNodes, node.children) ||\n                    visitNode(cbNode, node.closingFragment);\n            case 274 /* JsxSelfClosingElement */:\n            case 275 /* JsxOpeningElement */:\n                return visitNode(cbNode, node.tagName) ||\n                    visitNodes(cbNode, cbNodes, node.typeArguments) ||\n                    visitNode(cbNode, node.attributes);\n            case 281 /* JsxAttributes */:\n                return visitNodes(cbNode, cbNodes, node.properties);\n            case 280 /* JsxAttribute */:\n                return visitNode(cbNode, node.name) ||\n                    visitNode(cbNode, node.initializer);\n            case 282 /* JsxSpreadAttribute */:\n                return visitNode(cbNode, node.expression);\n            case 283 /* JsxExpression */:\n                return visitNode(cbNode, node.dotDotDotToken) ||\n                    visitNode(cbNode, node.expression);\n            case 276 /* JsxClosingElement */:\n                return visitNode(cbNode, node.tagName);\n            case 180 /* OptionalType */:\n            case 181 /* RestType */:\n            case 301 /* JSDocTypeExpression */:\n            case 306 /* JSDocNonNullableType */:\n            case 305 /* JSDocNullableType */:\n            case 307 /* JSDocOptionalType */:\n            case 309 /* JSDocVariadicType */:\n                return visitNode(cbNode, node.type);\n            case 308 /* JSDocFunctionType */:\n                return visitNodes(cbNode, cbNodes, node.parameters) ||\n                    visitNode(cbNode, node.type);\n            case 311 /* JSDocComment */:\n                return visitNodes(cbNode, cbNodes, node.tags);\n            case 332 /* JSDocSeeTag */:\n                return visitNode(cbNode, node.tagName) ||\n                    visitNode(cbNode, node.name);\n            case 302 /* JSDocNameReference */:\n                return visitNode(cbNode, node.name);\n            case 326 /* JSDocParameterTag */:\n            case 333 /* JSDocPropertyTag */:\n                return visitNode(cbNode, node.tagName) ||\n                    (node.isNameFirst\n                        ? visitNode(cbNode, node.name) ||\n                            visitNode(cbNode, node.typeExpression)\n                        : visitNode(cbNode, node.typeExpression) ||\n                            visitNode(cbNode, node.name));\n            case 317 /* JSDocAuthorTag */:\n                return visitNode(cbNode, node.tagName);\n            case 316 /* JSDocImplementsTag */:\n                return visitNode(cbNode, node.tagName) ||\n                    visitNode(cbNode, node.class);\n            case 315 /* JSDocAugmentsTag */:\n                return visitNode(cbNode, node.tagName) ||\n                    visitNode(cbNode, node.class);\n            case 330 /* JSDocTemplateTag */:\n                return visitNode(cbNode, node.tagName) ||\n                    visitNode(cbNode, node.constraint) ||\n                    visitNodes(cbNode, cbNodes, node.typeParameters);\n            case 331 /* JSDocTypedefTag */:\n                return visitNode(cbNode, node.tagName) ||\n                    (node.typeExpression &&\n                        node.typeExpression.kind === 301 /* JSDocTypeExpression */\n                        ? visitNode(cbNode, node.typeExpression) ||\n                            visitNode(cbNode, node.fullName)\n                        : visitNode(cbNode, node.fullName) ||\n                            visitNode(cbNode, node.typeExpression));\n            case 324 /* JSDocCallbackTag */:\n                return visitNode(cbNode, node.tagName) ||\n                    visitNode(cbNode, node.fullName) ||\n                    visitNode(cbNode, node.typeExpression);\n            case 327 /* JSDocReturnTag */:\n            case 329 /* JSDocTypeTag */:\n            case 328 /* JSDocThisTag */:\n            case 325 /* JSDocEnumTag */:\n                return visitNode(cbNode, node.tagName) ||\n                    visitNode(cbNode, node.typeExpression);\n            case 313 /* JSDocSignature */:\n                return ts.forEach(node.typeParameters, cbNode) ||\n                    ts.forEach(node.parameters, cbNode) ||\n                    visitNode(cbNode, node.type);\n            case 312 /* JSDocTypeLiteral */:\n                return ts.forEach(node.jsDocPropertyTags, cbNode);\n            case 314 /* JSDocTag */:\n            case 319 /* JSDocClassTag */:\n            case 320 /* JSDocPublicTag */:\n            case 321 /* JSDocPrivateTag */:\n            case 322 /* JSDocProtectedTag */:\n            case 323 /* JSDocReadonlyTag */:\n                return visitNode(cbNode, node.tagName);\n            case 336 /* PartiallyEmittedExpression */:\n                return visitNode(cbNode, node.expression);\n        }\n    }\n    ts.forEachChild = forEachChild;\n    /** @internal */\n    /**\n     * Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes\n     * stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; additionally,\n     * unlike `forEachChild`, embedded arrays are flattened and the 'cbNode' callback is invoked for each element.\n     *  If a callback returns a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned.\n     *\n     * @param node a given node to visit its children\n     * @param cbNode a callback to be invoked for all child nodes\n     * @param cbNodes a callback to be invoked for embedded array\n     *\n     * @remarks Unlike `forEachChild`, `forEachChildRecursively` handles recursively invoking the traversal on each child node found,\n     * and while doing so, handles traversing the structure without relying on the callstack to encode the tree structure.\n     */\n    function forEachChildRecursively(rootNode, cbNode, cbNodes) {\n        var queue = gatherPossibleChildren(rootNode);\n        var parents = []; // tracks parent references for elements in queue\n        while (parents.length < queue.length) {\n            parents.push(rootNode);\n        }\n        while (queue.length !== 0) {\n            var current = queue.pop();\n            var parent = parents.pop();\n            if (ts.isArray(current)) {\n                if (cbNodes) {\n                    var res = cbNodes(current, parent);\n                    if (res) {\n                        if (res === \"skip\")\n                            continue;\n                        return res;\n                    }\n                }\n                for (var i = current.length - 1; i >= 0; --i) {\n                    queue.push(current[i]);\n                    parents.push(parent);\n                }\n            }\n            else {\n                var res = cbNode(current, parent);\n                if (res) {\n                    if (res === \"skip\")\n                        continue;\n                    return res;\n                }\n                if (current.kind >= 157 /* FirstNode */) {\n                    // add children in reverse order to the queue, so popping gives the first child\n                    for (var _i = 0, _a = gatherPossibleChildren(current); _i < _a.length; _i++) {\n                        var child = _a[_i];\n                        queue.push(child);\n                        parents.push(current);\n                    }\n                }\n            }\n        }\n    }\n    ts.forEachChildRecursively = forEachChildRecursively;\n    function gatherPossibleChildren(node) {\n        var children = [];\n        forEachChild(node, addWorkItem, addWorkItem); // By using a stack above and `unshift` here, we emulate a depth-first preorder traversal\n        return children;\n        function addWorkItem(n) {\n            children.unshift(n);\n        }\n    }\n    function createSourceFile(fileName, sourceText, languageVersion, setParentNodes, scriptKind) {\n        if (setParentNodes === void 0) { setParentNodes = false; }\n        ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"parse\" /* Parse */, \"createSourceFile\", { path: fileName }, /*separateBeginAndEnd*/ true);\n        ts.performance.mark(\"beforeParse\");\n        var result;\n        ts.perfLogger.logStartParseSourceFile(fileName);\n        if (languageVersion === 100 /* JSON */) {\n            result = Parser.parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes, 6 /* JSON */);\n        }\n        else {\n            result = Parser.parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes, scriptKind);\n        }\n        ts.perfLogger.logStopParseSourceFile();\n        ts.performance.mark(\"afterParse\");\n        ts.performance.measure(\"Parse\", \"beforeParse\", \"afterParse\");\n        ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n        return result;\n    }\n    ts.createSourceFile = createSourceFile;\n    function parseIsolatedEntityName(text, languageVersion) {\n        return Parser.parseIsolatedEntityName(text, languageVersion);\n    }\n    ts.parseIsolatedEntityName = parseIsolatedEntityName;\n    /**\n     * Parse json text into SyntaxTree and return node and parse errors if any\n     * @param fileName\n     * @param sourceText\n     */\n    function parseJsonText(fileName, sourceText) {\n        return Parser.parseJsonText(fileName, sourceText);\n    }\n    ts.parseJsonText = parseJsonText;\n    // See also `isExternalOrCommonJsModule` in utilities.ts\n    function isExternalModule(file) {\n        return file.externalModuleIndicator !== undefined;\n    }\n    ts.isExternalModule = isExternalModule;\n    // Produces a new SourceFile for the 'newText' provided. The 'textChangeRange' parameter\n    // indicates what changed between the 'text' that this SourceFile has and the 'newText'.\n    // The SourceFile will be created with the compiler attempting to reuse as many nodes from\n    // this file as possible.\n    //\n    // Note: this function mutates nodes from this SourceFile. That means any existing nodes\n    // from this SourceFile that are being held onto may change as a result (including\n    // becoming detached from any SourceFile).  It is recommended that this SourceFile not\n    // be used once 'update' is called on it.\n    function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) {\n        if (aggressiveChecks === void 0) { aggressiveChecks = false; }\n        var newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);\n        // Because new source file node is created, it may not have the flag PossiblyContainDynamicImport. This is the case if there is no new edit to add dynamic import.\n        // We will manually port the flag to the new source file.\n        newSourceFile.flags |= (sourceFile.flags & 3145728 /* PermanentlySetIncrementalFlags */);\n        return newSourceFile;\n    }\n    ts.updateSourceFile = updateSourceFile;\n    /* @internal */\n    function parseIsolatedJSDocComment(content, start, length) {\n        var result = Parser.JSDocParser.parseIsolatedJSDocComment(content, start, length);\n        if (result && result.jsDoc) {\n            // because the jsDocComment was parsed out of the source file, it might\n            // not be covered by the fixupParentReferences.\n            Parser.fixupParentReferences(result.jsDoc);\n        }\n        return result;\n    }\n    ts.parseIsolatedJSDocComment = parseIsolatedJSDocComment;\n    /* @internal */\n    // Exposed only for testing.\n    function parseJSDocTypeExpressionForTests(content, start, length) {\n        return Parser.JSDocParser.parseJSDocTypeExpressionForTests(content, start, length);\n    }\n    ts.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests;\n    // Implement the parser as a singleton module.  We do this for perf reasons because creating\n    // parser instances can actually be expensive enough to impact us on projects with many source\n    // files.\n    var Parser;\n    (function (Parser) {\n        // Share a single scanner across all calls to parse a source file.  This helps speed things\n        // up by avoiding the cost of creating/compiling scanners over and over again.\n        var scanner = ts.createScanner(99 /* Latest */, /*skipTrivia*/ true);\n        var disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */;\n        // capture constructors in 'initializeState' to avoid null checks\n        // tslint:disable variable-name\n        var NodeConstructor;\n        var TokenConstructor;\n        var IdentifierConstructor;\n        var PrivateIdentifierConstructor;\n        var SourceFileConstructor;\n        // tslint:enable variable-name\n        function countNode(node) {\n            nodeCount++;\n            return node;\n        }\n        // Rather than using `createBaseNodeFactory` here, we establish a `BaseNodeFactory` that closes over the\n        // constructors above, which are reset each time `initializeState` is called.\n        var baseNodeFactory = {\n            createBaseSourceFileNode: function (kind) { return countNode(new SourceFileConstructor(kind, /*pos*/ 0, /*end*/ 0)); },\n            createBaseIdentifierNode: function (kind) { return countNode(new IdentifierConstructor(kind, /*pos*/ 0, /*end*/ 0)); },\n            createBasePrivateIdentifierNode: function (kind) { return countNode(new PrivateIdentifierConstructor(kind, /*pos*/ 0, /*end*/ 0)); },\n            createBaseTokenNode: function (kind) { return countNode(new TokenConstructor(kind, /*pos*/ 0, /*end*/ 0)); },\n            createBaseNode: function (kind) { return countNode(new NodeConstructor(kind, /*pos*/ 0, /*end*/ 0)); }\n        };\n        var factory = ts.createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory);\n        var fileName;\n        var sourceFlags;\n        var sourceText;\n        var languageVersion;\n        var scriptKind;\n        var languageVariant;\n        var parseDiagnostics;\n        var jsDocDiagnostics;\n        var syntaxCursor;\n        var currentToken;\n        var nodeCount;\n        var identifiers;\n        var privateIdentifiers;\n        var identifierCount;\n        var parsingContext;\n        var notParenthesizedArrow;\n        // Flags that dictate what parsing context we're in.  For example:\n        // Whether or not we are in strict parsing mode.  All that changes in strict parsing mode is\n        // that some tokens that would be considered identifiers may be considered keywords.\n        //\n        // When adding more parser context flags, consider which is the more common case that the\n        // flag will be in.  This should be the 'false' state for that flag.  The reason for this is\n        // that we don't store data in our nodes unless the value is in the *non-default* state.  So,\n        // for example, more often than code 'allows-in' (or doesn't 'disallow-in').  We opt for\n        // 'disallow-in' set to 'false'.  Otherwise, if we had 'allowsIn' set to 'true', then almost\n        // all nodes would need extra state on them to store this info.\n        //\n        // Note: 'allowIn' and 'allowYield' track 1:1 with the [in] and [yield] concepts in the ES6\n        // grammar specification.\n        //\n        // An important thing about these context concepts.  By default they are effectively inherited\n        // while parsing through every grammar production.  i.e. if you don't change them, then when\n        // you parse a sub-production, it will have the same context values as the parent production.\n        // This is great most of the time.  After all, consider all the 'expression' grammar productions\n        // and how nearly all of them pass along the 'in' and 'yield' context values:\n        //\n        // EqualityExpression[In, Yield] :\n        //      RelationalExpression[?In, ?Yield]\n        //      EqualityExpression[?In, ?Yield] == RelationalExpression[?In, ?Yield]\n        //      EqualityExpression[?In, ?Yield] != RelationalExpression[?In, ?Yield]\n        //      EqualityExpression[?In, ?Yield] === RelationalExpression[?In, ?Yield]\n        //      EqualityExpression[?In, ?Yield] !== RelationalExpression[?In, ?Yield]\n        //\n        // Where you have to be careful is then understanding what the points are in the grammar\n        // where the values are *not* passed along.  For example:\n        //\n        // SingleNameBinding[Yield,GeneratorParameter]\n        //      [+GeneratorParameter]BindingIdentifier[Yield] Initializer[In]opt\n        //      [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt\n        //\n        // Here this is saying that if the GeneratorParameter context flag is set, that we should\n        // explicitly set the 'yield' context flag to false before calling into the BindingIdentifier\n        // and we should explicitly unset the 'yield' context flag before calling into the Initializer.\n        // production.  Conversely, if the GeneratorParameter context flag is not set, then we\n        // should leave the 'yield' context flag alone.\n        //\n        // Getting this all correct is tricky and requires careful reading of the grammar to\n        // understand when these values should be changed versus when they should be inherited.\n        //\n        // Note: it should not be necessary to save/restore these flags during speculative/lookahead\n        // parsing.  These context flags are naturally stored and restored through normal recursive\n        // descent parsing and unwinding.\n        var contextFlags;\n        // Indicates whether we are currently parsing top-level statements.\n        var topLevel = true;\n        // Whether or not we've had a parse error since creating the last AST node.  If we have\n        // encountered an error, it will be stored on the next AST node we create.  Parse errors\n        // can be broken down into three categories:\n        //\n        // 1) An error that occurred during scanning.  For example, an unterminated literal, or a\n        //    character that was completely not understood.\n        //\n        // 2) A token was expected, but was not present.  This type of error is commonly produced\n        //    by the 'parseExpected' function.\n        //\n        // 3) A token was present that no parsing function was able to consume.  This type of error\n        //    only occurs in the 'abortParsingListOrMoveToNextToken' function when the parser\n        //    decides to skip the token.\n        //\n        // In all of these cases, we want to mark the next node as having had an error before it.\n        // With this mark, we can know in incremental settings if this node can be reused, or if\n        // we have to reparse it.  If we don't keep this information around, we may just reuse the\n        // node.  in that event we would then not produce the same errors as we did before, causing\n        // significant confusion problems.\n        //\n        // Note: it is necessary that this value be saved/restored during speculative/lookahead\n        // parsing.  During lookahead parsing, we will often create a node.  That node will have\n        // this value attached, and then this value will be set back to 'false'.  If we decide to\n        // rewind, we must get back to the same value we had prior to the lookahead.\n        //\n        // Note: any errors at the end of the file that do not precede a regular node, should get\n        // attached to the EOF token.\n        var parseErrorBeforeNextFinishedNode = false;\n        function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind) {\n            if (setParentNodes === void 0) { setParentNodes = false; }\n            scriptKind = ts.ensureScriptKind(fileName, scriptKind);\n            if (scriptKind === 6 /* JSON */) {\n                var result_3 = parseJsonText(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes);\n                ts.convertToObjectWorker(result_3, result_3.parseDiagnostics, /*returnValue*/ false, /*knownRootOptions*/ undefined, /*jsonConversionNotifier*/ undefined);\n                result_3.referencedFiles = ts.emptyArray;\n                result_3.typeReferenceDirectives = ts.emptyArray;\n                result_3.libReferenceDirectives = ts.emptyArray;\n                result_3.amdDependencies = ts.emptyArray;\n                result_3.hasNoDefaultLib = false;\n                result_3.pragmas = ts.emptyMap;\n                return result_3;\n            }\n            initializeState(fileName, sourceText, languageVersion, syntaxCursor, scriptKind);\n            var result = parseSourceFileWorker(languageVersion, setParentNodes, scriptKind);\n            clearState();\n            return result;\n        }\n        Parser.parseSourceFile = parseSourceFile;\n        function parseIsolatedEntityName(content, languageVersion) {\n            // Choice of `isDeclarationFile` should be arbitrary\n            initializeState(\"\", content, languageVersion, /*syntaxCursor*/ undefined, 1 /* JS */);\n            // Prime the scanner.\n            nextToken();\n            var entityName = parseEntityName(/*allowReservedWords*/ true);\n            var isInvalid = token() === 1 /* EndOfFileToken */ && !parseDiagnostics.length;\n            clearState();\n            return isInvalid ? entityName : undefined;\n        }\n        Parser.parseIsolatedEntityName = parseIsolatedEntityName;\n        function parseJsonText(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes) {\n            if (languageVersion === void 0) { languageVersion = 2 /* ES2015 */; }\n            if (setParentNodes === void 0) { setParentNodes = false; }\n            initializeState(fileName, sourceText, languageVersion, syntaxCursor, 6 /* JSON */);\n            sourceFlags = contextFlags;\n            // Prime the scanner.\n            nextToken();\n            var pos = getNodePos();\n            var statements, endOfFileToken;\n            if (token() === 1 /* EndOfFileToken */) {\n                statements = createNodeArray([], pos, pos);\n                endOfFileToken = parseTokenNode();\n            }\n            else {\n                var expression = void 0;\n                switch (token()) {\n                    case 22 /* OpenBracketToken */:\n                        expression = parseArrayLiteralExpression();\n                        break;\n                    case 109 /* TrueKeyword */:\n                    case 94 /* FalseKeyword */:\n                    case 103 /* NullKeyword */:\n                        expression = parseTokenNode();\n                        break;\n                    case 40 /* MinusToken */:\n                        if (lookAhead(function () { return nextToken() === 8 /* NumericLiteral */ && nextToken() !== 58 /* ColonToken */; })) {\n                            expression = parsePrefixUnaryExpression();\n                        }\n                        else {\n                            expression = parseObjectLiteralExpression();\n                        }\n                        break;\n                    case 8 /* NumericLiteral */:\n                    case 10 /* StringLiteral */:\n                        if (lookAhead(function () { return nextToken() !== 58 /* ColonToken */; })) {\n                            expression = parseLiteralNode();\n                            break;\n                        }\n                    // falls through\n                    default:\n                        expression = parseObjectLiteralExpression();\n                        break;\n                }\n                var statement = factory.createExpressionStatement(expression);\n                finishNode(statement, pos);\n                statements = createNodeArray([statement], pos);\n                endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, ts.Diagnostics.Unexpected_token);\n            }\n            // Set source file so that errors will be reported with this file name\n            var sourceFile = createSourceFile(fileName, 2 /* ES2015 */, 6 /* JSON */, /*isDeclaration*/ false, statements, endOfFileToken, sourceFlags);\n            if (setParentNodes) {\n                fixupParentReferences(sourceFile);\n            }\n            sourceFile.nodeCount = nodeCount;\n            sourceFile.identifierCount = identifierCount;\n            sourceFile.identifiers = identifiers;\n            sourceFile.parseDiagnostics = ts.attachFileToDiagnostics(parseDiagnostics, sourceFile);\n            if (jsDocDiagnostics) {\n                sourceFile.jsDocDiagnostics = ts.attachFileToDiagnostics(jsDocDiagnostics, sourceFile);\n            }\n            var result = sourceFile;\n            clearState();\n            return result;\n        }\n        Parser.parseJsonText = parseJsonText;\n        function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind) {\n            NodeConstructor = ts.objectAllocator.getNodeConstructor();\n            TokenConstructor = ts.objectAllocator.getTokenConstructor();\n            IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor();\n            PrivateIdentifierConstructor = ts.objectAllocator.getPrivateIdentifierConstructor();\n            SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor();\n            fileName = ts.normalizePath(_fileName);\n            sourceText = _sourceText;\n            languageVersion = _languageVersion;\n            syntaxCursor = _syntaxCursor;\n            scriptKind = _scriptKind;\n            languageVariant = ts.getLanguageVariant(_scriptKind);\n            parseDiagnostics = [];\n            parsingContext = 0;\n            identifiers = new ts.Map();\n            privateIdentifiers = new ts.Map();\n            identifierCount = 0;\n            nodeCount = 0;\n            sourceFlags = 0;\n            topLevel = true;\n            switch (scriptKind) {\n                case 1 /* JS */:\n                case 2 /* JSX */:\n                    contextFlags = 131072 /* JavaScriptFile */;\n                    break;\n                case 6 /* JSON */:\n                    contextFlags = 131072 /* JavaScriptFile */ | 33554432 /* JsonFile */;\n                    break;\n                default:\n                    contextFlags = 0 /* None */;\n                    break;\n            }\n            parseErrorBeforeNextFinishedNode = false;\n            // Initialize and prime the scanner before parsing the source elements.\n            scanner.setText(sourceText);\n            scanner.setOnError(scanError);\n            scanner.setScriptTarget(languageVersion);\n            scanner.setLanguageVariant(languageVariant);\n        }\n        function clearState() {\n            // Clear out the text the scanner is pointing at, so it doesn't keep anything alive unnecessarily.\n            scanner.clearCommentDirectives();\n            scanner.setText(\"\");\n            scanner.setOnError(undefined);\n            // Clear any data.  We don't want to accidentally hold onto it for too long.\n            sourceText = undefined;\n            languageVersion = undefined;\n            syntaxCursor = undefined;\n            scriptKind = undefined;\n            languageVariant = undefined;\n            sourceFlags = 0;\n            parseDiagnostics = undefined;\n            jsDocDiagnostics = undefined;\n            parsingContext = 0;\n            identifiers = undefined;\n            notParenthesizedArrow = undefined;\n            topLevel = true;\n        }\n        function parseSourceFileWorker(languageVersion, setParentNodes, scriptKind) {\n            var isDeclarationFile = isDeclarationFileName(fileName);\n            if (isDeclarationFile) {\n                contextFlags |= 8388608 /* Ambient */;\n            }\n            sourceFlags = contextFlags;\n            // Prime the scanner.\n            nextToken();\n            var statements = parseList(0 /* SourceElements */, parseStatement);\n            ts.Debug.assert(token() === 1 /* EndOfFileToken */);\n            var endOfFileToken = addJSDocComment(parseTokenNode());\n            var sourceFile = createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, sourceFlags);\n            // A member of ReadonlyArray<T> isn't assignable to a member of T[] (and prevents a direct cast) - but this is where we set up those members so they can be readonly in the future\n            processCommentPragmas(sourceFile, sourceText);\n            processPragmasIntoFields(sourceFile, reportPragmaDiagnostic);\n            sourceFile.commentDirectives = scanner.getCommentDirectives();\n            sourceFile.nodeCount = nodeCount;\n            sourceFile.identifierCount = identifierCount;\n            sourceFile.identifiers = identifiers;\n            sourceFile.parseDiagnostics = ts.attachFileToDiagnostics(parseDiagnostics, sourceFile);\n            if (jsDocDiagnostics) {\n                sourceFile.jsDocDiagnostics = ts.attachFileToDiagnostics(jsDocDiagnostics, sourceFile);\n            }\n            if (setParentNodes) {\n                fixupParentReferences(sourceFile);\n            }\n            return sourceFile;\n            function reportPragmaDiagnostic(pos, end, diagnostic) {\n                parseDiagnostics.push(ts.createDetachedDiagnostic(fileName, pos, end, diagnostic));\n            }\n        }\n        function withJSDoc(node, hasJSDoc) {\n            return hasJSDoc ? addJSDocComment(node) : node;\n        }\n        var hasDeprecatedTag = false;\n        function addJSDocComment(node) {\n            ts.Debug.assert(!node.jsDoc); // Should only be called once per node\n            var jsDoc = ts.mapDefined(ts.getJSDocCommentRanges(node, sourceText), function (comment) { return JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos); });\n            if (jsDoc.length)\n                node.jsDoc = jsDoc;\n            if (hasDeprecatedTag) {\n                hasDeprecatedTag = false;\n                node.flags |= 134217728 /* Deprecated */;\n            }\n            return node;\n        }\n        function reparseTopLevelAwait(sourceFile) {\n            var savedSyntaxCursor = syntaxCursor;\n            var baseSyntaxCursor = IncrementalParser.createSyntaxCursor(sourceFile);\n            syntaxCursor = { currentNode: currentNode };\n            var statements = [];\n            var savedParseDiagnostics = parseDiagnostics;\n            parseDiagnostics = [];\n            var pos = 0;\n            var start = findNextStatementWithAwait(sourceFile.statements, 0);\n            var _loop_3 = function () {\n                // append all statements between pos and start\n                var prevStatement = sourceFile.statements[pos];\n                var nextStatement = sourceFile.statements[start];\n                ts.addRange(statements, sourceFile.statements, pos, start);\n                pos = findNextStatementWithoutAwait(sourceFile.statements, start);\n                // append all diagnostics associated with the copied range\n                var diagnosticStart = ts.findIndex(savedParseDiagnostics, function (diagnostic) { return diagnostic.start >= prevStatement.pos; });\n                var diagnosticEnd = diagnosticStart >= 0 ? ts.findIndex(savedParseDiagnostics, function (diagnostic) { return diagnostic.start >= nextStatement.pos; }, diagnosticStart) : -1;\n                if (diagnosticStart >= 0) {\n                    ts.addRange(parseDiagnostics, savedParseDiagnostics, diagnosticStart, diagnosticEnd >= 0 ? diagnosticEnd : undefined);\n                }\n                // reparse all statements between start and pos. We skip existing diagnostics for the same range and allow the parser to generate new ones.\n                speculationHelper(function () {\n                    var savedContextFlags = contextFlags;\n                    contextFlags |= 32768 /* AwaitContext */;\n                    scanner.setTextPos(nextStatement.pos);\n                    nextToken();\n                    while (token() !== 1 /* EndOfFileToken */) {\n                        var startPos = scanner.getStartPos();\n                        var statement = parseListElement(0 /* SourceElements */, parseStatement);\n                        statements.push(statement);\n                        if (startPos === scanner.getStartPos()) {\n                            nextToken();\n                        }\n                        if (pos >= 0) {\n                            var nonAwaitStatement = sourceFile.statements[pos];\n                            if (statement.end === nonAwaitStatement.pos) {\n                                // done reparsing this section\n                                break;\n                            }\n                            if (statement.end > nonAwaitStatement.pos) {\n                                // we ate into the next statement, so we must reparse it.\n                                pos = findNextStatementWithoutAwait(sourceFile.statements, pos + 1);\n                            }\n                        }\n                    }\n                    contextFlags = savedContextFlags;\n                }, 2 /* Reparse */);\n                // find the next statement containing an `await`\n                start = pos >= 0 ? findNextStatementWithAwait(sourceFile.statements, pos) : -1;\n            };\n            while (start !== -1) {\n                _loop_3();\n            }\n            // append all statements between pos and the end of the list\n            if (pos >= 0) {\n                var prevStatement_1 = sourceFile.statements[pos];\n                ts.addRange(statements, sourceFile.statements, pos);\n                // append all diagnostics associated with the copied range\n                var diagnosticStart = ts.findIndex(savedParseDiagnostics, function (diagnostic) { return diagnostic.start >= prevStatement_1.pos; });\n                if (diagnosticStart >= 0) {\n                    ts.addRange(parseDiagnostics, savedParseDiagnostics, diagnosticStart);\n                }\n            }\n            syntaxCursor = savedSyntaxCursor;\n            return factory.updateSourceFile(sourceFile, ts.setTextRange(factory.createNodeArray(statements), sourceFile.statements));\n            function containsPossibleTopLevelAwait(node) {\n                return !(node.flags & 32768 /* AwaitContext */)\n                    && !!(node.transformFlags & 8388608 /* ContainsPossibleTopLevelAwait */);\n            }\n            function findNextStatementWithAwait(statements, start) {\n                for (var i = start; i < statements.length; i++) {\n                    if (containsPossibleTopLevelAwait(statements[i])) {\n                        return i;\n                    }\n                }\n                return -1;\n            }\n            function findNextStatementWithoutAwait(statements, start) {\n                for (var i = start; i < statements.length; i++) {\n                    if (!containsPossibleTopLevelAwait(statements[i])) {\n                        return i;\n                    }\n                }\n                return -1;\n            }\n            function currentNode(position) {\n                var node = baseSyntaxCursor.currentNode(position);\n                if (topLevel && node && containsPossibleTopLevelAwait(node)) {\n                    node.intersectsChange = true;\n                }\n                return node;\n            }\n        }\n        function fixupParentReferences(rootNode) {\n            // normally parent references are set during binding. However, for clients that only need\n            // a syntax tree, and no semantic features, then the binding process is an unnecessary\n            // overhead.  This functions allows us to set all the parents, without all the expense of\n            // binding.\n            ts.setParentRecursive(rootNode, /*incremental*/ true);\n        }\n        Parser.fixupParentReferences = fixupParentReferences;\n        function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, flags) {\n            // code from createNode is inlined here so createNode won't have to deal with special case of creating source files\n            // this is quite rare comparing to other nodes and createNode should be as fast as possible\n            var sourceFile = factory.createSourceFile(statements, endOfFileToken, flags);\n            ts.setTextRangePosWidth(sourceFile, 0, sourceText.length);\n            setExternalModuleIndicator(sourceFile);\n            // If we parsed this as an external module, it may contain top-level await\n            if (!isDeclarationFile && isExternalModule(sourceFile) && sourceFile.transformFlags & 8388608 /* ContainsPossibleTopLevelAwait */) {\n                sourceFile = reparseTopLevelAwait(sourceFile);\n            }\n            sourceFile.text = sourceText;\n            sourceFile.bindDiagnostics = [];\n            sourceFile.bindSuggestionDiagnostics = undefined;\n            sourceFile.languageVersion = languageVersion;\n            sourceFile.fileName = fileName;\n            sourceFile.languageVariant = ts.getLanguageVariant(scriptKind);\n            sourceFile.isDeclarationFile = isDeclarationFile;\n            sourceFile.scriptKind = scriptKind;\n            return sourceFile;\n        }\n        function setContextFlag(val, flag) {\n            if (val) {\n                contextFlags |= flag;\n            }\n            else {\n                contextFlags &= ~flag;\n            }\n        }\n        function setDisallowInContext(val) {\n            setContextFlag(val, 4096 /* DisallowInContext */);\n        }\n        function setYieldContext(val) {\n            setContextFlag(val, 8192 /* YieldContext */);\n        }\n        function setDecoratorContext(val) {\n            setContextFlag(val, 16384 /* DecoratorContext */);\n        }\n        function setAwaitContext(val) {\n            setContextFlag(val, 32768 /* AwaitContext */);\n        }\n        function doOutsideOfContext(context, func) {\n            // contextFlagsToClear will contain only the context flags that are\n            // currently set that we need to temporarily clear\n            // We don't just blindly reset to the previous flags to ensure\n            // that we do not mutate cached flags for the incremental\n            // parser (ThisNodeHasError, ThisNodeOrAnySubNodesHasError, and\n            // HasAggregatedChildData).\n            var contextFlagsToClear = context & contextFlags;\n            if (contextFlagsToClear) {\n                // clear the requested context flags\n                setContextFlag(/*val*/ false, contextFlagsToClear);\n                var result = func();\n                // restore the context flags we just cleared\n                setContextFlag(/*val*/ true, contextFlagsToClear);\n                return result;\n            }\n            // no need to do anything special as we are not in any of the requested contexts\n            return func();\n        }\n        function doInsideOfContext(context, func) {\n            // contextFlagsToSet will contain only the context flags that\n            // are not currently set that we need to temporarily enable.\n            // We don't just blindly reset to the previous flags to ensure\n            // that we do not mutate cached flags for the incremental\n            // parser (ThisNodeHasError, ThisNodeOrAnySubNodesHasError, and\n            // HasAggregatedChildData).\n            var contextFlagsToSet = context & ~contextFlags;\n            if (contextFlagsToSet) {\n                // set the requested context flags\n                setContextFlag(/*val*/ true, contextFlagsToSet);\n                var result = func();\n                // reset the context flags we just set\n                setContextFlag(/*val*/ false, contextFlagsToSet);\n                return result;\n            }\n            // no need to do anything special as we are already in all of the requested contexts\n            return func();\n        }\n        function allowInAnd(func) {\n            return doOutsideOfContext(4096 /* DisallowInContext */, func);\n        }\n        function disallowInAnd(func) {\n            return doInsideOfContext(4096 /* DisallowInContext */, func);\n        }\n        function doInYieldContext(func) {\n            return doInsideOfContext(8192 /* YieldContext */, func);\n        }\n        function doInDecoratorContext(func) {\n            return doInsideOfContext(16384 /* DecoratorContext */, func);\n        }\n        function doInAwaitContext(func) {\n            return doInsideOfContext(32768 /* AwaitContext */, func);\n        }\n        function doOutsideOfAwaitContext(func) {\n            return doOutsideOfContext(32768 /* AwaitContext */, func);\n        }\n        function doInYieldAndAwaitContext(func) {\n            return doInsideOfContext(8192 /* YieldContext */ | 32768 /* AwaitContext */, func);\n        }\n        function doOutsideOfYieldAndAwaitContext(func) {\n            return doOutsideOfContext(8192 /* YieldContext */ | 32768 /* AwaitContext */, func);\n        }\n        function inContext(flags) {\n            return (contextFlags & flags) !== 0;\n        }\n        function inYieldContext() {\n            return inContext(8192 /* YieldContext */);\n        }\n        function inDisallowInContext() {\n            return inContext(4096 /* DisallowInContext */);\n        }\n        function inDecoratorContext() {\n            return inContext(16384 /* DecoratorContext */);\n        }\n        function inAwaitContext() {\n            return inContext(32768 /* AwaitContext */);\n        }\n        function parseErrorAtCurrentToken(message, arg0) {\n            parseErrorAt(scanner.getTokenPos(), scanner.getTextPos(), message, arg0);\n        }\n        function parseErrorAtPosition(start, length, message, arg0) {\n            // Don't report another error if it would just be at the same position as the last error.\n            var lastError = ts.lastOrUndefined(parseDiagnostics);\n            if (!lastError || start !== lastError.start) {\n                parseDiagnostics.push(ts.createDetachedDiagnostic(fileName, start, length, message, arg0));\n            }\n            // Mark that we've encountered an error.  We'll set an appropriate bit on the next\n            // node we finish so that it can't be reused incrementally.\n            parseErrorBeforeNextFinishedNode = true;\n        }\n        function parseErrorAt(start, end, message, arg0) {\n            parseErrorAtPosition(start, end - start, message, arg0);\n        }\n        function parseErrorAtRange(range, message, arg0) {\n            parseErrorAt(range.pos, range.end, message, arg0);\n        }\n        function scanError(message, length) {\n            parseErrorAtPosition(scanner.getTextPos(), length, message);\n        }\n        function getNodePos() {\n            return scanner.getStartPos();\n        }\n        function hasPrecedingJSDocComment() {\n            return scanner.hasPrecedingJSDocComment();\n        }\n        // Use this function to access the current token instead of reading the currentToken\n        // variable. Since function results aren't narrowed in control flow analysis, this ensures\n        // that the type checker doesn't make wrong assumptions about the type of the current\n        // token (e.g. a call to nextToken() changes the current token but the checker doesn't\n        // reason about this side effect).  Mainstream VMs inline simple functions like this, so\n        // there is no performance penalty.\n        function token() {\n            return currentToken;\n        }\n        function nextTokenWithoutCheck() {\n            return currentToken = scanner.scan();\n        }\n        function nextTokenAnd(func) {\n            nextToken();\n            return func();\n        }\n        function nextToken() {\n            // if the keyword had an escape\n            if (ts.isKeyword(currentToken) && (scanner.hasUnicodeEscape() || scanner.hasExtendedUnicodeEscape())) {\n                // issue a parse error for the escape\n                parseErrorAt(scanner.getTokenPos(), scanner.getTextPos(), ts.Diagnostics.Keywords_cannot_contain_escape_characters);\n            }\n            return nextTokenWithoutCheck();\n        }\n        function nextTokenJSDoc() {\n            return currentToken = scanner.scanJsDocToken();\n        }\n        function reScanGreaterToken() {\n            return currentToken = scanner.reScanGreaterToken();\n        }\n        function reScanSlashToken() {\n            return currentToken = scanner.reScanSlashToken();\n        }\n        function reScanTemplateToken(isTaggedTemplate) {\n            return currentToken = scanner.reScanTemplateToken(isTaggedTemplate);\n        }\n        function reScanTemplateHeadOrNoSubstitutionTemplate() {\n            return currentToken = scanner.reScanTemplateHeadOrNoSubstitutionTemplate();\n        }\n        function reScanLessThanToken() {\n            return currentToken = scanner.reScanLessThanToken();\n        }\n        function scanJsxIdentifier() {\n            return currentToken = scanner.scanJsxIdentifier();\n        }\n        function scanJsxText() {\n            return currentToken = scanner.scanJsxToken();\n        }\n        function scanJsxAttributeValue() {\n            return currentToken = scanner.scanJsxAttributeValue();\n        }\n        function speculationHelper(callback, speculationKind) {\n            // Keep track of the state we'll need to rollback to if lookahead fails (or if the\n            // caller asked us to always reset our state).\n            var saveToken = currentToken;\n            var saveParseDiagnosticsLength = parseDiagnostics.length;\n            var saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode;\n            // Note: it is not actually necessary to save/restore the context flags here.  That's\n            // because the saving/restoring of these flags happens naturally through the recursive\n            // descent nature of our parser.  However, we still store this here just so we can\n            // assert that invariant holds.\n            var saveContextFlags = contextFlags;\n            // If we're only looking ahead, then tell the scanner to only lookahead as well.\n            // Otherwise, if we're actually speculatively parsing, then tell the scanner to do the\n            // same.\n            var result = speculationKind !== 0 /* TryParse */\n                ? scanner.lookAhead(callback)\n                : scanner.tryScan(callback);\n            ts.Debug.assert(saveContextFlags === contextFlags);\n            // If our callback returned something 'falsy' or we're just looking ahead,\n            // then unconditionally restore us to where we were.\n            if (!result || speculationKind !== 0 /* TryParse */) {\n                currentToken = saveToken;\n                if (speculationKind !== 2 /* Reparse */) {\n                    parseDiagnostics.length = saveParseDiagnosticsLength;\n                }\n                parseErrorBeforeNextFinishedNode = saveParseErrorBeforeNextFinishedNode;\n            }\n            return result;\n        }\n        /** Invokes the provided callback then unconditionally restores the parser to the state it\n         * was in immediately prior to invoking the callback.  The result of invoking the callback\n         * is returned from this function.\n         */\n        function lookAhead(callback) {\n            return speculationHelper(callback, 1 /* Lookahead */);\n        }\n        /** Invokes the provided callback.  If the callback returns something falsy, then it restores\n         * the parser to the state it was in immediately prior to invoking the callback.  If the\n         * callback returns something truthy, then the parser state is not rolled back.  The result\n         * of invoking the callback is returned from this function.\n         */\n        function tryParse(callback) {\n            return speculationHelper(callback, 0 /* TryParse */);\n        }\n        function isBindingIdentifier() {\n            if (token() === 78 /* Identifier */) {\n                return true;\n            }\n            return token() > 115 /* LastReservedWord */;\n        }\n        // Ignore strict mode flag because we will report an error in type checker instead.\n        function isIdentifier() {\n            if (token() === 78 /* Identifier */) {\n                return true;\n            }\n            // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is\n            // considered a keyword and is not an identifier.\n            if (token() === 124 /* YieldKeyword */ && inYieldContext()) {\n                return false;\n            }\n            // If we have a 'await' keyword, and we're in the [Await] context, then 'await' is\n            // considered a keyword and is not an identifier.\n            if (token() === 130 /* AwaitKeyword */ && inAwaitContext()) {\n                return false;\n            }\n            return token() > 115 /* LastReservedWord */;\n        }\n        function parseExpected(kind, diagnosticMessage, shouldAdvance) {\n            if (shouldAdvance === void 0) { shouldAdvance = true; }\n            if (token() === kind) {\n                if (shouldAdvance) {\n                    nextToken();\n                }\n                return true;\n            }\n            // Report specific message if provided with one.  Otherwise, report generic fallback message.\n            if (diagnosticMessage) {\n                parseErrorAtCurrentToken(diagnosticMessage);\n            }\n            else {\n                parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(kind));\n            }\n            return false;\n        }\n        function parseExpectedJSDoc(kind) {\n            if (token() === kind) {\n                nextTokenJSDoc();\n                return true;\n            }\n            parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(kind));\n            return false;\n        }\n        function parseOptional(t) {\n            if (token() === t) {\n                nextToken();\n                return true;\n            }\n            return false;\n        }\n        function parseOptionalToken(t) {\n            if (token() === t) {\n                return parseTokenNode();\n            }\n            return undefined;\n        }\n        function parseOptionalTokenJSDoc(t) {\n            if (token() === t) {\n                return parseTokenNodeJSDoc();\n            }\n            return undefined;\n        }\n        function parseExpectedToken(t, diagnosticMessage, arg0) {\n            return parseOptionalToken(t) ||\n                createMissingNode(t, /*reportAtCurrentPosition*/ false, diagnosticMessage || ts.Diagnostics._0_expected, arg0 || ts.tokenToString(t));\n        }\n        function parseExpectedTokenJSDoc(t) {\n            return parseOptionalTokenJSDoc(t) ||\n                createMissingNode(t, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(t));\n        }\n        function parseTokenNode() {\n            var pos = getNodePos();\n            var kind = token();\n            nextToken();\n            return finishNode(factory.createToken(kind), pos);\n        }\n        function parseTokenNodeJSDoc() {\n            var pos = getNodePos();\n            var kind = token();\n            nextTokenJSDoc();\n            return finishNode(factory.createToken(kind), pos);\n        }\n        function canParseSemicolon() {\n            // If there's a real semicolon, then we can always parse it out.\n            if (token() === 26 /* SemicolonToken */) {\n                return true;\n            }\n            // We can parse out an optional semicolon in ASI cases in the following cases.\n            return token() === 19 /* CloseBraceToken */ || token() === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak();\n        }\n        function parseSemicolon() {\n            if (canParseSemicolon()) {\n                if (token() === 26 /* SemicolonToken */) {\n                    // consume the semicolon if it was explicitly provided.\n                    nextToken();\n                }\n                return true;\n            }\n            else {\n                return parseExpected(26 /* SemicolonToken */);\n            }\n        }\n        function createNodeArray(elements, pos, end, hasTrailingComma) {\n            var array = factory.createNodeArray(elements, hasTrailingComma);\n            ts.setTextRangePosEnd(array, pos, end !== null && end !== void 0 ? end : scanner.getStartPos());\n            return array;\n        }\n        function finishNode(node, pos, end) {\n            ts.setTextRangePosEnd(node, pos, end !== null && end !== void 0 ? end : scanner.getStartPos());\n            if (contextFlags) {\n                node.flags |= contextFlags;\n            }\n            // Keep track on the node if we encountered an error while parsing it.  If we did, then\n            // we cannot reuse the node incrementally.  Once we've marked this node, clear out the\n            // flag so that we don't mark any subsequent nodes.\n            if (parseErrorBeforeNextFinishedNode) {\n                parseErrorBeforeNextFinishedNode = false;\n                node.flags |= 65536 /* ThisNodeHasError */;\n            }\n            return node;\n        }\n        function createMissingNode(kind, reportAtCurrentPosition, diagnosticMessage, arg0) {\n            if (reportAtCurrentPosition) {\n                parseErrorAtPosition(scanner.getStartPos(), 0, diagnosticMessage, arg0);\n            }\n            else if (diagnosticMessage) {\n                parseErrorAtCurrentToken(diagnosticMessage, arg0);\n            }\n            var pos = getNodePos();\n            var result = kind === 78 /* Identifier */ ? factory.createIdentifier(\"\", /*typeArguments*/ undefined, /*originalKeywordKind*/ undefined) :\n                ts.isTemplateLiteralKind(kind) ? factory.createTemplateLiteralLikeNode(kind, \"\", \"\", /*templateFlags*/ undefined) :\n                    kind === 8 /* NumericLiteral */ ? factory.createNumericLiteral(\"\", /*numericLiteralFlags*/ undefined) :\n                        kind === 10 /* StringLiteral */ ? factory.createStringLiteral(\"\", /*isSingleQuote*/ undefined) :\n                            kind === 271 /* MissingDeclaration */ ? factory.createMissingDeclaration() :\n                                factory.createToken(kind);\n            return finishNode(result, pos);\n        }\n        function internIdentifier(text) {\n            var identifier = identifiers.get(text);\n            if (identifier === undefined) {\n                identifiers.set(text, identifier = text);\n            }\n            return identifier;\n        }\n        // An identifier that starts with two underscores has an extra underscore character prepended to it to avoid issues\n        // with magic property names like '__proto__'. The 'identifiers' object is used to share a single string instance for\n        // each identifier in order to reduce memory consumption.\n        function createIdentifier(isIdentifier, diagnosticMessage, privateIdentifierDiagnosticMessage) {\n            if (isIdentifier) {\n                identifierCount++;\n                var pos = getNodePos();\n                // Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker\n                var originalKeywordKind = token();\n                var text = internIdentifier(scanner.getTokenValue());\n                nextTokenWithoutCheck();\n                return finishNode(factory.createIdentifier(text, /*typeArguments*/ undefined, originalKeywordKind), pos);\n            }\n            if (token() === 79 /* PrivateIdentifier */) {\n                parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);\n                return createIdentifier(/*isIdentifier*/ true);\n            }\n            if (token() === 0 /* Unknown */ && scanner.tryScan(function () { return scanner.reScanInvalidIdentifier() === 78 /* Identifier */; })) {\n                // Scanner has already recorded an 'Invalid character' error, so no need to add another from the parser.\n                return createIdentifier(/*isIdentifier*/ true);\n            }\n            identifierCount++;\n            // Only for end of file because the error gets reported incorrectly on embedded script tags.\n            var reportAtCurrentPosition = token() === 1 /* EndOfFileToken */;\n            var isReservedWord = scanner.isReservedWord();\n            var msgArg = scanner.getTokenText();\n            var defaultMessage = isReservedWord ?\n                ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here :\n                ts.Diagnostics.Identifier_expected;\n            return createMissingNode(78 /* Identifier */, reportAtCurrentPosition, diagnosticMessage || defaultMessage, msgArg);\n        }\n        function parseBindingIdentifier(privateIdentifierDiagnosticMessage) {\n            return createIdentifier(isBindingIdentifier(), /*diagnosticMessage*/ undefined, privateIdentifierDiagnosticMessage);\n        }\n        function parseIdentifier(diagnosticMessage, privateIdentifierDiagnosticMessage) {\n            return createIdentifier(isIdentifier(), diagnosticMessage, privateIdentifierDiagnosticMessage);\n        }\n        function parseIdentifierName(diagnosticMessage) {\n            return createIdentifier(ts.tokenIsIdentifierOrKeyword(token()), diagnosticMessage);\n        }\n        function isLiteralPropertyName() {\n            return ts.tokenIsIdentifierOrKeyword(token()) ||\n                token() === 10 /* StringLiteral */ ||\n                token() === 8 /* NumericLiteral */;\n        }\n        function parsePropertyNameWorker(allowComputedPropertyNames) {\n            if (token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */) {\n                var node = parseLiteralNode();\n                node.text = internIdentifier(node.text);\n                return node;\n            }\n            if (allowComputedPropertyNames && token() === 22 /* OpenBracketToken */) {\n                return parseComputedPropertyName();\n            }\n            if (token() === 79 /* PrivateIdentifier */) {\n                return parsePrivateIdentifier();\n            }\n            return parseIdentifierName();\n        }\n        function parsePropertyName() {\n            return parsePropertyNameWorker(/*allowComputedPropertyNames*/ true);\n        }\n        function parseComputedPropertyName() {\n            // PropertyName [Yield]:\n            //      LiteralPropertyName\n            //      ComputedPropertyName[?Yield]\n            var pos = getNodePos();\n            parseExpected(22 /* OpenBracketToken */);\n            // We parse any expression (including a comma expression). But the grammar\n            // says that only an assignment expression is allowed, so the grammar checker\n            // will error if it sees a comma expression.\n            var expression = allowInAnd(parseExpression);\n            parseExpected(23 /* CloseBracketToken */);\n            return finishNode(factory.createComputedPropertyName(expression), pos);\n        }\n        function internPrivateIdentifier(text) {\n            var privateIdentifier = privateIdentifiers.get(text);\n            if (privateIdentifier === undefined) {\n                privateIdentifiers.set(text, privateIdentifier = text);\n            }\n            return privateIdentifier;\n        }\n        function parsePrivateIdentifier() {\n            var pos = getNodePos();\n            var node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.getTokenText()));\n            nextToken();\n            return finishNode(node, pos);\n        }\n        function parseContextualModifier(t) {\n            return token() === t && tryParse(nextTokenCanFollowModifier);\n        }\n        function nextTokenIsOnSameLineAndCanFollowModifier() {\n            nextToken();\n            if (scanner.hasPrecedingLineBreak()) {\n                return false;\n            }\n            return canFollowModifier();\n        }\n        function nextTokenCanFollowModifier() {\n            switch (token()) {\n                case 84 /* ConstKeyword */:\n                    // 'const' is only a modifier if followed by 'enum'.\n                    return nextToken() === 91 /* EnumKeyword */;\n                case 92 /* ExportKeyword */:\n                    nextToken();\n                    if (token() === 87 /* DefaultKeyword */) {\n                        return lookAhead(nextTokenCanFollowDefaultKeyword);\n                    }\n                    if (token() === 149 /* TypeKeyword */) {\n                        return lookAhead(nextTokenCanFollowExportModifier);\n                    }\n                    return canFollowExportModifier();\n                case 87 /* DefaultKeyword */:\n                    return nextTokenCanFollowDefaultKeyword();\n                case 123 /* StaticKeyword */:\n                    return nextTokenIsOnSameLineAndCanFollowModifier();\n                case 134 /* GetKeyword */:\n                case 146 /* SetKeyword */:\n                    nextToken();\n                    return canFollowModifier();\n                default:\n                    return nextTokenIsOnSameLineAndCanFollowModifier();\n            }\n        }\n        function canFollowExportModifier() {\n            return token() !== 41 /* AsteriskToken */\n                && token() !== 126 /* AsKeyword */\n                && token() !== 18 /* OpenBraceToken */\n                && canFollowModifier();\n        }\n        function nextTokenCanFollowExportModifier() {\n            nextToken();\n            return canFollowExportModifier();\n        }\n        function parseAnyContextualModifier() {\n            return ts.isModifierKind(token()) && tryParse(nextTokenCanFollowModifier);\n        }\n        function canFollowModifier() {\n            return token() === 22 /* OpenBracketToken */\n                || token() === 18 /* OpenBraceToken */\n                || token() === 41 /* AsteriskToken */\n                || token() === 25 /* DotDotDotToken */\n                || isLiteralPropertyName();\n        }\n        function nextTokenCanFollowDefaultKeyword() {\n            nextToken();\n            return token() === 83 /* ClassKeyword */ || token() === 97 /* FunctionKeyword */ ||\n                token() === 117 /* InterfaceKeyword */ ||\n                (token() === 125 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine)) ||\n                (token() === 129 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine));\n        }\n        // True if positioned at the start of a list element\n        function isListElement(parsingContext, inErrorRecovery) {\n            var node = currentNode(parsingContext);\n            if (node) {\n                return true;\n            }\n            switch (parsingContext) {\n                case 0 /* SourceElements */:\n                case 1 /* BlockStatements */:\n                case 3 /* SwitchClauseStatements */:\n                    // If we're in error recovery, then we don't want to treat ';' as an empty statement.\n                    // The problem is that ';' can show up in far too many contexts, and if we see one\n                    // and assume it's a statement, then we may bail out inappropriately from whatever\n                    // we're parsing.  For example, if we have a semicolon in the middle of a class, then\n                    // we really don't want to assume the class is over and we're on a statement in the\n                    // outer module.  We just want to consume and move on.\n                    return !(token() === 26 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement();\n                case 2 /* SwitchClauses */:\n                    return token() === 81 /* CaseKeyword */ || token() === 87 /* DefaultKeyword */;\n                case 4 /* TypeMembers */:\n                    return lookAhead(isTypeMemberStart);\n                case 5 /* ClassMembers */:\n                    // We allow semicolons as class elements (as specified by ES6) as long as we're\n                    // not in error recovery.  If we're in error recovery, we don't want an errant\n                    // semicolon to be treated as a class member (since they're almost always used\n                    // for statements.\n                    return lookAhead(isClassMemberStart) || (token() === 26 /* SemicolonToken */ && !inErrorRecovery);\n                case 6 /* EnumMembers */:\n                    // Include open bracket computed properties. This technically also lets in indexers,\n                    // which would be a candidate for improved error reporting.\n                    return token() === 22 /* OpenBracketToken */ || isLiteralPropertyName();\n                case 12 /* ObjectLiteralMembers */:\n                    switch (token()) {\n                        case 22 /* OpenBracketToken */:\n                        case 41 /* AsteriskToken */:\n                        case 25 /* DotDotDotToken */:\n                        case 24 /* DotToken */: // Not an object literal member, but don't want to close the object (see `tests/cases/fourslash/completionsDotInObjectLiteral.ts`)\n                            return true;\n                        default:\n                            return isLiteralPropertyName();\n                    }\n                case 18 /* RestProperties */:\n                    return isLiteralPropertyName();\n                case 9 /* ObjectBindingElements */:\n                    return token() === 22 /* OpenBracketToken */ || token() === 25 /* DotDotDotToken */ || isLiteralPropertyName();\n                case 7 /* HeritageClauseElement */:\n                    // If we see `{ ... }` then only consume it as an expression if it is followed by `,` or `{`\n                    // That way we won't consume the body of a class in its heritage clause.\n                    if (token() === 18 /* OpenBraceToken */) {\n                        return lookAhead(isValidHeritageClauseObjectLiteral);\n                    }\n                    if (!inErrorRecovery) {\n                        return isStartOfLeftHandSideExpression() && !isHeritageClauseExtendsOrImplementsKeyword();\n                    }\n                    else {\n                        // If we're in error recovery we tighten up what we're willing to match.\n                        // That way we don't treat something like \"this\" as a valid heritage clause\n                        // element during recovery.\n                        return isIdentifier() && !isHeritageClauseExtendsOrImplementsKeyword();\n                    }\n                case 8 /* VariableDeclarations */:\n                    return isBindingIdentifierOrPrivateIdentifierOrPattern();\n                case 10 /* ArrayBindingElements */:\n                    return token() === 27 /* CommaToken */ || token() === 25 /* DotDotDotToken */ || isBindingIdentifierOrPrivateIdentifierOrPattern();\n                case 19 /* TypeParameters */:\n                    return isIdentifier();\n                case 15 /* ArrayLiteralMembers */:\n                    switch (token()) {\n                        case 27 /* CommaToken */:\n                        case 24 /* DotToken */: // Not an array literal member, but don't want to close the array (see `tests/cases/fourslash/completionsDotInArrayLiteralInObjectLiteral.ts`)\n                            return true;\n                    }\n                // falls through\n                case 11 /* ArgumentExpressions */:\n                    return token() === 25 /* DotDotDotToken */ || isStartOfExpression();\n                case 16 /* Parameters */:\n                    return isStartOfParameter(/*isJSDocParameter*/ false);\n                case 17 /* JSDocParameters */:\n                    return isStartOfParameter(/*isJSDocParameter*/ true);\n                case 20 /* TypeArguments */:\n                case 21 /* TupleElementTypes */:\n                    return token() === 27 /* CommaToken */ || isStartOfType();\n                case 22 /* HeritageClauses */:\n                    return isHeritageClause();\n                case 23 /* ImportOrExportSpecifiers */:\n                    return ts.tokenIsIdentifierOrKeyword(token());\n                case 13 /* JsxAttributes */:\n                    return ts.tokenIsIdentifierOrKeyword(token()) || token() === 18 /* OpenBraceToken */;\n                case 14 /* JsxChildren */:\n                    return true;\n            }\n            return ts.Debug.fail(\"Non-exhaustive case in 'isListElement'.\");\n        }\n        function isValidHeritageClauseObjectLiteral() {\n            ts.Debug.assert(token() === 18 /* OpenBraceToken */);\n            if (nextToken() === 19 /* CloseBraceToken */) {\n                // if we see \"extends {}\" then only treat the {} as what we're extending (and not\n                // the class body) if we have:\n                //\n                //      extends {} {\n                //      extends {},\n                //      extends {} extends\n                //      extends {} implements\n                var next = nextToken();\n                return next === 27 /* CommaToken */ || next === 18 /* OpenBraceToken */ || next === 93 /* ExtendsKeyword */ || next === 116 /* ImplementsKeyword */;\n            }\n            return true;\n        }\n        function nextTokenIsIdentifier() {\n            nextToken();\n            return isIdentifier();\n        }\n        function nextTokenIsIdentifierOrKeyword() {\n            nextToken();\n            return ts.tokenIsIdentifierOrKeyword(token());\n        }\n        function nextTokenIsIdentifierOrKeywordOrGreaterThan() {\n            nextToken();\n            return ts.tokenIsIdentifierOrKeywordOrGreaterThan(token());\n        }\n        function isHeritageClauseExtendsOrImplementsKeyword() {\n            if (token() === 116 /* ImplementsKeyword */ ||\n                token() === 93 /* ExtendsKeyword */) {\n                return lookAhead(nextTokenIsStartOfExpression);\n            }\n            return false;\n        }\n        function nextTokenIsStartOfExpression() {\n            nextToken();\n            return isStartOfExpression();\n        }\n        function nextTokenIsStartOfType() {\n            nextToken();\n            return isStartOfType();\n        }\n        // True if positioned at a list terminator\n        function isListTerminator(kind) {\n            if (token() === 1 /* EndOfFileToken */) {\n                // Being at the end of the file ends all lists.\n                return true;\n            }\n            switch (kind) {\n                case 1 /* BlockStatements */:\n                case 2 /* SwitchClauses */:\n                case 4 /* TypeMembers */:\n                case 5 /* ClassMembers */:\n                case 6 /* EnumMembers */:\n                case 12 /* ObjectLiteralMembers */:\n                case 9 /* ObjectBindingElements */:\n                case 23 /* ImportOrExportSpecifiers */:\n                    return token() === 19 /* CloseBraceToken */;\n                case 3 /* SwitchClauseStatements */:\n                    return token() === 19 /* CloseBraceToken */ || token() === 81 /* CaseKeyword */ || token() === 87 /* DefaultKeyword */;\n                case 7 /* HeritageClauseElement */:\n                    return token() === 18 /* OpenBraceToken */ || token() === 93 /* ExtendsKeyword */ || token() === 116 /* ImplementsKeyword */;\n                case 8 /* VariableDeclarations */:\n                    return isVariableDeclaratorListTerminator();\n                case 19 /* TypeParameters */:\n                    // Tokens other than '>' are here for better error recovery\n                    return token() === 31 /* GreaterThanToken */ || token() === 20 /* OpenParenToken */ || token() === 18 /* OpenBraceToken */ || token() === 93 /* ExtendsKeyword */ || token() === 116 /* ImplementsKeyword */;\n                case 11 /* ArgumentExpressions */:\n                    // Tokens other than ')' are here for better error recovery\n                    return token() === 21 /* CloseParenToken */ || token() === 26 /* SemicolonToken */;\n                case 15 /* ArrayLiteralMembers */:\n                case 21 /* TupleElementTypes */:\n                case 10 /* ArrayBindingElements */:\n                    return token() === 23 /* CloseBracketToken */;\n                case 17 /* JSDocParameters */:\n                case 16 /* Parameters */:\n                case 18 /* RestProperties */:\n                    // Tokens other than ')' and ']' (the latter for index signatures) are here for better error recovery\n                    return token() === 21 /* CloseParenToken */ || token() === 23 /* CloseBracketToken */ /*|| token === SyntaxKind.OpenBraceToken*/;\n                case 20 /* TypeArguments */:\n                    // All other tokens should cause the type-argument to terminate except comma token\n                    return token() !== 27 /* CommaToken */;\n                case 22 /* HeritageClauses */:\n                    return token() === 18 /* OpenBraceToken */ || token() === 19 /* CloseBraceToken */;\n                case 13 /* JsxAttributes */:\n                    return token() === 31 /* GreaterThanToken */ || token() === 43 /* SlashToken */;\n                case 14 /* JsxChildren */:\n                    return token() === 29 /* LessThanToken */ && lookAhead(nextTokenIsSlash);\n                default:\n                    return false;\n            }\n        }\n        function isVariableDeclaratorListTerminator() {\n            // If we can consume a semicolon (either explicitly, or with ASI), then consider us done\n            // with parsing the list of variable declarators.\n            if (canParseSemicolon()) {\n                return true;\n            }\n            // in the case where we're parsing the variable declarator of a 'for-in' statement, we\n            // are done if we see an 'in' keyword in front of us. Same with for-of\n            if (isInOrOfKeyword(token())) {\n                return true;\n            }\n            // ERROR RECOVERY TWEAK:\n            // For better error recovery, if we see an '=>' then we just stop immediately.  We've got an\n            // arrow function here and it's going to be very unlikely that we'll resynchronize and get\n            // another variable declaration.\n            if (token() === 38 /* EqualsGreaterThanToken */) {\n                return true;\n            }\n            // Keep trying to parse out variable declarators.\n            return false;\n        }\n        // True if positioned at element or terminator of the current list or any enclosing list\n        function isInSomeParsingContext() {\n            for (var kind = 0; kind < 24 /* Count */; kind++) {\n                if (parsingContext & (1 << kind)) {\n                    if (isListElement(kind, /*inErrorRecovery*/ true) || isListTerminator(kind)) {\n                        return true;\n                    }\n                }\n            }\n            return false;\n        }\n        // Parses a list of elements\n        function parseList(kind, parseElement) {\n            var saveParsingContext = parsingContext;\n            parsingContext |= 1 << kind;\n            var list = [];\n            var listPos = getNodePos();\n            while (!isListTerminator(kind)) {\n                if (isListElement(kind, /*inErrorRecovery*/ false)) {\n                    var element = parseListElement(kind, parseElement);\n                    list.push(element);\n                    continue;\n                }\n                if (abortParsingListOrMoveToNextToken(kind)) {\n                    break;\n                }\n            }\n            parsingContext = saveParsingContext;\n            return createNodeArray(list, listPos);\n        }\n        function parseListElement(parsingContext, parseElement) {\n            var node = currentNode(parsingContext);\n            if (node) {\n                return consumeNode(node);\n            }\n            return parseElement();\n        }\n        function currentNode(parsingContext) {\n            // If we don't have a cursor or the parsing context isn't reusable, there's nothing to reuse.\n            //\n            // If there is an outstanding parse error that we've encountered, but not attached to\n            // some node, then we cannot get a node from the old source tree.  This is because we\n            // want to mark the next node we encounter as being unusable.\n            //\n            // Note: This may be too conservative.  Perhaps we could reuse the node and set the bit\n            // on it (or its leftmost child) as having the error.  For now though, being conservative\n            // is nice and likely won't ever affect perf.\n            if (!syntaxCursor || !isReusableParsingContext(parsingContext) || parseErrorBeforeNextFinishedNode) {\n                return undefined;\n            }\n            var node = syntaxCursor.currentNode(scanner.getStartPos());\n            // Can't reuse a missing node.\n            // Can't reuse a node that intersected the change range.\n            // Can't reuse a node that contains a parse error.  This is necessary so that we\n            // produce the same set of errors again.\n            if (ts.nodeIsMissing(node) || node.intersectsChange || ts.containsParseError(node)) {\n                return undefined;\n            }\n            // We can only reuse a node if it was parsed under the same strict mode that we're\n            // currently in.  i.e. if we originally parsed a node in non-strict mode, but then\n            // the user added 'using strict' at the top of the file, then we can't use that node\n            // again as the presence of strict mode may cause us to parse the tokens in the file\n            // differently.\n            //\n            // Note: we *can* reuse tokens when the strict mode changes.  That's because tokens\n            // are unaffected by strict mode.  It's just the parser will decide what to do with it\n            // differently depending on what mode it is in.\n            //\n            // This also applies to all our other context flags as well.\n            var nodeContextFlags = node.flags & 25358336 /* ContextFlags */;\n            if (nodeContextFlags !== contextFlags) {\n                return undefined;\n            }\n            // Ok, we have a node that looks like it could be reused.  Now verify that it is valid\n            // in the current list parsing context that we're currently at.\n            if (!canReuseNode(node, parsingContext)) {\n                return undefined;\n            }\n            if (node.jsDocCache) {\n                // jsDocCache may include tags from parent nodes, which might have been modified.\n                node.jsDocCache = undefined;\n            }\n            return node;\n        }\n        function consumeNode(node) {\n            // Move the scanner so it is after the node we just consumed.\n            scanner.setTextPos(node.end);\n            nextToken();\n            return node;\n        }\n        function isReusableParsingContext(parsingContext) {\n            switch (parsingContext) {\n                case 5 /* ClassMembers */:\n                case 2 /* SwitchClauses */:\n                case 0 /* SourceElements */:\n                case 1 /* BlockStatements */:\n                case 3 /* SwitchClauseStatements */:\n                case 6 /* EnumMembers */:\n                case 4 /* TypeMembers */:\n                case 8 /* VariableDeclarations */:\n                case 17 /* JSDocParameters */:\n                case 16 /* Parameters */:\n                    return true;\n            }\n            return false;\n        }\n        function canReuseNode(node, parsingContext) {\n            switch (parsingContext) {\n                case 5 /* ClassMembers */:\n                    return isReusableClassMember(node);\n                case 2 /* SwitchClauses */:\n                    return isReusableSwitchClause(node);\n                case 0 /* SourceElements */:\n                case 1 /* BlockStatements */:\n                case 3 /* SwitchClauseStatements */:\n                    return isReusableStatement(node);\n                case 6 /* EnumMembers */:\n                    return isReusableEnumMember(node);\n                case 4 /* TypeMembers */:\n                    return isReusableTypeMember(node);\n                case 8 /* VariableDeclarations */:\n                    return isReusableVariableDeclaration(node);\n                case 17 /* JSDocParameters */:\n                case 16 /* Parameters */:\n                    return isReusableParameter(node);\n                // Any other lists we do not care about reusing nodes in.  But feel free to add if\n                // you can do so safely.  Danger areas involve nodes that may involve speculative\n                // parsing.  If speculative parsing is involved with the node, then the range the\n                // parser reached while looking ahead might be in the edited range (see the example\n                // in canReuseVariableDeclaratorNode for a good case of this).\n                // case ParsingContext.HeritageClauses:\n                // This would probably be safe to reuse.  There is no speculative parsing with\n                // heritage clauses.\n                // case ParsingContext.TypeParameters:\n                // This would probably be safe to reuse.  There is no speculative parsing with\n                // type parameters.  Note that that's because type *parameters* only occur in\n                // unambiguous *type* contexts.  While type *arguments* occur in very ambiguous\n                // *expression* contexts.\n                // case ParsingContext.TupleElementTypes:\n                // This would probably be safe to reuse.  There is no speculative parsing with\n                // tuple types.\n                // Technically, type argument list types are probably safe to reuse.  While\n                // speculative parsing is involved with them (since type argument lists are only\n                // produced from speculative parsing a < as a type argument list), we only have\n                // the types because speculative parsing succeeded.  Thus, the lookahead never\n                // went past the end of the list and rewound.\n                // case ParsingContext.TypeArguments:\n                // Note: these are almost certainly not safe to ever reuse.  Expressions commonly\n                // need a large amount of lookahead, and we should not reuse them as they may\n                // have actually intersected the edit.\n                // case ParsingContext.ArgumentExpressions:\n                // This is not safe to reuse for the same reason as the 'AssignmentExpression'\n                // cases.  i.e. a property assignment may end with an expression, and thus might\n                // have lookahead far beyond it's old node.\n                // case ParsingContext.ObjectLiteralMembers:\n                // This is probably not safe to reuse.  There can be speculative parsing with\n                // type names in a heritage clause.  There can be generic names in the type\n                // name list, and there can be left hand side expressions (which can have type\n                // arguments.)\n                // case ParsingContext.HeritageClauseElement:\n                // Perhaps safe to reuse, but it's unlikely we'd see more than a dozen attributes\n                // on any given element. Same for children.\n                // case ParsingContext.JsxAttributes:\n                // case ParsingContext.JsxChildren:\n            }\n            return false;\n        }\n        function isReusableClassMember(node) {\n            if (node) {\n                switch (node.kind) {\n                    case 166 /* Constructor */:\n                    case 171 /* IndexSignature */:\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                    case 163 /* PropertyDeclaration */:\n                    case 229 /* SemicolonClassElement */:\n                        return true;\n                    case 165 /* MethodDeclaration */:\n                        // Method declarations are not necessarily reusable.  An object-literal\n                        // may have a method calls \"constructor(...)\" and we must reparse that\n                        // into an actual .ConstructorDeclaration.\n                        var methodDeclaration = node;\n                        var nameIsConstructor = methodDeclaration.name.kind === 78 /* Identifier */ &&\n                            methodDeclaration.name.originalKeywordKind === 132 /* ConstructorKeyword */;\n                        return !nameIsConstructor;\n                }\n            }\n            return false;\n        }\n        function isReusableSwitchClause(node) {\n            if (node) {\n                switch (node.kind) {\n                    case 284 /* CaseClause */:\n                    case 285 /* DefaultClause */:\n                        return true;\n                }\n            }\n            return false;\n        }\n        function isReusableStatement(node) {\n            if (node) {\n                switch (node.kind) {\n                    case 251 /* FunctionDeclaration */:\n                    case 232 /* VariableStatement */:\n                    case 230 /* Block */:\n                    case 234 /* IfStatement */:\n                    case 233 /* ExpressionStatement */:\n                    case 246 /* ThrowStatement */:\n                    case 242 /* ReturnStatement */:\n                    case 244 /* SwitchStatement */:\n                    case 241 /* BreakStatement */:\n                    case 240 /* ContinueStatement */:\n                    case 238 /* ForInStatement */:\n                    case 239 /* ForOfStatement */:\n                    case 237 /* ForStatement */:\n                    case 236 /* WhileStatement */:\n                    case 243 /* WithStatement */:\n                    case 231 /* EmptyStatement */:\n                    case 247 /* TryStatement */:\n                    case 245 /* LabeledStatement */:\n                    case 235 /* DoStatement */:\n                    case 248 /* DebuggerStatement */:\n                    case 261 /* ImportDeclaration */:\n                    case 260 /* ImportEqualsDeclaration */:\n                    case 267 /* ExportDeclaration */:\n                    case 266 /* ExportAssignment */:\n                    case 256 /* ModuleDeclaration */:\n                    case 252 /* ClassDeclaration */:\n                    case 253 /* InterfaceDeclaration */:\n                    case 255 /* EnumDeclaration */:\n                    case 254 /* TypeAliasDeclaration */:\n                        return true;\n                }\n            }\n            return false;\n        }\n        function isReusableEnumMember(node) {\n            return node.kind === 291 /* EnumMember */;\n        }\n        function isReusableTypeMember(node) {\n            if (node) {\n                switch (node.kind) {\n                    case 170 /* ConstructSignature */:\n                    case 164 /* MethodSignature */:\n                    case 171 /* IndexSignature */:\n                    case 162 /* PropertySignature */:\n                    case 169 /* CallSignature */:\n                        return true;\n                }\n            }\n            return false;\n        }\n        function isReusableVariableDeclaration(node) {\n            if (node.kind !== 249 /* VariableDeclaration */) {\n                return false;\n            }\n            // Very subtle incremental parsing bug.  Consider the following code:\n            //\n            //      let v = new List < A, B\n            //\n            // This is actually legal code.  It's a list of variable declarators \"v = new List<A\"\n            // on one side and \"B\" on the other. If you then change that to:\n            //\n            //      let v = new List < A, B >()\n            //\n            // then we have a problem.  \"v = new List<A\" doesn't intersect the change range, so we\n            // start reparsing at \"B\" and we completely fail to handle this properly.\n            //\n            // In order to prevent this, we do not allow a variable declarator to be reused if it\n            // has an initializer.\n            var variableDeclarator = node;\n            return variableDeclarator.initializer === undefined;\n        }\n        function isReusableParameter(node) {\n            if (node.kind !== 160 /* Parameter */) {\n                return false;\n            }\n            // See the comment in isReusableVariableDeclaration for why we do this.\n            var parameter = node;\n            return parameter.initializer === undefined;\n        }\n        // Returns true if we should abort parsing.\n        function abortParsingListOrMoveToNextToken(kind) {\n            parsingContextErrors(kind);\n            if (isInSomeParsingContext()) {\n                return true;\n            }\n            nextToken();\n            return false;\n        }\n        function parsingContextErrors(context) {\n            switch (context) {\n                case 0 /* SourceElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected);\n                case 1 /* BlockStatements */: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected);\n                case 2 /* SwitchClauses */: return parseErrorAtCurrentToken(ts.Diagnostics.case_or_default_expected);\n                case 3 /* SwitchClauseStatements */: return parseErrorAtCurrentToken(ts.Diagnostics.Statement_expected);\n                case 18 /* RestProperties */: // fallthrough\n                case 4 /* TypeMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_or_signature_expected);\n                case 5 /* ClassMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected);\n                case 6 /* EnumMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Enum_member_expected);\n                case 7 /* HeritageClauseElement */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_expected);\n                case 8 /* VariableDeclarations */:\n                    return ts.isKeyword(token())\n                        ? parseErrorAtCurrentToken(ts.Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, ts.tokenToString(token()))\n                        : parseErrorAtCurrentToken(ts.Diagnostics.Variable_declaration_expected);\n                case 9 /* ObjectBindingElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_destructuring_pattern_expected);\n                case 10 /* ArrayBindingElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Array_element_destructuring_pattern_expected);\n                case 11 /* ArgumentExpressions */: return parseErrorAtCurrentToken(ts.Diagnostics.Argument_expression_expected);\n                case 12 /* ObjectLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_assignment_expected);\n                case 15 /* ArrayLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_or_comma_expected);\n                case 17 /* JSDocParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected);\n                case 16 /* Parameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected);\n                case 19 /* TypeParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_parameter_declaration_expected);\n                case 20 /* TypeArguments */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_argument_expected);\n                case 21 /* TupleElementTypes */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_expected);\n                case 22 /* HeritageClauses */: return parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_expected);\n                case 23 /* ImportOrExportSpecifiers */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected);\n                case 13 /* JsxAttributes */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected);\n                case 14 /* JsxChildren */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected);\n                default: return [undefined]; // TODO: GH#18217 `default: Debug.assertNever(context);`\n            }\n        }\n        // Parses a comma-delimited list of elements\n        function parseDelimitedList(kind, parseElement, considerSemicolonAsDelimiter) {\n            var saveParsingContext = parsingContext;\n            parsingContext |= 1 << kind;\n            var list = [];\n            var listPos = getNodePos();\n            var commaStart = -1; // Meaning the previous token was not a comma\n            while (true) {\n                if (isListElement(kind, /*inErrorRecovery*/ false)) {\n                    var startPos = scanner.getStartPos();\n                    list.push(parseListElement(kind, parseElement));\n                    commaStart = scanner.getTokenPos();\n                    if (parseOptional(27 /* CommaToken */)) {\n                        // No need to check for a zero length node since we know we parsed a comma\n                        continue;\n                    }\n                    commaStart = -1; // Back to the state where the last token was not a comma\n                    if (isListTerminator(kind)) {\n                        break;\n                    }\n                    // We didn't get a comma, and the list wasn't terminated, explicitly parse\n                    // out a comma so we give a good error message.\n                    parseExpected(27 /* CommaToken */, getExpectedCommaDiagnostic(kind));\n                    // If the token was a semicolon, and the caller allows that, then skip it and\n                    // continue.  This ensures we get back on track and don't result in tons of\n                    // parse errors.  For example, this can happen when people do things like use\n                    // a semicolon to delimit object literal members.   Note: we'll have already\n                    // reported an error when we called parseExpected above.\n                    if (considerSemicolonAsDelimiter && token() === 26 /* SemicolonToken */ && !scanner.hasPrecedingLineBreak()) {\n                        nextToken();\n                    }\n                    if (startPos === scanner.getStartPos()) {\n                        // What we're parsing isn't actually remotely recognizable as a element and we've consumed no tokens whatsoever\n                        // Consume a token to advance the parser in some way and avoid an infinite loop\n                        // This can happen when we're speculatively parsing parenthesized expressions which we think may be arrow functions,\n                        // or when a modifier keyword which is disallowed as a parameter name (ie, `static` in strict mode) is supplied\n                        nextToken();\n                    }\n                    continue;\n                }\n                if (isListTerminator(kind)) {\n                    break;\n                }\n                if (abortParsingListOrMoveToNextToken(kind)) {\n                    break;\n                }\n            }\n            parsingContext = saveParsingContext;\n            // Recording the trailing comma is deliberately done after the previous\n            // loop, and not just if we see a list terminator. This is because the list\n            // may have ended incorrectly, but it is still important to know if there\n            // was a trailing comma.\n            // Check if the last token was a comma.\n            // Always preserve a trailing comma by marking it on the NodeArray\n            return createNodeArray(list, listPos, /*end*/ undefined, commaStart >= 0);\n        }\n        function getExpectedCommaDiagnostic(kind) {\n            return kind === 6 /* EnumMembers */ ? ts.Diagnostics.An_enum_member_name_must_be_followed_by_a_or : undefined;\n        }\n        function createMissingList() {\n            var list = createNodeArray([], getNodePos());\n            list.isMissingList = true;\n            return list;\n        }\n        function isMissingList(arr) {\n            return !!arr.isMissingList;\n        }\n        function parseBracketedList(kind, parseElement, open, close) {\n            if (parseExpected(open)) {\n                var result = parseDelimitedList(kind, parseElement);\n                parseExpected(close);\n                return result;\n            }\n            return createMissingList();\n        }\n        function parseEntityName(allowReservedWords, diagnosticMessage) {\n            var pos = getNodePos();\n            var entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage);\n            var dotPos = getNodePos();\n            while (parseOptional(24 /* DotToken */)) {\n                if (token() === 29 /* LessThanToken */) {\n                    // the entity is part of a JSDoc-style generic, so record the trailing dot for later error reporting\n                    entity.jsdocDotPos = dotPos;\n                    break;\n                }\n                dotPos = getNodePos();\n                entity = finishNode(factory.createQualifiedName(entity, parseRightSideOfDot(allowReservedWords, /* allowPrivateIdentifiers */ false)), pos);\n            }\n            return entity;\n        }\n        function createQualifiedName(entity, name) {\n            return finishNode(factory.createQualifiedName(entity, name), entity.pos);\n        }\n        function parseRightSideOfDot(allowIdentifierNames, allowPrivateIdentifiers) {\n            // Technically a keyword is valid here as all identifiers and keywords are identifier names.\n            // However, often we'll encounter this in error situations when the identifier or keyword\n            // is actually starting another valid construct.\n            //\n            // So, we check for the following specific case:\n            //\n            //      name.\n            //      identifierOrKeyword identifierNameOrKeyword\n            //\n            // Note: the newlines are important here.  For example, if that above code\n            // were rewritten into:\n            //\n            //      name.identifierOrKeyword\n            //      identifierNameOrKeyword\n            //\n            // Then we would consider it valid.  That's because ASI would take effect and\n            // the code would be implicitly: \"name.identifierOrKeyword; identifierNameOrKeyword\".\n            // In the first case though, ASI will not take effect because there is not a\n            // line terminator after the identifier or keyword.\n            if (scanner.hasPrecedingLineBreak() && ts.tokenIsIdentifierOrKeyword(token())) {\n                var matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine);\n                if (matchesPattern) {\n                    // Report that we need an identifier.  However, report it right after the dot,\n                    // and not on the next token.  This is because the next token might actually\n                    // be an identifier and the error would be quite confusing.\n                    return createMissingNode(78 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Identifier_expected);\n                }\n            }\n            if (token() === 79 /* PrivateIdentifier */) {\n                var node = parsePrivateIdentifier();\n                return allowPrivateIdentifiers ? node : createMissingNode(78 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Identifier_expected);\n            }\n            return allowIdentifierNames ? parseIdentifierName() : parseIdentifier();\n        }\n        function parseTemplateSpans(isTaggedTemplate) {\n            var pos = getNodePos();\n            var list = [];\n            var node;\n            do {\n                node = parseTemplateSpan(isTaggedTemplate);\n                list.push(node);\n            } while (node.literal.kind === 16 /* TemplateMiddle */);\n            return createNodeArray(list, pos);\n        }\n        function parseTemplateExpression(isTaggedTemplate) {\n            var pos = getNodePos();\n            return finishNode(factory.createTemplateExpression(parseTemplateHead(isTaggedTemplate), parseTemplateSpans(isTaggedTemplate)), pos);\n        }\n        function parseTemplateType() {\n            var pos = getNodePos();\n            return finishNode(factory.createTemplateLiteralType(parseTemplateHead(/*isTaggedTemplate*/ false), parseTemplateTypeSpans()), pos);\n        }\n        function parseTemplateTypeSpans() {\n            var pos = getNodePos();\n            var list = [];\n            var node;\n            do {\n                node = parseTemplateTypeSpan();\n                list.push(node);\n            } while (node.literal.kind === 16 /* TemplateMiddle */);\n            return createNodeArray(list, pos);\n        }\n        function parseTemplateTypeSpan() {\n            var pos = getNodePos();\n            return finishNode(factory.createTemplateLiteralTypeSpan(parseType(), parseLiteralOfTemplateSpan(/*isTaggedTemplate*/ false)), pos);\n        }\n        function parseLiteralOfTemplateSpan(isTaggedTemplate) {\n            if (token() === 19 /* CloseBraceToken */) {\n                reScanTemplateToken(isTaggedTemplate);\n                return parseTemplateMiddleOrTemplateTail();\n            }\n            else {\n                // TODO(rbuckton): Do we need to call `parseExpectedToken` or can we just call `createMissingNode` directly?\n                return parseExpectedToken(17 /* TemplateTail */, ts.Diagnostics._0_expected, ts.tokenToString(19 /* CloseBraceToken */));\n            }\n        }\n        function parseTemplateSpan(isTaggedTemplate) {\n            var pos = getNodePos();\n            return finishNode(factory.createTemplateSpan(allowInAnd(parseExpression), parseLiteralOfTemplateSpan(isTaggedTemplate)), pos);\n        }\n        function parseLiteralNode() {\n            return parseLiteralLikeNode(token());\n        }\n        function parseTemplateHead(isTaggedTemplate) {\n            if (isTaggedTemplate) {\n                reScanTemplateHeadOrNoSubstitutionTemplate();\n            }\n            var fragment = parseLiteralLikeNode(token());\n            ts.Debug.assert(fragment.kind === 15 /* TemplateHead */, \"Template head has wrong token kind\");\n            return fragment;\n        }\n        function parseTemplateMiddleOrTemplateTail() {\n            var fragment = parseLiteralLikeNode(token());\n            ts.Debug.assert(fragment.kind === 16 /* TemplateMiddle */ || fragment.kind === 17 /* TemplateTail */, \"Template fragment has wrong token kind\");\n            return fragment;\n        }\n        function getTemplateLiteralRawText(kind) {\n            var isLast = kind === 14 /* NoSubstitutionTemplateLiteral */ || kind === 17 /* TemplateTail */;\n            var tokenText = scanner.getTokenText();\n            return tokenText.substring(1, tokenText.length - (scanner.isUnterminated() ? 0 : isLast ? 1 : 2));\n        }\n        function parseLiteralLikeNode(kind) {\n            var pos = getNodePos();\n            var node = ts.isTemplateLiteralKind(kind) ? factory.createTemplateLiteralLikeNode(kind, scanner.getTokenValue(), getTemplateLiteralRawText(kind), scanner.getTokenFlags() & 2048 /* TemplateLiteralLikeFlags */) :\n                // Octal literals are not allowed in strict mode or ES5\n                // Note that theoretically the following condition would hold true literals like 009,\n                // which is not octal. But because of how the scanner separates the tokens, we would\n                // never get a token like this. Instead, we would get 00 and 9 as two separate tokens.\n                // We also do not need to check for negatives because any prefix operator would be part of a\n                // parent unary expression.\n                kind === 8 /* NumericLiteral */ ? factory.createNumericLiteral(scanner.getTokenValue(), scanner.getNumericLiteralFlags()) :\n                    kind === 10 /* StringLiteral */ ? factory.createStringLiteral(scanner.getTokenValue(), /*isSingleQuote*/ undefined, scanner.hasExtendedUnicodeEscape()) :\n                        ts.isLiteralKind(kind) ? factory.createLiteralLikeNode(kind, scanner.getTokenValue()) :\n                            ts.Debug.fail();\n            if (scanner.hasExtendedUnicodeEscape()) {\n                node.hasExtendedUnicodeEscape = true;\n            }\n            if (scanner.isUnterminated()) {\n                node.isUnterminated = true;\n            }\n            nextToken();\n            return finishNode(node, pos);\n        }\n        // TYPES\n        function parseEntityNameOfTypeReference() {\n            return parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected);\n        }\n        function parseTypeArgumentsOfTypeReference() {\n            if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) {\n                return parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */);\n            }\n        }\n        function parseTypeReference() {\n            var pos = getNodePos();\n            return finishNode(factory.createTypeReferenceNode(parseEntityNameOfTypeReference(), parseTypeArgumentsOfTypeReference()), pos);\n        }\n        // If true, we should abort parsing an error function.\n        function typeHasArrowFunctionBlockingParseError(node) {\n            switch (node.kind) {\n                case 173 /* TypeReference */:\n                    return ts.nodeIsMissing(node.typeName);\n                case 174 /* FunctionType */:\n                case 175 /* ConstructorType */: {\n                    var _a = node, parameters = _a.parameters, type = _a.type;\n                    return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type);\n                }\n                case 186 /* ParenthesizedType */:\n                    return typeHasArrowFunctionBlockingParseError(node.type);\n                default:\n                    return false;\n            }\n        }\n        function parseThisTypePredicate(lhs) {\n            nextToken();\n            return finishNode(factory.createTypePredicateNode(/*assertsModifier*/ undefined, lhs, parseType()), lhs.pos);\n        }\n        function parseThisTypeNode() {\n            var pos = getNodePos();\n            nextToken();\n            return finishNode(factory.createThisTypeNode(), pos);\n        }\n        function parseJSDocAllType() {\n            var pos = getNodePos();\n            nextToken();\n            return finishNode(factory.createJSDocAllType(), pos);\n        }\n        function parseJSDocNonNullableType() {\n            var pos = getNodePos();\n            nextToken();\n            return finishNode(factory.createJSDocNonNullableType(parseNonArrayType()), pos);\n        }\n        function parseJSDocUnknownOrNullableType() {\n            var pos = getNodePos();\n            // skip the ?\n            nextToken();\n            // Need to lookahead to decide if this is a nullable or unknown type.\n            // Here are cases where we'll pick the unknown type:\n            //\n            //      Foo(?,\n            //      { a: ? }\n            //      Foo(?)\n            //      Foo<?>\n            //      Foo(?=\n            //      (?|\n            if (token() === 27 /* CommaToken */ ||\n                token() === 19 /* CloseBraceToken */ ||\n                token() === 21 /* CloseParenToken */ ||\n                token() === 31 /* GreaterThanToken */ ||\n                token() === 62 /* EqualsToken */ ||\n                token() === 51 /* BarToken */) {\n                return finishNode(factory.createJSDocUnknownType(), pos);\n            }\n            else {\n                return finishNode(factory.createJSDocNullableType(parseType()), pos);\n            }\n        }\n        function parseJSDocFunctionType() {\n            var pos = getNodePos();\n            var hasJSDoc = hasPrecedingJSDocComment();\n            if (lookAhead(nextTokenIsOpenParen)) {\n                nextToken();\n                var parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */);\n                var type = parseReturnType(58 /* ColonToken */, /*isType*/ false);\n                return withJSDoc(finishNode(factory.createJSDocFunctionType(parameters, type), pos), hasJSDoc);\n            }\n            return finishNode(factory.createTypeReferenceNode(parseIdentifierName(), /*typeArguments*/ undefined), pos);\n        }\n        function parseJSDocParameter() {\n            var pos = getNodePos();\n            var name;\n            if (token() === 107 /* ThisKeyword */ || token() === 102 /* NewKeyword */) {\n                name = parseIdentifierName();\n                parseExpected(58 /* ColonToken */);\n            }\n            return finishNode(factory.createParameterDeclaration(\n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, \n            /*dotDotDotToken*/ undefined, \n            // TODO(rbuckton): JSDoc parameters don't have names (except `this`/`new`), should we manufacture an empty identifier?\n            name, \n            /*questionToken*/ undefined, parseJSDocType(), \n            /*initializer*/ undefined), pos);\n        }\n        function parseJSDocType() {\n            scanner.setInJSDocType(true);\n            var pos = getNodePos();\n            if (parseOptional(139 /* ModuleKeyword */)) {\n                // TODO(rbuckton): We never set the type for a JSDocNamepathType. What should we put here?\n                var moduleTag = factory.createJSDocNamepathType(/*type*/ undefined);\n                terminate: while (true) {\n                    switch (token()) {\n                        case 19 /* CloseBraceToken */:\n                        case 1 /* EndOfFileToken */:\n                        case 27 /* CommaToken */:\n                        case 5 /* WhitespaceTrivia */:\n                            break terminate;\n                        default:\n                            nextTokenJSDoc();\n                    }\n                }\n                scanner.setInJSDocType(false);\n                return finishNode(moduleTag, pos);\n            }\n            var hasDotDotDot = parseOptional(25 /* DotDotDotToken */);\n            var type = parseTypeOrTypePredicate();\n            scanner.setInJSDocType(false);\n            if (hasDotDotDot) {\n                type = finishNode(factory.createJSDocVariadicType(type), pos);\n            }\n            if (token() === 62 /* EqualsToken */) {\n                nextToken();\n                return finishNode(factory.createJSDocOptionalType(type), pos);\n            }\n            return type;\n        }\n        function parseTypeQuery() {\n            var pos = getNodePos();\n            parseExpected(111 /* TypeOfKeyword */);\n            return finishNode(factory.createTypeQueryNode(parseEntityName(/*allowReservedWords*/ true)), pos);\n        }\n        function parseTypeParameter() {\n            var pos = getNodePos();\n            var name = parseIdentifier();\n            var constraint;\n            var expression;\n            if (parseOptional(93 /* ExtendsKeyword */)) {\n                // It's not uncommon for people to write improper constraints to a generic.  If the\n                // user writes a constraint that is an expression and not an actual type, then parse\n                // it out as an expression (so we can recover well), but report that a type is needed\n                // instead.\n                if (isStartOfType() || !isStartOfExpression()) {\n                    constraint = parseType();\n                }\n                else {\n                    // It was not a type, and it looked like an expression.  Parse out an expression\n                    // here so we recover well.  Note: it is important that we call parseUnaryExpression\n                    // and not parseExpression here.  If the user has:\n                    //\n                    //      <T extends \"\">\n                    //\n                    // We do *not* want to consume the `>` as we're consuming the expression for \"\".\n                    expression = parseUnaryExpressionOrHigher();\n                }\n            }\n            var defaultType = parseOptional(62 /* EqualsToken */) ? parseType() : undefined;\n            var node = factory.createTypeParameterDeclaration(name, constraint, defaultType);\n            node.expression = expression;\n            return finishNode(node, pos);\n        }\n        function parseTypeParameters() {\n            if (token() === 29 /* LessThanToken */) {\n                return parseBracketedList(19 /* TypeParameters */, parseTypeParameter, 29 /* LessThanToken */, 31 /* GreaterThanToken */);\n            }\n        }\n        function isStartOfParameter(isJSDocParameter) {\n            return token() === 25 /* DotDotDotToken */ ||\n                isBindingIdentifierOrPrivateIdentifierOrPattern() ||\n                ts.isModifierKind(token()) ||\n                token() === 59 /* AtToken */ ||\n                isStartOfType(/*inStartOfParameter*/ !isJSDocParameter);\n        }\n        function parseNameOfParameter(modifiers) {\n            // FormalParameter [Yield,Await]:\n            //      BindingElement[?Yield,?Await]\n            var name = parseIdentifierOrPattern(ts.Diagnostics.Private_identifiers_cannot_be_used_as_parameters);\n            if (ts.getFullWidth(name) === 0 && !ts.some(modifiers) && ts.isModifierKind(token())) {\n                // in cases like\n                // 'use strict'\n                // function foo(static)\n                // isParameter('static') === true, because of isModifier('static')\n                // however 'static' is not a legal identifier in a strict mode.\n                // so result of this function will be ParameterDeclaration (flags = 0, name = missing, type = undefined, initializer = undefined)\n                // and current token will not change => parsing of the enclosing parameter list will last till the end of time (or OOM)\n                // to avoid this we'll advance cursor to the next token.\n                nextToken();\n            }\n            return name;\n        }\n        function parseParameterInOuterAwaitContext() {\n            return parseParameterWorker(/*inOuterAwaitContext*/ true);\n        }\n        function parseParameter() {\n            return parseParameterWorker(/*inOuterAwaitContext*/ false);\n        }\n        function parseParameterWorker(inOuterAwaitContext) {\n            var pos = getNodePos();\n            var hasJSDoc = hasPrecedingJSDocComment();\n            if (token() === 107 /* ThisKeyword */) {\n                var node_1 = factory.createParameterDeclaration(\n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, \n                /*dotDotDotToken*/ undefined, createIdentifier(/*isIdentifier*/ true), \n                /*questionToken*/ undefined, parseTypeAnnotation(), \n                /*initializer*/ undefined);\n                return withJSDoc(finishNode(node_1, pos), hasJSDoc);\n            }\n            // FormalParameter [Yield,Await]:\n            //      BindingElement[?Yield,?Await]\n            // Decorators are parsed in the outer [Await] context, the rest of the parameter is parsed in the function's [Await] context.\n            var decorators = inOuterAwaitContext ? doInAwaitContext(parseDecorators) : parseDecorators();\n            var savedTopLevel = topLevel;\n            topLevel = false;\n            var modifiers = parseModifiers();\n            var node = withJSDoc(finishNode(factory.createParameterDeclaration(decorators, modifiers, parseOptionalToken(25 /* DotDotDotToken */), parseNameOfParameter(modifiers), parseOptionalToken(57 /* QuestionToken */), parseTypeAnnotation(), parseInitializer()), pos), hasJSDoc);\n            topLevel = savedTopLevel;\n            return node;\n        }\n        function parseReturnType(returnToken, isType) {\n            if (shouldParseReturnType(returnToken, isType)) {\n                return parseTypeOrTypePredicate();\n            }\n        }\n        function shouldParseReturnType(returnToken, isType) {\n            if (returnToken === 38 /* EqualsGreaterThanToken */) {\n                parseExpected(returnToken);\n                return true;\n            }\n            else if (parseOptional(58 /* ColonToken */)) {\n                return true;\n            }\n            else if (isType && token() === 38 /* EqualsGreaterThanToken */) {\n                // This is easy to get backward, especially in type contexts, so parse the type anyway\n                parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(58 /* ColonToken */));\n                nextToken();\n                return true;\n            }\n            return false;\n        }\n        function parseParametersWorker(flags) {\n            // FormalParameters [Yield,Await]: (modified)\n            //      [empty]\n            //      FormalParameterList[?Yield,Await]\n            //\n            // FormalParameter[Yield,Await]: (modified)\n            //      BindingElement[?Yield,Await]\n            //\n            // BindingElement [Yield,Await]: (modified)\n            //      SingleNameBinding[?Yield,?Await]\n            //      BindingPattern[?Yield,?Await]Initializer [In, ?Yield,?Await] opt\n            //\n            // SingleNameBinding [Yield,Await]:\n            //      BindingIdentifier[?Yield,?Await]Initializer [In, ?Yield,?Await] opt\n            var savedYieldContext = inYieldContext();\n            var savedAwaitContext = inAwaitContext();\n            setYieldContext(!!(flags & 1 /* Yield */));\n            setAwaitContext(!!(flags & 2 /* Await */));\n            var parameters = flags & 32 /* JSDoc */ ?\n                parseDelimitedList(17 /* JSDocParameters */, parseJSDocParameter) :\n                parseDelimitedList(16 /* Parameters */, savedAwaitContext ? parseParameterInOuterAwaitContext : parseParameter);\n            setYieldContext(savedYieldContext);\n            setAwaitContext(savedAwaitContext);\n            return parameters;\n        }\n        function parseParameters(flags) {\n            // FormalParameters [Yield,Await]: (modified)\n            //      [empty]\n            //      FormalParameterList[?Yield,Await]\n            //\n            // FormalParameter[Yield,Await]: (modified)\n            //      BindingElement[?Yield,Await]\n            //\n            // BindingElement [Yield,Await]: (modified)\n            //      SingleNameBinding[?Yield,?Await]\n            //      BindingPattern[?Yield,?Await]Initializer [In, ?Yield,?Await] opt\n            //\n            // SingleNameBinding [Yield,Await]:\n            //      BindingIdentifier[?Yield,?Await]Initializer [In, ?Yield,?Await] opt\n            if (!parseExpected(20 /* OpenParenToken */)) {\n                return createMissingList();\n            }\n            var parameters = parseParametersWorker(flags);\n            parseExpected(21 /* CloseParenToken */);\n            return parameters;\n        }\n        function parseTypeMemberSemicolon() {\n            // We allow type members to be separated by commas or (possibly ASI) semicolons.\n            // First check if it was a comma.  If so, we're done with the member.\n            if (parseOptional(27 /* CommaToken */)) {\n                return;\n            }\n            // Didn't have a comma.  We must have a (possible ASI) semicolon.\n            parseSemicolon();\n        }\n        function parseSignatureMember(kind) {\n            var pos = getNodePos();\n            var hasJSDoc = hasPrecedingJSDocComment();\n            if (kind === 170 /* ConstructSignature */) {\n                parseExpected(102 /* NewKeyword */);\n            }\n            var typeParameters = parseTypeParameters();\n            var parameters = parseParameters(4 /* Type */);\n            var type = parseReturnType(58 /* ColonToken */, /*isType*/ true);\n            parseTypeMemberSemicolon();\n            var node = kind === 169 /* CallSignature */\n                ? factory.createCallSignature(typeParameters, parameters, type)\n                : factory.createConstructSignature(typeParameters, parameters, type);\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function isIndexSignature() {\n            return token() === 22 /* OpenBracketToken */ && lookAhead(isUnambiguouslyIndexSignature);\n        }\n        function isUnambiguouslyIndexSignature() {\n            // The only allowed sequence is:\n            //\n            //   [id:\n            //\n            // However, for error recovery, we also check the following cases:\n            //\n            //   [...\n            //   [id,\n            //   [id?,\n            //   [id?:\n            //   [id?]\n            //   [public id\n            //   [private id\n            //   [protected id\n            //   []\n            //\n            nextToken();\n            if (token() === 25 /* DotDotDotToken */ || token() === 23 /* CloseBracketToken */) {\n                return true;\n            }\n            if (ts.isModifierKind(token())) {\n                nextToken();\n                if (isIdentifier()) {\n                    return true;\n                }\n            }\n            else if (!isIdentifier()) {\n                return false;\n            }\n            else {\n                // Skip the identifier\n                nextToken();\n            }\n            // A colon signifies a well formed indexer\n            // A comma should be a badly formed indexer because comma expressions are not allowed\n            // in computed properties.\n            if (token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */) {\n                return true;\n            }\n            // Question mark could be an indexer with an optional property,\n            // or it could be a conditional expression in a computed property.\n            if (token() !== 57 /* QuestionToken */) {\n                return false;\n            }\n            // If any of the following tokens are after the question mark, it cannot\n            // be a conditional expression, so treat it as an indexer.\n            nextToken();\n            return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */;\n        }\n        function parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers) {\n            var parameters = parseBracketedList(16 /* Parameters */, parseParameter, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */);\n            var type = parseTypeAnnotation();\n            parseTypeMemberSemicolon();\n            var node = factory.createIndexSignature(decorators, modifiers, parameters, type);\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) {\n            var name = parsePropertyName();\n            var questionToken = parseOptionalToken(57 /* QuestionToken */);\n            var node;\n            if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) {\n                // Method signatures don't exist in expression contexts.  So they have neither\n                // [Yield] nor [Await]\n                var typeParameters = parseTypeParameters();\n                var parameters = parseParameters(4 /* Type */);\n                var type = parseReturnType(58 /* ColonToken */, /*isType*/ true);\n                node = factory.createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type);\n            }\n            else {\n                var type = parseTypeAnnotation();\n                node = factory.createPropertySignature(modifiers, name, questionToken, type);\n                // Although type literal properties cannot not have initializers, we attempt\n                // to parse an initializer so we can report in the checker that an interface\n                // property or type literal property cannot have an initializer.\n                if (token() === 62 /* EqualsToken */)\n                    node.initializer = parseInitializer();\n            }\n            parseTypeMemberSemicolon();\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function isTypeMemberStart() {\n            // Return true if we have the start of a signature member\n            if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) {\n                return true;\n            }\n            var idToken = false;\n            // Eat up all modifiers, but hold on to the last one in case it is actually an identifier\n            while (ts.isModifierKind(token())) {\n                idToken = true;\n                nextToken();\n            }\n            // Index signatures and computed property names are type members\n            if (token() === 22 /* OpenBracketToken */) {\n                return true;\n            }\n            // Try to get the first property-like token following all modifiers\n            if (isLiteralPropertyName()) {\n                idToken = true;\n                nextToken();\n            }\n            // If we were able to get any potential identifier, check that it is\n            // the start of a member declaration\n            if (idToken) {\n                return token() === 20 /* OpenParenToken */ ||\n                    token() === 29 /* LessThanToken */ ||\n                    token() === 57 /* QuestionToken */ ||\n                    token() === 58 /* ColonToken */ ||\n                    token() === 27 /* CommaToken */ ||\n                    canParseSemicolon();\n            }\n            return false;\n        }\n        function parseTypeMember() {\n            if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) {\n                return parseSignatureMember(169 /* CallSignature */);\n            }\n            if (token() === 102 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) {\n                return parseSignatureMember(170 /* ConstructSignature */);\n            }\n            var pos = getNodePos();\n            var hasJSDoc = hasPrecedingJSDocComment();\n            var modifiers = parseModifiers();\n            if (isIndexSignature()) {\n                return parseIndexSignatureDeclaration(pos, hasJSDoc, /*decorators*/ undefined, modifiers);\n            }\n            return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers);\n        }\n        function nextTokenIsOpenParenOrLessThan() {\n            nextToken();\n            return token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */;\n        }\n        function nextTokenIsDot() {\n            return nextToken() === 24 /* DotToken */;\n        }\n        function nextTokenIsOpenParenOrLessThanOrDot() {\n            switch (nextToken()) {\n                case 20 /* OpenParenToken */:\n                case 29 /* LessThanToken */:\n                case 24 /* DotToken */:\n                    return true;\n            }\n            return false;\n        }\n        function parseTypeLiteral() {\n            var pos = getNodePos();\n            return finishNode(factory.createTypeLiteralNode(parseObjectTypeMembers()), pos);\n        }\n        function parseObjectTypeMembers() {\n            var members;\n            if (parseExpected(18 /* OpenBraceToken */)) {\n                members = parseList(4 /* TypeMembers */, parseTypeMember);\n                parseExpected(19 /* CloseBraceToken */);\n            }\n            else {\n                members = createMissingList();\n            }\n            return members;\n        }\n        function isStartOfMappedType() {\n            nextToken();\n            if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) {\n                return nextToken() === 142 /* ReadonlyKeyword */;\n            }\n            if (token() === 142 /* ReadonlyKeyword */) {\n                nextToken();\n            }\n            return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 100 /* InKeyword */;\n        }\n        function parseMappedTypeParameter() {\n            var pos = getNodePos();\n            var name = parseIdentifierName();\n            parseExpected(100 /* InKeyword */);\n            var type = parseType();\n            return finishNode(factory.createTypeParameterDeclaration(name, type, /*defaultType*/ undefined), pos);\n        }\n        function parseMappedType() {\n            var pos = getNodePos();\n            parseExpected(18 /* OpenBraceToken */);\n            var readonlyToken;\n            if (token() === 142 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) {\n                readonlyToken = parseTokenNode();\n                if (readonlyToken.kind !== 142 /* ReadonlyKeyword */) {\n                    parseExpected(142 /* ReadonlyKeyword */);\n                }\n            }\n            parseExpected(22 /* OpenBracketToken */);\n            var typeParameter = parseMappedTypeParameter();\n            var nameType = parseOptional(126 /* AsKeyword */) ? parseType() : undefined;\n            parseExpected(23 /* CloseBracketToken */);\n            var questionToken;\n            if (token() === 57 /* QuestionToken */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) {\n                questionToken = parseTokenNode();\n                if (questionToken.kind !== 57 /* QuestionToken */) {\n                    parseExpected(57 /* QuestionToken */);\n                }\n            }\n            var type = parseTypeAnnotation();\n            parseSemicolon();\n            parseExpected(19 /* CloseBraceToken */);\n            return finishNode(factory.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type), pos);\n        }\n        function parseTupleElementType() {\n            var pos = getNodePos();\n            if (parseOptional(25 /* DotDotDotToken */)) {\n                return finishNode(factory.createRestTypeNode(parseType()), pos);\n            }\n            var type = parseType();\n            if (ts.isJSDocNullableType(type) && type.pos === type.type.pos) {\n                var node = factory.createOptionalTypeNode(type.type);\n                ts.setTextRange(node, type);\n                node.flags = type.flags;\n                return node;\n            }\n            return type;\n        }\n        function isNextTokenColonOrQuestionColon() {\n            return nextToken() === 58 /* ColonToken */ || (token() === 57 /* QuestionToken */ && nextToken() === 58 /* ColonToken */);\n        }\n        function isTupleElementName() {\n            if (token() === 25 /* DotDotDotToken */) {\n                return ts.tokenIsIdentifierOrKeyword(nextToken()) && isNextTokenColonOrQuestionColon();\n            }\n            return ts.tokenIsIdentifierOrKeyword(token()) && isNextTokenColonOrQuestionColon();\n        }\n        function parseTupleElementNameOrTupleElementType() {\n            if (lookAhead(isTupleElementName)) {\n                var pos = getNodePos();\n                var hasJSDoc = hasPrecedingJSDocComment();\n                var dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */);\n                var name = parseIdentifierName();\n                var questionToken = parseOptionalToken(57 /* QuestionToken */);\n                parseExpected(58 /* ColonToken */);\n                var type = parseTupleElementType();\n                var node = factory.createNamedTupleMember(dotDotDotToken, name, questionToken, type);\n                return withJSDoc(finishNode(node, pos), hasJSDoc);\n            }\n            return parseTupleElementType();\n        }\n        function parseTupleType() {\n            var pos = getNodePos();\n            return finishNode(factory.createTupleTypeNode(parseBracketedList(21 /* TupleElementTypes */, parseTupleElementNameOrTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */)), pos);\n        }\n        function parseParenthesizedType() {\n            var pos = getNodePos();\n            parseExpected(20 /* OpenParenToken */);\n            var type = parseType();\n            parseExpected(21 /* CloseParenToken */);\n            return finishNode(factory.createParenthesizedType(type), pos);\n        }\n        function parseModifiersForConstructorType() {\n            var modifiers;\n            if (token() === 125 /* AbstractKeyword */) {\n                var pos = getNodePos();\n                nextToken();\n                var modifier = finishNode(factory.createToken(125 /* AbstractKeyword */), pos);\n                modifiers = createNodeArray([modifier], pos);\n            }\n            return modifiers;\n        }\n        function parseFunctionOrConstructorType() {\n            var pos = getNodePos();\n            var hasJSDoc = hasPrecedingJSDocComment();\n            var modifiers = parseModifiersForConstructorType();\n            var isConstructorType = parseOptional(102 /* NewKeyword */);\n            var typeParameters = parseTypeParameters();\n            var parameters = parseParameters(4 /* Type */);\n            var type = parseReturnType(38 /* EqualsGreaterThanToken */, /*isType*/ false);\n            var node = isConstructorType\n                ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, type)\n                : factory.createFunctionTypeNode(typeParameters, parameters, type);\n            if (!isConstructorType)\n                node.modifiers = modifiers;\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function parseKeywordAndNoDot() {\n            var node = parseTokenNode();\n            return token() === 24 /* DotToken */ ? undefined : node;\n        }\n        function parseLiteralTypeNode(negative) {\n            var pos = getNodePos();\n            if (negative) {\n                nextToken();\n            }\n            var expression = token() === 109 /* TrueKeyword */ || token() === 94 /* FalseKeyword */ || token() === 103 /* NullKeyword */ ?\n                parseTokenNode() :\n                parseLiteralLikeNode(token());\n            if (negative) {\n                expression = finishNode(factory.createPrefixUnaryExpression(40 /* MinusToken */, expression), pos);\n            }\n            return finishNode(factory.createLiteralTypeNode(expression), pos);\n        }\n        function isStartOfTypeOfImportType() {\n            nextToken();\n            return token() === 99 /* ImportKeyword */;\n        }\n        function parseImportType() {\n            sourceFlags |= 1048576 /* PossiblyContainsDynamicImport */;\n            var pos = getNodePos();\n            var isTypeOf = parseOptional(111 /* TypeOfKeyword */);\n            parseExpected(99 /* ImportKeyword */);\n            parseExpected(20 /* OpenParenToken */);\n            var type = parseType();\n            parseExpected(21 /* CloseParenToken */);\n            var qualifier = parseOptional(24 /* DotToken */) ? parseEntityNameOfTypeReference() : undefined;\n            var typeArguments = parseTypeArgumentsOfTypeReference();\n            return finishNode(factory.createImportTypeNode(type, qualifier, typeArguments, isTypeOf), pos);\n        }\n        function nextTokenIsNumericOrBigIntLiteral() {\n            nextToken();\n            return token() === 8 /* NumericLiteral */ || token() === 9 /* BigIntLiteral */;\n        }\n        function parseNonArrayType() {\n            switch (token()) {\n                case 128 /* AnyKeyword */:\n                case 152 /* UnknownKeyword */:\n                case 147 /* StringKeyword */:\n                case 144 /* NumberKeyword */:\n                case 155 /* BigIntKeyword */:\n                case 148 /* SymbolKeyword */:\n                case 131 /* BooleanKeyword */:\n                case 150 /* UndefinedKeyword */:\n                case 141 /* NeverKeyword */:\n                case 145 /* ObjectKeyword */:\n                    // If these are followed by a dot, then parse these out as a dotted type reference instead.\n                    return tryParse(parseKeywordAndNoDot) || parseTypeReference();\n                case 65 /* AsteriskEqualsToken */:\n                    // If there is '*=', treat it as * followed by postfix =\n                    scanner.reScanAsteriskEqualsToken();\n                // falls through\n                case 41 /* AsteriskToken */:\n                    return parseJSDocAllType();\n                case 60 /* QuestionQuestionToken */:\n                    // If there is '??', treat it as prefix-'?' in JSDoc type.\n                    scanner.reScanQuestionToken();\n                // falls through\n                case 57 /* QuestionToken */:\n                    return parseJSDocUnknownOrNullableType();\n                case 97 /* FunctionKeyword */:\n                    return parseJSDocFunctionType();\n                case 53 /* ExclamationToken */:\n                    return parseJSDocNonNullableType();\n                case 14 /* NoSubstitutionTemplateLiteral */:\n                case 10 /* StringLiteral */:\n                case 8 /* NumericLiteral */:\n                case 9 /* BigIntLiteral */:\n                case 109 /* TrueKeyword */:\n                case 94 /* FalseKeyword */:\n                case 103 /* NullKeyword */:\n                    return parseLiteralTypeNode();\n                case 40 /* MinusToken */:\n                    return lookAhead(nextTokenIsNumericOrBigIntLiteral) ? parseLiteralTypeNode(/*negative*/ true) : parseTypeReference();\n                case 113 /* VoidKeyword */:\n                    return parseTokenNode();\n                case 107 /* ThisKeyword */: {\n                    var thisKeyword = parseThisTypeNode();\n                    if (token() === 137 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) {\n                        return parseThisTypePredicate(thisKeyword);\n                    }\n                    else {\n                        return thisKeyword;\n                    }\n                }\n                case 111 /* TypeOfKeyword */:\n                    return lookAhead(isStartOfTypeOfImportType) ? parseImportType() : parseTypeQuery();\n                case 18 /* OpenBraceToken */:\n                    return lookAhead(isStartOfMappedType) ? parseMappedType() : parseTypeLiteral();\n                case 22 /* OpenBracketToken */:\n                    return parseTupleType();\n                case 20 /* OpenParenToken */:\n                    return parseParenthesizedType();\n                case 99 /* ImportKeyword */:\n                    return parseImportType();\n                case 127 /* AssertsKeyword */:\n                    return lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine) ? parseAssertsTypePredicate() : parseTypeReference();\n                case 15 /* TemplateHead */:\n                    return parseTemplateType();\n                default:\n                    return parseTypeReference();\n            }\n        }\n        function isStartOfType(inStartOfParameter) {\n            switch (token()) {\n                case 128 /* AnyKeyword */:\n                case 152 /* UnknownKeyword */:\n                case 147 /* StringKeyword */:\n                case 144 /* NumberKeyword */:\n                case 155 /* BigIntKeyword */:\n                case 131 /* BooleanKeyword */:\n                case 142 /* ReadonlyKeyword */:\n                case 148 /* SymbolKeyword */:\n                case 151 /* UniqueKeyword */:\n                case 113 /* VoidKeyword */:\n                case 150 /* UndefinedKeyword */:\n                case 103 /* NullKeyword */:\n                case 107 /* ThisKeyword */:\n                case 111 /* TypeOfKeyword */:\n                case 141 /* NeverKeyword */:\n                case 18 /* OpenBraceToken */:\n                case 22 /* OpenBracketToken */:\n                case 29 /* LessThanToken */:\n                case 51 /* BarToken */:\n                case 50 /* AmpersandToken */:\n                case 102 /* NewKeyword */:\n                case 10 /* StringLiteral */:\n                case 8 /* NumericLiteral */:\n                case 9 /* BigIntLiteral */:\n                case 109 /* TrueKeyword */:\n                case 94 /* FalseKeyword */:\n                case 145 /* ObjectKeyword */:\n                case 41 /* AsteriskToken */:\n                case 57 /* QuestionToken */:\n                case 53 /* ExclamationToken */:\n                case 25 /* DotDotDotToken */:\n                case 135 /* InferKeyword */:\n                case 99 /* ImportKeyword */:\n                case 127 /* AssertsKeyword */:\n                case 14 /* NoSubstitutionTemplateLiteral */:\n                case 15 /* TemplateHead */:\n                    return true;\n                case 97 /* FunctionKeyword */:\n                    return !inStartOfParameter;\n                case 40 /* MinusToken */:\n                    return !inStartOfParameter && lookAhead(nextTokenIsNumericOrBigIntLiteral);\n                case 20 /* OpenParenToken */:\n                    // Only consider '(' the start of a type if followed by ')', '...', an identifier, a modifier,\n                    // or something that starts a type. We don't want to consider things like '(1)' a type.\n                    return !inStartOfParameter && lookAhead(isStartOfParenthesizedOrFunctionType);\n                default:\n                    return isIdentifier();\n            }\n        }\n        function isStartOfParenthesizedOrFunctionType() {\n            nextToken();\n            return token() === 21 /* CloseParenToken */ || isStartOfParameter(/*isJSDocParameter*/ false) || isStartOfType();\n        }\n        function parsePostfixTypeOrHigher() {\n            var pos = getNodePos();\n            var type = parseNonArrayType();\n            while (!scanner.hasPrecedingLineBreak()) {\n                switch (token()) {\n                    case 53 /* ExclamationToken */:\n                        nextToken();\n                        type = finishNode(factory.createJSDocNonNullableType(type), pos);\n                        break;\n                    case 57 /* QuestionToken */:\n                        // If next token is start of a type we have a conditional type\n                        if (lookAhead(nextTokenIsStartOfType)) {\n                            return type;\n                        }\n                        nextToken();\n                        type = finishNode(factory.createJSDocNullableType(type), pos);\n                        break;\n                    case 22 /* OpenBracketToken */:\n                        parseExpected(22 /* OpenBracketToken */);\n                        if (isStartOfType()) {\n                            var indexType = parseType();\n                            parseExpected(23 /* CloseBracketToken */);\n                            type = finishNode(factory.createIndexedAccessTypeNode(type, indexType), pos);\n                        }\n                        else {\n                            parseExpected(23 /* CloseBracketToken */);\n                            type = finishNode(factory.createArrayTypeNode(type), pos);\n                        }\n                        break;\n                    default:\n                        return type;\n                }\n            }\n            return type;\n        }\n        function parseTypeOperator(operator) {\n            var pos = getNodePos();\n            parseExpected(operator);\n            return finishNode(factory.createTypeOperatorNode(operator, parseTypeOperatorOrHigher()), pos);\n        }\n        function parseTypeParameterOfInferType() {\n            var pos = getNodePos();\n            return finishNode(factory.createTypeParameterDeclaration(parseIdentifier(), \n            /*constraint*/ undefined, \n            /*defaultType*/ undefined), pos);\n        }\n        function parseInferType() {\n            var pos = getNodePos();\n            parseExpected(135 /* InferKeyword */);\n            return finishNode(factory.createInferTypeNode(parseTypeParameterOfInferType()), pos);\n        }\n        function parseTypeOperatorOrHigher() {\n            var operator = token();\n            switch (operator) {\n                case 138 /* KeyOfKeyword */:\n                case 151 /* UniqueKeyword */:\n                case 142 /* ReadonlyKeyword */:\n                    return parseTypeOperator(operator);\n                case 135 /* InferKeyword */:\n                    return parseInferType();\n            }\n            return parsePostfixTypeOrHigher();\n        }\n        function parseFunctionOrConstructorTypeToError(isInUnionType) {\n            // the function type and constructor type shorthand notation\n            // are not allowed directly in unions and intersections, but we'll\n            // try to parse them gracefully and issue a helpful message.\n            if (isStartOfFunctionTypeOrConstructorType()) {\n                var type = parseFunctionOrConstructorType();\n                var diagnostic = void 0;\n                if (ts.isFunctionTypeNode(type)) {\n                    diagnostic = isInUnionType\n                        ? ts.Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_a_union_type\n                        : ts.Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type;\n                }\n                else {\n                    diagnostic = isInUnionType\n                        ? ts.Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type\n                        : ts.Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type;\n                }\n                parseErrorAtRange(type, diagnostic);\n                return type;\n            }\n            return undefined;\n        }\n        function parseUnionOrIntersectionType(operator, parseConstituentType, createTypeNode) {\n            var pos = getNodePos();\n            var isUnionType = operator === 51 /* BarToken */;\n            var hasLeadingOperator = parseOptional(operator);\n            var type = hasLeadingOperator && parseFunctionOrConstructorTypeToError(isUnionType)\n                || parseConstituentType();\n            if (token() === operator || hasLeadingOperator) {\n                var types = [type];\n                while (parseOptional(operator)) {\n                    types.push(parseFunctionOrConstructorTypeToError(isUnionType) || parseConstituentType());\n                }\n                type = finishNode(createTypeNode(createNodeArray(types, pos)), pos);\n            }\n            return type;\n        }\n        function parseIntersectionTypeOrHigher() {\n            return parseUnionOrIntersectionType(50 /* AmpersandToken */, parseTypeOperatorOrHigher, factory.createIntersectionTypeNode);\n        }\n        function parseUnionTypeOrHigher() {\n            return parseUnionOrIntersectionType(51 /* BarToken */, parseIntersectionTypeOrHigher, factory.createUnionTypeNode);\n        }\n        function nextTokenIsNewKeyword() {\n            nextToken();\n            return token() === 102 /* NewKeyword */;\n        }\n        function isStartOfFunctionTypeOrConstructorType() {\n            if (token() === 29 /* LessThanToken */) {\n                return true;\n            }\n            if (token() === 20 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType)) {\n                return true;\n            }\n            return token() === 102 /* NewKeyword */ ||\n                token() === 125 /* AbstractKeyword */ && lookAhead(nextTokenIsNewKeyword);\n        }\n        function skipParameterStart() {\n            if (ts.isModifierKind(token())) {\n                // Skip modifiers\n                parseModifiers();\n            }\n            if (isIdentifier() || token() === 107 /* ThisKeyword */) {\n                nextToken();\n                return true;\n            }\n            if (token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */) {\n                // Return true if we can parse an array or object binding pattern with no errors\n                var previousErrorCount = parseDiagnostics.length;\n                parseIdentifierOrPattern();\n                return previousErrorCount === parseDiagnostics.length;\n            }\n            return false;\n        }\n        function isUnambiguouslyStartOfFunctionType() {\n            nextToken();\n            if (token() === 21 /* CloseParenToken */ || token() === 25 /* DotDotDotToken */) {\n                // ( )\n                // ( ...\n                return true;\n            }\n            if (skipParameterStart()) {\n                // We successfully skipped modifiers (if any) and an identifier or binding pattern,\n                // now see if we have something that indicates a parameter declaration\n                if (token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ ||\n                    token() === 57 /* QuestionToken */ || token() === 62 /* EqualsToken */) {\n                    // ( xxx :\n                    // ( xxx ,\n                    // ( xxx ?\n                    // ( xxx =\n                    return true;\n                }\n                if (token() === 21 /* CloseParenToken */) {\n                    nextToken();\n                    if (token() === 38 /* EqualsGreaterThanToken */) {\n                        // ( xxx ) =>\n                        return true;\n                    }\n                }\n            }\n            return false;\n        }\n        function parseTypeOrTypePredicate() {\n            var pos = getNodePos();\n            var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix);\n            var type = parseType();\n            if (typePredicateVariable) {\n                return finishNode(factory.createTypePredicateNode(/*assertsModifier*/ undefined, typePredicateVariable, type), pos);\n            }\n            else {\n                return type;\n            }\n        }\n        function parseTypePredicatePrefix() {\n            var id = parseIdentifier();\n            if (token() === 137 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) {\n                nextToken();\n                return id;\n            }\n        }\n        function parseAssertsTypePredicate() {\n            var pos = getNodePos();\n            var assertsModifier = parseExpectedToken(127 /* AssertsKeyword */);\n            var parameterName = token() === 107 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier();\n            var type = parseOptional(137 /* IsKeyword */) ? parseType() : undefined;\n            return finishNode(factory.createTypePredicateNode(assertsModifier, parameterName, type), pos);\n        }\n        function parseType() {\n            // The rules about 'yield' only apply to actual code/expression contexts.  They don't\n            // apply to 'type' contexts.  So we disable these parameters here before moving on.\n            return doOutsideOfContext(40960 /* TypeExcludesFlags */, parseTypeWorker);\n        }\n        function parseTypeWorker(noConditionalTypes) {\n            if (isStartOfFunctionTypeOrConstructorType()) {\n                return parseFunctionOrConstructorType();\n            }\n            var pos = getNodePos();\n            var type = parseUnionTypeOrHigher();\n            if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(93 /* ExtendsKeyword */)) {\n                // The type following 'extends' is not permitted to be another conditional type\n                var extendsType = parseTypeWorker(/*noConditionalTypes*/ true);\n                parseExpected(57 /* QuestionToken */);\n                var trueType = parseTypeWorker();\n                parseExpected(58 /* ColonToken */);\n                var falseType = parseTypeWorker();\n                return finishNode(factory.createConditionalTypeNode(type, extendsType, trueType, falseType), pos);\n            }\n            return type;\n        }\n        function parseTypeAnnotation() {\n            return parseOptional(58 /* ColonToken */) ? parseType() : undefined;\n        }\n        // EXPRESSIONS\n        function isStartOfLeftHandSideExpression() {\n            switch (token()) {\n                case 107 /* ThisKeyword */:\n                case 105 /* SuperKeyword */:\n                case 103 /* NullKeyword */:\n                case 109 /* TrueKeyword */:\n                case 94 /* FalseKeyword */:\n                case 8 /* NumericLiteral */:\n                case 9 /* BigIntLiteral */:\n                case 10 /* StringLiteral */:\n                case 14 /* NoSubstitutionTemplateLiteral */:\n                case 15 /* TemplateHead */:\n                case 20 /* OpenParenToken */:\n                case 22 /* OpenBracketToken */:\n                case 18 /* OpenBraceToken */:\n                case 97 /* FunctionKeyword */:\n                case 83 /* ClassKeyword */:\n                case 102 /* NewKeyword */:\n                case 43 /* SlashToken */:\n                case 67 /* SlashEqualsToken */:\n                case 78 /* Identifier */:\n                    return true;\n                case 99 /* ImportKeyword */:\n                    return lookAhead(nextTokenIsOpenParenOrLessThanOrDot);\n                default:\n                    return isIdentifier();\n            }\n        }\n        function isStartOfExpression() {\n            if (isStartOfLeftHandSideExpression()) {\n                return true;\n            }\n            switch (token()) {\n                case 39 /* PlusToken */:\n                case 40 /* MinusToken */:\n                case 54 /* TildeToken */:\n                case 53 /* ExclamationToken */:\n                case 88 /* DeleteKeyword */:\n                case 111 /* TypeOfKeyword */:\n                case 113 /* VoidKeyword */:\n                case 45 /* PlusPlusToken */:\n                case 46 /* MinusMinusToken */:\n                case 29 /* LessThanToken */:\n                case 130 /* AwaitKeyword */:\n                case 124 /* YieldKeyword */:\n                case 79 /* PrivateIdentifier */:\n                    // Yield/await always starts an expression.  Either it is an identifier (in which case\n                    // it is definitely an expression).  Or it's a keyword (either because we're in\n                    // a generator or async function, or in strict mode (or both)) and it started a yield or await expression.\n                    return true;\n                default:\n                    // Error tolerance.  If we see the start of some binary operator, we consider\n                    // that the start of an expression.  That way we'll parse out a missing identifier,\n                    // give a good message about an identifier being missing, and then consume the\n                    // rest of the binary expression.\n                    if (isBinaryOperator()) {\n                        return true;\n                    }\n                    return isIdentifier();\n            }\n        }\n        function isStartOfExpressionStatement() {\n            // As per the grammar, none of '{' or 'function' or 'class' can start an expression statement.\n            return token() !== 18 /* OpenBraceToken */ &&\n                token() !== 97 /* FunctionKeyword */ &&\n                token() !== 83 /* ClassKeyword */ &&\n                token() !== 59 /* AtToken */ &&\n                isStartOfExpression();\n        }\n        function parseExpression() {\n            // Expression[in]:\n            //      AssignmentExpression[in]\n            //      Expression[in] , AssignmentExpression[in]\n            // clear the decorator context when parsing Expression, as it should be unambiguous when parsing a decorator\n            var saveDecoratorContext = inDecoratorContext();\n            if (saveDecoratorContext) {\n                setDecoratorContext(/*val*/ false);\n            }\n            var pos = getNodePos();\n            var expr = parseAssignmentExpressionOrHigher();\n            var operatorToken;\n            while ((operatorToken = parseOptionalToken(27 /* CommaToken */))) {\n                expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(), pos);\n            }\n            if (saveDecoratorContext) {\n                setDecoratorContext(/*val*/ true);\n            }\n            return expr;\n        }\n        function parseInitializer() {\n            return parseOptional(62 /* EqualsToken */) ? parseAssignmentExpressionOrHigher() : undefined;\n        }\n        function parseAssignmentExpressionOrHigher() {\n            //  AssignmentExpression[in,yield]:\n            //      1) ConditionalExpression[?in,?yield]\n            //      2) LeftHandSideExpression = AssignmentExpression[?in,?yield]\n            //      3) LeftHandSideExpression AssignmentOperator AssignmentExpression[?in,?yield]\n            //      4) ArrowFunctionExpression[?in,?yield]\n            //      5) AsyncArrowFunctionExpression[in,yield,await]\n            //      6) [+Yield] YieldExpression[?In]\n            //\n            // Note: for ease of implementation we treat productions '2' and '3' as the same thing.\n            // (i.e. they're both BinaryExpressions with an assignment operator in it).\n            // First, do the simple check if we have a YieldExpression (production '6').\n            if (isYieldExpression()) {\n                return parseYieldExpression();\n            }\n            // Then, check if we have an arrow function (production '4' and '5') that starts with a parenthesized\n            // parameter list or is an async arrow function.\n            // AsyncArrowFunctionExpression:\n            //      1) async[no LineTerminator here]AsyncArrowBindingIdentifier[?Yield][no LineTerminator here]=>AsyncConciseBody[?In]\n            //      2) CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await][no LineTerminator here]=>AsyncConciseBody[?In]\n            // Production (1) of AsyncArrowFunctionExpression is parsed in \"tryParseAsyncSimpleArrowFunctionExpression\".\n            // And production (2) is parsed in \"tryParseParenthesizedArrowFunctionExpression\".\n            //\n            // If we do successfully parse arrow-function, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is\n            // not a LeftHandSideExpression, nor does it start a ConditionalExpression.  So we are done\n            // with AssignmentExpression if we see one.\n            var arrowExpression = tryParseParenthesizedArrowFunctionExpression() || tryParseAsyncSimpleArrowFunctionExpression();\n            if (arrowExpression) {\n                return arrowExpression;\n            }\n            // Now try to see if we're in production '1', '2' or '3'.  A conditional expression can\n            // start with a LogicalOrExpression, while the assignment productions can only start with\n            // LeftHandSideExpressions.\n            //\n            // So, first, we try to just parse out a BinaryExpression.  If we get something that is a\n            // LeftHandSide or higher, then we can try to parse out the assignment expression part.\n            // Otherwise, we try to parse out the conditional expression bit.  We want to allow any\n            // binary expression here, so we pass in the 'lowest' precedence here so that it matches\n            // and consumes anything.\n            var pos = getNodePos();\n            var expr = parseBinaryExpressionOrHigher(0 /* Lowest */);\n            // To avoid a look-ahead, we did not handle the case of an arrow function with a single un-parenthesized\n            // parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single\n            // identifier and the current token is an arrow.\n            if (expr.kind === 78 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) {\n                return parseSimpleArrowFunctionExpression(pos, expr, /*asyncModifier*/ undefined);\n            }\n            // Now see if we might be in cases '2' or '3'.\n            // If the expression was a LHS expression, and we have an assignment operator, then\n            // we're in '2' or '3'. Consume the assignment and return.\n            //\n            // Note: we call reScanGreaterToken so that we get an appropriately merged token\n            // for cases like `> > =` becoming `>>=`\n            if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) {\n                return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(), pos);\n            }\n            // It wasn't an assignment or a lambda.  This is a conditional expression:\n            return parseConditionalExpressionRest(expr, pos);\n        }\n        function isYieldExpression() {\n            if (token() === 124 /* YieldKeyword */) {\n                // If we have a 'yield' keyword, and this is a context where yield expressions are\n                // allowed, then definitely parse out a yield expression.\n                if (inYieldContext()) {\n                    return true;\n                }\n                // We're in a context where 'yield expr' is not allowed.  However, if we can\n                // definitely tell that the user was trying to parse a 'yield expr' and not\n                // just a normal expr that start with a 'yield' identifier, then parse out\n                // a 'yield expr'.  We can then report an error later that they are only\n                // allowed in generator expressions.\n                //\n                // for example, if we see 'yield(foo)', then we'll have to treat that as an\n                // invocation expression of something called 'yield'.  However, if we have\n                // 'yield foo' then that is not legal as a normal expression, so we can\n                // definitely recognize this as a yield expression.\n                //\n                // for now we just check if the next token is an identifier.  More heuristics\n                // can be added here later as necessary.  We just need to make sure that we\n                // don't accidentally consume something legal.\n                return lookAhead(nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine);\n            }\n            return false;\n        }\n        function nextTokenIsIdentifierOnSameLine() {\n            nextToken();\n            return !scanner.hasPrecedingLineBreak() && isIdentifier();\n        }\n        function parseYieldExpression() {\n            var pos = getNodePos();\n            // YieldExpression[In] :\n            //      yield\n            //      yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield]\n            //      yield [no LineTerminator here] * [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield]\n            nextToken();\n            if (!scanner.hasPrecedingLineBreak() &&\n                (token() === 41 /* AsteriskToken */ || isStartOfExpression())) {\n                return finishNode(factory.createYieldExpression(parseOptionalToken(41 /* AsteriskToken */), parseAssignmentExpressionOrHigher()), pos);\n            }\n            else {\n                // if the next token is not on the same line as yield.  or we don't have an '*' or\n                // the start of an expression, then this is just a simple \"yield\" expression.\n                return finishNode(factory.createYieldExpression(/*asteriskToken*/ undefined, /*expression*/ undefined), pos);\n            }\n        }\n        function parseSimpleArrowFunctionExpression(pos, identifier, asyncModifier) {\n            ts.Debug.assert(token() === 38 /* EqualsGreaterThanToken */, \"parseSimpleArrowFunctionExpression should only have been called if we had a =>\");\n            var parameter = factory.createParameterDeclaration(\n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, \n            /*dotDotDotToken*/ undefined, identifier, \n            /*questionToken*/ undefined, \n            /*type*/ undefined, \n            /*initializer*/ undefined);\n            finishNode(parameter, identifier.pos);\n            var parameters = createNodeArray([parameter], parameter.pos, parameter.end);\n            var equalsGreaterThanToken = parseExpectedToken(38 /* EqualsGreaterThanToken */);\n            var body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier);\n            var node = factory.createArrowFunction(asyncModifier, /*typeParameters*/ undefined, parameters, /*type*/ undefined, equalsGreaterThanToken, body);\n            return addJSDocComment(finishNode(node, pos));\n        }\n        function tryParseParenthesizedArrowFunctionExpression() {\n            var triState = isParenthesizedArrowFunctionExpression();\n            if (triState === 0 /* False */) {\n                // It's definitely not a parenthesized arrow function expression.\n                return undefined;\n            }\n            // If we definitely have an arrow function, then we can just parse one, not requiring a\n            // following => or { token. Otherwise, we *might* have an arrow function.  Try to parse\n            // it out, but don't allow any ambiguity, and return 'undefined' if this could be an\n            // expression instead.\n            return triState === 1 /* True */ ?\n                parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ true) :\n                tryParse(parsePossibleParenthesizedArrowFunctionExpression);\n        }\n        //  True        -> We definitely expect a parenthesized arrow function here.\n        //  False       -> There *cannot* be a parenthesized arrow function here.\n        //  Unknown     -> There *might* be a parenthesized arrow function here.\n        //                 Speculatively look ahead to be sure, and rollback if not.\n        function isParenthesizedArrowFunctionExpression() {\n            if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 129 /* AsyncKeyword */) {\n                return lookAhead(isParenthesizedArrowFunctionExpressionWorker);\n            }\n            if (token() === 38 /* EqualsGreaterThanToken */) {\n                // ERROR RECOVERY TWEAK:\n                // If we see a standalone => try to parse it as an arrow function expression as that's\n                // likely what the user intended to write.\n                return 1 /* True */;\n            }\n            // Definitely not a parenthesized arrow function.\n            return 0 /* False */;\n        }\n        function isParenthesizedArrowFunctionExpressionWorker() {\n            if (token() === 129 /* AsyncKeyword */) {\n                nextToken();\n                if (scanner.hasPrecedingLineBreak()) {\n                    return 0 /* False */;\n                }\n                if (token() !== 20 /* OpenParenToken */ && token() !== 29 /* LessThanToken */) {\n                    return 0 /* False */;\n                }\n            }\n            var first = token();\n            var second = nextToken();\n            if (first === 20 /* OpenParenToken */) {\n                if (second === 21 /* CloseParenToken */) {\n                    // Simple cases: \"() =>\", \"(): \", and \"() {\".\n                    // This is an arrow function with no parameters.\n                    // The last one is not actually an arrow function,\n                    // but this is probably what the user intended.\n                    var third = nextToken();\n                    switch (third) {\n                        case 38 /* EqualsGreaterThanToken */:\n                        case 58 /* ColonToken */:\n                        case 18 /* OpenBraceToken */:\n                            return 1 /* True */;\n                        default:\n                            return 0 /* False */;\n                    }\n                }\n                // If encounter \"([\" or \"({\", this could be the start of a binding pattern.\n                // Examples:\n                //      ([ x ]) => { }\n                //      ({ x }) => { }\n                //      ([ x ])\n                //      ({ x })\n                if (second === 22 /* OpenBracketToken */ || second === 18 /* OpenBraceToken */) {\n                    return 2 /* Unknown */;\n                }\n                // Simple case: \"(...\"\n                // This is an arrow function with a rest parameter.\n                if (second === 25 /* DotDotDotToken */) {\n                    return 1 /* True */;\n                }\n                // Check for \"(xxx yyy\", where xxx is a modifier and yyy is an identifier. This\n                // isn't actually allowed, but we want to treat it as a lambda so we can provide\n                // a good error message.\n                if (ts.isModifierKind(second) && second !== 129 /* AsyncKeyword */ && lookAhead(nextTokenIsIdentifier)) {\n                    return 1 /* True */;\n                }\n                // If we had \"(\" followed by something that's not an identifier,\n                // then this definitely doesn't look like a lambda.  \"this\" is not\n                // valid, but we want to parse it and then give a semantic error.\n                if (!isIdentifier() && second !== 107 /* ThisKeyword */) {\n                    return 0 /* False */;\n                }\n                switch (nextToken()) {\n                    case 58 /* ColonToken */:\n                        // If we have something like \"(a:\", then we must have a\n                        // type-annotated parameter in an arrow function expression.\n                        return 1 /* True */;\n                    case 57 /* QuestionToken */:\n                        nextToken();\n                        // If we have \"(a?:\" or \"(a?,\" or \"(a?=\" or \"(a?)\" then it is definitely a lambda.\n                        if (token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 62 /* EqualsToken */ || token() === 21 /* CloseParenToken */) {\n                            return 1 /* True */;\n                        }\n                        // Otherwise it is definitely not a lambda.\n                        return 0 /* False */;\n                    case 27 /* CommaToken */:\n                    case 62 /* EqualsToken */:\n                    case 21 /* CloseParenToken */:\n                        // If we have \"(a,\" or \"(a=\" or \"(a)\" this *could* be an arrow function\n                        return 2 /* Unknown */;\n                }\n                // It is definitely not an arrow function\n                return 0 /* False */;\n            }\n            else {\n                ts.Debug.assert(first === 29 /* LessThanToken */);\n                // If we have \"<\" not followed by an identifier,\n                // then this definitely is not an arrow function.\n                if (!isIdentifier()) {\n                    return 0 /* False */;\n                }\n                // JSX overrides\n                if (languageVariant === 1 /* JSX */) {\n                    var isArrowFunctionInJsx = lookAhead(function () {\n                        var third = nextToken();\n                        if (third === 93 /* ExtendsKeyword */) {\n                            var fourth = nextToken();\n                            switch (fourth) {\n                                case 62 /* EqualsToken */:\n                                case 31 /* GreaterThanToken */:\n                                    return false;\n                                default:\n                                    return true;\n                            }\n                        }\n                        else if (third === 27 /* CommaToken */) {\n                            return true;\n                        }\n                        return false;\n                    });\n                    if (isArrowFunctionInJsx) {\n                        return 1 /* True */;\n                    }\n                    return 0 /* False */;\n                }\n                // This *could* be a parenthesized arrow function.\n                return 2 /* Unknown */;\n            }\n        }\n        function parsePossibleParenthesizedArrowFunctionExpression() {\n            var tokenPos = scanner.getTokenPos();\n            if (notParenthesizedArrow === null || notParenthesizedArrow === void 0 ? void 0 : notParenthesizedArrow.has(tokenPos)) {\n                return undefined;\n            }\n            var result = parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ false);\n            if (!result) {\n                (notParenthesizedArrow || (notParenthesizedArrow = new ts.Set())).add(tokenPos);\n            }\n            return result;\n        }\n        function tryParseAsyncSimpleArrowFunctionExpression() {\n            // We do a check here so that we won't be doing unnecessarily call to \"lookAhead\"\n            if (token() === 129 /* AsyncKeyword */) {\n                if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) {\n                    var pos = getNodePos();\n                    var asyncModifier = parseModifiersForArrowFunction();\n                    var expr = parseBinaryExpressionOrHigher(0 /* Lowest */);\n                    return parseSimpleArrowFunctionExpression(pos, expr, asyncModifier);\n                }\n            }\n            return undefined;\n        }\n        function isUnParenthesizedAsyncArrowFunctionWorker() {\n            // AsyncArrowFunctionExpression:\n            //      1) async[no LineTerminator here]AsyncArrowBindingIdentifier[?Yield][no LineTerminator here]=>AsyncConciseBody[?In]\n            //      2) CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await][no LineTerminator here]=>AsyncConciseBody[?In]\n            if (token() === 129 /* AsyncKeyword */) {\n                nextToken();\n                // If the \"async\" is followed by \"=>\" token then it is not a beginning of an async arrow-function\n                // but instead a simple arrow-function which will be parsed inside \"parseAssignmentExpressionOrHigher\"\n                if (scanner.hasPrecedingLineBreak() || token() === 38 /* EqualsGreaterThanToken */) {\n                    return 0 /* False */;\n                }\n                // Check for un-parenthesized AsyncArrowFunction\n                var expr = parseBinaryExpressionOrHigher(0 /* Lowest */);\n                if (!scanner.hasPrecedingLineBreak() && expr.kind === 78 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) {\n                    return 1 /* True */;\n                }\n            }\n            return 0 /* False */;\n        }\n        function parseParenthesizedArrowFunctionExpression(allowAmbiguity) {\n            var pos = getNodePos();\n            var hasJSDoc = hasPrecedingJSDocComment();\n            var modifiers = parseModifiersForArrowFunction();\n            var isAsync = ts.some(modifiers, ts.isAsyncModifier) ? 2 /* Await */ : 0 /* None */;\n            // Arrow functions are never generators.\n            //\n            // If we're speculatively parsing a signature for a parenthesized arrow function, then\n            // we have to have a complete parameter list.  Otherwise we might see something like\n            // a => (b => c)\n            // And think that \"(b =>\" was actually a parenthesized arrow function with a missing\n            // close paren.\n            var typeParameters = parseTypeParameters();\n            var parameters;\n            if (!parseExpected(20 /* OpenParenToken */)) {\n                if (!allowAmbiguity) {\n                    return undefined;\n                }\n                parameters = createMissingList();\n            }\n            else {\n                parameters = parseParametersWorker(isAsync);\n                if (!parseExpected(21 /* CloseParenToken */) && !allowAmbiguity) {\n                    return undefined;\n                }\n            }\n            var type = parseReturnType(58 /* ColonToken */, /*isType*/ false);\n            if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {\n                return undefined;\n            }\n            // Parsing a signature isn't enough.\n            // Parenthesized arrow signatures often look like other valid expressions.\n            // For instance:\n            //  - \"(x = 10)\" is an assignment expression parsed as a signature with a default parameter value.\n            //  - \"(x,y)\" is a comma expression parsed as a signature with two parameters.\n            //  - \"a ? (b): c\" will have \"(b):\" parsed as a signature with a return type annotation.\n            //  - \"a ? (b): function() {}\" will too, since function() is a valid JSDoc function type.\n            //\n            // So we need just a bit of lookahead to ensure that it can only be a signature.\n            var hasJSDocFunctionType = type && ts.isJSDocFunctionType(type);\n            if (!allowAmbiguity && token() !== 38 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) {\n                // Returning undefined here will cause our caller to rewind to where we started from.\n                return undefined;\n            }\n            // If we have an arrow, then try to parse the body. Even if not, try to parse if we\n            // have an opening brace, just in case we're in an error state.\n            var lastToken = token();\n            var equalsGreaterThanToken = parseExpectedToken(38 /* EqualsGreaterThanToken */);\n            var body = (lastToken === 38 /* EqualsGreaterThanToken */ || lastToken === 18 /* OpenBraceToken */)\n                ? parseArrowFunctionExpressionBody(ts.some(modifiers, ts.isAsyncModifier))\n                : parseIdentifier();\n            var node = factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body);\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function parseArrowFunctionExpressionBody(isAsync) {\n            if (token() === 18 /* OpenBraceToken */) {\n                return parseFunctionBlock(isAsync ? 2 /* Await */ : 0 /* None */);\n            }\n            if (token() !== 26 /* SemicolonToken */ &&\n                token() !== 97 /* FunctionKeyword */ &&\n                token() !== 83 /* ClassKeyword */ &&\n                isStartOfStatement() &&\n                !isStartOfExpressionStatement()) {\n                // Check if we got a plain statement (i.e. no expression-statements, no function/class expressions/declarations)\n                //\n                // Here we try to recover from a potential error situation in the case where the\n                // user meant to supply a block. For example, if the user wrote:\n                //\n                //  a =>\n                //      let v = 0;\n                //  }\n                //\n                // they may be missing an open brace.  Check to see if that's the case so we can\n                // try to recover better.  If we don't do this, then the next close curly we see may end\n                // up preemptively closing the containing construct.\n                //\n                // Note: even when 'IgnoreMissingOpenBrace' is passed, parseBody will still error.\n                return parseFunctionBlock(16 /* IgnoreMissingOpenBrace */ | (isAsync ? 2 /* Await */ : 0 /* None */));\n            }\n            var savedTopLevel = topLevel;\n            topLevel = false;\n            var node = isAsync\n                ? doInAwaitContext(parseAssignmentExpressionOrHigher)\n                : doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);\n            topLevel = savedTopLevel;\n            return node;\n        }\n        function parseConditionalExpressionRest(leftOperand, pos) {\n            // Note: we are passed in an expression which was produced from parseBinaryExpressionOrHigher.\n            var questionToken = parseOptionalToken(57 /* QuestionToken */);\n            if (!questionToken) {\n                return leftOperand;\n            }\n            // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and\n            // we do not that for the 'whenFalse' part.\n            var colonToken;\n            return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher), colonToken = parseExpectedToken(58 /* ColonToken */), ts.nodeIsPresent(colonToken)\n                ? parseAssignmentExpressionOrHigher()\n                : createMissingNode(78 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(58 /* ColonToken */))), pos);\n        }\n        function parseBinaryExpressionOrHigher(precedence) {\n            var pos = getNodePos();\n            var leftOperand = parseUnaryExpressionOrHigher();\n            return parseBinaryExpressionRest(precedence, leftOperand, pos);\n        }\n        function isInOrOfKeyword(t) {\n            return t === 100 /* InKeyword */ || t === 156 /* OfKeyword */;\n        }\n        function parseBinaryExpressionRest(precedence, leftOperand, pos) {\n            while (true) {\n                // We either have a binary operator here, or we're finished.  We call\n                // reScanGreaterToken so that we merge token sequences like > and = into >=\n                reScanGreaterToken();\n                var newPrecedence = ts.getBinaryOperatorPrecedence(token());\n                // Check the precedence to see if we should \"take\" this operator\n                // - For left associative operator (all operator but **), consume the operator,\n                //   recursively call the function below, and parse binaryExpression as a rightOperand\n                //   of the caller if the new precedence of the operator is greater then or equal to the current precedence.\n                //   For example:\n                //      a - b - c;\n                //            ^token; leftOperand = b. Return b to the caller as a rightOperand\n                //      a * b - c\n                //            ^token; leftOperand = b. Return b to the caller as a rightOperand\n                //      a - b * c;\n                //            ^token; leftOperand = b. Return b * c to the caller as a rightOperand\n                // - For right associative operator (**), consume the operator, recursively call the function\n                //   and parse binaryExpression as a rightOperand of the caller if the new precedence of\n                //   the operator is strictly grater than the current precedence\n                //   For example:\n                //      a ** b ** c;\n                //             ^^token; leftOperand = b. Return b ** c to the caller as a rightOperand\n                //      a - b ** c;\n                //            ^^token; leftOperand = b. Return b ** c to the caller as a rightOperand\n                //      a ** b - c\n                //             ^token; leftOperand = b. Return b to the caller as a rightOperand\n                var consumeCurrentOperator = token() === 42 /* AsteriskAsteriskToken */ ?\n                    newPrecedence >= precedence :\n                    newPrecedence > precedence;\n                if (!consumeCurrentOperator) {\n                    break;\n                }\n                if (token() === 100 /* InKeyword */ && inDisallowInContext()) {\n                    break;\n                }\n                if (token() === 126 /* AsKeyword */) {\n                    // Make sure we *do* perform ASI for constructs like this:\n                    //    var x = foo\n                    //    as (Bar)\n                    // This should be parsed as an initialized variable, followed\n                    // by a function call to 'as' with the argument 'Bar'\n                    if (scanner.hasPrecedingLineBreak()) {\n                        break;\n                    }\n                    else {\n                        nextToken();\n                        leftOperand = makeAsExpression(leftOperand, parseType());\n                    }\n                }\n                else {\n                    leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence), pos);\n                }\n            }\n            return leftOperand;\n        }\n        function isBinaryOperator() {\n            if (inDisallowInContext() && token() === 100 /* InKeyword */) {\n                return false;\n            }\n            return ts.getBinaryOperatorPrecedence(token()) > 0;\n        }\n        function makeBinaryExpression(left, operatorToken, right, pos) {\n            return finishNode(factory.createBinaryExpression(left, operatorToken, right), pos);\n        }\n        function makeAsExpression(left, right) {\n            return finishNode(factory.createAsExpression(left, right), left.pos);\n        }\n        function parsePrefixUnaryExpression() {\n            var pos = getNodePos();\n            return finishNode(factory.createPrefixUnaryExpression(token(), nextTokenAnd(parseSimpleUnaryExpression)), pos);\n        }\n        function parseDeleteExpression() {\n            var pos = getNodePos();\n            return finishNode(factory.createDeleteExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos);\n        }\n        function parseTypeOfExpression() {\n            var pos = getNodePos();\n            return finishNode(factory.createTypeOfExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos);\n        }\n        function parseVoidExpression() {\n            var pos = getNodePos();\n            return finishNode(factory.createVoidExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos);\n        }\n        function isAwaitExpression() {\n            if (token() === 130 /* AwaitKeyword */) {\n                if (inAwaitContext()) {\n                    return true;\n                }\n                // here we are using similar heuristics as 'isYieldExpression'\n                return lookAhead(nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine);\n            }\n            return false;\n        }\n        function parseAwaitExpression() {\n            var pos = getNodePos();\n            return finishNode(factory.createAwaitExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos);\n        }\n        /**\n         * Parse ES7 exponential expression and await expression\n         *\n         * ES7 ExponentiationExpression:\n         *      1) UnaryExpression[?Yield]\n         *      2) UpdateExpression[?Yield] ** ExponentiationExpression[?Yield]\n         *\n         */\n        function parseUnaryExpressionOrHigher() {\n            /**\n             * ES7 UpdateExpression:\n             *      1) LeftHandSideExpression[?Yield]\n             *      2) LeftHandSideExpression[?Yield][no LineTerminator here]++\n             *      3) LeftHandSideExpression[?Yield][no LineTerminator here]--\n             *      4) ++UnaryExpression[?Yield]\n             *      5) --UnaryExpression[?Yield]\n             */\n            if (isUpdateExpression()) {\n                var pos = getNodePos();\n                var updateExpression = parseUpdateExpression();\n                return token() === 42 /* AsteriskAsteriskToken */ ?\n                    parseBinaryExpressionRest(ts.getBinaryOperatorPrecedence(token()), updateExpression, pos) :\n                    updateExpression;\n            }\n            /**\n             * ES7 UnaryExpression:\n             *      1) UpdateExpression[?yield]\n             *      2) delete UpdateExpression[?yield]\n             *      3) void UpdateExpression[?yield]\n             *      4) typeof UpdateExpression[?yield]\n             *      5) + UpdateExpression[?yield]\n             *      6) - UpdateExpression[?yield]\n             *      7) ~ UpdateExpression[?yield]\n             *      8) ! UpdateExpression[?yield]\n             */\n            var unaryOperator = token();\n            var simpleUnaryExpression = parseSimpleUnaryExpression();\n            if (token() === 42 /* AsteriskAsteriskToken */) {\n                var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos);\n                var end = simpleUnaryExpression.end;\n                if (simpleUnaryExpression.kind === 206 /* TypeAssertionExpression */) {\n                    parseErrorAt(pos, end, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses);\n                }\n                else {\n                    parseErrorAt(pos, end, ts.Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses, ts.tokenToString(unaryOperator));\n                }\n            }\n            return simpleUnaryExpression;\n        }\n        /**\n         * Parse ES7 simple-unary expression or higher:\n         *\n         * ES7 UnaryExpression:\n         *      1) UpdateExpression[?yield]\n         *      2) delete UnaryExpression[?yield]\n         *      3) void UnaryExpression[?yield]\n         *      4) typeof UnaryExpression[?yield]\n         *      5) + UnaryExpression[?yield]\n         *      6) - UnaryExpression[?yield]\n         *      7) ~ UnaryExpression[?yield]\n         *      8) ! UnaryExpression[?yield]\n         *      9) [+Await] await UnaryExpression[?yield]\n         */\n        function parseSimpleUnaryExpression() {\n            switch (token()) {\n                case 39 /* PlusToken */:\n                case 40 /* MinusToken */:\n                case 54 /* TildeToken */:\n                case 53 /* ExclamationToken */:\n                    return parsePrefixUnaryExpression();\n                case 88 /* DeleteKeyword */:\n                    return parseDeleteExpression();\n                case 111 /* TypeOfKeyword */:\n                    return parseTypeOfExpression();\n                case 113 /* VoidKeyword */:\n                    return parseVoidExpression();\n                case 29 /* LessThanToken */:\n                    // This is modified UnaryExpression grammar in TypeScript\n                    //  UnaryExpression (modified):\n                    //      < type > UnaryExpression\n                    return parseTypeAssertion();\n                case 130 /* AwaitKeyword */:\n                    if (isAwaitExpression()) {\n                        return parseAwaitExpression();\n                    }\n                // falls through\n                default:\n                    return parseUpdateExpression();\n            }\n        }\n        /**\n         * Check if the current token can possibly be an ES7 increment expression.\n         *\n         * ES7 UpdateExpression:\n         *      LeftHandSideExpression[?Yield]\n         *      LeftHandSideExpression[?Yield][no LineTerminator here]++\n         *      LeftHandSideExpression[?Yield][no LineTerminator here]--\n         *      ++LeftHandSideExpression[?Yield]\n         *      --LeftHandSideExpression[?Yield]\n         */\n        function isUpdateExpression() {\n            // This function is called inside parseUnaryExpression to decide\n            // whether to call parseSimpleUnaryExpression or call parseUpdateExpression directly\n            switch (token()) {\n                case 39 /* PlusToken */:\n                case 40 /* MinusToken */:\n                case 54 /* TildeToken */:\n                case 53 /* ExclamationToken */:\n                case 88 /* DeleteKeyword */:\n                case 111 /* TypeOfKeyword */:\n                case 113 /* VoidKeyword */:\n                case 130 /* AwaitKeyword */:\n                    return false;\n                case 29 /* LessThanToken */:\n                    // If we are not in JSX context, we are parsing TypeAssertion which is an UnaryExpression\n                    if (languageVariant !== 1 /* JSX */) {\n                        return false;\n                    }\n                // We are in JSX context and the token is part of JSXElement.\n                // falls through\n                default:\n                    return true;\n            }\n        }\n        /**\n         * Parse ES7 UpdateExpression. UpdateExpression is used instead of ES6's PostFixExpression.\n         *\n         * ES7 UpdateExpression[yield]:\n         *      1) LeftHandSideExpression[?yield]\n         *      2) LeftHandSideExpression[?yield] [[no LineTerminator here]]++\n         *      3) LeftHandSideExpression[?yield] [[no LineTerminator here]]--\n         *      4) ++LeftHandSideExpression[?yield]\n         *      5) --LeftHandSideExpression[?yield]\n         * In TypeScript (2), (3) are parsed as PostfixUnaryExpression. (4), (5) are parsed as PrefixUnaryExpression\n         */\n        function parseUpdateExpression() {\n            if (token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) {\n                var pos = getNodePos();\n                return finishNode(factory.createPrefixUnaryExpression(token(), nextTokenAnd(parseLeftHandSideExpressionOrHigher)), pos);\n            }\n            else if (languageVariant === 1 /* JSX */ && token() === 29 /* LessThanToken */ && lookAhead(nextTokenIsIdentifierOrKeywordOrGreaterThan)) {\n                // JSXElement is part of primaryExpression\n                return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true);\n            }\n            var expression = parseLeftHandSideExpressionOrHigher();\n            ts.Debug.assert(ts.isLeftHandSideExpression(expression));\n            if ((token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) {\n                var operator = token();\n                nextToken();\n                return finishNode(factory.createPostfixUnaryExpression(expression, operator), expression.pos);\n            }\n            return expression;\n        }\n        function parseLeftHandSideExpressionOrHigher() {\n            // Original Ecma:\n            // LeftHandSideExpression: See 11.2\n            //      NewExpression\n            //      CallExpression\n            //\n            // Our simplification:\n            //\n            // LeftHandSideExpression: See 11.2\n            //      MemberExpression\n            //      CallExpression\n            //\n            // See comment in parseMemberExpressionOrHigher on how we replaced NewExpression with\n            // MemberExpression to make our lives easier.\n            //\n            // to best understand the below code, it's important to see how CallExpression expands\n            // out into its own productions:\n            //\n            // CallExpression:\n            //      MemberExpression Arguments\n            //      CallExpression Arguments\n            //      CallExpression[Expression]\n            //      CallExpression.IdentifierName\n            //      import (AssignmentExpression)\n            //      super Arguments\n            //      super.IdentifierName\n            //\n            // Because of the recursion in these calls, we need to bottom out first. There are three\n            // bottom out states we can run into: 1) We see 'super' which must start either of\n            // the last two CallExpression productions. 2) We see 'import' which must start import call.\n            // 3)we have a MemberExpression which either completes the LeftHandSideExpression,\n            // or starts the beginning of the first four CallExpression productions.\n            var pos = getNodePos();\n            var expression;\n            if (token() === 99 /* ImportKeyword */) {\n                if (lookAhead(nextTokenIsOpenParenOrLessThan)) {\n                    // We don't want to eagerly consume all import keyword as import call expression so we look ahead to find \"(\"\n                    // For example:\n                    //      var foo3 = require(\"subfolder\n                    //      import * as foo1 from \"module-from-node\n                    // We want this import to be a statement rather than import call expression\n                    sourceFlags |= 1048576 /* PossiblyContainsDynamicImport */;\n                    expression = parseTokenNode();\n                }\n                else if (lookAhead(nextTokenIsDot)) {\n                    // This is an 'import.*' metaproperty (i.e. 'import.meta')\n                    nextToken(); // advance past the 'import'\n                    nextToken(); // advance past the dot\n                    expression = finishNode(factory.createMetaProperty(99 /* ImportKeyword */, parseIdentifierName()), pos);\n                    sourceFlags |= 2097152 /* PossiblyContainsImportMeta */;\n                }\n                else {\n                    expression = parseMemberExpressionOrHigher();\n                }\n            }\n            else {\n                expression = token() === 105 /* SuperKeyword */ ? parseSuperExpression() : parseMemberExpressionOrHigher();\n            }\n            // Now, we *may* be complete.  However, we might have consumed the start of a\n            // CallExpression or OptionalExpression.  As such, we need to consume the rest\n            // of it here to be complete.\n            return parseCallExpressionRest(pos, expression);\n        }\n        function parseMemberExpressionOrHigher() {\n            // Note: to make our lives simpler, we decompose the NewExpression productions and\n            // place ObjectCreationExpression and FunctionExpression into PrimaryExpression.\n            // like so:\n            //\n            //   PrimaryExpression : See 11.1\n            //      this\n            //      Identifier\n            //      Literal\n            //      ArrayLiteral\n            //      ObjectLiteral\n            //      (Expression)\n            //      FunctionExpression\n            //      new MemberExpression Arguments?\n            //\n            //   MemberExpression : See 11.2\n            //      PrimaryExpression\n            //      MemberExpression[Expression]\n            //      MemberExpression.IdentifierName\n            //\n            //   CallExpression : See 11.2\n            //      MemberExpression\n            //      CallExpression Arguments\n            //      CallExpression[Expression]\n            //      CallExpression.IdentifierName\n            //\n            // Technically this is ambiguous.  i.e. CallExpression defines:\n            //\n            //   CallExpression:\n            //      CallExpression Arguments\n            //\n            // If you see: \"new Foo()\"\n            //\n            // Then that could be treated as a single ObjectCreationExpression, or it could be\n            // treated as the invocation of \"new Foo\".  We disambiguate that in code (to match\n            // the original grammar) by making sure that if we see an ObjectCreationExpression\n            // we always consume arguments if they are there. So we treat \"new Foo()\" as an\n            // object creation only, and not at all as an invocation.  Another way to think\n            // about this is that for every \"new\" that we see, we will consume an argument list if\n            // it is there as part of the *associated* object creation node.  Any additional\n            // argument lists we see, will become invocation expressions.\n            //\n            // Because there are no other places in the grammar now that refer to FunctionExpression\n            // or ObjectCreationExpression, it is safe to push down into the PrimaryExpression\n            // production.\n            //\n            // Because CallExpression and MemberExpression are left recursive, we need to bottom out\n            // of the recursion immediately.  So we parse out a primary expression to start with.\n            var pos = getNodePos();\n            var expression = parsePrimaryExpression();\n            return parseMemberExpressionRest(pos, expression, /*allowOptionalChain*/ true);\n        }\n        function parseSuperExpression() {\n            var pos = getNodePos();\n            var expression = parseTokenNode();\n            if (token() === 29 /* LessThanToken */) {\n                var startPos = getNodePos();\n                var typeArguments = tryParse(parseTypeArgumentsInExpression);\n                if (typeArguments !== undefined) {\n                    parseErrorAt(startPos, getNodePos(), ts.Diagnostics.super_may_not_use_type_arguments);\n                }\n            }\n            if (token() === 20 /* OpenParenToken */ || token() === 24 /* DotToken */ || token() === 22 /* OpenBracketToken */) {\n                return expression;\n            }\n            // If we have seen \"super\" it must be followed by '(' or '.'.\n            // If it wasn't then just try to parse out a '.' and report an error.\n            parseExpectedToken(24 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);\n            // private names will never work with `super` (`super.#foo`), but that's a semantic error, not syntactic\n            return finishNode(factory.createPropertyAccessExpression(expression, parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ true)), pos);\n        }\n        function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition) {\n            var pos = getNodePos();\n            var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext);\n            var result;\n            if (opening.kind === 275 /* JsxOpeningElement */) {\n                var children = parseJsxChildren(opening);\n                var closingElement = parseJsxClosingElement(inExpressionContext);\n                if (!tagNamesAreEquivalent(opening.tagName, closingElement.tagName)) {\n                    parseErrorAtRange(closingElement, ts.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, ts.getTextOfNodeFromSourceText(sourceText, opening.tagName));\n                }\n                result = finishNode(factory.createJsxElement(opening, children, closingElement), pos);\n            }\n            else if (opening.kind === 278 /* JsxOpeningFragment */) {\n                result = finishNode(factory.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos);\n            }\n            else {\n                ts.Debug.assert(opening.kind === 274 /* JsxSelfClosingElement */);\n                // Nothing else to do for self-closing elements\n                result = opening;\n            }\n            // If the user writes the invalid code '<div></div><div></div>' in an expression context (i.e. not wrapped in\n            // an enclosing tag), we'll naively try to parse   ^ this as a 'less than' operator and the remainder of the tag\n            // as garbage, which will cause the formatter to badly mangle the JSX. Perform a speculative parse of a JSX\n            // element if we see a < token so that we can wrap it in a synthetic binary expression so the formatter\n            // does less damage and we can report a better error.\n            // Since JSX elements are invalid < operands anyway, this lookahead parse will only occur in error scenarios\n            // of one sort or another.\n            if (inExpressionContext && token() === 29 /* LessThanToken */) {\n                var topBadPos_1 = typeof topInvalidNodePosition === \"undefined\" ? result.pos : topInvalidNodePosition;\n                var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true, topBadPos_1); });\n                if (invalidElement) {\n                    var operatorToken = createMissingNode(27 /* CommaToken */, /*reportAtCurrentPosition*/ false);\n                    ts.setTextRangePosWidth(operatorToken, invalidElement.pos, 0);\n                    parseErrorAt(ts.skipTrivia(sourceText, topBadPos_1), invalidElement.end, ts.Diagnostics.JSX_expressions_must_have_one_parent_element);\n                    return finishNode(factory.createBinaryExpression(result, operatorToken, invalidElement), pos);\n                }\n            }\n            return result;\n        }\n        function parseJsxText() {\n            var pos = getNodePos();\n            var node = factory.createJsxText(scanner.getTokenValue(), currentToken === 12 /* JsxTextAllWhiteSpaces */);\n            currentToken = scanner.scanJsxToken();\n            return finishNode(node, pos);\n        }\n        function parseJsxChild(openingTag, token) {\n            switch (token) {\n                case 1 /* EndOfFileToken */:\n                    // If we hit EOF, issue the error at the tag that lacks the closing element\n                    // rather than at the end of the file (which is useless)\n                    if (ts.isJsxOpeningFragment(openingTag)) {\n                        parseErrorAtRange(openingTag, ts.Diagnostics.JSX_fragment_has_no_corresponding_closing_tag);\n                    }\n                    else {\n                        // We want the error span to cover only 'Foo.Bar' in < Foo.Bar >\n                        // or to cover only 'Foo' in < Foo >\n                        var tag = openingTag.tagName;\n                        var start = ts.skipTrivia(sourceText, tag.pos);\n                        parseErrorAt(start, tag.end, ts.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, ts.getTextOfNodeFromSourceText(sourceText, openingTag.tagName));\n                    }\n                    return undefined;\n                case 30 /* LessThanSlashToken */:\n                case 7 /* ConflictMarkerTrivia */:\n                    return undefined;\n                case 11 /* JsxText */:\n                case 12 /* JsxTextAllWhiteSpaces */:\n                    return parseJsxText();\n                case 18 /* OpenBraceToken */:\n                    return parseJsxExpression(/*inExpressionContext*/ false);\n                case 29 /* LessThanToken */:\n                    return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ false);\n                default:\n                    return ts.Debug.assertNever(token);\n            }\n        }\n        function parseJsxChildren(openingTag) {\n            var list = [];\n            var listPos = getNodePos();\n            var saveParsingContext = parsingContext;\n            parsingContext |= 1 << 14 /* JsxChildren */;\n            while (true) {\n                var child = parseJsxChild(openingTag, currentToken = scanner.reScanJsxToken());\n                if (!child)\n                    break;\n                list.push(child);\n            }\n            parsingContext = saveParsingContext;\n            return createNodeArray(list, listPos);\n        }\n        function parseJsxAttributes() {\n            var pos = getNodePos();\n            return finishNode(factory.createJsxAttributes(parseList(13 /* JsxAttributes */, parseJsxAttribute)), pos);\n        }\n        function parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext) {\n            var pos = getNodePos();\n            parseExpected(29 /* LessThanToken */);\n            if (token() === 31 /* GreaterThanToken */) {\n                // See below for explanation of scanJsxText\n                scanJsxText();\n                return finishNode(factory.createJsxOpeningFragment(), pos);\n            }\n            var tagName = parseJsxElementName();\n            var typeArguments = (contextFlags & 131072 /* JavaScriptFile */) === 0 ? tryParseTypeArguments() : undefined;\n            var attributes = parseJsxAttributes();\n            var node;\n            if (token() === 31 /* GreaterThanToken */) {\n                // Closing tag, so scan the immediately-following text with the JSX scanning instead\n                // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate\n                // scanning errors\n                scanJsxText();\n                node = factory.createJsxOpeningElement(tagName, typeArguments, attributes);\n            }\n            else {\n                parseExpected(43 /* SlashToken */);\n                if (inExpressionContext) {\n                    parseExpected(31 /* GreaterThanToken */);\n                }\n                else {\n                    parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false);\n                    scanJsxText();\n                }\n                node = factory.createJsxSelfClosingElement(tagName, typeArguments, attributes);\n            }\n            return finishNode(node, pos);\n        }\n        function parseJsxElementName() {\n            var pos = getNodePos();\n            scanJsxIdentifier();\n            // JsxElement can have name in the form of\n            //      propertyAccessExpression\n            //      primaryExpression in the form of an identifier and \"this\" keyword\n            // We can't just simply use parseLeftHandSideExpressionOrHigher because then we will start consider class,function etc as a keyword\n            // We only want to consider \"this\" as a primaryExpression\n            var expression = token() === 107 /* ThisKeyword */ ?\n                parseTokenNode() : parseIdentifierName();\n            while (parseOptional(24 /* DotToken */)) {\n                expression = finishNode(factory.createPropertyAccessExpression(expression, parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ false)), pos);\n            }\n            return expression;\n        }\n        function parseJsxExpression(inExpressionContext) {\n            var pos = getNodePos();\n            if (!parseExpected(18 /* OpenBraceToken */)) {\n                return undefined;\n            }\n            var dotDotDotToken;\n            var expression;\n            if (token() !== 19 /* CloseBraceToken */) {\n                dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */);\n                // Only an AssignmentExpression is valid here per the JSX spec,\n                // but we can unambiguously parse a comma sequence and provide\n                // a better error message in grammar checking.\n                expression = parseExpression();\n            }\n            if (inExpressionContext) {\n                parseExpected(19 /* CloseBraceToken */);\n            }\n            else {\n                if (parseExpected(19 /* CloseBraceToken */, /*message*/ undefined, /*shouldAdvance*/ false)) {\n                    scanJsxText();\n                }\n            }\n            return finishNode(factory.createJsxExpression(dotDotDotToken, expression), pos);\n        }\n        function parseJsxAttribute() {\n            if (token() === 18 /* OpenBraceToken */) {\n                return parseJsxSpreadAttribute();\n            }\n            scanJsxIdentifier();\n            var pos = getNodePos();\n            return finishNode(factory.createJsxAttribute(parseIdentifierName(), token() !== 62 /* EqualsToken */ ? undefined :\n                scanJsxAttributeValue() === 10 /* StringLiteral */ ? parseLiteralNode() :\n                    parseJsxExpression(/*inExpressionContext*/ true)), pos);\n        }\n        function parseJsxSpreadAttribute() {\n            var pos = getNodePos();\n            parseExpected(18 /* OpenBraceToken */);\n            parseExpected(25 /* DotDotDotToken */);\n            var expression = parseExpression();\n            parseExpected(19 /* CloseBraceToken */);\n            return finishNode(factory.createJsxSpreadAttribute(expression), pos);\n        }\n        function parseJsxClosingElement(inExpressionContext) {\n            var pos = getNodePos();\n            parseExpected(30 /* LessThanSlashToken */);\n            var tagName = parseJsxElementName();\n            if (inExpressionContext) {\n                parseExpected(31 /* GreaterThanToken */);\n            }\n            else {\n                parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false);\n                scanJsxText();\n            }\n            return finishNode(factory.createJsxClosingElement(tagName), pos);\n        }\n        function parseJsxClosingFragment(inExpressionContext) {\n            var pos = getNodePos();\n            parseExpected(30 /* LessThanSlashToken */);\n            if (ts.tokenIsIdentifierOrKeyword(token())) {\n                parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);\n            }\n            if (inExpressionContext) {\n                parseExpected(31 /* GreaterThanToken */);\n            }\n            else {\n                parseExpected(31 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false);\n                scanJsxText();\n            }\n            return finishNode(factory.createJsxJsxClosingFragment(), pos);\n        }\n        function parseTypeAssertion() {\n            var pos = getNodePos();\n            parseExpected(29 /* LessThanToken */);\n            var type = parseType();\n            parseExpected(31 /* GreaterThanToken */);\n            var expression = parseSimpleUnaryExpression();\n            return finishNode(factory.createTypeAssertion(type, expression), pos);\n        }\n        function nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate() {\n            nextToken();\n            return ts.tokenIsIdentifierOrKeyword(token())\n                || token() === 22 /* OpenBracketToken */\n                || isTemplateStartOfTaggedTemplate();\n        }\n        function isStartOfOptionalPropertyOrElementAccessChain() {\n            return token() === 28 /* QuestionDotToken */\n                && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate);\n        }\n        function tryReparseOptionalChain(node) {\n            if (node.flags & 32 /* OptionalChain */) {\n                return true;\n            }\n            // check for an optional chain in a non-null expression\n            if (ts.isNonNullExpression(node)) {\n                var expr = node.expression;\n                while (ts.isNonNullExpression(expr) && !(expr.flags & 32 /* OptionalChain */)) {\n                    expr = expr.expression;\n                }\n                if (expr.flags & 32 /* OptionalChain */) {\n                    // this is part of an optional chain. Walk down from `node` to `expression` and set the flag.\n                    while (ts.isNonNullExpression(node)) {\n                        node.flags |= 32 /* OptionalChain */;\n                        node = node.expression;\n                    }\n                    return true;\n                }\n            }\n            return false;\n        }\n        function parsePropertyAccessExpressionRest(pos, expression, questionDotToken) {\n            var name = parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ true);\n            var isOptionalChain = questionDotToken || tryReparseOptionalChain(expression);\n            var propertyAccess = isOptionalChain ?\n                factory.createPropertyAccessChain(expression, questionDotToken, name) :\n                factory.createPropertyAccessExpression(expression, name);\n            if (isOptionalChain && ts.isPrivateIdentifier(propertyAccess.name)) {\n                parseErrorAtRange(propertyAccess.name, ts.Diagnostics.An_optional_chain_cannot_contain_private_identifiers);\n            }\n            return finishNode(propertyAccess, pos);\n        }\n        function parseElementAccessExpressionRest(pos, expression, questionDotToken) {\n            var argumentExpression;\n            if (token() === 23 /* CloseBracketToken */) {\n                argumentExpression = createMissingNode(78 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.An_element_access_expression_should_take_an_argument);\n            }\n            else {\n                var argument = allowInAnd(parseExpression);\n                if (ts.isStringOrNumericLiteralLike(argument)) {\n                    argument.text = internIdentifier(argument.text);\n                }\n                argumentExpression = argument;\n            }\n            parseExpected(23 /* CloseBracketToken */);\n            var indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ?\n                factory.createElementAccessChain(expression, questionDotToken, argumentExpression) :\n                factory.createElementAccessExpression(expression, argumentExpression);\n            return finishNode(indexedAccess, pos);\n        }\n        function parseMemberExpressionRest(pos, expression, allowOptionalChain) {\n            while (true) {\n                var questionDotToken = void 0;\n                var isPropertyAccess = false;\n                if (allowOptionalChain && isStartOfOptionalPropertyOrElementAccessChain()) {\n                    questionDotToken = parseExpectedToken(28 /* QuestionDotToken */);\n                    isPropertyAccess = ts.tokenIsIdentifierOrKeyword(token());\n                }\n                else {\n                    isPropertyAccess = parseOptional(24 /* DotToken */);\n                }\n                if (isPropertyAccess) {\n                    expression = parsePropertyAccessExpressionRest(pos, expression, questionDotToken);\n                    continue;\n                }\n                if (!questionDotToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) {\n                    nextToken();\n                    expression = finishNode(factory.createNonNullExpression(expression), pos);\n                    continue;\n                }\n                // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName\n                if ((questionDotToken || !inDecoratorContext()) && parseOptional(22 /* OpenBracketToken */)) {\n                    expression = parseElementAccessExpressionRest(pos, expression, questionDotToken);\n                    continue;\n                }\n                if (isTemplateStartOfTaggedTemplate()) {\n                    expression = parseTaggedTemplateRest(pos, expression, questionDotToken, /*typeArguments*/ undefined);\n                    continue;\n                }\n                return expression;\n            }\n        }\n        function isTemplateStartOfTaggedTemplate() {\n            return token() === 14 /* NoSubstitutionTemplateLiteral */ || token() === 15 /* TemplateHead */;\n        }\n        function parseTaggedTemplateRest(pos, tag, questionDotToken, typeArguments) {\n            var tagExpression = factory.createTaggedTemplateExpression(tag, typeArguments, token() === 14 /* NoSubstitutionTemplateLiteral */ ?\n                (reScanTemplateHeadOrNoSubstitutionTemplate(), parseLiteralNode()) :\n                parseTemplateExpression(/*isTaggedTemplate*/ true));\n            if (questionDotToken || tag.flags & 32 /* OptionalChain */) {\n                tagExpression.flags |= 32 /* OptionalChain */;\n            }\n            tagExpression.questionDotToken = questionDotToken;\n            return finishNode(tagExpression, pos);\n        }\n        function parseCallExpressionRest(pos, expression) {\n            while (true) {\n                expression = parseMemberExpressionRest(pos, expression, /*allowOptionalChain*/ true);\n                var questionDotToken = parseOptionalToken(28 /* QuestionDotToken */);\n                // handle 'foo<<T>()'\n                // parse template arguments only in TypeScript files (not in JavaScript files).\n                if ((contextFlags & 131072 /* JavaScriptFile */) === 0 && (token() === 29 /* LessThanToken */ || token() === 47 /* LessThanLessThanToken */)) {\n                    // See if this is the start of a generic invocation.  If so, consume it and\n                    // keep checking for postfix expressions.  Otherwise, it's just a '<' that's\n                    // part of an arithmetic expression.  Break out so we consume it higher in the\n                    // stack.\n                    var typeArguments = tryParse(parseTypeArgumentsInExpression);\n                    if (typeArguments) {\n                        if (isTemplateStartOfTaggedTemplate()) {\n                            expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments);\n                            continue;\n                        }\n                        var argumentList = parseArgumentList();\n                        var callExpr = questionDotToken || tryReparseOptionalChain(expression) ?\n                            factory.createCallChain(expression, questionDotToken, typeArguments, argumentList) :\n                            factory.createCallExpression(expression, typeArguments, argumentList);\n                        expression = finishNode(callExpr, pos);\n                        continue;\n                    }\n                }\n                else if (token() === 20 /* OpenParenToken */) {\n                    var argumentList = parseArgumentList();\n                    var callExpr = questionDotToken || tryReparseOptionalChain(expression) ?\n                        factory.createCallChain(expression, questionDotToken, /*typeArguments*/ undefined, argumentList) :\n                        factory.createCallExpression(expression, /*typeArguments*/ undefined, argumentList);\n                    expression = finishNode(callExpr, pos);\n                    continue;\n                }\n                if (questionDotToken) {\n                    // We failed to parse anything, so report a missing identifier here.\n                    var name = createMissingNode(78 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Identifier_expected);\n                    expression = finishNode(factory.createPropertyAccessChain(expression, questionDotToken, name), pos);\n                }\n                break;\n            }\n            return expression;\n        }\n        function parseArgumentList() {\n            parseExpected(20 /* OpenParenToken */);\n            var result = parseDelimitedList(11 /* ArgumentExpressions */, parseArgumentExpression);\n            parseExpected(21 /* CloseParenToken */);\n            return result;\n        }\n        function parseTypeArgumentsInExpression() {\n            if ((contextFlags & 131072 /* JavaScriptFile */) !== 0) {\n                // TypeArguments must not be parsed in JavaScript files to avoid ambiguity with binary operators.\n                return undefined;\n            }\n            if (reScanLessThanToken() !== 29 /* LessThanToken */) {\n                return undefined;\n            }\n            nextToken();\n            var typeArguments = parseDelimitedList(20 /* TypeArguments */, parseType);\n            if (!parseExpected(31 /* GreaterThanToken */)) {\n                // If it doesn't have the closing `>` then it's definitely not an type argument list.\n                return undefined;\n            }\n            // If we have a '<', then only parse this as a argument list if the type arguments\n            // are complete and we have an open paren.  if we don't, rewind and return nothing.\n            return typeArguments && canFollowTypeArgumentsInExpression()\n                ? typeArguments\n                : undefined;\n        }\n        function canFollowTypeArgumentsInExpression() {\n            switch (token()) {\n                case 20 /* OpenParenToken */: // foo<x>(\n                case 14 /* NoSubstitutionTemplateLiteral */: // foo<T> `...`\n                case 15 /* TemplateHead */: // foo<T> `...${100}...`\n                // these are the only tokens can legally follow a type argument\n                // list. So we definitely want to treat them as type arg lists.\n                // falls through\n                case 24 /* DotToken */: // foo<x>.\n                case 21 /* CloseParenToken */: // foo<x>)\n                case 23 /* CloseBracketToken */: // foo<x>]\n                case 58 /* ColonToken */: // foo<x>:\n                case 26 /* SemicolonToken */: // foo<x>;\n                case 57 /* QuestionToken */: // foo<x>?\n                case 34 /* EqualsEqualsToken */: // foo<x> ==\n                case 36 /* EqualsEqualsEqualsToken */: // foo<x> ===\n                case 35 /* ExclamationEqualsToken */: // foo<x> !=\n                case 37 /* ExclamationEqualsEqualsToken */: // foo<x> !==\n                case 55 /* AmpersandAmpersandToken */: // foo<x> &&\n                case 56 /* BarBarToken */: // foo<x> ||\n                case 60 /* QuestionQuestionToken */: // foo<x> ??\n                case 52 /* CaretToken */: // foo<x> ^\n                case 50 /* AmpersandToken */: // foo<x> &\n                case 51 /* BarToken */: // foo<x> |\n                case 19 /* CloseBraceToken */: // foo<x> }\n                case 1 /* EndOfFileToken */: // foo<x>\n                    // these cases can't legally follow a type arg list.  However, they're not legal\n                    // expressions either.  The user is probably in the middle of a generic type. So\n                    // treat it as such.\n                    return true;\n                case 27 /* CommaToken */: // foo<x>,\n                case 18 /* OpenBraceToken */: // foo<x> {\n                // We don't want to treat these as type arguments.  Otherwise we'll parse this\n                // as an invocation expression.  Instead, we want to parse out the expression\n                // in isolation from the type arguments.\n                // falls through\n                default:\n                    // Anything else treat as an expression.\n                    return false;\n            }\n        }\n        function parsePrimaryExpression() {\n            switch (token()) {\n                case 8 /* NumericLiteral */:\n                case 9 /* BigIntLiteral */:\n                case 10 /* StringLiteral */:\n                case 14 /* NoSubstitutionTemplateLiteral */:\n                    return parseLiteralNode();\n                case 107 /* ThisKeyword */:\n                case 105 /* SuperKeyword */:\n                case 103 /* NullKeyword */:\n                case 109 /* TrueKeyword */:\n                case 94 /* FalseKeyword */:\n                    return parseTokenNode();\n                case 20 /* OpenParenToken */:\n                    return parseParenthesizedExpression();\n                case 22 /* OpenBracketToken */:\n                    return parseArrayLiteralExpression();\n                case 18 /* OpenBraceToken */:\n                    return parseObjectLiteralExpression();\n                case 129 /* AsyncKeyword */:\n                    // Async arrow functions are parsed earlier in parseAssignmentExpressionOrHigher.\n                    // If we encounter `async [no LineTerminator here] function` then this is an async\n                    // function; otherwise, its an identifier.\n                    if (!lookAhead(nextTokenIsFunctionKeywordOnSameLine)) {\n                        break;\n                    }\n                    return parseFunctionExpression();\n                case 83 /* ClassKeyword */:\n                    return parseClassExpression();\n                case 97 /* FunctionKeyword */:\n                    return parseFunctionExpression();\n                case 102 /* NewKeyword */:\n                    return parseNewExpressionOrNewDotTarget();\n                case 43 /* SlashToken */:\n                case 67 /* SlashEqualsToken */:\n                    if (reScanSlashToken() === 13 /* RegularExpressionLiteral */) {\n                        return parseLiteralNode();\n                    }\n                    break;\n                case 15 /* TemplateHead */:\n                    return parseTemplateExpression(/* isTaggedTemplate */ false);\n            }\n            return parseIdentifier(ts.Diagnostics.Expression_expected);\n        }\n        function parseParenthesizedExpression() {\n            var pos = getNodePos();\n            var hasJSDoc = hasPrecedingJSDocComment();\n            parseExpected(20 /* OpenParenToken */);\n            var expression = allowInAnd(parseExpression);\n            parseExpected(21 /* CloseParenToken */);\n            return withJSDoc(finishNode(factory.createParenthesizedExpression(expression), pos), hasJSDoc);\n        }\n        function parseSpreadElement() {\n            var pos = getNodePos();\n            parseExpected(25 /* DotDotDotToken */);\n            var expression = parseAssignmentExpressionOrHigher();\n            return finishNode(factory.createSpreadElement(expression), pos);\n        }\n        function parseArgumentOrArrayLiteralElement() {\n            return token() === 25 /* DotDotDotToken */ ? parseSpreadElement() :\n                token() === 27 /* CommaToken */ ? finishNode(factory.createOmittedExpression(), getNodePos()) :\n                    parseAssignmentExpressionOrHigher();\n        }\n        function parseArgumentExpression() {\n            return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement);\n        }\n        function parseArrayLiteralExpression() {\n            var pos = getNodePos();\n            parseExpected(22 /* OpenBracketToken */);\n            var multiLine = scanner.hasPrecedingLineBreak();\n            var elements = parseDelimitedList(15 /* ArrayLiteralMembers */, parseArgumentOrArrayLiteralElement);\n            parseExpected(23 /* CloseBracketToken */);\n            return finishNode(factory.createArrayLiteralExpression(elements, multiLine), pos);\n        }\n        function parseObjectLiteralElement() {\n            var pos = getNodePos();\n            var hasJSDoc = hasPrecedingJSDocComment();\n            if (parseOptionalToken(25 /* DotDotDotToken */)) {\n                var expression = parseAssignmentExpressionOrHigher();\n                return withJSDoc(finishNode(factory.createSpreadAssignment(expression), pos), hasJSDoc);\n            }\n            var decorators = parseDecorators();\n            var modifiers = parseModifiers();\n            if (parseContextualModifier(134 /* GetKeyword */)) {\n                return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* GetAccessor */);\n            }\n            if (parseContextualModifier(146 /* SetKeyword */)) {\n                return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 168 /* SetAccessor */);\n            }\n            var asteriskToken = parseOptionalToken(41 /* AsteriskToken */);\n            var tokenIsIdentifier = isIdentifier();\n            var name = parsePropertyName();\n            // Disallowing of optional property assignments and definite assignment assertion happens in the grammar checker.\n            var questionToken = parseOptionalToken(57 /* QuestionToken */);\n            var exclamationToken = parseOptionalToken(53 /* ExclamationToken */);\n            if (asteriskToken || token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) {\n                return parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name, questionToken, exclamationToken);\n            }\n            // check if it is short-hand property assignment or normal property assignment\n            // NOTE: if token is EqualsToken it is interpreted as CoverInitializedName production\n            // CoverInitializedName[Yield] :\n            //     IdentifierReference[?Yield] Initializer[In, ?Yield]\n            // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern\n            var node;\n            var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58 /* ColonToken */);\n            if (isShorthandPropertyAssignment) {\n                var equalsToken = parseOptionalToken(62 /* EqualsToken */);\n                var objectAssignmentInitializer = equalsToken ? allowInAnd(parseAssignmentExpressionOrHigher) : undefined;\n                node = factory.createShorthandPropertyAssignment(name, objectAssignmentInitializer);\n                // Save equals token for error reporting.\n                // TODO(rbuckton): Consider manufacturing this when we need to report an error as it is otherwise not useful.\n                node.equalsToken = equalsToken;\n            }\n            else {\n                parseExpected(58 /* ColonToken */);\n                var initializer = allowInAnd(parseAssignmentExpressionOrHigher);\n                node = factory.createPropertyAssignment(name, initializer);\n            }\n            // Decorators, Modifiers, questionToken, and exclamationToken are not supported by property assignments and are reported in the grammar checker\n            node.decorators = decorators;\n            node.modifiers = modifiers;\n            node.questionToken = questionToken;\n            node.exclamationToken = exclamationToken;\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function parseObjectLiteralExpression() {\n            var pos = getNodePos();\n            var openBracePosition = scanner.getTokenPos();\n            parseExpected(18 /* OpenBraceToken */);\n            var multiLine = scanner.hasPrecedingLineBreak();\n            var properties = parseDelimitedList(12 /* ObjectLiteralMembers */, parseObjectLiteralElement, /*considerSemicolonAsDelimiter*/ true);\n            if (!parseExpected(19 /* CloseBraceToken */)) {\n                var lastError = ts.lastOrUndefined(parseDiagnostics);\n                if (lastError && lastError.code === ts.Diagnostics._0_expected.code) {\n                    ts.addRelatedInfo(lastError, ts.createDetachedDiagnostic(fileName, openBracePosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));\n                }\n            }\n            return finishNode(factory.createObjectLiteralExpression(properties, multiLine), pos);\n        }\n        function parseFunctionExpression() {\n            // GeneratorExpression:\n            //      function* BindingIdentifier [Yield][opt](FormalParameters[Yield]){ GeneratorBody }\n            //\n            // FunctionExpression:\n            //      function BindingIdentifier[opt](FormalParameters){ FunctionBody }\n            var saveDecoratorContext = inDecoratorContext();\n            if (saveDecoratorContext) {\n                setDecoratorContext(/*val*/ false);\n            }\n            var pos = getNodePos();\n            var hasJSDoc = hasPrecedingJSDocComment();\n            var modifiers = parseModifiers();\n            parseExpected(97 /* FunctionKeyword */);\n            var asteriskToken = parseOptionalToken(41 /* AsteriskToken */);\n            var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */;\n            var isAsync = ts.some(modifiers, ts.isAsyncModifier) ? 2 /* Await */ : 0 /* None */;\n            var name = isGenerator && isAsync ? doInYieldAndAwaitContext(parseOptionalBindingIdentifier) :\n                isGenerator ? doInYieldContext(parseOptionalBindingIdentifier) :\n                    isAsync ? doInAwaitContext(parseOptionalBindingIdentifier) :\n                        parseOptionalBindingIdentifier();\n            var typeParameters = parseTypeParameters();\n            var parameters = parseParameters(isGenerator | isAsync);\n            var type = parseReturnType(58 /* ColonToken */, /*isType*/ false);\n            var body = parseFunctionBlock(isGenerator | isAsync);\n            if (saveDecoratorContext) {\n                setDecoratorContext(/*val*/ true);\n            }\n            var node = factory.createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body);\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function parseOptionalBindingIdentifier() {\n            return isBindingIdentifier() ? parseBindingIdentifier() : undefined;\n        }\n        function parseNewExpressionOrNewDotTarget() {\n            var pos = getNodePos();\n            parseExpected(102 /* NewKeyword */);\n            if (parseOptional(24 /* DotToken */)) {\n                var name = parseIdentifierName();\n                return finishNode(factory.createMetaProperty(102 /* NewKeyword */, name), pos);\n            }\n            var expressionPos = getNodePos();\n            var expression = parsePrimaryExpression();\n            var typeArguments;\n            while (true) {\n                expression = parseMemberExpressionRest(expressionPos, expression, /*allowOptionalChain*/ false);\n                typeArguments = tryParse(parseTypeArgumentsInExpression);\n                if (isTemplateStartOfTaggedTemplate()) {\n                    ts.Debug.assert(!!typeArguments, \"Expected a type argument list; all plain tagged template starts should be consumed in 'parseMemberExpressionRest'\");\n                    expression = parseTaggedTemplateRest(expressionPos, expression, /*optionalChain*/ undefined, typeArguments);\n                    typeArguments = undefined;\n                }\n                break;\n            }\n            var argumentsArray;\n            if (token() === 20 /* OpenParenToken */) {\n                argumentsArray = parseArgumentList();\n            }\n            else if (typeArguments) {\n                parseErrorAt(pos, scanner.getStartPos(), ts.Diagnostics.A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list);\n            }\n            return finishNode(factory.createNewExpression(expression, typeArguments, argumentsArray), pos);\n        }\n        // STATEMENTS\n        function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {\n            var pos = getNodePos();\n            var openBracePosition = scanner.getTokenPos();\n            if (parseExpected(18 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) {\n                var multiLine = scanner.hasPrecedingLineBreak();\n                var statements = parseList(1 /* BlockStatements */, parseStatement);\n                if (!parseExpected(19 /* CloseBraceToken */)) {\n                    var lastError = ts.lastOrUndefined(parseDiagnostics);\n                    if (lastError && lastError.code === ts.Diagnostics._0_expected.code) {\n                        ts.addRelatedInfo(lastError, ts.createDetachedDiagnostic(fileName, openBracePosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));\n                    }\n                }\n                return finishNode(factory.createBlock(statements, multiLine), pos);\n            }\n            else {\n                var statements = createMissingList();\n                return finishNode(factory.createBlock(statements, /*multiLine*/ undefined), pos);\n            }\n        }\n        function parseFunctionBlock(flags, diagnosticMessage) {\n            var savedYieldContext = inYieldContext();\n            setYieldContext(!!(flags & 1 /* Yield */));\n            var savedAwaitContext = inAwaitContext();\n            setAwaitContext(!!(flags & 2 /* Await */));\n            var savedTopLevel = topLevel;\n            topLevel = false;\n            // We may be in a [Decorator] context when parsing a function expression or\n            // arrow function. The body of the function is not in [Decorator] context.\n            var saveDecoratorContext = inDecoratorContext();\n            if (saveDecoratorContext) {\n                setDecoratorContext(/*val*/ false);\n            }\n            var block = parseBlock(!!(flags & 16 /* IgnoreMissingOpenBrace */), diagnosticMessage);\n            if (saveDecoratorContext) {\n                setDecoratorContext(/*val*/ true);\n            }\n            topLevel = savedTopLevel;\n            setYieldContext(savedYieldContext);\n            setAwaitContext(savedAwaitContext);\n            return block;\n        }\n        function parseEmptyStatement() {\n            var pos = getNodePos();\n            parseExpected(26 /* SemicolonToken */);\n            return finishNode(factory.createEmptyStatement(), pos);\n        }\n        function parseIfStatement() {\n            var pos = getNodePos();\n            parseExpected(98 /* IfKeyword */);\n            parseExpected(20 /* OpenParenToken */);\n            var expression = allowInAnd(parseExpression);\n            parseExpected(21 /* CloseParenToken */);\n            var thenStatement = parseStatement();\n            var elseStatement = parseOptional(90 /* ElseKeyword */) ? parseStatement() : undefined;\n            return finishNode(factory.createIfStatement(expression, thenStatement, elseStatement), pos);\n        }\n        function parseDoStatement() {\n            var pos = getNodePos();\n            parseExpected(89 /* DoKeyword */);\n            var statement = parseStatement();\n            parseExpected(114 /* WhileKeyword */);\n            parseExpected(20 /* OpenParenToken */);\n            var expression = allowInAnd(parseExpression);\n            parseExpected(21 /* CloseParenToken */);\n            // From: https://mail.mozilla.org/pipermail/es-discuss/2011-August/016188.html\n            // 157 min --- All allen at wirfs-brock.com CONF --- \"do{;}while(false)false\" prohibited in\n            // spec but allowed in consensus reality. Approved -- this is the de-facto standard whereby\n            //  do;while(0)x will have a semicolon inserted before x.\n            parseOptional(26 /* SemicolonToken */);\n            return finishNode(factory.createDoStatement(statement, expression), pos);\n        }\n        function parseWhileStatement() {\n            var pos = getNodePos();\n            parseExpected(114 /* WhileKeyword */);\n            parseExpected(20 /* OpenParenToken */);\n            var expression = allowInAnd(parseExpression);\n            parseExpected(21 /* CloseParenToken */);\n            var statement = parseStatement();\n            return finishNode(factory.createWhileStatement(expression, statement), pos);\n        }\n        function parseForOrForInOrForOfStatement() {\n            var pos = getNodePos();\n            parseExpected(96 /* ForKeyword */);\n            var awaitToken = parseOptionalToken(130 /* AwaitKeyword */);\n            parseExpected(20 /* OpenParenToken */);\n            var initializer;\n            if (token() !== 26 /* SemicolonToken */) {\n                if (token() === 112 /* VarKeyword */ || token() === 118 /* LetKeyword */ || token() === 84 /* ConstKeyword */) {\n                    initializer = parseVariableDeclarationList(/*inForStatementInitializer*/ true);\n                }\n                else {\n                    initializer = disallowInAnd(parseExpression);\n                }\n            }\n            var node;\n            if (awaitToken ? parseExpected(156 /* OfKeyword */) : parseOptional(156 /* OfKeyword */)) {\n                var expression = allowInAnd(parseAssignmentExpressionOrHigher);\n                parseExpected(21 /* CloseParenToken */);\n                node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement());\n            }\n            else if (parseOptional(100 /* InKeyword */)) {\n                var expression = allowInAnd(parseExpression);\n                parseExpected(21 /* CloseParenToken */);\n                node = factory.createForInStatement(initializer, expression, parseStatement());\n            }\n            else {\n                parseExpected(26 /* SemicolonToken */);\n                var condition = token() !== 26 /* SemicolonToken */ && token() !== 21 /* CloseParenToken */\n                    ? allowInAnd(parseExpression)\n                    : undefined;\n                parseExpected(26 /* SemicolonToken */);\n                var incrementor = token() !== 21 /* CloseParenToken */\n                    ? allowInAnd(parseExpression)\n                    : undefined;\n                parseExpected(21 /* CloseParenToken */);\n                node = factory.createForStatement(initializer, condition, incrementor, parseStatement());\n            }\n            return finishNode(node, pos);\n        }\n        function parseBreakOrContinueStatement(kind) {\n            var pos = getNodePos();\n            parseExpected(kind === 241 /* BreakStatement */ ? 80 /* BreakKeyword */ : 85 /* ContinueKeyword */);\n            var label = canParseSemicolon() ? undefined : parseIdentifier();\n            parseSemicolon();\n            var node = kind === 241 /* BreakStatement */\n                ? factory.createBreakStatement(label)\n                : factory.createContinueStatement(label);\n            return finishNode(node, pos);\n        }\n        function parseReturnStatement() {\n            var pos = getNodePos();\n            parseExpected(104 /* ReturnKeyword */);\n            var expression = canParseSemicolon() ? undefined : allowInAnd(parseExpression);\n            parseSemicolon();\n            return finishNode(factory.createReturnStatement(expression), pos);\n        }\n        function parseWithStatement() {\n            var pos = getNodePos();\n            parseExpected(115 /* WithKeyword */);\n            parseExpected(20 /* OpenParenToken */);\n            var expression = allowInAnd(parseExpression);\n            parseExpected(21 /* CloseParenToken */);\n            var statement = doInsideOfContext(16777216 /* InWithStatement */, parseStatement);\n            return finishNode(factory.createWithStatement(expression, statement), pos);\n        }\n        function parseCaseClause() {\n            var pos = getNodePos();\n            parseExpected(81 /* CaseKeyword */);\n            var expression = allowInAnd(parseExpression);\n            parseExpected(58 /* ColonToken */);\n            var statements = parseList(3 /* SwitchClauseStatements */, parseStatement);\n            return finishNode(factory.createCaseClause(expression, statements), pos);\n        }\n        function parseDefaultClause() {\n            var pos = getNodePos();\n            parseExpected(87 /* DefaultKeyword */);\n            parseExpected(58 /* ColonToken */);\n            var statements = parseList(3 /* SwitchClauseStatements */, parseStatement);\n            return finishNode(factory.createDefaultClause(statements), pos);\n        }\n        function parseCaseOrDefaultClause() {\n            return token() === 81 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause();\n        }\n        function parseCaseBlock() {\n            var pos = getNodePos();\n            parseExpected(18 /* OpenBraceToken */);\n            var clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause);\n            parseExpected(19 /* CloseBraceToken */);\n            return finishNode(factory.createCaseBlock(clauses), pos);\n        }\n        function parseSwitchStatement() {\n            var pos = getNodePos();\n            parseExpected(106 /* SwitchKeyword */);\n            parseExpected(20 /* OpenParenToken */);\n            var expression = allowInAnd(parseExpression);\n            parseExpected(21 /* CloseParenToken */);\n            var caseBlock = parseCaseBlock();\n            return finishNode(factory.createSwitchStatement(expression, caseBlock), pos);\n        }\n        function parseThrowStatement() {\n            // ThrowStatement[Yield] :\n            //      throw [no LineTerminator here]Expression[In, ?Yield];\n            var pos = getNodePos();\n            parseExpected(108 /* ThrowKeyword */);\n            // Because of automatic semicolon insertion, we need to report error if this\n            // throw could be terminated with a semicolon.  Note: we can't call 'parseExpression'\n            // directly as that might consume an expression on the following line.\n            // Instead, we create a \"missing\" identifier, but don't report an error. The actual error\n            // will be reported in the grammar walker.\n            var expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression);\n            if (expression === undefined) {\n                identifierCount++;\n                expression = finishNode(factory.createIdentifier(\"\"), getNodePos());\n            }\n            parseSemicolon();\n            return finishNode(factory.createThrowStatement(expression), pos);\n        }\n        // TODO: Review for error recovery\n        function parseTryStatement() {\n            var pos = getNodePos();\n            parseExpected(110 /* TryKeyword */);\n            var tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false);\n            var catchClause = token() === 82 /* CatchKeyword */ ? parseCatchClause() : undefined;\n            // If we don't have a catch clause, then we must have a finally clause.  Try to parse\n            // one out no matter what.\n            var finallyBlock;\n            if (!catchClause || token() === 95 /* FinallyKeyword */) {\n                parseExpected(95 /* FinallyKeyword */);\n                finallyBlock = parseBlock(/*ignoreMissingOpenBrace*/ false);\n            }\n            return finishNode(factory.createTryStatement(tryBlock, catchClause, finallyBlock), pos);\n        }\n        function parseCatchClause() {\n            var pos = getNodePos();\n            parseExpected(82 /* CatchKeyword */);\n            var variableDeclaration;\n            if (parseOptional(20 /* OpenParenToken */)) {\n                variableDeclaration = parseVariableDeclaration();\n                parseExpected(21 /* CloseParenToken */);\n            }\n            else {\n                // Keep shape of node to avoid degrading performance.\n                variableDeclaration = undefined;\n            }\n            var block = parseBlock(/*ignoreMissingOpenBrace*/ false);\n            return finishNode(factory.createCatchClause(variableDeclaration, block), pos);\n        }\n        function parseDebuggerStatement() {\n            var pos = getNodePos();\n            parseExpected(86 /* DebuggerKeyword */);\n            parseSemicolon();\n            return finishNode(factory.createDebuggerStatement(), pos);\n        }\n        function parseExpressionOrLabeledStatement() {\n            // Avoiding having to do the lookahead for a labeled statement by just trying to parse\n            // out an expression, seeing if it is identifier and then seeing if it is followed by\n            // a colon.\n            var pos = getNodePos();\n            var hasJSDoc = hasPrecedingJSDocComment();\n            var node;\n            var hasParen = token() === 20 /* OpenParenToken */;\n            var expression = allowInAnd(parseExpression);\n            if (ts.isIdentifier(expression) && parseOptional(58 /* ColonToken */)) {\n                node = factory.createLabeledStatement(expression, parseStatement());\n            }\n            else {\n                parseSemicolon();\n                node = factory.createExpressionStatement(expression);\n                if (hasParen) {\n                    // do not parse the same jsdoc twice\n                    hasJSDoc = false;\n                }\n            }\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function nextTokenIsIdentifierOrKeywordOnSameLine() {\n            nextToken();\n            return ts.tokenIsIdentifierOrKeyword(token()) && !scanner.hasPrecedingLineBreak();\n        }\n        function nextTokenIsClassKeywordOnSameLine() {\n            nextToken();\n            return token() === 83 /* ClassKeyword */ && !scanner.hasPrecedingLineBreak();\n        }\n        function nextTokenIsFunctionKeywordOnSameLine() {\n            nextToken();\n            return token() === 97 /* FunctionKeyword */ && !scanner.hasPrecedingLineBreak();\n        }\n        function nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine() {\n            nextToken();\n            return (ts.tokenIsIdentifierOrKeyword(token()) || token() === 8 /* NumericLiteral */ || token() === 9 /* BigIntLiteral */ || token() === 10 /* StringLiteral */) && !scanner.hasPrecedingLineBreak();\n        }\n        function isDeclaration() {\n            while (true) {\n                switch (token()) {\n                    case 112 /* VarKeyword */:\n                    case 118 /* LetKeyword */:\n                    case 84 /* ConstKeyword */:\n                    case 97 /* FunctionKeyword */:\n                    case 83 /* ClassKeyword */:\n                    case 91 /* EnumKeyword */:\n                        return true;\n                    // 'declare', 'module', 'namespace', 'interface'* and 'type' are all legal JavaScript identifiers;\n                    // however, an identifier cannot be followed by another identifier on the same line. This is what we\n                    // count on to parse out the respective declarations. For instance, we exploit this to say that\n                    //\n                    //    namespace n\n                    //\n                    // can be none other than the beginning of a namespace declaration, but need to respect that JavaScript sees\n                    //\n                    //    namespace\n                    //    n\n                    //\n                    // as the identifier 'namespace' on one line followed by the identifier 'n' on another.\n                    // We need to look one token ahead to see if it permissible to try parsing a declaration.\n                    //\n                    // *Note*: 'interface' is actually a strict mode reserved word. So while\n                    //\n                    //   \"use strict\"\n                    //   interface\n                    //   I {}\n                    //\n                    // could be legal, it would add complexity for very little gain.\n                    case 117 /* InterfaceKeyword */:\n                    case 149 /* TypeKeyword */:\n                        return nextTokenIsIdentifierOnSameLine();\n                    case 139 /* ModuleKeyword */:\n                    case 140 /* NamespaceKeyword */:\n                        return nextTokenIsIdentifierOrStringLiteralOnSameLine();\n                    case 125 /* AbstractKeyword */:\n                    case 129 /* AsyncKeyword */:\n                    case 133 /* DeclareKeyword */:\n                    case 120 /* PrivateKeyword */:\n                    case 121 /* ProtectedKeyword */:\n                    case 122 /* PublicKeyword */:\n                    case 142 /* ReadonlyKeyword */:\n                        nextToken();\n                        // ASI takes effect for this modifier.\n                        if (scanner.hasPrecedingLineBreak()) {\n                            return false;\n                        }\n                        continue;\n                    case 154 /* GlobalKeyword */:\n                        nextToken();\n                        return token() === 18 /* OpenBraceToken */ || token() === 78 /* Identifier */ || token() === 92 /* ExportKeyword */;\n                    case 99 /* ImportKeyword */:\n                        nextToken();\n                        return token() === 10 /* StringLiteral */ || token() === 41 /* AsteriskToken */ ||\n                            token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token());\n                    case 92 /* ExportKeyword */:\n                        var currentToken_1 = nextToken();\n                        if (currentToken_1 === 149 /* TypeKeyword */) {\n                            currentToken_1 = lookAhead(nextToken);\n                        }\n                        if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ ||\n                            currentToken_1 === 18 /* OpenBraceToken */ || currentToken_1 === 87 /* DefaultKeyword */ ||\n                            currentToken_1 === 126 /* AsKeyword */) {\n                            return true;\n                        }\n                        continue;\n                    case 123 /* StaticKeyword */:\n                        nextToken();\n                        continue;\n                    default:\n                        return false;\n                }\n            }\n        }\n        function isStartOfDeclaration() {\n            return lookAhead(isDeclaration);\n        }\n        function isStartOfStatement() {\n            switch (token()) {\n                case 59 /* AtToken */:\n                case 26 /* SemicolonToken */:\n                case 18 /* OpenBraceToken */:\n                case 112 /* VarKeyword */:\n                case 118 /* LetKeyword */:\n                case 97 /* FunctionKeyword */:\n                case 83 /* ClassKeyword */:\n                case 91 /* EnumKeyword */:\n                case 98 /* IfKeyword */:\n                case 89 /* DoKeyword */:\n                case 114 /* WhileKeyword */:\n                case 96 /* ForKeyword */:\n                case 85 /* ContinueKeyword */:\n                case 80 /* BreakKeyword */:\n                case 104 /* ReturnKeyword */:\n                case 115 /* WithKeyword */:\n                case 106 /* SwitchKeyword */:\n                case 108 /* ThrowKeyword */:\n                case 110 /* TryKeyword */:\n                case 86 /* DebuggerKeyword */:\n                // 'catch' and 'finally' do not actually indicate that the code is part of a statement,\n                // however, we say they are here so that we may gracefully parse them and error later.\n                // falls through\n                case 82 /* CatchKeyword */:\n                case 95 /* FinallyKeyword */:\n                    return true;\n                case 99 /* ImportKeyword */:\n                    return isStartOfDeclaration() || lookAhead(nextTokenIsOpenParenOrLessThanOrDot);\n                case 84 /* ConstKeyword */:\n                case 92 /* ExportKeyword */:\n                    return isStartOfDeclaration();\n                case 129 /* AsyncKeyword */:\n                case 133 /* DeclareKeyword */:\n                case 117 /* InterfaceKeyword */:\n                case 139 /* ModuleKeyword */:\n                case 140 /* NamespaceKeyword */:\n                case 149 /* TypeKeyword */:\n                case 154 /* GlobalKeyword */:\n                    // When these don't start a declaration, they're an identifier in an expression statement\n                    return true;\n                case 122 /* PublicKeyword */:\n                case 120 /* PrivateKeyword */:\n                case 121 /* ProtectedKeyword */:\n                case 123 /* StaticKeyword */:\n                case 142 /* ReadonlyKeyword */:\n                    // When these don't start a declaration, they may be the start of a class member if an identifier\n                    // immediately follows. Otherwise they're an identifier in an expression statement.\n                    return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine);\n                default:\n                    return isStartOfExpression();\n            }\n        }\n        function nextTokenIsIdentifierOrStartOfDestructuring() {\n            nextToken();\n            return isIdentifier() || token() === 18 /* OpenBraceToken */ || token() === 22 /* OpenBracketToken */;\n        }\n        function isLetDeclaration() {\n            // In ES6 'let' always starts a lexical declaration if followed by an identifier or {\n            // or [.\n            return lookAhead(nextTokenIsIdentifierOrStartOfDestructuring);\n        }\n        function parseStatement() {\n            switch (token()) {\n                case 26 /* SemicolonToken */:\n                    return parseEmptyStatement();\n                case 18 /* OpenBraceToken */:\n                    return parseBlock(/*ignoreMissingOpenBrace*/ false);\n                case 112 /* VarKeyword */:\n                    return parseVariableStatement(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined);\n                case 118 /* LetKeyword */:\n                    if (isLetDeclaration()) {\n                        return parseVariableStatement(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined);\n                    }\n                    break;\n                case 97 /* FunctionKeyword */:\n                    return parseFunctionDeclaration(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined);\n                case 83 /* ClassKeyword */:\n                    return parseClassDeclaration(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined);\n                case 98 /* IfKeyword */:\n                    return parseIfStatement();\n                case 89 /* DoKeyword */:\n                    return parseDoStatement();\n                case 114 /* WhileKeyword */:\n                    return parseWhileStatement();\n                case 96 /* ForKeyword */:\n                    return parseForOrForInOrForOfStatement();\n                case 85 /* ContinueKeyword */:\n                    return parseBreakOrContinueStatement(240 /* ContinueStatement */);\n                case 80 /* BreakKeyword */:\n                    return parseBreakOrContinueStatement(241 /* BreakStatement */);\n                case 104 /* ReturnKeyword */:\n                    return parseReturnStatement();\n                case 115 /* WithKeyword */:\n                    return parseWithStatement();\n                case 106 /* SwitchKeyword */:\n                    return parseSwitchStatement();\n                case 108 /* ThrowKeyword */:\n                    return parseThrowStatement();\n                case 110 /* TryKeyword */:\n                // Include 'catch' and 'finally' for error recovery.\n                // falls through\n                case 82 /* CatchKeyword */:\n                case 95 /* FinallyKeyword */:\n                    return parseTryStatement();\n                case 86 /* DebuggerKeyword */:\n                    return parseDebuggerStatement();\n                case 59 /* AtToken */:\n                    return parseDeclaration();\n                case 129 /* AsyncKeyword */:\n                case 117 /* InterfaceKeyword */:\n                case 149 /* TypeKeyword */:\n                case 139 /* ModuleKeyword */:\n                case 140 /* NamespaceKeyword */:\n                case 133 /* DeclareKeyword */:\n                case 84 /* ConstKeyword */:\n                case 91 /* EnumKeyword */:\n                case 92 /* ExportKeyword */:\n                case 99 /* ImportKeyword */:\n                case 120 /* PrivateKeyword */:\n                case 121 /* ProtectedKeyword */:\n                case 122 /* PublicKeyword */:\n                case 125 /* AbstractKeyword */:\n                case 123 /* StaticKeyword */:\n                case 142 /* ReadonlyKeyword */:\n                case 154 /* GlobalKeyword */:\n                    if (isStartOfDeclaration()) {\n                        return parseDeclaration();\n                    }\n                    break;\n            }\n            return parseExpressionOrLabeledStatement();\n        }\n        function isDeclareModifier(modifier) {\n            return modifier.kind === 133 /* DeclareKeyword */;\n        }\n        function parseDeclaration() {\n            // TODO: Can we hold onto the parsed decorators/modifiers and advance the scanner\n            //       if we can't reuse the declaration, so that we don't do this work twice?\n            //\n            // `parseListElement` attempted to get the reused node at this position,\n            // but the ambient context flag was not yet set, so the node appeared\n            // not reusable in that context.\n            var isAmbient = ts.some(lookAhead(function () { return (parseDecorators(), parseModifiers()); }), isDeclareModifier);\n            if (isAmbient) {\n                var node = tryReuseAmbientDeclaration();\n                if (node) {\n                    return node;\n                }\n            }\n            var pos = getNodePos();\n            var hasJSDoc = hasPrecedingJSDocComment();\n            var decorators = parseDecorators();\n            var modifiers = parseModifiers();\n            if (isAmbient) {\n                for (var _i = 0, _a = modifiers; _i < _a.length; _i++) {\n                    var m = _a[_i];\n                    m.flags |= 8388608 /* Ambient */;\n                }\n                return doInsideOfContext(8388608 /* Ambient */, function () { return parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers); });\n            }\n            else {\n                return parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers);\n            }\n        }\n        function tryReuseAmbientDeclaration() {\n            return doInsideOfContext(8388608 /* Ambient */, function () {\n                var node = currentNode(parsingContext);\n                if (node) {\n                    return consumeNode(node);\n                }\n            });\n        }\n        function parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers) {\n            switch (token()) {\n                case 112 /* VarKeyword */:\n                case 118 /* LetKeyword */:\n                case 84 /* ConstKeyword */:\n                    return parseVariableStatement(pos, hasJSDoc, decorators, modifiers);\n                case 97 /* FunctionKeyword */:\n                    return parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers);\n                case 83 /* ClassKeyword */:\n                    return parseClassDeclaration(pos, hasJSDoc, decorators, modifiers);\n                case 117 /* InterfaceKeyword */:\n                    return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers);\n                case 149 /* TypeKeyword */:\n                    return parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers);\n                case 91 /* EnumKeyword */:\n                    return parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers);\n                case 154 /* GlobalKeyword */:\n                case 139 /* ModuleKeyword */:\n                case 140 /* NamespaceKeyword */:\n                    return parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers);\n                case 99 /* ImportKeyword */:\n                    return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers);\n                case 92 /* ExportKeyword */:\n                    nextToken();\n                    switch (token()) {\n                        case 87 /* DefaultKeyword */:\n                        case 62 /* EqualsToken */:\n                            return parseExportAssignment(pos, hasJSDoc, decorators, modifiers);\n                        case 126 /* AsKeyword */:\n                            return parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers);\n                        default:\n                            return parseExportDeclaration(pos, hasJSDoc, decorators, modifiers);\n                    }\n                default:\n                    if (decorators || modifiers) {\n                        // We reached this point because we encountered decorators and/or modifiers and assumed a declaration\n                        // would follow. For recovery and error reporting purposes, return an incomplete declaration.\n                        var missing = createMissingNode(271 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected);\n                        ts.setTextRangePos(missing, pos);\n                        missing.decorators = decorators;\n                        missing.modifiers = modifiers;\n                        return missing;\n                    }\n                    return undefined; // TODO: GH#18217\n            }\n        }\n        function nextTokenIsIdentifierOrStringLiteralOnSameLine() {\n            nextToken();\n            return !scanner.hasPrecedingLineBreak() && (isIdentifier() || token() === 10 /* StringLiteral */);\n        }\n        function parseFunctionBlockOrSemicolon(flags, diagnosticMessage) {\n            if (token() !== 18 /* OpenBraceToken */ && canParseSemicolon()) {\n                parseSemicolon();\n                return;\n            }\n            return parseFunctionBlock(flags, diagnosticMessage);\n        }\n        // DECLARATIONS\n        function parseArrayBindingElement() {\n            var pos = getNodePos();\n            if (token() === 27 /* CommaToken */) {\n                return finishNode(factory.createOmittedExpression(), pos);\n            }\n            var dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */);\n            var name = parseIdentifierOrPattern();\n            var initializer = parseInitializer();\n            return finishNode(factory.createBindingElement(dotDotDotToken, /*propertyName*/ undefined, name, initializer), pos);\n        }\n        function parseObjectBindingElement() {\n            var pos = getNodePos();\n            var dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */);\n            var tokenIsIdentifier = isBindingIdentifier();\n            var propertyName = parsePropertyName();\n            var name;\n            if (tokenIsIdentifier && token() !== 58 /* ColonToken */) {\n                name = propertyName;\n                propertyName = undefined;\n            }\n            else {\n                parseExpected(58 /* ColonToken */);\n                name = parseIdentifierOrPattern();\n            }\n            var initializer = parseInitializer();\n            return finishNode(factory.createBindingElement(dotDotDotToken, propertyName, name, initializer), pos);\n        }\n        function parseObjectBindingPattern() {\n            var pos = getNodePos();\n            parseExpected(18 /* OpenBraceToken */);\n            var elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement);\n            parseExpected(19 /* CloseBraceToken */);\n            return finishNode(factory.createObjectBindingPattern(elements), pos);\n        }\n        function parseArrayBindingPattern() {\n            var pos = getNodePos();\n            parseExpected(22 /* OpenBracketToken */);\n            var elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement);\n            parseExpected(23 /* CloseBracketToken */);\n            return finishNode(factory.createArrayBindingPattern(elements), pos);\n        }\n        function isBindingIdentifierOrPrivateIdentifierOrPattern() {\n            return token() === 18 /* OpenBraceToken */\n                || token() === 22 /* OpenBracketToken */\n                || token() === 79 /* PrivateIdentifier */\n                || isBindingIdentifier();\n        }\n        function parseIdentifierOrPattern(privateIdentifierDiagnosticMessage) {\n            if (token() === 22 /* OpenBracketToken */) {\n                return parseArrayBindingPattern();\n            }\n            if (token() === 18 /* OpenBraceToken */) {\n                return parseObjectBindingPattern();\n            }\n            return parseBindingIdentifier(privateIdentifierDiagnosticMessage);\n        }\n        function parseVariableDeclarationAllowExclamation() {\n            return parseVariableDeclaration(/*allowExclamation*/ true);\n        }\n        function parseVariableDeclaration(allowExclamation) {\n            var pos = getNodePos();\n            var name = parseIdentifierOrPattern(ts.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations);\n            var exclamationToken;\n            if (allowExclamation && name.kind === 78 /* Identifier */ &&\n                token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) {\n                exclamationToken = parseTokenNode();\n            }\n            var type = parseTypeAnnotation();\n            var initializer = isInOrOfKeyword(token()) ? undefined : parseInitializer();\n            var node = factory.createVariableDeclaration(name, exclamationToken, type, initializer);\n            return finishNode(node, pos);\n        }\n        function parseVariableDeclarationList(inForStatementInitializer) {\n            var pos = getNodePos();\n            var flags = 0;\n            switch (token()) {\n                case 112 /* VarKeyword */:\n                    break;\n                case 118 /* LetKeyword */:\n                    flags |= 1 /* Let */;\n                    break;\n                case 84 /* ConstKeyword */:\n                    flags |= 2 /* Const */;\n                    break;\n                default:\n                    ts.Debug.fail();\n            }\n            nextToken();\n            // The user may have written the following:\n            //\n            //    for (let of X) { }\n            //\n            // In this case, we want to parse an empty declaration list, and then parse 'of'\n            // as a keyword. The reason this is not automatic is that 'of' is a valid identifier.\n            // So we need to look ahead to determine if 'of' should be treated as a keyword in\n            // this context.\n            // The checker will then give an error that there is an empty declaration list.\n            var declarations;\n            if (token() === 156 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) {\n                declarations = createMissingList();\n            }\n            else {\n                var savedDisallowIn = inDisallowInContext();\n                setDisallowInContext(inForStatementInitializer);\n                declarations = parseDelimitedList(8 /* VariableDeclarations */, inForStatementInitializer ? parseVariableDeclaration : parseVariableDeclarationAllowExclamation);\n                setDisallowInContext(savedDisallowIn);\n            }\n            return finishNode(factory.createVariableDeclarationList(declarations, flags), pos);\n        }\n        function canFollowContextualOfKeyword() {\n            return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */;\n        }\n        function parseVariableStatement(pos, hasJSDoc, decorators, modifiers) {\n            var declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false);\n            parseSemicolon();\n            var node = factory.createVariableStatement(modifiers, declarationList);\n            // Decorators are not allowed on a variable statement, so we keep track of them to report them in the grammar checker.\n            node.decorators = decorators;\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers) {\n            var savedAwaitContext = inAwaitContext();\n            var modifierFlags = ts.modifiersToFlags(modifiers);\n            parseExpected(97 /* FunctionKeyword */);\n            var asteriskToken = parseOptionalToken(41 /* AsteriskToken */);\n            // We don't parse the name here in await context, instead we will report a grammar error in the checker.\n            var name = modifierFlags & 512 /* Default */ ? parseOptionalBindingIdentifier() : parseBindingIdentifier();\n            var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */;\n            var isAsync = modifierFlags & 256 /* Async */ ? 2 /* Await */ : 0 /* None */;\n            var typeParameters = parseTypeParameters();\n            if (modifierFlags & 1 /* Export */)\n                setAwaitContext(/*value*/ true);\n            var parameters = parseParameters(isGenerator | isAsync);\n            var type = parseReturnType(58 /* ColonToken */, /*isType*/ false);\n            var body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, ts.Diagnostics.or_expected);\n            setAwaitContext(savedAwaitContext);\n            var node = factory.createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body);\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function parseConstructorName() {\n            if (token() === 132 /* ConstructorKeyword */) {\n                return parseExpected(132 /* ConstructorKeyword */);\n            }\n            if (token() === 10 /* StringLiteral */ && lookAhead(nextToken) === 20 /* OpenParenToken */) {\n                return tryParse(function () {\n                    var literalNode = parseLiteralNode();\n                    return literalNode.text === \"constructor\" ? literalNode : undefined;\n                });\n            }\n        }\n        function tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers) {\n            return tryParse(function () {\n                if (parseConstructorName()) {\n                    var typeParameters = parseTypeParameters();\n                    var parameters = parseParameters(0 /* None */);\n                    var type = parseReturnType(58 /* ColonToken */, /*isType*/ false);\n                    var body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected);\n                    var node = factory.createConstructorDeclaration(decorators, modifiers, parameters, body);\n                    // Attach `typeParameters` and `type` if they exist so that we can report them in the grammar checker.\n                    node.typeParameters = typeParameters;\n                    node.type = type;\n                    return withJSDoc(finishNode(node, pos), hasJSDoc);\n                }\n            });\n        }\n        function parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name, questionToken, exclamationToken, diagnosticMessage) {\n            var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */;\n            var isAsync = ts.some(modifiers, ts.isAsyncModifier) ? 2 /* Await */ : 0 /* None */;\n            var typeParameters = parseTypeParameters();\n            var parameters = parseParameters(isGenerator | isAsync);\n            var type = parseReturnType(58 /* ColonToken */, /*isType*/ false);\n            var body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, diagnosticMessage);\n            var node = factory.createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body);\n            // An exclamation token on a method is invalid syntax and will be handled by the grammar checker\n            node.exclamationToken = exclamationToken;\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, questionToken) {\n            var exclamationToken = !questionToken && !scanner.hasPrecedingLineBreak() ? parseOptionalToken(53 /* ExclamationToken */) : undefined;\n            var type = parseTypeAnnotation();\n            var initializer = doOutsideOfContext(8192 /* YieldContext */ | 32768 /* AwaitContext */ | 4096 /* DisallowInContext */, parseInitializer);\n            parseSemicolon();\n            var node = factory.createPropertyDeclaration(decorators, modifiers, name, questionToken || exclamationToken, type, initializer);\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers) {\n            var asteriskToken = parseOptionalToken(41 /* AsteriskToken */);\n            var name = parsePropertyName();\n            // Note: this is not legal as per the grammar.  But we allow it in the parser and\n            // report an error in the grammar checker.\n            var questionToken = parseOptionalToken(57 /* QuestionToken */);\n            if (asteriskToken || token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) {\n                return parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name, questionToken, /*exclamationToken*/ undefined, ts.Diagnostics.or_expected);\n            }\n            return parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, questionToken);\n        }\n        function parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, kind) {\n            var name = parsePropertyName();\n            var typeParameters = parseTypeParameters();\n            var parameters = parseParameters(0 /* None */);\n            var type = parseReturnType(58 /* ColonToken */, /*isType*/ false);\n            var body = parseFunctionBlockOrSemicolon(0 /* None */);\n            var node = kind === 167 /* GetAccessor */\n                ? factory.createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body)\n                : factory.createSetAccessorDeclaration(decorators, modifiers, name, parameters, body);\n            // Keep track of `typeParameters` (for both) and `type` (for setters) if they were parsed those indicate grammar errors\n            node.typeParameters = typeParameters;\n            if (type && node.kind === 168 /* SetAccessor */)\n                node.type = type;\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function isClassMemberStart() {\n            var idToken;\n            if (token() === 59 /* AtToken */) {\n                return true;\n            }\n            // Eat up all modifiers, but hold on to the last one in case it is actually an identifier.\n            while (ts.isModifierKind(token())) {\n                idToken = token();\n                // If the idToken is a class modifier (protected, private, public, and static), it is\n                // certain that we are starting to parse class member. This allows better error recovery\n                // Example:\n                //      public foo() ...     // true\n                //      public @dec blah ... // true; we will then report an error later\n                //      export public ...    // true; we will then report an error later\n                if (ts.isClassMemberModifier(idToken)) {\n                    return true;\n                }\n                nextToken();\n            }\n            if (token() === 41 /* AsteriskToken */) {\n                return true;\n            }\n            // Try to get the first property-like token following all modifiers.\n            // This can either be an identifier or the 'get' or 'set' keywords.\n            if (isLiteralPropertyName()) {\n                idToken = token();\n                nextToken();\n            }\n            // Index signatures and computed properties are class members; we can parse.\n            if (token() === 22 /* OpenBracketToken */) {\n                return true;\n            }\n            // If we were able to get any potential identifier...\n            if (idToken !== undefined) {\n                // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse.\n                if (!ts.isKeyword(idToken) || idToken === 146 /* SetKeyword */ || idToken === 134 /* GetKeyword */) {\n                    return true;\n                }\n                // If it *is* a keyword, but not an accessor, check a little farther along\n                // to see if it should actually be parsed as a class member.\n                switch (token()) {\n                    case 20 /* OpenParenToken */: // Method declaration\n                    case 29 /* LessThanToken */: // Generic Method declaration\n                    case 53 /* ExclamationToken */: // Non-null assertion on property name\n                    case 58 /* ColonToken */: // Type Annotation for declaration\n                    case 62 /* EqualsToken */: // Initializer for declaration\n                    case 57 /* QuestionToken */: // Not valid, but permitted so that it gets caught later on.\n                        return true;\n                    default:\n                        // Covers\n                        //  - Semicolons     (declaration termination)\n                        //  - Closing braces (end-of-class, must be declaration)\n                        //  - End-of-files   (not valid, but permitted so that it gets caught later on)\n                        //  - Line-breaks    (enabling *automatic semicolon insertion*)\n                        return canParseSemicolon();\n                }\n            }\n            return false;\n        }\n        function parseDecoratorExpression() {\n            if (inAwaitContext() && token() === 130 /* AwaitKeyword */) {\n                // `@await` is is disallowed in an [Await] context, but can cause parsing to go off the rails\n                // This simply parses the missing identifier and moves on.\n                var pos = getNodePos();\n                var awaitExpression = parseIdentifier(ts.Diagnostics.Expression_expected);\n                nextToken();\n                var memberExpression = parseMemberExpressionRest(pos, awaitExpression, /*allowOptionalChain*/ true);\n                return parseCallExpressionRest(pos, memberExpression);\n            }\n            return parseLeftHandSideExpressionOrHigher();\n        }\n        function tryParseDecorator() {\n            var pos = getNodePos();\n            if (!parseOptional(59 /* AtToken */)) {\n                return undefined;\n            }\n            var expression = doInDecoratorContext(parseDecoratorExpression);\n            return finishNode(factory.createDecorator(expression), pos);\n        }\n        function parseDecorators() {\n            var pos = getNodePos();\n            var list, decorator;\n            while (decorator = tryParseDecorator()) {\n                list = ts.append(list, decorator);\n            }\n            return list && createNodeArray(list, pos);\n        }\n        function tryParseModifier(permitInvalidConstAsModifier) {\n            var pos = getNodePos();\n            var kind = token();\n            if (token() === 84 /* ConstKeyword */ && permitInvalidConstAsModifier) {\n                // We need to ensure that any subsequent modifiers appear on the same line\n                // so that when 'const' is a standalone declaration, we don't issue an error.\n                if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) {\n                    return undefined;\n                }\n            }\n            else {\n                if (!parseAnyContextualModifier()) {\n                    return undefined;\n                }\n            }\n            return finishNode(factory.createToken(kind), pos);\n        }\n        /*\n         * There are situations in which a modifier like 'const' will appear unexpectedly, such as on a class member.\n         * In those situations, if we are entirely sure that 'const' is not valid on its own (such as when ASI takes effect\n         * and turns it into a standalone declaration), then it is better to parse it and report an error later.\n         *\n         * In such situations, 'permitInvalidConstAsModifier' should be set to true.\n         */\n        function parseModifiers(permitInvalidConstAsModifier) {\n            var pos = getNodePos();\n            var list, modifier;\n            while (modifier = tryParseModifier(permitInvalidConstAsModifier)) {\n                list = ts.append(list, modifier);\n            }\n            return list && createNodeArray(list, pos);\n        }\n        function parseModifiersForArrowFunction() {\n            var modifiers;\n            if (token() === 129 /* AsyncKeyword */) {\n                var pos = getNodePos();\n                nextToken();\n                var modifier = finishNode(factory.createToken(129 /* AsyncKeyword */), pos);\n                modifiers = createNodeArray([modifier], pos);\n            }\n            return modifiers;\n        }\n        function parseClassElement() {\n            var pos = getNodePos();\n            if (token() === 26 /* SemicolonToken */) {\n                nextToken();\n                return finishNode(factory.createSemicolonClassElement(), pos);\n            }\n            var hasJSDoc = hasPrecedingJSDocComment();\n            var decorators = parseDecorators();\n            var modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true);\n            if (parseContextualModifier(134 /* GetKeyword */)) {\n                return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* GetAccessor */);\n            }\n            if (parseContextualModifier(146 /* SetKeyword */)) {\n                return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 168 /* SetAccessor */);\n            }\n            if (token() === 132 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) {\n                var constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers);\n                if (constructorDeclaration) {\n                    return constructorDeclaration;\n                }\n            }\n            if (isIndexSignature()) {\n                return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers);\n            }\n            // It is very important that we check this *after* checking indexers because\n            // the [ token can start an index signature or a computed property name\n            if (ts.tokenIsIdentifierOrKeyword(token()) ||\n                token() === 10 /* StringLiteral */ ||\n                token() === 8 /* NumericLiteral */ ||\n                token() === 41 /* AsteriskToken */ ||\n                token() === 22 /* OpenBracketToken */) {\n                var isAmbient = ts.some(modifiers, isDeclareModifier);\n                if (isAmbient) {\n                    for (var _i = 0, _a = modifiers; _i < _a.length; _i++) {\n                        var m = _a[_i];\n                        m.flags |= 8388608 /* Ambient */;\n                    }\n                    return doInsideOfContext(8388608 /* Ambient */, function () { return parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers); });\n                }\n                else {\n                    return parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers);\n                }\n            }\n            if (decorators || modifiers) {\n                // treat this as a property declaration with a missing name.\n                var name = createMissingNode(78 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected);\n                return parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, /*questionToken*/ undefined);\n            }\n            // 'isClassMemberStart' should have hinted not to attempt parsing.\n            return ts.Debug.fail(\"Should not have attempted to parse class member declaration.\");\n        }\n        function parseClassExpression() {\n            return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined, 221 /* ClassExpression */);\n        }\n        function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) {\n            return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 252 /* ClassDeclaration */);\n        }\n        function parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, kind) {\n            var savedAwaitContext = inAwaitContext();\n            parseExpected(83 /* ClassKeyword */);\n            // We don't parse the name here in await context, instead we will report a grammar error in the checker.\n            var name = parseNameOfClassDeclarationOrExpression();\n            var typeParameters = parseTypeParameters();\n            if (ts.some(modifiers, ts.isExportModifier))\n                setAwaitContext(/*value*/ true);\n            var heritageClauses = parseHeritageClauses();\n            var members;\n            if (parseExpected(18 /* OpenBraceToken */)) {\n                // ClassTail[Yield,Await] : (Modified) See 14.5\n                //      ClassHeritage[?Yield,?Await]opt { ClassBody[?Yield,?Await]opt }\n                members = parseClassMembers();\n                parseExpected(19 /* CloseBraceToken */);\n            }\n            else {\n                members = createMissingList();\n            }\n            setAwaitContext(savedAwaitContext);\n            var node = kind === 252 /* ClassDeclaration */\n                ? factory.createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members)\n                : factory.createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members);\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function parseNameOfClassDeclarationOrExpression() {\n            // implements is a future reserved word so\n            // 'class implements' might mean either\n            // - class expression with omitted name, 'implements' starts heritage clause\n            // - class with name 'implements'\n            // 'isImplementsClause' helps to disambiguate between these two cases\n            return isBindingIdentifier() && !isImplementsClause()\n                ? createIdentifier(isBindingIdentifier())\n                : undefined;\n        }\n        function isImplementsClause() {\n            return token() === 116 /* ImplementsKeyword */ && lookAhead(nextTokenIsIdentifierOrKeyword);\n        }\n        function parseHeritageClauses() {\n            // ClassTail[Yield,Await] : (Modified) See 14.5\n            //      ClassHeritage[?Yield,?Await]opt { ClassBody[?Yield,?Await]opt }\n            if (isHeritageClause()) {\n                return parseList(22 /* HeritageClauses */, parseHeritageClause);\n            }\n            return undefined;\n        }\n        function parseHeritageClause() {\n            var pos = getNodePos();\n            var tok = token();\n            ts.Debug.assert(tok === 93 /* ExtendsKeyword */ || tok === 116 /* ImplementsKeyword */); // isListElement() should ensure this.\n            nextToken();\n            var types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments);\n            return finishNode(factory.createHeritageClause(tok, types), pos);\n        }\n        function parseExpressionWithTypeArguments() {\n            var pos = getNodePos();\n            var expression = parseLeftHandSideExpressionOrHigher();\n            var typeArguments = tryParseTypeArguments();\n            return finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos);\n        }\n        function tryParseTypeArguments() {\n            return token() === 29 /* LessThanToken */ ?\n                parseBracketedList(20 /* TypeArguments */, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */) : undefined;\n        }\n        function isHeritageClause() {\n            return token() === 93 /* ExtendsKeyword */ || token() === 116 /* ImplementsKeyword */;\n        }\n        function parseClassMembers() {\n            return parseList(5 /* ClassMembers */, parseClassElement);\n        }\n        function parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers) {\n            parseExpected(117 /* InterfaceKeyword */);\n            var name = parseIdentifier();\n            var typeParameters = parseTypeParameters();\n            var heritageClauses = parseHeritageClauses();\n            var members = parseObjectTypeMembers();\n            var node = factory.createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members);\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) {\n            parseExpected(149 /* TypeKeyword */);\n            var name = parseIdentifier();\n            var typeParameters = parseTypeParameters();\n            parseExpected(62 /* EqualsToken */);\n            var type = token() === 136 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType();\n            parseSemicolon();\n            var node = factory.createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type);\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        // In an ambient declaration, the grammar only allows integer literals as initializers.\n        // In a non-ambient declaration, the grammar allows uninitialized members only in a\n        // ConstantEnumMemberSection, which starts at the beginning of an enum declaration\n        // or any time an integer literal initializer is encountered.\n        function parseEnumMember() {\n            var pos = getNodePos();\n            var hasJSDoc = hasPrecedingJSDocComment();\n            var name = parsePropertyName();\n            var initializer = allowInAnd(parseInitializer);\n            return withJSDoc(finishNode(factory.createEnumMember(name, initializer), pos), hasJSDoc);\n        }\n        function parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers) {\n            parseExpected(91 /* EnumKeyword */);\n            var name = parseIdentifier();\n            var members;\n            if (parseExpected(18 /* OpenBraceToken */)) {\n                members = doOutsideOfYieldAndAwaitContext(function () { return parseDelimitedList(6 /* EnumMembers */, parseEnumMember); });\n                parseExpected(19 /* CloseBraceToken */);\n            }\n            else {\n                members = createMissingList();\n            }\n            var node = factory.createEnumDeclaration(decorators, modifiers, name, members);\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function parseModuleBlock() {\n            var pos = getNodePos();\n            var statements;\n            if (parseExpected(18 /* OpenBraceToken */)) {\n                statements = parseList(1 /* BlockStatements */, parseStatement);\n                parseExpected(19 /* CloseBraceToken */);\n            }\n            else {\n                statements = createMissingList();\n            }\n            return finishNode(factory.createModuleBlock(statements), pos);\n        }\n        function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags) {\n            // If we are parsing a dotted namespace name, we want to\n            // propagate the 'Namespace' flag across the names if set.\n            var namespaceFlag = flags & 16 /* Namespace */;\n            var name = parseIdentifier();\n            var body = parseOptional(24 /* DotToken */)\n                ? parseModuleOrNamespaceDeclaration(getNodePos(), /*hasJSDoc*/ false, /*decorators*/ undefined, /*modifiers*/ undefined, 4 /* NestedNamespace */ | namespaceFlag)\n                : parseModuleBlock();\n            var node = factory.createModuleDeclaration(decorators, modifiers, name, body, flags);\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) {\n            var flags = 0;\n            var name;\n            if (token() === 154 /* GlobalKeyword */) {\n                // parse 'global' as name of global scope augmentation\n                name = parseIdentifier();\n                flags |= 1024 /* GlobalAugmentation */;\n            }\n            else {\n                name = parseLiteralNode();\n                name.text = internIdentifier(name.text);\n            }\n            var body;\n            if (token() === 18 /* OpenBraceToken */) {\n                body = parseModuleBlock();\n            }\n            else {\n                parseSemicolon();\n            }\n            var node = factory.createModuleDeclaration(decorators, modifiers, name, body, flags);\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) {\n            var flags = 0;\n            if (token() === 154 /* GlobalKeyword */) {\n                // global augmentation\n                return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers);\n            }\n            else if (parseOptional(140 /* NamespaceKeyword */)) {\n                flags |= 16 /* Namespace */;\n            }\n            else {\n                parseExpected(139 /* ModuleKeyword */);\n                if (token() === 10 /* StringLiteral */) {\n                    return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers);\n                }\n            }\n            return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags);\n        }\n        function isExternalModuleReference() {\n            return token() === 143 /* RequireKeyword */ &&\n                lookAhead(nextTokenIsOpenParen);\n        }\n        function nextTokenIsOpenParen() {\n            return nextToken() === 20 /* OpenParenToken */;\n        }\n        function nextTokenIsSlash() {\n            return nextToken() === 43 /* SlashToken */;\n        }\n        function parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers) {\n            parseExpected(126 /* AsKeyword */);\n            parseExpected(140 /* NamespaceKeyword */);\n            var name = parseIdentifier();\n            parseSemicolon();\n            var node = factory.createNamespaceExportDeclaration(name);\n            // NamespaceExportDeclaration nodes cannot have decorators or modifiers, so we attach them here so we can report them in the grammar checker\n            node.decorators = decorators;\n            node.modifiers = modifiers;\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers) {\n            parseExpected(99 /* ImportKeyword */);\n            var afterImportPos = scanner.getStartPos();\n            // We don't parse the identifier here in await context, instead we will report a grammar error in the checker.\n            var identifier;\n            if (isIdentifier()) {\n                identifier = parseIdentifier();\n            }\n            var isTypeOnly = false;\n            if (token() !== 153 /* FromKeyword */ &&\n                (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === \"type\" &&\n                (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) {\n                isTypeOnly = true;\n                identifier = isIdentifier() ? parseIdentifier() : undefined;\n            }\n            if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()) {\n                return parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly);\n            }\n            // ImportDeclaration:\n            //  import ImportClause from ModuleSpecifier ;\n            //  import ModuleSpecifier;\n            var importClause;\n            if (identifier || // import id\n                token() === 41 /* AsteriskToken */ || // import *\n                token() === 18 /* OpenBraceToken */ // import {\n            ) {\n                importClause = parseImportClause(identifier, afterImportPos, isTypeOnly);\n                parseExpected(153 /* FromKeyword */);\n            }\n            var moduleSpecifier = parseModuleSpecifier();\n            parseSemicolon();\n            var node = factory.createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier);\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function tokenAfterImportDefinitelyProducesImportDeclaration() {\n            return token() === 41 /* AsteriskToken */ || token() === 18 /* OpenBraceToken */;\n        }\n        function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() {\n            // In `import id ___`, the current token decides whether to produce\n            // an ImportDeclaration or ImportEqualsDeclaration.\n            return token() === 27 /* CommaToken */ || token() === 153 /* FromKeyword */;\n        }\n        function parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly) {\n            parseExpected(62 /* EqualsToken */);\n            var moduleReference = parseModuleReference();\n            parseSemicolon();\n            var node = factory.createImportEqualsDeclaration(decorators, modifiers, isTypeOnly, identifier, moduleReference);\n            var finished = withJSDoc(finishNode(node, pos), hasJSDoc);\n            return finished;\n        }\n        function parseImportClause(identifier, pos, isTypeOnly) {\n            // ImportClause:\n            //  ImportedDefaultBinding\n            //  NameSpaceImport\n            //  NamedImports\n            //  ImportedDefaultBinding, NameSpaceImport\n            //  ImportedDefaultBinding, NamedImports\n            // If there was no default import or if there is comma token after default import\n            // parse namespace or named imports\n            var namedBindings;\n            if (!identifier ||\n                parseOptional(27 /* CommaToken */)) {\n                namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(264 /* NamedImports */);\n            }\n            return finishNode(factory.createImportClause(isTypeOnly, identifier, namedBindings), pos);\n        }\n        function parseModuleReference() {\n            return isExternalModuleReference()\n                ? parseExternalModuleReference()\n                : parseEntityName(/*allowReservedWords*/ false);\n        }\n        function parseExternalModuleReference() {\n            var pos = getNodePos();\n            parseExpected(143 /* RequireKeyword */);\n            parseExpected(20 /* OpenParenToken */);\n            var expression = parseModuleSpecifier();\n            parseExpected(21 /* CloseParenToken */);\n            return finishNode(factory.createExternalModuleReference(expression), pos);\n        }\n        function parseModuleSpecifier() {\n            if (token() === 10 /* StringLiteral */) {\n                var result = parseLiteralNode();\n                result.text = internIdentifier(result.text);\n                return result;\n            }\n            else {\n                // We allow arbitrary expressions here, even though the grammar only allows string\n                // literals.  We check to ensure that it is only a string literal later in the grammar\n                // check pass.\n                return parseExpression();\n            }\n        }\n        function parseNamespaceImport() {\n            // NameSpaceImport:\n            //  * as ImportedBinding\n            var pos = getNodePos();\n            parseExpected(41 /* AsteriskToken */);\n            parseExpected(126 /* AsKeyword */);\n            var name = parseIdentifier();\n            return finishNode(factory.createNamespaceImport(name), pos);\n        }\n        function parseNamedImportsOrExports(kind) {\n            var pos = getNodePos();\n            // NamedImports:\n            //  { }\n            //  { ImportsList }\n            //  { ImportsList, }\n            // ImportsList:\n            //  ImportSpecifier\n            //  ImportsList, ImportSpecifier\n            var node = kind === 264 /* NamedImports */\n                ? factory.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */))\n                : factory.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */));\n            return finishNode(node, pos);\n        }\n        function parseExportSpecifier() {\n            return parseImportOrExportSpecifier(270 /* ExportSpecifier */);\n        }\n        function parseImportSpecifier() {\n            return parseImportOrExportSpecifier(265 /* ImportSpecifier */);\n        }\n        function parseImportOrExportSpecifier(kind) {\n            var pos = getNodePos();\n            // ImportSpecifier:\n            //   BindingIdentifier\n            //   IdentifierName as BindingIdentifier\n            // ExportSpecifier:\n            //   IdentifierName\n            //   IdentifierName as IdentifierName\n            var checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier();\n            var checkIdentifierStart = scanner.getTokenPos();\n            var checkIdentifierEnd = scanner.getTextPos();\n            var identifierName = parseIdentifierName();\n            var propertyName;\n            var name;\n            if (token() === 126 /* AsKeyword */) {\n                propertyName = identifierName;\n                parseExpected(126 /* AsKeyword */);\n                checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier();\n                checkIdentifierStart = scanner.getTokenPos();\n                checkIdentifierEnd = scanner.getTextPos();\n                name = parseIdentifierName();\n            }\n            else {\n                name = identifierName;\n            }\n            if (kind === 265 /* ImportSpecifier */ && checkIdentifierIsKeyword) {\n                parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected);\n            }\n            var node = kind === 265 /* ImportSpecifier */\n                ? factory.createImportSpecifier(propertyName, name)\n                : factory.createExportSpecifier(propertyName, name);\n            return finishNode(node, pos);\n        }\n        function parseNamespaceExport(pos) {\n            return finishNode(factory.createNamespaceExport(parseIdentifierName()), pos);\n        }\n        function parseExportDeclaration(pos, hasJSDoc, decorators, modifiers) {\n            var savedAwaitContext = inAwaitContext();\n            setAwaitContext(/*value*/ true);\n            var exportClause;\n            var moduleSpecifier;\n            var isTypeOnly = parseOptional(149 /* TypeKeyword */);\n            var namespaceExportPos = getNodePos();\n            if (parseOptional(41 /* AsteriskToken */)) {\n                if (parseOptional(126 /* AsKeyword */)) {\n                    exportClause = parseNamespaceExport(namespaceExportPos);\n                }\n                parseExpected(153 /* FromKeyword */);\n                moduleSpecifier = parseModuleSpecifier();\n            }\n            else {\n                exportClause = parseNamedImportsOrExports(268 /* NamedExports */);\n                // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios,\n                // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from \"moduleName\";`)\n                // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect.\n                if (token() === 153 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) {\n                    parseExpected(153 /* FromKeyword */);\n                    moduleSpecifier = parseModuleSpecifier();\n                }\n            }\n            parseSemicolon();\n            setAwaitContext(savedAwaitContext);\n            var node = factory.createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier);\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function parseExportAssignment(pos, hasJSDoc, decorators, modifiers) {\n            var savedAwaitContext = inAwaitContext();\n            setAwaitContext(/*value*/ true);\n            var isExportEquals;\n            if (parseOptional(62 /* EqualsToken */)) {\n                isExportEquals = true;\n            }\n            else {\n                parseExpected(87 /* DefaultKeyword */);\n            }\n            var expression = parseAssignmentExpressionOrHigher();\n            parseSemicolon();\n            setAwaitContext(savedAwaitContext);\n            var node = factory.createExportAssignment(decorators, modifiers, isExportEquals, expression);\n            return withJSDoc(finishNode(node, pos), hasJSDoc);\n        }\n        function setExternalModuleIndicator(sourceFile) {\n            // Try to use the first top-level import/export when available, then\n            // fall back to looking for an 'import.meta' somewhere in the tree if necessary.\n            sourceFile.externalModuleIndicator =\n                ts.forEach(sourceFile.statements, isAnExternalModuleIndicatorNode) ||\n                    getImportMetaIfNecessary(sourceFile);\n        }\n        function isAnExternalModuleIndicatorNode(node) {\n            return hasModifierOfKind(node, 92 /* ExportKeyword */)\n                || ts.isImportEqualsDeclaration(node) && ts.isExternalModuleReference(node.moduleReference)\n                || ts.isImportDeclaration(node)\n                || ts.isExportAssignment(node)\n                || ts.isExportDeclaration(node) ? node : undefined;\n        }\n        function getImportMetaIfNecessary(sourceFile) {\n            return sourceFile.flags & 2097152 /* PossiblyContainsImportMeta */ ?\n                walkTreeForExternalModuleIndicators(sourceFile) :\n                undefined;\n        }\n        function walkTreeForExternalModuleIndicators(node) {\n            return isImportMeta(node) ? node : forEachChild(node, walkTreeForExternalModuleIndicators);\n        }\n        /** Do not use hasModifier inside the parser; it relies on parent pointers. Use this instead. */\n        function hasModifierOfKind(node, kind) {\n            return ts.some(node.modifiers, function (m) { return m.kind === kind; });\n        }\n        function isImportMeta(node) {\n            return ts.isMetaProperty(node) && node.keywordToken === 99 /* ImportKeyword */ && node.name.escapedText === \"meta\";\n        }\n        var ParsingContext;\n        (function (ParsingContext) {\n            ParsingContext[ParsingContext[\"SourceElements\"] = 0] = \"SourceElements\";\n            ParsingContext[ParsingContext[\"BlockStatements\"] = 1] = \"BlockStatements\";\n            ParsingContext[ParsingContext[\"SwitchClauses\"] = 2] = \"SwitchClauses\";\n            ParsingContext[ParsingContext[\"SwitchClauseStatements\"] = 3] = \"SwitchClauseStatements\";\n            ParsingContext[ParsingContext[\"TypeMembers\"] = 4] = \"TypeMembers\";\n            ParsingContext[ParsingContext[\"ClassMembers\"] = 5] = \"ClassMembers\";\n            ParsingContext[ParsingContext[\"EnumMembers\"] = 6] = \"EnumMembers\";\n            ParsingContext[ParsingContext[\"HeritageClauseElement\"] = 7] = \"HeritageClauseElement\";\n            ParsingContext[ParsingContext[\"VariableDeclarations\"] = 8] = \"VariableDeclarations\";\n            ParsingContext[ParsingContext[\"ObjectBindingElements\"] = 9] = \"ObjectBindingElements\";\n            ParsingContext[ParsingContext[\"ArrayBindingElements\"] = 10] = \"ArrayBindingElements\";\n            ParsingContext[ParsingContext[\"ArgumentExpressions\"] = 11] = \"ArgumentExpressions\";\n            ParsingContext[ParsingContext[\"ObjectLiteralMembers\"] = 12] = \"ObjectLiteralMembers\";\n            ParsingContext[ParsingContext[\"JsxAttributes\"] = 13] = \"JsxAttributes\";\n            ParsingContext[ParsingContext[\"JsxChildren\"] = 14] = \"JsxChildren\";\n            ParsingContext[ParsingContext[\"ArrayLiteralMembers\"] = 15] = \"ArrayLiteralMembers\";\n            ParsingContext[ParsingContext[\"Parameters\"] = 16] = \"Parameters\";\n            ParsingContext[ParsingContext[\"JSDocParameters\"] = 17] = \"JSDocParameters\";\n            ParsingContext[ParsingContext[\"RestProperties\"] = 18] = \"RestProperties\";\n            ParsingContext[ParsingContext[\"TypeParameters\"] = 19] = \"TypeParameters\";\n            ParsingContext[ParsingContext[\"TypeArguments\"] = 20] = \"TypeArguments\";\n            ParsingContext[ParsingContext[\"TupleElementTypes\"] = 21] = \"TupleElementTypes\";\n            ParsingContext[ParsingContext[\"HeritageClauses\"] = 22] = \"HeritageClauses\";\n            ParsingContext[ParsingContext[\"ImportOrExportSpecifiers\"] = 23] = \"ImportOrExportSpecifiers\";\n            ParsingContext[ParsingContext[\"Count\"] = 24] = \"Count\"; // Number of parsing contexts\n        })(ParsingContext || (ParsingContext = {}));\n        var Tristate;\n        (function (Tristate) {\n            Tristate[Tristate[\"False\"] = 0] = \"False\";\n            Tristate[Tristate[\"True\"] = 1] = \"True\";\n            Tristate[Tristate[\"Unknown\"] = 2] = \"Unknown\";\n        })(Tristate || (Tristate = {}));\n        var JSDocParser;\n        (function (JSDocParser) {\n            function parseJSDocTypeExpressionForTests(content, start, length) {\n                initializeState(\"file.js\", content, 99 /* Latest */, /*_syntaxCursor:*/ undefined, 1 /* JS */);\n                scanner.setText(content, start, length);\n                currentToken = scanner.scan();\n                var jsDocTypeExpression = parseJSDocTypeExpression();\n                var sourceFile = createSourceFile(\"file.js\", 99 /* Latest */, 1 /* JS */, /*isDeclarationFile*/ false, [], factory.createToken(1 /* EndOfFileToken */), 0 /* None */);\n                var diagnostics = ts.attachFileToDiagnostics(parseDiagnostics, sourceFile);\n                if (jsDocDiagnostics) {\n                    sourceFile.jsDocDiagnostics = ts.attachFileToDiagnostics(jsDocDiagnostics, sourceFile);\n                }\n                clearState();\n                return jsDocTypeExpression ? { jsDocTypeExpression: jsDocTypeExpression, diagnostics: diagnostics } : undefined;\n            }\n            JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests;\n            // Parses out a JSDoc type expression.\n            function parseJSDocTypeExpression(mayOmitBraces) {\n                var pos = getNodePos();\n                var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18 /* OpenBraceToken */);\n                var type = doInsideOfContext(4194304 /* JSDoc */, parseJSDocType);\n                if (!mayOmitBraces || hasBrace) {\n                    parseExpectedJSDoc(19 /* CloseBraceToken */);\n                }\n                var result = factory.createJSDocTypeExpression(type);\n                fixupParentReferences(result);\n                return finishNode(result, pos);\n            }\n            JSDocParser.parseJSDocTypeExpression = parseJSDocTypeExpression;\n            function parseJSDocNameReference() {\n                var pos = getNodePos();\n                var hasBrace = parseOptional(18 /* OpenBraceToken */);\n                var entityName = parseEntityName(/* allowReservedWords*/ false);\n                if (hasBrace) {\n                    parseExpectedJSDoc(19 /* CloseBraceToken */);\n                }\n                var result = factory.createJSDocNameReference(entityName);\n                fixupParentReferences(result);\n                return finishNode(result, pos);\n            }\n            JSDocParser.parseJSDocNameReference = parseJSDocNameReference;\n            function parseIsolatedJSDocComment(content, start, length) {\n                initializeState(\"\", content, 99 /* Latest */, /*_syntaxCursor:*/ undefined, 1 /* JS */);\n                var jsDoc = doInsideOfContext(4194304 /* JSDoc */, function () { return parseJSDocCommentWorker(start, length); });\n                var sourceFile = { languageVariant: 0 /* Standard */, text: content };\n                var diagnostics = ts.attachFileToDiagnostics(parseDiagnostics, sourceFile);\n                clearState();\n                return jsDoc ? { jsDoc: jsDoc, diagnostics: diagnostics } : undefined;\n            }\n            JSDocParser.parseIsolatedJSDocComment = parseIsolatedJSDocComment;\n            function parseJSDocComment(parent, start, length) {\n                var saveToken = currentToken;\n                var saveParseDiagnosticsLength = parseDiagnostics.length;\n                var saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode;\n                var comment = doInsideOfContext(4194304 /* JSDoc */, function () { return parseJSDocCommentWorker(start, length); });\n                ts.setParent(comment, parent);\n                if (contextFlags & 131072 /* JavaScriptFile */) {\n                    if (!jsDocDiagnostics) {\n                        jsDocDiagnostics = [];\n                    }\n                    jsDocDiagnostics.push.apply(jsDocDiagnostics, parseDiagnostics);\n                }\n                currentToken = saveToken;\n                parseDiagnostics.length = saveParseDiagnosticsLength;\n                parseErrorBeforeNextFinishedNode = saveParseErrorBeforeNextFinishedNode;\n                return comment;\n            }\n            JSDocParser.parseJSDocComment = parseJSDocComment;\n            var JSDocState;\n            (function (JSDocState) {\n                JSDocState[JSDocState[\"BeginningOfLine\"] = 0] = \"BeginningOfLine\";\n                JSDocState[JSDocState[\"SawAsterisk\"] = 1] = \"SawAsterisk\";\n                JSDocState[JSDocState[\"SavingComments\"] = 2] = \"SavingComments\";\n                JSDocState[JSDocState[\"SavingBackticks\"] = 3] = \"SavingBackticks\";\n            })(JSDocState || (JSDocState = {}));\n            var PropertyLikeParse;\n            (function (PropertyLikeParse) {\n                PropertyLikeParse[PropertyLikeParse[\"Property\"] = 1] = \"Property\";\n                PropertyLikeParse[PropertyLikeParse[\"Parameter\"] = 2] = \"Parameter\";\n                PropertyLikeParse[PropertyLikeParse[\"CallbackParameter\"] = 4] = \"CallbackParameter\";\n            })(PropertyLikeParse || (PropertyLikeParse = {}));\n            function parseJSDocCommentWorker(start, length) {\n                if (start === void 0) { start = 0; }\n                var content = sourceText;\n                var end = length === undefined ? content.length : start + length;\n                length = end - start;\n                ts.Debug.assert(start >= 0);\n                ts.Debug.assert(start <= end);\n                ts.Debug.assert(end <= content.length);\n                // Check for /** (JSDoc opening part)\n                if (!isJSDocLikeText(content, start)) {\n                    return undefined;\n                }\n                var tags;\n                var tagsPos;\n                var tagsEnd;\n                var comments = [];\n                // + 3 for leading /**, - 5 in total for /** */\n                return scanner.scanRange(start + 3, length - 5, function () {\n                    // Initially we can parse out a tag.  We also have seen a starting asterisk.\n                    // This is so that /** * @type */ doesn't parse.\n                    var state = 1 /* SawAsterisk */;\n                    var margin;\n                    // + 4 for leading '/** '\n                    // + 1 because the last index of \\n is always one index before the first character in the line and coincidentally, if there is no \\n before start, it is -1, which is also one index before the first character\n                    var indent = start - (content.lastIndexOf(\"\\n\", start) + 1) + 4;\n                    function pushComment(text) {\n                        if (!margin) {\n                            margin = indent;\n                        }\n                        comments.push(text);\n                        indent += text.length;\n                    }\n                    nextTokenJSDoc();\n                    while (parseOptionalJsdoc(5 /* WhitespaceTrivia */))\n                        ;\n                    if (parseOptionalJsdoc(4 /* NewLineTrivia */)) {\n                        state = 0 /* BeginningOfLine */;\n                        indent = 0;\n                    }\n                    loop: while (true) {\n                        switch (token()) {\n                            case 59 /* AtToken */:\n                                if (state === 0 /* BeginningOfLine */ || state === 1 /* SawAsterisk */) {\n                                    removeTrailingWhitespace(comments);\n                                    addTag(parseTag(indent));\n                                    // NOTE: According to usejsdoc.org, a tag goes to end of line, except the last tag.\n                                    // Real-world comments may break this rule, so \"BeginningOfLine\" will not be a real line beginning\n                                    // for malformed examples like `/** @param {string} x @returns {number} the length */`\n                                    state = 0 /* BeginningOfLine */;\n                                    margin = undefined;\n                                }\n                                else {\n                                    pushComment(scanner.getTokenText());\n                                }\n                                break;\n                            case 4 /* NewLineTrivia */:\n                                comments.push(scanner.getTokenText());\n                                state = 0 /* BeginningOfLine */;\n                                indent = 0;\n                                break;\n                            case 41 /* AsteriskToken */:\n                                var asterisk = scanner.getTokenText();\n                                if (state === 1 /* SawAsterisk */ || state === 2 /* SavingComments */) {\n                                    // If we've already seen an asterisk, then we can no longer parse a tag on this line\n                                    state = 2 /* SavingComments */;\n                                    pushComment(asterisk);\n                                }\n                                else {\n                                    // Ignore the first asterisk on a line\n                                    state = 1 /* SawAsterisk */;\n                                    indent += asterisk.length;\n                                }\n                                break;\n                            case 5 /* WhitespaceTrivia */:\n                                // only collect whitespace if we're already saving comments or have just crossed the comment indent margin\n                                var whitespace = scanner.getTokenText();\n                                if (state === 2 /* SavingComments */) {\n                                    comments.push(whitespace);\n                                }\n                                else if (margin !== undefined && indent + whitespace.length > margin) {\n                                    comments.push(whitespace.slice(margin - indent));\n                                }\n                                indent += whitespace.length;\n                                break;\n                            case 1 /* EndOfFileToken */:\n                                break loop;\n                            default:\n                                // Anything else is doc comment text. We just save it. Because it\n                                // wasn't a tag, we can no longer parse a tag on this line until we hit the next\n                                // line break.\n                                state = 2 /* SavingComments */;\n                                pushComment(scanner.getTokenText());\n                                break;\n                        }\n                        nextTokenJSDoc();\n                    }\n                    removeLeadingNewlines(comments);\n                    removeTrailingWhitespace(comments);\n                    return createJSDocComment();\n                });\n                function removeLeadingNewlines(comments) {\n                    while (comments.length && (comments[0] === \"\\n\" || comments[0] === \"\\r\")) {\n                        comments.shift();\n                    }\n                }\n                function removeTrailingWhitespace(comments) {\n                    while (comments.length && comments[comments.length - 1].trim() === \"\") {\n                        comments.pop();\n                    }\n                }\n                function createJSDocComment() {\n                    var comment = comments.length ? comments.join(\"\") : undefined;\n                    var tagsArray = tags && createNodeArray(tags, tagsPos, tagsEnd);\n                    return finishNode(factory.createJSDocComment(comment, tagsArray), start, end);\n                }\n                function isNextNonwhitespaceTokenEndOfFile() {\n                    // We must use infinite lookahead, as there could be any number of newlines :(\n                    while (true) {\n                        nextTokenJSDoc();\n                        if (token() === 1 /* EndOfFileToken */) {\n                            return true;\n                        }\n                        if (!(token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */)) {\n                            return false;\n                        }\n                    }\n                }\n                function skipWhitespace() {\n                    if (token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */) {\n                        if (lookAhead(isNextNonwhitespaceTokenEndOfFile)) {\n                            return; // Don't skip whitespace prior to EoF (or end of comment) - that shouldn't be included in any node's range\n                        }\n                    }\n                    while (token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */) {\n                        nextTokenJSDoc();\n                    }\n                }\n                function skipWhitespaceOrAsterisk() {\n                    if (token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */) {\n                        if (lookAhead(isNextNonwhitespaceTokenEndOfFile)) {\n                            return \"\"; // Don't skip whitespace prior to EoF (or end of comment) - that shouldn't be included in any node's range\n                        }\n                    }\n                    var precedingLineBreak = scanner.hasPrecedingLineBreak();\n                    var seenLineBreak = false;\n                    var indentText = \"\";\n                    while ((precedingLineBreak && token() === 41 /* AsteriskToken */) || token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */) {\n                        indentText += scanner.getTokenText();\n                        if (token() === 4 /* NewLineTrivia */) {\n                            precedingLineBreak = true;\n                            seenLineBreak = true;\n                            indentText = \"\";\n                        }\n                        else if (token() === 41 /* AsteriskToken */) {\n                            precedingLineBreak = false;\n                        }\n                        nextTokenJSDoc();\n                    }\n                    return seenLineBreak ? indentText : \"\";\n                }\n                function parseTag(margin) {\n                    ts.Debug.assert(token() === 59 /* AtToken */);\n                    var start = scanner.getTokenPos();\n                    nextTokenJSDoc();\n                    var tagName = parseJSDocIdentifierName(/*message*/ undefined);\n                    var indentText = skipWhitespaceOrAsterisk();\n                    var tag;\n                    switch (tagName.escapedText) {\n                        case \"author\":\n                            tag = parseAuthorTag(start, tagName, margin, indentText);\n                            break;\n                        case \"implements\":\n                            tag = parseImplementsTag(start, tagName, margin, indentText);\n                            break;\n                        case \"augments\":\n                        case \"extends\":\n                            tag = parseAugmentsTag(start, tagName, margin, indentText);\n                            break;\n                        case \"class\":\n                        case \"constructor\":\n                            tag = parseSimpleTag(start, factory.createJSDocClassTag, tagName, margin, indentText);\n                            break;\n                        case \"public\":\n                            tag = parseSimpleTag(start, factory.createJSDocPublicTag, tagName, margin, indentText);\n                            break;\n                        case \"private\":\n                            tag = parseSimpleTag(start, factory.createJSDocPrivateTag, tagName, margin, indentText);\n                            break;\n                        case \"protected\":\n                            tag = parseSimpleTag(start, factory.createJSDocProtectedTag, tagName, margin, indentText);\n                            break;\n                        case \"readonly\":\n                            tag = parseSimpleTag(start, factory.createJSDocReadonlyTag, tagName, margin, indentText);\n                            break;\n                        case \"deprecated\":\n                            hasDeprecatedTag = true;\n                            tag = parseSimpleTag(start, factory.createJSDocDeprecatedTag, tagName, margin, indentText);\n                            break;\n                        case \"this\":\n                            tag = parseThisTag(start, tagName, margin, indentText);\n                            break;\n                        case \"enum\":\n                            tag = parseEnumTag(start, tagName, margin, indentText);\n                            break;\n                        case \"arg\":\n                        case \"argument\":\n                        case \"param\":\n                            return parseParameterOrPropertyTag(start, tagName, 2 /* Parameter */, margin);\n                        case \"return\":\n                        case \"returns\":\n                            tag = parseReturnTag(start, tagName, margin, indentText);\n                            break;\n                        case \"template\":\n                            tag = parseTemplateTag(start, tagName, margin, indentText);\n                            break;\n                        case \"type\":\n                            tag = parseTypeTag(start, tagName, margin, indentText);\n                            break;\n                        case \"typedef\":\n                            tag = parseTypedefTag(start, tagName, margin, indentText);\n                            break;\n                        case \"callback\":\n                            tag = parseCallbackTag(start, tagName, margin, indentText);\n                            break;\n                        case \"see\":\n                            tag = parseSeeTag(start, tagName, margin, indentText);\n                            break;\n                        default:\n                            tag = parseUnknownTag(start, tagName, margin, indentText);\n                            break;\n                    }\n                    return tag;\n                }\n                function parseTrailingTagComments(pos, end, margin, indentText) {\n                    // some tags, like typedef and callback, have already parsed their comments earlier\n                    if (!indentText) {\n                        margin += end - pos;\n                    }\n                    return parseTagComments(margin, indentText.slice(margin));\n                }\n                function parseTagComments(indent, initialMargin) {\n                    var comments = [];\n                    var state = 0 /* BeginningOfLine */;\n                    var previousWhitespace = true;\n                    var margin;\n                    function pushComment(text) {\n                        if (!margin) {\n                            margin = indent;\n                        }\n                        comments.push(text);\n                        indent += text.length;\n                    }\n                    if (initialMargin !== undefined) {\n                        // jump straight to saving comments if there is some initial indentation\n                        if (initialMargin !== \"\") {\n                            pushComment(initialMargin);\n                        }\n                        state = 1 /* SawAsterisk */;\n                    }\n                    var tok = token();\n                    loop: while (true) {\n                        switch (tok) {\n                            case 4 /* NewLineTrivia */:\n                                state = 0 /* BeginningOfLine */;\n                                // don't use pushComment here because we want to keep the margin unchanged\n                                comments.push(scanner.getTokenText());\n                                indent = 0;\n                                break;\n                            case 59 /* AtToken */:\n                                if (state === 3 /* SavingBackticks */ || !previousWhitespace && state === 2 /* SavingComments */) {\n                                    // @ doesn't start a new tag inside ``, and inside a comment, only after whitespace\n                                    comments.push(scanner.getTokenText());\n                                    break;\n                                }\n                                scanner.setTextPos(scanner.getTextPos() - 1);\n                            // falls through\n                            case 1 /* EndOfFileToken */:\n                                // Done\n                                break loop;\n                            case 5 /* WhitespaceTrivia */:\n                                if (state === 2 /* SavingComments */ || state === 3 /* SavingBackticks */) {\n                                    pushComment(scanner.getTokenText());\n                                }\n                                else {\n                                    var whitespace = scanner.getTokenText();\n                                    // if the whitespace crosses the margin, take only the whitespace that passes the margin\n                                    if (margin !== undefined && indent + whitespace.length > margin) {\n                                        comments.push(whitespace.slice(margin - indent));\n                                    }\n                                    indent += whitespace.length;\n                                }\n                                break;\n                            case 18 /* OpenBraceToken */:\n                                state = 2 /* SavingComments */;\n                                if (lookAhead(function () { return nextTokenJSDoc() === 59 /* AtToken */ && ts.tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && scanner.getTokenText() === \"link\"; })) {\n                                    pushComment(scanner.getTokenText());\n                                    nextTokenJSDoc();\n                                    pushComment(scanner.getTokenText());\n                                    nextTokenJSDoc();\n                                }\n                                pushComment(scanner.getTokenText());\n                                break;\n                            case 61 /* BacktickToken */:\n                                if (state === 3 /* SavingBackticks */) {\n                                    state = 2 /* SavingComments */;\n                                }\n                                else {\n                                    state = 3 /* SavingBackticks */;\n                                }\n                                pushComment(scanner.getTokenText());\n                                break;\n                            case 41 /* AsteriskToken */:\n                                if (state === 0 /* BeginningOfLine */) {\n                                    // leading asterisks start recording on the *next* (non-whitespace) token\n                                    state = 1 /* SawAsterisk */;\n                                    indent += 1;\n                                    break;\n                                }\n                            // record the * as a comment\n                            // falls through\n                            default:\n                                if (state !== 3 /* SavingBackticks */) {\n                                    state = 2 /* SavingComments */; // leading identifiers start recording as well\n                                }\n                                pushComment(scanner.getTokenText());\n                                break;\n                        }\n                        previousWhitespace = token() === 5 /* WhitespaceTrivia */;\n                        tok = nextTokenJSDoc();\n                    }\n                    removeLeadingNewlines(comments);\n                    removeTrailingWhitespace(comments);\n                    return comments.length === 0 ? undefined : comments.join(\"\");\n                }\n                function parseUnknownTag(start, tagName, indent, indentText) {\n                    var end = getNodePos();\n                    return finishNode(factory.createJSDocUnknownTag(tagName, parseTrailingTagComments(start, end, indent, indentText)), start, end);\n                }\n                function addTag(tag) {\n                    if (!tag) {\n                        return;\n                    }\n                    if (!tags) {\n                        tags = [tag];\n                        tagsPos = tag.pos;\n                    }\n                    else {\n                        tags.push(tag);\n                    }\n                    tagsEnd = tag.end;\n                }\n                function tryParseTypeExpression() {\n                    skipWhitespaceOrAsterisk();\n                    return token() === 18 /* OpenBraceToken */ ? parseJSDocTypeExpression() : undefined;\n                }\n                function parseBracketNameInPropertyAndParamTag() {\n                    // Looking for something like '[foo]', 'foo', '[foo.bar]' or 'foo.bar'\n                    var isBracketed = parseOptionalJsdoc(22 /* OpenBracketToken */);\n                    if (isBracketed) {\n                        skipWhitespace();\n                    }\n                    // a markdown-quoted name: `arg` is not legal jsdoc, but occurs in the wild\n                    var isBackquoted = parseOptionalJsdoc(61 /* BacktickToken */);\n                    var name = parseJSDocEntityName();\n                    if (isBackquoted) {\n                        parseExpectedTokenJSDoc(61 /* BacktickToken */);\n                    }\n                    if (isBracketed) {\n                        skipWhitespace();\n                        // May have an optional default, e.g. '[foo = 42]'\n                        if (parseOptionalToken(62 /* EqualsToken */)) {\n                            parseExpression();\n                        }\n                        parseExpected(23 /* CloseBracketToken */);\n                    }\n                    return { name: name, isBracketed: isBracketed };\n                }\n                function isObjectOrObjectArrayTypeReference(node) {\n                    switch (node.kind) {\n                        case 145 /* ObjectKeyword */:\n                            return true;\n                        case 178 /* ArrayType */:\n                            return isObjectOrObjectArrayTypeReference(node.elementType);\n                        default:\n                            return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === \"Object\" && !node.typeArguments;\n                    }\n                }\n                function parseParameterOrPropertyTag(start, tagName, target, indent) {\n                    var typeExpression = tryParseTypeExpression();\n                    var isNameFirst = !typeExpression;\n                    skipWhitespaceOrAsterisk();\n                    var _a = parseBracketNameInPropertyAndParamTag(), name = _a.name, isBracketed = _a.isBracketed;\n                    var indentText = skipWhitespaceOrAsterisk();\n                    if (isNameFirst) {\n                        typeExpression = tryParseTypeExpression();\n                    }\n                    var comment = parseTrailingTagComments(start, getNodePos(), indent, indentText);\n                    var nestedTypeLiteral = target !== 4 /* CallbackParameter */ && parseNestedTypeLiteral(typeExpression, name, target, indent);\n                    if (nestedTypeLiteral) {\n                        typeExpression = nestedTypeLiteral;\n                        isNameFirst = true;\n                    }\n                    var result = target === 1 /* Property */\n                        ? factory.createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment)\n                        : factory.createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment);\n                    return finishNode(result, start);\n                }\n                function parseNestedTypeLiteral(typeExpression, name, target, indent) {\n                    if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) {\n                        var pos = getNodePos();\n                        var child = void 0;\n                        var children = void 0;\n                        while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) {\n                            if (child.kind === 326 /* JSDocParameterTag */ || child.kind === 333 /* JSDocPropertyTag */) {\n                                children = ts.append(children, child);\n                            }\n                        }\n                        if (children) {\n                            var literal = finishNode(factory.createJSDocTypeLiteral(children, typeExpression.type.kind === 178 /* ArrayType */), pos);\n                            return finishNode(factory.createJSDocTypeExpression(literal), pos);\n                        }\n                    }\n                }\n                function parseReturnTag(start, tagName, indent, indentText) {\n                    if (ts.some(tags, ts.isJSDocReturnTag)) {\n                        parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText);\n                    }\n                    var typeExpression = tryParseTypeExpression();\n                    var end = getNodePos();\n                    return finishNode(factory.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start, end, indent, indentText)), start, end);\n                }\n                function parseTypeTag(start, tagName, indent, indentText) {\n                    if (ts.some(tags, ts.isJSDocTypeTag)) {\n                        parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText);\n                    }\n                    var typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true);\n                    var end = getNodePos();\n                    var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, end, indent, indentText) : undefined;\n                    return finishNode(factory.createJSDocTypeTag(tagName, typeExpression, comments), start, end);\n                }\n                function parseSeeTag(start, tagName, indent, indentText) {\n                    var nameExpression = parseJSDocNameReference();\n                    var end = getNodePos();\n                    var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, end, indent, indentText) : undefined;\n                    return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start, end);\n                }\n                function parseAuthorTag(start, tagName, indent, indentText) {\n                    var comments = parseAuthorNameAndEmail() + (parseTrailingTagComments(start, end, indent, indentText) || \"\");\n                    return finishNode(factory.createJSDocAuthorTag(tagName, comments || undefined), start);\n                }\n                function parseAuthorNameAndEmail() {\n                    var comments = [];\n                    var inEmail = false;\n                    var token = scanner.getToken();\n                    while (token !== 1 /* EndOfFileToken */ && token !== 4 /* NewLineTrivia */) {\n                        if (token === 29 /* LessThanToken */) {\n                            inEmail = true;\n                        }\n                        else if (token === 59 /* AtToken */ && !inEmail) {\n                            break;\n                        }\n                        else if (token === 31 /* GreaterThanToken */ && inEmail) {\n                            comments.push(scanner.getTokenText());\n                            scanner.setTextPos(scanner.getTokenPos() + 1);\n                            break;\n                        }\n                        comments.push(scanner.getTokenText());\n                        token = nextTokenJSDoc();\n                    }\n                    return comments.join(\"\");\n                }\n                function parseImplementsTag(start, tagName, margin, indentText) {\n                    var className = parseExpressionWithTypeArgumentsForAugments();\n                    var end = getNodePos();\n                    return finishNode(factory.createJSDocImplementsTag(tagName, className, parseTrailingTagComments(start, end, margin, indentText)), start, end);\n                }\n                function parseAugmentsTag(start, tagName, margin, indentText) {\n                    var className = parseExpressionWithTypeArgumentsForAugments();\n                    var end = getNodePos();\n                    return finishNode(factory.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start, end, margin, indentText)), start, end);\n                }\n                function parseExpressionWithTypeArgumentsForAugments() {\n                    var usedBrace = parseOptional(18 /* OpenBraceToken */);\n                    var pos = getNodePos();\n                    var expression = parsePropertyAccessEntityNameExpression();\n                    var typeArguments = tryParseTypeArguments();\n                    var node = factory.createExpressionWithTypeArguments(expression, typeArguments);\n                    var res = finishNode(node, pos);\n                    if (usedBrace) {\n                        parseExpected(19 /* CloseBraceToken */);\n                    }\n                    return res;\n                }\n                function parsePropertyAccessEntityNameExpression() {\n                    var pos = getNodePos();\n                    var node = parseJSDocIdentifierName();\n                    while (parseOptional(24 /* DotToken */)) {\n                        var name = parseJSDocIdentifierName();\n                        node = finishNode(factory.createPropertyAccessExpression(node, name), pos);\n                    }\n                    return node;\n                }\n                function parseSimpleTag(start, createTag, tagName, margin, indentText) {\n                    var end = getNodePos();\n                    return finishNode(createTag(tagName, parseTrailingTagComments(start, end, margin, indentText)), start, end);\n                }\n                function parseThisTag(start, tagName, margin, indentText) {\n                    var typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true);\n                    skipWhitespace();\n                    var end = getNodePos();\n                    return finishNode(factory.createJSDocThisTag(tagName, typeExpression, parseTrailingTagComments(start, end, margin, indentText)), start, end);\n                }\n                function parseEnumTag(start, tagName, margin, indentText) {\n                    var typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true);\n                    skipWhitespace();\n                    var end = getNodePos();\n                    return finishNode(factory.createJSDocEnumTag(tagName, typeExpression, parseTrailingTagComments(start, end, margin, indentText)), start, end);\n                }\n                function parseTypedefTag(start, tagName, indent, indentText) {\n                    var _a;\n                    var typeExpression = tryParseTypeExpression();\n                    skipWhitespaceOrAsterisk();\n                    var fullName = parseJSDocTypeNameWithNamespace();\n                    skipWhitespace();\n                    var comment = parseTagComments(indent);\n                    var end;\n                    if (!typeExpression || isObjectOrObjectArrayTypeReference(typeExpression.type)) {\n                        var child = void 0;\n                        var childTypeTag = void 0;\n                        var jsDocPropertyTags = void 0;\n                        var hasChildren = false;\n                        while (child = tryParse(function () { return parseChildPropertyTag(indent); })) {\n                            hasChildren = true;\n                            if (child.kind === 329 /* JSDocTypeTag */) {\n                                if (childTypeTag) {\n                                    parseErrorAtCurrentToken(ts.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);\n                                    var lastError = ts.lastOrUndefined(parseDiagnostics);\n                                    if (lastError) {\n                                        ts.addRelatedInfo(lastError, ts.createDetachedDiagnostic(fileName, 0, 0, ts.Diagnostics.The_tag_was_first_specified_here));\n                                    }\n                                    break;\n                                }\n                                else {\n                                    childTypeTag = child;\n                                }\n                            }\n                            else {\n                                jsDocPropertyTags = ts.append(jsDocPropertyTags, child);\n                            }\n                        }\n                        if (hasChildren) {\n                            var isArrayType = typeExpression && typeExpression.type.kind === 178 /* ArrayType */;\n                            var jsdocTypeLiteral = factory.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType);\n                            typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ?\n                                childTypeTag.typeExpression :\n                                finishNode(jsdocTypeLiteral, start);\n                            end = typeExpression.end;\n                        }\n                    }\n                    // Only include the characters between the name end and the next token if a comment was actually parsed out - otherwise it's just whitespace\n                    end = end || comment !== undefined ?\n                        getNodePos() :\n                        ((_a = fullName !== null && fullName !== void 0 ? fullName : typeExpression) !== null && _a !== void 0 ? _a : tagName).end;\n                    if (!comment) {\n                        comment = parseTrailingTagComments(start, end, indent, indentText);\n                    }\n                    var typedefTag = factory.createJSDocTypedefTag(tagName, typeExpression, fullName, comment);\n                    return finishNode(typedefTag, start, end);\n                }\n                function parseJSDocTypeNameWithNamespace(nested) {\n                    var pos = scanner.getTokenPos();\n                    if (!ts.tokenIsIdentifierOrKeyword(token())) {\n                        return undefined;\n                    }\n                    var typeNameOrNamespaceName = parseJSDocIdentifierName();\n                    if (parseOptional(24 /* DotToken */)) {\n                        var body = parseJSDocTypeNameWithNamespace(/*nested*/ true);\n                        var jsDocNamespaceNode = factory.createModuleDeclaration(\n                        /*decorators*/ undefined, \n                        /*modifiers*/ undefined, typeNameOrNamespaceName, body, nested ? 4 /* NestedNamespace */ : undefined);\n                        return finishNode(jsDocNamespaceNode, pos);\n                    }\n                    if (nested) {\n                        typeNameOrNamespaceName.isInJSDocNamespace = true;\n                    }\n                    return typeNameOrNamespaceName;\n                }\n                function parseCallbackTagParameters(indent) {\n                    var pos = getNodePos();\n                    var child;\n                    var parameters;\n                    while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent); })) {\n                        parameters = ts.append(parameters, child);\n                    }\n                    return createNodeArray(parameters || [], pos);\n                }\n                function parseCallbackTag(start, tagName, indent, indentText) {\n                    var fullName = parseJSDocTypeNameWithNamespace();\n                    skipWhitespace();\n                    var comment = parseTagComments(indent);\n                    var parameters = parseCallbackTagParameters(indent);\n                    var returnTag = tryParse(function () {\n                        if (parseOptionalJsdoc(59 /* AtToken */)) {\n                            var tag = parseTag(indent);\n                            if (tag && tag.kind === 327 /* JSDocReturnTag */) {\n                                return tag;\n                            }\n                        }\n                    });\n                    var typeExpression = finishNode(factory.createJSDocSignature(/*typeParameters*/ undefined, parameters, returnTag), start);\n                    var end = getNodePos();\n                    if (!comment) {\n                        comment = parseTrailingTagComments(start, end, indent, indentText);\n                    }\n                    return finishNode(factory.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start, end);\n                }\n                function escapedTextsEqual(a, b) {\n                    while (!ts.isIdentifier(a) || !ts.isIdentifier(b)) {\n                        if (!ts.isIdentifier(a) && !ts.isIdentifier(b) && a.right.escapedText === b.right.escapedText) {\n                            a = a.left;\n                            b = b.left;\n                        }\n                        else {\n                            return false;\n                        }\n                    }\n                    return a.escapedText === b.escapedText;\n                }\n                function parseChildPropertyTag(indent) {\n                    return parseChildParameterOrPropertyTag(1 /* Property */, indent);\n                }\n                function parseChildParameterOrPropertyTag(target, indent, name) {\n                    var canParseTag = true;\n                    var seenAsterisk = false;\n                    while (true) {\n                        switch (nextTokenJSDoc()) {\n                            case 59 /* AtToken */:\n                                if (canParseTag) {\n                                    var child = tryParseChildTag(target, indent);\n                                    if (child && (child.kind === 326 /* JSDocParameterTag */ || child.kind === 333 /* JSDocPropertyTag */) &&\n                                        target !== 4 /* CallbackParameter */ &&\n                                        name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {\n                                        return false;\n                                    }\n                                    return child;\n                                }\n                                seenAsterisk = false;\n                                break;\n                            case 4 /* NewLineTrivia */:\n                                canParseTag = true;\n                                seenAsterisk = false;\n                                break;\n                            case 41 /* AsteriskToken */:\n                                if (seenAsterisk) {\n                                    canParseTag = false;\n                                }\n                                seenAsterisk = true;\n                                break;\n                            case 78 /* Identifier */:\n                                canParseTag = false;\n                                break;\n                            case 1 /* EndOfFileToken */:\n                                return false;\n                        }\n                    }\n                }\n                function tryParseChildTag(target, indent) {\n                    ts.Debug.assert(token() === 59 /* AtToken */);\n                    var start = scanner.getStartPos();\n                    nextTokenJSDoc();\n                    var tagName = parseJSDocIdentifierName();\n                    skipWhitespace();\n                    var t;\n                    switch (tagName.escapedText) {\n                        case \"type\":\n                            return target === 1 /* Property */ && parseTypeTag(start, tagName);\n                        case \"prop\":\n                        case \"property\":\n                            t = 1 /* Property */;\n                            break;\n                        case \"arg\":\n                        case \"argument\":\n                        case \"param\":\n                            t = 2 /* Parameter */ | 4 /* CallbackParameter */;\n                            break;\n                        default:\n                            return false;\n                    }\n                    if (!(target & t)) {\n                        return false;\n                    }\n                    return parseParameterOrPropertyTag(start, tagName, target, indent);\n                }\n                function parseTemplateTagTypeParameter() {\n                    var typeParameterPos = getNodePos();\n                    var name = parseJSDocIdentifierName(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);\n                    return finishNode(factory.createTypeParameterDeclaration(name, /*constraint*/ undefined, /*defaultType*/ undefined), typeParameterPos);\n                }\n                function parseTemplateTagTypeParameters() {\n                    var pos = getNodePos();\n                    var typeParameters = [];\n                    do {\n                        skipWhitespace();\n                        typeParameters.push(parseTemplateTagTypeParameter());\n                        skipWhitespaceOrAsterisk();\n                    } while (parseOptionalJsdoc(27 /* CommaToken */));\n                    return createNodeArray(typeParameters, pos);\n                }\n                function parseTemplateTag(start, tagName, indent, indentText) {\n                    // The template tag looks like one of the following:\n                    //   @template T,U,V\n                    //   @template {Constraint} T\n                    //\n                    // According to the [closure docs](https://github.com/google/closure-compiler/wiki/Generic-Types#multiple-bounded-template-types):\n                    //   > Multiple bounded generics cannot be declared on the same line. For the sake of clarity, if multiple templates share the same\n                    //   > type bound they must be declared on separate lines.\n                    //\n                    // TODO: Determine whether we should enforce this in the checker.\n                    // TODO: Consider moving the `constraint` to the first type parameter as we could then remove `getEffectiveConstraintOfTypeParameter`.\n                    // TODO: Consider only parsing a single type parameter if there is a constraint.\n                    var constraint = token() === 18 /* OpenBraceToken */ ? parseJSDocTypeExpression() : undefined;\n                    var typeParameters = parseTemplateTagTypeParameters();\n                    var end = getNodePos();\n                    return finishNode(factory.createJSDocTemplateTag(tagName, constraint, typeParameters, parseTrailingTagComments(start, end, indent, indentText)), start, end);\n                }\n                function parseOptionalJsdoc(t) {\n                    if (token() === t) {\n                        nextTokenJSDoc();\n                        return true;\n                    }\n                    return false;\n                }\n                function parseJSDocEntityName() {\n                    var entity = parseJSDocIdentifierName();\n                    if (parseOptional(22 /* OpenBracketToken */)) {\n                        parseExpected(23 /* CloseBracketToken */);\n                        // Note that y[] is accepted as an entity name, but the postfix brackets are not saved for checking.\n                        // Technically usejsdoc.org requires them for specifying a property of a type equivalent to Array<{ x: ...}>\n                        // but it's not worth it to enforce that restriction.\n                    }\n                    while (parseOptional(24 /* DotToken */)) {\n                        var name = parseJSDocIdentifierName();\n                        if (parseOptional(22 /* OpenBracketToken */)) {\n                            parseExpected(23 /* CloseBracketToken */);\n                        }\n                        entity = createQualifiedName(entity, name);\n                    }\n                    return entity;\n                }\n                function parseJSDocIdentifierName(message) {\n                    if (!ts.tokenIsIdentifierOrKeyword(token())) {\n                        return createMissingNode(78 /* Identifier */, /*reportAtCurrentPosition*/ !message, message || ts.Diagnostics.Identifier_expected);\n                    }\n                    identifierCount++;\n                    var pos = scanner.getTokenPos();\n                    var end = scanner.getTextPos();\n                    var originalKeywordKind = token();\n                    var text = internIdentifier(scanner.getTokenValue());\n                    var result = finishNode(factory.createIdentifier(text, /*typeArguments*/ undefined, originalKeywordKind), pos, end);\n                    nextTokenJSDoc();\n                    return result;\n                }\n            }\n        })(JSDocParser = Parser.JSDocParser || (Parser.JSDocParser = {}));\n    })(Parser || (Parser = {}));\n    var IncrementalParser;\n    (function (IncrementalParser) {\n        function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) {\n            aggressiveChecks = aggressiveChecks || ts.Debug.shouldAssert(2 /* Aggressive */);\n            checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks);\n            if (ts.textChangeRangeIsUnchanged(textChangeRange)) {\n                // if the text didn't change, then we can just return our current source file as-is.\n                return sourceFile;\n            }\n            if (sourceFile.statements.length === 0) {\n                // If we don't have any statements in the current source file, then there's no real\n                // way to incrementally parse.  So just do a full parse instead.\n                return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, /*syntaxCursor*/ undefined, /*setParentNodes*/ true, sourceFile.scriptKind);\n            }\n            // Make sure we're not trying to incrementally update a source file more than once.  Once\n            // we do an update the original source file is considered unusable from that point onwards.\n            //\n            // This is because we do incremental parsing in-place.  i.e. we take nodes from the old\n            // tree and give them new positions and parents.  From that point on, trusting the old\n            // tree at all is not possible as far too much of it may violate invariants.\n            var incrementalSourceFile = sourceFile;\n            ts.Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed);\n            incrementalSourceFile.hasBeenIncrementallyParsed = true;\n            Parser.fixupParentReferences(incrementalSourceFile);\n            var oldText = sourceFile.text;\n            var syntaxCursor = createSyntaxCursor(sourceFile);\n            // Make the actual change larger so that we know to reparse anything whose lookahead\n            // might have intersected the change.\n            var changeRange = extendToAffectedRange(sourceFile, textChangeRange);\n            checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks);\n            // Ensure that extending the affected range only moved the start of the change range\n            // earlier in the file.\n            ts.Debug.assert(changeRange.span.start <= textChangeRange.span.start);\n            ts.Debug.assert(ts.textSpanEnd(changeRange.span) === ts.textSpanEnd(textChangeRange.span));\n            ts.Debug.assert(ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)) === ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange)));\n            // The is the amount the nodes after the edit range need to be adjusted.  It can be\n            // positive (if the edit added characters), negative (if the edit deleted characters)\n            // or zero (if this was a pure overwrite with nothing added/removed).\n            var delta = ts.textChangeRangeNewSpan(changeRange).length - changeRange.span.length;\n            // If we added or removed characters during the edit, then we need to go and adjust all\n            // the nodes after the edit.  Those nodes may move forward (if we inserted chars) or they\n            // may move backward (if we deleted chars).\n            //\n            // Doing this helps us out in two ways.  First, it means that any nodes/tokens we want\n            // to reuse are already at the appropriate position in the new text.  That way when we\n            // reuse them, we don't have to figure out if they need to be adjusted.  Second, it makes\n            // it very easy to determine if we can reuse a node.  If the node's position is at where\n            // we are in the text, then we can reuse it.  Otherwise we can't.  If the node's position\n            // is ahead of us, then we'll need to rescan tokens.  If the node's position is behind\n            // us, then we'll need to skip it or crumble it as appropriate\n            //\n            // We will also adjust the positions of nodes that intersect the change range as well.\n            // By doing this, we ensure that all the positions in the old tree are consistent, not\n            // just the positions of nodes entirely before/after the change range.  By being\n            // consistent, we can then easily map from positions to nodes in the old tree easily.\n            //\n            // Also, mark any syntax elements that intersect the changed span.  We know, up front,\n            // that we cannot reuse these elements.\n            updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, ts.textSpanEnd(changeRange.span), ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks);\n            // Now that we've set up our internal incremental state just proceed and parse the\n            // source file in the normal fashion.  When possible the parser will retrieve and\n            // reuse nodes from the old tree.\n            //\n            // Note: passing in 'true' for setNodeParents is very important.  When incrementally\n            // parsing, we will be reusing nodes from the old tree, and placing it into new\n            // parents.  If we don't set the parents now, we'll end up with an observably\n            // inconsistent tree.  Setting the parents on the new tree should be very fast.  We\n            // will immediately bail out of walking any subtrees when we can see that their parents\n            // are already correct.\n            var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /*setParentNodes*/ true, sourceFile.scriptKind);\n            result.commentDirectives = getNewCommentDirectives(sourceFile.commentDirectives, result.commentDirectives, changeRange.span.start, ts.textSpanEnd(changeRange.span), delta, oldText, newText, aggressiveChecks);\n            return result;\n        }\n        IncrementalParser.updateSourceFile = updateSourceFile;\n        function getNewCommentDirectives(oldDirectives, newDirectives, changeStart, changeRangeOldEnd, delta, oldText, newText, aggressiveChecks) {\n            if (!oldDirectives)\n                return newDirectives;\n            var commentDirectives;\n            var addedNewlyScannedDirectives = false;\n            for (var _i = 0, oldDirectives_1 = oldDirectives; _i < oldDirectives_1.length; _i++) {\n                var directive = oldDirectives_1[_i];\n                var range = directive.range, type = directive.type;\n                // Range before the change\n                if (range.end < changeStart) {\n                    commentDirectives = ts.append(commentDirectives, directive);\n                }\n                else if (range.pos > changeRangeOldEnd) {\n                    addNewlyScannedDirectives();\n                    // Node is entirely past the change range.  We need to move both its pos and\n                    // end, forward or backward appropriately.\n                    var updatedDirective = {\n                        range: { pos: range.pos + delta, end: range.end + delta },\n                        type: type\n                    };\n                    commentDirectives = ts.append(commentDirectives, updatedDirective);\n                    if (aggressiveChecks) {\n                        ts.Debug.assert(oldText.substring(range.pos, range.end) === newText.substring(updatedDirective.range.pos, updatedDirective.range.end));\n                    }\n                }\n                // Ignore ranges that fall in change range\n            }\n            addNewlyScannedDirectives();\n            return commentDirectives;\n            function addNewlyScannedDirectives() {\n                if (addedNewlyScannedDirectives)\n                    return;\n                addedNewlyScannedDirectives = true;\n                if (!commentDirectives) {\n                    commentDirectives = newDirectives;\n                }\n                else if (newDirectives) {\n                    commentDirectives.push.apply(commentDirectives, newDirectives);\n                }\n            }\n        }\n        function moveElementEntirelyPastChangeRange(element, isArray, delta, oldText, newText, aggressiveChecks) {\n            if (isArray) {\n                visitArray(element);\n            }\n            else {\n                visitNode(element);\n            }\n            return;\n            function visitNode(node) {\n                var text = \"\";\n                if (aggressiveChecks && shouldCheckNode(node)) {\n                    text = oldText.substring(node.pos, node.end);\n                }\n                // Ditch any existing LS children we may have created.  This way we can avoid\n                // moving them forward.\n                if (node._children) {\n                    node._children = undefined;\n                }\n                ts.setTextRangePosEnd(node, node.pos + delta, node.end + delta);\n                if (aggressiveChecks && shouldCheckNode(node)) {\n                    ts.Debug.assert(text === newText.substring(node.pos, node.end));\n                }\n                forEachChild(node, visitNode, visitArray);\n                if (ts.hasJSDocNodes(node)) {\n                    for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) {\n                        var jsDocComment = _a[_i];\n                        visitNode(jsDocComment);\n                    }\n                }\n                checkNodePositions(node, aggressiveChecks);\n            }\n            function visitArray(array) {\n                array._children = undefined;\n                ts.setTextRangePosEnd(array, array.pos + delta, array.end + delta);\n                for (var _i = 0, array_8 = array; _i < array_8.length; _i++) {\n                    var node = array_8[_i];\n                    visitNode(node);\n                }\n            }\n        }\n        function shouldCheckNode(node) {\n            switch (node.kind) {\n                case 10 /* StringLiteral */:\n                case 8 /* NumericLiteral */:\n                case 78 /* Identifier */:\n                    return true;\n            }\n            return false;\n        }\n        function adjustIntersectingElement(element, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta) {\n            ts.Debug.assert(element.end >= changeStart, \"Adjusting an element that was entirely before the change range\");\n            ts.Debug.assert(element.pos <= changeRangeOldEnd, \"Adjusting an element that was entirely after the change range\");\n            ts.Debug.assert(element.pos <= element.end);\n            // We have an element that intersects the change range in some way.  It may have its\n            // start, or its end (or both) in the changed range.  We want to adjust any part\n            // that intersects such that the final tree is in a consistent state.  i.e. all\n            // children have spans within the span of their parent, and all siblings are ordered\n            // properly.\n            // We may need to update both the 'pos' and the 'end' of the element.\n            // If the 'pos' is before the start of the change, then we don't need to touch it.\n            // If it isn't, then the 'pos' must be inside the change.  How we update it will\n            // depend if delta is positive or negative. If delta is positive then we have\n            // something like:\n            //\n            //  -------------------AAA-----------------\n            //  -------------------BBBCCCCCCC-----------------\n            //\n            // In this case, we consider any node that started in the change range to still be\n            // starting at the same position.\n            //\n            // however, if the delta is negative, then we instead have something like this:\n            //\n            //  -------------------XXXYYYYYYY-----------------\n            //  -------------------ZZZ-----------------\n            //\n            // In this case, any element that started in the 'X' range will keep its position.\n            // However any element that started after that will have their pos adjusted to be\n            // at the end of the new range.  i.e. any node that started in the 'Y' range will\n            // be adjusted to have their start at the end of the 'Z' range.\n            //\n            // The element will keep its position if possible.  Or Move backward to the new-end\n            // if it's in the 'Y' range.\n            var pos = Math.min(element.pos, changeRangeNewEnd);\n            // If the 'end' is after the change range, then we always adjust it by the delta\n            // amount.  However, if the end is in the change range, then how we adjust it\n            // will depend on if delta is positive or negative.  If delta is positive then we\n            // have something like:\n            //\n            //  -------------------AAA-----------------\n            //  -------------------BBBCCCCCCC-----------------\n            //\n            // In this case, we consider any node that ended inside the change range to keep its\n            // end position.\n            //\n            // however, if the delta is negative, then we instead have something like this:\n            //\n            //  -------------------XXXYYYYYYY-----------------\n            //  -------------------ZZZ-----------------\n            //\n            // In this case, any element that ended in the 'X' range will keep its position.\n            // However any element that ended after that will have their pos adjusted to be\n            // at the end of the new range.  i.e. any node that ended in the 'Y' range will\n            // be adjusted to have their end at the end of the 'Z' range.\n            var end = element.end >= changeRangeOldEnd ?\n                // Element ends after the change range.  Always adjust the end pos.\n                element.end + delta :\n                // Element ends in the change range.  The element will keep its position if\n                // possible. Or Move backward to the new-end if it's in the 'Y' range.\n                Math.min(element.end, changeRangeNewEnd);\n            ts.Debug.assert(pos <= end);\n            if (element.parent) {\n                ts.Debug.assertGreaterThanOrEqual(pos, element.parent.pos);\n                ts.Debug.assertLessThanOrEqual(end, element.parent.end);\n            }\n            ts.setTextRangePosEnd(element, pos, end);\n        }\n        function checkNodePositions(node, aggressiveChecks) {\n            if (aggressiveChecks) {\n                var pos_2 = node.pos;\n                var visitNode_1 = function (child) {\n                    ts.Debug.assert(child.pos >= pos_2);\n                    pos_2 = child.end;\n                };\n                if (ts.hasJSDocNodes(node)) {\n                    for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) {\n                        var jsDocComment = _a[_i];\n                        visitNode_1(jsDocComment);\n                    }\n                }\n                forEachChild(node, visitNode_1);\n                ts.Debug.assert(pos_2 <= node.end);\n            }\n        }\n        function updateTokenPositionsAndMarkElements(sourceFile, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta, oldText, newText, aggressiveChecks) {\n            visitNode(sourceFile);\n            return;\n            function visitNode(child) {\n                ts.Debug.assert(child.pos <= child.end);\n                if (child.pos > changeRangeOldEnd) {\n                    // Node is entirely past the change range.  We need to move both its pos and\n                    // end, forward or backward appropriately.\n                    moveElementEntirelyPastChangeRange(child, /*isArray*/ false, delta, oldText, newText, aggressiveChecks);\n                    return;\n                }\n                // Check if the element intersects the change range.  If it does, then it is not\n                // reusable.  Also, we'll need to recurse to see what constituent portions we may\n                // be able to use.\n                var fullEnd = child.end;\n                if (fullEnd >= changeStart) {\n                    child.intersectsChange = true;\n                    child._children = undefined;\n                    // Adjust the pos or end (or both) of the intersecting element accordingly.\n                    adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);\n                    forEachChild(child, visitNode, visitArray);\n                    if (ts.hasJSDocNodes(child)) {\n                        for (var _i = 0, _a = child.jsDoc; _i < _a.length; _i++) {\n                            var jsDocComment = _a[_i];\n                            visitNode(jsDocComment);\n                        }\n                    }\n                    checkNodePositions(child, aggressiveChecks);\n                    return;\n                }\n                // Otherwise, the node is entirely before the change range.  No need to do anything with it.\n                ts.Debug.assert(fullEnd < changeStart);\n            }\n            function visitArray(array) {\n                ts.Debug.assert(array.pos <= array.end);\n                if (array.pos > changeRangeOldEnd) {\n                    // Array is entirely after the change range.  We need to move it, and move any of\n                    // its children.\n                    moveElementEntirelyPastChangeRange(array, /*isArray*/ true, delta, oldText, newText, aggressiveChecks);\n                    return;\n                }\n                // Check if the element intersects the change range.  If it does, then it is not\n                // reusable.  Also, we'll need to recurse to see what constituent portions we may\n                // be able to use.\n                var fullEnd = array.end;\n                if (fullEnd >= changeStart) {\n                    array.intersectsChange = true;\n                    array._children = undefined;\n                    // Adjust the pos or end (or both) of the intersecting array accordingly.\n                    adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);\n                    for (var _i = 0, array_9 = array; _i < array_9.length; _i++) {\n                        var node = array_9[_i];\n                        visitNode(node);\n                    }\n                    return;\n                }\n                // Otherwise, the array is entirely before the change range.  No need to do anything with it.\n                ts.Debug.assert(fullEnd < changeStart);\n            }\n        }\n        function extendToAffectedRange(sourceFile, changeRange) {\n            // Consider the following code:\n            //      void foo() { /; }\n            //\n            // If the text changes with an insertion of / just before the semicolon then we end up with:\n            //      void foo() { //; }\n            //\n            // If we were to just use the changeRange a is, then we would not rescan the { token\n            // (as it does not intersect the actual original change range).  Because an edit may\n            // change the token touching it, we actually need to look back *at least* one token so\n            // that the prior token sees that change.\n            var maxLookahead = 1;\n            var start = changeRange.span.start;\n            // the first iteration aligns us with the change start. subsequent iteration move us to\n            // the left by maxLookahead tokens.  We only need to do this as long as we're not at the\n            // start of the tree.\n            for (var i = 0; start > 0 && i <= maxLookahead; i++) {\n                var nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start);\n                ts.Debug.assert(nearestNode.pos <= start);\n                var position = nearestNode.pos;\n                start = Math.max(0, position - 1);\n            }\n            var finalSpan = ts.createTextSpanFromBounds(start, ts.textSpanEnd(changeRange.span));\n            var finalLength = changeRange.newLength + (changeRange.span.start - start);\n            return ts.createTextChangeRange(finalSpan, finalLength);\n        }\n        function findNearestNodeStartingBeforeOrAtPosition(sourceFile, position) {\n            var bestResult = sourceFile;\n            var lastNodeEntirelyBeforePosition;\n            forEachChild(sourceFile, visit);\n            if (lastNodeEntirelyBeforePosition) {\n                var lastChildOfLastEntireNodeBeforePosition = getLastDescendant(lastNodeEntirelyBeforePosition);\n                if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) {\n                    bestResult = lastChildOfLastEntireNodeBeforePosition;\n                }\n            }\n            return bestResult;\n            function getLastDescendant(node) {\n                while (true) {\n                    var lastChild = ts.getLastChild(node);\n                    if (lastChild) {\n                        node = lastChild;\n                    }\n                    else {\n                        return node;\n                    }\n                }\n            }\n            function visit(child) {\n                if (ts.nodeIsMissing(child)) {\n                    // Missing nodes are effectively invisible to us.  We never even consider them\n                    // When trying to find the nearest node before us.\n                    return;\n                }\n                // If the child intersects this position, then this node is currently the nearest\n                // node that starts before the position.\n                if (child.pos <= position) {\n                    if (child.pos >= bestResult.pos) {\n                        // This node starts before the position, and is closer to the position than\n                        // the previous best node we found.  It is now the new best node.\n                        bestResult = child;\n                    }\n                    // Now, the node may overlap the position, or it may end entirely before the\n                    // position.  If it overlaps with the position, then either it, or one of its\n                    // children must be the nearest node before the position.  So we can just\n                    // recurse into this child to see if we can find something better.\n                    if (position < child.end) {\n                        // The nearest node is either this child, or one of the children inside\n                        // of it.  We've already marked this child as the best so far.  Recurse\n                        // in case one of the children is better.\n                        forEachChild(child, visit);\n                        // Once we look at the children of this node, then there's no need to\n                        // continue any further.\n                        return true;\n                    }\n                    else {\n                        ts.Debug.assert(child.end <= position);\n                        // The child ends entirely before this position.  Say you have the following\n                        // (where $ is the position)\n                        //\n                        //      <complex expr 1> ? <complex expr 2> $ : <...> <...>\n                        //\n                        // We would want to find the nearest preceding node in \"complex expr 2\".\n                        // To support that, we keep track of this node, and once we're done searching\n                        // for a best node, we recurse down this node to see if we can find a good\n                        // result in it.\n                        //\n                        // This approach allows us to quickly skip over nodes that are entirely\n                        // before the position, while still allowing us to find any nodes in the\n                        // last one that might be what we want.\n                        lastNodeEntirelyBeforePosition = child;\n                    }\n                }\n                else {\n                    ts.Debug.assert(child.pos > position);\n                    // We're now at a node that is entirely past the position we're searching for.\n                    // This node (and all following nodes) could never contribute to the result,\n                    // so just skip them by returning 'true' here.\n                    return true;\n                }\n            }\n        }\n        function checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks) {\n            var oldText = sourceFile.text;\n            if (textChangeRange) {\n                ts.Debug.assert((oldText.length - textChangeRange.span.length + textChangeRange.newLength) === newText.length);\n                if (aggressiveChecks || ts.Debug.shouldAssert(3 /* VeryAggressive */)) {\n                    var oldTextPrefix = oldText.substr(0, textChangeRange.span.start);\n                    var newTextPrefix = newText.substr(0, textChangeRange.span.start);\n                    ts.Debug.assert(oldTextPrefix === newTextPrefix);\n                    var oldTextSuffix = oldText.substring(ts.textSpanEnd(textChangeRange.span), oldText.length);\n                    var newTextSuffix = newText.substring(ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange)), newText.length);\n                    ts.Debug.assert(oldTextSuffix === newTextSuffix);\n                }\n            }\n        }\n        function createSyntaxCursor(sourceFile) {\n            var currentArray = sourceFile.statements;\n            var currentArrayIndex = 0;\n            ts.Debug.assert(currentArrayIndex < currentArray.length);\n            var current = currentArray[currentArrayIndex];\n            var lastQueriedPosition = -1 /* Value */;\n            return {\n                currentNode: function (position) {\n                    // Only compute the current node if the position is different than the last time\n                    // we were asked.  The parser commonly asks for the node at the same position\n                    // twice.  Once to know if can read an appropriate list element at a certain point,\n                    // and then to actually read and consume the node.\n                    if (position !== lastQueriedPosition) {\n                        // Much of the time the parser will need the very next node in the array that\n                        // we just returned a node from.So just simply check for that case and move\n                        // forward in the array instead of searching for the node again.\n                        if (current && current.end === position && currentArrayIndex < (currentArray.length - 1)) {\n                            currentArrayIndex++;\n                            current = currentArray[currentArrayIndex];\n                        }\n                        // If we don't have a node, or the node we have isn't in the right position,\n                        // then try to find a viable node at the position requested.\n                        if (!current || current.pos !== position) {\n                            findHighestListElementThatStartsAtPosition(position);\n                        }\n                    }\n                    // Cache this query so that we don't do any extra work if the parser calls back\n                    // into us.  Note: this is very common as the parser will make pairs of calls like\n                    // 'isListElement -> parseListElement'.  If we were unable to find a node when\n                    // called with 'isListElement', we don't want to redo the work when parseListElement\n                    // is called immediately after.\n                    lastQueriedPosition = position;\n                    // Either we don'd have a node, or we have a node at the position being asked for.\n                    ts.Debug.assert(!current || current.pos === position);\n                    return current;\n                }\n            };\n            // Finds the highest element in the tree we can find that starts at the provided position.\n            // The element must be a direct child of some node list in the tree.  This way after we\n            // return it, we can easily return its next sibling in the list.\n            function findHighestListElementThatStartsAtPosition(position) {\n                // Clear out any cached state about the last node we found.\n                currentArray = undefined;\n                currentArrayIndex = -1 /* Value */;\n                current = undefined;\n                // Recurse into the source file to find the highest node at this position.\n                forEachChild(sourceFile, visitNode, visitArray);\n                return;\n                function visitNode(node) {\n                    if (position >= node.pos && position < node.end) {\n                        // Position was within this node.  Keep searching deeper to find the node.\n                        forEachChild(node, visitNode, visitArray);\n                        // don't proceed any further in the search.\n                        return true;\n                    }\n                    // position wasn't in this node, have to keep searching.\n                    return false;\n                }\n                function visitArray(array) {\n                    if (position >= array.pos && position < array.end) {\n                        // position was in this array.  Search through this array to see if we find a\n                        // viable element.\n                        for (var i = 0; i < array.length; i++) {\n                            var child = array[i];\n                            if (child) {\n                                if (child.pos === position) {\n                                    // Found the right node.  We're done.\n                                    currentArray = array;\n                                    currentArrayIndex = i;\n                                    current = child;\n                                    return true;\n                                }\n                                else {\n                                    if (child.pos < position && position < child.end) {\n                                        // Position in somewhere within this child.  Search in it and\n                                        // stop searching in this array.\n                                        forEachChild(child, visitNode, visitArray);\n                                        return true;\n                                    }\n                                }\n                            }\n                        }\n                    }\n                    // position wasn't in this array, have to keep searching.\n                    return false;\n                }\n            }\n        }\n        IncrementalParser.createSyntaxCursor = createSyntaxCursor;\n        var InvalidPosition;\n        (function (InvalidPosition) {\n            InvalidPosition[InvalidPosition[\"Value\"] = -1] = \"Value\";\n        })(InvalidPosition || (InvalidPosition = {}));\n    })(IncrementalParser || (IncrementalParser = {}));\n    /** @internal */\n    function isDeclarationFileName(fileName) {\n        return ts.fileExtensionIs(fileName, \".d.ts\" /* Dts */);\n    }\n    ts.isDeclarationFileName = isDeclarationFileName;\n    /*@internal*/\n    function processCommentPragmas(context, sourceText) {\n        var pragmas = [];\n        for (var _i = 0, _a = ts.getLeadingCommentRanges(sourceText, 0) || ts.emptyArray; _i < _a.length; _i++) {\n            var range = _a[_i];\n            var comment = sourceText.substring(range.pos, range.end);\n            extractPragmas(pragmas, range, comment);\n        }\n        context.pragmas = new ts.Map();\n        for (var _b = 0, pragmas_1 = pragmas; _b < pragmas_1.length; _b++) {\n            var pragma = pragmas_1[_b];\n            if (context.pragmas.has(pragma.name)) {\n                var currentValue = context.pragmas.get(pragma.name);\n                if (currentValue instanceof Array) {\n                    currentValue.push(pragma.args);\n                }\n                else {\n                    context.pragmas.set(pragma.name, [currentValue, pragma.args]);\n                }\n                continue;\n            }\n            context.pragmas.set(pragma.name, pragma.args);\n        }\n    }\n    ts.processCommentPragmas = processCommentPragmas;\n    /*@internal*/\n    function processPragmasIntoFields(context, reportDiagnostic) {\n        context.checkJsDirective = undefined;\n        context.referencedFiles = [];\n        context.typeReferenceDirectives = [];\n        context.libReferenceDirectives = [];\n        context.amdDependencies = [];\n        context.hasNoDefaultLib = false;\n        context.pragmas.forEach(function (entryOrList, key) {\n            // TODO: The below should be strongly type-guarded and not need casts/explicit annotations, since entryOrList is related to\n            // key and key is constrained to a union; but it's not (see GH#21483 for at least partial fix) :(\n            switch (key) {\n                case \"reference\": {\n                    var referencedFiles_1 = context.referencedFiles;\n                    var typeReferenceDirectives_1 = context.typeReferenceDirectives;\n                    var libReferenceDirectives_1 = context.libReferenceDirectives;\n                    ts.forEach(ts.toArray(entryOrList), function (arg) {\n                        var _a = arg.arguments, types = _a.types, lib = _a.lib, path = _a.path;\n                        if (arg.arguments[\"no-default-lib\"]) {\n                            context.hasNoDefaultLib = true;\n                        }\n                        else if (types) {\n                            typeReferenceDirectives_1.push({ pos: types.pos, end: types.end, fileName: types.value });\n                        }\n                        else if (lib) {\n                            libReferenceDirectives_1.push({ pos: lib.pos, end: lib.end, fileName: lib.value });\n                        }\n                        else if (path) {\n                            referencedFiles_1.push({ pos: path.pos, end: path.end, fileName: path.value });\n                        }\n                        else {\n                            reportDiagnostic(arg.range.pos, arg.range.end - arg.range.pos, ts.Diagnostics.Invalid_reference_directive_syntax);\n                        }\n                    });\n                    break;\n                }\n                case \"amd-dependency\": {\n                    context.amdDependencies = ts.map(ts.toArray(entryOrList), function (x) { return ({ name: x.arguments.name, path: x.arguments.path }); });\n                    break;\n                }\n                case \"amd-module\": {\n                    if (entryOrList instanceof Array) {\n                        for (var _i = 0, entryOrList_1 = entryOrList; _i < entryOrList_1.length; _i++) {\n                            var entry = entryOrList_1[_i];\n                            if (context.moduleName) {\n                                // TODO: It's probably fine to issue this diagnostic on all instances of the pragma\n                                reportDiagnostic(entry.range.pos, entry.range.end - entry.range.pos, ts.Diagnostics.An_AMD_module_cannot_have_multiple_name_assignments);\n                            }\n                            context.moduleName = entry.arguments.name;\n                        }\n                    }\n                    else {\n                        context.moduleName = entryOrList.arguments.name;\n                    }\n                    break;\n                }\n                case \"ts-nocheck\":\n                case \"ts-check\": {\n                    // _last_ of either nocheck or check in a file is the \"winner\"\n                    ts.forEach(ts.toArray(entryOrList), function (entry) {\n                        if (!context.checkJsDirective || entry.range.pos > context.checkJsDirective.pos) {\n                            context.checkJsDirective = {\n                                enabled: key === \"ts-check\",\n                                end: entry.range.end,\n                                pos: entry.range.pos\n                            };\n                        }\n                    });\n                    break;\n                }\n                case \"jsx\":\n                case \"jsxfrag\":\n                case \"jsximportsource\":\n                case \"jsxruntime\":\n                    return; // Accessed directly\n                default: ts.Debug.fail(\"Unhandled pragma kind\"); // Can this be made into an assertNever in the future?\n            }\n        });\n    }\n    ts.processPragmasIntoFields = processPragmasIntoFields;\n    var namedArgRegExCache = new ts.Map();\n    function getNamedArgRegEx(name) {\n        if (namedArgRegExCache.has(name)) {\n            return namedArgRegExCache.get(name);\n        }\n        var result = new RegExp(\"(\\\\s\" + name + \"\\\\s*=\\\\s*)('|\\\")(.+?)\\\\2\", \"im\");\n        namedArgRegExCache.set(name, result);\n        return result;\n    }\n    var tripleSlashXMLCommentStartRegEx = /^\\/\\/\\/\\s*<(\\S+)\\s.*?\\/>/im;\n    var singleLinePragmaRegEx = /^\\/\\/\\/?\\s*@(\\S+)\\s*(.*)\\s*$/im;\n    function extractPragmas(pragmas, range, text) {\n        var tripleSlash = range.kind === 2 /* SingleLineCommentTrivia */ && tripleSlashXMLCommentStartRegEx.exec(text);\n        if (tripleSlash) {\n            var name = tripleSlash[1].toLowerCase(); // Technically unsafe cast, but we do it so the below check to make it safe typechecks\n            var pragma = ts.commentPragmas[name];\n            if (!pragma || !(pragma.kind & 1 /* TripleSlashXML */)) {\n                return;\n            }\n            if (pragma.args) {\n                var argument = {};\n                for (var _i = 0, _a = pragma.args; _i < _a.length; _i++) {\n                    var arg = _a[_i];\n                    var matcher = getNamedArgRegEx(arg.name);\n                    var matchResult = matcher.exec(text);\n                    if (!matchResult && !arg.optional) {\n                        return; // Missing required argument, don't parse\n                    }\n                    else if (matchResult) {\n                        if (arg.captureSpan) {\n                            var startPos = range.pos + matchResult.index + matchResult[1].length + matchResult[2].length;\n                            argument[arg.name] = {\n                                value: matchResult[3],\n                                pos: startPos,\n                                end: startPos + matchResult[3].length\n                            };\n                        }\n                        else {\n                            argument[arg.name] = matchResult[3];\n                        }\n                    }\n                }\n                pragmas.push({ name: name, args: { arguments: argument, range: range } });\n            }\n            else {\n                pragmas.push({ name: name, args: { arguments: {}, range: range } });\n            }\n            return;\n        }\n        var singleLine = range.kind === 2 /* SingleLineCommentTrivia */ && singleLinePragmaRegEx.exec(text);\n        if (singleLine) {\n            return addPragmaForMatch(pragmas, range, 2 /* SingleLine */, singleLine);\n        }\n        if (range.kind === 3 /* MultiLineCommentTrivia */) {\n            var multiLinePragmaRegEx = /\\s*@(\\S+)\\s*(.*)\\s*$/gim; // Defined inline since it uses the \"g\" flag, which keeps a persistent index (for iterating)\n            var multiLineMatch = void 0;\n            while (multiLineMatch = multiLinePragmaRegEx.exec(text)) {\n                addPragmaForMatch(pragmas, range, 4 /* MultiLine */, multiLineMatch);\n            }\n        }\n    }\n    function addPragmaForMatch(pragmas, range, kind, match) {\n        if (!match)\n            return;\n        var name = match[1].toLowerCase(); // Technically unsafe cast, but we do it so they below check to make it safe typechecks\n        var pragma = ts.commentPragmas[name];\n        if (!pragma || !(pragma.kind & kind)) {\n            return;\n        }\n        var args = match[2]; // Split on spaces and match up positionally with definition\n        var argument = getNamedPragmaArguments(pragma, args);\n        if (argument === \"fail\")\n            return; // Missing required argument, fail to parse it\n        pragmas.push({ name: name, args: { arguments: argument, range: range } });\n        return;\n    }\n    function getNamedPragmaArguments(pragma, text) {\n        if (!text)\n            return {};\n        if (!pragma.args)\n            return {};\n        var args = text.split(/\\s+/);\n        var argMap = {};\n        for (var i = 0; i < pragma.args.length; i++) {\n            var argument = pragma.args[i];\n            if (!args[i] && !argument.optional) {\n                return \"fail\";\n            }\n            if (argument.captureSpan) {\n                return ts.Debug.fail(\"Capture spans not yet implemented for non-xml pragmas\");\n            }\n            argMap[argument.name] = args[i];\n        }\n        return argMap;\n    }\n    /** @internal */\n    function tagNamesAreEquivalent(lhs, rhs) {\n        if (lhs.kind !== rhs.kind) {\n            return false;\n        }\n        if (lhs.kind === 78 /* Identifier */) {\n            return lhs.escapedText === rhs.escapedText;\n        }\n        if (lhs.kind === 107 /* ThisKeyword */) {\n            return true;\n        }\n        // If we are at this statement then we must have PropertyAccessExpression and because tag name in Jsx element can only\n        // take forms of JsxTagNameExpression which includes an identifier, \"this\" expression, or another propertyAccessExpression\n        // it is safe to case the expression property as such. See parseJsxElementName for how we parse tag name in Jsx element\n        return lhs.name.escapedText === rhs.name.escapedText &&\n            tagNamesAreEquivalent(lhs.expression, rhs.expression);\n    }\n    ts.tagNamesAreEquivalent = tagNamesAreEquivalent;\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    /* @internal */\n    ts.compileOnSaveCommandLineOption = { name: \"compileOnSave\", type: \"boolean\" };\n    var jsxOptionMap = new ts.Map(ts.getEntries({\n        \"preserve\": 1 /* Preserve */,\n        \"react-native\": 3 /* ReactNative */,\n        \"react\": 2 /* React */,\n        \"react-jsx\": 4 /* ReactJSX */,\n        \"react-jsxdev\": 5 /* ReactJSXDev */,\n    }));\n    /* @internal */\n    ts.inverseJsxOptionMap = new ts.Map(ts.arrayFrom(ts.mapIterator(jsxOptionMap.entries(), function (_a) {\n        var key = _a[0], value = _a[1];\n        return [\"\" + value, key];\n    })));\n    // NOTE: The order here is important to default lib ordering as entries will have the same\n    //       order in the generated program (see `getDefaultLibPriority` in program.ts). This\n    //       order also affects overload resolution when a type declared in one lib is\n    //       augmented in another lib.\n    var libEntries = [\n        // JavaScript only\n        [\"es5\", \"lib.es5.d.ts\"],\n        [\"es6\", \"lib.es2015.d.ts\"],\n        [\"es2015\", \"lib.es2015.d.ts\"],\n        [\"es7\", \"lib.es2016.d.ts\"],\n        [\"es2016\", \"lib.es2016.d.ts\"],\n        [\"es2017\", \"lib.es2017.d.ts\"],\n        [\"es2018\", \"lib.es2018.d.ts\"],\n        [\"es2019\", \"lib.es2019.d.ts\"],\n        [\"es2020\", \"lib.es2020.d.ts\"],\n        [\"esnext\", \"lib.esnext.d.ts\"],\n        // Host only\n        [\"dom\", \"lib.dom.d.ts\"],\n        [\"dom.iterable\", \"lib.dom.iterable.d.ts\"],\n        [\"webworker\", \"lib.webworker.d.ts\"],\n        [\"webworker.importscripts\", \"lib.webworker.importscripts.d.ts\"],\n        [\"webworker.iterable\", \"lib.webworker.iterable.d.ts\"],\n        [\"scripthost\", \"lib.scripthost.d.ts\"],\n        // ES2015 Or ESNext By-feature options\n        [\"es2015.core\", \"lib.es2015.core.d.ts\"],\n        [\"es2015.collection\", \"lib.es2015.collection.d.ts\"],\n        [\"es2015.generator\", \"lib.es2015.generator.d.ts\"],\n        [\"es2015.iterable\", \"lib.es2015.iterable.d.ts\"],\n        [\"es2015.promise\", \"lib.es2015.promise.d.ts\"],\n        [\"es2015.proxy\", \"lib.es2015.proxy.d.ts\"],\n        [\"es2015.reflect\", \"lib.es2015.reflect.d.ts\"],\n        [\"es2015.symbol\", \"lib.es2015.symbol.d.ts\"],\n        [\"es2015.symbol.wellknown\", \"lib.es2015.symbol.wellknown.d.ts\"],\n        [\"es2016.array.include\", \"lib.es2016.array.include.d.ts\"],\n        [\"es2017.object\", \"lib.es2017.object.d.ts\"],\n        [\"es2017.sharedmemory\", \"lib.es2017.sharedmemory.d.ts\"],\n        [\"es2017.string\", \"lib.es2017.string.d.ts\"],\n        [\"es2017.intl\", \"lib.es2017.intl.d.ts\"],\n        [\"es2017.typedarrays\", \"lib.es2017.typedarrays.d.ts\"],\n        [\"es2018.asyncgenerator\", \"lib.es2018.asyncgenerator.d.ts\"],\n        [\"es2018.asynciterable\", \"lib.es2018.asynciterable.d.ts\"],\n        [\"es2018.intl\", \"lib.es2018.intl.d.ts\"],\n        [\"es2018.promise\", \"lib.es2018.promise.d.ts\"],\n        [\"es2018.regexp\", \"lib.es2018.regexp.d.ts\"],\n        [\"es2019.array\", \"lib.es2019.array.d.ts\"],\n        [\"es2019.object\", \"lib.es2019.object.d.ts\"],\n        [\"es2019.string\", \"lib.es2019.string.d.ts\"],\n        [\"es2019.symbol\", \"lib.es2019.symbol.d.ts\"],\n        [\"es2020.bigint\", \"lib.es2020.bigint.d.ts\"],\n        [\"es2020.promise\", \"lib.es2020.promise.d.ts\"],\n        [\"es2020.sharedmemory\", \"lib.es2020.sharedmemory.d.ts\"],\n        [\"es2020.string\", \"lib.es2020.string.d.ts\"],\n        [\"es2020.symbol.wellknown\", \"lib.es2020.symbol.wellknown.d.ts\"],\n        [\"es2020.intl\", \"lib.es2020.intl.d.ts\"],\n        [\"esnext.array\", \"lib.es2019.array.d.ts\"],\n        [\"esnext.symbol\", \"lib.es2019.symbol.d.ts\"],\n        [\"esnext.asynciterable\", \"lib.es2018.asynciterable.d.ts\"],\n        [\"esnext.intl\", \"lib.esnext.intl.d.ts\"],\n        [\"esnext.bigint\", \"lib.es2020.bigint.d.ts\"],\n        [\"esnext.string\", \"lib.esnext.string.d.ts\"],\n        [\"esnext.promise\", \"lib.esnext.promise.d.ts\"],\n        [\"esnext.weakref\", \"lib.esnext.weakref.d.ts\"]\n    ];\n    /**\n     * An array of supported \"lib\" reference file names used to determine the order for inclusion\n     * when referenced, as well as for spelling suggestions. This ensures the correct ordering for\n     * overload resolution when a type declared in one lib is extended by another.\n     */\n    /* @internal */\n    ts.libs = libEntries.map(function (entry) { return entry[0]; });\n    /**\n     * A map of lib names to lib files. This map is used both for parsing the \"lib\" command line\n     * option as well as for resolving lib reference directives.\n     */\n    /* @internal */\n    ts.libMap = new ts.Map(libEntries);\n    // Watch related options\n    /* @internal */\n    ts.optionsForWatch = [\n        {\n            name: \"watchFile\",\n            type: new ts.Map(ts.getEntries({\n                fixedpollinginterval: ts.WatchFileKind.FixedPollingInterval,\n                prioritypollinginterval: ts.WatchFileKind.PriorityPollingInterval,\n                dynamicprioritypolling: ts.WatchFileKind.DynamicPriorityPolling,\n                usefsevents: ts.WatchFileKind.UseFsEvents,\n                usefseventsonparentdirectory: ts.WatchFileKind.UseFsEventsOnParentDirectory,\n            })),\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_UseFsEvents_UseFsEventsOnParentDirectory,\n        },\n        {\n            name: \"watchDirectory\",\n            type: new ts.Map(ts.getEntries({\n                usefsevents: ts.WatchDirectoryKind.UseFsEvents,\n                fixedpollinginterval: ts.WatchDirectoryKind.FixedPollingInterval,\n                dynamicprioritypolling: ts.WatchDirectoryKind.DynamicPriorityPolling,\n            })),\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling,\n        },\n        {\n            name: \"fallbackPolling\",\n            type: new ts.Map(ts.getEntries({\n                fixedinterval: ts.PollingWatchKind.FixedInterval,\n                priorityinterval: ts.PollingWatchKind.PriorityInterval,\n                dynamicpriority: ts.PollingWatchKind.DynamicPriority,\n            })),\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority,\n        },\n        {\n            name: \"synchronousWatchDirectory\",\n            type: \"boolean\",\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,\n        },\n        {\n            name: \"excludeDirectories\",\n            type: \"list\",\n            element: {\n                name: \"excludeDirectory\",\n                type: \"string\",\n                isFilePath: true,\n                extraValidation: specToDiagnostic\n            },\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,\n        },\n        {\n            name: \"excludeFiles\",\n            type: \"list\",\n            element: {\n                name: \"excludeFile\",\n                type: \"string\",\n                isFilePath: true,\n                extraValidation: specToDiagnostic\n            },\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,\n        },\n    ];\n    /* @internal */\n    ts.commonOptionsWithBuild = [\n        {\n            name: \"help\",\n            shortName: \"h\",\n            type: \"boolean\",\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Command_line_Options,\n            description: ts.Diagnostics.Print_this_message,\n        },\n        {\n            name: \"help\",\n            shortName: \"?\",\n            type: \"boolean\"\n        },\n        {\n            name: \"watch\",\n            shortName: \"w\",\n            type: \"boolean\",\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Command_line_Options,\n            description: ts.Diagnostics.Watch_input_files,\n        },\n        {\n            name: \"preserveWatchOutput\",\n            type: \"boolean\",\n            showInSimplifiedHelpView: false,\n            category: ts.Diagnostics.Command_line_Options,\n            description: ts.Diagnostics.Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen,\n        },\n        {\n            name: \"listFiles\",\n            type: \"boolean\",\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Print_names_of_files_part_of_the_compilation\n        },\n        {\n            name: \"explainFiles\",\n            type: \"boolean\",\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Print_names_of_files_and_the_reason_they_are_part_of_the_compilation\n        }, {\n            name: \"listEmittedFiles\",\n            type: \"boolean\",\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Print_names_of_generated_files_part_of_the_compilation\n        },\n        {\n            name: \"pretty\",\n            type: \"boolean\",\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Command_line_Options,\n            description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental\n        },\n        {\n            name: \"traceResolution\",\n            type: \"boolean\",\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process\n        },\n        {\n            name: \"diagnostics\",\n            type: \"boolean\",\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Show_diagnostic_information\n        },\n        {\n            name: \"extendedDiagnostics\",\n            type: \"boolean\",\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Show_verbose_diagnostic_information\n        },\n        {\n            name: \"generateCpuProfile\",\n            type: \"string\",\n            isFilePath: true,\n            paramType: ts.Diagnostics.FILE_OR_DIRECTORY,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Generates_a_CPU_profile\n        },\n        {\n            name: \"generateTrace\",\n            type: \"string\",\n            isFilePath: true,\n            isCommandLineOnly: true,\n            paramType: ts.Diagnostics.DIRECTORY,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Generates_an_event_trace_and_a_list_of_types\n        },\n        {\n            name: \"incremental\",\n            shortName: \"i\",\n            type: \"boolean\",\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Enable_incremental_compilation,\n            transpileOptionValue: undefined\n        },\n        {\n            name: \"assumeChangesOnlyAffectDirectDependencies\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            affectsEmit: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it\n        },\n        {\n            name: \"locale\",\n            type: \"string\",\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.The_locale_used_when_displaying_messages_to_the_user_e_g_en_us\n        },\n    ];\n    /* @internal */\n    ts.targetOptionDeclaration = {\n        name: \"target\",\n        shortName: \"t\",\n        type: new ts.Map(ts.getEntries({\n            es3: 0 /* ES3 */,\n            es5: 1 /* ES5 */,\n            es6: 2 /* ES2015 */,\n            es2015: 2 /* ES2015 */,\n            es2016: 3 /* ES2016 */,\n            es2017: 4 /* ES2017 */,\n            es2018: 5 /* ES2018 */,\n            es2019: 6 /* ES2019 */,\n            es2020: 7 /* ES2020 */,\n            esnext: 99 /* ESNext */,\n        })),\n        affectsSourceFile: true,\n        affectsModuleResolution: true,\n        affectsEmit: true,\n        paramType: ts.Diagnostics.VERSION,\n        showInSimplifiedHelpView: true,\n        category: ts.Diagnostics.Basic_Options,\n        description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_ES2019_ES2020_or_ESNEXT,\n    };\n    /* @internal */\n    ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild), [\n        {\n            name: \"all\",\n            type: \"boolean\",\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Command_line_Options,\n            description: ts.Diagnostics.Show_all_compiler_options,\n        },\n        {\n            name: \"version\",\n            shortName: \"v\",\n            type: \"boolean\",\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Command_line_Options,\n            description: ts.Diagnostics.Print_the_compiler_s_version,\n        },\n        {\n            name: \"init\",\n            type: \"boolean\",\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Command_line_Options,\n            description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,\n        },\n        {\n            name: \"project\",\n            shortName: \"p\",\n            type: \"string\",\n            isFilePath: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Command_line_Options,\n            paramType: ts.Diagnostics.FILE_OR_DIRECTORY,\n            description: ts.Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json,\n        },\n        {\n            name: \"build\",\n            type: \"boolean\",\n            shortName: \"b\",\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Command_line_Options,\n            description: ts.Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date\n        },\n        {\n            name: \"showConfig\",\n            type: \"boolean\",\n            category: ts.Diagnostics.Command_line_Options,\n            isCommandLineOnly: true,\n            description: ts.Diagnostics.Print_the_final_configuration_instead_of_building\n        },\n        {\n            name: \"listFilesOnly\",\n            type: \"boolean\",\n            category: ts.Diagnostics.Command_line_Options,\n            affectsSemanticDiagnostics: true,\n            affectsEmit: true,\n            isCommandLineOnly: true,\n            description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing\n        },\n        // Basic\n        ts.targetOptionDeclaration,\n        {\n            name: \"module\",\n            shortName: \"m\",\n            type: new ts.Map(ts.getEntries({\n                none: ts.ModuleKind.None,\n                commonjs: ts.ModuleKind.CommonJS,\n                amd: ts.ModuleKind.AMD,\n                system: ts.ModuleKind.System,\n                umd: ts.ModuleKind.UMD,\n                es6: ts.ModuleKind.ES2015,\n                es2015: ts.ModuleKind.ES2015,\n                es2020: ts.ModuleKind.ES2020,\n                esnext: ts.ModuleKind.ESNext\n            })),\n            affectsModuleResolution: true,\n            affectsEmit: true,\n            paramType: ts.Diagnostics.KIND,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_es2020_or_ESNext,\n        },\n        {\n            name: \"lib\",\n            type: \"list\",\n            element: {\n                name: \"lib\",\n                type: ts.libMap\n            },\n            affectsModuleResolution: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation,\n            transpileOptionValue: undefined\n        },\n        {\n            name: \"allowJs\",\n            type: \"boolean\",\n            affectsModuleResolution: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Allow_javascript_files_to_be_compiled\n        },\n        {\n            name: \"checkJs\",\n            type: \"boolean\",\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Report_errors_in_js_files\n        },\n        {\n            name: \"jsx\",\n            type: jsxOptionMap,\n            affectsSourceFile: true,\n            affectsEmit: true,\n            affectsModuleResolution: true,\n            paramType: ts.Diagnostics.KIND,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Specify_JSX_code_generation_Colon_preserve_react_native_react_react_jsx_or_react_jsxdev,\n        },\n        {\n            name: \"declaration\",\n            shortName: \"d\",\n            type: \"boolean\",\n            affectsEmit: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Generates_corresponding_d_ts_file,\n            transpileOptionValue: undefined\n        },\n        {\n            name: \"declarationMap\",\n            type: \"boolean\",\n            affectsEmit: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Generates_a_sourcemap_for_each_corresponding_d_ts_file,\n            transpileOptionValue: undefined\n        },\n        {\n            name: \"emitDeclarationOnly\",\n            type: \"boolean\",\n            affectsEmit: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Only_emit_d_ts_declaration_files,\n            transpileOptionValue: undefined\n        },\n        {\n            name: \"sourceMap\",\n            type: \"boolean\",\n            affectsEmit: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Generates_corresponding_map_file,\n        },\n        {\n            name: \"outFile\",\n            type: \"string\",\n            affectsEmit: true,\n            isFilePath: true,\n            paramType: ts.Diagnostics.FILE,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file,\n            transpileOptionValue: undefined\n        },\n        {\n            name: \"outDir\",\n            type: \"string\",\n            affectsEmit: true,\n            isFilePath: true,\n            paramType: ts.Diagnostics.DIRECTORY,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Redirect_output_structure_to_the_directory,\n        },\n        {\n            name: \"rootDir\",\n            type: \"string\",\n            affectsEmit: true,\n            isFilePath: true,\n            paramType: ts.Diagnostics.LOCATION,\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir,\n        },\n        {\n            name: \"composite\",\n            type: \"boolean\",\n            affectsEmit: true,\n            isTSConfigOnly: true,\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Enable_project_compilation,\n            transpileOptionValue: undefined\n        },\n        {\n            name: \"tsBuildInfoFile\",\n            type: \"string\",\n            affectsEmit: true,\n            isFilePath: true,\n            paramType: ts.Diagnostics.FILE,\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Specify_file_to_store_incremental_compilation_information,\n            transpileOptionValue: undefined\n        },\n        {\n            name: \"removeComments\",\n            type: \"boolean\",\n            affectsEmit: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Do_not_emit_comments_to_output,\n        },\n        {\n            name: \"noEmit\",\n            type: \"boolean\",\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Do_not_emit_outputs,\n            transpileOptionValue: undefined\n        },\n        {\n            name: \"importHelpers\",\n            type: \"boolean\",\n            affectsEmit: true,\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Import_emit_helpers_from_tslib\n        },\n        {\n            name: \"importsNotUsedAsValues\",\n            type: new ts.Map(ts.getEntries({\n                remove: 0 /* Remove */,\n                preserve: 1 /* Preserve */,\n                error: 2 /* Error */\n            })),\n            affectsEmit: true,\n            affectsSemanticDiagnostics: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types\n        },\n        {\n            name: \"downlevelIteration\",\n            type: \"boolean\",\n            affectsEmit: true,\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3\n        },\n        {\n            name: \"isolatedModules\",\n            type: \"boolean\",\n            category: ts.Diagnostics.Basic_Options,\n            description: ts.Diagnostics.Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule,\n            transpileOptionValue: true\n        },\n        // Strict Type Checks\n        {\n            name: \"strict\",\n            type: \"boolean\",\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Strict_Type_Checking_Options,\n            description: ts.Diagnostics.Enable_all_strict_type_checking_options\n        },\n        {\n            name: \"noImplicitAny\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            strictFlag: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Strict_Type_Checking_Options,\n            description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type\n        },\n        {\n            name: \"strictNullChecks\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            strictFlag: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Strict_Type_Checking_Options,\n            description: ts.Diagnostics.Enable_strict_null_checks\n        },\n        {\n            name: \"strictFunctionTypes\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            strictFlag: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Strict_Type_Checking_Options,\n            description: ts.Diagnostics.Enable_strict_checking_of_function_types\n        },\n        {\n            name: \"strictBindCallApply\",\n            type: \"boolean\",\n            strictFlag: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Strict_Type_Checking_Options,\n            description: ts.Diagnostics.Enable_strict_bind_call_and_apply_methods_on_functions\n        },\n        {\n            name: \"strictPropertyInitialization\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            strictFlag: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Strict_Type_Checking_Options,\n            description: ts.Diagnostics.Enable_strict_checking_of_property_initialization_in_classes\n        },\n        {\n            name: \"noImplicitThis\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            strictFlag: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Strict_Type_Checking_Options,\n            description: ts.Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type,\n        },\n        {\n            name: \"alwaysStrict\",\n            type: \"boolean\",\n            affectsSourceFile: true,\n            strictFlag: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Strict_Type_Checking_Options,\n            description: ts.Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file\n        },\n        // Additional Checks\n        {\n            name: \"noUnusedLocals\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Additional_Checks,\n            description: ts.Diagnostics.Report_errors_on_unused_locals,\n        },\n        {\n            name: \"noUnusedParameters\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Additional_Checks,\n            description: ts.Diagnostics.Report_errors_on_unused_parameters,\n        },\n        {\n            name: \"noImplicitReturns\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Additional_Checks,\n            description: ts.Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value\n        },\n        {\n            name: \"noFallthroughCasesInSwitch\",\n            type: \"boolean\",\n            affectsBindDiagnostics: true,\n            affectsSemanticDiagnostics: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Additional_Checks,\n            description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement\n        },\n        {\n            name: \"noUncheckedIndexedAccess\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            showInSimplifiedHelpView: false,\n            category: ts.Diagnostics.Additional_Checks,\n            description: ts.Diagnostics.Include_undefined_in_index_signature_results\n        },\n        {\n            name: \"noPropertyAccessFromIndexSignature\",\n            type: \"boolean\",\n            showInSimplifiedHelpView: false,\n            category: ts.Diagnostics.Additional_Checks,\n            description: ts.Diagnostics.Require_undeclared_properties_from_index_signatures_to_use_element_accesses\n        },\n        // Module Resolution\n        {\n            name: \"moduleResolution\",\n            type: new ts.Map(ts.getEntries({\n                node: ts.ModuleResolutionKind.NodeJs,\n                classic: ts.ModuleResolutionKind.Classic,\n            })),\n            affectsModuleResolution: true,\n            paramType: ts.Diagnostics.STRATEGY,\n            category: ts.Diagnostics.Module_Resolution_Options,\n            description: ts.Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6,\n        },\n        {\n            name: \"baseUrl\",\n            type: \"string\",\n            affectsModuleResolution: true,\n            isFilePath: true,\n            category: ts.Diagnostics.Module_Resolution_Options,\n            description: ts.Diagnostics.Base_directory_to_resolve_non_absolute_module_names\n        },\n        {\n            // this option can only be specified in tsconfig.json\n            // use type = object to copy the value as-is\n            name: \"paths\",\n            type: \"object\",\n            affectsModuleResolution: true,\n            isTSConfigOnly: true,\n            category: ts.Diagnostics.Module_Resolution_Options,\n            description: ts.Diagnostics.A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl,\n            transpileOptionValue: undefined\n        },\n        {\n            // this option can only be specified in tsconfig.json\n            // use type = object to copy the value as-is\n            name: \"rootDirs\",\n            type: \"list\",\n            isTSConfigOnly: true,\n            element: {\n                name: \"rootDirs\",\n                type: \"string\",\n                isFilePath: true\n            },\n            affectsModuleResolution: true,\n            category: ts.Diagnostics.Module_Resolution_Options,\n            description: ts.Diagnostics.List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime,\n            transpileOptionValue: undefined\n        },\n        {\n            name: \"typeRoots\",\n            type: \"list\",\n            element: {\n                name: \"typeRoots\",\n                type: \"string\",\n                isFilePath: true\n            },\n            affectsModuleResolution: true,\n            category: ts.Diagnostics.Module_Resolution_Options,\n            description: ts.Diagnostics.List_of_folders_to_include_type_definitions_from\n        },\n        {\n            name: \"types\",\n            type: \"list\",\n            element: {\n                name: \"types\",\n                type: \"string\"\n            },\n            affectsModuleResolution: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Module_Resolution_Options,\n            description: ts.Diagnostics.Type_declaration_files_to_be_included_in_compilation,\n            transpileOptionValue: undefined\n        },\n        {\n            name: \"allowSyntheticDefaultImports\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            category: ts.Diagnostics.Module_Resolution_Options,\n            description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking\n        },\n        {\n            name: \"esModuleInterop\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            affectsEmit: true,\n            showInSimplifiedHelpView: true,\n            category: ts.Diagnostics.Module_Resolution_Options,\n            description: ts.Diagnostics.Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports\n        },\n        {\n            name: \"preserveSymlinks\",\n            type: \"boolean\",\n            category: ts.Diagnostics.Module_Resolution_Options,\n            description: ts.Diagnostics.Do_not_resolve_the_real_path_of_symlinks,\n        },\n        {\n            name: \"allowUmdGlobalAccess\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            category: ts.Diagnostics.Module_Resolution_Options,\n            description: ts.Diagnostics.Allow_accessing_UMD_globals_from_modules,\n        },\n        // Source Maps\n        {\n            name: \"sourceRoot\",\n            type: \"string\",\n            affectsEmit: true,\n            paramType: ts.Diagnostics.LOCATION,\n            category: ts.Diagnostics.Source_Map_Options,\n            description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations,\n        },\n        {\n            name: \"mapRoot\",\n            type: \"string\",\n            affectsEmit: true,\n            paramType: ts.Diagnostics.LOCATION,\n            category: ts.Diagnostics.Source_Map_Options,\n            description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations,\n        },\n        {\n            name: \"inlineSourceMap\",\n            type: \"boolean\",\n            affectsEmit: true,\n            category: ts.Diagnostics.Source_Map_Options,\n            description: ts.Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file\n        },\n        {\n            name: \"inlineSources\",\n            type: \"boolean\",\n            affectsEmit: true,\n            category: ts.Diagnostics.Source_Map_Options,\n            description: ts.Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set\n        },\n        // Experimental\n        {\n            name: \"experimentalDecorators\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            category: ts.Diagnostics.Experimental_Options,\n            description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators\n        },\n        {\n            name: \"emitDecoratorMetadata\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            affectsEmit: true,\n            category: ts.Diagnostics.Experimental_Options,\n            description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators\n        },\n        // Advanced\n        {\n            name: \"jsxFactory\",\n            type: \"string\",\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h\n        },\n        {\n            name: \"jsxFragmentFactory\",\n            type: \"string\",\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment\n        },\n        {\n            name: \"jsxImportSource\",\n            type: \"string\",\n            affectsSemanticDiagnostics: true,\n            affectsEmit: true,\n            affectsModuleResolution: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react\n        },\n        {\n            name: \"resolveJsonModule\",\n            type: \"boolean\",\n            affectsModuleResolution: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Include_modules_imported_with_json_extension\n        },\n        {\n            name: \"out\",\n            type: \"string\",\n            affectsEmit: true,\n            isFilePath: false,\n            // for correct behaviour, please use outFile\n            category: ts.Diagnostics.Advanced_Options,\n            paramType: ts.Diagnostics.FILE,\n            description: ts.Diagnostics.Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file,\n            transpileOptionValue: undefined\n        },\n        {\n            name: \"reactNamespace\",\n            type: \"string\",\n            affectsEmit: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit\n        },\n        {\n            name: \"skipDefaultLibCheck\",\n            type: \"boolean\",\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files\n        },\n        {\n            name: \"charset\",\n            type: \"string\",\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.The_character_set_of_the_input_files\n        },\n        {\n            name: \"emitBOM\",\n            type: \"boolean\",\n            affectsEmit: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files\n        },\n        {\n            name: \"newLine\",\n            type: new ts.Map(ts.getEntries({\n                crlf: 0 /* CarriageReturnLineFeed */,\n                lf: 1 /* LineFeed */\n            })),\n            affectsEmit: true,\n            paramType: ts.Diagnostics.NEWLINE,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix,\n        },\n        {\n            name: \"noErrorTruncation\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Do_not_truncate_error_messages\n        },\n        {\n            name: \"noLib\",\n            type: \"boolean\",\n            affectsModuleResolution: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Do_not_include_the_default_library_file_lib_d_ts,\n            // We are not returning a sourceFile for lib file when asked by the program,\n            // so pass --noLib to avoid reporting a file not found error.\n            transpileOptionValue: true\n        },\n        {\n            name: \"noResolve\",\n            type: \"boolean\",\n            affectsModuleResolution: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files,\n            // We are not doing a full typecheck, we are not resolving the whole context,\n            // so pass --noResolve to avoid reporting missing file errors.\n            transpileOptionValue: true\n        },\n        {\n            name: \"stripInternal\",\n            type: \"boolean\",\n            affectsEmit: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation,\n        },\n        {\n            name: \"disableSizeLimit\",\n            type: \"boolean\",\n            affectsSourceFile: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Disable_size_limitations_on_JavaScript_projects\n        },\n        {\n            name: \"disableSourceOfProjectReferenceRedirect\",\n            type: \"boolean\",\n            isTSConfigOnly: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects\n        },\n        {\n            name: \"disableSolutionSearching\",\n            type: \"boolean\",\n            isTSConfigOnly: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Disable_solution_searching_for_this_project\n        },\n        {\n            name: \"disableReferencedProjectLoad\",\n            type: \"boolean\",\n            isTSConfigOnly: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Disable_loading_referenced_projects\n        },\n        {\n            name: \"noImplicitUseStrict\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Do_not_emit_use_strict_directives_in_module_output\n        },\n        {\n            name: \"noEmitHelpers\",\n            type: \"boolean\",\n            affectsEmit: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Do_not_generate_custom_helper_functions_like_extends_in_compiled_output\n        },\n        {\n            name: \"noEmitOnError\",\n            type: \"boolean\",\n            affectsEmit: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported,\n            transpileOptionValue: undefined\n        },\n        {\n            name: \"preserveConstEnums\",\n            type: \"boolean\",\n            affectsEmit: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code\n        },\n        {\n            name: \"declarationDir\",\n            type: \"string\",\n            affectsEmit: true,\n            isFilePath: true,\n            paramType: ts.Diagnostics.DIRECTORY,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Output_directory_for_generated_declaration_files,\n            transpileOptionValue: undefined\n        },\n        {\n            name: \"skipLibCheck\",\n            type: \"boolean\",\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Skip_type_checking_of_declaration_files,\n        },\n        {\n            name: \"allowUnusedLabels\",\n            type: \"boolean\",\n            affectsBindDiagnostics: true,\n            affectsSemanticDiagnostics: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Do_not_report_errors_on_unused_labels\n        },\n        {\n            name: \"allowUnreachableCode\",\n            type: \"boolean\",\n            affectsBindDiagnostics: true,\n            affectsSemanticDiagnostics: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Do_not_report_errors_on_unreachable_code\n        },\n        {\n            name: \"suppressExcessPropertyErrors\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Suppress_excess_property_checks_for_object_literals,\n        },\n        {\n            name: \"suppressImplicitAnyIndexErrors\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures,\n        },\n        {\n            name: \"forceConsistentCasingInFileNames\",\n            type: \"boolean\",\n            affectsModuleResolution: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file\n        },\n        {\n            name: \"maxNodeModuleJsDepth\",\n            type: \"number\",\n            affectsModuleResolution: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files\n        },\n        {\n            name: \"noStrictGenericChecks\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,\n        },\n        {\n            name: \"useDefineForClassFields\",\n            type: \"boolean\",\n            affectsSemanticDiagnostics: true,\n            affectsEmit: true,\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Emit_class_fields_with_Define_instead_of_Set,\n        },\n        {\n            name: \"keyofStringsOnly\",\n            type: \"boolean\",\n            category: ts.Diagnostics.Advanced_Options,\n            description: ts.Diagnostics.Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols,\n        },\n        {\n            // A list of plugins to load in the language service\n            name: \"plugins\",\n            type: \"list\",\n            isTSConfigOnly: true,\n            element: {\n                name: \"plugin\",\n                type: \"object\"\n            },\n            description: ts.Diagnostics.List_of_language_service_plugins\n        },\n    ]);\n    /* @internal */\n    ts.semanticDiagnosticsOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsSemanticDiagnostics; });\n    /* @internal */\n    ts.affectsEmitOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsEmit; });\n    /* @internal */\n    ts.moduleResolutionOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsModuleResolution; });\n    /* @internal */\n    ts.sourceFileAffectingCompilerOptions = ts.optionDeclarations.filter(function (option) {\n        return !!option.affectsSourceFile || !!option.affectsModuleResolution || !!option.affectsBindDiagnostics;\n    });\n    /* @internal */\n    ts.transpileOptionValueCompilerOptions = ts.optionDeclarations.filter(function (option) {\n        return ts.hasProperty(option, \"transpileOptionValue\");\n    });\n    /* @internal */\n    ts.buildOpts = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild), [\n        {\n            name: \"verbose\",\n            shortName: \"v\",\n            category: ts.Diagnostics.Command_line_Options,\n            description: ts.Diagnostics.Enable_verbose_logging,\n            type: \"boolean\"\n        },\n        {\n            name: \"dry\",\n            shortName: \"d\",\n            category: ts.Diagnostics.Command_line_Options,\n            description: ts.Diagnostics.Show_what_would_be_built_or_deleted_if_specified_with_clean,\n            type: \"boolean\"\n        },\n        {\n            name: \"force\",\n            shortName: \"f\",\n            category: ts.Diagnostics.Command_line_Options,\n            description: ts.Diagnostics.Build_all_projects_including_those_that_appear_to_be_up_to_date,\n            type: \"boolean\"\n        },\n        {\n            name: \"clean\",\n            category: ts.Diagnostics.Command_line_Options,\n            description: ts.Diagnostics.Delete_the_outputs_of_all_projects,\n            type: \"boolean\"\n        }\n    ]);\n    /* @internal */\n    ts.typeAcquisitionDeclarations = [\n        {\n            /* @deprecated typingOptions.enableAutoDiscovery\n             * Use typeAcquisition.enable instead.\n             */\n            name: \"enableAutoDiscovery\",\n            type: \"boolean\",\n        },\n        {\n            name: \"enable\",\n            type: \"boolean\",\n        },\n        {\n            name: \"include\",\n            type: \"list\",\n            element: {\n                name: \"include\",\n                type: \"string\"\n            }\n        },\n        {\n            name: \"exclude\",\n            type: \"list\",\n            element: {\n                name: \"exclude\",\n                type: \"string\"\n            }\n        },\n        {\n            name: \"disableFilenameBasedTypeAcquisition\",\n            type: \"boolean\",\n        },\n    ];\n    /*@internal*/\n    function createOptionNameMap(optionDeclarations) {\n        var optionsNameMap = new ts.Map();\n        var shortOptionNames = new ts.Map();\n        ts.forEach(optionDeclarations, function (option) {\n            optionsNameMap.set(option.name.toLowerCase(), option);\n            if (option.shortName) {\n                shortOptionNames.set(option.shortName, option.name);\n            }\n        });\n        return { optionsNameMap: optionsNameMap, shortOptionNames: shortOptionNames };\n    }\n    ts.createOptionNameMap = createOptionNameMap;\n    var optionsNameMapCache;\n    /* @internal */\n    function getOptionsNameMap() {\n        return optionsNameMapCache || (optionsNameMapCache = createOptionNameMap(ts.optionDeclarations));\n    }\n    ts.getOptionsNameMap = getOptionsNameMap;\n    /* @internal */\n    ts.defaultInitCompilerOptions = {\n        module: ts.ModuleKind.CommonJS,\n        target: 1 /* ES5 */,\n        strict: true,\n        esModuleInterop: true,\n        forceConsistentCasingInFileNames: true,\n        skipLibCheck: true\n    };\n    /* @internal */\n    function convertEnableAutoDiscoveryToEnable(typeAcquisition) {\n        // Convert deprecated typingOptions.enableAutoDiscovery to typeAcquisition.enable\n        if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== undefined && typeAcquisition.enable === undefined) {\n            return {\n                enable: typeAcquisition.enableAutoDiscovery,\n                include: typeAcquisition.include || [],\n                exclude: typeAcquisition.exclude || []\n            };\n        }\n        return typeAcquisition;\n    }\n    ts.convertEnableAutoDiscoveryToEnable = convertEnableAutoDiscoveryToEnable;\n    /* @internal */\n    function createCompilerDiagnosticForInvalidCustomType(opt) {\n        return createDiagnosticForInvalidCustomType(opt, ts.createCompilerDiagnostic);\n    }\n    ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;\n    function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {\n        var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return \"'\" + key + \"'\"; }).join(\", \");\n        return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, \"--\" + opt.name, namesOfType);\n    }\n    /* @internal */\n    function parseCustomTypeOption(opt, value, errors) {\n        return convertJsonOptionOfCustomType(opt, trimString(value || \"\"), errors);\n    }\n    ts.parseCustomTypeOption = parseCustomTypeOption;\n    /* @internal */\n    function parseListTypeOption(opt, value, errors) {\n        if (value === void 0) { value = \"\"; }\n        value = trimString(value);\n        if (ts.startsWith(value, \"-\")) {\n            return undefined;\n        }\n        if (value === \"\") {\n            return [];\n        }\n        var values = value.split(\",\");\n        switch (opt.element.type) {\n            case \"number\":\n                return ts.mapDefined(values, function (v) { return validateJsonOptionValue(opt.element, parseInt(v), errors); });\n            case \"string\":\n                return ts.mapDefined(values, function (v) { return validateJsonOptionValue(opt.element, v || \"\", errors); });\n            default:\n                return ts.mapDefined(values, function (v) { return parseCustomTypeOption(opt.element, v, errors); });\n        }\n    }\n    ts.parseListTypeOption = parseListTypeOption;\n    function getOptionName(option) {\n        return option.name;\n    }\n    function createUnknownOptionError(unknownOption, diagnostics, createDiagnostics, unknownOptionErrorText) {\n        var possibleOption = ts.getSpellingSuggestion(unknownOption, diagnostics.optionDeclarations, getOptionName);\n        return possibleOption ?\n            createDiagnostics(diagnostics.unknownDidYouMeanDiagnostic, unknownOptionErrorText || unknownOption, possibleOption.name) :\n            createDiagnostics(diagnostics.unknownOptionDiagnostic, unknownOptionErrorText || unknownOption);\n    }\n    /*@internal*/\n    function parseCommandLineWorker(diagnostics, commandLine, readFile) {\n        var options = {};\n        var watchOptions;\n        var fileNames = [];\n        var errors = [];\n        parseStrings(commandLine);\n        return {\n            options: options,\n            watchOptions: watchOptions,\n            fileNames: fileNames,\n            errors: errors\n        };\n        function parseStrings(args) {\n            var i = 0;\n            while (i < args.length) {\n                var s = args[i];\n                i++;\n                if (s.charCodeAt(0) === 64 /* at */) {\n                    parseResponseFile(s.slice(1));\n                }\n                else if (s.charCodeAt(0) === 45 /* minus */) {\n                    var inputOptionName = s.slice(s.charCodeAt(1) === 45 /* minus */ ? 2 : 1);\n                    var opt = getOptionDeclarationFromName(diagnostics.getOptionsNameMap, inputOptionName, /*allowShort*/ true);\n                    if (opt) {\n                        i = parseOptionValue(args, i, diagnostics, opt, options, errors);\n                    }\n                    else {\n                        var watchOpt = getOptionDeclarationFromName(watchOptionsDidYouMeanDiagnostics.getOptionsNameMap, inputOptionName, /*allowShort*/ true);\n                        if (watchOpt) {\n                            i = parseOptionValue(args, i, watchOptionsDidYouMeanDiagnostics, watchOpt, watchOptions || (watchOptions = {}), errors);\n                        }\n                        else {\n                            errors.push(createUnknownOptionError(inputOptionName, diagnostics, ts.createCompilerDiagnostic, s));\n                        }\n                    }\n                }\n                else {\n                    fileNames.push(s);\n                }\n            }\n        }\n        function parseResponseFile(fileName) {\n            var text = tryReadFile(fileName, readFile || (function (fileName) { return ts.sys.readFile(fileName); }));\n            if (!ts.isString(text)) {\n                errors.push(text);\n                return;\n            }\n            var args = [];\n            var pos = 0;\n            while (true) {\n                while (pos < text.length && text.charCodeAt(pos) <= 32 /* space */)\n                    pos++;\n                if (pos >= text.length)\n                    break;\n                var start = pos;\n                if (text.charCodeAt(start) === 34 /* doubleQuote */) {\n                    pos++;\n                    while (pos < text.length && text.charCodeAt(pos) !== 34 /* doubleQuote */)\n                        pos++;\n                    if (pos < text.length) {\n                        args.push(text.substring(start + 1, pos));\n                        pos++;\n                    }\n                    else {\n                        errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unterminated_quoted_string_in_response_file_0, fileName));\n                    }\n                }\n                else {\n                    while (text.charCodeAt(pos) > 32 /* space */)\n                        pos++;\n                    args.push(text.substring(start, pos));\n                }\n            }\n            parseStrings(args);\n        }\n    }\n    ts.parseCommandLineWorker = parseCommandLineWorker;\n    function parseOptionValue(args, i, diagnostics, opt, options, errors) {\n        if (opt.isTSConfigOnly) {\n            var optValue = args[i];\n            if (optValue === \"null\") {\n                options[opt.name] = undefined;\n                i++;\n            }\n            else if (opt.type === \"boolean\") {\n                if (optValue === \"false\") {\n                    options[opt.name] = validateJsonOptionValue(opt, /*value*/ false, errors);\n                    i++;\n                }\n                else {\n                    if (optValue === \"true\")\n                        i++;\n                    errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line, opt.name));\n                }\n            }\n            else {\n                errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line, opt.name));\n                if (optValue && !ts.startsWith(optValue, \"-\"))\n                    i++;\n            }\n        }\n        else {\n            // Check to see if no argument was provided (e.g. \"--locale\" is the last command-line argument).\n            if (!args[i] && opt.type !== \"boolean\") {\n                errors.push(ts.createCompilerDiagnostic(diagnostics.optionTypeMismatchDiagnostic, opt.name, getCompilerOptionValueTypeString(opt)));\n            }\n            if (args[i] !== \"null\") {\n                switch (opt.type) {\n                    case \"number\":\n                        options[opt.name] = validateJsonOptionValue(opt, parseInt(args[i]), errors);\n                        i++;\n                        break;\n                    case \"boolean\":\n                        // boolean flag has optional value true, false, others\n                        var optValue = args[i];\n                        options[opt.name] = validateJsonOptionValue(opt, optValue !== \"false\", errors);\n                        // consume next argument as boolean flag value\n                        if (optValue === \"false\" || optValue === \"true\") {\n                            i++;\n                        }\n                        break;\n                    case \"string\":\n                        options[opt.name] = validateJsonOptionValue(opt, args[i] || \"\", errors);\n                        i++;\n                        break;\n                    case \"list\":\n                        var result = parseListTypeOption(opt, args[i], errors);\n                        options[opt.name] = result || [];\n                        if (result) {\n                            i++;\n                        }\n                        break;\n                    // If not a primitive, the possible types are specified in what is effectively a map of options.\n                    default:\n                        options[opt.name] = parseCustomTypeOption(opt, args[i], errors);\n                        i++;\n                        break;\n                }\n            }\n            else {\n                options[opt.name] = undefined;\n                i++;\n            }\n        }\n        return i;\n    }\n    /*@internal*/\n    ts.compilerOptionsDidYouMeanDiagnostics = {\n        getOptionsNameMap: getOptionsNameMap,\n        optionDeclarations: ts.optionDeclarations,\n        unknownOptionDiagnostic: ts.Diagnostics.Unknown_compiler_option_0,\n        unknownDidYouMeanDiagnostic: ts.Diagnostics.Unknown_compiler_option_0_Did_you_mean_1,\n        optionTypeMismatchDiagnostic: ts.Diagnostics.Compiler_option_0_expects_an_argument\n    };\n    function parseCommandLine(commandLine, readFile) {\n        return parseCommandLineWorker(ts.compilerOptionsDidYouMeanDiagnostics, commandLine, readFile);\n    }\n    ts.parseCommandLine = parseCommandLine;\n    /** @internal */\n    function getOptionFromName(optionName, allowShort) {\n        return getOptionDeclarationFromName(getOptionsNameMap, optionName, allowShort);\n    }\n    ts.getOptionFromName = getOptionFromName;\n    function getOptionDeclarationFromName(getOptionNameMap, optionName, allowShort) {\n        if (allowShort === void 0) { allowShort = false; }\n        optionName = optionName.toLowerCase();\n        var _a = getOptionNameMap(), optionsNameMap = _a.optionsNameMap, shortOptionNames = _a.shortOptionNames;\n        // Try to translate short option names to their full equivalents.\n        if (allowShort) {\n            var short = shortOptionNames.get(optionName);\n            if (short !== undefined) {\n                optionName = short;\n            }\n        }\n        return optionsNameMap.get(optionName);\n    }\n    var buildOptionsNameMapCache;\n    function getBuildOptionsNameMap() {\n        return buildOptionsNameMapCache || (buildOptionsNameMapCache = createOptionNameMap(ts.buildOpts));\n    }\n    var buildOptionsDidYouMeanDiagnostics = {\n        getOptionsNameMap: getBuildOptionsNameMap,\n        optionDeclarations: ts.buildOpts,\n        unknownOptionDiagnostic: ts.Diagnostics.Unknown_build_option_0,\n        unknownDidYouMeanDiagnostic: ts.Diagnostics.Unknown_build_option_0_Did_you_mean_1,\n        optionTypeMismatchDiagnostic: ts.Diagnostics.Build_option_0_requires_a_value_of_type_1\n    };\n    /*@internal*/\n    function parseBuildCommand(args) {\n        var _a = parseCommandLineWorker(buildOptionsDidYouMeanDiagnostics, args), options = _a.options, watchOptions = _a.watchOptions, projects = _a.fileNames, errors = _a.errors;\n        var buildOptions = options;\n        if (projects.length === 0) {\n            // tsc -b invoked with no extra arguments; act as if invoked with \"tsc -b .\"\n            projects.push(\".\");\n        }\n        // Nonsensical combinations\n        if (buildOptions.clean && buildOptions.force) {\n            errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Options_0_and_1_cannot_be_combined, \"clean\", \"force\"));\n        }\n        if (buildOptions.clean && buildOptions.verbose) {\n            errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Options_0_and_1_cannot_be_combined, \"clean\", \"verbose\"));\n        }\n        if (buildOptions.clean && buildOptions.watch) {\n            errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Options_0_and_1_cannot_be_combined, \"clean\", \"watch\"));\n        }\n        if (buildOptions.watch && buildOptions.dry) {\n            errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Options_0_and_1_cannot_be_combined, \"watch\", \"dry\"));\n        }\n        return { buildOptions: buildOptions, watchOptions: watchOptions, projects: projects, errors: errors };\n    }\n    ts.parseBuildCommand = parseBuildCommand;\n    /* @internal */\n    function getDiagnosticText(_message) {\n        var _args = [];\n        for (var _i = 1; _i < arguments.length; _i++) {\n            _args[_i - 1] = arguments[_i];\n        }\n        var diagnostic = ts.createCompilerDiagnostic.apply(undefined, arguments);\n        return diagnostic.messageText;\n    }\n    ts.getDiagnosticText = getDiagnosticText;\n    /**\n     * Reads the config file, reports errors if any and exits if the config file cannot be found\n     */\n    function getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, extendedConfigCache, watchOptionsToExtend, extraFileExtensions) {\n        var configFileText = tryReadFile(configFileName, function (fileName) { return host.readFile(fileName); });\n        if (!ts.isString(configFileText)) {\n            host.onUnRecoverableConfigFileDiagnostic(configFileText);\n            return undefined;\n        }\n        var result = ts.parseJsonText(configFileName, configFileText);\n        var cwd = host.getCurrentDirectory();\n        result.path = ts.toPath(configFileName, cwd, ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames));\n        result.resolvedPath = result.path;\n        result.originalFileName = result.fileName;\n        return parseJsonSourceFileConfigFileContent(result, host, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), cwd), optionsToExtend, ts.getNormalizedAbsolutePath(configFileName, cwd), \n        /*resolutionStack*/ undefined, extraFileExtensions, extendedConfigCache, watchOptionsToExtend);\n    }\n    ts.getParsedCommandLineOfConfigFile = getParsedCommandLineOfConfigFile;\n    /**\n     * Read tsconfig.json file\n     * @param fileName The path to the config file\n     */\n    function readConfigFile(fileName, readFile) {\n        var textOrDiagnostic = tryReadFile(fileName, readFile);\n        return ts.isString(textOrDiagnostic) ? parseConfigFileTextToJson(fileName, textOrDiagnostic) : { config: {}, error: textOrDiagnostic };\n    }\n    ts.readConfigFile = readConfigFile;\n    /**\n     * Parse the text of the tsconfig.json file\n     * @param fileName The path to the config file\n     * @param jsonText The text of the config file\n     */\n    function parseConfigFileTextToJson(fileName, jsonText) {\n        var jsonSourceFile = ts.parseJsonText(fileName, jsonText);\n        return {\n            config: convertToObject(jsonSourceFile, jsonSourceFile.parseDiagnostics),\n            error: jsonSourceFile.parseDiagnostics.length ? jsonSourceFile.parseDiagnostics[0] : undefined\n        };\n    }\n    ts.parseConfigFileTextToJson = parseConfigFileTextToJson;\n    /**\n     * Read tsconfig.json file\n     * @param fileName The path to the config file\n     */\n    function readJsonConfigFile(fileName, readFile) {\n        var textOrDiagnostic = tryReadFile(fileName, readFile);\n        return ts.isString(textOrDiagnostic) ? ts.parseJsonText(fileName, textOrDiagnostic) : { fileName: fileName, parseDiagnostics: [textOrDiagnostic] };\n    }\n    ts.readJsonConfigFile = readJsonConfigFile;\n    /*@internal*/\n    function tryReadFile(fileName, readFile) {\n        var text;\n        try {\n            text = readFile(fileName);\n        }\n        catch (e) {\n            return ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message);\n        }\n        return text === undefined ? ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0, fileName) : text;\n    }\n    ts.tryReadFile = tryReadFile;\n    function commandLineOptionsToMap(options) {\n        return ts.arrayToMap(options, getOptionName);\n    }\n    var typeAcquisitionDidYouMeanDiagnostics = {\n        optionDeclarations: ts.typeAcquisitionDeclarations,\n        unknownOptionDiagnostic: ts.Diagnostics.Unknown_type_acquisition_option_0,\n        unknownDidYouMeanDiagnostic: ts.Diagnostics.Unknown_type_acquisition_option_0_Did_you_mean_1,\n    };\n    var watchOptionsNameMapCache;\n    function getWatchOptionsNameMap() {\n        return watchOptionsNameMapCache || (watchOptionsNameMapCache = createOptionNameMap(ts.optionsForWatch));\n    }\n    var watchOptionsDidYouMeanDiagnostics = {\n        getOptionsNameMap: getWatchOptionsNameMap,\n        optionDeclarations: ts.optionsForWatch,\n        unknownOptionDiagnostic: ts.Diagnostics.Unknown_watch_option_0,\n        unknownDidYouMeanDiagnostic: ts.Diagnostics.Unknown_watch_option_0_Did_you_mean_1,\n        optionTypeMismatchDiagnostic: ts.Diagnostics.Watch_option_0_requires_a_value_of_type_1\n    };\n    var commandLineCompilerOptionsMapCache;\n    function getCommandLineCompilerOptionsMap() {\n        return commandLineCompilerOptionsMapCache || (commandLineCompilerOptionsMapCache = commandLineOptionsToMap(ts.optionDeclarations));\n    }\n    var commandLineWatchOptionsMapCache;\n    function getCommandLineWatchOptionsMap() {\n        return commandLineWatchOptionsMapCache || (commandLineWatchOptionsMapCache = commandLineOptionsToMap(ts.optionsForWatch));\n    }\n    var commandLineTypeAcquisitionMapCache;\n    function getCommandLineTypeAcquisitionMap() {\n        return commandLineTypeAcquisitionMapCache || (commandLineTypeAcquisitionMapCache = commandLineOptionsToMap(ts.typeAcquisitionDeclarations));\n    }\n    var _tsconfigRootOptions;\n    function getTsconfigRootOptionsMap() {\n        if (_tsconfigRootOptions === undefined) {\n            _tsconfigRootOptions = {\n                name: undefined,\n                type: \"object\",\n                elementOptions: commandLineOptionsToMap([\n                    {\n                        name: \"compilerOptions\",\n                        type: \"object\",\n                        elementOptions: getCommandLineCompilerOptionsMap(),\n                        extraKeyDiagnostics: ts.compilerOptionsDidYouMeanDiagnostics,\n                    },\n                    {\n                        name: \"watchOptions\",\n                        type: \"object\",\n                        elementOptions: getCommandLineWatchOptionsMap(),\n                        extraKeyDiagnostics: watchOptionsDidYouMeanDiagnostics,\n                    },\n                    {\n                        name: \"typingOptions\",\n                        type: \"object\",\n                        elementOptions: getCommandLineTypeAcquisitionMap(),\n                        extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics,\n                    },\n                    {\n                        name: \"typeAcquisition\",\n                        type: \"object\",\n                        elementOptions: getCommandLineTypeAcquisitionMap(),\n                        extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics\n                    },\n                    {\n                        name: \"extends\",\n                        type: \"string\"\n                    },\n                    {\n                        name: \"references\",\n                        type: \"list\",\n                        element: {\n                            name: \"references\",\n                            type: \"object\"\n                        }\n                    },\n                    {\n                        name: \"files\",\n                        type: \"list\",\n                        element: {\n                            name: \"files\",\n                            type: \"string\"\n                        }\n                    },\n                    {\n                        name: \"include\",\n                        type: \"list\",\n                        element: {\n                            name: \"include\",\n                            type: \"string\"\n                        }\n                    },\n                    {\n                        name: \"exclude\",\n                        type: \"list\",\n                        element: {\n                            name: \"exclude\",\n                            type: \"string\"\n                        }\n                    },\n                    ts.compileOnSaveCommandLineOption\n                ])\n            };\n        }\n        return _tsconfigRootOptions;\n    }\n    /**\n     * Convert the json syntax tree into the json value\n     */\n    function convertToObject(sourceFile, errors) {\n        return convertToObjectWorker(sourceFile, errors, /*returnValue*/ true, /*knownRootOptions*/ undefined, /*jsonConversionNotifier*/ undefined);\n    }\n    ts.convertToObject = convertToObject;\n    /**\n     * Convert the json syntax tree into the json value and report errors\n     * This returns the json value (apart from checking errors) only if returnValue provided is true.\n     * Otherwise it just checks the errors and returns undefined\n     */\n    /*@internal*/\n    function convertToObjectWorker(sourceFile, errors, returnValue, knownRootOptions, jsonConversionNotifier) {\n        if (!sourceFile.statements.length) {\n            return returnValue ? {} : undefined;\n        }\n        return convertPropertyValueToJson(sourceFile.statements[0].expression, knownRootOptions);\n        function isRootOptionMap(knownOptions) {\n            return knownRootOptions && knownRootOptions.elementOptions === knownOptions;\n        }\n        function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) {\n            var result = returnValue ? {} : undefined;\n            var _loop_4 = function (element) {\n                if (element.kind !== 288 /* PropertyAssignment */) {\n                    errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected));\n                    return \"continue\";\n                }\n                if (element.questionToken) {\n                    errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element.questionToken, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, \"?\"));\n                }\n                if (!isDoubleQuotedString(element.name)) {\n                    errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element.name, ts.Diagnostics.String_literal_with_double_quotes_expected));\n                }\n                var textOfKey = ts.isComputedNonLiteralName(element.name) ? undefined : ts.getTextOfPropertyName(element.name);\n                var keyText = textOfKey && ts.unescapeLeadingUnderscores(textOfKey);\n                var option = keyText && knownOptions ? knownOptions.get(keyText) : undefined;\n                if (keyText && extraKeyDiagnostics && !option) {\n                    if (knownOptions) {\n                        errors.push(createUnknownOptionError(keyText, extraKeyDiagnostics, function (message, arg0, arg1) { return ts.createDiagnosticForNodeInSourceFile(sourceFile, element.name, message, arg0, arg1); }));\n                    }\n                    else {\n                        errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element.name, extraKeyDiagnostics.unknownOptionDiagnostic, keyText));\n                    }\n                }\n                var value = convertPropertyValueToJson(element.initializer, option);\n                if (typeof keyText !== \"undefined\") {\n                    if (returnValue) {\n                        result[keyText] = value;\n                    }\n                    // Notify key value set, if user asked for it\n                    if (jsonConversionNotifier &&\n                        // Current callbacks are only on known parent option or if we are setting values in the root\n                        (parentOption || isRootOptionMap(knownOptions))) {\n                        var isValidOptionValue = isCompilerOptionsValue(option, value);\n                        if (parentOption) {\n                            if (isValidOptionValue) {\n                                // Notify option set in the parent if its a valid option value\n                                jsonConversionNotifier.onSetValidOptionKeyValueInParent(parentOption, option, value);\n                            }\n                        }\n                        else if (isRootOptionMap(knownOptions)) {\n                            if (isValidOptionValue) {\n                                // Notify about the valid root key value being set\n                                jsonConversionNotifier.onSetValidOptionKeyValueInRoot(keyText, element.name, value, element.initializer);\n                            }\n                            else if (!option) {\n                                // Notify about the unknown root key value being set\n                                jsonConversionNotifier.onSetUnknownOptionKeyValueInRoot(keyText, element.name, value, element.initializer);\n                            }\n                        }\n                    }\n                }\n            };\n            for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {\n                var element = _a[_i];\n                _loop_4(element);\n            }\n            return result;\n        }\n        function convertArrayLiteralExpressionToJson(elements, elementOption) {\n            if (!returnValue) {\n                elements.forEach(function (element) { return convertPropertyValueToJson(element, elementOption); });\n                return undefined;\n            }\n            // Filter out invalid values\n            return ts.filter(elements.map(function (element) { return convertPropertyValueToJson(element, elementOption); }), function (v) { return v !== undefined; });\n        }\n        function convertPropertyValueToJson(valueExpression, option) {\n            var invalidReported;\n            switch (valueExpression.kind) {\n                case 109 /* TrueKeyword */:\n                    reportInvalidOptionValue(option && option.type !== \"boolean\");\n                    return validateValue(/*value*/ true);\n                case 94 /* FalseKeyword */:\n                    reportInvalidOptionValue(option && option.type !== \"boolean\");\n                    return validateValue(/*value*/ false);\n                case 103 /* NullKeyword */:\n                    reportInvalidOptionValue(option && option.name === \"extends\"); // \"extends\" is the only option we don't allow null/undefined for\n                    return validateValue(/*value*/ null); // eslint-disable-line no-null/no-null\n                case 10 /* StringLiteral */:\n                    if (!isDoubleQuotedString(valueExpression)) {\n                        errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, ts.Diagnostics.String_literal_with_double_quotes_expected));\n                    }\n                    reportInvalidOptionValue(option && (ts.isString(option.type) && option.type !== \"string\"));\n                    var text = valueExpression.text;\n                    if (option && !ts.isString(option.type)) {\n                        var customOption = option;\n                        // Validate custom option type\n                        if (!customOption.type.has(text.toLowerCase())) {\n                            errors.push(createDiagnosticForInvalidCustomType(customOption, function (message, arg0, arg1) { return ts.createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, message, arg0, arg1); }));\n                            invalidReported = true;\n                        }\n                    }\n                    return validateValue(text);\n                case 8 /* NumericLiteral */:\n                    reportInvalidOptionValue(option && option.type !== \"number\");\n                    return validateValue(Number(valueExpression.text));\n                case 214 /* PrefixUnaryExpression */:\n                    if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) {\n                        break; // not valid JSON syntax\n                    }\n                    reportInvalidOptionValue(option && option.type !== \"number\");\n                    return validateValue(-Number(valueExpression.operand.text));\n                case 200 /* ObjectLiteralExpression */:\n                    reportInvalidOptionValue(option && option.type !== \"object\");\n                    var objectLiteralExpression = valueExpression;\n                    // Currently having element option declaration in the tsconfig with type \"object\"\n                    // determines if it needs onSetValidOptionKeyValueInParent callback or not\n                    // At moment there are only \"compilerOptions\", \"typeAcquisition\" and \"typingOptions\"\n                    // that satifies it and need it to modify options set in them (for normalizing file paths)\n                    // vs what we set in the json\n                    // If need arises, we can modify this interface and callbacks as needed\n                    if (option) {\n                        var _a = option, elementOptions = _a.elementOptions, extraKeyDiagnostics = _a.extraKeyDiagnostics, optionName = _a.name;\n                        return validateValue(convertObjectLiteralExpressionToJson(objectLiteralExpression, elementOptions, extraKeyDiagnostics, optionName));\n                    }\n                    else {\n                        return validateValue(convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, \n                        /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined));\n                    }\n                case 199 /* ArrayLiteralExpression */:\n                    reportInvalidOptionValue(option && option.type !== \"list\");\n                    return validateValue(convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element));\n            }\n            // Not in expected format\n            if (option) {\n                reportInvalidOptionValue(/*isError*/ true);\n            }\n            else {\n                errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, ts.Diagnostics.Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal));\n            }\n            return undefined;\n            function validateValue(value) {\n                var _a;\n                if (!invalidReported) {\n                    var diagnostic = (_a = option === null || option === void 0 ? void 0 : option.extraValidation) === null || _a === void 0 ? void 0 : _a.call(option, value);\n                    if (diagnostic) {\n                        errors.push(ts.createDiagnosticForNodeInSourceFile.apply(void 0, __spreadArray([sourceFile, valueExpression], diagnostic)));\n                        return undefined;\n                    }\n                }\n                return value;\n            }\n            function reportInvalidOptionValue(isError) {\n                if (isError) {\n                    errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, option.name, getCompilerOptionValueTypeString(option)));\n                    invalidReported = true;\n                }\n            }\n        }\n        function isDoubleQuotedString(node) {\n            return ts.isStringLiteral(node) && ts.isStringDoubleQuoted(node, sourceFile);\n        }\n    }\n    ts.convertToObjectWorker = convertToObjectWorker;\n    function getCompilerOptionValueTypeString(option) {\n        return option.type === \"list\" ?\n            \"Array\" :\n            ts.isString(option.type) ? option.type : \"string\";\n    }\n    function isCompilerOptionsValue(option, value) {\n        if (option) {\n            if (isNullOrUndefined(value))\n                return true; // All options are undefinable/nullable\n            if (option.type === \"list\") {\n                return ts.isArray(value);\n            }\n            var expectedType = ts.isString(option.type) ? option.type : \"string\";\n            return typeof value === expectedType;\n        }\n        return false;\n    }\n    /**\n     * Generate an uncommented, complete tsconfig for use with \"--showConfig\"\n     * @param configParseResult options to be generated into tsconfig.json\n     * @param configFileName name of the parsed config file - output paths will be generated relative to this\n     * @param host provides current directory and case sensitivity services\n     */\n    /** @internal */\n    function convertToTSConfig(configParseResult, configFileName, host) {\n        var _a, _b, _c;\n        var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames);\n        var files = ts.map(ts.filter(configParseResult.fileNames, !((_b = (_a = configParseResult.options.configFile) === null || _a === void 0 ? void 0 : _a.configFileSpecs) === null || _b === void 0 ? void 0 : _b.validatedIncludeSpecs) ? ts.returnTrue : matchesSpecs(configFileName, configParseResult.options.configFile.configFileSpecs.validatedIncludeSpecs, configParseResult.options.configFile.configFileSpecs.validatedExcludeSpecs, host)), function (f) { return ts.getRelativePathFromFile(ts.getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), ts.getNormalizedAbsolutePath(f, host.getCurrentDirectory()), getCanonicalFileName); });\n        var optionMap = serializeCompilerOptions(configParseResult.options, { configFilePath: ts.getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames });\n        var watchOptionMap = configParseResult.watchOptions && serializeWatchOptions(configParseResult.watchOptions);\n        var config = __assign(__assign({ compilerOptions: __assign(__assign({}, optionMapToObject(optionMap)), { showConfig: undefined, configFile: undefined, configFilePath: undefined, help: undefined, init: undefined, listFiles: undefined, listEmittedFiles: undefined, project: undefined, build: undefined, version: undefined }), watchOptions: watchOptionMap && optionMapToObject(watchOptionMap), references: ts.map(configParseResult.projectReferences, function (r) { return (__assign(__assign({}, r), { path: r.originalPath ? r.originalPath : \"\", originalPath: undefined })); }), files: ts.length(files) ? files : undefined }, (((_c = configParseResult.options.configFile) === null || _c === void 0 ? void 0 : _c.configFileSpecs) ? {\n            include: filterSameAsDefaultInclude(configParseResult.options.configFile.configFileSpecs.validatedIncludeSpecs),\n            exclude: configParseResult.options.configFile.configFileSpecs.validatedExcludeSpecs\n        } : {})), { compileOnSave: !!configParseResult.compileOnSave ? true : undefined });\n        return config;\n    }\n    ts.convertToTSConfig = convertToTSConfig;\n    function optionMapToObject(optionMap) {\n        return __assign({}, ts.arrayFrom(optionMap.entries()).reduce(function (prev, cur) {\n            var _a;\n            return (__assign(__assign({}, prev), (_a = {}, _a[cur[0]] = cur[1], _a)));\n        }, {}));\n    }\n    function filterSameAsDefaultInclude(specs) {\n        if (!ts.length(specs))\n            return undefined;\n        if (ts.length(specs) !== 1)\n            return specs;\n        if (specs[0] === \"**/*\")\n            return undefined;\n        return specs;\n    }\n    function matchesSpecs(path, includeSpecs, excludeSpecs, host) {\n        if (!includeSpecs)\n            return ts.returnTrue;\n        var patterns = ts.getFileMatcherPatterns(path, excludeSpecs, includeSpecs, host.useCaseSensitiveFileNames, host.getCurrentDirectory());\n        var excludeRe = patterns.excludePattern && ts.getRegexFromPattern(patterns.excludePattern, host.useCaseSensitiveFileNames);\n        var includeRe = patterns.includeFilePattern && ts.getRegexFromPattern(patterns.includeFilePattern, host.useCaseSensitiveFileNames);\n        if (includeRe) {\n            if (excludeRe) {\n                return function (path) { return !(includeRe.test(path) && !excludeRe.test(path)); };\n            }\n            return function (path) { return !includeRe.test(path); };\n        }\n        if (excludeRe) {\n            return function (path) { return excludeRe.test(path); };\n        }\n        return ts.returnTrue;\n    }\n    function getCustomTypeMapOfCommandLineOption(optionDefinition) {\n        if (optionDefinition.type === \"string\" || optionDefinition.type === \"number\" || optionDefinition.type === \"boolean\" || optionDefinition.type === \"object\") {\n            // this is of a type CommandLineOptionOfPrimitiveType\n            return undefined;\n        }\n        else if (optionDefinition.type === \"list\") {\n            return getCustomTypeMapOfCommandLineOption(optionDefinition.element);\n        }\n        else {\n            return optionDefinition.type;\n        }\n    }\n    function getNameOfCompilerOptionValue(value, customTypeMap) {\n        // There is a typeMap associated with this command-line option so use it to map value back to its name\n        return ts.forEachEntry(customTypeMap, function (mapValue, key) {\n            if (mapValue === value) {\n                return key;\n            }\n        });\n    }\n    function serializeCompilerOptions(options, pathOptions) {\n        return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions);\n    }\n    function serializeWatchOptions(options) {\n        return serializeOptionBaseObject(options, getWatchOptionsNameMap());\n    }\n    function serializeOptionBaseObject(options, _a, pathOptions) {\n        var optionsNameMap = _a.optionsNameMap;\n        var result = new ts.Map();\n        var getCanonicalFileName = pathOptions && ts.createGetCanonicalFileName(pathOptions.useCaseSensitiveFileNames);\n        var _loop_5 = function (name) {\n            if (ts.hasProperty(options, name)) {\n                // tsconfig only options cannot be specified via command line,\n                // so we can assume that only types that can appear here string | number | boolean\n                if (optionsNameMap.has(name) && optionsNameMap.get(name).category === ts.Diagnostics.Command_line_Options) {\n                    return \"continue\";\n                }\n                var value = options[name];\n                var optionDefinition = optionsNameMap.get(name.toLowerCase());\n                if (optionDefinition) {\n                    var customTypeMap_1 = getCustomTypeMapOfCommandLineOption(optionDefinition);\n                    if (!customTypeMap_1) {\n                        // There is no map associated with this compiler option then use the value as-is\n                        // This is the case if the value is expect to be string, number, boolean or list of string\n                        if (pathOptions && optionDefinition.isFilePath) {\n                            result.set(name, ts.getRelativePathFromFile(pathOptions.configFilePath, ts.getNormalizedAbsolutePath(value, ts.getDirectoryPath(pathOptions.configFilePath)), getCanonicalFileName));\n                        }\n                        else {\n                            result.set(name, value);\n                        }\n                    }\n                    else {\n                        if (optionDefinition.type === \"list\") {\n                            result.set(name, value.map(function (element) { return getNameOfCompilerOptionValue(element, customTypeMap_1); })); // TODO: GH#18217\n                        }\n                        else {\n                            // There is a typeMap associated with this command-line option so use it to map value back to its name\n                            result.set(name, getNameOfCompilerOptionValue(value, customTypeMap_1));\n                        }\n                    }\n                }\n            }\n        };\n        for (var name in options) {\n            _loop_5(name);\n        }\n        return result;\n    }\n    /**\n     * Generate tsconfig configuration when running command line \"--init\"\n     * @param options commandlineOptions to be generated into tsconfig.json\n     * @param fileNames array of filenames to be generated into tsconfig.json\n     */\n    /* @internal */\n    function generateTSConfig(options, fileNames, newLine) {\n        var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions);\n        var compilerOptionsMap = serializeCompilerOptions(compilerOptions);\n        return writeConfigurations();\n        function getDefaultValueForOption(option) {\n            switch (option.type) {\n                case \"number\":\n                    return 1;\n                case \"boolean\":\n                    return true;\n                case \"string\":\n                    return option.isFilePath ? \"./\" : \"\";\n                case \"list\":\n                    return [];\n                case \"object\":\n                    return {};\n                default:\n                    var iterResult = option.type.keys().next();\n                    if (!iterResult.done)\n                        return iterResult.value;\n                    return ts.Debug.fail(\"Expected 'option.type' to have entries.\");\n            }\n        }\n        function makePadding(paddingLength) {\n            return Array(paddingLength + 1).join(\" \");\n        }\n        function isAllowedOption(_a) {\n            var category = _a.category, name = _a.name;\n            // Skip options which do not have a category or have category `Command_line_Options`\n            // Exclude all possible `Advanced_Options` in tsconfig.json which were NOT defined in command line\n            return category !== undefined\n                && category !== ts.Diagnostics.Command_line_Options\n                && (category !== ts.Diagnostics.Advanced_Options || compilerOptionsMap.has(name));\n        }\n        function writeConfigurations() {\n            // Filter applicable options to place in the file\n            var categorizedOptions = ts.createMultiMap();\n            for (var _i = 0, optionDeclarations_1 = ts.optionDeclarations; _i < optionDeclarations_1.length; _i++) {\n                var option = optionDeclarations_1[_i];\n                var category = option.category;\n                if (isAllowedOption(option)) {\n                    categorizedOptions.add(ts.getLocaleSpecificMessage(category), option);\n                }\n            }\n            // Serialize all options and their descriptions\n            var marginLength = 0;\n            var seenKnownKeys = 0;\n            var entries = [];\n            categorizedOptions.forEach(function (options, category) {\n                if (entries.length !== 0) {\n                    entries.push({ value: \"\" });\n                }\n                entries.push({ value: \"/* \" + category + \" */\" });\n                for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {\n                    var option = options_1[_i];\n                    var optionName = void 0;\n                    if (compilerOptionsMap.has(option.name)) {\n                        optionName = \"\\\"\" + option.name + \"\\\": \" + JSON.stringify(compilerOptionsMap.get(option.name)) + ((seenKnownKeys += 1) === compilerOptionsMap.size ? \"\" : \",\");\n                    }\n                    else {\n                        optionName = \"// \\\"\" + option.name + \"\\\": \" + JSON.stringify(getDefaultValueForOption(option)) + \",\";\n                    }\n                    entries.push({\n                        value: optionName,\n                        description: \"/* \" + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + \" */\"\n                    });\n                    marginLength = Math.max(optionName.length, marginLength);\n                }\n            });\n            // Write the output\n            var tab = makePadding(2);\n            var result = [];\n            result.push(\"{\");\n            result.push(tab + \"\\\"compilerOptions\\\": {\");\n            result.push(\"\" + tab + tab + \"/* \" + ts.getLocaleSpecificMessage(ts.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file) + \" */\");\n            result.push(\"\");\n            // Print out each row, aligning all the descriptions on the same column.\n            for (var _a = 0, entries_2 = entries; _a < entries_2.length; _a++) {\n                var entry = entries_2[_a];\n                var value = entry.value, _b = entry.description, description = _b === void 0 ? \"\" : _b;\n                result.push(value && \"\" + tab + tab + value + (description && (makePadding(marginLength - value.length + 2) + description)));\n            }\n            if (fileNames.length) {\n                result.push(tab + \"},\");\n                result.push(tab + \"\\\"files\\\": [\");\n                for (var i = 0; i < fileNames.length; i++) {\n                    result.push(\"\" + tab + tab + JSON.stringify(fileNames[i]) + (i === fileNames.length - 1 ? \"\" : \",\"));\n                }\n                result.push(tab + \"]\");\n            }\n            else {\n                result.push(tab + \"}\");\n            }\n            result.push(\"}\");\n            return result.join(newLine) + newLine;\n        }\n    }\n    ts.generateTSConfig = generateTSConfig;\n    /* @internal */\n    function convertToOptionsWithAbsolutePaths(options, toAbsolutePath) {\n        var result = {};\n        var optionsNameMap = getOptionsNameMap().optionsNameMap;\n        for (var name in options) {\n            if (ts.hasProperty(options, name)) {\n                result[name] = convertToOptionValueWithAbsolutePaths(optionsNameMap.get(name.toLowerCase()), options[name], toAbsolutePath);\n            }\n        }\n        if (result.configFilePath) {\n            result.configFilePath = toAbsolutePath(result.configFilePath);\n        }\n        return result;\n    }\n    ts.convertToOptionsWithAbsolutePaths = convertToOptionsWithAbsolutePaths;\n    function convertToOptionValueWithAbsolutePaths(option, value, toAbsolutePath) {\n        if (option && !isNullOrUndefined(value)) {\n            if (option.type === \"list\") {\n                var values = value;\n                if (option.element.isFilePath && values.length) {\n                    return values.map(toAbsolutePath);\n                }\n            }\n            else if (option.isFilePath) {\n                return toAbsolutePath(value);\n            }\n        }\n        return value;\n    }\n    /**\n     * Parse the contents of a config file (tsconfig.json).\n     * @param json The contents of the config file to parse\n     * @param host Instance of ParseConfigHost used to enumerate files in folder.\n     * @param basePath A root directory to resolve relative path entries in the config\n     *    file to. e.g. outDir\n     */\n    function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache, existingWatchOptions) {\n        return parseJsonConfigFileContentWorker(json, /*sourceFile*/ undefined, host, basePath, existingOptions, existingWatchOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache);\n    }\n    ts.parseJsonConfigFileContent = parseJsonConfigFileContent;\n    /**\n     * Parse the contents of a config file (tsconfig.json).\n     * @param jsonNode The contents of the config file to parse\n     * @param host Instance of ParseConfigHost used to enumerate files in folder.\n     * @param basePath A root directory to resolve relative path entries in the config\n     *    file to. e.g. outDir\n     */\n    function parseJsonSourceFileConfigFileContent(sourceFile, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache, existingWatchOptions) {\n        return parseJsonConfigFileContentWorker(/*json*/ undefined, sourceFile, host, basePath, existingOptions, existingWatchOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache);\n    }\n    ts.parseJsonSourceFileConfigFileContent = parseJsonSourceFileConfigFileContent;\n    /*@internal*/\n    function setConfigFileInOptions(options, configFile) {\n        if (configFile) {\n            Object.defineProperty(options, \"configFile\", { enumerable: false, writable: false, value: configFile });\n        }\n    }\n    ts.setConfigFileInOptions = setConfigFileInOptions;\n    function isNullOrUndefined(x) {\n        return x === undefined || x === null; // eslint-disable-line no-null/no-null\n    }\n    function directoryOfCombinedPath(fileName, basePath) {\n        // Use the `getNormalizedAbsolutePath` function to avoid canonicalizing the path, as it must remain noncanonical\n        // until consistent casing errors are reported\n        return ts.getDirectoryPath(ts.getNormalizedAbsolutePath(fileName, basePath));\n    }\n    /**\n     * Parse the contents of a config file from json or json source file (tsconfig.json).\n     * @param json The contents of the config file to parse\n     * @param sourceFile sourceFile corresponding to the Json\n     * @param host Instance of ParseConfigHost used to enumerate files in folder.\n     * @param basePath A root directory to resolve relative path entries in the config\n     *    file to. e.g. outDir\n     * @param resolutionStack Only present for backwards-compatibility. Should be empty.\n     */\n    function parseJsonConfigFileContentWorker(json, sourceFile, host, basePath, existingOptions, existingWatchOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache) {\n        if (existingOptions === void 0) { existingOptions = {}; }\n        if (resolutionStack === void 0) { resolutionStack = []; }\n        if (extraFileExtensions === void 0) { extraFileExtensions = []; }\n        ts.Debug.assert((json === undefined && sourceFile !== undefined) || (json !== undefined && sourceFile === undefined));\n        var errors = [];\n        var parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache);\n        var raw = parsedConfig.raw;\n        var options = ts.extend(existingOptions, parsedConfig.options || {});\n        var watchOptions = existingWatchOptions && parsedConfig.watchOptions ?\n            ts.extend(existingWatchOptions, parsedConfig.watchOptions) :\n            parsedConfig.watchOptions || existingWatchOptions;\n        options.configFilePath = configFileName && ts.normalizeSlashes(configFileName);\n        var configFileSpecs = getConfigFileSpecs();\n        if (sourceFile)\n            sourceFile.configFileSpecs = configFileSpecs;\n        setConfigFileInOptions(options, sourceFile);\n        var basePathForFileNames = ts.normalizePath(configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath);\n        return {\n            options: options,\n            watchOptions: watchOptions,\n            fileNames: getFileNames(basePathForFileNames),\n            projectReferences: getProjectReferences(basePathForFileNames),\n            typeAcquisition: parsedConfig.typeAcquisition || getDefaultTypeAcquisition(),\n            raw: raw,\n            errors: errors,\n            // Wildcard directories (provided as part of a wildcard path) are stored in a\n            // file map that marks whether it was a regular wildcard match (with a `*` or `?` token),\n            // or a recursive directory. This information is used by filesystem watchers to monitor for\n            // new entries in these paths.\n            wildcardDirectories: getWildcardDirectories(configFileSpecs, basePathForFileNames, host.useCaseSensitiveFileNames),\n            compileOnSave: !!raw.compileOnSave,\n        };\n        function getConfigFileSpecs() {\n            var referencesOfRaw = getPropFromRaw(\"references\", function (element) { return typeof element === \"object\"; }, \"object\");\n            var filesSpecs = toPropValue(getSpecsFromRaw(\"files\"));\n            if (filesSpecs) {\n                var hasZeroOrNoReferences = referencesOfRaw === \"no-prop\" || ts.isArray(referencesOfRaw) && referencesOfRaw.length === 0;\n                var hasExtends = ts.hasProperty(raw, \"extends\");\n                if (filesSpecs.length === 0 && hasZeroOrNoReferences && !hasExtends) {\n                    if (sourceFile) {\n                        var fileName = configFileName || \"tsconfig.json\";\n                        var diagnosticMessage = ts.Diagnostics.The_files_list_in_config_file_0_is_empty;\n                        var nodeValue = ts.firstDefined(ts.getTsConfigPropArray(sourceFile, \"files\"), function (property) { return property.initializer; });\n                        var error = nodeValue\n                            ? ts.createDiagnosticForNodeInSourceFile(sourceFile, nodeValue, diagnosticMessage, fileName)\n                            : ts.createCompilerDiagnostic(diagnosticMessage, fileName);\n                        errors.push(error);\n                    }\n                    else {\n                        createCompilerDiagnosticOnlyIfJson(ts.Diagnostics.The_files_list_in_config_file_0_is_empty, configFileName || \"tsconfig.json\");\n                    }\n                }\n            }\n            var includeSpecs = toPropValue(getSpecsFromRaw(\"include\"));\n            var excludeOfRaw = getSpecsFromRaw(\"exclude\");\n            var excludeSpecs = toPropValue(excludeOfRaw);\n            if (excludeOfRaw === \"no-prop\" && raw.compilerOptions) {\n                var outDir = raw.compilerOptions.outDir;\n                var declarationDir = raw.compilerOptions.declarationDir;\n                if (outDir || declarationDir) {\n                    excludeSpecs = [outDir, declarationDir].filter(function (d) { return !!d; });\n                }\n            }\n            if (filesSpecs === undefined && includeSpecs === undefined) {\n                includeSpecs = [\"**/*\"];\n            }\n            var validatedIncludeSpecs, validatedExcludeSpecs;\n            // The exclude spec list is converted into a regular expression, which allows us to quickly\n            // test whether a file or directory should be excluded before recursively traversing the\n            // file system.\n            if (includeSpecs) {\n                validatedIncludeSpecs = validateSpecs(includeSpecs, errors, /*disallowTrailingRecursion*/ true, sourceFile, \"include\");\n            }\n            if (excludeSpecs) {\n                validatedExcludeSpecs = validateSpecs(excludeSpecs, errors, /*disallowTrailingRecursion*/ false, sourceFile, \"exclude\");\n            }\n            return {\n                filesSpecs: filesSpecs,\n                includeSpecs: includeSpecs,\n                excludeSpecs: excludeSpecs,\n                validatedFilesSpec: ts.filter(filesSpecs, ts.isString),\n                validatedIncludeSpecs: validatedIncludeSpecs,\n                validatedExcludeSpecs: validatedExcludeSpecs,\n            };\n        }\n        function getFileNames(basePath) {\n            var fileNames = getFileNamesFromConfigSpecs(configFileSpecs, basePath, options, host, extraFileExtensions);\n            if (shouldReportNoInputFiles(fileNames, canJsonReportNoInputFiles(raw), resolutionStack)) {\n                errors.push(getErrorForNoInputFiles(configFileSpecs, configFileName));\n            }\n            return fileNames;\n        }\n        function getProjectReferences(basePath) {\n            var projectReferences;\n            var referencesOfRaw = getPropFromRaw(\"references\", function (element) { return typeof element === \"object\"; }, \"object\");\n            if (ts.isArray(referencesOfRaw)) {\n                for (var _i = 0, referencesOfRaw_1 = referencesOfRaw; _i < referencesOfRaw_1.length; _i++) {\n                    var ref = referencesOfRaw_1[_i];\n                    if (typeof ref.path !== \"string\") {\n                        createCompilerDiagnosticOnlyIfJson(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, \"reference.path\", \"string\");\n                    }\n                    else {\n                        (projectReferences || (projectReferences = [])).push({\n                            path: ts.getNormalizedAbsolutePath(ref.path, basePath),\n                            originalPath: ref.path,\n                            prepend: ref.prepend,\n                            circular: ref.circular\n                        });\n                    }\n                }\n            }\n            return projectReferences;\n        }\n        function toPropValue(specResult) {\n            return ts.isArray(specResult) ? specResult : undefined;\n        }\n        function getSpecsFromRaw(prop) {\n            return getPropFromRaw(prop, ts.isString, \"string\");\n        }\n        function getPropFromRaw(prop, validateElement, elementTypeName) {\n            if (ts.hasProperty(raw, prop) && !isNullOrUndefined(raw[prop])) {\n                if (ts.isArray(raw[prop])) {\n                    var result = raw[prop];\n                    if (!sourceFile && !ts.every(result, validateElement)) {\n                        errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, prop, elementTypeName));\n                    }\n                    return result;\n                }\n                else {\n                    createCompilerDiagnosticOnlyIfJson(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, prop, \"Array\");\n                    return \"not-array\";\n                }\n            }\n            return \"no-prop\";\n        }\n        function createCompilerDiagnosticOnlyIfJson(message, arg0, arg1) {\n            if (!sourceFile) {\n                errors.push(ts.createCompilerDiagnostic(message, arg0, arg1));\n            }\n        }\n    }\n    function isErrorNoInputFiles(error) {\n        return error.code === ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code;\n    }\n    function getErrorForNoInputFiles(_a, configFileName) {\n        var includeSpecs = _a.includeSpecs, excludeSpecs = _a.excludeSpecs;\n        return ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, configFileName || \"tsconfig.json\", JSON.stringify(includeSpecs || []), JSON.stringify(excludeSpecs || []));\n    }\n    function shouldReportNoInputFiles(fileNames, canJsonReportNoInutFiles, resolutionStack) {\n        return fileNames.length === 0 && canJsonReportNoInutFiles && (!resolutionStack || resolutionStack.length === 0);\n    }\n    /*@internal*/\n    function canJsonReportNoInputFiles(raw) {\n        return !ts.hasProperty(raw, \"files\") && !ts.hasProperty(raw, \"references\");\n    }\n    ts.canJsonReportNoInputFiles = canJsonReportNoInputFiles;\n    /*@internal*/\n    function updateErrorForNoInputFiles(fileNames, configFileName, configFileSpecs, configParseDiagnostics, canJsonReportNoInutFiles) {\n        var existingErrors = configParseDiagnostics.length;\n        if (shouldReportNoInputFiles(fileNames, canJsonReportNoInutFiles)) {\n            configParseDiagnostics.push(getErrorForNoInputFiles(configFileSpecs, configFileName));\n        }\n        else {\n            ts.filterMutate(configParseDiagnostics, function (error) { return !isErrorNoInputFiles(error); });\n        }\n        return existingErrors !== configParseDiagnostics.length;\n    }\n    ts.updateErrorForNoInputFiles = updateErrorForNoInputFiles;\n    function isSuccessfulParsedTsconfig(value) {\n        return !!value.options;\n    }\n    /**\n     * This *just* extracts options/include/exclude/files out of a config file.\n     * It does *not* resolve the included files.\n     */\n    function parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache) {\n        var _a;\n        basePath = ts.normalizeSlashes(basePath);\n        var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || \"\", basePath);\n        if (resolutionStack.indexOf(resolvedPath) >= 0) {\n            errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, __spreadArray(__spreadArray([], resolutionStack), [resolvedPath]).join(\" -> \")));\n            return { raw: json || convertToObject(sourceFile, errors) };\n        }\n        var ownConfig = json ?\n            parseOwnConfigOfJson(json, host, basePath, configFileName, errors) :\n            parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors);\n        if ((_a = ownConfig.options) === null || _a === void 0 ? void 0 : _a.paths) {\n            // If we end up needing to resolve relative paths from 'paths' relative to\n            // the config file location, we'll need to know where that config file was.\n            // Since 'paths' can be inherited from an extended config in another directory,\n            // we wouldn't know which directory to use unless we store it here.\n            ownConfig.options.pathsBasePath = basePath;\n        }\n        if (ownConfig.extendedConfigPath) {\n            // copy the resolution stack so it is never reused between branches in potential diamond-problem scenarios.\n            resolutionStack = resolutionStack.concat([resolvedPath]);\n            var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, resolutionStack, errors, extendedConfigCache);\n            if (extendedConfig && isSuccessfulParsedTsconfig(extendedConfig)) {\n                var baseRaw_1 = extendedConfig.raw;\n                var raw_1 = ownConfig.raw;\n                var relativeDifference_1;\n                var setPropertyInRawIfNotUndefined = function (propertyName) {\n                    if (!raw_1[propertyName] && baseRaw_1[propertyName]) {\n                        raw_1[propertyName] = ts.map(baseRaw_1[propertyName], function (path) { return ts.isRootedDiskPath(path) ? path : ts.combinePaths(relativeDifference_1 || (relativeDifference_1 = ts.convertToRelativePath(ts.getDirectoryPath(ownConfig.extendedConfigPath), basePath, ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames))), path); });\n                    }\n                };\n                setPropertyInRawIfNotUndefined(\"include\");\n                setPropertyInRawIfNotUndefined(\"exclude\");\n                setPropertyInRawIfNotUndefined(\"files\");\n                if (raw_1.compileOnSave === undefined) {\n                    raw_1.compileOnSave = baseRaw_1.compileOnSave;\n                }\n                ownConfig.options = ts.assign({}, extendedConfig.options, ownConfig.options);\n                ownConfig.watchOptions = ownConfig.watchOptions && extendedConfig.watchOptions ?\n                    ts.assign({}, extendedConfig.watchOptions, ownConfig.watchOptions) :\n                    ownConfig.watchOptions || extendedConfig.watchOptions;\n                // TODO extend type typeAcquisition\n            }\n        }\n        return ownConfig;\n    }\n    function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) {\n        if (ts.hasProperty(json, \"excludes\")) {\n            errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude));\n        }\n        var options = convertCompilerOptionsFromJsonWorker(json.compilerOptions, basePath, errors, configFileName);\n        // typingOptions has been deprecated and is only supported for backward compatibility purposes.\n        // It should be removed in future releases - use typeAcquisition instead.\n        var typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition || json.typingOptions, basePath, errors, configFileName);\n        var watchOptions = convertWatchOptionsFromJsonWorker(json.watchOptions, basePath, errors);\n        json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors);\n        var extendedConfigPath;\n        if (json.extends) {\n            if (!ts.isString(json.extends)) {\n                errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, \"extends\", \"string\"));\n            }\n            else {\n                var newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath;\n                extendedConfigPath = getExtendsConfigPath(json.extends, host, newBase, errors, ts.createCompilerDiagnostic);\n            }\n        }\n        return { raw: json, options: options, watchOptions: watchOptions, typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath };\n    }\n    function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors) {\n        var options = getDefaultCompilerOptions(configFileName);\n        var typeAcquisition, typingOptionstypeAcquisition;\n        var watchOptions;\n        var extendedConfigPath;\n        var optionsIterator = {\n            onSetValidOptionKeyValueInParent: function (parentOption, option, value) {\n                var currentOption;\n                switch (parentOption) {\n                    case \"compilerOptions\":\n                        currentOption = options;\n                        break;\n                    case \"watchOptions\":\n                        currentOption = (watchOptions || (watchOptions = {}));\n                        break;\n                    case \"typeAcquisition\":\n                        currentOption = (typeAcquisition || (typeAcquisition = getDefaultTypeAcquisition(configFileName)));\n                        break;\n                    case \"typingOptions\":\n                        currentOption = (typingOptionstypeAcquisition || (typingOptionstypeAcquisition = getDefaultTypeAcquisition(configFileName)));\n                        break;\n                    default:\n                        ts.Debug.fail(\"Unknown option\");\n                }\n                currentOption[option.name] = normalizeOptionValue(option, basePath, value);\n            },\n            onSetValidOptionKeyValueInRoot: function (key, _keyNode, value, valueNode) {\n                switch (key) {\n                    case \"extends\":\n                        var newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath;\n                        extendedConfigPath = getExtendsConfigPath(value, host, newBase, errors, function (message, arg0) {\n                            return ts.createDiagnosticForNodeInSourceFile(sourceFile, valueNode, message, arg0);\n                        });\n                        return;\n                }\n            },\n            onSetUnknownOptionKeyValueInRoot: function (key, keyNode, _value, _valueNode) {\n                if (key === \"excludes\") {\n                    errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, keyNode, ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude));\n                }\n            }\n        };\n        var json = convertToObjectWorker(sourceFile, errors, /*returnValue*/ true, getTsconfigRootOptionsMap(), optionsIterator);\n        if (!typeAcquisition) {\n            if (typingOptionstypeAcquisition) {\n                typeAcquisition = (typingOptionstypeAcquisition.enableAutoDiscovery !== undefined) ?\n                    {\n                        enable: typingOptionstypeAcquisition.enableAutoDiscovery,\n                        include: typingOptionstypeAcquisition.include,\n                        exclude: typingOptionstypeAcquisition.exclude\n                    } :\n                    typingOptionstypeAcquisition;\n            }\n            else {\n                typeAcquisition = getDefaultTypeAcquisition(configFileName);\n            }\n        }\n        return { raw: json, options: options, watchOptions: watchOptions, typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath };\n    }\n    function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiagnostic) {\n        extendedConfig = ts.normalizeSlashes(extendedConfig);\n        if (ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, \"./\") || ts.startsWith(extendedConfig, \"../\")) {\n            var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);\n            if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, \".json\" /* Json */)) {\n                extendedConfigPath = extendedConfigPath + \".json\";\n                if (!host.fileExists(extendedConfigPath)) {\n                    errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));\n                    return undefined;\n                }\n            }\n            return extendedConfigPath;\n        }\n        // If the path isn't a rooted or relative path, resolve like a module\n        var resolved = ts.nodeModuleNameResolver(extendedConfig, ts.combinePaths(basePath, \"tsconfig.json\"), { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, /*cache*/ undefined, /*projectRefs*/ undefined, /*lookupConfig*/ true);\n        if (resolved.resolvedModule) {\n            return resolved.resolvedModule.resolvedFileName;\n        }\n        errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));\n        return undefined;\n    }\n    function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache) {\n        var _a;\n        var path = host.useCaseSensitiveFileNames ? extendedConfigPath : ts.toFileNameLowerCase(extendedConfigPath);\n        var value;\n        var extendedResult;\n        var extendedConfig;\n        if (extendedConfigCache && (value = extendedConfigCache.get(path))) {\n            (extendedResult = value.extendedResult, extendedConfig = value.extendedConfig);\n        }\n        else {\n            extendedResult = readJsonConfigFile(extendedConfigPath, function (path) { return host.readFile(path); });\n            if (!extendedResult.parseDiagnostics.length) {\n                extendedConfig = parseConfig(/*json*/ undefined, extendedResult, host, ts.getDirectoryPath(extendedConfigPath), ts.getBaseFileName(extendedConfigPath), resolutionStack, errors, extendedConfigCache);\n            }\n            if (extendedConfigCache) {\n                extendedConfigCache.set(path, { extendedResult: extendedResult, extendedConfig: extendedConfig });\n            }\n        }\n        if (sourceFile) {\n            sourceFile.extendedSourceFiles = [extendedResult.fileName];\n            if (extendedResult.extendedSourceFiles) {\n                (_a = sourceFile.extendedSourceFiles).push.apply(_a, extendedResult.extendedSourceFiles);\n            }\n        }\n        if (extendedResult.parseDiagnostics.length) {\n            errors.push.apply(errors, extendedResult.parseDiagnostics);\n            return undefined;\n        }\n        return extendedConfig;\n    }\n    function convertCompileOnSaveOptionFromJson(jsonOption, basePath, errors) {\n        if (!ts.hasProperty(jsonOption, ts.compileOnSaveCommandLineOption.name)) {\n            return false;\n        }\n        var result = convertJsonOption(ts.compileOnSaveCommandLineOption, jsonOption.compileOnSave, basePath, errors);\n        return typeof result === \"boolean\" && result;\n    }\n    function convertCompilerOptionsFromJson(jsonOptions, basePath, configFileName) {\n        var errors = [];\n        var options = convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName);\n        return { options: options, errors: errors };\n    }\n    ts.convertCompilerOptionsFromJson = convertCompilerOptionsFromJson;\n    function convertTypeAcquisitionFromJson(jsonOptions, basePath, configFileName) {\n        var errors = [];\n        var options = convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName);\n        return { options: options, errors: errors };\n    }\n    ts.convertTypeAcquisitionFromJson = convertTypeAcquisitionFromJson;\n    function getDefaultCompilerOptions(configFileName) {\n        var options = configFileName && ts.getBaseFileName(configFileName) === \"jsconfig.json\"\n            ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true, noEmit: true }\n            : {};\n        return options;\n    }\n    function convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName) {\n        var options = getDefaultCompilerOptions(configFileName);\n        convertOptionsFromJson(getCommandLineCompilerOptionsMap(), jsonOptions, basePath, options, ts.compilerOptionsDidYouMeanDiagnostics, errors);\n        if (configFileName) {\n            options.configFilePath = ts.normalizeSlashes(configFileName);\n        }\n        return options;\n    }\n    function getDefaultTypeAcquisition(configFileName) {\n        return { enable: !!configFileName && ts.getBaseFileName(configFileName) === \"jsconfig.json\", include: [], exclude: [] };\n    }\n    function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) {\n        var options = getDefaultTypeAcquisition(configFileName);\n        var typeAcquisition = convertEnableAutoDiscoveryToEnable(jsonOptions);\n        convertOptionsFromJson(getCommandLineTypeAcquisitionMap(), typeAcquisition, basePath, options, typeAcquisitionDidYouMeanDiagnostics, errors);\n        return options;\n    }\n    function convertWatchOptionsFromJsonWorker(jsonOptions, basePath, errors) {\n        return convertOptionsFromJson(getCommandLineWatchOptionsMap(), jsonOptions, basePath, /*defaultOptions*/ undefined, watchOptionsDidYouMeanDiagnostics, errors);\n    }\n    function convertOptionsFromJson(optionsNameMap, jsonOptions, basePath, defaultOptions, diagnostics, errors) {\n        if (!jsonOptions) {\n            return;\n        }\n        for (var id in jsonOptions) {\n            var opt = optionsNameMap.get(id);\n            if (opt) {\n                (defaultOptions || (defaultOptions = {}))[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors);\n            }\n            else {\n                errors.push(createUnknownOptionError(id, diagnostics, ts.createCompilerDiagnostic));\n            }\n        }\n        return defaultOptions;\n    }\n    /*@internal*/\n    function convertJsonOption(opt, value, basePath, errors) {\n        if (isCompilerOptionsValue(opt, value)) {\n            var optType = opt.type;\n            if (optType === \"list\" && ts.isArray(value)) {\n                return convertJsonOptionOfListType(opt, value, basePath, errors);\n            }\n            else if (!ts.isString(optType)) {\n                return convertJsonOptionOfCustomType(opt, value, errors);\n            }\n            var validatedValue = validateJsonOptionValue(opt, value, errors);\n            return isNullOrUndefined(validatedValue) ? validatedValue : normalizeNonListOptionValue(opt, basePath, validatedValue);\n        }\n        else {\n            errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, opt.name, getCompilerOptionValueTypeString(opt)));\n        }\n    }\n    ts.convertJsonOption = convertJsonOption;\n    function normalizeOptionValue(option, basePath, value) {\n        if (isNullOrUndefined(value))\n            return undefined;\n        if (option.type === \"list\") {\n            var listOption_1 = option;\n            if (listOption_1.element.isFilePath || !ts.isString(listOption_1.element.type)) {\n                return ts.filter(ts.map(value, function (v) { return normalizeOptionValue(listOption_1.element, basePath, v); }), function (v) { return !!v; });\n            }\n            return value;\n        }\n        else if (!ts.isString(option.type)) {\n            return option.type.get(ts.isString(value) ? value.toLowerCase() : value);\n        }\n        return normalizeNonListOptionValue(option, basePath, value);\n    }\n    function normalizeNonListOptionValue(option, basePath, value) {\n        if (option.isFilePath) {\n            value = ts.getNormalizedAbsolutePath(value, basePath);\n            if (value === \"\") {\n                value = \".\";\n            }\n        }\n        return value;\n    }\n    function validateJsonOptionValue(opt, value, errors) {\n        var _a;\n        if (isNullOrUndefined(value))\n            return undefined;\n        var d = (_a = opt.extraValidation) === null || _a === void 0 ? void 0 : _a.call(opt, value);\n        if (!d)\n            return value;\n        errors.push(ts.createCompilerDiagnostic.apply(void 0, d));\n        return undefined;\n    }\n    function convertJsonOptionOfCustomType(opt, value, errors) {\n        if (isNullOrUndefined(value))\n            return undefined;\n        var key = value.toLowerCase();\n        var val = opt.type.get(key);\n        if (val !== undefined) {\n            return validateJsonOptionValue(opt, val, errors);\n        }\n        else {\n            errors.push(createCompilerDiagnosticForInvalidCustomType(opt));\n        }\n    }\n    function convertJsonOptionOfListType(option, values, basePath, errors) {\n        return ts.filter(ts.map(values, function (v) { return convertJsonOption(option.element, v, basePath, errors); }), function (v) { return !!v; });\n    }\n    function trimString(s) {\n        return typeof s.trim === \"function\" ? s.trim() : s.replace(/^[\\s]+|[\\s]+$/g, \"\");\n    }\n    /**\n     * Tests for a path that ends in a recursive directory wildcard.\n     * Matches **, \\**, **\\, and \\**\\, but not a**b.\n     *\n     * NOTE: used \\ in place of / above to avoid issues with multiline comments.\n     *\n     * Breakdown:\n     *  (^|\\/)      # matches either the beginning of the string or a directory separator.\n     *  \\*\\*        # matches the recursive directory wildcard \"**\".\n     *  \\/?$        # matches an optional trailing directory separator at the end of the string.\n     */\n    var invalidTrailingRecursionPattern = /(^|\\/)\\*\\*\\/?$/;\n    /**\n     * Tests for a path where .. appears after a recursive directory wildcard.\n     * Matches **\\..\\*, **\\a\\..\\*, and **\\.., but not ..\\**\\*\n     *\n     * NOTE: used \\ in place of / above to avoid issues with multiline comments.\n     *\n     * Breakdown:\n     *  (^|\\/)      # matches either the beginning of the string or a directory separator.\n     *  \\*\\*\\/      # matches a recursive directory wildcard \"**\" followed by a directory separator.\n     *  (.*\\/)?     # optionally matches any number of characters followed by a directory separator.\n     *  \\.\\.        # matches a parent directory path component \"..\"\n     *  ($|\\/)      # matches either the end of the string or a directory separator.\n     */\n    var invalidDotDotAfterRecursiveWildcardPattern = /(^|\\/)\\*\\*\\/(.*\\/)?\\.\\.($|\\/)/;\n    /**\n     * Tests for a path containing a wildcard character in a directory component of the path.\n     * Matches \\*\\, \\?\\, and \\a*b\\, but not \\a\\ or \\a\\*.\n     *\n     * NOTE: used \\ in place of / above to avoid issues with multiline comments.\n     *\n     * Breakdown:\n     *  \\/          # matches a directory separator.\n     *  [^/]*?      # matches any number of characters excluding directory separators (non-greedy).\n     *  [*?]        # matches either a wildcard character (* or ?)\n     *  [^/]*       # matches any number of characters excluding directory separators (greedy).\n     *  \\/          # matches a directory separator.\n     */\n    var watchRecursivePattern = /\\/[^/]*?[*?][^/]*\\//;\n    /**\n     * Matches the portion of a wildcard path that does not contain wildcards.\n     * Matches \\a of \\a\\*, or \\a\\b\\c of \\a\\b\\c\\?\\d.\n     *\n     * NOTE: used \\ in place of / above to avoid issues with multiline comments.\n     *\n     * Breakdown:\n     *  ^                   # matches the beginning of the string\n     *  [^*?]*              # matches any number of non-wildcard characters\n     *  (?=\\/[^/]*[*?])     # lookahead that matches a directory separator followed by\n     *                      # a path component that contains at least one wildcard character (* or ?).\n     */\n    var wildcardDirectoryPattern = /^[^*?]*(?=\\/[^/]*[*?])/;\n    /**\n     * Gets the file names from the provided config file specs that contain, files, include, exclude and\n     * other properties needed to resolve the file names\n     * @param configFileSpecs The config file specs extracted with file names to include, wildcards to include/exclude and other details\n     * @param basePath The base path for any relative file specifications.\n     * @param options Compiler options.\n     * @param host The host used to resolve files and directories.\n     * @param extraFileExtensions optionaly file extra file extension information from host\n     */\n    /* @internal */\n    function getFileNamesFromConfigSpecs(configFileSpecs, basePath, options, host, extraFileExtensions) {\n        if (extraFileExtensions === void 0) { extraFileExtensions = ts.emptyArray; }\n        basePath = ts.normalizePath(basePath);\n        var keyMapper = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames);\n        // Literal file names (provided via the \"files\" array in tsconfig.json) are stored in a\n        // file map with a possibly case insensitive key. We use this map later when when including\n        // wildcard paths.\n        var literalFileMap = new ts.Map();\n        // Wildcard paths (provided via the \"includes\" array in tsconfig.json) are stored in a\n        // file map with a possibly case insensitive key. We use this map to store paths matched\n        // via wildcard, and to handle extension priority.\n        var wildcardFileMap = new ts.Map();\n        // Wildcard paths of json files (provided via the \"includes\" array in tsconfig.json) are stored in a\n        // file map with a possibly case insensitive key. We use this map to store paths matched\n        // via wildcard of *.json kind\n        var wildCardJsonFileMap = new ts.Map();\n        var validatedFilesSpec = configFileSpecs.validatedFilesSpec, validatedIncludeSpecs = configFileSpecs.validatedIncludeSpecs, validatedExcludeSpecs = configFileSpecs.validatedExcludeSpecs;\n        // Rather than requery this for each file and filespec, we query the supported extensions\n        // once and store it on the expansion context.\n        var supportedExtensions = ts.getSupportedExtensions(options, extraFileExtensions);\n        var supportedExtensionsWithJsonIfResolveJsonModule = ts.getSuppoertedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions);\n        // Literal files are always included verbatim. An \"include\" or \"exclude\" specification cannot\n        // remove a literal file.\n        if (validatedFilesSpec) {\n            for (var _i = 0, validatedFilesSpec_1 = validatedFilesSpec; _i < validatedFilesSpec_1.length; _i++) {\n                var fileName = validatedFilesSpec_1[_i];\n                var file = ts.getNormalizedAbsolutePath(fileName, basePath);\n                literalFileMap.set(keyMapper(file), file);\n            }\n        }\n        var jsonOnlyIncludeRegexes;\n        if (validatedIncludeSpecs && validatedIncludeSpecs.length > 0) {\n            var _loop_6 = function (file) {\n                if (ts.fileExtensionIs(file, \".json\" /* Json */)) {\n                    // Valid only if *.json specified\n                    if (!jsonOnlyIncludeRegexes) {\n                        var includes = validatedIncludeSpecs.filter(function (s) { return ts.endsWith(s, \".json\" /* Json */); });\n                        var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, \"files\"), function (pattern) { return \"^\" + pattern + \"$\"; });\n                        jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map(function (pattern) { return ts.getRegexFromPattern(pattern, host.useCaseSensitiveFileNames); }) : ts.emptyArray;\n                    }\n                    var includeIndex = ts.findIndex(jsonOnlyIncludeRegexes, function (re) { return re.test(file); });\n                    if (includeIndex !== -1) {\n                        var key_1 = keyMapper(file);\n                        if (!literalFileMap.has(key_1) && !wildCardJsonFileMap.has(key_1)) {\n                            wildCardJsonFileMap.set(key_1, file);\n                        }\n                    }\n                    return \"continue\";\n                }\n                // If we have already included a literal or wildcard path with a\n                // higher priority extension, we should skip this file.\n                //\n                // This handles cases where we may encounter both <file>.ts and\n                // <file>.d.ts (or <file>.js if \"allowJs\" is enabled) in the same\n                // directory when they are compilation outputs.\n                if (hasFileWithHigherPriorityExtension(file, literalFileMap, wildcardFileMap, supportedExtensions, keyMapper)) {\n                    return \"continue\";\n                }\n                // We may have included a wildcard path with a lower priority\n                // extension due to the user-defined order of entries in the\n                // \"include\" array. If there is a lower priority extension in the\n                // same directory, we should remove it.\n                removeWildcardFilesWithLowerPriorityExtension(file, wildcardFileMap, supportedExtensions, keyMapper);\n                var key = keyMapper(file);\n                if (!literalFileMap.has(key) && !wildcardFileMap.has(key)) {\n                    wildcardFileMap.set(key, file);\n                }\n            };\n            for (var _a = 0, _b = host.readDirectory(basePath, supportedExtensionsWithJsonIfResolveJsonModule, validatedExcludeSpecs, validatedIncludeSpecs, /*depth*/ undefined); _a < _b.length; _a++) {\n                var file = _b[_a];\n                _loop_6(file);\n            }\n        }\n        var literalFiles = ts.arrayFrom(literalFileMap.values());\n        var wildcardFiles = ts.arrayFrom(wildcardFileMap.values());\n        return literalFiles.concat(wildcardFiles, ts.arrayFrom(wildCardJsonFileMap.values()));\n    }\n    ts.getFileNamesFromConfigSpecs = getFileNamesFromConfigSpecs;\n    /* @internal */\n    function isExcludedFile(pathToCheck, spec, basePath, useCaseSensitiveFileNames, currentDirectory) {\n        var validatedFilesSpec = spec.validatedFilesSpec, validatedIncludeSpecs = spec.validatedIncludeSpecs, validatedExcludeSpecs = spec.validatedExcludeSpecs;\n        if (!ts.length(validatedIncludeSpecs) || !ts.length(validatedExcludeSpecs))\n            return false;\n        basePath = ts.normalizePath(basePath);\n        var keyMapper = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);\n        if (validatedFilesSpec) {\n            for (var _i = 0, validatedFilesSpec_2 = validatedFilesSpec; _i < validatedFilesSpec_2.length; _i++) {\n                var fileName = validatedFilesSpec_2[_i];\n                if (keyMapper(ts.getNormalizedAbsolutePath(fileName, basePath)) === pathToCheck)\n                    return false;\n            }\n        }\n        return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs, useCaseSensitiveFileNames, currentDirectory, basePath);\n    }\n    ts.isExcludedFile = isExcludedFile;\n    /* @internal */\n    function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames, currentDirectory) {\n        return matchesExcludeWorker(pathToCheck, ts.filter(excludeSpecs, function (spec) { return !invalidDotDotAfterRecursiveWildcardPattern.test(spec); }), useCaseSensitiveFileNames, currentDirectory);\n    }\n    ts.matchesExclude = matchesExclude;\n    function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames, currentDirectory, basePath) {\n        var excludePattern = ts.getRegularExpressionForWildcard(excludeSpecs, ts.combinePaths(ts.normalizePath(currentDirectory), basePath), \"exclude\");\n        var excludeRegex = excludePattern && ts.getRegexFromPattern(excludePattern, useCaseSensitiveFileNames);\n        if (!excludeRegex)\n            return false;\n        if (excludeRegex.test(pathToCheck))\n            return true;\n        return !ts.hasExtension(pathToCheck) && excludeRegex.test(ts.ensureTrailingDirectorySeparator(pathToCheck));\n    }\n    function validateSpecs(specs, errors, disallowTrailingRecursion, jsonSourceFile, specKey) {\n        return specs.filter(function (spec) {\n            if (!ts.isString(spec))\n                return false;\n            var diag = specToDiagnostic(spec, disallowTrailingRecursion);\n            if (diag !== undefined) {\n                errors.push(createDiagnostic.apply(void 0, diag));\n            }\n            return diag === undefined;\n        });\n        function createDiagnostic(message, spec) {\n            var element = ts.getTsConfigPropArrayElementValue(jsonSourceFile, specKey, spec);\n            return element ?\n                ts.createDiagnosticForNodeInSourceFile(jsonSourceFile, element, message, spec) :\n                ts.createCompilerDiagnostic(message, spec);\n        }\n    }\n    function specToDiagnostic(spec, disallowTrailingRecursion) {\n        if (disallowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) {\n            return [ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];\n        }\n        else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) {\n            return [ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];\n        }\n    }\n    /**\n     * Gets directories in a set of include patterns that should be watched for changes.\n     */\n    function getWildcardDirectories(_a, path, useCaseSensitiveFileNames) {\n        var include = _a.validatedIncludeSpecs, exclude = _a.validatedExcludeSpecs;\n        // We watch a directory recursively if it contains a wildcard anywhere in a directory segment\n        // of the pattern:\n        //\n        //  /a/b/**/d   - Watch /a/b recursively to catch changes to any d in any subfolder recursively\n        //  /a/b/*/d    - Watch /a/b recursively to catch any d in any immediate subfolder, even if a new subfolder is added\n        //  /a/b        - Watch /a/b recursively to catch changes to anything in any recursive subfoler\n        //\n        // We watch a directory without recursion if it contains a wildcard in the file segment of\n        // the pattern:\n        //\n        //  /a/b/*      - Watch /a/b directly to catch any new file\n        //  /a/b/a?z    - Watch /a/b directly to catch any new file matching a?z\n        var rawExcludeRegex = ts.getRegularExpressionForWildcard(exclude, path, \"exclude\");\n        var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? \"\" : \"i\");\n        var wildcardDirectories = {};\n        if (include !== undefined) {\n            var recursiveKeys = [];\n            for (var _i = 0, include_1 = include; _i < include_1.length; _i++) {\n                var file = include_1[_i];\n                var spec = ts.normalizePath(ts.combinePaths(path, file));\n                if (excludeRegex && excludeRegex.test(spec)) {\n                    continue;\n                }\n                var match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames);\n                if (match) {\n                    var key = match.key, flags = match.flags;\n                    var existingFlags = wildcardDirectories[key];\n                    if (existingFlags === undefined || existingFlags < flags) {\n                        wildcardDirectories[key] = flags;\n                        if (flags === 1 /* Recursive */) {\n                            recursiveKeys.push(key);\n                        }\n                    }\n                }\n            }\n            // Remove any subpaths under an existing recursively watched directory.\n            for (var key in wildcardDirectories) {\n                if (ts.hasProperty(wildcardDirectories, key)) {\n                    for (var _b = 0, recursiveKeys_1 = recursiveKeys; _b < recursiveKeys_1.length; _b++) {\n                        var recursiveKey = recursiveKeys_1[_b];\n                        if (key !== recursiveKey && ts.containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) {\n                            delete wildcardDirectories[key];\n                        }\n                    }\n                }\n            }\n        }\n        return wildcardDirectories;\n    }\n    function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames) {\n        var match = wildcardDirectoryPattern.exec(spec);\n        if (match) {\n            return {\n                key: useCaseSensitiveFileNames ? match[0] : ts.toFileNameLowerCase(match[0]),\n                flags: watchRecursivePattern.test(spec) ? 1 /* Recursive */ : 0 /* None */\n            };\n        }\n        if (ts.isImplicitGlob(spec)) {\n            return {\n                key: useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec),\n                flags: 1 /* Recursive */\n            };\n        }\n        return undefined;\n    }\n    /**\n     * Determines whether a literal or wildcard file has already been included that has a higher\n     * extension priority.\n     *\n     * @param file The path to the file.\n     * @param extensionPriority The priority of the extension.\n     * @param context The expansion context.\n     */\n    function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) {\n        var extensionPriority = ts.getExtensionPriority(file, extensions);\n        var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority, extensions);\n        for (var i = 0 /* Highest */; i < adjustedExtensionPriority; i++) {\n            var higherPriorityExtension = extensions[i];\n            var higherPriorityPath = keyMapper(ts.changeExtension(file, higherPriorityExtension));\n            if (literalFiles.has(higherPriorityPath) || wildcardFiles.has(higherPriorityPath)) {\n                return true;\n            }\n        }\n        return false;\n    }\n    /**\n     * Removes files included via wildcard expansion with a lower extension priority that have\n     * already been included.\n     *\n     * @param file The path to the file.\n     * @param extensionPriority The priority of the extension.\n     * @param context The expansion context.\n     */\n    function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) {\n        var extensionPriority = ts.getExtensionPriority(file, extensions);\n        var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority, extensions);\n        for (var i = nextExtensionPriority; i < extensions.length; i++) {\n            var lowerPriorityExtension = extensions[i];\n            var lowerPriorityPath = keyMapper(ts.changeExtension(file, lowerPriorityExtension));\n            wildcardFiles.delete(lowerPriorityPath);\n        }\n    }\n    /**\n     * Produces a cleaned version of compiler options with personally identifying info (aka, paths) removed.\n     * Also converts enum values back to strings.\n     */\n    /* @internal */\n    function convertCompilerOptionsForTelemetry(opts) {\n        var out = {};\n        for (var key in opts) {\n            if (opts.hasOwnProperty(key)) {\n                var type = getOptionFromName(key);\n                if (type !== undefined) { // Ignore unknown options\n                    out[key] = getOptionValueWithEmptyStrings(opts[key], type);\n                }\n            }\n        }\n        return out;\n    }\n    ts.convertCompilerOptionsForTelemetry = convertCompilerOptionsForTelemetry;\n    function getOptionValueWithEmptyStrings(value, option) {\n        switch (option.type) {\n            case \"object\": // \"paths\". Can't get any useful information from the value since we blank out strings, so just return \"\".\n                return \"\";\n            case \"string\": // Could be any arbitrary string -- use empty string instead.\n                return \"\";\n            case \"number\": // Allow numbers, but be sure to check it's actually a number.\n                return typeof value === \"number\" ? value : \"\";\n            case \"boolean\":\n                return typeof value === \"boolean\" ? value : \"\";\n            case \"list\":\n                var elementType_1 = option.element;\n                return ts.isArray(value) ? value.map(function (v) { return getOptionValueWithEmptyStrings(v, elementType_1); }) : \"\";\n            default:\n                return ts.forEachEntry(option.type, function (optionEnumValue, optionStringValue) {\n                    if (optionEnumValue === value) {\n                        return optionStringValue;\n                    }\n                }); // TODO: GH#18217\n        }\n    }\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    function trace(host) {\n        host.trace(ts.formatMessage.apply(undefined, arguments));\n    }\n    ts.trace = trace;\n    /* @internal */\n    function isTraceEnabled(compilerOptions, host) {\n        return !!compilerOptions.traceResolution && host.trace !== undefined;\n    }\n    ts.isTraceEnabled = isTraceEnabled;\n    function withPackageId(packageInfo, r) {\n        var packageId;\n        if (r && packageInfo) {\n            var packageJsonContent = packageInfo.packageJsonContent;\n            if (typeof packageJsonContent.name === \"string\" && typeof packageJsonContent.version === \"string\") {\n                packageId = {\n                    name: packageJsonContent.name,\n                    subModuleName: r.path.slice(packageInfo.packageDirectory.length + ts.directorySeparator.length),\n                    version: packageJsonContent.version\n                };\n            }\n        }\n        return r && { path: r.path, extension: r.ext, packageId: packageId };\n    }\n    function noPackageId(r) {\n        return withPackageId(/*packageInfo*/ undefined, r);\n    }\n    function removeIgnoredPackageId(r) {\n        if (r) {\n            ts.Debug.assert(r.packageId === undefined);\n            return { path: r.path, ext: r.extension };\n        }\n    }\n    /**\n     * Kinds of file that we are currently looking for.\n     * Typically there is one pass with Extensions.TypeScript, then a second pass with Extensions.JavaScript.\n     */\n    var Extensions;\n    (function (Extensions) {\n        Extensions[Extensions[\"TypeScript\"] = 0] = \"TypeScript\";\n        Extensions[Extensions[\"JavaScript\"] = 1] = \"JavaScript\";\n        Extensions[Extensions[\"Json\"] = 2] = \"Json\";\n        Extensions[Extensions[\"TSConfig\"] = 3] = \"TSConfig\";\n        Extensions[Extensions[\"DtsOnly\"] = 4] = \"DtsOnly\"; /** Only '.d.ts' */\n    })(Extensions || (Extensions = {}));\n    /** Used with `Extensions.DtsOnly` to extract the path from TypeScript results. */\n    function resolvedTypeScriptOnly(resolved) {\n        if (!resolved) {\n            return undefined;\n        }\n        ts.Debug.assert(ts.extensionIsTS(resolved.extension));\n        return { fileName: resolved.path, packageId: resolved.packageId };\n    }\n    function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, resultFromCache) {\n        var _a;\n        if (resultFromCache) {\n            (_a = resultFromCache.failedLookupLocations).push.apply(_a, failedLookupLocations);\n            return resultFromCache;\n        }\n        return {\n            resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: resolved.originalPath === true ? undefined : resolved.originalPath, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId },\n            failedLookupLocations: failedLookupLocations\n        };\n    }\n    function readPackageJsonField(jsonContent, fieldName, typeOfTag, state) {\n        if (!ts.hasProperty(jsonContent, fieldName)) {\n            if (state.traceEnabled) {\n                trace(state.host, ts.Diagnostics.package_json_does_not_have_a_0_field, fieldName);\n            }\n            return;\n        }\n        var value = jsonContent[fieldName];\n        if (typeof value !== typeOfTag || value === null) { // eslint-disable-line no-null/no-null\n            if (state.traceEnabled) {\n                // eslint-disable-next-line no-null/no-null\n                trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, fieldName, typeOfTag, value === null ? \"null\" : typeof value);\n            }\n            return;\n        }\n        return value;\n    }\n    function readPackageJsonPathField(jsonContent, fieldName, baseDirectory, state) {\n        var fileName = readPackageJsonField(jsonContent, fieldName, \"string\", state);\n        if (fileName === undefined) {\n            return;\n        }\n        if (!fileName) {\n            if (state.traceEnabled) {\n                trace(state.host, ts.Diagnostics.package_json_had_a_falsy_0_field, fieldName);\n            }\n            return;\n        }\n        var path = ts.normalizePath(ts.combinePaths(baseDirectory, fileName));\n        if (state.traceEnabled) {\n            trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, fileName, path);\n        }\n        return path;\n    }\n    function readPackageJsonTypesFields(jsonContent, baseDirectory, state) {\n        return readPackageJsonPathField(jsonContent, \"typings\", baseDirectory, state)\n            || readPackageJsonPathField(jsonContent, \"types\", baseDirectory, state);\n    }\n    function readPackageJsonTSConfigField(jsonContent, baseDirectory, state) {\n        return readPackageJsonPathField(jsonContent, \"tsconfig\", baseDirectory, state);\n    }\n    function readPackageJsonMainField(jsonContent, baseDirectory, state) {\n        return readPackageJsonPathField(jsonContent, \"main\", baseDirectory, state);\n    }\n    function readPackageJsonTypesVersionsField(jsonContent, state) {\n        var typesVersions = readPackageJsonField(jsonContent, \"typesVersions\", \"object\", state);\n        if (typesVersions === undefined)\n            return;\n        if (state.traceEnabled) {\n            trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_field_with_version_specific_path_mappings);\n        }\n        return typesVersions;\n    }\n    function readPackageJsonTypesVersionPaths(jsonContent, state) {\n        var typesVersions = readPackageJsonTypesVersionsField(jsonContent, state);\n        if (typesVersions === undefined)\n            return;\n        if (state.traceEnabled) {\n            for (var key in typesVersions) {\n                if (ts.hasProperty(typesVersions, key) && !ts.VersionRange.tryParse(key)) {\n                    trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range, key);\n                }\n            }\n        }\n        var result = getPackageJsonTypesVersionsPaths(typesVersions);\n        if (!result) {\n            if (state.traceEnabled) {\n                trace(state.host, ts.Diagnostics.package_json_does_not_have_a_typesVersions_entry_that_matches_version_0, ts.versionMajorMinor);\n            }\n            return;\n        }\n        var bestVersionKey = result.version, bestVersionPaths = result.paths;\n        if (typeof bestVersionPaths !== \"object\") {\n            if (state.traceEnabled) {\n                trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, \"typesVersions['\" + bestVersionKey + \"']\", \"object\", typeof bestVersionPaths);\n            }\n            return;\n        }\n        return result;\n    }\n    var typeScriptVersion;\n    /* @internal */\n    function getPackageJsonTypesVersionsPaths(typesVersions) {\n        if (!typeScriptVersion)\n            typeScriptVersion = new ts.Version(ts.version);\n        for (var key in typesVersions) {\n            if (!ts.hasProperty(typesVersions, key))\n                continue;\n            var keyRange = ts.VersionRange.tryParse(key);\n            if (keyRange === undefined) {\n                continue;\n            }\n            // return the first entry whose range matches the current compiler version.\n            if (keyRange.test(typeScriptVersion)) {\n                return { version: key, paths: typesVersions[key] };\n            }\n        }\n    }\n    ts.getPackageJsonTypesVersionsPaths = getPackageJsonTypesVersionsPaths;\n    function getEffectiveTypeRoots(options, host) {\n        if (options.typeRoots) {\n            return options.typeRoots;\n        }\n        var currentDirectory;\n        if (options.configFilePath) {\n            currentDirectory = ts.getDirectoryPath(options.configFilePath);\n        }\n        else if (host.getCurrentDirectory) {\n            currentDirectory = host.getCurrentDirectory();\n        }\n        if (currentDirectory !== undefined) {\n            return getDefaultTypeRoots(currentDirectory, host);\n        }\n    }\n    ts.getEffectiveTypeRoots = getEffectiveTypeRoots;\n    /**\n     * Returns the path to every node_modules/@types directory from some ancestor directory.\n     * Returns undefined if there are none.\n     */\n    function getDefaultTypeRoots(currentDirectory, host) {\n        if (!host.directoryExists) {\n            return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)];\n            // And if it doesn't exist, tough.\n        }\n        var typeRoots;\n        ts.forEachAncestorDirectory(ts.normalizePath(currentDirectory), function (directory) {\n            var atTypes = ts.combinePaths(directory, nodeModulesAtTypes);\n            if (host.directoryExists(atTypes)) {\n                (typeRoots || (typeRoots = [])).push(atTypes);\n            }\n            return undefined;\n        });\n        return typeRoots;\n    }\n    var nodeModulesAtTypes = ts.combinePaths(\"node_modules\", \"@types\");\n    /**\n     * @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown.\n     * This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups\n     * is assumed to be the same as root directory of the project.\n     */\n    function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference) {\n        var traceEnabled = isTraceEnabled(options, host);\n        if (redirectedReference) {\n            options = redirectedReference.commandLine.options;\n        }\n        var failedLookupLocations = [];\n        var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations };\n        var typeRoots = getEffectiveTypeRoots(options, host);\n        if (traceEnabled) {\n            if (containingFile === undefined) {\n                if (typeRoots === undefined) {\n                    trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set, typeReferenceDirectiveName);\n                }\n                else {\n                    trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1, typeReferenceDirectiveName, typeRoots);\n                }\n            }\n            else {\n                if (typeRoots === undefined) {\n                    trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set, typeReferenceDirectiveName, containingFile);\n                }\n                else {\n                    trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_2, typeReferenceDirectiveName, containingFile, typeRoots);\n                }\n            }\n            if (redirectedReference) {\n                trace(host, ts.Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName);\n            }\n        }\n        var resolved = primaryLookup();\n        var primary = true;\n        if (!resolved) {\n            resolved = secondaryLookup();\n            primary = false;\n        }\n        var resolvedTypeReferenceDirective;\n        if (resolved) {\n            var fileName = resolved.fileName, packageId = resolved.packageId;\n            var resolvedFileName = options.preserveSymlinks ? fileName : realPath(fileName, host, traceEnabled);\n            if (traceEnabled) {\n                if (packageId) {\n                    trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3, typeReferenceDirectiveName, resolvedFileName, ts.packageIdToString(packageId), primary);\n                }\n                else {\n                    trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, resolvedFileName, primary);\n                }\n            }\n            resolvedTypeReferenceDirective = { primary: primary, resolvedFileName: resolvedFileName, packageId: packageId, isExternalLibraryImport: pathContainsNodeModules(fileName) };\n        }\n        return { resolvedTypeReferenceDirective: resolvedTypeReferenceDirective, failedLookupLocations: failedLookupLocations };\n        function primaryLookup() {\n            // Check primary library paths\n            if (typeRoots && typeRoots.length) {\n                if (traceEnabled) {\n                    trace(host, ts.Diagnostics.Resolving_with_primary_search_path_0, typeRoots.join(\", \"));\n                }\n                return ts.firstDefined(typeRoots, function (typeRoot) {\n                    var candidate = ts.combinePaths(typeRoot, typeReferenceDirectiveName);\n                    var candidateDirectory = ts.getDirectoryPath(candidate);\n                    var directoryExists = ts.directoryProbablyExists(candidateDirectory, host);\n                    if (!directoryExists && traceEnabled) {\n                        trace(host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidateDirectory);\n                    }\n                    return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(Extensions.DtsOnly, candidate, !directoryExists, moduleResolutionState));\n                });\n            }\n            else {\n                if (traceEnabled) {\n                    trace(host, ts.Diagnostics.Root_directory_cannot_be_determined_skipping_primary_search_paths);\n                }\n            }\n        }\n        function secondaryLookup() {\n            var initialLocationForSecondaryLookup = containingFile && ts.getDirectoryPath(containingFile);\n            if (initialLocationForSecondaryLookup !== undefined) {\n                // check secondary locations\n                if (traceEnabled) {\n                    trace(host, ts.Diagnostics.Looking_up_in_node_modules_folder_initial_location_0, initialLocationForSecondaryLookup);\n                }\n                var result = void 0;\n                if (!ts.isExternalModuleNameRelative(typeReferenceDirectiveName)) {\n                    var searchResult = loadModuleFromNearestNodeModulesDirectory(Extensions.DtsOnly, typeReferenceDirectiveName, initialLocationForSecondaryLookup, moduleResolutionState, /*cache*/ undefined, /*redirectedReference*/ undefined);\n                    result = searchResult && searchResult.value;\n                }\n                else {\n                    var candidate = ts.normalizePathAndParts(ts.combinePaths(initialLocationForSecondaryLookup, typeReferenceDirectiveName)).path;\n                    result = nodeLoadModuleByRelativeName(Extensions.DtsOnly, candidate, /*onlyRecordFailures*/ false, moduleResolutionState, /*considerPackageJson*/ true);\n                }\n                var resolvedFile = resolvedTypeScriptOnly(result);\n                if (!resolvedFile && traceEnabled) {\n                    trace(host, ts.Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName);\n                }\n                return resolvedFile;\n            }\n            else {\n                if (traceEnabled) {\n                    trace(host, ts.Diagnostics.Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder);\n                }\n            }\n        }\n    }\n    ts.resolveTypeReferenceDirective = resolveTypeReferenceDirective;\n    /**\n     * Given a set of options, returns the set of type directive names\n     *   that should be included for this program automatically.\n     * This list could either come from the config file,\n     *   or from enumerating the types root + initial secondary types lookup location.\n     * More type directives might appear in the program later as a result of loading actual source files;\n     *   this list is only the set of defaults that are implicitly included.\n     */\n    function getAutomaticTypeDirectiveNames(options, host) {\n        // Use explicit type list from tsconfig.json\n        if (options.types) {\n            return options.types;\n        }\n        // Walk the primary type lookup locations\n        var result = [];\n        if (host.directoryExists && host.getDirectories) {\n            var typeRoots = getEffectiveTypeRoots(options, host);\n            if (typeRoots) {\n                for (var _i = 0, typeRoots_1 = typeRoots; _i < typeRoots_1.length; _i++) {\n                    var root = typeRoots_1[_i];\n                    if (host.directoryExists(root)) {\n                        for (var _a = 0, _b = host.getDirectories(root); _a < _b.length; _a++) {\n                            var typeDirectivePath = _b[_a];\n                            var normalized = ts.normalizePath(typeDirectivePath);\n                            var packageJsonPath = ts.combinePaths(root, normalized, \"package.json\");\n                            // `types-publisher` sometimes creates packages with `\"typings\": null` for packages that don't provide their own types.\n                            // See `createNotNeededPackageJSON` in the types-publisher` repo.\n                            // eslint-disable-next-line no-null/no-null\n                            var isNotNeededPackage = host.fileExists(packageJsonPath) && ts.readJson(packageJsonPath, host).typings === null;\n                            if (!isNotNeededPackage) {\n                                var baseFileName = ts.getBaseFileName(normalized);\n                                // At this stage, skip results with leading dot.\n                                if (baseFileName.charCodeAt(0) !== 46 /* dot */) {\n                                    // Return just the type directive names\n                                    result.push(baseFileName);\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        return result;\n    }\n    ts.getAutomaticTypeDirectiveNames = getAutomaticTypeDirectiveNames;\n    function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options) {\n        return createModuleResolutionCacheWithMaps(createCacheWithRedirects(options), createCacheWithRedirects(options), currentDirectory, getCanonicalFileName);\n    }\n    ts.createModuleResolutionCache = createModuleResolutionCache;\n    /*@internal*/\n    function createCacheWithRedirects(options) {\n        var ownMap = new ts.Map();\n        var redirectsMap = new ts.Map();\n        return {\n            ownMap: ownMap,\n            redirectsMap: redirectsMap,\n            getOrCreateMapOfCacheRedirects: getOrCreateMapOfCacheRedirects,\n            clear: clear,\n            setOwnOptions: setOwnOptions,\n            setOwnMap: setOwnMap\n        };\n        function setOwnOptions(newOptions) {\n            options = newOptions;\n        }\n        function setOwnMap(newOwnMap) {\n            ownMap = newOwnMap;\n        }\n        function getOrCreateMapOfCacheRedirects(redirectedReference) {\n            if (!redirectedReference) {\n                return ownMap;\n            }\n            var path = redirectedReference.sourceFile.path;\n            var redirects = redirectsMap.get(path);\n            if (!redirects) {\n                // Reuse map if redirected reference map uses same resolution\n                redirects = !options || ts.optionsHaveModuleResolutionChanges(options, redirectedReference.commandLine.options) ? new ts.Map() : ownMap;\n                redirectsMap.set(path, redirects);\n            }\n            return redirects;\n        }\n        function clear() {\n            ownMap.clear();\n            redirectsMap.clear();\n        }\n    }\n    ts.createCacheWithRedirects = createCacheWithRedirects;\n    /*@internal*/\n    function createModuleResolutionCacheWithMaps(directoryToModuleNameMap, moduleNameToDirectoryMap, currentDirectory, getCanonicalFileName) {\n        return { getOrCreateCacheForDirectory: getOrCreateCacheForDirectory, getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, directoryToModuleNameMap: directoryToModuleNameMap, moduleNameToDirectoryMap: moduleNameToDirectoryMap };\n        function getOrCreateCacheForDirectory(directoryName, redirectedReference) {\n            var path = ts.toPath(directoryName, currentDirectory, getCanonicalFileName);\n            return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path, function () { return new ts.Map(); });\n        }\n        function getOrCreateCacheForModuleName(nonRelativeModuleName, redirectedReference) {\n            ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));\n            return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, nonRelativeModuleName, createPerModuleNameCache);\n        }\n        function getOrCreateCache(cacheWithRedirects, redirectedReference, key, create) {\n            var cache = cacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference);\n            var result = cache.get(key);\n            if (!result) {\n                result = create();\n                cache.set(key, result);\n            }\n            return result;\n        }\n        function createPerModuleNameCache() {\n            var directoryPathMap = new ts.Map();\n            return { get: get, set: set };\n            function get(directory) {\n                return directoryPathMap.get(ts.toPath(directory, currentDirectory, getCanonicalFileName));\n            }\n            /**\n             * At first this function add entry directory -> module resolution result to the table.\n             * Then it computes the set of parent folders for 'directory' that should have the same module resolution result\n             * and for every parent folder in set it adds entry: parent -> module resolution. .\n             * Lets say we first directory name: /a/b/c/d/e and resolution result is: /a/b/bar.ts.\n             * Set of parent folders that should have the same result will be:\n             * [\n             *     /a/b/c/d, /a/b/c, /a/b\n             * ]\n             * this means that request for module resolution from file in any of these folder will be immediately found in cache.\n             */\n            function set(directory, result) {\n                var path = ts.toPath(directory, currentDirectory, getCanonicalFileName);\n                // if entry is already in cache do nothing\n                if (directoryPathMap.has(path)) {\n                    return;\n                }\n                directoryPathMap.set(path, result);\n                var resolvedFileName = result.resolvedModule &&\n                    (result.resolvedModule.originalPath || result.resolvedModule.resolvedFileName);\n                // find common prefix between directory and resolved file name\n                // this common prefix should be the shortest path that has the same resolution\n                // directory: /a/b/c/d/e\n                // resolvedFileName: /a/b/foo.d.ts\n                // commonPrefix: /a/b\n                // for failed lookups cache the result for every directory up to root\n                var commonPrefix = resolvedFileName && getCommonPrefix(path, resolvedFileName);\n                var current = path;\n                while (current !== commonPrefix) {\n                    var parent = ts.getDirectoryPath(current);\n                    if (parent === current || directoryPathMap.has(parent)) {\n                        break;\n                    }\n                    directoryPathMap.set(parent, result);\n                    current = parent;\n                }\n            }\n            function getCommonPrefix(directory, resolution) {\n                var resolutionDirectory = ts.toPath(ts.getDirectoryPath(resolution), currentDirectory, getCanonicalFileName);\n                // find first position where directory and resolution differs\n                var i = 0;\n                var limit = Math.min(directory.length, resolutionDirectory.length);\n                while (i < limit && directory.charCodeAt(i) === resolutionDirectory.charCodeAt(i)) {\n                    i++;\n                }\n                if (i === directory.length && (resolutionDirectory.length === i || resolutionDirectory[i] === ts.directorySeparator)) {\n                    return directory;\n                }\n                var rootLength = ts.getRootLength(directory);\n                if (i < rootLength) {\n                    return undefined;\n                }\n                var sep = directory.lastIndexOf(ts.directorySeparator, i - 1);\n                if (sep === -1) {\n                    return undefined;\n                }\n                return directory.substr(0, Math.max(sep, rootLength));\n            }\n        }\n    }\n    ts.createModuleResolutionCacheWithMaps = createModuleResolutionCacheWithMaps;\n    function resolveModuleNameFromCache(moduleName, containingFile, cache) {\n        var containingDirectory = ts.getDirectoryPath(containingFile);\n        var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory);\n        return perFolderCache && perFolderCache.get(moduleName);\n    }\n    ts.resolveModuleNameFromCache = resolveModuleNameFromCache;\n    function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {\n        var traceEnabled = isTraceEnabled(compilerOptions, host);\n        if (redirectedReference) {\n            compilerOptions = redirectedReference.commandLine.options;\n        }\n        if (traceEnabled) {\n            trace(host, ts.Diagnostics.Resolving_module_0_from_1, moduleName, containingFile);\n            if (redirectedReference) {\n                trace(host, ts.Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName);\n            }\n        }\n        var containingDirectory = ts.getDirectoryPath(containingFile);\n        var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference);\n        var result = perFolderCache && perFolderCache.get(moduleName);\n        if (result) {\n            if (traceEnabled) {\n                trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory);\n            }\n        }\n        else {\n            var moduleResolution = compilerOptions.moduleResolution;\n            if (moduleResolution === undefined) {\n                moduleResolution = ts.getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS ? ts.ModuleResolutionKind.NodeJs : ts.ModuleResolutionKind.Classic;\n                if (traceEnabled) {\n                    trace(host, ts.Diagnostics.Module_resolution_kind_is_not_specified_using_0, ts.ModuleResolutionKind[moduleResolution]);\n                }\n            }\n            else {\n                if (traceEnabled) {\n                    trace(host, ts.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ts.ModuleResolutionKind[moduleResolution]);\n                }\n            }\n            ts.perfLogger.logStartResolveModule(moduleName /* , containingFile, ModuleResolutionKind[moduleResolution]*/);\n            switch (moduleResolution) {\n                case ts.ModuleResolutionKind.NodeJs:\n                    result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);\n                    break;\n                case ts.ModuleResolutionKind.Classic:\n                    result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);\n                    break;\n                default:\n                    return ts.Debug.fail(\"Unexpected moduleResolution: \" + moduleResolution);\n            }\n            if (result && result.resolvedModule)\n                ts.perfLogger.logInfoEvent(\"Module \\\"\" + moduleName + \"\\\" resolved to \\\"\" + result.resolvedModule.resolvedFileName + \"\\\"\");\n            ts.perfLogger.logStopResolveModule((result && result.resolvedModule) ? \"\" + result.resolvedModule.resolvedFileName : \"null\");\n            if (perFolderCache) {\n                perFolderCache.set(moduleName, result);\n                if (!ts.isExternalModuleNameRelative(moduleName)) {\n                    // put result in per-module name cache\n                    cache.getOrCreateCacheForModuleName(moduleName, redirectedReference).set(containingDirectory, result);\n                }\n            }\n        }\n        if (traceEnabled) {\n            if (result.resolvedModule) {\n                if (result.resolvedModule.packageId) {\n                    trace(host, ts.Diagnostics.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2, moduleName, result.resolvedModule.resolvedFileName, ts.packageIdToString(result.resolvedModule.packageId));\n                }\n                else {\n                    trace(host, ts.Diagnostics.Module_name_0_was_successfully_resolved_to_1, moduleName, result.resolvedModule.resolvedFileName);\n                }\n            }\n            else {\n                trace(host, ts.Diagnostics.Module_name_0_was_not_resolved, moduleName);\n            }\n        }\n        return result;\n    }\n    ts.resolveModuleName = resolveModuleName;\n    /**\n     * Any module resolution kind can be augmented with optional settings: 'baseUrl', 'paths' and 'rootDirs' - they are used to\n     * mitigate differences between design time structure of the project and its runtime counterpart so the same import name\n     * can be resolved successfully by TypeScript compiler and runtime module loader.\n     * If these settings are set then loading procedure will try to use them to resolve module name and it can of failure it will\n     * fallback to standard resolution routine.\n     *\n     * - baseUrl - this setting controls how non-relative module names are resolved. If this setting is specified then non-relative\n     * names will be resolved relative to baseUrl: i.e. if baseUrl is '/a/b' then candidate location to resolve module name 'c/d' will\n     * be '/a/b/c/d'\n     * - paths - this setting can only be used when baseUrl is specified. allows to tune how non-relative module names\n     * will be resolved based on the content of the module name.\n     * Structure of 'paths' compiler options\n     * 'paths': {\n     *    pattern-1: [...substitutions],\n     *    pattern-2: [...substitutions],\n     *    ...\n     *    pattern-n: [...substitutions]\n     * }\n     * Pattern here is a string that can contain zero or one '*' character. During module resolution module name will be matched against\n     * all patterns in the list. Matching for patterns that don't contain '*' means that module name must be equal to pattern respecting the case.\n     * If pattern contains '*' then to match pattern \"<prefix>*<suffix>\" module name must start with the <prefix> and end with <suffix>.\n     * <MatchedStar> denotes part of the module name between <prefix> and <suffix>.\n     * If module name can be matches with multiple patterns then pattern with the longest prefix will be picked.\n     * After selecting pattern we'll use list of substitutions to get candidate locations of the module and the try to load module\n     * from the candidate location.\n     * Substitution is a string that can contain zero or one '*'. To get candidate location from substitution we'll pick every\n     * substitution in the list and replace '*' with <MatchedStar> string. If candidate location is not rooted it\n     * will be converted to absolute using baseUrl.\n     * For example:\n     * baseUrl: /a/b/c\n     * \"paths\": {\n     *     // match all module names\n     *     \"*\": [\n     *         \"*\",        // use matched name as is,\n     *                     // <matched name> will be looked as /a/b/c/<matched name>\n     *\n     *         \"folder1/*\" // substitution will convert matched name to 'folder1/<matched name>',\n     *                     // since it is not rooted then final candidate location will be /a/b/c/folder1/<matched name>\n     *     ],\n     *     // match module names that start with 'components/'\n     *     \"components/*\": [ \"/root/components/*\" ] // substitution will convert /components/folder1/<matched name> to '/root/components/folder1/<matched name>',\n     *                                              // it is rooted so it will be final candidate location\n     * }\n     *\n     * 'rootDirs' allows the project to be spreaded across multiple locations and resolve modules with relative names as if\n     * they were in the same location. For example lets say there are two files\n     * '/local/src/content/file1.ts'\n     * '/shared/components/contracts/src/content/protocols/file2.ts'\n     * After bundling content of '/shared/components/contracts/src' will be merged with '/local/src' so\n     * if file1 has the following import 'import {x} from \"./protocols/file2\"' it will be resolved successfully in runtime.\n     * 'rootDirs' provides the way to tell compiler that in order to get the whole project it should behave as if content of all\n     * root dirs were merged together.\n     * I.e. for the example above 'rootDirs' will have two entries: [ '/local/src', '/shared/components/contracts/src' ].\n     * Compiler will first convert './protocols/file2' into absolute path relative to the location of containing file:\n     * '/local/src/content/protocols/file2' and try to load it - failure.\n     * Then it will search 'rootDirs' looking for a longest matching prefix of this absolute path and if such prefix is found - absolute path will\n     * be converted to a path relative to found rootDir entry './content/protocols/file2' (*). As a last step compiler will check all remaining\n     * entries in 'rootDirs', use them to build absolute path out of (*) and try to resolve module from this location.\n     */\n    function tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, state) {\n        var resolved = tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state);\n        if (resolved)\n            return resolved.value;\n        if (!ts.isExternalModuleNameRelative(moduleName)) {\n            return tryLoadModuleUsingBaseUrl(extensions, moduleName, loader, state);\n        }\n        else {\n            return tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, state);\n        }\n    }\n    function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state) {\n        var _a = state.compilerOptions, baseUrl = _a.baseUrl, paths = _a.paths;\n        if (paths && !ts.pathIsRelative(moduleName)) {\n            if (state.traceEnabled) {\n                if (baseUrl) {\n                    trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName);\n                }\n                trace(state.host, ts.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName);\n            }\n            var baseDirectory = ts.getPathsBasePath(state.compilerOptions, state.host); // Always defined when 'paths' is defined\n            return tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, loader, /*onlyRecordFailures*/ false, state);\n        }\n    }\n    function tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, state) {\n        if (!state.compilerOptions.rootDirs) {\n            return undefined;\n        }\n        if (state.traceEnabled) {\n            trace(state.host, ts.Diagnostics.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0, moduleName);\n        }\n        var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName));\n        var matchedRootDir;\n        var matchedNormalizedPrefix;\n        for (var _i = 0, _a = state.compilerOptions.rootDirs; _i < _a.length; _i++) {\n            var rootDir = _a[_i];\n            // rootDirs are expected to be absolute\n            // in case of tsconfig.json this will happen automatically - compiler will expand relative names\n            // using location of tsconfig.json as base location\n            var normalizedRoot = ts.normalizePath(rootDir);\n            if (!ts.endsWith(normalizedRoot, ts.directorySeparator)) {\n                normalizedRoot += ts.directorySeparator;\n            }\n            var isLongestMatchingPrefix = ts.startsWith(candidate, normalizedRoot) &&\n                (matchedNormalizedPrefix === undefined || matchedNormalizedPrefix.length < normalizedRoot.length);\n            if (state.traceEnabled) {\n                trace(state.host, ts.Diagnostics.Checking_if_0_is_the_longest_matching_prefix_for_1_2, normalizedRoot, candidate, isLongestMatchingPrefix);\n            }\n            if (isLongestMatchingPrefix) {\n                matchedNormalizedPrefix = normalizedRoot;\n                matchedRootDir = rootDir;\n            }\n        }\n        if (matchedNormalizedPrefix) {\n            if (state.traceEnabled) {\n                trace(state.host, ts.Diagnostics.Longest_matching_prefix_for_0_is_1, candidate, matchedNormalizedPrefix);\n            }\n            var suffix = candidate.substr(matchedNormalizedPrefix.length);\n            // first - try to load from a initial location\n            if (state.traceEnabled) {\n                trace(state.host, ts.Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, matchedNormalizedPrefix, candidate);\n            }\n            var resolvedFileName = loader(extensions, candidate, !ts.directoryProbablyExists(containingDirectory, state.host), state);\n            if (resolvedFileName) {\n                return resolvedFileName;\n            }\n            if (state.traceEnabled) {\n                trace(state.host, ts.Diagnostics.Trying_other_entries_in_rootDirs);\n            }\n            // then try to resolve using remaining entries in rootDirs\n            for (var _b = 0, _c = state.compilerOptions.rootDirs; _b < _c.length; _b++) {\n                var rootDir = _c[_b];\n                if (rootDir === matchedRootDir) {\n                    // skip the initially matched entry\n                    continue;\n                }\n                var candidate_1 = ts.combinePaths(ts.normalizePath(rootDir), suffix);\n                if (state.traceEnabled) {\n                    trace(state.host, ts.Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, rootDir, candidate_1);\n                }\n                var baseDirectory = ts.getDirectoryPath(candidate_1);\n                var resolvedFileName_1 = loader(extensions, candidate_1, !ts.directoryProbablyExists(baseDirectory, state.host), state);\n                if (resolvedFileName_1) {\n                    return resolvedFileName_1;\n                }\n            }\n            if (state.traceEnabled) {\n                trace(state.host, ts.Diagnostics.Module_resolution_using_rootDirs_has_failed);\n            }\n        }\n        return undefined;\n    }\n    function tryLoadModuleUsingBaseUrl(extensions, moduleName, loader, state) {\n        var baseUrl = state.compilerOptions.baseUrl;\n        if (!baseUrl) {\n            return undefined;\n        }\n        if (state.traceEnabled) {\n            trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName);\n        }\n        var candidate = ts.normalizePath(ts.combinePaths(baseUrl, moduleName));\n        if (state.traceEnabled) {\n            trace(state.host, ts.Diagnostics.Resolving_module_name_0_relative_to_base_url_1_2, moduleName, baseUrl, candidate);\n        }\n        return loader(extensions, candidate, !ts.directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state);\n    }\n    /**\n     * Expose resolution logic to allow us to use Node module resolution logic from arbitrary locations.\n     * No way to do this with `require()`: https://github.com/nodejs/node/issues/5963\n     * Throws an error if the module can't be resolved.\n     */\n    /* @internal */\n    function resolveJSModule(moduleName, initialDir, host) {\n        var _a = tryResolveJSModuleWorker(moduleName, initialDir, host), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations;\n        if (!resolvedModule) {\n            throw new Error(\"Could not resolve JS module '\" + moduleName + \"' starting at '\" + initialDir + \"'. Looked in: \" + failedLookupLocations.join(\", \"));\n        }\n        return resolvedModule.resolvedFileName;\n    }\n    ts.resolveJSModule = resolveJSModule;\n    /* @internal */\n    function tryResolveJSModule(moduleName, initialDir, host) {\n        var resolvedModule = tryResolveJSModuleWorker(moduleName, initialDir, host).resolvedModule;\n        return resolvedModule && resolvedModule.resolvedFileName;\n    }\n    ts.tryResolveJSModule = tryResolveJSModule;\n    var jsOnlyExtensions = [Extensions.JavaScript];\n    var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];\n    var tsPlusJsonExtensions = __spreadArray(__spreadArray([], tsExtensions), [Extensions.Json]);\n    var tsconfigExtensions = [Extensions.TSConfig];\n    function tryResolveJSModuleWorker(moduleName, initialDir, host) {\n        return nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, /*cache*/ undefined, jsOnlyExtensions, /*redirectedReferences*/ undefined);\n    }\n    function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, lookupConfig) {\n        return nodeModuleNameResolverWorker(moduleName, ts.getDirectoryPath(containingFile), compilerOptions, host, cache, lookupConfig ? tsconfigExtensions : (compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions), redirectedReference);\n    }\n    ts.nodeModuleNameResolver = nodeModuleNameResolver;\n    function nodeModuleNameResolverWorker(moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) {\n        var _a, _b;\n        var traceEnabled = isTraceEnabled(compilerOptions, host);\n        var failedLookupLocations = [];\n        var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations };\n        var result = ts.forEach(extensions, function (ext) { return tryResolve(ext); });\n        return createResolvedModuleWithFailedLookupLocations((_a = result === null || result === void 0 ? void 0 : result.value) === null || _a === void 0 ? void 0 : _a.resolved, (_b = result === null || result === void 0 ? void 0 : result.value) === null || _b === void 0 ? void 0 : _b.isExternalLibraryImport, failedLookupLocations, state.resultFromCache);\n        function tryResolve(extensions) {\n            var loader = function (extensions, candidate, onlyRecordFailures, state) { return nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ true); };\n            var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, state);\n            if (resolved) {\n                return toSearchResult({ resolved: resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) });\n            }\n            if (!ts.isExternalModuleNameRelative(moduleName)) {\n                if (traceEnabled) {\n                    trace(host, ts.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]);\n                }\n                var resolved_1 = loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, containingDirectory, state, cache, redirectedReference);\n                if (!resolved_1)\n                    return undefined;\n                var resolvedValue = resolved_1.value;\n                if (!compilerOptions.preserveSymlinks && resolvedValue && !resolvedValue.originalPath) {\n                    var path = realPath(resolvedValue.path, host, traceEnabled);\n                    var originalPath = path === resolvedValue.path ? undefined : resolvedValue.path;\n                    resolvedValue = __assign(__assign({}, resolvedValue), { path: path, originalPath: originalPath });\n                }\n                // For node_modules lookups, get the real path so that multiple accesses to an `npm link`-ed module do not create duplicate files.\n                return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } };\n            }\n            else {\n                var _a = ts.normalizePathAndParts(ts.combinePaths(containingDirectory, moduleName)), candidate = _a.path, parts = _a.parts;\n                var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, /*onlyRecordFailures*/ false, state, /*considerPackageJson*/ true);\n                // Treat explicit \"node_modules\" import as an external library import.\n                return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: ts.contains(parts, \"node_modules\") });\n            }\n        }\n    }\n    function realPath(path, host, traceEnabled) {\n        if (!host.realpath) {\n            return path;\n        }\n        var real = ts.normalizePath(host.realpath(path));\n        if (traceEnabled) {\n            trace(host, ts.Diagnostics.Resolving_real_path_for_0_result_1, path, real);\n        }\n        ts.Debug.assert(host.fileExists(real), path + \" linked to nonexistent file \" + real);\n        return real;\n    }\n    function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {\n        if (state.traceEnabled) {\n            trace(state.host, ts.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1, candidate, Extensions[extensions]);\n        }\n        if (!ts.hasTrailingDirectorySeparator(candidate)) {\n            if (!onlyRecordFailures) {\n                var parentOfCandidate = ts.getDirectoryPath(candidate);\n                if (!ts.directoryProbablyExists(parentOfCandidate, state.host)) {\n                    if (state.traceEnabled) {\n                        trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, parentOfCandidate);\n                    }\n                    onlyRecordFailures = true;\n                }\n            }\n            var resolvedFromFile = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state);\n            if (resolvedFromFile) {\n                var packageDirectory = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile) : undefined;\n                var packageInfo = packageDirectory ? getPackageJsonInfo(packageDirectory, /*onlyRecordFailures*/ false, state) : undefined;\n                return withPackageId(packageInfo, resolvedFromFile);\n            }\n        }\n        if (!onlyRecordFailures) {\n            var candidateExists = ts.directoryProbablyExists(candidate, state.host);\n            if (!candidateExists) {\n                if (state.traceEnabled) {\n                    trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidate);\n                }\n                onlyRecordFailures = true;\n            }\n        }\n        return loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson);\n    }\n    /*@internal*/\n    ts.nodeModulesPathPart = \"/node_modules/\";\n    /*@internal*/\n    function pathContainsNodeModules(path) {\n        return ts.stringContains(path, ts.nodeModulesPathPart);\n    }\n    ts.pathContainsNodeModules = pathContainsNodeModules;\n    /**\n     * This will be called on the successfully resolved path from `loadModuleFromFile`.\n     * (Not needed for `loadModuleFromNodeModules` as that looks up the `package.json` as part of resolution.)\n     *\n     * packageDirectory is the directory of the package itself.\n     *   For `blah/node_modules/foo/index.d.ts` this is packageDirectory: \"foo\"\n     *   For `/node_modules/foo/bar.d.ts` this is packageDirectory: \"foo\"\n     *   For `/node_modules/@types/foo/bar/index.d.ts` this is packageDirectory: \"@types/foo\"\n     *   For `/node_modules/foo/bar/index.d.ts` this is packageDirectory: \"foo\"\n     */\n    function parseNodeModuleFromPath(resolved) {\n        var path = ts.normalizePath(resolved.path);\n        var idx = path.lastIndexOf(ts.nodeModulesPathPart);\n        if (idx === -1) {\n            return undefined;\n        }\n        var indexAfterNodeModules = idx + ts.nodeModulesPathPart.length;\n        var indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterNodeModules);\n        if (path.charCodeAt(indexAfterNodeModules) === 64 /* at */) {\n            indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName);\n        }\n        return path.slice(0, indexAfterPackageName);\n    }\n    function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex) {\n        var nextSeparatorIndex = path.indexOf(ts.directorySeparator, prevSeparatorIndex + 1);\n        return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex;\n    }\n    function loadModuleFromFileNoPackageId(extensions, candidate, onlyRecordFailures, state) {\n        return noPackageId(loadModuleFromFile(extensions, candidate, onlyRecordFailures, state));\n    }\n    /**\n     * @param {boolean} onlyRecordFailures - if true then function won't try to actually load files but instead record all attempts as failures. This flag is necessary\n     * in cases when we know upfront that all load attempts will fail (because containing folder does not exists) however we still need to record all failed lookup locations.\n     */\n    function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {\n        if (extensions === Extensions.Json || extensions === Extensions.TSConfig) {\n            var extensionLess = ts.tryRemoveExtension(candidate, \".json\" /* Json */);\n            return (extensionLess === undefined && extensions === Extensions.Json) ? undefined : tryAddingExtensions(extensionLess || candidate, extensions, onlyRecordFailures, state);\n        }\n        // First, try adding an extension. An import of \"foo\" could be matched by a file \"foo.ts\", or \"foo.js\" by \"foo.js.ts\"\n        var resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, onlyRecordFailures, state);\n        if (resolvedByAddingExtension) {\n            return resolvedByAddingExtension;\n        }\n        // If that didn't work, try stripping a \".js\" or \".jsx\" extension and replacing it with a TypeScript one;\n        // e.g. \"./foo.js\" can be matched by \"./foo.ts\" or \"./foo.d.ts\"\n        if (ts.hasJSFileExtension(candidate)) {\n            var extensionless = ts.removeFileExtension(candidate);\n            if (state.traceEnabled) {\n                var extension = candidate.substring(extensionless.length);\n                trace(state.host, ts.Diagnostics.File_name_0_has_a_1_extension_stripping_it, candidate, extension);\n            }\n            return tryAddingExtensions(extensionless, extensions, onlyRecordFailures, state);\n        }\n    }\n    /** Try to return an existing file that adds one of the `extensions` to `candidate`. */\n    function tryAddingExtensions(candidate, extensions, onlyRecordFailures, state) {\n        if (!onlyRecordFailures) {\n            // check if containing folder exists - if it doesn't then just record failures for all supported extensions without disk probing\n            var directory = ts.getDirectoryPath(candidate);\n            if (directory) {\n                onlyRecordFailures = !ts.directoryProbablyExists(directory, state.host);\n            }\n        }\n        switch (extensions) {\n            case Extensions.DtsOnly:\n                return tryExtension(\".d.ts\" /* Dts */);\n            case Extensions.TypeScript:\n                return tryExtension(\".ts\" /* Ts */) || tryExtension(\".tsx\" /* Tsx */) || tryExtension(\".d.ts\" /* Dts */);\n            case Extensions.JavaScript:\n                return tryExtension(\".js\" /* Js */) || tryExtension(\".jsx\" /* Jsx */);\n            case Extensions.TSConfig:\n            case Extensions.Json:\n                return tryExtension(\".json\" /* Json */);\n        }\n        function tryExtension(ext) {\n            var path = tryFile(candidate + ext, onlyRecordFailures, state);\n            return path === undefined ? undefined : { path: path, ext: ext };\n        }\n    }\n    /** Return the file if it exists. */\n    function tryFile(fileName, onlyRecordFailures, state) {\n        if (!onlyRecordFailures) {\n            if (state.host.fileExists(fileName)) {\n                if (state.traceEnabled) {\n                    trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName);\n                }\n                return fileName;\n            }\n            else {\n                if (state.traceEnabled) {\n                    trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName);\n                }\n            }\n        }\n        state.failedLookupLocations.push(fileName);\n        return undefined;\n    }\n    function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {\n        if (considerPackageJson === void 0) { considerPackageJson = true; }\n        var packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : undefined;\n        var packageJsonContent = packageInfo && packageInfo.packageJsonContent;\n        var versionPaths = packageInfo && packageInfo.versionPaths;\n        return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));\n    }\n    function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {\n        var host = state.host, traceEnabled = state.traceEnabled;\n        var directoryExists = !onlyRecordFailures && ts.directoryProbablyExists(packageDirectory, host);\n        var packageJsonPath = ts.combinePaths(packageDirectory, \"package.json\");\n        if (directoryExists && host.fileExists(packageJsonPath)) {\n            var packageJsonContent = ts.readJson(packageJsonPath, host);\n            if (traceEnabled) {\n                trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath);\n            }\n            var versionPaths = readPackageJsonTypesVersionPaths(packageJsonContent, state);\n            return { packageDirectory: packageDirectory, packageJsonContent: packageJsonContent, versionPaths: versionPaths };\n        }\n        else {\n            if (directoryExists && traceEnabled) {\n                trace(host, ts.Diagnostics.File_0_does_not_exist, packageJsonPath);\n            }\n            // record package json as one of failed lookup locations - in the future if this file will appear it will invalidate resolution results\n            state.failedLookupLocations.push(packageJsonPath);\n        }\n    }\n    function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, jsonContent, versionPaths) {\n        var packageFile;\n        if (jsonContent) {\n            switch (extensions) {\n                case Extensions.JavaScript:\n                case Extensions.Json:\n                    packageFile = readPackageJsonMainField(jsonContent, candidate, state);\n                    break;\n                case Extensions.TypeScript:\n                    // When resolving typescript modules, try resolving using main field as well\n                    packageFile = readPackageJsonTypesFields(jsonContent, candidate, state) || readPackageJsonMainField(jsonContent, candidate, state);\n                    break;\n                case Extensions.DtsOnly:\n                    packageFile = readPackageJsonTypesFields(jsonContent, candidate, state);\n                    break;\n                case Extensions.TSConfig:\n                    packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state);\n                    break;\n                default:\n                    return ts.Debug.assertNever(extensions);\n            }\n        }\n        var loader = function (extensions, candidate, onlyRecordFailures, state) {\n            var fromFile = tryFile(candidate, onlyRecordFailures, state);\n            if (fromFile) {\n                var resolved = resolvedIfExtensionMatches(extensions, fromFile);\n                if (resolved) {\n                    return noPackageId(resolved);\n                }\n                if (state.traceEnabled) {\n                    trace(state.host, ts.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile);\n                }\n            }\n            // Even if extensions is DtsOnly, we can still look up a .ts file as a result of package.json \"types\"\n            var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions;\n            // Don't do package.json lookup recursively, because Node.js' package lookup doesn't.\n            return nodeLoadModuleByRelativeName(nextExtensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ false);\n        };\n        var onlyRecordFailuresForPackageFile = packageFile ? !ts.directoryProbablyExists(ts.getDirectoryPath(packageFile), state.host) : undefined;\n        var onlyRecordFailuresForIndex = onlyRecordFailures || !ts.directoryProbablyExists(candidate, state.host);\n        var indexPath = ts.combinePaths(candidate, extensions === Extensions.TSConfig ? \"tsconfig\" : \"index\");\n        if (versionPaths && (!packageFile || ts.containsPath(candidate, packageFile))) {\n            var moduleName = ts.getRelativePathFromDirectory(candidate, packageFile || indexPath, /*ignoreCase*/ false);\n            if (state.traceEnabled) {\n                trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, ts.version, moduleName);\n            }\n            var result = tryLoadModuleUsingPaths(extensions, moduleName, candidate, versionPaths.paths, loader, onlyRecordFailuresForPackageFile || onlyRecordFailuresForIndex, state);\n            if (result) {\n                return removeIgnoredPackageId(result.value);\n            }\n        }\n        // It won't have a `packageId` set, because we disabled `considerPackageJson`.\n        var packageFileResult = packageFile && removeIgnoredPackageId(loader(extensions, packageFile, onlyRecordFailuresForPackageFile, state));\n        if (packageFileResult)\n            return packageFileResult;\n        return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state);\n    }\n    /** Resolve from an arbitrarily specified file. Return `undefined` if it has an unsupported extension. */\n    function resolvedIfExtensionMatches(extensions, path) {\n        var ext = ts.tryGetExtensionFromPath(path);\n        return ext !== undefined && extensionIsOk(extensions, ext) ? { path: path, ext: ext } : undefined;\n    }\n    /** True if `extension` is one of the supported `extensions`. */\n    function extensionIsOk(extensions, extension) {\n        switch (extensions) {\n            case Extensions.JavaScript:\n                return extension === \".js\" /* Js */ || extension === \".jsx\" /* Jsx */;\n            case Extensions.TSConfig:\n            case Extensions.Json:\n                return extension === \".json\" /* Json */;\n            case Extensions.TypeScript:\n                return extension === \".ts\" /* Ts */ || extension === \".tsx\" /* Tsx */ || extension === \".d.ts\" /* Dts */;\n            case Extensions.DtsOnly:\n                return extension === \".d.ts\" /* Dts */;\n        }\n    }\n    /* @internal */\n    function parsePackageName(moduleName) {\n        var idx = moduleName.indexOf(ts.directorySeparator);\n        if (moduleName[0] === \"@\") {\n            idx = moduleName.indexOf(ts.directorySeparator, idx + 1);\n        }\n        return idx === -1 ? { packageName: moduleName, rest: \"\" } : { packageName: moduleName.slice(0, idx), rest: moduleName.slice(idx + 1) };\n    }\n    ts.parsePackageName = parsePackageName;\n    function loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, directory, state, cache, redirectedReference) {\n        return loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, /*typesScopeOnly*/ false, cache, redirectedReference);\n    }\n    function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, directory, state) {\n        // Extensions parameter here doesn't actually matter, because typesOnly ensures we're just doing @types lookup, which is always DtsOnly.\n        return loadModuleFromNearestNodeModulesDirectoryWorker(Extensions.DtsOnly, moduleName, directory, state, /*typesScopeOnly*/ true, /*cache*/ undefined, /*redirectedReference*/ undefined);\n    }\n    function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {\n        var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, redirectedReference);\n        return ts.forEachAncestorDirectory(ts.normalizeSlashes(directory), function (ancestorDirectory) {\n            if (ts.getBaseFileName(ancestorDirectory) !== \"node_modules\") {\n                var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state);\n                if (resolutionFromCache) {\n                    return resolutionFromCache;\n                }\n                return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, ancestorDirectory, state, typesScopeOnly));\n            }\n        });\n    }\n    function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, directory, state, typesScopeOnly) {\n        var nodeModulesFolder = ts.combinePaths(directory, \"node_modules\");\n        var nodeModulesFolderExists = ts.directoryProbablyExists(nodeModulesFolder, state.host);\n        if (!nodeModulesFolderExists && state.traceEnabled) {\n            trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder);\n        }\n        var packageResult = typesScopeOnly ? undefined : loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, state);\n        if (packageResult) {\n            return packageResult;\n        }\n        if (extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) {\n            var nodeModulesAtTypes_1 = ts.combinePaths(nodeModulesFolder, \"@types\");\n            var nodeModulesAtTypesExists = nodeModulesFolderExists;\n            if (nodeModulesFolderExists && !ts.directoryProbablyExists(nodeModulesAtTypes_1, state.host)) {\n                if (state.traceEnabled) {\n                    trace(state.host, ts.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesAtTypes_1);\n                }\n                nodeModulesAtTypesExists = false;\n            }\n            return loadModuleFromSpecificNodeModulesDirectory(Extensions.DtsOnly, mangleScopedPackageNameWithTrace(moduleName, state), nodeModulesAtTypes_1, nodeModulesAtTypesExists, state);\n        }\n    }\n    function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state) {\n        var candidate = ts.normalizePath(ts.combinePaths(nodeModulesDirectory, moduleName));\n        // First look for a nested package.json, as in `node_modules/foo/bar/package.json`.\n        var packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state);\n        if (packageInfo) {\n            var fromFile = loadModuleFromFile(extensions, candidate, !nodeModulesDirectoryExists, state);\n            if (fromFile) {\n                return noPackageId(fromFile);\n            }\n            var fromDirectory = loadNodeModuleFromDirectoryWorker(extensions, candidate, !nodeModulesDirectoryExists, state, packageInfo.packageJsonContent, packageInfo.versionPaths);\n            return withPackageId(packageInfo, fromDirectory);\n        }\n        var loader = function (extensions, candidate, onlyRecordFailures, state) {\n            var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||\n                loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);\n            return withPackageId(packageInfo, pathAndExtension);\n        };\n        var _a = parsePackageName(moduleName), packageName = _a.packageName, rest = _a.rest;\n        if (rest !== \"\") { // If \"rest\" is empty, we just did this search above.\n            var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);\n            // Don't use a \"types\" or \"main\" from here because we're not loading the root, but a subdirectory -- just here for the packageId and path mappings.\n            packageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);\n            if (packageInfo && packageInfo.versionPaths) {\n                if (state.traceEnabled) {\n                    trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.versionPaths.version, ts.version, rest);\n                }\n                var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);\n                var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.versionPaths.paths, loader, !packageDirectoryExists, state);\n                if (fromPaths) {\n                    return fromPaths.value;\n                }\n            }\n        }\n        return loader(extensions, candidate, !nodeModulesDirectoryExists, state);\n    }\n    function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, loader, onlyRecordFailures, state) {\n        var matchedPattern = ts.matchPatternOrExact(ts.getOwnKeys(paths), moduleName);\n        if (matchedPattern) {\n            var matchedStar_1 = ts.isString(matchedPattern) ? undefined : ts.matchedText(matchedPattern, moduleName);\n            var matchedPatternText = ts.isString(matchedPattern) ? matchedPattern : ts.patternText(matchedPattern);\n            if (state.traceEnabled) {\n                trace(state.host, ts.Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText);\n            }\n            var resolved = ts.forEach(paths[matchedPatternText], function (subst) {\n                var path = matchedStar_1 ? subst.replace(\"*\", matchedStar_1) : subst;\n                // When baseUrl is not specified, the command line parser resolves relative paths to the config file location.\n                var candidate = ts.normalizePath(ts.combinePaths(baseDirectory, path));\n                if (state.traceEnabled) {\n                    trace(state.host, ts.Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path);\n                }\n                // A path mapping may have an extension, in contrast to an import, which should omit it.\n                var extension = ts.tryGetExtensionFromPath(subst);\n                if (extension !== undefined) {\n                    var path_1 = tryFile(candidate, onlyRecordFailures, state);\n                    if (path_1 !== undefined) {\n                        return noPackageId({ path: path_1, ext: extension });\n                    }\n                }\n                return loader(extensions, candidate, onlyRecordFailures || !ts.directoryProbablyExists(ts.getDirectoryPath(candidate), state.host), state);\n            });\n            return { value: resolved };\n        }\n    }\n    /** Double underscores are used in DefinitelyTyped to delimit scoped packages. */\n    var mangledScopedPackageSeparator = \"__\";\n    /** For a scoped package, we must look in `@types/foo__bar` instead of `@types/@foo/bar`. */\n    function mangleScopedPackageNameWithTrace(packageName, state) {\n        var mangled = mangleScopedPackageName(packageName);\n        if (state.traceEnabled && mangled !== packageName) {\n            trace(state.host, ts.Diagnostics.Scoped_package_detected_looking_in_0, mangled);\n        }\n        return mangled;\n    }\n    /* @internal */\n    function getTypesPackageName(packageName) {\n        return \"@types/\" + mangleScopedPackageName(packageName);\n    }\n    ts.getTypesPackageName = getTypesPackageName;\n    /* @internal */\n    function mangleScopedPackageName(packageName) {\n        if (ts.startsWith(packageName, \"@\")) {\n            var replaceSlash = packageName.replace(ts.directorySeparator, mangledScopedPackageSeparator);\n            if (replaceSlash !== packageName) {\n                return replaceSlash.slice(1); // Take off the \"@\"\n            }\n        }\n        return packageName;\n    }\n    ts.mangleScopedPackageName = mangleScopedPackageName;\n    /* @internal */\n    function getPackageNameFromTypesPackageName(mangledName) {\n        var withoutAtTypePrefix = ts.removePrefix(mangledName, \"@types/\");\n        if (withoutAtTypePrefix !== mangledName) {\n            return unmangleScopedPackageName(withoutAtTypePrefix);\n        }\n        return mangledName;\n    }\n    ts.getPackageNameFromTypesPackageName = getPackageNameFromTypesPackageName;\n    /* @internal */\n    function unmangleScopedPackageName(typesPackageName) {\n        return ts.stringContains(typesPackageName, mangledScopedPackageSeparator) ?\n            \"@\" + typesPackageName.replace(mangledScopedPackageSeparator, ts.directorySeparator) :\n            typesPackageName;\n    }\n    ts.unmangleScopedPackageName = unmangleScopedPackageName;\n    function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, state) {\n        var result = cache && cache.get(containingDirectory);\n        if (result) {\n            if (state.traceEnabled) {\n                trace(state.host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory);\n            }\n            state.resultFromCache = result;\n            return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, originalPath: result.resolvedModule.originalPath || true, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } };\n        }\n    }\n    function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {\n        var traceEnabled = isTraceEnabled(compilerOptions, host);\n        var failedLookupLocations = [];\n        var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations };\n        var containingDirectory = ts.getDirectoryPath(containingFile);\n        var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript);\n        // No originalPath because classic resolution doesn't resolve realPath\n        return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations, state.resultFromCache);\n        function tryResolve(extensions) {\n            var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state);\n            if (resolvedUsingSettings) {\n                return { value: resolvedUsingSettings };\n            }\n            if (!ts.isExternalModuleNameRelative(moduleName)) {\n                var perModuleNameCache_1 = cache && cache.getOrCreateCacheForModuleName(moduleName, redirectedReference);\n                // Climb up parent directories looking for a module.\n                var resolved_3 = ts.forEachAncestorDirectory(containingDirectory, function (directory) {\n                    var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache_1, moduleName, directory, state);\n                    if (resolutionFromCache) {\n                        return resolutionFromCache;\n                    }\n                    var searchName = ts.normalizePath(ts.combinePaths(directory, moduleName));\n                    return toSearchResult(loadModuleFromFileNoPackageId(extensions, searchName, /*onlyRecordFailures*/ false, state));\n                });\n                if (resolved_3) {\n                    return resolved_3;\n                }\n                if (extensions === Extensions.TypeScript) {\n                    // If we didn't find the file normally, look it up in @types.\n                    return loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, containingDirectory, state);\n                }\n            }\n            else {\n                var candidate = ts.normalizePath(ts.combinePaths(containingDirectory, moduleName));\n                return toSearchResult(loadModuleFromFileNoPackageId(extensions, candidate, /*onlyRecordFailures*/ false, state));\n            }\n        }\n    }\n    ts.classicNameResolver = classicNameResolver;\n    /**\n     * A host may load a module from a global cache of typings.\n     * This is the minumum code needed to expose that functionality; the rest is in the host.\n     */\n    /* @internal */\n    function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache) {\n        var traceEnabled = isTraceEnabled(compilerOptions, host);\n        if (traceEnabled) {\n            trace(host, ts.Diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2, projectName, moduleName, globalCache);\n        }\n        var failedLookupLocations = [];\n        var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations };\n        var resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, /*typesScopeOnly*/ false);\n        return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations, state.resultFromCache);\n    }\n    ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache;\n    /**\n     * Wraps value to SearchResult.\n     * @returns undefined if value is undefined or { value } otherwise\n     */\n    function toSearchResult(value) {\n        return value !== undefined ? { value: value } : undefined;\n    }\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var ModuleInstanceState;\n    (function (ModuleInstanceState) {\n        ModuleInstanceState[ModuleInstanceState[\"NonInstantiated\"] = 0] = \"NonInstantiated\";\n        ModuleInstanceState[ModuleInstanceState[\"Instantiated\"] = 1] = \"Instantiated\";\n        ModuleInstanceState[ModuleInstanceState[\"ConstEnumOnly\"] = 2] = \"ConstEnumOnly\";\n    })(ModuleInstanceState = ts.ModuleInstanceState || (ts.ModuleInstanceState = {}));\n    function getModuleInstanceState(node, visited) {\n        if (node.body && !node.body.parent) {\n            // getModuleInstanceStateForAliasTarget needs to walk up the parent chain, so parent pointers must be set on this tree already\n            ts.setParent(node.body, node);\n            ts.setParentRecursive(node.body, /*incremental*/ false);\n        }\n        return node.body ? getModuleInstanceStateCached(node.body, visited) : 1 /* Instantiated */;\n    }\n    ts.getModuleInstanceState = getModuleInstanceState;\n    function getModuleInstanceStateCached(node, visited) {\n        if (visited === void 0) { visited = new ts.Map(); }\n        var nodeId = ts.getNodeId(node);\n        if (visited.has(nodeId)) {\n            return visited.get(nodeId) || 0 /* NonInstantiated */;\n        }\n        visited.set(nodeId, undefined);\n        var result = getModuleInstanceStateWorker(node, visited);\n        visited.set(nodeId, result);\n        return result;\n    }\n    function getModuleInstanceStateWorker(node, visited) {\n        // A module is uninstantiated if it contains only\n        switch (node.kind) {\n            // 1. interface declarations, type alias declarations\n            case 253 /* InterfaceDeclaration */:\n            case 254 /* TypeAliasDeclaration */:\n                return 0 /* NonInstantiated */;\n            // 2. const enum declarations\n            case 255 /* EnumDeclaration */:\n                if (ts.isEnumConst(node)) {\n                    return 2 /* ConstEnumOnly */;\n                }\n                break;\n            // 3. non-exported import declarations\n            case 261 /* ImportDeclaration */:\n            case 260 /* ImportEqualsDeclaration */:\n                if (!(ts.hasSyntacticModifier(node, 1 /* Export */))) {\n                    return 0 /* NonInstantiated */;\n                }\n                break;\n            // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain\n            case 267 /* ExportDeclaration */:\n                var exportDeclaration = node;\n                if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 268 /* NamedExports */) {\n                    var state = 0 /* NonInstantiated */;\n                    for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) {\n                        var specifier = _a[_i];\n                        var specifierState = getModuleInstanceStateForAliasTarget(specifier, visited);\n                        if (specifierState > state) {\n                            state = specifierState;\n                        }\n                        if (state === 1 /* Instantiated */) {\n                            return state;\n                        }\n                    }\n                    return state;\n                }\n                break;\n            // 5. other uninstantiated module declarations.\n            case 257 /* ModuleBlock */: {\n                var state_1 = 0 /* NonInstantiated */;\n                ts.forEachChild(node, function (n) {\n                    var childState = getModuleInstanceStateCached(n, visited);\n                    switch (childState) {\n                        case 0 /* NonInstantiated */:\n                            // child is non-instantiated - continue searching\n                            return;\n                        case 2 /* ConstEnumOnly */:\n                            // child is const enum only - record state and continue searching\n                            state_1 = 2 /* ConstEnumOnly */;\n                            return;\n                        case 1 /* Instantiated */:\n                            // child is instantiated - record state and stop\n                            state_1 = 1 /* Instantiated */;\n                            return true;\n                        default:\n                            ts.Debug.assertNever(childState);\n                    }\n                });\n                return state_1;\n            }\n            case 256 /* ModuleDeclaration */:\n                return getModuleInstanceState(node, visited);\n            case 78 /* Identifier */:\n                // Only jsdoc typedef definition can exist in jsdoc namespace, and it should\n                // be considered the same as type alias\n                if (node.isInJSDocNamespace) {\n                    return 0 /* NonInstantiated */;\n                }\n        }\n        return 1 /* Instantiated */;\n    }\n    function getModuleInstanceStateForAliasTarget(specifier, visited) {\n        var name = specifier.propertyName || specifier.name;\n        var p = specifier.parent;\n        while (p) {\n            if (ts.isBlock(p) || ts.isModuleBlock(p) || ts.isSourceFile(p)) {\n                var statements = p.statements;\n                var found = void 0;\n                for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) {\n                    var statement = statements_2[_i];\n                    if (ts.nodeHasName(statement, name)) {\n                        if (!statement.parent) {\n                            ts.setParent(statement, p);\n                            ts.setParentRecursive(statement, /*incremental*/ false);\n                        }\n                        var state = getModuleInstanceStateCached(statement, visited);\n                        if (found === undefined || state > found) {\n                            found = state;\n                        }\n                        if (found === 1 /* Instantiated */) {\n                            return found;\n                        }\n                    }\n                }\n                if (found !== undefined) {\n                    return found;\n                }\n            }\n            p = p.parent;\n        }\n        return 1 /* Instantiated */; // Couldn't locate, assume could refer to a value\n    }\n    var ContainerFlags;\n    (function (ContainerFlags) {\n        // The current node is not a container, and no container manipulation should happen before\n        // recursing into it.\n        ContainerFlags[ContainerFlags[\"None\"] = 0] = \"None\";\n        // The current node is a container.  It should be set as the current container (and block-\n        // container) before recursing into it.  The current node does not have locals.  Examples:\n        //\n        //      Classes, ObjectLiterals, TypeLiterals, Interfaces...\n        ContainerFlags[ContainerFlags[\"IsContainer\"] = 1] = \"IsContainer\";\n        // The current node is a block-scoped-container.  It should be set as the current block-\n        // container before recursing into it.  Examples:\n        //\n        //      Blocks (when not parented by functions), Catch clauses, For/For-in/For-of statements...\n        ContainerFlags[ContainerFlags[\"IsBlockScopedContainer\"] = 2] = \"IsBlockScopedContainer\";\n        // The current node is the container of a control flow path. The current control flow should\n        // be saved and restored, and a new control flow initialized within the container.\n        ContainerFlags[ContainerFlags[\"IsControlFlowContainer\"] = 4] = \"IsControlFlowContainer\";\n        ContainerFlags[ContainerFlags[\"IsFunctionLike\"] = 8] = \"IsFunctionLike\";\n        ContainerFlags[ContainerFlags[\"IsFunctionExpression\"] = 16] = \"IsFunctionExpression\";\n        ContainerFlags[ContainerFlags[\"HasLocals\"] = 32] = \"HasLocals\";\n        ContainerFlags[ContainerFlags[\"IsInterface\"] = 64] = \"IsInterface\";\n        ContainerFlags[ContainerFlags[\"IsObjectLiteralOrClassExpressionMethod\"] = 128] = \"IsObjectLiteralOrClassExpressionMethod\";\n    })(ContainerFlags || (ContainerFlags = {}));\n    function initFlowNode(node) {\n        ts.Debug.attachFlowNodeDebugInfo(node);\n        return node;\n    }\n    var binder = createBinder();\n    function bindSourceFile(file, options) {\n        ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"bind\" /* Bind */, \"bindSourceFile\", { path: file.path }, /*separateBeginAndEnd*/ true);\n        ts.performance.mark(\"beforeBind\");\n        ts.perfLogger.logStartBindFile(\"\" + file.fileName);\n        binder(file, options);\n        ts.perfLogger.logStopBindFile();\n        ts.performance.mark(\"afterBind\");\n        ts.performance.measure(\"Bind\", \"beforeBind\", \"afterBind\");\n        ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n    }\n    ts.bindSourceFile = bindSourceFile;\n    function createBinder() {\n        var file;\n        var options;\n        var languageVersion;\n        var parent;\n        var container;\n        var thisParentContainer; // Container one level up\n        var blockScopeContainer;\n        var lastContainer;\n        var delayedTypeAliases;\n        var seenThisKeyword;\n        // state used by control flow analysis\n        var currentFlow;\n        var currentBreakTarget;\n        var currentContinueTarget;\n        var currentReturnTarget;\n        var currentTrueTarget;\n        var currentFalseTarget;\n        var currentExceptionTarget;\n        var preSwitchCaseFlow;\n        var activeLabelList;\n        var hasExplicitReturn;\n        // state used for emit helpers\n        var emitFlags;\n        // If this file is an external module, then it is automatically in strict-mode according to\n        // ES6.  If it is not an external module, then we'll determine if it is in strict mode or\n        // not depending on if we see \"use strict\" in certain places or if we hit a class/namespace\n        // or if compiler options contain alwaysStrict.\n        var inStrictMode;\n        // If we are binding an assignment pattern, we will bind certain expressions differently.\n        var inAssignmentPattern = false;\n        var symbolCount = 0;\n        var Symbol;\n        var classifiableNames;\n        var unreachableFlow = { flags: 1 /* Unreachable */ };\n        var reportedUnreachableFlow = { flags: 1 /* Unreachable */ };\n        /**\n         * Inside the binder, we may create a diagnostic for an as-yet unbound node (with potentially no parent pointers, implying no accessible source file)\n         * If so, the node _must_ be in the current file (as that's the only way anything could have traversed to it to yield it as the error node)\n         * This version of `createDiagnosticForNode` uses the binder's context to account for this, and always yields correct diagnostics even in these situations.\n         */\n        function createDiagnosticForNode(node, message, arg0, arg1, arg2) {\n            return ts.createDiagnosticForNodeInSourceFile(ts.getSourceFileOfNode(node) || file, node, message, arg0, arg1, arg2);\n        }\n        function bindSourceFile(f, opts) {\n            file = f;\n            options = opts;\n            languageVersion = ts.getEmitScriptTarget(options);\n            inStrictMode = bindInStrictMode(file, opts);\n            classifiableNames = new ts.Set();\n            symbolCount = 0;\n            Symbol = ts.objectAllocator.getSymbolConstructor();\n            // Attach debugging information if necessary\n            ts.Debug.attachFlowNodeDebugInfo(unreachableFlow);\n            ts.Debug.attachFlowNodeDebugInfo(reportedUnreachableFlow);\n            if (!file.locals) {\n                bind(file);\n                file.symbolCount = symbolCount;\n                file.classifiableNames = classifiableNames;\n                delayedBindJSDocTypedefTag();\n            }\n            file = undefined;\n            options = undefined;\n            languageVersion = undefined;\n            parent = undefined;\n            container = undefined;\n            thisParentContainer = undefined;\n            blockScopeContainer = undefined;\n            lastContainer = undefined;\n            delayedTypeAliases = undefined;\n            seenThisKeyword = false;\n            currentFlow = undefined;\n            currentBreakTarget = undefined;\n            currentContinueTarget = undefined;\n            currentReturnTarget = undefined;\n            currentTrueTarget = undefined;\n            currentFalseTarget = undefined;\n            currentExceptionTarget = undefined;\n            activeLabelList = undefined;\n            hasExplicitReturn = false;\n            inAssignmentPattern = false;\n            emitFlags = 0 /* None */;\n        }\n        return bindSourceFile;\n        function bindInStrictMode(file, opts) {\n            if (ts.getStrictOptionValue(opts, \"alwaysStrict\") && !file.isDeclarationFile) {\n                // bind in strict mode source files with alwaysStrict option\n                return true;\n            }\n            else {\n                return !!file.externalModuleIndicator;\n            }\n        }\n        function createSymbol(flags, name) {\n            symbolCount++;\n            return new Symbol(flags, name);\n        }\n        function addDeclarationToSymbol(symbol, node, symbolFlags) {\n            symbol.flags |= symbolFlags;\n            node.symbol = symbol;\n            symbol.declarations = ts.appendIfUnique(symbol.declarations, node);\n            if (symbolFlags & (32 /* Class */ | 384 /* Enum */ | 1536 /* Module */ | 3 /* Variable */) && !symbol.exports) {\n                symbol.exports = ts.createSymbolTable();\n            }\n            if (symbolFlags & (32 /* Class */ | 64 /* Interface */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && !symbol.members) {\n                symbol.members = ts.createSymbolTable();\n            }\n            // On merge of const enum module with class or function, reset const enum only flag (namespaces will already recalculate)\n            if (symbol.constEnumOnlyModule && (symbol.flags & (16 /* Function */ | 32 /* Class */ | 256 /* RegularEnum */))) {\n                symbol.constEnumOnlyModule = false;\n            }\n            if (symbolFlags & 111551 /* Value */) {\n                ts.setValueDeclaration(symbol, node);\n            }\n        }\n        // Should not be called on a declaration with a computed property name,\n        // unless it is a well known Symbol.\n        function getDeclarationName(node) {\n            if (node.kind === 266 /* ExportAssignment */) {\n                return node.isExportEquals ? \"export=\" /* ExportEquals */ : \"default\" /* Default */;\n            }\n            var name = ts.getNameOfDeclaration(node);\n            if (name) {\n                if (ts.isAmbientModule(node)) {\n                    var moduleName = ts.getTextOfIdentifierOrLiteral(name);\n                    return (ts.isGlobalScopeAugmentation(node) ? \"__global\" : \"\\\"\" + moduleName + \"\\\"\");\n                }\n                if (name.kind === 158 /* ComputedPropertyName */) {\n                    var nameExpression = name.expression;\n                    // treat computed property names where expression is string/numeric literal as just string/numeric literal\n                    if (ts.isStringOrNumericLiteralLike(nameExpression)) {\n                        return ts.escapeLeadingUnderscores(nameExpression.text);\n                    }\n                    if (ts.isSignedNumericLiteral(nameExpression)) {\n                        return ts.tokenToString(nameExpression.operator) + nameExpression.operand.text;\n                    }\n                    ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression));\n                    return ts.getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name));\n                }\n                if (ts.isWellKnownSymbolSyntactically(name)) {\n                    return ts.getPropertyNameForKnownSymbolName(ts.idText(name.name));\n                }\n                if (ts.isPrivateIdentifier(name)) {\n                    // containingClass exists because private names only allowed inside classes\n                    var containingClass = ts.getContainingClass(node);\n                    if (!containingClass) {\n                        // we can get here in cases where there is already a parse error.\n                        return undefined;\n                    }\n                    var containingClassSymbol = containingClass.symbol;\n                    return ts.getSymbolNameForPrivateIdentifier(containingClassSymbol, name.escapedText);\n                }\n                return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined;\n            }\n            switch (node.kind) {\n                case 166 /* Constructor */:\n                    return \"__constructor\" /* Constructor */;\n                case 174 /* FunctionType */:\n                case 169 /* CallSignature */:\n                case 313 /* JSDocSignature */:\n                    return \"__call\" /* Call */;\n                case 175 /* ConstructorType */:\n                case 170 /* ConstructSignature */:\n                    return \"__new\" /* New */;\n                case 171 /* IndexSignature */:\n                    return \"__index\" /* Index */;\n                case 267 /* ExportDeclaration */:\n                    return \"__export\" /* ExportStar */;\n                case 297 /* SourceFile */:\n                    // json file should behave as\n                    // module.exports = ...\n                    return \"export=\" /* ExportEquals */;\n                case 216 /* BinaryExpression */:\n                    if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) {\n                        // module.exports = ...\n                        return \"export=\" /* ExportEquals */;\n                    }\n                    ts.Debug.fail(\"Unknown binary declaration kind\");\n                    break;\n                case 308 /* JSDocFunctionType */:\n                    return (ts.isJSDocConstructSignature(node) ? \"__new\" /* New */ : \"__call\" /* Call */);\n                case 160 /* Parameter */:\n                    // Parameters with names are handled at the top of this function.  Parameters\n                    // without names can only come from JSDocFunctionTypes.\n                    ts.Debug.assert(node.parent.kind === 308 /* JSDocFunctionType */, \"Impossible parameter parent kind\", function () { return \"parent is: \" + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + \", expected JSDocFunctionType\"; });\n                    var functionType = node.parent;\n                    var index = functionType.parameters.indexOf(node);\n                    return \"arg\" + index;\n            }\n        }\n        function getDisplayName(node) {\n            return ts.isNamedDeclaration(node) ? ts.declarationNameToString(node.name) : ts.unescapeLeadingUnderscores(ts.Debug.checkDefined(getDeclarationName(node)));\n        }\n        /**\n         * Declares a Symbol for the node and adds it to symbols. Reports errors for conflicting identifier names.\n         * @param symbolTable - The symbol table which node will be added to.\n         * @param parent - node's parent declaration.\n         * @param node - The declaration to be added to the symbol table\n         * @param includes - The SymbolFlags that node has in addition to its declaration type (eg: export, ambient, etc.)\n         * @param excludes - The flags which node cannot be declared alongside in a symbol table. Used to report forbidden declarations.\n         */\n        function declareSymbol(symbolTable, parent, node, includes, excludes, isReplaceableByMethod) {\n            ts.Debug.assert(!ts.hasDynamicName(node));\n            var isDefaultExport = ts.hasSyntacticModifier(node, 512 /* Default */) || ts.isExportSpecifier(node) && node.name.escapedText === \"default\";\n            // The exported symbol for an export default function/class node is always named \"default\"\n            var name = isDefaultExport && parent ? \"default\" /* Default */ : getDeclarationName(node);\n            var symbol;\n            if (name === undefined) {\n                symbol = createSymbol(0 /* None */, \"__missing\" /* Missing */);\n            }\n            else {\n                // Check and see if the symbol table already has a symbol with this name.  If not,\n                // create a new symbol with this name and add it to the table.  Note that we don't\n                // give the new symbol any flags *yet*.  This ensures that it will not conflict\n                // with the 'excludes' flags we pass in.\n                //\n                // If we do get an existing symbol, see if it conflicts with the new symbol we're\n                // creating.  For example, a 'var' symbol and a 'class' symbol will conflict within\n                // the same symbol table.  If we have a conflict, report the issue on each\n                // declaration we have for this symbol, and then create a new symbol for this\n                // declaration.\n                //\n                // Note that when properties declared in Javascript constructors\n                // (marked by isReplaceableByMethod) conflict with another symbol, the property loses.\n                // Always. This allows the common Javascript pattern of overwriting a prototype method\n                // with an bound instance method of the same type: `this.method = this.method.bind(this)`\n                //\n                // If we created a new symbol, either because we didn't have a symbol with this name\n                // in the symbol table, or we conflicted with an existing symbol, then just add this\n                // node as the sole declaration of the new symbol.\n                //\n                // Otherwise, we'll be merging into a compatible existing symbol (for example when\n                // you have multiple 'vars' with the same name in the same container).  In this case\n                // just add this node into the declarations list of the symbol.\n                symbol = symbolTable.get(name);\n                if (includes & 2885600 /* Classifiable */) {\n                    classifiableNames.add(name);\n                }\n                if (!symbol) {\n                    symbolTable.set(name, symbol = createSymbol(0 /* None */, name));\n                    if (isReplaceableByMethod)\n                        symbol.isReplaceableByMethod = true;\n                }\n                else if (isReplaceableByMethod && !symbol.isReplaceableByMethod) {\n                    // A symbol already exists, so don't add this as a declaration.\n                    return symbol;\n                }\n                else if (symbol.flags & excludes) {\n                    if (symbol.isReplaceableByMethod) {\n                        // Javascript constructor-declared symbols can be discarded in favor of\n                        // prototype symbols like methods.\n                        symbolTable.set(name, symbol = createSymbol(0 /* None */, name));\n                    }\n                    else if (!(includes & 3 /* Variable */ && symbol.flags & 67108864 /* Assignment */)) {\n                        // Assignment declarations are allowed to merge with variables, no matter what other flags they have.\n                        if (ts.isNamedDeclaration(node)) {\n                            ts.setParent(node.name, node);\n                        }\n                        // Report errors every position with duplicate declaration\n                        // Report errors on previous encountered declarations\n                        var message_1 = symbol.flags & 2 /* BlockScopedVariable */\n                            ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0\n                            : ts.Diagnostics.Duplicate_identifier_0;\n                        var messageNeedsName_1 = true;\n                        if (symbol.flags & 384 /* Enum */ || includes & 384 /* Enum */) {\n                            message_1 = ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations;\n                            messageNeedsName_1 = false;\n                        }\n                        var multipleDefaultExports_1 = false;\n                        if (ts.length(symbol.declarations)) {\n                            // If the current node is a default export of some sort, then check if\n                            // there are any other default exports that we need to error on.\n                            // We'll know whether we have other default exports depending on if `symbol` already has a declaration list set.\n                            if (isDefaultExport) {\n                                message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports;\n                                messageNeedsName_1 = false;\n                                multipleDefaultExports_1 = true;\n                            }\n                            else {\n                                // This is to properly report an error in the case \"export default { }\" is after export default of class declaration or function declaration.\n                                // Error on multiple export default in the following case:\n                                // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default\n                                // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers)\n                                if (symbol.declarations && symbol.declarations.length &&\n                                    (node.kind === 266 /* ExportAssignment */ && !node.isExportEquals)) {\n                                    message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports;\n                                    messageNeedsName_1 = false;\n                                    multipleDefaultExports_1 = true;\n                                }\n                            }\n                        }\n                        var relatedInformation_1 = [];\n                        if (ts.isTypeAliasDeclaration(node) && ts.nodeIsMissing(node.type) && ts.hasSyntacticModifier(node, 1 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) {\n                            // export type T; - may have meant export type { T }?\n                            relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, \"export type { \" + ts.unescapeLeadingUnderscores(node.name.escapedText) + \" }\"));\n                        }\n                        var declarationName_1 = ts.getNameOfDeclaration(node) || node;\n                        ts.forEach(symbol.declarations, function (declaration, index) {\n                            var decl = ts.getNameOfDeclaration(declaration) || declaration;\n                            var diag = createDiagnosticForNode(decl, message_1, messageNeedsName_1 ? getDisplayName(declaration) : undefined);\n                            file.bindDiagnostics.push(multipleDefaultExports_1 ? ts.addRelatedInfo(diag, createDiagnosticForNode(declarationName_1, index === 0 ? ts.Diagnostics.Another_export_default_is_here : ts.Diagnostics.and_here)) : diag);\n                            if (multipleDefaultExports_1) {\n                                relatedInformation_1.push(createDiagnosticForNode(decl, ts.Diagnostics.The_first_export_default_is_here));\n                            }\n                        });\n                        var diag = createDiagnosticForNode(declarationName_1, message_1, messageNeedsName_1 ? getDisplayName(node) : undefined);\n                        file.bindDiagnostics.push(ts.addRelatedInfo.apply(void 0, __spreadArray([diag], relatedInformation_1)));\n                        symbol = createSymbol(0 /* None */, name);\n                    }\n                }\n            }\n            addDeclarationToSymbol(symbol, node, includes);\n            if (symbol.parent) {\n                ts.Debug.assert(symbol.parent === parent, \"Existing symbol parent should match new one\");\n            }\n            else {\n                symbol.parent = parent;\n            }\n            return symbol;\n        }\n        function declareModuleMember(node, symbolFlags, symbolExcludes) {\n            var hasExportModifier = !!(ts.getCombinedModifierFlags(node) & 1 /* Export */) || jsdocTreatAsExported(node);\n            if (symbolFlags & 2097152 /* Alias */) {\n                if (node.kind === 270 /* ExportSpecifier */ || (node.kind === 260 /* ImportEqualsDeclaration */ && hasExportModifier)) {\n                    return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);\n                }\n                else {\n                    return declareSymbol(container.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes);\n                }\n            }\n            else {\n                // Exported module members are given 2 symbols: A local symbol that is classified with an ExportValue flag,\n                // and an associated export symbol with all the correct flags set on it. There are 2 main reasons:\n                //\n                //   1. We treat locals and exports of the same name as mutually exclusive within a container.\n                //      That means the binder will issue a Duplicate Identifier error if you mix locals and exports\n                //      with the same name in the same container.\n                //      TODO: Make this a more specific error and decouple it from the exclusion logic.\n                //   2. When we checkIdentifier in the checker, we set its resolved symbol to the local symbol,\n                //      but return the export symbol (by calling getExportSymbolOfValueSymbolIfExported). That way\n                //      when the emitter comes back to it, it knows not to qualify the name if it was found in a containing scope.\n                // NOTE: Nested ambient modules always should go to to 'locals' table to prevent their automatic merge\n                //       during global merging in the checker. Why? The only case when ambient module is permitted inside another module is module augmentation\n                //       and this case is specially handled. Module augmentations should only be merged with original module definition\n                //       and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed.\n                if (ts.isJSDocTypeAlias(node))\n                    ts.Debug.assert(ts.isInJSFile(node)); // We shouldn't add symbols for JSDoc nodes if not in a JS file.\n                if (!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 64 /* ExportContext */)) {\n                    if (!container.locals || (ts.hasSyntacticModifier(node, 512 /* Default */) && !getDeclarationName(node))) {\n                        return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); // No local symbol for an unnamed default!\n                    }\n                    var exportKind = symbolFlags & 111551 /* Value */ ? 1048576 /* ExportValue */ : 0;\n                    var local = declareSymbol(container.locals, /*parent*/ undefined, node, exportKind, symbolExcludes);\n                    local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);\n                    node.localSymbol = local;\n                    return local;\n                }\n                else {\n                    return declareSymbol(container.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes);\n                }\n            }\n        }\n        function jsdocTreatAsExported(node) {\n            if (node.parent && ts.isModuleDeclaration(node)) {\n                node = node.parent;\n            }\n            if (!ts.isJSDocTypeAlias(node))\n                return false;\n            // jsdoc typedef handling is a bit of a doozy, but to summarize, treat the typedef as exported if:\n            // 1. It has an explicit name (since by default typedefs are always directly exported, either at the top level or in a container), or\n            if (!ts.isJSDocEnumTag(node) && !!node.fullName)\n                return true;\n            // 2. The thing a nameless typedef pulls its name from is implicitly a direct export (either by assignment or actual export flag).\n            var declName = ts.getNameOfDeclaration(node);\n            if (!declName)\n                return false;\n            if (ts.isPropertyAccessEntityNameExpression(declName.parent) && isTopLevelNamespaceAssignment(declName.parent))\n                return true;\n            if (ts.isDeclaration(declName.parent) && ts.getCombinedModifierFlags(declName.parent) & 1 /* Export */)\n                return true;\n            // This could potentially be simplified by having `delayedBindJSDocTypedefTag` pass in an override for `hasExportModifier`, since it should\n            // already have calculated and branched on most of this.\n            return false;\n        }\n        // All container nodes are kept on a linked list in declaration order. This list is used by\n        // the getLocalNameOfContainer function in the type checker to validate that the local name\n        // used for a container is unique.\n        function bindContainer(node, containerFlags) {\n            // Before we recurse into a node's children, we first save the existing parent, container\n            // and block-container.  Then after we pop out of processing the children, we restore\n            // these saved values.\n            var saveContainer = container;\n            var saveThisParentContainer = thisParentContainer;\n            var savedBlockScopeContainer = blockScopeContainer;\n            // Depending on what kind of node this is, we may have to adjust the current container\n            // and block-container.   If the current node is a container, then it is automatically\n            // considered the current block-container as well.  Also, for containers that we know\n            // may contain locals, we eagerly initialize the .locals field. We do this because\n            // it's highly likely that the .locals will be needed to place some child in (for example,\n            // a parameter, or variable declaration).\n            //\n            // However, we do not proactively create the .locals for block-containers because it's\n            // totally normal and common for block-containers to never actually have a block-scoped\n            // variable in them.  We don't want to end up allocating an object for every 'block' we\n            // run into when most of them won't be necessary.\n            //\n            // Finally, if this is a block-container, then we clear out any existing .locals object\n            // it may contain within it.  This happens in incremental scenarios.  Because we can be\n            // reusing a node from a previous compilation, that node may have had 'locals' created\n            // for it.  We must clear this so we don't accidentally move any stale data forward from\n            // a previous compilation.\n            if (containerFlags & 1 /* IsContainer */) {\n                if (node.kind !== 209 /* ArrowFunction */) {\n                    thisParentContainer = container;\n                }\n                container = blockScopeContainer = node;\n                if (containerFlags & 32 /* HasLocals */) {\n                    container.locals = ts.createSymbolTable();\n                }\n                addToContainerChain(container);\n            }\n            else if (containerFlags & 2 /* IsBlockScopedContainer */) {\n                blockScopeContainer = node;\n                blockScopeContainer.locals = undefined;\n            }\n            if (containerFlags & 4 /* IsControlFlowContainer */) {\n                var saveCurrentFlow = currentFlow;\n                var saveBreakTarget = currentBreakTarget;\n                var saveContinueTarget = currentContinueTarget;\n                var saveReturnTarget = currentReturnTarget;\n                var saveExceptionTarget = currentExceptionTarget;\n                var saveActiveLabelList = activeLabelList;\n                var saveHasExplicitReturn = hasExplicitReturn;\n                var isIIFE = containerFlags & 16 /* IsFunctionExpression */ && !ts.hasSyntacticModifier(node, 256 /* Async */) &&\n                    !node.asteriskToken && !!ts.getImmediatelyInvokedFunctionExpression(node);\n                // A non-async, non-generator IIFE is considered part of the containing control flow. Return statements behave\n                // similarly to break statements that exit to a label just past the statement body.\n                if (!isIIFE) {\n                    currentFlow = initFlowNode({ flags: 2 /* Start */ });\n                    if (containerFlags & (16 /* IsFunctionExpression */ | 128 /* IsObjectLiteralOrClassExpressionMethod */)) {\n                        currentFlow.node = node;\n                    }\n                }\n                // We create a return control flow graph for IIFEs and constructors. For constructors\n                // we use the return control flow graph in strict property initialization checks.\n                currentReturnTarget = isIIFE || node.kind === 166 /* Constructor */ || (ts.isInJSFile(node) && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */)) ? createBranchLabel() : undefined;\n                currentExceptionTarget = undefined;\n                currentBreakTarget = undefined;\n                currentContinueTarget = undefined;\n                activeLabelList = undefined;\n                hasExplicitReturn = false;\n                bindChildren(node);\n                // Reset all reachability check related flags on node (for incremental scenarios)\n                node.flags &= ~2816 /* ReachabilityAndEmitFlags */;\n                if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && ts.nodeIsPresent(node.body)) {\n                    node.flags |= 256 /* HasImplicitReturn */;\n                    if (hasExplicitReturn)\n                        node.flags |= 512 /* HasExplicitReturn */;\n                    node.endFlowNode = currentFlow;\n                }\n                if (node.kind === 297 /* SourceFile */) {\n                    node.flags |= emitFlags;\n                }\n                if (currentReturnTarget) {\n                    addAntecedent(currentReturnTarget, currentFlow);\n                    currentFlow = finishFlowLabel(currentReturnTarget);\n                    if (node.kind === 166 /* Constructor */ || (ts.isInJSFile(node) && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */))) {\n                        node.returnFlowNode = currentFlow;\n                    }\n                }\n                if (!isIIFE) {\n                    currentFlow = saveCurrentFlow;\n                }\n                currentBreakTarget = saveBreakTarget;\n                currentContinueTarget = saveContinueTarget;\n                currentReturnTarget = saveReturnTarget;\n                currentExceptionTarget = saveExceptionTarget;\n                activeLabelList = saveActiveLabelList;\n                hasExplicitReturn = saveHasExplicitReturn;\n            }\n            else if (containerFlags & 64 /* IsInterface */) {\n                seenThisKeyword = false;\n                bindChildren(node);\n                node.flags = seenThisKeyword ? node.flags | 128 /* ContainsThis */ : node.flags & ~128 /* ContainsThis */;\n            }\n            else {\n                bindChildren(node);\n            }\n            container = saveContainer;\n            thisParentContainer = saveThisParentContainer;\n            blockScopeContainer = savedBlockScopeContainer;\n        }\n        function bindEachFunctionsFirst(nodes) {\n            bindEach(nodes, function (n) { return n.kind === 251 /* FunctionDeclaration */ ? bind(n) : undefined; });\n            bindEach(nodes, function (n) { return n.kind !== 251 /* FunctionDeclaration */ ? bind(n) : undefined; });\n        }\n        function bindEach(nodes, bindFunction) {\n            if (bindFunction === void 0) { bindFunction = bind; }\n            if (nodes === undefined) {\n                return;\n            }\n            ts.forEach(nodes, bindFunction);\n        }\n        function bindEachChild(node) {\n            ts.forEachChild(node, bind, bindEach);\n        }\n        function bindChildren(node) {\n            var saveInAssignmentPattern = inAssignmentPattern;\n            // Most nodes aren't valid in an assignment pattern, so we clear the value here\n            // and set it before we descend into nodes that could actually be part of an assignment pattern.\n            inAssignmentPattern = false;\n            if (checkUnreachable(node)) {\n                bindEachChild(node);\n                bindJSDoc(node);\n                inAssignmentPattern = saveInAssignmentPattern;\n                return;\n            }\n            if (node.kind >= 232 /* FirstStatement */ && node.kind <= 248 /* LastStatement */ && !options.allowUnreachableCode) {\n                node.flowNode = currentFlow;\n            }\n            switch (node.kind) {\n                case 236 /* WhileStatement */:\n                    bindWhileStatement(node);\n                    break;\n                case 235 /* DoStatement */:\n                    bindDoStatement(node);\n                    break;\n                case 237 /* ForStatement */:\n                    bindForStatement(node);\n                    break;\n                case 238 /* ForInStatement */:\n                case 239 /* ForOfStatement */:\n                    bindForInOrForOfStatement(node);\n                    break;\n                case 234 /* IfStatement */:\n                    bindIfStatement(node);\n                    break;\n                case 242 /* ReturnStatement */:\n                case 246 /* ThrowStatement */:\n                    bindReturnOrThrow(node);\n                    break;\n                case 241 /* BreakStatement */:\n                case 240 /* ContinueStatement */:\n                    bindBreakOrContinueStatement(node);\n                    break;\n                case 247 /* TryStatement */:\n                    bindTryStatement(node);\n                    break;\n                case 244 /* SwitchStatement */:\n                    bindSwitchStatement(node);\n                    break;\n                case 258 /* CaseBlock */:\n                    bindCaseBlock(node);\n                    break;\n                case 284 /* CaseClause */:\n                    bindCaseClause(node);\n                    break;\n                case 233 /* ExpressionStatement */:\n                    bindExpressionStatement(node);\n                    break;\n                case 245 /* LabeledStatement */:\n                    bindLabeledStatement(node);\n                    break;\n                case 214 /* PrefixUnaryExpression */:\n                    bindPrefixUnaryExpressionFlow(node);\n                    break;\n                case 215 /* PostfixUnaryExpression */:\n                    bindPostfixUnaryExpressionFlow(node);\n                    break;\n                case 216 /* BinaryExpression */:\n                    if (ts.isDestructuringAssignment(node)) {\n                        // Carry over whether we are in an assignment pattern to\n                        // binary expressions that could actually be an initializer\n                        inAssignmentPattern = saveInAssignmentPattern;\n                        bindDestructuringAssignmentFlow(node);\n                        return;\n                    }\n                    bindBinaryExpressionFlow(node);\n                    break;\n                case 210 /* DeleteExpression */:\n                    bindDeleteExpressionFlow(node);\n                    break;\n                case 217 /* ConditionalExpression */:\n                    bindConditionalExpressionFlow(node);\n                    break;\n                case 249 /* VariableDeclaration */:\n                    bindVariableDeclarationFlow(node);\n                    break;\n                case 201 /* PropertyAccessExpression */:\n                case 202 /* ElementAccessExpression */:\n                    bindAccessExpressionFlow(node);\n                    break;\n                case 203 /* CallExpression */:\n                    bindCallExpressionFlow(node);\n                    break;\n                case 225 /* NonNullExpression */:\n                    bindNonNullExpressionFlow(node);\n                    break;\n                case 331 /* JSDocTypedefTag */:\n                case 324 /* JSDocCallbackTag */:\n                case 325 /* JSDocEnumTag */:\n                    bindJSDocTypeAlias(node);\n                    break;\n                // In source files and blocks, bind functions first to match hoisting that occurs at runtime\n                case 297 /* SourceFile */: {\n                    bindEachFunctionsFirst(node.statements);\n                    bind(node.endOfFileToken);\n                    break;\n                }\n                case 230 /* Block */:\n                case 257 /* ModuleBlock */:\n                    bindEachFunctionsFirst(node.statements);\n                    break;\n                case 198 /* BindingElement */:\n                    bindBindingElementFlow(node);\n                    break;\n                case 200 /* ObjectLiteralExpression */:\n                case 199 /* ArrayLiteralExpression */:\n                case 288 /* PropertyAssignment */:\n                case 220 /* SpreadElement */:\n                    // Carry over whether we are in an assignment pattern of Object and Array literals\n                    // as well as their children that are valid assignment targets.\n                    inAssignmentPattern = saveInAssignmentPattern;\n                // falls through\n                default:\n                    bindEachChild(node);\n                    break;\n            }\n            bindJSDoc(node);\n            inAssignmentPattern = saveInAssignmentPattern;\n        }\n        function isNarrowingExpression(expr) {\n            switch (expr.kind) {\n                case 78 /* Identifier */:\n                case 79 /* PrivateIdentifier */:\n                case 107 /* ThisKeyword */:\n                case 201 /* PropertyAccessExpression */:\n                case 202 /* ElementAccessExpression */:\n                    return containsNarrowableReference(expr);\n                case 203 /* CallExpression */:\n                    return hasNarrowableArgument(expr);\n                case 207 /* ParenthesizedExpression */:\n                case 225 /* NonNullExpression */:\n                    return isNarrowingExpression(expr.expression);\n                case 216 /* BinaryExpression */:\n                    return isNarrowingBinaryExpression(expr);\n                case 214 /* PrefixUnaryExpression */:\n                    return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand);\n                case 211 /* TypeOfExpression */:\n                    return isNarrowingExpression(expr.expression);\n            }\n            return false;\n        }\n        function isNarrowableReference(expr) {\n            return expr.kind === 78 /* Identifier */ || expr.kind === 79 /* PrivateIdentifier */ || expr.kind === 107 /* ThisKeyword */ || expr.kind === 105 /* SuperKeyword */ ||\n                (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) ||\n                ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right) ||\n                ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression) ||\n                ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);\n        }\n        function containsNarrowableReference(expr) {\n            return isNarrowableReference(expr) || ts.isOptionalChain(expr) && containsNarrowableReference(expr.expression);\n        }\n        function hasNarrowableArgument(expr) {\n            if (expr.arguments) {\n                for (var _i = 0, _a = expr.arguments; _i < _a.length; _i++) {\n                    var argument = _a[_i];\n                    if (containsNarrowableReference(argument)) {\n                        return true;\n                    }\n                }\n            }\n            if (expr.expression.kind === 201 /* PropertyAccessExpression */ &&\n                containsNarrowableReference(expr.expression.expression)) {\n                return true;\n            }\n            return false;\n        }\n        function isNarrowingTypeofOperands(expr1, expr2) {\n            return ts.isTypeOfExpression(expr1) && isNarrowableOperand(expr1.expression) && ts.isStringLiteralLike(expr2);\n        }\n        function isNarrowableInOperands(left, right) {\n            return ts.isStringLiteralLike(left) && isNarrowingExpression(right);\n        }\n        function isNarrowingBinaryExpression(expr) {\n            switch (expr.operatorToken.kind) {\n                case 62 /* EqualsToken */:\n                case 74 /* BarBarEqualsToken */:\n                case 75 /* AmpersandAmpersandEqualsToken */:\n                case 76 /* QuestionQuestionEqualsToken */:\n                    return containsNarrowableReference(expr.left);\n                case 34 /* EqualsEqualsToken */:\n                case 35 /* ExclamationEqualsToken */:\n                case 36 /* EqualsEqualsEqualsToken */:\n                case 37 /* ExclamationEqualsEqualsToken */:\n                    return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) ||\n                        isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right);\n                case 101 /* InstanceOfKeyword */:\n                    return isNarrowableOperand(expr.left);\n                case 100 /* InKeyword */:\n                    return isNarrowableInOperands(expr.left, expr.right);\n                case 27 /* CommaToken */:\n                    return isNarrowingExpression(expr.right);\n            }\n            return false;\n        }\n        function isNarrowableOperand(expr) {\n            switch (expr.kind) {\n                case 207 /* ParenthesizedExpression */:\n                    return isNarrowableOperand(expr.expression);\n                case 216 /* BinaryExpression */:\n                    switch (expr.operatorToken.kind) {\n                        case 62 /* EqualsToken */:\n                            return isNarrowableOperand(expr.left);\n                        case 27 /* CommaToken */:\n                            return isNarrowableOperand(expr.right);\n                    }\n            }\n            return containsNarrowableReference(expr);\n        }\n        function createBranchLabel() {\n            return initFlowNode({ flags: 4 /* BranchLabel */, antecedents: undefined });\n        }\n        function createLoopLabel() {\n            return initFlowNode({ flags: 8 /* LoopLabel */, antecedents: undefined });\n        }\n        function createReduceLabel(target, antecedents, antecedent) {\n            return initFlowNode({ flags: 1024 /* ReduceLabel */, target: target, antecedents: antecedents, antecedent: antecedent });\n        }\n        function setFlowNodeReferenced(flow) {\n            // On first reference we set the Referenced flag, thereafter we set the Shared flag\n            flow.flags |= flow.flags & 2048 /* Referenced */ ? 4096 /* Shared */ : 2048 /* Referenced */;\n        }\n        function addAntecedent(label, antecedent) {\n            if (!(antecedent.flags & 1 /* Unreachable */) && !ts.contains(label.antecedents, antecedent)) {\n                (label.antecedents || (label.antecedents = [])).push(antecedent);\n                setFlowNodeReferenced(antecedent);\n            }\n        }\n        function createFlowCondition(flags, antecedent, expression) {\n            if (antecedent.flags & 1 /* Unreachable */) {\n                return antecedent;\n            }\n            if (!expression) {\n                return flags & 32 /* TrueCondition */ ? antecedent : unreachableFlow;\n            }\n            if ((expression.kind === 109 /* TrueKeyword */ && flags & 64 /* FalseCondition */ ||\n                expression.kind === 94 /* FalseKeyword */ && flags & 32 /* TrueCondition */) &&\n                !ts.isExpressionOfOptionalChainRoot(expression) && !ts.isNullishCoalesce(expression.parent)) {\n                return unreachableFlow;\n            }\n            if (!isNarrowingExpression(expression)) {\n                return antecedent;\n            }\n            setFlowNodeReferenced(antecedent);\n            return initFlowNode({ flags: flags, antecedent: antecedent, node: expression });\n        }\n        function createFlowSwitchClause(antecedent, switchStatement, clauseStart, clauseEnd) {\n            setFlowNodeReferenced(antecedent);\n            return initFlowNode({ flags: 128 /* SwitchClause */, antecedent: antecedent, switchStatement: switchStatement, clauseStart: clauseStart, clauseEnd: clauseEnd });\n        }\n        function createFlowMutation(flags, antecedent, node) {\n            setFlowNodeReferenced(antecedent);\n            var result = initFlowNode({ flags: flags, antecedent: antecedent, node: node });\n            if (currentExceptionTarget) {\n                addAntecedent(currentExceptionTarget, result);\n            }\n            return result;\n        }\n        function createFlowCall(antecedent, node) {\n            setFlowNodeReferenced(antecedent);\n            return initFlowNode({ flags: 512 /* Call */, antecedent: antecedent, node: node });\n        }\n        function finishFlowLabel(flow) {\n            var antecedents = flow.antecedents;\n            if (!antecedents) {\n                return unreachableFlow;\n            }\n            if (antecedents.length === 1) {\n                return antecedents[0];\n            }\n            return flow;\n        }\n        function isStatementCondition(node) {\n            var parent = node.parent;\n            switch (parent.kind) {\n                case 234 /* IfStatement */:\n                case 236 /* WhileStatement */:\n                case 235 /* DoStatement */:\n                    return parent.expression === node;\n                case 237 /* ForStatement */:\n                case 217 /* ConditionalExpression */:\n                    return parent.condition === node;\n            }\n            return false;\n        }\n        function isLogicalExpression(node) {\n            while (true) {\n                if (node.kind === 207 /* ParenthesizedExpression */) {\n                    node = node.expression;\n                }\n                else if (node.kind === 214 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) {\n                    node = node.operand;\n                }\n                else {\n                    return node.kind === 216 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ ||\n                        node.operatorToken.kind === 56 /* BarBarToken */ ||\n                        node.operatorToken.kind === 60 /* QuestionQuestionToken */);\n                }\n            }\n        }\n        function isLogicalAssignmentExpression(node) {\n            node = ts.skipParentheses(node);\n            return ts.isBinaryExpression(node) && ts.isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind);\n        }\n        function isTopLevelLogicalExpression(node) {\n            while (ts.isParenthesizedExpression(node.parent) ||\n                ts.isPrefixUnaryExpression(node.parent) && node.parent.operator === 53 /* ExclamationToken */) {\n                node = node.parent;\n            }\n            return !isStatementCondition(node) &&\n                !isLogicalAssignmentExpression(node.parent) &&\n                !isLogicalExpression(node.parent) &&\n                !(ts.isOptionalChain(node.parent) && node.parent.expression === node);\n        }\n        function doWithConditionalBranches(action, value, trueTarget, falseTarget) {\n            var savedTrueTarget = currentTrueTarget;\n            var savedFalseTarget = currentFalseTarget;\n            currentTrueTarget = trueTarget;\n            currentFalseTarget = falseTarget;\n            action(value);\n            currentTrueTarget = savedTrueTarget;\n            currentFalseTarget = savedFalseTarget;\n        }\n        function bindCondition(node, trueTarget, falseTarget) {\n            doWithConditionalBranches(bind, node, trueTarget, falseTarget);\n            if (!node || !isLogicalAssignmentExpression(node) && !isLogicalExpression(node) && !(ts.isOptionalChain(node) && ts.isOutermostOptionalChain(node))) {\n                addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node));\n                addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node));\n            }\n        }\n        function bindIterativeStatement(node, breakTarget, continueTarget) {\n            var saveBreakTarget = currentBreakTarget;\n            var saveContinueTarget = currentContinueTarget;\n            currentBreakTarget = breakTarget;\n            currentContinueTarget = continueTarget;\n            bind(node);\n            currentBreakTarget = saveBreakTarget;\n            currentContinueTarget = saveContinueTarget;\n        }\n        function setContinueTarget(node, target) {\n            var label = activeLabelList;\n            while (label && node.parent.kind === 245 /* LabeledStatement */) {\n                label.continueTarget = target;\n                label = label.next;\n                node = node.parent;\n            }\n            return target;\n        }\n        function bindWhileStatement(node) {\n            var preWhileLabel = setContinueTarget(node, createLoopLabel());\n            var preBodyLabel = createBranchLabel();\n            var postWhileLabel = createBranchLabel();\n            addAntecedent(preWhileLabel, currentFlow);\n            currentFlow = preWhileLabel;\n            bindCondition(node.expression, preBodyLabel, postWhileLabel);\n            currentFlow = finishFlowLabel(preBodyLabel);\n            bindIterativeStatement(node.statement, postWhileLabel, preWhileLabel);\n            addAntecedent(preWhileLabel, currentFlow);\n            currentFlow = finishFlowLabel(postWhileLabel);\n        }\n        function bindDoStatement(node) {\n            var preDoLabel = createLoopLabel();\n            var preConditionLabel = setContinueTarget(node, createBranchLabel());\n            var postDoLabel = createBranchLabel();\n            addAntecedent(preDoLabel, currentFlow);\n            currentFlow = preDoLabel;\n            bindIterativeStatement(node.statement, postDoLabel, preConditionLabel);\n            addAntecedent(preConditionLabel, currentFlow);\n            currentFlow = finishFlowLabel(preConditionLabel);\n            bindCondition(node.expression, preDoLabel, postDoLabel);\n            currentFlow = finishFlowLabel(postDoLabel);\n        }\n        function bindForStatement(node) {\n            var preLoopLabel = setContinueTarget(node, createLoopLabel());\n            var preBodyLabel = createBranchLabel();\n            var postLoopLabel = createBranchLabel();\n            bind(node.initializer);\n            addAntecedent(preLoopLabel, currentFlow);\n            currentFlow = preLoopLabel;\n            bindCondition(node.condition, preBodyLabel, postLoopLabel);\n            currentFlow = finishFlowLabel(preBodyLabel);\n            bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);\n            bind(node.incrementor);\n            addAntecedent(preLoopLabel, currentFlow);\n            currentFlow = finishFlowLabel(postLoopLabel);\n        }\n        function bindForInOrForOfStatement(node) {\n            var preLoopLabel = setContinueTarget(node, createLoopLabel());\n            var postLoopLabel = createBranchLabel();\n            bind(node.expression);\n            addAntecedent(preLoopLabel, currentFlow);\n            currentFlow = preLoopLabel;\n            if (node.kind === 239 /* ForOfStatement */) {\n                bind(node.awaitModifier);\n            }\n            addAntecedent(postLoopLabel, currentFlow);\n            bind(node.initializer);\n            if (node.initializer.kind !== 250 /* VariableDeclarationList */) {\n                bindAssignmentTargetFlow(node.initializer);\n            }\n            bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);\n            addAntecedent(preLoopLabel, currentFlow);\n            currentFlow = finishFlowLabel(postLoopLabel);\n        }\n        function bindIfStatement(node) {\n            var thenLabel = createBranchLabel();\n            var elseLabel = createBranchLabel();\n            var postIfLabel = createBranchLabel();\n            bindCondition(node.expression, thenLabel, elseLabel);\n            currentFlow = finishFlowLabel(thenLabel);\n            bind(node.thenStatement);\n            addAntecedent(postIfLabel, currentFlow);\n            currentFlow = finishFlowLabel(elseLabel);\n            bind(node.elseStatement);\n            addAntecedent(postIfLabel, currentFlow);\n            currentFlow = finishFlowLabel(postIfLabel);\n        }\n        function bindReturnOrThrow(node) {\n            bind(node.expression);\n            if (node.kind === 242 /* ReturnStatement */) {\n                hasExplicitReturn = true;\n                if (currentReturnTarget) {\n                    addAntecedent(currentReturnTarget, currentFlow);\n                }\n            }\n            currentFlow = unreachableFlow;\n        }\n        function findActiveLabel(name) {\n            for (var label = activeLabelList; label; label = label.next) {\n                if (label.name === name) {\n                    return label;\n                }\n            }\n            return undefined;\n        }\n        function bindBreakOrContinueFlow(node, breakTarget, continueTarget) {\n            var flowLabel = node.kind === 241 /* BreakStatement */ ? breakTarget : continueTarget;\n            if (flowLabel) {\n                addAntecedent(flowLabel, currentFlow);\n                currentFlow = unreachableFlow;\n            }\n        }\n        function bindBreakOrContinueStatement(node) {\n            bind(node.label);\n            if (node.label) {\n                var activeLabel = findActiveLabel(node.label.escapedText);\n                if (activeLabel) {\n                    activeLabel.referenced = true;\n                    bindBreakOrContinueFlow(node, activeLabel.breakTarget, activeLabel.continueTarget);\n                }\n            }\n            else {\n                bindBreakOrContinueFlow(node, currentBreakTarget, currentContinueTarget);\n            }\n        }\n        function bindTryStatement(node) {\n            // We conservatively assume that *any* code in the try block can cause an exception, but we only need\n            // to track code that causes mutations (because only mutations widen the possible control flow type of\n            // a variable). The exceptionLabel is the target label for control flows that result from exceptions.\n            // We add all mutation flow nodes as antecedents of this label such that we can analyze them as possible\n            // antecedents of the start of catch or finally blocks. Furthermore, we add the current control flow to\n            // represent exceptions that occur before any mutations.\n            var saveReturnTarget = currentReturnTarget;\n            var saveExceptionTarget = currentExceptionTarget;\n            var normalExitLabel = createBranchLabel();\n            var returnLabel = createBranchLabel();\n            var exceptionLabel = createBranchLabel();\n            if (node.finallyBlock) {\n                currentReturnTarget = returnLabel;\n            }\n            addAntecedent(exceptionLabel, currentFlow);\n            currentExceptionTarget = exceptionLabel;\n            bind(node.tryBlock);\n            addAntecedent(normalExitLabel, currentFlow);\n            if (node.catchClause) {\n                // Start of catch clause is the target of exceptions from try block.\n                currentFlow = finishFlowLabel(exceptionLabel);\n                // The currentExceptionTarget now represents control flows from exceptions in the catch clause.\n                // Effectively, in a try-catch-finally, if an exception occurs in the try block, the catch block\n                // acts like a second try block.\n                exceptionLabel = createBranchLabel();\n                addAntecedent(exceptionLabel, currentFlow);\n                currentExceptionTarget = exceptionLabel;\n                bind(node.catchClause);\n                addAntecedent(normalExitLabel, currentFlow);\n            }\n            currentReturnTarget = saveReturnTarget;\n            currentExceptionTarget = saveExceptionTarget;\n            if (node.finallyBlock) {\n                // Possible ways control can reach the finally block:\n                // 1) Normal completion of try block of a try-finally or try-catch-finally\n                // 2) Normal completion of catch block (following exception in try block) of a try-catch-finally\n                // 3) Return in try or catch block of a try-finally or try-catch-finally\n                // 4) Exception in try block of a try-finally\n                // 5) Exception in catch block of a try-catch-finally\n                // When analyzing a control flow graph that starts inside a finally block we want to consider all\n                // five possibilities above. However, when analyzing a control flow graph that starts outside (past)\n                // the finally block, we only want to consider the first two (if we're past a finally block then it\n                // must have completed normally). Likewise, when analyzing a control flow graph from return statements\n                // in try or catch blocks in an IIFE, we only want to consider the third. To make this possible, we\n                // inject a ReduceLabel node into the control flow graph. This node contains an alternate reduced\n                // set of antecedents for the pre-finally label. As control flow analysis passes by a ReduceLabel\n                // node, the pre-finally label is temporarily switched to the reduced antecedent set.\n                var finallyLabel = createBranchLabel();\n                finallyLabel.antecedents = ts.concatenate(ts.concatenate(normalExitLabel.antecedents, exceptionLabel.antecedents), returnLabel.antecedents);\n                currentFlow = finallyLabel;\n                bind(node.finallyBlock);\n                if (currentFlow.flags & 1 /* Unreachable */) {\n                    // If the end of the finally block is unreachable, the end of the entire try statement is unreachable.\n                    currentFlow = unreachableFlow;\n                }\n                else {\n                    // If we have an IIFE return target and return statements in the try or catch blocks, add a control\n                    // flow that goes back through the finally block and back through only the return statements.\n                    if (currentReturnTarget && returnLabel.antecedents) {\n                        addAntecedent(currentReturnTarget, createReduceLabel(finallyLabel, returnLabel.antecedents, currentFlow));\n                    }\n                    // If we have an outer exception target (i.e. a containing try-finally or try-catch-finally), add a\n                    // control flow that goes back through the finally blok and back through each possible exception source.\n                    if (currentExceptionTarget && exceptionLabel.antecedents) {\n                        addAntecedent(currentExceptionTarget, createReduceLabel(finallyLabel, exceptionLabel.antecedents, currentFlow));\n                    }\n                    // If the end of the finally block is reachable, but the end of the try and catch blocks are not,\n                    // convert the current flow to unreachable. For example, 'try { return 1; } finally { ... }' should\n                    // result in an unreachable current control flow.\n                    currentFlow = normalExitLabel.antecedents ? createReduceLabel(finallyLabel, normalExitLabel.antecedents, currentFlow) : unreachableFlow;\n                }\n            }\n            else {\n                currentFlow = finishFlowLabel(normalExitLabel);\n            }\n        }\n        function bindSwitchStatement(node) {\n            var postSwitchLabel = createBranchLabel();\n            bind(node.expression);\n            var saveBreakTarget = currentBreakTarget;\n            var savePreSwitchCaseFlow = preSwitchCaseFlow;\n            currentBreakTarget = postSwitchLabel;\n            preSwitchCaseFlow = currentFlow;\n            bind(node.caseBlock);\n            addAntecedent(postSwitchLabel, currentFlow);\n            var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 285 /* DefaultClause */; });\n            // We mark a switch statement as possibly exhaustive if it has no default clause and if all\n            // case clauses have unreachable end points (e.g. they all return). Note, we no longer need\n            // this property in control flow analysis, it's there only for backwards compatibility.\n            node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents;\n            if (!hasDefault) {\n                addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0));\n            }\n            currentBreakTarget = saveBreakTarget;\n            preSwitchCaseFlow = savePreSwitchCaseFlow;\n            currentFlow = finishFlowLabel(postSwitchLabel);\n        }\n        function bindCaseBlock(node) {\n            var clauses = node.clauses;\n            var isNarrowingSwitch = isNarrowingExpression(node.parent.expression);\n            var fallthroughFlow = unreachableFlow;\n            for (var i = 0; i < clauses.length; i++) {\n                var clauseStart = i;\n                while (!clauses[i].statements.length && i + 1 < clauses.length) {\n                    bind(clauses[i]);\n                    i++;\n                }\n                var preCaseLabel = createBranchLabel();\n                addAntecedent(preCaseLabel, isNarrowingSwitch ? createFlowSwitchClause(preSwitchCaseFlow, node.parent, clauseStart, i + 1) : preSwitchCaseFlow);\n                addAntecedent(preCaseLabel, fallthroughFlow);\n                currentFlow = finishFlowLabel(preCaseLabel);\n                var clause = clauses[i];\n                bind(clause);\n                fallthroughFlow = currentFlow;\n                if (!(currentFlow.flags & 1 /* Unreachable */) && i !== clauses.length - 1 && options.noFallthroughCasesInSwitch) {\n                    clause.fallthroughFlowNode = currentFlow;\n                }\n            }\n        }\n        function bindCaseClause(node) {\n            var saveCurrentFlow = currentFlow;\n            currentFlow = preSwitchCaseFlow;\n            bind(node.expression);\n            currentFlow = saveCurrentFlow;\n            bindEach(node.statements);\n        }\n        function bindExpressionStatement(node) {\n            bind(node.expression);\n            maybeBindExpressionFlowIfCall(node.expression);\n        }\n        function maybeBindExpressionFlowIfCall(node) {\n            // A top level or LHS of comma expression call expression with a dotted function name and at least one argument\n            // is potentially an assertion and is therefore included in the control flow.\n            if (node.kind === 203 /* CallExpression */) {\n                var call = node;\n                if (ts.isDottedName(call.expression) && call.expression.kind !== 105 /* SuperKeyword */) {\n                    currentFlow = createFlowCall(currentFlow, call);\n                }\n            }\n        }\n        function bindLabeledStatement(node) {\n            var postStatementLabel = createBranchLabel();\n            activeLabelList = {\n                next: activeLabelList,\n                name: node.label.escapedText,\n                breakTarget: postStatementLabel,\n                continueTarget: undefined,\n                referenced: false\n            };\n            bind(node.label);\n            bind(node.statement);\n            if (!activeLabelList.referenced && !options.allowUnusedLabels) {\n                errorOrSuggestionOnNode(ts.unusedLabelIsError(options), node.label, ts.Diagnostics.Unused_label);\n            }\n            activeLabelList = activeLabelList.next;\n            addAntecedent(postStatementLabel, currentFlow);\n            currentFlow = finishFlowLabel(postStatementLabel);\n        }\n        function bindDestructuringTargetFlow(node) {\n            if (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) {\n                bindAssignmentTargetFlow(node.left);\n            }\n            else {\n                bindAssignmentTargetFlow(node);\n            }\n        }\n        function bindAssignmentTargetFlow(node) {\n            if (isNarrowableReference(node)) {\n                currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node);\n            }\n            else if (node.kind === 199 /* ArrayLiteralExpression */) {\n                for (var _i = 0, _a = node.elements; _i < _a.length; _i++) {\n                    var e = _a[_i];\n                    if (e.kind === 220 /* SpreadElement */) {\n                        bindAssignmentTargetFlow(e.expression);\n                    }\n                    else {\n                        bindDestructuringTargetFlow(e);\n                    }\n                }\n            }\n            else if (node.kind === 200 /* ObjectLiteralExpression */) {\n                for (var _b = 0, _c = node.properties; _b < _c.length; _b++) {\n                    var p = _c[_b];\n                    if (p.kind === 288 /* PropertyAssignment */) {\n                        bindDestructuringTargetFlow(p.initializer);\n                    }\n                    else if (p.kind === 289 /* ShorthandPropertyAssignment */) {\n                        bindAssignmentTargetFlow(p.name);\n                    }\n                    else if (p.kind === 290 /* SpreadAssignment */) {\n                        bindAssignmentTargetFlow(p.expression);\n                    }\n                }\n            }\n        }\n        function bindLogicalLikeExpression(node, trueTarget, falseTarget) {\n            var preRightLabel = createBranchLabel();\n            if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 75 /* AmpersandAmpersandEqualsToken */) {\n                bindCondition(node.left, preRightLabel, falseTarget);\n            }\n            else {\n                bindCondition(node.left, trueTarget, preRightLabel);\n            }\n            currentFlow = finishFlowLabel(preRightLabel);\n            bind(node.operatorToken);\n            if (ts.isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind)) {\n                doWithConditionalBranches(bind, node.right, trueTarget, falseTarget);\n                bindAssignmentTargetFlow(node.left);\n                addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node));\n                addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node));\n            }\n            else {\n                bindCondition(node.right, trueTarget, falseTarget);\n            }\n        }\n        function bindPrefixUnaryExpressionFlow(node) {\n            if (node.operator === 53 /* ExclamationToken */) {\n                var saveTrueTarget = currentTrueTarget;\n                currentTrueTarget = currentFalseTarget;\n                currentFalseTarget = saveTrueTarget;\n                bindEachChild(node);\n                currentFalseTarget = currentTrueTarget;\n                currentTrueTarget = saveTrueTarget;\n            }\n            else {\n                bindEachChild(node);\n                if (node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */) {\n                    bindAssignmentTargetFlow(node.operand);\n                }\n            }\n        }\n        function bindPostfixUnaryExpressionFlow(node) {\n            bindEachChild(node);\n            if (node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */) {\n                bindAssignmentTargetFlow(node.operand);\n            }\n        }\n        function bindDestructuringAssignmentFlow(node) {\n            if (inAssignmentPattern) {\n                inAssignmentPattern = false;\n                bind(node.operatorToken);\n                bind(node.right);\n                inAssignmentPattern = true;\n                bind(node.left);\n            }\n            else {\n                inAssignmentPattern = true;\n                bind(node.left);\n                inAssignmentPattern = false;\n                bind(node.operatorToken);\n                bind(node.right);\n            }\n            bindAssignmentTargetFlow(node.left);\n        }\n        var BindBinaryExpressionFlowState;\n        (function (BindBinaryExpressionFlowState) {\n            BindBinaryExpressionFlowState[BindBinaryExpressionFlowState[\"BindThenBindChildren\"] = 0] = \"BindThenBindChildren\";\n            BindBinaryExpressionFlowState[BindBinaryExpressionFlowState[\"MaybeBindLeft\"] = 1] = \"MaybeBindLeft\";\n            BindBinaryExpressionFlowState[BindBinaryExpressionFlowState[\"BindToken\"] = 2] = \"BindToken\";\n            BindBinaryExpressionFlowState[BindBinaryExpressionFlowState[\"BindRight\"] = 3] = \"BindRight\";\n            BindBinaryExpressionFlowState[BindBinaryExpressionFlowState[\"FinishBind\"] = 4] = \"FinishBind\";\n        })(BindBinaryExpressionFlowState || (BindBinaryExpressionFlowState = {}));\n        function bindBinaryExpressionFlow(node) {\n            var workStacks = {\n                expr: [node],\n                state: [1 /* MaybeBindLeft */],\n                inStrictMode: [undefined],\n                parent: [undefined],\n            };\n            var stackIndex = 0;\n            while (stackIndex >= 0) {\n                node = workStacks.expr[stackIndex];\n                switch (workStacks.state[stackIndex]) {\n                    case 0 /* BindThenBindChildren */: {\n                        // This state is used only when recuring, to emulate the work that `bind` does before\n                        // reaching `bindChildren`. A normal call to `bindBinaryExpressionFlow` will already have done this work.\n                        ts.setParent(node, parent);\n                        var saveInStrictMode = inStrictMode;\n                        bindWorker(node);\n                        var saveParent = parent;\n                        parent = node;\n                        advanceState(1 /* MaybeBindLeft */, saveInStrictMode, saveParent);\n                        break;\n                    }\n                    case 1 /* MaybeBindLeft */: {\n                        var operator = node.operatorToken.kind;\n                        // TODO: bindLogicalExpression is recursive - if we want to handle deeply nested `&&` expressions\n                        // we'll need to handle the `bindLogicalExpression` scenarios in this state machine, too\n                        // For now, though, since the common cases are chained `+`, leaving it recursive is fine\n                        if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */ ||\n                            ts.isLogicalOrCoalescingAssignmentOperator(operator)) {\n                            if (isTopLevelLogicalExpression(node)) {\n                                var postExpressionLabel = createBranchLabel();\n                                bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel);\n                                currentFlow = finishFlowLabel(postExpressionLabel);\n                            }\n                            else {\n                                bindLogicalLikeExpression(node, currentTrueTarget, currentFalseTarget);\n                            }\n                            completeNode();\n                        }\n                        else {\n                            advanceState(2 /* BindToken */);\n                            maybeBind(node.left);\n                        }\n                        break;\n                    }\n                    case 2 /* BindToken */: {\n                        if (node.operatorToken.kind === 27 /* CommaToken */) {\n                            maybeBindExpressionFlowIfCall(node.left);\n                        }\n                        advanceState(3 /* BindRight */);\n                        maybeBind(node.operatorToken);\n                        break;\n                    }\n                    case 3 /* BindRight */: {\n                        advanceState(4 /* FinishBind */);\n                        maybeBind(node.right);\n                        break;\n                    }\n                    case 4 /* FinishBind */: {\n                        var operator = node.operatorToken.kind;\n                        if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) {\n                            bindAssignmentTargetFlow(node.left);\n                            if (operator === 62 /* EqualsToken */ && node.left.kind === 202 /* ElementAccessExpression */) {\n                                var elementAccess = node.left;\n                                if (isNarrowableOperand(elementAccess.expression)) {\n                                    currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node);\n                                }\n                            }\n                        }\n                        completeNode();\n                        break;\n                    }\n                    default: return ts.Debug.fail(\"Invalid state \" + workStacks.state[stackIndex] + \" for bindBinaryExpressionFlow\");\n                }\n            }\n            /**\n             * Note that `advanceState` sets the _current_ head state, and that `maybeBind` potentially pushes on a new\n             * head state; so `advanceState` must be called before any `maybeBind` during a state's execution.\n             */\n            function advanceState(state, isInStrictMode, parent) {\n                workStacks.state[stackIndex] = state;\n                if (isInStrictMode !== undefined) {\n                    workStacks.inStrictMode[stackIndex] = isInStrictMode;\n                }\n                if (parent !== undefined) {\n                    workStacks.parent[stackIndex] = parent;\n                }\n            }\n            function completeNode() {\n                if (workStacks.inStrictMode[stackIndex] !== undefined) {\n                    inStrictMode = workStacks.inStrictMode[stackIndex];\n                    parent = workStacks.parent[stackIndex];\n                }\n                stackIndex--;\n            }\n            /**\n             * If `node` is a BinaryExpression, adds it to the local work stack, otherwise recursively binds it\n             */\n            function maybeBind(node) {\n                if (node && ts.isBinaryExpression(node) && !ts.isDestructuringAssignment(node)) {\n                    stackIndex++;\n                    workStacks.expr[stackIndex] = node;\n                    workStacks.state[stackIndex] = 0 /* BindThenBindChildren */;\n                    workStacks.inStrictMode[stackIndex] = undefined;\n                    workStacks.parent[stackIndex] = undefined;\n                }\n                else {\n                    bind(node);\n                }\n            }\n        }\n        function bindDeleteExpressionFlow(node) {\n            bindEachChild(node);\n            if (node.expression.kind === 201 /* PropertyAccessExpression */) {\n                bindAssignmentTargetFlow(node.expression);\n            }\n        }\n        function bindConditionalExpressionFlow(node) {\n            var trueLabel = createBranchLabel();\n            var falseLabel = createBranchLabel();\n            var postExpressionLabel = createBranchLabel();\n            bindCondition(node.condition, trueLabel, falseLabel);\n            currentFlow = finishFlowLabel(trueLabel);\n            bind(node.questionToken);\n            bind(node.whenTrue);\n            addAntecedent(postExpressionLabel, currentFlow);\n            currentFlow = finishFlowLabel(falseLabel);\n            bind(node.colonToken);\n            bind(node.whenFalse);\n            addAntecedent(postExpressionLabel, currentFlow);\n            currentFlow = finishFlowLabel(postExpressionLabel);\n        }\n        function bindInitializedVariableFlow(node) {\n            var name = !ts.isOmittedExpression(node) ? node.name : undefined;\n            if (ts.isBindingPattern(name)) {\n                for (var _i = 0, _a = name.elements; _i < _a.length; _i++) {\n                    var child = _a[_i];\n                    bindInitializedVariableFlow(child);\n                }\n            }\n            else {\n                currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node);\n            }\n        }\n        function bindVariableDeclarationFlow(node) {\n            bindEachChild(node);\n            if (node.initializer || ts.isForInOrOfStatement(node.parent.parent)) {\n                bindInitializedVariableFlow(node);\n            }\n        }\n        function bindBindingElementFlow(node) {\n            if (ts.isBindingPattern(node.name)) {\n                // When evaluating a binding pattern, the initializer is evaluated before the binding pattern, per:\n                // - https://tc39.es/ecma262/#sec-destructuring-binding-patterns-runtime-semantics-iteratorbindinginitialization\n                //   - `BindingElement: BindingPattern Initializer?`\n                // - https://tc39.es/ecma262/#sec-runtime-semantics-keyedbindinginitialization\n                //   - `BindingElement: BindingPattern Initializer?`\n                bindEach(node.decorators);\n                bindEach(node.modifiers);\n                bind(node.dotDotDotToken);\n                bind(node.propertyName);\n                bind(node.initializer);\n                bind(node.name);\n            }\n            else {\n                bindEachChild(node);\n            }\n        }\n        function bindJSDocTypeAlias(node) {\n            ts.setParent(node.tagName, node);\n            if (node.kind !== 325 /* JSDocEnumTag */ && node.fullName) {\n                ts.setParent(node.fullName, node);\n                ts.setParentRecursive(node.fullName, /*incremental*/ false);\n            }\n        }\n        function bindJSDocClassTag(node) {\n            bindEachChild(node);\n            var host = ts.getHostSignatureFromJSDoc(node);\n            if (host && host.kind !== 165 /* MethodDeclaration */) {\n                addDeclarationToSymbol(host.symbol, host, 32 /* Class */);\n            }\n        }\n        function bindOptionalExpression(node, trueTarget, falseTarget) {\n            doWithConditionalBranches(bind, node, trueTarget, falseTarget);\n            if (!ts.isOptionalChain(node) || ts.isOutermostOptionalChain(node)) {\n                addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node));\n                addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node));\n            }\n        }\n        function bindOptionalChainRest(node) {\n            switch (node.kind) {\n                case 201 /* PropertyAccessExpression */:\n                    bind(node.questionDotToken);\n                    bind(node.name);\n                    break;\n                case 202 /* ElementAccessExpression */:\n                    bind(node.questionDotToken);\n                    bind(node.argumentExpression);\n                    break;\n                case 203 /* CallExpression */:\n                    bind(node.questionDotToken);\n                    bindEach(node.typeArguments);\n                    bindEach(node.arguments);\n                    break;\n            }\n        }\n        function bindOptionalChain(node, trueTarget, falseTarget) {\n            // For an optional chain, we emulate the behavior of a logical expression:\n            //\n            // a?.b         -> a && a.b\n            // a?.b.c       -> a && a.b.c\n            // a?.b?.c      -> a && a.b && a.b.c\n            // a?.[x = 1]   -> a && a[x = 1]\n            //\n            // To do this we descend through the chain until we reach the root of a chain (the expression with a `?.`)\n            // and build it's CFA graph as if it were the first condition (`a && ...`). Then we bind the rest\n            // of the node as part of the \"true\" branch, and continue to do so as we ascend back up to the outermost\n            // chain node. We then treat the entire node as the right side of the expression.\n            var preChainLabel = ts.isOptionalChainRoot(node) ? createBranchLabel() : undefined;\n            bindOptionalExpression(node.expression, preChainLabel || trueTarget, falseTarget);\n            if (preChainLabel) {\n                currentFlow = finishFlowLabel(preChainLabel);\n            }\n            doWithConditionalBranches(bindOptionalChainRest, node, trueTarget, falseTarget);\n            if (ts.isOutermostOptionalChain(node)) {\n                addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node));\n                addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node));\n            }\n        }\n        function bindOptionalChainFlow(node) {\n            if (isTopLevelLogicalExpression(node)) {\n                var postExpressionLabel = createBranchLabel();\n                bindOptionalChain(node, postExpressionLabel, postExpressionLabel);\n                currentFlow = finishFlowLabel(postExpressionLabel);\n            }\n            else {\n                bindOptionalChain(node, currentTrueTarget, currentFalseTarget);\n            }\n        }\n        function bindNonNullExpressionFlow(node) {\n            if (ts.isOptionalChain(node)) {\n                bindOptionalChainFlow(node);\n            }\n            else {\n                bindEachChild(node);\n            }\n        }\n        function bindAccessExpressionFlow(node) {\n            if (ts.isOptionalChain(node)) {\n                bindOptionalChainFlow(node);\n            }\n            else {\n                bindEachChild(node);\n            }\n        }\n        function bindCallExpressionFlow(node) {\n            if (ts.isOptionalChain(node)) {\n                bindOptionalChainFlow(node);\n            }\n            else {\n                // If the target of the call expression is a function expression or arrow function we have\n                // an immediately invoked function expression (IIFE). Initialize the flowNode property to\n                // the current control flow (which includes evaluation of the IIFE arguments).\n                var expr = ts.skipParentheses(node.expression);\n                if (expr.kind === 208 /* FunctionExpression */ || expr.kind === 209 /* ArrowFunction */) {\n                    bindEach(node.typeArguments);\n                    bindEach(node.arguments);\n                    bind(node.expression);\n                }\n                else {\n                    bindEachChild(node);\n                    if (node.expression.kind === 105 /* SuperKeyword */) {\n                        currentFlow = createFlowCall(currentFlow, node);\n                    }\n                }\n            }\n            if (node.expression.kind === 201 /* PropertyAccessExpression */) {\n                var propertyAccess = node.expression;\n                if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) {\n                    currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node);\n                }\n            }\n        }\n        function getContainerFlags(node) {\n            switch (node.kind) {\n                case 221 /* ClassExpression */:\n                case 252 /* ClassDeclaration */:\n                case 255 /* EnumDeclaration */:\n                case 200 /* ObjectLiteralExpression */:\n                case 177 /* TypeLiteral */:\n                case 312 /* JSDocTypeLiteral */:\n                case 281 /* JsxAttributes */:\n                    return 1 /* IsContainer */;\n                case 253 /* InterfaceDeclaration */:\n                    return 1 /* IsContainer */ | 64 /* IsInterface */;\n                case 256 /* ModuleDeclaration */:\n                case 254 /* TypeAliasDeclaration */:\n                case 190 /* MappedType */:\n                    return 1 /* IsContainer */ | 32 /* HasLocals */;\n                case 297 /* SourceFile */:\n                    return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;\n                case 165 /* MethodDeclaration */:\n                    if (ts.isObjectLiteralOrClassExpressionMethod(node)) {\n                        return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */;\n                    }\n                // falls through\n                case 166 /* Constructor */:\n                case 251 /* FunctionDeclaration */:\n                case 164 /* MethodSignature */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                case 169 /* CallSignature */:\n                case 313 /* JSDocSignature */:\n                case 308 /* JSDocFunctionType */:\n                case 174 /* FunctionType */:\n                case 170 /* ConstructSignature */:\n                case 171 /* IndexSignature */:\n                case 175 /* ConstructorType */:\n                    return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                    return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;\n                case 257 /* ModuleBlock */:\n                    return 4 /* IsControlFlowContainer */;\n                case 163 /* PropertyDeclaration */:\n                    return node.initializer ? 4 /* IsControlFlowContainer */ : 0;\n                case 287 /* CatchClause */:\n                case 237 /* ForStatement */:\n                case 238 /* ForInStatement */:\n                case 239 /* ForOfStatement */:\n                case 258 /* CaseBlock */:\n                    return 2 /* IsBlockScopedContainer */;\n                case 230 /* Block */:\n                    // do not treat blocks directly inside a function as a block-scoped-container.\n                    // Locals that reside in this block should go to the function locals. Otherwise 'x'\n                    // would not appear to be a redeclaration of a block scoped local in the following\n                    // example:\n                    //\n                    //      function foo() {\n                    //          var x;\n                    //          let x;\n                    //      }\n                    //\n                    // If we placed 'var x' into the function locals and 'let x' into the locals of\n                    // the block, then there would be no collision.\n                    //\n                    // By not creating a new block-scoped-container here, we ensure that both 'var x'\n                    // and 'let x' go into the Function-container's locals, and we do get a collision\n                    // conflict.\n                    return ts.isFunctionLike(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */;\n            }\n            return 0 /* None */;\n        }\n        function addToContainerChain(next) {\n            if (lastContainer) {\n                lastContainer.nextContainer = next;\n            }\n            lastContainer = next;\n        }\n        function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) {\n            switch (container.kind) {\n                // Modules, source files, and classes need specialized handling for how their\n                // members are declared (for example, a member of a class will go into a specific\n                // symbol table depending on if it is static or not). We defer to specialized\n                // handlers to take care of declaring these child members.\n                case 256 /* ModuleDeclaration */:\n                    return declareModuleMember(node, symbolFlags, symbolExcludes);\n                case 297 /* SourceFile */:\n                    return declareSourceFileMember(node, symbolFlags, symbolExcludes);\n                case 221 /* ClassExpression */:\n                case 252 /* ClassDeclaration */:\n                    return declareClassMember(node, symbolFlags, symbolExcludes);\n                case 255 /* EnumDeclaration */:\n                    return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);\n                case 177 /* TypeLiteral */:\n                case 312 /* JSDocTypeLiteral */:\n                case 200 /* ObjectLiteralExpression */:\n                case 253 /* InterfaceDeclaration */:\n                case 281 /* JsxAttributes */:\n                    // Interface/Object-types always have their children added to the 'members' of\n                    // their container. They are only accessible through an instance of their\n                    // container, and are never in scope otherwise (even inside the body of the\n                    // object / type / interface declaring them). An exception is type parameters,\n                    // which are in scope without qualification (similar to 'locals').\n                    return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);\n                case 174 /* FunctionType */:\n                case 175 /* ConstructorType */:\n                case 169 /* CallSignature */:\n                case 170 /* ConstructSignature */:\n                case 313 /* JSDocSignature */:\n                case 171 /* IndexSignature */:\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                case 166 /* Constructor */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                case 251 /* FunctionDeclaration */:\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                case 308 /* JSDocFunctionType */:\n                case 331 /* JSDocTypedefTag */:\n                case 324 /* JSDocCallbackTag */:\n                case 254 /* TypeAliasDeclaration */:\n                case 190 /* MappedType */:\n                    // All the children of these container types are never visible through another\n                    // symbol (i.e. through another symbol's 'exports' or 'members').  Instead,\n                    // they're only accessed 'lexically' (i.e. from code that exists underneath\n                    // their container in the tree). To accomplish this, we simply add their declared\n                    // symbol to the 'locals' of the container.  These symbols can then be found as\n                    // the type checker walks up the containers, checking them for matching names.\n                    return declareSymbol(container.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes);\n            }\n        }\n        function declareClassMember(node, symbolFlags, symbolExcludes) {\n            return ts.hasSyntacticModifier(node, 32 /* Static */)\n                ? declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes)\n                : declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);\n        }\n        function declareSourceFileMember(node, symbolFlags, symbolExcludes) {\n            return ts.isExternalModule(file)\n                ? declareModuleMember(node, symbolFlags, symbolExcludes)\n                : declareSymbol(file.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes);\n        }\n        function hasExportDeclarations(node) {\n            var body = ts.isSourceFile(node) ? node : ts.tryCast(node.body, ts.isModuleBlock);\n            return !!body && body.statements.some(function (s) { return ts.isExportDeclaration(s) || ts.isExportAssignment(s); });\n        }\n        function setExportContextFlag(node) {\n            // A declaration source file or ambient module declaration that contains no export declarations (but possibly regular\n            // declarations with export modifiers) is an export context in which declarations are implicitly exported.\n            if (node.flags & 8388608 /* Ambient */ && !hasExportDeclarations(node)) {\n                node.flags |= 64 /* ExportContext */;\n            }\n            else {\n                node.flags &= ~64 /* ExportContext */;\n            }\n        }\n        function bindModuleDeclaration(node) {\n            setExportContextFlag(node);\n            if (ts.isAmbientModule(node)) {\n                if (ts.hasSyntacticModifier(node, 1 /* Export */)) {\n                    errorOnFirstToken(node, ts.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible);\n                }\n                if (ts.isModuleAugmentationExternal(node)) {\n                    declareModuleSymbol(node);\n                }\n                else {\n                    var pattern = void 0;\n                    if (node.name.kind === 10 /* StringLiteral */) {\n                        var text = node.name.text;\n                        if (ts.hasZeroOrOneAsteriskCharacter(text)) {\n                            pattern = ts.tryParsePattern(text);\n                        }\n                        else {\n                            errorOnFirstToken(node.name, ts.Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character, text);\n                        }\n                    }\n                    var symbol = declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 110735 /* ValueModuleExcludes */);\n                    file.patternAmbientModules = ts.append(file.patternAmbientModules, pattern && { pattern: pattern, symbol: symbol });\n                }\n            }\n            else {\n                var state = declareModuleSymbol(node);\n                if (state !== 0 /* NonInstantiated */) {\n                    var symbol = node.symbol;\n                    // if module was already merged with some function, class or non-const enum, treat it as non-const-enum-only\n                    symbol.constEnumOnlyModule = (!(symbol.flags & (16 /* Function */ | 32 /* Class */ | 256 /* RegularEnum */)))\n                        // Current must be `const enum` only\n                        && state === 2 /* ConstEnumOnly */\n                        // Can't have been set to 'false' in a previous merged symbol. ('undefined' OK)\n                        && symbol.constEnumOnlyModule !== false;\n                }\n            }\n        }\n        function declareModuleSymbol(node) {\n            var state = getModuleInstanceState(node);\n            var instantiated = state !== 0 /* NonInstantiated */;\n            declareSymbolAndAddToSymbolTable(node, instantiated ? 512 /* ValueModule */ : 1024 /* NamespaceModule */, instantiated ? 110735 /* ValueModuleExcludes */ : 0 /* NamespaceModuleExcludes */);\n            return state;\n        }\n        function bindFunctionOrConstructorType(node) {\n            // For a given function symbol \"<...>(...) => T\" we want to generate a symbol identical\n            // to the one we would get for: { <...>(...): T }\n            //\n            // We do that by making an anonymous type literal symbol, and then setting the function\n            // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable\n            // from an actual type literal symbol you would have gotten had you used the long form.\n            var symbol = createSymbol(131072 /* Signature */, getDeclarationName(node)); // TODO: GH#18217\n            addDeclarationToSymbol(symbol, node, 131072 /* Signature */);\n            var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, \"__type\" /* Type */);\n            addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */);\n            typeLiteralSymbol.members = ts.createSymbolTable();\n            typeLiteralSymbol.members.set(symbol.escapedName, symbol);\n        }\n        function bindObjectLiteralExpression(node) {\n            var ElementKind;\n            (function (ElementKind) {\n                ElementKind[ElementKind[\"Property\"] = 1] = \"Property\";\n                ElementKind[ElementKind[\"Accessor\"] = 2] = \"Accessor\";\n            })(ElementKind || (ElementKind = {}));\n            if (inStrictMode && !ts.isAssignmentTarget(node)) {\n                var seen = new ts.Map();\n                for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {\n                    var prop = _a[_i];\n                    if (prop.kind === 290 /* SpreadAssignment */ || prop.name.kind !== 78 /* Identifier */) {\n                        continue;\n                    }\n                    var identifier = prop.name;\n                    // ECMA-262 11.1.5 Object Initializer\n                    // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true\n                    // a.This production is contained in strict code and IsDataDescriptor(previous) is true and\n                    // IsDataDescriptor(propId.descriptor) is true.\n                    //    b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true.\n                    //    c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true.\n                    //    d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true\n                    // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields\n                    var currentKind = prop.kind === 288 /* PropertyAssignment */ || prop.kind === 289 /* ShorthandPropertyAssignment */ || prop.kind === 165 /* MethodDeclaration */\n                        ? 1 /* Property */\n                        : 2 /* Accessor */;\n                    var existingKind = seen.get(identifier.escapedText);\n                    if (!existingKind) {\n                        seen.set(identifier.escapedText, currentKind);\n                        continue;\n                    }\n                    if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) {\n                        var span = ts.getErrorSpanForNode(file, identifier);\n                        file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));\n                    }\n                }\n            }\n            return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, \"__object\" /* Object */);\n        }\n        function bindJsxAttributes(node) {\n            return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, \"__jsxAttributes\" /* JSXAttributes */);\n        }\n        function bindJsxAttribute(node, symbolFlags, symbolExcludes) {\n            return declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes);\n        }\n        function bindAnonymousDeclaration(node, symbolFlags, name) {\n            var symbol = createSymbol(symbolFlags, name);\n            if (symbolFlags & (8 /* EnumMember */ | 106500 /* ClassMember */)) {\n                symbol.parent = container.symbol;\n            }\n            addDeclarationToSymbol(symbol, node, symbolFlags);\n            return symbol;\n        }\n        function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) {\n            switch (blockScopeContainer.kind) {\n                case 256 /* ModuleDeclaration */:\n                    declareModuleMember(node, symbolFlags, symbolExcludes);\n                    break;\n                case 297 /* SourceFile */:\n                    if (ts.isExternalOrCommonJsModule(container)) {\n                        declareModuleMember(node, symbolFlags, symbolExcludes);\n                        break;\n                    }\n                // falls through\n                default:\n                    if (!blockScopeContainer.locals) {\n                        blockScopeContainer.locals = ts.createSymbolTable();\n                        addToContainerChain(blockScopeContainer);\n                    }\n                    declareSymbol(blockScopeContainer.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes);\n            }\n        }\n        function delayedBindJSDocTypedefTag() {\n            if (!delayedTypeAliases) {\n                return;\n            }\n            var saveContainer = container;\n            var saveLastContainer = lastContainer;\n            var saveBlockScopeContainer = blockScopeContainer;\n            var saveParent = parent;\n            var saveCurrentFlow = currentFlow;\n            for (var _i = 0, delayedTypeAliases_1 = delayedTypeAliases; _i < delayedTypeAliases_1.length; _i++) {\n                var typeAlias = delayedTypeAliases_1[_i];\n                var host = ts.getJSDocHost(typeAlias);\n                container = (host && ts.findAncestor(host.parent, function (n) { return !!(getContainerFlags(n) & 1 /* IsContainer */); })) || file;\n                blockScopeContainer = (host && ts.getEnclosingBlockScopeContainer(host)) || file;\n                currentFlow = initFlowNode({ flags: 2 /* Start */ });\n                parent = typeAlias;\n                bind(typeAlias.typeExpression);\n                var declName = ts.getNameOfDeclaration(typeAlias);\n                if ((ts.isJSDocEnumTag(typeAlias) || !typeAlias.fullName) && declName && ts.isPropertyAccessEntityNameExpression(declName.parent)) {\n                    // typedef anchored to an A.B.C assignment - we need to bind into B's namespace under name C\n                    var isTopLevel = isTopLevelNamespaceAssignment(declName.parent);\n                    if (isTopLevel) {\n                        bindPotentiallyMissingNamespaces(file.symbol, declName.parent, isTopLevel, !!ts.findAncestor(declName, function (d) { return ts.isPropertyAccessExpression(d) && d.name.escapedText === \"prototype\"; }), /*containerIsClass*/ false);\n                        var oldContainer = container;\n                        switch (ts.getAssignmentDeclarationPropertyAccessKind(declName.parent)) {\n                            case 1 /* ExportsProperty */:\n                            case 2 /* ModuleExports */:\n                                if (!ts.isExternalOrCommonJsModule(file)) {\n                                    container = undefined;\n                                }\n                                else {\n                                    container = file;\n                                }\n                                break;\n                            case 4 /* ThisProperty */:\n                                container = declName.parent.expression;\n                                break;\n                            case 3 /* PrototypeProperty */:\n                                container = declName.parent.expression.name;\n                                break;\n                            case 5 /* Property */:\n                                container = isExportsOrModuleExportsOrAlias(file, declName.parent.expression) ? file\n                                    : ts.isPropertyAccessExpression(declName.parent.expression) ? declName.parent.expression.name\n                                        : declName.parent.expression;\n                                break;\n                            case 0 /* None */:\n                                return ts.Debug.fail(\"Shouldn't have detected typedef or enum on non-assignment declaration\");\n                        }\n                        if (container) {\n                            declareModuleMember(typeAlias, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */);\n                        }\n                        container = oldContainer;\n                    }\n                }\n                else if (ts.isJSDocEnumTag(typeAlias) || !typeAlias.fullName || typeAlias.fullName.kind === 78 /* Identifier */) {\n                    parent = typeAlias.parent;\n                    bindBlockScopedDeclaration(typeAlias, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */);\n                }\n                else {\n                    bind(typeAlias.fullName);\n                }\n            }\n            container = saveContainer;\n            lastContainer = saveLastContainer;\n            blockScopeContainer = saveBlockScopeContainer;\n            parent = saveParent;\n            currentFlow = saveCurrentFlow;\n        }\n        // The binder visits every node in the syntax tree so it is a convenient place to perform a single localized\n        // check for reserved words used as identifiers in strict mode code, as well as `yield` or `await` in\n        // [Yield] or [Await] contexts, respectively.\n        function checkContextualIdentifier(node) {\n            // Report error only if there are no parse errors in file\n            if (!file.parseDiagnostics.length &&\n                !(node.flags & 8388608 /* Ambient */) &&\n                !(node.flags & 4194304 /* JSDoc */) &&\n                !ts.isIdentifierName(node)) {\n                // strict mode identifiers\n                if (inStrictMode &&\n                    node.originalKeywordKind >= 116 /* FirstFutureReservedWord */ &&\n                    node.originalKeywordKind <= 124 /* LastFutureReservedWord */) {\n                    file.bindDiagnostics.push(createDiagnosticForNode(node, getStrictModeIdentifierMessage(node), ts.declarationNameToString(node)));\n                }\n                else if (node.originalKeywordKind === 130 /* AwaitKeyword */) {\n                    if (ts.isExternalModule(file) && ts.isInTopLevelContext(node)) {\n                        file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module, ts.declarationNameToString(node)));\n                    }\n                    else if (node.flags & 32768 /* AwaitContext */) {\n                        file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, ts.declarationNameToString(node)));\n                    }\n                }\n                else if (node.originalKeywordKind === 124 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) {\n                    file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, ts.declarationNameToString(node)));\n                }\n            }\n        }\n        function getStrictModeIdentifierMessage(node) {\n            // Provide specialized messages to help the user understand why we think they're in\n            // strict mode.\n            if (ts.getContainingClass(node)) {\n                return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode;\n            }\n            if (file.externalModuleIndicator) {\n                return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode;\n            }\n            return ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode;\n        }\n        // The binder visits every node, so this is a good place to check for\n        // the reserved private name (there is only one)\n        function checkPrivateIdentifier(node) {\n            if (node.escapedText === \"#constructor\") {\n                // Report error only if there are no parse errors in file\n                if (!file.parseDiagnostics.length) {\n                    file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.constructor_is_a_reserved_word, ts.declarationNameToString(node)));\n                }\n            }\n        }\n        function checkStrictModeBinaryExpression(node) {\n            if (inStrictMode && ts.isLeftHandSideExpression(node.left) && ts.isAssignmentOperator(node.operatorToken.kind)) {\n                // ECMA 262 (Annex C) The identifier eval or arguments may not appear as the LeftHandSideExpression of an\n                // Assignment operator(11.13) or of a PostfixExpression(11.3)\n                checkStrictModeEvalOrArguments(node, node.left);\n            }\n        }\n        function checkStrictModeCatchClause(node) {\n            // It is a SyntaxError if a TryStatement with a Catch occurs within strict code and the Identifier of the\n            // Catch production is eval or arguments\n            if (inStrictMode && node.variableDeclaration) {\n                checkStrictModeEvalOrArguments(node, node.variableDeclaration.name);\n            }\n        }\n        function checkStrictModeDeleteExpression(node) {\n            // Grammar checking\n            if (inStrictMode && node.expression.kind === 78 /* Identifier */) {\n                // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its\n                // UnaryExpression is a direct reference to a variable, function argument, or function name\n                var span = ts.getErrorSpanForNode(file, node.expression);\n                file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode));\n            }\n        }\n        function isEvalOrArgumentsIdentifier(node) {\n            return ts.isIdentifier(node) && (node.escapedText === \"eval\" || node.escapedText === \"arguments\");\n        }\n        function checkStrictModeEvalOrArguments(contextNode, name) {\n            if (name && name.kind === 78 /* Identifier */) {\n                var identifier = name;\n                if (isEvalOrArgumentsIdentifier(identifier)) {\n                    // We check first if the name is inside class declaration or class expression; if so give explicit message\n                    // otherwise report generic error message.\n                    var span = ts.getErrorSpanForNode(file, name);\n                    file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, getStrictModeEvalOrArgumentsMessage(contextNode), ts.idText(identifier)));\n                }\n            }\n        }\n        function getStrictModeEvalOrArgumentsMessage(node) {\n            // Provide specialized messages to help the user understand why we think they're in\n            // strict mode.\n            if (ts.getContainingClass(node)) {\n                return ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode;\n            }\n            if (file.externalModuleIndicator) {\n                return ts.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode;\n            }\n            return ts.Diagnostics.Invalid_use_of_0_in_strict_mode;\n        }\n        function checkStrictModeFunctionName(node) {\n            if (inStrictMode) {\n                // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a strict mode FunctionDeclaration or FunctionExpression (13.1))\n                checkStrictModeEvalOrArguments(node, node.name);\n            }\n        }\n        function getStrictModeBlockScopeFunctionDeclarationMessage(node) {\n            // Provide specialized messages to help the user understand why we think they're in\n            // strict mode.\n            if (ts.getContainingClass(node)) {\n                return ts.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode;\n            }\n            if (file.externalModuleIndicator) {\n                return ts.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode;\n            }\n            return ts.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5;\n        }\n        function checkStrictModeFunctionDeclaration(node) {\n            if (languageVersion < 2 /* ES2015 */) {\n                // Report error if function is not top level function declaration\n                if (blockScopeContainer.kind !== 297 /* SourceFile */ &&\n                    blockScopeContainer.kind !== 256 /* ModuleDeclaration */ &&\n                    !ts.isFunctionLike(blockScopeContainer)) {\n                    // We check first if the name is inside class declaration or class expression; if so give explicit message\n                    // otherwise report generic error message.\n                    var errorSpan = ts.getErrorSpanForNode(file, node);\n                    file.bindDiagnostics.push(ts.createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node)));\n                }\n            }\n        }\n        function checkStrictModeNumericLiteral(node) {\n            if (inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {\n                file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));\n            }\n        }\n        function checkStrictModePostfixUnaryExpression(node) {\n            // Grammar checking\n            // The identifier eval or arguments may not appear as the LeftHandSideExpression of an\n            // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression\n            // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator.\n            if (inStrictMode) {\n                checkStrictModeEvalOrArguments(node, node.operand);\n            }\n        }\n        function checkStrictModePrefixUnaryExpression(node) {\n            // Grammar checking\n            if (inStrictMode) {\n                if (node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */) {\n                    checkStrictModeEvalOrArguments(node, node.operand);\n                }\n            }\n        }\n        function checkStrictModeWithStatement(node) {\n            // Grammar checking for withStatement\n            if (inStrictMode) {\n                errorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode);\n            }\n        }\n        function checkStrictModeLabeledStatement(node) {\n            // Grammar checking for labeledStatement\n            if (inStrictMode && options.target >= 2 /* ES2015 */) {\n                if (ts.isDeclarationStatement(node.statement) || ts.isVariableStatement(node.statement)) {\n                    errorOnFirstToken(node.label, ts.Diagnostics.A_label_is_not_allowed_here);\n                }\n            }\n        }\n        function errorOnFirstToken(node, message, arg0, arg1, arg2) {\n            var span = ts.getSpanOfTokenAtPosition(file, node.pos);\n            file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2));\n        }\n        function errorOrSuggestionOnNode(isError, node, message) {\n            errorOrSuggestionOnRange(isError, node, node, message);\n        }\n        function errorOrSuggestionOnRange(isError, startNode, endNode, message) {\n            addErrorOrSuggestionDiagnostic(isError, { pos: ts.getTokenPosOfNode(startNode, file), end: endNode.end }, message);\n        }\n        function addErrorOrSuggestionDiagnostic(isError, range, message) {\n            var diag = ts.createFileDiagnostic(file, range.pos, range.end - range.pos, message);\n            if (isError) {\n                file.bindDiagnostics.push(diag);\n            }\n            else {\n                file.bindSuggestionDiagnostics = ts.append(file.bindSuggestionDiagnostics, __assign(__assign({}, diag), { category: ts.DiagnosticCategory.Suggestion }));\n            }\n        }\n        function bind(node) {\n            if (!node) {\n                return;\n            }\n            ts.setParent(node, parent);\n            var saveInStrictMode = inStrictMode;\n            // Even though in the AST the jsdoc @typedef node belongs to the current node,\n            // its symbol might be in the same scope with the current node's symbol. Consider:\n            //\n            //     /** @typedef {string | number} MyType */\n            //     function foo();\n            //\n            // Here the current node is \"foo\", which is a container, but the scope of \"MyType\" should\n            // not be inside \"foo\". Therefore we always bind @typedef before bind the parent node,\n            // and skip binding this tag later when binding all the other jsdoc tags.\n            // First we bind declaration nodes to a symbol if possible. We'll both create a symbol\n            // and then potentially add the symbol to an appropriate symbol table. Possible\n            // destination symbol tables are:\n            //\n            //  1) The 'exports' table of the current container's symbol.\n            //  2) The 'members' table of the current container's symbol.\n            //  3) The 'locals' table of the current container.\n            //\n            // However, not all symbols will end up in any of these tables. 'Anonymous' symbols\n            // (like TypeLiterals for example) will not be put in any table.\n            bindWorker(node);\n            // Then we recurse into the children of the node to bind them as well. For certain\n            // symbols we do specialized work when we recurse. For example, we'll keep track of\n            // the current 'container' node when it changes. This helps us know which symbol table\n            // a local should go into for example. Since terminal nodes are known not to have\n            // children, as an optimization we don't process those.\n            if (node.kind > 156 /* LastToken */) {\n                var saveParent = parent;\n                parent = node;\n                var containerFlags = getContainerFlags(node);\n                if (containerFlags === 0 /* None */) {\n                    bindChildren(node);\n                }\n                else {\n                    bindContainer(node, containerFlags);\n                }\n                parent = saveParent;\n            }\n            else {\n                var saveParent = parent;\n                if (node.kind === 1 /* EndOfFileToken */)\n                    parent = node;\n                bindJSDoc(node);\n                parent = saveParent;\n            }\n            inStrictMode = saveInStrictMode;\n        }\n        function bindJSDoc(node) {\n            if (ts.hasJSDocNodes(node)) {\n                if (ts.isInJSFile(node)) {\n                    for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) {\n                        var j = _a[_i];\n                        bind(j);\n                    }\n                }\n                else {\n                    for (var _b = 0, _c = node.jsDoc; _b < _c.length; _b++) {\n                        var j = _c[_b];\n                        ts.setParent(j, node);\n                        ts.setParentRecursive(j, /*incremental*/ false);\n                    }\n                }\n            }\n        }\n        function updateStrictModeStatementList(statements) {\n            if (!inStrictMode) {\n                for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) {\n                    var statement = statements_3[_i];\n                    if (!ts.isPrologueDirective(statement)) {\n                        return;\n                    }\n                    if (isUseStrictPrologueDirective(statement)) {\n                        inStrictMode = true;\n                        return;\n                    }\n                }\n            }\n        }\n        /// Should be called only on prologue directives (isPrologueDirective(node) should be true)\n        function isUseStrictPrologueDirective(node) {\n            var nodeText = ts.getSourceTextOfNodeFromSourceFile(file, node.expression);\n            // Note: the node text must be exactly \"use strict\" or 'use strict'.  It is not ok for the\n            // string to contain unicode escapes (as per ES5).\n            return nodeText === '\"use strict\"' || nodeText === \"'use strict'\";\n        }\n        function bindWorker(node) {\n            switch (node.kind) {\n                /* Strict mode checks */\n                case 78 /* Identifier */:\n                    // for typedef type names with namespaces, bind the new jsdoc type symbol here\n                    // because it requires all containing namespaces to be in effect, namely the\n                    // current \"blockScopeContainer\" needs to be set to its immediate namespace parent.\n                    if (node.isInJSDocNamespace) {\n                        var parentNode = node.parent;\n                        while (parentNode && !ts.isJSDocTypeAlias(parentNode)) {\n                            parentNode = parentNode.parent;\n                        }\n                        bindBlockScopedDeclaration(parentNode, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */);\n                        break;\n                    }\n                // falls through\n                case 107 /* ThisKeyword */:\n                    if (currentFlow && (ts.isExpression(node) || parent.kind === 289 /* ShorthandPropertyAssignment */)) {\n                        node.flowNode = currentFlow;\n                    }\n                    return checkContextualIdentifier(node);\n                case 157 /* QualifiedName */:\n                    if (currentFlow && parent.kind === 176 /* TypeQuery */) {\n                        node.flowNode = currentFlow;\n                    }\n                    break;\n                case 105 /* SuperKeyword */:\n                    node.flowNode = currentFlow;\n                    break;\n                case 79 /* PrivateIdentifier */:\n                    return checkPrivateIdentifier(node);\n                case 201 /* PropertyAccessExpression */:\n                case 202 /* ElementAccessExpression */:\n                    var expr = node;\n                    if (currentFlow && isNarrowableReference(expr)) {\n                        expr.flowNode = currentFlow;\n                    }\n                    if (ts.isSpecialPropertyDeclaration(expr)) {\n                        bindSpecialPropertyDeclaration(expr);\n                    }\n                    if (ts.isInJSFile(expr) &&\n                        file.commonJsModuleIndicator &&\n                        ts.isModuleExportsAccessExpression(expr) &&\n                        !lookupSymbolForName(blockScopeContainer, \"module\")) {\n                        declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */);\n                    }\n                    break;\n                case 216 /* BinaryExpression */:\n                    var specialKind = ts.getAssignmentDeclarationKind(node);\n                    switch (specialKind) {\n                        case 1 /* ExportsProperty */:\n                            bindExportsPropertyAssignment(node);\n                            break;\n                        case 2 /* ModuleExports */:\n                            bindModuleExportsAssignment(node);\n                            break;\n                        case 3 /* PrototypeProperty */:\n                            bindPrototypePropertyAssignment(node.left, node);\n                            break;\n                        case 6 /* Prototype */:\n                            bindPrototypeAssignment(node);\n                            break;\n                        case 4 /* ThisProperty */:\n                            bindThisPropertyAssignment(node);\n                            break;\n                        case 5 /* Property */:\n                            var expression = node.left.expression;\n                            if (ts.isInJSFile(node) && ts.isIdentifier(expression)) {\n                                var symbol = lookupSymbolForName(blockScopeContainer, expression.escapedText);\n                                if (ts.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration)) {\n                                    bindThisPropertyAssignment(node);\n                                    break;\n                                }\n                            }\n                            bindSpecialPropertyAssignment(node);\n                            break;\n                        case 0 /* None */:\n                            // Nothing to do\n                            break;\n                        default:\n                            ts.Debug.fail(\"Unknown binary expression special property assignment kind\");\n                    }\n                    return checkStrictModeBinaryExpression(node);\n                case 287 /* CatchClause */:\n                    return checkStrictModeCatchClause(node);\n                case 210 /* DeleteExpression */:\n                    return checkStrictModeDeleteExpression(node);\n                case 8 /* NumericLiteral */:\n                    return checkStrictModeNumericLiteral(node);\n                case 215 /* PostfixUnaryExpression */:\n                    return checkStrictModePostfixUnaryExpression(node);\n                case 214 /* PrefixUnaryExpression */:\n                    return checkStrictModePrefixUnaryExpression(node);\n                case 243 /* WithStatement */:\n                    return checkStrictModeWithStatement(node);\n                case 245 /* LabeledStatement */:\n                    return checkStrictModeLabeledStatement(node);\n                case 187 /* ThisType */:\n                    seenThisKeyword = true;\n                    return;\n                case 172 /* TypePredicate */:\n                    break; // Binding the children will handle everything\n                case 159 /* TypeParameter */:\n                    return bindTypeParameter(node);\n                case 160 /* Parameter */:\n                    return bindParameter(node);\n                case 249 /* VariableDeclaration */:\n                    return bindVariableDeclarationOrBindingElement(node);\n                case 198 /* BindingElement */:\n                    node.flowNode = currentFlow;\n                    return bindVariableDeclarationOrBindingElement(node);\n                case 163 /* PropertyDeclaration */:\n                case 162 /* PropertySignature */:\n                    return bindPropertyWorker(node);\n                case 288 /* PropertyAssignment */:\n                case 289 /* ShorthandPropertyAssignment */:\n                    return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */);\n                case 291 /* EnumMember */:\n                    return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */);\n                case 169 /* CallSignature */:\n                case 170 /* ConstructSignature */:\n                case 171 /* IndexSignature */:\n                    return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */);\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                    // If this is an ObjectLiteralExpression method, then it sits in the same space\n                    // as other properties in the object literal.  So we use SymbolFlags.PropertyExcludes\n                    // so that it will conflict with any other object literal members with the same\n                    // name.\n                    return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */);\n                case 251 /* FunctionDeclaration */:\n                    return bindFunctionDeclaration(node);\n                case 166 /* Constructor */:\n                    return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */);\n                case 167 /* GetAccessor */:\n                    return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */);\n                case 168 /* SetAccessor */:\n                    return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */);\n                case 174 /* FunctionType */:\n                case 308 /* JSDocFunctionType */:\n                case 313 /* JSDocSignature */:\n                case 175 /* ConstructorType */:\n                    return bindFunctionOrConstructorType(node);\n                case 177 /* TypeLiteral */:\n                case 312 /* JSDocTypeLiteral */:\n                case 190 /* MappedType */:\n                    return bindAnonymousTypeWorker(node);\n                case 319 /* JSDocClassTag */:\n                    return bindJSDocClassTag(node);\n                case 200 /* ObjectLiteralExpression */:\n                    return bindObjectLiteralExpression(node);\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                    return bindFunctionExpression(node);\n                case 203 /* CallExpression */:\n                    var assignmentKind = ts.getAssignmentDeclarationKind(node);\n                    switch (assignmentKind) {\n                        case 7 /* ObjectDefinePropertyValue */:\n                            return bindObjectDefinePropertyAssignment(node);\n                        case 8 /* ObjectDefinePropertyExports */:\n                            return bindObjectDefinePropertyExport(node);\n                        case 9 /* ObjectDefinePrototypeProperty */:\n                            return bindObjectDefinePrototypeProperty(node);\n                        case 0 /* None */:\n                            break; // Nothing to do\n                        default:\n                            return ts.Debug.fail(\"Unknown call expression assignment declaration kind\");\n                    }\n                    if (ts.isInJSFile(node)) {\n                        bindCallExpression(node);\n                    }\n                    break;\n                // Members of classes, interfaces, and modules\n                case 221 /* ClassExpression */:\n                case 252 /* ClassDeclaration */:\n                    // All classes are automatically in strict mode in ES6.\n                    inStrictMode = true;\n                    return bindClassLikeDeclaration(node);\n                case 253 /* InterfaceDeclaration */:\n                    return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */);\n                case 254 /* TypeAliasDeclaration */:\n                    return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */);\n                case 255 /* EnumDeclaration */:\n                    return bindEnumDeclaration(node);\n                case 256 /* ModuleDeclaration */:\n                    return bindModuleDeclaration(node);\n                // Jsx-attributes\n                case 281 /* JsxAttributes */:\n                    return bindJsxAttributes(node);\n                case 280 /* JsxAttribute */:\n                    return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */);\n                // Imports and exports\n                case 260 /* ImportEqualsDeclaration */:\n                case 263 /* NamespaceImport */:\n                case 265 /* ImportSpecifier */:\n                case 270 /* ExportSpecifier */:\n                    return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);\n                case 259 /* NamespaceExportDeclaration */:\n                    return bindNamespaceExportDeclaration(node);\n                case 262 /* ImportClause */:\n                    return bindImportClause(node);\n                case 267 /* ExportDeclaration */:\n                    return bindExportDeclaration(node);\n                case 266 /* ExportAssignment */:\n                    return bindExportAssignment(node);\n                case 297 /* SourceFile */:\n                    updateStrictModeStatementList(node.statements);\n                    return bindSourceFileIfExternalModule();\n                case 230 /* Block */:\n                    if (!ts.isFunctionLike(node.parent)) {\n                        return;\n                    }\n                // falls through\n                case 257 /* ModuleBlock */:\n                    return updateStrictModeStatementList(node.statements);\n                case 326 /* JSDocParameterTag */:\n                    if (node.parent.kind === 313 /* JSDocSignature */) {\n                        return bindParameter(node);\n                    }\n                    if (node.parent.kind !== 312 /* JSDocTypeLiteral */) {\n                        break;\n                    }\n                // falls through\n                case 333 /* JSDocPropertyTag */:\n                    var propTag = node;\n                    var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 307 /* JSDocOptionalType */ ?\n                        4 /* Property */ | 16777216 /* Optional */ :\n                        4 /* Property */;\n                    return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */);\n                case 331 /* JSDocTypedefTag */:\n                case 324 /* JSDocCallbackTag */:\n                case 325 /* JSDocEnumTag */:\n                    return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);\n            }\n        }\n        function bindPropertyWorker(node) {\n            return bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), 0 /* PropertyExcludes */);\n        }\n        function bindAnonymousTypeWorker(node) {\n            return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, \"__type\" /* Type */);\n        }\n        function bindSourceFileIfExternalModule() {\n            setExportContextFlag(file);\n            if (ts.isExternalModule(file)) {\n                bindSourceFileAsExternalModule();\n            }\n            else if (ts.isJsonSourceFile(file)) {\n                bindSourceFileAsExternalModule();\n                // Create symbol equivalent for the module.exports = {}\n                var originalSymbol = file.symbol;\n                declareSymbol(file.symbol.exports, file.symbol, file, 4 /* Property */, 67108863 /* All */);\n                file.symbol = originalSymbol;\n            }\n        }\n        function bindSourceFileAsExternalModule() {\n            bindAnonymousDeclaration(file, 512 /* ValueModule */, \"\\\"\" + ts.removeFileExtension(file.fileName) + \"\\\"\");\n        }\n        function bindExportAssignment(node) {\n            if (!container.symbol || !container.symbol.exports) {\n                // Export assignment in some sort of block construct\n                bindAnonymousDeclaration(node, 2097152 /* Alias */, getDeclarationName(node));\n            }\n            else {\n                var flags = ts.exportAssignmentIsAlias(node)\n                    // An export default clause with an EntityNameExpression or a class expression exports all meanings of that identifier or expression;\n                    ? 2097152 /* Alias */\n                    // An export default clause with any other expression exports a value\n                    : 4 /* Property */;\n                // If there is an `export default x;` alias declaration, can't `export default` anything else.\n                // (In contrast, you can still have `export default function f() {}` and `export default interface I {}`.)\n                var symbol = declareSymbol(container.symbol.exports, container.symbol, node, flags, 67108863 /* All */);\n                if (node.isExportEquals) {\n                    // Will be an error later, since the module already has other exports. Just make sure this has a valueDeclaration set.\n                    ts.setValueDeclaration(symbol, node);\n                }\n            }\n        }\n        function bindNamespaceExportDeclaration(node) {\n            if (node.modifiers && node.modifiers.length) {\n                file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here));\n            }\n            var diag = !ts.isSourceFile(node.parent) ? ts.Diagnostics.Global_module_exports_may_only_appear_at_top_level\n                : !ts.isExternalModule(node.parent) ? ts.Diagnostics.Global_module_exports_may_only_appear_in_module_files\n                    : !node.parent.isDeclarationFile ? ts.Diagnostics.Global_module_exports_may_only_appear_in_declaration_files\n                        : undefined;\n            if (diag) {\n                file.bindDiagnostics.push(createDiagnosticForNode(node, diag));\n            }\n            else {\n                file.symbol.globalExports = file.symbol.globalExports || ts.createSymbolTable();\n                declareSymbol(file.symbol.globalExports, file.symbol, node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);\n            }\n        }\n        function bindExportDeclaration(node) {\n            if (!container.symbol || !container.symbol.exports) {\n                // Export * in some sort of block construct\n                bindAnonymousDeclaration(node, 8388608 /* ExportStar */, getDeclarationName(node));\n            }\n            else if (!node.exportClause) {\n                // All export * declarations are collected in an __export symbol\n                declareSymbol(container.symbol.exports, container.symbol, node, 8388608 /* ExportStar */, 0 /* None */);\n            }\n            else if (ts.isNamespaceExport(node.exportClause)) {\n                // declareSymbol walks up parents to find name text, parent _must_ be set\n                // but won't be set by the normal binder walk until `bindChildren` later on.\n                ts.setParent(node.exportClause, node);\n                declareSymbol(container.symbol.exports, container.symbol, node.exportClause, 2097152 /* Alias */, 2097152 /* AliasExcludes */);\n            }\n        }\n        function bindImportClause(node) {\n            if (node.name) {\n                declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);\n            }\n        }\n        function setCommonJsModuleIndicator(node) {\n            if (file.externalModuleIndicator) {\n                return false;\n            }\n            if (!file.commonJsModuleIndicator) {\n                file.commonJsModuleIndicator = node;\n                bindSourceFileAsExternalModule();\n            }\n            return true;\n        }\n        function bindObjectDefinePropertyExport(node) {\n            if (!setCommonJsModuleIndicator(node)) {\n                return;\n            }\n            var symbol = forEachIdentifierInEntityName(node.arguments[0], /*parent*/ undefined, function (id, symbol) {\n                if (symbol) {\n                    addDeclarationToSymbol(symbol, id, 1536 /* Module */ | 67108864 /* Assignment */);\n                }\n                return symbol;\n            });\n            if (symbol) {\n                var flags = 4 /* Property */ | 1048576 /* ExportValue */;\n                declareSymbol(symbol.exports, symbol, node, flags, 0 /* None */);\n            }\n        }\n        function bindExportsPropertyAssignment(node) {\n            // When we create a property via 'exports.foo = bar', the 'exports.foo' property access\n            // expression is the declaration\n            if (!setCommonJsModuleIndicator(node)) {\n                return;\n            }\n            var symbol = forEachIdentifierInEntityName(node.left.expression, /*parent*/ undefined, function (id, symbol) {\n                if (symbol) {\n                    addDeclarationToSymbol(symbol, id, 1536 /* Module */ | 67108864 /* Assignment */);\n                }\n                return symbol;\n            });\n            if (symbol) {\n                var isAlias = ts.isAliasableExpression(node.right) && (ts.isExportsIdentifier(node.left.expression) || ts.isModuleExportsAccessExpression(node.left.expression));\n                var flags = isAlias ? 2097152 /* Alias */ : 4 /* Property */ | 1048576 /* ExportValue */;\n                ts.setParent(node.left, node);\n                declareSymbol(symbol.exports, symbol, node.left, flags, 0 /* None */);\n            }\n        }\n        function bindModuleExportsAssignment(node) {\n            // A common practice in node modules is to set 'export = module.exports = {}', this ensures that 'exports'\n            // is still pointing to 'module.exports'.\n            // We do not want to consider this as 'export=' since a module can have only one of these.\n            // Similarly we do not want to treat 'module.exports = exports' as an 'export='.\n            if (!setCommonJsModuleIndicator(node)) {\n                return;\n            }\n            var assignedExpression = ts.getRightMostAssignedExpression(node.right);\n            if (ts.isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) {\n                return;\n            }\n            if (ts.isObjectLiteralExpression(assignedExpression) && ts.every(assignedExpression.properties, ts.isShorthandPropertyAssignment)) {\n                ts.forEach(assignedExpression.properties, bindExportAssignedObjectMemberAlias);\n                return;\n            }\n            // 'module.exports = expr' assignment\n            var flags = ts.exportAssignmentIsAlias(node)\n                ? 2097152 /* Alias */\n                : 4 /* Property */ | 1048576 /* ExportValue */ | 512 /* ValueModule */;\n            var symbol = declareSymbol(file.symbol.exports, file.symbol, node, flags | 67108864 /* Assignment */, 0 /* None */);\n            ts.setValueDeclaration(symbol, node);\n        }\n        function bindExportAssignedObjectMemberAlias(node) {\n            declareSymbol(file.symbol.exports, file.symbol, node, 2097152 /* Alias */ | 67108864 /* Assignment */, 0 /* None */);\n        }\n        function bindThisPropertyAssignment(node) {\n            ts.Debug.assert(ts.isInJSFile(node));\n            // private identifiers *must* be declared (even in JS files)\n            var hasPrivateIdentifier = (ts.isBinaryExpression(node) && ts.isPropertyAccessExpression(node.left) && ts.isPrivateIdentifier(node.left.name))\n                || (ts.isPropertyAccessExpression(node) && ts.isPrivateIdentifier(node.name));\n            if (hasPrivateIdentifier) {\n                return;\n            }\n            var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false);\n            switch (thisContainer.kind) {\n                case 251 /* FunctionDeclaration */:\n                case 208 /* FunctionExpression */:\n                    var constructorSymbol = thisContainer.symbol;\n                    // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression.\n                    if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) {\n                        var l = thisContainer.parent.left;\n                        if (ts.isBindableStaticAccessExpression(l) && ts.isPrototypeAccess(l.expression)) {\n                            constructorSymbol = lookupSymbolForPropertyAccess(l.expression.expression, thisParentContainer);\n                        }\n                    }\n                    if (constructorSymbol && constructorSymbol.valueDeclaration) {\n                        // Declare a 'member' if the container is an ES5 class or ES6 constructor\n                        constructorSymbol.members = constructorSymbol.members || ts.createSymbolTable();\n                        // It's acceptable for multiple 'this' assignments of the same identifier to occur\n                        if (ts.hasDynamicName(node)) {\n                            bindDynamicallyNamedThisPropertyAssignment(node, constructorSymbol);\n                        }\n                        else {\n                            declareSymbol(constructorSymbol.members, constructorSymbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* PropertyExcludes */ & ~4 /* Property */);\n                        }\n                        addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */);\n                    }\n                    break;\n                case 166 /* Constructor */:\n                case 163 /* PropertyDeclaration */:\n                case 165 /* MethodDeclaration */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    // this.foo assignment in a JavaScript class\n                    // Bind this property to the containing class\n                    var containingClass = thisContainer.parent;\n                    var symbolTable = ts.hasSyntacticModifier(thisContainer, 32 /* Static */) ? containingClass.symbol.exports : containingClass.symbol.members;\n                    if (ts.hasDynamicName(node)) {\n                        bindDynamicallyNamedThisPropertyAssignment(node, containingClass.symbol);\n                    }\n                    else {\n                        declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true);\n                    }\n                    break;\n                case 297 /* SourceFile */:\n                    // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script\n                    if (ts.hasDynamicName(node)) {\n                        break;\n                    }\n                    else if (thisContainer.commonJsModuleIndicator) {\n                        declareSymbol(thisContainer.symbol.exports, thisContainer.symbol, node, 4 /* Property */ | 1048576 /* ExportValue */, 0 /* None */);\n                    }\n                    else {\n                        declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 111550 /* FunctionScopedVariableExcludes */);\n                    }\n                    break;\n                default:\n                    ts.Debug.failBadSyntaxKind(thisContainer);\n            }\n        }\n        function bindDynamicallyNamedThisPropertyAssignment(node, symbol) {\n            bindAnonymousDeclaration(node, 4 /* Property */, \"__computed\" /* Computed */);\n            addLateBoundAssignmentDeclarationToSymbol(node, symbol);\n        }\n        function addLateBoundAssignmentDeclarationToSymbol(node, symbol) {\n            if (symbol) {\n                (symbol.assignmentDeclarationMembers || (symbol.assignmentDeclarationMembers = new ts.Map())).set(ts.getNodeId(node), node);\n            }\n        }\n        function bindSpecialPropertyDeclaration(node) {\n            if (node.expression.kind === 107 /* ThisKeyword */) {\n                bindThisPropertyAssignment(node);\n            }\n            else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 297 /* SourceFile */) {\n                if (ts.isPrototypeAccess(node.expression)) {\n                    bindPrototypePropertyAssignment(node, node.parent);\n                }\n                else {\n                    bindStaticPropertyAssignment(node);\n                }\n            }\n        }\n        /** For `x.prototype = { p, ... }`, declare members p,... if `x` is function/class/{}, or not declared. */\n        function bindPrototypeAssignment(node) {\n            ts.setParent(node.left, node);\n            ts.setParent(node.right, node);\n            bindPropertyAssignment(node.left.expression, node.left, /*isPrototypeProperty*/ false, /*containerIsClass*/ true);\n        }\n        function bindObjectDefinePrototypeProperty(node) {\n            var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0].expression);\n            if (namespaceSymbol && namespaceSymbol.valueDeclaration) {\n                // Ensure the namespace symbol becomes class-like\n                addDeclarationToSymbol(namespaceSymbol, namespaceSymbol.valueDeclaration, 32 /* Class */);\n            }\n            bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ true);\n        }\n        /**\n         * For `x.prototype.y = z`, declare a member `y` on `x` if `x` is a function or class, or not declared.\n         * Note that jsdoc preceding an ExpressionStatement like `x.prototype.y;` is also treated as a declaration.\n         */\n        function bindPrototypePropertyAssignment(lhs, parent) {\n            // Look up the function in the local scope, since prototype assignments should\n            // follow the function declaration\n            var classPrototype = lhs.expression;\n            var constructorFunction = classPrototype.expression;\n            // Fix up parent pointers since we're going to use these nodes before we bind into them\n            ts.setParent(constructorFunction, classPrototype);\n            ts.setParent(classPrototype, lhs);\n            ts.setParent(lhs, parent);\n            bindPropertyAssignment(constructorFunction, lhs, /*isPrototypeProperty*/ true, /*containerIsClass*/ true);\n        }\n        function bindObjectDefinePropertyAssignment(node) {\n            var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]);\n            var isToplevel = node.parent.parent.kind === 297 /* SourceFile */;\n            namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false);\n            bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false);\n        }\n        function bindSpecialPropertyAssignment(node) {\n            var _a;\n            // Class declarations in Typescript do not allow property declarations\n            var parentSymbol = lookupSymbolForPropertyAccess(node.left.expression, container) || lookupSymbolForPropertyAccess(node.left.expression, blockScopeContainer);\n            if (!ts.isInJSFile(node) && !ts.isFunctionSymbol(parentSymbol)) {\n                return;\n            }\n            var rootExpr = ts.getLeftmostAccessExpression(node.left);\n            if (ts.isIdentifier(rootExpr) && ((_a = lookupSymbolForName(container, rootExpr.escapedText)) === null || _a === void 0 ? void 0 : _a.flags) & 2097152 /* Alias */) {\n                return;\n            }\n            // Fix up parent pointers since we're going to use these nodes before we bind into them\n            ts.setParent(node.left, node);\n            ts.setParent(node.right, node);\n            if (ts.isIdentifier(node.left.expression) && container === file && isExportsOrModuleExportsOrAlias(file, node.left.expression)) {\n                // This can be an alias for the 'exports' or 'module.exports' names, e.g.\n                //    var util = module.exports;\n                //    util.property = function ...\n                bindExportsPropertyAssignment(node);\n            }\n            else if (ts.hasDynamicName(node)) {\n                bindAnonymousDeclaration(node, 4 /* Property */ | 67108864 /* Assignment */, \"__computed\" /* Computed */);\n                var sym = bindPotentiallyMissingNamespaces(parentSymbol, node.left.expression, isTopLevelNamespaceAssignment(node.left), /*isPrototype*/ false, /*containerIsClass*/ false);\n                addLateBoundAssignmentDeclarationToSymbol(node, sym);\n            }\n            else {\n                bindStaticPropertyAssignment(ts.cast(node.left, ts.isBindableStaticNameExpression));\n            }\n        }\n        /**\n         * For nodes like `x.y = z`, declare a member 'y' on 'x' if x is a function (or IIFE) or class or {}, or not declared.\n         * Also works for expression statements preceded by JSDoc, like / ** @type number * / x.y;\n         */\n        function bindStaticPropertyAssignment(node) {\n            ts.Debug.assert(!ts.isIdentifier(node));\n            ts.setParent(node.expression, node);\n            bindPropertyAssignment(node.expression, node, /*isPrototypeProperty*/ false, /*containerIsClass*/ false);\n        }\n        function bindPotentiallyMissingNamespaces(namespaceSymbol, entityName, isToplevel, isPrototypeProperty, containerIsClass) {\n            if ((namespaceSymbol === null || namespaceSymbol === void 0 ? void 0 : namespaceSymbol.flags) & 2097152 /* Alias */) {\n                return namespaceSymbol;\n            }\n            if (isToplevel && !isPrototypeProperty) {\n                // make symbols or add declarations for intermediate containers\n                var flags_2 = 1536 /* Module */ | 67108864 /* Assignment */;\n                var excludeFlags_1 = 110735 /* ValueModuleExcludes */ & ~67108864 /* Assignment */;\n                namespaceSymbol = forEachIdentifierInEntityName(entityName, namespaceSymbol, function (id, symbol, parent) {\n                    if (symbol) {\n                        addDeclarationToSymbol(symbol, id, flags_2);\n                        return symbol;\n                    }\n                    else {\n                        var table = parent ? parent.exports :\n                            file.jsGlobalAugmentations || (file.jsGlobalAugmentations = ts.createSymbolTable());\n                        return declareSymbol(table, parent, id, flags_2, excludeFlags_1);\n                    }\n                });\n            }\n            if (containerIsClass && namespaceSymbol && namespaceSymbol.valueDeclaration) {\n                addDeclarationToSymbol(namespaceSymbol, namespaceSymbol.valueDeclaration, 32 /* Class */);\n            }\n            return namespaceSymbol;\n        }\n        function bindPotentiallyNewExpandoMemberToNamespace(declaration, namespaceSymbol, isPrototypeProperty) {\n            if (!namespaceSymbol || !isExpandoSymbol(namespaceSymbol)) {\n                return;\n            }\n            // Set up the members collection if it doesn't exist already\n            var symbolTable = isPrototypeProperty ?\n                (namespaceSymbol.members || (namespaceSymbol.members = ts.createSymbolTable())) :\n                (namespaceSymbol.exports || (namespaceSymbol.exports = ts.createSymbolTable()));\n            var includes = 0 /* None */;\n            var excludes = 0 /* None */;\n            // Method-like\n            if (ts.isFunctionLikeDeclaration(ts.getAssignedExpandoInitializer(declaration))) {\n                includes = 8192 /* Method */;\n                excludes = 103359 /* MethodExcludes */;\n            }\n            // Maybe accessor-like\n            else if (ts.isCallExpression(declaration) && ts.isBindableObjectDefinePropertyCall(declaration)) {\n                if (ts.some(declaration.arguments[2].properties, function (p) {\n                    var id = ts.getNameOfDeclaration(p);\n                    return !!id && ts.isIdentifier(id) && ts.idText(id) === \"set\";\n                })) {\n                    // We mix in `SymbolFLags.Property` so in the checker `getTypeOfVariableParameterOrProperty` is used for this\n                    // symbol, instead of `getTypeOfAccessor` (which will assert as there is no real accessor declaration)\n                    includes |= 65536 /* SetAccessor */ | 4 /* Property */;\n                    excludes |= 78783 /* SetAccessorExcludes */;\n                }\n                if (ts.some(declaration.arguments[2].properties, function (p) {\n                    var id = ts.getNameOfDeclaration(p);\n                    return !!id && ts.isIdentifier(id) && ts.idText(id) === \"get\";\n                })) {\n                    includes |= 32768 /* GetAccessor */ | 4 /* Property */;\n                    excludes |= 46015 /* GetAccessorExcludes */;\n                }\n            }\n            if (includes === 0 /* None */) {\n                includes = 4 /* Property */;\n                excludes = 0 /* PropertyExcludes */;\n            }\n            declareSymbol(symbolTable, namespaceSymbol, declaration, includes | 67108864 /* Assignment */, excludes & ~67108864 /* Assignment */);\n        }\n        function isTopLevelNamespaceAssignment(propertyAccess) {\n            return ts.isBinaryExpression(propertyAccess.parent)\n                ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 297 /* SourceFile */\n                : propertyAccess.parent.parent.kind === 297 /* SourceFile */;\n        }\n        function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) {\n            var namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer);\n            var isToplevel = isTopLevelNamespaceAssignment(propertyAccess);\n            namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, propertyAccess.expression, isToplevel, isPrototypeProperty, containerIsClass);\n            bindPotentiallyNewExpandoMemberToNamespace(propertyAccess, namespaceSymbol, isPrototypeProperty);\n        }\n        /**\n         * Javascript expando values are:\n         * - Functions\n         * - classes\n         * - namespaces\n         * - variables initialized with function expressions\n         * -                       with class expressions\n         * -                       with empty object literals\n         * -                       with non-empty object literals if assigned to the prototype property\n         */\n        function isExpandoSymbol(symbol) {\n            if (symbol.flags & (16 /* Function */ | 32 /* Class */ | 1024 /* NamespaceModule */)) {\n                return true;\n            }\n            var node = symbol.valueDeclaration;\n            if (node && ts.isCallExpression(node)) {\n                return !!ts.getAssignedExpandoInitializer(node);\n            }\n            var init = !node ? undefined :\n                ts.isVariableDeclaration(node) ? node.initializer :\n                    ts.isBinaryExpression(node) ? node.right :\n                        ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) ? node.parent.right :\n                            undefined;\n            init = init && ts.getRightMostAssignedExpression(init);\n            if (init) {\n                var isPrototypeAssignment = ts.isPrototypeAccess(ts.isVariableDeclaration(node) ? node.name : ts.isBinaryExpression(node) ? node.left : node);\n                return !!ts.getExpandoInitializer(ts.isBinaryExpression(init) && (init.operatorToken.kind === 56 /* BarBarToken */ || init.operatorToken.kind === 60 /* QuestionQuestionToken */) ? init.right : init, isPrototypeAssignment);\n            }\n            return false;\n        }\n        function getParentOfBinaryExpression(expr) {\n            while (ts.isBinaryExpression(expr.parent)) {\n                expr = expr.parent;\n            }\n            return expr.parent;\n        }\n        function lookupSymbolForPropertyAccess(node, lookupContainer) {\n            if (lookupContainer === void 0) { lookupContainer = container; }\n            if (ts.isIdentifier(node)) {\n                return lookupSymbolForName(lookupContainer, node.escapedText);\n            }\n            else {\n                var symbol = lookupSymbolForPropertyAccess(node.expression);\n                return symbol && symbol.exports && symbol.exports.get(ts.getElementOrPropertyAccessName(node));\n            }\n        }\n        function forEachIdentifierInEntityName(e, parent, action) {\n            if (isExportsOrModuleExportsOrAlias(file, e)) {\n                return file.symbol;\n            }\n            else if (ts.isIdentifier(e)) {\n                return action(e, lookupSymbolForPropertyAccess(e), parent);\n            }\n            else {\n                var s = forEachIdentifierInEntityName(e.expression, parent, action);\n                var name = ts.getNameOrArgument(e);\n                // unreachable\n                if (ts.isPrivateIdentifier(name)) {\n                    ts.Debug.fail(\"unexpected PrivateIdentifier\");\n                }\n                return action(name, s && s.exports && s.exports.get(ts.getElementOrPropertyAccessName(e)), s);\n            }\n        }\n        function bindCallExpression(node) {\n            // We're only inspecting call expressions to detect CommonJS modules, so we can skip\n            // this check if we've already seen the module indicator\n            if (!file.commonJsModuleIndicator && ts.isRequireCall(node, /*checkArgumentIsStringLiteralLike*/ false)) {\n                setCommonJsModuleIndicator(node);\n            }\n        }\n        function bindClassLikeDeclaration(node) {\n            if (node.kind === 252 /* ClassDeclaration */) {\n                bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */);\n            }\n            else {\n                var bindingName = node.name ? node.name.escapedText : \"__class\" /* Class */;\n                bindAnonymousDeclaration(node, 32 /* Class */, bindingName);\n                // Add name of class expression into the map for semantic classifier\n                if (node.name) {\n                    classifiableNames.add(node.name.escapedText);\n                }\n            }\n            var symbol = node.symbol;\n            // TypeScript 1.0 spec (April 2014): 8.4\n            // Every class automatically contains a static property member named 'prototype', the\n            // type of which is an instantiation of the class type with type Any supplied as a type\n            // argument for each type parameter. It is an error to explicitly declare a static\n            // property member with the name 'prototype'.\n            //\n            // Note: we check for this here because this class may be merging into a module.  The\n            // module might have an exported variable called 'prototype'.  We can't allow that as\n            // that would clash with the built-in 'prototype' for the class.\n            var prototypeSymbol = createSymbol(4 /* Property */ | 4194304 /* Prototype */, \"prototype\");\n            var symbolExport = symbol.exports.get(prototypeSymbol.escapedName);\n            if (symbolExport) {\n                if (node.name) {\n                    ts.setParent(node.name, node);\n                }\n                file.bindDiagnostics.push(createDiagnosticForNode(symbolExport.declarations[0], ts.Diagnostics.Duplicate_identifier_0, ts.symbolName(prototypeSymbol)));\n            }\n            symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol);\n            prototypeSymbol.parent = symbol;\n        }\n        function bindEnumDeclaration(node) {\n            return ts.isEnumConst(node)\n                ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */)\n                : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */);\n        }\n        function bindVariableDeclarationOrBindingElement(node) {\n            if (inStrictMode) {\n                checkStrictModeEvalOrArguments(node, node.name);\n            }\n            if (!ts.isBindingPattern(node.name)) {\n                if (ts.isInJSFile(node) && ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true) && !ts.getJSDocTypeTag(node)) {\n                    declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);\n                }\n                else if (ts.isBlockOrCatchScoped(node)) {\n                    bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */);\n                }\n                else if (ts.isParameterDeclaration(node)) {\n                    // It is safe to walk up parent chain to find whether the node is a destructuring parameter declaration\n                    // because its parent chain has already been set up, since parents are set before descending into children.\n                    //\n                    // If node is a binding element in parameter declaration, we need to use ParameterExcludes.\n                    // Using ParameterExcludes flag allows the compiler to report an error on duplicate identifiers in Parameter Declaration\n                    // For example:\n                    //      function foo([a,a]) {} // Duplicate Identifier error\n                    //      function bar(a,a) {}   // Duplicate Identifier error, parameter declaration in this case is handled in bindParameter\n                    //                             // which correctly set excluded symbols\n                    declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 111551 /* ParameterExcludes */);\n                }\n                else {\n                    declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 111550 /* FunctionScopedVariableExcludes */);\n                }\n            }\n        }\n        function bindParameter(node) {\n            if (node.kind === 326 /* JSDocParameterTag */ && container.kind !== 313 /* JSDocSignature */) {\n                return;\n            }\n            if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) {\n                // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a\n                // strict mode FunctionLikeDeclaration or FunctionExpression(13.1)\n                checkStrictModeEvalOrArguments(node, node.name);\n            }\n            if (ts.isBindingPattern(node.name)) {\n                bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, \"__\" + node.parent.parameters.indexOf(node));\n            }\n            else {\n                declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 111551 /* ParameterExcludes */);\n            }\n            // If this is a property-parameter, then also declare the property symbol into the\n            // containing class.\n            if (ts.isParameterPropertyDeclaration(node, node.parent)) {\n                var classDeclaration = node.parent.parent;\n                declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), 0 /* PropertyExcludes */);\n            }\n        }\n        function bindFunctionDeclaration(node) {\n            if (!file.isDeclarationFile && !(node.flags & 8388608 /* Ambient */)) {\n                if (ts.isAsyncFunction(node)) {\n                    emitFlags |= 2048 /* HasAsyncFunctions */;\n                }\n            }\n            checkStrictModeFunctionName(node);\n            if (inStrictMode) {\n                checkStrictModeFunctionDeclaration(node);\n                bindBlockScopedDeclaration(node, 16 /* Function */, 110991 /* FunctionExcludes */);\n            }\n            else {\n                declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 110991 /* FunctionExcludes */);\n            }\n        }\n        function bindFunctionExpression(node) {\n            if (!file.isDeclarationFile && !(node.flags & 8388608 /* Ambient */)) {\n                if (ts.isAsyncFunction(node)) {\n                    emitFlags |= 2048 /* HasAsyncFunctions */;\n                }\n            }\n            if (currentFlow) {\n                node.flowNode = currentFlow;\n            }\n            checkStrictModeFunctionName(node);\n            var bindingName = node.name ? node.name.escapedText : \"__function\" /* Function */;\n            return bindAnonymousDeclaration(node, 16 /* Function */, bindingName);\n        }\n        function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) {\n            if (!file.isDeclarationFile && !(node.flags & 8388608 /* Ambient */) && ts.isAsyncFunction(node)) {\n                emitFlags |= 2048 /* HasAsyncFunctions */;\n            }\n            if (currentFlow && ts.isObjectLiteralOrClassExpressionMethod(node)) {\n                node.flowNode = currentFlow;\n            }\n            return ts.hasDynamicName(node)\n                ? bindAnonymousDeclaration(node, symbolFlags, \"__computed\" /* Computed */)\n                : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes);\n        }\n        function getInferTypeContainer(node) {\n            var extendsType = ts.findAncestor(node, function (n) { return n.parent && ts.isConditionalTypeNode(n.parent) && n.parent.extendsType === n; });\n            return extendsType && extendsType.parent;\n        }\n        function bindTypeParameter(node) {\n            if (ts.isJSDocTemplateTag(node.parent)) {\n                var container_1 = ts.find(node.parent.parent.tags, ts.isJSDocTypeAlias) || ts.getHostSignatureFromJSDoc(node.parent); // TODO: GH#18217\n                if (container_1) {\n                    if (!container_1.locals) {\n                        container_1.locals = ts.createSymbolTable();\n                    }\n                    declareSymbol(container_1.locals, /*parent*/ undefined, node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);\n                }\n                else {\n                    declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);\n                }\n            }\n            else if (node.parent.kind === 185 /* InferType */) {\n                var container_2 = getInferTypeContainer(node.parent);\n                if (container_2) {\n                    if (!container_2.locals) {\n                        container_2.locals = ts.createSymbolTable();\n                    }\n                    declareSymbol(container_2.locals, /*parent*/ undefined, node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);\n                }\n                else {\n                    bindAnonymousDeclaration(node, 262144 /* TypeParameter */, getDeclarationName(node)); // TODO: GH#18217\n                }\n            }\n            else {\n                declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);\n            }\n        }\n        // reachability checks\n        function shouldReportErrorOnModuleDeclaration(node) {\n            var instanceState = getModuleInstanceState(node);\n            return instanceState === 1 /* Instantiated */ || (instanceState === 2 /* ConstEnumOnly */ && ts.shouldPreserveConstEnums(options));\n        }\n        function checkUnreachable(node) {\n            if (!(currentFlow.flags & 1 /* Unreachable */)) {\n                return false;\n            }\n            if (currentFlow === unreachableFlow) {\n                var reportError = \n                // report error on all statements except empty ones\n                (ts.isStatementButNotDeclaration(node) && node.kind !== 231 /* EmptyStatement */) ||\n                    // report error on class declarations\n                    node.kind === 252 /* ClassDeclaration */ ||\n                    // report error on instantiated modules or const-enums only modules if preserveConstEnums is set\n                    (node.kind === 256 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node));\n                if (reportError) {\n                    currentFlow = reportedUnreachableFlow;\n                    if (!options.allowUnreachableCode) {\n                        // unreachable code is reported if\n                        // - user has explicitly asked about it AND\n                        // - statement is in not ambient context (statements in ambient context is already an error\n                        //   so we should not report extras) AND\n                        //   - node is not variable statement OR\n                        //   - node is block scoped variable statement OR\n                        //   - node is not block scoped variable statement and at least one variable declaration has initializer\n                        //   Rationale: we don't want to report errors on non-initialized var's since they are hoisted\n                        //   On the other side we do want to report errors on non-initialized 'lets' because of TDZ\n                        var isError_1 = ts.unreachableCodeIsError(options) &&\n                            !(node.flags & 8388608 /* Ambient */) &&\n                            (!ts.isVariableStatement(node) ||\n                                !!(ts.getCombinedNodeFlags(node.declarationList) & 3 /* BlockScoped */) ||\n                                node.declarationList.declarations.some(function (d) { return !!d.initializer; }));\n                        eachUnreachableRange(node, function (start, end) { return errorOrSuggestionOnRange(isError_1, start, end, ts.Diagnostics.Unreachable_code_detected); });\n                    }\n                }\n            }\n            return true;\n        }\n    }\n    function eachUnreachableRange(node, cb) {\n        if (ts.isStatement(node) && isExecutableStatement(node) && ts.isBlock(node.parent)) {\n            var statements = node.parent.statements;\n            var slice_1 = ts.sliceAfter(statements, node);\n            ts.getRangesWhere(slice_1, isExecutableStatement, function (start, afterEnd) { return cb(slice_1[start], slice_1[afterEnd - 1]); });\n        }\n        else {\n            cb(node, node);\n        }\n    }\n    // As opposed to a pure declaration like an `interface`\n    function isExecutableStatement(s) {\n        // Don't remove statements that can validly be used before they appear.\n        return !ts.isFunctionDeclaration(s) && !isPurelyTypeDeclaration(s) && !ts.isEnumDeclaration(s) &&\n            // `var x;` may declare a variable used above\n            !(ts.isVariableStatement(s) && !(ts.getCombinedNodeFlags(s) & (1 /* Let */ | 2 /* Const */)) && s.declarationList.declarations.some(function (d) { return !d.initializer; }));\n    }\n    function isPurelyTypeDeclaration(s) {\n        switch (s.kind) {\n            case 253 /* InterfaceDeclaration */:\n            case 254 /* TypeAliasDeclaration */:\n                return true;\n            case 256 /* ModuleDeclaration */:\n                return getModuleInstanceState(s) !== 1 /* Instantiated */;\n            case 255 /* EnumDeclaration */:\n                return ts.hasSyntacticModifier(s, 2048 /* Const */);\n            default:\n                return false;\n        }\n    }\n    function isExportsOrModuleExportsOrAlias(sourceFile, node) {\n        var i = 0;\n        var q = [node];\n        while (q.length && i < 100) {\n            i++;\n            node = q.shift();\n            if (ts.isExportsIdentifier(node) || ts.isModuleExportsAccessExpression(node)) {\n                return true;\n            }\n            else if (ts.isIdentifier(node)) {\n                var symbol = lookupSymbolForName(sourceFile, node.escapedText);\n                if (!!symbol && !!symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && !!symbol.valueDeclaration.initializer) {\n                    var init = symbol.valueDeclaration.initializer;\n                    q.push(init);\n                    if (ts.isAssignmentExpression(init, /*excludeCompoundAssignment*/ true)) {\n                        q.push(init.left);\n                        q.push(init.right);\n                    }\n                }\n            }\n        }\n        return false;\n    }\n    ts.isExportsOrModuleExportsOrAlias = isExportsOrModuleExportsOrAlias;\n    function lookupSymbolForName(container, name) {\n        var local = container.locals && container.locals.get(name);\n        if (local) {\n            return local.exportSymbol || local;\n        }\n        if (ts.isSourceFile(container) && container.jsGlobalAugmentations && container.jsGlobalAugmentations.has(name)) {\n            return container.jsGlobalAugmentations.get(name);\n        }\n        return container.symbol && container.symbol.exports && container.symbol.exports.get(name);\n    }\n})(ts || (ts = {}));\n/** @internal */\nvar ts;\n(function (ts) {\n    function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintOfTypeParameter, getFirstIdentifier, getTypeArguments) {\n        return getSymbolWalker;\n        function getSymbolWalker(accept) {\n            if (accept === void 0) { accept = function () { return true; }; }\n            var visitedTypes = []; // Sparse array from id to type\n            var visitedSymbols = []; // Sparse array from id to symbol\n            return {\n                walkType: function (type) {\n                    try {\n                        visitType(type);\n                        return { visitedTypes: ts.getOwnValues(visitedTypes), visitedSymbols: ts.getOwnValues(visitedSymbols) };\n                    }\n                    finally {\n                        ts.clear(visitedTypes);\n                        ts.clear(visitedSymbols);\n                    }\n                },\n                walkSymbol: function (symbol) {\n                    try {\n                        visitSymbol(symbol);\n                        return { visitedTypes: ts.getOwnValues(visitedTypes), visitedSymbols: ts.getOwnValues(visitedSymbols) };\n                    }\n                    finally {\n                        ts.clear(visitedTypes);\n                        ts.clear(visitedSymbols);\n                    }\n                },\n            };\n            function visitType(type) {\n                if (!type) {\n                    return;\n                }\n                if (visitedTypes[type.id]) {\n                    return;\n                }\n                visitedTypes[type.id] = type;\n                // Reuse visitSymbol to visit the type's symbol,\n                //  but be sure to bail on recuring into the type if accept declines the symbol.\n                var shouldBail = visitSymbol(type.symbol);\n                if (shouldBail)\n                    return;\n                // Visit the type's related types, if any\n                if (type.flags & 524288 /* Object */) {\n                    var objectType = type;\n                    var objectFlags = objectType.objectFlags;\n                    if (objectFlags & 4 /* Reference */) {\n                        visitTypeReference(type);\n                    }\n                    if (objectFlags & 32 /* Mapped */) {\n                        visitMappedType(type);\n                    }\n                    if (objectFlags & (1 /* Class */ | 2 /* Interface */)) {\n                        visitInterfaceType(type);\n                    }\n                    if (objectFlags & (8 /* Tuple */ | 16 /* Anonymous */)) {\n                        visitObjectType(objectType);\n                    }\n                }\n                if (type.flags & 262144 /* TypeParameter */) {\n                    visitTypeParameter(type);\n                }\n                if (type.flags & 3145728 /* UnionOrIntersection */) {\n                    visitUnionOrIntersectionType(type);\n                }\n                if (type.flags & 4194304 /* Index */) {\n                    visitIndexType(type);\n                }\n                if (type.flags & 8388608 /* IndexedAccess */) {\n                    visitIndexedAccessType(type);\n                }\n            }\n            function visitTypeReference(type) {\n                visitType(type.target);\n                ts.forEach(getTypeArguments(type), visitType);\n            }\n            function visitTypeParameter(type) {\n                visitType(getConstraintOfTypeParameter(type));\n            }\n            function visitUnionOrIntersectionType(type) {\n                ts.forEach(type.types, visitType);\n            }\n            function visitIndexType(type) {\n                visitType(type.type);\n            }\n            function visitIndexedAccessType(type) {\n                visitType(type.objectType);\n                visitType(type.indexType);\n                visitType(type.constraint);\n            }\n            function visitMappedType(type) {\n                visitType(type.typeParameter);\n                visitType(type.constraintType);\n                visitType(type.templateType);\n                visitType(type.modifiersType);\n            }\n            function visitSignature(signature) {\n                var typePredicate = getTypePredicateOfSignature(signature);\n                if (typePredicate) {\n                    visitType(typePredicate.type);\n                }\n                ts.forEach(signature.typeParameters, visitType);\n                for (var _i = 0, _a = signature.parameters; _i < _a.length; _i++) {\n                    var parameter = _a[_i];\n                    visitSymbol(parameter);\n                }\n                visitType(getRestTypeOfSignature(signature));\n                visitType(getReturnTypeOfSignature(signature));\n            }\n            function visitInterfaceType(interfaceT) {\n                visitObjectType(interfaceT);\n                ts.forEach(interfaceT.typeParameters, visitType);\n                ts.forEach(getBaseTypes(interfaceT), visitType);\n                visitType(interfaceT.thisType);\n            }\n            function visitObjectType(type) {\n                var stringIndexType = getIndexTypeOfStructuredType(type, 0 /* String */);\n                visitType(stringIndexType);\n                var numberIndexType = getIndexTypeOfStructuredType(type, 1 /* Number */);\n                visitType(numberIndexType);\n                // The two checks above *should* have already resolved the type (if needed), so this should be cached\n                var resolved = resolveStructuredTypeMembers(type);\n                for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) {\n                    var signature = _a[_i];\n                    visitSignature(signature);\n                }\n                for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) {\n                    var signature = _c[_b];\n                    visitSignature(signature);\n                }\n                for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) {\n                    var p = _e[_d];\n                    visitSymbol(p);\n                }\n            }\n            function visitSymbol(symbol) {\n                if (!symbol) {\n                    return false;\n                }\n                var symbolId = ts.getSymbolId(symbol);\n                if (visitedSymbols[symbolId]) {\n                    return false;\n                }\n                visitedSymbols[symbolId] = symbol;\n                if (!accept(symbol)) {\n                    return true;\n                }\n                var t = getTypeOfSymbol(symbol);\n                visitType(t); // Should handle members on classes and such\n                if (symbol.exports) {\n                    symbol.exports.forEach(visitSymbol);\n                }\n                ts.forEach(symbol.declarations, function (d) {\n                    // Type queries are too far resolved when we just visit the symbol's type\n                    //  (their type resolved directly to the member deeply referenced)\n                    // So to get the intervening symbols, we need to check if there's a type\n                    // query node on any of the symbol's declarations and get symbols there\n                    if (d.type && d.type.kind === 176 /* TypeQuery */) {\n                        var query = d.type;\n                        var entity = getResolvedSymbol(getFirstIdentifier(query.exprName));\n                        visitSymbol(entity);\n                    }\n                });\n                return false;\n            }\n        }\n    }\n    ts.createGetSymbolWalker = createGetSymbolWalker;\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var ambientModuleSymbolRegex = /^\".+\"$/;\n    var anon = \"(anonymous)\";\n    var nextSymbolId = 1;\n    var nextNodeId = 1;\n    var nextMergeId = 1;\n    var nextFlowId = 1;\n    var IterationUse;\n    (function (IterationUse) {\n        IterationUse[IterationUse[\"AllowsSyncIterablesFlag\"] = 1] = \"AllowsSyncIterablesFlag\";\n        IterationUse[IterationUse[\"AllowsAsyncIterablesFlag\"] = 2] = \"AllowsAsyncIterablesFlag\";\n        IterationUse[IterationUse[\"AllowsStringInputFlag\"] = 4] = \"AllowsStringInputFlag\";\n        IterationUse[IterationUse[\"ForOfFlag\"] = 8] = \"ForOfFlag\";\n        IterationUse[IterationUse[\"YieldStarFlag\"] = 16] = \"YieldStarFlag\";\n        IterationUse[IterationUse[\"SpreadFlag\"] = 32] = \"SpreadFlag\";\n        IterationUse[IterationUse[\"DestructuringFlag\"] = 64] = \"DestructuringFlag\";\n        IterationUse[IterationUse[\"PossiblyOutOfBounds\"] = 128] = \"PossiblyOutOfBounds\";\n        // Spread, Destructuring, Array element assignment\n        IterationUse[IterationUse[\"Element\"] = 1] = \"Element\";\n        IterationUse[IterationUse[\"Spread\"] = 33] = \"Spread\";\n        IterationUse[IterationUse[\"Destructuring\"] = 65] = \"Destructuring\";\n        IterationUse[IterationUse[\"ForOf\"] = 13] = \"ForOf\";\n        IterationUse[IterationUse[\"ForAwaitOf\"] = 15] = \"ForAwaitOf\";\n        IterationUse[IterationUse[\"YieldStar\"] = 17] = \"YieldStar\";\n        IterationUse[IterationUse[\"AsyncYieldStar\"] = 19] = \"AsyncYieldStar\";\n        IterationUse[IterationUse[\"GeneratorReturnType\"] = 1] = \"GeneratorReturnType\";\n        IterationUse[IterationUse[\"AsyncGeneratorReturnType\"] = 2] = \"AsyncGeneratorReturnType\";\n    })(IterationUse || (IterationUse = {}));\n    var IterationTypeKind;\n    (function (IterationTypeKind) {\n        IterationTypeKind[IterationTypeKind[\"Yield\"] = 0] = \"Yield\";\n        IterationTypeKind[IterationTypeKind[\"Return\"] = 1] = \"Return\";\n        IterationTypeKind[IterationTypeKind[\"Next\"] = 2] = \"Next\";\n    })(IterationTypeKind || (IterationTypeKind = {}));\n    var WideningKind;\n    (function (WideningKind) {\n        WideningKind[WideningKind[\"Normal\"] = 0] = \"Normal\";\n        WideningKind[WideningKind[\"FunctionReturn\"] = 1] = \"FunctionReturn\";\n        WideningKind[WideningKind[\"GeneratorNext\"] = 2] = \"GeneratorNext\";\n        WideningKind[WideningKind[\"GeneratorYield\"] = 3] = \"GeneratorYield\";\n    })(WideningKind || (WideningKind = {}));\n    var TypeFacts;\n    (function (TypeFacts) {\n        TypeFacts[TypeFacts[\"None\"] = 0] = \"None\";\n        TypeFacts[TypeFacts[\"TypeofEQString\"] = 1] = \"TypeofEQString\";\n        TypeFacts[TypeFacts[\"TypeofEQNumber\"] = 2] = \"TypeofEQNumber\";\n        TypeFacts[TypeFacts[\"TypeofEQBigInt\"] = 4] = \"TypeofEQBigInt\";\n        TypeFacts[TypeFacts[\"TypeofEQBoolean\"] = 8] = \"TypeofEQBoolean\";\n        TypeFacts[TypeFacts[\"TypeofEQSymbol\"] = 16] = \"TypeofEQSymbol\";\n        TypeFacts[TypeFacts[\"TypeofEQObject\"] = 32] = \"TypeofEQObject\";\n        TypeFacts[TypeFacts[\"TypeofEQFunction\"] = 64] = \"TypeofEQFunction\";\n        TypeFacts[TypeFacts[\"TypeofEQHostObject\"] = 128] = \"TypeofEQHostObject\";\n        TypeFacts[TypeFacts[\"TypeofNEString\"] = 256] = \"TypeofNEString\";\n        TypeFacts[TypeFacts[\"TypeofNENumber\"] = 512] = \"TypeofNENumber\";\n        TypeFacts[TypeFacts[\"TypeofNEBigInt\"] = 1024] = \"TypeofNEBigInt\";\n        TypeFacts[TypeFacts[\"TypeofNEBoolean\"] = 2048] = \"TypeofNEBoolean\";\n        TypeFacts[TypeFacts[\"TypeofNESymbol\"] = 4096] = \"TypeofNESymbol\";\n        TypeFacts[TypeFacts[\"TypeofNEObject\"] = 8192] = \"TypeofNEObject\";\n        TypeFacts[TypeFacts[\"TypeofNEFunction\"] = 16384] = \"TypeofNEFunction\";\n        TypeFacts[TypeFacts[\"TypeofNEHostObject\"] = 32768] = \"TypeofNEHostObject\";\n        TypeFacts[TypeFacts[\"EQUndefined\"] = 65536] = \"EQUndefined\";\n        TypeFacts[TypeFacts[\"EQNull\"] = 131072] = \"EQNull\";\n        TypeFacts[TypeFacts[\"EQUndefinedOrNull\"] = 262144] = \"EQUndefinedOrNull\";\n        TypeFacts[TypeFacts[\"NEUndefined\"] = 524288] = \"NEUndefined\";\n        TypeFacts[TypeFacts[\"NENull\"] = 1048576] = \"NENull\";\n        TypeFacts[TypeFacts[\"NEUndefinedOrNull\"] = 2097152] = \"NEUndefinedOrNull\";\n        TypeFacts[TypeFacts[\"Truthy\"] = 4194304] = \"Truthy\";\n        TypeFacts[TypeFacts[\"Falsy\"] = 8388608] = \"Falsy\";\n        TypeFacts[TypeFacts[\"All\"] = 16777215] = \"All\";\n        // The following members encode facts about particular kinds of types for use in the getTypeFacts function.\n        // The presence of a particular fact means that the given test is true for some (and possibly all) values\n        // of that kind of type.\n        TypeFacts[TypeFacts[\"BaseStringStrictFacts\"] = 3735041] = \"BaseStringStrictFacts\";\n        TypeFacts[TypeFacts[\"BaseStringFacts\"] = 12582401] = \"BaseStringFacts\";\n        TypeFacts[TypeFacts[\"StringStrictFacts\"] = 16317953] = \"StringStrictFacts\";\n        TypeFacts[TypeFacts[\"StringFacts\"] = 16776705] = \"StringFacts\";\n        TypeFacts[TypeFacts[\"EmptyStringStrictFacts\"] = 12123649] = \"EmptyStringStrictFacts\";\n        TypeFacts[TypeFacts[\"EmptyStringFacts\"] = 12582401] = \"EmptyStringFacts\";\n        TypeFacts[TypeFacts[\"NonEmptyStringStrictFacts\"] = 7929345] = \"NonEmptyStringStrictFacts\";\n        TypeFacts[TypeFacts[\"NonEmptyStringFacts\"] = 16776705] = \"NonEmptyStringFacts\";\n        TypeFacts[TypeFacts[\"BaseNumberStrictFacts\"] = 3734786] = \"BaseNumberStrictFacts\";\n        TypeFacts[TypeFacts[\"BaseNumberFacts\"] = 12582146] = \"BaseNumberFacts\";\n        TypeFacts[TypeFacts[\"NumberStrictFacts\"] = 16317698] = \"NumberStrictFacts\";\n        TypeFacts[TypeFacts[\"NumberFacts\"] = 16776450] = \"NumberFacts\";\n        TypeFacts[TypeFacts[\"ZeroNumberStrictFacts\"] = 12123394] = \"ZeroNumberStrictFacts\";\n        TypeFacts[TypeFacts[\"ZeroNumberFacts\"] = 12582146] = \"ZeroNumberFacts\";\n        TypeFacts[TypeFacts[\"NonZeroNumberStrictFacts\"] = 7929090] = \"NonZeroNumberStrictFacts\";\n        TypeFacts[TypeFacts[\"NonZeroNumberFacts\"] = 16776450] = \"NonZeroNumberFacts\";\n        TypeFacts[TypeFacts[\"BaseBigIntStrictFacts\"] = 3734276] = \"BaseBigIntStrictFacts\";\n        TypeFacts[TypeFacts[\"BaseBigIntFacts\"] = 12581636] = \"BaseBigIntFacts\";\n        TypeFacts[TypeFacts[\"BigIntStrictFacts\"] = 16317188] = \"BigIntStrictFacts\";\n        TypeFacts[TypeFacts[\"BigIntFacts\"] = 16775940] = \"BigIntFacts\";\n        TypeFacts[TypeFacts[\"ZeroBigIntStrictFacts\"] = 12122884] = \"ZeroBigIntStrictFacts\";\n        TypeFacts[TypeFacts[\"ZeroBigIntFacts\"] = 12581636] = \"ZeroBigIntFacts\";\n        TypeFacts[TypeFacts[\"NonZeroBigIntStrictFacts\"] = 7928580] = \"NonZeroBigIntStrictFacts\";\n        TypeFacts[TypeFacts[\"NonZeroBigIntFacts\"] = 16775940] = \"NonZeroBigIntFacts\";\n        TypeFacts[TypeFacts[\"BaseBooleanStrictFacts\"] = 3733256] = \"BaseBooleanStrictFacts\";\n        TypeFacts[TypeFacts[\"BaseBooleanFacts\"] = 12580616] = \"BaseBooleanFacts\";\n        TypeFacts[TypeFacts[\"BooleanStrictFacts\"] = 16316168] = \"BooleanStrictFacts\";\n        TypeFacts[TypeFacts[\"BooleanFacts\"] = 16774920] = \"BooleanFacts\";\n        TypeFacts[TypeFacts[\"FalseStrictFacts\"] = 12121864] = \"FalseStrictFacts\";\n        TypeFacts[TypeFacts[\"FalseFacts\"] = 12580616] = \"FalseFacts\";\n        TypeFacts[TypeFacts[\"TrueStrictFacts\"] = 7927560] = \"TrueStrictFacts\";\n        TypeFacts[TypeFacts[\"TrueFacts\"] = 16774920] = \"TrueFacts\";\n        TypeFacts[TypeFacts[\"SymbolStrictFacts\"] = 7925520] = \"SymbolStrictFacts\";\n        TypeFacts[TypeFacts[\"SymbolFacts\"] = 16772880] = \"SymbolFacts\";\n        TypeFacts[TypeFacts[\"ObjectStrictFacts\"] = 7888800] = \"ObjectStrictFacts\";\n        TypeFacts[TypeFacts[\"ObjectFacts\"] = 16736160] = \"ObjectFacts\";\n        TypeFacts[TypeFacts[\"FunctionStrictFacts\"] = 7880640] = \"FunctionStrictFacts\";\n        TypeFacts[TypeFacts[\"FunctionFacts\"] = 16728000] = \"FunctionFacts\";\n        TypeFacts[TypeFacts[\"UndefinedFacts\"] = 9830144] = \"UndefinedFacts\";\n        TypeFacts[TypeFacts[\"NullFacts\"] = 9363232] = \"NullFacts\";\n        TypeFacts[TypeFacts[\"EmptyObjectStrictFacts\"] = 16318463] = \"EmptyObjectStrictFacts\";\n        TypeFacts[TypeFacts[\"AllTypeofNE\"] = 556800] = \"AllTypeofNE\";\n        TypeFacts[TypeFacts[\"EmptyObjectFacts\"] = 16777215] = \"EmptyObjectFacts\";\n    })(TypeFacts || (TypeFacts = {}));\n    var typeofEQFacts = new ts.Map(ts.getEntries({\n        string: 1 /* TypeofEQString */,\n        number: 2 /* TypeofEQNumber */,\n        bigint: 4 /* TypeofEQBigInt */,\n        boolean: 8 /* TypeofEQBoolean */,\n        symbol: 16 /* TypeofEQSymbol */,\n        undefined: 65536 /* EQUndefined */,\n        object: 32 /* TypeofEQObject */,\n        function: 64 /* TypeofEQFunction */\n    }));\n    var typeofNEFacts = new ts.Map(ts.getEntries({\n        string: 256 /* TypeofNEString */,\n        number: 512 /* TypeofNENumber */,\n        bigint: 1024 /* TypeofNEBigInt */,\n        boolean: 2048 /* TypeofNEBoolean */,\n        symbol: 4096 /* TypeofNESymbol */,\n        undefined: 524288 /* NEUndefined */,\n        object: 8192 /* TypeofNEObject */,\n        function: 16384 /* TypeofNEFunction */\n    }));\n    var TypeSystemPropertyName;\n    (function (TypeSystemPropertyName) {\n        TypeSystemPropertyName[TypeSystemPropertyName[\"Type\"] = 0] = \"Type\";\n        TypeSystemPropertyName[TypeSystemPropertyName[\"ResolvedBaseConstructorType\"] = 1] = \"ResolvedBaseConstructorType\";\n        TypeSystemPropertyName[TypeSystemPropertyName[\"DeclaredType\"] = 2] = \"DeclaredType\";\n        TypeSystemPropertyName[TypeSystemPropertyName[\"ResolvedReturnType\"] = 3] = \"ResolvedReturnType\";\n        TypeSystemPropertyName[TypeSystemPropertyName[\"ImmediateBaseConstraint\"] = 4] = \"ImmediateBaseConstraint\";\n        TypeSystemPropertyName[TypeSystemPropertyName[\"EnumTagType\"] = 5] = \"EnumTagType\";\n        TypeSystemPropertyName[TypeSystemPropertyName[\"ResolvedTypeArguments\"] = 6] = \"ResolvedTypeArguments\";\n        TypeSystemPropertyName[TypeSystemPropertyName[\"ResolvedBaseTypes\"] = 7] = \"ResolvedBaseTypes\";\n    })(TypeSystemPropertyName || (TypeSystemPropertyName = {}));\n    var CheckMode;\n    (function (CheckMode) {\n        CheckMode[CheckMode[\"Normal\"] = 0] = \"Normal\";\n        CheckMode[CheckMode[\"Contextual\"] = 1] = \"Contextual\";\n        CheckMode[CheckMode[\"Inferential\"] = 2] = \"Inferential\";\n        CheckMode[CheckMode[\"SkipContextSensitive\"] = 4] = \"SkipContextSensitive\";\n        CheckMode[CheckMode[\"SkipGenericFunctions\"] = 8] = \"SkipGenericFunctions\";\n        CheckMode[CheckMode[\"IsForSignatureHelp\"] = 16] = \"IsForSignatureHelp\";\n    })(CheckMode || (CheckMode = {}));\n    var AccessFlags;\n    (function (AccessFlags) {\n        AccessFlags[AccessFlags[\"None\"] = 0] = \"None\";\n        AccessFlags[AccessFlags[\"NoIndexSignatures\"] = 1] = \"NoIndexSignatures\";\n        AccessFlags[AccessFlags[\"Writing\"] = 2] = \"Writing\";\n        AccessFlags[AccessFlags[\"CacheSymbol\"] = 4] = \"CacheSymbol\";\n        AccessFlags[AccessFlags[\"NoTupleBoundsCheck\"] = 8] = \"NoTupleBoundsCheck\";\n        AccessFlags[AccessFlags[\"ExpressionPosition\"] = 16] = \"ExpressionPosition\";\n    })(AccessFlags || (AccessFlags = {}));\n    var SignatureCheckMode;\n    (function (SignatureCheckMode) {\n        SignatureCheckMode[SignatureCheckMode[\"BivariantCallback\"] = 1] = \"BivariantCallback\";\n        SignatureCheckMode[SignatureCheckMode[\"StrictCallback\"] = 2] = \"StrictCallback\";\n        SignatureCheckMode[SignatureCheckMode[\"IgnoreReturnTypes\"] = 4] = \"IgnoreReturnTypes\";\n        SignatureCheckMode[SignatureCheckMode[\"StrictArity\"] = 8] = \"StrictArity\";\n        SignatureCheckMode[SignatureCheckMode[\"Callback\"] = 3] = \"Callback\";\n    })(SignatureCheckMode || (SignatureCheckMode = {}));\n    var IntersectionState;\n    (function (IntersectionState) {\n        IntersectionState[IntersectionState[\"None\"] = 0] = \"None\";\n        IntersectionState[IntersectionState[\"Source\"] = 1] = \"Source\";\n        IntersectionState[IntersectionState[\"Target\"] = 2] = \"Target\";\n        IntersectionState[IntersectionState[\"PropertyCheck\"] = 4] = \"PropertyCheck\";\n        IntersectionState[IntersectionState[\"UnionIntersectionCheck\"] = 8] = \"UnionIntersectionCheck\";\n        IntersectionState[IntersectionState[\"InPropertyCheck\"] = 16] = \"InPropertyCheck\";\n    })(IntersectionState || (IntersectionState = {}));\n    var MappedTypeModifiers;\n    (function (MappedTypeModifiers) {\n        MappedTypeModifiers[MappedTypeModifiers[\"IncludeReadonly\"] = 1] = \"IncludeReadonly\";\n        MappedTypeModifiers[MappedTypeModifiers[\"ExcludeReadonly\"] = 2] = \"ExcludeReadonly\";\n        MappedTypeModifiers[MappedTypeModifiers[\"IncludeOptional\"] = 4] = \"IncludeOptional\";\n        MappedTypeModifiers[MappedTypeModifiers[\"ExcludeOptional\"] = 8] = \"ExcludeOptional\";\n    })(MappedTypeModifiers || (MappedTypeModifiers = {}));\n    var ExpandingFlags;\n    (function (ExpandingFlags) {\n        ExpandingFlags[ExpandingFlags[\"None\"] = 0] = \"None\";\n        ExpandingFlags[ExpandingFlags[\"Source\"] = 1] = \"Source\";\n        ExpandingFlags[ExpandingFlags[\"Target\"] = 2] = \"Target\";\n        ExpandingFlags[ExpandingFlags[\"Both\"] = 3] = \"Both\";\n    })(ExpandingFlags || (ExpandingFlags = {}));\n    var MembersOrExportsResolutionKind;\n    (function (MembersOrExportsResolutionKind) {\n        MembersOrExportsResolutionKind[\"resolvedExports\"] = \"resolvedExports\";\n        MembersOrExportsResolutionKind[\"resolvedMembers\"] = \"resolvedMembers\";\n    })(MembersOrExportsResolutionKind || (MembersOrExportsResolutionKind = {}));\n    var UnusedKind;\n    (function (UnusedKind) {\n        UnusedKind[UnusedKind[\"Local\"] = 0] = \"Local\";\n        UnusedKind[UnusedKind[\"Parameter\"] = 1] = \"Parameter\";\n    })(UnusedKind || (UnusedKind = {}));\n    var isNotOverloadAndNotAccessor = ts.and(isNotOverload, isNotAccessor);\n    var DeclarationMeaning;\n    (function (DeclarationMeaning) {\n        DeclarationMeaning[DeclarationMeaning[\"GetAccessor\"] = 1] = \"GetAccessor\";\n        DeclarationMeaning[DeclarationMeaning[\"SetAccessor\"] = 2] = \"SetAccessor\";\n        DeclarationMeaning[DeclarationMeaning[\"PropertyAssignment\"] = 4] = \"PropertyAssignment\";\n        DeclarationMeaning[DeclarationMeaning[\"Method\"] = 8] = \"Method\";\n        DeclarationMeaning[DeclarationMeaning[\"GetOrSetAccessor\"] = 3] = \"GetOrSetAccessor\";\n        DeclarationMeaning[DeclarationMeaning[\"PropertyAssignmentOrMethod\"] = 12] = \"PropertyAssignmentOrMethod\";\n    })(DeclarationMeaning || (DeclarationMeaning = {}));\n    var DeclarationSpaces;\n    (function (DeclarationSpaces) {\n        DeclarationSpaces[DeclarationSpaces[\"None\"] = 0] = \"None\";\n        DeclarationSpaces[DeclarationSpaces[\"ExportValue\"] = 1] = \"ExportValue\";\n        DeclarationSpaces[DeclarationSpaces[\"ExportType\"] = 2] = \"ExportType\";\n        DeclarationSpaces[DeclarationSpaces[\"ExportNamespace\"] = 4] = \"ExportNamespace\";\n    })(DeclarationSpaces || (DeclarationSpaces = {}));\n    var MinArgumentCountFlags;\n    (function (MinArgumentCountFlags) {\n        MinArgumentCountFlags[MinArgumentCountFlags[\"None\"] = 0] = \"None\";\n        MinArgumentCountFlags[MinArgumentCountFlags[\"StrongArityForUntypedJS\"] = 1] = \"StrongArityForUntypedJS\";\n        MinArgumentCountFlags[MinArgumentCountFlags[\"VoidIsNonOptional\"] = 2] = \"VoidIsNonOptional\";\n    })(MinArgumentCountFlags || (MinArgumentCountFlags = {}));\n    var IntrinsicTypeKind;\n    (function (IntrinsicTypeKind) {\n        IntrinsicTypeKind[IntrinsicTypeKind[\"Uppercase\"] = 0] = \"Uppercase\";\n        IntrinsicTypeKind[IntrinsicTypeKind[\"Lowercase\"] = 1] = \"Lowercase\";\n        IntrinsicTypeKind[IntrinsicTypeKind[\"Capitalize\"] = 2] = \"Capitalize\";\n        IntrinsicTypeKind[IntrinsicTypeKind[\"Uncapitalize\"] = 3] = \"Uncapitalize\";\n    })(IntrinsicTypeKind || (IntrinsicTypeKind = {}));\n    var intrinsicTypeKinds = new ts.Map(ts.getEntries({\n        Uppercase: 0 /* Uppercase */,\n        Lowercase: 1 /* Lowercase */,\n        Capitalize: 2 /* Capitalize */,\n        Uncapitalize: 3 /* Uncapitalize */\n    }));\n    function SymbolLinks() {\n    }\n    function NodeLinks() {\n        this.flags = 0;\n    }\n    function getNodeId(node) {\n        if (!node.id) {\n            node.id = nextNodeId;\n            nextNodeId++;\n        }\n        return node.id;\n    }\n    ts.getNodeId = getNodeId;\n    function getSymbolId(symbol) {\n        if (!symbol.id) {\n            symbol.id = nextSymbolId;\n            nextSymbolId++;\n        }\n        return symbol.id;\n    }\n    ts.getSymbolId = getSymbolId;\n    function isInstantiatedModule(node, preserveConstEnums) {\n        var moduleState = ts.getModuleInstanceState(node);\n        return moduleState === 1 /* Instantiated */ ||\n            (preserveConstEnums && moduleState === 2 /* ConstEnumOnly */);\n    }\n    ts.isInstantiatedModule = isInstantiatedModule;\n    function createTypeChecker(host, produceDiagnostics) {\n        var getPackagesSet = ts.memoize(function () {\n            var set = new ts.Set();\n            host.getSourceFiles().forEach(function (sf) {\n                if (!sf.resolvedModules)\n                    return;\n                ts.forEachEntry(sf.resolvedModules, function (r) {\n                    if (r && r.packageId)\n                        set.add(r.packageId.name);\n                });\n            });\n            return set;\n        });\n        // Cancellation that controls whether or not we can cancel in the middle of type checking.\n        // In general cancelling is *not* safe for the type checker.  We might be in the middle of\n        // computing something, and we will leave our internals in an inconsistent state.  Callers\n        // who set the cancellation token should catch if a cancellation exception occurs, and\n        // should throw away and create a new TypeChecker.\n        //\n        // Currently we only support setting the cancellation token when getting diagnostics.  This\n        // is because diagnostics can be quite expensive, and we want to allow hosts to bail out if\n        // they no longer need the information (for example, if the user started editing again).\n        var cancellationToken;\n        var requestedExternalEmitHelpers;\n        var externalHelpersModule;\n        var Symbol = ts.objectAllocator.getSymbolConstructor();\n        var Type = ts.objectAllocator.getTypeConstructor();\n        var Signature = ts.objectAllocator.getSignatureConstructor();\n        var typeCount = 0;\n        var symbolCount = 0;\n        var enumCount = 0;\n        var totalInstantiationCount = 0;\n        var instantiationCount = 0;\n        var instantiationDepth = 0;\n        var currentNode;\n        var typeCatalog = []; // NB: id is index + 1\n        var emptySymbols = ts.createSymbolTable();\n        var arrayVariances = [1 /* Covariant */];\n        var compilerOptions = host.getCompilerOptions();\n        var languageVersion = ts.getEmitScriptTarget(compilerOptions);\n        var moduleKind = ts.getEmitModuleKind(compilerOptions);\n        var allowSyntheticDefaultImports = ts.getAllowSyntheticDefaultImports(compilerOptions);\n        var strictNullChecks = ts.getStrictOptionValue(compilerOptions, \"strictNullChecks\");\n        var strictFunctionTypes = ts.getStrictOptionValue(compilerOptions, \"strictFunctionTypes\");\n        var strictBindCallApply = ts.getStrictOptionValue(compilerOptions, \"strictBindCallApply\");\n        var strictPropertyInitialization = ts.getStrictOptionValue(compilerOptions, \"strictPropertyInitialization\");\n        var noImplicitAny = ts.getStrictOptionValue(compilerOptions, \"noImplicitAny\");\n        var noImplicitThis = ts.getStrictOptionValue(compilerOptions, \"noImplicitThis\");\n        var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;\n        var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 32768 /* FreshLiteral */;\n        var emitResolver = createResolver();\n        var nodeBuilder = createNodeBuilder();\n        var globals = ts.createSymbolTable();\n        var undefinedSymbol = createSymbol(4 /* Property */, \"undefined\");\n        undefinedSymbol.declarations = [];\n        var globalThisSymbol = createSymbol(1536 /* Module */, \"globalThis\", 8 /* Readonly */);\n        globalThisSymbol.exports = globals;\n        globalThisSymbol.declarations = [];\n        globals.set(globalThisSymbol.escapedName, globalThisSymbol);\n        var argumentsSymbol = createSymbol(4 /* Property */, \"arguments\");\n        var requireSymbol = createSymbol(4 /* Property */, \"require\");\n        /** This will be set during calls to `getResolvedSignature` where services determines an apparent number of arguments greater than what is actually provided. */\n        var apparentArgumentCount;\n        // for public members that accept a Node or one of its subtypes, we must guard against\n        // synthetic nodes created during transformations by calling `getParseTreeNode`.\n        // for most of these, we perform the guard only on `checker` to avoid any possible\n        // extra cost of calling `getParseTreeNode` when calling these functions from inside the\n        // checker.\n        var checker = {\n            getNodeCount: function () { return ts.sum(host.getSourceFiles(), \"nodeCount\"); },\n            getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), \"identifierCount\"); },\n            getSymbolCount: function () { return ts.sum(host.getSourceFiles(), \"symbolCount\") + symbolCount; },\n            getTypeCatalog: function () { return typeCatalog; },\n            getTypeCount: function () { return typeCount; },\n            getInstantiationCount: function () { return totalInstantiationCount; },\n            getRelationCacheSizes: function () { return ({\n                assignable: assignableRelation.size,\n                identity: identityRelation.size,\n                subtype: subtypeRelation.size,\n                strictSubtype: strictSubtypeRelation.size,\n            }); },\n            isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; },\n            isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; },\n            isUnknownSymbol: function (symbol) { return symbol === unknownSymbol; },\n            getMergedSymbol: getMergedSymbol,\n            getDiagnostics: getDiagnostics,\n            getGlobalDiagnostics: getGlobalDiagnostics,\n            getRecursionIdentity: getRecursionIdentity,\n            getTypeOfSymbolAtLocation: function (symbol, locationIn) {\n                var location = ts.getParseTreeNode(locationIn);\n                return location ? getTypeOfSymbolAtLocation(symbol, location) : errorType;\n            },\n            getSymbolsOfParameterPropertyDeclaration: function (parameterIn, parameterName) {\n                var parameter = ts.getParseTreeNode(parameterIn, ts.isParameter);\n                if (parameter === undefined)\n                    return ts.Debug.fail(\"Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node.\");\n                return getSymbolsOfParameterPropertyDeclaration(parameter, ts.escapeLeadingUnderscores(parameterName));\n            },\n            getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol,\n            getPropertiesOfType: getPropertiesOfType,\n            getPropertyOfType: function (type, name) { return getPropertyOfType(type, ts.escapeLeadingUnderscores(name)); },\n            getPrivateIdentifierPropertyOfType: function (leftType, name, location) {\n                var node = ts.getParseTreeNode(location);\n                if (!node) {\n                    return undefined;\n                }\n                var propName = ts.escapeLeadingUnderscores(name);\n                var lexicallyScopedIdentifier = lookupSymbolForPrivateIdentifierDeclaration(propName, node);\n                return lexicallyScopedIdentifier ? getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedIdentifier) : undefined;\n            },\n            getTypeOfPropertyOfType: function (type, name) { return getTypeOfPropertyOfType(type, ts.escapeLeadingUnderscores(name)); },\n            getIndexInfoOfType: getIndexInfoOfType,\n            getSignaturesOfType: getSignaturesOfType,\n            getIndexTypeOfType: getIndexTypeOfType,\n            getBaseTypes: getBaseTypes,\n            getBaseTypeOfLiteralType: getBaseTypeOfLiteralType,\n            getWidenedType: getWidenedType,\n            getTypeFromTypeNode: function (nodeIn) {\n                var node = ts.getParseTreeNode(nodeIn, ts.isTypeNode);\n                return node ? getTypeFromTypeNode(node) : errorType;\n            },\n            getParameterType: getTypeAtPosition,\n            getPromisedTypeOfPromise: getPromisedTypeOfPromise,\n            getAwaitedType: function (type) { return getAwaitedType(type); },\n            getReturnTypeOfSignature: getReturnTypeOfSignature,\n            isNullableType: isNullableType,\n            getNullableType: getNullableType,\n            getNonNullableType: getNonNullableType,\n            getNonOptionalType: removeOptionalTypeMarker,\n            getTypeArguments: getTypeArguments,\n            typeToTypeNode: nodeBuilder.typeToTypeNode,\n            indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration,\n            signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration,\n            symbolToEntityName: nodeBuilder.symbolToEntityName,\n            symbolToExpression: nodeBuilder.symbolToExpression,\n            symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations,\n            symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration,\n            typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration,\n            getSymbolsInScope: function (locationIn, meaning) {\n                var location = ts.getParseTreeNode(locationIn);\n                return location ? getSymbolsInScope(location, meaning) : [];\n            },\n            getSymbolAtLocation: function (nodeIn) {\n                var node = ts.getParseTreeNode(nodeIn);\n                // set ignoreErrors: true because any lookups invoked by the API shouldn't cause any new errors\n                return node ? getSymbolAtLocation(node, /*ignoreErrors*/ true) : undefined;\n            },\n            getShorthandAssignmentValueSymbol: function (nodeIn) {\n                var node = ts.getParseTreeNode(nodeIn);\n                return node ? getShorthandAssignmentValueSymbol(node) : undefined;\n            },\n            getExportSpecifierLocalTargetSymbol: function (nodeIn) {\n                var node = ts.getParseTreeNode(nodeIn, ts.isExportSpecifier);\n                return node ? getExportSpecifierLocalTargetSymbol(node) : undefined;\n            },\n            getExportSymbolOfSymbol: function (symbol) {\n                return getMergedSymbol(symbol.exportSymbol || symbol);\n            },\n            getTypeAtLocation: function (nodeIn) {\n                var node = ts.getParseTreeNode(nodeIn);\n                return node ? getTypeOfNode(node) : errorType;\n            },\n            getTypeOfAssignmentPattern: function (nodeIn) {\n                var node = ts.getParseTreeNode(nodeIn, ts.isAssignmentPattern);\n                return node && getTypeOfAssignmentPattern(node) || errorType;\n            },\n            getPropertySymbolOfDestructuringAssignment: function (locationIn) {\n                var location = ts.getParseTreeNode(locationIn, ts.isIdentifier);\n                return location ? getPropertySymbolOfDestructuringAssignment(location) : undefined;\n            },\n            signatureToString: function (signature, enclosingDeclaration, flags, kind) {\n                return signatureToString(signature, ts.getParseTreeNode(enclosingDeclaration), flags, kind);\n            },\n            typeToString: function (type, enclosingDeclaration, flags) {\n                return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags);\n            },\n            symbolToString: function (symbol, enclosingDeclaration, meaning, flags) {\n                return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning, flags);\n            },\n            typePredicateToString: function (predicate, enclosingDeclaration, flags) {\n                return typePredicateToString(predicate, ts.getParseTreeNode(enclosingDeclaration), flags);\n            },\n            writeSignature: function (signature, enclosingDeclaration, flags, kind, writer) {\n                return signatureToString(signature, ts.getParseTreeNode(enclosingDeclaration), flags, kind, writer);\n            },\n            writeType: function (type, enclosingDeclaration, flags, writer) {\n                return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags, writer);\n            },\n            writeSymbol: function (symbol, enclosingDeclaration, meaning, flags, writer) {\n                return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning, flags, writer);\n            },\n            writeTypePredicate: function (predicate, enclosingDeclaration, flags, writer) {\n                return typePredicateToString(predicate, ts.getParseTreeNode(enclosingDeclaration), flags, writer);\n            },\n            getAugmentedPropertiesOfType: getAugmentedPropertiesOfType,\n            getRootSymbols: getRootSymbols,\n            getSymbolOfExpando: getSymbolOfExpando,\n            getContextualType: function (nodeIn, contextFlags) {\n                var node = ts.getParseTreeNode(nodeIn, ts.isExpression);\n                if (!node) {\n                    return undefined;\n                }\n                var containingCall = ts.findAncestor(node, ts.isCallLikeExpression);\n                var containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature;\n                if (contextFlags & 4 /* Completions */ && containingCall) {\n                    var toMarkSkip = node;\n                    do {\n                        getNodeLinks(toMarkSkip).skipDirectInference = true;\n                        toMarkSkip = toMarkSkip.parent;\n                    } while (toMarkSkip && toMarkSkip !== containingCall);\n                    getNodeLinks(containingCall).resolvedSignature = undefined;\n                }\n                var result = getContextualType(node, contextFlags);\n                if (contextFlags & 4 /* Completions */ && containingCall) {\n                    var toMarkSkip = node;\n                    do {\n                        getNodeLinks(toMarkSkip).skipDirectInference = undefined;\n                        toMarkSkip = toMarkSkip.parent;\n                    } while (toMarkSkip && toMarkSkip !== containingCall);\n                    getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;\n                }\n                return result;\n            },\n            getContextualTypeForObjectLiteralElement: function (nodeIn) {\n                var node = ts.getParseTreeNode(nodeIn, ts.isObjectLiteralElementLike);\n                return node ? getContextualTypeForObjectLiteralElement(node) : undefined;\n            },\n            getContextualTypeForArgumentAtIndex: function (nodeIn, argIndex) {\n                var node = ts.getParseTreeNode(nodeIn, ts.isCallLikeExpression);\n                return node && getContextualTypeForArgumentAtIndex(node, argIndex);\n            },\n            getContextualTypeForJsxAttribute: function (nodeIn) {\n                var node = ts.getParseTreeNode(nodeIn, ts.isJsxAttributeLike);\n                return node && getContextualTypeForJsxAttribute(node);\n            },\n            isContextSensitive: isContextSensitive,\n            getFullyQualifiedName: getFullyQualifiedName,\n            getResolvedSignature: function (node, candidatesOutArray, argumentCount) {\n                return getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */);\n            },\n            getResolvedSignatureForSignatureHelp: function (node, candidatesOutArray, argumentCount) {\n                return getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */);\n            },\n            getExpandedParameters: getExpandedParameters,\n            hasEffectiveRestParameter: hasEffectiveRestParameter,\n            getConstantValue: function (nodeIn) {\n                var node = ts.getParseTreeNode(nodeIn, canHaveConstantValue);\n                return node ? getConstantValue(node) : undefined;\n            },\n            isValidPropertyAccess: function (nodeIn, propertyName) {\n                var node = ts.getParseTreeNode(nodeIn, ts.isPropertyAccessOrQualifiedNameOrImportTypeNode);\n                return !!node && isValidPropertyAccess(node, ts.escapeLeadingUnderscores(propertyName));\n            },\n            isValidPropertyAccessForCompletions: function (nodeIn, type, property) {\n                var node = ts.getParseTreeNode(nodeIn, ts.isPropertyAccessExpression);\n                return !!node && isValidPropertyAccessForCompletions(node, type, property);\n            },\n            getSignatureFromDeclaration: function (declarationIn) {\n                var declaration = ts.getParseTreeNode(declarationIn, ts.isFunctionLike);\n                return declaration ? getSignatureFromDeclaration(declaration) : undefined;\n            },\n            isImplementationOfOverload: function (nodeIn) {\n                var node = ts.getParseTreeNode(nodeIn, ts.isFunctionLike);\n                return node ? isImplementationOfOverload(node) : undefined;\n            },\n            getImmediateAliasedSymbol: getImmediateAliasedSymbol,\n            getAliasedSymbol: resolveAlias,\n            getEmitResolver: getEmitResolver,\n            getExportsOfModule: getExportsOfModuleAsArray,\n            getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule,\n            getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintOfTypeParameter, ts.getFirstIdentifier, getTypeArguments),\n            getAmbientModules: getAmbientModules,\n            getJsxIntrinsicTagNamesAt: getJsxIntrinsicTagNamesAt,\n            isOptionalParameter: function (nodeIn) {\n                var node = ts.getParseTreeNode(nodeIn, ts.isParameter);\n                return node ? isOptionalParameter(node) : false;\n            },\n            tryGetMemberInModuleExports: function (name, symbol) { return tryGetMemberInModuleExports(ts.escapeLeadingUnderscores(name), symbol); },\n            tryGetMemberInModuleExportsAndProperties: function (name, symbol) { return tryGetMemberInModuleExportsAndProperties(ts.escapeLeadingUnderscores(name), symbol); },\n            tryFindAmbientModuleWithoutAugmentations: function (moduleName) {\n                // we deliberately exclude augmentations\n                // since we are only interested in declarations of the module itself\n                return tryFindAmbientModule(moduleName, /*withAugmentations*/ false);\n            },\n            getApparentType: getApparentType,\n            getUnionType: getUnionType,\n            isTypeAssignableTo: isTypeAssignableTo,\n            createAnonymousType: createAnonymousType,\n            createSignature: createSignature,\n            createSymbol: createSymbol,\n            createIndexInfo: createIndexInfo,\n            getAnyType: function () { return anyType; },\n            getStringType: function () { return stringType; },\n            getNumberType: function () { return numberType; },\n            createPromiseType: createPromiseType,\n            createArrayType: createArrayType,\n            getElementTypeOfArrayType: getElementTypeOfArrayType,\n            getBooleanType: function () { return booleanType; },\n            getFalseType: function (fresh) { return fresh ? falseType : regularFalseType; },\n            getTrueType: function (fresh) { return fresh ? trueType : regularTrueType; },\n            getVoidType: function () { return voidType; },\n            getUndefinedType: function () { return undefinedType; },\n            getNullType: function () { return nullType; },\n            getESSymbolType: function () { return esSymbolType; },\n            getNeverType: function () { return neverType; },\n            getOptionalType: function () { return optionalType; },\n            isSymbolAccessible: isSymbolAccessible,\n            isArrayType: isArrayType,\n            isTupleType: isTupleType,\n            isArrayLikeType: isArrayLikeType,\n            isTypeInvalidDueToUnionDiscriminant: isTypeInvalidDueToUnionDiscriminant,\n            getAllPossiblePropertiesOfTypes: getAllPossiblePropertiesOfTypes,\n            getSuggestedSymbolForNonexistentProperty: getSuggestedSymbolForNonexistentProperty,\n            getSuggestionForNonexistentProperty: getSuggestionForNonexistentProperty,\n            getSuggestedSymbolForNonexistentJSXAttribute: getSuggestedSymbolForNonexistentJSXAttribute,\n            getSuggestedSymbolForNonexistentSymbol: function (location, name, meaning) { return getSuggestedSymbolForNonexistentSymbol(location, ts.escapeLeadingUnderscores(name), meaning); },\n            getSuggestionForNonexistentSymbol: function (location, name, meaning) { return getSuggestionForNonexistentSymbol(location, ts.escapeLeadingUnderscores(name), meaning); },\n            getSuggestedSymbolForNonexistentModule: getSuggestedSymbolForNonexistentModule,\n            getSuggestionForNonexistentExport: getSuggestionForNonexistentExport,\n            getBaseConstraintOfType: getBaseConstraintOfType,\n            getDefaultFromTypeParameter: function (type) { return type && type.flags & 262144 /* TypeParameter */ ? getDefaultFromTypeParameter(type) : undefined; },\n            resolveName: function (name, location, meaning, excludeGlobals) {\n                return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false, excludeGlobals);\n            },\n            getJsxNamespace: function (n) { return ts.unescapeLeadingUnderscores(getJsxNamespace(n)); },\n            getJsxFragmentFactory: function (n) {\n                var jsxFragmentFactory = getJsxFragmentFactoryEntity(n);\n                return jsxFragmentFactory && ts.unescapeLeadingUnderscores(ts.getFirstIdentifier(jsxFragmentFactory).escapedText);\n            },\n            getAccessibleSymbolChain: getAccessibleSymbolChain,\n            getTypePredicateOfSignature: getTypePredicateOfSignature,\n            resolveExternalModuleName: function (moduleSpecifierIn) {\n                var moduleSpecifier = ts.getParseTreeNode(moduleSpecifierIn, ts.isExpression);\n                return moduleSpecifier && resolveExternalModuleName(moduleSpecifier, moduleSpecifier, /*ignoreErrors*/ true);\n            },\n            resolveExternalModuleSymbol: resolveExternalModuleSymbol,\n            tryGetThisTypeAt: function (nodeIn, includeGlobalThis) {\n                var node = ts.getParseTreeNode(nodeIn);\n                return node && tryGetThisTypeAt(node, includeGlobalThis);\n            },\n            getTypeArgumentConstraint: function (nodeIn) {\n                var node = ts.getParseTreeNode(nodeIn, ts.isTypeNode);\n                return node && getTypeArgumentConstraint(node);\n            },\n            getSuggestionDiagnostics: function (fileIn, ct) {\n                var file = ts.getParseTreeNode(fileIn, ts.isSourceFile) || ts.Debug.fail(\"Could not determine parsed source file.\");\n                if (ts.skipTypeChecking(file, compilerOptions, host)) {\n                    return ts.emptyArray;\n                }\n                var diagnostics;\n                try {\n                    // Record the cancellation token so it can be checked later on during checkSourceElement.\n                    // Do this in a finally block so we can ensure that it gets reset back to nothing after\n                    // this call is done.\n                    cancellationToken = ct;\n                    // Ensure file is type checked\n                    checkSourceFile(file);\n                    ts.Debug.assert(!!(getNodeLinks(file).flags & 1 /* TypeChecked */));\n                    diagnostics = ts.addRange(diagnostics, suggestionDiagnostics.getDiagnostics(file.fileName));\n                    checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(file), function (containingNode, kind, diag) {\n                        if (!ts.containsParseError(containingNode) && !unusedIsError(kind, !!(containingNode.flags & 8388608 /* Ambient */))) {\n                            (diagnostics || (diagnostics = [])).push(__assign(__assign({}, diag), { category: ts.DiagnosticCategory.Suggestion }));\n                        }\n                    });\n                    return diagnostics || ts.emptyArray;\n                }\n                finally {\n                    cancellationToken = undefined;\n                }\n            },\n            runWithCancellationToken: function (token, callback) {\n                try {\n                    cancellationToken = token;\n                    return callback(checker);\n                }\n                finally {\n                    cancellationToken = undefined;\n                }\n            },\n            getLocalTypeParametersOfClassOrInterfaceOrTypeAlias: getLocalTypeParametersOfClassOrInterfaceOrTypeAlias,\n            isDeclarationVisible: isDeclarationVisible,\n        };\n        function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode) {\n            var node = ts.getParseTreeNode(nodeIn, ts.isCallLikeExpression);\n            apparentArgumentCount = argumentCount;\n            var res = node ? getResolvedSignature(node, candidatesOutArray, checkMode) : undefined;\n            apparentArgumentCount = undefined;\n            return res;\n        }\n        var tupleTypes = new ts.Map();\n        var unionTypes = new ts.Map();\n        var intersectionTypes = new ts.Map();\n        var literalTypes = new ts.Map();\n        var indexedAccessTypes = new ts.Map();\n        var templateLiteralTypes = new ts.Map();\n        var stringMappingTypes = new ts.Map();\n        var substitutionTypes = new ts.Map();\n        var evolvingArrayTypes = [];\n        var undefinedProperties = new ts.Map();\n        var unknownSymbol = createSymbol(4 /* Property */, \"unknown\");\n        var resolvingSymbol = createSymbol(0, \"__resolving__\" /* Resolving */);\n        var anyType = createIntrinsicType(1 /* Any */, \"any\");\n        var autoType = createIntrinsicType(1 /* Any */, \"any\");\n        var wildcardType = createIntrinsicType(1 /* Any */, \"any\");\n        var errorType = createIntrinsicType(1 /* Any */, \"error\");\n        var nonInferrableAnyType = createIntrinsicType(1 /* Any */, \"any\", 524288 /* ContainsWideningType */);\n        var intrinsicMarkerType = createIntrinsicType(1 /* Any */, \"intrinsic\");\n        var unknownType = createIntrinsicType(2 /* Unknown */, \"unknown\");\n        var undefinedType = createIntrinsicType(32768 /* Undefined */, \"undefined\");\n        var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, \"undefined\", 524288 /* ContainsWideningType */);\n        var optionalType = createIntrinsicType(32768 /* Undefined */, \"undefined\");\n        var nullType = createIntrinsicType(65536 /* Null */, \"null\");\n        var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, \"null\", 524288 /* ContainsWideningType */);\n        var stringType = createIntrinsicType(4 /* String */, \"string\");\n        var numberType = createIntrinsicType(8 /* Number */, \"number\");\n        var bigintType = createIntrinsicType(64 /* BigInt */, \"bigint\");\n        var falseType = createIntrinsicType(512 /* BooleanLiteral */, \"false\");\n        var regularFalseType = createIntrinsicType(512 /* BooleanLiteral */, \"false\");\n        var trueType = createIntrinsicType(512 /* BooleanLiteral */, \"true\");\n        var regularTrueType = createIntrinsicType(512 /* BooleanLiteral */, \"true\");\n        trueType.regularType = regularTrueType;\n        trueType.freshType = trueType;\n        regularTrueType.regularType = regularTrueType;\n        regularTrueType.freshType = trueType;\n        falseType.regularType = regularFalseType;\n        falseType.freshType = falseType;\n        regularFalseType.regularType = regularFalseType;\n        regularFalseType.freshType = falseType;\n        var booleanType = createBooleanType([regularFalseType, regularTrueType]);\n        // Also mark all combinations of fresh/regular booleans as \"Boolean\" so they print as `boolean` instead of `true | false`\n        // (The union is cached, so simply doing the marking here is sufficient)\n        createBooleanType([regularFalseType, trueType]);\n        createBooleanType([falseType, regularTrueType]);\n        createBooleanType([falseType, trueType]);\n        var esSymbolType = createIntrinsicType(4096 /* ESSymbol */, \"symbol\");\n        var voidType = createIntrinsicType(16384 /* Void */, \"void\");\n        var neverType = createIntrinsicType(131072 /* Never */, \"never\");\n        var silentNeverType = createIntrinsicType(131072 /* Never */, \"never\");\n        var nonInferrableType = createIntrinsicType(131072 /* Never */, \"never\", 2097152 /* NonInferrableType */);\n        var implicitNeverType = createIntrinsicType(131072 /* Never */, \"never\");\n        var unreachableNeverType = createIntrinsicType(131072 /* Never */, \"never\");\n        var nonPrimitiveType = createIntrinsicType(67108864 /* NonPrimitive */, \"object\");\n        var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]);\n        var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType;\n        var numberOrBigIntType = getUnionType([numberType, bigintType]);\n        var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]);\n        var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; });\n        var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; });\n        var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);\n        var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);\n        emptyJsxObjectType.objectFlags |= 4096 /* JsxAttributes */;\n        var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, \"__type\" /* Type */);\n        emptyTypeLiteralSymbol.members = ts.createSymbolTable();\n        var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);\n        var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);\n        emptyGenericType.instantiations = new ts.Map();\n        var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);\n        // The anyFunctionType contains the anyFunctionType by definition. The flag is further propagated\n        // in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes.\n        anyFunctionType.objectFlags |= 2097152 /* NonInferrableType */;\n        var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);\n        var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);\n        var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);\n        var markerSuperType = createTypeParameter();\n        var markerSubType = createTypeParameter();\n        markerSubType.constraint = markerSuperType;\n        var markerOtherType = createTypeParameter();\n        var noTypePredicate = createTypePredicate(1 /* Identifier */, \"<<unresolved>>\", 0, anyType);\n        var anySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*resolvedTypePredicate*/ undefined, 0, 0 /* None */);\n        var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, errorType, /*resolvedTypePredicate*/ undefined, 0, 0 /* None */);\n        var resolvingSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*resolvedTypePredicate*/ undefined, 0, 0 /* None */);\n        var silentNeverSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, silentNeverType, /*resolvedTypePredicate*/ undefined, 0, 0 /* None */);\n        var enumNumberIndexInfo = createIndexInfo(stringType, /*isReadonly*/ true);\n        var iterationTypesCache = new ts.Map(); // cache for common IterationTypes instances\n        var noIterationTypes = {\n            get yieldType() { return ts.Debug.fail(\"Not supported\"); },\n            get returnType() { return ts.Debug.fail(\"Not supported\"); },\n            get nextType() { return ts.Debug.fail(\"Not supported\"); },\n        };\n        var anyIterationTypes = createIterationTypes(anyType, anyType, anyType);\n        var anyIterationTypesExceptNext = createIterationTypes(anyType, anyType, unknownType);\n        var defaultIterationTypes = createIterationTypes(neverType, anyType, undefinedType); // default iteration types for `Iterator`.\n        var asyncIterationTypesResolver = {\n            iterableCacheKey: \"iterationTypesOfAsyncIterable\",\n            iteratorCacheKey: \"iterationTypesOfAsyncIterator\",\n            iteratorSymbolName: \"asyncIterator\",\n            getGlobalIteratorType: getGlobalAsyncIteratorType,\n            getGlobalIterableType: getGlobalAsyncIterableType,\n            getGlobalIterableIteratorType: getGlobalAsyncIterableIteratorType,\n            getGlobalGeneratorType: getGlobalAsyncGeneratorType,\n            resolveIterationType: getAwaitedType,\n            mustHaveANextMethodDiagnostic: ts.Diagnostics.An_async_iterator_must_have_a_next_method,\n            mustBeAMethodDiagnostic: ts.Diagnostics.The_0_property_of_an_async_iterator_must_be_a_method,\n            mustHaveAValueDiagnostic: ts.Diagnostics.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property,\n        };\n        var syncIterationTypesResolver = {\n            iterableCacheKey: \"iterationTypesOfIterable\",\n            iteratorCacheKey: \"iterationTypesOfIterator\",\n            iteratorSymbolName: \"iterator\",\n            getGlobalIteratorType: getGlobalIteratorType,\n            getGlobalIterableType: getGlobalIterableType,\n            getGlobalIterableIteratorType: getGlobalIterableIteratorType,\n            getGlobalGeneratorType: getGlobalGeneratorType,\n            resolveIterationType: function (type, _errorNode) { return type; },\n            mustHaveANextMethodDiagnostic: ts.Diagnostics.An_iterator_must_have_a_next_method,\n            mustBeAMethodDiagnostic: ts.Diagnostics.The_0_property_of_an_iterator_must_be_a_method,\n            mustHaveAValueDiagnostic: ts.Diagnostics.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property,\n        };\n        /** Key is \"/path/to/a.ts|/path/to/b.ts\". */\n        var amalgamatedDuplicates;\n        var reverseMappedCache = new ts.Map();\n        var inInferTypeForHomomorphicMappedType = false;\n        var ambientModulesCache;\n        /**\n         * List of every ambient module with a \"*\" wildcard.\n         * Unlike other ambient modules, these can't be stored in `globals` because symbol tables only deal with exact matches.\n         * This is only used if there is no exact match.\n         */\n        var patternAmbientModules;\n        var patternAmbientModuleAugmentations;\n        var globalObjectType;\n        var globalFunctionType;\n        var globalCallableFunctionType;\n        var globalNewableFunctionType;\n        var globalArrayType;\n        var globalReadonlyArrayType;\n        var globalStringType;\n        var globalNumberType;\n        var globalBooleanType;\n        var globalRegExpType;\n        var globalThisType;\n        var anyArrayType;\n        var autoArrayType;\n        var anyReadonlyArrayType;\n        var deferredGlobalNonNullableTypeAlias;\n        // The library files are only loaded when the feature is used.\n        // This allows users to just specify library files they want to used through --lib\n        // and they will not get an error from not having unrelated library files\n        var deferredGlobalESSymbolConstructorSymbol;\n        var deferredGlobalESSymbolType;\n        var deferredGlobalTypedPropertyDescriptorType;\n        var deferredGlobalPromiseType;\n        var deferredGlobalPromiseLikeType;\n        var deferredGlobalPromiseConstructorSymbol;\n        var deferredGlobalPromiseConstructorLikeType;\n        var deferredGlobalIterableType;\n        var deferredGlobalIteratorType;\n        var deferredGlobalIterableIteratorType;\n        var deferredGlobalGeneratorType;\n        var deferredGlobalIteratorYieldResultType;\n        var deferredGlobalIteratorReturnResultType;\n        var deferredGlobalAsyncIterableType;\n        var deferredGlobalAsyncIteratorType;\n        var deferredGlobalAsyncIterableIteratorType;\n        var deferredGlobalAsyncGeneratorType;\n        var deferredGlobalTemplateStringsArrayType;\n        var deferredGlobalImportMetaType;\n        var deferredGlobalExtractSymbol;\n        var deferredGlobalOmitSymbol;\n        var deferredGlobalBigIntType;\n        var allPotentiallyUnusedIdentifiers = new ts.Map(); // key is file name\n        var flowLoopStart = 0;\n        var flowLoopCount = 0;\n        var sharedFlowCount = 0;\n        var flowAnalysisDisabled = false;\n        var flowInvocationCount = 0;\n        var lastFlowNode;\n        var lastFlowNodeReachable;\n        var flowTypeCache;\n        var emptyStringType = getLiteralType(\"\");\n        var zeroType = getLiteralType(0);\n        var zeroBigIntType = getLiteralType({ negative: false, base10Value: \"0\" });\n        var resolutionTargets = [];\n        var resolutionResults = [];\n        var resolutionPropertyNames = [];\n        var suggestionCount = 0;\n        var maximumSuggestionCount = 10;\n        var mergedSymbols = [];\n        var symbolLinks = [];\n        var nodeLinks = [];\n        var flowLoopCaches = [];\n        var flowLoopNodes = [];\n        var flowLoopKeys = [];\n        var flowLoopTypes = [];\n        var sharedFlowNodes = [];\n        var sharedFlowTypes = [];\n        var flowNodeReachable = [];\n        var flowNodePostSuper = [];\n        var potentialThisCollisions = [];\n        var potentialNewTargetCollisions = [];\n        var potentialWeakMapCollisions = [];\n        var awaitedTypeStack = [];\n        var diagnostics = ts.createDiagnosticCollection();\n        var suggestionDiagnostics = ts.createDiagnosticCollection();\n        var typeofTypesByName = new ts.Map(ts.getEntries({\n            string: stringType,\n            number: numberType,\n            bigint: bigintType,\n            boolean: booleanType,\n            symbol: esSymbolType,\n            undefined: undefinedType\n        }));\n        var typeofType = createTypeofType();\n        var _jsxNamespace;\n        var _jsxFactoryEntity;\n        var outofbandVarianceMarkerHandler;\n        var subtypeRelation = new ts.Map();\n        var strictSubtypeRelation = new ts.Map();\n        var assignableRelation = new ts.Map();\n        var comparableRelation = new ts.Map();\n        var identityRelation = new ts.Map();\n        var enumRelation = new ts.Map();\n        var builtinGlobals = ts.createSymbolTable();\n        builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol);\n        initializeTypeChecker();\n        return checker;\n        function getJsxNamespace(location) {\n            if (location) {\n                var file = ts.getSourceFileOfNode(location);\n                if (file) {\n                    if (ts.isJsxOpeningFragment(location)) {\n                        if (file.localJsxFragmentNamespace) {\n                            return file.localJsxFragmentNamespace;\n                        }\n                        var jsxFragmentPragma = file.pragmas.get(\"jsxfrag\");\n                        if (jsxFragmentPragma) {\n                            var chosenPragma = ts.isArray(jsxFragmentPragma) ? jsxFragmentPragma[0] : jsxFragmentPragma;\n                            file.localJsxFragmentFactory = ts.parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion);\n                            ts.visitNode(file.localJsxFragmentFactory, markAsSynthetic);\n                            if (file.localJsxFragmentFactory) {\n                                return file.localJsxFragmentNamespace = ts.getFirstIdentifier(file.localJsxFragmentFactory).escapedText;\n                            }\n                        }\n                        var entity = getJsxFragmentFactoryEntity(location);\n                        if (entity) {\n                            file.localJsxFragmentFactory = entity;\n                            return file.localJsxFragmentNamespace = ts.getFirstIdentifier(entity).escapedText;\n                        }\n                    }\n                    else {\n                        if (file.localJsxNamespace) {\n                            return file.localJsxNamespace;\n                        }\n                        var jsxPragma = file.pragmas.get(\"jsx\");\n                        if (jsxPragma) {\n                            var chosenPragma = ts.isArray(jsxPragma) ? jsxPragma[0] : jsxPragma;\n                            file.localJsxFactory = ts.parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion);\n                            ts.visitNode(file.localJsxFactory, markAsSynthetic);\n                            if (file.localJsxFactory) {\n                                return file.localJsxNamespace = ts.getFirstIdentifier(file.localJsxFactory).escapedText;\n                            }\n                        }\n                    }\n                }\n            }\n            if (!_jsxNamespace) {\n                _jsxNamespace = \"React\";\n                if (compilerOptions.jsxFactory) {\n                    _jsxFactoryEntity = ts.parseIsolatedEntityName(compilerOptions.jsxFactory, languageVersion);\n                    ts.visitNode(_jsxFactoryEntity, markAsSynthetic);\n                    if (_jsxFactoryEntity) {\n                        _jsxNamespace = ts.getFirstIdentifier(_jsxFactoryEntity).escapedText;\n                    }\n                }\n                else if (compilerOptions.reactNamespace) {\n                    _jsxNamespace = ts.escapeLeadingUnderscores(compilerOptions.reactNamespace);\n                }\n            }\n            if (!_jsxFactoryEntity) {\n                _jsxFactoryEntity = ts.factory.createQualifiedName(ts.factory.createIdentifier(ts.unescapeLeadingUnderscores(_jsxNamespace)), \"createElement\");\n            }\n            return _jsxNamespace;\n            function markAsSynthetic(node) {\n                ts.setTextRangePosEnd(node, -1, -1);\n                return ts.visitEachChild(node, markAsSynthetic, ts.nullTransformationContext);\n            }\n        }\n        function getEmitResolver(sourceFile, cancellationToken) {\n            // Ensure we have all the type information in place for this file so that all the\n            // emitter questions of this resolver will return the right information.\n            getDiagnostics(sourceFile, cancellationToken);\n            return emitResolver;\n        }\n        function lookupOrIssueError(location, message, arg0, arg1, arg2, arg3) {\n            var diagnostic = location\n                ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3)\n                : ts.createCompilerDiagnostic(message, arg0, arg1, arg2, arg3);\n            var existing = diagnostics.lookup(diagnostic);\n            if (existing) {\n                return existing;\n            }\n            else {\n                diagnostics.add(diagnostic);\n                return diagnostic;\n            }\n        }\n        function errorSkippedOn(key, location, message, arg0, arg1, arg2, arg3) {\n            var diagnostic = error(location, message, arg0, arg1, arg2, arg3);\n            diagnostic.skippedOn = key;\n            return diagnostic;\n        }\n        function error(location, message, arg0, arg1, arg2, arg3) {\n            var diagnostic = location\n                ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3)\n                : ts.createCompilerDiagnostic(message, arg0, arg1, arg2, arg3);\n            diagnostics.add(diagnostic);\n            return diagnostic;\n        }\n        function addErrorOrSuggestion(isError, diagnostic) {\n            if (isError) {\n                diagnostics.add(diagnostic);\n            }\n            else {\n                suggestionDiagnostics.add(__assign(__assign({}, diagnostic), { category: ts.DiagnosticCategory.Suggestion }));\n            }\n        }\n        function errorOrSuggestion(isError, location, message, arg0, arg1, arg2, arg3) {\n            // Pseudo-synthesized input node\n            if (location.pos < 0 || location.end < 0) {\n                if (!isError) {\n                    return; // Drop suggestions (we have no span to suggest on)\n                }\n                // Issue errors globally\n                var file = ts.getSourceFileOfNode(location);\n                addErrorOrSuggestion(isError, \"message\" in message ? ts.createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForFileFromMessageChain(file, message)); // eslint-disable-line no-in-operator\n                return;\n            }\n            addErrorOrSuggestion(isError, \"message\" in message ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForNodeFromMessageChain(location, message)); // eslint-disable-line no-in-operator\n        }\n        function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, arg0, arg1, arg2, arg3) {\n            var diagnostic = error(location, message, arg0, arg1, arg2, arg3);\n            if (maybeMissingAwait) {\n                var related = ts.createDiagnosticForNode(location, ts.Diagnostics.Did_you_forget_to_use_await);\n                ts.addRelatedInfo(diagnostic, related);\n            }\n            return diagnostic;\n        }\n        function addDeprecatedSuggestionWorker(declarations, diagnostic) {\n            var deprecatedTag = Array.isArray(declarations) ? ts.forEach(declarations, ts.getJSDocDeprecatedTag) : ts.getJSDocDeprecatedTag(declarations);\n            if (deprecatedTag) {\n                ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(deprecatedTag, ts.Diagnostics.The_declaration_was_marked_as_deprecated_here));\n            }\n            // We call `addRelatedInfo()` before adding the diagnostic to prevent duplicates.\n            suggestionDiagnostics.add(diagnostic);\n            return diagnostic;\n        }\n        function addDeprecatedSuggestion(location, declarations, deprecatedEntity) {\n            var diagnostic = ts.createDiagnosticForNode(location, ts.Diagnostics._0_is_deprecated, deprecatedEntity);\n            return addDeprecatedSuggestionWorker(declarations, diagnostic);\n        }\n        function addDeprecatedSuggestionWithSignature(location, declaration, deprecatedEntity, signatureString) {\n            var diagnostic = deprecatedEntity\n                ? ts.createDiagnosticForNode(location, ts.Diagnostics.The_signature_0_of_1_is_deprecated, signatureString, deprecatedEntity)\n                : ts.createDiagnosticForNode(location, ts.Diagnostics._0_is_deprecated, signatureString);\n            return addDeprecatedSuggestionWorker(declaration, diagnostic);\n        }\n        function createSymbol(flags, name, checkFlags) {\n            symbolCount++;\n            var symbol = (new Symbol(flags | 33554432 /* Transient */, name));\n            symbol.checkFlags = checkFlags || 0;\n            return symbol;\n        }\n        function getExcludedSymbolFlags(flags) {\n            var result = 0;\n            if (flags & 2 /* BlockScopedVariable */)\n                result |= 111551 /* BlockScopedVariableExcludes */;\n            if (flags & 1 /* FunctionScopedVariable */)\n                result |= 111550 /* FunctionScopedVariableExcludes */;\n            if (flags & 4 /* Property */)\n                result |= 0 /* PropertyExcludes */;\n            if (flags & 8 /* EnumMember */)\n                result |= 900095 /* EnumMemberExcludes */;\n            if (flags & 16 /* Function */)\n                result |= 110991 /* FunctionExcludes */;\n            if (flags & 32 /* Class */)\n                result |= 899503 /* ClassExcludes */;\n            if (flags & 64 /* Interface */)\n                result |= 788872 /* InterfaceExcludes */;\n            if (flags & 256 /* RegularEnum */)\n                result |= 899327 /* RegularEnumExcludes */;\n            if (flags & 128 /* ConstEnum */)\n                result |= 899967 /* ConstEnumExcludes */;\n            if (flags & 512 /* ValueModule */)\n                result |= 110735 /* ValueModuleExcludes */;\n            if (flags & 8192 /* Method */)\n                result |= 103359 /* MethodExcludes */;\n            if (flags & 32768 /* GetAccessor */)\n                result |= 46015 /* GetAccessorExcludes */;\n            if (flags & 65536 /* SetAccessor */)\n                result |= 78783 /* SetAccessorExcludes */;\n            if (flags & 262144 /* TypeParameter */)\n                result |= 526824 /* TypeParameterExcludes */;\n            if (flags & 524288 /* TypeAlias */)\n                result |= 788968 /* TypeAliasExcludes */;\n            if (flags & 2097152 /* Alias */)\n                result |= 2097152 /* AliasExcludes */;\n            return result;\n        }\n        function recordMergedSymbol(target, source) {\n            if (!source.mergeId) {\n                source.mergeId = nextMergeId;\n                nextMergeId++;\n            }\n            mergedSymbols[source.mergeId] = target;\n        }\n        function cloneSymbol(symbol) {\n            var result = createSymbol(symbol.flags, symbol.escapedName);\n            result.declarations = symbol.declarations ? symbol.declarations.slice() : [];\n            result.parent = symbol.parent;\n            if (symbol.valueDeclaration)\n                result.valueDeclaration = symbol.valueDeclaration;\n            if (symbol.constEnumOnlyModule)\n                result.constEnumOnlyModule = true;\n            if (symbol.members)\n                result.members = new ts.Map(symbol.members);\n            if (symbol.exports)\n                result.exports = new ts.Map(symbol.exports);\n            recordMergedSymbol(result, symbol);\n            return result;\n        }\n        /**\n         * Note: if target is transient, then it is mutable, and mergeSymbol with both mutate and return it.\n         * If target is not transient, mergeSymbol will produce a transient clone, mutate that and return it.\n         */\n        function mergeSymbol(target, source, unidirectional) {\n            if (unidirectional === void 0) { unidirectional = false; }\n            if (!(target.flags & getExcludedSymbolFlags(source.flags)) ||\n                (source.flags | target.flags) & 67108864 /* Assignment */) {\n                if (source === target) {\n                    // This can happen when an export assigned namespace exports something also erroneously exported at the top level\n                    // See `declarationFileNoCrashOnExtraExportModifier` for an example\n                    return target;\n                }\n                if (!(target.flags & 33554432 /* Transient */)) {\n                    var resolvedTarget = resolveSymbol(target);\n                    if (resolvedTarget === unknownSymbol) {\n                        return source;\n                    }\n                    target = cloneSymbol(resolvedTarget);\n                }\n                // Javascript static-property-assignment declarations always merge, even though they are also values\n                if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) {\n                    // reset flag when merging instantiated module into value module that has only const enums\n                    target.constEnumOnlyModule = false;\n                }\n                target.flags |= source.flags;\n                if (source.valueDeclaration) {\n                    ts.setValueDeclaration(target, source.valueDeclaration);\n                }\n                ts.addRange(target.declarations, source.declarations);\n                if (source.members) {\n                    if (!target.members)\n                        target.members = ts.createSymbolTable();\n                    mergeSymbolTable(target.members, source.members, unidirectional);\n                }\n                if (source.exports) {\n                    if (!target.exports)\n                        target.exports = ts.createSymbolTable();\n                    mergeSymbolTable(target.exports, source.exports, unidirectional);\n                }\n                if (!unidirectional) {\n                    recordMergedSymbol(target, source);\n                }\n            }\n            else if (target.flags & 1024 /* NamespaceModule */) {\n                // Do not report an error when merging `var globalThis` with the built-in `globalThis`,\n                // as we will already report a \"Declaration name conflicts...\" error, and this error\n                // won't make much sense.\n                if (target !== globalThisSymbol) {\n                    error(ts.getNameOfDeclaration(source.declarations[0]), ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target));\n                }\n            }\n            else { // error\n                var isEitherEnum = !!(target.flags & 384 /* Enum */ || source.flags & 384 /* Enum */);\n                var isEitherBlockScoped_1 = !!(target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */);\n                var message = isEitherEnum\n                    ? ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations\n                    : isEitherBlockScoped_1\n                        ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0\n                        : ts.Diagnostics.Duplicate_identifier_0;\n                var sourceSymbolFile = source.declarations && ts.getSourceFileOfNode(source.declarations[0]);\n                var targetSymbolFile = target.declarations && ts.getSourceFileOfNode(target.declarations[0]);\n                var symbolName_1 = symbolToString(source);\n                // Collect top-level duplicate identifier errors into one mapping, so we can then merge their diagnostics if there are a bunch\n                if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {\n                    var firstFile_1 = ts.comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 /* LessThan */ ? sourceSymbolFile : targetSymbolFile;\n                    var secondFile_1 = firstFile_1 === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile;\n                    var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, firstFile_1.path + \"|\" + secondFile_1.path, function () {\n                        return ({ firstFile: firstFile_1, secondFile: secondFile_1, conflictingSymbols: new ts.Map() });\n                    });\n                    var conflictingSymbolInfo = ts.getOrUpdate(filesDuplicates.conflictingSymbols, symbolName_1, function () {\n                        return ({ isBlockScoped: isEitherBlockScoped_1, firstFileLocations: [], secondFileLocations: [] });\n                    });\n                    addDuplicateLocations(conflictingSymbolInfo.firstFileLocations, source);\n                    addDuplicateLocations(conflictingSymbolInfo.secondFileLocations, target);\n                }\n                else {\n                    addDuplicateDeclarationErrorsForSymbols(source, message, symbolName_1, target);\n                    addDuplicateDeclarationErrorsForSymbols(target, message, symbolName_1, source);\n                }\n            }\n            return target;\n            function addDuplicateLocations(locs, symbol) {\n                for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                    var decl = _a[_i];\n                    ts.pushIfUnique(locs, decl);\n                }\n            }\n        }\n        function addDuplicateDeclarationErrorsForSymbols(target, message, symbolName, source) {\n            ts.forEach(target.declarations, function (node) {\n                addDuplicateDeclarationError(node, message, symbolName, source.declarations);\n            });\n        }\n        function addDuplicateDeclarationError(node, message, symbolName, relatedNodes) {\n            var errorNode = (ts.getExpandoInitializer(node, /*isPrototypeAssignment*/ false) ? ts.getNameOfExpando(node) : ts.getNameOfDeclaration(node)) || node;\n            var err = lookupOrIssueError(errorNode, message, symbolName);\n            var _loop_7 = function (relatedNode) {\n                var adjustedNode = (ts.getExpandoInitializer(relatedNode, /*isPrototypeAssignment*/ false) ? ts.getNameOfExpando(relatedNode) : ts.getNameOfDeclaration(relatedNode)) || relatedNode;\n                if (adjustedNode === errorNode)\n                    return \"continue\";\n                err.relatedInformation = err.relatedInformation || [];\n                var leadingMessage = ts.createDiagnosticForNode(adjustedNode, ts.Diagnostics._0_was_also_declared_here, symbolName);\n                var followOnMessage = ts.createDiagnosticForNode(adjustedNode, ts.Diagnostics.and_here);\n                if (ts.length(err.relatedInformation) >= 5 || ts.some(err.relatedInformation, function (r) { return ts.compareDiagnostics(r, followOnMessage) === 0 /* EqualTo */ || ts.compareDiagnostics(r, leadingMessage) === 0 /* EqualTo */; }))\n                    return \"continue\";\n                ts.addRelatedInfo(err, !ts.length(err.relatedInformation) ? leadingMessage : followOnMessage);\n            };\n            for (var _i = 0, _a = relatedNodes || ts.emptyArray; _i < _a.length; _i++) {\n                var relatedNode = _a[_i];\n                _loop_7(relatedNode);\n            }\n        }\n        function combineSymbolTables(first, second) {\n            if (!(first === null || first === void 0 ? void 0 : first.size))\n                return second;\n            if (!(second === null || second === void 0 ? void 0 : second.size))\n                return first;\n            var combined = ts.createSymbolTable();\n            mergeSymbolTable(combined, first);\n            mergeSymbolTable(combined, second);\n            return combined;\n        }\n        function mergeSymbolTable(target, source, unidirectional) {\n            if (unidirectional === void 0) { unidirectional = false; }\n            source.forEach(function (sourceSymbol, id) {\n                var targetSymbol = target.get(id);\n                target.set(id, targetSymbol ? mergeSymbol(targetSymbol, sourceSymbol, unidirectional) : sourceSymbol);\n            });\n        }\n        function mergeModuleAugmentation(moduleName) {\n            var _a, _b;\n            var moduleAugmentation = moduleName.parent;\n            if (moduleAugmentation.symbol.declarations[0] !== moduleAugmentation) {\n                // this is a combined symbol for multiple augmentations within the same file.\n                // its symbol already has accumulated information for all declarations\n                // so we need to add it just once - do the work only for first declaration\n                ts.Debug.assert(moduleAugmentation.symbol.declarations.length > 1);\n                return;\n            }\n            if (ts.isGlobalScopeAugmentation(moduleAugmentation)) {\n                mergeSymbolTable(globals, moduleAugmentation.symbol.exports);\n            }\n            else {\n                // find a module that about to be augmented\n                // do not validate names of augmentations that are defined in ambient context\n                var moduleNotFoundError = !(moduleName.parent.parent.flags & 8388608 /* Ambient */)\n                    ? ts.Diagnostics.Invalid_module_name_in_augmentation_module_0_cannot_be_found\n                    : undefined;\n                var mainModule_1 = resolveExternalModuleNameWorker(moduleName, moduleName, moduleNotFoundError, /*isForAugmentation*/ true);\n                if (!mainModule_1) {\n                    return;\n                }\n                // obtain item referenced by 'export='\n                mainModule_1 = resolveExternalModuleSymbol(mainModule_1);\n                if (mainModule_1.flags & 1920 /* Namespace */) {\n                    // If we're merging an augmentation to a pattern ambient module, we want to\n                    // perform the merge unidirectionally from the augmentation ('a.foo') to\n                    // the pattern ('*.foo'), so that 'getMergedSymbol()' on a.foo gives you\n                    // all the exports both from the pattern and from the augmentation, but\n                    // 'getMergedSymbol()' on *.foo only gives you exports from *.foo.\n                    if (ts.some(patternAmbientModules, function (module) { return mainModule_1 === module.symbol; })) {\n                        var merged = mergeSymbol(moduleAugmentation.symbol, mainModule_1, /*unidirectional*/ true);\n                        if (!patternAmbientModuleAugmentations) {\n                            patternAmbientModuleAugmentations = new ts.Map();\n                        }\n                        // moduleName will be a StringLiteral since this is not `declare global`.\n                        patternAmbientModuleAugmentations.set(moduleName.text, merged);\n                    }\n                    else {\n                        if (((_a = mainModule_1.exports) === null || _a === void 0 ? void 0 : _a.get(\"__export\" /* ExportStar */)) && ((_b = moduleAugmentation.symbol.exports) === null || _b === void 0 ? void 0 : _b.size)) {\n                            // We may need to merge the module augmentation's exports into the target symbols of the resolved exports\n                            var resolvedExports = getResolvedMembersOrExportsOfSymbol(mainModule_1, \"resolvedExports\" /* resolvedExports */);\n                            for (var _i = 0, _c = ts.arrayFrom(moduleAugmentation.symbol.exports.entries()); _i < _c.length; _i++) {\n                                var _d = _c[_i], key = _d[0], value = _d[1];\n                                if (resolvedExports.has(key) && !mainModule_1.exports.has(key)) {\n                                    mergeSymbol(resolvedExports.get(key), value);\n                                }\n                            }\n                        }\n                        mergeSymbol(mainModule_1, moduleAugmentation.symbol);\n                    }\n                }\n                else {\n                    // moduleName will be a StringLiteral since this is not `declare global`.\n                    error(moduleName, ts.Diagnostics.Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity, moduleName.text);\n                }\n            }\n        }\n        function addToSymbolTable(target, source, message) {\n            source.forEach(function (sourceSymbol, id) {\n                var targetSymbol = target.get(id);\n                if (targetSymbol) {\n                    // Error on redeclarations\n                    ts.forEach(targetSymbol.declarations, addDeclarationDiagnostic(ts.unescapeLeadingUnderscores(id), message));\n                }\n                else {\n                    target.set(id, sourceSymbol);\n                }\n            });\n            function addDeclarationDiagnostic(id, message) {\n                return function (declaration) { return diagnostics.add(ts.createDiagnosticForNode(declaration, message, id)); };\n            }\n        }\n        function getSymbolLinks(symbol) {\n            if (symbol.flags & 33554432 /* Transient */)\n                return symbol;\n            var id = getSymbolId(symbol);\n            return symbolLinks[id] || (symbolLinks[id] = new SymbolLinks());\n        }\n        function getNodeLinks(node) {\n            var nodeId = getNodeId(node);\n            return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks());\n        }\n        function isGlobalSourceFile(node) {\n            return node.kind === 297 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node);\n        }\n        function getSymbol(symbols, name, meaning) {\n            if (meaning) {\n                var symbol = getMergedSymbol(symbols.get(name));\n                if (symbol) {\n                    ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, \"Should never get an instantiated symbol here.\");\n                    if (symbol.flags & meaning) {\n                        return symbol;\n                    }\n                    if (symbol.flags & 2097152 /* Alias */) {\n                        var target = resolveAlias(symbol);\n                        // Unknown symbol means an error occurred in alias resolution, treat it as positive answer to avoid cascading errors\n                        if (target === unknownSymbol || target.flags & meaning) {\n                            return symbol;\n                        }\n                    }\n                }\n            }\n            // return undefined if we can't find a symbol.\n        }\n        /**\n         * Get symbols that represent parameter-property-declaration as parameter and as property declaration\n         * @param parameter a parameterDeclaration node\n         * @param parameterName a name of the parameter to get the symbols for.\n         * @return a tuple of two symbols\n         */\n        function getSymbolsOfParameterPropertyDeclaration(parameter, parameterName) {\n            var constructorDeclaration = parameter.parent;\n            var classDeclaration = parameter.parent.parent;\n            var parameterSymbol = getSymbol(constructorDeclaration.locals, parameterName, 111551 /* Value */);\n            var propertySymbol = getSymbol(getMembersOfSymbol(classDeclaration.symbol), parameterName, 111551 /* Value */);\n            if (parameterSymbol && propertySymbol) {\n                return [parameterSymbol, propertySymbol];\n            }\n            return ts.Debug.fail(\"There should exist two symbols, one as property declaration and one as parameter declaration\");\n        }\n        function isBlockScopedNameDeclaredBeforeUse(declaration, usage) {\n            var declarationFile = ts.getSourceFileOfNode(declaration);\n            var useFile = ts.getSourceFileOfNode(usage);\n            var declContainer = ts.getEnclosingBlockScopeContainer(declaration);\n            if (declarationFile !== useFile) {\n                if ((moduleKind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator)) ||\n                    (!ts.outFile(compilerOptions)) ||\n                    isInTypeQuery(usage) ||\n                    declaration.flags & 8388608 /* Ambient */) {\n                    // nodes are in different files and order cannot be determined\n                    return true;\n                }\n                // declaration is after usage\n                // can be legal if usage is deferred (i.e. inside function or in initializer of instance property)\n                if (isUsedInFunctionOrInstanceProperty(usage, declaration)) {\n                    return true;\n                }\n                var sourceFiles = host.getSourceFiles();\n                return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile);\n            }\n            if (declaration.pos <= usage.pos && !(ts.isPropertyDeclaration(declaration) && ts.isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) {\n                // declaration is before usage\n                if (declaration.kind === 198 /* BindingElement */) {\n                    // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2])\n                    var errorBindingElement = ts.getAncestor(usage, 198 /* BindingElement */);\n                    if (errorBindingElement) {\n                        return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) ||\n                            declaration.pos < errorBindingElement.pos;\n                    }\n                    // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a)\n                    return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 249 /* VariableDeclaration */), usage);\n                }\n                else if (declaration.kind === 249 /* VariableDeclaration */) {\n                    // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a)\n                    return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);\n                }\n                else if (ts.isClassDeclaration(declaration)) {\n                    // still might be illegal if the usage is within a computed property name in the class (eg class A { static p = \"a\"; [A.p]() {} })\n                    return !ts.findAncestor(usage, function (n) { return ts.isComputedPropertyName(n) && n.parent.parent === declaration; });\n                }\n                else if (ts.isPropertyDeclaration(declaration)) {\n                    // still might be illegal if a self-referencing property initializer (eg private x = this.x)\n                    return !isPropertyImmediatelyReferencedWithinDeclaration(declaration, usage, /*stopAtAnyPropertyDeclaration*/ false);\n                }\n                else if (ts.isParameterPropertyDeclaration(declaration, declaration.parent)) {\n                    // foo = this.bar is illegal in esnext+useDefineForClassFields when bar is a parameter property\n                    return !(compilerOptions.target === 99 /* ESNext */ && !!compilerOptions.useDefineForClassFields\n                        && ts.getContainingClass(declaration) === ts.getContainingClass(usage)\n                        && isUsedInFunctionOrInstanceProperty(usage, declaration));\n                }\n                return true;\n            }\n            // declaration is after usage, but it can still be legal if usage is deferred:\n            // 1. inside an export specifier\n            // 2. inside a function\n            // 3. inside an instance property initializer, a reference to a non-instance property\n            //    (except when target: \"esnext\" and useDefineForClassFields: true and the reference is to a parameter property)\n            // 4. inside a static property initializer, a reference to a static method in the same class\n            // 5. inside a TS export= declaration (since we will move the export statement during emit to avoid TDZ)\n            // or if usage is in a type context:\n            // 1. inside a type query (typeof in type position)\n            // 2. inside a jsdoc comment\n            if (usage.parent.kind === 270 /* ExportSpecifier */ || (usage.parent.kind === 266 /* ExportAssignment */ && usage.parent.isExportEquals)) {\n                // export specifiers do not use the variable, they only make it available for use\n                return true;\n            }\n            // When resolving symbols for exports, the `usage` location passed in can be the export site directly\n            if (usage.kind === 266 /* ExportAssignment */ && usage.isExportEquals) {\n                return true;\n            }\n            if (!!(usage.flags & 4194304 /* JSDoc */) || isInTypeQuery(usage) || usageInTypeDeclaration()) {\n                return true;\n            }\n            if (isUsedInFunctionOrInstanceProperty(usage, declaration)) {\n                if (compilerOptions.target === 99 /* ESNext */ && !!compilerOptions.useDefineForClassFields\n                    && ts.getContainingClass(declaration)\n                    && (ts.isPropertyDeclaration(declaration) || ts.isParameterPropertyDeclaration(declaration, declaration.parent))) {\n                    return !isPropertyImmediatelyReferencedWithinDeclaration(declaration, usage, /*stopAtAnyPropertyDeclaration*/ true);\n                }\n                else {\n                    return true;\n                }\n            }\n            return false;\n            function usageInTypeDeclaration() {\n                return !!ts.findAncestor(usage, function (node) { return ts.isInterfaceDeclaration(node) || ts.isTypeAliasDeclaration(node); });\n            }\n            function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) {\n                switch (declaration.parent.parent.kind) {\n                    case 232 /* VariableStatement */:\n                    case 237 /* ForStatement */:\n                    case 239 /* ForOfStatement */:\n                        // variable statement/for/for-of statement case,\n                        // use site should not be inside variable declaration (initializer of declaration or binding element)\n                        if (isSameScopeDescendentOf(usage, declaration, declContainer)) {\n                            return true;\n                        }\n                        break;\n                }\n                // ForIn/ForOf case - use site should not be used in expression part\n                var grandparent = declaration.parent.parent;\n                return ts.isForInOrOfStatement(grandparent) && isSameScopeDescendentOf(usage, grandparent.expression, declContainer);\n            }\n            function isUsedInFunctionOrInstanceProperty(usage, declaration) {\n                return !!ts.findAncestor(usage, function (current) {\n                    if (current === declContainer) {\n                        return \"quit\";\n                    }\n                    if (ts.isFunctionLike(current)) {\n                        return true;\n                    }\n                    var initializerOfProperty = current.parent &&\n                        current.parent.kind === 163 /* PropertyDeclaration */ &&\n                        current.parent.initializer === current;\n                    if (initializerOfProperty) {\n                        if (ts.hasSyntacticModifier(current.parent, 32 /* Static */)) {\n                            if (declaration.kind === 165 /* MethodDeclaration */) {\n                                return true;\n                            }\n                        }\n                        else {\n                            var isDeclarationInstanceProperty = declaration.kind === 163 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(declaration, 32 /* Static */);\n                            if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) {\n                                return true;\n                            }\n                        }\n                    }\n                    return false;\n                });\n            }\n            /** stopAtAnyPropertyDeclaration is used for detecting ES-standard class field use-before-def errors */\n            function isPropertyImmediatelyReferencedWithinDeclaration(declaration, usage, stopAtAnyPropertyDeclaration) {\n                // always legal if usage is after declaration\n                if (usage.end > declaration.end) {\n                    return false;\n                }\n                // still might be legal if usage is deferred (e.g. x: any = () => this.x)\n                // otherwise illegal if immediately referenced within the declaration (e.g. x: any = this.x)\n                var ancestorChangingReferenceScope = ts.findAncestor(usage, function (node) {\n                    if (node === declaration) {\n                        return \"quit\";\n                    }\n                    switch (node.kind) {\n                        case 209 /* ArrowFunction */:\n                            return true;\n                        case 163 /* PropertyDeclaration */:\n                            // even when stopping at any property declaration, they need to come from the same class\n                            return stopAtAnyPropertyDeclaration &&\n                                (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent\n                                    || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent)\n                                ? \"quit\" : true;\n                        case 230 /* Block */:\n                            switch (node.parent.kind) {\n                                case 167 /* GetAccessor */:\n                                case 165 /* MethodDeclaration */:\n                                case 168 /* SetAccessor */:\n                                    return true;\n                                default:\n                                    return false;\n                            }\n                        default:\n                            return false;\n                    }\n                });\n                return ancestorChangingReferenceScope === undefined;\n            }\n        }\n        function useOuterVariableScopeInParameter(result, location, lastLocation) {\n            var target = ts.getEmitScriptTarget(compilerOptions);\n            var functionLocation = location;\n            if (ts.isParameter(lastLocation) && functionLocation.body && result.valueDeclaration.pos >= functionLocation.body.pos && result.valueDeclaration.end <= functionLocation.body.end) {\n                // check for several cases where we introduce temporaries that require moving the name/initializer of the parameter to the body\n                // - static field in a class expression\n                // - optional chaining pre-es2020\n                // - nullish coalesce pre-es2020\n                // - spread assignment in binding pattern pre-es2017\n                if (target >= 2 /* ES2015 */) {\n                    var links = getNodeLinks(functionLocation);\n                    if (links.declarationRequiresScopeChange === undefined) {\n                        links.declarationRequiresScopeChange = ts.forEach(functionLocation.parameters, requiresScopeChange) || false;\n                    }\n                    return !links.declarationRequiresScopeChange;\n                }\n            }\n            return false;\n            function requiresScopeChange(node) {\n                return requiresScopeChangeWorker(node.name)\n                    || !!node.initializer && requiresScopeChangeWorker(node.initializer);\n            }\n            function requiresScopeChangeWorker(node) {\n                switch (node.kind) {\n                    case 209 /* ArrowFunction */:\n                    case 208 /* FunctionExpression */:\n                    case 251 /* FunctionDeclaration */:\n                    case 166 /* Constructor */:\n                        // do not descend into these\n                        return false;\n                    case 165 /* MethodDeclaration */:\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                    case 288 /* PropertyAssignment */:\n                        return requiresScopeChangeWorker(node.name);\n                    case 163 /* PropertyDeclaration */:\n                        // static properties in classes introduce temporary variables\n                        if (ts.hasStaticModifier(node)) {\n                            return target < 99 /* ESNext */ || !compilerOptions.useDefineForClassFields;\n                        }\n                        return requiresScopeChangeWorker(node.name);\n                    default:\n                        // null coalesce and optional chain pre-es2020 produce temporary variables\n                        if (ts.isNullishCoalesce(node) || ts.isOptionalChain(node)) {\n                            return target < 7 /* ES2020 */;\n                        }\n                        if (ts.isBindingElement(node) && node.dotDotDotToken && ts.isObjectBindingPattern(node.parent)) {\n                            return target < 4 /* ES2017 */;\n                        }\n                        if (ts.isTypeNode(node))\n                            return false;\n                        return ts.forEachChild(node, requiresScopeChangeWorker) || false;\n                }\n            }\n        }\n        /**\n         * Resolve a given name for a given meaning at a given location. An error is reported if the name was not found and\n         * the nameNotFoundMessage argument is not undefined. Returns the resolved symbol, or undefined if no symbol with\n         * the given name can be found.\n         *\n         * @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters.\n         */\n        function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, suggestedNameNotFoundMessage) {\n            if (excludeGlobals === void 0) { excludeGlobals = false; }\n            return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol, suggestedNameNotFoundMessage);\n        }\n        function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup, suggestedNameNotFoundMessage) {\n            var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location\n            var result;\n            var lastLocation;\n            var lastSelfReferenceLocation;\n            var propertyWithInvalidInitializer;\n            var associatedDeclarationForContainingInitializerOrBindingName;\n            var withinDeferredContext = false;\n            var errorLocation = location;\n            var grandparent;\n            var isInExternalModule = false;\n            loop: while (location) {\n                // Locals of a source file are not in scope (because they get merged into the global symbol table)\n                if (location.locals && !isGlobalSourceFile(location)) {\n                    if (result = lookup(location.locals, name, meaning)) {\n                        var useResult = true;\n                        if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) {\n                            // symbol lookup restrictions for function-like declarations\n                            // - Type parameters of a function are in scope in the entire function declaration, including the parameter\n                            //   list and return type. However, local types are only in scope in the function body.\n                            // - parameters are only in the scope of function body\n                            // This restriction does not apply to JSDoc comment types because they are parented\n                            // at a higher level than type parameters would normally be\n                            if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 311 /* JSDocComment */) {\n                                useResult = result.flags & 262144 /* TypeParameter */\n                                    // type parameters are visible in parameter list, return type and type parameter list\n                                    ? lastLocation === location.type ||\n                                        lastLocation.kind === 160 /* Parameter */ ||\n                                        lastLocation.kind === 159 /* TypeParameter */\n                                    // local types not visible outside the function body\n                                    : false;\n                            }\n                            if (meaning & result.flags & 3 /* Variable */) {\n                                // expression inside parameter will lookup as normal variable scope when targeting es2015+\n                                if (useOuterVariableScopeInParameter(result, location, lastLocation)) {\n                                    useResult = false;\n                                }\n                                else if (result.flags & 1 /* FunctionScopedVariable */) {\n                                    // parameters are visible only inside function body, parameter list and return type\n                                    // technically for parameter list case here we might mix parameters and variables declared in function,\n                                    // however it is detected separately when checking initializers of parameters\n                                    // to make sure that they reference no variables declared after them.\n                                    useResult =\n                                        lastLocation.kind === 160 /* Parameter */ ||\n                                            (lastLocation === location.type &&\n                                                !!ts.findAncestor(result.valueDeclaration, ts.isParameter));\n                                }\n                            }\n                        }\n                        else if (location.kind === 184 /* ConditionalType */) {\n                            // A type parameter declared using 'infer T' in a conditional type is visible only in\n                            // the true branch of the conditional type.\n                            useResult = lastLocation === location.trueType;\n                        }\n                        if (useResult) {\n                            break loop;\n                        }\n                        else {\n                            result = undefined;\n                        }\n                    }\n                }\n                withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation);\n                switch (location.kind) {\n                    case 297 /* SourceFile */:\n                        if (!ts.isExternalOrCommonJsModule(location))\n                            break;\n                        isInExternalModule = true;\n                    // falls through\n                    case 256 /* ModuleDeclaration */:\n                        var moduleExports = getSymbolOfNode(location).exports || emptySymbols;\n                        if (location.kind === 297 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) {\n                            // It's an external module. First see if the module has an export default and if the local\n                            // name of that export default matches.\n                            if (result = moduleExports.get(\"default\" /* Default */)) {\n                                var localSymbol = ts.getLocalSymbolForExportDefault(result);\n                                if (localSymbol && (result.flags & meaning) && localSymbol.escapedName === name) {\n                                    break loop;\n                                }\n                                result = undefined;\n                            }\n                            // Because of module/namespace merging, a module's exports are in scope,\n                            // yet we never want to treat an export specifier as putting a member in scope.\n                            // Therefore, if the name we find is purely an export specifier, it is not actually considered in scope.\n                            // Two things to note about this:\n                            //     1. We have to check this without calling getSymbol. The problem with calling getSymbol\n                            //        on an export specifier is that it might find the export specifier itself, and try to\n                            //        resolve it as an alias. This will cause the checker to consider the export specifier\n                            //        a circular alias reference when it might not be.\n                            //     2. We check === SymbolFlags.Alias in order to check that the symbol is *purely*\n                            //        an alias. If we used &, we'd be throwing out symbols that have non alias aspects,\n                            //        which is not the desired behavior.\n                            var moduleExport = moduleExports.get(name);\n                            if (moduleExport &&\n                                moduleExport.flags === 2097152 /* Alias */ &&\n                                (ts.getDeclarationOfKind(moduleExport, 270 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 269 /* NamespaceExport */))) {\n                                break;\n                            }\n                        }\n                        // ES6 exports are also visible locally (except for 'default'), but commonjs exports are not (except typedefs)\n                        if (name !== \"default\" /* Default */ && (result = lookup(moduleExports, name, meaning & 2623475 /* ModuleMember */))) {\n                            if (ts.isSourceFile(location) && location.commonJsModuleIndicator && !result.declarations.some(ts.isJSDocTypeAlias)) {\n                                result = undefined;\n                            }\n                            else {\n                                break loop;\n                            }\n                        }\n                        break;\n                    case 255 /* EnumDeclaration */:\n                        if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) {\n                            break loop;\n                        }\n                        break;\n                    case 163 /* PropertyDeclaration */:\n                        // TypeScript 1.0 spec (April 2014): 8.4.1\n                        // Initializer expressions for instance member variables are evaluated in the scope\n                        // of the class constructor body but are not permitted to reference parameters or\n                        // local variables of the constructor. This effectively means that entities from outer scopes\n                        // by the same name as a constructor parameter or local variable are inaccessible\n                        // in initializer expressions for instance member variables.\n                        if (!ts.hasSyntacticModifier(location, 32 /* Static */)) {\n                            var ctor = findConstructorDeclaration(location.parent);\n                            if (ctor && ctor.locals) {\n                                if (lookup(ctor.locals, name, meaning & 111551 /* Value */)) {\n                                    // Remember the property node, it will be used later to report appropriate error\n                                    propertyWithInvalidInitializer = location;\n                                }\n                            }\n                        }\n                        break;\n                    case 252 /* ClassDeclaration */:\n                    case 221 /* ClassExpression */:\n                    case 253 /* InterfaceDeclaration */:\n                        // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals\n                        // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would\n                        // trigger resolving late-bound names, which we may already be in the process of doing while we're here!\n                        if (result = lookup(getSymbolOfNode(location).members || emptySymbols, name, meaning & 788968 /* Type */)) {\n                            if (!isTypeParameterSymbolDeclaredInContainer(result, location)) {\n                                // ignore type parameters not declared in this container\n                                result = undefined;\n                                break;\n                            }\n                            if (lastLocation && ts.hasSyntacticModifier(lastLocation, 32 /* Static */)) {\n                                // TypeScript 1.0 spec (April 2014): 3.4.1\n                                // The scope of a type parameter extends over the entire declaration with which the type\n                                // parameter list is associated, with the exception of static member declarations in classes.\n                                error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters);\n                                return undefined;\n                            }\n                            break loop;\n                        }\n                        if (location.kind === 221 /* ClassExpression */ && meaning & 32 /* Class */) {\n                            var className = location.name;\n                            if (className && name === className.escapedText) {\n                                result = location.symbol;\n                                break loop;\n                            }\n                        }\n                        break;\n                    case 223 /* ExpressionWithTypeArguments */:\n                        // The type parameters of a class are not in scope in the base class expression.\n                        if (lastLocation === location.expression && location.parent.token === 93 /* ExtendsKeyword */) {\n                            var container = location.parent.parent;\n                            if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 788968 /* Type */))) {\n                                if (nameNotFoundMessage) {\n                                    error(errorLocation, ts.Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters);\n                                }\n                                return undefined;\n                            }\n                        }\n                        break;\n                    // It is not legal to reference a class's own type parameters from a computed property name that\n                    // belongs to the class. For example:\n                    //\n                    //   function foo<T>() { return '' }\n                    //   class C<T> { // <-- Class's own type parameter T\n                    //       [foo<T>()]() { } // <-- Reference to T from class's own computed property\n                    //   }\n                    //\n                    case 158 /* ComputedPropertyName */:\n                        grandparent = location.parent.parent;\n                        if (ts.isClassLike(grandparent) || grandparent.kind === 253 /* InterfaceDeclaration */) {\n                            // A reference to this grandparent's type parameters would be an error\n                            if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) {\n                                error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);\n                                return undefined;\n                            }\n                        }\n                        break;\n                    case 209 /* ArrowFunction */:\n                        // when targeting ES6 or higher there is no 'arguments' in an arrow function\n                        // for lower compile targets the resolved symbol is used to emit an error\n                        if (compilerOptions.target >= 2 /* ES2015 */) {\n                            break;\n                        }\n                    // falls through\n                    case 165 /* MethodDeclaration */:\n                    case 166 /* Constructor */:\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                    case 251 /* FunctionDeclaration */:\n                        if (meaning & 3 /* Variable */ && name === \"arguments\") {\n                            result = argumentsSymbol;\n                            break loop;\n                        }\n                        break;\n                    case 208 /* FunctionExpression */:\n                        if (meaning & 3 /* Variable */ && name === \"arguments\") {\n                            result = argumentsSymbol;\n                            break loop;\n                        }\n                        if (meaning & 16 /* Function */) {\n                            var functionName = location.name;\n                            if (functionName && name === functionName.escapedText) {\n                                result = location.symbol;\n                                break loop;\n                            }\n                        }\n                        break;\n                    case 161 /* Decorator */:\n                        // Decorators are resolved at the class declaration. Resolving at the parameter\n                        // or member would result in looking up locals in the method.\n                        //\n                        //   function y() {}\n                        //   class C {\n                        //       method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter.\n                        //   }\n                        //\n                        if (location.parent && location.parent.kind === 160 /* Parameter */) {\n                            location = location.parent;\n                        }\n                        //\n                        //   function y() {}\n                        //   class C {\n                        //       @y method(x, y) {} // <-- decorator y should be resolved at the class declaration, not the method.\n                        //   }\n                        //\n                        // class Decorators are resolved outside of the class to avoid referencing type parameters of that class.\n                        //\n                        //   type T = number;\n                        //   declare function y(x: T): any;\n                        //   @param(1 as T) // <-- T should resolve to the type alias outside of class C\n                        //   class C<T> {}\n                        if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 252 /* ClassDeclaration */)) {\n                            location = location.parent;\n                        }\n                        break;\n                    case 331 /* JSDocTypedefTag */:\n                    case 324 /* JSDocCallbackTag */:\n                    case 325 /* JSDocEnumTag */:\n                        // js type aliases do not resolve names from their host, so skip past it\n                        var root = ts.getJSDocRoot(location);\n                        if (root) {\n                            location = root.parent;\n                        }\n                        break;\n                    case 160 /* Parameter */:\n                        if (lastLocation && (lastLocation === location.initializer ||\n                            lastLocation === location.name && ts.isBindingPattern(lastLocation))) {\n                            if (!associatedDeclarationForContainingInitializerOrBindingName) {\n                                associatedDeclarationForContainingInitializerOrBindingName = location;\n                            }\n                        }\n                        break;\n                    case 198 /* BindingElement */:\n                        if (lastLocation && (lastLocation === location.initializer ||\n                            lastLocation === location.name && ts.isBindingPattern(lastLocation))) {\n                            if (ts.isParameterDeclaration(location) && !associatedDeclarationForContainingInitializerOrBindingName) {\n                                associatedDeclarationForContainingInitializerOrBindingName = location;\n                            }\n                        }\n                        break;\n                    case 185 /* InferType */:\n                        if (meaning & 262144 /* TypeParameter */) {\n                            var parameterName = location.typeParameter.name;\n                            if (parameterName && name === parameterName.escapedText) {\n                                result = location.typeParameter.symbol;\n                                break loop;\n                            }\n                        }\n                        break;\n                }\n                if (isSelfReferenceLocation(location)) {\n                    lastSelfReferenceLocation = location;\n                }\n                lastLocation = location;\n                location = location.parent;\n            }\n            // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`.\n            // If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself.\n            // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used.\n            if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) {\n                result.isReferenced |= meaning;\n            }\n            if (!result) {\n                if (lastLocation) {\n                    ts.Debug.assert(lastLocation.kind === 297 /* SourceFile */);\n                    if (lastLocation.commonJsModuleIndicator && name === \"exports\" && meaning & lastLocation.symbol.flags) {\n                        return lastLocation.symbol;\n                    }\n                }\n                if (!excludeGlobals) {\n                    result = lookup(globals, name, meaning);\n                }\n            }\n            if (!result) {\n                if (originalLocation && ts.isInJSFile(originalLocation) && originalLocation.parent) {\n                    if (ts.isRequireCall(originalLocation.parent, /*checkArgumentIsStringLiteralLike*/ false)) {\n                        return requireSymbol;\n                    }\n                }\n            }\n            if (!result) {\n                if (nameNotFoundMessage) {\n                    if (!errorLocation ||\n                        !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && // TODO: GH#18217\n                            !checkAndReportErrorForExtendingInterface(errorLocation) &&\n                            !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) &&\n                            !checkAndReportErrorForExportingPrimitiveType(errorLocation, name) &&\n                            !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) &&\n                            !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) &&\n                            !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {\n                        var suggestion = void 0;\n                        if (suggestedNameNotFoundMessage && suggestionCount < maximumSuggestionCount) {\n                            suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning);\n                            var isGlobalScopeAugmentationDeclaration = suggestion && suggestion.valueDeclaration && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration);\n                            if (isGlobalScopeAugmentationDeclaration) {\n                                suggestion = undefined;\n                            }\n                            if (suggestion) {\n                                var suggestionName = symbolToString(suggestion);\n                                var diagnostic = error(errorLocation, suggestedNameNotFoundMessage, diagnosticName(nameArg), suggestionName);\n                                if (suggestion.valueDeclaration) {\n                                    ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));\n                                }\n                            }\n                        }\n                        if (!suggestion) {\n                            if (nameArg) {\n                                var lib = getSuggestedLibForNonExistentName(nameArg);\n                                if (lib) {\n                                    error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg), lib);\n                                }\n                                else {\n                                    error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg));\n                                }\n                            }\n                        }\n                        suggestionCount++;\n                    }\n                }\n                return undefined;\n            }\n            // Perform extra checks only if error reporting was requested\n            if (nameNotFoundMessage) {\n                if (propertyWithInvalidInitializer && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) {\n                    // We have a match, but the reference occurred within a property initializer and the identifier also binds\n                    // to a local variable in the constructor where the code will be emitted. Note that this is actually allowed\n                    // with ESNext+useDefineForClassFields because the scope semantics are different.\n                    var propertyName = propertyWithInvalidInitializer.name;\n                    error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), diagnosticName(nameArg));\n                    return undefined;\n                }\n                // Only check for block-scoped variable if we have an error location and are looking for the\n                // name with variable meaning\n                //      For example,\n                //          declare module foo {\n                //              interface bar {}\n                //          }\n                //      const foo/*1*/: foo/*2*/.bar;\n                // The foo at /*1*/ and /*2*/ will share same symbol with two meanings:\n                // block-scoped variable and namespace module. However, only when we\n                // try to resolve name in /*1*/ which is used in variable position,\n                // we want to check for block-scoped\n                if (errorLocation &&\n                    (meaning & 2 /* BlockScopedVariable */ ||\n                        ((meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 111551 /* Value */) === 111551 /* Value */))) {\n                    var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result);\n                    if (exportOrLocalSymbol.flags & 2 /* BlockScopedVariable */ || exportOrLocalSymbol.flags & 32 /* Class */ || exportOrLocalSymbol.flags & 384 /* Enum */) {\n                        checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);\n                    }\n                }\n                // If we're in an external module, we can't reference value symbols created from UMD export declarations\n                if (result && isInExternalModule && (meaning & 111551 /* Value */) === 111551 /* Value */ && !(originalLocation.flags & 4194304 /* JSDoc */)) {\n                    var merged = getMergedSymbol(result);\n                    if (ts.length(merged.declarations) && ts.every(merged.declarations, function (d) { return ts.isNamespaceExportDeclaration(d) || ts.isSourceFile(d) && !!d.symbol.globalExports; })) {\n                        errorOrSuggestion(!compilerOptions.allowUmdGlobalAccess, errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts.unescapeLeadingUnderscores(name));\n                    }\n                }\n                // If we're in a parameter initializer or binding name, we can't reference the values of the parameter whose initializer we're within or parameters to the right\n                if (result && associatedDeclarationForContainingInitializerOrBindingName && !withinDeferredContext && (meaning & 111551 /* Value */) === 111551 /* Value */) {\n                    var candidate = getMergedSymbol(getLateBoundSymbol(result));\n                    var root = ts.getRootDeclaration(associatedDeclarationForContainingInitializerOrBindingName);\n                    // A parameter initializer or binding pattern initializer within a parameter cannot refer to itself\n                    if (candidate === getSymbolOfNode(associatedDeclarationForContainingInitializerOrBindingName)) {\n                        error(errorLocation, ts.Diagnostics.Parameter_0_cannot_reference_itself, ts.declarationNameToString(associatedDeclarationForContainingInitializerOrBindingName.name));\n                    }\n                    // And it cannot refer to any declarations which come after it\n                    else if (candidate.valueDeclaration && candidate.valueDeclaration.pos > associatedDeclarationForContainingInitializerOrBindingName.pos && root.parent.locals && lookup(root.parent.locals, candidate.escapedName, meaning) === candidate) {\n                        error(errorLocation, ts.Diagnostics.Parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(associatedDeclarationForContainingInitializerOrBindingName.name), ts.declarationNameToString(errorLocation));\n                    }\n                }\n                if (result && errorLocation && meaning & 111551 /* Value */ && result.flags & 2097152 /* Alias */) {\n                    checkSymbolUsageInExpressionContext(result, name, errorLocation);\n                }\n            }\n            return result;\n        }\n        function checkSymbolUsageInExpressionContext(symbol, name, useSite) {\n            if (!ts.isValidTypeOnlyAliasUseSite(useSite)) {\n                var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(symbol);\n                if (typeOnlyDeclaration) {\n                    var isExport = ts.typeOnlyDeclarationIsExport(typeOnlyDeclaration);\n                    var message = isExport\n                        ? ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type\n                        : ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;\n                    var relatedMessage = isExport\n                        ? ts.Diagnostics._0_was_exported_here\n                        : ts.Diagnostics._0_was_imported_here;\n                    var unescapedName = ts.unescapeLeadingUnderscores(name);\n                    ts.addRelatedInfo(error(useSite, message, unescapedName), ts.createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, unescapedName));\n                }\n            }\n        }\n        function getIsDeferredContext(location, lastLocation) {\n            if (location.kind !== 209 /* ArrowFunction */ && location.kind !== 208 /* FunctionExpression */) {\n                // initializers in instance property declaration of class like entities are executed in constructor and thus deferred\n                return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) ||\n                    (location.kind === 163 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred\n            }\n            if (lastLocation && lastLocation === location.name) {\n                return false;\n            }\n            // generator functions and async functions are not inlined in control flow when immediately invoked\n            if (location.asteriskToken || ts.hasSyntacticModifier(location, 256 /* Async */)) {\n                return true;\n            }\n            return !ts.getImmediatelyInvokedFunctionExpression(location);\n        }\n        function isSelfReferenceLocation(node) {\n            switch (node.kind) {\n                case 251 /* FunctionDeclaration */:\n                case 252 /* ClassDeclaration */:\n                case 253 /* InterfaceDeclaration */:\n                case 255 /* EnumDeclaration */:\n                case 254 /* TypeAliasDeclaration */:\n                case 256 /* ModuleDeclaration */: // For `namespace N { N; }`\n                    return true;\n                default:\n                    return false;\n            }\n        }\n        function diagnosticName(nameArg) {\n            return ts.isString(nameArg) ? ts.unescapeLeadingUnderscores(nameArg) : ts.declarationNameToString(nameArg);\n        }\n        function isTypeParameterSymbolDeclaredInContainer(symbol, container) {\n            for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                var decl = _a[_i];\n                if (decl.kind === 159 /* TypeParameter */) {\n                    var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent;\n                    if (parent === container) {\n                        return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217\n                    }\n                }\n            }\n            return false;\n        }\n        function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) {\n            if (!ts.isIdentifier(errorLocation) || errorLocation.escapedText !== name || isTypeReferenceIdentifier(errorLocation) || isInTypeQuery(errorLocation)) {\n                return false;\n            }\n            var container = ts.getThisContainer(errorLocation, /*includeArrowFunctions*/ false);\n            var location = container;\n            while (location) {\n                if (ts.isClassLike(location.parent)) {\n                    var classSymbol = getSymbolOfNode(location.parent);\n                    if (!classSymbol) {\n                        break;\n                    }\n                    // Check to see if a static member exists.\n                    var constructorType = getTypeOfSymbol(classSymbol);\n                    if (getPropertyOfType(constructorType, name)) {\n                        error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0, diagnosticName(nameArg), symbolToString(classSymbol));\n                        return true;\n                    }\n                    // No static member is present.\n                    // Check if we're in an instance method and look for a relevant instance member.\n                    if (location === container && !ts.hasSyntacticModifier(location, 32 /* Static */)) {\n                        var instanceType = getDeclaredTypeOfSymbol(classSymbol).thisType; // TODO: GH#18217\n                        if (getPropertyOfType(instanceType, name)) {\n                            error(errorLocation, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, diagnosticName(nameArg));\n                            return true;\n                        }\n                    }\n                }\n                location = location.parent;\n            }\n            return false;\n        }\n        function checkAndReportErrorForExtendingInterface(errorLocation) {\n            var expression = getEntityNameForExtendingInterface(errorLocation);\n            if (expression && resolveEntityName(expression, 64 /* Interface */, /*ignoreErrors*/ true)) {\n                error(errorLocation, ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements, ts.getTextOfNode(expression));\n                return true;\n            }\n            return false;\n        }\n        /**\n         * Climbs up parents to an ExpressionWithTypeArguments, and returns its expression,\n         * but returns undefined if that expression is not an EntityNameExpression.\n         */\n        function getEntityNameForExtendingInterface(node) {\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                case 201 /* PropertyAccessExpression */:\n                    return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined;\n                case 223 /* ExpressionWithTypeArguments */:\n                    if (ts.isEntityNameExpression(node.expression)) {\n                        return node.expression;\n                    }\n                // falls through\n                default:\n                    return undefined;\n            }\n        }\n        function checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) {\n            var namespaceMeaning = 1920 /* Namespace */ | (ts.isInJSFile(errorLocation) ? 111551 /* Value */ : 0);\n            if (meaning === namespaceMeaning) {\n                var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 /* Type */ & ~namespaceMeaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));\n                var parent = errorLocation.parent;\n                if (symbol) {\n                    if (ts.isQualifiedName(parent)) {\n                        ts.Debug.assert(parent.left === errorLocation, \"Should only be resolving left side of qualified name as a namespace\");\n                        var propName = parent.right.escapedText;\n                        var propType = getPropertyOfType(getDeclaredTypeOfSymbol(symbol), propName);\n                        if (propType) {\n                            error(parent, ts.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1, ts.unescapeLeadingUnderscores(name), ts.unescapeLeadingUnderscores(propName));\n                            return true;\n                        }\n                    }\n                    error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here, ts.unescapeLeadingUnderscores(name));\n                    return true;\n                }\n            }\n            return false;\n        }\n        function checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning) {\n            if (meaning & (788968 /* Type */ & ~1920 /* Namespace */)) {\n                var symbol = resolveSymbol(resolveName(errorLocation, name, ~788968 /* Type */ & 111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));\n                if (symbol && !(symbol.flags & 1920 /* Namespace */)) {\n                    error(errorLocation, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, ts.unescapeLeadingUnderscores(name));\n                    return true;\n                }\n            }\n            return false;\n        }\n        function isPrimitiveTypeName(name) {\n            return name === \"any\" || name === \"string\" || name === \"number\" || name === \"boolean\" || name === \"never\" || name === \"unknown\";\n        }\n        function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) {\n            if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 270 /* ExportSpecifier */) {\n                error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name);\n                return true;\n            }\n            return false;\n        }\n        function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) {\n            if (meaning & (111551 /* Value */ & ~1024 /* NamespaceModule */)) {\n                if (isPrimitiveTypeName(name)) {\n                    error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name));\n                    return true;\n                }\n                var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 /* Type */ & ~111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));\n                if (symbol && !(symbol.flags & 1024 /* NamespaceModule */)) {\n                    var rawName = ts.unescapeLeadingUnderscores(name);\n                    if (isES2015OrLaterConstructorName(name)) {\n                        error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later, rawName);\n                    }\n                    else if (maybeMappedType(errorLocation, symbol)) {\n                        error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0, rawName, rawName === \"K\" ? \"P\" : \"K\");\n                    }\n                    else {\n                        error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, rawName);\n                    }\n                    return true;\n                }\n            }\n            return false;\n        }\n        function maybeMappedType(node, symbol) {\n            var container = ts.findAncestor(node.parent, function (n) {\n                return ts.isComputedPropertyName(n) || ts.isPropertySignature(n) ? false : ts.isTypeLiteralNode(n) || \"quit\";\n            });\n            if (container && container.members.length === 1) {\n                var type = getDeclaredTypeOfSymbol(symbol);\n                return !!(type.flags & 1048576 /* Union */) && allTypesAssignableToKind(type, 384 /* StringOrNumberLiteral */, /*strict*/ true);\n            }\n            return false;\n        }\n        function isES2015OrLaterConstructorName(n) {\n            switch (n) {\n                case \"Promise\":\n                case \"Symbol\":\n                case \"Map\":\n                case \"WeakMap\":\n                case \"Set\":\n                case \"WeakSet\":\n                    return true;\n            }\n            return false;\n        }\n        function checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) {\n            if (meaning & (111551 /* Value */ & ~1024 /* NamespaceModule */ & ~788968 /* Type */)) {\n                var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 /* NamespaceModule */ & ~111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));\n                if (symbol) {\n                    error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_value, ts.unescapeLeadingUnderscores(name));\n                    return true;\n                }\n            }\n            else if (meaning & (788968 /* Type */ & ~1024 /* NamespaceModule */ & ~111551 /* Value */)) {\n                var symbol = resolveSymbol(resolveName(errorLocation, name, (512 /* ValueModule */ | 1024 /* NamespaceModule */) & ~788968 /* Type */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));\n                if (symbol) {\n                    error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_type, ts.unescapeLeadingUnderscores(name));\n                    return true;\n                }\n            }\n            return false;\n        }\n        function checkResolvedBlockScopedVariable(result, errorLocation) {\n            ts.Debug.assert(!!(result.flags & 2 /* BlockScopedVariable */ || result.flags & 32 /* Class */ || result.flags & 384 /* Enum */));\n            if (result.flags & (16 /* Function */ | 1 /* FunctionScopedVariable */ | 67108864 /* Assignment */) && result.flags & 32 /* Class */) {\n                // constructor functions aren't block scoped\n                return;\n            }\n            // Block-scoped variables cannot be used before their definition\n            var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 255 /* EnumDeclaration */); });\n            if (declaration === undefined)\n                return ts.Debug.fail(\"checkResolvedBlockScopedVariable could not find block-scoped declaration\");\n            if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) {\n                var diagnosticMessage = void 0;\n                var declarationName = ts.declarationNameToString(ts.getNameOfDeclaration(declaration));\n                if (result.flags & 2 /* BlockScopedVariable */) {\n                    diagnosticMessage = error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, declarationName);\n                }\n                else if (result.flags & 32 /* Class */) {\n                    diagnosticMessage = error(errorLocation, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName);\n                }\n                else if (result.flags & 256 /* RegularEnum */) {\n                    diagnosticMessage = error(errorLocation, ts.Diagnostics.Enum_0_used_before_its_declaration, declarationName);\n                }\n                else {\n                    ts.Debug.assert(!!(result.flags & 128 /* ConstEnum */));\n                    if (ts.shouldPreserveConstEnums(compilerOptions)) {\n                        diagnosticMessage = error(errorLocation, ts.Diagnostics.Enum_0_used_before_its_declaration, declarationName);\n                    }\n                }\n                if (diagnosticMessage) {\n                    ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(declaration, ts.Diagnostics._0_is_declared_here, declarationName));\n                }\n            }\n        }\n        /* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached.\n         * If at any point current node is equal to 'parent' node - return true.\n         * Return false if 'stopAt' node is reached or isFunctionLike(current) === true.\n         */\n        function isSameScopeDescendentOf(initial, parent, stopAt) {\n            return !!parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? \"quit\" : n === parent; });\n        }\n        function getAnyImportSyntax(node) {\n            switch (node.kind) {\n                case 260 /* ImportEqualsDeclaration */:\n                    return node;\n                case 262 /* ImportClause */:\n                    return node.parent;\n                case 263 /* NamespaceImport */:\n                    return node.parent.parent;\n                case 265 /* ImportSpecifier */:\n                    return node.parent.parent.parent;\n                default:\n                    return undefined;\n            }\n        }\n        function getDeclarationOfAliasSymbol(symbol) {\n            return ts.find(symbol.declarations, isAliasSymbolDeclaration);\n        }\n        /**\n         * An alias symbol is created by one of the following declarations:\n         * import <symbol> = ...\n         * import <symbol> from ...\n         * import * as <symbol> from ...\n         * import { x as <symbol> } from ...\n         * export { x as <symbol> } from ...\n         * export * as ns <symbol> from ...\n         * export = <EntityNameExpression>\n         * export default <EntityNameExpression>\n         * module.exports = <EntityNameExpression>\n         * {<Identifier>}\n         * {name: <EntityNameExpression>}\n         */\n        function isAliasSymbolDeclaration(node) {\n            return node.kind === 260 /* ImportEqualsDeclaration */\n                || node.kind === 259 /* NamespaceExportDeclaration */\n                || node.kind === 262 /* ImportClause */ && !!node.name\n                || node.kind === 263 /* NamespaceImport */\n                || node.kind === 269 /* NamespaceExport */\n                || node.kind === 265 /* ImportSpecifier */\n                || node.kind === 270 /* ExportSpecifier */\n                || node.kind === 266 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node)\n                || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node)\n                || ts.isAccessExpression(node)\n                    && ts.isBinaryExpression(node.parent)\n                    && node.parent.left === node\n                    && node.parent.operatorToken.kind === 62 /* EqualsToken */\n                    && isAliasableOrJsExpression(node.parent.right)\n                || node.kind === 289 /* ShorthandPropertyAssignment */\n                || node.kind === 288 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer)\n                || ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true);\n        }\n        function isAliasableOrJsExpression(e) {\n            return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e);\n        }\n        function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) {\n            var commonJSPropertyAccess = getCommonJSPropertyAccess(node);\n            if (commonJSPropertyAccess) {\n                var name = ts.getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0];\n                return ts.isIdentifier(commonJSPropertyAccess.name)\n                    ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name), commonJSPropertyAccess.name.escapedText))\n                    : undefined;\n            }\n            if (ts.isVariableDeclaration(node) || node.moduleReference.kind === 272 /* ExternalModuleReference */) {\n                var immediate = resolveExternalModuleName(node, ts.getExternalModuleRequireArgument(node) || ts.getExternalModuleImportEqualsDeclarationExpression(node));\n                var resolved_4 = resolveExternalModuleSymbol(immediate);\n                markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false);\n                return resolved_4;\n            }\n            var resolved = getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias);\n            checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved);\n            return resolved;\n        }\n        function checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved) {\n            if (markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false) && !node.isTypeOnly) {\n                var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfNode(node));\n                var isExport = ts.typeOnlyDeclarationIsExport(typeOnlyDeclaration);\n                var message = isExport\n                    ? ts.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type\n                    : ts.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type;\n                var relatedMessage = isExport\n                    ? ts.Diagnostics._0_was_exported_here\n                    : ts.Diagnostics._0_was_imported_here;\n                // Non-null assertion is safe because the optionality comes from ImportClause,\n                // but if an ImportClause was the typeOnlyDeclaration, it had to have a `name`.\n                var name = ts.unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText);\n                ts.addRelatedInfo(error(node.moduleReference, message), ts.createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name));\n            }\n        }\n        function resolveExportByName(moduleSymbol, name, sourceNode, dontResolveAlias) {\n            var exportValue = moduleSymbol.exports.get(\"export=\" /* ExportEquals */);\n            var exportSymbol = exportValue ? getPropertyOfType(getTypeOfSymbol(exportValue), name) : moduleSymbol.exports.get(name);\n            var resolved = resolveSymbol(exportSymbol, dontResolveAlias);\n            markSymbolOfAliasDeclarationIfTypeOnly(sourceNode, exportSymbol, resolved, /*overwriteEmpty*/ false);\n            return resolved;\n        }\n        function isSyntacticDefault(node) {\n            return ((ts.isExportAssignment(node) && !node.isExportEquals) || ts.hasSyntacticModifier(node, 512 /* Default */) || ts.isExportSpecifier(node));\n        }\n        function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias) {\n            if (!allowSyntheticDefaultImports) {\n                return false;\n            }\n            // Declaration files (and ambient modules)\n            if (!file || file.isDeclarationFile) {\n                // Definitely cannot have a synthetic default if they have a syntactic default member specified\n                var defaultExportSymbol = resolveExportByName(moduleSymbol, \"default\" /* Default */, /*sourceNode*/ undefined, /*dontResolveAlias*/ true); // Dont resolve alias because we want the immediately exported symbol's declaration\n                if (defaultExportSymbol && ts.some(defaultExportSymbol.declarations, isSyntacticDefault)) {\n                    return false;\n                }\n                // It _might_ still be incorrect to assume there is no __esModule marker on the import at runtime, even if there is no `default` member\n                // So we check a bit more,\n                if (resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores(\"__esModule\"), /*sourceNode*/ undefined, dontResolveAlias)) {\n                    // If there is an `__esModule` specified in the declaration (meaning someone explicitly added it or wrote it in their code),\n                    // it definitely is a module and does not have a synthetic default\n                    return false;\n                }\n                // There are _many_ declaration files not written with esmodules in mind that still get compiled into a format with __esModule set\n                // Meaning there may be no default at runtime - however to be on the permissive side, we allow access to a synthetic default member\n                // as there is no marker to indicate if the accompanying JS has `__esModule` or not, or is even native esm\n                return true;\n            }\n            // TypeScript files never have a synthetic default (as they are always emitted with an __esModule marker) _unless_ they contain an export= statement\n            if (!ts.isSourceFileJS(file)) {\n                return hasExportAssignmentSymbol(moduleSymbol);\n            }\n            // JS files have a synthetic default if they do not contain ES2015+ module syntax (export = is not valid in js) _and_ do not have an __esModule marker\n            return !file.externalModuleIndicator && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores(\"__esModule\"), /*sourceNode*/ undefined, dontResolveAlias);\n        }\n        function getTargetOfImportClause(node, dontResolveAlias) {\n            var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);\n            if (moduleSymbol) {\n                var exportDefaultSymbol = void 0;\n                if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {\n                    exportDefaultSymbol = moduleSymbol;\n                }\n                else {\n                    exportDefaultSymbol = resolveExportByName(moduleSymbol, \"default\" /* Default */, node, dontResolveAlias);\n                }\n                var file = ts.find(moduleSymbol.declarations, ts.isSourceFile);\n                var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias);\n                if (!exportDefaultSymbol && !hasSyntheticDefault) {\n                    if (hasExportAssignmentSymbol(moduleSymbol)) {\n                        var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? \"allowSyntheticDefaultImports\" : \"esModuleInterop\";\n                        var exportEqualsSymbol = moduleSymbol.exports.get(\"export=\" /* ExportEquals */);\n                        var exportAssignment = exportEqualsSymbol.valueDeclaration;\n                        var err = error(node.name, ts.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), compilerOptionName);\n                        ts.addRelatedInfo(err, ts.createDiagnosticForNode(exportAssignment, ts.Diagnostics.This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag, compilerOptionName));\n                    }\n                    else {\n                        reportNonDefaultExport(moduleSymbol, node);\n                    }\n                }\n                else if (hasSyntheticDefault) {\n                    // per emit behavior, a synthetic default overrides a \"real\" .default member if `__esModule` is not present\n                    var resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);\n                    markSymbolOfAliasDeclarationIfTypeOnly(node, moduleSymbol, resolved, /*overwriteTypeOnly*/ false);\n                    return resolved;\n                }\n                markSymbolOfAliasDeclarationIfTypeOnly(node, exportDefaultSymbol, /*finalTarget*/ undefined, /*overwriteTypeOnly*/ false);\n                return exportDefaultSymbol;\n            }\n        }\n        function reportNonDefaultExport(moduleSymbol, node) {\n            var _a, _b;\n            if ((_a = moduleSymbol.exports) === null || _a === void 0 ? void 0 : _a.has(node.symbol.escapedName)) {\n                error(node.name, ts.Diagnostics.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead, symbolToString(moduleSymbol), symbolToString(node.symbol));\n            }\n            else {\n                var diagnostic = error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol));\n                var exportStar = (_b = moduleSymbol.exports) === null || _b === void 0 ? void 0 : _b.get(\"__export\" /* ExportStar */);\n                if (exportStar) {\n                    var defaultExport = ts.find(exportStar.declarations, function (decl) {\n                        var _a, _b;\n                        return !!(ts.isExportDeclaration(decl) && decl.moduleSpecifier &&\n                            ((_b = (_a = resolveExternalModuleName(decl, decl.moduleSpecifier)) === null || _a === void 0 ? void 0 : _a.exports) === null || _b === void 0 ? void 0 : _b.has(\"default\" /* Default */)));\n                    });\n                    if (defaultExport) {\n                        ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(defaultExport, ts.Diagnostics.export_Asterisk_does_not_re_export_a_default));\n                    }\n                }\n            }\n        }\n        function getTargetOfNamespaceImport(node, dontResolveAlias) {\n            var moduleSpecifier = node.parent.parent.moduleSpecifier;\n            var immediate = resolveExternalModuleName(node, moduleSpecifier);\n            var resolved = resolveESModuleSymbol(immediate, moduleSpecifier, dontResolveAlias, /*suppressUsageError*/ false);\n            markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved, /*overwriteEmpty*/ false);\n            return resolved;\n        }\n        function getTargetOfNamespaceExport(node, dontResolveAlias) {\n            var moduleSpecifier = node.parent.moduleSpecifier;\n            var immediate = moduleSpecifier && resolveExternalModuleName(node, moduleSpecifier);\n            var resolved = moduleSpecifier && resolveESModuleSymbol(immediate, moduleSpecifier, dontResolveAlias, /*suppressUsageError*/ false);\n            markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved, /*overwriteEmpty*/ false);\n            return resolved;\n        }\n        // This function creates a synthetic symbol that combines the value side of one symbol with the\n        // type/namespace side of another symbol. Consider this example:\n        //\n        //   declare module graphics {\n        //       interface Point {\n        //           x: number;\n        //           y: number;\n        //       }\n        //   }\n        //   declare var graphics: {\n        //       Point: new (x: number, y: number) => graphics.Point;\n        //   }\n        //   declare module \"graphics\" {\n        //       export = graphics;\n        //   }\n        //\n        // An 'import { Point } from \"graphics\"' needs to create a symbol that combines the value side 'Point'\n        // property with the type/namespace side interface 'Point'.\n        function combineValueAndTypeSymbols(valueSymbol, typeSymbol) {\n            if (valueSymbol === unknownSymbol && typeSymbol === unknownSymbol) {\n                return unknownSymbol;\n            }\n            if (valueSymbol.flags & (788968 /* Type */ | 1920 /* Namespace */)) {\n                return valueSymbol;\n            }\n            var result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.escapedName);\n            result.declarations = ts.deduplicate(ts.concatenate(valueSymbol.declarations, typeSymbol.declarations), ts.equateValues);\n            result.parent = valueSymbol.parent || typeSymbol.parent;\n            if (valueSymbol.valueDeclaration)\n                result.valueDeclaration = valueSymbol.valueDeclaration;\n            if (typeSymbol.members)\n                result.members = new ts.Map(typeSymbol.members);\n            if (valueSymbol.exports)\n                result.exports = new ts.Map(valueSymbol.exports);\n            return result;\n        }\n        function getExportOfModule(symbol, name, specifier, dontResolveAlias) {\n            if (symbol.flags & 1536 /* Module */) {\n                var exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText);\n                var resolved = resolveSymbol(exportSymbol, dontResolveAlias);\n                markSymbolOfAliasDeclarationIfTypeOnly(specifier, exportSymbol, resolved, /*overwriteEmpty*/ false);\n                return resolved;\n            }\n        }\n        function getPropertyOfVariable(symbol, name) {\n            if (symbol.flags & 3 /* Variable */) {\n                var typeAnnotation = symbol.valueDeclaration.type;\n                if (typeAnnotation) {\n                    return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name));\n                }\n            }\n        }\n        function getExternalModuleMember(node, specifier, dontResolveAlias) {\n            var _a;\n            if (dontResolveAlias === void 0) { dontResolveAlias = false; }\n            var moduleSpecifier = ts.getExternalModuleRequireArgument(node) || node.moduleSpecifier;\n            var moduleSymbol = resolveExternalModuleName(node, moduleSpecifier); // TODO: GH#18217\n            var name = !ts.isPropertyAccessExpression(specifier) && specifier.propertyName || specifier.name;\n            if (!ts.isIdentifier(name)) {\n                return undefined;\n            }\n            var suppressInteropError = name.escapedText === \"default\" /* Default */ && !!(compilerOptions.allowSyntheticDefaultImports || compilerOptions.esModuleInterop);\n            var targetSymbol = resolveESModuleSymbol(moduleSymbol, moduleSpecifier, dontResolveAlias, suppressInteropError);\n            if (targetSymbol) {\n                if (name.escapedText) {\n                    if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {\n                        return moduleSymbol;\n                    }\n                    var symbolFromVariable = void 0;\n                    // First check if module was specified with \"export=\". If so, get the member from the resolved type\n                    if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get(\"export=\" /* ExportEquals */)) {\n                        symbolFromVariable = getPropertyOfType(getTypeOfSymbol(targetSymbol), name.escapedText, /*skipObjectFunctionPropertyAugment*/ true);\n                    }\n                    else {\n                        symbolFromVariable = getPropertyOfVariable(targetSymbol, name.escapedText);\n                    }\n                    // if symbolFromVariable is export - get its final target\n                    symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias);\n                    var symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias);\n                    if (symbolFromModule === undefined && name.escapedText === \"default\" /* Default */) {\n                        var file = ts.find(moduleSymbol.declarations, ts.isSourceFile);\n                        if (canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias)) {\n                            symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);\n                        }\n                    }\n                    var symbol = symbolFromModule && symbolFromVariable && symbolFromModule !== symbolFromVariable ?\n                        combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) :\n                        symbolFromModule || symbolFromVariable;\n                    if (!symbol) {\n                        var moduleName = getFullyQualifiedName(moduleSymbol, node);\n                        var declarationName = ts.declarationNameToString(name);\n                        var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);\n                        if (suggestion !== undefined) {\n                            var suggestionName = symbolToString(suggestion);\n                            var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);\n                            if (suggestion.valueDeclaration) {\n                                ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));\n                            }\n                        }\n                        else {\n                            if ((_a = moduleSymbol.exports) === null || _a === void 0 ? void 0 : _a.has(\"default\" /* Default */)) {\n                                error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName, declarationName);\n                            }\n                            else {\n                                reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName);\n                            }\n                        }\n                    }\n                    return symbol;\n                }\n            }\n        }\n        function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {\n            var _a;\n            var localSymbol = (_a = moduleSymbol.valueDeclaration.locals) === null || _a === void 0 ? void 0 : _a.get(name.escapedText);\n            var exports = moduleSymbol.exports;\n            if (localSymbol) {\n                var exportedEqualsSymbol = exports === null || exports === void 0 ? void 0 : exports.get(\"export=\" /* ExportEquals */);\n                if (exportedEqualsSymbol) {\n                    getSymbolIfSameReference(exportedEqualsSymbol, localSymbol) ? reportInvalidImportEqualsExportMember(node, name, declarationName, moduleName) :\n                        error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, moduleName, declarationName);\n                }\n                else {\n                    var exportedSymbol = exports ? ts.find(symbolsToArray(exports), function (symbol) { return !!getSymbolIfSameReference(symbol, localSymbol); }) : undefined;\n                    var diagnostic = exportedSymbol ? error(name, ts.Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2, moduleName, declarationName, symbolToString(exportedSymbol)) :\n                        error(name, ts.Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported, moduleName, declarationName);\n                    ts.addRelatedInfo.apply(void 0, __spreadArray([diagnostic], ts.map(localSymbol.declarations, function (decl, index) {\n                        return ts.createDiagnosticForNode(decl, index === 0 ? ts.Diagnostics._0_is_declared_here : ts.Diagnostics.and_here, declarationName);\n                    })));\n                }\n            }\n            else {\n                error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, moduleName, declarationName);\n            }\n        }\n        function reportInvalidImportEqualsExportMember(node, name, declarationName, moduleName) {\n            if (moduleKind >= ts.ModuleKind.ES2015) {\n                var message = compilerOptions.esModuleInterop ? ts.Diagnostics._0_can_only_be_imported_by_using_a_default_import :\n                    ts.Diagnostics._0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;\n                error(name, message, declarationName);\n            }\n            else {\n                if (ts.isInJSFile(node)) {\n                    var message = compilerOptions.esModuleInterop ? ts.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import :\n                        ts.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;\n                    error(name, message, declarationName);\n                }\n                else {\n                    var message = compilerOptions.esModuleInterop ? ts.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import :\n                        ts.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;\n                    error(name, message, declarationName, declarationName, moduleName);\n                }\n            }\n        }\n        function getTargetOfImportSpecifier(node, dontResolveAlias) {\n            var root = ts.isBindingElement(node) ? ts.getRootDeclaration(node) : node.parent.parent.parent;\n            var commonJSPropertyAccess = getCommonJSPropertyAccess(root);\n            var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias);\n            var name = node.propertyName || node.name;\n            if (commonJSPropertyAccess && resolved && ts.isIdentifier(name)) {\n                return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText), dontResolveAlias);\n            }\n            markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false);\n            return resolved;\n        }\n        function getCommonJSPropertyAccess(node) {\n            if (ts.isVariableDeclaration(node) && node.initializer && ts.isPropertyAccessExpression(node.initializer)) {\n                return node.initializer;\n            }\n        }\n        function getTargetOfNamespaceExportDeclaration(node, dontResolveAlias) {\n            var resolved = resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias);\n            markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false);\n            return resolved;\n        }\n        function getTargetOfExportSpecifier(node, meaning, dontResolveAlias) {\n            var resolved = node.parent.parent.moduleSpecifier ?\n                getExternalModuleMember(node.parent.parent, node, dontResolveAlias) :\n                resolveEntityName(node.propertyName || node.name, meaning, /*ignoreErrors*/ false, dontResolveAlias);\n            markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false);\n            return resolved;\n        }\n        function getTargetOfExportAssignment(node, dontResolveAlias) {\n            var expression = ts.isExportAssignment(node) ? node.expression : node.right;\n            var resolved = getTargetOfAliasLikeExpression(expression, dontResolveAlias);\n            markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false);\n            return resolved;\n        }\n        function getTargetOfAliasLikeExpression(expression, dontResolveAlias) {\n            if (ts.isClassExpression(expression)) {\n                return checkExpressionCached(expression).symbol;\n            }\n            if (!ts.isEntityName(expression) && !ts.isEntityNameExpression(expression)) {\n                return undefined;\n            }\n            var aliasLike = resolveEntityName(expression, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontResolveAlias);\n            if (aliasLike) {\n                return aliasLike;\n            }\n            checkExpressionCached(expression);\n            return getNodeLinks(expression).resolvedSymbol;\n        }\n        function getTargetOfPropertyAssignment(node, dontRecursivelyResolve) {\n            var expression = node.initializer;\n            return getTargetOfAliasLikeExpression(expression, dontRecursivelyResolve);\n        }\n        function getTargetOfAccessExpression(node, dontRecursivelyResolve) {\n            if (!(ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */)) {\n                return undefined;\n            }\n            return getTargetOfAliasLikeExpression(node.parent.right, dontRecursivelyResolve);\n        }\n        function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) {\n            if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; }\n            switch (node.kind) {\n                case 260 /* ImportEqualsDeclaration */:\n                case 249 /* VariableDeclaration */:\n                    return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve);\n                case 262 /* ImportClause */:\n                    return getTargetOfImportClause(node, dontRecursivelyResolve);\n                case 263 /* NamespaceImport */:\n                    return getTargetOfNamespaceImport(node, dontRecursivelyResolve);\n                case 269 /* NamespaceExport */:\n                    return getTargetOfNamespaceExport(node, dontRecursivelyResolve);\n                case 265 /* ImportSpecifier */:\n                case 198 /* BindingElement */:\n                    return getTargetOfImportSpecifier(node, dontRecursivelyResolve);\n                case 270 /* ExportSpecifier */:\n                    return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve);\n                case 266 /* ExportAssignment */:\n                case 216 /* BinaryExpression */:\n                    return getTargetOfExportAssignment(node, dontRecursivelyResolve);\n                case 259 /* NamespaceExportDeclaration */:\n                    return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve);\n                case 289 /* ShorthandPropertyAssignment */:\n                    return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve);\n                case 288 /* PropertyAssignment */:\n                    return getTargetOfPropertyAssignment(node, dontRecursivelyResolve);\n                case 202 /* ElementAccessExpression */:\n                case 201 /* PropertyAccessExpression */:\n                    return getTargetOfAccessExpression(node, dontRecursivelyResolve);\n                default:\n                    return ts.Debug.fail();\n            }\n        }\n        /**\n         * Indicates that a symbol is an alias that does not merge with a local declaration.\n         * OR Is a JSContainer which may merge an alias with a local declaration\n         */\n        function isNonLocalAlias(symbol, excludes) {\n            if (excludes === void 0) { excludes = 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */; }\n            if (!symbol)\n                return false;\n            return (symbol.flags & (2097152 /* Alias */ | excludes)) === 2097152 /* Alias */ || !!(symbol.flags & 2097152 /* Alias */ && symbol.flags & 67108864 /* Assignment */);\n        }\n        function resolveSymbol(symbol, dontResolveAlias) {\n            return !dontResolveAlias && isNonLocalAlias(symbol) ? resolveAlias(symbol) : symbol;\n        }\n        function resolveAlias(symbol) {\n            ts.Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, \"Should only get Alias here.\");\n            var links = getSymbolLinks(symbol);\n            if (!links.target) {\n                links.target = resolvingSymbol;\n                var node = getDeclarationOfAliasSymbol(symbol);\n                if (!node)\n                    return ts.Debug.fail();\n                var target = getTargetOfAliasDeclaration(node);\n                if (links.target === resolvingSymbol) {\n                    links.target = target || unknownSymbol;\n                }\n                else {\n                    error(node, ts.Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol));\n                }\n            }\n            else if (links.target === resolvingSymbol) {\n                links.target = unknownSymbol;\n            }\n            return links.target;\n        }\n        function tryResolveAlias(symbol) {\n            var links = getSymbolLinks(symbol);\n            if (links.target !== resolvingSymbol) {\n                return resolveAlias(symbol);\n            }\n            return undefined;\n        }\n        /**\n         * Marks a symbol as type-only if its declaration is syntactically type-only.\n         * If it is not itself marked type-only, but resolves to a type-only alias\n         * somewhere in its resolution chain, save a reference to the type-only alias declaration\n         * so the alias _not_ marked type-only can be identified as _transitively_ type-only.\n         *\n         * This function is called on each alias declaration that could be type-only or resolve to\n         * another type-only alias during `resolveAlias`, so that later, when an alias is used in a\n         * JS-emitting expression, we can quickly determine if that symbol is effectively type-only\n         * and issue an error if so.\n         *\n         * @param aliasDeclaration The alias declaration not marked as type-only\n         * has already been marked as not resolving to a type-only alias. Used when recursively resolving qualified\n         * names of import aliases, e.g. `import C = a.b.C`. If namespace `a` is not found to be type-only, the\n         * import declaration will initially be marked as not resolving to a type-only symbol. But, namespace `b`\n         * must still be checked for a type-only marker, overwriting the previous negative result if found.\n         * @param immediateTarget The symbol to which the alias declaration immediately resolves\n         * @param finalTarget The symbol to which the alias declaration ultimately resolves\n         * @param overwriteEmpty Checks `resolvesToSymbol` for type-only declarations even if `aliasDeclaration`\n         */\n        function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) {\n            if (!aliasDeclaration || ts.isPropertyAccessExpression(aliasDeclaration))\n                return false;\n            // If the declaration itself is type-only, mark it and return.\n            // No need to check what it resolves to.\n            var sourceSymbol = getSymbolOfNode(aliasDeclaration);\n            if (ts.isTypeOnlyImportOrExportDeclaration(aliasDeclaration)) {\n                var links_1 = getSymbolLinks(sourceSymbol);\n                links_1.typeOnlyDeclaration = aliasDeclaration;\n                return true;\n            }\n            var links = getSymbolLinks(sourceSymbol);\n            return markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, immediateTarget, overwriteEmpty)\n                || markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, finalTarget, overwriteEmpty);\n        }\n        function markSymbolOfAliasDeclarationIfTypeOnlyWorker(aliasDeclarationLinks, target, overwriteEmpty) {\n            var _a, _b, _c;\n            if (target && (aliasDeclarationLinks.typeOnlyDeclaration === undefined || overwriteEmpty && aliasDeclarationLinks.typeOnlyDeclaration === false)) {\n                var exportSymbol = (_b = (_a = target.exports) === null || _a === void 0 ? void 0 : _a.get(\"export=\" /* ExportEquals */)) !== null && _b !== void 0 ? _b : target;\n                var typeOnly = exportSymbol.declarations && ts.find(exportSymbol.declarations, ts.isTypeOnlyImportOrExportDeclaration);\n                aliasDeclarationLinks.typeOnlyDeclaration = (_c = typeOnly !== null && typeOnly !== void 0 ? typeOnly : getSymbolLinks(exportSymbol).typeOnlyDeclaration) !== null && _c !== void 0 ? _c : false;\n            }\n            return !!aliasDeclarationLinks.typeOnlyDeclaration;\n        }\n        /** Indicates that a symbol directly or indirectly resolves to a type-only import or export. */\n        function getTypeOnlyAliasDeclaration(symbol) {\n            if (!(symbol.flags & 2097152 /* Alias */)) {\n                return undefined;\n            }\n            var links = getSymbolLinks(symbol);\n            return links.typeOnlyDeclaration || undefined;\n        }\n        function markExportAsReferenced(node) {\n            var symbol = getSymbolOfNode(node);\n            var target = resolveAlias(symbol);\n            if (target) {\n                var markAlias = target === unknownSymbol ||\n                    ((target.flags & 111551 /* Value */) && !isConstEnumOrConstEnumOnlyModule(target) && !getTypeOnlyAliasDeclaration(symbol));\n                if (markAlias) {\n                    markAliasSymbolAsReferenced(symbol);\n                }\n            }\n        }\n        // When an alias symbol is referenced, we need to mark the entity it references as referenced and in turn repeat that until\n        // we reach a non-alias or an exported entity (which is always considered referenced). We do this by checking the target of\n        // the alias as an expression (which recursively takes us back here if the target references another alias).\n        function markAliasSymbolAsReferenced(symbol) {\n            var links = getSymbolLinks(symbol);\n            if (!links.referenced) {\n                links.referenced = true;\n                var node = getDeclarationOfAliasSymbol(symbol);\n                if (!node)\n                    return ts.Debug.fail();\n                // We defer checking of the reference of an `import =` until the import itself is referenced,\n                // This way a chain of imports can be elided if ultimately the final input is only used in a type\n                // position.\n                if (ts.isInternalModuleImportEqualsDeclaration(node)) {\n                    var target = resolveSymbol(symbol);\n                    if (target === unknownSymbol || target.flags & 111551 /* Value */) {\n                        // import foo = <symbol>\n                        checkExpressionCached(node.moduleReference);\n                    }\n                }\n            }\n        }\n        // Aliases that resolve to const enums are not marked as referenced because they are not emitted,\n        // but their usage in value positions must be tracked to determine if the import can be type-only.\n        function markConstEnumAliasAsReferenced(symbol) {\n            var links = getSymbolLinks(symbol);\n            if (!links.constEnumReferenced) {\n                links.constEnumReferenced = true;\n            }\n        }\n        // This function is only for imports with entity names\n        function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, dontResolveAlias) {\n            // There are three things we might try to look for. In the following examples,\n            // the search term is enclosed in |...|:\n            //\n            //     import a = |b|; // Namespace\n            //     import a = |b.c|; // Value, type, namespace\n            //     import a = |b.c|.d; // Namespace\n            if (entityName.kind === 78 /* Identifier */ && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {\n                entityName = entityName.parent;\n            }\n            // Check for case 1 and 3 in the above example\n            if (entityName.kind === 78 /* Identifier */ || entityName.parent.kind === 157 /* QualifiedName */) {\n                return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias);\n            }\n            else {\n                // Case 2 in above example\n                // entityName.kind could be a QualifiedName or a Missing identifier\n                ts.Debug.assert(entityName.parent.kind === 260 /* ImportEqualsDeclaration */);\n                return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias);\n            }\n        }\n        function getFullyQualifiedName(symbol, containingLocation) {\n            return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + \".\" + symbolToString(symbol) : symbolToString(symbol, containingLocation, /*meaning*/ undefined, 16 /* DoNotIncludeSymbolChain */ | 4 /* AllowAnyNodeKind */);\n        }\n        /**\n         * Resolves a qualified name and any involved aliases.\n         */\n        function resolveEntityName(name, meaning, ignoreErrors, dontResolveAlias, location) {\n            if (ts.nodeIsMissing(name)) {\n                return undefined;\n            }\n            var namespaceMeaning = 1920 /* Namespace */ | (ts.isInJSFile(name) ? meaning & 111551 /* Value */ : 0);\n            var symbol;\n            if (name.kind === 78 /* Identifier */) {\n                var message = meaning === namespaceMeaning || ts.nodeIsSynthesized(name) ? ts.Diagnostics.Cannot_find_namespace_0 : getCannotFindNameDiagnosticForName(ts.getFirstIdentifier(name));\n                var symbolFromJSPrototype = ts.isInJSFile(name) && !ts.nodeIsSynthesized(name) ? resolveEntityNameFromAssignmentDeclaration(name, meaning) : undefined;\n                symbol = getMergedSymbol(resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, /*isUse*/ true));\n                if (!symbol) {\n                    return getMergedSymbol(symbolFromJSPrototype);\n                }\n            }\n            else if (name.kind === 157 /* QualifiedName */ || name.kind === 201 /* PropertyAccessExpression */) {\n                var left = name.kind === 157 /* QualifiedName */ ? name.left : name.expression;\n                var right = name.kind === 157 /* QualifiedName */ ? name.right : name.name;\n                var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location);\n                if (!namespace || ts.nodeIsMissing(right)) {\n                    return undefined;\n                }\n                else if (namespace === unknownSymbol) {\n                    return namespace;\n                }\n                if (ts.isInJSFile(name)) {\n                    if (namespace.valueDeclaration &&\n                        ts.isVariableDeclaration(namespace.valueDeclaration) &&\n                        namespace.valueDeclaration.initializer &&\n                        isCommonJsRequire(namespace.valueDeclaration.initializer)) {\n                        var moduleName = namespace.valueDeclaration.initializer.arguments[0];\n                        var moduleSym = resolveExternalModuleName(moduleName, moduleName);\n                        if (moduleSym) {\n                            var resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym);\n                            if (resolvedModuleSymbol) {\n                                namespace = resolvedModuleSymbol;\n                            }\n                        }\n                    }\n                }\n                symbol = getMergedSymbol(getSymbol(getExportsOfSymbol(namespace), right.escapedText, meaning));\n                if (!symbol) {\n                    if (!ignoreErrors) {\n                        var namespaceName = getFullyQualifiedName(namespace);\n                        var declarationName = ts.declarationNameToString(right);\n                        var suggestion = getSuggestedSymbolForNonexistentModule(right, namespace);\n                        suggestion ?\n                            error(right, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, namespaceName, declarationName, symbolToString(suggestion)) :\n                            error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName);\n                    }\n                    return undefined;\n                }\n            }\n            else {\n                throw ts.Debug.assertNever(name, \"Unknown entity name kind.\");\n            }\n            ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, \"Should never get an instantiated symbol here.\");\n            if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 266 /* ExportAssignment */)) {\n                markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true);\n            }\n            return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol);\n        }\n        /**\n         * 1. For prototype-property methods like `A.prototype.m = function () ...`, try to resolve names in the scope of `A` too.\n         * Note that prototype-property assignment to locations outside the current file (eg globals) doesn't work, so\n         * name resolution won't work either.\n         * 2. For property assignments like `{ x: function f () { } }`, try to resolve names in the scope of `f` too.\n         */\n        function resolveEntityNameFromAssignmentDeclaration(name, meaning) {\n            if (isJSDocTypeReference(name.parent)) {\n                var secondaryLocation = getAssignmentDeclarationLocation(name.parent);\n                if (secondaryLocation) {\n                    return resolveName(secondaryLocation, name.escapedText, meaning, /*nameNotFoundMessage*/ undefined, name, /*isUse*/ true);\n                }\n            }\n        }\n        function getAssignmentDeclarationLocation(node) {\n            var typeAlias = ts.findAncestor(node, function (node) { return !(ts.isJSDocNode(node) || node.flags & 4194304 /* JSDoc */) ? \"quit\" : ts.isJSDocTypeAlias(node); });\n            if (typeAlias) {\n                return;\n            }\n            var host = ts.getJSDocHost(node);\n            if (host &&\n                ts.isExpressionStatement(host) &&\n                ts.isBinaryExpression(host.expression) &&\n                ts.getAssignmentDeclarationKind(host.expression) === 3 /* PrototypeProperty */) {\n                // X.prototype.m = /** @param {K} p */ function () { } <-- look for K on X's declaration\n                var symbol = getSymbolOfNode(host.expression.left);\n                if (symbol) {\n                    return getDeclarationOfJSPrototypeContainer(symbol);\n                }\n            }\n            if (host && (ts.isObjectLiteralMethod(host) || ts.isPropertyAssignment(host)) &&\n                ts.isBinaryExpression(host.parent.parent) &&\n                ts.getAssignmentDeclarationKind(host.parent.parent) === 6 /* Prototype */) {\n                // X.prototype = { /** @param {K} p */m() { } } <-- look for K on X's declaration\n                var symbol = getSymbolOfNode(host.parent.parent.left);\n                if (symbol) {\n                    return getDeclarationOfJSPrototypeContainer(symbol);\n                }\n            }\n            var sig = ts.getEffectiveJSDocHost(node);\n            if (sig && ts.isFunctionLike(sig)) {\n                var symbol = getSymbolOfNode(sig);\n                return symbol && symbol.valueDeclaration;\n            }\n        }\n        function getDeclarationOfJSPrototypeContainer(symbol) {\n            var decl = symbol.parent.valueDeclaration;\n            if (!decl) {\n                return undefined;\n            }\n            var initializer = ts.isAssignmentDeclaration(decl) ? ts.getAssignedExpandoInitializer(decl) :\n                ts.hasOnlyExpressionInitializer(decl) ? ts.getDeclaredExpandoInitializer(decl) :\n                    undefined;\n            return initializer || decl;\n        }\n        /**\n         * Get the real symbol of a declaration with an expando initializer.\n         *\n         * Normally, declarations have an associated symbol, but when a declaration has an expando\n         * initializer, the expando's symbol is the one that has all the members merged into it.\n         */\n        function getExpandoSymbol(symbol) {\n            var decl = symbol.valueDeclaration;\n            if (!decl || !ts.isInJSFile(decl) || symbol.flags & 524288 /* TypeAlias */ || ts.getExpandoInitializer(decl, /*isPrototypeAssignment*/ false)) {\n                return undefined;\n            }\n            var init = ts.isVariableDeclaration(decl) ? ts.getDeclaredExpandoInitializer(decl) : ts.getAssignedExpandoInitializer(decl);\n            if (init) {\n                var initSymbol = getSymbolOfNode(init);\n                if (initSymbol) {\n                    return mergeJSSymbols(initSymbol, symbol);\n                }\n            }\n        }\n        function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) {\n            var isClassic = ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Classic;\n            var errorMessage = isClassic ?\n                ts.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option\n                : ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;\n            return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : errorMessage);\n        }\n        function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) {\n            if (isForAugmentation === void 0) { isForAugmentation = false; }\n            return ts.isStringLiteralLike(moduleReferenceExpression)\n                ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation)\n                : undefined;\n        }\n        function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) {\n            if (isForAugmentation === void 0) { isForAugmentation = false; }\n            if (ts.startsWith(moduleReference, \"@types/\")) {\n                var diag = ts.Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;\n                var withoutAtTypePrefix = ts.removePrefix(moduleReference, \"@types/\");\n                error(errorNode, diag, withoutAtTypePrefix, moduleReference);\n            }\n            var ambientModule = tryFindAmbientModule(moduleReference, /*withAugmentations*/ true);\n            if (ambientModule) {\n                return ambientModule;\n            }\n            var currentSourceFile = ts.getSourceFileOfNode(location);\n            var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference); // TODO: GH#18217\n            var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule);\n            var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName);\n            if (sourceFile) {\n                if (sourceFile.symbol) {\n                    if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) {\n                        errorOnImplicitAnyModule(/*isError*/ false, errorNode, resolvedModule, moduleReference);\n                    }\n                    // merged symbol is module declaration symbol combined with all augmentations\n                    return getMergedSymbol(sourceFile.symbol);\n                }\n                if (moduleNotFoundError) {\n                    // report errors only if it was requested\n                    error(errorNode, ts.Diagnostics.File_0_is_not_a_module, sourceFile.fileName);\n                }\n                return undefined;\n            }\n            if (patternAmbientModules) {\n                var pattern = ts.findBestPatternMatch(patternAmbientModules, function (_) { return _.pattern; }, moduleReference);\n                if (pattern) {\n                    // If the module reference matched a pattern ambient module ('*.foo') but there's also a\n                    // module augmentation by the specific name requested ('a.foo'), we store the merged symbol\n                    // by the augmentation name ('a.foo'), because asking for *.foo should not give you exports\n                    // from a.foo.\n                    var augmentation = patternAmbientModuleAugmentations && patternAmbientModuleAugmentations.get(moduleReference);\n                    if (augmentation) {\n                        return getMergedSymbol(augmentation);\n                    }\n                    return getMergedSymbol(pattern.symbol);\n                }\n            }\n            // May be an untyped module. If so, ignore resolutionDiagnostic.\n            if (resolvedModule && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension) && resolutionDiagnostic === undefined || resolutionDiagnostic === ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type) {\n                if (isForAugmentation) {\n                    var diag = ts.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented;\n                    error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName);\n                }\n                else {\n                    errorOnImplicitAnyModule(/*isError*/ noImplicitAny && !!moduleNotFoundError, errorNode, resolvedModule, moduleReference);\n                }\n                // Failed imports and untyped modules are both treated in an untyped manner; only difference is whether we give a diagnostic first.\n                return undefined;\n            }\n            if (moduleNotFoundError) {\n                // See if this was possibly a projectReference redirect\n                if (resolvedModule) {\n                    var redirect = host.getProjectReferenceRedirect(resolvedModule.resolvedFileName);\n                    if (redirect) {\n                        error(errorNode, ts.Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, resolvedModule.resolvedFileName);\n                        return undefined;\n                    }\n                }\n                if (resolutionDiagnostic) {\n                    error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);\n                }\n                else {\n                    var tsExtension = ts.tryExtractTSExtension(moduleReference);\n                    if (tsExtension) {\n                        var diag = ts.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead;\n                        var importSourceWithoutExtension = ts.removeExtension(moduleReference, tsExtension);\n                        var replacedImportSource = importSourceWithoutExtension;\n                        /**\n                         * Direct users to import source with .js extension if outputting an ES module.\n                         * @see https://github.com/microsoft/TypeScript/issues/42151\n                         */\n                        var moduleKind_1 = ts.getEmitModuleKind(compilerOptions);\n                        if (moduleKind_1 >= ts.ModuleKind.ES2015) {\n                            replacedImportSource += \".js\";\n                        }\n                        error(errorNode, diag, tsExtension, replacedImportSource);\n                    }\n                    else if (!compilerOptions.resolveJsonModule &&\n                        ts.fileExtensionIs(moduleReference, \".json\" /* Json */) &&\n                        ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs &&\n                        ts.hasJsonModuleEmitEnabled(compilerOptions)) {\n                        error(errorNode, ts.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);\n                    }\n                    else {\n                        error(errorNode, moduleNotFoundError, moduleReference);\n                    }\n                }\n            }\n            return undefined;\n        }\n        function errorOnImplicitAnyModule(isError, errorNode, _a, moduleReference) {\n            var packageId = _a.packageId, resolvedFileName = _a.resolvedFileName;\n            var errorInfo = !ts.isExternalModuleNameRelative(moduleReference) && packageId\n                ? typesPackageExists(packageId.name)\n                    ? ts.chainDiagnosticMessages(\n                    /*details*/ undefined, ts.Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, packageId.name, ts.mangleScopedPackageName(packageId.name))\n                    : ts.chainDiagnosticMessages(\n                    /*details*/ undefined, ts.Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference, ts.mangleScopedPackageName(packageId.name))\n                : undefined;\n            errorOrSuggestion(isError, errorNode, ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedFileName));\n        }\n        function typesPackageExists(packageName) {\n            return getPackagesSet().has(ts.getTypesPackageName(packageName));\n        }\n        function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) {\n            if (moduleSymbol === null || moduleSymbol === void 0 ? void 0 : moduleSymbol.exports) {\n                var exportEquals = resolveSymbol(moduleSymbol.exports.get(\"export=\" /* ExportEquals */), dontResolveAlias);\n                var exported = getCommonJsExportEquals(getMergedSymbol(exportEquals), getMergedSymbol(moduleSymbol));\n                return getMergedSymbol(exported) || moduleSymbol;\n            }\n            return undefined;\n        }\n        function getCommonJsExportEquals(exported, moduleSymbol) {\n            if (!exported || exported === unknownSymbol || exported === moduleSymbol || moduleSymbol.exports.size === 1 || exported.flags & 2097152 /* Alias */) {\n                return exported;\n            }\n            var links = getSymbolLinks(exported);\n            if (links.cjsExportMerged) {\n                return links.cjsExportMerged;\n            }\n            var merged = exported.flags & 33554432 /* Transient */ ? exported : cloneSymbol(exported);\n            merged.flags = merged.flags | 512 /* ValueModule */;\n            if (merged.exports === undefined) {\n                merged.exports = ts.createSymbolTable();\n            }\n            moduleSymbol.exports.forEach(function (s, name) {\n                if (name === \"export=\" /* ExportEquals */)\n                    return;\n                merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);\n            });\n            getSymbolLinks(merged).cjsExportMerged = merged;\n            return links.cjsExportMerged = merged;\n        }\n        // An external module with an 'export =' declaration may be referenced as an ES6 module provided the 'export ='\n        // references a symbol that is at least declared as a module or a variable. The target of the 'export =' may\n        // combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable).\n        function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) {\n            var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);\n            if (!dontResolveAlias && symbol) {\n                if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 297 /* SourceFile */)) {\n                    var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015\n                        ? \"allowSyntheticDefaultImports\"\n                        : \"esModuleInterop\";\n                    error(referencingLocation, ts.Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName);\n                    return symbol;\n                }\n                if (compilerOptions.esModuleInterop) {\n                    var referenceParent = referencingLocation.parent;\n                    if ((ts.isImportDeclaration(referenceParent) && ts.getNamespaceDeclarationNode(referenceParent)) ||\n                        ts.isImportCall(referenceParent)) {\n                        var type = getTypeOfSymbol(symbol);\n                        var sigs = getSignaturesOfStructuredType(type, 0 /* Call */);\n                        if (!sigs || !sigs.length) {\n                            sigs = getSignaturesOfStructuredType(type, 1 /* Construct */);\n                        }\n                        if (sigs && sigs.length) {\n                            var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol);\n                            // Create a new symbol which has the module's type less the call and construct signatures\n                            var result = createSymbol(symbol.flags, symbol.escapedName);\n                            result.declarations = symbol.declarations ? symbol.declarations.slice() : [];\n                            result.parent = symbol.parent;\n                            result.target = symbol;\n                            result.originatingImport = referenceParent;\n                            if (symbol.valueDeclaration)\n                                result.valueDeclaration = symbol.valueDeclaration;\n                            if (symbol.constEnumOnlyModule)\n                                result.constEnumOnlyModule = true;\n                            if (symbol.members)\n                                result.members = new ts.Map(symbol.members);\n                            if (symbol.exports)\n                                result.exports = new ts.Map(symbol.exports);\n                            var resolvedModuleType = resolveStructuredTypeMembers(moduleType); // Should already be resolved from the signature checks above\n                            result.type = createAnonymousType(result, resolvedModuleType.members, ts.emptyArray, ts.emptyArray, resolvedModuleType.stringIndexInfo, resolvedModuleType.numberIndexInfo);\n                            return result;\n                        }\n                    }\n                }\n            }\n            return symbol;\n        }\n        function hasExportAssignmentSymbol(moduleSymbol) {\n            return moduleSymbol.exports.get(\"export=\" /* ExportEquals */) !== undefined;\n        }\n        function getExportsOfModuleAsArray(moduleSymbol) {\n            return symbolsToArray(getExportsOfModule(moduleSymbol));\n        }\n        function getExportsAndPropertiesOfModule(moduleSymbol) {\n            var exports = getExportsOfModuleAsArray(moduleSymbol);\n            var exportEquals = resolveExternalModuleSymbol(moduleSymbol);\n            if (exportEquals !== moduleSymbol) {\n                ts.addRange(exports, getPropertiesOfType(getTypeOfSymbol(exportEquals)));\n            }\n            return exports;\n        }\n        function tryGetMemberInModuleExports(memberName, moduleSymbol) {\n            var symbolTable = getExportsOfModule(moduleSymbol);\n            if (symbolTable) {\n                return symbolTable.get(memberName);\n            }\n        }\n        function tryGetMemberInModuleExportsAndProperties(memberName, moduleSymbol) {\n            var symbol = tryGetMemberInModuleExports(memberName, moduleSymbol);\n            if (symbol) {\n                return symbol;\n            }\n            var exportEquals = resolveExternalModuleSymbol(moduleSymbol);\n            if (exportEquals === moduleSymbol) {\n                return undefined;\n            }\n            var type = getTypeOfSymbol(exportEquals);\n            return type.flags & 131068 /* Primitive */ ||\n                ts.getObjectFlags(type) & 1 /* Class */ ||\n                isArrayOrTupleLikeType(type)\n                ? undefined\n                : getPropertyOfType(type, memberName);\n        }\n        function getExportsOfSymbol(symbol) {\n            return symbol.flags & 6256 /* LateBindingContainer */ ? getResolvedMembersOrExportsOfSymbol(symbol, \"resolvedExports\" /* resolvedExports */) :\n                symbol.flags & 1536 /* Module */ ? getExportsOfModule(symbol) :\n                    symbol.exports || emptySymbols;\n        }\n        function getExportsOfModule(moduleSymbol) {\n            var links = getSymbolLinks(moduleSymbol);\n            return links.resolvedExports || (links.resolvedExports = getExportsOfModuleWorker(moduleSymbol));\n        }\n        /**\n         * Extends one symbol table with another while collecting information on name collisions for error message generation into the `lookupTable` argument\n         * Not passing `lookupTable` and `exportNode` disables this collection, and just extends the tables\n         */\n        function extendExportSymbols(target, source, lookupTable, exportNode) {\n            if (!source)\n                return;\n            source.forEach(function (sourceSymbol, id) {\n                if (id === \"default\" /* Default */)\n                    return;\n                var targetSymbol = target.get(id);\n                if (!targetSymbol) {\n                    target.set(id, sourceSymbol);\n                    if (lookupTable && exportNode) {\n                        lookupTable.set(id, {\n                            specifierText: ts.getTextOfNode(exportNode.moduleSpecifier)\n                        });\n                    }\n                }\n                else if (lookupTable && exportNode && targetSymbol && resolveSymbol(targetSymbol) !== resolveSymbol(sourceSymbol)) {\n                    var collisionTracker = lookupTable.get(id);\n                    if (!collisionTracker.exportsWithDuplicate) {\n                        collisionTracker.exportsWithDuplicate = [exportNode];\n                    }\n                    else {\n                        collisionTracker.exportsWithDuplicate.push(exportNode);\n                    }\n                }\n            });\n        }\n        function getExportsOfModuleWorker(moduleSymbol) {\n            var visitedSymbols = [];\n            // A module defined by an 'export=' consists of one export that needs to be resolved\n            moduleSymbol = resolveExternalModuleSymbol(moduleSymbol);\n            return visit(moduleSymbol) || emptySymbols;\n            // The ES6 spec permits export * declarations in a module to circularly reference the module itself. For example,\n            // module 'a' can 'export * from \"b\"' and 'b' can 'export * from \"a\"' without error.\n            function visit(symbol) {\n                if (!(symbol && symbol.exports && ts.pushIfUnique(visitedSymbols, symbol))) {\n                    return;\n                }\n                var symbols = new ts.Map(symbol.exports);\n                // All export * declarations are collected in an __export symbol by the binder\n                var exportStars = symbol.exports.get(\"__export\" /* ExportStar */);\n                if (exportStars) {\n                    var nestedSymbols = ts.createSymbolTable();\n                    var lookupTable_1 = new ts.Map();\n                    for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) {\n                        var node = _a[_i];\n                        var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier);\n                        var exportedSymbols = visit(resolvedModule);\n                        extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable_1, node);\n                    }\n                    lookupTable_1.forEach(function (_a, id) {\n                        var exportsWithDuplicate = _a.exportsWithDuplicate;\n                        // It's not an error if the file with multiple `export *`s with duplicate names exports a member with that name itself\n                        if (id === \"export=\" || !(exportsWithDuplicate && exportsWithDuplicate.length) || symbols.has(id)) {\n                            return;\n                        }\n                        for (var _i = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _i < exportsWithDuplicate_1.length; _i++) {\n                            var node = exportsWithDuplicate_1[_i];\n                            diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable_1.get(id).specifierText, ts.unescapeLeadingUnderscores(id)));\n                        }\n                    });\n                    extendExportSymbols(symbols, nestedSymbols);\n                }\n                return symbols;\n            }\n        }\n        function getMergedSymbol(symbol) {\n            var merged;\n            return symbol && symbol.mergeId && (merged = mergedSymbols[symbol.mergeId]) ? merged : symbol;\n        }\n        function getSymbolOfNode(node) {\n            return getMergedSymbol(node.symbol && getLateBoundSymbol(node.symbol));\n        }\n        function getParentOfSymbol(symbol) {\n            return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent));\n        }\n        function getAlternativeContainingModules(symbol, enclosingDeclaration) {\n            var containingFile = ts.getSourceFileOfNode(enclosingDeclaration);\n            var id = getNodeId(containingFile);\n            var links = getSymbolLinks(symbol);\n            var results;\n            if (links.extendedContainersByFile && (results = links.extendedContainersByFile.get(id))) {\n                return results;\n            }\n            if (containingFile && containingFile.imports) {\n                // Try to make an import using an import already in the enclosing file, if possible\n                for (var _i = 0, _a = containingFile.imports; _i < _a.length; _i++) {\n                    var importRef = _a[_i];\n                    if (ts.nodeIsSynthesized(importRef))\n                        continue; // Synthetic names can't be resolved by `resolveExternalModuleName` - they'll cause a debug assert if they error\n                    var resolvedModule = resolveExternalModuleName(enclosingDeclaration, importRef, /*ignoreErrors*/ true);\n                    if (!resolvedModule)\n                        continue;\n                    var ref = getAliasForSymbolInContainer(resolvedModule, symbol);\n                    if (!ref)\n                        continue;\n                    results = ts.append(results, resolvedModule);\n                }\n                if (ts.length(results)) {\n                    (links.extendedContainersByFile || (links.extendedContainersByFile = new ts.Map())).set(id, results);\n                    return results;\n                }\n            }\n            if (links.extendedContainers) {\n                return links.extendedContainers;\n            }\n            // No results from files already being imported by this file - expand search (expensive, but not location-specific, so cached)\n            var otherFiles = host.getSourceFiles();\n            for (var _b = 0, otherFiles_1 = otherFiles; _b < otherFiles_1.length; _b++) {\n                var file = otherFiles_1[_b];\n                if (!ts.isExternalModule(file))\n                    continue;\n                var sym = getSymbolOfNode(file);\n                var ref = getAliasForSymbolInContainer(sym, symbol);\n                if (!ref)\n                    continue;\n                results = ts.append(results, sym);\n            }\n            return links.extendedContainers = results || ts.emptyArray;\n        }\n        /**\n         * Attempts to find the symbol corresponding to the container a symbol is in - usually this\n         * is just its' `.parent`, but for locals, this value is `undefined`\n         */\n        function getContainersOfSymbol(symbol, enclosingDeclaration, meaning) {\n            var container = getParentOfSymbol(symbol);\n            // Type parameters end up in the `members` lists but are not externally visible\n            if (container && !(symbol.flags & 262144 /* TypeParameter */)) {\n                var additionalContainers = ts.mapDefined(container.declarations, fileSymbolIfFileSymbolExportEqualsContainer);\n                var reexportContainers = enclosingDeclaration && getAlternativeContainingModules(symbol, enclosingDeclaration);\n                var objectLiteralContainer = getVariableDeclarationOfObjectLiteral(container, meaning);\n                if (enclosingDeclaration && getAccessibleSymbolChain(container, enclosingDeclaration, 1920 /* Namespace */, /*externalOnly*/ false)) {\n                    return ts.append(ts.concatenate(ts.concatenate([container], additionalContainers), reexportContainers), objectLiteralContainer); // This order expresses a preference for the real container if it is in scope\n                }\n                var res = ts.append(ts.append(additionalContainers, container), objectLiteralContainer);\n                return ts.concatenate(res, reexportContainers);\n            }\n            var candidates = ts.mapDefined(symbol.declarations, function (d) {\n                if (!ts.isAmbientModule(d) && d.parent && hasNonGlobalAugmentationExternalModuleSymbol(d.parent)) {\n                    return getSymbolOfNode(d.parent);\n                }\n                if (ts.isClassExpression(d) && ts.isBinaryExpression(d.parent) && d.parent.operatorToken.kind === 62 /* EqualsToken */ && ts.isAccessExpression(d.parent.left) && ts.isEntityNameExpression(d.parent.left.expression)) {\n                    if (ts.isModuleExportsAccessExpression(d.parent.left) || ts.isExportsIdentifier(d.parent.left.expression)) {\n                        return getSymbolOfNode(ts.getSourceFileOfNode(d));\n                    }\n                    checkExpressionCached(d.parent.left.expression);\n                    return getNodeLinks(d.parent.left.expression).resolvedSymbol;\n                }\n            });\n            if (!ts.length(candidates)) {\n                return undefined;\n            }\n            return ts.mapDefined(candidates, function (candidate) { return getAliasForSymbolInContainer(candidate, symbol) ? candidate : undefined; });\n            function fileSymbolIfFileSymbolExportEqualsContainer(d) {\n                return container && getFileSymbolIfFileSymbolExportEqualsContainer(d, container);\n            }\n        }\n        function getVariableDeclarationOfObjectLiteral(symbol, meaning) {\n            // If we're trying to reference some object literal in, eg `var a = { x: 1 }`, the symbol for the literal, `__object`, is distinct\n            // from the symbol of the declaration it is being assigned to. Since we can use the declaration to refer to the literal, however,\n            // we'd like to make that connection here - potentially causing us to paint the declaration's visibility, and therefore the literal.\n            var firstDecl = !!ts.length(symbol.declarations) && ts.first(symbol.declarations);\n            if (meaning & 111551 /* Value */ && firstDecl && firstDecl.parent && ts.isVariableDeclaration(firstDecl.parent)) {\n                if (ts.isObjectLiteralExpression(firstDecl) && firstDecl === firstDecl.parent.initializer || ts.isTypeLiteralNode(firstDecl) && firstDecl === firstDecl.parent.type) {\n                    return getSymbolOfNode(firstDecl.parent);\n                }\n            }\n        }\n        function getFileSymbolIfFileSymbolExportEqualsContainer(d, container) {\n            var fileSymbol = getExternalModuleContainer(d);\n            var exported = fileSymbol && fileSymbol.exports && fileSymbol.exports.get(\"export=\" /* ExportEquals */);\n            return exported && getSymbolIfSameReference(exported, container) ? fileSymbol : undefined;\n        }\n        function getAliasForSymbolInContainer(container, symbol) {\n            if (container === getParentOfSymbol(symbol)) {\n                // fast path, `symbol` is either already the alias or isn't aliased\n                return symbol;\n            }\n            // Check if container is a thing with an `export=` which points directly at `symbol`, and if so, return\n            // the container itself as the alias for the symbol\n            var exportEquals = container.exports && container.exports.get(\"export=\" /* ExportEquals */);\n            if (exportEquals && getSymbolIfSameReference(exportEquals, symbol)) {\n                return container;\n            }\n            var exports = getExportsOfSymbol(container);\n            var quick = exports.get(symbol.escapedName);\n            if (quick && getSymbolIfSameReference(quick, symbol)) {\n                return quick;\n            }\n            return ts.forEachEntry(exports, function (exported) {\n                if (getSymbolIfSameReference(exported, symbol)) {\n                    return exported;\n                }\n            });\n        }\n        /**\n         * Checks if two symbols, through aliasing and/or merging, refer to the same thing\n         */\n        function getSymbolIfSameReference(s1, s2) {\n            if (getMergedSymbol(resolveSymbol(getMergedSymbol(s1))) === getMergedSymbol(resolveSymbol(getMergedSymbol(s2)))) {\n                return s1;\n            }\n        }\n        function getExportSymbolOfValueSymbolIfExported(symbol) {\n            return getMergedSymbol(symbol && (symbol.flags & 1048576 /* ExportValue */) !== 0 ? symbol.exportSymbol : symbol);\n        }\n        function symbolIsValue(symbol) {\n            return !!(symbol.flags & 111551 /* Value */ || symbol.flags & 2097152 /* Alias */ && resolveAlias(symbol).flags & 111551 /* Value */ && !getTypeOnlyAliasDeclaration(symbol));\n        }\n        function findConstructorDeclaration(node) {\n            var members = node.members;\n            for (var _i = 0, members_3 = members; _i < members_3.length; _i++) {\n                var member = members_3[_i];\n                if (member.kind === 166 /* Constructor */ && ts.nodeIsPresent(member.body)) {\n                    return member;\n                }\n            }\n        }\n        function createType(flags) {\n            var result = new Type(checker, flags);\n            typeCount++;\n            result.id = typeCount;\n            typeCatalog.push(result);\n            return result;\n        }\n        function createOriginType(flags) {\n            return new Type(checker, flags);\n        }\n        function createIntrinsicType(kind, intrinsicName, objectFlags) {\n            if (objectFlags === void 0) { objectFlags = 0; }\n            var type = createType(kind);\n            type.intrinsicName = intrinsicName;\n            type.objectFlags = objectFlags;\n            return type;\n        }\n        function createBooleanType(trueFalseTypes) {\n            var type = getUnionType(trueFalseTypes);\n            type.flags |= 16 /* Boolean */;\n            type.intrinsicName = \"boolean\";\n            return type;\n        }\n        function createObjectType(objectFlags, symbol) {\n            var type = createType(524288 /* Object */);\n            type.objectFlags = objectFlags;\n            type.symbol = symbol;\n            type.members = undefined;\n            type.properties = undefined;\n            type.callSignatures = undefined;\n            type.constructSignatures = undefined;\n            type.stringIndexInfo = undefined;\n            type.numberIndexInfo = undefined;\n            return type;\n        }\n        function createTypeofType() {\n            return getUnionType(ts.arrayFrom(typeofEQFacts.keys(), getLiteralType));\n        }\n        function createTypeParameter(symbol) {\n            var type = createType(262144 /* TypeParameter */);\n            if (symbol)\n                type.symbol = symbol;\n            return type;\n        }\n        // A reserved member name starts with two underscores, but the third character cannot be an underscore,\n        // @, or #. A third underscore indicates an escaped form of an identifier that started\n        // with at least two underscores. The @ character indicates that the name is denoted by a well known ES\n        // Symbol instance and the # character indicates that the name is a PrivateIdentifier.\n        function isReservedMemberName(name) {\n            return name.charCodeAt(0) === 95 /* _ */ &&\n                name.charCodeAt(1) === 95 /* _ */ &&\n                name.charCodeAt(2) !== 95 /* _ */ &&\n                name.charCodeAt(2) !== 64 /* at */ &&\n                name.charCodeAt(2) !== 35 /* hash */;\n        }\n        function getNamedMembers(members) {\n            var result;\n            members.forEach(function (symbol, id) {\n                if (!isReservedMemberName(id) && symbolIsValue(symbol)) {\n                    (result || (result = [])).push(symbol);\n                }\n            });\n            return result || ts.emptyArray;\n        }\n        function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {\n            var resolved = type;\n            resolved.members = members;\n            resolved.properties = ts.emptyArray;\n            resolved.callSignatures = callSignatures;\n            resolved.constructSignatures = constructSignatures;\n            resolved.stringIndexInfo = stringIndexInfo;\n            resolved.numberIndexInfo = numberIndexInfo;\n            // This can loop back to getPropertyOfType() which would crash if `callSignatures` & `constructSignatures` are not initialized.\n            if (members !== emptySymbols)\n                resolved.properties = getNamedMembers(members);\n            return resolved;\n        }\n        function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {\n            return setStructuredTypeMembers(createObjectType(16 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);\n        }\n        function getResolvedTypeWithoutAbstractConstructSignatures(type) {\n            if (type.constructSignatures.length === 0)\n                return type;\n            if (type.objectTypeWithoutAbstractConstructSignatures)\n                return type.objectTypeWithoutAbstractConstructSignatures;\n            var constructSignatures = ts.filter(type.constructSignatures, function (signature) { return !(signature.flags & 4 /* Abstract */); });\n            if (type.constructSignatures === constructSignatures)\n                return type;\n            var typeCopy = createAnonymousType(type.symbol, type.members, type.callSignatures, ts.some(constructSignatures) ? constructSignatures : ts.emptyArray, type.stringIndexInfo, type.numberIndexInfo);\n            type.objectTypeWithoutAbstractConstructSignatures = typeCopy;\n            typeCopy.objectTypeWithoutAbstractConstructSignatures = typeCopy;\n            return typeCopy;\n        }\n        function forEachSymbolTableInScope(enclosingDeclaration, callback) {\n            var result;\n            var _loop_8 = function (location) {\n                // Locals of a source file are not in scope (because they get merged into the global symbol table)\n                if (location.locals && !isGlobalSourceFile(location)) {\n                    if (result = callback(location.locals)) {\n                        return { value: result };\n                    }\n                }\n                switch (location.kind) {\n                    case 297 /* SourceFile */:\n                        if (!ts.isExternalOrCommonJsModule(location)) {\n                            break;\n                        }\n                    // falls through\n                    case 256 /* ModuleDeclaration */:\n                        var sym = getSymbolOfNode(location);\n                        // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten\n                        // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred\n                        // to one another anyway)\n                        if (result = callback((sym === null || sym === void 0 ? void 0 : sym.exports) || emptySymbols)) {\n                            return { value: result };\n                        }\n                        break;\n                    case 252 /* ClassDeclaration */:\n                    case 221 /* ClassExpression */:\n                    case 253 /* InterfaceDeclaration */:\n                        // Type parameters are bound into `members` lists so they can merge across declarations\n                        // This is troublesome, since in all other respects, they behave like locals :cries:\n                        // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol\n                        // lookup logic in terms of `resolveName` would be nice\n                        // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals\n                        // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would\n                        // trigger resolving late-bound names, which we may already be in the process of doing while we're here!\n                        var table_1;\n                        // TODO: Should this filtered table be cached in some way?\n                        (getSymbolOfNode(location).members || emptySymbols).forEach(function (memberSymbol, key) {\n                            if (memberSymbol.flags & (788968 /* Type */ & ~67108864 /* Assignment */)) {\n                                (table_1 || (table_1 = ts.createSymbolTable())).set(key, memberSymbol);\n                            }\n                        });\n                        if (table_1 && (result = callback(table_1))) {\n                            return { value: result };\n                        }\n                        break;\n                }\n            };\n            for (var location = enclosingDeclaration; location; location = location.parent) {\n                var state_2 = _loop_8(location);\n                if (typeof state_2 === \"object\")\n                    return state_2.value;\n            }\n            return callback(globals);\n        }\n        function getQualifiedLeftMeaning(rightMeaning) {\n            // If we are looking in value space, the parent meaning is value, other wise it is namespace\n            return rightMeaning === 111551 /* Value */ ? 111551 /* Value */ : 1920 /* Namespace */;\n        }\n        function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing, visitedSymbolTablesMap) {\n            if (visitedSymbolTablesMap === void 0) { visitedSymbolTablesMap = new ts.Map(); }\n            if (!(symbol && !isPropertyOrMethodDeclarationSymbol(symbol))) {\n                return undefined;\n            }\n            var id = getSymbolId(symbol);\n            var visitedSymbolTables = visitedSymbolTablesMap.get(id);\n            if (!visitedSymbolTables) {\n                visitedSymbolTablesMap.set(id, visitedSymbolTables = []);\n            }\n            return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable);\n            /**\n             * @param {ignoreQualification} boolean Set when a symbol is being looked for through the exports of another symbol (meaning we have a route to qualify it already)\n             */\n            function getAccessibleSymbolChainFromSymbolTable(symbols, ignoreQualification) {\n                if (!ts.pushIfUnique(visitedSymbolTables, symbols)) {\n                    return undefined;\n                }\n                var result = trySymbolTable(symbols, ignoreQualification);\n                visitedSymbolTables.pop();\n                return result;\n            }\n            function canQualifySymbol(symbolFromSymbolTable, meaning) {\n                // If the symbol is equivalent and doesn't need further qualification, this symbol is accessible\n                return !needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning) ||\n                    // If symbol needs qualification, make sure that parent is accessible, if it is then this symbol is accessible too\n                    !!getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing, visitedSymbolTablesMap);\n            }\n            function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol, ignoreQualification) {\n                return (symbol === (resolvedAliasSymbol || symbolFromSymbolTable) || getMergedSymbol(symbol) === getMergedSymbol(resolvedAliasSymbol || symbolFromSymbolTable)) &&\n                    // if the symbolFromSymbolTable is not external module (it could be if it was determined as ambient external module and would be in globals table)\n                    // and if symbolFromSymbolTable or alias resolution matches the symbol,\n                    // check the symbol can be qualified, it is only then this symbol is accessible\n                    !ts.some(symbolFromSymbolTable.declarations, hasNonGlobalAugmentationExternalModuleSymbol) &&\n                    (ignoreQualification || canQualifySymbol(getMergedSymbol(symbolFromSymbolTable), meaning));\n            }\n            function trySymbolTable(symbols, ignoreQualification) {\n                // If symbol is directly available by its name in the symbol table\n                if (isAccessible(symbols.get(symbol.escapedName), /*resolvedAliasSymbol*/ undefined, ignoreQualification)) {\n                    return [symbol];\n                }\n                // Check if symbol is any of the aliases in scope\n                var result = ts.forEachEntry(symbols, function (symbolFromSymbolTable) {\n                    if (symbolFromSymbolTable.flags & 2097152 /* Alias */\n                        && symbolFromSymbolTable.escapedName !== \"export=\" /* ExportEquals */\n                        && symbolFromSymbolTable.escapedName !== \"default\" /* Default */\n                        && !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration)))\n                        // If `!useOnlyExternalAliasing`, we can use any type of alias to get the name\n                        && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration))\n                        // While exports are generally considered to be in scope, export-specifier declared symbols are _not_\n                        // See similar comment in `resolveName` for details\n                        && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 270 /* ExportSpecifier */))) {\n                        var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);\n                        var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification);\n                        if (candidate) {\n                            return candidate;\n                        }\n                    }\n                    if (symbolFromSymbolTable.escapedName === symbol.escapedName && symbolFromSymbolTable.exportSymbol) {\n                        if (isAccessible(getMergedSymbol(symbolFromSymbolTable.exportSymbol), /*aliasSymbol*/ undefined, ignoreQualification)) {\n                            return [symbol];\n                        }\n                    }\n                });\n                // If there's no result and we're looking at the global symbol table, treat `globalThis` like an alias and try to lookup thru that\n                return result || (symbols === globals ? getCandidateListForSymbol(globalThisSymbol, globalThisSymbol, ignoreQualification) : undefined);\n            }\n            function getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification) {\n                if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification)) {\n                    return [symbolFromSymbolTable];\n                }\n                // Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain\n                // but only if the symbolFromSymbolTable can be qualified\n                var candidateTable = getExportsOfSymbol(resolvedImportedSymbol);\n                var accessibleSymbolsFromExports = candidateTable && getAccessibleSymbolChainFromSymbolTable(candidateTable, /*ignoreQualification*/ true);\n                if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) {\n                    return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports);\n                }\n            }\n        }\n        function needsQualification(symbol, enclosingDeclaration, meaning) {\n            var qualify = false;\n            forEachSymbolTableInScope(enclosingDeclaration, function (symbolTable) {\n                // If symbol of this name is not available in the symbol table we are ok\n                var symbolFromSymbolTable = getMergedSymbol(symbolTable.get(symbol.escapedName));\n                if (!symbolFromSymbolTable) {\n                    // Continue to the next symbol table\n                    return false;\n                }\n                // If the symbol with this name is present it should refer to the symbol\n                if (symbolFromSymbolTable === symbol) {\n                    // No need to qualify\n                    return true;\n                }\n                // Qualify if the symbol from symbol table has same meaning as expected\n                symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 270 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;\n                if (symbolFromSymbolTable.flags & meaning) {\n                    qualify = true;\n                    return true;\n                }\n                // Continue to the next symbol table\n                return false;\n            });\n            return qualify;\n        }\n        function isPropertyOrMethodDeclarationSymbol(symbol) {\n            if (symbol.declarations && symbol.declarations.length) {\n                for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                    var declaration = _a[_i];\n                    switch (declaration.kind) {\n                        case 163 /* PropertyDeclaration */:\n                        case 165 /* MethodDeclaration */:\n                        case 167 /* GetAccessor */:\n                        case 168 /* SetAccessor */:\n                            continue;\n                        default:\n                            return false;\n                    }\n                }\n                return true;\n            }\n            return false;\n        }\n        function isTypeSymbolAccessible(typeSymbol, enclosingDeclaration) {\n            var access = isSymbolAccessibleWorker(typeSymbol, enclosingDeclaration, 788968 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false, /*allowModules*/ true);\n            return access.accessibility === 0 /* Accessible */;\n        }\n        function isValueSymbolAccessible(typeSymbol, enclosingDeclaration) {\n            var access = isSymbolAccessibleWorker(typeSymbol, enclosingDeclaration, 111551 /* Value */, /*shouldComputeAliasesToMakeVisible*/ false, /*allowModules*/ true);\n            return access.accessibility === 0 /* Accessible */;\n        }\n        function isSymbolAccessibleByFlags(typeSymbol, enclosingDeclaration, flags) {\n            var access = isSymbolAccessibleWorker(typeSymbol, enclosingDeclaration, flags, /*shouldComputeAliasesToMakeVisible*/ false, /*allowModules*/ false);\n            return access.accessibility === 0 /* Accessible */;\n        }\n        function isAnySymbolAccessible(symbols, enclosingDeclaration, initialSymbol, meaning, shouldComputeAliasesToMakeVisible, allowModules) {\n            if (!ts.length(symbols))\n                return;\n            var hadAccessibleChain;\n            var earlyModuleBail = false;\n            for (var _i = 0, _a = symbols; _i < _a.length; _i++) {\n                var symbol = _a[_i];\n                // Symbol is accessible if it by itself is accessible\n                var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, /*useOnlyExternalAliasing*/ false);\n                if (accessibleSymbolChain) {\n                    hadAccessibleChain = symbol;\n                    var hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0], shouldComputeAliasesToMakeVisible);\n                    if (hasAccessibleDeclarations) {\n                        return hasAccessibleDeclarations;\n                    }\n                }\n                else if (allowModules) {\n                    if (ts.some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {\n                        if (shouldComputeAliasesToMakeVisible) {\n                            earlyModuleBail = true;\n                            // Generally speaking, we want to use the aliases that already exist to refer to a module, if present\n                            // In order to do so, we need to find those aliases in order to retain them in declaration emit; so\n                            // if we are in declaration emit, we cannot use the fast path for module visibility until we've exhausted\n                            // all other visibility options (in order to capture the possible aliases used to reference the module)\n                            continue;\n                        }\n                        // Any meaning of a module symbol is always accessible via an `import` type\n                        return {\n                            accessibility: 0 /* Accessible */\n                        };\n                    }\n                }\n                // If we haven't got the accessible symbol, it doesn't mean the symbol is actually inaccessible.\n                // It could be a qualified symbol and hence verify the path\n                // e.g.:\n                // module m {\n                //     export class c {\n                //     }\n                // }\n                // const x: typeof m.c\n                // In the above example when we start with checking if typeof m.c symbol is accessible,\n                // we are going to see if c can be accessed in scope directly.\n                // But it can't, hence the accessible is going to be undefined, but that doesn't mean m.c is inaccessible\n                // It is accessible if the parent m is accessible because then m.c can be accessed through qualification\n                var containers = getContainersOfSymbol(symbol, enclosingDeclaration, meaning);\n                var parentResult = isAnySymbolAccessible(containers, enclosingDeclaration, initialSymbol, initialSymbol === symbol ? getQualifiedLeftMeaning(meaning) : meaning, shouldComputeAliasesToMakeVisible, allowModules);\n                if (parentResult) {\n                    return parentResult;\n                }\n            }\n            if (earlyModuleBail) {\n                return {\n                    accessibility: 0 /* Accessible */\n                };\n            }\n            if (hadAccessibleChain) {\n                return {\n                    accessibility: 1 /* NotAccessible */,\n                    errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning),\n                    errorModuleName: hadAccessibleChain !== initialSymbol ? symbolToString(hadAccessibleChain, enclosingDeclaration, 1920 /* Namespace */) : undefined,\n                };\n            }\n        }\n        /**\n         * Check if the given symbol in given enclosing declaration is accessible and mark all associated alias to be visible if requested\n         *\n         * @param symbol a Symbol to check if accessible\n         * @param enclosingDeclaration a Node containing reference to the symbol\n         * @param meaning a SymbolFlags to check if such meaning of the symbol is accessible\n         * @param shouldComputeAliasToMakeVisible a boolean value to indicate whether to return aliases to be mark visible in case the symbol is accessible\n         */\n        function isSymbolAccessible(symbol, enclosingDeclaration, meaning, shouldComputeAliasesToMakeVisible) {\n            return isSymbolAccessibleWorker(symbol, enclosingDeclaration, meaning, shouldComputeAliasesToMakeVisible, /*allowModules*/ true);\n        }\n        function isSymbolAccessibleWorker(symbol, enclosingDeclaration, meaning, shouldComputeAliasesToMakeVisible, allowModules) {\n            if (symbol && enclosingDeclaration) {\n                var result = isAnySymbolAccessible([symbol], enclosingDeclaration, symbol, meaning, shouldComputeAliasesToMakeVisible, allowModules);\n                if (result) {\n                    return result;\n                }\n                // This could be a symbol that is not exported in the external module\n                // or it could be a symbol from different external module that is not aliased and hence cannot be named\n                var symbolExternalModule = ts.forEach(symbol.declarations, getExternalModuleContainer);\n                if (symbolExternalModule) {\n                    var enclosingExternalModule = getExternalModuleContainer(enclosingDeclaration);\n                    if (symbolExternalModule !== enclosingExternalModule) {\n                        // name from different external module that is not visible\n                        return {\n                            accessibility: 2 /* CannotBeNamed */,\n                            errorSymbolName: symbolToString(symbol, enclosingDeclaration, meaning),\n                            errorModuleName: symbolToString(symbolExternalModule),\n                            errorNode: ts.isInJSFile(enclosingDeclaration) ? enclosingDeclaration : undefined,\n                        };\n                    }\n                }\n                // Just a local name that is not accessible\n                return {\n                    accessibility: 1 /* NotAccessible */,\n                    errorSymbolName: symbolToString(symbol, enclosingDeclaration, meaning),\n                };\n            }\n            return { accessibility: 0 /* Accessible */ };\n        }\n        function getExternalModuleContainer(declaration) {\n            var node = ts.findAncestor(declaration, hasExternalModuleSymbol);\n            return node && getSymbolOfNode(node);\n        }\n        function hasExternalModuleSymbol(declaration) {\n            return ts.isAmbientModule(declaration) || (declaration.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration));\n        }\n        function hasNonGlobalAugmentationExternalModuleSymbol(declaration) {\n            return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration));\n        }\n        function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) {\n            var aliasesToMakeVisible;\n            if (!ts.every(ts.filter(symbol.declarations, function (d) { return d.kind !== 78 /* Identifier */; }), getIsDeclarationVisible)) {\n                return undefined;\n            }\n            return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: aliasesToMakeVisible };\n            function getIsDeclarationVisible(declaration) {\n                var _a, _b;\n                if (!isDeclarationVisible(declaration)) {\n                    // Mark the unexported alias as visible if its parent is visible\n                    // because these kind of aliases can be used to name types in declaration file\n                    var anyImportSyntax = getAnyImportSyntax(declaration);\n                    if (anyImportSyntax &&\n                        !ts.hasSyntacticModifier(anyImportSyntax, 1 /* Export */) && // import clause without export\n                        isDeclarationVisible(anyImportSyntax.parent)) {\n                        return addVisibleAlias(declaration, anyImportSyntax);\n                    }\n                    else if (ts.isVariableDeclaration(declaration) && ts.isVariableStatement(declaration.parent.parent) &&\n                        !ts.hasSyntacticModifier(declaration.parent.parent, 1 /* Export */) && // unexported variable statement\n                        isDeclarationVisible(declaration.parent.parent.parent)) {\n                        return addVisibleAlias(declaration, declaration.parent.parent);\n                    }\n                    else if (ts.isLateVisibilityPaintedStatement(declaration) // unexported top-level statement\n                        && !ts.hasSyntacticModifier(declaration, 1 /* Export */)\n                        && isDeclarationVisible(declaration.parent)) {\n                        return addVisibleAlias(declaration, declaration);\n                    }\n                    else if (symbol.flags & 2097152 /* Alias */ && ts.isBindingElement(declaration) && ts.isInJSFile(declaration) && ((_a = declaration.parent) === null || _a === void 0 ? void 0 : _a.parent) // exported import-like top-level JS require statement\n                        && ts.isVariableDeclaration(declaration.parent.parent)\n                        && ((_b = declaration.parent.parent.parent) === null || _b === void 0 ? void 0 : _b.parent) && ts.isVariableStatement(declaration.parent.parent.parent.parent)\n                        && !ts.hasSyntacticModifier(declaration.parent.parent.parent.parent, 1 /* Export */)\n                        && declaration.parent.parent.parent.parent.parent // check if the thing containing the variable statement is visible (ie, the file)\n                        && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) {\n                        return addVisibleAlias(declaration, declaration.parent.parent.parent.parent);\n                    }\n                    // Declaration is not visible\n                    return false;\n                }\n                return true;\n            }\n            function addVisibleAlias(declaration, aliasingStatement) {\n                // In function \"buildTypeDisplay\" where we decide whether to write type-alias or serialize types,\n                // we want to just check if type- alias is accessible or not but we don't care about emitting those alias at that time\n                // since we will do the emitting later in trackSymbol.\n                if (shouldComputeAliasToMakeVisible) {\n                    getNodeLinks(declaration).isVisible = true;\n                    aliasesToMakeVisible = ts.appendIfUnique(aliasesToMakeVisible, aliasingStatement);\n                }\n                return true;\n            }\n        }\n        function isEntityNameVisible(entityName, enclosingDeclaration) {\n            // get symbol of the first identifier of the entityName\n            var meaning;\n            if (entityName.parent.kind === 176 /* TypeQuery */ ||\n                ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) ||\n                entityName.parent.kind === 158 /* ComputedPropertyName */) {\n                // Typeof value\n                meaning = 111551 /* Value */ | 1048576 /* ExportValue */;\n            }\n            else if (entityName.kind === 157 /* QualifiedName */ || entityName.kind === 201 /* PropertyAccessExpression */ ||\n                entityName.parent.kind === 260 /* ImportEqualsDeclaration */) {\n                // Left identifier from type reference or TypeAlias\n                // Entity name of the import declaration\n                meaning = 1920 /* Namespace */;\n            }\n            else {\n                // Type Reference or TypeAlias entity = Identifier\n                meaning = 788968 /* Type */;\n            }\n            var firstIdentifier = ts.getFirstIdentifier(entityName);\n            var symbol = resolveName(enclosingDeclaration, firstIdentifier.escapedText, meaning, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false);\n            if (symbol && symbol.flags & 262144 /* TypeParameter */ && meaning & 788968 /* Type */) {\n                return { accessibility: 0 /* Accessible */ };\n            }\n            // Verify if the symbol is accessible\n            return (symbol && hasVisibleDeclarations(symbol, /*shouldComputeAliasToMakeVisible*/ true)) || {\n                accessibility: 1 /* NotAccessible */,\n                errorSymbolName: ts.getTextOfNode(firstIdentifier),\n                errorNode: firstIdentifier\n            };\n        }\n        function symbolToString(symbol, enclosingDeclaration, meaning, flags, writer) {\n            if (flags === void 0) { flags = 4 /* AllowAnyNodeKind */; }\n            var nodeFlags = 70221824 /* IgnoreErrors */;\n            if (flags & 2 /* UseOnlyExternalAliasing */) {\n                nodeFlags |= 128 /* UseOnlyExternalAliasing */;\n            }\n            if (flags & 1 /* WriteTypeParametersOrArguments */) {\n                nodeFlags |= 512 /* WriteTypeParametersInQualifiedName */;\n            }\n            if (flags & 8 /* UseAliasDefinedOutsideCurrentScope */) {\n                nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */;\n            }\n            if (flags & 16 /* DoNotIncludeSymbolChain */) {\n                nodeFlags |= 134217728 /* DoNotIncludeSymbolChain */;\n            }\n            var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToExpression : nodeBuilder.symbolToEntityName;\n            return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker);\n            function symbolToStringWorker(writer) {\n                var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); // TODO: GH#18217\n                // add neverAsciiEscape for GH#39027\n                var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 297 /* SourceFile */ ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true });\n                var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);\n                printer.writeNode(4 /* Unspecified */, entity, /*sourceFile*/ sourceFile, writer);\n                return writer;\n            }\n        }\n        function signatureToString(signature, enclosingDeclaration, flags, kind, writer) {\n            if (flags === void 0) { flags = 0 /* None */; }\n            return writer ? signatureToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(signatureToStringWorker);\n            function signatureToStringWorker(writer) {\n                var sigOutput;\n                if (flags & 262144 /* WriteArrowStyleSignature */) {\n                    sigOutput = kind === 1 /* Construct */ ? 175 /* ConstructorType */ : 174 /* FunctionType */;\n                }\n                else {\n                    sigOutput = kind === 1 /* Construct */ ? 170 /* ConstructSignature */ : 169 /* CallSignature */;\n                }\n                var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */);\n                var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true });\n                var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);\n                printer.writeNode(4 /* Unspecified */, sig, /*sourceFile*/ sourceFile, ts.getTrailingSemicolonDeferringWriter(writer)); // TODO: GH#18217\n                return writer;\n            }\n        }\n        function typeToString(type, enclosingDeclaration, flags, writer) {\n            if (flags === void 0) { flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; }\n            if (writer === void 0) { writer = ts.createTextWriter(\"\"); }\n            var noTruncation = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */;\n            var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0), writer);\n            if (typeNode === undefined)\n                return ts.Debug.fail(\"should always get typenode\");\n            var options = { removeComments: true };\n            var printer = ts.createPrinter(options);\n            var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);\n            printer.writeNode(4 /* Unspecified */, typeNode, /*sourceFile*/ sourceFile, writer);\n            var result = writer.getText();\n            var maxLength = noTruncation ? ts.noTruncationMaximumTruncationLength * 2 : ts.defaultMaximumTruncationLength * 2;\n            if (maxLength && result && result.length >= maxLength) {\n                return result.substr(0, maxLength - \"...\".length) + \"...\";\n            }\n            return result;\n        }\n        function getTypeNamesForErrorDisplay(left, right) {\n            var leftStr = symbolValueDeclarationIsContextSensitive(left.symbol) ? typeToString(left, left.symbol.valueDeclaration) : typeToString(left);\n            var rightStr = symbolValueDeclarationIsContextSensitive(right.symbol) ? typeToString(right, right.symbol.valueDeclaration) : typeToString(right);\n            if (leftStr === rightStr) {\n                leftStr = getTypeNameForErrorDisplay(left);\n                rightStr = getTypeNameForErrorDisplay(right);\n            }\n            return [leftStr, rightStr];\n        }\n        function getTypeNameForErrorDisplay(type) {\n            return typeToString(type, /*enclosingDeclaration*/ undefined, 64 /* UseFullyQualifiedType */);\n        }\n        function symbolValueDeclarationIsContextSensitive(symbol) {\n            return symbol && symbol.valueDeclaration && ts.isExpression(symbol.valueDeclaration) && !isContextSensitive(symbol.valueDeclaration);\n        }\n        function toNodeBuilderFlags(flags) {\n            if (flags === void 0) { flags = 0 /* None */; }\n            return flags & 814775659 /* NodeBuilderFlagsMask */;\n        }\n        function isClassInstanceSide(type) {\n            return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(ts.getObjectFlags(type) & 1073741824 /* IsClassInstanceClone */));\n        }\n        function createNodeBuilder() {\n            return {\n                typeToTypeNode: function (type, enclosingDeclaration, flags, tracker) {\n                    return withContext(enclosingDeclaration, flags, tracker, function (context) { return typeToTypeNodeHelper(type, context); });\n                },\n                indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags, tracker) {\n                    return withContext(enclosingDeclaration, flags, tracker, function (context) { return indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context, /*typeNode*/ undefined); });\n                },\n                signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags, tracker) {\n                    return withContext(enclosingDeclaration, flags, tracker, function (context) { return signatureToSignatureDeclarationHelper(signature, kind, context); });\n                },\n                symbolToEntityName: function (symbol, meaning, enclosingDeclaration, flags, tracker) {\n                    return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolToName(symbol, context, meaning, /*expectsIdentifier*/ false); });\n                },\n                symbolToExpression: function (symbol, meaning, enclosingDeclaration, flags, tracker) {\n                    return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolToExpression(symbol, context, meaning); });\n                },\n                symbolToTypeParameterDeclarations: function (symbol, enclosingDeclaration, flags, tracker) {\n                    return withContext(enclosingDeclaration, flags, tracker, function (context) { return typeParametersToTypeParameterDeclarations(symbol, context); });\n                },\n                symbolToParameterDeclaration: function (symbol, enclosingDeclaration, flags, tracker) {\n                    return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolToParameterDeclaration(symbol, context); });\n                },\n                typeParameterToDeclaration: function (parameter, enclosingDeclaration, flags, tracker) {\n                    return withContext(enclosingDeclaration, flags, tracker, function (context) { return typeParameterToDeclaration(parameter, context); });\n                },\n                symbolTableToDeclarationStatements: function (symbolTable, enclosingDeclaration, flags, tracker, bundled) {\n                    return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolTableToDeclarationStatements(symbolTable, context, bundled); });\n                },\n            };\n            function withContext(enclosingDeclaration, flags, tracker, cb) {\n                var _a, _b;\n                ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0);\n                var context = {\n                    enclosingDeclaration: enclosingDeclaration,\n                    flags: flags || 0 /* None */,\n                    // If no full tracker is provided, fake up a dummy one with a basic limited-functionality moduleResolverHost\n                    tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop, moduleResolverHost: flags & 134217728 /* DoNotIncludeSymbolChain */ ? {\n                            getCommonSourceDirectory: !!host.getCommonSourceDirectory ? function () { return host.getCommonSourceDirectory(); } : function () { return \"\"; },\n                            getSourceFiles: function () { return host.getSourceFiles(); },\n                            getCurrentDirectory: function () { return host.getCurrentDirectory(); },\n                            getSymlinkCache: ts.maybeBind(host, host.getSymlinkCache),\n                            useCaseSensitiveFileNames: ts.maybeBind(host, host.useCaseSensitiveFileNames),\n                            redirectTargetsMap: host.redirectTargetsMap,\n                            getProjectReferenceRedirect: function (fileName) { return host.getProjectReferenceRedirect(fileName); },\n                            isSourceOfProjectReferenceRedirect: function (fileName) { return host.isSourceOfProjectReferenceRedirect(fileName); },\n                            fileExists: function (fileName) { return host.fileExists(fileName); },\n                            getFileIncludeReasons: function () { return host.getFileIncludeReasons(); },\n                        } : undefined },\n                    encounteredError: false,\n                    visitedTypes: undefined,\n                    symbolDepth: undefined,\n                    inferTypeParameters: undefined,\n                    approximateLength: 0\n                };\n                var resultingNode = cb(context);\n                if (context.truncating && context.flags & 1 /* NoTruncation */) {\n                    (_b = (_a = context.tracker) === null || _a === void 0 ? void 0 : _a.reportTruncationError) === null || _b === void 0 ? void 0 : _b.call(_a);\n                }\n                return context.encounteredError ? undefined : resultingNode;\n            }\n            function checkTruncationLength(context) {\n                if (context.truncating)\n                    return context.truncating;\n                return context.truncating = context.approximateLength > ((context.flags & 1 /* NoTruncation */) ? ts.noTruncationMaximumTruncationLength : ts.defaultMaximumTruncationLength);\n            }\n            function typeToTypeNodeHelper(type, context) {\n                if (cancellationToken && cancellationToken.throwIfCancellationRequested) {\n                    cancellationToken.throwIfCancellationRequested();\n                }\n                var inTypeAlias = context.flags & 8388608 /* InTypeAlias */;\n                context.flags &= ~8388608 /* InTypeAlias */;\n                if (!type) {\n                    if (!(context.flags & 262144 /* AllowEmptyUnionOrIntersection */)) {\n                        context.encounteredError = true;\n                        return undefined; // TODO: GH#18217\n                    }\n                    context.approximateLength += 3;\n                    return ts.factory.createKeywordTypeNode(128 /* AnyKeyword */);\n                }\n                if (!(context.flags & 536870912 /* NoTypeReduction */)) {\n                    type = getReducedType(type);\n                }\n                if (type.flags & 1 /* Any */) {\n                    context.approximateLength += 3;\n                    return ts.factory.createKeywordTypeNode(type === intrinsicMarkerType ? 136 /* IntrinsicKeyword */ : 128 /* AnyKeyword */);\n                }\n                if (type.flags & 2 /* Unknown */) {\n                    return ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */);\n                }\n                if (type.flags & 4 /* String */) {\n                    context.approximateLength += 6;\n                    return ts.factory.createKeywordTypeNode(147 /* StringKeyword */);\n                }\n                if (type.flags & 8 /* Number */) {\n                    context.approximateLength += 6;\n                    return ts.factory.createKeywordTypeNode(144 /* NumberKeyword */);\n                }\n                if (type.flags & 64 /* BigInt */) {\n                    context.approximateLength += 6;\n                    return ts.factory.createKeywordTypeNode(155 /* BigIntKeyword */);\n                }\n                if (type.flags & 16 /* Boolean */) {\n                    context.approximateLength += 7;\n                    return ts.factory.createKeywordTypeNode(131 /* BooleanKeyword */);\n                }\n                if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) {\n                    var parentSymbol = getParentOfSymbol(type.symbol);\n                    var parentName = symbolToTypeNode(parentSymbol, context, 788968 /* Type */);\n                    if (getDeclaredTypeOfSymbol(parentSymbol) === type) {\n                        return parentName;\n                    }\n                    var memberName = ts.symbolName(type.symbol);\n                    if (ts.isIdentifierText(memberName, 0 /* ES3 */)) {\n                        return appendReferenceToType(parentName, ts.factory.createTypeReferenceNode(memberName, /*typeArguments*/ undefined));\n                    }\n                    if (ts.isImportTypeNode(parentName)) {\n                        parentName.isTypeOf = true; // mutably update, node is freshly manufactured anyhow\n                        return ts.factory.createIndexedAccessTypeNode(parentName, ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(memberName)));\n                    }\n                    else if (ts.isTypeReferenceNode(parentName)) {\n                        return ts.factory.createIndexedAccessTypeNode(ts.factory.createTypeQueryNode(parentName.typeName), ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(memberName)));\n                    }\n                    else {\n                        return ts.Debug.fail(\"Unhandled type node kind returned from `symbolToTypeNode`.\");\n                    }\n                }\n                if (type.flags & 1056 /* EnumLike */) {\n                    return symbolToTypeNode(type.symbol, context, 788968 /* Type */);\n                }\n                if (type.flags & 128 /* StringLiteral */) {\n                    context.approximateLength += (type.value.length + 2);\n                    return ts.factory.createLiteralTypeNode(ts.setEmitFlags(ts.factory.createStringLiteral(type.value, !!(context.flags & 268435456 /* UseSingleQuotesForStringLiteralType */)), 16777216 /* NoAsciiEscaping */));\n                }\n                if (type.flags & 256 /* NumberLiteral */) {\n                    var value = type.value;\n                    context.approximateLength += (\"\" + value).length;\n                    return ts.factory.createLiteralTypeNode(value < 0 ? ts.factory.createPrefixUnaryExpression(40 /* MinusToken */, ts.factory.createNumericLiteral(-value)) : ts.factory.createNumericLiteral(value));\n                }\n                if (type.flags & 2048 /* BigIntLiteral */) {\n                    context.approximateLength += (ts.pseudoBigIntToString(type.value).length) + 1;\n                    return ts.factory.createLiteralTypeNode((ts.factory.createBigIntLiteral(type.value)));\n                }\n                if (type.flags & 512 /* BooleanLiteral */) {\n                    context.approximateLength += type.intrinsicName.length;\n                    return ts.factory.createLiteralTypeNode(type.intrinsicName === \"true\" ? ts.factory.createTrue() : ts.factory.createFalse());\n                }\n                if (type.flags & 8192 /* UniqueESSymbol */) {\n                    if (!(context.flags & 1048576 /* AllowUniqueESSymbolType */)) {\n                        if (isValueSymbolAccessible(type.symbol, context.enclosingDeclaration)) {\n                            context.approximateLength += 6;\n                            return symbolToTypeNode(type.symbol, context, 111551 /* Value */);\n                        }\n                        if (context.tracker.reportInaccessibleUniqueSymbolError) {\n                            context.tracker.reportInaccessibleUniqueSymbolError();\n                        }\n                    }\n                    context.approximateLength += 13;\n                    return ts.factory.createTypeOperatorNode(151 /* UniqueKeyword */, ts.factory.createKeywordTypeNode(148 /* SymbolKeyword */));\n                }\n                if (type.flags & 16384 /* Void */) {\n                    context.approximateLength += 4;\n                    return ts.factory.createKeywordTypeNode(113 /* VoidKeyword */);\n                }\n                if (type.flags & 32768 /* Undefined */) {\n                    context.approximateLength += 9;\n                    return ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */);\n                }\n                if (type.flags & 65536 /* Null */) {\n                    context.approximateLength += 4;\n                    return ts.factory.createLiteralTypeNode(ts.factory.createNull());\n                }\n                if (type.flags & 131072 /* Never */) {\n                    context.approximateLength += 5;\n                    return ts.factory.createKeywordTypeNode(141 /* NeverKeyword */);\n                }\n                if (type.flags & 4096 /* ESSymbol */) {\n                    context.approximateLength += 6;\n                    return ts.factory.createKeywordTypeNode(148 /* SymbolKeyword */);\n                }\n                if (type.flags & 67108864 /* NonPrimitive */) {\n                    context.approximateLength += 6;\n                    return ts.factory.createKeywordTypeNode(145 /* ObjectKeyword */);\n                }\n                if (isThisTypeParameter(type)) {\n                    if (context.flags & 4194304 /* InObjectTypeLiteral */) {\n                        if (!context.encounteredError && !(context.flags & 32768 /* AllowThisInObjectLiteral */)) {\n                            context.encounteredError = true;\n                        }\n                        if (context.tracker.reportInaccessibleThisError) {\n                            context.tracker.reportInaccessibleThisError();\n                        }\n                    }\n                    context.approximateLength += 4;\n                    return ts.factory.createThisTypeNode();\n                }\n                if (!inTypeAlias && type.aliasSymbol && (context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */ || isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration))) {\n                    var typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context);\n                    if (isReservedMemberName(type.aliasSymbol.escapedName) && !(type.aliasSymbol.flags & 32 /* Class */))\n                        return ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(\"\"), typeArgumentNodes);\n                    return symbolToTypeNode(type.aliasSymbol, context, 788968 /* Type */, typeArgumentNodes);\n                }\n                var objectFlags = ts.getObjectFlags(type);\n                if (objectFlags & 4 /* Reference */) {\n                    ts.Debug.assert(!!(type.flags & 524288 /* Object */));\n                    return type.node ? visitAndTransformType(type, typeReferenceToTypeNode) : typeReferenceToTypeNode(type);\n                }\n                if (type.flags & 262144 /* TypeParameter */ || objectFlags & 3 /* ClassOrInterface */) {\n                    if (type.flags & 262144 /* TypeParameter */ && ts.contains(context.inferTypeParameters, type)) {\n                        context.approximateLength += (ts.symbolName(type.symbol).length + 6);\n                        return ts.factory.createInferTypeNode(typeParameterToDeclarationWithConstraint(type, context, /*constraintNode*/ undefined));\n                    }\n                    if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ &&\n                        type.flags & 262144 /* TypeParameter */ &&\n                        !isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration)) {\n                        var name = typeParameterToName(type, context);\n                        context.approximateLength += ts.idText(name).length;\n                        return ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(ts.idText(name)), /*typeArguments*/ undefined);\n                    }\n                    // Ignore constraint/default when creating a usage (as opposed to declaration) of a type parameter.\n                    return type.symbol\n                        ? symbolToTypeNode(type.symbol, context, 788968 /* Type */)\n                        : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(\"?\"), /*typeArguments*/ undefined);\n                }\n                if (type.flags & 1048576 /* Union */ && type.origin) {\n                    type = type.origin;\n                }\n                if (type.flags & (1048576 /* Union */ | 2097152 /* Intersection */)) {\n                    var types = type.flags & 1048576 /* Union */ ? formatUnionTypes(type.types) : type.types;\n                    if (ts.length(types) === 1) {\n                        return typeToTypeNodeHelper(types[0], context);\n                    }\n                    var typeNodes = mapToTypeNodes(types, context, /*isBareList*/ true);\n                    if (typeNodes && typeNodes.length > 0) {\n                        return type.flags & 1048576 /* Union */ ? ts.factory.createUnionTypeNode(typeNodes) : ts.factory.createIntersectionTypeNode(typeNodes);\n                    }\n                    else {\n                        if (!context.encounteredError && !(context.flags & 262144 /* AllowEmptyUnionOrIntersection */)) {\n                            context.encounteredError = true;\n                        }\n                        return undefined; // TODO: GH#18217\n                    }\n                }\n                if (objectFlags & (16 /* Anonymous */ | 32 /* Mapped */)) {\n                    ts.Debug.assert(!!(type.flags & 524288 /* Object */));\n                    // The type is an object literal type.\n                    return createAnonymousTypeNode(type);\n                }\n                if (type.flags & 4194304 /* Index */) {\n                    var indexedType = type.type;\n                    context.approximateLength += 6;\n                    var indexTypeNode = typeToTypeNodeHelper(indexedType, context);\n                    return ts.factory.createTypeOperatorNode(138 /* KeyOfKeyword */, indexTypeNode);\n                }\n                if (type.flags & 134217728 /* TemplateLiteral */) {\n                    var texts_1 = type.texts;\n                    var types_1 = type.types;\n                    var templateHead = ts.factory.createTemplateHead(texts_1[0]);\n                    var templateSpans = ts.factory.createNodeArray(ts.map(types_1, function (t, i) { return ts.factory.createTemplateLiteralTypeSpan(typeToTypeNodeHelper(t, context), (i < types_1.length - 1 ? ts.factory.createTemplateMiddle : ts.factory.createTemplateTail)(texts_1[i + 1])); }));\n                    context.approximateLength += 2;\n                    return ts.factory.createTemplateLiteralType(templateHead, templateSpans);\n                }\n                if (type.flags & 268435456 /* StringMapping */) {\n                    var typeNode = typeToTypeNodeHelper(type.type, context);\n                    return symbolToTypeNode(type.symbol, context, 788968 /* Type */, [typeNode]);\n                }\n                if (type.flags & 8388608 /* IndexedAccess */) {\n                    var objectTypeNode = typeToTypeNodeHelper(type.objectType, context);\n                    var indexTypeNode = typeToTypeNodeHelper(type.indexType, context);\n                    context.approximateLength += 2;\n                    return ts.factory.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode);\n                }\n                if (type.flags & 16777216 /* Conditional */) {\n                    var checkTypeNode = typeToTypeNodeHelper(type.checkType, context);\n                    var saveInferTypeParameters = context.inferTypeParameters;\n                    context.inferTypeParameters = type.root.inferTypeParameters;\n                    var extendsTypeNode = typeToTypeNodeHelper(type.extendsType, context);\n                    context.inferTypeParameters = saveInferTypeParameters;\n                    var trueTypeNode = typeToTypeNodeOrCircularityElision(getTrueTypeFromConditionalType(type));\n                    var falseTypeNode = typeToTypeNodeOrCircularityElision(getFalseTypeFromConditionalType(type));\n                    context.approximateLength += 15;\n                    return ts.factory.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode);\n                }\n                if (type.flags & 33554432 /* Substitution */) {\n                    return typeToTypeNodeHelper(type.baseType, context);\n                }\n                return ts.Debug.fail(\"Should be unreachable.\");\n                function typeToTypeNodeOrCircularityElision(type) {\n                    var _a, _b, _c;\n                    if (type.flags & 1048576 /* Union */) {\n                        if ((_a = context.visitedTypes) === null || _a === void 0 ? void 0 : _a.has(getTypeId(type))) {\n                            if (!(context.flags & 131072 /* AllowAnonymousIdentifier */)) {\n                                context.encounteredError = true;\n                                (_c = (_b = context.tracker) === null || _b === void 0 ? void 0 : _b.reportCyclicStructureError) === null || _c === void 0 ? void 0 : _c.call(_b);\n                            }\n                            return createElidedInformationPlaceholder(context);\n                        }\n                        return visitAndTransformType(type, function (type) { return typeToTypeNodeHelper(type, context); });\n                    }\n                    return typeToTypeNodeHelper(type, context);\n                }\n                function createMappedTypeNodeFromType(type) {\n                    ts.Debug.assert(!!(type.flags & 524288 /* Object */));\n                    var readonlyToken = type.declaration.readonlyToken ? ts.factory.createToken(type.declaration.readonlyToken.kind) : undefined;\n                    var questionToken = type.declaration.questionToken ? ts.factory.createToken(type.declaration.questionToken.kind) : undefined;\n                    var appropriateConstraintTypeNode;\n                    if (isMappedTypeWithKeyofConstraintDeclaration(type)) {\n                        // We have a { [P in keyof T]: X }\n                        // We do this to ensure we retain the toplevel keyof-ness of the type which may be lost due to keyof distribution during `getConstraintTypeFromMappedType`\n                        appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(138 /* KeyOfKeyword */, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context));\n                    }\n                    else {\n                        appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type), context);\n                    }\n                    var typeParameterNode = typeParameterToDeclarationWithConstraint(getTypeParameterFromMappedType(type), context, appropriateConstraintTypeNode);\n                    var nameTypeNode = type.declaration.nameType ? typeToTypeNodeHelper(getNameTypeFromMappedType(type), context) : undefined;\n                    var templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context);\n                    var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, nameTypeNode, questionToken, templateTypeNode);\n                    context.approximateLength += 10;\n                    return ts.setEmitFlags(mappedTypeNode, 1 /* SingleLine */);\n                }\n                function createAnonymousTypeNode(type) {\n                    var _a;\n                    var typeId = type.id;\n                    var symbol = type.symbol;\n                    if (symbol) {\n                        var isInstanceType = isClassInstanceSide(type) ? 788968 /* Type */ : 111551 /* Value */;\n                        if (isJSConstructor(symbol.valueDeclaration)) {\n                            // Instance and static types share the same symbol; only add 'typeof' for the static side.\n                            return symbolToTypeNode(symbol, context, isInstanceType);\n                        }\n                        // Always use 'typeof T' for type of class, enum, and module objects\n                        else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 221 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) ||\n                            symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) ||\n                            shouldWriteTypeOfFunctionSymbol()) {\n                            return symbolToTypeNode(symbol, context, isInstanceType);\n                        }\n                        else if ((_a = context.visitedTypes) === null || _a === void 0 ? void 0 : _a.has(typeId)) {\n                            // If type is an anonymous type literal in a type alias declaration, use type alias name\n                            var typeAlias = getTypeAliasForTypeLiteral(type);\n                            if (typeAlias) {\n                                // The specified symbol flags need to be reinterpreted as type flags\n                                return symbolToTypeNode(typeAlias, context, 788968 /* Type */);\n                            }\n                            else {\n                                return createElidedInformationPlaceholder(context);\n                            }\n                        }\n                        else {\n                            return visitAndTransformType(type, createTypeNodeFromObjectType);\n                        }\n                    }\n                    else {\n                        // Anonymous types without a symbol are never circular.\n                        return createTypeNodeFromObjectType(type);\n                    }\n                    function shouldWriteTypeOfFunctionSymbol() {\n                        var _a;\n                        var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method\n                            ts.some(symbol.declarations, function (declaration) { return ts.hasSyntacticModifier(declaration, 32 /* Static */); });\n                        var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) &&\n                            (symbol.parent || // is exported function symbol\n                                ts.forEach(symbol.declarations, function (declaration) {\n                                    return declaration.parent.kind === 297 /* SourceFile */ || declaration.parent.kind === 257 /* ModuleBlock */;\n                                }));\n                        if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {\n                            // typeof is allowed only for static/non local functions\n                            return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a = context.visitedTypes) === null || _a === void 0 ? void 0 : _a.has(typeId))) && // it is type of the symbol uses itself recursively\n                                (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration)); // And the build is going to succeed without visibility error or there is no structural fallback allowed\n                        }\n                    }\n                }\n                function visitAndTransformType(type, transform) {\n                    var typeId = type.id;\n                    var isConstructorObject = ts.getObjectFlags(type) & 16 /* Anonymous */ && type.symbol && type.symbol.flags & 32 /* Class */;\n                    var id = ts.getObjectFlags(type) & 4 /* Reference */ && type.node ? \"N\" + getNodeId(type.node) :\n                        type.symbol ? (isConstructorObject ? \"+\" : \"\") + getSymbolId(type.symbol) :\n                            undefined;\n                    // Since instantiations of the same anonymous type have the same symbol, tracking symbols instead\n                    // of types allows us to catch circular references to instantiations of the same anonymous type\n                    if (!context.visitedTypes) {\n                        context.visitedTypes = new ts.Set();\n                    }\n                    if (id && !context.symbolDepth) {\n                        context.symbolDepth = new ts.Map();\n                    }\n                    var depth;\n                    if (id) {\n                        depth = context.symbolDepth.get(id) || 0;\n                        if (depth > 10) {\n                            return createElidedInformationPlaceholder(context);\n                        }\n                        context.symbolDepth.set(id, depth + 1);\n                    }\n                    context.visitedTypes.add(typeId);\n                    var result = transform(type);\n                    context.visitedTypes.delete(typeId);\n                    if (id) {\n                        context.symbolDepth.set(id, depth);\n                    }\n                    return result;\n                }\n                function createTypeNodeFromObjectType(type) {\n                    if (isGenericMappedType(type) || type.containsError) {\n                        return createMappedTypeNodeFromType(type);\n                    }\n                    var resolved = resolveStructuredTypeMembers(type);\n                    if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) {\n                        if (!resolved.callSignatures.length && !resolved.constructSignatures.length) {\n                            context.approximateLength += 2;\n                            return ts.setEmitFlags(ts.factory.createTypeLiteralNode(/*members*/ undefined), 1 /* SingleLine */);\n                        }\n                        if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) {\n                            var signature = resolved.callSignatures[0];\n                            var signatureNode = signatureToSignatureDeclarationHelper(signature, 174 /* FunctionType */, context);\n                            return signatureNode;\n                        }\n                        if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) {\n                            var signature = resolved.constructSignatures[0];\n                            var signatureNode = signatureToSignatureDeclarationHelper(signature, 175 /* ConstructorType */, context);\n                            return signatureNode;\n                        }\n                    }\n                    var abstractSignatures = ts.filter(resolved.constructSignatures, function (signature) { return !!(signature.flags & 4 /* Abstract */); });\n                    if (ts.some(abstractSignatures)) {\n                        var types = ts.map(abstractSignatures, getOrCreateTypeFromSignature);\n                        // count the number of type elements excluding abstract constructors\n                        var typeElementCount = resolved.callSignatures.length +\n                            (resolved.constructSignatures.length - abstractSignatures.length) +\n                            (resolved.stringIndexInfo ? 1 : 0) +\n                            (resolved.numberIndexInfo ? 1 : 0) +\n                            // exclude `prototype` when writing a class expression as a type literal, as per\n                            // the logic in `createTypeNodesFromResolvedType`.\n                            (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ?\n                                ts.countWhere(resolved.properties, function (p) { return !(p.flags & 4194304 /* Prototype */); }) :\n                                ts.length(resolved.properties));\n                        // don't include an empty object literal if there were no other static-side\n                        // properties to write, i.e. `abstract class C { }` becomes `abstract new () => {}`\n                        // and not `(abstract new () => {}) & {}`\n                        if (typeElementCount) {\n                            // create a copy of the object type without any abstract construct signatures.\n                            types.push(getResolvedTypeWithoutAbstractConstructSignatures(resolved));\n                        }\n                        return typeToTypeNodeHelper(getIntersectionType(types), context);\n                    }\n                    var savedFlags = context.flags;\n                    context.flags |= 4194304 /* InObjectTypeLiteral */;\n                    var members = createTypeNodesFromResolvedType(resolved);\n                    context.flags = savedFlags;\n                    var typeLiteralNode = ts.factory.createTypeLiteralNode(members);\n                    context.approximateLength += 2;\n                    ts.setEmitFlags(typeLiteralNode, (context.flags & 1024 /* MultilineObjectLiterals */) ? 0 : 1 /* SingleLine */);\n                    return typeLiteralNode;\n                }\n                function typeReferenceToTypeNode(type) {\n                    var typeArguments = getTypeArguments(type);\n                    if (type.target === globalArrayType || type.target === globalReadonlyArrayType) {\n                        if (context.flags & 2 /* WriteArrayAsGenericType */) {\n                            var typeArgumentNode = typeToTypeNodeHelper(typeArguments[0], context);\n                            return ts.factory.createTypeReferenceNode(type.target === globalArrayType ? \"Array\" : \"ReadonlyArray\", [typeArgumentNode]);\n                        }\n                        var elementType = typeToTypeNodeHelper(typeArguments[0], context);\n                        var arrayType = ts.factory.createArrayTypeNode(elementType);\n                        return type.target === globalArrayType ? arrayType : ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, arrayType);\n                    }\n                    else if (type.target.objectFlags & 8 /* Tuple */) {\n                        if (typeArguments.length > 0) {\n                            var arity = getTypeReferenceArity(type);\n                            var tupleConstituentNodes = mapToTypeNodes(typeArguments.slice(0, arity), context);\n                            if (tupleConstituentNodes) {\n                                if (type.target.labeledElementDeclarations) {\n                                    for (var i = 0; i < tupleConstituentNodes.length; i++) {\n                                        var flags = type.target.elementFlags[i];\n                                        tupleConstituentNodes[i] = ts.factory.createNamedTupleMember(flags & 12 /* Variable */ ? ts.factory.createToken(25 /* DotDotDotToken */) : undefined, ts.factory.createIdentifier(ts.unescapeLeadingUnderscores(getTupleElementLabel(type.target.labeledElementDeclarations[i]))), flags & 2 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined, flags & 4 /* Rest */ ? ts.factory.createArrayTypeNode(tupleConstituentNodes[i]) :\n                                            tupleConstituentNodes[i]);\n                                    }\n                                }\n                                else {\n                                    for (var i = 0; i < Math.min(arity, tupleConstituentNodes.length); i++) {\n                                        var flags = type.target.elementFlags[i];\n                                        tupleConstituentNodes[i] =\n                                            flags & 12 /* Variable */ ? ts.factory.createRestTypeNode(flags & 4 /* Rest */ ? ts.factory.createArrayTypeNode(tupleConstituentNodes[i]) : tupleConstituentNodes[i]) :\n                                                flags & 2 /* Optional */ ? ts.factory.createOptionalTypeNode(tupleConstituentNodes[i]) :\n                                                    tupleConstituentNodes[i];\n                                    }\n                                }\n                                var tupleTypeNode = ts.setEmitFlags(ts.factory.createTupleTypeNode(tupleConstituentNodes), 1 /* SingleLine */);\n                                return type.target.readonly ? ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode;\n                            }\n                        }\n                        if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) {\n                            var tupleTypeNode = ts.setEmitFlags(ts.factory.createTupleTypeNode([]), 1 /* SingleLine */);\n                            return type.target.readonly ? ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode;\n                        }\n                        context.encounteredError = true;\n                        return undefined; // TODO: GH#18217\n                    }\n                    else if (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ &&\n                        type.symbol.valueDeclaration &&\n                        ts.isClassLike(type.symbol.valueDeclaration) &&\n                        !isValueSymbolAccessible(type.symbol, context.enclosingDeclaration)) {\n                        return createAnonymousTypeNode(type);\n                    }\n                    else {\n                        var outerTypeParameters = type.target.outerTypeParameters;\n                        var i = 0;\n                        var resultType = void 0;\n                        if (outerTypeParameters) {\n                            var length_2 = outerTypeParameters.length;\n                            while (i < length_2) {\n                                // Find group of type arguments for type parameters with the same declaring container.\n                                var start = i;\n                                var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]);\n                                do {\n                                    i++;\n                                } while (i < length_2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent);\n                                // When type parameters are their own type arguments for the whole group (i.e. we have\n                                // the default outer type arguments), we don't show the group.\n                                if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) {\n                                    var typeArgumentSlice = mapToTypeNodes(typeArguments.slice(start, i), context);\n                                    var flags_3 = context.flags;\n                                    context.flags |= 16 /* ForbidIndexedAccessSymbolReferences */;\n                                    var ref = symbolToTypeNode(parent, context, 788968 /* Type */, typeArgumentSlice);\n                                    context.flags = flags_3;\n                                    resultType = !resultType ? ref : appendReferenceToType(resultType, ref);\n                                }\n                            }\n                        }\n                        var typeArgumentNodes = void 0;\n                        if (typeArguments.length > 0) {\n                            var typeParameterCount = (type.target.typeParameters || ts.emptyArray).length;\n                            typeArgumentNodes = mapToTypeNodes(typeArguments.slice(i, typeParameterCount), context);\n                        }\n                        var flags = context.flags;\n                        context.flags |= 16 /* ForbidIndexedAccessSymbolReferences */;\n                        var finalRef = symbolToTypeNode(type.symbol, context, 788968 /* Type */, typeArgumentNodes);\n                        context.flags = flags;\n                        return !resultType ? finalRef : appendReferenceToType(resultType, finalRef);\n                    }\n                }\n                function appendReferenceToType(root, ref) {\n                    if (ts.isImportTypeNode(root)) {\n                        // first shift type arguments\n                        var typeArguments = root.typeArguments;\n                        var qualifier = root.qualifier;\n                        if (qualifier) {\n                            if (ts.isIdentifier(qualifier)) {\n                                qualifier = ts.factory.updateIdentifier(qualifier, typeArguments);\n                            }\n                            else {\n                                qualifier = ts.factory.updateQualifiedName(qualifier, qualifier.left, ts.factory.updateIdentifier(qualifier.right, typeArguments));\n                            }\n                        }\n                        typeArguments = ref.typeArguments;\n                        // then move qualifiers\n                        var ids = getAccessStack(ref);\n                        for (var _i = 0, ids_1 = ids; _i < ids_1.length; _i++) {\n                            var id = ids_1[_i];\n                            qualifier = qualifier ? ts.factory.createQualifiedName(qualifier, id) : id;\n                        }\n                        return ts.factory.updateImportTypeNode(root, root.argument, qualifier, typeArguments, root.isTypeOf);\n                    }\n                    else {\n                        // first shift type arguments\n                        var typeArguments = root.typeArguments;\n                        var typeName = root.typeName;\n                        if (ts.isIdentifier(typeName)) {\n                            typeName = ts.factory.updateIdentifier(typeName, typeArguments);\n                        }\n                        else {\n                            typeName = ts.factory.updateQualifiedName(typeName, typeName.left, ts.factory.updateIdentifier(typeName.right, typeArguments));\n                        }\n                        typeArguments = ref.typeArguments;\n                        // then move qualifiers\n                        var ids = getAccessStack(ref);\n                        for (var _a = 0, ids_2 = ids; _a < ids_2.length; _a++) {\n                            var id = ids_2[_a];\n                            typeName = ts.factory.createQualifiedName(typeName, id);\n                        }\n                        return ts.factory.updateTypeReferenceNode(root, typeName, typeArguments);\n                    }\n                }\n                function getAccessStack(ref) {\n                    var state = ref.typeName;\n                    var ids = [];\n                    while (!ts.isIdentifier(state)) {\n                        ids.unshift(state.right);\n                        state = state.left;\n                    }\n                    ids.unshift(state);\n                    return ids;\n                }\n                function createTypeNodesFromResolvedType(resolvedType) {\n                    if (checkTruncationLength(context)) {\n                        return [ts.factory.createPropertySignature(/*modifiers*/ undefined, \"...\", /*questionToken*/ undefined, /*type*/ undefined)];\n                    }\n                    var typeElements = [];\n                    for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) {\n                        var signature = _a[_i];\n                        typeElements.push(signatureToSignatureDeclarationHelper(signature, 169 /* CallSignature */, context));\n                    }\n                    for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) {\n                        var signature = _c[_b];\n                        if (signature.flags & 4 /* Abstract */)\n                            continue;\n                        typeElements.push(signatureToSignatureDeclarationHelper(signature, 170 /* ConstructSignature */, context));\n                    }\n                    if (resolvedType.stringIndexInfo) {\n                        var indexSignature = void 0;\n                        if (resolvedType.objectFlags & 2048 /* ReverseMapped */) {\n                            indexSignature = indexInfoToIndexSignatureDeclarationHelper(createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration), 0 /* String */, context, createElidedInformationPlaceholder(context));\n                        }\n                        else {\n                            indexSignature = indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0 /* String */, context, /*typeNode*/ undefined);\n                        }\n                        typeElements.push(indexSignature);\n                    }\n                    if (resolvedType.numberIndexInfo) {\n                        typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1 /* Number */, context, /*typeNode*/ undefined));\n                    }\n                    var properties = resolvedType.properties;\n                    if (!properties) {\n                        return typeElements;\n                    }\n                    var i = 0;\n                    for (var _d = 0, properties_1 = properties; _d < properties_1.length; _d++) {\n                        var propertySymbol = properties_1[_d];\n                        i++;\n                        if (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) {\n                            if (propertySymbol.flags & 4194304 /* Prototype */) {\n                                continue;\n                            }\n                            if (ts.getDeclarationModifierFlagsFromSymbol(propertySymbol) & (8 /* Private */ | 16 /* Protected */) && context.tracker.reportPrivateInBaseOfClassExpression) {\n                                context.tracker.reportPrivateInBaseOfClassExpression(ts.unescapeLeadingUnderscores(propertySymbol.escapedName));\n                            }\n                        }\n                        if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {\n                            typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, \"... \" + (properties.length - i) + \" more ...\", /*questionToken*/ undefined, /*type*/ undefined));\n                            addPropertyToElementList(properties[properties.length - 1], context, typeElements);\n                            break;\n                        }\n                        addPropertyToElementList(propertySymbol, context, typeElements);\n                    }\n                    return typeElements.length ? typeElements : undefined;\n                }\n            }\n            function createElidedInformationPlaceholder(context) {\n                context.approximateLength += 3;\n                if (!(context.flags & 1 /* NoTruncation */)) {\n                    return ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(\"...\"), /*typeArguments*/ undefined);\n                }\n                return ts.factory.createKeywordTypeNode(128 /* AnyKeyword */);\n            }\n            function addPropertyToElementList(propertySymbol, context, typeElements) {\n                var propertyIsReverseMapped = !!(ts.getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */);\n                var propertyType = propertyIsReverseMapped && context.flags & 33554432 /* InReverseMappedType */ ?\n                    anyType : getTypeOfSymbol(propertySymbol);\n                var saveEnclosingDeclaration = context.enclosingDeclaration;\n                context.enclosingDeclaration = undefined;\n                if (context.tracker.trackSymbol && ts.getCheckFlags(propertySymbol) & 4096 /* Late */ && isLateBoundName(propertySymbol.escapedName)) {\n                    var decl = ts.first(propertySymbol.declarations);\n                    if (hasLateBindableName(decl)) {\n                        if (ts.isBinaryExpression(decl)) {\n                            var name = ts.getNameOfDeclaration(decl);\n                            if (name && ts.isElementAccessExpression(name) && ts.isPropertyAccessEntityNameExpression(name.argumentExpression)) {\n                                trackComputedName(name.argumentExpression, saveEnclosingDeclaration, context);\n                            }\n                        }\n                        else {\n                            trackComputedName(decl.name.expression, saveEnclosingDeclaration, context);\n                        }\n                    }\n                }\n                context.enclosingDeclaration = saveEnclosingDeclaration;\n                var propertyName = getPropertyNameNodeForSymbol(propertySymbol, context);\n                context.approximateLength += (ts.symbolName(propertySymbol).length + 1);\n                var optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined;\n                if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) {\n                    var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */);\n                    for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) {\n                        var signature = signatures_1[_i];\n                        var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 164 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });\n                        typeElements.push(preserveCommentsOn(methodDeclaration));\n                    }\n                }\n                else {\n                    var savedFlags = context.flags;\n                    context.flags |= propertyIsReverseMapped ? 33554432 /* InReverseMappedType */ : 0;\n                    var propertyTypeNode = void 0;\n                    if (propertyIsReverseMapped && !!(savedFlags & 33554432 /* InReverseMappedType */)) {\n                        propertyTypeNode = createElidedInformationPlaceholder(context);\n                    }\n                    else {\n                        propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : ts.factory.createKeywordTypeNode(128 /* AnyKeyword */);\n                    }\n                    context.flags = savedFlags;\n                    var modifiers = isReadonlySymbol(propertySymbol) ? [ts.factory.createToken(142 /* ReadonlyKeyword */)] : undefined;\n                    if (modifiers) {\n                        context.approximateLength += 9;\n                    }\n                    var propertySignature = ts.factory.createPropertySignature(modifiers, propertyName, optionalToken, propertyTypeNode);\n                    typeElements.push(preserveCommentsOn(propertySignature));\n                }\n                function preserveCommentsOn(node) {\n                    if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 333 /* JSDocPropertyTag */; })) {\n                        var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 333 /* JSDocPropertyTag */; });\n                        var commentText = d.comment;\n                        if (commentText) {\n                            ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: \"*\\n * \" + commentText.replace(/\\n/g, \"\\n * \") + \"\\n \", pos: -1, end: -1, hasTrailingNewLine: true }]);\n                        }\n                    }\n                    else if (propertySymbol.valueDeclaration) {\n                        // Copy comments to node for declaration emit\n                        ts.setCommentRange(node, propertySymbol.valueDeclaration);\n                    }\n                    return node;\n                }\n            }\n            function mapToTypeNodes(types, context, isBareList) {\n                if (ts.some(types)) {\n                    if (checkTruncationLength(context)) {\n                        if (!isBareList) {\n                            return [ts.factory.createTypeReferenceNode(\"...\", /*typeArguments*/ undefined)];\n                        }\n                        else if (types.length > 2) {\n                            return [\n                                typeToTypeNodeHelper(types[0], context),\n                                ts.factory.createTypeReferenceNode(\"... \" + (types.length - 2) + \" more ...\", /*typeArguments*/ undefined),\n                                typeToTypeNodeHelper(types[types.length - 1], context)\n                            ];\n                        }\n                    }\n                    var mayHaveNameCollisions = !(context.flags & 64 /* UseFullyQualifiedType */);\n                    /** Map from type reference identifier text to [type, index in `result` where the type node is] */\n                    var seenNames = mayHaveNameCollisions ? ts.createUnderscoreEscapedMultiMap() : undefined;\n                    var result_4 = [];\n                    var i = 0;\n                    for (var _i = 0, types_2 = types; _i < types_2.length; _i++) {\n                        var type = types_2[_i];\n                        i++;\n                        if (checkTruncationLength(context) && (i + 2 < types.length - 1)) {\n                            result_4.push(ts.factory.createTypeReferenceNode(\"... \" + (types.length - i) + \" more ...\", /*typeArguments*/ undefined));\n                            var typeNode_1 = typeToTypeNodeHelper(types[types.length - 1], context);\n                            if (typeNode_1) {\n                                result_4.push(typeNode_1);\n                            }\n                            break;\n                        }\n                        context.approximateLength += 2; // Account for whitespace + separator\n                        var typeNode = typeToTypeNodeHelper(type, context);\n                        if (typeNode) {\n                            result_4.push(typeNode);\n                            if (seenNames && ts.isIdentifierTypeReference(typeNode)) {\n                                seenNames.add(typeNode.typeName.escapedText, [type, result_4.length - 1]);\n                            }\n                        }\n                    }\n                    if (seenNames) {\n                        // To avoid printing types like `[Foo, Foo]` or `Bar & Bar` where\n                        // occurrences of the same name actually come from different\n                        // namespaces, go through the single-identifier type reference nodes\n                        // we just generated, and see if any names were generated more than\n                        // once while referring to different types. If so, regenerate the\n                        // type node for each entry by that name with the\n                        // `UseFullyQualifiedType` flag enabled.\n                        var saveContextFlags = context.flags;\n                        context.flags |= 64 /* UseFullyQualifiedType */;\n                        seenNames.forEach(function (types) {\n                            if (!ts.arrayIsHomogeneous(types, function (_a, _b) {\n                                var a = _a[0];\n                                var b = _b[0];\n                                return typesAreSameReference(a, b);\n                            })) {\n                                for (var _i = 0, types_3 = types; _i < types_3.length; _i++) {\n                                    var _a = types_3[_i], type = _a[0], resultIndex = _a[1];\n                                    result_4[resultIndex] = typeToTypeNodeHelper(type, context);\n                                }\n                            }\n                        });\n                        context.flags = saveContextFlags;\n                    }\n                    return result_4;\n                }\n            }\n            function typesAreSameReference(a, b) {\n                return a === b\n                    || !!a.symbol && a.symbol === b.symbol\n                    || !!a.aliasSymbol && a.aliasSymbol === b.aliasSymbol;\n            }\n            function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context, typeNode) {\n                var name = ts.getNameFromIndexInfo(indexInfo) || \"x\";\n                var indexerTypeNode = ts.factory.createKeywordTypeNode(kind === 0 /* String */ ? 147 /* StringKeyword */ : 144 /* NumberKeyword */);\n                var indexingParameter = ts.factory.createParameterDeclaration(\n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, \n                /*dotDotDotToken*/ undefined, name, \n                /*questionToken*/ undefined, indexerTypeNode, \n                /*initializer*/ undefined);\n                if (!typeNode) {\n                    typeNode = typeToTypeNodeHelper(indexInfo.type || anyType, context);\n                }\n                if (!indexInfo.type && !(context.flags & 2097152 /* AllowEmptyIndexInfoType */)) {\n                    context.encounteredError = true;\n                }\n                context.approximateLength += (name.length + 4);\n                return ts.factory.createIndexSignature(\n                /*decorators*/ undefined, indexInfo.isReadonly ? [ts.factory.createToken(142 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode);\n            }\n            function signatureToSignatureDeclarationHelper(signature, kind, context, options) {\n                var _a, _b, _c, _d;\n                var suppressAny = context.flags & 256 /* SuppressAnyReturnType */;\n                if (suppressAny)\n                    context.flags &= ~256 /* SuppressAnyReturnType */; // suppress only toplevel `any`s\n                var typeParameters;\n                var typeArguments;\n                if (context.flags & 32 /* WriteTypeArgumentsOfSignature */ && signature.target && signature.mapper && signature.target.typeParameters) {\n                    typeArguments = signature.target.typeParameters.map(function (parameter) { return typeToTypeNodeHelper(instantiateType(parameter, signature.mapper), context); });\n                }\n                else {\n                    typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); });\n                }\n                var expandedParams = getExpandedParameters(signature, /*skipUnionExpanding*/ true)[0];\n                // If the expanded parameter list had a variadic in a non-trailing position, don't expand it\n                var parameters = (ts.some(expandedParams, function (p) { return p !== expandedParams[expandedParams.length - 1] && !!(ts.getCheckFlags(p) & 32768 /* RestParameter */); }) ? signature.parameters : expandedParams).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 166 /* Constructor */, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); });\n                if (signature.thisParameter) {\n                    var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context);\n                    parameters.unshift(thisParameter);\n                }\n                var returnTypeNode;\n                var typePredicate = getTypePredicateOfSignature(signature);\n                if (typePredicate) {\n                    var assertsModifier = typePredicate.kind === 2 /* AssertsThis */ || typePredicate.kind === 3 /* AssertsIdentifier */ ?\n                        ts.factory.createToken(127 /* AssertsKeyword */) :\n                        undefined;\n                    var parameterName = typePredicate.kind === 1 /* Identifier */ || typePredicate.kind === 3 /* AssertsIdentifier */ ?\n                        ts.setEmitFlags(ts.factory.createIdentifier(typePredicate.parameterName), 16777216 /* NoAsciiEscaping */) :\n                        ts.factory.createThisTypeNode();\n                    var typeNode = typePredicate.type && typeToTypeNodeHelper(typePredicate.type, context);\n                    returnTypeNode = ts.factory.createTypePredicateNode(assertsModifier, parameterName, typeNode);\n                }\n                else {\n                    var returnType = getReturnTypeOfSignature(signature);\n                    if (returnType && !(suppressAny && isTypeAny(returnType))) {\n                        returnTypeNode = serializeReturnTypeForSignature(context, returnType, signature, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports);\n                    }\n                    else if (!suppressAny) {\n                        returnTypeNode = ts.factory.createKeywordTypeNode(128 /* AnyKeyword */);\n                    }\n                }\n                var modifiers = options === null || options === void 0 ? void 0 : options.modifiers;\n                if ((kind === 175 /* ConstructorType */) && signature.flags & 4 /* Abstract */) {\n                    var flags = ts.modifiersToFlags(modifiers);\n                    modifiers = ts.factory.createModifiersFromModifierFlags(flags | 128 /* Abstract */);\n                }\n                context.approximateLength += 3; // Usually a signature contributes a few more characters than this, but 3 is the minimum\n                var node = kind === 169 /* CallSignature */ ? ts.factory.createCallSignature(typeParameters, parameters, returnTypeNode) :\n                    kind === 170 /* ConstructSignature */ ? ts.factory.createConstructSignature(typeParameters, parameters, returnTypeNode) :\n                        kind === 164 /* MethodSignature */ ? ts.factory.createMethodSignature(modifiers, (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : ts.factory.createIdentifier(\"\"), options === null || options === void 0 ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) :\n                            kind === 165 /* MethodDeclaration */ ? ts.factory.createMethodDeclaration(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, (_b = options === null || options === void 0 ? void 0 : options.name) !== null && _b !== void 0 ? _b : ts.factory.createIdentifier(\"\"), /*questionToken*/ undefined, typeParameters, parameters, returnTypeNode, /*body*/ undefined) :\n                                kind === 166 /* Constructor */ ? ts.factory.createConstructorDeclaration(/*decorators*/ undefined, modifiers, parameters, /*body*/ undefined) :\n                                    kind === 167 /* GetAccessor */ ? ts.factory.createGetAccessorDeclaration(/*decorators*/ undefined, modifiers, (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts.factory.createIdentifier(\"\"), parameters, returnTypeNode, /*body*/ undefined) :\n                                        kind === 168 /* SetAccessor */ ? ts.factory.createSetAccessorDeclaration(/*decorators*/ undefined, modifiers, (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts.factory.createIdentifier(\"\"), parameters, /*body*/ undefined) :\n                                            kind === 171 /* IndexSignature */ ? ts.factory.createIndexSignature(/*decorators*/ undefined, modifiers, parameters, returnTypeNode) :\n                                                kind === 308 /* JSDocFunctionType */ ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) :\n                                                    kind === 174 /* FunctionType */ ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(\"\"))) :\n                                                        kind === 175 /* ConstructorType */ ? ts.factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(\"\"))) :\n                                                            kind === 251 /* FunctionDeclaration */ ? ts.factory.createFunctionDeclaration(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(\"\"), typeParameters, parameters, returnTypeNode, /*body*/ undefined) :\n                                                                kind === 208 /* FunctionExpression */ ? ts.factory.createFunctionExpression(modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(\"\"), typeParameters, parameters, returnTypeNode, ts.factory.createBlock([])) :\n                                                                    kind === 209 /* ArrowFunction */ ? ts.factory.createArrowFunction(modifiers, typeParameters, parameters, returnTypeNode, /*equalsGreaterThanToken*/ undefined, ts.factory.createBlock([])) :\n                                                                        ts.Debug.assertNever(kind);\n                if (typeArguments) {\n                    node.typeArguments = ts.factory.createNodeArray(typeArguments);\n                }\n                return node;\n            }\n            function typeParameterToDeclarationWithConstraint(type, context, constraintNode) {\n                var savedContextFlags = context.flags;\n                context.flags &= ~512 /* WriteTypeParametersInQualifiedName */; // Avoids potential infinite loop when building for a claimspace with a generic\n                var name = typeParameterToName(type, context);\n                var defaultParameter = getDefaultFromTypeParameter(type);\n                var defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter, context);\n                context.flags = savedContextFlags;\n                return ts.factory.createTypeParameterDeclaration(name, constraintNode, defaultParameterNode);\n            }\n            function typeParameterToDeclaration(type, context, constraint) {\n                if (constraint === void 0) { constraint = getConstraintOfTypeParameter(type); }\n                var constraintNode = constraint && typeToTypeNodeHelper(constraint, context);\n                return typeParameterToDeclarationWithConstraint(type, context, constraintNode);\n            }\n            function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags, privateSymbolVisitor, bundledImports) {\n                var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 160 /* Parameter */);\n                if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) {\n                    parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 326 /* JSDocParameterTag */);\n                }\n                var parameterType = getTypeOfSymbol(parameterSymbol);\n                if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {\n                    parameterType = getOptionalType(parameterType);\n                }\n                if ((context.flags & 1073741824 /* NoUndefinedOptionalParameterType */) && parameterDeclaration && !ts.isJSDocParameterTag(parameterDeclaration) && isOptionalUninitializedParameter(parameterDeclaration)) {\n                    parameterType = getTypeWithFacts(parameterType, 524288 /* NEUndefined */);\n                }\n                var parameterTypeNode = serializeTypeForDeclaration(context, parameterType, parameterSymbol, context.enclosingDeclaration, privateSymbolVisitor, bundledImports);\n                var modifiers = !(context.flags & 8192 /* OmitParameterModifiers */) && preserveModifierFlags && parameterDeclaration && parameterDeclaration.modifiers ? parameterDeclaration.modifiers.map(ts.factory.cloneNode) : undefined;\n                var isRest = parameterDeclaration && ts.isRestParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 32768 /* RestParameter */;\n                var dotDotDotToken = isRest ? ts.factory.createToken(25 /* DotDotDotToken */) : undefined;\n                var name = parameterDeclaration ? parameterDeclaration.name ?\n                    parameterDeclaration.name.kind === 78 /* Identifier */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) :\n                        parameterDeclaration.name.kind === 157 /* QualifiedName */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) :\n                            cloneBindingName(parameterDeclaration.name) :\n                    ts.symbolName(parameterSymbol) :\n                    ts.symbolName(parameterSymbol);\n                var isOptional = parameterDeclaration && isOptionalParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 16384 /* OptionalParameter */;\n                var questionToken = isOptional ? ts.factory.createToken(57 /* QuestionToken */) : undefined;\n                var parameterNode = ts.factory.createParameterDeclaration(\n                /*decorators*/ undefined, modifiers, dotDotDotToken, name, questionToken, parameterTypeNode, \n                /*initializer*/ undefined);\n                context.approximateLength += ts.symbolName(parameterSymbol).length + 3;\n                return parameterNode;\n                function cloneBindingName(node) {\n                    return elideInitializerAndSetEmitFlags(node);\n                    function elideInitializerAndSetEmitFlags(node) {\n                        if (context.tracker.trackSymbol && ts.isComputedPropertyName(node) && isLateBindableName(node)) {\n                            trackComputedName(node.expression, context.enclosingDeclaration, context);\n                        }\n                        var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags);\n                        if (ts.isBindingElement(visited)) {\n                            visited = ts.factory.updateBindingElement(visited, visited.dotDotDotToken, visited.propertyName, visited.name, \n                            /*initializer*/ undefined);\n                        }\n                        if (!ts.nodeIsSynthesized(visited)) {\n                            visited = ts.factory.cloneNode(visited);\n                        }\n                        return ts.setEmitFlags(visited, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */);\n                    }\n                }\n            }\n            function trackComputedName(accessExpression, enclosingDeclaration, context) {\n                if (!context.tracker.trackSymbol)\n                    return;\n                // get symbol of the first identifier of the entityName\n                var firstIdentifier = ts.getFirstIdentifier(accessExpression);\n                var name = resolveName(firstIdentifier, firstIdentifier.escapedText, 111551 /* Value */ | 1048576 /* ExportValue */, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true);\n                if (name) {\n                    context.tracker.trackSymbol(name, enclosingDeclaration, 111551 /* Value */);\n                }\n            }\n            function lookupSymbolChain(symbol, context, meaning, yieldModuleSymbol) {\n                context.tracker.trackSymbol(symbol, context.enclosingDeclaration, meaning); // TODO: GH#18217\n                return lookupSymbolChainWorker(symbol, context, meaning, yieldModuleSymbol);\n            }\n            function lookupSymbolChainWorker(symbol, context, meaning, yieldModuleSymbol) {\n                // Try to get qualified name if the symbol is not a type parameter and there is an enclosing declaration.\n                var chain;\n                var isTypeParameter = symbol.flags & 262144 /* TypeParameter */;\n                if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */) && !(context.flags & 134217728 /* DoNotIncludeSymbolChain */)) {\n                    chain = ts.Debug.checkDefined(getSymbolChain(symbol, meaning, /*endOfChain*/ true));\n                    ts.Debug.assert(chain && chain.length > 0);\n                }\n                else {\n                    chain = [symbol];\n                }\n                return chain;\n                /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */\n                function getSymbolChain(symbol, meaning, endOfChain) {\n                    var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, !!(context.flags & 128 /* UseOnlyExternalAliasing */));\n                    var parentSpecifiers;\n                    if (!accessibleSymbolChain ||\n                        needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) {\n                        // Go up and add our parent.\n                        var parents_1 = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol, context.enclosingDeclaration, meaning);\n                        if (ts.length(parents_1)) {\n                            parentSpecifiers = parents_1.map(function (symbol) {\n                                return ts.some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol)\n                                    ? getSpecifierForModuleSymbol(symbol, context)\n                                    : undefined;\n                            });\n                            var indices = parents_1.map(function (_, i) { return i; });\n                            indices.sort(sortByBestName);\n                            var sortedParents = indices.map(function (i) { return parents_1[i]; });\n                            for (var _i = 0, sortedParents_1 = sortedParents; _i < sortedParents_1.length; _i++) {\n                                var parent = sortedParents_1[_i];\n                                var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false);\n                                if (parentChain) {\n                                    if (parent.exports && parent.exports.get(\"export=\" /* ExportEquals */) &&\n                                        getSymbolIfSameReference(parent.exports.get(\"export=\" /* ExportEquals */), symbol)) {\n                                        // parentChain root _is_ symbol - symbol is a module export=, so it kinda looks like it's own parent\n                                        // No need to lookup an alias for the symbol in itself\n                                        accessibleSymbolChain = parentChain;\n                                        break;\n                                    }\n                                    accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [getAliasForSymbolInContainer(parent, symbol) || symbol]);\n                                    break;\n                                }\n                            }\n                        }\n                    }\n                    if (accessibleSymbolChain) {\n                        return accessibleSymbolChain;\n                    }\n                    if (\n                    // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols.\n                    endOfChain ||\n                        // If a parent symbol is an anonymous type, don't write it.\n                        !(symbol.flags & (2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */))) {\n                        // If a parent symbol is an external module, don't write it. (We prefer just `x` vs `\"foo/bar\".x`.)\n                        if (!endOfChain && !yieldModuleSymbol && !!ts.forEach(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {\n                            return;\n                        }\n                        return [symbol];\n                    }\n                    function sortByBestName(a, b) {\n                        var specifierA = parentSpecifiers[a];\n                        var specifierB = parentSpecifiers[b];\n                        if (specifierA && specifierB) {\n                            var isBRelative = ts.pathIsRelative(specifierB);\n                            if (ts.pathIsRelative(specifierA) === isBRelative) {\n                                // Both relative or both non-relative, sort by number of parts\n                                return ts.moduleSpecifiers.countPathComponents(specifierA) - ts.moduleSpecifiers.countPathComponents(specifierB);\n                            }\n                            if (isBRelative) {\n                                // A is non-relative, B is relative: prefer A\n                                return -1;\n                            }\n                            // A is relative, B is non-relative: prefer B\n                            return 1;\n                        }\n                        return 0;\n                    }\n                }\n            }\n            function typeParametersToTypeParameterDeclarations(symbol, context) {\n                var typeParameterNodes;\n                var targetSymbol = getTargetSymbol(symbol);\n                if (targetSymbol.flags & (32 /* Class */ | 64 /* Interface */ | 524288 /* TypeAlias */)) {\n                    typeParameterNodes = ts.factory.createNodeArray(ts.map(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol), function (tp) { return typeParameterToDeclaration(tp, context); }));\n                }\n                return typeParameterNodes;\n            }\n            function lookupTypeParameterNodes(chain, index, context) {\n                var _a;\n                ts.Debug.assert(chain && 0 <= index && index < chain.length);\n                var symbol = chain[index];\n                var symbolId = getSymbolId(symbol);\n                if ((_a = context.typeParameterSymbolList) === null || _a === void 0 ? void 0 : _a.has(symbolId)) {\n                    return undefined;\n                }\n                (context.typeParameterSymbolList || (context.typeParameterSymbolList = new ts.Set())).add(symbolId);\n                var typeParameterNodes;\n                if (context.flags & 512 /* WriteTypeParametersInQualifiedName */ && index < (chain.length - 1)) {\n                    var parentSymbol = symbol;\n                    var nextSymbol_1 = chain[index + 1];\n                    if (ts.getCheckFlags(nextSymbol_1) & 1 /* Instantiated */) {\n                        var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 /* Alias */ ? resolveAlias(parentSymbol) : parentSymbol);\n                        typeParameterNodes = mapToTypeNodes(ts.map(params, function (t) { return getMappedType(t, nextSymbol_1.mapper); }), context);\n                    }\n                    else {\n                        typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context);\n                    }\n                }\n                return typeParameterNodes;\n            }\n            /**\n             * Given A[B][C][D], finds A[B]\n             */\n            function getTopmostIndexedAccessType(top) {\n                if (ts.isIndexedAccessTypeNode(top.objectType)) {\n                    return getTopmostIndexedAccessType(top.objectType);\n                }\n                return top;\n            }\n            function getSpecifierForModuleSymbol(symbol, context) {\n                var _a;\n                var file = ts.getDeclarationOfKind(symbol, 297 /* SourceFile */);\n                if (!file) {\n                    var equivalentFileSymbol = ts.firstDefined(symbol.declarations, function (d) { return getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol); });\n                    if (equivalentFileSymbol) {\n                        file = ts.getDeclarationOfKind(equivalentFileSymbol, 297 /* SourceFile */);\n                    }\n                }\n                if (file && file.moduleName !== undefined) {\n                    // Use the amd name if it is available\n                    return file.moduleName;\n                }\n                if (!file) {\n                    if (context.tracker.trackReferencedAmbientModule) {\n                        var ambientDecls = ts.filter(symbol.declarations, ts.isAmbientModule);\n                        if (ts.length(ambientDecls)) {\n                            for (var _i = 0, ambientDecls_1 = ambientDecls; _i < ambientDecls_1.length; _i++) {\n                                var decl = ambientDecls_1[_i];\n                                context.tracker.trackReferencedAmbientModule(decl, symbol);\n                            }\n                        }\n                    }\n                    if (ambientModuleSymbolRegex.test(symbol.escapedName)) {\n                        return symbol.escapedName.substring(1, symbol.escapedName.length - 1);\n                    }\n                }\n                if (!context.enclosingDeclaration || !context.tracker.moduleResolverHost) {\n                    // If there's no context declaration, we can't lookup a non-ambient specifier, so we just use the symbol name\n                    if (ambientModuleSymbolRegex.test(symbol.escapedName)) {\n                        return symbol.escapedName.substring(1, symbol.escapedName.length - 1);\n                    }\n                    return ts.getSourceFileOfNode(ts.getNonAugmentationDeclaration(symbol)).fileName; // A resolver may not be provided for baselines and errors - in those cases we use the fileName in full\n                }\n                var contextFile = ts.getSourceFileOfNode(ts.getOriginalNode(context.enclosingDeclaration));\n                var links = getSymbolLinks(symbol);\n                var specifier = links.specifierCache && links.specifierCache.get(contextFile.path);\n                if (!specifier) {\n                    var isBundle_1 = !!ts.outFile(compilerOptions);\n                    // For declaration bundles, we need to generate absolute paths relative to the common source dir for imports,\n                    // just like how the declaration emitter does for the ambient module declarations - we can easily accomplish this\n                    // using the `baseUrl` compiler option (which we would otherwise never use in declaration emit) and a non-relative\n                    // specifier preference\n                    var moduleResolverHost = context.tracker.moduleResolverHost;\n                    var specifierCompilerOptions = isBundle_1 ? __assign(__assign({}, compilerOptions), { baseUrl: moduleResolverHost.getCommonSourceDirectory() }) : compilerOptions;\n                    specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, checker, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? \"non-relative\" : \"relative\", importModuleSpecifierEnding: isBundle_1 ? \"minimal\" : undefined }));\n                    (_a = links.specifierCache) !== null && _a !== void 0 ? _a : (links.specifierCache = new ts.Map());\n                    links.specifierCache.set(contextFile.path, specifier);\n                }\n                return specifier;\n            }\n            function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) {\n                var chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */)); // If we're using aliases outside the current scope, dont bother with the module\n                var isTypeOf = meaning === 111551 /* Value */;\n                if (ts.some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {\n                    // module is root, must use `ImportTypeNode`\n                    var nonRootParts = chain.length > 1 ? createAccessFromSymbolChain(chain, chain.length - 1, 1) : undefined;\n                    var typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain, 0, context);\n                    var specifier = getSpecifierForModuleSymbol(chain[0], context);\n                    if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs && specifier.indexOf(\"/node_modules/\") >= 0) {\n                        // If ultimately we can only name the symbol with a reference that dives into a `node_modules` folder, we should error\n                        // since declaration files with these kinds of references are liable to fail when published :(\n                        context.encounteredError = true;\n                        if (context.tracker.reportLikelyUnsafeImportRequiredError) {\n                            context.tracker.reportLikelyUnsafeImportRequiredError(specifier);\n                        }\n                    }\n                    var lit = ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(specifier));\n                    if (context.tracker.trackExternalModuleSymbolOfImportTypeNode)\n                        context.tracker.trackExternalModuleSymbolOfImportTypeNode(chain[0]);\n                    context.approximateLength += specifier.length + 10; // specifier + import(\"\")\n                    if (!nonRootParts || ts.isEntityName(nonRootParts)) {\n                        if (nonRootParts) {\n                            var lastId = ts.isIdentifier(nonRootParts) ? nonRootParts : nonRootParts.right;\n                            lastId.typeArguments = undefined;\n                        }\n                        return ts.factory.createImportTypeNode(lit, nonRootParts, typeParameterNodes, isTypeOf);\n                    }\n                    else {\n                        var splitNode = getTopmostIndexedAccessType(nonRootParts);\n                        var qualifier = splitNode.objectType.typeName;\n                        return ts.factory.createIndexedAccessTypeNode(ts.factory.createImportTypeNode(lit, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType);\n                    }\n                }\n                var entityName = createAccessFromSymbolChain(chain, chain.length - 1, 0);\n                if (ts.isIndexedAccessTypeNode(entityName)) {\n                    return entityName; // Indexed accesses can never be `typeof`\n                }\n                if (isTypeOf) {\n                    return ts.factory.createTypeQueryNode(entityName);\n                }\n                else {\n                    var lastId = ts.isIdentifier(entityName) ? entityName : entityName.right;\n                    var lastTypeArgs = lastId.typeArguments;\n                    lastId.typeArguments = undefined;\n                    return ts.factory.createTypeReferenceNode(entityName, lastTypeArgs);\n                }\n                function createAccessFromSymbolChain(chain, index, stopper) {\n                    var typeParameterNodes = index === (chain.length - 1) ? overrideTypeArguments : lookupTypeParameterNodes(chain, index, context);\n                    var symbol = chain[index];\n                    var parent = chain[index - 1];\n                    var symbolName;\n                    if (index === 0) {\n                        context.flags |= 16777216 /* InInitialEntityName */;\n                        symbolName = getNameOfSymbolAsWritten(symbol, context);\n                        context.approximateLength += (symbolName ? symbolName.length : 0) + 1;\n                        context.flags ^= 16777216 /* InInitialEntityName */;\n                    }\n                    else {\n                        if (parent && getExportsOfSymbol(parent)) {\n                            var exports_1 = getExportsOfSymbol(parent);\n                            ts.forEachEntry(exports_1, function (ex, name) {\n                                if (getSymbolIfSameReference(ex, symbol) && !isLateBoundName(name) && name !== \"export=\" /* ExportEquals */) {\n                                    symbolName = ts.unescapeLeadingUnderscores(name);\n                                    return true;\n                                }\n                            });\n                        }\n                    }\n                    if (!symbolName) {\n                        symbolName = getNameOfSymbolAsWritten(symbol, context);\n                    }\n                    context.approximateLength += symbolName.length + 1;\n                    if (!(context.flags & 16 /* ForbidIndexedAccessSymbolReferences */) && parent &&\n                        getMembersOfSymbol(parent) && getMembersOfSymbol(parent).get(symbol.escapedName) &&\n                        getSymbolIfSameReference(getMembersOfSymbol(parent).get(symbol.escapedName), symbol)) {\n                        // Should use an indexed access\n                        var LHS = createAccessFromSymbolChain(chain, index - 1, stopper);\n                        if (ts.isIndexedAccessTypeNode(LHS)) {\n                            return ts.factory.createIndexedAccessTypeNode(LHS, ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(symbolName)));\n                        }\n                        else {\n                            return ts.factory.createIndexedAccessTypeNode(ts.factory.createTypeReferenceNode(LHS, typeParameterNodes), ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(symbolName)));\n                        }\n                    }\n                    var identifier = ts.setEmitFlags(ts.factory.createIdentifier(symbolName, typeParameterNodes), 16777216 /* NoAsciiEscaping */);\n                    identifier.symbol = symbol;\n                    if (index > stopper) {\n                        var LHS = createAccessFromSymbolChain(chain, index - 1, stopper);\n                        if (!ts.isEntityName(LHS)) {\n                            return ts.Debug.fail(\"Impossible construct - an export of an indexed access cannot be reachable\");\n                        }\n                        return ts.factory.createQualifiedName(LHS, identifier);\n                    }\n                    return identifier;\n                }\n            }\n            function typeParameterShadowsNameInScope(escapedName, context, type) {\n                var result = resolveName(context.enclosingDeclaration, escapedName, 788968 /* Type */, /*nameNotFoundArg*/ undefined, escapedName, /*isUse*/ false);\n                if (result) {\n                    if (result.flags & 262144 /* TypeParameter */ && result === type.symbol) {\n                        return false;\n                    }\n                    return true;\n                }\n                return false;\n            }\n            function typeParameterToName(type, context) {\n                var _a;\n                if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && context.typeParameterNames) {\n                    var cached = context.typeParameterNames.get(getTypeId(type));\n                    if (cached) {\n                        return cached;\n                    }\n                }\n                var result = symbolToName(type.symbol, context, 788968 /* Type */, /*expectsIdentifier*/ true);\n                if (!(result.kind & 78 /* Identifier */)) {\n                    return ts.factory.createIdentifier(\"(Missing type parameter)\");\n                }\n                if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {\n                    var rawtext = result.escapedText;\n                    var i = 0;\n                    var text = rawtext;\n                    while (((_a = context.typeParameterNamesByText) === null || _a === void 0 ? void 0 : _a.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {\n                        i++;\n                        text = rawtext + \"_\" + i;\n                    }\n                    if (text !== rawtext) {\n                        result = ts.factory.createIdentifier(text, result.typeArguments);\n                    }\n                    (context.typeParameterNames || (context.typeParameterNames = new ts.Map())).set(getTypeId(type), result);\n                    (context.typeParameterNamesByText || (context.typeParameterNamesByText = new ts.Set())).add(result.escapedText);\n                }\n                return result;\n            }\n            function symbolToName(symbol, context, meaning, expectsIdentifier) {\n                var chain = lookupSymbolChain(symbol, context, meaning);\n                if (expectsIdentifier && chain.length !== 1\n                    && !context.encounteredError\n                    && !(context.flags & 65536 /* AllowQualifedNameInPlaceOfIdentifier */)) {\n                    context.encounteredError = true;\n                }\n                return createEntityNameFromSymbolChain(chain, chain.length - 1);\n                function createEntityNameFromSymbolChain(chain, index) {\n                    var typeParameterNodes = lookupTypeParameterNodes(chain, index, context);\n                    var symbol = chain[index];\n                    if (index === 0) {\n                        context.flags |= 16777216 /* InInitialEntityName */;\n                    }\n                    var symbolName = getNameOfSymbolAsWritten(symbol, context);\n                    if (index === 0) {\n                        context.flags ^= 16777216 /* InInitialEntityName */;\n                    }\n                    var identifier = ts.setEmitFlags(ts.factory.createIdentifier(symbolName, typeParameterNodes), 16777216 /* NoAsciiEscaping */);\n                    identifier.symbol = symbol;\n                    return index > 0 ? ts.factory.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier;\n                }\n            }\n            function symbolToExpression(symbol, context, meaning) {\n                var chain = lookupSymbolChain(symbol, context, meaning);\n                return createExpressionFromSymbolChain(chain, chain.length - 1);\n                function createExpressionFromSymbolChain(chain, index) {\n                    var typeParameterNodes = lookupTypeParameterNodes(chain, index, context);\n                    var symbol = chain[index];\n                    if (index === 0) {\n                        context.flags |= 16777216 /* InInitialEntityName */;\n                    }\n                    var symbolName = getNameOfSymbolAsWritten(symbol, context);\n                    if (index === 0) {\n                        context.flags ^= 16777216 /* InInitialEntityName */;\n                    }\n                    var firstChar = symbolName.charCodeAt(0);\n                    if (ts.isSingleOrDoubleQuote(firstChar) && ts.some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {\n                        return ts.factory.createStringLiteral(getSpecifierForModuleSymbol(symbol, context));\n                    }\n                    var canUsePropertyAccess = firstChar === 35 /* hash */ ?\n                        symbolName.length > 1 && ts.isIdentifierStart(symbolName.charCodeAt(1), languageVersion) :\n                        ts.isIdentifierStart(firstChar, languageVersion);\n                    if (index === 0 || canUsePropertyAccess) {\n                        var identifier = ts.setEmitFlags(ts.factory.createIdentifier(symbolName, typeParameterNodes), 16777216 /* NoAsciiEscaping */);\n                        identifier.symbol = symbol;\n                        return index > 0 ? ts.factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain, index - 1), identifier) : identifier;\n                    }\n                    else {\n                        if (firstChar === 91 /* openBracket */) {\n                            symbolName = symbolName.substring(1, symbolName.length - 1);\n                            firstChar = symbolName.charCodeAt(0);\n                        }\n                        var expression = void 0;\n                        if (ts.isSingleOrDoubleQuote(firstChar)) {\n                            expression = ts.factory.createStringLiteral(symbolName\n                                .substring(1, symbolName.length - 1)\n                                .replace(/\\\\./g, function (s) { return s.substring(1); }), firstChar === 39 /* singleQuote */);\n                        }\n                        else if ((\"\" + +symbolName) === symbolName) {\n                            expression = ts.factory.createNumericLiteral(+symbolName);\n                        }\n                        if (!expression) {\n                            expression = ts.setEmitFlags(ts.factory.createIdentifier(symbolName, typeParameterNodes), 16777216 /* NoAsciiEscaping */);\n                            expression.symbol = symbol;\n                        }\n                        return ts.factory.createElementAccessExpression(createExpressionFromSymbolChain(chain, index - 1), expression);\n                    }\n                }\n            }\n            function isStringNamed(d) {\n                var name = ts.getNameOfDeclaration(d);\n                return !!name && ts.isStringLiteral(name);\n            }\n            function isSingleQuotedStringNamed(d) {\n                var name = ts.getNameOfDeclaration(d);\n                return !!(name && ts.isStringLiteral(name) && (name.singleQuote || !ts.nodeIsSynthesized(name) && ts.startsWith(ts.getTextOfNode(name, /*includeTrivia*/ false), \"'\")));\n            }\n            function getPropertyNameNodeForSymbol(symbol, context) {\n                var singleQuote = !!ts.length(symbol.declarations) && ts.every(symbol.declarations, isSingleQuotedStringNamed);\n                var fromNameType = getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote);\n                if (fromNameType) {\n                    return fromNameType;\n                }\n                if (ts.isKnownSymbol(symbol)) {\n                    return ts.factory.createComputedPropertyName(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(\"Symbol\"), symbol.escapedName.substr(3)));\n                }\n                var rawName = ts.unescapeLeadingUnderscores(symbol.escapedName);\n                var stringNamed = !!ts.length(symbol.declarations) && ts.every(symbol.declarations, isStringNamed);\n                return createPropertyNameNodeForIdentifierOrLiteral(rawName, stringNamed, singleQuote);\n            }\n            // See getNameForSymbolFromNameType for a stringy equivalent\n            function getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote) {\n                var nameType = getSymbolLinks(symbol).nameType;\n                if (nameType) {\n                    if (nameType.flags & 384 /* StringOrNumberLiteral */) {\n                        var name = \"\" + nameType.value;\n                        if (!ts.isIdentifierText(name, compilerOptions.target) && !isNumericLiteralName(name)) {\n                            return ts.factory.createStringLiteral(name, !!singleQuote);\n                        }\n                        if (isNumericLiteralName(name) && ts.startsWith(name, \"-\")) {\n                            return ts.factory.createComputedPropertyName(ts.factory.createNumericLiteral(+name));\n                        }\n                        return createPropertyNameNodeForIdentifierOrLiteral(name);\n                    }\n                    if (nameType.flags & 8192 /* UniqueESSymbol */) {\n                        return ts.factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, 111551 /* Value */));\n                    }\n                }\n            }\n            function createPropertyNameNodeForIdentifierOrLiteral(name, stringNamed, singleQuote) {\n                return ts.isIdentifierText(name, compilerOptions.target) ? ts.factory.createIdentifier(name) :\n                    !stringNamed && isNumericLiteralName(name) && +name >= 0 ? ts.factory.createNumericLiteral(+name) :\n                        ts.factory.createStringLiteral(name, !!singleQuote);\n            }\n            function cloneNodeBuilderContext(context) {\n                var initial = __assign({}, context);\n                // Make type parameters created within this context not consume the name outside this context\n                // The symbol serializer ends up creating many sibling scopes that all need \"separate\" contexts when\n                // it comes to naming things - within a normal `typeToTypeNode` call, the node builder only ever descends\n                // through the type tree, so the only cases where we could have used distinct sibling scopes was when there\n                // were multiple generic overloads with similar generated type parameter names\n                // The effect:\n                // When we write out\n                // export const x: <T>(x: T) => T\n                // export const y: <T>(x: T) => T\n                // we write it out like that, rather than as\n                // export const x: <T>(x: T) => T\n                // export const y: <T_1>(x: T_1) => T_1\n                if (initial.typeParameterNames) {\n                    initial.typeParameterNames = new ts.Map(initial.typeParameterNames);\n                }\n                if (initial.typeParameterNamesByText) {\n                    initial.typeParameterNamesByText = new ts.Set(initial.typeParameterNamesByText);\n                }\n                if (initial.typeParameterSymbolList) {\n                    initial.typeParameterSymbolList = new ts.Set(initial.typeParameterSymbolList);\n                }\n                return initial;\n            }\n            function getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration) {\n                return symbol.declarations && ts.find(symbol.declarations, function (s) { return !!ts.getEffectiveTypeAnnotationNode(s) && (!enclosingDeclaration || !!ts.findAncestor(s, function (n) { return n === enclosingDeclaration; })); });\n            }\n            function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) {\n                return !(ts.getObjectFlags(type) & 4 /* Reference */) || !ts.isTypeReferenceNode(existing) || ts.length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);\n            }\n            /**\n             * Unlike `typeToTypeNodeHelper`, this handles setting up the `AllowUniqueESSymbolType` flag\n             * so a `unique symbol` is returned when appropriate for the input symbol, rather than `typeof sym`\n             */\n            function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {\n                if (type !== errorType && enclosingDeclaration) {\n                    var declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);\n                    if (declWithExistingAnnotation && !ts.isFunctionLikeDeclaration(declWithExistingAnnotation)) {\n                        // try to reuse the existing annotation\n                        var existing = ts.getEffectiveTypeAnnotationNode(declWithExistingAnnotation);\n                        if (getTypeFromTypeNode(existing) === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {\n                            var result_5 = serializeExistingTypeNode(context, existing, includePrivateSymbol, bundled);\n                            if (result_5) {\n                                return result_5;\n                            }\n                        }\n                    }\n                }\n                var oldFlags = context.flags;\n                if (type.flags & 8192 /* UniqueESSymbol */ &&\n                    type.symbol === symbol && (!context.enclosingDeclaration || ts.some(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) === ts.getSourceFileOfNode(context.enclosingDeclaration); }))) {\n                    context.flags |= 1048576 /* AllowUniqueESSymbolType */;\n                }\n                var result = typeToTypeNodeHelper(type, context);\n                context.flags = oldFlags;\n                return result;\n            }\n            function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {\n                if (type !== errorType && context.enclosingDeclaration) {\n                    var annotation = signature.declaration && ts.getEffectiveReturnTypeNode(signature.declaration);\n                    if (!!ts.findAncestor(annotation, function (n) { return n === context.enclosingDeclaration; }) && annotation && instantiateType(getTypeFromTypeNode(annotation), signature.mapper) === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) {\n                        var result = serializeExistingTypeNode(context, annotation, includePrivateSymbol, bundled);\n                        if (result) {\n                            return result;\n                        }\n                    }\n                }\n                return typeToTypeNodeHelper(type, context);\n            }\n            function trackExistingEntityName(node, context, includePrivateSymbol) {\n                var _a, _b;\n                var introducesError = false;\n                var leftmost = ts.getFirstIdentifier(node);\n                if (ts.isInJSFile(node) && (ts.isExportsIdentifier(leftmost) || ts.isModuleExportsAccessExpression(leftmost.parent) || (ts.isQualifiedName(leftmost.parent) && ts.isModuleIdentifier(leftmost.parent.left) && ts.isExportsIdentifier(leftmost.parent.right)))) {\n                    introducesError = true;\n                    return { introducesError: introducesError, node: node };\n                }\n                var sym = resolveEntityName(leftmost, 67108863 /* All */, /*ignoreErrors*/ true, /*dontResolveALias*/ true);\n                if (sym) {\n                    if (isSymbolAccessible(sym, context.enclosingDeclaration, 67108863 /* All */, /*shouldComputeAliasesToMakeVisible*/ false).accessibility !== 0 /* Accessible */) {\n                        introducesError = true;\n                    }\n                    else {\n                        (_b = (_a = context.tracker) === null || _a === void 0 ? void 0 : _a.trackSymbol) === null || _b === void 0 ? void 0 : _b.call(_a, sym, context.enclosingDeclaration, 67108863 /* All */);\n                        includePrivateSymbol === null || includePrivateSymbol === void 0 ? void 0 : includePrivateSymbol(sym);\n                    }\n                    if (ts.isIdentifier(node)) {\n                        var name = sym.flags & 262144 /* TypeParameter */ ? typeParameterToName(getDeclaredTypeOfSymbol(sym), context) : ts.factory.cloneNode(node);\n                        name.symbol = sym; // for quickinfo, which uses identifier symbol information\n                        return { introducesError: introducesError, node: ts.setEmitFlags(ts.setOriginalNode(name, node), 16777216 /* NoAsciiEscaping */) };\n                    }\n                }\n                return { introducesError: introducesError, node: node };\n            }\n            function serializeExistingTypeNode(context, existing, includePrivateSymbol, bundled) {\n                if (cancellationToken && cancellationToken.throwIfCancellationRequested) {\n                    cancellationToken.throwIfCancellationRequested();\n                }\n                var hadError = false;\n                var file = ts.getSourceFileOfNode(existing);\n                var transformed = ts.visitNode(existing, visitExistingNodeTreeSymbols);\n                if (hadError) {\n                    return undefined;\n                }\n                return transformed === existing ? ts.setTextRange(ts.factory.cloneNode(existing), existing) : transformed;\n                function visitExistingNodeTreeSymbols(node) {\n                    // We don't _actually_ support jsdoc namepath types, emit `any` instead\n                    if (ts.isJSDocAllType(node) || node.kind === 310 /* JSDocNamepathType */) {\n                        return ts.factory.createKeywordTypeNode(128 /* AnyKeyword */);\n                    }\n                    if (ts.isJSDocUnknownType(node)) {\n                        return ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */);\n                    }\n                    if (ts.isJSDocNullableType(node)) {\n                        return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createLiteralTypeNode(ts.factory.createNull())]);\n                    }\n                    if (ts.isJSDocOptionalType(node)) {\n                        return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)]);\n                    }\n                    if (ts.isJSDocNonNullableType(node)) {\n                        return ts.visitNode(node.type, visitExistingNodeTreeSymbols);\n                    }\n                    if (ts.isJSDocVariadicType(node)) {\n                        return ts.factory.createArrayTypeNode(ts.visitNode(node.type, visitExistingNodeTreeSymbols));\n                    }\n                    if (ts.isJSDocTypeLiteral(node)) {\n                        return ts.factory.createTypeLiteralNode(ts.map(node.jsDocPropertyTags, function (t) {\n                            var name = ts.isIdentifier(t.name) ? t.name : t.name.right;\n                            var typeViaParent = getTypeOfPropertyOfType(getTypeFromTypeNode(node), name.escapedText);\n                            var overrideTypeNode = typeViaParent && t.typeExpression && getTypeFromTypeNode(t.typeExpression.type) !== typeViaParent ? typeToTypeNodeHelper(typeViaParent, context) : undefined;\n                            return ts.factory.createPropertySignature(\n                            /*modifiers*/ undefined, name, t.isBracketed || t.typeExpression && ts.isJSDocOptionalType(t.typeExpression.type) ? ts.factory.createToken(57 /* QuestionToken */) : undefined, overrideTypeNode || (t.typeExpression && ts.visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols)) || ts.factory.createKeywordTypeNode(128 /* AnyKeyword */));\n                        }));\n                    }\n                    if (ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === \"\") {\n                        return ts.setOriginalNode(ts.factory.createKeywordTypeNode(128 /* AnyKeyword */), node);\n                    }\n                    if ((ts.isExpressionWithTypeArguments(node) || ts.isTypeReferenceNode(node)) && ts.isJSDocIndexSignature(node)) {\n                        return ts.factory.createTypeLiteralNode([ts.factory.createIndexSignature(\n                            /*decorators*/ undefined, \n                            /*modifiers*/ undefined, [ts.factory.createParameterDeclaration(\n                                /*decorators*/ undefined, \n                                /*modifiers*/ undefined, \n                                /*dotdotdotToken*/ undefined, \"x\", \n                                /*questionToken*/ undefined, ts.visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols))], ts.visitNode(node.typeArguments[1], visitExistingNodeTreeSymbols))]);\n                    }\n                    if (ts.isJSDocFunctionType(node)) {\n                        if (ts.isJSDocConstructSignature(node)) {\n                            var newTypeNode_1;\n                            return ts.factory.createConstructorTypeNode(node.modifiers, ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols), ts.mapDefined(node.parameters, function (p, i) { return p.name && ts.isIdentifier(p.name) && p.name.escapedText === \"new\" ? (newTypeNode_1 = p.type, undefined) : ts.factory.createParameterDeclaration(\n                            /*decorators*/ undefined, \n                            /*modifiers*/ undefined, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, ts.visitNode(p.type, visitExistingNodeTreeSymbols), \n                            /*initializer*/ undefined); }), ts.visitNode(newTypeNode_1 || node.type, visitExistingNodeTreeSymbols) || ts.factory.createKeywordTypeNode(128 /* AnyKeyword */));\n                        }\n                        else {\n                            return ts.factory.createFunctionTypeNode(ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols), ts.map(node.parameters, function (p, i) { return ts.factory.createParameterDeclaration(\n                            /*decorators*/ undefined, \n                            /*modifiers*/ undefined, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, ts.visitNode(p.type, visitExistingNodeTreeSymbols), \n                            /*initializer*/ undefined); }), ts.visitNode(node.type, visitExistingNodeTreeSymbols) || ts.factory.createKeywordTypeNode(128 /* AnyKeyword */));\n                        }\n                    }\n                    if (ts.isTypeReferenceNode(node) && ts.isInJSDoc(node) && (!existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(node, getTypeFromTypeNode(node)) || getIntendedTypeFromJSDocTypeReference(node) || unknownSymbol === resolveTypeReferenceName(getTypeReferenceName(node), 788968 /* Type */, /*ignoreErrors*/ true))) {\n                        return ts.setOriginalNode(typeToTypeNodeHelper(getTypeFromTypeNode(node), context), node);\n                    }\n                    if (ts.isLiteralImportTypeNode(node)) {\n                        var nodeSymbol = getNodeLinks(node).resolvedSymbol;\n                        if (ts.isInJSDoc(node) &&\n                            nodeSymbol &&\n                            (\n                            // The import type resolved using jsdoc fallback logic\n                            (!node.isTypeOf && !(nodeSymbol.flags & 788968 /* Type */)) ||\n                                // The import type had type arguments autofilled by js fallback logic\n                                !(ts.length(node.typeArguments) >= getMinTypeArgumentCount(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(nodeSymbol))))) {\n                            return ts.setOriginalNode(typeToTypeNodeHelper(getTypeFromTypeNode(node), context), node);\n                        }\n                        return ts.factory.updateImportTypeNode(node, ts.factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)), node.qualifier, ts.visitNodes(node.typeArguments, visitExistingNodeTreeSymbols, ts.isTypeNode), node.isTypeOf);\n                    }\n                    if (ts.isEntityName(node) || ts.isEntityNameExpression(node)) {\n                        var _a = trackExistingEntityName(node, context, includePrivateSymbol), introducesError = _a.introducesError, result = _a.node;\n                        hadError = hadError || introducesError;\n                        if (result !== node) {\n                            return result;\n                        }\n                    }\n                    if (file && ts.isTupleTypeNode(node) && (ts.getLineAndCharacterOfPosition(file, node.pos).line === ts.getLineAndCharacterOfPosition(file, node.end).line)) {\n                        ts.setEmitFlags(node, 1 /* SingleLine */);\n                    }\n                    return ts.visitEachChild(node, visitExistingNodeTreeSymbols, ts.nullTransformationContext);\n                    function getEffectiveDotDotDotForParameter(p) {\n                        return p.dotDotDotToken || (p.type && ts.isJSDocVariadicType(p.type) ? ts.factory.createToken(25 /* DotDotDotToken */) : undefined);\n                    }\n                    /** Note that `new:T` parameters are not handled, but should be before calling this function. */\n                    function getNameForJSDocFunctionParameter(p, index) {\n                        return p.name && ts.isIdentifier(p.name) && p.name.escapedText === \"this\" ? \"this\"\n                            : getEffectiveDotDotDotForParameter(p) ? \"args\"\n                                : \"arg\" + index;\n                    }\n                    function rewriteModuleSpecifier(parent, lit) {\n                        if (bundled) {\n                            if (context.tracker && context.tracker.moduleResolverHost) {\n                                var targetFile = getExternalModuleFileFromDeclaration(parent);\n                                if (targetFile) {\n                                    var getCanonicalFileName = ts.createGetCanonicalFileName(!!host.useCaseSensitiveFileNames);\n                                    var resolverHost = {\n                                        getCanonicalFileName: getCanonicalFileName,\n                                        getCurrentDirectory: function () { return context.tracker.moduleResolverHost.getCurrentDirectory(); },\n                                        getCommonSourceDirectory: function () { return context.tracker.moduleResolverHost.getCommonSourceDirectory(); }\n                                    };\n                                    var newName = ts.getResolvedExternalModuleName(resolverHost, targetFile);\n                                    return ts.factory.createStringLiteral(newName);\n                                }\n                            }\n                        }\n                        else {\n                            if (context.tracker && context.tracker.trackExternalModuleSymbolOfImportTypeNode) {\n                                var moduleSym = resolveExternalModuleNameWorker(lit, lit, /*moduleNotFoundError*/ undefined);\n                                if (moduleSym) {\n                                    context.tracker.trackExternalModuleSymbolOfImportTypeNode(moduleSym);\n                                }\n                            }\n                        }\n                        return lit;\n                    }\n                }\n            }\n            function symbolTableToDeclarationStatements(symbolTable, context, bundled) {\n                var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.factory.createPropertyDeclaration, 165 /* MethodDeclaration */, /*useAcessors*/ true);\n                var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type) { return ts.factory.createPropertySignature(mods, name, question, type); }, 164 /* MethodSignature */, /*useAcessors*/ false);\n                // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of\n                // declaration mapping\n                // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration\n                // emit codepaths which want to apply more specific contexts (so we can still refer to the root real declaration\n                // we're trying to emit from later on)\n                var enclosingDeclaration = context.enclosingDeclaration;\n                var results = [];\n                var visitedSymbols = new ts.Set();\n                var deferredPrivatesStack = [];\n                var oldcontext = context;\n                context = __assign(__assign({}, oldcontext), { usedSymbolNames: new ts.Set(oldcontext.usedSymbolNames), remappedSymbolNames: new ts.Map(), tracker: __assign(__assign({}, oldcontext.tracker), { trackSymbol: function (sym, decl, meaning) {\n                            var accessibleResult = isSymbolAccessible(sym, decl, meaning, /*computeAliases*/ false);\n                            if (accessibleResult.accessibility === 0 /* Accessible */) {\n                                // Lookup the root symbol of the chain of refs we'll use to access it and serialize it\n                                var chain = lookupSymbolChainWorker(sym, context, meaning);\n                                if (!(sym.flags & 4 /* Property */)) {\n                                    includePrivateSymbol(chain[0]);\n                                }\n                            }\n                            else if (oldcontext.tracker && oldcontext.tracker.trackSymbol) {\n                                oldcontext.tracker.trackSymbol(sym, decl, meaning);\n                            }\n                        } }) });\n                ts.forEachEntry(symbolTable, function (symbol, name) {\n                    var baseName = ts.unescapeLeadingUnderscores(name);\n                    void getInternalSymbolName(symbol, baseName); // Called to cache values into `usedSymbolNames` and `remappedSymbolNames`\n                });\n                var addingDeclare = !bundled;\n                var exportEquals = symbolTable.get(\"export=\" /* ExportEquals */);\n                if (exportEquals && symbolTable.size > 1 && exportEquals.flags & 2097152 /* Alias */) {\n                    symbolTable = ts.createSymbolTable();\n                    // Remove extraneous elements from root symbol table (they'll be mixed back in when the target of the `export=` is looked up)\n                    symbolTable.set(\"export=\" /* ExportEquals */, exportEquals);\n                }\n                visitSymbolTable(symbolTable);\n                return mergeRedundantStatements(results);\n                function isIdentifierAndNotUndefined(node) {\n                    return !!node && node.kind === 78 /* Identifier */;\n                }\n                function getNamesOfDeclaration(statement) {\n                    if (ts.isVariableStatement(statement)) {\n                        return ts.filter(ts.map(statement.declarationList.declarations, ts.getNameOfDeclaration), isIdentifierAndNotUndefined);\n                    }\n                    return ts.filter([ts.getNameOfDeclaration(statement)], isIdentifierAndNotUndefined);\n                }\n                function flattenExportAssignedNamespace(statements) {\n                    var exportAssignment = ts.find(statements, ts.isExportAssignment);\n                    var nsIndex = ts.findIndex(statements, ts.isModuleDeclaration);\n                    var ns = nsIndex !== -1 ? statements[nsIndex] : undefined;\n                    if (ns && exportAssignment && exportAssignment.isExportEquals &&\n                        ts.isIdentifier(exportAssignment.expression) && ts.isIdentifier(ns.name) && ts.idText(ns.name) === ts.idText(exportAssignment.expression) &&\n                        ns.body && ts.isModuleBlock(ns.body)) {\n                        // Pass 0: Correct situations where a module has both an `export = ns` and multiple top-level exports by stripping the export modifiers from\n                        //  the top-level exports and exporting them in the targeted ns, as can occur when a js file has both typedefs and `module.export` assignments\n                        var excessExports = ts.filter(statements, function (s) { return !!(ts.getEffectiveModifierFlags(s) & 1 /* Export */); });\n                        var name_2 = ns.name;\n                        var body = ns.body;\n                        if (ts.length(excessExports)) {\n                            ns = ts.factory.updateModuleDeclaration(ns, ns.decorators, ns.modifiers, ns.name, body = ts.factory.updateModuleBlock(body, ts.factory.createNodeArray(__spreadArray(__spreadArray([], ns.body.statements), [ts.factory.createExportDeclaration(\n                                /*decorators*/ undefined, \n                                /*modifiers*/ undefined, \n                                /*isTypeOnly*/ false, ts.factory.createNamedExports(ts.map(ts.flatMap(excessExports, function (e) { return getNamesOfDeclaration(e); }), function (id) { return ts.factory.createExportSpecifier(/*alias*/ undefined, id); })), \n                                /*moduleSpecifier*/ undefined)]))));\n                            statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, nsIndex)), [ns]), statements.slice(nsIndex + 1));\n                        }\n                        // Pass 1: Flatten `export namespace _exports {} export = _exports;` so long as the `export=` only points at a single namespace declaration\n                        if (!ts.find(statements, function (s) { return s !== ns && ts.nodeHasName(s, name_2); })) {\n                            results = [];\n                            // If the namespace contains no export assignments or declarations, and no declarations flagged with `export`, then _everything_ is exported -\n                            // to respect this as the top level, we need to add an `export` modifier to everything\n                            var mixinExportFlag_1 = !ts.some(body.statements, function (s) { return ts.hasSyntacticModifier(s, 1 /* Export */) || ts.isExportAssignment(s) || ts.isExportDeclaration(s); });\n                            ts.forEach(body.statements, function (s) {\n                                addResult(s, mixinExportFlag_1 ? 1 /* Export */ : 0 /* None */); // Recalculates the ambient (and export, if applicable from above) flag\n                            });\n                            statements = __spreadArray(__spreadArray([], ts.filter(statements, function (s) { return s !== ns && s !== exportAssignment; })), results);\n                        }\n                    }\n                    return statements;\n                }\n                function mergeExportDeclarations(statements) {\n                    // Pass 2: Combine all `export {}` declarations\n                    var exports = ts.filter(statements, function (d) { return ts.isExportDeclaration(d) && !d.moduleSpecifier && !!d.exportClause && ts.isNamedExports(d.exportClause); });\n                    if (ts.length(exports) > 1) {\n                        var nonExports = ts.filter(statements, function (d) { return !ts.isExportDeclaration(d) || !!d.moduleSpecifier || !d.exportClause; });\n                        statements = __spreadArray(__spreadArray([], nonExports), [ts.factory.createExportDeclaration(\n                            /*decorators*/ undefined, \n                            /*modifiers*/ undefined, \n                            /*isTypeOnly*/ false, ts.factory.createNamedExports(ts.flatMap(exports, function (e) { return ts.cast(e.exportClause, ts.isNamedExports).elements; })), \n                            /*moduleSpecifier*/ undefined)]);\n                    }\n                    // Pass 2b: Also combine all `export {} from \"...\"` declarations as needed\n                    var reexports = ts.filter(statements, function (d) { return ts.isExportDeclaration(d) && !!d.moduleSpecifier && !!d.exportClause && ts.isNamedExports(d.exportClause); });\n                    if (ts.length(reexports) > 1) {\n                        var groups = ts.group(reexports, function (decl) { return ts.isStringLiteral(decl.moduleSpecifier) ? \">\" + decl.moduleSpecifier.text : \">\"; });\n                        if (groups.length !== reexports.length) {\n                            var _loop_9 = function (group_1) {\n                                if (group_1.length > 1) {\n                                    // remove group members from statements and then merge group members and add back to statements\n                                    statements = __spreadArray(__spreadArray([], ts.filter(statements, function (s) { return group_1.indexOf(s) === -1; })), [\n                                        ts.factory.createExportDeclaration(\n                                        /*decorators*/ undefined, \n                                        /*modifiers*/ undefined, \n                                        /*isTypeOnly*/ false, ts.factory.createNamedExports(ts.flatMap(group_1, function (e) { return ts.cast(e.exportClause, ts.isNamedExports).elements; })), group_1[0].moduleSpecifier)\n                                    ]);\n                                }\n                            };\n                            for (var _i = 0, groups_1 = groups; _i < groups_1.length; _i++) {\n                                var group_1 = groups_1[_i];\n                                _loop_9(group_1);\n                            }\n                        }\n                    }\n                    return statements;\n                }\n                function inlineExportModifiers(statements) {\n                    // Pass 3: Move all `export {}`'s to `export` modifiers where possible\n                    var index = ts.findIndex(statements, function (d) { return ts.isExportDeclaration(d) && !d.moduleSpecifier && !!d.exportClause && ts.isNamedExports(d.exportClause); });\n                    if (index >= 0) {\n                        var exportDecl = statements[index];\n                        var replacements = ts.mapDefined(exportDecl.exportClause.elements, function (e) {\n                            if (!e.propertyName) {\n                                // export {name} - look thru `statements` for `name`, and if all results can take an `export` modifier, do so and filter it\n                                var indices = ts.indicesOf(statements);\n                                var associatedIndices = ts.filter(indices, function (i) { return ts.nodeHasName(statements[i], e.name); });\n                                if (ts.length(associatedIndices) && ts.every(associatedIndices, function (i) { return canHaveExportModifier(statements[i]); })) {\n                                    for (var _i = 0, associatedIndices_1 = associatedIndices; _i < associatedIndices_1.length; _i++) {\n                                        var index_1 = associatedIndices_1[_i];\n                                        statements[index_1] = addExportModifier(statements[index_1]);\n                                    }\n                                    return undefined;\n                                }\n                            }\n                            return e;\n                        });\n                        if (!ts.length(replacements)) {\n                            // all clauses removed, remove the export declaration\n                            ts.orderedRemoveItemAt(statements, index);\n                        }\n                        else {\n                            // some items filtered, others not - update the export declaration\n                            statements[index] = ts.factory.updateExportDeclaration(exportDecl, exportDecl.decorators, exportDecl.modifiers, exportDecl.isTypeOnly, ts.factory.updateNamedExports(exportDecl.exportClause, replacements), exportDecl.moduleSpecifier);\n                        }\n                    }\n                    return statements;\n                }\n                function mergeRedundantStatements(statements) {\n                    statements = flattenExportAssignedNamespace(statements);\n                    statements = mergeExportDeclarations(statements);\n                    statements = inlineExportModifiers(statements);\n                    // Not a cleanup, but as a final step: If there is a mix of `export` and non-`export` declarations, but no `export =` or `export {}` add a `export {};` so\n                    // declaration privacy is respected.\n                    if (enclosingDeclaration &&\n                        ((ts.isSourceFile(enclosingDeclaration) && ts.isExternalOrCommonJsModule(enclosingDeclaration)) || ts.isModuleDeclaration(enclosingDeclaration)) &&\n                        (!ts.some(statements, ts.isExternalModuleIndicator) || (!ts.hasScopeMarker(statements) && ts.some(statements, ts.needsScopeMarker)))) {\n                        statements.push(ts.createEmptyExports(ts.factory));\n                    }\n                    return statements;\n                }\n                function canHaveExportModifier(node) {\n                    return ts.isEnumDeclaration(node) ||\n                        ts.isVariableStatement(node) ||\n                        ts.isFunctionDeclaration(node) ||\n                        ts.isClassDeclaration(node) ||\n                        (ts.isModuleDeclaration(node) && !ts.isExternalModuleAugmentation(node) && !ts.isGlobalScopeAugmentation(node)) ||\n                        ts.isInterfaceDeclaration(node) ||\n                        isTypeDeclaration(node);\n                }\n                function addExportModifier(node) {\n                    var flags = (ts.getEffectiveModifierFlags(node) | 1 /* Export */) & ~2 /* Ambient */;\n                    return ts.factory.updateModifiers(node, flags);\n                }\n                function removeExportModifier(node) {\n                    var flags = ts.getEffectiveModifierFlags(node) & ~1 /* Export */;\n                    return ts.factory.updateModifiers(node, flags);\n                }\n                function visitSymbolTable(symbolTable, suppressNewPrivateContext, propertyAsAlias) {\n                    if (!suppressNewPrivateContext) {\n                        deferredPrivatesStack.push(new ts.Map());\n                    }\n                    symbolTable.forEach(function (symbol) {\n                        serializeSymbol(symbol, /*isPrivate*/ false, !!propertyAsAlias);\n                    });\n                    if (!suppressNewPrivateContext) {\n                        // deferredPrivates will be filled up by visiting the symbol table\n                        // And will continue to iterate as elements are added while visited `deferredPrivates`\n                        // (As that's how a map iterator is defined to work)\n                        deferredPrivatesStack[deferredPrivatesStack.length - 1].forEach(function (symbol) {\n                            serializeSymbol(symbol, /*isPrivate*/ true, !!propertyAsAlias);\n                        });\n                        deferredPrivatesStack.pop();\n                    }\n                }\n                function serializeSymbol(symbol, isPrivate, propertyAsAlias) {\n                    // cache visited list based on merged symbol, since we want to use the unmerged top-level symbol, but\n                    // still skip reserializing it if we encounter the merged product later on\n                    var visitedSym = getMergedSymbol(symbol);\n                    if (visitedSymbols.has(getSymbolId(visitedSym))) {\n                        return; // Already printed\n                    }\n                    visitedSymbols.add(getSymbolId(visitedSym));\n                    // Only actually serialize symbols within the correct enclosing declaration, otherwise do nothing with the out-of-context symbol\n                    var skipMembershipCheck = !isPrivate; // We only call this on exported symbols when we know they're in the correct scope\n                    if (skipMembershipCheck || (!!ts.length(symbol.declarations) && ts.some(symbol.declarations, function (d) { return !!ts.findAncestor(d, function (n) { return n === enclosingDeclaration; }); }))) {\n                        var oldContext = context;\n                        context = cloneNodeBuilderContext(context);\n                        var result = serializeSymbolWorker(symbol, isPrivate, propertyAsAlias);\n                        context = oldContext;\n                        return result;\n                    }\n                }\n                // Synthesize declarations for a symbol - might be an Interface, a Class, a Namespace, a Type, a Variable (const, let, or var), an Alias\n                // or a merge of some number of those.\n                // An interesting challenge is ensuring that when classes merge with namespaces and interfaces, is keeping\n                // each symbol in only one of the representations\n                // Also, synthesizing a default export of some kind\n                // If it's an alias: emit `export default ref`\n                // If it's a property: emit `export default _default` with a `_default` prop\n                // If it's a class/interface/function: emit a class/interface/function with a `default` modifier\n                // These forms can merge, eg (`export default 12; export default interface A {}`)\n                function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias) {\n                    var symbolName = ts.unescapeLeadingUnderscores(symbol.escapedName);\n                    var isDefault = symbol.escapedName === \"default\" /* Default */;\n                    if (isPrivate && !(context.flags & 131072 /* AllowAnonymousIdentifier */) && ts.isStringANonContextualKeyword(symbolName) && !isDefault) {\n                        // Oh no. We cannot use this symbol's name as it's name... It's likely some jsdoc had an invalid name like `export` or `default` :(\n                        context.encounteredError = true;\n                        // TODO: Issue error via symbol tracker?\n                        return; // If we need to emit a private with a keyword name, we're done for, since something else will try to refer to it by that name\n                    }\n                    var needsPostExportDefault = isDefault && !!(symbol.flags & -113 /* ExportDoesNotSupportDefaultModifier */\n                        || (symbol.flags & 16 /* Function */ && ts.length(getPropertiesOfType(getTypeOfSymbol(symbol))))) && !(symbol.flags & 2097152 /* Alias */); // An alias symbol should preclude needing to make an alias ourselves\n                    var needsExportDeclaration = !needsPostExportDefault && !isPrivate && ts.isStringANonContextualKeyword(symbolName) && !isDefault;\n                    // `serializeVariableOrProperty` will handle adding the export declaration if it is run (since `getInternalSymbolName` will create the name mapping), so we need to ensuer we unset `needsExportDeclaration` if it is\n                    if (needsPostExportDefault || needsExportDeclaration) {\n                        isPrivate = true;\n                    }\n                    var modifierFlags = (!isPrivate ? 1 /* Export */ : 0) | (isDefault && !needsPostExportDefault ? 512 /* Default */ : 0);\n                    var isConstMergedWithNS = symbol.flags & 1536 /* Module */ &&\n                        symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) &&\n                        symbol.escapedName !== \"export=\" /* ExportEquals */;\n                    var isConstMergedWithNSPrintableAsSignatureMerge = isConstMergedWithNS && isTypeRepresentableAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol);\n                    if (symbol.flags & (16 /* Function */ | 8192 /* Method */) || isConstMergedWithNSPrintableAsSignatureMerge) {\n                        serializeAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol, getInternalSymbolName(symbol, symbolName), modifierFlags);\n                    }\n                    if (symbol.flags & 524288 /* TypeAlias */) {\n                        serializeTypeAlias(symbol, symbolName, modifierFlags);\n                    }\n                    // Need to skip over export= symbols below - json source files get a single `Property` flagged\n                    // symbol of name `export=` which needs to be handled like an alias. It's not great, but it is what it is.\n                    if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */)\n                        && symbol.escapedName !== \"export=\" /* ExportEquals */\n                        && !(symbol.flags & 4194304 /* Prototype */)\n                        && !(symbol.flags & 32 /* Class */)\n                        && !isConstMergedWithNSPrintableAsSignatureMerge) {\n                        if (propertyAsAlias) {\n                            var createdExport = serializeMaybeAliasAssignment(symbol);\n                            if (createdExport) {\n                                needsExportDeclaration = false;\n                                needsPostExportDefault = false;\n                            }\n                        }\n                        else {\n                            var type = getTypeOfSymbol(symbol);\n                            var localName = getInternalSymbolName(symbol, symbolName);\n                            if (!(symbol.flags & 16 /* Function */) && isTypeRepresentableAsFunctionNamespaceMerge(type, symbol)) {\n                                // If the type looks like a function declaration + ns could represent it, and it's type is sourced locally, rewrite it into a function declaration + ns\n                                serializeAsFunctionNamespaceMerge(type, symbol, localName, modifierFlags);\n                            }\n                            else {\n                                // A Class + Property merge is made for a `module.exports.Member = class {}`, and it doesn't serialize well as either a class _or_ a property symbol - in fact, _it behaves like an alias!_\n                                // `var` is `FunctionScopedVariable`, `const` and `let` are `BlockScopedVariable`, and `module.exports.thing =` is `Property`\n                                var flags = !(symbol.flags & 2 /* BlockScopedVariable */) ? undefined\n                                    : isConstVariable(symbol) ? 2 /* Const */\n                                        : 1 /* Let */;\n                                var name = (needsPostExportDefault || !(symbol.flags & 4 /* Property */)) ? localName : getUnusedName(localName, symbol);\n                                var textRange = symbol.declarations && ts.find(symbol.declarations, function (d) { return ts.isVariableDeclaration(d); });\n                                if (textRange && ts.isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) {\n                                    textRange = textRange.parent.parent;\n                                }\n                                var propertyAccessRequire = ts.find(symbol.declarations, ts.isPropertyAccessExpression);\n                                if (propertyAccessRequire && ts.isBinaryExpression(propertyAccessRequire.parent) && ts.isIdentifier(propertyAccessRequire.parent.right)\n                                    && type.symbol && ts.isSourceFile(type.symbol.valueDeclaration)) {\n                                    var alias = localName === propertyAccessRequire.parent.right.escapedText ? undefined : propertyAccessRequire.parent.right;\n                                    addResult(ts.factory.createExportDeclaration(\n                                    /*decorators*/ undefined, \n                                    /*modifiers*/ undefined, \n                                    /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(alias, localName)])), 0 /* None */);\n                                    context.tracker.trackSymbol(type.symbol, context.enclosingDeclaration, 111551 /* Value */);\n                                }\n                                else {\n                                    var statement = ts.setTextRange(ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([\n                                        ts.factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled))\n                                    ], flags)), textRange);\n                                    addResult(statement, name !== localName ? modifierFlags & ~1 /* Export */ : modifierFlags);\n                                    if (name !== localName && !isPrivate) {\n                                        // We rename the variable declaration we generate for Property symbols since they may have a name which\n                                        // conflicts with a local declaration. For example, given input:\n                                        // ```\n                                        // function g() {}\n                                        // module.exports.g = g\n                                        // ```\n                                        // In such a situation, we have a local variable named `g`, and a separate exported variable named `g`.\n                                        // Naively, we would emit\n                                        // ```\n                                        // function g() {}\n                                        // export const g: typeof g;\n                                        // ```\n                                        // That's obviously incorrect - the `g` in the type annotation needs to refer to the local `g`, but\n                                        // the export declaration shadows it.\n                                        // To work around that, we instead write\n                                        // ```\n                                        // function g() {}\n                                        // const g_1: typeof g;\n                                        // export { g_1 as g };\n                                        // ```\n                                        // To create an export named `g` that does _not_ shadow the local `g`\n                                        addResult(ts.factory.createExportDeclaration(\n                                        /*decorators*/ undefined, \n                                        /*modifiers*/ undefined, \n                                        /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0 /* None */);\n                                        needsExportDeclaration = false;\n                                        needsPostExportDefault = false;\n                                    }\n                                }\n                            }\n                        }\n                    }\n                    if (symbol.flags & 384 /* Enum */) {\n                        serializeEnum(symbol, symbolName, modifierFlags);\n                    }\n                    if (symbol.flags & 32 /* Class */) {\n                        if (symbol.flags & 4 /* Property */ && ts.isBinaryExpression(symbol.valueDeclaration.parent) && ts.isClassExpression(symbol.valueDeclaration.parent.right)) {\n                            // Looks like a `module.exports.Sub = class {}` - if we serialize `symbol` as a class, the result will have no members,\n                            // since the classiness is actually from the target of the effective alias the symbol is. yes. A BlockScopedVariable|Class|Property\n                            // _really_ acts like an Alias, and none of a BlockScopedVariable, Class, or Property. This is the travesty of JS binding today.\n                            serializeAsAlias(symbol, getInternalSymbolName(symbol, symbolName), modifierFlags);\n                        }\n                        else {\n                            serializeAsClass(symbol, getInternalSymbolName(symbol, symbolName), modifierFlags);\n                        }\n                    }\n                    if ((symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && (!isConstMergedWithNS || isTypeOnlyNamespace(symbol))) || isConstMergedWithNSPrintableAsSignatureMerge) {\n                        serializeModule(symbol, symbolName, modifierFlags);\n                    }\n                    // The class meaning serialization should handle serializing all interface members\n                    if (symbol.flags & 64 /* Interface */ && !(symbol.flags & 32 /* Class */)) {\n                        serializeInterface(symbol, symbolName, modifierFlags);\n                    }\n                    if (symbol.flags & 2097152 /* Alias */) {\n                        serializeAsAlias(symbol, getInternalSymbolName(symbol, symbolName), modifierFlags);\n                    }\n                    if (symbol.flags & 4 /* Property */ && symbol.escapedName === \"export=\" /* ExportEquals */) {\n                        serializeMaybeAliasAssignment(symbol);\n                    }\n                    if (symbol.flags & 8388608 /* ExportStar */) {\n                        // synthesize export * from \"moduleReference\"\n                        // Straightforward - only one thing to do - make an export declaration\n                        for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                            var node = _a[_i];\n                            var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier);\n                            if (!resolvedModule)\n                                continue;\n                            addResult(ts.factory.createExportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ false, /*exportClause*/ undefined, ts.factory.createStringLiteral(getSpecifierForModuleSymbol(resolvedModule, context))), 0 /* None */);\n                        }\n                    }\n                    if (needsPostExportDefault) {\n                        addResult(ts.factory.createExportAssignment(/*decorators*/ undefined, /*modifiers*/ undefined, /*isExportAssignment*/ false, ts.factory.createIdentifier(getInternalSymbolName(symbol, symbolName))), 0 /* None */);\n                    }\n                    else if (needsExportDeclaration) {\n                        addResult(ts.factory.createExportDeclaration(\n                        /*decorators*/ undefined, \n                        /*modifiers*/ undefined, \n                        /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(getInternalSymbolName(symbol, symbolName), symbolName)])), 0 /* None */);\n                    }\n                }\n                function includePrivateSymbol(symbol) {\n                    if (ts.some(symbol.declarations, ts.isParameterDeclaration))\n                        return;\n                    ts.Debug.assertIsDefined(deferredPrivatesStack[deferredPrivatesStack.length - 1]);\n                    getUnusedName(ts.unescapeLeadingUnderscores(symbol.escapedName), symbol); // Call to cache unique name for symbol\n                    // Blanket moving (import) aliases into the root private context should work, since imports are not valid within namespaces\n                    // (so they must have been in the root to begin with if they were real imports) cjs `require` aliases (an upcoming feature)\n                    // will throw a wrench in this, since those may have been nested, but we'll need to synthesize them in the outer scope\n                    // anyway, as that's the only place the import they translate to is valid. In such a case, we might need to use a unique name\n                    // for the moved import; which hopefully the above `getUnusedName` call should produce.\n                    var isExternalImportAlias = !!(symbol.flags & 2097152 /* Alias */) && !ts.some(symbol.declarations, function (d) {\n                        return !!ts.findAncestor(d, ts.isExportDeclaration) ||\n                            ts.isNamespaceExport(d) ||\n                            (ts.isImportEqualsDeclaration(d) && !ts.isExternalModuleReference(d.moduleReference));\n                    });\n                    deferredPrivatesStack[isExternalImportAlias ? 0 : (deferredPrivatesStack.length - 1)].set(getSymbolId(symbol), symbol);\n                }\n                function isExportingScope(enclosingDeclaration) {\n                    return ((ts.isSourceFile(enclosingDeclaration) && (ts.isExternalOrCommonJsModule(enclosingDeclaration) || ts.isJsonSourceFile(enclosingDeclaration))) ||\n                        (ts.isAmbientModule(enclosingDeclaration) && !ts.isGlobalScopeAugmentation(enclosingDeclaration)));\n                }\n                // Prepends a `declare` and/or `export` modifier if the context requires it, and then adds `node` to `result` and returns `node`\n                function addResult(node, additionalModifierFlags) {\n                    if (ts.canHaveModifiers(node)) {\n                        var newModifierFlags = 0 /* None */;\n                        var enclosingDeclaration_1 = context.enclosingDeclaration &&\n                            (ts.isJSDocTypeAlias(context.enclosingDeclaration) ? ts.getSourceFileOfNode(context.enclosingDeclaration) : context.enclosingDeclaration);\n                        if (additionalModifierFlags & 1 /* Export */ &&\n                            enclosingDeclaration_1 && (isExportingScope(enclosingDeclaration_1) || ts.isModuleDeclaration(enclosingDeclaration_1)) &&\n                            canHaveExportModifier(node)) {\n                            // Classes, namespaces, variables, functions, interfaces, and types should all be `export`ed in a module context if not private\n                            newModifierFlags |= 1 /* Export */;\n                        }\n                        if (addingDeclare && !(newModifierFlags & 1 /* Export */) &&\n                            (!enclosingDeclaration_1 || !(enclosingDeclaration_1.flags & 8388608 /* Ambient */)) &&\n                            (ts.isEnumDeclaration(node) || ts.isVariableStatement(node) || ts.isFunctionDeclaration(node) || ts.isClassDeclaration(node) || ts.isModuleDeclaration(node))) {\n                            // Classes, namespaces, variables, enums, and functions all need `declare` modifiers to be valid in a declaration file top-level scope\n                            newModifierFlags |= 2 /* Ambient */;\n                        }\n                        if ((additionalModifierFlags & 512 /* Default */) && (ts.isClassDeclaration(node) || ts.isInterfaceDeclaration(node) || ts.isFunctionDeclaration(node))) {\n                            newModifierFlags |= 512 /* Default */;\n                        }\n                        if (newModifierFlags) {\n                            node = ts.factory.updateModifiers(node, newModifierFlags | ts.getEffectiveModifierFlags(node));\n                        }\n                    }\n                    results.push(node);\n                }\n                function serializeTypeAlias(symbol, symbolName, modifierFlags) {\n                    var aliasType = getDeclaredTypeOfTypeAlias(symbol);\n                    var typeParams = getSymbolLinks(symbol).typeParameters;\n                    var typeParamDecls = ts.map(typeParams, function (p) { return typeParameterToDeclaration(p, context); });\n                    var jsdocAliasDecl = ts.find(symbol.declarations, ts.isJSDocTypeAlias);\n                    var commentText = jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : undefined;\n                    var oldFlags = context.flags;\n                    context.flags |= 8388608 /* InTypeAlias */;\n                    var oldEnclosingDecl = context.enclosingDeclaration;\n                    context.enclosingDeclaration = jsdocAliasDecl;\n                    var typeNode = jsdocAliasDecl && jsdocAliasDecl.typeExpression\n                        && ts.isJSDocTypeExpression(jsdocAliasDecl.typeExpression)\n                        && serializeExistingTypeNode(context, jsdocAliasDecl.typeExpression.type, includePrivateSymbol, bundled)\n                        || typeToTypeNodeHelper(aliasType, context);\n                    addResult(ts.setSyntheticLeadingComments(ts.factory.createTypeAliasDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, getInternalSymbolName(symbol, symbolName), typeParamDecls, typeNode), !commentText ? [] : [{ kind: 3 /* MultiLineCommentTrivia */, text: \"*\\n * \" + commentText.replace(/\\n/g, \"\\n * \") + \"\\n \", pos: -1, end: -1, hasTrailingNewLine: true }]), modifierFlags);\n                    context.flags = oldFlags;\n                    context.enclosingDeclaration = oldEnclosingDecl;\n                }\n                function serializeInterface(symbol, symbolName, modifierFlags) {\n                    var interfaceType = getDeclaredTypeOfClassOrInterface(symbol);\n                    var localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol);\n                    var typeParamDecls = ts.map(localParams, function (p) { return typeParameterToDeclaration(p, context); });\n                    var baseTypes = getBaseTypes(interfaceType);\n                    var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined;\n                    var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); });\n                    var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 169 /* CallSignature */);\n                    var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 170 /* ConstructSignature */);\n                    var indexSignatures = serializeIndexSignatures(interfaceType, baseType);\n                    var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.factory.createHeritageClause(93 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b, 111551 /* Value */); }))];\n                    addResult(ts.factory.createInterfaceDeclaration(\n                    /*decorators*/ undefined, \n                    /*modifiers*/ undefined, getInternalSymbolName(symbol, symbolName), typeParamDecls, heritageClauses, __spreadArray(__spreadArray(__spreadArray(__spreadArray([], indexSignatures), constructSignatures), callSignatures), members)), modifierFlags);\n                }\n                function getNamespaceMembersForSerialization(symbol) {\n                    return !symbol.exports ? [] : ts.filter(ts.arrayFrom(symbol.exports.values()), isNamespaceMember);\n                }\n                function isTypeOnlyNamespace(symbol) {\n                    return ts.every(getNamespaceMembersForSerialization(symbol), function (m) { return !(resolveSymbol(m).flags & 111551 /* Value */); });\n                }\n                function serializeModule(symbol, symbolName, modifierFlags) {\n                    var members = getNamespaceMembersForSerialization(symbol);\n                    // Split NS members up by declaration - members whose parent symbol is the ns symbol vs those whose is not (but were added in later via merging)\n                    var locationMap = ts.arrayToMultiMap(members, function (m) { return m.parent && m.parent === symbol ? \"real\" : \"merged\"; });\n                    var realMembers = locationMap.get(\"real\") || ts.emptyArray;\n                    var mergedMembers = locationMap.get(\"merged\") || ts.emptyArray;\n                    // TODO: `suppressNewPrivateContext` is questionable -we need to simply be emitting privates in whatever scope they were declared in, rather\n                    // than whatever scope we traverse to them in. That's a bit of a complex rewrite, since we're not _actually_ tracking privates at all in advance,\n                    // so we don't even have placeholders to fill in.\n                    if (ts.length(realMembers)) {\n                        var localName = getInternalSymbolName(symbol, symbolName);\n                        serializeAsNamespaceDeclaration(realMembers, localName, modifierFlags, !!(symbol.flags & (16 /* Function */ | 67108864 /* Assignment */)));\n                    }\n                    if (ts.length(mergedMembers)) {\n                        var containingFile_1 = ts.getSourceFileOfNode(context.enclosingDeclaration);\n                        var localName = getInternalSymbolName(symbol, symbolName);\n                        var nsBody = ts.factory.createModuleBlock([ts.factory.createExportDeclaration(\n                            /*decorators*/ undefined, \n                            /*modifiers*/ undefined, \n                            /*isTypeOnly*/ false, ts.factory.createNamedExports(ts.mapDefined(ts.filter(mergedMembers, function (n) { return n.escapedName !== \"export=\" /* ExportEquals */; }), function (s) {\n                                var _a, _b;\n                                var name = ts.unescapeLeadingUnderscores(s.escapedName);\n                                var localName = getInternalSymbolName(s, name);\n                                var aliasDecl = s.declarations && getDeclarationOfAliasSymbol(s);\n                                if (containingFile_1 && (aliasDecl ? containingFile_1 !== ts.getSourceFileOfNode(aliasDecl) : !ts.some(s.declarations, function (d) { return ts.getSourceFileOfNode(d) === containingFile_1; }))) {\n                                    (_b = (_a = context.tracker) === null || _a === void 0 ? void 0 : _a.reportNonlocalAugmentation) === null || _b === void 0 ? void 0 : _b.call(_a, containingFile_1, symbol, s);\n                                    return undefined;\n                                }\n                                var target = aliasDecl && getTargetOfAliasDeclaration(aliasDecl, /*dontRecursivelyResolve*/ true);\n                                includePrivateSymbol(target || s);\n                                var targetName = target ? getInternalSymbolName(target, ts.unescapeLeadingUnderscores(target.escapedName)) : localName;\n                                return ts.factory.createExportSpecifier(name === targetName ? undefined : targetName, name);\n                            })))]);\n                        addResult(ts.factory.createModuleDeclaration(\n                        /*decorators*/ undefined, \n                        /*modifiers*/ undefined, ts.factory.createIdentifier(localName), nsBody, 16 /* Namespace */), 0 /* None */);\n                    }\n                }\n                function serializeEnum(symbol, symbolName, modifierFlags) {\n                    addResult(ts.factory.createEnumDeclaration(\n                    /*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ? 2048 /* Const */ : 0), getInternalSymbolName(symbol, symbolName), ts.map(ts.filter(getPropertiesOfType(getTypeOfSymbol(symbol)), function (p) { return !!(p.flags & 8 /* EnumMember */); }), function (p) {\n                        // TODO: Handle computed names\n                        // I hate that to get the initialized value we need to walk back to the declarations here; but there's no\n                        // other way to get the possible const value of an enum member that I'm aware of, as the value is cached\n                        // _on the declaration_, not on the declaration's symbol...\n                        var initializedValue = p.declarations && p.declarations[0] && ts.isEnumMember(p.declarations[0]) ? getConstantValue(p.declarations[0]) : undefined;\n                        return ts.factory.createEnumMember(ts.unescapeLeadingUnderscores(p.escapedName), initializedValue === undefined ? undefined :\n                            typeof initializedValue === \"string\" ? ts.factory.createStringLiteral(initializedValue) :\n                                ts.factory.createNumericLiteral(initializedValue));\n                    })), modifierFlags);\n                }\n                function serializeAsFunctionNamespaceMerge(type, symbol, localName, modifierFlags) {\n                    var signatures = getSignaturesOfType(type, 0 /* Call */);\n                    for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) {\n                        var sig = signatures_2[_i];\n                        // Each overload becomes a separate function declaration, in order\n                        var decl = signatureToSignatureDeclarationHelper(sig, 251 /* FunctionDeclaration */, context, { name: ts.factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled });\n                        // for expressions assigned to `var`s, use the `var` as the text range\n                        addResult(ts.setTextRange(decl, sig.declaration && ts.isVariableDeclaration(sig.declaration.parent) && sig.declaration.parent.parent || sig.declaration), modifierFlags);\n                    }\n                    // Module symbol emit will take care of module-y members, provided it has exports\n                    if (!(symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && !!symbol.exports && !!symbol.exports.size)) {\n                        var props = ts.filter(getPropertiesOfType(type), isNamespaceMember);\n                        serializeAsNamespaceDeclaration(props, localName, modifierFlags, /*suppressNewPrivateContext*/ true);\n                    }\n                }\n                function serializeAsNamespaceDeclaration(props, localName, modifierFlags, suppressNewPrivateContext) {\n                    if (ts.length(props)) {\n                        var localVsRemoteMap = ts.arrayToMultiMap(props, function (p) {\n                            return !ts.length(p.declarations) || ts.some(p.declarations, function (d) {\n                                return ts.getSourceFileOfNode(d) === ts.getSourceFileOfNode(context.enclosingDeclaration);\n                            }) ? \"local\" : \"remote\";\n                        });\n                        var localProps = localVsRemoteMap.get(\"local\") || ts.emptyArray;\n                        // handle remote props first - we need to make an `import` declaration that points at the module containing each remote\n                        // prop in the outermost scope (TODO: a namespace within a namespace would need to be appropriately handled by this)\n                        // Example:\n                        // import Foo_1 = require(\"./exporter\");\n                        // export namespace ns {\n                        //     import Foo = Foo_1.Foo;\n                        //     export { Foo };\n                        //     export const c: number;\n                        // }\n                        // This is needed because in JS, statements like `const x = require(\"./f\")` support both type and value lookup, even if they're\n                        // normally just value lookup (so it functions kinda like an alias even when it's not an alias)\n                        // _Usually_, we'll simply print the top-level as an alias instead of a `var` in such situations, however is is theoretically\n                        // possible to encounter a situation where a type has members from both the current file and other files - in those situations,\n                        // emit akin to the above would be needed.\n                        // Add a namespace\n                        // Create namespace as non-synthetic so it is usable as an enclosing declaration\n                        var fakespace = ts.parseNodeFactory.createModuleDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createIdentifier(localName), ts.factory.createModuleBlock([]), 16 /* Namespace */);\n                        ts.setParent(fakespace, enclosingDeclaration);\n                        fakespace.locals = ts.createSymbolTable(props);\n                        fakespace.symbol = props[0].parent;\n                        var oldResults = results;\n                        results = [];\n                        var oldAddingDeclare = addingDeclare;\n                        addingDeclare = false;\n                        var subcontext = __assign(__assign({}, context), { enclosingDeclaration: fakespace });\n                        var oldContext = context;\n                        context = subcontext;\n                        // TODO: implement handling for the localVsRemoteMap.get(\"remote\") - should be difficult to trigger (see comment above), as only interesting cross-file js merges should make this possible\n                        visitSymbolTable(ts.createSymbolTable(localProps), suppressNewPrivateContext, /*propertyAsAlias*/ true);\n                        context = oldContext;\n                        addingDeclare = oldAddingDeclare;\n                        var declarations = results;\n                        results = oldResults;\n                        // replace namespace with synthetic version\n                        var defaultReplaced = ts.map(declarations, function (d) { return ts.isExportAssignment(d) && !d.isExportEquals && ts.isIdentifier(d.expression) ? ts.factory.createExportDeclaration(\n                        /*decorators*/ undefined, \n                        /*modifiers*/ undefined, \n                        /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(d.expression, ts.factory.createIdentifier(\"default\" /* Default */))])) : d; });\n                        var exportModifierStripped = ts.every(defaultReplaced, function (d) { return ts.hasSyntacticModifier(d, 1 /* Export */); }) ? ts.map(defaultReplaced, removeExportModifier) : defaultReplaced;\n                        fakespace = ts.factory.updateModuleDeclaration(fakespace, fakespace.decorators, fakespace.modifiers, fakespace.name, ts.factory.createModuleBlock(exportModifierStripped));\n                        addResult(fakespace, modifierFlags); // namespaces can never be default exported\n                    }\n                }\n                function isNamespaceMember(p) {\n                    return !!(p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) ||\n                        !(p.flags & 4194304 /* Prototype */ || p.escapedName === \"prototype\" || p.valueDeclaration && ts.getEffectiveModifierFlags(p.valueDeclaration) & 32 /* Static */ && ts.isClassLike(p.valueDeclaration.parent));\n                }\n                function sanitizeJSDocImplements(clauses) {\n                    var result = ts.mapDefined(clauses, function (e) {\n                        var _a;\n                        var oldEnclosing = context.enclosingDeclaration;\n                        context.enclosingDeclaration = e;\n                        var expr = e.expression;\n                        if (ts.isEntityNameExpression(expr)) {\n                            if (ts.isIdentifier(expr) && ts.idText(expr) === \"\") {\n                                return cleanup(/*result*/ undefined); // Empty heritage clause, should be an error, but prefer emitting no heritage clauses to reemitting the empty one\n                            }\n                            var introducesError = void 0;\n                            (_a = trackExistingEntityName(expr, context, includePrivateSymbol), introducesError = _a.introducesError, expr = _a.node);\n                            if (introducesError) {\n                                return cleanup(/*result*/ undefined);\n                            }\n                        }\n                        return cleanup(ts.factory.createExpressionWithTypeArguments(expr, ts.map(e.typeArguments, function (a) {\n                            return serializeExistingTypeNode(context, a, includePrivateSymbol, bundled)\n                                || typeToTypeNodeHelper(getTypeFromTypeNode(a), context);\n                        })));\n                        function cleanup(result) {\n                            context.enclosingDeclaration = oldEnclosing;\n                            return result;\n                        }\n                    });\n                    if (result.length === clauses.length) {\n                        return result;\n                    }\n                    return undefined;\n                }\n                function serializeAsClass(symbol, localName, modifierFlags) {\n                    var _a;\n                    var originalDecl = ts.find(symbol.declarations, ts.isClassLike);\n                    var oldEnclosing = context.enclosingDeclaration;\n                    context.enclosingDeclaration = originalDecl || oldEnclosing;\n                    var localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol);\n                    var typeParamDecls = ts.map(localParams, function (p) { return typeParameterToDeclaration(p, context); });\n                    var classType = getDeclaredTypeOfClassOrInterface(symbol);\n                    var baseTypes = getBaseTypes(classType);\n                    var originalImplements = originalDecl && ts.getEffectiveImplementsTypeNodes(originalDecl);\n                    var implementsExpressions = originalImplements && sanitizeJSDocImplements(originalImplements)\n                        || ts.mapDefined(getImplementsTypes(classType), serializeImplementedType);\n                    var staticType = getTypeOfSymbol(symbol);\n                    var isClass = !!((_a = staticType.symbol) === null || _a === void 0 ? void 0 : _a.valueDeclaration) && ts.isClassLike(staticType.symbol.valueDeclaration);\n                    var staticBaseType = isClass\n                        ? getBaseConstructorTypeOfClass(staticType)\n                        : anyType;\n                    var heritageClauses = __spreadArray(__spreadArray([], !ts.length(baseTypes) ? [] : [ts.factory.createHeritageClause(93 /* ExtendsKeyword */, ts.map(baseTypes, function (b) { return serializeBaseType(b, staticBaseType, localName); }))]), !ts.length(implementsExpressions) ? [] : [ts.factory.createHeritageClause(116 /* ImplementsKeyword */, implementsExpressions)]);\n                    var symbolProps = getNonInterhitedProperties(classType, baseTypes, getPropertiesOfType(classType));\n                    var publicSymbolProps = ts.filter(symbolProps, function (s) {\n                        // `valueDeclaration` could be undefined if inherited from\n                        // a union/intersection base type, but inherited properties\n                        // don't matter here.\n                        var valueDecl = s.valueDeclaration;\n                        return valueDecl && !(ts.isNamedDeclaration(valueDecl) && ts.isPrivateIdentifier(valueDecl.name));\n                    });\n                    var hasPrivateIdentifier = ts.some(symbolProps, function (s) {\n                        // `valueDeclaration` could be undefined if inherited from\n                        // a union/intersection base type, but inherited properties\n                        // don't matter here.\n                        var valueDecl = s.valueDeclaration;\n                        return valueDecl && ts.isNamedDeclaration(valueDecl) && ts.isPrivateIdentifier(valueDecl.name);\n                    });\n                    // Boil down all private properties into a single one.\n                    var privateProperties = hasPrivateIdentifier ?\n                        [ts.factory.createPropertyDeclaration(\n                            /*decorators*/ undefined, \n                            /*modifiers*/ undefined, ts.factory.createPrivateIdentifier(\"#private\"), \n                            /*questionOrExclamationToken*/ undefined, \n                            /*type*/ undefined, \n                            /*initializer*/ undefined)] :\n                        ts.emptyArray;\n                    var publicProperties = ts.flatMap(publicSymbolProps, function (p) { return serializePropertySymbolForClass(p, /*isStatic*/ false, baseTypes[0]); });\n                    // Consider static members empty if symbol also has function or module meaning - function namespacey emit will handle statics\n                    var staticMembers = ts.flatMap(ts.filter(getPropertiesOfType(staticType), function (p) { return !(p.flags & 4194304 /* Prototype */) && p.escapedName !== \"prototype\" && !isNamespaceMember(p); }), function (p) { return serializePropertySymbolForClass(p, /*isStatic*/ true, staticBaseType); });\n                    // When we encounter an `X.prototype.y` assignment in a JS file, we bind `X` as a class regardless as to whether\n                    // the value is ever initialized with a class or function-like value. For cases where `X` could never be\n                    // created via `new`, we will inject a `private constructor()` declaration to indicate it is not createable.\n                    var isNonConstructableClassLikeInJsFile = !isClass &&\n                        !!symbol.valueDeclaration &&\n                        ts.isInJSFile(symbol.valueDeclaration) &&\n                        !ts.some(getSignaturesOfType(staticType, 1 /* Construct */));\n                    var constructors = isNonConstructableClassLikeInJsFile ?\n                        [ts.factory.createConstructorDeclaration(/*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags(8 /* Private */), [], /*body*/ undefined)] :\n                        serializeSignatures(1 /* Construct */, staticType, staticBaseType, 166 /* Constructor */);\n                    var indexSignatures = serializeIndexSignatures(classType, baseTypes[0]);\n                    context.enclosingDeclaration = oldEnclosing;\n                    addResult(ts.setTextRange(ts.factory.createClassDeclaration(\n                    /*decorators*/ undefined, \n                    /*modifiers*/ undefined, localName, typeParamDecls, heritageClauses, __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], indexSignatures), staticMembers), constructors), publicProperties), privateProperties)), symbol.declarations && ts.filter(symbol.declarations, function (d) { return ts.isClassDeclaration(d) || ts.isClassExpression(d); })[0]), modifierFlags);\n                }\n                function serializeAsAlias(symbol, localName, modifierFlags) {\n                    var _a, _b, _c, _d, _e;\n                    // synthesize an alias, eg `export { symbolName as Name }`\n                    // need to mark the alias `symbol` points at\n                    // as something we need to serialize as a private declaration as well\n                    var node = getDeclarationOfAliasSymbol(symbol);\n                    if (!node)\n                        return ts.Debug.fail();\n                    var target = getMergedSymbol(getTargetOfAliasDeclaration(node, /*dontRecursivelyResolve*/ true));\n                    if (!target) {\n                        return;\n                    }\n                    var verbatimTargetName = ts.unescapeLeadingUnderscores(target.escapedName);\n                    if (verbatimTargetName === \"export=\" /* ExportEquals */ && (compilerOptions.esModuleInterop || compilerOptions.allowSyntheticDefaultImports)) {\n                        // target refers to an `export=` symbol that was hoisted into a synthetic default - rename here to match\n                        verbatimTargetName = \"default\" /* Default */;\n                    }\n                    var targetName = getInternalSymbolName(target, verbatimTargetName);\n                    includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first\n                    switch (node.kind) {\n                        case 198 /* BindingElement */:\n                            if (((_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.kind) === 249 /* VariableDeclaration */) {\n                                // const { SomeClass } = require('./lib');\n                                var specifier_1 = getSpecifierForModuleSymbol(target.parent || target, context); // './lib'\n                                var propertyName = node.propertyName;\n                                addResult(ts.factory.createImportDeclaration(\n                                /*decorators*/ undefined, \n                                /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, ts.factory.createNamedImports([ts.factory.createImportSpecifier(propertyName && ts.isIdentifier(propertyName) ? ts.factory.createIdentifier(ts.idText(propertyName)) : undefined, ts.factory.createIdentifier(localName))])), ts.factory.createStringLiteral(specifier_1)), 0 /* None */);\n                                break;\n                            }\n                            // We don't know how to serialize this (nested?) binding element\n                            ts.Debug.failBadSyntaxKind(((_c = node.parent) === null || _c === void 0 ? void 0 : _c.parent) || node, \"Unhandled binding element grandparent kind in declaration serialization\");\n                            break;\n                        case 289 /* ShorthandPropertyAssignment */:\n                            if (((_e = (_d = node.parent) === null || _d === void 0 ? void 0 : _d.parent) === null || _e === void 0 ? void 0 : _e.kind) === 216 /* BinaryExpression */) {\n                                // module.exports = { SomeClass }\n                                serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), targetName);\n                            }\n                            break;\n                        case 249 /* VariableDeclaration */:\n                            // commonjs require: const x = require('y')\n                            if (ts.isPropertyAccessExpression(node.initializer)) {\n                                // const x = require('y').z\n                                var initializer = node.initializer; // require('y').z\n                                var uniqueName = ts.factory.createUniqueName(localName); // _x\n                                var specifier_2 = getSpecifierForModuleSymbol(target.parent || target, context); // 'y'\n                                // import _x = require('y');\n                                addResult(ts.factory.createImportEqualsDeclaration(\n                                /*decorators*/ undefined, \n                                /*modifiers*/ undefined, \n                                /*isTypeOnly*/ false, uniqueName, ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(specifier_2))), 0 /* None */);\n                                // import x = _x.z\n                                addResult(ts.factory.createImportEqualsDeclaration(\n                                /*decorators*/ undefined, \n                                /*modifiers*/ undefined, \n                                /*isTypeOnly*/ false, ts.factory.createIdentifier(localName), ts.factory.createQualifiedName(uniqueName, initializer.name)), modifierFlags);\n                                break;\n                            }\n                        // else fall through and treat commonjs require just like import=\n                        case 260 /* ImportEqualsDeclaration */:\n                            // This _specifically_ only exists to handle json declarations - where we make aliases, but since\n                            // we emit no declarations for the json document, must not refer to it in the declarations\n                            if (target.escapedName === \"export=\" /* ExportEquals */ && ts.some(target.declarations, ts.isJsonSourceFile)) {\n                                serializeMaybeAliasAssignment(symbol);\n                                break;\n                            }\n                            // Could be a local `import localName = ns.member` or\n                            // an external `import localName = require(\"whatever\")`\n                            var isLocalImport = !(target.flags & 512 /* ValueModule */) && !ts.isVariableDeclaration(node);\n                            addResult(ts.factory.createImportEqualsDeclaration(\n                            /*decorators*/ undefined, \n                            /*modifiers*/ undefined, \n                            /*isTypeOnly*/ false, ts.factory.createIdentifier(localName), isLocalImport\n                                ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false)\n                                : ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)))), isLocalImport ? modifierFlags : 0 /* None */);\n                            break;\n                        case 259 /* NamespaceExportDeclaration */:\n                            // export as namespace foo\n                            // TODO: Not part of a file's local or export symbol tables\n                            // Is bound into file.symbol.globalExports instead, which we don't currently traverse\n                            addResult(ts.factory.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */);\n                            break;\n                        case 262 /* ImportClause */:\n                            addResult(ts.factory.createImportDeclaration(\n                            /*decorators*/ undefined, \n                            /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, ts.factory.createIdentifier(localName), /*namedBindings*/ undefined), \n                            // We use `target.parent || target` below as `target.parent` is unset when the target is a module which has been export assigned\n                            // And then made into a default by the `esModuleInterop` or `allowSyntheticDefaultImports` flag\n                            // In such cases, the `target` refers to the module itself already\n                            ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */);\n                            break;\n                        case 263 /* NamespaceImport */:\n                            addResult(ts.factory.createImportDeclaration(\n                            /*decorators*/ undefined, \n                            /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*importClause*/ undefined, ts.factory.createNamespaceImport(ts.factory.createIdentifier(localName))), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */);\n                            break;\n                        case 269 /* NamespaceExport */:\n                            addResult(ts.factory.createExportDeclaration(\n                            /*decorators*/ undefined, \n                            /*modifiers*/ undefined, \n                            /*isTypeOnly*/ false, ts.factory.createNamespaceExport(ts.factory.createIdentifier(localName)), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */);\n                            break;\n                        case 265 /* ImportSpecifier */:\n                            addResult(ts.factory.createImportDeclaration(\n                            /*decorators*/ undefined, \n                            /*modifiers*/ undefined, ts.factory.createImportClause(\n                            /*isTypeOnly*/ false, \n                            /*importClause*/ undefined, ts.factory.createNamedImports([\n                                ts.factory.createImportSpecifier(localName !== verbatimTargetName ? ts.factory.createIdentifier(verbatimTargetName) : undefined, ts.factory.createIdentifier(localName))\n                            ])), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */);\n                            break;\n                        case 270 /* ExportSpecifier */:\n                            // does not use localName because the symbol name in this case refers to the name in the exports table,\n                            // which we must exactly preserve\n                            var specifier = node.parent.parent.moduleSpecifier;\n                            // targetName is only used when the target is local, as otherwise the target is an alias that points at\n                            // another file\n                            serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.factory.createStringLiteral(specifier.text) : undefined);\n                            break;\n                        case 266 /* ExportAssignment */:\n                            serializeMaybeAliasAssignment(symbol);\n                            break;\n                        case 216 /* BinaryExpression */:\n                        case 201 /* PropertyAccessExpression */:\n                        case 202 /* ElementAccessExpression */:\n                            // Could be best encoded as though an export specifier or as though an export assignment\n                            // If name is default or export=, do an export assignment\n                            // Otherwise do an export specifier\n                            if (symbol.escapedName === \"default\" /* Default */ || symbol.escapedName === \"export=\" /* ExportEquals */) {\n                                serializeMaybeAliasAssignment(symbol);\n                            }\n                            else {\n                                serializeExportSpecifier(localName, targetName);\n                            }\n                            break;\n                        default:\n                            return ts.Debug.failBadSyntaxKind(node, \"Unhandled alias declaration kind in symbol serializer!\");\n                    }\n                }\n                function serializeExportSpecifier(localName, targetName, specifier) {\n                    addResult(ts.factory.createExportDeclaration(\n                    /*decorators*/ undefined, \n                    /*modifiers*/ undefined, \n                    /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(localName !== targetName ? targetName : undefined, localName)]), specifier), 0 /* None */);\n                }\n                /**\n                 * Returns `true` if an export assignment or declaration was produced for the symbol\n                 */\n                function serializeMaybeAliasAssignment(symbol) {\n                    if (symbol.flags & 4194304 /* Prototype */) {\n                        return false;\n                    }\n                    var name = ts.unescapeLeadingUnderscores(symbol.escapedName);\n                    var isExportEquals = name === \"export=\" /* ExportEquals */;\n                    var isDefault = name === \"default\" /* Default */;\n                    var isExportAssignmentCompatibleSymbolName = isExportEquals || isDefault;\n                    // synthesize export = ref\n                    // ref should refer to either be a locally scoped symbol which we need to emit, or\n                    // a reference to another namespace/module which we may need to emit an `import` statement for\n                    var aliasDecl = symbol.declarations && getDeclarationOfAliasSymbol(symbol);\n                    // serialize what the alias points to, preserve the declaration's initializer\n                    var target = aliasDecl && getTargetOfAliasDeclaration(aliasDecl, /*dontRecursivelyResolve*/ true);\n                    // If the target resolves and resolves to a thing defined in this file, emit as an alias, otherwise emit as a const\n                    if (target && ts.length(target.declarations) && ts.some(target.declarations, function (d) { return ts.getSourceFileOfNode(d) === ts.getSourceFileOfNode(enclosingDeclaration); })) {\n                        // In case `target` refers to a namespace member, look at the declaration and serialize the leftmost symbol in it\n                        // eg, `namespace A { export class B {} }; exports = A.B;`\n                        // Technically, this is all that's required in the case where the assignment is an entity name expression\n                        var expr = aliasDecl && ((ts.isExportAssignment(aliasDecl) || ts.isBinaryExpression(aliasDecl)) ? ts.getExportAssignmentExpression(aliasDecl) : ts.getPropertyAssignmentAliasLikeExpression(aliasDecl));\n                        var first_1 = expr && ts.isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined;\n                        var referenced = first_1 && resolveEntityName(first_1, 67108863 /* All */, /*ignoreErrors*/ true, /*dontResolveAlias*/ true, enclosingDeclaration);\n                        if (referenced || target) {\n                            includePrivateSymbol(referenced || target);\n                        }\n                        // We disable the context's symbol tracker for the duration of this name serialization\n                        // as, by virtue of being here, the name is required to print something, and we don't want to\n                        // issue a visibility error on it. Only anonymous classes that an alias points at _would_ issue\n                        // a visibility error here (as they're not visible within any scope), but we want to hoist them\n                        // into the containing scope anyway, so we want to skip the visibility checks.\n                        var oldTrack = context.tracker.trackSymbol;\n                        context.tracker.trackSymbol = ts.noop;\n                        if (isExportAssignmentCompatibleSymbolName) {\n                            results.push(ts.factory.createExportAssignment(\n                            /*decorators*/ undefined, \n                            /*modifiers*/ undefined, isExportEquals, symbolToExpression(target, context, 67108863 /* All */)));\n                        }\n                        else {\n                            if (first_1 === expr && first_1) {\n                                // serialize as `export {target as name}`\n                                serializeExportSpecifier(name, ts.idText(first_1));\n                            }\n                            else if (expr && ts.isClassExpression(expr)) {\n                                serializeExportSpecifier(name, getInternalSymbolName(target, ts.symbolName(target)));\n                            }\n                            else {\n                                // serialize as `import _Ref = t.arg.et; export { _Ref as name }`\n                                var varName = getUnusedName(name, symbol);\n                                addResult(ts.factory.createImportEqualsDeclaration(\n                                /*decorators*/ undefined, \n                                /*modifiers*/ undefined, \n                                /*isTypeOnly*/ false, ts.factory.createIdentifier(varName), symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false)), 0 /* None */);\n                                serializeExportSpecifier(name, varName);\n                            }\n                        }\n                        context.tracker.trackSymbol = oldTrack;\n                        return true;\n                    }\n                    else {\n                        // serialize as an anonymous property declaration\n                        var varName = getUnusedName(name, symbol);\n                        // We have to use `getWidenedType` here since the object within a json file is unwidened within the file\n                        // (Unwidened types can only exist in expression contexts and should never be serialized)\n                        var typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol)));\n                        if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) {\n                            // If there are no index signatures and `typeToSerialize` is an object type, emit as a namespace instead of a const\n                            serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 1 /* Export */);\n                        }\n                        else {\n                            var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([\n                                ts.factory.createVariableDeclaration(varName, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled))\n                            ], 2 /* Const */));\n                            // Inlined JSON types exported with [module.]exports= will already emit an export=, so should use `declare`.\n                            // Otherwise, the type itself should be exported.\n                            addResult(statement, target && target.flags & 4 /* Property */ && target.escapedName === \"export=\" /* ExportEquals */ ? 2 /* Ambient */\n                                : name === varName ? 1 /* Export */\n                                    : 0 /* None */);\n                        }\n                        if (isExportAssignmentCompatibleSymbolName) {\n                            results.push(ts.factory.createExportAssignment(\n                            /*decorators*/ undefined, \n                            /*modifiers*/ undefined, isExportEquals, ts.factory.createIdentifier(varName)));\n                            return true;\n                        }\n                        else if (name !== varName) {\n                            serializeExportSpecifier(name, varName);\n                            return true;\n                        }\n                        return false;\n                    }\n                }\n                function isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, hostSymbol) {\n                    // Only object types which are not constructable, or indexable, whose members all come from the\n                    // context source file, and whose property names are all valid identifiers and not late-bound, _and_\n                    // whose input is not type annotated (if the input symbol has an annotation we can reuse, we should prefer it)\n                    var ctxSrc = ts.getSourceFileOfNode(context.enclosingDeclaration);\n                    return ts.getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) &&\n                        !getIndexInfoOfType(typeToSerialize, 0 /* String */) &&\n                        !getIndexInfoOfType(typeToSerialize, 1 /* Number */) &&\n                        !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class\n                        !!(ts.length(ts.filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || ts.length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) &&\n                        !ts.length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK\n                        !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) &&\n                        !(typeToSerialize.symbol && ts.some(typeToSerialize.symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== ctxSrc; })) &&\n                        !ts.some(getPropertiesOfType(typeToSerialize), function (p) { return isLateBoundName(p.escapedName); }) &&\n                        !ts.some(getPropertiesOfType(typeToSerialize), function (p) { return ts.some(p.declarations, function (d) { return ts.getSourceFileOfNode(d) !== ctxSrc; }); }) &&\n                        ts.every(getPropertiesOfType(typeToSerialize), function (p) { return ts.isIdentifierText(ts.symbolName(p), languageVersion); });\n                }\n                function makeSerializePropertySymbol(createProperty, methodKind, useAccessors) {\n                    return function serializePropertySymbol(p, isStatic, baseType) {\n                        var modifierFlags = ts.getDeclarationModifierFlagsFromSymbol(p);\n                        var isPrivate = !!(modifierFlags & 8 /* Private */);\n                        if (isStatic && (p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */))) {\n                            // Only value-only-meaning symbols can be correctly encoded as class statics, type/namespace/alias meaning symbols\n                            // need to be merged namespace members\n                            return [];\n                        }\n                        if (p.flags & 4194304 /* Prototype */ ||\n                            (baseType && getPropertyOfType(baseType, p.escapedName)\n                                && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p)\n                                && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */)\n                                && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName)))) {\n                            return [];\n                        }\n                        var flag = (modifierFlags & ~256 /* Async */) | (isStatic ? 32 /* Static */ : 0);\n                        var name = getPropertyNameNodeForSymbol(p, context);\n                        var firstPropertyLikeDecl = ts.find(p.declarations, ts.or(ts.isPropertyDeclaration, ts.isAccessor, ts.isVariableDeclaration, ts.isPropertySignature, ts.isBinaryExpression, ts.isPropertyAccessExpression));\n                        if (p.flags & 98304 /* Accessor */ && useAccessors) {\n                            var result = [];\n                            if (p.flags & 65536 /* SetAccessor */) {\n                                result.push(ts.setTextRange(ts.factory.createSetAccessorDeclaration(\n                                /*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags(flag), name, [ts.factory.createParameterDeclaration(\n                                    /*decorators*/ undefined, \n                                    /*modifiers*/ undefined, \n                                    /*dotDotDotToken*/ undefined, \"arg\", \n                                    /*questionToken*/ undefined, isPrivate ? undefined : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled))], \n                                /*body*/ undefined), ts.find(p.declarations, ts.isSetAccessor) || firstPropertyLikeDecl));\n                            }\n                            if (p.flags & 32768 /* GetAccessor */) {\n                                var isPrivate_1 = modifierFlags & 8 /* Private */;\n                                result.push(ts.setTextRange(ts.factory.createGetAccessorDeclaration(\n                                /*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags(flag), name, [], isPrivate_1 ? undefined : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled), \n                                /*body*/ undefined), ts.find(p.declarations, ts.isGetAccessor) || firstPropertyLikeDecl));\n                            }\n                            return result;\n                        }\n                        // This is an else/if as accessors and properties can't merge in TS, but might in JS\n                        // If this happens, we assume the accessor takes priority, as it imposes more constraints\n                        else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) {\n                            return ts.setTextRange(createProperty(\n                            /*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag), name, p.flags & 16777216 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined, isPrivate ? undefined : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled), \n                            // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357\n                            // interface members can't have initializers, however class members _can_\n                            /*initializer*/ undefined), ts.find(p.declarations, ts.or(ts.isPropertyDeclaration, ts.isVariableDeclaration)) || firstPropertyLikeDecl);\n                        }\n                        if (p.flags & (8192 /* Method */ | 16 /* Function */)) {\n                            var type = getTypeOfSymbol(p);\n                            var signatures = getSignaturesOfType(type, 0 /* Call */);\n                            if (flag & 8 /* Private */) {\n                                return ts.setTextRange(createProperty(\n                                /*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag), name, p.flags & 16777216 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined, \n                                /*type*/ undefined, \n                                /*initializer*/ undefined), ts.find(p.declarations, ts.isFunctionLikeDeclaration) || signatures[0] && signatures[0].declaration || p.declarations[0]);\n                            }\n                            var results_1 = [];\n                            for (var _i = 0, signatures_3 = signatures; _i < signatures_3.length; _i++) {\n                                var sig = signatures_3[_i];\n                                // Each overload becomes a separate method declaration, in order\n                                var decl = signatureToSignatureDeclarationHelper(sig, methodKind, context, {\n                                    name: name,\n                                    questionToken: p.flags & 16777216 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined,\n                                    modifiers: flag ? ts.factory.createModifiersFromModifierFlags(flag) : undefined\n                                });\n                                results_1.push(ts.setTextRange(decl, sig.declaration));\n                            }\n                            return results_1;\n                        }\n                        // The `Constructor`'s symbol isn't in the class's properties lists, obviously, since it's a signature on the static\n                        return ts.Debug.fail(\"Unhandled class member kind! \" + (p.__debugFlags || p.flags));\n                    };\n                }\n                function serializePropertySymbolForInterface(p, baseType) {\n                    return serializePropertySymbolForInterfaceWorker(p, /*isStatic*/ false, baseType);\n                }\n                function serializeSignatures(kind, input, baseType, outputKind) {\n                    var signatures = getSignaturesOfType(input, kind);\n                    if (kind === 1 /* Construct */) {\n                        if (!baseType && ts.every(signatures, function (s) { return ts.length(s.parameters) === 0; })) {\n                            return []; // No base type, every constructor is empty - elide the extraneous `constructor()`\n                        }\n                        if (baseType) {\n                            // If there is a base type, if every signature in the class is identical to a signature in the baseType, elide all the declarations\n                            var baseSigs = getSignaturesOfType(baseType, 1 /* Construct */);\n                            if (!ts.length(baseSigs) && ts.every(signatures, function (s) { return ts.length(s.parameters) === 0; })) {\n                                return []; // Base had no explicit signatures, if all our signatures are also implicit, return an empty list\n                            }\n                            if (baseSigs.length === signatures.length) {\n                                var failed = false;\n                                for (var i = 0; i < baseSigs.length; i++) {\n                                    if (!compareSignaturesIdentical(signatures[i], baseSigs[i], /*partialMatch*/ false, /*ignoreThisTypes*/ false, /*ignoreReturnTypes*/ true, compareTypesIdentical)) {\n                                        failed = true;\n                                        break;\n                                    }\n                                }\n                                if (!failed) {\n                                    return []; // Every signature was identical - elide constructor list as it is inherited\n                                }\n                            }\n                        }\n                        var privateProtected = 0;\n                        for (var _i = 0, signatures_4 = signatures; _i < signatures_4.length; _i++) {\n                            var s = signatures_4[_i];\n                            if (s.declaration) {\n                                privateProtected |= ts.getSelectedEffectiveModifierFlags(s.declaration, 8 /* Private */ | 16 /* Protected */);\n                            }\n                        }\n                        if (privateProtected) {\n                            return [ts.setTextRange(ts.factory.createConstructorDeclaration(\n                                /*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags(privateProtected), \n                                /*parameters*/ [], \n                                /*body*/ undefined), signatures[0].declaration)];\n                        }\n                    }\n                    var results = [];\n                    for (var _a = 0, signatures_5 = signatures; _a < signatures_5.length; _a++) {\n                        var sig = signatures_5[_a];\n                        // Each overload becomes a separate constructor declaration, in order\n                        var decl = signatureToSignatureDeclarationHelper(sig, outputKind, context);\n                        results.push(ts.setTextRange(decl, sig.declaration));\n                    }\n                    return results;\n                }\n                function serializeIndexSignatures(input, baseType) {\n                    var results = [];\n                    for (var _i = 0, _a = [0 /* String */, 1 /* Number */]; _i < _a.length; _i++) {\n                        var type = _a[_i];\n                        var info = getIndexInfoOfType(input, type);\n                        if (info) {\n                            if (baseType) {\n                                var baseInfo = getIndexInfoOfType(baseType, type);\n                                if (baseInfo) {\n                                    if (isTypeIdenticalTo(info.type, baseInfo.type)) {\n                                        continue; // elide identical index signatures\n                                    }\n                                }\n                            }\n                            results.push(indexInfoToIndexSignatureDeclarationHelper(info, type, context, /*typeNode*/ undefined));\n                        }\n                    }\n                    return results;\n                }\n                function serializeBaseType(t, staticType, rootName) {\n                    var ref = trySerializeAsTypeReference(t, 111551 /* Value */);\n                    if (ref) {\n                        return ref;\n                    }\n                    var tempName = getUnusedName(rootName + \"_base\");\n                    var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([\n                        ts.factory.createVariableDeclaration(tempName, /*exclamationToken*/ undefined, typeToTypeNodeHelper(staticType, context))\n                    ], 2 /* Const */));\n                    addResult(statement, 0 /* None */);\n                    return ts.factory.createExpressionWithTypeArguments(ts.factory.createIdentifier(tempName), /*typeArgs*/ undefined);\n                }\n                function trySerializeAsTypeReference(t, flags) {\n                    var typeArgs;\n                    var reference;\n                    // We don't use `isValueSymbolAccessible` below. since that considers alternative containers (like modules)\n                    // which we can't write out in a syntactically valid way as an expression\n                    if (t.target && isSymbolAccessibleByFlags(t.target.symbol, enclosingDeclaration, flags)) {\n                        typeArgs = ts.map(getTypeArguments(t), function (t) { return typeToTypeNodeHelper(t, context); });\n                        reference = symbolToExpression(t.target.symbol, context, 788968 /* Type */);\n                    }\n                    else if (t.symbol && isSymbolAccessibleByFlags(t.symbol, enclosingDeclaration, flags)) {\n                        reference = symbolToExpression(t.symbol, context, 788968 /* Type */);\n                    }\n                    if (reference) {\n                        return ts.factory.createExpressionWithTypeArguments(reference, typeArgs);\n                    }\n                }\n                function serializeImplementedType(t) {\n                    var ref = trySerializeAsTypeReference(t, 788968 /* Type */);\n                    if (ref) {\n                        return ref;\n                    }\n                    if (t.symbol) {\n                        return ts.factory.createExpressionWithTypeArguments(symbolToExpression(t.symbol, context, 788968 /* Type */), /*typeArgs*/ undefined);\n                    }\n                }\n                function getUnusedName(input, symbol) {\n                    var _a, _b;\n                    var id = symbol ? getSymbolId(symbol) : undefined;\n                    if (id) {\n                        if (context.remappedSymbolNames.has(id)) {\n                            return context.remappedSymbolNames.get(id);\n                        }\n                    }\n                    if (symbol) {\n                        input = getNameCandidateWorker(symbol, input);\n                    }\n                    var i = 0;\n                    var original = input;\n                    while ((_a = context.usedSymbolNames) === null || _a === void 0 ? void 0 : _a.has(input)) {\n                        i++;\n                        input = original + \"_\" + i;\n                    }\n                    (_b = context.usedSymbolNames) === null || _b === void 0 ? void 0 : _b.add(input);\n                    if (id) {\n                        context.remappedSymbolNames.set(id, input);\n                    }\n                    return input;\n                }\n                function getNameCandidateWorker(symbol, localName) {\n                    if (localName === \"default\" /* Default */ || localName === \"__class\" /* Class */ || localName === \"__function\" /* Function */) {\n                        var flags = context.flags;\n                        context.flags |= 16777216 /* InInitialEntityName */;\n                        var nameCandidate = getNameOfSymbolAsWritten(symbol, context);\n                        context.flags = flags;\n                        localName = nameCandidate.length > 0 && ts.isSingleOrDoubleQuote(nameCandidate.charCodeAt(0)) ? ts.stripQuotes(nameCandidate) : nameCandidate;\n                    }\n                    if (localName === \"default\" /* Default */) {\n                        localName = \"_default\";\n                    }\n                    else if (localName === \"export=\" /* ExportEquals */) {\n                        localName = \"_exports\";\n                    }\n                    localName = ts.isIdentifierText(localName, languageVersion) && !ts.isStringANonContextualKeyword(localName) ? localName : \"_\" + localName.replace(/[^a-zA-Z0-9]/g, \"_\");\n                    return localName;\n                }\n                function getInternalSymbolName(symbol, localName) {\n                    var id = getSymbolId(symbol);\n                    if (context.remappedSymbolNames.has(id)) {\n                        return context.remappedSymbolNames.get(id);\n                    }\n                    localName = getNameCandidateWorker(symbol, localName);\n                    // The result of this is going to be used as the symbol's name - lock it in, so `getUnusedName` will also pick it up\n                    context.remappedSymbolNames.set(id, localName);\n                    return localName;\n                }\n            }\n        }\n        function typePredicateToString(typePredicate, enclosingDeclaration, flags, writer) {\n            if (flags === void 0) { flags = 16384 /* UseAliasDefinedOutsideCurrentScope */; }\n            return writer ? typePredicateToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(typePredicateToStringWorker);\n            function typePredicateToStringWorker(writer) {\n                var predicate = ts.factory.createTypePredicateNode(typePredicate.kind === 2 /* AssertsThis */ || typePredicate.kind === 3 /* AssertsIdentifier */ ? ts.factory.createToken(127 /* AssertsKeyword */) : undefined, typePredicate.kind === 1 /* Identifier */ || typePredicate.kind === 3 /* AssertsIdentifier */ ? ts.factory.createIdentifier(typePredicate.parameterName) : ts.factory.createThisTypeNode(), typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */) // TODO: GH#18217\n                );\n                var printer = ts.createPrinter({ removeComments: true });\n                var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);\n                printer.writeNode(4 /* Unspecified */, predicate, /*sourceFile*/ sourceFile, writer);\n                return writer;\n            }\n        }\n        function formatUnionTypes(types) {\n            var result = [];\n            var flags = 0;\n            for (var i = 0; i < types.length; i++) {\n                var t = types[i];\n                flags |= t.flags;\n                if (!(t.flags & 98304 /* Nullable */)) {\n                    if (t.flags & (512 /* BooleanLiteral */ | 1024 /* EnumLiteral */)) {\n                        var baseType = t.flags & 512 /* BooleanLiteral */ ? booleanType : getBaseTypeOfEnumLiteralType(t);\n                        if (baseType.flags & 1048576 /* Union */) {\n                            var count = baseType.types.length;\n                            if (i + count <= types.length && getRegularTypeOfLiteralType(types[i + count - 1]) === getRegularTypeOfLiteralType(baseType.types[count - 1])) {\n                                result.push(baseType);\n                                i += count - 1;\n                                continue;\n                            }\n                        }\n                    }\n                    result.push(t);\n                }\n            }\n            if (flags & 65536 /* Null */)\n                result.push(nullType);\n            if (flags & 32768 /* Undefined */)\n                result.push(undefinedType);\n            return result || types;\n        }\n        function visibilityToString(flags) {\n            if (flags === 8 /* Private */) {\n                return \"private\";\n            }\n            if (flags === 16 /* Protected */) {\n                return \"protected\";\n            }\n            return \"public\";\n        }\n        function getTypeAliasForTypeLiteral(type) {\n            if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) {\n                var node = ts.walkUpParenthesizedTypes(type.symbol.declarations[0].parent);\n                if (node.kind === 254 /* TypeAliasDeclaration */) {\n                    return getSymbolOfNode(node);\n                }\n            }\n            return undefined;\n        }\n        function isTopLevelInExternalModuleAugmentation(node) {\n            return node && node.parent &&\n                node.parent.kind === 257 /* ModuleBlock */ &&\n                ts.isExternalModuleAugmentation(node.parent.parent);\n        }\n        function isDefaultBindingContext(location) {\n            return location.kind === 297 /* SourceFile */ || ts.isAmbientModule(location);\n        }\n        function getNameOfSymbolFromNameType(symbol, context) {\n            var nameType = getSymbolLinks(symbol).nameType;\n            if (nameType) {\n                if (nameType.flags & 384 /* StringOrNumberLiteral */) {\n                    var name = \"\" + nameType.value;\n                    if (!ts.isIdentifierText(name, compilerOptions.target) && !isNumericLiteralName(name)) {\n                        return \"\\\"\" + ts.escapeString(name, 34 /* doubleQuote */) + \"\\\"\";\n                    }\n                    if (isNumericLiteralName(name) && ts.startsWith(name, \"-\")) {\n                        return \"[\" + name + \"]\";\n                    }\n                    return name;\n                }\n                if (nameType.flags & 8192 /* UniqueESSymbol */) {\n                    return \"[\" + getNameOfSymbolAsWritten(nameType.symbol, context) + \"]\";\n                }\n            }\n        }\n        /**\n         * Gets a human-readable name for a symbol.\n         * Should *not* be used for the right-hand side of a `.` -- use `symbolName(symbol)` for that instead.\n         *\n         * Unlike `symbolName(symbol)`, this will include quotes if the name is from a string literal.\n         * It will also use a representation of a number as written instead of a decimal form, e.g. `0o11` instead of `9`.\n         */\n        function getNameOfSymbolAsWritten(symbol, context) {\n            if (context && symbol.escapedName === \"default\" /* Default */ && !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */) &&\n                // If it's not the first part of an entity name, it must print as `default`\n                (!(context.flags & 16777216 /* InInitialEntityName */) ||\n                    // if the symbol is synthesized, it will only be referenced externally it must print as `default`\n                    !symbol.declarations ||\n                    // if not in the same binding context (source file, module declaration), it must print as `default`\n                    (context.enclosingDeclaration && ts.findAncestor(symbol.declarations[0], isDefaultBindingContext) !== ts.findAncestor(context.enclosingDeclaration, isDefaultBindingContext)))) {\n                return \"default\";\n            }\n            if (symbol.declarations && symbol.declarations.length) {\n                var declaration = ts.firstDefined(symbol.declarations, function (d) { return ts.getNameOfDeclaration(d) ? d : undefined; }); // Try using a declaration with a name, first\n                var name_3 = declaration && ts.getNameOfDeclaration(declaration);\n                if (declaration && name_3) {\n                    if (ts.isCallExpression(declaration) && ts.isBindableObjectDefinePropertyCall(declaration)) {\n                        return ts.symbolName(symbol);\n                    }\n                    if (ts.isComputedPropertyName(name_3) && !(ts.getCheckFlags(symbol) & 4096 /* Late */)) {\n                        var nameType = getSymbolLinks(symbol).nameType;\n                        if (nameType && nameType.flags & 384 /* StringOrNumberLiteral */) {\n                            // Computed property name isn't late bound, but has a well-known name type - use name type to generate a symbol name\n                            var result = getNameOfSymbolFromNameType(symbol, context);\n                            if (result !== undefined) {\n                                return result;\n                            }\n                        }\n                    }\n                    return ts.declarationNameToString(name_3);\n                }\n                if (!declaration) {\n                    declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway\n                }\n                if (declaration.parent && declaration.parent.kind === 249 /* VariableDeclaration */) {\n                    return ts.declarationNameToString(declaration.parent.name);\n                }\n                switch (declaration.kind) {\n                    case 221 /* ClassExpression */:\n                    case 208 /* FunctionExpression */:\n                    case 209 /* ArrowFunction */:\n                        if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) {\n                            context.encounteredError = true;\n                        }\n                        return declaration.kind === 221 /* ClassExpression */ ? \"(Anonymous class)\" : \"(Anonymous function)\";\n                }\n            }\n            var name = getNameOfSymbolFromNameType(symbol, context);\n            return name !== undefined ? name : ts.symbolName(symbol);\n        }\n        function isDeclarationVisible(node) {\n            if (node) {\n                var links = getNodeLinks(node);\n                if (links.isVisible === undefined) {\n                    links.isVisible = !!determineIfDeclarationIsVisible();\n                }\n                return links.isVisible;\n            }\n            return false;\n            function determineIfDeclarationIsVisible() {\n                switch (node.kind) {\n                    case 324 /* JSDocCallbackTag */:\n                    case 331 /* JSDocTypedefTag */:\n                    case 325 /* JSDocEnumTag */:\n                        // Top-level jsdoc type aliases are considered exported\n                        // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file\n                        return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent));\n                    case 198 /* BindingElement */:\n                        return isDeclarationVisible(node.parent.parent);\n                    case 249 /* VariableDeclaration */:\n                        if (ts.isBindingPattern(node.name) &&\n                            !node.name.elements.length) {\n                            // If the binding pattern is empty, this variable declaration is not visible\n                            return false;\n                        }\n                    // falls through\n                    case 256 /* ModuleDeclaration */:\n                    case 252 /* ClassDeclaration */:\n                    case 253 /* InterfaceDeclaration */:\n                    case 254 /* TypeAliasDeclaration */:\n                    case 251 /* FunctionDeclaration */:\n                    case 255 /* EnumDeclaration */:\n                    case 260 /* ImportEqualsDeclaration */:\n                        // external module augmentation is always visible\n                        if (ts.isExternalModuleAugmentation(node)) {\n                            return true;\n                        }\n                        var parent = getDeclarationContainer(node);\n                        // If the node is not exported or it is not ambient module element (except import declaration)\n                        if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) &&\n                            !(node.kind !== 260 /* ImportEqualsDeclaration */ && parent.kind !== 297 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) {\n                            return isGlobalSourceFile(parent);\n                        }\n                        // Exported members/ambient module elements (exception import declaration) are visible if parent is visible\n                        return isDeclarationVisible(parent);\n                    case 163 /* PropertyDeclaration */:\n                    case 162 /* PropertySignature */:\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                    case 165 /* MethodDeclaration */:\n                    case 164 /* MethodSignature */:\n                        if (ts.hasEffectiveModifier(node, 8 /* Private */ | 16 /* Protected */)) {\n                            // Private/protected properties/methods are not visible\n                            return false;\n                        }\n                    // Public properties/methods are visible if its parents are visible, so:\n                    // falls through\n                    case 166 /* Constructor */:\n                    case 170 /* ConstructSignature */:\n                    case 169 /* CallSignature */:\n                    case 171 /* IndexSignature */:\n                    case 160 /* Parameter */:\n                    case 257 /* ModuleBlock */:\n                    case 174 /* FunctionType */:\n                    case 175 /* ConstructorType */:\n                    case 177 /* TypeLiteral */:\n                    case 173 /* TypeReference */:\n                    case 178 /* ArrayType */:\n                    case 179 /* TupleType */:\n                    case 182 /* UnionType */:\n                    case 183 /* IntersectionType */:\n                    case 186 /* ParenthesizedType */:\n                    case 192 /* NamedTupleMember */:\n                        return isDeclarationVisible(node.parent);\n                    // Default binding, import specifier and namespace import is visible\n                    // only on demand so by default it is not visible\n                    case 262 /* ImportClause */:\n                    case 263 /* NamespaceImport */:\n                    case 265 /* ImportSpecifier */:\n                        return false;\n                    // Type parameters are always visible\n                    case 159 /* TypeParameter */:\n                    // Source file and namespace export are always visible\n                    // falls through\n                    case 297 /* SourceFile */:\n                    case 259 /* NamespaceExportDeclaration */:\n                        return true;\n                    // Export assignments do not create name bindings outside the module\n                    case 266 /* ExportAssignment */:\n                        return false;\n                    default:\n                        return false;\n                }\n            }\n        }\n        function collectLinkedAliases(node, setVisibility) {\n            var exportSymbol;\n            if (node.parent && node.parent.kind === 266 /* ExportAssignment */) {\n                exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false);\n            }\n            else if (node.parent.kind === 270 /* ExportSpecifier */) {\n                exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */);\n            }\n            var result;\n            var visited;\n            if (exportSymbol) {\n                visited = new ts.Set();\n                visited.add(getSymbolId(exportSymbol));\n                buildVisibleNodeList(exportSymbol.declarations);\n            }\n            return result;\n            function buildVisibleNodeList(declarations) {\n                ts.forEach(declarations, function (declaration) {\n                    var resultNode = getAnyImportSyntax(declaration) || declaration;\n                    if (setVisibility) {\n                        getNodeLinks(declaration).isVisible = true;\n                    }\n                    else {\n                        result = result || [];\n                        ts.pushIfUnique(result, resultNode);\n                    }\n                    if (ts.isInternalModuleImportEqualsDeclaration(declaration)) {\n                        // Add the referenced top container visible\n                        var internalModuleReference = declaration.moduleReference;\n                        var firstIdentifier = ts.getFirstIdentifier(internalModuleReference);\n                        var importSymbol = resolveName(declaration, firstIdentifier.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, undefined, undefined, /*isUse*/ false);\n                        if (importSymbol && visited) {\n                            if (ts.tryAddToSet(visited, getSymbolId(importSymbol))) {\n                                buildVisibleNodeList(importSymbol.declarations);\n                            }\n                        }\n                    }\n                });\n            }\n        }\n        /**\n         * Push an entry on the type resolution stack. If an entry with the given target and the given property name\n         * is already on the stack, and no entries in between already have a type, then a circularity has occurred.\n         * In this case, the result values of the existing entry and all entries pushed after it are changed to false,\n         * and the value false is returned. Otherwise, the new entry is just pushed onto the stack, and true is returned.\n         * In order to see if the same query has already been done before, the target object and the propertyName both\n         * must match the one passed in.\n         *\n         * @param target The symbol, type, or signature whose type is being queried\n         * @param propertyName The property name that should be used to query the target for its type\n         */\n        function pushTypeResolution(target, propertyName) {\n            var resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName);\n            if (resolutionCycleStartIndex >= 0) {\n                // A cycle was found\n                var length_3 = resolutionTargets.length;\n                for (var i = resolutionCycleStartIndex; i < length_3; i++) {\n                    resolutionResults[i] = false;\n                }\n                return false;\n            }\n            resolutionTargets.push(target);\n            resolutionResults.push(/*items*/ true);\n            resolutionPropertyNames.push(propertyName);\n            return true;\n        }\n        function findResolutionCycleStartIndex(target, propertyName) {\n            for (var i = resolutionTargets.length - 1; i >= 0; i--) {\n                if (hasType(resolutionTargets[i], resolutionPropertyNames[i])) {\n                    return -1;\n                }\n                if (resolutionTargets[i] === target && resolutionPropertyNames[i] === propertyName) {\n                    return i;\n                }\n            }\n            return -1;\n        }\n        function hasType(target, propertyName) {\n            switch (propertyName) {\n                case 0 /* Type */:\n                    return !!getSymbolLinks(target).type;\n                case 5 /* EnumTagType */:\n                    return !!(getNodeLinks(target).resolvedEnumType);\n                case 2 /* DeclaredType */:\n                    return !!getSymbolLinks(target).declaredType;\n                case 1 /* ResolvedBaseConstructorType */:\n                    return !!target.resolvedBaseConstructorType;\n                case 3 /* ResolvedReturnType */:\n                    return !!target.resolvedReturnType;\n                case 4 /* ImmediateBaseConstraint */:\n                    return !!target.immediateBaseConstraint;\n                case 6 /* ResolvedTypeArguments */:\n                    return !!target.resolvedTypeArguments;\n                case 7 /* ResolvedBaseTypes */:\n                    return !!target.baseTypesResolved;\n            }\n            return ts.Debug.assertNever(propertyName);\n        }\n        /**\n         * Pop an entry from the type resolution stack and return its associated result value. The result value will\n         * be true if no circularities were detected, or false if a circularity was found.\n         */\n        function popTypeResolution() {\n            resolutionTargets.pop();\n            resolutionPropertyNames.pop();\n            return resolutionResults.pop();\n        }\n        function getDeclarationContainer(node) {\n            return ts.findAncestor(ts.getRootDeclaration(node), function (node) {\n                switch (node.kind) {\n                    case 249 /* VariableDeclaration */:\n                    case 250 /* VariableDeclarationList */:\n                    case 265 /* ImportSpecifier */:\n                    case 264 /* NamedImports */:\n                    case 263 /* NamespaceImport */:\n                    case 262 /* ImportClause */:\n                        return false;\n                    default:\n                        return true;\n                }\n            }).parent;\n        }\n        function getTypeOfPrototypeProperty(prototype) {\n            // TypeScript 1.0 spec (April 2014): 8.4\n            // Every class automatically contains a static property member named 'prototype',\n            // the type of which is an instantiation of the class type with type Any supplied as a type argument for each type parameter.\n            // It is an error to explicitly declare a static property member with the name 'prototype'.\n            var classType = getDeclaredTypeOfSymbol(getParentOfSymbol(prototype));\n            return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType;\n        }\n        // Return the type of the given property in the given type, or undefined if no such property exists\n        function getTypeOfPropertyOfType(type, name) {\n            var prop = getPropertyOfType(type, name);\n            return prop ? getTypeOfSymbol(prop) : undefined;\n        }\n        function getTypeOfPropertyOrIndexSignature(type, name) {\n            return getTypeOfPropertyOfType(type, name) || isNumericLiteralName(name) && getIndexTypeOfType(type, 1 /* Number */) || getIndexTypeOfType(type, 0 /* String */) || unknownType;\n        }\n        function isTypeAny(type) {\n            return type && (type.flags & 1 /* Any */) !== 0;\n        }\n        // Return the type of a binding element parent. We check SymbolLinks first to see if a type has been\n        // assigned by contextual typing.\n        function getTypeForBindingElementParent(node) {\n            var symbol = getSymbolOfNode(node);\n            return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false);\n        }\n        function getRestType(source, properties, symbol) {\n            source = filterType(source, function (t) { return !(t.flags & 98304 /* Nullable */); });\n            if (source.flags & 131072 /* Never */) {\n                return emptyObjectType;\n            }\n            if (source.flags & 1048576 /* Union */) {\n                return mapType(source, function (t) { return getRestType(t, properties, symbol); });\n            }\n            var omitKeyType = getUnionType(ts.map(properties, getLiteralTypeFromPropertyName));\n            if (isGenericObjectType(source) || isGenericIndexType(omitKeyType)) {\n                if (omitKeyType.flags & 131072 /* Never */) {\n                    return source;\n                }\n                var omitTypeAlias = getGlobalOmitSymbol();\n                if (!omitTypeAlias) {\n                    return errorType;\n                }\n                return getTypeAliasInstantiation(omitTypeAlias, [source, omitKeyType]);\n            }\n            var members = ts.createSymbolTable();\n            for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {\n                var prop = _a[_i];\n                if (!isTypeAssignableTo(getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */), omitKeyType)\n                    && !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 /* Private */ | 16 /* Protected */))\n                    && isSpreadableProperty(prop)) {\n                    members.set(prop.escapedName, getSpreadSymbol(prop, /*readonly*/ false));\n                }\n            }\n            var stringIndexInfo = getIndexInfoOfType(source, 0 /* String */);\n            var numberIndexInfo = getIndexInfoOfType(source, 1 /* Number */);\n            var result = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);\n            result.objectFlags |= 131072 /* ObjectRestType */;\n            return result;\n        }\n        // Determine the control flow type associated with a destructuring declaration or assignment. The following\n        // forms of destructuring are possible:\n        //   let { x } = obj;  // BindingElement\n        //   let [ x ] = obj;  // BindingElement\n        //   { x } = obj;      // ShorthandPropertyAssignment\n        //   { x: v } = obj;   // PropertyAssignment\n        //   [ x ] = obj;      // Expression\n        // We construct a synthetic element access expression corresponding to 'obj.x' such that the control\n        // flow analyzer doesn't have to handle all the different syntactic forms.\n        function getFlowTypeOfDestructuring(node, declaredType) {\n            var reference = getSyntheticElementAccess(node);\n            return reference ? getFlowTypeOfReference(reference, declaredType) : declaredType;\n        }\n        function getSyntheticElementAccess(node) {\n            var parentAccess = getParentElementAccess(node);\n            if (parentAccess && parentAccess.flowNode) {\n                var propName = getDestructuringPropertyName(node);\n                if (propName) {\n                    var literal = ts.setTextRange(ts.parseNodeFactory.createStringLiteral(propName), node);\n                    var lhsExpr = ts.isLeftHandSideExpression(parentAccess) ? parentAccess : ts.parseNodeFactory.createParenthesizedExpression(parentAccess);\n                    var result = ts.setTextRange(ts.parseNodeFactory.createElementAccessExpression(lhsExpr, literal), node);\n                    ts.setParent(literal, result);\n                    ts.setParent(result, node);\n                    if (lhsExpr !== parentAccess) {\n                        ts.setParent(lhsExpr, result);\n                    }\n                    result.flowNode = parentAccess.flowNode;\n                    return result;\n                }\n            }\n        }\n        function getParentElementAccess(node) {\n            var ancestor = node.parent.parent;\n            switch (ancestor.kind) {\n                case 198 /* BindingElement */:\n                case 288 /* PropertyAssignment */:\n                    return getSyntheticElementAccess(ancestor);\n                case 199 /* ArrayLiteralExpression */:\n                    return getSyntheticElementAccess(node.parent);\n                case 249 /* VariableDeclaration */:\n                    return ancestor.initializer;\n                case 216 /* BinaryExpression */:\n                    return ancestor.right;\n            }\n        }\n        function getDestructuringPropertyName(node) {\n            var parent = node.parent;\n            if (node.kind === 198 /* BindingElement */ && parent.kind === 196 /* ObjectBindingPattern */) {\n                return getLiteralPropertyNameText(node.propertyName || node.name);\n            }\n            if (node.kind === 288 /* PropertyAssignment */ || node.kind === 289 /* ShorthandPropertyAssignment */) {\n                return getLiteralPropertyNameText(node.name);\n            }\n            return \"\" + parent.elements.indexOf(node);\n        }\n        function getLiteralPropertyNameText(name) {\n            var type = getLiteralTypeFromPropertyName(name);\n            return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? \"\" + type.value : undefined;\n        }\n        /** Return the inferred type for a binding element */\n        function getTypeForBindingElement(declaration) {\n            var pattern = declaration.parent;\n            var parentType = getTypeForBindingElementParent(pattern.parent);\n            // If no type or an any type was inferred for parent, infer that for the binding element\n            if (!parentType || isTypeAny(parentType)) {\n                return parentType;\n            }\n            // Relax null check on ambient destructuring parameters, since the parameters have no implementation and are just documentation\n            if (strictNullChecks && declaration.flags & 8388608 /* Ambient */ && ts.isParameterDeclaration(declaration)) {\n                parentType = getNonNullableType(parentType);\n            }\n            // Filter `undefined` from the type we check against if the parent has an initializer and that initializer is not possibly `undefined`\n            else if (strictNullChecks && pattern.parent.initializer && !(getTypeFacts(getTypeOfInitializer(pattern.parent.initializer)) & 65536 /* EQUndefined */)) {\n                parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */);\n            }\n            var type;\n            if (pattern.kind === 196 /* ObjectBindingPattern */) {\n                if (declaration.dotDotDotToken) {\n                    parentType = getReducedType(parentType);\n                    if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) {\n                        error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types);\n                        return errorType;\n                    }\n                    var literalMembers = [];\n                    for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {\n                        var element = _a[_i];\n                        if (!element.dotDotDotToken) {\n                            literalMembers.push(element.propertyName || element.name);\n                        }\n                    }\n                    type = getRestType(parentType, literalMembers, declaration.symbol);\n                }\n                else {\n                    // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form)\n                    var name = declaration.propertyName || declaration.name;\n                    var indexType = getLiteralTypeFromPropertyName(name);\n                    var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, name, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, 16 /* ExpressionPosition */), declaration.name);\n                    type = getFlowTypeOfDestructuring(declaration, declaredType);\n                }\n            }\n            else {\n                // This elementType will be used if the specific property corresponding to this index is not\n                // present (aka the tuple element property). This call also checks that the parentType is in\n                // fact an iterable or array (depending on target language).\n                var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */ | (declaration.dotDotDotToken ? 0 : 128 /* PossiblyOutOfBounds */), parentType, undefinedType, pattern);\n                var index_2 = pattern.elements.indexOf(declaration);\n                if (declaration.dotDotDotToken) {\n                    // If the parent is a tuple type, the rest element has a tuple type of the\n                    // remaining tuple element types. Otherwise, the rest element has an array type with same\n                    // element type as the parent type.\n                    type = everyType(parentType, isTupleType) ?\n                        mapType(parentType, function (t) { return sliceTupleType(t, index_2); }) :\n                        createArrayType(elementType);\n                }\n                else if (isArrayLikeType(parentType)) {\n                    var indexType = getLiteralType(index_2);\n                    var accessFlags = hasDefaultValue(declaration) ? 8 /* NoTupleBoundsCheck */ : 0;\n                    var declaredType = getConstraintForLocation(getIndexedAccessTypeOrUndefined(parentType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, declaration.name, accessFlags | 16 /* ExpressionPosition */) || errorType, declaration.name);\n                    type = getFlowTypeOfDestructuring(declaration, declaredType);\n                }\n                else {\n                    type = elementType;\n                }\n            }\n            if (!declaration.initializer) {\n                return type;\n            }\n            if (ts.getEffectiveTypeAnnotationNode(ts.walkUpBindingElementsAndPatterns(declaration))) {\n                // In strict null checking mode, if a default value of a non-undefined type is specified, remove\n                // undefined from the final type.\n                return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration)) & 32768 /* Undefined */) ?\n                    getTypeWithFacts(type, 524288 /* NEUndefined */) :\n                    type;\n            }\n            return widenTypeInferredFromInitializer(declaration, getUnionType([getTypeWithFacts(type, 524288 /* NEUndefined */), checkDeclarationInitializer(declaration)], 2 /* Subtype */));\n        }\n        function getTypeForDeclarationFromJSDocComment(declaration) {\n            var jsdocType = ts.getJSDocType(declaration);\n            if (jsdocType) {\n                return getTypeFromTypeNode(jsdocType);\n            }\n            return undefined;\n        }\n        function isNullOrUndefined(node) {\n            var expr = ts.skipParentheses(node);\n            return expr.kind === 103 /* NullKeyword */ || expr.kind === 78 /* Identifier */ && getResolvedSymbol(expr) === undefinedSymbol;\n        }\n        function isEmptyArrayLiteral(node) {\n            var expr = ts.skipParentheses(node);\n            return expr.kind === 199 /* ArrayLiteralExpression */ && expr.elements.length === 0;\n        }\n        function addOptionality(type, optional) {\n            if (optional === void 0) { optional = true; }\n            return strictNullChecks && optional ? getOptionalType(type) : type;\n        }\n        // Return the inferred type for a variable, parameter, or property declaration\n        function getTypeForVariableLikeDeclaration(declaration, includeOptionality) {\n            // A variable declared in a for..in statement is of type string, or of type keyof T when the\n            // right hand expression is of a type parameter type.\n            if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 238 /* ForInStatement */) {\n                var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression)));\n                return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType;\n            }\n            if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 239 /* ForOfStatement */) {\n                // checkRightHandSideOfForOf will return undefined if the for-of expression type was\n                // missing properties/signatures required to get its iteratedType (like\n                // [Symbol.iterator] or next). This may be because we accessed properties from anyType,\n                // or it may have led to an error inside getElementTypeOfIterable.\n                var forOfStatement = declaration.parent.parent;\n                return checkRightHandSideOfForOf(forOfStatement) || anyType;\n            }\n            if (ts.isBindingPattern(declaration.parent)) {\n                return getTypeForBindingElement(declaration);\n            }\n            var isOptional = includeOptionality && (ts.isParameter(declaration) && isJSDocOptionalParameter(declaration)\n                || isOptionalJSDocPropertyLikeTag(declaration)\n                || !ts.isBindingElement(declaration) && !ts.isVariableDeclaration(declaration) && !!declaration.questionToken);\n            // Use type from type annotation if one is present\n            var declaredType = tryGetTypeFromEffectiveTypeNode(declaration);\n            if (declaredType) {\n                return addOptionality(declaredType, isOptional);\n            }\n            if ((noImplicitAny || ts.isInJSFile(declaration)) &&\n                ts.isVariableDeclaration(declaration) && !ts.isBindingPattern(declaration.name) &&\n                !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 8388608 /* Ambient */)) {\n                // If --noImplicitAny is on or the declaration is in a Javascript file,\n                // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no\n                // initializer or a 'null' or 'undefined' initializer.\n                if (!(ts.getCombinedNodeFlags(declaration) & 2 /* Const */) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) {\n                    return autoType;\n                }\n                // Use control flow tracked 'any[]' type for non-ambient, non-exported variables with an empty array\n                // literal initializer.\n                if (declaration.initializer && isEmptyArrayLiteral(declaration.initializer)) {\n                    return autoArrayType;\n                }\n            }\n            if (ts.isParameter(declaration)) {\n                var func = declaration.parent;\n                // For a parameter of a set accessor, use the type of the get accessor if one is present\n                if (func.kind === 168 /* SetAccessor */ && hasBindableName(func)) {\n                    var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 167 /* GetAccessor */);\n                    if (getter) {\n                        var getterSignature = getSignatureFromDeclaration(getter);\n                        var thisParameter = getAccessorThisParameter(func);\n                        if (thisParameter && declaration === thisParameter) {\n                            // Use the type from the *getter*\n                            ts.Debug.assert(!thisParameter.type);\n                            return getTypeOfSymbol(getterSignature.thisParameter);\n                        }\n                        return getReturnTypeOfSignature(getterSignature);\n                    }\n                }\n                if (ts.isInJSFile(declaration)) {\n                    var typeTag = ts.getJSDocType(func);\n                    if (typeTag && ts.isFunctionTypeNode(typeTag)) {\n                        var signature = getSignatureFromDeclaration(typeTag);\n                        var pos = func.parameters.indexOf(declaration);\n                        return declaration.dotDotDotToken ? getRestTypeAtPosition(signature, pos) : getTypeAtPosition(signature, pos);\n                    }\n                }\n                // Use contextual parameter type if one is available\n                var type = declaration.symbol.escapedName === \"this\" /* This */ ? getContextualThisParameterType(func) : getContextuallyTypedParameterType(declaration);\n                if (type) {\n                    return addOptionality(type, isOptional);\n                }\n            }\n            // Use the type of the initializer expression if one is present and the declaration is\n            // not a parameter of a contextually typed function\n            if (ts.hasOnlyExpressionInitializer(declaration) && !!declaration.initializer) {\n                if (ts.isInJSFile(declaration) && !ts.isParameter(declaration)) {\n                    var containerObjectType = getJSContainerObjectType(declaration, getSymbolOfNode(declaration), ts.getDeclaredExpandoInitializer(declaration));\n                    if (containerObjectType) {\n                        return containerObjectType;\n                    }\n                }\n                var type = widenTypeInferredFromInitializer(declaration, checkDeclarationInitializer(declaration));\n                return addOptionality(type, isOptional);\n            }\n            if (ts.isPropertyDeclaration(declaration) && !ts.hasStaticModifier(declaration) && (noImplicitAny || ts.isInJSFile(declaration))) {\n                // We have a property declaration with no type annotation or initializer, in noImplicitAny mode or a .js file.\n                // Use control flow analysis of this.xxx assignments in the constructor to determine the type of the property.\n                var constructor = findConstructorDeclaration(declaration.parent);\n                var type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) :\n                    ts.getEffectiveModifierFlags(declaration) & 2 /* Ambient */ ? getTypeOfPropertyInBaseClass(declaration.symbol) :\n                        undefined;\n                return type && addOptionality(type, isOptional);\n            }\n            if (ts.isJsxAttribute(declaration)) {\n                // if JSX attribute doesn't have initializer, by default the attribute will have boolean value of true.\n                // I.e <Elem attr /> is sugar for <Elem attr={true} />\n                return trueType;\n            }\n            // If the declaration specifies a binding pattern and is not a parameter of a contextually\n            // typed function, use the type implied by the binding pattern\n            if (ts.isBindingPattern(declaration.name)) {\n                return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ false, /*reportErrors*/ true);\n            }\n            // No type specified and nothing can be inferred\n            return undefined;\n        }\n        function isConstructorDeclaredProperty(symbol) {\n            // A property is considered a constructor declared property when all declaration sites are this.xxx assignments,\n            // when no declaration sites have JSDoc type annotations, and when at least one declaration site is in the body of\n            // a class constructor.\n            if (symbol.valueDeclaration && ts.isBinaryExpression(symbol.valueDeclaration)) {\n                var links = getSymbolLinks(symbol);\n                if (links.isConstructorDeclaredProperty === undefined) {\n                    links.isConstructorDeclaredProperty = false;\n                    links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && ts.every(symbol.declarations, function (declaration) {\n                        return ts.isBinaryExpression(declaration) &&\n                            isPossiblyAliasedThisProperty(declaration) &&\n                            (declaration.left.kind !== 202 /* ElementAccessExpression */ || ts.isStringOrNumericLiteralLike(declaration.left.argumentExpression)) &&\n                            !getAnnotatedTypeForAssignmentDeclaration(/*declaredType*/ undefined, declaration, symbol, declaration);\n                    });\n                }\n                return links.isConstructorDeclaredProperty;\n            }\n            return false;\n        }\n        function isAutoTypedProperty(symbol) {\n            // A property is auto-typed when its declaration has no type annotation or initializer and we're in\n            // noImplicitAny mode or a .js file.\n            var declaration = symbol.valueDeclaration;\n            return declaration && ts.isPropertyDeclaration(declaration) && !ts.getEffectiveTypeAnnotationNode(declaration) &&\n                !declaration.initializer && (noImplicitAny || ts.isInJSFile(declaration));\n        }\n        function getDeclaringConstructor(symbol) {\n            for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                var declaration = _a[_i];\n                var container = ts.getThisContainer(declaration, /*includeArrowFunctions*/ false);\n                if (container && (container.kind === 166 /* Constructor */ || isJSConstructor(container))) {\n                    return container;\n                }\n            }\n        }\n        function getFlowTypeInConstructor(symbol, constructor) {\n            var accessName = ts.startsWith(symbol.escapedName, \"__#\")\n                ? ts.factory.createPrivateIdentifier(symbol.escapedName.split(\"@\")[1])\n                : ts.unescapeLeadingUnderscores(symbol.escapedName);\n            var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), accessName);\n            ts.setParent(reference.expression, reference);\n            ts.setParent(reference, constructor);\n            reference.flowNode = constructor.returnFlowNode;\n            var flowType = getFlowTypeOfProperty(reference, symbol);\n            if (noImplicitAny && (flowType === autoType || flowType === autoArrayType)) {\n                error(symbol.valueDeclaration, ts.Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType));\n            }\n            // We don't infer a type if assignments are only null or undefined.\n            return everyType(flowType, isNullableType) ? undefined : convertAutoToAny(flowType);\n        }\n        function getFlowTypeOfProperty(reference, prop) {\n            var initialType = prop && (!isAutoTypedProperty(prop) || ts.getEffectiveModifierFlags(prop.valueDeclaration) & 2 /* Ambient */) && getTypeOfPropertyInBaseClass(prop) || undefinedType;\n            return getFlowTypeOfReference(reference, autoType, initialType);\n        }\n        function getWidenedTypeForAssignmentDeclaration(symbol, resolvedSymbol) {\n            // function/class/{} initializers are themselves containers, so they won't merge in the same way as other initializers\n            var container = ts.getAssignedExpandoInitializer(symbol.valueDeclaration);\n            if (container) {\n                var tag = ts.getJSDocTypeTag(container);\n                if (tag && tag.typeExpression) {\n                    return getTypeFromTypeNode(tag.typeExpression);\n                }\n                var containerObjectType = getJSContainerObjectType(symbol.valueDeclaration, symbol, container);\n                return containerObjectType || getWidenedLiteralType(checkExpressionCached(container));\n            }\n            var type;\n            var definedInConstructor = false;\n            var definedInMethod = false;\n            // We use control flow analysis to determine the type of the property if the property qualifies as a constructor\n            // declared property and the resulting control flow type isn't just undefined or null.\n            if (isConstructorDeclaredProperty(symbol)) {\n                type = getFlowTypeInConstructor(symbol, getDeclaringConstructor(symbol));\n            }\n            if (!type) {\n                var jsdocType = void 0;\n                var types = void 0;\n                for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                    var declaration = _a[_i];\n                    var expression = (ts.isBinaryExpression(declaration) || ts.isCallExpression(declaration)) ? declaration :\n                        ts.isAccessExpression(declaration) ? ts.isBinaryExpression(declaration.parent) ? declaration.parent : declaration :\n                            undefined;\n                    if (!expression) {\n                        continue; // Non-assignment declaration merged in (eg, an Identifier to mark the thing as a namespace) - skip over it and pull type info from elsewhere\n                    }\n                    var kind = ts.isAccessExpression(expression)\n                        ? ts.getAssignmentDeclarationPropertyAccessKind(expression)\n                        : ts.getAssignmentDeclarationKind(expression);\n                    if (kind === 4 /* ThisProperty */ || ts.isBinaryExpression(expression) && isPossiblyAliasedThisProperty(expression, kind)) {\n                        if (isDeclarationInConstructor(expression)) {\n                            definedInConstructor = true;\n                        }\n                        else {\n                            definedInMethod = true;\n                        }\n                    }\n                    if (!ts.isCallExpression(expression)) {\n                        jsdocType = getAnnotatedTypeForAssignmentDeclaration(jsdocType, expression, symbol, declaration);\n                    }\n                    if (!jsdocType) {\n                        (types || (types = [])).push((ts.isBinaryExpression(expression) || ts.isCallExpression(expression)) ? getInitializerTypeFromAssignmentDeclaration(symbol, resolvedSymbol, expression, kind) : neverType);\n                    }\n                }\n                type = jsdocType;\n                if (!type) {\n                    if (!ts.length(types)) {\n                        return errorType; // No types from any declarations :(\n                    }\n                    var constructorTypes = definedInConstructor ? getConstructorDefinedThisAssignmentTypes(types, symbol.declarations) : undefined;\n                    // use only the constructor types unless they were only assigned null | undefined (including widening variants)\n                    if (definedInMethod) {\n                        var propType = getTypeOfPropertyInBaseClass(symbol);\n                        if (propType) {\n                            (constructorTypes || (constructorTypes = [])).push(propType);\n                            definedInConstructor = true;\n                        }\n                    }\n                    var sourceTypes = ts.some(constructorTypes, function (t) { return !!(t.flags & ~98304 /* Nullable */); }) ? constructorTypes : types; // TODO: GH#18217\n                    type = getUnionType(sourceTypes, 2 /* Subtype */);\n                }\n            }\n            var widened = getWidenedType(addOptionality(type, definedInMethod && !definedInConstructor));\n            if (filterType(widened, function (t) { return !!(t.flags & ~98304 /* Nullable */); }) === neverType) {\n                reportImplicitAny(symbol.valueDeclaration, anyType);\n                return anyType;\n            }\n            return widened;\n        }\n        function getJSContainerObjectType(decl, symbol, init) {\n            var _a, _b;\n            if (!ts.isInJSFile(decl) || !init || !ts.isObjectLiteralExpression(init) || init.properties.length) {\n                return undefined;\n            }\n            var exports = ts.createSymbolTable();\n            while (ts.isBinaryExpression(decl) || ts.isPropertyAccessExpression(decl)) {\n                var s_2 = getSymbolOfNode(decl);\n                if ((_a = s_2 === null || s_2 === void 0 ? void 0 : s_2.exports) === null || _a === void 0 ? void 0 : _a.size) {\n                    mergeSymbolTable(exports, s_2.exports);\n                }\n                decl = ts.isBinaryExpression(decl) ? decl.parent : decl.parent.parent;\n            }\n            var s = getSymbolOfNode(decl);\n            if ((_b = s === null || s === void 0 ? void 0 : s.exports) === null || _b === void 0 ? void 0 : _b.size) {\n                mergeSymbolTable(exports, s.exports);\n            }\n            var type = createAnonymousType(symbol, exports, ts.emptyArray, ts.emptyArray, undefined, undefined);\n            type.objectFlags |= 16384 /* JSLiteral */;\n            return type;\n        }\n        function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) {\n            var typeNode = ts.getEffectiveTypeAnnotationNode(expression.parent);\n            if (typeNode) {\n                var type = getWidenedType(getTypeFromTypeNode(typeNode));\n                if (!declaredType) {\n                    return type;\n                }\n                else if (declaredType !== errorType && type !== errorType && !isTypeIdenticalTo(declaredType, type)) {\n                    errorNextVariableOrPropertyDeclarationMustHaveSameType(/*firstDeclaration*/ undefined, declaredType, declaration, type);\n                }\n            }\n            if (symbol.parent) {\n                var typeNode_2 = ts.getEffectiveTypeAnnotationNode(symbol.parent.valueDeclaration);\n                if (typeNode_2) {\n                    return getTypeOfPropertyOfType(getTypeFromTypeNode(typeNode_2), symbol.escapedName);\n                }\n            }\n            return declaredType;\n        }\n        /** If we don't have an explicit JSDoc type, get the type from the initializer. */\n        function getInitializerTypeFromAssignmentDeclaration(symbol, resolvedSymbol, expression, kind) {\n            if (ts.isCallExpression(expression)) {\n                if (resolvedSymbol) {\n                    return getTypeOfSymbol(resolvedSymbol); // This shouldn't happen except under some hopefully forbidden merges of export assignments and object define assignments\n                }\n                var objectLitType = checkExpressionCached(expression.arguments[2]);\n                var valueType = getTypeOfPropertyOfType(objectLitType, \"value\");\n                if (valueType) {\n                    return valueType;\n                }\n                var getFunc = getTypeOfPropertyOfType(objectLitType, \"get\");\n                if (getFunc) {\n                    var getSig = getSingleCallSignature(getFunc);\n                    if (getSig) {\n                        return getReturnTypeOfSignature(getSig);\n                    }\n                }\n                var setFunc = getTypeOfPropertyOfType(objectLitType, \"set\");\n                if (setFunc) {\n                    var setSig = getSingleCallSignature(setFunc);\n                    if (setSig) {\n                        return getTypeOfFirstParameterOfSignature(setSig);\n                    }\n                }\n                return anyType;\n            }\n            if (containsSameNamedThisProperty(expression.left, expression.right)) {\n                return anyType;\n            }\n            var type = resolvedSymbol ? getTypeOfSymbol(resolvedSymbol) : getWidenedLiteralType(checkExpressionCached(expression.right));\n            if (type.flags & 524288 /* Object */ &&\n                kind === 2 /* ModuleExports */ &&\n                symbol.escapedName === \"export=\" /* ExportEquals */) {\n                var exportedType = resolveStructuredTypeMembers(type);\n                var members_4 = ts.createSymbolTable();\n                ts.copyEntries(exportedType.members, members_4);\n                var initialSize = members_4.size;\n                if (resolvedSymbol && !resolvedSymbol.exports) {\n                    resolvedSymbol.exports = ts.createSymbolTable();\n                }\n                (resolvedSymbol || symbol).exports.forEach(function (s, name) {\n                    var _a;\n                    var exportedMember = members_4.get(name);\n                    if (exportedMember && exportedMember !== s) {\n                        if (s.flags & 111551 /* Value */ && exportedMember.flags & 111551 /* Value */) {\n                            // If the member has an additional value-like declaration, union the types from the two declarations,\n                            // but issue an error if they occurred in two different files. The purpose is to support a JS file with\n                            // a pattern like:\n                            //\n                            // module.exports = { a: true };\n                            // module.exports.a = 3;\n                            //\n                            // but we may have a JS file with `module.exports = { a: true }` along with a TypeScript module augmentation\n                            // declaring an `export const a: number`. In that case, we issue a duplicate identifier error, because\n                            // it's unclear what that's supposed to mean, so it's probably a mistake.\n                            if (ts.getSourceFileOfNode(s.valueDeclaration) !== ts.getSourceFileOfNode(exportedMember.valueDeclaration)) {\n                                var unescapedName = ts.unescapeLeadingUnderscores(s.escapedName);\n                                var exportedMemberName = ((_a = ts.tryCast(exportedMember.valueDeclaration, ts.isNamedDeclaration)) === null || _a === void 0 ? void 0 : _a.name) || exportedMember.valueDeclaration;\n                                ts.addRelatedInfo(error(s.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(exportedMemberName, ts.Diagnostics._0_was_also_declared_here, unescapedName));\n                                ts.addRelatedInfo(error(exportedMemberName, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(s.valueDeclaration, ts.Diagnostics._0_was_also_declared_here, unescapedName));\n                            }\n                            var union = createSymbol(s.flags | exportedMember.flags, name);\n                            union.type = getUnionType([getTypeOfSymbol(s), getTypeOfSymbol(exportedMember)]);\n                            union.valueDeclaration = exportedMember.valueDeclaration;\n                            union.declarations = ts.concatenate(exportedMember.declarations, s.declarations);\n                            members_4.set(name, union);\n                        }\n                        else {\n                            members_4.set(name, mergeSymbol(s, exportedMember));\n                        }\n                    }\n                    else {\n                        members_4.set(name, s);\n                    }\n                });\n                var result = createAnonymousType(initialSize !== members_4.size ? undefined : exportedType.symbol, // Only set the type's symbol if it looks to be the same as the original type\n                members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.stringIndexInfo, exportedType.numberIndexInfo);\n                result.objectFlags |= (ts.getObjectFlags(type) & 16384 /* JSLiteral */); // Propagate JSLiteral flag\n                if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {\n                    result.objectFlags |= 1073741824 /* IsClassInstanceClone */; // Propagate the knowledge that this type is equivalent to the symbol's class instance type\n                }\n                return result;\n            }\n            if (isEmptyArrayLiteralType(type)) {\n                reportImplicitAny(expression, anyArrayType);\n                return anyArrayType;\n            }\n            return type;\n        }\n        function containsSameNamedThisProperty(thisProperty, expression) {\n            return ts.isPropertyAccessExpression(thisProperty)\n                && thisProperty.expression.kind === 107 /* ThisKeyword */\n                && ts.forEachChildRecursively(expression, function (n) { return isMatchingReference(thisProperty, n); });\n        }\n        function isDeclarationInConstructor(expression) {\n            var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false);\n            // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added.\n            // Function expressions that are assigned to the prototype count as methods.\n            return thisContainer.kind === 166 /* Constructor */ ||\n                thisContainer.kind === 251 /* FunctionDeclaration */ ||\n                (thisContainer.kind === 208 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent));\n        }\n        function getConstructorDefinedThisAssignmentTypes(types, declarations) {\n            ts.Debug.assert(types.length === declarations.length);\n            return types.filter(function (_, i) {\n                var declaration = declarations[i];\n                var expression = ts.isBinaryExpression(declaration) ? declaration :\n                    ts.isBinaryExpression(declaration.parent) ? declaration.parent : undefined;\n                return expression && isDeclarationInConstructor(expression);\n            });\n        }\n        // Return the type implied by a binding pattern element. This is the type of the initializer of the element if\n        // one is present. Otherwise, if the element is itself a binding pattern, it is the type implied by the binding\n        // pattern. Otherwise, it is the type any.\n        function getTypeFromBindingElement(element, includePatternInType, reportErrors) {\n            if (element.initializer) {\n                // The type implied by a binding pattern is independent of context, so we check the initializer with no\n                // contextual type or, if the element itself is a binding pattern, with the type implied by that binding\n                // pattern.\n                var contextualType = ts.isBindingPattern(element.name) ? getTypeFromBindingPattern(element.name, /*includePatternInType*/ true, /*reportErrors*/ false) : unknownType;\n                return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, contextualType)));\n            }\n            if (ts.isBindingPattern(element.name)) {\n                return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors);\n            }\n            if (reportErrors && !declarationBelongsToPrivateAmbientMember(element)) {\n                reportImplicitAny(element, anyType);\n            }\n            // When we're including the pattern in the type (an indication we're obtaining a contextual type), we\n            // use the non-inferrable any type. Inference will never directly infer this type, but it is possible\n            // to infer a type that contains it, e.g. for a binding pattern like [foo] or { foo }. In such cases,\n            // widening of the binding pattern type substitutes a regular any for the non-inferrable any.\n            return includePatternInType ? nonInferrableAnyType : anyType;\n        }\n        // Return the type implied by an object binding pattern\n        function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) {\n            var members = ts.createSymbolTable();\n            var stringIndexInfo;\n            var objectFlags = 128 /* ObjectLiteral */ | 1048576 /* ContainsObjectOrArrayLiteral */;\n            ts.forEach(pattern.elements, function (e) {\n                var name = e.propertyName || e.name;\n                if (e.dotDotDotToken) {\n                    stringIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false);\n                    return;\n                }\n                var exprType = getLiteralTypeFromPropertyName(name);\n                if (!isTypeUsableAsPropertyName(exprType)) {\n                    // do not include computed properties in the implied type\n                    objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */;\n                    return;\n                }\n                var text = getPropertyNameFromType(exprType);\n                var flags = 4 /* Property */ | (e.initializer ? 16777216 /* Optional */ : 0);\n                var symbol = createSymbol(flags, text);\n                symbol.type = getTypeFromBindingElement(e, includePatternInType, reportErrors);\n                symbol.bindingElement = e;\n                members.set(symbol.escapedName, symbol);\n            });\n            var result = createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, undefined);\n            result.objectFlags |= objectFlags;\n            if (includePatternInType) {\n                result.pattern = pattern;\n                result.objectFlags |= 1048576 /* ContainsObjectOrArrayLiteral */;\n            }\n            return result;\n        }\n        // Return the type implied by an array binding pattern\n        function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) {\n            var elements = pattern.elements;\n            var lastElement = ts.lastOrUndefined(elements);\n            var restElement = lastElement && lastElement.kind === 198 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : undefined;\n            if (elements.length === 0 || elements.length === 1 && restElement) {\n                return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType;\n            }\n            var elementTypes = ts.map(elements, function (e) { return ts.isOmittedExpression(e) ? anyType : getTypeFromBindingElement(e, includePatternInType, reportErrors); });\n            var minLength = ts.findLastIndex(elements, function (e) { return !(e === restElement || ts.isOmittedExpression(e) || hasDefaultValue(e)); }, elements.length - 1) + 1;\n            var elementFlags = ts.map(elements, function (e, i) { return e === restElement ? 4 /* Rest */ : i >= minLength ? 2 /* Optional */ : 1 /* Required */; });\n            var result = createTupleType(elementTypes, elementFlags);\n            if (includePatternInType) {\n                result = cloneTypeReference(result);\n                result.pattern = pattern;\n                result.objectFlags |= 1048576 /* ContainsObjectOrArrayLiteral */;\n            }\n            return result;\n        }\n        // Return the type implied by a binding pattern. This is the type implied purely by the binding pattern itself\n        // and without regard to its context (i.e. without regard any type annotation or initializer associated with the\n        // declaration in which the binding pattern is contained). For example, the implied type of [x, y] is [any, any]\n        // and the implied type of { x, y: z = 1 } is { x: any; y: number; }. The type implied by a binding pattern is\n        // used as the contextual type of an initializer associated with the binding pattern. Also, for a destructuring\n        // parameter with no type annotation or initializer, the type implied by the binding pattern becomes the type of\n        // the parameter.\n        function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) {\n            if (includePatternInType === void 0) { includePatternInType = false; }\n            if (reportErrors === void 0) { reportErrors = false; }\n            return pattern.kind === 196 /* ObjectBindingPattern */\n                ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors)\n                : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors);\n        }\n        // Return the type associated with a variable, parameter, or property declaration. In the simple case this is the type\n        // specified in a type annotation or inferred from an initializer. However, in the case of a destructuring declaration it\n        // is a bit more involved. For example:\n        //\n        //   var [x, s = \"\"] = [1, \"one\"];\n        //\n        // Here, the array literal [1, \"one\"] is contextually typed by the type [any, string], which is the implied type of the\n        // binding pattern [x, s = \"\"]. Because the contextual type is a tuple type, the resulting type of [1, \"one\"] is the\n        // tuple type [number, string]. Thus, the type inferred for 'x' is number and the type inferred for 's' is string.\n        function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) {\n            return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true), declaration, reportErrors);\n        }\n        function widenTypeForVariableLikeDeclaration(type, declaration, reportErrors) {\n            if (type) {\n                if (reportErrors) {\n                    reportErrorsFromWidening(declaration, type);\n                }\n                // always widen a 'unique symbol' type if the type was created for a different declaration.\n                if (type.flags & 8192 /* UniqueESSymbol */ && (ts.isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfNode(declaration)) {\n                    type = esSymbolType;\n                }\n                return getWidenedType(type);\n            }\n            // Rest parameters default to type any[], other parameters default to type any\n            type = ts.isParameter(declaration) && declaration.dotDotDotToken ? anyArrayType : anyType;\n            // Report implicit any errors unless this is a private property within an ambient declaration\n            if (reportErrors) {\n                if (!declarationBelongsToPrivateAmbientMember(declaration)) {\n                    reportImplicitAny(declaration, type);\n                }\n            }\n            return type;\n        }\n        function declarationBelongsToPrivateAmbientMember(declaration) {\n            var root = ts.getRootDeclaration(declaration);\n            var memberDeclaration = root.kind === 160 /* Parameter */ ? root.parent : root;\n            return isPrivateWithinAmbient(memberDeclaration);\n        }\n        function tryGetTypeFromEffectiveTypeNode(declaration) {\n            var typeNode = ts.getEffectiveTypeAnnotationNode(declaration);\n            if (typeNode) {\n                return getTypeFromTypeNode(typeNode);\n            }\n        }\n        function getTypeOfVariableOrParameterOrProperty(symbol) {\n            var links = getSymbolLinks(symbol);\n            if (!links.type) {\n                var type = getTypeOfVariableOrParameterOrPropertyWorker(symbol);\n                // For a contextually typed parameter it is possible that a type has already\n                // been assigned (in assignTypeToParameterAndFixTypeParameters), and we want\n                // to preserve this type.\n                if (!links.type) {\n                    links.type = type;\n                }\n            }\n            return links.type;\n        }\n        function getTypeOfVariableOrParameterOrPropertyWorker(symbol) {\n            // Handle prototype property\n            if (symbol.flags & 4194304 /* Prototype */) {\n                return getTypeOfPrototypeProperty(symbol);\n            }\n            // CommonsJS require and module both have type any.\n            if (symbol === requireSymbol) {\n                return anyType;\n            }\n            if (symbol.flags & 134217728 /* ModuleExports */) {\n                var fileSymbol = getSymbolOfNode(ts.getSourceFileOfNode(symbol.valueDeclaration));\n                var result = createSymbol(fileSymbol.flags, \"exports\");\n                result.declarations = fileSymbol.declarations ? fileSymbol.declarations.slice() : [];\n                result.parent = symbol;\n                result.target = fileSymbol;\n                if (fileSymbol.valueDeclaration)\n                    result.valueDeclaration = fileSymbol.valueDeclaration;\n                if (fileSymbol.members)\n                    result.members = new ts.Map(fileSymbol.members);\n                if (fileSymbol.exports)\n                    result.exports = new ts.Map(fileSymbol.exports);\n                var members = ts.createSymbolTable();\n                members.set(\"exports\", result);\n                return createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, undefined, undefined);\n            }\n            // Handle catch clause variables\n            var declaration = symbol.valueDeclaration;\n            if (ts.isCatchClauseVariableDeclarationOrBindingElement(declaration)) {\n                var decl = declaration;\n                if (!decl.type)\n                    return anyType;\n                var type_1 = getTypeOfNode(decl.type);\n                // an errorType will make `checkTryStatement` issue an error\n                return isTypeAny(type_1) || type_1 === unknownType ? type_1 : errorType;\n            }\n            // Handle export default expressions\n            if (ts.isSourceFile(declaration) && ts.isJsonSourceFile(declaration)) {\n                if (!declaration.statements.length) {\n                    return emptyObjectType;\n                }\n                return getWidenedType(getWidenedLiteralType(checkExpression(declaration.statements[0].expression)));\n            }\n            // Handle variable, parameter or property\n            if (!pushTypeResolution(symbol, 0 /* Type */)) {\n                // Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty`\n                if (symbol.flags & 512 /* ValueModule */ && !(symbol.flags & 67108864 /* Assignment */)) {\n                    return getTypeOfFuncClassEnumModule(symbol);\n                }\n                return reportCircularityError(symbol);\n            }\n            var type;\n            if (declaration.kind === 266 /* ExportAssignment */) {\n                type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration);\n            }\n            else if (ts.isBinaryExpression(declaration) ||\n                (ts.isInJSFile(declaration) &&\n                    (ts.isCallExpression(declaration) || (ts.isPropertyAccessExpression(declaration) || ts.isBindableStaticElementAccessExpression(declaration)) && ts.isBinaryExpression(declaration.parent)))) {\n                type = getWidenedTypeForAssignmentDeclaration(symbol);\n            }\n            else if (ts.isPropertyAccessExpression(declaration)\n                || ts.isElementAccessExpression(declaration)\n                || ts.isIdentifier(declaration)\n                || ts.isStringLiteralLike(declaration)\n                || ts.isNumericLiteral(declaration)\n                || ts.isClassDeclaration(declaration)\n                || ts.isFunctionDeclaration(declaration)\n                || (ts.isMethodDeclaration(declaration) && !ts.isObjectLiteralMethod(declaration))\n                || ts.isMethodSignature(declaration)\n                || ts.isSourceFile(declaration)) {\n                // Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty`\n                if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) {\n                    return getTypeOfFuncClassEnumModule(symbol);\n                }\n                type = ts.isBinaryExpression(declaration.parent) ?\n                    getWidenedTypeForAssignmentDeclaration(symbol) :\n                    tryGetTypeFromEffectiveTypeNode(declaration) || anyType;\n            }\n            else if (ts.isPropertyAssignment(declaration)) {\n                type = tryGetTypeFromEffectiveTypeNode(declaration) || checkPropertyAssignment(declaration);\n            }\n            else if (ts.isJsxAttribute(declaration)) {\n                type = tryGetTypeFromEffectiveTypeNode(declaration) || checkJsxAttribute(declaration);\n            }\n            else if (ts.isShorthandPropertyAssignment(declaration)) {\n                type = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation(declaration.name, 0 /* Normal */);\n            }\n            else if (ts.isObjectLiteralMethod(declaration)) {\n                type = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod(declaration, 0 /* Normal */);\n            }\n            else if (ts.isParameter(declaration)\n                || ts.isPropertyDeclaration(declaration)\n                || ts.isPropertySignature(declaration)\n                || ts.isVariableDeclaration(declaration)\n                || ts.isBindingElement(declaration)\n                || ts.isJSDocPropertyLikeTag(declaration)) {\n                type = getWidenedTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true);\n            }\n            // getTypeOfSymbol dispatches some JS merges incorrectly because their symbol flags are not mutually exclusive.\n            // Re-dispatch based on valueDeclaration.kind instead.\n            else if (ts.isEnumDeclaration(declaration)) {\n                type = getTypeOfFuncClassEnumModule(symbol);\n            }\n            else if (ts.isEnumMember(declaration)) {\n                type = getTypeOfEnumMember(symbol);\n            }\n            else if (ts.isAccessor(declaration)) {\n                type = resolveTypeOfAccessors(symbol);\n            }\n            else {\n                return ts.Debug.fail(\"Unhandled declaration kind! \" + ts.Debug.formatSyntaxKind(declaration.kind) + \" for \" + ts.Debug.formatSymbol(symbol));\n            }\n            if (!popTypeResolution()) {\n                // Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty`\n                if (symbol.flags & 512 /* ValueModule */ && !(symbol.flags & 67108864 /* Assignment */)) {\n                    return getTypeOfFuncClassEnumModule(symbol);\n                }\n                return reportCircularityError(symbol);\n            }\n            return type;\n        }\n        function getAnnotatedAccessorTypeNode(accessor) {\n            if (accessor) {\n                if (accessor.kind === 167 /* GetAccessor */) {\n                    var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor);\n                    return getterTypeAnnotation;\n                }\n                else {\n                    var setterTypeAnnotation = ts.getEffectiveSetAccessorTypeAnnotationNode(accessor);\n                    return setterTypeAnnotation;\n                }\n            }\n            return undefined;\n        }\n        function getAnnotatedAccessorType(accessor) {\n            var node = getAnnotatedAccessorTypeNode(accessor);\n            return node && getTypeFromTypeNode(node);\n        }\n        function getAnnotatedAccessorThisParameter(accessor) {\n            var parameter = getAccessorThisParameter(accessor);\n            return parameter && parameter.symbol;\n        }\n        function getThisTypeOfDeclaration(declaration) {\n            return getThisTypeOfSignature(getSignatureFromDeclaration(declaration));\n        }\n        function getTypeOfAccessors(symbol) {\n            var links = getSymbolLinks(symbol);\n            return links.type || (links.type = getTypeOfAccessorsWorker(symbol));\n        }\n        function getTypeOfAccessorsWorker(symbol) {\n            if (!pushTypeResolution(symbol, 0 /* Type */)) {\n                return errorType;\n            }\n            var type = resolveTypeOfAccessors(symbol);\n            if (!popTypeResolution()) {\n                type = anyType;\n                if (noImplicitAny) {\n                    var getter = ts.getDeclarationOfKind(symbol, 167 /* GetAccessor */);\n                    error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol));\n                }\n            }\n            return type;\n        }\n        function resolveTypeOfAccessors(symbol) {\n            var getter = ts.getDeclarationOfKind(symbol, 167 /* GetAccessor */);\n            var setter = ts.getDeclarationOfKind(symbol, 168 /* SetAccessor */);\n            if (getter && ts.isInJSFile(getter)) {\n                var jsDocType = getTypeForDeclarationFromJSDocComment(getter);\n                if (jsDocType) {\n                    return jsDocType;\n                }\n            }\n            // First try to see if the user specified a return type on the get-accessor.\n            var getterReturnType = getAnnotatedAccessorType(getter);\n            if (getterReturnType) {\n                return getterReturnType;\n            }\n            else {\n                // If the user didn't specify a return type, try to use the set-accessor's parameter type.\n                var setterParameterType = getAnnotatedAccessorType(setter);\n                if (setterParameterType) {\n                    return setterParameterType;\n                }\n                else {\n                    // If there are no specified types, try to infer it from the body of the get accessor if it exists.\n                    if (getter && getter.body) {\n                        return getReturnTypeFromBody(getter);\n                    }\n                    // Otherwise, fall back to 'any'.\n                    else {\n                        if (setter) {\n                            if (!isPrivateWithinAmbient(setter)) {\n                                errorOrSuggestion(noImplicitAny, setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol));\n                            }\n                        }\n                        else {\n                            ts.Debug.assert(!!getter, \"there must exist a getter as we are current checking either setter or getter in this function\");\n                            if (!isPrivateWithinAmbient(getter)) {\n                                errorOrSuggestion(noImplicitAny, getter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation, symbolToString(symbol));\n                            }\n                        }\n                        return anyType;\n                    }\n                }\n            }\n        }\n        function getBaseTypeVariableOfClass(symbol) {\n            var baseConstructorType = getBaseConstructorTypeOfClass(getDeclaredTypeOfClassOrInterface(symbol));\n            return baseConstructorType.flags & 8650752 /* TypeVariable */ ? baseConstructorType :\n                baseConstructorType.flags & 2097152 /* Intersection */ ? ts.find(baseConstructorType.types, function (t) { return !!(t.flags & 8650752 /* TypeVariable */); }) :\n                    undefined;\n        }\n        function getTypeOfFuncClassEnumModule(symbol) {\n            var links = getSymbolLinks(symbol);\n            var originalLinks = links;\n            if (!links.type) {\n                var expando = symbol.valueDeclaration && getSymbolOfExpando(symbol.valueDeclaration, /*allowDeclaration*/ false);\n                if (expando) {\n                    var merged = mergeJSSymbols(symbol, expando);\n                    if (merged) {\n                        // note:we overwrite links because we just cloned the symbol\n                        symbol = links = merged;\n                    }\n                }\n                originalLinks.type = links.type = getTypeOfFuncClassEnumModuleWorker(symbol);\n            }\n            return links.type;\n        }\n        function getTypeOfFuncClassEnumModuleWorker(symbol) {\n            var declaration = symbol.valueDeclaration;\n            if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) {\n                return anyType;\n            }\n            else if (declaration && (declaration.kind === 216 /* BinaryExpression */ ||\n                ts.isAccessExpression(declaration) &&\n                    declaration.parent.kind === 216 /* BinaryExpression */)) {\n                return getWidenedTypeForAssignmentDeclaration(symbol);\n            }\n            else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) {\n                var resolvedModule = resolveExternalModuleSymbol(symbol);\n                if (resolvedModule !== symbol) {\n                    if (!pushTypeResolution(symbol, 0 /* Type */)) {\n                        return errorType;\n                    }\n                    var exportEquals = getMergedSymbol(symbol.exports.get(\"export=\" /* ExportEquals */));\n                    var type_2 = getWidenedTypeForAssignmentDeclaration(exportEquals, exportEquals === resolvedModule ? undefined : resolvedModule);\n                    if (!popTypeResolution()) {\n                        return reportCircularityError(symbol);\n                    }\n                    return type_2;\n                }\n            }\n            var type = createObjectType(16 /* Anonymous */, symbol);\n            if (symbol.flags & 32 /* Class */) {\n                var baseTypeVariable = getBaseTypeVariableOfClass(symbol);\n                return baseTypeVariable ? getIntersectionType([type, baseTypeVariable]) : type;\n            }\n            else {\n                return strictNullChecks && symbol.flags & 16777216 /* Optional */ ? getOptionalType(type) : type;\n            }\n        }\n        function getTypeOfEnumMember(symbol) {\n            var links = getSymbolLinks(symbol);\n            return links.type || (links.type = getDeclaredTypeOfEnumMember(symbol));\n        }\n        function getTypeOfAlias(symbol) {\n            var links = getSymbolLinks(symbol);\n            if (!links.type) {\n                var targetSymbol = resolveAlias(symbol);\n                // It only makes sense to get the type of a value symbol. If the result of resolving\n                // the alias is not a value, then it has no type. To get the type associated with a\n                // type symbol, call getDeclaredTypeOfSymbol.\n                // This check is important because without it, a call to getTypeOfSymbol could end\n                // up recursively calling getTypeOfAlias, causing a stack overflow.\n                links.type = targetSymbol.flags & 111551 /* Value */\n                    ? getTypeOfSymbol(targetSymbol)\n                    : errorType;\n            }\n            return links.type;\n        }\n        function getTypeOfInstantiatedSymbol(symbol) {\n            var links = getSymbolLinks(symbol);\n            if (!links.type) {\n                if (!pushTypeResolution(symbol, 0 /* Type */)) {\n                    return links.type = errorType;\n                }\n                var type = instantiateType(getTypeOfSymbol(links.target), links.mapper);\n                if (!popTypeResolution()) {\n                    type = reportCircularityError(symbol);\n                }\n                links.type = type;\n            }\n            return links.type;\n        }\n        function reportCircularityError(symbol) {\n            var declaration = symbol.valueDeclaration;\n            // Check if variable has type annotation that circularly references the variable itself\n            if (ts.getEffectiveTypeAnnotationNode(declaration)) {\n                error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));\n                return errorType;\n            }\n            // Check if variable has initializer that circularly references the variable itself\n            if (noImplicitAny && (declaration.kind !== 160 /* Parameter */ || declaration.initializer)) {\n                error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol));\n            }\n            // Circularities could also result from parameters in function expressions that end up\n            // having themselves as contextual types following type argument inference. In those cases\n            // we have already reported an implicit any error so we don't report anything here.\n            return anyType;\n        }\n        function getTypeOfSymbolWithDeferredType(symbol) {\n            var links = getSymbolLinks(symbol);\n            if (!links.type) {\n                ts.Debug.assertIsDefined(links.deferralParent);\n                ts.Debug.assertIsDefined(links.deferralConstituents);\n                links.type = links.deferralParent.flags & 1048576 /* Union */ ? getUnionType(links.deferralConstituents) : getIntersectionType(links.deferralConstituents);\n            }\n            return links.type;\n        }\n        function getTypeOfSymbol(symbol) {\n            var checkFlags = ts.getCheckFlags(symbol);\n            if (checkFlags & 65536 /* DeferredType */) {\n                return getTypeOfSymbolWithDeferredType(symbol);\n            }\n            if (checkFlags & 1 /* Instantiated */) {\n                return getTypeOfInstantiatedSymbol(symbol);\n            }\n            if (checkFlags & 262144 /* Mapped */) {\n                return getTypeOfMappedSymbol(symbol);\n            }\n            if (checkFlags & 8192 /* ReverseMapped */) {\n                return getTypeOfReverseMappedSymbol(symbol);\n            }\n            if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) {\n                return getTypeOfVariableOrParameterOrProperty(symbol);\n            }\n            if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) {\n                return getTypeOfFuncClassEnumModule(symbol);\n            }\n            if (symbol.flags & 8 /* EnumMember */) {\n                return getTypeOfEnumMember(symbol);\n            }\n            if (symbol.flags & 98304 /* Accessor */) {\n                return getTypeOfAccessors(symbol);\n            }\n            if (symbol.flags & 2097152 /* Alias */) {\n                return getTypeOfAlias(symbol);\n            }\n            return errorType;\n        }\n        function isReferenceToType(type, target) {\n            return type !== undefined\n                && target !== undefined\n                && (ts.getObjectFlags(type) & 4 /* Reference */) !== 0\n                && type.target === target;\n        }\n        function getTargetType(type) {\n            return ts.getObjectFlags(type) & 4 /* Reference */ ? type.target : type;\n        }\n        // TODO: GH#18217 If `checkBase` is undefined, we should not call this because this will always return false.\n        function hasBaseType(type, checkBase) {\n            return check(type);\n            function check(type) {\n                if (ts.getObjectFlags(type) & (3 /* ClassOrInterface */ | 4 /* Reference */)) {\n                    var target = getTargetType(type);\n                    return target === checkBase || ts.some(getBaseTypes(target), check);\n                }\n                else if (type.flags & 2097152 /* Intersection */) {\n                    return ts.some(type.types, check);\n                }\n                return false;\n            }\n        }\n        // Appends the type parameters given by a list of declarations to a set of type parameters and returns the resulting set.\n        // The function allocates a new array if the input type parameter set is undefined, but otherwise it modifies the set\n        // in-place and returns the same array.\n        function appendTypeParameters(typeParameters, declarations) {\n            for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) {\n                var declaration = declarations_2[_i];\n                typeParameters = ts.appendIfUnique(typeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)));\n            }\n            return typeParameters;\n        }\n        // Return the outer type parameters of a node or undefined if the node has no outer type parameters.\n        function getOuterTypeParameters(node, includeThisTypes) {\n            while (true) {\n                node = node.parent; // TODO: GH#18217 Use SourceFile kind check instead\n                if (node && ts.isBinaryExpression(node)) {\n                    // prototype assignments get the outer type parameters of their constructor function\n                    var assignmentKind = ts.getAssignmentDeclarationKind(node);\n                    if (assignmentKind === 6 /* Prototype */ || assignmentKind === 3 /* PrototypeProperty */) {\n                        var symbol = getSymbolOfNode(node.left);\n                        if (symbol && symbol.parent && !ts.findAncestor(symbol.parent.valueDeclaration, function (d) { return node === d; })) {\n                            node = symbol.parent.valueDeclaration;\n                        }\n                    }\n                }\n                if (!node) {\n                    return undefined;\n                }\n                switch (node.kind) {\n                    case 232 /* VariableStatement */:\n                    case 252 /* ClassDeclaration */:\n                    case 221 /* ClassExpression */:\n                    case 253 /* InterfaceDeclaration */:\n                    case 169 /* CallSignature */:\n                    case 170 /* ConstructSignature */:\n                    case 164 /* MethodSignature */:\n                    case 174 /* FunctionType */:\n                    case 175 /* ConstructorType */:\n                    case 308 /* JSDocFunctionType */:\n                    case 251 /* FunctionDeclaration */:\n                    case 165 /* MethodDeclaration */:\n                    case 208 /* FunctionExpression */:\n                    case 209 /* ArrowFunction */:\n                    case 254 /* TypeAliasDeclaration */:\n                    case 330 /* JSDocTemplateTag */:\n                    case 331 /* JSDocTypedefTag */:\n                    case 325 /* JSDocEnumTag */:\n                    case 324 /* JSDocCallbackTag */:\n                    case 190 /* MappedType */:\n                    case 184 /* ConditionalType */:\n                        var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);\n                        if (node.kind === 190 /* MappedType */) {\n                            return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)));\n                        }\n                        else if (node.kind === 184 /* ConditionalType */) {\n                            return ts.concatenate(outerTypeParameters, getInferTypeParameters(node));\n                        }\n                        else if (node.kind === 232 /* VariableStatement */ && !ts.isInJSFile(node)) {\n                            break;\n                        }\n                        var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node));\n                        var thisType = includeThisTypes &&\n                            (node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */ || node.kind === 253 /* InterfaceDeclaration */ || isJSConstructor(node)) &&\n                            getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;\n                        return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters;\n                    case 326 /* JSDocParameterTag */:\n                        var paramSymbol = ts.getParameterSymbolFromJSDoc(node);\n                        if (paramSymbol) {\n                            node = paramSymbol.valueDeclaration;\n                        }\n                        break;\n                }\n            }\n        }\n        // The outer type parameters are those defined by enclosing generic classes, methods, or functions.\n        function getOuterTypeParametersOfClassOrInterface(symbol) {\n            var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 253 /* InterfaceDeclaration */);\n            ts.Debug.assert(!!declaration, \"Class was missing valueDeclaration -OR- non-class had no interface declarations\");\n            return getOuterTypeParameters(declaration);\n        }\n        // The local type parameters are the combined set of type parameters from all declarations of the class,\n        // interface, or type alias.\n        function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) {\n            var result;\n            for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                var node = _a[_i];\n                if (node.kind === 253 /* InterfaceDeclaration */ ||\n                    node.kind === 252 /* ClassDeclaration */ ||\n                    node.kind === 221 /* ClassExpression */ ||\n                    isJSConstructor(node) ||\n                    ts.isTypeAlias(node)) {\n                    var declaration = node;\n                    result = appendTypeParameters(result, ts.getEffectiveTypeParameterDeclarations(declaration));\n                }\n            }\n            return result;\n        }\n        // The full set of type parameters for a generic class or interface type consists of its outer type parameters plus\n        // its locally declared type parameters.\n        function getTypeParametersOfClassOrInterface(symbol) {\n            return ts.concatenate(getOuterTypeParametersOfClassOrInterface(symbol), getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol));\n        }\n        // A type is a mixin constructor if it has a single construct signature taking no type parameters and a single\n        // rest parameter of type any[].\n        function isMixinConstructorType(type) {\n            var signatures = getSignaturesOfType(type, 1 /* Construct */);\n            if (signatures.length === 1) {\n                var s = signatures[0];\n                if (!s.typeParameters && s.parameters.length === 1 && signatureHasRestParameter(s)) {\n                    var paramType = getTypeOfParameter(s.parameters[0]);\n                    return isTypeAny(paramType) || getElementTypeOfArrayType(paramType) === anyType;\n                }\n            }\n            return false;\n        }\n        function isConstructorType(type) {\n            if (getSignaturesOfType(type, 1 /* Construct */).length > 0) {\n                return true;\n            }\n            if (type.flags & 8650752 /* TypeVariable */) {\n                var constraint = getBaseConstraintOfType(type);\n                return !!constraint && isMixinConstructorType(constraint);\n            }\n            return false;\n        }\n        function getBaseTypeNodeOfClass(type) {\n            return ts.getEffectiveBaseTypeNode(type.symbol.valueDeclaration);\n        }\n        function getConstructorsForTypeArguments(type, typeArgumentNodes, location) {\n            var typeArgCount = ts.length(typeArgumentNodes);\n            var isJavascript = ts.isInJSFile(location);\n            return ts.filter(getSignaturesOfType(type, 1 /* Construct */), function (sig) { return (isJavascript || typeArgCount >= getMinTypeArgumentCount(sig.typeParameters)) && typeArgCount <= ts.length(sig.typeParameters); });\n        }\n        function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes, location) {\n            var signatures = getConstructorsForTypeArguments(type, typeArgumentNodes, location);\n            var typeArguments = ts.map(typeArgumentNodes, getTypeFromTypeNode);\n            return ts.sameMap(signatures, function (sig) { return ts.some(sig.typeParameters) ? getSignatureInstantiation(sig, typeArguments, ts.isInJSFile(location)) : sig; });\n        }\n        /**\n         * The base constructor of a class can resolve to\n         * * undefinedType if the class has no extends clause,\n         * * unknownType if an error occurred during resolution of the extends expression,\n         * * nullType if the extends expression is the null value,\n         * * anyType if the extends expression has type any, or\n         * * an object type with at least one construct signature.\n         */\n        function getBaseConstructorTypeOfClass(type) {\n            if (!type.resolvedBaseConstructorType) {\n                var decl = type.symbol.valueDeclaration;\n                var extended = ts.getEffectiveBaseTypeNode(decl);\n                var baseTypeNode = getBaseTypeNodeOfClass(type);\n                if (!baseTypeNode) {\n                    return type.resolvedBaseConstructorType = undefinedType;\n                }\n                if (!pushTypeResolution(type, 1 /* ResolvedBaseConstructorType */)) {\n                    return errorType;\n                }\n                var baseConstructorType = checkExpression(baseTypeNode.expression);\n                if (extended && baseTypeNode !== extended) {\n                    ts.Debug.assert(!extended.typeArguments); // Because this is in a JS file, and baseTypeNode is in an @extends tag\n                    checkExpression(extended.expression);\n                }\n                if (baseConstructorType.flags & (524288 /* Object */ | 2097152 /* Intersection */)) {\n                    // Resolving the members of a class requires us to resolve the base class of that class.\n                    // We force resolution here such that we catch circularities now.\n                    resolveStructuredTypeMembers(baseConstructorType);\n                }\n                if (!popTypeResolution()) {\n                    error(type.symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression, symbolToString(type.symbol));\n                    return type.resolvedBaseConstructorType = errorType;\n                }\n                if (!(baseConstructorType.flags & 1 /* Any */) && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) {\n                    var err = error(baseTypeNode.expression, ts.Diagnostics.Type_0_is_not_a_constructor_function_type, typeToString(baseConstructorType));\n                    if (baseConstructorType.flags & 262144 /* TypeParameter */) {\n                        var constraint = getConstraintFromTypeParameter(baseConstructorType);\n                        var ctorReturn = unknownType;\n                        if (constraint) {\n                            var ctorSig = getSignaturesOfType(constraint, 1 /* Construct */);\n                            if (ctorSig[0]) {\n                                ctorReturn = getReturnTypeOfSignature(ctorSig[0]);\n                            }\n                        }\n                        ts.addRelatedInfo(err, ts.createDiagnosticForNode(baseConstructorType.symbol.declarations[0], ts.Diagnostics.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1, symbolToString(baseConstructorType.symbol), typeToString(ctorReturn)));\n                    }\n                    return type.resolvedBaseConstructorType = errorType;\n                }\n                type.resolvedBaseConstructorType = baseConstructorType;\n            }\n            return type.resolvedBaseConstructorType;\n        }\n        function getImplementsTypes(type) {\n            var resolvedImplementsTypes = ts.emptyArray;\n            for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) {\n                var declaration = _a[_i];\n                var implementsTypeNodes = ts.getEffectiveImplementsTypeNodes(declaration);\n                if (!implementsTypeNodes)\n                    continue;\n                for (var _b = 0, implementsTypeNodes_1 = implementsTypeNodes; _b < implementsTypeNodes_1.length; _b++) {\n                    var node = implementsTypeNodes_1[_b];\n                    var implementsType = getTypeFromTypeNode(node);\n                    if (implementsType !== errorType) {\n                        if (resolvedImplementsTypes === ts.emptyArray) {\n                            resolvedImplementsTypes = [implementsType];\n                        }\n                        else {\n                            resolvedImplementsTypes.push(implementsType);\n                        }\n                    }\n                }\n            }\n            return resolvedImplementsTypes;\n        }\n        function reportCircularBaseType(node, type) {\n            error(node, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, 2 /* WriteArrayAsGenericType */));\n        }\n        function getBaseTypes(type) {\n            if (!type.baseTypesResolved) {\n                if (pushTypeResolution(type, 7 /* ResolvedBaseTypes */)) {\n                    if (type.objectFlags & 8 /* Tuple */) {\n                        type.resolvedBaseTypes = [getTupleBaseType(type)];\n                    }\n                    else if (type.symbol.flags & (32 /* Class */ | 64 /* Interface */)) {\n                        if (type.symbol.flags & 32 /* Class */) {\n                            resolveBaseTypesOfClass(type);\n                        }\n                        if (type.symbol.flags & 64 /* Interface */) {\n                            resolveBaseTypesOfInterface(type);\n                        }\n                    }\n                    else {\n                        ts.Debug.fail(\"type must be class or interface\");\n                    }\n                    if (!popTypeResolution()) {\n                        for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) {\n                            var declaration = _a[_i];\n                            if (declaration.kind === 252 /* ClassDeclaration */ || declaration.kind === 253 /* InterfaceDeclaration */) {\n                                reportCircularBaseType(declaration, type);\n                            }\n                        }\n                    }\n                }\n                type.baseTypesResolved = true;\n            }\n            return type.resolvedBaseTypes;\n        }\n        function getTupleBaseType(type) {\n            var elementTypes = ts.sameMap(type.typeParameters, function (t, i) { return type.elementFlags[i] & 8 /* Variadic */ ? getIndexedAccessType(t, numberType) : t; });\n            return createArrayType(getUnionType(elementTypes || ts.emptyArray), type.readonly);\n        }\n        function resolveBaseTypesOfClass(type) {\n            type.resolvedBaseTypes = ts.resolvingEmptyArray;\n            var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type));\n            if (!(baseConstructorType.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 1 /* Any */))) {\n                return type.resolvedBaseTypes = ts.emptyArray;\n            }\n            var baseTypeNode = getBaseTypeNodeOfClass(type);\n            var baseType;\n            var originalBaseType = baseConstructorType.symbol ? getDeclaredTypeOfSymbol(baseConstructorType.symbol) : undefined;\n            if (baseConstructorType.symbol && baseConstructorType.symbol.flags & 32 /* Class */ &&\n                areAllOuterTypeParametersApplied(originalBaseType)) {\n                // When base constructor type is a class with no captured type arguments we know that the constructors all have the same type parameters as the\n                // class and all return the instance type of the class. There is no need for further checks and we can apply the\n                // type arguments in the same manner as a type reference to get the same error reporting experience.\n                baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol);\n            }\n            else if (baseConstructorType.flags & 1 /* Any */) {\n                baseType = baseConstructorType;\n            }\n            else {\n                // The class derives from a \"class-like\" constructor function, check that we have at least one construct signature\n                // with a matching number of type parameters and use the return type of the first instantiated signature. Elsewhere\n                // we check that all instantiated signatures return the same type.\n                var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments, baseTypeNode);\n                if (!constructors.length) {\n                    error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments);\n                    return type.resolvedBaseTypes = ts.emptyArray;\n                }\n                baseType = getReturnTypeOfSignature(constructors[0]);\n            }\n            if (baseType === errorType) {\n                return type.resolvedBaseTypes = ts.emptyArray;\n            }\n            var reducedBaseType = getReducedType(baseType);\n            if (!isValidBaseType(reducedBaseType)) {\n                var elaboration = elaborateNeverIntersection(/*errorInfo*/ undefined, baseType);\n                var diagnostic = ts.chainDiagnosticMessages(elaboration, ts.Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members, typeToString(reducedBaseType));\n                diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(baseTypeNode.expression, diagnostic));\n                return type.resolvedBaseTypes = ts.emptyArray;\n            }\n            if (type === reducedBaseType || hasBaseType(reducedBaseType, type)) {\n                error(type.symbol.valueDeclaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, 2 /* WriteArrayAsGenericType */));\n                return type.resolvedBaseTypes = ts.emptyArray;\n            }\n            if (type.resolvedBaseTypes === ts.resolvingEmptyArray) {\n                // Circular reference, likely through instantiation of default parameters\n                // (otherwise there'd be an error from hasBaseType) - this is fine, but `.members` should be reset\n                // as `getIndexedAccessType` via `instantiateType` via `getTypeFromClassOrInterfaceReference` forces a\n                // partial instantiation of the members without the base types fully resolved\n                type.members = undefined;\n            }\n            return type.resolvedBaseTypes = [reducedBaseType];\n        }\n        function areAllOuterTypeParametersApplied(type) {\n            // An unapplied type parameter has its symbol still the same as the matching argument symbol.\n            // Since parameters are applied outer-to-inner, only the last outer parameter needs to be checked.\n            var outerTypeParameters = type.outerTypeParameters;\n            if (outerTypeParameters) {\n                var last_1 = outerTypeParameters.length - 1;\n                var typeArguments = getTypeArguments(type);\n                return outerTypeParameters[last_1].symbol !== typeArguments[last_1].symbol;\n            }\n            return true;\n        }\n        // A valid base type is `any`, an object type or intersection of object types.\n        function isValidBaseType(type) {\n            if (type.flags & 262144 /* TypeParameter */) {\n                var constraint = getBaseConstraintOfType(type);\n                if (constraint) {\n                    return isValidBaseType(constraint);\n                }\n            }\n            // TODO: Given that we allow type parmeters here now, is this `!isGenericMappedType(type)` check really needed?\n            // There's no reason a `T` should be allowed while a `Readonly<T>` should not.\n            return !!(type.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 1 /* Any */) && !isGenericMappedType(type) ||\n                type.flags & 2097152 /* Intersection */ && ts.every(type.types, isValidBaseType));\n        }\n        function resolveBaseTypesOfInterface(type) {\n            type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray;\n            for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) {\n                var declaration = _a[_i];\n                if (declaration.kind === 253 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) {\n                    for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) {\n                        var node = _c[_b];\n                        var baseType = getReducedType(getTypeFromTypeNode(node));\n                        if (baseType !== errorType) {\n                            if (isValidBaseType(baseType)) {\n                                if (type !== baseType && !hasBaseType(baseType, type)) {\n                                    if (type.resolvedBaseTypes === ts.emptyArray) {\n                                        type.resolvedBaseTypes = [baseType];\n                                    }\n                                    else {\n                                        type.resolvedBaseTypes.push(baseType);\n                                    }\n                                }\n                                else {\n                                    reportCircularBaseType(declaration, type);\n                                }\n                            }\n                            else {\n                                error(node, ts.Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members);\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        /**\n         * Returns true if the interface given by the symbol is free of \"this\" references.\n         *\n         * Specifically, the result is true if the interface itself contains no references\n         * to \"this\" in its body, if all base types are interfaces,\n         * and if none of the base interfaces have a \"this\" type.\n         */\n        function isThislessInterface(symbol) {\n            for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                var declaration = _a[_i];\n                if (declaration.kind === 253 /* InterfaceDeclaration */) {\n                    if (declaration.flags & 128 /* ContainsThis */) {\n                        return false;\n                    }\n                    var baseTypeNodes = ts.getInterfaceBaseTypeNodes(declaration);\n                    if (baseTypeNodes) {\n                        for (var _b = 0, baseTypeNodes_1 = baseTypeNodes; _b < baseTypeNodes_1.length; _b++) {\n                            var node = baseTypeNodes_1[_b];\n                            if (ts.isEntityNameExpression(node.expression)) {\n                                var baseSymbol = resolveEntityName(node.expression, 788968 /* Type */, /*ignoreErrors*/ true);\n                                if (!baseSymbol || !(baseSymbol.flags & 64 /* Interface */) || getDeclaredTypeOfClassOrInterface(baseSymbol).thisType) {\n                                    return false;\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n            return true;\n        }\n        function getDeclaredTypeOfClassOrInterface(symbol) {\n            var links = getSymbolLinks(symbol);\n            var originalLinks = links;\n            if (!links.declaredType) {\n                var kind = symbol.flags & 32 /* Class */ ? 1 /* Class */ : 2 /* Interface */;\n                var merged = mergeJSSymbols(symbol, getAssignedClassSymbol(symbol.valueDeclaration));\n                if (merged) {\n                    // note:we overwrite links because we just cloned the symbol\n                    symbol = links = merged;\n                }\n                var type = originalLinks.declaredType = links.declaredType = createObjectType(kind, symbol);\n                var outerTypeParameters = getOuterTypeParametersOfClassOrInterface(symbol);\n                var localTypeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol);\n                // A class or interface is generic if it has type parameters or a \"this\" type. We always give classes a \"this\" type\n                // because it is not feasible to analyze all members to determine if the \"this\" type escapes the class (in particular,\n                // property types inferred from initializers and method return types inferred from return statements are very hard\n                // to exhaustively analyze). We give interfaces a \"this\" type if we can't definitely determine that they are free of\n                // \"this\" references.\n                if (outerTypeParameters || localTypeParameters || kind === 1 /* Class */ || !isThislessInterface(symbol)) {\n                    type.objectFlags |= 4 /* Reference */;\n                    type.typeParameters = ts.concatenate(outerTypeParameters, localTypeParameters);\n                    type.outerTypeParameters = outerTypeParameters;\n                    type.localTypeParameters = localTypeParameters;\n                    type.instantiations = new ts.Map();\n                    type.instantiations.set(getTypeListId(type.typeParameters), type);\n                    type.target = type;\n                    type.resolvedTypeArguments = type.typeParameters;\n                    type.thisType = createTypeParameter(symbol);\n                    type.thisType.isThisType = true;\n                    type.thisType.constraint = type;\n                }\n            }\n            return links.declaredType;\n        }\n        function getDeclaredTypeOfTypeAlias(symbol) {\n            var links = getSymbolLinks(symbol);\n            if (!links.declaredType) {\n                // Note that we use the links object as the target here because the symbol object is used as the unique\n                // identity for resolution of the 'type' property in SymbolLinks.\n                if (!pushTypeResolution(symbol, 2 /* DeclaredType */)) {\n                    return errorType;\n                }\n                var declaration = ts.Debug.checkDefined(ts.find(symbol.declarations, ts.isTypeAlias), \"Type alias symbol with no valid declaration found\");\n                var typeNode = ts.isJSDocTypeAlias(declaration) ? declaration.typeExpression : declaration.type;\n                // If typeNode is missing, we will error in checkJSDocTypedefTag.\n                var type = typeNode ? getTypeFromTypeNode(typeNode) : errorType;\n                if (popTypeResolution()) {\n                    var typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol);\n                    if (typeParameters) {\n                        // Initialize the instantiation cache for generic type aliases. The declared type corresponds to\n                        // an instantiation of the type alias with the type parameters supplied as type arguments.\n                        links.typeParameters = typeParameters;\n                        links.instantiations = new ts.Map();\n                        links.instantiations.set(getTypeListId(typeParameters), type);\n                    }\n                }\n                else {\n                    type = errorType;\n                    error(ts.isNamedDeclaration(declaration) ? declaration.name : declaration || declaration, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));\n                }\n                links.declaredType = type;\n            }\n            return links.declaredType;\n        }\n        function isStringConcatExpression(expr) {\n            if (ts.isStringLiteralLike(expr)) {\n                return true;\n            }\n            else if (expr.kind === 216 /* BinaryExpression */) {\n                return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right);\n            }\n            return false;\n        }\n        function isLiteralEnumMember(member) {\n            var expr = member.initializer;\n            if (!expr) {\n                return !(member.flags & 8388608 /* Ambient */);\n            }\n            switch (expr.kind) {\n                case 10 /* StringLiteral */:\n                case 8 /* NumericLiteral */:\n                case 14 /* NoSubstitutionTemplateLiteral */:\n                    return true;\n                case 214 /* PrefixUnaryExpression */:\n                    return expr.operator === 40 /* MinusToken */ &&\n                        expr.operand.kind === 8 /* NumericLiteral */;\n                case 78 /* Identifier */:\n                    return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText);\n                case 216 /* BinaryExpression */:\n                    return isStringConcatExpression(expr);\n                default:\n                    return false;\n            }\n        }\n        function getEnumKind(symbol) {\n            var links = getSymbolLinks(symbol);\n            if (links.enumKind !== undefined) {\n                return links.enumKind;\n            }\n            var hasNonLiteralMember = false;\n            for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                var declaration = _a[_i];\n                if (declaration.kind === 255 /* EnumDeclaration */) {\n                    for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {\n                        var member = _c[_b];\n                        if (member.initializer && ts.isStringLiteralLike(member.initializer)) {\n                            return links.enumKind = 1 /* Literal */;\n                        }\n                        if (!isLiteralEnumMember(member)) {\n                            hasNonLiteralMember = true;\n                        }\n                    }\n                }\n            }\n            return links.enumKind = hasNonLiteralMember ? 0 /* Numeric */ : 1 /* Literal */;\n        }\n        function getBaseTypeOfEnumLiteralType(type) {\n            return type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */) ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type;\n        }\n        function getDeclaredTypeOfEnum(symbol) {\n            var links = getSymbolLinks(symbol);\n            if (links.declaredType) {\n                return links.declaredType;\n            }\n            if (getEnumKind(symbol) === 1 /* Literal */) {\n                enumCount++;\n                var memberTypeList = [];\n                for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                    var declaration = _a[_i];\n                    if (declaration.kind === 255 /* EnumDeclaration */) {\n                        for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {\n                            var member = _c[_b];\n                            var value = getEnumMemberValue(member);\n                            var memberType = getFreshTypeOfLiteralType(getLiteralType(value !== undefined ? value : 0, enumCount, getSymbolOfNode(member)));\n                            getSymbolLinks(getSymbolOfNode(member)).declaredType = memberType;\n                            memberTypeList.push(getRegularTypeOfLiteralType(memberType));\n                        }\n                    }\n                }\n                if (memberTypeList.length) {\n                    var enumType_1 = getUnionType(memberTypeList, 1 /* Literal */, symbol, /*aliasTypeArguments*/ undefined);\n                    if (enumType_1.flags & 1048576 /* Union */) {\n                        enumType_1.flags |= 1024 /* EnumLiteral */;\n                        enumType_1.symbol = symbol;\n                    }\n                    return links.declaredType = enumType_1;\n                }\n            }\n            var enumType = createType(32 /* Enum */);\n            enumType.symbol = symbol;\n            return links.declaredType = enumType;\n        }\n        function getDeclaredTypeOfEnumMember(symbol) {\n            var links = getSymbolLinks(symbol);\n            if (!links.declaredType) {\n                var enumType = getDeclaredTypeOfEnum(getParentOfSymbol(symbol));\n                if (!links.declaredType) {\n                    links.declaredType = enumType;\n                }\n            }\n            return links.declaredType;\n        }\n        function getDeclaredTypeOfTypeParameter(symbol) {\n            var links = getSymbolLinks(symbol);\n            return links.declaredType || (links.declaredType = createTypeParameter(symbol));\n        }\n        function getDeclaredTypeOfAlias(symbol) {\n            var links = getSymbolLinks(symbol);\n            return links.declaredType || (links.declaredType = getDeclaredTypeOfSymbol(resolveAlias(symbol)));\n        }\n        function getDeclaredTypeOfSymbol(symbol) {\n            return tryGetDeclaredTypeOfSymbol(symbol) || errorType;\n        }\n        function tryGetDeclaredTypeOfSymbol(symbol) {\n            if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) {\n                return getDeclaredTypeOfClassOrInterface(symbol);\n            }\n            if (symbol.flags & 524288 /* TypeAlias */) {\n                return getDeclaredTypeOfTypeAlias(symbol);\n            }\n            if (symbol.flags & 262144 /* TypeParameter */) {\n                return getDeclaredTypeOfTypeParameter(symbol);\n            }\n            if (symbol.flags & 384 /* Enum */) {\n                return getDeclaredTypeOfEnum(symbol);\n            }\n            if (symbol.flags & 8 /* EnumMember */) {\n                return getDeclaredTypeOfEnumMember(symbol);\n            }\n            if (symbol.flags & 2097152 /* Alias */) {\n                return getDeclaredTypeOfAlias(symbol);\n            }\n            return undefined;\n        }\n        /**\n         * A type is free of this references if it's the any, string, number, boolean, symbol, or void keyword, a string\n         * literal type, an array with an element type that is free of this references, or a type reference that is\n         * free of this references.\n         */\n        function isThislessType(node) {\n            switch (node.kind) {\n                case 128 /* AnyKeyword */:\n                case 152 /* UnknownKeyword */:\n                case 147 /* StringKeyword */:\n                case 144 /* NumberKeyword */:\n                case 155 /* BigIntKeyword */:\n                case 131 /* BooleanKeyword */:\n                case 148 /* SymbolKeyword */:\n                case 145 /* ObjectKeyword */:\n                case 113 /* VoidKeyword */:\n                case 150 /* UndefinedKeyword */:\n                case 141 /* NeverKeyword */:\n                case 191 /* LiteralType */:\n                    return true;\n                case 178 /* ArrayType */:\n                    return isThislessType(node.elementType);\n                case 173 /* TypeReference */:\n                    return !node.typeArguments || node.typeArguments.every(isThislessType);\n            }\n            return false;\n        }\n        /** A type parameter is thisless if its constraint is thisless, or if it has no constraint. */\n        function isThislessTypeParameter(node) {\n            var constraint = ts.getEffectiveConstraintOfTypeParameter(node);\n            return !constraint || isThislessType(constraint);\n        }\n        /**\n         * A variable-like declaration is free of this references if it has a type annotation\n         * that is thisless, or if it has no type annotation and no initializer (and is thus of type any).\n         */\n        function isThislessVariableLikeDeclaration(node) {\n            var typeNode = ts.getEffectiveTypeAnnotationNode(node);\n            return typeNode ? isThislessType(typeNode) : !ts.hasInitializer(node);\n        }\n        /**\n         * A function-like declaration is considered free of `this` references if it has a return type\n         * annotation that is free of this references and if each parameter is thisless and if\n         * each type parameter (if present) is thisless.\n         */\n        function isThislessFunctionLikeDeclaration(node) {\n            var returnType = ts.getEffectiveReturnTypeNode(node);\n            var typeParameters = ts.getEffectiveTypeParameterDeclarations(node);\n            return (node.kind === 166 /* Constructor */ || (!!returnType && isThislessType(returnType))) &&\n                node.parameters.every(isThislessVariableLikeDeclaration) &&\n                typeParameters.every(isThislessTypeParameter);\n        }\n        /**\n         * Returns true if the class or interface member given by the symbol is free of \"this\" references. The\n         * function may return false for symbols that are actually free of \"this\" references because it is not\n         * feasible to perform a complete analysis in all cases. In particular, property members with types\n         * inferred from their initializers and function members with inferred return types are conservatively\n         * assumed not to be free of \"this\" references.\n         */\n        function isThisless(symbol) {\n            if (symbol.declarations && symbol.declarations.length === 1) {\n                var declaration = symbol.declarations[0];\n                if (declaration) {\n                    switch (declaration.kind) {\n                        case 163 /* PropertyDeclaration */:\n                        case 162 /* PropertySignature */:\n                            return isThislessVariableLikeDeclaration(declaration);\n                        case 165 /* MethodDeclaration */:\n                        case 164 /* MethodSignature */:\n                        case 166 /* Constructor */:\n                        case 167 /* GetAccessor */:\n                        case 168 /* SetAccessor */:\n                            return isThislessFunctionLikeDeclaration(declaration);\n                    }\n                }\n            }\n            return false;\n        }\n        // The mappingThisOnly flag indicates that the only type parameter being mapped is \"this\". When the flag is true,\n        // we check symbols to see if we can quickly conclude they are free of \"this\" references, thus needing no instantiation.\n        function createInstantiatedSymbolTable(symbols, mapper, mappingThisOnly) {\n            var result = ts.createSymbolTable();\n            for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) {\n                var symbol = symbols_2[_i];\n                result.set(symbol.escapedName, mappingThisOnly && isThisless(symbol) ? symbol : instantiateSymbol(symbol, mapper));\n            }\n            return result;\n        }\n        function addInheritedMembers(symbols, baseSymbols) {\n            for (var _i = 0, baseSymbols_1 = baseSymbols; _i < baseSymbols_1.length; _i++) {\n                var s = baseSymbols_1[_i];\n                if (!symbols.has(s.escapedName) && !isStaticPrivateIdentifierProperty(s)) {\n                    symbols.set(s.escapedName, s);\n                }\n            }\n        }\n        function isStaticPrivateIdentifierProperty(s) {\n            return !!s.valueDeclaration && ts.isPrivateIdentifierPropertyDeclaration(s.valueDeclaration) && ts.hasSyntacticModifier(s.valueDeclaration, 32 /* Static */);\n        }\n        function resolveDeclaredMembers(type) {\n            if (!type.declaredProperties) {\n                var symbol = type.symbol;\n                var members = getMembersOfSymbol(symbol);\n                type.declaredProperties = getNamedMembers(members);\n                // Start with signatures at empty array in case of recursive types\n                type.declaredCallSignatures = ts.emptyArray;\n                type.declaredConstructSignatures = ts.emptyArray;\n                type.declaredCallSignatures = getSignaturesOfSymbol(members.get(\"__call\" /* Call */));\n                type.declaredConstructSignatures = getSignaturesOfSymbol(members.get(\"__new\" /* New */));\n                type.declaredStringIndexInfo = getIndexInfoOfSymbol(symbol, 0 /* String */);\n                type.declaredNumberIndexInfo = getIndexInfoOfSymbol(symbol, 1 /* Number */);\n            }\n            return type;\n        }\n        /**\n         * Indicates whether a type can be used as a property name.\n         */\n        function isTypeUsableAsPropertyName(type) {\n            return !!(type.flags & 8576 /* StringOrNumberLiteralOrUnique */);\n        }\n        /**\n         * Indicates whether a declaration name is definitely late-bindable.\n         * A declaration name is only late-bindable if:\n         * - It is a `ComputedPropertyName`.\n         * - Its expression is an `Identifier` or either a `PropertyAccessExpression` an\n         * `ElementAccessExpression` consisting only of these same three types of nodes.\n         * - The type of its expression is a string or numeric literal type, or is a `unique symbol` type.\n         */\n        function isLateBindableName(node) {\n            if (!ts.isComputedPropertyName(node) && !ts.isElementAccessExpression(node)) {\n                return false;\n            }\n            var expr = ts.isComputedPropertyName(node) ? node.expression : node.argumentExpression;\n            return ts.isEntityNameExpression(expr)\n                && isTypeUsableAsPropertyName(ts.isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(expr));\n        }\n        function isLateBoundName(name) {\n            return name.charCodeAt(0) === 95 /* _ */ &&\n                name.charCodeAt(1) === 95 /* _ */ &&\n                name.charCodeAt(2) === 64 /* at */;\n        }\n        /**\n         * Indicates whether a declaration has a late-bindable dynamic name.\n         */\n        function hasLateBindableName(node) {\n            var name = ts.getNameOfDeclaration(node);\n            return !!name && isLateBindableName(name);\n        }\n        /**\n         * Indicates whether a declaration has an early-bound name or a dynamic name that can be late-bound.\n         */\n        function hasBindableName(node) {\n            return !ts.hasDynamicName(node) || hasLateBindableName(node);\n        }\n        /**\n         * Indicates whether a declaration name is a dynamic name that cannot be late-bound.\n         */\n        function isNonBindableDynamicName(node) {\n            return ts.isDynamicName(node) && !isLateBindableName(node);\n        }\n        /**\n         * Gets the symbolic name for a member from its type.\n         */\n        function getPropertyNameFromType(type) {\n            if (type.flags & 8192 /* UniqueESSymbol */) {\n                return type.escapedName;\n            }\n            if (type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */)) {\n                return ts.escapeLeadingUnderscores(\"\" + type.value);\n            }\n            return ts.Debug.fail();\n        }\n        /**\n         * Adds a declaration to a late-bound dynamic member. This performs the same function for\n         * late-bound members that `addDeclarationToSymbol` in binder.ts performs for early-bound\n         * members.\n         */\n        function addDeclarationToLateBoundSymbol(symbol, member, symbolFlags) {\n            ts.Debug.assert(!!(ts.getCheckFlags(symbol) & 4096 /* Late */), \"Expected a late-bound symbol.\");\n            symbol.flags |= symbolFlags;\n            getSymbolLinks(member.symbol).lateSymbol = symbol;\n            if (!symbol.declarations) {\n                symbol.declarations = [member];\n            }\n            else {\n                symbol.declarations.push(member);\n            }\n            if (symbolFlags & 111551 /* Value */) {\n                if (!symbol.valueDeclaration || symbol.valueDeclaration.kind !== member.kind) {\n                    symbol.valueDeclaration = member;\n                }\n            }\n        }\n        /**\n         * Performs late-binding of a dynamic member. This performs the same function for\n         * late-bound members that `declareSymbol` in binder.ts performs for early-bound\n         * members.\n         *\n         * If a symbol is a dynamic name from a computed property, we perform an additional \"late\"\n         * binding phase to attempt to resolve the name for the symbol from the type of the computed\n         * property's expression. If the type of the expression is a string-literal, numeric-literal,\n         * or unique symbol type, we can use that type as the name of the symbol.\n         *\n         * For example, given:\n         *\n         *   const x = Symbol();\n         *\n         *   interface I {\n         *     [x]: number;\n         *   }\n         *\n         * The binder gives the property `[x]: number` a special symbol with the name \"__computed\".\n         * In the late-binding phase we can type-check the expression `x` and see that it has a\n         * unique symbol type which we can then use as the name of the member. This allows users\n         * to define custom symbols that can be used in the members of an object type.\n         *\n         * @param parent The containing symbol for the member.\n         * @param earlySymbols The early-bound symbols of the parent.\n         * @param lateSymbols The late-bound symbols of the parent.\n         * @param decl The member to bind.\n         */\n        function lateBindMember(parent, earlySymbols, lateSymbols, decl) {\n            ts.Debug.assert(!!decl.symbol, \"The member is expected to have a symbol.\");\n            var links = getNodeLinks(decl);\n            if (!links.resolvedSymbol) {\n                // In the event we attempt to resolve the late-bound name of this member recursively,\n                // fall back to the early-bound name of this member.\n                links.resolvedSymbol = decl.symbol;\n                var declName = ts.isBinaryExpression(decl) ? decl.left : decl.name;\n                var type = ts.isElementAccessExpression(declName) ? checkExpressionCached(declName.argumentExpression) : checkComputedPropertyName(declName);\n                if (isTypeUsableAsPropertyName(type)) {\n                    var memberName = getPropertyNameFromType(type);\n                    var symbolFlags = decl.symbol.flags;\n                    // Get or add a late-bound symbol for the member. This allows us to merge late-bound accessor declarations.\n                    var lateSymbol = lateSymbols.get(memberName);\n                    if (!lateSymbol)\n                        lateSymbols.set(memberName, lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */));\n                    // Report an error if a late-bound member has the same name as an early-bound member,\n                    // or if we have another early-bound symbol declaration with the same name and\n                    // conflicting flags.\n                    var earlySymbol = earlySymbols && earlySymbols.get(memberName);\n                    if (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol) {\n                        // If we have an existing early-bound member, combine its declarations so that we can\n                        // report an error at each declaration.\n                        var declarations = earlySymbol ? ts.concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations;\n                        var name_4 = !(type.flags & 8192 /* UniqueESSymbol */) && ts.unescapeLeadingUnderscores(memberName) || ts.declarationNameToString(declName);\n                        ts.forEach(declarations, function (declaration) { return error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.Property_0_was_also_declared_here, name_4); });\n                        error(declName || decl, ts.Diagnostics.Duplicate_property_0, name_4);\n                        lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */);\n                    }\n                    lateSymbol.nameType = type;\n                    addDeclarationToLateBoundSymbol(lateSymbol, decl, symbolFlags);\n                    if (lateSymbol.parent) {\n                        ts.Debug.assert(lateSymbol.parent === parent, \"Existing symbol parent should match new one\");\n                    }\n                    else {\n                        lateSymbol.parent = parent;\n                    }\n                    return links.resolvedSymbol = lateSymbol;\n                }\n            }\n            return links.resolvedSymbol;\n        }\n        function getResolvedMembersOrExportsOfSymbol(symbol, resolutionKind) {\n            var links = getSymbolLinks(symbol);\n            if (!links[resolutionKind]) {\n                var isStatic = resolutionKind === \"resolvedExports\" /* resolvedExports */;\n                var earlySymbols = !isStatic ? symbol.members :\n                    symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol) :\n                        symbol.exports;\n                // In the event we recursively resolve the members/exports of the symbol, we\n                // set the initial value of resolvedMembers/resolvedExports to the early-bound\n                // members/exports of the symbol.\n                links[resolutionKind] = earlySymbols || emptySymbols;\n                // fill in any as-yet-unresolved late-bound members.\n                var lateSymbols = ts.createSymbolTable();\n                for (var _i = 0, _a = symbol.declarations || ts.emptyArray; _i < _a.length; _i++) {\n                    var decl = _a[_i];\n                    var members = ts.getMembersOfDeclaration(decl);\n                    if (members) {\n                        for (var _b = 0, members_5 = members; _b < members_5.length; _b++) {\n                            var member = members_5[_b];\n                            if (isStatic === ts.hasStaticModifier(member) && hasLateBindableName(member)) {\n                                lateBindMember(symbol, earlySymbols, lateSymbols, member);\n                            }\n                        }\n                    }\n                }\n                var assignments = symbol.assignmentDeclarationMembers;\n                if (assignments) {\n                    var decls = ts.arrayFrom(assignments.values());\n                    for (var _c = 0, decls_1 = decls; _c < decls_1.length; _c++) {\n                        var member = decls_1[_c];\n                        var assignmentKind = ts.getAssignmentDeclarationKind(member);\n                        var isInstanceMember = assignmentKind === 3 /* PrototypeProperty */\n                            || ts.isBinaryExpression(member) && isPossiblyAliasedThisProperty(member, assignmentKind)\n                            || assignmentKind === 9 /* ObjectDefinePrototypeProperty */\n                            || assignmentKind === 6 /* Prototype */; // A straight `Prototype` assignment probably can never have a computed name\n                        if (isStatic === !isInstanceMember && hasLateBindableName(member)) {\n                            lateBindMember(symbol, earlySymbols, lateSymbols, member);\n                        }\n                    }\n                }\n                links[resolutionKind] = combineSymbolTables(earlySymbols, lateSymbols) || emptySymbols;\n            }\n            return links[resolutionKind];\n        }\n        /**\n         * Gets a SymbolTable containing both the early- and late-bound members of a symbol.\n         *\n         * For a description of late-binding, see `lateBindMember`.\n         */\n        function getMembersOfSymbol(symbol) {\n            return symbol.flags & 6256 /* LateBindingContainer */\n                ? getResolvedMembersOrExportsOfSymbol(symbol, \"resolvedMembers\" /* resolvedMembers */)\n                : symbol.members || emptySymbols;\n        }\n        /**\n         * If a symbol is the dynamic name of the member of an object type, get the late-bound\n         * symbol of the member.\n         *\n         * For a description of late-binding, see `lateBindMember`.\n         */\n        function getLateBoundSymbol(symbol) {\n            if (symbol.flags & 106500 /* ClassMember */ && symbol.escapedName === \"__computed\" /* Computed */) {\n                var links = getSymbolLinks(symbol);\n                if (!links.lateSymbol && ts.some(symbol.declarations, hasLateBindableName)) {\n                    // force late binding of members/exports. This will set the late-bound symbol\n                    var parent = getMergedSymbol(symbol.parent);\n                    if (ts.some(symbol.declarations, ts.hasStaticModifier)) {\n                        getExportsOfSymbol(parent);\n                    }\n                    else {\n                        getMembersOfSymbol(parent);\n                    }\n                }\n                return links.lateSymbol || (links.lateSymbol = symbol);\n            }\n            return symbol;\n        }\n        function getTypeWithThisArgument(type, thisArgument, needApparentType) {\n            if (ts.getObjectFlags(type) & 4 /* Reference */) {\n                var target = type.target;\n                var typeArguments = getTypeArguments(type);\n                if (ts.length(target.typeParameters) === ts.length(typeArguments)) {\n                    var ref = createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType]));\n                    return needApparentType ? getApparentType(ref) : ref;\n                }\n            }\n            else if (type.flags & 2097152 /* Intersection */) {\n                var types = ts.sameMap(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument, needApparentType); });\n                return types !== type.types ? getIntersectionType(types) : type;\n            }\n            return needApparentType ? getApparentType(type) : type;\n        }\n        function resolveObjectTypeMembers(type, source, typeParameters, typeArguments) {\n            var mapper;\n            var members;\n            var callSignatures;\n            var constructSignatures;\n            var stringIndexInfo;\n            var numberIndexInfo;\n            if (ts.rangeEquals(typeParameters, typeArguments, 0, typeParameters.length)) {\n                members = source.symbol ? getMembersOfSymbol(source.symbol) : ts.createSymbolTable(source.declaredProperties);\n                callSignatures = source.declaredCallSignatures;\n                constructSignatures = source.declaredConstructSignatures;\n                stringIndexInfo = source.declaredStringIndexInfo;\n                numberIndexInfo = source.declaredNumberIndexInfo;\n            }\n            else {\n                mapper = createTypeMapper(typeParameters, typeArguments);\n                members = createInstantiatedSymbolTable(source.declaredProperties, mapper, /*mappingThisOnly*/ typeParameters.length === 1);\n                callSignatures = instantiateSignatures(source.declaredCallSignatures, mapper);\n                constructSignatures = instantiateSignatures(source.declaredConstructSignatures, mapper);\n                stringIndexInfo = instantiateIndexInfo(source.declaredStringIndexInfo, mapper);\n                numberIndexInfo = instantiateIndexInfo(source.declaredNumberIndexInfo, mapper);\n            }\n            var baseTypes = getBaseTypes(source);\n            if (baseTypes.length) {\n                if (source.symbol && members === getMembersOfSymbol(source.symbol)) {\n                    members = ts.createSymbolTable(source.declaredProperties);\n                }\n                setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);\n                var thisArgument = ts.lastOrUndefined(typeArguments);\n                for (var _i = 0, baseTypes_1 = baseTypes; _i < baseTypes_1.length; _i++) {\n                    var baseType = baseTypes_1[_i];\n                    var instantiatedBaseType = thisArgument ? getTypeWithThisArgument(instantiateType(baseType, mapper), thisArgument) : baseType;\n                    addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType));\n                    callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */));\n                    constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */));\n                    if (!stringIndexInfo) {\n                        stringIndexInfo = instantiatedBaseType === anyType ?\n                            createIndexInfo(anyType, /*isReadonly*/ false) :\n                            getIndexInfoOfType(instantiatedBaseType, 0 /* String */);\n                    }\n                    numberIndexInfo = numberIndexInfo || getIndexInfoOfType(instantiatedBaseType, 1 /* Number */);\n                }\n            }\n            setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);\n        }\n        function resolveClassOrInterfaceMembers(type) {\n            resolveObjectTypeMembers(type, resolveDeclaredMembers(type), ts.emptyArray, ts.emptyArray);\n        }\n        function resolveTypeReferenceMembers(type) {\n            var source = resolveDeclaredMembers(type.target);\n            var typeParameters = ts.concatenate(source.typeParameters, [source.thisType]);\n            var typeArguments = getTypeArguments(type);\n            var paddedTypeArguments = typeArguments.length === typeParameters.length ? typeArguments : ts.concatenate(typeArguments, [type]);\n            resolveObjectTypeMembers(type, source, typeParameters, paddedTypeArguments);\n        }\n        function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, flags) {\n            var sig = new Signature(checker, flags);\n            sig.declaration = declaration;\n            sig.typeParameters = typeParameters;\n            sig.parameters = parameters;\n            sig.thisParameter = thisParameter;\n            sig.resolvedReturnType = resolvedReturnType;\n            sig.resolvedTypePredicate = resolvedTypePredicate;\n            sig.minArgumentCount = minArgumentCount;\n            sig.resolvedMinArgumentCount = undefined;\n            sig.target = undefined;\n            sig.mapper = undefined;\n            sig.unionSignatures = undefined;\n            return sig;\n        }\n        function cloneSignature(sig) {\n            var result = createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, /*resolvedReturnType*/ undefined, \n            /*resolvedTypePredicate*/ undefined, sig.minArgumentCount, sig.flags & 39 /* PropagatingFlags */);\n            result.target = sig.target;\n            result.mapper = sig.mapper;\n            result.unionSignatures = sig.unionSignatures;\n            return result;\n        }\n        function createUnionSignature(signature, unionSignatures) {\n            var result = cloneSignature(signature);\n            result.unionSignatures = unionSignatures;\n            result.target = undefined;\n            result.mapper = undefined;\n            return result;\n        }\n        function getOptionalCallSignature(signature, callChainFlags) {\n            if ((signature.flags & 24 /* CallChainFlags */) === callChainFlags) {\n                return signature;\n            }\n            if (!signature.optionalCallSignatureCache) {\n                signature.optionalCallSignatureCache = {};\n            }\n            var key = callChainFlags === 8 /* IsInnerCallChain */ ? \"inner\" : \"outer\";\n            return signature.optionalCallSignatureCache[key]\n                || (signature.optionalCallSignatureCache[key] = createOptionalCallSignature(signature, callChainFlags));\n        }\n        function createOptionalCallSignature(signature, callChainFlags) {\n            ts.Debug.assert(callChainFlags === 8 /* IsInnerCallChain */ || callChainFlags === 16 /* IsOuterCallChain */, \"An optional call signature can either be for an inner call chain or an outer call chain, but not both.\");\n            var result = cloneSignature(signature);\n            result.flags |= callChainFlags;\n            return result;\n        }\n        function getExpandedParameters(sig, skipUnionExpanding) {\n            if (signatureHasRestParameter(sig)) {\n                var restIndex_1 = sig.parameters.length - 1;\n                var restType = getTypeOfSymbol(sig.parameters[restIndex_1]);\n                if (isTupleType(restType)) {\n                    return [expandSignatureParametersWithTupleMembers(restType, restIndex_1)];\n                }\n                else if (!skipUnionExpanding && restType.flags & 1048576 /* Union */ && ts.every(restType.types, isTupleType)) {\n                    return ts.map(restType.types, function (t) { return expandSignatureParametersWithTupleMembers(t, restIndex_1); });\n                }\n            }\n            return [sig.parameters];\n            function expandSignatureParametersWithTupleMembers(restType, restIndex) {\n                var elementTypes = getTypeArguments(restType);\n                var associatedNames = restType.target.labeledElementDeclarations;\n                var restParams = ts.map(elementTypes, function (t, i) {\n                    // Lookup the label from the individual tuple passed in before falling back to the signature `rest` parameter name\n                    var tupleLabelName = !!associatedNames && getTupleElementLabel(associatedNames[i]);\n                    var name = tupleLabelName || getParameterNameAtPosition(sig, restIndex + i, restType);\n                    var flags = restType.target.elementFlags[i];\n                    var checkFlags = flags & 12 /* Variable */ ? 32768 /* RestParameter */ :\n                        flags & 2 /* Optional */ ? 16384 /* OptionalParameter */ : 0;\n                    var symbol = createSymbol(1 /* FunctionScopedVariable */, name, checkFlags);\n                    symbol.type = flags & 4 /* Rest */ ? createArrayType(t) : t;\n                    return symbol;\n                });\n                return ts.concatenate(sig.parameters.slice(0, restIndex), restParams);\n            }\n        }\n        function getDefaultConstructSignatures(classType) {\n            var baseConstructorType = getBaseConstructorTypeOfClass(classType);\n            var baseSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */);\n            var declaration = ts.getClassLikeDeclarationOfSymbol(classType.symbol);\n            var isAbstract = !!declaration && ts.hasSyntacticModifier(declaration, 128 /* Abstract */);\n            if (baseSignatures.length === 0) {\n                return [createSignature(undefined, classType.localTypeParameters, undefined, ts.emptyArray, classType, /*resolvedTypePredicate*/ undefined, 0, isAbstract ? 4 /* Abstract */ : 0 /* None */)];\n            }\n            var baseTypeNode = getBaseTypeNodeOfClass(classType);\n            var isJavaScript = ts.isInJSFile(baseTypeNode);\n            var typeArguments = typeArgumentsFromTypeReferenceNode(baseTypeNode);\n            var typeArgCount = ts.length(typeArguments);\n            var result = [];\n            for (var _i = 0, baseSignatures_1 = baseSignatures; _i < baseSignatures_1.length; _i++) {\n                var baseSig = baseSignatures_1[_i];\n                var minTypeArgumentCount = getMinTypeArgumentCount(baseSig.typeParameters);\n                var typeParamCount = ts.length(baseSig.typeParameters);\n                if (isJavaScript || typeArgCount >= minTypeArgumentCount && typeArgCount <= typeParamCount) {\n                    var sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, minTypeArgumentCount, isJavaScript)) : cloneSignature(baseSig);\n                    sig.typeParameters = classType.localTypeParameters;\n                    sig.resolvedReturnType = classType;\n                    sig.flags = isAbstract ? sig.flags | 4 /* Abstract */ : sig.flags & ~4 /* Abstract */;\n                    result.push(sig);\n                }\n            }\n            return result;\n        }\n        function findMatchingSignature(signatureList, signature, partialMatch, ignoreThisTypes, ignoreReturnTypes) {\n            for (var _i = 0, signatureList_1 = signatureList; _i < signatureList_1.length; _i++) {\n                var s = signatureList_1[_i];\n                if (compareSignaturesIdentical(s, signature, partialMatch, ignoreThisTypes, ignoreReturnTypes, partialMatch ? compareTypesSubtypeOf : compareTypesIdentical)) {\n                    return s;\n                }\n            }\n        }\n        function findMatchingSignatures(signatureLists, signature, listIndex) {\n            if (signature.typeParameters) {\n                // We require an exact match for generic signatures, so we only return signatures from the first\n                // signature list and only if they have exact matches in the other signature lists.\n                if (listIndex > 0) {\n                    return undefined;\n                }\n                for (var i = 1; i < signatureLists.length; i++) {\n                    if (!findMatchingSignature(signatureLists[i], signature, /*partialMatch*/ false, /*ignoreThisTypes*/ false, /*ignoreReturnTypes*/ false)) {\n                        return undefined;\n                    }\n                }\n                return [signature];\n            }\n            var result;\n            for (var i = 0; i < signatureLists.length; i++) {\n                // Allow matching non-generic signatures to have excess parameters and different return types.\n                // Prefer matching this types if possible.\n                var match = i === listIndex ? signature : findMatchingSignature(signatureLists[i], signature, /*partialMatch*/ true, /*ignoreThisTypes*/ false, /*ignoreReturnTypes*/ true);\n                if (!match) {\n                    return undefined;\n                }\n                result = ts.appendIfUnique(result, match);\n            }\n            return result;\n        }\n        // The signatures of a union type are those signatures that are present in each of the constituent types.\n        // Generic signatures must match exactly, but non-generic signatures are allowed to have extra optional\n        // parameters and may differ in return types. When signatures differ in return types, the resulting return\n        // type is the union of the constituent return types.\n        function getUnionSignatures(signatureLists) {\n            var result;\n            var indexWithLengthOverOne;\n            for (var i = 0; i < signatureLists.length; i++) {\n                if (signatureLists[i].length === 0)\n                    return ts.emptyArray;\n                if (signatureLists[i].length > 1) {\n                    indexWithLengthOverOne = indexWithLengthOverOne === undefined ? i : -1; // -1 is a signal there are multiple overload sets\n                }\n                for (var _i = 0, _a = signatureLists[i]; _i < _a.length; _i++) {\n                    var signature = _a[_i];\n                    // Only process signatures with parameter lists that aren't already in the result list\n                    if (!result || !findMatchingSignature(result, signature, /*partialMatch*/ false, /*ignoreThisTypes*/ false, /*ignoreReturnTypes*/ true)) {\n                        var unionSignatures = findMatchingSignatures(signatureLists, signature, i);\n                        if (unionSignatures) {\n                            var s = signature;\n                            // Union the result types when more than one signature matches\n                            if (unionSignatures.length > 1) {\n                                var thisParameter = signature.thisParameter;\n                                var firstThisParameterOfUnionSignatures = ts.forEach(unionSignatures, function (sig) { return sig.thisParameter; });\n                                if (firstThisParameterOfUnionSignatures) {\n                                    var thisType = getIntersectionType(ts.mapDefined(unionSignatures, function (sig) { return sig.thisParameter && getTypeOfSymbol(sig.thisParameter); }));\n                                    thisParameter = createSymbolWithType(firstThisParameterOfUnionSignatures, thisType);\n                                }\n                                s = createUnionSignature(signature, unionSignatures);\n                                s.thisParameter = thisParameter;\n                            }\n                            (result || (result = [])).push(s);\n                        }\n                    }\n                }\n            }\n            if (!ts.length(result) && indexWithLengthOverOne !== -1) {\n                // No sufficiently similar signature existed to subsume all the other signatures in the union - time to see if we can make a single\n                // signature that handles all over them. We only do this when there are overloads in only one constituent.\n                // (Overloads are conditional in nature and having overloads in multiple constituents would necessitate making a power set of\n                // signatures from the type, whose ordering would be non-obvious)\n                var masterList = signatureLists[indexWithLengthOverOne !== undefined ? indexWithLengthOverOne : 0];\n                var results = masterList.slice();\n                var _loop_10 = function (signatures) {\n                    if (signatures !== masterList) {\n                        var signature_1 = signatures[0];\n                        ts.Debug.assert(!!signature_1, \"getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass\");\n                        results = signature_1.typeParameters && ts.some(results, function (s) { return !!s.typeParameters && !compareTypeParametersIdentical(signature_1.typeParameters, s.typeParameters); }) ? undefined : ts.map(results, function (sig) { return combineSignaturesOfUnionMembers(sig, signature_1); });\n                        if (!results) {\n                            return \"break\";\n                        }\n                    }\n                };\n                for (var _b = 0, signatureLists_1 = signatureLists; _b < signatureLists_1.length; _b++) {\n                    var signatures = signatureLists_1[_b];\n                    var state_3 = _loop_10(signatures);\n                    if (state_3 === \"break\")\n                        break;\n                }\n                result = results;\n            }\n            return result || ts.emptyArray;\n        }\n        function compareTypeParametersIdentical(sourceParams, targetParams) {\n            if (sourceParams.length !== targetParams.length) {\n                return false;\n            }\n            var mapper = createTypeMapper(targetParams, sourceParams);\n            for (var i = 0; i < sourceParams.length; i++) {\n                var source = sourceParams[i];\n                var target = targetParams[i];\n                if (source === target)\n                    continue;\n                // We instantiate the target type parameter constraints into the source types so we can recognize `<T, U extends T>` as the same as `<A, B extends A>`\n                if (!isTypeIdenticalTo(getConstraintFromTypeParameter(source) || unknownType, instantiateType(getConstraintFromTypeParameter(target) || unknownType, mapper)))\n                    return false;\n                // We don't compare defaults - we just use the type parameter defaults from the first signature that seems to match.\n                // It might make sense to combine these defaults in the future, but doing so intelligently requires knowing\n                // if the parameter is used covariantly or contravariantly (so we intersect if it's used like a parameter or union if used like a return type)\n                // and, since it's just an inference _default_, just picking one arbitrarily works OK.\n            }\n            return true;\n        }\n        function combineUnionThisParam(left, right, mapper) {\n            if (!left || !right) {\n                return left || right;\n            }\n            // A signature `this` type might be a read or a write position... It's very possible that it should be invariant\n            // and we should refuse to merge signatures if there are `this` types and they do not match. However, so as to be\n            // permissive when calling, for now, we'll intersect the `this` types just like we do for param types in union signatures.\n            var thisType = getIntersectionType([getTypeOfSymbol(left), instantiateType(getTypeOfSymbol(right), mapper)]);\n            return createSymbolWithType(left, thisType);\n        }\n        function combineUnionParameters(left, right, mapper) {\n            var leftCount = getParameterCount(left);\n            var rightCount = getParameterCount(right);\n            var longest = leftCount >= rightCount ? left : right;\n            var shorter = longest === left ? right : left;\n            var longestCount = longest === left ? leftCount : rightCount;\n            var eitherHasEffectiveRest = (hasEffectiveRestParameter(left) || hasEffectiveRestParameter(right));\n            var needsExtraRestElement = eitherHasEffectiveRest && !hasEffectiveRestParameter(longest);\n            var params = new Array(longestCount + (needsExtraRestElement ? 1 : 0));\n            for (var i = 0; i < longestCount; i++) {\n                var longestParamType = tryGetTypeAtPosition(longest, i);\n                if (longest === right) {\n                    longestParamType = instantiateType(longestParamType, mapper);\n                }\n                var shorterParamType = tryGetTypeAtPosition(shorter, i) || unknownType;\n                if (shorter === right) {\n                    shorterParamType = instantiateType(shorterParamType, mapper);\n                }\n                var unionParamType = getIntersectionType([longestParamType, shorterParamType]);\n                var isRestParam = eitherHasEffectiveRest && !needsExtraRestElement && i === (longestCount - 1);\n                var isOptional = i >= getMinArgumentCount(longest) && i >= getMinArgumentCount(shorter);\n                var leftName = i >= leftCount ? undefined : getParameterNameAtPosition(left, i);\n                var rightName = i >= rightCount ? undefined : getParameterNameAtPosition(right, i);\n                var paramName = leftName === rightName ? leftName :\n                    !leftName ? rightName :\n                        !rightName ? leftName :\n                            undefined;\n                var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || \"arg\" + i);\n                paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;\n                params[i] = paramSymbol;\n            }\n            if (needsExtraRestElement) {\n                var restParamSymbol = createSymbol(1 /* FunctionScopedVariable */, \"args\");\n                restParamSymbol.type = createArrayType(getTypeAtPosition(shorter, longestCount));\n                if (shorter === right) {\n                    restParamSymbol.type = instantiateType(restParamSymbol.type, mapper);\n                }\n                params[longestCount] = restParamSymbol;\n            }\n            return params;\n        }\n        function combineSignaturesOfUnionMembers(left, right) {\n            var typeParams = left.typeParameters || right.typeParameters;\n            var paramMapper;\n            if (left.typeParameters && right.typeParameters) {\n                paramMapper = createTypeMapper(right.typeParameters, left.typeParameters);\n                // We just use the type parameter defaults from the first signature\n            }\n            var declaration = left.declaration;\n            var params = combineUnionParameters(left, right, paramMapper);\n            var thisParam = combineUnionThisParam(left.thisParameter, right.thisParameter, paramMapper);\n            var minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount);\n            var result = createSignature(declaration, typeParams, thisParam, params, \n            /*resolvedReturnType*/ undefined, \n            /*resolvedTypePredicate*/ undefined, minArgCount, (left.flags | right.flags) & 39 /* PropagatingFlags */);\n            result.unionSignatures = ts.concatenate(left.unionSignatures || [left], [right]);\n            if (paramMapper) {\n                result.mapper = left.mapper && left.unionSignatures ? combineTypeMappers(left.mapper, paramMapper) : paramMapper;\n            }\n            return result;\n        }\n        function getUnionIndexInfo(types, kind) {\n            var indexTypes = [];\n            var isAnyReadonly = false;\n            for (var _i = 0, types_4 = types; _i < types_4.length; _i++) {\n                var type = types_4[_i];\n                var indexInfo = getIndexInfoOfType(getApparentType(type), kind);\n                if (!indexInfo) {\n                    return undefined;\n                }\n                indexTypes.push(indexInfo.type);\n                isAnyReadonly = isAnyReadonly || indexInfo.isReadonly;\n            }\n            return createIndexInfo(getUnionType(indexTypes, 2 /* Subtype */), isAnyReadonly);\n        }\n        function resolveUnionTypeMembers(type) {\n            // The members and properties collections are empty for union types. To get all properties of a union\n            // type use getPropertiesOfType (only the language service uses this).\n            var callSignatures = getUnionSignatures(ts.map(type.types, function (t) { return t === globalFunctionType ? [unknownSignature] : getSignaturesOfType(t, 0 /* Call */); }));\n            var constructSignatures = getUnionSignatures(ts.map(type.types, function (t) { return getSignaturesOfType(t, 1 /* Construct */); }));\n            var stringIndexInfo = getUnionIndexInfo(type.types, 0 /* String */);\n            var numberIndexInfo = getUnionIndexInfo(type.types, 1 /* Number */);\n            setStructuredTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);\n        }\n        function intersectTypes(type1, type2) {\n            return !type1 ? type2 : !type2 ? type1 : getIntersectionType([type1, type2]);\n        }\n        function intersectIndexInfos(info1, info2) {\n            return !info1 ? info2 : !info2 ? info1 : createIndexInfo(getIntersectionType([info1.type, info2.type]), info1.isReadonly && info2.isReadonly);\n        }\n        function unionSpreadIndexInfos(info1, info2) {\n            return info1 && info2 && createIndexInfo(getUnionType([info1.type, info2.type]), info1.isReadonly || info2.isReadonly);\n        }\n        function findMixins(types) {\n            var constructorTypeCount = ts.countWhere(types, function (t) { return getSignaturesOfType(t, 1 /* Construct */).length > 0; });\n            var mixinFlags = ts.map(types, isMixinConstructorType);\n            if (constructorTypeCount > 0 && constructorTypeCount === ts.countWhere(mixinFlags, function (b) { return b; })) {\n                var firstMixinIndex = mixinFlags.indexOf(/*searchElement*/ true);\n                mixinFlags[firstMixinIndex] = false;\n            }\n            return mixinFlags;\n        }\n        function includeMixinType(type, types, mixinFlags, index) {\n            var mixedTypes = [];\n            for (var i = 0; i < types.length; i++) {\n                if (i === index) {\n                    mixedTypes.push(type);\n                }\n                else if (mixinFlags[i]) {\n                    mixedTypes.push(getReturnTypeOfSignature(getSignaturesOfType(types[i], 1 /* Construct */)[0]));\n                }\n            }\n            return getIntersectionType(mixedTypes);\n        }\n        function resolveIntersectionTypeMembers(type) {\n            // The members and properties collections are empty for intersection types. To get all properties of an\n            // intersection type use getPropertiesOfType (only the language service uses this).\n            var callSignatures;\n            var constructSignatures;\n            var stringIndexInfo;\n            var numberIndexInfo;\n            var types = type.types;\n            var mixinFlags = findMixins(types);\n            var mixinCount = ts.countWhere(mixinFlags, function (b) { return b; });\n            var _loop_11 = function (i) {\n                var t = type.types[i];\n                // When an intersection type contains mixin constructor types, the construct signatures from\n                // those types are discarded and their return types are mixed into the return types of all\n                // other construct signatures in the intersection type. For example, the intersection type\n                // '{ new(...args: any[]) => A } & { new(s: string) => B }' has a single construct signature\n                // 'new(s: string) => A & B'.\n                if (!mixinFlags[i]) {\n                    var signatures = getSignaturesOfType(t, 1 /* Construct */);\n                    if (signatures.length && mixinCount > 0) {\n                        signatures = ts.map(signatures, function (s) {\n                            var clone = cloneSignature(s);\n                            clone.resolvedReturnType = includeMixinType(getReturnTypeOfSignature(s), types, mixinFlags, i);\n                            return clone;\n                        });\n                    }\n                    constructSignatures = appendSignatures(constructSignatures, signatures);\n                }\n                callSignatures = appendSignatures(callSignatures, getSignaturesOfType(t, 0 /* Call */));\n                stringIndexInfo = intersectIndexInfos(stringIndexInfo, getIndexInfoOfType(t, 0 /* String */));\n                numberIndexInfo = intersectIndexInfos(numberIndexInfo, getIndexInfoOfType(t, 1 /* Number */));\n            };\n            for (var i = 0; i < types.length; i++) {\n                _loop_11(i);\n            }\n            setStructuredTypeMembers(type, emptySymbols, callSignatures || ts.emptyArray, constructSignatures || ts.emptyArray, stringIndexInfo, numberIndexInfo);\n        }\n        function appendSignatures(signatures, newSignatures) {\n            var _loop_12 = function (sig) {\n                if (!signatures || ts.every(signatures, function (s) { return !compareSignaturesIdentical(s, sig, /*partialMatch*/ false, /*ignoreThisTypes*/ false, /*ignoreReturnTypes*/ false, compareTypesIdentical); })) {\n                    signatures = ts.append(signatures, sig);\n                }\n            };\n            for (var _i = 0, newSignatures_1 = newSignatures; _i < newSignatures_1.length; _i++) {\n                var sig = newSignatures_1[_i];\n                _loop_12(sig);\n            }\n            return signatures;\n        }\n        /**\n         * Converts an AnonymousType to a ResolvedType.\n         */\n        function resolveAnonymousTypeMembers(type) {\n            var symbol = getMergedSymbol(type.symbol);\n            if (type.target) {\n                setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);\n                var members = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, /*mappingThisOnly*/ false);\n                var callSignatures = instantiateSignatures(getSignaturesOfType(type.target, 0 /* Call */), type.mapper);\n                var constructSignatures = instantiateSignatures(getSignaturesOfType(type.target, 1 /* Construct */), type.mapper);\n                var stringIndexInfo = instantiateIndexInfo(getIndexInfoOfType(type.target, 0 /* String */), type.mapper);\n                var numberIndexInfo = instantiateIndexInfo(getIndexInfoOfType(type.target, 1 /* Number */), type.mapper);\n                setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);\n            }\n            else if (symbol.flags & 2048 /* TypeLiteral */) {\n                setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);\n                var members = getMembersOfSymbol(symbol);\n                var callSignatures = getSignaturesOfSymbol(members.get(\"__call\" /* Call */));\n                var constructSignatures = getSignaturesOfSymbol(members.get(\"__new\" /* New */));\n                var stringIndexInfo = getIndexInfoOfSymbol(symbol, 0 /* String */);\n                var numberIndexInfo = getIndexInfoOfSymbol(symbol, 1 /* Number */);\n                setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);\n            }\n            else {\n                // Combinations of function, class, enum and module\n                var members = emptySymbols;\n                var stringIndexInfo = void 0;\n                if (symbol.exports) {\n                    members = getExportsOfSymbol(symbol);\n                    if (symbol === globalThisSymbol) {\n                        var varsOnly_1 = new ts.Map();\n                        members.forEach(function (p) {\n                            if (!(p.flags & 418 /* BlockScoped */)) {\n                                varsOnly_1.set(p.escapedName, p);\n                            }\n                        });\n                        members = varsOnly_1;\n                    }\n                }\n                setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, undefined, undefined);\n                if (symbol.flags & 32 /* Class */) {\n                    var classType = getDeclaredTypeOfClassOrInterface(symbol);\n                    var baseConstructorType = getBaseConstructorTypeOfClass(classType);\n                    if (baseConstructorType.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 8650752 /* TypeVariable */)) {\n                        members = ts.createSymbolTable(getNamedMembers(members));\n                        addInheritedMembers(members, getPropertiesOfType(baseConstructorType));\n                    }\n                    else if (baseConstructorType === anyType) {\n                        stringIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false);\n                    }\n                }\n                var numberIndexInfo = symbol.flags & 384 /* Enum */ && (getDeclaredTypeOfSymbol(symbol).flags & 32 /* Enum */ ||\n                    ts.some(type.properties, function (prop) { return !!(getTypeOfSymbol(prop).flags & 296 /* NumberLike */); })) ? enumNumberIndexInfo : undefined;\n                setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);\n                // We resolve the members before computing the signatures because a signature may use\n                // typeof with a qualified name expression that circularly references the type we are\n                // in the process of resolving (see issue #6072). The temporarily empty signature list\n                // will never be observed because a qualified name can't reference signatures.\n                if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) {\n                    type.callSignatures = getSignaturesOfSymbol(symbol);\n                }\n                // And likewise for construct signatures for classes\n                if (symbol.flags & 32 /* Class */) {\n                    var classType_1 = getDeclaredTypeOfClassOrInterface(symbol);\n                    var constructSignatures = symbol.members ? getSignaturesOfSymbol(symbol.members.get(\"__constructor\" /* Constructor */)) : ts.emptyArray;\n                    if (symbol.flags & 16 /* Function */) {\n                        constructSignatures = ts.addRange(constructSignatures.slice(), ts.mapDefined(type.callSignatures, function (sig) { return isJSConstructor(sig.declaration) ?\n                            createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, classType_1, /*resolvedTypePredicate*/ undefined, sig.minArgumentCount, sig.flags & 39 /* PropagatingFlags */) :\n                            undefined; }));\n                    }\n                    if (!constructSignatures.length) {\n                        constructSignatures = getDefaultConstructSignatures(classType_1);\n                    }\n                    type.constructSignatures = constructSignatures;\n                }\n            }\n        }\n        function resolveReverseMappedTypeMembers(type) {\n            var indexInfo = getIndexInfoOfType(type.source, 0 /* String */);\n            var modifiers = getMappedTypeModifiers(type.mappedType);\n            var readonlyMask = modifiers & 1 /* IncludeReadonly */ ? false : true;\n            var optionalMask = modifiers & 4 /* IncludeOptional */ ? 0 : 16777216 /* Optional */;\n            var stringIndexInfo = indexInfo && createIndexInfo(inferReverseMappedType(indexInfo.type, type.mappedType, type.constraintType), readonlyMask && indexInfo.isReadonly);\n            var members = ts.createSymbolTable();\n            for (var _i = 0, _a = getPropertiesOfType(type.source); _i < _a.length; _i++) {\n                var prop = _a[_i];\n                var checkFlags = 8192 /* ReverseMapped */ | (readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0);\n                var inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.escapedName, checkFlags);\n                inferredProp.declarations = prop.declarations;\n                inferredProp.nameType = getSymbolLinks(prop).nameType;\n                inferredProp.propertyType = getTypeOfSymbol(prop);\n                inferredProp.mappedType = type.mappedType;\n                inferredProp.constraintType = type.constraintType;\n                members.set(prop.escapedName, inferredProp);\n            }\n            setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, undefined);\n        }\n        // Return the lower bound of the key type in a mapped type. Intuitively, the lower\n        // bound includes those keys that are known to always be present, for example because\n        // because of constraints on type parameters (e.g. 'keyof T' for a constrained T).\n        function getLowerBoundOfKeyType(type) {\n            if (type.flags & 4194304 /* Index */) {\n                var t = getApparentType(type.type);\n                return isGenericTupleType(t) ? getKnownKeysOfTupleType(t) : getIndexType(t);\n            }\n            if (type.flags & 16777216 /* Conditional */) {\n                if (type.root.isDistributive) {\n                    var checkType = type.checkType;\n                    var constraint = getLowerBoundOfKeyType(checkType);\n                    if (constraint !== checkType) {\n                        return getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));\n                    }\n                }\n                return type;\n            }\n            if (type.flags & 1048576 /* Union */) {\n                return mapType(type, getLowerBoundOfKeyType);\n            }\n            if (type.flags & 2097152 /* Intersection */) {\n                return getIntersectionType(ts.sameMap(type.types, getLowerBoundOfKeyType));\n            }\n            return type;\n        }\n        function getIsLateCheckFlag(s) {\n            return ts.getCheckFlags(s) & 4096 /* Late */;\n        }\n        /** Resolve the members of a mapped type { [P in K]: T } */\n        function resolveMappedTypeMembers(type) {\n            var members = ts.createSymbolTable();\n            var stringIndexInfo;\n            var numberIndexInfo;\n            // Resolve upfront such that recursive references see an empty object type.\n            setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);\n            // In { [P in K]: T }, we refer to P as the type parameter type, K as the constraint type,\n            // and T as the template type.\n            var typeParameter = getTypeParameterFromMappedType(type);\n            var constraintType = getConstraintTypeFromMappedType(type);\n            var nameType = getNameTypeFromMappedType(type.target || type);\n            var templateType = getTemplateTypeFromMappedType(type.target || type);\n            var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T'\n            var templateModifiers = getMappedTypeModifiers(type);\n            var include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */;\n            if (isMappedTypeWithKeyofConstraintDeclaration(type)) {\n                // We have a { [P in keyof T]: X }\n                for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) {\n                    var prop = _a[_i];\n                    addMemberForKeyType(getLiteralTypeFromProperty(prop, include));\n                }\n                if (modifiersType.flags & 1 /* Any */ || getIndexInfoOfType(modifiersType, 0 /* String */)) {\n                    addMemberForKeyType(stringType);\n                }\n                if (!keyofStringsOnly && getIndexInfoOfType(modifiersType, 1 /* Number */)) {\n                    addMemberForKeyType(numberType);\n                }\n            }\n            else {\n                forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);\n            }\n            setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);\n            function addMemberForKeyType(keyType) {\n                var propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type.mapper, typeParameter, keyType)) : keyType;\n                forEachType(propNameType, function (t) { return addMemberForKeyTypeWorker(keyType, t); });\n            }\n            function addMemberForKeyTypeWorker(keyType, propNameType) {\n                // If the current iteration type constituent is a string literal type, create a property.\n                // Otherwise, for type string create a string index signature.\n                if (isTypeUsableAsPropertyName(propNameType)) {\n                    var propName = getPropertyNameFromType(propNameType);\n                    // String enum members from separate enums with identical values\n                    // are distinct types with the same property name. Make the resulting\n                    // property symbol's name type be the union of those enum member types.\n                    var existingProp = members.get(propName);\n                    if (existingProp) {\n                        existingProp.nameType = getUnionType([existingProp.nameType, propNameType]);\n                        existingProp.keyType = getUnionType([existingProp.keyType, keyType]);\n                    }\n                    else {\n                        var modifiersProp = isTypeUsableAsPropertyName(keyType) ? getPropertyOfType(modifiersType, getPropertyNameFromType(keyType)) : undefined;\n                        var isOptional = !!(templateModifiers & 4 /* IncludeOptional */ ||\n                            !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */);\n                        var isReadonly = !!(templateModifiers & 1 /* IncludeReadonly */ ||\n                            !(templateModifiers & 2 /* ExcludeReadonly */) && modifiersProp && isReadonlySymbol(modifiersProp));\n                        var stripOptional = strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 /* Optional */;\n                        var lateFlag = modifiersProp ? getIsLateCheckFlag(modifiersProp) : 0;\n                        var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, lateFlag | 262144 /* Mapped */ | (isReadonly ? 8 /* Readonly */ : 0) | (stripOptional ? 524288 /* StripOptional */ : 0));\n                        prop.mappedType = type;\n                        prop.nameType = propNameType;\n                        prop.keyType = keyType;\n                        if (modifiersProp) {\n                            prop.syntheticOrigin = modifiersProp;\n                            prop.declarations = modifiersProp.declarations;\n                        }\n                        members.set(propName, prop);\n                    }\n                }\n                else if (propNameType.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 32 /* Enum */)) {\n                    var propType = instantiateType(templateType, appendTypeMapping(type.mapper, typeParameter, keyType));\n                    if (propNameType.flags & (1 /* Any */ | 4 /* String */)) {\n                        stringIndexInfo = createIndexInfo(stringIndexInfo ? getUnionType([stringIndexInfo.type, propType]) : propType, !!(templateModifiers & 1 /* IncludeReadonly */));\n                    }\n                    else {\n                        numberIndexInfo = createIndexInfo(numberIndexInfo ? getUnionType([numberIndexInfo.type, propType]) : propType, !!(templateModifiers & 1 /* IncludeReadonly */));\n                    }\n                }\n            }\n        }\n        function getTypeOfMappedSymbol(symbol) {\n            if (!symbol.type) {\n                var mappedType = symbol.mappedType;\n                if (!pushTypeResolution(symbol, 0 /* Type */)) {\n                    mappedType.containsError = true;\n                    return errorType;\n                }\n                var templateType = getTemplateTypeFromMappedType(mappedType.target || mappedType);\n                var mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.keyType);\n                var propType = instantiateType(templateType, mapper);\n                // When creating an optional property in strictNullChecks mode, if 'undefined' isn't assignable to the\n                // type, we include 'undefined' in the type. Similarly, when creating a non-optional property in strictNullChecks\n                // mode, if the underlying property is optional we remove 'undefined' from the type.\n                var type = strictNullChecks && symbol.flags & 16777216 /* Optional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType) :\n                    symbol.checkFlags & 524288 /* StripOptional */ ? getTypeWithFacts(propType, 524288 /* NEUndefined */) :\n                        propType;\n                if (!popTypeResolution()) {\n                    error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType));\n                    type = errorType;\n                }\n                symbol.type = type;\n            }\n            return symbol.type;\n        }\n        function getTypeParameterFromMappedType(type) {\n            return type.typeParameter ||\n                (type.typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(type.declaration.typeParameter)));\n        }\n        function getConstraintTypeFromMappedType(type) {\n            return type.constraintType ||\n                (type.constraintType = getConstraintOfTypeParameter(getTypeParameterFromMappedType(type)) || errorType);\n        }\n        function getNameTypeFromMappedType(type) {\n            return type.declaration.nameType ?\n                type.nameType || (type.nameType = instantiateType(getTypeFromTypeNode(type.declaration.nameType), type.mapper)) :\n                undefined;\n        }\n        function getTemplateTypeFromMappedType(type) {\n            return type.templateType ||\n                (type.templateType = type.declaration.type ?\n                    instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper) :\n                    errorType);\n        }\n        function getConstraintDeclarationForMappedType(type) {\n            return ts.getEffectiveConstraintOfTypeParameter(type.declaration.typeParameter);\n        }\n        function isMappedTypeWithKeyofConstraintDeclaration(type) {\n            var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217\n            return constraintDeclaration.kind === 188 /* TypeOperator */ &&\n                constraintDeclaration.operator === 138 /* KeyOfKeyword */;\n        }\n        function getModifiersTypeFromMappedType(type) {\n            if (!type.modifiersType) {\n                if (isMappedTypeWithKeyofConstraintDeclaration(type)) {\n                    // If the constraint declaration is a 'keyof T' node, the modifiers type is T. We check\n                    // AST nodes here because, when T is a non-generic type, the logic below eagerly resolves\n                    // 'keyof T' to a literal union type and we can't recover T from that type.\n                    type.modifiersType = instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(type).type), type.mapper);\n                }\n                else {\n                    // Otherwise, get the declared constraint type, and if the constraint type is a type parameter,\n                    // get the constraint of that type parameter. If the resulting type is an indexed type 'keyof T',\n                    // the modifiers type is T. Otherwise, the modifiers type is unknown.\n                    var declaredType = getTypeFromMappedTypeNode(type.declaration);\n                    var constraint = getConstraintTypeFromMappedType(declaredType);\n                    var extendedConstraint = constraint && constraint.flags & 262144 /* TypeParameter */ ? getConstraintOfTypeParameter(constraint) : constraint;\n                    type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 /* Index */ ? instantiateType(extendedConstraint.type, type.mapper) : unknownType;\n                }\n            }\n            return type.modifiersType;\n        }\n        function getMappedTypeModifiers(type) {\n            var declaration = type.declaration;\n            return (declaration.readonlyToken ? declaration.readonlyToken.kind === 40 /* MinusToken */ ? 2 /* ExcludeReadonly */ : 1 /* IncludeReadonly */ : 0) |\n                (declaration.questionToken ? declaration.questionToken.kind === 40 /* MinusToken */ ? 8 /* ExcludeOptional */ : 4 /* IncludeOptional */ : 0);\n        }\n        function getMappedTypeOptionality(type) {\n            var modifiers = getMappedTypeModifiers(type);\n            return modifiers & 8 /* ExcludeOptional */ ? -1 : modifiers & 4 /* IncludeOptional */ ? 1 : 0;\n        }\n        function getCombinedMappedTypeOptionality(type) {\n            var optionality = getMappedTypeOptionality(type);\n            var modifiersType = getModifiersTypeFromMappedType(type);\n            return optionality || (isGenericMappedType(modifiersType) ? getMappedTypeOptionality(modifiersType) : 0);\n        }\n        function isPartialMappedType(type) {\n            return !!(ts.getObjectFlags(type) & 32 /* Mapped */ && getMappedTypeModifiers(type) & 4 /* IncludeOptional */);\n        }\n        function isGenericMappedType(type) {\n            return !!(ts.getObjectFlags(type) & 32 /* Mapped */) && isGenericIndexType(getConstraintTypeFromMappedType(type));\n        }\n        function resolveStructuredTypeMembers(type) {\n            if (!type.members) {\n                if (type.flags & 524288 /* Object */) {\n                    if (type.objectFlags & 4 /* Reference */) {\n                        resolveTypeReferenceMembers(type);\n                    }\n                    else if (type.objectFlags & 3 /* ClassOrInterface */) {\n                        resolveClassOrInterfaceMembers(type);\n                    }\n                    else if (type.objectFlags & 2048 /* ReverseMapped */) {\n                        resolveReverseMappedTypeMembers(type);\n                    }\n                    else if (type.objectFlags & 16 /* Anonymous */) {\n                        resolveAnonymousTypeMembers(type);\n                    }\n                    else if (type.objectFlags & 32 /* Mapped */) {\n                        resolveMappedTypeMembers(type);\n                    }\n                }\n                else if (type.flags & 1048576 /* Union */) {\n                    resolveUnionTypeMembers(type);\n                }\n                else if (type.flags & 2097152 /* Intersection */) {\n                    resolveIntersectionTypeMembers(type);\n                }\n            }\n            return type;\n        }\n        /** Return properties of an object type or an empty array for other types */\n        function getPropertiesOfObjectType(type) {\n            if (type.flags & 524288 /* Object */) {\n                return resolveStructuredTypeMembers(type).properties;\n            }\n            return ts.emptyArray;\n        }\n        /** If the given type is an object type and that type has a property by the given name,\n         * return the symbol for that property. Otherwise return undefined.\n         */\n        function getPropertyOfObjectType(type, name) {\n            if (type.flags & 524288 /* Object */) {\n                var resolved = resolveStructuredTypeMembers(type);\n                var symbol = resolved.members.get(name);\n                if (symbol && symbolIsValue(symbol)) {\n                    return symbol;\n                }\n            }\n        }\n        function getPropertiesOfUnionOrIntersectionType(type) {\n            if (!type.resolvedProperties) {\n                var members = ts.createSymbolTable();\n                for (var _i = 0, _a = type.types; _i < _a.length; _i++) {\n                    var current = _a[_i];\n                    for (var _b = 0, _c = getPropertiesOfType(current); _b < _c.length; _b++) {\n                        var prop = _c[_b];\n                        if (!members.has(prop.escapedName)) {\n                            var combinedProp = getPropertyOfUnionOrIntersectionType(type, prop.escapedName);\n                            if (combinedProp) {\n                                members.set(prop.escapedName, combinedProp);\n                            }\n                        }\n                    }\n                    // The properties of a union type are those that are present in all constituent types, so\n                    // we only need to check the properties of the first type without index signature\n                    if (type.flags & 1048576 /* Union */ && !getIndexInfoOfType(current, 0 /* String */) && !getIndexInfoOfType(current, 1 /* Number */)) {\n                        break;\n                    }\n                }\n                type.resolvedProperties = getNamedMembers(members);\n            }\n            return type.resolvedProperties;\n        }\n        function getPropertiesOfType(type) {\n            type = getReducedApparentType(type);\n            return type.flags & 3145728 /* UnionOrIntersection */ ?\n                getPropertiesOfUnionOrIntersectionType(type) :\n                getPropertiesOfObjectType(type);\n        }\n        function isTypeInvalidDueToUnionDiscriminant(contextualType, obj) {\n            var list = obj.properties;\n            return list.some(function (property) {\n                var nameType = property.name && getLiteralTypeFromPropertyName(property.name);\n                var name = nameType && isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : undefined;\n                var expected = name === undefined ? undefined : getTypeOfPropertyOfType(contextualType, name);\n                return !!expected && isLiteralType(expected) && !isTypeAssignableTo(getTypeOfNode(property), expected);\n            });\n        }\n        function getAllPossiblePropertiesOfTypes(types) {\n            var unionType = getUnionType(types);\n            if (!(unionType.flags & 1048576 /* Union */)) {\n                return getAugmentedPropertiesOfType(unionType);\n            }\n            var props = ts.createSymbolTable();\n            for (var _i = 0, types_5 = types; _i < types_5.length; _i++) {\n                var memberType = types_5[_i];\n                for (var _a = 0, _b = getAugmentedPropertiesOfType(memberType); _a < _b.length; _a++) {\n                    var escapedName = _b[_a].escapedName;\n                    if (!props.has(escapedName)) {\n                        var prop = createUnionOrIntersectionProperty(unionType, escapedName);\n                        // May be undefined if the property is private\n                        if (prop)\n                            props.set(escapedName, prop);\n                    }\n                }\n            }\n            return ts.arrayFrom(props.values());\n        }\n        function getConstraintOfType(type) {\n            return type.flags & 262144 /* TypeParameter */ ? getConstraintOfTypeParameter(type) :\n                type.flags & 8388608 /* IndexedAccess */ ? getConstraintOfIndexedAccess(type) :\n                    type.flags & 16777216 /* Conditional */ ? getConstraintOfConditionalType(type) :\n                        getBaseConstraintOfType(type);\n        }\n        function getConstraintOfTypeParameter(typeParameter) {\n            return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined;\n        }\n        function getConstraintOfIndexedAccess(type) {\n            return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : undefined;\n        }\n        function getSimplifiedTypeOrConstraint(type) {\n            var simplified = getSimplifiedType(type, /*writing*/ false);\n            return simplified !== type ? simplified : getConstraintOfType(type);\n        }\n        function getConstraintFromIndexedAccess(type) {\n            var indexConstraint = getSimplifiedTypeOrConstraint(type.indexType);\n            if (indexConstraint && indexConstraint !== type.indexType) {\n                var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint, type.noUncheckedIndexedAccessCandidate);\n                if (indexedAccess) {\n                    return indexedAccess;\n                }\n            }\n            var objectConstraint = getSimplifiedTypeOrConstraint(type.objectType);\n            if (objectConstraint && objectConstraint !== type.objectType) {\n                return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType, type.noUncheckedIndexedAccessCandidate);\n            }\n            return undefined;\n        }\n        function getDefaultConstraintOfConditionalType(type) {\n            if (!type.resolvedDefaultConstraint) {\n                // An `any` branch of a conditional type would normally be viral - specifically, without special handling here,\n                // a conditional type with a single branch of type `any` would be assignable to anything, since it's constraint would simplify to\n                // just `any`. This result is _usually_ unwanted - so instead here we elide an `any` branch from the constraint type,\n                // in effect treating `any` like `never` rather than `unknown` in this location.\n                var trueConstraint = getInferredTrueTypeFromConditionalType(type);\n                var falseConstraint = getFalseTypeFromConditionalType(type);\n                type.resolvedDefaultConstraint = isTypeAny(trueConstraint) ? falseConstraint : isTypeAny(falseConstraint) ? trueConstraint : getUnionType([trueConstraint, falseConstraint]);\n            }\n            return type.resolvedDefaultConstraint;\n        }\n        function getConstraintOfDistributiveConditionalType(type) {\n            // Check if we have a conditional type of the form 'T extends U ? X : Y', where T is a constrained\n            // type parameter. If so, create an instantiation of the conditional type where T is replaced\n            // with its constraint. We do this because if the constraint is a union type it will be distributed\n            // over the conditional type and possibly reduced. For example, 'T extends undefined ? never : T'\n            // removes 'undefined' from T.\n            // We skip returning a distributive constraint for a restrictive instantiation of a conditional type\n            // as the constraint for all type params (check type included) have been replace with `unknown`, which\n            // is going to produce even more false positive/negative results than the distribute constraint already does.\n            // Please note: the distributive constraint is a kludge for emulating what a negated type could to do filter\n            // a union - once negated types exist and are applied to the conditional false branch, this \"constraint\"\n            // likely doesn't need to exist.\n            if (type.root.isDistributive && type.restrictiveInstantiation !== type) {\n                var simplified = getSimplifiedType(type.checkType, /*writing*/ false);\n                var constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified;\n                if (constraint && constraint !== type.checkType) {\n                    var instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));\n                    if (!(instantiated.flags & 131072 /* Never */)) {\n                        return instantiated;\n                    }\n                }\n            }\n            return undefined;\n        }\n        function getConstraintFromConditionalType(type) {\n            return getConstraintOfDistributiveConditionalType(type) || getDefaultConstraintOfConditionalType(type);\n        }\n        function getConstraintOfConditionalType(type) {\n            return hasNonCircularBaseConstraint(type) ? getConstraintFromConditionalType(type) : undefined;\n        }\n        function getEffectiveConstraintOfIntersection(types, targetIsUnion) {\n            var constraints;\n            var hasDisjointDomainType = false;\n            for (var _i = 0, types_6 = types; _i < types_6.length; _i++) {\n                var t = types_6[_i];\n                if (t.flags & 465829888 /* Instantiable */) {\n                    // We keep following constraints as long as we have an instantiable type that is known\n                    // not to be circular or infinite (hence we stop on index access types).\n                    var constraint = getConstraintOfType(t);\n                    while (constraint && constraint.flags & (262144 /* TypeParameter */ | 4194304 /* Index */ | 16777216 /* Conditional */)) {\n                        constraint = getConstraintOfType(constraint);\n                    }\n                    if (constraint) {\n                        constraints = ts.append(constraints, constraint);\n                        if (targetIsUnion) {\n                            constraints = ts.append(constraints, t);\n                        }\n                    }\n                }\n                else if (t.flags & 469892092 /* DisjointDomains */) {\n                    hasDisjointDomainType = true;\n                }\n            }\n            // If the target is a union type or if we are intersecting with types belonging to one of the\n            // disjoint domains, we may end up producing a constraint that hasn't been examined before.\n            if (constraints && (targetIsUnion || hasDisjointDomainType)) {\n                if (hasDisjointDomainType) {\n                    // We add any types belong to one of the disjoint domains because they might cause the final\n                    // intersection operation to reduce the union constraints.\n                    for (var _a = 0, types_7 = types; _a < types_7.length; _a++) {\n                        var t = types_7[_a];\n                        if (t.flags & 469892092 /* DisjointDomains */) {\n                            constraints = ts.append(constraints, t);\n                        }\n                    }\n                }\n                return getIntersectionType(constraints);\n            }\n            return undefined;\n        }\n        function getBaseConstraintOfType(type) {\n            if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) {\n                var constraint = getResolvedBaseConstraint(type);\n                return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined;\n            }\n            return type.flags & 4194304 /* Index */ ? keyofConstraintType : undefined;\n        }\n        /**\n         * This is similar to `getBaseConstraintOfType` except it returns the input type if there's no base constraint, instead of `undefined`\n         * It also doesn't map indexes to `string`, as where this is used this would be unneeded (and likely undesirable)\n         */\n        function getBaseConstraintOrType(type) {\n            return getBaseConstraintOfType(type) || type;\n        }\n        function hasNonCircularBaseConstraint(type) {\n            return getResolvedBaseConstraint(type) !== circularConstraintType;\n        }\n        /**\n         * Return the resolved base constraint of a type variable. The noConstraintType singleton is returned if the\n         * type variable has no constraint, and the circularConstraintType singleton is returned if the constraint\n         * circularly references the type variable.\n         */\n        function getResolvedBaseConstraint(type) {\n            if (type.resolvedBaseConstraint) {\n                return type.resolvedBaseConstraint;\n            }\n            var stack = [];\n            return type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type);\n            function getImmediateBaseConstraint(t) {\n                if (!t.immediateBaseConstraint) {\n                    if (!pushTypeResolution(t, 4 /* ImmediateBaseConstraint */)) {\n                        return circularConstraintType;\n                    }\n                    var result = void 0;\n                    // We always explore at least 10 levels of nested constraints. Thereafter, we continue to explore\n                    // up to 50 levels of nested constraints provided there are no \"deeply nested\" types on the stack\n                    // (i.e. no types for which five instantiations have been recorded on the stack). If we reach 50\n                    // levels of nesting, we are presumably exploring a repeating pattern with a long cycle that hasn't\n                    // yet triggered the deeply nested limiter. We have no test cases that actually get to 50 levels of\n                    // nesting, so it is effectively just a safety stop.\n                    if (stack.length < 10 || stack.length < 50 && !isDeeplyNestedType(t, stack, stack.length)) {\n                        stack.push(t);\n                        result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false));\n                        stack.pop();\n                    }\n                    if (!popTypeResolution()) {\n                        if (t.flags & 262144 /* TypeParameter */) {\n                            var errorNode = getConstraintDeclaration(t);\n                            if (errorNode) {\n                                var diagnostic = error(errorNode, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(t));\n                                if (currentNode && !ts.isNodeDescendantOf(errorNode, currentNode) && !ts.isNodeDescendantOf(currentNode, errorNode)) {\n                                    ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(currentNode, ts.Diagnostics.Circularity_originates_in_type_at_this_location));\n                                }\n                            }\n                        }\n                        result = circularConstraintType;\n                    }\n                    t.immediateBaseConstraint = result || noConstraintType;\n                }\n                return t.immediateBaseConstraint;\n            }\n            function getBaseConstraint(t) {\n                var c = getImmediateBaseConstraint(t);\n                return c !== noConstraintType && c !== circularConstraintType ? c : undefined;\n            }\n            function computeBaseConstraint(t) {\n                if (t.flags & 262144 /* TypeParameter */) {\n                    var constraint = getConstraintFromTypeParameter(t);\n                    return t.isThisType || !constraint ?\n                        constraint :\n                        getBaseConstraint(constraint);\n                }\n                if (t.flags & 3145728 /* UnionOrIntersection */) {\n                    var types = t.types;\n                    var baseTypes = [];\n                    var different = false;\n                    for (var _i = 0, types_8 = types; _i < types_8.length; _i++) {\n                        var type_3 = types_8[_i];\n                        var baseType = getBaseConstraint(type_3);\n                        if (baseType) {\n                            if (baseType !== type_3) {\n                                different = true;\n                            }\n                            baseTypes.push(baseType);\n                        }\n                        else {\n                            different = true;\n                        }\n                    }\n                    if (!different) {\n                        return t;\n                    }\n                    return t.flags & 1048576 /* Union */ && baseTypes.length === types.length ? getUnionType(baseTypes) :\n                        t.flags & 2097152 /* Intersection */ && baseTypes.length ? getIntersectionType(baseTypes) :\n                            undefined;\n                }\n                if (t.flags & 4194304 /* Index */) {\n                    return keyofConstraintType;\n                }\n                if (t.flags & 134217728 /* TemplateLiteral */) {\n                    var types = t.types;\n                    var constraints = ts.mapDefined(types, getBaseConstraint);\n                    return constraints.length === types.length ? getTemplateLiteralType(t.texts, constraints) : stringType;\n                }\n                if (t.flags & 268435456 /* StringMapping */) {\n                    var constraint = getBaseConstraint(t.type);\n                    return constraint ? getStringMappingType(t.symbol, constraint) : stringType;\n                }\n                if (t.flags & 8388608 /* IndexedAccess */) {\n                    var baseObjectType = getBaseConstraint(t.objectType);\n                    var baseIndexType = getBaseConstraint(t.indexType);\n                    var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, t.noUncheckedIndexedAccessCandidate);\n                    return baseIndexedAccess && getBaseConstraint(baseIndexedAccess);\n                }\n                if (t.flags & 16777216 /* Conditional */) {\n                    var constraint = getConstraintFromConditionalType(t);\n                    return constraint && getBaseConstraint(constraint);\n                }\n                if (t.flags & 33554432 /* Substitution */) {\n                    return getBaseConstraint(t.substitute);\n                }\n                return t;\n            }\n        }\n        function getApparentTypeOfIntersectionType(type) {\n            return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type, /*apparentType*/ true));\n        }\n        function getResolvedTypeParameterDefault(typeParameter) {\n            if (!typeParameter.default) {\n                if (typeParameter.target) {\n                    var targetDefault = getResolvedTypeParameterDefault(typeParameter.target);\n                    typeParameter.default = targetDefault ? instantiateType(targetDefault, typeParameter.mapper) : noConstraintType;\n                }\n                else {\n                    // To block recursion, set the initial value to the resolvingDefaultType.\n                    typeParameter.default = resolvingDefaultType;\n                    var defaultDeclaration = typeParameter.symbol && ts.forEach(typeParameter.symbol.declarations, function (decl) { return ts.isTypeParameterDeclaration(decl) && decl.default; });\n                    var defaultType = defaultDeclaration ? getTypeFromTypeNode(defaultDeclaration) : noConstraintType;\n                    if (typeParameter.default === resolvingDefaultType) {\n                        // If we have not been called recursively, set the correct default type.\n                        typeParameter.default = defaultType;\n                    }\n                }\n            }\n            else if (typeParameter.default === resolvingDefaultType) {\n                // If we are called recursively for this type parameter, mark the default as circular.\n                typeParameter.default = circularConstraintType;\n            }\n            return typeParameter.default;\n        }\n        /**\n         * Gets the default type for a type parameter.\n         *\n         * If the type parameter is the result of an instantiation, this gets the instantiated\n         * default type of its target. If the type parameter has no default type or the default is\n         * circular, `undefined` is returned.\n         */\n        function getDefaultFromTypeParameter(typeParameter) {\n            var defaultType = getResolvedTypeParameterDefault(typeParameter);\n            return defaultType !== noConstraintType && defaultType !== circularConstraintType ? defaultType : undefined;\n        }\n        function hasNonCircularTypeParameterDefault(typeParameter) {\n            return getResolvedTypeParameterDefault(typeParameter) !== circularConstraintType;\n        }\n        /**\n         * Indicates whether the declaration of a typeParameter has a default type.\n         */\n        function hasTypeParameterDefault(typeParameter) {\n            return !!(typeParameter.symbol && ts.forEach(typeParameter.symbol.declarations, function (decl) { return ts.isTypeParameterDeclaration(decl) && decl.default; }));\n        }\n        function getApparentTypeOfMappedType(type) {\n            return type.resolvedApparentType || (type.resolvedApparentType = getResolvedApparentTypeOfMappedType(type));\n        }\n        function getResolvedApparentTypeOfMappedType(type) {\n            var typeVariable = getHomomorphicTypeVariable(type);\n            if (typeVariable && !type.declaration.nameType) {\n                var constraint = getConstraintOfTypeParameter(typeVariable);\n                if (constraint && (isArrayType(constraint) || isTupleType(constraint))) {\n                    return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper));\n                }\n            }\n            return type;\n        }\n        /**\n         * For a type parameter, return the base constraint of the type parameter. For the string, number,\n         * boolean, and symbol primitive types, return the corresponding object types. Otherwise return the\n         * type itself.\n         */\n        function getApparentType(type) {\n            var t = type.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type;\n            return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) :\n                t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) :\n                    t.flags & 402653316 /* StringLike */ ? globalStringType :\n                        t.flags & 296 /* NumberLike */ ? globalNumberType :\n                            t.flags & 2112 /* BigIntLike */ ? getGlobalBigIntType(/*reportErrors*/ languageVersion >= 7 /* ES2020 */) :\n                                t.flags & 528 /* BooleanLike */ ? globalBooleanType :\n                                    t.flags & 12288 /* ESSymbolLike */ ? getGlobalESSymbolType(/*reportErrors*/ languageVersion >= 2 /* ES2015 */) :\n                                        t.flags & 67108864 /* NonPrimitive */ ? emptyObjectType :\n                                            t.flags & 4194304 /* Index */ ? keyofConstraintType :\n                                                t.flags & 2 /* Unknown */ && !strictNullChecks ? emptyObjectType :\n                                                    t;\n        }\n        function getReducedApparentType(type) {\n            // Since getApparentType may return a non-reduced union or intersection type, we need to perform\n            // type reduction both before and after obtaining the apparent type. For example, given a type parameter\n            // 'T extends A | B', the type 'T & X' becomes 'A & X | B & X' after obtaining the apparent type, and\n            // that type may need further reduction to remove empty intersections.\n            return getReducedType(getApparentType(getReducedType(type)));\n        }\n        function createUnionOrIntersectionProperty(containingType, name, skipObjectFunctionPropertyAugment) {\n            var singleProp;\n            var propSet;\n            var indexTypes;\n            var isUnion = containingType.flags & 1048576 /* Union */;\n            // Flags we want to propagate to the result if they exist in all source symbols\n            var optionalFlag = isUnion ? 0 /* None */ : 16777216 /* Optional */;\n            var syntheticFlag = 4 /* SyntheticMethod */;\n            var checkFlags = 0;\n            for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) {\n                var current = _a[_i];\n                var type = getApparentType(current);\n                if (!(type === errorType || type.flags & 131072 /* Never */)) {\n                    var prop = getPropertyOfType(type, name, skipObjectFunctionPropertyAugment);\n                    var modifiers = prop ? ts.getDeclarationModifierFlagsFromSymbol(prop) : 0;\n                    if (prop) {\n                        if (isUnion) {\n                            optionalFlag |= (prop.flags & 16777216 /* Optional */);\n                        }\n                        else {\n                            optionalFlag &= prop.flags;\n                        }\n                        if (!singleProp) {\n                            singleProp = prop;\n                        }\n                        else if (prop !== singleProp) {\n                            if (!propSet) {\n                                propSet = new ts.Map();\n                                propSet.set(getSymbolId(singleProp), singleProp);\n                            }\n                            var id = getSymbolId(prop);\n                            if (!propSet.has(id)) {\n                                propSet.set(id, prop);\n                            }\n                        }\n                        checkFlags |= (isReadonlySymbol(prop) ? 8 /* Readonly */ : 0) |\n                            (!(modifiers & 24 /* NonPublicAccessibilityModifier */) ? 256 /* ContainsPublic */ : 0) |\n                            (modifiers & 16 /* Protected */ ? 512 /* ContainsProtected */ : 0) |\n                            (modifiers & 8 /* Private */ ? 1024 /* ContainsPrivate */ : 0) |\n                            (modifiers & 32 /* Static */ ? 2048 /* ContainsStatic */ : 0);\n                        if (!isPrototypeProperty(prop)) {\n                            syntheticFlag = 2 /* SyntheticProperty */;\n                        }\n                    }\n                    else if (isUnion) {\n                        var indexInfo = !isLateBoundName(name) && (isNumericLiteralName(name) && getIndexInfoOfType(type, 1 /* Number */) || getIndexInfoOfType(type, 0 /* String */));\n                        if (indexInfo) {\n                            checkFlags |= 32 /* WritePartial */ | (indexInfo.isReadonly ? 8 /* Readonly */ : 0);\n                            indexTypes = ts.append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type);\n                        }\n                        else if (isObjectLiteralType(type)) {\n                            checkFlags |= 32 /* WritePartial */;\n                            indexTypes = ts.append(indexTypes, undefinedType);\n                        }\n                        else {\n                            checkFlags |= 16 /* ReadPartial */;\n                        }\n                    }\n                }\n            }\n            if (!singleProp || isUnion && (propSet || checkFlags & 48 /* Partial */) && checkFlags & (1024 /* ContainsPrivate */ | 512 /* ContainsProtected */)) {\n                // No property was found, or, in a union, a property has a private or protected declaration in one\n                // constituent, but is missing or has a different declaration in another constituent.\n                return undefined;\n            }\n            if (!propSet && !(checkFlags & 16 /* ReadPartial */) && !indexTypes) {\n                return singleProp;\n            }\n            var props = propSet ? ts.arrayFrom(propSet.values()) : [singleProp];\n            var declarations;\n            var firstType;\n            var nameType;\n            var propTypes = [];\n            var firstValueDeclaration;\n            var hasNonUniformValueDeclaration = false;\n            for (var _b = 0, props_1 = props; _b < props_1.length; _b++) {\n                var prop = props_1[_b];\n                if (!firstValueDeclaration) {\n                    firstValueDeclaration = prop.valueDeclaration;\n                }\n                else if (prop.valueDeclaration && prop.valueDeclaration !== firstValueDeclaration) {\n                    hasNonUniformValueDeclaration = true;\n                }\n                declarations = ts.addRange(declarations, prop.declarations);\n                var type = getTypeOfSymbol(prop);\n                if (!firstType) {\n                    firstType = type;\n                    nameType = getSymbolLinks(prop).nameType;\n                }\n                else if (type !== firstType) {\n                    checkFlags |= 64 /* HasNonUniformType */;\n                }\n                if (isLiteralType(type)) {\n                    checkFlags |= 128 /* HasLiteralType */;\n                }\n                if (type.flags & 131072 /* Never */) {\n                    checkFlags |= 131072 /* HasNeverType */;\n                }\n                propTypes.push(type);\n            }\n            ts.addRange(propTypes, indexTypes);\n            var result = createSymbol(4 /* Property */ | optionalFlag, name, syntheticFlag | checkFlags);\n            result.containingType = containingType;\n            if (!hasNonUniformValueDeclaration && firstValueDeclaration) {\n                result.valueDeclaration = firstValueDeclaration;\n                // Inherit information about parent type.\n                if (firstValueDeclaration.symbol.parent) {\n                    result.parent = firstValueDeclaration.symbol.parent;\n                }\n            }\n            result.declarations = declarations;\n            result.nameType = nameType;\n            if (propTypes.length > 2) {\n                // When `propTypes` has the potential to explode in size when normalized, defer normalization until absolutely needed\n                result.checkFlags |= 65536 /* DeferredType */;\n                result.deferralParent = containingType;\n                result.deferralConstituents = propTypes;\n            }\n            else {\n                result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);\n            }\n            return result;\n        }\n        // Return the symbol for a given property in a union or intersection type, or undefined if the property\n        // does not exist in any constituent type. Note that the returned property may only be present in some\n        // constituents, in which case the isPartial flag is set when the containing type is union type. We need\n        // these partial properties when identifying discriminant properties, but otherwise they are filtered out\n        // and do not appear to be present in the union type.\n        function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) {\n            var _a, _b;\n            var property = ((_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) === null || _a === void 0 ? void 0 : _a.get(name)) ||\n                !skipObjectFunctionPropertyAugment ? (_b = type.propertyCache) === null || _b === void 0 ? void 0 : _b.get(name) : undefined;\n            if (!property) {\n                property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);\n                if (property) {\n                    var properties = skipObjectFunctionPropertyAugment ? type.propertyCacheWithoutObjectFunctionPropertyAugment || (type.propertyCacheWithoutObjectFunctionPropertyAugment = ts.createSymbolTable()) : type.propertyCache || (type.propertyCache = ts.createSymbolTable());\n                    properties.set(name, property);\n                }\n            }\n            return property;\n        }\n        function getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment) {\n            var property = getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);\n            // We need to filter out partial properties in union types\n            return property && !(ts.getCheckFlags(property) & 16 /* ReadPartial */) ? property : undefined;\n        }\n        /**\n         * Return the reduced form of the given type. For a union type, it is a union of the normalized constituent types.\n         * For an intersection of types containing one or more mututally exclusive discriminant properties, it is 'never'.\n         * For all other types, it is simply the type itself. Discriminant properties are considered mutually exclusive when\n         * no constituent property has type 'never', but the intersection of the constituent property types is 'never'.\n         */\n        function getReducedType(type) {\n            if (type.flags & 1048576 /* Union */ && type.objectFlags & 268435456 /* ContainsIntersections */) {\n                return type.resolvedReducedType || (type.resolvedReducedType = getReducedUnionType(type));\n            }\n            else if (type.flags & 2097152 /* Intersection */) {\n                if (!(type.objectFlags & 268435456 /* IsNeverIntersectionComputed */)) {\n                    type.objectFlags |= 268435456 /* IsNeverIntersectionComputed */ |\n                        (ts.some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ? 536870912 /* IsNeverIntersection */ : 0);\n                }\n                return type.objectFlags & 536870912 /* IsNeverIntersection */ ? neverType : type;\n            }\n            return type;\n        }\n        function getReducedUnionType(unionType) {\n            var reducedTypes = ts.sameMap(unionType.types, getReducedType);\n            if (reducedTypes === unionType.types) {\n                return unionType;\n            }\n            var reduced = getUnionType(reducedTypes);\n            if (reduced.flags & 1048576 /* Union */) {\n                reduced.resolvedReducedType = reduced;\n            }\n            return reduced;\n        }\n        function isNeverReducedProperty(prop) {\n            return isDiscriminantWithNeverType(prop) || isConflictingPrivateProperty(prop);\n        }\n        function isDiscriminantWithNeverType(prop) {\n            // Return true for a synthetic non-optional property with non-uniform types, where at least one is\n            // a literal type and none is never, that reduces to never.\n            return !(prop.flags & 16777216 /* Optional */) &&\n                (ts.getCheckFlags(prop) & (192 /* Discriminant */ | 131072 /* HasNeverType */)) === 192 /* Discriminant */ &&\n                !!(getTypeOfSymbol(prop).flags & 131072 /* Never */);\n        }\n        function isConflictingPrivateProperty(prop) {\n            // Return true for a synthetic property with multiple declarations, at least one of which is private.\n            return !prop.valueDeclaration && !!(ts.getCheckFlags(prop) & 1024 /* ContainsPrivate */);\n        }\n        function elaborateNeverIntersection(errorInfo, type) {\n            if (ts.getObjectFlags(type) & 536870912 /* IsNeverIntersection */) {\n                var neverProp = ts.find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);\n                if (neverProp) {\n                    return ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, typeToString(type, /*enclosingDeclaration*/ undefined, 536870912 /* NoTypeReduction */), symbolToString(neverProp));\n                }\n                var privateProp = ts.find(getPropertiesOfUnionOrIntersectionType(type), isConflictingPrivateProperty);\n                if (privateProp) {\n                    return ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some, typeToString(type, /*enclosingDeclaration*/ undefined, 536870912 /* NoTypeReduction */), symbolToString(privateProp));\n                }\n            }\n            return errorInfo;\n        }\n        /**\n         * Return the symbol for the property with the given name in the given type. Creates synthetic union properties when\n         * necessary, maps primitive types and type parameters are to their apparent types, and augments with properties from\n         * Object and Function as appropriate.\n         *\n         * @param type a type to look up property from\n         * @param name a name of property to look up in a given type\n         */\n        function getPropertyOfType(type, name, skipObjectFunctionPropertyAugment) {\n            type = getReducedApparentType(type);\n            if (type.flags & 524288 /* Object */) {\n                var resolved = resolveStructuredTypeMembers(type);\n                var symbol = resolved.members.get(name);\n                if (symbol && symbolIsValue(symbol)) {\n                    return symbol;\n                }\n                if (skipObjectFunctionPropertyAugment)\n                    return undefined;\n                var functionType = resolved === anyFunctionType ? globalFunctionType :\n                    resolved.callSignatures.length ? globalCallableFunctionType :\n                        resolved.constructSignatures.length ? globalNewableFunctionType :\n                            undefined;\n                if (functionType) {\n                    var symbol_1 = getPropertyOfObjectType(functionType, name);\n                    if (symbol_1) {\n                        return symbol_1;\n                    }\n                }\n                return getPropertyOfObjectType(globalObjectType, name);\n            }\n            if (type.flags & 3145728 /* UnionOrIntersection */) {\n                return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);\n            }\n            return undefined;\n        }\n        function getSignaturesOfStructuredType(type, kind) {\n            if (type.flags & 3670016 /* StructuredType */) {\n                var resolved = resolveStructuredTypeMembers(type);\n                return kind === 0 /* Call */ ? resolved.callSignatures : resolved.constructSignatures;\n            }\n            return ts.emptyArray;\n        }\n        /**\n         * Return the signatures of the given kind in the given type. Creates synthetic union signatures when necessary and\n         * maps primitive types and type parameters are to their apparent types.\n         */\n        function getSignaturesOfType(type, kind) {\n            return getSignaturesOfStructuredType(getReducedApparentType(type), kind);\n        }\n        function getIndexInfoOfStructuredType(type, kind) {\n            if (type.flags & 3670016 /* StructuredType */) {\n                var resolved = resolveStructuredTypeMembers(type);\n                return kind === 0 /* String */ ? resolved.stringIndexInfo : resolved.numberIndexInfo;\n            }\n        }\n        function getIndexTypeOfStructuredType(type, kind) {\n            var info = getIndexInfoOfStructuredType(type, kind);\n            return info && info.type;\n        }\n        // Return the indexing info of the given kind in the given type. Creates synthetic union index types when necessary and\n        // maps primitive types and type parameters are to their apparent types.\n        function getIndexInfoOfType(type, kind) {\n            return getIndexInfoOfStructuredType(getReducedApparentType(type), kind);\n        }\n        // Return the index type of the given kind in the given type. Creates synthetic union index types when necessary and\n        // maps primitive types and type parameters are to their apparent types.\n        function getIndexTypeOfType(type, kind) {\n            return getIndexTypeOfStructuredType(getReducedApparentType(type), kind);\n        }\n        function getImplicitIndexTypeOfType(type, kind) {\n            if (isObjectTypeWithInferableIndex(type)) {\n                var propTypes = [];\n                for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) {\n                    var prop = _a[_i];\n                    if (kind === 0 /* String */ || isNumericLiteralName(prop.escapedName)) {\n                        propTypes.push(getTypeOfSymbol(prop));\n                    }\n                }\n                if (kind === 0 /* String */) {\n                    ts.append(propTypes, getIndexTypeOfType(type, 1 /* Number */));\n                }\n                if (propTypes.length) {\n                    return getUnionType(propTypes);\n                }\n            }\n            return undefined;\n        }\n        // Return list of type parameters with duplicates removed (duplicate identifier errors are generated in the actual\n        // type checking functions).\n        function getTypeParametersFromDeclaration(declaration) {\n            var result;\n            for (var _i = 0, _a = ts.getEffectiveTypeParameterDeclarations(declaration); _i < _a.length; _i++) {\n                var node = _a[_i];\n                result = ts.appendIfUnique(result, getDeclaredTypeOfTypeParameter(node.symbol));\n            }\n            return result;\n        }\n        function symbolsToArray(symbols) {\n            var result = [];\n            symbols.forEach(function (symbol, id) {\n                if (!isReservedMemberName(id)) {\n                    result.push(symbol);\n                }\n            });\n            return result;\n        }\n        function isJSDocOptionalParameter(node) {\n            return ts.isInJSFile(node) && (\n            // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType\n            node.type && node.type.kind === 307 /* JSDocOptionalType */\n                || ts.getJSDocParameterTags(node).some(function (_a) {\n                    var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression;\n                    return isBracketed || !!typeExpression && typeExpression.type.kind === 307 /* JSDocOptionalType */;\n                }));\n        }\n        function tryFindAmbientModule(moduleName, withAugmentations) {\n            if (ts.isExternalModuleNameRelative(moduleName)) {\n                return undefined;\n            }\n            var symbol = getSymbol(globals, '\"' + moduleName + '\"', 512 /* ValueModule */);\n            // merged symbol is module declaration symbol combined with all augmentations\n            return symbol && withAugmentations ? getMergedSymbol(symbol) : symbol;\n        }\n        function isOptionalParameter(node) {\n            if (ts.hasQuestionToken(node) || isOptionalJSDocPropertyLikeTag(node) || isJSDocOptionalParameter(node)) {\n                return true;\n            }\n            if (node.initializer) {\n                var signature = getSignatureFromDeclaration(node.parent);\n                var parameterIndex = node.parent.parameters.indexOf(node);\n                ts.Debug.assert(parameterIndex >= 0);\n                // Only consider syntactic or instantiated parameters as optional, not `void` parameters as this function is used\n                // in grammar checks and checking for `void` too early results in parameter types widening too early\n                // and causes some noImplicitAny errors to be lost.\n                return parameterIndex >= getMinArgumentCount(signature, 1 /* StrongArityForUntypedJS */ | 2 /* VoidIsNonOptional */);\n            }\n            var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent);\n            if (iife) {\n                return !node.type &&\n                    !node.dotDotDotToken &&\n                    node.parent.parameters.indexOf(node) >= iife.arguments.length;\n            }\n            return false;\n        }\n        function isOptionalJSDocPropertyLikeTag(node) {\n            if (!ts.isJSDocPropertyLikeTag(node)) {\n                return false;\n            }\n            var isBracketed = node.isBracketed, typeExpression = node.typeExpression;\n            return isBracketed || !!typeExpression && typeExpression.type.kind === 307 /* JSDocOptionalType */;\n        }\n        function createTypePredicate(kind, parameterName, parameterIndex, type) {\n            return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type };\n        }\n        /**\n         * Gets the minimum number of type arguments needed to satisfy all non-optional type\n         * parameters.\n         */\n        function getMinTypeArgumentCount(typeParameters) {\n            var minTypeArgumentCount = 0;\n            if (typeParameters) {\n                for (var i = 0; i < typeParameters.length; i++) {\n                    if (!hasTypeParameterDefault(typeParameters[i])) {\n                        minTypeArgumentCount = i + 1;\n                    }\n                }\n            }\n            return minTypeArgumentCount;\n        }\n        function fillMissingTypeArguments(typeArguments, typeParameters, minTypeArgumentCount, isJavaScriptImplicitAny) {\n            var numTypeParameters = ts.length(typeParameters);\n            if (!numTypeParameters) {\n                return [];\n            }\n            var numTypeArguments = ts.length(typeArguments);\n            if (isJavaScriptImplicitAny || (numTypeArguments >= minTypeArgumentCount && numTypeArguments <= numTypeParameters)) {\n                var result = typeArguments ? typeArguments.slice() : [];\n                // Map invalid forward references in default types to the error type\n                for (var i = numTypeArguments; i < numTypeParameters; i++) {\n                    result[i] = errorType;\n                }\n                var baseDefaultType = getDefaultTypeArgumentType(isJavaScriptImplicitAny);\n                for (var i = numTypeArguments; i < numTypeParameters; i++) {\n                    var defaultType = getDefaultFromTypeParameter(typeParameters[i]);\n                    if (isJavaScriptImplicitAny && defaultType && (isTypeIdenticalTo(defaultType, unknownType) || isTypeIdenticalTo(defaultType, emptyObjectType))) {\n                        defaultType = anyType;\n                    }\n                    result[i] = defaultType ? instantiateType(defaultType, createTypeMapper(typeParameters, result)) : baseDefaultType;\n                }\n                result.length = typeParameters.length;\n                return result;\n            }\n            return typeArguments && typeArguments.slice();\n        }\n        function getSignatureFromDeclaration(declaration) {\n            var links = getNodeLinks(declaration);\n            if (!links.resolvedSignature) {\n                var parameters = [];\n                var flags = 0 /* None */;\n                var minArgumentCount = 0;\n                var thisParameter = void 0;\n                var hasThisParameter = false;\n                var iife = ts.getImmediatelyInvokedFunctionExpression(declaration);\n                var isJSConstructSignature = ts.isJSDocConstructSignature(declaration);\n                var isUntypedSignatureInJSFile = !iife &&\n                    ts.isInJSFile(declaration) &&\n                    ts.isValueSignatureDeclaration(declaration) &&\n                    !ts.hasJSDocParameterTags(declaration) &&\n                    !ts.getJSDocType(declaration);\n                if (isUntypedSignatureInJSFile) {\n                    flags |= 32 /* IsUntypedSignatureInJSFile */;\n                }\n                // If this is a JSDoc construct signature, then skip the first parameter in the\n                // parameter list.  The first parameter represents the return type of the construct\n                // signature.\n                for (var i = isJSConstructSignature ? 1 : 0; i < declaration.parameters.length; i++) {\n                    var param = declaration.parameters[i];\n                    var paramSymbol = param.symbol;\n                    var type = ts.isJSDocParameterTag(param) ? (param.typeExpression && param.typeExpression.type) : param.type;\n                    // Include parameter symbol instead of property symbol in the signature\n                    if (paramSymbol && !!(paramSymbol.flags & 4 /* Property */) && !ts.isBindingPattern(param.name)) {\n                        var resolvedSymbol = resolveName(param, paramSymbol.escapedName, 111551 /* Value */, undefined, undefined, /*isUse*/ false);\n                        paramSymbol = resolvedSymbol;\n                    }\n                    if (i === 0 && paramSymbol.escapedName === \"this\" /* This */) {\n                        hasThisParameter = true;\n                        thisParameter = param.symbol;\n                    }\n                    else {\n                        parameters.push(paramSymbol);\n                    }\n                    if (type && type.kind === 191 /* LiteralType */) {\n                        flags |= 2 /* HasLiteralTypes */;\n                    }\n                    // Record a new minimum argument count if this is not an optional parameter\n                    var isOptionalParameter_1 = isOptionalJSDocPropertyLikeTag(param) ||\n                        param.initializer || param.questionToken || param.dotDotDotToken ||\n                        iife && parameters.length > iife.arguments.length && !type ||\n                        isJSDocOptionalParameter(param);\n                    if (!isOptionalParameter_1) {\n                        minArgumentCount = parameters.length;\n                    }\n                }\n                // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation\n                if ((declaration.kind === 167 /* GetAccessor */ || declaration.kind === 168 /* SetAccessor */) &&\n                    hasBindableName(declaration) &&\n                    (!hasThisParameter || !thisParameter)) {\n                    var otherKind = declaration.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */;\n                    var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind);\n                    if (other) {\n                        thisParameter = getAnnotatedAccessorThisParameter(other);\n                    }\n                }\n                var classType = declaration.kind === 166 /* Constructor */ ?\n                    getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol))\n                    : undefined;\n                var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);\n                if (ts.hasRestParameter(declaration) || ts.isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {\n                    flags |= 1 /* HasRestParameter */;\n                }\n                if (ts.isConstructorTypeNode(declaration) && ts.hasSyntacticModifier(declaration, 128 /* Abstract */) ||\n                    ts.isConstructorDeclaration(declaration) && ts.hasSyntacticModifier(declaration.parent, 128 /* Abstract */)) {\n                    flags |= 4 /* Abstract */;\n                }\n                links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, \n                /*resolvedReturnType*/ undefined, /*resolvedTypePredicate*/ undefined, minArgumentCount, flags);\n            }\n            return links.resolvedSignature;\n        }\n        /**\n         * A JS function gets a synthetic rest parameter if it references `arguments` AND:\n         * 1. It has no parameters but at least one `@param` with a type that starts with `...`\n         * OR\n         * 2. It has at least one parameter, and the last parameter has a matching `@param` with a type that starts with `...`\n         */\n        function maybeAddJsSyntheticRestParameter(declaration, parameters) {\n            if (ts.isJSDocSignature(declaration) || !containsArgumentsReference(declaration)) {\n                return false;\n            }\n            var lastParam = ts.lastOrUndefined(declaration.parameters);\n            var lastParamTags = lastParam ? ts.getJSDocParameterTags(lastParam) : ts.getJSDocTags(declaration).filter(ts.isJSDocParameterTag);\n            var lastParamVariadicType = ts.firstDefined(lastParamTags, function (p) {\n                return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined;\n            });\n            var syntheticArgsSymbol = createSymbol(3 /* Variable */, \"args\", 32768 /* RestParameter */);\n            syntheticArgsSymbol.type = lastParamVariadicType ? createArrayType(getTypeFromTypeNode(lastParamVariadicType.type)) : anyArrayType;\n            if (lastParamVariadicType) {\n                // Replace the last parameter with a rest parameter.\n                parameters.pop();\n            }\n            parameters.push(syntheticArgsSymbol);\n            return true;\n        }\n        function getSignatureOfTypeTag(node) {\n            // should be attached to a function declaration or expression\n            if (!(ts.isInJSFile(node) && ts.isFunctionLikeDeclaration(node)))\n                return undefined;\n            var typeTag = ts.getJSDocTypeTag(node);\n            var signature = typeTag && typeTag.typeExpression && getSingleCallSignature(getTypeFromTypeNode(typeTag.typeExpression));\n            return signature && getErasedSignature(signature);\n        }\n        function getReturnTypeOfTypeTag(node) {\n            var signature = getSignatureOfTypeTag(node);\n            return signature && getReturnTypeOfSignature(signature);\n        }\n        function containsArgumentsReference(declaration) {\n            var links = getNodeLinks(declaration);\n            if (links.containsArgumentsReference === undefined) {\n                if (links.flags & 8192 /* CaptureArguments */) {\n                    links.containsArgumentsReference = true;\n                }\n                else {\n                    links.containsArgumentsReference = traverse(declaration.body);\n                }\n            }\n            return links.containsArgumentsReference;\n            function traverse(node) {\n                if (!node)\n                    return false;\n                switch (node.kind) {\n                    case 78 /* Identifier */:\n                        return node.escapedText === argumentsSymbol.escapedName && getResolvedSymbol(node) === argumentsSymbol;\n                    case 163 /* PropertyDeclaration */:\n                    case 165 /* MethodDeclaration */:\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                        return node.name.kind === 158 /* ComputedPropertyName */\n                            && traverse(node.name);\n                    case 201 /* PropertyAccessExpression */:\n                    case 202 /* ElementAccessExpression */:\n                        return traverse(node.expression);\n                    default:\n                        return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse);\n                }\n            }\n        }\n        function getSignaturesOfSymbol(symbol) {\n            if (!symbol)\n                return ts.emptyArray;\n            var result = [];\n            for (var i = 0; i < symbol.declarations.length; i++) {\n                var decl = symbol.declarations[i];\n                if (!ts.isFunctionLike(decl))\n                    continue;\n                // Don't include signature if node is the implementation of an overloaded function. A node is considered\n                // an implementation node if it has a body and the previous node is of the same kind and immediately\n                // precedes the implementation node (i.e. has the same parent and ends where the implementation starts).\n                if (i > 0 && decl.body) {\n                    var previous = symbol.declarations[i - 1];\n                    if (decl.parent === previous.parent && decl.kind === previous.kind && decl.pos === previous.end) {\n                        continue;\n                    }\n                }\n                result.push(getSignatureFromDeclaration(decl));\n            }\n            return result;\n        }\n        function resolveExternalModuleTypeByLiteral(name) {\n            var moduleSym = resolveExternalModuleName(name, name);\n            if (moduleSym) {\n                var resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym);\n                if (resolvedModuleSymbol) {\n                    return getTypeOfSymbol(resolvedModuleSymbol);\n                }\n            }\n            return anyType;\n        }\n        function getThisTypeOfSignature(signature) {\n            if (signature.thisParameter) {\n                return getTypeOfSymbol(signature.thisParameter);\n            }\n        }\n        function getTypePredicateOfSignature(signature) {\n            if (!signature.resolvedTypePredicate) {\n                if (signature.target) {\n                    var targetTypePredicate = getTypePredicateOfSignature(signature.target);\n                    signature.resolvedTypePredicate = targetTypePredicate ? instantiateTypePredicate(targetTypePredicate, signature.mapper) : noTypePredicate;\n                }\n                else if (signature.unionSignatures) {\n                    signature.resolvedTypePredicate = getUnionTypePredicate(signature.unionSignatures) || noTypePredicate;\n                }\n                else {\n                    var type = signature.declaration && ts.getEffectiveReturnTypeNode(signature.declaration);\n                    var jsdocPredicate = void 0;\n                    if (!type && ts.isInJSFile(signature.declaration)) {\n                        var jsdocSignature = getSignatureOfTypeTag(signature.declaration);\n                        if (jsdocSignature && signature !== jsdocSignature) {\n                            jsdocPredicate = getTypePredicateOfSignature(jsdocSignature);\n                        }\n                    }\n                    signature.resolvedTypePredicate = type && ts.isTypePredicateNode(type) ?\n                        createTypePredicateFromTypePredicateNode(type, signature) :\n                        jsdocPredicate || noTypePredicate;\n                }\n                ts.Debug.assert(!!signature.resolvedTypePredicate);\n            }\n            return signature.resolvedTypePredicate === noTypePredicate ? undefined : signature.resolvedTypePredicate;\n        }\n        function createTypePredicateFromTypePredicateNode(node, signature) {\n            var parameterName = node.parameterName;\n            var type = node.type && getTypeFromTypeNode(node.type);\n            return parameterName.kind === 187 /* ThisType */ ?\n                createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) :\n                createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type);\n        }\n        function getReturnTypeOfSignature(signature) {\n            if (!signature.resolvedReturnType) {\n                if (!pushTypeResolution(signature, 3 /* ResolvedReturnType */)) {\n                    return errorType;\n                }\n                var type = signature.target ? instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper) :\n                    signature.unionSignatures ? instantiateType(getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature), 2 /* Subtype */), signature.mapper) :\n                        getReturnTypeFromAnnotation(signature.declaration) ||\n                            (ts.nodeIsMissing(signature.declaration.body) ? anyType : getReturnTypeFromBody(signature.declaration));\n                if (signature.flags & 8 /* IsInnerCallChain */) {\n                    type = addOptionalTypeMarker(type);\n                }\n                else if (signature.flags & 16 /* IsOuterCallChain */) {\n                    type = getOptionalType(type);\n                }\n                if (!popTypeResolution()) {\n                    if (signature.declaration) {\n                        var typeNode = ts.getEffectiveReturnTypeNode(signature.declaration);\n                        if (typeNode) {\n                            error(typeNode, ts.Diagnostics.Return_type_annotation_circularly_references_itself);\n                        }\n                        else if (noImplicitAny) {\n                            var declaration = signature.declaration;\n                            var name = ts.getNameOfDeclaration(declaration);\n                            if (name) {\n                                error(name, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, ts.declarationNameToString(name));\n                            }\n                            else {\n                                error(declaration, ts.Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions);\n                            }\n                        }\n                    }\n                    type = anyType;\n                }\n                signature.resolvedReturnType = type;\n            }\n            return signature.resolvedReturnType;\n        }\n        function getReturnTypeFromAnnotation(declaration) {\n            if (declaration.kind === 166 /* Constructor */) {\n                return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol));\n            }\n            if (ts.isJSDocConstructSignature(declaration)) {\n                return getTypeFromTypeNode(declaration.parameters[0].type); // TODO: GH#18217\n            }\n            var typeNode = ts.getEffectiveReturnTypeNode(declaration);\n            if (typeNode) {\n                return getTypeFromTypeNode(typeNode);\n            }\n            if (declaration.kind === 167 /* GetAccessor */ && hasBindableName(declaration)) {\n                var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration);\n                if (jsDocType) {\n                    return jsDocType;\n                }\n                var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 168 /* SetAccessor */);\n                var setterType = getAnnotatedAccessorType(setter);\n                if (setterType) {\n                    return setterType;\n                }\n            }\n            return getReturnTypeOfTypeTag(declaration);\n        }\n        function isResolvingReturnTypeOfSignature(signature) {\n            return !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3 /* ResolvedReturnType */) >= 0;\n        }\n        function getRestTypeOfSignature(signature) {\n            return tryGetRestTypeOfSignature(signature) || anyType;\n        }\n        function tryGetRestTypeOfSignature(signature) {\n            if (signatureHasRestParameter(signature)) {\n                var sigRestType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]);\n                var restType = isTupleType(sigRestType) ? getRestTypeOfTupleType(sigRestType) : sigRestType;\n                return restType && getIndexTypeOfType(restType, 1 /* Number */);\n            }\n            return undefined;\n        }\n        function getSignatureInstantiation(signature, typeArguments, isJavascript, inferredTypeParameters) {\n            var instantiatedSignature = getSignatureInstantiationWithoutFillingInTypeArguments(signature, fillMissingTypeArguments(typeArguments, signature.typeParameters, getMinTypeArgumentCount(signature.typeParameters), isJavascript));\n            if (inferredTypeParameters) {\n                var returnSignature = getSingleCallOrConstructSignature(getReturnTypeOfSignature(instantiatedSignature));\n                if (returnSignature) {\n                    var newReturnSignature = cloneSignature(returnSignature);\n                    newReturnSignature.typeParameters = inferredTypeParameters;\n                    var newInstantiatedSignature = cloneSignature(instantiatedSignature);\n                    newInstantiatedSignature.resolvedReturnType = getOrCreateTypeFromSignature(newReturnSignature);\n                    return newInstantiatedSignature;\n                }\n            }\n            return instantiatedSignature;\n        }\n        function getSignatureInstantiationWithoutFillingInTypeArguments(signature, typeArguments) {\n            var instantiations = signature.instantiations || (signature.instantiations = new ts.Map());\n            var id = getTypeListId(typeArguments);\n            var instantiation = instantiations.get(id);\n            if (!instantiation) {\n                instantiations.set(id, instantiation = createSignatureInstantiation(signature, typeArguments));\n            }\n            return instantiation;\n        }\n        function createSignatureInstantiation(signature, typeArguments) {\n            return instantiateSignature(signature, createSignatureTypeMapper(signature, typeArguments), /*eraseTypeParameters*/ true);\n        }\n        function createSignatureTypeMapper(signature, typeArguments) {\n            return createTypeMapper(signature.typeParameters, typeArguments);\n        }\n        function getErasedSignature(signature) {\n            return signature.typeParameters ?\n                signature.erasedSignatureCache || (signature.erasedSignatureCache = createErasedSignature(signature)) :\n                signature;\n        }\n        function createErasedSignature(signature) {\n            // Create an instantiation of the signature where all type arguments are the any type.\n            return instantiateSignature(signature, createTypeEraser(signature.typeParameters), /*eraseTypeParameters*/ true);\n        }\n        function getCanonicalSignature(signature) {\n            return signature.typeParameters ?\n                signature.canonicalSignatureCache || (signature.canonicalSignatureCache = createCanonicalSignature(signature)) :\n                signature;\n        }\n        function createCanonicalSignature(signature) {\n            // Create an instantiation of the signature where each unconstrained type parameter is replaced with\n            // its original. When a generic class or interface is instantiated, each generic method in the class or\n            // interface is instantiated with a fresh set of cloned type parameters (which we need to handle scenarios\n            // where different generations of the same type parameter are in scope). This leads to a lot of new type\n            // identities, and potentially a lot of work comparing those identities, so here we create an instantiation\n            // that uses the original type identities for all unconstrained type parameters.\n            return getSignatureInstantiation(signature, ts.map(signature.typeParameters, function (tp) { return tp.target && !getConstraintOfTypeParameter(tp.target) ? tp.target : tp; }), ts.isInJSFile(signature.declaration));\n        }\n        function getBaseSignature(signature) {\n            var typeParameters = signature.typeParameters;\n            if (typeParameters) {\n                var typeEraser_1 = createTypeEraser(typeParameters);\n                var baseConstraints = ts.map(typeParameters, function (tp) { return instantiateType(getBaseConstraintOfType(tp), typeEraser_1) || unknownType; });\n                return instantiateSignature(signature, createTypeMapper(typeParameters, baseConstraints), /*eraseTypeParameters*/ true);\n            }\n            return signature;\n        }\n        function getOrCreateTypeFromSignature(signature) {\n            // There are two ways to declare a construct signature, one is by declaring a class constructor\n            // using the constructor keyword, and the other is declaring a bare construct signature in an\n            // object type literal or interface (using the new keyword). Each way of declaring a constructor\n            // will result in a different declaration kind.\n            if (!signature.isolatedSignatureType) {\n                var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */;\n                var isConstructor = kind === 166 /* Constructor */ || kind === 170 /* ConstructSignature */ || kind === 175 /* ConstructorType */;\n                var type = createObjectType(16 /* Anonymous */);\n                type.members = emptySymbols;\n                type.properties = ts.emptyArray;\n                type.callSignatures = !isConstructor ? [signature] : ts.emptyArray;\n                type.constructSignatures = isConstructor ? [signature] : ts.emptyArray;\n                signature.isolatedSignatureType = type;\n            }\n            return signature.isolatedSignatureType;\n        }\n        function getIndexSymbol(symbol) {\n            return symbol.members.get(\"__index\" /* Index */);\n        }\n        function getIndexDeclarationOfSymbol(symbol, kind) {\n            var syntaxKind = kind === 1 /* Number */ ? 144 /* NumberKeyword */ : 147 /* StringKeyword */;\n            var indexSymbol = getIndexSymbol(symbol);\n            if (indexSymbol) {\n                for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {\n                    var decl = _a[_i];\n                    var node = ts.cast(decl, ts.isIndexSignatureDeclaration);\n                    if (node.parameters.length === 1) {\n                        var parameter = node.parameters[0];\n                        if (parameter.type && parameter.type.kind === syntaxKind) {\n                            return node;\n                        }\n                    }\n                }\n            }\n            return undefined;\n        }\n        function createIndexInfo(type, isReadonly, declaration) {\n            return { type: type, isReadonly: isReadonly, declaration: declaration };\n        }\n        function getIndexInfoOfSymbol(symbol, kind) {\n            var declaration = getIndexDeclarationOfSymbol(symbol, kind);\n            if (declaration) {\n                return createIndexInfo(declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, ts.hasEffectiveModifier(declaration, 64 /* Readonly */), declaration);\n            }\n            return undefined;\n        }\n        function getConstraintDeclaration(type) {\n            return ts.mapDefined(ts.filter(type.symbol && type.symbol.declarations, ts.isTypeParameterDeclaration), ts.getEffectiveConstraintOfTypeParameter)[0];\n        }\n        function getInferredTypeParameterConstraint(typeParameter) {\n            var inferences;\n            if (typeParameter.symbol) {\n                for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) {\n                    var declaration = _a[_i];\n                    if (declaration.parent.kind === 185 /* InferType */) {\n                        // When an 'infer T' declaration is immediately contained in a type reference node\n                        // (such as 'Foo<infer T>'), T's constraint is inferred from the constraint of the\n                        // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are\n                        // present, we form an intersection of the inferred constraint types.\n                        var _b = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _c = _b[0], childTypeParameter = _c === void 0 ? declaration.parent : _c, grandParent = _b[1];\n                        if (grandParent.kind === 173 /* TypeReference */) {\n                            var typeReference = grandParent;\n                            var typeParameters = getTypeParametersForTypeReference(typeReference);\n                            if (typeParameters) {\n                                var index = typeReference.typeArguments.indexOf(childTypeParameter);\n                                if (index < typeParameters.length) {\n                                    var declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]);\n                                    if (declaredConstraint) {\n                                        // Type parameter constraints can reference other type parameters so\n                                        // constraints need to be instantiated. If instantiation produces the\n                                        // type parameter itself, we discard that inference. For example, in\n                                        //   type Foo<T extends string, U extends T> = [T, U];\n                                        //   type Bar<T> = T extends Foo<infer X, infer X> ? Foo<X, X> : T;\n                                        // the instantiated constraint for U is X, so we discard that inference.\n                                        var mapper = createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReference, typeParameters));\n                                        var constraint = instantiateType(declaredConstraint, mapper);\n                                        if (constraint !== typeParameter) {\n                                            inferences = ts.append(inferences, constraint);\n                                        }\n                                    }\n                                }\n                            }\n                        }\n                        // When an 'infer T' declaration is immediately contained in a rest parameter declaration, a rest type\n                        // or a named rest tuple element, we infer an 'unknown[]' constraint.\n                        else if (grandParent.kind === 160 /* Parameter */ && grandParent.dotDotDotToken ||\n                            grandParent.kind === 181 /* RestType */ ||\n                            grandParent.kind === 192 /* NamedTupleMember */ && grandParent.dotDotDotToken) {\n                            inferences = ts.append(inferences, createArrayType(unknownType));\n                        }\n                        // When an 'infer T' declaration is immediately contained in a string template type, we infer a 'string'\n                        // constraint.\n                        else if (grandParent.kind === 194 /* TemplateLiteralTypeSpan */) {\n                            inferences = ts.append(inferences, stringType);\n                        }\n                        // When an 'infer T' declaration is in the constraint position of a mapped type, we infer a 'keyof any'\n                        // constraint.\n                        else if (grandParent.kind === 159 /* TypeParameter */ && grandParent.parent.kind === 190 /* MappedType */) {\n                            inferences = ts.append(inferences, keyofConstraintType);\n                        }\n                    }\n                }\n            }\n            return inferences && getIntersectionType(inferences);\n        }\n        /** This is a worker function. Use getConstraintOfTypeParameter which guards against circular constraints. */\n        function getConstraintFromTypeParameter(typeParameter) {\n            if (!typeParameter.constraint) {\n                if (typeParameter.target) {\n                    var targetConstraint = getConstraintOfTypeParameter(typeParameter.target);\n                    typeParameter.constraint = targetConstraint ? instantiateType(targetConstraint, typeParameter.mapper) : noConstraintType;\n                }\n                else {\n                    var constraintDeclaration = getConstraintDeclaration(typeParameter);\n                    if (!constraintDeclaration) {\n                        typeParameter.constraint = getInferredTypeParameterConstraint(typeParameter) || noConstraintType;\n                    }\n                    else {\n                        var type = getTypeFromTypeNode(constraintDeclaration);\n                        if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed\n                            // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was),\n                            // use unknown otherwise\n                            type = constraintDeclaration.parent.parent.kind === 190 /* MappedType */ ? keyofConstraintType : unknownType;\n                        }\n                        typeParameter.constraint = type;\n                    }\n                }\n            }\n            return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint;\n        }\n        function getParentSymbolOfTypeParameter(typeParameter) {\n            var tp = ts.getDeclarationOfKind(typeParameter.symbol, 159 /* TypeParameter */);\n            var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent;\n            return host && getSymbolOfNode(host);\n        }\n        function getTypeListId(types) {\n            var result = \"\";\n            if (types) {\n                var length_4 = types.length;\n                var i = 0;\n                while (i < length_4) {\n                    var startId = types[i].id;\n                    var count = 1;\n                    while (i + count < length_4 && types[i + count].id === startId + count) {\n                        count++;\n                    }\n                    if (result.length) {\n                        result += \",\";\n                    }\n                    result += startId;\n                    if (count > 1) {\n                        result += \":\" + count;\n                    }\n                    i += count;\n                }\n            }\n            return result;\n        }\n        function getAliasId(aliasSymbol, aliasTypeArguments) {\n            return aliasSymbol ? \"@\" + getSymbolId(aliasSymbol) + (aliasTypeArguments ? \":\" + getTypeListId(aliasTypeArguments) : \"\") : \"\";\n        }\n        // This function is used to propagate certain flags when creating new object type references and union types.\n        // It is only necessary to do so if a constituent type might be the undefined type, the null type, the type\n        // of an object literal or the anyFunctionType. This is because there are operations in the type checker\n        // that care about the presence of such types at arbitrary depth in a containing type.\n        function getPropagatingFlagsOfTypes(types, excludeKinds) {\n            var result = 0;\n            for (var _i = 0, types_9 = types; _i < types_9.length; _i++) {\n                var type = types_9[_i];\n                if (!(type.flags & excludeKinds)) {\n                    result |= ts.getObjectFlags(type);\n                }\n            }\n            return result & 3670016 /* PropagatingFlags */;\n        }\n        function createTypeReference(target, typeArguments) {\n            var id = getTypeListId(typeArguments);\n            var type = target.instantiations.get(id);\n            if (!type) {\n                type = createObjectType(4 /* Reference */, target.symbol);\n                target.instantiations.set(id, type);\n                type.objectFlags |= typeArguments ? getPropagatingFlagsOfTypes(typeArguments, /*excludeKinds*/ 0) : 0;\n                type.target = target;\n                type.resolvedTypeArguments = typeArguments;\n            }\n            return type;\n        }\n        function cloneTypeReference(source) {\n            var type = createType(source.flags);\n            type.symbol = source.symbol;\n            type.objectFlags = source.objectFlags;\n            type.target = source.target;\n            type.resolvedTypeArguments = source.resolvedTypeArguments;\n            return type;\n        }\n        function createDeferredTypeReference(target, node, mapper, aliasSymbol, aliasTypeArguments) {\n            if (!aliasSymbol) {\n                aliasSymbol = getAliasSymbolForTypeNode(node);\n                var localAliasTypeArguments = getTypeArgumentsForAliasSymbol(aliasSymbol);\n                aliasTypeArguments = mapper ? instantiateTypes(localAliasTypeArguments, mapper) : localAliasTypeArguments;\n            }\n            var type = createObjectType(4 /* Reference */, target.symbol);\n            type.target = target;\n            type.node = node;\n            type.mapper = mapper;\n            type.aliasSymbol = aliasSymbol;\n            type.aliasTypeArguments = aliasTypeArguments;\n            return type;\n        }\n        function getTypeArguments(type) {\n            var _a, _b;\n            if (!type.resolvedTypeArguments) {\n                if (!pushTypeResolution(type, 6 /* ResolvedTypeArguments */)) {\n                    return ((_a = type.target.localTypeParameters) === null || _a === void 0 ? void 0 : _a.map(function () { return errorType; })) || ts.emptyArray;\n                }\n                var node = type.node;\n                var typeArguments = !node ? ts.emptyArray :\n                    node.kind === 173 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) :\n                        node.kind === 178 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] :\n                            ts.map(node.elements, getTypeFromTypeNode);\n                if (popTypeResolution()) {\n                    type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments;\n                }\n                else {\n                    type.resolvedTypeArguments = ((_b = type.target.localTypeParameters) === null || _b === void 0 ? void 0 : _b.map(function () { return errorType; })) || ts.emptyArray;\n                    error(type.node || currentNode, type.target.symbol ? ts.Diagnostics.Type_arguments_for_0_circularly_reference_themselves : ts.Diagnostics.Tuple_type_arguments_circularly_reference_themselves, type.target.symbol && symbolToString(type.target.symbol));\n                }\n            }\n            return type.resolvedTypeArguments;\n        }\n        function getTypeReferenceArity(type) {\n            return ts.length(type.target.typeParameters);\n        }\n        /**\n         * Get type from type-reference that reference to class or interface\n         */\n        function getTypeFromClassOrInterfaceReference(node, symbol) {\n            var type = getDeclaredTypeOfSymbol(getMergedSymbol(symbol));\n            var typeParameters = type.localTypeParameters;\n            if (typeParameters) {\n                var numTypeArguments = ts.length(node.typeArguments);\n                var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters);\n                var isJs = ts.isInJSFile(node);\n                var isJsImplicitAny = !noImplicitAny && isJs;\n                if (!isJsImplicitAny && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) {\n                    var missingAugmentsTag = isJs && ts.isExpressionWithTypeArguments(node) && !ts.isJSDocAugmentsTag(node.parent);\n                    var diag = minTypeArgumentCount === typeParameters.length ?\n                        missingAugmentsTag ?\n                            ts.Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag :\n                            ts.Diagnostics.Generic_type_0_requires_1_type_argument_s :\n                        missingAugmentsTag ?\n                            ts.Diagnostics.Expected_0_1_type_arguments_provide_these_with_an_extends_tag :\n                            ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments;\n                    var typeStr = typeToString(type, /*enclosingDeclaration*/ undefined, 2 /* WriteArrayAsGenericType */);\n                    error(node, diag, typeStr, minTypeArgumentCount, typeParameters.length);\n                    if (!isJs) {\n                        // TODO: Adopt same permissive behavior in TS as in JS to reduce follow-on editing experience failures (requires editing fillMissingTypeArguments)\n                        return errorType;\n                    }\n                }\n                if (node.kind === 173 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) {\n                    return createDeferredTypeReference(type, node, /*mapper*/ undefined);\n                }\n                // In a type reference, the outer type parameters of the referenced class or interface are automatically\n                // supplied as type arguments and the type reference only specifies arguments for the local type parameters\n                // of the class or interface.\n                var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgumentsFromTypeReferenceNode(node), typeParameters, minTypeArgumentCount, isJs));\n                return createTypeReference(type, typeArguments);\n            }\n            return checkNoTypeArguments(node, symbol) ? type : errorType;\n        }\n        function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {\n            var type = getDeclaredTypeOfSymbol(symbol);\n            if (type === intrinsicMarkerType && intrinsicTypeKinds.has(symbol.escapedName) && typeArguments && typeArguments.length === 1) {\n                return getStringMappingType(symbol, typeArguments[0]);\n            }\n            var links = getSymbolLinks(symbol);\n            var typeParameters = links.typeParameters;\n            var id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);\n            var instantiation = links.instantiations.get(id);\n            if (!instantiation) {\n                links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), ts.isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments));\n            }\n            return instantiation;\n        }\n        /**\n         * Get type from reference to type alias. When a type alias is generic, the declared type of the type alias may include\n         * references to the type parameters of the alias. We replace those with the actual type arguments by instantiating the\n         * declared type. Instantiations are cached using the type identities of the type arguments as the key.\n         */\n        function getTypeFromTypeAliasReference(node, symbol) {\n            var type = getDeclaredTypeOfSymbol(symbol);\n            var typeParameters = getSymbolLinks(symbol).typeParameters;\n            if (typeParameters) {\n                var numTypeArguments = ts.length(node.typeArguments);\n                var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters);\n                if (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length) {\n                    error(node, minTypeArgumentCount === typeParameters.length ?\n                        ts.Diagnostics.Generic_type_0_requires_1_type_argument_s :\n                        ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, symbolToString(symbol), minTypeArgumentCount, typeParameters.length);\n                    return errorType;\n                }\n                var aliasSymbol = getAliasSymbolForTypeNode(node);\n                return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));\n            }\n            return checkNoTypeArguments(node, symbol) ? type : errorType;\n        }\n        function getTypeReferenceName(node) {\n            switch (node.kind) {\n                case 173 /* TypeReference */:\n                    return node.typeName;\n                case 223 /* ExpressionWithTypeArguments */:\n                    // We only support expressions that are simple qualified names. For other\n                    // expressions this produces undefined.\n                    var expr = node.expression;\n                    if (ts.isEntityNameExpression(expr)) {\n                        return expr;\n                    }\n                // fall through;\n            }\n            return undefined;\n        }\n        function resolveTypeReferenceName(typeReferenceName, meaning, ignoreErrors) {\n            if (!typeReferenceName) {\n                return unknownSymbol;\n            }\n            return resolveEntityName(typeReferenceName, meaning, ignoreErrors) || unknownSymbol;\n        }\n        function getTypeReferenceType(node, symbol) {\n            if (symbol === unknownSymbol) {\n                return errorType;\n            }\n            symbol = getExpandoSymbol(symbol) || symbol;\n            if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) {\n                return getTypeFromClassOrInterfaceReference(node, symbol);\n            }\n            if (symbol.flags & 524288 /* TypeAlias */) {\n                return getTypeFromTypeAliasReference(node, symbol);\n            }\n            // Get type from reference to named type that cannot be generic (enum or type parameter)\n            var res = tryGetDeclaredTypeOfSymbol(symbol);\n            if (res) {\n                return checkNoTypeArguments(node, symbol) ? getRegularTypeOfLiteralType(res) : errorType;\n            }\n            if (symbol.flags & 111551 /* Value */ && isJSDocTypeReference(node)) {\n                var jsdocType = getTypeFromJSDocValueReference(node, symbol);\n                if (jsdocType) {\n                    return jsdocType;\n                }\n                else {\n                    // Resolve the type reference as a Type for the purpose of reporting errors.\n                    resolveTypeReferenceName(getTypeReferenceName(node), 788968 /* Type */);\n                    return getTypeOfSymbol(symbol);\n                }\n            }\n            return errorType;\n        }\n        /**\n         * A JSdoc TypeReference may be to a value, but resolve it as a type anyway.\n         * Example: import('./b').ConstructorFunction\n         */\n        function getTypeFromJSDocValueReference(node, symbol) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedJSDocType) {\n                var valueType = getTypeOfSymbol(symbol);\n                var typeType = valueType;\n                if (symbol.valueDeclaration) {\n                    var isImportTypeWithQualifier = node.kind === 195 /* ImportType */ && node.qualifier;\n                    // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL}\n                    if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) {\n                        typeType = getTypeReferenceType(node, valueType.symbol);\n                    }\n                }\n                links.resolvedJSDocType = typeType;\n            }\n            return links.resolvedJSDocType;\n        }\n        function getSubstitutionType(baseType, substitute) {\n            if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) {\n                return baseType;\n            }\n            var id = getTypeId(baseType) + \">\" + getTypeId(substitute);\n            var cached = substitutionTypes.get(id);\n            if (cached) {\n                return cached;\n            }\n            var result = createType(33554432 /* Substitution */);\n            result.baseType = baseType;\n            result.substitute = substitute;\n            substitutionTypes.set(id, result);\n            return result;\n        }\n        function isUnaryTupleTypeNode(node) {\n            return node.kind === 179 /* TupleType */ && node.elements.length === 1;\n        }\n        function getImpliedConstraint(type, checkNode, extendsNode) {\n            return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) :\n                getActualTypeVariable(getTypeFromTypeNode(checkNode)) === type ? getTypeFromTypeNode(extendsNode) :\n                    undefined;\n        }\n        function getConditionalFlowTypeOfType(type, node) {\n            var constraints;\n            while (node && !ts.isStatement(node) && node.kind !== 311 /* JSDocComment */) {\n                var parent = node.parent;\n                if (parent.kind === 184 /* ConditionalType */ && node === parent.trueType) {\n                    var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType);\n                    if (constraint) {\n                        constraints = ts.append(constraints, constraint);\n                    }\n                }\n                node = parent;\n            }\n            return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type;\n        }\n        function isJSDocTypeReference(node) {\n            return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 173 /* TypeReference */ || node.kind === 195 /* ImportType */);\n        }\n        function checkNoTypeArguments(node, symbol) {\n            if (node.typeArguments) {\n                error(node, ts.Diagnostics.Type_0_is_not_generic, symbol ? symbolToString(symbol) : node.typeName ? ts.declarationNameToString(node.typeName) : anon);\n                return false;\n            }\n            return true;\n        }\n        function getIntendedTypeFromJSDocTypeReference(node) {\n            if (ts.isIdentifier(node.typeName)) {\n                var typeArgs = node.typeArguments;\n                switch (node.typeName.escapedText) {\n                    case \"String\":\n                        checkNoTypeArguments(node);\n                        return stringType;\n                    case \"Number\":\n                        checkNoTypeArguments(node);\n                        return numberType;\n                    case \"Boolean\":\n                        checkNoTypeArguments(node);\n                        return booleanType;\n                    case \"Void\":\n                        checkNoTypeArguments(node);\n                        return voidType;\n                    case \"Undefined\":\n                        checkNoTypeArguments(node);\n                        return undefinedType;\n                    case \"Null\":\n                        checkNoTypeArguments(node);\n                        return nullType;\n                    case \"Function\":\n                    case \"function\":\n                        checkNoTypeArguments(node);\n                        return globalFunctionType;\n                    case \"array\":\n                        return (!typeArgs || !typeArgs.length) && !noImplicitAny ? anyArrayType : undefined;\n                    case \"promise\":\n                        return (!typeArgs || !typeArgs.length) && !noImplicitAny ? createPromiseType(anyType) : undefined;\n                    case \"Object\":\n                        if (typeArgs && typeArgs.length === 2) {\n                            if (ts.isJSDocIndexSignature(node)) {\n                                var indexed = getTypeFromTypeNode(typeArgs[0]);\n                                var target = getTypeFromTypeNode(typeArgs[1]);\n                                var index = createIndexInfo(target, /*isReadonly*/ false);\n                                return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType ? index : undefined, indexed === numberType ? index : undefined);\n                            }\n                            return anyType;\n                        }\n                        checkNoTypeArguments(node);\n                        return !noImplicitAny ? anyType : undefined;\n                }\n            }\n        }\n        function getTypeFromJSDocNullableTypeNode(node) {\n            var type = getTypeFromTypeNode(node.type);\n            return strictNullChecks ? getNullableType(type, 65536 /* Null */) : type;\n        }\n        function getTypeFromTypeReference(node) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedType) {\n                // handle LS queries on the `const` in `x as const` by resolving to the type of `x`\n                if (ts.isConstTypeReference(node) && ts.isAssertionExpression(node.parent)) {\n                    links.resolvedSymbol = unknownSymbol;\n                    return links.resolvedType = checkExpressionCached(node.parent.expression);\n                }\n                var symbol = void 0;\n                var type = void 0;\n                var meaning = 788968 /* Type */;\n                if (isJSDocTypeReference(node)) {\n                    type = getIntendedTypeFromJSDocTypeReference(node);\n                    if (!type) {\n                        symbol = resolveTypeReferenceName(getTypeReferenceName(node), meaning, /*ignoreErrors*/ true);\n                        if (symbol === unknownSymbol) {\n                            symbol = resolveTypeReferenceName(getTypeReferenceName(node), meaning | 111551 /* Value */);\n                        }\n                        else {\n                            resolveTypeReferenceName(getTypeReferenceName(node), meaning); // Resolve again to mark errors, if any\n                        }\n                        type = getTypeReferenceType(node, symbol);\n                    }\n                }\n                if (!type) {\n                    symbol = resolveTypeReferenceName(getTypeReferenceName(node), meaning);\n                    type = getTypeReferenceType(node, symbol);\n                }\n                // Cache both the resolved symbol and the resolved type. The resolved symbol is needed when we check the\n                // type reference in checkTypeReferenceNode.\n                links.resolvedSymbol = symbol;\n                links.resolvedType = type;\n            }\n            return links.resolvedType;\n        }\n        function typeArgumentsFromTypeReferenceNode(node) {\n            return ts.map(node.typeArguments, getTypeFromTypeNode);\n        }\n        function getTypeFromTypeQueryNode(node) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedType) {\n                // TypeScript 1.0 spec (April 2014): 3.6.3\n                // The expression is processed as an identifier expression (section 4.3)\n                // or property access expression(section 4.10),\n                // the widened type(section 3.9) of which becomes the result.\n                links.resolvedType = getRegularTypeOfLiteralType(getWidenedType(checkExpression(node.exprName)));\n            }\n            return links.resolvedType;\n        }\n        function getTypeOfGlobalSymbol(symbol, arity) {\n            function getTypeDeclaration(symbol) {\n                var declarations = symbol.declarations;\n                for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) {\n                    var declaration = declarations_3[_i];\n                    switch (declaration.kind) {\n                        case 252 /* ClassDeclaration */:\n                        case 253 /* InterfaceDeclaration */:\n                        case 255 /* EnumDeclaration */:\n                            return declaration;\n                    }\n                }\n            }\n            if (!symbol) {\n                return arity ? emptyGenericType : emptyObjectType;\n            }\n            var type = getDeclaredTypeOfSymbol(symbol);\n            if (!(type.flags & 524288 /* Object */)) {\n                error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, ts.symbolName(symbol));\n                return arity ? emptyGenericType : emptyObjectType;\n            }\n            if (ts.length(type.typeParameters) !== arity) {\n                error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, ts.symbolName(symbol), arity);\n                return arity ? emptyGenericType : emptyObjectType;\n            }\n            return type;\n        }\n        function getGlobalValueSymbol(name, reportErrors) {\n            return getGlobalSymbol(name, 111551 /* Value */, reportErrors ? ts.Diagnostics.Cannot_find_global_value_0 : undefined);\n        }\n        function getGlobalTypeSymbol(name, reportErrors) {\n            return getGlobalSymbol(name, 788968 /* Type */, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined);\n        }\n        function getGlobalSymbol(name, meaning, diagnostic) {\n            // Don't track references for global symbols anyway, so value if `isReference` is arbitrary\n            return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false);\n        }\n        function getGlobalType(name, arity, reportErrors) {\n            var symbol = getGlobalTypeSymbol(name, reportErrors);\n            return symbol || reportErrors ? getTypeOfGlobalSymbol(symbol, arity) : undefined;\n        }\n        function getGlobalTypedPropertyDescriptorType() {\n            return deferredGlobalTypedPropertyDescriptorType || (deferredGlobalTypedPropertyDescriptorType = getGlobalType(\"TypedPropertyDescriptor\", /*arity*/ 1, /*reportErrors*/ true)) || emptyGenericType;\n        }\n        function getGlobalTemplateStringsArrayType() {\n            return deferredGlobalTemplateStringsArrayType || (deferredGlobalTemplateStringsArrayType = getGlobalType(\"TemplateStringsArray\", /*arity*/ 0, /*reportErrors*/ true)) || emptyObjectType;\n        }\n        function getGlobalImportMetaType() {\n            return deferredGlobalImportMetaType || (deferredGlobalImportMetaType = getGlobalType(\"ImportMeta\", /*arity*/ 0, /*reportErrors*/ true)) || emptyObjectType;\n        }\n        function getGlobalESSymbolConstructorSymbol(reportErrors) {\n            return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol(\"Symbol\", reportErrors));\n        }\n        function getGlobalESSymbolType(reportErrors) {\n            return deferredGlobalESSymbolType || (deferredGlobalESSymbolType = getGlobalType(\"Symbol\", /*arity*/ 0, reportErrors)) || emptyObjectType;\n        }\n        function getGlobalPromiseType(reportErrors) {\n            return deferredGlobalPromiseType || (deferredGlobalPromiseType = getGlobalType(\"Promise\", /*arity*/ 1, reportErrors)) || emptyGenericType;\n        }\n        function getGlobalPromiseLikeType(reportErrors) {\n            return deferredGlobalPromiseLikeType || (deferredGlobalPromiseLikeType = getGlobalType(\"PromiseLike\", /*arity*/ 1, reportErrors)) || emptyGenericType;\n        }\n        function getGlobalPromiseConstructorSymbol(reportErrors) {\n            return deferredGlobalPromiseConstructorSymbol || (deferredGlobalPromiseConstructorSymbol = getGlobalValueSymbol(\"Promise\", reportErrors));\n        }\n        function getGlobalPromiseConstructorLikeType(reportErrors) {\n            return deferredGlobalPromiseConstructorLikeType || (deferredGlobalPromiseConstructorLikeType = getGlobalType(\"PromiseConstructorLike\", /*arity*/ 0, reportErrors)) || emptyObjectType;\n        }\n        function getGlobalAsyncIterableType(reportErrors) {\n            return deferredGlobalAsyncIterableType || (deferredGlobalAsyncIterableType = getGlobalType(\"AsyncIterable\", /*arity*/ 1, reportErrors)) || emptyGenericType;\n        }\n        function getGlobalAsyncIteratorType(reportErrors) {\n            return deferredGlobalAsyncIteratorType || (deferredGlobalAsyncIteratorType = getGlobalType(\"AsyncIterator\", /*arity*/ 3, reportErrors)) || emptyGenericType;\n        }\n        function getGlobalAsyncIterableIteratorType(reportErrors) {\n            return deferredGlobalAsyncIterableIteratorType || (deferredGlobalAsyncIterableIteratorType = getGlobalType(\"AsyncIterableIterator\", /*arity*/ 1, reportErrors)) || emptyGenericType;\n        }\n        function getGlobalAsyncGeneratorType(reportErrors) {\n            return deferredGlobalAsyncGeneratorType || (deferredGlobalAsyncGeneratorType = getGlobalType(\"AsyncGenerator\", /*arity*/ 3, reportErrors)) || emptyGenericType;\n        }\n        function getGlobalIterableType(reportErrors) {\n            return deferredGlobalIterableType || (deferredGlobalIterableType = getGlobalType(\"Iterable\", /*arity*/ 1, reportErrors)) || emptyGenericType;\n        }\n        function getGlobalIteratorType(reportErrors) {\n            return deferredGlobalIteratorType || (deferredGlobalIteratorType = getGlobalType(\"Iterator\", /*arity*/ 3, reportErrors)) || emptyGenericType;\n        }\n        function getGlobalIterableIteratorType(reportErrors) {\n            return deferredGlobalIterableIteratorType || (deferredGlobalIterableIteratorType = getGlobalType(\"IterableIterator\", /*arity*/ 1, reportErrors)) || emptyGenericType;\n        }\n        function getGlobalGeneratorType(reportErrors) {\n            return deferredGlobalGeneratorType || (deferredGlobalGeneratorType = getGlobalType(\"Generator\", /*arity*/ 3, reportErrors)) || emptyGenericType;\n        }\n        function getGlobalIteratorYieldResultType(reportErrors) {\n            return deferredGlobalIteratorYieldResultType || (deferredGlobalIteratorYieldResultType = getGlobalType(\"IteratorYieldResult\", /*arity*/ 1, reportErrors)) || emptyGenericType;\n        }\n        function getGlobalIteratorReturnResultType(reportErrors) {\n            return deferredGlobalIteratorReturnResultType || (deferredGlobalIteratorReturnResultType = getGlobalType(\"IteratorReturnResult\", /*arity*/ 1, reportErrors)) || emptyGenericType;\n        }\n        function getGlobalTypeOrUndefined(name, arity) {\n            if (arity === void 0) { arity = 0; }\n            var symbol = getGlobalSymbol(name, 788968 /* Type */, /*diagnostic*/ undefined);\n            return symbol && getTypeOfGlobalSymbol(symbol, arity);\n        }\n        function getGlobalExtractSymbol() {\n            return deferredGlobalExtractSymbol || (deferredGlobalExtractSymbol = getGlobalSymbol(\"Extract\", 524288 /* TypeAlias */, ts.Diagnostics.Cannot_find_global_type_0)); // TODO: GH#18217\n        }\n        function getGlobalOmitSymbol() {\n            return deferredGlobalOmitSymbol || (deferredGlobalOmitSymbol = getGlobalSymbol(\"Omit\", 524288 /* TypeAlias */, ts.Diagnostics.Cannot_find_global_type_0)); // TODO: GH#18217\n        }\n        function getGlobalBigIntType(reportErrors) {\n            return deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType(\"BigInt\", /*arity*/ 0, reportErrors)) || emptyObjectType;\n        }\n        /**\n         * Instantiates a global type that is generic with some element type, and returns that instantiation.\n         */\n        function createTypeFromGenericGlobalType(genericGlobalType, typeArguments) {\n            return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, typeArguments) : emptyObjectType;\n        }\n        function createTypedPropertyDescriptorType(propertyType) {\n            return createTypeFromGenericGlobalType(getGlobalTypedPropertyDescriptorType(), [propertyType]);\n        }\n        function createIterableType(iteratedType) {\n            return createTypeFromGenericGlobalType(getGlobalIterableType(/*reportErrors*/ true), [iteratedType]);\n        }\n        function createArrayType(elementType, readonly) {\n            return createTypeFromGenericGlobalType(readonly ? globalReadonlyArrayType : globalArrayType, [elementType]);\n        }\n        function getTupleElementFlags(node) {\n            switch (node.kind) {\n                case 180 /* OptionalType */:\n                    return 2 /* Optional */;\n                case 181 /* RestType */:\n                    return getRestTypeElementFlags(node);\n                case 192 /* NamedTupleMember */:\n                    return node.questionToken ? 2 /* Optional */ :\n                        node.dotDotDotToken ? getRestTypeElementFlags(node) :\n                            1 /* Required */;\n                default:\n                    return 1 /* Required */;\n            }\n        }\n        function getRestTypeElementFlags(node) {\n            return getArrayElementTypeNode(node.type) ? 4 /* Rest */ : 8 /* Variadic */;\n        }\n        function getArrayOrTupleTargetType(node) {\n            var readonly = isReadonlyTypeOperator(node.parent);\n            var elementType = getArrayElementTypeNode(node);\n            if (elementType) {\n                return readonly ? globalReadonlyArrayType : globalArrayType;\n            }\n            var elementFlags = ts.map(node.elements, getTupleElementFlags);\n            var missingName = ts.some(node.elements, function (e) { return e.kind !== 192 /* NamedTupleMember */; });\n            return getTupleTargetType(elementFlags, readonly, /*associatedNames*/ missingName ? undefined : node.elements);\n        }\n        // Return true if the given type reference node is directly aliased or if it needs to be deferred\n        // because it is possibly contained in a circular chain of eagerly resolved types.\n        function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) {\n            return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 178 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) :\n                node.kind === 179 /* TupleType */ ? ts.some(node.elements, mayResolveTypeAlias) :\n                    hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias));\n        }\n        // Return true when the given node is transitively contained in type constructs that eagerly\n        // resolve their constituent types. We include SyntaxKind.TypeReference because type arguments\n        // of type aliases are eagerly resolved.\n        function isResolvedByTypeAlias(node) {\n            var parent = node.parent;\n            switch (parent.kind) {\n                case 186 /* ParenthesizedType */:\n                case 192 /* NamedTupleMember */:\n                case 173 /* TypeReference */:\n                case 182 /* UnionType */:\n                case 183 /* IntersectionType */:\n                case 189 /* IndexedAccessType */:\n                case 184 /* ConditionalType */:\n                case 188 /* TypeOperator */:\n                case 178 /* ArrayType */:\n                case 179 /* TupleType */:\n                    return isResolvedByTypeAlias(parent);\n                case 254 /* TypeAliasDeclaration */:\n                    return true;\n            }\n            return false;\n        }\n        // Return true if resolving the given node (i.e. getTypeFromTypeNode) possibly causes resolution\n        // of a type alias.\n        function mayResolveTypeAlias(node) {\n            switch (node.kind) {\n                case 173 /* TypeReference */:\n                    return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */);\n                case 176 /* TypeQuery */:\n                    return true;\n                case 188 /* TypeOperator */:\n                    return node.operator !== 151 /* UniqueKeyword */ && mayResolveTypeAlias(node.type);\n                case 186 /* ParenthesizedType */:\n                case 180 /* OptionalType */:\n                case 192 /* NamedTupleMember */:\n                case 307 /* JSDocOptionalType */:\n                case 305 /* JSDocNullableType */:\n                case 306 /* JSDocNonNullableType */:\n                case 301 /* JSDocTypeExpression */:\n                    return mayResolveTypeAlias(node.type);\n                case 181 /* RestType */:\n                    return node.type.kind !== 178 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType);\n                case 182 /* UnionType */:\n                case 183 /* IntersectionType */:\n                    return ts.some(node.types, mayResolveTypeAlias);\n                case 189 /* IndexedAccessType */:\n                    return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType);\n                case 184 /* ConditionalType */:\n                    return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) ||\n                        mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType);\n            }\n            return false;\n        }\n        function getTypeFromArrayOrTupleTypeNode(node) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedType) {\n                var target = getArrayOrTupleTargetType(node);\n                if (target === emptyGenericType) {\n                    links.resolvedType = emptyObjectType;\n                }\n                else if (!(node.kind === 179 /* TupleType */ && ts.some(node.elements, function (e) { return !!(getTupleElementFlags(e) & 8 /* Variadic */); })) && isDeferredTypeReferenceNode(node)) {\n                    links.resolvedType = node.kind === 179 /* TupleType */ && node.elements.length === 0 ? target :\n                        createDeferredTypeReference(target, node, /*mapper*/ undefined);\n                }\n                else {\n                    var elementTypes = node.kind === 178 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode);\n                    links.resolvedType = createNormalizedTypeReference(target, elementTypes);\n                }\n            }\n            return links.resolvedType;\n        }\n        function isReadonlyTypeOperator(node) {\n            return ts.isTypeOperatorNode(node) && node.operator === 142 /* ReadonlyKeyword */;\n        }\n        function createTupleType(elementTypes, elementFlags, readonly, namedMemberDeclarations) {\n            if (readonly === void 0) { readonly = false; }\n            var tupleTarget = getTupleTargetType(elementFlags || ts.map(elementTypes, function (_) { return 1 /* Required */; }), readonly, namedMemberDeclarations);\n            return tupleTarget === emptyGenericType ? emptyObjectType :\n                elementTypes.length ? createNormalizedTypeReference(tupleTarget, elementTypes) :\n                    tupleTarget;\n        }\n        function getTupleTargetType(elementFlags, readonly, namedMemberDeclarations) {\n            if (elementFlags.length === 1 && elementFlags[0] & 4 /* Rest */) {\n                // [...X[]] is equivalent to just X[]\n                return readonly ? globalReadonlyArrayType : globalArrayType;\n            }\n            var key = ts.map(elementFlags, function (f) { return f & 1 /* Required */ ? \"#\" : f & 2 /* Optional */ ? \"?\" : f & 4 /* Rest */ ? \".\" : \"*\"; }).join() +\n                (readonly ? \"R\" : \"\") +\n                (namedMemberDeclarations && namedMemberDeclarations.length ? \",\" + ts.map(namedMemberDeclarations, getNodeId).join(\",\") : \"\");\n            var type = tupleTypes.get(key);\n            if (!type) {\n                tupleTypes.set(key, type = createTupleTargetType(elementFlags, readonly, namedMemberDeclarations));\n            }\n            return type;\n        }\n        // We represent tuple types as type references to synthesized generic interface types created by\n        // this function. The types are of the form:\n        //\n        //   interface Tuple<T0, T1, T2, ...> extends Array<T0 | T1 | T2 | ...> { 0: T0, 1: T1, 2: T2, ... }\n        //\n        // Note that the generic type created by this function has no symbol associated with it. The same\n        // is true for each of the synthesized type parameters.\n        function createTupleTargetType(elementFlags, readonly, namedMemberDeclarations) {\n            var arity = elementFlags.length;\n            var minLength = ts.countWhere(elementFlags, function (f) { return !!(f & (1 /* Required */ | 8 /* Variadic */)); });\n            var typeParameters;\n            var properties = [];\n            var combinedFlags = 0;\n            if (arity) {\n                typeParameters = new Array(arity);\n                for (var i = 0; i < arity; i++) {\n                    var typeParameter = typeParameters[i] = createTypeParameter();\n                    var flags = elementFlags[i];\n                    combinedFlags |= flags;\n                    if (!(combinedFlags & 12 /* Variable */)) {\n                        var property = createSymbol(4 /* Property */ | (flags & 2 /* Optional */ ? 16777216 /* Optional */ : 0), \"\" + i, readonly ? 8 /* Readonly */ : 0);\n                        property.tupleLabelDeclaration = namedMemberDeclarations === null || namedMemberDeclarations === void 0 ? void 0 : namedMemberDeclarations[i];\n                        property.type = typeParameter;\n                        properties.push(property);\n                    }\n                }\n            }\n            var fixedLength = properties.length;\n            var lengthSymbol = createSymbol(4 /* Property */, \"length\");\n            if (combinedFlags & 12 /* Variable */) {\n                lengthSymbol.type = numberType;\n            }\n            else {\n                var literalTypes_1 = [];\n                for (var i = minLength; i <= arity; i++)\n                    literalTypes_1.push(getLiteralType(i));\n                lengthSymbol.type = getUnionType(literalTypes_1);\n            }\n            properties.push(lengthSymbol);\n            var type = createObjectType(8 /* Tuple */ | 4 /* Reference */);\n            type.typeParameters = typeParameters;\n            type.outerTypeParameters = undefined;\n            type.localTypeParameters = typeParameters;\n            type.instantiations = new ts.Map();\n            type.instantiations.set(getTypeListId(type.typeParameters), type);\n            type.target = type;\n            type.resolvedTypeArguments = type.typeParameters;\n            type.thisType = createTypeParameter();\n            type.thisType.isThisType = true;\n            type.thisType.constraint = type;\n            type.declaredProperties = properties;\n            type.declaredCallSignatures = ts.emptyArray;\n            type.declaredConstructSignatures = ts.emptyArray;\n            type.declaredStringIndexInfo = undefined;\n            type.declaredNumberIndexInfo = undefined;\n            type.elementFlags = elementFlags;\n            type.minLength = minLength;\n            type.fixedLength = fixedLength;\n            type.hasRestElement = !!(combinedFlags & 12 /* Variable */);\n            type.combinedFlags = combinedFlags;\n            type.readonly = readonly;\n            type.labeledElementDeclarations = namedMemberDeclarations;\n            return type;\n        }\n        function createNormalizedTypeReference(target, typeArguments) {\n            return target.objectFlags & 8 /* Tuple */ ? createNormalizedTupleType(target, typeArguments) : createTypeReference(target, typeArguments);\n        }\n        function createNormalizedTupleType(target, elementTypes) {\n            var _a, _b, _c;\n            if (!(target.combinedFlags & 14 /* NonRequired */)) {\n                // No need to normalize when we only have regular required elements\n                return createTypeReference(target, elementTypes);\n            }\n            if (target.combinedFlags & 8 /* Variadic */) {\n                // Transform [A, ...(X | Y | Z)] into [A, ...X] | [A, ...Y] | [A, ...Z]\n                var unionIndex_1 = ts.findIndex(elementTypes, function (t, i) { return !!(target.elementFlags[i] & 8 /* Variadic */ && t.flags & (131072 /* Never */ | 1048576 /* Union */)); });\n                if (unionIndex_1 >= 0) {\n                    return checkCrossProductUnion(ts.map(elementTypes, function (t, i) { return target.elementFlags[i] & 8 /* Variadic */ ? t : unknownType; })) ?\n                        mapType(elementTypes[unionIndex_1], function (t) { return createNormalizedTupleType(target, ts.replaceElement(elementTypes, unionIndex_1, t)); }) :\n                        errorType;\n                }\n            }\n            // We have optional, rest, or variadic elements that may need normalizing. Normalization ensures that all variadic\n            // elements are generic and that the tuple type has one of the following layouts, disregarding variadic elements:\n            // (1) Zero or more required elements, followed by zero or more optional elements, followed by zero or one rest element.\n            // (2) Zero or more required elements, followed by a rest element, followed by zero or more required elements.\n            // In either layout, zero or more generic variadic elements may be present at any location.\n            var expandedTypes = [];\n            var expandedFlags = [];\n            var expandedDeclarations = [];\n            var lastRequiredIndex = -1;\n            var firstRestIndex = -1;\n            var lastOptionalOrRestIndex = -1;\n            var _loop_13 = function (i) {\n                var type = elementTypes[i];\n                var flags = target.elementFlags[i];\n                if (flags & 8 /* Variadic */) {\n                    if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {\n                        // Generic variadic elements stay as they are.\n                        addElement(type, 8 /* Variadic */, (_a = target.labeledElementDeclarations) === null || _a === void 0 ? void 0 : _a[i]);\n                    }\n                    else if (isTupleType(type)) {\n                        var elements = getTypeArguments(type);\n                        if (elements.length + expandedTypes.length >= 10000) {\n                            error(currentNode, ts.isPartOfTypeNode(currentNode)\n                                ? ts.Diagnostics.Type_produces_a_tuple_type_that_is_too_large_to_represent\n                                : ts.Diagnostics.Expression_produces_a_tuple_type_that_is_too_large_to_represent);\n                            return { value: errorType };\n                        }\n                        // Spread variadic elements with tuple types into the resulting tuple.\n                        ts.forEach(elements, function (t, n) { var _a; return addElement(t, type.target.elementFlags[n], (_a = type.target.labeledElementDeclarations) === null || _a === void 0 ? void 0 : _a[n]); });\n                    }\n                    else {\n                        // Treat everything else as an array type and create a rest element.\n                        addElement(isArrayLikeType(type) && getIndexTypeOfType(type, 1 /* Number */) || errorType, 4 /* Rest */, (_b = target.labeledElementDeclarations) === null || _b === void 0 ? void 0 : _b[i]);\n                    }\n                }\n                else {\n                    // Copy other element kinds with no change.\n                    addElement(type, flags, (_c = target.labeledElementDeclarations) === null || _c === void 0 ? void 0 : _c[i]);\n                }\n            };\n            for (var i = 0; i < elementTypes.length; i++) {\n                var state_4 = _loop_13(i);\n                if (typeof state_4 === \"object\")\n                    return state_4.value;\n            }\n            // Turn optional elements preceding the last required element into required elements\n            for (var i = 0; i < lastRequiredIndex; i++) {\n                if (expandedFlags[i] & 2 /* Optional */)\n                    expandedFlags[i] = 1 /* Required */;\n            }\n            if (firstRestIndex >= 0 && firstRestIndex < lastOptionalOrRestIndex) {\n                // Turn elements between first rest and last optional/rest into a single rest element\n                expandedTypes[firstRestIndex] = getUnionType(ts.sameMap(expandedTypes.slice(firstRestIndex, lastOptionalOrRestIndex + 1), function (t, i) { return expandedFlags[firstRestIndex + i] & 8 /* Variadic */ ? getIndexedAccessType(t, numberType) : t; }));\n                expandedTypes.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex);\n                expandedFlags.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex);\n                expandedDeclarations === null || expandedDeclarations === void 0 ? void 0 : expandedDeclarations.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex);\n            }\n            var tupleTarget = getTupleTargetType(expandedFlags, target.readonly, expandedDeclarations);\n            return tupleTarget === emptyGenericType ? emptyObjectType :\n                expandedFlags.length ? createTypeReference(tupleTarget, expandedTypes) :\n                    tupleTarget;\n            function addElement(type, flags, declaration) {\n                if (flags & 1 /* Required */) {\n                    lastRequiredIndex = expandedFlags.length;\n                }\n                if (flags & 4 /* Rest */ && firstRestIndex < 0) {\n                    firstRestIndex = expandedFlags.length;\n                }\n                if (flags & (2 /* Optional */ | 4 /* Rest */)) {\n                    lastOptionalOrRestIndex = expandedFlags.length;\n                }\n                expandedTypes.push(type);\n                expandedFlags.push(flags);\n                if (expandedDeclarations && declaration) {\n                    expandedDeclarations.push(declaration);\n                }\n                else {\n                    expandedDeclarations = undefined;\n                }\n            }\n        }\n        function sliceTupleType(type, index, endSkipCount) {\n            if (endSkipCount === void 0) { endSkipCount = 0; }\n            var target = type.target;\n            var endIndex = getTypeReferenceArity(type) - endSkipCount;\n            return index > target.fixedLength ? getRestArrayTypeOfTupleType(type) || createTupleType(ts.emptyArray) :\n                createTupleType(getTypeArguments(type).slice(index, endIndex), target.elementFlags.slice(index, endIndex), \n                /*readonly*/ false, target.labeledElementDeclarations && target.labeledElementDeclarations.slice(index, endIndex));\n        }\n        function getKnownKeysOfTupleType(type) {\n            return getUnionType(ts.append(ts.arrayOf(type.target.fixedLength, function (i) { return getLiteralType(\"\" + i); }), getIndexType(type.target.readonly ? globalReadonlyArrayType : globalArrayType)));\n        }\n        // Return count of starting consecutive tuple elements of the given kind(s)\n        function getStartElementCount(type, flags) {\n            var index = ts.findIndex(type.elementFlags, function (f) { return !(f & flags); });\n            return index >= 0 ? index : type.elementFlags.length;\n        }\n        // Return count of ending consecutive tuple elements of the given kind(s)\n        function getEndElementCount(type, flags) {\n            return type.elementFlags.length - ts.findLastIndex(type.elementFlags, function (f) { return !(f & flags); }) - 1;\n        }\n        function getTypeFromOptionalTypeNode(node) {\n            var type = getTypeFromTypeNode(node.type);\n            return strictNullChecks ? getOptionalType(type) : type;\n        }\n        function getTypeId(type) {\n            return type.id;\n        }\n        function containsType(types, type) {\n            return ts.binarySearch(types, type, getTypeId, ts.compareValues) >= 0;\n        }\n        function insertType(types, type) {\n            var index = ts.binarySearch(types, type, getTypeId, ts.compareValues);\n            if (index < 0) {\n                types.splice(~index, 0, type);\n                return true;\n            }\n            return false;\n        }\n        function addTypeToUnion(typeSet, includes, type) {\n            var flags = type.flags;\n            if (flags & 1048576 /* Union */) {\n                return addTypesToUnion(typeSet, includes | (isNamedUnionType(type) ? 1048576 /* Union */ : 0), type.types);\n            }\n            // We ignore 'never' types in unions\n            if (!(flags & 131072 /* Never */)) {\n                includes |= flags & 205258751 /* IncludesMask */;\n                if (flags & 469499904 /* StructuredOrInstantiable */)\n                    includes |= 262144 /* IncludesStructuredOrInstantiable */;\n                if (type === wildcardType)\n                    includes |= 8388608 /* IncludesWildcard */;\n                if (!strictNullChecks && flags & 98304 /* Nullable */) {\n                    if (!(ts.getObjectFlags(type) & 524288 /* ContainsWideningType */))\n                        includes |= 4194304 /* IncludesNonWideningType */;\n                }\n                else {\n                    var len = typeSet.length;\n                    var index = len && type.id > typeSet[len - 1].id ? ~len : ts.binarySearch(typeSet, type, getTypeId, ts.compareValues);\n                    if (index < 0) {\n                        typeSet.splice(~index, 0, type);\n                    }\n                }\n            }\n            return includes;\n        }\n        // Add the given types to the given type set. Order is preserved, duplicates are removed,\n        // and nested types of the given kind are flattened into the set.\n        function addTypesToUnion(typeSet, includes, types) {\n            for (var _i = 0, types_10 = types; _i < types_10.length; _i++) {\n                var type = types_10[_i];\n                includes = addTypeToUnion(typeSet, includes, type);\n            }\n            return includes;\n        }\n        function removeSubtypes(types, hasObjectTypes) {\n            // We assume that redundant primitive types have already been removed from the types array and that there\n            // are no any and unknown types in the array. Thus, the only possible supertypes for primitive types are empty\n            // object types, and if none of those are present we can exclude primitive types from the subtype check.\n            var hasEmptyObject = hasObjectTypes && ts.some(types, function (t) { return !!(t.flags & 524288 /* Object */) && !isGenericMappedType(t) && isEmptyResolvedType(resolveStructuredTypeMembers(t)); });\n            var len = types.length;\n            var i = len;\n            var count = 0;\n            while (i > 0) {\n                i--;\n                var source = types[i];\n                if (hasEmptyObject || source.flags & 469499904 /* StructuredOrInstantiable */) {\n                    for (var _i = 0, types_11 = types; _i < types_11.length; _i++) {\n                        var target = types_11[_i];\n                        if (source !== target) {\n                            if (count === 100000) {\n                                // After 100000 subtype checks we estimate the remaining amount of work by assuming the\n                                // same ratio of checks per element. If the estimated number of remaining type checks is\n                                // greater than 1M we deem the union type too complex to represent. This for example\n                                // caps union types at 1000 unique object types.\n                                var estimatedCount = (count / (len - i)) * len;\n                                if (estimatedCount > 1000000) {\n                                    ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant(\"checkTypes\" /* CheckTypes */, \"removeSubtypes_DepthLimit\", { typeIds: types.map(function (t) { return t.id; }) });\n                                    error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);\n                                    return false;\n                                }\n                            }\n                            count++;\n                            if (isTypeRelatedTo(source, target, strictSubtypeRelation) && (!(ts.getObjectFlags(getTargetType(source)) & 1 /* Class */) ||\n                                !(ts.getObjectFlags(getTargetType(target)) & 1 /* Class */) ||\n                                isTypeDerivedFrom(source, target))) {\n                                ts.orderedRemoveItemAt(types, i);\n                                break;\n                            }\n                        }\n                    }\n                }\n            }\n            return true;\n        }\n        function removeRedundantLiteralTypes(types, includes, reduceVoidUndefined) {\n            var i = types.length;\n            while (i > 0) {\n                i--;\n                var t = types[i];\n                var flags = t.flags;\n                var remove = flags & 128 /* StringLiteral */ && includes & 4 /* String */ ||\n                    flags & 256 /* NumberLiteral */ && includes & 8 /* Number */ ||\n                    flags & 2048 /* BigIntLiteral */ && includes & 64 /* BigInt */ ||\n                    flags & 8192 /* UniqueESSymbol */ && includes & 4096 /* ESSymbol */ ||\n                    reduceVoidUndefined && flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||\n                    isFreshLiteralType(t) && containsType(types, t.regularType);\n                if (remove) {\n                    ts.orderedRemoveItemAt(types, i);\n                }\n            }\n        }\n        function removeStringLiteralsMatchedByTemplateLiterals(types) {\n            var templates = ts.filter(types, isPatternLiteralType);\n            if (templates.length) {\n                var i = types.length;\n                var _loop_14 = function () {\n                    i--;\n                    var t = types[i];\n                    if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return isTypeSubtypeOf(t, template); })) {\n                        ts.orderedRemoveItemAt(types, i);\n                    }\n                };\n                while (i > 0) {\n                    _loop_14();\n                }\n            }\n        }\n        function isNamedUnionType(type) {\n            return !!(type.flags & 1048576 /* Union */ && (type.aliasSymbol || type.origin));\n        }\n        function addNamedUnions(namedUnions, types) {\n            for (var _i = 0, types_12 = types; _i < types_12.length; _i++) {\n                var t = types_12[_i];\n                if (t.flags & 1048576 /* Union */) {\n                    var origin = t.origin;\n                    if (t.aliasSymbol || origin && !(origin.flags & 1048576 /* Union */)) {\n                        ts.pushIfUnique(namedUnions, t);\n                    }\n                    else if (origin && origin.flags & 1048576 /* Union */) {\n                        addNamedUnions(namedUnions, origin.types);\n                    }\n                }\n            }\n        }\n        function createOriginUnionOrIntersectionType(flags, types) {\n            var result = createOriginType(flags);\n            result.types = types;\n            return result;\n        }\n        // We sort and deduplicate the constituent types based on object identity. If the subtypeReduction\n        // flag is specified we also reduce the constituent type set to only include types that aren't subtypes\n        // of other types. Subtype reduction is expensive for large union types and is possible only when union\n        // types are known not to circularly reference themselves (as is the case with union types created by\n        // expression constructs such as array literals and the || and ?: operators). Named types can\n        // circularly reference themselves and therefore cannot be subtype reduced during their declaration.\n        // For example, \"type Item = string | (() => Item\" is a named type that circularly references itself.\n        function getUnionType(types, unionReduction, aliasSymbol, aliasTypeArguments, origin) {\n            if (unionReduction === void 0) { unionReduction = 1 /* Literal */; }\n            if (types.length === 0) {\n                return neverType;\n            }\n            if (types.length === 1) {\n                return types[0];\n            }\n            var typeSet = [];\n            var includes = addTypesToUnion(typeSet, 0, types);\n            if (unionReduction !== 0 /* None */) {\n                if (includes & 3 /* AnyOrUnknown */) {\n                    return includes & 1 /* Any */ ? includes & 8388608 /* IncludesWildcard */ ? wildcardType : anyType : unknownType;\n                }\n                if (unionReduction & (1 /* Literal */ | 2 /* Subtype */)) {\n                    if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {\n                        removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));\n                    }\n                    if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {\n                        removeStringLiteralsMatchedByTemplateLiterals(typeSet);\n                    }\n                }\n                if (unionReduction & 2 /* Subtype */) {\n                    if (!removeSubtypes(typeSet, !!(includes & 524288 /* Object */))) {\n                        return errorType;\n                    }\n                }\n                if (typeSet.length === 0) {\n                    return includes & 65536 /* Null */ ? includes & 4194304 /* IncludesNonWideningType */ ? nullType : nullWideningType :\n                        includes & 32768 /* Undefined */ ? includes & 4194304 /* IncludesNonWideningType */ ? undefinedType : undefinedWideningType :\n                            neverType;\n                }\n            }\n            if (!origin && includes & 1048576 /* Union */) {\n                var namedUnions = [];\n                addNamedUnions(namedUnions, types);\n                var reducedTypes = [];\n                var _loop_15 = function (t) {\n                    if (!ts.some(namedUnions, function (union) { return containsType(union.types, t); })) {\n                        reducedTypes.push(t);\n                    }\n                };\n                for (var _i = 0, typeSet_1 = typeSet; _i < typeSet_1.length; _i++) {\n                    var t = typeSet_1[_i];\n                    _loop_15(t);\n                }\n                if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) {\n                    return namedUnions[0];\n                }\n                // We create a denormalized origin type only when the union was created from one or more named unions\n                // (unions with alias symbols or origins) and when there is no overlap between those named unions.\n                var namedTypesCount = ts.reduceLeft(namedUnions, function (sum, union) { return sum + union.types.length; }, 0);\n                if (namedTypesCount + reducedTypes.length === typeSet.length) {\n                    for (var _a = 0, namedUnions_1 = namedUnions; _a < namedUnions_1.length; _a++) {\n                        var t = namedUnions_1[_a];\n                        insertType(reducedTypes, t);\n                    }\n                    origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);\n                }\n            }\n            var objectFlags = (includes & 468598819 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) |\n                (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0);\n            return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);\n        }\n        function getUnionTypePredicate(signatures) {\n            var first;\n            var types = [];\n            for (var _i = 0, signatures_6 = signatures; _i < signatures_6.length; _i++) {\n                var sig = signatures_6[_i];\n                var pred = getTypePredicateOfSignature(sig);\n                if (!pred || pred.kind === 2 /* AssertsThis */ || pred.kind === 3 /* AssertsIdentifier */) {\n                    continue;\n                }\n                if (first) {\n                    if (!typePredicateKindsMatch(first, pred)) {\n                        // No common type predicate.\n                        return undefined;\n                    }\n                }\n                else {\n                    first = pred;\n                }\n                types.push(pred.type);\n            }\n            if (!first) {\n                // No union signatures had a type predicate.\n                return undefined;\n            }\n            var unionType = getUnionType(types);\n            return createTypePredicate(first.kind, first.parameterName, first.parameterIndex, unionType);\n        }\n        function typePredicateKindsMatch(a, b) {\n            return a.kind === b.kind && a.parameterIndex === b.parameterIndex;\n        }\n        function createUnionType(types, aliasSymbol, aliasTypeArguments, origin) {\n            var result = createType(1048576 /* Union */);\n            result.objectFlags = getPropagatingFlagsOfTypes(types, /*excludeKinds*/ 98304 /* Nullable */);\n            result.types = types;\n            result.origin = origin;\n            result.aliasSymbol = aliasSymbol;\n            result.aliasTypeArguments = aliasTypeArguments;\n            return result;\n        }\n        // This function assumes the constituent type list is sorted and deduplicated.\n        function getUnionTypeFromSortedList(types, objectFlags, aliasSymbol, aliasTypeArguments, origin) {\n            if (types.length === 0) {\n                return neverType;\n            }\n            if (types.length === 1) {\n                return types[0];\n            }\n            var typeKey = !origin ? getTypeListId(types) :\n                origin.flags & 1048576 /* Union */ ? \"|\" + getTypeListId(origin.types) :\n                    origin.flags & 2097152 /* Intersection */ ? \"&\" + getTypeListId(origin.types) :\n                        \"#\" + origin.type.id;\n            var id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments);\n            var type = unionTypes.get(id);\n            if (!type) {\n                type = createUnionType(types, aliasSymbol, aliasTypeArguments, origin);\n                type.objectFlags |= objectFlags;\n                unionTypes.set(id, type);\n            }\n            return type;\n        }\n        function getTypeFromUnionTypeNode(node) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedType) {\n                var aliasSymbol = getAliasSymbolForTypeNode(node);\n                links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), 1 /* Literal */, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));\n            }\n            return links.resolvedType;\n        }\n        function addTypeToIntersection(typeSet, includes, type) {\n            var flags = type.flags;\n            if (flags & 2097152 /* Intersection */) {\n                return addTypesToIntersection(typeSet, includes, type.types);\n            }\n            if (isEmptyAnonymousObjectType(type)) {\n                if (!(includes & 16777216 /* IncludesEmptyObject */)) {\n                    includes |= 16777216 /* IncludesEmptyObject */;\n                    typeSet.set(type.id.toString(), type);\n                }\n            }\n            else {\n                if (flags & 3 /* AnyOrUnknown */) {\n                    if (type === wildcardType)\n                        includes |= 8388608 /* IncludesWildcard */;\n                }\n                else if ((strictNullChecks || !(flags & 98304 /* Nullable */)) && !typeSet.has(type.id.toString())) {\n                    if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) {\n                        // We have seen two distinct unit types which means we should reduce to an\n                        // empty intersection. Adding TypeFlags.NonPrimitive causes that to happen.\n                        includes |= 67108864 /* NonPrimitive */;\n                    }\n                    typeSet.set(type.id.toString(), type);\n                }\n                includes |= flags & 205258751 /* IncludesMask */;\n            }\n            return includes;\n        }\n        // Add the given types to the given type set. Order is preserved, freshness is removed from literal\n        // types, duplicates are removed, and nested types of the given kind are flattened into the set.\n        function addTypesToIntersection(typeSet, includes, types) {\n            for (var _i = 0, types_13 = types; _i < types_13.length; _i++) {\n                var type = types_13[_i];\n                includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type));\n            }\n            return includes;\n        }\n        function removeRedundantPrimitiveTypes(types, includes) {\n            var i = types.length;\n            while (i > 0) {\n                i--;\n                var t = types[i];\n                var remove = t.flags & 4 /* String */ && includes & 128 /* StringLiteral */ ||\n                    t.flags & 8 /* Number */ && includes & 256 /* NumberLiteral */ ||\n                    t.flags & 64 /* BigInt */ && includes & 2048 /* BigIntLiteral */ ||\n                    t.flags & 4096 /* ESSymbol */ && includes & 8192 /* UniqueESSymbol */;\n                if (remove) {\n                    ts.orderedRemoveItemAt(types, i);\n                }\n            }\n        }\n        // Check that the given type has a match in every union. A given type is matched by\n        // an identical type, and a literal type is additionally matched by its corresponding\n        // primitive type.\n        function eachUnionContains(unionTypes, type) {\n            for (var _i = 0, unionTypes_1 = unionTypes; _i < unionTypes_1.length; _i++) {\n                var u = unionTypes_1[_i];\n                if (!containsType(u.types, type)) {\n                    var primitive = type.flags & 128 /* StringLiteral */ ? stringType :\n                        type.flags & 256 /* NumberLiteral */ ? numberType :\n                            type.flags & 2048 /* BigIntLiteral */ ? bigintType :\n                                type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType :\n                                    undefined;\n                    if (!primitive || !containsType(u.types, primitive)) {\n                        return false;\n                    }\n                }\n            }\n            return true;\n        }\n        /**\n         * Returns `true` if the intersection of the template literals and string literals is the empty set, eg `get${string}` & \"setX\", and should reduce to `never`\n         */\n        function extractRedundantTemplateLiterals(types) {\n            var i = types.length;\n            var literals = ts.filter(types, function (t) { return !!(t.flags & 128 /* StringLiteral */); });\n            while (i > 0) {\n                i--;\n                var t = types[i];\n                if (!(t.flags & 134217728 /* TemplateLiteral */))\n                    continue;\n                for (var _i = 0, literals_1 = literals; _i < literals_1.length; _i++) {\n                    var t2 = literals_1[_i];\n                    if (isTypeSubtypeOf(t2, t)) {\n                        // eg, ``get${T}` & \"getX\"` is just `\"getX\"`\n                        ts.orderedRemoveItemAt(types, i);\n                        break;\n                    }\n                    else if (isPatternLiteralType(t)) {\n                        return true;\n                    }\n                }\n            }\n            return false;\n        }\n        function extractIrreducible(types, flag) {\n            if (ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); })) {\n                for (var i = 0; i < types.length; i++) {\n                    types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });\n                }\n                return true;\n            }\n            return false;\n        }\n        // If the given list of types contains more than one union of primitive types, replace the\n        // first with a union containing an intersection of those primitive types, then remove the\n        // other unions and return true. Otherwise, do nothing and return false.\n        function intersectUnionsOfPrimitiveTypes(types) {\n            var unionTypes;\n            var index = ts.findIndex(types, function (t) { return !!(ts.getObjectFlags(t) & 262144 /* PrimitiveUnion */); });\n            if (index < 0) {\n                return false;\n            }\n            var i = index + 1;\n            // Remove all but the first union of primitive types and collect them in\n            // the unionTypes array.\n            while (i < types.length) {\n                var t = types[i];\n                if (ts.getObjectFlags(t) & 262144 /* PrimitiveUnion */) {\n                    (unionTypes || (unionTypes = [types[index]])).push(t);\n                    ts.orderedRemoveItemAt(types, i);\n                }\n                else {\n                    i++;\n                }\n            }\n            // Return false if there was only one union of primitive types\n            if (!unionTypes) {\n                return false;\n            }\n            // We have more than one union of primitive types, now intersect them. For each\n            // type in each union we check if the type is matched in every union and if so\n            // we include it in the result.\n            var checked = [];\n            var result = [];\n            for (var _i = 0, unionTypes_2 = unionTypes; _i < unionTypes_2.length; _i++) {\n                var u = unionTypes_2[_i];\n                for (var _a = 0, _b = u.types; _a < _b.length; _a++) {\n                    var t = _b[_a];\n                    if (insertType(checked, t)) {\n                        if (eachUnionContains(unionTypes, t)) {\n                            insertType(result, t);\n                        }\n                    }\n                }\n            }\n            // Finally replace the first union with the result\n            types[index] = getUnionTypeFromSortedList(result, 262144 /* PrimitiveUnion */);\n            return true;\n        }\n        function createIntersectionType(types, aliasSymbol, aliasTypeArguments) {\n            var result = createType(2097152 /* Intersection */);\n            result.objectFlags = getPropagatingFlagsOfTypes(types, /*excludeKinds*/ 98304 /* Nullable */);\n            result.types = types;\n            result.aliasSymbol = aliasSymbol;\n            result.aliasTypeArguments = aliasTypeArguments;\n            return result;\n        }\n        // We normalize combinations of intersection and union types based on the distributive property of the '&'\n        // operator. Specifically, because X & (A | B) is equivalent to X & A | X & B, we can transform intersection\n        // types with union type constituents into equivalent union types with intersection type constituents and\n        // effectively ensure that union types are always at the top level in type representations.\n        //\n        // We do not perform structural deduplication on intersection types. Intersection types are created only by the &\n        // type operator and we can't reduce those because we want to support recursive intersection types. For example,\n        // a type alias of the form \"type List<T> = T & { next: List<T> }\" cannot be reduced during its declaration.\n        // Also, unlike union types, the order of the constituent types is preserved in order that overload resolution\n        // for intersections of types with signatures can be deterministic.\n        function getIntersectionType(types, aliasSymbol, aliasTypeArguments) {\n            var typeMembershipMap = new ts.Map();\n            var includes = addTypesToIntersection(typeMembershipMap, 0, types);\n            var typeSet = ts.arrayFrom(typeMembershipMap.values());\n            // An intersection type is considered empty if it contains\n            // the type never, or\n            // more than one unit type or,\n            // an object type and a nullable type (null or undefined), or\n            // a string-like type and a type known to be non-string-like, or\n            // a number-like type and a type known to be non-number-like, or\n            // a symbol-like type and a type known to be non-symbol-like, or\n            // a void-like type and a type known to be non-void-like, or\n            // a non-primitive type and a type known to be primitive.\n            if (includes & 131072 /* Never */ ||\n                strictNullChecks && includes & 98304 /* Nullable */ && includes & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 16777216 /* IncludesEmptyObject */) ||\n                includes & 67108864 /* NonPrimitive */ && includes & (469892092 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) ||\n                includes & 402653316 /* StringLike */ && includes & (469892092 /* DisjointDomains */ & ~402653316 /* StringLike */) ||\n                includes & 296 /* NumberLike */ && includes & (469892092 /* DisjointDomains */ & ~296 /* NumberLike */) ||\n                includes & 2112 /* BigIntLike */ && includes & (469892092 /* DisjointDomains */ & ~2112 /* BigIntLike */) ||\n                includes & 12288 /* ESSymbolLike */ && includes & (469892092 /* DisjointDomains */ & ~12288 /* ESSymbolLike */) ||\n                includes & 49152 /* VoidLike */ && includes & (469892092 /* DisjointDomains */ & ~49152 /* VoidLike */)) {\n                return neverType;\n            }\n            if (includes & 134217728 /* TemplateLiteral */ && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) {\n                return neverType;\n            }\n            if (includes & 1 /* Any */) {\n                return includes & 8388608 /* IncludesWildcard */ ? wildcardType : anyType;\n            }\n            if (!strictNullChecks && includes & 98304 /* Nullable */) {\n                return includes & 32768 /* Undefined */ ? undefinedType : nullType;\n            }\n            if (includes & 4 /* String */ && includes & 128 /* StringLiteral */ ||\n                includes & 8 /* Number */ && includes & 256 /* NumberLiteral */ ||\n                includes & 64 /* BigInt */ && includes & 2048 /* BigIntLiteral */ ||\n                includes & 4096 /* ESSymbol */ && includes & 8192 /* UniqueESSymbol */) {\n                removeRedundantPrimitiveTypes(typeSet, includes);\n            }\n            if (includes & 16777216 /* IncludesEmptyObject */ && includes & 524288 /* Object */) {\n                ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));\n            }\n            if (typeSet.length === 0) {\n                return unknownType;\n            }\n            if (typeSet.length === 1) {\n                return typeSet[0];\n            }\n            var id = getTypeListId(typeSet) + getAliasId(aliasSymbol, aliasTypeArguments);\n            var result = intersectionTypes.get(id);\n            if (!result) {\n                if (includes & 1048576 /* Union */) {\n                    if (intersectUnionsOfPrimitiveTypes(typeSet)) {\n                        // When the intersection creates a reduced set (which might mean that *all* union types have\n                        // disappeared), we restart the operation to get a new set of combined flags. Once we have\n                        // reduced we'll never reduce again, so this occurs at most once.\n                        result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);\n                    }\n                    else if (extractIrreducible(typeSet, 32768 /* Undefined */)) {\n                        result = getUnionType([getIntersectionType(typeSet), undefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);\n                    }\n                    else if (extractIrreducible(typeSet, 65536 /* Null */)) {\n                        result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);\n                    }\n                    else {\n                        // We are attempting to construct a type of the form X & (A | B) & (C | D). Transform this into a type of\n                        // the form X & A & C | X & A & D | X & B & C | X & B & D. If the estimated size of the resulting union type\n                        // exceeds 100000 constituents, report an error.\n                        if (!checkCrossProductUnion(typeSet)) {\n                            return errorType;\n                        }\n                        var constituents = getCrossProductIntersections(typeSet);\n                        // We attach a denormalized origin type when at least one constituent of the cross-product union is an\n                        // intersection (i.e. when the intersection didn't just reduce one or more unions to smaller unions).\n                        var origin = ts.some(constituents, function (t) { return !!(t.flags & 2097152 /* Intersection */); }) ? createOriginUnionOrIntersectionType(2097152 /* Intersection */, typeSet) : undefined;\n                        result = getUnionType(constituents, 1 /* Literal */, aliasSymbol, aliasTypeArguments, origin);\n                    }\n                }\n                else {\n                    result = createIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);\n                }\n                intersectionTypes.set(id, result);\n            }\n            return result;\n        }\n        function getCrossProductUnionSize(types) {\n            return ts.reduceLeft(types, function (n, t) { return t.flags & 1048576 /* Union */ ? n * t.types.length : t.flags & 131072 /* Never */ ? 0 : n; }, 1);\n        }\n        function checkCrossProductUnion(types) {\n            var size = getCrossProductUnionSize(types);\n            if (size >= 100000) {\n                ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant(\"checkTypes\" /* CheckTypes */, \"checkCrossProductUnion_DepthLimit\", { typeIds: types.map(function (t) { return t.id; }), size: size });\n                error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);\n                return false;\n            }\n            return true;\n        }\n        function getCrossProductIntersections(types) {\n            var count = getCrossProductUnionSize(types);\n            var intersections = [];\n            for (var i = 0; i < count; i++) {\n                var constituents = types.slice();\n                var n = i;\n                for (var j = types.length - 1; j >= 0; j--) {\n                    if (types[j].flags & 1048576 /* Union */) {\n                        var sourceTypes = types[j].types;\n                        var length_5 = sourceTypes.length;\n                        constituents[j] = sourceTypes[n % length_5];\n                        n = Math.floor(n / length_5);\n                    }\n                }\n                var t = getIntersectionType(constituents);\n                if (!(t.flags & 131072 /* Never */))\n                    intersections.push(t);\n            }\n            return intersections;\n        }\n        function getTypeFromIntersectionTypeNode(node) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedType) {\n                var aliasSymbol = getAliasSymbolForTypeNode(node);\n                links.resolvedType = getIntersectionType(ts.map(node.types, getTypeFromTypeNode), aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));\n            }\n            return links.resolvedType;\n        }\n        function createIndexType(type, stringsOnly) {\n            var result = createType(4194304 /* Index */);\n            result.type = type;\n            result.stringsOnly = stringsOnly;\n            return result;\n        }\n        function createOriginIndexType(type) {\n            var result = createOriginType(4194304 /* Index */);\n            result.type = type;\n            return result;\n        }\n        function getIndexTypeForGenericType(type, stringsOnly) {\n            return stringsOnly ?\n                type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, /*stringsOnly*/ true)) :\n                type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, /*stringsOnly*/ false));\n        }\n        function instantiateTypeAsMappedNameType(nameType, type, t) {\n            return instantiateType(nameType, appendTypeMapping(type.mapper, getTypeParameterFromMappedType(type), t));\n        }\n        function getIndexTypeForMappedType(type, noIndexSignatures) {\n            var constraint = filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); });\n            var nameType = type.declaration.nameType && getTypeFromTypeNode(type.declaration.nameType);\n            // If the constraint is exclusively string/number/never type(s), we need to pull the property names from the modified type and run them through the `nameType` mapper as well\n            // since they won't appear in the constraint, due to subtype reducing with the string/number index types\n            var properties = nameType && everyType(constraint, function (t) { return !!(t.flags & (4 /* String */ | 8 /* Number */ | 131072 /* Never */)); }) && getPropertiesOfType(getApparentType(getModifiersTypeFromMappedType(type)));\n            return nameType ?\n                getUnionType([mapType(constraint, function (t) { return instantiateTypeAsMappedNameType(nameType, type, t); }), mapType(getUnionType(ts.map(properties || ts.emptyArray, function (p) { return getLiteralTypeFromProperty(p, 8576 /* StringOrNumberLiteralOrUnique */); })), function (t) { return instantiateTypeAsMappedNameType(nameType, type, t); })]) :\n                constraint;\n        }\n        // Ordinarily we reduce a keyof M, where M is a mapped type { [P in K as N<P>]: X }, to simply N<K>. This however presumes\n        // that N distributes over union types, i.e. that N<A | B | C> is equivalent to N<A> | N<B> | N<C>. That presumption may not\n        // be true when N is a non-distributive conditional type or an instantiable type with a non-distributive conditional type as\n        // a constituent. In those cases, we cannot reduce keyof M and need to preserve it as is.\n        function maybeNonDistributiveNameType(type) {\n            return !!(type && (type.flags & 16777216 /* Conditional */ && (!type.root.isDistributive || maybeNonDistributiveNameType(type.checkType)) ||\n                type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) && ts.some(type.types, maybeNonDistributiveNameType) ||\n                type.flags & (4194304 /* Index */ | 268435456 /* StringMapping */) && maybeNonDistributiveNameType(type.type) ||\n                type.flags & 8388608 /* IndexedAccess */ && maybeNonDistributiveNameType(type.indexType) ||\n                type.flags & 33554432 /* Substitution */ && maybeNonDistributiveNameType(type.substitute)));\n        }\n        function getLiteralTypeFromPropertyName(name) {\n            if (ts.isPrivateIdentifier(name)) {\n                return neverType;\n            }\n            return ts.isIdentifier(name) ? getLiteralType(ts.unescapeLeadingUnderscores(name.escapedText)) :\n                getRegularTypeOfLiteralType(ts.isComputedPropertyName(name) ? checkComputedPropertyName(name) : checkExpression(name));\n        }\n        function getBigIntLiteralType(node) {\n            return getLiteralType({\n                negative: false,\n                base10Value: ts.parsePseudoBigInt(node.text)\n            });\n        }\n        function getLiteralTypeFromProperty(prop, include) {\n            if (!(ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 /* NonPublicAccessibilityModifier */)) {\n                var type = getSymbolLinks(getLateBoundSymbol(prop)).nameType;\n                if (!type && !ts.isKnownSymbol(prop)) {\n                    if (prop.escapedName === \"default\" /* Default */) {\n                        type = getLiteralType(\"default\");\n                    }\n                    else {\n                        var name = prop.valueDeclaration && ts.getNameOfDeclaration(prop.valueDeclaration);\n                        type = name && getLiteralTypeFromPropertyName(name) || getLiteralType(ts.symbolName(prop));\n                    }\n                }\n                if (type && type.flags & include) {\n                    return type;\n                }\n            }\n            return neverType;\n        }\n        function getLiteralTypeFromProperties(type, include, includeOrigin) {\n            var origin = includeOrigin && (ts.getObjectFlags(type) & (3 /* ClassOrInterface */ | 4 /* Reference */) || type.aliasSymbol) ? createOriginIndexType(type) : undefined;\n            return getUnionType(ts.map(getPropertiesOfType(type), function (p) { return getLiteralTypeFromProperty(p, include); }), 1 /* Literal */, \n            /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, origin);\n        }\n        function getNonEnumNumberIndexInfo(type) {\n            var numberIndexInfo = getIndexInfoOfType(type, 1 /* Number */);\n            return numberIndexInfo !== enumNumberIndexInfo ? numberIndexInfo : undefined;\n        }\n        function getIndexType(type, stringsOnly, noIndexSignatures) {\n            if (stringsOnly === void 0) { stringsOnly = keyofStringsOnly; }\n            var includeOrigin = stringsOnly === keyofStringsOnly && !noIndexSignatures;\n            type = getReducedType(type);\n            return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :\n                type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :\n                    type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && maybeNonDistributiveNameType(getNameTypeFromMappedType(type)) ? getIndexTypeForGenericType(type, stringsOnly) :\n                        ts.getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, noIndexSignatures) :\n                            type === wildcardType ? wildcardType :\n                                type.flags & 2 /* Unknown */ ? neverType :\n                                    type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType :\n                                        stringsOnly ? !noIndexSignatures && getIndexInfoOfType(type, 0 /* String */) ? stringType : getLiteralTypeFromProperties(type, 128 /* StringLiteral */, includeOrigin) :\n                                            !noIndexSignatures && getIndexInfoOfType(type, 0 /* String */) ? getUnionType([stringType, numberType, getLiteralTypeFromProperties(type, 8192 /* UniqueESSymbol */, includeOrigin)]) :\n                                                getNonEnumNumberIndexInfo(type) ? getUnionType([numberType, getLiteralTypeFromProperties(type, 128 /* StringLiteral */ | 8192 /* UniqueESSymbol */, includeOrigin)]) :\n                                                    getLiteralTypeFromProperties(type, 8576 /* StringOrNumberLiteralOrUnique */, includeOrigin);\n        }\n        function getExtractStringType(type) {\n            if (keyofStringsOnly) {\n                return type;\n            }\n            var extractTypeAlias = getGlobalExtractSymbol();\n            return extractTypeAlias ? getTypeAliasInstantiation(extractTypeAlias, [type, stringType]) : stringType;\n        }\n        function getIndexTypeOrString(type) {\n            var indexType = getExtractStringType(getIndexType(type));\n            return indexType.flags & 131072 /* Never */ ? stringType : indexType;\n        }\n        function getTypeFromTypeOperatorNode(node) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedType) {\n                switch (node.operator) {\n                    case 138 /* KeyOfKeyword */:\n                        links.resolvedType = getIndexType(getTypeFromTypeNode(node.type));\n                        break;\n                    case 151 /* UniqueKeyword */:\n                        links.resolvedType = node.type.kind === 148 /* SymbolKeyword */\n                            ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent))\n                            : errorType;\n                        break;\n                    case 142 /* ReadonlyKeyword */:\n                        links.resolvedType = getTypeFromTypeNode(node.type);\n                        break;\n                    default:\n                        throw ts.Debug.assertNever(node.operator);\n                }\n            }\n            return links.resolvedType;\n        }\n        function getTypeFromTemplateTypeNode(node) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedType) {\n                links.resolvedType = getTemplateLiteralType(__spreadArray([node.head.text], ts.map(node.templateSpans, function (span) { return span.literal.text; })), ts.map(node.templateSpans, function (span) { return getTypeFromTypeNode(span.type); }));\n            }\n            return links.resolvedType;\n        }\n        function getTemplateLiteralType(texts, types) {\n            var unionIndex = ts.findIndex(types, function (t) { return !!(t.flags & (131072 /* Never */ | 1048576 /* Union */)); });\n            if (unionIndex >= 0) {\n                return checkCrossProductUnion(types) ?\n                    mapType(types[unionIndex], function (t) { return getTemplateLiteralType(texts, ts.replaceElement(types, unionIndex, t)); }) :\n                    errorType;\n            }\n            if (ts.contains(types, wildcardType)) {\n                return wildcardType;\n            }\n            var newTypes = [];\n            var newTexts = [];\n            var text = texts[0];\n            if (!addSpans(texts, types)) {\n                return stringType;\n            }\n            if (newTypes.length === 0) {\n                return getLiteralType(text);\n            }\n            newTexts.push(text);\n            if (ts.every(newTexts, function (t) { return t === \"\"; }) && ts.every(newTypes, function (t) { return !!(t.flags & 4 /* String */); })) {\n                return stringType;\n            }\n            var id = getTypeListId(newTypes) + \"|\" + ts.map(newTexts, function (t) { return t.length; }).join(\",\") + \"|\" + newTexts.join(\"\");\n            var type = templateLiteralTypes.get(id);\n            if (!type) {\n                templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes));\n            }\n            return type;\n            function addSpans(texts, types) {\n                for (var i = 0; i < types.length; i++) {\n                    var t = types[i];\n                    if (t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) {\n                        text += getTemplateStringForType(t) || \"\";\n                        text += texts[i + 1];\n                    }\n                    else if (t.flags & 134217728 /* TemplateLiteral */) {\n                        text += t.texts[0];\n                        if (!addSpans(t.texts, t.types))\n                            return false;\n                        text += texts[i + 1];\n                    }\n                    else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t)) {\n                        newTypes.push(t);\n                        newTexts.push(text);\n                        text = texts[i + 1];\n                    }\n                    else {\n                        return false;\n                    }\n                }\n                return true;\n            }\n        }\n        function getTemplateStringForType(type) {\n            return type.flags & 128 /* StringLiteral */ ? type.value :\n                type.flags & 256 /* NumberLiteral */ ? \"\" + type.value :\n                    type.flags & 2048 /* BigIntLiteral */ ? ts.pseudoBigIntToString(type.value) :\n                        type.flags & 512 /* BooleanLiteral */ ? type.intrinsicName :\n                            type.flags & 65536 /* Null */ ? \"null\" :\n                                type.flags & 32768 /* Undefined */ ? \"undefined\" :\n                                    undefined;\n        }\n        function createTemplateLiteralType(texts, types) {\n            var type = createType(134217728 /* TemplateLiteral */);\n            type.texts = texts;\n            type.types = types;\n            return type;\n        }\n        function getStringMappingType(symbol, type) {\n            return type.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) :\n                isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) :\n                    type.flags & 128 /* StringLiteral */ ? getLiteralType(applyStringMapping(symbol, type.value)) :\n                        type;\n        }\n        function applyStringMapping(symbol, str) {\n            switch (intrinsicTypeKinds.get(symbol.escapedName)) {\n                case 0 /* Uppercase */: return str.toUpperCase();\n                case 1 /* Lowercase */: return str.toLowerCase();\n                case 2 /* Capitalize */: return str.charAt(0).toUpperCase() + str.slice(1);\n                case 3 /* Uncapitalize */: return str.charAt(0).toLowerCase() + str.slice(1);\n            }\n            return str;\n        }\n        function getStringMappingTypeForGenericType(symbol, type) {\n            var id = getSymbolId(symbol) + \",\" + getTypeId(type);\n            var result = stringMappingTypes.get(id);\n            if (!result) {\n                stringMappingTypes.set(id, result = createStringMappingType(symbol, type));\n            }\n            return result;\n        }\n        function createStringMappingType(symbol, type) {\n            var result = createType(268435456 /* StringMapping */);\n            result.symbol = symbol;\n            result.type = type;\n            return result;\n        }\n        function createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined) {\n            var type = createType(8388608 /* IndexedAccess */);\n            type.objectType = objectType;\n            type.indexType = indexType;\n            type.aliasSymbol = aliasSymbol;\n            type.aliasTypeArguments = aliasTypeArguments;\n            type.noUncheckedIndexedAccessCandidate = shouldIncludeUndefined;\n            return type;\n        }\n        /**\n         * Returns if a type is or consists of a JSLiteral object type\n         * In addition to objects which are directly literals,\n         * * unions where every element is a jsliteral\n         * * intersections where at least one element is a jsliteral\n         * * and instantiable types constrained to a jsliteral\n         * Should all count as literals and not print errors on access or assignment of possibly existing properties.\n         * This mirrors the behavior of the index signature propagation, to which this behaves similarly (but doesn't affect assignability or inference).\n         */\n        function isJSLiteralType(type) {\n            if (noImplicitAny) {\n                return false; // Flag is meaningless under `noImplicitAny` mode\n            }\n            if (ts.getObjectFlags(type) & 16384 /* JSLiteral */) {\n                return true;\n            }\n            if (type.flags & 1048576 /* Union */) {\n                return ts.every(type.types, isJSLiteralType);\n            }\n            if (type.flags & 2097152 /* Intersection */) {\n                return ts.some(type.types, isJSLiteralType);\n            }\n            if (type.flags & 465829888 /* Instantiable */) {\n                var constraint = getResolvedBaseConstraint(type);\n                return constraint !== type && isJSLiteralType(constraint);\n            }\n            return false;\n        }\n        function getPropertyNameFromIndex(indexType, accessNode) {\n            var accessExpression = accessNode && accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode : undefined;\n            return isTypeUsableAsPropertyName(indexType) ?\n                getPropertyNameFromType(indexType) :\n                accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ?\n                    ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name)) :\n                    accessNode && ts.isPropertyName(accessNode) ?\n                        // late bound names are handled in the first branch, so here we only need to handle normal names\n                        ts.getPropertyNameForPropertyNameNode(accessNode) :\n                        undefined;\n        }\n        function isUncalledFunctionReference(node, symbol) {\n            if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) {\n                var parent = ts.findAncestor(node.parent, function (n) { return !ts.isAccessExpression(n); }) || node.parent;\n                if (ts.isCallLikeExpression(parent)) {\n                    return ts.isCallOrNewExpression(parent) && ts.isIdentifier(node) && hasMatchingArgument(parent, node);\n                }\n                return ts.every(symbol.declarations, function (d) { return !ts.isFunctionLike(d) || !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); });\n            }\n            return true;\n        }\n        function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags, noUncheckedIndexedAccessCandidate, reportDeprecated) {\n            var _a;\n            var accessExpression = accessNode && accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode : undefined;\n            var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode);\n            if (propName !== undefined) {\n                var prop = getPropertyOfType(objectType, propName);\n                if (prop) {\n                    if (reportDeprecated && accessNode && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(accessNode, prop)) {\n                        var deprecatedNode = (_a = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a !== void 0 ? _a : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode);\n                        addDeprecatedSuggestion(deprecatedNode, prop.declarations, propName);\n                    }\n                    if (accessExpression) {\n                        markPropertyAsReferenced(prop, accessExpression, /*isThisAccess*/ accessExpression.expression.kind === 107 /* ThisKeyword */);\n                        if (isAssignmentToReadonlyEntity(accessExpression, prop, ts.getAssignmentTargetKind(accessExpression))) {\n                            error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(prop));\n                            return undefined;\n                        }\n                        if (accessFlags & 4 /* CacheSymbol */) {\n                            getNodeLinks(accessNode).resolvedSymbol = prop;\n                        }\n                        if (isThisPropertyAccessInConstructor(accessExpression, prop)) {\n                            return autoType;\n                        }\n                    }\n                    var propType = getTypeOfSymbol(prop);\n                    return accessExpression && ts.getAssignmentTargetKind(accessExpression) !== 1 /* Definite */ ?\n                        getFlowTypeOfReference(accessExpression, propType) :\n                        propType;\n                }\n                if (everyType(objectType, isTupleType) && isNumericLiteralName(propName) && +propName >= 0) {\n                    if (accessNode && everyType(objectType, function (t) { return !t.target.hasRestElement; }) && !(accessFlags & 8 /* NoTupleBoundsCheck */)) {\n                        var indexNode = getIndexNodeForAccessExpression(accessNode);\n                        if (isTupleType(objectType)) {\n                            error(indexNode, ts.Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2, typeToString(objectType), getTypeReferenceArity(objectType), ts.unescapeLeadingUnderscores(propName));\n                        }\n                        else {\n                            error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(propName), typeToString(objectType));\n                        }\n                    }\n                    errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, 1 /* Number */));\n                    return mapType(objectType, function (t) {\n                        var restType = getRestTypeOfTupleType(t) || undefinedType;\n                        return noUncheckedIndexedAccessCandidate ? getUnionType([restType, undefinedType]) : restType;\n                    });\n                }\n            }\n            if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) {\n                if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) {\n                    return objectType;\n                }\n                var stringIndexInfo = getIndexInfoOfType(objectType, 0 /* String */);\n                var indexInfo = isTypeAssignableToKind(indexType, 296 /* NumberLike */) && getIndexInfoOfType(objectType, 1 /* Number */) || stringIndexInfo;\n                if (indexInfo) {\n                    if (accessFlags & 1 /* NoIndexSignatures */ && indexInfo === stringIndexInfo) {\n                        if (accessExpression) {\n                            error(accessExpression, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(originalObjectType));\n                        }\n                        return undefined;\n                    }\n                    if (accessNode && !isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {\n                        var indexNode = getIndexNodeForAccessExpression(accessNode);\n                        error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));\n                        return noUncheckedIndexedAccessCandidate ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;\n                    }\n                    errorIfWritingToReadonlyIndex(indexInfo);\n                    return noUncheckedIndexedAccessCandidate ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;\n                }\n                if (indexType.flags & 131072 /* Never */) {\n                    return neverType;\n                }\n                if (isJSLiteralType(objectType)) {\n                    return anyType;\n                }\n                if (accessExpression && !isConstEnumObjectType(objectType)) {\n                    if (isObjectLiteralType(objectType)) {\n                        if (noImplicitAny && indexType.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */)) {\n                            diagnostics.add(ts.createDiagnosticForNode(accessExpression, ts.Diagnostics.Property_0_does_not_exist_on_type_1, indexType.value, typeToString(objectType)));\n                            return undefinedType;\n                        }\n                        else if (indexType.flags & (8 /* Number */ | 4 /* String */)) {\n                            var types = ts.map(objectType.properties, function (property) {\n                                return getTypeOfSymbol(property);\n                            });\n                            return getUnionType(ts.append(types, undefinedType));\n                        }\n                    }\n                    if (objectType.symbol === globalThisSymbol && propName !== undefined && globalThisSymbol.exports.has(propName) && (globalThisSymbol.exports.get(propName).flags & 418 /* BlockScoped */)) {\n                        error(accessExpression, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(propName), typeToString(objectType));\n                    }\n                    else if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && !suppressNoImplicitAnyError) {\n                        if (propName !== undefined && typeHasStaticProperty(propName, objectType)) {\n                            var typeName = typeToString(objectType);\n                            error(accessExpression, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead, propName, typeName, typeName + \"[\" + ts.getTextOfNode(accessExpression.argumentExpression) + \"]\");\n                        }\n                        else if (getIndexTypeOfType(objectType, 1 /* Number */)) {\n                            error(accessExpression.argumentExpression, ts.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number);\n                        }\n                        else {\n                            var suggestion = void 0;\n                            if (propName !== undefined && (suggestion = getSuggestionForNonexistentProperty(propName, objectType))) {\n                                if (suggestion !== undefined) {\n                                    error(accessExpression.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName, typeToString(objectType), suggestion);\n                                }\n                            }\n                            else {\n                                var suggestion_1 = getSuggestionForNonexistentIndexSignature(objectType, accessExpression, indexType);\n                                if (suggestion_1 !== undefined) {\n                                    error(accessExpression, ts.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1, typeToString(objectType), suggestion_1);\n                                }\n                                else {\n                                    var errorInfo = void 0;\n                                    if (indexType.flags & 1024 /* EnumLiteral */) {\n                                        errorInfo = ts.chainDiagnosticMessages(/* details */ undefined, ts.Diagnostics.Property_0_does_not_exist_on_type_1, \"[\" + typeToString(indexType) + \"]\", typeToString(objectType));\n                                    }\n                                    else if (indexType.flags & 8192 /* UniqueESSymbol */) {\n                                        var symbolName_2 = getFullyQualifiedName(indexType.symbol, accessExpression);\n                                        errorInfo = ts.chainDiagnosticMessages(/* details */ undefined, ts.Diagnostics.Property_0_does_not_exist_on_type_1, \"[\" + symbolName_2 + \"]\", typeToString(objectType));\n                                    }\n                                    else if (indexType.flags & 128 /* StringLiteral */) {\n                                        errorInfo = ts.chainDiagnosticMessages(/* details */ undefined, ts.Diagnostics.Property_0_does_not_exist_on_type_1, indexType.value, typeToString(objectType));\n                                    }\n                                    else if (indexType.flags & 256 /* NumberLiteral */) {\n                                        errorInfo = ts.chainDiagnosticMessages(/* details */ undefined, ts.Diagnostics.Property_0_does_not_exist_on_type_1, indexType.value, typeToString(objectType));\n                                    }\n                                    else if (indexType.flags & (8 /* Number */ | 4 /* String */)) {\n                                        errorInfo = ts.chainDiagnosticMessages(/* details */ undefined, ts.Diagnostics.No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1, typeToString(indexType), typeToString(objectType));\n                                    }\n                                    errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1, typeToString(fullIndexType), typeToString(objectType));\n                                    diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(accessExpression, errorInfo));\n                                }\n                            }\n                        }\n                    }\n                    return undefined;\n                }\n            }\n            if (isJSLiteralType(objectType)) {\n                return anyType;\n            }\n            if (accessNode) {\n                var indexNode = getIndexNodeForAccessExpression(accessNode);\n                if (indexType.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */)) {\n                    error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, \"\" + indexType.value, typeToString(objectType));\n                }\n                else if (indexType.flags & (4 /* String */ | 8 /* Number */)) {\n                    error(indexNode, ts.Diagnostics.Type_0_has_no_matching_index_signature_for_type_1, typeToString(objectType), typeToString(indexType));\n                }\n                else {\n                    error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));\n                }\n            }\n            if (isTypeAny(indexType)) {\n                return indexType;\n            }\n            return undefined;\n            function errorIfWritingToReadonlyIndex(indexInfo) {\n                if (indexInfo && indexInfo.isReadonly && accessExpression && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) {\n                    error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));\n                }\n            }\n        }\n        function getIndexNodeForAccessExpression(accessNode) {\n            return accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode.argumentExpression :\n                accessNode.kind === 189 /* IndexedAccessType */ ? accessNode.indexType :\n                    accessNode.kind === 158 /* ComputedPropertyName */ ? accessNode.expression :\n                        accessNode;\n        }\n        function isPatternLiteralPlaceholderType(type) {\n            return templateConstraintType.types.indexOf(type) !== -1 || !!(type.flags & 1 /* Any */);\n        }\n        function isPatternLiteralType(type) {\n            return !!(type.flags & 134217728 /* TemplateLiteral */) && ts.every(type.types, isPatternLiteralPlaceholderType);\n        }\n        function isGenericObjectType(type) {\n            if (type.flags & 3145728 /* UnionOrIntersection */) {\n                if (!(type.objectFlags & 4194304 /* IsGenericObjectTypeComputed */)) {\n                    type.objectFlags |= 4194304 /* IsGenericObjectTypeComputed */ |\n                        (ts.some(type.types, isGenericObjectType) ? 8388608 /* IsGenericObjectType */ : 0);\n                }\n                return !!(type.objectFlags & 8388608 /* IsGenericObjectType */);\n            }\n            return !!(type.flags & 58982400 /* InstantiableNonPrimitive */) || isGenericMappedType(type) || isGenericTupleType(type);\n        }\n        function isGenericIndexType(type) {\n            if (type.flags & 3145728 /* UnionOrIntersection */) {\n                if (!(type.objectFlags & 16777216 /* IsGenericIndexTypeComputed */)) {\n                    type.objectFlags |= 16777216 /* IsGenericIndexTypeComputed */ |\n                        (ts.some(type.types, isGenericIndexType) ? 33554432 /* IsGenericIndexType */ : 0);\n                }\n                return !!(type.objectFlags & 33554432 /* IsGenericIndexType */);\n            }\n            return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) && !isPatternLiteralType(type);\n        }\n        function isThisTypeParameter(type) {\n            return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType);\n        }\n        function getSimplifiedType(type, writing) {\n            return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) :\n                type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) :\n                    type;\n        }\n        function distributeIndexOverObjectType(objectType, indexType, writing) {\n            // (T | U)[K] -> T[K] | U[K] (reading)\n            // (T | U)[K] -> T[K] & U[K] (writing)\n            // (T & U)[K] -> T[K] & U[K]\n            if (objectType.flags & 3145728 /* UnionOrIntersection */) {\n                var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });\n                return objectType.flags & 2097152 /* Intersection */ || writing ? getIntersectionType(types) : getUnionType(types);\n            }\n        }\n        function distributeObjectOverIndexType(objectType, indexType, writing) {\n            // T[A | B] -> T[A] | T[B] (reading)\n            // T[A | B] -> T[A] & T[B] (writing)\n            if (indexType.flags & 1048576 /* Union */) {\n                var types = ts.map(indexType.types, function (t) { return getSimplifiedType(getIndexedAccessType(objectType, t), writing); });\n                return writing ? getIntersectionType(types) : getUnionType(types);\n            }\n        }\n        // Transform an indexed access to a simpler form, if possible. Return the simpler form, or return\n        // the type itself if no transformation is possible. The writing flag indicates that the type is\n        // the target of an assignment.\n        function getSimplifiedIndexedAccessType(type, writing) {\n            var cache = writing ? \"simplifiedForWriting\" : \"simplifiedForReading\";\n            if (type[cache]) {\n                return type[cache] === circularConstraintType ? type : type[cache];\n            }\n            type[cache] = circularConstraintType;\n            // We recursively simplify the object type as it may in turn be an indexed access type. For example, with\n            // '{ [P in T]: { [Q in U]: number } }[T][U]' we want to first simplify the inner indexed access type.\n            var objectType = getSimplifiedType(type.objectType, writing);\n            var indexType = getSimplifiedType(type.indexType, writing);\n            // T[A | B] -> T[A] | T[B] (reading)\n            // T[A | B] -> T[A] & T[B] (writing)\n            var distributedOverIndex = distributeObjectOverIndexType(objectType, indexType, writing);\n            if (distributedOverIndex) {\n                return type[cache] = distributedOverIndex;\n            }\n            // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again\n            if (!(indexType.flags & 465829888 /* Instantiable */)) {\n                // (T | U)[K] -> T[K] | U[K] (reading)\n                // (T | U)[K] -> T[K] & U[K] (writing)\n                // (T & U)[K] -> T[K] & U[K]\n                var distributedOverObject = distributeIndexOverObjectType(objectType, indexType, writing);\n                if (distributedOverObject) {\n                    return type[cache] = distributedOverObject;\n                }\n            }\n            // So ultimately (reading):\n            // ((A & B) | C)[K1 | K2] -> ((A & B) | C)[K1] | ((A & B) | C)[K2] -> (A & B)[K1] | C[K1] | (A & B)[K2] | C[K2] -> (A[K1] & B[K1]) | C[K1] | (A[K2] & B[K2]) | C[K2]\n            // A generic tuple type indexed by a number exists only when the index type doesn't select a\n            // fixed element. We simplify to either the combined type of all elements (when the index type\n            // the actual number type) or to the combined type of all non-fixed elements.\n            if (isGenericTupleType(objectType) && indexType.flags & 296 /* NumberLike */) {\n                var elementType = getElementTypeOfSliceOfTupleType(objectType, indexType.flags & 8 /* Number */ ? 0 : objectType.target.fixedLength, /*endSkipCount*/ 0, writing);\n                if (elementType) {\n                    return type[cache] = elementType;\n                }\n            }\n            // If the object type is a mapped type { [P in K]: E }, where K is generic, instantiate E using a mapper\n            // that substitutes the index type for P. For example, for an index access { [P in K]: Box<T[P]> }[X], we\n            // construct the type Box<T[X]>.\n            if (isGenericMappedType(objectType)) {\n                return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), function (t) { return getSimplifiedType(t, writing); });\n            }\n            return type[cache] = type;\n        }\n        function getSimplifiedConditionalType(type, writing) {\n            var checkType = type.checkType;\n            var extendsType = type.extendsType;\n            var trueType = getTrueTypeFromConditionalType(type);\n            var falseType = getFalseTypeFromConditionalType(type);\n            // Simplifications for types of the form `T extends U ? T : never` and `T extends U ? never : T`.\n            if (falseType.flags & 131072 /* Never */ && getActualTypeVariable(trueType) === getActualTypeVariable(checkType)) {\n                if (checkType.flags & 1 /* Any */ || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) { // Always true\n                    return getSimplifiedType(trueType, writing);\n                }\n                else if (isIntersectionEmpty(checkType, extendsType)) { // Always false\n                    return neverType;\n                }\n            }\n            else if (trueType.flags & 131072 /* Never */ && getActualTypeVariable(falseType) === getActualTypeVariable(checkType)) {\n                if (!(checkType.flags & 1 /* Any */) && isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) { // Always true\n                    return neverType;\n                }\n                else if (checkType.flags & 1 /* Any */ || isIntersectionEmpty(checkType, extendsType)) { // Always false\n                    return getSimplifiedType(falseType, writing);\n                }\n            }\n            return type;\n        }\n        /**\n         * Invokes union simplification logic to determine if an intersection is considered empty as a union constituent\n         */\n        function isIntersectionEmpty(type1, type2) {\n            return !!(getUnionType([intersectTypes(type1, type2), neverType]).flags & 131072 /* Never */);\n        }\n        function substituteIndexedMappedType(objectType, index) {\n            var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [index]);\n            var templateMapper = combineTypeMappers(objectType.mapper, mapper);\n            return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper);\n        }\n        function getIndexedAccessType(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, aliasSymbol, aliasTypeArguments, accessFlags) {\n            if (accessFlags === void 0) { accessFlags = 0 /* None */; }\n            return getIndexedAccessTypeOrUndefined(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType);\n        }\n        function indexTypeLessThan(indexType, limit) {\n            return everyType(indexType, function (t) {\n                if (t.flags & 384 /* StringOrNumberLiteral */) {\n                    var propName = getPropertyNameFromType(t);\n                    if (isNumericLiteralName(propName)) {\n                        var index = +propName;\n                        return index >= 0 && index < limit;\n                    }\n                }\n                return false;\n            });\n        }\n        function getIndexedAccessTypeOrUndefined(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) {\n            if (accessFlags === void 0) { accessFlags = 0 /* None */; }\n            if (objectType === wildcardType || indexType === wildcardType) {\n                return wildcardType;\n            }\n            var shouldIncludeUndefined = noUncheckedIndexedAccessCandidate ||\n                (!!compilerOptions.noUncheckedIndexedAccess &&\n                    (accessFlags & (2 /* Writing */ | 16 /* ExpressionPosition */)) === 16 /* ExpressionPosition */);\n            // If the object type has a string index signature and no other members we know that the result will\n            // always be the type of that index signature and we can simplify accordingly.\n            if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {\n                indexType = stringType;\n            }\n            // If the index type is generic, or if the object type is generic and doesn't originate in an expression and\n            // the operation isn't exclusively indexing the fixed (non-variadic) portion of a tuple type, we are performing\n            // a higher-order index access where we cannot meaningfully access the properties of the object type. Note that\n            // for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in an expression. This is to\n            // preserve backwards compatibility. For example, an element access 'this[\"foo\"]' has always been resolved\n            // eagerly using the constraint type of 'this' at the given location.\n            if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 189 /* IndexedAccessType */ ?\n                isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) :\n                isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) {\n                if (objectType.flags & 3 /* AnyOrUnknown */) {\n                    return objectType;\n                }\n                // Defer the operation by creating an indexed access type.\n                var id = objectType.id + \",\" + indexType.id + (shouldIncludeUndefined ? \"?\" : \"\") + getAliasId(aliasSymbol, aliasTypeArguments);\n                var type = indexedAccessTypes.get(id);\n                if (!type) {\n                    indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined));\n                }\n                return type;\n            }\n            // In the following we resolve T[K] to the type of the property in T selected by K.\n            // We treat boolean as different from other unions to improve errors;\n            // skipping straight to getPropertyTypeForIndexType gives errors with 'boolean' instead of 'true'.\n            var apparentObjectType = getReducedApparentType(objectType);\n            if (indexType.flags & 1048576 /* Union */ && !(indexType.flags & 16 /* Boolean */)) {\n                var propTypes = [];\n                var wasMissingProp = false;\n                for (var _i = 0, _a = indexType.types; _i < _a.length; _i++) {\n                    var t = _a[_i];\n                    var propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, wasMissingProp, accessNode, accessFlags, shouldIncludeUndefined);\n                    if (propType) {\n                        propTypes.push(propType);\n                    }\n                    else if (!accessNode) {\n                        // If there's no error node, we can immeditely stop, since error reporting is off\n                        return undefined;\n                    }\n                    else {\n                        // Otherwise we set a flag and return at the end of the loop so we still mark all errors\n                        wasMissingProp = true;\n                    }\n                }\n                if (wasMissingProp) {\n                    return undefined;\n                }\n                return accessFlags & 2 /* Writing */\n                    ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments)\n                    : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments);\n            }\n            return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, /* supressNoImplicitAnyError */ false, accessNode, accessFlags | 4 /* CacheSymbol */, shouldIncludeUndefined, /* reportDeprecated */ true);\n        }\n        function getTypeFromIndexedAccessTypeNode(node) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedType) {\n                var objectType = getTypeFromTypeNode(node.objectType);\n                var indexType = getTypeFromTypeNode(node.indexType);\n                var potentialAlias = getAliasSymbolForTypeNode(node);\n                var resolved = getIndexedAccessType(objectType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias));\n                links.resolvedType = resolved.flags & 8388608 /* IndexedAccess */ &&\n                    resolved.objectType === objectType &&\n                    resolved.indexType === indexType ?\n                    getConditionalFlowTypeOfType(resolved, node) : resolved;\n            }\n            return links.resolvedType;\n        }\n        function getTypeFromMappedTypeNode(node) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedType) {\n                var type = createObjectType(32 /* Mapped */, node.symbol);\n                type.declaration = node;\n                type.aliasSymbol = getAliasSymbolForTypeNode(node);\n                type.aliasTypeArguments = getTypeArgumentsForAliasSymbol(type.aliasSymbol);\n                links.resolvedType = type;\n                // Eagerly resolve the constraint type which forces an error if the constraint type circularly\n                // references itself through one or more type aliases.\n                getConstraintTypeFromMappedType(type);\n            }\n            return links.resolvedType;\n        }\n        function getActualTypeVariable(type) {\n            if (type.flags & 33554432 /* Substitution */) {\n                return type.baseType;\n            }\n            if (type.flags & 8388608 /* IndexedAccess */ && (type.objectType.flags & 33554432 /* Substitution */ ||\n                type.indexType.flags & 33554432 /* Substitution */)) {\n                return getIndexedAccessType(getActualTypeVariable(type.objectType), getActualTypeVariable(type.indexType));\n            }\n            return type;\n        }\n        function isTypicalNondistributiveConditional(root) {\n            return !root.isDistributive\n                && root.node.checkType.kind === 179 /* TupleType */\n                && ts.length(root.node.checkType.elements) === 1\n                && root.node.extendsType.kind === 179 /* TupleType */\n                && ts.length(root.node.extendsType.elements) === 1;\n        }\n        /**\n         * We syntactually check for common nondistributive conditional shapes and unwrap them into\n         * the intended comparison - we do this so we can check if the unwrapped types are generic or\n         * not and appropriately defer condition calculation\n         */\n        function unwrapNondistributiveConditionalTuple(root, type) {\n            return isTypicalNondistributiveConditional(root) && isTupleType(type) ? getTypeArguments(type)[0] : type;\n        }\n        function getConditionalType(root, mapper, aliasSymbol, aliasTypeArguments) {\n            var result;\n            var extraTypes;\n            // We loop here for an immediately nested conditional type in the false position, effectively treating\n            // types of the form 'A extends B ? X : C extends D ? Y : E extends F ? Z : ...' as a single construct for\n            // purposes of resolution. This means such types aren't subject to the instatiation depth limiter.\n            while (true) {\n                var isUnwrapped = isTypicalNondistributiveConditional(root);\n                var checkType = instantiateType(unwrapNondistributiveConditionalTuple(root, root.checkType), mapper);\n                var checkTypeInstantiable = isGenericObjectType(checkType) || isGenericIndexType(checkType);\n                var extendsType = instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), mapper);\n                if (checkType === wildcardType || extendsType === wildcardType) {\n                    return wildcardType;\n                }\n                var combinedMapper = void 0;\n                if (root.inferTypeParameters) {\n                    var context = createInferenceContext(root.inferTypeParameters, /*signature*/ undefined, 0 /* None */);\n                    if (!checkTypeInstantiable) {\n                        // We don't want inferences from constraints as they may cause us to eagerly resolve the\n                        // conditional type instead of deferring resolution. Also, we always want strict function\n                        // types rules (i.e. proper contravariance) for inferences.\n                        inferTypes(context.inferences, checkType, extendsType, 256 /* NoConstraints */ | 512 /* AlwaysStrict */);\n                    }\n                    combinedMapper = mergeTypeMappers(mapper, context.mapper);\n                }\n                // Instantiate the extends type including inferences for 'infer T' type parameters\n                var inferredExtendsType = combinedMapper ? instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), combinedMapper) : extendsType;\n                // We attempt to resolve the conditional type only when the check and extends types are non-generic\n                if (!checkTypeInstantiable && !isGenericObjectType(inferredExtendsType) && !isGenericIndexType(inferredExtendsType)) {\n                    // Return falseType for a definitely false extends check. We check an instantiations of the two\n                    // types with type parameters mapped to the wildcard type, the most permissive instantiations\n                    // possible (the wildcard type is assignable to and from all types). If those are not related,\n                    // then no instantiations will be and we can just return the false branch type.\n                    if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && ((checkType.flags & 1 /* Any */ && !isUnwrapped) || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) {\n                        // Return union of trueType and falseType for 'any' since it matches anything\n                        if (checkType.flags & 1 /* Any */ && !isUnwrapped) {\n                            (extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper));\n                        }\n                        // If falseType is an immediately nested conditional type that isn't distributive or has an\n                        // identical checkType, switch to that type and loop.\n                        var falseType_1 = getTypeFromTypeNode(root.node.falseType);\n                        if (falseType_1.flags & 16777216 /* Conditional */) {\n                            var newRoot = falseType_1.root;\n                            if (newRoot.node.parent === root.node && (!newRoot.isDistributive || newRoot.checkType === root.checkType)) {\n                                root = newRoot;\n                                continue;\n                            }\n                        }\n                        result = instantiateType(falseType_1, mapper);\n                        break;\n                    }\n                    // Return trueType for a definitely true extends check. We check instantiations of the two\n                    // types with type parameters mapped to their restrictive form, i.e. a form of the type parameter\n                    // that has no constraint. This ensures that, for example, the type\n                    //   type Foo<T extends { x: any }> = T extends { x: string } ? string : number\n                    // doesn't immediately resolve to 'string' instead of being deferred.\n                    if (inferredExtendsType.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) {\n                        result = instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper);\n                        break;\n                    }\n                }\n                // Return a deferred type for a check that is neither definitely true nor definitely false\n                result = createType(16777216 /* Conditional */);\n                result.root = root;\n                result.checkType = instantiateType(root.checkType, mapper);\n                result.extendsType = instantiateType(root.extendsType, mapper);\n                result.mapper = mapper;\n                result.combinedMapper = combinedMapper;\n                result.aliasSymbol = aliasSymbol || root.aliasSymbol;\n                result.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(root.aliasTypeArguments, mapper); // TODO: GH#18217\n                break;\n            }\n            return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;\n        }\n        function getTrueTypeFromConditionalType(type) {\n            return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.mapper));\n        }\n        function getFalseTypeFromConditionalType(type) {\n            return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(getTypeFromTypeNode(type.root.node.falseType), type.mapper));\n        }\n        function getInferredTrueTypeFromConditionalType(type) {\n            return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = type.combinedMapper ? instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.combinedMapper) : getTrueTypeFromConditionalType(type));\n        }\n        function getInferTypeParameters(node) {\n            var result;\n            if (node.locals) {\n                node.locals.forEach(function (symbol) {\n                    if (symbol.flags & 262144 /* TypeParameter */) {\n                        result = ts.append(result, getDeclaredTypeOfSymbol(symbol));\n                    }\n                });\n            }\n            return result;\n        }\n        function getTypeFromConditionalTypeNode(node) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedType) {\n                var checkType = getTypeFromTypeNode(node.checkType);\n                var aliasSymbol = getAliasSymbolForTypeNode(node);\n                var aliasTypeArguments = getTypeArgumentsForAliasSymbol(aliasSymbol);\n                var allOuterTypeParameters = getOuterTypeParameters(node, /*includeThisTypes*/ true);\n                var outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : ts.filter(allOuterTypeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, node); });\n                var root = {\n                    node: node,\n                    checkType: checkType,\n                    extendsType: getTypeFromTypeNode(node.extendsType),\n                    isDistributive: !!(checkType.flags & 262144 /* TypeParameter */),\n                    inferTypeParameters: getInferTypeParameters(node),\n                    outerTypeParameters: outerTypeParameters,\n                    instantiations: undefined,\n                    aliasSymbol: aliasSymbol,\n                    aliasTypeArguments: aliasTypeArguments\n                };\n                links.resolvedType = getConditionalType(root, /*mapper*/ undefined);\n                if (outerTypeParameters) {\n                    root.instantiations = new ts.Map();\n                    root.instantiations.set(getTypeListId(outerTypeParameters), links.resolvedType);\n                }\n            }\n            return links.resolvedType;\n        }\n        function getTypeFromInferTypeNode(node) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedType) {\n                links.resolvedType = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter));\n            }\n            return links.resolvedType;\n        }\n        function getIdentifierChain(node) {\n            if (ts.isIdentifier(node)) {\n                return [node];\n            }\n            else {\n                return ts.append(getIdentifierChain(node.left), node.right);\n            }\n        }\n        function getTypeFromImportTypeNode(node) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedType) {\n                if (node.isTypeOf && node.typeArguments) { // Only the non-typeof form can make use of type arguments\n                    error(node, ts.Diagnostics.Type_arguments_cannot_be_used_here);\n                    links.resolvedSymbol = unknownSymbol;\n                    return links.resolvedType = errorType;\n                }\n                if (!ts.isLiteralImportTypeNode(node)) {\n                    error(node.argument, ts.Diagnostics.String_literal_expected);\n                    links.resolvedSymbol = unknownSymbol;\n                    return links.resolvedType = errorType;\n                }\n                var targetMeaning = node.isTypeOf ? 111551 /* Value */ : node.flags & 4194304 /* JSDoc */ ? 111551 /* Value */ | 788968 /* Type */ : 788968 /* Type */;\n                // TODO: Future work: support unions/generics/whatever via a deferred import-type\n                var innerModuleSymbol = resolveExternalModuleName(node, node.argument.literal);\n                if (!innerModuleSymbol) {\n                    links.resolvedSymbol = unknownSymbol;\n                    return links.resolvedType = errorType;\n                }\n                var moduleSymbol = resolveExternalModuleSymbol(innerModuleSymbol, /*dontResolveAlias*/ false);\n                if (!ts.nodeIsMissing(node.qualifier)) {\n                    var nameStack = getIdentifierChain(node.qualifier);\n                    var currentNamespace = moduleSymbol;\n                    var current = void 0;\n                    while (current = nameStack.shift()) {\n                        var meaning = nameStack.length ? 1920 /* Namespace */ : targetMeaning;\n                        // typeof a.b.c is normally resolved using `checkExpression` which in turn defers to `checkQualifiedName`\n                        // That, in turn, ultimately uses `getPropertyOfType` on the type of the symbol, which differs slightly from\n                        // the `exports` lookup process that only looks up namespace members which is used for most type references\n                        var mergedResolvedSymbol = getMergedSymbol(resolveSymbol(currentNamespace));\n                        var next = node.isTypeOf\n                            ? getPropertyOfType(getTypeOfSymbol(mergedResolvedSymbol), current.escapedText)\n                            : getSymbol(getExportsOfSymbol(mergedResolvedSymbol), current.escapedText, meaning);\n                        if (!next) {\n                            error(current, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(currentNamespace), ts.declarationNameToString(current));\n                            return links.resolvedType = errorType;\n                        }\n                        getNodeLinks(current).resolvedSymbol = next;\n                        getNodeLinks(current.parent).resolvedSymbol = next;\n                        currentNamespace = next;\n                    }\n                    links.resolvedType = resolveImportSymbolType(node, links, currentNamespace, targetMeaning);\n                }\n                else {\n                    if (moduleSymbol.flags & targetMeaning) {\n                        links.resolvedType = resolveImportSymbolType(node, links, moduleSymbol, targetMeaning);\n                    }\n                    else {\n                        var errorMessage = targetMeaning === 111551 /* Value */\n                            ? ts.Diagnostics.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here\n                            : ts.Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0;\n                        error(node, errorMessage, node.argument.literal.text);\n                        links.resolvedSymbol = unknownSymbol;\n                        links.resolvedType = errorType;\n                    }\n                }\n            }\n            return links.resolvedType;\n        }\n        function resolveImportSymbolType(node, links, symbol, meaning) {\n            var resolvedSymbol = resolveSymbol(symbol);\n            links.resolvedSymbol = resolvedSymbol;\n            if (meaning === 111551 /* Value */) {\n                return getTypeOfSymbol(symbol); // intentionally doesn't use resolved symbol so type is cached as expected on the alias\n            }\n            else {\n                return getTypeReferenceType(node, resolvedSymbol); // getTypeReferenceType doesn't handle aliases - it must get the resolved symbol\n            }\n        }\n        function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedType) {\n                // Deferred resolution of members is handled by resolveObjectTypeMembers\n                var aliasSymbol = getAliasSymbolForTypeNode(node);\n                if (getMembersOfSymbol(node.symbol).size === 0 && !aliasSymbol) {\n                    links.resolvedType = emptyTypeLiteralType;\n                }\n                else {\n                    var type = createObjectType(16 /* Anonymous */, node.symbol);\n                    type.aliasSymbol = aliasSymbol;\n                    type.aliasTypeArguments = getTypeArgumentsForAliasSymbol(aliasSymbol);\n                    if (ts.isJSDocTypeLiteral(node) && node.isArrayType) {\n                        type = createArrayType(type);\n                    }\n                    links.resolvedType = type;\n                }\n            }\n            return links.resolvedType;\n        }\n        function getAliasSymbolForTypeNode(node) {\n            var host = node.parent;\n            while (ts.isParenthesizedTypeNode(host) || ts.isJSDocTypeExpression(host) || ts.isTypeOperatorNode(host) && host.operator === 142 /* ReadonlyKeyword */) {\n                host = host.parent;\n            }\n            return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined;\n        }\n        function getTypeArgumentsForAliasSymbol(symbol) {\n            return symbol ? getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) : undefined;\n        }\n        function isNonGenericObjectType(type) {\n            return !!(type.flags & 524288 /* Object */) && !isGenericMappedType(type);\n        }\n        function isEmptyObjectTypeOrSpreadsIntoEmptyObject(type) {\n            return isEmptyObjectType(type) || !!(type.flags & (65536 /* Null */ | 32768 /* Undefined */ | 528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */));\n        }\n        function tryMergeUnionOfObjectTypeAndEmptyObject(type, readonly) {\n            if (ts.every(type.types, isEmptyObjectTypeOrSpreadsIntoEmptyObject)) {\n                return ts.find(type.types, isEmptyObjectType) || emptyObjectType;\n            }\n            var firstType = ts.find(type.types, function (t) { return !isEmptyObjectTypeOrSpreadsIntoEmptyObject(t); });\n            if (!firstType) {\n                return undefined;\n            }\n            var secondType = firstType && ts.find(type.types, function (t) { return t !== firstType && !isEmptyObjectTypeOrSpreadsIntoEmptyObject(t); });\n            if (secondType) {\n                return undefined;\n            }\n            return getAnonymousPartialType(firstType);\n            function getAnonymousPartialType(type) {\n                // gets the type as if it had been spread, but where everything in the spread is made optional\n                var members = ts.createSymbolTable();\n                for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) {\n                    var prop = _a[_i];\n                    if (ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 /* Private */ | 16 /* Protected */)) {\n                        // do nothing, skip privates\n                    }\n                    else if (isSpreadableProperty(prop)) {\n                        var isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);\n                        var flags = 4 /* Property */ | 16777216 /* Optional */;\n                        var result = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 /* Readonly */ : 0));\n                        result.type = isSetonlyAccessor ? undefinedType : getUnionType([getTypeOfSymbol(prop), undefinedType]);\n                        result.declarations = prop.declarations;\n                        result.nameType = getSymbolLinks(prop).nameType;\n                        result.syntheticOrigin = prop;\n                        members.set(prop.escapedName, result);\n                    }\n                }\n                var spread = createAnonymousType(type.symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfoOfType(type, 0 /* String */), getIndexInfoOfType(type, 1 /* Number */));\n                spread.objectFlags |= 128 /* ObjectLiteral */ | 1048576 /* ContainsObjectOrArrayLiteral */;\n                return spread;\n            }\n        }\n        /**\n         * Since the source of spread types are object literals, which are not binary,\n         * this function should be called in a left folding style, with left = previous result of getSpreadType\n         * and right = the new element to be spread.\n         */\n        function getSpreadType(left, right, symbol, objectFlags, readonly) {\n            if (left.flags & 1 /* Any */ || right.flags & 1 /* Any */) {\n                return anyType;\n            }\n            if (left.flags & 2 /* Unknown */ || right.flags & 2 /* Unknown */) {\n                return unknownType;\n            }\n            if (left.flags & 131072 /* Never */) {\n                return right;\n            }\n            if (right.flags & 131072 /* Never */) {\n                return left;\n            }\n            if (left.flags & 1048576 /* Union */) {\n                var merged = tryMergeUnionOfObjectTypeAndEmptyObject(left, readonly);\n                if (merged) {\n                    return getSpreadType(merged, right, symbol, objectFlags, readonly);\n                }\n                return checkCrossProductUnion([left, right])\n                    ? mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); })\n                    : errorType;\n            }\n            if (right.flags & 1048576 /* Union */) {\n                var merged = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly);\n                if (merged) {\n                    return getSpreadType(left, merged, symbol, objectFlags, readonly);\n                }\n                return checkCrossProductUnion([left, right])\n                    ? mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); })\n                    : errorType;\n            }\n            if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) {\n                return left;\n            }\n            if (isGenericObjectType(left) || isGenericObjectType(right)) {\n                if (isEmptyObjectType(left)) {\n                    return right;\n                }\n                // When the left type is an intersection, we may need to merge the last constituent of the\n                // intersection with the right type. For example when the left type is 'T & { a: string }'\n                // and the right type is '{ b: string }' we produce 'T & { a: string, b: string }'.\n                if (left.flags & 2097152 /* Intersection */) {\n                    var types = left.types;\n                    var lastLeft = types[types.length - 1];\n                    if (isNonGenericObjectType(lastLeft) && isNonGenericObjectType(right)) {\n                        return getIntersectionType(ts.concatenate(types.slice(0, types.length - 1), [getSpreadType(lastLeft, right, symbol, objectFlags, readonly)]));\n                    }\n                }\n                return getIntersectionType([left, right]);\n            }\n            var members = ts.createSymbolTable();\n            var skippedPrivateMembers = new ts.Set();\n            var stringIndexInfo;\n            var numberIndexInfo;\n            if (left === emptyObjectType) {\n                // for the first spread element, left === emptyObjectType, so take the right's string indexer\n                stringIndexInfo = getIndexInfoOfType(right, 0 /* String */);\n                numberIndexInfo = getIndexInfoOfType(right, 1 /* Number */);\n            }\n            else {\n                stringIndexInfo = unionSpreadIndexInfos(getIndexInfoOfType(left, 0 /* String */), getIndexInfoOfType(right, 0 /* String */));\n                numberIndexInfo = unionSpreadIndexInfos(getIndexInfoOfType(left, 1 /* Number */), getIndexInfoOfType(right, 1 /* Number */));\n            }\n            for (var _i = 0, _a = getPropertiesOfType(right); _i < _a.length; _i++) {\n                var rightProp = _a[_i];\n                if (ts.getDeclarationModifierFlagsFromSymbol(rightProp) & (8 /* Private */ | 16 /* Protected */)) {\n                    skippedPrivateMembers.add(rightProp.escapedName);\n                }\n                else if (isSpreadableProperty(rightProp)) {\n                    members.set(rightProp.escapedName, getSpreadSymbol(rightProp, readonly));\n                }\n            }\n            for (var _b = 0, _c = getPropertiesOfType(left); _b < _c.length; _b++) {\n                var leftProp = _c[_b];\n                if (skippedPrivateMembers.has(leftProp.escapedName) || !isSpreadableProperty(leftProp)) {\n                    continue;\n                }\n                if (members.has(leftProp.escapedName)) {\n                    var rightProp = members.get(leftProp.escapedName);\n                    var rightType = getTypeOfSymbol(rightProp);\n                    if (rightProp.flags & 16777216 /* Optional */) {\n                        var declarations = ts.concatenate(leftProp.declarations, rightProp.declarations);\n                        var flags = 4 /* Property */ | (leftProp.flags & 16777216 /* Optional */);\n                        var result = createSymbol(flags, leftProp.escapedName);\n                        result.type = getUnionType([getTypeOfSymbol(leftProp), getTypeWithFacts(rightType, 524288 /* NEUndefined */)]);\n                        result.leftSpread = leftProp;\n                        result.rightSpread = rightProp;\n                        result.declarations = declarations;\n                        result.nameType = getSymbolLinks(leftProp).nameType;\n                        members.set(leftProp.escapedName, result);\n                    }\n                }\n                else {\n                    members.set(leftProp.escapedName, getSpreadSymbol(leftProp, readonly));\n                }\n            }\n            var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfoWithReadonly(stringIndexInfo, readonly), getIndexInfoWithReadonly(numberIndexInfo, readonly));\n            spread.objectFlags |= 128 /* ObjectLiteral */ | 1048576 /* ContainsObjectOrArrayLiteral */ | 1024 /* ContainsSpread */ | objectFlags;\n            return spread;\n        }\n        /** We approximate own properties as non-methods plus methods that are inside the object literal */\n        function isSpreadableProperty(prop) {\n            return !ts.some(prop.declarations, ts.isPrivateIdentifierPropertyDeclaration) &&\n                (!(prop.flags & (8192 /* Method */ | 32768 /* GetAccessor */ | 65536 /* SetAccessor */)) ||\n                    !prop.declarations.some(function (decl) { return ts.isClassLike(decl.parent); }));\n        }\n        function getSpreadSymbol(prop, readonly) {\n            var isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);\n            if (!isSetonlyAccessor && readonly === isReadonlySymbol(prop)) {\n                return prop;\n            }\n            var flags = 4 /* Property */ | (prop.flags & 16777216 /* Optional */);\n            var result = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 /* Readonly */ : 0));\n            result.type = isSetonlyAccessor ? undefinedType : getTypeOfSymbol(prop);\n            result.declarations = prop.declarations;\n            result.nameType = getSymbolLinks(prop).nameType;\n            result.syntheticOrigin = prop;\n            return result;\n        }\n        function getIndexInfoWithReadonly(info, readonly) {\n            return info && info.isReadonly !== readonly ? createIndexInfo(info.type, readonly, info.declaration) : info;\n        }\n        function createLiteralType(flags, value, symbol) {\n            var type = createType(flags);\n            type.symbol = symbol;\n            type.value = value;\n            return type;\n        }\n        function getFreshTypeOfLiteralType(type) {\n            if (type.flags & 2944 /* Literal */) {\n                if (!type.freshType) {\n                    var freshType = createLiteralType(type.flags, type.value, type.symbol);\n                    freshType.regularType = type;\n                    freshType.freshType = freshType;\n                    type.freshType = freshType;\n                }\n                return type.freshType;\n            }\n            return type;\n        }\n        function getRegularTypeOfLiteralType(type) {\n            return type.flags & 2944 /* Literal */ ? type.regularType :\n                type.flags & 1048576 /* Union */ ? (type.regularType || (type.regularType = mapType(type, getRegularTypeOfLiteralType))) :\n                    type;\n        }\n        function isFreshLiteralType(type) {\n            return !!(type.flags & 2944 /* Literal */) && type.freshType === type;\n        }\n        function getLiteralType(value, enumId, symbol) {\n            // We store all literal types in a single map with keys of the form '#NNN' and '@SSS',\n            // where NNN is the text representation of a numeric literal and SSS are the characters\n            // of a string literal. For literal enum members we use 'EEE#NNN' and 'EEE@SSS', where\n            // EEE is a unique id for the containing enum type.\n            var qualifier = typeof value === \"number\" ? \"#\" : typeof value === \"string\" ? \"@\" : \"n\";\n            var key = (enumId ? enumId : \"\") + qualifier + (typeof value === \"object\" ? ts.pseudoBigIntToString(value) : value);\n            var type = literalTypes.get(key);\n            if (!type) {\n                var flags = (typeof value === \"number\" ? 256 /* NumberLiteral */ :\n                    typeof value === \"string\" ? 128 /* StringLiteral */ : 2048 /* BigIntLiteral */) |\n                    (enumId ? 1024 /* EnumLiteral */ : 0);\n                literalTypes.set(key, type = createLiteralType(flags, value, symbol));\n                type.regularType = type;\n            }\n            return type;\n        }\n        function getTypeFromLiteralTypeNode(node) {\n            if (node.literal.kind === 103 /* NullKeyword */) {\n                return nullType;\n            }\n            var links = getNodeLinks(node);\n            if (!links.resolvedType) {\n                links.resolvedType = getRegularTypeOfLiteralType(checkExpression(node.literal));\n            }\n            return links.resolvedType;\n        }\n        function createUniqueESSymbolType(symbol) {\n            var type = createType(8192 /* UniqueESSymbol */);\n            type.symbol = symbol;\n            type.escapedName = \"__@\" + type.symbol.escapedName + \"@\" + getSymbolId(type.symbol);\n            return type;\n        }\n        function getESSymbolLikeTypeForNode(node) {\n            if (ts.isValidESSymbolDeclaration(node)) {\n                var symbol = getSymbolOfNode(node);\n                var links = getSymbolLinks(symbol);\n                return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol));\n            }\n            return esSymbolType;\n        }\n        function getThisType(node) {\n            var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false);\n            var parent = container && container.parent;\n            if (parent && (ts.isClassLike(parent) || parent.kind === 253 /* InterfaceDeclaration */)) {\n                if (!ts.hasSyntacticModifier(container, 32 /* Static */) &&\n                    (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) {\n                    return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType;\n                }\n            }\n            // inside x.prototype = { ... }\n            if (parent && ts.isObjectLiteralExpression(parent) && ts.isBinaryExpression(parent.parent) && ts.getAssignmentDeclarationKind(parent.parent) === 6 /* Prototype */) {\n                return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent.parent.left).parent).thisType;\n            }\n            // /** @return {this} */\n            // x.prototype.m = function() { ... }\n            var host = node.flags & 4194304 /* JSDoc */ ? ts.getHostSignatureFromJSDoc(node) : undefined;\n            if (host && ts.isFunctionExpression(host) && ts.isBinaryExpression(host.parent) && ts.getAssignmentDeclarationKind(host.parent) === 3 /* PrototypeProperty */) {\n                return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(host.parent.left).parent).thisType;\n            }\n            // inside constructor function C() { ... }\n            if (isJSConstructor(container) && ts.isNodeDescendantOf(node, container.body)) {\n                return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(container)).thisType;\n            }\n            error(node, ts.Diagnostics.A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface);\n            return errorType;\n        }\n        function getTypeFromThisTypeNode(node) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedType) {\n                links.resolvedType = getThisType(node);\n            }\n            return links.resolvedType;\n        }\n        function getTypeFromRestTypeNode(node) {\n            return getTypeFromTypeNode(getArrayElementTypeNode(node.type) || node.type);\n        }\n        function getArrayElementTypeNode(node) {\n            switch (node.kind) {\n                case 186 /* ParenthesizedType */:\n                    return getArrayElementTypeNode(node.type);\n                case 179 /* TupleType */:\n                    if (node.elements.length === 1) {\n                        node = node.elements[0];\n                        if (node.kind === 181 /* RestType */ || node.kind === 192 /* NamedTupleMember */ && node.dotDotDotToken) {\n                            return getArrayElementTypeNode(node.type);\n                        }\n                    }\n                    break;\n                case 178 /* ArrayType */:\n                    return node.elementType;\n            }\n            return undefined;\n        }\n        function getTypeFromNamedTupleTypeNode(node) {\n            var links = getNodeLinks(node);\n            return links.resolvedType || (links.resolvedType =\n                node.dotDotDotToken ? getTypeFromRestTypeNode(node) :\n                    node.questionToken && strictNullChecks ? getOptionalType(getTypeFromTypeNode(node.type)) :\n                        getTypeFromTypeNode(node.type));\n        }\n        function getTypeFromTypeNode(node) {\n            return getConditionalFlowTypeOfType(getTypeFromTypeNodeWorker(node), node);\n        }\n        function getTypeFromTypeNodeWorker(node) {\n            switch (node.kind) {\n                case 128 /* AnyKeyword */:\n                case 303 /* JSDocAllType */:\n                case 304 /* JSDocUnknownType */:\n                    return anyType;\n                case 152 /* UnknownKeyword */:\n                    return unknownType;\n                case 147 /* StringKeyword */:\n                    return stringType;\n                case 144 /* NumberKeyword */:\n                    return numberType;\n                case 155 /* BigIntKeyword */:\n                    return bigintType;\n                case 131 /* BooleanKeyword */:\n                    return booleanType;\n                case 148 /* SymbolKeyword */:\n                    return esSymbolType;\n                case 113 /* VoidKeyword */:\n                    return voidType;\n                case 150 /* UndefinedKeyword */:\n                    return undefinedType;\n                case 103 /* NullKeyword */:\n                    // TODO(rbuckton): `NullKeyword` is no longer a `TypeNode`, but we defensively allow it here because of incorrect casts in the Language Service.\n                    return nullType;\n                case 141 /* NeverKeyword */:\n                    return neverType;\n                case 145 /* ObjectKeyword */:\n                    return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType;\n                case 136 /* IntrinsicKeyword */:\n                    return intrinsicMarkerType;\n                case 187 /* ThisType */:\n                case 107 /* ThisKeyword */:\n                    // TODO(rbuckton): `ThisKeyword` is no longer a `TypeNode`, but we defensively allow it here because of incorrect casts in the Language Service and because of `isPartOfTypeNode`.\n                    return getTypeFromThisTypeNode(node);\n                case 191 /* LiteralType */:\n                    return getTypeFromLiteralTypeNode(node);\n                case 173 /* TypeReference */:\n                    return getTypeFromTypeReference(node);\n                case 172 /* TypePredicate */:\n                    return node.assertsModifier ? voidType : booleanType;\n                case 223 /* ExpressionWithTypeArguments */:\n                    return getTypeFromTypeReference(node);\n                case 176 /* TypeQuery */:\n                    return getTypeFromTypeQueryNode(node);\n                case 178 /* ArrayType */:\n                case 179 /* TupleType */:\n                    return getTypeFromArrayOrTupleTypeNode(node);\n                case 180 /* OptionalType */:\n                    return getTypeFromOptionalTypeNode(node);\n                case 182 /* UnionType */:\n                    return getTypeFromUnionTypeNode(node);\n                case 183 /* IntersectionType */:\n                    return getTypeFromIntersectionTypeNode(node);\n                case 305 /* JSDocNullableType */:\n                    return getTypeFromJSDocNullableTypeNode(node);\n                case 307 /* JSDocOptionalType */:\n                    return addOptionality(getTypeFromTypeNode(node.type));\n                case 192 /* NamedTupleMember */:\n                    return getTypeFromNamedTupleTypeNode(node);\n                case 186 /* ParenthesizedType */:\n                case 306 /* JSDocNonNullableType */:\n                case 301 /* JSDocTypeExpression */:\n                    return getTypeFromTypeNode(node.type);\n                case 181 /* RestType */:\n                    return getTypeFromRestTypeNode(node);\n                case 309 /* JSDocVariadicType */:\n                    return getTypeFromJSDocVariadicType(node);\n                case 174 /* FunctionType */:\n                case 175 /* ConstructorType */:\n                case 177 /* TypeLiteral */:\n                case 312 /* JSDocTypeLiteral */:\n                case 308 /* JSDocFunctionType */:\n                case 313 /* JSDocSignature */:\n                    return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);\n                case 188 /* TypeOperator */:\n                    return getTypeFromTypeOperatorNode(node);\n                case 189 /* IndexedAccessType */:\n                    return getTypeFromIndexedAccessTypeNode(node);\n                case 190 /* MappedType */:\n                    return getTypeFromMappedTypeNode(node);\n                case 184 /* ConditionalType */:\n                    return getTypeFromConditionalTypeNode(node);\n                case 185 /* InferType */:\n                    return getTypeFromInferTypeNode(node);\n                case 193 /* TemplateLiteralType */:\n                    return getTypeFromTemplateTypeNode(node);\n                case 195 /* ImportType */:\n                    return getTypeFromImportTypeNode(node);\n                // This function assumes that an identifier, qualified name, or property access expression is a type expression\n                // Callers should first ensure this by calling `isPartOfTypeNode`\n                // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s.\n                case 78 /* Identifier */:\n                case 157 /* QualifiedName */:\n                case 201 /* PropertyAccessExpression */:\n                    var symbol = getSymbolAtLocation(node);\n                    return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType;\n                default:\n                    return errorType;\n            }\n        }\n        function instantiateList(items, mapper, instantiator) {\n            if (items && items.length) {\n                for (var i = 0; i < items.length; i++) {\n                    var item = items[i];\n                    var mapped = instantiator(item, mapper);\n                    if (item !== mapped) {\n                        var result = i === 0 ? [] : items.slice(0, i);\n                        result.push(mapped);\n                        for (i++; i < items.length; i++) {\n                            result.push(instantiator(items[i], mapper));\n                        }\n                        return result;\n                    }\n                }\n            }\n            return items;\n        }\n        function instantiateTypes(types, mapper) {\n            return instantiateList(types, mapper, instantiateType);\n        }\n        function instantiateSignatures(signatures, mapper) {\n            return instantiateList(signatures, mapper, instantiateSignature);\n        }\n        function createTypeMapper(sources, targets) {\n            return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) : makeArrayTypeMapper(sources, targets);\n        }\n        function getMappedType(type, mapper) {\n            switch (mapper.kind) {\n                case 0 /* Simple */:\n                    return type === mapper.source ? mapper.target : type;\n                case 1 /* Array */:\n                    var sources = mapper.sources;\n                    var targets = mapper.targets;\n                    for (var i = 0; i < sources.length; i++) {\n                        if (type === sources[i]) {\n                            return targets ? targets[i] : anyType;\n                        }\n                    }\n                    return type;\n                case 2 /* Function */:\n                    return mapper.func(type);\n                case 3 /* Composite */:\n                case 4 /* Merged */:\n                    var t1 = getMappedType(type, mapper.mapper1);\n                    return t1 !== type && mapper.kind === 3 /* Composite */ ? instantiateType(t1, mapper.mapper2) : getMappedType(t1, mapper.mapper2);\n            }\n        }\n        function makeUnaryTypeMapper(source, target) {\n            return { kind: 0 /* Simple */, source: source, target: target };\n        }\n        function makeArrayTypeMapper(sources, targets) {\n            return { kind: 1 /* Array */, sources: sources, targets: targets };\n        }\n        function makeFunctionTypeMapper(func) {\n            return { kind: 2 /* Function */, func: func };\n        }\n        function makeCompositeTypeMapper(kind, mapper1, mapper2) {\n            return { kind: kind, mapper1: mapper1, mapper2: mapper2 };\n        }\n        function createTypeEraser(sources) {\n            return createTypeMapper(sources, /*targets*/ undefined);\n        }\n        /**\n         * Maps forward-references to later types parameters to the empty object type.\n         * This is used during inference when instantiating type parameter defaults.\n         */\n        function createBackreferenceMapper(context, index) {\n            return makeFunctionTypeMapper(function (t) { return ts.findIndex(context.inferences, function (info) { return info.typeParameter === t; }) >= index ? unknownType : t; });\n        }\n        function combineTypeMappers(mapper1, mapper2) {\n            return mapper1 ? makeCompositeTypeMapper(3 /* Composite */, mapper1, mapper2) : mapper2;\n        }\n        function mergeTypeMappers(mapper1, mapper2) {\n            return mapper1 ? makeCompositeTypeMapper(4 /* Merged */, mapper1, mapper2) : mapper2;\n        }\n        function prependTypeMapping(source, target, mapper) {\n            return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(4 /* Merged */, makeUnaryTypeMapper(source, target), mapper);\n        }\n        function appendTypeMapping(mapper, source, target) {\n            return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(4 /* Merged */, mapper, makeUnaryTypeMapper(source, target));\n        }\n        function getRestrictiveTypeParameter(tp) {\n            return tp.constraint === unknownType ? tp : tp.restrictiveInstantiation || (tp.restrictiveInstantiation = createTypeParameter(tp.symbol),\n                tp.restrictiveInstantiation.constraint = unknownType,\n                tp.restrictiveInstantiation);\n        }\n        function cloneTypeParameter(typeParameter) {\n            var result = createTypeParameter(typeParameter.symbol);\n            result.target = typeParameter;\n            return result;\n        }\n        function instantiateTypePredicate(predicate, mapper) {\n            return createTypePredicate(predicate.kind, predicate.parameterName, predicate.parameterIndex, instantiateType(predicate.type, mapper));\n        }\n        function instantiateSignature(signature, mapper, eraseTypeParameters) {\n            var freshTypeParameters;\n            if (signature.typeParameters && !eraseTypeParameters) {\n                // First create a fresh set of type parameters, then include a mapping from the old to the\n                // new type parameters in the mapper function. Finally store this mapper in the new type\n                // parameters such that we can use it when instantiating constraints.\n                freshTypeParameters = ts.map(signature.typeParameters, cloneTypeParameter);\n                mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper);\n                for (var _i = 0, freshTypeParameters_1 = freshTypeParameters; _i < freshTypeParameters_1.length; _i++) {\n                    var tp = freshTypeParameters_1[_i];\n                    tp.mapper = mapper;\n                }\n            }\n            // Don't compute resolvedReturnType and resolvedTypePredicate now,\n            // because using `mapper` now could trigger inferences to become fixed. (See `createInferenceContext`.)\n            // See GH#17600.\n            var result = createSignature(signature.declaration, freshTypeParameters, signature.thisParameter && instantiateSymbol(signature.thisParameter, mapper), instantiateList(signature.parameters, mapper, instantiateSymbol), \n            /*resolvedReturnType*/ undefined, \n            /*resolvedTypePredicate*/ undefined, signature.minArgumentCount, signature.flags & 39 /* PropagatingFlags */);\n            result.target = signature;\n            result.mapper = mapper;\n            return result;\n        }\n        function instantiateSymbol(symbol, mapper) {\n            var links = getSymbolLinks(symbol);\n            if (links.type && !couldContainTypeVariables(links.type)) {\n                // If the type of the symbol is already resolved, and if that type could not possibly\n                // be affected by instantiation, simply return the symbol itself.\n                return symbol;\n            }\n            if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) {\n                // If symbol being instantiated is itself a instantiation, fetch the original target and combine the\n                // type mappers. This ensures that original type identities are properly preserved and that aliases\n                // always reference a non-aliases.\n                symbol = links.target;\n                mapper = combineTypeMappers(links.mapper, mapper);\n            }\n            // Keep the flags from the symbol we're instantiating.  Mark that is instantiated, and\n            // also transient so that we can just store data on it directly.\n            var result = createSymbol(symbol.flags, symbol.escapedName, 1 /* Instantiated */ | ts.getCheckFlags(symbol) & (8 /* Readonly */ | 4096 /* Late */ | 16384 /* OptionalParameter */ | 32768 /* RestParameter */));\n            result.declarations = symbol.declarations;\n            result.parent = symbol.parent;\n            result.target = symbol;\n            result.mapper = mapper;\n            if (symbol.valueDeclaration) {\n                result.valueDeclaration = symbol.valueDeclaration;\n            }\n            if (links.nameType) {\n                result.nameType = links.nameType;\n            }\n            return result;\n        }\n        function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {\n            var declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.symbol.declarations[0];\n            var links = getNodeLinks(declaration);\n            var target = type.objectFlags & 4 /* Reference */ ? links.resolvedType :\n                type.objectFlags & 64 /* Instantiated */ ? type.target : type;\n            var typeParameters = links.outerTypeParameters;\n            if (!typeParameters) {\n                // The first time an anonymous type is instantiated we compute and store a list of the type\n                // parameters that are in scope (and therefore potentially referenced). For type literals that\n                // aren't the right hand side of a generic type alias declaration we optimize by reducing the\n                // set of type parameters to those that are possibly referenced in the literal.\n                var outerTypeParameters = getOuterTypeParameters(declaration, /*includeThisTypes*/ true);\n                if (isJSConstructor(declaration)) {\n                    var templateTagParameters = getTypeParametersFromDeclaration(declaration);\n                    outerTypeParameters = ts.addRange(outerTypeParameters, templateTagParameters);\n                }\n                typeParameters = outerTypeParameters || ts.emptyArray;\n                typeParameters = (target.objectFlags & 4 /* Reference */ || target.symbol.flags & 2048 /* TypeLiteral */) && !target.aliasTypeArguments ?\n                    ts.filter(typeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, declaration); }) :\n                    typeParameters;\n                links.outerTypeParameters = typeParameters;\n            }\n            if (typeParameters.length) {\n                // We are instantiating an anonymous type that has one or more type parameters in scope. Apply the\n                // mapper to the type parameters to produce the effective list of type arguments, and compute the\n                // instantiation cache key from the type IDs of the type arguments.\n                var combinedMapper_1 = combineTypeMappers(type.mapper, mapper);\n                var typeArguments = ts.map(typeParameters, function (t) { return getMappedType(t, combinedMapper_1); });\n                var newAliasSymbol = aliasSymbol || type.aliasSymbol;\n                var newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper);\n                var id = getTypeListId(typeArguments) + getAliasId(newAliasSymbol, newAliasTypeArguments);\n                if (!target.instantiations) {\n                    target.instantiations = new ts.Map();\n                    target.instantiations.set(getTypeListId(typeParameters) + getAliasId(target.aliasSymbol, target.aliasTypeArguments), target);\n                }\n                var result = target.instantiations.get(id);\n                if (!result) {\n                    var newMapper = createTypeMapper(typeParameters, typeArguments);\n                    result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) :\n                        target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) :\n                            instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);\n                    target.instantiations.set(id, result);\n                }\n                return result;\n            }\n            return type;\n        }\n        function maybeTypeParameterReference(node) {\n            return !(node.kind === 157 /* QualifiedName */ ||\n                node.parent.kind === 173 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName ||\n                node.parent.kind === 195 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier);\n        }\n        function isTypeParameterPossiblyReferenced(tp, node) {\n            // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks\n            // between the node and the type parameter declaration, if the node contains actual references to the\n            // type parameter, or if the node contains type queries, we consider the type parameter possibly referenced.\n            if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) {\n                var container = tp.symbol.declarations[0].parent;\n                for (var n = node; n !== container; n = n.parent) {\n                    if (!n || n.kind === 230 /* Block */ || n.kind === 184 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) {\n                        return true;\n                    }\n                }\n                return !!ts.forEachChild(node, containsReference);\n            }\n            return true;\n            function containsReference(node) {\n                switch (node.kind) {\n                    case 187 /* ThisType */:\n                        return !!tp.isThisType;\n                    case 78 /* Identifier */:\n                        return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) &&\n                            getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality\n                    case 176 /* TypeQuery */:\n                        return true;\n                }\n                return !!ts.forEachChild(node, containsReference);\n            }\n        }\n        function getHomomorphicTypeVariable(type) {\n            var constraintType = getConstraintTypeFromMappedType(type);\n            if (constraintType.flags & 4194304 /* Index */) {\n                var typeVariable = getActualTypeVariable(constraintType.type);\n                if (typeVariable.flags & 262144 /* TypeParameter */) {\n                    return typeVariable;\n                }\n            }\n            return undefined;\n        }\n        function instantiateMappedType(type, mapper, aliasSymbol, aliasTypeArguments) {\n            // For a homomorphic mapped type { [P in keyof T]: X }, where T is some type variable, the mapping\n            // operation depends on T as follows:\n            // * If T is a primitive type no mapping is performed and the result is simply T.\n            // * If T is a union type we distribute the mapped type over the union.\n            // * If T is an array we map to an array where the element type has been transformed.\n            // * If T is a tuple we map to a tuple where the element types have been transformed.\n            // * Otherwise we map to an object type where the type of each property has been transformed.\n            // For example, when T is instantiated to a union type A | B, we produce { [P in keyof A]: X } |\n            // { [P in keyof B]: X }, and when when T is instantiated to a union type A | undefined, we produce\n            // { [P in keyof A]: X } | undefined.\n            var typeVariable = getHomomorphicTypeVariable(type);\n            if (typeVariable) {\n                var mappedTypeVariable = instantiateType(typeVariable, mapper);\n                if (typeVariable !== mappedTypeVariable) {\n                    return mapTypeWithAlias(getReducedType(mappedTypeVariable), function (t) {\n                        if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) {\n                            if (!type.declaration.nameType) {\n                                if (isArrayType(t)) {\n                                    return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));\n                                }\n                                if (isGenericTupleType(t)) {\n                                    return instantiateMappedGenericTupleType(t, type, typeVariable, mapper);\n                                }\n                                if (isTupleType(t)) {\n                                    return instantiateMappedTupleType(t, type, prependTypeMapping(typeVariable, t, mapper));\n                                }\n                            }\n                            return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t, mapper));\n                        }\n                        return t;\n                    }, aliasSymbol, aliasTypeArguments);\n                }\n            }\n            // If the constraint type of the instantiation is the wildcard type, return the wildcard type.\n            return instantiateType(getConstraintTypeFromMappedType(type), mapper) === wildcardType ? wildcardType : instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments);\n        }\n        function getModifiedReadonlyState(state, modifiers) {\n            return modifiers & 1 /* IncludeReadonly */ ? true : modifiers & 2 /* ExcludeReadonly */ ? false : state;\n        }\n        function instantiateMappedGenericTupleType(tupleType, mappedType, typeVariable, mapper) {\n            // When a tuple type is generic (i.e. when it contains variadic elements), we want to eagerly map the\n            // non-generic elements and defer mapping the generic elements. In order to facilitate this, we transform\n            // M<[A, B?, ...T, ...C[]] into [...M<[A]>, ...M<[B?]>, ...M<T>, ...M<C[]>] and then rely on tuple type\n            // normalization to resolve the non-generic parts of the resulting tuple.\n            var elementFlags = tupleType.target.elementFlags;\n            var elementTypes = ts.map(getTypeArguments(tupleType), function (t, i) {\n                var singleton = elementFlags[i] & 8 /* Variadic */ ? t :\n                    elementFlags[i] & 4 /* Rest */ ? createArrayType(t) :\n                        createTupleType([t], [elementFlags[i]]);\n                // The singleton is never a generic tuple type, so it is safe to recurse here.\n                return instantiateMappedType(mappedType, prependTypeMapping(typeVariable, singleton, mapper));\n            });\n            var newReadonly = getModifiedReadonlyState(tupleType.target.readonly, getMappedTypeModifiers(mappedType));\n            return createTupleType(elementTypes, ts.map(elementTypes, function (_) { return 8 /* Variadic */; }), newReadonly);\n        }\n        function instantiateMappedArrayType(arrayType, mappedType, mapper) {\n            var elementType = instantiateMappedTypeTemplate(mappedType, numberType, /*isOptional*/ true, mapper);\n            return elementType === errorType ? errorType :\n                createArrayType(elementType, getModifiedReadonlyState(isReadonlyArrayType(arrayType), getMappedTypeModifiers(mappedType)));\n        }\n        function instantiateMappedTupleType(tupleType, mappedType, mapper) {\n            var elementFlags = tupleType.target.elementFlags;\n            var elementTypes = ts.map(getTypeArguments(tupleType), function (_, i) {\n                return instantiateMappedTypeTemplate(mappedType, getLiteralType(\"\" + i), !!(elementFlags[i] & 2 /* Optional */), mapper);\n            });\n            var modifiers = getMappedTypeModifiers(mappedType);\n            var newTupleModifiers = modifiers & 4 /* IncludeOptional */ ? ts.map(elementFlags, function (f) { return f & 1 /* Required */ ? 2 /* Optional */ : f; }) :\n                modifiers & 8 /* ExcludeOptional */ ? ts.map(elementFlags, function (f) { return f & 2 /* Optional */ ? 1 /* Required */ : f; }) :\n                    elementFlags;\n            var newReadonly = getModifiedReadonlyState(tupleType.target.readonly, modifiers);\n            return ts.contains(elementTypes, errorType) ? errorType :\n                createTupleType(elementTypes, newTupleModifiers, newReadonly, tupleType.target.labeledElementDeclarations);\n        }\n        function instantiateMappedTypeTemplate(type, key, isOptional, mapper) {\n            var templateMapper = appendTypeMapping(mapper, getTypeParameterFromMappedType(type), key);\n            var propType = instantiateType(getTemplateTypeFromMappedType(type.target || type), templateMapper);\n            var modifiers = getMappedTypeModifiers(type);\n            return strictNullChecks && modifiers & 4 /* IncludeOptional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType) :\n                strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) :\n                    propType;\n        }\n        function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {\n            var result = createObjectType(type.objectFlags | 64 /* Instantiated */, type.symbol);\n            if (type.objectFlags & 32 /* Mapped */) {\n                result.declaration = type.declaration;\n                // C.f. instantiateSignature\n                var origTypeParameter = getTypeParameterFromMappedType(type);\n                var freshTypeParameter = cloneTypeParameter(origTypeParameter);\n                result.typeParameter = freshTypeParameter;\n                mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);\n                freshTypeParameter.mapper = mapper;\n            }\n            result.target = type;\n            result.mapper = mapper;\n            result.aliasSymbol = aliasSymbol || type.aliasSymbol;\n            result.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper);\n            return result;\n        }\n        function getConditionalTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {\n            var root = type.root;\n            if (root.outerTypeParameters) {\n                // We are instantiating a conditional type that has one or more type parameters in scope. Apply the\n                // mapper to the type parameters to produce the effective list of type arguments, and compute the\n                // instantiation cache key from the type IDs of the type arguments.\n                var typeArguments = ts.map(root.outerTypeParameters, function (t) { return getMappedType(t, mapper); });\n                var id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);\n                var result = root.instantiations.get(id);\n                if (!result) {\n                    var newMapper = createTypeMapper(root.outerTypeParameters, typeArguments);\n                    result = instantiateConditionalType(root, newMapper, aliasSymbol, aliasTypeArguments);\n                    root.instantiations.set(id, result);\n                }\n                return result;\n            }\n            return type;\n        }\n        function instantiateConditionalType(root, mapper, aliasSymbol, aliasTypeArguments) {\n            // Check if we have a conditional type where the check type is a naked type parameter. If so,\n            // the conditional type is distributive over union types and when T is instantiated to a union\n            // type A | B, we produce (A extends U ? X : Y) | (B extends U ? X : Y).\n            if (root.isDistributive) {\n                var checkType_1 = root.checkType;\n                var instantiatedType = getMappedType(checkType_1, mapper);\n                if (checkType_1 !== instantiatedType && instantiatedType.flags & (1048576 /* Union */ | 131072 /* Never */)) {\n                    return mapTypeWithAlias(instantiatedType, function (t) { return getConditionalType(root, prependTypeMapping(checkType_1, t, mapper)); }, aliasSymbol, aliasTypeArguments);\n                }\n            }\n            return getConditionalType(root, mapper, aliasSymbol, aliasTypeArguments);\n        }\n        function instantiateType(type, mapper) {\n            return type && mapper ? instantiateTypeWithAlias(type, mapper, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined) : type;\n        }\n        function instantiateTypeWithAlias(type, mapper, aliasSymbol, aliasTypeArguments) {\n            if (!couldContainTypeVariables(type)) {\n                return type;\n            }\n            if (instantiationDepth === 50 || instantiationCount >= 5000000) {\n                // We have reached 50 recursive type instantiations and there is a very high likelyhood we're dealing\n                // with a combination of infinite generic types that perpetually generate new type identities. We stop\n                // the recursion here by yielding the error type.\n                ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant(\"checkTypes\" /* CheckTypes */, \"instantiateType_DepthLimit\", { typeId: type.id, instantiationDepth: instantiationDepth, instantiationCount: instantiationCount });\n                error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);\n                return errorType;\n            }\n            totalInstantiationCount++;\n            instantiationCount++;\n            instantiationDepth++;\n            var result = instantiateTypeWorker(type, mapper, aliasSymbol, aliasTypeArguments);\n            instantiationDepth--;\n            return result;\n        }\n        function instantiateTypeWorker(type, mapper, aliasSymbol, aliasTypeArguments) {\n            var flags = type.flags;\n            if (flags & 262144 /* TypeParameter */) {\n                return getMappedType(type, mapper);\n            }\n            if (flags & 524288 /* Object */) {\n                var objectFlags = type.objectFlags;\n                if (objectFlags & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */)) {\n                    if (objectFlags & 4 /* Reference */ && !type.node) {\n                        var resolvedTypeArguments = type.resolvedTypeArguments;\n                        var newTypeArguments = instantiateTypes(resolvedTypeArguments, mapper);\n                        return newTypeArguments !== resolvedTypeArguments ? createNormalizedTypeReference(type.target, newTypeArguments) : type;\n                    }\n                    return getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments);\n                }\n                return type;\n            }\n            if (flags & 3145728 /* UnionOrIntersection */) {\n                var origin = type.flags & 1048576 /* Union */ ? type.origin : undefined;\n                var types = origin && origin.flags & 3145728 /* UnionOrIntersection */ ? origin.types : type.types;\n                var newTypes = instantiateTypes(types, mapper);\n                if (newTypes === types && aliasSymbol === type.aliasSymbol) {\n                    return type;\n                }\n                var newAliasSymbol = aliasSymbol || type.aliasSymbol;\n                var newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper);\n                return flags & 2097152 /* Intersection */ || origin && origin.flags & 2097152 /* Intersection */ ?\n                    getIntersectionType(newTypes, newAliasSymbol, newAliasTypeArguments) :\n                    getUnionType(newTypes, 1 /* Literal */, newAliasSymbol, newAliasTypeArguments);\n            }\n            if (flags & 4194304 /* Index */) {\n                return getIndexType(instantiateType(type.type, mapper));\n            }\n            if (flags & 134217728 /* TemplateLiteral */) {\n                return getTemplateLiteralType(type.texts, instantiateTypes(type.types, mapper));\n            }\n            if (flags & 268435456 /* StringMapping */) {\n                return getStringMappingType(type.symbol, instantiateType(type.type, mapper));\n            }\n            if (flags & 8388608 /* IndexedAccess */) {\n                var newAliasSymbol = aliasSymbol || type.aliasSymbol;\n                var newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper);\n                return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), type.noUncheckedIndexedAccessCandidate, /*accessNode*/ undefined, newAliasSymbol, newAliasTypeArguments);\n            }\n            if (flags & 16777216 /* Conditional */) {\n                return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper), aliasSymbol, aliasTypeArguments);\n            }\n            if (flags & 33554432 /* Substitution */) {\n                var maybeVariable = instantiateType(type.baseType, mapper);\n                if (maybeVariable.flags & 8650752 /* TypeVariable */) {\n                    return getSubstitutionType(maybeVariable, instantiateType(type.substitute, mapper));\n                }\n                else {\n                    var sub = instantiateType(type.substitute, mapper);\n                    if (sub.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(maybeVariable), getRestrictiveInstantiation(sub))) {\n                        return maybeVariable;\n                    }\n                    return sub;\n                }\n            }\n            return type;\n        }\n        function getPermissiveInstantiation(type) {\n            return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type :\n                type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper));\n        }\n        function getRestrictiveInstantiation(type) {\n            if (type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */)) {\n                return type;\n            }\n            if (type.restrictiveInstantiation) {\n                return type.restrictiveInstantiation;\n            }\n            type.restrictiveInstantiation = instantiateType(type, restrictiveMapper);\n            // We set the following so we don't attempt to set the restrictive instance of a restrictive instance\n            // which is redundant - we'll produce new type identities, but all type params have already been mapped.\n            // This also gives us a way to detect restrictive instances upon comparisons and _disable_ the \"distributeive constraint\"\n            // assignability check for them, which is distinctly unsafe, as once you have a restrctive instance, all the type parameters\n            // are constrained to `unknown` and produce tons of false positives/negatives!\n            type.restrictiveInstantiation.restrictiveInstantiation = type.restrictiveInstantiation;\n            return type.restrictiveInstantiation;\n        }\n        function instantiateIndexInfo(info, mapper) {\n            return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration);\n        }\n        // Returns true if the given expression contains (at any level of nesting) a function or arrow expression\n        // that is subject to contextual typing.\n        function isContextSensitive(node) {\n            ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));\n            switch (node.kind) {\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                case 165 /* MethodDeclaration */:\n                case 251 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type\n                    return isContextSensitiveFunctionLikeDeclaration(node);\n                case 200 /* ObjectLiteralExpression */:\n                    return ts.some(node.properties, isContextSensitive);\n                case 199 /* ArrayLiteralExpression */:\n                    return ts.some(node.elements, isContextSensitive);\n                case 217 /* ConditionalExpression */:\n                    return isContextSensitive(node.whenTrue) ||\n                        isContextSensitive(node.whenFalse);\n                case 216 /* BinaryExpression */:\n                    return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) &&\n                        (isContextSensitive(node.left) || isContextSensitive(node.right));\n                case 288 /* PropertyAssignment */:\n                    return isContextSensitive(node.initializer);\n                case 207 /* ParenthesizedExpression */:\n                    return isContextSensitive(node.expression);\n                case 281 /* JsxAttributes */:\n                    return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive);\n                case 280 /* JsxAttribute */: {\n                    // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive.\n                    var initializer = node.initializer;\n                    return !!initializer && isContextSensitive(initializer);\n                }\n                case 283 /* JsxExpression */: {\n                    // It is possible to that node.expression is undefined (e.g <div x={} />)\n                    var expression = node.expression;\n                    return !!expression && isContextSensitive(expression);\n                }\n            }\n            return false;\n        }\n        function isContextSensitiveFunctionLikeDeclaration(node) {\n            return (!ts.isFunctionDeclaration(node) || ts.isInJSFile(node) && !!getTypeForDeclarationFromJSDocComment(node)) &&\n                (hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node));\n        }\n        function hasContextSensitiveParameters(node) {\n            // Functions with type parameters are not context sensitive.\n            if (!node.typeParameters) {\n                // Functions with any parameters that lack type annotations are context sensitive.\n                if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) {\n                    return true;\n                }\n                if (node.kind !== 209 /* ArrowFunction */) {\n                    // If the first parameter is not an explicit 'this' parameter, then the function has\n                    // an implicit 'this' parameter which is subject to contextual typing.\n                    var parameter = ts.firstOrUndefined(node.parameters);\n                    if (!(parameter && ts.parameterIsThisKeyword(parameter))) {\n                        return true;\n                    }\n                }\n            }\n            return false;\n        }\n        function hasContextSensitiveReturnExpression(node) {\n            // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value.\n            return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 230 /* Block */ && isContextSensitive(node.body);\n        }\n        function isContextSensitiveFunctionOrObjectLiteralMethod(func) {\n            return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) &&\n                isContextSensitiveFunctionLikeDeclaration(func);\n        }\n        function getTypeWithoutSignatures(type) {\n            if (type.flags & 524288 /* Object */) {\n                var resolved = resolveStructuredTypeMembers(type);\n                if (resolved.constructSignatures.length || resolved.callSignatures.length) {\n                    var result = createObjectType(16 /* Anonymous */, type.symbol);\n                    result.members = resolved.members;\n                    result.properties = resolved.properties;\n                    result.callSignatures = ts.emptyArray;\n                    result.constructSignatures = ts.emptyArray;\n                    return result;\n                }\n            }\n            else if (type.flags & 2097152 /* Intersection */) {\n                return getIntersectionType(ts.map(type.types, getTypeWithoutSignatures));\n            }\n            return type;\n        }\n        // TYPE CHECKING\n        function isTypeIdenticalTo(source, target) {\n            return isTypeRelatedTo(source, target, identityRelation);\n        }\n        function compareTypesIdentical(source, target) {\n            return isTypeRelatedTo(source, target, identityRelation) ? -1 /* True */ : 0 /* False */;\n        }\n        function compareTypesAssignable(source, target) {\n            return isTypeRelatedTo(source, target, assignableRelation) ? -1 /* True */ : 0 /* False */;\n        }\n        function compareTypesSubtypeOf(source, target) {\n            return isTypeRelatedTo(source, target, subtypeRelation) ? -1 /* True */ : 0 /* False */;\n        }\n        function isTypeSubtypeOf(source, target) {\n            return isTypeRelatedTo(source, target, subtypeRelation);\n        }\n        function isTypeAssignableTo(source, target) {\n            return isTypeRelatedTo(source, target, assignableRelation);\n        }\n        // An object type S is considered to be derived from an object type T if\n        // S is a union type and every constituent of S is derived from T,\n        // T is a union type and S is derived from at least one constituent of T, or\n        // S is a type variable with a base constraint that is derived from T,\n        // T is one of the global types Object and Function and S is a subtype of T, or\n        // T occurs directly or indirectly in an 'extends' clause of S.\n        // Note that this check ignores type parameters and only considers the\n        // inheritance hierarchy.\n        function isTypeDerivedFrom(source, target) {\n            return source.flags & 1048576 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) :\n                target.flags & 1048576 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) :\n                    source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) :\n                        target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) :\n                            target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) :\n                                hasBaseType(source, getTargetType(target)) || (isArrayType(target) && !isReadonlyArrayType(target) && isTypeDerivedFrom(source, globalReadonlyArrayType));\n        }\n        /**\n         * This is *not* a bi-directional relationship.\n         * If one needs to check both directions for comparability, use a second call to this function or 'checkTypeComparableTo'.\n         *\n         * A type S is comparable to a type T if some (but not necessarily all) of the possible values of S are also possible values of T.\n         * It is used to check following cases:\n         *   - the types of the left and right sides of equality/inequality operators (`===`, `!==`, `==`, `!=`).\n         *   - the types of `case` clause expressions and their respective `switch` expressions.\n         *   - the type of an expression in a type assertion with the type being asserted.\n         */\n        function isTypeComparableTo(source, target) {\n            return isTypeRelatedTo(source, target, comparableRelation);\n        }\n        function areTypesComparable(type1, type2) {\n            return isTypeComparableTo(type1, type2) || isTypeComparableTo(type2, type1);\n        }\n        function checkTypeAssignableTo(source, target, errorNode, headMessage, containingMessageChain, errorOutputObject) {\n            return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain, errorOutputObject);\n        }\n        /**\n         * Like `checkTypeAssignableTo`, but if it would issue an error, instead performs structural comparisons of the types using the given expression node to\n         * attempt to issue more specific errors on, for example, specific object literal properties or tuple members.\n         */\n        function checkTypeAssignableToAndOptionallyElaborate(source, target, errorNode, expr, headMessage, containingMessageChain) {\n            return checkTypeRelatedToAndOptionallyElaborate(source, target, assignableRelation, errorNode, expr, headMessage, containingMessageChain, /*errorOutputContainer*/ undefined);\n        }\n        function checkTypeRelatedToAndOptionallyElaborate(source, target, relation, errorNode, expr, headMessage, containingMessageChain, errorOutputContainer) {\n            if (isTypeRelatedTo(source, target, relation))\n                return true;\n            if (!errorNode || !elaborateError(expr, source, target, relation, headMessage, containingMessageChain, errorOutputContainer)) {\n                return checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer);\n            }\n            return false;\n        }\n        function isOrHasGenericConditional(type) {\n            return !!(type.flags & 16777216 /* Conditional */ || (type.flags & 2097152 /* Intersection */ && ts.some(type.types, isOrHasGenericConditional)));\n        }\n        function elaborateError(node, source, target, relation, headMessage, containingMessageChain, errorOutputContainer) {\n            if (!node || isOrHasGenericConditional(target))\n                return false;\n            if (!checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined)\n                && elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage, containingMessageChain, errorOutputContainer)) {\n                return true;\n            }\n            switch (node.kind) {\n                case 283 /* JsxExpression */:\n                case 207 /* ParenthesizedExpression */:\n                    return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);\n                case 216 /* BinaryExpression */:\n                    switch (node.operatorToken.kind) {\n                        case 62 /* EqualsToken */:\n                        case 27 /* CommaToken */:\n                            return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);\n                    }\n                    break;\n                case 200 /* ObjectLiteralExpression */:\n                    return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer);\n                case 199 /* ArrayLiteralExpression */:\n                    return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer);\n                case 281 /* JsxAttributes */:\n                    return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer);\n                case 209 /* ArrowFunction */:\n                    return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer);\n            }\n            return false;\n        }\n        function elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage, containingMessageChain, errorOutputContainer) {\n            var callSignatures = getSignaturesOfType(source, 0 /* Call */);\n            var constructSignatures = getSignaturesOfType(source, 1 /* Construct */);\n            for (var _i = 0, _a = [constructSignatures, callSignatures]; _i < _a.length; _i++) {\n                var signatures = _a[_i];\n                if (ts.some(signatures, function (s) {\n                    var returnType = getReturnTypeOfSignature(s);\n                    return !(returnType.flags & (1 /* Any */ | 131072 /* Never */)) && checkTypeRelatedTo(returnType, target, relation, /*errorNode*/ undefined);\n                })) {\n                    var resultObj = errorOutputContainer || {};\n                    checkTypeAssignableTo(source, target, node, headMessage, containingMessageChain, resultObj);\n                    var diagnostic = resultObj.errors[resultObj.errors.length - 1];\n                    ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(node, signatures === constructSignatures ? ts.Diagnostics.Did_you_mean_to_use_new_with_this_expression : ts.Diagnostics.Did_you_mean_to_call_this_expression));\n                    return true;\n                }\n            }\n            return false;\n        }\n        function elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer) {\n            // Don't elaborate blocks\n            if (ts.isBlock(node.body)) {\n                return false;\n            }\n            // Or functions with annotated parameter types\n            if (ts.some(node.parameters, ts.hasType)) {\n                return false;\n            }\n            var sourceSig = getSingleCallSignature(source);\n            if (!sourceSig) {\n                return false;\n            }\n            var targetSignatures = getSignaturesOfType(target, 0 /* Call */);\n            if (!ts.length(targetSignatures)) {\n                return false;\n            }\n            var returnExpression = node.body;\n            var sourceReturn = getReturnTypeOfSignature(sourceSig);\n            var targetReturn = getUnionType(ts.map(targetSignatures, getReturnTypeOfSignature));\n            if (!checkTypeRelatedTo(sourceReturn, targetReturn, relation, /*errorNode*/ undefined)) {\n                var elaborated = returnExpression && elaborateError(returnExpression, sourceReturn, targetReturn, relation, /*headMessage*/ undefined, containingMessageChain, errorOutputContainer);\n                if (elaborated) {\n                    return elaborated;\n                }\n                var resultObj = errorOutputContainer || {};\n                checkTypeRelatedTo(sourceReturn, targetReturn, relation, returnExpression, /*message*/ undefined, containingMessageChain, resultObj);\n                if (resultObj.errors) {\n                    if (target.symbol && ts.length(target.symbol.declarations)) {\n                        ts.addRelatedInfo(resultObj.errors[resultObj.errors.length - 1], ts.createDiagnosticForNode(target.symbol.declarations[0], ts.Diagnostics.The_expected_type_comes_from_the_return_type_of_this_signature));\n                    }\n                    if ((ts.getFunctionFlags(node) & 2 /* Async */) === 0\n                        // exclude cases where source itself is promisy - this way we don't make a suggestion when relating\n                        // an IPromise and a Promise that are slightly different\n                        && !getTypeOfPropertyOfType(sourceReturn, \"then\")\n                        && checkTypeRelatedTo(createPromiseType(sourceReturn), targetReturn, relation, /*errorNode*/ undefined)) {\n                        ts.addRelatedInfo(resultObj.errors[resultObj.errors.length - 1], ts.createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async));\n                    }\n                    return true;\n                }\n            }\n            return false;\n        }\n        function getBestMatchIndexedAccessTypeOrUndefined(source, target, nameType) {\n            var idx = getIndexedAccessTypeOrUndefined(target, nameType);\n            if (idx) {\n                return idx;\n            }\n            if (target.flags & 1048576 /* Union */) {\n                var best = getBestMatchingType(source, target);\n                if (best) {\n                    return getIndexedAccessTypeOrUndefined(best, nameType);\n                }\n            }\n        }\n        function checkExpressionForMutableLocationWithContextualType(next, sourcePropType) {\n            next.contextualType = sourcePropType;\n            try {\n                return checkExpressionForMutableLocation(next, 1 /* Contextual */, sourcePropType);\n            }\n            finally {\n                next.contextualType = undefined;\n            }\n        }\n        /**\n         * For every element returned from the iterator, checks that element to issue an error on a property of that element's type\n         * If that element would issue an error, we first attempt to dive into that element's inner expression and issue a more specific error by recuring into `elaborateError`\n         * Otherwise, we issue an error on _every_ element which fail the assignability check\n         */\n        function elaborateElementwise(iterator, source, target, relation, containingMessageChain, errorOutputContainer) {\n            // Assignability failure - check each prop individually, and if that fails, fall back on the bad error span\n            var reportedError = false;\n            for (var status = iterator.next(); !status.done; status = iterator.next()) {\n                var _a = status.value, prop = _a.errorNode, next = _a.innerExpression, nameType = _a.nameType, errorMessage = _a.errorMessage;\n                var targetPropType = getBestMatchIndexedAccessTypeOrUndefined(source, target, nameType);\n                if (!targetPropType || targetPropType.flags & 8388608 /* IndexedAccess */)\n                    continue; // Don't elaborate on indexes on generic variables\n                var sourcePropType = getIndexedAccessTypeOrUndefined(source, nameType);\n                if (sourcePropType && !checkTypeRelatedTo(sourcePropType, targetPropType, relation, /*errorNode*/ undefined)) {\n                    var elaborated = next && elaborateError(next, sourcePropType, targetPropType, relation, /*headMessage*/ undefined, containingMessageChain, errorOutputContainer);\n                    if (elaborated) {\n                        reportedError = true;\n                    }\n                    else {\n                        // Issue error on the prop itself, since the prop couldn't elaborate the error\n                        var resultObj = errorOutputContainer || {};\n                        // Use the expression type, if available\n                        var specificSource = next ? checkExpressionForMutableLocationWithContextualType(next, sourcePropType) : sourcePropType;\n                        var result = checkTypeRelatedTo(specificSource, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj);\n                        if (result && specificSource !== sourcePropType) {\n                            // If for whatever reason the expression type doesn't yield an error, make sure we still issue an error on the sourcePropType\n                            checkTypeRelatedTo(sourcePropType, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj);\n                        }\n                        if (resultObj.errors) {\n                            var reportedDiag = resultObj.errors[resultObj.errors.length - 1];\n                            var propertyName = isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : undefined;\n                            var targetProp = propertyName !== undefined ? getPropertyOfType(target, propertyName) : undefined;\n                            var issuedElaboration = false;\n                            if (!targetProp) {\n                                var indexInfo = isTypeAssignableToKind(nameType, 296 /* NumberLike */) && getIndexInfoOfType(target, 1 /* Number */) ||\n                                    getIndexInfoOfType(target, 0 /* String */) ||\n                                    undefined;\n                                if (indexInfo && indexInfo.declaration && !ts.getSourceFileOfNode(indexInfo.declaration).hasNoDefaultLib) {\n                                    issuedElaboration = true;\n                                    ts.addRelatedInfo(reportedDiag, ts.createDiagnosticForNode(indexInfo.declaration, ts.Diagnostics.The_expected_type_comes_from_this_index_signature));\n                                }\n                            }\n                            if (!issuedElaboration && (targetProp && ts.length(targetProp.declarations) || target.symbol && ts.length(target.symbol.declarations))) {\n                                var targetNode = targetProp && ts.length(targetProp.declarations) ? targetProp.declarations[0] : target.symbol.declarations[0];\n                                if (!ts.getSourceFileOfNode(targetNode).hasNoDefaultLib) {\n                                    ts.addRelatedInfo(reportedDiag, ts.createDiagnosticForNode(targetNode, ts.Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1, propertyName && !(nameType.flags & 8192 /* UniqueESSymbol */) ? ts.unescapeLeadingUnderscores(propertyName) : typeToString(nameType), typeToString(target)));\n                                }\n                            }\n                        }\n                        reportedError = true;\n                    }\n                }\n            }\n            return reportedError;\n        }\n        function generateJsxAttributes(node) {\n            var _i, _a, prop;\n            return __generator(this, function (_b) {\n                switch (_b.label) {\n                    case 0:\n                        if (!ts.length(node.properties))\n                            return [2 /*return*/];\n                        _i = 0, _a = node.properties;\n                        _b.label = 1;\n                    case 1:\n                        if (!(_i < _a.length)) return [3 /*break*/, 4];\n                        prop = _a[_i];\n                        if (ts.isJsxSpreadAttribute(prop))\n                            return [3 /*break*/, 3];\n                        return [4 /*yield*/, { errorNode: prop.name, innerExpression: prop.initializer, nameType: getLiteralType(ts.idText(prop.name)) }];\n                    case 2:\n                        _b.sent();\n                        _b.label = 3;\n                    case 3:\n                        _i++;\n                        return [3 /*break*/, 1];\n                    case 4: return [2 /*return*/];\n                }\n            });\n        }\n        function generateJsxChildren(node, getInvalidTextDiagnostic) {\n            var memberOffset, i, child, nameType, elem;\n            return __generator(this, function (_a) {\n                switch (_a.label) {\n                    case 0:\n                        if (!ts.length(node.children))\n                            return [2 /*return*/];\n                        memberOffset = 0;\n                        i = 0;\n                        _a.label = 1;\n                    case 1:\n                        if (!(i < node.children.length)) return [3 /*break*/, 5];\n                        child = node.children[i];\n                        nameType = getLiteralType(i - memberOffset);\n                        elem = getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic);\n                        if (!elem) return [3 /*break*/, 3];\n                        return [4 /*yield*/, elem];\n                    case 2:\n                        _a.sent();\n                        return [3 /*break*/, 4];\n                    case 3:\n                        memberOffset++;\n                        _a.label = 4;\n                    case 4:\n                        i++;\n                        return [3 /*break*/, 1];\n                    case 5: return [2 /*return*/];\n                }\n            });\n        }\n        function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) {\n            switch (child.kind) {\n                case 283 /* JsxExpression */:\n                    // child is of the type of the expression\n                    return { errorNode: child, innerExpression: child.expression, nameType: nameType };\n                case 11 /* JsxText */:\n                    if (child.containsOnlyTriviaWhiteSpaces) {\n                        break; // Whitespace only jsx text isn't real jsx text\n                    }\n                    // child is a string\n                    return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() };\n                case 273 /* JsxElement */:\n                case 274 /* JsxSelfClosingElement */:\n                case 277 /* JsxFragment */:\n                    // child is of type JSX.Element\n                    return { errorNode: child, innerExpression: child, nameType: nameType };\n                default:\n                    return ts.Debug.assertNever(child, \"Found invalid jsx child\");\n            }\n        }\n        function elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer) {\n            var result = elaborateElementwise(generateJsxAttributes(node), source, target, relation, containingMessageChain, errorOutputContainer);\n            var invalidTextDiagnostic;\n            if (ts.isJsxOpeningElement(node.parent) && ts.isJsxElement(node.parent.parent)) {\n                var containingElement = node.parent.parent;\n                var childPropName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));\n                var childrenPropName = childPropName === undefined ? \"children\" : ts.unescapeLeadingUnderscores(childPropName);\n                var childrenNameType = getLiteralType(childrenPropName);\n                var childrenTargetType = getIndexedAccessType(target, childrenNameType);\n                var validChildren = ts.getSemanticJsxChildren(containingElement.children);\n                if (!ts.length(validChildren)) {\n                    return result;\n                }\n                var moreThanOneRealChildren = ts.length(validChildren) > 1;\n                var arrayLikeTargetParts = filterType(childrenTargetType, isArrayOrTupleLikeType);\n                var nonArrayLikeTargetParts = filterType(childrenTargetType, function (t) { return !isArrayOrTupleLikeType(t); });\n                if (moreThanOneRealChildren) {\n                    if (arrayLikeTargetParts !== neverType) {\n                        var realSource = createTupleType(checkJsxChildren(containingElement, 0 /* Normal */));\n                        var children = generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic);\n                        result = elaborateElementwise(children, realSource, arrayLikeTargetParts, relation, containingMessageChain, errorOutputContainer) || result;\n                    }\n                    else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) {\n                        // arity mismatch\n                        result = true;\n                        var diag = error(containingElement.openingElement.tagName, ts.Diagnostics.This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided, childrenPropName, typeToString(childrenTargetType));\n                        if (errorOutputContainer && errorOutputContainer.skipLogging) {\n                            (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);\n                        }\n                    }\n                }\n                else {\n                    if (nonArrayLikeTargetParts !== neverType) {\n                        var child = validChildren[0];\n                        var elem_1 = getElaborationElementForJsxChild(child, childrenNameType, getInvalidTextualChildDiagnostic);\n                        if (elem_1) {\n                            result = elaborateElementwise((function () { return __generator(this, function (_a) {\n                                switch (_a.label) {\n                                    case 0: return [4 /*yield*/, elem_1];\n                                    case 1:\n                                        _a.sent();\n                                        return [2 /*return*/];\n                                }\n                            }); })(), source, target, relation, containingMessageChain, errorOutputContainer) || result;\n                        }\n                    }\n                    else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) {\n                        // arity mismatch\n                        result = true;\n                        var diag = error(containingElement.openingElement.tagName, ts.Diagnostics.This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided, childrenPropName, typeToString(childrenTargetType));\n                        if (errorOutputContainer && errorOutputContainer.skipLogging) {\n                            (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);\n                        }\n                    }\n                }\n            }\n            return result;\n            function getInvalidTextualChildDiagnostic() {\n                if (!invalidTextDiagnostic) {\n                    var tagNameText = ts.getTextOfNode(node.parent.tagName);\n                    var childPropName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));\n                    var childrenPropName = childPropName === undefined ? \"children\" : ts.unescapeLeadingUnderscores(childPropName);\n                    var childrenTargetType = getIndexedAccessType(target, getLiteralType(childrenPropName));\n                    var diagnostic = ts.Diagnostics._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2;\n                    invalidTextDiagnostic = __assign(__assign({}, diagnostic), { key: \"!!ALREADY FORMATTED!!\", message: ts.formatMessage(/*_dummy*/ undefined, diagnostic, tagNameText, childrenPropName, typeToString(childrenTargetType)) });\n                }\n                return invalidTextDiagnostic;\n            }\n        }\n        function generateLimitedTupleElements(node, target) {\n            var len, i, elem, nameType;\n            return __generator(this, function (_a) {\n                switch (_a.label) {\n                    case 0:\n                        len = ts.length(node.elements);\n                        if (!len)\n                            return [2 /*return*/];\n                        i = 0;\n                        _a.label = 1;\n                    case 1:\n                        if (!(i < len)) return [3 /*break*/, 4];\n                        // Skip elements which do not exist in the target - a length error on the tuple overall is likely better than an error on a mismatched index signature\n                        if (isTupleLikeType(target) && !getPropertyOfType(target, (\"\" + i)))\n                            return [3 /*break*/, 3];\n                        elem = node.elements[i];\n                        if (ts.isOmittedExpression(elem))\n                            return [3 /*break*/, 3];\n                        nameType = getLiteralType(i);\n                        return [4 /*yield*/, { errorNode: elem, innerExpression: elem, nameType: nameType }];\n                    case 2:\n                        _a.sent();\n                        _a.label = 3;\n                    case 3:\n                        i++;\n                        return [3 /*break*/, 1];\n                    case 4: return [2 /*return*/];\n                }\n            });\n        }\n        function elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) {\n            if (target.flags & 131068 /* Primitive */)\n                return false;\n            if (isTupleLikeType(source)) {\n                return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer);\n            }\n            // recreate a tuple from the elements, if possible\n            // Since we're re-doing the expression type, we need to reapply the contextual type\n            var oldContext = node.contextualType;\n            node.contextualType = target;\n            try {\n                var tupleizedType = checkArrayLiteral(node, 1 /* Contextual */, /*forceTuple*/ true);\n                node.contextualType = oldContext;\n                if (isTupleLikeType(tupleizedType)) {\n                    return elaborateElementwise(generateLimitedTupleElements(node, target), tupleizedType, target, relation, containingMessageChain, errorOutputContainer);\n                }\n                return false;\n            }\n            finally {\n                node.contextualType = oldContext;\n            }\n        }\n        function generateObjectLiteralElements(node) {\n            var _i, _a, prop, type, _b;\n            return __generator(this, function (_c) {\n                switch (_c.label) {\n                    case 0:\n                        if (!ts.length(node.properties))\n                            return [2 /*return*/];\n                        _i = 0, _a = node.properties;\n                        _c.label = 1;\n                    case 1:\n                        if (!(_i < _a.length)) return [3 /*break*/, 8];\n                        prop = _a[_i];\n                        if (ts.isSpreadAssignment(prop))\n                            return [3 /*break*/, 7];\n                        type = getLiteralTypeFromProperty(getSymbolOfNode(prop), 8576 /* StringOrNumberLiteralOrUnique */);\n                        if (!type || (type.flags & 131072 /* Never */)) {\n                            return [3 /*break*/, 7];\n                        }\n                        _b = prop.kind;\n                        switch (_b) {\n                            case 168 /* SetAccessor */: return [3 /*break*/, 2];\n                            case 167 /* GetAccessor */: return [3 /*break*/, 2];\n                            case 165 /* MethodDeclaration */: return [3 /*break*/, 2];\n                            case 289 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2];\n                            case 288 /* PropertyAssignment */: return [3 /*break*/, 4];\n                        }\n                        return [3 /*break*/, 6];\n                    case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }];\n                    case 3:\n                        _c.sent();\n                        return [3 /*break*/, 7];\n                    case 4: return [4 /*yield*/, { errorNode: prop.name, innerExpression: prop.initializer, nameType: type, errorMessage: ts.isComputedNonLiteralName(prop.name) ? ts.Diagnostics.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1 : undefined }];\n                    case 5:\n                        _c.sent();\n                        return [3 /*break*/, 7];\n                    case 6:\n                        ts.Debug.assertNever(prop);\n                        _c.label = 7;\n                    case 7:\n                        _i++;\n                        return [3 /*break*/, 1];\n                    case 8: return [2 /*return*/];\n                }\n            });\n        }\n        function elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) {\n            if (target.flags & 131068 /* Primitive */)\n                return false;\n            return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, containingMessageChain, errorOutputContainer);\n        }\n        /**\n         * This is *not* a bi-directional relationship.\n         * If one needs to check both directions for comparability, use a second call to this function or 'isTypeComparableTo'.\n         */\n        function checkTypeComparableTo(source, target, errorNode, headMessage, containingMessageChain) {\n            return checkTypeRelatedTo(source, target, comparableRelation, errorNode, headMessage, containingMessageChain);\n        }\n        function isSignatureAssignableTo(source, target, ignoreReturnTypes) {\n            return compareSignaturesRelated(source, target, ignoreReturnTypes ? 4 /* IgnoreReturnTypes */ : 0, /*reportErrors*/ false, \n            /*errorReporter*/ undefined, /*errorReporter*/ undefined, compareTypesAssignable, /*reportUnreliableMarkers*/ undefined) !== 0 /* False */;\n        }\n        /**\n         * Returns true if `s` is `(...args: any[]) => any` or `(this: any, ...args: any[]) => any`\n         */\n        function isAnySignature(s) {\n            return !s.typeParameters && (!s.thisParameter || isTypeAny(getTypeOfParameter(s.thisParameter))) && s.parameters.length === 1 &&\n                signatureHasRestParameter(s) && (getTypeOfParameter(s.parameters[0]) === anyArrayType || isTypeAny(getTypeOfParameter(s.parameters[0]))) &&\n                isTypeAny(getReturnTypeOfSignature(s));\n        }\n        /**\n         * See signatureRelatedTo, compareSignaturesIdentical\n         */\n        function compareSignaturesRelated(source, target, checkMode, reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) {\n            // TODO (drosen): De-duplicate code between related functions.\n            if (source === target) {\n                return -1 /* True */;\n            }\n            if (isAnySignature(target)) {\n                return -1 /* True */;\n            }\n            var targetCount = getParameterCount(target);\n            var sourceHasMoreParameters = !hasEffectiveRestParameter(target) &&\n                (checkMode & 8 /* StrictArity */ ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount);\n            if (sourceHasMoreParameters) {\n                return 0 /* False */;\n            }\n            if (source.typeParameters && source.typeParameters !== target.typeParameters) {\n                target = getCanonicalSignature(target);\n                source = instantiateSignatureInContextOf(source, target, /*inferenceContext*/ undefined, compareTypes);\n            }\n            var sourceCount = getParameterCount(source);\n            var sourceRestType = getNonArrayRestType(source);\n            var targetRestType = getNonArrayRestType(target);\n            if (sourceRestType || targetRestType) {\n                void instantiateType(sourceRestType || targetRestType, reportUnreliableMarkers);\n            }\n            if (sourceRestType && targetRestType && sourceCount !== targetCount) {\n                // We're not able to relate misaligned complex rest parameters\n                return 0 /* False */;\n            }\n            var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;\n            var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 165 /* MethodDeclaration */ &&\n                kind !== 164 /* MethodSignature */ && kind !== 166 /* Constructor */;\n            var result = -1 /* True */;\n            var sourceThisType = getThisTypeOfSignature(source);\n            if (sourceThisType && sourceThisType !== voidType) {\n                var targetThisType = getThisTypeOfSignature(target);\n                if (targetThisType) {\n                    // void sources are assignable to anything.\n                    var related = !strictVariance && compareTypes(sourceThisType, targetThisType, /*reportErrors*/ false)\n                        || compareTypes(targetThisType, sourceThisType, reportErrors);\n                    if (!related) {\n                        if (reportErrors) {\n                            errorReporter(ts.Diagnostics.The_this_types_of_each_signature_are_incompatible);\n                        }\n                        return 0 /* False */;\n                    }\n                    result &= related;\n                }\n            }\n            var paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount);\n            var restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;\n            for (var i = 0; i < paramCount; i++) {\n                var sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);\n                var targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);\n                if (sourceType && targetType) {\n                    // In order to ensure that any generic type Foo<T> is at least co-variant with respect to T no matter\n                    // how Foo uses T, we need to relate parameters bi-variantly (given that parameters are input positions,\n                    // they naturally relate only contra-variantly). However, if the source and target parameters both have\n                    // function types with a single call signature, we know we are relating two callback parameters. In\n                    // that case it is sufficient to only relate the parameters of the signatures co-variantly because,\n                    // similar to return values, callback parameters are output positions. This means that a Promise<T>,\n                    // where T is used only in callback parameter positions, will be co-variant (as opposed to bi-variant)\n                    // with respect to T.\n                    var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType));\n                    var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType));\n                    var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) &&\n                        (getFalsyFlags(sourceType) & 98304 /* Nullable */) === (getFalsyFlags(targetType) & 98304 /* Nullable */);\n                    var related = callbacks ?\n                        compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) :\n                        !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors);\n                    // With strict arity, (x: number | undefined) => void is a subtype of (x?: number | undefined) => void\n                    if (related && checkMode & 8 /* StrictArity */ && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(sourceType, targetType, /*reportErrors*/ false)) {\n                        related = 0 /* False */;\n                    }\n                    if (!related) {\n                        if (reportErrors) {\n                            errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, ts.unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), ts.unescapeLeadingUnderscores(getParameterNameAtPosition(target, i)));\n                        }\n                        return 0 /* False */;\n                    }\n                    result &= related;\n                }\n            }\n            if (!(checkMode & 4 /* IgnoreReturnTypes */)) {\n                // If a signature resolution is already in-flight, skip issuing a circularity error\n                // here and just use the `any` type directly\n                var targetReturnType = isResolvingReturnTypeOfSignature(target) ? anyType\n                    : target.declaration && isJSConstructor(target.declaration) ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(target.declaration.symbol))\n                        : getReturnTypeOfSignature(target);\n                if (targetReturnType === voidType) {\n                    return result;\n                }\n                var sourceReturnType = isResolvingReturnTypeOfSignature(source) ? anyType\n                    : source.declaration && isJSConstructor(source.declaration) ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(source.declaration.symbol))\n                        : getReturnTypeOfSignature(source);\n                // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions\n                var targetTypePredicate = getTypePredicateOfSignature(target);\n                if (targetTypePredicate) {\n                    var sourceTypePredicate = getTypePredicateOfSignature(source);\n                    if (sourceTypePredicate) {\n                        result &= compareTypePredicateRelatedTo(sourceTypePredicate, targetTypePredicate, reportErrors, errorReporter, compareTypes);\n                    }\n                    else if (ts.isIdentifierTypePredicate(targetTypePredicate)) {\n                        if (reportErrors) {\n                            errorReporter(ts.Diagnostics.Signature_0_must_be_a_type_predicate, signatureToString(source));\n                        }\n                        return 0 /* False */;\n                    }\n                }\n                else {\n                    // When relating callback signatures, we still need to relate return types bi-variantly as otherwise\n                    // the containing type wouldn't be co-variant. For example, interface Foo<T> { add(cb: () => T): void }\n                    // wouldn't be co-variant for T without this rule.\n                    result &= checkMode & 1 /* BivariantCallback */ && compareTypes(targetReturnType, sourceReturnType, /*reportErrors*/ false) ||\n                        compareTypes(sourceReturnType, targetReturnType, reportErrors);\n                    if (!result && reportErrors && incompatibleErrorReporter) {\n                        incompatibleErrorReporter(sourceReturnType, targetReturnType);\n                    }\n                }\n            }\n            return result;\n        }\n        function compareTypePredicateRelatedTo(source, target, reportErrors, errorReporter, compareTypes) {\n            if (source.kind !== target.kind) {\n                if (reportErrors) {\n                    errorReporter(ts.Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard);\n                    errorReporter(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target));\n                }\n                return 0 /* False */;\n            }\n            if (source.kind === 1 /* Identifier */ || source.kind === 3 /* AssertsIdentifier */) {\n                if (source.parameterIndex !== target.parameterIndex) {\n                    if (reportErrors) {\n                        errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, source.parameterName, target.parameterName);\n                        errorReporter(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target));\n                    }\n                    return 0 /* False */;\n                }\n            }\n            var related = source.type === target.type ? -1 /* True */ :\n                source.type && target.type ? compareTypes(source.type, target.type, reportErrors) :\n                    0 /* False */;\n            if (related === 0 /* False */ && reportErrors) {\n                errorReporter(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target));\n            }\n            return related;\n        }\n        function isImplementationCompatibleWithOverload(implementation, overload) {\n            var erasedSource = getErasedSignature(implementation);\n            var erasedTarget = getErasedSignature(overload);\n            // First see if the return types are compatible in either direction.\n            var sourceReturnType = getReturnTypeOfSignature(erasedSource);\n            var targetReturnType = getReturnTypeOfSignature(erasedTarget);\n            if (targetReturnType === voidType\n                || isTypeRelatedTo(targetReturnType, sourceReturnType, assignableRelation)\n                || isTypeRelatedTo(sourceReturnType, targetReturnType, assignableRelation)) {\n                return isSignatureAssignableTo(erasedSource, erasedTarget, /*ignoreReturnTypes*/ true);\n            }\n            return false;\n        }\n        function isEmptyResolvedType(t) {\n            return t !== anyFunctionType &&\n                t.properties.length === 0 &&\n                t.callSignatures.length === 0 &&\n                t.constructSignatures.length === 0 &&\n                !t.stringIndexInfo &&\n                !t.numberIndexInfo;\n        }\n        function isEmptyObjectType(type) {\n            return type.flags & 524288 /* Object */ ? !isGenericMappedType(type) && isEmptyResolvedType(resolveStructuredTypeMembers(type)) :\n                type.flags & 67108864 /* NonPrimitive */ ? true :\n                    type.flags & 1048576 /* Union */ ? ts.some(type.types, isEmptyObjectType) :\n                        type.flags & 2097152 /* Intersection */ ? ts.every(type.types, isEmptyObjectType) :\n                            false;\n        }\n        function isEmptyAnonymousObjectType(type) {\n            return !!(ts.getObjectFlags(type) & 16 /* Anonymous */ && (type.members && isEmptyResolvedType(type) ||\n                type.symbol && type.symbol.flags & 2048 /* TypeLiteral */ && getMembersOfSymbol(type.symbol).size === 0));\n        }\n        function isStringIndexSignatureOnlyType(type) {\n            return type.flags & 524288 /* Object */ && !isGenericMappedType(type) && getPropertiesOfType(type).length === 0 && getIndexInfoOfType(type, 0 /* String */) && !getIndexInfoOfType(type, 1 /* Number */) ||\n                type.flags & 3145728 /* UnionOrIntersection */ && ts.every(type.types, isStringIndexSignatureOnlyType) ||\n                false;\n        }\n        function isEnumTypeRelatedTo(sourceSymbol, targetSymbol, errorReporter) {\n            if (sourceSymbol === targetSymbol) {\n                return true;\n            }\n            var id = getSymbolId(sourceSymbol) + \",\" + getSymbolId(targetSymbol);\n            var entry = enumRelation.get(id);\n            if (entry !== undefined && !(!(entry & 4 /* Reported */) && entry & 2 /* Failed */ && errorReporter)) {\n                return !!(entry & 1 /* Succeeded */);\n            }\n            if (sourceSymbol.escapedName !== targetSymbol.escapedName || !(sourceSymbol.flags & 256 /* RegularEnum */) || !(targetSymbol.flags & 256 /* RegularEnum */)) {\n                enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);\n                return false;\n            }\n            var targetEnumType = getTypeOfSymbol(targetSymbol);\n            for (var _i = 0, _a = getPropertiesOfType(getTypeOfSymbol(sourceSymbol)); _i < _a.length; _i++) {\n                var property = _a[_i];\n                if (property.flags & 8 /* EnumMember */) {\n                    var targetProperty = getPropertyOfType(targetEnumType, property.escapedName);\n                    if (!targetProperty || !(targetProperty.flags & 8 /* EnumMember */)) {\n                        if (errorReporter) {\n                            errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, ts.symbolName(property), typeToString(getDeclaredTypeOfSymbol(targetSymbol), /*enclosingDeclaration*/ undefined, 64 /* UseFullyQualifiedType */));\n                            enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);\n                        }\n                        else {\n                            enumRelation.set(id, 2 /* Failed */);\n                        }\n                        return false;\n                    }\n                }\n            }\n            enumRelation.set(id, 1 /* Succeeded */);\n            return true;\n        }\n        function isSimpleTypeRelatedTo(source, target, relation, errorReporter) {\n            var s = source.flags;\n            var t = target.flags;\n            if (t & 3 /* AnyOrUnknown */ || s & 131072 /* Never */ || source === wildcardType)\n                return true;\n            if (t & 131072 /* Never */)\n                return false;\n            if (s & 402653316 /* StringLike */ && t & 4 /* String */)\n                return true;\n            if (s & 128 /* StringLiteral */ && s & 1024 /* EnumLiteral */ &&\n                t & 128 /* StringLiteral */ && !(t & 1024 /* EnumLiteral */) &&\n                source.value === target.value)\n                return true;\n            if (s & 296 /* NumberLike */ && t & 8 /* Number */)\n                return true;\n            if (s & 256 /* NumberLiteral */ && s & 1024 /* EnumLiteral */ &&\n                t & 256 /* NumberLiteral */ && !(t & 1024 /* EnumLiteral */) &&\n                source.value === target.value)\n                return true;\n            if (s & 2112 /* BigIntLike */ && t & 64 /* BigInt */)\n                return true;\n            if (s & 528 /* BooleanLike */ && t & 16 /* Boolean */)\n                return true;\n            if (s & 12288 /* ESSymbolLike */ && t & 4096 /* ESSymbol */)\n                return true;\n            if (s & 32 /* Enum */ && t & 32 /* Enum */ && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter))\n                return true;\n            if (s & 1024 /* EnumLiteral */ && t & 1024 /* EnumLiteral */) {\n                if (s & 1048576 /* Union */ && t & 1048576 /* Union */ && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter))\n                    return true;\n                if (s & 2944 /* Literal */ && t & 2944 /* Literal */ &&\n                    source.value === target.value &&\n                    isEnumTypeRelatedTo(getParentOfSymbol(source.symbol), getParentOfSymbol(target.symbol), errorReporter))\n                    return true;\n            }\n            if (s & 32768 /* Undefined */ && (!strictNullChecks || t & (32768 /* Undefined */ | 16384 /* Void */)))\n                return true;\n            if (s & 65536 /* Null */ && (!strictNullChecks || t & 65536 /* Null */))\n                return true;\n            if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */)\n                return true;\n            if (relation === assignableRelation || relation === comparableRelation) {\n                if (s & 1 /* Any */)\n                    return true;\n                // Type number or any numeric literal type is assignable to any numeric enum type or any\n                // numeric enum literal type. This rule exists for backwards compatibility reasons because\n                // bit-flag enum types sometimes look like literal enum types with numeric literal values.\n                if (s & (8 /* Number */ | 256 /* NumberLiteral */) && !(s & 1024 /* EnumLiteral */) && (t & 32 /* Enum */ || t & 256 /* NumberLiteral */ && t & 1024 /* EnumLiteral */))\n                    return true;\n            }\n            return false;\n        }\n        function isTypeRelatedTo(source, target, relation) {\n            if (isFreshLiteralType(source)) {\n                source = source.regularType;\n            }\n            if (isFreshLiteralType(target)) {\n                target = target.regularType;\n            }\n            if (source === target) {\n                return true;\n            }\n            if (relation !== identityRelation) {\n                if (relation === comparableRelation && !(target.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target, source, relation) || isSimpleTypeRelatedTo(source, target, relation)) {\n                    return true;\n                }\n            }\n            else {\n                if (!(source.flags & 3145728 /* UnionOrIntersection */) && !(target.flags & 3145728 /* UnionOrIntersection */) &&\n                    source.flags !== target.flags && !(source.flags & 469237760 /* Substructure */))\n                    return false;\n            }\n            if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {\n                var related = relation.get(getRelationKey(source, target, 0 /* None */, relation));\n                if (related !== undefined) {\n                    return !!(related & 1 /* Succeeded */);\n                }\n            }\n            if (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */) {\n                return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined);\n            }\n            return false;\n        }\n        function isIgnoredJsxProperty(source, sourceProp) {\n            return ts.getObjectFlags(source) & 4096 /* JsxAttributes */ && !isUnhyphenatedJsxName(sourceProp.escapedName);\n        }\n        function getNormalizedType(type, writing) {\n            while (true) {\n                var t = isFreshLiteralType(type) ? type.regularType :\n                    ts.getObjectFlags(type) & 4 /* Reference */ && type.node ? createTypeReference(type.target, getTypeArguments(type)) :\n                        type.flags & 3145728 /* UnionOrIntersection */ ? getReducedType(type) :\n                            type.flags & 33554432 /* Substitution */ ? writing ? type.baseType : type.substitute :\n                                type.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(type, writing) :\n                                    type;\n                if (t === type)\n                    break;\n                type = t;\n            }\n            return type;\n        }\n        /**\n         * Checks if 'source' is related to 'target' (e.g.: is a assignable to).\n         * @param source The left-hand-side of the relation.\n         * @param target The right-hand-side of the relation.\n         * @param relation The relation considered. One of 'identityRelation', 'subtypeRelation', 'assignableRelation', or 'comparableRelation'.\n         * Used as both to determine which checks are performed and as a cache of previously computed results.\n         * @param errorNode The suggested node upon which all errors will be reported, if defined. This may or may not be the actual node used.\n         * @param headMessage If the error chain should be prepended by a head message, then headMessage will be used.\n         * @param containingMessageChain A chain of errors to prepend any new errors found.\n         * @param errorOutputContainer Return the diagnostic. Do not log if 'skipLogging' is truthy.\n         */\n        function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer) {\n            var errorInfo;\n            var relatedInfo;\n            var maybeKeys;\n            var sourceStack;\n            var targetStack;\n            var maybeCount = 0;\n            var depth = 0;\n            var expandingFlags = 0 /* None */;\n            var overflow = false;\n            var overrideNextErrorInfo = 0; // How many `reportRelationError` calls should be skipped in the elaboration pyramid\n            var lastSkippedInfo;\n            var incompatibleStack = [];\n            var inPropertyCheck = false;\n            ts.Debug.assert(relation !== identityRelation || !errorNode, \"no error reporting in identity checking\");\n            var result = isRelatedTo(source, target, /*reportErrors*/ !!errorNode, headMessage);\n            if (incompatibleStack.length) {\n                reportIncompatibleStack();\n            }\n            if (overflow) {\n                ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant(\"checkTypes\" /* CheckTypes */, \"checkTypeRelatedTo_DepthLimit\", { sourceId: source.id, targetId: target.id, depth: depth });\n                var diag = error(errorNode || currentNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target));\n                if (errorOutputContainer) {\n                    (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);\n                }\n            }\n            else if (errorInfo) {\n                if (containingMessageChain) {\n                    var chain = containingMessageChain();\n                    if (chain) {\n                        ts.concatenateDiagnosticMessageChains(chain, errorInfo);\n                        errorInfo = chain;\n                    }\n                }\n                var relatedInformation = void 0;\n                // Check if we should issue an extra diagnostic to produce a quickfix for a slightly incorrect import statement\n                if (headMessage && errorNode && !result && source.symbol) {\n                    var links = getSymbolLinks(source.symbol);\n                    if (links.originatingImport && !ts.isImportCall(links.originatingImport)) {\n                        var helpfulRetry = checkTypeRelatedTo(getTypeOfSymbol(links.target), target, relation, /*errorNode*/ undefined);\n                        if (helpfulRetry) {\n                            // Likely an incorrect import. Issue a helpful diagnostic to produce a quickfix to change the import\n                            var diag_1 = ts.createDiagnosticForNode(links.originatingImport, ts.Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead);\n                            relatedInformation = ts.append(relatedInformation, diag_1); // Cause the error to appear with the error that triggered it\n                        }\n                    }\n                }\n                var diag = ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, relatedInformation);\n                if (relatedInfo) {\n                    ts.addRelatedInfo.apply(void 0, __spreadArray([diag], relatedInfo));\n                }\n                if (errorOutputContainer) {\n                    (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);\n                }\n                if (!errorOutputContainer || !errorOutputContainer.skipLogging) {\n                    diagnostics.add(diag);\n                }\n            }\n            if (errorNode && errorOutputContainer && errorOutputContainer.skipLogging && result === 0 /* False */) {\n                ts.Debug.assert(!!errorOutputContainer.errors, \"missed opportunity to interact with error.\");\n            }\n            return result !== 0 /* False */;\n            function resetErrorInfo(saved) {\n                errorInfo = saved.errorInfo;\n                lastSkippedInfo = saved.lastSkippedInfo;\n                incompatibleStack = saved.incompatibleStack;\n                overrideNextErrorInfo = saved.overrideNextErrorInfo;\n                relatedInfo = saved.relatedInfo;\n            }\n            function captureErrorCalculationState() {\n                return {\n                    errorInfo: errorInfo,\n                    lastSkippedInfo: lastSkippedInfo,\n                    incompatibleStack: incompatibleStack.slice(),\n                    overrideNextErrorInfo: overrideNextErrorInfo,\n                    relatedInfo: !relatedInfo ? undefined : relatedInfo.slice()\n                };\n            }\n            function reportIncompatibleError(message, arg0, arg1, arg2, arg3) {\n                overrideNextErrorInfo++; // Suppress the next relation error\n                lastSkippedInfo = undefined; // Reset skipped info cache\n                incompatibleStack.push([message, arg0, arg1, arg2, arg3]);\n            }\n            function reportIncompatibleStack() {\n                var stack = incompatibleStack;\n                incompatibleStack = [];\n                var info = lastSkippedInfo;\n                lastSkippedInfo = undefined;\n                if (stack.length === 1) {\n                    reportError.apply(void 0, stack[0]);\n                    if (info) {\n                        // Actually do the last relation error\n                        reportRelationError.apply(void 0, __spreadArray([/*headMessage*/ undefined], info));\n                    }\n                    return;\n                }\n                // The first error will be the innermost, while the last will be the outermost - so by popping off the end,\n                // we can build from left to right\n                var path = \"\";\n                var secondaryRootErrors = [];\n                while (stack.length) {\n                    var _a = stack.pop(), msg = _a[0], args = _a.slice(1);\n                    switch (msg.code) {\n                        case ts.Diagnostics.Types_of_property_0_are_incompatible.code: {\n                            // Parenthesize a `new` if there is one\n                            if (path.indexOf(\"new \") === 0) {\n                                path = \"(\" + path + \")\";\n                            }\n                            var str = \"\" + args[0];\n                            // If leading, just print back the arg (irrespective of if it's a valid identifier)\n                            if (path.length === 0) {\n                                path = \"\" + str;\n                            }\n                            // Otherwise write a dotted name if possible\n                            else if (ts.isIdentifierText(str, compilerOptions.target)) {\n                                path = path + \".\" + str;\n                            }\n                            // Failing that, check if the name is already a computed name\n                            else if (str[0] === \"[\" && str[str.length - 1] === \"]\") {\n                                path = \"\" + path + str;\n                            }\n                            // And finally write out a computed name as a last resort\n                            else {\n                                path = path + \"[\" + str + \"]\";\n                            }\n                            break;\n                        }\n                        case ts.Diagnostics.Call_signature_return_types_0_and_1_are_incompatible.code:\n                        case ts.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible.code:\n                        case ts.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code:\n                        case ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code: {\n                            if (path.length === 0) {\n                                // Don't flatten signature compatability errors at the start of a chain - instead prefer\n                                // to unify (the with no arguments bit is excessive for printback) and print them back\n                                var mappedMsg = msg;\n                                if (msg.code === ts.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code) {\n                                    mappedMsg = ts.Diagnostics.Call_signature_return_types_0_and_1_are_incompatible;\n                                }\n                                else if (msg.code === ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code) {\n                                    mappedMsg = ts.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible;\n                                }\n                                secondaryRootErrors.unshift([mappedMsg, args[0], args[1]]);\n                            }\n                            else {\n                                var prefix = (msg.code === ts.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible.code ||\n                                    msg.code === ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code)\n                                    ? \"new \"\n                                    : \"\";\n                                var params = (msg.code === ts.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code ||\n                                    msg.code === ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code)\n                                    ? \"\"\n                                    : \"...\";\n                                path = \"\" + prefix + path + \"(\" + params + \")\";\n                            }\n                            break;\n                        }\n                        default:\n                            return ts.Debug.fail(\"Unhandled Diagnostic: \" + msg.code);\n                    }\n                }\n                if (path) {\n                    reportError(path[path.length - 1] === \")\"\n                        ? ts.Diagnostics.The_types_returned_by_0_are_incompatible_between_these_types\n                        : ts.Diagnostics.The_types_of_0_are_incompatible_between_these_types, path);\n                }\n                else {\n                    // Remove the innermost secondary error as it will duplicate the error already reported by `reportRelationError` on entry\n                    secondaryRootErrors.shift();\n                }\n                for (var _i = 0, secondaryRootErrors_1 = secondaryRootErrors; _i < secondaryRootErrors_1.length; _i++) {\n                    var _b = secondaryRootErrors_1[_i], msg = _b[0], args = _b.slice(1);\n                    var originalValue = msg.elidedInCompatabilityPyramid;\n                    msg.elidedInCompatabilityPyramid = false; // Temporarily override elision to ensure error is reported\n                    reportError.apply(void 0, __spreadArray([msg], args));\n                    msg.elidedInCompatabilityPyramid = originalValue;\n                }\n                if (info) {\n                    // Actually do the last relation error\n                    reportRelationError.apply(void 0, __spreadArray([/*headMessage*/ undefined], info));\n                }\n            }\n            function reportError(message, arg0, arg1, arg2, arg3) {\n                ts.Debug.assert(!!errorNode);\n                if (incompatibleStack.length)\n                    reportIncompatibleStack();\n                if (message.elidedInCompatabilityPyramid)\n                    return;\n                errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2, arg3);\n            }\n            function associateRelatedInfo(info) {\n                ts.Debug.assert(!!errorInfo);\n                if (!relatedInfo) {\n                    relatedInfo = [info];\n                }\n                else {\n                    relatedInfo.push(info);\n                }\n            }\n            function reportRelationError(message, source, target) {\n                if (incompatibleStack.length)\n                    reportIncompatibleStack();\n                var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1];\n                var generalizedSource = source;\n                var generalizedSourceType = sourceType;\n                if (isLiteralType(source) && !typeCouldHaveTopLevelSingletonTypes(target)) {\n                    generalizedSource = getBaseTypeOfLiteralType(source);\n                    ts.Debug.assert(!isTypeAssignableTo(generalizedSource, target), \"generalized source shouldn't be assignable\");\n                    generalizedSourceType = getTypeNameForErrorDisplay(generalizedSource);\n                }\n                if (target.flags & 262144 /* TypeParameter */) {\n                    var constraint = getBaseConstraintOfType(target);\n                    var needsOriginalSource = void 0;\n                    if (constraint && (isTypeAssignableTo(generalizedSource, constraint) || (needsOriginalSource = isTypeAssignableTo(source, constraint)))) {\n                        reportError(ts.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, needsOriginalSource ? sourceType : generalizedSourceType, targetType, typeToString(constraint));\n                    }\n                    else {\n                        reportError(ts.Diagnostics._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1, targetType, generalizedSourceType);\n                    }\n                }\n                if (!message) {\n                    if (relation === comparableRelation) {\n                        message = ts.Diagnostics.Type_0_is_not_comparable_to_type_1;\n                    }\n                    else if (sourceType === targetType) {\n                        message = ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated;\n                    }\n                    else {\n                        message = ts.Diagnostics.Type_0_is_not_assignable_to_type_1;\n                    }\n                }\n                reportError(message, generalizedSourceType, targetType);\n            }\n            function tryElaborateErrorsForPrimitivesAndObjects(source, target) {\n                var sourceType = symbolValueDeclarationIsContextSensitive(source.symbol) ? typeToString(source, source.symbol.valueDeclaration) : typeToString(source);\n                var targetType = symbolValueDeclarationIsContextSensitive(target.symbol) ? typeToString(target, target.symbol.valueDeclaration) : typeToString(target);\n                if ((globalStringType === source && stringType === target) ||\n                    (globalNumberType === source && numberType === target) ||\n                    (globalBooleanType === source && booleanType === target) ||\n                    (getGlobalESSymbolType(/*reportErrors*/ false) === source && esSymbolType === target)) {\n                    reportError(ts.Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible, targetType, sourceType);\n                }\n            }\n            /**\n             * Try and elaborate array and tuple errors. Returns false\n             * if we have found an elaboration, or we should ignore\n             * any other elaborations when relating the `source` and\n             * `target` types.\n             */\n            function tryElaborateArrayLikeErrors(source, target, reportErrors) {\n                /**\n                 * The spec for elaboration is:\n                 * - If the source is a readonly tuple and the target is a mutable array or tuple, elaborate on mutability and skip property elaborations.\n                 * - If the source is a tuple then skip property elaborations if the target is an array or tuple.\n                 * - If the source is a readonly array and the target is a mutable array or tuple, elaborate on mutability and skip property elaborations.\n                 * - If the source an array then skip property elaborations if the target is a tuple.\n                 */\n                if (isTupleType(source)) {\n                    if (source.target.readonly && isMutableArrayOrTuple(target)) {\n                        if (reportErrors) {\n                            reportError(ts.Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1, typeToString(source), typeToString(target));\n                        }\n                        return false;\n                    }\n                    return isTupleType(target) || isArrayType(target);\n                }\n                if (isReadonlyArrayType(source) && isMutableArrayOrTuple(target)) {\n                    if (reportErrors) {\n                        reportError(ts.Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1, typeToString(source), typeToString(target));\n                    }\n                    return false;\n                }\n                if (isTupleType(target)) {\n                    return isArrayType(source);\n                }\n                return true;\n            }\n            /**\n             * Compare two types and return\n             * * Ternary.True if they are related with no assumptions,\n             * * Ternary.Maybe if they are related with assumptions of other relationships, or\n             * * Ternary.False if they are not related.\n             */\n            function isRelatedTo(originalSource, originalTarget, reportErrors, headMessage, intersectionState) {\n                if (reportErrors === void 0) { reportErrors = false; }\n                if (intersectionState === void 0) { intersectionState = 0 /* None */; }\n                // Before normalization: if `source` is type an object type, and `target` is primitive,\n                // skip all the checks we don't need and just return `isSimpleTypeRelatedTo` result\n                if (originalSource.flags & 524288 /* Object */ && originalTarget.flags & 131068 /* Primitive */) {\n                    if (isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors ? reportError : undefined)) {\n                        return -1 /* True */;\n                    }\n                    reportErrorResults(originalSource, originalTarget, 0 /* False */, !!(ts.getObjectFlags(originalSource) & 4096 /* JsxAttributes */));\n                    return 0 /* False */;\n                }\n                // Normalize the source and target types: Turn fresh literal types into regular literal types,\n                // turn deferred type references into regular type references, simplify indexed access and\n                // conditional types, and resolve substitution types to either the substitution (on the source\n                // side) or the type variable (on the target side).\n                var source = getNormalizedType(originalSource, /*writing*/ false);\n                var target = getNormalizedType(originalTarget, /*writing*/ true);\n                if (source === target)\n                    return -1 /* True */;\n                if (relation === identityRelation) {\n                    return isIdenticalTo(source, target);\n                }\n                // We fastpath comparing a type parameter to exactly its constraint, as this is _super_ common,\n                // and otherwise, for type parameters in large unions, causes us to need to compare the union to itself,\n                // as we break down the _target_ union first, _then_ get the source constraint - so for every\n                // member of the target, we attempt to find a match in the source. This avoids that in cases where\n                // the target is exactly the constraint.\n                if (source.flags & 262144 /* TypeParameter */ && getConstraintOfType(source) === target) {\n                    return -1 /* True */;\n                }\n                // Try to see if we're relating something like `Foo` -> `Bar | null | undefined`.\n                // If so, reporting the `null` and `undefined` in the type is hardly useful.\n                // First, see if we're even relating an object type to a union.\n                // Then see if the target is stripped down to a single non-union type.\n                // Note\n                //  * We actually want to remove null and undefined naively here (rather than using getNonNullableType),\n                //    since we don't want to end up with a worse error like \"`Foo` is not assignable to `NonNullable<T>`\"\n                //    when dealing with generics.\n                //  * We also don't deal with primitive source types, since we already halt elaboration below.\n                if (target.flags & 1048576 /* Union */ && source.flags & 524288 /* Object */ &&\n                    target.types.length <= 3 && maybeTypeOfKind(target, 98304 /* Nullable */)) {\n                    var nullStrippedTarget = extractTypesOfKind(target, ~98304 /* Nullable */);\n                    if (!(nullStrippedTarget.flags & (1048576 /* Union */ | 131072 /* Never */))) {\n                        if (source === nullStrippedTarget)\n                            return -1 /* True */;\n                        target = nullStrippedTarget;\n                    }\n                }\n                if (relation === comparableRelation && !(target.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target, source, relation) ||\n                    isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))\n                    return -1 /* True */;\n                var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */);\n                var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 32768 /* FreshLiteral */);\n                if (isPerformingExcessPropertyChecks) {\n                    if (hasExcessProperties(source, target, reportErrors)) {\n                        if (reportErrors) {\n                            reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);\n                        }\n                        return 0 /* False */;\n                    }\n                }\n                var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2 /* Target */) &&\n                    source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&\n                    target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&\n                    (getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));\n                if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {\n                    if (reportErrors) {\n                        var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);\n                        var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);\n                        var calls = getSignaturesOfType(source, 0 /* Call */);\n                        var constructs = getSignaturesOfType(source, 1 /* Construct */);\n                        if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, /*reportErrors*/ false) ||\n                            constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, /*reportErrors*/ false)) {\n                            reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);\n                        }\n                        else {\n                            reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);\n                        }\n                    }\n                    return 0 /* False */;\n                }\n                traceUnionsOrIntersectionsTooLarge(source, target);\n                var result = 0 /* False */;\n                var saveErrorInfo = captureErrorCalculationState();\n                // Note that these checks are specifically ordered to produce correct results. In particular,\n                // we need to deconstruct unions before intersections (because unions are always at the top),\n                // and we need to handle \"each\" relations before \"some\" relations for the same kind of type.\n                if (source.flags & 3145728 /* UnionOrIntersection */ || target.flags & 3145728 /* UnionOrIntersection */) {\n                    result = getConstituentCount(source) * getConstituentCount(target) >= 4 ?\n                        recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */) :\n                        structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);\n                }\n                if (!result && !(source.flags & 1048576 /* Union */) && (source.flags & (469499904 /* StructuredOrInstantiable */) || target.flags & 469499904 /* StructuredOrInstantiable */)) {\n                    if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) {\n                        resetErrorInfo(saveErrorInfo);\n                    }\n                }\n                if (!result && source.flags & (2097152 /* Intersection */ | 262144 /* TypeParameter */)) {\n                    // The combined constraint of an intersection type is the intersection of the constraints of\n                    // the constituents. When an intersection type contains instantiable types with union type\n                    // constraints, there are situations where we need to examine the combined constraint. One is\n                    // when the target is a union type. Another is when the intersection contains types belonging\n                    // to one of the disjoint domains. For example, given type variables T and U, each with the\n                    // constraint 'string | number', the combined constraint of 'T & U' is 'string | number' and\n                    // we need to check this constraint against a union on the target side. Also, given a type\n                    // variable V constrained to 'string | number', 'V & number' has a combined constraint of\n                    // 'string & number | number & number' which reduces to just 'number'.\n                    // This also handles type parameters, as a type parameter with a union constraint compared against a union\n                    // needs to have its constraint hoisted into an intersection with said type parameter, this way\n                    // the type param can be compared with itself in the target (with the influence of its constraint to match other parts)\n                    // For example, if `T extends 1 | 2` and `U extends 2 | 3` and we compare `T & U` to `T & U & (1 | 2 | 3)`\n                    var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 /* Intersection */ ? source.types : [source], !!(target.flags & 1048576 /* Union */));\n                    if (constraint && (source.flags & 2097152 /* Intersection */ || target.flags & 1048576 /* Union */)) {\n                        if (everyType(constraint, function (c) { return c !== source; })) { // Skip comparison if expansion contains the source itself\n                            // TODO: Stack errors so we get a pyramid for the \"normal\" comparison above, _and_ a second for this\n                            if (result = isRelatedTo(constraint, target, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {\n                                resetErrorInfo(saveErrorInfo);\n                            }\n                        }\n                    }\n                }\n                // For certain combinations involving intersections and optional, excess, or mismatched properties we need\n                // an extra property check where the intersection is viewed as a single object. The following are motivating\n                // examples that all should be errors, but aren't without this extra property check:\n                //\n                //   let obj: { a: { x: string } } & { c: number } = { a: { x: 'hello', y: 2 }, c: 5 };  // Nested excess property\n                //\n                //   declare let wrong: { a: { y: string } };\n                //   let weak: { a?: { x?: number } } & { c?: string } = wrong;  // Nested weak object type\n                //\n                //   function foo<T extends object>(x: { a?: string }, y: T & { a: boolean }) {\n                //     x = y;  // Mismatched property in source intersection\n                //   }\n                //\n                // We suppress recursive intersection property checks because they can generate lots of work when relating\n                // recursive intersections that are structurally similar but not exactly identical. See #37854.\n                if (result && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||\n                    isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 2097152 /* NonInferrableType */); }))) {\n                    inPropertyCheck = true;\n                    result &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */);\n                    inPropertyCheck = false;\n                }\n                reportErrorResults(source, target, result, isComparingJsxAttributes);\n                return result;\n                function reportErrorResults(source, target, result, isComparingJsxAttributes) {\n                    if (!result && reportErrors) {\n                        source = originalSource.aliasSymbol ? originalSource : source;\n                        target = originalTarget.aliasSymbol ? originalTarget : target;\n                        var maybeSuppress = overrideNextErrorInfo > 0;\n                        if (maybeSuppress) {\n                            overrideNextErrorInfo--;\n                        }\n                        if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {\n                            var currentError = errorInfo;\n                            tryElaborateArrayLikeErrors(source, target, reportErrors);\n                            if (errorInfo !== currentError) {\n                                maybeSuppress = !!errorInfo;\n                            }\n                        }\n                        if (source.flags & 524288 /* Object */ && target.flags & 131068 /* Primitive */) {\n                            tryElaborateErrorsForPrimitivesAndObjects(source, target);\n                        }\n                        else if (source.symbol && source.flags & 524288 /* Object */ && globalObjectType === source) {\n                            reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);\n                        }\n                        else if (isComparingJsxAttributes && target.flags & 2097152 /* Intersection */) {\n                            var targetTypes = target.types;\n                            var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);\n                            var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);\n                            if (intrinsicAttributes !== errorType && intrinsicClassAttributes !== errorType &&\n                                (ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {\n                                // do not report top error\n                                return result;\n                            }\n                        }\n                        else {\n                            errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);\n                        }\n                        if (!headMessage && maybeSuppress) {\n                            lastSkippedInfo = [source, target];\n                            // Used by, eg, missing property checking to replace the top-level message with a more informative one\n                            return result;\n                        }\n                        reportRelationError(headMessage, source, target);\n                    }\n                }\n            }\n            function traceUnionsOrIntersectionsTooLarge(source, target) {\n                if (!ts.tracing) {\n                    return;\n                }\n                if ((source.flags & 3145728 /* UnionOrIntersection */) && (target.flags & 3145728 /* UnionOrIntersection */)) {\n                    var sourceUnionOrIntersection = source;\n                    var targetUnionOrIntersection = target;\n                    if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 262144 /* PrimitiveUnion */) {\n                        // There's a fast path for comparing primitive unions\n                        return;\n                    }\n                    var sourceSize = sourceUnionOrIntersection.types.length;\n                    var targetSize = targetUnionOrIntersection.types.length;\n                    if (sourceSize * targetSize > 1E6) {\n                        ts.tracing.instant(\"checkTypes\" /* CheckTypes */, \"traceUnionsOrIntersectionsTooLarge_DepthLimit\", {\n                            sourceId: source.id,\n                            sourceSize: sourceSize,\n                            targetId: target.id,\n                            targetSize: targetSize,\n                            pos: errorNode === null || errorNode === void 0 ? void 0 : errorNode.pos,\n                            end: errorNode === null || errorNode === void 0 ? void 0 : errorNode.end\n                        });\n                    }\n                }\n            }\n            function isIdenticalTo(source, target) {\n                var flags = source.flags & target.flags;\n                if (!(flags & 469237760 /* Substructure */)) {\n                    return 0 /* False */;\n                }\n                traceUnionsOrIntersectionsTooLarge(source, target);\n                if (flags & 3145728 /* UnionOrIntersection */) {\n                    var result_6 = eachTypeRelatedToSomeType(source, target);\n                    if (result_6) {\n                        result_6 &= eachTypeRelatedToSomeType(target, source);\n                    }\n                    return result_6;\n                }\n                return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false, 0 /* None */);\n            }\n            function getTypeOfPropertyInTypes(types, name) {\n                var appendPropType = function (propTypes, type) {\n                    type = getApparentType(type);\n                    var prop = type.flags & 3145728 /* UnionOrIntersection */ ? getPropertyOfUnionOrIntersectionType(type, name) : getPropertyOfObjectType(type, name);\n                    var propType = prop && getTypeOfSymbol(prop) || isNumericLiteralName(name) && getIndexTypeOfType(type, 1 /* Number */) || getIndexTypeOfType(type, 0 /* String */) || undefinedType;\n                    return ts.append(propTypes, propType);\n                };\n                return getUnionType(ts.reduceLeft(types, appendPropType, /*initial*/ undefined) || ts.emptyArray);\n            }\n            function hasExcessProperties(source, target, reportErrors) {\n                if (!isExcessPropertyCheckTarget(target) || !noImplicitAny && ts.getObjectFlags(target) & 16384 /* JSLiteral */) {\n                    return false; // Disable excess property checks on JS literals to simulate having an implicit \"index signature\" - but only outside of noImplicitAny\n                }\n                var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */);\n                if ((relation === assignableRelation || relation === comparableRelation) &&\n                    (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) {\n                    return false;\n                }\n                var reducedTarget = target;\n                var checkTypes;\n                if (target.flags & 1048576 /* Union */) {\n                    reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);\n                    checkTypes = reducedTarget.flags & 1048576 /* Union */ ? reducedTarget.types : [reducedTarget];\n                }\n                var _loop_16 = function (prop) {\n                    if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {\n                        if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {\n                            if (reportErrors) {\n                                // Report error in terms of object types in the target as those are the only ones\n                                // we check in isKnownProperty.\n                                var errorTarget = filterType(reducedTarget, isExcessPropertyCheckTarget);\n                                // We know *exactly* where things went wrong when comparing the types.\n                                // Use this property as the error node as this will be more helpful in\n                                // reasoning about what went wrong.\n                                if (!errorNode)\n                                    return { value: ts.Debug.fail() };\n                                if (ts.isJsxAttributes(errorNode) || ts.isJsxOpeningLikeElement(errorNode) || ts.isJsxOpeningLikeElement(errorNode.parent)) {\n                                    // JsxAttributes has an object-literal flag and undergo same type-assignablity check as normal object-literal.\n                                    // However, using an object-literal error message will be very confusing to the users so we give different a message.\n                                    if (prop.valueDeclaration && ts.isJsxAttribute(prop.valueDeclaration) && ts.getSourceFileOfNode(errorNode) === ts.getSourceFileOfNode(prop.valueDeclaration.name)) {\n                                        // Note that extraneous children (as in `<NoChild>extra</NoChild>`) don't pass this check,\n                                        // since `children` is a SyntaxKind.PropertySignature instead of a SyntaxKind.JsxAttribute.\n                                        errorNode = prop.valueDeclaration.name;\n                                    }\n                                    var propName = symbolToString(prop);\n                                    var suggestionSymbol = getSuggestedSymbolForNonexistentJSXAttribute(propName, errorTarget);\n                                    var suggestion = suggestionSymbol ? symbolToString(suggestionSymbol) : undefined;\n                                    if (suggestion) {\n                                        reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName, typeToString(errorTarget), suggestion);\n                                    }\n                                    else {\n                                        reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, propName, typeToString(errorTarget));\n                                    }\n                                }\n                                else {\n                                    // use the property's value declaration if the property is assigned inside the literal itself\n                                    var objectLiteralDeclaration_1 = source.symbol && ts.firstOrUndefined(source.symbol.declarations);\n                                    var suggestion = void 0;\n                                    if (prop.valueDeclaration && ts.findAncestor(prop.valueDeclaration, function (d) { return d === objectLiteralDeclaration_1; }) && ts.getSourceFileOfNode(objectLiteralDeclaration_1) === ts.getSourceFileOfNode(errorNode)) {\n                                        var propDeclaration = prop.valueDeclaration;\n                                        ts.Debug.assertNode(propDeclaration, ts.isObjectLiteralElementLike);\n                                        errorNode = propDeclaration;\n                                        var name = propDeclaration.name;\n                                        if (ts.isIdentifier(name)) {\n                                            suggestion = getSuggestionForNonexistentProperty(name, errorTarget);\n                                        }\n                                    }\n                                    if (suggestion !== undefined) {\n                                        reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2, symbolToString(prop), typeToString(errorTarget), suggestion);\n                                    }\n                                    else {\n                                        reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(errorTarget));\n                                    }\n                                }\n                            }\n                            return { value: true };\n                        }\n                        if (checkTypes && !isRelatedTo(getTypeOfSymbol(prop), getTypeOfPropertyInTypes(checkTypes, prop.escapedName), reportErrors)) {\n                            if (reportErrors) {\n                                reportIncompatibleError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(prop));\n                            }\n                            return { value: true };\n                        }\n                    }\n                };\n                for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {\n                    var prop = _a[_i];\n                    var state_5 = _loop_16(prop);\n                    if (typeof state_5 === \"object\")\n                        return state_5.value;\n                }\n                return false;\n            }\n            function shouldCheckAsExcessProperty(prop, container) {\n                return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration;\n            }\n            function eachTypeRelatedToSomeType(source, target) {\n                var result = -1 /* True */;\n                var sourceTypes = source.types;\n                for (var _i = 0, sourceTypes_1 = sourceTypes; _i < sourceTypes_1.length; _i++) {\n                    var sourceType = sourceTypes_1[_i];\n                    var related = typeRelatedToSomeType(sourceType, target, /*reportErrors*/ false);\n                    if (!related) {\n                        return 0 /* False */;\n                    }\n                    result &= related;\n                }\n                return result;\n            }\n            function typeRelatedToSomeType(source, target, reportErrors) {\n                var targetTypes = target.types;\n                if (target.flags & 1048576 /* Union */ && containsType(targetTypes, source)) {\n                    return -1 /* True */;\n                }\n                for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) {\n                    var type = targetTypes_1[_i];\n                    var related = isRelatedTo(source, type, /*reportErrors*/ false);\n                    if (related) {\n                        return related;\n                    }\n                }\n                if (reportErrors) {\n                    var bestMatchingType = getBestMatchingType(source, target, isRelatedTo);\n                    isRelatedTo(source, bestMatchingType || targetTypes[targetTypes.length - 1], /*reportErrors*/ true);\n                }\n                return 0 /* False */;\n            }\n            function typeRelatedToEachType(source, target, reportErrors, intersectionState) {\n                var result = -1 /* True */;\n                var targetTypes = target.types;\n                for (var _i = 0, targetTypes_2 = targetTypes; _i < targetTypes_2.length; _i++) {\n                    var targetType = targetTypes_2[_i];\n                    var related = isRelatedTo(source, targetType, reportErrors, /*headMessage*/ undefined, intersectionState);\n                    if (!related) {\n                        return 0 /* False */;\n                    }\n                    result &= related;\n                }\n                return result;\n            }\n            function someTypeRelatedToType(source, target, reportErrors, intersectionState) {\n                var sourceTypes = source.types;\n                if (source.flags & 1048576 /* Union */ && containsType(sourceTypes, target)) {\n                    return -1 /* True */;\n                }\n                var len = sourceTypes.length;\n                for (var i = 0; i < len; i++) {\n                    var related = isRelatedTo(sourceTypes[i], target, reportErrors && i === len - 1, /*headMessage*/ undefined, intersectionState);\n                    if (related) {\n                        return related;\n                    }\n                }\n                return 0 /* False */;\n            }\n            function getUndefinedStrippedTargetIfNeeded(source, target) {\n                // As a builtin type, `undefined` is a very low type ID - making it almsot always first, making this a very fast check to see\n                // if we need to strip `undefined` from the target\n                if (source.flags & 1048576 /* Union */ && target.flags & 1048576 /* Union */ &&\n                    !(source.types[0].flags & 32768 /* Undefined */) && target.types[0].flags & 32768 /* Undefined */) {\n                    return extractTypesOfKind(target, ~32768 /* Undefined */);\n                }\n                return target;\n            }\n            function eachTypeRelatedToType(source, target, reportErrors, intersectionState) {\n                var result = -1 /* True */;\n                var sourceTypes = source.types;\n                // We strip `undefined` from the target if the `source` trivially doesn't contain it for our correspondence-checking fastpath\n                // since `undefined` is frequently added by optionality and would otherwise spoil a potentially useful correspondence\n                var undefinedStrippedTarget = getUndefinedStrippedTargetIfNeeded(source, target);\n                for (var i = 0; i < sourceTypes.length; i++) {\n                    var sourceType = sourceTypes[i];\n                    if (undefinedStrippedTarget.flags & 1048576 /* Union */ && sourceTypes.length >= undefinedStrippedTarget.types.length && sourceTypes.length % undefinedStrippedTarget.types.length === 0) {\n                        // many unions are mappings of one another; in such cases, simply comparing members at the same index can shortcut the comparison\n                        // such unions will have identical lengths, and their corresponding elements will match up. Another common scenario is where a large\n                        // union has a union of objects intersected with it. In such cases, if the input was, eg `(\"a\" | \"b\" | \"c\") & (string | boolean | {} | {whatever})`,\n                        // the result will have the structure `\"a\" | \"b\" | \"c\" | \"a\" & {} | \"b\" & {} | \"c\" & {} | \"a\" & {whatever} | \"b\" & {whatever} | \"c\" & {whatever}`\n                        // - the resulting union has a length which is a multiple of the original union, and the elements correspond modulo the length of the original union\n                        var related_1 = isRelatedTo(sourceType, undefinedStrippedTarget.types[i % undefinedStrippedTarget.types.length], /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState);\n                        if (related_1) {\n                            result &= related_1;\n                            continue;\n                        }\n                    }\n                    var related = isRelatedTo(sourceType, target, reportErrors, /*headMessage*/ undefined, intersectionState);\n                    if (!related) {\n                        return 0 /* False */;\n                    }\n                    result &= related;\n                }\n                return result;\n            }\n            function typeArgumentsRelatedTo(sources, targets, variances, reportErrors, intersectionState) {\n                if (sources === void 0) { sources = ts.emptyArray; }\n                if (targets === void 0) { targets = ts.emptyArray; }\n                if (variances === void 0) { variances = ts.emptyArray; }\n                if (sources.length !== targets.length && relation === identityRelation) {\n                    return 0 /* False */;\n                }\n                var length = sources.length <= targets.length ? sources.length : targets.length;\n                var result = -1 /* True */;\n                for (var i = 0; i < length; i++) {\n                    // When variance information isn't available we default to covariance. This happens\n                    // in the process of computing variance information for recursive types and when\n                    // comparing 'this' type arguments.\n                    var varianceFlags = i < variances.length ? variances[i] : 1 /* Covariant */;\n                    var variance = varianceFlags & 7 /* VarianceMask */;\n                    // We ignore arguments for independent type parameters (because they're never witnessed).\n                    if (variance !== 4 /* Independent */) {\n                        var s = sources[i];\n                        var t = targets[i];\n                        var related = -1 /* True */;\n                        if (varianceFlags & 8 /* Unmeasurable */) {\n                            // Even an `Unmeasurable` variance works out without a structural check if the source and target are _identical_.\n                            // We can't simply assume invariance, because `Unmeasurable` marks nonlinear relations, for example, a relation tained by\n                            // the `-?` modifier in a mapped type (where, no matter how the inputs are related, the outputs still might not be)\n                            related = relation === identityRelation ? isRelatedTo(s, t, /*reportErrors*/ false) : compareTypesIdentical(s, t);\n                        }\n                        else if (variance === 1 /* Covariant */) {\n                            related = isRelatedTo(s, t, reportErrors, /*headMessage*/ undefined, intersectionState);\n                        }\n                        else if (variance === 2 /* Contravariant */) {\n                            related = isRelatedTo(t, s, reportErrors, /*headMessage*/ undefined, intersectionState);\n                        }\n                        else if (variance === 3 /* Bivariant */) {\n                            // In the bivariant case we first compare contravariantly without reporting\n                            // errors. Then, if that doesn't succeed, we compare covariantly with error\n                            // reporting. Thus, error elaboration will be based on the the covariant check,\n                            // which is generally easier to reason about.\n                            related = isRelatedTo(t, s, /*reportErrors*/ false);\n                            if (!related) {\n                                related = isRelatedTo(s, t, reportErrors, /*headMessage*/ undefined, intersectionState);\n                            }\n                        }\n                        else {\n                            // In the invariant case we first compare covariantly, and only when that\n                            // succeeds do we proceed to compare contravariantly. Thus, error elaboration\n                            // will typically be based on the covariant check.\n                            related = isRelatedTo(s, t, reportErrors, /*headMessage*/ undefined, intersectionState);\n                            if (related) {\n                                related &= isRelatedTo(t, s, reportErrors, /*headMessage*/ undefined, intersectionState);\n                            }\n                        }\n                        if (!related) {\n                            return 0 /* False */;\n                        }\n                        result &= related;\n                    }\n                }\n                return result;\n            }\n            // Determine if possibly recursive types are related. First, check if the result is already available in the global cache.\n            // Second, check if we have already started a comparison of the given two types in which case we assume the result to be true.\n            // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are\n            // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion\n            // and issue an error. Otherwise, actually compare the structure of the two types.\n            function recursiveTypeRelatedTo(source, target, reportErrors, intersectionState) {\n                if (overflow) {\n                    return 0 /* False */;\n                }\n                var id = getRelationKey(source, target, intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0), relation);\n                var entry = relation.get(id);\n                if (entry !== undefined) {\n                    if (reportErrors && entry & 2 /* Failed */ && !(entry & 4 /* Reported */)) {\n                        // We are elaborating errors and the cached result is an unreported failure. The result will be reported\n                        // as a failure, and should be updated as a reported failure by the bottom of this function.\n                    }\n                    else {\n                        if (outofbandVarianceMarkerHandler) {\n                            // We're in the middle of variance checking - integrate any unmeasurable/unreliable flags from this cached component\n                            var saved = entry & 24 /* ReportsMask */;\n                            if (saved & 8 /* ReportsUnmeasurable */) {\n                                instantiateType(source, makeFunctionTypeMapper(reportUnmeasurableMarkers));\n                            }\n                            if (saved & 16 /* ReportsUnreliable */) {\n                                instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers));\n                            }\n                        }\n                        return entry & 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */;\n                    }\n                }\n                if (!maybeKeys) {\n                    maybeKeys = [];\n                    sourceStack = [];\n                    targetStack = [];\n                }\n                else {\n                    for (var i = 0; i < maybeCount; i++) {\n                        // If source and target are already being compared, consider them related with assumptions\n                        if (id === maybeKeys[i]) {\n                            return 3 /* Maybe */;\n                        }\n                    }\n                    if (depth === 100) {\n                        overflow = true;\n                        return 0 /* False */;\n                    }\n                }\n                var maybeStart = maybeCount;\n                maybeKeys[maybeCount] = id;\n                maybeCount++;\n                sourceStack[depth] = source;\n                targetStack[depth] = target;\n                depth++;\n                var saveExpandingFlags = expandingFlags;\n                if (!(expandingFlags & 1 /* Source */) && isDeeplyNestedType(source, sourceStack, depth))\n                    expandingFlags |= 1 /* Source */;\n                if (!(expandingFlags & 2 /* Target */) && isDeeplyNestedType(target, targetStack, depth))\n                    expandingFlags |= 2 /* Target */;\n                var originalHandler;\n                var propagatingVarianceFlags = 0;\n                if (outofbandVarianceMarkerHandler) {\n                    originalHandler = outofbandVarianceMarkerHandler;\n                    outofbandVarianceMarkerHandler = function (onlyUnreliable) {\n                        propagatingVarianceFlags |= onlyUnreliable ? 16 /* ReportsUnreliable */ : 8 /* ReportsUnmeasurable */;\n                        return originalHandler(onlyUnreliable);\n                    };\n                }\n                if (expandingFlags === 3 /* Both */) {\n                    ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant(\"checkTypes\" /* CheckTypes */, \"recursiveTypeRelatedTo_DepthLimit\", {\n                        sourceId: source.id,\n                        sourceIdStack: sourceStack.map(function (t) { return t.id; }),\n                        targetId: target.id,\n                        targetIdStack: targetStack.map(function (t) { return t.id; }),\n                        depth: depth,\n                    });\n                }\n                var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3 /* Maybe */;\n                if (outofbandVarianceMarkerHandler) {\n                    outofbandVarianceMarkerHandler = originalHandler;\n                }\n                expandingFlags = saveExpandingFlags;\n                depth--;\n                if (result) {\n                    if (result === -1 /* True */ || depth === 0) {\n                        if (result === -1 /* True */ || result === 3 /* Maybe */) {\n                            // If result is definitely true, record all maybe keys as having succeeded. Also, record Ternary.Maybe\n                            // results as having succeeded once we reach depth 0, but never record Ternary.Unknown results.\n                            for (var i = maybeStart; i < maybeCount; i++) {\n                                relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);\n                            }\n                        }\n                        maybeCount = maybeStart;\n                    }\n                }\n                else {\n                    // A false result goes straight into global cache (when something is false under\n                    // assumptions it will also be false without assumptions)\n                    relation.set(id, (reportErrors ? 4 /* Reported */ : 0) | 2 /* Failed */ | propagatingVarianceFlags);\n                    maybeCount = maybeStart;\n                }\n                return result;\n            }\n            function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {\n                ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"checkTypes\" /* CheckTypes */, \"structuredTypeRelatedTo\", { sourceId: source.id, targetId: target.id });\n                var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState);\n                ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n                return result;\n            }\n            function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) {\n                if (intersectionState & 4 /* PropertyCheck */) {\n                    return propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */);\n                }\n                if (intersectionState & 8 /* UnionIntersectionCheck */) {\n                    // Note that these checks are specifically ordered to produce correct results. In particular,\n                    // we need to deconstruct unions before intersections (because unions are always at the top),\n                    // and we need to handle \"each\" relations before \"some\" relations for the same kind of type.\n                    if (source.flags & 1048576 /* Union */) {\n                        return relation === comparableRelation ?\n                            someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & ~8 /* UnionIntersectionCheck */) :\n                            eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & ~8 /* UnionIntersectionCheck */);\n                    }\n                    if (target.flags & 1048576 /* Union */) {\n                        return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068 /* Primitive */) && !(target.flags & 131068 /* Primitive */));\n                    }\n                    if (target.flags & 2097152 /* Intersection */) {\n                        return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */);\n                    }\n                    // Source is an intersection. Check to see if any constituents of the intersection are immediately related\n                    // to the target.\n                    //\n                    // Don't report errors though. Checking whether a constituent is related to the source is not actually\n                    // useful and leads to some confusing error messages. Instead it is better to let the below checks\n                    // take care of this, or to not elaborate at all. For instance,\n                    //\n                    //    - For an object type (such as 'C = A & B'), users are usually more interested in structural errors.\n                    //\n                    //    - For a union type (such as '(A | B) = (C & D)'), it's better to hold onto the whole intersection\n                    //          than to report that 'D' is not assignable to 'A' or 'B'.\n                    //\n                    //    - For a primitive type or type parameter (such as 'number = A & B') there is no point in\n                    //          breaking the intersection apart.\n                    return someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */);\n                }\n                var flags = source.flags & target.flags;\n                if (relation === identityRelation && !(flags & 524288 /* Object */)) {\n                    if (flags & 4194304 /* Index */) {\n                        return isRelatedTo(source.type, target.type, /*reportErrors*/ false);\n                    }\n                    var result_7 = 0 /* False */;\n                    if (flags & 8388608 /* IndexedAccess */) {\n                        if (result_7 = isRelatedTo(source.objectType, target.objectType, /*reportErrors*/ false)) {\n                            if (result_7 &= isRelatedTo(source.indexType, target.indexType, /*reportErrors*/ false)) {\n                                return result_7;\n                            }\n                        }\n                    }\n                    if (flags & 16777216 /* Conditional */) {\n                        if (source.root.isDistributive === target.root.isDistributive) {\n                            if (result_7 = isRelatedTo(source.checkType, target.checkType, /*reportErrors*/ false)) {\n                                if (result_7 &= isRelatedTo(source.extendsType, target.extendsType, /*reportErrors*/ false)) {\n                                    if (result_7 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), /*reportErrors*/ false)) {\n                                        if (result_7 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), /*reportErrors*/ false)) {\n                                            return result_7;\n                                        }\n                                    }\n                                }\n                            }\n                        }\n                    }\n                    if (flags & 33554432 /* Substitution */) {\n                        return isRelatedTo(source.substitute, target.substitute, /*reportErrors*/ false);\n                    }\n                    return 0 /* False */;\n                }\n                var result;\n                var originalErrorInfo;\n                var varianceCheckFailed = false;\n                var saveErrorInfo = captureErrorCalculationState();\n                // We limit alias variance probing to only object and conditional types since their alias behavior\n                // is more predictable than other, interned types, which may or may not have an alias depending on\n                // the order in which things were checked.\n                if (source.flags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&\n                    source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol &&\n                    !(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {\n                    var variances = getAliasVariances(source.aliasSymbol);\n                    if (variances === ts.emptyArray) {\n                        return 1 /* Unknown */;\n                    }\n                    var varianceResult = relateVariances(source.aliasTypeArguments, target.aliasTypeArguments, variances, intersectionState);\n                    if (varianceResult !== undefined) {\n                        return varianceResult;\n                    }\n                }\n                // For a generic type T and a type U that is assignable to T, [...U] is assignable to T, U is assignable to readonly [...T],\n                // and U is assignable to [...T] when U is constrained to a mutable array or tuple type.\n                if (isSingleElementGenericTupleType(source) && !source.target.readonly && (result = isRelatedTo(getTypeArguments(source)[0], target)) ||\n                    isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0]))) {\n                    return result;\n                }\n                if (target.flags & 262144 /* TypeParameter */) {\n                    // A source type { [P in Q]: X } is related to a target type T if keyof T is related to Q and X is related to T[Q].\n                    if (ts.getObjectFlags(source) & 32 /* Mapped */ && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) {\n                        if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) {\n                            var templateType = getTemplateTypeFromMappedType(source);\n                            var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source));\n                            if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) {\n                                return result;\n                            }\n                        }\n                    }\n                }\n                else if (target.flags & 4194304 /* Index */) {\n                    var targetType = target.type;\n                    // A keyof S is related to a keyof T if T is related to S.\n                    if (source.flags & 4194304 /* Index */) {\n                        if (result = isRelatedTo(targetType, source.type, /*reportErrors*/ false)) {\n                            return result;\n                        }\n                    }\n                    if (isTupleType(targetType)) {\n                        // An index type can have a tuple type target when the tuple type contains variadic elements.\n                        // Check if the source is related to the known keys of the tuple type.\n                        if (result = isRelatedTo(source, getKnownKeysOfTupleType(targetType), reportErrors)) {\n                            return result;\n                        }\n                    }\n                    else {\n                        // A type S is assignable to keyof T if S is assignable to keyof C, where C is the\n                        // simplified form of T or, if T doesn't simplify, the constraint of T.\n                        var constraint = getSimplifiedTypeOrConstraint(targetType);\n                        if (constraint) {\n                            // We require Ternary.True here such that circular constraints don't cause\n                            // false positives. For example, given 'T extends { [K in keyof T]: string }',\n                            // 'keyof T' has itself as its constraint and produces a Ternary.Maybe when\n                            // related to other types.\n                            if (isRelatedTo(source, getIndexType(constraint, target.stringsOnly), reportErrors) === -1 /* True */) {\n                                return -1 /* True */;\n                            }\n                        }\n                    }\n                }\n                else if (target.flags & 8388608 /* IndexedAccess */) {\n                    // A type S is related to a type T[K] if S is related to C, where C is the base\n                    // constraint of T[K] for writing.\n                    if (relation === assignableRelation || relation === comparableRelation) {\n                        var objectType = target.objectType;\n                        var indexType = target.indexType;\n                        var baseObjectType = getBaseConstraintOfType(objectType) || objectType;\n                        var baseIndexType = getBaseConstraintOfType(indexType) || indexType;\n                        if (!isGenericObjectType(baseObjectType) && !isGenericIndexType(baseIndexType)) {\n                            var accessFlags = 2 /* Writing */ | (baseObjectType !== objectType ? 1 /* NoIndexSignatures */ : 0);\n                            var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, target.noUncheckedIndexedAccessCandidate, /*accessNode*/ undefined, accessFlags);\n                            if (constraint && (result = isRelatedTo(source, constraint, reportErrors))) {\n                                return result;\n                            }\n                        }\n                    }\n                }\n                else if (isGenericMappedType(target) && !target.declaration.nameType) {\n                    // A source type T is related to a target type { [P in X]: T[P] }\n                    var template = getTemplateTypeFromMappedType(target);\n                    var modifiers = getMappedTypeModifiers(target);\n                    if (!(modifiers & 8 /* ExcludeOptional */)) {\n                        if (template.flags & 8388608 /* IndexedAccess */ && template.objectType === source &&\n                            template.indexType === getTypeParameterFromMappedType(target)) {\n                            return -1 /* True */;\n                        }\n                        if (!isGenericMappedType(source)) {\n                            var targetConstraint = getConstraintTypeFromMappedType(target);\n                            var sourceKeys = getIndexType(source, /*stringsOnly*/ undefined, /*noIndexSignatures*/ true);\n                            var includeOptional = modifiers & 4 /* IncludeOptional */;\n                            var filteredByApplicability = includeOptional ? intersectTypes(targetConstraint, sourceKeys) : undefined;\n                            // A source type T is related to a target type { [P in Q]: X } if Q is related to keyof T and T[Q] is related to X.\n                            // A source type T is related to a target type { [P in Q]?: X } if some constituent Q' of Q is related to keyof T and T[Q'] is related to X.\n                            if (includeOptional\n                                ? !(filteredByApplicability.flags & 131072 /* Never */)\n                                : isRelatedTo(targetConstraint, sourceKeys)) {\n                                var templateType = getTemplateTypeFromMappedType(target);\n                                var typeParameter = getTypeParameterFromMappedType(target);\n                                // Fastpath: When the template has the form Obj[P] where P is the mapped type parameter, directly compare `source` with `Obj`\n                                // to avoid creating the (potentially very large) number of new intermediate types made by manufacturing `source[P]`\n                                var nonNullComponent = extractTypesOfKind(templateType, ~98304 /* Nullable */);\n                                if (nonNullComponent.flags & 8388608 /* IndexedAccess */ && nonNullComponent.indexType === typeParameter) {\n                                    if (result = isRelatedTo(source, nonNullComponent.objectType, reportErrors)) {\n                                        return result;\n                                    }\n                                }\n                                else {\n                                    var indexingType = filteredByApplicability ? getIntersectionType([filteredByApplicability, typeParameter]) : typeParameter;\n                                    var indexedAccessType = getIndexedAccessType(source, indexingType);\n                                    if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) {\n                                        return result;\n                                    }\n                                }\n                            }\n                            originalErrorInfo = errorInfo;\n                            resetErrorInfo(saveErrorInfo);\n                        }\n                    }\n                }\n                else if (target.flags & 134217728 /* TemplateLiteral */ && source.flags & 128 /* StringLiteral */) {\n                    if (isPatternLiteralType(target)) {\n                        // match all non-`string` segments\n                        var result_8 = inferLiteralsFromTemplateLiteralType(source, target);\n                        if (result_8 && ts.every(result_8, function (r, i) { return isStringLiteralTypeValueParsableAsType(r, target.types[i]); })) {\n                            return -1 /* True */;\n                        }\n                    }\n                }\n                if (source.flags & 8650752 /* TypeVariable */) {\n                    if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) {\n                        // A type S[K] is related to a type T[J] if S is related to T and K is related to J.\n                        if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) {\n                            result &= isRelatedTo(source.indexType, target.indexType, reportErrors);\n                        }\n                        if (result) {\n                            resetErrorInfo(saveErrorInfo);\n                            return result;\n                        }\n                    }\n                    else {\n                        var constraint = getConstraintOfType(source);\n                        if (!constraint || (source.flags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {\n                            // A type variable with no constraint is not related to the non-primitive object type.\n                            if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */))) {\n                                resetErrorInfo(saveErrorInfo);\n                                return result;\n                            }\n                        }\n                        // hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed\n                        else if (result = isRelatedTo(constraint, target, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {\n                            resetErrorInfo(saveErrorInfo);\n                            return result;\n                        }\n                        // slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example\n                        else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, reportErrors, /*headMessage*/ undefined, intersectionState)) {\n                            resetErrorInfo(saveErrorInfo);\n                            return result;\n                        }\n                    }\n                }\n                else if (source.flags & 4194304 /* Index */) {\n                    if (result = isRelatedTo(keyofConstraintType, target, reportErrors)) {\n                        resetErrorInfo(saveErrorInfo);\n                        return result;\n                    }\n                }\n                else if (source.flags & 134217728 /* TemplateLiteral */) {\n                    if (target.flags & 134217728 /* TemplateLiteral */ &&\n                        source.texts.length === target.texts.length &&\n                        source.types.length === target.types.length &&\n                        ts.every(source.texts, function (t, i) { return t === target.texts[i]; }) &&\n                        ts.every(instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)).types, function (t, i) { return !!(target.types[i].flags & (1 /* Any */ | 4 /* String */)) || !!isRelatedTo(t, target.types[i], /*reportErrors*/ false); })) {\n                        return -1 /* True */;\n                    }\n                    var constraint = getBaseConstraintOfType(source);\n                    if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, reportErrors))) {\n                        resetErrorInfo(saveErrorInfo);\n                        return result;\n                    }\n                }\n                else if (source.flags & 268435456 /* StringMapping */) {\n                    if (target.flags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {\n                        if (result = isRelatedTo(source.type, target.type, reportErrors)) {\n                            resetErrorInfo(saveErrorInfo);\n                            return result;\n                        }\n                    }\n                    else {\n                        var constraint = getBaseConstraintOfType(source);\n                        if (constraint && (result = isRelatedTo(constraint, target, reportErrors))) {\n                            resetErrorInfo(saveErrorInfo);\n                            return result;\n                        }\n                    }\n                }\n                else if (source.flags & 16777216 /* Conditional */) {\n                    if (target.flags & 16777216 /* Conditional */) {\n                        // Two conditional types 'T1 extends U1 ? X1 : Y1' and 'T2 extends U2 ? X2 : Y2' are related if\n                        // one of T1 and T2 is related to the other, U1 and U2 are identical types, X1 is related to X2,\n                        // and Y1 is related to Y2.\n                        var sourceParams = source.root.inferTypeParameters;\n                        var sourceExtends = source.extendsType;\n                        var mapper = void 0;\n                        if (sourceParams) {\n                            // If the source has infer type parameters, we instantiate them in the context of the target\n                            var ctx = createInferenceContext(sourceParams, /*signature*/ undefined, 0 /* None */, isRelatedTo);\n                            inferTypes(ctx.inferences, target.extendsType, sourceExtends, 256 /* NoConstraints */ | 512 /* AlwaysStrict */);\n                            sourceExtends = instantiateType(sourceExtends, ctx.mapper);\n                            mapper = ctx.mapper;\n                        }\n                        if (isTypeIdenticalTo(sourceExtends, target.extendsType) &&\n                            (isRelatedTo(source.checkType, target.checkType) || isRelatedTo(target.checkType, source.checkType))) {\n                            if (result = isRelatedTo(instantiateType(getTrueTypeFromConditionalType(source), mapper), getTrueTypeFromConditionalType(target), reportErrors)) {\n                                result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), reportErrors);\n                            }\n                            if (result) {\n                                resetErrorInfo(saveErrorInfo);\n                                return result;\n                            }\n                        }\n                    }\n                    else {\n                        // conditionals aren't related to one another via distributive constraint as it is much too inaccurate and allows way\n                        // more assignments than are desirable (since it maps the source check type to its constraint, it loses information)\n                        var distributiveConstraint = getConstraintOfDistributiveConditionalType(source);\n                        if (distributiveConstraint) {\n                            if (result = isRelatedTo(distributiveConstraint, target, reportErrors)) {\n                                resetErrorInfo(saveErrorInfo);\n                                return result;\n                            }\n                        }\n                    }\n                    // conditionals _can_ be related to one another via normal constraint, as, eg, `A extends B ? O : never` should be assignable to `O`\n                    // when `O` is a conditional (`never` is trivially aissgnable to `O`, as is `O`!).\n                    var defaultConstraint = getDefaultConstraintOfConditionalType(source);\n                    if (defaultConstraint) {\n                        if (result = isRelatedTo(defaultConstraint, target, reportErrors)) {\n                            resetErrorInfo(saveErrorInfo);\n                            return result;\n                        }\n                    }\n                }\n                else {\n                    // An empty object type is related to any mapped type that includes a '?' modifier.\n                    if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) {\n                        return -1 /* True */;\n                    }\n                    if (isGenericMappedType(target)) {\n                        if (isGenericMappedType(source)) {\n                            if (result = mappedTypeRelatedTo(source, target, reportErrors)) {\n                                resetErrorInfo(saveErrorInfo);\n                                return result;\n                            }\n                        }\n                        return 0 /* False */;\n                    }\n                    var sourceIsPrimitive = !!(source.flags & 131068 /* Primitive */);\n                    if (relation !== identityRelation) {\n                        source = getApparentType(source);\n                    }\n                    else if (isGenericMappedType(source)) {\n                        return 0 /* False */;\n                    }\n                    if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target &&\n                        !(ts.getObjectFlags(source) & 8192 /* MarkerType */ || ts.getObjectFlags(target) & 8192 /* MarkerType */)) {\n                        // We have type references to the same generic type, and the type references are not marker\n                        // type references (which are intended by be compared structurally). Obtain the variance\n                        // information for the type parameters and relate the type arguments accordingly.\n                        var variances = getVariances(source.target);\n                        // We return Ternary.Maybe for a recursive invocation of getVariances (signalled by emptyArray). This\n                        // effectively means we measure variance only from type parameter occurrences that aren't nested in\n                        // recursive instantiations of the generic type.\n                        if (variances === ts.emptyArray) {\n                            return 1 /* Unknown */;\n                        }\n                        var varianceResult = relateVariances(getTypeArguments(source), getTypeArguments(target), variances, intersectionState);\n                        if (varianceResult !== undefined) {\n                            return varianceResult;\n                        }\n                    }\n                    else if (isReadonlyArrayType(target) ? isArrayType(source) || isTupleType(source) : isArrayType(target) && isTupleType(source) && !source.target.readonly) {\n                        if (relation !== identityRelation) {\n                            return isRelatedTo(getIndexTypeOfType(source, 1 /* Number */) || anyType, getIndexTypeOfType(target, 1 /* Number */) || anyType, reportErrors);\n                        }\n                        else {\n                            // By flags alone, we know that the `target` is a readonly array while the source is a normal array or tuple\n                            // or `target` is an array and source is a tuple - in both cases the types cannot be identical, by construction\n                            return 0 /* False */;\n                        }\n                    }\n                    // Consider a fresh empty object literal type \"closed\" under the subtype relationship - this way `{} <- {[idx: string]: any} <- fresh({})`\n                    // and not `{} <- fresh({}) <- {[idx: string]: any}`\n                    else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target) && ts.getObjectFlags(target) & 32768 /* FreshLiteral */ && !isEmptyObjectType(source)) {\n                        return 0 /* False */;\n                    }\n                    // Even if relationship doesn't hold for unions, intersections, or generic type references,\n                    // it may hold in a structural comparison.\n                    // In a check of the form X = A & B, we will have previously checked if A relates to X or B relates\n                    // to X. Failing both of those we want to check if the aggregation of A and B's members structurally\n                    // relates to X. Thus, we include intersection types on the source side here.\n                    if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 524288 /* Object */) {\n                        // Report structural errors only if we haven't reported any errors yet\n                        var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo.errorInfo && !sourceIsPrimitive;\n                        result = propertiesRelatedTo(source, target, reportStructuralErrors, /*excludedProperties*/ undefined, intersectionState);\n                        if (result) {\n                            result &= signaturesRelatedTo(source, target, 0 /* Call */, reportStructuralErrors);\n                            if (result) {\n                                result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportStructuralErrors);\n                                if (result) {\n                                    result &= indexTypesRelatedTo(source, target, 0 /* String */, sourceIsPrimitive, reportStructuralErrors, intersectionState);\n                                    if (result) {\n                                        result &= indexTypesRelatedTo(source, target, 1 /* Number */, sourceIsPrimitive, reportStructuralErrors, intersectionState);\n                                    }\n                                }\n                            }\n                        }\n                        if (varianceCheckFailed && result) {\n                            errorInfo = originalErrorInfo || errorInfo || saveErrorInfo.errorInfo; // Use variance error (there is no structural one) and return false\n                        }\n                        else if (result) {\n                            return result;\n                        }\n                    }\n                    // If S is an object type and T is a discriminated union, S may be related to T if\n                    // there exists a constituent of T for every combination of the discriminants of S\n                    // with respect to T. We do not report errors here, as we will use the existing\n                    // error result from checking each constituent of the union.\n                    if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) {\n                        var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */);\n                        if (objectOnlyTarget.flags & 1048576 /* Union */) {\n                            var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);\n                            if (result_9) {\n                                return result_9;\n                            }\n                        }\n                    }\n                }\n                return 0 /* False */;\n                function relateVariances(sourceTypeArguments, targetTypeArguments, variances, intersectionState) {\n                    if (result = typeArgumentsRelatedTo(sourceTypeArguments, targetTypeArguments, variances, reportErrors, intersectionState)) {\n                        return result;\n                    }\n                    if (ts.some(variances, function (v) { return !!(v & 24 /* AllowsStructuralFallback */); })) {\n                        // If some type parameter was `Unmeasurable` or `Unreliable`, and we couldn't pass by assuming it was identical, then we\n                        // have to allow a structural fallback check\n                        // We elide the variance-based error elaborations, since those might not be too helpful, since we'll potentially\n                        // be assuming identity of the type parameter.\n                        originalErrorInfo = undefined;\n                        resetErrorInfo(saveErrorInfo);\n                        return undefined;\n                    }\n                    var allowStructuralFallback = targetTypeArguments && hasCovariantVoidArgument(targetTypeArguments, variances);\n                    varianceCheckFailed = !allowStructuralFallback;\n                    // The type arguments did not relate appropriately, but it may be because we have no variance\n                    // information (in which case typeArgumentsRelatedTo defaulted to covariance for all type\n                    // arguments). It might also be the case that the target type has a 'void' type argument for\n                    // a covariant type parameter that is only used in return positions within the generic type\n                    // (in which case any type argument is permitted on the source side). In those cases we proceed\n                    // with a structural comparison. Otherwise, we know for certain the instantiations aren't\n                    // related and we can return here.\n                    if (variances !== ts.emptyArray && !allowStructuralFallback) {\n                        // In some cases generic types that are covariant in regular type checking mode become\n                        // invariant in --strictFunctionTypes mode because one or more type parameters are used in\n                        // both co- and contravariant positions. In order to make it easier to diagnose *why* such\n                        // types are invariant, if any of the type parameters are invariant we reset the reported\n                        // errors and instead force a structural comparison (which will include elaborations that\n                        // reveal the reason).\n                        // We can switch on `reportErrors` here, since varianceCheckFailed guarantees we return `False`,\n                        // we can return `False` early here to skip calculating the structural error message we don't need.\n                        if (varianceCheckFailed && !(reportErrors && ts.some(variances, function (v) { return (v & 7 /* VarianceMask */) === 0 /* Invariant */; }))) {\n                            return 0 /* False */;\n                        }\n                        // We remember the original error information so we can restore it in case the structural\n                        // comparison unexpectedly succeeds. This can happen when the structural comparison result\n                        // is a Ternary.Maybe for example caused by the recursion depth limiter.\n                        originalErrorInfo = errorInfo;\n                        resetErrorInfo(saveErrorInfo);\n                    }\n                }\n            }\n            function reportUnmeasurableMarkers(p) {\n                if (outofbandVarianceMarkerHandler && (p === markerSuperType || p === markerSubType || p === markerOtherType)) {\n                    outofbandVarianceMarkerHandler(/*onlyUnreliable*/ false);\n                }\n                return p;\n            }\n            function reportUnreliableMarkers(p) {\n                if (outofbandVarianceMarkerHandler && (p === markerSuperType || p === markerSubType || p === markerOtherType)) {\n                    outofbandVarianceMarkerHandler(/*onlyUnreliable*/ true);\n                }\n                return p;\n            }\n            // A type [P in S]: X is related to a type [Q in T]: Y if T is related to S and X' is\n            // related to Y, where X' is an instantiation of X in which P is replaced with Q. Notice\n            // that S and T are contra-variant whereas X and Y are co-variant.\n            function mappedTypeRelatedTo(source, target, reportErrors) {\n                var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) :\n                    getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target));\n                if (modifiersRelated) {\n                    var result_10;\n                    var targetConstraint = getConstraintTypeFromMappedType(target);\n                    var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers));\n                    if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) {\n                        var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);\n                        if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) {\n                            return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors);\n                        }\n                    }\n                }\n                return 0 /* False */;\n            }\n            function typeRelatedToDiscriminatedType(source, target) {\n                // 1. Generate the combinations of discriminant properties & types 'source' can satisfy.\n                //    a. If the number of combinations is above a set limit, the comparison is too complex.\n                // 2. Filter 'target' to the subset of types whose discriminants exist in the matrix.\n                //    a. If 'target' does not satisfy all discriminants in the matrix, 'source' is not related.\n                // 3. For each type in the filtered 'target', determine if all non-discriminant properties of\n                //    'target' are related to a property in 'source'.\n                //\n                // NOTE: See ~/tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithDiscriminatedUnion.ts\n                //       for examples.\n                var sourceProperties = getPropertiesOfType(source);\n                var sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target);\n                if (!sourcePropertiesFiltered)\n                    return 0 /* False */;\n                // Though we could compute the number of combinations as we generate\n                // the matrix, this would incur additional memory overhead due to\n                // array allocations. To reduce this overhead, we first compute\n                // the number of combinations to ensure we will not surpass our\n                // fixed limit before incurring the cost of any allocations:\n                var numCombinations = 1;\n                for (var _i = 0, sourcePropertiesFiltered_1 = sourcePropertiesFiltered; _i < sourcePropertiesFiltered_1.length; _i++) {\n                    var sourceProperty = sourcePropertiesFiltered_1[_i];\n                    numCombinations *= countTypes(getTypeOfSymbol(sourceProperty));\n                    if (numCombinations > 25) {\n                        // We've reached the complexity limit.\n                        ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant(\"checkTypes\" /* CheckTypes */, \"typeRelatedToDiscriminatedType_DepthLimit\", { sourceId: source.id, targetId: target.id, numCombinations: numCombinations });\n                        return 0 /* False */;\n                    }\n                }\n                // Compute the set of types for each discriminant property.\n                var sourceDiscriminantTypes = new Array(sourcePropertiesFiltered.length);\n                var excludedProperties = new ts.Set();\n                for (var i = 0; i < sourcePropertiesFiltered.length; i++) {\n                    var sourceProperty = sourcePropertiesFiltered[i];\n                    var sourcePropertyType = getTypeOfSymbol(sourceProperty);\n                    sourceDiscriminantTypes[i] = sourcePropertyType.flags & 1048576 /* Union */\n                        ? sourcePropertyType.types\n                        : [sourcePropertyType];\n                    excludedProperties.add(sourceProperty.escapedName);\n                }\n                // Match each combination of the cartesian product of discriminant properties to one or more\n                // constituents of 'target'. If any combination does not have a match then 'source' is not relatable.\n                var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);\n                var matchingTypes = [];\n                var _loop_17 = function (combination) {\n                    var hasMatch = false;\n                    outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {\n                        var type = _d[_c];\n                        var _loop_18 = function (i) {\n                            var sourceProperty = sourcePropertiesFiltered[i];\n                            var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);\n                            if (!targetProperty)\n                                return \"continue-outer\";\n                            if (sourceProperty === targetProperty)\n                                return \"continue\";\n                            // We compare the source property to the target in the context of a single discriminant type.\n                            var related = propertyRelatedTo(source, target, sourceProperty, targetProperty, function (_) { return combination[i]; }, /*reportErrors*/ false, 0 /* None */, /*skipOptional*/ strictNullChecks || relation === comparableRelation);\n                            // If the target property could not be found, or if the properties were not related,\n                            // then this constituent is not a match.\n                            if (!related) {\n                                return \"continue-outer\";\n                            }\n                        };\n                        for (var i = 0; i < sourcePropertiesFiltered.length; i++) {\n                            var state_7 = _loop_18(i);\n                            switch (state_7) {\n                                case \"continue-outer\": continue outer;\n                            }\n                        }\n                        ts.pushIfUnique(matchingTypes, type, ts.equateValues);\n                        hasMatch = true;\n                    }\n                    if (!hasMatch) {\n                        return { value: 0 /* False */ };\n                    }\n                };\n                for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {\n                    var combination = discriminantCombinations_1[_a];\n                    var state_6 = _loop_17(combination);\n                    if (typeof state_6 === \"object\")\n                        return state_6.value;\n                }\n                // Compare the remaining non-discriminant properties of each match.\n                var result = -1 /* True */;\n                for (var _b = 0, matchingTypes_1 = matchingTypes; _b < matchingTypes_1.length; _b++) {\n                    var type = matchingTypes_1[_b];\n                    result &= propertiesRelatedTo(source, type, /*reportErrors*/ false, excludedProperties, 0 /* None */);\n                    if (result) {\n                        result &= signaturesRelatedTo(source, type, 0 /* Call */, /*reportStructuralErrors*/ false);\n                        if (result) {\n                            result &= signaturesRelatedTo(source, type, 1 /* Construct */, /*reportStructuralErrors*/ false);\n                            if (result) {\n                                result &= indexTypesRelatedTo(source, type, 0 /* String */, /*sourceIsPrimitive*/ false, /*reportStructuralErrors*/ false, 0 /* None */);\n                                // Comparing numeric index types when both `source` and `type` are tuples is unnecessary as the\n                                // element types should be sufficiently covered by `propertiesRelatedTo`. It also causes problems\n                                // with index type assignability as the types for the excluded discriminants are still included\n                                // in the index type.\n                                if (result && !(isTupleType(source) && isTupleType(type))) {\n                                    result &= indexTypesRelatedTo(source, type, 1 /* Number */, /*sourceIsPrimitive*/ false, /*reportStructuralErrors*/ false, 0 /* None */);\n                                }\n                            }\n                        }\n                    }\n                    if (!result) {\n                        return result;\n                    }\n                }\n                return result;\n            }\n            function excludeProperties(properties, excludedProperties) {\n                if (!excludedProperties || properties.length === 0)\n                    return properties;\n                var result;\n                for (var i = 0; i < properties.length; i++) {\n                    if (!excludedProperties.has(properties[i].escapedName)) {\n                        if (result) {\n                            result.push(properties[i]);\n                        }\n                    }\n                    else if (!result) {\n                        result = properties.slice(0, i);\n                    }\n                }\n                return result || properties;\n            }\n            function isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState) {\n                var targetIsOptional = strictNullChecks && !!(ts.getCheckFlags(targetProp) & 48 /* Partial */);\n                var source = getTypeOfSourceProperty(sourceProp);\n                if (ts.getCheckFlags(targetProp) & 65536 /* DeferredType */ && !getSymbolLinks(targetProp).type) {\n                    // Rather than resolving (and normalizing) the type, relate constituent-by-constituent without performing normalization or seconadary passes\n                    var links = getSymbolLinks(targetProp);\n                    ts.Debug.assertIsDefined(links.deferralParent);\n                    ts.Debug.assertIsDefined(links.deferralConstituents);\n                    var unionParent = !!(links.deferralParent.flags & 1048576 /* Union */);\n                    var result_11 = unionParent ? 0 /* False */ : -1 /* True */;\n                    var targetTypes = links.deferralConstituents;\n                    for (var _i = 0, targetTypes_3 = targetTypes; _i < targetTypes_3.length; _i++) {\n                        var targetType = targetTypes_3[_i];\n                        var related = isRelatedTo(source, targetType, /*reportErrors*/ false, /*headMessage*/ undefined, unionParent ? 0 : 2 /* Target */);\n                        if (!unionParent) {\n                            if (!related) {\n                                // Can't assign to a target individually - have to fallback to assigning to the _whole_ intersection (which forces normalization)\n                                return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors);\n                            }\n                            result_11 &= related;\n                        }\n                        else {\n                            if (related) {\n                                return related;\n                            }\n                        }\n                    }\n                    if (unionParent && !result_11 && targetIsOptional) {\n                        result_11 = isRelatedTo(source, undefinedType);\n                    }\n                    if (unionParent && !result_11 && reportErrors) {\n                        // The easiest way to get the right errors here is to un-defer (which may be costly)\n                        // If it turns out this is too costly too often, we can replicate the error handling logic within\n                        // typeRelatedToSomeType without the discriminatable type branch (as that requires a manifest union\n                        // type on which to hand discriminable properties, which we are expressly trying to avoid here)\n                        return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors);\n                    }\n                    return result_11;\n                }\n                else {\n                    return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors, /*headMessage*/ undefined, intersectionState);\n                }\n            }\n            function propertyRelatedTo(source, target, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState, skipOptional) {\n                var sourcePropFlags = ts.getDeclarationModifierFlagsFromSymbol(sourceProp);\n                var targetPropFlags = ts.getDeclarationModifierFlagsFromSymbol(targetProp);\n                if (sourcePropFlags & 8 /* Private */ || targetPropFlags & 8 /* Private */) {\n                    if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) {\n                        if (reportErrors) {\n                            if (sourcePropFlags & 8 /* Private */ && targetPropFlags & 8 /* Private */) {\n                                reportError(ts.Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp));\n                            }\n                            else {\n                                reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourcePropFlags & 8 /* Private */ ? source : target), typeToString(sourcePropFlags & 8 /* Private */ ? target : source));\n                            }\n                        }\n                        return 0 /* False */;\n                    }\n                }\n                else if (targetPropFlags & 16 /* Protected */) {\n                    if (!isValidOverrideOf(sourceProp, targetProp)) {\n                        if (reportErrors) {\n                            reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(getDeclaringClass(sourceProp) || source), typeToString(getDeclaringClass(targetProp) || target));\n                        }\n                        return 0 /* False */;\n                    }\n                }\n                else if (sourcePropFlags & 16 /* Protected */) {\n                    if (reportErrors) {\n                        reportError(ts.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target));\n                    }\n                    return 0 /* False */;\n                }\n                // If the target comes from a partial union prop, allow `undefined` in the target type\n                var related = isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState);\n                if (!related) {\n                    if (reportErrors) {\n                        reportIncompatibleError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp));\n                    }\n                    return 0 /* False */;\n                }\n                // When checking for comparability, be more lenient with optional properties.\n                if (!skipOptional && sourceProp.flags & 16777216 /* Optional */ && !(targetProp.flags & 16777216 /* Optional */)) {\n                    // TypeScript 1.0 spec (April 2014): 3.8.3\n                    // S is a subtype of a type T, and T is a supertype of S if ...\n                    // S' and T are object types and, for each member M in T..\n                    // M is a property and S' contains a property N where\n                    // if M is a required property, N is also a required property\n                    // (M - property in T)\n                    // (N - property in S)\n                    if (reportErrors) {\n                        reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target));\n                    }\n                    return 0 /* False */;\n                }\n                return related;\n            }\n            function reportUnmatchedProperty(source, target, unmatchedProperty, requireOptionalProperties) {\n                var shouldSkipElaboration = false;\n                // give specific error in case where private names have the same description\n                if (unmatchedProperty.valueDeclaration\n                    && ts.isNamedDeclaration(unmatchedProperty.valueDeclaration)\n                    && ts.isPrivateIdentifier(unmatchedProperty.valueDeclaration.name)\n                    && source.symbol\n                    && source.symbol.flags & 32 /* Class */) {\n                    var privateIdentifierDescription = unmatchedProperty.valueDeclaration.name.escapedText;\n                    var symbolTableKey = ts.getSymbolNameForPrivateIdentifier(source.symbol, privateIdentifierDescription);\n                    if (symbolTableKey && getPropertyOfType(source, symbolTableKey)) {\n                        var sourceName = ts.factory.getDeclarationName(source.symbol.valueDeclaration);\n                        var targetName = ts.factory.getDeclarationName(target.symbol.valueDeclaration);\n                        reportError(ts.Diagnostics.Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2, diagnosticName(privateIdentifierDescription), diagnosticName(sourceName.escapedText === \"\" ? anon : sourceName), diagnosticName(targetName.escapedText === \"\" ? anon : targetName));\n                        return;\n                    }\n                }\n                var props = ts.arrayFrom(getUnmatchedProperties(source, target, requireOptionalProperties, /*matchDiscriminantProperties*/ false));\n                if (!headMessage || (headMessage.code !== ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code &&\n                    headMessage.code !== ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code)) {\n                    shouldSkipElaboration = true; // Retain top-level error for interface implementing issues, otherwise omit it\n                }\n                if (props.length === 1) {\n                    var propName = symbolToString(unmatchedProperty);\n                    reportError.apply(void 0, __spreadArray([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target)));\n                    if (ts.length(unmatchedProperty.declarations)) {\n                        associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));\n                    }\n                    if (shouldSkipElaboration && errorInfo) {\n                        overrideNextErrorInfo++;\n                    }\n                }\n                else if (tryElaborateArrayLikeErrors(source, target, /*reportErrors*/ false)) {\n                    if (props.length > 5) { // arbitrary cutoff for too-long list form\n                        reportError(ts.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more, typeToString(source), typeToString(target), ts.map(props.slice(0, 4), function (p) { return symbolToString(p); }).join(\", \"), props.length - 4);\n                    }\n                    else {\n                        reportError(ts.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2, typeToString(source), typeToString(target), ts.map(props, function (p) { return symbolToString(p); }).join(\", \"));\n                    }\n                    if (shouldSkipElaboration && errorInfo) {\n                        overrideNextErrorInfo++;\n                    }\n                }\n                // No array like or unmatched property error - just issue top level error (errorInfo = undefined)\n            }\n            function propertiesRelatedTo(source, target, reportErrors, excludedProperties, intersectionState) {\n                if (relation === identityRelation) {\n                    return propertiesIdenticalTo(source, target, excludedProperties);\n                }\n                var result = -1 /* True */;\n                if (isTupleType(target)) {\n                    if (isArrayType(source) || isTupleType(source)) {\n                        if (!target.target.readonly && (isReadonlyArrayType(source) || isTupleType(source) && source.target.readonly)) {\n                            return 0 /* False */;\n                        }\n                        var sourceArity = getTypeReferenceArity(source);\n                        var targetArity = getTypeReferenceArity(target);\n                        var sourceRestFlag = isTupleType(source) ? source.target.combinedFlags & 4 /* Rest */ : 4 /* Rest */;\n                        var targetRestFlag = target.target.combinedFlags & 4 /* Rest */;\n                        var sourceMinLength = isTupleType(source) ? source.target.minLength : 0;\n                        var targetMinLength = target.target.minLength;\n                        if (!sourceRestFlag && sourceArity < targetMinLength) {\n                            if (reportErrors) {\n                                reportError(ts.Diagnostics.Source_has_0_element_s_but_target_requires_1, sourceArity, targetMinLength);\n                            }\n                            return 0 /* False */;\n                        }\n                        if (!targetRestFlag && targetArity < sourceMinLength) {\n                            if (reportErrors) {\n                                reportError(ts.Diagnostics.Source_has_0_element_s_but_target_allows_only_1, sourceMinLength, targetArity);\n                            }\n                            return 0 /* False */;\n                        }\n                        if (!targetRestFlag && sourceRestFlag) {\n                            if (reportErrors) {\n                                if (sourceMinLength < targetMinLength) {\n                                    reportError(ts.Diagnostics.Target_requires_0_element_s_but_source_may_have_fewer, targetMinLength);\n                                }\n                                else {\n                                    reportError(ts.Diagnostics.Target_allows_only_0_element_s_but_source_may_have_more, targetArity);\n                                }\n                            }\n                            return 0 /* False */;\n                        }\n                        var sourceTypeArguments = getTypeArguments(source);\n                        var targetTypeArguments = getTypeArguments(target);\n                        var startCount = Math.min(isTupleType(source) ? getStartElementCount(source.target, 11 /* NonRest */) : 0, getStartElementCount(target.target, 11 /* NonRest */));\n                        var endCount = Math.min(isTupleType(source) ? getEndElementCount(source.target, 11 /* NonRest */) : 0, targetRestFlag ? getEndElementCount(target.target, 11 /* NonRest */) : 0);\n                        var canExcludeDiscriminants = !!excludedProperties;\n                        for (var i = 0; i < targetArity; i++) {\n                            var sourceIndex = i < targetArity - endCount ? i : i + sourceArity - targetArity;\n                            var sourceFlags = isTupleType(source) && (i < startCount || i >= targetArity - endCount) ? source.target.elementFlags[sourceIndex] : 4 /* Rest */;\n                            var targetFlags = target.target.elementFlags[i];\n                            if (targetFlags & 8 /* Variadic */ && !(sourceFlags & 8 /* Variadic */)) {\n                                if (reportErrors) {\n                                    reportError(ts.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target, i);\n                                }\n                                return 0 /* False */;\n                            }\n                            if (sourceFlags & 8 /* Variadic */ && !(targetFlags & 12 /* Variable */)) {\n                                if (reportErrors) {\n                                    reportError(ts.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, sourceIndex, i);\n                                }\n                                return 0 /* False */;\n                            }\n                            if (targetFlags & 1 /* Required */ && !(sourceFlags & 1 /* Required */)) {\n                                if (reportErrors) {\n                                    reportError(ts.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target, i);\n                                }\n                                return 0 /* False */;\n                            }\n                            // We can only exclude discriminant properties if we have not yet encountered a variable-length element.\n                            if (canExcludeDiscriminants) {\n                                if (sourceFlags & 12 /* Variable */ || targetFlags & 12 /* Variable */) {\n                                    canExcludeDiscriminants = false;\n                                }\n                                if (canExcludeDiscriminants && (excludedProperties === null || excludedProperties === void 0 ? void 0 : excludedProperties.has((\"\" + i)))) {\n                                    continue;\n                                }\n                            }\n                            var sourceType = !isTupleType(source) ? sourceTypeArguments[0] :\n                                i < startCount || i >= targetArity - endCount ? sourceTypeArguments[sourceIndex] :\n                                    getElementTypeOfSliceOfTupleType(source, startCount, endCount) || neverType;\n                            var targetType = targetTypeArguments[i];\n                            var targetCheckType = sourceFlags & 8 /* Variadic */ && targetFlags & 4 /* Rest */ ? createArrayType(targetType) : targetType;\n                            var related = isRelatedTo(sourceType, targetCheckType, reportErrors, /*headMessage*/ undefined, intersectionState);\n                            if (!related) {\n                                if (reportErrors) {\n                                    if (i < startCount || i >= targetArity - endCount || sourceArity - startCount - endCount === 1) {\n                                        reportIncompatibleError(ts.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourceIndex, i);\n                                    }\n                                    else {\n                                        reportIncompatibleError(ts.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, startCount, sourceArity - endCount - 1, i);\n                                    }\n                                }\n                                return 0 /* False */;\n                            }\n                            result &= related;\n                        }\n                        return result;\n                    }\n                    if (target.target.combinedFlags & 12 /* Variable */) {\n                        return 0 /* False */;\n                    }\n                }\n                var requireOptionalProperties = (relation === subtypeRelation || relation === strictSubtypeRelation) && !isObjectLiteralType(source) && !isEmptyArrayLiteralType(source) && !isTupleType(source);\n                var unmatchedProperty = getUnmatchedProperty(source, target, requireOptionalProperties, /*matchDiscriminantProperties*/ false);\n                if (unmatchedProperty) {\n                    if (reportErrors) {\n                        reportUnmatchedProperty(source, target, unmatchedProperty, requireOptionalProperties);\n                    }\n                    return 0 /* False */;\n                }\n                if (isObjectLiteralType(target)) {\n                    for (var _i = 0, _a = excludeProperties(getPropertiesOfType(source), excludedProperties); _i < _a.length; _i++) {\n                        var sourceProp = _a[_i];\n                        if (!getPropertyOfObjectType(target, sourceProp.escapedName)) {\n                            var sourceType = getTypeOfSymbol(sourceProp);\n                            if (!(sourceType === undefinedType || sourceType === undefinedWideningType || sourceType === optionalType)) {\n                                if (reportErrors) {\n                                    reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(sourceProp), typeToString(target));\n                                }\n                                return 0 /* False */;\n                            }\n                        }\n                    }\n                }\n                // We only call this for union target types when we're attempting to do excess property checking - in those cases, we want to get _all possible props_\n                // from the target union, across all members\n                var properties = getPropertiesOfType(target);\n                var numericNamesOnly = isTupleType(source) && isTupleType(target);\n                for (var _b = 0, _c = excludeProperties(properties, excludedProperties); _b < _c.length; _b++) {\n                    var targetProp = _c[_b];\n                    var name = targetProp.escapedName;\n                    if (!(targetProp.flags & 4194304 /* Prototype */) && (!numericNamesOnly || isNumericLiteralName(name) || name === \"length\")) {\n                        var sourceProp = getPropertyOfType(source, name);\n                        if (sourceProp && sourceProp !== targetProp) {\n                            var related = propertyRelatedTo(source, target, sourceProp, targetProp, getTypeOfSymbol, reportErrors, intersectionState, relation === comparableRelation);\n                            if (!related) {\n                                return 0 /* False */;\n                            }\n                            result &= related;\n                        }\n                    }\n                }\n                return result;\n            }\n            function propertiesIdenticalTo(source, target, excludedProperties) {\n                if (!(source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */)) {\n                    return 0 /* False */;\n                }\n                var sourceProperties = excludeProperties(getPropertiesOfObjectType(source), excludedProperties);\n                var targetProperties = excludeProperties(getPropertiesOfObjectType(target), excludedProperties);\n                if (sourceProperties.length !== targetProperties.length) {\n                    return 0 /* False */;\n                }\n                var result = -1 /* True */;\n                for (var _i = 0, sourceProperties_1 = sourceProperties; _i < sourceProperties_1.length; _i++) {\n                    var sourceProp = sourceProperties_1[_i];\n                    var targetProp = getPropertyOfObjectType(target, sourceProp.escapedName);\n                    if (!targetProp) {\n                        return 0 /* False */;\n                    }\n                    var related = compareProperties(sourceProp, targetProp, isRelatedTo);\n                    if (!related) {\n                        return 0 /* False */;\n                    }\n                    result &= related;\n                }\n                return result;\n            }\n            function signaturesRelatedTo(source, target, kind, reportErrors) {\n                var _a, _b;\n                if (relation === identityRelation) {\n                    return signaturesIdenticalTo(source, target, kind);\n                }\n                if (target === anyFunctionType || source === anyFunctionType) {\n                    return -1 /* True */;\n                }\n                var sourceIsJSConstructor = source.symbol && isJSConstructor(source.symbol.valueDeclaration);\n                var targetIsJSConstructor = target.symbol && isJSConstructor(target.symbol.valueDeclaration);\n                var sourceSignatures = getSignaturesOfType(source, (sourceIsJSConstructor && kind === 1 /* Construct */) ?\n                    0 /* Call */ : kind);\n                var targetSignatures = getSignaturesOfType(target, (targetIsJSConstructor && kind === 1 /* Construct */) ?\n                    0 /* Call */ : kind);\n                if (kind === 1 /* Construct */ && sourceSignatures.length && targetSignatures.length) {\n                    var sourceIsAbstract = !!(sourceSignatures[0].flags & 4 /* Abstract */);\n                    var targetIsAbstract = !!(targetSignatures[0].flags & 4 /* Abstract */);\n                    if (sourceIsAbstract && !targetIsAbstract) {\n                        // An abstract constructor type is not assignable to a non-abstract constructor type\n                        // as it would otherwise be possible to new an abstract class. Note that the assignability\n                        // check we perform for an extends clause excludes construct signatures from the target,\n                        // so this check never proceeds.\n                        if (reportErrors) {\n                            reportError(ts.Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type);\n                        }\n                        return 0 /* False */;\n                    }\n                    if (!constructorVisibilitiesAreCompatible(sourceSignatures[0], targetSignatures[0], reportErrors)) {\n                        return 0 /* False */;\n                    }\n                }\n                var result = -1 /* True */;\n                var saveErrorInfo = captureErrorCalculationState();\n                var incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;\n                var sourceObjectFlags = ts.getObjectFlags(source);\n                var targetObjectFlags = ts.getObjectFlags(target);\n                if (sourceObjectFlags & 64 /* Instantiated */ && targetObjectFlags & 64 /* Instantiated */ && source.symbol === target.symbol) {\n                    // We have instantiations of the same anonymous type (which typically will be the type of a\n                    // method). Simply do a pairwise comparison of the signatures in the two signature lists instead\n                    // of the much more expensive N * M comparison matrix we explore below. We erase type parameters\n                    // as they are known to always be the same.\n                    for (var i = 0; i < targetSignatures.length; i++) {\n                        var related = signatureRelatedTo(sourceSignatures[i], targetSignatures[i], /*erase*/ true, reportErrors, incompatibleReporter(sourceSignatures[i], targetSignatures[i]));\n                        if (!related) {\n                            return 0 /* False */;\n                        }\n                        result &= related;\n                    }\n                }\n                else if (sourceSignatures.length === 1 && targetSignatures.length === 1) {\n                    // For simple functions (functions with a single signature) we only erase type parameters for\n                    // the comparable relation. Otherwise, if the source signature is generic, we instantiate it\n                    // in the context of the target signature before checking the relationship. Ideally we'd do\n                    // this regardless of the number of signatures, but the potential costs are prohibitive due\n                    // to the quadratic nature of the logic below.\n                    var eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks;\n                    var sourceSignature = ts.first(sourceSignatures);\n                    var targetSignature = ts.first(targetSignatures);\n                    result = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors, incompatibleReporter(sourceSignature, targetSignature));\n                    if (!result && reportErrors && kind === 1 /* Construct */ && (sourceObjectFlags & targetObjectFlags) &&\n                        (((_a = targetSignature.declaration) === null || _a === void 0 ? void 0 : _a.kind) === 166 /* Constructor */ || ((_b = sourceSignature.declaration) === null || _b === void 0 ? void 0 : _b.kind) === 166 /* Constructor */)) {\n                        var constructSignatureToString = function (signature) {\n                            return signatureToString(signature, /*enclosingDeclaration*/ undefined, 262144 /* WriteArrowStyleSignature */, kind);\n                        };\n                        reportError(ts.Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(sourceSignature), constructSignatureToString(targetSignature));\n                        reportError(ts.Diagnostics.Types_of_construct_signatures_are_incompatible);\n                        return result;\n                    }\n                }\n                else {\n                    outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) {\n                        var t = targetSignatures_1[_i];\n                        // Only elaborate errors from the first failure\n                        var shouldElaborateErrors = reportErrors;\n                        for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) {\n                            var s = sourceSignatures_1[_c];\n                            var related = signatureRelatedTo(s, t, /*erase*/ true, shouldElaborateErrors, incompatibleReporter(s, t));\n                            if (related) {\n                                result &= related;\n                                resetErrorInfo(saveErrorInfo);\n                                continue outer;\n                            }\n                            shouldElaborateErrors = false;\n                        }\n                        if (shouldElaborateErrors) {\n                            reportError(ts.Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source), signatureToString(t, /*enclosingDeclaration*/ undefined, /*flags*/ undefined, kind));\n                        }\n                        return 0 /* False */;\n                    }\n                }\n                return result;\n            }\n            function reportIncompatibleCallSignatureReturn(siga, sigb) {\n                if (siga.parameters.length === 0 && sigb.parameters.length === 0) {\n                    return function (source, target) { return reportIncompatibleError(ts.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1, typeToString(source), typeToString(target)); };\n                }\n                return function (source, target) { return reportIncompatibleError(ts.Diagnostics.Call_signature_return_types_0_and_1_are_incompatible, typeToString(source), typeToString(target)); };\n            }\n            function reportIncompatibleConstructSignatureReturn(siga, sigb) {\n                if (siga.parameters.length === 0 && sigb.parameters.length === 0) {\n                    return function (source, target) { return reportIncompatibleError(ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1, typeToString(source), typeToString(target)); };\n                }\n                return function (source, target) { return reportIncompatibleError(ts.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source), typeToString(target)); };\n            }\n            /**\n             * See signatureAssignableTo, compareSignaturesIdentical\n             */\n            function signatureRelatedTo(source, target, erase, reportErrors, incompatibleReporter) {\n                return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 /* StrictArity */ : 0, reportErrors, reportError, incompatibleReporter, isRelatedTo, makeFunctionTypeMapper(reportUnreliableMarkers));\n            }\n            function signaturesIdenticalTo(source, target, kind) {\n                var sourceSignatures = getSignaturesOfType(source, kind);\n                var targetSignatures = getSignaturesOfType(target, kind);\n                if (sourceSignatures.length !== targetSignatures.length) {\n                    return 0 /* False */;\n                }\n                var result = -1 /* True */;\n                for (var i = 0; i < sourceSignatures.length; i++) {\n                    var related = compareSignaturesIdentical(sourceSignatures[i], targetSignatures[i], /*partialMatch*/ false, /*ignoreThisTypes*/ false, /*ignoreReturnTypes*/ false, isRelatedTo);\n                    if (!related) {\n                        return 0 /* False */;\n                    }\n                    result &= related;\n                }\n                return result;\n            }\n            function eachPropertyRelatedTo(source, target, kind, reportErrors) {\n                var result = -1 /* True */;\n                var props = source.flags & 2097152 /* Intersection */ ? getPropertiesOfUnionOrIntersectionType(source) : getPropertiesOfObjectType(source);\n                for (var _i = 0, props_2 = props; _i < props_2.length; _i++) {\n                    var prop = props_2[_i];\n                    // Skip over ignored JSX and symbol-named members\n                    if (isIgnoredJsxProperty(source, prop)) {\n                        continue;\n                    }\n                    var nameType = getSymbolLinks(prop).nameType;\n                    if (nameType && nameType.flags & 8192 /* UniqueESSymbol */) {\n                        continue;\n                    }\n                    if (kind === 0 /* String */ || isNumericLiteralName(prop.escapedName)) {\n                        var propType = getTypeOfSymbol(prop);\n                        var type = propType.flags & 32768 /* Undefined */ || !(kind === 0 /* String */ && prop.flags & 16777216 /* Optional */)\n                            ? propType\n                            : getTypeWithFacts(propType, 524288 /* NEUndefined */);\n                        var related = isRelatedTo(type, target, reportErrors);\n                        if (!related) {\n                            if (reportErrors) {\n                                reportError(ts.Diagnostics.Property_0_is_incompatible_with_index_signature, symbolToString(prop));\n                            }\n                            return 0 /* False */;\n                        }\n                        result &= related;\n                    }\n                }\n                return result;\n            }\n            function indexTypeRelatedTo(sourceType, targetType, reportErrors) {\n                var related = isRelatedTo(sourceType, targetType, reportErrors);\n                if (!related && reportErrors) {\n                    reportError(ts.Diagnostics.Index_signatures_are_incompatible);\n                }\n                return related;\n            }\n            function indexTypesRelatedTo(source, target, kind, sourceIsPrimitive, reportErrors, intersectionState) {\n                if (relation === identityRelation) {\n                    return indexTypesIdenticalTo(source, target, kind);\n                }\n                var targetType = getIndexTypeOfType(target, kind);\n                if (!targetType || targetType.flags & 1 /* Any */ && !sourceIsPrimitive) {\n                    // Index signature of type any permits assignment from everything but primitives\n                    return -1 /* True */;\n                }\n                if (isGenericMappedType(source)) {\n                    // A generic mapped type { [P in K]: T } is related to a type with an index signature\n                    // { [x: string]: U }, and optionally with an index signature { [x: number]: V },\n                    // if T is related to U and V.\n                    return getIndexTypeOfType(target, 0 /* String */) ? isRelatedTo(getTemplateTypeFromMappedType(source), targetType, reportErrors) : 0 /* False */;\n                }\n                var indexType = getIndexTypeOfType(source, kind) || kind === 1 /* Number */ && getIndexTypeOfType(source, 0 /* String */);\n                if (indexType) {\n                    return indexTypeRelatedTo(indexType, targetType, reportErrors);\n                }\n                if (!(intersectionState & 1 /* Source */) && isObjectTypeWithInferableIndex(source)) {\n                    // Intersection constituents are never considered to have an inferred index signature\n                    var related = eachPropertyRelatedTo(source, targetType, kind, reportErrors);\n                    if (related && kind === 0 /* String */) {\n                        var numberIndexType = getIndexTypeOfType(source, 1 /* Number */);\n                        if (numberIndexType) {\n                            related &= indexTypeRelatedTo(numberIndexType, targetType, reportErrors);\n                        }\n                    }\n                    return related;\n                }\n                if (reportErrors) {\n                    reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source));\n                }\n                return 0 /* False */;\n            }\n            function indexTypesIdenticalTo(source, target, indexKind) {\n                var targetInfo = getIndexInfoOfType(target, indexKind);\n                var sourceInfo = getIndexInfoOfType(source, indexKind);\n                if (!sourceInfo && !targetInfo) {\n                    return -1 /* True */;\n                }\n                if (sourceInfo && targetInfo && sourceInfo.isReadonly === targetInfo.isReadonly) {\n                    return isRelatedTo(sourceInfo.type, targetInfo.type);\n                }\n                return 0 /* False */;\n            }\n            function constructorVisibilitiesAreCompatible(sourceSignature, targetSignature, reportErrors) {\n                if (!sourceSignature.declaration || !targetSignature.declaration) {\n                    return true;\n                }\n                var sourceAccessibility = ts.getSelectedEffectiveModifierFlags(sourceSignature.declaration, 24 /* NonPublicAccessibilityModifier */);\n                var targetAccessibility = ts.getSelectedEffectiveModifierFlags(targetSignature.declaration, 24 /* NonPublicAccessibilityModifier */);\n                // A public, protected and private signature is assignable to a private signature.\n                if (targetAccessibility === 8 /* Private */) {\n                    return true;\n                }\n                // A public and protected signature is assignable to a protected signature.\n                if (targetAccessibility === 16 /* Protected */ && sourceAccessibility !== 8 /* Private */) {\n                    return true;\n                }\n                // Only a public signature is assignable to public signature.\n                if (targetAccessibility !== 16 /* Protected */ && !sourceAccessibility) {\n                    return true;\n                }\n                if (reportErrors) {\n                    reportError(ts.Diagnostics.Cannot_assign_a_0_constructor_type_to_a_1_constructor_type, visibilityToString(sourceAccessibility), visibilityToString(targetAccessibility));\n                }\n                return false;\n            }\n        }\n        function typeCouldHaveTopLevelSingletonTypes(type) {\n            // Okay, yes, 'boolean' is a union of 'true | false', but that's not useful\n            // in error reporting scenarios. If you need to use this function but that detail matters,\n            // feel free to add a flag.\n            if (type.flags & 16 /* Boolean */) {\n                return false;\n            }\n            if (type.flags & 3145728 /* UnionOrIntersection */) {\n                return !!ts.forEach(type.types, typeCouldHaveTopLevelSingletonTypes);\n            }\n            if (type.flags & 465829888 /* Instantiable */) {\n                var constraint = getConstraintOfType(type);\n                if (constraint && constraint !== type) {\n                    return typeCouldHaveTopLevelSingletonTypes(constraint);\n                }\n            }\n            return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */);\n        }\n        function getBestMatchingType(source, target, isRelatedTo) {\n            if (isRelatedTo === void 0) { isRelatedTo = compareTypesAssignable; }\n            return findMatchingDiscriminantType(source, target, isRelatedTo, /*skipPartial*/ true) ||\n                findMatchingTypeReferenceOrTypeAliasReference(source, target) ||\n                findBestTypeForObjectLiteral(source, target) ||\n                findBestTypeForInvokable(source, target) ||\n                findMostOverlappyType(source, target);\n        }\n        function discriminateTypeByDiscriminableItems(target, discriminators, related, defaultValue, skipPartial) {\n            // undefined=unknown, true=discriminated, false=not discriminated\n            // The state of each type progresses from left to right. Discriminated types stop at 'true'.\n            var discriminable = target.types.map(function (_) { return undefined; });\n            for (var _i = 0, discriminators_1 = discriminators; _i < discriminators_1.length; _i++) {\n                var _a = discriminators_1[_i], getDiscriminatingType = _a[0], propertyName = _a[1];\n                var targetProp = getUnionOrIntersectionProperty(target, propertyName);\n                if (skipPartial && targetProp && ts.getCheckFlags(targetProp) & 16 /* ReadPartial */) {\n                    continue;\n                }\n                var i = 0;\n                for (var _b = 0, _c = target.types; _b < _c.length; _b++) {\n                    var type = _c[_b];\n                    var targetType = getTypeOfPropertyOfType(type, propertyName);\n                    if (targetType && related(getDiscriminatingType(), targetType)) {\n                        discriminable[i] = discriminable[i] === undefined ? true : discriminable[i];\n                    }\n                    else {\n                        discriminable[i] = false;\n                    }\n                    i++;\n                }\n            }\n            var match = discriminable.indexOf(/*searchElement*/ true);\n            if (match === -1) {\n                return defaultValue;\n            }\n            // make sure exactly 1 matches before returning it\n            var nextMatch = discriminable.indexOf(/*searchElement*/ true, match + 1);\n            while (nextMatch !== -1) {\n                if (!isTypeIdenticalTo(target.types[match], target.types[nextMatch])) {\n                    return defaultValue;\n                }\n                nextMatch = discriminable.indexOf(/*searchElement*/ true, nextMatch + 1);\n            }\n            return target.types[match];\n        }\n        /**\n         * A type is 'weak' if it is an object type with at least one optional property\n         * and no required properties, call/construct signatures or index signatures\n         */\n        function isWeakType(type) {\n            if (type.flags & 524288 /* Object */) {\n                var resolved = resolveStructuredTypeMembers(type);\n                return resolved.callSignatures.length === 0 && resolved.constructSignatures.length === 0 &&\n                    !resolved.stringIndexInfo && !resolved.numberIndexInfo &&\n                    resolved.properties.length > 0 &&\n                    ts.every(resolved.properties, function (p) { return !!(p.flags & 16777216 /* Optional */); });\n            }\n            if (type.flags & 2097152 /* Intersection */) {\n                return ts.every(type.types, isWeakType);\n            }\n            return false;\n        }\n        function hasCommonProperties(source, target, isComparingJsxAttributes) {\n            for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {\n                var prop = _a[_i];\n                if (isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) {\n                    return true;\n                }\n            }\n            return false;\n        }\n        // Return a type reference where the source type parameter is replaced with the target marker\n        // type, and flag the result as a marker type reference.\n        function getMarkerTypeReference(type, source, target) {\n            var result = createTypeReference(type, ts.map(type.typeParameters, function (t) { return t === source ? target : t; }));\n            result.objectFlags |= 8192 /* MarkerType */;\n            return result;\n        }\n        function getAliasVariances(symbol) {\n            var links = getSymbolLinks(symbol);\n            return getVariancesWorker(links.typeParameters, links, function (_links, param, marker) {\n                var type = getTypeAliasInstantiation(symbol, instantiateTypes(links.typeParameters, makeUnaryTypeMapper(param, marker)));\n                type.aliasTypeArgumentsContainsMarker = true;\n                return type;\n            });\n        }\n        // Return an array containing the variance of each type parameter. The variance is effectively\n        // a digest of the type comparisons that occur for each type argument when instantiations of the\n        // generic type are structurally compared. We infer the variance information by comparing\n        // instantiations of the generic type for type arguments with known relations. The function\n        // returns the emptyArray singleton when invoked recursively for the given generic type.\n        function getVariancesWorker(typeParameters, cache, createMarkerType) {\n            var _a, _b, _c;\n            if (typeParameters === void 0) { typeParameters = ts.emptyArray; }\n            var variances = cache.variances;\n            if (!variances) {\n                ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"checkTypes\" /* CheckTypes */, \"getVariancesWorker\", { arity: typeParameters.length, id: (_c = (_a = cache.id) !== null && _a !== void 0 ? _a : (_b = cache.declaredType) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : -1 });\n                // The emptyArray singleton is used to signal a recursive invocation.\n                cache.variances = ts.emptyArray;\n                variances = [];\n                var _loop_19 = function (tp) {\n                    var unmeasurable = false;\n                    var unreliable = false;\n                    var oldHandler = outofbandVarianceMarkerHandler;\n                    outofbandVarianceMarkerHandler = function (onlyUnreliable) { return onlyUnreliable ? unreliable = true : unmeasurable = true; };\n                    // We first compare instantiations where the type parameter is replaced with\n                    // marker types that have a known subtype relationship. From this we can infer\n                    // invariance, covariance, contravariance or bivariance.\n                    var typeWithSuper = createMarkerType(cache, tp, markerSuperType);\n                    var typeWithSub = createMarkerType(cache, tp, markerSubType);\n                    var variance = (isTypeAssignableTo(typeWithSub, typeWithSuper) ? 1 /* Covariant */ : 0) |\n                        (isTypeAssignableTo(typeWithSuper, typeWithSub) ? 2 /* Contravariant */ : 0);\n                    // If the instantiations appear to be related bivariantly it may be because the\n                    // type parameter is independent (i.e. it isn't witnessed anywhere in the generic\n                    // type). To determine this we compare instantiations where the type parameter is\n                    // replaced with marker types that are known to be unrelated.\n                    if (variance === 3 /* Bivariant */ && isTypeAssignableTo(createMarkerType(cache, tp, markerOtherType), typeWithSuper)) {\n                        variance = 4 /* Independent */;\n                    }\n                    outofbandVarianceMarkerHandler = oldHandler;\n                    if (unmeasurable || unreliable) {\n                        if (unmeasurable) {\n                            variance |= 8 /* Unmeasurable */;\n                        }\n                        if (unreliable) {\n                            variance |= 16 /* Unreliable */;\n                        }\n                    }\n                    variances.push(variance);\n                };\n                for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) {\n                    var tp = typeParameters_1[_i];\n                    _loop_19(tp);\n                }\n                cache.variances = variances;\n                ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n            }\n            return variances;\n        }\n        function getVariances(type) {\n            // Arrays and tuples are known to be covariant, no need to spend time computing this.\n            if (type === globalArrayType || type === globalReadonlyArrayType || type.objectFlags & 8 /* Tuple */) {\n                return arrayVariances;\n            }\n            return getVariancesWorker(type.typeParameters, type, getMarkerTypeReference);\n        }\n        // Return true if the given type reference has a 'void' type argument for a covariant type parameter.\n        // See comment at call in recursiveTypeRelatedTo for when this case matters.\n        function hasCovariantVoidArgument(typeArguments, variances) {\n            for (var i = 0; i < variances.length; i++) {\n                if ((variances[i] & 7 /* VarianceMask */) === 1 /* Covariant */ && typeArguments[i].flags & 16384 /* Void */) {\n                    return true;\n                }\n            }\n            return false;\n        }\n        function isUnconstrainedTypeParameter(type) {\n            return type.flags & 262144 /* TypeParameter */ && !getConstraintOfTypeParameter(type);\n        }\n        function isNonDeferredTypeReference(type) {\n            return !!(ts.getObjectFlags(type) & 4 /* Reference */) && !type.node;\n        }\n        function isTypeReferenceWithGenericArguments(type) {\n            return isNonDeferredTypeReference(type) && ts.some(getTypeArguments(type), function (t) { return isUnconstrainedTypeParameter(t) || isTypeReferenceWithGenericArguments(t); });\n        }\n        /**\n         * getTypeReferenceId(A<T, number, U>) returns \"111=0-12=1\"\n         *   where A.id=111 and number.id=12\n         */\n        function getTypeReferenceId(type, typeParameters, depth) {\n            if (depth === void 0) { depth = 0; }\n            var result = \"\" + type.target.id;\n            for (var _i = 0, _a = getTypeArguments(type); _i < _a.length; _i++) {\n                var t = _a[_i];\n                if (isUnconstrainedTypeParameter(t)) {\n                    var index = typeParameters.indexOf(t);\n                    if (index < 0) {\n                        index = typeParameters.length;\n                        typeParameters.push(t);\n                    }\n                    result += \"=\" + index;\n                }\n                else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) {\n                    result += \"<\" + getTypeReferenceId(t, typeParameters, depth + 1) + \">\";\n                }\n                else {\n                    result += \"-\" + t.id;\n                }\n            }\n            return result;\n        }\n        /**\n         * To improve caching, the relation key for two generic types uses the target's id plus ids of the type parameters.\n         * For other cases, the types ids are used.\n         */\n        function getRelationKey(source, target, intersectionState, relation) {\n            if (relation === identityRelation && source.id > target.id) {\n                var temp = source;\n                source = target;\n                target = temp;\n            }\n            var postFix = intersectionState ? \":\" + intersectionState : \"\";\n            if (isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target)) {\n                var typeParameters = [];\n                return getTypeReferenceId(source, typeParameters) + \",\" + getTypeReferenceId(target, typeParameters) + postFix;\n            }\n            return source.id + \",\" + target.id + postFix;\n        }\n        // Invoke the callback for each underlying property symbol of the given symbol and return the first\n        // value that isn't undefined.\n        function forEachProperty(prop, callback) {\n            if (ts.getCheckFlags(prop) & 6 /* Synthetic */) {\n                for (var _i = 0, _a = prop.containingType.types; _i < _a.length; _i++) {\n                    var t = _a[_i];\n                    var p = getPropertyOfType(t, prop.escapedName);\n                    var result = p && forEachProperty(p, callback);\n                    if (result) {\n                        return result;\n                    }\n                }\n                return undefined;\n            }\n            return callback(prop);\n        }\n        // Return the declaring class type of a property or undefined if property not declared in class\n        function getDeclaringClass(prop) {\n            return prop.parent && prop.parent.flags & 32 /* Class */ ? getDeclaredTypeOfSymbol(getParentOfSymbol(prop)) : undefined;\n        }\n        // Return the inherited type of the given property or undefined if property doesn't exist in a base class.\n        function getTypeOfPropertyInBaseClass(property) {\n            var classType = getDeclaringClass(property);\n            var baseClassType = classType && getBaseTypes(classType)[0];\n            return baseClassType && getTypeOfPropertyOfType(baseClassType, property.escapedName);\n        }\n        // Return true if some underlying source property is declared in a class that derives\n        // from the given base class.\n        function isPropertyInClassDerivedFrom(prop, baseClass) {\n            return forEachProperty(prop, function (sp) {\n                var sourceClass = getDeclaringClass(sp);\n                return sourceClass ? hasBaseType(sourceClass, baseClass) : false;\n            });\n        }\n        // Return true if source property is a valid override of protected parts of target property.\n        function isValidOverrideOf(sourceProp, targetProp) {\n            return !forEachProperty(targetProp, function (tp) { return ts.getDeclarationModifierFlagsFromSymbol(tp) & 16 /* Protected */ ?\n                !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false; });\n        }\n        // Return true if the given class derives from each of the declaring classes of the protected\n        // constituents of the given property.\n        function isClassDerivedFromDeclaringClasses(checkClass, prop) {\n            return forEachProperty(prop, function (p) { return ts.getDeclarationModifierFlagsFromSymbol(p) & 16 /* Protected */ ?\n                !hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass;\n        }\n        // Return true if the given type is deeply nested. We consider this to be the case when structural type comparisons\n        // for 5 or more occurrences or instantiations of the type have been recorded on the given stack. It is possible,\n        // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely\n        // expanding. Effectively, we will generate a false positive when two types are structurally equal to at least 5\n        // levels, but unequal at some level beyond that.\n        // In addition, this will also detect when an indexed access has been chained off of 5 or more times (which is essentially\n        // the dual of the structural comparison), and likewise mark the type as deeply nested, potentially adding false positives\n        // for finite but deeply expanding indexed accesses (eg, for `Q[P1][P2][P3][P4][P5]`).\n        // It also detects when a recursive type reference has expanded 5 or more times, eg, if the true branch of\n        // `type A<T> = null extends T ? [A<NonNullable<T>>] : [T]`\n        // has expanded into `[A<NonNullable<NonNullable<NonNullable<NonNullable<NonNullable<T>>>>>>]`\n        // in such cases we need to terminate the expansion, and we do so here.\n        function isDeeplyNestedType(type, stack, depth) {\n            if (depth >= 5) {\n                var identity_1 = getRecursionIdentity(type);\n                if (identity_1) {\n                    var count = 0;\n                    for (var i = 0; i < depth; i++) {\n                        if (getRecursionIdentity(stack[i]) === identity_1) {\n                            count++;\n                            if (count >= 5) {\n                                return true;\n                            }\n                        }\n                    }\n                }\n            }\n            return false;\n        }\n        // Types with constituents that could circularly reference the type have a recursion identity. The recursion\n        // identity is some object that is common to instantiations of the type with the same origin.\n        function getRecursionIdentity(type) {\n            if (type.flags & 524288 /* Object */ && !isObjectOrArrayLiteralType(type)) {\n                if (ts.getObjectFlags(type) && 4 /* Reference */ && type.node) {\n                    // Deferred type references are tracked through their associated AST node. This gives us finer\n                    // granularity than using their associated target because each manifest type reference has a\n                    // unique AST node.\n                    return type.node;\n                }\n                if (type.symbol && !(ts.getObjectFlags(type) & 16 /* Anonymous */ && type.symbol.flags & 32 /* Class */)) {\n                    // We track all object types that have an associated symbol (representing the origin of the type), but\n                    // exclude the static side of classes from this check since it shares its symbol with the instance side.\n                    return type.symbol;\n                }\n                if (isTupleType(type)) {\n                    // Tuple types are tracked through their target type\n                    return type.target;\n                }\n            }\n            if (type.flags & 8388608 /* IndexedAccess */) {\n                // Identity is the leftmost object type in a chain of indexed accesses, eg, in A[P][Q] it is A\n                do {\n                    type = type.objectType;\n                } while (type.flags & 8388608 /* IndexedAccess */);\n                return type;\n            }\n            if (type.flags & 16777216 /* Conditional */) {\n                // The root object represents the origin of the conditional type\n                return type.root;\n            }\n            return undefined;\n        }\n        function isPropertyIdenticalTo(sourceProp, targetProp) {\n            return compareProperties(sourceProp, targetProp, compareTypesIdentical) !== 0 /* False */;\n        }\n        function compareProperties(sourceProp, targetProp, compareTypes) {\n            // Two members are considered identical when\n            // - they are public properties with identical names, optionality, and types,\n            // - they are private or protected properties originating in the same declaration and having identical types\n            if (sourceProp === targetProp) {\n                return -1 /* True */;\n            }\n            var sourcePropAccessibility = ts.getDeclarationModifierFlagsFromSymbol(sourceProp) & 24 /* NonPublicAccessibilityModifier */;\n            var targetPropAccessibility = ts.getDeclarationModifierFlagsFromSymbol(targetProp) & 24 /* NonPublicAccessibilityModifier */;\n            if (sourcePropAccessibility !== targetPropAccessibility) {\n                return 0 /* False */;\n            }\n            if (sourcePropAccessibility) {\n                if (getTargetSymbol(sourceProp) !== getTargetSymbol(targetProp)) {\n                    return 0 /* False */;\n                }\n            }\n            else {\n                if ((sourceProp.flags & 16777216 /* Optional */) !== (targetProp.flags & 16777216 /* Optional */)) {\n                    return 0 /* False */;\n                }\n            }\n            if (isReadonlySymbol(sourceProp) !== isReadonlySymbol(targetProp)) {\n                return 0 /* False */;\n            }\n            return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp));\n        }\n        function isMatchingSignature(source, target, partialMatch) {\n            var sourceParameterCount = getParameterCount(source);\n            var targetParameterCount = getParameterCount(target);\n            var sourceMinArgumentCount = getMinArgumentCount(source);\n            var targetMinArgumentCount = getMinArgumentCount(target);\n            var sourceHasRestParameter = hasEffectiveRestParameter(source);\n            var targetHasRestParameter = hasEffectiveRestParameter(target);\n            // A source signature matches a target signature if the two signatures have the same number of required,\n            // optional, and rest parameters.\n            if (sourceParameterCount === targetParameterCount &&\n                sourceMinArgumentCount === targetMinArgumentCount &&\n                sourceHasRestParameter === targetHasRestParameter) {\n                return true;\n            }\n            // A source signature partially matches a target signature if the target signature has no fewer required\n            // parameters\n            if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount) {\n                return true;\n            }\n            return false;\n        }\n        /**\n         * See signatureRelatedTo, compareSignaturesIdentical\n         */\n        function compareSignaturesIdentical(source, target, partialMatch, ignoreThisTypes, ignoreReturnTypes, compareTypes) {\n            // TODO (drosen): De-duplicate code between related functions.\n            if (source === target) {\n                return -1 /* True */;\n            }\n            if (!(isMatchingSignature(source, target, partialMatch))) {\n                return 0 /* False */;\n            }\n            // Check that the two signatures have the same number of type parameters.\n            if (ts.length(source.typeParameters) !== ts.length(target.typeParameters)) {\n                return 0 /* False */;\n            }\n            // Check that type parameter constraints and defaults match. If they do, instantiate the source\n            // signature with the type parameters of the target signature and continue the comparison.\n            if (target.typeParameters) {\n                var mapper = createTypeMapper(source.typeParameters, target.typeParameters);\n                for (var i = 0; i < target.typeParameters.length; i++) {\n                    var s = source.typeParameters[i];\n                    var t = target.typeParameters[i];\n                    if (!(s === t || compareTypes(instantiateType(getConstraintFromTypeParameter(s), mapper) || unknownType, getConstraintFromTypeParameter(t) || unknownType) &&\n                        compareTypes(instantiateType(getDefaultFromTypeParameter(s), mapper) || unknownType, getDefaultFromTypeParameter(t) || unknownType))) {\n                        return 0 /* False */;\n                    }\n                }\n                source = instantiateSignature(source, mapper, /*eraseTypeParameters*/ true);\n            }\n            var result = -1 /* True */;\n            if (!ignoreThisTypes) {\n                var sourceThisType = getThisTypeOfSignature(source);\n                if (sourceThisType) {\n                    var targetThisType = getThisTypeOfSignature(target);\n                    if (targetThisType) {\n                        var related = compareTypes(sourceThisType, targetThisType);\n                        if (!related) {\n                            return 0 /* False */;\n                        }\n                        result &= related;\n                    }\n                }\n            }\n            var targetLen = getParameterCount(target);\n            for (var i = 0; i < targetLen; i++) {\n                var s = getTypeAtPosition(source, i);\n                var t = getTypeAtPosition(target, i);\n                var related = compareTypes(t, s);\n                if (!related) {\n                    return 0 /* False */;\n                }\n                result &= related;\n            }\n            if (!ignoreReturnTypes) {\n                var sourceTypePredicate = getTypePredicateOfSignature(source);\n                var targetTypePredicate = getTypePredicateOfSignature(target);\n                result &= sourceTypePredicate || targetTypePredicate ?\n                    compareTypePredicatesIdentical(sourceTypePredicate, targetTypePredicate, compareTypes) :\n                    compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target));\n            }\n            return result;\n        }\n        function compareTypePredicatesIdentical(source, target, compareTypes) {\n            return !(source && target && typePredicateKindsMatch(source, target)) ? 0 /* False */ :\n                source.type === target.type ? -1 /* True */ :\n                    source.type && target.type ? compareTypes(source.type, target.type) :\n                        0 /* False */;\n        }\n        function literalTypesWithSameBaseType(types) {\n            var commonBaseType;\n            for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {\n                var t = types_14[_i];\n                var baseType = getBaseTypeOfLiteralType(t);\n                if (!commonBaseType) {\n                    commonBaseType = baseType;\n                }\n                if (baseType === t || baseType !== commonBaseType) {\n                    return false;\n                }\n            }\n            return true;\n        }\n        // When the candidate types are all literal types with the same base type, return a union\n        // of those literal types. Otherwise, return the leftmost type for which no type to the\n        // right is a supertype.\n        function getSupertypeOrUnion(types) {\n            return literalTypesWithSameBaseType(types) ?\n                getUnionType(types) :\n                ts.reduceLeft(types, function (s, t) { return isTypeSubtypeOf(s, t) ? t : s; });\n        }\n        function getCommonSupertype(types) {\n            if (!strictNullChecks) {\n                return getSupertypeOrUnion(types);\n            }\n            var primaryTypes = ts.filter(types, function (t) { return !(t.flags & 98304 /* Nullable */); });\n            return primaryTypes.length ?\n                getNullableType(getSupertypeOrUnion(primaryTypes), getFalsyFlagsOfTypes(types) & 98304 /* Nullable */) :\n                getUnionType(types, 2 /* Subtype */);\n        }\n        // Return the leftmost type for which no type to the right is a subtype.\n        function getCommonSubtype(types) {\n            return ts.reduceLeft(types, function (s, t) { return isTypeSubtypeOf(t, s) ? t : s; });\n        }\n        function isArrayType(type) {\n            return !!(ts.getObjectFlags(type) & 4 /* Reference */) && (type.target === globalArrayType || type.target === globalReadonlyArrayType);\n        }\n        function isReadonlyArrayType(type) {\n            return !!(ts.getObjectFlags(type) & 4 /* Reference */) && type.target === globalReadonlyArrayType;\n        }\n        function isMutableArrayOrTuple(type) {\n            return isArrayType(type) && !isReadonlyArrayType(type) || isTupleType(type) && !type.target.readonly;\n        }\n        function getElementTypeOfArrayType(type) {\n            return isArrayType(type) ? getTypeArguments(type)[0] : undefined;\n        }\n        function isArrayLikeType(type) {\n            // A type is array-like if it is a reference to the global Array or global ReadonlyArray type,\n            // or if it is not the undefined or null type and if it is assignable to ReadonlyArray<any>\n            return isArrayType(type) || !(type.flags & 98304 /* Nullable */) && isTypeAssignableTo(type, anyReadonlyArrayType);\n        }\n        function isEmptyArrayLiteralType(type) {\n            var elementType = isArrayType(type) ? getTypeArguments(type)[0] : undefined;\n            return elementType === undefinedWideningType || elementType === implicitNeverType;\n        }\n        function isTupleLikeType(type) {\n            return isTupleType(type) || !!getPropertyOfType(type, \"0\");\n        }\n        function isArrayOrTupleLikeType(type) {\n            return isArrayLikeType(type) || isTupleLikeType(type);\n        }\n        function getTupleElementType(type, index) {\n            var propType = getTypeOfPropertyOfType(type, \"\" + index);\n            if (propType) {\n                return propType;\n            }\n            if (everyType(type, isTupleType)) {\n                return mapType(type, function (t) { return getRestTypeOfTupleType(t) || undefinedType; });\n            }\n            return undefined;\n        }\n        function isNeitherUnitTypeNorNever(type) {\n            return !(type.flags & (109440 /* Unit */ | 131072 /* Never */));\n        }\n        function isUnitType(type) {\n            return !!(type.flags & 109440 /* Unit */);\n        }\n        function isLiteralType(type) {\n            return type.flags & 16 /* Boolean */ ? true :\n                type.flags & 1048576 /* Union */ ? type.flags & 1024 /* EnumLiteral */ ? true : ts.every(type.types, isUnitType) :\n                    isUnitType(type);\n        }\n        function getBaseTypeOfLiteralType(type) {\n            return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) :\n                type.flags & 128 /* StringLiteral */ ? stringType :\n                    type.flags & 256 /* NumberLiteral */ ? numberType :\n                        type.flags & 2048 /* BigIntLiteral */ ? bigintType :\n                            type.flags & 512 /* BooleanLiteral */ ? booleanType :\n                                type.flags & 1048576 /* Union */ ? mapType(type, getBaseTypeOfLiteralType) :\n                                    type;\n        }\n        function getWidenedLiteralType(type) {\n            return type.flags & 1024 /* EnumLiteral */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLiteralType(type) :\n                type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType :\n                    type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType :\n                        type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType :\n                            type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType :\n                                type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) :\n                                    type;\n        }\n        function getWidenedUniqueESSymbolType(type) {\n            return type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType :\n                type.flags & 1048576 /* Union */ ? mapType(type, getWidenedUniqueESSymbolType) :\n                    type;\n        }\n        function getWidenedLiteralLikeTypeForContextualType(type, contextualType) {\n            if (!isLiteralOfContextualType(type, contextualType)) {\n                type = getWidenedUniqueESSymbolType(getWidenedLiteralType(type));\n            }\n            return type;\n        }\n        function getWidenedLiteralLikeTypeForContextualReturnTypeIfNeeded(type, contextualSignatureReturnType, isAsync) {\n            if (type && isUnitType(type)) {\n                var contextualType = !contextualSignatureReturnType ? undefined :\n                    isAsync ? getPromisedTypeOfPromise(contextualSignatureReturnType) :\n                        contextualSignatureReturnType;\n                type = getWidenedLiteralLikeTypeForContextualType(type, contextualType);\n            }\n            return type;\n        }\n        function getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(type, contextualSignatureReturnType, kind, isAsyncGenerator) {\n            if (type && isUnitType(type)) {\n                var contextualType = !contextualSignatureReturnType ? undefined :\n                    getIterationTypeOfGeneratorFunctionReturnType(kind, contextualSignatureReturnType, isAsyncGenerator);\n                type = getWidenedLiteralLikeTypeForContextualType(type, contextualType);\n            }\n            return type;\n        }\n        /**\n         * Check if a Type was written as a tuple type literal.\n         * Prefer using isTupleLikeType() unless the use of `elementTypes`/`getTypeArguments` is required.\n         */\n        function isTupleType(type) {\n            return !!(ts.getObjectFlags(type) & 4 /* Reference */ && type.target.objectFlags & 8 /* Tuple */);\n        }\n        function isGenericTupleType(type) {\n            return isTupleType(type) && !!(type.target.combinedFlags & 8 /* Variadic */);\n        }\n        function isSingleElementGenericTupleType(type) {\n            return isGenericTupleType(type) && type.target.elementFlags.length === 1;\n        }\n        function getRestTypeOfTupleType(type) {\n            return getElementTypeOfSliceOfTupleType(type, type.target.fixedLength);\n        }\n        function getRestArrayTypeOfTupleType(type) {\n            var restType = getRestTypeOfTupleType(type);\n            return restType && createArrayType(restType);\n        }\n        function getElementTypeOfSliceOfTupleType(type, index, endSkipCount, writing) {\n            if (endSkipCount === void 0) { endSkipCount = 0; }\n            if (writing === void 0) { writing = false; }\n            var length = getTypeReferenceArity(type) - endSkipCount;\n            if (index < length) {\n                var typeArguments = getTypeArguments(type);\n                var elementTypes = [];\n                for (var i = index; i < length; i++) {\n                    var t = typeArguments[i];\n                    elementTypes.push(type.target.elementFlags[i] & 8 /* Variadic */ ? getIndexedAccessType(t, numberType) : t);\n                }\n                return writing ? getIntersectionType(elementTypes) : getUnionType(elementTypes);\n            }\n            return undefined;\n        }\n        function isTupleTypeStructureMatching(t1, t2) {\n            return getTypeReferenceArity(t1) === getTypeReferenceArity(t2) &&\n                ts.every(t1.target.elementFlags, function (f, i) { return (f & 12 /* Variable */) === (t2.target.elementFlags[i] & 12 /* Variable */); });\n        }\n        function isZeroBigInt(_a) {\n            var value = _a.value;\n            return value.base10Value === \"0\";\n        }\n        function getFalsyFlagsOfTypes(types) {\n            var result = 0;\n            for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {\n                var t = types_15[_i];\n                result |= getFalsyFlags(t);\n            }\n            return result;\n        }\n        // Returns the String, Number, Boolean, StringLiteral, NumberLiteral, BooleanLiteral, Void, Undefined, or Null\n        // flags for the string, number, boolean, \"\", 0, false, void, undefined, or null types respectively. Returns\n        // no flags for all other types (including non-falsy literal types).\n        function getFalsyFlags(type) {\n            return type.flags & 1048576 /* Union */ ? getFalsyFlagsOfTypes(type.types) :\n                type.flags & 128 /* StringLiteral */ ? type.value === \"\" ? 128 /* StringLiteral */ : 0 :\n                    type.flags & 256 /* NumberLiteral */ ? type.value === 0 ? 256 /* NumberLiteral */ : 0 :\n                        type.flags & 2048 /* BigIntLiteral */ ? isZeroBigInt(type) ? 2048 /* BigIntLiteral */ : 0 :\n                            type.flags & 512 /* BooleanLiteral */ ? (type === falseType || type === regularFalseType) ? 512 /* BooleanLiteral */ : 0 :\n                                type.flags & 117724 /* PossiblyFalsy */;\n        }\n        function removeDefinitelyFalsyTypes(type) {\n            return getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ ?\n                filterType(type, function (t) { return !(getFalsyFlags(t) & 117632 /* DefinitelyFalsy */); }) :\n                type;\n        }\n        function extractDefinitelyFalsyTypes(type) {\n            return mapType(type, getDefinitelyFalsyPartOfType);\n        }\n        function getDefinitelyFalsyPartOfType(type) {\n            return type.flags & 4 /* String */ ? emptyStringType :\n                type.flags & 8 /* Number */ ? zeroType :\n                    type.flags & 64 /* BigInt */ ? zeroBigIntType :\n                        type === regularFalseType ||\n                            type === falseType ||\n                            type.flags & (16384 /* Void */ | 32768 /* Undefined */ | 65536 /* Null */ | 3 /* AnyOrUnknown */) ||\n                            type.flags & 128 /* StringLiteral */ && type.value === \"\" ||\n                            type.flags & 256 /* NumberLiteral */ && type.value === 0 ||\n                            type.flags & 2048 /* BigIntLiteral */ && isZeroBigInt(type) ? type :\n                            neverType;\n        }\n        /**\n         * Add undefined or null or both to a type if they are missing.\n         * @param type - type to add undefined and/or null to if not present\n         * @param flags - Either TypeFlags.Undefined or TypeFlags.Null, or both\n         */\n        function getNullableType(type, flags) {\n            var missing = (flags & ~type.flags) & (32768 /* Undefined */ | 65536 /* Null */);\n            return missing === 0 ? type :\n                missing === 32768 /* Undefined */ ? getUnionType([type, undefinedType]) :\n                    missing === 65536 /* Null */ ? getUnionType([type, nullType]) :\n                        getUnionType([type, undefinedType, nullType]);\n        }\n        function getOptionalType(type) {\n            ts.Debug.assert(strictNullChecks);\n            return type.flags & 32768 /* Undefined */ ? type : getUnionType([type, undefinedType]);\n        }\n        function getGlobalNonNullableTypeInstantiation(type) {\n            if (!deferredGlobalNonNullableTypeAlias) {\n                deferredGlobalNonNullableTypeAlias = getGlobalSymbol(\"NonNullable\", 524288 /* TypeAlias */, /*diagnostic*/ undefined) || unknownSymbol;\n            }\n            // Use NonNullable global type alias if available to improve quick info/declaration emit\n            if (deferredGlobalNonNullableTypeAlias !== unknownSymbol) {\n                return getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [type]);\n            }\n            return getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */); // Type alias unavailable, fall back to non-higher-order behavior\n        }\n        function getNonNullableType(type) {\n            return strictNullChecks ? getGlobalNonNullableTypeInstantiation(type) : type;\n        }\n        function addOptionalTypeMarker(type) {\n            return strictNullChecks ? getUnionType([type, optionalType]) : type;\n        }\n        function isNotOptionalTypeMarker(type) {\n            return type !== optionalType;\n        }\n        function removeOptionalTypeMarker(type) {\n            return strictNullChecks ? filterType(type, isNotOptionalTypeMarker) : type;\n        }\n        function propagateOptionalTypeMarker(type, node, wasOptional) {\n            return wasOptional ? ts.isOutermostOptionalChain(node) ? getOptionalType(type) : addOptionalTypeMarker(type) : type;\n        }\n        function getOptionalExpressionType(exprType, expression) {\n            return ts.isExpressionOfOptionalChainRoot(expression) ? getNonNullableType(exprType) :\n                ts.isOptionalChain(expression) ? removeOptionalTypeMarker(exprType) :\n                    exprType;\n        }\n        /**\n         * Is source potentially coercible to target type under `==`.\n         * Assumes that `source` is a constituent of a union, hence\n         * the boolean literal flag on the LHS, but not on the RHS.\n         *\n         * This does not fully replicate the semantics of `==`. The\n         * intention is to catch cases that are clearly not right.\n         *\n         * Comparing (string | number) to number should not remove the\n         * string element.\n         *\n         * Comparing (string | number) to 1 will remove the string\n         * element, though this is not sound. This is a pragmatic\n         * choice.\n         *\n         * @see narrowTypeByEquality\n         *\n         * @param source\n         * @param target\n         */\n        function isCoercibleUnderDoubleEquals(source, target) {\n            return ((source.flags & (8 /* Number */ | 4 /* String */ | 512 /* BooleanLiteral */)) !== 0)\n                && ((target.flags & (8 /* Number */ | 4 /* String */ | 16 /* Boolean */)) !== 0);\n        }\n        /**\n         * Return true if type was inferred from an object literal, written as an object type literal, or is the shape of a module\n         * with no call or construct signatures.\n         */\n        function isObjectTypeWithInferableIndex(type) {\n            return type.flags & 2097152 /* Intersection */ ? ts.every(type.types, isObjectTypeWithInferableIndex) :\n                !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 &&\n                    !typeHasCallOrConstructSignatures(type)) || !!(ts.getObjectFlags(type) & 2048 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source));\n        }\n        function createSymbolWithType(source, type) {\n            var symbol = createSymbol(source.flags, source.escapedName, ts.getCheckFlags(source) & 8 /* Readonly */);\n            symbol.declarations = source.declarations;\n            symbol.parent = source.parent;\n            symbol.type = type;\n            symbol.target = source;\n            if (source.valueDeclaration) {\n                symbol.valueDeclaration = source.valueDeclaration;\n            }\n            var nameType = getSymbolLinks(source).nameType;\n            if (nameType) {\n                symbol.nameType = nameType;\n            }\n            return symbol;\n        }\n        function transformTypeOfMembers(type, f) {\n            var members = ts.createSymbolTable();\n            for (var _i = 0, _a = getPropertiesOfObjectType(type); _i < _a.length; _i++) {\n                var property = _a[_i];\n                var original = getTypeOfSymbol(property);\n                var updated = f(original);\n                members.set(property.escapedName, updated === original ? property : createSymbolWithType(property, updated));\n            }\n            return members;\n        }\n        /**\n         * If the the provided object literal is subject to the excess properties check,\n         * create a new that is exempt. Recursively mark object literal members as exempt.\n         * Leave signatures alone since they are not subject to the check.\n         */\n        function getRegularTypeOfObjectLiteral(type) {\n            if (!(isObjectLiteralType(type) && ts.getObjectFlags(type) & 32768 /* FreshLiteral */)) {\n                return type;\n            }\n            var regularType = type.regularType;\n            if (regularType) {\n                return regularType;\n            }\n            var resolved = type;\n            var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);\n            var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo);\n            regularNew.flags = resolved.flags;\n            regularNew.objectFlags |= resolved.objectFlags & ~32768 /* FreshLiteral */;\n            type.regularType = regularNew;\n            return regularNew;\n        }\n        function createWideningContext(parent, propertyName, siblings) {\n            return { parent: parent, propertyName: propertyName, siblings: siblings, resolvedProperties: undefined };\n        }\n        function getSiblingsOfContext(context) {\n            if (!context.siblings) {\n                var siblings_1 = [];\n                for (var _i = 0, _a = getSiblingsOfContext(context.parent); _i < _a.length; _i++) {\n                    var type = _a[_i];\n                    if (isObjectLiteralType(type)) {\n                        var prop = getPropertyOfObjectType(type, context.propertyName);\n                        if (prop) {\n                            forEachType(getTypeOfSymbol(prop), function (t) {\n                                siblings_1.push(t);\n                            });\n                        }\n                    }\n                }\n                context.siblings = siblings_1;\n            }\n            return context.siblings;\n        }\n        function getPropertiesOfContext(context) {\n            if (!context.resolvedProperties) {\n                var names = new ts.Map();\n                for (var _i = 0, _a = getSiblingsOfContext(context); _i < _a.length; _i++) {\n                    var t = _a[_i];\n                    if (isObjectLiteralType(t) && !(ts.getObjectFlags(t) & 1024 /* ContainsSpread */)) {\n                        for (var _b = 0, _c = getPropertiesOfType(t); _b < _c.length; _b++) {\n                            var prop = _c[_b];\n                            names.set(prop.escapedName, prop);\n                        }\n                    }\n                }\n                context.resolvedProperties = ts.arrayFrom(names.values());\n            }\n            return context.resolvedProperties;\n        }\n        function getWidenedProperty(prop, context) {\n            if (!(prop.flags & 4 /* Property */)) {\n                // Since get accessors already widen their return value there is no need to\n                // widen accessor based properties here.\n                return prop;\n            }\n            var original = getTypeOfSymbol(prop);\n            var propContext = context && createWideningContext(context, prop.escapedName, /*siblings*/ undefined);\n            var widened = getWidenedTypeWithContext(original, propContext);\n            return widened === original ? prop : createSymbolWithType(prop, widened);\n        }\n        function getUndefinedProperty(prop) {\n            var cached = undefinedProperties.get(prop.escapedName);\n            if (cached) {\n                return cached;\n            }\n            var result = createSymbolWithType(prop, undefinedType);\n            result.flags |= 16777216 /* Optional */;\n            undefinedProperties.set(prop.escapedName, result);\n            return result;\n        }\n        function getWidenedTypeOfObjectLiteral(type, context) {\n            var members = ts.createSymbolTable();\n            for (var _i = 0, _a = getPropertiesOfObjectType(type); _i < _a.length; _i++) {\n                var prop = _a[_i];\n                members.set(prop.escapedName, getWidenedProperty(prop, context));\n            }\n            if (context) {\n                for (var _b = 0, _c = getPropertiesOfContext(context); _b < _c.length; _b++) {\n                    var prop = _c[_b];\n                    if (!members.has(prop.escapedName)) {\n                        members.set(prop.escapedName, getUndefinedProperty(prop));\n                    }\n                }\n            }\n            var stringIndexInfo = getIndexInfoOfType(type, 0 /* String */);\n            var numberIndexInfo = getIndexInfoOfType(type, 1 /* Number */);\n            var result = createAnonymousType(type.symbol, members, ts.emptyArray, ts.emptyArray, stringIndexInfo && createIndexInfo(getWidenedType(stringIndexInfo.type), stringIndexInfo.isReadonly), numberIndexInfo && createIndexInfo(getWidenedType(numberIndexInfo.type), numberIndexInfo.isReadonly));\n            result.objectFlags |= (ts.getObjectFlags(type) & (16384 /* JSLiteral */ | 2097152 /* NonInferrableType */)); // Retain js literal flag through widening\n            return result;\n        }\n        function getWidenedType(type) {\n            return getWidenedTypeWithContext(type, /*context*/ undefined);\n        }\n        function getWidenedTypeWithContext(type, context) {\n            if (ts.getObjectFlags(type) & 1572864 /* RequiresWidening */) {\n                if (context === undefined && type.widened) {\n                    return type.widened;\n                }\n                var result = void 0;\n                if (type.flags & (1 /* Any */ | 98304 /* Nullable */)) {\n                    result = anyType;\n                }\n                else if (isObjectLiteralType(type)) {\n                    result = getWidenedTypeOfObjectLiteral(type, context);\n                }\n                else if (type.flags & 1048576 /* Union */) {\n                    var unionContext_1 = context || createWideningContext(/*parent*/ undefined, /*propertyName*/ undefined, type.types);\n                    var widenedTypes = ts.sameMap(type.types, function (t) { return t.flags & 98304 /* Nullable */ ? t : getWidenedTypeWithContext(t, unionContext_1); });\n                    // Widening an empty object literal transitions from a highly restrictive type to\n                    // a highly inclusive one. For that reason we perform subtype reduction here if the\n                    // union includes empty object types (e.g. reducing {} | string to just {}).\n                    result = getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType) ? 2 /* Subtype */ : 1 /* Literal */);\n                }\n                else if (type.flags & 2097152 /* Intersection */) {\n                    result = getIntersectionType(ts.sameMap(type.types, getWidenedType));\n                }\n                else if (isArrayType(type) || isTupleType(type)) {\n                    result = createTypeReference(type.target, ts.sameMap(getTypeArguments(type), getWidenedType));\n                }\n                if (result && context === undefined) {\n                    type.widened = result;\n                }\n                return result || type;\n            }\n            return type;\n        }\n        /**\n         * Reports implicit any errors that occur as a result of widening 'null' and 'undefined'\n         * to 'any'. A call to reportWideningErrorsInType is normally accompanied by a call to\n         * getWidenedType. But in some cases getWidenedType is called without reporting errors\n         * (type argument inference is an example).\n         *\n         * The return value indicates whether an error was in fact reported. The particular circumstances\n         * are on a best effort basis. Currently, if the null or undefined that causes widening is inside\n         * an object literal property (arbitrarily deeply), this function reports an error. If no error is\n         * reported, reportImplicitAnyError is a suitable fallback to report a general error.\n         */\n        function reportWideningErrorsInType(type) {\n            var errorReported = false;\n            if (ts.getObjectFlags(type) & 524288 /* ContainsWideningType */) {\n                if (type.flags & 1048576 /* Union */) {\n                    if (ts.some(type.types, isEmptyObjectType)) {\n                        errorReported = true;\n                    }\n                    else {\n                        for (var _i = 0, _a = type.types; _i < _a.length; _i++) {\n                            var t = _a[_i];\n                            if (reportWideningErrorsInType(t)) {\n                                errorReported = true;\n                            }\n                        }\n                    }\n                }\n                if (isArrayType(type) || isTupleType(type)) {\n                    for (var _b = 0, _c = getTypeArguments(type); _b < _c.length; _b++) {\n                        var t = _c[_b];\n                        if (reportWideningErrorsInType(t)) {\n                            errorReported = true;\n                        }\n                    }\n                }\n                if (isObjectLiteralType(type)) {\n                    for (var _d = 0, _e = getPropertiesOfObjectType(type); _d < _e.length; _d++) {\n                        var p = _e[_d];\n                        var t = getTypeOfSymbol(p);\n                        if (ts.getObjectFlags(t) & 524288 /* ContainsWideningType */) {\n                            if (!reportWideningErrorsInType(t)) {\n                                error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));\n                            }\n                            errorReported = true;\n                        }\n                    }\n                }\n            }\n            return errorReported;\n        }\n        function reportImplicitAny(declaration, type, wideningKind) {\n            var typeAsString = typeToString(getWidenedType(type));\n            if (ts.isInJSFile(declaration) && !ts.isCheckJsEnabledForFile(ts.getSourceFileOfNode(declaration), compilerOptions)) {\n                // Only report implicit any errors/suggestions in TS and ts-check JS files\n                return;\n            }\n            var diagnostic;\n            switch (declaration.kind) {\n                case 216 /* BinaryExpression */:\n                case 163 /* PropertyDeclaration */:\n                case 162 /* PropertySignature */:\n                    diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;\n                    break;\n                case 160 /* Parameter */:\n                    var param = declaration;\n                    if (ts.isIdentifier(param.name) &&\n                        (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) &&\n                        param.parent.parameters.indexOf(param) > -1 &&\n                        (resolveName(param, param.name.escapedText, 788968 /* Type */, undefined, param.name.escapedText, /*isUse*/ true) ||\n                            param.name.originalKeywordKind && ts.isTypeNodeKind(param.name.originalKeywordKind))) {\n                        var newName = \"arg\" + param.parent.parameters.indexOf(param);\n                        errorOrSuggestion(noImplicitAny, declaration, ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, ts.declarationNameToString(param.name));\n                        return;\n                    }\n                    diagnostic = declaration.dotDotDotToken ?\n                        noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage :\n                        noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;\n                    break;\n                case 198 /* BindingElement */:\n                    diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type;\n                    if (!noImplicitAny) {\n                        // Don't issue a suggestion for binding elements since the codefix doesn't yet support them.\n                        return;\n                    }\n                    break;\n                case 308 /* JSDocFunctionType */:\n                    error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);\n                    return;\n                case 251 /* FunctionDeclaration */:\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                    if (noImplicitAny && !declaration.name) {\n                        if (wideningKind === 3 /* GeneratorYield */) {\n                            error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString);\n                        }\n                        else {\n                            error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);\n                        }\n                        return;\n                    }\n                    diagnostic = !noImplicitAny ? ts.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage :\n                        wideningKind === 3 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type :\n                            ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type;\n                    break;\n                case 190 /* MappedType */:\n                    if (noImplicitAny) {\n                        error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type);\n                    }\n                    return;\n                default:\n                    diagnostic = noImplicitAny ? ts.Diagnostics.Variable_0_implicitly_has_an_1_type : ts.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;\n            }\n            errorOrSuggestion(noImplicitAny, declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString);\n        }\n        function reportErrorsFromWidening(declaration, type, wideningKind) {\n            if (produceDiagnostics && noImplicitAny && ts.getObjectFlags(type) & 524288 /* ContainsWideningType */ && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {\n                // Report implicit any error within type if possible, otherwise report error on declaration\n                if (!reportWideningErrorsInType(type)) {\n                    reportImplicitAny(declaration, type, wideningKind);\n                }\n            }\n        }\n        function applyToParameterTypes(source, target, callback) {\n            var sourceCount = getParameterCount(source);\n            var targetCount = getParameterCount(target);\n            var sourceRestType = getEffectiveRestType(source);\n            var targetRestType = getEffectiveRestType(target);\n            var targetNonRestCount = targetRestType ? targetCount - 1 : targetCount;\n            var paramCount = sourceRestType ? targetNonRestCount : Math.min(sourceCount, targetNonRestCount);\n            var sourceThisType = getThisTypeOfSignature(source);\n            if (sourceThisType) {\n                var targetThisType = getThisTypeOfSignature(target);\n                if (targetThisType) {\n                    callback(sourceThisType, targetThisType);\n                }\n            }\n            for (var i = 0; i < paramCount; i++) {\n                callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i));\n            }\n            if (targetRestType) {\n                callback(getRestTypeAtPosition(source, paramCount), targetRestType);\n            }\n        }\n        function applyToReturnTypes(source, target, callback) {\n            var sourceTypePredicate = getTypePredicateOfSignature(source);\n            var targetTypePredicate = getTypePredicateOfSignature(target);\n            if (sourceTypePredicate && targetTypePredicate && typePredicateKindsMatch(sourceTypePredicate, targetTypePredicate) && sourceTypePredicate.type && targetTypePredicate.type) {\n                callback(sourceTypePredicate.type, targetTypePredicate.type);\n            }\n            else {\n                callback(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target));\n            }\n        }\n        function createInferenceContext(typeParameters, signature, flags, compareTypes) {\n            return createInferenceContextWorker(typeParameters.map(createInferenceInfo), signature, flags, compareTypes || compareTypesAssignable);\n        }\n        function cloneInferenceContext(context, extraFlags) {\n            if (extraFlags === void 0) { extraFlags = 0; }\n            return context && createInferenceContextWorker(ts.map(context.inferences, cloneInferenceInfo), context.signature, context.flags | extraFlags, context.compareTypes);\n        }\n        function createInferenceContextWorker(inferences, signature, flags, compareTypes) {\n            var context = {\n                inferences: inferences,\n                signature: signature,\n                flags: flags,\n                compareTypes: compareTypes,\n                mapper: makeFunctionTypeMapper(function (t) { return mapToInferredType(context, t, /*fix*/ true); }),\n                nonFixingMapper: makeFunctionTypeMapper(function (t) { return mapToInferredType(context, t, /*fix*/ false); }),\n            };\n            return context;\n        }\n        function mapToInferredType(context, t, fix) {\n            var inferences = context.inferences;\n            for (var i = 0; i < inferences.length; i++) {\n                var inference = inferences[i];\n                if (t === inference.typeParameter) {\n                    if (fix && !inference.isFixed) {\n                        clearCachedInferences(inferences);\n                        inference.isFixed = true;\n                    }\n                    return getInferredType(context, i);\n                }\n            }\n            return t;\n        }\n        function clearCachedInferences(inferences) {\n            for (var _i = 0, inferences_1 = inferences; _i < inferences_1.length; _i++) {\n                var inference = inferences_1[_i];\n                if (!inference.isFixed) {\n                    inference.inferredType = undefined;\n                }\n            }\n        }\n        function createInferenceInfo(typeParameter) {\n            return {\n                typeParameter: typeParameter,\n                candidates: undefined,\n                contraCandidates: undefined,\n                inferredType: undefined,\n                priority: undefined,\n                topLevel: true,\n                isFixed: false,\n                impliedArity: undefined\n            };\n        }\n        function cloneInferenceInfo(inference) {\n            return {\n                typeParameter: inference.typeParameter,\n                candidates: inference.candidates && inference.candidates.slice(),\n                contraCandidates: inference.contraCandidates && inference.contraCandidates.slice(),\n                inferredType: inference.inferredType,\n                priority: inference.priority,\n                topLevel: inference.topLevel,\n                isFixed: inference.isFixed,\n                impliedArity: inference.impliedArity\n            };\n        }\n        function cloneInferredPartOfContext(context) {\n            var inferences = ts.filter(context.inferences, hasInferenceCandidates);\n            return inferences.length ?\n                createInferenceContextWorker(ts.map(inferences, cloneInferenceInfo), context.signature, context.flags, context.compareTypes) :\n                undefined;\n        }\n        function getMapperFromContext(context) {\n            return context && context.mapper;\n        }\n        // Return true if the given type could possibly reference a type parameter for which\n        // we perform type inference (i.e. a type parameter of a generic function). We cache\n        // results for union and intersection types for performance reasons.\n        function couldContainTypeVariables(type) {\n            var objectFlags = ts.getObjectFlags(type);\n            if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) {\n                return !!(objectFlags & 134217728 /* CouldContainTypeVariables */);\n            }\n            var result = !!(type.flags & 465829888 /* Instantiable */ ||\n                type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) ||\n                    objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations ||\n                    objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */)) ||\n                type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && ts.some(type.types, couldContainTypeVariables));\n            if (type.flags & 3899393 /* ObjectFlagsType */) {\n                type.objectFlags |= 67108864 /* CouldContainTypeVariablesComputed */ | (result ? 134217728 /* CouldContainTypeVariables */ : 0);\n            }\n            return result;\n        }\n        function isNonGenericTopLevelType(type) {\n            if (type.aliasSymbol && !type.aliasTypeArguments) {\n                var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 254 /* TypeAliasDeclaration */);\n                return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind === 297 /* SourceFile */ ? true : n.kind === 256 /* ModuleDeclaration */ ? false : \"quit\"; }));\n            }\n            return false;\n        }\n        function isTypeParameterAtTopLevel(type, typeParameter) {\n            return !!(type === typeParameter ||\n                type.flags & 3145728 /* UnionOrIntersection */ && ts.some(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); }) ||\n                type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter));\n        }\n        /** Create an object with properties named in the string literal type. Every property has type `any` */\n        function createEmptyObjectTypeFromStringLiteral(type) {\n            var members = ts.createSymbolTable();\n            forEachType(type, function (t) {\n                if (!(t.flags & 128 /* StringLiteral */)) {\n                    return;\n                }\n                var name = ts.escapeLeadingUnderscores(t.value);\n                var literalProp = createSymbol(4 /* Property */, name);\n                literalProp.type = anyType;\n                if (t.symbol) {\n                    literalProp.declarations = t.symbol.declarations;\n                    literalProp.valueDeclaration = t.symbol.valueDeclaration;\n                }\n                members.set(name, literalProp);\n            });\n            var indexInfo = type.flags & 4 /* String */ ? createIndexInfo(emptyObjectType, /*isReadonly*/ false) : undefined;\n            return createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, indexInfo, undefined);\n        }\n        /**\n         * Infer a suitable input type for a homomorphic mapped type { [P in keyof T]: X }. We construct\n         * an object type with the same set of properties as the source type, where the type of each\n         * property is computed by inferring from the source property type to X for the type\n         * variable T[P] (i.e. we treat the type T[P] as the type variable we're inferring for).\n         */\n        function inferTypeForHomomorphicMappedType(source, target, constraint) {\n            if (inInferTypeForHomomorphicMappedType) {\n                return undefined;\n            }\n            var key = source.id + \",\" + target.id + \",\" + constraint.id;\n            if (reverseMappedCache.has(key)) {\n                return reverseMappedCache.get(key);\n            }\n            inInferTypeForHomomorphicMappedType = true;\n            var type = createReverseMappedType(source, target, constraint);\n            inInferTypeForHomomorphicMappedType = false;\n            reverseMappedCache.set(key, type);\n            return type;\n        }\n        // We consider a type to be partially inferable if it isn't marked non-inferable or if it is\n        // an object literal type with at least one property of an inferable type. For example, an object\n        // literal { a: 123, b: x => true } is marked non-inferable because it contains a context sensitive\n        // arrow function, but is considered partially inferable because property 'a' has an inferable type.\n        function isPartiallyInferableType(type) {\n            return !(ts.getObjectFlags(type) & 2097152 /* NonInferrableType */) ||\n                isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }) ||\n                isTupleType(type) && ts.some(getTypeArguments(type), isPartiallyInferableType);\n        }\n        function createReverseMappedType(source, target, constraint) {\n            // We consider a source type reverse mappable if it has a string index signature or if\n            // it has one or more properties and is of a partially inferable type.\n            if (!(getIndexInfoOfType(source, 0 /* String */) || getPropertiesOfType(source).length !== 0 && isPartiallyInferableType(source))) {\n                return undefined;\n            }\n            // For arrays and tuples we infer new arrays and tuples where the reverse mapping has been\n            // applied to the element type(s).\n            if (isArrayType(source)) {\n                return createArrayType(inferReverseMappedType(getTypeArguments(source)[0], target, constraint), isReadonlyArrayType(source));\n            }\n            if (isTupleType(source)) {\n                var elementTypes = ts.map(getTypeArguments(source), function (t) { return inferReverseMappedType(t, target, constraint); });\n                var elementFlags = getMappedTypeModifiers(target) & 4 /* IncludeOptional */ ?\n                    ts.sameMap(source.target.elementFlags, function (f) { return f & 2 /* Optional */ ? 1 /* Required */ : f; }) :\n                    source.target.elementFlags;\n                return createTupleType(elementTypes, elementFlags, source.target.readonly, source.target.labeledElementDeclarations);\n            }\n            // For all other object types we infer a new object type where the reverse mapping has been\n            // applied to the type of each property.\n            var reversed = createObjectType(2048 /* ReverseMapped */ | 16 /* Anonymous */, /*symbol*/ undefined);\n            reversed.source = source;\n            reversed.mappedType = target;\n            reversed.constraintType = constraint;\n            return reversed;\n        }\n        function getTypeOfReverseMappedSymbol(symbol) {\n            return inferReverseMappedType(symbol.propertyType, symbol.mappedType, symbol.constraintType);\n        }\n        function inferReverseMappedType(sourceType, target, constraint) {\n            var typeParameter = getIndexedAccessType(constraint.type, getTypeParameterFromMappedType(target));\n            var templateType = getTemplateTypeFromMappedType(target);\n            var inference = createInferenceInfo(typeParameter);\n            inferTypes([inference], sourceType, templateType);\n            return getTypeFromInference(inference) || unknownType;\n        }\n        function getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties) {\n            var properties, _i, properties_2, targetProp, sourceProp, targetType, sourceType;\n            return __generator(this, function (_a) {\n                switch (_a.label) {\n                    case 0:\n                        properties = getPropertiesOfType(target);\n                        _i = 0, properties_2 = properties;\n                        _a.label = 1;\n                    case 1:\n                        if (!(_i < properties_2.length)) return [3 /*break*/, 6];\n                        targetProp = properties_2[_i];\n                        // TODO: remove this when we support static private identifier fields and find other solutions to get privateNamesAndStaticFields test to pass\n                        if (isStaticPrivateIdentifierProperty(targetProp)) {\n                            return [3 /*break*/, 5];\n                        }\n                        if (!(requireOptionalProperties || !(targetProp.flags & 16777216 /* Optional */ || ts.getCheckFlags(targetProp) & 48 /* Partial */))) return [3 /*break*/, 5];\n                        sourceProp = getPropertyOfType(source, targetProp.escapedName);\n                        if (!!sourceProp) return [3 /*break*/, 3];\n                        return [4 /*yield*/, targetProp];\n                    case 2:\n                        _a.sent();\n                        return [3 /*break*/, 5];\n                    case 3:\n                        if (!matchDiscriminantProperties) return [3 /*break*/, 5];\n                        targetType = getTypeOfSymbol(targetProp);\n                        if (!(targetType.flags & 109440 /* Unit */)) return [3 /*break*/, 5];\n                        sourceType = getTypeOfSymbol(sourceProp);\n                        if (!!(sourceType.flags & 1 /* Any */ || getRegularTypeOfLiteralType(sourceType) === getRegularTypeOfLiteralType(targetType))) return [3 /*break*/, 5];\n                        return [4 /*yield*/, targetProp];\n                    case 4:\n                        _a.sent();\n                        _a.label = 5;\n                    case 5:\n                        _i++;\n                        return [3 /*break*/, 1];\n                    case 6: return [2 /*return*/];\n                }\n            });\n        }\n        function getUnmatchedProperty(source, target, requireOptionalProperties, matchDiscriminantProperties) {\n            var result = getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties).next();\n            if (!result.done)\n                return result.value;\n        }\n        function tupleTypesDefinitelyUnrelated(source, target) {\n            return !(target.target.combinedFlags & 8 /* Variadic */) && target.target.minLength > source.target.minLength ||\n                !target.target.hasRestElement && (source.target.hasRestElement || target.target.fixedLength < source.target.fixedLength);\n        }\n        function typesDefinitelyUnrelated(source, target) {\n            // Two tuple types with incompatible arities are definitely unrelated.\n            // Two object types that each have a property that is unmatched in the other are definitely unrelated.\n            return isTupleType(source) && isTupleType(target) ? tupleTypesDefinitelyUnrelated(source, target) :\n                !!getUnmatchedProperty(source, target, /*requireOptionalProperties*/ false, /*matchDiscriminantProperties*/ true) &&\n                    !!getUnmatchedProperty(target, source, /*requireOptionalProperties*/ false, /*matchDiscriminantProperties*/ false);\n        }\n        function getTypeFromInference(inference) {\n            return inference.candidates ? getUnionType(inference.candidates, 2 /* Subtype */) :\n                inference.contraCandidates ? getIntersectionType(inference.contraCandidates) :\n                    undefined;\n        }\n        function hasSkipDirectInferenceFlag(node) {\n            return !!getNodeLinks(node).skipDirectInference;\n        }\n        function isFromInferenceBlockedSource(type) {\n            return !!(type.symbol && ts.some(type.symbol.declarations, hasSkipDirectInferenceFlag));\n        }\n        function isValidBigIntString(s) {\n            var scanner = ts.createScanner(99 /* ESNext */, /*skipTrivia*/ false);\n            var success = true;\n            scanner.setOnError(function () { return success = false; });\n            scanner.setText(s + \"n\");\n            var result = scanner.scan();\n            if (result === 40 /* MinusToken */) {\n                result = scanner.scan();\n            }\n            var flags = scanner.getTokenFlags();\n            // validate that\n            // * scanning proceeded without error\n            // * a bigint can be scanned, and that when it is scanned, it is\n            // * the full length of the input string (so the scanner is one character beyond the augmented input length)\n            // * it does not contain a numeric seperator (the `BigInt` constructor does not accept a numeric seperator in its input)\n            return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === (s.length + 1) && !(flags & 512 /* ContainsSeparator */);\n        }\n        function isStringLiteralTypeValueParsableAsType(s, target) {\n            if (target.flags & 1048576 /* Union */) {\n                return !!forEachType(target, function (t) { return isStringLiteralTypeValueParsableAsType(s, t); });\n            }\n            switch (target) {\n                case stringType: return true;\n                case numberType: return s.value !== \"\" && isFinite(+(s.value));\n                case bigintType: return s.value !== \"\" && isValidBigIntString(s.value);\n                // the next 4 should be handled in `getTemplateLiteralType`, as they are all exactly one value, but are here for completeness, just in case\n                // this function is ever used on types which don't come from template literal holes\n                case trueType: return s.value === \"true\";\n                case falseType: return s.value === \"false\";\n                case undefinedType: return s.value === \"undefined\";\n                case nullType: return s.value === \"null\";\n                default: return !!(target.flags & 1 /* Any */);\n            }\n        }\n        function inferLiteralsFromTemplateLiteralType(source, target) {\n            var value = source.value;\n            var texts = target.texts;\n            var lastIndex = texts.length - 1;\n            var startText = texts[0];\n            var endText = texts[lastIndex];\n            if (!(value.startsWith(startText) && value.slice(startText.length).endsWith(endText)))\n                return undefined;\n            var matches = [];\n            var str = value.slice(startText.length, value.length - endText.length);\n            var pos = 0;\n            for (var i = 1; i < lastIndex; i++) {\n                var delim = texts[i];\n                var delimPos = delim.length > 0 ? str.indexOf(delim, pos) : pos < str.length ? pos + 1 : -1;\n                if (delimPos < 0)\n                    return undefined;\n                matches.push(getLiteralType(str.slice(pos, delimPos)));\n                pos = delimPos + delim.length;\n            }\n            matches.push(getLiteralType(str.slice(pos)));\n            return matches;\n        }\n        function inferTypes(inferences, originalSource, originalTarget, priority, contravariant) {\n            if (priority === void 0) { priority = 0; }\n            if (contravariant === void 0) { contravariant = false; }\n            var bivariant = false;\n            var propagationType;\n            var inferencePriority = 1024 /* MaxValue */;\n            var allowComplexConstraintInference = true;\n            var visited;\n            var sourceStack;\n            var targetStack;\n            var expandingFlags = 0 /* None */;\n            inferFromTypes(originalSource, originalTarget);\n            function inferFromTypes(source, target) {\n                if (!couldContainTypeVariables(target)) {\n                    return;\n                }\n                if (source === wildcardType) {\n                    // We are inferring from an 'any' type. We want to infer this type for every type parameter\n                    // referenced in the target type, so we record it as the propagation type and infer from the\n                    // target to itself. Then, as we find candidates we substitute the propagation type.\n                    var savePropagationType = propagationType;\n                    propagationType = source;\n                    inferFromTypes(target, target);\n                    propagationType = savePropagationType;\n                    return;\n                }\n                if (source.aliasSymbol && source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) {\n                    // Source and target are types originating in the same generic type alias declaration.\n                    // Simply infer from source type arguments to target type arguments.\n                    inferFromTypeArguments(source.aliasTypeArguments, target.aliasTypeArguments, getAliasVariances(source.aliasSymbol));\n                    return;\n                }\n                if (source === target && source.flags & 3145728 /* UnionOrIntersection */) {\n                    // When source and target are the same union or intersection type, just relate each constituent\n                    // type to itself.\n                    for (var _i = 0, _a = source.types; _i < _a.length; _i++) {\n                        var t = _a[_i];\n                        inferFromTypes(t, t);\n                    }\n                    return;\n                }\n                if (target.flags & 1048576 /* Union */) {\n                    // First, infer between identically matching source and target constituents and remove the\n                    // matching types.\n                    var _b = inferFromMatchingTypes(source.flags & 1048576 /* Union */ ? source.types : [source], target.types, isTypeOrBaseIdenticalTo), tempSources = _b[0], tempTargets = _b[1];\n                    // Next, infer between closely matching source and target constituents and remove\n                    // the matching types. Types closely match when they are instantiations of the same\n                    // object type or instantiations of the same type alias.\n                    var _c = inferFromMatchingTypes(tempSources, tempTargets, isTypeCloselyMatchedBy), sources = _c[0], targets = _c[1];\n                    if (targets.length === 0) {\n                        return;\n                    }\n                    target = getUnionType(targets);\n                    if (sources.length === 0) {\n                        // All source constituents have been matched and there is nothing further to infer from.\n                        // However, simply making no inferences is undesirable because it could ultimately mean\n                        // inferring a type parameter constraint. Instead, make a lower priority inference from\n                        // the full source to whatever remains in the target. For example, when inferring from\n                        // string to 'string | T', make a lower priority inference of string for T.\n                        inferWithPriority(source, target, 1 /* NakedTypeVariable */);\n                        return;\n                    }\n                    source = getUnionType(sources);\n                }\n                else if (target.flags & 2097152 /* Intersection */ && ts.some(target.types, function (t) { return !!getInferenceInfoForType(t) || (isGenericMappedType(t) && !!getInferenceInfoForType(getHomomorphicTypeVariable(t) || neverType)); })) {\n                    // We reduce intersection types only when they contain naked type parameters. For example, when\n                    // inferring from 'string[] & { extra: any }' to 'string[] & T' we want to remove string[] and\n                    // infer { extra: any } for T. But when inferring to 'string[] & Iterable<T>' we want to keep the\n                    // string[] on the source side and infer string for T.\n                    // Likewise, we consider a homomorphic mapped type constrainted to the target type parameter as similar to a \"naked type variable\"\n                    // in such scenarios.\n                    if (!(source.flags & 1048576 /* Union */)) {\n                        // Infer between identically matching source and target constituents and remove the matching types.\n                        var _d = inferFromMatchingTypes(source.flags & 2097152 /* Intersection */ ? source.types : [source], target.types, isTypeIdenticalTo), sources = _d[0], targets = _d[1];\n                        if (sources.length === 0 || targets.length === 0) {\n                            return;\n                        }\n                        source = getIntersectionType(sources);\n                        target = getIntersectionType(targets);\n                    }\n                }\n                else if (target.flags & (8388608 /* IndexedAccess */ | 33554432 /* Substitution */)) {\n                    target = getActualTypeVariable(target);\n                }\n                if (target.flags & 8650752 /* TypeVariable */) {\n                    // If target is a type parameter, make an inference, unless the source type contains\n                    // the anyFunctionType (the wildcard type that's used to avoid contextually typing functions).\n                    // Because the anyFunctionType is internal, it should not be exposed to the user by adding\n                    // it as an inference candidate. Hopefully, a better candidate will come along that does\n                    // not contain anyFunctionType when we come back to this argument for its second round\n                    // of inference. Also, we exclude inferences for silentNeverType (which is used as a wildcard\n                    // when constructing types from type parameters that had no inference candidates).\n                    if (ts.getObjectFlags(source) & 2097152 /* NonInferrableType */ || source === nonInferrableAnyType || source === silentNeverType ||\n                        (priority & 64 /* ReturnType */ && (source === autoType || source === autoArrayType)) || isFromInferenceBlockedSource(source)) {\n                        return;\n                    }\n                    var inference = getInferenceInfoForType(target);\n                    if (inference) {\n                        if (!inference.isFixed) {\n                            if (inference.priority === undefined || priority < inference.priority) {\n                                inference.candidates = undefined;\n                                inference.contraCandidates = undefined;\n                                inference.topLevel = true;\n                                inference.priority = priority;\n                            }\n                            if (priority === inference.priority) {\n                                var candidate = propagationType || source;\n                                // We make contravariant inferences only if we are in a pure contravariant position,\n                                // i.e. only if we have not descended into a bivariant position.\n                                if (contravariant && !bivariant) {\n                                    if (!ts.contains(inference.contraCandidates, candidate)) {\n                                        inference.contraCandidates = ts.append(inference.contraCandidates, candidate);\n                                        clearCachedInferences(inferences);\n                                    }\n                                }\n                                else if (!ts.contains(inference.candidates, candidate)) {\n                                    inference.candidates = ts.append(inference.candidates, candidate);\n                                    clearCachedInferences(inferences);\n                                }\n                            }\n                            if (!(priority & 64 /* ReturnType */) && target.flags & 262144 /* TypeParameter */ && inference.topLevel && !isTypeParameterAtTopLevel(originalTarget, target)) {\n                                inference.topLevel = false;\n                                clearCachedInferences(inferences);\n                            }\n                        }\n                        inferencePriority = Math.min(inferencePriority, priority);\n                        return;\n                    }\n                    else {\n                        // Infer to the simplified version of an indexed access, if possible, to (hopefully) expose more bare type parameters to the inference engine\n                        var simplified = getSimplifiedType(target, /*writing*/ false);\n                        if (simplified !== target) {\n                            invokeOnce(source, simplified, inferFromTypes);\n                        }\n                        else if (target.flags & 8388608 /* IndexedAccess */) {\n                            var indexType = getSimplifiedType(target.indexType, /*writing*/ false);\n                            // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider\n                            // that key of that access to be \"instantiated\", since we're looking to find the infernce goal in any way we can.\n                            if (indexType.flags & 465829888 /* Instantiable */) {\n                                var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false);\n                                if (simplified_1 && simplified_1 !== target) {\n                                    invokeOnce(source, simplified_1, inferFromTypes);\n                                }\n                            }\n                        }\n                    }\n                }\n                if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target)) &&\n                    !(source.node && target.node)) {\n                    // If source and target are references to the same generic type, infer from type arguments\n                    inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target));\n                }\n                else if (source.flags & 4194304 /* Index */ && target.flags & 4194304 /* Index */) {\n                    contravariant = !contravariant;\n                    inferFromTypes(source.type, target.type);\n                    contravariant = !contravariant;\n                }\n                else if ((isLiteralType(source) || source.flags & 4 /* String */) && target.flags & 4194304 /* Index */) {\n                    var empty = createEmptyObjectTypeFromStringLiteral(source);\n                    contravariant = !contravariant;\n                    inferWithPriority(empty, target.type, 128 /* LiteralKeyof */);\n                    contravariant = !contravariant;\n                }\n                else if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) {\n                    inferFromTypes(source.objectType, target.objectType);\n                    inferFromTypes(source.indexType, target.indexType);\n                }\n                else if (source.flags & 268435456 /* StringMapping */ && target.flags & 268435456 /* StringMapping */) {\n                    if (source.symbol === target.symbol) {\n                        inferFromTypes(source.type, target.type);\n                    }\n                }\n                else if (target.flags & 16777216 /* Conditional */) {\n                    invokeOnce(source, target, inferToConditionalType);\n                }\n                else if (target.flags & 3145728 /* UnionOrIntersection */) {\n                    inferToMultipleTypes(source, target.types, target.flags);\n                }\n                else if (source.flags & 1048576 /* Union */) {\n                    // Source is a union or intersection type, infer from each constituent type\n                    var sourceTypes = source.types;\n                    for (var _e = 0, sourceTypes_2 = sourceTypes; _e < sourceTypes_2.length; _e++) {\n                        var sourceType = sourceTypes_2[_e];\n                        inferFromTypes(sourceType, target);\n                    }\n                }\n                else if (target.flags & 134217728 /* TemplateLiteral */) {\n                    inferToTemplateLiteralType(source, target);\n                }\n                else {\n                    source = getReducedType(source);\n                    if (!(priority & 256 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {\n                        var apparentSource = getApparentType(source);\n                        // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type.\n                        // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes`\n                        // with the simplified source.\n                        if (apparentSource !== source && allowComplexConstraintInference && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {\n                            // TODO: The `allowComplexConstraintInference` flag is a hack! This forbids inference from complex constraints within constraints!\n                            // This isn't required algorithmically, but rather is used to lower the memory burden caused by performing inference\n                            // that is _too good_ in projects with complicated constraints (eg, fp-ts). In such cases, if we did not limit ourselves\n                            // here, we might produce more valid inferences for types, causing us to do more checks and perform more instantiations\n                            // (in addition to the extra stack depth here) which, in turn, can push the already close process over its limit.\n                            // TL;DR: If we ever become generally more memory efficient (or our resource budget ever increases), we should just\n                            // remove this `allowComplexConstraintInference` flag.\n                            allowComplexConstraintInference = false;\n                            return inferFromTypes(apparentSource, target);\n                        }\n                        source = apparentSource;\n                    }\n                    if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */)) {\n                        invokeOnce(source, target, inferFromObjectTypes);\n                    }\n                }\n            }\n            function inferWithPriority(source, target, newPriority) {\n                var savePriority = priority;\n                priority |= newPriority;\n                inferFromTypes(source, target);\n                priority = savePriority;\n            }\n            function invokeOnce(source, target, action) {\n                var key = source.id + \",\" + target.id;\n                var status = visited && visited.get(key);\n                if (status !== undefined) {\n                    inferencePriority = Math.min(inferencePriority, status);\n                    return;\n                }\n                (visited || (visited = new ts.Map())).set(key, -1 /* Circularity */);\n                var saveInferencePriority = inferencePriority;\n                inferencePriority = 1024 /* MaxValue */;\n                // We stop inferring and report a circularity if we encounter duplicate recursion identities on both\n                // the source side and the target side.\n                var saveExpandingFlags = expandingFlags;\n                var sourceIdentity = getRecursionIdentity(source) || source;\n                var targetIdentity = getRecursionIdentity(target) || target;\n                if (sourceIdentity && ts.contains(sourceStack, sourceIdentity))\n                    expandingFlags |= 1 /* Source */;\n                if (targetIdentity && ts.contains(targetStack, targetIdentity))\n                    expandingFlags |= 2 /* Target */;\n                if (expandingFlags !== 3 /* Both */) {\n                    if (sourceIdentity)\n                        (sourceStack || (sourceStack = [])).push(sourceIdentity);\n                    if (targetIdentity)\n                        (targetStack || (targetStack = [])).push(targetIdentity);\n                    action(source, target);\n                    if (targetIdentity)\n                        targetStack.pop();\n                    if (sourceIdentity)\n                        sourceStack.pop();\n                }\n                else {\n                    inferencePriority = -1 /* Circularity */;\n                }\n                expandingFlags = saveExpandingFlags;\n                visited.set(key, inferencePriority);\n                inferencePriority = Math.min(inferencePriority, saveInferencePriority);\n            }\n            function inferFromMatchingTypes(sources, targets, matches) {\n                var matchedSources;\n                var matchedTargets;\n                for (var _i = 0, targets_1 = targets; _i < targets_1.length; _i++) {\n                    var t = targets_1[_i];\n                    for (var _a = 0, sources_1 = sources; _a < sources_1.length; _a++) {\n                        var s = sources_1[_a];\n                        if (matches(s, t)) {\n                            inferFromTypes(s, t);\n                            matchedSources = ts.appendIfUnique(matchedSources, s);\n                            matchedTargets = ts.appendIfUnique(matchedTargets, t);\n                        }\n                    }\n                }\n                return [\n                    matchedSources ? ts.filter(sources, function (t) { return !ts.contains(matchedSources, t); }) : sources,\n                    matchedTargets ? ts.filter(targets, function (t) { return !ts.contains(matchedTargets, t); }) : targets,\n                ];\n            }\n            function inferFromTypeArguments(sourceTypes, targetTypes, variances) {\n                var count = sourceTypes.length < targetTypes.length ? sourceTypes.length : targetTypes.length;\n                for (var i = 0; i < count; i++) {\n                    if (i < variances.length && (variances[i] & 7 /* VarianceMask */) === 2 /* Contravariant */) {\n                        inferFromContravariantTypes(sourceTypes[i], targetTypes[i]);\n                    }\n                    else {\n                        inferFromTypes(sourceTypes[i], targetTypes[i]);\n                    }\n                }\n            }\n            function inferFromContravariantTypes(source, target) {\n                if (strictFunctionTypes || priority & 512 /* AlwaysStrict */) {\n                    contravariant = !contravariant;\n                    inferFromTypes(source, target);\n                    contravariant = !contravariant;\n                }\n                else {\n                    inferFromTypes(source, target);\n                }\n            }\n            function getInferenceInfoForType(type) {\n                if (type.flags & 8650752 /* TypeVariable */) {\n                    for (var _i = 0, inferences_2 = inferences; _i < inferences_2.length; _i++) {\n                        var inference = inferences_2[_i];\n                        if (type === inference.typeParameter) {\n                            return inference;\n                        }\n                    }\n                }\n                return undefined;\n            }\n            function getSingleTypeVariableFromIntersectionTypes(types) {\n                var typeVariable;\n                for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {\n                    var type = types_16[_i];\n                    var t = type.flags & 2097152 /* Intersection */ && ts.find(type.types, function (t) { return !!getInferenceInfoForType(t); });\n                    if (!t || typeVariable && t !== typeVariable) {\n                        return undefined;\n                    }\n                    typeVariable = t;\n                }\n                return typeVariable;\n            }\n            function inferToMultipleTypes(source, targets, targetFlags) {\n                var typeVariableCount = 0;\n                if (targetFlags & 1048576 /* Union */) {\n                    var nakedTypeVariable = void 0;\n                    var sources = source.flags & 1048576 /* Union */ ? source.types : [source];\n                    var matched_1 = new Array(sources.length);\n                    var inferenceCircularity = false;\n                    // First infer to types that are not naked type variables. For each source type we\n                    // track whether inferences were made from that particular type to some target with\n                    // equal priority (i.e. of equal quality) to what we would infer for a naked type\n                    // parameter.\n                    for (var _i = 0, targets_2 = targets; _i < targets_2.length; _i++) {\n                        var t = targets_2[_i];\n                        if (getInferenceInfoForType(t)) {\n                            nakedTypeVariable = t;\n                            typeVariableCount++;\n                        }\n                        else {\n                            for (var i = 0; i < sources.length; i++) {\n                                var saveInferencePriority = inferencePriority;\n                                inferencePriority = 1024 /* MaxValue */;\n                                inferFromTypes(sources[i], t);\n                                if (inferencePriority === priority)\n                                    matched_1[i] = true;\n                                inferenceCircularity = inferenceCircularity || inferencePriority === -1 /* Circularity */;\n                                inferencePriority = Math.min(inferencePriority, saveInferencePriority);\n                            }\n                        }\n                    }\n                    if (typeVariableCount === 0) {\n                        // If every target is an intersection of types containing a single naked type variable,\n                        // make a lower priority inference to that type variable. This handles inferring from\n                        // 'A | B' to 'T & (X | Y)' where we want to infer 'A | B' for T.\n                        var intersectionTypeVariable = getSingleTypeVariableFromIntersectionTypes(targets);\n                        if (intersectionTypeVariable) {\n                            inferWithPriority(source, intersectionTypeVariable, 1 /* NakedTypeVariable */);\n                        }\n                        return;\n                    }\n                    // If the target has a single naked type variable and no inference circularities were\n                    // encountered above (meaning we explored the types fully), create a union of the source\n                    // types from which no inferences have been made so far and infer from that union to the\n                    // naked type variable.\n                    if (typeVariableCount === 1 && !inferenceCircularity) {\n                        var unmatched = ts.flatMap(sources, function (s, i) { return matched_1[i] ? undefined : s; });\n                        if (unmatched.length) {\n                            inferFromTypes(getUnionType(unmatched), nakedTypeVariable);\n                            return;\n                        }\n                    }\n                }\n                else {\n                    // We infer from types that are not naked type variables first so that inferences we\n                    // make from nested naked type variables and given slightly higher priority by virtue\n                    // of being first in the candidates array.\n                    for (var _a = 0, targets_3 = targets; _a < targets_3.length; _a++) {\n                        var t = targets_3[_a];\n                        if (getInferenceInfoForType(t)) {\n                            typeVariableCount++;\n                        }\n                        else {\n                            inferFromTypes(source, t);\n                        }\n                    }\n                }\n                // Inferences directly to naked type variables are given lower priority as they are\n                // less specific. For example, when inferring from Promise<string> to T | Promise<T>,\n                // we want to infer string for T, not Promise<string> | string. For intersection types\n                // we only infer to single naked type variables.\n                if (targetFlags & 2097152 /* Intersection */ ? typeVariableCount === 1 : typeVariableCount > 0) {\n                    for (var _b = 0, targets_4 = targets; _b < targets_4.length; _b++) {\n                        var t = targets_4[_b];\n                        if (getInferenceInfoForType(t)) {\n                            inferWithPriority(source, t, 1 /* NakedTypeVariable */);\n                        }\n                    }\n                }\n            }\n            function inferToMappedType(source, target, constraintType) {\n                if (constraintType.flags & 1048576 /* Union */) {\n                    var result = false;\n                    for (var _i = 0, _a = constraintType.types; _i < _a.length; _i++) {\n                        var type = _a[_i];\n                        result = inferToMappedType(source, target, type) || result;\n                    }\n                    return result;\n                }\n                if (constraintType.flags & 4194304 /* Index */) {\n                    // We're inferring from some source type S to a homomorphic mapped type { [P in keyof T]: X },\n                    // where T is a type variable. Use inferTypeForHomomorphicMappedType to infer a suitable source\n                    // type and then make a secondary inference from that type to T. We make a secondary inference\n                    // such that direct inferences to T get priority over inferences to Partial<T>, for example.\n                    var inference = getInferenceInfoForType(constraintType.type);\n                    if (inference && !inference.isFixed && !isFromInferenceBlockedSource(source)) {\n                        var inferredType = inferTypeForHomomorphicMappedType(source, target, constraintType);\n                        if (inferredType) {\n                            // We assign a lower priority to inferences made from types containing non-inferrable\n                            // types because we may only have a partial result (i.e. we may have failed to make\n                            // reverse inferences for some properties).\n                            inferWithPriority(inferredType, inference.typeParameter, ts.getObjectFlags(source) & 2097152 /* NonInferrableType */ ?\n                                8 /* PartialHomomorphicMappedType */ :\n                                4 /* HomomorphicMappedType */);\n                        }\n                    }\n                    return true;\n                }\n                if (constraintType.flags & 262144 /* TypeParameter */) {\n                    // We're inferring from some source type S to a mapped type { [P in K]: X }, where K is a type\n                    // parameter. First infer from 'keyof S' to K.\n                    inferWithPriority(getIndexType(source), constraintType, 16 /* MappedTypeConstraint */);\n                    // If K is constrained to a type C, also infer to C. Thus, for a mapped type { [P in K]: X },\n                    // where K extends keyof T, we make the same inferences as for a homomorphic mapped type\n                    // { [P in keyof T]: X }. This enables us to make meaningful inferences when the target is a\n                    // Pick<T, K>.\n                    var extendedConstraint = getConstraintOfType(constraintType);\n                    if (extendedConstraint && inferToMappedType(source, target, extendedConstraint)) {\n                        return true;\n                    }\n                    // If no inferences can be made to K's constraint, infer from a union of the property types\n                    // in the source to the template type X.\n                    var propTypes = ts.map(getPropertiesOfType(source), getTypeOfSymbol);\n                    var stringIndexType = getIndexTypeOfType(source, 0 /* String */);\n                    var numberIndexInfo = getNonEnumNumberIndexInfo(source);\n                    var numberIndexType = numberIndexInfo && numberIndexInfo.type;\n                    inferFromTypes(getUnionType(ts.append(ts.append(propTypes, stringIndexType), numberIndexType)), getTemplateTypeFromMappedType(target));\n                    return true;\n                }\n                return false;\n            }\n            function inferToConditionalType(source, target) {\n                if (source.flags & 16777216 /* Conditional */) {\n                    inferFromTypes(source.checkType, target.checkType);\n                    inferFromTypes(source.extendsType, target.extendsType);\n                    inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target));\n                    inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target));\n                }\n                else {\n                    var savePriority = priority;\n                    priority |= contravariant ? 32 /* ContravariantConditional */ : 0;\n                    var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)];\n                    inferToMultipleTypes(source, targetTypes, target.flags);\n                    priority = savePriority;\n                }\n            }\n            function inferToTemplateLiteralType(source, target) {\n                var matches = source.flags & 128 /* StringLiteral */ ? inferLiteralsFromTemplateLiteralType(source, target) :\n                    source.flags & 134217728 /* TemplateLiteral */ && ts.arraysEqual(source.texts, target.texts) ? source.types :\n                        undefined;\n                var types = target.types;\n                for (var i = 0; i < types.length; i++) {\n                    inferFromTypes(matches ? matches[i] : neverType, types[i]);\n                }\n            }\n            function inferFromObjectTypes(source, target) {\n                if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) {\n                    // If source and target are references to the same generic type, infer from type arguments\n                    inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target));\n                    return;\n                }\n                if (isGenericMappedType(source) && isGenericMappedType(target)) {\n                    // The source and target types are generic types { [P in S]: X } and { [P in T]: Y }, so we infer\n                    // from S to T and from X to Y.\n                    inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));\n                    inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));\n                    var sourceNameType = getNameTypeFromMappedType(source);\n                    var targetNameType = getNameTypeFromMappedType(target);\n                    if (sourceNameType && targetNameType)\n                        inferFromTypes(sourceNameType, targetNameType);\n                }\n                if (ts.getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) {\n                    var constraintType = getConstraintTypeFromMappedType(target);\n                    if (inferToMappedType(source, target, constraintType)) {\n                        return;\n                    }\n                }\n                // Infer from the members of source and target only if the two types are possibly related\n                if (!typesDefinitelyUnrelated(source, target)) {\n                    if (isArrayType(source) || isTupleType(source)) {\n                        if (isTupleType(target)) {\n                            var sourceArity = getTypeReferenceArity(source);\n                            var targetArity = getTypeReferenceArity(target);\n                            var elementTypes = getTypeArguments(target);\n                            var elementFlags = target.target.elementFlags;\n                            // When source and target are tuple types with the same structure (fixed, variadic, and rest are matched\n                            // to the same kind in each position), simply infer between the element types.\n                            if (isTupleType(source) && isTupleTypeStructureMatching(source, target)) {\n                                for (var i = 0; i < targetArity; i++) {\n                                    inferFromTypes(getTypeArguments(source)[i], elementTypes[i]);\n                                }\n                                return;\n                            }\n                            var startLength = isTupleType(source) ? Math.min(source.target.fixedLength, target.target.fixedLength) : 0;\n                            var endLength = Math.min(isTupleType(source) ? getEndElementCount(source.target, 3 /* Fixed */) : 0, target.target.hasRestElement ? getEndElementCount(target.target, 3 /* Fixed */) : 0);\n                            // Infer between starting fixed elements.\n                            for (var i = 0; i < startLength; i++) {\n                                inferFromTypes(getTypeArguments(source)[i], elementTypes[i]);\n                            }\n                            if (!isTupleType(source) || sourceArity - startLength - endLength === 1 && source.target.elementFlags[startLength] & 4 /* Rest */) {\n                                // Single rest element remains in source, infer from that to every element in target\n                                var restType = getTypeArguments(source)[startLength];\n                                for (var i = startLength; i < targetArity - endLength; i++) {\n                                    inferFromTypes(elementFlags[i] & 8 /* Variadic */ ? createArrayType(restType) : restType, elementTypes[i]);\n                                }\n                            }\n                            else {\n                                var middleLength = targetArity - startLength - endLength;\n                                if (middleLength === 2 && elementFlags[startLength] & elementFlags[startLength + 1] & 8 /* Variadic */ && isTupleType(source)) {\n                                    // Middle of target is [...T, ...U] and source is tuple type\n                                    var targetInfo = getInferenceInfoForType(elementTypes[startLength]);\n                                    if (targetInfo && targetInfo.impliedArity !== undefined) {\n                                        // Infer slices from source based on implied arity of T.\n                                        inferFromTypes(sliceTupleType(source, startLength, endLength + sourceArity - targetInfo.impliedArity), elementTypes[startLength]);\n                                        inferFromTypes(sliceTupleType(source, startLength + targetInfo.impliedArity, endLength), elementTypes[startLength + 1]);\n                                    }\n                                }\n                                else if (middleLength === 1 && elementFlags[startLength] & 8 /* Variadic */) {\n                                    // Middle of target is exactly one variadic element. Infer the slice between the fixed parts in the source.\n                                    // If target ends in optional element(s), make a lower priority a speculative inference.\n                                    var endsInOptional = target.target.elementFlags[targetArity - 1] & 2 /* Optional */;\n                                    var sourceSlice = isTupleType(source) ? sliceTupleType(source, startLength, endLength) : createArrayType(getTypeArguments(source)[0]);\n                                    inferWithPriority(sourceSlice, elementTypes[startLength], endsInOptional ? 2 /* SpeculativeTuple */ : 0);\n                                }\n                                else if (middleLength === 1 && elementFlags[startLength] & 4 /* Rest */) {\n                                    // Middle of target is exactly one rest element. If middle of source is not empty, infer union of middle element types.\n                                    var restType = isTupleType(source) ? getElementTypeOfSliceOfTupleType(source, startLength, endLength) : getTypeArguments(source)[0];\n                                    if (restType) {\n                                        inferFromTypes(restType, elementTypes[startLength]);\n                                    }\n                                }\n                            }\n                            // Infer between ending fixed elements\n                            for (var i = 0; i < endLength; i++) {\n                                inferFromTypes(getTypeArguments(source)[sourceArity - i - 1], elementTypes[targetArity - i - 1]);\n                            }\n                            return;\n                        }\n                        if (isArrayType(target)) {\n                            inferFromIndexTypes(source, target);\n                            return;\n                        }\n                    }\n                    inferFromProperties(source, target);\n                    inferFromSignatures(source, target, 0 /* Call */);\n                    inferFromSignatures(source, target, 1 /* Construct */);\n                    inferFromIndexTypes(source, target);\n                }\n            }\n            function inferFromProperties(source, target) {\n                var properties = getPropertiesOfObjectType(target);\n                for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) {\n                    var targetProp = properties_3[_i];\n                    var sourceProp = getPropertyOfType(source, targetProp.escapedName);\n                    if (sourceProp) {\n                        inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp));\n                    }\n                }\n            }\n            function inferFromSignatures(source, target, kind) {\n                var sourceSignatures = getSignaturesOfType(source, kind);\n                var targetSignatures = getSignaturesOfType(target, kind);\n                var sourceLen = sourceSignatures.length;\n                var targetLen = targetSignatures.length;\n                var len = sourceLen < targetLen ? sourceLen : targetLen;\n                var skipParameters = !!(ts.getObjectFlags(source) & 2097152 /* NonInferrableType */);\n                for (var i = 0; i < len; i++) {\n                    inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i]), skipParameters);\n                }\n            }\n            function inferFromSignature(source, target, skipParameters) {\n                if (!skipParameters) {\n                    var saveBivariant = bivariant;\n                    var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;\n                    // Once we descend into a bivariant signature we remain bivariant for all nested inferences\n                    bivariant = bivariant || kind === 165 /* MethodDeclaration */ || kind === 164 /* MethodSignature */ || kind === 166 /* Constructor */;\n                    applyToParameterTypes(source, target, inferFromContravariantTypes);\n                    bivariant = saveBivariant;\n                }\n                applyToReturnTypes(source, target, inferFromTypes);\n            }\n            function inferFromIndexTypes(source, target) {\n                var targetStringIndexType = getIndexTypeOfType(target, 0 /* String */);\n                if (targetStringIndexType) {\n                    var sourceIndexType = getIndexTypeOfType(source, 0 /* String */) ||\n                        getImplicitIndexTypeOfType(source, 0 /* String */);\n                    if (sourceIndexType) {\n                        inferFromTypes(sourceIndexType, targetStringIndexType);\n                    }\n                }\n                var targetNumberIndexType = getIndexTypeOfType(target, 1 /* Number */);\n                if (targetNumberIndexType) {\n                    var sourceIndexType = getIndexTypeOfType(source, 1 /* Number */) ||\n                        getIndexTypeOfType(source, 0 /* String */) ||\n                        getImplicitIndexTypeOfType(source, 1 /* Number */);\n                    if (sourceIndexType) {\n                        inferFromTypes(sourceIndexType, targetNumberIndexType);\n                    }\n                }\n            }\n        }\n        function isTypeOrBaseIdenticalTo(s, t) {\n            return isTypeIdenticalTo(s, t) || !!(t.flags & 4 /* String */ && s.flags & 128 /* StringLiteral */ || t.flags & 8 /* Number */ && s.flags & 256 /* NumberLiteral */);\n        }\n        function isTypeCloselyMatchedBy(s, t) {\n            return !!(s.flags & 524288 /* Object */ && t.flags & 524288 /* Object */ && s.symbol && s.symbol === t.symbol ||\n                s.aliasSymbol && s.aliasTypeArguments && s.aliasSymbol === t.aliasSymbol);\n        }\n        function hasPrimitiveConstraint(type) {\n            var constraint = getConstraintOfTypeParameter(type);\n            return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */);\n        }\n        function isObjectLiteralType(type) {\n            return !!(ts.getObjectFlags(type) & 128 /* ObjectLiteral */);\n        }\n        function isObjectOrArrayLiteralType(type) {\n            return !!(ts.getObjectFlags(type) & (128 /* ObjectLiteral */ | 65536 /* ArrayLiteral */));\n        }\n        function unionObjectAndArrayLiteralCandidates(candidates) {\n            if (candidates.length > 1) {\n                var objectLiterals = ts.filter(candidates, isObjectOrArrayLiteralType);\n                if (objectLiterals.length) {\n                    var literalsType = getUnionType(objectLiterals, 2 /* Subtype */);\n                    return ts.concatenate(ts.filter(candidates, function (t) { return !isObjectOrArrayLiteralType(t); }), [literalsType]);\n                }\n            }\n            return candidates;\n        }\n        function getContravariantInference(inference) {\n            return inference.priority & 208 /* PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates);\n        }\n        function getCovariantInference(inference, signature) {\n            // Extract all object and array literal types and replace them with a single widened and normalized type.\n            var candidates = unionObjectAndArrayLiteralCandidates(inference.candidates);\n            // We widen inferred literal types if\n            // all inferences were made to top-level occurrences of the type parameter, and\n            // the type parameter has no constraint or its constraint includes no primitive or literal types, and\n            // the type parameter was fixed during inference or does not occur at top-level in the return type.\n            var primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter);\n            var widenLiteralTypes = !primitiveConstraint && inference.topLevel &&\n                (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter));\n            var baseCandidates = primitiveConstraint ? ts.sameMap(candidates, getRegularTypeOfLiteralType) :\n                widenLiteralTypes ? ts.sameMap(candidates, getWidenedLiteralType) :\n                    candidates;\n            // If all inferences were made from a position that implies a combined result, infer a union type.\n            // Otherwise, infer a common supertype.\n            var unwidenedType = inference.priority & 208 /* PriorityImpliesCombination */ ?\n                getUnionType(baseCandidates, 2 /* Subtype */) :\n                getCommonSupertype(baseCandidates);\n            return getWidenedType(unwidenedType);\n        }\n        function getInferredType(context, index) {\n            var inference = context.inferences[index];\n            if (!inference.inferredType) {\n                var inferredType = void 0;\n                var signature = context.signature;\n                if (signature) {\n                    var inferredCovariantType = inference.candidates ? getCovariantInference(inference, signature) : undefined;\n                    if (inference.contraCandidates) {\n                        var inferredContravariantType = getContravariantInference(inference);\n                        // If we have both co- and contra-variant inferences, we prefer the contra-variant inference\n                        // unless the co-variant inference is a subtype and not 'never'.\n                        inferredType = inferredCovariantType && !(inferredCovariantType.flags & 131072 /* Never */) &&\n                            isTypeSubtypeOf(inferredCovariantType, inferredContravariantType) ?\n                            inferredCovariantType : inferredContravariantType;\n                    }\n                    else if (inferredCovariantType) {\n                        inferredType = inferredCovariantType;\n                    }\n                    else if (context.flags & 1 /* NoDefault */) {\n                        // We use silentNeverType as the wildcard that signals no inferences.\n                        inferredType = silentNeverType;\n                    }\n                    else {\n                        // Infer either the default or the empty object type when no inferences were\n                        // made. It is important to remember that in this case, inference still\n                        // succeeds, meaning there is no error for not having inference candidates. An\n                        // inference error only occurs when there are *conflicting* candidates, i.e.\n                        // candidates with no common supertype.\n                        var defaultType = getDefaultFromTypeParameter(inference.typeParameter);\n                        if (defaultType) {\n                            // Instantiate the default type. Any forward reference to a type\n                            // parameter should be instantiated to the empty object type.\n                            inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper));\n                        }\n                    }\n                }\n                else {\n                    inferredType = getTypeFromInference(inference);\n                }\n                inference.inferredType = inferredType || getDefaultTypeArgumentType(!!(context.flags & 2 /* AnyDefault */));\n                var constraint = getConstraintOfTypeParameter(inference.typeParameter);\n                if (constraint) {\n                    var instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);\n                    if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {\n                        inference.inferredType = inferredType = instantiatedConstraint;\n                    }\n                }\n            }\n            return inference.inferredType;\n        }\n        function getDefaultTypeArgumentType(isInJavaScriptFile) {\n            return isInJavaScriptFile ? anyType : unknownType;\n        }\n        function getInferredTypes(context) {\n            var result = [];\n            for (var i = 0; i < context.inferences.length; i++) {\n                result.push(getInferredType(context, i));\n            }\n            return result;\n        }\n        // EXPRESSION TYPE CHECKING\n        function getCannotFindNameDiagnosticForName(node) {\n            switch (node.escapedText) {\n                case \"document\":\n                case \"console\":\n                    return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom;\n                case \"$\":\n                    return compilerOptions.types\n                        ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig\n                        : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery;\n                case \"describe\":\n                case \"suite\":\n                case \"it\":\n                case \"test\":\n                    return compilerOptions.types\n                        ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig\n                        : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha;\n                case \"process\":\n                case \"require\":\n                case \"Buffer\":\n                case \"module\":\n                    return compilerOptions.types\n                        ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig\n                        : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode;\n                case \"Map\":\n                case \"Set\":\n                case \"Promise\":\n                case \"Symbol\":\n                case \"WeakMap\":\n                case \"WeakSet\":\n                case \"Iterator\":\n                case \"AsyncIterator\":\n                case \"SharedArrayBuffer\":\n                case \"Atomics\":\n                case \"AsyncIterable\":\n                case \"AsyncIterableIterator\":\n                case \"AsyncGenerator\":\n                case \"AsyncGeneratorFunction\":\n                case \"BigInt\":\n                case \"Reflect\":\n                case \"BigInt64Array\":\n                case \"BigUint64Array\":\n                    return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later;\n                default:\n                    if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) {\n                        return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer;\n                    }\n                    else {\n                        return ts.Diagnostics.Cannot_find_name_0;\n                    }\n            }\n        }\n        function getResolvedSymbol(node) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedSymbol) {\n                links.resolvedSymbol = !ts.nodeIsMissing(node) &&\n                    resolveName(node, node.escapedText, 111551 /* Value */ | 1048576 /* ExportValue */, getCannotFindNameDiagnosticForName(node), node, !ts.isWriteOnlyAccess(node), \n                    /*excludeGlobals*/ false, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1) || unknownSymbol;\n            }\n            return links.resolvedSymbol;\n        }\n        function isInTypeQuery(node) {\n            // TypeScript 1.0 spec (April 2014): 3.6.3\n            // A type query consists of the keyword typeof followed by an expression.\n            // The expression is restricted to a single identifier or a sequence of identifiers separated by periods\n            return !!ts.findAncestor(node, function (n) { return n.kind === 176 /* TypeQuery */ ? true : n.kind === 78 /* Identifier */ || n.kind === 157 /* QualifiedName */ ? false : \"quit\"; });\n        }\n        // Return the flow cache key for a \"dotted name\" (i.e. a sequence of identifiers\n        // separated by dots). The key consists of the id of the symbol referenced by the\n        // leftmost identifier followed by zero or more property names separated by dots.\n        // The result is undefined if the reference isn't a dotted name. We prefix nodes\n        // occurring in an apparent type position with '@' because the control flow type\n        // of such nodes may be based on the apparent type instead of the declared type.\n        function getFlowCacheKey(node, declaredType, initialType, flowContainer) {\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                    var symbol = getResolvedSymbol(node);\n                    return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : \"-1\") + \"|\" + getTypeId(declaredType) + \"|\" + getTypeId(initialType) + \"|\" + (isConstraintPosition(node) ? \"@\" : \"\") + getSymbolId(symbol) : undefined;\n                case 107 /* ThisKeyword */:\n                    return \"0|\" + (flowContainer ? getNodeId(flowContainer) : \"-1\") + \"|\" + getTypeId(declaredType) + \"|\" + getTypeId(initialType);\n                case 225 /* NonNullExpression */:\n                case 207 /* ParenthesizedExpression */:\n                    return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);\n                case 201 /* PropertyAccessExpression */:\n                case 202 /* ElementAccessExpression */:\n                    var propName = getAccessedPropertyName(node);\n                    if (propName !== undefined) {\n                        var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);\n                        return key && key + \".\" + propName;\n                    }\n            }\n            return undefined;\n        }\n        function isMatchingReference(source, target) {\n            switch (target.kind) {\n                case 207 /* ParenthesizedExpression */:\n                case 225 /* NonNullExpression */:\n                    return isMatchingReference(source, target.expression);\n                case 216 /* BinaryExpression */:\n                    return (ts.isAssignmentExpression(target) && isMatchingReference(source, target.left)) ||\n                        (ts.isBinaryExpression(target) && target.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source, target.right));\n            }\n            switch (source.kind) {\n                case 78 /* Identifier */:\n                case 79 /* PrivateIdentifier */:\n                    return target.kind === 78 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) ||\n                        (target.kind === 249 /* VariableDeclaration */ || target.kind === 198 /* BindingElement */) &&\n                            getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);\n                case 107 /* ThisKeyword */:\n                    return target.kind === 107 /* ThisKeyword */;\n                case 105 /* SuperKeyword */:\n                    return target.kind === 105 /* SuperKeyword */;\n                case 225 /* NonNullExpression */:\n                case 207 /* ParenthesizedExpression */:\n                    return isMatchingReference(source.expression, target);\n                case 201 /* PropertyAccessExpression */:\n                case 202 /* ElementAccessExpression */:\n                    return ts.isAccessExpression(target) &&\n                        getAccessedPropertyName(source) === getAccessedPropertyName(target) &&\n                        isMatchingReference(source.expression, target.expression);\n                case 157 /* QualifiedName */:\n                    return ts.isAccessExpression(target) &&\n                        source.right.escapedText === getAccessedPropertyName(target) &&\n                        isMatchingReference(source.left, target.expression);\n                case 216 /* BinaryExpression */:\n                    return (ts.isBinaryExpression(source) && source.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source.right, target));\n            }\n            return false;\n        }\n        // Given a source x, check if target matches x or is an && operation with an operand that matches x.\n        function containsTruthyCheck(source, target) {\n            return isMatchingReference(source, target) ||\n                (target.kind === 216 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ &&\n                    (containsTruthyCheck(source, target.left) || containsTruthyCheck(source, target.right)));\n        }\n        function getAccessedPropertyName(access) {\n            return access.kind === 201 /* PropertyAccessExpression */ ? access.name.escapedText :\n                ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :\n                    undefined;\n        }\n        function containsMatchingReference(source, target) {\n            while (ts.isAccessExpression(source)) {\n                source = source.expression;\n                if (isMatchingReference(source, target)) {\n                    return true;\n                }\n            }\n            return false;\n        }\n        function optionalChainContainsReference(source, target) {\n            while (ts.isOptionalChain(source)) {\n                source = source.expression;\n                if (isMatchingReference(source, target)) {\n                    return true;\n                }\n            }\n            return false;\n        }\n        function isDiscriminantProperty(type, name) {\n            if (type && type.flags & 1048576 /* Union */) {\n                var prop = getUnionOrIntersectionProperty(type, name);\n                if (prop && ts.getCheckFlags(prop) & 2 /* SyntheticProperty */) {\n                    if (prop.isDiscriminantProperty === undefined) {\n                        prop.isDiscriminantProperty =\n                            (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ &&\n                                !maybeTypeOfKind(getTypeOfSymbol(prop), 465829888 /* Instantiable */);\n                    }\n                    return !!prop.isDiscriminantProperty;\n                }\n            }\n            return false;\n        }\n        function findDiscriminantProperties(sourceProperties, target) {\n            var result;\n            for (var _i = 0, sourceProperties_2 = sourceProperties; _i < sourceProperties_2.length; _i++) {\n                var sourceProperty = sourceProperties_2[_i];\n                if (isDiscriminantProperty(target, sourceProperty.escapedName)) {\n                    if (result) {\n                        result.push(sourceProperty);\n                        continue;\n                    }\n                    result = [sourceProperty];\n                }\n            }\n            return result;\n        }\n        function isOrContainsMatchingReference(source, target) {\n            return isMatchingReference(source, target) || containsMatchingReference(source, target);\n        }\n        function hasMatchingArgument(expression, reference) {\n            if (expression.arguments) {\n                for (var _i = 0, _a = expression.arguments; _i < _a.length; _i++) {\n                    var argument = _a[_i];\n                    if (isOrContainsMatchingReference(reference, argument)) {\n                        return true;\n                    }\n                }\n            }\n            if (expression.expression.kind === 201 /* PropertyAccessExpression */ &&\n                isOrContainsMatchingReference(reference, expression.expression.expression)) {\n                return true;\n            }\n            return false;\n        }\n        function getFlowNodeId(flow) {\n            if (!flow.id || flow.id < 0) {\n                flow.id = nextFlowId;\n                nextFlowId++;\n            }\n            return flow.id;\n        }\n        function typeMaybeAssignableTo(source, target) {\n            if (!(source.flags & 1048576 /* Union */)) {\n                return isTypeAssignableTo(source, target);\n            }\n            for (var _i = 0, _a = source.types; _i < _a.length; _i++) {\n                var t = _a[_i];\n                if (isTypeAssignableTo(t, target)) {\n                    return true;\n                }\n            }\n            return false;\n        }\n        // Remove those constituent types of declaredType to which no constituent type of assignedType is assignable.\n        // For example, when a variable of type number | string | boolean is assigned a value of type number | boolean,\n        // we remove type string.\n        function getAssignmentReducedType(declaredType, assignedType) {\n            if (declaredType !== assignedType) {\n                if (assignedType.flags & 131072 /* Never */) {\n                    return assignedType;\n                }\n                var reducedType = filterType(declaredType, function (t) { return typeMaybeAssignableTo(assignedType, t); });\n                if (assignedType.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(assignedType)) {\n                    reducedType = mapType(reducedType, getFreshTypeOfLiteralType); // Ensure that if the assignment is a fresh type, that we narrow to fresh types\n                }\n                // Our crude heuristic produces an invalid result in some cases: see GH#26130.\n                // For now, when that happens, we give up and don't narrow at all.  (This also\n                // means we'll never narrow for erroneous assignments where the assigned type\n                // is not assignable to the declared type.)\n                if (isTypeAssignableTo(assignedType, reducedType)) {\n                    return reducedType;\n                }\n            }\n            return declaredType;\n        }\n        function getTypeFactsOfTypes(types) {\n            var result = 0 /* None */;\n            for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {\n                var t = types_17[_i];\n                result |= getTypeFacts(t);\n            }\n            return result;\n        }\n        function isFunctionObjectType(type) {\n            // We do a quick check for a \"bind\" property before performing the more expensive subtype\n            // check. This gives us a quicker out in the common case where an object type is not a function.\n            var resolved = resolveStructuredTypeMembers(type);\n            return !!(resolved.callSignatures.length || resolved.constructSignatures.length ||\n                resolved.members.get(\"bind\") && isTypeSubtypeOf(type, globalFunctionType));\n        }\n        function getTypeFacts(type) {\n            var flags = type.flags;\n            if (flags & 4 /* String */) {\n                return strictNullChecks ? 16317953 /* StringStrictFacts */ : 16776705 /* StringFacts */;\n            }\n            if (flags & 128 /* StringLiteral */) {\n                var isEmpty = type.value === \"\";\n                return strictNullChecks ?\n                    isEmpty ? 12123649 /* EmptyStringStrictFacts */ : 7929345 /* NonEmptyStringStrictFacts */ :\n                    isEmpty ? 12582401 /* EmptyStringFacts */ : 16776705 /* NonEmptyStringFacts */;\n            }\n            if (flags & (8 /* Number */ | 32 /* Enum */)) {\n                return strictNullChecks ? 16317698 /* NumberStrictFacts */ : 16776450 /* NumberFacts */;\n            }\n            if (flags & 256 /* NumberLiteral */) {\n                var isZero = type.value === 0;\n                return strictNullChecks ?\n                    isZero ? 12123394 /* ZeroNumberStrictFacts */ : 7929090 /* NonZeroNumberStrictFacts */ :\n                    isZero ? 12582146 /* ZeroNumberFacts */ : 16776450 /* NonZeroNumberFacts */;\n            }\n            if (flags & 64 /* BigInt */) {\n                return strictNullChecks ? 16317188 /* BigIntStrictFacts */ : 16775940 /* BigIntFacts */;\n            }\n            if (flags & 2048 /* BigIntLiteral */) {\n                var isZero = isZeroBigInt(type);\n                return strictNullChecks ?\n                    isZero ? 12122884 /* ZeroBigIntStrictFacts */ : 7928580 /* NonZeroBigIntStrictFacts */ :\n                    isZero ? 12581636 /* ZeroBigIntFacts */ : 16775940 /* NonZeroBigIntFacts */;\n            }\n            if (flags & 16 /* Boolean */) {\n                return strictNullChecks ? 16316168 /* BooleanStrictFacts */ : 16774920 /* BooleanFacts */;\n            }\n            if (flags & 528 /* BooleanLike */) {\n                return strictNullChecks ?\n                    (type === falseType || type === regularFalseType) ? 12121864 /* FalseStrictFacts */ : 7927560 /* TrueStrictFacts */ :\n                    (type === falseType || type === regularFalseType) ? 12580616 /* FalseFacts */ : 16774920 /* TrueFacts */;\n            }\n            if (flags & 524288 /* Object */) {\n                return ts.getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type) ?\n                    strictNullChecks ? 16318463 /* EmptyObjectStrictFacts */ : 16777215 /* EmptyObjectFacts */ :\n                    isFunctionObjectType(type) ?\n                        strictNullChecks ? 7880640 /* FunctionStrictFacts */ : 16728000 /* FunctionFacts */ :\n                        strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */;\n            }\n            if (flags & (16384 /* Void */ | 32768 /* Undefined */)) {\n                return 9830144 /* UndefinedFacts */;\n            }\n            if (flags & 65536 /* Null */) {\n                return 9363232 /* NullFacts */;\n            }\n            if (flags & 12288 /* ESSymbolLike */) {\n                return strictNullChecks ? 7925520 /* SymbolStrictFacts */ : 16772880 /* SymbolFacts */;\n            }\n            if (flags & 67108864 /* NonPrimitive */) {\n                return strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */;\n            }\n            if (flags & 131072 /* Never */) {\n                return 0 /* None */;\n            }\n            if (flags & 465829888 /* Instantiable */) {\n                return !isPatternLiteralType(type) ? getTypeFacts(getBaseConstraintOfType(type) || unknownType) :\n                    strictNullChecks ? 7929345 /* NonEmptyStringStrictFacts */ : 16776705 /* NonEmptyStringFacts */;\n            }\n            if (flags & 3145728 /* UnionOrIntersection */) {\n                return getTypeFactsOfTypes(type.types);\n            }\n            return 16777215 /* All */;\n        }\n        function getTypeWithFacts(type, include) {\n            return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });\n        }\n        function getTypeWithDefault(type, defaultExpression) {\n            if (defaultExpression) {\n                var defaultType = getTypeOfExpression(defaultExpression);\n                return getUnionType([getTypeWithFacts(type, 524288 /* NEUndefined */), defaultType]);\n            }\n            return type;\n        }\n        function getTypeOfDestructuredProperty(type, name) {\n            var nameType = getLiteralTypeFromPropertyName(name);\n            if (!isTypeUsableAsPropertyName(nameType))\n                return errorType;\n            var text = getPropertyNameFromType(nameType);\n            return getConstraintForLocation(getTypeOfPropertyOfType(type, text), name) ||\n                isNumericLiteralName(text) && includeUndefinedInIndexSignature(getIndexTypeOfType(type, 1 /* Number */)) ||\n                includeUndefinedInIndexSignature(getIndexTypeOfType(type, 0 /* String */)) ||\n                errorType;\n        }\n        function getTypeOfDestructuredArrayElement(type, index) {\n            return everyType(type, isTupleLikeType) && getTupleElementType(type, index) ||\n                includeUndefinedInIndexSignature(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined)) ||\n                errorType;\n        }\n        function includeUndefinedInIndexSignature(type) {\n            if (!type)\n                return type;\n            return compilerOptions.noUncheckedIndexedAccess ?\n                getUnionType([type, undefinedType]) :\n                type;\n        }\n        function getTypeOfDestructuredSpreadExpression(type) {\n            return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType);\n        }\n        function getAssignedTypeOfBinaryExpression(node) {\n            var isDestructuringDefaultAssignment = node.parent.kind === 199 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) ||\n                node.parent.kind === 288 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent);\n            return isDestructuringDefaultAssignment ?\n                getTypeWithDefault(getAssignedType(node), node.right) :\n                getTypeOfExpression(node.right);\n        }\n        function isDestructuringAssignmentTarget(parent) {\n            return parent.parent.kind === 216 /* BinaryExpression */ && parent.parent.left === parent ||\n                parent.parent.kind === 239 /* ForOfStatement */ && parent.parent.initializer === parent;\n        }\n        function getAssignedTypeOfArrayLiteralElement(node, element) {\n            return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element));\n        }\n        function getAssignedTypeOfSpreadExpression(node) {\n            return getTypeOfDestructuredSpreadExpression(getAssignedType(node.parent));\n        }\n        function getAssignedTypeOfPropertyAssignment(node) {\n            return getTypeOfDestructuredProperty(getAssignedType(node.parent), node.name);\n        }\n        function getAssignedTypeOfShorthandPropertyAssignment(node) {\n            return getTypeWithDefault(getAssignedTypeOfPropertyAssignment(node), node.objectAssignmentInitializer);\n        }\n        function getAssignedType(node) {\n            var parent = node.parent;\n            switch (parent.kind) {\n                case 238 /* ForInStatement */:\n                    return stringType;\n                case 239 /* ForOfStatement */:\n                    return checkRightHandSideOfForOf(parent) || errorType;\n                case 216 /* BinaryExpression */:\n                    return getAssignedTypeOfBinaryExpression(parent);\n                case 210 /* DeleteExpression */:\n                    return undefinedType;\n                case 199 /* ArrayLiteralExpression */:\n                    return getAssignedTypeOfArrayLiteralElement(parent, node);\n                case 220 /* SpreadElement */:\n                    return getAssignedTypeOfSpreadExpression(parent);\n                case 288 /* PropertyAssignment */:\n                    return getAssignedTypeOfPropertyAssignment(parent);\n                case 289 /* ShorthandPropertyAssignment */:\n                    return getAssignedTypeOfShorthandPropertyAssignment(parent);\n            }\n            return errorType;\n        }\n        function getInitialTypeOfBindingElement(node) {\n            var pattern = node.parent;\n            var parentType = getInitialType(pattern.parent);\n            var type = pattern.kind === 196 /* ObjectBindingPattern */ ?\n                getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) :\n                !node.dotDotDotToken ?\n                    getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) :\n                    getTypeOfDestructuredSpreadExpression(parentType);\n            return getTypeWithDefault(type, node.initializer);\n        }\n        function getTypeOfInitializer(node) {\n            // Return the cached type if one is available. If the type of the variable was inferred\n            // from its initializer, we'll already have cached the type. Otherwise we compute it now\n            // without caching such that transient types are reflected.\n            var links = getNodeLinks(node);\n            return links.resolvedType || getTypeOfExpression(node);\n        }\n        function getInitialTypeOfVariableDeclaration(node) {\n            if (node.initializer) {\n                return getTypeOfInitializer(node.initializer);\n            }\n            if (node.parent.parent.kind === 238 /* ForInStatement */) {\n                return stringType;\n            }\n            if (node.parent.parent.kind === 239 /* ForOfStatement */) {\n                return checkRightHandSideOfForOf(node.parent.parent) || errorType;\n            }\n            return errorType;\n        }\n        function getInitialType(node) {\n            return node.kind === 249 /* VariableDeclaration */ ?\n                getInitialTypeOfVariableDeclaration(node) :\n                getInitialTypeOfBindingElement(node);\n        }\n        function isEmptyArrayAssignment(node) {\n            return node.kind === 249 /* VariableDeclaration */ && node.initializer &&\n                isEmptyArrayLiteral(node.initializer) ||\n                node.kind !== 198 /* BindingElement */ && node.parent.kind === 216 /* BinaryExpression */ &&\n                    isEmptyArrayLiteral(node.parent.right);\n        }\n        function getReferenceCandidate(node) {\n            switch (node.kind) {\n                case 207 /* ParenthesizedExpression */:\n                    return getReferenceCandidate(node.expression);\n                case 216 /* BinaryExpression */:\n                    switch (node.operatorToken.kind) {\n                        case 62 /* EqualsToken */:\n                        case 74 /* BarBarEqualsToken */:\n                        case 75 /* AmpersandAmpersandEqualsToken */:\n                        case 76 /* QuestionQuestionEqualsToken */:\n                            return getReferenceCandidate(node.left);\n                        case 27 /* CommaToken */:\n                            return getReferenceCandidate(node.right);\n                    }\n            }\n            return node;\n        }\n        function getReferenceRoot(node) {\n            var parent = node.parent;\n            return parent.kind === 207 /* ParenthesizedExpression */ ||\n                parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node ||\n                parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ?\n                getReferenceRoot(parent) : node;\n        }\n        function getTypeOfSwitchClause(clause) {\n            if (clause.kind === 284 /* CaseClause */) {\n                return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression));\n            }\n            return neverType;\n        }\n        function getSwitchClauseTypes(switchStatement) {\n            var links = getNodeLinks(switchStatement);\n            if (!links.switchTypes) {\n                links.switchTypes = [];\n                for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) {\n                    var clause = _a[_i];\n                    links.switchTypes.push(getTypeOfSwitchClause(clause));\n                }\n            }\n            return links.switchTypes;\n        }\n        function getSwitchClauseTypeOfWitnesses(switchStatement, retainDefault) {\n            var witnesses = [];\n            for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) {\n                var clause = _a[_i];\n                if (clause.kind === 284 /* CaseClause */) {\n                    if (ts.isStringLiteralLike(clause.expression)) {\n                        witnesses.push(clause.expression.text);\n                        continue;\n                    }\n                    return ts.emptyArray;\n                }\n                if (retainDefault)\n                    witnesses.push(/*explicitDefaultStatement*/ undefined);\n            }\n            return witnesses;\n        }\n        function eachTypeContainedIn(source, types) {\n            return source.flags & 1048576 /* Union */ ? !ts.forEach(source.types, function (t) { return !ts.contains(types, t); }) : ts.contains(types, source);\n        }\n        function isTypeSubsetOf(source, target) {\n            return source === target || target.flags & 1048576 /* Union */ && isTypeSubsetOfUnion(source, target);\n        }\n        function isTypeSubsetOfUnion(source, target) {\n            if (source.flags & 1048576 /* Union */) {\n                for (var _i = 0, _a = source.types; _i < _a.length; _i++) {\n                    var t = _a[_i];\n                    if (!containsType(target.types, t)) {\n                        return false;\n                    }\n                }\n                return true;\n            }\n            if (source.flags & 1024 /* EnumLiteral */ && getBaseTypeOfEnumLiteralType(source) === target) {\n                return true;\n            }\n            return containsType(target.types, source);\n        }\n        function forEachType(type, f) {\n            return type.flags & 1048576 /* Union */ ? ts.forEach(type.types, f) : f(type);\n        }\n        function everyType(type, f) {\n            return type.flags & 1048576 /* Union */ ? ts.every(type.types, f) : f(type);\n        }\n        function filterType(type, f) {\n            if (type.flags & 1048576 /* Union */) {\n                var types = type.types;\n                var filtered = ts.filter(types, f);\n                if (filtered === types) {\n                    return type;\n                }\n                var origin = type.origin;\n                var newOrigin = void 0;\n                if (origin && origin.flags & 1048576 /* Union */) {\n                    // If the origin type is a (denormalized) union type, filter its non-union constituents. If that ends\n                    // up removing a smaller number of types than in the normalized constituent set (meaning some of the\n                    // filtered types are within nested unions in the origin), then we can't construct a new origin type.\n                    // Otherwise, if we have exactly one type left in the origin set, return that as the filtered type.\n                    // Otherwise, construct a new filtered origin type.\n                    var originTypes = origin.types;\n                    var originFiltered = ts.filter(originTypes, function (t) { return !!(t.flags & 1048576 /* Union */) || f(t); });\n                    if (originTypes.length - originFiltered.length === types.length - filtered.length) {\n                        if (originFiltered.length === 1) {\n                            return originFiltered[0];\n                        }\n                        newOrigin = createOriginUnionOrIntersectionType(1048576 /* Union */, originFiltered);\n                    }\n                }\n                return getUnionTypeFromSortedList(filtered, type.objectFlags, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, newOrigin);\n            }\n            return type.flags & 131072 /* Never */ || f(type) ? type : neverType;\n        }\n        function countTypes(type) {\n            return type.flags & 1048576 /* Union */ ? type.types.length : 1;\n        }\n        function mapType(type, mapper, noReductions) {\n            if (type.flags & 131072 /* Never */) {\n                return type;\n            }\n            if (!(type.flags & 1048576 /* Union */)) {\n                return mapper(type);\n            }\n            var origin = type.origin;\n            var types = origin && origin.flags & 1048576 /* Union */ ? origin.types : type.types;\n            var mappedTypes;\n            var changed = false;\n            for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {\n                var t = types_18[_i];\n                var mapped = t.flags & 1048576 /* Union */ ? mapType(t, mapper, noReductions) : mapper(t);\n                changed || (changed = t !== mapped);\n                if (mapped) {\n                    if (!mappedTypes) {\n                        mappedTypes = [mapped];\n                    }\n                    else {\n                        mappedTypes.push(mapped);\n                    }\n                }\n            }\n            return changed ? mappedTypes && getUnionType(mappedTypes, noReductions ? 0 /* None */ : 1 /* Literal */) : type;\n        }\n        function mapTypeWithAlias(type, mapper, aliasSymbol, aliasTypeArguments) {\n            return type.flags & 1048576 /* Union */ && aliasSymbol ?\n                getUnionType(ts.map(type.types, mapper), 1 /* Literal */, aliasSymbol, aliasTypeArguments) :\n                mapType(type, mapper);\n        }\n        function getConstituentCount(type) {\n            return type.flags & 3145728 /* UnionOrIntersection */ ? type.types.length : 1;\n        }\n        function extractTypesOfKind(type, kind) {\n            return filterType(type, function (t) { return (t.flags & kind) !== 0; });\n        }\n        // Return a new type in which occurrences of the string and number primitive types in\n        // typeWithPrimitives have been replaced with occurrences of string literals and numeric\n        // literals in typeWithLiterals, respectively.\n        function replacePrimitivesWithLiterals(typeWithPrimitives, typeWithLiterals) {\n            if (isTypeSubsetOf(stringType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 128 /* StringLiteral */) ||\n                isTypeSubsetOf(numberType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 256 /* NumberLiteral */) ||\n                isTypeSubsetOf(bigintType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 2048 /* BigIntLiteral */)) {\n                return mapType(typeWithPrimitives, function (t) {\n                    return t.flags & 4 /* String */ ? extractTypesOfKind(typeWithLiterals, 4 /* String */ | 128 /* StringLiteral */) :\n                        t.flags & 8 /* Number */ ? extractTypesOfKind(typeWithLiterals, 8 /* Number */ | 256 /* NumberLiteral */) :\n                            t.flags & 64 /* BigInt */ ? extractTypesOfKind(typeWithLiterals, 64 /* BigInt */ | 2048 /* BigIntLiteral */) : t;\n                });\n            }\n            return typeWithPrimitives;\n        }\n        function isIncomplete(flowType) {\n            return flowType.flags === 0;\n        }\n        function getTypeFromFlowType(flowType) {\n            return flowType.flags === 0 ? flowType.type : flowType;\n        }\n        function createFlowType(type, incomplete) {\n            return incomplete ? { flags: 0, type: type.flags & 131072 /* Never */ ? silentNeverType : type } : type;\n        }\n        // An evolving array type tracks the element types that have so far been seen in an\n        // 'x.push(value)' or 'x[n] = value' operation along the control flow graph. Evolving\n        // array types are ultimately converted into manifest array types (using getFinalArrayType)\n        // and never escape the getFlowTypeOfReference function.\n        function createEvolvingArrayType(elementType) {\n            var result = createObjectType(256 /* EvolvingArray */);\n            result.elementType = elementType;\n            return result;\n        }\n        function getEvolvingArrayType(elementType) {\n            return evolvingArrayTypes[elementType.id] || (evolvingArrayTypes[elementType.id] = createEvolvingArrayType(elementType));\n        }\n        // When adding evolving array element types we do not perform subtype reduction. Instead,\n        // we defer subtype reduction until the evolving array type is finalized into a manifest\n        // array type.\n        function addEvolvingArrayElementType(evolvingArrayType, node) {\n            var elementType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(getContextFreeTypeOfExpression(node)));\n            return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType]));\n        }\n        function createFinalArrayType(elementType) {\n            return elementType.flags & 131072 /* Never */ ?\n                autoArrayType :\n                createArrayType(elementType.flags & 1048576 /* Union */ ?\n                    getUnionType(elementType.types, 2 /* Subtype */) :\n                    elementType);\n        }\n        // We perform subtype reduction upon obtaining the final array type from an evolving array type.\n        function getFinalArrayType(evolvingArrayType) {\n            return evolvingArrayType.finalArrayType || (evolvingArrayType.finalArrayType = createFinalArrayType(evolvingArrayType.elementType));\n        }\n        function finalizeEvolvingArrayType(type) {\n            return ts.getObjectFlags(type) & 256 /* EvolvingArray */ ? getFinalArrayType(type) : type;\n        }\n        function getElementTypeOfEvolvingArrayType(type) {\n            return ts.getObjectFlags(type) & 256 /* EvolvingArray */ ? type.elementType : neverType;\n        }\n        function isEvolvingArrayTypeList(types) {\n            var hasEvolvingArrayType = false;\n            for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {\n                var t = types_19[_i];\n                if (!(t.flags & 131072 /* Never */)) {\n                    if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) {\n                        return false;\n                    }\n                    hasEvolvingArrayType = true;\n                }\n            }\n            return hasEvolvingArrayType;\n        }\n        // Return true if the given node is 'x' in an 'x.length', x.push(value)', 'x.unshift(value)' or\n        // 'x[n] = value' operation, where 'n' is an expression of type any, undefined, or a number-like type.\n        function isEvolvingArrayOperationTarget(node) {\n            var root = getReferenceRoot(node);\n            var parent = root.parent;\n            var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === \"length\" ||\n                parent.parent.kind === 203 /* CallExpression */\n                    && ts.isIdentifier(parent.name)\n                    && ts.isPushOrUnshiftIdentifier(parent.name));\n            var isElementAssignment = parent.kind === 202 /* ElementAccessExpression */ &&\n                parent.expression === root &&\n                parent.parent.kind === 216 /* BinaryExpression */ &&\n                parent.parent.operatorToken.kind === 62 /* EqualsToken */ &&\n                parent.parent.left === parent &&\n                !ts.isAssignmentTarget(parent.parent) &&\n                isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 296 /* NumberLike */);\n            return isLengthPushOrUnshift || isElementAssignment;\n        }\n        function isDeclarationWithExplicitTypeAnnotation(declaration) {\n            return (declaration.kind === 249 /* VariableDeclaration */ || declaration.kind === 160 /* Parameter */ ||\n                declaration.kind === 163 /* PropertyDeclaration */ || declaration.kind === 162 /* PropertySignature */) &&\n                !!ts.getEffectiveTypeAnnotationNode(declaration);\n        }\n        function getExplicitTypeOfSymbol(symbol, diagnostic) {\n            if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 512 /* ValueModule */)) {\n                return getTypeOfSymbol(symbol);\n            }\n            if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) {\n                if (ts.getCheckFlags(symbol) & 262144 /* Mapped */) {\n                    var origin = symbol.syntheticOrigin;\n                    if (origin && getExplicitTypeOfSymbol(origin)) {\n                        return getTypeOfSymbol(symbol);\n                    }\n                }\n                var declaration = symbol.valueDeclaration;\n                if (declaration) {\n                    if (isDeclarationWithExplicitTypeAnnotation(declaration)) {\n                        return getTypeOfSymbol(symbol);\n                    }\n                    if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 239 /* ForOfStatement */) {\n                        var statement = declaration.parent.parent;\n                        var expressionType = getTypeOfDottedName(statement.expression, /*diagnostic*/ undefined);\n                        if (expressionType) {\n                            var use = statement.awaitModifier ? 15 /* ForAwaitOf */ : 13 /* ForOf */;\n                            return checkIteratedTypeOrElementType(use, expressionType, undefinedType, /*errorNode*/ undefined);\n                        }\n                    }\n                    if (diagnostic) {\n                        ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(declaration, ts.Diagnostics._0_needs_an_explicit_type_annotation, symbolToString(symbol)));\n                    }\n                }\n            }\n        }\n        // We require the dotted function name in an assertion expression to be comprised of identifiers\n        // that reference function, method, class or value module symbols; or variable, property or\n        // parameter symbols with declarations that have explicit type annotations. Such references are\n        // resolvable with no possibility of triggering circularities in control flow analysis.\n        function getTypeOfDottedName(node, diagnostic) {\n            if (!(node.flags & 16777216 /* InWithStatement */)) {\n                switch (node.kind) {\n                    case 78 /* Identifier */:\n                        var symbol = getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(node));\n                        return getExplicitTypeOfSymbol(symbol.flags & 2097152 /* Alias */ ? resolveAlias(symbol) : symbol, diagnostic);\n                    case 107 /* ThisKeyword */:\n                        return getExplicitThisType(node);\n                    case 105 /* SuperKeyword */:\n                        return checkSuperExpression(node);\n                    case 201 /* PropertyAccessExpression */: {\n                        var type = getTypeOfDottedName(node.expression, diagnostic);\n                        if (type) {\n                            var name = node.name;\n                            var prop = void 0;\n                            if (ts.isPrivateIdentifier(name)) {\n                                if (!type.symbol) {\n                                    return undefined;\n                                }\n                                prop = getPropertyOfType(type, ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText));\n                            }\n                            else {\n                                prop = getPropertyOfType(type, name.escapedText);\n                            }\n                            return prop && getExplicitTypeOfSymbol(prop, diagnostic);\n                        }\n                        return undefined;\n                    }\n                    case 207 /* ParenthesizedExpression */:\n                        return getTypeOfDottedName(node.expression, diagnostic);\n                }\n            }\n        }\n        function getEffectsSignature(node) {\n            var links = getNodeLinks(node);\n            var signature = links.effectsSignature;\n            if (signature === undefined) {\n                // A call expression parented by an expression statement is a potential assertion. Other call\n                // expressions are potential type predicate function calls. In order to avoid triggering\n                // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call\n                // target expression of an assertion.\n                var funcType = void 0;\n                if (node.parent.kind === 233 /* ExpressionStatement */) {\n                    funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined);\n                }\n                else if (node.expression.kind !== 105 /* SuperKeyword */) {\n                    if (ts.isOptionalChain(node)) {\n                        funcType = checkNonNullType(getOptionalExpressionType(checkExpression(node.expression), node.expression), node.expression);\n                    }\n                    else {\n                        funcType = checkNonNullExpression(node.expression);\n                    }\n                }\n                var signatures = getSignaturesOfType(funcType && getApparentType(funcType) || unknownType, 0 /* Call */);\n                var candidate = signatures.length === 1 && !signatures[0].typeParameters ? signatures[0] :\n                    ts.some(signatures, hasTypePredicateOrNeverReturnType) ? getResolvedSignature(node) :\n                        undefined;\n                signature = links.effectsSignature = candidate && hasTypePredicateOrNeverReturnType(candidate) ? candidate : unknownSignature;\n            }\n            return signature === unknownSignature ? undefined : signature;\n        }\n        function hasTypePredicateOrNeverReturnType(signature) {\n            return !!(getTypePredicateOfSignature(signature) ||\n                signature.declaration && (getReturnTypeFromAnnotation(signature.declaration) || unknownType).flags & 131072 /* Never */);\n        }\n        function getTypePredicateArgument(predicate, callExpression) {\n            if (predicate.kind === 1 /* Identifier */ || predicate.kind === 3 /* AssertsIdentifier */) {\n                return callExpression.arguments[predicate.parameterIndex];\n            }\n            var invokedExpression = ts.skipParentheses(callExpression.expression);\n            return ts.isAccessExpression(invokedExpression) ? ts.skipParentheses(invokedExpression.expression) : undefined;\n        }\n        function reportFlowControlError(node) {\n            var block = ts.findAncestor(node, ts.isFunctionOrModuleBlock);\n            var sourceFile = ts.getSourceFileOfNode(node);\n            var span = ts.getSpanOfTokenAtPosition(sourceFile, block.statements.pos);\n            diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.The_containing_function_or_module_body_is_too_large_for_control_flow_analysis));\n        }\n        function isReachableFlowNode(flow) {\n            var result = isReachableFlowNodeWorker(flow, /*noCacheCheck*/ false);\n            lastFlowNode = flow;\n            lastFlowNodeReachable = result;\n            return result;\n        }\n        function isFalseExpression(expr) {\n            var node = ts.skipParentheses(expr);\n            return node.kind === 94 /* FalseKeyword */ || node.kind === 216 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) ||\n                node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right));\n        }\n        function isReachableFlowNodeWorker(flow, noCacheCheck) {\n            while (true) {\n                if (flow === lastFlowNode) {\n                    return lastFlowNodeReachable;\n                }\n                var flags = flow.flags;\n                if (flags & 4096 /* Shared */) {\n                    if (!noCacheCheck) {\n                        var id = getFlowNodeId(flow);\n                        var reachable = flowNodeReachable[id];\n                        return reachable !== undefined ? reachable : (flowNodeReachable[id] = isReachableFlowNodeWorker(flow, /*noCacheCheck*/ true));\n                    }\n                    noCacheCheck = false;\n                }\n                if (flags & (16 /* Assignment */ | 96 /* Condition */ | 256 /* ArrayMutation */)) {\n                    flow = flow.antecedent;\n                }\n                else if (flags & 512 /* Call */) {\n                    var signature = getEffectsSignature(flow.node);\n                    if (signature) {\n                        var predicate = getTypePredicateOfSignature(signature);\n                        if (predicate && predicate.kind === 3 /* AssertsIdentifier */ && !predicate.type) {\n                            var predicateArgument = flow.node.arguments[predicate.parameterIndex];\n                            if (predicateArgument && isFalseExpression(predicateArgument)) {\n                                return false;\n                            }\n                        }\n                        if (getReturnTypeOfSignature(signature).flags & 131072 /* Never */) {\n                            return false;\n                        }\n                    }\n                    flow = flow.antecedent;\n                }\n                else if (flags & 4 /* BranchLabel */) {\n                    // A branching point is reachable if any branch is reachable.\n                    return ts.some(flow.antecedents, function (f) { return isReachableFlowNodeWorker(f, /*noCacheCheck*/ false); });\n                }\n                else if (flags & 8 /* LoopLabel */) {\n                    var antecedents = flow.antecedents;\n                    if (antecedents === undefined || antecedents.length === 0) {\n                        return false;\n                    }\n                    // A loop is reachable if the control flow path that leads to the top is reachable.\n                    flow = antecedents[0];\n                }\n                else if (flags & 128 /* SwitchClause */) {\n                    // The control flow path representing an unmatched value in a switch statement with\n                    // no default clause is unreachable if the switch statement is exhaustive.\n                    if (flow.clauseStart === flow.clauseEnd && isExhaustiveSwitchStatement(flow.switchStatement)) {\n                        return false;\n                    }\n                    flow = flow.antecedent;\n                }\n                else if (flags & 1024 /* ReduceLabel */) {\n                    // Cache is unreliable once we start adjusting labels\n                    lastFlowNode = undefined;\n                    var target = flow.target;\n                    var saveAntecedents = target.antecedents;\n                    target.antecedents = flow.antecedents;\n                    var result = isReachableFlowNodeWorker(flow.antecedent, /*noCacheCheck*/ false);\n                    target.antecedents = saveAntecedents;\n                    return result;\n                }\n                else {\n                    return !(flags & 1 /* Unreachable */);\n                }\n            }\n        }\n        // Return true if the given flow node is preceded by a 'super(...)' call in every possible code path\n        // leading to the node.\n        function isPostSuperFlowNode(flow, noCacheCheck) {\n            while (true) {\n                var flags = flow.flags;\n                if (flags & 4096 /* Shared */) {\n                    if (!noCacheCheck) {\n                        var id = getFlowNodeId(flow);\n                        var postSuper = flowNodePostSuper[id];\n                        return postSuper !== undefined ? postSuper : (flowNodePostSuper[id] = isPostSuperFlowNode(flow, /*noCacheCheck*/ true));\n                    }\n                    noCacheCheck = false;\n                }\n                if (flags & (16 /* Assignment */ | 96 /* Condition */ | 256 /* ArrayMutation */ | 128 /* SwitchClause */)) {\n                    flow = flow.antecedent;\n                }\n                else if (flags & 512 /* Call */) {\n                    if (flow.node.expression.kind === 105 /* SuperKeyword */) {\n                        return true;\n                    }\n                    flow = flow.antecedent;\n                }\n                else if (flags & 4 /* BranchLabel */) {\n                    // A branching point is post-super if every branch is post-super.\n                    return ts.every(flow.antecedents, function (f) { return isPostSuperFlowNode(f, /*noCacheCheck*/ false); });\n                }\n                else if (flags & 8 /* LoopLabel */) {\n                    // A loop is post-super if the control flow path that leads to the top is post-super.\n                    flow = flow.antecedents[0];\n                }\n                else if (flags & 1024 /* ReduceLabel */) {\n                    var target = flow.target;\n                    var saveAntecedents = target.antecedents;\n                    target.antecedents = flow.antecedents;\n                    var result = isPostSuperFlowNode(flow.antecedent, /*noCacheCheck*/ false);\n                    target.antecedents = saveAntecedents;\n                    return result;\n                }\n                else {\n                    // Unreachable nodes are considered post-super to silence errors\n                    return !!(flags & 1 /* Unreachable */);\n                }\n            }\n        }\n        function getFlowTypeOfReference(reference, declaredType, initialType, flowContainer, couldBeUninitialized) {\n            if (initialType === void 0) { initialType = declaredType; }\n            var key;\n            var isKeySet = false;\n            var flowDepth = 0;\n            if (flowAnalysisDisabled) {\n                return errorType;\n            }\n            if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 536624127 /* Narrowable */)) {\n                return declaredType;\n            }\n            flowInvocationCount++;\n            var sharedFlowStart = sharedFlowCount;\n            var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode));\n            sharedFlowCount = sharedFlowStart;\n            // When the reference is 'x' in an 'x.length', 'x.push(value)', 'x.unshift(value)' or x[n] = value' operation,\n            // we give type 'any[]' to 'x' instead of using the type determined by control flow analysis such that operations\n            // on empty arrays are possible without implicit any errors and new element types can be inferred without\n            // type mismatch errors.\n            var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType);\n            if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 225 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {\n                return declaredType;\n            }\n            return resultType;\n            function getOrSetCacheKey() {\n                if (isKeySet) {\n                    return key;\n                }\n                isKeySet = true;\n                return key = getFlowCacheKey(reference, declaredType, initialType, flowContainer);\n            }\n            function getTypeAtFlowNode(flow) {\n                if (flowDepth === 2000) {\n                    // We have made 2000 recursive invocations. To avoid overflowing the call stack we report an error\n                    // and disable further control flow analysis in the containing function or module body.\n                    ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant(\"checkTypes\" /* CheckTypes */, \"getTypeAtFlowNode_DepthLimit\", { flowId: flow.id });\n                    flowAnalysisDisabled = true;\n                    reportFlowControlError(reference);\n                    return errorType;\n                }\n                flowDepth++;\n                var sharedFlow;\n                while (true) {\n                    var flags = flow.flags;\n                    if (flags & 4096 /* Shared */) {\n                        // We cache results of flow type resolution for shared nodes that were previously visited in\n                        // the same getFlowTypeOfReference invocation. A node is considered shared when it is the\n                        // antecedent of more than one node.\n                        for (var i = sharedFlowStart; i < sharedFlowCount; i++) {\n                            if (sharedFlowNodes[i] === flow) {\n                                flowDepth--;\n                                return sharedFlowTypes[i];\n                            }\n                        }\n                        sharedFlow = flow;\n                    }\n                    var type = void 0;\n                    if (flags & 16 /* Assignment */) {\n                        type = getTypeAtFlowAssignment(flow);\n                        if (!type) {\n                            flow = flow.antecedent;\n                            continue;\n                        }\n                    }\n                    else if (flags & 512 /* Call */) {\n                        type = getTypeAtFlowCall(flow);\n                        if (!type) {\n                            flow = flow.antecedent;\n                            continue;\n                        }\n                    }\n                    else if (flags & 96 /* Condition */) {\n                        type = getTypeAtFlowCondition(flow);\n                    }\n                    else if (flags & 128 /* SwitchClause */) {\n                        type = getTypeAtSwitchClause(flow);\n                    }\n                    else if (flags & 12 /* Label */) {\n                        if (flow.antecedents.length === 1) {\n                            flow = flow.antecedents[0];\n                            continue;\n                        }\n                        type = flags & 4 /* BranchLabel */ ?\n                            getTypeAtFlowBranchLabel(flow) :\n                            getTypeAtFlowLoopLabel(flow);\n                    }\n                    else if (flags & 256 /* ArrayMutation */) {\n                        type = getTypeAtFlowArrayMutation(flow);\n                        if (!type) {\n                            flow = flow.antecedent;\n                            continue;\n                        }\n                    }\n                    else if (flags & 1024 /* ReduceLabel */) {\n                        var target = flow.target;\n                        var saveAntecedents = target.antecedents;\n                        target.antecedents = flow.antecedents;\n                        type = getTypeAtFlowNode(flow.antecedent);\n                        target.antecedents = saveAntecedents;\n                    }\n                    else if (flags & 2 /* Start */) {\n                        // Check if we should continue with the control flow of the containing function.\n                        var container = flow.node;\n                        if (container && container !== flowContainer &&\n                            reference.kind !== 201 /* PropertyAccessExpression */ &&\n                            reference.kind !== 202 /* ElementAccessExpression */ &&\n                            reference.kind !== 107 /* ThisKeyword */) {\n                            flow = container.flowNode;\n                            continue;\n                        }\n                        // At the top of the flow we have the initial type.\n                        type = initialType;\n                    }\n                    else {\n                        // Unreachable code errors are reported in the binding phase. Here we\n                        // simply return the non-auto declared type to reduce follow-on errors.\n                        type = convertAutoToAny(declaredType);\n                    }\n                    if (sharedFlow) {\n                        // Record visited node and the associated type in the cache.\n                        sharedFlowNodes[sharedFlowCount] = sharedFlow;\n                        sharedFlowTypes[sharedFlowCount] = type;\n                        sharedFlowCount++;\n                    }\n                    flowDepth--;\n                    return type;\n                }\n            }\n            function getInitialOrAssignedType(flow) {\n                var node = flow.node;\n                return getConstraintForLocation(node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */ ?\n                    getInitialType(node) :\n                    getAssignedType(node), reference);\n            }\n            function getTypeAtFlowAssignment(flow) {\n                var node = flow.node;\n                // Assignments only narrow the computed type if the declared type is a union type. Thus, we\n                // only need to evaluate the assigned type if the declared type is a union type.\n                if (isMatchingReference(reference, node)) {\n                    if (!isReachableFlowNode(flow)) {\n                        return unreachableNeverType;\n                    }\n                    if (ts.getAssignmentTargetKind(node) === 2 /* Compound */) {\n                        var flowType = getTypeAtFlowNode(flow.antecedent);\n                        return createFlowType(getBaseTypeOfLiteralType(getTypeFromFlowType(flowType)), isIncomplete(flowType));\n                    }\n                    if (declaredType === autoType || declaredType === autoArrayType) {\n                        if (isEmptyArrayAssignment(node)) {\n                            return getEvolvingArrayType(neverType);\n                        }\n                        var assignedType = getWidenedLiteralType(getInitialOrAssignedType(flow));\n                        return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;\n                    }\n                    if (declaredType.flags & 1048576 /* Union */) {\n                        return getAssignmentReducedType(declaredType, getInitialOrAssignedType(flow));\n                    }\n                    return declaredType;\n                }\n                // We didn't have a direct match. However, if the reference is a dotted name, this\n                // may be an assignment to a left hand part of the reference. For example, for a\n                // reference 'x.y.z', we may be at an assignment to 'x.y' or 'x'. In that case,\n                // return the declared type.\n                if (containsMatchingReference(reference, node)) {\n                    if (!isReachableFlowNode(flow)) {\n                        return unreachableNeverType;\n                    }\n                    // A matching dotted name might also be an expando property on a function *expression*,\n                    // in which case we continue control flow analysis back to the function's declaration\n                    if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) {\n                        var init = ts.getDeclaredExpandoInitializer(node);\n                        if (init && (init.kind === 208 /* FunctionExpression */ || init.kind === 209 /* ArrowFunction */)) {\n                            return getTypeAtFlowNode(flow.antecedent);\n                        }\n                    }\n                    return declaredType;\n                }\n                // for (const _ in ref) acts as a nonnull on ref\n                if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 238 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) {\n                    return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent)));\n                }\n                // Assignment doesn't affect reference\n                return undefined;\n            }\n            function narrowTypeByAssertion(type, expr) {\n                var node = ts.skipParentheses(expr);\n                if (node.kind === 94 /* FalseKeyword */) {\n                    return unreachableNeverType;\n                }\n                if (node.kind === 216 /* BinaryExpression */) {\n                    if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) {\n                        return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right);\n                    }\n                    if (node.operatorToken.kind === 56 /* BarBarToken */) {\n                        return getUnionType([narrowTypeByAssertion(type, node.left), narrowTypeByAssertion(type, node.right)]);\n                    }\n                }\n                return narrowType(type, node, /*assumeTrue*/ true);\n            }\n            function getTypeAtFlowCall(flow) {\n                var signature = getEffectsSignature(flow.node);\n                if (signature) {\n                    var predicate = getTypePredicateOfSignature(signature);\n                    if (predicate && (predicate.kind === 2 /* AssertsThis */ || predicate.kind === 3 /* AssertsIdentifier */)) {\n                        var flowType = getTypeAtFlowNode(flow.antecedent);\n                        var type = finalizeEvolvingArrayType(getTypeFromFlowType(flowType));\n                        var narrowedType = predicate.type ? narrowTypeByTypePredicate(type, predicate, flow.node, /*assumeTrue*/ true) :\n                            predicate.kind === 3 /* AssertsIdentifier */ && predicate.parameterIndex >= 0 && predicate.parameterIndex < flow.node.arguments.length ? narrowTypeByAssertion(type, flow.node.arguments[predicate.parameterIndex]) :\n                                type;\n                        return narrowedType === type ? flowType : createFlowType(narrowedType, isIncomplete(flowType));\n                    }\n                    if (getReturnTypeOfSignature(signature).flags & 131072 /* Never */) {\n                        return unreachableNeverType;\n                    }\n                }\n                return undefined;\n            }\n            function getTypeAtFlowArrayMutation(flow) {\n                if (declaredType === autoType || declaredType === autoArrayType) {\n                    var node = flow.node;\n                    var expr = node.kind === 203 /* CallExpression */ ?\n                        node.expression.expression :\n                        node.left.expression;\n                    if (isMatchingReference(reference, getReferenceCandidate(expr))) {\n                        var flowType = getTypeAtFlowNode(flow.antecedent);\n                        var type = getTypeFromFlowType(flowType);\n                        if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) {\n                            var evolvedType_1 = type;\n                            if (node.kind === 203 /* CallExpression */) {\n                                for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) {\n                                    var arg = _a[_i];\n                                    evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg);\n                                }\n                            }\n                            else {\n                                // We must get the context free expression type so as to not recur in an uncached fashion on the LHS (which causes exponential blowup in compile time)\n                                var indexType = getContextFreeTypeOfExpression(node.left.argumentExpression);\n                                if (isTypeAssignableToKind(indexType, 296 /* NumberLike */)) {\n                                    evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, node.right);\n                                }\n                            }\n                            return evolvedType_1 === type ? flowType : createFlowType(evolvedType_1, isIncomplete(flowType));\n                        }\n                        return flowType;\n                    }\n                }\n                return undefined;\n            }\n            function getTypeAtFlowCondition(flow) {\n                var flowType = getTypeAtFlowNode(flow.antecedent);\n                var type = getTypeFromFlowType(flowType);\n                if (type.flags & 131072 /* Never */) {\n                    return flowType;\n                }\n                // If we have an antecedent type (meaning we're reachable in some way), we first\n                // attempt to narrow the antecedent type. If that produces the never type, and if\n                // the antecedent type is incomplete (i.e. a transient type in a loop), then we\n                // take the type guard as an indication that control *could* reach here once we\n                // have the complete type. We proceed by switching to the silent never type which\n                // doesn't report errors when operators are applied to it. Note that this is the\n                // *only* place a silent never type is ever generated.\n                var assumeTrue = (flow.flags & 32 /* TrueCondition */) !== 0;\n                var nonEvolvingType = finalizeEvolvingArrayType(type);\n                var narrowedType = narrowType(nonEvolvingType, flow.node, assumeTrue);\n                if (narrowedType === nonEvolvingType) {\n                    return flowType;\n                }\n                return createFlowType(narrowedType, isIncomplete(flowType));\n            }\n            function getTypeAtSwitchClause(flow) {\n                var expr = flow.switchStatement.expression;\n                var flowType = getTypeAtFlowNode(flow.antecedent);\n                var type = getTypeFromFlowType(flowType);\n                if (isMatchingReference(reference, expr)) {\n                    type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);\n                }\n                else if (expr.kind === 211 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {\n                    type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);\n                }\n                else {\n                    if (strictNullChecks) {\n                        if (optionalChainContainsReference(expr, reference)) {\n                            type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); });\n                        }\n                        else if (expr.kind === 211 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) {\n                            type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === \"undefined\"); });\n                        }\n                    }\n                    if (isMatchingReferenceDiscriminant(expr, type)) {\n                        type = narrowTypeByDiscriminant(type, expr, function (t) { return narrowTypeBySwitchOnDiscriminant(t, flow.switchStatement, flow.clauseStart, flow.clauseEnd); });\n                    }\n                }\n                return createFlowType(type, isIncomplete(flowType));\n            }\n            function getTypeAtFlowBranchLabel(flow) {\n                var antecedentTypes = [];\n                var subtypeReduction = false;\n                var seenIncomplete = false;\n                var bypassFlow;\n                for (var _i = 0, _a = flow.antecedents; _i < _a.length; _i++) {\n                    var antecedent = _a[_i];\n                    if (!bypassFlow && antecedent.flags & 128 /* SwitchClause */ && antecedent.clauseStart === antecedent.clauseEnd) {\n                        // The antecedent is the bypass branch of a potentially exhaustive switch statement.\n                        bypassFlow = antecedent;\n                        continue;\n                    }\n                    var flowType = getTypeAtFlowNode(antecedent);\n                    var type = getTypeFromFlowType(flowType);\n                    // If the type at a particular antecedent path is the declared type and the\n                    // reference is known to always be assigned (i.e. when declared and initial types\n                    // are the same), there is no reason to process more antecedents since the only\n                    // possible outcome is subtypes that will be removed in the final union type anyway.\n                    if (type === declaredType && declaredType === initialType) {\n                        return type;\n                    }\n                    ts.pushIfUnique(antecedentTypes, type);\n                    // If an antecedent type is not a subset of the declared type, we need to perform\n                    // subtype reduction. This happens when a \"foreign\" type is injected into the control\n                    // flow using the instanceof operator or a user defined type predicate.\n                    if (!isTypeSubsetOf(type, declaredType)) {\n                        subtypeReduction = true;\n                    }\n                    if (isIncomplete(flowType)) {\n                        seenIncomplete = true;\n                    }\n                }\n                if (bypassFlow) {\n                    var flowType = getTypeAtFlowNode(bypassFlow);\n                    var type = getTypeFromFlowType(flowType);\n                    // If the bypass flow contributes a type we haven't seen yet and the switch statement\n                    // isn't exhaustive, process the bypass flow type. Since exhaustiveness checks increase\n                    // the risk of circularities, we only want to perform them when they make a difference.\n                    if (!ts.contains(antecedentTypes, type) && !isExhaustiveSwitchStatement(bypassFlow.switchStatement)) {\n                        if (type === declaredType && declaredType === initialType) {\n                            return type;\n                        }\n                        antecedentTypes.push(type);\n                        if (!isTypeSubsetOf(type, declaredType)) {\n                            subtypeReduction = true;\n                        }\n                        if (isIncomplete(flowType)) {\n                            seenIncomplete = true;\n                        }\n                    }\n                }\n                return createFlowType(getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction ? 2 /* Subtype */ : 1 /* Literal */), seenIncomplete);\n            }\n            function getTypeAtFlowLoopLabel(flow) {\n                // If we have previously computed the control flow type for the reference at\n                // this flow loop junction, return the cached type.\n                var id = getFlowNodeId(flow);\n                var cache = flowLoopCaches[id] || (flowLoopCaches[id] = new ts.Map());\n                var key = getOrSetCacheKey();\n                if (!key) {\n                    // No cache key is generated when binding patterns are in unnarrowable situations\n                    return declaredType;\n                }\n                var cached = cache.get(key);\n                if (cached) {\n                    return cached;\n                }\n                // If this flow loop junction and reference are already being processed, return\n                // the union of the types computed for each branch so far, marked as incomplete.\n                // It is possible to see an empty array in cases where loops are nested and the\n                // back edge of the outer loop reaches an inner loop that is already being analyzed.\n                // In such cases we restart the analysis of the inner loop, which will then see\n                // a non-empty in-process array for the outer loop and eventually terminate because\n                // the first antecedent of a loop junction is always the non-looping control flow\n                // path that leads to the top.\n                for (var i = flowLoopStart; i < flowLoopCount; i++) {\n                    if (flowLoopNodes[i] === flow && flowLoopKeys[i] === key && flowLoopTypes[i].length) {\n                        return createFlowType(getUnionOrEvolvingArrayType(flowLoopTypes[i], 1 /* Literal */), /*incomplete*/ true);\n                    }\n                }\n                // Add the flow loop junction and reference to the in-process stack and analyze\n                // each antecedent code path.\n                var antecedentTypes = [];\n                var subtypeReduction = false;\n                var firstAntecedentType;\n                for (var _i = 0, _a = flow.antecedents; _i < _a.length; _i++) {\n                    var antecedent = _a[_i];\n                    var flowType = void 0;\n                    if (!firstAntecedentType) {\n                        // The first antecedent of a loop junction is always the non-looping control\n                        // flow path that leads to the top.\n                        flowType = firstAntecedentType = getTypeAtFlowNode(antecedent);\n                    }\n                    else {\n                        // All but the first antecedent are the looping control flow paths that lead\n                        // back to the loop junction. We track these on the flow loop stack.\n                        flowLoopNodes[flowLoopCount] = flow;\n                        flowLoopKeys[flowLoopCount] = key;\n                        flowLoopTypes[flowLoopCount] = antecedentTypes;\n                        flowLoopCount++;\n                        var saveFlowTypeCache = flowTypeCache;\n                        flowTypeCache = undefined;\n                        flowType = getTypeAtFlowNode(antecedent);\n                        flowTypeCache = saveFlowTypeCache;\n                        flowLoopCount--;\n                        // If we see a value appear in the cache it is a sign that control flow analysis\n                        // was restarted and completed by checkExpressionCached. We can simply pick up\n                        // the resulting type and bail out.\n                        var cached_1 = cache.get(key);\n                        if (cached_1) {\n                            return cached_1;\n                        }\n                    }\n                    var type = getTypeFromFlowType(flowType);\n                    ts.pushIfUnique(antecedentTypes, type);\n                    // If an antecedent type is not a subset of the declared type, we need to perform\n                    // subtype reduction. This happens when a \"foreign\" type is injected into the control\n                    // flow using the instanceof operator or a user defined type predicate.\n                    if (!isTypeSubsetOf(type, declaredType)) {\n                        subtypeReduction = true;\n                    }\n                    // If the type at a particular antecedent path is the declared type there is no\n                    // reason to process more antecedents since the only possible outcome is subtypes\n                    // that will be removed in the final union type anyway.\n                    if (type === declaredType) {\n                        break;\n                    }\n                }\n                // The result is incomplete if the first antecedent (the non-looping control flow path)\n                // is incomplete.\n                var result = getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction ? 2 /* Subtype */ : 1 /* Literal */);\n                if (isIncomplete(firstAntecedentType)) {\n                    return createFlowType(result, /*incomplete*/ true);\n                }\n                cache.set(key, result);\n                return result;\n            }\n            // At flow control branch or loop junctions, if the type along every antecedent code path\n            // is an evolving array type, we construct a combined evolving array type. Otherwise we\n            // finalize all evolving array types.\n            function getUnionOrEvolvingArrayType(types, subtypeReduction) {\n                if (isEvolvingArrayTypeList(types)) {\n                    return getEvolvingArrayType(getUnionType(ts.map(types, getElementTypeOfEvolvingArrayType)));\n                }\n                var result = getUnionType(ts.sameMap(types, finalizeEvolvingArrayType), subtypeReduction);\n                if (result !== declaredType && result.flags & declaredType.flags & 1048576 /* Union */ && ts.arraysEqual(result.types, declaredType.types)) {\n                    return declaredType;\n                }\n                return result;\n            }\n            function isMatchingReferenceDiscriminant(expr, computedType) {\n                var type = declaredType.flags & 1048576 /* Union */ ? declaredType : computedType;\n                if (!(type.flags & 1048576 /* Union */) || !ts.isAccessExpression(expr)) {\n                    return false;\n                }\n                var name = getAccessedPropertyName(expr);\n                if (name === undefined) {\n                    return false;\n                }\n                return isMatchingReference(reference, expr.expression) && isDiscriminantProperty(type, name);\n            }\n            function narrowTypeByDiscriminant(type, access, narrowType) {\n                var propName = getAccessedPropertyName(access);\n                if (propName === undefined) {\n                    return type;\n                }\n                var includesNullable = strictNullChecks && maybeTypeOfKind(type, 98304 /* Nullable */);\n                var removeNullable = includesNullable && ts.isOptionalChain(access);\n                var propType = getTypeOfPropertyOfType(removeNullable ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type, propName);\n                if (!propType) {\n                    return type;\n                }\n                propType = removeNullable ? getOptionalType(propType) : propType;\n                var narrowedPropType = narrowType(propType);\n                return filterType(type, function (t) {\n                    var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);\n                    return !(discriminantType.flags & 131072 /* Never */) && isTypeComparableTo(discriminantType, narrowedPropType);\n                });\n            }\n            function narrowTypeByTruthiness(type, expr, assumeTrue) {\n                if (isMatchingReference(reference, expr)) {\n                    return getTypeWithFacts(type, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */);\n                }\n                if (strictNullChecks && assumeTrue && optionalChainContainsReference(expr, reference)) {\n                    type = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);\n                }\n                if (isMatchingReferenceDiscriminant(expr, type)) {\n                    return narrowTypeByDiscriminant(type, expr, function (t) { return getTypeWithFacts(t, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */); });\n                }\n                return type;\n            }\n            function isTypePresencePossible(type, propName, assumeTrue) {\n                if (getIndexInfoOfType(type, 0 /* String */)) {\n                    return true;\n                }\n                var prop = getPropertyOfType(type, propName);\n                if (prop) {\n                    return prop.flags & 16777216 /* Optional */ ? true : assumeTrue;\n                }\n                return !assumeTrue;\n            }\n            function narrowByInKeyword(type, literal, assumeTrue) {\n                if (type.flags & (1048576 /* Union */ | 524288 /* Object */)\n                    || isThisTypeParameter(type)\n                    || type.flags & 2097152 /* Intersection */ && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {\n                    var propName_1 = ts.escapeLeadingUnderscores(literal.text);\n                    return filterType(type, function (t) { return isTypePresencePossible(t, propName_1, assumeTrue); });\n                }\n                return type;\n            }\n            function narrowTypeByBinaryExpression(type, expr, assumeTrue) {\n                switch (expr.operatorToken.kind) {\n                    case 62 /* EqualsToken */:\n                    case 74 /* BarBarEqualsToken */:\n                    case 75 /* AmpersandAmpersandEqualsToken */:\n                    case 76 /* QuestionQuestionEqualsToken */:\n                        return narrowTypeByTruthiness(narrowType(type, expr.right, assumeTrue), expr.left, assumeTrue);\n                    case 34 /* EqualsEqualsToken */:\n                    case 35 /* ExclamationEqualsToken */:\n                    case 36 /* EqualsEqualsEqualsToken */:\n                    case 37 /* ExclamationEqualsEqualsToken */:\n                        var operator_1 = expr.operatorToken.kind;\n                        var left_1 = getReferenceCandidate(expr.left);\n                        var right_1 = getReferenceCandidate(expr.right);\n                        if (left_1.kind === 211 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) {\n                            return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue);\n                        }\n                        if (right_1.kind === 211 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) {\n                            return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue);\n                        }\n                        if (isMatchingReference(reference, left_1)) {\n                            return narrowTypeByEquality(type, operator_1, right_1, assumeTrue);\n                        }\n                        if (isMatchingReference(reference, right_1)) {\n                            return narrowTypeByEquality(type, operator_1, left_1, assumeTrue);\n                        }\n                        if (strictNullChecks) {\n                            if (optionalChainContainsReference(left_1, reference)) {\n                                type = narrowTypeByOptionalChainContainment(type, operator_1, right_1, assumeTrue);\n                            }\n                            else if (optionalChainContainsReference(right_1, reference)) {\n                                type = narrowTypeByOptionalChainContainment(type, operator_1, left_1, assumeTrue);\n                            }\n                        }\n                        if (isMatchingReferenceDiscriminant(left_1, type)) {\n                            return narrowTypeByDiscriminant(type, left_1, function (t) { return narrowTypeByEquality(t, operator_1, right_1, assumeTrue); });\n                        }\n                        if (isMatchingReferenceDiscriminant(right_1, type)) {\n                            return narrowTypeByDiscriminant(type, right_1, function (t) { return narrowTypeByEquality(t, operator_1, left_1, assumeTrue); });\n                        }\n                        if (isMatchingConstructorReference(left_1)) {\n                            return narrowTypeByConstructor(type, operator_1, right_1, assumeTrue);\n                        }\n                        if (isMatchingConstructorReference(right_1)) {\n                            return narrowTypeByConstructor(type, operator_1, left_1, assumeTrue);\n                        }\n                        break;\n                    case 101 /* InstanceOfKeyword */:\n                        return narrowTypeByInstanceof(type, expr, assumeTrue);\n                    case 100 /* InKeyword */:\n                        var target = getReferenceCandidate(expr.right);\n                        if (ts.isStringLiteralLike(expr.left) && isMatchingReference(reference, target)) {\n                            return narrowByInKeyword(type, expr.left, assumeTrue);\n                        }\n                        break;\n                    case 27 /* CommaToken */:\n                        return narrowType(type, expr.right, assumeTrue);\n                }\n                return type;\n            }\n            function narrowTypeByOptionalChainContainment(type, operator, value, assumeTrue) {\n                // We are in a branch of obj?.foo === value (or any one of the other equality operators). We narrow obj as follows:\n                // When operator is === and type of value excludes undefined, null and undefined is removed from type of obj in true branch.\n                // When operator is !== and type of value excludes undefined, null and undefined is removed from type of obj in false branch.\n                // When operator is == and type of value excludes null and undefined, null and undefined is removed from type of obj in true branch.\n                // When operator is != and type of value excludes null and undefined, null and undefined is removed from type of obj in false branch.\n                // When operator is === and type of value is undefined, null and undefined is removed from type of obj in false branch.\n                // When operator is !== and type of value is undefined, null and undefined is removed from type of obj in true branch.\n                // When operator is == and type of value is null or undefined, null and undefined is removed from type of obj in false branch.\n                // When operator is != and type of value is null or undefined, null and undefined is removed from type of obj in true branch.\n                var equalsOperator = operator === 34 /* EqualsEqualsToken */ || operator === 36 /* EqualsEqualsEqualsToken */;\n                var nullableFlags = operator === 34 /* EqualsEqualsToken */ || operator === 35 /* ExclamationEqualsToken */ ? 98304 /* Nullable */ : 32768 /* Undefined */;\n                var valueType = getTypeOfExpression(value);\n                // Note that we include any and unknown in the exclusion test because their domain includes null and undefined.\n                var removeNullable = equalsOperator !== assumeTrue && everyType(valueType, function (t) { return !!(t.flags & nullableFlags); }) ||\n                    equalsOperator === assumeTrue && everyType(valueType, function (t) { return !(t.flags & (3 /* AnyOrUnknown */ | nullableFlags)); });\n                return removeNullable ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;\n            }\n            function narrowTypeByEquality(type, operator, value, assumeTrue) {\n                if (type.flags & 1 /* Any */) {\n                    return type;\n                }\n                if (operator === 35 /* ExclamationEqualsToken */ || operator === 37 /* ExclamationEqualsEqualsToken */) {\n                    assumeTrue = !assumeTrue;\n                }\n                var valueType = getTypeOfExpression(value);\n                if ((type.flags & 2 /* Unknown */) && assumeTrue && (operator === 36 /* EqualsEqualsEqualsToken */ || operator === 37 /* ExclamationEqualsEqualsToken */)) {\n                    if (valueType.flags & (131068 /* Primitive */ | 67108864 /* NonPrimitive */)) {\n                        return valueType;\n                    }\n                    if (valueType.flags & 524288 /* Object */) {\n                        return nonPrimitiveType;\n                    }\n                    return type;\n                }\n                if (valueType.flags & 98304 /* Nullable */) {\n                    if (!strictNullChecks) {\n                        return type;\n                    }\n                    var doubleEquals = operator === 34 /* EqualsEqualsToken */ || operator === 35 /* ExclamationEqualsToken */;\n                    var facts = doubleEquals ?\n                        assumeTrue ? 262144 /* EQUndefinedOrNull */ : 2097152 /* NEUndefinedOrNull */ :\n                        valueType.flags & 65536 /* Null */ ?\n                            assumeTrue ? 131072 /* EQNull */ : 1048576 /* NENull */ :\n                            assumeTrue ? 65536 /* EQUndefined */ : 524288 /* NEUndefined */;\n                    return getTypeWithFacts(type, facts);\n                }\n                if (assumeTrue) {\n                    var filterFn = operator === 34 /* EqualsEqualsToken */ ?\n                        (function (t) { return areTypesComparable(t, valueType) || isCoercibleUnderDoubleEquals(t, valueType); }) :\n                        function (t) { return areTypesComparable(t, valueType); };\n                    return replacePrimitivesWithLiterals(filterType(type, filterFn), valueType);\n                }\n                if (isUnitType(valueType)) {\n                    var regularType_1 = getRegularTypeOfLiteralType(valueType);\n                    return filterType(type, function (t) { return isUnitType(t) ? !areTypesComparable(t, valueType) : getRegularTypeOfLiteralType(t) !== regularType_1; });\n                }\n                return type;\n            }\n            function narrowTypeByTypeof(type, typeOfExpr, operator, literal, assumeTrue) {\n                // We have '==', '!=', '===', or !==' operator with 'typeof xxx' and string literal operands\n                if (operator === 35 /* ExclamationEqualsToken */ || operator === 37 /* ExclamationEqualsEqualsToken */) {\n                    assumeTrue = !assumeTrue;\n                }\n                var target = getReferenceCandidate(typeOfExpr.expression);\n                if (!isMatchingReference(reference, target)) {\n                    if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== \"undefined\")) {\n                        return getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);\n                    }\n                    return type;\n                }\n                if (type.flags & 1 /* Any */ && literal.text === \"function\") {\n                    return type;\n                }\n                if (assumeTrue && type.flags & 2 /* Unknown */ && literal.text === \"object\") {\n                    // The pattern x && typeof x === 'object', where x is of type unknown, narrows x to type object. We don't\n                    // need to check for the reverse typeof x === 'object' && x since that already narrows correctly.\n                    if (typeOfExpr.parent.parent.kind === 216 /* BinaryExpression */) {\n                        var expr = typeOfExpr.parent.parent;\n                        if (expr.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && expr.right === typeOfExpr.parent && containsTruthyCheck(reference, expr.left)) {\n                            return nonPrimitiveType;\n                        }\n                    }\n                    return getUnionType([nonPrimitiveType, nullType]);\n                }\n                var facts = assumeTrue ?\n                    typeofEQFacts.get(literal.text) || 128 /* TypeofEQHostObject */ :\n                    typeofNEFacts.get(literal.text) || 32768 /* TypeofNEHostObject */;\n                var impliedType = getImpliedTypeFromTypeofGuard(type, literal.text);\n                return getTypeWithFacts(assumeTrue && impliedType ? mapType(type, narrowUnionMemberByTypeof(impliedType)) : type, facts);\n            }\n            function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {\n                var everyClauseChecks = clauseStart !== clauseEnd && ts.every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);\n                return everyClauseChecks ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;\n            }\n            function narrowTypeBySwitchOnDiscriminant(type, switchStatement, clauseStart, clauseEnd) {\n                // We only narrow if all case expressions specify\n                // values with unit types, except for the case where\n                // `type` is unknown. In this instance we map object\n                // types to the nonPrimitive type and narrow with that.\n                var switchTypes = getSwitchClauseTypes(switchStatement);\n                if (!switchTypes.length) {\n                    return type;\n                }\n                var clauseTypes = switchTypes.slice(clauseStart, clauseEnd);\n                var hasDefaultClause = clauseStart === clauseEnd || ts.contains(clauseTypes, neverType);\n                if ((type.flags & 2 /* Unknown */) && !hasDefaultClause) {\n                    var groundClauseTypes = void 0;\n                    for (var i = 0; i < clauseTypes.length; i += 1) {\n                        var t = clauseTypes[i];\n                        if (t.flags & (131068 /* Primitive */ | 67108864 /* NonPrimitive */)) {\n                            if (groundClauseTypes !== undefined) {\n                                groundClauseTypes.push(t);\n                            }\n                        }\n                        else if (t.flags & 524288 /* Object */) {\n                            if (groundClauseTypes === undefined) {\n                                groundClauseTypes = clauseTypes.slice(0, i);\n                            }\n                            groundClauseTypes.push(nonPrimitiveType);\n                        }\n                        else {\n                            return type;\n                        }\n                    }\n                    return getUnionType(groundClauseTypes === undefined ? clauseTypes : groundClauseTypes);\n                }\n                var discriminantType = getUnionType(clauseTypes);\n                var caseType = discriminantType.flags & 131072 /* Never */ ? neverType :\n                    replacePrimitivesWithLiterals(filterType(type, function (t) { return areTypesComparable(discriminantType, t); }), discriminantType);\n                if (!hasDefaultClause) {\n                    return caseType;\n                }\n                var defaultType = filterType(type, function (t) { return !(isUnitType(t) && ts.contains(switchTypes, getRegularTypeOfLiteralType(t))); });\n                return caseType.flags & 131072 /* Never */ ? defaultType : getUnionType([caseType, defaultType]);\n            }\n            function getImpliedTypeFromTypeofGuard(type, text) {\n                switch (text) {\n                    case \"function\":\n                        return type.flags & 1 /* Any */ ? type : globalFunctionType;\n                    case \"object\":\n                        return type.flags & 2 /* Unknown */ ? getUnionType([nonPrimitiveType, nullType]) : type;\n                    default:\n                        return typeofTypesByName.get(text);\n                }\n            }\n            // When narrowing a union type by a `typeof` guard using type-facts alone, constituent types that are\n            // super-types of the implied guard will be retained in the final type: this is because type-facts only\n            // filter. Instead, we would like to replace those union constituents with the more precise type implied by\n            // the guard. For example: narrowing `{} | undefined` by `\"boolean\"` should produce the type `boolean`, not\n            // the filtered type `{}`. For this reason we narrow constituents of the union individually, in addition to\n            // filtering by type-facts.\n            function narrowUnionMemberByTypeof(candidate) {\n                return function (type) {\n                    if (isTypeSubtypeOf(type, candidate)) {\n                        return type;\n                    }\n                    if (isTypeSubtypeOf(candidate, type)) {\n                        return candidate;\n                    }\n                    if (type.flags & 465829888 /* Instantiable */) {\n                        var constraint = getBaseConstraintOfType(type) || anyType;\n                        if (isTypeSubtypeOf(candidate, constraint)) {\n                            return getIntersectionType([type, candidate]);\n                        }\n                    }\n                    return type;\n                };\n            }\n            function narrowBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) {\n                var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement, /*retainDefault*/ true);\n                if (!switchWitnesses.length) {\n                    return type;\n                }\n                //  Equal start and end denotes implicit fallthrough; undefined marks explicit default clause\n                var defaultCaseLocation = ts.findIndex(switchWitnesses, function (elem) { return elem === undefined; });\n                var hasDefaultClause = clauseStart === clauseEnd || (defaultCaseLocation >= clauseStart && defaultCaseLocation < clauseEnd);\n                var clauseWitnesses;\n                var switchFacts;\n                if (defaultCaseLocation > -1) {\n                    // We no longer need the undefined denoting an explicit default case. Remove the undefined and\n                    // fix-up clauseStart and clauseEnd.  This means that we don't have to worry about undefined in the\n                    // witness array.\n                    var witnesses = switchWitnesses.filter(function (witness) { return witness !== undefined; });\n                    // The adjusted clause start and end after removing the `default` statement.\n                    var fixedClauseStart = defaultCaseLocation < clauseStart ? clauseStart - 1 : clauseStart;\n                    var fixedClauseEnd = defaultCaseLocation < clauseEnd ? clauseEnd - 1 : clauseEnd;\n                    clauseWitnesses = witnesses.slice(fixedClauseStart, fixedClauseEnd);\n                    switchFacts = getFactsFromTypeofSwitch(fixedClauseStart, fixedClauseEnd, witnesses, hasDefaultClause);\n                }\n                else {\n                    clauseWitnesses = switchWitnesses.slice(clauseStart, clauseEnd);\n                    switchFacts = getFactsFromTypeofSwitch(clauseStart, clauseEnd, switchWitnesses, hasDefaultClause);\n                }\n                if (hasDefaultClause) {\n                    return filterType(type, function (t) { return (getTypeFacts(t) & switchFacts) === switchFacts; });\n                }\n                /*\n                  The implied type is the raw type suggested by a\n                  value being caught in this clause.\n\n                  When the clause contains a default case we ignore\n                  the implied type and try to narrow using any facts\n                  we can learn: see `switchFacts`.\n\n                  Example:\n                  switch (typeof x) {\n                      case 'number':\n                      case 'string': break;\n                      default: break;\n                      case 'number':\n                      case 'boolean': break\n                  }\n\n                  In the first clause (case `number` and `string`) the\n                  implied type is number | string.\n\n                  In the default clause we de not compute an implied type.\n\n                  In the third clause (case `number` and `boolean`)\n                  the naive implied type is number | boolean, however\n                  we use the type facts to narrow the implied type to\n                  boolean. We know that number cannot be selected\n                  because it is caught in the first clause.\n                */\n                var impliedType = getTypeWithFacts(getUnionType(clauseWitnesses.map(function (text) { return getImpliedTypeFromTypeofGuard(type, text) || type; })), switchFacts);\n                return getTypeWithFacts(mapType(type, narrowUnionMemberByTypeof(impliedType)), switchFacts);\n            }\n            function isMatchingConstructorReference(expr) {\n                return (ts.isPropertyAccessExpression(expr) && ts.idText(expr.name) === \"constructor\" ||\n                    ts.isElementAccessExpression(expr) && ts.isStringLiteralLike(expr.argumentExpression) && expr.argumentExpression.text === \"constructor\") &&\n                    isMatchingReference(reference, expr.expression);\n            }\n            function narrowTypeByConstructor(type, operator, identifier, assumeTrue) {\n                // Do not narrow when checking inequality.\n                if (assumeTrue ? (operator !== 34 /* EqualsEqualsToken */ && operator !== 36 /* EqualsEqualsEqualsToken */) : (operator !== 35 /* ExclamationEqualsToken */ && operator !== 37 /* ExclamationEqualsEqualsToken */)) {\n                    return type;\n                }\n                // Get the type of the constructor identifier expression, if it is not a function then do not narrow.\n                var identifierType = getTypeOfExpression(identifier);\n                if (!isFunctionType(identifierType) && !isConstructorType(identifierType)) {\n                    return type;\n                }\n                // Get the prototype property of the type identifier so we can find out its type.\n                var prototypeProperty = getPropertyOfType(identifierType, \"prototype\");\n                if (!prototypeProperty) {\n                    return type;\n                }\n                // Get the type of the prototype, if it is undefined, or the global `Object` or `Function` types then do not narrow.\n                var prototypeType = getTypeOfSymbol(prototypeProperty);\n                var candidate = !isTypeAny(prototypeType) ? prototypeType : undefined;\n                if (!candidate || candidate === globalObjectType || candidate === globalFunctionType) {\n                    return type;\n                }\n                // If the type that is being narrowed is `any` then just return the `candidate` type since every type is a subtype of `any`.\n                if (isTypeAny(type)) {\n                    return candidate;\n                }\n                // Filter out types that are not considered to be \"constructed by\" the `candidate` type.\n                return filterType(type, function (t) { return isConstructedBy(t, candidate); });\n                function isConstructedBy(source, target) {\n                    // If either the source or target type are a class type then we need to check that they are the same exact type.\n                    // This is because you may have a class `A` that defines some set of properties, and another class `B`\n                    // that defines the same set of properties as class `A`, in that case they are structurally the same\n                    // type, but when you do something like `instanceOfA.constructor === B` it will return false.\n                    if (source.flags & 524288 /* Object */ && ts.getObjectFlags(source) & 1 /* Class */ ||\n                        target.flags & 524288 /* Object */ && ts.getObjectFlags(target) & 1 /* Class */) {\n                        return source.symbol === target.symbol;\n                    }\n                    // For all other types just check that the `source` type is a subtype of the `target` type.\n                    return isTypeSubtypeOf(source, target);\n                }\n            }\n            function narrowTypeByInstanceof(type, expr, assumeTrue) {\n                var left = getReferenceCandidate(expr.left);\n                if (!isMatchingReference(reference, left)) {\n                    if (assumeTrue && strictNullChecks && optionalChainContainsReference(left, reference)) {\n                        return getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);\n                    }\n                    return type;\n                }\n                // Check that right operand is a function type with a prototype property\n                var rightType = getTypeOfExpression(expr.right);\n                if (!isTypeDerivedFrom(rightType, globalFunctionType)) {\n                    return type;\n                }\n                var targetType;\n                var prototypeProperty = getPropertyOfType(rightType, \"prototype\");\n                if (prototypeProperty) {\n                    // Target type is type of the prototype property\n                    var prototypePropertyType = getTypeOfSymbol(prototypeProperty);\n                    if (!isTypeAny(prototypePropertyType)) {\n                        targetType = prototypePropertyType;\n                    }\n                }\n                // Don't narrow from 'any' if the target type is exactly 'Object' or 'Function'\n                if (isTypeAny(type) && (targetType === globalObjectType || targetType === globalFunctionType)) {\n                    return type;\n                }\n                if (!targetType) {\n                    var constructSignatures = getSignaturesOfType(rightType, 1 /* Construct */);\n                    targetType = constructSignatures.length ?\n                        getUnionType(ts.map(constructSignatures, function (signature) { return getReturnTypeOfSignature(getErasedSignature(signature)); })) :\n                        emptyObjectType;\n                }\n                // We can't narrow a union based off instanceof without negated types see #31576 for more info\n                if (!assumeTrue && rightType.flags & 1048576 /* Union */) {\n                    var nonConstructorTypeInUnion = ts.find(rightType.types, function (t) { return !isConstructorType(t); });\n                    if (!nonConstructorTypeInUnion)\n                        return type;\n                }\n                return getNarrowedType(type, targetType, assumeTrue, isTypeDerivedFrom);\n            }\n            function getNarrowedType(type, candidate, assumeTrue, isRelated) {\n                if (!assumeTrue) {\n                    return filterType(type, function (t) { return !isRelated(t, candidate); });\n                }\n                // If the current type is a union type, remove all constituents that couldn't be instances of\n                // the candidate type. If one or more constituents remain, return a union of those.\n                if (type.flags & 1048576 /* Union */) {\n                    var assignableType = filterType(type, function (t) { return isRelated(t, candidate); });\n                    if (!(assignableType.flags & 131072 /* Never */)) {\n                        return assignableType;\n                    }\n                }\n                // If the candidate type is a subtype of the target type, narrow to the candidate type.\n                // Otherwise, if the target type is assignable to the candidate type, keep the target type.\n                // Otherwise, if the candidate type is assignable to the target type, narrow to the candidate\n                // type. Otherwise, the types are completely unrelated, so narrow to an intersection of the\n                // two types.\n                return isTypeSubtypeOf(candidate, type) ? candidate :\n                    isTypeAssignableTo(type, candidate) ? type :\n                        isTypeAssignableTo(candidate, type) ? candidate :\n                            getIntersectionType([type, candidate]);\n            }\n            function narrowTypeByCallExpression(type, callExpression, assumeTrue) {\n                if (hasMatchingArgument(callExpression, reference)) {\n                    var signature = assumeTrue || !ts.isCallChain(callExpression) ? getEffectsSignature(callExpression) : undefined;\n                    var predicate = signature && getTypePredicateOfSignature(signature);\n                    if (predicate && (predicate.kind === 0 /* This */ || predicate.kind === 1 /* Identifier */)) {\n                        return narrowTypeByTypePredicate(type, predicate, callExpression, assumeTrue);\n                    }\n                }\n                return type;\n            }\n            function narrowTypeByTypePredicate(type, predicate, callExpression, assumeTrue) {\n                // Don't narrow from 'any' if the predicate type is exactly 'Object' or 'Function'\n                if (predicate.type && !(isTypeAny(type) && (predicate.type === globalObjectType || predicate.type === globalFunctionType))) {\n                    var predicateArgument = getTypePredicateArgument(predicate, callExpression);\n                    if (predicateArgument) {\n                        if (isMatchingReference(reference, predicateArgument)) {\n                            return getNarrowedType(type, predicate.type, assumeTrue, isTypeSubtypeOf);\n                        }\n                        if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) &&\n                            !(getTypeFacts(predicate.type) & 65536 /* EQUndefined */)) {\n                            type = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);\n                        }\n                        if (isMatchingReferenceDiscriminant(predicateArgument, type)) {\n                            return narrowTypeByDiscriminant(type, predicateArgument, function (t) { return getNarrowedType(t, predicate.type, assumeTrue, isTypeSubtypeOf); });\n                        }\n                    }\n                }\n                return type;\n            }\n            // Narrow the given type based on the given expression having the assumed boolean value. The returned type\n            // will be a subtype or the same type as the argument.\n            function narrowType(type, expr, assumeTrue) {\n                // for `a?.b`, we emulate a synthetic `a !== null && a !== undefined` condition for `a`\n                if (ts.isExpressionOfOptionalChainRoot(expr) ||\n                    ts.isBinaryExpression(expr.parent) && expr.parent.operatorToken.kind === 60 /* QuestionQuestionToken */ && expr.parent.left === expr) {\n                    return narrowTypeByOptionality(type, expr, assumeTrue);\n                }\n                switch (expr.kind) {\n                    case 78 /* Identifier */:\n                    case 107 /* ThisKeyword */:\n                    case 105 /* SuperKeyword */:\n                    case 201 /* PropertyAccessExpression */:\n                    case 202 /* ElementAccessExpression */:\n                        return narrowTypeByTruthiness(type, expr, assumeTrue);\n                    case 203 /* CallExpression */:\n                        return narrowTypeByCallExpression(type, expr, assumeTrue);\n                    case 207 /* ParenthesizedExpression */:\n                    case 225 /* NonNullExpression */:\n                        return narrowType(type, expr.expression, assumeTrue);\n                    case 216 /* BinaryExpression */:\n                        return narrowTypeByBinaryExpression(type, expr, assumeTrue);\n                    case 214 /* PrefixUnaryExpression */:\n                        if (expr.operator === 53 /* ExclamationToken */) {\n                            return narrowType(type, expr.operand, !assumeTrue);\n                        }\n                        break;\n                }\n                return type;\n            }\n            function narrowTypeByOptionality(type, expr, assumePresent) {\n                if (isMatchingReference(reference, expr)) {\n                    return getTypeWithFacts(type, assumePresent ? 2097152 /* NEUndefinedOrNull */ : 262144 /* EQUndefinedOrNull */);\n                }\n                if (isMatchingReferenceDiscriminant(expr, type)) {\n                    return narrowTypeByDiscriminant(type, expr, function (t) { return getTypeWithFacts(t, assumePresent ? 2097152 /* NEUndefinedOrNull */ : 262144 /* EQUndefinedOrNull */); });\n                }\n                return type;\n            }\n        }\n        function getTypeOfSymbolAtLocation(symbol, location) {\n            symbol = symbol.exportSymbol || symbol;\n            // If we have an identifier or a property access at the given location, if the location is\n            // an dotted name expression, and if the location is not an assignment target, obtain the type\n            // of the expression (which will reflect control flow analysis). If the expression indeed\n            // resolved to the given symbol, return the narrowed type.\n            if (location.kind === 78 /* Identifier */) {\n                if (ts.isRightSideOfQualifiedNameOrPropertyAccess(location)) {\n                    location = location.parent;\n                }\n                if (ts.isExpressionNode(location) && !ts.isAssignmentTarget(location)) {\n                    var type = getTypeOfExpression(location);\n                    if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {\n                        return type;\n                    }\n                }\n            }\n            // The location isn't a reference to the given symbol, meaning we're being asked\n            // a hypothetical question of what type the symbol would have if there was a reference\n            // to it at the given location. Since we have no control flow information for the\n            // hypothetical reference (control flow information is created and attached by the\n            // binder), we simply return the declared type of the symbol.\n            return getTypeOfSymbol(symbol);\n        }\n        function getControlFlowContainer(node) {\n            return ts.findAncestor(node.parent, function (node) {\n                return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) ||\n                    node.kind === 257 /* ModuleBlock */ ||\n                    node.kind === 297 /* SourceFile */ ||\n                    node.kind === 163 /* PropertyDeclaration */;\n            });\n        }\n        // Check if a parameter is assigned anywhere within its declaring function.\n        function isParameterAssigned(symbol) {\n            var func = ts.getRootDeclaration(symbol.valueDeclaration).parent;\n            var links = getNodeLinks(func);\n            if (!(links.flags & 8388608 /* AssignmentsMarked */)) {\n                links.flags |= 8388608 /* AssignmentsMarked */;\n                if (!hasParentWithAssignmentsMarked(func)) {\n                    markParameterAssignments(func);\n                }\n            }\n            return symbol.isAssigned || false;\n        }\n        function hasParentWithAssignmentsMarked(node) {\n            return !!ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !!(getNodeLinks(node).flags & 8388608 /* AssignmentsMarked */); });\n        }\n        function markParameterAssignments(node) {\n            if (node.kind === 78 /* Identifier */) {\n                if (ts.isAssignmentTarget(node)) {\n                    var symbol = getResolvedSymbol(node);\n                    if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 160 /* Parameter */) {\n                        symbol.isAssigned = true;\n                    }\n                }\n            }\n            else {\n                ts.forEachChild(node, markParameterAssignments);\n            }\n        }\n        function isConstVariable(symbol) {\n            return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */) !== 0 && getTypeOfSymbol(symbol) !== autoArrayType;\n        }\n        /** remove undefined from the annotated type of a parameter when there is an initializer (that doesn't include undefined) */\n        function removeOptionalityFromDeclaredType(declaredType, declaration) {\n            if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) {\n                var annotationIncludesUndefined = strictNullChecks &&\n                    declaration.kind === 160 /* Parameter */ &&\n                    declaration.initializer &&\n                    getFalsyFlags(declaredType) & 32768 /* Undefined */ &&\n                    !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */);\n                popTypeResolution();\n                return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType;\n            }\n            else {\n                reportCircularityError(declaration.symbol);\n                return declaredType;\n            }\n        }\n        function isConstraintPosition(node) {\n            var parent = node.parent;\n            return parent.kind === 201 /* PropertyAccessExpression */ ||\n                parent.kind === 203 /* CallExpression */ && parent.expression === node ||\n                parent.kind === 202 /* ElementAccessExpression */ && parent.expression === node ||\n                parent.kind === 198 /* BindingElement */ && parent.name === node && !!parent.initializer;\n        }\n        function typeHasNullableConstraint(type) {\n            return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */);\n        }\n        function getConstraintForLocation(type, node) {\n            // When a node is the left hand expression of a property access, element access, or call expression,\n            // and the type of the node includes type variables with constraints that are nullable, we fetch the\n            // apparent type of the node *before* performing control flow analysis such that narrowings apply to\n            // the constraint type.\n            if (type && isConstraintPosition(node) && forEachType(type, typeHasNullableConstraint)) {\n                return mapType(getWidenedType(type), getBaseConstraintOrType);\n            }\n            return type;\n        }\n        function isExportOrExportExpression(location) {\n            return !!ts.findAncestor(location, function (e) { return e.parent && ts.isExportAssignment(e.parent) && e.parent.expression === e && ts.isEntityNameExpression(e); });\n        }\n        function markAliasReferenced(symbol, location) {\n            if (isNonLocalAlias(symbol, /*excludes*/ 111551 /* Value */) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol)) {\n                var target = resolveAlias(symbol);\n                if (target.flags & 111551 /* Value */) {\n                    // An alias resolving to a const enum cannot be elided if (1) 'isolatedModules' is enabled\n                    // (because the const enum value will not be inlined), or if (2) the alias is an export\n                    // of a const enum declaration that will be preserved.\n                    if (compilerOptions.isolatedModules ||\n                        ts.shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) ||\n                        !isConstEnumOrConstEnumOnlyModule(target)) {\n                        markAliasSymbolAsReferenced(symbol);\n                    }\n                    else {\n                        markConstEnumAliasAsReferenced(symbol);\n                    }\n                }\n            }\n        }\n        function checkIdentifier(node) {\n            var symbol = getResolvedSymbol(node);\n            if (symbol === unknownSymbol) {\n                return errorType;\n            }\n            // As noted in ECMAScript 6 language spec, arrow functions never have an arguments objects.\n            // Although in down-level emit of arrow function, we emit it using function expression which means that\n            // arguments objects will be bound to the inner object; emitting arrow function natively in ES6, arguments objects\n            // will be bound to non-arrow function that contain this arrow function. This results in inconsistent behavior.\n            // To avoid that we will give an error to users if they use arguments objects in arrow function so that they\n            // can explicitly bound arguments objects\n            if (symbol === argumentsSymbol) {\n                var container = ts.getContainingFunction(node);\n                if (languageVersion < 2 /* ES2015 */) {\n                    if (container.kind === 209 /* ArrowFunction */) {\n                        error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);\n                    }\n                    else if (ts.hasSyntacticModifier(container, 256 /* Async */)) {\n                        error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method);\n                    }\n                }\n                getNodeLinks(container).flags |= 8192 /* CaptureArguments */;\n                return getTypeOfSymbol(symbol);\n            }\n            // We should only mark aliases as referenced if there isn't a local value declaration\n            // for the symbol. Also, don't mark any property access expression LHS - checkPropertyAccessExpression will handle that\n            if (!(node.parent && ts.isPropertyAccessExpression(node.parent) && node.parent.expression === node)) {\n                markAliasReferenced(symbol, node);\n            }\n            var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);\n            var sourceSymbol = localOrExportSymbol.flags & 2097152 /* Alias */ ? resolveAlias(localOrExportSymbol) : localOrExportSymbol;\n            if (getDeclarationNodeFlagsFromSymbol(sourceSymbol) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, sourceSymbol)) {\n                addDeprecatedSuggestion(node, sourceSymbol.declarations, node.escapedText);\n            }\n            var declaration = localOrExportSymbol.valueDeclaration;\n            if (localOrExportSymbol.flags & 32 /* Class */) {\n                // Due to the emit for class decorators, any reference to the class from inside of the class body\n                // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind\n                // behavior of class names in ES6.\n                if (declaration.kind === 252 /* ClassDeclaration */\n                    && ts.nodeIsDecorated(declaration)) {\n                    var container = ts.getContainingClass(node);\n                    while (container !== undefined) {\n                        if (container === declaration && container.name !== node) {\n                            getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */;\n                            getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */;\n                            break;\n                        }\n                        container = ts.getContainingClass(container);\n                    }\n                }\n                else if (declaration.kind === 221 /* ClassExpression */) {\n                    // When we emit a class expression with static members that contain a reference\n                    // to the constructor in the initializer, we will need to substitute that\n                    // binding with an alias as the class name is not in scope.\n                    var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false);\n                    while (container.kind !== 297 /* SourceFile */) {\n                        if (container.parent === declaration) {\n                            if (container.kind === 163 /* PropertyDeclaration */ && ts.hasSyntacticModifier(container, 32 /* Static */)) {\n                                getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */;\n                                getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */;\n                            }\n                            break;\n                        }\n                        container = ts.getThisContainer(container, /*includeArrowFunctions*/ false);\n                    }\n                }\n            }\n            checkNestedBlockScopedBinding(node, symbol);\n            var type = getConstraintForLocation(getTypeOfSymbol(localOrExportSymbol), node);\n            var assignmentKind = ts.getAssignmentTargetKind(node);\n            if (assignmentKind) {\n                if (!(localOrExportSymbol.flags & 3 /* Variable */) &&\n                    !(ts.isInJSFile(node) && localOrExportSymbol.flags & 512 /* ValueModule */)) {\n                    error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable, symbolToString(symbol));\n                    return errorType;\n                }\n                if (isReadonlySymbol(localOrExportSymbol)) {\n                    if (localOrExportSymbol.flags & 3 /* Variable */) {\n                        error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant, symbolToString(symbol));\n                    }\n                    else {\n                        error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(symbol));\n                    }\n                    return errorType;\n                }\n            }\n            var isAlias = localOrExportSymbol.flags & 2097152 /* Alias */;\n            // We only narrow variables and parameters occurring in a non-assignment position. For all other\n            // entities we simply return the declared type.\n            if (localOrExportSymbol.flags & 3 /* Variable */) {\n                if (assignmentKind === 1 /* Definite */) {\n                    return type;\n                }\n            }\n            else if (isAlias) {\n                declaration = ts.find(symbol.declarations, isSomeImportDeclaration);\n            }\n            else {\n                return type;\n            }\n            if (!declaration) {\n                return type;\n            }\n            // The declaration container is the innermost function that encloses the declaration of the variable\n            // or parameter. The flow container is the innermost function starting with which we analyze the control\n            // flow graph to determine the control flow based type.\n            var isParameter = ts.getRootDeclaration(declaration).kind === 160 /* Parameter */;\n            var declarationContainer = getControlFlowContainer(declaration);\n            var flowContainer = getControlFlowContainer(node);\n            var isOuterVariable = flowContainer !== declarationContainer;\n            var isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && ts.isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);\n            var isModuleExports = symbol.flags & 134217728 /* ModuleExports */;\n            // When the control flow originates in a function expression or arrow function and we are referencing\n            // a const variable or parameter from an outer function, we extend the origin of the control flow\n            // analysis to include the immediately enclosing function.\n            while (flowContainer !== declarationContainer && (flowContainer.kind === 208 /* FunctionExpression */ ||\n                flowContainer.kind === 209 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) &&\n                (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) {\n                flowContainer = getControlFlowContainer(flowContainer);\n            }\n            // We only look for uninitialized variables in strict null checking mode, and only when we can analyze\n            // the entire control flow graph from the variable's declaration (i.e. when the flow container and\n            // declaration container are the same).\n            var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) ||\n                type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 ||\n                    isInTypeQuery(node) || node.parent.kind === 270 /* ExportSpecifier */) ||\n                node.parent.kind === 225 /* NonNullExpression */ ||\n                declaration.kind === 249 /* VariableDeclaration */ && declaration.exclamationToken ||\n                declaration.flags & 8388608 /* Ambient */;\n            var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) :\n                type === autoType || type === autoArrayType ? undefinedType :\n                    getOptionalType(type);\n            var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized);\n            // A variable is considered uninitialized when it is possible to analyze the entire control flow graph\n            // from declaration to use, and when the variable's declared type doesn't include undefined but the\n            // control flow based type does include undefined.\n            if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {\n                if (flowType === autoType || flowType === autoArrayType) {\n                    if (noImplicitAny) {\n                        error(ts.getNameOfDeclaration(declaration), ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType));\n                        error(node, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType));\n                    }\n                    return convertAutoToAny(flowType);\n                }\n            }\n            else if (!assumeInitialized && !(getFalsyFlags(type) & 32768 /* Undefined */) && getFalsyFlags(flowType) & 32768 /* Undefined */) {\n                error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol));\n                // Return the declared type to reduce follow-on errors\n                return type;\n            }\n            return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType;\n        }\n        function isInsideFunction(node, threshold) {\n            return !!ts.findAncestor(node, function (n) { return n === threshold ? \"quit\" : ts.isFunctionLike(n); });\n        }\n        function getPartOfForStatementContainingNode(node, container) {\n            return ts.findAncestor(node, function (n) { return n === container ? \"quit\" : n === container.initializer || n === container.condition || n === container.incrementor || n === container.statement; });\n        }\n        function checkNestedBlockScopedBinding(node, symbol) {\n            if (languageVersion >= 2 /* ES2015 */ ||\n                (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 ||\n                ts.isSourceFile(symbol.valueDeclaration) ||\n                symbol.valueDeclaration.parent.kind === 287 /* CatchClause */) {\n                return;\n            }\n            // 1. walk from the use site up to the declaration and check\n            // if there is anything function like between declaration and use-site (is binding/class is captured in function).\n            // 2. walk from the declaration up to the boundary of lexical environment and check\n            // if there is an iteration statement in between declaration and boundary (is binding/class declared inside iteration statement)\n            var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration);\n            var usedInFunction = isInsideFunction(node.parent, container);\n            var current = container;\n            var containedInIterationStatement = false;\n            while (current && !ts.nodeStartsNewLexicalEnvironment(current)) {\n                if (ts.isIterationStatement(current, /*lookInLabeledStatements*/ false)) {\n                    containedInIterationStatement = true;\n                    break;\n                }\n                current = current.parent;\n            }\n            if (containedInIterationStatement) {\n                if (usedInFunction) {\n                    // mark iteration statement as containing block-scoped binding captured in some function\n                    var capturesBlockScopeBindingInLoopBody = true;\n                    if (ts.isForStatement(container)) {\n                        var varDeclList = ts.getAncestor(symbol.valueDeclaration, 250 /* VariableDeclarationList */);\n                        if (varDeclList && varDeclList.parent === container) {\n                            var part = getPartOfForStatementContainingNode(node.parent, container);\n                            if (part) {\n                                var links = getNodeLinks(part);\n                                links.flags |= 131072 /* ContainsCapturedBlockScopeBinding */;\n                                var capturedBindings = links.capturedBlockScopeBindings || (links.capturedBlockScopeBindings = []);\n                                ts.pushIfUnique(capturedBindings, symbol);\n                                if (part === container.initializer) {\n                                    capturesBlockScopeBindingInLoopBody = false; // Initializer is outside of loop body\n                                }\n                            }\n                        }\n                    }\n                    if (capturesBlockScopeBindingInLoopBody) {\n                        getNodeLinks(current).flags |= 65536 /* LoopWithCapturedBlockScopedBinding */;\n                    }\n                }\n                // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement.\n                // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back.\n                if (ts.isForStatement(container)) {\n                    var varDeclList = ts.getAncestor(symbol.valueDeclaration, 250 /* VariableDeclarationList */);\n                    if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) {\n                        getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */;\n                    }\n                }\n                // set 'declared inside loop' bit on the block-scoped binding\n                getNodeLinks(symbol.valueDeclaration).flags |= 524288 /* BlockScopedBindingInLoop */;\n            }\n            if (usedInFunction) {\n                getNodeLinks(symbol.valueDeclaration).flags |= 262144 /* CapturedBlockScopedBinding */;\n            }\n        }\n        function isBindingCapturedByNode(node, decl) {\n            var links = getNodeLinks(node);\n            return !!links && ts.contains(links.capturedBlockScopeBindings, getSymbolOfNode(decl));\n        }\n        function isAssignedInBodyOfForStatement(node, container) {\n            // skip parenthesized nodes\n            var current = node;\n            while (current.parent.kind === 207 /* ParenthesizedExpression */) {\n                current = current.parent;\n            }\n            // check if node is used as LHS in some assignment expression\n            var isAssigned = false;\n            if (ts.isAssignmentTarget(current)) {\n                isAssigned = true;\n            }\n            else if ((current.parent.kind === 214 /* PrefixUnaryExpression */ || current.parent.kind === 215 /* PostfixUnaryExpression */)) {\n                var expr = current.parent;\n                isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */;\n            }\n            if (!isAssigned) {\n                return false;\n            }\n            // at this point we know that node is the target of assignment\n            // now check that modification happens inside the statement part of the ForStatement\n            return !!ts.findAncestor(current, function (n) { return n === container ? \"quit\" : n === container.statement; });\n        }\n        function captureLexicalThis(node, container) {\n            getNodeLinks(node).flags |= 2 /* LexicalThis */;\n            if (container.kind === 163 /* PropertyDeclaration */ || container.kind === 166 /* Constructor */) {\n                var classNode = container.parent;\n                getNodeLinks(classNode).flags |= 4 /* CaptureThis */;\n            }\n            else {\n                getNodeLinks(container).flags |= 4 /* CaptureThis */;\n            }\n        }\n        function findFirstSuperCall(node) {\n            return ts.isSuperCall(node) ? node :\n                ts.isFunctionLike(node) ? undefined :\n                    ts.forEachChild(node, findFirstSuperCall);\n        }\n        /**\n         * Check if the given class-declaration extends null then return true.\n         * Otherwise, return false\n         * @param classDecl a class declaration to check if it extends null\n         */\n        function classDeclarationExtendsNull(classDecl) {\n            var classSymbol = getSymbolOfNode(classDecl);\n            var classInstanceType = getDeclaredTypeOfSymbol(classSymbol);\n            var baseConstructorType = getBaseConstructorTypeOfClass(classInstanceType);\n            return baseConstructorType === nullWideningType;\n        }\n        function checkThisBeforeSuper(node, container, diagnosticMessage) {\n            var containingClassDecl = container.parent;\n            var baseTypeNode = ts.getClassExtendsHeritageElement(containingClassDecl);\n            // If a containing class does not have extends clause or the class extends null\n            // skip checking whether super statement is called before \"this\" accessing.\n            if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) {\n                if (node.flowNode && !isPostSuperFlowNode(node.flowNode, /*noCacheCheck*/ false)) {\n                    error(node, diagnosticMessage);\n                }\n            }\n        }\n        function checkThisExpression(node) {\n            // Stop at the first arrow function so that we can\n            // tell whether 'this' needs to be captured.\n            var container = ts.getThisContainer(node, /* includeArrowFunctions */ true);\n            var capturedByArrowFunction = false;\n            if (container.kind === 166 /* Constructor */) {\n                checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class);\n            }\n            // Now skip arrow functions to get the \"real\" owner of 'this'.\n            if (container.kind === 209 /* ArrowFunction */) {\n                container = ts.getThisContainer(container, /* includeArrowFunctions */ false);\n                capturedByArrowFunction = true;\n            }\n            switch (container.kind) {\n                case 256 /* ModuleDeclaration */:\n                    error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);\n                    // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks\n                    break;\n                case 255 /* EnumDeclaration */:\n                    error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location);\n                    // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks\n                    break;\n                case 166 /* Constructor */:\n                    if (isInConstructorArgumentInitializer(node, container)) {\n                        error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments);\n                        // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks\n                    }\n                    break;\n                case 163 /* PropertyDeclaration */:\n                case 162 /* PropertySignature */:\n                    if (ts.hasSyntacticModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) {\n                        error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer);\n                        // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks\n                    }\n                    break;\n                case 158 /* ComputedPropertyName */:\n                    error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name);\n                    break;\n            }\n            // When targeting es6, mark that we'll need to capture `this` in its lexically bound scope.\n            if (capturedByArrowFunction && languageVersion < 2 /* ES2015 */) {\n                captureLexicalThis(node, container);\n            }\n            var type = tryGetThisTypeAt(node, /*includeGlobalThis*/ true, container);\n            if (noImplicitThis) {\n                var globalThisType_1 = getTypeOfSymbol(globalThisSymbol);\n                if (type === globalThisType_1 && capturedByArrowFunction) {\n                    error(node, ts.Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this);\n                }\n                else if (!type) {\n                    // With noImplicitThis, functions may not reference 'this' if it has type 'any'\n                    var diag = error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);\n                    if (!ts.isSourceFile(container)) {\n                        var outsideThis = tryGetThisTypeAt(container);\n                        if (outsideThis && outsideThis !== globalThisType_1) {\n                            ts.addRelatedInfo(diag, ts.createDiagnosticForNode(container, ts.Diagnostics.An_outer_value_of_this_is_shadowed_by_this_container));\n                        }\n                    }\n                }\n            }\n            return type || anyType;\n        }\n        function tryGetThisTypeAt(node, includeGlobalThis, container) {\n            if (includeGlobalThis === void 0) { includeGlobalThis = true; }\n            if (container === void 0) { container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); }\n            var isInJS = ts.isInJSFile(node);\n            if (ts.isFunctionLike(container) &&\n                (!isInParameterInitializerBeforeContainingFunction(node) || ts.getThisParameter(container))) {\n                var thisType = getThisTypeOfDeclaration(container) || isInJS && getTypeForThisExpressionFromJSDoc(container);\n                // Note: a parameter initializer should refer to class-this unless function-this is explicitly annotated.\n                // If this is a function in a JS file, it might be a class method.\n                if (!thisType) {\n                    var className = getClassNameFromPrototypeMethod(container);\n                    if (isInJS && className) {\n                        var classSymbol = checkExpression(className).symbol;\n                        if (classSymbol && classSymbol.members && (classSymbol.flags & 16 /* Function */)) {\n                            thisType = getDeclaredTypeOfSymbol(classSymbol).thisType;\n                        }\n                    }\n                    else if (isJSConstructor(container)) {\n                        thisType = getDeclaredTypeOfSymbol(getMergedSymbol(container.symbol)).thisType;\n                    }\n                    thisType || (thisType = getContextualThisParameterType(container));\n                }\n                if (thisType) {\n                    return getFlowTypeOfReference(node, thisType);\n                }\n            }\n            if (ts.isClassLike(container.parent)) {\n                var symbol = getSymbolOfNode(container.parent);\n                var type = ts.hasSyntacticModifier(container, 32 /* Static */) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType;\n                return getFlowTypeOfReference(node, type);\n            }\n            if (ts.isSourceFile(container)) {\n                // look up in the source file's locals or exports\n                if (container.commonJsModuleIndicator) {\n                    var fileSymbol = getSymbolOfNode(container);\n                    return fileSymbol && getTypeOfSymbol(fileSymbol);\n                }\n                else if (container.externalModuleIndicator) {\n                    // TODO: Maybe issue a better error than 'object is possibly undefined'\n                    return undefinedType;\n                }\n                else if (includeGlobalThis) {\n                    return getTypeOfSymbol(globalThisSymbol);\n                }\n            }\n        }\n        function getExplicitThisType(node) {\n            var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false);\n            if (ts.isFunctionLike(container)) {\n                var signature = getSignatureFromDeclaration(container);\n                if (signature.thisParameter) {\n                    return getExplicitTypeOfSymbol(signature.thisParameter);\n                }\n            }\n            if (ts.isClassLike(container.parent)) {\n                var symbol = getSymbolOfNode(container.parent);\n                return ts.hasSyntacticModifier(container, 32 /* Static */) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType;\n            }\n        }\n        function getClassNameFromPrototypeMethod(container) {\n            // Check if it's the RHS of a x.prototype.y = function [name]() { .... }\n            if (container.kind === 208 /* FunctionExpression */ &&\n                ts.isBinaryExpression(container.parent) &&\n                ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) {\n                // Get the 'x' of 'x.prototype.y = container'\n                return container.parent // x.prototype.y = container\n                    .left // x.prototype.y\n                    .expression // x.prototype\n                    .expression; // x\n            }\n            // x.prototype = { method() { } }\n            else if (container.kind === 165 /* MethodDeclaration */ &&\n                container.parent.kind === 200 /* ObjectLiteralExpression */ &&\n                ts.isBinaryExpression(container.parent.parent) &&\n                ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) {\n                return container.parent.parent.left.expression;\n            }\n            // x.prototype = { method: function() { } }\n            else if (container.kind === 208 /* FunctionExpression */ &&\n                container.parent.kind === 288 /* PropertyAssignment */ &&\n                container.parent.parent.kind === 200 /* ObjectLiteralExpression */ &&\n                ts.isBinaryExpression(container.parent.parent.parent) &&\n                ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) {\n                return container.parent.parent.parent.left.expression;\n            }\n            // Object.defineProperty(x, \"method\", { value: function() { } });\n            // Object.defineProperty(x, \"method\", { set: (x: () => void) => void });\n            // Object.defineProperty(x, \"method\", { get: () => function() { }) });\n            else if (container.kind === 208 /* FunctionExpression */ &&\n                ts.isPropertyAssignment(container.parent) &&\n                ts.isIdentifier(container.parent.name) &&\n                (container.parent.name.escapedText === \"value\" || container.parent.name.escapedText === \"get\" || container.parent.name.escapedText === \"set\") &&\n                ts.isObjectLiteralExpression(container.parent.parent) &&\n                ts.isCallExpression(container.parent.parent.parent) &&\n                container.parent.parent.parent.arguments[2] === container.parent.parent &&\n                ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) {\n                return container.parent.parent.parent.arguments[0].expression;\n            }\n            // Object.defineProperty(x, \"method\", { value() { } });\n            // Object.defineProperty(x, \"method\", { set(x: () => void) {} });\n            // Object.defineProperty(x, \"method\", { get() { return () => {} } });\n            else if (ts.isMethodDeclaration(container) &&\n                ts.isIdentifier(container.name) &&\n                (container.name.escapedText === \"value\" || container.name.escapedText === \"get\" || container.name.escapedText === \"set\") &&\n                ts.isObjectLiteralExpression(container.parent) &&\n                ts.isCallExpression(container.parent.parent) &&\n                container.parent.parent.arguments[2] === container.parent &&\n                ts.getAssignmentDeclarationKind(container.parent.parent) === 9 /* ObjectDefinePrototypeProperty */) {\n                return container.parent.parent.arguments[0].expression;\n            }\n        }\n        function getTypeForThisExpressionFromJSDoc(node) {\n            var jsdocType = ts.getJSDocType(node);\n            if (jsdocType && jsdocType.kind === 308 /* JSDocFunctionType */) {\n                var jsDocFunctionType = jsdocType;\n                if (jsDocFunctionType.parameters.length > 0 &&\n                    jsDocFunctionType.parameters[0].name &&\n                    jsDocFunctionType.parameters[0].name.escapedText === \"this\" /* This */) {\n                    return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type);\n                }\n            }\n            var thisTag = ts.getJSDocThisTag(node);\n            if (thisTag && thisTag.typeExpression) {\n                return getTypeFromTypeNode(thisTag.typeExpression);\n            }\n        }\n        function isInConstructorArgumentInitializer(node, constructorDecl) {\n            return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? \"quit\" : n.kind === 160 /* Parameter */ && n.parent === constructorDecl; });\n        }\n        function checkSuperExpression(node) {\n            var isCallExpression = node.parent.kind === 203 /* CallExpression */ && node.parent.expression === node;\n            var immediateContainer = ts.getSuperContainer(node, /*stopOnFunctions*/ true);\n            var container = immediateContainer;\n            var needToCaptureLexicalThis = false;\n            // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting\n            if (!isCallExpression) {\n                while (container && container.kind === 209 /* ArrowFunction */) {\n                    container = ts.getSuperContainer(container, /*stopOnFunctions*/ true);\n                    needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */;\n                }\n            }\n            var canUseSuperExpression = isLegalUsageOfSuperExpression(container);\n            var nodeCheckFlag = 0;\n            if (!canUseSuperExpression) {\n                // issue more specific error if super is used in computed property name\n                // class A { foo() { return \"1\" }}\n                // class B {\n                //     [super.foo()]() {}\n                // }\n                var current = ts.findAncestor(node, function (n) { return n === container ? \"quit\" : n.kind === 158 /* ComputedPropertyName */; });\n                if (current && current.kind === 158 /* ComputedPropertyName */) {\n                    error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name);\n                }\n                else if (isCallExpression) {\n                    error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors);\n                }\n                else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 200 /* ObjectLiteralExpression */)) {\n                    error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions);\n                }\n                else {\n                    error(node, ts.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class);\n                }\n                return errorType;\n            }\n            if (!isCallExpression && immediateContainer.kind === 166 /* Constructor */) {\n                checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class);\n            }\n            if (ts.hasSyntacticModifier(container, 32 /* Static */) || isCallExpression) {\n                nodeCheckFlag = 512 /* SuperStatic */;\n            }\n            else {\n                nodeCheckFlag = 256 /* SuperInstance */;\n            }\n            getNodeLinks(node).flags |= nodeCheckFlag;\n            // Due to how we emit async functions, we need to specialize the emit for an async method that contains a `super` reference.\n            // This is due to the fact that we emit the body of an async function inside of a generator function. As generator\n            // functions cannot reference `super`, we emit a helper inside of the method body, but outside of the generator. This helper\n            // uses an arrow function, which is permitted to reference `super`.\n            //\n            // There are two primary ways we can access `super` from within an async method. The first is getting the value of a property\n            // or indexed access on super, either as part of a right-hand-side expression or call expression. The second is when setting the value\n            // of a property or indexed access, either as part of an assignment expression or destructuring assignment.\n            //\n            // The simplest case is reading a value, in which case we will emit something like the following:\n            //\n            //  // ts\n            //  ...\n            //  async asyncMethod() {\n            //    let x = await super.asyncMethod();\n            //    return x;\n            //  }\n            //  ...\n            //\n            //  // js\n            //  ...\n            //  asyncMethod() {\n            //      const _super = Object.create(null, {\n            //        asyncMethod: { get: () => super.asyncMethod },\n            //      });\n            //      return __awaiter(this, arguments, Promise, function *() {\n            //          let x = yield _super.asyncMethod.call(this);\n            //          return x;\n            //      });\n            //  }\n            //  ...\n            //\n            // The more complex case is when we wish to assign a value, especially as part of a destructuring assignment. As both cases\n            // are legal in ES6, but also likely less frequent, we only emit setters if there is an assignment:\n            //\n            //  // ts\n            //  ...\n            //  async asyncMethod(ar: Promise<any[]>) {\n            //      [super.a, super.b] = await ar;\n            //  }\n            //  ...\n            //\n            //  // js\n            //  ...\n            //  asyncMethod(ar) {\n            //      const _super = Object.create(null, {\n            //        a: { get: () => super.a, set: (v) => super.a = v },\n            //        b: { get: () => super.b, set: (v) => super.b = v }\n            //      };\n            //      return __awaiter(this, arguments, Promise, function *() {\n            //          [_super.a, _super.b] = yield ar;\n            //      });\n            //  }\n            //  ...\n            //\n            // Creating an object that has getter and setters instead of just an accessor function is required for destructuring assignments\n            // as a call expression cannot be used as the target of a destructuring assignment while a property access can.\n            //\n            // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations.\n            if (container.kind === 165 /* MethodDeclaration */ && ts.hasSyntacticModifier(container, 256 /* Async */)) {\n                if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) {\n                    getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */;\n                }\n                else {\n                    getNodeLinks(container).flags |= 2048 /* AsyncMethodWithSuper */;\n                }\n            }\n            if (needToCaptureLexicalThis) {\n                // call expressions are allowed only in constructors so they should always capture correct 'this'\n                // super property access expressions can also appear in arrow functions -\n                // in this case they should also use correct lexical this\n                captureLexicalThis(node.parent, container);\n            }\n            if (container.parent.kind === 200 /* ObjectLiteralExpression */) {\n                if (languageVersion < 2 /* ES2015 */) {\n                    error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher);\n                    return errorType;\n                }\n                else {\n                    // for object literal assume that type of 'super' is 'any'\n                    return anyType;\n                }\n            }\n            // at this point the only legal case for parent is ClassLikeDeclaration\n            var classLikeDeclaration = container.parent;\n            if (!ts.getClassExtendsHeritageElement(classLikeDeclaration)) {\n                error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class);\n                return errorType;\n            }\n            var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(classLikeDeclaration));\n            var baseClassType = classType && getBaseTypes(classType)[0];\n            if (!baseClassType) {\n                return errorType;\n            }\n            if (container.kind === 166 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) {\n                // issue custom error message for super property access in constructor arguments (to be aligned with old compiler)\n                error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments);\n                return errorType;\n            }\n            return nodeCheckFlag === 512 /* SuperStatic */\n                ? getBaseConstructorTypeOfClass(classType)\n                : getTypeWithThisArgument(baseClassType, classType.thisType);\n            function isLegalUsageOfSuperExpression(container) {\n                if (!container) {\n                    return false;\n                }\n                if (isCallExpression) {\n                    // TS 1.0 SPEC (April 2014): 4.8.1\n                    // Super calls are only permitted in constructors of derived classes\n                    return container.kind === 166 /* Constructor */;\n                }\n                else {\n                    // TS 1.0 SPEC (April 2014)\n                    // 'super' property access is allowed\n                    // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance\n                    // - In a static member function or static member accessor\n                    // topmost container must be something that is directly nested in the class declaration\\object literal expression\n                    if (ts.isClassLike(container.parent) || container.parent.kind === 200 /* ObjectLiteralExpression */) {\n                        if (ts.hasSyntacticModifier(container, 32 /* Static */)) {\n                            return container.kind === 165 /* MethodDeclaration */ ||\n                                container.kind === 164 /* MethodSignature */ ||\n                                container.kind === 167 /* GetAccessor */ ||\n                                container.kind === 168 /* SetAccessor */;\n                        }\n                        else {\n                            return container.kind === 165 /* MethodDeclaration */ ||\n                                container.kind === 164 /* MethodSignature */ ||\n                                container.kind === 167 /* GetAccessor */ ||\n                                container.kind === 168 /* SetAccessor */ ||\n                                container.kind === 163 /* PropertyDeclaration */ ||\n                                container.kind === 162 /* PropertySignature */ ||\n                                container.kind === 166 /* Constructor */;\n                        }\n                    }\n                }\n                return false;\n            }\n        }\n        function getContainingObjectLiteral(func) {\n            return (func.kind === 165 /* MethodDeclaration */ ||\n                func.kind === 167 /* GetAccessor */ ||\n                func.kind === 168 /* SetAccessor */) && func.parent.kind === 200 /* ObjectLiteralExpression */ ? func.parent :\n                func.kind === 208 /* FunctionExpression */ && func.parent.kind === 288 /* PropertyAssignment */ ? func.parent.parent :\n                    undefined;\n        }\n        function getThisTypeArgument(type) {\n            return ts.getObjectFlags(type) & 4 /* Reference */ && type.target === globalThisType ? getTypeArguments(type)[0] : undefined;\n        }\n        function getThisTypeFromContextualType(type) {\n            return mapType(type, function (t) {\n                return t.flags & 2097152 /* Intersection */ ? ts.forEach(t.types, getThisTypeArgument) : getThisTypeArgument(t);\n            });\n        }\n        function getContextualThisParameterType(func) {\n            if (func.kind === 209 /* ArrowFunction */) {\n                return undefined;\n            }\n            if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) {\n                var contextualSignature = getContextualSignature(func);\n                if (contextualSignature) {\n                    var thisParameter = contextualSignature.thisParameter;\n                    if (thisParameter) {\n                        return getTypeOfSymbol(thisParameter);\n                    }\n                }\n            }\n            var inJs = ts.isInJSFile(func);\n            if (noImplicitThis || inJs) {\n                var containingLiteral = getContainingObjectLiteral(func);\n                if (containingLiteral) {\n                    // We have an object literal method. Check if the containing object literal has a contextual type\n                    // that includes a ThisType<T>. If so, T is the contextual type for 'this'. We continue looking in\n                    // any directly enclosing object literals.\n                    var contextualType = getApparentTypeOfContextualType(containingLiteral);\n                    var literal = containingLiteral;\n                    var type = contextualType;\n                    while (type) {\n                        var thisType = getThisTypeFromContextualType(type);\n                        if (thisType) {\n                            return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral)));\n                        }\n                        if (literal.parent.kind !== 288 /* PropertyAssignment */) {\n                            break;\n                        }\n                        literal = literal.parent.parent;\n                        type = getApparentTypeOfContextualType(literal);\n                    }\n                    // There was no contextual ThisType<T> for the containing object literal, so the contextual type\n                    // for 'this' is the non-null form of the contextual type for the containing object literal or\n                    // the type of the object literal itself.\n                    return getWidenedType(contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral));\n                }\n                // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the\n                // contextual type for 'this' is 'obj'.\n                var parent = ts.walkUpParenthesizedExpressions(func.parent);\n                if (parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) {\n                    var target = parent.left;\n                    if (ts.isAccessExpression(target)) {\n                        var expression = target.expression;\n                        // Don't contextually type `this` as `exports` in `exports.Point = function(x, y) { this.x = x; this.y = y; }`\n                        if (inJs && ts.isIdentifier(expression)) {\n                            var sourceFile = ts.getSourceFileOfNode(parent);\n                            if (sourceFile.commonJsModuleIndicator && getResolvedSymbol(expression) === sourceFile.symbol) {\n                                return undefined;\n                            }\n                        }\n                        return getWidenedType(checkExpressionCached(expression));\n                    }\n                }\n            }\n            return undefined;\n        }\n        // Return contextual type of parameter or undefined if no contextual type is available\n        function getContextuallyTypedParameterType(parameter) {\n            var func = parameter.parent;\n            if (!isContextSensitiveFunctionOrObjectLiteralMethod(func)) {\n                return undefined;\n            }\n            var iife = ts.getImmediatelyInvokedFunctionExpression(func);\n            if (iife && iife.arguments) {\n                var args = getEffectiveCallArguments(iife);\n                var indexOfParameter = func.parameters.indexOf(parameter);\n                if (parameter.dotDotDotToken) {\n                    return getSpreadArgumentType(args, indexOfParameter, args.length, anyType, /*context*/ undefined, 0 /* Normal */);\n                }\n                var links = getNodeLinks(iife);\n                var cached = links.resolvedSignature;\n                links.resolvedSignature = anySignature;\n                var type = indexOfParameter < args.length ?\n                    getWidenedLiteralType(checkExpression(args[indexOfParameter])) :\n                    parameter.initializer ? undefined : undefinedWideningType;\n                links.resolvedSignature = cached;\n                return type;\n            }\n            var contextualSignature = getContextualSignature(func);\n            if (contextualSignature) {\n                var index = func.parameters.indexOf(parameter) - (ts.getThisParameter(func) ? 1 : 0);\n                return parameter.dotDotDotToken && ts.lastOrUndefined(func.parameters) === parameter ?\n                    getRestTypeAtPosition(contextualSignature, index) :\n                    tryGetTypeAtPosition(contextualSignature, index);\n            }\n        }\n        function getContextualTypeForVariableLikeDeclaration(declaration) {\n            var typeNode = ts.getEffectiveTypeAnnotationNode(declaration);\n            if (typeNode) {\n                return getTypeFromTypeNode(typeNode);\n            }\n            switch (declaration.kind) {\n                case 160 /* Parameter */:\n                    return getContextuallyTypedParameterType(declaration);\n                case 198 /* BindingElement */:\n                    return getContextualTypeForBindingElement(declaration);\n                case 163 /* PropertyDeclaration */:\n                    if (ts.hasSyntacticModifier(declaration, 32 /* Static */)) {\n                        return getContextualTypeForStaticPropertyDeclaration(declaration);\n                    }\n                // By default, do nothing and return undefined - only the above cases have context implied by a parent\n            }\n        }\n        function getContextualTypeForBindingElement(declaration) {\n            var parent = declaration.parent.parent;\n            var name = declaration.propertyName || declaration.name;\n            var parentType = getContextualTypeForVariableLikeDeclaration(parent) ||\n                parent.kind !== 198 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent);\n            if (!parentType || ts.isBindingPattern(name) || ts.isComputedNonLiteralName(name))\n                return undefined;\n            if (parent.name.kind === 197 /* ArrayBindingPattern */) {\n                var index = ts.indexOfNode(declaration.parent.elements, declaration);\n                if (index < 0)\n                    return undefined;\n                return getContextualTypeForElementExpression(parentType, index);\n            }\n            var nameType = getLiteralTypeFromPropertyName(name);\n            if (isTypeUsableAsPropertyName(nameType)) {\n                var text = getPropertyNameFromType(nameType);\n                return getTypeOfPropertyOfType(parentType, text);\n            }\n        }\n        function getContextualTypeForStaticPropertyDeclaration(declaration) {\n            var parentType = ts.isExpression(declaration.parent) && getContextualType(declaration.parent);\n            if (!parentType)\n                return undefined;\n            return getTypeOfPropertyOfContextualType(parentType, getSymbolOfNode(declaration).escapedName);\n        }\n        // In a variable, parameter or property declaration with a type annotation,\n        //   the contextual type of an initializer expression is the type of the variable, parameter or property.\n        // Otherwise, in a parameter declaration of a contextually typed function expression,\n        //   the contextual type of an initializer expression is the contextual type of the parameter.\n        // Otherwise, in a variable or parameter declaration with a binding pattern name,\n        //   the contextual type of an initializer expression is the type implied by the binding pattern.\n        // Otherwise, in a binding pattern inside a variable or parameter declaration,\n        //   the contextual type of an initializer expression is the type annotation of the containing declaration, if present.\n        function getContextualTypeForInitializerExpression(node, contextFlags) {\n            var declaration = node.parent;\n            if (ts.hasInitializer(declaration) && node === declaration.initializer) {\n                var result = getContextualTypeForVariableLikeDeclaration(declaration);\n                if (result) {\n                    return result;\n                }\n                if (!(contextFlags & 8 /* SkipBindingPatterns */) && ts.isBindingPattern(declaration.name)) { // This is less a contextual type and more an implied shape - in some cases, this may be undesirable\n                    return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ true, /*reportErrors*/ false);\n                }\n            }\n            return undefined;\n        }\n        function getContextualTypeForReturnExpression(node) {\n            var func = ts.getContainingFunction(node);\n            if (func) {\n                var contextualReturnType = getContextualReturnType(func);\n                if (contextualReturnType) {\n                    var functionFlags = ts.getFunctionFlags(func);\n                    if (functionFlags & 1 /* Generator */) { // Generator or AsyncGenerator function\n                        var use = functionFlags & 2 /* Async */ ? 2 /* AsyncGeneratorReturnType */ : 1 /* GeneratorReturnType */;\n                        var iterationTypes = getIterationTypesOfIterable(contextualReturnType, use, /*errorNode*/ undefined);\n                        if (!iterationTypes) {\n                            return undefined;\n                        }\n                        contextualReturnType = iterationTypes.returnType;\n                        // falls through to unwrap Promise for AsyncGenerators\n                    }\n                    if (functionFlags & 2 /* Async */) { // Async function or AsyncGenerator function\n                        var contextualAwaitedType = mapType(contextualReturnType, getAwaitedType);\n                        return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]);\n                    }\n                    return contextualReturnType; // Regular function or Generator function\n                }\n            }\n            return undefined;\n        }\n        function getContextualTypeForAwaitOperand(node, contextFlags) {\n            var contextualType = getContextualType(node, contextFlags);\n            if (contextualType) {\n                var contextualAwaitedType = getAwaitedType(contextualType);\n                return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]);\n            }\n            return undefined;\n        }\n        function getContextualTypeForYieldOperand(node) {\n            var func = ts.getContainingFunction(node);\n            if (func) {\n                var functionFlags = ts.getFunctionFlags(func);\n                var contextualReturnType = getContextualReturnType(func);\n                if (contextualReturnType) {\n                    return node.asteriskToken\n                        ? contextualReturnType\n                        : getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, contextualReturnType, (functionFlags & 2 /* Async */) !== 0);\n                }\n            }\n            return undefined;\n        }\n        function isInParameterInitializerBeforeContainingFunction(node) {\n            var inBindingInitializer = false;\n            while (node.parent && !ts.isFunctionLike(node.parent)) {\n                if (ts.isParameter(node.parent) && (inBindingInitializer || node.parent.initializer === node)) {\n                    return true;\n                }\n                if (ts.isBindingElement(node.parent) && node.parent.initializer === node) {\n                    inBindingInitializer = true;\n                }\n                node = node.parent;\n            }\n            return false;\n        }\n        function getContextualIterationType(kind, functionDecl) {\n            var isAsync = !!(ts.getFunctionFlags(functionDecl) & 2 /* Async */);\n            var contextualReturnType = getContextualReturnType(functionDecl);\n            if (contextualReturnType) {\n                return getIterationTypeOfGeneratorFunctionReturnType(kind, contextualReturnType, isAsync)\n                    || undefined;\n            }\n            return undefined;\n        }\n        function getContextualReturnType(functionDecl) {\n            // If the containing function has a return type annotation, is a constructor, or is a get accessor whose\n            // corresponding set accessor has a type annotation, return statements in the function are contextually typed\n            var returnType = getReturnTypeFromAnnotation(functionDecl);\n            if (returnType) {\n                return returnType;\n            }\n            // Otherwise, if the containing function is contextually typed by a function type with exactly one call signature\n            // and that call signature is non-generic, return statements are contextually typed by the return type of the signature\n            var signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl);\n            if (signature && !isResolvingReturnTypeOfSignature(signature)) {\n                return getReturnTypeOfSignature(signature);\n            }\n            return undefined;\n        }\n        // In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter.\n        function getContextualTypeForArgument(callTarget, arg) {\n            var args = getEffectiveCallArguments(callTarget);\n            var argIndex = args.indexOf(arg); // -1 for e.g. the expression of a CallExpression, or the tag of a TaggedTemplateExpression\n            return argIndex === -1 ? undefined : getContextualTypeForArgumentAtIndex(callTarget, argIndex);\n        }\n        function getContextualTypeForArgumentAtIndex(callTarget, argIndex) {\n            // If we're already in the process of resolving the given signature, don't resolve again as\n            // that could cause infinite recursion. Instead, return anySignature.\n            var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget);\n            if (ts.isJsxOpeningLikeElement(callTarget) && argIndex === 0) {\n                return getEffectiveFirstArgumentForJsxSignature(signature, callTarget);\n            }\n            return getTypeAtPosition(signature, argIndex);\n        }\n        function getContextualTypeForSubstitutionExpression(template, substitutionExpression) {\n            if (template.parent.kind === 205 /* TaggedTemplateExpression */) {\n                return getContextualTypeForArgument(template.parent, substitutionExpression);\n            }\n            return undefined;\n        }\n        function getContextualTypeForBinaryOperand(node, contextFlags) {\n            var binaryExpression = node.parent;\n            var left = binaryExpression.left, operatorToken = binaryExpression.operatorToken, right = binaryExpression.right;\n            switch (operatorToken.kind) {\n                case 62 /* EqualsToken */:\n                case 75 /* AmpersandAmpersandEqualsToken */:\n                case 74 /* BarBarEqualsToken */:\n                case 76 /* QuestionQuestionEqualsToken */:\n                    return node === right ? getContextualTypeForAssignmentDeclaration(binaryExpression) : undefined;\n                case 56 /* BarBarToken */:\n                case 60 /* QuestionQuestionToken */:\n                    // When an || expression has a contextual type, the operands are contextually typed by that type, except\n                    // when that type originates in a binding pattern, the right operand is contextually typed by the type of\n                    // the left operand. When an || expression has no contextual type, the right operand is contextually typed\n                    // by the type of the left operand, except for the special case of Javascript declarations of the form\n                    // `namespace.prop = namespace.prop || {}`.\n                    var type = getContextualType(binaryExpression, contextFlags);\n                    return node === right && (type && type.pattern || !type && !ts.isDefaultedExpandoInitializer(binaryExpression)) ?\n                        getTypeOfExpression(left) : type;\n                case 55 /* AmpersandAmpersandToken */:\n                case 27 /* CommaToken */:\n                    return node === right ? getContextualType(binaryExpression, contextFlags) : undefined;\n                default:\n                    return undefined;\n            }\n        }\n        // In an assignment expression, the right operand is contextually typed by the type of the left operand.\n        // Don't do this for assignment declarations unless there is a type tag on the assignment, to avoid circularity from checking the right operand.\n        function getContextualTypeForAssignmentDeclaration(binaryExpression) {\n            var kind = ts.getAssignmentDeclarationKind(binaryExpression);\n            switch (kind) {\n                case 0 /* None */:\n                    return getTypeOfExpression(binaryExpression.left);\n                case 5 /* Property */:\n                case 1 /* ExportsProperty */:\n                case 6 /* Prototype */:\n                case 3 /* PrototypeProperty */:\n                    if (isPossiblyAliasedThisProperty(binaryExpression, kind)) {\n                        return getContextualTypeForThisPropertyAssignment(binaryExpression, kind);\n                    }\n                    // If `binaryExpression.left` was assigned a symbol, then this is a new declaration; otherwise it is an assignment to an existing declaration.\n                    // See `bindStaticPropertyAssignment` in `binder.ts`.\n                    else if (!binaryExpression.left.symbol) {\n                        return getTypeOfExpression(binaryExpression.left);\n                    }\n                    else {\n                        var decl = binaryExpression.left.symbol.valueDeclaration;\n                        if (!decl) {\n                            return undefined;\n                        }\n                        var lhs = ts.cast(binaryExpression.left, ts.isAccessExpression);\n                        var overallAnnotation = ts.getEffectiveTypeAnnotationNode(decl);\n                        if (overallAnnotation) {\n                            return getTypeFromTypeNode(overallAnnotation);\n                        }\n                        else if (ts.isIdentifier(lhs.expression)) {\n                            var id = lhs.expression;\n                            var parentSymbol = resolveName(id, id.escapedText, 111551 /* Value */, undefined, id.escapedText, /*isUse*/ true);\n                            if (parentSymbol) {\n                                var annotated = parentSymbol.valueDeclaration && ts.getEffectiveTypeAnnotationNode(parentSymbol.valueDeclaration);\n                                if (annotated) {\n                                    var nameStr = ts.getElementOrPropertyAccessName(lhs);\n                                    if (nameStr !== undefined) {\n                                        return getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated), nameStr);\n                                    }\n                                }\n                                return undefined;\n                            }\n                        }\n                        return ts.isInJSFile(decl) ? undefined : getTypeOfExpression(binaryExpression.left);\n                    }\n                case 2 /* ModuleExports */:\n                case 4 /* ThisProperty */:\n                    return getContextualTypeForThisPropertyAssignment(binaryExpression, kind);\n                case 7 /* ObjectDefinePropertyValue */:\n                case 8 /* ObjectDefinePropertyExports */:\n                case 9 /* ObjectDefinePrototypeProperty */:\n                    return ts.Debug.fail(\"Does not apply\");\n                default:\n                    return ts.Debug.assertNever(kind);\n            }\n        }\n        function isPossiblyAliasedThisProperty(declaration, kind) {\n            if (kind === void 0) { kind = ts.getAssignmentDeclarationKind(declaration); }\n            if (kind === 4 /* ThisProperty */) {\n                return true;\n            }\n            if (!ts.isInJSFile(declaration) || kind !== 5 /* Property */ || !ts.isIdentifier(declaration.left.expression)) {\n                return false;\n            }\n            var name = declaration.left.expression.escapedText;\n            var symbol = resolveName(declaration.left, name, 111551 /* Value */, undefined, undefined, /*isUse*/ true, /*excludeGlobals*/ true);\n            return ts.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration);\n        }\n        function getContextualTypeForThisPropertyAssignment(binaryExpression, kind) {\n            if (!binaryExpression.symbol)\n                return getTypeOfExpression(binaryExpression.left);\n            if (binaryExpression.symbol.valueDeclaration) {\n                var annotated = ts.getEffectiveTypeAnnotationNode(binaryExpression.symbol.valueDeclaration);\n                if (annotated) {\n                    var type = getTypeFromTypeNode(annotated);\n                    if (type) {\n                        return type;\n                    }\n                }\n            }\n            if (kind === 2 /* ModuleExports */)\n                return undefined;\n            var thisAccess = ts.cast(binaryExpression.left, ts.isAccessExpression);\n            if (!ts.isObjectLiteralMethod(ts.getThisContainer(thisAccess.expression, /*includeArrowFunctions*/ false))) {\n                return undefined;\n            }\n            var thisType = checkThisExpression(thisAccess.expression);\n            var nameStr = ts.getElementOrPropertyAccessName(thisAccess);\n            return nameStr !== undefined && getTypeOfPropertyOfContextualType(thisType, nameStr) || undefined;\n        }\n        function isCircularMappedProperty(symbol) {\n            return !!(ts.getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.type && findResolutionCycleStartIndex(symbol, 0 /* Type */) >= 0);\n        }\n        function getTypeOfPropertyOfContextualType(type, name) {\n            return mapType(type, function (t) {\n                if (isGenericMappedType(t)) {\n                    var constraint = getConstraintTypeFromMappedType(t);\n                    var constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;\n                    var propertyNameType = getLiteralType(ts.unescapeLeadingUnderscores(name));\n                    if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {\n                        return substituteIndexedMappedType(t, propertyNameType);\n                    }\n                }\n                else if (t.flags & 3670016 /* StructuredType */) {\n                    var prop = getPropertyOfType(t, name);\n                    if (prop) {\n                        return isCircularMappedProperty(prop) ? undefined : getTypeOfSymbol(prop);\n                    }\n                    if (isTupleType(t)) {\n                        var restType = getRestTypeOfTupleType(t);\n                        if (restType && isNumericLiteralName(name) && +name >= 0) {\n                            return restType;\n                        }\n                    }\n                    return isNumericLiteralName(name) && getIndexTypeOfContextualType(t, 1 /* Number */) ||\n                        getIndexTypeOfContextualType(t, 0 /* String */);\n                }\n                return undefined;\n            }, /*noReductions*/ true);\n        }\n        function getIndexTypeOfContextualType(type, kind) {\n            return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }, /*noReductions*/ true);\n        }\n        // In an object literal contextually typed by a type T, the contextual type of a property assignment is the type of\n        // the matching property in T, if one exists. Otherwise, it is the type of the numeric index signature in T, if one\n        // exists. Otherwise, it is the type of the string index signature in T, if one exists.\n        function getContextualTypeForObjectLiteralMethod(node, contextFlags) {\n            ts.Debug.assert(ts.isObjectLiteralMethod(node));\n            if (node.flags & 16777216 /* InWithStatement */) {\n                // We cannot answer semantic questions within a with block, do not proceed any further\n                return undefined;\n            }\n            return getContextualTypeForObjectLiteralElement(node, contextFlags);\n        }\n        function getContextualTypeForObjectLiteralElement(element, contextFlags) {\n            var objectLiteral = element.parent;\n            var type = getApparentTypeOfContextualType(objectLiteral, contextFlags);\n            if (type) {\n                if (hasBindableName(element)) {\n                    // For a (non-symbol) computed property, there is no reason to look up the name\n                    // in the type. It will just be \"__computed\", which does not appear in any\n                    // SymbolTable.\n                    var symbolName_3 = getSymbolOfNode(element).escapedName;\n                    var propertyType = getTypeOfPropertyOfContextualType(type, symbolName_3);\n                    if (propertyType) {\n                        return propertyType;\n                    }\n                }\n                return isNumericName(element.name) && getIndexTypeOfContextualType(type, 1 /* Number */) ||\n                    getIndexTypeOfContextualType(type, 0 /* String */);\n            }\n            return undefined;\n        }\n        // In an array literal contextually typed by a type T, the contextual type of an element expression at index N is\n        // the type of the property with the numeric name N in T, if one exists. Otherwise, if T has a numeric index signature,\n        // it is the type of the numeric index signature in T. Otherwise, in ES6 and higher, the contextual type is the iterated\n        // type of T.\n        function getContextualTypeForElementExpression(arrayContextualType, index) {\n            return arrayContextualType && (getTypeOfPropertyOfContextualType(arrayContextualType, \"\" + index)\n                || mapType(arrayContextualType, function (t) { return getIteratedTypeOrElementType(1 /* Element */, t, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false); }, \n                /*noReductions*/ true));\n        }\n        // In a contextually typed conditional expression, the true/false expressions are contextually typed by the same type.\n        function getContextualTypeForConditionalOperand(node, contextFlags) {\n            var conditional = node.parent;\n            return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional, contextFlags) : undefined;\n        }\n        function getContextualTypeForChildJsxExpression(node, child) {\n            var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName);\n            // JSX expression is in children of JSX Element, we will look for an \"children\" attribute (we get the name from JSX.ElementAttributesProperty)\n            var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));\n            if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== \"\")) {\n                return undefined;\n            }\n            var realChildren = ts.getSemanticJsxChildren(node.children);\n            var childIndex = realChildren.indexOf(child);\n            var childFieldType = getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName);\n            return childFieldType && (realChildren.length === 1 ? childFieldType : mapType(childFieldType, function (t) {\n                if (isArrayLikeType(t)) {\n                    return getIndexedAccessType(t, getLiteralType(childIndex));\n                }\n                else {\n                    return t;\n                }\n            }, /*noReductions*/ true));\n        }\n        function getContextualTypeForJsxExpression(node) {\n            var exprParent = node.parent;\n            return ts.isJsxAttributeLike(exprParent)\n                ? getContextualType(node)\n                : ts.isJsxElement(exprParent)\n                    ? getContextualTypeForChildJsxExpression(exprParent, node)\n                    : undefined;\n        }\n        function getContextualTypeForJsxAttribute(attribute) {\n            // When we trying to resolve JsxOpeningLikeElement as a stateless function element, we will already give its attributes a contextual type\n            // which is a type of the parameter of the signature we are trying out.\n            // If there is no contextual type (e.g. we are trying to resolve stateful component), get attributes type from resolving element's tagName\n            if (ts.isJsxAttribute(attribute)) {\n                var attributesType = getApparentTypeOfContextualType(attribute.parent);\n                if (!attributesType || isTypeAny(attributesType)) {\n                    return undefined;\n                }\n                return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText);\n            }\n            else {\n                return getContextualType(attribute.parent);\n            }\n        }\n        // Return true if the given expression is possibly a discriminant value. We limit the kinds of\n        // expressions we check to those that don't depend on their contextual type in order not to cause\n        // recursive (and possibly infinite) invocations of getContextualType.\n        function isPossiblyDiscriminantValue(node) {\n            switch (node.kind) {\n                case 10 /* StringLiteral */:\n                case 8 /* NumericLiteral */:\n                case 9 /* BigIntLiteral */:\n                case 14 /* NoSubstitutionTemplateLiteral */:\n                case 109 /* TrueKeyword */:\n                case 94 /* FalseKeyword */:\n                case 103 /* NullKeyword */:\n                case 78 /* Identifier */:\n                case 150 /* UndefinedKeyword */:\n                    return true;\n                case 201 /* PropertyAccessExpression */:\n                case 207 /* ParenthesizedExpression */:\n                    return isPossiblyDiscriminantValue(node.expression);\n                case 283 /* JsxExpression */:\n                    return !node.expression || isPossiblyDiscriminantValue(node.expression);\n            }\n            return false;\n        }\n        function discriminateContextualTypeByObjectMembers(node, contextualType) {\n            return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 288 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType);\n        }\n        function discriminateContextualTypeByJSXAttributes(node, contextualType) {\n            return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 280 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType);\n        }\n        // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily\n        // be \"pushed\" onto a node using the contextualType property.\n        function getApparentTypeOfContextualType(node, contextFlags) {\n            var contextualType = ts.isObjectLiteralMethod(node) ?\n                getContextualTypeForObjectLiteralMethod(node, contextFlags) :\n                getContextualType(node, contextFlags);\n            var instantiatedType = instantiateContextualType(contextualType, node, contextFlags);\n            if (instantiatedType && !(contextFlags && contextFlags & 2 /* NoConstraints */ && instantiatedType.flags & 8650752 /* TypeVariable */)) {\n                var apparentType = mapType(instantiatedType, getApparentType, /*noReductions*/ true);\n                if (apparentType.flags & 1048576 /* Union */) {\n                    if (ts.isObjectLiteralExpression(node)) {\n                        return discriminateContextualTypeByObjectMembers(node, apparentType);\n                    }\n                    else if (ts.isJsxAttributes(node)) {\n                        return discriminateContextualTypeByJSXAttributes(node, apparentType);\n                    }\n                }\n                return apparentType;\n            }\n        }\n        // If the given contextual type contains instantiable types and if a mapper representing\n        // return type inferences is available, instantiate those types using that mapper.\n        function instantiateContextualType(contextualType, node, contextFlags) {\n            if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) {\n                var inferenceContext = getInferenceContext(node);\n                // If no inferences have been made, nothing is gained from instantiating as type parameters\n                // would just be replaced with their defaults similar to the apparent type.\n                if (inferenceContext && ts.some(inferenceContext.inferences, hasInferenceCandidates)) {\n                    // For contextual signatures we incorporate all inferences made so far, e.g. from return\n                    // types as well as arguments to the left in a function call.\n                    if (contextFlags && contextFlags & 1 /* Signature */) {\n                        return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);\n                    }\n                    // For other purposes (e.g. determining whether to produce literal types) we only\n                    // incorporate inferences made from the return type in a function call.\n                    if (inferenceContext.returnMapper) {\n                        return instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);\n                    }\n                }\n            }\n            return contextualType;\n        }\n        // This function is similar to instantiateType, except that (a) it only instantiates types that\n        // are classified as instantiable (i.e. it doesn't instantiate object types), and (b) it performs\n        // no reductions on instantiated union types.\n        function instantiateInstantiableTypes(type, mapper) {\n            if (type.flags & 465829888 /* Instantiable */) {\n                return instantiateType(type, mapper);\n            }\n            if (type.flags & 1048576 /* Union */) {\n                return getUnionType(ts.map(type.types, function (t) { return instantiateInstantiableTypes(t, mapper); }), 0 /* None */);\n            }\n            if (type.flags & 2097152 /* Intersection */) {\n                return getIntersectionType(ts.map(type.types, function (t) { return instantiateInstantiableTypes(t, mapper); }));\n            }\n            return type;\n        }\n        /**\n         * Whoa! Do you really want to use this function?\n         *\n         * Unless you're trying to get the *non-apparent* type for a\n         * value-literal type or you're authoring relevant portions of this algorithm,\n         * you probably meant to use 'getApparentTypeOfContextualType'.\n         * Otherwise this may not be very useful.\n         *\n         * In cases where you *are* working on this function, you should understand\n         * when it is appropriate to use 'getContextualType' and 'getApparentTypeOfContextualType'.\n         *\n         *   - Use 'getContextualType' when you are simply going to propagate the result to the expression.\n         *   - Use 'getApparentTypeOfContextualType' when you're going to need the members of the type.\n         *\n         * @param node the expression whose contextual type will be returned.\n         * @returns the contextual type of an expression.\n         */\n        function getContextualType(node, contextFlags) {\n            if (node.flags & 16777216 /* InWithStatement */) {\n                // We cannot answer semantic questions within a with block, do not proceed any further\n                return undefined;\n            }\n            if (node.contextualType) {\n                return node.contextualType;\n            }\n            var parent = node.parent;\n            switch (parent.kind) {\n                case 249 /* VariableDeclaration */:\n                case 160 /* Parameter */:\n                case 163 /* PropertyDeclaration */:\n                case 162 /* PropertySignature */:\n                case 198 /* BindingElement */:\n                    return getContextualTypeForInitializerExpression(node, contextFlags);\n                case 209 /* ArrowFunction */:\n                case 242 /* ReturnStatement */:\n                    return getContextualTypeForReturnExpression(node);\n                case 219 /* YieldExpression */:\n                    return getContextualTypeForYieldOperand(parent);\n                case 213 /* AwaitExpression */:\n                    return getContextualTypeForAwaitOperand(parent, contextFlags);\n                case 203 /* CallExpression */:\n                    if (parent.expression.kind === 99 /* ImportKeyword */) {\n                        return stringType;\n                    }\n                /* falls through */\n                case 204 /* NewExpression */:\n                    return getContextualTypeForArgument(parent, node);\n                case 206 /* TypeAssertionExpression */:\n                case 224 /* AsExpression */:\n                    return ts.isConstTypeReference(parent.type) ? tryFindWhenConstTypeReference(parent) : getTypeFromTypeNode(parent.type);\n                case 216 /* BinaryExpression */:\n                    return getContextualTypeForBinaryOperand(node, contextFlags);\n                case 288 /* PropertyAssignment */:\n                case 289 /* ShorthandPropertyAssignment */:\n                    return getContextualTypeForObjectLiteralElement(parent, contextFlags);\n                case 290 /* SpreadAssignment */:\n                    return getApparentTypeOfContextualType(parent.parent, contextFlags);\n                case 199 /* ArrayLiteralExpression */: {\n                    var arrayLiteral = parent;\n                    var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags);\n                    return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node));\n                }\n                case 217 /* ConditionalExpression */:\n                    return getContextualTypeForConditionalOperand(node, contextFlags);\n                case 228 /* TemplateSpan */:\n                    ts.Debug.assert(parent.parent.kind === 218 /* TemplateExpression */);\n                    return getContextualTypeForSubstitutionExpression(parent.parent, node);\n                case 207 /* ParenthesizedExpression */: {\n                    // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast.\n                    var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined;\n                    return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags);\n                }\n                case 225 /* NonNullExpression */:\n                    return getContextualType(parent, contextFlags);\n                case 283 /* JsxExpression */:\n                    return getContextualTypeForJsxExpression(parent);\n                case 280 /* JsxAttribute */:\n                case 282 /* JsxSpreadAttribute */:\n                    return getContextualTypeForJsxAttribute(parent);\n                case 275 /* JsxOpeningElement */:\n                case 274 /* JsxSelfClosingElement */:\n                    return getContextualJsxElementAttributesType(parent, contextFlags);\n            }\n            return undefined;\n            function tryFindWhenConstTypeReference(node) {\n                return getContextualType(node);\n            }\n        }\n        function getInferenceContext(node) {\n            var ancestor = ts.findAncestor(node, function (n) { return !!n.inferenceContext; });\n            return ancestor && ancestor.inferenceContext;\n        }\n        function getContextualJsxElementAttributesType(node, contextFlags) {\n            if (ts.isJsxOpeningElement(node) && node.parent.contextualType && contextFlags !== 4 /* Completions */) {\n                // Contextually applied type is moved from attributes up to the outer jsx attributes so when walking up from the children they get hit\n                // _However_ to hit them from the _attributes_ we must look for them here; otherwise we'll used the declared type\n                // (as below) instead!\n                return node.parent.contextualType;\n            }\n            return getContextualTypeForArgumentAtIndex(node, 0);\n        }\n        function getEffectiveFirstArgumentForJsxSignature(signature, node) {\n            return getJsxReferenceKind(node) !== 0 /* Component */\n                ? getJsxPropsTypeFromCallSignature(signature, node)\n                : getJsxPropsTypeFromClassType(signature, node);\n        }\n        function getJsxPropsTypeFromCallSignature(sig, context) {\n            var propsType = getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType);\n            propsType = getJsxManagedAttributesFromLocatedAttributes(context, getJsxNamespaceAt(context), propsType);\n            var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);\n            if (intrinsicAttribs !== errorType) {\n                propsType = intersectTypes(intrinsicAttribs, propsType);\n            }\n            return propsType;\n        }\n        function getJsxPropsTypeForSignatureFromMember(sig, forcedLookupLocation) {\n            if (sig.unionSignatures) {\n                // JSX Elements using the legacy `props`-field based lookup (eg, react class components) need to treat the `props` member as an input\n                // instead of an output position when resolving the signature. We need to go back to the input signatures of the composite signature,\n                // get the type of `props` on each return type individually, and then _intersect them_, rather than union them (as would normally occur\n                // for a union signature). It's an unfortunate quirk of looking in the output of the signature for the type we want to use for the input.\n                // The default behavior of `getTypeOfFirstParameterOfSignatureWithFallback` when no `props` member name is defined is much more sane.\n                var results = [];\n                for (var _i = 0, _a = sig.unionSignatures; _i < _a.length; _i++) {\n                    var signature = _a[_i];\n                    var instance = getReturnTypeOfSignature(signature);\n                    if (isTypeAny(instance)) {\n                        return instance;\n                    }\n                    var propType = getTypeOfPropertyOfType(instance, forcedLookupLocation);\n                    if (!propType) {\n                        return;\n                    }\n                    results.push(propType);\n                }\n                return getIntersectionType(results);\n            }\n            var instanceType = getReturnTypeOfSignature(sig);\n            return isTypeAny(instanceType) ? instanceType : getTypeOfPropertyOfType(instanceType, forcedLookupLocation);\n        }\n        function getStaticTypeOfReferencedJsxConstructor(context) {\n            if (isJsxIntrinsicIdentifier(context.tagName)) {\n                var result = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(context);\n                var fakeSignature = createSignatureForJSXIntrinsic(context, result);\n                return getOrCreateTypeFromSignature(fakeSignature);\n            }\n            var tagType = checkExpressionCached(context.tagName);\n            if (tagType.flags & 128 /* StringLiteral */) {\n                var result = getIntrinsicAttributesTypeFromStringLiteralType(tagType, context);\n                if (!result) {\n                    return errorType;\n                }\n                var fakeSignature = createSignatureForJSXIntrinsic(context, result);\n                return getOrCreateTypeFromSignature(fakeSignature);\n            }\n            return tagType;\n        }\n        function getJsxManagedAttributesFromLocatedAttributes(context, ns, attributesType) {\n            var managedSym = getJsxLibraryManagedAttributes(ns);\n            if (managedSym) {\n                var declaredManagedType = getDeclaredTypeOfSymbol(managedSym); // fetches interface type, or initializes symbol links type parmaeters\n                var ctorType = getStaticTypeOfReferencedJsxConstructor(context);\n                if (managedSym.flags & 524288 /* TypeAlias */) {\n                    var params = getSymbolLinks(managedSym).typeParameters;\n                    if (ts.length(params) >= 2) {\n                        var args = fillMissingTypeArguments([ctorType, attributesType], params, 2, ts.isInJSFile(context));\n                        return getTypeAliasInstantiation(managedSym, args);\n                    }\n                }\n                if (ts.length(declaredManagedType.typeParameters) >= 2) {\n                    var args = fillMissingTypeArguments([ctorType, attributesType], declaredManagedType.typeParameters, 2, ts.isInJSFile(context));\n                    return createTypeReference(declaredManagedType, args);\n                }\n            }\n            return attributesType;\n        }\n        function getJsxPropsTypeFromClassType(sig, context) {\n            var ns = getJsxNamespaceAt(context);\n            var forcedLookupLocation = getJsxElementPropertiesName(ns);\n            var attributesType = forcedLookupLocation === undefined\n                // If there is no type ElementAttributesProperty, return the type of the first parameter of the signature, which should be the props type\n                ? getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType)\n                : forcedLookupLocation === \"\"\n                    // If there is no e.g. 'props' member in ElementAttributesProperty, use the element class type instead\n                    ? getReturnTypeOfSignature(sig)\n                    // Otherwise get the type of the property on the signature return type\n                    : getJsxPropsTypeForSignatureFromMember(sig, forcedLookupLocation);\n            if (!attributesType) {\n                // There is no property named 'props' on this instance type\n                if (!!forcedLookupLocation && !!ts.length(context.attributes.properties)) {\n                    error(context, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, ts.unescapeLeadingUnderscores(forcedLookupLocation));\n                }\n                return unknownType;\n            }\n            attributesType = getJsxManagedAttributesFromLocatedAttributes(context, ns, attributesType);\n            if (isTypeAny(attributesType)) {\n                // Props is of type 'any' or unknown\n                return attributesType;\n            }\n            else {\n                // Normal case -- add in IntrinsicClassElements<T> and IntrinsicElements\n                var apparentAttributesType = attributesType;\n                var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes, context);\n                if (intrinsicClassAttribs !== errorType) {\n                    var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol);\n                    var hostClassType = getReturnTypeOfSignature(sig);\n                    apparentAttributesType = intersectTypes(typeParams\n                        ? createTypeReference(intrinsicClassAttribs, fillMissingTypeArguments([hostClassType], typeParams, getMinTypeArgumentCount(typeParams), ts.isInJSFile(context)))\n                        : intrinsicClassAttribs, apparentAttributesType);\n                }\n                var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);\n                if (intrinsicAttribs !== errorType) {\n                    apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType);\n                }\n                return apparentAttributesType;\n            }\n        }\n        // If the given type is an object or union type with a single signature, and if that signature has at\n        // least as many parameters as the given function, return the signature. Otherwise return undefined.\n        function getContextualCallSignature(type, node) {\n            var signatures = getSignaturesOfType(type, 0 /* Call */);\n            if (signatures.length === 1) {\n                var signature = signatures[0];\n                if (!isAritySmaller(signature, node)) {\n                    return signature;\n                }\n            }\n        }\n        /** If the contextual signature has fewer parameters than the function expression, do not use it */\n        function isAritySmaller(signature, target) {\n            var targetParameterCount = 0;\n            for (; targetParameterCount < target.parameters.length; targetParameterCount++) {\n                var param = target.parameters[targetParameterCount];\n                if (param.initializer || param.questionToken || param.dotDotDotToken || isJSDocOptionalParameter(param)) {\n                    break;\n                }\n            }\n            if (target.parameters.length && ts.parameterIsThisKeyword(target.parameters[0])) {\n                targetParameterCount--;\n            }\n            return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount;\n        }\n        function isFunctionExpressionOrArrowFunction(node) {\n            return node.kind === 208 /* FunctionExpression */ || node.kind === 209 /* ArrowFunction */;\n        }\n        function getContextualSignatureForFunctionLikeDeclaration(node) {\n            // Only function expressions, arrow functions, and object literal methods are contextually typed.\n            return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node)\n                ? getContextualSignature(node)\n                : undefined;\n        }\n        // Return the contextual signature for a given expression node. A contextual type provides a\n        // contextual signature if it has a single call signature and if that call signature is non-generic.\n        // If the contextual type is a union type, get the signature from each type possible and if they are\n        // all identical ignoring their return type, the result is same signature but with return type as\n        // union type of return types from these signatures\n        function getContextualSignature(node) {\n            ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));\n            var typeTagSignature = getSignatureOfTypeTag(node);\n            if (typeTagSignature) {\n                return typeTagSignature;\n            }\n            var type = getApparentTypeOfContextualType(node, 1 /* Signature */);\n            if (!type) {\n                return undefined;\n            }\n            if (!(type.flags & 1048576 /* Union */)) {\n                return getContextualCallSignature(type, node);\n            }\n            var signatureList;\n            var types = type.types;\n            for (var _i = 0, types_20 = types; _i < types_20.length; _i++) {\n                var current = types_20[_i];\n                var signature = getContextualCallSignature(current, node);\n                if (signature) {\n                    if (!signatureList) {\n                        // This signature will contribute to contextual union signature\n                        signatureList = [signature];\n                    }\n                    else if (!compareSignaturesIdentical(signatureList[0], signature, /*partialMatch*/ false, /*ignoreThisTypes*/ true, /*ignoreReturnTypes*/ true, compareTypesIdentical)) {\n                        // Signatures aren't identical, do not use\n                        return undefined;\n                    }\n                    else {\n                        // Use this signature for contextual union signature\n                        signatureList.push(signature);\n                    }\n                }\n            }\n            // Result is union of signatures collected (return type is union of return types of this signature set)\n            if (signatureList) {\n                return signatureList.length === 1 ? signatureList[0] : createUnionSignature(signatureList[0], signatureList);\n            }\n        }\n        function checkSpreadExpression(node, checkMode) {\n            if (languageVersion < 2 /* ES2015 */) {\n                checkExternalEmitHelpers(node, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);\n            }\n            var arrayOrIterableType = checkExpression(node.expression, checkMode);\n            return checkIteratedTypeOrElementType(33 /* Spread */, arrayOrIterableType, undefinedType, node.expression);\n        }\n        function checkSyntheticExpression(node) {\n            return node.isSpread ? getIndexedAccessType(node.type, numberType) : node.type;\n        }\n        function hasDefaultValue(node) {\n            return (node.kind === 198 /* BindingElement */ && !!node.initializer) ||\n                (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */);\n        }\n        function checkArrayLiteral(node, checkMode, forceTuple) {\n            var elements = node.elements;\n            var elementCount = elements.length;\n            var elementTypes = [];\n            var elementFlags = [];\n            var contextualType = getApparentTypeOfContextualType(node);\n            var inDestructuringPattern = ts.isAssignmentTarget(node);\n            var inConstContext = isConstContext(node);\n            for (var i = 0; i < elementCount; i++) {\n                var e = elements[i];\n                if (e.kind === 220 /* SpreadElement */) {\n                    if (languageVersion < 2 /* ES2015 */) {\n                        checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);\n                    }\n                    var spreadType = checkExpression(e.expression, checkMode, forceTuple);\n                    if (isArrayLikeType(spreadType)) {\n                        elementTypes.push(spreadType);\n                        elementFlags.push(8 /* Variadic */);\n                    }\n                    else if (inDestructuringPattern) {\n                        // Given the following situation:\n                        //    var c: {};\n                        //    [...c] = [\"\", 0];\n                        //\n                        // c is represented in the tree as a spread element in an array literal.\n                        // But c really functions as a rest element, and its purpose is to provide\n                        // a contextual type for the right hand side of the assignment. Therefore,\n                        // instead of calling checkExpression on \"...c\", which will give an error\n                        // if c is not iterable/array-like, we need to act as if we are trying to\n                        // get the contextual element type from it. So we do something similar to\n                        // getContextualTypeForElementExpression, which will crucially not error\n                        // if there is no index type / iterated type.\n                        var restElementType = getIndexTypeOfType(spreadType, 1 /* Number */) ||\n                            getIteratedTypeOrElementType(65 /* Destructuring */, spreadType, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false) ||\n                            unknownType;\n                        elementTypes.push(restElementType);\n                        elementFlags.push(4 /* Rest */);\n                    }\n                    else {\n                        elementTypes.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, e.expression));\n                        elementFlags.push(4 /* Rest */);\n                    }\n                }\n                else {\n                    var elementContextualType = getContextualTypeForElementExpression(contextualType, elementTypes.length);\n                    var type = checkExpressionForMutableLocation(e, checkMode, elementContextualType, forceTuple);\n                    elementTypes.push(type);\n                    elementFlags.push(1 /* Required */);\n                }\n            }\n            if (inDestructuringPattern) {\n                return createTupleType(elementTypes, elementFlags);\n            }\n            if (forceTuple || inConstContext || contextualType && forEachType(contextualType, isTupleLikeType)) {\n                return createArrayLiteralType(createTupleType(elementTypes, elementFlags, /*readonly*/ inConstContext));\n            }\n            return createArrayLiteralType(createArrayType(elementTypes.length ?\n                getUnionType(ts.sameMap(elementTypes, function (t, i) { return elementFlags[i] & 8 /* Variadic */ ? getIndexedAccessTypeOrUndefined(t, numberType) || anyType : t; }), 2 /* Subtype */) :\n                strictNullChecks ? implicitNeverType : undefinedWideningType, inConstContext));\n        }\n        function createArrayLiteralType(type) {\n            if (!(ts.getObjectFlags(type) & 4 /* Reference */)) {\n                return type;\n            }\n            var literalType = type.literalType;\n            if (!literalType) {\n                literalType = type.literalType = cloneTypeReference(type);\n                literalType.objectFlags |= 65536 /* ArrayLiteral */ | 1048576 /* ContainsObjectOrArrayLiteral */;\n            }\n            return literalType;\n        }\n        function isNumericName(name) {\n            switch (name.kind) {\n                case 158 /* ComputedPropertyName */:\n                    return isNumericComputedName(name);\n                case 78 /* Identifier */:\n                    return isNumericLiteralName(name.escapedText);\n                case 8 /* NumericLiteral */:\n                case 10 /* StringLiteral */:\n                    return isNumericLiteralName(name.text);\n                default:\n                    return false;\n            }\n        }\n        function isNumericComputedName(name) {\n            // It seems odd to consider an expression of type Any to result in a numeric name,\n            // but this behavior is consistent with checkIndexedAccess\n            return isTypeAssignableToKind(checkComputedPropertyName(name), 296 /* NumberLike */);\n        }\n        function isInfinityOrNaNString(name) {\n            return name === \"Infinity\" || name === \"-Infinity\" || name === \"NaN\";\n        }\n        function isNumericLiteralName(name) {\n            // The intent of numeric names is that\n            //     - they are names with text in a numeric form, and that\n            //     - setting properties/indexing with them is always equivalent to doing so with the numeric literal 'numLit',\n            //         acquired by applying the abstract 'ToNumber' operation on the name's text.\n            //\n            // The subtlety is in the latter portion, as we cannot reliably say that anything that looks like a numeric literal is a numeric name.\n            // In fact, it is the case that the text of the name must be equal to 'ToString(numLit)' for this to hold.\n            //\n            // Consider the property name '\"0xF00D\"'. When one indexes with '0xF00D', they are actually indexing with the value of 'ToString(0xF00D)'\n            // according to the ECMAScript specification, so it is actually as if the user indexed with the string '\"61453\"'.\n            // Thus, the text of all numeric literals equivalent to '61543' such as '0xF00D', '0xf00D', '0170015', etc. are not valid numeric names\n            // because their 'ToString' representation is not equal to their original text.\n            // This is motivated by ECMA-262 sections 9.3.1, 9.8.1, 11.1.5, and 11.2.1.\n            //\n            // Here, we test whether 'ToString(ToNumber(name))' is exactly equal to 'name'.\n            // The '+' prefix operator is equivalent here to applying the abstract ToNumber operation.\n            // Applying the 'toString()' method on a number gives us the abstract ToString operation on a number.\n            //\n            // Note that this accepts the values 'Infinity', '-Infinity', and 'NaN', and that this is intentional.\n            // This is desired behavior, because when indexing with them as numeric entities, you are indexing\n            // with the strings '\"Infinity\"', '\"-Infinity\"', and '\"NaN\"' respectively.\n            return (+name).toString() === name;\n        }\n        function checkComputedPropertyName(node) {\n            var links = getNodeLinks(node.expression);\n            if (!links.resolvedType) {\n                links.resolvedType = checkExpression(node.expression);\n                // This will allow types number, string, symbol or any. It will also allow enums, the unknown\n                // type, and any union of these types (like string | number).\n                if (links.resolvedType.flags & 98304 /* Nullable */ ||\n                    !isTypeAssignableToKind(links.resolvedType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) &&\n                        !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) {\n                    error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any);\n                }\n                else {\n                    checkThatExpressionIsProperSymbolReference(node.expression, links.resolvedType, /*reportError*/ true);\n                }\n            }\n            return links.resolvedType;\n        }\n        function isSymbolWithNumericName(symbol) {\n            var _a;\n            var firstDecl = (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a[0];\n            return isNumericLiteralName(symbol.escapedName) || (firstDecl && ts.isNamedDeclaration(firstDecl) && isNumericName(firstDecl.name));\n        }\n        function getObjectLiteralIndexInfo(node, offset, properties, kind) {\n            var propTypes = [];\n            for (var i = offset; i < properties.length; i++) {\n                if (kind === 0 /* String */ || isSymbolWithNumericName(properties[i])) {\n                    propTypes.push(getTypeOfSymbol(properties[i]));\n                }\n            }\n            var unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType;\n            return createIndexInfo(unionType, isConstContext(node));\n        }\n        function getImmediateAliasedSymbol(symbol) {\n            ts.Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, \"Should only get Alias here.\");\n            var links = getSymbolLinks(symbol);\n            if (!links.immediateTarget) {\n                var node = getDeclarationOfAliasSymbol(symbol);\n                if (!node)\n                    return ts.Debug.fail();\n                links.immediateTarget = getTargetOfAliasDeclaration(node, /*dontRecursivelyResolve*/ true);\n            }\n            return links.immediateTarget;\n        }\n        function checkObjectLiteral(node, checkMode) {\n            var inDestructuringPattern = ts.isAssignmentTarget(node);\n            // Grammar checking\n            checkGrammarObjectLiteralExpression(node, inDestructuringPattern);\n            var allPropertiesTable = strictNullChecks ? ts.createSymbolTable() : undefined;\n            var propertiesTable = ts.createSymbolTable();\n            var propertiesArray = [];\n            var spread = emptyObjectType;\n            var contextualType = getApparentTypeOfContextualType(node);\n            var contextualTypeHasPattern = contextualType && contextualType.pattern &&\n                (contextualType.pattern.kind === 196 /* ObjectBindingPattern */ || contextualType.pattern.kind === 200 /* ObjectLiteralExpression */);\n            var inConstContext = isConstContext(node);\n            var checkFlags = inConstContext ? 8 /* Readonly */ : 0;\n            var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node);\n            var enumTag = ts.getJSDocEnumTag(node);\n            var isJSObjectLiteral = !contextualType && isInJavascript && !enumTag;\n            var objectFlags = freshObjectLiteralFlag;\n            var patternWithComputedProperties = false;\n            var hasComputedStringProperty = false;\n            var hasComputedNumberProperty = false;\n            // Spreads may cause an early bail; ensure computed names are always checked (this is cached)\n            // As otherwise they may not be checked until exports for the type at this position are retrieved,\n            // which may never occur.\n            for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {\n                var elem = _a[_i];\n                if (elem.name && ts.isComputedPropertyName(elem.name) && !ts.isWellKnownSymbolSyntactically(elem.name)) {\n                    checkComputedPropertyName(elem.name);\n                }\n            }\n            var offset = 0;\n            for (var _b = 0, _c = node.properties; _b < _c.length; _b++) {\n                var memberDecl = _c[_b];\n                var member = getSymbolOfNode(memberDecl);\n                var computedNameType = memberDecl.name && memberDecl.name.kind === 158 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ?\n                    checkComputedPropertyName(memberDecl.name) : undefined;\n                if (memberDecl.kind === 288 /* PropertyAssignment */ ||\n                    memberDecl.kind === 289 /* ShorthandPropertyAssignment */ ||\n                    ts.isObjectLiteralMethod(memberDecl)) {\n                    var type = memberDecl.kind === 288 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) :\n                        // avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring\n                        // for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`.\n                        // we don't want to say \"could not find 'a'\".\n                        memberDecl.kind === 289 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) :\n                            checkObjectLiteralMethod(memberDecl, checkMode);\n                    if (isInJavascript) {\n                        var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);\n                        if (jsDocType) {\n                            checkTypeAssignableTo(type, jsDocType, memberDecl);\n                            type = jsDocType;\n                        }\n                        else if (enumTag && enumTag.typeExpression) {\n                            checkTypeAssignableTo(type, getTypeFromTypeNode(enumTag.typeExpression), memberDecl);\n                        }\n                    }\n                    objectFlags |= ts.getObjectFlags(type) & 3670016 /* PropagatingFlags */;\n                    var nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : undefined;\n                    var prop = nameType ?\n                        createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) :\n                        createSymbol(4 /* Property */ | member.flags, member.escapedName, checkFlags);\n                    if (nameType) {\n                        prop.nameType = nameType;\n                    }\n                    if (inDestructuringPattern) {\n                        // If object literal is an assignment pattern and if the assignment pattern specifies a default value\n                        // for the property, make the property optional.\n                        var isOptional = (memberDecl.kind === 288 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) ||\n                            (memberDecl.kind === 289 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer);\n                        if (isOptional) {\n                            prop.flags |= 16777216 /* Optional */;\n                        }\n                    }\n                    else if (contextualTypeHasPattern && !(ts.getObjectFlags(contextualType) & 512 /* ObjectLiteralPatternWithComputedProperties */)) {\n                        // If object literal is contextually typed by the implied type of a binding pattern, and if the\n                        // binding pattern specifies a default value for the property, make the property optional.\n                        var impliedProp = getPropertyOfType(contextualType, member.escapedName);\n                        if (impliedProp) {\n                            prop.flags |= impliedProp.flags & 16777216 /* Optional */;\n                        }\n                        else if (!compilerOptions.suppressExcessPropertyErrors && !getIndexInfoOfType(contextualType, 0 /* String */)) {\n                            error(memberDecl.name, ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(member), typeToString(contextualType));\n                        }\n                    }\n                    prop.declarations = member.declarations;\n                    prop.parent = member.parent;\n                    if (member.valueDeclaration) {\n                        prop.valueDeclaration = member.valueDeclaration;\n                    }\n                    prop.type = type;\n                    prop.target = member;\n                    member = prop;\n                    allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop);\n                }\n                else if (memberDecl.kind === 290 /* SpreadAssignment */) {\n                    if (languageVersion < 2 /* ES2015 */) {\n                        checkExternalEmitHelpers(memberDecl, 2 /* Assign */);\n                    }\n                    if (propertiesArray.length > 0) {\n                        spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, objectFlags, inConstContext);\n                        propertiesArray = [];\n                        propertiesTable = ts.createSymbolTable();\n                        hasComputedStringProperty = false;\n                        hasComputedNumberProperty = false;\n                    }\n                    var type = getReducedType(checkExpression(memberDecl.expression));\n                    if (!isValidSpreadType(type)) {\n                        error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types);\n                        return errorType;\n                    }\n                    if (allPropertiesTable) {\n                        checkSpreadPropOverrides(type, allPropertiesTable, memberDecl);\n                    }\n                    spread = getSpreadType(spread, type, node.symbol, objectFlags, inConstContext);\n                    offset = propertiesArray.length;\n                    continue;\n                }\n                else {\n                    // TypeScript 1.0 spec (April 2014)\n                    // A get accessor declaration is processed in the same manner as\n                    // an ordinary function declaration(section 6.1) with no parameters.\n                    // A set accessor declaration is processed in the same manner\n                    // as an ordinary function declaration with a single parameter and a Void return type.\n                    ts.Debug.assert(memberDecl.kind === 167 /* GetAccessor */ || memberDecl.kind === 168 /* SetAccessor */);\n                    checkNodeDeferred(memberDecl);\n                }\n                if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) {\n                    if (isTypeAssignableTo(computedNameType, stringNumberSymbolType)) {\n                        if (isTypeAssignableTo(computedNameType, numberType)) {\n                            hasComputedNumberProperty = true;\n                        }\n                        else {\n                            hasComputedStringProperty = true;\n                        }\n                        if (inDestructuringPattern) {\n                            patternWithComputedProperties = true;\n                        }\n                    }\n                }\n                else {\n                    propertiesTable.set(member.escapedName, member);\n                }\n                propertiesArray.push(member);\n            }\n            // If object literal is contextually typed by the implied type of a binding pattern, augment the result\n            // type with those properties for which the binding pattern specifies a default value.\n            // If the object literal is spread into another object literal, skip this step and let the top-level object\n            // literal handle it instead.\n            if (contextualTypeHasPattern && node.parent.kind !== 290 /* SpreadAssignment */) {\n                for (var _d = 0, _e = getPropertiesOfType(contextualType); _d < _e.length; _d++) {\n                    var prop = _e[_d];\n                    if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {\n                        if (!(prop.flags & 16777216 /* Optional */)) {\n                            error(prop.valueDeclaration || prop.bindingElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value);\n                        }\n                        propertiesTable.set(prop.escapedName, prop);\n                        propertiesArray.push(prop);\n                    }\n                }\n            }\n            if (spread !== emptyObjectType) {\n                if (propertiesArray.length > 0) {\n                    spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, objectFlags, inConstContext);\n                    propertiesArray = [];\n                    propertiesTable = ts.createSymbolTable();\n                    hasComputedStringProperty = false;\n                    hasComputedNumberProperty = false;\n                }\n                // remap the raw emptyObjectType fed in at the top into a fresh empty object literal type, unique to this use site\n                return mapType(spread, function (t) { return t === emptyObjectType ? createObjectLiteralType() : t; });\n            }\n            return createObjectLiteralType();\n            function createObjectLiteralType() {\n                var stringIndexInfo = hasComputedStringProperty ? getObjectLiteralIndexInfo(node, offset, propertiesArray, 0 /* String */) : undefined;\n                var numberIndexInfo = hasComputedNumberProperty ? getObjectLiteralIndexInfo(node, offset, propertiesArray, 1 /* Number */) : undefined;\n                var result = createAnonymousType(node.symbol, propertiesTable, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);\n                result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 1048576 /* ContainsObjectOrArrayLiteral */;\n                if (isJSObjectLiteral) {\n                    result.objectFlags |= 16384 /* JSLiteral */;\n                }\n                if (patternWithComputedProperties) {\n                    result.objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */;\n                }\n                if (inDestructuringPattern) {\n                    result.pattern = node;\n                }\n                return result;\n            }\n        }\n        function isValidSpreadType(type) {\n            if (type.flags & 465829888 /* Instantiable */) {\n                var constraint = getBaseConstraintOfType(type);\n                if (constraint !== undefined) {\n                    return isValidSpreadType(constraint);\n                }\n            }\n            return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) ||\n                getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) ||\n                type.flags & 3145728 /* UnionOrIntersection */ && ts.every(type.types, isValidSpreadType));\n        }\n        function checkJsxSelfClosingElementDeferred(node) {\n            checkJsxOpeningLikeElementOrOpeningFragment(node);\n        }\n        function checkJsxSelfClosingElement(node, _checkMode) {\n            checkNodeDeferred(node);\n            return getJsxElementTypeAt(node) || anyType;\n        }\n        function checkJsxElementDeferred(node) {\n            // Check attributes\n            checkJsxOpeningLikeElementOrOpeningFragment(node.openingElement);\n            // Perform resolution on the closing tag so that rename/go to definition/etc work\n            if (isJsxIntrinsicIdentifier(node.closingElement.tagName)) {\n                getIntrinsicTagSymbol(node.closingElement);\n            }\n            else {\n                checkExpression(node.closingElement.tagName);\n            }\n            checkJsxChildren(node);\n        }\n        function checkJsxElement(node, _checkMode) {\n            checkNodeDeferred(node);\n            return getJsxElementTypeAt(node) || anyType;\n        }\n        function checkJsxFragment(node) {\n            checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment);\n            // by default, jsx:'react' will use jsxFactory = React.createElement and jsxFragmentFactory = React.Fragment\n            // if jsxFactory compiler option is provided, ensure jsxFragmentFactory compiler option or @jsxFrag pragma is provided too\n            var nodeSourceFile = ts.getSourceFileOfNode(node);\n            if (ts.getJSXTransformEnabled(compilerOptions) && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has(\"jsx\"))\n                && !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has(\"jsxfrag\")) {\n                error(node, compilerOptions.jsxFactory\n                    ? ts.Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option\n                    : ts.Diagnostics.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments);\n            }\n            checkJsxChildren(node);\n            return getJsxElementTypeAt(node) || anyType;\n        }\n        function isUnhyphenatedJsxName(name) {\n            return !ts.stringContains(name, \"-\");\n        }\n        /**\n         * Returns true iff React would emit this tag name as a string rather than an identifier or qualified name\n         */\n        function isJsxIntrinsicIdentifier(tagName) {\n            return tagName.kind === 78 /* Identifier */ && ts.isIntrinsicJsxName(tagName.escapedText);\n        }\n        function checkJsxAttribute(node, checkMode) {\n            return node.initializer\n                ? checkExpressionForMutableLocation(node.initializer, checkMode)\n                : trueType; // <Elem attr /> is sugar for <Elem attr={true} />\n        }\n        /**\n         * Get attributes type of the JSX opening-like element. The result is from resolving \"attributes\" property of the opening-like element.\n         *\n         * @param openingLikeElement a JSX opening-like element\n         * @param filter a function to remove attributes that will not participate in checking whether attributes are assignable\n         * @return an anonymous type (similar to the one returned by checkObjectLiteral) in which its properties are attributes property.\n         * @remarks Because this function calls getSpreadType, it needs to use the same checks as checkObjectLiteral,\n         * which also calls getSpreadType.\n         */\n        function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {\n            var attributes = openingLikeElement.attributes;\n            var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;\n            var attributesTable = ts.createSymbolTable();\n            var spread = emptyJsxObjectType;\n            var hasSpreadAnyType = false;\n            var typeToIntersect;\n            var explicitlySpecifyChildrenAttribute = false;\n            var objectFlags = 4096 /* JsxAttributes */;\n            var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement));\n            for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) {\n                var attributeDecl = _a[_i];\n                var member = attributeDecl.symbol;\n                if (ts.isJsxAttribute(attributeDecl)) {\n                    var exprType = checkJsxAttribute(attributeDecl, checkMode);\n                    objectFlags |= ts.getObjectFlags(exprType) & 3670016 /* PropagatingFlags */;\n                    var attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName);\n                    attributeSymbol.declarations = member.declarations;\n                    attributeSymbol.parent = member.parent;\n                    if (member.valueDeclaration) {\n                        attributeSymbol.valueDeclaration = member.valueDeclaration;\n                    }\n                    attributeSymbol.type = exprType;\n                    attributeSymbol.target = member;\n                    attributesTable.set(attributeSymbol.escapedName, attributeSymbol);\n                    allAttributesTable === null || allAttributesTable === void 0 ? void 0 : allAttributesTable.set(attributeSymbol.escapedName, attributeSymbol);\n                    if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {\n                        explicitlySpecifyChildrenAttribute = true;\n                    }\n                }\n                else {\n                    ts.Debug.assert(attributeDecl.kind === 282 /* JsxSpreadAttribute */);\n                    if (attributesTable.size > 0) {\n                        spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false);\n                        attributesTable = ts.createSymbolTable();\n                    }\n                    var exprType = getReducedType(checkExpressionCached(attributeDecl.expression, checkMode));\n                    if (isTypeAny(exprType)) {\n                        hasSpreadAnyType = true;\n                    }\n                    if (isValidSpreadType(exprType)) {\n                        spread = getSpreadType(spread, exprType, attributes.symbol, objectFlags, /*readonly*/ false);\n                        if (allAttributesTable) {\n                            checkSpreadPropOverrides(exprType, allAttributesTable, attributeDecl);\n                        }\n                    }\n                    else {\n                        typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType;\n                    }\n                }\n            }\n            if (!hasSpreadAnyType) {\n                if (attributesTable.size > 0) {\n                    spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false);\n                }\n            }\n            // Handle children attribute\n            var parent = openingLikeElement.parent.kind === 273 /* JsxElement */ ? openingLikeElement.parent : undefined;\n            // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement\n            if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) {\n                var childrenTypes = checkJsxChildren(parent, checkMode);\n                if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== \"\") {\n                    // Error if there is a attribute named \"children\" explicitly specified and children element.\n                    // This is because children element will overwrite the value from attributes.\n                    // Note: we will not warn \"children\" attribute overwritten if \"children\" attribute is specified in object spread.\n                    if (explicitlySpecifyChildrenAttribute) {\n                        error(attributes, ts.Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, ts.unescapeLeadingUnderscores(jsxChildrenPropertyName));\n                    }\n                    var contextualType = getApparentTypeOfContextualType(openingLikeElement.attributes);\n                    var childrenContextualType = contextualType && getTypeOfPropertyOfContextualType(contextualType, jsxChildrenPropertyName);\n                    // If there are children in the body of JSX element, create dummy attribute \"children\" with the union of children types so that it will pass the attribute checking process\n                    var childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName);\n                    childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] :\n                        childrenContextualType && forEachType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) :\n                            createArrayType(getUnionType(childrenTypes));\n                    // Fake up a property declaration for the children\n                    childrenPropSymbol.valueDeclaration = ts.factory.createPropertySignature(/*modifiers*/ undefined, ts.unescapeLeadingUnderscores(jsxChildrenPropertyName), /*questionToken*/ undefined, /*type*/ undefined);\n                    ts.setParent(childrenPropSymbol.valueDeclaration, attributes);\n                    childrenPropSymbol.valueDeclaration.symbol = childrenPropSymbol;\n                    var childPropMap = ts.createSymbolTable();\n                    childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol);\n                    spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined), attributes.symbol, objectFlags, /*readonly*/ false);\n                }\n            }\n            if (hasSpreadAnyType) {\n                return anyType;\n            }\n            if (typeToIntersect && spread !== emptyJsxObjectType) {\n                return getIntersectionType([typeToIntersect, spread]);\n            }\n            return typeToIntersect || (spread === emptyJsxObjectType ? createJsxAttributesType() : spread);\n            /**\n             * Create anonymous type from given attributes symbol table.\n             * @param symbol a symbol of JsxAttributes containing attributes corresponding to attributesTable\n             * @param attributesTable a symbol table of attributes property\n             */\n            function createJsxAttributesType() {\n                objectFlags |= freshObjectLiteralFlag;\n                var result = createAnonymousType(attributes.symbol, attributesTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined);\n                result.objectFlags |= objectFlags | 128 /* ObjectLiteral */ | 1048576 /* ContainsObjectOrArrayLiteral */;\n                return result;\n            }\n        }\n        function checkJsxChildren(node, checkMode) {\n            var childrenTypes = [];\n            for (var _i = 0, _a = node.children; _i < _a.length; _i++) {\n                var child = _a[_i];\n                // In React, JSX text that contains only whitespaces will be ignored so we don't want to type-check that\n                // because then type of children property will have constituent of string type.\n                if (child.kind === 11 /* JsxText */) {\n                    if (!child.containsOnlyTriviaWhiteSpaces) {\n                        childrenTypes.push(stringType);\n                    }\n                }\n                else if (child.kind === 283 /* JsxExpression */ && !child.expression) {\n                    continue; // empty jsx expressions don't *really* count as present children\n                }\n                else {\n                    childrenTypes.push(checkExpressionForMutableLocation(child, checkMode));\n                }\n            }\n            return childrenTypes;\n        }\n        function checkSpreadPropOverrides(type, props, spread) {\n            for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) {\n                var right = _a[_i];\n                var left = props.get(right.escapedName);\n                var rightType = getTypeOfSymbol(right);\n                if (left && !maybeTypeOfKind(rightType, 98304 /* Nullable */) && !(maybeTypeOfKind(rightType, 3 /* AnyOrUnknown */) && right.flags & 16777216 /* Optional */)) {\n                    var diagnostic = error(left.valueDeclaration, ts.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, ts.unescapeLeadingUnderscores(left.escapedName));\n                    ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(spread, ts.Diagnostics.This_spread_always_overwrites_this_property));\n                }\n            }\n        }\n        /**\n         * Check attributes property of opening-like element. This function is called during chooseOverload to get call signature of a JSX opening-like element.\n         * (See \"checkApplicableSignatureForJsxOpeningLikeElement\" for how the function is used)\n         * @param node a JSXAttributes to be resolved of its type\n         */\n        function checkJsxAttributes(node, checkMode) {\n            return createJsxAttributesTypeFromAttributesProperty(node.parent, checkMode);\n        }\n        function getJsxType(name, location) {\n            var namespace = getJsxNamespaceAt(location);\n            var exports = namespace && getExportsOfSymbol(namespace);\n            var typeSymbol = exports && getSymbol(exports, name, 788968 /* Type */);\n            return typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : errorType;\n        }\n        /**\n         * Looks up an intrinsic tag name and returns a symbol that either points to an intrinsic\n         * property (in which case nodeLinks.jsxFlags will be IntrinsicNamedElement) or an intrinsic\n         * string index signature (in which case nodeLinks.jsxFlags will be IntrinsicIndexedElement).\n         * May also return unknownSymbol if both of these lookups fail.\n         */\n        function getIntrinsicTagSymbol(node) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedSymbol) {\n                var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, node);\n                if (intrinsicElementsType !== errorType) {\n                    // Property case\n                    if (!ts.isIdentifier(node.tagName))\n                        return ts.Debug.fail();\n                    var intrinsicProp = getPropertyOfType(intrinsicElementsType, node.tagName.escapedText);\n                    if (intrinsicProp) {\n                        links.jsxFlags |= 1 /* IntrinsicNamedElement */;\n                        return links.resolvedSymbol = intrinsicProp;\n                    }\n                    // Intrinsic string indexer case\n                    var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, 0 /* String */);\n                    if (indexSignatureType) {\n                        links.jsxFlags |= 2 /* IntrinsicIndexedElement */;\n                        return links.resolvedSymbol = intrinsicElementsType.symbol;\n                    }\n                    // Wasn't found\n                    error(node, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.idText(node.tagName), \"JSX.\" + JsxNames.IntrinsicElements);\n                    return links.resolvedSymbol = unknownSymbol;\n                }\n                else {\n                    if (noImplicitAny) {\n                        error(node, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, ts.unescapeLeadingUnderscores(JsxNames.IntrinsicElements));\n                    }\n                    return links.resolvedSymbol = unknownSymbol;\n                }\n            }\n            return links.resolvedSymbol;\n        }\n        function getJsxNamespaceContainerForImplicitImport(location) {\n            var file = location && ts.getSourceFileOfNode(location);\n            var links = file && getNodeLinks(file);\n            if (links && links.jsxImplicitImportContainer === false) {\n                return undefined;\n            }\n            if (links && links.jsxImplicitImportContainer) {\n                return links.jsxImplicitImportContainer;\n            }\n            var runtimeImportSpecifier = ts.getJSXRuntimeImport(ts.getJSXImplicitImportBase(compilerOptions, file), compilerOptions);\n            if (!runtimeImportSpecifier) {\n                return undefined;\n            }\n            var isClassic = ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Classic;\n            var errorMessage = isClassic\n                ? ts.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option\n                : ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;\n            var mod = resolveExternalModule(location, runtimeImportSpecifier, errorMessage, location);\n            var result = mod && mod !== unknownSymbol ? getMergedSymbol(resolveSymbol(mod)) : undefined;\n            if (links) {\n                links.jsxImplicitImportContainer = result || false;\n            }\n            return result;\n        }\n        function getJsxNamespaceAt(location) {\n            var links = location && getNodeLinks(location);\n            if (links && links.jsxNamespace) {\n                return links.jsxNamespace;\n            }\n            if (!links || links.jsxNamespace !== false) {\n                var resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location);\n                if (!resolvedNamespace || resolvedNamespace === unknownSymbol) {\n                    var namespaceName = getJsxNamespace(location);\n                    resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false);\n                }\n                if (resolvedNamespace) {\n                    var candidate = resolveSymbol(getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920 /* Namespace */));\n                    if (candidate && candidate !== unknownSymbol) {\n                        if (links) {\n                            links.jsxNamespace = candidate;\n                        }\n                        return candidate;\n                    }\n                }\n                if (links) {\n                    links.jsxNamespace = false;\n                }\n            }\n            // JSX global fallback\n            var s = resolveSymbol(getGlobalSymbol(JsxNames.JSX, 1920 /* Namespace */, /*diagnosticMessage*/ undefined));\n            if (s === unknownSymbol) {\n                return undefined; // TODO: GH#18217\n            }\n            return s; // TODO: GH#18217\n        }\n        /**\n         * Look into JSX namespace and then look for container with matching name as nameOfAttribPropContainer.\n         * Get a single property from that container if existed. Report an error if there are more than one property.\n         *\n         * @param nameOfAttribPropContainer a string of value JsxNames.ElementAttributesPropertyNameContainer or JsxNames.ElementChildrenAttributeNameContainer\n         *          if other string is given or the container doesn't exist, return undefined.\n         */\n        function getNameFromJsxElementAttributesContainer(nameOfAttribPropContainer, jsxNamespace) {\n            // JSX.ElementAttributesProperty | JSX.ElementChildrenAttribute [symbol]\n            var jsxElementAttribPropInterfaceSym = jsxNamespace && getSymbol(jsxNamespace.exports, nameOfAttribPropContainer, 788968 /* Type */);\n            // JSX.ElementAttributesProperty | JSX.ElementChildrenAttribute [type]\n            var jsxElementAttribPropInterfaceType = jsxElementAttribPropInterfaceSym && getDeclaredTypeOfSymbol(jsxElementAttribPropInterfaceSym);\n            // The properties of JSX.ElementAttributesProperty | JSX.ElementChildrenAttribute\n            var propertiesOfJsxElementAttribPropInterface = jsxElementAttribPropInterfaceType && getPropertiesOfType(jsxElementAttribPropInterfaceType);\n            if (propertiesOfJsxElementAttribPropInterface) {\n                // Element Attributes has zero properties, so the element attributes type will be the class instance type\n                if (propertiesOfJsxElementAttribPropInterface.length === 0) {\n                    return \"\";\n                }\n                // Element Attributes has one property, so the element attributes type will be the type of the corresponding\n                // property of the class instance type\n                else if (propertiesOfJsxElementAttribPropInterface.length === 1) {\n                    return propertiesOfJsxElementAttribPropInterface[0].escapedName;\n                }\n                else if (propertiesOfJsxElementAttribPropInterface.length > 1) {\n                    // More than one property on ElementAttributesProperty is an error\n                    error(jsxElementAttribPropInterfaceSym.declarations[0], ts.Diagnostics.The_global_type_JSX_0_may_not_have_more_than_one_property, ts.unescapeLeadingUnderscores(nameOfAttribPropContainer));\n                }\n            }\n            return undefined;\n        }\n        function getJsxLibraryManagedAttributes(jsxNamespace) {\n            // JSX.LibraryManagedAttributes [symbol]\n            return jsxNamespace && getSymbol(jsxNamespace.exports, JsxNames.LibraryManagedAttributes, 788968 /* Type */);\n        }\n        /// e.g. \"props\" for React.d.ts,\n        /// or 'undefined' if ElementAttributesProperty doesn't exist (which means all\n        ///     non-intrinsic elements' attributes type is 'any'),\n        /// or '' if it has 0 properties (which means every\n        ///     non-intrinsic elements' attributes type is the element instance type)\n        function getJsxElementPropertiesName(jsxNamespace) {\n            return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace);\n        }\n        function getJsxElementChildrenPropertyName(jsxNamespace) {\n            return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace);\n        }\n        function getUninstantiatedJsxSignaturesOfType(elementType, caller) {\n            if (elementType.flags & 4 /* String */) {\n                return [anySignature];\n            }\n            else if (elementType.flags & 128 /* StringLiteral */) {\n                var intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(elementType, caller);\n                if (!intrinsicType) {\n                    error(caller, ts.Diagnostics.Property_0_does_not_exist_on_type_1, elementType.value, \"JSX.\" + JsxNames.IntrinsicElements);\n                    return ts.emptyArray;\n                }\n                else {\n                    var fakeSignature = createSignatureForJSXIntrinsic(caller, intrinsicType);\n                    return [fakeSignature];\n                }\n            }\n            var apparentElemType = getApparentType(elementType);\n            // Resolve the signatures, preferring constructor\n            var signatures = getSignaturesOfType(apparentElemType, 1 /* Construct */);\n            if (signatures.length === 0) {\n                // No construct signatures, try call signatures\n                signatures = getSignaturesOfType(apparentElemType, 0 /* Call */);\n            }\n            if (signatures.length === 0 && apparentElemType.flags & 1048576 /* Union */) {\n                // If each member has some combination of new/call signatures; make a union signature list for those\n                signatures = getUnionSignatures(ts.map(apparentElemType.types, function (t) { return getUninstantiatedJsxSignaturesOfType(t, caller); }));\n            }\n            return signatures;\n        }\n        function getIntrinsicAttributesTypeFromStringLiteralType(type, location) {\n            // If the elemType is a stringLiteral type, we can then provide a check to make sure that the string literal type is one of the Jsx intrinsic element type\n            // For example:\n            //      var CustomTag: \"h1\" = \"h1\";\n            //      <CustomTag> Hello World </CustomTag>\n            var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, location);\n            if (intrinsicElementsType !== errorType) {\n                var stringLiteralTypeName = type.value;\n                var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName));\n                if (intrinsicProp) {\n                    return getTypeOfSymbol(intrinsicProp);\n                }\n                var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, 0 /* String */);\n                if (indexSignatureType) {\n                    return indexSignatureType;\n                }\n                return undefined;\n            }\n            // If we need to report an error, we already done so here. So just return any to prevent any more error downstream\n            return anyType;\n        }\n        function checkJsxReturnAssignableToAppropriateBound(refKind, elemInstanceType, openingLikeElement) {\n            if (refKind === 1 /* Function */) {\n                var sfcReturnConstraint = getJsxStatelessElementTypeAt(openingLikeElement);\n                if (sfcReturnConstraint) {\n                    checkTypeRelatedTo(elemInstanceType, sfcReturnConstraint, assignableRelation, openingLikeElement.tagName, ts.Diagnostics.Its_return_type_0_is_not_a_valid_JSX_element, generateInitialErrorChain);\n                }\n            }\n            else if (refKind === 0 /* Component */) {\n                var classConstraint = getJsxElementClassTypeAt(openingLikeElement);\n                if (classConstraint) {\n                    // Issue an error if this return type isn't assignable to JSX.ElementClass, failing that\n                    checkTypeRelatedTo(elemInstanceType, classConstraint, assignableRelation, openingLikeElement.tagName, ts.Diagnostics.Its_instance_type_0_is_not_a_valid_JSX_element, generateInitialErrorChain);\n                }\n            }\n            else { // Mixed\n                var sfcReturnConstraint = getJsxStatelessElementTypeAt(openingLikeElement);\n                var classConstraint = getJsxElementClassTypeAt(openingLikeElement);\n                if (!sfcReturnConstraint || !classConstraint) {\n                    return;\n                }\n                var combined = getUnionType([sfcReturnConstraint, classConstraint]);\n                checkTypeRelatedTo(elemInstanceType, combined, assignableRelation, openingLikeElement.tagName, ts.Diagnostics.Its_element_type_0_is_not_a_valid_JSX_element, generateInitialErrorChain);\n            }\n            function generateInitialErrorChain() {\n                var componentName = ts.getTextOfNode(openingLikeElement.tagName);\n                return ts.chainDiagnosticMessages(/* details */ undefined, ts.Diagnostics._0_cannot_be_used_as_a_JSX_component, componentName);\n            }\n        }\n        /**\n         * Get attributes type of the given intrinsic opening-like Jsx element by resolving the tag name.\n         * The function is intended to be called from a function which has checked that the opening element is an intrinsic element.\n         * @param node an intrinsic JSX opening-like element\n         */\n        function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) {\n            ts.Debug.assert(isJsxIntrinsicIdentifier(node.tagName));\n            var links = getNodeLinks(node);\n            if (!links.resolvedJsxElementAttributesType) {\n                var symbol = getIntrinsicTagSymbol(node);\n                if (links.jsxFlags & 1 /* IntrinsicNamedElement */) {\n                    return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol);\n                }\n                else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) {\n                    return links.resolvedJsxElementAttributesType =\n                        getIndexTypeOfType(getDeclaredTypeOfSymbol(symbol), 0 /* String */);\n                }\n                else {\n                    return links.resolvedJsxElementAttributesType = errorType;\n                }\n            }\n            return links.resolvedJsxElementAttributesType;\n        }\n        function getJsxElementClassTypeAt(location) {\n            var type = getJsxType(JsxNames.ElementClass, location);\n            if (type === errorType)\n                return undefined;\n            return type;\n        }\n        function getJsxElementTypeAt(location) {\n            return getJsxType(JsxNames.Element, location);\n        }\n        function getJsxStatelessElementTypeAt(location) {\n            var jsxElementType = getJsxElementTypeAt(location);\n            if (jsxElementType) {\n                return getUnionType([jsxElementType, nullType]);\n            }\n        }\n        /**\n         * Returns all the properties of the Jsx.IntrinsicElements interface\n         */\n        function getJsxIntrinsicTagNamesAt(location) {\n            var intrinsics = getJsxType(JsxNames.IntrinsicElements, location);\n            return intrinsics ? getPropertiesOfType(intrinsics) : ts.emptyArray;\n        }\n        function checkJsxPreconditions(errorNode) {\n            // Preconditions for using JSX\n            if ((compilerOptions.jsx || 0 /* None */) === 0 /* None */) {\n                error(errorNode, ts.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided);\n            }\n            if (getJsxElementTypeAt(errorNode) === undefined) {\n                if (noImplicitAny) {\n                    error(errorNode, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist);\n                }\n            }\n        }\n        function checkJsxOpeningLikeElementOrOpeningFragment(node) {\n            var isNodeOpeningLikeElement = ts.isJsxOpeningLikeElement(node);\n            if (isNodeOpeningLikeElement) {\n                checkGrammarJsxElement(node);\n            }\n            checkJsxPreconditions(node);\n            if (!getJsxNamespaceContainerForImplicitImport(node)) {\n                // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import.\n                // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error.\n                var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined;\n                var jsxFactoryNamespace = getJsxNamespace(node);\n                var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node;\n                // allow null as jsxFragmentFactory\n                var jsxFactorySym = void 0;\n                if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === \"null\")) {\n                    jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true);\n                }\n                if (jsxFactorySym) {\n                    // Mark local symbol as referenced here because it might not have been marked\n                    // if jsx emit was not jsxFactory as there wont be error being emitted\n                    jsxFactorySym.isReferenced = 67108863 /* All */;\n                    // If react/jsxFactory symbol is alias, mark it as refereced\n                    if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) {\n                        markAliasSymbolAsReferenced(jsxFactorySym);\n                    }\n                }\n            }\n            if (isNodeOpeningLikeElement) {\n                var jsxOpeningLikeNode = node;\n                var sig = getResolvedSignature(jsxOpeningLikeNode);\n                checkDeprecatedSignature(sig, node);\n                checkJsxReturnAssignableToAppropriateBound(getJsxReferenceKind(jsxOpeningLikeNode), getReturnTypeOfSignature(sig), jsxOpeningLikeNode);\n            }\n        }\n        /**\n         * Check if a property with the given name is known anywhere in the given type. In an object type, a property\n         * is considered known if\n         * 1. the object type is empty and the check is for assignability, or\n         * 2. if the object type has index signatures, or\n         * 3. if the property is actually declared in the object type\n         *    (this means that 'toString', for example, is not usually a known property).\n         * 4. In a union or intersection type,\n         *    a property is considered known if it is known in any constituent type.\n         * @param targetType a type to search a given name in\n         * @param name a property name to search\n         * @param isComparingJsxAttributes a boolean flag indicating whether we are searching in JsxAttributesType\n         */\n        function isKnownProperty(targetType, name, isComparingJsxAttributes) {\n            if (targetType.flags & 524288 /* Object */) {\n                var resolved = resolveStructuredTypeMembers(targetType);\n                if (resolved.stringIndexInfo ||\n                    resolved.numberIndexInfo && isNumericLiteralName(name) ||\n                    getPropertyOfObjectType(targetType, name) ||\n                    isComparingJsxAttributes && !isUnhyphenatedJsxName(name)) {\n                    // For JSXAttributes, if the attribute has a hyphenated name, consider that the attribute to be known.\n                    return true;\n                }\n            }\n            else if (targetType.flags & 3145728 /* UnionOrIntersection */ && isExcessPropertyCheckTarget(targetType)) {\n                for (var _i = 0, _a = targetType.types; _i < _a.length; _i++) {\n                    var t = _a[_i];\n                    if (isKnownProperty(t, name, isComparingJsxAttributes)) {\n                        return true;\n                    }\n                }\n            }\n            return false;\n        }\n        function isExcessPropertyCheckTarget(type) {\n            return !!(type.flags & 524288 /* Object */ && !(ts.getObjectFlags(type) & 512 /* ObjectLiteralPatternWithComputedProperties */) ||\n                type.flags & 67108864 /* NonPrimitive */ ||\n                type.flags & 1048576 /* Union */ && ts.some(type.types, isExcessPropertyCheckTarget) ||\n                type.flags & 2097152 /* Intersection */ && ts.every(type.types, isExcessPropertyCheckTarget));\n        }\n        function checkJsxExpression(node, checkMode) {\n            checkGrammarJsxExpression(node);\n            if (node.expression) {\n                var type = checkExpression(node.expression, checkMode);\n                if (node.dotDotDotToken && type !== anyType && !isArrayType(type)) {\n                    error(node, ts.Diagnostics.JSX_spread_child_must_be_an_array_type);\n                }\n                return type;\n            }\n            else {\n                return errorType;\n            }\n        }\n        function getDeclarationNodeFlagsFromSymbol(s) {\n            return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : 0;\n        }\n        /**\n         * Return whether this symbol is a member of a prototype somewhere\n         * Note that this is not tracked well within the compiler, so the answer may be incorrect.\n         */\n        function isPrototypeProperty(symbol) {\n            if (symbol.flags & 8192 /* Method */ || ts.getCheckFlags(symbol) & 4 /* SyntheticMethod */) {\n                return true;\n            }\n            if (ts.isInJSFile(symbol.valueDeclaration)) {\n                var parent = symbol.valueDeclaration.parent;\n                return parent && ts.isBinaryExpression(parent) &&\n                    ts.getAssignmentDeclarationKind(parent) === 3 /* PrototypeProperty */;\n            }\n        }\n        /**\n         * Check whether the requested property access is valid.\n         * Returns true if node is a valid property access, and false otherwise.\n         * @param node The node to be checked.\n         * @param isSuper True if the access is from `super.`.\n         * @param type The type of the object whose property is being accessed. (Not the type of the property.)\n         * @param prop The symbol for the property being accessed.\n         */\n        function checkPropertyAccessibility(node, isSuper, type, prop) {\n            var flags = ts.getDeclarationModifierFlagsFromSymbol(prop);\n            var errorNode = node.kind === 157 /* QualifiedName */ ? node.right : node.kind === 195 /* ImportType */ ? node : node.name;\n            if (isSuper) {\n                // TS 1.0 spec (April 2014): 4.8.2\n                // - In a constructor, instance member function, instance member accessor, or\n                //   instance member variable initializer where this references a derived class instance,\n                //   a super property access is permitted and must specify a public instance member function of the base class.\n                // - In a static member function or static member accessor\n                //   where this references the constructor function object of a derived class,\n                //   a super property access is permitted and must specify a public static member function of the base class.\n                if (languageVersion < 2 /* ES2015 */) {\n                    if (symbolHasNonMethodDeclaration(prop)) {\n                        error(errorNode, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword);\n                        return false;\n                    }\n                }\n                if (flags & 128 /* Abstract */) {\n                    // A method cannot be accessed in a super property access if the method is abstract.\n                    // This error could mask a private property access error. But, a member\n                    // cannot simultaneously be private and abstract, so this will trigger an\n                    // additional error elsewhere.\n                    error(errorNode, ts.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString(prop), typeToString(getDeclaringClass(prop)));\n                    return false;\n                }\n            }\n            // Referencing abstract properties within their own constructors is not allowed\n            if ((flags & 128 /* Abstract */) && ts.isThisProperty(node) && symbolHasNonMethodDeclaration(prop)) {\n                var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));\n                if (declaringClassDeclaration && isNodeUsedDuringClassInitialization(node)) {\n                    error(errorNode, ts.Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor, symbolToString(prop), ts.getTextOfIdentifierOrLiteral(declaringClassDeclaration.name)); // TODO: GH#18217\n                    return false;\n                }\n            }\n            if (ts.isPropertyAccessExpression(node) && ts.isPrivateIdentifier(node.name)) {\n                if (!ts.getContainingClass(node)) {\n                    error(errorNode, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);\n                    return false;\n                }\n                return true;\n            }\n            // Public properties are otherwise accessible.\n            if (!(flags & 24 /* NonPublicAccessibilityModifier */)) {\n                return true;\n            }\n            // Property is known to be private or protected at this point\n            // Private property is accessible if the property is within the declaring class\n            if (flags & 8 /* Private */) {\n                var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));\n                if (!isNodeWithinClass(node, declaringClassDeclaration)) {\n                    error(errorNode, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(getDeclaringClass(prop)));\n                    return false;\n                }\n                return true;\n            }\n            // Property is known to be protected at this point\n            // All protected properties of a supertype are accessible in a super access\n            if (isSuper) {\n                return true;\n            }\n            // Find the first enclosing class that has the declaring classes of the protected constituents\n            // of the property as base classes\n            var enclosingClass = forEachEnclosingClass(node, function (enclosingDeclaration) {\n                var enclosingClass = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingDeclaration));\n                return isClassDerivedFromDeclaringClasses(enclosingClass, prop) ? enclosingClass : undefined;\n            });\n            // A protected property is accessible if the property is within the declaring class or classes derived from it\n            if (!enclosingClass) {\n                // allow PropertyAccessibility if context is in function with this parameter\n                // static member access is disallow\n                var thisParameter = void 0;\n                if (flags & 32 /* Static */ || !(thisParameter = getThisParameterFromNodeContext(node)) || !thisParameter.type) {\n                    error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || type));\n                    return false;\n                }\n                var thisType = getTypeFromTypeNode(thisParameter.type);\n                enclosingClass = ((thisType.flags & 262144 /* TypeParameter */) ? getConstraintOfTypeParameter(thisType) : thisType).target;\n            }\n            // No further restrictions for static properties\n            if (flags & 32 /* Static */) {\n                return true;\n            }\n            if (type.flags & 262144 /* TypeParameter */) {\n                // get the original type -- represented as the type constraint of the 'this' type\n                type = type.isThisType ? getConstraintOfTypeParameter(type) : getBaseConstraintOfType(type); // TODO: GH#18217 Use a different variable that's allowed to be undefined\n            }\n            if (!type || !hasBaseType(type, enclosingClass)) {\n                error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1, symbolToString(prop), typeToString(enclosingClass));\n                return false;\n            }\n            return true;\n        }\n        function getThisParameterFromNodeContext(node) {\n            var thisContainer = ts.getThisContainer(node, /* includeArrowFunctions */ false);\n            return thisContainer && ts.isFunctionLike(thisContainer) ? ts.getThisParameter(thisContainer) : undefined;\n        }\n        function symbolHasNonMethodDeclaration(symbol) {\n            return !!forEachProperty(symbol, function (prop) { return !(prop.flags & 8192 /* Method */); });\n        }\n        function checkNonNullExpression(node) {\n            return checkNonNullType(checkExpression(node), node);\n        }\n        function isNullableType(type) {\n            return !!((strictNullChecks ? getFalsyFlags(type) : type.flags) & 98304 /* Nullable */);\n        }\n        function getNonNullableTypeIfNeeded(type) {\n            return isNullableType(type) ? getNonNullableType(type) : type;\n        }\n        function reportObjectPossiblyNullOrUndefinedError(node, flags) {\n            error(node, flags & 32768 /* Undefined */ ? flags & 65536 /* Null */ ?\n                ts.Diagnostics.Object_is_possibly_null_or_undefined :\n                ts.Diagnostics.Object_is_possibly_undefined :\n                ts.Diagnostics.Object_is_possibly_null);\n        }\n        function reportCannotInvokePossiblyNullOrUndefinedError(node, flags) {\n            error(node, flags & 32768 /* Undefined */ ? flags & 65536 /* Null */ ?\n                ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined :\n                ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined :\n                ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null);\n        }\n        function checkNonNullTypeWithReporter(type, node, reportError) {\n            if (strictNullChecks && type.flags & 2 /* Unknown */) {\n                error(node, ts.Diagnostics.Object_is_of_type_unknown);\n                return errorType;\n            }\n            var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 98304 /* Nullable */;\n            if (kind) {\n                reportError(node, kind);\n                var t = getNonNullableType(type);\n                return t.flags & (98304 /* Nullable */ | 131072 /* Never */) ? errorType : t;\n            }\n            return type;\n        }\n        function checkNonNullType(type, node) {\n            return checkNonNullTypeWithReporter(type, node, reportObjectPossiblyNullOrUndefinedError);\n        }\n        function checkNonNullNonVoidType(type, node) {\n            var nonNullType = checkNonNullType(type, node);\n            if (nonNullType !== errorType && nonNullType.flags & 16384 /* Void */) {\n                error(node, ts.Diagnostics.Object_is_possibly_undefined);\n            }\n            return nonNullType;\n        }\n        function checkPropertyAccessExpression(node) {\n            return node.flags & 32 /* OptionalChain */ ? checkPropertyAccessChain(node) :\n                checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullExpression(node.expression), node.name);\n        }\n        function checkPropertyAccessChain(node) {\n            var leftType = checkExpression(node.expression);\n            var nonOptionalType = getOptionalExpressionType(leftType, node.expression);\n            return propagateOptionalTypeMarker(checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullType(nonOptionalType, node.expression), node.name), node, nonOptionalType !== leftType);\n        }\n        function checkQualifiedName(node) {\n            return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right);\n        }\n        function isMethodAccessForCall(node) {\n            while (node.parent.kind === 207 /* ParenthesizedExpression */) {\n                node = node.parent;\n            }\n            return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node;\n        }\n        // Lookup the private identifier lexically.\n        function lookupSymbolForPrivateIdentifierDeclaration(propName, location) {\n            for (var containingClass = ts.getContainingClass(location); !!containingClass; containingClass = ts.getContainingClass(containingClass)) {\n                var symbol = containingClass.symbol;\n                var name = ts.getSymbolNameForPrivateIdentifier(symbol, propName);\n                var prop = (symbol.members && symbol.members.get(name)) || (symbol.exports && symbol.exports.get(name));\n                if (prop) {\n                    return prop;\n                }\n            }\n        }\n        function getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedIdentifier) {\n            return getPropertyOfType(leftType, lexicallyScopedIdentifier.escapedName);\n        }\n        function checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedIdentifier) {\n            // Either the identifier could not be looked up in the lexical scope OR the lexically scoped identifier did not exist on the type.\n            // Find a private identifier with the same description on the type.\n            var propertyOnType;\n            var properties = getPropertiesOfType(leftType);\n            if (properties) {\n                ts.forEach(properties, function (symbol) {\n                    var decl = symbol.valueDeclaration;\n                    if (decl && ts.isNamedDeclaration(decl) && ts.isPrivateIdentifier(decl.name) && decl.name.escapedText === right.escapedText) {\n                        propertyOnType = symbol;\n                        return true;\n                    }\n                });\n            }\n            var diagName = diagnosticName(right);\n            if (propertyOnType) {\n                var typeValueDecl = propertyOnType.valueDeclaration;\n                var typeClass_1 = ts.getContainingClass(typeValueDecl);\n                ts.Debug.assert(!!typeClass_1);\n                // We found a private identifier property with the same description.\n                // Either:\n                // - There is a lexically scoped private identifier AND it shadows the one we found on the type.\n                // - It is an attempt to access the private identifier outside of the class.\n                if (lexicallyScopedIdentifier) {\n                    var lexicalValueDecl = lexicallyScopedIdentifier.valueDeclaration;\n                    var lexicalClass = ts.getContainingClass(lexicalValueDecl);\n                    ts.Debug.assert(!!lexicalClass);\n                    if (ts.findAncestor(lexicalClass, function (n) { return typeClass_1 === n; })) {\n                        var diagnostic = error(right, ts.Diagnostics.The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling, diagName, typeToString(leftType));\n                        ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(lexicalValueDecl, ts.Diagnostics.The_shadowing_declaration_of_0_is_defined_here, diagName), ts.createDiagnosticForNode(typeValueDecl, ts.Diagnostics.The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here, diagName));\n                        return true;\n                    }\n                }\n                error(right, ts.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier, diagName, diagnosticName(typeClass_1.name || anon));\n                return true;\n            }\n            return false;\n        }\n        function isThisPropertyAccessInConstructor(node, prop) {\n            return (isConstructorDeclaredProperty(prop) || ts.isThisProperty(node) && isAutoTypedProperty(prop))\n                && ts.getThisContainer(node, /*includeArrowFunctions*/ true) === getDeclaringConstructor(prop);\n        }\n        function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right) {\n            var parentSymbol = getNodeLinks(left).resolvedSymbol;\n            var assignmentKind = ts.getAssignmentTargetKind(node);\n            var apparentType = getApparentType(assignmentKind !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(leftType) : leftType);\n            if (ts.isPrivateIdentifier(right)) {\n                checkExternalEmitHelpers(node, 524288 /* ClassPrivateFieldGet */);\n            }\n            var isAnyLike = isTypeAny(apparentType) || apparentType === silentNeverType;\n            var prop;\n            if (ts.isPrivateIdentifier(right)) {\n                var lexicallyScopedSymbol = lookupSymbolForPrivateIdentifierDeclaration(right.escapedText, right);\n                if (isAnyLike) {\n                    if (lexicallyScopedSymbol) {\n                        return apparentType;\n                    }\n                    if (!ts.getContainingClass(right)) {\n                        grammarErrorOnNode(right, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);\n                        return anyType;\n                    }\n                }\n                prop = lexicallyScopedSymbol ? getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedSymbol) : undefined;\n                // Check for private-identifier-specific shadowing and lexical-scoping errors.\n                if (!prop && checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedSymbol)) {\n                    return errorType;\n                }\n            }\n            else {\n                if (isAnyLike) {\n                    if (ts.isIdentifier(left) && parentSymbol) {\n                        markAliasReferenced(parentSymbol, node);\n                    }\n                    return apparentType;\n                }\n                prop = getPropertyOfType(apparentType, right.escapedText);\n            }\n            // In `Foo.Bar.Baz`, 'Foo' is not referenced if 'Bar' is a const enum or a module containing only const enums.\n            // The exceptions are:\n            //   1. if 'isolatedModules' is enabled, because the const enum value will not be inlined, and\n            //   2. if 'preserveConstEnums' is enabled and the expression is itself an export, e.g. `export = Foo.Bar.Baz`.\n            if (ts.isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules || !(prop && isConstEnumOrConstEnumOnlyModule(prop)) || ts.shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) {\n                markAliasReferenced(parentSymbol, node);\n            }\n            var propType;\n            if (!prop) {\n                var indexInfo = !ts.isPrivateIdentifier(right) && (assignmentKind === 0 /* None */ || !isGenericObjectType(leftType) || isThisTypeParameter(leftType)) ? getIndexInfoOfType(apparentType, 0 /* String */) : undefined;\n                if (!(indexInfo && indexInfo.type)) {\n                    if (isJSLiteralType(leftType)) {\n                        return anyType;\n                    }\n                    if (leftType.symbol === globalThisSymbol) {\n                        if (globalThisSymbol.exports.has(right.escapedText) && (globalThisSymbol.exports.get(right.escapedText).flags & 418 /* BlockScoped */)) {\n                            error(right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(right.escapedText), typeToString(leftType));\n                        }\n                        else if (noImplicitAny) {\n                            error(right, ts.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature, typeToString(leftType));\n                        }\n                        return anyType;\n                    }\n                    if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) {\n                        reportNonexistentProperty(right, isThisTypeParameter(leftType) ? apparentType : leftType);\n                    }\n                    return errorType;\n                }\n                if (indexInfo.isReadonly && (ts.isAssignmentTarget(node) || ts.isDeleteTarget(node))) {\n                    error(node, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType));\n                }\n                propType = (compilerOptions.noUncheckedIndexedAccess && !ts.isAssignmentTarget(node)) ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;\n                if (compilerOptions.noPropertyAccessFromIndexSignature && ts.isPropertyAccessExpression(node)) {\n                    error(right, ts.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, ts.unescapeLeadingUnderscores(right.escapedText));\n                }\n            }\n            else {\n                if (getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, prop)) {\n                    addDeprecatedSuggestion(right, prop.declarations, right.escapedText);\n                }\n                checkPropertyNotUsedBeforeDeclaration(prop, node, right);\n                markPropertyAsReferenced(prop, node, left.kind === 107 /* ThisKeyword */);\n                getNodeLinks(node).resolvedSymbol = prop;\n                checkPropertyAccessibility(node, left.kind === 105 /* SuperKeyword */, apparentType, prop);\n                if (isAssignmentToReadonlyEntity(node, prop, assignmentKind)) {\n                    error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts.idText(right));\n                    return errorType;\n                }\n                propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : getConstraintForLocation(getTypeOfSymbol(prop), node);\n            }\n            return getFlowTypeOfAccessExpression(node, prop, propType, right);\n        }\n        function getFlowTypeOfAccessExpression(node, prop, propType, errorNode) {\n            // Only compute control flow type if this is a property access expression that isn't an\n            // assignment target, and the referenced property was declared as a variable, property,\n            // accessor, or optional method.\n            var assignmentKind = ts.getAssignmentTargetKind(node);\n            if (assignmentKind === 1 /* Definite */ ||\n                prop && !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 1048576 /* Union */)) {\n                return propType;\n            }\n            if (propType === autoType) {\n                return getFlowTypeOfProperty(node, prop);\n            }\n            // If strict null checks and strict property initialization checks are enabled, if we have\n            // a this.xxx property access, if the property is an instance property without an initializer,\n            // and if we are in a constructor of the same class as the property declaration, assume that\n            // the property is uninitialized at the top of the control flow.\n            var assumeUninitialized = false;\n            if (strictNullChecks && strictPropertyInitialization && ts.isAccessExpression(node) && node.expression.kind === 107 /* ThisKeyword */) {\n                var declaration = prop && prop.valueDeclaration;\n                if (declaration && isInstancePropertyWithoutInitializer(declaration)) {\n                    var flowContainer = getControlFlowContainer(node);\n                    if (flowContainer.kind === 166 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) {\n                        assumeUninitialized = true;\n                    }\n                }\n            }\n            else if (strictNullChecks && prop && prop.valueDeclaration &&\n                ts.isPropertyAccessExpression(prop.valueDeclaration) &&\n                ts.getAssignmentDeclarationPropertyAccessKind(prop.valueDeclaration) &&\n                getControlFlowContainer(node) === getControlFlowContainer(prop.valueDeclaration)) {\n                assumeUninitialized = true;\n            }\n            var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);\n            if (assumeUninitialized && !(getFalsyFlags(propType) & 32768 /* Undefined */) && getFalsyFlags(flowType) & 32768 /* Undefined */) {\n                error(errorNode, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217\n                // Return the declared type to reduce follow-on errors\n                return propType;\n            }\n            return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType;\n        }\n        function checkPropertyNotUsedBeforeDeclaration(prop, node, right) {\n            var valueDeclaration = prop.valueDeclaration;\n            if (!valueDeclaration || ts.getSourceFileOfNode(node).isDeclarationFile) {\n                return;\n            }\n            var diagnosticMessage;\n            var declarationName = ts.idText(right);\n            if (isInPropertyInitializer(node)\n                && !(ts.isAccessExpression(node) && ts.isAccessExpression(node.expression))\n                && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)\n                && !isPropertyDeclaredInAncestorClass(prop)) {\n                diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName);\n            }\n            else if (valueDeclaration.kind === 252 /* ClassDeclaration */ &&\n                node.parent.kind !== 173 /* TypeReference */ &&\n                !(valueDeclaration.flags & 8388608 /* Ambient */) &&\n                !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {\n                diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName);\n            }\n            if (diagnosticMessage) {\n                ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(valueDeclaration, ts.Diagnostics._0_is_declared_here, declarationName));\n            }\n        }\n        function isInPropertyInitializer(node) {\n            return !!ts.findAncestor(node, function (node) {\n                switch (node.kind) {\n                    case 163 /* PropertyDeclaration */:\n                        return true;\n                    case 288 /* PropertyAssignment */:\n                    case 165 /* MethodDeclaration */:\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                    case 290 /* SpreadAssignment */:\n                    case 158 /* ComputedPropertyName */:\n                    case 228 /* TemplateSpan */:\n                    case 283 /* JsxExpression */:\n                    case 280 /* JsxAttribute */:\n                    case 281 /* JsxAttributes */:\n                    case 282 /* JsxSpreadAttribute */:\n                    case 275 /* JsxOpeningElement */:\n                    case 223 /* ExpressionWithTypeArguments */:\n                    case 286 /* HeritageClause */:\n                        return false;\n                    default:\n                        return ts.isExpressionNode(node) ? false : \"quit\";\n                }\n            });\n        }\n        /**\n         * It's possible that \"prop.valueDeclaration\" is a local declaration, but the property was also declared in a superclass.\n         * In that case we won't consider it used before its declaration, because it gets its value from the superclass' declaration.\n         */\n        function isPropertyDeclaredInAncestorClass(prop) {\n            if (!(prop.parent.flags & 32 /* Class */)) {\n                return false;\n            }\n            var classType = getTypeOfSymbol(prop.parent);\n            while (true) {\n                classType = classType.symbol && getSuperClass(classType);\n                if (!classType) {\n                    return false;\n                }\n                var superProperty = getPropertyOfType(classType, prop.escapedName);\n                if (superProperty && superProperty.valueDeclaration) {\n                    return true;\n                }\n            }\n        }\n        function getSuperClass(classType) {\n            var x = getBaseTypes(classType);\n            if (x.length === 0) {\n                return undefined;\n            }\n            return getIntersectionType(x);\n        }\n        function reportNonexistentProperty(propNode, containingType) {\n            var errorInfo;\n            var relatedInfo;\n            if (!ts.isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 131068 /* Primitive */)) {\n                for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) {\n                    var subtype = _a[_i];\n                    if (!getPropertyOfType(subtype, propNode.escapedText) && !getIndexInfoOfType(subtype, 0 /* String */)) {\n                        errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.declarationNameToString(propNode), typeToString(subtype));\n                        break;\n                    }\n                }\n            }\n            if (typeHasStaticProperty(propNode.escapedText, containingType)) {\n                var propName = ts.declarationNameToString(propNode);\n                var typeName = typeToString(containingType);\n                errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead, propName, typeName, typeName + \".\" + propName);\n            }\n            else {\n                var promisedType = getPromisedTypeOfPromise(containingType);\n                if (promisedType && getPropertyOfType(promisedType, propNode.escapedText)) {\n                    errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.declarationNameToString(propNode), typeToString(containingType));\n                    relatedInfo = ts.createDiagnosticForNode(propNode, ts.Diagnostics.Did_you_forget_to_use_await);\n                }\n                else {\n                    var missingProperty = ts.declarationNameToString(propNode);\n                    var container = typeToString(containingType);\n                    var libSuggestion = getSuggestedLibForNonExistentProperty(missingProperty, containingType);\n                    if (libSuggestion !== undefined) {\n                        errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later, missingProperty, container, libSuggestion);\n                    }\n                    else {\n                        var suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType);\n                        if (suggestion !== undefined) {\n                            var suggestedName = ts.symbolName(suggestion);\n                            errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, missingProperty, container, suggestedName);\n                            relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestedName);\n                        }\n                        else {\n                            errorInfo = ts.chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), ts.Diagnostics.Property_0_does_not_exist_on_type_1, missingProperty, container);\n                        }\n                    }\n                }\n            }\n            var resultDiagnostic = ts.createDiagnosticForNodeFromMessageChain(propNode, errorInfo);\n            if (relatedInfo) {\n                ts.addRelatedInfo(resultDiagnostic, relatedInfo);\n            }\n            diagnostics.add(resultDiagnostic);\n        }\n        function typeHasStaticProperty(propName, containingType) {\n            var prop = containingType.symbol && getPropertyOfType(getTypeOfSymbol(containingType.symbol), propName);\n            return prop !== undefined && prop.valueDeclaration && ts.hasSyntacticModifier(prop.valueDeclaration, 32 /* Static */);\n        }\n        function getSuggestedLibForNonExistentName(name) {\n            var missingName = diagnosticName(name);\n            var allFeatures = ts.getScriptTargetFeatures();\n            var libTargets = ts.getOwnKeys(allFeatures);\n            for (var _i = 0, libTargets_1 = libTargets; _i < libTargets_1.length; _i++) {\n                var libTarget = libTargets_1[_i];\n                var containingTypes = ts.getOwnKeys(allFeatures[libTarget]);\n                if (containingTypes !== undefined && ts.contains(containingTypes, missingName)) {\n                    return libTarget;\n                }\n            }\n        }\n        function getSuggestedLibForNonExistentProperty(missingProperty, containingType) {\n            var container = getApparentType(containingType).symbol;\n            if (!container) {\n                return undefined;\n            }\n            var allFeatures = ts.getScriptTargetFeatures();\n            var libTargets = ts.getOwnKeys(allFeatures);\n            for (var _i = 0, libTargets_2 = libTargets; _i < libTargets_2.length; _i++) {\n                var libTarget = libTargets_2[_i];\n                var featuresOfLib = allFeatures[libTarget];\n                var featuresOfContainingType = featuresOfLib[ts.symbolName(container)];\n                if (featuresOfContainingType !== undefined && ts.contains(featuresOfContainingType, missingProperty)) {\n                    return libTarget;\n                }\n            }\n        }\n        function getSuggestedSymbolForNonexistentProperty(name, containingType) {\n            return getSpellingSuggestionForName(ts.isString(name) ? name : ts.idText(name), getPropertiesOfType(containingType), 111551 /* Value */);\n        }\n        function getSuggestedSymbolForNonexistentJSXAttribute(name, containingType) {\n            var strName = ts.isString(name) ? name : ts.idText(name);\n            var properties = getPropertiesOfType(containingType);\n            var jsxSpecific = strName === \"for\" ? ts.find(properties, function (x) { return ts.symbolName(x) === \"htmlFor\"; })\n                : strName === \"class\" ? ts.find(properties, function (x) { return ts.symbolName(x) === \"className\"; })\n                    : undefined;\n            return jsxSpecific !== null && jsxSpecific !== void 0 ? jsxSpecific : getSpellingSuggestionForName(strName, properties, 111551 /* Value */);\n        }\n        function getSuggestionForNonexistentProperty(name, containingType) {\n            var suggestion = getSuggestedSymbolForNonexistentProperty(name, containingType);\n            return suggestion && ts.symbolName(suggestion);\n        }\n        function getSuggestedSymbolForNonexistentSymbol(location, outerName, meaning) {\n            ts.Debug.assert(outerName !== undefined, \"outername should always be defined\");\n            var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, function (symbols, name, meaning) {\n                ts.Debug.assertEqual(outerName, name, \"name should equal outerName\");\n                var symbol = getSymbol(symbols, name, meaning);\n                // Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function\n                // So the table *contains* `x` but `x` isn't actually in scope.\n                // However, resolveNameHelper will continue and call this callback again, so we'll eventually get a correct suggestion.\n                return symbol || getSpellingSuggestionForName(ts.unescapeLeadingUnderscores(name), ts.arrayFrom(symbols.values()), meaning);\n            });\n            return result;\n        }\n        function getSuggestionForNonexistentSymbol(location, outerName, meaning) {\n            var symbolResult = getSuggestedSymbolForNonexistentSymbol(location, outerName, meaning);\n            return symbolResult && ts.symbolName(symbolResult);\n        }\n        function getSuggestedSymbolForNonexistentModule(name, targetModule) {\n            return targetModule.exports && getSpellingSuggestionForName(ts.idText(name), getExportsOfModuleAsArray(targetModule), 2623475 /* ModuleMember */);\n        }\n        function getSuggestionForNonexistentExport(name, targetModule) {\n            var suggestion = getSuggestedSymbolForNonexistentModule(name, targetModule);\n            return suggestion && ts.symbolName(suggestion);\n        }\n        function getSuggestionForNonexistentIndexSignature(objectType, expr, keyedType) {\n            // check if object type has setter or getter\n            function hasProp(name) {\n                var prop = getPropertyOfObjectType(objectType, name);\n                if (prop) {\n                    var s = getSingleCallSignature(getTypeOfSymbol(prop));\n                    return !!s && getMinArgumentCount(s) >= 1 && isTypeAssignableTo(keyedType, getTypeAtPosition(s, 0));\n                }\n                return false;\n            }\n            ;\n            var suggestedMethod = ts.isAssignmentTarget(expr) ? \"set\" : \"get\";\n            if (!hasProp(suggestedMethod)) {\n                return undefined;\n            }\n            var suggestion = ts.tryGetPropertyAccessOrIdentifierToString(expr.expression);\n            if (suggestion === undefined) {\n                suggestion = suggestedMethod;\n            }\n            else {\n                suggestion += \".\" + suggestedMethod;\n            }\n            return suggestion;\n        }\n        /**\n         * Given a name and a list of symbols whose names are *not* equal to the name, return a spelling suggestion if there is one that is close enough.\n         * Names less than length 3 only check for case-insensitive equality, not levenshtein distance.\n         *\n         * If there is a candidate that's the same except for case, return that.\n         * If there is a candidate that's within one edit of the name, return that.\n         * Otherwise, return the candidate with the smallest Levenshtein distance,\n         *    except for candidates:\n         *      * With no name\n         *      * Whose meaning doesn't match the `meaning` parameter.\n         *      * Whose length differs from the target name by more than 0.34 of the length of the name.\n         *      * Whose levenshtein distance is more than 0.4 of the length of the name\n         *        (0.4 allows 1 substitution/transposition for every 5 characters,\n         *         and 1 insertion/deletion at 3 characters)\n         */\n        function getSpellingSuggestionForName(name, symbols, meaning) {\n            return ts.getSpellingSuggestion(name, symbols, getCandidateName);\n            function getCandidateName(candidate) {\n                var candidateName = ts.symbolName(candidate);\n                if (ts.startsWith(candidateName, \"\\\"\")) {\n                    return undefined;\n                }\n                if (candidate.flags & meaning) {\n                    return candidateName;\n                }\n                if (candidate.flags & 2097152 /* Alias */) {\n                    var alias = tryResolveAlias(candidate);\n                    if (alias && alias.flags & meaning) {\n                        return candidateName;\n                    }\n                }\n                return undefined;\n            }\n        }\n        function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) {\n            var valueDeclaration = prop && (prop.flags & 106500 /* ClassMember */) && prop.valueDeclaration;\n            if (!valueDeclaration) {\n                return;\n            }\n            var hasPrivateModifier = ts.hasEffectiveModifier(valueDeclaration, 8 /* Private */);\n            var hasPrivateIdentifier = ts.isNamedDeclaration(prop.valueDeclaration) && ts.isPrivateIdentifier(prop.valueDeclaration.name);\n            if (!hasPrivateModifier && !hasPrivateIdentifier) {\n                return;\n            }\n            if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */)) {\n                return;\n            }\n            if (isThisAccess) {\n                // Find any FunctionLikeDeclaration because those create a new 'this' binding. But this should only matter for methods (or getters/setters).\n                var containingMethod = ts.findAncestor(nodeForCheckWriteOnly, ts.isFunctionLikeDeclaration);\n                if (containingMethod && containingMethod.symbol === prop) {\n                    return;\n                }\n            }\n            (ts.getCheckFlags(prop) & 1 /* Instantiated */ ? getSymbolLinks(prop).target : prop).isReferenced = 67108863 /* All */;\n        }\n        function isValidPropertyAccess(node, propertyName) {\n            switch (node.kind) {\n                case 201 /* PropertyAccessExpression */:\n                    return isValidPropertyAccessWithType(node, node.expression.kind === 105 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression)));\n                case 157 /* QualifiedName */:\n                    return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left)));\n                case 195 /* ImportType */:\n                    return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node));\n            }\n        }\n        function isValidPropertyAccessForCompletions(node, type, property) {\n            return isValidPropertyAccessWithType(node, node.kind === 201 /* PropertyAccessExpression */ && node.expression.kind === 105 /* SuperKeyword */, property.escapedName, type);\n            // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context.\n        }\n        function isValidPropertyAccessWithType(node, isSuper, propertyName, type) {\n            if (type === errorType || isTypeAny(type)) {\n                return true;\n            }\n            var prop = getPropertyOfType(type, propertyName);\n            if (prop) {\n                if (ts.isPropertyAccessExpression(node) && prop.valueDeclaration && ts.isPrivateIdentifierPropertyDeclaration(prop.valueDeclaration)) {\n                    var declClass_1 = ts.getContainingClass(prop.valueDeclaration);\n                    return !ts.isOptionalChain(node) && !!ts.findAncestor(node, function (parent) { return parent === declClass_1; });\n                }\n                return checkPropertyAccessibility(node, isSuper, type, prop);\n            }\n            // In js files properties of unions are allowed in completion\n            return ts.isInJSFile(node) && (type.flags & 1048576 /* Union */) !== 0 && type.types.some(function (elementType) { return isValidPropertyAccessWithType(node, isSuper, propertyName, elementType); });\n        }\n        /**\n         * Return the symbol of the for-in variable declared or referenced by the given for-in statement.\n         */\n        function getForInVariableSymbol(node) {\n            var initializer = node.initializer;\n            if (initializer.kind === 250 /* VariableDeclarationList */) {\n                var variable = initializer.declarations[0];\n                if (variable && !ts.isBindingPattern(variable.name)) {\n                    return getSymbolOfNode(variable);\n                }\n            }\n            else if (initializer.kind === 78 /* Identifier */) {\n                return getResolvedSymbol(initializer);\n            }\n            return undefined;\n        }\n        /**\n         * Return true if the given type is considered to have numeric property names.\n         */\n        function hasNumericPropertyNames(type) {\n            return getIndexTypeOfType(type, 1 /* Number */) && !getIndexTypeOfType(type, 0 /* String */);\n        }\n        /**\n         * Return true if given node is an expression consisting of an identifier (possibly parenthesized)\n         * that references a for-in variable for an object with numeric property names.\n         */\n        function isForInVariableForNumericPropertyNames(expr) {\n            var e = ts.skipParentheses(expr);\n            if (e.kind === 78 /* Identifier */) {\n                var symbol = getResolvedSymbol(e);\n                if (symbol.flags & 3 /* Variable */) {\n                    var child = expr;\n                    var node = expr.parent;\n                    while (node) {\n                        if (node.kind === 238 /* ForInStatement */ &&\n                            child === node.statement &&\n                            getForInVariableSymbol(node) === symbol &&\n                            hasNumericPropertyNames(getTypeOfExpression(node.expression))) {\n                            return true;\n                        }\n                        child = node;\n                        node = node.parent;\n                    }\n                }\n            }\n            return false;\n        }\n        function checkIndexedAccess(node) {\n            return node.flags & 32 /* OptionalChain */ ? checkElementAccessChain(node) :\n                checkElementAccessExpression(node, checkNonNullExpression(node.expression));\n        }\n        function checkElementAccessChain(node) {\n            var exprType = checkExpression(node.expression);\n            var nonOptionalType = getOptionalExpressionType(exprType, node.expression);\n            return propagateOptionalTypeMarker(checkElementAccessExpression(node, checkNonNullType(nonOptionalType, node.expression)), node, nonOptionalType !== exprType);\n        }\n        function checkElementAccessExpression(node, exprType) {\n            var objectType = ts.getAssignmentTargetKind(node) !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(exprType) : exprType;\n            var indexExpression = node.argumentExpression;\n            var indexType = checkExpression(indexExpression);\n            if (objectType === errorType || objectType === silentNeverType) {\n                return objectType;\n            }\n            if (isConstEnumObjectType(objectType) && !ts.isStringLiteralLike(indexExpression)) {\n                error(indexExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal);\n                return errorType;\n            }\n            var effectiveIndexType = isForInVariableForNumericPropertyNames(indexExpression) ? numberType : indexType;\n            var accessFlags = ts.isAssignmentTarget(node) ?\n                2 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 1 /* NoIndexSignatures */ : 0) :\n                0 /* None */;\n            var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, /*noUncheckedIndexedAccessCandidate*/ undefined, node, accessFlags | 16 /* ExpressionPosition */) || errorType;\n            return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, indexedAccessType.symbol, indexedAccessType, indexExpression), node);\n        }\n        function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) {\n            if (expressionType === errorType) {\n                // There is already an error, so no need to report one.\n                return false;\n            }\n            if (!ts.isWellKnownSymbolSyntactically(expression)) {\n                return false;\n            }\n            // Make sure the property type is the primitive symbol type\n            if ((expressionType.flags & 12288 /* ESSymbolLike */) === 0) {\n                if (reportError) {\n                    error(expression, ts.Diagnostics.A_computed_property_name_of_the_form_0_must_be_of_type_symbol, ts.getTextOfNode(expression));\n                }\n                return false;\n            }\n            // The name is Symbol.<someName>, so make sure Symbol actually resolves to the\n            // global Symbol object\n            var leftHandSide = expression.expression;\n            var leftHandSideSymbol = getResolvedSymbol(leftHandSide);\n            if (!leftHandSideSymbol) {\n                return false;\n            }\n            var globalESSymbol = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ true);\n            if (!globalESSymbol) {\n                // Already errored when we tried to look up the symbol\n                return false;\n            }\n            if (leftHandSideSymbol !== globalESSymbol) {\n                if (reportError) {\n                    error(leftHandSide, ts.Diagnostics.Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object);\n                }\n                return false;\n            }\n            return true;\n        }\n        function callLikeExpressionMayHaveTypeArguments(node) {\n            return ts.isCallOrNewExpression(node) || ts.isTaggedTemplateExpression(node) || ts.isJsxOpeningLikeElement(node);\n        }\n        function resolveUntypedCall(node) {\n            if (callLikeExpressionMayHaveTypeArguments(node)) {\n                // Check type arguments even though we will give an error that untyped calls may not accept type arguments.\n                // This gets us diagnostics for the type arguments and marks them as referenced.\n                ts.forEach(node.typeArguments, checkSourceElement);\n            }\n            if (node.kind === 205 /* TaggedTemplateExpression */) {\n                checkExpression(node.template);\n            }\n            else if (ts.isJsxOpeningLikeElement(node)) {\n                checkExpression(node.attributes);\n            }\n            else if (node.kind !== 161 /* Decorator */) {\n                ts.forEach(node.arguments, function (argument) {\n                    checkExpression(argument);\n                });\n            }\n            return anySignature;\n        }\n        function resolveErrorCall(node) {\n            resolveUntypedCall(node);\n            return unknownSignature;\n        }\n        // Re-order candidate signatures into the result array. Assumes the result array to be empty.\n        // The candidate list orders groups in reverse, but within a group signatures are kept in declaration order\n        // A nit here is that we reorder only signatures that belong to the same symbol,\n        // so order how inherited signatures are processed is still preserved.\n        // interface A { (x: string): void }\n        // interface B extends A { (x: 'foo'): string }\n        // const b: B;\n        // b('foo') // <- here overloads should be processed as [(x:'foo'): string, (x: string): void]\n        function reorderCandidates(signatures, result, callChainFlags) {\n            var lastParent;\n            var lastSymbol;\n            var cutoffIndex = 0;\n            var index;\n            var specializedIndex = -1;\n            var spliceIndex;\n            ts.Debug.assert(!result.length);\n            for (var _i = 0, signatures_7 = signatures; _i < signatures_7.length; _i++) {\n                var signature = signatures_7[_i];\n                var symbol = signature.declaration && getSymbolOfNode(signature.declaration);\n                var parent = signature.declaration && signature.declaration.parent;\n                if (!lastSymbol || symbol === lastSymbol) {\n                    if (lastParent && parent === lastParent) {\n                        index = index + 1;\n                    }\n                    else {\n                        lastParent = parent;\n                        index = cutoffIndex;\n                    }\n                }\n                else {\n                    // current declaration belongs to a different symbol\n                    // set cutoffIndex so re-orderings in the future won't change result set from 0 to cutoffIndex\n                    index = cutoffIndex = result.length;\n                    lastParent = parent;\n                }\n                lastSymbol = symbol;\n                // specialized signatures always need to be placed before non-specialized signatures regardless\n                // of the cutoff position; see GH#1133\n                if (signatureHasLiteralTypes(signature)) {\n                    specializedIndex++;\n                    spliceIndex = specializedIndex;\n                    // The cutoff index always needs to be greater than or equal to the specialized signature index\n                    // in order to prevent non-specialized signatures from being added before a specialized\n                    // signature.\n                    cutoffIndex++;\n                }\n                else {\n                    spliceIndex = index;\n                }\n                result.splice(spliceIndex, 0, callChainFlags ? getOptionalCallSignature(signature, callChainFlags) : signature);\n            }\n        }\n        function isSpreadArgument(arg) {\n            return !!arg && (arg.kind === 220 /* SpreadElement */ || arg.kind === 227 /* SyntheticExpression */ && arg.isSpread);\n        }\n        function getSpreadArgumentIndex(args) {\n            return ts.findIndex(args, isSpreadArgument);\n        }\n        function acceptsVoid(t) {\n            return !!(t.flags & 16384 /* Void */);\n        }\n        function acceptsVoidUndefinedUnknownOrAny(t) {\n            return !!(t.flags & (16384 /* Void */ | 32768 /* Undefined */ | 2 /* Unknown */ | 1 /* Any */));\n        }\n        function hasCorrectArity(node, args, signature, signatureHelpTrailingComma) {\n            if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; }\n            var argCount;\n            var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments\n            var effectiveParameterCount = getParameterCount(signature);\n            var effectiveMinimumArguments = getMinArgumentCount(signature);\n            if (node.kind === 205 /* TaggedTemplateExpression */) {\n                argCount = args.length;\n                if (node.template.kind === 218 /* TemplateExpression */) {\n                    // If a tagged template expression lacks a tail literal, the call is incomplete.\n                    // Specifically, a template only can end in a TemplateTail or a Missing literal.\n                    var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span.\n                    callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated;\n                }\n                else {\n                    // If the template didn't end in a backtick, or its beginning occurred right prior to EOF,\n                    // then this might actually turn out to be a TemplateHead in the future;\n                    // so we consider the call to be incomplete.\n                    var templateLiteral = node.template;\n                    ts.Debug.assert(templateLiteral.kind === 14 /* NoSubstitutionTemplateLiteral */);\n                    callIsIncomplete = !!templateLiteral.isUnterminated;\n                }\n            }\n            else if (node.kind === 161 /* Decorator */) {\n                argCount = getDecoratorArgumentCount(node, signature);\n            }\n            else if (ts.isJsxOpeningLikeElement(node)) {\n                callIsIncomplete = node.attributes.end === node.end;\n                if (callIsIncomplete) {\n                    return true;\n                }\n                argCount = effectiveMinimumArguments === 0 ? args.length : 1;\n                effectiveParameterCount = args.length === 0 ? effectiveParameterCount : 1; // class may have argumentless ctor functions - still resolve ctor and compare vs props member type\n                effectiveMinimumArguments = Math.min(effectiveMinimumArguments, 1); // sfc may specify context argument - handled by framework and not typechecked\n            }\n            else if (!node.arguments) {\n                // This only happens when we have something of the form: 'new C'\n                ts.Debug.assert(node.kind === 204 /* NewExpression */);\n                return getMinArgumentCount(signature) === 0;\n            }\n            else {\n                argCount = signatureHelpTrailingComma ? args.length + 1 : args.length;\n                // If we are missing the close parenthesis, the call is incomplete.\n                callIsIncomplete = node.arguments.end === node.end;\n                // If a spread argument is present, check that it corresponds to a rest parameter or at least that it's in the valid range.\n                var spreadArgIndex = getSpreadArgumentIndex(args);\n                if (spreadArgIndex >= 0) {\n                    return spreadArgIndex >= getMinArgumentCount(signature) && (hasEffectiveRestParameter(signature) || spreadArgIndex < getParameterCount(signature));\n                }\n            }\n            // Too many arguments implies incorrect arity.\n            if (!hasEffectiveRestParameter(signature) && argCount > effectiveParameterCount) {\n                return false;\n            }\n            // If the call is incomplete, we should skip the lower bound check.\n            // JSX signatures can have extra parameters provided by the library which we don't check\n            if (callIsIncomplete || argCount >= effectiveMinimumArguments) {\n                return true;\n            }\n            for (var i = argCount; i < effectiveMinimumArguments; i++) {\n                var type = getTypeAtPosition(signature, i);\n                if (filterType(type, ts.isInJSFile(node) && !strictNullChecks ? acceptsVoidUndefinedUnknownOrAny : acceptsVoid).flags & 131072 /* Never */) {\n                    return false;\n                }\n            }\n            return true;\n        }\n        function hasCorrectTypeArgumentArity(signature, typeArguments) {\n            // If the user supplied type arguments, but the number of type arguments does not match\n            // the declared number of type parameters, the call has an incorrect arity.\n            var numTypeParameters = ts.length(signature.typeParameters);\n            var minTypeArgumentCount = getMinTypeArgumentCount(signature.typeParameters);\n            return !ts.some(typeArguments) ||\n                (typeArguments.length >= minTypeArgumentCount && typeArguments.length <= numTypeParameters);\n        }\n        // If type has a single call signature and no other members, return that signature. Otherwise, return undefined.\n        function getSingleCallSignature(type) {\n            return getSingleSignature(type, 0 /* Call */, /*allowMembers*/ false);\n        }\n        function getSingleCallOrConstructSignature(type) {\n            return getSingleSignature(type, 0 /* Call */, /*allowMembers*/ false) ||\n                getSingleSignature(type, 1 /* Construct */, /*allowMembers*/ false);\n        }\n        function getSingleSignature(type, kind, allowMembers) {\n            if (type.flags & 524288 /* Object */) {\n                var resolved = resolveStructuredTypeMembers(type);\n                if (allowMembers || resolved.properties.length === 0 && !resolved.stringIndexInfo && !resolved.numberIndexInfo) {\n                    if (kind === 0 /* Call */ && resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0) {\n                        return resolved.callSignatures[0];\n                    }\n                    if (kind === 1 /* Construct */ && resolved.constructSignatures.length === 1 && resolved.callSignatures.length === 0) {\n                        return resolved.constructSignatures[0];\n                    }\n                }\n            }\n            return undefined;\n        }\n        // Instantiate a generic signature in the context of a non-generic signature (section 3.8.5 in TypeScript spec)\n        function instantiateSignatureInContextOf(signature, contextualSignature, inferenceContext, compareTypes) {\n            var context = createInferenceContext(signature.typeParameters, signature, 0 /* None */, compareTypes);\n            // We clone the inferenceContext to avoid fixing. For example, when the source signature is <T>(x: T) => T[] and\n            // the contextual signature is (...args: A) => B, we want to infer the element type of A's constraint (say 'any')\n            // for T but leave it possible to later infer '[any]' back to A.\n            var restType = getEffectiveRestType(contextualSignature);\n            var mapper = inferenceContext && (restType && restType.flags & 262144 /* TypeParameter */ ? inferenceContext.nonFixingMapper : inferenceContext.mapper);\n            var sourceSignature = mapper ? instantiateSignature(contextualSignature, mapper) : contextualSignature;\n            applyToParameterTypes(sourceSignature, signature, function (source, target) {\n                // Type parameters from outer context referenced by source type are fixed by instantiation of the source type\n                inferTypes(context.inferences, source, target);\n            });\n            if (!inferenceContext) {\n                applyToReturnTypes(contextualSignature, signature, function (source, target) {\n                    inferTypes(context.inferences, source, target, 64 /* ReturnType */);\n                });\n            }\n            return getSignatureInstantiation(signature, getInferredTypes(context), ts.isInJSFile(contextualSignature.declaration));\n        }\n        function inferJsxTypeArguments(node, signature, checkMode, context) {\n            var paramType = getEffectiveFirstArgumentForJsxSignature(signature, node);\n            var checkAttrType = checkExpressionWithContextualType(node.attributes, paramType, context, checkMode);\n            inferTypes(context.inferences, checkAttrType, paramType);\n            return getInferredTypes(context);\n        }\n        function getThisArgumentType(thisArgumentNode) {\n            if (!thisArgumentNode) {\n                return voidType;\n            }\n            var thisArgumentType = checkExpression(thisArgumentNode);\n            return ts.isOptionalChainRoot(thisArgumentNode.parent) ? getNonNullableType(thisArgumentType) :\n                ts.isOptionalChain(thisArgumentNode.parent) ? removeOptionalTypeMarker(thisArgumentType) :\n                    thisArgumentType;\n        }\n        function inferTypeArguments(node, signature, args, checkMode, context) {\n            if (ts.isJsxOpeningLikeElement(node)) {\n                return inferJsxTypeArguments(node, signature, checkMode, context);\n            }\n            // If a contextual type is available, infer from that type to the return type of the call expression. For\n            // example, given a 'function wrap<T, U>(cb: (x: T) => U): (x: T) => U' and a call expression\n            // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the\n            // return type of 'wrap'.\n            if (node.kind !== 161 /* Decorator */) {\n                var contextualType = getContextualType(node, ts.every(signature.typeParameters, function (p) { return !!getDefaultFromTypeParameter(p); }) ? 8 /* SkipBindingPatterns */ : 0 /* None */);\n                if (contextualType) {\n                    // We clone the inference context to avoid disturbing a resolution in progress for an\n                    // outer call expression. Effectively we just want a snapshot of whatever has been\n                    // inferred for any outer call expression so far.\n                    var outerContext = getInferenceContext(node);\n                    var outerMapper = getMapperFromContext(cloneInferenceContext(outerContext, 1 /* NoDefault */));\n                    var instantiatedType = instantiateType(contextualType, outerMapper);\n                    // If the contextual type is a generic function type with a single call signature, we\n                    // instantiate the type with its own type parameters and type arguments. This ensures that\n                    // the type parameters are not erased to type any during type inference such that they can\n                    // be inferred as actual types from the contextual type. For example:\n                    //   declare function arrayMap<T, U>(f: (x: T) => U): (a: T[]) => U[];\n                    //   const boxElements: <A>(a: A[]) => { value: A }[] = arrayMap(value => ({ value }));\n                    // Above, the type of the 'value' parameter is inferred to be 'A'.\n                    var contextualSignature = getSingleCallSignature(instantiatedType);\n                    var inferenceSourceType = contextualSignature && contextualSignature.typeParameters ?\n                        getOrCreateTypeFromSignature(getSignatureInstantiationWithoutFillingInTypeArguments(contextualSignature, contextualSignature.typeParameters)) :\n                        instantiatedType;\n                    var inferenceTargetType = getReturnTypeOfSignature(signature);\n                    // Inferences made from return types have lower priority than all other inferences.\n                    inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 64 /* ReturnType */);\n                    // Create a type mapper for instantiating generic contextual types using the inferences made\n                    // from the return type. We need a separate inference pass here because (a) instantiation of\n                    // the source type uses the outer context's return mapper (which excludes inferences made from\n                    // outer arguments), and (b) we don't want any further inferences going into this context.\n                    var returnContext = createInferenceContext(signature.typeParameters, signature, context.flags);\n                    var returnSourceType = instantiateType(contextualType, outerContext && outerContext.returnMapper);\n                    inferTypes(returnContext.inferences, returnSourceType, inferenceTargetType);\n                    context.returnMapper = ts.some(returnContext.inferences, hasInferenceCandidates) ? getMapperFromContext(cloneInferredPartOfContext(returnContext)) : undefined;\n                }\n            }\n            var restType = getNonArrayRestType(signature);\n            var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length;\n            if (restType && restType.flags & 262144 /* TypeParameter */) {\n                var info = ts.find(context.inferences, function (info) { return info.typeParameter === restType; });\n                if (info) {\n                    info.impliedArity = ts.findIndex(args, isSpreadArgument, argCount) < 0 ? args.length - argCount : undefined;\n                }\n            }\n            var thisType = getThisTypeOfSignature(signature);\n            if (thisType) {\n                var thisArgumentNode = getThisArgumentOfCall(node);\n                inferTypes(context.inferences, getThisArgumentType(thisArgumentNode), thisType);\n            }\n            for (var i = 0; i < argCount; i++) {\n                var arg = args[i];\n                if (arg.kind !== 222 /* OmittedExpression */) {\n                    var paramType = getTypeAtPosition(signature, i);\n                    var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);\n                    inferTypes(context.inferences, argType, paramType);\n                }\n            }\n            if (restType) {\n                var spreadType = getSpreadArgumentType(args, argCount, args.length, restType, context, checkMode);\n                inferTypes(context.inferences, spreadType, restType);\n            }\n            return getInferredTypes(context);\n        }\n        function getMutableArrayOrTupleType(type) {\n            return type.flags & 1048576 /* Union */ ? mapType(type, getMutableArrayOrTupleType) :\n                type.flags & 1 /* Any */ || isMutableArrayOrTuple(getBaseConstraintOfType(type) || type) ? type :\n                    isTupleType(type) ? createTupleType(getTypeArguments(type), type.target.elementFlags, /*readonly*/ false, type.target.labeledElementDeclarations) :\n                        createTupleType([type], [8 /* Variadic */]);\n        }\n        function getSpreadArgumentType(args, index, argCount, restType, context, checkMode) {\n            if (index >= argCount - 1) {\n                var arg = args[argCount - 1];\n                if (isSpreadArgument(arg)) {\n                    // We are inferring from a spread expression in the last argument position, i.e. both the parameter\n                    // and the argument are ...x forms.\n                    return getMutableArrayOrTupleType(arg.kind === 227 /* SyntheticExpression */ ? arg.type :\n                        checkExpressionWithContextualType(arg.expression, restType, context, checkMode));\n                }\n            }\n            var types = [];\n            var flags = [];\n            var names = [];\n            for (var i = index; i < argCount; i++) {\n                var arg = args[i];\n                if (isSpreadArgument(arg)) {\n                    var spreadType = arg.kind === 227 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression);\n                    if (isArrayLikeType(spreadType)) {\n                        types.push(spreadType);\n                        flags.push(8 /* Variadic */);\n                    }\n                    else {\n                        types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 220 /* SpreadElement */ ? arg.expression : arg));\n                        flags.push(4 /* Rest */);\n                    }\n                }\n                else {\n                    var contextualType = getIndexedAccessType(restType, getLiteralType(i - index));\n                    var argType = checkExpressionWithContextualType(arg, contextualType, context, checkMode);\n                    var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */);\n                    types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType));\n                    flags.push(1 /* Required */);\n                }\n                if (arg.kind === 227 /* SyntheticExpression */ && arg.tupleNameSource) {\n                    names.push(arg.tupleNameSource);\n                }\n            }\n            return createTupleType(types, flags, /*readonly*/ false, ts.length(names) === ts.length(types) ? names : undefined);\n        }\n        function checkTypeArguments(signature, typeArgumentNodes, reportErrors, headMessage) {\n            var isJavascript = ts.isInJSFile(signature.declaration);\n            var typeParameters = signature.typeParameters;\n            var typeArgumentTypes = fillMissingTypeArguments(ts.map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), isJavascript);\n            var mapper;\n            for (var i = 0; i < typeArgumentNodes.length; i++) {\n                ts.Debug.assert(typeParameters[i] !== undefined, \"Should not call checkTypeArguments with too many type arguments\");\n                var constraint = getConstraintOfTypeParameter(typeParameters[i]);\n                if (constraint) {\n                    var errorInfo = reportErrors && headMessage ? (function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); }) : undefined;\n                    var typeArgumentHeadMessage = headMessage || ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1;\n                    if (!mapper) {\n                        mapper = createTypeMapper(typeParameters, typeArgumentTypes);\n                    }\n                    var typeArgument = typeArgumentTypes[i];\n                    if (!checkTypeAssignableTo(typeArgument, getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), reportErrors ? typeArgumentNodes[i] : undefined, typeArgumentHeadMessage, errorInfo)) {\n                        return undefined;\n                    }\n                }\n            }\n            return typeArgumentTypes;\n        }\n        function getJsxReferenceKind(node) {\n            if (isJsxIntrinsicIdentifier(node.tagName)) {\n                return 2 /* Mixed */;\n            }\n            var tagType = getApparentType(checkExpression(node.tagName));\n            if (ts.length(getSignaturesOfType(tagType, 1 /* Construct */))) {\n                return 0 /* Component */;\n            }\n            if (ts.length(getSignaturesOfType(tagType, 0 /* Call */))) {\n                return 1 /* Function */;\n            }\n            return 2 /* Mixed */;\n        }\n        /**\n         * Check if the given signature can possibly be a signature called by the JSX opening-like element.\n         * @param node a JSX opening-like element we are trying to figure its call signature\n         * @param signature a candidate signature we are trying whether it is a call signature\n         * @param relation a relationship to check parameter and argument type\n         */\n        function checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain, errorOutputContainer) {\n            // Stateless function components can have maximum of three arguments: \"props\", \"context\", and \"updater\".\n            // However \"context\" and \"updater\" are implicit and can't be specify by users. Only the first parameter, props,\n            // can be specified by users through attributes property.\n            var paramType = getEffectiveFirstArgumentForJsxSignature(signature, node);\n            var attributesType = checkExpressionWithContextualType(node.attributes, paramType, /*inferenceContext*/ undefined, checkMode);\n            return checkTagNameDoesNotExpectTooManyArguments() && checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes, \n            /*headMessage*/ undefined, containingMessageChain, errorOutputContainer);\n            function checkTagNameDoesNotExpectTooManyArguments() {\n                var _a;\n                if (getJsxNamespaceContainerForImplicitImport(node)) {\n                    return true; // factory is implicitly jsx/jsxdev - assume it fits the bill, since we don't strongly look for the jsx/jsxs/jsxDEV factory APIs anywhere else (at least not yet)\n                }\n                var tagType = ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node) && !isJsxIntrinsicIdentifier(node.tagName) ? checkExpression(node.tagName) : undefined;\n                if (!tagType) {\n                    return true;\n                }\n                var tagCallSignatures = getSignaturesOfType(tagType, 0 /* Call */);\n                if (!ts.length(tagCallSignatures)) {\n                    return true;\n                }\n                var factory = getJsxFactoryEntity(node);\n                if (!factory) {\n                    return true;\n                }\n                var factorySymbol = resolveEntityName(factory, 111551 /* Value */, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, node);\n                if (!factorySymbol) {\n                    return true;\n                }\n                var factoryType = getTypeOfSymbol(factorySymbol);\n                var callSignatures = getSignaturesOfType(factoryType, 0 /* Call */);\n                if (!ts.length(callSignatures)) {\n                    return true;\n                }\n                var hasFirstParamSignatures = false;\n                var maxParamCount = 0;\n                // Check that _some_ first parameter expects a FC-like thing, and that some overload of the SFC expects an acceptable number of arguments\n                for (var _i = 0, callSignatures_1 = callSignatures; _i < callSignatures_1.length; _i++) {\n                    var sig = callSignatures_1[_i];\n                    var firstparam = getTypeAtPosition(sig, 0);\n                    var signaturesOfParam = getSignaturesOfType(firstparam, 0 /* Call */);\n                    if (!ts.length(signaturesOfParam))\n                        continue;\n                    for (var _b = 0, signaturesOfParam_1 = signaturesOfParam; _b < signaturesOfParam_1.length; _b++) {\n                        var paramSig = signaturesOfParam_1[_b];\n                        hasFirstParamSignatures = true;\n                        if (hasEffectiveRestParameter(paramSig)) {\n                            return true; // some signature has a rest param, so function components can have an arbitrary number of arguments\n                        }\n                        var paramCount = getParameterCount(paramSig);\n                        if (paramCount > maxParamCount) {\n                            maxParamCount = paramCount;\n                        }\n                    }\n                }\n                if (!hasFirstParamSignatures) {\n                    // Not a single signature had a first parameter which expected a signature - for back compat, and\n                    // to guard against generic factories which won't have signatures directly, do not error\n                    return true;\n                }\n                var absoluteMinArgCount = Infinity;\n                for (var _c = 0, tagCallSignatures_1 = tagCallSignatures; _c < tagCallSignatures_1.length; _c++) {\n                    var tagSig = tagCallSignatures_1[_c];\n                    var tagRequiredArgCount = getMinArgumentCount(tagSig);\n                    if (tagRequiredArgCount < absoluteMinArgCount) {\n                        absoluteMinArgCount = tagRequiredArgCount;\n                    }\n                }\n                if (absoluteMinArgCount <= maxParamCount) {\n                    return true; // some signature accepts the number of arguments the function component provides\n                }\n                if (reportErrors) {\n                    var diag = ts.createDiagnosticForNode(node.tagName, ts.Diagnostics.Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3, ts.entityNameToString(node.tagName), absoluteMinArgCount, ts.entityNameToString(factory), maxParamCount);\n                    var tagNameDeclaration = (_a = getSymbolAtLocation(node.tagName)) === null || _a === void 0 ? void 0 : _a.valueDeclaration;\n                    if (tagNameDeclaration) {\n                        ts.addRelatedInfo(diag, ts.createDiagnosticForNode(tagNameDeclaration, ts.Diagnostics._0_is_declared_here, ts.entityNameToString(node.tagName)));\n                    }\n                    if (errorOutputContainer && errorOutputContainer.skipLogging) {\n                        (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);\n                    }\n                    if (!errorOutputContainer.skipLogging) {\n                        diagnostics.add(diag);\n                    }\n                }\n                return false;\n            }\n        }\n        function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors, containingMessageChain) {\n            var errorOutputContainer = { errors: undefined, skipLogging: true };\n            if (ts.isJsxOpeningLikeElement(node)) {\n                if (!checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain, errorOutputContainer)) {\n                    ts.Debug.assert(!reportErrors || !!errorOutputContainer.errors, \"jsx should have errors when reporting errors\");\n                    return errorOutputContainer.errors || ts.emptyArray;\n                }\n                return undefined;\n            }\n            var thisType = getThisTypeOfSignature(signature);\n            if (thisType && thisType !== voidType && node.kind !== 204 /* NewExpression */) {\n                // If the called expression is not of the form `x.f` or `x[\"f\"]`, then sourceType = voidType\n                // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible.\n                // If the expression is a new expression, then the check is skipped.\n                var thisArgumentNode = getThisArgumentOfCall(node);\n                var thisArgumentType = getThisArgumentType(thisArgumentNode);\n                var errorNode = reportErrors ? (thisArgumentNode || node) : undefined;\n                var headMessage_1 = ts.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1;\n                if (!checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage_1, containingMessageChain, errorOutputContainer)) {\n                    ts.Debug.assert(!reportErrors || !!errorOutputContainer.errors, \"this parameter should have errors when reporting errors\");\n                    return errorOutputContainer.errors || ts.emptyArray;\n                }\n            }\n            var headMessage = ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1;\n            var restType = getNonArrayRestType(signature);\n            var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length;\n            for (var i = 0; i < argCount; i++) {\n                var arg = args[i];\n                if (arg.kind !== 222 /* OmittedExpression */) {\n                    var paramType = getTypeAtPosition(signature, i);\n                    var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode);\n                    // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive),\n                    // we obtain the regular type of any object literal arguments because we may not have inferred complete\n                    // parameter types yet and therefore excess property checks may yield false positives (see #17041).\n                    var checkArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType;\n                    if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage, containingMessageChain, errorOutputContainer)) {\n                        ts.Debug.assert(!reportErrors || !!errorOutputContainer.errors, \"parameter should have errors when reporting errors\");\n                        maybeAddMissingAwaitInfo(arg, checkArgType, paramType);\n                        return errorOutputContainer.errors || ts.emptyArray;\n                    }\n                }\n            }\n            if (restType) {\n                var spreadType = getSpreadArgumentType(args, argCount, args.length, restType, /*context*/ undefined, checkMode);\n                var restArgCount = args.length - argCount;\n                var errorNode = !reportErrors ? undefined :\n                    restArgCount === 0 ? node :\n                        restArgCount === 1 ? args[argCount] :\n                            ts.setTextRangePosEnd(createSyntheticExpression(node, spreadType), args[argCount].pos, args[args.length - 1].end);\n                if (!checkTypeRelatedTo(spreadType, restType, relation, errorNode, headMessage, /*containingMessageChain*/ undefined, errorOutputContainer)) {\n                    ts.Debug.assert(!reportErrors || !!errorOutputContainer.errors, \"rest parameter should have errors when reporting errors\");\n                    maybeAddMissingAwaitInfo(errorNode, spreadType, restType);\n                    return errorOutputContainer.errors || ts.emptyArray;\n                }\n            }\n            return undefined;\n            function maybeAddMissingAwaitInfo(errorNode, source, target) {\n                if (errorNode && reportErrors && errorOutputContainer.errors && errorOutputContainer.errors.length) {\n                    // Bail if target is Promise-like---something else is wrong\n                    if (getAwaitedTypeOfPromise(target)) {\n                        return;\n                    }\n                    var awaitedTypeOfSource = getAwaitedTypeOfPromise(source);\n                    if (awaitedTypeOfSource && isTypeRelatedTo(awaitedTypeOfSource, target, relation)) {\n                        ts.addRelatedInfo(errorOutputContainer.errors[0], ts.createDiagnosticForNode(errorNode, ts.Diagnostics.Did_you_forget_to_use_await));\n                    }\n                }\n            }\n        }\n        /**\n         * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise.\n         */\n        function getThisArgumentOfCall(node) {\n            if (node.kind === 203 /* CallExpression */) {\n                var callee = ts.skipOuterExpressions(node.expression);\n                if (ts.isAccessExpression(callee)) {\n                    return callee.expression;\n                }\n            }\n        }\n        function createSyntheticExpression(parent, type, isSpread, tupleNameSource) {\n            var result = ts.parseNodeFactory.createSyntheticExpression(type, isSpread, tupleNameSource);\n            ts.setTextRange(result, parent);\n            ts.setParent(result, parent);\n            return result;\n        }\n        /**\n         * Returns the effective arguments for an expression that works like a function invocation.\n         */\n        function getEffectiveCallArguments(node) {\n            if (node.kind === 205 /* TaggedTemplateExpression */) {\n                var template = node.template;\n                var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())];\n                if (template.kind === 218 /* TemplateExpression */) {\n                    ts.forEach(template.templateSpans, function (span) {\n                        args_3.push(span.expression);\n                    });\n                }\n                return args_3;\n            }\n            if (node.kind === 161 /* Decorator */) {\n                return getEffectiveDecoratorArguments(node);\n            }\n            if (ts.isJsxOpeningLikeElement(node)) {\n                return node.attributes.properties.length > 0 || (ts.isJsxOpeningElement(node) && node.parent.children.length > 0) ? [node.attributes] : ts.emptyArray;\n            }\n            var args = node.arguments || ts.emptyArray;\n            var spreadIndex = getSpreadArgumentIndex(args);\n            if (spreadIndex >= 0) {\n                // Create synthetic arguments from spreads of tuple types.\n                var effectiveArgs_1 = args.slice(0, spreadIndex);\n                var _loop_20 = function (i) {\n                    var arg = args[i];\n                    // We can call checkExpressionCached because spread expressions never have a contextual type.\n                    var spreadType = arg.kind === 220 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));\n                    if (spreadType && isTupleType(spreadType)) {\n                        ts.forEach(getTypeArguments(spreadType), function (t, i) {\n                            var _a;\n                            var flags = spreadType.target.elementFlags[i];\n                            var syntheticArg = createSyntheticExpression(arg, flags & 4 /* Rest */ ? createArrayType(t) : t, !!(flags & 12 /* Variable */), (_a = spreadType.target.labeledElementDeclarations) === null || _a === void 0 ? void 0 : _a[i]);\n                            effectiveArgs_1.push(syntheticArg);\n                        });\n                    }\n                    else {\n                        effectiveArgs_1.push(arg);\n                    }\n                };\n                for (var i = spreadIndex; i < args.length; i++) {\n                    _loop_20(i);\n                }\n                return effectiveArgs_1;\n            }\n            return args;\n        }\n        /**\n         * Returns the synthetic argument list for a decorator invocation.\n         */\n        function getEffectiveDecoratorArguments(node) {\n            var parent = node.parent;\n            var expr = node.expression;\n            switch (parent.kind) {\n                case 252 /* ClassDeclaration */:\n                case 221 /* ClassExpression */:\n                    // For a class decorator, the `target` is the type of the class (e.g. the\n                    // \"static\" or \"constructor\" side of the class).\n                    return [\n                        createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent)))\n                    ];\n                case 160 /* Parameter */:\n                    // A parameter declaration decorator will have three arguments (see\n                    // `ParameterDecorator` in core.d.ts).\n                    var func = parent.parent;\n                    return [\n                        createSyntheticExpression(expr, parent.parent.kind === 166 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType),\n                        createSyntheticExpression(expr, anyType),\n                        createSyntheticExpression(expr, numberType)\n                    ];\n                case 163 /* PropertyDeclaration */:\n                case 165 /* MethodDeclaration */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    // A method or accessor declaration decorator will have two or three arguments (see\n                    // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators\n                    // for ES3, we will only pass two arguments.\n                    var hasPropDesc = parent.kind !== 163 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */;\n                    return [\n                        createSyntheticExpression(expr, getParentTypeOfClassElement(parent)),\n                        createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)),\n                        createSyntheticExpression(expr, hasPropDesc ? createTypedPropertyDescriptorType(getTypeOfNode(parent)) : anyType)\n                    ];\n            }\n            return ts.Debug.fail();\n        }\n        /**\n         * Returns the argument count for a decorator node that works like a function invocation.\n         */\n        function getDecoratorArgumentCount(node, signature) {\n            switch (node.parent.kind) {\n                case 252 /* ClassDeclaration */:\n                case 221 /* ClassExpression */:\n                    return 1;\n                case 163 /* PropertyDeclaration */:\n                    return 2;\n                case 165 /* MethodDeclaration */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    // For ES3 or decorators with only two parameters we supply only two arguments\n                    return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3;\n                case 160 /* Parameter */:\n                    return 3;\n                default:\n                    return ts.Debug.fail();\n            }\n        }\n        function getDiagnosticSpanForCallNode(node, doNotIncludeArguments) {\n            var start;\n            var length;\n            var sourceFile = ts.getSourceFileOfNode(node);\n            if (ts.isPropertyAccessExpression(node.expression)) {\n                var nameSpan = ts.getErrorSpanForNode(sourceFile, node.expression.name);\n                start = nameSpan.start;\n                length = doNotIncludeArguments ? nameSpan.length : node.end - start;\n            }\n            else {\n                var expressionSpan = ts.getErrorSpanForNode(sourceFile, node.expression);\n                start = expressionSpan.start;\n                length = doNotIncludeArguments ? expressionSpan.length : node.end - start;\n            }\n            return { start: start, length: length, sourceFile: sourceFile };\n        }\n        function getDiagnosticForCallNode(node, message, arg0, arg1, arg2, arg3) {\n            if (ts.isCallExpression(node)) {\n                var _a = getDiagnosticSpanForCallNode(node), sourceFile = _a.sourceFile, start = _a.start, length_6 = _a.length;\n                return ts.createFileDiagnostic(sourceFile, start, length_6, message, arg0, arg1, arg2, arg3);\n            }\n            else {\n                return ts.createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3);\n            }\n        }\n        function isPromiseResolveArityError(node) {\n            if (!ts.isCallExpression(node) || !ts.isIdentifier(node.expression))\n                return false;\n            var symbol = resolveName(node.expression, node.expression.escapedText, 111551 /* Value */, undefined, undefined, false);\n            var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration;\n            if (!decl || !ts.isParameter(decl) || !isFunctionExpressionOrArrowFunction(decl.parent) || !ts.isNewExpression(decl.parent.parent) || !ts.isIdentifier(decl.parent.parent.expression)) {\n                return false;\n            }\n            var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(/*reportErrors*/ false);\n            if (!globalPromiseSymbol)\n                return false;\n            var constructorSymbol = getSymbolAtLocation(decl.parent.parent.expression, /*ignoreErrors*/ true);\n            return constructorSymbol === globalPromiseSymbol;\n        }\n        function getArgumentArityError(node, signatures, args) {\n            var min = Number.POSITIVE_INFINITY;\n            var max = Number.NEGATIVE_INFINITY;\n            var belowArgCount = Number.NEGATIVE_INFINITY;\n            var aboveArgCount = Number.POSITIVE_INFINITY;\n            var argCount = args.length;\n            var closestSignature;\n            for (var _i = 0, signatures_8 = signatures; _i < signatures_8.length; _i++) {\n                var sig = signatures_8[_i];\n                var minCount = getMinArgumentCount(sig);\n                var maxCount = getParameterCount(sig);\n                if (minCount < argCount && minCount > belowArgCount)\n                    belowArgCount = minCount;\n                if (argCount < maxCount && maxCount < aboveArgCount)\n                    aboveArgCount = maxCount;\n                if (minCount < min) {\n                    min = minCount;\n                    closestSignature = sig;\n                }\n                max = Math.max(max, maxCount);\n            }\n            var hasRestParameter = ts.some(signatures, hasEffectiveRestParameter);\n            var paramRange = hasRestParameter ? min :\n                min < max ? min + \"-\" + max :\n                    min;\n            var hasSpreadArgument = getSpreadArgumentIndex(args) > -1;\n            if (argCount <= max && hasSpreadArgument) {\n                argCount--;\n            }\n            var spanArray;\n            var related;\n            var error = hasRestParameter || hasSpreadArgument ?\n                hasRestParameter && hasSpreadArgument ?\n                    ts.Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more :\n                    hasRestParameter ?\n                        ts.Diagnostics.Expected_at_least_0_arguments_but_got_1 :\n                        ts.Diagnostics.Expected_0_arguments_but_got_1_or_more :\n                paramRange === 1 && argCount === 0 && isPromiseResolveArityError(node) ?\n                    ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise :\n                    ts.Diagnostics.Expected_0_arguments_but_got_1;\n            if (closestSignature && getMinArgumentCount(closestSignature) > argCount && closestSignature.declaration) {\n                var paramDecl = closestSignature.declaration.parameters[closestSignature.thisParameter ? argCount + 1 : argCount];\n                if (paramDecl) {\n                    related = ts.createDiagnosticForNode(paramDecl, ts.isBindingPattern(paramDecl.name) ? ts.Diagnostics.An_argument_matching_this_binding_pattern_was_not_provided :\n                        ts.isRestParameter(paramDecl) ? ts.Diagnostics.Arguments_for_the_rest_parameter_0_were_not_provided : ts.Diagnostics.An_argument_for_0_was_not_provided, !paramDecl.name ? argCount : !ts.isBindingPattern(paramDecl.name) ? ts.idText(ts.getFirstIdentifier(paramDecl.name)) : undefined);\n                }\n            }\n            if (min < argCount && argCount < max) {\n                return getDiagnosticForCallNode(node, ts.Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, argCount, belowArgCount, aboveArgCount);\n            }\n            if (!hasSpreadArgument && argCount < min) {\n                var diagnostic_1 = getDiagnosticForCallNode(node, error, paramRange, argCount);\n                return related ? ts.addRelatedInfo(diagnostic_1, related) : diagnostic_1;\n            }\n            if (hasRestParameter || hasSpreadArgument) {\n                spanArray = ts.factory.createNodeArray(args);\n                if (hasSpreadArgument && argCount) {\n                    var nextArg = ts.elementAt(args, getSpreadArgumentIndex(args) + 1) || undefined;\n                    spanArray = ts.factory.createNodeArray(args.slice(max > argCount && nextArg ? args.indexOf(nextArg) : Math.min(max, args.length - 1)));\n                }\n            }\n            else {\n                spanArray = ts.factory.createNodeArray(args.slice(max));\n            }\n            var pos = ts.first(spanArray).pos;\n            var end = ts.last(spanArray).end;\n            if (end === pos) {\n                end++;\n            }\n            ts.setTextRangePosEnd(spanArray, pos, end);\n            var diagnostic = ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), spanArray, error, paramRange, argCount);\n            return related ? ts.addRelatedInfo(diagnostic, related) : diagnostic;\n        }\n        function getTypeArgumentArityError(node, signatures, typeArguments) {\n            var argCount = typeArguments.length;\n            // No overloads exist\n            if (signatures.length === 1) {\n                var sig = signatures[0];\n                var min_1 = getMinTypeArgumentCount(sig.typeParameters);\n                var max = ts.length(sig.typeParameters);\n                return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, min_1 < max ? min_1 + \"-\" + max : min_1, argCount);\n            }\n            // Overloads exist\n            var belowArgCount = -Infinity;\n            var aboveArgCount = Infinity;\n            for (var _i = 0, signatures_9 = signatures; _i < signatures_9.length; _i++) {\n                var sig = signatures_9[_i];\n                var min_2 = getMinTypeArgumentCount(sig.typeParameters);\n                var max = ts.length(sig.typeParameters);\n                if (min_2 > argCount) {\n                    aboveArgCount = Math.min(aboveArgCount, min_2);\n                }\n                else if (max < argCount) {\n                    belowArgCount = Math.max(belowArgCount, max);\n                }\n            }\n            if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) {\n                return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount);\n            }\n            return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount);\n        }\n        function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) {\n            var isTaggedTemplate = node.kind === 205 /* TaggedTemplateExpression */;\n            var isDecorator = node.kind === 161 /* Decorator */;\n            var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node);\n            var reportErrors = !candidatesOutArray && produceDiagnostics;\n            var typeArguments;\n            if (!isDecorator) {\n                typeArguments = node.typeArguments;\n                // We already perform checking on the type arguments on the class declaration itself.\n                if (isTaggedTemplate || isJsxOpeningOrSelfClosingElement || node.expression.kind !== 105 /* SuperKeyword */) {\n                    ts.forEach(typeArguments, checkSourceElement);\n                }\n            }\n            var candidates = candidatesOutArray || [];\n            // reorderCandidates fills up the candidates array directly\n            reorderCandidates(signatures, candidates, callChainFlags);\n            if (!candidates.length) {\n                if (reportErrors) {\n                    diagnostics.add(getDiagnosticForCallNode(node, ts.Diagnostics.Call_target_does_not_contain_any_signatures));\n                }\n                return resolveErrorCall(node);\n            }\n            var args = getEffectiveCallArguments(node);\n            // The excludeArgument array contains true for each context sensitive argument (an argument\n            // is context sensitive it is susceptible to a one-time permanent contextual typing).\n            //\n            // The idea is that we will perform type argument inference & assignability checking once\n            // without using the susceptible parameters that are functions, and once more for those\n            // parameters, contextually typing each as we go along.\n            //\n            // For a tagged template, then the first argument be 'undefined' if necessary because it\n            // represents a TemplateStringsArray.\n            //\n            // For a decorator, no arguments are susceptible to contextual typing due to the fact\n            // decorators are applied to a declaration by the emitter, and not to an expression.\n            var isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;\n            var argCheckMode = !isDecorator && !isSingleNonGenericCandidate && ts.some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;\n            // The following variables are captured and modified by calls to chooseOverload.\n            // If overload resolution or type argument inference fails, we want to report the\n            // best error possible. The best error is one which says that an argument was not\n            // assignable to a parameter. This implies that everything else about the overload\n            // was fine. So if there is any overload that is only incorrect because of an\n            // argument, we will report an error on that one.\n            //\n            //     function foo(s: string): void;\n            //     function foo(n: number): void; // Report argument error on this overload\n            //     function foo(): void;\n            //     foo(true);\n            //\n            // If none of the overloads even made it that far, there are two possibilities.\n            // There was a problem with type arguments for some overload, in which case\n            // report an error on that. Or none of the overloads even had correct arity,\n            // in which case give an arity error.\n            //\n            //     function foo<T extends string>(x: T): void; // Report type argument error\n            //     function foo(): void;\n            //     foo<number>(0);\n            //\n            var candidatesForArgumentError;\n            var candidateForArgumentArityError;\n            var candidateForTypeArgumentError;\n            var result;\n            // If we are in signature help, a trailing comma indicates that we intend to provide another argument,\n            // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments.\n            var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 203 /* CallExpression */ && node.arguments.hasTrailingComma;\n            // Section 4.12.1:\n            // if the candidate list contains one or more signatures for which the type of each argument\n            // expression is a subtype of each corresponding parameter type, the return type of the first\n            // of those signatures becomes the return type of the function call.\n            // Otherwise, the return type of the first signature in the candidate list becomes the return\n            // type of the function call.\n            //\n            // Whether the call is an error is determined by assignability of the arguments. The subtype pass\n            // is just important for choosing the best signature. So in the case where there is only one\n            // signature, the subtype pass is useless. So skipping it is an optimization.\n            if (candidates.length > 1) {\n                result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);\n            }\n            if (!result) {\n                result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);\n            }\n            if (result) {\n                return result;\n            }\n            // No signatures were applicable. Now report errors based on the last applicable signature with\n            // no arguments excluded from assignability checks.\n            // If candidate is undefined, it means that no candidates had a suitable arity. In that case,\n            // skip the checkApplicableSignature check.\n            if (reportErrors) {\n                if (candidatesForArgumentError) {\n                    if (candidatesForArgumentError.length === 1 || candidatesForArgumentError.length > 3) {\n                        var last_2 = candidatesForArgumentError[candidatesForArgumentError.length - 1];\n                        var chain_1;\n                        if (candidatesForArgumentError.length > 3) {\n                            chain_1 = ts.chainDiagnosticMessages(chain_1, ts.Diagnostics.The_last_overload_gave_the_following_error);\n                            chain_1 = ts.chainDiagnosticMessages(chain_1, ts.Diagnostics.No_overload_matches_this_call);\n                        }\n                        var diags = getSignatureApplicabilityError(node, args, last_2, assignableRelation, 0 /* Normal */, /*reportErrors*/ true, function () { return chain_1; });\n                        if (diags) {\n                            for (var _i = 0, diags_1 = diags; _i < diags_1.length; _i++) {\n                                var d = diags_1[_i];\n                                if (last_2.declaration && candidatesForArgumentError.length > 3) {\n                                    ts.addRelatedInfo(d, ts.createDiagnosticForNode(last_2.declaration, ts.Diagnostics.The_last_overload_is_declared_here));\n                                }\n                                addImplementationSuccessElaboration(last_2, d);\n                                diagnostics.add(d);\n                            }\n                        }\n                        else {\n                            ts.Debug.fail(\"No error for last overload signature\");\n                        }\n                    }\n                    else {\n                        var allDiagnostics = [];\n                        var max = 0;\n                        var min_3 = Number.MAX_VALUE;\n                        var minIndex = 0;\n                        var i_1 = 0;\n                        var _loop_21 = function (c) {\n                            var chain_2 = function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };\n                            var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0 /* Normal */, /*reportErrors*/ true, chain_2);\n                            if (diags_2) {\n                                if (diags_2.length <= min_3) {\n                                    min_3 = diags_2.length;\n                                    minIndex = i_1;\n                                }\n                                max = Math.max(max, diags_2.length);\n                                allDiagnostics.push(diags_2);\n                            }\n                            else {\n                                ts.Debug.fail(\"No error for 3 or fewer overload signatures\");\n                            }\n                            i_1++;\n                        };\n                        for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {\n                            var c = candidatesForArgumentError_1[_a];\n                            _loop_21(c);\n                        }\n                        var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);\n                        ts.Debug.assert(diags_3.length > 0, \"No errors reported for 3 or fewer overload signatures\");\n                        var chain = ts.chainDiagnosticMessages(ts.map(diags_3, function (d) { return typeof d.messageText === \"string\" ? d : d.messageText; }), ts.Diagnostics.No_overload_matches_this_call);\n                        // The below is a spread to guarantee we get a new (mutable) array - our `flatMap` helper tries to do \"smart\" optimizations where it reuses input\n                        // arrays and the emptyArray singleton where possible, which is decidedly not what we want while we're still constructing this diagnostic\n                        var related = __spreadArray([], ts.flatMap(diags_3, function (d) { return d.relatedInformation; }));\n                        var diag = void 0;\n                        if (ts.every(diags_3, function (d) { return d.start === diags_3[0].start && d.length === diags_3[0].length && d.file === diags_3[0].file; })) {\n                            var _b = diags_3[0], file = _b.file, start = _b.start, length_7 = _b.length;\n                            diag = { file: file, start: start, length: length_7, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related };\n                        }\n                        else {\n                            diag = ts.createDiagnosticForNodeFromMessageChain(node, chain, related);\n                        }\n                        addImplementationSuccessElaboration(candidatesForArgumentError[0], diag);\n                        diagnostics.add(diag);\n                    }\n                }\n                else if (candidateForArgumentArityError) {\n                    diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args));\n                }\n                else if (candidateForTypeArgumentError) {\n                    checkTypeArguments(candidateForTypeArgumentError, node.typeArguments, /*reportErrors*/ true, fallbackError);\n                }\n                else {\n                    var signaturesWithCorrectTypeArgumentArity = ts.filter(signatures, function (s) { return hasCorrectTypeArgumentArity(s, typeArguments); });\n                    if (signaturesWithCorrectTypeArgumentArity.length === 0) {\n                        diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments));\n                    }\n                    else if (!isDecorator) {\n                        diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args));\n                    }\n                    else if (fallbackError) {\n                        diagnostics.add(getDiagnosticForCallNode(node, fallbackError));\n                    }\n                }\n            }\n            return getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray);\n            function addImplementationSuccessElaboration(failed, diagnostic) {\n                var _a, _b;\n                var oldCandidatesForArgumentError = candidatesForArgumentError;\n                var oldCandidateForArgumentArityError = candidateForArgumentArityError;\n                var oldCandidateForTypeArgumentError = candidateForTypeArgumentError;\n                var failedSignatureDeclarations = ((_b = (_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.declarations) || ts.emptyArray;\n                var isOverload = failedSignatureDeclarations.length > 1;\n                var implDecl = isOverload ? ts.find(failedSignatureDeclarations, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined;\n                if (implDecl) {\n                    var candidate = getSignatureFromDeclaration(implDecl);\n                    var isSingleNonGenericCandidate_1 = !candidate.typeParameters;\n                    if (chooseOverload([candidate], assignableRelation, isSingleNonGenericCandidate_1)) {\n                        ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(implDecl, ts.Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible));\n                    }\n                }\n                candidatesForArgumentError = oldCandidatesForArgumentError;\n                candidateForArgumentArityError = oldCandidateForArgumentArityError;\n                candidateForTypeArgumentError = oldCandidateForTypeArgumentError;\n            }\n            function chooseOverload(candidates, relation, isSingleNonGenericCandidate, signatureHelpTrailingComma) {\n                if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; }\n                candidatesForArgumentError = undefined;\n                candidateForArgumentArityError = undefined;\n                candidateForTypeArgumentError = undefined;\n                if (isSingleNonGenericCandidate) {\n                    var candidate = candidates[0];\n                    if (ts.some(typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma)) {\n                        return undefined;\n                    }\n                    if (getSignatureApplicabilityError(node, args, candidate, relation, 0 /* Normal */, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) {\n                        candidatesForArgumentError = [candidate];\n                        return undefined;\n                    }\n                    return candidate;\n                }\n                for (var candidateIndex = 0; candidateIndex < candidates.length; candidateIndex++) {\n                    var candidate = candidates[candidateIndex];\n                    if (!hasCorrectTypeArgumentArity(candidate, typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma)) {\n                        continue;\n                    }\n                    var checkCandidate = void 0;\n                    var inferenceContext = void 0;\n                    if (candidate.typeParameters) {\n                        var typeArgumentTypes = void 0;\n                        if (ts.some(typeArguments)) {\n                            typeArgumentTypes = checkTypeArguments(candidate, typeArguments, /*reportErrors*/ false);\n                            if (!typeArgumentTypes) {\n                                candidateForTypeArgumentError = candidate;\n                                continue;\n                            }\n                        }\n                        else {\n                            inferenceContext = createInferenceContext(candidate.typeParameters, candidate, /*flags*/ ts.isInJSFile(node) ? 2 /* AnyDefault */ : 0 /* None */);\n                            typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext);\n                            argCheckMode |= inferenceContext.flags & 4 /* SkippedGenericFunction */ ? 8 /* SkipGenericFunctions */ : 0 /* Normal */;\n                        }\n                        checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, ts.isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters);\n                        // If the original signature has a generic rest type, instantiation may produce a\n                        // signature with different arity and we need to perform another arity check.\n                        if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma)) {\n                            candidateForArgumentArityError = checkCandidate;\n                            continue;\n                        }\n                    }\n                    else {\n                        checkCandidate = candidate;\n                    }\n                    if (getSignatureApplicabilityError(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) {\n                        // Give preference to error candidates that have no rest parameters (as they are more specific)\n                        (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate);\n                        continue;\n                    }\n                    if (argCheckMode) {\n                        // If one or more context sensitive arguments were excluded, we start including\n                        // them now (and keeping do so for any subsequent candidates) and perform a second\n                        // round of type inference and applicability checking for this particular candidate.\n                        argCheckMode = 0 /* Normal */;\n                        if (inferenceContext) {\n                            var typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);\n                            checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, ts.isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters);\n                            // If the original signature has a generic rest type, instantiation may produce a\n                            // signature with different arity and we need to perform another arity check.\n                            if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma)) {\n                                candidateForArgumentArityError = checkCandidate;\n                                continue;\n                            }\n                        }\n                        if (getSignatureApplicabilityError(node, args, checkCandidate, relation, argCheckMode, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) {\n                            // Give preference to error candidates that have no rest parameters (as they are more specific)\n                            (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate);\n                            continue;\n                        }\n                    }\n                    candidates[candidateIndex] = checkCandidate;\n                    return checkCandidate;\n                }\n                return undefined;\n            }\n        }\n        // No signature was applicable. We have already reported the errors for the invalid signature.\n        function getCandidateForOverloadFailure(node, candidates, args, hasCandidatesOutArray) {\n            ts.Debug.assert(candidates.length > 0); // Else should not have called this.\n            checkNodeDeferred(node);\n            // Normally we will combine overloads. Skip this if they have type parameters since that's hard to combine.\n            // Don't do this if there is a `candidatesOutArray`,\n            // because then we want the chosen best candidate to be one of the overloads, not a combination.\n            return hasCandidatesOutArray || candidates.length === 1 || candidates.some(function (c) { return !!c.typeParameters; })\n                ? pickLongestCandidateSignature(node, candidates, args)\n                : createUnionOfSignaturesForOverloadFailure(candidates);\n        }\n        function createUnionOfSignaturesForOverloadFailure(candidates) {\n            var thisParameters = ts.mapDefined(candidates, function (c) { return c.thisParameter; });\n            var thisParameter;\n            if (thisParameters.length) {\n                thisParameter = createCombinedSymbolFromTypes(thisParameters, thisParameters.map(getTypeOfParameter));\n            }\n            var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;\n            var parameters = [];\n            var _loop_22 = function (i) {\n                var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?\n                    i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :\n                    i < s.parameters.length ? s.parameters[i] : undefined; });\n                ts.Debug.assert(symbols.length !== 0);\n                parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));\n            };\n            for (var i = 0; i < maxNonRestParam; i++) {\n                _loop_22(i);\n            }\n            var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });\n            var flags = 0 /* None */;\n            if (restParameterSymbols.length !== 0) {\n                var type = createArrayType(getUnionType(ts.mapDefined(candidates, tryGetRestTypeOfSignature), 2 /* Subtype */));\n                parameters.push(createCombinedSymbolForOverloadFailure(restParameterSymbols, type));\n                flags |= 1 /* HasRestParameter */;\n            }\n            if (candidates.some(signatureHasLiteralTypes)) {\n                flags |= 2 /* HasLiteralTypes */;\n            }\n            return createSignature(candidates[0].declaration, \n            /*typeParameters*/ undefined, // Before calling this we tested for `!candidates.some(c => !!c.typeParameters)`.\n            thisParameter, parameters, \n            /*resolvedReturnType*/ getIntersectionType(candidates.map(getReturnTypeOfSignature)), \n            /*typePredicate*/ undefined, minArgumentCount, flags);\n        }\n        function getNumNonRestParameters(signature) {\n            var numParams = signature.parameters.length;\n            return signatureHasRestParameter(signature) ? numParams - 1 : numParams;\n        }\n        function createCombinedSymbolFromTypes(sources, types) {\n            return createCombinedSymbolForOverloadFailure(sources, getUnionType(types, 2 /* Subtype */));\n        }\n        function createCombinedSymbolForOverloadFailure(sources, type) {\n            // This function is currently only used for erroneous overloads, so it's good enough to just use the first source.\n            return createSymbolWithType(ts.first(sources), type);\n        }\n        function pickLongestCandidateSignature(node, candidates, args) {\n            // Pick the longest signature. This way we can get a contextual type for cases like:\n            //     declare function f(a: { xa: number; xb: number; }, b: number);\n            //     f({ |\n            // Also, use explicitly-supplied type arguments if they are provided, so we can get a contextual signature in cases like:\n            //     declare function f<T>(k: keyof T);\n            //     f<Foo>(\"\n            var bestIndex = getLongestCandidateIndex(candidates, apparentArgumentCount === undefined ? args.length : apparentArgumentCount);\n            var candidate = candidates[bestIndex];\n            var typeParameters = candidate.typeParameters;\n            if (!typeParameters) {\n                return candidate;\n            }\n            var typeArgumentNodes = callLikeExpressionMayHaveTypeArguments(node) ? node.typeArguments : undefined;\n            var instantiated = typeArgumentNodes\n                ? createSignatureInstantiation(candidate, getTypeArgumentsFromNodes(typeArgumentNodes, typeParameters, ts.isInJSFile(node)))\n                : inferSignatureInstantiationForOverloadFailure(node, typeParameters, candidate, args);\n            candidates[bestIndex] = instantiated;\n            return instantiated;\n        }\n        function getTypeArgumentsFromNodes(typeArgumentNodes, typeParameters, isJs) {\n            var typeArguments = typeArgumentNodes.map(getTypeOfNode);\n            while (typeArguments.length > typeParameters.length) {\n                typeArguments.pop();\n            }\n            while (typeArguments.length < typeParameters.length) {\n                typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));\n            }\n            return typeArguments;\n        }\n        function inferSignatureInstantiationForOverloadFailure(node, typeParameters, candidate, args) {\n            var inferenceContext = createInferenceContext(typeParameters, candidate, /*flags*/ ts.isInJSFile(node) ? 2 /* AnyDefault */ : 0 /* None */);\n            var typeArgumentTypes = inferTypeArguments(node, candidate, args, 4 /* SkipContextSensitive */ | 8 /* SkipGenericFunctions */, inferenceContext);\n            return createSignatureInstantiation(candidate, typeArgumentTypes);\n        }\n        function getLongestCandidateIndex(candidates, argsCount) {\n            var maxParamsIndex = -1;\n            var maxParams = -1;\n            for (var i = 0; i < candidates.length; i++) {\n                var candidate = candidates[i];\n                var paramCount = getParameterCount(candidate);\n                if (hasEffectiveRestParameter(candidate) || paramCount >= argsCount) {\n                    return i;\n                }\n                if (paramCount > maxParams) {\n                    maxParams = paramCount;\n                    maxParamsIndex = i;\n                }\n            }\n            return maxParamsIndex;\n        }\n        function resolveCallExpression(node, candidatesOutArray, checkMode) {\n            if (node.expression.kind === 105 /* SuperKeyword */) {\n                var superType = checkSuperExpression(node.expression);\n                if (isTypeAny(superType)) {\n                    for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) {\n                        var arg = _a[_i];\n                        checkExpression(arg); // Still visit arguments so they get marked for visibility, etc\n                    }\n                    return anySignature;\n                }\n                if (superType !== errorType) {\n                    // In super call, the candidate signatures are the matching arity signatures of the base constructor function instantiated\n                    // with the type arguments specified in the extends clause.\n                    var baseTypeNode = ts.getEffectiveBaseTypeNode(ts.getContainingClass(node));\n                    if (baseTypeNode) {\n                        var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode);\n                        return resolveCall(node, baseConstructors, candidatesOutArray, checkMode, 0 /* None */);\n                    }\n                }\n                return resolveUntypedCall(node);\n            }\n            var callChainFlags;\n            var funcType = checkExpression(node.expression);\n            if (ts.isCallChain(node)) {\n                var nonOptionalType = getOptionalExpressionType(funcType, node.expression);\n                callChainFlags = nonOptionalType === funcType ? 0 /* None */ :\n                    ts.isOutermostOptionalChain(node) ? 16 /* IsOuterCallChain */ :\n                        8 /* IsInnerCallChain */;\n                funcType = nonOptionalType;\n            }\n            else {\n                callChainFlags = 0 /* None */;\n            }\n            funcType = checkNonNullTypeWithReporter(funcType, node.expression, reportCannotInvokePossiblyNullOrUndefinedError);\n            if (funcType === silentNeverType) {\n                return silentNeverSignature;\n            }\n            var apparentType = getApparentType(funcType);\n            if (apparentType === errorType) {\n                // Another error has already been reported\n                return resolveErrorCall(node);\n            }\n            // Technically, this signatures list may be incomplete. We are taking the apparent type,\n            // but we are not including call signatures that may have been added to the Object or\n            // Function interface, since they have none by default. This is a bit of a leap of faith\n            // that the user will not add any.\n            var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */);\n            var numConstructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */).length;\n            // TS 1.0 Spec: 4.12\n            // In an untyped function call no TypeArgs are permitted, Args can be any argument list, no contextual\n            // types are provided for the argument expressions, and the result is always of type Any.\n            if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) {\n                // The unknownType indicates that an error already occurred (and was reported).  No\n                // need to report another error in this case.\n                if (funcType !== errorType && node.typeArguments) {\n                    error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments);\n                }\n                return resolveUntypedCall(node);\n            }\n            // If FuncExpr's apparent type(section 3.8.1) is a function type, the call is a typed function call.\n            // TypeScript employs overload resolution in typed function calls in order to support functions\n            // with multiple call signatures.\n            if (!callSignatures.length) {\n                if (numConstructSignatures) {\n                    error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType));\n                }\n                else {\n                    var relatedInformation = void 0;\n                    if (node.arguments.length === 1) {\n                        var text = ts.getSourceFileOfNode(node).text;\n                        if (ts.isLineBreak(text.charCodeAt(ts.skipTrivia(text, node.expression.end, /* stopAfterLineBreak */ true) - 1))) {\n                            relatedInformation = ts.createDiagnosticForNode(node.expression, ts.Diagnostics.Are_you_missing_a_semicolon);\n                        }\n                    }\n                    invocationError(node.expression, apparentType, 0 /* Call */, relatedInformation);\n                }\n                return resolveErrorCall(node);\n            }\n            // When a call to a generic function is an argument to an outer call to a generic function for which\n            // inference is in process, we have a choice to make. If the inner call relies on inferences made from\n            // its contextual type to its return type, deferring the inner call processing allows the best possible\n            // contextual type to accumulate. But if the outer call relies on inferences made from the return type of\n            // the inner call, the inner call should be processed early. There's no sure way to know which choice is\n            // right (only a full unification algorithm can determine that), so we resort to the following heuristic:\n            // If no type arguments are specified in the inner call and at least one call signature is generic and\n            // returns a function type, we choose to defer processing. This narrowly permits function composition\n            // operators to flow inferences through return types, but otherwise processes calls right away. We\n            // use the resolvingSignature singleton to indicate that we deferred processing. This result will be\n            // propagated out and eventually turned into nonInferrableType (a type that is assignable to anything and\n            // from which we never make inferences).\n            if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) {\n                skippedGenericFunction(node, checkMode);\n                return resolvingSignature;\n            }\n            // If the function is explicitly marked with `@class`, then it must be constructed.\n            if (callSignatures.some(function (sig) { return ts.isInJSFile(sig.declaration) && !!ts.getJSDocClassTag(sig.declaration); })) {\n                error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType));\n                return resolveErrorCall(node);\n            }\n            return resolveCall(node, callSignatures, candidatesOutArray, checkMode, callChainFlags);\n        }\n        function isGenericFunctionReturningFunction(signature) {\n            return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature)));\n        }\n        /**\n         * TS 1.0 spec: 4.12\n         * If FuncExpr is of type Any, or of an object type that has no call or construct signatures\n         * but is a subtype of the Function interface, the call is an untyped function call.\n         */\n        function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) {\n            // We exclude union types because we may have a union of function types that happen to have no common signatures.\n            return isTypeAny(funcType) || isTypeAny(apparentFuncType) && !!(funcType.flags & 262144 /* TypeParameter */) ||\n                !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & (1048576 /* Union */ | 131072 /* Never */)) && isTypeAssignableTo(funcType, globalFunctionType);\n        }\n        function resolveNewExpression(node, candidatesOutArray, checkMode) {\n            if (node.arguments && languageVersion < 1 /* ES5 */) {\n                var spreadIndex = getSpreadArgumentIndex(node.arguments);\n                if (spreadIndex >= 0) {\n                    error(node.arguments[spreadIndex], ts.Diagnostics.Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher);\n                }\n            }\n            var expressionType = checkNonNullExpression(node.expression);\n            if (expressionType === silentNeverType) {\n                return silentNeverSignature;\n            }\n            // If expressionType's apparent type(section 3.8.1) is an object type with one or\n            // more construct signatures, the expression is processed in the same manner as a\n            // function call, but using the construct signatures as the initial set of candidate\n            // signatures for overload resolution. The result type of the function call becomes\n            // the result type of the operation.\n            expressionType = getApparentType(expressionType);\n            if (expressionType === errorType) {\n                // Another error has already been reported\n                return resolveErrorCall(node);\n            }\n            // TS 1.0 spec: 4.11\n            // If expressionType is of type Any, Args can be any argument\n            // list and the result of the operation is of type Any.\n            if (isTypeAny(expressionType)) {\n                if (node.typeArguments) {\n                    error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments);\n                }\n                return resolveUntypedCall(node);\n            }\n            // Technically, this signatures list may be incomplete. We are taking the apparent type,\n            // but we are not including construct signatures that may have been added to the Object or\n            // Function interface, since they have none by default. This is a bit of a leap of faith\n            // that the user will not add any.\n            var constructSignatures = getSignaturesOfType(expressionType, 1 /* Construct */);\n            if (constructSignatures.length) {\n                if (!isConstructorAccessible(node, constructSignatures[0])) {\n                    return resolveErrorCall(node);\n                }\n                // If the expression is a class of abstract type, or an abstract construct signature,\n                // then it cannot be instantiated.\n                // In the case of a merged class-module or class-interface declaration,\n                // only the class declaration node will have the Abstract flag set.\n                if (constructSignatures.some(function (signature) { return signature.flags & 4 /* Abstract */; })) {\n                    error(node, ts.Diagnostics.Cannot_create_an_instance_of_an_abstract_class);\n                    return resolveErrorCall(node);\n                }\n                var valueDecl = expressionType.symbol && ts.getClassLikeDeclarationOfSymbol(expressionType.symbol);\n                if (valueDecl && ts.hasSyntacticModifier(valueDecl, 128 /* Abstract */)) {\n                    error(node, ts.Diagnostics.Cannot_create_an_instance_of_an_abstract_class);\n                    return resolveErrorCall(node);\n                }\n                return resolveCall(node, constructSignatures, candidatesOutArray, checkMode, 0 /* None */);\n            }\n            // If expressionType's apparent type is an object type with no construct signatures but\n            // one or more call signatures, the expression is processed as a function call. A compile-time\n            // error occurs if the result of the function call is not Void. The type of the result of the\n            // operation is Any. It is an error to have a Void this type.\n            var callSignatures = getSignaturesOfType(expressionType, 0 /* Call */);\n            if (callSignatures.length) {\n                var signature = resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */);\n                if (!noImplicitAny) {\n                    if (signature.declaration && !isJSConstructor(signature.declaration) && getReturnTypeOfSignature(signature) !== voidType) {\n                        error(node, ts.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword);\n                    }\n                    if (getThisTypeOfSignature(signature) === voidType) {\n                        error(node, ts.Diagnostics.A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void);\n                    }\n                }\n                return signature;\n            }\n            invocationError(node.expression, expressionType, 1 /* Construct */);\n            return resolveErrorCall(node);\n        }\n        function typeHasProtectedAccessibleBase(target, type) {\n            var baseTypes = getBaseTypes(type);\n            if (!ts.length(baseTypes)) {\n                return false;\n            }\n            var firstBase = baseTypes[0];\n            if (firstBase.flags & 2097152 /* Intersection */) {\n                var types = firstBase.types;\n                var mixinFlags = findMixins(types);\n                var i = 0;\n                for (var _i = 0, _a = firstBase.types; _i < _a.length; _i++) {\n                    var intersectionMember = _a[_i];\n                    // We want to ignore mixin ctors\n                    if (!mixinFlags[i]) {\n                        if (ts.getObjectFlags(intersectionMember) & (1 /* Class */ | 2 /* Interface */)) {\n                            if (intersectionMember.symbol === target) {\n                                return true;\n                            }\n                            if (typeHasProtectedAccessibleBase(target, intersectionMember)) {\n                                return true;\n                            }\n                        }\n                    }\n                    i++;\n                }\n                return false;\n            }\n            if (firstBase.symbol === target) {\n                return true;\n            }\n            return typeHasProtectedAccessibleBase(target, firstBase);\n        }\n        function isConstructorAccessible(node, signature) {\n            if (!signature || !signature.declaration) {\n                return true;\n            }\n            var declaration = signature.declaration;\n            var modifiers = ts.getSelectedEffectiveModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */);\n            // (1) Public constructors and (2) constructor functions are always accessible.\n            if (!modifiers || declaration.kind !== 166 /* Constructor */) {\n                return true;\n            }\n            var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol);\n            var declaringClass = getDeclaredTypeOfSymbol(declaration.parent.symbol);\n            // A private or protected constructor can only be instantiated within its own class (or a subclass, for protected)\n            if (!isNodeWithinClass(node, declaringClassDeclaration)) {\n                var containingClass = ts.getContainingClass(node);\n                if (containingClass && modifiers & 16 /* Protected */) {\n                    var containingType = getTypeOfNode(containingClass);\n                    if (typeHasProtectedAccessibleBase(declaration.parent.symbol, containingType)) {\n                        return true;\n                    }\n                }\n                if (modifiers & 8 /* Private */) {\n                    error(node, ts.Diagnostics.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration, typeToString(declaringClass));\n                }\n                if (modifiers & 16 /* Protected */) {\n                    error(node, ts.Diagnostics.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration, typeToString(declaringClass));\n                }\n                return false;\n            }\n            return true;\n        }\n        function invocationErrorDetails(errorTarget, apparentType, kind) {\n            var errorInfo;\n            var isCall = kind === 0 /* Call */;\n            var awaitedType = getAwaitedType(apparentType);\n            var maybeMissingAwait = awaitedType && getSignaturesOfType(awaitedType, kind).length > 0;\n            if (apparentType.flags & 1048576 /* Union */) {\n                var types = apparentType.types;\n                var hasSignatures = false;\n                for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {\n                    var constituent = types_21[_i];\n                    var signatures = getSignaturesOfType(constituent, kind);\n                    if (signatures.length !== 0) {\n                        hasSignatures = true;\n                        if (errorInfo) {\n                            // Bail early if we already have an error, no chance of \"No constituent of type is callable\"\n                            break;\n                        }\n                    }\n                    else {\n                        // Error on the first non callable constituent only\n                        if (!errorInfo) {\n                            errorInfo = ts.chainDiagnosticMessages(errorInfo, isCall ?\n                                ts.Diagnostics.Type_0_has_no_call_signatures :\n                                ts.Diagnostics.Type_0_has_no_construct_signatures, typeToString(constituent));\n                            errorInfo = ts.chainDiagnosticMessages(errorInfo, isCall ?\n                                ts.Diagnostics.Not_all_constituents_of_type_0_are_callable :\n                                ts.Diagnostics.Not_all_constituents_of_type_0_are_constructable, typeToString(apparentType));\n                        }\n                        if (hasSignatures) {\n                            // Bail early if we already found a siganture, no chance of \"No constituent of type is callable\"\n                            break;\n                        }\n                    }\n                }\n                if (!hasSignatures) {\n                    errorInfo = ts.chainDiagnosticMessages(\n                    /* detials */ undefined, isCall ?\n                        ts.Diagnostics.No_constituent_of_type_0_is_callable :\n                        ts.Diagnostics.No_constituent_of_type_0_is_constructable, typeToString(apparentType));\n                }\n                if (!errorInfo) {\n                    errorInfo = ts.chainDiagnosticMessages(errorInfo, isCall ?\n                        ts.Diagnostics.Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other :\n                        ts.Diagnostics.Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other, typeToString(apparentType));\n                }\n            }\n            else {\n                errorInfo = ts.chainDiagnosticMessages(errorInfo, isCall ?\n                    ts.Diagnostics.Type_0_has_no_call_signatures :\n                    ts.Diagnostics.Type_0_has_no_construct_signatures, typeToString(apparentType));\n            }\n            var headMessage = isCall ? ts.Diagnostics.This_expression_is_not_callable : ts.Diagnostics.This_expression_is_not_constructable;\n            // Diagnose get accessors incorrectly called as functions\n            if (ts.isCallExpression(errorTarget.parent) && errorTarget.parent.arguments.length === 0) {\n                var resolvedSymbol = getNodeLinks(errorTarget).resolvedSymbol;\n                if (resolvedSymbol && resolvedSymbol.flags & 32768 /* GetAccessor */) {\n                    headMessage = ts.Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without;\n                }\n            }\n            return {\n                messageChain: ts.chainDiagnosticMessages(errorInfo, headMessage),\n                relatedMessage: maybeMissingAwait ? ts.Diagnostics.Did_you_forget_to_use_await : undefined,\n            };\n        }\n        function invocationError(errorTarget, apparentType, kind, relatedInformation) {\n            var _a = invocationErrorDetails(errorTarget, apparentType, kind), messageChain = _a.messageChain, relatedInfo = _a.relatedMessage;\n            var diagnostic = ts.createDiagnosticForNodeFromMessageChain(errorTarget, messageChain);\n            if (relatedInfo) {\n                ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(errorTarget, relatedInfo));\n            }\n            if (ts.isCallExpression(errorTarget.parent)) {\n                var _b = getDiagnosticSpanForCallNode(errorTarget.parent, /* doNotIncludeArguments */ true), start = _b.start, length_8 = _b.length;\n                diagnostic.start = start;\n                diagnostic.length = length_8;\n            }\n            diagnostics.add(diagnostic);\n            invocationErrorRecovery(apparentType, kind, relatedInformation ? ts.addRelatedInfo(diagnostic, relatedInformation) : diagnostic);\n        }\n        function invocationErrorRecovery(apparentType, kind, diagnostic) {\n            if (!apparentType.symbol) {\n                return;\n            }\n            var importNode = getSymbolLinks(apparentType.symbol).originatingImport;\n            // Create a diagnostic on the originating import if possible onto which we can attach a quickfix\n            //  An import call expression cannot be rewritten into another form to correct the error - the only solution is to use `.default` at the use-site\n            if (importNode && !ts.isImportCall(importNode)) {\n                var sigs = getSignaturesOfType(getTypeOfSymbol(getSymbolLinks(apparentType.symbol).target), kind);\n                if (!sigs || !sigs.length)\n                    return;\n                ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(importNode, ts.Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead));\n            }\n        }\n        function resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode) {\n            var tagType = checkExpression(node.tag);\n            var apparentType = getApparentType(tagType);\n            if (apparentType === errorType) {\n                // Another error has already been reported\n                return resolveErrorCall(node);\n            }\n            var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */);\n            var numConstructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */).length;\n            if (isUntypedFunctionCall(tagType, apparentType, callSignatures.length, numConstructSignatures)) {\n                return resolveUntypedCall(node);\n            }\n            if (!callSignatures.length) {\n                if (ts.isArrayLiteralExpression(node.parent)) {\n                    var diagnostic = ts.createDiagnosticForNode(node.tag, ts.Diagnostics.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked);\n                    diagnostics.add(diagnostic);\n                    return resolveErrorCall(node);\n                }\n                invocationError(node.tag, apparentType, 0 /* Call */);\n                return resolveErrorCall(node);\n            }\n            return resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */);\n        }\n        /**\n         * Gets the localized diagnostic head message to use for errors when resolving a decorator as a call expression.\n         */\n        function getDiagnosticHeadMessageForDecoratorResolution(node) {\n            switch (node.parent.kind) {\n                case 252 /* ClassDeclaration */:\n                case 221 /* ClassExpression */:\n                    return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;\n                case 160 /* Parameter */:\n                    return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;\n                case 163 /* PropertyDeclaration */:\n                    return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;\n                case 165 /* MethodDeclaration */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;\n                default:\n                    return ts.Debug.fail();\n            }\n        }\n        /**\n         * Resolves a decorator as if it were a call expression.\n         */\n        function resolveDecorator(node, candidatesOutArray, checkMode) {\n            var funcType = checkExpression(node.expression);\n            var apparentType = getApparentType(funcType);\n            if (apparentType === errorType) {\n                return resolveErrorCall(node);\n            }\n            var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */);\n            var numConstructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */).length;\n            if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) {\n                return resolveUntypedCall(node);\n            }\n            if (isPotentiallyUncalledDecorator(node, callSignatures)) {\n                var nodeStr = ts.getTextOfNode(node.expression, /*includeTrivia*/ false);\n                error(node, ts.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0, nodeStr);\n                return resolveErrorCall(node);\n            }\n            var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);\n            if (!callSignatures.length) {\n                var errorDetails = invocationErrorDetails(node.expression, apparentType, 0 /* Call */);\n                var messageChain = ts.chainDiagnosticMessages(errorDetails.messageChain, headMessage);\n                var diag = ts.createDiagnosticForNodeFromMessageChain(node.expression, messageChain);\n                if (errorDetails.relatedMessage) {\n                    ts.addRelatedInfo(diag, ts.createDiagnosticForNode(node.expression, errorDetails.relatedMessage));\n                }\n                diagnostics.add(diag);\n                invocationErrorRecovery(apparentType, 0 /* Call */, diag);\n                return resolveErrorCall(node);\n            }\n            return resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */, headMessage);\n        }\n        function createSignatureForJSXIntrinsic(node, result) {\n            var namespace = getJsxNamespaceAt(node);\n            var exports = namespace && getExportsOfSymbol(namespace);\n            // We fake up a SFC signature for each intrinsic, however a more specific per-element signature drawn from the JSX declaration\n            // file would probably be preferable.\n            var typeSymbol = exports && getSymbol(exports, JsxNames.Element, 788968 /* Type */);\n            var returnNode = typeSymbol && nodeBuilder.symbolToEntityName(typeSymbol, 788968 /* Type */, node);\n            var declaration = ts.factory.createFunctionTypeNode(/*typeParameters*/ undefined, [ts.factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotdotdot*/ undefined, \"props\", /*questionMark*/ undefined, nodeBuilder.typeToTypeNode(result, node))], returnNode ? ts.factory.createTypeReferenceNode(returnNode, /*typeArguments*/ undefined) : ts.factory.createKeywordTypeNode(128 /* AnyKeyword */));\n            var parameterSymbol = createSymbol(1 /* FunctionScopedVariable */, \"props\");\n            parameterSymbol.type = result;\n            return createSignature(declaration, \n            /*typeParameters*/ undefined, \n            /*thisParameter*/ undefined, [parameterSymbol], typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : errorType, \n            /*returnTypePredicate*/ undefined, 1, 0 /* None */);\n        }\n        function resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode) {\n            if (isJsxIntrinsicIdentifier(node.tagName)) {\n                var result = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node);\n                var fakeSignature = createSignatureForJSXIntrinsic(node, result);\n                checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), /*mapper*/ undefined, 0 /* Normal */), result, node.tagName, node.attributes);\n                if (ts.length(node.typeArguments)) {\n                    ts.forEach(node.typeArguments, checkSourceElement);\n                    diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), node.typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, 0, ts.length(node.typeArguments)));\n                }\n                return fakeSignature;\n            }\n            var exprTypes = checkExpression(node.tagName);\n            var apparentType = getApparentType(exprTypes);\n            if (apparentType === errorType) {\n                return resolveErrorCall(node);\n            }\n            var signatures = getUninstantiatedJsxSignaturesOfType(exprTypes, node);\n            if (isUntypedFunctionCall(exprTypes, apparentType, signatures.length, /*constructSignatures*/ 0)) {\n                return resolveUntypedCall(node);\n            }\n            if (signatures.length === 0) {\n                // We found no signatures at all, which is an error\n                error(node.tagName, ts.Diagnostics.JSX_element_type_0_does_not_have_any_construct_or_call_signatures, ts.getTextOfNode(node.tagName));\n                return resolveErrorCall(node);\n            }\n            return resolveCall(node, signatures, candidatesOutArray, checkMode, 0 /* None */);\n        }\n        /**\n         * Sometimes, we have a decorator that could accept zero arguments,\n         * but is receiving too many arguments as part of the decorator invocation.\n         * In those cases, a user may have meant to *call* the expression before using it as a decorator.\n         */\n        function isPotentiallyUncalledDecorator(decorator, signatures) {\n            return signatures.length && ts.every(signatures, function (signature) {\n                return signature.minArgumentCount === 0 &&\n                    !signatureHasRestParameter(signature) &&\n                    signature.parameters.length < getDecoratorArgumentCount(decorator, signature);\n            });\n        }\n        function resolveSignature(node, candidatesOutArray, checkMode) {\n            switch (node.kind) {\n                case 203 /* CallExpression */:\n                    return resolveCallExpression(node, candidatesOutArray, checkMode);\n                case 204 /* NewExpression */:\n                    return resolveNewExpression(node, candidatesOutArray, checkMode);\n                case 205 /* TaggedTemplateExpression */:\n                    return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode);\n                case 161 /* Decorator */:\n                    return resolveDecorator(node, candidatesOutArray, checkMode);\n                case 275 /* JsxOpeningElement */:\n                case 274 /* JsxSelfClosingElement */:\n                    return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode);\n            }\n            throw ts.Debug.assertNever(node, \"Branch in 'resolveSignature' should be unreachable.\");\n        }\n        /**\n         * Resolve a signature of a given call-like expression.\n         * @param node a call-like expression to try resolve a signature for\n         * @param candidatesOutArray an array of signature to be filled in by the function. It is passed by signature help in the language service;\n         *                           the function will fill it up with appropriate candidate signatures\n         * @return a signature of the call-like expression or undefined if one can't be found\n         */\n        function getResolvedSignature(node, candidatesOutArray, checkMode) {\n            var links = getNodeLinks(node);\n            // If getResolvedSignature has already been called, we will have cached the resolvedSignature.\n            // However, it is possible that either candidatesOutArray was not passed in the first time,\n            // or that a different candidatesOutArray was passed in. Therefore, we need to redo the work\n            // to correctly fill the candidatesOutArray.\n            var cached = links.resolvedSignature;\n            if (cached && cached !== resolvingSignature && !candidatesOutArray) {\n                return cached;\n            }\n            links.resolvedSignature = resolvingSignature;\n            var result = resolveSignature(node, candidatesOutArray, checkMode || 0 /* Normal */);\n            // When CheckMode.SkipGenericFunctions is set we use resolvingSignature to indicate that call\n            // resolution should be deferred.\n            if (result !== resolvingSignature) {\n                // If signature resolution originated in control flow type analysis (for example to compute the\n                // assigned type in a flow assignment) we don't cache the result as it may be based on temporary\n                // types from the control flow analysis.\n                links.resolvedSignature = flowLoopStart === flowLoopCount ? result : cached;\n            }\n            return result;\n        }\n        /**\n         * Indicates whether a declaration can be treated as a constructor in a JavaScript\n         * file.\n         */\n        function isJSConstructor(node) {\n            var _a;\n            if (!node || !ts.isInJSFile(node)) {\n                return false;\n            }\n            var func = ts.isFunctionDeclaration(node) || ts.isFunctionExpression(node) ? node :\n                ts.isVariableDeclaration(node) && node.initializer && ts.isFunctionExpression(node.initializer) ? node.initializer :\n                    undefined;\n            if (func) {\n                // If the node has a @class tag, treat it like a constructor.\n                if (ts.getJSDocClassTag(node))\n                    return true;\n                // If the symbol of the node has members, treat it like a constructor.\n                var symbol = getSymbolOfNode(func);\n                return !!((_a = symbol === null || symbol === void 0 ? void 0 : symbol.members) === null || _a === void 0 ? void 0 : _a.size);\n            }\n            return false;\n        }\n        function mergeJSSymbols(target, source) {\n            var _a, _b;\n            if (source) {\n                var links = getSymbolLinks(source);\n                if (!links.inferredClassSymbol || !links.inferredClassSymbol.has(getSymbolId(target))) {\n                    var inferred = ts.isTransientSymbol(target) ? target : cloneSymbol(target);\n                    inferred.exports = inferred.exports || ts.createSymbolTable();\n                    inferred.members = inferred.members || ts.createSymbolTable();\n                    inferred.flags |= source.flags & 32 /* Class */;\n                    if ((_a = source.exports) === null || _a === void 0 ? void 0 : _a.size) {\n                        mergeSymbolTable(inferred.exports, source.exports);\n                    }\n                    if ((_b = source.members) === null || _b === void 0 ? void 0 : _b.size) {\n                        mergeSymbolTable(inferred.members, source.members);\n                    }\n                    (links.inferredClassSymbol || (links.inferredClassSymbol = new ts.Map())).set(getSymbolId(inferred), inferred);\n                    return inferred;\n                }\n                return links.inferredClassSymbol.get(getSymbolId(target));\n            }\n        }\n        function getAssignedClassSymbol(decl) {\n            var _a;\n            var assignmentSymbol = decl && getSymbolOfExpando(decl, /*allowDeclaration*/ true);\n            var prototype = (_a = assignmentSymbol === null || assignmentSymbol === void 0 ? void 0 : assignmentSymbol.exports) === null || _a === void 0 ? void 0 : _a.get(\"prototype\");\n            var init = (prototype === null || prototype === void 0 ? void 0 : prototype.valueDeclaration) && getAssignedJSPrototype(prototype.valueDeclaration);\n            return init ? getSymbolOfNode(init) : undefined;\n        }\n        function getSymbolOfExpando(node, allowDeclaration) {\n            if (!node.parent) {\n                return undefined;\n            }\n            var name;\n            var decl;\n            if (ts.isVariableDeclaration(node.parent) && node.parent.initializer === node) {\n                if (!ts.isInJSFile(node) && !(ts.isVarConst(node.parent) && ts.isFunctionLikeDeclaration(node))) {\n                    return undefined;\n                }\n                name = node.parent.name;\n                decl = node.parent;\n            }\n            else if (ts.isBinaryExpression(node.parent)) {\n                var parentNode = node.parent;\n                var parentNodeOperator = node.parent.operatorToken.kind;\n                if (parentNodeOperator === 62 /* EqualsToken */ && (allowDeclaration || parentNode.right === node)) {\n                    name = parentNode.left;\n                    decl = name;\n                }\n                else if (parentNodeOperator === 56 /* BarBarToken */ || parentNodeOperator === 60 /* QuestionQuestionToken */) {\n                    if (ts.isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) {\n                        name = parentNode.parent.name;\n                        decl = parentNode.parent;\n                    }\n                    else if (ts.isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 62 /* EqualsToken */ && (allowDeclaration || parentNode.parent.right === parentNode)) {\n                        name = parentNode.parent.left;\n                        decl = name;\n                    }\n                    if (!name || !ts.isBindableStaticNameExpression(name) || !ts.isSameEntityName(name, parentNode.left)) {\n                        return undefined;\n                    }\n                }\n            }\n            else if (allowDeclaration && ts.isFunctionDeclaration(node)) {\n                name = node.name;\n                decl = node;\n            }\n            if (!decl || !name || (!allowDeclaration && !ts.getExpandoInitializer(node, ts.isPrototypeAccess(name)))) {\n                return undefined;\n            }\n            return getSymbolOfNode(decl);\n        }\n        function getAssignedJSPrototype(node) {\n            if (!node.parent) {\n                return false;\n            }\n            var parent = node.parent;\n            while (parent && parent.kind === 201 /* PropertyAccessExpression */) {\n                parent = parent.parent;\n            }\n            if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) {\n                var right = ts.getInitializerOfBinaryExpression(parent);\n                return ts.isObjectLiteralExpression(right) && right;\n            }\n        }\n        /**\n         * Syntactically and semantically checks a call or new expression.\n         * @param node The call/new expression to be checked.\n         * @returns On success, the expression's signature's return type. On failure, anyType.\n         */\n        function checkCallExpression(node, checkMode) {\n            var _a;\n            if (!checkGrammarTypeArguments(node, node.typeArguments))\n                checkGrammarArguments(node.arguments);\n            var signature = getResolvedSignature(node, /*candidatesOutArray*/ undefined, checkMode);\n            if (signature === resolvingSignature) {\n                // CheckMode.SkipGenericFunctions is enabled and this is a call to a generic function that\n                // returns a function type. We defer checking and return nonInferrableType.\n                return nonInferrableType;\n            }\n            checkDeprecatedSignature(signature, node);\n            if (node.expression.kind === 105 /* SuperKeyword */) {\n                return voidType;\n            }\n            if (node.kind === 204 /* NewExpression */) {\n                var declaration = signature.declaration;\n                if (declaration &&\n                    declaration.kind !== 166 /* Constructor */ &&\n                    declaration.kind !== 170 /* ConstructSignature */ &&\n                    declaration.kind !== 175 /* ConstructorType */ &&\n                    !ts.isJSDocConstructSignature(declaration) &&\n                    !isJSConstructor(declaration)) {\n                    // When resolved signature is a call signature (and not a construct signature) the result type is any\n                    if (noImplicitAny) {\n                        error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type);\n                    }\n                    return anyType;\n                }\n            }\n            // In JavaScript files, calls to any identifier 'require' are treated as external module imports\n            if (ts.isInJSFile(node) && isCommonJsRequire(node)) {\n                return resolveExternalModuleTypeByLiteral(node.arguments[0]);\n            }\n            var returnType = getReturnTypeOfSignature(signature);\n            // Treat any call to the global 'Symbol' function that is part of a const variable or readonly property\n            // as a fresh unique symbol literal type.\n            if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) {\n                return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent));\n            }\n            if (node.kind === 203 /* CallExpression */ && !node.questionDotToken && node.parent.kind === 233 /* ExpressionStatement */ &&\n                returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) {\n                if (!ts.isDottedName(node.expression)) {\n                    error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name);\n                }\n                else if (!getEffectsSignature(node)) {\n                    var diagnostic = error(node.expression, ts.Diagnostics.Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation);\n                    getTypeOfDottedName(node.expression, diagnostic);\n                }\n            }\n            if (ts.isInJSFile(node)) {\n                var jsSymbol = getSymbolOfExpando(node, /*allowDeclaration*/ false);\n                if ((_a = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a === void 0 ? void 0 : _a.size) {\n                    var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, undefined, undefined);\n                    jsAssignmentType.objectFlags |= 16384 /* JSLiteral */;\n                    return getIntersectionType([returnType, jsAssignmentType]);\n                }\n            }\n            return returnType;\n        }\n        function checkDeprecatedSignature(signature, node) {\n            if (signature.declaration && signature.declaration.flags & 134217728 /* Deprecated */) {\n                var suggestionNode = getDeprecatedSuggestionNode(node);\n                var name = ts.tryGetPropertyAccessOrIdentifierToString(ts.getInvokedExpression(node));\n                addDeprecatedSuggestionWithSignature(suggestionNode, signature.declaration, name, signatureToString(signature));\n            }\n        }\n        function getDeprecatedSuggestionNode(node) {\n            node = ts.skipParentheses(node);\n            switch (node.kind) {\n                case 203 /* CallExpression */:\n                case 161 /* Decorator */:\n                case 204 /* NewExpression */:\n                    return getDeprecatedSuggestionNode(node.expression);\n                case 205 /* TaggedTemplateExpression */:\n                    return getDeprecatedSuggestionNode(node.tag);\n                case 275 /* JsxOpeningElement */:\n                case 274 /* JsxSelfClosingElement */:\n                    return getDeprecatedSuggestionNode(node.tagName);\n                case 202 /* ElementAccessExpression */:\n                    return node.argumentExpression;\n                case 201 /* PropertyAccessExpression */:\n                    return node.name;\n                case 173 /* TypeReference */:\n                    var typeReference = node;\n                    return ts.isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference;\n                default:\n                    return node;\n            }\n        }\n        function isSymbolOrSymbolForCall(node) {\n            if (!ts.isCallExpression(node))\n                return false;\n            var left = node.expression;\n            if (ts.isPropertyAccessExpression(left) && left.name.escapedText === \"for\") {\n                left = left.expression;\n            }\n            if (!ts.isIdentifier(left) || left.escapedText !== \"Symbol\") {\n                return false;\n            }\n            // make sure `Symbol` is the global symbol\n            var globalESSymbol = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ false);\n            if (!globalESSymbol) {\n                return false;\n            }\n            return globalESSymbol === resolveName(left, \"Symbol\", 111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false);\n        }\n        function checkImportCallExpression(node) {\n            // Check grammar of dynamic import\n            if (!checkGrammarArguments(node.arguments))\n                checkGrammarImportCallExpression(node);\n            if (node.arguments.length === 0) {\n                return createPromiseReturnType(node, anyType);\n            }\n            var specifier = node.arguments[0];\n            var specifierType = checkExpressionCached(specifier);\n            // Even though multiple arguments is grammatically incorrect, type-check extra arguments for completion\n            for (var i = 1; i < node.arguments.length; ++i) {\n                checkExpressionCached(node.arguments[i]);\n            }\n            if (specifierType.flags & 32768 /* Undefined */ || specifierType.flags & 65536 /* Null */ || !isTypeAssignableTo(specifierType, stringType)) {\n                error(specifier, ts.Diagnostics.Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0, typeToString(specifierType));\n            }\n            // resolveExternalModuleName will return undefined if the moduleReferenceExpression is not a string literal\n            var moduleSymbol = resolveExternalModuleName(node, specifier);\n            if (moduleSymbol) {\n                var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, /*dontRecursivelyResolve*/ true, /*suppressUsageError*/ false);\n                if (esModuleSymbol) {\n                    return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol));\n                }\n            }\n            return createPromiseReturnType(node, anyType);\n        }\n        function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol) {\n            if (allowSyntheticDefaultImports && type && type !== errorType) {\n                var synthType = type;\n                if (!synthType.syntheticType) {\n                    var file = ts.find(originalSymbol.declarations, ts.isSourceFile);\n                    var hasSyntheticDefault = canHaveSyntheticDefault(file, originalSymbol, /*dontResolveAlias*/ false);\n                    if (hasSyntheticDefault) {\n                        var memberTable = ts.createSymbolTable();\n                        var newSymbol = createSymbol(2097152 /* Alias */, \"default\" /* Default */);\n                        newSymbol.parent = originalSymbol;\n                        newSymbol.nameType = getLiteralType(\"default\");\n                        newSymbol.target = resolveSymbol(symbol);\n                        memberTable.set(\"default\" /* Default */, newSymbol);\n                        var anonymousSymbol = createSymbol(2048 /* TypeLiteral */, \"__type\" /* Type */);\n                        var defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined);\n                        anonymousSymbol.type = defaultContainingObject;\n                        synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, /*objectFlags*/ 0, /*readonly*/ false) : defaultContainingObject;\n                    }\n                    else {\n                        synthType.syntheticType = type;\n                    }\n                }\n                return synthType.syntheticType;\n            }\n            return type;\n        }\n        function isCommonJsRequire(node) {\n            if (!ts.isRequireCall(node, /*checkArgumentIsStringLiteralLike*/ true)) {\n                return false;\n            }\n            // Make sure require is not a local function\n            if (!ts.isIdentifier(node.expression))\n                return ts.Debug.fail();\n            var resolvedRequire = resolveName(node.expression, node.expression.escapedText, 111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true); // TODO: GH#18217\n            if (resolvedRequire === requireSymbol) {\n                return true;\n            }\n            // project includes symbol named 'require' - make sure that it is ambient and local non-alias\n            if (resolvedRequire.flags & 2097152 /* Alias */) {\n                return false;\n            }\n            var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */\n                ? 251 /* FunctionDeclaration */\n                : resolvedRequire.flags & 3 /* Variable */\n                    ? 249 /* VariableDeclaration */\n                    : 0 /* Unknown */;\n            if (targetDeclarationKind !== 0 /* Unknown */) {\n                var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind);\n                // function/variable declaration should be ambient\n                return !!decl && !!(decl.flags & 8388608 /* Ambient */);\n            }\n            return false;\n        }\n        function checkTaggedTemplateExpression(node) {\n            if (!checkGrammarTaggedTemplateChain(node))\n                checkGrammarTypeArguments(node, node.typeArguments);\n            if (languageVersion < 2 /* ES2015 */) {\n                checkExternalEmitHelpers(node, 262144 /* MakeTemplateObject */);\n            }\n            var signature = getResolvedSignature(node);\n            checkDeprecatedSignature(signature, node);\n            return getReturnTypeOfSignature(signature);\n        }\n        function checkAssertion(node) {\n            return checkAssertionWorker(node, node.type, node.expression);\n        }\n        function isValidConstAssertionArgument(node) {\n            switch (node.kind) {\n                case 10 /* StringLiteral */:\n                case 14 /* NoSubstitutionTemplateLiteral */:\n                case 8 /* NumericLiteral */:\n                case 9 /* BigIntLiteral */:\n                case 109 /* TrueKeyword */:\n                case 94 /* FalseKeyword */:\n                case 199 /* ArrayLiteralExpression */:\n                case 200 /* ObjectLiteralExpression */:\n                case 218 /* TemplateExpression */:\n                    return true;\n                case 207 /* ParenthesizedExpression */:\n                    return isValidConstAssertionArgument(node.expression);\n                case 214 /* PrefixUnaryExpression */:\n                    var op = node.operator;\n                    var arg = node.operand;\n                    return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) ||\n                        op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */;\n                case 201 /* PropertyAccessExpression */:\n                case 202 /* ElementAccessExpression */:\n                    var expr = node.expression;\n                    if (ts.isIdentifier(expr)) {\n                        var symbol = getSymbolAtLocation(expr);\n                        if (symbol && symbol.flags & 2097152 /* Alias */) {\n                            symbol = resolveAlias(symbol);\n                        }\n                        return !!(symbol && (symbol.flags & 384 /* Enum */) && getEnumKind(symbol) === 1 /* Literal */);\n                    }\n            }\n            return false;\n        }\n        function checkAssertionWorker(errNode, type, expression, checkMode) {\n            var exprType = checkExpression(expression, checkMode);\n            if (ts.isConstTypeReference(type)) {\n                if (!isValidConstAssertionArgument(expression)) {\n                    error(expression, ts.Diagnostics.A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals);\n                }\n                return getRegularTypeOfLiteralType(exprType);\n            }\n            checkSourceElement(type);\n            exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(exprType));\n            var targetType = getTypeFromTypeNode(type);\n            if (produceDiagnostics && targetType !== errorType) {\n                var widenedType = getWidenedType(exprType);\n                if (!isTypeComparableTo(targetType, widenedType)) {\n                    checkTypeComparableTo(exprType, targetType, errNode, ts.Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first);\n                }\n            }\n            return targetType;\n        }\n        function checkNonNullChain(node) {\n            var leftType = checkExpression(node.expression);\n            var nonOptionalType = getOptionalExpressionType(leftType, node.expression);\n            return propagateOptionalTypeMarker(getNonNullableType(nonOptionalType), node, nonOptionalType !== leftType);\n        }\n        function checkNonNullAssertion(node) {\n            return node.flags & 32 /* OptionalChain */ ? checkNonNullChain(node) :\n                getNonNullableType(checkExpression(node.expression));\n        }\n        function checkMetaProperty(node) {\n            checkGrammarMetaProperty(node);\n            if (node.keywordToken === 102 /* NewKeyword */) {\n                return checkNewTargetMetaProperty(node);\n            }\n            if (node.keywordToken === 99 /* ImportKeyword */) {\n                return checkImportMetaProperty(node);\n            }\n            return ts.Debug.assertNever(node.keywordToken);\n        }\n        function checkNewTargetMetaProperty(node) {\n            var container = ts.getNewTargetContainer(node);\n            if (!container) {\n                error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, \"new.target\");\n                return errorType;\n            }\n            else if (container.kind === 166 /* Constructor */) {\n                var symbol = getSymbolOfNode(container.parent);\n                return getTypeOfSymbol(symbol);\n            }\n            else {\n                var symbol = getSymbolOfNode(container);\n                return getTypeOfSymbol(symbol);\n            }\n        }\n        function checkImportMetaProperty(node) {\n            if (moduleKind !== ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) {\n                error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system);\n            }\n            var file = ts.getSourceFileOfNode(node);\n            ts.Debug.assert(!!(file.flags & 2097152 /* PossiblyContainsImportMeta */), \"Containing file is missing import meta node flag.\");\n            ts.Debug.assert(!!file.externalModuleIndicator, \"Containing file should be a module.\");\n            return node.name.escapedText === \"meta\" ? getGlobalImportMetaType() : errorType;\n        }\n        function getTypeOfParameter(symbol) {\n            var type = getTypeOfSymbol(symbol);\n            if (strictNullChecks) {\n                var declaration = symbol.valueDeclaration;\n                if (declaration && ts.hasInitializer(declaration)) {\n                    return getOptionalType(type);\n                }\n            }\n            return type;\n        }\n        function getTupleElementLabel(d) {\n            ts.Debug.assert(ts.isIdentifier(d.name)); // Parameter declarations could be binding patterns, but we only allow identifier names\n            return d.name.escapedText;\n        }\n        function getParameterNameAtPosition(signature, pos, overrideRestType) {\n            var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);\n            if (pos < paramCount) {\n                return signature.parameters[pos].escapedName;\n            }\n            var restParameter = signature.parameters[paramCount] || unknownSymbol;\n            var restType = overrideRestType || getTypeOfSymbol(restParameter);\n            if (isTupleType(restType)) {\n                var associatedNames = restType.target.labeledElementDeclarations;\n                var index = pos - paramCount;\n                return associatedNames && getTupleElementLabel(associatedNames[index]) || restParameter.escapedName + \"_\" + index;\n            }\n            return restParameter.escapedName;\n        }\n        function isValidDeclarationForTupleLabel(d) {\n            return d.kind === 192 /* NamedTupleMember */ || (ts.isParameter(d) && d.name && ts.isIdentifier(d.name));\n        }\n        function getNameableDeclarationAtPosition(signature, pos) {\n            var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);\n            if (pos < paramCount) {\n                var decl = signature.parameters[pos].valueDeclaration;\n                return decl && isValidDeclarationForTupleLabel(decl) ? decl : undefined;\n            }\n            var restParameter = signature.parameters[paramCount] || unknownSymbol;\n            var restType = getTypeOfSymbol(restParameter);\n            if (isTupleType(restType)) {\n                var associatedNames = restType.target.labeledElementDeclarations;\n                var index = pos - paramCount;\n                return associatedNames && associatedNames[index];\n            }\n            return restParameter.valueDeclaration && isValidDeclarationForTupleLabel(restParameter.valueDeclaration) ? restParameter.valueDeclaration : undefined;\n        }\n        function getTypeAtPosition(signature, pos) {\n            return tryGetTypeAtPosition(signature, pos) || anyType;\n        }\n        function tryGetTypeAtPosition(signature, pos) {\n            var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);\n            if (pos < paramCount) {\n                return getTypeOfParameter(signature.parameters[pos]);\n            }\n            if (signatureHasRestParameter(signature)) {\n                // We want to return the value undefined for an out of bounds parameter position,\n                // so we need to check bounds here before calling getIndexedAccessType (which\n                // otherwise would return the type 'undefined').\n                var restType = getTypeOfSymbol(signature.parameters[paramCount]);\n                var index = pos - paramCount;\n                if (!isTupleType(restType) || restType.target.hasRestElement || index < restType.target.fixedLength) {\n                    return getIndexedAccessType(restType, getLiteralType(index));\n                }\n            }\n            return undefined;\n        }\n        function getRestTypeAtPosition(source, pos) {\n            var parameterCount = getParameterCount(source);\n            var minArgumentCount = getMinArgumentCount(source);\n            var restType = getEffectiveRestType(source);\n            if (restType && pos >= parameterCount - 1) {\n                return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType));\n            }\n            var types = [];\n            var flags = [];\n            var names = [];\n            for (var i = pos; i < parameterCount; i++) {\n                if (!restType || i < parameterCount - 1) {\n                    types.push(getTypeAtPosition(source, i));\n                    flags.push(i < minArgumentCount ? 1 /* Required */ : 2 /* Optional */);\n                }\n                else {\n                    types.push(restType);\n                    flags.push(8 /* Variadic */);\n                }\n                var name = getNameableDeclarationAtPosition(source, i);\n                if (name) {\n                    names.push(name);\n                }\n            }\n            return createTupleType(types, flags, /*readonly*/ false, ts.length(names) === ts.length(types) ? names : undefined);\n        }\n        // Return the number of parameters in a signature. The rest parameter, if present, counts as one\n        // parameter. For example, the parameter count of (x: number, y: number, ...z: string[]) is 3 and\n        // the parameter count of (x: number, ...args: [number, ...string[], boolean])) is also 3. In the\n        // latter example, the effective rest type is [...string[], boolean].\n        function getParameterCount(signature) {\n            var length = signature.parameters.length;\n            if (signatureHasRestParameter(signature)) {\n                var restType = getTypeOfSymbol(signature.parameters[length - 1]);\n                if (isTupleType(restType)) {\n                    return length + restType.target.fixedLength - (restType.target.hasRestElement ? 0 : 1);\n                }\n            }\n            return length;\n        }\n        function getMinArgumentCount(signature, flags) {\n            var strongArityForUntypedJS = flags & 1 /* StrongArityForUntypedJS */;\n            var voidIsNonOptional = flags & 2 /* VoidIsNonOptional */;\n            if (voidIsNonOptional || signature.resolvedMinArgumentCount === undefined) {\n                var minArgumentCount = void 0;\n                if (signatureHasRestParameter(signature)) {\n                    var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]);\n                    if (isTupleType(restType)) {\n                        var firstOptionalIndex = ts.findIndex(restType.target.elementFlags, function (f) { return !(f & 1 /* Required */); });\n                        var requiredCount = firstOptionalIndex < 0 ? restType.target.fixedLength : firstOptionalIndex;\n                        if (requiredCount > 0) {\n                            minArgumentCount = signature.parameters.length - 1 + requiredCount;\n                        }\n                    }\n                }\n                if (minArgumentCount === undefined) {\n                    if (!strongArityForUntypedJS && signature.flags & 32 /* IsUntypedSignatureInJSFile */) {\n                        return 0;\n                    }\n                    minArgumentCount = signature.minArgumentCount;\n                }\n                if (voidIsNonOptional) {\n                    return minArgumentCount;\n                }\n                for (var i = minArgumentCount - 1; i >= 0; i--) {\n                    var type = getTypeAtPosition(signature, i);\n                    if (filterType(type, acceptsVoid).flags & 131072 /* Never */) {\n                        break;\n                    }\n                    minArgumentCount = i;\n                }\n                signature.resolvedMinArgumentCount = minArgumentCount;\n            }\n            return signature.resolvedMinArgumentCount;\n        }\n        function hasEffectiveRestParameter(signature) {\n            if (signatureHasRestParameter(signature)) {\n                var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]);\n                return !isTupleType(restType) || restType.target.hasRestElement;\n            }\n            return false;\n        }\n        function getEffectiveRestType(signature) {\n            if (signatureHasRestParameter(signature)) {\n                var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]);\n                if (!isTupleType(restType)) {\n                    return restType;\n                }\n                if (restType.target.hasRestElement) {\n                    return sliceTupleType(restType, restType.target.fixedLength);\n                }\n            }\n            return undefined;\n        }\n        function getNonArrayRestType(signature) {\n            var restType = getEffectiveRestType(signature);\n            return restType && !isArrayType(restType) && !isTypeAny(restType) && (getReducedType(restType).flags & 131072 /* Never */) === 0 ? restType : undefined;\n        }\n        function getTypeOfFirstParameterOfSignature(signature) {\n            return getTypeOfFirstParameterOfSignatureWithFallback(signature, neverType);\n        }\n        function getTypeOfFirstParameterOfSignatureWithFallback(signature, fallbackType) {\n            return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : fallbackType;\n        }\n        function inferFromAnnotatedParameters(signature, context, inferenceContext) {\n            var len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);\n            for (var i = 0; i < len; i++) {\n                var declaration = signature.parameters[i].valueDeclaration;\n                if (declaration.type) {\n                    var typeNode = ts.getEffectiveTypeAnnotationNode(declaration);\n                    if (typeNode) {\n                        inferTypes(inferenceContext.inferences, getTypeFromTypeNode(typeNode), getTypeAtPosition(context, i));\n                    }\n                }\n            }\n            var restType = getEffectiveRestType(context);\n            if (restType && restType.flags & 262144 /* TypeParameter */) {\n                // The contextual signature has a generic rest parameter. We first instantiate the contextual\n                // signature (without fixing type parameters) and assign types to contextually typed parameters.\n                var instantiatedContext = instantiateSignature(context, inferenceContext.nonFixingMapper);\n                assignContextualParameterTypes(signature, instantiatedContext);\n                // We then infer from a tuple type representing the parameters that correspond to the contextual\n                // rest parameter.\n                var restPos = getParameterCount(context) - 1;\n                inferTypes(inferenceContext.inferences, getRestTypeAtPosition(signature, restPos), restType);\n            }\n        }\n        function assignContextualParameterTypes(signature, context) {\n            signature.typeParameters = context.typeParameters;\n            if (context.thisParameter) {\n                var parameter = signature.thisParameter;\n                if (!parameter || parameter.valueDeclaration && !parameter.valueDeclaration.type) {\n                    if (!parameter) {\n                        signature.thisParameter = createSymbolWithType(context.thisParameter, /*type*/ undefined);\n                    }\n                    assignParameterType(signature.thisParameter, getTypeOfSymbol(context.thisParameter));\n                }\n            }\n            var len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);\n            for (var i = 0; i < len; i++) {\n                var parameter = signature.parameters[i];\n                if (!ts.getEffectiveTypeAnnotationNode(parameter.valueDeclaration)) {\n                    var contextualParameterType = tryGetTypeAtPosition(context, i);\n                    assignParameterType(parameter, contextualParameterType);\n                }\n            }\n            if (signatureHasRestParameter(signature)) {\n                // parameter might be a transient symbol generated by use of `arguments` in the function body.\n                var parameter = ts.last(signature.parameters);\n                if (ts.isTransientSymbol(parameter) || !ts.getEffectiveTypeAnnotationNode(parameter.valueDeclaration)) {\n                    var contextualParameterType = getRestTypeAtPosition(context, len);\n                    assignParameterType(parameter, contextualParameterType);\n                }\n            }\n        }\n        function assignNonContextualParameterTypes(signature) {\n            if (signature.thisParameter) {\n                assignParameterType(signature.thisParameter);\n            }\n            for (var _i = 0, _a = signature.parameters; _i < _a.length; _i++) {\n                var parameter = _a[_i];\n                assignParameterType(parameter);\n            }\n        }\n        function assignParameterType(parameter, type) {\n            var links = getSymbolLinks(parameter);\n            if (!links.type) {\n                var declaration = parameter.valueDeclaration;\n                links.type = type || getWidenedTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true);\n                if (declaration.name.kind !== 78 /* Identifier */) {\n                    // if inference didn't come up with anything but unknown, fall back to the binding pattern if present.\n                    if (links.type === unknownType) {\n                        links.type = getTypeFromBindingPattern(declaration.name);\n                    }\n                    assignBindingElementTypes(declaration.name);\n                }\n            }\n        }\n        // When contextual typing assigns a type to a parameter that contains a binding pattern, we also need to push\n        // the destructured type into the contained binding elements.\n        function assignBindingElementTypes(pattern) {\n            for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {\n                var element = _a[_i];\n                if (!ts.isOmittedExpression(element)) {\n                    if (element.name.kind === 78 /* Identifier */) {\n                        getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);\n                    }\n                    else {\n                        assignBindingElementTypes(element.name);\n                    }\n                }\n            }\n        }\n        function createPromiseType(promisedType) {\n            // creates a `Promise<T>` type where `T` is the promisedType argument\n            var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true);\n            if (globalPromiseType !== emptyGenericType) {\n                // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type\n                promisedType = getAwaitedType(promisedType) || unknownType;\n                return createTypeReference(globalPromiseType, [promisedType]);\n            }\n            return unknownType;\n        }\n        function createPromiseLikeType(promisedType) {\n            // creates a `PromiseLike<T>` type where `T` is the promisedType argument\n            var globalPromiseLikeType = getGlobalPromiseLikeType(/*reportErrors*/ true);\n            if (globalPromiseLikeType !== emptyGenericType) {\n                // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type\n                promisedType = getAwaitedType(promisedType) || unknownType;\n                return createTypeReference(globalPromiseLikeType, [promisedType]);\n            }\n            return unknownType;\n        }\n        function createPromiseReturnType(func, promisedType) {\n            var promiseType = createPromiseType(promisedType);\n            if (promiseType === unknownType) {\n                error(func, ts.isImportCall(func) ?\n                    ts.Diagnostics.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option :\n                    ts.Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option);\n                return errorType;\n            }\n            else if (!getGlobalPromiseConstructorSymbol(/*reportErrors*/ true)) {\n                error(func, ts.isImportCall(func) ?\n                    ts.Diagnostics.A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option :\n                    ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);\n            }\n            return promiseType;\n        }\n        function getReturnTypeFromBody(func, checkMode) {\n            if (!func.body) {\n                return errorType;\n            }\n            var functionFlags = ts.getFunctionFlags(func);\n            var isAsync = (functionFlags & 2 /* Async */) !== 0;\n            var isGenerator = (functionFlags & 1 /* Generator */) !== 0;\n            var returnType;\n            var yieldType;\n            var nextType;\n            var fallbackReturnType = voidType;\n            if (func.body.kind !== 230 /* Block */) { // Async or normal arrow function\n                returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */);\n                if (isAsync) {\n                    // From within an async function you can return either a non-promise value or a promise. Any\n                    // Promise/A+ compatible implementation will always assimilate any foreign promise, so the\n                    // return type of the body should be unwrapped to its awaited type, which we will wrap in\n                    // the native Promise<T> type later in this function.\n                    returnType = checkAwaitedType(returnType, /*errorNode*/ func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);\n                }\n            }\n            else if (isGenerator) { // Generator or AsyncGenerator function\n                var returnTypes = checkAndAggregateReturnExpressionTypes(func, checkMode);\n                if (!returnTypes) {\n                    fallbackReturnType = neverType;\n                }\n                else if (returnTypes.length > 0) {\n                    returnType = getUnionType(returnTypes, 2 /* Subtype */);\n                }\n                var _a = checkAndAggregateYieldOperandTypes(func, checkMode), yieldTypes = _a.yieldTypes, nextTypes = _a.nextTypes;\n                yieldType = ts.some(yieldTypes) ? getUnionType(yieldTypes, 2 /* Subtype */) : undefined;\n                nextType = ts.some(nextTypes) ? getIntersectionType(nextTypes) : undefined;\n            }\n            else { // Async or normal function\n                var types = checkAndAggregateReturnExpressionTypes(func, checkMode);\n                if (!types) {\n                    // For an async function, the return type will not be never, but rather a Promise for never.\n                    return functionFlags & 2 /* Async */\n                        ? createPromiseReturnType(func, neverType) // Async function\n                        : neverType; // Normal function\n                }\n                if (types.length === 0) {\n                    // For an async function, the return type will not be void, but rather a Promise for void.\n                    return functionFlags & 2 /* Async */\n                        ? createPromiseReturnType(func, voidType) // Async function\n                        : voidType; // Normal function\n                }\n                // Return a union of the return expression types.\n                returnType = getUnionType(types, 2 /* Subtype */);\n            }\n            if (returnType || yieldType || nextType) {\n                if (yieldType)\n                    reportErrorsFromWidening(func, yieldType, 3 /* GeneratorYield */);\n                if (returnType)\n                    reportErrorsFromWidening(func, returnType, 1 /* FunctionReturn */);\n                if (nextType)\n                    reportErrorsFromWidening(func, nextType, 2 /* GeneratorNext */);\n                if (returnType && isUnitType(returnType) ||\n                    yieldType && isUnitType(yieldType) ||\n                    nextType && isUnitType(nextType)) {\n                    var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func);\n                    var contextualType = !contextualSignature ? undefined :\n                        contextualSignature === getSignatureFromDeclaration(func) ? isGenerator ? undefined : returnType :\n                            instantiateContextualType(getReturnTypeOfSignature(contextualSignature), func);\n                    if (isGenerator) {\n                        yieldType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(yieldType, contextualType, 0 /* Yield */, isAsync);\n                        returnType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(returnType, contextualType, 1 /* Return */, isAsync);\n                        nextType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(nextType, contextualType, 2 /* Next */, isAsync);\n                    }\n                    else {\n                        returnType = getWidenedLiteralLikeTypeForContextualReturnTypeIfNeeded(returnType, contextualType, isAsync);\n                    }\n                }\n                if (yieldType)\n                    yieldType = getWidenedType(yieldType);\n                if (returnType)\n                    returnType = getWidenedType(returnType);\n                if (nextType)\n                    nextType = getWidenedType(nextType);\n            }\n            if (isGenerator) {\n                return createGeneratorReturnType(yieldType || neverType, returnType || fallbackReturnType, nextType || getContextualIterationType(2 /* Next */, func) || unknownType, isAsync);\n            }\n            else {\n                // From within an async function you can return either a non-promise value or a promise. Any\n                // Promise/A+ compatible implementation will always assimilate any foreign promise, so the\n                // return type of the body is awaited type of the body, wrapped in a native Promise<T> type.\n                return isAsync\n                    ? createPromiseType(returnType || fallbackReturnType)\n                    : returnType || fallbackReturnType;\n            }\n        }\n        function createGeneratorReturnType(yieldType, returnType, nextType, isAsyncGenerator) {\n            var resolver = isAsyncGenerator ? asyncIterationTypesResolver : syncIterationTypesResolver;\n            var globalGeneratorType = resolver.getGlobalGeneratorType(/*reportErrors*/ false);\n            yieldType = resolver.resolveIterationType(yieldType, /*errorNode*/ undefined) || unknownType;\n            returnType = resolver.resolveIterationType(returnType, /*errorNode*/ undefined) || unknownType;\n            nextType = resolver.resolveIterationType(nextType, /*errorNode*/ undefined) || unknownType;\n            if (globalGeneratorType === emptyGenericType) {\n                // Fall back to the global IterableIterator if returnType is assignable to the expected return iteration\n                // type of IterableIterator, and the expected next iteration type of IterableIterator is assignable to\n                // nextType.\n                var globalType = resolver.getGlobalIterableIteratorType(/*reportErrors*/ false);\n                var iterationTypes = globalType !== emptyGenericType ? getIterationTypesOfGlobalIterableType(globalType, resolver) : undefined;\n                var iterableIteratorReturnType = iterationTypes ? iterationTypes.returnType : anyType;\n                var iterableIteratorNextType = iterationTypes ? iterationTypes.nextType : undefinedType;\n                if (isTypeAssignableTo(returnType, iterableIteratorReturnType) &&\n                    isTypeAssignableTo(iterableIteratorNextType, nextType)) {\n                    if (globalType !== emptyGenericType) {\n                        return createTypeFromGenericGlobalType(globalType, [yieldType]);\n                    }\n                    // The global IterableIterator type doesn't exist, so report an error\n                    resolver.getGlobalIterableIteratorType(/*reportErrors*/ true);\n                    return emptyObjectType;\n                }\n                // The global Generator type doesn't exist, so report an error\n                resolver.getGlobalGeneratorType(/*reportErrors*/ true);\n                return emptyObjectType;\n            }\n            return createTypeFromGenericGlobalType(globalGeneratorType, [yieldType, returnType, nextType]);\n        }\n        function checkAndAggregateYieldOperandTypes(func, checkMode) {\n            var yieldTypes = [];\n            var nextTypes = [];\n            var isAsync = (ts.getFunctionFlags(func) & 2 /* Async */) !== 0;\n            ts.forEachYieldExpression(func.body, function (yieldExpression) {\n                var yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode) : undefinedWideningType;\n                ts.pushIfUnique(yieldTypes, getYieldedTypeOfYieldExpression(yieldExpression, yieldExpressionType, anyType, isAsync));\n                var nextType;\n                if (yieldExpression.asteriskToken) {\n                    var iterationTypes = getIterationTypesOfIterable(yieldExpressionType, isAsync ? 19 /* AsyncYieldStar */ : 17 /* YieldStar */, yieldExpression.expression);\n                    nextType = iterationTypes && iterationTypes.nextType;\n                }\n                else {\n                    nextType = getContextualType(yieldExpression);\n                }\n                if (nextType)\n                    ts.pushIfUnique(nextTypes, nextType);\n            });\n            return { yieldTypes: yieldTypes, nextTypes: nextTypes };\n        }\n        function getYieldedTypeOfYieldExpression(node, expressionType, sentType, isAsync) {\n            var errorNode = node.expression || node;\n            // A `yield*` expression effectively yields everything that its operand yields\n            var yieldedType = node.asteriskToken ? checkIteratedTypeOrElementType(isAsync ? 19 /* AsyncYieldStar */ : 17 /* YieldStar */, expressionType, sentType, errorNode) : expressionType;\n            return !isAsync ? yieldedType : getAwaitedType(yieldedType, errorNode, node.asteriskToken\n                ? ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member\n                : ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);\n        }\n        /**\n         * Collect the TypeFacts learned from a typeof switch with\n         * total clauses `witnesses`, and the active clause ranging\n         * from `start` to `end`. Parameter `hasDefault` denotes\n         * whether the active clause contains a default clause.\n         */\n        function getFactsFromTypeofSwitch(start, end, witnesses, hasDefault) {\n            var facts = 0 /* None */;\n            // When in the default we only collect inequality facts\n            // because default is 'in theory' a set of infinite\n            // equalities.\n            if (hasDefault) {\n                // Value is not equal to any types after the active clause.\n                for (var i = end; i < witnesses.length; i++) {\n                    facts |= typeofNEFacts.get(witnesses[i]) || 32768 /* TypeofNEHostObject */;\n                }\n                // Remove inequalities for types that appear in the\n                // active clause because they appear before other\n                // types collected so far.\n                for (var i = start; i < end; i++) {\n                    facts &= ~(typeofNEFacts.get(witnesses[i]) || 0);\n                }\n                // Add inequalities for types before the active clause unconditionally.\n                for (var i = 0; i < start; i++) {\n                    facts |= typeofNEFacts.get(witnesses[i]) || 32768 /* TypeofNEHostObject */;\n                }\n            }\n            // When in an active clause without default the set of\n            // equalities is finite.\n            else {\n                // Add equalities for all types in the active clause.\n                for (var i = start; i < end; i++) {\n                    facts |= typeofEQFacts.get(witnesses[i]) || 128 /* TypeofEQHostObject */;\n                }\n                // Remove equalities for types that appear before the\n                // active clause.\n                for (var i = 0; i < start; i++) {\n                    facts &= ~(typeofEQFacts.get(witnesses[i]) || 0);\n                }\n            }\n            return facts;\n        }\n        function isExhaustiveSwitchStatement(node) {\n            var links = getNodeLinks(node);\n            return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node));\n        }\n        function computeExhaustiveSwitchStatement(node) {\n            if (node.expression.kind === 211 /* TypeOfExpression */) {\n                var operandType = getTypeOfExpression(node.expression.expression);\n                var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false);\n                // notEqualFacts states that the type of the switched value is not equal to every type in the switch.\n                var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, /*hasDefault*/ true);\n                var type_4 = getBaseConstraintOfType(operandType) || operandType;\n                // Take any/unknown as a special condition. Or maybe we could change `type` to a union containing all primitive types.\n                if (type_4.flags & 3 /* AnyOrUnknown */) {\n                    return (556800 /* AllTypeofNE */ & notEqualFacts_1) === 556800 /* AllTypeofNE */;\n                }\n                return !!(filterType(type_4, function (t) { return (getTypeFacts(t) & notEqualFacts_1) === notEqualFacts_1; }).flags & 131072 /* Never */);\n            }\n            var type = getTypeOfExpression(node.expression);\n            if (!isLiteralType(type)) {\n                return false;\n            }\n            var switchTypes = getSwitchClauseTypes(node);\n            if (!switchTypes.length || ts.some(switchTypes, isNeitherUnitTypeNorNever)) {\n                return false;\n            }\n            return eachTypeContainedIn(mapType(type, getRegularTypeOfLiteralType), switchTypes);\n        }\n        function functionHasImplicitReturn(func) {\n            return func.endFlowNode && isReachableFlowNode(func.endFlowNode);\n        }\n        /** NOTE: Return value of `[]` means a different thing than `undefined`. `[]` means func returns `void`, `undefined` means it returns `never`. */\n        function checkAndAggregateReturnExpressionTypes(func, checkMode) {\n            var functionFlags = ts.getFunctionFlags(func);\n            var aggregatedTypes = [];\n            var hasReturnWithNoExpression = functionHasImplicitReturn(func);\n            var hasReturnOfTypeNever = false;\n            ts.forEachReturnStatement(func.body, function (returnStatement) {\n                var expr = returnStatement.expression;\n                if (expr) {\n                    var type = checkExpressionCached(expr, checkMode && checkMode & ~8 /* SkipGenericFunctions */);\n                    if (functionFlags & 2 /* Async */) {\n                        // From within an async function you can return either a non-promise value or a promise. Any\n                        // Promise/A+ compatible implementation will always assimilate any foreign promise, so the\n                        // return type of the body should be unwrapped to its awaited type, which should be wrapped in\n                        // the native Promise<T> type by the caller.\n                        type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);\n                    }\n                    if (type.flags & 131072 /* Never */) {\n                        hasReturnOfTypeNever = true;\n                    }\n                    ts.pushIfUnique(aggregatedTypes, type);\n                }\n                else {\n                    hasReturnWithNoExpression = true;\n                }\n            });\n            if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || mayReturnNever(func))) {\n                return undefined;\n            }\n            if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression &&\n                !(isJSConstructor(func) && aggregatedTypes.some(function (t) { return t.symbol === func.symbol; }))) {\n                // Javascript \"callable constructors\", containing eg `if (!(this instanceof A)) return new A()` should not add undefined\n                ts.pushIfUnique(aggregatedTypes, undefinedType);\n            }\n            return aggregatedTypes;\n        }\n        function mayReturnNever(func) {\n            switch (func.kind) {\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                    return true;\n                case 165 /* MethodDeclaration */:\n                    return func.parent.kind === 200 /* ObjectLiteralExpression */;\n                default:\n                    return false;\n            }\n        }\n        /**\n         * TypeScript Specification 1.0 (6.3) - July 2014\n         *   An explicitly typed function whose return type isn't the Void type,\n         *   the Any type, or a union type containing the Void or Any type as a constituent\n         *   must have at least one return statement somewhere in its body.\n         *   An exception to this rule is if the function implementation consists of a single 'throw' statement.\n         *\n         * @param returnType - return type of the function, can be undefined if return type is not explicitly specified\n         */\n        function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) {\n            if (!produceDiagnostics) {\n                return;\n            }\n            var functionFlags = ts.getFunctionFlags(func);\n            var type = returnType && unwrapReturnType(returnType, functionFlags);\n            // Functions with with an explicitly specified 'void' or 'any' return type don't need any return expressions.\n            if (type && maybeTypeOfKind(type, 1 /* Any */ | 16384 /* Void */)) {\n                return;\n            }\n            // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check.\n            // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw\n            if (func.kind === 164 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 230 /* Block */ || !functionHasImplicitReturn(func)) {\n                return;\n            }\n            var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */;\n            if (type && type.flags & 131072 /* Never */) {\n                error(ts.getEffectiveReturnTypeNode(func), ts.Diagnostics.A_function_returning_never_cannot_have_a_reachable_end_point);\n            }\n            else if (type && !hasExplicitReturn) {\n                // minimal check: function has syntactic return type annotation and no explicit return statements in the body\n                // this function does not conform to the specification.\n                // NOTE: having returnType !== undefined is a precondition for entering this branch so func.type will always be present\n                error(ts.getEffectiveReturnTypeNode(func), ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value);\n            }\n            else if (type && strictNullChecks && !isTypeAssignableTo(undefinedType, type)) {\n                error(ts.getEffectiveReturnTypeNode(func) || func, ts.Diagnostics.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined);\n            }\n            else if (compilerOptions.noImplicitReturns) {\n                if (!type) {\n                    // If return type annotation is omitted check if function has any explicit return statements.\n                    // If it does not have any - its inferred return type is void - don't do any checks.\n                    // Otherwise get inferred return type from function body and report error only if it is not void / anytype\n                    if (!hasExplicitReturn) {\n                        return;\n                    }\n                    var inferredReturnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func));\n                    if (isUnwrappedReturnTypeVoidOrAny(func, inferredReturnType)) {\n                        return;\n                    }\n                }\n                error(ts.getEffectiveReturnTypeNode(func) || func, ts.Diagnostics.Not_all_code_paths_return_a_value);\n            }\n        }\n        function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) {\n            ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));\n            checkNodeDeferred(node);\n            // The identityMapper object is used to indicate that function expressions are wildcards\n            if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) {\n                // Skip parameters, return signature with return type that retains noncontextual parts so inferences can still be drawn in an early stage\n                if (!ts.getEffectiveReturnTypeNode(node) && !hasContextSensitiveParameters(node)) {\n                    // Return plain anyFunctionType if there is no possibility we'll make inferences from the return type\n                    var contextualSignature = getContextualSignature(node);\n                    if (contextualSignature && couldContainTypeVariables(getReturnTypeOfSignature(contextualSignature))) {\n                        var links = getNodeLinks(node);\n                        if (links.contextFreeType) {\n                            return links.contextFreeType;\n                        }\n                        var returnType = getReturnTypeFromBody(node, checkMode);\n                        var returnOnlySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, returnType, /*resolvedTypePredicate*/ undefined, 0, 0 /* None */);\n                        var returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], ts.emptyArray, undefined, undefined);\n                        returnOnlyType.objectFlags |= 2097152 /* NonInferrableType */;\n                        return links.contextFreeType = returnOnlyType;\n                    }\n                }\n                return anyFunctionType;\n            }\n            // Grammar checking\n            var hasGrammarError = checkGrammarFunctionLikeDeclaration(node);\n            if (!hasGrammarError && node.kind === 208 /* FunctionExpression */) {\n                checkGrammarForGenerator(node);\n            }\n            contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode);\n            return getTypeOfSymbol(getSymbolOfNode(node));\n        }\n        function contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode) {\n            var links = getNodeLinks(node);\n            // Check if function expression is contextually typed and assign parameter types if so.\n            if (!(links.flags & 1024 /* ContextChecked */)) {\n                var contextualSignature = getContextualSignature(node);\n                // If a type check is started at a function expression that is an argument of a function call, obtaining the\n                // contextual type may recursively get back to here during overload resolution of the call. If so, we will have\n                // already assigned contextual types.\n                if (!(links.flags & 1024 /* ContextChecked */)) {\n                    links.flags |= 1024 /* ContextChecked */;\n                    var signature = ts.firstOrUndefined(getSignaturesOfType(getTypeOfSymbol(getSymbolOfNode(node)), 0 /* Call */));\n                    if (!signature) {\n                        return;\n                    }\n                    if (isContextSensitive(node)) {\n                        if (contextualSignature) {\n                            var inferenceContext = getInferenceContext(node);\n                            if (checkMode && checkMode & 2 /* Inferential */) {\n                                inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext);\n                            }\n                            var instantiatedContextualSignature = inferenceContext ?\n                                instantiateSignature(contextualSignature, inferenceContext.mapper) : contextualSignature;\n                            assignContextualParameterTypes(signature, instantiatedContextualSignature);\n                        }\n                        else {\n                            // Force resolution of all parameter types such that the absence of a contextual type is consistently reflected.\n                            assignNonContextualParameterTypes(signature);\n                        }\n                    }\n                    if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) {\n                        var returnType = getReturnTypeFromBody(node, checkMode);\n                        if (!signature.resolvedReturnType) {\n                            signature.resolvedReturnType = returnType;\n                        }\n                    }\n                    checkSignatureDeclaration(node);\n                }\n            }\n        }\n        function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) {\n            ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));\n            var functionFlags = ts.getFunctionFlags(node);\n            var returnType = getReturnTypeFromAnnotation(node);\n            checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);\n            if (node.body) {\n                if (!ts.getEffectiveReturnTypeNode(node)) {\n                    // There are some checks that are only performed in getReturnTypeFromBody, that may produce errors\n                    // we need. An example is the noImplicitAny errors resulting from widening the return expression\n                    // of a function. Because checking of function expression bodies is deferred, there was never an\n                    // appropriate time to do this during the main walk of the file (see the comment at the top of\n                    // checkFunctionExpressionBodies). So it must be done now.\n                    getReturnTypeOfSignature(getSignatureFromDeclaration(node));\n                }\n                if (node.body.kind === 230 /* Block */) {\n                    checkSourceElement(node.body);\n                }\n                else {\n                    // From within an async function you can return either a non-promise value or a promise. Any\n                    // Promise/A+ compatible implementation will always assimilate any foreign promise, so we\n                    // should not be checking assignability of a promise to the return type. Instead, we need to\n                    // check assignability of the awaited type of the expression body against the promised type of\n                    // its return type annotation.\n                    var exprType = checkExpression(node.body);\n                    var returnOrPromisedType = returnType && unwrapReturnType(returnType, functionFlags);\n                    if (returnOrPromisedType) {\n                        if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */) { // Async function\n                            var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);\n                            checkTypeAssignableToAndOptionallyElaborate(awaitedType, returnOrPromisedType, node.body, node.body);\n                        }\n                        else { // Normal function\n                            checkTypeAssignableToAndOptionallyElaborate(exprType, returnOrPromisedType, node.body, node.body);\n                        }\n                    }\n                }\n            }\n        }\n        function checkArithmeticOperandType(operand, type, diagnostic, isAwaitValid) {\n            if (isAwaitValid === void 0) { isAwaitValid = false; }\n            if (!isTypeAssignableTo(type, numberOrBigIntType)) {\n                var awaitedType = isAwaitValid && getAwaitedTypeOfPromise(type);\n                errorAndMaybeSuggestAwait(operand, !!awaitedType && isTypeAssignableTo(awaitedType, numberOrBigIntType), diagnostic);\n                return false;\n            }\n            return true;\n        }\n        function isReadonlyAssignmentDeclaration(d) {\n            if (!ts.isCallExpression(d)) {\n                return false;\n            }\n            if (!ts.isBindableObjectDefinePropertyCall(d)) {\n                return false;\n            }\n            var objectLitType = checkExpressionCached(d.arguments[2]);\n            var valueType = getTypeOfPropertyOfType(objectLitType, \"value\");\n            if (valueType) {\n                var writableProp = getPropertyOfType(objectLitType, \"writable\");\n                var writableType = writableProp && getTypeOfSymbol(writableProp);\n                if (!writableType || writableType === falseType || writableType === regularFalseType) {\n                    return true;\n                }\n                // We include this definition whereupon we walk back and check the type at the declaration because\n                // The usual definition of `Object.defineProperty` will _not_ cause literal types to be preserved in the\n                // argument types, should the type be contextualized by the call itself.\n                if (writableProp && writableProp.valueDeclaration && ts.isPropertyAssignment(writableProp.valueDeclaration)) {\n                    var initializer = writableProp.valueDeclaration.initializer;\n                    var rawOriginalType = checkExpression(initializer);\n                    if (rawOriginalType === falseType || rawOriginalType === regularFalseType) {\n                        return true;\n                    }\n                }\n                return false;\n            }\n            var setProp = getPropertyOfType(objectLitType, \"set\");\n            return !setProp;\n        }\n        function isReadonlySymbol(symbol) {\n            // The following symbols are considered read-only:\n            // Properties with a 'readonly' modifier\n            // Variables declared with 'const'\n            // Get accessors without matching set accessors\n            // Enum members\n            // Object.defineProperty assignments with writable false or no setter\n            // Unions and intersections of the above (unions and intersections eagerly set isReadonly on creation)\n            return !!(ts.getCheckFlags(symbol) & 8 /* Readonly */ ||\n                symbol.flags & 4 /* Property */ && ts.getDeclarationModifierFlagsFromSymbol(symbol) & 64 /* Readonly */ ||\n                symbol.flags & 3 /* Variable */ && getDeclarationNodeFlagsFromSymbol(symbol) & 2 /* Const */ ||\n                symbol.flags & 98304 /* Accessor */ && !(symbol.flags & 65536 /* SetAccessor */) ||\n                symbol.flags & 8 /* EnumMember */ ||\n                ts.some(symbol.declarations, isReadonlyAssignmentDeclaration));\n        }\n        function isAssignmentToReadonlyEntity(expr, symbol, assignmentKind) {\n            var _a, _b;\n            if (assignmentKind === 0 /* None */) {\n                // no assigment means it doesn't matter whether the entity is readonly\n                return false;\n            }\n            if (isReadonlySymbol(symbol)) {\n                // Allow assignments to readonly properties within constructors of the same class declaration.\n                if (symbol.flags & 4 /* Property */ &&\n                    ts.isAccessExpression(expr) &&\n                    expr.expression.kind === 107 /* ThisKeyword */) {\n                    // Look for if this is the constructor for the class that `symbol` is a property of.\n                    var ctor = ts.getContainingFunction(expr);\n                    if (!(ctor && (ctor.kind === 166 /* Constructor */ || isJSConstructor(ctor)))) {\n                        return true;\n                    }\n                    if (symbol.valueDeclaration) {\n                        var isAssignmentDeclaration_1 = ts.isBinaryExpression(symbol.valueDeclaration);\n                        var isLocalPropertyDeclaration = ctor.parent === symbol.valueDeclaration.parent;\n                        var isLocalParameterProperty = ctor === symbol.valueDeclaration.parent;\n                        var isLocalThisPropertyAssignment = isAssignmentDeclaration_1 && ((_a = symbol.parent) === null || _a === void 0 ? void 0 : _a.valueDeclaration) === ctor.parent;\n                        var isLocalThisPropertyAssignmentConstructorFunction = isAssignmentDeclaration_1 && ((_b = symbol.parent) === null || _b === void 0 ? void 0 : _b.valueDeclaration) === ctor;\n                        var isWriteableSymbol = isLocalPropertyDeclaration\n                            || isLocalParameterProperty\n                            || isLocalThisPropertyAssignment\n                            || isLocalThisPropertyAssignmentConstructorFunction;\n                        return !isWriteableSymbol;\n                    }\n                }\n                return true;\n            }\n            if (ts.isAccessExpression(expr)) {\n                // references through namespace import should be readonly\n                var node = ts.skipParentheses(expr.expression);\n                if (node.kind === 78 /* Identifier */) {\n                    var symbol_2 = getNodeLinks(node).resolvedSymbol;\n                    if (symbol_2.flags & 2097152 /* Alias */) {\n                        var declaration = getDeclarationOfAliasSymbol(symbol_2);\n                        return !!declaration && declaration.kind === 263 /* NamespaceImport */;\n                    }\n                }\n            }\n            return false;\n        }\n        function checkReferenceExpression(expr, invalidReferenceMessage, invalidOptionalChainMessage) {\n            // References are combinations of identifiers, parentheses, and property accesses.\n            var node = ts.skipOuterExpressions(expr, 6 /* Assertions */ | 1 /* Parentheses */);\n            if (node.kind !== 78 /* Identifier */ && !ts.isAccessExpression(node)) {\n                error(expr, invalidReferenceMessage);\n                return false;\n            }\n            if (node.flags & 32 /* OptionalChain */) {\n                error(expr, invalidOptionalChainMessage);\n                return false;\n            }\n            return true;\n        }\n        function checkDeleteExpression(node) {\n            checkExpression(node.expression);\n            var expr = ts.skipParentheses(node.expression);\n            if (!ts.isAccessExpression(expr)) {\n                error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference);\n                return booleanType;\n            }\n            if (ts.isPropertyAccessExpression(expr) && ts.isPrivateIdentifier(expr.name)) {\n                error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier);\n            }\n            var links = getNodeLinks(expr);\n            var symbol = getExportSymbolOfValueSymbolIfExported(links.resolvedSymbol);\n            if (symbol) {\n                if (isReadonlySymbol(symbol)) {\n                    error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property);\n                }\n                checkDeleteExpressionMustBeOptional(expr, getTypeOfSymbol(symbol));\n            }\n            return booleanType;\n        }\n        function checkDeleteExpressionMustBeOptional(expr, type) {\n            var AnyOrUnknownOrNeverFlags = 3 /* AnyOrUnknown */ | 131072 /* Never */;\n            if (strictNullChecks && !(type.flags & AnyOrUnknownOrNeverFlags) && !(getFalsyFlags(type) & 32768 /* Undefined */)) {\n                error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_optional);\n            }\n        }\n        function checkTypeOfExpression(node) {\n            checkExpression(node.expression);\n            return typeofType;\n        }\n        function checkVoidExpression(node) {\n            checkExpression(node.expression);\n            return undefinedWideningType;\n        }\n        function checkAwaitExpression(node) {\n            // Grammar checking\n            if (produceDiagnostics) {\n                if (!(node.flags & 32768 /* AwaitContext */)) {\n                    if (ts.isInTopLevelContext(node)) {\n                        var sourceFile = ts.getSourceFileOfNode(node);\n                        if (!hasParseDiagnostics(sourceFile)) {\n                            var span = void 0;\n                            if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {\n                                if (!span)\n                                    span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);\n                                var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module);\n                                diagnostics.add(diagnostic);\n                            }\n                            if ((moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) || languageVersion < 4 /* ES2017 */) {\n                                span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);\n                                var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_esnext_or_system_and_the_target_option_is_set_to_es2017_or_higher);\n                                diagnostics.add(diagnostic);\n                            }\n                        }\n                    }\n                    else {\n                        // use of 'await' in non-async function\n                        var sourceFile = ts.getSourceFileOfNode(node);\n                        if (!hasParseDiagnostics(sourceFile)) {\n                            var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);\n                            var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules);\n                            var func = ts.getContainingFunction(node);\n                            if (func && func.kind !== 166 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) {\n                                var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async);\n                                ts.addRelatedInfo(diagnostic, relatedInfo);\n                            }\n                            diagnostics.add(diagnostic);\n                        }\n                    }\n                }\n                if (isInParameterInitializerBeforeContainingFunction(node)) {\n                    error(node, ts.Diagnostics.await_expressions_cannot_be_used_in_a_parameter_initializer);\n                }\n            }\n            var operandType = checkExpression(node.expression);\n            var awaitedType = checkAwaitedType(operandType, node, ts.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);\n            if (awaitedType === operandType && awaitedType !== errorType && !(operandType.flags & 3 /* AnyOrUnknown */)) {\n                addErrorOrSuggestion(/*isError*/ false, ts.createDiagnosticForNode(node, ts.Diagnostics.await_has_no_effect_on_the_type_of_this_expression));\n            }\n            return awaitedType;\n        }\n        function checkPrefixUnaryExpression(node) {\n            var operandType = checkExpression(node.operand);\n            if (operandType === silentNeverType) {\n                return silentNeverType;\n            }\n            switch (node.operand.kind) {\n                case 8 /* NumericLiteral */:\n                    switch (node.operator) {\n                        case 40 /* MinusToken */:\n                            return getFreshTypeOfLiteralType(getLiteralType(-node.operand.text));\n                        case 39 /* PlusToken */:\n                            return getFreshTypeOfLiteralType(getLiteralType(+node.operand.text));\n                    }\n                    break;\n                case 9 /* BigIntLiteral */:\n                    if (node.operator === 40 /* MinusToken */) {\n                        return getFreshTypeOfLiteralType(getLiteralType({\n                            negative: true,\n                            base10Value: ts.parsePseudoBigInt(node.operand.text)\n                        }));\n                    }\n            }\n            switch (node.operator) {\n                case 39 /* PlusToken */:\n                case 40 /* MinusToken */:\n                case 54 /* TildeToken */:\n                    checkNonNullType(operandType, node.operand);\n                    if (maybeTypeOfKind(operandType, 12288 /* ESSymbolLike */)) {\n                        error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator));\n                    }\n                    if (node.operator === 39 /* PlusToken */) {\n                        if (maybeTypeOfKind(operandType, 2112 /* BigIntLike */)) {\n                            error(node.operand, ts.Diagnostics.Operator_0_cannot_be_applied_to_type_1, ts.tokenToString(node.operator), typeToString(getBaseTypeOfLiteralType(operandType)));\n                        }\n                        return numberType;\n                    }\n                    return getUnaryResultType(operandType);\n                case 53 /* ExclamationToken */:\n                    checkTruthinessExpression(node.operand);\n                    var facts = getTypeFacts(operandType) & (4194304 /* Truthy */ | 8388608 /* Falsy */);\n                    return facts === 4194304 /* Truthy */ ? falseType :\n                        facts === 8388608 /* Falsy */ ? trueType :\n                            booleanType;\n                case 45 /* PlusPlusToken */:\n                case 46 /* MinusMinusToken */:\n                    var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type);\n                    if (ok) {\n                        // run check only if former checks succeeded to avoid reporting cascading errors\n                        checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access);\n                    }\n                    return getUnaryResultType(operandType);\n            }\n            return errorType;\n        }\n        function checkPostfixUnaryExpression(node) {\n            var operandType = checkExpression(node.operand);\n            if (operandType === silentNeverType) {\n                return silentNeverType;\n            }\n            var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type);\n            if (ok) {\n                // run check only if former checks succeeded to avoid reporting cascading errors\n                checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access);\n            }\n            return getUnaryResultType(operandType);\n        }\n        function getUnaryResultType(operandType) {\n            if (maybeTypeOfKind(operandType, 2112 /* BigIntLike */)) {\n                return isTypeAssignableToKind(operandType, 3 /* AnyOrUnknown */) || maybeTypeOfKind(operandType, 296 /* NumberLike */)\n                    ? numberOrBigIntType\n                    : bigintType;\n            }\n            // If it's not a bigint type, implicit coercion will result in a number\n            return numberType;\n        }\n        // Return true if type might be of the given kind. A union or intersection type might be of a given\n        // kind if at least one constituent type is of the given kind.\n        function maybeTypeOfKind(type, kind) {\n            if (type.flags & kind) {\n                return true;\n            }\n            if (type.flags & 3145728 /* UnionOrIntersection */) {\n                var types = type.types;\n                for (var _i = 0, types_22 = types; _i < types_22.length; _i++) {\n                    var t = types_22[_i];\n                    if (maybeTypeOfKind(t, kind)) {\n                        return true;\n                    }\n                }\n            }\n            return false;\n        }\n        function isTypeAssignableToKind(source, kind, strict) {\n            if (source.flags & kind) {\n                return true;\n            }\n            if (strict && source.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */ | 32768 /* Undefined */ | 65536 /* Null */)) {\n                return false;\n            }\n            return !!(kind & 296 /* NumberLike */) && isTypeAssignableTo(source, numberType) ||\n                !!(kind & 2112 /* BigIntLike */) && isTypeAssignableTo(source, bigintType) ||\n                !!(kind & 402653316 /* StringLike */) && isTypeAssignableTo(source, stringType) ||\n                !!(kind & 528 /* BooleanLike */) && isTypeAssignableTo(source, booleanType) ||\n                !!(kind & 16384 /* Void */) && isTypeAssignableTo(source, voidType) ||\n                !!(kind & 131072 /* Never */) && isTypeAssignableTo(source, neverType) ||\n                !!(kind & 65536 /* Null */) && isTypeAssignableTo(source, nullType) ||\n                !!(kind & 32768 /* Undefined */) && isTypeAssignableTo(source, undefinedType) ||\n                !!(kind & 4096 /* ESSymbol */) && isTypeAssignableTo(source, esSymbolType) ||\n                !!(kind & 67108864 /* NonPrimitive */) && isTypeAssignableTo(source, nonPrimitiveType);\n        }\n        function allTypesAssignableToKind(source, kind, strict) {\n            return source.flags & 1048576 /* Union */ ?\n                ts.every(source.types, function (subType) { return allTypesAssignableToKind(subType, kind, strict); }) :\n                isTypeAssignableToKind(source, kind, strict);\n        }\n        function isConstEnumObjectType(type) {\n            return !!(ts.getObjectFlags(type) & 16 /* Anonymous */) && !!type.symbol && isConstEnumSymbol(type.symbol);\n        }\n        function isConstEnumSymbol(symbol) {\n            return (symbol.flags & 128 /* ConstEnum */) !== 0;\n        }\n        function checkInstanceOfExpression(left, right, leftType, rightType) {\n            if (leftType === silentNeverType || rightType === silentNeverType) {\n                return silentNeverType;\n            }\n            // TypeScript 1.0 spec (April 2014): 4.15.4\n            // The instanceof operator requires the left operand to be of type Any, an object type, or a type parameter type,\n            // and the right operand to be of type Any, a subtype of the 'Function' interface type, or have a call or construct signature.\n            // The result is always of the Boolean primitive type.\n            // NOTE: do not raise error if leftType is unknown as related error was already reported\n            if (!isTypeAny(leftType) &&\n                allTypesAssignableToKind(leftType, 131068 /* Primitive */)) {\n                error(left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter);\n            }\n            // NOTE: do not raise error if right is unknown as related error was already reported\n            if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) {\n                error(right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type);\n            }\n            return booleanType;\n        }\n        function checkInExpression(left, right, leftType, rightType) {\n            if (leftType === silentNeverType || rightType === silentNeverType) {\n                return silentNeverType;\n            }\n            leftType = checkNonNullType(leftType, left);\n            rightType = checkNonNullType(rightType, right);\n            // TypeScript 1.0 spec (April 2014): 4.15.5\n            // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type,\n            // and the right operand to be\n            //\n            //   1. assignable to the non-primitive type,\n            //   2. an unconstrained type parameter,\n            //   3. a union or intersection including one or more type parameters, whose constituents are all assignable to the\n            //      the non-primitive type, or are unconstrainted type parameters, or have constraints assignable to the\n            //      non-primitive type, or\n            //   4. a type parameter whose constraint is\n            //      i. an object type,\n            //     ii. the non-primitive type, or\n            //    iii. a union or intersection with at least one constituent assignable to an object or non-primitive type.\n            //\n            // The divergent behavior for type parameters and unions containing type parameters is a workaround for type\n            // parameters not being narrowable. If the right operand is a concrete type, we can error if there is any chance\n            // it is a primitive. But if the operand is a type parameter, it cannot be narrowed, so we don't issue an error\n            // unless *all* instantiations would result in an error.\n            //\n            // The result is always of the Boolean primitive type.\n            if (!(allTypesAssignableToKind(leftType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) ||\n                isTypeAssignableToKind(leftType, 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */ | 262144 /* TypeParameter */))) {\n                error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol);\n            }\n            var rightTypeConstraint = getConstraintOfType(rightType);\n            if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */) ||\n                rightTypeConstraint && (isTypeAssignableToKind(rightType, 3145728 /* UnionOrIntersection */) && !allTypesAssignableToKind(rightTypeConstraint, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */) ||\n                    !maybeTypeOfKind(rightTypeConstraint, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */))) {\n                error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_not_be_a_primitive);\n            }\n            return booleanType;\n        }\n        function checkObjectLiteralAssignment(node, sourceType, rightIsThis) {\n            var properties = node.properties;\n            if (strictNullChecks && properties.length === 0) {\n                return checkNonNullType(sourceType, node);\n            }\n            for (var i = 0; i < properties.length; i++) {\n                checkObjectLiteralDestructuringPropertyAssignment(node, sourceType, i, properties, rightIsThis);\n            }\n            return sourceType;\n        }\n        /** Note: If property cannot be a SpreadAssignment, then allProperties does not need to be provided */\n        function checkObjectLiteralDestructuringPropertyAssignment(node, objectLiteralType, propertyIndex, allProperties, rightIsThis) {\n            if (rightIsThis === void 0) { rightIsThis = false; }\n            var properties = node.properties;\n            var property = properties[propertyIndex];\n            if (property.kind === 288 /* PropertyAssignment */ || property.kind === 289 /* ShorthandPropertyAssignment */) {\n                var name = property.name;\n                var exprType = getLiteralTypeFromPropertyName(name);\n                if (isTypeUsableAsPropertyName(exprType)) {\n                    var text = getPropertyNameFromType(exprType);\n                    var prop = getPropertyOfType(objectLiteralType, text);\n                    if (prop) {\n                        markPropertyAsReferenced(prop, property, rightIsThis);\n                        checkPropertyAccessibility(property, /*isSuper*/ false, objectLiteralType, prop);\n                    }\n                }\n                var elementType = getIndexedAccessType(objectLiteralType, exprType, /*noUncheckedIndexedAccessCandidate*/ undefined, name, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, 16 /* ExpressionPosition */);\n                var type = getFlowTypeOfDestructuring(property, elementType);\n                return checkDestructuringAssignment(property.kind === 289 /* ShorthandPropertyAssignment */ ? property : property.initializer, type);\n            }\n            else if (property.kind === 290 /* SpreadAssignment */) {\n                if (propertyIndex < properties.length - 1) {\n                    error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);\n                }\n                else {\n                    if (languageVersion < 99 /* ESNext */) {\n                        checkExternalEmitHelpers(property, 4 /* Rest */);\n                    }\n                    var nonRestNames = [];\n                    if (allProperties) {\n                        for (var _i = 0, allProperties_1 = allProperties; _i < allProperties_1.length; _i++) {\n                            var otherProperty = allProperties_1[_i];\n                            if (!ts.isSpreadAssignment(otherProperty)) {\n                                nonRestNames.push(otherProperty.name);\n                            }\n                        }\n                    }\n                    var type = getRestType(objectLiteralType, nonRestNames, objectLiteralType.symbol);\n                    checkGrammarForDisallowedTrailingComma(allProperties, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);\n                    return checkDestructuringAssignment(property.expression, type);\n                }\n            }\n            else {\n                error(property, ts.Diagnostics.Property_assignment_expected);\n            }\n        }\n        function checkArrayLiteralAssignment(node, sourceType, checkMode) {\n            var elements = node.elements;\n            if (languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) {\n                checkExternalEmitHelpers(node, 512 /* Read */);\n            }\n            // This elementType will be used if the specific property corresponding to this index is not\n            // present (aka the tuple element property). This call also checks that the parentType is in\n            // fact an iterable or array (depending on target language).\n            var possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 /* Destructuring */ | 128 /* PossiblyOutOfBounds */, sourceType, undefinedType, node) || errorType;\n            var inBoundsType = compilerOptions.noUncheckedIndexedAccess ? undefined : possiblyOutOfBoundsType;\n            for (var i = 0; i < elements.length; i++) {\n                var type = possiblyOutOfBoundsType;\n                if (node.elements[i].kind === 220 /* SpreadElement */) {\n                    type = inBoundsType = inBoundsType !== null && inBoundsType !== void 0 ? inBoundsType : (checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType);\n                }\n                checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, type, checkMode);\n            }\n            return sourceType;\n        }\n        function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) {\n            var elements = node.elements;\n            var element = elements[elementIndex];\n            if (element.kind !== 222 /* OmittedExpression */) {\n                if (element.kind !== 220 /* SpreadElement */) {\n                    var indexType = getLiteralType(elementIndex);\n                    if (isArrayLikeType(sourceType)) {\n                        // We create a synthetic expression so that getIndexedAccessType doesn't get confused\n                        // when the element is a SyntaxKind.ElementAccessExpression.\n                        var accessFlags = 16 /* ExpressionPosition */ | (hasDefaultValue(element) ? 8 /* NoTupleBoundsCheck */ : 0);\n                        var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, createSyntheticExpression(element, indexType), accessFlags) || errorType;\n                        var assignedType = hasDefaultValue(element) ? getTypeWithFacts(elementType_2, 524288 /* NEUndefined */) : elementType_2;\n                        var type = getFlowTypeOfDestructuring(element, assignedType);\n                        return checkDestructuringAssignment(element, type, checkMode);\n                    }\n                    return checkDestructuringAssignment(element, elementType, checkMode);\n                }\n                if (elementIndex < elements.length - 1) {\n                    error(element, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);\n                }\n                else {\n                    var restExpression = element.expression;\n                    if (restExpression.kind === 216 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) {\n                        error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer);\n                    }\n                    else {\n                        checkGrammarForDisallowedTrailingComma(node.elements, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);\n                        var type = everyType(sourceType, isTupleType) ?\n                            mapType(sourceType, function (t) { return sliceTupleType(t, elementIndex); }) :\n                            createArrayType(elementType);\n                        return checkDestructuringAssignment(restExpression, type, checkMode);\n                    }\n                }\n            }\n            return undefined;\n        }\n        function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) {\n            var target;\n            if (exprOrAssignment.kind === 289 /* ShorthandPropertyAssignment */) {\n                var prop = exprOrAssignment;\n                if (prop.objectAssignmentInitializer) {\n                    // In strict null checking mode, if a default value of a non-undefined type is specified, remove\n                    // undefined from the final type.\n                    if (strictNullChecks &&\n                        !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 32768 /* Undefined */)) {\n                        sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */);\n                    }\n                    checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode);\n                }\n                target = exprOrAssignment.name;\n            }\n            else {\n                target = exprOrAssignment;\n            }\n            if (target.kind === 216 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) {\n                checkBinaryExpression(target, checkMode);\n                target = target.left;\n            }\n            if (target.kind === 200 /* ObjectLiteralExpression */) {\n                return checkObjectLiteralAssignment(target, sourceType, rightIsThis);\n            }\n            if (target.kind === 199 /* ArrayLiteralExpression */) {\n                return checkArrayLiteralAssignment(target, sourceType, checkMode);\n            }\n            return checkReferenceAssignment(target, sourceType, checkMode);\n        }\n        function checkReferenceAssignment(target, sourceType, checkMode) {\n            var targetType = checkExpression(target, checkMode);\n            var error = target.parent.kind === 290 /* SpreadAssignment */ ?\n                ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access :\n                ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access;\n            var optionalError = target.parent.kind === 290 /* SpreadAssignment */ ?\n                ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access :\n                ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access;\n            if (checkReferenceExpression(target, error, optionalError)) {\n                checkTypeAssignableToAndOptionallyElaborate(sourceType, targetType, target, target);\n            }\n            if (ts.isPrivateIdentifierPropertyAccessExpression(target)) {\n                checkExternalEmitHelpers(target.parent, 1048576 /* ClassPrivateFieldSet */);\n            }\n            return sourceType;\n        }\n        /**\n         * This is a *shallow* check: An expression is side-effect-free if the\n         * evaluation of the expression *itself* cannot produce side effects.\n         * For example, x++ / 3 is side-effect free because the / operator\n         * does not have side effects.\n         * The intent is to \"smell test\" an expression for correctness in positions where\n         * its value is discarded (e.g. the left side of the comma operator).\n         */\n        function isSideEffectFree(node) {\n            node = ts.skipParentheses(node);\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                case 10 /* StringLiteral */:\n                case 13 /* RegularExpressionLiteral */:\n                case 205 /* TaggedTemplateExpression */:\n                case 218 /* TemplateExpression */:\n                case 14 /* NoSubstitutionTemplateLiteral */:\n                case 8 /* NumericLiteral */:\n                case 9 /* BigIntLiteral */:\n                case 109 /* TrueKeyword */:\n                case 94 /* FalseKeyword */:\n                case 103 /* NullKeyword */:\n                case 150 /* UndefinedKeyword */:\n                case 208 /* FunctionExpression */:\n                case 221 /* ClassExpression */:\n                case 209 /* ArrowFunction */:\n                case 199 /* ArrayLiteralExpression */:\n                case 200 /* ObjectLiteralExpression */:\n                case 211 /* TypeOfExpression */:\n                case 225 /* NonNullExpression */:\n                case 274 /* JsxSelfClosingElement */:\n                case 273 /* JsxElement */:\n                    return true;\n                case 217 /* ConditionalExpression */:\n                    return isSideEffectFree(node.whenTrue) &&\n                        isSideEffectFree(node.whenFalse);\n                case 216 /* BinaryExpression */:\n                    if (ts.isAssignmentOperator(node.operatorToken.kind)) {\n                        return false;\n                    }\n                    return isSideEffectFree(node.left) &&\n                        isSideEffectFree(node.right);\n                case 214 /* PrefixUnaryExpression */:\n                case 215 /* PostfixUnaryExpression */:\n                    // Unary operators ~, !, +, and - have no side effects.\n                    // The rest do.\n                    switch (node.operator) {\n                        case 53 /* ExclamationToken */:\n                        case 39 /* PlusToken */:\n                        case 40 /* MinusToken */:\n                        case 54 /* TildeToken */:\n                            return true;\n                    }\n                    return false;\n                // Some forms listed here for clarity\n                case 212 /* VoidExpression */: // Explicit opt-out\n                case 206 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings\n                case 224 /* AsExpression */: // Not SEF, but can produce useful type warnings\n                default:\n                    return false;\n            }\n        }\n        function isTypeEqualityComparableTo(source, target) {\n            return (target.flags & 98304 /* Nullable */) !== 0 || isTypeComparableTo(source, target);\n        }\n        var CheckBinaryExpressionState;\n        (function (CheckBinaryExpressionState) {\n            CheckBinaryExpressionState[CheckBinaryExpressionState[\"MaybeCheckLeft\"] = 0] = \"MaybeCheckLeft\";\n            CheckBinaryExpressionState[CheckBinaryExpressionState[\"CheckRight\"] = 1] = \"CheckRight\";\n            CheckBinaryExpressionState[CheckBinaryExpressionState[\"FinishCheck\"] = 2] = \"FinishCheck\";\n        })(CheckBinaryExpressionState || (CheckBinaryExpressionState = {}));\n        function checkBinaryExpression(node, checkMode) {\n            var workStacks = {\n                expr: [node],\n                state: [0 /* MaybeCheckLeft */],\n                leftType: [undefined]\n            };\n            var stackIndex = 0;\n            var lastResult;\n            while (stackIndex >= 0) {\n                node = workStacks.expr[stackIndex];\n                switch (workStacks.state[stackIndex]) {\n                    case 0 /* MaybeCheckLeft */: {\n                        if (ts.isInJSFile(node) && ts.getAssignedExpandoInitializer(node)) {\n                            finishInvocation(checkExpression(node.right, checkMode));\n                            break;\n                        }\n                        checkGrammarNullishCoalesceWithLogicalExpression(node);\n                        var operator = node.operatorToken.kind;\n                        if (operator === 62 /* EqualsToken */ && (node.left.kind === 200 /* ObjectLiteralExpression */ || node.left.kind === 199 /* ArrayLiteralExpression */)) {\n                            finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 107 /* ThisKeyword */));\n                            break;\n                        }\n                        advanceState(1 /* CheckRight */);\n                        maybeCheckExpression(node.left);\n                        break;\n                    }\n                    case 1 /* CheckRight */: {\n                        var leftType = lastResult;\n                        workStacks.leftType[stackIndex] = leftType;\n                        var operator = node.operatorToken.kind;\n                        if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) {\n                            if (operator === 55 /* AmpersandAmpersandToken */) {\n                                var parent = ts.walkUpParenthesizedExpressions(node.parent);\n                                checkTestingKnownTruthyCallableType(node.left, leftType, ts.isIfStatement(parent) ? parent.thenStatement : undefined);\n                            }\n                            checkTruthinessOfType(leftType, node.left);\n                        }\n                        advanceState(2 /* FinishCheck */);\n                        maybeCheckExpression(node.right);\n                        break;\n                    }\n                    case 2 /* FinishCheck */: {\n                        var leftType = workStacks.leftType[stackIndex];\n                        var rightType = lastResult;\n                        finishInvocation(checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, node));\n                        break;\n                    }\n                    default: return ts.Debug.fail(\"Invalid state \" + workStacks.state[stackIndex] + \" for checkBinaryExpression\");\n                }\n            }\n            return lastResult;\n            function finishInvocation(result) {\n                lastResult = result;\n                stackIndex--;\n            }\n            /**\n             * Note that `advanceState` sets the _current_ head state, and that `maybeCheckExpression` potentially pushes on a new\n             * head state; so `advanceState` must be called before any `maybeCheckExpression` during a state's execution.\n             */\n            function advanceState(nextState) {\n                workStacks.state[stackIndex] = nextState;\n            }\n            function maybeCheckExpression(node) {\n                if (ts.isBinaryExpression(node)) {\n                    stackIndex++;\n                    workStacks.expr[stackIndex] = node;\n                    workStacks.state[stackIndex] = 0 /* MaybeCheckLeft */;\n                    workStacks.leftType[stackIndex] = undefined;\n                }\n                else {\n                    lastResult = checkExpression(node, checkMode);\n                }\n            }\n        }\n        function checkGrammarNullishCoalesceWithLogicalExpression(node) {\n            var left = node.left, operatorToken = node.operatorToken, right = node.right;\n            if (operatorToken.kind === 60 /* QuestionQuestionToken */) {\n                if (ts.isBinaryExpression(left) && (left.operatorToken.kind === 56 /* BarBarToken */ || left.operatorToken.kind === 55 /* AmpersandAmpersandToken */)) {\n                    grammarErrorOnNode(left, ts.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, ts.tokenToString(left.operatorToken.kind), ts.tokenToString(operatorToken.kind));\n                }\n                if (ts.isBinaryExpression(right) && (right.operatorToken.kind === 56 /* BarBarToken */ || right.operatorToken.kind === 55 /* AmpersandAmpersandToken */)) {\n                    grammarErrorOnNode(right, ts.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, ts.tokenToString(right.operatorToken.kind), ts.tokenToString(operatorToken.kind));\n                }\n            }\n        }\n        // Note that this and `checkBinaryExpression` above should behave mostly the same, except this elides some\n        // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame\n        function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) {\n            var operator = operatorToken.kind;\n            if (operator === 62 /* EqualsToken */ && (left.kind === 200 /* ObjectLiteralExpression */ || left.kind === 199 /* ArrayLiteralExpression */)) {\n                return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 107 /* ThisKeyword */);\n            }\n            var leftType;\n            if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */) {\n                leftType = checkTruthinessExpression(left, checkMode);\n            }\n            else {\n                leftType = checkExpression(left, checkMode);\n            }\n            var rightType = checkExpression(right, checkMode);\n            return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode);\n        }\n        function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode) {\n            var operator = operatorToken.kind;\n            switch (operator) {\n                case 41 /* AsteriskToken */:\n                case 42 /* AsteriskAsteriskToken */:\n                case 65 /* AsteriskEqualsToken */:\n                case 66 /* AsteriskAsteriskEqualsToken */:\n                case 43 /* SlashToken */:\n                case 67 /* SlashEqualsToken */:\n                case 44 /* PercentToken */:\n                case 68 /* PercentEqualsToken */:\n                case 40 /* MinusToken */:\n                case 64 /* MinusEqualsToken */:\n                case 47 /* LessThanLessThanToken */:\n                case 69 /* LessThanLessThanEqualsToken */:\n                case 48 /* GreaterThanGreaterThanToken */:\n                case 70 /* GreaterThanGreaterThanEqualsToken */:\n                case 49 /* GreaterThanGreaterThanGreaterThanToken */:\n                case 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */:\n                case 51 /* BarToken */:\n                case 73 /* BarEqualsToken */:\n                case 52 /* CaretToken */:\n                case 77 /* CaretEqualsToken */:\n                case 50 /* AmpersandToken */:\n                case 72 /* AmpersandEqualsToken */:\n                    if (leftType === silentNeverType || rightType === silentNeverType) {\n                        return silentNeverType;\n                    }\n                    leftType = checkNonNullType(leftType, left);\n                    rightType = checkNonNullType(rightType, right);\n                    var suggestedOperator = void 0;\n                    // if a user tries to apply a bitwise operator to 2 boolean operands\n                    // try and return them a helpful suggestion\n                    if ((leftType.flags & 528 /* BooleanLike */) &&\n                        (rightType.flags & 528 /* BooleanLike */) &&\n                        (suggestedOperator = getSuggestedBooleanOperator(operatorToken.kind)) !== undefined) {\n                        error(errorNode || operatorToken, ts.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, ts.tokenToString(operatorToken.kind), ts.tokenToString(suggestedOperator));\n                        return numberType;\n                    }\n                    else {\n                        // otherwise just check each operand separately and report errors as normal\n                        var leftOk = checkArithmeticOperandType(left, leftType, ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, /*isAwaitValid*/ true);\n                        var rightOk = checkArithmeticOperandType(right, rightType, ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, /*isAwaitValid*/ true);\n                        var resultType_1;\n                        // If both are any or unknown, allow operation; assume it will resolve to number\n                        if ((isTypeAssignableToKind(leftType, 3 /* AnyOrUnknown */) && isTypeAssignableToKind(rightType, 3 /* AnyOrUnknown */)) ||\n                            // Or, if neither could be bigint, implicit coercion results in a number result\n                            !(maybeTypeOfKind(leftType, 2112 /* BigIntLike */) || maybeTypeOfKind(rightType, 2112 /* BigIntLike */))) {\n                            resultType_1 = numberType;\n                        }\n                        // At least one is assignable to bigint, so check that both are\n                        else if (bothAreBigIntLike(leftType, rightType)) {\n                            switch (operator) {\n                                case 49 /* GreaterThanGreaterThanGreaterThanToken */:\n                                case 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */:\n                                    reportOperatorError();\n                                    break;\n                                case 42 /* AsteriskAsteriskToken */:\n                                case 66 /* AsteriskAsteriskEqualsToken */:\n                                    if (languageVersion < 3 /* ES2016 */) {\n                                        error(errorNode, ts.Diagnostics.Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later);\n                                    }\n                            }\n                            resultType_1 = bigintType;\n                        }\n                        // Exactly one of leftType/rightType is assignable to bigint\n                        else {\n                            reportOperatorError(bothAreBigIntLike);\n                            resultType_1 = errorType;\n                        }\n                        if (leftOk && rightOk) {\n                            checkAssignmentOperator(resultType_1);\n                        }\n                        return resultType_1;\n                    }\n                case 39 /* PlusToken */:\n                case 63 /* PlusEqualsToken */:\n                    if (leftType === silentNeverType || rightType === silentNeverType) {\n                        return silentNeverType;\n                    }\n                    if (!isTypeAssignableToKind(leftType, 402653316 /* StringLike */) && !isTypeAssignableToKind(rightType, 402653316 /* StringLike */)) {\n                        leftType = checkNonNullType(leftType, left);\n                        rightType = checkNonNullType(rightType, right);\n                    }\n                    var resultType = void 0;\n                    if (isTypeAssignableToKind(leftType, 296 /* NumberLike */, /*strict*/ true) && isTypeAssignableToKind(rightType, 296 /* NumberLike */, /*strict*/ true)) {\n                        // Operands of an enum type are treated as having the primitive type Number.\n                        // If both operands are of the Number primitive type, the result is of the Number primitive type.\n                        resultType = numberType;\n                    }\n                    else if (isTypeAssignableToKind(leftType, 2112 /* BigIntLike */, /*strict*/ true) && isTypeAssignableToKind(rightType, 2112 /* BigIntLike */, /*strict*/ true)) {\n                        // If both operands are of the BigInt primitive type, the result is of the BigInt primitive type.\n                        resultType = bigintType;\n                    }\n                    else if (isTypeAssignableToKind(leftType, 402653316 /* StringLike */, /*strict*/ true) || isTypeAssignableToKind(rightType, 402653316 /* StringLike */, /*strict*/ true)) {\n                        // If one or both operands are of the String primitive type, the result is of the String primitive type.\n                        resultType = stringType;\n                    }\n                    else if (isTypeAny(leftType) || isTypeAny(rightType)) {\n                        // Otherwise, the result is of type Any.\n                        // NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we.\n                        resultType = leftType === errorType || rightType === errorType ? errorType : anyType;\n                    }\n                    // Symbols are not allowed at all in arithmetic expressions\n                    if (resultType && !checkForDisallowedESSymbolOperand(operator)) {\n                        return resultType;\n                    }\n                    if (!resultType) {\n                        // Types that have a reasonably good chance of being a valid operand type.\n                        // If both types have an awaited type of one of these, we'll assume the user\n                        // might be missing an await without doing an exhaustive check that inserting\n                        // await(s) will actually be a completely valid binary expression.\n                        var closeEnoughKind_1 = 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 3 /* AnyOrUnknown */;\n                        reportOperatorError(function (left, right) {\n                            return isTypeAssignableToKind(left, closeEnoughKind_1) &&\n                                isTypeAssignableToKind(right, closeEnoughKind_1);\n                        });\n                        return anyType;\n                    }\n                    if (operator === 63 /* PlusEqualsToken */) {\n                        checkAssignmentOperator(resultType);\n                    }\n                    return resultType;\n                case 29 /* LessThanToken */:\n                case 31 /* GreaterThanToken */:\n                case 32 /* LessThanEqualsToken */:\n                case 33 /* GreaterThanEqualsToken */:\n                    if (checkForDisallowedESSymbolOperand(operator)) {\n                        leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left));\n                        rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right));\n                        reportOperatorErrorUnless(function (left, right) {\n                            return isTypeComparableTo(left, right) || isTypeComparableTo(right, left) || (isTypeAssignableTo(left, numberOrBigIntType) && isTypeAssignableTo(right, numberOrBigIntType));\n                        });\n                    }\n                    return booleanType;\n                case 34 /* EqualsEqualsToken */:\n                case 35 /* ExclamationEqualsToken */:\n                case 36 /* EqualsEqualsEqualsToken */:\n                case 37 /* ExclamationEqualsEqualsToken */:\n                    reportOperatorErrorUnless(function (left, right) { return isTypeEqualityComparableTo(left, right) || isTypeEqualityComparableTo(right, left); });\n                    return booleanType;\n                case 101 /* InstanceOfKeyword */:\n                    return checkInstanceOfExpression(left, right, leftType, rightType);\n                case 100 /* InKeyword */:\n                    return checkInExpression(left, right, leftType, rightType);\n                case 55 /* AmpersandAmpersandToken */:\n                case 75 /* AmpersandAmpersandEqualsToken */: {\n                    var resultType_2 = getTypeFacts(leftType) & 4194304 /* Truthy */ ?\n                        getUnionType([extractDefinitelyFalsyTypes(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType)), rightType]) :\n                        leftType;\n                    if (operator === 75 /* AmpersandAmpersandEqualsToken */) {\n                        checkAssignmentOperator(rightType);\n                    }\n                    return resultType_2;\n                }\n                case 56 /* BarBarToken */:\n                case 74 /* BarBarEqualsToken */: {\n                    var resultType_3 = getTypeFacts(leftType) & 8388608 /* Falsy */ ?\n                        getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2 /* Subtype */) :\n                        leftType;\n                    if (operator === 74 /* BarBarEqualsToken */) {\n                        checkAssignmentOperator(rightType);\n                    }\n                    return resultType_3;\n                }\n                case 60 /* QuestionQuestionToken */:\n                case 76 /* QuestionQuestionEqualsToken */: {\n                    var resultType_4 = getTypeFacts(leftType) & 262144 /* EQUndefinedOrNull */ ?\n                        getUnionType([getNonNullableType(leftType), rightType], 2 /* Subtype */) :\n                        leftType;\n                    if (operator === 76 /* QuestionQuestionEqualsToken */) {\n                        checkAssignmentOperator(rightType);\n                    }\n                    return resultType_4;\n                }\n                case 62 /* EqualsToken */:\n                    var declKind = ts.isBinaryExpression(left.parent) ? ts.getAssignmentDeclarationKind(left.parent) : 0 /* None */;\n                    checkAssignmentDeclaration(declKind, rightType);\n                    if (isAssignmentDeclaration(declKind)) {\n                        if (!(rightType.flags & 524288 /* Object */) ||\n                            declKind !== 2 /* ModuleExports */ &&\n                                declKind !== 6 /* Prototype */ &&\n                                !isEmptyObjectType(rightType) &&\n                                !isFunctionObjectType(rightType) &&\n                                !(ts.getObjectFlags(rightType) & 1 /* Class */)) {\n                            // don't check assignability of module.exports=, C.prototype=, or expando types because they will necessarily be incomplete\n                            checkAssignmentOperator(rightType);\n                        }\n                        return leftType;\n                    }\n                    else {\n                        checkAssignmentOperator(rightType);\n                        return getRegularTypeOfObjectLiteral(rightType);\n                    }\n                case 27 /* CommaToken */:\n                    if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isEvalNode(right)) {\n                        var sf = ts.getSourceFileOfNode(left);\n                        var sourceText = sf.text;\n                        var start_3 = ts.skipTrivia(sourceText, left.pos);\n                        var isInDiag2657 = sf.parseDiagnostics.some(function (diag) {\n                            if (diag.code !== ts.Diagnostics.JSX_expressions_must_have_one_parent_element.code)\n                                return false;\n                            return ts.textSpanContainsPosition(diag, start_3);\n                        });\n                        if (!isInDiag2657)\n                            error(left, ts.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);\n                    }\n                    return rightType;\n                default:\n                    return ts.Debug.fail();\n            }\n            function bothAreBigIntLike(left, right) {\n                return isTypeAssignableToKind(left, 2112 /* BigIntLike */) && isTypeAssignableToKind(right, 2112 /* BigIntLike */);\n            }\n            function checkAssignmentDeclaration(kind, rightType) {\n                if (kind === 2 /* ModuleExports */) {\n                    for (var _i = 0, _a = getPropertiesOfObjectType(rightType); _i < _a.length; _i++) {\n                        var prop = _a[_i];\n                        var propType = getTypeOfSymbol(prop);\n                        if (propType.symbol && propType.symbol.flags & 32 /* Class */) {\n                            var name = prop.escapedName;\n                            var symbol = resolveName(prop.valueDeclaration, name, 788968 /* Type */, undefined, name, /*isUse*/ false);\n                            if (symbol && symbol.declarations.some(ts.isJSDocTypedefTag)) {\n                                addDuplicateDeclarationErrorsForSymbols(symbol, ts.Diagnostics.Duplicate_identifier_0, ts.unescapeLeadingUnderscores(name), prop);\n                                addDuplicateDeclarationErrorsForSymbols(prop, ts.Diagnostics.Duplicate_identifier_0, ts.unescapeLeadingUnderscores(name), symbol);\n                            }\n                        }\n                    }\n                }\n            }\n            function isEvalNode(node) {\n                return node.kind === 78 /* Identifier */ && node.escapedText === \"eval\";\n            }\n            // Return true if there was no error, false if there was an error.\n            function checkForDisallowedESSymbolOperand(operator) {\n                var offendingSymbolOperand = maybeTypeOfKind(leftType, 12288 /* ESSymbolLike */) ? left :\n                    maybeTypeOfKind(rightType, 12288 /* ESSymbolLike */) ? right :\n                        undefined;\n                if (offendingSymbolOperand) {\n                    error(offendingSymbolOperand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(operator));\n                    return false;\n                }\n                return true;\n            }\n            function getSuggestedBooleanOperator(operator) {\n                switch (operator) {\n                    case 51 /* BarToken */:\n                    case 73 /* BarEqualsToken */:\n                        return 56 /* BarBarToken */;\n                    case 52 /* CaretToken */:\n                    case 77 /* CaretEqualsToken */:\n                        return 37 /* ExclamationEqualsEqualsToken */;\n                    case 50 /* AmpersandToken */:\n                    case 72 /* AmpersandEqualsToken */:\n                        return 55 /* AmpersandAmpersandToken */;\n                    default:\n                        return undefined;\n                }\n            }\n            function checkAssignmentOperator(valueType) {\n                if (produceDiagnostics && ts.isAssignmentOperator(operator)) {\n                    // TypeScript 1.0 spec (April 2014): 4.17\n                    // An assignment of the form\n                    //    VarExpr = ValueExpr\n                    // requires VarExpr to be classified as a reference\n                    // A compound assignment furthermore requires VarExpr to be classified as a reference (section 4.1)\n                    // and the type of the non-compound operation to be assignable to the type of VarExpr.\n                    if (checkReferenceExpression(left, ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access, ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access)\n                        && (!ts.isIdentifier(left) || ts.unescapeLeadingUnderscores(left.escapedText) !== \"exports\")) {\n                        // to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported\n                        checkTypeAssignableToAndOptionallyElaborate(valueType, leftType, left, right);\n                    }\n                }\n            }\n            function isAssignmentDeclaration(kind) {\n                var _a;\n                switch (kind) {\n                    case 2 /* ModuleExports */:\n                        return true;\n                    case 1 /* ExportsProperty */:\n                    case 5 /* Property */:\n                    case 6 /* Prototype */:\n                    case 3 /* PrototypeProperty */:\n                    case 4 /* ThisProperty */:\n                        var symbol = getSymbolOfNode(left);\n                        var init = ts.getAssignedExpandoInitializer(right);\n                        return !!init && ts.isObjectLiteralExpression(init) &&\n                            !!((_a = symbol === null || symbol === void 0 ? void 0 : symbol.exports) === null || _a === void 0 ? void 0 : _a.size);\n                    default:\n                        return false;\n                }\n            }\n            /**\n             * Returns true if an error is reported\n             */\n            function reportOperatorErrorUnless(typesAreCompatible) {\n                if (!typesAreCompatible(leftType, rightType)) {\n                    reportOperatorError(typesAreCompatible);\n                    return true;\n                }\n                return false;\n            }\n            function reportOperatorError(isRelated) {\n                var _a;\n                var wouldWorkWithAwait = false;\n                var errNode = errorNode || operatorToken;\n                if (isRelated) {\n                    var awaitedLeftType = getAwaitedType(leftType);\n                    var awaitedRightType = getAwaitedType(rightType);\n                    wouldWorkWithAwait = !(awaitedLeftType === leftType && awaitedRightType === rightType)\n                        && !!(awaitedLeftType && awaitedRightType)\n                        && isRelated(awaitedLeftType, awaitedRightType);\n                }\n                var effectiveLeft = leftType;\n                var effectiveRight = rightType;\n                if (!wouldWorkWithAwait && isRelated) {\n                    _a = getBaseTypesIfUnrelated(leftType, rightType, isRelated), effectiveLeft = _a[0], effectiveRight = _a[1];\n                }\n                var _b = getTypeNamesForErrorDisplay(effectiveLeft, effectiveRight), leftStr = _b[0], rightStr = _b[1];\n                if (!tryGiveBetterPrimaryError(errNode, wouldWorkWithAwait, leftStr, rightStr)) {\n                    errorAndMaybeSuggestAwait(errNode, wouldWorkWithAwait, ts.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2, ts.tokenToString(operatorToken.kind), leftStr, rightStr);\n                }\n            }\n            function tryGiveBetterPrimaryError(errNode, maybeMissingAwait, leftStr, rightStr) {\n                var typeName;\n                switch (operatorToken.kind) {\n                    case 36 /* EqualsEqualsEqualsToken */:\n                    case 34 /* EqualsEqualsToken */:\n                        typeName = \"false\";\n                        break;\n                    case 37 /* ExclamationEqualsEqualsToken */:\n                    case 35 /* ExclamationEqualsToken */:\n                        typeName = \"true\";\n                }\n                if (typeName) {\n                    return errorAndMaybeSuggestAwait(errNode, maybeMissingAwait, ts.Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap, typeName, leftStr, rightStr);\n                }\n                return undefined;\n            }\n        }\n        function getBaseTypesIfUnrelated(leftType, rightType, isRelated) {\n            var effectiveLeft = leftType;\n            var effectiveRight = rightType;\n            var leftBase = getBaseTypeOfLiteralType(leftType);\n            var rightBase = getBaseTypeOfLiteralType(rightType);\n            if (!isRelated(leftBase, rightBase)) {\n                effectiveLeft = leftBase;\n                effectiveRight = rightBase;\n            }\n            return [effectiveLeft, effectiveRight];\n        }\n        function checkYieldExpression(node) {\n            // Grammar checking\n            if (produceDiagnostics) {\n                if (!(node.flags & 8192 /* YieldContext */)) {\n                    grammarErrorOnFirstToken(node, ts.Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body);\n                }\n                if (isInParameterInitializerBeforeContainingFunction(node)) {\n                    error(node, ts.Diagnostics.yield_expressions_cannot_be_used_in_a_parameter_initializer);\n                }\n            }\n            var func = ts.getContainingFunction(node);\n            if (!func)\n                return anyType;\n            var functionFlags = ts.getFunctionFlags(func);\n            if (!(functionFlags & 1 /* Generator */)) {\n                // If the user's code is syntactically correct, the func should always have a star. After all, we are in a yield context.\n                return anyType;\n            }\n            var isAsync = (functionFlags & 2 /* Async */) !== 0;\n            if (node.asteriskToken) {\n                // Async generator functions prior to ESNext require the __await, __asyncDelegator,\n                // and __asyncValues helpers\n                if (isAsync && languageVersion < 99 /* ESNext */) {\n                    checkExternalEmitHelpers(node, 26624 /* AsyncDelegatorIncludes */);\n                }\n                // Generator functions prior to ES2015 require the __values helper\n                if (!isAsync && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) {\n                    checkExternalEmitHelpers(node, 256 /* Values */);\n                }\n            }\n            // There is no point in doing an assignability check if the function\n            // has no explicit return type because the return type is directly computed\n            // from the yield expressions.\n            var returnType = getReturnTypeFromAnnotation(func);\n            var iterationTypes = returnType && getIterationTypesOfGeneratorFunctionReturnType(returnType, isAsync);\n            var signatureYieldType = iterationTypes && iterationTypes.yieldType || anyType;\n            var signatureNextType = iterationTypes && iterationTypes.nextType || anyType;\n            var resolvedSignatureNextType = isAsync ? getAwaitedType(signatureNextType) || anyType : signatureNextType;\n            var yieldExpressionType = node.expression ? checkExpression(node.expression) : undefinedWideningType;\n            var yieldedType = getYieldedTypeOfYieldExpression(node, yieldExpressionType, resolvedSignatureNextType, isAsync);\n            if (returnType && yieldedType) {\n                checkTypeAssignableToAndOptionallyElaborate(yieldedType, signatureYieldType, node.expression || node, node.expression);\n            }\n            if (node.asteriskToken) {\n                var use = isAsync ? 19 /* AsyncYieldStar */ : 17 /* YieldStar */;\n                return getIterationTypeOfIterable(use, 1 /* Return */, yieldExpressionType, node.expression)\n                    || anyType;\n            }\n            else if (returnType) {\n                return getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, isAsync)\n                    || anyType;\n            }\n            var type = getContextualIterationType(2 /* Next */, func);\n            if (!type) {\n                type = anyType;\n                if (produceDiagnostics && noImplicitAny && !ts.expressionResultIsUnused(node)) {\n                    var contextualType = getContextualType(node);\n                    if (!contextualType || isTypeAny(contextualType)) {\n                        error(node, ts.Diagnostics.yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation);\n                    }\n                }\n            }\n            return type;\n        }\n        function checkConditionalExpression(node, checkMode) {\n            var type = checkTruthinessExpression(node.condition);\n            checkTestingKnownTruthyCallableType(node.condition, type, node.whenTrue);\n            var type1 = checkExpression(node.whenTrue, checkMode);\n            var type2 = checkExpression(node.whenFalse, checkMode);\n            return getUnionType([type1, type2], 2 /* Subtype */);\n        }\n        function checkTemplateExpression(node) {\n            var texts = [node.head.text];\n            var types = [];\n            for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) {\n                var span = _a[_i];\n                var type = checkExpression(span.expression);\n                if (maybeTypeOfKind(type, 12288 /* ESSymbolLike */)) {\n                    error(span.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String);\n                }\n                texts.push(span.literal.text);\n                types.push(isTypeAssignableTo(type, templateConstraintType) ? type : stringType);\n            }\n            return isConstContext(node) ? getTemplateLiteralType(texts, types) : stringType;\n        }\n        function getContextNode(node) {\n            if (node.kind === 281 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) {\n                return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes)\n            }\n            return node;\n        }\n        function checkExpressionWithContextualType(node, contextualType, inferenceContext, checkMode) {\n            var context = getContextNode(node);\n            var saveContextualType = context.contextualType;\n            var saveInferenceContext = context.inferenceContext;\n            try {\n                context.contextualType = contextualType;\n                context.inferenceContext = inferenceContext;\n                var type = checkExpression(node, checkMode | 1 /* Contextual */ | (inferenceContext ? 2 /* Inferential */ : 0));\n                // We strip literal freshness when an appropriate contextual type is present such that contextually typed\n                // literals always preserve their literal types (otherwise they might widen during type inference). An alternative\n                // here would be to not mark contextually typed literals as fresh in the first place.\n                var result = maybeTypeOfKind(type, 2944 /* Literal */) && isLiteralOfContextualType(type, instantiateContextualType(contextualType, node)) ?\n                    getRegularTypeOfLiteralType(type) : type;\n                return result;\n            }\n            finally {\n                // In the event our operation is canceled or some other exception occurs, reset the contextual type\n                // so that we do not accidentally hold onto an instance of the checker, as a Type created in the services layer\n                // may hold onto the checker that created it.\n                context.contextualType = saveContextualType;\n                context.inferenceContext = saveInferenceContext;\n            }\n        }\n        function checkExpressionCached(node, checkMode) {\n            var links = getNodeLinks(node);\n            if (!links.resolvedType) {\n                if (checkMode && checkMode !== 0 /* Normal */) {\n                    return checkExpression(node, checkMode);\n                }\n                // When computing a type that we're going to cache, we need to ignore any ongoing control flow\n                // analysis because variables may have transient types in indeterminable states. Moving flowLoopStart\n                // to the top of the stack ensures all transient types are computed from a known point.\n                var saveFlowLoopStart = flowLoopStart;\n                var saveFlowTypeCache = flowTypeCache;\n                flowLoopStart = flowLoopCount;\n                flowTypeCache = undefined;\n                links.resolvedType = checkExpression(node, checkMode);\n                flowTypeCache = saveFlowTypeCache;\n                flowLoopStart = saveFlowLoopStart;\n            }\n            return links.resolvedType;\n        }\n        function isTypeAssertion(node) {\n            node = ts.skipParentheses(node);\n            return node.kind === 206 /* TypeAssertionExpression */ || node.kind === 224 /* AsExpression */;\n        }\n        function checkDeclarationInitializer(declaration, contextualType) {\n            var initializer = ts.getEffectiveInitializer(declaration);\n            var type = getQuickTypeOfExpression(initializer) ||\n                (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer));\n            return ts.isParameter(declaration) && declaration.name.kind === 197 /* ArrayBindingPattern */ &&\n                isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ?\n                padTupleType(type, declaration.name) : type;\n        }\n        function padTupleType(type, pattern) {\n            var patternElements = pattern.elements;\n            var elementTypes = getTypeArguments(type).slice();\n            var elementFlags = type.target.elementFlags.slice();\n            for (var i = getTypeReferenceArity(type); i < patternElements.length; i++) {\n                var e = patternElements[i];\n                if (i < patternElements.length - 1 || !(e.kind === 198 /* BindingElement */ && e.dotDotDotToken)) {\n                    elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType);\n                    elementFlags.push(2 /* Optional */);\n                    if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) {\n                        reportImplicitAny(e, anyType);\n                    }\n                }\n            }\n            return createTupleType(elementTypes, elementFlags, type.target.readonly);\n        }\n        function widenTypeInferredFromInitializer(declaration, type) {\n            var widened = ts.getCombinedNodeFlags(declaration) & 2 /* Const */ || ts.isDeclarationReadonly(declaration) ? type : getWidenedLiteralType(type);\n            if (ts.isInJSFile(declaration)) {\n                if (widened.flags & 98304 /* Nullable */) {\n                    reportImplicitAny(declaration, anyType);\n                    return anyType;\n                }\n                else if (isEmptyArrayLiteralType(widened)) {\n                    reportImplicitAny(declaration, anyArrayType);\n                    return anyArrayType;\n                }\n            }\n            return widened;\n        }\n        function isLiteralOfContextualType(candidateType, contextualType) {\n            if (contextualType) {\n                if (contextualType.flags & 3145728 /* UnionOrIntersection */) {\n                    var types = contextualType.types;\n                    return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); });\n                }\n                if (contextualType.flags & 58982400 /* InstantiableNonPrimitive */) {\n                    // If the contextual type is a type variable constrained to a primitive type, consider\n                    // this a literal context for literals of that primitive type. For example, given a\n                    // type parameter 'T extends string', infer string literal types for T.\n                    var constraint = getBaseConstraintOfType(contextualType) || unknownType;\n                    return maybeTypeOfKind(constraint, 4 /* String */) && maybeTypeOfKind(candidateType, 128 /* StringLiteral */) ||\n                        maybeTypeOfKind(constraint, 8 /* Number */) && maybeTypeOfKind(candidateType, 256 /* NumberLiteral */) ||\n                        maybeTypeOfKind(constraint, 64 /* BigInt */) && maybeTypeOfKind(candidateType, 2048 /* BigIntLiteral */) ||\n                        maybeTypeOfKind(constraint, 4096 /* ESSymbol */) && maybeTypeOfKind(candidateType, 8192 /* UniqueESSymbol */) ||\n                        isLiteralOfContextualType(candidateType, constraint);\n                }\n                // If the contextual type is a literal of a particular primitive type, we consider this a\n                // literal context for all literals of that primitive type.\n                return !!(contextualType.flags & (128 /* StringLiteral */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && maybeTypeOfKind(candidateType, 128 /* StringLiteral */) ||\n                    contextualType.flags & 256 /* NumberLiteral */ && maybeTypeOfKind(candidateType, 256 /* NumberLiteral */) ||\n                    contextualType.flags & 2048 /* BigIntLiteral */ && maybeTypeOfKind(candidateType, 2048 /* BigIntLiteral */) ||\n                    contextualType.flags & 512 /* BooleanLiteral */ && maybeTypeOfKind(candidateType, 512 /* BooleanLiteral */) ||\n                    contextualType.flags & 8192 /* UniqueESSymbol */ && maybeTypeOfKind(candidateType, 8192 /* UniqueESSymbol */));\n            }\n            return false;\n        }\n        function isConstContext(node) {\n            var parent = node.parent;\n            return ts.isAssertionExpression(parent) && ts.isConstTypeReference(parent.type) ||\n                (ts.isParenthesizedExpression(parent) || ts.isArrayLiteralExpression(parent) || ts.isSpreadElement(parent)) && isConstContext(parent) ||\n                (ts.isPropertyAssignment(parent) || ts.isShorthandPropertyAssignment(parent) || ts.isTemplateSpan(parent)) && isConstContext(parent.parent);\n        }\n        function checkExpressionForMutableLocation(node, checkMode, contextualType, forceTuple) {\n            var type = checkExpression(node, checkMode, forceTuple);\n            return isConstContext(node) ? getRegularTypeOfLiteralType(type) :\n                isTypeAssertion(node) ? type :\n                    getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType(arguments.length === 2 ? getContextualType(node) : contextualType, node));\n        }\n        function checkPropertyAssignment(node, checkMode) {\n            // Do not use hasDynamicName here, because that returns false for well known symbols.\n            // We want to perform checkComputedPropertyName for all computed properties, including\n            // well known symbols.\n            if (node.name.kind === 158 /* ComputedPropertyName */) {\n                checkComputedPropertyName(node.name);\n            }\n            return checkExpressionForMutableLocation(node.initializer, checkMode);\n        }\n        function checkObjectLiteralMethod(node, checkMode) {\n            // Grammar checking\n            checkGrammarMethod(node);\n            // Do not use hasDynamicName here, because that returns false for well known symbols.\n            // We want to perform checkComputedPropertyName for all computed properties, including\n            // well known symbols.\n            if (node.name.kind === 158 /* ComputedPropertyName */) {\n                checkComputedPropertyName(node.name);\n            }\n            var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);\n            return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode);\n        }\n        function instantiateTypeWithSingleGenericCallSignature(node, type, checkMode) {\n            if (checkMode && checkMode & (2 /* Inferential */ | 8 /* SkipGenericFunctions */)) {\n                var callSignature = getSingleSignature(type, 0 /* Call */, /*allowMembers*/ true);\n                var constructSignature = getSingleSignature(type, 1 /* Construct */, /*allowMembers*/ true);\n                var signature = callSignature || constructSignature;\n                if (signature && signature.typeParameters) {\n                    var contextualType = getApparentTypeOfContextualType(node, 2 /* NoConstraints */);\n                    if (contextualType) {\n                        var contextualSignature = getSingleSignature(getNonNullableType(contextualType), callSignature ? 0 /* Call */ : 1 /* Construct */, /*allowMembers*/ false);\n                        if (contextualSignature && !contextualSignature.typeParameters) {\n                            if (checkMode & 8 /* SkipGenericFunctions */) {\n                                skippedGenericFunction(node, checkMode);\n                                return anyFunctionType;\n                            }\n                            var context = getInferenceContext(node);\n                            // We have an expression that is an argument of a generic function for which we are performing\n                            // type argument inference. The expression is of a function type with a single generic call\n                            // signature and a contextual function type with a single non-generic call signature. Now check\n                            // if the outer function returns a function type with a single non-generic call signature and\n                            // if some of the outer function type parameters have no inferences so far. If so, we can\n                            // potentially add inferred type parameters to the outer function return type.\n                            var returnType = context.signature && getReturnTypeOfSignature(context.signature);\n                            var returnSignature = returnType && getSingleCallOrConstructSignature(returnType);\n                            if (returnSignature && !returnSignature.typeParameters && !ts.every(context.inferences, hasInferenceCandidates)) {\n                                // Instantiate the signature with its own type parameters as type arguments, possibly\n                                // renaming the type parameters to ensure they have unique names.\n                                var uniqueTypeParameters = getUniqueTypeParameters(context, signature.typeParameters);\n                                var instantiatedSignature = getSignatureInstantiationWithoutFillingInTypeArguments(signature, uniqueTypeParameters);\n                                // Infer from the parameters of the instantiated signature to the parameters of the\n                                // contextual signature starting with an empty set of inference candidates.\n                                var inferences_3 = ts.map(context.inferences, function (info) { return createInferenceInfo(info.typeParameter); });\n                                applyToParameterTypes(instantiatedSignature, contextualSignature, function (source, target) {\n                                    inferTypes(inferences_3, source, target, /*priority*/ 0, /*contravariant*/ true);\n                                });\n                                if (ts.some(inferences_3, hasInferenceCandidates)) {\n                                    // We have inference candidates, indicating that one or more type parameters are referenced\n                                    // in the parameter types of the contextual signature. Now also infer from the return type.\n                                    applyToReturnTypes(instantiatedSignature, contextualSignature, function (source, target) {\n                                        inferTypes(inferences_3, source, target);\n                                    });\n                                    // If the type parameters for which we produced candidates do not have any inferences yet,\n                                    // we adopt the new inference candidates and add the type parameters of the expression type\n                                    // to the set of inferred type parameters for the outer function return type.\n                                    if (!hasOverlappingInferences(context.inferences, inferences_3)) {\n                                        mergeInferences(context.inferences, inferences_3);\n                                        context.inferredTypeParameters = ts.concatenate(context.inferredTypeParameters, uniqueTypeParameters);\n                                        return getOrCreateTypeFromSignature(instantiatedSignature);\n                                    }\n                                }\n                            }\n                            return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context));\n                        }\n                    }\n                }\n            }\n            return type;\n        }\n        function skippedGenericFunction(node, checkMode) {\n            if (checkMode & 2 /* Inferential */) {\n                // We have skipped a generic function during inferential typing. Obtain the inference context and\n                // indicate this has occurred such that we know a second pass of inference is be needed.\n                var context = getInferenceContext(node);\n                context.flags |= 4 /* SkippedGenericFunction */;\n            }\n        }\n        function hasInferenceCandidates(info) {\n            return !!(info.candidates || info.contraCandidates);\n        }\n        function hasOverlappingInferences(a, b) {\n            for (var i = 0; i < a.length; i++) {\n                if (hasInferenceCandidates(a[i]) && hasInferenceCandidates(b[i])) {\n                    return true;\n                }\n            }\n            return false;\n        }\n        function mergeInferences(target, source) {\n            for (var i = 0; i < target.length; i++) {\n                if (!hasInferenceCandidates(target[i]) && hasInferenceCandidates(source[i])) {\n                    target[i] = source[i];\n                }\n            }\n        }\n        function getUniqueTypeParameters(context, typeParameters) {\n            var result = [];\n            var oldTypeParameters;\n            var newTypeParameters;\n            for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {\n                var tp = typeParameters_2[_i];\n                var name = tp.symbol.escapedName;\n                if (hasTypeParameterByName(context.inferredTypeParameters, name) || hasTypeParameterByName(result, name)) {\n                    var newName = getUniqueTypeParameterName(ts.concatenate(context.inferredTypeParameters, result), name);\n                    var symbol = createSymbol(262144 /* TypeParameter */, newName);\n                    var newTypeParameter = createTypeParameter(symbol);\n                    newTypeParameter.target = tp;\n                    oldTypeParameters = ts.append(oldTypeParameters, tp);\n                    newTypeParameters = ts.append(newTypeParameters, newTypeParameter);\n                    result.push(newTypeParameter);\n                }\n                else {\n                    result.push(tp);\n                }\n            }\n            if (newTypeParameters) {\n                var mapper = createTypeMapper(oldTypeParameters, newTypeParameters);\n                for (var _a = 0, newTypeParameters_1 = newTypeParameters; _a < newTypeParameters_1.length; _a++) {\n                    var tp = newTypeParameters_1[_a];\n                    tp.mapper = mapper;\n                }\n            }\n            return result;\n        }\n        function hasTypeParameterByName(typeParameters, name) {\n            return ts.some(typeParameters, function (tp) { return tp.symbol.escapedName === name; });\n        }\n        function getUniqueTypeParameterName(typeParameters, baseName) {\n            var len = baseName.length;\n            while (len > 1 && baseName.charCodeAt(len - 1) >= 48 /* _0 */ && baseName.charCodeAt(len - 1) <= 57 /* _9 */)\n                len--;\n            var s = baseName.slice(0, len);\n            for (var index = 1; true; index++) {\n                var augmentedName = (s + index);\n                if (!hasTypeParameterByName(typeParameters, augmentedName)) {\n                    return augmentedName;\n                }\n            }\n        }\n        function getReturnTypeOfSingleNonGenericCallSignature(funcType) {\n            var signature = getSingleCallSignature(funcType);\n            if (signature && !signature.typeParameters) {\n                return getReturnTypeOfSignature(signature);\n            }\n        }\n        function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {\n            var funcType = checkExpression(expr.expression);\n            var nonOptionalType = getOptionalExpressionType(funcType, expr.expression);\n            var returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType);\n            return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);\n        }\n        /**\n         * Returns the type of an expression. Unlike checkExpression, this function is simply concerned\n         * with computing the type and may not fully check all contained sub-expressions for errors.\n         */\n        function getTypeOfExpression(node) {\n            // Don't bother caching types that require no flow analysis and are quick to compute.\n            var quickType = getQuickTypeOfExpression(node);\n            if (quickType) {\n                return quickType;\n            }\n            // If a type has been cached for the node, return it.\n            if (node.flags & 67108864 /* TypeCached */ && flowTypeCache) {\n                var cachedType = flowTypeCache[getNodeId(node)];\n                if (cachedType) {\n                    return cachedType;\n                }\n            }\n            var startInvocationCount = flowInvocationCount;\n            var type = checkExpression(node);\n            // If control flow analysis was required to determine the type, it is worth caching.\n            if (flowInvocationCount !== startInvocationCount) {\n                var cache = flowTypeCache || (flowTypeCache = []);\n                cache[getNodeId(node)] = type;\n                ts.setNodeFlags(node, node.flags | 67108864 /* TypeCached */);\n            }\n            return type;\n        }\n        function getQuickTypeOfExpression(node) {\n            var expr = ts.skipParentheses(node);\n            // Optimize for the common case of a call to a function with a single non-generic call\n            // signature where we can just fetch the return type without checking the arguments.\n            if (ts.isCallExpression(expr) && expr.expression.kind !== 105 /* SuperKeyword */ && !ts.isRequireCall(expr, /*checkArgumentIsStringLiteralLike*/ true) && !isSymbolOrSymbolForCall(expr)) {\n                var type = ts.isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) :\n                    getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));\n                if (type) {\n                    return type;\n                }\n            }\n            else if (ts.isAssertionExpression(expr) && !ts.isConstTypeReference(expr.type)) {\n                return getTypeFromTypeNode(expr.type);\n            }\n            else if (node.kind === 8 /* NumericLiteral */ || node.kind === 10 /* StringLiteral */ ||\n                node.kind === 109 /* TrueKeyword */ || node.kind === 94 /* FalseKeyword */) {\n                return checkExpression(node);\n            }\n            return undefined;\n        }\n        /**\n         * Returns the type of an expression. Unlike checkExpression, this function is simply concerned\n         * with computing the type and may not fully check all contained sub-expressions for errors.\n         * It is intended for uses where you know there is no contextual type,\n         * and requesting the contextual type might cause a circularity or other bad behaviour.\n         * It sets the contextual type of the node to any before calling getTypeOfExpression.\n         */\n        function getContextFreeTypeOfExpression(node) {\n            var links = getNodeLinks(node);\n            if (links.contextFreeType) {\n                return links.contextFreeType;\n            }\n            var saveContextualType = node.contextualType;\n            node.contextualType = anyType;\n            try {\n                var type = links.contextFreeType = checkExpression(node, 4 /* SkipContextSensitive */);\n                return type;\n            }\n            finally {\n                // In the event our operation is canceled or some other exception occurs, reset the contextual type\n                // so that we do not accidentally hold onto an instance of the checker, as a Type created in the services layer\n                // may hold onto the checker that created it.\n                node.contextualType = saveContextualType;\n            }\n        }\n        function checkExpression(node, checkMode, forceTuple) {\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"check\" /* Check */, \"checkExpression\", { kind: node.kind, pos: node.pos, end: node.end });\n            var saveCurrentNode = currentNode;\n            currentNode = node;\n            instantiationCount = 0;\n            var uninstantiatedType = checkExpressionWorker(node, checkMode, forceTuple);\n            var type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode);\n            if (isConstEnumObjectType(type)) {\n                checkConstEnumAccess(node, type);\n            }\n            currentNode = saveCurrentNode;\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n            return type;\n        }\n        function checkConstEnumAccess(node, type) {\n            // enum object type for const enums are only permitted in:\n            // - 'left' in property access\n            // - 'object' in indexed access\n            // - target in rhs of import statement\n            var ok = (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.expression === node) ||\n                (node.parent.kind === 202 /* ElementAccessExpression */ && node.parent.expression === node) ||\n                ((node.kind === 78 /* Identifier */ || node.kind === 157 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) ||\n                    (node.parent.kind === 176 /* TypeQuery */ && node.parent.exprName === node)) ||\n                (node.parent.kind === 270 /* ExportSpecifier */); // We allow reexporting const enums\n            if (!ok) {\n                error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query);\n            }\n            if (compilerOptions.isolatedModules) {\n                ts.Debug.assert(!!(type.symbol.flags & 128 /* ConstEnum */));\n                var constEnumDeclaration = type.symbol.valueDeclaration;\n                if (constEnumDeclaration.flags & 8388608 /* Ambient */) {\n                    error(node, ts.Diagnostics.Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided);\n                }\n            }\n        }\n        function checkParenthesizedExpression(node, checkMode) {\n            var tag = ts.isInJSFile(node) ? ts.getJSDocTypeTag(node) : undefined;\n            if (tag) {\n                return checkAssertionWorker(tag, tag.typeExpression.type, node.expression, checkMode);\n            }\n            return checkExpression(node.expression, checkMode);\n        }\n        function checkExpressionWorker(node, checkMode, forceTuple) {\n            var kind = node.kind;\n            if (cancellationToken) {\n                // Only bother checking on a few construct kinds.  We don't want to be excessively\n                // hitting the cancellation token on every node we check.\n                switch (kind) {\n                    case 221 /* ClassExpression */:\n                    case 208 /* FunctionExpression */:\n                    case 209 /* ArrowFunction */:\n                        cancellationToken.throwIfCancellationRequested();\n                }\n            }\n            switch (kind) {\n                case 78 /* Identifier */:\n                    return checkIdentifier(node);\n                case 107 /* ThisKeyword */:\n                    return checkThisExpression(node);\n                case 105 /* SuperKeyword */:\n                    return checkSuperExpression(node);\n                case 103 /* NullKeyword */:\n                    return nullWideningType;\n                case 14 /* NoSubstitutionTemplateLiteral */:\n                case 10 /* StringLiteral */:\n                    return getFreshTypeOfLiteralType(getLiteralType(node.text));\n                case 8 /* NumericLiteral */:\n                    checkGrammarNumericLiteral(node);\n                    return getFreshTypeOfLiteralType(getLiteralType(+node.text));\n                case 9 /* BigIntLiteral */:\n                    checkGrammarBigIntLiteral(node);\n                    return getFreshTypeOfLiteralType(getBigIntLiteralType(node));\n                case 109 /* TrueKeyword */:\n                    return trueType;\n                case 94 /* FalseKeyword */:\n                    return falseType;\n                case 218 /* TemplateExpression */:\n                    return checkTemplateExpression(node);\n                case 13 /* RegularExpressionLiteral */:\n                    return globalRegExpType;\n                case 199 /* ArrayLiteralExpression */:\n                    return checkArrayLiteral(node, checkMode, forceTuple);\n                case 200 /* ObjectLiteralExpression */:\n                    return checkObjectLiteral(node, checkMode);\n                case 201 /* PropertyAccessExpression */:\n                    return checkPropertyAccessExpression(node);\n                case 157 /* QualifiedName */:\n                    return checkQualifiedName(node);\n                case 202 /* ElementAccessExpression */:\n                    return checkIndexedAccess(node);\n                case 203 /* CallExpression */:\n                    if (node.expression.kind === 99 /* ImportKeyword */) {\n                        return checkImportCallExpression(node);\n                    }\n                // falls through\n                case 204 /* NewExpression */:\n                    return checkCallExpression(node, checkMode);\n                case 205 /* TaggedTemplateExpression */:\n                    return checkTaggedTemplateExpression(node);\n                case 207 /* ParenthesizedExpression */:\n                    return checkParenthesizedExpression(node, checkMode);\n                case 221 /* ClassExpression */:\n                    return checkClassExpression(node);\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                    return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);\n                case 211 /* TypeOfExpression */:\n                    return checkTypeOfExpression(node);\n                case 206 /* TypeAssertionExpression */:\n                case 224 /* AsExpression */:\n                    return checkAssertion(node);\n                case 225 /* NonNullExpression */:\n                    return checkNonNullAssertion(node);\n                case 226 /* MetaProperty */:\n                    return checkMetaProperty(node);\n                case 210 /* DeleteExpression */:\n                    return checkDeleteExpression(node);\n                case 212 /* VoidExpression */:\n                    return checkVoidExpression(node);\n                case 213 /* AwaitExpression */:\n                    return checkAwaitExpression(node);\n                case 214 /* PrefixUnaryExpression */:\n                    return checkPrefixUnaryExpression(node);\n                case 215 /* PostfixUnaryExpression */:\n                    return checkPostfixUnaryExpression(node);\n                case 216 /* BinaryExpression */:\n                    return checkBinaryExpression(node, checkMode);\n                case 217 /* ConditionalExpression */:\n                    return checkConditionalExpression(node, checkMode);\n                case 220 /* SpreadElement */:\n                    return checkSpreadExpression(node, checkMode);\n                case 222 /* OmittedExpression */:\n                    return undefinedWideningType;\n                case 219 /* YieldExpression */:\n                    return checkYieldExpression(node);\n                case 227 /* SyntheticExpression */:\n                    return checkSyntheticExpression(node);\n                case 283 /* JsxExpression */:\n                    return checkJsxExpression(node, checkMode);\n                case 273 /* JsxElement */:\n                    return checkJsxElement(node, checkMode);\n                case 274 /* JsxSelfClosingElement */:\n                    return checkJsxSelfClosingElement(node, checkMode);\n                case 277 /* JsxFragment */:\n                    return checkJsxFragment(node);\n                case 281 /* JsxAttributes */:\n                    return checkJsxAttributes(node, checkMode);\n                case 275 /* JsxOpeningElement */:\n                    ts.Debug.fail(\"Shouldn't ever directly check a JsxOpeningElement\");\n            }\n            return errorType;\n        }\n        // DECLARATION AND STATEMENT TYPE CHECKING\n        function checkTypeParameter(node) {\n            // Grammar Checking\n            if (node.expression) {\n                grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected);\n            }\n            checkSourceElement(node.constraint);\n            checkSourceElement(node.default);\n            var typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node));\n            // Resolve base constraint to reveal circularity errors\n            getBaseConstraintOfType(typeParameter);\n            if (!hasNonCircularTypeParameterDefault(typeParameter)) {\n                error(node.default, ts.Diagnostics.Type_parameter_0_has_a_circular_default, typeToString(typeParameter));\n            }\n            var constraintType = getConstraintOfTypeParameter(typeParameter);\n            var defaultType = getDefaultFromTypeParameter(typeParameter);\n            if (constraintType && defaultType) {\n                checkTypeAssignableTo(defaultType, getTypeWithThisArgument(instantiateType(constraintType, makeUnaryTypeMapper(typeParameter, defaultType)), defaultType), node.default, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1);\n            }\n            if (produceDiagnostics) {\n                checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0);\n            }\n        }\n        function checkParameter(node) {\n            // Grammar checking\n            // It is a SyntaxError if the Identifier \"eval\" or the Identifier \"arguments\" occurs as the\n            // Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code\n            // or if its FunctionBody is strict code(11.1.5).\n            checkGrammarDecoratorsAndModifiers(node);\n            checkVariableLikeDeclaration(node);\n            var func = ts.getContainingFunction(node);\n            if (ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */)) {\n                if (!(func.kind === 166 /* Constructor */ && ts.nodeIsPresent(func.body))) {\n                    error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);\n                }\n                if (func.kind === 166 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === \"constructor\") {\n                    error(node.name, ts.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name);\n                }\n            }\n            if (node.questionToken && ts.isBindingPattern(node.name) && func.body) {\n                error(node, ts.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature);\n            }\n            if (node.name && ts.isIdentifier(node.name) && (node.name.escapedText === \"this\" || node.name.escapedText === \"new\")) {\n                if (func.parameters.indexOf(node) !== 0) {\n                    error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText);\n                }\n                if (func.kind === 166 /* Constructor */ || func.kind === 170 /* ConstructSignature */ || func.kind === 175 /* ConstructorType */) {\n                    error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter);\n                }\n                if (func.kind === 209 /* ArrowFunction */) {\n                    error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter);\n                }\n                if (func.kind === 167 /* GetAccessor */ || func.kind === 168 /* SetAccessor */) {\n                    error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters);\n                }\n            }\n            // Only check rest parameter type if it's not a binding pattern. Since binding patterns are\n            // not allowed in a rest parameter, we already have an error from checkGrammarParameterList.\n            if (node.dotDotDotToken && !ts.isBindingPattern(node.name) && !isTypeAssignableTo(getReducedType(getTypeOfSymbol(node.symbol)), anyReadonlyArrayType)) {\n                error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type);\n            }\n        }\n        function checkTypePredicate(node) {\n            var parent = getTypePredicateParent(node);\n            if (!parent) {\n                // The parent must not be valid.\n                error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);\n                return;\n            }\n            var signature = getSignatureFromDeclaration(parent);\n            var typePredicate = getTypePredicateOfSignature(signature);\n            if (!typePredicate) {\n                return;\n            }\n            checkSourceElement(node.type);\n            var parameterName = node.parameterName;\n            if (typePredicate.kind === 0 /* This */ || typePredicate.kind === 2 /* AssertsThis */) {\n                getTypeFromThisTypeNode(parameterName);\n            }\n            else {\n                if (typePredicate.parameterIndex >= 0) {\n                    if (signatureHasRestParameter(signature) && typePredicate.parameterIndex === signature.parameters.length - 1) {\n                        error(parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter);\n                    }\n                    else {\n                        if (typePredicate.type) {\n                            var leadingError = function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); };\n                            checkTypeAssignableTo(typePredicate.type, getTypeOfSymbol(signature.parameters[typePredicate.parameterIndex]), node.type, \n                            /*headMessage*/ undefined, leadingError);\n                        }\n                    }\n                }\n                else if (parameterName) {\n                    var hasReportedError = false;\n                    for (var _i = 0, _a = parent.parameters; _i < _a.length; _i++) {\n                        var name = _a[_i].name;\n                        if (ts.isBindingPattern(name) &&\n                            checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, parameterName, typePredicate.parameterName)) {\n                            hasReportedError = true;\n                            break;\n                        }\n                    }\n                    if (!hasReportedError) {\n                        error(node.parameterName, ts.Diagnostics.Cannot_find_parameter_0, typePredicate.parameterName);\n                    }\n                }\n            }\n        }\n        function getTypePredicateParent(node) {\n            switch (node.parent.kind) {\n                case 209 /* ArrowFunction */:\n                case 169 /* CallSignature */:\n                case 251 /* FunctionDeclaration */:\n                case 208 /* FunctionExpression */:\n                case 174 /* FunctionType */:\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                    var parent = node.parent;\n                    if (node === parent.type) {\n                        return parent;\n                    }\n            }\n        }\n        function checkIfTypePredicateVariableIsDeclaredInBindingPattern(pattern, predicateVariableNode, predicateVariableName) {\n            for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {\n                var element = _a[_i];\n                if (ts.isOmittedExpression(element)) {\n                    continue;\n                }\n                var name = element.name;\n                if (name.kind === 78 /* Identifier */ && name.escapedText === predicateVariableName) {\n                    error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName);\n                    return true;\n                }\n                else if (name.kind === 197 /* ArrayBindingPattern */ || name.kind === 196 /* ObjectBindingPattern */) {\n                    if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) {\n                        return true;\n                    }\n                }\n            }\n        }\n        function checkSignatureDeclaration(node) {\n            // Grammar checking\n            if (node.kind === 171 /* IndexSignature */) {\n                checkGrammarIndexSignature(node);\n            }\n            // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled\n            else if (node.kind === 174 /* FunctionType */ || node.kind === 251 /* FunctionDeclaration */ || node.kind === 175 /* ConstructorType */ ||\n                node.kind === 169 /* CallSignature */ || node.kind === 166 /* Constructor */ ||\n                node.kind === 170 /* ConstructSignature */) {\n                checkGrammarFunctionLikeDeclaration(node);\n            }\n            var functionFlags = ts.getFunctionFlags(node);\n            if (!(functionFlags & 4 /* Invalid */)) {\n                // Async generators prior to ESNext require the __await and __asyncGenerator helpers\n                if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && languageVersion < 99 /* ESNext */) {\n                    checkExternalEmitHelpers(node, 6144 /* AsyncGeneratorIncludes */);\n                }\n                // Async functions prior to ES2017 require the __awaiter helper\n                if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ && languageVersion < 4 /* ES2017 */) {\n                    checkExternalEmitHelpers(node, 64 /* Awaiter */);\n                }\n                // Generator functions, Async functions, and Async Generator functions prior to\n                // ES2015 require the __generator helper\n                if ((functionFlags & 3 /* AsyncGenerator */) !== 0 /* Normal */ && languageVersion < 2 /* ES2015 */) {\n                    checkExternalEmitHelpers(node, 128 /* Generator */);\n                }\n            }\n            checkTypeParameters(node.typeParameters);\n            ts.forEach(node.parameters, checkParameter);\n            // TODO(rbuckton): Should we start checking JSDoc types?\n            if (node.type) {\n                checkSourceElement(node.type);\n            }\n            if (produceDiagnostics) {\n                checkCollisionWithArgumentsInGeneratedCode(node);\n                var returnTypeNode = ts.getEffectiveReturnTypeNode(node);\n                if (noImplicitAny && !returnTypeNode) {\n                    switch (node.kind) {\n                        case 170 /* ConstructSignature */:\n                            error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);\n                            break;\n                        case 169 /* CallSignature */:\n                            error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);\n                            break;\n                    }\n                }\n                if (returnTypeNode) {\n                    var functionFlags_1 = ts.getFunctionFlags(node);\n                    if ((functionFlags_1 & (4 /* Invalid */ | 1 /* Generator */)) === 1 /* Generator */) {\n                        var returnType = getTypeFromTypeNode(returnTypeNode);\n                        if (returnType === voidType) {\n                            error(returnTypeNode, ts.Diagnostics.A_generator_cannot_have_a_void_type_annotation);\n                        }\n                        else {\n                            // Naively, one could check that Generator<any, any, any> is assignable to the return type annotation.\n                            // However, that would not catch the error in the following case.\n                            //\n                            //    interface BadGenerator extends Iterable<number>, Iterator<string> { }\n                            //    function* g(): BadGenerator { } // Iterable and Iterator have different types!\n                            //\n                            var generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, returnType, (functionFlags_1 & 2 /* Async */) !== 0) || anyType;\n                            var generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, (functionFlags_1 & 2 /* Async */) !== 0) || generatorYieldType;\n                            var generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, (functionFlags_1 & 2 /* Async */) !== 0) || unknownType;\n                            var generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags_1 & 2 /* Async */));\n                            checkTypeAssignableTo(generatorInstantiation, returnType, returnTypeNode);\n                        }\n                    }\n                    else if ((functionFlags_1 & 3 /* AsyncGenerator */) === 2 /* Async */) {\n                        checkAsyncFunctionReturnType(node, returnTypeNode);\n                    }\n                }\n                if (node.kind !== 171 /* IndexSignature */ && node.kind !== 308 /* JSDocFunctionType */) {\n                    registerForUnusedIdentifiersCheck(node);\n                }\n            }\n        }\n        function checkClassForDuplicateDeclarations(node) {\n            var instanceNames = new ts.Map();\n            var staticNames = new ts.Map();\n            // instance and static private identifiers share the same scope\n            var privateIdentifiers = new ts.Map();\n            for (var _i = 0, _a = node.members; _i < _a.length; _i++) {\n                var member = _a[_i];\n                if (member.kind === 166 /* Constructor */) {\n                    for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {\n                        var param = _c[_b];\n                        if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) {\n                            addName(instanceNames, param.name, param.name.escapedText, 3 /* GetOrSetAccessor */);\n                        }\n                    }\n                }\n                else {\n                    var isStatic = ts.hasSyntacticModifier(member, 32 /* Static */);\n                    var name = member.name;\n                    if (!name) {\n                        return;\n                    }\n                    var names = ts.isPrivateIdentifier(name) ? privateIdentifiers :\n                        isStatic ? staticNames :\n                            instanceNames;\n                    var memberName = name && ts.getPropertyNameForPropertyNameNode(name);\n                    if (memberName) {\n                        switch (member.kind) {\n                            case 167 /* GetAccessor */:\n                                addName(names, name, memberName, 1 /* GetAccessor */);\n                                break;\n                            case 168 /* SetAccessor */:\n                                addName(names, name, memberName, 2 /* SetAccessor */);\n                                break;\n                            case 163 /* PropertyDeclaration */:\n                                addName(names, name, memberName, 3 /* GetOrSetAccessor */);\n                                break;\n                            case 165 /* MethodDeclaration */:\n                                addName(names, name, memberName, 8 /* Method */);\n                                break;\n                        }\n                    }\n                }\n            }\n            function addName(names, location, name, meaning) {\n                var prev = names.get(name);\n                if (prev) {\n                    if (prev & 8 /* Method */) {\n                        if (meaning !== 8 /* Method */) {\n                            error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location));\n                        }\n                    }\n                    else if (prev & meaning) {\n                        error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location));\n                    }\n                    else {\n                        names.set(name, prev | meaning);\n                    }\n                }\n                else {\n                    names.set(name, meaning);\n                }\n            }\n        }\n        /**\n         * Static members being set on a constructor function may conflict with built-in properties\n         * of Function. Esp. in ECMAScript 5 there are non-configurable and non-writable\n         * built-in properties. This check issues a transpile error when a class has a static\n         * member with the same name as a non-writable built-in property.\n         *\n         * @see http://www.ecma-international.org/ecma-262/5.1/#sec-15.3.3\n         * @see http://www.ecma-international.org/ecma-262/5.1/#sec-15.3.5\n         * @see http://www.ecma-international.org/ecma-262/6.0/#sec-properties-of-the-function-constructor\n         * @see http://www.ecma-international.org/ecma-262/6.0/#sec-function-instances\n         */\n        function checkClassForStaticPropertyNameConflicts(node) {\n            for (var _i = 0, _a = node.members; _i < _a.length; _i++) {\n                var member = _a[_i];\n                var memberNameNode = member.name;\n                var isStatic = ts.hasSyntacticModifier(member, 32 /* Static */);\n                if (isStatic && memberNameNode) {\n                    var memberName = ts.getPropertyNameForPropertyNameNode(memberNameNode);\n                    switch (memberName) {\n                        case \"name\":\n                        case \"length\":\n                        case \"caller\":\n                        case \"arguments\":\n                        case \"prototype\":\n                            var message = ts.Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1;\n                            var className = getNameOfSymbolAsWritten(getSymbolOfNode(node));\n                            error(memberNameNode, message, memberName, className);\n                            break;\n                    }\n                }\n            }\n        }\n        function checkObjectTypeForDuplicateDeclarations(node) {\n            var names = new ts.Map();\n            for (var _i = 0, _a = node.members; _i < _a.length; _i++) {\n                var member = _a[_i];\n                if (member.kind === 162 /* PropertySignature */) {\n                    var memberName = void 0;\n                    var name = member.name;\n                    switch (name.kind) {\n                        case 10 /* StringLiteral */:\n                        case 8 /* NumericLiteral */:\n                            memberName = name.text;\n                            break;\n                        case 78 /* Identifier */:\n                            memberName = ts.idText(name);\n                            break;\n                        default:\n                            continue;\n                    }\n                    if (names.get(memberName)) {\n                        error(ts.getNameOfDeclaration(member.symbol.valueDeclaration), ts.Diagnostics.Duplicate_identifier_0, memberName);\n                        error(member.name, ts.Diagnostics.Duplicate_identifier_0, memberName);\n                    }\n                    else {\n                        names.set(memberName, true);\n                    }\n                }\n            }\n        }\n        function checkTypeForDuplicateIndexSignatures(node) {\n            if (node.kind === 253 /* InterfaceDeclaration */) {\n                var nodeSymbol = getSymbolOfNode(node);\n                // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration\n                // to prevent this run check only for the first declaration of a given kind\n                if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) {\n                    return;\n                }\n            }\n            // TypeScript 1.0 spec (April 2014)\n            // 3.7.4: An object type can contain at most one string index signature and one numeric index signature.\n            // 8.5: A class declaration can have at most one string index member declaration and one numeric index member declaration\n            var indexSymbol = getIndexSymbol(getSymbolOfNode(node));\n            if (indexSymbol) {\n                var seenNumericIndexer = false;\n                var seenStringIndexer = false;\n                for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {\n                    var decl = _a[_i];\n                    var declaration = decl;\n                    if (declaration.parameters.length === 1 && declaration.parameters[0].type) {\n                        switch (declaration.parameters[0].type.kind) {\n                            case 147 /* StringKeyword */:\n                                if (!seenStringIndexer) {\n                                    seenStringIndexer = true;\n                                }\n                                else {\n                                    error(declaration, ts.Diagnostics.Duplicate_string_index_signature);\n                                }\n                                break;\n                            case 144 /* NumberKeyword */:\n                                if (!seenNumericIndexer) {\n                                    seenNumericIndexer = true;\n                                }\n                                else {\n                                    error(declaration, ts.Diagnostics.Duplicate_number_index_signature);\n                                }\n                                break;\n                        }\n                    }\n                }\n            }\n        }\n        function checkPropertyDeclaration(node) {\n            // Grammar checking\n            if (!checkGrammarDecoratorsAndModifiers(node) && !checkGrammarProperty(node))\n                checkGrammarComputedPropertyName(node.name);\n            checkVariableLikeDeclaration(node);\n            // Private class fields transformation relies on WeakMaps.\n            if (ts.isPrivateIdentifier(node.name) && languageVersion < 99 /* ESNext */) {\n                for (var lexicalScope = ts.getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = ts.getEnclosingBlockScopeContainer(lexicalScope)) {\n                    getNodeLinks(lexicalScope).flags |= 67108864 /* ContainsClassWithPrivateIdentifiers */;\n                }\n            }\n        }\n        function checkPropertySignature(node) {\n            if (ts.isPrivateIdentifier(node.name)) {\n                error(node, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);\n            }\n            return checkPropertyDeclaration(node);\n        }\n        function checkMethodDeclaration(node) {\n            // Grammar checking\n            if (!checkGrammarMethod(node))\n                checkGrammarComputedPropertyName(node.name);\n            if (ts.isPrivateIdentifier(node.name)) {\n                error(node, ts.Diagnostics.A_method_cannot_be_named_with_a_private_identifier);\n            }\n            // Grammar checking for modifiers is done inside the function checkGrammarFunctionLikeDeclaration\n            checkFunctionOrMethodDeclaration(node);\n            // Abstract methods cannot have an implementation.\n            // Extra checks are to avoid reporting multiple errors relating to the \"abstractness\" of the node.\n            if (ts.hasSyntacticModifier(node, 128 /* Abstract */) && node.kind === 165 /* MethodDeclaration */ && node.body) {\n                error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name));\n            }\n        }\n        function checkConstructorDeclaration(node) {\n            // Grammar check on signature of constructor and modifier of the constructor is done in checkSignatureDeclaration function.\n            checkSignatureDeclaration(node);\n            // Grammar check for checking only related to constructorDeclaration\n            if (!checkGrammarConstructorTypeParameters(node))\n                checkGrammarConstructorTypeAnnotation(node);\n            checkSourceElement(node.body);\n            var symbol = getSymbolOfNode(node);\n            var firstDeclaration = ts.getDeclarationOfKind(symbol, node.kind);\n            // Only type check the symbol once\n            if (node === firstDeclaration) {\n                checkFunctionOrConstructorSymbol(symbol);\n            }\n            // exit early in the case of signature - super checks are not relevant to them\n            if (ts.nodeIsMissing(node.body)) {\n                return;\n            }\n            if (!produceDiagnostics) {\n                return;\n            }\n            function isInstancePropertyWithInitializerOrPrivateIdentifierProperty(n) {\n                if (ts.isPrivateIdentifierPropertyDeclaration(n)) {\n                    return true;\n                }\n                return n.kind === 163 /* PropertyDeclaration */ &&\n                    !ts.hasSyntacticModifier(n, 32 /* Static */) &&\n                    !!n.initializer;\n            }\n            // TS 1.0 spec (April 2014): 8.3.2\n            // Constructors of classes with no extends clause may not contain super calls, whereas\n            // constructors of derived classes must contain at least one super call somewhere in their function body.\n            var containingClassDecl = node.parent;\n            if (ts.getClassExtendsHeritageElement(containingClassDecl)) {\n                captureLexicalThis(node.parent, containingClassDecl);\n                var classExtendsNull = classDeclarationExtendsNull(containingClassDecl);\n                var superCall = findFirstSuperCall(node.body);\n                if (superCall) {\n                    if (classExtendsNull) {\n                        error(superCall, ts.Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null);\n                    }\n                    // The first statement in the body of a constructor (excluding prologue directives) must be a super call\n                    // if both of the following are true:\n                    // - The containing class is a derived class.\n                    // - The constructor declares parameter properties\n                    //   or the containing class declares instance member variables with initializers.\n                    var superCallShouldBeFirst = (compilerOptions.target !== 99 /* ESNext */ || !compilerOptions.useDefineForClassFields) &&\n                        (ts.some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) ||\n                            ts.some(node.parameters, function (p) { return ts.hasSyntacticModifier(p, 92 /* ParameterPropertyModifier */); }));\n                    // Skip past any prologue directives to find the first statement\n                    // to ensure that it was a super call.\n                    if (superCallShouldBeFirst) {\n                        var statements = node.body.statements;\n                        var superCallStatement = void 0;\n                        for (var _i = 0, statements_4 = statements; _i < statements_4.length; _i++) {\n                            var statement = statements_4[_i];\n                            if (statement.kind === 233 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) {\n                                superCallStatement = statement;\n                                break;\n                            }\n                            if (!ts.isPrologueDirective(statement)) {\n                                break;\n                            }\n                        }\n                        if (!superCallStatement) {\n                            error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_parameter_properties_or_private_identifiers);\n                        }\n                    }\n                }\n                else if (!classExtendsNull) {\n                    error(node, ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call);\n                }\n            }\n        }\n        function checkAccessorDeclaration(node) {\n            if (produceDiagnostics) {\n                // Grammar checking accessors\n                if (!checkGrammarFunctionLikeDeclaration(node) && !checkGrammarAccessor(node))\n                    checkGrammarComputedPropertyName(node.name);\n                checkDecorators(node);\n                checkSignatureDeclaration(node);\n                if (node.kind === 167 /* GetAccessor */) {\n                    if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) {\n                        if (!(node.flags & 512 /* HasExplicitReturn */)) {\n                            error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value);\n                        }\n                    }\n                }\n                // Do not use hasDynamicName here, because that returns false for well known symbols.\n                // We want to perform checkComputedPropertyName for all computed properties, including\n                // well known symbols.\n                if (node.name.kind === 158 /* ComputedPropertyName */) {\n                    checkComputedPropertyName(node.name);\n                }\n                if (ts.isPrivateIdentifier(node.name)) {\n                    error(node.name, ts.Diagnostics.An_accessor_cannot_be_named_with_a_private_identifier);\n                }\n                if (hasBindableName(node)) {\n                    // TypeScript 1.0 spec (April 2014): 8.4.3\n                    // Accessors for the same member name must specify the same accessibility.\n                    var otherKind = node.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */;\n                    var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind);\n                    if (otherAccessor) {\n                        var nodeFlags = ts.getEffectiveModifierFlags(node);\n                        var otherFlags = ts.getEffectiveModifierFlags(otherAccessor);\n                        if ((nodeFlags & 28 /* AccessibilityModifier */) !== (otherFlags & 28 /* AccessibilityModifier */)) {\n                            error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility);\n                        }\n                        if ((nodeFlags & 128 /* Abstract */) !== (otherFlags & 128 /* Abstract */)) {\n                            error(node.name, ts.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract);\n                        }\n                        // TypeScript 1.0 spec (April 2014): 4.5\n                        // If both accessors include type annotations, the specified types must be identical.\n                        checkAccessorDeclarationTypesIdentical(node, otherAccessor, getAnnotatedAccessorType, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type);\n                        checkAccessorDeclarationTypesIdentical(node, otherAccessor, getThisTypeOfDeclaration, ts.Diagnostics.get_and_set_accessor_must_have_the_same_this_type);\n                    }\n                }\n                var returnType = getTypeOfAccessors(getSymbolOfNode(node));\n                if (node.kind === 167 /* GetAccessor */) {\n                    checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);\n                }\n            }\n            checkSourceElement(node.body);\n        }\n        function checkAccessorDeclarationTypesIdentical(first, second, getAnnotatedType, message) {\n            var firstType = getAnnotatedType(first);\n            var secondType = getAnnotatedType(second);\n            if (firstType && secondType && !isTypeIdenticalTo(firstType, secondType)) {\n                error(first, message);\n            }\n        }\n        function checkMissingDeclaration(node) {\n            checkDecorators(node);\n        }\n        function getEffectiveTypeArguments(node, typeParameters) {\n            return fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), ts.isInJSFile(node));\n        }\n        function checkTypeArgumentConstraints(node, typeParameters) {\n            var typeArguments;\n            var mapper;\n            var result = true;\n            for (var i = 0; i < typeParameters.length; i++) {\n                var constraint = getConstraintOfTypeParameter(typeParameters[i]);\n                if (constraint) {\n                    if (!typeArguments) {\n                        typeArguments = getEffectiveTypeArguments(node, typeParameters);\n                        mapper = createTypeMapper(typeParameters, typeArguments);\n                    }\n                    result = result && checkTypeAssignableTo(typeArguments[i], instantiateType(constraint, mapper), node.typeArguments[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1);\n                }\n            }\n            return result;\n        }\n        function getTypeParametersForTypeReference(node) {\n            var type = getTypeFromTypeReference(node);\n            if (type !== errorType) {\n                var symbol = getNodeLinks(node).resolvedSymbol;\n                if (symbol) {\n                    return symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters ||\n                        (ts.getObjectFlags(type) & 4 /* Reference */ ? type.target.localTypeParameters : undefined);\n                }\n            }\n            return undefined;\n        }\n        function checkTypeReferenceNode(node) {\n            checkGrammarTypeArguments(node, node.typeArguments);\n            if (node.kind === 173 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) {\n                grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);\n            }\n            ts.forEach(node.typeArguments, checkSourceElement);\n            var type = getTypeFromTypeReference(node);\n            if (type !== errorType) {\n                if (node.typeArguments && produceDiagnostics) {\n                    var typeParameters = getTypeParametersForTypeReference(node);\n                    if (typeParameters) {\n                        checkTypeArgumentConstraints(node, typeParameters);\n                    }\n                }\n                var symbol = getNodeLinks(node).resolvedSymbol;\n                if (symbol) {\n                    if (ts.some(symbol.declarations, function (d) { return isTypeDeclaration(d) && !!(d.flags & 134217728 /* Deprecated */); })) {\n                        addDeprecatedSuggestion(getDeprecatedSuggestionNode(node), symbol.declarations, symbol.escapedName);\n                    }\n                    if (type.flags & 32 /* Enum */ && symbol.flags & 8 /* EnumMember */) {\n                        error(node, ts.Diagnostics.Enum_type_0_has_members_with_initializers_that_are_not_literals, typeToString(type));\n                    }\n                }\n            }\n        }\n        function getTypeArgumentConstraint(node) {\n            var typeReferenceNode = ts.tryCast(node.parent, ts.isTypeReferenceType);\n            if (!typeReferenceNode)\n                return undefined;\n            var typeParameters = getTypeParametersForTypeReference(typeReferenceNode); // TODO: GH#18217\n            var constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]);\n            return constraint && instantiateType(constraint, createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReferenceNode, typeParameters)));\n        }\n        function checkTypeQuery(node) {\n            getTypeFromTypeQueryNode(node);\n        }\n        function checkTypeLiteral(node) {\n            ts.forEach(node.members, checkSourceElement);\n            if (produceDiagnostics) {\n                var type = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);\n                checkIndexConstraints(type);\n                checkTypeForDuplicateIndexSignatures(node);\n                checkObjectTypeForDuplicateDeclarations(node);\n            }\n        }\n        function checkArrayType(node) {\n            checkSourceElement(node.elementType);\n        }\n        function checkTupleType(node) {\n            var elementTypes = node.elements;\n            var seenOptionalElement = false;\n            var seenRestElement = false;\n            var hasNamedElement = ts.some(elementTypes, ts.isNamedTupleMember);\n            for (var _i = 0, elementTypes_1 = elementTypes; _i < elementTypes_1.length; _i++) {\n                var e = elementTypes_1[_i];\n                if (e.kind !== 192 /* NamedTupleMember */ && hasNamedElement) {\n                    grammarErrorOnNode(e, ts.Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names);\n                    break;\n                }\n                var flags = getTupleElementFlags(e);\n                if (flags & 8 /* Variadic */) {\n                    var type = getTypeFromTypeNode(e.type);\n                    if (!isArrayLikeType(type)) {\n                        error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type);\n                        break;\n                    }\n                    if (isArrayType(type) || isTupleType(type) && type.target.combinedFlags & 4 /* Rest */) {\n                        seenRestElement = true;\n                    }\n                }\n                else if (flags & 4 /* Rest */) {\n                    if (seenRestElement) {\n                        grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_cannot_follow_another_rest_element);\n                        break;\n                    }\n                    seenRestElement = true;\n                }\n                else if (flags & 2 /* Optional */) {\n                    if (seenRestElement) {\n                        grammarErrorOnNode(e, ts.Diagnostics.An_optional_element_cannot_follow_a_rest_element);\n                        break;\n                    }\n                    seenOptionalElement = true;\n                }\n                else if (seenOptionalElement) {\n                    grammarErrorOnNode(e, ts.Diagnostics.A_required_element_cannot_follow_an_optional_element);\n                    break;\n                }\n            }\n            ts.forEach(node.elements, checkSourceElement);\n            getTypeFromTypeNode(node);\n        }\n        function checkUnionOrIntersectionType(node) {\n            ts.forEach(node.types, checkSourceElement);\n            getTypeFromTypeNode(node);\n        }\n        function checkIndexedAccessIndexType(type, accessNode) {\n            if (!(type.flags & 8388608 /* IndexedAccess */)) {\n                return type;\n            }\n            // Check if the index type is assignable to 'keyof T' for the object type.\n            var objectType = type.objectType;\n            var indexType = type.indexType;\n            if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) {\n                if (accessNode.kind === 202 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) &&\n                    ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {\n                    error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));\n                }\n                return type;\n            }\n            // Check if we're indexing with a numeric type and if either object or index types\n            // is a generic type with a constraint that has a numeric index signature.\n            var apparentObjectType = getApparentType(objectType);\n            if (getIndexInfoOfType(apparentObjectType, 1 /* Number */) && isTypeAssignableToKind(indexType, 296 /* NumberLike */)) {\n                return type;\n            }\n            if (isGenericObjectType(objectType)) {\n                var propertyName_1 = getPropertyNameFromIndex(indexType, accessNode);\n                if (propertyName_1) {\n                    var propertySymbol = forEachType(apparentObjectType, function (t) { return getPropertyOfType(t, propertyName_1); });\n                    if (propertySymbol && ts.getDeclarationModifierFlagsFromSymbol(propertySymbol) & 24 /* NonPublicAccessibilityModifier */) {\n                        error(accessNode, ts.Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter, ts.unescapeLeadingUnderscores(propertyName_1));\n                        return errorType;\n                    }\n                }\n            }\n            error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType));\n            return errorType;\n        }\n        function checkIndexedAccessType(node) {\n            checkSourceElement(node.objectType);\n            checkSourceElement(node.indexType);\n            checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(node), node);\n        }\n        function checkMappedType(node) {\n            checkSourceElement(node.typeParameter);\n            checkSourceElement(node.nameType);\n            checkSourceElement(node.type);\n            if (!node.type) {\n                reportImplicitAny(node, anyType);\n            }\n            var type = getTypeFromMappedTypeNode(node);\n            var nameType = getNameTypeFromMappedType(type);\n            if (nameType) {\n                checkTypeAssignableTo(nameType, keyofConstraintType, node.nameType);\n            }\n            else {\n                var constraintType = getConstraintTypeFromMappedType(type);\n                checkTypeAssignableTo(constraintType, keyofConstraintType, ts.getEffectiveConstraintOfTypeParameter(node.typeParameter));\n            }\n        }\n        function checkThisType(node) {\n            getTypeFromThisTypeNode(node);\n        }\n        function checkTypeOperator(node) {\n            checkGrammarTypeOperatorNode(node);\n            checkSourceElement(node.type);\n        }\n        function checkConditionalType(node) {\n            ts.forEachChild(node, checkSourceElement);\n        }\n        function checkInferType(node) {\n            if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 184 /* ConditionalType */ && n.parent.extendsType === n; })) {\n                grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type);\n            }\n            checkSourceElement(node.typeParameter);\n            registerForUnusedIdentifiersCheck(node);\n        }\n        function checkTemplateLiteralType(node) {\n            for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) {\n                var span = _a[_i];\n                checkSourceElement(span.type);\n                var type = getTypeFromTypeNode(span.type);\n                checkTypeAssignableTo(type, templateConstraintType, span.type);\n            }\n            getTypeFromTypeNode(node);\n        }\n        function checkImportType(node) {\n            checkSourceElement(node.argument);\n            getTypeFromTypeNode(node);\n        }\n        function checkNamedTupleMember(node) {\n            if (node.dotDotDotToken && node.questionToken) {\n                grammarErrorOnNode(node, ts.Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest);\n            }\n            if (node.type.kind === 180 /* OptionalType */) {\n                grammarErrorOnNode(node.type, ts.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type);\n            }\n            if (node.type.kind === 181 /* RestType */) {\n                grammarErrorOnNode(node.type, ts.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type);\n            }\n            checkSourceElement(node.type);\n            getTypeFromTypeNode(node);\n        }\n        function isPrivateWithinAmbient(node) {\n            return (ts.hasEffectiveModifier(node, 8 /* Private */) || ts.isPrivateIdentifierPropertyDeclaration(node)) && !!(node.flags & 8388608 /* Ambient */);\n        }\n        function getEffectiveDeclarationFlags(n, flagsToCheck) {\n            var flags = ts.getCombinedModifierFlags(n);\n            // children of classes (even ambient classes) should not be marked as ambient or export\n            // because those flags have no useful semantics there.\n            if (n.parent.kind !== 253 /* InterfaceDeclaration */ &&\n                n.parent.kind !== 252 /* ClassDeclaration */ &&\n                n.parent.kind !== 221 /* ClassExpression */ &&\n                n.flags & 8388608 /* Ambient */) {\n                if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) {\n                    // It is nested in an ambient context, which means it is automatically exported\n                    flags |= 1 /* Export */;\n                }\n                flags |= 2 /* Ambient */;\n            }\n            return flags & flagsToCheck;\n        }\n        function checkFunctionOrConstructorSymbol(symbol) {\n            if (!produceDiagnostics) {\n                return;\n            }\n            function getCanonicalOverload(overloads, implementation) {\n                // Consider the canonical set of flags to be the flags of the bodyDeclaration or the first declaration\n                // Error on all deviations from this canonical set of flags\n                // The caveat is that if some overloads are defined in lib.d.ts, we don't want to\n                // report the errors on those. To achieve this, we will say that the implementation is\n                // the canonical signature only if it is in the same container as the first overload\n                var implementationSharesContainerWithFirstOverload = implementation !== undefined && implementation.parent === overloads[0].parent;\n                return implementationSharesContainerWithFirstOverload ? implementation : overloads[0];\n            }\n            function checkFlagAgreementBetweenOverloads(overloads, implementation, flagsToCheck, someOverloadFlags, allOverloadFlags) {\n                // Error if some overloads have a flag that is not shared by all overloads. To find the\n                // deviations, we XOR someOverloadFlags with allOverloadFlags\n                var someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags;\n                if (someButNotAllOverloadFlags !== 0) {\n                    var canonicalFlags_1 = getEffectiveDeclarationFlags(getCanonicalOverload(overloads, implementation), flagsToCheck);\n                    ts.forEach(overloads, function (o) {\n                        var deviation = getEffectiveDeclarationFlags(o, flagsToCheck) ^ canonicalFlags_1;\n                        if (deviation & 1 /* Export */) {\n                            error(ts.getNameOfDeclaration(o), ts.Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported);\n                        }\n                        else if (deviation & 2 /* Ambient */) {\n                            error(ts.getNameOfDeclaration(o), ts.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient);\n                        }\n                        else if (deviation & (8 /* Private */ | 16 /* Protected */)) {\n                            error(ts.getNameOfDeclaration(o) || o, ts.Diagnostics.Overload_signatures_must_all_be_public_private_or_protected);\n                        }\n                        else if (deviation & 128 /* Abstract */) {\n                            error(ts.getNameOfDeclaration(o), ts.Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract);\n                        }\n                    });\n                }\n            }\n            function checkQuestionTokenAgreementBetweenOverloads(overloads, implementation, someHaveQuestionToken, allHaveQuestionToken) {\n                if (someHaveQuestionToken !== allHaveQuestionToken) {\n                    var canonicalHasQuestionToken_1 = ts.hasQuestionToken(getCanonicalOverload(overloads, implementation));\n                    ts.forEach(overloads, function (o) {\n                        var deviation = ts.hasQuestionToken(o) !== canonicalHasQuestionToken_1;\n                        if (deviation) {\n                            error(ts.getNameOfDeclaration(o), ts.Diagnostics.Overload_signatures_must_all_be_optional_or_required);\n                        }\n                    });\n                }\n            }\n            var flagsToCheck = 1 /* Export */ | 2 /* Ambient */ | 8 /* Private */ | 16 /* Protected */ | 128 /* Abstract */;\n            var someNodeFlags = 0 /* None */;\n            var allNodeFlags = flagsToCheck;\n            var someHaveQuestionToken = false;\n            var allHaveQuestionToken = true;\n            var hasOverloads = false;\n            var bodyDeclaration;\n            var lastSeenNonAmbientDeclaration;\n            var previousDeclaration;\n            var declarations = symbol.declarations;\n            var isConstructor = (symbol.flags & 16384 /* Constructor */) !== 0;\n            function reportImplementationExpectedError(node) {\n                if (node.name && ts.nodeIsMissing(node.name)) {\n                    return;\n                }\n                var seen = false;\n                var subsequentNode = ts.forEachChild(node.parent, function (c) {\n                    if (seen) {\n                        return c;\n                    }\n                    else {\n                        seen = c === node;\n                    }\n                });\n                // We may be here because of some extra nodes between overloads that could not be parsed into a valid node.\n                // In this case the subsequent node is not really consecutive (.pos !== node.end), and we must ignore it here.\n                if (subsequentNode && subsequentNode.pos === node.end) {\n                    if (subsequentNode.kind === node.kind) {\n                        var errorNode_1 = subsequentNode.name || subsequentNode;\n                        var subsequentName = subsequentNode.name;\n                        if (node.name && subsequentName && (\n                        // both are private identifiers\n                        ts.isPrivateIdentifier(node.name) && ts.isPrivateIdentifier(subsequentName) && node.name.escapedText === subsequentName.escapedText ||\n                            // Both are computed property names\n                            // TODO: GH#17345: These are methods, so handle computed name case. (`Always allowing computed property names is *not* the correct behavior!)\n                            ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) ||\n                            // Both are literal property names that are the same.\n                            ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) &&\n                                ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) {\n                            var reportError = (node.kind === 165 /* MethodDeclaration */ || node.kind === 164 /* MethodSignature */) &&\n                                ts.hasSyntacticModifier(node, 32 /* Static */) !== ts.hasSyntacticModifier(subsequentNode, 32 /* Static */);\n                            // we can get here in two cases\n                            // 1. mixed static and instance class members\n                            // 2. something with the same name was defined before the set of overloads that prevents them from merging\n                            // here we'll report error only for the first case since for second we should already report error in binder\n                            if (reportError) {\n                                var diagnostic = ts.hasSyntacticModifier(node, 32 /* Static */) ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;\n                                error(errorNode_1, diagnostic);\n                            }\n                            return;\n                        }\n                        if (ts.nodeIsPresent(subsequentNode.body)) {\n                            error(errorNode_1, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name));\n                            return;\n                        }\n                    }\n                }\n                var errorNode = node.name || node;\n                if (isConstructor) {\n                    error(errorNode, ts.Diagnostics.Constructor_implementation_is_missing);\n                }\n                else {\n                    // Report different errors regarding non-consecutive blocks of declarations depending on whether\n                    // the node in question is abstract.\n                    if (ts.hasSyntacticModifier(node, 128 /* Abstract */)) {\n                        error(errorNode, ts.Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive);\n                    }\n                    else {\n                        error(errorNode, ts.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration);\n                    }\n                }\n            }\n            var duplicateFunctionDeclaration = false;\n            var multipleConstructorImplementation = false;\n            var hasNonAmbientClass = false;\n            var functionDeclarations = [];\n            for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) {\n                var current = declarations_4[_i];\n                var node = current;\n                var inAmbientContext = node.flags & 8388608 /* Ambient */;\n                var inAmbientContextOrInterface = node.parent && (node.parent.kind === 253 /* InterfaceDeclaration */ || node.parent.kind === 177 /* TypeLiteral */) || inAmbientContext;\n                if (inAmbientContextOrInterface) {\n                    // check if declarations are consecutive only if they are non-ambient\n                    // 1. ambient declarations can be interleaved\n                    // i.e. this is legal\n                    //     declare function foo();\n                    //     declare function bar();\n                    //     declare function foo();\n                    // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one\n                    previousDeclaration = undefined;\n                }\n                if ((node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */) && !inAmbientContext) {\n                    hasNonAmbientClass = true;\n                }\n                if (node.kind === 251 /* FunctionDeclaration */ || node.kind === 165 /* MethodDeclaration */ || node.kind === 164 /* MethodSignature */ || node.kind === 166 /* Constructor */) {\n                    functionDeclarations.push(node);\n                    var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck);\n                    someNodeFlags |= currentNodeFlags;\n                    allNodeFlags &= currentNodeFlags;\n                    someHaveQuestionToken = someHaveQuestionToken || ts.hasQuestionToken(node);\n                    allHaveQuestionToken = allHaveQuestionToken && ts.hasQuestionToken(node);\n                    var bodyIsPresent = ts.nodeIsPresent(node.body);\n                    if (bodyIsPresent && bodyDeclaration) {\n                        if (isConstructor) {\n                            multipleConstructorImplementation = true;\n                        }\n                        else {\n                            duplicateFunctionDeclaration = true;\n                        }\n                    }\n                    else if ((previousDeclaration === null || previousDeclaration === void 0 ? void 0 : previousDeclaration.parent) === node.parent && previousDeclaration.end !== node.pos) {\n                        reportImplementationExpectedError(previousDeclaration);\n                    }\n                    if (bodyIsPresent) {\n                        if (!bodyDeclaration) {\n                            bodyDeclaration = node;\n                        }\n                    }\n                    else {\n                        hasOverloads = true;\n                    }\n                    previousDeclaration = node;\n                    if (!inAmbientContextOrInterface) {\n                        lastSeenNonAmbientDeclaration = node;\n                    }\n                }\n            }\n            if (multipleConstructorImplementation) {\n                ts.forEach(functionDeclarations, function (declaration) {\n                    error(declaration, ts.Diagnostics.Multiple_constructor_implementations_are_not_allowed);\n                });\n            }\n            if (duplicateFunctionDeclaration) {\n                ts.forEach(functionDeclarations, function (declaration) {\n                    error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.Duplicate_function_implementation);\n                });\n            }\n            if (hasNonAmbientClass && !isConstructor && symbol.flags & 16 /* Function */) {\n                // A non-ambient class cannot be an implementation for a non-constructor function/class merge\n                // TODO: The below just replicates our older error from when classes and functions were\n                // entirely unable to merge - a more helpful message like \"Class declaration cannot implement overload list\"\n                // might be warranted. :shrug:\n                ts.forEach(declarations, function (declaration) {\n                    addDuplicateDeclarationError(declaration, ts.Diagnostics.Duplicate_identifier_0, ts.symbolName(symbol), declarations);\n                });\n            }\n            // Abstract methods can't have an implementation -- in particular, they don't need one.\n            if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body &&\n                !ts.hasSyntacticModifier(lastSeenNonAmbientDeclaration, 128 /* Abstract */) && !lastSeenNonAmbientDeclaration.questionToken) {\n                reportImplementationExpectedError(lastSeenNonAmbientDeclaration);\n            }\n            if (hasOverloads) {\n                checkFlagAgreementBetweenOverloads(declarations, bodyDeclaration, flagsToCheck, someNodeFlags, allNodeFlags);\n                checkQuestionTokenAgreementBetweenOverloads(declarations, bodyDeclaration, someHaveQuestionToken, allHaveQuestionToken);\n                if (bodyDeclaration) {\n                    var signatures = getSignaturesOfSymbol(symbol);\n                    var bodySignature = getSignatureFromDeclaration(bodyDeclaration);\n                    for (var _a = 0, signatures_10 = signatures; _a < signatures_10.length; _a++) {\n                        var signature = signatures_10[_a];\n                        if (!isImplementationCompatibleWithOverload(bodySignature, signature)) {\n                            ts.addRelatedInfo(error(signature.declaration, ts.Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature), ts.createDiagnosticForNode(bodyDeclaration, ts.Diagnostics.The_implementation_signature_is_declared_here));\n                            break;\n                        }\n                    }\n                }\n            }\n        }\n        function checkExportsOnMergedDeclarations(node) {\n            if (!produceDiagnostics) {\n                return;\n            }\n            // if localSymbol is defined on node then node itself is exported - check is required\n            var symbol = node.localSymbol;\n            if (!symbol) {\n                // local symbol is undefined => this declaration is non-exported.\n                // however symbol might contain other declarations that are exported\n                symbol = getSymbolOfNode(node);\n                if (!symbol.exportSymbol) {\n                    // this is a pure local symbol (all declarations are non-exported) - no need to check anything\n                    return;\n                }\n            }\n            // run the check only for the first declaration in the list\n            if (ts.getDeclarationOfKind(symbol, node.kind) !== node) {\n                return;\n            }\n            var exportedDeclarationSpaces = 0 /* None */;\n            var nonExportedDeclarationSpaces = 0 /* None */;\n            var defaultExportedDeclarationSpaces = 0 /* None */;\n            for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                var d = _a[_i];\n                var declarationSpaces = getDeclarationSpaces(d);\n                var effectiveDeclarationFlags = getEffectiveDeclarationFlags(d, 1 /* Export */ | 512 /* Default */);\n                if (effectiveDeclarationFlags & 1 /* Export */) {\n                    if (effectiveDeclarationFlags & 512 /* Default */) {\n                        defaultExportedDeclarationSpaces |= declarationSpaces;\n                    }\n                    else {\n                        exportedDeclarationSpaces |= declarationSpaces;\n                    }\n                }\n                else {\n                    nonExportedDeclarationSpaces |= declarationSpaces;\n                }\n            }\n            // Spaces for anything not declared a 'default export'.\n            var nonDefaultExportedDeclarationSpaces = exportedDeclarationSpaces | nonExportedDeclarationSpaces;\n            var commonDeclarationSpacesForExportsAndLocals = exportedDeclarationSpaces & nonExportedDeclarationSpaces;\n            var commonDeclarationSpacesForDefaultAndNonDefault = defaultExportedDeclarationSpaces & nonDefaultExportedDeclarationSpaces;\n            if (commonDeclarationSpacesForExportsAndLocals || commonDeclarationSpacesForDefaultAndNonDefault) {\n                // declaration spaces for exported and non-exported declarations intersect\n                for (var _b = 0, _c = symbol.declarations; _b < _c.length; _b++) {\n                    var d = _c[_b];\n                    var declarationSpaces = getDeclarationSpaces(d);\n                    var name = ts.getNameOfDeclaration(d);\n                    // Only error on the declarations that contributed to the intersecting spaces.\n                    if (declarationSpaces & commonDeclarationSpacesForDefaultAndNonDefault) {\n                        error(name, ts.Diagnostics.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead, ts.declarationNameToString(name));\n                    }\n                    else if (declarationSpaces & commonDeclarationSpacesForExportsAndLocals) {\n                        error(name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.declarationNameToString(name));\n                    }\n                }\n            }\n            function getDeclarationSpaces(decl) {\n                var d = decl;\n                switch (d.kind) {\n                    case 253 /* InterfaceDeclaration */:\n                    case 254 /* TypeAliasDeclaration */:\n                    // A jsdoc typedef and callback are, by definition, type aliases.\n                    // falls through\n                    case 331 /* JSDocTypedefTag */:\n                    case 324 /* JSDocCallbackTag */:\n                    case 325 /* JSDocEnumTag */:\n                        return 2 /* ExportType */;\n                    case 256 /* ModuleDeclaration */:\n                        return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */\n                            ? 4 /* ExportNamespace */ | 1 /* ExportValue */\n                            : 4 /* ExportNamespace */;\n                    case 252 /* ClassDeclaration */:\n                    case 255 /* EnumDeclaration */:\n                    case 291 /* EnumMember */:\n                        return 2 /* ExportType */ | 1 /* ExportValue */;\n                    case 297 /* SourceFile */:\n                        return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */;\n                    case 266 /* ExportAssignment */:\n                        // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values\n                        if (!ts.isEntityNameExpression(d.expression)) {\n                            return 1 /* ExportValue */;\n                        }\n                        d = d.expression;\n                    // The below options all declare an Alias, which is allowed to merge with other values within the importing module.\n                    // falls through\n                    case 260 /* ImportEqualsDeclaration */:\n                    case 263 /* NamespaceImport */:\n                    case 262 /* ImportClause */:\n                        var result_12 = 0 /* None */;\n                        var target = resolveAlias(getSymbolOfNode(d));\n                        ts.forEach(target.declarations, function (d) { result_12 |= getDeclarationSpaces(d); });\n                        return result_12;\n                    case 249 /* VariableDeclaration */:\n                    case 198 /* BindingElement */:\n                    case 251 /* FunctionDeclaration */:\n                    case 265 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591\n                    case 78 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098\n                        // Identifiers are used as declarations of assignment declarations whose parents may be\n                        // SyntaxKind.CallExpression - `Object.defineProperty(thing, \"aField\", {value: 42});`\n                        // SyntaxKind.ElementAccessExpression - `thing[\"aField\"] = 42;` or `thing[\"aField\"];` (with a doc comment on it)\n                        // or SyntaxKind.PropertyAccessExpression - `thing.aField = 42;`\n                        // all of which are pretty much always values, or at least imply a value meaning.\n                        // It may be apprpriate to treat these as aliases in the future.\n                        return 1 /* ExportValue */;\n                    default:\n                        return ts.Debug.failBadSyntaxKind(d);\n                }\n            }\n        }\n        function getAwaitedTypeOfPromise(type, errorNode, diagnosticMessage, arg0) {\n            var promisedType = getPromisedTypeOfPromise(type, errorNode);\n            return promisedType && getAwaitedType(promisedType, errorNode, diagnosticMessage, arg0);\n        }\n        /**\n         * Gets the \"promised type\" of a promise.\n         * @param type The type of the promise.\n         * @remarks The \"promised type\" of a type is the type of the \"value\" parameter of the \"onfulfilled\" callback.\n         */\n        function getPromisedTypeOfPromise(type, errorNode) {\n            //\n            //  { // type\n            //      then( // thenFunction\n            //          onfulfilled: ( // onfulfilledParameterType\n            //              value: T // valueParameterType\n            //          ) => any\n            //      ): any;\n            //  }\n            //\n            if (isTypeAny(type)) {\n                return undefined;\n            }\n            var typeAsPromise = type;\n            if (typeAsPromise.promisedTypeOfPromise) {\n                return typeAsPromise.promisedTypeOfPromise;\n            }\n            if (isReferenceToType(type, getGlobalPromiseType(/*reportErrors*/ false))) {\n                return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0];\n            }\n            var thenFunction = getTypeOfPropertyOfType(type, \"then\"); // TODO: GH#18217\n            if (isTypeAny(thenFunction)) {\n                return undefined;\n            }\n            var thenSignatures = thenFunction ? getSignaturesOfType(thenFunction, 0 /* Call */) : ts.emptyArray;\n            if (thenSignatures.length === 0) {\n                if (errorNode) {\n                    error(errorNode, ts.Diagnostics.A_promise_must_have_a_then_method);\n                }\n                return undefined;\n            }\n            var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(thenSignatures, getTypeOfFirstParameterOfSignature)), 2097152 /* NEUndefinedOrNull */);\n            if (isTypeAny(onfulfilledParameterType)) {\n                return undefined;\n            }\n            var onfulfilledParameterSignatures = getSignaturesOfType(onfulfilledParameterType, 0 /* Call */);\n            if (onfulfilledParameterSignatures.length === 0) {\n                if (errorNode) {\n                    error(errorNode, ts.Diagnostics.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback);\n                }\n                return undefined;\n            }\n            return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), 2 /* Subtype */);\n        }\n        /**\n         * Gets the \"awaited type\" of a type.\n         * @param type The type to await.\n         * @remarks The \"awaited type\" of an expression is its \"promised type\" if the expression is a\n         * Promise-like type; otherwise, it is the type of the expression. This is used to reflect\n         * The runtime behavior of the `await` keyword.\n         */\n        function checkAwaitedType(type, errorNode, diagnosticMessage, arg0) {\n            var awaitedType = getAwaitedType(type, errorNode, diagnosticMessage, arg0);\n            return awaitedType || errorType;\n        }\n        /**\n         * Determines whether a type has a callable `then` member.\n         */\n        function isThenableType(type) {\n            var thenFunction = getTypeOfPropertyOfType(type, \"then\");\n            return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152 /* NEUndefinedOrNull */), 0 /* Call */).length > 0;\n        }\n        /**\n         * Gets the \"awaited type\" of a type.\n         *\n         * The \"awaited type\" of an expression is its \"promised type\" if the expression is a\n         * Promise-like type; otherwise, it is the type of the expression. If the \"promised\n         * type\" is itself a Promise-like, the \"promised type\" is recursively unwrapped until a\n         * non-promise type is found.\n         *\n         * This is used to reflect the runtime behavior of the `await` keyword.\n         */\n        function getAwaitedType(type, errorNode, diagnosticMessage, arg0) {\n            if (isTypeAny(type)) {\n                return type;\n            }\n            var typeAsAwaitable = type;\n            if (typeAsAwaitable.awaitedTypeOfType) {\n                return typeAsAwaitable.awaitedTypeOfType;\n            }\n            // For a union, get a union of the awaited types of each constituent.\n            //\n            return typeAsAwaitable.awaitedTypeOfType =\n                mapType(type, errorNode ? function (constituentType) { return getAwaitedTypeWorker(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeWorker);\n        }\n        function getAwaitedTypeWorker(type, errorNode, diagnosticMessage, arg0) {\n            var typeAsAwaitable = type;\n            if (typeAsAwaitable.awaitedTypeOfType) {\n                return typeAsAwaitable.awaitedTypeOfType;\n            }\n            var promisedType = getPromisedTypeOfPromise(type);\n            if (promisedType) {\n                if (type.id === promisedType.id || awaitedTypeStack.lastIndexOf(promisedType.id) >= 0) {\n                    // Verify that we don't have a bad actor in the form of a promise whose\n                    // promised type is the same as the promise type, or a mutually recursive\n                    // promise. If so, we return undefined as we cannot guess the shape. If this\n                    // were the actual case in the JavaScript, this Promise would never resolve.\n                    //\n                    // An example of a bad actor with a singly-recursive promise type might\n                    // be:\n                    //\n                    //  interface BadPromise {\n                    //      then(\n                    //          onfulfilled: (value: BadPromise) => any,\n                    //          onrejected: (error: any) => any): BadPromise;\n                    //  }\n                    //\n                    // The above interface will pass the PromiseLike check, and return a\n                    // promised type of `BadPromise`. Since this is a self reference, we\n                    // don't want to keep recursing ad infinitum.\n                    //\n                    // An example of a bad actor in the form of a mutually-recursive\n                    // promise type might be:\n                    //\n                    //  interface BadPromiseA {\n                    //      then(\n                    //          onfulfilled: (value: BadPromiseB) => any,\n                    //          onrejected: (error: any) => any): BadPromiseB;\n                    //  }\n                    //\n                    //  interface BadPromiseB {\n                    //      then(\n                    //          onfulfilled: (value: BadPromiseA) => any,\n                    //          onrejected: (error: any) => any): BadPromiseA;\n                    //  }\n                    //\n                    if (errorNode) {\n                        error(errorNode, ts.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method);\n                    }\n                    return undefined;\n                }\n                // Keep track of the type we're about to unwrap to avoid bad recursive promise types.\n                // See the comments above for more information.\n                awaitedTypeStack.push(type.id);\n                var awaitedType = getAwaitedType(promisedType, errorNode, diagnosticMessage, arg0);\n                awaitedTypeStack.pop();\n                if (!awaitedType) {\n                    return undefined;\n                }\n                return typeAsAwaitable.awaitedTypeOfType = awaitedType;\n            }\n            // The type was not a promise, so it could not be unwrapped any further.\n            // As long as the type does not have a callable \"then\" property, it is\n            // safe to return the type; otherwise, an error is reported and we return\n            // undefined.\n            //\n            // An example of a non-promise \"thenable\" might be:\n            //\n            //  await { then(): void {} }\n            //\n            // The \"thenable\" does not match the minimal definition for a promise. When\n            // a Promise/A+-compatible or ES6 promise tries to adopt this value, the promise\n            // will never settle. We treat this as an error to help flag an early indicator\n            // of a runtime problem. If the user wants to return this value from an async\n            // function, they would need to wrap it in some other value. If they want it to\n            // be treated as a promise, they can cast to <any>.\n            if (isThenableType(type)) {\n                if (errorNode) {\n                    if (!diagnosticMessage)\n                        return ts.Debug.fail();\n                    error(errorNode, diagnosticMessage, arg0);\n                }\n                return undefined;\n            }\n            return typeAsAwaitable.awaitedTypeOfType = type;\n        }\n        /**\n         * Checks the return type of an async function to ensure it is a compatible\n         * Promise implementation.\n         *\n         * This checks that an async function has a valid Promise-compatible return type.\n         * An async function has a valid Promise-compatible return type if the resolved value\n         * of the return type has a construct signature that takes in an `initializer` function\n         * that in turn supplies a `resolve` function as one of its arguments and results in an\n         * object with a callable `then` signature.\n         *\n         * @param node The signature to check\n         */\n        function checkAsyncFunctionReturnType(node, returnTypeNode) {\n            // As part of our emit for an async function, we will need to emit the entity name of\n            // the return type annotation as an expression. To meet the necessary runtime semantics\n            // for __awaiter, we must also check that the type of the declaration (e.g. the static\n            // side or \"constructor\" of the promise type) is compatible `PromiseConstructorLike`.\n            //\n            // An example might be (from lib.es6.d.ts):\n            //\n            //  interface Promise<T> { ... }\n            //  interface PromiseConstructor {\n            //      new <T>(...): Promise<T>;\n            //  }\n            //  declare var Promise: PromiseConstructor;\n            //\n            // When an async function declares a return type annotation of `Promise<T>`, we\n            // need to get the type of the `Promise` variable declaration above, which would\n            // be `PromiseConstructor`.\n            //\n            // The same case applies to a class:\n            //\n            //  declare class Promise<T> {\n            //      constructor(...);\n            //      then<U>(...): Promise<U>;\n            //  }\n            //\n            var returnType = getTypeFromTypeNode(returnTypeNode);\n            if (languageVersion >= 2 /* ES2015 */) {\n                if (returnType === errorType) {\n                    return;\n                }\n                var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true);\n                if (globalPromiseType !== emptyGenericType && !isReferenceToType(returnType, globalPromiseType)) {\n                    // The promise type was not a valid type reference to the global promise type, so we\n                    // report an error and return the unknown type.\n                    error(returnTypeNode, ts.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0, typeToString(getAwaitedType(returnType) || voidType));\n                    return;\n                }\n            }\n            else {\n                // Always mark the type node as referenced if it points to a value\n                markTypeNodeAsReferenced(returnTypeNode);\n                if (returnType === errorType) {\n                    return;\n                }\n                var promiseConstructorName = ts.getEntityNameFromTypeNode(returnTypeNode);\n                if (promiseConstructorName === undefined) {\n                    error(returnTypeNode, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, typeToString(returnType));\n                    return;\n                }\n                var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 111551 /* Value */, /*ignoreErrors*/ true);\n                var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : errorType;\n                if (promiseConstructorType === errorType) {\n                    if (promiseConstructorName.kind === 78 /* Identifier */ && promiseConstructorName.escapedText === \"Promise\" && getTargetType(returnType) === getGlobalPromiseType(/*reportErrors*/ false)) {\n                        error(returnTypeNode, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);\n                    }\n                    else {\n                        error(returnTypeNode, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName));\n                    }\n                    return;\n                }\n                var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType(/*reportErrors*/ true);\n                if (globalPromiseConstructorLikeType === emptyObjectType) {\n                    // If we couldn't resolve the global PromiseConstructorLike type we cannot verify\n                    // compatibility with __awaiter.\n                    error(returnTypeNode, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName));\n                    return;\n                }\n                if (!checkTypeAssignableTo(promiseConstructorType, globalPromiseConstructorLikeType, returnTypeNode, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value)) {\n                    return;\n                }\n                // Verify there is no local declaration that could collide with the promise constructor.\n                var rootName = promiseConstructorName && ts.getFirstIdentifier(promiseConstructorName);\n                var collidingSymbol = getSymbol(node.locals, rootName.escapedText, 111551 /* Value */);\n                if (collidingSymbol) {\n                    error(collidingSymbol.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, ts.idText(rootName), ts.entityNameToString(promiseConstructorName));\n                    return;\n                }\n            }\n            checkAwaitedType(returnType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);\n        }\n        /** Check a decorator */\n        function checkDecorator(node) {\n            var signature = getResolvedSignature(node);\n            checkDeprecatedSignature(signature, node);\n            var returnType = getReturnTypeOfSignature(signature);\n            if (returnType.flags & 1 /* Any */) {\n                return;\n            }\n            var expectedReturnType;\n            var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);\n            var errorInfo;\n            switch (node.parent.kind) {\n                case 252 /* ClassDeclaration */:\n                    var classSymbol = getSymbolOfNode(node.parent);\n                    var classConstructorType = getTypeOfSymbol(classSymbol);\n                    expectedReturnType = getUnionType([classConstructorType, voidType]);\n                    break;\n                case 160 /* Parameter */:\n                    expectedReturnType = voidType;\n                    errorInfo = ts.chainDiagnosticMessages(\n                    /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);\n                    break;\n                case 163 /* PropertyDeclaration */:\n                    expectedReturnType = voidType;\n                    errorInfo = ts.chainDiagnosticMessages(\n                    /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);\n                    break;\n                case 165 /* MethodDeclaration */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    var methodType = getTypeOfNode(node.parent);\n                    var descriptorType = createTypedPropertyDescriptorType(methodType);\n                    expectedReturnType = getUnionType([descriptorType, voidType]);\n                    break;\n                default:\n                    return ts.Debug.fail();\n            }\n            checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, function () { return errorInfo; });\n        }\n        /**\n         * If a TypeNode can be resolved to a value symbol imported from an external module, it is\n         * marked as referenced to prevent import elision.\n         */\n        function markTypeNodeAsReferenced(node) {\n            markEntityNameOrEntityExpressionAsReference(node && ts.getEntityNameFromTypeNode(node));\n        }\n        function markEntityNameOrEntityExpressionAsReference(typeName) {\n            if (!typeName)\n                return;\n            var rootName = ts.getFirstIdentifier(typeName);\n            var meaning = (typeName.kind === 78 /* Identifier */ ? 788968 /* Type */ : 1920 /* Namespace */) | 2097152 /* Alias */;\n            var rootSymbol = resolveName(rootName, rootName.escapedText, meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isRefernce*/ true);\n            if (rootSymbol\n                && rootSymbol.flags & 2097152 /* Alias */\n                && symbolIsValue(rootSymbol)\n                && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol))\n                && !getTypeOnlyAliasDeclaration(rootSymbol)) {\n                markAliasSymbolAsReferenced(rootSymbol);\n            }\n        }\n        /**\n         * This function marks the type used for metadata decorator as referenced if it is import\n         * from external module.\n         * This is different from markTypeNodeAsReferenced because it tries to simplify type nodes in\n         * union and intersection type\n         * @param node\n         */\n        function markDecoratorMedataDataTypeNodeAsReferenced(node) {\n            var entityName = getEntityNameForDecoratorMetadata(node);\n            if (entityName && ts.isEntityName(entityName)) {\n                markEntityNameOrEntityExpressionAsReference(entityName);\n            }\n        }\n        function getEntityNameForDecoratorMetadata(node) {\n            if (node) {\n                switch (node.kind) {\n                    case 183 /* IntersectionType */:\n                    case 182 /* UnionType */:\n                        return getEntityNameForDecoratorMetadataFromTypeList(node.types);\n                    case 184 /* ConditionalType */:\n                        return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]);\n                    case 186 /* ParenthesizedType */:\n                    case 192 /* NamedTupleMember */:\n                        return getEntityNameForDecoratorMetadata(node.type);\n                    case 173 /* TypeReference */:\n                        return node.typeName;\n                }\n            }\n        }\n        function getEntityNameForDecoratorMetadataFromTypeList(types) {\n            var commonEntityName;\n            for (var _i = 0, types_23 = types; _i < types_23.length; _i++) {\n                var typeNode = types_23[_i];\n                while (typeNode.kind === 186 /* ParenthesizedType */ || typeNode.kind === 192 /* NamedTupleMember */) {\n                    typeNode = typeNode.type; // Skip parens if need be\n                }\n                if (typeNode.kind === 141 /* NeverKeyword */) {\n                    continue; // Always elide `never` from the union/intersection if possible\n                }\n                if (!strictNullChecks && (typeNode.kind === 191 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 150 /* UndefinedKeyword */)) {\n                    continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks\n                }\n                var individualEntityName = getEntityNameForDecoratorMetadata(typeNode);\n                if (!individualEntityName) {\n                    // Individual is something like string number\n                    // So it would be serialized to either that type or object\n                    // Safe to return here\n                    return undefined;\n                }\n                if (commonEntityName) {\n                    // Note this is in sync with the transformation that happens for type node.\n                    // Keep this in sync with serializeUnionOrIntersectionType\n                    // Verify if they refer to same entity and is identifier\n                    // return undefined if they dont match because we would emit object\n                    if (!ts.isIdentifier(commonEntityName) ||\n                        !ts.isIdentifier(individualEntityName) ||\n                        commonEntityName.escapedText !== individualEntityName.escapedText) {\n                        return undefined;\n                    }\n                }\n                else {\n                    commonEntityName = individualEntityName;\n                }\n            }\n            return commonEntityName;\n        }\n        function getParameterTypeNodeForDecoratorCheck(node) {\n            var typeNode = ts.getEffectiveTypeAnnotationNode(node);\n            return ts.isRestParameter(node) ? ts.getRestParameterElementType(typeNode) : typeNode;\n        }\n        /** Check the decorators of a node */\n        function checkDecorators(node) {\n            if (!node.decorators) {\n                return;\n            }\n            // skip this check for nodes that cannot have decorators. These should have already had an error reported by\n            // checkGrammarDecorators.\n            if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) {\n                return;\n            }\n            if (!compilerOptions.experimentalDecorators) {\n                error(node, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning);\n            }\n            var firstDecorator = node.decorators[0];\n            checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */);\n            if (node.kind === 160 /* Parameter */) {\n                checkExternalEmitHelpers(firstDecorator, 32 /* Param */);\n            }\n            if (compilerOptions.emitDecoratorMetadata) {\n                checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */);\n                // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator.\n                switch (node.kind) {\n                    case 252 /* ClassDeclaration */:\n                        var constructor = ts.getFirstConstructorWithBody(node);\n                        if (constructor) {\n                            for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) {\n                                var parameter = _a[_i];\n                                markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));\n                            }\n                        }\n                        break;\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                        var otherKind = node.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */;\n                        var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind);\n                        markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor));\n                        break;\n                    case 165 /* MethodDeclaration */:\n                        for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) {\n                            var parameter = _c[_b];\n                            markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));\n                        }\n                        markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node));\n                        break;\n                    case 163 /* PropertyDeclaration */:\n                        markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node));\n                        break;\n                    case 160 /* Parameter */:\n                        markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node));\n                        var containingSignature = node.parent;\n                        for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) {\n                            var parameter = _e[_d];\n                            markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));\n                        }\n                        break;\n                }\n            }\n            ts.forEach(node.decorators, checkDecorator);\n        }\n        function checkFunctionDeclaration(node) {\n            if (produceDiagnostics) {\n                checkFunctionOrMethodDeclaration(node);\n                checkGrammarForGenerator(node);\n                checkCollisionWithRequireExportsInGeneratedCode(node, node.name);\n                checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);\n            }\n        }\n        function checkJSDocTypeAliasTag(node) {\n            if (!node.typeExpression) {\n                // If the node had `@property` tags, `typeExpression` would have been set to the first property tag.\n                error(node.name, ts.Diagnostics.JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags);\n            }\n            if (node.name) {\n                checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0);\n            }\n            checkSourceElement(node.typeExpression);\n        }\n        function checkJSDocTemplateTag(node) {\n            checkSourceElement(node.constraint);\n            for (var _i = 0, _a = node.typeParameters; _i < _a.length; _i++) {\n                var tp = _a[_i];\n                checkSourceElement(tp);\n            }\n        }\n        function checkJSDocTypeTag(node) {\n            checkSourceElement(node.typeExpression);\n        }\n        function checkJSDocParameterTag(node) {\n            checkSourceElement(node.typeExpression);\n            if (!ts.getParameterSymbolFromJSDoc(node)) {\n                var decl = ts.getHostSignatureFromJSDoc(node);\n                // don't issue an error for invalid hosts -- just functions --\n                // and give a better error message when the host function mentions `arguments`\n                // but the tag doesn't have an array type\n                if (decl) {\n                    var i = ts.getJSDocTags(decl).filter(ts.isJSDocParameterTag).indexOf(node);\n                    if (i > -1 && i < decl.parameters.length && ts.isBindingPattern(decl.parameters[i].name)) {\n                        return;\n                    }\n                    if (!containsArgumentsReference(decl)) {\n                        if (ts.isQualifiedName(node.name)) {\n                            error(node.name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(node.name), ts.entityNameToString(node.name.left));\n                        }\n                        else {\n                            error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name));\n                        }\n                    }\n                    else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node &&\n                        node.typeExpression && node.typeExpression.type &&\n                        !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) {\n                        error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 157 /* QualifiedName */ ? node.name.right : node.name));\n                    }\n                }\n            }\n        }\n        function checkJSDocPropertyTag(node) {\n            checkSourceElement(node.typeExpression);\n        }\n        function checkJSDocFunctionType(node) {\n            if (produceDiagnostics && !node.type && !ts.isJSDocConstructSignature(node)) {\n                reportImplicitAny(node, anyType);\n            }\n            checkSignatureDeclaration(node);\n        }\n        function checkJSDocImplementsTag(node) {\n            var classLike = ts.getEffectiveJSDocHost(node);\n            if (!classLike || !ts.isClassDeclaration(classLike) && !ts.isClassExpression(classLike)) {\n                error(classLike, ts.Diagnostics.JSDoc_0_is_not_attached_to_a_class, ts.idText(node.tagName));\n            }\n        }\n        function checkJSDocAugmentsTag(node) {\n            var classLike = ts.getEffectiveJSDocHost(node);\n            if (!classLike || !ts.isClassDeclaration(classLike) && !ts.isClassExpression(classLike)) {\n                error(classLike, ts.Diagnostics.JSDoc_0_is_not_attached_to_a_class, ts.idText(node.tagName));\n                return;\n            }\n            var augmentsTags = ts.getJSDocTags(classLike).filter(ts.isJSDocAugmentsTag);\n            ts.Debug.assert(augmentsTags.length > 0);\n            if (augmentsTags.length > 1) {\n                error(augmentsTags[1], ts.Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag);\n            }\n            var name = getIdentifierFromEntityNameExpression(node.class.expression);\n            var extend = ts.getClassExtendsHeritageElement(classLike);\n            if (extend) {\n                var className = getIdentifierFromEntityNameExpression(extend.expression);\n                if (className && name.escapedText !== className.escapedText) {\n                    error(name, ts.Diagnostics.JSDoc_0_1_does_not_match_the_extends_2_clause, ts.idText(node.tagName), ts.idText(name), ts.idText(className));\n                }\n            }\n        }\n        function getIdentifierFromEntityNameExpression(node) {\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                    return node;\n                case 201 /* PropertyAccessExpression */:\n                    return node.name;\n                default:\n                    return undefined;\n            }\n        }\n        function checkFunctionOrMethodDeclaration(node) {\n            checkDecorators(node);\n            checkSignatureDeclaration(node);\n            var functionFlags = ts.getFunctionFlags(node);\n            // Do not use hasDynamicName here, because that returns false for well known symbols.\n            // We want to perform checkComputedPropertyName for all computed properties, including\n            // well known symbols.\n            if (node.name && node.name.kind === 158 /* ComputedPropertyName */) {\n                // This check will account for methods in class/interface declarations,\n                // as well as accessors in classes/object literals\n                checkComputedPropertyName(node.name);\n            }\n            if (hasBindableName(node)) {\n                // first we want to check the local symbol that contain this declaration\n                // - if node.localSymbol !== undefined - this is current declaration is exported and localSymbol points to the local symbol\n                // - if node.localSymbol === undefined - this node is non-exported so we can just pick the result of getSymbolOfNode\n                var symbol = getSymbolOfNode(node);\n                var localSymbol = node.localSymbol || symbol;\n                // Since the javascript won't do semantic analysis like typescript,\n                // if the javascript file comes before the typescript file and both contain same name functions,\n                // checkFunctionOrConstructorSymbol wouldn't be called if we didnt ignore javascript function.\n                var firstDeclaration = ts.find(localSymbol.declarations, \n                // Get first non javascript function declaration\n                function (declaration) { return declaration.kind === node.kind && !(declaration.flags & 131072 /* JavaScriptFile */); });\n                // Only type check the symbol once\n                if (node === firstDeclaration) {\n                    checkFunctionOrConstructorSymbol(localSymbol);\n                }\n                if (symbol.parent) {\n                    // run check on export symbol to check that modifiers agree across all exported declarations\n                    checkFunctionOrConstructorSymbol(symbol);\n                }\n            }\n            var body = node.kind === 164 /* MethodSignature */ ? undefined : node.body;\n            checkSourceElement(body);\n            checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node));\n            if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) {\n                // Report an implicit any error if there is no body, no explicit return type, and node is not a private method\n                // in an ambient context\n                if (ts.nodeIsMissing(body) && !isPrivateWithinAmbient(node)) {\n                    reportImplicitAny(node, anyType);\n                }\n                if (functionFlags & 1 /* Generator */ && ts.nodeIsPresent(body)) {\n                    // A generator with a body and no type annotation can still cause errors. It can error if the\n                    // yielded values have no common supertype, or it can give an implicit any error if it has no\n                    // yielded values. The only way to trigger these errors is to try checking its return type.\n                    getReturnTypeOfSignature(getSignatureFromDeclaration(node));\n                }\n            }\n            // A js function declaration can have a @type tag instead of a return type node, but that type must have a call signature\n            if (ts.isInJSFile(node)) {\n                var typeTag = ts.getJSDocTypeTag(node);\n                if (typeTag && typeTag.typeExpression && !getContextualCallSignature(getTypeFromTypeNode(typeTag.typeExpression), node)) {\n                    error(typeTag.typeExpression.type, ts.Diagnostics.The_type_of_a_function_declaration_must_match_the_function_s_signature);\n                }\n            }\n        }\n        function registerForUnusedIdentifiersCheck(node) {\n            // May be in a call such as getTypeOfNode that happened to call this. But potentiallyUnusedIdentifiers is only defined in the scope of `checkSourceFile`.\n            if (produceDiagnostics) {\n                var sourceFile = ts.getSourceFileOfNode(node);\n                var potentiallyUnusedIdentifiers = allPotentiallyUnusedIdentifiers.get(sourceFile.path);\n                if (!potentiallyUnusedIdentifiers) {\n                    potentiallyUnusedIdentifiers = [];\n                    allPotentiallyUnusedIdentifiers.set(sourceFile.path, potentiallyUnusedIdentifiers);\n                }\n                // TODO: GH#22580\n                // Debug.assert(addToSeen(seenPotentiallyUnusedIdentifiers, getNodeId(node)), \"Adding potentially-unused identifier twice\");\n                potentiallyUnusedIdentifiers.push(node);\n            }\n        }\n        function checkUnusedIdentifiers(potentiallyUnusedIdentifiers, addDiagnostic) {\n            for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) {\n                var node = potentiallyUnusedIdentifiers_1[_i];\n                switch (node.kind) {\n                    case 252 /* ClassDeclaration */:\n                    case 221 /* ClassExpression */:\n                        checkUnusedClassMembers(node, addDiagnostic);\n                        checkUnusedTypeParameters(node, addDiagnostic);\n                        break;\n                    case 297 /* SourceFile */:\n                    case 256 /* ModuleDeclaration */:\n                    case 230 /* Block */:\n                    case 258 /* CaseBlock */:\n                    case 237 /* ForStatement */:\n                    case 238 /* ForInStatement */:\n                    case 239 /* ForOfStatement */:\n                        checkUnusedLocalsAndParameters(node, addDiagnostic);\n                        break;\n                    case 166 /* Constructor */:\n                    case 208 /* FunctionExpression */:\n                    case 251 /* FunctionDeclaration */:\n                    case 209 /* ArrowFunction */:\n                    case 165 /* MethodDeclaration */:\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                        if (node.body) { // Don't report unused parameters in overloads\n                            checkUnusedLocalsAndParameters(node, addDiagnostic);\n                        }\n                        checkUnusedTypeParameters(node, addDiagnostic);\n                        break;\n                    case 164 /* MethodSignature */:\n                    case 169 /* CallSignature */:\n                    case 170 /* ConstructSignature */:\n                    case 174 /* FunctionType */:\n                    case 175 /* ConstructorType */:\n                    case 254 /* TypeAliasDeclaration */:\n                    case 253 /* InterfaceDeclaration */:\n                        checkUnusedTypeParameters(node, addDiagnostic);\n                        break;\n                    case 185 /* InferType */:\n                        checkUnusedInferTypeParameter(node, addDiagnostic);\n                        break;\n                    default:\n                        ts.Debug.assertNever(node, \"Node should not have been registered for unused identifiers check\");\n                }\n            }\n        }\n        function errorUnusedLocal(declaration, name, addDiagnostic) {\n            var node = ts.getNameOfDeclaration(declaration) || declaration;\n            var message = isTypeDeclaration(declaration) ? ts.Diagnostics._0_is_declared_but_never_used : ts.Diagnostics._0_is_declared_but_its_value_is_never_read;\n            addDiagnostic(declaration, 0 /* Local */, ts.createDiagnosticForNode(node, message, name));\n        }\n        function isIdentifierThatStartsWithUnderscore(node) {\n            return ts.isIdentifier(node) && ts.idText(node).charCodeAt(0) === 95 /* _ */;\n        }\n        function checkUnusedClassMembers(node, addDiagnostic) {\n            for (var _i = 0, _a = node.members; _i < _a.length; _i++) {\n                var member = _a[_i];\n                switch (member.kind) {\n                    case 165 /* MethodDeclaration */:\n                    case 163 /* PropertyDeclaration */:\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                        if (member.kind === 168 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) {\n                            // Already would have reported an error on the getter.\n                            break;\n                        }\n                        var symbol = getSymbolOfNode(member);\n                        if (!symbol.isReferenced\n                            && (ts.hasEffectiveModifier(member, 8 /* Private */) || ts.isNamedDeclaration(member) && ts.isPrivateIdentifier(member.name))\n                            && !(member.flags & 8388608 /* Ambient */)) {\n                            addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)));\n                        }\n                        break;\n                    case 166 /* Constructor */:\n                        for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {\n                            var parameter = _c[_b];\n                            if (!parameter.symbol.isReferenced && ts.hasSyntacticModifier(parameter, 8 /* Private */)) {\n                                addDiagnostic(parameter, 0 /* Local */, ts.createDiagnosticForNode(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol)));\n                            }\n                        }\n                        break;\n                    case 171 /* IndexSignature */:\n                    case 229 /* SemicolonClassElement */:\n                        // Can't be private\n                        break;\n                    default:\n                        ts.Debug.fail();\n                }\n            }\n        }\n        function checkUnusedInferTypeParameter(node, addDiagnostic) {\n            var typeParameter = node.typeParameter;\n            if (isTypeParameterUnused(typeParameter)) {\n                addDiagnostic(node, 1 /* Parameter */, ts.createDiagnosticForNode(node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(typeParameter.name)));\n            }\n        }\n        function checkUnusedTypeParameters(node, addDiagnostic) {\n            // Only report errors on the last declaration for the type parameter container;\n            // this ensures that all uses have been accounted for.\n            if (ts.last(getSymbolOfNode(node).declarations) !== node)\n                return;\n            var typeParameters = ts.getEffectiveTypeParameterDeclarations(node);\n            var seenParentsWithEveryUnused = new ts.Set();\n            for (var _i = 0, typeParameters_3 = typeParameters; _i < typeParameters_3.length; _i++) {\n                var typeParameter = typeParameters_3[_i];\n                if (!isTypeParameterUnused(typeParameter))\n                    continue;\n                var name = ts.idText(typeParameter.name);\n                var parent = typeParameter.parent;\n                if (parent.kind !== 185 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) {\n                    if (ts.tryAddToSet(seenParentsWithEveryUnused, parent)) {\n                        var sourceFile = ts.getSourceFileOfNode(parent);\n                        var range = ts.isJSDocTemplateTag(parent)\n                            // Whole @template tag\n                            ? ts.rangeOfNode(parent)\n                            // Include the `<>` in the error message\n                            : ts.rangeOfTypeParameters(sourceFile, parent.typeParameters);\n                        var only = parent.typeParameters.length === 1;\n                        var message = only ? ts.Diagnostics._0_is_declared_but_its_value_is_never_read : ts.Diagnostics.All_type_parameters_are_unused;\n                        var arg0 = only ? name : undefined;\n                        addDiagnostic(typeParameter, 1 /* Parameter */, ts.createFileDiagnostic(sourceFile, range.pos, range.end - range.pos, message, arg0));\n                    }\n                }\n                else {\n                    addDiagnostic(typeParameter, 1 /* Parameter */, ts.createDiagnosticForNode(typeParameter, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name));\n                }\n            }\n        }\n        function isTypeParameterUnused(typeParameter) {\n            return !(getMergedSymbol(typeParameter.symbol).isReferenced & 262144 /* TypeParameter */) && !isIdentifierThatStartsWithUnderscore(typeParameter.name);\n        }\n        function addToGroup(map, key, value, getKey) {\n            var keyString = String(getKey(key));\n            var group = map.get(keyString);\n            if (group) {\n                group[1].push(value);\n            }\n            else {\n                map.set(keyString, [key, [value]]);\n            }\n        }\n        function tryGetRootParameterDeclaration(node) {\n            return ts.tryCast(ts.getRootDeclaration(node), ts.isParameter);\n        }\n        function isValidUnusedLocalDeclaration(declaration) {\n            if (ts.isBindingElement(declaration)) {\n                if (ts.isObjectBindingPattern(declaration.parent)) {\n                    /**\n                     * ignore starts with underscore names _\n                     * const { a: _a } = { a: 1 }\n                     */\n                    return !!(declaration.propertyName && isIdentifierThatStartsWithUnderscore(declaration.name));\n                }\n                return isIdentifierThatStartsWithUnderscore(declaration.name);\n            }\n            return ts.isAmbientModule(declaration) ||\n                (ts.isVariableDeclaration(declaration) && ts.isForInOrOfStatement(declaration.parent.parent) || isImportedDeclaration(declaration)) && isIdentifierThatStartsWithUnderscore(declaration.name);\n        }\n        function checkUnusedLocalsAndParameters(nodeWithLocals, addDiagnostic) {\n            // Ideally we could use the ImportClause directly as a key, but must wait until we have full ES6 maps. So must store key along with value.\n            var unusedImports = new ts.Map();\n            var unusedDestructures = new ts.Map();\n            var unusedVariables = new ts.Map();\n            nodeWithLocals.locals.forEach(function (local) {\n                // If it's purely a type parameter, ignore, will be checked in `checkUnusedTypeParameters`.\n                // If it's a type parameter merged with a parameter, check if the parameter-side is used.\n                if (local.flags & 262144 /* TypeParameter */ ? !(local.flags & 3 /* Variable */ && !(local.isReferenced & 3 /* Variable */)) : local.isReferenced || local.exportSymbol) {\n                    return;\n                }\n                for (var _i = 0, _a = local.declarations; _i < _a.length; _i++) {\n                    var declaration = _a[_i];\n                    if (isValidUnusedLocalDeclaration(declaration)) {\n                        continue;\n                    }\n                    if (isImportedDeclaration(declaration)) {\n                        addToGroup(unusedImports, importClauseFromImported(declaration), declaration, getNodeId);\n                    }\n                    else if (ts.isBindingElement(declaration) && ts.isObjectBindingPattern(declaration.parent)) {\n                        // In `{ a, ...b }, `a` is considered used since it removes a property from `b`. `b` may still be unused though.\n                        var lastElement = ts.last(declaration.parent.elements);\n                        if (declaration === lastElement || !ts.last(declaration.parent.elements).dotDotDotToken) {\n                            addToGroup(unusedDestructures, declaration.parent, declaration, getNodeId);\n                        }\n                    }\n                    else if (ts.isVariableDeclaration(declaration)) {\n                        addToGroup(unusedVariables, declaration.parent, declaration, getNodeId);\n                    }\n                    else {\n                        var parameter = local.valueDeclaration && tryGetRootParameterDeclaration(local.valueDeclaration);\n                        var name = local.valueDeclaration && ts.getNameOfDeclaration(local.valueDeclaration);\n                        if (parameter && name) {\n                            if (!ts.isParameterPropertyDeclaration(parameter, parameter.parent) && !ts.parameterIsThisKeyword(parameter) && !isIdentifierThatStartsWithUnderscore(name)) {\n                                if (ts.isBindingElement(declaration) && ts.isArrayBindingPattern(declaration.parent)) {\n                                    addToGroup(unusedDestructures, declaration.parent, declaration, getNodeId);\n                                }\n                                else {\n                                    addDiagnostic(parameter, 1 /* Parameter */, ts.createDiagnosticForNode(name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.symbolName(local)));\n                                }\n                            }\n                        }\n                        else {\n                            errorUnusedLocal(declaration, ts.symbolName(local), addDiagnostic);\n                        }\n                    }\n                }\n            });\n            unusedImports.forEach(function (_a) {\n                var importClause = _a[0], unuseds = _a[1];\n                var importDecl = importClause.parent;\n                var nDeclarations = (importClause.name ? 1 : 0) +\n                    (importClause.namedBindings ?\n                        (importClause.namedBindings.kind === 263 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length)\n                        : 0);\n                if (nDeclarations === unuseds.length) {\n                    addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1\n                        ? ts.createDiagnosticForNode(importDecl, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.first(unuseds).name))\n                        : ts.createDiagnosticForNode(importDecl, ts.Diagnostics.All_imports_in_import_declaration_are_unused));\n                }\n                else {\n                    for (var _i = 0, unuseds_1 = unuseds; _i < unuseds_1.length; _i++) {\n                        var unused = unuseds_1[_i];\n                        errorUnusedLocal(unused, ts.idText(unused.name), addDiagnostic);\n                    }\n                }\n            });\n            unusedDestructures.forEach(function (_a) {\n                var bindingPattern = _a[0], bindingElements = _a[1];\n                var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */;\n                if (bindingPattern.elements.length === bindingElements.length) {\n                    if (bindingElements.length === 1 && bindingPattern.parent.kind === 249 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 250 /* VariableDeclarationList */) {\n                        addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId);\n                    }\n                    else {\n                        addDiagnostic(bindingPattern, kind, bindingElements.length === 1\n                            ? ts.createDiagnosticForNode(bindingPattern, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(bindingElements).name))\n                            : ts.createDiagnosticForNode(bindingPattern, ts.Diagnostics.All_destructured_elements_are_unused));\n                    }\n                }\n                else {\n                    for (var _i = 0, bindingElements_1 = bindingElements; _i < bindingElements_1.length; _i++) {\n                        var e = bindingElements_1[_i];\n                        addDiagnostic(e, kind, ts.createDiagnosticForNode(e, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(e.name)));\n                    }\n                }\n            });\n            unusedVariables.forEach(function (_a) {\n                var declarationList = _a[0], declarations = _a[1];\n                if (declarationList.declarations.length === declarations.length) {\n                    addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1\n                        ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name))\n                        : ts.createDiagnosticForNode(declarationList.parent.kind === 232 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused));\n                }\n                else {\n                    for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {\n                        var decl = declarations_5[_i];\n                        addDiagnostic(decl, 0 /* Local */, ts.createDiagnosticForNode(decl, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(decl.name)));\n                    }\n                }\n            });\n        }\n        function bindingNameText(name) {\n            switch (name.kind) {\n                case 78 /* Identifier */:\n                    return ts.idText(name);\n                case 197 /* ArrayBindingPattern */:\n                case 196 /* ObjectBindingPattern */:\n                    return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name);\n                default:\n                    return ts.Debug.assertNever(name);\n            }\n        }\n        function isImportedDeclaration(node) {\n            return node.kind === 262 /* ImportClause */ || node.kind === 265 /* ImportSpecifier */ || node.kind === 263 /* NamespaceImport */;\n        }\n        function importClauseFromImported(decl) {\n            return decl.kind === 262 /* ImportClause */ ? decl : decl.kind === 263 /* NamespaceImport */ ? decl.parent : decl.parent.parent;\n        }\n        function checkBlock(node) {\n            // Grammar checking for SyntaxKind.Block\n            if (node.kind === 230 /* Block */) {\n                checkGrammarStatementInAmbientContext(node);\n            }\n            if (ts.isFunctionOrModuleBlock(node)) {\n                var saveFlowAnalysisDisabled = flowAnalysisDisabled;\n                ts.forEach(node.statements, checkSourceElement);\n                flowAnalysisDisabled = saveFlowAnalysisDisabled;\n            }\n            else {\n                ts.forEach(node.statements, checkSourceElement);\n            }\n            if (node.locals) {\n                registerForUnusedIdentifiersCheck(node);\n            }\n        }\n        function checkCollisionWithArgumentsInGeneratedCode(node) {\n            // no rest parameters \\ declaration context \\ overload - no codegen impact\n            if (languageVersion >= 2 /* ES2015 */ || !ts.hasRestParameter(node) || node.flags & 8388608 /* Ambient */ || ts.nodeIsMissing(node.body)) {\n                return;\n            }\n            ts.forEach(node.parameters, function (p) {\n                if (p.name && !ts.isBindingPattern(p.name) && p.name.escapedText === argumentsSymbol.escapedName) {\n                    errorSkippedOn(\"noEmit\", p, ts.Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters);\n                }\n            });\n        }\n        function needCollisionCheckForIdentifier(node, identifier, name) {\n            if (!(identifier && identifier.escapedText === name)) {\n                return false;\n            }\n            if (node.kind === 163 /* PropertyDeclaration */ ||\n                node.kind === 162 /* PropertySignature */ ||\n                node.kind === 165 /* MethodDeclaration */ ||\n                node.kind === 164 /* MethodSignature */ ||\n                node.kind === 167 /* GetAccessor */ ||\n                node.kind === 168 /* SetAccessor */) {\n                // it is ok to have member named '_super' or '_this' - member access is always qualified\n                return false;\n            }\n            if (node.flags & 8388608 /* Ambient */) {\n                // ambient context - no codegen impact\n                return false;\n            }\n            var root = ts.getRootDeclaration(node);\n            if (root.kind === 160 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) {\n                // just an overload - no codegen impact\n                return false;\n            }\n            return true;\n        }\n        // this function will run after checking the source file so 'CaptureThis' is correct for all nodes\n        function checkIfThisIsCapturedInEnclosingScope(node) {\n            ts.findAncestor(node, function (current) {\n                if (getNodeCheckFlags(current) & 4 /* CaptureThis */) {\n                    var isDeclaration_1 = node.kind !== 78 /* Identifier */;\n                    if (isDeclaration_1) {\n                        error(ts.getNameOfDeclaration(node), ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference);\n                    }\n                    else {\n                        error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference);\n                    }\n                    return true;\n                }\n                return false;\n            });\n        }\n        function checkIfNewTargetIsCapturedInEnclosingScope(node) {\n            ts.findAncestor(node, function (current) {\n                if (getNodeCheckFlags(current) & 8 /* CaptureNewTarget */) {\n                    var isDeclaration_2 = node.kind !== 78 /* Identifier */;\n                    if (isDeclaration_2) {\n                        error(ts.getNameOfDeclaration(node), ts.Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference);\n                    }\n                    else {\n                        error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference);\n                    }\n                    return true;\n                }\n                return false;\n            });\n        }\n        function checkWeakMapCollision(node) {\n            var enclosingBlockScope = ts.getEnclosingBlockScopeContainer(node);\n            if (getNodeCheckFlags(enclosingBlockScope) & 67108864 /* ContainsClassWithPrivateIdentifiers */) {\n                errorSkippedOn(\"noEmit\", node, ts.Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, \"WeakMap\");\n            }\n        }\n        function checkCollisionWithRequireExportsInGeneratedCode(node, name) {\n            // No need to check for require or exports for ES6 modules and later\n            if (moduleKind >= ts.ModuleKind.ES2015) {\n                return;\n            }\n            if (!needCollisionCheckForIdentifier(node, name, \"require\") && !needCollisionCheckForIdentifier(node, name, \"exports\")) {\n                return;\n            }\n            // Uninstantiated modules shouldnt do this check\n            if (ts.isModuleDeclaration(node) && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) {\n                return;\n            }\n            // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent\n            var parent = getDeclarationContainer(node);\n            if (parent.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) {\n                // If the declaration happens to be in external module, report error that require and exports are reserved keywords\n                errorSkippedOn(\"noEmit\", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name));\n            }\n        }\n        function checkCollisionWithGlobalPromiseInGeneratedCode(node, name) {\n            if (languageVersion >= 4 /* ES2017 */ || !needCollisionCheckForIdentifier(node, name, \"Promise\")) {\n                return;\n            }\n            // Uninstantiated modules shouldnt do this check\n            if (ts.isModuleDeclaration(node) && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) {\n                return;\n            }\n            // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent\n            var parent = getDeclarationContainer(node);\n            if (parent.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) {\n                // If the declaration happens to be in external module, report error that Promise is a reserved identifier.\n                errorSkippedOn(\"noEmit\", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name));\n            }\n        }\n        function checkVarDeclaredNamesNotShadowed(node) {\n            // - ScriptBody : StatementList\n            // It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList\n            // also occurs in the VarDeclaredNames of StatementList.\n            // - Block : { StatementList }\n            // It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList\n            // also occurs in the VarDeclaredNames of StatementList.\n            // Variable declarations are hoisted to the top of their function scope. They can shadow\n            // block scoped declarations, which bind tighter. this will not be flagged as duplicate definition\n            // by the binder as the declaration scope is different.\n            // A non-initialized declaration is a no-op as the block declaration will resolve before the var\n            // declaration. the problem is if the declaration has an initializer. this will act as a write to the\n            // block declared value. this is fine for let, but not const.\n            // Only consider declarations with initializers, uninitialized const declarations will not\n            // step on a let/const variable.\n            // Do not consider const and const declarations, as duplicate block-scoped declarations\n            // are handled by the binder.\n            // We are only looking for const declarations that step on let\\const declarations from a\n            // different scope. e.g.:\n            //      {\n            //          const x = 0; // localDeclarationSymbol obtained after name resolution will correspond to this declaration\n            //          const x = 0; // symbol for this declaration will be 'symbol'\n            //      }\n            // skip block-scoped variables and parameters\n            if ((ts.getCombinedNodeFlags(node) & 3 /* BlockScoped */) !== 0 || ts.isParameterDeclaration(node)) {\n                return;\n            }\n            // skip variable declarations that don't have initializers\n            // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern\n            // so we'll always treat binding elements as initialized\n            if (node.kind === 249 /* VariableDeclaration */ && !node.initializer) {\n                return;\n            }\n            var symbol = getSymbolOfNode(node);\n            if (symbol.flags & 1 /* FunctionScopedVariable */) {\n                if (!ts.isIdentifier(node.name))\n                    return ts.Debug.fail();\n                var localDeclarationSymbol = resolveName(node, node.name.escapedText, 3 /* Variable */, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false);\n                if (localDeclarationSymbol &&\n                    localDeclarationSymbol !== symbol &&\n                    localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) {\n                    if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) {\n                        var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 250 /* VariableDeclarationList */);\n                        var container = varDeclList.parent.kind === 232 /* VariableStatement */ && varDeclList.parent.parent\n                            ? varDeclList.parent.parent\n                            : undefined;\n                        // names of block-scoped and function scoped variables can collide only\n                        // if block scoped variable is defined in the function\\module\\source file scope (because of variable hoisting)\n                        var namesShareScope = container &&\n                            (container.kind === 230 /* Block */ && ts.isFunctionLike(container.parent) ||\n                                container.kind === 257 /* ModuleBlock */ ||\n                                container.kind === 256 /* ModuleDeclaration */ ||\n                                container.kind === 297 /* SourceFile */);\n                        // here we know that function scoped variable is shadowed by block scoped one\n                        // if they are defined in the same scope - binder has already reported redeclaration error\n                        // otherwise if variable has an initializer - show error that initialization will fail\n                        // since LHS will be block scoped name instead of function scoped\n                        if (!namesShareScope) {\n                            var name = symbolToString(localDeclarationSymbol);\n                            error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name);\n                        }\n                    }\n                }\n            }\n        }\n        function convertAutoToAny(type) {\n            return type === autoType ? anyType : type === autoArrayType ? anyArrayType : type;\n        }\n        // Check variable, parameter, or property declaration\n        function checkVariableLikeDeclaration(node) {\n            var _a;\n            checkDecorators(node);\n            if (!ts.isBindingElement(node)) {\n                checkSourceElement(node.type);\n            }\n            // JSDoc `function(string, string): string` syntax results in parameters with no name\n            if (!node.name) {\n                return;\n            }\n            // For a computed property, just check the initializer and exit\n            // Do not use hasDynamicName here, because that returns false for well known symbols.\n            // We want to perform checkComputedPropertyName for all computed properties, including\n            // well known symbols.\n            if (node.name.kind === 158 /* ComputedPropertyName */) {\n                checkComputedPropertyName(node.name);\n                if (node.initializer) {\n                    checkExpressionCached(node.initializer);\n                }\n            }\n            if (node.kind === 198 /* BindingElement */) {\n                if (node.parent.kind === 196 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) {\n                    checkExternalEmitHelpers(node, 4 /* Rest */);\n                }\n                // check computed properties inside property names of binding elements\n                if (node.propertyName && node.propertyName.kind === 158 /* ComputedPropertyName */) {\n                    checkComputedPropertyName(node.propertyName);\n                }\n                // check private/protected variable access\n                var parent = node.parent.parent;\n                var parentType = getTypeForBindingElementParent(parent);\n                var name = node.propertyName || node.name;\n                if (parentType && !ts.isBindingPattern(name)) {\n                    var exprType = getLiteralTypeFromPropertyName(name);\n                    if (isTypeUsableAsPropertyName(exprType)) {\n                        var nameText = getPropertyNameFromType(exprType);\n                        var property = getPropertyOfType(parentType, nameText);\n                        if (property) {\n                            markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference.\n                            checkPropertyAccessibility(parent, !!parent.initializer && parent.initializer.kind === 105 /* SuperKeyword */, parentType, property);\n                        }\n                    }\n                }\n            }\n            // For a binding pattern, check contained binding elements\n            if (ts.isBindingPattern(node.name)) {\n                if (node.name.kind === 197 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) {\n                    checkExternalEmitHelpers(node, 512 /* Read */);\n                }\n                ts.forEach(node.name.elements, checkSourceElement);\n            }\n            // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body\n            if (node.initializer && ts.isParameterDeclaration(node) && ts.nodeIsMissing(ts.getContainingFunction(node).body)) {\n                error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation);\n                return;\n            }\n            // For a binding pattern, validate the initializer and exit\n            if (ts.isBindingPattern(node.name)) {\n                var needCheckInitializer = node.initializer && node.parent.parent.kind !== 238 /* ForInStatement */;\n                var needCheckWidenedType = node.name.elements.length === 0;\n                if (needCheckInitializer || needCheckWidenedType) {\n                    // Don't validate for-in initializer as it is already an error\n                    var widenedType = getWidenedTypeForVariableLikeDeclaration(node);\n                    if (needCheckInitializer) {\n                        var initializerType = checkExpressionCached(node.initializer);\n                        if (strictNullChecks && needCheckWidenedType) {\n                            checkNonNullNonVoidType(initializerType, node);\n                        }\n                        else {\n                            checkTypeAssignableToAndOptionallyElaborate(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer);\n                        }\n                    }\n                    // check the binding pattern with empty elements\n                    if (needCheckWidenedType) {\n                        if (ts.isArrayBindingPattern(node.name)) {\n                            checkIteratedTypeOrElementType(65 /* Destructuring */, widenedType, undefinedType, node);\n                        }\n                        else if (strictNullChecks) {\n                            checkNonNullNonVoidType(widenedType, node);\n                        }\n                    }\n                }\n                return;\n            }\n            // For a commonjs `const x = require`, validate the alias and exit\n            var symbol = getSymbolOfNode(node);\n            if (symbol.flags & 2097152 /* Alias */ && ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true)) {\n                checkAliasSymbol(node);\n                return;\n            }\n            var type = convertAutoToAny(getTypeOfSymbol(symbol));\n            if (node === symbol.valueDeclaration) {\n                // Node is the primary declaration of the symbol, just validate the initializer\n                // Don't validate for-in initializer as it is already an error\n                var initializer = ts.getEffectiveInitializer(node);\n                if (initializer) {\n                    var isJSObjectLiteralInitializer = ts.isInJSFile(node) &&\n                        ts.isObjectLiteralExpression(initializer) &&\n                        (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) &&\n                        !!((_a = symbol.exports) === null || _a === void 0 ? void 0 : _a.size);\n                    if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 238 /* ForInStatement */) {\n                        checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined);\n                    }\n                }\n                if (symbol.declarations.length > 1) {\n                    if (ts.some(symbol.declarations, function (d) { return d !== node && ts.isVariableLike(d) && !areDeclarationFlagsIdentical(d, node); })) {\n                        error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));\n                    }\n                }\n            }\n            else {\n                // Node is a secondary declaration, check that type is identical to primary declaration and check that\n                // initializer is consistent with type associated with the node\n                var declarationType = convertAutoToAny(getWidenedTypeForVariableLikeDeclaration(node));\n                if (type !== errorType && declarationType !== errorType &&\n                    !isTypeIdenticalTo(type, declarationType) &&\n                    !(symbol.flags & 67108864 /* Assignment */)) {\n                    errorNextVariableOrPropertyDeclarationMustHaveSameType(symbol.valueDeclaration, type, node, declarationType);\n                }\n                if (node.initializer) {\n                    checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(node.initializer), declarationType, node, node.initializer, /*headMessage*/ undefined);\n                }\n                if (!areDeclarationFlagsIdentical(node, symbol.valueDeclaration)) {\n                    error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));\n                }\n            }\n            if (node.kind !== 163 /* PropertyDeclaration */ && node.kind !== 162 /* PropertySignature */) {\n                // We know we don't have a binding pattern or computed name here\n                checkExportsOnMergedDeclarations(node);\n                if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) {\n                    checkVarDeclaredNamesNotShadowed(node);\n                }\n                checkCollisionWithRequireExportsInGeneratedCode(node, node.name);\n                checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);\n                if (languageVersion < 99 /* ESNext */ && needCollisionCheckForIdentifier(node, node.name, \"WeakMap\")) {\n                    potentialWeakMapCollisions.push(node);\n                }\n            }\n        }\n        function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) {\n            var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration);\n            var message = nextDeclaration.kind === 163 /* PropertyDeclaration */ || nextDeclaration.kind === 162 /* PropertySignature */\n                ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2\n                : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2;\n            var declName = ts.declarationNameToString(nextDeclarationName);\n            var err = error(nextDeclarationName, message, declName, typeToString(firstType), typeToString(nextType));\n            if (firstDeclaration) {\n                ts.addRelatedInfo(err, ts.createDiagnosticForNode(firstDeclaration, ts.Diagnostics._0_was_also_declared_here, declName));\n            }\n        }\n        function areDeclarationFlagsIdentical(left, right) {\n            if ((left.kind === 160 /* Parameter */ && right.kind === 249 /* VariableDeclaration */) ||\n                (left.kind === 249 /* VariableDeclaration */ && right.kind === 160 /* Parameter */)) {\n                // Differences in optionality between parameters and variables are allowed.\n                return true;\n            }\n            if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) {\n                return false;\n            }\n            var interestingFlags = 8 /* Private */ |\n                16 /* Protected */ |\n                256 /* Async */ |\n                128 /* Abstract */ |\n                64 /* Readonly */ |\n                32 /* Static */;\n            return ts.getSelectedEffectiveModifierFlags(left, interestingFlags) === ts.getSelectedEffectiveModifierFlags(right, interestingFlags);\n        }\n        function checkVariableDeclaration(node) {\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"check\" /* Check */, \"checkVariableDeclaration\", { kind: node.kind, pos: node.pos, end: node.end });\n            checkGrammarVariableDeclaration(node);\n            checkVariableLikeDeclaration(node);\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n        }\n        function checkBindingElement(node) {\n            checkGrammarBindingElement(node);\n            return checkVariableLikeDeclaration(node);\n        }\n        function checkVariableStatement(node) {\n            // Grammar checking\n            if (!checkGrammarDecoratorsAndModifiers(node) && !checkGrammarVariableDeclarationList(node.declarationList))\n                checkGrammarForDisallowedLetOrConstStatement(node);\n            ts.forEach(node.declarationList.declarations, checkSourceElement);\n        }\n        function checkExpressionStatement(node) {\n            // Grammar checking\n            checkGrammarStatementInAmbientContext(node);\n            checkExpression(node.expression);\n        }\n        function checkIfStatement(node) {\n            // Grammar checking\n            checkGrammarStatementInAmbientContext(node);\n            var type = checkTruthinessExpression(node.expression);\n            checkTestingKnownTruthyCallableType(node.expression, type, node.thenStatement);\n            checkSourceElement(node.thenStatement);\n            if (node.thenStatement.kind === 231 /* EmptyStatement */) {\n                error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);\n            }\n            checkSourceElement(node.elseStatement);\n        }\n        function checkTestingKnownTruthyCallableType(condExpr, type, body) {\n            if (!strictNullChecks) {\n                return;\n            }\n            var location = ts.isBinaryExpression(condExpr) ? condExpr.right : condExpr;\n            var testedNode = ts.isIdentifier(location) ? location\n                : ts.isPropertyAccessExpression(location) ? location.name\n                    : ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right\n                        : undefined;\n            var isPropertyExpressionCast = ts.isPropertyAccessExpression(location)\n                && ts.isAssertionExpression(ts.skipParentheses(location.expression));\n            if (!testedNode || isPropertyExpressionCast) {\n                return;\n            }\n            var possiblyFalsy = getFalsyFlags(type);\n            if (possiblyFalsy) {\n                return;\n            }\n            // While it technically should be invalid for any known-truthy value\n            // to be tested, we de-scope to functions unrefenced in the block as a\n            // heuristic to identify the most common bugs. There are too many\n            // false positives for values sourced from type definitions without\n            // strictNullChecks otherwise.\n            var callSignatures = getSignaturesOfType(type, 0 /* Call */);\n            if (callSignatures.length === 0) {\n                return;\n            }\n            var testedSymbol = getSymbolAtLocation(testedNode);\n            if (!testedSymbol) {\n                return;\n            }\n            var isUsed = ts.isBinaryExpression(condExpr.parent) && isFunctionUsedInBinaryExpressionChain(condExpr.parent, testedSymbol)\n                || body && isFunctionUsedInConditionBody(condExpr, body, testedNode, testedSymbol);\n            if (!isUsed) {\n                error(location, ts.Diagnostics.This_condition_will_always_return_true_since_the_function_is_always_defined_Did_you_mean_to_call_it_instead);\n            }\n        }\n        function isFunctionUsedInConditionBody(expr, body, testedNode, testedSymbol) {\n            return !!ts.forEachChild(body, function check(childNode) {\n                if (ts.isIdentifier(childNode)) {\n                    var childSymbol = getSymbolAtLocation(childNode);\n                    if (childSymbol && childSymbol === testedSymbol) {\n                        // If the test was a simple identifier, the above check is sufficient\n                        if (ts.isIdentifier(expr)) {\n                            return true;\n                        }\n                        // Otherwise we need to ensure the symbol is called on the same target\n                        var testedExpression = testedNode.parent;\n                        var childExpression = childNode.parent;\n                        while (testedExpression && childExpression) {\n                            if (ts.isIdentifier(testedExpression) && ts.isIdentifier(childExpression) ||\n                                testedExpression.kind === 107 /* ThisKeyword */ && childExpression.kind === 107 /* ThisKeyword */) {\n                                return getSymbolAtLocation(testedExpression) === getSymbolAtLocation(childExpression);\n                            }\n                            else if (ts.isPropertyAccessExpression(testedExpression) && ts.isPropertyAccessExpression(childExpression)) {\n                                if (getSymbolAtLocation(testedExpression.name) !== getSymbolAtLocation(childExpression.name)) {\n                                    return false;\n                                }\n                                childExpression = childExpression.expression;\n                                testedExpression = testedExpression.expression;\n                            }\n                            else if (ts.isCallExpression(testedExpression) && ts.isCallExpression(childExpression)) {\n                                childExpression = childExpression.expression;\n                                testedExpression = testedExpression.expression;\n                            }\n                            else {\n                                return false;\n                            }\n                        }\n                    }\n                }\n                return ts.forEachChild(childNode, check);\n            });\n        }\n        function isFunctionUsedInBinaryExpressionChain(node, testedSymbol) {\n            while (ts.isBinaryExpression(node) && node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) {\n                var isUsed = ts.forEachChild(node.right, function visit(child) {\n                    if (ts.isIdentifier(child)) {\n                        var symbol = getSymbolAtLocation(child);\n                        if (symbol && symbol === testedSymbol) {\n                            return true;\n                        }\n                    }\n                    return ts.forEachChild(child, visit);\n                });\n                if (isUsed) {\n                    return true;\n                }\n                node = node.parent;\n            }\n            return false;\n        }\n        function checkDoStatement(node) {\n            // Grammar checking\n            checkGrammarStatementInAmbientContext(node);\n            checkSourceElement(node.statement);\n            checkTruthinessExpression(node.expression);\n        }\n        function checkWhileStatement(node) {\n            // Grammar checking\n            checkGrammarStatementInAmbientContext(node);\n            checkTruthinessExpression(node.expression);\n            checkSourceElement(node.statement);\n        }\n        function checkTruthinessOfType(type, node) {\n            if (type.flags & 16384 /* Void */) {\n                error(node, ts.Diagnostics.An_expression_of_type_void_cannot_be_tested_for_truthiness);\n            }\n            return type;\n        }\n        function checkTruthinessExpression(node, checkMode) {\n            return checkTruthinessOfType(checkExpression(node, checkMode), node);\n        }\n        function checkForStatement(node) {\n            // Grammar checking\n            if (!checkGrammarStatementInAmbientContext(node)) {\n                if (node.initializer && node.initializer.kind === 250 /* VariableDeclarationList */) {\n                    checkGrammarVariableDeclarationList(node.initializer);\n                }\n            }\n            if (node.initializer) {\n                if (node.initializer.kind === 250 /* VariableDeclarationList */) {\n                    ts.forEach(node.initializer.declarations, checkVariableDeclaration);\n                }\n                else {\n                    checkExpression(node.initializer);\n                }\n            }\n            if (node.condition)\n                checkTruthinessExpression(node.condition);\n            if (node.incrementor)\n                checkExpression(node.incrementor);\n            checkSourceElement(node.statement);\n            if (node.locals) {\n                registerForUnusedIdentifiersCheck(node);\n            }\n        }\n        function checkForOfStatement(node) {\n            checkGrammarForInOrForOfStatement(node);\n            if (node.awaitModifier) {\n                var functionFlags = ts.getFunctionFlags(ts.getContainingFunction(node));\n                if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 99 /* ESNext */) {\n                    // for..await..of in an async function or async generator function prior to ESNext requires the __asyncValues helper\n                    checkExternalEmitHelpers(node, 16384 /* ForAwaitOfIncludes */);\n                }\n            }\n            else if (compilerOptions.downlevelIteration && languageVersion < 2 /* ES2015 */) {\n                // for..of prior to ES2015 requires the __values helper when downlevelIteration is enabled\n                checkExternalEmitHelpers(node, 256 /* ForOfIncludes */);\n            }\n            // Check the LHS and RHS\n            // If the LHS is a declaration, just check it as a variable declaration, which will in turn check the RHS\n            // via checkRightHandSideOfForOf.\n            // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference.\n            // Then check that the RHS is assignable to it.\n            if (node.initializer.kind === 250 /* VariableDeclarationList */) {\n                checkForInOrForOfVariableDeclaration(node);\n            }\n            else {\n                var varExpr = node.initializer;\n                var iteratedType = checkRightHandSideOfForOf(node);\n                // There may be a destructuring assignment on the left side\n                if (varExpr.kind === 199 /* ArrayLiteralExpression */ || varExpr.kind === 200 /* ObjectLiteralExpression */) {\n                    // iteratedType may be undefined. In this case, we still want to check the structure of\n                    // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like\n                    // to short circuit the type relation checking as much as possible, so we pass the unknownType.\n                    checkDestructuringAssignment(varExpr, iteratedType || errorType);\n                }\n                else {\n                    var leftType = checkExpression(varExpr);\n                    checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access, ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access);\n                    // iteratedType will be undefined if the rightType was missing properties/signatures\n                    // required to get its iteratedType (like [Symbol.iterator] or next). This may be\n                    // because we accessed properties from anyType, or it may have led to an error inside\n                    // getElementTypeOfIterable.\n                    if (iteratedType) {\n                        checkTypeAssignableToAndOptionallyElaborate(iteratedType, leftType, varExpr, node.expression);\n                    }\n                }\n            }\n            checkSourceElement(node.statement);\n            if (node.locals) {\n                registerForUnusedIdentifiersCheck(node);\n            }\n        }\n        function checkForInStatement(node) {\n            // Grammar checking\n            checkGrammarForInOrForOfStatement(node);\n            var rightType = getNonNullableTypeIfNeeded(checkExpression(node.expression));\n            // TypeScript 1.0 spec (April 2014): 5.4\n            // In a 'for-in' statement of the form\n            // for (let VarDecl in Expr) Statement\n            //   VarDecl must be a variable declaration without a type annotation that declares a variable of type Any,\n            //   and Expr must be an expression of type Any, an object type, or a type parameter type.\n            if (node.initializer.kind === 250 /* VariableDeclarationList */) {\n                var variable = node.initializer.declarations[0];\n                if (variable && ts.isBindingPattern(variable.name)) {\n                    error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);\n                }\n                checkForInOrForOfVariableDeclaration(node);\n            }\n            else {\n                // In a 'for-in' statement of the form\n                // for (Var in Expr) Statement\n                //   Var must be an expression classified as a reference of type Any or the String primitive type,\n                //   and Expr must be an expression of type Any, an object type, or a type parameter type.\n                var varExpr = node.initializer;\n                var leftType = checkExpression(varExpr);\n                if (varExpr.kind === 199 /* ArrayLiteralExpression */ || varExpr.kind === 200 /* ObjectLiteralExpression */) {\n                    error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);\n                }\n                else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) {\n                    error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any);\n                }\n                else {\n                    // run check only former check succeeded to avoid cascading errors\n                    checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access);\n                }\n            }\n            // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved\n            // in this case error about missing name is already reported - do not report extra one\n            if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) {\n                error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType));\n            }\n            checkSourceElement(node.statement);\n            if (node.locals) {\n                registerForUnusedIdentifiersCheck(node);\n            }\n        }\n        function checkForInOrForOfVariableDeclaration(iterationStatement) {\n            var variableDeclarationList = iterationStatement.initializer;\n            // checkGrammarForInOrForOfStatement will check that there is exactly one declaration.\n            if (variableDeclarationList.declarations.length >= 1) {\n                var decl = variableDeclarationList.declarations[0];\n                checkVariableDeclaration(decl);\n            }\n        }\n        function checkRightHandSideOfForOf(statement) {\n            var use = statement.awaitModifier ? 15 /* ForAwaitOf */ : 13 /* ForOf */;\n            return checkIteratedTypeOrElementType(use, checkNonNullExpression(statement.expression), undefinedType, statement.expression);\n        }\n        function checkIteratedTypeOrElementType(use, inputType, sentType, errorNode) {\n            if (isTypeAny(inputType)) {\n                return inputType;\n            }\n            return getIteratedTypeOrElementType(use, inputType, sentType, errorNode, /*checkAssignability*/ true) || anyType;\n        }\n        /**\n         * When consuming an iterable type in a for..of, spread, or iterator destructuring assignment\n         * we want to get the iterated type of an iterable for ES2015 or later, or the iterated type\n         * of a iterable (if defined globally) or element type of an array like for ES2015 or earlier.\n         */\n        function getIteratedTypeOrElementType(use, inputType, sentType, errorNode, checkAssignability) {\n            var allowAsyncIterables = (use & 2 /* AllowsAsyncIterablesFlag */) !== 0;\n            if (inputType === neverType) {\n                reportTypeNotIterableError(errorNode, inputType, allowAsyncIterables); // TODO: GH#18217\n                return undefined;\n            }\n            var uplevelIteration = languageVersion >= 2 /* ES2015 */;\n            var downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration;\n            var possibleOutOfBounds = compilerOptions.noUncheckedIndexedAccess && !!(use & 128 /* PossiblyOutOfBounds */);\n            // Get the iterated type of an `Iterable<T>` or `IterableIterator<T>` only in ES2015\n            // or higher, when inside of an async generator or for-await-if, or when\n            // downlevelIteration is requested.\n            if (uplevelIteration || downlevelIteration || allowAsyncIterables) {\n                // We only report errors for an invalid iterable type in ES2015 or higher.\n                var iterationTypes = getIterationTypesOfIterable(inputType, use, uplevelIteration ? errorNode : undefined);\n                if (checkAssignability) {\n                    if (iterationTypes) {\n                        var diagnostic = use & 8 /* ForOfFlag */ ? ts.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0 :\n                            use & 32 /* SpreadFlag */ ? ts.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0 :\n                                use & 64 /* DestructuringFlag */ ? ts.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0 :\n                                    use & 16 /* YieldStarFlag */ ? ts.Diagnostics.Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0 :\n                                        undefined;\n                        if (diagnostic) {\n                            checkTypeAssignableTo(sentType, iterationTypes.nextType, errorNode, diagnostic);\n                        }\n                    }\n                }\n                if (iterationTypes || uplevelIteration) {\n                    return possibleOutOfBounds ? includeUndefinedInIndexSignature(iterationTypes && iterationTypes.yieldType) : (iterationTypes && iterationTypes.yieldType);\n                }\n            }\n            var arrayType = inputType;\n            var reportedError = false;\n            var hasStringConstituent = false;\n            // If strings are permitted, remove any string-like constituents from the array type.\n            // This allows us to find other non-string element types from an array unioned with\n            // a string.\n            if (use & 4 /* AllowsStringInputFlag */) {\n                if (arrayType.flags & 1048576 /* Union */) {\n                    // After we remove all types that are StringLike, we will know if there was a string constituent\n                    // based on whether the result of filter is a new array.\n                    var arrayTypes = inputType.types;\n                    var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 402653316 /* StringLike */); });\n                    if (filteredTypes !== arrayTypes) {\n                        arrayType = getUnionType(filteredTypes, 2 /* Subtype */);\n                    }\n                }\n                else if (arrayType.flags & 402653316 /* StringLike */) {\n                    arrayType = neverType;\n                }\n                hasStringConstituent = arrayType !== inputType;\n                if (hasStringConstituent) {\n                    if (languageVersion < 1 /* ES5 */) {\n                        if (errorNode) {\n                            error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher);\n                            reportedError = true;\n                        }\n                    }\n                    // Now that we've removed all the StringLike types, if no constituents remain, then the entire\n                    // arrayOrStringType was a string.\n                    if (arrayType.flags & 131072 /* Never */) {\n                        return possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType;\n                    }\n                }\n            }\n            if (!isArrayLikeType(arrayType)) {\n                if (errorNode && !reportedError) {\n                    // Which error we report depends on whether we allow strings or if there was a\n                    // string constituent. For example, if the input type is number | string, we\n                    // want to say that number is not an array type. But if the input was just\n                    // number and string input is allowed, we want to say that number is not an\n                    // array type or a string type.\n                    var yieldType = getIterationTypeOfIterable(use, 0 /* Yield */, inputType, /*errorNode*/ undefined);\n                    var _a = !(use & 4 /* AllowsStringInputFlag */) || hasStringConstituent\n                        ? downlevelIteration\n                            ? [ts.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true]\n                            : yieldType\n                                ? [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators, false]\n                                : [ts.Diagnostics.Type_0_is_not_an_array_type, true]\n                        : downlevelIteration\n                            ? [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true]\n                            : yieldType\n                                ? [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators, false]\n                                : [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, true], defaultDiagnostic = _a[0], maybeMissingAwait = _a[1];\n                    errorAndMaybeSuggestAwait(errorNode, maybeMissingAwait && !!getAwaitedTypeOfPromise(arrayType), defaultDiagnostic, typeToString(arrayType));\n                }\n                return hasStringConstituent ? possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType : undefined;\n            }\n            var arrayElementType = getIndexTypeOfType(arrayType, 1 /* Number */);\n            if (hasStringConstituent && arrayElementType) {\n                // This is just an optimization for the case where arrayOrStringType is string | string[]\n                if (arrayElementType.flags & 402653316 /* StringLike */ && !compilerOptions.noUncheckedIndexedAccess) {\n                    return stringType;\n                }\n                return getUnionType(possibleOutOfBounds ? [arrayElementType, stringType, undefinedType] : [arrayElementType, stringType], 2 /* Subtype */);\n            }\n            return (use & 128 /* PossiblyOutOfBounds */) ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType;\n        }\n        /**\n         * Gets the requested \"iteration type\" from an `Iterable`-like or `AsyncIterable`-like type.\n         */\n        function getIterationTypeOfIterable(use, typeKind, inputType, errorNode) {\n            if (isTypeAny(inputType)) {\n                return undefined;\n            }\n            var iterationTypes = getIterationTypesOfIterable(inputType, use, errorNode);\n            return iterationTypes && iterationTypes[getIterationTypesKeyFromIterationTypeKind(typeKind)];\n        }\n        function createIterationTypes(yieldType, returnType, nextType) {\n            // `yieldType` and `returnType` are defaulted to `neverType` they each will be combined\n            // via `getUnionType` when merging iteration types. `nextType` is defined as `unknownType`\n            // as it is combined via `getIntersectionType` when merging iteration types.\n            if (yieldType === void 0) { yieldType = neverType; }\n            if (returnType === void 0) { returnType = neverType; }\n            if (nextType === void 0) { nextType = unknownType; }\n            // Use the cache only for intrinsic types to keep it small as they are likely to be\n            // more frequently created (i.e. `Iterator<number, void, unknown>`). Iteration types\n            // are also cached on the type they are requested for, so we shouldn't need to maintain\n            // the cache for less-frequently used types.\n            if (yieldType.flags & 67359327 /* Intrinsic */ &&\n                returnType.flags & (1 /* Any */ | 131072 /* Never */ | 2 /* Unknown */ | 16384 /* Void */ | 32768 /* Undefined */) &&\n                nextType.flags & (1 /* Any */ | 131072 /* Never */ | 2 /* Unknown */ | 16384 /* Void */ | 32768 /* Undefined */)) {\n                var id = getTypeListId([yieldType, returnType, nextType]);\n                var iterationTypes = iterationTypesCache.get(id);\n                if (!iterationTypes) {\n                    iterationTypes = { yieldType: yieldType, returnType: returnType, nextType: nextType };\n                    iterationTypesCache.set(id, iterationTypes);\n                }\n                return iterationTypes;\n            }\n            return { yieldType: yieldType, returnType: returnType, nextType: nextType };\n        }\n        /**\n         * Combines multiple `IterationTypes` records.\n         *\n         * If `array` is empty or all elements are missing or are references to `noIterationTypes`,\n         * then `noIterationTypes` is returned. Otherwise, an `IterationTypes` record is returned\n         * for the combined iteration types.\n         */\n        function combineIterationTypes(array) {\n            var yieldTypes;\n            var returnTypes;\n            var nextTypes;\n            for (var _i = 0, array_10 = array; _i < array_10.length; _i++) {\n                var iterationTypes = array_10[_i];\n                if (iterationTypes === undefined || iterationTypes === noIterationTypes) {\n                    continue;\n                }\n                if (iterationTypes === anyIterationTypes) {\n                    return anyIterationTypes;\n                }\n                yieldTypes = ts.append(yieldTypes, iterationTypes.yieldType);\n                returnTypes = ts.append(returnTypes, iterationTypes.returnType);\n                nextTypes = ts.append(nextTypes, iterationTypes.nextType);\n            }\n            if (yieldTypes || returnTypes || nextTypes) {\n                return createIterationTypes(yieldTypes && getUnionType(yieldTypes), returnTypes && getUnionType(returnTypes), nextTypes && getIntersectionType(nextTypes));\n            }\n            return noIterationTypes;\n        }\n        function getCachedIterationTypes(type, cacheKey) {\n            return type[cacheKey];\n        }\n        function setCachedIterationTypes(type, cacheKey, cachedTypes) {\n            return type[cacheKey] = cachedTypes;\n        }\n        /**\n         * Gets the *yield*, *return*, and *next* types from an `Iterable`-like or `AsyncIterable`-like type.\n         *\n         * At every level that involves analyzing return types of signatures, we union the return types of all the signatures.\n         *\n         * Another thing to note is that at any step of this process, we could run into a dead end,\n         * meaning either the property is missing, or we run into the anyType. If either of these things\n         * happens, we return `undefined` to signal that we could not find the iteration type. If a property\n         * is missing, and the previous step did not result in `any`, then we also give an error if the\n         * caller requested it. Then the caller can decide what to do in the case where there is no iterated\n         * type.\n         *\n         * For a **for-of** statement, `yield*` (in a normal generator), spread, array\n         * destructuring, or normal generator we will only ever look for a `[Symbol.iterator]()`\n         * method.\n         *\n         * For an async generator we will only ever look at the `[Symbol.asyncIterator]()` method.\n         *\n         * For a **for-await-of** statement or a `yield*` in an async generator we will look for\n         * the `[Symbol.asyncIterator]()` method first, and then the `[Symbol.iterator]()` method.\n         */\n        function getIterationTypesOfIterable(type, use, errorNode) {\n            if (isTypeAny(type)) {\n                return anyIterationTypes;\n            }\n            if (!(type.flags & 1048576 /* Union */)) {\n                var iterationTypes_1 = getIterationTypesOfIterableWorker(type, use, errorNode);\n                if (iterationTypes_1 === noIterationTypes) {\n                    if (errorNode) {\n                        reportTypeNotIterableError(errorNode, type, !!(use & 2 /* AllowsAsyncIterablesFlag */));\n                    }\n                    return undefined;\n                }\n                return iterationTypes_1;\n            }\n            var cacheKey = use & 2 /* AllowsAsyncIterablesFlag */ ? \"iterationTypesOfAsyncIterable\" : \"iterationTypesOfIterable\";\n            var cachedTypes = getCachedIterationTypes(type, cacheKey);\n            if (cachedTypes)\n                return cachedTypes === noIterationTypes ? undefined : cachedTypes;\n            var allIterationTypes;\n            for (var _i = 0, _a = type.types; _i < _a.length; _i++) {\n                var constituent = _a[_i];\n                var iterationTypes_2 = getIterationTypesOfIterableWorker(constituent, use, errorNode);\n                if (iterationTypes_2 === noIterationTypes) {\n                    if (errorNode) {\n                        reportTypeNotIterableError(errorNode, type, !!(use & 2 /* AllowsAsyncIterablesFlag */));\n                    }\n                    setCachedIterationTypes(type, cacheKey, noIterationTypes);\n                    return undefined;\n                }\n                else {\n                    allIterationTypes = ts.append(allIterationTypes, iterationTypes_2);\n                }\n            }\n            var iterationTypes = allIterationTypes ? combineIterationTypes(allIterationTypes) : noIterationTypes;\n            setCachedIterationTypes(type, cacheKey, iterationTypes);\n            return iterationTypes === noIterationTypes ? undefined : iterationTypes;\n        }\n        function getAsyncFromSyncIterationTypes(iterationTypes, errorNode) {\n            if (iterationTypes === noIterationTypes)\n                return noIterationTypes;\n            if (iterationTypes === anyIterationTypes)\n                return anyIterationTypes;\n            var yieldType = iterationTypes.yieldType, returnType = iterationTypes.returnType, nextType = iterationTypes.nextType;\n            return createIterationTypes(getAwaitedType(yieldType, errorNode) || anyType, getAwaitedType(returnType, errorNode) || anyType, nextType);\n        }\n        /**\n         * Gets the *yield*, *return*, and *next* types from a non-union type.\n         *\n         * If we are unable to find the *yield*, *return*, and *next* types, `noIterationTypes` is\n         * returned to indicate to the caller that it should report an error. Otherwise, an\n         * `IterationTypes` record is returned.\n         *\n         * NOTE: You probably don't want to call this directly and should be calling\n         * `getIterationTypesOfIterable` instead.\n         */\n        function getIterationTypesOfIterableWorker(type, use, errorNode) {\n            if (isTypeAny(type)) {\n                return anyIterationTypes;\n            }\n            if (use & 2 /* AllowsAsyncIterablesFlag */) {\n                var iterationTypes = getIterationTypesOfIterableCached(type, asyncIterationTypesResolver) ||\n                    getIterationTypesOfIterableFast(type, asyncIterationTypesResolver);\n                if (iterationTypes) {\n                    return iterationTypes;\n                }\n            }\n            if (use & 1 /* AllowsSyncIterablesFlag */) {\n                var iterationTypes = getIterationTypesOfIterableCached(type, syncIterationTypesResolver) ||\n                    getIterationTypesOfIterableFast(type, syncIterationTypesResolver);\n                if (iterationTypes) {\n                    if (use & 2 /* AllowsAsyncIterablesFlag */) {\n                        // for a sync iterable in an async context, only use the cached types if they are valid.\n                        if (iterationTypes !== noIterationTypes) {\n                            return setCachedIterationTypes(type, \"iterationTypesOfAsyncIterable\", getAsyncFromSyncIterationTypes(iterationTypes, errorNode));\n                        }\n                    }\n                    else {\n                        return iterationTypes;\n                    }\n                }\n            }\n            if (use & 2 /* AllowsAsyncIterablesFlag */) {\n                var iterationTypes = getIterationTypesOfIterableSlow(type, asyncIterationTypesResolver, errorNode);\n                if (iterationTypes !== noIterationTypes) {\n                    return iterationTypes;\n                }\n            }\n            if (use & 1 /* AllowsSyncIterablesFlag */) {\n                var iterationTypes = getIterationTypesOfIterableSlow(type, syncIterationTypesResolver, errorNode);\n                if (iterationTypes !== noIterationTypes) {\n                    if (use & 2 /* AllowsAsyncIterablesFlag */) {\n                        return setCachedIterationTypes(type, \"iterationTypesOfAsyncIterable\", iterationTypes\n                            ? getAsyncFromSyncIterationTypes(iterationTypes, errorNode)\n                            : noIterationTypes);\n                    }\n                    else {\n                        return iterationTypes;\n                    }\n                }\n            }\n            return noIterationTypes;\n        }\n        /**\n         * Gets the *yield*, *return*, and *next* types of an `Iterable`-like or\n         * `AsyncIterable`-like type from the cache.\n         *\n         * NOTE: You probably don't want to call this directly and should be calling\n         * `getIterationTypesOfIterable` instead.\n         */\n        function getIterationTypesOfIterableCached(type, resolver) {\n            return getCachedIterationTypes(type, resolver.iterableCacheKey);\n        }\n        function getIterationTypesOfGlobalIterableType(globalType, resolver) {\n            var globalIterationTypes = getIterationTypesOfIterableCached(globalType, resolver) ||\n                getIterationTypesOfIterableSlow(globalType, resolver, /*errorNode*/ undefined);\n            return globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes;\n        }\n        /**\n         * Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like\n         * type from from common heuristics.\n         *\n         * If we previously analyzed this type and found no iteration types, `noIterationTypes` is\n         * returned. If we found iteration types, an `IterationTypes` record is returned.\n         * Otherwise, we return `undefined` to indicate to the caller it should perform a more\n         * exhaustive analysis.\n         *\n         * NOTE: You probably don't want to call this directly and should be calling\n         * `getIterationTypesOfIterable` instead.\n         */\n        function getIterationTypesOfIterableFast(type, resolver) {\n            // As an optimization, if the type is an instantiation of one of the following global types, then\n            // just grab its related type argument:\n            // - `Iterable<T>` or `AsyncIterable<T>`\n            // - `IterableIterator<T>` or `AsyncIterableIterator<T>`\n            var globalType;\n            if (isReferenceToType(type, globalType = resolver.getGlobalIterableType(/*reportErrors*/ false)) ||\n                isReferenceToType(type, globalType = resolver.getGlobalIterableIteratorType(/*reportErrors*/ false))) {\n                var yieldType = getTypeArguments(type)[0];\n                // The \"return\" and \"next\" types of `Iterable` and `IterableIterator` are defined by the\n                // iteration types of their `[Symbol.iterator]()` method. The same is true for their async cousins.\n                // While we define these as `any` and `undefined` in our libs by default, a custom lib *could* use\n                // different definitions.\n                var _a = getIterationTypesOfGlobalIterableType(globalType, resolver), returnType = _a.returnType, nextType = _a.nextType;\n                return setCachedIterationTypes(type, resolver.iterableCacheKey, createIterationTypes(yieldType, returnType, nextType));\n            }\n            // As an optimization, if the type is an instantiation of the following global type, then\n            // just grab its related type arguments:\n            // - `Generator<T, TReturn, TNext>` or `AsyncGenerator<T, TReturn, TNext>`\n            if (isReferenceToType(type, resolver.getGlobalGeneratorType(/*reportErrors*/ false))) {\n                var _b = getTypeArguments(type), yieldType = _b[0], returnType = _b[1], nextType = _b[2];\n                return setCachedIterationTypes(type, resolver.iterableCacheKey, createIterationTypes(yieldType, returnType, nextType));\n            }\n        }\n        /**\n         * Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like\n         * type from its members.\n         *\n         * If we successfully found the *yield*, *return*, and *next* types, an `IterationTypes`\n         * record is returned. Otherwise, `noIterationTypes` is returned.\n         *\n         * NOTE: You probably don't want to call this directly and should be calling\n         * `getIterationTypesOfIterable` instead.\n         */\n        function getIterationTypesOfIterableSlow(type, resolver, errorNode) {\n            var _a;\n            var method = getPropertyOfType(type, ts.getPropertyNameForKnownSymbolName(resolver.iteratorSymbolName));\n            var methodType = method && !(method.flags & 16777216 /* Optional */) ? getTypeOfSymbol(method) : undefined;\n            if (isTypeAny(methodType)) {\n                return setCachedIterationTypes(type, resolver.iterableCacheKey, anyIterationTypes);\n            }\n            var signatures = methodType ? getSignaturesOfType(methodType, 0 /* Call */) : undefined;\n            if (!ts.some(signatures)) {\n                return setCachedIterationTypes(type, resolver.iterableCacheKey, noIterationTypes);\n            }\n            var iteratorType = getIntersectionType(ts.map(signatures, getReturnTypeOfSignature));\n            var iterationTypes = (_a = getIterationTypesOfIterator(iteratorType, resolver, errorNode)) !== null && _a !== void 0 ? _a : noIterationTypes;\n            return setCachedIterationTypes(type, resolver.iterableCacheKey, iterationTypes);\n        }\n        function reportTypeNotIterableError(errorNode, type, allowAsyncIterables) {\n            var message = allowAsyncIterables\n                ? ts.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator\n                : ts.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator;\n            errorAndMaybeSuggestAwait(errorNode, !!getAwaitedTypeOfPromise(type), message, typeToString(type));\n        }\n        /**\n         * Gets the *yield*, *return*, and *next* types from an `Iterator`-like or `AsyncIterator`-like type.\n         *\n         * If we successfully found the *yield*, *return*, and *next* types, an `IterationTypes`\n         * record is returned. Otherwise, `undefined` is returned.\n         */\n        function getIterationTypesOfIterator(type, resolver, errorNode) {\n            if (isTypeAny(type)) {\n                return anyIterationTypes;\n            }\n            var iterationTypes = getIterationTypesOfIteratorCached(type, resolver) ||\n                getIterationTypesOfIteratorFast(type, resolver) ||\n                getIterationTypesOfIteratorSlow(type, resolver, errorNode);\n            return iterationTypes === noIterationTypes ? undefined : iterationTypes;\n        }\n        /**\n         * Gets the iteration types of an `Iterator`-like or `AsyncIterator`-like type from the\n         * cache.\n         *\n         * NOTE: You probably don't want to call this directly and should be calling\n         * `getIterationTypesOfIterator` instead.\n         */\n        function getIterationTypesOfIteratorCached(type, resolver) {\n            return getCachedIterationTypes(type, resolver.iteratorCacheKey);\n        }\n        /**\n         * Gets the iteration types of an `Iterator`-like or `AsyncIterator`-like type from the\n         * cache or from common heuristics.\n         *\n         * If we previously analyzed this type and found no iteration types, `noIterationTypes` is\n         * returned. If we found iteration types, an `IterationTypes` record is returned.\n         * Otherwise, we return `undefined` to indicate to the caller it should perform a more\n         * exhaustive analysis.\n         *\n         * NOTE: You probably don't want to call this directly and should be calling\n         * `getIterationTypesOfIterator` instead.\n         */\n        function getIterationTypesOfIteratorFast(type, resolver) {\n            // As an optimization, if the type is an instantiation of one of the following global types,\n            // then just grab its related type argument:\n            // - `IterableIterator<T>` or `AsyncIterableIterator<T>`\n            // - `Iterator<T, TReturn, TNext>` or `AsyncIterator<T, TReturn, TNext>`\n            // - `Generator<T, TReturn, TNext>` or `AsyncGenerator<T, TReturn, TNext>`\n            var globalType = resolver.getGlobalIterableIteratorType(/*reportErrors*/ false);\n            if (isReferenceToType(type, globalType)) {\n                var yieldType = getTypeArguments(type)[0];\n                // The \"return\" and \"next\" types of `IterableIterator` and `AsyncIterableIterator` are defined by the\n                // iteration types of their `next`, `return`, and `throw` methods. While we define these as `any`\n                // and `undefined` in our libs by default, a custom lib *could* use different definitions.\n                var globalIterationTypes = getIterationTypesOfIteratorCached(globalType, resolver) ||\n                    getIterationTypesOfIteratorSlow(globalType, resolver, /*errorNode*/ undefined);\n                var _a = globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes, returnType = _a.returnType, nextType = _a.nextType;\n                return setCachedIterationTypes(type, resolver.iteratorCacheKey, createIterationTypes(yieldType, returnType, nextType));\n            }\n            if (isReferenceToType(type, resolver.getGlobalIteratorType(/*reportErrors*/ false)) ||\n                isReferenceToType(type, resolver.getGlobalGeneratorType(/*reportErrors*/ false))) {\n                var _b = getTypeArguments(type), yieldType = _b[0], returnType = _b[1], nextType = _b[2];\n                return setCachedIterationTypes(type, resolver.iteratorCacheKey, createIterationTypes(yieldType, returnType, nextType));\n            }\n        }\n        function isIteratorResult(type, kind) {\n            // From https://tc39.github.io/ecma262/#sec-iteratorresult-interface:\n            // > [done] is the result status of an iterator `next` method call. If the end of the iterator was reached `done` is `true`.\n            // > If the end was not reached `done` is `false` and a value is available.\n            // > If a `done` property (either own or inherited) does not exist, it is consider to have the value `false`.\n            var doneType = getTypeOfPropertyOfType(type, \"done\") || falseType;\n            return isTypeAssignableTo(kind === 0 /* Yield */ ? falseType : trueType, doneType);\n        }\n        function isYieldIteratorResult(type) {\n            return isIteratorResult(type, 0 /* Yield */);\n        }\n        function isReturnIteratorResult(type) {\n            return isIteratorResult(type, 1 /* Return */);\n        }\n        /**\n         * Gets the *yield* and *return* types of an `IteratorResult`-like type.\n         *\n         * If we are unable to determine a *yield* or a *return* type, `noIterationTypes` is\n         * returned to indicate to the caller that it should handle the error. Otherwise, an\n         * `IterationTypes` record is returned.\n         */\n        function getIterationTypesOfIteratorResult(type) {\n            if (isTypeAny(type)) {\n                return anyIterationTypes;\n            }\n            var cachedTypes = getCachedIterationTypes(type, \"iterationTypesOfIteratorResult\");\n            if (cachedTypes) {\n                return cachedTypes;\n            }\n            // As an optimization, if the type is an instantiation of one of the global `IteratorYieldResult<T>`\n            // or `IteratorReturnResult<TReturn>` types, then just grab its type argument.\n            if (isReferenceToType(type, getGlobalIteratorYieldResultType(/*reportErrors*/ false))) {\n                var yieldType_1 = getTypeArguments(type)[0];\n                return setCachedIterationTypes(type, \"iterationTypesOfIteratorResult\", createIterationTypes(yieldType_1, /*returnType*/ undefined, /*nextType*/ undefined));\n            }\n            if (isReferenceToType(type, getGlobalIteratorReturnResultType(/*reportErrors*/ false))) {\n                var returnType_1 = getTypeArguments(type)[0];\n                return setCachedIterationTypes(type, \"iterationTypesOfIteratorResult\", createIterationTypes(/*yieldType*/ undefined, returnType_1, /*nextType*/ undefined));\n            }\n            // Choose any constituents that can produce the requested iteration type.\n            var yieldIteratorResult = filterType(type, isYieldIteratorResult);\n            var yieldType = yieldIteratorResult !== neverType ? getTypeOfPropertyOfType(yieldIteratorResult, \"value\") : undefined;\n            var returnIteratorResult = filterType(type, isReturnIteratorResult);\n            var returnType = returnIteratorResult !== neverType ? getTypeOfPropertyOfType(returnIteratorResult, \"value\") : undefined;\n            if (!yieldType && !returnType) {\n                return setCachedIterationTypes(type, \"iterationTypesOfIteratorResult\", noIterationTypes);\n            }\n            // From https://tc39.github.io/ecma262/#sec-iteratorresult-interface\n            // > ... If the iterator does not have a return value, `value` is `undefined`. In that case, the\n            // > `value` property may be absent from the conforming object if it does not inherit an explicit\n            // > `value` property.\n            return setCachedIterationTypes(type, \"iterationTypesOfIteratorResult\", createIterationTypes(yieldType, returnType || voidType, /*nextType*/ undefined));\n        }\n        /**\n         * Gets the *yield*, *return*, and *next* types of a the `next()`, `return()`, or\n         * `throw()` method of an `Iterator`-like or `AsyncIterator`-like type.\n         *\n         * If we successfully found the *yield*, *return*, and *next* types, an `IterationTypes`\n         * record is returned. Otherwise, we return `undefined`.\n         */\n        function getIterationTypesOfMethod(type, resolver, methodName, errorNode) {\n            var _a, _b, _c, _d;\n            var method = getPropertyOfType(type, methodName);\n            // Ignore 'return' or 'throw' if they are missing.\n            if (!method && methodName !== \"next\") {\n                return undefined;\n            }\n            var methodType = method && !(methodName === \"next\" && (method.flags & 16777216 /* Optional */))\n                ? methodName === \"next\" ? getTypeOfSymbol(method) : getTypeWithFacts(getTypeOfSymbol(method), 2097152 /* NEUndefinedOrNull */)\n                : undefined;\n            if (isTypeAny(methodType)) {\n                // `return()` and `throw()` don't provide a *next* type.\n                return methodName === \"next\" ? anyIterationTypes : anyIterationTypesExceptNext;\n            }\n            // Both async and non-async iterators *must* have a `next` method.\n            var methodSignatures = methodType ? getSignaturesOfType(methodType, 0 /* Call */) : ts.emptyArray;\n            if (methodSignatures.length === 0) {\n                if (errorNode) {\n                    var diagnostic = methodName === \"next\"\n                        ? resolver.mustHaveANextMethodDiagnostic\n                        : resolver.mustBeAMethodDiagnostic;\n                    error(errorNode, diagnostic, methodName);\n                }\n                return methodName === \"next\" ? anyIterationTypes : undefined;\n            }\n            // If the method signature comes exclusively from the global iterator or generator type,\n            // create iteration types from its type arguments like `getIterationTypesOfIteratorFast`\n            // does (so as to remove `undefined` from the next and return types). We arrive here when\n            // a contextual type for a generator was not a direct reference to one of those global types,\n            // but looking up `methodType` referred to one of them (and nothing else). E.g., in\n            // `interface SpecialIterator extends Iterator<number> {}`, `SpecialIterator` is not a\n            // reference to `Iterator`, but its `next` member derives exclusively from `Iterator`.\n            if ((methodType === null || methodType === void 0 ? void 0 : methodType.symbol) && methodSignatures.length === 1) {\n                var globalGeneratorType = resolver.getGlobalGeneratorType(/*reportErrors*/ false);\n                var globalIteratorType = resolver.getGlobalIteratorType(/*reportErrors*/ false);\n                var isGeneratorMethod = ((_b = (_a = globalGeneratorType.symbol) === null || _a === void 0 ? void 0 : _a.members) === null || _b === void 0 ? void 0 : _b.get(methodName)) === methodType.symbol;\n                var isIteratorMethod = !isGeneratorMethod && ((_d = (_c = globalIteratorType.symbol) === null || _c === void 0 ? void 0 : _c.members) === null || _d === void 0 ? void 0 : _d.get(methodName)) === methodType.symbol;\n                if (isGeneratorMethod || isIteratorMethod) {\n                    var globalType = isGeneratorMethod ? globalGeneratorType : globalIteratorType;\n                    var mapper = methodType.mapper;\n                    return createIterationTypes(getMappedType(globalType.typeParameters[0], mapper), getMappedType(globalType.typeParameters[1], mapper), methodName === \"next\" ? getMappedType(globalType.typeParameters[2], mapper) : undefined);\n                }\n            }\n            // Extract the first parameter and return type of each signature.\n            var methodParameterTypes;\n            var methodReturnTypes;\n            for (var _i = 0, methodSignatures_1 = methodSignatures; _i < methodSignatures_1.length; _i++) {\n                var signature = methodSignatures_1[_i];\n                if (methodName !== \"throw\" && ts.some(signature.parameters)) {\n                    methodParameterTypes = ts.append(methodParameterTypes, getTypeAtPosition(signature, 0));\n                }\n                methodReturnTypes = ts.append(methodReturnTypes, getReturnTypeOfSignature(signature));\n            }\n            // Resolve the *next* or *return* type from the first parameter of a `next()` or\n            // `return()` method, respectively.\n            var returnTypes;\n            var nextType;\n            if (methodName !== \"throw\") {\n                var methodParameterType = methodParameterTypes ? getUnionType(methodParameterTypes) : unknownType;\n                if (methodName === \"next\") {\n                    // The value of `next(value)` is *not* awaited by async generators\n                    nextType = methodParameterType;\n                }\n                else if (methodName === \"return\") {\n                    // The value of `return(value)` *is* awaited by async generators\n                    var resolvedMethodParameterType = resolver.resolveIterationType(methodParameterType, errorNode) || anyType;\n                    returnTypes = ts.append(returnTypes, resolvedMethodParameterType);\n                }\n            }\n            // Resolve the *yield* and *return* types from the return type of the method (i.e. `IteratorResult`)\n            var yieldType;\n            var methodReturnType = methodReturnTypes ? getIntersectionType(methodReturnTypes) : neverType;\n            var resolvedMethodReturnType = resolver.resolveIterationType(methodReturnType, errorNode) || anyType;\n            var iterationTypes = getIterationTypesOfIteratorResult(resolvedMethodReturnType);\n            if (iterationTypes === noIterationTypes) {\n                if (errorNode) {\n                    error(errorNode, resolver.mustHaveAValueDiagnostic, methodName);\n                }\n                yieldType = anyType;\n                returnTypes = ts.append(returnTypes, anyType);\n            }\n            else {\n                yieldType = iterationTypes.yieldType;\n                returnTypes = ts.append(returnTypes, iterationTypes.returnType);\n            }\n            return createIterationTypes(yieldType, getUnionType(returnTypes), nextType);\n        }\n        /**\n         * Gets the *yield*, *return*, and *next* types of an `Iterator`-like or `AsyncIterator`-like\n         * type from its members.\n         *\n         * If we successfully found the *yield*, *return*, and *next* types, an `IterationTypes`\n         * record is returned. Otherwise, `noIterationTypes` is returned.\n         *\n         * NOTE: You probably don't want to call this directly and should be calling\n         * `getIterationTypesOfIterator` instead.\n         */\n        function getIterationTypesOfIteratorSlow(type, resolver, errorNode) {\n            var iterationTypes = combineIterationTypes([\n                getIterationTypesOfMethod(type, resolver, \"next\", errorNode),\n                getIterationTypesOfMethod(type, resolver, \"return\", errorNode),\n                getIterationTypesOfMethod(type, resolver, \"throw\", errorNode),\n            ]);\n            return setCachedIterationTypes(type, resolver.iteratorCacheKey, iterationTypes);\n        }\n        /**\n         * Gets the requested \"iteration type\" from a type that is either `Iterable`-like, `Iterator`-like,\n         * `IterableIterator`-like, or `Generator`-like (for a non-async generator); or `AsyncIterable`-like,\n         * `AsyncIterator`-like, `AsyncIterableIterator`-like, or `AsyncGenerator`-like (for an async generator).\n         */\n        function getIterationTypeOfGeneratorFunctionReturnType(kind, returnType, isAsyncGenerator) {\n            if (isTypeAny(returnType)) {\n                return undefined;\n            }\n            var iterationTypes = getIterationTypesOfGeneratorFunctionReturnType(returnType, isAsyncGenerator);\n            return iterationTypes && iterationTypes[getIterationTypesKeyFromIterationTypeKind(kind)];\n        }\n        function getIterationTypesOfGeneratorFunctionReturnType(type, isAsyncGenerator) {\n            if (isTypeAny(type)) {\n                return anyIterationTypes;\n            }\n            var use = isAsyncGenerator ? 2 /* AsyncGeneratorReturnType */ : 1 /* GeneratorReturnType */;\n            var resolver = isAsyncGenerator ? asyncIterationTypesResolver : syncIterationTypesResolver;\n            return getIterationTypesOfIterable(type, use, /*errorNode*/ undefined) ||\n                getIterationTypesOfIterator(type, resolver, /*errorNode*/ undefined);\n        }\n        function checkBreakOrContinueStatement(node) {\n            // Grammar checking\n            if (!checkGrammarStatementInAmbientContext(node))\n                checkGrammarBreakOrContinueStatement(node);\n            // TODO: Check that target label is valid\n        }\n        function unwrapReturnType(returnType, functionFlags) {\n            var _a, _b;\n            var isGenerator = !!(functionFlags & 1 /* Generator */);\n            var isAsync = !!(functionFlags & 2 /* Async */);\n            return isGenerator ? (_a = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, isAsync)) !== null && _a !== void 0 ? _a : errorType :\n                isAsync ? (_b = getAwaitedType(returnType)) !== null && _b !== void 0 ? _b : errorType :\n                    returnType;\n        }\n        function isUnwrappedReturnTypeVoidOrAny(func, returnType) {\n            var unwrappedReturnType = unwrapReturnType(returnType, ts.getFunctionFlags(func));\n            return !!unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 16384 /* Void */ | 3 /* AnyOrUnknown */);\n        }\n        function checkReturnStatement(node) {\n            var _a;\n            // Grammar checking\n            if (checkGrammarStatementInAmbientContext(node)) {\n                return;\n            }\n            var func = ts.getContainingFunction(node);\n            if (!func) {\n                grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body);\n                return;\n            }\n            var signature = getSignatureFromDeclaration(func);\n            var returnType = getReturnTypeOfSignature(signature);\n            var functionFlags = ts.getFunctionFlags(func);\n            if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) {\n                var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType;\n                if (func.kind === 168 /* SetAccessor */) {\n                    if (node.expression) {\n                        error(node, ts.Diagnostics.Setters_cannot_return_a_value);\n                    }\n                }\n                else if (func.kind === 166 /* Constructor */) {\n                    if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) {\n                        error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);\n                    }\n                }\n                else if (getReturnTypeFromAnnotation(func)) {\n                    var unwrappedReturnType = (_a = unwrapReturnType(returnType, functionFlags)) !== null && _a !== void 0 ? _a : returnType;\n                    var unwrappedExprType = functionFlags & 2 /* Async */\n                        ? checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)\n                        : exprType;\n                    if (unwrappedReturnType) {\n                        // If the function has a return type, but promisedType is\n                        // undefined, an error will be reported in checkAsyncFunctionReturnType\n                        // so we don't need to report one here.\n                        checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, node, node.expression);\n                    }\n                }\n            }\n            else if (func.kind !== 166 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) {\n                // The function has a return type, but the return statement doesn't have an expression.\n                error(node, ts.Diagnostics.Not_all_code_paths_return_a_value);\n            }\n        }\n        function checkWithStatement(node) {\n            // Grammar checking for withStatement\n            if (!checkGrammarStatementInAmbientContext(node)) {\n                if (node.flags & 32768 /* AwaitContext */) {\n                    grammarErrorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_an_async_function_block);\n                }\n            }\n            checkExpression(node.expression);\n            var sourceFile = ts.getSourceFileOfNode(node);\n            if (!hasParseDiagnostics(sourceFile)) {\n                var start = ts.getSpanOfTokenAtPosition(sourceFile, node.pos).start;\n                var end = node.statement.pos;\n                grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any);\n            }\n        }\n        function checkSwitchStatement(node) {\n            // Grammar checking\n            checkGrammarStatementInAmbientContext(node);\n            var firstDefaultClause;\n            var hasDuplicateDefaultClause = false;\n            var expressionType = checkExpression(node.expression);\n            var expressionIsLiteral = isLiteralType(expressionType);\n            ts.forEach(node.caseBlock.clauses, function (clause) {\n                // Grammar check for duplicate default clauses, skip if we already report duplicate default clause\n                if (clause.kind === 285 /* DefaultClause */ && !hasDuplicateDefaultClause) {\n                    if (firstDefaultClause === undefined) {\n                        firstDefaultClause = clause;\n                    }\n                    else {\n                        grammarErrorOnNode(clause, ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement);\n                        hasDuplicateDefaultClause = true;\n                    }\n                }\n                if (produceDiagnostics && clause.kind === 284 /* CaseClause */) {\n                    // TypeScript 1.0 spec (April 2014): 5.9\n                    // In a 'switch' statement, each 'case' expression must be of a type that is comparable\n                    // to or from the type of the 'switch' expression.\n                    var caseType = checkExpression(clause.expression);\n                    var caseIsLiteral = isLiteralType(caseType);\n                    var comparedExpressionType = expressionType;\n                    if (!caseIsLiteral || !expressionIsLiteral) {\n                        caseType = caseIsLiteral ? getBaseTypeOfLiteralType(caseType) : caseType;\n                        comparedExpressionType = getBaseTypeOfLiteralType(expressionType);\n                    }\n                    if (!isTypeEqualityComparableTo(comparedExpressionType, caseType)) {\n                        // expressionType is not comparable to caseType, try the reversed check and report errors if it fails\n                        checkTypeComparableTo(caseType, comparedExpressionType, clause.expression, /*headMessage*/ undefined);\n                    }\n                }\n                ts.forEach(clause.statements, checkSourceElement);\n                if (compilerOptions.noFallthroughCasesInSwitch && clause.fallthroughFlowNode && isReachableFlowNode(clause.fallthroughFlowNode)) {\n                    error(clause, ts.Diagnostics.Fallthrough_case_in_switch);\n                }\n            });\n            if (node.caseBlock.locals) {\n                registerForUnusedIdentifiersCheck(node.caseBlock);\n            }\n        }\n        function checkLabeledStatement(node) {\n            // Grammar checking\n            if (!checkGrammarStatementInAmbientContext(node)) {\n                ts.findAncestor(node.parent, function (current) {\n                    if (ts.isFunctionLike(current)) {\n                        return \"quit\";\n                    }\n                    if (current.kind === 245 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) {\n                        grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label));\n                        return true;\n                    }\n                    return false;\n                });\n            }\n            // ensure that label is unique\n            checkSourceElement(node.statement);\n        }\n        function checkThrowStatement(node) {\n            // Grammar checking\n            if (!checkGrammarStatementInAmbientContext(node)) {\n                if (ts.isIdentifier(node.expression) && !node.expression.escapedText) {\n                    grammarErrorAfterFirstToken(node, ts.Diagnostics.Line_break_not_permitted_here);\n                }\n            }\n            if (node.expression) {\n                checkExpression(node.expression);\n            }\n        }\n        function checkTryStatement(node) {\n            // Grammar checking\n            checkGrammarStatementInAmbientContext(node);\n            checkBlock(node.tryBlock);\n            var catchClause = node.catchClause;\n            if (catchClause) {\n                // Grammar checking\n                if (catchClause.variableDeclaration) {\n                    var declaration = catchClause.variableDeclaration;\n                    if (declaration.type) {\n                        var type = getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ false);\n                        if (type && !(type.flags & 3 /* AnyOrUnknown */)) {\n                            grammarErrorOnFirstToken(declaration.type, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified);\n                        }\n                    }\n                    else if (declaration.initializer) {\n                        grammarErrorOnFirstToken(declaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer);\n                    }\n                    else {\n                        var blockLocals_1 = catchClause.block.locals;\n                        if (blockLocals_1) {\n                            ts.forEachKey(catchClause.locals, function (caughtName) {\n                                var blockLocal = blockLocals_1.get(caughtName);\n                                if (blockLocal && (blockLocal.flags & 2 /* BlockScopedVariable */) !== 0) {\n                                    grammarErrorOnNode(blockLocal.valueDeclaration, ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause, caughtName);\n                                }\n                            });\n                        }\n                    }\n                }\n                checkBlock(catchClause.block);\n            }\n            if (node.finallyBlock) {\n                checkBlock(node.finallyBlock);\n            }\n        }\n        function checkIndexConstraints(type) {\n            var declaredNumberIndexer = getIndexDeclarationOfSymbol(type.symbol, 1 /* Number */);\n            var declaredStringIndexer = getIndexDeclarationOfSymbol(type.symbol, 0 /* String */);\n            var stringIndexType = getIndexTypeOfType(type, 0 /* String */);\n            var numberIndexType = getIndexTypeOfType(type, 1 /* Number */);\n            if (stringIndexType || numberIndexType) {\n                ts.forEach(getPropertiesOfObjectType(type), function (prop) {\n                    var propType = getTypeOfSymbol(prop);\n                    checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0 /* String */);\n                    checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1 /* Number */);\n                });\n                var classDeclaration = type.symbol.valueDeclaration;\n                if (ts.getObjectFlags(type) & 1 /* Class */ && ts.isClassLike(classDeclaration)) {\n                    for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) {\n                        var member = _a[_i];\n                        // Only process instance properties with computed names here.\n                        // Static properties cannot be in conflict with indexers,\n                        // and properties with literal names were already checked.\n                        if (!ts.hasSyntacticModifier(member, 32 /* Static */) && !hasBindableName(member)) {\n                            var symbol = getSymbolOfNode(member);\n                            var propType = getTypeOfSymbol(symbol);\n                            checkIndexConstraintForProperty(symbol, propType, type, declaredStringIndexer, stringIndexType, 0 /* String */);\n                            checkIndexConstraintForProperty(symbol, propType, type, declaredNumberIndexer, numberIndexType, 1 /* Number */);\n                        }\n                    }\n                }\n            }\n            var errorNode;\n            if (stringIndexType && numberIndexType) {\n                errorNode = declaredNumberIndexer || declaredStringIndexer;\n                // condition 'errorNode === undefined' may appear if types does not declare nor string neither number indexer\n                if (!errorNode && (ts.getObjectFlags(type) & 2 /* Interface */)) {\n                    var someBaseTypeHasBothIndexers = ts.forEach(getBaseTypes(type), function (base) { return getIndexTypeOfType(base, 0 /* String */) && getIndexTypeOfType(base, 1 /* Number */); });\n                    errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0];\n                }\n            }\n            if (errorNode && !isTypeAssignableTo(numberIndexType, stringIndexType)) { // TODO: GH#18217\n                error(errorNode, ts.Diagnostics.Numeric_index_type_0_is_not_assignable_to_string_index_type_1, typeToString(numberIndexType), typeToString(stringIndexType));\n            }\n            function checkIndexConstraintForProperty(prop, propertyType, containingType, indexDeclaration, indexType, indexKind) {\n                // ESSymbol properties apply to neither string nor numeric indexers.\n                if (!indexType || ts.isKnownSymbol(prop)) {\n                    return;\n                }\n                var propDeclaration = prop.valueDeclaration;\n                var name = propDeclaration && ts.getNameOfDeclaration(propDeclaration);\n                if (name && ts.isPrivateIdentifier(name)) {\n                    return;\n                }\n                // index is numeric and property name is not valid numeric literal\n                if (indexKind === 1 /* Number */ && !(name ? isNumericName(name) : isNumericLiteralName(prop.escapedName))) {\n                    return;\n                }\n                // perform property check if property or indexer is declared in 'type'\n                // this allows us to rule out cases when both property and indexer are inherited from the base class\n                var errorNode;\n                if (propDeclaration && name &&\n                    (propDeclaration.kind === 216 /* BinaryExpression */ ||\n                        name.kind === 158 /* ComputedPropertyName */ ||\n                        prop.parent === containingType.symbol)) {\n                    errorNode = propDeclaration;\n                }\n                else if (indexDeclaration) {\n                    errorNode = indexDeclaration;\n                }\n                else if (ts.getObjectFlags(containingType) & 2 /* Interface */) {\n                    // for interfaces property and indexer might be inherited from different bases\n                    // check if any base class already has both property and indexer.\n                    // check should be performed only if 'type' is the first type that brings property\\indexer together\n                    var someBaseClassHasBothPropertyAndIndexer = ts.forEach(getBaseTypes(containingType), function (base) { return getPropertyOfObjectType(base, prop.escapedName) && getIndexTypeOfType(base, indexKind); });\n                    errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0];\n                }\n                if (errorNode && !isTypeAssignableTo(propertyType, indexType)) {\n                    var errorMessage = indexKind === 0 /* String */\n                        ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2\n                        : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2;\n                    error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType));\n                }\n            }\n        }\n        function checkTypeNameIsReserved(name, message) {\n            // TS 1.0 spec (April 2014): 3.6.1\n            // The predefined type keywords are reserved and cannot be used as names of user defined types.\n            switch (name.escapedText) {\n                case \"any\":\n                case \"unknown\":\n                case \"number\":\n                case \"bigint\":\n                case \"boolean\":\n                case \"string\":\n                case \"symbol\":\n                case \"void\":\n                case \"object\":\n                    error(name, message, name.escapedText);\n            }\n        }\n        /**\n         * The name cannot be used as 'Object' of user defined types with special target.\n         */\n        function checkClassNameCollisionWithObject(name) {\n            if (languageVersion === 1 /* ES5 */ && name.escapedText === \"Object\"\n                && moduleKind < ts.ModuleKind.ES2015) {\n                error(name, ts.Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ts.ModuleKind[moduleKind]); // https://github.com/Microsoft/TypeScript/issues/17494\n            }\n        }\n        /**\n         * Check each type parameter and check that type parameters have no duplicate type parameter declarations\n         */\n        function checkTypeParameters(typeParameterDeclarations) {\n            if (typeParameterDeclarations) {\n                var seenDefault = false;\n                for (var i = 0; i < typeParameterDeclarations.length; i++) {\n                    var node = typeParameterDeclarations[i];\n                    checkTypeParameter(node);\n                    if (produceDiagnostics) {\n                        if (node.default) {\n                            seenDefault = true;\n                            checkTypeParametersNotReferenced(node.default, typeParameterDeclarations, i);\n                        }\n                        else if (seenDefault) {\n                            error(node, ts.Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters);\n                        }\n                        for (var j = 0; j < i; j++) {\n                            if (typeParameterDeclarations[j].symbol === node.symbol) {\n                                error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.declarationNameToString(node.name));\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        /** Check that type parameter defaults only reference previously declared type parameters */\n        function checkTypeParametersNotReferenced(root, typeParameters, index) {\n            visit(root);\n            function visit(node) {\n                if (node.kind === 173 /* TypeReference */) {\n                    var type = getTypeFromTypeReference(node);\n                    if (type.flags & 262144 /* TypeParameter */) {\n                        for (var i = index; i < typeParameters.length; i++) {\n                            if (type.symbol === getSymbolOfNode(typeParameters[i])) {\n                                error(node, ts.Diagnostics.Type_parameter_defaults_can_only_reference_previously_declared_type_parameters);\n                            }\n                        }\n                    }\n                }\n                ts.forEachChild(node, visit);\n            }\n        }\n        /** Check that type parameter lists are identical across multiple declarations */\n        function checkTypeParameterListsIdentical(symbol) {\n            if (symbol.declarations.length === 1) {\n                return;\n            }\n            var links = getSymbolLinks(symbol);\n            if (!links.typeParametersChecked) {\n                links.typeParametersChecked = true;\n                var declarations = getClassOrInterfaceDeclarationsOfSymbol(symbol);\n                if (declarations.length <= 1) {\n                    return;\n                }\n                var type = getDeclaredTypeOfSymbol(symbol);\n                if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) {\n                    // Report an error on every conflicting declaration.\n                    var name = symbolToString(symbol);\n                    for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) {\n                        var declaration = declarations_6[_i];\n                        error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name);\n                    }\n                }\n            }\n        }\n        function areTypeParametersIdentical(declarations, targetParameters) {\n            var maxTypeArgumentCount = ts.length(targetParameters);\n            var minTypeArgumentCount = getMinTypeArgumentCount(targetParameters);\n            for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) {\n                var declaration = declarations_7[_i];\n                // If this declaration has too few or too many type parameters, we report an error\n                var sourceParameters = ts.getEffectiveTypeParameterDeclarations(declaration);\n                var numTypeParameters = sourceParameters.length;\n                if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) {\n                    return false;\n                }\n                for (var i = 0; i < numTypeParameters; i++) {\n                    var source = sourceParameters[i];\n                    var target = targetParameters[i];\n                    // If the type parameter node does not have the same as the resolved type\n                    // parameter at this position, we report an error.\n                    if (source.name.escapedText !== target.symbol.escapedName) {\n                        return false;\n                    }\n                    // If the type parameter node does not have an identical constraint as the resolved\n                    // type parameter at this position, we report an error.\n                    var constraint = ts.getEffectiveConstraintOfTypeParameter(source);\n                    var sourceConstraint = constraint && getTypeFromTypeNode(constraint);\n                    var targetConstraint = getConstraintOfTypeParameter(target);\n                    // relax check if later interface augmentation has no constraint, it's more broad and is OK to merge with\n                    // a more constrained interface (this could be generalized to a full hierarchy check, but that's maybe overkill)\n                    if (sourceConstraint && targetConstraint && !isTypeIdenticalTo(sourceConstraint, targetConstraint)) {\n                        return false;\n                    }\n                    // If the type parameter node has a default and it is not identical to the default\n                    // for the type parameter at this position, we report an error.\n                    var sourceDefault = source.default && getTypeFromTypeNode(source.default);\n                    var targetDefault = getDefaultFromTypeParameter(target);\n                    if (sourceDefault && targetDefault && !isTypeIdenticalTo(sourceDefault, targetDefault)) {\n                        return false;\n                    }\n                }\n            }\n            return true;\n        }\n        function checkClassExpression(node) {\n            checkClassLikeDeclaration(node);\n            checkNodeDeferred(node);\n            return getTypeOfSymbol(getSymbolOfNode(node));\n        }\n        function checkClassExpressionDeferred(node) {\n            ts.forEach(node.members, checkSourceElement);\n            registerForUnusedIdentifiersCheck(node);\n        }\n        function checkClassDeclaration(node) {\n            if (!node.name && !ts.hasSyntacticModifier(node, 512 /* Default */)) {\n                grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name);\n            }\n            checkClassLikeDeclaration(node);\n            ts.forEach(node.members, checkSourceElement);\n            registerForUnusedIdentifiersCheck(node);\n        }\n        function checkClassLikeDeclaration(node) {\n            checkGrammarClassLikeDeclaration(node);\n            checkDecorators(node);\n            if (node.name) {\n                checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0);\n                checkCollisionWithRequireExportsInGeneratedCode(node, node.name);\n                checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);\n                if (!(node.flags & 8388608 /* Ambient */)) {\n                    checkClassNameCollisionWithObject(node.name);\n                }\n            }\n            checkTypeParameters(ts.getEffectiveTypeParameterDeclarations(node));\n            checkExportsOnMergedDeclarations(node);\n            var symbol = getSymbolOfNode(node);\n            var type = getDeclaredTypeOfSymbol(symbol);\n            var typeWithThis = getTypeWithThisArgument(type);\n            var staticType = getTypeOfSymbol(symbol);\n            checkTypeParameterListsIdentical(symbol);\n            checkFunctionOrConstructorSymbol(symbol);\n            checkClassForDuplicateDeclarations(node);\n            // Only check for reserved static identifiers on non-ambient context.\n            if (!(node.flags & 8388608 /* Ambient */)) {\n                checkClassForStaticPropertyNameConflicts(node);\n            }\n            var baseTypeNode = ts.getEffectiveBaseTypeNode(node);\n            if (baseTypeNode) {\n                ts.forEach(baseTypeNode.typeArguments, checkSourceElement);\n                if (languageVersion < 2 /* ES2015 */) {\n                    checkExternalEmitHelpers(baseTypeNode.parent, 1 /* Extends */);\n                }\n                // check both @extends and extends if both are specified.\n                var extendsNode = ts.getClassExtendsHeritageElement(node);\n                if (extendsNode && extendsNode !== baseTypeNode) {\n                    checkExpression(extendsNode.expression);\n                }\n                var baseTypes = getBaseTypes(type);\n                if (baseTypes.length && produceDiagnostics) {\n                    var baseType_1 = baseTypes[0];\n                    var baseConstructorType = getBaseConstructorTypeOfClass(type);\n                    var staticBaseType = getApparentType(baseConstructorType);\n                    checkBaseTypeAccessibility(staticBaseType, baseTypeNode);\n                    checkSourceElement(baseTypeNode.expression);\n                    if (ts.some(baseTypeNode.typeArguments)) {\n                        ts.forEach(baseTypeNode.typeArguments, checkSourceElement);\n                        for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i < _a.length; _i++) {\n                            var constructor = _a[_i];\n                            if (!checkTypeArgumentConstraints(baseTypeNode, constructor.typeParameters)) {\n                                break;\n                            }\n                        }\n                    }\n                    var baseWithThis = getTypeWithThisArgument(baseType_1, type.thisType);\n                    if (!checkTypeAssignableTo(typeWithThis, baseWithThis, /*errorNode*/ undefined)) {\n                        issueMemberSpecificError(node, typeWithThis, baseWithThis, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1);\n                    }\n                    else {\n                        // Report static side error only when instance type is assignable\n                        checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1);\n                    }\n                    if (baseConstructorType.flags & 8650752 /* TypeVariable */) {\n                        if (!isMixinConstructorType(staticType)) {\n                            error(node.name || node, ts.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any);\n                        }\n                        else {\n                            var constructSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */);\n                            if (constructSignatures.some(function (signature) { return signature.flags & 4 /* Abstract */; }) && !ts.hasSyntacticModifier(node, 128 /* Abstract */)) {\n                                error(node.name || node, ts.Diagnostics.A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract);\n                            }\n                        }\n                    }\n                    if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32 /* Class */) && !(baseConstructorType.flags & 8650752 /* TypeVariable */)) {\n                        // When the static base type is a \"class-like\" constructor function (but not actually a class), we verify\n                        // that all instantiated base constructor signatures return the same type.\n                        var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode);\n                        if (ts.forEach(constructors, function (sig) { return !isJSConstructor(sig.declaration) && !isTypeIdenticalTo(getReturnTypeOfSignature(sig), baseType_1); })) {\n                            error(baseTypeNode.expression, ts.Diagnostics.Base_constructors_must_all_have_the_same_return_type);\n                        }\n                    }\n                    checkKindsOfPropertyMemberOverrides(type, baseType_1);\n                }\n            }\n            var implementedTypeNodes = ts.getEffectiveImplementsTypeNodes(node);\n            if (implementedTypeNodes) {\n                for (var _b = 0, implementedTypeNodes_1 = implementedTypeNodes; _b < implementedTypeNodes_1.length; _b++) {\n                    var typeRefNode = implementedTypeNodes_1[_b];\n                    if (!ts.isEntityNameExpression(typeRefNode.expression) || ts.isOptionalChain(typeRefNode.expression)) {\n                        error(typeRefNode.expression, ts.Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments);\n                    }\n                    checkTypeReferenceNode(typeRefNode);\n                    if (produceDiagnostics) {\n                        var t = getReducedType(getTypeFromTypeNode(typeRefNode));\n                        if (t !== errorType) {\n                            if (isValidBaseType(t)) {\n                                var genericDiag = t.symbol && t.symbol.flags & 32 /* Class */ ?\n                                    ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass :\n                                    ts.Diagnostics.Class_0_incorrectly_implements_interface_1;\n                                var baseWithThis = getTypeWithThisArgument(t, type.thisType);\n                                if (!checkTypeAssignableTo(typeWithThis, baseWithThis, /*errorNode*/ undefined)) {\n                                    issueMemberSpecificError(node, typeWithThis, baseWithThis, genericDiag);\n                                }\n                            }\n                            else {\n                                error(typeRefNode, ts.Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members);\n                            }\n                        }\n                    }\n                }\n            }\n            if (produceDiagnostics) {\n                checkIndexConstraints(type);\n                checkTypeForDuplicateIndexSignatures(node);\n                checkPropertyInitialization(node);\n            }\n        }\n        function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {\n            // iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible\n            var issuedMemberError = false;\n            var _loop_23 = function (member) {\n                if (ts.hasStaticModifier(member)) {\n                    return \"continue\";\n                }\n                var declaredProp = member.name && getSymbolAtLocation(member.name) || getSymbolAtLocation(member);\n                if (declaredProp) {\n                    var prop = getPropertyOfType(typeWithThis, declaredProp.escapedName);\n                    var baseProp = getPropertyOfType(baseWithThis, declaredProp.escapedName);\n                    if (prop && baseProp) {\n                        var rootChain = function () { return ts.chainDiagnosticMessages(\n                        /*details*/ undefined, ts.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2, symbolToString(declaredProp), typeToString(typeWithThis), typeToString(baseWithThis)); };\n                        if (!checkTypeAssignableTo(getTypeOfSymbol(prop), getTypeOfSymbol(baseProp), member.name || member, /*message*/ undefined, rootChain)) {\n                            issuedMemberError = true;\n                        }\n                    }\n                }\n            };\n            for (var _i = 0, _a = node.members; _i < _a.length; _i++) {\n                var member = _a[_i];\n                _loop_23(member);\n            }\n            if (!issuedMemberError) {\n                // check again with diagnostics to generate a less-specific error\n                checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag);\n            }\n        }\n        function checkBaseTypeAccessibility(type, node) {\n            var signatures = getSignaturesOfType(type, 1 /* Construct */);\n            if (signatures.length) {\n                var declaration = signatures[0].declaration;\n                if (declaration && ts.hasEffectiveModifier(declaration, 8 /* Private */)) {\n                    var typeClassDeclaration = ts.getClassLikeDeclarationOfSymbol(type.symbol);\n                    if (!isNodeWithinClass(node, typeClassDeclaration)) {\n                        error(node, ts.Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName(type.symbol));\n                    }\n                }\n            }\n        }\n        function getTargetSymbol(s) {\n            // if symbol is instantiated its flags are not copied from the 'target'\n            // so we'll need to get back original 'target' symbol to work with correct set of flags\n            return ts.getCheckFlags(s) & 1 /* Instantiated */ ? s.target : s;\n        }\n        function getClassOrInterfaceDeclarationsOfSymbol(symbol) {\n            return ts.filter(symbol.declarations, function (d) {\n                return d.kind === 252 /* ClassDeclaration */ || d.kind === 253 /* InterfaceDeclaration */;\n            });\n        }\n        function checkKindsOfPropertyMemberOverrides(type, baseType) {\n            // TypeScript 1.0 spec (April 2014): 8.2.3\n            // A derived class inherits all members from its base class it doesn't override.\n            // Inheritance means that a derived class implicitly contains all non - overridden members of the base class.\n            // Both public and private property members are inherited, but only public property members can be overridden.\n            // A property member in a derived class is said to override a property member in a base class\n            // when the derived class property member has the same name and kind(instance or static)\n            // as the base class property member.\n            // The type of an overriding property member must be assignable(section 3.8.4)\n            // to the type of the overridden property member, or otherwise a compile - time error occurs.\n            // Base class instance member functions can be overridden by derived class instance member functions,\n            // but not by other kinds of members.\n            // Base class instance member variables and accessors can be overridden by\n            // derived class instance member variables and accessors, but not by other kinds of members.\n            // NOTE: assignability is checked in checkClassDeclaration\n            var baseProperties = getPropertiesOfType(baseType);\n            basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {\n                var baseProperty = baseProperties_1[_i];\n                var base = getTargetSymbol(baseProperty);\n                if (base.flags & 4194304 /* Prototype */) {\n                    continue;\n                }\n                var baseSymbol = getPropertyOfObjectType(type, base.escapedName);\n                if (!baseSymbol) {\n                    continue;\n                }\n                var derived = getTargetSymbol(baseSymbol);\n                var baseDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(base);\n                ts.Debug.assert(!!derived, \"derived should point to something, even if it is the base class' declaration.\");\n                // In order to resolve whether the inherited method was overridden in the base class or not,\n                // we compare the Symbols obtained. Since getTargetSymbol returns the symbol on the *uninstantiated*\n                // type declaration, derived and base resolve to the same symbol even in the case of generic classes.\n                if (derived === base) {\n                    // derived class inherits base without override/redeclaration\n                    var derivedClassDecl = ts.getClassLikeDeclarationOfSymbol(type.symbol);\n                    // It is an error to inherit an abstract member without implementing it or being declared abstract.\n                    // If there is no declaration for the derived class (as in the case of class expressions),\n                    // then the class cannot be declared abstract.\n                    if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !ts.hasSyntacticModifier(derivedClassDecl, 128 /* Abstract */))) {\n                        // Searches other base types for a declaration that would satisfy the inherited abstract member.\n                        // (The class may have more than one base type via declaration merging with an interface with the\n                        // same name.)\n                        for (var _a = 0, _b = getBaseTypes(type); _a < _b.length; _a++) {\n                            var otherBaseType = _b[_a];\n                            if (otherBaseType === baseType)\n                                continue;\n                            var baseSymbol_1 = getPropertyOfObjectType(otherBaseType, base.escapedName);\n                            var derivedElsewhere = baseSymbol_1 && getTargetSymbol(baseSymbol_1);\n                            if (derivedElsewhere && derivedElsewhere !== base) {\n                                continue basePropertyCheck;\n                            }\n                        }\n                        if (derivedClassDecl.kind === 221 /* ClassExpression */) {\n                            error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType));\n                        }\n                        else {\n                            error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2, typeToString(type), symbolToString(baseProperty), typeToString(baseType));\n                        }\n                    }\n                }\n                else {\n                    // derived overrides base.\n                    var derivedDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(derived);\n                    if (baseDeclarationFlags & 8 /* Private */ || derivedDeclarationFlags & 8 /* Private */) {\n                        // either base or derived property is private - not override, skip it\n                        continue;\n                    }\n                    var errorMessage = void 0;\n                    var basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;\n                    var derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;\n                    if (basePropertyFlags && derivedPropertyFlags) {\n                        // property/accessor is overridden with property/accessor\n                        if (baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer)\n                            || base.valueDeclaration && base.valueDeclaration.parent.kind === 253 /* InterfaceDeclaration */\n                            || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) {\n                            // when the base property is abstract or from an interface, base/derived flags don't need to match\n                            // same when the derived property is from an assignment\n                            continue;\n                        }\n                        var overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;\n                        var overriddenInstanceAccessor = basePropertyFlags === 4 /* Property */ && derivedPropertyFlags !== 4 /* Property */;\n                        if (overriddenInstanceProperty || overriddenInstanceAccessor) {\n                            var errorMessage_1 = overriddenInstanceProperty ?\n                                ts.Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property :\n                                ts.Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;\n                            error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type));\n                        }\n                        else if (compilerOptions.useDefineForClassFields) {\n                            var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 163 /* PropertyDeclaration */ && !d.initializer; });\n                            if (uninitialized\n                                && !(derived.flags & 33554432 /* Transient */)\n                                && !(baseDeclarationFlags & 128 /* Abstract */)\n                                && !(derivedDeclarationFlags & 128 /* Abstract */)\n                                && !derived.declarations.some(function (d) { return !!(d.flags & 8388608 /* Ambient */); })) {\n                                var constructor = findConstructorDeclaration(ts.getClassLikeDeclarationOfSymbol(type.symbol));\n                                var propName = uninitialized.name;\n                                if (uninitialized.exclamationToken\n                                    || !constructor\n                                    || !ts.isIdentifier(propName)\n                                    || !strictNullChecks\n                                    || !isPropertyInitializedInConstructor(propName, type, constructor)) {\n                                    var errorMessage_2 = ts.Diagnostics.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration;\n                                    error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_2, symbolToString(base), typeToString(baseType));\n                                }\n                            }\n                        }\n                        // correct case\n                        continue;\n                    }\n                    else if (isPrototypeProperty(base)) {\n                        if (isPrototypeProperty(derived) || derived.flags & 4 /* Property */) {\n                            // method is overridden with method or property -- correct case\n                            continue;\n                        }\n                        else {\n                            ts.Debug.assert(!!(derived.flags & 98304 /* Accessor */));\n                            errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor;\n                        }\n                    }\n                    else if (base.flags & 98304 /* Accessor */) {\n                        errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function;\n                    }\n                    else {\n                        errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function;\n                    }\n                    error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type));\n                }\n            }\n        }\n        function getNonInterhitedProperties(type, baseTypes, properties) {\n            if (!ts.length(baseTypes)) {\n                return properties;\n            }\n            var seen = new ts.Map();\n            ts.forEach(properties, function (p) { seen.set(p.escapedName, p); });\n            for (var _i = 0, baseTypes_2 = baseTypes; _i < baseTypes_2.length; _i++) {\n                var base = baseTypes_2[_i];\n                var properties_5 = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType));\n                for (var _a = 0, properties_4 = properties_5; _a < properties_4.length; _a++) {\n                    var prop = properties_4[_a];\n                    var existing = seen.get(prop.escapedName);\n                    if (existing && !isPropertyIdenticalTo(existing, prop)) {\n                        seen.delete(prop.escapedName);\n                    }\n                }\n            }\n            return ts.arrayFrom(seen.values());\n        }\n        function checkInheritedPropertiesAreIdentical(type, typeNode) {\n            var baseTypes = getBaseTypes(type);\n            if (baseTypes.length < 2) {\n                return true;\n            }\n            var seen = new ts.Map();\n            ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen.set(p.escapedName, { prop: p, containingType: type }); });\n            var ok = true;\n            for (var _i = 0, baseTypes_3 = baseTypes; _i < baseTypes_3.length; _i++) {\n                var base = baseTypes_3[_i];\n                var properties = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType));\n                for (var _a = 0, properties_6 = properties; _a < properties_6.length; _a++) {\n                    var prop = properties_6[_a];\n                    var existing = seen.get(prop.escapedName);\n                    if (!existing) {\n                        seen.set(prop.escapedName, { prop: prop, containingType: base });\n                    }\n                    else {\n                        var isInheritedProperty = existing.containingType !== type;\n                        if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) {\n                            ok = false;\n                            var typeName1 = typeToString(existing.containingType);\n                            var typeName2 = typeToString(base);\n                            var errorInfo = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical, symbolToString(prop), typeName1, typeName2);\n                            errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2);\n                            diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo));\n                        }\n                    }\n                }\n            }\n            return ok;\n        }\n        function checkPropertyInitialization(node) {\n            if (!strictNullChecks || !strictPropertyInitialization || node.flags & 8388608 /* Ambient */) {\n                return;\n            }\n            var constructor = findConstructorDeclaration(node);\n            for (var _i = 0, _a = node.members; _i < _a.length; _i++) {\n                var member = _a[_i];\n                if (ts.getEffectiveModifierFlags(member) & 2 /* Ambient */) {\n                    continue;\n                }\n                if (isInstancePropertyWithoutInitializer(member)) {\n                    var propName = member.name;\n                    if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {\n                        var type = getTypeOfSymbol(getSymbolOfNode(member));\n                        if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {\n                            if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {\n                                error(member.name, ts.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, ts.declarationNameToString(propName));\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        function isInstancePropertyWithoutInitializer(node) {\n            return node.kind === 163 /* PropertyDeclaration */ &&\n                !ts.hasSyntacticModifier(node, 32 /* Static */ | 128 /* Abstract */) &&\n                !node.exclamationToken &&\n                !node.initializer;\n        }\n        function isPropertyInitializedInConstructor(propName, propType, constructor) {\n            var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);\n            ts.setParent(reference.expression, reference);\n            ts.setParent(reference, constructor);\n            reference.flowNode = constructor.returnFlowNode;\n            var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));\n            return !(getFalsyFlags(flowType) & 32768 /* Undefined */);\n        }\n        function checkInterfaceDeclaration(node) {\n            // Grammar checking\n            if (!checkGrammarDecoratorsAndModifiers(node))\n                checkGrammarInterfaceDeclaration(node);\n            checkTypeParameters(node.typeParameters);\n            if (produceDiagnostics) {\n                checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0);\n                checkExportsOnMergedDeclarations(node);\n                var symbol = getSymbolOfNode(node);\n                checkTypeParameterListsIdentical(symbol);\n                // Only check this symbol once\n                var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 253 /* InterfaceDeclaration */);\n                if (node === firstInterfaceDecl) {\n                    var type = getDeclaredTypeOfSymbol(symbol);\n                    var typeWithThis = getTypeWithThisArgument(type);\n                    // run subsequent checks only if first set succeeded\n                    if (checkInheritedPropertiesAreIdentical(type, node.name)) {\n                        for (var _i = 0, _a = getBaseTypes(type); _i < _a.length; _i++) {\n                            var baseType = _a[_i];\n                            checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(baseType, type.thisType), node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1);\n                        }\n                        checkIndexConstraints(type);\n                    }\n                }\n                checkObjectTypeForDuplicateDeclarations(node);\n            }\n            ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) {\n                if (!ts.isEntityNameExpression(heritageElement.expression) || ts.isOptionalChain(heritageElement.expression)) {\n                    error(heritageElement.expression, ts.Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments);\n                }\n                checkTypeReferenceNode(heritageElement);\n            });\n            ts.forEach(node.members, checkSourceElement);\n            if (produceDiagnostics) {\n                checkTypeForDuplicateIndexSignatures(node);\n                registerForUnusedIdentifiersCheck(node);\n            }\n        }\n        function checkTypeAliasDeclaration(node) {\n            // Grammar checking\n            checkGrammarDecoratorsAndModifiers(node);\n            checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0);\n            checkExportsOnMergedDeclarations(node);\n            checkTypeParameters(node.typeParameters);\n            if (node.type.kind === 136 /* IntrinsicKeyword */) {\n                if (!intrinsicTypeKinds.has(node.name.escapedText) || ts.length(node.typeParameters) !== 1) {\n                    error(node.type, ts.Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types);\n                }\n            }\n            else {\n                checkSourceElement(node.type);\n                registerForUnusedIdentifiersCheck(node);\n            }\n        }\n        function computeEnumMemberValues(node) {\n            var nodeLinks = getNodeLinks(node);\n            if (!(nodeLinks.flags & 16384 /* EnumValuesComputed */)) {\n                nodeLinks.flags |= 16384 /* EnumValuesComputed */;\n                var autoValue = 0;\n                for (var _i = 0, _a = node.members; _i < _a.length; _i++) {\n                    var member = _a[_i];\n                    var value = computeMemberValue(member, autoValue);\n                    getNodeLinks(member).enumMemberValue = value;\n                    autoValue = typeof value === \"number\" ? value + 1 : undefined;\n                }\n            }\n        }\n        function computeMemberValue(member, autoValue) {\n            if (ts.isComputedNonLiteralName(member.name)) {\n                error(member.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums);\n            }\n            else {\n                var text = ts.getTextOfPropertyName(member.name);\n                if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {\n                    error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name);\n                }\n            }\n            if (member.initializer) {\n                return computeConstantValue(member);\n            }\n            // In ambient non-const numeric enum declarations, enum members without initializers are\n            // considered computed members (as opposed to having auto-incremented values).\n            if (member.parent.flags & 8388608 /* Ambient */ && !ts.isEnumConst(member.parent) && getEnumKind(getSymbolOfNode(member.parent)) === 0 /* Numeric */) {\n                return undefined;\n            }\n            // If the member declaration specifies no value, the member is considered a constant enum member.\n            // If the member is the first member in the enum declaration, it is assigned the value zero.\n            // Otherwise, it is assigned the value of the immediately preceding member plus one, and an error\n            // occurs if the immediately preceding member is not a constant enum member.\n            if (autoValue !== undefined) {\n                return autoValue;\n            }\n            error(member.name, ts.Diagnostics.Enum_member_must_have_initializer);\n            return undefined;\n        }\n        function computeConstantValue(member) {\n            var enumKind = getEnumKind(getSymbolOfNode(member.parent));\n            var isConstEnum = ts.isEnumConst(member.parent);\n            var initializer = member.initializer;\n            var value = enumKind === 1 /* Literal */ && !isLiteralEnumMember(member) ? undefined : evaluate(initializer);\n            if (value !== undefined) {\n                if (isConstEnum && typeof value === \"number\" && !isFinite(value)) {\n                    error(initializer, isNaN(value) ?\n                        ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN :\n                        ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value);\n                }\n            }\n            else if (enumKind === 1 /* Literal */) {\n                error(initializer, ts.Diagnostics.Computed_values_are_not_permitted_in_an_enum_with_string_valued_members);\n                return 0;\n            }\n            else if (isConstEnum) {\n                error(initializer, ts.Diagnostics.const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values);\n            }\n            else if (member.parent.flags & 8388608 /* Ambient */) {\n                error(initializer, ts.Diagnostics.In_ambient_enum_declarations_member_initializer_must_be_constant_expression);\n            }\n            else {\n                // Only here do we need to check that the initializer is assignable to the enum type.\n                var source = checkExpression(initializer);\n                if (!isTypeAssignableToKind(source, 296 /* NumberLike */)) {\n                    error(initializer, ts.Diagnostics.Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhaustiveness_checks_consider_using_an_object_literal_instead, typeToString(source));\n                }\n                else {\n                    checkTypeAssignableTo(source, getDeclaredTypeOfSymbol(getSymbolOfNode(member.parent)), initializer, /*headMessage*/ undefined);\n                }\n            }\n            return value;\n            function evaluate(expr) {\n                switch (expr.kind) {\n                    case 214 /* PrefixUnaryExpression */:\n                        var value_2 = evaluate(expr.operand);\n                        if (typeof value_2 === \"number\") {\n                            switch (expr.operator) {\n                                case 39 /* PlusToken */: return value_2;\n                                case 40 /* MinusToken */: return -value_2;\n                                case 54 /* TildeToken */: return ~value_2;\n                            }\n                        }\n                        break;\n                    case 216 /* BinaryExpression */:\n                        var left = evaluate(expr.left);\n                        var right = evaluate(expr.right);\n                        if (typeof left === \"number\" && typeof right === \"number\") {\n                            switch (expr.operatorToken.kind) {\n                                case 51 /* BarToken */: return left | right;\n                                case 50 /* AmpersandToken */: return left & right;\n                                case 48 /* GreaterThanGreaterThanToken */: return left >> right;\n                                case 49 /* GreaterThanGreaterThanGreaterThanToken */: return left >>> right;\n                                case 47 /* LessThanLessThanToken */: return left << right;\n                                case 52 /* CaretToken */: return left ^ right;\n                                case 41 /* AsteriskToken */: return left * right;\n                                case 43 /* SlashToken */: return left / right;\n                                case 39 /* PlusToken */: return left + right;\n                                case 40 /* MinusToken */: return left - right;\n                                case 44 /* PercentToken */: return left % right;\n                                case 42 /* AsteriskAsteriskToken */: return Math.pow(left, right);\n                            }\n                        }\n                        else if (typeof left === \"string\" && typeof right === \"string\" && expr.operatorToken.kind === 39 /* PlusToken */) {\n                            return left + right;\n                        }\n                        break;\n                    case 10 /* StringLiteral */:\n                    case 14 /* NoSubstitutionTemplateLiteral */:\n                        return expr.text;\n                    case 8 /* NumericLiteral */:\n                        checkGrammarNumericLiteral(expr);\n                        return +expr.text;\n                    case 207 /* ParenthesizedExpression */:\n                        return evaluate(expr.expression);\n                    case 78 /* Identifier */:\n                        var identifier = expr;\n                        if (isInfinityOrNaNString(identifier.escapedText)) {\n                            return +(identifier.escapedText);\n                        }\n                        return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);\n                    case 202 /* ElementAccessExpression */:\n                    case 201 /* PropertyAccessExpression */:\n                        var ex = expr;\n                        if (isConstantMemberAccess(ex)) {\n                            var type = getTypeOfExpression(ex.expression);\n                            if (type.symbol && type.symbol.flags & 384 /* Enum */) {\n                                var name = void 0;\n                                if (ex.kind === 201 /* PropertyAccessExpression */) {\n                                    name = ex.name.escapedText;\n                                }\n                                else {\n                                    name = ts.escapeLeadingUnderscores(ts.cast(ex.argumentExpression, ts.isLiteralExpression).text);\n                                }\n                                return evaluateEnumMember(expr, type.symbol, name);\n                            }\n                        }\n                        break;\n                }\n                return undefined;\n            }\n            function evaluateEnumMember(expr, enumSymbol, name) {\n                var memberSymbol = enumSymbol.exports.get(name);\n                if (memberSymbol) {\n                    var declaration = memberSymbol.valueDeclaration;\n                    if (declaration !== member) {\n                        if (isBlockScopedNameDeclaredBeforeUse(declaration, member)) {\n                            return getEnumMemberValue(declaration);\n                        }\n                        error(expr, ts.Diagnostics.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums);\n                        return 0;\n                    }\n                    else {\n                        error(expr, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(memberSymbol));\n                    }\n                }\n                return undefined;\n            }\n        }\n        function isConstantMemberAccess(node) {\n            return node.kind === 78 /* Identifier */ ||\n                node.kind === 201 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) ||\n                node.kind === 202 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) &&\n                    ts.isStringLiteralLike(node.argumentExpression);\n        }\n        function checkEnumDeclaration(node) {\n            if (!produceDiagnostics) {\n                return;\n            }\n            // Grammar checking\n            checkGrammarDecoratorsAndModifiers(node);\n            checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0);\n            checkCollisionWithRequireExportsInGeneratedCode(node, node.name);\n            checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);\n            checkExportsOnMergedDeclarations(node);\n            node.members.forEach(checkEnumMember);\n            computeEnumMemberValues(node);\n            // Spec 2014 - Section 9.3:\n            // It isn't possible for one enum declaration to continue the automatic numbering sequence of another,\n            // and when an enum type has multiple declarations, only one declaration is permitted to omit a value\n            // for the first member.\n            //\n            // Only perform this check once per symbol\n            var enumSymbol = getSymbolOfNode(node);\n            var firstDeclaration = ts.getDeclarationOfKind(enumSymbol, node.kind);\n            if (node === firstDeclaration) {\n                if (enumSymbol.declarations.length > 1) {\n                    var enumIsConst_1 = ts.isEnumConst(node);\n                    // check that const is placed\\omitted on all enum declarations\n                    ts.forEach(enumSymbol.declarations, function (decl) {\n                        if (ts.isEnumDeclaration(decl) && ts.isEnumConst(decl) !== enumIsConst_1) {\n                            error(ts.getNameOfDeclaration(decl), ts.Diagnostics.Enum_declarations_must_all_be_const_or_non_const);\n                        }\n                    });\n                }\n                var seenEnumMissingInitialInitializer_1 = false;\n                ts.forEach(enumSymbol.declarations, function (declaration) {\n                    // return true if we hit a violation of the rule, false otherwise\n                    if (declaration.kind !== 255 /* EnumDeclaration */) {\n                        return false;\n                    }\n                    var enumDeclaration = declaration;\n                    if (!enumDeclaration.members.length) {\n                        return false;\n                    }\n                    var firstEnumMember = enumDeclaration.members[0];\n                    if (!firstEnumMember.initializer) {\n                        if (seenEnumMissingInitialInitializer_1) {\n                            error(firstEnumMember.name, ts.Diagnostics.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element);\n                        }\n                        else {\n                            seenEnumMissingInitialInitializer_1 = true;\n                        }\n                    }\n                });\n            }\n        }\n        function checkEnumMember(node) {\n            if (ts.isPrivateIdentifier(node.name)) {\n                error(node, ts.Diagnostics.An_enum_member_cannot_be_named_with_a_private_identifier);\n            }\n        }\n        function getFirstNonAmbientClassOrFunctionDeclaration(symbol) {\n            var declarations = symbol.declarations;\n            for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) {\n                var declaration = declarations_8[_i];\n                if ((declaration.kind === 252 /* ClassDeclaration */ ||\n                    (declaration.kind === 251 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) &&\n                    !(declaration.flags & 8388608 /* Ambient */)) {\n                    return declaration;\n                }\n            }\n            return undefined;\n        }\n        function inSameLexicalScope(node1, node2) {\n            var container1 = ts.getEnclosingBlockScopeContainer(node1);\n            var container2 = ts.getEnclosingBlockScopeContainer(node2);\n            if (isGlobalSourceFile(container1)) {\n                return isGlobalSourceFile(container2);\n            }\n            else if (isGlobalSourceFile(container2)) {\n                return false;\n            }\n            else {\n                return container1 === container2;\n            }\n        }\n        function checkModuleDeclaration(node) {\n            if (produceDiagnostics) {\n                // Grammar checking\n                var isGlobalAugmentation = ts.isGlobalScopeAugmentation(node);\n                var inAmbientContext = node.flags & 8388608 /* Ambient */;\n                if (isGlobalAugmentation && !inAmbientContext) {\n                    error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context);\n                }\n                var isAmbientExternalModule = ts.isAmbientModule(node);\n                var contextErrorMessage = isAmbientExternalModule\n                    ? ts.Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file\n                    : ts.Diagnostics.A_namespace_declaration_is_only_allowed_in_a_namespace_or_module;\n                if (checkGrammarModuleElementContext(node, contextErrorMessage)) {\n                    // If we hit a module declaration in an illegal context, just bail out to avoid cascading errors.\n                    return;\n                }\n                if (!checkGrammarDecoratorsAndModifiers(node)) {\n                    if (!inAmbientContext && node.name.kind === 10 /* StringLiteral */) {\n                        grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names);\n                    }\n                }\n                if (ts.isIdentifier(node.name)) {\n                    checkCollisionWithRequireExportsInGeneratedCode(node, node.name);\n                    checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);\n                }\n                checkExportsOnMergedDeclarations(node);\n                var symbol = getSymbolOfNode(node);\n                // The following checks only apply on a non-ambient instantiated module declaration.\n                if (symbol.flags & 512 /* ValueModule */\n                    && !inAmbientContext\n                    && symbol.declarations.length > 1\n                    && isInstantiatedModule(node, ts.shouldPreserveConstEnums(compilerOptions))) {\n                    var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);\n                    if (firstNonAmbientClassOrFunc) {\n                        if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) {\n                            error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged);\n                        }\n                        else if (node.pos < firstNonAmbientClassOrFunc.pos) {\n                            error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged);\n                        }\n                    }\n                    // if the module merges with a class declaration in the same lexical scope,\n                    // we need to track this to ensure the correct emit.\n                    var mergedClass = ts.getDeclarationOfKind(symbol, 252 /* ClassDeclaration */);\n                    if (mergedClass &&\n                        inSameLexicalScope(node, mergedClass)) {\n                        getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */;\n                    }\n                }\n                if (isAmbientExternalModule) {\n                    if (ts.isExternalModuleAugmentation(node)) {\n                        // body of the augmentation should be checked for consistency only if augmentation was applied to its target (either global scope or module)\n                        // otherwise we'll be swamped in cascading errors.\n                        // We can detect if augmentation was applied using following rules:\n                        // - augmentation for a global scope is always applied\n                        // - augmentation for some external module is applied if symbol for augmentation is merged (it was combined with target module).\n                        var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 33554432 /* Transient */);\n                        if (checkBody && node.body) {\n                            for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) {\n                                var statement = _a[_i];\n                                checkModuleAugmentationElement(statement, isGlobalAugmentation);\n                            }\n                        }\n                    }\n                    else if (isGlobalSourceFile(node.parent)) {\n                        if (isGlobalAugmentation) {\n                            error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations);\n                        }\n                        else if (ts.isExternalModuleNameRelative(ts.getTextOfIdentifierOrLiteral(node.name))) {\n                            error(node.name, ts.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name);\n                        }\n                    }\n                    else {\n                        if (isGlobalAugmentation) {\n                            error(node.name, ts.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations);\n                        }\n                        else {\n                            // Node is not an augmentation and is not located on the script level.\n                            // This means that this is declaration of ambient module that is located in other module or namespace which is prohibited.\n                            error(node.name, ts.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces);\n                        }\n                    }\n                }\n            }\n            if (node.body) {\n                checkSourceElement(node.body);\n                if (!ts.isGlobalScopeAugmentation(node)) {\n                    registerForUnusedIdentifiersCheck(node);\n                }\n            }\n        }\n        function checkModuleAugmentationElement(node, isGlobalAugmentation) {\n            switch (node.kind) {\n                case 232 /* VariableStatement */:\n                    // error each individual name in variable statement instead of marking the entire variable statement\n                    for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {\n                        var decl = _a[_i];\n                        checkModuleAugmentationElement(decl, isGlobalAugmentation);\n                    }\n                    break;\n                case 266 /* ExportAssignment */:\n                case 267 /* ExportDeclaration */:\n                    grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);\n                    break;\n                case 260 /* ImportEqualsDeclaration */:\n                case 261 /* ImportDeclaration */:\n                    grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);\n                    break;\n                case 198 /* BindingElement */:\n                case 249 /* VariableDeclaration */:\n                    var name = node.name;\n                    if (ts.isBindingPattern(name)) {\n                        for (var _b = 0, _c = name.elements; _b < _c.length; _b++) {\n                            var el = _c[_b];\n                            // mark individual names in binding pattern\n                            checkModuleAugmentationElement(el, isGlobalAugmentation);\n                        }\n                        break;\n                    }\n                // falls through\n                case 252 /* ClassDeclaration */:\n                case 255 /* EnumDeclaration */:\n                case 251 /* FunctionDeclaration */:\n                case 253 /* InterfaceDeclaration */:\n                case 256 /* ModuleDeclaration */:\n                case 254 /* TypeAliasDeclaration */:\n                    if (isGlobalAugmentation) {\n                        return;\n                    }\n                    var symbol = getSymbolOfNode(node);\n                    if (symbol) {\n                        // module augmentations cannot introduce new names on the top level scope of the module\n                        // this is done it two steps\n                        // 1. quick check - if symbol for node is not merged - this is local symbol to this augmentation - report error\n                        // 2. main check - report error if value declaration of the parent symbol is module augmentation)\n                        var reportError = !(symbol.flags & 33554432 /* Transient */);\n                        if (!reportError) {\n                            // symbol should not originate in augmentation\n                            reportError = !!symbol.parent && ts.isExternalModuleAugmentation(symbol.parent.declarations[0]);\n                        }\n                    }\n                    break;\n            }\n        }\n        function getFirstNonModuleExportsIdentifier(node) {\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                    return node;\n                case 157 /* QualifiedName */:\n                    do {\n                        node = node.left;\n                    } while (node.kind !== 78 /* Identifier */);\n                    return node;\n                case 201 /* PropertyAccessExpression */:\n                    do {\n                        if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) {\n                            return node.name;\n                        }\n                        node = node.expression;\n                    } while (node.kind !== 78 /* Identifier */);\n                    return node;\n            }\n        }\n        function checkExternalImportOrExportDeclaration(node) {\n            var moduleName = ts.getExternalModuleName(node);\n            if (!moduleName || ts.nodeIsMissing(moduleName)) {\n                // Should be a parse error.\n                return false;\n            }\n            if (!ts.isStringLiteral(moduleName)) {\n                error(moduleName, ts.Diagnostics.String_literal_expected);\n                return false;\n            }\n            var inAmbientExternalModule = node.parent.kind === 257 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent);\n            if (node.parent.kind !== 297 /* SourceFile */ && !inAmbientExternalModule) {\n                error(moduleName, node.kind === 267 /* ExportDeclaration */ ?\n                    ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace :\n                    ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);\n                return false;\n            }\n            if (inAmbientExternalModule && ts.isExternalModuleNameRelative(moduleName.text)) {\n                // we have already reported errors on top level imports/exports in external module augmentations in checkModuleDeclaration\n                // no need to do this again.\n                if (!isTopLevelInExternalModuleAugmentation(node)) {\n                    // TypeScript 1.0 spec (April 2013): 12.1.6\n                    // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference\n                    // other external modules only through top - level external module names.\n                    // Relative external module names are not permitted.\n                    error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name);\n                    return false;\n                }\n            }\n            return true;\n        }\n        function checkAliasSymbol(node) {\n            var _a;\n            var symbol = getSymbolOfNode(node);\n            var target = resolveAlias(symbol);\n            if (target !== unknownSymbol) {\n                // For external modules, `symbol` represents the local symbol for an alias.\n                // This local symbol will merge any other local declarations (excluding other aliases)\n                // and symbol.flags will contains combined representation for all merged declaration.\n                // Based on symbol.flags we can compute a set of excluded meanings (meaning that resolved alias should not have,\n                // otherwise it will conflict with some local declaration). Note that in addition to normal flags we include matching SymbolFlags.Export*\n                // in order to prevent collisions with declarations that were exported from the current module (they still contribute to local names).\n                symbol = getMergedSymbol(symbol.exportSymbol || symbol);\n                var excludedMeanings = (symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */) ? 111551 /* Value */ : 0) |\n                    (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) |\n                    (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0);\n                if (target.flags & excludedMeanings) {\n                    var message = node.kind === 270 /* ExportSpecifier */ ?\n                        ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 :\n                        ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;\n                    error(node, message, symbolToString(symbol));\n                }\n                // Don't allow to re-export something with no value side when `--isolatedModules` is set.\n                if (compilerOptions.isolatedModules\n                    && node.kind === 270 /* ExportSpecifier */\n                    && !node.parent.parent.isTypeOnly\n                    && !(target.flags & 111551 /* Value */)\n                    && !(node.flags & 8388608 /* Ambient */)) {\n                    error(node, ts.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type);\n                }\n                if (ts.isImportSpecifier(node) && ((_a = target.declarations) === null || _a === void 0 ? void 0 : _a.every(function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); }))) {\n                    addDeprecatedSuggestion(node.name, target.declarations, symbol.escapedName);\n                }\n            }\n        }\n        function checkImportBinding(node) {\n            checkCollisionWithRequireExportsInGeneratedCode(node, node.name);\n            checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);\n            checkAliasSymbol(node);\n            if (node.kind === 265 /* ImportSpecifier */ &&\n                ts.idText(node.propertyName || node.name) === \"default\" &&\n                compilerOptions.esModuleInterop &&\n                moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015) {\n                checkExternalEmitHelpers(node, 131072 /* ImportDefault */);\n            }\n        }\n        function checkImportDeclaration(node) {\n            if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) {\n                // If we hit an import declaration in an illegal context, just bail out to avoid cascading errors.\n                return;\n            }\n            if (!checkGrammarDecoratorsAndModifiers(node) && ts.hasEffectiveModifiers(node)) {\n                grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers);\n            }\n            if (checkExternalImportOrExportDeclaration(node)) {\n                var importClause = node.importClause;\n                if (importClause && !checkGrammarImportClause(importClause)) {\n                    if (importClause.name) {\n                        checkImportBinding(importClause);\n                    }\n                    if (importClause.namedBindings) {\n                        if (importClause.namedBindings.kind === 263 /* NamespaceImport */) {\n                            checkImportBinding(importClause.namedBindings);\n                            if (moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015 && compilerOptions.esModuleInterop) {\n                                // import * as ns from \"foo\";\n                                checkExternalEmitHelpers(node, 65536 /* ImportStar */);\n                            }\n                        }\n                        else {\n                            var moduleExisted = resolveExternalModuleName(node, node.moduleSpecifier);\n                            if (moduleExisted) {\n                                ts.forEach(importClause.namedBindings.elements, checkImportBinding);\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        function checkImportEqualsDeclaration(node) {\n            if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) {\n                // If we hit an import declaration in an illegal context, just bail out to avoid cascading errors.\n                return;\n            }\n            checkGrammarDecoratorsAndModifiers(node);\n            if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {\n                checkImportBinding(node);\n                if (ts.hasSyntacticModifier(node, 1 /* Export */)) {\n                    markExportAsReferenced(node);\n                }\n                if (node.moduleReference.kind !== 272 /* ExternalModuleReference */) {\n                    var target = resolveAlias(getSymbolOfNode(node));\n                    if (target !== unknownSymbol) {\n                        if (target.flags & 111551 /* Value */) {\n                            // Target is a value symbol, check that it is not hidden by a local declaration with the same name\n                            var moduleName = ts.getFirstIdentifier(node.moduleReference);\n                            if (!(resolveEntityName(moduleName, 111551 /* Value */ | 1920 /* Namespace */).flags & 1920 /* Namespace */)) {\n                                error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.declarationNameToString(moduleName));\n                            }\n                        }\n                        if (target.flags & 788968 /* Type */) {\n                            checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0);\n                        }\n                    }\n                    if (node.isTypeOnly) {\n                        grammarErrorOnNode(node, ts.Diagnostics.An_import_alias_cannot_use_import_type);\n                    }\n                }\n                else {\n                    if (moduleKind >= ts.ModuleKind.ES2015 && !node.isTypeOnly && !(node.flags & 8388608 /* Ambient */)) {\n                        // Import equals declaration is deprecated in es6 or above\n                        grammarErrorOnNode(node, ts.Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);\n                    }\n                }\n            }\n        }\n        function checkExportDeclaration(node) {\n            if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module)) {\n                // If we hit an export in an illegal context, just bail out to avoid cascading errors.\n                return;\n            }\n            if (!checkGrammarDecoratorsAndModifiers(node) && ts.hasEffectiveModifiers(node)) {\n                grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_declaration_cannot_have_modifiers);\n            }\n            if (node.moduleSpecifier && node.exportClause && ts.isNamedExports(node.exportClause) && ts.length(node.exportClause.elements) && languageVersion === 0 /* ES3 */) {\n                checkExternalEmitHelpers(node, 2097152 /* CreateBinding */);\n            }\n            checkGrammarExportDeclaration(node);\n            if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {\n                if (node.exportClause && !ts.isNamespaceExport(node.exportClause)) {\n                    // export { x, y }\n                    // export { x, y } from \"foo\"\n                    ts.forEach(node.exportClause.elements, checkExportSpecifier);\n                    var inAmbientExternalModule = node.parent.kind === 257 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent);\n                    var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 257 /* ModuleBlock */ &&\n                        !node.moduleSpecifier && node.flags & 8388608 /* Ambient */;\n                    if (node.parent.kind !== 297 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {\n                        error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);\n                    }\n                }\n                else {\n                    // export * from \"foo\"\n                    // export * as ns from \"foo\";\n                    var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier);\n                    if (moduleSymbol && hasExportAssignmentSymbol(moduleSymbol)) {\n                        error(node.moduleSpecifier, ts.Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol));\n                    }\n                    else if (node.exportClause) {\n                        checkAliasSymbol(node.exportClause);\n                    }\n                    if (moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015) {\n                        if (node.exportClause) {\n                            // export * as ns from \"foo\";\n                            // For ES2015 modules, we emit it as a pair of `import * as a_1 ...; export { a_1 as ns }` and don't need the helper.\n                            // We only use the helper here when in esModuleInterop\n                            if (compilerOptions.esModuleInterop) {\n                                checkExternalEmitHelpers(node, 65536 /* ImportStar */);\n                            }\n                        }\n                        else {\n                            // export * from \"foo\"\n                            checkExternalEmitHelpers(node, 32768 /* ExportStar */);\n                        }\n                    }\n                }\n            }\n        }\n        function checkGrammarExportDeclaration(node) {\n            var _a;\n            var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 268 /* NamedExports */;\n            if (isTypeOnlyExportStar) {\n                grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type);\n            }\n            return !isTypeOnlyExportStar;\n        }\n        function checkGrammarModuleElementContext(node, errorMessage) {\n            var isInAppropriateContext = node.parent.kind === 297 /* SourceFile */ || node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 256 /* ModuleDeclaration */;\n            if (!isInAppropriateContext) {\n                grammarErrorOnFirstToken(node, errorMessage);\n            }\n            return !isInAppropriateContext;\n        }\n        function importClauseContainsReferencedImport(importClause) {\n            return ts.forEachImportClauseDeclaration(importClause, function (declaration) {\n                return !!getSymbolOfNode(declaration).isReferenced;\n            });\n        }\n        function importClauseContainsConstEnumUsedAsValue(importClause) {\n            return ts.forEachImportClauseDeclaration(importClause, function (declaration) {\n                return !!getSymbolLinks(getSymbolOfNode(declaration)).constEnumReferenced;\n            });\n        }\n        function canConvertImportDeclarationToTypeOnly(statement) {\n            return ts.isImportDeclaration(statement) &&\n                statement.importClause &&\n                !statement.importClause.isTypeOnly &&\n                importClauseContainsReferencedImport(statement.importClause) &&\n                !isReferencedAliasDeclaration(statement.importClause, /*checkChildren*/ true) &&\n                !importClauseContainsConstEnumUsedAsValue(statement.importClause);\n        }\n        function canConvertImportEqualsDeclarationToTypeOnly(statement) {\n            return ts.isImportEqualsDeclaration(statement) &&\n                ts.isExternalModuleReference(statement.moduleReference) &&\n                !statement.isTypeOnly &&\n                getSymbolOfNode(statement).isReferenced &&\n                !isReferencedAliasDeclaration(statement, /*checkChildren*/ false) &&\n                !getSymbolLinks(getSymbolOfNode(statement)).constEnumReferenced;\n        }\n        function checkImportsForTypeOnlyConversion(sourceFile) {\n            for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {\n                var statement = _a[_i];\n                if (canConvertImportDeclarationToTypeOnly(statement) || canConvertImportEqualsDeclarationToTypeOnly(statement)) {\n                    error(statement, ts.Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error);\n                }\n            }\n        }\n        function checkExportSpecifier(node) {\n            checkAliasSymbol(node);\n            if (ts.getEmitDeclarations(compilerOptions)) {\n                collectLinkedAliases(node.propertyName || node.name, /*setVisibility*/ true);\n            }\n            if (!node.parent.parent.moduleSpecifier) {\n                var exportedName = node.propertyName || node.name;\n                // find immediate value referenced by exported name (SymbolFlags.Alias is set so we don't chase down aliases)\n                var symbol = resolveName(exportedName, exportedName.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, \n                /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true);\n                if (symbol && (symbol === undefinedSymbol || symbol === globalThisSymbol || isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0])))) {\n                    error(exportedName, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, ts.idText(exportedName));\n                }\n                else {\n                    markExportAsReferenced(node);\n                    var target = symbol && (symbol.flags & 2097152 /* Alias */ ? resolveAlias(symbol) : symbol);\n                    if (!target || target === unknownSymbol || target.flags & 111551 /* Value */) {\n                        checkExpressionCached(node.propertyName || node.name);\n                    }\n                }\n            }\n            else {\n                if (compilerOptions.esModuleInterop &&\n                    moduleKind !== ts.ModuleKind.System &&\n                    moduleKind < ts.ModuleKind.ES2015 &&\n                    ts.idText(node.propertyName || node.name) === \"default\") {\n                    checkExternalEmitHelpers(node, 131072 /* ImportDefault */);\n                }\n            }\n        }\n        function checkExportAssignment(node) {\n            if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) {\n                // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors.\n                return;\n            }\n            var container = node.parent.kind === 297 /* SourceFile */ ? node.parent : node.parent.parent;\n            if (container.kind === 256 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) {\n                if (node.isExportEquals) {\n                    error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace);\n                }\n                else {\n                    error(node, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);\n                }\n                return;\n            }\n            // Grammar checking\n            if (!checkGrammarDecoratorsAndModifiers(node) && ts.hasEffectiveModifiers(node)) {\n                grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers);\n            }\n            if (node.expression.kind === 78 /* Identifier */) {\n                var id = node.expression;\n                var sym = resolveEntityName(id, 67108863 /* All */, /*ignoreErrors*/ true, /*dontResolveAlias*/ true, node);\n                if (sym) {\n                    markAliasReferenced(sym, id);\n                    // If not a value, we're interpreting the identifier as a type export, along the lines of (`export { Id as default }`)\n                    var target = sym.flags & 2097152 /* Alias */ ? resolveAlias(sym) : sym;\n                    if (target === unknownSymbol || target.flags & 111551 /* Value */) {\n                        // However if it is a value, we need to check it's being used correctly\n                        checkExpressionCached(node.expression);\n                    }\n                }\n                else {\n                    checkExpressionCached(node.expression); // doesn't resolve, check as expression to mark as error\n                }\n                if (ts.getEmitDeclarations(compilerOptions)) {\n                    collectLinkedAliases(node.expression, /*setVisibility*/ true);\n                }\n            }\n            else {\n                checkExpressionCached(node.expression);\n            }\n            checkExternalModuleExports(container);\n            if ((node.flags & 8388608 /* Ambient */) && !ts.isEntityNameExpression(node.expression)) {\n                grammarErrorOnNode(node.expression, ts.Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context);\n            }\n            if (node.isExportEquals && !(node.flags & 8388608 /* Ambient */)) {\n                if (moduleKind >= ts.ModuleKind.ES2015) {\n                    // export assignment is not supported in es6 modules\n                    grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead);\n                }\n                else if (moduleKind === ts.ModuleKind.System) {\n                    // system modules does not support export assignment\n                    grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system);\n                }\n            }\n        }\n        function hasExportedMembers(moduleSymbol) {\n            return ts.forEachEntry(moduleSymbol.exports, function (_, id) { return id !== \"export=\"; });\n        }\n        function checkExternalModuleExports(node) {\n            var moduleSymbol = getSymbolOfNode(node);\n            var links = getSymbolLinks(moduleSymbol);\n            if (!links.exportsChecked) {\n                var exportEqualsSymbol = moduleSymbol.exports.get(\"export=\");\n                if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) {\n                    var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration;\n                    if (!isTopLevelInExternalModuleAugmentation(declaration) && !ts.isInJSFile(declaration)) {\n                        error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);\n                    }\n                }\n                // Checks for export * conflicts\n                var exports_2 = getExportsOfModule(moduleSymbol);\n                if (exports_2) {\n                    exports_2.forEach(function (_a, id) {\n                        var declarations = _a.declarations, flags = _a.flags;\n                        if (id === \"__export\") {\n                            return;\n                        }\n                        // ECMA262: 15.2.1.1 It is a Syntax Error if the ExportedNames of ModuleItemList contains any duplicate entries.\n                        // (TS Exceptions: namespaces, function overloads, enums, and interfaces)\n                        if (flags & (1920 /* Namespace */ | 64 /* Interface */ | 384 /* Enum */)) {\n                            return;\n                        }\n                        var exportedDeclarationsCount = ts.countWhere(declarations, isNotOverloadAndNotAccessor);\n                        if (flags & 524288 /* TypeAlias */ && exportedDeclarationsCount <= 2) {\n                            // it is legal to merge type alias with other values\n                            // so count should be either 1 (just type alias) or 2 (type alias + merged value)\n                            return;\n                        }\n                        if (exportedDeclarationsCount > 1) {\n                            for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) {\n                                var declaration = declarations_9[_i];\n                                if (isNotOverload(declaration)) {\n                                    diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, ts.unescapeLeadingUnderscores(id)));\n                                }\n                            }\n                        }\n                    });\n                }\n                links.exportsChecked = true;\n            }\n        }\n        function checkSourceElement(node) {\n            if (node) {\n                var saveCurrentNode = currentNode;\n                currentNode = node;\n                instantiationCount = 0;\n                checkSourceElementWorker(node);\n                currentNode = saveCurrentNode;\n            }\n        }\n        function checkSourceElementWorker(node) {\n            if (ts.isInJSFile(node)) {\n                ts.forEach(node.jsDoc, function (_a) {\n                    var tags = _a.tags;\n                    return ts.forEach(tags, checkSourceElement);\n                });\n            }\n            var kind = node.kind;\n            if (cancellationToken) {\n                // Only bother checking on a few construct kinds.  We don't want to be excessively\n                // hitting the cancellation token on every node we check.\n                switch (kind) {\n                    case 256 /* ModuleDeclaration */:\n                    case 252 /* ClassDeclaration */:\n                    case 253 /* InterfaceDeclaration */:\n                    case 251 /* FunctionDeclaration */:\n                        cancellationToken.throwIfCancellationRequested();\n                }\n            }\n            if (kind >= 232 /* FirstStatement */ && kind <= 248 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) {\n                errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected);\n            }\n            switch (kind) {\n                case 159 /* TypeParameter */:\n                    return checkTypeParameter(node);\n                case 160 /* Parameter */:\n                    return checkParameter(node);\n                case 163 /* PropertyDeclaration */:\n                    return checkPropertyDeclaration(node);\n                case 162 /* PropertySignature */:\n                    return checkPropertySignature(node);\n                case 175 /* ConstructorType */:\n                case 174 /* FunctionType */:\n                case 169 /* CallSignature */:\n                case 170 /* ConstructSignature */:\n                case 171 /* IndexSignature */:\n                    return checkSignatureDeclaration(node);\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                    return checkMethodDeclaration(node);\n                case 166 /* Constructor */:\n                    return checkConstructorDeclaration(node);\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    return checkAccessorDeclaration(node);\n                case 173 /* TypeReference */:\n                    return checkTypeReferenceNode(node);\n                case 172 /* TypePredicate */:\n                    return checkTypePredicate(node);\n                case 176 /* TypeQuery */:\n                    return checkTypeQuery(node);\n                case 177 /* TypeLiteral */:\n                    return checkTypeLiteral(node);\n                case 178 /* ArrayType */:\n                    return checkArrayType(node);\n                case 179 /* TupleType */:\n                    return checkTupleType(node);\n                case 182 /* UnionType */:\n                case 183 /* IntersectionType */:\n                    return checkUnionOrIntersectionType(node);\n                case 186 /* ParenthesizedType */:\n                case 180 /* OptionalType */:\n                case 181 /* RestType */:\n                    return checkSourceElement(node.type);\n                case 187 /* ThisType */:\n                    return checkThisType(node);\n                case 188 /* TypeOperator */:\n                    return checkTypeOperator(node);\n                case 184 /* ConditionalType */:\n                    return checkConditionalType(node);\n                case 185 /* InferType */:\n                    return checkInferType(node);\n                case 193 /* TemplateLiteralType */:\n                    return checkTemplateLiteralType(node);\n                case 195 /* ImportType */:\n                    return checkImportType(node);\n                case 192 /* NamedTupleMember */:\n                    return checkNamedTupleMember(node);\n                case 315 /* JSDocAugmentsTag */:\n                    return checkJSDocAugmentsTag(node);\n                case 316 /* JSDocImplementsTag */:\n                    return checkJSDocImplementsTag(node);\n                case 331 /* JSDocTypedefTag */:\n                case 324 /* JSDocCallbackTag */:\n                case 325 /* JSDocEnumTag */:\n                    return checkJSDocTypeAliasTag(node);\n                case 330 /* JSDocTemplateTag */:\n                    return checkJSDocTemplateTag(node);\n                case 329 /* JSDocTypeTag */:\n                    return checkJSDocTypeTag(node);\n                case 326 /* JSDocParameterTag */:\n                    return checkJSDocParameterTag(node);\n                case 333 /* JSDocPropertyTag */:\n                    return checkJSDocPropertyTag(node);\n                case 308 /* JSDocFunctionType */:\n                    checkJSDocFunctionType(node);\n                // falls through\n                case 306 /* JSDocNonNullableType */:\n                case 305 /* JSDocNullableType */:\n                case 303 /* JSDocAllType */:\n                case 304 /* JSDocUnknownType */:\n                case 312 /* JSDocTypeLiteral */:\n                    checkJSDocTypeIsInJsFile(node);\n                    ts.forEachChild(node, checkSourceElement);\n                    return;\n                case 309 /* JSDocVariadicType */:\n                    checkJSDocVariadicType(node);\n                    return;\n                case 301 /* JSDocTypeExpression */:\n                    return checkSourceElement(node.type);\n                case 189 /* IndexedAccessType */:\n                    return checkIndexedAccessType(node);\n                case 190 /* MappedType */:\n                    return checkMappedType(node);\n                case 251 /* FunctionDeclaration */:\n                    return checkFunctionDeclaration(node);\n                case 230 /* Block */:\n                case 257 /* ModuleBlock */:\n                    return checkBlock(node);\n                case 232 /* VariableStatement */:\n                    return checkVariableStatement(node);\n                case 233 /* ExpressionStatement */:\n                    return checkExpressionStatement(node);\n                case 234 /* IfStatement */:\n                    return checkIfStatement(node);\n                case 235 /* DoStatement */:\n                    return checkDoStatement(node);\n                case 236 /* WhileStatement */:\n                    return checkWhileStatement(node);\n                case 237 /* ForStatement */:\n                    return checkForStatement(node);\n                case 238 /* ForInStatement */:\n                    return checkForInStatement(node);\n                case 239 /* ForOfStatement */:\n                    return checkForOfStatement(node);\n                case 240 /* ContinueStatement */:\n                case 241 /* BreakStatement */:\n                    return checkBreakOrContinueStatement(node);\n                case 242 /* ReturnStatement */:\n                    return checkReturnStatement(node);\n                case 243 /* WithStatement */:\n                    return checkWithStatement(node);\n                case 244 /* SwitchStatement */:\n                    return checkSwitchStatement(node);\n                case 245 /* LabeledStatement */:\n                    return checkLabeledStatement(node);\n                case 246 /* ThrowStatement */:\n                    return checkThrowStatement(node);\n                case 247 /* TryStatement */:\n                    return checkTryStatement(node);\n                case 249 /* VariableDeclaration */:\n                    return checkVariableDeclaration(node);\n                case 198 /* BindingElement */:\n                    return checkBindingElement(node);\n                case 252 /* ClassDeclaration */:\n                    return checkClassDeclaration(node);\n                case 253 /* InterfaceDeclaration */:\n                    return checkInterfaceDeclaration(node);\n                case 254 /* TypeAliasDeclaration */:\n                    return checkTypeAliasDeclaration(node);\n                case 255 /* EnumDeclaration */:\n                    return checkEnumDeclaration(node);\n                case 256 /* ModuleDeclaration */:\n                    return checkModuleDeclaration(node);\n                case 261 /* ImportDeclaration */:\n                    return checkImportDeclaration(node);\n                case 260 /* ImportEqualsDeclaration */:\n                    return checkImportEqualsDeclaration(node);\n                case 267 /* ExportDeclaration */:\n                    return checkExportDeclaration(node);\n                case 266 /* ExportAssignment */:\n                    return checkExportAssignment(node);\n                case 231 /* EmptyStatement */:\n                case 248 /* DebuggerStatement */:\n                    checkGrammarStatementInAmbientContext(node);\n                    return;\n                case 271 /* MissingDeclaration */:\n                    return checkMissingDeclaration(node);\n            }\n        }\n        function checkJSDocTypeIsInJsFile(node) {\n            if (!ts.isInJSFile(node)) {\n                grammarErrorOnNode(node, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);\n            }\n        }\n        function checkJSDocVariadicType(node) {\n            checkJSDocTypeIsInJsFile(node);\n            checkSourceElement(node.type);\n            // Only legal location is in the *last* parameter tag or last parameter of a JSDoc function.\n            var parent = node.parent;\n            if (ts.isParameter(parent) && ts.isJSDocFunctionType(parent.parent)) {\n                if (ts.last(parent.parent.parameters) !== parent) {\n                    error(node, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list);\n                }\n                return;\n            }\n            if (!ts.isJSDocTypeExpression(parent)) {\n                error(node, ts.Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);\n            }\n            var paramTag = node.parent.parent;\n            if (!ts.isJSDocParameterTag(paramTag)) {\n                error(node, ts.Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);\n                return;\n            }\n            var param = ts.getParameterSymbolFromJSDoc(paramTag);\n            if (!param) {\n                // We will error in `checkJSDocParameterTag`.\n                return;\n            }\n            var host = ts.getHostSignatureFromJSDoc(paramTag);\n            if (!host || ts.last(host.parameters).symbol !== param) {\n                error(node, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list);\n            }\n        }\n        function getTypeFromJSDocVariadicType(node) {\n            var type = getTypeFromTypeNode(node.type);\n            var parent = node.parent;\n            var paramTag = node.parent.parent;\n            if (ts.isJSDocTypeExpression(node.parent) && ts.isJSDocParameterTag(paramTag)) {\n                // Else we will add a diagnostic, see `checkJSDocVariadicType`.\n                var host_1 = ts.getHostSignatureFromJSDoc(paramTag);\n                if (host_1) {\n                    /*\n                    Only return an array type if the corresponding parameter is marked as a rest parameter, or if there are no parameters.\n                    So in the following situation we will not create an array type:\n                        /** @param {...number} a * /\n                        function f(a) {}\n                    Because `a` will just be of type `number | undefined`. A synthetic `...args` will also be added, which *will* get an array type.\n                    */\n                    var lastParamDeclaration = ts.lastOrUndefined(host_1.parameters);\n                    var symbol = ts.getParameterSymbolFromJSDoc(paramTag);\n                    if (!lastParamDeclaration ||\n                        symbol && lastParamDeclaration.symbol === symbol && ts.isRestParameter(lastParamDeclaration)) {\n                        return createArrayType(type);\n                    }\n                }\n            }\n            if (ts.isParameter(parent) && ts.isJSDocFunctionType(parent.parent)) {\n                return createArrayType(type);\n            }\n            return addOptionality(type);\n        }\n        // Function and class expression bodies are checked after all statements in the enclosing body. This is\n        // to ensure constructs like the following are permitted:\n        //     const foo = function () {\n        //        const s = foo();\n        //        return \"hello\";\n        //     }\n        // Here, performing a full type check of the body of the function expression whilst in the process of\n        // determining the type of foo would cause foo to be given type any because of the recursive reference.\n        // Delaying the type check of the body ensures foo has been assigned a type.\n        function checkNodeDeferred(node) {\n            var enclosingFile = ts.getSourceFileOfNode(node);\n            var links = getNodeLinks(enclosingFile);\n            if (!(links.flags & 1 /* TypeChecked */)) {\n                links.deferredNodes = links.deferredNodes || new ts.Map();\n                var id = getNodeId(node);\n                links.deferredNodes.set(id, node);\n            }\n        }\n        function checkDeferredNodes(context) {\n            var links = getNodeLinks(context);\n            if (links.deferredNodes) {\n                links.deferredNodes.forEach(checkDeferredNode);\n            }\n        }\n        function checkDeferredNode(node) {\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"check\" /* Check */, \"checkDeferredNode\", { kind: node.kind, pos: node.pos, end: node.end });\n            var saveCurrentNode = currentNode;\n            currentNode = node;\n            instantiationCount = 0;\n            switch (node.kind) {\n                case 203 /* CallExpression */:\n                case 204 /* NewExpression */:\n                case 205 /* TaggedTemplateExpression */:\n                case 161 /* Decorator */:\n                case 275 /* JsxOpeningElement */:\n                    // These node kinds are deferred checked when overload resolution fails\n                    // To save on work, we ensure the arguments are checked just once, in\n                    // a deferred way\n                    resolveUntypedCall(node);\n                    break;\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                    checkFunctionExpressionOrObjectLiteralMethodDeferred(node);\n                    break;\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    checkAccessorDeclaration(node);\n                    break;\n                case 221 /* ClassExpression */:\n                    checkClassExpressionDeferred(node);\n                    break;\n                case 274 /* JsxSelfClosingElement */:\n                    checkJsxSelfClosingElementDeferred(node);\n                    break;\n                case 273 /* JsxElement */:\n                    checkJsxElementDeferred(node);\n                    break;\n            }\n            currentNode = saveCurrentNode;\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n        }\n        function checkSourceFile(node) {\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"check\" /* Check */, \"checkSourceFile\", { path: node.path }, /*separateBeginAndEnd*/ true);\n            ts.performance.mark(\"beforeCheck\");\n            checkSourceFileWorker(node);\n            ts.performance.mark(\"afterCheck\");\n            ts.performance.measure(\"Check\", \"beforeCheck\", \"afterCheck\");\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n        }\n        function unusedIsError(kind, isAmbient) {\n            if (isAmbient) {\n                return false;\n            }\n            switch (kind) {\n                case 0 /* Local */:\n                    return !!compilerOptions.noUnusedLocals;\n                case 1 /* Parameter */:\n                    return !!compilerOptions.noUnusedParameters;\n                default:\n                    return ts.Debug.assertNever(kind);\n            }\n        }\n        function getPotentiallyUnusedIdentifiers(sourceFile) {\n            return allPotentiallyUnusedIdentifiers.get(sourceFile.path) || ts.emptyArray;\n        }\n        // Fully type check a source file and collect the relevant diagnostics.\n        function checkSourceFileWorker(node) {\n            var links = getNodeLinks(node);\n            if (!(links.flags & 1 /* TypeChecked */)) {\n                if (ts.skipTypeChecking(node, compilerOptions, host)) {\n                    return;\n                }\n                // Grammar checking\n                checkGrammarSourceFile(node);\n                ts.clear(potentialThisCollisions);\n                ts.clear(potentialNewTargetCollisions);\n                ts.clear(potentialWeakMapCollisions);\n                ts.forEach(node.statements, checkSourceElement);\n                checkSourceElement(node.endOfFileToken);\n                checkDeferredNodes(node);\n                if (ts.isExternalOrCommonJsModule(node)) {\n                    registerForUnusedIdentifiersCheck(node);\n                }\n                if (!node.isDeclarationFile && (compilerOptions.noUnusedLocals || compilerOptions.noUnusedParameters)) {\n                    checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(node), function (containingNode, kind, diag) {\n                        if (!ts.containsParseError(containingNode) && unusedIsError(kind, !!(containingNode.flags & 8388608 /* Ambient */))) {\n                            diagnostics.add(diag);\n                        }\n                    });\n                }\n                if (compilerOptions.importsNotUsedAsValues === 2 /* Error */ &&\n                    !node.isDeclarationFile &&\n                    ts.isExternalModule(node)) {\n                    checkImportsForTypeOnlyConversion(node);\n                }\n                if (ts.isExternalOrCommonJsModule(node)) {\n                    checkExternalModuleExports(node);\n                }\n                if (potentialThisCollisions.length) {\n                    ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope);\n                    ts.clear(potentialThisCollisions);\n                }\n                if (potentialNewTargetCollisions.length) {\n                    ts.forEach(potentialNewTargetCollisions, checkIfNewTargetIsCapturedInEnclosingScope);\n                    ts.clear(potentialNewTargetCollisions);\n                }\n                if (potentialWeakMapCollisions.length) {\n                    ts.forEach(potentialWeakMapCollisions, checkWeakMapCollision);\n                    ts.clear(potentialWeakMapCollisions);\n                }\n                links.flags |= 1 /* TypeChecked */;\n            }\n        }\n        function getDiagnostics(sourceFile, ct) {\n            try {\n                // Record the cancellation token so it can be checked later on during checkSourceElement.\n                // Do this in a finally block so we can ensure that it gets reset back to nothing after\n                // this call is done.\n                cancellationToken = ct;\n                return getDiagnosticsWorker(sourceFile);\n            }\n            finally {\n                cancellationToken = undefined;\n            }\n        }\n        function getDiagnosticsWorker(sourceFile) {\n            throwIfNonDiagnosticsProducing();\n            if (sourceFile) {\n                // Some global diagnostics are deferred until they are needed and\n                // may not be reported in the first call to getGlobalDiagnostics.\n                // We should catch these changes and report them.\n                var previousGlobalDiagnostics = diagnostics.getGlobalDiagnostics();\n                var previousGlobalDiagnosticsSize = previousGlobalDiagnostics.length;\n                checkSourceFile(sourceFile);\n                var semanticDiagnostics = diagnostics.getDiagnostics(sourceFile.fileName);\n                var currentGlobalDiagnostics = diagnostics.getGlobalDiagnostics();\n                if (currentGlobalDiagnostics !== previousGlobalDiagnostics) {\n                    // If the arrays are not the same reference, new diagnostics were added.\n                    var deferredGlobalDiagnostics = ts.relativeComplement(previousGlobalDiagnostics, currentGlobalDiagnostics, ts.compareDiagnostics);\n                    return ts.concatenate(deferredGlobalDiagnostics, semanticDiagnostics);\n                }\n                else if (previousGlobalDiagnosticsSize === 0 && currentGlobalDiagnostics.length > 0) {\n                    // If the arrays are the same reference, but the length has changed, a single\n                    // new diagnostic was added as DiagnosticCollection attempts to reuse the\n                    // same array.\n                    return ts.concatenate(currentGlobalDiagnostics, semanticDiagnostics);\n                }\n                return semanticDiagnostics;\n            }\n            // Global diagnostics are always added when a file is not provided to\n            // getDiagnostics\n            ts.forEach(host.getSourceFiles(), checkSourceFile);\n            return diagnostics.getDiagnostics();\n        }\n        function getGlobalDiagnostics() {\n            throwIfNonDiagnosticsProducing();\n            return diagnostics.getGlobalDiagnostics();\n        }\n        function throwIfNonDiagnosticsProducing() {\n            if (!produceDiagnostics) {\n                throw new Error(\"Trying to get diagnostics from a type checker that does not produce them.\");\n            }\n        }\n        // Language service support\n        function getSymbolsInScope(location, meaning) {\n            if (location.flags & 16777216 /* InWithStatement */) {\n                // We cannot answer semantic questions within a with block, do not proceed any further\n                return [];\n            }\n            var symbols = ts.createSymbolTable();\n            var isStatic = false;\n            populateSymbols();\n            symbols.delete(\"this\" /* This */); // Not a symbol, a keyword\n            return symbolsToArray(symbols);\n            function populateSymbols() {\n                while (location) {\n                    if (location.locals && !isGlobalSourceFile(location)) {\n                        copySymbols(location.locals, meaning);\n                    }\n                    switch (location.kind) {\n                        case 297 /* SourceFile */:\n                            if (!ts.isExternalOrCommonJsModule(location))\n                                break;\n                        // falls through\n                        case 256 /* ModuleDeclaration */:\n                            copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */);\n                            break;\n                        case 255 /* EnumDeclaration */:\n                            copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */);\n                            break;\n                        case 221 /* ClassExpression */:\n                            var className = location.name;\n                            if (className) {\n                                copySymbol(location.symbol, meaning);\n                            }\n                        // this fall-through is necessary because we would like to handle\n                        // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration.\n                        // falls through\n                        case 252 /* ClassDeclaration */:\n                        case 253 /* InterfaceDeclaration */:\n                            // If we didn't come from static member of class or interface,\n                            // add the type parameters into the symbol table\n                            // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol.\n                            // Note: that the memberFlags come from previous iteration.\n                            if (!isStatic) {\n                                copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */);\n                            }\n                            break;\n                        case 208 /* FunctionExpression */:\n                            var funcName = location.name;\n                            if (funcName) {\n                                copySymbol(location.symbol, meaning);\n                            }\n                            break;\n                    }\n                    if (ts.introducesArgumentsExoticObject(location)) {\n                        copySymbol(argumentsSymbol, meaning);\n                    }\n                    isStatic = ts.hasSyntacticModifier(location, 32 /* Static */);\n                    location = location.parent;\n                }\n                copySymbols(globals, meaning);\n            }\n            /**\n             * Copy the given symbol into symbol tables if the symbol has the given meaning\n             * and it doesn't already existed in the symbol table\n             * @param key a key for storing in symbol table; if undefined, use symbol.name\n             * @param symbol the symbol to be added into symbol table\n             * @param meaning meaning of symbol to filter by before adding to symbol table\n             */\n            function copySymbol(symbol, meaning) {\n                if (ts.getCombinedLocalAndExportSymbolFlags(symbol) & meaning) {\n                    var id = symbol.escapedName;\n                    // We will copy all symbol regardless of its reserved name because\n                    // symbolsToArray will check whether the key is a reserved name and\n                    // it will not copy symbol with reserved name to the array\n                    if (!symbols.has(id)) {\n                        symbols.set(id, symbol);\n                    }\n                }\n            }\n            function copySymbols(source, meaning) {\n                if (meaning) {\n                    source.forEach(function (symbol) {\n                        copySymbol(symbol, meaning);\n                    });\n                }\n            }\n        }\n        function isTypeDeclarationName(name) {\n            return name.kind === 78 /* Identifier */ &&\n                isTypeDeclaration(name.parent) &&\n                ts.getNameOfDeclaration(name.parent) === name;\n        }\n        function isTypeDeclaration(node) {\n            switch (node.kind) {\n                case 159 /* TypeParameter */:\n                case 252 /* ClassDeclaration */:\n                case 253 /* InterfaceDeclaration */:\n                case 254 /* TypeAliasDeclaration */:\n                case 255 /* EnumDeclaration */:\n                case 331 /* JSDocTypedefTag */:\n                case 324 /* JSDocCallbackTag */:\n                case 325 /* JSDocEnumTag */:\n                    return true;\n                case 262 /* ImportClause */:\n                    return node.isTypeOnly;\n                case 265 /* ImportSpecifier */:\n                case 270 /* ExportSpecifier */:\n                    return node.parent.parent.isTypeOnly;\n                default:\n                    return false;\n            }\n        }\n        // True if the given identifier is part of a type reference\n        function isTypeReferenceIdentifier(node) {\n            while (node.parent.kind === 157 /* QualifiedName */) {\n                node = node.parent;\n            }\n            return node.parent.kind === 173 /* TypeReference */;\n        }\n        function isHeritageClauseElementIdentifier(node) {\n            while (node.parent.kind === 201 /* PropertyAccessExpression */) {\n                node = node.parent;\n            }\n            return node.parent.kind === 223 /* ExpressionWithTypeArguments */;\n        }\n        function isJSDocEntryNameReference(node) {\n            while (node.parent.kind === 157 /* QualifiedName */) {\n                node = node.parent;\n            }\n            while (node.parent.kind === 201 /* PropertyAccessExpression */) {\n                node = node.parent;\n            }\n            return node.parent.kind === 302 /* JSDocNameReference */;\n        }\n        function forEachEnclosingClass(node, callback) {\n            var result;\n            while (true) {\n                node = ts.getContainingClass(node);\n                if (!node)\n                    break;\n                if (result = callback(node))\n                    break;\n            }\n            return result;\n        }\n        function isNodeUsedDuringClassInitialization(node) {\n            return !!ts.findAncestor(node, function (element) {\n                if (ts.isConstructorDeclaration(element) && ts.nodeIsPresent(element.body) || ts.isPropertyDeclaration(element)) {\n                    return true;\n                }\n                else if (ts.isClassLike(element) || ts.isFunctionLikeDeclaration(element)) {\n                    return \"quit\";\n                }\n                return false;\n            });\n        }\n        function isNodeWithinClass(node, classDeclaration) {\n            return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; });\n        }\n        function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) {\n            while (nodeOnRightSide.parent.kind === 157 /* QualifiedName */) {\n                nodeOnRightSide = nodeOnRightSide.parent;\n            }\n            if (nodeOnRightSide.parent.kind === 260 /* ImportEqualsDeclaration */) {\n                return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined;\n            }\n            if (nodeOnRightSide.parent.kind === 266 /* ExportAssignment */) {\n                return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined;\n            }\n            return undefined;\n        }\n        function isInRightSideOfImportOrExportAssignment(node) {\n            return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined;\n        }\n        function getSpecialPropertyAssignmentSymbolFromEntityName(entityName) {\n            var specialPropertyAssignmentKind = ts.getAssignmentDeclarationKind(entityName.parent.parent);\n            switch (specialPropertyAssignmentKind) {\n                case 1 /* ExportsProperty */:\n                case 3 /* PrototypeProperty */:\n                    return getSymbolOfNode(entityName.parent);\n                case 4 /* ThisProperty */:\n                case 2 /* ModuleExports */:\n                case 5 /* Property */:\n                    return getSymbolOfNode(entityName.parent.parent);\n            }\n        }\n        function isImportTypeQualifierPart(node) {\n            var parent = node.parent;\n            while (ts.isQualifiedName(parent)) {\n                node = parent;\n                parent = parent.parent;\n            }\n            if (parent && parent.kind === 195 /* ImportType */ && parent.qualifier === node) {\n                return parent;\n            }\n            return undefined;\n        }\n        function getSymbolOfNameOrPropertyAccessExpression(name) {\n            if (ts.isDeclarationName(name)) {\n                return getSymbolOfNode(name.parent);\n            }\n            if (ts.isInJSFile(name) &&\n                name.parent.kind === 201 /* PropertyAccessExpression */ &&\n                name.parent === name.parent.parent.left) {\n                // Check if this is a special property assignment\n                if (!ts.isPrivateIdentifier(name)) {\n                    var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(name);\n                    if (specialPropertyAssignmentSymbol) {\n                        return specialPropertyAssignmentSymbol;\n                    }\n                }\n            }\n            if (name.parent.kind === 266 /* ExportAssignment */ && ts.isEntityNameExpression(name)) {\n                // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression\n                var success = resolveEntityName(name, \n                /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true);\n                if (success && success !== unknownSymbol) {\n                    return success;\n                }\n            }\n            else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) {\n                // Since we already checked for ExportAssignment, this really could only be an Import\n                var importEqualsDeclaration = ts.getAncestor(name, 260 /* ImportEqualsDeclaration */);\n                ts.Debug.assert(importEqualsDeclaration !== undefined);\n                return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true);\n            }\n            if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name)) {\n                var possibleImportNode = isImportTypeQualifierPart(name);\n                if (possibleImportNode) {\n                    getTypeFromTypeNode(possibleImportNode);\n                    var sym = getNodeLinks(name).resolvedSymbol;\n                    return sym === unknownSymbol ? undefined : sym;\n                }\n            }\n            while (ts.isRightSideOfQualifiedNameOrPropertyAccess(name)) {\n                name = name.parent;\n            }\n            if (isHeritageClauseElementIdentifier(name)) {\n                var meaning = 0 /* None */;\n                // In an interface or class, we're definitely interested in a type.\n                if (name.parent.kind === 223 /* ExpressionWithTypeArguments */) {\n                    meaning = 788968 /* Type */;\n                    // In a class 'extends' clause we are also looking for a value.\n                    if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) {\n                        meaning |= 111551 /* Value */;\n                    }\n                }\n                else {\n                    meaning = 1920 /* Namespace */;\n                }\n                meaning |= 2097152 /* Alias */;\n                var entityNameSymbol = ts.isEntityNameExpression(name) ? resolveEntityName(name, meaning) : undefined;\n                if (entityNameSymbol) {\n                    return entityNameSymbol;\n                }\n            }\n            if (name.parent.kind === 326 /* JSDocParameterTag */) {\n                return ts.getParameterSymbolFromJSDoc(name.parent);\n            }\n            if (name.parent.kind === 159 /* TypeParameter */ && name.parent.parent.kind === 330 /* JSDocTemplateTag */) {\n                ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true.\n                var typeParameter = ts.getTypeParameterFromJsDoc(name.parent);\n                return typeParameter && typeParameter.symbol;\n            }\n            if (ts.isExpressionNode(name)) {\n                if (ts.nodeIsMissing(name)) {\n                    // Missing entity name.\n                    return undefined;\n                }\n                if (name.kind === 78 /* Identifier */) {\n                    if (ts.isJSXTagName(name) && isJsxIntrinsicIdentifier(name)) {\n                        var symbol = getIntrinsicTagSymbol(name.parent);\n                        return symbol === unknownSymbol ? undefined : symbol;\n                    }\n                    return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true);\n                }\n                else if (name.kind === 201 /* PropertyAccessExpression */ || name.kind === 157 /* QualifiedName */) {\n                    var links = getNodeLinks(name);\n                    if (links.resolvedSymbol) {\n                        return links.resolvedSymbol;\n                    }\n                    if (name.kind === 201 /* PropertyAccessExpression */) {\n                        checkPropertyAccessExpression(name);\n                    }\n                    else {\n                        checkQualifiedName(name);\n                    }\n                    return links.resolvedSymbol;\n                }\n            }\n            else if (isTypeReferenceIdentifier(name)) {\n                var meaning = name.parent.kind === 173 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */;\n                return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true);\n            }\n            else if (isJSDocEntryNameReference(name)) {\n                var meaning = 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */;\n                return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true, ts.getHostSignatureFromJSDoc(name));\n            }\n            if (name.parent.kind === 172 /* TypePredicate */) {\n                return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */);\n            }\n            // Do we want to return undefined here?\n            return undefined;\n        }\n        function getSymbolAtLocation(node, ignoreErrors) {\n            if (node.kind === 297 /* SourceFile */) {\n                return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined;\n            }\n            var parent = node.parent;\n            var grandParent = parent.parent;\n            if (node.flags & 16777216 /* InWithStatement */) {\n                // We cannot answer semantic questions within a with block, do not proceed any further\n                return undefined;\n            }\n            if (isDeclarationNameOrImportPropertyName(node)) {\n                // This is a declaration, call getSymbolOfNode\n                var parentSymbol = getSymbolOfNode(parent);\n                return ts.isImportOrExportSpecifier(node.parent) && node.parent.propertyName === node\n                    ? getImmediateAliasedSymbol(parentSymbol)\n                    : parentSymbol;\n            }\n            else if (ts.isLiteralComputedPropertyDeclarationName(node)) {\n                return getSymbolOfNode(parent.parent);\n            }\n            if (node.kind === 78 /* Identifier */) {\n                if (isInRightSideOfImportOrExportAssignment(node)) {\n                    return getSymbolOfNameOrPropertyAccessExpression(node);\n                }\n                else if (parent.kind === 198 /* BindingElement */ &&\n                    grandParent.kind === 196 /* ObjectBindingPattern */ &&\n                    node === parent.propertyName) {\n                    var typeOfPattern = getTypeOfNode(grandParent);\n                    var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText);\n                    if (propertyDeclaration) {\n                        return propertyDeclaration;\n                    }\n                }\n            }\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                case 79 /* PrivateIdentifier */:\n                case 201 /* PropertyAccessExpression */:\n                case 157 /* QualifiedName */:\n                    return getSymbolOfNameOrPropertyAccessExpression(node);\n                case 107 /* ThisKeyword */:\n                    var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false);\n                    if (ts.isFunctionLike(container)) {\n                        var sig = getSignatureFromDeclaration(container);\n                        if (sig.thisParameter) {\n                            return sig.thisParameter;\n                        }\n                    }\n                    if (ts.isInExpressionContext(node)) {\n                        return checkExpression(node).symbol;\n                    }\n                // falls through\n                case 187 /* ThisType */:\n                    return getTypeFromThisTypeNode(node).symbol;\n                case 105 /* SuperKeyword */:\n                    return checkExpression(node).symbol;\n                case 132 /* ConstructorKeyword */:\n                    // constructor keyword for an overload, should take us to the definition if it exist\n                    var constructorDeclaration = node.parent;\n                    if (constructorDeclaration && constructorDeclaration.kind === 166 /* Constructor */) {\n                        return constructorDeclaration.parent.symbol;\n                    }\n                    return undefined;\n                case 10 /* StringLiteral */:\n                case 14 /* NoSubstitutionTemplateLiteral */:\n                    // 1). import x = require(\"./mo/*gotToDefinitionHere*/d\")\n                    // 2). External module name in an import declaration\n                    // 3). Dynamic import call or require in javascript\n                    // 4). type A = import(\"./f/*gotToDefinitionHere*/oo\")\n                    if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) ||\n                        ((node.parent.kind === 261 /* ImportDeclaration */ || node.parent.kind === 267 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) ||\n                        ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) ||\n                        (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) {\n                        return resolveExternalModuleName(node, node, ignoreErrors);\n                    }\n                    if (ts.isCallExpression(parent) && ts.isBindableObjectDefinePropertyCall(parent) && parent.arguments[1] === node) {\n                        return getSymbolOfNode(parent);\n                    }\n                // falls through\n                case 8 /* NumericLiteral */:\n                    // index access\n                    var objectType = ts.isElementAccessExpression(parent)\n                        ? parent.argumentExpression === node ? getTypeOfExpression(parent.expression) : undefined\n                        : ts.isLiteralTypeNode(parent) && ts.isIndexedAccessTypeNode(grandParent)\n                            ? getTypeFromTypeNode(grandParent.objectType)\n                            : undefined;\n                    return objectType && getPropertyOfType(objectType, ts.escapeLeadingUnderscores(node.text));\n                case 87 /* DefaultKeyword */:\n                case 97 /* FunctionKeyword */:\n                case 38 /* EqualsGreaterThanToken */:\n                case 83 /* ClassKeyword */:\n                    return getSymbolOfNode(node.parent);\n                case 195 /* ImportType */:\n                    return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined;\n                case 92 /* ExportKeyword */:\n                    return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined;\n                default:\n                    return undefined;\n            }\n        }\n        function getShorthandAssignmentValueSymbol(location) {\n            if (location && location.kind === 289 /* ShorthandPropertyAssignment */) {\n                return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */);\n            }\n            return undefined;\n        }\n        /** Returns the target of an export specifier without following aliases */\n        function getExportSpecifierLocalTargetSymbol(node) {\n            if (ts.isExportSpecifier(node)) {\n                return node.parent.parent.moduleSpecifier ?\n                    getExternalModuleMember(node.parent.parent, node) :\n                    resolveEntityName(node.propertyName || node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */);\n            }\n            else {\n                return resolveEntityName(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */);\n            }\n        }\n        function getTypeOfNode(node) {\n            if (ts.isSourceFile(node) && !ts.isExternalModule(node)) {\n                return errorType;\n            }\n            if (node.flags & 16777216 /* InWithStatement */) {\n                // We cannot answer semantic questions within a with block, do not proceed any further\n                return errorType;\n            }\n            var classDecl = ts.tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node);\n            var classType = classDecl && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(classDecl.class));\n            if (ts.isPartOfTypeNode(node)) {\n                var typeFromTypeNode = getTypeFromTypeNode(node);\n                return classType ? getTypeWithThisArgument(typeFromTypeNode, classType.thisType) : typeFromTypeNode;\n            }\n            if (ts.isExpressionNode(node)) {\n                return getRegularTypeOfExpression(node);\n            }\n            if (classType && !classDecl.isImplements) {\n                // A SyntaxKind.ExpressionWithTypeArguments is considered a type node, except when it occurs in the\n                // extends clause of a class. We handle that case here.\n                var baseType = ts.firstOrUndefined(getBaseTypes(classType));\n                return baseType ? getTypeWithThisArgument(baseType, classType.thisType) : errorType;\n            }\n            if (isTypeDeclaration(node)) {\n                // In this case, we call getSymbolOfNode instead of getSymbolAtLocation because it is a declaration\n                var symbol = getSymbolOfNode(node);\n                return getDeclaredTypeOfSymbol(symbol);\n            }\n            if (isTypeDeclarationName(node)) {\n                var symbol = getSymbolAtLocation(node);\n                return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType;\n            }\n            if (ts.isDeclaration(node)) {\n                // In this case, we call getSymbolOfNode instead of getSymbolAtLocation because it is a declaration\n                var symbol = getSymbolOfNode(node);\n                return getTypeOfSymbol(symbol);\n            }\n            if (isDeclarationNameOrImportPropertyName(node)) {\n                var symbol = getSymbolAtLocation(node);\n                if (symbol) {\n                    return getTypeOfSymbol(symbol);\n                }\n                return errorType;\n            }\n            if (ts.isBindingPattern(node)) {\n                return getTypeForVariableLikeDeclaration(node.parent, /*includeOptionality*/ true) || errorType;\n            }\n            if (isInRightSideOfImportOrExportAssignment(node)) {\n                var symbol = getSymbolAtLocation(node);\n                if (symbol) {\n                    var declaredType = getDeclaredTypeOfSymbol(symbol);\n                    return declaredType !== errorType ? declaredType : getTypeOfSymbol(symbol);\n                }\n            }\n            return errorType;\n        }\n        // Gets the type of object literal or array literal of destructuring assignment.\n        // { a } from\n        //     for ( { a } of elems) {\n        //     }\n        // [ a ] from\n        //     [a] = [ some array ...]\n        function getTypeOfAssignmentPattern(expr) {\n            ts.Debug.assert(expr.kind === 200 /* ObjectLiteralExpression */ || expr.kind === 199 /* ArrayLiteralExpression */);\n            // If this is from \"for of\"\n            //     for ( { a } of elems) {\n            //     }\n            if (expr.parent.kind === 239 /* ForOfStatement */) {\n                var iteratedType = checkRightHandSideOfForOf(expr.parent);\n                return checkDestructuringAssignment(expr, iteratedType || errorType);\n            }\n            // If this is from \"for\" initializer\n            //     for ({a } = elems[0];.....) { }\n            if (expr.parent.kind === 216 /* BinaryExpression */) {\n                var iteratedType = getTypeOfExpression(expr.parent.right);\n                return checkDestructuringAssignment(expr, iteratedType || errorType);\n            }\n            // If this is from nested object binding pattern\n            //     for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) {\n            if (expr.parent.kind === 288 /* PropertyAssignment */) {\n                var node_2 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression);\n                var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_2) || errorType;\n                var propertyIndex = ts.indexOfNode(node_2.properties, expr.parent);\n                return checkObjectLiteralDestructuringPropertyAssignment(node_2, typeOfParentObjectLiteral, propertyIndex);\n            }\n            // Array literal assignment - array destructuring pattern\n            var node = ts.cast(expr.parent, ts.isArrayLiteralExpression);\n            //    [{ property1: p1, property2 }] = elems;\n            var typeOfArrayLiteral = getTypeOfAssignmentPattern(node) || errorType;\n            var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */, typeOfArrayLiteral, undefinedType, expr.parent) || errorType;\n            return checkArrayLiteralDestructuringElementAssignment(node, typeOfArrayLiteral, node.elements.indexOf(expr), elementType);\n        }\n        // Gets the property symbol corresponding to the property in destructuring assignment\n        // 'property1' from\n        //     for ( { property1: a } of elems) {\n        //     }\n        // 'property1' at location 'a' from:\n        //     [a] = [ property1, property2 ]\n        function getPropertySymbolOfDestructuringAssignment(location) {\n            // Get the type of the object or array literal and then look for property of given name in the type\n            var typeOfObjectLiteral = getTypeOfAssignmentPattern(ts.cast(location.parent.parent, ts.isAssignmentPattern));\n            return typeOfObjectLiteral && getPropertyOfType(typeOfObjectLiteral, location.escapedText);\n        }\n        function getRegularTypeOfExpression(expr) {\n            if (ts.isRightSideOfQualifiedNameOrPropertyAccess(expr)) {\n                expr = expr.parent;\n            }\n            return getRegularTypeOfLiteralType(getTypeOfExpression(expr));\n        }\n        /**\n         * Gets either the static or instance type of a class element, based on\n         * whether the element is declared as \"static\".\n         */\n        function getParentTypeOfClassElement(node) {\n            var classSymbol = getSymbolOfNode(node.parent);\n            return ts.hasSyntacticModifier(node, 32 /* Static */)\n                ? getTypeOfSymbol(classSymbol)\n                : getDeclaredTypeOfSymbol(classSymbol);\n        }\n        function getClassElementPropertyKeyType(element) {\n            var name = element.name;\n            switch (name.kind) {\n                case 78 /* Identifier */:\n                    return getLiteralType(ts.idText(name));\n                case 8 /* NumericLiteral */:\n                case 10 /* StringLiteral */:\n                    return getLiteralType(name.text);\n                case 158 /* ComputedPropertyName */:\n                    var nameType = checkComputedPropertyName(name);\n                    return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType;\n                default:\n                    return ts.Debug.fail(\"Unsupported property name.\");\n            }\n        }\n        // Return the list of properties of the given type, augmented with properties from Function\n        // if the type has call or construct signatures\n        function getAugmentedPropertiesOfType(type) {\n            type = getApparentType(type);\n            var propsByName = ts.createSymbolTable(getPropertiesOfType(type));\n            var functionType = getSignaturesOfType(type, 0 /* Call */).length ? globalCallableFunctionType :\n                getSignaturesOfType(type, 1 /* Construct */).length ? globalNewableFunctionType :\n                    undefined;\n            if (functionType) {\n                ts.forEach(getPropertiesOfType(functionType), function (p) {\n                    if (!propsByName.has(p.escapedName)) {\n                        propsByName.set(p.escapedName, p);\n                    }\n                });\n            }\n            return getNamedMembers(propsByName);\n        }\n        function typeHasCallOrConstructSignatures(type) {\n            return ts.typeHasCallOrConstructSignatures(type, checker);\n        }\n        function getRootSymbols(symbol) {\n            var roots = getImmediateRootSymbols(symbol);\n            return roots ? ts.flatMap(roots, getRootSymbols) : [symbol];\n        }\n        function getImmediateRootSymbols(symbol) {\n            if (ts.getCheckFlags(symbol) & 6 /* Synthetic */) {\n                return ts.mapDefined(getSymbolLinks(symbol).containingType.types, function (type) { return getPropertyOfType(type, symbol.escapedName); });\n            }\n            else if (symbol.flags & 33554432 /* Transient */) {\n                var _a = symbol, leftSpread = _a.leftSpread, rightSpread = _a.rightSpread, syntheticOrigin = _a.syntheticOrigin;\n                return leftSpread ? [leftSpread, rightSpread]\n                    : syntheticOrigin ? [syntheticOrigin]\n                        : ts.singleElementArray(tryGetAliasTarget(symbol));\n            }\n            return undefined;\n        }\n        function tryGetAliasTarget(symbol) {\n            var target;\n            var next = symbol;\n            while (next = getSymbolLinks(next).target) {\n                target = next;\n            }\n            return target;\n        }\n        // Emitter support\n        function isArgumentsLocalBinding(nodeIn) {\n            // Note: does not handle isShorthandPropertyAssignment (and probably a few more)\n            if (ts.isGeneratedIdentifier(nodeIn))\n                return false;\n            var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);\n            if (!node)\n                return false;\n            var parent = node.parent;\n            if (!parent)\n                return false;\n            var isPropertyName = ((ts.isPropertyAccessExpression(parent)\n                || ts.isPropertyAssignment(parent))\n                && parent.name === node);\n            return !isPropertyName && getReferencedValueSymbol(node) === argumentsSymbol;\n        }\n        function moduleExportsSomeValue(moduleReferenceExpression) {\n            var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression);\n            if (!moduleSymbol || ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {\n                // If the module is not found or is shorthand, assume that it may export a value.\n                return true;\n            }\n            var hasExportAssignment = hasExportAssignmentSymbol(moduleSymbol);\n            // if module has export assignment then 'resolveExternalModuleSymbol' will return resolved symbol for export assignment\n            // otherwise it will return moduleSymbol itself\n            moduleSymbol = resolveExternalModuleSymbol(moduleSymbol);\n            var symbolLinks = getSymbolLinks(moduleSymbol);\n            if (symbolLinks.exportsSomeValue === undefined) {\n                // for export assignments - check if resolved symbol for RHS is itself a value\n                // otherwise - check if at least one export is value\n                symbolLinks.exportsSomeValue = hasExportAssignment\n                    ? !!(moduleSymbol.flags & 111551 /* Value */)\n                    : ts.forEachEntry(getExportsOfModule(moduleSymbol), isValue);\n            }\n            return symbolLinks.exportsSomeValue;\n            function isValue(s) {\n                s = resolveSymbol(s);\n                return s && !!(s.flags & 111551 /* Value */);\n            }\n        }\n        function isNameOfModuleOrEnumDeclaration(node) {\n            return ts.isModuleOrEnumDeclaration(node.parent) && node === node.parent.name;\n        }\n        // When resolved as an expression identifier, if the given node references an exported entity, return the declaration\n        // node of the exported entity's container. Otherwise, return undefined.\n        function getReferencedExportContainer(nodeIn, prefixLocals) {\n            var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);\n            if (node) {\n                // When resolving the export container for the name of a module or enum\n                // declaration, we need to start resolution at the declaration's container.\n                // Otherwise, we could incorrectly resolve the export container as the\n                // declaration if it contains an exported member with the same name.\n                var symbol = getReferencedValueSymbol(node, /*startInDeclarationContainer*/ isNameOfModuleOrEnumDeclaration(node));\n                if (symbol) {\n                    if (symbol.flags & 1048576 /* ExportValue */) {\n                        // If we reference an exported entity within the same module declaration, then whether\n                        // we prefix depends on the kind of entity. SymbolFlags.ExportHasLocal encompasses all the\n                        // kinds that we do NOT prefix.\n                        var exportSymbol = getMergedSymbol(symbol.exportSymbol);\n                        if (!prefixLocals && exportSymbol.flags & 944 /* ExportHasLocal */ && !(exportSymbol.flags & 3 /* Variable */)) {\n                            return undefined;\n                        }\n                        symbol = exportSymbol;\n                    }\n                    var parentSymbol_1 = getParentOfSymbol(symbol);\n                    if (parentSymbol_1) {\n                        if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 297 /* SourceFile */) {\n                            var symbolFile = parentSymbol_1.valueDeclaration;\n                            var referenceFile = ts.getSourceFileOfNode(node);\n                            // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined.\n                            var symbolIsUmdExport = symbolFile !== referenceFile;\n                            return symbolIsUmdExport ? undefined : symbolFile;\n                        }\n                        return ts.findAncestor(node.parent, function (n) { return ts.isModuleOrEnumDeclaration(n) && getSymbolOfNode(n) === parentSymbol_1; });\n                    }\n                }\n            }\n        }\n        // When resolved as an expression identifier, if the given node references an import, return the declaration of\n        // that import. Otherwise, return undefined.\n        function getReferencedImportDeclaration(nodeIn) {\n            if (nodeIn.generatedImportReference) {\n                return nodeIn.generatedImportReference;\n            }\n            var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);\n            if (node) {\n                var symbol = getReferencedValueSymbol(node);\n                // We should only get the declaration of an alias if there isn't a local value\n                // declaration for the symbol\n                if (isNonLocalAlias(symbol, /*excludes*/ 111551 /* Value */) && !getTypeOnlyAliasDeclaration(symbol)) {\n                    return getDeclarationOfAliasSymbol(symbol);\n                }\n            }\n            return undefined;\n        }\n        function isSymbolOfDestructuredElementOfCatchBinding(symbol) {\n            return ts.isBindingElement(symbol.valueDeclaration)\n                && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 287 /* CatchClause */;\n        }\n        function isSymbolOfDeclarationWithCollidingName(symbol) {\n            if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) {\n                var links = getSymbolLinks(symbol);\n                if (links.isDeclarationWithCollidingName === undefined) {\n                    var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration);\n                    if (ts.isStatementWithLocals(container) || isSymbolOfDestructuredElementOfCatchBinding(symbol)) {\n                        var nodeLinks_1 = getNodeLinks(symbol.valueDeclaration);\n                        if (resolveName(container.parent, symbol.escapedName, 111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)) {\n                            // redeclaration - always should be renamed\n                            links.isDeclarationWithCollidingName = true;\n                        }\n                        else if (nodeLinks_1.flags & 262144 /* CapturedBlockScopedBinding */) {\n                            // binding is captured in the function\n                            // should be renamed if:\n                            // - binding is not top level - top level bindings never collide with anything\n                            // AND\n                            //   - binding is not declared in loop, should be renamed to avoid name reuse across siblings\n                            //     let a, b\n                            //     { let x = 1; a = () => x; }\n                            //     { let x = 100; b = () => x; }\n                            //     console.log(a()); // should print '1'\n                            //     console.log(b()); // should print '100'\n                            //     OR\n                            //   - binding is declared inside loop but not in inside initializer of iteration statement or directly inside loop body\n                            //     * variables from initializer are passed to rewritten loop body as parameters so they are not captured directly\n                            //     * variables that are declared immediately in loop body will become top level variable after loop is rewritten and thus\n                            //       they will not collide with anything\n                            var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */;\n                            var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false);\n                            var inLoopBodyBlock = container.kind === 230 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false);\n                            links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock));\n                        }\n                        else {\n                            links.isDeclarationWithCollidingName = false;\n                        }\n                    }\n                }\n                return links.isDeclarationWithCollidingName;\n            }\n            return false;\n        }\n        // When resolved as an expression identifier, if the given node references a nested block scoped entity with\n        // a name that either hides an existing name or might hide it when compiled downlevel,\n        // return the declaration of that entity. Otherwise, return undefined.\n        function getReferencedDeclarationWithCollidingName(nodeIn) {\n            if (!ts.isGeneratedIdentifier(nodeIn)) {\n                var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);\n                if (node) {\n                    var symbol = getReferencedValueSymbol(node);\n                    if (symbol && isSymbolOfDeclarationWithCollidingName(symbol)) {\n                        return symbol.valueDeclaration;\n                    }\n                }\n            }\n            return undefined;\n        }\n        // Return true if the given node is a declaration of a nested block scoped entity with a name that either hides an\n        // existing name or might hide a name when compiled downlevel\n        function isDeclarationWithCollidingName(nodeIn) {\n            var node = ts.getParseTreeNode(nodeIn, ts.isDeclaration);\n            if (node) {\n                var symbol = getSymbolOfNode(node);\n                if (symbol) {\n                    return isSymbolOfDeclarationWithCollidingName(symbol);\n                }\n            }\n            return false;\n        }\n        function isValueAliasDeclaration(node) {\n            switch (node.kind) {\n                case 260 /* ImportEqualsDeclaration */:\n                    return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol);\n                case 262 /* ImportClause */:\n                case 263 /* NamespaceImport */:\n                case 265 /* ImportSpecifier */:\n                case 270 /* ExportSpecifier */:\n                    var symbol = getSymbolOfNode(node) || unknownSymbol;\n                    return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol);\n                case 267 /* ExportDeclaration */:\n                    var exportClause = node.exportClause;\n                    return !!exportClause && (ts.isNamespaceExport(exportClause) ||\n                        ts.some(exportClause.elements, isValueAliasDeclaration));\n                case 266 /* ExportAssignment */:\n                    return node.expression && node.expression.kind === 78 /* Identifier */ ?\n                        isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) :\n                        true;\n            }\n            return false;\n        }\n        function isTopLevelValueImportEqualsWithEntityName(nodeIn) {\n            var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration);\n            if (node === undefined || node.parent.kind !== 297 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) {\n                // parent is not source file or it is not reference to internal module\n                return false;\n            }\n            var isValue = isAliasResolvedToValue(getSymbolOfNode(node));\n            return isValue && node.moduleReference && !ts.nodeIsMissing(node.moduleReference);\n        }\n        function isAliasResolvedToValue(symbol) {\n            var target = resolveAlias(symbol);\n            if (target === unknownSymbol) {\n                return true;\n            }\n            // const enums and modules that contain only const enums are not considered values from the emit perspective\n            // unless 'preserveConstEnums' option is set to true\n            return !!(target.flags & 111551 /* Value */) &&\n                (ts.shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target));\n        }\n        function isConstEnumOrConstEnumOnlyModule(s) {\n            return isConstEnumSymbol(s) || !!s.constEnumOnlyModule;\n        }\n        function isReferencedAliasDeclaration(node, checkChildren) {\n            if (isAliasSymbolDeclaration(node)) {\n                var symbol = getSymbolOfNode(node);\n                var links = symbol && getSymbolLinks(symbol);\n                if (links === null || links === void 0 ? void 0 : links.referenced) {\n                    return true;\n                }\n                var target = getSymbolLinks(symbol).target; // TODO: GH#18217\n                if (target && ts.getEffectiveModifierFlags(node) & 1 /* Export */ &&\n                    target.flags & 111551 /* Value */ &&\n                    (ts.shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {\n                    // An `export import ... =` of a value symbol is always considered referenced\n                    return true;\n                }\n            }\n            if (checkChildren) {\n                return !!ts.forEachChild(node, function (node) { return isReferencedAliasDeclaration(node, checkChildren); });\n            }\n            return false;\n        }\n        function isImplementationOfOverload(node) {\n            if (ts.nodeIsPresent(node.body)) {\n                if (ts.isGetAccessor(node) || ts.isSetAccessor(node))\n                    return false; // Get or set accessors can never be overload implementations, but can have up to 2 signatures\n                var symbol = getSymbolOfNode(node);\n                var signaturesOfSymbol = getSignaturesOfSymbol(symbol);\n                // If this function body corresponds to function with multiple signature, it is implementation of overload\n                // e.g.: function foo(a: string): string;\n                //       function foo(a: number): number;\n                //       function foo(a: any) { // This is implementation of the overloads\n                //           return a;\n                //       }\n                return signaturesOfSymbol.length > 1 ||\n                    // If there is single signature for the symbol, it is overload if that signature isn't coming from the node\n                    // e.g.: function foo(a: string): string;\n                    //       function foo(a: any) { // This is implementation of the overloads\n                    //           return a;\n                    //       }\n                    (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node);\n            }\n            return false;\n        }\n        function isRequiredInitializedParameter(parameter) {\n            return !!strictNullChecks &&\n                !isOptionalParameter(parameter) &&\n                !ts.isJSDocParameterTag(parameter) &&\n                !!parameter.initializer &&\n                !ts.hasSyntacticModifier(parameter, 92 /* ParameterPropertyModifier */);\n        }\n        function isOptionalUninitializedParameterProperty(parameter) {\n            return strictNullChecks &&\n                isOptionalParameter(parameter) &&\n                !parameter.initializer &&\n                ts.hasSyntacticModifier(parameter, 92 /* ParameterPropertyModifier */);\n        }\n        function isOptionalUninitializedParameter(parameter) {\n            return !!strictNullChecks &&\n                isOptionalParameter(parameter) &&\n                !parameter.initializer;\n        }\n        function isExpandoFunctionDeclaration(node) {\n            var declaration = ts.getParseTreeNode(node, ts.isFunctionDeclaration);\n            if (!declaration) {\n                return false;\n            }\n            var symbol = getSymbolOfNode(declaration);\n            if (!symbol || !(symbol.flags & 16 /* Function */)) {\n                return false;\n            }\n            return !!ts.forEachEntry(getExportsOfSymbol(symbol), function (p) { return p.flags & 111551 /* Value */ && p.valueDeclaration && ts.isPropertyAccessExpression(p.valueDeclaration); });\n        }\n        function getPropertiesOfContainerFunction(node) {\n            var declaration = ts.getParseTreeNode(node, ts.isFunctionDeclaration);\n            if (!declaration) {\n                return ts.emptyArray;\n            }\n            var symbol = getSymbolOfNode(declaration);\n            return symbol && getPropertiesOfType(getTypeOfSymbol(symbol)) || ts.emptyArray;\n        }\n        function getNodeCheckFlags(node) {\n            return getNodeLinks(node).flags || 0;\n        }\n        function getEnumMemberValue(node) {\n            computeEnumMemberValues(node.parent);\n            return getNodeLinks(node).enumMemberValue;\n        }\n        function canHaveConstantValue(node) {\n            switch (node.kind) {\n                case 291 /* EnumMember */:\n                case 201 /* PropertyAccessExpression */:\n                case 202 /* ElementAccessExpression */:\n                    return true;\n            }\n            return false;\n        }\n        function getConstantValue(node) {\n            if (node.kind === 291 /* EnumMember */) {\n                return getEnumMemberValue(node);\n            }\n            var symbol = getNodeLinks(node).resolvedSymbol;\n            if (symbol && (symbol.flags & 8 /* EnumMember */)) {\n                // inline property\\index accesses only for const enums\n                var member = symbol.valueDeclaration;\n                if (ts.isEnumConst(member.parent)) {\n                    return getEnumMemberValue(member);\n                }\n            }\n            return undefined;\n        }\n        function isFunctionType(type) {\n            return !!(type.flags & 524288 /* Object */) && getSignaturesOfType(type, 0 /* Call */).length > 0;\n        }\n        function getTypeReferenceSerializationKind(typeNameIn, location) {\n            var _a;\n            // ensure both `typeName` and `location` are parse tree nodes.\n            var typeName = ts.getParseTreeNode(typeNameIn, ts.isEntityName);\n            if (!typeName)\n                return ts.TypeReferenceSerializationKind.Unknown;\n            if (location) {\n                location = ts.getParseTreeNode(location);\n                if (!location)\n                    return ts.TypeReferenceSerializationKind.Unknown;\n            }\n            // Resolve the symbol as a value to ensure the type can be reached at runtime during emit.\n            var valueSymbol = resolveEntityName(typeName, 111551 /* Value */, /*ignoreErrors*/ true, /*dontResolveAlias*/ true, location);\n            var isTypeOnly = ((_a = valueSymbol === null || valueSymbol === void 0 ? void 0 : valueSymbol.declarations) === null || _a === void 0 ? void 0 : _a.every(ts.isTypeOnlyImportOrExportDeclaration)) || false;\n            var resolvedSymbol = valueSymbol && valueSymbol.flags & 2097152 /* Alias */ ? resolveAlias(valueSymbol) : valueSymbol;\n            // Resolve the symbol as a type so that we can provide a more useful hint for the type serializer.\n            var typeSymbol = resolveEntityName(typeName, 788968 /* Type */, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, location);\n            if (resolvedSymbol && resolvedSymbol === typeSymbol) {\n                var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(/*reportErrors*/ false);\n                if (globalPromiseSymbol && resolvedSymbol === globalPromiseSymbol) {\n                    return ts.TypeReferenceSerializationKind.Promise;\n                }\n                var constructorType = getTypeOfSymbol(resolvedSymbol);\n                if (constructorType && isConstructorType(constructorType)) {\n                    return isTypeOnly ? ts.TypeReferenceSerializationKind.TypeWithCallSignature : ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue;\n                }\n            }\n            // We might not be able to resolve type symbol so use unknown type in that case (eg error case)\n            if (!typeSymbol) {\n                return isTypeOnly ? ts.TypeReferenceSerializationKind.ObjectType : ts.TypeReferenceSerializationKind.Unknown;\n            }\n            var type = getDeclaredTypeOfSymbol(typeSymbol);\n            if (type === errorType) {\n                return isTypeOnly ? ts.TypeReferenceSerializationKind.ObjectType : ts.TypeReferenceSerializationKind.Unknown;\n            }\n            else if (type.flags & 3 /* AnyOrUnknown */) {\n                return ts.TypeReferenceSerializationKind.ObjectType;\n            }\n            else if (isTypeAssignableToKind(type, 16384 /* Void */ | 98304 /* Nullable */ | 131072 /* Never */)) {\n                return ts.TypeReferenceSerializationKind.VoidNullableOrNeverType;\n            }\n            else if (isTypeAssignableToKind(type, 528 /* BooleanLike */)) {\n                return ts.TypeReferenceSerializationKind.BooleanType;\n            }\n            else if (isTypeAssignableToKind(type, 296 /* NumberLike */)) {\n                return ts.TypeReferenceSerializationKind.NumberLikeType;\n            }\n            else if (isTypeAssignableToKind(type, 2112 /* BigIntLike */)) {\n                return ts.TypeReferenceSerializationKind.BigIntLikeType;\n            }\n            else if (isTypeAssignableToKind(type, 402653316 /* StringLike */)) {\n                return ts.TypeReferenceSerializationKind.StringLikeType;\n            }\n            else if (isTupleType(type)) {\n                return ts.TypeReferenceSerializationKind.ArrayLikeType;\n            }\n            else if (isTypeAssignableToKind(type, 12288 /* ESSymbolLike */)) {\n                return ts.TypeReferenceSerializationKind.ESSymbolType;\n            }\n            else if (isFunctionType(type)) {\n                return ts.TypeReferenceSerializationKind.TypeWithCallSignature;\n            }\n            else if (isArrayType(type)) {\n                return ts.TypeReferenceSerializationKind.ArrayLikeType;\n            }\n            else {\n                return ts.TypeReferenceSerializationKind.ObjectType;\n            }\n        }\n        function createTypeOfDeclaration(declarationIn, enclosingDeclaration, flags, tracker, addUndefined) {\n            var declaration = ts.getParseTreeNode(declarationIn, ts.isVariableLikeOrAccessor);\n            if (!declaration) {\n                return ts.factory.createToken(128 /* AnyKeyword */);\n            }\n            // Get type of the symbol if this is the valid symbol otherwise get type at location\n            var symbol = getSymbolOfNode(declaration);\n            var type = symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* Signature */))\n                ? getWidenedLiteralType(getTypeOfSymbol(symbol))\n                : errorType;\n            if (type.flags & 8192 /* UniqueESSymbol */ &&\n                type.symbol === symbol) {\n                flags |= 1048576 /* AllowUniqueESSymbolType */;\n            }\n            if (addUndefined) {\n                type = getOptionalType(type);\n            }\n            return nodeBuilder.typeToTypeNode(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, tracker);\n        }\n        function createReturnTypeOfSignatureDeclaration(signatureDeclarationIn, enclosingDeclaration, flags, tracker) {\n            var signatureDeclaration = ts.getParseTreeNode(signatureDeclarationIn, ts.isFunctionLike);\n            if (!signatureDeclaration) {\n                return ts.factory.createToken(128 /* AnyKeyword */);\n            }\n            var signature = getSignatureFromDeclaration(signatureDeclaration);\n            return nodeBuilder.typeToTypeNode(getReturnTypeOfSignature(signature), enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, tracker);\n        }\n        function createTypeOfExpression(exprIn, enclosingDeclaration, flags, tracker) {\n            var expr = ts.getParseTreeNode(exprIn, ts.isExpression);\n            if (!expr) {\n                return ts.factory.createToken(128 /* AnyKeyword */);\n            }\n            var type = getWidenedType(getRegularTypeOfExpression(expr));\n            return nodeBuilder.typeToTypeNode(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, tracker);\n        }\n        function hasGlobalName(name) {\n            return globals.has(ts.escapeLeadingUnderscores(name));\n        }\n        function getReferencedValueSymbol(reference, startInDeclarationContainer) {\n            var resolvedSymbol = getNodeLinks(reference).resolvedSymbol;\n            if (resolvedSymbol) {\n                return resolvedSymbol;\n            }\n            var location = reference;\n            if (startInDeclarationContainer) {\n                // When resolving the name of a declaration as a value, we need to start resolution\n                // at a point outside of the declaration.\n                var parent = reference.parent;\n                if (ts.isDeclaration(parent) && reference === parent.name) {\n                    location = getDeclarationContainer(parent);\n                }\n            }\n            return resolveName(location, reference.escapedText, 111551 /* Value */ | 1048576 /* ExportValue */ | 2097152 /* Alias */, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true);\n        }\n        function getReferencedValueDeclaration(referenceIn) {\n            if (!ts.isGeneratedIdentifier(referenceIn)) {\n                var reference = ts.getParseTreeNode(referenceIn, ts.isIdentifier);\n                if (reference) {\n                    var symbol = getReferencedValueSymbol(reference);\n                    if (symbol) {\n                        return getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration;\n                    }\n                }\n            }\n            return undefined;\n        }\n        function isLiteralConstDeclaration(node) {\n            if (ts.isDeclarationReadonly(node) || ts.isVariableDeclaration(node) && ts.isVarConst(node)) {\n                return isFreshLiteralType(getTypeOfSymbol(getSymbolOfNode(node)));\n            }\n            return false;\n        }\n        function literalTypeToNode(type, enclosing, tracker) {\n            var enumResult = type.flags & 1024 /* EnumLiteral */ ? nodeBuilder.symbolToExpression(type.symbol, 111551 /* Value */, enclosing, /*flags*/ undefined, tracker)\n                : type === trueType ? ts.factory.createTrue() : type === falseType && ts.factory.createFalse();\n            if (enumResult)\n                return enumResult;\n            var literalValue = type.value;\n            return typeof literalValue === \"object\" ? ts.factory.createBigIntLiteral(literalValue) :\n                typeof literalValue === \"number\" ? ts.factory.createNumericLiteral(literalValue) :\n                    ts.factory.createStringLiteral(literalValue);\n        }\n        function createLiteralConstValue(node, tracker) {\n            var type = getTypeOfSymbol(getSymbolOfNode(node));\n            return literalTypeToNode(type, node, tracker);\n        }\n        function getJsxFactoryEntity(location) {\n            return location ? (getJsxNamespace(location), (ts.getSourceFileOfNode(location).localJsxFactory || _jsxFactoryEntity)) : _jsxFactoryEntity;\n        }\n        function getJsxFragmentFactoryEntity(location) {\n            if (location) {\n                var file = ts.getSourceFileOfNode(location);\n                if (file) {\n                    if (file.localJsxFragmentFactory) {\n                        return file.localJsxFragmentFactory;\n                    }\n                    var jsxFragPragmas = file.pragmas.get(\"jsxfrag\");\n                    var jsxFragPragma = ts.isArray(jsxFragPragmas) ? jsxFragPragmas[0] : jsxFragPragmas;\n                    if (jsxFragPragma) {\n                        file.localJsxFragmentFactory = ts.parseIsolatedEntityName(jsxFragPragma.arguments.factory, languageVersion);\n                        return file.localJsxFragmentFactory;\n                    }\n                }\n            }\n            if (compilerOptions.jsxFragmentFactory) {\n                return ts.parseIsolatedEntityName(compilerOptions.jsxFragmentFactory, languageVersion);\n            }\n        }\n        function createResolver() {\n            // this variable and functions that use it are deliberately moved here from the outer scope\n            // to avoid scope pollution\n            var resolvedTypeReferenceDirectives = host.getResolvedTypeReferenceDirectives();\n            var fileToDirective;\n            if (resolvedTypeReferenceDirectives) {\n                // populate reverse mapping: file path -> type reference directive that was resolved to this file\n                fileToDirective = new ts.Map();\n                resolvedTypeReferenceDirectives.forEach(function (resolvedDirective, key) {\n                    if (!resolvedDirective || !resolvedDirective.resolvedFileName) {\n                        return;\n                    }\n                    var file = host.getSourceFile(resolvedDirective.resolvedFileName);\n                    if (file) {\n                        // Add the transitive closure of path references loaded by this file (as long as they are not)\n                        // part of an existing type reference.\n                        addReferencedFilesToTypeDirective(file, key);\n                    }\n                });\n            }\n            return {\n                getReferencedExportContainer: getReferencedExportContainer,\n                getReferencedImportDeclaration: getReferencedImportDeclaration,\n                getReferencedDeclarationWithCollidingName: getReferencedDeclarationWithCollidingName,\n                isDeclarationWithCollidingName: isDeclarationWithCollidingName,\n                isValueAliasDeclaration: function (nodeIn) {\n                    var node = ts.getParseTreeNode(nodeIn);\n                    // Synthesized nodes are always treated like values.\n                    return node ? isValueAliasDeclaration(node) : true;\n                },\n                hasGlobalName: hasGlobalName,\n                isReferencedAliasDeclaration: function (nodeIn, checkChildren) {\n                    var node = ts.getParseTreeNode(nodeIn);\n                    // Synthesized nodes are always treated as referenced.\n                    return node ? isReferencedAliasDeclaration(node, checkChildren) : true;\n                },\n                getNodeCheckFlags: function (nodeIn) {\n                    var node = ts.getParseTreeNode(nodeIn);\n                    return node ? getNodeCheckFlags(node) : 0;\n                },\n                isTopLevelValueImportEqualsWithEntityName: isTopLevelValueImportEqualsWithEntityName,\n                isDeclarationVisible: isDeclarationVisible,\n                isImplementationOfOverload: isImplementationOfOverload,\n                isRequiredInitializedParameter: isRequiredInitializedParameter,\n                isOptionalUninitializedParameterProperty: isOptionalUninitializedParameterProperty,\n                isExpandoFunctionDeclaration: isExpandoFunctionDeclaration,\n                getPropertiesOfContainerFunction: getPropertiesOfContainerFunction,\n                createTypeOfDeclaration: createTypeOfDeclaration,\n                createReturnTypeOfSignatureDeclaration: createReturnTypeOfSignatureDeclaration,\n                createTypeOfExpression: createTypeOfExpression,\n                createLiteralConstValue: createLiteralConstValue,\n                isSymbolAccessible: isSymbolAccessible,\n                isEntityNameVisible: isEntityNameVisible,\n                getConstantValue: function (nodeIn) {\n                    var node = ts.getParseTreeNode(nodeIn, canHaveConstantValue);\n                    return node ? getConstantValue(node) : undefined;\n                },\n                collectLinkedAliases: collectLinkedAliases,\n                getReferencedValueDeclaration: getReferencedValueDeclaration,\n                getTypeReferenceSerializationKind: getTypeReferenceSerializationKind,\n                isOptionalParameter: isOptionalParameter,\n                moduleExportsSomeValue: moduleExportsSomeValue,\n                isArgumentsLocalBinding: isArgumentsLocalBinding,\n                getExternalModuleFileFromDeclaration: function (nodeIn) {\n                    var node = ts.getParseTreeNode(nodeIn, ts.hasPossibleExternalModuleReference);\n                    return node && getExternalModuleFileFromDeclaration(node);\n                },\n                getTypeReferenceDirectivesForEntityName: getTypeReferenceDirectivesForEntityName,\n                getTypeReferenceDirectivesForSymbol: getTypeReferenceDirectivesForSymbol,\n                isLiteralConstDeclaration: isLiteralConstDeclaration,\n                isLateBound: function (nodeIn) {\n                    var node = ts.getParseTreeNode(nodeIn, ts.isDeclaration);\n                    var symbol = node && getSymbolOfNode(node);\n                    return !!(symbol && ts.getCheckFlags(symbol) & 4096 /* Late */);\n                },\n                getJsxFactoryEntity: getJsxFactoryEntity,\n                getJsxFragmentFactoryEntity: getJsxFragmentFactoryEntity,\n                getAllAccessorDeclarations: function (accessor) {\n                    accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217\n                    var otherKind = accessor.kind === 168 /* SetAccessor */ ? 167 /* GetAccessor */ : 168 /* SetAccessor */;\n                    var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind);\n                    var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor;\n                    var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor;\n                    var setAccessor = accessor.kind === 168 /* SetAccessor */ ? accessor : otherAccessor;\n                    var getAccessor = accessor.kind === 167 /* GetAccessor */ ? accessor : otherAccessor;\n                    return {\n                        firstAccessor: firstAccessor,\n                        secondAccessor: secondAccessor,\n                        setAccessor: setAccessor,\n                        getAccessor: getAccessor\n                    };\n                },\n                getSymbolOfExternalModuleSpecifier: function (moduleName) { return resolveExternalModuleNameWorker(moduleName, moduleName, /*moduleNotFoundError*/ undefined); },\n                isBindingCapturedByNode: function (node, decl) {\n                    var parseNode = ts.getParseTreeNode(node);\n                    var parseDecl = ts.getParseTreeNode(decl);\n                    return !!parseNode && !!parseDecl && (ts.isVariableDeclaration(parseDecl) || ts.isBindingElement(parseDecl)) && isBindingCapturedByNode(parseNode, parseDecl);\n                },\n                getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) {\n                    var n = ts.getParseTreeNode(node);\n                    ts.Debug.assert(n && n.kind === 297 /* SourceFile */, \"Non-sourcefile node passed into getDeclarationsForSourceFile\");\n                    var sym = getSymbolOfNode(node);\n                    if (!sym) {\n                        return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled);\n                    }\n                    return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, tracker, bundled);\n                },\n                isImportRequiredByAugmentation: isImportRequiredByAugmentation,\n            };\n            function isImportRequiredByAugmentation(node) {\n                var file = ts.getSourceFileOfNode(node);\n                if (!file.symbol)\n                    return false;\n                var importTarget = getExternalModuleFileFromDeclaration(node);\n                if (!importTarget)\n                    return false;\n                if (importTarget === file)\n                    return false;\n                var exports = getExportsOfModule(file.symbol);\n                for (var _i = 0, _a = ts.arrayFrom(exports.values()); _i < _a.length; _i++) {\n                    var s = _a[_i];\n                    if (s.mergeId) {\n                        var merged = getMergedSymbol(s);\n                        for (var _b = 0, _c = merged.declarations; _b < _c.length; _b++) {\n                            var d = _c[_b];\n                            var declFile = ts.getSourceFileOfNode(d);\n                            if (declFile === importTarget) {\n                                return true;\n                            }\n                        }\n                    }\n                }\n                return false;\n            }\n            function isInHeritageClause(node) {\n                return node.parent && node.parent.kind === 223 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 286 /* HeritageClause */;\n            }\n            // defined here to avoid outer scope pollution\n            function getTypeReferenceDirectivesForEntityName(node) {\n                // program does not have any files with type reference directives - bail out\n                if (!fileToDirective) {\n                    return undefined;\n                }\n                // property access can only be used as values, or types when within an expression with type arguments inside a heritage clause\n                // qualified names can only be used as types\\namespaces\n                // identifiers are treated as values only if they appear in type queries\n                var meaning = 788968 /* Type */ | 1920 /* Namespace */;\n                if ((node.kind === 78 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 201 /* PropertyAccessExpression */ && !isInHeritageClause(node))) {\n                    meaning = 111551 /* Value */ | 1048576 /* ExportValue */;\n                }\n                var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true);\n                return symbol && symbol !== unknownSymbol ? getTypeReferenceDirectivesForSymbol(symbol, meaning) : undefined;\n            }\n            // defined here to avoid outer scope pollution\n            function getTypeReferenceDirectivesForSymbol(symbol, meaning) {\n                // program does not have any files with type reference directives - bail out\n                if (!fileToDirective) {\n                    return undefined;\n                }\n                if (!isSymbolFromTypeDeclarationFile(symbol)) {\n                    return undefined;\n                }\n                // check what declarations in the symbol can contribute to the target meaning\n                var typeReferenceDirectives;\n                for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                    var decl = _a[_i];\n                    // check meaning of the local symbol to see if declaration needs to be analyzed further\n                    if (decl.symbol && decl.symbol.flags & meaning) {\n                        var file = ts.getSourceFileOfNode(decl);\n                        var typeReferenceDirective = fileToDirective.get(file.path);\n                        if (typeReferenceDirective) {\n                            (typeReferenceDirectives || (typeReferenceDirectives = [])).push(typeReferenceDirective);\n                        }\n                        else {\n                            // found at least one entry that does not originate from type reference directive\n                            return undefined;\n                        }\n                    }\n                }\n                return typeReferenceDirectives;\n            }\n            function isSymbolFromTypeDeclarationFile(symbol) {\n                // bail out if symbol does not have associated declarations (i.e. this is transient symbol created for property in binding pattern)\n                if (!symbol.declarations) {\n                    return false;\n                }\n                // walk the parent chain for symbols to make sure that top level parent symbol is in the global scope\n                // external modules cannot define or contribute to type declaration files\n                var current = symbol;\n                while (true) {\n                    var parent = getParentOfSymbol(current);\n                    if (parent) {\n                        current = parent;\n                    }\n                    else {\n                        break;\n                    }\n                }\n                if (current.valueDeclaration && current.valueDeclaration.kind === 297 /* SourceFile */ && current.flags & 512 /* ValueModule */) {\n                    return false;\n                }\n                // check that at least one declaration of top level symbol originates from type declaration file\n                for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                    var decl = _a[_i];\n                    var file = ts.getSourceFileOfNode(decl);\n                    if (fileToDirective.has(file.path)) {\n                        return true;\n                    }\n                }\n                return false;\n            }\n            function addReferencedFilesToTypeDirective(file, key) {\n                if (fileToDirective.has(file.path))\n                    return;\n                fileToDirective.set(file.path, key);\n                for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) {\n                    var fileName = _a[_i].fileName;\n                    var resolvedFile = ts.resolveTripleslashReference(fileName, file.fileName);\n                    var referencedFile = host.getSourceFile(resolvedFile);\n                    if (referencedFile) {\n                        addReferencedFilesToTypeDirective(referencedFile, key);\n                    }\n                }\n            }\n        }\n        function getExternalModuleFileFromDeclaration(declaration) {\n            var specifier = declaration.kind === 256 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);\n            var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217\n            if (!moduleSymbol) {\n                return undefined;\n            }\n            return ts.getDeclarationOfKind(moduleSymbol, 297 /* SourceFile */);\n        }\n        function initializeTypeChecker() {\n            // Bind all source files and propagate errors\n            for (var _i = 0, _a = host.getSourceFiles(); _i < _a.length; _i++) {\n                var file = _a[_i];\n                ts.bindSourceFile(file, compilerOptions);\n            }\n            amalgamatedDuplicates = new ts.Map();\n            // Initialize global symbol table\n            var augmentations;\n            for (var _b = 0, _c = host.getSourceFiles(); _b < _c.length; _b++) {\n                var file = _c[_b];\n                if (file.redirectInfo) {\n                    continue;\n                }\n                if (!ts.isExternalOrCommonJsModule(file)) {\n                    // It is an error for a non-external-module (i.e. script) to declare its own `globalThis`.\n                    // We can't use `builtinGlobals` for this due to synthetic expando-namespace generation in JS files.\n                    var fileGlobalThisSymbol = file.locals.get(\"globalThis\");\n                    if (fileGlobalThisSymbol) {\n                        for (var _d = 0, _e = fileGlobalThisSymbol.declarations; _d < _e.length; _d++) {\n                            var declaration = _e[_d];\n                            diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0, \"globalThis\"));\n                        }\n                    }\n                    mergeSymbolTable(globals, file.locals);\n                }\n                if (file.jsGlobalAugmentations) {\n                    mergeSymbolTable(globals, file.jsGlobalAugmentations);\n                }\n                if (file.patternAmbientModules && file.patternAmbientModules.length) {\n                    patternAmbientModules = ts.concatenate(patternAmbientModules, file.patternAmbientModules);\n                }\n                if (file.moduleAugmentations.length) {\n                    (augmentations || (augmentations = [])).push(file.moduleAugmentations);\n                }\n                if (file.symbol && file.symbol.globalExports) {\n                    // Merge in UMD exports with first-in-wins semantics (see #9771)\n                    var source = file.symbol.globalExports;\n                    source.forEach(function (sourceSymbol, id) {\n                        if (!globals.has(id)) {\n                            globals.set(id, sourceSymbol);\n                        }\n                    });\n                }\n            }\n            // We do global augmentations separately from module augmentations (and before creating global types) because they\n            //  1. Affect global types. We won't have the correct global types until global augmentations are merged. Also,\n            //  2. Module augmentation instantiation requires creating the type of a module, which, in turn, can require\n            //       checking for an export or property on the module (if export=) which, in turn, can fall back to the\n            //       apparent type of the module - either globalObjectType or globalFunctionType - which wouldn't exist if we\n            //       did module augmentations prior to finalizing the global types.\n            if (augmentations) {\n                // merge _global_ module augmentations.\n                // this needs to be done after global symbol table is initialized to make sure that all ambient modules are indexed\n                for (var _f = 0, augmentations_1 = augmentations; _f < augmentations_1.length; _f++) {\n                    var list = augmentations_1[_f];\n                    for (var _g = 0, list_1 = list; _g < list_1.length; _g++) {\n                        var augmentation = list_1[_g];\n                        if (!ts.isGlobalScopeAugmentation(augmentation.parent))\n                            continue;\n                        mergeModuleAugmentation(augmentation);\n                    }\n                }\n            }\n            // Setup global builtins\n            addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0);\n            getSymbolLinks(undefinedSymbol).type = undefinedWideningType;\n            getSymbolLinks(argumentsSymbol).type = getGlobalType(\"IArguments\", /*arity*/ 0, /*reportErrors*/ true);\n            getSymbolLinks(unknownSymbol).type = errorType;\n            getSymbolLinks(globalThisSymbol).type = createObjectType(16 /* Anonymous */, globalThisSymbol);\n            // Initialize special types\n            globalArrayType = getGlobalType(\"Array\", /*arity*/ 1, /*reportErrors*/ true);\n            globalObjectType = getGlobalType(\"Object\", /*arity*/ 0, /*reportErrors*/ true);\n            globalFunctionType = getGlobalType(\"Function\", /*arity*/ 0, /*reportErrors*/ true);\n            globalCallableFunctionType = strictBindCallApply && getGlobalType(\"CallableFunction\", /*arity*/ 0, /*reportErrors*/ true) || globalFunctionType;\n            globalNewableFunctionType = strictBindCallApply && getGlobalType(\"NewableFunction\", /*arity*/ 0, /*reportErrors*/ true) || globalFunctionType;\n            globalStringType = getGlobalType(\"String\", /*arity*/ 0, /*reportErrors*/ true);\n            globalNumberType = getGlobalType(\"Number\", /*arity*/ 0, /*reportErrors*/ true);\n            globalBooleanType = getGlobalType(\"Boolean\", /*arity*/ 0, /*reportErrors*/ true);\n            globalRegExpType = getGlobalType(\"RegExp\", /*arity*/ 0, /*reportErrors*/ true);\n            anyArrayType = createArrayType(anyType);\n            autoArrayType = createArrayType(autoType);\n            if (autoArrayType === emptyObjectType) {\n                // autoArrayType is used as a marker, so even if global Array type is not defined, it needs to be a unique type\n                autoArrayType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);\n            }\n            globalReadonlyArrayType = getGlobalTypeOrUndefined(\"ReadonlyArray\", /*arity*/ 1) || globalArrayType;\n            anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType;\n            globalThisType = getGlobalTypeOrUndefined(\"ThisType\", /*arity*/ 1);\n            if (augmentations) {\n                // merge _nonglobal_ module augmentations.\n                // this needs to be done after global symbol table is initialized to make sure that all ambient modules are indexed\n                for (var _h = 0, augmentations_2 = augmentations; _h < augmentations_2.length; _h++) {\n                    var list = augmentations_2[_h];\n                    for (var _j = 0, list_2 = list; _j < list_2.length; _j++) {\n                        var augmentation = list_2[_j];\n                        if (ts.isGlobalScopeAugmentation(augmentation.parent))\n                            continue;\n                        mergeModuleAugmentation(augmentation);\n                    }\n                }\n            }\n            amalgamatedDuplicates.forEach(function (_a) {\n                var firstFile = _a.firstFile, secondFile = _a.secondFile, conflictingSymbols = _a.conflictingSymbols;\n                // If not many things conflict, issue individual errors\n                if (conflictingSymbols.size < 8) {\n                    conflictingSymbols.forEach(function (_a, symbolName) {\n                        var isBlockScoped = _a.isBlockScoped, firstFileLocations = _a.firstFileLocations, secondFileLocations = _a.secondFileLocations;\n                        var message = isBlockScoped ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0;\n                        for (var _i = 0, firstFileLocations_1 = firstFileLocations; _i < firstFileLocations_1.length; _i++) {\n                            var node = firstFileLocations_1[_i];\n                            addDuplicateDeclarationError(node, message, symbolName, secondFileLocations);\n                        }\n                        for (var _b = 0, secondFileLocations_1 = secondFileLocations; _b < secondFileLocations_1.length; _b++) {\n                            var node = secondFileLocations_1[_b];\n                            addDuplicateDeclarationError(node, message, symbolName, firstFileLocations);\n                        }\n                    });\n                }\n                else {\n                    // Otherwise issue top-level error since the files appear very identical in terms of what they contain\n                    var list = ts.arrayFrom(conflictingSymbols.keys()).join(\", \");\n                    diagnostics.add(ts.addRelatedInfo(ts.createDiagnosticForNode(firstFile, ts.Diagnostics.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0, list), ts.createDiagnosticForNode(secondFile, ts.Diagnostics.Conflicts_are_in_this_file)));\n                    diagnostics.add(ts.addRelatedInfo(ts.createDiagnosticForNode(secondFile, ts.Diagnostics.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0, list), ts.createDiagnosticForNode(firstFile, ts.Diagnostics.Conflicts_are_in_this_file)));\n                }\n            });\n            amalgamatedDuplicates = undefined;\n        }\n        function checkExternalEmitHelpers(location, helpers) {\n            if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) {\n                var sourceFile = ts.getSourceFileOfNode(location);\n                if (ts.isEffectiveExternalModule(sourceFile, compilerOptions) && !(location.flags & 8388608 /* Ambient */)) {\n                    var helpersModule = resolveHelpersModule(sourceFile, location);\n                    if (helpersModule !== unknownSymbol) {\n                        var uncheckedHelpers = helpers & ~requestedExternalEmitHelpers;\n                        for (var helper = 1 /* FirstEmitHelper */; helper <= 2097152 /* LastEmitHelper */; helper <<= 1) {\n                            if (uncheckedHelpers & helper) {\n                                var name = getHelperName(helper);\n                                var symbol = getSymbol(helpersModule.exports, ts.escapeLeadingUnderscores(name), 111551 /* Value */);\n                                if (!symbol) {\n                                    error(location, ts.Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, ts.externalHelpersModuleNameText, name);\n                                }\n                            }\n                        }\n                    }\n                    requestedExternalEmitHelpers |= helpers;\n                }\n            }\n        }\n        function getHelperName(helper) {\n            switch (helper) {\n                case 1 /* Extends */: return \"__extends\";\n                case 2 /* Assign */: return \"__assign\";\n                case 4 /* Rest */: return \"__rest\";\n                case 8 /* Decorate */: return \"__decorate\";\n                case 16 /* Metadata */: return \"__metadata\";\n                case 32 /* Param */: return \"__param\";\n                case 64 /* Awaiter */: return \"__awaiter\";\n                case 128 /* Generator */: return \"__generator\";\n                case 256 /* Values */: return \"__values\";\n                case 512 /* Read */: return \"__read\";\n                case 1024 /* SpreadArray */: return \"__spreadArray\";\n                case 2048 /* Await */: return \"__await\";\n                case 4096 /* AsyncGenerator */: return \"__asyncGenerator\";\n                case 8192 /* AsyncDelegator */: return \"__asyncDelegator\";\n                case 16384 /* AsyncValues */: return \"__asyncValues\";\n                case 32768 /* ExportStar */: return \"__exportStar\";\n                case 65536 /* ImportStar */: return \"__importStar\";\n                case 131072 /* ImportDefault */: return \"__importDefault\";\n                case 262144 /* MakeTemplateObject */: return \"__makeTemplateObject\";\n                case 524288 /* ClassPrivateFieldGet */: return \"__classPrivateFieldGet\";\n                case 1048576 /* ClassPrivateFieldSet */: return \"__classPrivateFieldSet\";\n                case 2097152 /* CreateBinding */: return \"__createBinding\";\n                default: return ts.Debug.fail(\"Unrecognized helper\");\n            }\n        }\n        function resolveHelpersModule(node, errorNode) {\n            if (!externalHelpersModule) {\n                externalHelpersModule = resolveExternalModule(node, ts.externalHelpersModuleNameText, ts.Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found, errorNode) || unknownSymbol;\n            }\n            return externalHelpersModule;\n        }\n        // GRAMMAR CHECKING\n        function checkGrammarDecoratorsAndModifiers(node) {\n            return checkGrammarDecorators(node) || checkGrammarModifiers(node);\n        }\n        function checkGrammarDecorators(node) {\n            if (!node.decorators) {\n                return false;\n            }\n            if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) {\n                if (node.kind === 165 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) {\n                    return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload);\n                }\n                else {\n                    return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here);\n                }\n            }\n            else if (node.kind === 167 /* GetAccessor */ || node.kind === 168 /* SetAccessor */) {\n                var accessors = ts.getAllAccessorDeclarations(node.parent.members, node);\n                if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) {\n                    return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name);\n                }\n            }\n            return false;\n        }\n        function checkGrammarModifiers(node) {\n            var quickResult = reportObviousModifierErrors(node);\n            if (quickResult !== undefined) {\n                return quickResult;\n            }\n            var lastStatic, lastDeclare, lastAsync, lastReadonly;\n            var flags = 0 /* None */;\n            for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) {\n                var modifier = _a[_i];\n                if (modifier.kind !== 142 /* ReadonlyKeyword */) {\n                    if (node.kind === 162 /* PropertySignature */ || node.kind === 164 /* MethodSignature */) {\n                        return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind));\n                    }\n                    if (node.kind === 171 /* IndexSignature */) {\n                        return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind));\n                    }\n                }\n                switch (modifier.kind) {\n                    case 84 /* ConstKeyword */:\n                        if (node.kind !== 255 /* EnumDeclaration */) {\n                            return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(84 /* ConstKeyword */));\n                        }\n                        break;\n                    case 122 /* PublicKeyword */:\n                    case 121 /* ProtectedKeyword */:\n                    case 120 /* PrivateKeyword */:\n                        var text = visibilityToString(ts.modifierToFlag(modifier.kind));\n                        if (flags & 28 /* AccessibilityModifier */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics.Accessibility_modifier_already_seen);\n                        }\n                        else if (flags & 32 /* Static */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, \"static\");\n                        }\n                        else if (flags & 64 /* Readonly */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, \"readonly\");\n                        }\n                        else if (flags & 256 /* Async */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, \"async\");\n                        }\n                        else if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);\n                        }\n                        else if (flags & 128 /* Abstract */) {\n                            if (modifier.kind === 120 /* PrivateKeyword */) {\n                                return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, \"abstract\");\n                            }\n                            else {\n                                return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, \"abstract\");\n                            }\n                        }\n                        else if (ts.isPrivateIdentifierPropertyDeclaration(node)) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier);\n                        }\n                        flags |= ts.modifierToFlag(modifier.kind);\n                        break;\n                    case 123 /* StaticKeyword */:\n                        if (flags & 32 /* Static */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, \"static\");\n                        }\n                        else if (flags & 64 /* Readonly */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, \"static\", \"readonly\");\n                        }\n                        else if (flags & 256 /* Async */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, \"static\", \"async\");\n                        }\n                        else if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, \"static\");\n                        }\n                        else if (node.kind === 160 /* Parameter */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, \"static\");\n                        }\n                        else if (flags & 128 /* Abstract */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, \"static\", \"abstract\");\n                        }\n                        else if (ts.isPrivateIdentifierPropertyDeclaration(node)) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, \"static\");\n                        }\n                        flags |= 32 /* Static */;\n                        lastStatic = modifier;\n                        break;\n                    case 142 /* ReadonlyKeyword */:\n                        if (flags & 64 /* Readonly */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, \"readonly\");\n                        }\n                        else if (node.kind !== 163 /* PropertyDeclaration */ && node.kind !== 162 /* PropertySignature */ && node.kind !== 171 /* IndexSignature */ && node.kind !== 160 /* Parameter */) {\n                            // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property.\n                            return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);\n                        }\n                        flags |= 64 /* Readonly */;\n                        lastReadonly = modifier;\n                        break;\n                    case 92 /* ExportKeyword */:\n                        if (flags & 1 /* Export */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, \"export\");\n                        }\n                        else if (flags & 2 /* Ambient */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, \"export\", \"declare\");\n                        }\n                        else if (flags & 128 /* Abstract */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, \"export\", \"abstract\");\n                        }\n                        else if (flags & 256 /* Async */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, \"export\", \"async\");\n                        }\n                        else if (ts.isClassLike(node.parent)) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, \"export\");\n                        }\n                        else if (node.kind === 160 /* Parameter */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, \"export\");\n                        }\n                        flags |= 1 /* Export */;\n                        break;\n                    case 87 /* DefaultKeyword */:\n                        var container = node.parent.kind === 297 /* SourceFile */ ? node.parent : node.parent.parent;\n                        if (container.kind === 256 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);\n                        }\n                        flags |= 512 /* Default */;\n                        break;\n                    case 133 /* DeclareKeyword */:\n                        if (flags & 2 /* Ambient */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, \"declare\");\n                        }\n                        else if (flags & 256 /* Async */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, \"async\");\n                        }\n                        else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, \"declare\");\n                        }\n                        else if (node.kind === 160 /* Parameter */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, \"declare\");\n                        }\n                        else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 257 /* ModuleBlock */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);\n                        }\n                        else if (ts.isPrivateIdentifierPropertyDeclaration(node)) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, \"declare\");\n                        }\n                        flags |= 2 /* Ambient */;\n                        lastDeclare = modifier;\n                        break;\n                    case 125 /* AbstractKeyword */:\n                        if (flags & 128 /* Abstract */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, \"abstract\");\n                        }\n                        if (node.kind !== 252 /* ClassDeclaration */ &&\n                            node.kind !== 175 /* ConstructorType */) {\n                            if (node.kind !== 165 /* MethodDeclaration */ &&\n                                node.kind !== 163 /* PropertyDeclaration */ &&\n                                node.kind !== 167 /* GetAccessor */ &&\n                                node.kind !== 168 /* SetAccessor */) {\n                                return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);\n                            }\n                            if (!(node.parent.kind === 252 /* ClassDeclaration */ && ts.hasSyntacticModifier(node.parent, 128 /* Abstract */))) {\n                                return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class);\n                            }\n                            if (flags & 32 /* Static */) {\n                                return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, \"static\", \"abstract\");\n                            }\n                            if (flags & 8 /* Private */) {\n                                return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, \"private\", \"abstract\");\n                            }\n                            if (flags & 256 /* Async */ && lastAsync) {\n                                return grammarErrorOnNode(lastAsync, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, \"async\", \"abstract\");\n                            }\n                        }\n                        if (ts.isNamedDeclaration(node) && node.name.kind === 79 /* PrivateIdentifier */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, \"abstract\");\n                        }\n                        flags |= 128 /* Abstract */;\n                        break;\n                    case 129 /* AsyncKeyword */:\n                        if (flags & 256 /* Async */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, \"async\");\n                        }\n                        else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, \"async\");\n                        }\n                        else if (node.kind === 160 /* Parameter */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, \"async\");\n                        }\n                        if (flags & 128 /* Abstract */) {\n                            return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, \"async\", \"abstract\");\n                        }\n                        flags |= 256 /* Async */;\n                        lastAsync = modifier;\n                        break;\n                }\n            }\n            if (node.kind === 166 /* Constructor */) {\n                if (flags & 32 /* Static */) {\n                    return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, \"static\");\n                }\n                if (flags & 128 /* Abstract */) {\n                    return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, \"abstract\"); // TODO: GH#18217\n                }\n                else if (flags & 256 /* Async */) {\n                    return grammarErrorOnNode(lastAsync, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, \"async\");\n                }\n                else if (flags & 64 /* Readonly */) {\n                    return grammarErrorOnNode(lastReadonly, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, \"readonly\");\n                }\n                return false;\n            }\n            else if ((node.kind === 261 /* ImportDeclaration */ || node.kind === 260 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) {\n                return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, \"declare\");\n            }\n            else if (node.kind === 160 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) {\n                return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern);\n            }\n            else if (node.kind === 160 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) {\n                return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);\n            }\n            if (flags & 256 /* Async */) {\n                return checkGrammarAsyncModifier(node, lastAsync);\n            }\n            return false;\n        }\n        /**\n         * true | false: Early return this value from checkGrammarModifiers.\n         * undefined: Need to do full checking on the modifiers.\n         */\n        function reportObviousModifierErrors(node) {\n            return !node.modifiers\n                ? false\n                : shouldReportBadModifier(node)\n                    ? grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here)\n                    : undefined;\n        }\n        function shouldReportBadModifier(node) {\n            switch (node.kind) {\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                case 166 /* Constructor */:\n                case 163 /* PropertyDeclaration */:\n                case 162 /* PropertySignature */:\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                case 171 /* IndexSignature */:\n                case 256 /* ModuleDeclaration */:\n                case 261 /* ImportDeclaration */:\n                case 260 /* ImportEqualsDeclaration */:\n                case 267 /* ExportDeclaration */:\n                case 266 /* ExportAssignment */:\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                case 160 /* Parameter */:\n                    return false;\n                default:\n                    if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) {\n                        return false;\n                    }\n                    switch (node.kind) {\n                        case 251 /* FunctionDeclaration */:\n                            return nodeHasAnyModifiersExcept(node, 129 /* AsyncKeyword */);\n                        case 252 /* ClassDeclaration */:\n                        case 175 /* ConstructorType */:\n                            return nodeHasAnyModifiersExcept(node, 125 /* AbstractKeyword */);\n                        case 253 /* InterfaceDeclaration */:\n                        case 232 /* VariableStatement */:\n                        case 254 /* TypeAliasDeclaration */:\n                            return true;\n                        case 255 /* EnumDeclaration */:\n                            return nodeHasAnyModifiersExcept(node, 84 /* ConstKeyword */);\n                        default:\n                            ts.Debug.fail();\n                    }\n            }\n        }\n        function nodeHasAnyModifiersExcept(node, allowedModifier) {\n            return node.modifiers.length > 1 || node.modifiers[0].kind !== allowedModifier;\n        }\n        function checkGrammarAsyncModifier(node, asyncModifier) {\n            switch (node.kind) {\n                case 165 /* MethodDeclaration */:\n                case 251 /* FunctionDeclaration */:\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                    return false;\n            }\n            return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, \"async\");\n        }\n        function checkGrammarForDisallowedTrailingComma(list, diag) {\n            if (diag === void 0) { diag = ts.Diagnostics.Trailing_comma_not_allowed; }\n            if (list && list.hasTrailingComma) {\n                return grammarErrorAtPos(list[0], list.end - \",\".length, \",\".length, diag);\n            }\n            return false;\n        }\n        function checkGrammarTypeParameterList(typeParameters, file) {\n            if (typeParameters && typeParameters.length === 0) {\n                var start = typeParameters.pos - \"<\".length;\n                var end = ts.skipTrivia(file.text, typeParameters.end) + \">\".length;\n                return grammarErrorAtPos(file, start, end - start, ts.Diagnostics.Type_parameter_list_cannot_be_empty);\n            }\n            return false;\n        }\n        function checkGrammarParameterList(parameters) {\n            var seenOptionalParameter = false;\n            var parameterCount = parameters.length;\n            for (var i = 0; i < parameterCount; i++) {\n                var parameter = parameters[i];\n                if (parameter.dotDotDotToken) {\n                    if (i !== (parameterCount - 1)) {\n                        return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list);\n                    }\n                    if (!(parameter.flags & 8388608 /* Ambient */)) { // Allow `...foo,` in ambient declarations; see GH#23070\n                        checkGrammarForDisallowedTrailingComma(parameters, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);\n                    }\n                    if (parameter.questionToken) {\n                        return grammarErrorOnNode(parameter.questionToken, ts.Diagnostics.A_rest_parameter_cannot_be_optional);\n                    }\n                    if (parameter.initializer) {\n                        return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer);\n                    }\n                }\n                else if (isOptionalParameter(parameter)) {\n                    seenOptionalParameter = true;\n                    if (parameter.questionToken && parameter.initializer) {\n                        return grammarErrorOnNode(parameter.name, ts.Diagnostics.Parameter_cannot_have_question_mark_and_initializer);\n                    }\n                }\n                else if (seenOptionalParameter && !parameter.initializer) {\n                    return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter);\n                }\n            }\n        }\n        function getNonSimpleParameters(parameters) {\n            return ts.filter(parameters, function (parameter) { return !!parameter.initializer || ts.isBindingPattern(parameter.name) || ts.isRestParameter(parameter); });\n        }\n        function checkGrammarForUseStrictSimpleParameterList(node) {\n            if (languageVersion >= 3 /* ES2016 */) {\n                var useStrictDirective_1 = node.body && ts.isBlock(node.body) && ts.findUseStrictPrologue(node.body.statements);\n                if (useStrictDirective_1) {\n                    var nonSimpleParameters = getNonSimpleParameters(node.parameters);\n                    if (ts.length(nonSimpleParameters)) {\n                        ts.forEach(nonSimpleParameters, function (parameter) {\n                            ts.addRelatedInfo(error(parameter, ts.Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive), ts.createDiagnosticForNode(useStrictDirective_1, ts.Diagnostics.use_strict_directive_used_here));\n                        });\n                        var diagnostics_2 = nonSimpleParameters.map(function (parameter, index) { return (index === 0 ? ts.createDiagnosticForNode(parameter, ts.Diagnostics.Non_simple_parameter_declared_here) : ts.createDiagnosticForNode(parameter, ts.Diagnostics.and_here)); });\n                        ts.addRelatedInfo.apply(void 0, __spreadArray([error(useStrictDirective_1, ts.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)], diagnostics_2));\n                        return true;\n                    }\n                }\n            }\n            return false;\n        }\n        function checkGrammarFunctionLikeDeclaration(node) {\n            // Prevent cascading error by short-circuit\n            var file = ts.getSourceFileOfNode(node);\n            return checkGrammarDecoratorsAndModifiers(node) ||\n                checkGrammarTypeParameterList(node.typeParameters, file) ||\n                checkGrammarParameterList(node.parameters) ||\n                checkGrammarArrowFunction(node, file) ||\n                (ts.isFunctionLikeDeclaration(node) && checkGrammarForUseStrictSimpleParameterList(node));\n        }\n        function checkGrammarClassLikeDeclaration(node) {\n            var file = ts.getSourceFileOfNode(node);\n            return checkGrammarClassDeclarationHeritageClauses(node) ||\n                checkGrammarTypeParameterList(node.typeParameters, file);\n        }\n        function checkGrammarArrowFunction(node, file) {\n            if (!ts.isArrowFunction(node)) {\n                return false;\n            }\n            var equalsGreaterThanToken = node.equalsGreaterThanToken;\n            var startLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.pos).line;\n            var endLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.end).line;\n            return startLine !== endLine && grammarErrorOnNode(equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow);\n        }\n        function checkGrammarIndexSignatureParameters(node) {\n            var parameter = node.parameters[0];\n            if (node.parameters.length !== 1) {\n                if (parameter) {\n                    return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter);\n                }\n                else {\n                    return grammarErrorOnNode(node, ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter);\n                }\n            }\n            checkGrammarForDisallowedTrailingComma(node.parameters, ts.Diagnostics.An_index_signature_cannot_have_a_trailing_comma);\n            if (parameter.dotDotDotToken) {\n                return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter);\n            }\n            if (ts.hasEffectiveModifiers(parameter)) {\n                return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier);\n            }\n            if (parameter.questionToken) {\n                return grammarErrorOnNode(parameter.questionToken, ts.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark);\n            }\n            if (parameter.initializer) {\n                return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer);\n            }\n            if (!parameter.type) {\n                return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation);\n            }\n            if (parameter.type.kind !== 147 /* StringKeyword */ && parameter.type.kind !== 144 /* NumberKeyword */) {\n                var type = getTypeFromTypeNode(parameter.type);\n                if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) {\n                    return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType));\n                }\n                if (type.flags & 1048576 /* Union */ && allTypesAssignableToKind(type, 384 /* StringOrNumberLiteral */, /*strict*/ true)) {\n                    return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead);\n                }\n                return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_either_string_or_number);\n            }\n            if (!node.type) {\n                return grammarErrorOnNode(node, ts.Diagnostics.An_index_signature_must_have_a_type_annotation);\n            }\n            return false;\n        }\n        function checkGrammarIndexSignature(node) {\n            // Prevent cascading error by short-circuit\n            return checkGrammarDecoratorsAndModifiers(node) || checkGrammarIndexSignatureParameters(node);\n        }\n        function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) {\n            if (typeArguments && typeArguments.length === 0) {\n                var sourceFile = ts.getSourceFileOfNode(node);\n                var start = typeArguments.pos - \"<\".length;\n                var end = ts.skipTrivia(sourceFile.text, typeArguments.end) + \">\".length;\n                return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Type_argument_list_cannot_be_empty);\n            }\n            return false;\n        }\n        function checkGrammarTypeArguments(node, typeArguments) {\n            return checkGrammarForDisallowedTrailingComma(typeArguments) ||\n                checkGrammarForAtLeastOneTypeArgument(node, typeArguments);\n        }\n        function checkGrammarTaggedTemplateChain(node) {\n            if (node.questionDotToken || node.flags & 32 /* OptionalChain */) {\n                return grammarErrorOnNode(node.template, ts.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain);\n            }\n            return false;\n        }\n        function checkGrammarForOmittedArgument(args) {\n            if (args) {\n                for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {\n                    var arg = args_4[_i];\n                    if (arg.kind === 222 /* OmittedExpression */) {\n                        return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);\n                    }\n                }\n            }\n            return false;\n        }\n        function checkGrammarArguments(args) {\n            return checkGrammarForOmittedArgument(args);\n        }\n        function checkGrammarHeritageClause(node) {\n            var types = node.types;\n            if (checkGrammarForDisallowedTrailingComma(types)) {\n                return true;\n            }\n            if (types && types.length === 0) {\n                var listType = ts.tokenToString(node.token);\n                return grammarErrorAtPos(node, types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType);\n            }\n            return ts.some(types, checkGrammarExpressionWithTypeArguments);\n        }\n        function checkGrammarExpressionWithTypeArguments(node) {\n            return checkGrammarTypeArguments(node, node.typeArguments);\n        }\n        function checkGrammarClassDeclarationHeritageClauses(node) {\n            var seenExtendsClause = false;\n            var seenImplementsClause = false;\n            if (!checkGrammarDecoratorsAndModifiers(node) && node.heritageClauses) {\n                for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) {\n                    var heritageClause = _a[_i];\n                    if (heritageClause.token === 93 /* ExtendsKeyword */) {\n                        if (seenExtendsClause) {\n                            return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen);\n                        }\n                        if (seenImplementsClause) {\n                            return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_must_precede_implements_clause);\n                        }\n                        if (heritageClause.types.length > 1) {\n                            return grammarErrorOnFirstToken(heritageClause.types[1], ts.Diagnostics.Classes_can_only_extend_a_single_class);\n                        }\n                        seenExtendsClause = true;\n                    }\n                    else {\n                        ts.Debug.assert(heritageClause.token === 116 /* ImplementsKeyword */);\n                        if (seenImplementsClause) {\n                            return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen);\n                        }\n                        seenImplementsClause = true;\n                    }\n                    // Grammar checking heritageClause inside class declaration\n                    checkGrammarHeritageClause(heritageClause);\n                }\n            }\n        }\n        function checkGrammarInterfaceDeclaration(node) {\n            var seenExtendsClause = false;\n            if (node.heritageClauses) {\n                for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) {\n                    var heritageClause = _a[_i];\n                    if (heritageClause.token === 93 /* ExtendsKeyword */) {\n                        if (seenExtendsClause) {\n                            return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen);\n                        }\n                        seenExtendsClause = true;\n                    }\n                    else {\n                        ts.Debug.assert(heritageClause.token === 116 /* ImplementsKeyword */);\n                        return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause);\n                    }\n                    // Grammar checking heritageClause inside class declaration\n                    checkGrammarHeritageClause(heritageClause);\n                }\n            }\n            return false;\n        }\n        function checkGrammarComputedPropertyName(node) {\n            // If node is not a computedPropertyName, just skip the grammar checking\n            if (node.kind !== 158 /* ComputedPropertyName */) {\n                return false;\n            }\n            var computedPropertyName = node;\n            if (computedPropertyName.expression.kind === 216 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) {\n                return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name);\n            }\n            return false;\n        }\n        function checkGrammarForGenerator(node) {\n            if (node.asteriskToken) {\n                ts.Debug.assert(node.kind === 251 /* FunctionDeclaration */ ||\n                    node.kind === 208 /* FunctionExpression */ ||\n                    node.kind === 165 /* MethodDeclaration */);\n                if (node.flags & 8388608 /* Ambient */) {\n                    return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context);\n                }\n                if (!node.body) {\n                    return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator);\n                }\n            }\n        }\n        function checkGrammarForInvalidQuestionMark(questionToken, message) {\n            return !!questionToken && grammarErrorOnNode(questionToken, message);\n        }\n        function checkGrammarForInvalidExclamationToken(exclamationToken, message) {\n            return !!exclamationToken && grammarErrorOnNode(exclamationToken, message);\n        }\n        function checkGrammarObjectLiteralExpression(node, inDestructuring) {\n            var seen = new ts.Map();\n            for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {\n                var prop = _a[_i];\n                if (prop.kind === 290 /* SpreadAssignment */) {\n                    if (inDestructuring) {\n                        // a rest property cannot be destructured any further\n                        var expression = ts.skipParentheses(prop.expression);\n                        if (ts.isArrayLiteralExpression(expression) || ts.isObjectLiteralExpression(expression)) {\n                            return grammarErrorOnNode(prop.expression, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern);\n                        }\n                    }\n                    continue;\n                }\n                var name = prop.name;\n                if (name.kind === 158 /* ComputedPropertyName */) {\n                    // If the name is not a ComputedPropertyName, the grammar checking will skip it\n                    checkGrammarComputedPropertyName(name);\n                }\n                if (prop.kind === 289 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) {\n                    // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern\n                    // outside of destructuring it is a syntax error\n                    return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern);\n                }\n                if (name.kind === 79 /* PrivateIdentifier */) {\n                    return grammarErrorOnNode(name, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);\n                }\n                // Modifiers are never allowed on properties except for 'async' on a method declaration\n                if (prop.modifiers) {\n                    // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n                    for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955\n                        var mod = _c[_b];\n                        if (mod.kind !== 129 /* AsyncKeyword */ || prop.kind !== 165 /* MethodDeclaration */) {\n                            grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod));\n                        }\n                    }\n                }\n                // ECMA-262 11.1.5 Object Initializer\n                // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true\n                // a.This production is contained in strict code and IsDataDescriptor(previous) is true and\n                // IsDataDescriptor(propId.descriptor) is true.\n                //    b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true.\n                //    c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true.\n                //    d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true\n                // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields\n                var currentKind = void 0;\n                switch (prop.kind) {\n                    case 289 /* ShorthandPropertyAssignment */:\n                        checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context);\n                    // falls through\n                    case 288 /* PropertyAssignment */:\n                        // Grammar checking for computedPropertyName and shorthandPropertyAssignment\n                        checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);\n                        if (name.kind === 8 /* NumericLiteral */) {\n                            checkGrammarNumericLiteral(name);\n                        }\n                        currentKind = 4 /* PropertyAssignment */;\n                        break;\n                    case 165 /* MethodDeclaration */:\n                        currentKind = 8 /* Method */;\n                        break;\n                    case 167 /* GetAccessor */:\n                        currentKind = 1 /* GetAccessor */;\n                        break;\n                    case 168 /* SetAccessor */:\n                        currentKind = 2 /* SetAccessor */;\n                        break;\n                    default:\n                        throw ts.Debug.assertNever(prop, \"Unexpected syntax kind:\" + prop.kind);\n                }\n                if (!inDestructuring) {\n                    var effectiveName = ts.getPropertyNameForPropertyNameNode(name);\n                    if (effectiveName === undefined) {\n                        continue;\n                    }\n                    var existingKind = seen.get(effectiveName);\n                    if (!existingKind) {\n                        seen.set(effectiveName, currentKind);\n                    }\n                    else {\n                        if ((currentKind & 12 /* PropertyAssignmentOrMethod */) && (existingKind & 12 /* PropertyAssignmentOrMethod */)) {\n                            grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));\n                        }\n                        else if ((currentKind & 3 /* GetOrSetAccessor */) && (existingKind & 3 /* GetOrSetAccessor */)) {\n                            if (existingKind !== 3 /* GetOrSetAccessor */ && currentKind !== existingKind) {\n                                seen.set(effectiveName, currentKind | existingKind);\n                            }\n                            else {\n                                return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);\n                            }\n                        }\n                        else {\n                            return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);\n                        }\n                    }\n                }\n            }\n        }\n        function checkGrammarJsxElement(node) {\n            checkGrammarTypeArguments(node, node.typeArguments);\n            var seen = new ts.Map();\n            for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) {\n                var attr = _a[_i];\n                if (attr.kind === 282 /* JsxSpreadAttribute */) {\n                    continue;\n                }\n                var name = attr.name, initializer = attr.initializer;\n                if (!seen.get(name.escapedText)) {\n                    seen.set(name.escapedText, true);\n                }\n                else {\n                    return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);\n                }\n                if (initializer && initializer.kind === 283 /* JsxExpression */ && !initializer.expression) {\n                    return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression);\n                }\n            }\n        }\n        function checkGrammarJsxExpression(node) {\n            if (node.expression && ts.isCommaSequence(node.expression)) {\n                return grammarErrorOnNode(node.expression, ts.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array);\n            }\n        }\n        function checkGrammarForInOrForOfStatement(forInOrOfStatement) {\n            if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) {\n                return true;\n            }\n            if (forInOrOfStatement.kind === 239 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) {\n                if (!(forInOrOfStatement.flags & 32768 /* AwaitContext */)) {\n                    var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement);\n                    if (ts.isInTopLevelContext(forInOrOfStatement)) {\n                        if (!hasParseDiagnostics(sourceFile)) {\n                            if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {\n                                diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module));\n                            }\n                            if ((moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) || languageVersion < 4 /* ES2017 */) {\n                                diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_esnext_or_system_and_the_target_option_is_set_to_es2017_or_higher));\n                            }\n                        }\n                    }\n                    else {\n                        // use of 'for-await-of' in non-async function\n                        if (!hasParseDiagnostics(sourceFile)) {\n                            var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules);\n                            var func = ts.getContainingFunction(forInOrOfStatement);\n                            if (func && func.kind !== 166 /* Constructor */) {\n                                ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, \"Enclosing function should never be an async function.\");\n                                var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async);\n                                ts.addRelatedInfo(diagnostic, relatedInfo);\n                            }\n                            diagnostics.add(diagnostic);\n                            return true;\n                        }\n                    }\n                    return false;\n                }\n            }\n            if (forInOrOfStatement.initializer.kind === 250 /* VariableDeclarationList */) {\n                var variableList = forInOrOfStatement.initializer;\n                if (!checkGrammarVariableDeclarationList(variableList)) {\n                    var declarations = variableList.declarations;\n                    // declarations.length can be zero if there is an error in variable declaration in for-of or for-in\n                    // See http://www.ecma-international.org/ecma-262/6.0/#sec-for-in-and-for-of-statements for details\n                    // For example:\n                    //      var let = 10;\n                    //      for (let of [1,2,3]) {} // this is invalid ES6 syntax\n                    //      for (let in [1,2,3]) {} // this is invalid ES6 syntax\n                    // We will then want to skip on grammar checking on variableList declaration\n                    if (!declarations.length) {\n                        return false;\n                    }\n                    if (declarations.length > 1) {\n                        var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */\n                            ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement\n                            : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;\n                        return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic);\n                    }\n                    var firstDeclaration = declarations[0];\n                    if (firstDeclaration.initializer) {\n                        var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */\n                            ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer\n                            : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;\n                        return grammarErrorOnNode(firstDeclaration.name, diagnostic);\n                    }\n                    if (firstDeclaration.type) {\n                        var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */\n                            ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation\n                            : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation;\n                        return grammarErrorOnNode(firstDeclaration, diagnostic);\n                    }\n                }\n            }\n            return false;\n        }\n        function checkGrammarAccessor(accessor) {\n            if (!(accessor.flags & 8388608 /* Ambient */)) {\n                if (languageVersion < 1 /* ES5 */) {\n                    return grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher);\n                }\n                if (accessor.body === undefined && !ts.hasSyntacticModifier(accessor, 128 /* Abstract */)) {\n                    return grammarErrorAtPos(accessor, accessor.end - 1, \";\".length, ts.Diagnostics._0_expected, \"{\");\n                }\n            }\n            if (accessor.body && ts.hasSyntacticModifier(accessor, 128 /* Abstract */)) {\n                return grammarErrorOnNode(accessor, ts.Diagnostics.An_abstract_accessor_cannot_have_an_implementation);\n            }\n            if (accessor.typeParameters) {\n                return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters);\n            }\n            if (!doesAccessorHaveCorrectParameterCount(accessor)) {\n                return grammarErrorOnNode(accessor.name, accessor.kind === 167 /* GetAccessor */ ?\n                    ts.Diagnostics.A_get_accessor_cannot_have_parameters :\n                    ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter);\n            }\n            if (accessor.kind === 168 /* SetAccessor */) {\n                if (accessor.type) {\n                    return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation);\n                }\n                var parameter = ts.Debug.checkDefined(ts.getSetAccessorValueParameter(accessor), \"Return value does not match parameter count assertion.\");\n                if (parameter.dotDotDotToken) {\n                    return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter);\n                }\n                if (parameter.questionToken) {\n                    return grammarErrorOnNode(parameter.questionToken, ts.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter);\n                }\n                if (parameter.initializer) {\n                    return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer);\n                }\n            }\n            return false;\n        }\n        /** Does the accessor have the right number of parameters?\n         * A get accessor has no parameters or a single `this` parameter.\n         * A set accessor has one parameter or a `this` parameter and one more parameter.\n         */\n        function doesAccessorHaveCorrectParameterCount(accessor) {\n            return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 167 /* GetAccessor */ ? 0 : 1);\n        }\n        function getAccessorThisParameter(accessor) {\n            if (accessor.parameters.length === (accessor.kind === 167 /* GetAccessor */ ? 1 : 2)) {\n                return ts.getThisParameter(accessor);\n            }\n        }\n        function checkGrammarTypeOperatorNode(node) {\n            if (node.operator === 151 /* UniqueKeyword */) {\n                if (node.type.kind !== 148 /* SymbolKeyword */) {\n                    return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(148 /* SymbolKeyword */));\n                }\n                var parent = ts.walkUpParenthesizedTypes(node.parent);\n                if (ts.isInJSFile(parent) && ts.isJSDocTypeExpression(parent)) {\n                    parent = parent.parent;\n                    if (ts.isJSDocTypeTag(parent)) {\n                        // walk up past JSDoc comment node\n                        parent = parent.parent.parent;\n                    }\n                }\n                switch (parent.kind) {\n                    case 249 /* VariableDeclaration */:\n                        var decl = parent;\n                        if (decl.name.kind !== 78 /* Identifier */) {\n                            return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name);\n                        }\n                        if (!ts.isVariableDeclarationInVariableStatement(decl)) {\n                            return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement);\n                        }\n                        if (!(decl.parent.flags & 2 /* Const */)) {\n                            return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const);\n                        }\n                        break;\n                    case 163 /* PropertyDeclaration */:\n                        if (!ts.hasSyntacticModifier(parent, 32 /* Static */) ||\n                            !ts.hasEffectiveModifier(parent, 64 /* Readonly */)) {\n                            return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly);\n                        }\n                        break;\n                    case 162 /* PropertySignature */:\n                        if (!ts.hasSyntacticModifier(parent, 64 /* Readonly */)) {\n                            return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);\n                        }\n                        break;\n                    default:\n                        return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here);\n                }\n            }\n            else if (node.operator === 142 /* ReadonlyKeyword */) {\n                if (node.type.kind !== 178 /* ArrayType */ && node.type.kind !== 179 /* TupleType */) {\n                    return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(148 /* SymbolKeyword */));\n                }\n            }\n        }\n        function checkGrammarForInvalidDynamicName(node, message) {\n            if (isNonBindableDynamicName(node)) {\n                return grammarErrorOnNode(node, message);\n            }\n        }\n        function checkGrammarMethod(node) {\n            if (checkGrammarFunctionLikeDeclaration(node)) {\n                return true;\n            }\n            if (node.kind === 165 /* MethodDeclaration */) {\n                if (node.parent.kind === 200 /* ObjectLiteralExpression */) {\n                    // We only disallow modifier on a method declaration if it is a property of object-literal-expression\n                    if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 129 /* AsyncKeyword */)) {\n                        return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here);\n                    }\n                    else if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) {\n                        return true;\n                    }\n                    else if (checkGrammarForInvalidExclamationToken(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context)) {\n                        return true;\n                    }\n                    else if (node.body === undefined) {\n                        return grammarErrorAtPos(node, node.end - 1, \";\".length, ts.Diagnostics._0_expected, \"{\");\n                    }\n                }\n                if (checkGrammarForGenerator(node)) {\n                    return true;\n                }\n            }\n            if (ts.isClassLike(node.parent)) {\n                // Technically, computed properties in ambient contexts is disallowed\n                // for property declarations and accessors too, not just methods.\n                // However, property declarations disallow computed names in general,\n                // and accessors are not allowed in ambient contexts in general,\n                // so this error only really matters for methods.\n                if (node.flags & 8388608 /* Ambient */) {\n                    return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);\n                }\n                else if (node.kind === 165 /* MethodDeclaration */ && !node.body) {\n                    return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);\n                }\n            }\n            else if (node.parent.kind === 253 /* InterfaceDeclaration */) {\n                return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);\n            }\n            else if (node.parent.kind === 177 /* TypeLiteral */) {\n                return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);\n            }\n        }\n        function checkGrammarBreakOrContinueStatement(node) {\n            var current = node;\n            while (current) {\n                if (ts.isFunctionLike(current)) {\n                    return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary);\n                }\n                switch (current.kind) {\n                    case 245 /* LabeledStatement */:\n                        if (node.label && current.label.escapedText === node.label.escapedText) {\n                            // found matching label - verify that label usage is correct\n                            // continue can only target labels that are on iteration statements\n                            var isMisplacedContinueLabel = node.kind === 240 /* ContinueStatement */\n                                && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true);\n                            if (isMisplacedContinueLabel) {\n                                return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement);\n                            }\n                            return false;\n                        }\n                        break;\n                    case 244 /* SwitchStatement */:\n                        if (node.kind === 241 /* BreakStatement */ && !node.label) {\n                            // unlabeled break within switch statement - ok\n                            return false;\n                        }\n                        break;\n                    default:\n                        if (ts.isIterationStatement(current, /*lookInLabeledStatement*/ false) && !node.label) {\n                            // unlabeled break or continue within iteration statement - ok\n                            return false;\n                        }\n                        break;\n                }\n                current = current.parent;\n            }\n            if (node.label) {\n                var message = node.kind === 241 /* BreakStatement */\n                    ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement\n                    : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement;\n                return grammarErrorOnNode(node, message);\n            }\n            else {\n                var message = node.kind === 241 /* BreakStatement */\n                    ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement\n                    : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement;\n                return grammarErrorOnNode(node, message);\n            }\n        }\n        function checkGrammarBindingElement(node) {\n            if (node.dotDotDotToken) {\n                var elements = node.parent.elements;\n                if (node !== ts.last(elements)) {\n                    return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);\n                }\n                checkGrammarForDisallowedTrailingComma(elements, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);\n                if (node.propertyName) {\n                    return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_have_a_property_name);\n                }\n            }\n            if (node.dotDotDotToken && node.initializer) {\n                // Error on equals token which immediately precedes the initializer\n                return grammarErrorAtPos(node, node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer);\n            }\n        }\n        function isStringOrNumberLiteralExpression(expr) {\n            return ts.isStringOrNumericLiteralLike(expr) ||\n                expr.kind === 214 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ &&\n                    expr.operand.kind === 8 /* NumericLiteral */;\n        }\n        function isBigIntLiteralExpression(expr) {\n            return expr.kind === 9 /* BigIntLiteral */ ||\n                expr.kind === 214 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ &&\n                    expr.operand.kind === 9 /* BigIntLiteral */;\n        }\n        function isSimpleLiteralEnumReference(expr) {\n            if ((ts.isPropertyAccessExpression(expr) || (ts.isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression))) &&\n                ts.isEntityNameExpression(expr.expression)) {\n                return !!(checkExpressionCached(expr).flags & 1024 /* EnumLiteral */);\n            }\n        }\n        function checkAmbientInitializer(node) {\n            var initializer = node.initializer;\n            if (initializer) {\n                var isInvalidInitializer = !(isStringOrNumberLiteralExpression(initializer) ||\n                    isSimpleLiteralEnumReference(initializer) ||\n                    initializer.kind === 109 /* TrueKeyword */ || initializer.kind === 94 /* FalseKeyword */ ||\n                    isBigIntLiteralExpression(initializer));\n                var isConstOrReadonly = ts.isDeclarationReadonly(node) || ts.isVariableDeclaration(node) && ts.isVarConst(node);\n                if (isConstOrReadonly && !node.type) {\n                    if (isInvalidInitializer) {\n                        return grammarErrorOnNode(initializer, ts.Diagnostics.A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference);\n                    }\n                }\n                else {\n                    return grammarErrorOnNode(initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts);\n                }\n                if (!isConstOrReadonly || isInvalidInitializer) {\n                    return grammarErrorOnNode(initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts);\n                }\n            }\n        }\n        function checkGrammarVariableDeclaration(node) {\n            if (node.parent.parent.kind !== 238 /* ForInStatement */ && node.parent.parent.kind !== 239 /* ForOfStatement */) {\n                if (node.flags & 8388608 /* Ambient */) {\n                    checkAmbientInitializer(node);\n                }\n                else if (!node.initializer) {\n                    if (ts.isBindingPattern(node.name) && !ts.isBindingPattern(node.parent)) {\n                        return grammarErrorOnNode(node, ts.Diagnostics.A_destructuring_declaration_must_have_an_initializer);\n                    }\n                    if (ts.isVarConst(node)) {\n                        return grammarErrorOnNode(node, ts.Diagnostics.const_declarations_must_be_initialized);\n                    }\n                }\n            }\n            if (node.exclamationToken && (node.parent.parent.kind !== 232 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) {\n                var message = node.initializer\n                    ? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions\n                    : !node.type\n                        ? ts.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations\n                        : ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context;\n                return grammarErrorOnNode(node.exclamationToken, message);\n            }\n            var moduleKind = ts.getEmitModuleKind(compilerOptions);\n            if (moduleKind < ts.ModuleKind.ES2015 && moduleKind !== ts.ModuleKind.System &&\n                !(node.parent.parent.flags & 8388608 /* Ambient */) && ts.hasSyntacticModifier(node.parent.parent, 1 /* Export */)) {\n                checkESModuleMarker(node.name);\n            }\n            var checkLetConstNames = (ts.isLet(node) || ts.isVarConst(node));\n            // 1. LexicalDeclaration : LetOrConst BindingList ;\n            // It is a Syntax Error if the BoundNames of BindingList contains \"let\".\n            // 2. ForDeclaration: ForDeclaration : LetOrConst ForBinding\n            // It is a Syntax Error if the BoundNames of ForDeclaration contains \"let\".\n            // It is a SyntaxError if a VariableDeclaration or VariableDeclarationNoIn occurs within strict code\n            // and its Identifier is eval or arguments\n            return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name);\n        }\n        function checkESModuleMarker(name) {\n            if (name.kind === 78 /* Identifier */) {\n                if (ts.idText(name) === \"__esModule\") {\n                    return grammarErrorOnNodeSkippedOn(\"noEmit\", name, ts.Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules);\n                }\n            }\n            else {\n                var elements = name.elements;\n                for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {\n                    var element = elements_1[_i];\n                    if (!ts.isOmittedExpression(element)) {\n                        return checkESModuleMarker(element.name);\n                    }\n                }\n            }\n            return false;\n        }\n        function checkGrammarNameInLetOrConstDeclarations(name) {\n            if (name.kind === 78 /* Identifier */) {\n                if (name.originalKeywordKind === 118 /* LetKeyword */) {\n                    return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations);\n                }\n            }\n            else {\n                var elements = name.elements;\n                for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) {\n                    var element = elements_2[_i];\n                    if (!ts.isOmittedExpression(element)) {\n                        checkGrammarNameInLetOrConstDeclarations(element.name);\n                    }\n                }\n            }\n            return false;\n        }\n        function checkGrammarVariableDeclarationList(declarationList) {\n            var declarations = declarationList.declarations;\n            if (checkGrammarForDisallowedTrailingComma(declarationList.declarations)) {\n                return true;\n            }\n            if (!declarationList.declarations.length) {\n                return grammarErrorAtPos(declarationList, declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty);\n            }\n            return false;\n        }\n        function allowLetAndConstDeclarations(parent) {\n            switch (parent.kind) {\n                case 234 /* IfStatement */:\n                case 235 /* DoStatement */:\n                case 236 /* WhileStatement */:\n                case 243 /* WithStatement */:\n                case 237 /* ForStatement */:\n                case 238 /* ForInStatement */:\n                case 239 /* ForOfStatement */:\n                    return false;\n                case 245 /* LabeledStatement */:\n                    return allowLetAndConstDeclarations(parent.parent);\n            }\n            return true;\n        }\n        function checkGrammarForDisallowedLetOrConstStatement(node) {\n            if (!allowLetAndConstDeclarations(node.parent)) {\n                if (ts.isLet(node.declarationList)) {\n                    return grammarErrorOnNode(node, ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block);\n                }\n                else if (ts.isVarConst(node.declarationList)) {\n                    return grammarErrorOnNode(node, ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block);\n                }\n            }\n        }\n        function checkGrammarMetaProperty(node) {\n            var escapedText = node.name.escapedText;\n            switch (node.keywordToken) {\n                case 102 /* NewKeyword */:\n                    if (escapedText !== \"target\") {\n                        return grammarErrorOnNode(node.name, ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.escapedText, ts.tokenToString(node.keywordToken), \"target\");\n                    }\n                    break;\n                case 99 /* ImportKeyword */:\n                    if (escapedText !== \"meta\") {\n                        return grammarErrorOnNode(node.name, ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.escapedText, ts.tokenToString(node.keywordToken), \"meta\");\n                    }\n                    break;\n            }\n        }\n        function hasParseDiagnostics(sourceFile) {\n            return sourceFile.parseDiagnostics.length > 0;\n        }\n        function grammarErrorOnFirstToken(node, message, arg0, arg1, arg2) {\n            var sourceFile = ts.getSourceFileOfNode(node);\n            if (!hasParseDiagnostics(sourceFile)) {\n                var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);\n                diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2));\n                return true;\n            }\n            return false;\n        }\n        function grammarErrorAtPos(nodeForSourceFile, start, length, message, arg0, arg1, arg2) {\n            var sourceFile = ts.getSourceFileOfNode(nodeForSourceFile);\n            if (!hasParseDiagnostics(sourceFile)) {\n                diagnostics.add(ts.createFileDiagnostic(sourceFile, start, length, message, arg0, arg1, arg2));\n                return true;\n            }\n            return false;\n        }\n        function grammarErrorOnNodeSkippedOn(key, node, message, arg0, arg1, arg2) {\n            var sourceFile = ts.getSourceFileOfNode(node);\n            if (!hasParseDiagnostics(sourceFile)) {\n                errorSkippedOn(key, node, message, arg0, arg1, arg2);\n                return true;\n            }\n            return false;\n        }\n        function grammarErrorOnNode(node, message, arg0, arg1, arg2) {\n            var sourceFile = ts.getSourceFileOfNode(node);\n            if (!hasParseDiagnostics(sourceFile)) {\n                diagnostics.add(ts.createDiagnosticForNode(node, message, arg0, arg1, arg2));\n                return true;\n            }\n            return false;\n        }\n        function checkGrammarConstructorTypeParameters(node) {\n            var jsdocTypeParameters = ts.isInJSFile(node) ? ts.getJSDocTypeParameterDeclarations(node) : undefined;\n            var range = node.typeParameters || jsdocTypeParameters && ts.firstOrUndefined(jsdocTypeParameters);\n            if (range) {\n                var pos = range.pos === range.end ? range.pos : ts.skipTrivia(ts.getSourceFileOfNode(node).text, range.pos);\n                return grammarErrorAtPos(node, pos, range.end - pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration);\n            }\n        }\n        function checkGrammarConstructorTypeAnnotation(node) {\n            var type = ts.getEffectiveReturnTypeNode(node);\n            if (type) {\n                return grammarErrorOnNode(type, ts.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration);\n            }\n        }\n        function checkGrammarProperty(node) {\n            if (ts.isClassLike(node.parent)) {\n                if (ts.isStringLiteral(node.name) && node.name.text === \"constructor\") {\n                    return grammarErrorOnNode(node.name, ts.Diagnostics.Classes_may_not_have_a_field_named_constructor);\n                }\n                if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) {\n                    return true;\n                }\n                if (languageVersion < 2 /* ES2015 */ && ts.isPrivateIdentifier(node.name)) {\n                    return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);\n                }\n            }\n            else if (node.parent.kind === 253 /* InterfaceDeclaration */) {\n                if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) {\n                    return true;\n                }\n                if (node.initializer) {\n                    return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer);\n                }\n            }\n            else if (node.parent.kind === 177 /* TypeLiteral */) {\n                if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) {\n                    return true;\n                }\n                if (node.initializer) {\n                    return grammarErrorOnNode(node.initializer, ts.Diagnostics.A_type_literal_property_cannot_have_an_initializer);\n                }\n            }\n            if (node.flags & 8388608 /* Ambient */) {\n                checkAmbientInitializer(node);\n            }\n            if (ts.isPropertyDeclaration(node) && node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer ||\n                node.flags & 8388608 /* Ambient */ || ts.hasSyntacticModifier(node, 32 /* Static */ | 128 /* Abstract */))) {\n                var message = node.initializer\n                    ? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions\n                    : !node.type\n                        ? ts.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations\n                        : ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context;\n                return grammarErrorOnNode(node.exclamationToken, message);\n            }\n        }\n        function checkGrammarTopLevelElementForRequiredDeclareModifier(node) {\n            // A declare modifier is required for any top level .d.ts declaration except export=, export default, export as namespace\n            // interfaces and imports categories:\n            //\n            //  DeclarationElement:\n            //     ExportAssignment\n            //     export_opt   InterfaceDeclaration\n            //     export_opt   TypeAliasDeclaration\n            //     export_opt   ImportDeclaration\n            //     export_opt   ExternalImportDeclaration\n            //     export_opt   AmbientDeclaration\n            //\n            // TODO: The spec needs to be amended to reflect this grammar.\n            if (node.kind === 253 /* InterfaceDeclaration */ ||\n                node.kind === 254 /* TypeAliasDeclaration */ ||\n                node.kind === 261 /* ImportDeclaration */ ||\n                node.kind === 260 /* ImportEqualsDeclaration */ ||\n                node.kind === 267 /* ExportDeclaration */ ||\n                node.kind === 266 /* ExportAssignment */ ||\n                node.kind === 259 /* NamespaceExportDeclaration */ ||\n                ts.hasSyntacticModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) {\n                return false;\n            }\n            return grammarErrorOnFirstToken(node, ts.Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier);\n        }\n        function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) {\n            for (var _i = 0, _a = file.statements; _i < _a.length; _i++) {\n                var decl = _a[_i];\n                if (ts.isDeclaration(decl) || decl.kind === 232 /* VariableStatement */) {\n                    if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) {\n                        return true;\n                    }\n                }\n            }\n            return false;\n        }\n        function checkGrammarSourceFile(node) {\n            return !!(node.flags & 8388608 /* Ambient */) && checkGrammarTopLevelElementsForRequiredDeclareModifier(node);\n        }\n        function checkGrammarStatementInAmbientContext(node) {\n            if (node.flags & 8388608 /* Ambient */) {\n                // Find containing block which is either Block, ModuleBlock, SourceFile\n                var links = getNodeLinks(node);\n                if (!links.hasReportedStatementInAmbientContext && (ts.isFunctionLike(node.parent) || ts.isAccessor(node.parent))) {\n                    return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);\n                }\n                // We are either parented by another statement, or some sort of block.\n                // If we're in a block, we only want to really report an error once\n                // to prevent noisiness.  So use a bit on the block to indicate if\n                // this has already been reported, and don't report if it has.\n                //\n                if (node.parent.kind === 230 /* Block */ || node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) {\n                    var links_2 = getNodeLinks(node.parent);\n                    // Check if the containing block ever report this error\n                    if (!links_2.hasReportedStatementInAmbientContext) {\n                        return links_2.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts);\n                    }\n                }\n                else {\n                    // We must be parented by a statement.  If so, there's no need\n                    // to report the error as our parent will have already done it.\n                    // Debug.assert(isStatement(node.parent));\n                }\n            }\n            return false;\n        }\n        function checkGrammarNumericLiteral(node) {\n            // Grammar checking\n            if (node.numericLiteralFlags & 32 /* Octal */) {\n                var diagnosticMessage = void 0;\n                if (languageVersion >= 1 /* ES5 */) {\n                    diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0;\n                }\n                else if (ts.isChildOfNodeWithKind(node, 191 /* LiteralType */)) {\n                    diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0;\n                }\n                else if (ts.isChildOfNodeWithKind(node, 291 /* EnumMember */)) {\n                    diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0;\n                }\n                if (diagnosticMessage) {\n                    var withMinus = ts.isPrefixUnaryExpression(node.parent) && node.parent.operator === 40 /* MinusToken */;\n                    var literal = (withMinus ? \"-\" : \"\") + \"0o\" + node.text;\n                    return grammarErrorOnNode(withMinus ? node.parent : node, diagnosticMessage, literal);\n                }\n            }\n            // Realism (size) checking\n            checkNumericLiteralValueSize(node);\n            return false;\n        }\n        function checkNumericLiteralValueSize(node) {\n            // Scientific notation (e.g. 2e54 and 1e00000000010) can't be converted to bigint\n            // Literals with 15 or fewer characters aren't long enough to reach past 2^53 - 1\n            // Fractional numbers (e.g. 9000000000000000.001) are inherently imprecise anyway\n            if (node.numericLiteralFlags & 16 /* Scientific */ || node.text.length <= 15 || node.text.indexOf(\".\") !== -1) {\n                return;\n            }\n            // We can't rely on the runtime to accurately store and compare extremely large numeric values\n            // Even for internal use, we use getTextOfNode: https://github.com/microsoft/TypeScript/issues/33298\n            // Thus, if the runtime claims a too-large number is lower than Number.MAX_SAFE_INTEGER,\n            // it's likely addition operations on it will fail too\n            var apparentValue = +ts.getTextOfNode(node);\n            if (apparentValue <= Math.pow(2, 53) - 1 && apparentValue + 1 > apparentValue) {\n                return;\n            }\n            addErrorOrSuggestion(/*isError*/ false, ts.createDiagnosticForNode(node, ts.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers));\n        }\n        function checkGrammarBigIntLiteral(node) {\n            var literalType = ts.isLiteralTypeNode(node.parent) ||\n                ts.isPrefixUnaryExpression(node.parent) && ts.isLiteralTypeNode(node.parent.parent);\n            if (!literalType) {\n                if (languageVersion < 7 /* ES2020 */) {\n                    if (grammarErrorOnNode(node, ts.Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020)) {\n                        return true;\n                    }\n                }\n            }\n            return false;\n        }\n        function grammarErrorAfterFirstToken(node, message, arg0, arg1, arg2) {\n            var sourceFile = ts.getSourceFileOfNode(node);\n            if (!hasParseDiagnostics(sourceFile)) {\n                var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);\n                diagnostics.add(ts.createFileDiagnostic(sourceFile, ts.textSpanEnd(span), /*length*/ 0, message, arg0, arg1, arg2));\n                return true;\n            }\n            return false;\n        }\n        function getAmbientModules() {\n            if (!ambientModulesCache) {\n                ambientModulesCache = [];\n                globals.forEach(function (global, sym) {\n                    // No need to `unescapeLeadingUnderscores`, an escaped symbol is never an ambient module.\n                    if (ambientModuleSymbolRegex.test(sym)) {\n                        ambientModulesCache.push(global);\n                    }\n                });\n            }\n            return ambientModulesCache;\n        }\n        function checkGrammarImportClause(node) {\n            if (node.isTypeOnly && node.name && node.namedBindings) {\n                return grammarErrorOnNode(node, ts.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both);\n            }\n            return false;\n        }\n        function checkGrammarImportCallExpression(node) {\n            if (moduleKind === ts.ModuleKind.ES2015) {\n                return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_or_umd);\n            }\n            if (node.typeArguments) {\n                return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_import_cannot_have_type_arguments);\n            }\n            var nodeArguments = node.arguments;\n            if (nodeArguments.length !== 1) {\n                return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_import_must_have_one_specifier_as_an_argument);\n            }\n            checkGrammarForDisallowedTrailingComma(nodeArguments);\n            // see: parseArgumentOrArrayLiteralElement...we use this function which parse arguments of callExpression to parse specifier for dynamic import.\n            // parseArgumentOrArrayLiteralElement allows spread element to be in an argument list which is not allowed as specifier in dynamic import.\n            if (ts.isSpreadElement(nodeArguments[0])) {\n                return grammarErrorOnNode(nodeArguments[0], ts.Diagnostics.Specifier_of_dynamic_import_cannot_be_spread_element);\n            }\n            return false;\n        }\n        function findMatchingTypeReferenceOrTypeAliasReference(source, unionTarget) {\n            var sourceObjectFlags = ts.getObjectFlags(source);\n            if (sourceObjectFlags & (4 /* Reference */ | 16 /* Anonymous */) && unionTarget.flags & 1048576 /* Union */) {\n                return ts.find(unionTarget.types, function (target) {\n                    if (target.flags & 524288 /* Object */) {\n                        var overlapObjFlags = sourceObjectFlags & ts.getObjectFlags(target);\n                        if (overlapObjFlags & 4 /* Reference */) {\n                            return source.target === target.target;\n                        }\n                        if (overlapObjFlags & 16 /* Anonymous */) {\n                            return !!source.aliasSymbol && source.aliasSymbol === target.aliasSymbol;\n                        }\n                    }\n                    return false;\n                });\n            }\n        }\n        function findBestTypeForObjectLiteral(source, unionTarget) {\n            if (ts.getObjectFlags(source) & 128 /* ObjectLiteral */ && forEachType(unionTarget, isArrayLikeType)) {\n                return ts.find(unionTarget.types, function (t) { return !isArrayLikeType(t); });\n            }\n        }\n        function findBestTypeForInvokable(source, unionTarget) {\n            var signatureKind = 0 /* Call */;\n            var hasSignatures = getSignaturesOfType(source, signatureKind).length > 0 ||\n                (signatureKind = 1 /* Construct */, getSignaturesOfType(source, signatureKind).length > 0);\n            if (hasSignatures) {\n                return ts.find(unionTarget.types, function (t) { return getSignaturesOfType(t, signatureKind).length > 0; });\n            }\n        }\n        function findMostOverlappyType(source, unionTarget) {\n            var bestMatch;\n            var matchingCount = 0;\n            for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {\n                var target = _a[_i];\n                var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);\n                if (overlap.flags & 4194304 /* Index */) {\n                    // perfect overlap of keys\n                    bestMatch = target;\n                    matchingCount = Infinity;\n                }\n                else if (overlap.flags & 1048576 /* Union */) {\n                    // We only want to account for literal types otherwise.\n                    // If we have a union of index types, it seems likely that we\n                    // needed to elaborate between two generic mapped types anyway.\n                    var len = ts.length(ts.filter(overlap.types, isUnitType));\n                    if (len >= matchingCount) {\n                        bestMatch = target;\n                        matchingCount = len;\n                    }\n                }\n                else if (isUnitType(overlap) && 1 >= matchingCount) {\n                    bestMatch = target;\n                    matchingCount = 1;\n                }\n            }\n            return bestMatch;\n        }\n        function filterPrimitivesIfContainsNonPrimitive(type) {\n            if (maybeTypeOfKind(type, 67108864 /* NonPrimitive */)) {\n                var result = filterType(type, function (t) { return !(t.flags & 131068 /* Primitive */); });\n                if (!(result.flags & 131072 /* Never */)) {\n                    return result;\n                }\n            }\n            return type;\n        }\n        // Keep this up-to-date with the same logic within `getApparentTypeOfContextualType`, since they should behave similarly\n        function findMatchingDiscriminantType(source, target, isRelatedTo, skipPartial) {\n            if (target.flags & 1048576 /* Union */ && source.flags & (2097152 /* Intersection */ | 524288 /* Object */)) {\n                var sourceProperties = getPropertiesOfType(source);\n                if (sourceProperties) {\n                    var sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target);\n                    if (sourcePropertiesFiltered) {\n                        return discriminateTypeByDiscriminableItems(target, ts.map(sourcePropertiesFiltered, function (p) { return [function () { return getTypeOfSymbol(p); }, p.escapedName]; }), isRelatedTo, /*defaultValue*/ undefined, skipPartial);\n                    }\n                }\n            }\n            return undefined;\n        }\n    }\n    ts.createTypeChecker = createTypeChecker;\n    function isNotAccessor(declaration) {\n        // Accessors check for their own matching duplicates, and in contexts where they are valid, there are already duplicate identifier checks\n        return !ts.isAccessor(declaration);\n    }\n    function isNotOverload(declaration) {\n        return (declaration.kind !== 251 /* FunctionDeclaration */ && declaration.kind !== 165 /* MethodDeclaration */) ||\n            !!declaration.body;\n    }\n    /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */\n    function isDeclarationNameOrImportPropertyName(name) {\n        switch (name.parent.kind) {\n            case 265 /* ImportSpecifier */:\n            case 270 /* ExportSpecifier */:\n                return ts.isIdentifier(name);\n            default:\n                return ts.isDeclarationName(name);\n        }\n    }\n    function isSomeImportDeclaration(decl) {\n        switch (decl.kind) {\n            case 262 /* ImportClause */: // For default import\n            case 260 /* ImportEqualsDeclaration */:\n            case 263 /* NamespaceImport */:\n            case 265 /* ImportSpecifier */: // For rename import `x as y`\n                return true;\n            case 78 /* Identifier */:\n                // For regular import, `decl` is an Identifier under the ImportSpecifier.\n                return decl.parent.kind === 265 /* ImportSpecifier */;\n            default:\n                return false;\n        }\n    }\n    var JsxNames;\n    (function (JsxNames) {\n        JsxNames.JSX = \"JSX\";\n        JsxNames.IntrinsicElements = \"IntrinsicElements\";\n        JsxNames.ElementClass = \"ElementClass\";\n        JsxNames.ElementAttributesPropertyNameContainer = \"ElementAttributesProperty\"; // TODO: Deprecate and remove support\n        JsxNames.ElementChildrenAttributeNameContainer = \"ElementChildrenAttribute\";\n        JsxNames.Element = \"Element\";\n        JsxNames.IntrinsicAttributes = \"IntrinsicAttributes\";\n        JsxNames.IntrinsicClassAttributes = \"IntrinsicClassAttributes\";\n        JsxNames.LibraryManagedAttributes = \"LibraryManagedAttributes\";\n    })(JsxNames || (JsxNames = {}));\n    function getIterationTypesKeyFromIterationTypeKind(typeKind) {\n        switch (typeKind) {\n            case 0 /* Yield */: return \"yieldType\";\n            case 1 /* Return */: return \"returnType\";\n            case 2 /* Next */: return \"nextType\";\n        }\n    }\n    function signatureHasRestParameter(s) {\n        return !!(s.flags & 1 /* HasRestParameter */);\n    }\n    ts.signatureHasRestParameter = signatureHasRestParameter;\n    function signatureHasLiteralTypes(s) {\n        return !!(s.flags & 2 /* HasLiteralTypes */);\n    }\n    ts.signatureHasLiteralTypes = signatureHasLiteralTypes;\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    var isTypeNodeOrTypeParameterDeclaration = ts.or(ts.isTypeNode, ts.isTypeParameterDeclaration);\n    function visitNode(node, visitor, test, lift) {\n        if (node === undefined || visitor === undefined) {\n            return node;\n        }\n        var visited = visitor(node);\n        if (visited === node) {\n            return node;\n        }\n        var visitedNode;\n        if (visited === undefined) {\n            return undefined;\n        }\n        else if (ts.isArray(visited)) {\n            visitedNode = (lift || extractSingleNode)(visited);\n        }\n        else {\n            visitedNode = visited;\n        }\n        ts.Debug.assertNode(visitedNode, test);\n        return visitedNode;\n    }\n    ts.visitNode = visitNode;\n    /**\n     * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.\n     *\n     * @param nodes The NodeArray to visit.\n     * @param visitor The callback used to visit a Node.\n     * @param test A node test to execute for each node.\n     * @param start An optional value indicating the starting offset at which to start visiting.\n     * @param count An optional value indicating the maximum number of nodes to visit.\n     */\n    function visitNodes(nodes, visitor, test, start, count) {\n        if (nodes === undefined || visitor === undefined) {\n            return nodes;\n        }\n        var updated;\n        // Ensure start and count have valid values\n        var length = nodes.length;\n        if (start === undefined || start < 0) {\n            start = 0;\n        }\n        if (count === undefined || count > length - start) {\n            count = length - start;\n        }\n        var hasTrailingComma;\n        var pos = -1;\n        var end = -1;\n        if (start > 0 || count < length) {\n            // If we are not visiting all of the original nodes, we must always create a new array.\n            // Since this is a fragment of a node array, we do not copy over the previous location\n            // and will only copy over `hasTrailingComma` if we are including the last element.\n            updated = [];\n            hasTrailingComma = nodes.hasTrailingComma && start + count === length;\n        }\n        // Visit each original node.\n        for (var i = 0; i < count; i++) {\n            var node = nodes[i + start];\n            var visited = node !== undefined ? visitor(node) : undefined;\n            if (updated !== undefined || visited === undefined || visited !== node) {\n                if (updated === undefined) {\n                    // Ensure we have a copy of `nodes`, up to the current index.\n                    updated = nodes.slice(0, i);\n                    hasTrailingComma = nodes.hasTrailingComma;\n                    pos = nodes.pos;\n                    end = nodes.end;\n                }\n                if (visited) {\n                    if (ts.isArray(visited)) {\n                        for (var _i = 0, visited_1 = visited; _i < visited_1.length; _i++) {\n                            var visitedNode = visited_1[_i];\n                            void ts.Debug.assertNode(visitedNode, test);\n                            updated.push(visitedNode);\n                        }\n                    }\n                    else {\n                        void ts.Debug.assertNode(visited, test);\n                        updated.push(visited);\n                    }\n                }\n            }\n        }\n        if (updated) {\n            // TODO(rbuckton): Remove dependency on `ts.factory` in favor of a provided factory.\n            var updatedArray = ts.factory.createNodeArray(updated, hasTrailingComma);\n            ts.setTextRangePosEnd(updatedArray, pos, end);\n            return updatedArray;\n        }\n        return nodes;\n    }\n    ts.visitNodes = visitNodes;\n    /**\n     * Starts a new lexical environment and visits a statement list, ending the lexical environment\n     * and merging hoisted declarations upon completion.\n     */\n    function visitLexicalEnvironment(statements, visitor, context, start, ensureUseStrict, nodesVisitor) {\n        if (nodesVisitor === void 0) { nodesVisitor = visitNodes; }\n        context.startLexicalEnvironment();\n        statements = nodesVisitor(statements, visitor, ts.isStatement, start);\n        if (ensureUseStrict)\n            statements = context.factory.ensureUseStrict(statements);\n        return ts.factory.mergeLexicalEnvironment(statements, context.endLexicalEnvironment());\n    }\n    ts.visitLexicalEnvironment = visitLexicalEnvironment;\n    function visitParameterList(nodes, visitor, context, nodesVisitor) {\n        if (nodesVisitor === void 0) { nodesVisitor = visitNodes; }\n        var updated;\n        context.startLexicalEnvironment();\n        if (nodes) {\n            context.setLexicalEnvironmentFlags(1 /* InParameters */, true);\n            updated = nodesVisitor(nodes, visitor, ts.isParameterDeclaration);\n            // As of ES2015, any runtime execution of that occurs in for a parameter (such as evaluating an\n            // initializer or a binding pattern), occurs in its own lexical scope. As a result, any expression\n            // that we might transform that introduces a temporary variable would fail as the temporary variable\n            // exists in a different lexical scope. To address this, we move any binding patterns and initializers\n            // in a parameter list to the body if we detect a variable being hoisted while visiting a parameter list\n            // when the emit target is greater than ES2015.\n            if (context.getLexicalEnvironmentFlags() & 2 /* VariablesHoistedInParameters */ &&\n                ts.getEmitScriptTarget(context.getCompilerOptions()) >= 2 /* ES2015 */) {\n                updated = addDefaultValueAssignmentsIfNeeded(updated, context);\n            }\n            context.setLexicalEnvironmentFlags(1 /* InParameters */, false);\n        }\n        context.suspendLexicalEnvironment();\n        return updated;\n    }\n    ts.visitParameterList = visitParameterList;\n    function addDefaultValueAssignmentsIfNeeded(parameters, context) {\n        var result;\n        for (var i = 0; i < parameters.length; i++) {\n            var parameter = parameters[i];\n            var updated = addDefaultValueAssignmentIfNeeded(parameter, context);\n            if (result || updated !== parameter) {\n                if (!result)\n                    result = parameters.slice(0, i);\n                result[i] = updated;\n            }\n        }\n        if (result) {\n            return ts.setTextRange(context.factory.createNodeArray(result, parameters.hasTrailingComma), parameters);\n        }\n        return parameters;\n    }\n    function addDefaultValueAssignmentIfNeeded(parameter, context) {\n        // A rest parameter cannot have a binding pattern or an initializer,\n        // so let's just ignore it.\n        return parameter.dotDotDotToken ? parameter :\n            ts.isBindingPattern(parameter.name) ? addDefaultValueAssignmentForBindingPattern(parameter, context) :\n                parameter.initializer ? addDefaultValueAssignmentForInitializer(parameter, parameter.name, parameter.initializer, context) :\n                    parameter;\n    }\n    function addDefaultValueAssignmentForBindingPattern(parameter, context) {\n        var factory = context.factory;\n        context.addInitializationStatement(factory.createVariableStatement(\n        /*modifiers*/ undefined, factory.createVariableDeclarationList([\n            factory.createVariableDeclaration(parameter.name, \n            /*exclamationToken*/ undefined, parameter.type, parameter.initializer ?\n                factory.createConditionalExpression(factory.createStrictEquality(factory.getGeneratedNameForNode(parameter), factory.createVoidZero()), \n                /*questionToken*/ undefined, parameter.initializer, \n                /*colonToken*/ undefined, factory.getGeneratedNameForNode(parameter)) :\n                factory.getGeneratedNameForNode(parameter)),\n        ])));\n        return factory.updateParameterDeclaration(parameter, parameter.decorators, parameter.modifiers, parameter.dotDotDotToken, factory.getGeneratedNameForNode(parameter), parameter.questionToken, parameter.type, \n        /*initializer*/ undefined);\n    }\n    function addDefaultValueAssignmentForInitializer(parameter, name, initializer, context) {\n        var factory = context.factory;\n        context.addInitializationStatement(factory.createIfStatement(factory.createTypeCheck(factory.cloneNode(name), \"undefined\"), ts.setEmitFlags(ts.setTextRange(factory.createBlock([\n            factory.createExpressionStatement(ts.setEmitFlags(ts.setTextRange(factory.createAssignment(ts.setEmitFlags(factory.cloneNode(name), 48 /* NoSourceMap */), ts.setEmitFlags(initializer, 48 /* NoSourceMap */ | ts.getEmitFlags(initializer) | 1536 /* NoComments */)), parameter), 1536 /* NoComments */))\n        ]), parameter), 1 /* SingleLine */ | 32 /* NoTrailingSourceMap */ | 384 /* NoTokenSourceMaps */ | 1536 /* NoComments */)));\n        return factory.updateParameterDeclaration(parameter, parameter.decorators, parameter.modifiers, parameter.dotDotDotToken, parameter.name, parameter.questionToken, parameter.type, \n        /*initializer*/ undefined);\n    }\n    function visitFunctionBody(node, visitor, context, nodeVisitor) {\n        if (nodeVisitor === void 0) { nodeVisitor = visitNode; }\n        context.resumeLexicalEnvironment();\n        var updated = nodeVisitor(node, visitor, ts.isConciseBody);\n        var declarations = context.endLexicalEnvironment();\n        if (ts.some(declarations)) {\n            if (!updated) {\n                return context.factory.createBlock(declarations);\n            }\n            var block = context.factory.converters.convertToFunctionBlock(updated);\n            var statements = ts.factory.mergeLexicalEnvironment(block.statements, declarations);\n            return context.factory.updateBlock(block, statements);\n        }\n        return updated;\n    }\n    ts.visitFunctionBody = visitFunctionBody;\n    function visitEachChild(node, visitor, context, nodesVisitor, tokenVisitor, nodeVisitor) {\n        if (nodesVisitor === void 0) { nodesVisitor = visitNodes; }\n        if (nodeVisitor === void 0) { nodeVisitor = visitNode; }\n        if (node === undefined) {\n            return undefined;\n        }\n        var kind = node.kind;\n        // No need to visit nodes with no children.\n        if ((kind > 0 /* FirstToken */ && kind <= 156 /* LastToken */) || kind === 187 /* ThisType */) {\n            return node;\n        }\n        var factory = context.factory;\n        switch (kind) {\n            // Names\n            case 78 /* Identifier */:\n                return factory.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration));\n            case 157 /* QualifiedName */:\n                return factory.updateQualifiedName(node, nodeVisitor(node.left, visitor, ts.isEntityName), nodeVisitor(node.right, visitor, ts.isIdentifier));\n            case 158 /* ComputedPropertyName */:\n                return factory.updateComputedPropertyName(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            // Signature elements\n            case 159 /* TypeParameter */:\n                return factory.updateTypeParameterDeclaration(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.constraint, visitor, ts.isTypeNode), nodeVisitor(node.default, visitor, ts.isTypeNode));\n            case 160 /* Parameter */:\n                return factory.updateParameterDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression));\n            case 161 /* Decorator */:\n                return factory.updateDecorator(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            // Type elements\n            case 162 /* PropertySignature */:\n                return factory.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode));\n            case 163 /* PropertyDeclaration */:\n                return factory.updatePropertyDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), \n                // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too\n                nodeVisitor(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression));\n            case 164 /* MethodSignature */:\n                return factory.updateMethodSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));\n            case 165 /* MethodDeclaration */:\n                return factory.updateMethodDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor));\n            case 166 /* Constructor */:\n                return factory.updateConstructorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor));\n            case 167 /* GetAccessor */:\n                return factory.updateGetAccessorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor));\n            case 168 /* SetAccessor */:\n                return factory.updateSetAccessorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor));\n            case 169 /* CallSignature */:\n                return factory.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));\n            case 170 /* ConstructSignature */:\n                return factory.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));\n            case 171 /* IndexSignature */:\n                return factory.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));\n            // Types\n            case 172 /* TypePredicate */:\n                return factory.updateTypePredicateNode(node, nodeVisitor(node.assertsModifier, visitor), nodeVisitor(node.parameterName, visitor), nodeVisitor(node.type, visitor, ts.isTypeNode));\n            case 173 /* TypeReference */:\n                return factory.updateTypeReferenceNode(node, nodeVisitor(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));\n            case 174 /* FunctionType */:\n                return factory.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));\n            case 175 /* ConstructorType */:\n                return factory.updateConstructorTypeNode(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));\n            case 176 /* TypeQuery */:\n                return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName));\n            case 177 /* TypeLiteral */:\n                return factory.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement));\n            case 178 /* ArrayType */:\n                return factory.updateArrayTypeNode(node, nodeVisitor(node.elementType, visitor, ts.isTypeNode));\n            case 179 /* TupleType */:\n                return factory.updateTupleTypeNode(node, nodesVisitor(node.elements, visitor, ts.isTypeNode));\n            case 180 /* OptionalType */:\n                return factory.updateOptionalTypeNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode));\n            case 181 /* RestType */:\n                return factory.updateRestTypeNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode));\n            case 182 /* UnionType */:\n                return factory.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode));\n            case 183 /* IntersectionType */:\n                return factory.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode));\n            case 184 /* ConditionalType */:\n                return factory.updateConditionalTypeNode(node, nodeVisitor(node.checkType, visitor, ts.isTypeNode), nodeVisitor(node.extendsType, visitor, ts.isTypeNode), nodeVisitor(node.trueType, visitor, ts.isTypeNode), nodeVisitor(node.falseType, visitor, ts.isTypeNode));\n            case 185 /* InferType */:\n                return factory.updateInferTypeNode(node, nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration));\n            case 195 /* ImportType */:\n                return factory.updateImportTypeNode(node, nodeVisitor(node.argument, visitor, ts.isTypeNode), nodeVisitor(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf);\n            case 192 /* NamedTupleMember */:\n                return factory.updateNamedTupleMember(node, visitNode(node.dotDotDotToken, visitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode));\n            case 186 /* ParenthesizedType */:\n                return factory.updateParenthesizedType(node, nodeVisitor(node.type, visitor, ts.isTypeNode));\n            case 188 /* TypeOperator */:\n                return factory.updateTypeOperatorNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode));\n            case 189 /* IndexedAccessType */:\n                return factory.updateIndexedAccessTypeNode(node, nodeVisitor(node.objectType, visitor, ts.isTypeNode), nodeVisitor(node.indexType, visitor, ts.isTypeNode));\n            case 190 /* MappedType */:\n                return factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.nameType, visitor, ts.isTypeNode), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode));\n            case 191 /* LiteralType */:\n                return factory.updateLiteralTypeNode(node, nodeVisitor(node.literal, visitor, ts.isExpression));\n            case 193 /* TemplateLiteralType */:\n                return factory.updateTemplateLiteralType(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateLiteralTypeSpan));\n            case 194 /* TemplateLiteralTypeSpan */:\n                return factory.updateTemplateLiteralTypeSpan(node, nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail));\n            // Binding patterns\n            case 196 /* ObjectBindingPattern */:\n                return factory.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement));\n            case 197 /* ArrayBindingPattern */:\n                return factory.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement));\n            case 198 /* BindingElement */:\n                return factory.updateBindingElement(node, nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.propertyName, visitor, ts.isPropertyName), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.initializer, visitor, ts.isExpression));\n            // Expression\n            case 199 /* ArrayLiteralExpression */:\n                return factory.updateArrayLiteralExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression));\n            case 200 /* ObjectLiteralExpression */:\n                return factory.updateObjectLiteralExpression(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike));\n            case 201 /* PropertyAccessExpression */:\n                if (node.flags & 32 /* OptionalChain */) {\n                    return factory.updatePropertyAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier));\n                }\n                return factory.updatePropertyAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.name, visitor, ts.isIdentifierOrPrivateIdentifier));\n            case 202 /* ElementAccessExpression */:\n                if (node.flags & 32 /* OptionalChain */) {\n                    return factory.updateElementAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.argumentExpression, visitor, ts.isExpression));\n                }\n                return factory.updateElementAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.argumentExpression, visitor, ts.isExpression));\n            case 203 /* CallExpression */:\n                if (node.flags & 32 /* OptionalChain */) {\n                    return factory.updateCallChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression));\n                }\n                return factory.updateCallExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression));\n            case 204 /* NewExpression */:\n                return factory.updateNewExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression));\n            case 205 /* TaggedTemplateExpression */:\n                return factory.updateTaggedTemplateExpression(node, nodeVisitor(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), nodeVisitor(node.template, visitor, ts.isTemplateLiteral));\n            case 206 /* TypeAssertionExpression */:\n                return factory.updateTypeAssertion(node, nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.expression, visitor, ts.isExpression));\n            case 207 /* ParenthesizedExpression */:\n                return factory.updateParenthesizedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            case 208 /* FunctionExpression */:\n                return factory.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor));\n            case 209 /* ArrowFunction */:\n                return factory.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context, nodeVisitor));\n            case 210 /* DeleteExpression */:\n                return factory.updateDeleteExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            case 211 /* TypeOfExpression */:\n                return factory.updateTypeOfExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            case 212 /* VoidExpression */:\n                return factory.updateVoidExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            case 213 /* AwaitExpression */:\n                return factory.updateAwaitExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            case 214 /* PrefixUnaryExpression */:\n                return factory.updatePrefixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts.isExpression));\n            case 215 /* PostfixUnaryExpression */:\n                return factory.updatePostfixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts.isExpression));\n            case 216 /* BinaryExpression */:\n                return factory.updateBinaryExpression(node, nodeVisitor(node.left, visitor, ts.isExpression), nodeVisitor(node.operatorToken, tokenVisitor, ts.isToken), nodeVisitor(node.right, visitor, ts.isExpression));\n            case 217 /* ConditionalExpression */:\n                return factory.updateConditionalExpression(node, nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.whenTrue, visitor, ts.isExpression), nodeVisitor(node.colonToken, tokenVisitor, ts.isToken), nodeVisitor(node.whenFalse, visitor, ts.isExpression));\n            case 218 /* TemplateExpression */:\n                return factory.updateTemplateExpression(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan));\n            case 219 /* YieldExpression */:\n                return factory.updateYieldExpression(node, nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.expression, visitor, ts.isExpression));\n            case 220 /* SpreadElement */:\n                return factory.updateSpreadElement(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            case 221 /* ClassExpression */:\n                return factory.updateClassExpression(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement));\n            case 223 /* ExpressionWithTypeArguments */:\n                return factory.updateExpressionWithTypeArguments(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));\n            case 224 /* AsExpression */:\n                return factory.updateAsExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.type, visitor, ts.isTypeNode));\n            case 225 /* NonNullExpression */:\n                if (node.flags & 32 /* OptionalChain */) {\n                    return factory.updateNonNullChain(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n                }\n                return factory.updateNonNullExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            case 226 /* MetaProperty */:\n                return factory.updateMetaProperty(node, nodeVisitor(node.name, visitor, ts.isIdentifier));\n            // Misc\n            case 228 /* TemplateSpan */:\n                return factory.updateTemplateSpan(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail));\n            // Element\n            case 230 /* Block */:\n                return factory.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement));\n            case 232 /* VariableStatement */:\n                return factory.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.declarationList, visitor, ts.isVariableDeclarationList));\n            case 233 /* ExpressionStatement */:\n                return factory.updateExpressionStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            case 234 /* IfStatement */:\n                return factory.updateIfStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.thenStatement, visitor, ts.isStatement, factory.liftToBlock), nodeVisitor(node.elseStatement, visitor, ts.isStatement, factory.liftToBlock));\n            case 235 /* DoStatement */:\n                return factory.updateDoStatement(node, nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock), nodeVisitor(node.expression, visitor, ts.isExpression));\n            case 236 /* WhileStatement */:\n                return factory.updateWhileStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock));\n            case 237 /* ForStatement */:\n                return factory.updateForStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.incrementor, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock));\n            case 238 /* ForInStatement */:\n                return factory.updateForInStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock));\n            case 239 /* ForOfStatement */:\n                return factory.updateForOfStatement(node, nodeVisitor(node.awaitModifier, tokenVisitor, ts.isToken), nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock));\n            case 240 /* ContinueStatement */:\n                return factory.updateContinueStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier));\n            case 241 /* BreakStatement */:\n                return factory.updateBreakStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier));\n            case 242 /* ReturnStatement */:\n                return factory.updateReturnStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            case 243 /* WithStatement */:\n                return factory.updateWithStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock));\n            case 244 /* SwitchStatement */:\n                return factory.updateSwitchStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.caseBlock, visitor, ts.isCaseBlock));\n            case 245 /* LabeledStatement */:\n                return factory.updateLabeledStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock));\n            case 246 /* ThrowStatement */:\n                return factory.updateThrowStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            case 247 /* TryStatement */:\n                return factory.updateTryStatement(node, nodeVisitor(node.tryBlock, visitor, ts.isBlock), nodeVisitor(node.catchClause, visitor, ts.isCatchClause), nodeVisitor(node.finallyBlock, visitor, ts.isBlock));\n            case 249 /* VariableDeclaration */:\n                return factory.updateVariableDeclaration(node, nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.exclamationToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression));\n            case 250 /* VariableDeclarationList */:\n                return factory.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration));\n            case 251 /* FunctionDeclaration */:\n                return factory.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor));\n            case 252 /* ClassDeclaration */:\n                return factory.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement));\n            case 253 /* InterfaceDeclaration */:\n                return factory.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement));\n            case 254 /* TypeAliasDeclaration */:\n                return factory.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));\n            case 255 /* EnumDeclaration */:\n                return factory.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember));\n            case 256 /* ModuleDeclaration */:\n                return factory.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.body, visitor, ts.isModuleBody));\n            case 257 /* ModuleBlock */:\n                return factory.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement));\n            case 258 /* CaseBlock */:\n                return factory.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause));\n            case 259 /* NamespaceExportDeclaration */:\n                return factory.updateNamespaceExportDeclaration(node, nodeVisitor(node.name, visitor, ts.isIdentifier));\n            case 260 /* ImportEqualsDeclaration */:\n                return factory.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), node.isTypeOnly, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.moduleReference, visitor, ts.isModuleReference));\n            case 261 /* ImportDeclaration */:\n                return factory.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.importClause, visitor, ts.isImportClause), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression));\n            case 262 /* ImportClause */:\n                return factory.updateImportClause(node, node.isTypeOnly, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.namedBindings, visitor, ts.isNamedImportBindings));\n            case 263 /* NamespaceImport */:\n                return factory.updateNamespaceImport(node, nodeVisitor(node.name, visitor, ts.isIdentifier));\n            case 269 /* NamespaceExport */:\n                return factory.updateNamespaceExport(node, nodeVisitor(node.name, visitor, ts.isIdentifier));\n            case 264 /* NamedImports */:\n                return factory.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier));\n            case 265 /* ImportSpecifier */:\n                return factory.updateImportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));\n            case 266 /* ExportAssignment */:\n                return factory.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.expression, visitor, ts.isExpression));\n            case 267 /* ExportDeclaration */:\n                return factory.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), node.isTypeOnly, nodeVisitor(node.exportClause, visitor, ts.isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression));\n            case 268 /* NamedExports */:\n                return factory.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier));\n            case 270 /* ExportSpecifier */:\n                return factory.updateExportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));\n            // Module references\n            case 272 /* ExternalModuleReference */:\n                return factory.updateExternalModuleReference(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            // JSX\n            case 273 /* JsxElement */:\n                return factory.updateJsxElement(node, nodeVisitor(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingElement, visitor, ts.isJsxClosingElement));\n            case 274 /* JsxSelfClosingElement */:\n                return factory.updateJsxSelfClosingElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.attributes, visitor, ts.isJsxAttributes));\n            case 275 /* JsxOpeningElement */:\n                return factory.updateJsxOpeningElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.attributes, visitor, ts.isJsxAttributes));\n            case 276 /* JsxClosingElement */:\n                return factory.updateJsxClosingElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression));\n            case 277 /* JsxFragment */:\n                return factory.updateJsxFragment(node, nodeVisitor(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingFragment, visitor, ts.isJsxClosingFragment));\n            case 280 /* JsxAttribute */:\n                return factory.updateJsxAttribute(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.initializer, visitor, ts.isStringLiteralOrJsxExpression));\n            case 281 /* JsxAttributes */:\n                return factory.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike));\n            case 282 /* JsxSpreadAttribute */:\n                return factory.updateJsxSpreadAttribute(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            case 283 /* JsxExpression */:\n                return factory.updateJsxExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            // Clauses\n            case 284 /* CaseClause */:\n                return factory.updateCaseClause(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement));\n            case 285 /* DefaultClause */:\n                return factory.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement));\n            case 286 /* HeritageClause */:\n                return factory.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments));\n            case 287 /* CatchClause */:\n                return factory.updateCatchClause(node, nodeVisitor(node.variableDeclaration, visitor, ts.isVariableDeclaration), nodeVisitor(node.block, visitor, ts.isBlock));\n            // Property assignments\n            case 288 /* PropertyAssignment */:\n                return factory.updatePropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));\n            case 289 /* ShorthandPropertyAssignment */:\n                return factory.updateShorthandPropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.objectAssignmentInitializer, visitor, ts.isExpression));\n            case 290 /* SpreadAssignment */:\n                return factory.updateSpreadAssignment(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            // Enum\n            case 291 /* EnumMember */:\n                return factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));\n            // Top-level nodes\n            case 297 /* SourceFile */:\n                return factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));\n            // Transformation nodes\n            case 336 /* PartiallyEmittedExpression */:\n                return factory.updatePartiallyEmittedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));\n            case 337 /* CommaListExpression */:\n                return factory.updateCommaListExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression));\n            default:\n                // No need to visit nodes with no children.\n                return node;\n        }\n    }\n    ts.visitEachChild = visitEachChild;\n    /**\n     * Extracts the single node from a NodeArray.\n     *\n     * @param nodes The NodeArray.\n     */\n    function extractSingleNode(nodes) {\n        ts.Debug.assert(nodes.length <= 1, \"Too many nodes written to output.\");\n        return ts.singleOrUndefined(nodes);\n    }\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    function createSourceMapGenerator(host, file, sourceRoot, sourcesDirectoryPath, generatorOptions) {\n        var _a = generatorOptions.extendedDiagnostics\n            ? ts.performance.createTimer(\"Source Map\", \"beforeSourcemap\", \"afterSourcemap\")\n            : ts.performance.nullTimer, enter = _a.enter, exit = _a.exit;\n        // Current source map file and its index in the sources list\n        var rawSources = [];\n        var sources = [];\n        var sourceToSourceIndexMap = new ts.Map();\n        var sourcesContent;\n        var names = [];\n        var nameToNameIndexMap;\n        var mappings = \"\";\n        // Last recorded and encoded mappings\n        var lastGeneratedLine = 0;\n        var lastGeneratedCharacter = 0;\n        var lastSourceIndex = 0;\n        var lastSourceLine = 0;\n        var lastSourceCharacter = 0;\n        var lastNameIndex = 0;\n        var hasLast = false;\n        var pendingGeneratedLine = 0;\n        var pendingGeneratedCharacter = 0;\n        var pendingSourceIndex = 0;\n        var pendingSourceLine = 0;\n        var pendingSourceCharacter = 0;\n        var pendingNameIndex = 0;\n        var hasPending = false;\n        var hasPendingSource = false;\n        var hasPendingName = false;\n        return {\n            getSources: function () { return rawSources; },\n            addSource: addSource,\n            setSourceContent: setSourceContent,\n            addName: addName,\n            addMapping: addMapping,\n            appendSourceMap: appendSourceMap,\n            toJSON: toJSON,\n            toString: function () { return JSON.stringify(toJSON()); }\n        };\n        function addSource(fileName) {\n            enter();\n            var source = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, fileName, host.getCurrentDirectory(), host.getCanonicalFileName, \n            /*isAbsolutePathAnUrl*/ true);\n            var sourceIndex = sourceToSourceIndexMap.get(source);\n            if (sourceIndex === undefined) {\n                sourceIndex = sources.length;\n                sources.push(source);\n                rawSources.push(fileName);\n                sourceToSourceIndexMap.set(source, sourceIndex);\n            }\n            exit();\n            return sourceIndex;\n        }\n        /* eslint-disable boolean-trivia, no-null/no-null */\n        function setSourceContent(sourceIndex, content) {\n            enter();\n            if (content !== null) {\n                if (!sourcesContent)\n                    sourcesContent = [];\n                while (sourcesContent.length < sourceIndex) {\n                    sourcesContent.push(null);\n                }\n                sourcesContent[sourceIndex] = content;\n            }\n            exit();\n        }\n        /* eslint-enable boolean-trivia, no-null/no-null */\n        function addName(name) {\n            enter();\n            if (!nameToNameIndexMap)\n                nameToNameIndexMap = new ts.Map();\n            var nameIndex = nameToNameIndexMap.get(name);\n            if (nameIndex === undefined) {\n                nameIndex = names.length;\n                names.push(name);\n                nameToNameIndexMap.set(name, nameIndex);\n            }\n            exit();\n            return nameIndex;\n        }\n        function isNewGeneratedPosition(generatedLine, generatedCharacter) {\n            return !hasPending\n                || pendingGeneratedLine !== generatedLine\n                || pendingGeneratedCharacter !== generatedCharacter;\n        }\n        function isBacktrackingSourcePosition(sourceIndex, sourceLine, sourceCharacter) {\n            return sourceIndex !== undefined\n                && sourceLine !== undefined\n                && sourceCharacter !== undefined\n                && pendingSourceIndex === sourceIndex\n                && (pendingSourceLine > sourceLine\n                    || pendingSourceLine === sourceLine && pendingSourceCharacter > sourceCharacter);\n        }\n        function addMapping(generatedLine, generatedCharacter, sourceIndex, sourceLine, sourceCharacter, nameIndex) {\n            ts.Debug.assert(generatedLine >= pendingGeneratedLine, \"generatedLine cannot backtrack\");\n            ts.Debug.assert(generatedCharacter >= 0, \"generatedCharacter cannot be negative\");\n            ts.Debug.assert(sourceIndex === undefined || sourceIndex >= 0, \"sourceIndex cannot be negative\");\n            ts.Debug.assert(sourceLine === undefined || sourceLine >= 0, \"sourceLine cannot be negative\");\n            ts.Debug.assert(sourceCharacter === undefined || sourceCharacter >= 0, \"sourceCharacter cannot be negative\");\n            enter();\n            // If this location wasn't recorded or the location in source is going backwards, record the mapping\n            if (isNewGeneratedPosition(generatedLine, generatedCharacter) ||\n                isBacktrackingSourcePosition(sourceIndex, sourceLine, sourceCharacter)) {\n                commitPendingMapping();\n                pendingGeneratedLine = generatedLine;\n                pendingGeneratedCharacter = generatedCharacter;\n                hasPendingSource = false;\n                hasPendingName = false;\n                hasPending = true;\n            }\n            if (sourceIndex !== undefined && sourceLine !== undefined && sourceCharacter !== undefined) {\n                pendingSourceIndex = sourceIndex;\n                pendingSourceLine = sourceLine;\n                pendingSourceCharacter = sourceCharacter;\n                hasPendingSource = true;\n                if (nameIndex !== undefined) {\n                    pendingNameIndex = nameIndex;\n                    hasPendingName = true;\n                }\n            }\n            exit();\n        }\n        function appendSourceMap(generatedLine, generatedCharacter, map, sourceMapPath, start, end) {\n            ts.Debug.assert(generatedLine >= pendingGeneratedLine, \"generatedLine cannot backtrack\");\n            ts.Debug.assert(generatedCharacter >= 0, \"generatedCharacter cannot be negative\");\n            enter();\n            // First, decode the old component sourcemap\n            var sourceIndexToNewSourceIndexMap = [];\n            var nameIndexToNewNameIndexMap;\n            var mappingIterator = decodeMappings(map.mappings);\n            for (var iterResult = mappingIterator.next(); !iterResult.done; iterResult = mappingIterator.next()) {\n                var raw = iterResult.value;\n                if (end && (raw.generatedLine > end.line ||\n                    (raw.generatedLine === end.line && raw.generatedCharacter > end.character))) {\n                    break;\n                }\n                if (start && (raw.generatedLine < start.line ||\n                    (start.line === raw.generatedLine && raw.generatedCharacter < start.character))) {\n                    continue;\n                }\n                // Then reencode all the updated mappings into the overall map\n                var newSourceIndex = void 0;\n                var newSourceLine = void 0;\n                var newSourceCharacter = void 0;\n                var newNameIndex = void 0;\n                if (raw.sourceIndex !== undefined) {\n                    newSourceIndex = sourceIndexToNewSourceIndexMap[raw.sourceIndex];\n                    if (newSourceIndex === undefined) {\n                        // Apply offsets to each position and fixup source entries\n                        var rawPath = map.sources[raw.sourceIndex];\n                        var relativePath = map.sourceRoot ? ts.combinePaths(map.sourceRoot, rawPath) : rawPath;\n                        var combinedPath = ts.combinePaths(ts.getDirectoryPath(sourceMapPath), relativePath);\n                        sourceIndexToNewSourceIndexMap[raw.sourceIndex] = newSourceIndex = addSource(combinedPath);\n                        if (map.sourcesContent && typeof map.sourcesContent[raw.sourceIndex] === \"string\") {\n                            setSourceContent(newSourceIndex, map.sourcesContent[raw.sourceIndex]);\n                        }\n                    }\n                    newSourceLine = raw.sourceLine;\n                    newSourceCharacter = raw.sourceCharacter;\n                    if (map.names && raw.nameIndex !== undefined) {\n                        if (!nameIndexToNewNameIndexMap)\n                            nameIndexToNewNameIndexMap = [];\n                        newNameIndex = nameIndexToNewNameIndexMap[raw.nameIndex];\n                        if (newNameIndex === undefined) {\n                            nameIndexToNewNameIndexMap[raw.nameIndex] = newNameIndex = addName(map.names[raw.nameIndex]);\n                        }\n                    }\n                }\n                var rawGeneratedLine = raw.generatedLine - (start ? start.line : 0);\n                var newGeneratedLine = rawGeneratedLine + generatedLine;\n                var rawGeneratedCharacter = start && start.line === raw.generatedLine ? raw.generatedCharacter - start.character : raw.generatedCharacter;\n                var newGeneratedCharacter = rawGeneratedLine === 0 ? rawGeneratedCharacter + generatedCharacter : rawGeneratedCharacter;\n                addMapping(newGeneratedLine, newGeneratedCharacter, newSourceIndex, newSourceLine, newSourceCharacter, newNameIndex);\n            }\n            exit();\n        }\n        function shouldCommitMapping() {\n            return !hasLast\n                || lastGeneratedLine !== pendingGeneratedLine\n                || lastGeneratedCharacter !== pendingGeneratedCharacter\n                || lastSourceIndex !== pendingSourceIndex\n                || lastSourceLine !== pendingSourceLine\n                || lastSourceCharacter !== pendingSourceCharacter\n                || lastNameIndex !== pendingNameIndex;\n        }\n        function commitPendingMapping() {\n            if (!hasPending || !shouldCommitMapping()) {\n                return;\n            }\n            enter();\n            // Line/Comma delimiters\n            if (lastGeneratedLine < pendingGeneratedLine) {\n                // Emit line delimiters\n                do {\n                    mappings += \";\";\n                    lastGeneratedLine++;\n                    lastGeneratedCharacter = 0;\n                } while (lastGeneratedLine < pendingGeneratedLine);\n            }\n            else {\n                ts.Debug.assertEqual(lastGeneratedLine, pendingGeneratedLine, \"generatedLine cannot backtrack\");\n                // Emit comma to separate the entry\n                if (hasLast) {\n                    mappings += \",\";\n                }\n            }\n            // 1. Relative generated character\n            mappings += base64VLQFormatEncode(pendingGeneratedCharacter - lastGeneratedCharacter);\n            lastGeneratedCharacter = pendingGeneratedCharacter;\n            if (hasPendingSource) {\n                // 2. Relative sourceIndex\n                mappings += base64VLQFormatEncode(pendingSourceIndex - lastSourceIndex);\n                lastSourceIndex = pendingSourceIndex;\n                // 3. Relative source line\n                mappings += base64VLQFormatEncode(pendingSourceLine - lastSourceLine);\n                lastSourceLine = pendingSourceLine;\n                // 4. Relative source character\n                mappings += base64VLQFormatEncode(pendingSourceCharacter - lastSourceCharacter);\n                lastSourceCharacter = pendingSourceCharacter;\n                if (hasPendingName) {\n                    // 5. Relative nameIndex\n                    mappings += base64VLQFormatEncode(pendingNameIndex - lastNameIndex);\n                    lastNameIndex = pendingNameIndex;\n                }\n            }\n            hasLast = true;\n            exit();\n        }\n        function toJSON() {\n            commitPendingMapping();\n            return {\n                version: 3,\n                file: file,\n                sourceRoot: sourceRoot,\n                sources: sources,\n                names: names,\n                mappings: mappings,\n                sourcesContent: sourcesContent,\n            };\n        }\n    }\n    ts.createSourceMapGenerator = createSourceMapGenerator;\n    // Sometimes tools can see the following line as a source mapping url comment, so we mangle it a bit (the [M])\n    var sourceMapCommentRegExp = /^\\/\\/[@#] source[M]appingURL=(.+)\\s*$/;\n    var whitespaceOrMapCommentRegExp = /^\\s*(\\/\\/[@#] .*)?$/;\n    function getLineInfo(text, lineStarts) {\n        return {\n            getLineCount: function () { return lineStarts.length; },\n            getLineText: function (line) { return text.substring(lineStarts[line], lineStarts[line + 1]); }\n        };\n    }\n    ts.getLineInfo = getLineInfo;\n    /**\n     * Tries to find the sourceMappingURL comment at the end of a file.\n     */\n    function tryGetSourceMappingURL(lineInfo) {\n        for (var index = lineInfo.getLineCount() - 1; index >= 0; index--) {\n            var line = lineInfo.getLineText(index);\n            var comment = sourceMapCommentRegExp.exec(line);\n            if (comment) {\n                return comment[1];\n            }\n            // If we see a non-whitespace/map comment-like line, break, to avoid scanning up the entire file\n            else if (!line.match(whitespaceOrMapCommentRegExp)) {\n                break;\n            }\n        }\n    }\n    ts.tryGetSourceMappingURL = tryGetSourceMappingURL;\n    /* eslint-disable no-null/no-null */\n    function isStringOrNull(x) {\n        return typeof x === \"string\" || x === null;\n    }\n    function isRawSourceMap(x) {\n        return x !== null\n            && typeof x === \"object\"\n            && x.version === 3\n            && typeof x.file === \"string\"\n            && typeof x.mappings === \"string\"\n            && ts.isArray(x.sources) && ts.every(x.sources, ts.isString)\n            && (x.sourceRoot === undefined || x.sourceRoot === null || typeof x.sourceRoot === \"string\")\n            && (x.sourcesContent === undefined || x.sourcesContent === null || ts.isArray(x.sourcesContent) && ts.every(x.sourcesContent, isStringOrNull))\n            && (x.names === undefined || x.names === null || ts.isArray(x.names) && ts.every(x.names, ts.isString));\n    }\n    ts.isRawSourceMap = isRawSourceMap;\n    /* eslint-enable no-null/no-null */\n    function tryParseRawSourceMap(text) {\n        try {\n            var parsed = JSON.parse(text);\n            if (isRawSourceMap(parsed)) {\n                return parsed;\n            }\n        }\n        catch (_a) {\n            // empty\n        }\n        return undefined;\n    }\n    ts.tryParseRawSourceMap = tryParseRawSourceMap;\n    function decodeMappings(mappings) {\n        var done = false;\n        var pos = 0;\n        var generatedLine = 0;\n        var generatedCharacter = 0;\n        var sourceIndex = 0;\n        var sourceLine = 0;\n        var sourceCharacter = 0;\n        var nameIndex = 0;\n        var error;\n        return {\n            get pos() { return pos; },\n            get error() { return error; },\n            get state() { return captureMapping(/*hasSource*/ true, /*hasName*/ true); },\n            next: function () {\n                while (!done && pos < mappings.length) {\n                    var ch = mappings.charCodeAt(pos);\n                    if (ch === 59 /* semicolon */) {\n                        // new line\n                        generatedLine++;\n                        generatedCharacter = 0;\n                        pos++;\n                        continue;\n                    }\n                    if (ch === 44 /* comma */) {\n                        // Next entry is on same line - no action needed\n                        pos++;\n                        continue;\n                    }\n                    var hasSource = false;\n                    var hasName = false;\n                    generatedCharacter += base64VLQFormatDecode();\n                    if (hasReportedError())\n                        return stopIterating();\n                    if (generatedCharacter < 0)\n                        return setErrorAndStopIterating(\"Invalid generatedCharacter found\");\n                    if (!isSourceMappingSegmentEnd()) {\n                        hasSource = true;\n                        sourceIndex += base64VLQFormatDecode();\n                        if (hasReportedError())\n                            return stopIterating();\n                        if (sourceIndex < 0)\n                            return setErrorAndStopIterating(\"Invalid sourceIndex found\");\n                        if (isSourceMappingSegmentEnd())\n                            return setErrorAndStopIterating(\"Unsupported Format: No entries after sourceIndex\");\n                        sourceLine += base64VLQFormatDecode();\n                        if (hasReportedError())\n                            return stopIterating();\n                        if (sourceLine < 0)\n                            return setErrorAndStopIterating(\"Invalid sourceLine found\");\n                        if (isSourceMappingSegmentEnd())\n                            return setErrorAndStopIterating(\"Unsupported Format: No entries after sourceLine\");\n                        sourceCharacter += base64VLQFormatDecode();\n                        if (hasReportedError())\n                            return stopIterating();\n                        if (sourceCharacter < 0)\n                            return setErrorAndStopIterating(\"Invalid sourceCharacter found\");\n                        if (!isSourceMappingSegmentEnd()) {\n                            hasName = true;\n                            nameIndex += base64VLQFormatDecode();\n                            if (hasReportedError())\n                                return stopIterating();\n                            if (nameIndex < 0)\n                                return setErrorAndStopIterating(\"Invalid nameIndex found\");\n                            if (!isSourceMappingSegmentEnd())\n                                return setErrorAndStopIterating(\"Unsupported Error Format: Entries after nameIndex\");\n                        }\n                    }\n                    return { value: captureMapping(hasSource, hasName), done: done };\n                }\n                return stopIterating();\n            }\n        };\n        function captureMapping(hasSource, hasName) {\n            return {\n                generatedLine: generatedLine,\n                generatedCharacter: generatedCharacter,\n                sourceIndex: hasSource ? sourceIndex : undefined,\n                sourceLine: hasSource ? sourceLine : undefined,\n                sourceCharacter: hasSource ? sourceCharacter : undefined,\n                nameIndex: hasName ? nameIndex : undefined\n            };\n        }\n        function stopIterating() {\n            done = true;\n            return { value: undefined, done: true };\n        }\n        function setError(message) {\n            if (error === undefined) {\n                error = message;\n            }\n        }\n        function setErrorAndStopIterating(message) {\n            setError(message);\n            return stopIterating();\n        }\n        function hasReportedError() {\n            return error !== undefined;\n        }\n        function isSourceMappingSegmentEnd() {\n            return (pos === mappings.length ||\n                mappings.charCodeAt(pos) === 44 /* comma */ ||\n                mappings.charCodeAt(pos) === 59 /* semicolon */);\n        }\n        function base64VLQFormatDecode() {\n            var moreDigits = true;\n            var shiftCount = 0;\n            var value = 0;\n            for (; moreDigits; pos++) {\n                if (pos >= mappings.length)\n                    return setError(\"Error in decoding base64VLQFormatDecode, past the mapping string\"), -1;\n                // 6 digit number\n                var currentByte = base64FormatDecode(mappings.charCodeAt(pos));\n                if (currentByte === -1)\n                    return setError(\"Invalid character in VLQ\"), -1;\n                // If msb is set, we still have more bits to continue\n                moreDigits = (currentByte & 32) !== 0;\n                // least significant 5 bits are the next msbs in the final value.\n                value = value | ((currentByte & 31) << shiftCount);\n                shiftCount += 5;\n            }\n            // Least significant bit if 1 represents negative and rest of the msb is actual absolute value\n            if ((value & 1) === 0) {\n                // + number\n                value = value >> 1;\n            }\n            else {\n                // - number\n                value = value >> 1;\n                value = -value;\n            }\n            return value;\n        }\n    }\n    ts.decodeMappings = decodeMappings;\n    function sameMapping(left, right) {\n        return left === right\n            || left.generatedLine === right.generatedLine\n                && left.generatedCharacter === right.generatedCharacter\n                && left.sourceIndex === right.sourceIndex\n                && left.sourceLine === right.sourceLine\n                && left.sourceCharacter === right.sourceCharacter\n                && left.nameIndex === right.nameIndex;\n    }\n    ts.sameMapping = sameMapping;\n    function isSourceMapping(mapping) {\n        return mapping.sourceIndex !== undefined\n            && mapping.sourceLine !== undefined\n            && mapping.sourceCharacter !== undefined;\n    }\n    ts.isSourceMapping = isSourceMapping;\n    function base64FormatEncode(value) {\n        return value >= 0 && value < 26 ? 65 /* A */ + value :\n            value >= 26 && value < 52 ? 97 /* a */ + value - 26 :\n                value >= 52 && value < 62 ? 48 /* _0 */ + value - 52 :\n                    value === 62 ? 43 /* plus */ :\n                        value === 63 ? 47 /* slash */ :\n                            ts.Debug.fail(value + \": not a base64 value\");\n    }\n    function base64FormatDecode(ch) {\n        return ch >= 65 /* A */ && ch <= 90 /* Z */ ? ch - 65 /* A */ :\n            ch >= 97 /* a */ && ch <= 122 /* z */ ? ch - 97 /* a */ + 26 :\n                ch >= 48 /* _0 */ && ch <= 57 /* _9 */ ? ch - 48 /* _0 */ + 52 :\n                    ch === 43 /* plus */ ? 62 :\n                        ch === 47 /* slash */ ? 63 :\n                            -1;\n    }\n    function base64VLQFormatEncode(inValue) {\n        // Add a new least significant bit that has the sign of the value.\n        // if negative number the least significant bit that gets added to the number has value 1\n        // else least significant bit value that gets added is 0\n        // eg. -1 changes to binary : 01 [1] => 3\n        //     +1 changes to binary : 01 [0] => 2\n        if (inValue < 0) {\n            inValue = ((-inValue) << 1) + 1;\n        }\n        else {\n            inValue = inValue << 1;\n        }\n        // Encode 5 bits at a time starting from least significant bits\n        var encodedStr = \"\";\n        do {\n            var currentDigit = inValue & 31; // 11111\n            inValue = inValue >> 5;\n            if (inValue > 0) {\n                // There are still more digits to decode, set the msb (6th bit)\n                currentDigit = currentDigit | 32;\n            }\n            encodedStr = encodedStr + String.fromCharCode(base64FormatEncode(currentDigit));\n        } while (inValue > 0);\n        return encodedStr;\n    }\n    function isSourceMappedPosition(value) {\n        return value.sourceIndex !== undefined\n            && value.sourcePosition !== undefined;\n    }\n    function sameMappedPosition(left, right) {\n        return left.generatedPosition === right.generatedPosition\n            && left.sourceIndex === right.sourceIndex\n            && left.sourcePosition === right.sourcePosition;\n    }\n    function compareSourcePositions(left, right) {\n        // Compares sourcePosition without comparing sourceIndex\n        // since the mappings are grouped by sourceIndex\n        ts.Debug.assert(left.sourceIndex === right.sourceIndex);\n        return ts.compareValues(left.sourcePosition, right.sourcePosition);\n    }\n    function compareGeneratedPositions(left, right) {\n        return ts.compareValues(left.generatedPosition, right.generatedPosition);\n    }\n    function getSourcePositionOfMapping(value) {\n        return value.sourcePosition;\n    }\n    function getGeneratedPositionOfMapping(value) {\n        return value.generatedPosition;\n    }\n    function createDocumentPositionMapper(host, map, mapPath) {\n        var mapDirectory = ts.getDirectoryPath(mapPath);\n        var sourceRoot = map.sourceRoot ? ts.getNormalizedAbsolutePath(map.sourceRoot, mapDirectory) : mapDirectory;\n        var generatedAbsoluteFilePath = ts.getNormalizedAbsolutePath(map.file, mapDirectory);\n        var generatedFile = host.getSourceFileLike(generatedAbsoluteFilePath);\n        var sourceFileAbsolutePaths = map.sources.map(function (source) { return ts.getNormalizedAbsolutePath(source, sourceRoot); });\n        var sourceToSourceIndexMap = new ts.Map(sourceFileAbsolutePaths.map(function (source, i) { return [host.getCanonicalFileName(source), i]; }));\n        var decodedMappings;\n        var generatedMappings;\n        var sourceMappings;\n        return {\n            getSourcePosition: getSourcePosition,\n            getGeneratedPosition: getGeneratedPosition\n        };\n        function processMapping(mapping) {\n            var generatedPosition = generatedFile !== undefined\n                ? ts.getPositionOfLineAndCharacter(generatedFile, mapping.generatedLine, mapping.generatedCharacter, /*allowEdits*/ true)\n                : -1;\n            var source;\n            var sourcePosition;\n            if (isSourceMapping(mapping)) {\n                var sourceFile = host.getSourceFileLike(sourceFileAbsolutePaths[mapping.sourceIndex]);\n                source = map.sources[mapping.sourceIndex];\n                sourcePosition = sourceFile !== undefined\n                    ? ts.getPositionOfLineAndCharacter(sourceFile, mapping.sourceLine, mapping.sourceCharacter, /*allowEdits*/ true)\n                    : -1;\n            }\n            return {\n                generatedPosition: generatedPosition,\n                source: source,\n                sourceIndex: mapping.sourceIndex,\n                sourcePosition: sourcePosition,\n                nameIndex: mapping.nameIndex\n            };\n        }\n        function getDecodedMappings() {\n            if (decodedMappings === undefined) {\n                var decoder = decodeMappings(map.mappings);\n                var mappings = ts.arrayFrom(decoder, processMapping);\n                if (decoder.error !== undefined) {\n                    if (host.log) {\n                        host.log(\"Encountered error while decoding sourcemap: \" + decoder.error);\n                    }\n                    decodedMappings = ts.emptyArray;\n                }\n                else {\n                    decodedMappings = mappings;\n                }\n            }\n            return decodedMappings;\n        }\n        function getSourceMappings(sourceIndex) {\n            if (sourceMappings === undefined) {\n                var lists = [];\n                for (var _i = 0, _a = getDecodedMappings(); _i < _a.length; _i++) {\n                    var mapping = _a[_i];\n                    if (!isSourceMappedPosition(mapping))\n                        continue;\n                    var list = lists[mapping.sourceIndex];\n                    if (!list)\n                        lists[mapping.sourceIndex] = list = [];\n                    list.push(mapping);\n                }\n                sourceMappings = lists.map(function (list) { return ts.sortAndDeduplicate(list, compareSourcePositions, sameMappedPosition); });\n            }\n            return sourceMappings[sourceIndex];\n        }\n        function getGeneratedMappings() {\n            if (generatedMappings === undefined) {\n                var list = [];\n                for (var _i = 0, _a = getDecodedMappings(); _i < _a.length; _i++) {\n                    var mapping = _a[_i];\n                    list.push(mapping);\n                }\n                generatedMappings = ts.sortAndDeduplicate(list, compareGeneratedPositions, sameMappedPosition);\n            }\n            return generatedMappings;\n        }\n        function getGeneratedPosition(loc) {\n            var sourceIndex = sourceToSourceIndexMap.get(host.getCanonicalFileName(loc.fileName));\n            if (sourceIndex === undefined)\n                return loc;\n            var sourceMappings = getSourceMappings(sourceIndex);\n            if (!ts.some(sourceMappings))\n                return loc;\n            var targetIndex = ts.binarySearchKey(sourceMappings, loc.pos, getSourcePositionOfMapping, ts.compareValues);\n            if (targetIndex < 0) {\n                // if no exact match, closest is 2's complement of result\n                targetIndex = ~targetIndex;\n            }\n            var mapping = sourceMappings[targetIndex];\n            if (mapping === undefined || mapping.sourceIndex !== sourceIndex) {\n                return loc;\n            }\n            return { fileName: generatedAbsoluteFilePath, pos: mapping.generatedPosition }; // Closest pos\n        }\n        function getSourcePosition(loc) {\n            var generatedMappings = getGeneratedMappings();\n            if (!ts.some(generatedMappings))\n                return loc;\n            var targetIndex = ts.binarySearchKey(generatedMappings, loc.pos, getGeneratedPositionOfMapping, ts.compareValues);\n            if (targetIndex < 0) {\n                // if no exact match, closest is 2's complement of result\n                targetIndex = ~targetIndex;\n            }\n            var mapping = generatedMappings[targetIndex];\n            if (mapping === undefined || !isSourceMappedPosition(mapping)) {\n                return loc;\n            }\n            return { fileName: sourceFileAbsolutePaths[mapping.sourceIndex], pos: mapping.sourcePosition }; // Closest pos\n        }\n    }\n    ts.createDocumentPositionMapper = createDocumentPositionMapper;\n    ts.identitySourceMapConsumer = {\n        getSourcePosition: ts.identity,\n        getGeneratedPosition: ts.identity\n    };\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    function getOriginalNodeId(node) {\n        node = ts.getOriginalNode(node);\n        return node ? ts.getNodeId(node) : 0;\n    }\n    ts.getOriginalNodeId = getOriginalNodeId;\n    function containsDefaultReference(node) {\n        if (!node)\n            return false;\n        if (!ts.isNamedImports(node))\n            return false;\n        return ts.some(node.elements, isNamedDefaultReference);\n    }\n    function isNamedDefaultReference(e) {\n        return e.propertyName !== undefined && e.propertyName.escapedText === \"default\" /* Default */;\n    }\n    function chainBundle(context, transformSourceFile) {\n        return transformSourceFileOrBundle;\n        function transformSourceFileOrBundle(node) {\n            return node.kind === 297 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node);\n        }\n        function transformBundle(node) {\n            return context.factory.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends);\n        }\n    }\n    ts.chainBundle = chainBundle;\n    function getExportNeedsImportStarHelper(node) {\n        return !!ts.getNamespaceDeclarationNode(node);\n    }\n    ts.getExportNeedsImportStarHelper = getExportNeedsImportStarHelper;\n    function getImportNeedsImportStarHelper(node) {\n        if (!!ts.getNamespaceDeclarationNode(node)) {\n            return true;\n        }\n        var bindings = node.importClause && node.importClause.namedBindings;\n        if (!bindings) {\n            return false;\n        }\n        if (!ts.isNamedImports(bindings))\n            return false;\n        var defaultRefCount = 0;\n        for (var _i = 0, _a = bindings.elements; _i < _a.length; _i++) {\n            var binding = _a[_i];\n            if (isNamedDefaultReference(binding)) {\n                defaultRefCount++;\n            }\n        }\n        // Import star is required if there's default named refs mixed with non-default refs, or if theres non-default refs and it has a default import\n        return (defaultRefCount > 0 && defaultRefCount !== bindings.elements.length) || (!!(bindings.elements.length - defaultRefCount) && ts.isDefaultImport(node));\n    }\n    ts.getImportNeedsImportStarHelper = getImportNeedsImportStarHelper;\n    function getImportNeedsImportDefaultHelper(node) {\n        // Import default is needed if there's a default import or a default ref and no other refs (meaning an import star helper wasn't requested)\n        return !getImportNeedsImportStarHelper(node) && (ts.isDefaultImport(node) || (!!node.importClause && ts.isNamedImports(node.importClause.namedBindings) && containsDefaultReference(node.importClause.namedBindings))); // TODO: GH#18217\n    }\n    ts.getImportNeedsImportDefaultHelper = getImportNeedsImportDefaultHelper;\n    function collectExternalModuleInfo(context, sourceFile, resolver, compilerOptions) {\n        var externalImports = [];\n        var exportSpecifiers = ts.createMultiMap();\n        var exportedBindings = [];\n        var uniqueExports = new ts.Map();\n        var exportedNames;\n        var hasExportDefault = false;\n        var exportEquals;\n        var hasExportStarsToExportValues = false;\n        var hasImportStar = false;\n        var hasImportDefault = false;\n        for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {\n            var node = _a[_i];\n            switch (node.kind) {\n                case 261 /* ImportDeclaration */:\n                    // import \"mod\"\n                    // import x from \"mod\"\n                    // import * as x from \"mod\"\n                    // import { x, y } from \"mod\"\n                    externalImports.push(node);\n                    if (!hasImportStar && getImportNeedsImportStarHelper(node)) {\n                        hasImportStar = true;\n                    }\n                    if (!hasImportDefault && getImportNeedsImportDefaultHelper(node)) {\n                        hasImportDefault = true;\n                    }\n                    break;\n                case 260 /* ImportEqualsDeclaration */:\n                    if (node.moduleReference.kind === 272 /* ExternalModuleReference */) {\n                        // import x = require(\"mod\")\n                        externalImports.push(node);\n                    }\n                    break;\n                case 267 /* ExportDeclaration */:\n                    if (node.moduleSpecifier) {\n                        if (!node.exportClause) {\n                            // export * from \"mod\"\n                            externalImports.push(node);\n                            hasExportStarsToExportValues = true;\n                        }\n                        else {\n                            // export * as ns from \"mod\"\n                            // export { x, y } from \"mod\"\n                            externalImports.push(node);\n                            if (ts.isNamedExports(node.exportClause)) {\n                                addExportedNamesForExportDeclaration(node);\n                            }\n                            else {\n                                var name = node.exportClause.name;\n                                if (!uniqueExports.get(ts.idText(name))) {\n                                    multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);\n                                    uniqueExports.set(ts.idText(name), true);\n                                    exportedNames = ts.append(exportedNames, name);\n                                }\n                                // we use the same helpers for `export * as ns` as we do for `import * as ns`\n                                hasImportStar = true;\n                            }\n                        }\n                    }\n                    else {\n                        // export { x, y }\n                        addExportedNamesForExportDeclaration(node);\n                    }\n                    break;\n                case 266 /* ExportAssignment */:\n                    if (node.isExportEquals && !exportEquals) {\n                        // export = x\n                        exportEquals = node;\n                    }\n                    break;\n                case 232 /* VariableStatement */:\n                    if (ts.hasSyntacticModifier(node, 1 /* Export */)) {\n                        for (var _b = 0, _c = node.declarationList.declarations; _b < _c.length; _b++) {\n                            var decl = _c[_b];\n                            exportedNames = collectExportedVariableInfo(decl, uniqueExports, exportedNames);\n                        }\n                    }\n                    break;\n                case 251 /* FunctionDeclaration */:\n                    if (ts.hasSyntacticModifier(node, 1 /* Export */)) {\n                        if (ts.hasSyntacticModifier(node, 512 /* Default */)) {\n                            // export default function() { }\n                            if (!hasExportDefault) {\n                                multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node));\n                                hasExportDefault = true;\n                            }\n                        }\n                        else {\n                            // export function x() { }\n                            var name = node.name;\n                            if (!uniqueExports.get(ts.idText(name))) {\n                                multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);\n                                uniqueExports.set(ts.idText(name), true);\n                                exportedNames = ts.append(exportedNames, name);\n                            }\n                        }\n                    }\n                    break;\n                case 252 /* ClassDeclaration */:\n                    if (ts.hasSyntacticModifier(node, 1 /* Export */)) {\n                        if (ts.hasSyntacticModifier(node, 512 /* Default */)) {\n                            // export default class { }\n                            if (!hasExportDefault) {\n                                multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node));\n                                hasExportDefault = true;\n                            }\n                        }\n                        else {\n                            // export class x { }\n                            var name = node.name;\n                            if (name && !uniqueExports.get(ts.idText(name))) {\n                                multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);\n                                uniqueExports.set(ts.idText(name), true);\n                                exportedNames = ts.append(exportedNames, name);\n                            }\n                        }\n                    }\n                    break;\n            }\n        }\n        var externalHelpersImportDeclaration = ts.createExternalHelpersImportDeclarationIfNeeded(context.factory, context.getEmitHelperFactory(), sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar, hasImportDefault);\n        if (externalHelpersImportDeclaration) {\n            externalImports.unshift(externalHelpersImportDeclaration);\n        }\n        return { externalImports: externalImports, exportSpecifiers: exportSpecifiers, exportEquals: exportEquals, hasExportStarsToExportValues: hasExportStarsToExportValues, exportedBindings: exportedBindings, exportedNames: exportedNames, externalHelpersImportDeclaration: externalHelpersImportDeclaration };\n        function addExportedNamesForExportDeclaration(node) {\n            for (var _i = 0, _a = ts.cast(node.exportClause, ts.isNamedExports).elements; _i < _a.length; _i++) {\n                var specifier = _a[_i];\n                if (!uniqueExports.get(ts.idText(specifier.name))) {\n                    var name = specifier.propertyName || specifier.name;\n                    if (!node.moduleSpecifier) {\n                        exportSpecifiers.add(ts.idText(name), specifier);\n                    }\n                    var decl = resolver.getReferencedImportDeclaration(name)\n                        || resolver.getReferencedValueDeclaration(name);\n                    if (decl) {\n                        multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(decl), specifier.name);\n                    }\n                    uniqueExports.set(ts.idText(specifier.name), true);\n                    exportedNames = ts.append(exportedNames, specifier.name);\n                }\n            }\n        }\n    }\n    ts.collectExternalModuleInfo = collectExternalModuleInfo;\n    function collectExportedVariableInfo(decl, uniqueExports, exportedNames) {\n        if (ts.isBindingPattern(decl.name)) {\n            for (var _i = 0, _a = decl.name.elements; _i < _a.length; _i++) {\n                var element = _a[_i];\n                if (!ts.isOmittedExpression(element)) {\n                    exportedNames = collectExportedVariableInfo(element, uniqueExports, exportedNames);\n                }\n            }\n        }\n        else if (!ts.isGeneratedIdentifier(decl.name)) {\n            var text = ts.idText(decl.name);\n            if (!uniqueExports.get(text)) {\n                uniqueExports.set(text, true);\n                exportedNames = ts.append(exportedNames, decl.name);\n            }\n        }\n        return exportedNames;\n    }\n    /** Use a sparse array as a multi-map. */\n    function multiMapSparseArrayAdd(map, key, value) {\n        var values = map[key];\n        if (values) {\n            values.push(value);\n        }\n        else {\n            map[key] = values = [value];\n        }\n        return values;\n    }\n    /**\n     * Used in the module transformer to check if an expression is reasonably without sideeffect,\n     *  and thus better to copy into multiple places rather than to cache in a temporary variable\n     *  - this is mostly subjective beyond the requirement that the expression not be sideeffecting\n     */\n    function isSimpleCopiableExpression(expression) {\n        return ts.isStringLiteralLike(expression) ||\n            expression.kind === 8 /* NumericLiteral */ ||\n            ts.isKeyword(expression.kind) ||\n            ts.isIdentifier(expression);\n    }\n    ts.isSimpleCopiableExpression = isSimpleCopiableExpression;\n    /**\n     * A simple inlinable expression is an expression which can be copied into multiple locations\n     * without risk of repeating any sideeffects and whose value could not possibly change between\n     * any such locations\n     */\n    function isSimpleInlineableExpression(expression) {\n        return !ts.isIdentifier(expression) && isSimpleCopiableExpression(expression) ||\n            ts.isWellKnownSymbolSyntactically(expression);\n    }\n    ts.isSimpleInlineableExpression = isSimpleInlineableExpression;\n    function isCompoundAssignment(kind) {\n        return kind >= 63 /* FirstCompoundAssignment */\n            && kind <= 77 /* LastCompoundAssignment */;\n    }\n    ts.isCompoundAssignment = isCompoundAssignment;\n    function getNonAssignmentOperatorForCompoundAssignment(kind) {\n        switch (kind) {\n            case 63 /* PlusEqualsToken */: return 39 /* PlusToken */;\n            case 64 /* MinusEqualsToken */: return 40 /* MinusToken */;\n            case 65 /* AsteriskEqualsToken */: return 41 /* AsteriskToken */;\n            case 66 /* AsteriskAsteriskEqualsToken */: return 42 /* AsteriskAsteriskToken */;\n            case 67 /* SlashEqualsToken */: return 43 /* SlashToken */;\n            case 68 /* PercentEqualsToken */: return 44 /* PercentToken */;\n            case 69 /* LessThanLessThanEqualsToken */: return 47 /* LessThanLessThanToken */;\n            case 70 /* GreaterThanGreaterThanEqualsToken */: return 48 /* GreaterThanGreaterThanToken */;\n            case 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */: return 49 /* GreaterThanGreaterThanGreaterThanToken */;\n            case 72 /* AmpersandEqualsToken */: return 50 /* AmpersandToken */;\n            case 73 /* BarEqualsToken */: return 51 /* BarToken */;\n            case 77 /* CaretEqualsToken */: return 52 /* CaretToken */;\n            case 74 /* BarBarEqualsToken */: return 56 /* BarBarToken */;\n            case 75 /* AmpersandAmpersandEqualsToken */: return 55 /* AmpersandAmpersandToken */;\n            case 76 /* QuestionQuestionEqualsToken */: return 60 /* QuestionQuestionToken */;\n        }\n    }\n    ts.getNonAssignmentOperatorForCompoundAssignment = getNonAssignmentOperatorForCompoundAssignment;\n    /**\n     * Adds super call and preceding prologue directives into the list of statements.\n     *\n     * @param ctor The constructor node.\n     * @param result The list of statements.\n     * @param visitor The visitor to apply to each node added to the result array.\n     * @returns index of the statement that follows super call\n     */\n    function addPrologueDirectivesAndInitialSuperCall(factory, ctor, result, visitor) {\n        if (ctor.body) {\n            var statements = ctor.body.statements;\n            // add prologue directives to the list (if any)\n            var index = factory.copyPrologue(statements, result, /*ensureUseStrict*/ false, visitor);\n            if (index === statements.length) {\n                // list contains nothing but prologue directives (or empty) - exit\n                return index;\n            }\n            var superIndex = ts.findIndex(statements, function (s) { return ts.isExpressionStatement(s) && ts.isSuperCall(s.expression); }, index);\n            if (superIndex > -1) {\n                for (var i = index; i <= superIndex; i++) {\n                    result.push(ts.visitNode(statements[i], visitor, ts.isStatement));\n                }\n                return superIndex + 1;\n            }\n            return index;\n        }\n        return 0;\n    }\n    ts.addPrologueDirectivesAndInitialSuperCall = addPrologueDirectivesAndInitialSuperCall;\n    function getProperties(node, requireInitializer, isStatic) {\n        return ts.filter(node.members, function (m) { return isInitializedOrStaticProperty(m, requireInitializer, isStatic); });\n    }\n    ts.getProperties = getProperties;\n    /**\n     * Is a class element either a static or an instance property declaration with an initializer?\n     *\n     * @param member The class element node.\n     * @param isStatic A value indicating whether the member should be a static or instance member.\n     */\n    function isInitializedOrStaticProperty(member, requireInitializer, isStatic) {\n        return ts.isPropertyDeclaration(member)\n            && (!!member.initializer || !requireInitializer)\n            && ts.hasStaticModifier(member) === isStatic;\n    }\n    /**\n     * Gets a value indicating whether a class element is either a static or an instance property declaration with an initializer.\n     *\n     * @param member The class element node.\n     * @param isStatic A value indicating whether the member should be a static or instance member.\n     */\n    function isInitializedProperty(member) {\n        return member.kind === 163 /* PropertyDeclaration */\n            && member.initializer !== undefined;\n    }\n    ts.isInitializedProperty = isInitializedProperty;\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    var FlattenLevel;\n    (function (FlattenLevel) {\n        FlattenLevel[FlattenLevel[\"All\"] = 0] = \"All\";\n        FlattenLevel[FlattenLevel[\"ObjectRest\"] = 1] = \"ObjectRest\";\n    })(FlattenLevel = ts.FlattenLevel || (ts.FlattenLevel = {}));\n    /**\n     * Flattens a DestructuringAssignment or a VariableDeclaration to an expression.\n     *\n     * @param node The node to flatten.\n     * @param visitor An optional visitor used to visit initializers.\n     * @param context The transformation context.\n     * @param level Indicates the extent to which flattening should occur.\n     * @param needsValue An optional value indicating whether the value from the right-hand-side of\n     * the destructuring assignment is needed as part of a larger expression.\n     * @param createAssignmentCallback An optional callback used to create the assignment expression.\n     */\n    function flattenDestructuringAssignment(node, visitor, context, level, needsValue, createAssignmentCallback) {\n        var location = node;\n        var value;\n        if (ts.isDestructuringAssignment(node)) {\n            value = node.right;\n            while (ts.isEmptyArrayLiteral(node.left) || ts.isEmptyObjectLiteral(node.left)) {\n                if (ts.isDestructuringAssignment(value)) {\n                    location = node = value;\n                    value = node.right;\n                }\n                else {\n                    return ts.visitNode(value, visitor, ts.isExpression);\n                }\n            }\n        }\n        var expressions;\n        var flattenContext = {\n            context: context,\n            level: level,\n            downlevelIteration: !!context.getCompilerOptions().downlevelIteration,\n            hoistTempVariables: true,\n            emitExpression: emitExpression,\n            emitBindingOrAssignment: emitBindingOrAssignment,\n            createArrayBindingOrAssignmentPattern: function (elements) { return makeArrayAssignmentPattern(context.factory, elements); },\n            createObjectBindingOrAssignmentPattern: function (elements) { return makeObjectAssignmentPattern(context.factory, elements); },\n            createArrayBindingOrAssignmentElement: makeAssignmentElement,\n            visitor: visitor\n        };\n        if (value) {\n            value = ts.visitNode(value, visitor, ts.isExpression);\n            if (ts.isIdentifier(value) && bindingOrAssignmentElementAssignsToName(node, value.escapedText) ||\n                bindingOrAssignmentElementContainsNonLiteralComputedName(node)) {\n                // If the right-hand value of the assignment is also an assignment target then\n                // we need to cache the right-hand value.\n                value = ensureIdentifier(flattenContext, value, /*reuseIdentifierExpressions*/ false, location);\n            }\n            else if (needsValue) {\n                // If the right-hand value of the destructuring assignment needs to be preserved (as\n                // is the case when the destructuring assignment is part of a larger expression),\n                // then we need to cache the right-hand value.\n                //\n                // The source map location for the assignment should point to the entire binary\n                // expression.\n                value = ensureIdentifier(flattenContext, value, /*reuseIdentifierExpressions*/ true, location);\n            }\n            else if (ts.nodeIsSynthesized(node)) {\n                // Generally, the source map location for a destructuring assignment is the root\n                // expression.\n                //\n                // However, if the root expression is synthesized (as in the case\n                // of the initializer when transforming a ForOfStatement), then the source map\n                // location should point to the right-hand value of the expression.\n                location = value;\n            }\n        }\n        flattenBindingOrAssignmentElement(flattenContext, node, value, location, /*skipInitializer*/ ts.isDestructuringAssignment(node));\n        if (value && needsValue) {\n            if (!ts.some(expressions)) {\n                return value;\n            }\n            expressions.push(value);\n        }\n        return context.factory.inlineExpressions(expressions) || context.factory.createOmittedExpression();\n        function emitExpression(expression) {\n            expressions = ts.append(expressions, expression);\n        }\n        function emitBindingOrAssignment(target, value, location, original) {\n            ts.Debug.assertNode(target, createAssignmentCallback ? ts.isIdentifier : ts.isExpression);\n            var expression = createAssignmentCallback\n                ? createAssignmentCallback(target, value, location)\n                : ts.setTextRange(context.factory.createAssignment(ts.visitNode(target, visitor, ts.isExpression), value), location);\n            expression.original = original;\n            emitExpression(expression);\n        }\n    }\n    ts.flattenDestructuringAssignment = flattenDestructuringAssignment;\n    function bindingOrAssignmentElementAssignsToName(element, escapedName) {\n        var target = ts.getTargetOfBindingOrAssignmentElement(element); // TODO: GH#18217\n        if (ts.isBindingOrAssignmentPattern(target)) {\n            return bindingOrAssignmentPatternAssignsToName(target, escapedName);\n        }\n        else if (ts.isIdentifier(target)) {\n            return target.escapedText === escapedName;\n        }\n        return false;\n    }\n    function bindingOrAssignmentPatternAssignsToName(pattern, escapedName) {\n        var elements = ts.getElementsOfBindingOrAssignmentPattern(pattern);\n        for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) {\n            var element = elements_3[_i];\n            if (bindingOrAssignmentElementAssignsToName(element, escapedName)) {\n                return true;\n            }\n        }\n        return false;\n    }\n    function bindingOrAssignmentElementContainsNonLiteralComputedName(element) {\n        var propertyName = ts.tryGetPropertyNameOfBindingOrAssignmentElement(element);\n        if (propertyName && ts.isComputedPropertyName(propertyName) && !ts.isLiteralExpression(propertyName.expression)) {\n            return true;\n        }\n        var target = ts.getTargetOfBindingOrAssignmentElement(element);\n        return !!target && ts.isBindingOrAssignmentPattern(target) && bindingOrAssignmentPatternContainsNonLiteralComputedName(target);\n    }\n    function bindingOrAssignmentPatternContainsNonLiteralComputedName(pattern) {\n        return !!ts.forEach(ts.getElementsOfBindingOrAssignmentPattern(pattern), bindingOrAssignmentElementContainsNonLiteralComputedName);\n    }\n    /**\n     * Flattens a VariableDeclaration or ParameterDeclaration to one or more variable declarations.\n     *\n     * @param node The node to flatten.\n     * @param visitor An optional visitor used to visit initializers.\n     * @param context The transformation context.\n     * @param boundValue The value bound to the declaration.\n     * @param skipInitializer A value indicating whether to ignore the initializer of `node`.\n     * @param hoistTempVariables Indicates whether temporary variables should not be recorded in-line.\n     * @param level Indicates the extent to which flattening should occur.\n     */\n    function flattenDestructuringBinding(node, visitor, context, level, rval, hoistTempVariables, skipInitializer) {\n        if (hoistTempVariables === void 0) { hoistTempVariables = false; }\n        var pendingExpressions;\n        var pendingDeclarations = [];\n        var declarations = [];\n        var flattenContext = {\n            context: context,\n            level: level,\n            downlevelIteration: !!context.getCompilerOptions().downlevelIteration,\n            hoistTempVariables: hoistTempVariables,\n            emitExpression: emitExpression,\n            emitBindingOrAssignment: emitBindingOrAssignment,\n            createArrayBindingOrAssignmentPattern: function (elements) { return makeArrayBindingPattern(context.factory, elements); },\n            createObjectBindingOrAssignmentPattern: function (elements) { return makeObjectBindingPattern(context.factory, elements); },\n            createArrayBindingOrAssignmentElement: function (name) { return makeBindingElement(context.factory, name); },\n            visitor: visitor\n        };\n        if (ts.isVariableDeclaration(node)) {\n            var initializer = ts.getInitializerOfBindingOrAssignmentElement(node);\n            if (initializer && (ts.isIdentifier(initializer) && bindingOrAssignmentElementAssignsToName(node, initializer.escapedText) ||\n                bindingOrAssignmentElementContainsNonLiteralComputedName(node))) {\n                // If the right-hand value of the assignment is also an assignment target then\n                // we need to cache the right-hand value.\n                initializer = ensureIdentifier(flattenContext, ts.visitNode(initializer, flattenContext.visitor), /*reuseIdentifierExpressions*/ false, initializer);\n                node = context.factory.updateVariableDeclaration(node, node.name, /*exclamationToken*/ undefined, /*type*/ undefined, initializer);\n            }\n        }\n        flattenBindingOrAssignmentElement(flattenContext, node, rval, node, skipInitializer);\n        if (pendingExpressions) {\n            var temp = context.factory.createTempVariable(/*recordTempVariable*/ undefined);\n            if (hoistTempVariables) {\n                var value = context.factory.inlineExpressions(pendingExpressions);\n                pendingExpressions = undefined;\n                emitBindingOrAssignment(temp, value, /*location*/ undefined, /*original*/ undefined);\n            }\n            else {\n                context.hoistVariableDeclaration(temp);\n                var pendingDeclaration = ts.last(pendingDeclarations);\n                pendingDeclaration.pendingExpressions = ts.append(pendingDeclaration.pendingExpressions, context.factory.createAssignment(temp, pendingDeclaration.value));\n                ts.addRange(pendingDeclaration.pendingExpressions, pendingExpressions);\n                pendingDeclaration.value = temp;\n            }\n        }\n        for (var _i = 0, pendingDeclarations_1 = pendingDeclarations; _i < pendingDeclarations_1.length; _i++) {\n            var _a = pendingDeclarations_1[_i], pendingExpressions_1 = _a.pendingExpressions, name = _a.name, value = _a.value, location = _a.location, original = _a.original;\n            var variable = context.factory.createVariableDeclaration(name, \n            /*exclamationToken*/ undefined, \n            /*type*/ undefined, pendingExpressions_1 ? context.factory.inlineExpressions(ts.append(pendingExpressions_1, value)) : value);\n            variable.original = original;\n            ts.setTextRange(variable, location);\n            declarations.push(variable);\n        }\n        return declarations;\n        function emitExpression(value) {\n            pendingExpressions = ts.append(pendingExpressions, value);\n        }\n        function emitBindingOrAssignment(target, value, location, original) {\n            ts.Debug.assertNode(target, ts.isBindingName);\n            if (pendingExpressions) {\n                value = context.factory.inlineExpressions(ts.append(pendingExpressions, value));\n                pendingExpressions = undefined;\n            }\n            pendingDeclarations.push({ pendingExpressions: pendingExpressions, name: target, value: value, location: location, original: original });\n        }\n    }\n    ts.flattenDestructuringBinding = flattenDestructuringBinding;\n    /**\n     * Flattens a BindingOrAssignmentElement into zero or more bindings or assignments.\n     *\n     * @param flattenContext Options used to control flattening.\n     * @param element The element to flatten.\n     * @param value The current RHS value to assign to the element.\n     * @param location The location to use for source maps and comments.\n     * @param skipInitializer An optional value indicating whether to include the initializer\n     * for the element.\n     */\n    function flattenBindingOrAssignmentElement(flattenContext, element, value, location, skipInitializer) {\n        var bindingTarget = ts.getTargetOfBindingOrAssignmentElement(element); // TODO: GH#18217\n        if (!skipInitializer) {\n            var initializer = ts.visitNode(ts.getInitializerOfBindingOrAssignmentElement(element), flattenContext.visitor, ts.isExpression);\n            if (initializer) {\n                // Combine value and initializer\n                if (value) {\n                    value = createDefaultValueCheck(flattenContext, value, initializer, location);\n                    // If 'value' is not a simple expression, it could contain side-effecting code that should evaluate before an object or array binding pattern.\n                    if (!ts.isSimpleInlineableExpression(initializer) && ts.isBindingOrAssignmentPattern(bindingTarget)) {\n                        value = ensureIdentifier(flattenContext, value, /*reuseIdentifierExpressions*/ true, location);\n                    }\n                }\n                else {\n                    value = initializer;\n                }\n            }\n            else if (!value) {\n                // Use 'void 0' in absence of value and initializer\n                value = flattenContext.context.factory.createVoidZero();\n            }\n        }\n        if (ts.isObjectBindingOrAssignmentPattern(bindingTarget)) {\n            flattenObjectBindingOrAssignmentPattern(flattenContext, element, bindingTarget, value, location);\n        }\n        else if (ts.isArrayBindingOrAssignmentPattern(bindingTarget)) {\n            flattenArrayBindingOrAssignmentPattern(flattenContext, element, bindingTarget, value, location);\n        }\n        else {\n            flattenContext.emitBindingOrAssignment(bindingTarget, value, location, /*original*/ element); // TODO: GH#18217\n        }\n    }\n    /**\n     * Flattens an ObjectBindingOrAssignmentPattern into zero or more bindings or assignments.\n     *\n     * @param flattenContext Options used to control flattening.\n     * @param parent The parent element of the pattern.\n     * @param pattern The ObjectBindingOrAssignmentPattern to flatten.\n     * @param value The current RHS value to assign to the element.\n     * @param location The location to use for source maps and comments.\n     */\n    function flattenObjectBindingOrAssignmentPattern(flattenContext, parent, pattern, value, location) {\n        var elements = ts.getElementsOfBindingOrAssignmentPattern(pattern);\n        var numElements = elements.length;\n        if (numElements !== 1) {\n            // For anything other than a single-element destructuring we need to generate a temporary\n            // to ensure value is evaluated exactly once. Additionally, if we have zero elements\n            // we need to emit *something* to ensure that in case a 'var' keyword was already emitted,\n            // so in that case, we'll intentionally create that temporary.\n            var reuseIdentifierExpressions = !ts.isDeclarationBindingElement(parent) || numElements !== 0;\n            value = ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location);\n        }\n        var bindingElements;\n        var computedTempVariables;\n        for (var i = 0; i < numElements; i++) {\n            var element = elements[i];\n            if (!ts.getRestIndicatorOfBindingOrAssignmentElement(element)) {\n                var propertyName = ts.getPropertyNameOfBindingOrAssignmentElement(element);\n                if (flattenContext.level >= 1 /* ObjectRest */\n                    && !(element.transformFlags & (8192 /* ContainsRestOrSpread */ | 16384 /* ContainsObjectRestOrSpread */))\n                    && !(ts.getTargetOfBindingOrAssignmentElement(element).transformFlags & (8192 /* ContainsRestOrSpread */ | 16384 /* ContainsObjectRestOrSpread */))\n                    && !ts.isComputedPropertyName(propertyName)) {\n                    bindingElements = ts.append(bindingElements, ts.visitNode(element, flattenContext.visitor));\n                }\n                else {\n                    if (bindingElements) {\n                        flattenContext.emitBindingOrAssignment(flattenContext.createObjectBindingOrAssignmentPattern(bindingElements), value, location, pattern);\n                        bindingElements = undefined;\n                    }\n                    var rhsValue = createDestructuringPropertyAccess(flattenContext, value, propertyName);\n                    if (ts.isComputedPropertyName(propertyName)) {\n                        computedTempVariables = ts.append(computedTempVariables, rhsValue.argumentExpression);\n                    }\n                    flattenBindingOrAssignmentElement(flattenContext, element, rhsValue, /*location*/ element);\n                }\n            }\n            else if (i === numElements - 1) {\n                if (bindingElements) {\n                    flattenContext.emitBindingOrAssignment(flattenContext.createObjectBindingOrAssignmentPattern(bindingElements), value, location, pattern);\n                    bindingElements = undefined;\n                }\n                var rhsValue = flattenContext.context.getEmitHelperFactory().createRestHelper(value, elements, computedTempVariables, pattern);\n                flattenBindingOrAssignmentElement(flattenContext, element, rhsValue, element);\n            }\n        }\n        if (bindingElements) {\n            flattenContext.emitBindingOrAssignment(flattenContext.createObjectBindingOrAssignmentPattern(bindingElements), value, location, pattern);\n        }\n    }\n    /**\n     * Flattens an ArrayBindingOrAssignmentPattern into zero or more bindings or assignments.\n     *\n     * @param flattenContext Options used to control flattening.\n     * @param parent The parent element of the pattern.\n     * @param pattern The ArrayBindingOrAssignmentPattern to flatten.\n     * @param value The current RHS value to assign to the element.\n     * @param location The location to use for source maps and comments.\n     */\n    function flattenArrayBindingOrAssignmentPattern(flattenContext, parent, pattern, value, location) {\n        var elements = ts.getElementsOfBindingOrAssignmentPattern(pattern);\n        var numElements = elements.length;\n        if (flattenContext.level < 1 /* ObjectRest */ && flattenContext.downlevelIteration) {\n            // Read the elements of the iterable into an array\n            value = ensureIdentifier(flattenContext, ts.setTextRange(flattenContext.context.getEmitHelperFactory().createReadHelper(value, numElements > 0 && ts.getRestIndicatorOfBindingOrAssignmentElement(elements[numElements - 1])\n                ? undefined\n                : numElements), location), \n            /*reuseIdentifierExpressions*/ false, location);\n        }\n        else if (numElements !== 1 && (flattenContext.level < 1 /* ObjectRest */ || numElements === 0)\n            || ts.every(elements, ts.isOmittedExpression)) {\n            // For anything other than a single-element destructuring we need to generate a temporary\n            // to ensure value is evaluated exactly once. Additionally, if we have zero elements\n            // we need to emit *something* to ensure that in case a 'var' keyword was already emitted,\n            // so in that case, we'll intentionally create that temporary.\n            // Or all the elements of the binding pattern are omitted expression such as \"var [,] = [1,2]\",\n            // then we will create temporary variable.\n            var reuseIdentifierExpressions = !ts.isDeclarationBindingElement(parent) || numElements !== 0;\n            value = ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location);\n        }\n        var bindingElements;\n        var restContainingElements;\n        for (var i = 0; i < numElements; i++) {\n            var element = elements[i];\n            if (flattenContext.level >= 1 /* ObjectRest */) {\n                // If an array pattern contains an ObjectRest, we must cache the result so that we\n                // can perform the ObjectRest destructuring in a different declaration\n                if (element.transformFlags & 16384 /* ContainsObjectRestOrSpread */ || flattenContext.hasTransformedPriorElement && !isSimpleBindingOrAssignmentElement(element)) {\n                    flattenContext.hasTransformedPriorElement = true;\n                    var temp = flattenContext.context.factory.createTempVariable(/*recordTempVariable*/ undefined);\n                    if (flattenContext.hoistTempVariables) {\n                        flattenContext.context.hoistVariableDeclaration(temp);\n                    }\n                    restContainingElements = ts.append(restContainingElements, [temp, element]);\n                    bindingElements = ts.append(bindingElements, flattenContext.createArrayBindingOrAssignmentElement(temp));\n                }\n                else {\n                    bindingElements = ts.append(bindingElements, element);\n                }\n            }\n            else if (ts.isOmittedExpression(element)) {\n                continue;\n            }\n            else if (!ts.getRestIndicatorOfBindingOrAssignmentElement(element)) {\n                var rhsValue = flattenContext.context.factory.createElementAccessExpression(value, i);\n                flattenBindingOrAssignmentElement(flattenContext, element, rhsValue, /*location*/ element);\n            }\n            else if (i === numElements - 1) {\n                var rhsValue = flattenContext.context.factory.createArraySliceCall(value, i);\n                flattenBindingOrAssignmentElement(flattenContext, element, rhsValue, /*location*/ element);\n            }\n        }\n        if (bindingElements) {\n            flattenContext.emitBindingOrAssignment(flattenContext.createArrayBindingOrAssignmentPattern(bindingElements), value, location, pattern);\n        }\n        if (restContainingElements) {\n            for (var _i = 0, restContainingElements_1 = restContainingElements; _i < restContainingElements_1.length; _i++) {\n                var _a = restContainingElements_1[_i], id = _a[0], element = _a[1];\n                flattenBindingOrAssignmentElement(flattenContext, element, id, element);\n            }\n        }\n    }\n    function isSimpleBindingOrAssignmentElement(element) {\n        var target = ts.getTargetOfBindingOrAssignmentElement(element);\n        if (!target || ts.isOmittedExpression(target))\n            return true;\n        var propertyName = ts.tryGetPropertyNameOfBindingOrAssignmentElement(element);\n        if (propertyName && !ts.isPropertyNameLiteral(propertyName))\n            return false;\n        var initializer = ts.getInitializerOfBindingOrAssignmentElement(element);\n        if (initializer && !ts.isSimpleInlineableExpression(initializer))\n            return false;\n        if (ts.isBindingOrAssignmentPattern(target))\n            return ts.every(ts.getElementsOfBindingOrAssignmentPattern(target), isSimpleBindingOrAssignmentElement);\n        return ts.isIdentifier(target);\n    }\n    /**\n     * Creates an expression used to provide a default value if a value is `undefined` at runtime.\n     *\n     * @param flattenContext Options used to control flattening.\n     * @param value The RHS value to test.\n     * @param defaultValue The default value to use if `value` is `undefined` at runtime.\n     * @param location The location to use for source maps and comments.\n     */\n    function createDefaultValueCheck(flattenContext, value, defaultValue, location) {\n        value = ensureIdentifier(flattenContext, value, /*reuseIdentifierExpressions*/ true, location);\n        return flattenContext.context.factory.createConditionalExpression(flattenContext.context.factory.createTypeCheck(value, \"undefined\"), /*questionToken*/ undefined, defaultValue, /*colonToken*/ undefined, value);\n    }\n    /**\n     * Creates either a PropertyAccessExpression or an ElementAccessExpression for the\n     * right-hand side of a transformed destructuring assignment.\n     *\n     * @link https://tc39.github.io/ecma262/#sec-runtime-semantics-keyeddestructuringassignmentevaluation\n     *\n     * @param flattenContext Options used to control flattening.\n     * @param value The RHS value that is the source of the property.\n     * @param propertyName The destructuring property name.\n     */\n    function createDestructuringPropertyAccess(flattenContext, value, propertyName) {\n        if (ts.isComputedPropertyName(propertyName)) {\n            var argumentExpression = ensureIdentifier(flattenContext, ts.visitNode(propertyName.expression, flattenContext.visitor), /*reuseIdentifierExpressions*/ false, /*location*/ propertyName);\n            return flattenContext.context.factory.createElementAccessExpression(value, argumentExpression);\n        }\n        else if (ts.isStringOrNumericLiteralLike(propertyName)) {\n            var argumentExpression = ts.factory.cloneNode(propertyName);\n            return flattenContext.context.factory.createElementAccessExpression(value, argumentExpression);\n        }\n        else {\n            var name = flattenContext.context.factory.createIdentifier(ts.idText(propertyName));\n            return flattenContext.context.factory.createPropertyAccessExpression(value, name);\n        }\n    }\n    /**\n     * Ensures that there exists a declared identifier whose value holds the given expression.\n     * This function is useful to ensure that the expression's value can be read from in subsequent expressions.\n     * Unless 'reuseIdentifierExpressions' is false, 'value' will be returned if it is just an identifier.\n     *\n     * @param flattenContext Options used to control flattening.\n     * @param value the expression whose value needs to be bound.\n     * @param reuseIdentifierExpressions true if identifier expressions can simply be returned;\n     * false if it is necessary to always emit an identifier.\n     * @param location The location to use for source maps and comments.\n     */\n    function ensureIdentifier(flattenContext, value, reuseIdentifierExpressions, location) {\n        if (ts.isIdentifier(value) && reuseIdentifierExpressions) {\n            return value;\n        }\n        else {\n            var temp = flattenContext.context.factory.createTempVariable(/*recordTempVariable*/ undefined);\n            if (flattenContext.hoistTempVariables) {\n                flattenContext.context.hoistVariableDeclaration(temp);\n                flattenContext.emitExpression(ts.setTextRange(flattenContext.context.factory.createAssignment(temp, value), location));\n            }\n            else {\n                flattenContext.emitBindingOrAssignment(temp, value, location, /*original*/ undefined);\n            }\n            return temp;\n        }\n    }\n    function makeArrayBindingPattern(factory, elements) {\n        ts.Debug.assertEachNode(elements, ts.isArrayBindingElement);\n        return factory.createArrayBindingPattern(elements);\n    }\n    function makeArrayAssignmentPattern(factory, elements) {\n        return factory.createArrayLiteralExpression(ts.map(elements, factory.converters.convertToArrayAssignmentElement));\n    }\n    function makeObjectBindingPattern(factory, elements) {\n        ts.Debug.assertEachNode(elements, ts.isBindingElement);\n        return factory.createObjectBindingPattern(elements);\n    }\n    function makeObjectAssignmentPattern(factory, elements) {\n        return factory.createObjectLiteralExpression(ts.map(elements, factory.converters.convertToObjectAssignmentElement));\n    }\n    function makeBindingElement(factory, name) {\n        return factory.createBindingElement(/*dotDotDotToken*/ undefined, /*propertyName*/ undefined, name);\n    }\n    function makeAssignmentElement(name) {\n        return name;\n    }\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    var ProcessLevel;\n    (function (ProcessLevel) {\n        ProcessLevel[ProcessLevel[\"LiftRestriction\"] = 0] = \"LiftRestriction\";\n        ProcessLevel[ProcessLevel[\"All\"] = 1] = \"All\";\n    })(ProcessLevel = ts.ProcessLevel || (ts.ProcessLevel = {}));\n    function processTaggedTemplateExpression(context, node, visitor, currentSourceFile, recordTaggedTemplateString, level) {\n        // Visit the tag expression\n        var tag = ts.visitNode(node.tag, visitor, ts.isExpression);\n        // Build up the template arguments and the raw and cooked strings for the template.\n        // We start out with 'undefined' for the first argument and revisit later\n        // to avoid walking over the template string twice and shifting all our arguments over after the fact.\n        var templateArguments = [undefined];\n        var cookedStrings = [];\n        var rawStrings = [];\n        var template = node.template;\n        if (level === ProcessLevel.LiftRestriction && !ts.hasInvalidEscape(template)) {\n            return ts.visitEachChild(node, visitor, context);\n        }\n        if (ts.isNoSubstitutionTemplateLiteral(template)) {\n            cookedStrings.push(createTemplateCooked(template));\n            rawStrings.push(getRawLiteral(template, currentSourceFile));\n        }\n        else {\n            cookedStrings.push(createTemplateCooked(template.head));\n            rawStrings.push(getRawLiteral(template.head, currentSourceFile));\n            for (var _i = 0, _a = template.templateSpans; _i < _a.length; _i++) {\n                var templateSpan = _a[_i];\n                cookedStrings.push(createTemplateCooked(templateSpan.literal));\n                rawStrings.push(getRawLiteral(templateSpan.literal, currentSourceFile));\n                templateArguments.push(ts.visitNode(templateSpan.expression, visitor, ts.isExpression));\n            }\n        }\n        var helperCall = context.getEmitHelperFactory().createTemplateObjectHelper(ts.factory.createArrayLiteralExpression(cookedStrings), ts.factory.createArrayLiteralExpression(rawStrings));\n        // Create a variable to cache the template object if we're in a module.\n        // Do not do this in the global scope, as any variable we currently generate could conflict with\n        // variables from outside of the current compilation. In the future, we can revisit this behavior.\n        if (ts.isExternalModule(currentSourceFile)) {\n            var tempVar = ts.factory.createUniqueName(\"templateObject\");\n            recordTaggedTemplateString(tempVar);\n            templateArguments[0] = ts.factory.createLogicalOr(tempVar, ts.factory.createAssignment(tempVar, helperCall));\n        }\n        else {\n            templateArguments[0] = helperCall;\n        }\n        return ts.factory.createCallExpression(tag, /*typeArguments*/ undefined, templateArguments);\n    }\n    ts.processTaggedTemplateExpression = processTaggedTemplateExpression;\n    function createTemplateCooked(template) {\n        return template.templateFlags ? ts.factory.createVoidZero() : ts.factory.createStringLiteral(template.text);\n    }\n    /**\n     * Creates an ES5 compatible literal from an ES6 template literal.\n     *\n     * @param node The ES6 template literal.\n     */\n    function getRawLiteral(node, currentSourceFile) {\n        // Find original source text, since we need to emit the raw strings of the tagged template.\n        // The raw strings contain the (escaped) strings of what the user wrote.\n        // Examples: `\\n` is converted to \"\\\\n\", a template string with a newline to \"\\n\".\n        var text = node.rawText;\n        if (text === undefined) {\n            text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node);\n            // text contains the original source, it will also contain quotes (\"`\"), dolar signs and braces (\"${\" and \"}\"),\n            // thus we need to remove those characters.\n            // First template piece starts with \"`\", others with \"}\"\n            // Last template piece ends with \"`\", others with \"${\"\n            var isLast = node.kind === 14 /* NoSubstitutionTemplateLiteral */ || node.kind === 17 /* TemplateTail */;\n            text = text.substring(1, text.length - (isLast ? 1 : 2));\n        }\n        // Newline normalization:\n        // ES6 Spec 11.8.6.1 - Static Semantics of TV's and TRV's\n        // <CR><LF> and <CR> LineTerminatorSequences are normalized to <LF> for both TV and TRV.\n        text = text.replace(/\\r\\n?/g, \"\\n\");\n        return ts.setTextRange(ts.factory.createStringLiteral(text), node);\n    }\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    /**\n     * Indicates whether to emit type metadata in the new format.\n     */\n    var USE_NEW_TYPE_METADATA_FORMAT = false;\n    var TypeScriptSubstitutionFlags;\n    (function (TypeScriptSubstitutionFlags) {\n        /** Enables substitutions for decorated classes. */\n        TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags[\"ClassAliases\"] = 1] = \"ClassAliases\";\n        /** Enables substitutions for namespace exports. */\n        TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags[\"NamespaceExports\"] = 2] = \"NamespaceExports\";\n        /* Enables substitutions for unqualified enum members */\n        TypeScriptSubstitutionFlags[TypeScriptSubstitutionFlags[\"NonQualifiedEnumMembers\"] = 8] = \"NonQualifiedEnumMembers\";\n    })(TypeScriptSubstitutionFlags || (TypeScriptSubstitutionFlags = {}));\n    var ClassFacts;\n    (function (ClassFacts) {\n        ClassFacts[ClassFacts[\"None\"] = 0] = \"None\";\n        ClassFacts[ClassFacts[\"HasStaticInitializedProperties\"] = 1] = \"HasStaticInitializedProperties\";\n        ClassFacts[ClassFacts[\"HasConstructorDecorators\"] = 2] = \"HasConstructorDecorators\";\n        ClassFacts[ClassFacts[\"HasMemberDecorators\"] = 4] = \"HasMemberDecorators\";\n        ClassFacts[ClassFacts[\"IsExportOfNamespace\"] = 8] = \"IsExportOfNamespace\";\n        ClassFacts[ClassFacts[\"IsNamedExternalExport\"] = 16] = \"IsNamedExternalExport\";\n        ClassFacts[ClassFacts[\"IsDefaultExternalExport\"] = 32] = \"IsDefaultExternalExport\";\n        ClassFacts[ClassFacts[\"IsDerivedClass\"] = 64] = \"IsDerivedClass\";\n        ClassFacts[ClassFacts[\"UseImmediatelyInvokedFunctionExpression\"] = 128] = \"UseImmediatelyInvokedFunctionExpression\";\n        ClassFacts[ClassFacts[\"HasAnyDecorators\"] = 6] = \"HasAnyDecorators\";\n        ClassFacts[ClassFacts[\"NeedsName\"] = 5] = \"NeedsName\";\n        ClassFacts[ClassFacts[\"MayNeedImmediatelyInvokedFunctionExpression\"] = 7] = \"MayNeedImmediatelyInvokedFunctionExpression\";\n        ClassFacts[ClassFacts[\"IsExported\"] = 56] = \"IsExported\";\n    })(ClassFacts || (ClassFacts = {}));\n    function transformTypeScript(context) {\n        var factory = context.factory, emitHelpers = context.getEmitHelperFactory, startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration;\n        var resolver = context.getEmitResolver();\n        var compilerOptions = context.getCompilerOptions();\n        var strictNullChecks = ts.getStrictOptionValue(compilerOptions, \"strictNullChecks\");\n        var languageVersion = ts.getEmitScriptTarget(compilerOptions);\n        var moduleKind = ts.getEmitModuleKind(compilerOptions);\n        // Save the previous transformation hooks.\n        var previousOnEmitNode = context.onEmitNode;\n        var previousOnSubstituteNode = context.onSubstituteNode;\n        // Set new transformation hooks.\n        context.onEmitNode = onEmitNode;\n        context.onSubstituteNode = onSubstituteNode;\n        // Enable substitution for property/element access to emit const enum values.\n        context.enableSubstitution(201 /* PropertyAccessExpression */);\n        context.enableSubstitution(202 /* ElementAccessExpression */);\n        // These variables contain state that changes as we descend into the tree.\n        var currentSourceFile;\n        var currentNamespace;\n        var currentNamespaceContainerName;\n        var currentLexicalScope;\n        var currentNameScope;\n        var currentScopeFirstDeclarationsOfName;\n        var currentClassHasParameterProperties;\n        /**\n         * Keeps track of whether expression substitution has been enabled for specific edge cases.\n         * They are persisted between each SourceFile transformation and should not be reset.\n         */\n        var enabledSubstitutions;\n        /**\n         * A map that keeps track of aliases created for classes with decorators to avoid issues\n         * with the double-binding behavior of classes.\n         */\n        var classAliases;\n        /**\n         * Keeps track of whether we are within any containing namespaces when performing\n         * just-in-time substitution while printing an expression identifier.\n         */\n        var applicableSubstitutions;\n        return transformSourceFileOrBundle;\n        function transformSourceFileOrBundle(node) {\n            if (node.kind === 298 /* Bundle */) {\n                return transformBundle(node);\n            }\n            return transformSourceFile(node);\n        }\n        function transformBundle(node) {\n            return factory.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) {\n                if (prepend.kind === 300 /* InputFiles */) {\n                    return ts.createUnparsedSourceFile(prepend, \"js\");\n                }\n                return prepend;\n            }));\n        }\n        /**\n         * Transform TypeScript-specific syntax in a SourceFile.\n         *\n         * @param node A SourceFile node.\n         */\n        function transformSourceFile(node) {\n            if (node.isDeclarationFile) {\n                return node;\n            }\n            currentSourceFile = node;\n            var visited = saveStateAndInvoke(node, visitSourceFile);\n            ts.addEmitHelpers(visited, context.readEmitHelpers());\n            currentSourceFile = undefined;\n            return visited;\n        }\n        /**\n         * Visits a node, saving and restoring state variables on the stack.\n         *\n         * @param node The node to visit.\n         */\n        function saveStateAndInvoke(node, f) {\n            // Save state\n            var savedCurrentScope = currentLexicalScope;\n            var savedCurrentNameScope = currentNameScope;\n            var savedCurrentScopeFirstDeclarationsOfName = currentScopeFirstDeclarationsOfName;\n            var savedCurrentClassHasParameterProperties = currentClassHasParameterProperties;\n            // Handle state changes before visiting a node.\n            onBeforeVisitNode(node);\n            var visited = f(node);\n            // Restore state\n            if (currentLexicalScope !== savedCurrentScope) {\n                currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName;\n            }\n            currentLexicalScope = savedCurrentScope;\n            currentNameScope = savedCurrentNameScope;\n            currentClassHasParameterProperties = savedCurrentClassHasParameterProperties;\n            return visited;\n        }\n        /**\n         * Performs actions that should always occur immediately before visiting a node.\n         *\n         * @param node The node to visit.\n         */\n        function onBeforeVisitNode(node) {\n            switch (node.kind) {\n                case 297 /* SourceFile */:\n                case 258 /* CaseBlock */:\n                case 257 /* ModuleBlock */:\n                case 230 /* Block */:\n                    currentLexicalScope = node;\n                    currentNameScope = undefined;\n                    currentScopeFirstDeclarationsOfName = undefined;\n                    break;\n                case 252 /* ClassDeclaration */:\n                case 251 /* FunctionDeclaration */:\n                    if (ts.hasSyntacticModifier(node, 2 /* Ambient */)) {\n                        break;\n                    }\n                    // Record these declarations provided that they have a name.\n                    if (node.name) {\n                        recordEmittedDeclarationInScope(node);\n                    }\n                    else {\n                        // These nodes should always have names unless they are default-exports;\n                        // however, class declaration parsing allows for undefined names, so syntactically invalid\n                        // programs may also have an undefined name.\n                        ts.Debug.assert(node.kind === 252 /* ClassDeclaration */ || ts.hasSyntacticModifier(node, 512 /* Default */));\n                    }\n                    if (ts.isClassDeclaration(node)) {\n                        // XXX: should probably also cover interfaces and type aliases that can have type variables?\n                        currentNameScope = node;\n                    }\n                    break;\n            }\n        }\n        /**\n         * General-purpose node visitor.\n         *\n         * @param node The node to visit.\n         */\n        function visitor(node) {\n            return saveStateAndInvoke(node, visitorWorker);\n        }\n        /**\n         * Visits and possibly transforms any node.\n         *\n         * @param node The node to visit.\n         */\n        function visitorWorker(node) {\n            if (node.transformFlags & 1 /* ContainsTypeScript */) {\n                return visitTypeScript(node);\n            }\n            return node;\n        }\n        /**\n         * Specialized visitor that visits the immediate children of a SourceFile.\n         *\n         * @param node The node to visit.\n         */\n        function sourceElementVisitor(node) {\n            return saveStateAndInvoke(node, sourceElementVisitorWorker);\n        }\n        /**\n         * Specialized visitor that visits the immediate children of a SourceFile.\n         *\n         * @param node The node to visit.\n         */\n        function sourceElementVisitorWorker(node) {\n            switch (node.kind) {\n                case 261 /* ImportDeclaration */:\n                case 260 /* ImportEqualsDeclaration */:\n                case 266 /* ExportAssignment */:\n                case 267 /* ExportDeclaration */:\n                    return visitElidableStatement(node);\n                default:\n                    return visitorWorker(node);\n            }\n        }\n        function visitElidableStatement(node) {\n            var parsed = ts.getParseTreeNode(node);\n            if (parsed !== node) {\n                // If the node has been transformed by a `before` transformer, perform no ellision on it\n                // As the type information we would attempt to lookup to perform ellision is potentially unavailable for the synthesized nodes\n                // We do not reuse `visitorWorker`, as the ellidable statement syntax kinds are technically unrecognized by the switch-case in `visitTypeScript`,\n                // and will trigger debug failures when debug verbosity is turned up\n                if (node.transformFlags & 1 /* ContainsTypeScript */) {\n                    // This node contains TypeScript, so we should visit its children.\n                    return ts.visitEachChild(node, visitor, context);\n                }\n                // Otherwise, we can just return the node\n                return node;\n            }\n            switch (node.kind) {\n                case 261 /* ImportDeclaration */:\n                    return visitImportDeclaration(node);\n                case 260 /* ImportEqualsDeclaration */:\n                    return visitImportEqualsDeclaration(node);\n                case 266 /* ExportAssignment */:\n                    return visitExportAssignment(node);\n                case 267 /* ExportDeclaration */:\n                    return visitExportDeclaration(node);\n                default:\n                    ts.Debug.fail(\"Unhandled ellided statement\");\n            }\n        }\n        /**\n         * Specialized visitor that visits the immediate children of a namespace.\n         *\n         * @param node The node to visit.\n         */\n        function namespaceElementVisitor(node) {\n            return saveStateAndInvoke(node, namespaceElementVisitorWorker);\n        }\n        /**\n         * Specialized visitor that visits the immediate children of a namespace.\n         *\n         * @param node The node to visit.\n         */\n        function namespaceElementVisitorWorker(node) {\n            if (node.kind === 267 /* ExportDeclaration */ ||\n                node.kind === 261 /* ImportDeclaration */ ||\n                node.kind === 262 /* ImportClause */ ||\n                (node.kind === 260 /* ImportEqualsDeclaration */ &&\n                    node.moduleReference.kind === 272 /* ExternalModuleReference */)) {\n                // do not emit ES6 imports and exports since they are illegal inside a namespace\n                return undefined;\n            }\n            else if (node.transformFlags & 1 /* ContainsTypeScript */ || ts.hasSyntacticModifier(node, 1 /* Export */)) {\n                return visitTypeScript(node);\n            }\n            return node;\n        }\n        /**\n         * Specialized visitor that visits the immediate children of a class with TypeScript syntax.\n         *\n         * @param node The node to visit.\n         */\n        function classElementVisitor(node) {\n            return saveStateAndInvoke(node, classElementVisitorWorker);\n        }\n        /**\n         * Specialized visitor that visits the immediate children of a class with TypeScript syntax.\n         *\n         * @param node The node to visit.\n         */\n        function classElementVisitorWorker(node) {\n            switch (node.kind) {\n                case 166 /* Constructor */:\n                    return visitConstructor(node);\n                case 163 /* PropertyDeclaration */:\n                    // Property declarations are not TypeScript syntax, but they must be visited\n                    // for the decorator transformation.\n                    return visitPropertyDeclaration(node);\n                case 171 /* IndexSignature */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                case 165 /* MethodDeclaration */:\n                    // Fallback to the default visit behavior.\n                    return visitorWorker(node);\n                case 229 /* SemicolonClassElement */:\n                    return node;\n                default:\n                    return ts.Debug.failBadSyntaxKind(node);\n            }\n        }\n        function modifierVisitor(node) {\n            if (ts.modifierToFlag(node.kind) & 2270 /* TypeScriptModifier */) {\n                return undefined;\n            }\n            else if (currentNamespace && node.kind === 92 /* ExportKeyword */) {\n                return undefined;\n            }\n            return node;\n        }\n        /**\n         * Branching visitor, visits a TypeScript syntax node.\n         *\n         * @param node The node to visit.\n         */\n        function visitTypeScript(node) {\n            if (ts.isStatement(node) && ts.hasSyntacticModifier(node, 2 /* Ambient */)) {\n                // TypeScript ambient declarations are elided, but some comments may be preserved.\n                // See the implementation of `getLeadingComments` in comments.ts for more details.\n                return factory.createNotEmittedStatement(node);\n            }\n            switch (node.kind) {\n                case 92 /* ExportKeyword */:\n                case 87 /* DefaultKeyword */:\n                    // ES6 export and default modifiers are elided when inside a namespace.\n                    return currentNamespace ? undefined : node;\n                case 122 /* PublicKeyword */:\n                case 120 /* PrivateKeyword */:\n                case 121 /* ProtectedKeyword */:\n                case 125 /* AbstractKeyword */:\n                case 84 /* ConstKeyword */:\n                case 133 /* DeclareKeyword */:\n                case 142 /* ReadonlyKeyword */:\n                // TypeScript accessibility and readonly modifiers are elided\n                // falls through\n                case 178 /* ArrayType */:\n                case 179 /* TupleType */:\n                case 180 /* OptionalType */:\n                case 181 /* RestType */:\n                case 177 /* TypeLiteral */:\n                case 172 /* TypePredicate */:\n                case 159 /* TypeParameter */:\n                case 128 /* AnyKeyword */:\n                case 152 /* UnknownKeyword */:\n                case 131 /* BooleanKeyword */:\n                case 147 /* StringKeyword */:\n                case 144 /* NumberKeyword */:\n                case 141 /* NeverKeyword */:\n                case 113 /* VoidKeyword */:\n                case 148 /* SymbolKeyword */:\n                case 175 /* ConstructorType */:\n                case 174 /* FunctionType */:\n                case 176 /* TypeQuery */:\n                case 173 /* TypeReference */:\n                case 182 /* UnionType */:\n                case 183 /* IntersectionType */:\n                case 184 /* ConditionalType */:\n                case 186 /* ParenthesizedType */:\n                case 187 /* ThisType */:\n                case 188 /* TypeOperator */:\n                case 189 /* IndexedAccessType */:\n                case 190 /* MappedType */:\n                case 191 /* LiteralType */:\n                // TypeScript type nodes are elided.\n                // falls through\n                case 171 /* IndexSignature */:\n                // TypeScript index signatures are elided.\n                // falls through\n                case 161 /* Decorator */:\n                // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration.\n                // falls through\n                case 254 /* TypeAliasDeclaration */:\n                    // TypeScript type-only declarations are elided.\n                    return undefined;\n                case 163 /* PropertyDeclaration */:\n                    // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects\n                    return visitPropertyDeclaration(node);\n                case 259 /* NamespaceExportDeclaration */:\n                    // TypeScript namespace export declarations are elided.\n                    return undefined;\n                case 166 /* Constructor */:\n                    return visitConstructor(node);\n                case 253 /* InterfaceDeclaration */:\n                    // TypeScript interfaces are elided, but some comments may be preserved.\n                    // See the implementation of `getLeadingComments` in comments.ts for more details.\n                    return factory.createNotEmittedStatement(node);\n                case 252 /* ClassDeclaration */:\n                    // This may be a class declaration with TypeScript syntax extensions.\n                    //\n                    // TypeScript class syntax extensions include:\n                    // - decorators\n                    // - optional `implements` heritage clause\n                    // - parameter property assignments in the constructor\n                    // - index signatures\n                    // - method overload signatures\n                    return visitClassDeclaration(node);\n                case 221 /* ClassExpression */:\n                    // This may be a class expression with TypeScript syntax extensions.\n                    //\n                    // TypeScript class syntax extensions include:\n                    // - decorators\n                    // - optional `implements` heritage clause\n                    // - parameter property assignments in the constructor\n                    // - index signatures\n                    // - method overload signatures\n                    return visitClassExpression(node);\n                case 286 /* HeritageClause */:\n                    // This may be a heritage clause with TypeScript syntax extensions.\n                    //\n                    // TypeScript heritage clause extensions include:\n                    // - `implements` clause\n                    return visitHeritageClause(node);\n                case 223 /* ExpressionWithTypeArguments */:\n                    // TypeScript supports type arguments on an expression in an `extends` heritage clause.\n                    return visitExpressionWithTypeArguments(node);\n                case 165 /* MethodDeclaration */:\n                    // TypeScript method declarations may have decorators, modifiers\n                    // or type annotations.\n                    return visitMethodDeclaration(node);\n                case 167 /* GetAccessor */:\n                    // Get Accessors can have TypeScript modifiers, decorators, and type annotations.\n                    return visitGetAccessor(node);\n                case 168 /* SetAccessor */:\n                    // Set Accessors can have TypeScript modifiers and type annotations.\n                    return visitSetAccessor(node);\n                case 251 /* FunctionDeclaration */:\n                    // Typescript function declarations can have modifiers, decorators, and type annotations.\n                    return visitFunctionDeclaration(node);\n                case 208 /* FunctionExpression */:\n                    // TypeScript function expressions can have modifiers and type annotations.\n                    return visitFunctionExpression(node);\n                case 209 /* ArrowFunction */:\n                    // TypeScript arrow functions can have modifiers and type annotations.\n                    return visitArrowFunction(node);\n                case 160 /* Parameter */:\n                    // This may be a parameter declaration with TypeScript syntax extensions.\n                    //\n                    // TypeScript parameter declaration syntax extensions include:\n                    // - decorators\n                    // - accessibility modifiers\n                    // - the question mark (?) token for optional parameters\n                    // - type annotations\n                    // - this parameters\n                    return visitParameter(node);\n                case 207 /* ParenthesizedExpression */:\n                    // ParenthesizedExpressions are TypeScript if their expression is a\n                    // TypeAssertion or AsExpression\n                    return visitParenthesizedExpression(node);\n                case 206 /* TypeAssertionExpression */:\n                case 224 /* AsExpression */:\n                    // TypeScript type assertions are removed, but their subtrees are preserved.\n                    return visitAssertionExpression(node);\n                case 203 /* CallExpression */:\n                    return visitCallExpression(node);\n                case 204 /* NewExpression */:\n                    return visitNewExpression(node);\n                case 205 /* TaggedTemplateExpression */:\n                    return visitTaggedTemplateExpression(node);\n                case 225 /* NonNullExpression */:\n                    // TypeScript non-null expressions are removed, but their subtrees are preserved.\n                    return visitNonNullExpression(node);\n                case 255 /* EnumDeclaration */:\n                    // TypeScript enum declarations do not exist in ES6 and must be rewritten.\n                    return visitEnumDeclaration(node);\n                case 232 /* VariableStatement */:\n                    // TypeScript namespace exports for variable statements must be transformed.\n                    return visitVariableStatement(node);\n                case 249 /* VariableDeclaration */:\n                    return visitVariableDeclaration(node);\n                case 256 /* ModuleDeclaration */:\n                    // TypeScript namespace declarations must be transformed.\n                    return visitModuleDeclaration(node);\n                case 260 /* ImportEqualsDeclaration */:\n                    // TypeScript namespace or external module import.\n                    return visitImportEqualsDeclaration(node);\n                case 274 /* JsxSelfClosingElement */:\n                    return visitJsxSelfClosingElement(node);\n                case 275 /* JsxOpeningElement */:\n                    return visitJsxJsxOpeningElement(node);\n                default:\n                    // node contains some other TypeScript syntax\n                    return ts.visitEachChild(node, visitor, context);\n            }\n        }\n        function visitSourceFile(node) {\n            var alwaysStrict = ts.getStrictOptionValue(compilerOptions, \"alwaysStrict\") &&\n                !(ts.isExternalModule(node) && moduleKind >= ts.ModuleKind.ES2015) &&\n                !ts.isJsonSourceFile(node);\n            return factory.updateSourceFile(node, ts.visitLexicalEnvironment(node.statements, sourceElementVisitor, context, /*start*/ 0, alwaysStrict));\n        }\n        /**\n         * Tests whether we should emit a __decorate call for a class declaration.\n         */\n        function shouldEmitDecorateCallForClass(node) {\n            if (node.decorators && node.decorators.length > 0) {\n                return true;\n            }\n            var constructor = ts.getFirstConstructorWithBody(node);\n            if (constructor) {\n                return ts.forEach(constructor.parameters, shouldEmitDecorateCallForParameter);\n            }\n            return false;\n        }\n        /**\n         * Tests whether we should emit a __decorate call for a parameter declaration.\n         */\n        function shouldEmitDecorateCallForParameter(parameter) {\n            return parameter.decorators !== undefined && parameter.decorators.length > 0;\n        }\n        function getClassFacts(node, staticProperties) {\n            var facts = 0 /* None */;\n            if (ts.some(staticProperties))\n                facts |= 1 /* HasStaticInitializedProperties */;\n            var extendsClauseElement = ts.getEffectiveBaseTypeNode(node);\n            if (extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 103 /* NullKeyword */)\n                facts |= 64 /* IsDerivedClass */;\n            if (shouldEmitDecorateCallForClass(node))\n                facts |= 2 /* HasConstructorDecorators */;\n            if (ts.childIsDecorated(node))\n                facts |= 4 /* HasMemberDecorators */;\n            if (isExportOfNamespace(node))\n                facts |= 8 /* IsExportOfNamespace */;\n            else if (isDefaultExternalModuleExport(node))\n                facts |= 32 /* IsDefaultExternalExport */;\n            else if (isNamedExternalModuleExport(node))\n                facts |= 16 /* IsNamedExternalExport */;\n            if (languageVersion <= 1 /* ES5 */ && (facts & 7 /* MayNeedImmediatelyInvokedFunctionExpression */))\n                facts |= 128 /* UseImmediatelyInvokedFunctionExpression */;\n            return facts;\n        }\n        function hasTypeScriptClassSyntax(node) {\n            return !!(node.transformFlags & 2048 /* ContainsTypeScriptClassSyntax */);\n        }\n        function isClassLikeDeclarationWithTypeScriptSyntax(node) {\n            return ts.some(node.decorators)\n                || ts.some(node.typeParameters)\n                || ts.some(node.heritageClauses, hasTypeScriptClassSyntax)\n                || ts.some(node.members, hasTypeScriptClassSyntax);\n        }\n        function visitClassDeclaration(node) {\n            if (!isClassLikeDeclarationWithTypeScriptSyntax(node) && !(currentNamespace && ts.hasSyntacticModifier(node, 1 /* Export */))) {\n                return ts.visitEachChild(node, visitor, context);\n            }\n            var staticProperties = ts.getProperties(node, /*requireInitializer*/ true, /*isStatic*/ true);\n            var facts = getClassFacts(node, staticProperties);\n            if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */) {\n                context.startLexicalEnvironment();\n            }\n            var name = node.name || (facts & 5 /* NeedsName */ ? factory.getGeneratedNameForNode(node) : undefined);\n            var classStatement = facts & 2 /* HasConstructorDecorators */\n                ? createClassDeclarationHeadWithDecorators(node, name)\n                : createClassDeclarationHeadWithoutDecorators(node, name, facts);\n            var statements = [classStatement];\n            // Write any decorators of the node.\n            addClassElementDecorationStatements(statements, node, /*isStatic*/ false);\n            addClassElementDecorationStatements(statements, node, /*isStatic*/ true);\n            addConstructorDecorationStatement(statements, node);\n            if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */) {\n                // When we emit a TypeScript class down to ES5, we must wrap it in an IIFE so that the\n                // 'es2015' transformer can properly nest static initializers and decorators. The result\n                // looks something like:\n                //\n                //  var C = function () {\n                //      class C {\n                //      }\n                //      C.static_prop = 1;\n                //      return C;\n                //  }();\n                //\n                var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentSourceFile.text, node.members.end), 19 /* CloseBraceToken */);\n                var localName = factory.getInternalName(node);\n                // The following partially-emitted expression exists purely to align our sourcemap\n                // emit with the original emitter.\n                var outer = factory.createPartiallyEmittedExpression(localName);\n                ts.setTextRangeEnd(outer, closingBraceLocation.end);\n                ts.setEmitFlags(outer, 1536 /* NoComments */);\n                var statement = factory.createReturnStatement(outer);\n                ts.setTextRangePos(statement, closingBraceLocation.pos);\n                ts.setEmitFlags(statement, 1536 /* NoComments */ | 384 /* NoTokenSourceMaps */);\n                statements.push(statement);\n                ts.insertStatementsAfterStandardPrologue(statements, context.endLexicalEnvironment());\n                var iife = factory.createImmediatelyInvokedArrowFunction(statements);\n                ts.setEmitFlags(iife, 33554432 /* TypeScriptClassWrapper */);\n                var varStatement = factory.createVariableStatement(\n                /*modifiers*/ undefined, factory.createVariableDeclarationList([\n                    factory.createVariableDeclaration(factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ false), \n                    /*exclamationToken*/ undefined, \n                    /*type*/ undefined, iife)\n                ]));\n                ts.setOriginalNode(varStatement, node);\n                ts.setCommentRange(varStatement, node);\n                ts.setSourceMapRange(varStatement, ts.moveRangePastDecorators(node));\n                ts.startOnNewLine(varStatement);\n                statements = [varStatement];\n            }\n            // If the class is exported as part of a TypeScript namespace, emit the namespace export.\n            // Otherwise, if the class was exported at the top level and was decorated, emit an export\n            // declaration or export default for the class.\n            if (facts & 8 /* IsExportOfNamespace */) {\n                addExportMemberAssignment(statements, node);\n            }\n            else if (facts & 128 /* UseImmediatelyInvokedFunctionExpression */ || facts & 2 /* HasConstructorDecorators */) {\n                if (facts & 32 /* IsDefaultExternalExport */) {\n                    statements.push(factory.createExportDefault(factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)));\n                }\n                else if (facts & 16 /* IsNamedExternalExport */) {\n                    statements.push(factory.createExternalModuleExport(factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)));\n                }\n            }\n            if (statements.length > 1) {\n                // Add a DeclarationMarker as a marker for the end of the declaration\n                statements.push(factory.createEndOfDeclarationMarker(node));\n                ts.setEmitFlags(classStatement, ts.getEmitFlags(classStatement) | 4194304 /* HasEndOfDeclarationMarker */);\n            }\n            return ts.singleOrMany(statements);\n        }\n        /**\n         * Transforms a non-decorated class declaration and appends the resulting statements.\n         *\n         * @param node A ClassDeclaration node.\n         * @param name The name of the class.\n         * @param facts Precomputed facts about the class.\n         */\n        function createClassDeclarationHeadWithoutDecorators(node, name, facts) {\n            //  ${modifiers} class ${name} ${heritageClauses} {\n            //      ${members}\n            //  }\n            // we do not emit modifiers on the declaration if we are emitting an IIFE\n            var modifiers = !(facts & 128 /* UseImmediatelyInvokedFunctionExpression */)\n                ? ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier)\n                : undefined;\n            var classDeclaration = factory.createClassDeclaration(\n            /*decorators*/ undefined, modifiers, name, \n            /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node));\n            // To better align with the old emitter, we should not emit a trailing source map\n            // entry if the class has static properties.\n            var emitFlags = ts.getEmitFlags(node);\n            if (facts & 1 /* HasStaticInitializedProperties */) {\n                emitFlags |= 32 /* NoTrailingSourceMap */;\n            }\n            ts.setTextRange(classDeclaration, node);\n            ts.setOriginalNode(classDeclaration, node);\n            ts.setEmitFlags(classDeclaration, emitFlags);\n            return classDeclaration;\n        }\n        /**\n         * Transforms a decorated class declaration and appends the resulting statements. If\n         * the class requires an alias to avoid issues with double-binding, the alias is returned.\n         */\n        function createClassDeclarationHeadWithDecorators(node, name) {\n            // When we emit an ES6 class that has a class decorator, we must tailor the\n            // emit to certain specific cases.\n            //\n            // In the simplest case, we emit the class declaration as a let declaration, and\n            // evaluate decorators after the close of the class body:\n            //\n            //  [Example 1]\n            //  ---------------------------------------------------------------------\n            //  TypeScript                      | Javascript\n            //  ---------------------------------------------------------------------\n            //  @dec                            | let C = class C {\n            //  class C {                       | }\n            //  }                               | C = __decorate([dec], C);\n            //  ---------------------------------------------------------------------\n            //  @dec                            | let C = class C {\n            //  export class C {                | }\n            //  }                               | C = __decorate([dec], C);\n            //                                  | export { C };\n            //  ---------------------------------------------------------------------\n            //\n            // If a class declaration contains a reference to itself *inside* of the class body,\n            // this introduces two bindings to the class: One outside of the class body, and one\n            // inside of the class body. If we apply decorators as in [Example 1] above, there\n            // is the possibility that the decorator `dec` will return a new value for the\n            // constructor, which would result in the binding inside of the class no longer\n            // pointing to the same reference as the binding outside of the class.\n            //\n            // As a result, we must instead rewrite all references to the class *inside* of the\n            // class body to instead point to a local temporary alias for the class:\n            //\n            //  [Example 2]\n            //  ---------------------------------------------------------------------\n            //  TypeScript                      | Javascript\n            //  ---------------------------------------------------------------------\n            //  @dec                            | let C = C_1 = class C {\n            //  class C {                       |   static x() { return C_1.y; }\n            //    static x() { return C.y; }    | }\n            //    static y = 1;                 | C.y = 1;\n            //  }                               | C = C_1 = __decorate([dec], C);\n            //                                  | var C_1;\n            //  ---------------------------------------------------------------------\n            //  @dec                            | let C = class C {\n            //  export class C {                |   static x() { return C_1.y; }\n            //    static x() { return C.y; }    | }\n            //    static y = 1;                 | C.y = 1;\n            //  }                               | C = C_1 = __decorate([dec], C);\n            //                                  | export { C };\n            //                                  | var C_1;\n            //  ---------------------------------------------------------------------\n            //\n            // If a class declaration is the default export of a module, we instead emit\n            // the export after the decorated declaration:\n            //\n            //  [Example 3]\n            //  ---------------------------------------------------------------------\n            //  TypeScript                      | Javascript\n            //  ---------------------------------------------------------------------\n            //  @dec                            | let default_1 = class {\n            //  export default class {          | }\n            //  }                               | default_1 = __decorate([dec], default_1);\n            //                                  | export default default_1;\n            //  ---------------------------------------------------------------------\n            //  @dec                            | let C = class C {\n            //  export default class C {        | }\n            //  }                               | C = __decorate([dec], C);\n            //                                  | export default C;\n            //  ---------------------------------------------------------------------\n            //\n            // If the class declaration is the default export and a reference to itself\n            // inside of the class body, we must emit both an alias for the class *and*\n            // move the export after the declaration:\n            //\n            //  [Example 4]\n            //  ---------------------------------------------------------------------\n            //  TypeScript                      | Javascript\n            //  ---------------------------------------------------------------------\n            //  @dec                            | let C = class C {\n            //  export default class C {        |   static x() { return C_1.y; }\n            //    static x() { return C.y; }    | }\n            //    static y = 1;                 | C.y = 1;\n            //  }                               | C = C_1 = __decorate([dec], C);\n            //                                  | export default C;\n            //                                  | var C_1;\n            //  ---------------------------------------------------------------------\n            //\n            var location = ts.moveRangePastDecorators(node);\n            var classAlias = getClassAliasIfNeeded(node);\n            var declName = factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true);\n            //  ... = class ${name} ${heritageClauses} {\n            //      ${members}\n            //  }\n            var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause);\n            var members = transformClassMembers(node);\n            var classExpression = factory.createClassExpression(/*decorators*/ undefined, /*modifiers*/ undefined, name, /*typeParameters*/ undefined, heritageClauses, members);\n            ts.setOriginalNode(classExpression, node);\n            ts.setTextRange(classExpression, location);\n            //  let ${name} = ${classExpression} where name is either declaredName if the class doesn't contain self-reference\n            //                                         or decoratedClassAlias if the class contain self-reference.\n            var statement = factory.createVariableStatement(\n            /*modifiers*/ undefined, factory.createVariableDeclarationList([\n                factory.createVariableDeclaration(declName, \n                /*exclamationToken*/ undefined, \n                /*type*/ undefined, classAlias ? factory.createAssignment(classAlias, classExpression) : classExpression)\n            ], 1 /* Let */));\n            ts.setOriginalNode(statement, node);\n            ts.setTextRange(statement, location);\n            ts.setCommentRange(statement, node);\n            return statement;\n        }\n        function visitClassExpression(node) {\n            if (!isClassLikeDeclarationWithTypeScriptSyntax(node)) {\n                return ts.visitEachChild(node, visitor, context);\n            }\n            var classExpression = factory.createClassExpression(\n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, node.name, \n            /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node));\n            ts.setOriginalNode(classExpression, node);\n            ts.setTextRange(classExpression, node);\n            return classExpression;\n        }\n        /**\n         * Transforms the members of a class.\n         *\n         * @param node The current class.\n         */\n        function transformClassMembers(node) {\n            var members = [];\n            var constructor = ts.getFirstConstructorWithBody(node);\n            var parametersWithPropertyAssignments = constructor &&\n                ts.filter(constructor.parameters, function (p) { return ts.isParameterPropertyDeclaration(p, constructor); });\n            if (parametersWithPropertyAssignments) {\n                for (var _i = 0, parametersWithPropertyAssignments_1 = parametersWithPropertyAssignments; _i < parametersWithPropertyAssignments_1.length; _i++) {\n                    var parameter = parametersWithPropertyAssignments_1[_i];\n                    if (ts.isIdentifier(parameter.name)) {\n                        members.push(ts.setOriginalNode(factory.createPropertyDeclaration(\n                        /*decorators*/ undefined, \n                        /*modifiers*/ undefined, parameter.name, \n                        /*questionOrExclamationToken*/ undefined, \n                        /*type*/ undefined, \n                        /*initializer*/ undefined), parameter));\n                    }\n                }\n            }\n            ts.addRange(members, ts.visitNodes(node.members, classElementVisitor, ts.isClassElement));\n            return ts.setTextRange(factory.createNodeArray(members), /*location*/ node.members);\n        }\n        /**\n         * Gets either the static or instance members of a class that are decorated, or have\n         * parameters that are decorated.\n         *\n         * @param node The class containing the member.\n         * @param isStatic A value indicating whether to retrieve static or instance members of\n         *                 the class.\n         */\n        function getDecoratedClassElements(node, isStatic) {\n            return ts.filter(node.members, isStatic ? function (m) { return isStaticDecoratedClassElement(m, node); } : function (m) { return isInstanceDecoratedClassElement(m, node); });\n        }\n        /**\n         * Determines whether a class member is a static member of a class that is decorated, or\n         * has parameters that are decorated.\n         *\n         * @param member The class member.\n         */\n        function isStaticDecoratedClassElement(member, parent) {\n            return isDecoratedClassElement(member, /*isStatic*/ true, parent);\n        }\n        /**\n         * Determines whether a class member is an instance member of a class that is decorated,\n         * or has parameters that are decorated.\n         *\n         * @param member The class member.\n         */\n        function isInstanceDecoratedClassElement(member, parent) {\n            return isDecoratedClassElement(member, /*isStatic*/ false, parent);\n        }\n        /**\n         * Determines whether a class member is either a static or an instance member of a class\n         * that is decorated, or has parameters that are decorated.\n         *\n         * @param member The class member.\n         */\n        function isDecoratedClassElement(member, isStatic, parent) {\n            return ts.nodeOrChildIsDecorated(member, parent)\n                && isStatic === ts.hasSyntacticModifier(member, 32 /* Static */);\n        }\n        /**\n         * Gets an array of arrays of decorators for the parameters of a function-like node.\n         * The offset into the result array should correspond to the offset of the parameter.\n         *\n         * @param node The function-like node.\n         */\n        function getDecoratorsOfParameters(node) {\n            var decorators;\n            if (node) {\n                var parameters = node.parameters;\n                var firstParameterIsThis = parameters.length > 0 && ts.parameterIsThisKeyword(parameters[0]);\n                var firstParameterOffset = firstParameterIsThis ? 1 : 0;\n                var numParameters = firstParameterIsThis ? parameters.length - 1 : parameters.length;\n                for (var i = 0; i < numParameters; i++) {\n                    var parameter = parameters[i + firstParameterOffset];\n                    if (decorators || parameter.decorators) {\n                        if (!decorators) {\n                            decorators = new Array(numParameters);\n                        }\n                        decorators[i] = parameter.decorators;\n                    }\n                }\n            }\n            return decorators;\n        }\n        /**\n         * Gets an AllDecorators object containing the decorators for the class and the decorators for the\n         * parameters of the constructor of the class.\n         *\n         * @param node The class node.\n         */\n        function getAllDecoratorsOfConstructor(node) {\n            var decorators = node.decorators;\n            var parameters = getDecoratorsOfParameters(ts.getFirstConstructorWithBody(node));\n            if (!decorators && !parameters) {\n                return undefined;\n            }\n            return {\n                decorators: decorators,\n                parameters: parameters\n            };\n        }\n        /**\n         * Gets an AllDecorators object containing the decorators for the member and its parameters.\n         *\n         * @param node The class node that contains the member.\n         * @param member The class member.\n         */\n        function getAllDecoratorsOfClassElement(node, member) {\n            switch (member.kind) {\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    return getAllDecoratorsOfAccessors(node, member);\n                case 165 /* MethodDeclaration */:\n                    return getAllDecoratorsOfMethod(member);\n                case 163 /* PropertyDeclaration */:\n                    return getAllDecoratorsOfProperty(member);\n                default:\n                    return undefined;\n            }\n        }\n        /**\n         * Gets an AllDecorators object containing the decorators for the accessor and its parameters.\n         *\n         * @param node The class node that contains the accessor.\n         * @param accessor The class accessor member.\n         */\n        function getAllDecoratorsOfAccessors(node, accessor) {\n            if (!accessor.body) {\n                return undefined;\n            }\n            var _a = ts.getAllAccessorDeclarations(node.members, accessor), firstAccessor = _a.firstAccessor, secondAccessor = _a.secondAccessor, setAccessor = _a.setAccessor;\n            var firstAccessorWithDecorators = firstAccessor.decorators ? firstAccessor : secondAccessor && secondAccessor.decorators ? secondAccessor : undefined;\n            if (!firstAccessorWithDecorators || accessor !== firstAccessorWithDecorators) {\n                return undefined;\n            }\n            var decorators = firstAccessorWithDecorators.decorators;\n            var parameters = getDecoratorsOfParameters(setAccessor);\n            if (!decorators && !parameters) {\n                return undefined;\n            }\n            return { decorators: decorators, parameters: parameters };\n        }\n        /**\n         * Gets an AllDecorators object containing the decorators for the method and its parameters.\n         *\n         * @param method The class method member.\n         */\n        function getAllDecoratorsOfMethod(method) {\n            if (!method.body) {\n                return undefined;\n            }\n            var decorators = method.decorators;\n            var parameters = getDecoratorsOfParameters(method);\n            if (!decorators && !parameters) {\n                return undefined;\n            }\n            return { decorators: decorators, parameters: parameters };\n        }\n        /**\n         * Gets an AllDecorators object containing the decorators for the property.\n         *\n         * @param property The class property member.\n         */\n        function getAllDecoratorsOfProperty(property) {\n            var decorators = property.decorators;\n            if (!decorators) {\n                return undefined;\n            }\n            return { decorators: decorators };\n        }\n        /**\n         * Transforms all of the decorators for a declaration into an array of expressions.\n         *\n         * @param node The declaration node.\n         * @param allDecorators An object containing all of the decorators for the declaration.\n         */\n        function transformAllDecoratorsOfDeclaration(node, container, allDecorators) {\n            if (!allDecorators) {\n                return undefined;\n            }\n            var decoratorExpressions = [];\n            ts.addRange(decoratorExpressions, ts.map(allDecorators.decorators, transformDecorator));\n            ts.addRange(decoratorExpressions, ts.flatMap(allDecorators.parameters, transformDecoratorsOfParameter));\n            addTypeMetadata(node, container, decoratorExpressions);\n            return decoratorExpressions;\n        }\n        /**\n         * Generates statements used to apply decorators to either the static or instance members\n         * of a class.\n         *\n         * @param node The class node.\n         * @param isStatic A value indicating whether to generate statements for static or\n         *                 instance members.\n         */\n        function addClassElementDecorationStatements(statements, node, isStatic) {\n            ts.addRange(statements, ts.map(generateClassElementDecorationExpressions(node, isStatic), expressionToStatement));\n        }\n        /**\n         * Generates expressions used to apply decorators to either the static or instance members\n         * of a class.\n         *\n         * @param node The class node.\n         * @param isStatic A value indicating whether to generate expressions for static or\n         *                 instance members.\n         */\n        function generateClassElementDecorationExpressions(node, isStatic) {\n            var members = getDecoratedClassElements(node, isStatic);\n            var expressions;\n            for (var _i = 0, members_6 = members; _i < members_6.length; _i++) {\n                var member = members_6[_i];\n                var expression = generateClassElementDecorationExpression(node, member);\n                if (expression) {\n                    if (!expressions) {\n                        expressions = [expression];\n                    }\n                    else {\n                        expressions.push(expression);\n                    }\n                }\n            }\n            return expressions;\n        }\n        /**\n         * Generates an expression used to evaluate class element decorators at runtime.\n         *\n         * @param node The class node that contains the member.\n         * @param member The class member.\n         */\n        function generateClassElementDecorationExpression(node, member) {\n            var allDecorators = getAllDecoratorsOfClassElement(node, member);\n            var decoratorExpressions = transformAllDecoratorsOfDeclaration(member, node, allDecorators);\n            if (!decoratorExpressions) {\n                return undefined;\n            }\n            // Emit the call to __decorate. Given the following:\n            //\n            //   class C {\n            //     @dec method(@dec2 x) {}\n            //     @dec get accessor() {}\n            //     @dec prop;\n            //   }\n            //\n            // The emit for a method is:\n            //\n            //   __decorate([\n            //       dec,\n            //       __param(0, dec2),\n            //       __metadata(\"design:type\", Function),\n            //       __metadata(\"design:paramtypes\", [Object]),\n            //       __metadata(\"design:returntype\", void 0)\n            //   ], C.prototype, \"method\", null);\n            //\n            // The emit for an accessor is:\n            //\n            //   __decorate([\n            //       dec\n            //   ], C.prototype, \"accessor\", null);\n            //\n            // The emit for a property is:\n            //\n            //   __decorate([\n            //       dec\n            //   ], C.prototype, \"prop\");\n            //\n            var prefix = getClassMemberPrefix(node, member);\n            var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true);\n            var descriptor = languageVersion > 0 /* ES3 */\n                ? member.kind === 163 /* PropertyDeclaration */\n                    // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it\n                    // should not invoke `Object.getOwnPropertyDescriptor`.\n                    ? factory.createVoidZero()\n                    // We emit `null` here to indicate to `__decorate` that it can invoke `Object.getOwnPropertyDescriptor` directly.\n                    // We have this extra argument here so that we can inject an explicit property descriptor at a later date.\n                    : factory.createNull()\n                : undefined;\n            var helper = emitHelpers().createDecorateHelper(decoratorExpressions, prefix, memberName, descriptor);\n            ts.setTextRange(helper, ts.moveRangePastDecorators(member));\n            ts.setEmitFlags(helper, 1536 /* NoComments */);\n            return helper;\n        }\n        /**\n         * Generates a __decorate helper call for a class constructor.\n         *\n         * @param node The class node.\n         */\n        function addConstructorDecorationStatement(statements, node) {\n            var expression = generateConstructorDecorationExpression(node);\n            if (expression) {\n                statements.push(ts.setOriginalNode(factory.createExpressionStatement(expression), node));\n            }\n        }\n        /**\n         * Generates a __decorate helper call for a class constructor.\n         *\n         * @param node The class node.\n         */\n        function generateConstructorDecorationExpression(node) {\n            var allDecorators = getAllDecoratorsOfConstructor(node);\n            var decoratorExpressions = transformAllDecoratorsOfDeclaration(node, node, allDecorators);\n            if (!decoratorExpressions) {\n                return undefined;\n            }\n            var classAlias = classAliases && classAliases[ts.getOriginalNodeId(node)];\n            var localName = factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true);\n            var decorate = emitHelpers().createDecorateHelper(decoratorExpressions, localName);\n            var expression = factory.createAssignment(localName, classAlias ? factory.createAssignment(classAlias, decorate) : decorate);\n            ts.setEmitFlags(expression, 1536 /* NoComments */);\n            ts.setSourceMapRange(expression, ts.moveRangePastDecorators(node));\n            return expression;\n        }\n        /**\n         * Transforms a decorator into an expression.\n         *\n         * @param decorator The decorator node.\n         */\n        function transformDecorator(decorator) {\n            return ts.visitNode(decorator.expression, visitor, ts.isExpression);\n        }\n        /**\n         * Transforms the decorators of a parameter.\n         *\n         * @param decorators The decorators for the parameter at the provided offset.\n         * @param parameterOffset The offset of the parameter.\n         */\n        function transformDecoratorsOfParameter(decorators, parameterOffset) {\n            var expressions;\n            if (decorators) {\n                expressions = [];\n                for (var _i = 0, decorators_1 = decorators; _i < decorators_1.length; _i++) {\n                    var decorator = decorators_1[_i];\n                    var helper = emitHelpers().createParamHelper(transformDecorator(decorator), parameterOffset);\n                    ts.setTextRange(helper, decorator.expression);\n                    ts.setEmitFlags(helper, 1536 /* NoComments */);\n                    expressions.push(helper);\n                }\n            }\n            return expressions;\n        }\n        /**\n         * Adds optional type metadata for a declaration.\n         *\n         * @param node The declaration node.\n         * @param decoratorExpressions The destination array to which to add new decorator expressions.\n         */\n        function addTypeMetadata(node, container, decoratorExpressions) {\n            if (USE_NEW_TYPE_METADATA_FORMAT) {\n                addNewTypeMetadata(node, container, decoratorExpressions);\n            }\n            else {\n                addOldTypeMetadata(node, container, decoratorExpressions);\n            }\n        }\n        function addOldTypeMetadata(node, container, decoratorExpressions) {\n            if (compilerOptions.emitDecoratorMetadata) {\n                if (shouldAddTypeMetadata(node)) {\n                    decoratorExpressions.push(emitHelpers().createMetadataHelper(\"design:type\", serializeTypeOfNode(node)));\n                }\n                if (shouldAddParamTypesMetadata(node)) {\n                    decoratorExpressions.push(emitHelpers().createMetadataHelper(\"design:paramtypes\", serializeParameterTypesOfNode(node, container)));\n                }\n                if (shouldAddReturnTypeMetadata(node)) {\n                    decoratorExpressions.push(emitHelpers().createMetadataHelper(\"design:returntype\", serializeReturnTypeOfNode(node)));\n                }\n            }\n        }\n        function addNewTypeMetadata(node, container, decoratorExpressions) {\n            if (compilerOptions.emitDecoratorMetadata) {\n                var properties = void 0;\n                if (shouldAddTypeMetadata(node)) {\n                    (properties || (properties = [])).push(factory.createPropertyAssignment(\"type\", factory.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, factory.createToken(38 /* EqualsGreaterThanToken */), serializeTypeOfNode(node))));\n                }\n                if (shouldAddParamTypesMetadata(node)) {\n                    (properties || (properties = [])).push(factory.createPropertyAssignment(\"paramTypes\", factory.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, factory.createToken(38 /* EqualsGreaterThanToken */), serializeParameterTypesOfNode(node, container))));\n                }\n                if (shouldAddReturnTypeMetadata(node)) {\n                    (properties || (properties = [])).push(factory.createPropertyAssignment(\"returnType\", factory.createArrowFunction(/*modifiers*/ undefined, /*typeParameters*/ undefined, [], /*type*/ undefined, factory.createToken(38 /* EqualsGreaterThanToken */), serializeReturnTypeOfNode(node))));\n                }\n                if (properties) {\n                    decoratorExpressions.push(emitHelpers().createMetadataHelper(\"design:typeinfo\", factory.createObjectLiteralExpression(properties, /*multiLine*/ true)));\n                }\n            }\n        }\n        /**\n         * Determines whether to emit the \"design:type\" metadata based on the node's kind.\n         * The caller should have already tested whether the node has decorators and whether the\n         * emitDecoratorMetadata compiler option is set.\n         *\n         * @param node The node to test.\n         */\n        function shouldAddTypeMetadata(node) {\n            var kind = node.kind;\n            return kind === 165 /* MethodDeclaration */\n                || kind === 167 /* GetAccessor */\n                || kind === 168 /* SetAccessor */\n                || kind === 163 /* PropertyDeclaration */;\n        }\n        /**\n         * Determines whether to emit the \"design:returntype\" metadata based on the node's kind.\n         * The caller should have already tested whether the node has decorators and whether the\n         * emitDecoratorMetadata compiler option is set.\n         *\n         * @param node The node to test.\n         */\n        function shouldAddReturnTypeMetadata(node) {\n            return node.kind === 165 /* MethodDeclaration */;\n        }\n        /**\n         * Determines whether to emit the \"design:paramtypes\" metadata based on the node's kind.\n         * The caller should have already tested whether the node has decorators and whether the\n         * emitDecoratorMetadata compiler option is set.\n         *\n         * @param node The node to test.\n         */\n        function shouldAddParamTypesMetadata(node) {\n            switch (node.kind) {\n                case 252 /* ClassDeclaration */:\n                case 221 /* ClassExpression */:\n                    return ts.getFirstConstructorWithBody(node) !== undefined;\n                case 165 /* MethodDeclaration */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    return true;\n            }\n            return false;\n        }\n        function getAccessorTypeNode(node) {\n            var accessors = resolver.getAllAccessorDeclarations(node);\n            return accessors.setAccessor && ts.getSetAccessorTypeAnnotationNode(accessors.setAccessor)\n                || accessors.getAccessor && ts.getEffectiveReturnTypeNode(accessors.getAccessor);\n        }\n        /**\n         * Serializes the type of a node for use with decorator type metadata.\n         *\n         * @param node The node that should have its type serialized.\n         */\n        function serializeTypeOfNode(node) {\n            switch (node.kind) {\n                case 163 /* PropertyDeclaration */:\n                case 160 /* Parameter */:\n                    return serializeTypeNode(node.type);\n                case 168 /* SetAccessor */:\n                case 167 /* GetAccessor */:\n                    return serializeTypeNode(getAccessorTypeNode(node));\n                case 252 /* ClassDeclaration */:\n                case 221 /* ClassExpression */:\n                case 165 /* MethodDeclaration */:\n                    return factory.createIdentifier(\"Function\");\n                default:\n                    return factory.createVoidZero();\n            }\n        }\n        /**\n         * Serializes the types of the parameters of a node for use with decorator type metadata.\n         *\n         * @param node The node that should have its parameter types serialized.\n         */\n        function serializeParameterTypesOfNode(node, container) {\n            var valueDeclaration = ts.isClassLike(node)\n                ? ts.getFirstConstructorWithBody(node)\n                : ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)\n                    ? node\n                    : undefined;\n            var expressions = [];\n            if (valueDeclaration) {\n                var parameters = getParametersOfDecoratedDeclaration(valueDeclaration, container);\n                var numParameters = parameters.length;\n                for (var i = 0; i < numParameters; i++) {\n                    var parameter = parameters[i];\n                    if (i === 0 && ts.isIdentifier(parameter.name) && parameter.name.escapedText === \"this\") {\n                        continue;\n                    }\n                    if (parameter.dotDotDotToken) {\n                        expressions.push(serializeTypeNode(ts.getRestParameterElementType(parameter.type)));\n                    }\n                    else {\n                        expressions.push(serializeTypeOfNode(parameter));\n                    }\n                }\n            }\n            return factory.createArrayLiteralExpression(expressions);\n        }\n        function getParametersOfDecoratedDeclaration(node, container) {\n            if (container && node.kind === 167 /* GetAccessor */) {\n                var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor;\n                if (setAccessor) {\n                    return setAccessor.parameters;\n                }\n            }\n            return node.parameters;\n        }\n        /**\n         * Serializes the return type of a node for use with decorator type metadata.\n         *\n         * @param node The node that should have its return type serialized.\n         */\n        function serializeReturnTypeOfNode(node) {\n            if (ts.isFunctionLike(node) && node.type) {\n                return serializeTypeNode(node.type);\n            }\n            else if (ts.isAsyncFunction(node)) {\n                return factory.createIdentifier(\"Promise\");\n            }\n            return factory.createVoidZero();\n        }\n        /**\n         * Serializes a type node for use with decorator type metadata.\n         *\n         * Types are serialized in the following fashion:\n         * - Void types point to \"undefined\" (e.g. \"void 0\")\n         * - Function and Constructor types point to the global \"Function\" constructor.\n         * - Interface types with a call or construct signature types point to the global\n         *   \"Function\" constructor.\n         * - Array and Tuple types point to the global \"Array\" constructor.\n         * - Type predicates and booleans point to the global \"Boolean\" constructor.\n         * - String literal types and strings point to the global \"String\" constructor.\n         * - Enum and number types point to the global \"Number\" constructor.\n         * - Symbol types point to the global \"Symbol\" constructor.\n         * - Type references to classes (or class-like variables) point to the constructor for the class.\n         * - Anything else points to the global \"Object\" constructor.\n         *\n         * @param node The type node to serialize.\n         */\n        function serializeTypeNode(node) {\n            if (node === undefined) {\n                return factory.createIdentifier(\"Object\");\n            }\n            switch (node.kind) {\n                case 113 /* VoidKeyword */:\n                case 150 /* UndefinedKeyword */:\n                case 141 /* NeverKeyword */:\n                    return factory.createVoidZero();\n                case 186 /* ParenthesizedType */:\n                    return serializeTypeNode(node.type);\n                case 174 /* FunctionType */:\n                case 175 /* ConstructorType */:\n                    return factory.createIdentifier(\"Function\");\n                case 178 /* ArrayType */:\n                case 179 /* TupleType */:\n                    return factory.createIdentifier(\"Array\");\n                case 172 /* TypePredicate */:\n                case 131 /* BooleanKeyword */:\n                    return factory.createIdentifier(\"Boolean\");\n                case 147 /* StringKeyword */:\n                    return factory.createIdentifier(\"String\");\n                case 145 /* ObjectKeyword */:\n                    return factory.createIdentifier(\"Object\");\n                case 191 /* LiteralType */:\n                    switch (node.literal.kind) {\n                        case 10 /* StringLiteral */:\n                        case 14 /* NoSubstitutionTemplateLiteral */:\n                            return factory.createIdentifier(\"String\");\n                        case 214 /* PrefixUnaryExpression */:\n                        case 8 /* NumericLiteral */:\n                            return factory.createIdentifier(\"Number\");\n                        case 9 /* BigIntLiteral */:\n                            return getGlobalBigIntNameWithFallback();\n                        case 109 /* TrueKeyword */:\n                        case 94 /* FalseKeyword */:\n                            return factory.createIdentifier(\"Boolean\");\n                        case 103 /* NullKeyword */:\n                            return factory.createVoidZero();\n                        default:\n                            return ts.Debug.failBadSyntaxKind(node.literal);\n                    }\n                case 144 /* NumberKeyword */:\n                    return factory.createIdentifier(\"Number\");\n                case 155 /* BigIntKeyword */:\n                    return getGlobalBigIntNameWithFallback();\n                case 148 /* SymbolKeyword */:\n                    return languageVersion < 2 /* ES2015 */\n                        ? getGlobalSymbolNameWithFallback()\n                        : factory.createIdentifier(\"Symbol\");\n                case 173 /* TypeReference */:\n                    return serializeTypeReferenceNode(node);\n                case 183 /* IntersectionType */:\n                case 182 /* UnionType */:\n                    return serializeTypeList(node.types);\n                case 184 /* ConditionalType */:\n                    return serializeTypeList([node.trueType, node.falseType]);\n                case 188 /* TypeOperator */:\n                    if (node.operator === 142 /* ReadonlyKeyword */) {\n                        return serializeTypeNode(node.type);\n                    }\n                    break;\n                case 176 /* TypeQuery */:\n                case 189 /* IndexedAccessType */:\n                case 190 /* MappedType */:\n                case 177 /* TypeLiteral */:\n                case 128 /* AnyKeyword */:\n                case 152 /* UnknownKeyword */:\n                case 187 /* ThisType */:\n                case 195 /* ImportType */:\n                    break;\n                // handle JSDoc types from an invalid parse\n                case 303 /* JSDocAllType */:\n                case 304 /* JSDocUnknownType */:\n                case 308 /* JSDocFunctionType */:\n                case 309 /* JSDocVariadicType */:\n                case 310 /* JSDocNamepathType */:\n                    break;\n                case 305 /* JSDocNullableType */:\n                case 306 /* JSDocNonNullableType */:\n                case 307 /* JSDocOptionalType */:\n                    return serializeTypeNode(node.type);\n                default:\n                    return ts.Debug.failBadSyntaxKind(node);\n            }\n            return factory.createIdentifier(\"Object\");\n        }\n        function serializeTypeList(types) {\n            // Note when updating logic here also update getEntityNameForDecoratorMetadata\n            // so that aliases can be marked as referenced\n            var serializedUnion;\n            for (var _i = 0, types_24 = types; _i < types_24.length; _i++) {\n                var typeNode = types_24[_i];\n                while (typeNode.kind === 186 /* ParenthesizedType */) {\n                    typeNode = typeNode.type; // Skip parens if need be\n                }\n                if (typeNode.kind === 141 /* NeverKeyword */) {\n                    continue; // Always elide `never` from the union/intersection if possible\n                }\n                if (!strictNullChecks && (typeNode.kind === 191 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 150 /* UndefinedKeyword */)) {\n                    continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks\n                }\n                var serializedIndividual = serializeTypeNode(typeNode);\n                if (ts.isIdentifier(serializedIndividual) && serializedIndividual.escapedText === \"Object\") {\n                    // One of the individual is global object, return immediately\n                    return serializedIndividual;\n                }\n                // If there exists union that is not void 0 expression, check if the the common type is identifier.\n                // anything more complex and we will just default to Object\n                else if (serializedUnion) {\n                    // Different types\n                    if (!ts.isIdentifier(serializedUnion) ||\n                        !ts.isIdentifier(serializedIndividual) ||\n                        serializedUnion.escapedText !== serializedIndividual.escapedText) {\n                        return factory.createIdentifier(\"Object\");\n                    }\n                }\n                else {\n                    // Initialize the union type\n                    serializedUnion = serializedIndividual;\n                }\n            }\n            // If we were able to find common type, use it\n            return serializedUnion || factory.createVoidZero(); // Fallback is only hit if all union constituients are null/undefined/never\n        }\n        /**\n         * Serializes a TypeReferenceNode to an appropriate JS constructor value for use with\n         * decorator type metadata.\n         *\n         * @param node The type reference node.\n         */\n        function serializeTypeReferenceNode(node) {\n            var kind = resolver.getTypeReferenceSerializationKind(node.typeName, currentNameScope || currentLexicalScope);\n            switch (kind) {\n                case ts.TypeReferenceSerializationKind.Unknown:\n                    // From conditional type type reference that cannot be resolved is Similar to any or unknown\n                    if (ts.findAncestor(node, function (n) { return n.parent && ts.isConditionalTypeNode(n.parent) && (n.parent.trueType === n || n.parent.falseType === n); })) {\n                        return factory.createIdentifier(\"Object\");\n                    }\n                    var serialized = serializeEntityNameAsExpressionFallback(node.typeName);\n                    var temp = factory.createTempVariable(hoistVariableDeclaration);\n                    return factory.createConditionalExpression(factory.createTypeCheck(factory.createAssignment(temp, serialized), \"function\"), \n                    /*questionToken*/ undefined, temp, \n                    /*colonToken*/ undefined, factory.createIdentifier(\"Object\"));\n                case ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue:\n                    return serializeEntityNameAsExpression(node.typeName);\n                case ts.TypeReferenceSerializationKind.VoidNullableOrNeverType:\n                    return factory.createVoidZero();\n                case ts.TypeReferenceSerializationKind.BigIntLikeType:\n                    return getGlobalBigIntNameWithFallback();\n                case ts.TypeReferenceSerializationKind.BooleanType:\n                    return factory.createIdentifier(\"Boolean\");\n                case ts.TypeReferenceSerializationKind.NumberLikeType:\n                    return factory.createIdentifier(\"Number\");\n                case ts.TypeReferenceSerializationKind.StringLikeType:\n                    return factory.createIdentifier(\"String\");\n                case ts.TypeReferenceSerializationKind.ArrayLikeType:\n                    return factory.createIdentifier(\"Array\");\n                case ts.TypeReferenceSerializationKind.ESSymbolType:\n                    return languageVersion < 2 /* ES2015 */\n                        ? getGlobalSymbolNameWithFallback()\n                        : factory.createIdentifier(\"Symbol\");\n                case ts.TypeReferenceSerializationKind.TypeWithCallSignature:\n                    return factory.createIdentifier(\"Function\");\n                case ts.TypeReferenceSerializationKind.Promise:\n                    return factory.createIdentifier(\"Promise\");\n                case ts.TypeReferenceSerializationKind.ObjectType:\n                    return factory.createIdentifier(\"Object\");\n                default:\n                    return ts.Debug.assertNever(kind);\n            }\n        }\n        function createCheckedValue(left, right) {\n            return factory.createLogicalAnd(factory.createStrictInequality(factory.createTypeOfExpression(left), factory.createStringLiteral(\"undefined\")), right);\n        }\n        /**\n         * Serializes an entity name which may not exist at runtime, but whose access shouldn't throw\n         *\n         * @param node The entity name to serialize.\n         */\n        function serializeEntityNameAsExpressionFallback(node) {\n            if (node.kind === 78 /* Identifier */) {\n                // A -> typeof A !== undefined && A\n                var copied = serializeEntityNameAsExpression(node);\n                return createCheckedValue(copied, copied);\n            }\n            if (node.left.kind === 78 /* Identifier */) {\n                // A.B -> typeof A !== undefined && A.B\n                return createCheckedValue(serializeEntityNameAsExpression(node.left), serializeEntityNameAsExpression(node));\n            }\n            // A.B.C -> typeof A !== undefined && (_a = A.B) !== void 0 && _a.C\n            var left = serializeEntityNameAsExpressionFallback(node.left);\n            var temp = factory.createTempVariable(hoistVariableDeclaration);\n            return factory.createLogicalAnd(factory.createLogicalAnd(left.left, factory.createStrictInequality(factory.createAssignment(temp, left.right), factory.createVoidZero())), factory.createPropertyAccessExpression(temp, node.right));\n        }\n        /**\n         * Serializes an entity name as an expression for decorator type metadata.\n         *\n         * @param node The entity name to serialize.\n         */\n        function serializeEntityNameAsExpression(node) {\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                    // Create a clone of the name with a new parent, and treat it as if it were\n                    // a source tree node for the purposes of the checker.\n                    var name = ts.setParent(ts.setTextRange(ts.parseNodeFactory.cloneNode(node), node), node.parent);\n                    name.original = undefined;\n                    ts.setParent(name, ts.getParseTreeNode(currentLexicalScope)); // ensure the parent is set to a parse tree node.\n                    return name;\n                case 157 /* QualifiedName */:\n                    return serializeQualifiedNameAsExpression(node);\n            }\n        }\n        /**\n         * Serializes an qualified name as an expression for decorator type metadata.\n         *\n         * @param node The qualified name to serialize.\n         * @param useFallback A value indicating whether to use logical operators to test for the\n         *                    qualified name at runtime.\n         */\n        function serializeQualifiedNameAsExpression(node) {\n            return factory.createPropertyAccessExpression(serializeEntityNameAsExpression(node.left), node.right);\n        }\n        /**\n         * Gets an expression that points to the global \"Symbol\" constructor at runtime if it is\n         * available.\n         */\n        function getGlobalSymbolNameWithFallback() {\n            return factory.createConditionalExpression(factory.createTypeCheck(factory.createIdentifier(\"Symbol\"), \"function\"), \n            /*questionToken*/ undefined, factory.createIdentifier(\"Symbol\"), \n            /*colonToken*/ undefined, factory.createIdentifier(\"Object\"));\n        }\n        /**\n         * Gets an expression that points to the global \"BigInt\" constructor at runtime if it is\n         * available.\n         */\n        function getGlobalBigIntNameWithFallback() {\n            return languageVersion < 99 /* ESNext */\n                ? factory.createConditionalExpression(factory.createTypeCheck(factory.createIdentifier(\"BigInt\"), \"function\"), \n                /*questionToken*/ undefined, factory.createIdentifier(\"BigInt\"), \n                /*colonToken*/ undefined, factory.createIdentifier(\"Object\"))\n                : factory.createIdentifier(\"BigInt\");\n        }\n        /**\n         * Gets an expression that represents a property name (for decorated properties or enums).\n         * For a computed property, a name is generated for the node.\n         *\n         * @param member The member whose name should be converted into an expression.\n         */\n        function getExpressionForPropertyName(member, generateNameForComputedPropertyName) {\n            var name = member.name;\n            if (ts.isPrivateIdentifier(name)) {\n                return factory.createIdentifier(\"\");\n            }\n            else if (ts.isComputedPropertyName(name)) {\n                return generateNameForComputedPropertyName && !ts.isSimpleInlineableExpression(name.expression)\n                    ? factory.getGeneratedNameForNode(name)\n                    : name.expression;\n            }\n            else if (ts.isIdentifier(name)) {\n                return factory.createStringLiteral(ts.idText(name));\n            }\n            else {\n                return factory.cloneNode(name);\n            }\n        }\n        /**\n         * Visits the property name of a class element, for use when emitting property\n         * initializers. For a computed property on a node with decorators, a temporary\n         * value is stored for later use.\n         *\n         * @param member The member whose name should be visited.\n         */\n        function visitPropertyNameOfClassElement(member) {\n            var name = member.name;\n            // Computed property names need to be transformed into a hoisted variable when they are used more than once.\n            // The names are used more than once when:\n            //   - the property is non-static and its initializer is moved to the constructor (when there are parameter property assignments).\n            //   - the property has a decorator.\n            if (ts.isComputedPropertyName(name) && ((!ts.hasStaticModifier(member) && currentClassHasParameterProperties) || ts.some(member.decorators))) {\n                var expression = ts.visitNode(name.expression, visitor, ts.isExpression);\n                var innerExpression = ts.skipPartiallyEmittedExpressions(expression);\n                if (!ts.isSimpleInlineableExpression(innerExpression)) {\n                    var generatedName = factory.getGeneratedNameForNode(name);\n                    hoistVariableDeclaration(generatedName);\n                    return factory.updateComputedPropertyName(name, factory.createAssignment(generatedName, expression));\n                }\n            }\n            return ts.visitNode(name, visitor, ts.isPropertyName);\n        }\n        /**\n         * Transforms a HeritageClause with TypeScript syntax.\n         *\n         * This function will only be called when one of the following conditions are met:\n         * - The node is a non-`extends` heritage clause that should be elided.\n         * - The node is an `extends` heritage clause that should be visited, but only allow a single type.\n         *\n         * @param node The HeritageClause to transform.\n         */\n        function visitHeritageClause(node) {\n            if (node.token === 116 /* ImplementsKeyword */) {\n                // implements clauses are elided\n                return undefined;\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        /**\n         * Transforms an ExpressionWithTypeArguments with TypeScript syntax.\n         *\n         * This function will only be called when one of the following conditions are met:\n         * - The node contains type arguments that should be elided.\n         *\n         * @param node The ExpressionWithTypeArguments to transform.\n         */\n        function visitExpressionWithTypeArguments(node) {\n            return factory.updateExpressionWithTypeArguments(node, ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression), \n            /*typeArguments*/ undefined);\n        }\n        /**\n         * Determines whether to emit a function-like declaration. We should not emit the\n         * declaration if it does not have a body.\n         *\n         * @param node The declaration node.\n         */\n        function shouldEmitFunctionLikeDeclaration(node) {\n            return !ts.nodeIsMissing(node.body);\n        }\n        function visitPropertyDeclaration(node) {\n            if (node.flags & 8388608 /* Ambient */ || ts.hasSyntacticModifier(node, 128 /* Abstract */)) {\n                return undefined;\n            }\n            var updated = factory.updatePropertyDeclaration(node, \n            /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), visitPropertyNameOfClassElement(node), \n            /*questionOrExclamationToken*/ undefined, \n            /*type*/ undefined, ts.visitNode(node.initializer, visitor));\n            if (updated !== node) {\n                // While we emit the source map for the node after skipping decorators and modifiers,\n                // we need to emit the comments for the original range.\n                ts.setCommentRange(updated, node);\n                ts.setSourceMapRange(updated, ts.moveRangePastDecorators(node));\n            }\n            return updated;\n        }\n        function visitConstructor(node) {\n            if (!shouldEmitFunctionLikeDeclaration(node)) {\n                return undefined;\n            }\n            return factory.updateConstructorDeclaration(node, \n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, ts.visitParameterList(node.parameters, visitor, context), transformConstructorBody(node.body, node));\n        }\n        function transformConstructorBody(body, constructor) {\n            var parametersWithPropertyAssignments = constructor &&\n                ts.filter(constructor.parameters, function (p) { return ts.isParameterPropertyDeclaration(p, constructor); });\n            if (!ts.some(parametersWithPropertyAssignments)) {\n                return ts.visitFunctionBody(body, visitor, context);\n            }\n            var statements = [];\n            var indexOfFirstStatement = 0;\n            resumeLexicalEnvironment();\n            indexOfFirstStatement = ts.addPrologueDirectivesAndInitialSuperCall(factory, constructor, statements, visitor);\n            // Add parameters with property assignments. Transforms this:\n            //\n            //  constructor (public x, public y) {\n            //  }\n            //\n            // Into this:\n            //\n            //  constructor (x, y) {\n            //      this.x = x;\n            //      this.y = y;\n            //  }\n            //\n            ts.addRange(statements, ts.map(parametersWithPropertyAssignments, transformParameterWithPropertyAssignment));\n            // Add the existing statements, skipping the initial super call.\n            ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, indexOfFirstStatement));\n            // End the lexical environment.\n            statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment());\n            var block = factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), body.statements), /*multiLine*/ true);\n            ts.setTextRange(block, /*location*/ body);\n            ts.setOriginalNode(block, body);\n            return block;\n        }\n        /**\n         * Transforms a parameter into a property assignment statement.\n         *\n         * @param node The parameter declaration.\n         */\n        function transformParameterWithPropertyAssignment(node) {\n            var name = node.name;\n            if (!ts.isIdentifier(name)) {\n                return undefined;\n            }\n            // TODO(rbuckton): Does this need to be parented?\n            var propertyName = ts.setParent(ts.setTextRange(factory.cloneNode(name), name), name.parent);\n            ts.setEmitFlags(propertyName, 1536 /* NoComments */ | 48 /* NoSourceMap */);\n            // TODO(rbuckton): Does this need to be parented?\n            var localName = ts.setParent(ts.setTextRange(factory.cloneNode(name), name), name.parent);\n            ts.setEmitFlags(localName, 1536 /* NoComments */);\n            return ts.startOnNewLine(ts.removeAllComments(ts.setTextRange(ts.setOriginalNode(factory.createExpressionStatement(factory.createAssignment(ts.setTextRange(factory.createPropertyAccessExpression(factory.createThis(), propertyName), node.name), localName)), node), ts.moveRangePos(node, -1))));\n        }\n        function visitMethodDeclaration(node) {\n            if (!shouldEmitFunctionLikeDeclaration(node)) {\n                return undefined;\n            }\n            var updated = factory.updateMethodDeclaration(node, \n            /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, visitPropertyNameOfClassElement(node), \n            /*questionToken*/ undefined, \n            /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), \n            /*type*/ undefined, ts.visitFunctionBody(node.body, visitor, context));\n            if (updated !== node) {\n                // While we emit the source map for the node after skipping decorators and modifiers,\n                // we need to emit the comments for the original range.\n                ts.setCommentRange(updated, node);\n                ts.setSourceMapRange(updated, ts.moveRangePastDecorators(node));\n            }\n            return updated;\n        }\n        /**\n         * Determines whether to emit an accessor declaration. We should not emit the\n         * declaration if it does not have a body and is abstract.\n         *\n         * @param node The declaration node.\n         */\n        function shouldEmitAccessorDeclaration(node) {\n            return !(ts.nodeIsMissing(node.body) && ts.hasSyntacticModifier(node, 128 /* Abstract */));\n        }\n        function visitGetAccessor(node) {\n            if (!shouldEmitAccessorDeclaration(node)) {\n                return undefined;\n            }\n            var updated = factory.updateGetAccessorDeclaration(node, \n            /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), visitPropertyNameOfClassElement(node), ts.visitParameterList(node.parameters, visitor, context), \n            /*type*/ undefined, ts.visitFunctionBody(node.body, visitor, context) || factory.createBlock([]));\n            if (updated !== node) {\n                // While we emit the source map for the node after skipping decorators and modifiers,\n                // we need to emit the comments for the original range.\n                ts.setCommentRange(updated, node);\n                ts.setSourceMapRange(updated, ts.moveRangePastDecorators(node));\n            }\n            return updated;\n        }\n        function visitSetAccessor(node) {\n            if (!shouldEmitAccessorDeclaration(node)) {\n                return undefined;\n            }\n            var updated = factory.updateSetAccessorDeclaration(node, \n            /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), visitPropertyNameOfClassElement(node), ts.visitParameterList(node.parameters, visitor, context), ts.visitFunctionBody(node.body, visitor, context) || factory.createBlock([]));\n            if (updated !== node) {\n                // While we emit the source map for the node after skipping decorators and modifiers,\n                // we need to emit the comments for the original range.\n                ts.setCommentRange(updated, node);\n                ts.setSourceMapRange(updated, ts.moveRangePastDecorators(node));\n            }\n            return updated;\n        }\n        function visitFunctionDeclaration(node) {\n            if (!shouldEmitFunctionLikeDeclaration(node)) {\n                return factory.createNotEmittedStatement(node);\n            }\n            var updated = factory.updateFunctionDeclaration(node, \n            /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, node.name, \n            /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), \n            /*type*/ undefined, ts.visitFunctionBody(node.body, visitor, context) || factory.createBlock([]));\n            if (isExportOfNamespace(node)) {\n                var statements = [updated];\n                addExportMemberAssignment(statements, node);\n                return statements;\n            }\n            return updated;\n        }\n        function visitFunctionExpression(node) {\n            if (!shouldEmitFunctionLikeDeclaration(node)) {\n                return factory.createOmittedExpression();\n            }\n            var updated = factory.updateFunctionExpression(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, node.name, \n            /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), \n            /*type*/ undefined, ts.visitFunctionBody(node.body, visitor, context) || factory.createBlock([]));\n            return updated;\n        }\n        function visitArrowFunction(node) {\n            var updated = factory.updateArrowFunction(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), \n            /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), \n            /*type*/ undefined, node.equalsGreaterThanToken, ts.visitFunctionBody(node.body, visitor, context));\n            return updated;\n        }\n        function visitParameter(node) {\n            if (ts.parameterIsThisKeyword(node)) {\n                return undefined;\n            }\n            var updated = factory.updateParameterDeclaration(node, \n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, node.dotDotDotToken, ts.visitNode(node.name, visitor, ts.isBindingName), \n            /*questionToken*/ undefined, \n            /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));\n            if (updated !== node) {\n                // While we emit the source map for the node after skipping decorators and modifiers,\n                // we need to emit the comments for the original range.\n                ts.setCommentRange(updated, node);\n                ts.setTextRange(updated, ts.moveRangePastModifiers(node));\n                ts.setSourceMapRange(updated, ts.moveRangePastModifiers(node));\n                ts.setEmitFlags(updated.name, 32 /* NoTrailingSourceMap */);\n            }\n            return updated;\n        }\n        function visitVariableStatement(node) {\n            if (isExportOfNamespace(node)) {\n                var variables = ts.getInitializedVariables(node.declarationList);\n                if (variables.length === 0) {\n                    // elide statement if there are no initialized variables.\n                    return undefined;\n                }\n                return ts.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(ts.map(variables, transformInitializedVariable))), node);\n            }\n            else {\n                return ts.visitEachChild(node, visitor, context);\n            }\n        }\n        function transformInitializedVariable(node) {\n            var name = node.name;\n            if (ts.isBindingPattern(name)) {\n                return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, \n                /*needsValue*/ false, createNamespaceExportExpression);\n            }\n            else {\n                return ts.setTextRange(factory.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name), ts.visitNode(node.initializer, visitor, ts.isExpression)), \n                /*location*/ node);\n            }\n        }\n        function visitVariableDeclaration(node) {\n            return factory.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName), \n            /*exclamationToken*/ undefined, \n            /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));\n        }\n        function visitParenthesizedExpression(node) {\n            var innerExpression = ts.skipOuterExpressions(node.expression, ~6 /* Assertions */);\n            if (ts.isAssertionExpression(innerExpression)) {\n                // Make sure we consider all nested cast expressions, e.g.:\n                // (<any><number><any>-A).x;\n                var expression = ts.visitNode(node.expression, visitor, ts.isExpression);\n                // We have an expression of the form: (<Type>SubExpr). Emitting this as (SubExpr)\n                // is really not desirable. We would like to emit the subexpression as-is. Omitting\n                // the parentheses, however, could cause change in the semantics of the generated\n                // code if the casted expression has a lower precedence than the rest of the\n                // expression.\n                //\n                // To preserve comments, we return a \"PartiallyEmittedExpression\" here which will\n                // preserve the position information of the original expression.\n                //\n                // Due to the auto-parenthesization rules used by the visitor and factory functions\n                // we can safely elide the parentheses here, as a new synthetic\n                // ParenthesizedExpression will be inserted if we remove parentheses too\n                // aggressively.\n                // HOWEVER - if there are leading comments on the expression itself, to handle ASI\n                // correctly for return and throw, we must keep the parenthesis\n                if (ts.length(ts.getLeadingCommentRangesOfNode(expression, currentSourceFile))) {\n                    return factory.updateParenthesizedExpression(node, expression);\n                }\n                return factory.createPartiallyEmittedExpression(expression, node);\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitAssertionExpression(node) {\n            var expression = ts.visitNode(node.expression, visitor, ts.isExpression);\n            return factory.createPartiallyEmittedExpression(expression, node);\n        }\n        function visitNonNullExpression(node) {\n            var expression = ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression);\n            return factory.createPartiallyEmittedExpression(expression, node);\n        }\n        function visitCallExpression(node) {\n            return factory.updateCallExpression(node, ts.visitNode(node.expression, visitor, ts.isExpression), \n            /*typeArguments*/ undefined, ts.visitNodes(node.arguments, visitor, ts.isExpression));\n        }\n        function visitNewExpression(node) {\n            return factory.updateNewExpression(node, ts.visitNode(node.expression, visitor, ts.isExpression), \n            /*typeArguments*/ undefined, ts.visitNodes(node.arguments, visitor, ts.isExpression));\n        }\n        function visitTaggedTemplateExpression(node) {\n            return factory.updateTaggedTemplateExpression(node, ts.visitNode(node.tag, visitor, ts.isExpression), \n            /*typeArguments*/ undefined, ts.visitNode(node.template, visitor, ts.isExpression));\n        }\n        function visitJsxSelfClosingElement(node) {\n            return factory.updateJsxSelfClosingElement(node, ts.visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), \n            /*typeArguments*/ undefined, ts.visitNode(node.attributes, visitor, ts.isJsxAttributes));\n        }\n        function visitJsxJsxOpeningElement(node) {\n            return factory.updateJsxOpeningElement(node, ts.visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), \n            /*typeArguments*/ undefined, ts.visitNode(node.attributes, visitor, ts.isJsxAttributes));\n        }\n        /**\n         * Determines whether to emit an enum declaration.\n         *\n         * @param node The enum declaration node.\n         */\n        function shouldEmitEnumDeclaration(node) {\n            return !ts.isEnumConst(node)\n                || ts.shouldPreserveConstEnums(compilerOptions);\n        }\n        /**\n         * Visits an enum declaration.\n         *\n         * This function will be called any time a TypeScript enum is encountered.\n         *\n         * @param node The enum declaration node.\n         */\n        function visitEnumDeclaration(node) {\n            if (!shouldEmitEnumDeclaration(node)) {\n                return factory.createNotEmittedStatement(node);\n            }\n            var statements = [];\n            // We request to be advised when the printer is about to print this node. This allows\n            // us to set up the correct state for later substitutions.\n            var emitFlags = 2 /* AdviseOnEmitNode */;\n            // If needed, we should emit a variable declaration for the enum. If we emit\n            // a leading variable declaration, we should not emit leading comments for the\n            // enum body.\n            var varAdded = addVarForEnumOrModuleDeclaration(statements, node);\n            if (varAdded) {\n                // We should still emit the comments if we are emitting a system module.\n                if (moduleKind !== ts.ModuleKind.System || currentLexicalScope !== currentSourceFile) {\n                    emitFlags |= 512 /* NoLeadingComments */;\n                }\n            }\n            // `parameterName` is the declaration name used inside of the enum.\n            var parameterName = getNamespaceParameterName(node);\n            // `containerName` is the expression used inside of the enum for assignments.\n            var containerName = getNamespaceContainerName(node);\n            // `exportName` is the expression used within this node's container for any exported references.\n            var exportName = ts.hasSyntacticModifier(node, 1 /* Export */)\n                ? factory.getExternalModuleOrNamespaceExportName(currentNamespaceContainerName, node, /*allowComments*/ false, /*allowSourceMaps*/ true)\n                : factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true);\n            //  x || (x = {})\n            //  exports.x || (exports.x = {})\n            var moduleArg = factory.createLogicalOr(exportName, factory.createAssignment(exportName, factory.createObjectLiteralExpression()));\n            if (hasNamespaceQualifiedExportName(node)) {\n                // `localName` is the expression used within this node's containing scope for any local references.\n                var localName = factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true);\n                //  x = (exports.x || (exports.x = {}))\n                moduleArg = factory.createAssignment(localName, moduleArg);\n            }\n            //  (function (x) {\n            //      x[x[\"y\"] = 0] = \"y\";\n            //      ...\n            //  })(x || (x = {}));\n            var enumStatement = factory.createExpressionStatement(factory.createCallExpression(factory.createFunctionExpression(\n            /*modifiers*/ undefined, \n            /*asteriskToken*/ undefined, \n            /*name*/ undefined, \n            /*typeParameters*/ undefined, [factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, parameterName)], \n            /*type*/ undefined, transformEnumBody(node, containerName)), \n            /*typeArguments*/ undefined, [moduleArg]));\n            ts.setOriginalNode(enumStatement, node);\n            if (varAdded) {\n                // If a variable was added, synthetic comments are emitted on it, not on the moduleStatement.\n                ts.setSyntheticLeadingComments(enumStatement, undefined);\n                ts.setSyntheticTrailingComments(enumStatement, undefined);\n            }\n            ts.setTextRange(enumStatement, node);\n            ts.addEmitFlags(enumStatement, emitFlags);\n            statements.push(enumStatement);\n            // Add a DeclarationMarker for the enum to preserve trailing comments and mark\n            // the end of the declaration.\n            statements.push(factory.createEndOfDeclarationMarker(node));\n            return statements;\n        }\n        /**\n         * Transforms the body of an enum declaration.\n         *\n         * @param node The enum declaration node.\n         */\n        function transformEnumBody(node, localName) {\n            var savedCurrentNamespaceLocalName = currentNamespaceContainerName;\n            currentNamespaceContainerName = localName;\n            var statements = [];\n            startLexicalEnvironment();\n            var members = ts.map(node.members, transformEnumMember);\n            ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());\n            ts.addRange(statements, members);\n            currentNamespaceContainerName = savedCurrentNamespaceLocalName;\n            return factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), /*location*/ node.members), \n            /*multiLine*/ true);\n        }\n        /**\n         * Transforms an enum member into a statement.\n         *\n         * @param member The enum member node.\n         */\n        function transformEnumMember(member) {\n            // enums don't support computed properties\n            // we pass false as 'generateNameForComputedPropertyName' for a backward compatibility purposes\n            // old emitter always generate 'expression' part of the name as-is.\n            var name = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ false);\n            var valueExpression = transformEnumMemberDeclarationValue(member);\n            var innerAssignment = factory.createAssignment(factory.createElementAccessExpression(currentNamespaceContainerName, name), valueExpression);\n            var outerAssignment = valueExpression.kind === 10 /* StringLiteral */ ?\n                innerAssignment :\n                factory.createAssignment(factory.createElementAccessExpression(currentNamespaceContainerName, innerAssignment), name);\n            return ts.setTextRange(factory.createExpressionStatement(ts.setTextRange(outerAssignment, member)), member);\n        }\n        /**\n         * Transforms the value of an enum member.\n         *\n         * @param member The enum member node.\n         */\n        function transformEnumMemberDeclarationValue(member) {\n            var value = resolver.getConstantValue(member);\n            if (value !== undefined) {\n                return typeof value === \"string\" ? factory.createStringLiteral(value) : factory.createNumericLiteral(value);\n            }\n            else {\n                enableSubstitutionForNonQualifiedEnumMembers();\n                if (member.initializer) {\n                    return ts.visitNode(member.initializer, visitor, ts.isExpression);\n                }\n                else {\n                    return factory.createVoidZero();\n                }\n            }\n        }\n        /**\n         * Determines whether to elide a module declaration.\n         *\n         * @param node The module declaration node.\n         */\n        function shouldEmitModuleDeclaration(nodeIn) {\n            var node = ts.getParseTreeNode(nodeIn, ts.isModuleDeclaration);\n            if (!node) {\n                // If we can't find a parse tree node, assume the node is instantiated.\n                return true;\n            }\n            return ts.isInstantiatedModule(node, ts.shouldPreserveConstEnums(compilerOptions));\n        }\n        /**\n         * Determines whether an exported declaration will have a qualified export name (e.g. `f.x`\n         * or `exports.x`).\n         */\n        function hasNamespaceQualifiedExportName(node) {\n            return isExportOfNamespace(node)\n                || (isExternalModuleExport(node)\n                    && moduleKind !== ts.ModuleKind.ES2015\n                    && moduleKind !== ts.ModuleKind.ES2020\n                    && moduleKind !== ts.ModuleKind.ESNext\n                    && moduleKind !== ts.ModuleKind.System);\n        }\n        /**\n         * Records that a declaration was emitted in the current scope, if it was the first\n         * declaration for the provided symbol.\n         */\n        function recordEmittedDeclarationInScope(node) {\n            if (!currentScopeFirstDeclarationsOfName) {\n                currentScopeFirstDeclarationsOfName = new ts.Map();\n            }\n            var name = declaredNameInScope(node);\n            if (!currentScopeFirstDeclarationsOfName.has(name)) {\n                currentScopeFirstDeclarationsOfName.set(name, node);\n            }\n        }\n        /**\n         * Determines whether a declaration is the first declaration with\n         * the same name emitted in the current scope.\n         */\n        function isFirstEmittedDeclarationInScope(node) {\n            if (currentScopeFirstDeclarationsOfName) {\n                var name = declaredNameInScope(node);\n                return currentScopeFirstDeclarationsOfName.get(name) === node;\n            }\n            return true;\n        }\n        function declaredNameInScope(node) {\n            ts.Debug.assertNode(node.name, ts.isIdentifier);\n            return node.name.escapedText;\n        }\n        /**\n         * Adds a leading VariableStatement for a enum or module declaration.\n         */\n        function addVarForEnumOrModuleDeclaration(statements, node) {\n            // Emit a variable statement for the module. We emit top-level enums as a `var`\n            // declaration to avoid static errors in global scripts scripts due to redeclaration.\n            // enums in any other scope are emitted as a `let` declaration.\n            var statement = factory.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), factory.createVariableDeclarationList([\n                factory.createVariableDeclaration(factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true))\n            ], currentLexicalScope.kind === 297 /* SourceFile */ ? 0 /* None */ : 1 /* Let */));\n            ts.setOriginalNode(statement, node);\n            recordEmittedDeclarationInScope(node);\n            if (isFirstEmittedDeclarationInScope(node)) {\n                // Adjust the source map emit to match the old emitter.\n                if (node.kind === 255 /* EnumDeclaration */) {\n                    ts.setSourceMapRange(statement.declarationList, node);\n                }\n                else {\n                    ts.setSourceMapRange(statement, node);\n                }\n                // Trailing comments for module declaration should be emitted after the function closure\n                // instead of the variable statement:\n                //\n                //     /** Module comment*/\n                //     module m1 {\n                //         function foo4Export() {\n                //         }\n                //     } // trailing comment module\n                //\n                // Should emit:\n                //\n                //     /** Module comment*/\n                //     var m1;\n                //     (function (m1) {\n                //         function foo4Export() {\n                //         }\n                //     })(m1 || (m1 = {})); // trailing comment module\n                //\n                ts.setCommentRange(statement, node);\n                ts.addEmitFlags(statement, 1024 /* NoTrailingComments */ | 4194304 /* HasEndOfDeclarationMarker */);\n                statements.push(statement);\n                return true;\n            }\n            else {\n                // For an EnumDeclaration or ModuleDeclaration that merges with a preceeding\n                // declaration we do not emit a leading variable declaration. To preserve the\n                // begin/end semantics of the declararation and to properly handle exports\n                // we wrap the leading variable declaration in a `MergeDeclarationMarker`.\n                var mergeMarker = factory.createMergeDeclarationMarker(statement);\n                ts.setEmitFlags(mergeMarker, 1536 /* NoComments */ | 4194304 /* HasEndOfDeclarationMarker */);\n                statements.push(mergeMarker);\n                return false;\n            }\n        }\n        /**\n         * Visits a module declaration node.\n         *\n         * This function will be called any time a TypeScript namespace (ModuleDeclaration) is encountered.\n         *\n         * @param node The module declaration node.\n         */\n        function visitModuleDeclaration(node) {\n            if (!shouldEmitModuleDeclaration(node)) {\n                return factory.createNotEmittedStatement(node);\n            }\n            ts.Debug.assertNode(node.name, ts.isIdentifier, \"A TypeScript namespace should have an Identifier name.\");\n            enableSubstitutionForNamespaceExports();\n            var statements = [];\n            // We request to be advised when the printer is about to print this node. This allows\n            // us to set up the correct state for later substitutions.\n            var emitFlags = 2 /* AdviseOnEmitNode */;\n            // If needed, we should emit a variable declaration for the module. If we emit\n            // a leading variable declaration, we should not emit leading comments for the\n            // module body.\n            var varAdded = addVarForEnumOrModuleDeclaration(statements, node);\n            if (varAdded) {\n                // We should still emit the comments if we are emitting a system module.\n                if (moduleKind !== ts.ModuleKind.System || currentLexicalScope !== currentSourceFile) {\n                    emitFlags |= 512 /* NoLeadingComments */;\n                }\n            }\n            // `parameterName` is the declaration name used inside of the namespace.\n            var parameterName = getNamespaceParameterName(node);\n            // `containerName` is the expression used inside of the namespace for exports.\n            var containerName = getNamespaceContainerName(node);\n            // `exportName` is the expression used within this node's container for any exported references.\n            var exportName = ts.hasSyntacticModifier(node, 1 /* Export */)\n                ? factory.getExternalModuleOrNamespaceExportName(currentNamespaceContainerName, node, /*allowComments*/ false, /*allowSourceMaps*/ true)\n                : factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true);\n            //  x || (x = {})\n            //  exports.x || (exports.x = {})\n            var moduleArg = factory.createLogicalOr(exportName, factory.createAssignment(exportName, factory.createObjectLiteralExpression()));\n            if (hasNamespaceQualifiedExportName(node)) {\n                // `localName` is the expression used within this node's containing scope for any local references.\n                var localName = factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true);\n                //  x = (exports.x || (exports.x = {}))\n                moduleArg = factory.createAssignment(localName, moduleArg);\n            }\n            //  (function (x_1) {\n            //      x_1.y = ...;\n            //  })(x || (x = {}));\n            var moduleStatement = factory.createExpressionStatement(factory.createCallExpression(factory.createFunctionExpression(\n            /*modifiers*/ undefined, \n            /*asteriskToken*/ undefined, \n            /*name*/ undefined, \n            /*typeParameters*/ undefined, [factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, parameterName)], \n            /*type*/ undefined, transformModuleBody(node, containerName)), \n            /*typeArguments*/ undefined, [moduleArg]));\n            ts.setOriginalNode(moduleStatement, node);\n            if (varAdded) {\n                // If a variable was added, synthetic comments are emitted on it, not on the moduleStatement.\n                ts.setSyntheticLeadingComments(moduleStatement, undefined);\n                ts.setSyntheticTrailingComments(moduleStatement, undefined);\n            }\n            ts.setTextRange(moduleStatement, node);\n            ts.addEmitFlags(moduleStatement, emitFlags);\n            statements.push(moduleStatement);\n            // Add a DeclarationMarker for the namespace to preserve trailing comments and mark\n            // the end of the declaration.\n            statements.push(factory.createEndOfDeclarationMarker(node));\n            return statements;\n        }\n        /**\n         * Transforms the body of a module declaration.\n         *\n         * @param node The module declaration node.\n         */\n        function transformModuleBody(node, namespaceLocalName) {\n            var savedCurrentNamespaceContainerName = currentNamespaceContainerName;\n            var savedCurrentNamespace = currentNamespace;\n            var savedCurrentScopeFirstDeclarationsOfName = currentScopeFirstDeclarationsOfName;\n            currentNamespaceContainerName = namespaceLocalName;\n            currentNamespace = node;\n            currentScopeFirstDeclarationsOfName = undefined;\n            var statements = [];\n            startLexicalEnvironment();\n            var statementsLocation;\n            var blockLocation;\n            if (node.body) {\n                if (node.body.kind === 257 /* ModuleBlock */) {\n                    saveStateAndInvoke(node.body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); });\n                    statementsLocation = node.body.statements;\n                    blockLocation = node.body;\n                }\n                else {\n                    var result = visitModuleDeclaration(node.body);\n                    if (result) {\n                        if (ts.isArray(result)) {\n                            ts.addRange(statements, result);\n                        }\n                        else {\n                            statements.push(result);\n                        }\n                    }\n                    var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body;\n                    statementsLocation = ts.moveRangePos(moduleBlock.statements, -1);\n                }\n            }\n            ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());\n            currentNamespaceContainerName = savedCurrentNamespaceContainerName;\n            currentNamespace = savedCurrentNamespace;\n            currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName;\n            var block = factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), \n            /*location*/ statementsLocation), \n            /*multiLine*/ true);\n            ts.setTextRange(block, blockLocation);\n            // namespace hello.hi.world {\n            //      function foo() {}\n            //\n            //      // TODO, blah\n            // }\n            //\n            // should be emitted as\n            //\n            // var hello;\n            // (function (hello) {\n            //     var hi;\n            //     (function (hi) {\n            //         var world;\n            //         (function (world) {\n            //             function foo() { }\n            //             // TODO, blah\n            //         })(world = hi.world || (hi.world = {}));\n            //     })(hi = hello.hi || (hello.hi = {}));\n            // })(hello || (hello = {}));\n            // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces.\n            if (!node.body || node.body.kind !== 257 /* ModuleBlock */) {\n                ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */);\n            }\n            return block;\n        }\n        function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) {\n            if (moduleDeclaration.body.kind === 256 /* ModuleDeclaration */) {\n                var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body);\n                return recursiveInnerModule || moduleDeclaration.body;\n            }\n        }\n        /**\n         * Visits an import declaration, eliding it if it is not referenced and `importsNotUsedAsValues` is not 'preserve'.\n         *\n         * @param node The import declaration node.\n         */\n        function visitImportDeclaration(node) {\n            if (!node.importClause) {\n                // Do not elide a side-effect only import declaration.\n                //  import \"foo\";\n                return node;\n            }\n            if (node.importClause.isTypeOnly) {\n                // Always elide type-only imports\n                return undefined;\n            }\n            // Elide the declaration if the import clause was elided.\n            var importClause = ts.visitNode(node.importClause, visitImportClause, ts.isImportClause);\n            return importClause ||\n                compilerOptions.importsNotUsedAsValues === 1 /* Preserve */ ||\n                compilerOptions.importsNotUsedAsValues === 2 /* Error */\n                ? factory.updateImportDeclaration(node, \n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, importClause, node.moduleSpecifier)\n                : undefined;\n        }\n        /**\n         * Visits an import clause, eliding it if it is not referenced.\n         *\n         * @param node The import clause node.\n         */\n        function visitImportClause(node) {\n            if (node.isTypeOnly) {\n                return undefined;\n            }\n            // Elide the import clause if we elide both its name and its named bindings.\n            var name = resolver.isReferencedAliasDeclaration(node) ? node.name : undefined;\n            var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings);\n            return (name || namedBindings) ? factory.updateImportClause(node, /*isTypeOnly*/ false, name, namedBindings) : undefined;\n        }\n        /**\n         * Visits named import bindings, eliding it if it is not referenced.\n         *\n         * @param node The named import bindings node.\n         */\n        function visitNamedImportBindings(node) {\n            if (node.kind === 263 /* NamespaceImport */) {\n                // Elide a namespace import if it is not referenced.\n                return resolver.isReferencedAliasDeclaration(node) ? node : undefined;\n            }\n            else {\n                // Elide named imports if all of its import specifiers are elided.\n                var elements = ts.visitNodes(node.elements, visitImportSpecifier, ts.isImportSpecifier);\n                return ts.some(elements) ? factory.updateNamedImports(node, elements) : undefined;\n            }\n        }\n        /**\n         * Visits an import specifier, eliding it if it is not referenced.\n         *\n         * @param node The import specifier node.\n         */\n        function visitImportSpecifier(node) {\n            // Elide an import specifier if it is not referenced.\n            return resolver.isReferencedAliasDeclaration(node) ? node : undefined;\n        }\n        /**\n         * Visits an export assignment, eliding it if it does not contain a clause that resolves\n         * to a value.\n         *\n         * @param node The export assignment node.\n         */\n        function visitExportAssignment(node) {\n            // Elide the export assignment if it does not reference a value.\n            return resolver.isValueAliasDeclaration(node)\n                ? ts.visitEachChild(node, visitor, context)\n                : undefined;\n        }\n        /**\n         * Visits an export declaration, eliding it if it does not contain a clause that resolves\n         * to a value.\n         *\n         * @param node The export declaration node.\n         */\n        function visitExportDeclaration(node) {\n            if (node.isTypeOnly) {\n                return undefined;\n            }\n            if (!node.exportClause || ts.isNamespaceExport(node.exportClause)) {\n                // never elide `export <whatever> from <whereever>` declarations -\n                // they should be kept for sideffects/untyped exports, even when the\n                // type checker doesn't know about any exports\n                return node;\n            }\n            if (!resolver.isValueAliasDeclaration(node)) {\n                // Elide the export declaration if it does not export a value.\n                return undefined;\n            }\n            // Elide the export declaration if all of its named exports are elided.\n            var exportClause = ts.visitNode(node.exportClause, visitNamedExportBindings, ts.isNamedExportBindings);\n            return exportClause\n                ? factory.updateExportDeclaration(node, \n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, node.isTypeOnly, exportClause, node.moduleSpecifier)\n                : undefined;\n        }\n        /**\n         * Visits named exports, eliding it if it does not contain an export specifier that\n         * resolves to a value.\n         *\n         * @param node The named exports node.\n         */\n        function visitNamedExports(node) {\n            // Elide the named exports if all of its export specifiers were elided.\n            var elements = ts.visitNodes(node.elements, visitExportSpecifier, ts.isExportSpecifier);\n            return ts.some(elements) ? factory.updateNamedExports(node, elements) : undefined;\n        }\n        function visitNamespaceExports(node) {\n            return factory.updateNamespaceExport(node, ts.visitNode(node.name, visitor, ts.isIdentifier));\n        }\n        function visitNamedExportBindings(node) {\n            return ts.isNamespaceExport(node) ? visitNamespaceExports(node) : visitNamedExports(node);\n        }\n        /**\n         * Visits an export specifier, eliding it if it does not resolve to a value.\n         *\n         * @param node The export specifier node.\n         */\n        function visitExportSpecifier(node) {\n            // Elide an export specifier if it does not reference a value.\n            return resolver.isValueAliasDeclaration(node) ? node : undefined;\n        }\n        /**\n         * Determines whether to emit an import equals declaration.\n         *\n         * @param node The import equals declaration node.\n         */\n        function shouldEmitImportEqualsDeclaration(node) {\n            // preserve old compiler's behavior: emit 'var' for import declaration (even if we do not consider them referenced) when\n            // - current file is not external module\n            // - import declaration is top level and target is value imported by entity name\n            return resolver.isReferencedAliasDeclaration(node)\n                || (!ts.isExternalModule(currentSourceFile)\n                    && resolver.isTopLevelValueImportEqualsWithEntityName(node));\n        }\n        /**\n         * Visits an import equals declaration.\n         *\n         * @param node The import equals declaration node.\n         */\n        function visitImportEqualsDeclaration(node) {\n            // Always elide type-only imports\n            if (node.isTypeOnly) {\n                return undefined;\n            }\n            if (ts.isExternalModuleImportEqualsDeclaration(node)) {\n                var isReferenced = resolver.isReferencedAliasDeclaration(node);\n                // If the alias is unreferenced but we want to keep the import, replace with 'import \"mod\"'.\n                if (!isReferenced && compilerOptions.importsNotUsedAsValues === 1 /* Preserve */) {\n                    return ts.setOriginalNode(ts.setTextRange(factory.createImportDeclaration(\n                    /*decorators*/ undefined, \n                    /*modifiers*/ undefined, \n                    /*importClause*/ undefined, node.moduleReference.expression), node), node);\n                }\n                return isReferenced ? ts.visitEachChild(node, visitor, context) : undefined;\n            }\n            if (!shouldEmitImportEqualsDeclaration(node)) {\n                return undefined;\n            }\n            var moduleReference = ts.createExpressionFromEntityName(factory, node.moduleReference);\n            ts.setEmitFlags(moduleReference, 1536 /* NoComments */ | 2048 /* NoNestedComments */);\n            if (isNamedExternalModuleExport(node) || !isExportOfNamespace(node)) {\n                //  export var ${name} = ${moduleReference};\n                //  var ${name} = ${moduleReference};\n                return ts.setOriginalNode(ts.setTextRange(factory.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), factory.createVariableDeclarationList([\n                    ts.setOriginalNode(factory.createVariableDeclaration(node.name, \n                    /*exclamationToken*/ undefined, \n                    /*type*/ undefined, moduleReference), node)\n                ])), node), node);\n            }\n            else {\n                // exports.${name} = ${moduleReference};\n                return ts.setOriginalNode(createNamespaceExport(node.name, moduleReference, node), node);\n            }\n        }\n        /**\n         * Gets a value indicating whether the node is exported from a namespace.\n         *\n         * @param node The node to test.\n         */\n        function isExportOfNamespace(node) {\n            return currentNamespace !== undefined && ts.hasSyntacticModifier(node, 1 /* Export */);\n        }\n        /**\n         * Gets a value indicating whether the node is exported from an external module.\n         *\n         * @param node The node to test.\n         */\n        function isExternalModuleExport(node) {\n            return currentNamespace === undefined && ts.hasSyntacticModifier(node, 1 /* Export */);\n        }\n        /**\n         * Gets a value indicating whether the node is a named export from an external module.\n         *\n         * @param node The node to test.\n         */\n        function isNamedExternalModuleExport(node) {\n            return isExternalModuleExport(node)\n                && !ts.hasSyntacticModifier(node, 512 /* Default */);\n        }\n        /**\n         * Gets a value indicating whether the node is the default export of an external module.\n         *\n         * @param node The node to test.\n         */\n        function isDefaultExternalModuleExport(node) {\n            return isExternalModuleExport(node)\n                && ts.hasSyntacticModifier(node, 512 /* Default */);\n        }\n        /**\n         * Creates a statement for the provided expression. This is used in calls to `map`.\n         */\n        function expressionToStatement(expression) {\n            return factory.createExpressionStatement(expression);\n        }\n        function addExportMemberAssignment(statements, node) {\n            var expression = factory.createAssignment(factory.getExternalModuleOrNamespaceExportName(currentNamespaceContainerName, node, /*allowComments*/ false, /*allowSourceMaps*/ true), factory.getLocalName(node));\n            ts.setSourceMapRange(expression, ts.createRange(node.name ? node.name.pos : node.pos, node.end));\n            var statement = factory.createExpressionStatement(expression);\n            ts.setSourceMapRange(statement, ts.createRange(-1, node.end));\n            statements.push(statement);\n        }\n        function createNamespaceExport(exportName, exportValue, location) {\n            return ts.setTextRange(factory.createExpressionStatement(factory.createAssignment(factory.getNamespaceMemberName(currentNamespaceContainerName, exportName, /*allowComments*/ false, /*allowSourceMaps*/ true), exportValue)), location);\n        }\n        function createNamespaceExportExpression(exportName, exportValue, location) {\n            return ts.setTextRange(factory.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(exportName), exportValue), location);\n        }\n        function getNamespaceMemberNameWithSourceMapsAndWithoutComments(name) {\n            return factory.getNamespaceMemberName(currentNamespaceContainerName, name, /*allowComments*/ false, /*allowSourceMaps*/ true);\n        }\n        /**\n         * Gets the declaration name used inside of a namespace or enum.\n         */\n        function getNamespaceParameterName(node) {\n            var name = factory.getGeneratedNameForNode(node);\n            ts.setSourceMapRange(name, node.name);\n            return name;\n        }\n        /**\n         * Gets the expression used to refer to a namespace or enum within the body\n         * of its declaration.\n         */\n        function getNamespaceContainerName(node) {\n            return factory.getGeneratedNameForNode(node);\n        }\n        /**\n         * Gets a local alias for a class declaration if it is a decorated class with an internal\n         * reference to the static side of the class. This is necessary to avoid issues with\n         * double-binding semantics for the class name.\n         */\n        function getClassAliasIfNeeded(node) {\n            if (resolver.getNodeCheckFlags(node) & 16777216 /* ClassWithConstructorReference */) {\n                enableSubstitutionForClassAliases();\n                var classAlias = factory.createUniqueName(node.name && !ts.isGeneratedIdentifier(node.name) ? ts.idText(node.name) : \"default\");\n                classAliases[ts.getOriginalNodeId(node)] = classAlias;\n                hoistVariableDeclaration(classAlias);\n                return classAlias;\n            }\n        }\n        function getClassPrototype(node) {\n            return factory.createPropertyAccessExpression(factory.getDeclarationName(node), \"prototype\");\n        }\n        function getClassMemberPrefix(node, member) {\n            return ts.hasSyntacticModifier(member, 32 /* Static */)\n                ? factory.getDeclarationName(node)\n                : getClassPrototype(node);\n        }\n        function enableSubstitutionForNonQualifiedEnumMembers() {\n            if ((enabledSubstitutions & 8 /* NonQualifiedEnumMembers */) === 0) {\n                enabledSubstitutions |= 8 /* NonQualifiedEnumMembers */;\n                context.enableSubstitution(78 /* Identifier */);\n            }\n        }\n        function enableSubstitutionForClassAliases() {\n            if ((enabledSubstitutions & 1 /* ClassAliases */) === 0) {\n                enabledSubstitutions |= 1 /* ClassAliases */;\n                // We need to enable substitutions for identifiers. This allows us to\n                // substitute class names inside of a class declaration.\n                context.enableSubstitution(78 /* Identifier */);\n                // Keep track of class aliases.\n                classAliases = [];\n            }\n        }\n        function enableSubstitutionForNamespaceExports() {\n            if ((enabledSubstitutions & 2 /* NamespaceExports */) === 0) {\n                enabledSubstitutions |= 2 /* NamespaceExports */;\n                // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to\n                // substitute the names of exported members of a namespace.\n                context.enableSubstitution(78 /* Identifier */);\n                context.enableSubstitution(289 /* ShorthandPropertyAssignment */);\n                // We need to be notified when entering and exiting namespaces.\n                context.enableEmitNotification(256 /* ModuleDeclaration */);\n            }\n        }\n        function isTransformedModuleDeclaration(node) {\n            return ts.getOriginalNode(node).kind === 256 /* ModuleDeclaration */;\n        }\n        function isTransformedEnumDeclaration(node) {\n            return ts.getOriginalNode(node).kind === 255 /* EnumDeclaration */;\n        }\n        /**\n         * Hook for node emit.\n         *\n         * @param hint A hint as to the intended usage of the node.\n         * @param node The node to emit.\n         * @param emit A callback used to emit the node in the printer.\n         */\n        function onEmitNode(hint, node, emitCallback) {\n            var savedApplicableSubstitutions = applicableSubstitutions;\n            var savedCurrentSourceFile = currentSourceFile;\n            if (ts.isSourceFile(node)) {\n                currentSourceFile = node;\n            }\n            if (enabledSubstitutions & 2 /* NamespaceExports */ && isTransformedModuleDeclaration(node)) {\n                applicableSubstitutions |= 2 /* NamespaceExports */;\n            }\n            if (enabledSubstitutions & 8 /* NonQualifiedEnumMembers */ && isTransformedEnumDeclaration(node)) {\n                applicableSubstitutions |= 8 /* NonQualifiedEnumMembers */;\n            }\n            previousOnEmitNode(hint, node, emitCallback);\n            applicableSubstitutions = savedApplicableSubstitutions;\n            currentSourceFile = savedCurrentSourceFile;\n        }\n        /**\n         * Hooks node substitutions.\n         *\n         * @param hint A hint as to the intended usage of the node.\n         * @param node The node to substitute.\n         */\n        function onSubstituteNode(hint, node) {\n            node = previousOnSubstituteNode(hint, node);\n            if (hint === 1 /* Expression */) {\n                return substituteExpression(node);\n            }\n            else if (ts.isShorthandPropertyAssignment(node)) {\n                return substituteShorthandPropertyAssignment(node);\n            }\n            return node;\n        }\n        function substituteShorthandPropertyAssignment(node) {\n            if (enabledSubstitutions & 2 /* NamespaceExports */) {\n                var name = node.name;\n                var exportedName = trySubstituteNamespaceExportedName(name);\n                if (exportedName) {\n                    // A shorthand property with an assignment initializer is probably part of a\n                    // destructuring assignment\n                    if (node.objectAssignmentInitializer) {\n                        var initializer = factory.createAssignment(exportedName, node.objectAssignmentInitializer);\n                        return ts.setTextRange(factory.createPropertyAssignment(name, initializer), node);\n                    }\n                    return ts.setTextRange(factory.createPropertyAssignment(name, exportedName), node);\n                }\n            }\n            return node;\n        }\n        function substituteExpression(node) {\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                    return substituteExpressionIdentifier(node);\n                case 201 /* PropertyAccessExpression */:\n                    return substitutePropertyAccessExpression(node);\n                case 202 /* ElementAccessExpression */:\n                    return substituteElementAccessExpression(node);\n            }\n            return node;\n        }\n        function substituteExpressionIdentifier(node) {\n            return trySubstituteClassAlias(node)\n                || trySubstituteNamespaceExportedName(node)\n                || node;\n        }\n        function trySubstituteClassAlias(node) {\n            if (enabledSubstitutions & 1 /* ClassAliases */) {\n                if (resolver.getNodeCheckFlags(node) & 33554432 /* ConstructorReferenceInClass */) {\n                    // Due to the emit for class decorators, any reference to the class from inside of the class body\n                    // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind\n                    // behavior of class names in ES6.\n                    // Also, when emitting statics for class expressions, we must substitute a class alias for\n                    // constructor references in static property initializers.\n                    var declaration = resolver.getReferencedValueDeclaration(node);\n                    if (declaration) {\n                        var classAlias = classAliases[declaration.id]; // TODO: GH#18217\n                        if (classAlias) {\n                            var clone_1 = factory.cloneNode(classAlias);\n                            ts.setSourceMapRange(clone_1, node);\n                            ts.setCommentRange(clone_1, node);\n                            return clone_1;\n                        }\n                    }\n                }\n            }\n            return undefined;\n        }\n        function trySubstituteNamespaceExportedName(node) {\n            // If this is explicitly a local name, do not substitute.\n            if (enabledSubstitutions & applicableSubstitutions && !ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) {\n                // If we are nested within a namespace declaration, we may need to qualifiy\n                // an identifier that is exported from a merged namespace.\n                var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false);\n                if (container && container.kind !== 297 /* SourceFile */) {\n                    var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 256 /* ModuleDeclaration */) ||\n                        (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 255 /* EnumDeclaration */);\n                    if (substitute) {\n                        return ts.setTextRange(factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(container), node), \n                        /*location*/ node);\n                    }\n                }\n            }\n            return undefined;\n        }\n        function substitutePropertyAccessExpression(node) {\n            return substituteConstantValue(node);\n        }\n        function substituteElementAccessExpression(node) {\n            return substituteConstantValue(node);\n        }\n        function substituteConstantValue(node) {\n            var constantValue = tryGetConstEnumValue(node);\n            if (constantValue !== undefined) {\n                // track the constant value on the node for the printer in needsDotDotForPropertyAccess\n                ts.setConstantValue(node, constantValue);\n                var substitute = typeof constantValue === \"string\" ? factory.createStringLiteral(constantValue) : factory.createNumericLiteral(constantValue);\n                if (!compilerOptions.removeComments) {\n                    var originalNode = ts.getOriginalNode(node, ts.isAccessExpression);\n                    var propertyName = ts.isPropertyAccessExpression(originalNode)\n                        ? ts.declarationNameToString(originalNode.name)\n                        : ts.getTextOfNode(originalNode.argumentExpression);\n                    ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, \" \" + propertyName + \" \");\n                }\n                return substitute;\n            }\n            return node;\n        }\n        function tryGetConstEnumValue(node) {\n            if (compilerOptions.isolatedModules) {\n                return undefined;\n            }\n            return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) ? resolver.getConstantValue(node) : undefined;\n        }\n    }\n    ts.transformTypeScript = transformTypeScript;\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    var ClassPropertySubstitutionFlags;\n    (function (ClassPropertySubstitutionFlags) {\n        /**\n         * Enables substitutions for class expressions with static fields\n         * which have initializers that reference the class name.\n         */\n        ClassPropertySubstitutionFlags[ClassPropertySubstitutionFlags[\"ClassAliases\"] = 1] = \"ClassAliases\";\n    })(ClassPropertySubstitutionFlags || (ClassPropertySubstitutionFlags = {}));\n    var PrivateIdentifierPlacement;\n    (function (PrivateIdentifierPlacement) {\n        PrivateIdentifierPlacement[PrivateIdentifierPlacement[\"InstanceField\"] = 0] = \"InstanceField\";\n    })(PrivateIdentifierPlacement || (PrivateIdentifierPlacement = {}));\n    /**\n     * Transforms ECMAScript Class Syntax.\n     * TypeScript parameter property syntax is transformed in the TypeScript transformer.\n     * For now, this transforms public field declarations using TypeScript class semantics,\n     * where declarations are elided and initializers are transformed as assignments in the constructor.\n     * When --useDefineForClassFields is on, this transforms to ECMAScript semantics, with Object.defineProperty.\n     */\n    function transformClassFields(context) {\n        var factory = context.factory, hoistVariableDeclaration = context.hoistVariableDeclaration, endLexicalEnvironment = context.endLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment;\n        var resolver = context.getEmitResolver();\n        var compilerOptions = context.getCompilerOptions();\n        var languageVersion = ts.getEmitScriptTarget(compilerOptions);\n        var shouldTransformPrivateFields = languageVersion < 99 /* ESNext */;\n        var previousOnSubstituteNode = context.onSubstituteNode;\n        context.onSubstituteNode = onSubstituteNode;\n        var enabledSubstitutions;\n        var classAliases;\n        /**\n         * Tracks what computed name expressions originating from elided names must be inlined\n         * at the next execution site, in document order\n         */\n        var pendingExpressions;\n        /**\n         * Tracks what computed name expression statements and static property initializers must be\n         * emitted at the next execution site, in document order (for decorated classes).\n         */\n        var pendingStatements;\n        var privateIdentifierEnvironmentStack = [];\n        var currentPrivateIdentifierEnvironment;\n        return ts.chainBundle(context, transformSourceFile);\n        function transformSourceFile(node) {\n            var options = context.getCompilerOptions();\n            if (node.isDeclarationFile\n                || options.useDefineForClassFields && options.target === 99 /* ESNext */) {\n                return node;\n            }\n            var visited = ts.visitEachChild(node, visitor, context);\n            ts.addEmitHelpers(visited, context.readEmitHelpers());\n            return visited;\n        }\n        function visitor(node) {\n            if (!(node.transformFlags & 4194304 /* ContainsClassFields */))\n                return node;\n            switch (node.kind) {\n                case 221 /* ClassExpression */:\n                case 252 /* ClassDeclaration */:\n                    return visitClassLike(node);\n                case 163 /* PropertyDeclaration */:\n                    return visitPropertyDeclaration(node);\n                case 232 /* VariableStatement */:\n                    return visitVariableStatement(node);\n                case 201 /* PropertyAccessExpression */:\n                    return visitPropertyAccessExpression(node);\n                case 214 /* PrefixUnaryExpression */:\n                    return visitPrefixUnaryExpression(node);\n                case 215 /* PostfixUnaryExpression */:\n                    return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false);\n                case 203 /* CallExpression */:\n                    return visitCallExpression(node);\n                case 216 /* BinaryExpression */:\n                    return visitBinaryExpression(node);\n                case 79 /* PrivateIdentifier */:\n                    return visitPrivateIdentifier(node);\n                case 233 /* ExpressionStatement */:\n                    return visitExpressionStatement(node);\n                case 237 /* ForStatement */:\n                    return visitForStatement(node);\n                case 205 /* TaggedTemplateExpression */:\n                    return visitTaggedTemplateExpression(node);\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitorDestructuringTarget(node) {\n            switch (node.kind) {\n                case 200 /* ObjectLiteralExpression */:\n                case 199 /* ArrayLiteralExpression */:\n                    return visitAssignmentPattern(node);\n                default:\n                    return visitor(node);\n            }\n        }\n        /**\n         * If we visit a private name, this means it is an undeclared private name.\n         * Replace it with an empty identifier to indicate a problem with the code.\n         */\n        function visitPrivateIdentifier(node) {\n            if (!shouldTransformPrivateFields) {\n                return node;\n            }\n            return ts.setOriginalNode(factory.createIdentifier(\"\"), node);\n        }\n        /**\n         * Visits the members of a class that has fields.\n         *\n         * @param node The node to visit.\n         */\n        function classElementVisitor(node) {\n            switch (node.kind) {\n                case 166 /* Constructor */:\n                    // Constructors for classes using class fields are transformed in\n                    // `visitClassDeclaration` or `visitClassExpression`.\n                    return undefined;\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                case 165 /* MethodDeclaration */:\n                    // Visit the name of the member (if it's a computed property name).\n                    return ts.visitEachChild(node, classElementVisitor, context);\n                case 163 /* PropertyDeclaration */:\n                    return visitPropertyDeclaration(node);\n                case 158 /* ComputedPropertyName */:\n                    return visitComputedPropertyName(node);\n                case 229 /* SemicolonClassElement */:\n                    return node;\n                default:\n                    return visitor(node);\n            }\n        }\n        function visitVariableStatement(node) {\n            var savedPendingStatements = pendingStatements;\n            pendingStatements = [];\n            var visitedNode = ts.visitEachChild(node, visitor, context);\n            var statement = ts.some(pendingStatements) ? __spreadArray([visitedNode], pendingStatements) :\n                visitedNode;\n            pendingStatements = savedPendingStatements;\n            return statement;\n        }\n        function visitComputedPropertyName(name) {\n            var node = ts.visitEachChild(name, visitor, context);\n            if (ts.some(pendingExpressions)) {\n                var expressions = pendingExpressions;\n                expressions.push(node.expression);\n                pendingExpressions = [];\n                node = factory.updateComputedPropertyName(node, factory.inlineExpressions(expressions));\n            }\n            return node;\n        }\n        function visitPropertyDeclaration(node) {\n            ts.Debug.assert(!ts.some(node.decorators));\n            if (!shouldTransformPrivateFields && ts.isPrivateIdentifier(node.name)) {\n                // Initializer is elided as the field is initialized in transformConstructor.\n                return factory.updatePropertyDeclaration(node, \n                /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, \n                /*questionOrExclamationToken*/ undefined, \n                /*type*/ undefined, \n                /*initializer*/ undefined);\n            }\n            // Create a temporary variable to store a computed property name (if necessary).\n            // If it's not inlineable, then we emit an expression after the class which assigns\n            // the property name to the temporary variable.\n            var expr = getPropertyNameExpressionIfNeeded(node.name, !!node.initializer || !!context.getCompilerOptions().useDefineForClassFields);\n            if (expr && !ts.isSimpleInlineableExpression(expr)) {\n                getPendingExpressions().push(expr);\n            }\n            return undefined;\n        }\n        function createPrivateIdentifierAccess(info, receiver) {\n            receiver = ts.visitNode(receiver, visitor, ts.isExpression);\n            switch (info.placement) {\n                case 0 /* InstanceField */:\n                    return context.getEmitHelperFactory().createClassPrivateFieldGetHelper(ts.nodeIsSynthesized(receiver) ? receiver : factory.cloneNode(receiver), info.weakMapName);\n                default: return ts.Debug.fail(\"Unexpected private identifier placement\");\n            }\n        }\n        function visitPropertyAccessExpression(node) {\n            if (shouldTransformPrivateFields && ts.isPrivateIdentifier(node.name)) {\n                var privateIdentifierInfo = accessPrivateIdentifier(node.name);\n                if (privateIdentifierInfo) {\n                    return ts.setOriginalNode(createPrivateIdentifierAccess(privateIdentifierInfo, node.expression), node);\n                }\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitPrefixUnaryExpression(node) {\n            if (shouldTransformPrivateFields && ts.isPrivateIdentifierPropertyAccessExpression(node.operand)) {\n                var operator = node.operator === 45 /* PlusPlusToken */ ?\n                    39 /* PlusToken */ : node.operator === 46 /* MinusMinusToken */ ?\n                    40 /* MinusToken */ : undefined;\n                var info = void 0;\n                if (operator && (info = accessPrivateIdentifier(node.operand.name))) {\n                    var receiver = ts.visitNode(node.operand.expression, visitor, ts.isExpression);\n                    var _a = createCopiableReceiverExpr(receiver), readExpression = _a.readExpression, initializeExpression = _a.initializeExpression;\n                    var existingValue = factory.createPrefixUnaryExpression(39 /* PlusToken */, createPrivateIdentifierAccess(info, readExpression));\n                    return ts.setOriginalNode(createPrivateIdentifierAssignment(info, initializeExpression || readExpression, factory.createBinaryExpression(existingValue, operator, factory.createNumericLiteral(1)), 62 /* EqualsToken */), node);\n                }\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitPostfixUnaryExpression(node, valueIsDiscarded) {\n            if (shouldTransformPrivateFields && ts.isPrivateIdentifierPropertyAccessExpression(node.operand)) {\n                var operator = node.operator === 45 /* PlusPlusToken */ ?\n                    39 /* PlusToken */ : node.operator === 46 /* MinusMinusToken */ ?\n                    40 /* MinusToken */ : undefined;\n                var info = void 0;\n                if (operator && (info = accessPrivateIdentifier(node.operand.name))) {\n                    var receiver = ts.visitNode(node.operand.expression, visitor, ts.isExpression);\n                    var _a = createCopiableReceiverExpr(receiver), readExpression = _a.readExpression, initializeExpression = _a.initializeExpression;\n                    var existingValue = factory.createPrefixUnaryExpression(39 /* PlusToken */, createPrivateIdentifierAccess(info, readExpression));\n                    // Create a temporary variable to store the value returned by the expression.\n                    var returnValue = valueIsDiscarded ? undefined : factory.createTempVariable(hoistVariableDeclaration);\n                    return ts.setOriginalNode(factory.inlineExpressions(ts.compact([\n                        createPrivateIdentifierAssignment(info, initializeExpression || readExpression, factory.createBinaryExpression(returnValue ? factory.createAssignment(returnValue, existingValue) : existingValue, operator, factory.createNumericLiteral(1)), 62 /* EqualsToken */),\n                        returnValue\n                    ])), node);\n                }\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitForStatement(node) {\n            if (node.incrementor && ts.isPostfixUnaryExpression(node.incrementor)) {\n                return factory.updateForStatement(node, ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), visitPostfixUnaryExpression(node.incrementor, /*valueIsDiscarded*/ true), ts.visitNode(node.statement, visitor, ts.isStatement));\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitExpressionStatement(node) {\n            if (ts.isPostfixUnaryExpression(node.expression)) {\n                return factory.updateExpressionStatement(node, visitPostfixUnaryExpression(node.expression, /*valueIsDiscarded*/ true));\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function createCopiableReceiverExpr(receiver) {\n            var clone = ts.nodeIsSynthesized(receiver) ? receiver : factory.cloneNode(receiver);\n            if (ts.isSimpleInlineableExpression(receiver)) {\n                return { readExpression: clone, initializeExpression: undefined };\n            }\n            var readExpression = factory.createTempVariable(hoistVariableDeclaration);\n            var initializeExpression = factory.createAssignment(readExpression, clone);\n            return { readExpression: readExpression, initializeExpression: initializeExpression };\n        }\n        function visitCallExpression(node) {\n            if (shouldTransformPrivateFields && ts.isPrivateIdentifierPropertyAccessExpression(node.expression)) {\n                // Transform call expressions of private names to properly bind the `this` parameter.\n                var _a = factory.createCallBinding(node.expression, hoistVariableDeclaration, languageVersion), thisArg = _a.thisArg, target = _a.target;\n                if (ts.isCallChain(node)) {\n                    return factory.updateCallChain(node, factory.createPropertyAccessChain(ts.visitNode(target, visitor), node.questionDotToken, \"call\"), \n                    /*questionDotToken*/ undefined, \n                    /*typeArguments*/ undefined, __spreadArray([ts.visitNode(thisArg, visitor, ts.isExpression)], ts.visitNodes(node.arguments, visitor, ts.isExpression)));\n                }\n                return factory.updateCallExpression(node, factory.createPropertyAccessExpression(ts.visitNode(target, visitor), \"call\"), \n                /*typeArguments*/ undefined, __spreadArray([ts.visitNode(thisArg, visitor, ts.isExpression)], ts.visitNodes(node.arguments, visitor, ts.isExpression)));\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitTaggedTemplateExpression(node) {\n            if (shouldTransformPrivateFields && ts.isPrivateIdentifierPropertyAccessExpression(node.tag)) {\n                // Bind the `this` correctly for tagged template literals when the tag is a private identifier property access.\n                var _a = factory.createCallBinding(node.tag, hoistVariableDeclaration, languageVersion), thisArg = _a.thisArg, target = _a.target;\n                return factory.updateTaggedTemplateExpression(node, factory.createCallExpression(factory.createPropertyAccessExpression(ts.visitNode(target, visitor), \"bind\"), \n                /*typeArguments*/ undefined, [ts.visitNode(thisArg, visitor, ts.isExpression)]), \n                /*typeArguments*/ undefined, ts.visitNode(node.template, visitor, ts.isTemplateLiteral));\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitBinaryExpression(node) {\n            if (shouldTransformPrivateFields) {\n                if (ts.isDestructuringAssignment(node)) {\n                    var savedPendingExpressions = pendingExpressions;\n                    pendingExpressions = undefined;\n                    node = factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorDestructuringTarget), node.operatorToken, ts.visitNode(node.right, visitor));\n                    var expr = ts.some(pendingExpressions) ?\n                        factory.inlineExpressions(ts.compact(__spreadArray(__spreadArray([], pendingExpressions), [node]))) :\n                        node;\n                    pendingExpressions = savedPendingExpressions;\n                    return expr;\n                }\n                if (ts.isAssignmentExpression(node) && ts.isPrivateIdentifierPropertyAccessExpression(node.left)) {\n                    var info = accessPrivateIdentifier(node.left.name);\n                    if (info) {\n                        return ts.setOriginalNode(createPrivateIdentifierAssignment(info, node.left.expression, node.right, node.operatorToken.kind), node);\n                    }\n                }\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function createPrivateIdentifierAssignment(info, receiver, right, operator) {\n            switch (info.placement) {\n                case 0 /* InstanceField */: {\n                    return createPrivateIdentifierInstanceFieldAssignment(info, receiver, right, operator);\n                }\n                default: return ts.Debug.fail(\"Unexpected private identifier placement\");\n            }\n        }\n        function createPrivateIdentifierInstanceFieldAssignment(info, receiver, right, operator) {\n            receiver = ts.visitNode(receiver, visitor, ts.isExpression);\n            right = ts.visitNode(right, visitor, ts.isExpression);\n            if (ts.isCompoundAssignment(operator)) {\n                var _a = createCopiableReceiverExpr(receiver), readExpression = _a.readExpression, initializeExpression = _a.initializeExpression;\n                return context.getEmitHelperFactory().createClassPrivateFieldSetHelper(initializeExpression || readExpression, info.weakMapName, factory.createBinaryExpression(context.getEmitHelperFactory().createClassPrivateFieldGetHelper(readExpression, info.weakMapName), ts.getNonAssignmentOperatorForCompoundAssignment(operator), right));\n            }\n            else {\n                return context.getEmitHelperFactory().createClassPrivateFieldSetHelper(receiver, info.weakMapName, right);\n            }\n        }\n        /**\n         * Set up the environment for a class.\n         */\n        function visitClassLike(node) {\n            var savedPendingExpressions = pendingExpressions;\n            pendingExpressions = undefined;\n            if (shouldTransformPrivateFields) {\n                startPrivateIdentifierEnvironment();\n            }\n            var result = ts.isClassDeclaration(node) ?\n                visitClassDeclaration(node) :\n                visitClassExpression(node);\n            if (shouldTransformPrivateFields) {\n                endPrivateIdentifierEnvironment();\n            }\n            pendingExpressions = savedPendingExpressions;\n            return result;\n        }\n        function doesClassElementNeedTransform(node) {\n            return ts.isPropertyDeclaration(node) || (shouldTransformPrivateFields && node.name && ts.isPrivateIdentifier(node.name));\n        }\n        function visitClassDeclaration(node) {\n            if (!ts.forEach(node.members, doesClassElementNeedTransform)) {\n                return ts.visitEachChild(node, visitor, context);\n            }\n            var extendsClauseElement = ts.getEffectiveBaseTypeNode(node);\n            var isDerivedClass = !!(extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 103 /* NullKeyword */);\n            var statements = [\n                factory.updateClassDeclaration(node, \n                /*decorators*/ undefined, node.modifiers, node.name, \n                /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, isDerivedClass))\n            ];\n            // Write any pending expressions from elided or moved computed property names\n            if (ts.some(pendingExpressions)) {\n                statements.push(factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions)));\n            }\n            // Emit static property assignment. Because classDeclaration is lexically evaluated,\n            // it is safe to emit static property assignment after classDeclaration\n            // From ES6 specification:\n            //      HasLexicalDeclaration (N) : Determines if the argument identifier has a binding in this environment record that was created using\n            //                                  a lexical declaration such as a LexicalDeclaration or a ClassDeclaration.\n            var staticProperties = ts.getProperties(node, /*requireInitializer*/ true, /*isStatic*/ true);\n            if (ts.some(staticProperties)) {\n                addPropertyStatements(statements, staticProperties, factory.getInternalName(node));\n            }\n            return statements;\n        }\n        function visitClassExpression(node) {\n            if (!ts.forEach(node.members, doesClassElementNeedTransform)) {\n                return ts.visitEachChild(node, visitor, context);\n            }\n            // If this class expression is a transformation of a decorated class declaration,\n            // then we want to output the pendingExpressions as statements, not as inlined\n            // expressions with the class statement.\n            //\n            // In this case, we use pendingStatements to produce the same output as the\n            // class declaration transformation. The VariableStatement visitor will insert\n            // these statements after the class expression variable statement.\n            var isDecoratedClassDeclaration = ts.isClassDeclaration(ts.getOriginalNode(node));\n            var staticProperties = ts.getProperties(node, /*requireInitializer*/ true, /*isStatic*/ true);\n            var extendsClauseElement = ts.getEffectiveBaseTypeNode(node);\n            var isDerivedClass = !!(extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 103 /* NullKeyword */);\n            var classExpression = factory.updateClassExpression(node, ts.visitNodes(node.decorators, visitor, ts.isDecorator), node.modifiers, node.name, \n            /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, isDerivedClass));\n            if (ts.some(staticProperties) || ts.some(pendingExpressions)) {\n                if (isDecoratedClassDeclaration) {\n                    ts.Debug.assertIsDefined(pendingStatements, \"Decorated classes transformed by TypeScript are expected to be within a variable declaration.\");\n                    // Write any pending expressions from elided or moved computed property names\n                    if (pendingStatements && pendingExpressions && ts.some(pendingExpressions)) {\n                        pendingStatements.push(factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions)));\n                    }\n                    if (pendingStatements && ts.some(staticProperties)) {\n                        addPropertyStatements(pendingStatements, staticProperties, factory.getInternalName(node));\n                    }\n                    return classExpression;\n                }\n                else {\n                    var expressions = [];\n                    var isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 16777216 /* ClassWithConstructorReference */;\n                    var temp = factory.createTempVariable(hoistVariableDeclaration, !!isClassWithConstructorReference);\n                    if (isClassWithConstructorReference) {\n                        // record an alias as the class name is not in scope for statics.\n                        enableSubstitutionForClassAliases();\n                        var alias = factory.cloneNode(temp);\n                        alias.autoGenerateFlags &= ~8 /* ReservedInNestedScopes */;\n                        classAliases[ts.getOriginalNodeId(node)] = alias;\n                    }\n                    // To preserve the behavior of the old emitter, we explicitly indent\n                    // the body of a class with static initializers.\n                    ts.setEmitFlags(classExpression, 65536 /* Indented */ | ts.getEmitFlags(classExpression));\n                    expressions.push(ts.startOnNewLine(factory.createAssignment(temp, classExpression)));\n                    // Add any pending expressions leftover from elided or relocated computed property names\n                    ts.addRange(expressions, ts.map(pendingExpressions, ts.startOnNewLine));\n                    ts.addRange(expressions, generateInitializedPropertyExpressions(staticProperties, temp));\n                    expressions.push(ts.startOnNewLine(temp));\n                    return factory.inlineExpressions(expressions);\n                }\n            }\n            return classExpression;\n        }\n        function transformClassMembers(node, isDerivedClass) {\n            if (shouldTransformPrivateFields) {\n                // Declare private names.\n                for (var _i = 0, _a = node.members; _i < _a.length; _i++) {\n                    var member = _a[_i];\n                    if (ts.isPrivateIdentifierPropertyDeclaration(member)) {\n                        addPrivateIdentifierToEnvironment(member.name);\n                    }\n                }\n            }\n            var members = [];\n            var constructor = transformConstructor(node, isDerivedClass);\n            if (constructor) {\n                members.push(constructor);\n            }\n            ts.addRange(members, ts.visitNodes(node.members, classElementVisitor, ts.isClassElement));\n            return ts.setTextRange(factory.createNodeArray(members), /*location*/ node.members);\n        }\n        function isPropertyDeclarationThatRequiresConstructorStatement(member) {\n            if (!ts.isPropertyDeclaration(member) || ts.hasStaticModifier(member) || ts.hasSyntacticModifier(ts.getOriginalNode(member), 128 /* Abstract */)) {\n                return false;\n            }\n            if (context.getCompilerOptions().useDefineForClassFields) {\n                // If we are using define semantics and targeting ESNext or higher,\n                // then we don't need to transform any class properties.\n                return languageVersion < 99 /* ESNext */;\n            }\n            return ts.isInitializedProperty(member) || shouldTransformPrivateFields && ts.isPrivateIdentifierPropertyDeclaration(member);\n        }\n        function transformConstructor(node, isDerivedClass) {\n            var constructor = ts.visitNode(ts.getFirstConstructorWithBody(node), visitor, ts.isConstructorDeclaration);\n            var properties = node.members.filter(isPropertyDeclarationThatRequiresConstructorStatement);\n            if (!ts.some(properties)) {\n                return constructor;\n            }\n            var parameters = ts.visitParameterList(constructor ? constructor.parameters : undefined, visitor, context);\n            var body = transformConstructorBody(node, constructor, isDerivedClass);\n            if (!body) {\n                return undefined;\n            }\n            return ts.startOnNewLine(ts.setOriginalNode(ts.setTextRange(factory.createConstructorDeclaration(\n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, parameters !== null && parameters !== void 0 ? parameters : [], body), constructor || node), constructor));\n        }\n        function transformConstructorBody(node, constructor, isDerivedClass) {\n            var useDefineForClassFields = context.getCompilerOptions().useDefineForClassFields;\n            var properties = ts.getProperties(node, /*requireInitializer*/ false, /*isStatic*/ false);\n            if (!useDefineForClassFields) {\n                properties = ts.filter(properties, function (property) { return !!property.initializer || ts.isPrivateIdentifier(property.name); });\n            }\n            // Only generate synthetic constructor when there are property initializers to move.\n            if (!constructor && !ts.some(properties)) {\n                return ts.visitFunctionBody(/*node*/ undefined, visitor, context);\n            }\n            resumeLexicalEnvironment();\n            var indexOfFirstStatement = 0;\n            var statements = [];\n            if (!constructor && isDerivedClass) {\n                // Add a synthetic `super` call:\n                //\n                //  super(...arguments);\n                //\n                statements.push(factory.createExpressionStatement(factory.createCallExpression(factory.createSuper(), \n                /*typeArguments*/ undefined, [factory.createSpreadElement(factory.createIdentifier(\"arguments\"))])));\n            }\n            if (constructor) {\n                indexOfFirstStatement = ts.addPrologueDirectivesAndInitialSuperCall(factory, constructor, statements, visitor);\n            }\n            // Add the property initializers. Transforms this:\n            //\n            //  public x = 1;\n            //\n            // Into this:\n            //\n            //  constructor() {\n            //      this.x = 1;\n            //  }\n            //\n            if (constructor === null || constructor === void 0 ? void 0 : constructor.body) {\n                var afterParameterProperties = ts.findIndex(constructor.body.statements, function (s) { return !ts.isParameterPropertyDeclaration(ts.getOriginalNode(s), constructor); }, indexOfFirstStatement);\n                if (afterParameterProperties === -1) {\n                    afterParameterProperties = constructor.body.statements.length;\n                }\n                if (afterParameterProperties > indexOfFirstStatement) {\n                    if (!useDefineForClassFields) {\n                        ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement, afterParameterProperties - indexOfFirstStatement));\n                    }\n                    indexOfFirstStatement = afterParameterProperties;\n                }\n            }\n            addPropertyStatements(statements, properties, factory.createThis());\n            // Add existing statements, skipping the initial super call.\n            if (constructor) {\n                ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement));\n            }\n            statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment());\n            return ts.setTextRange(factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), \n            /*location*/ constructor ? constructor.body.statements : node.members), \n            /*multiLine*/ true), \n            /*location*/ constructor ? constructor.body : undefined);\n        }\n        /**\n         * Generates assignment statements for property initializers.\n         *\n         * @param properties An array of property declarations to transform.\n         * @param receiver The receiver on which each property should be assigned.\n         */\n        function addPropertyStatements(statements, properties, receiver) {\n            for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) {\n                var property = properties_7[_i];\n                var expression = transformProperty(property, receiver);\n                if (!expression) {\n                    continue;\n                }\n                var statement = factory.createExpressionStatement(expression);\n                ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));\n                ts.setCommentRange(statement, property);\n                ts.setOriginalNode(statement, property);\n                statements.push(statement);\n            }\n        }\n        /**\n         * Generates assignment expressions for property initializers.\n         *\n         * @param properties An array of property declarations to transform.\n         * @param receiver The receiver on which each property should be assigned.\n         */\n        function generateInitializedPropertyExpressions(properties, receiver) {\n            var expressions = [];\n            for (var _i = 0, properties_8 = properties; _i < properties_8.length; _i++) {\n                var property = properties_8[_i];\n                var expression = transformProperty(property, receiver);\n                if (!expression) {\n                    continue;\n                }\n                ts.startOnNewLine(expression);\n                ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property));\n                ts.setCommentRange(expression, property);\n                ts.setOriginalNode(expression, property);\n                expressions.push(expression);\n            }\n            return expressions;\n        }\n        /**\n         * Transforms a property initializer into an assignment statement.\n         *\n         * @param property The property declaration.\n         * @param receiver The object receiving the property assignment.\n         */\n        function transformProperty(property, receiver) {\n            var _a;\n            // We generate a name here in order to reuse the value cached by the relocated computed name expression (which uses the same generated name)\n            var emitAssignment = !context.getCompilerOptions().useDefineForClassFields;\n            var propertyName = ts.isComputedPropertyName(property.name) && !ts.isSimpleInlineableExpression(property.name.expression)\n                ? factory.updateComputedPropertyName(property.name, factory.getGeneratedNameForNode(property.name))\n                : property.name;\n            if (shouldTransformPrivateFields && ts.isPrivateIdentifier(propertyName)) {\n                var privateIdentifierInfo = accessPrivateIdentifier(propertyName);\n                if (privateIdentifierInfo) {\n                    switch (privateIdentifierInfo.placement) {\n                        case 0 /* InstanceField */: {\n                            return createPrivateInstanceFieldInitializer(receiver, ts.visitNode(property.initializer, visitor, ts.isExpression), privateIdentifierInfo.weakMapName);\n                        }\n                    }\n                }\n                else {\n                    ts.Debug.fail(\"Undeclared private name for property declaration.\");\n                }\n            }\n            if (ts.isPrivateIdentifier(propertyName) && !property.initializer) {\n                return undefined;\n            }\n            if (ts.isPrivateIdentifier(propertyName) && !property.initializer) {\n                return undefined;\n            }\n            var propertyOriginalNode = ts.getOriginalNode(property);\n            if (ts.hasSyntacticModifier(propertyOriginalNode, 128 /* Abstract */)) {\n                return undefined;\n            }\n            var initializer = property.initializer || emitAssignment ? (_a = ts.visitNode(property.initializer, visitor, ts.isExpression)) !== null && _a !== void 0 ? _a : factory.createVoidZero()\n                : ts.isParameterPropertyDeclaration(propertyOriginalNode, propertyOriginalNode.parent) && ts.isIdentifier(propertyName) ? propertyName\n                    : factory.createVoidZero();\n            if (emitAssignment || ts.isPrivateIdentifier(propertyName)) {\n                var memberAccess = ts.createMemberAccessForPropertyName(factory, receiver, propertyName, /*location*/ propertyName);\n                return factory.createAssignment(memberAccess, initializer);\n            }\n            else {\n                var name = ts.isComputedPropertyName(propertyName) ? propertyName.expression\n                    : ts.isIdentifier(propertyName) ? factory.createStringLiteral(ts.unescapeLeadingUnderscores(propertyName.escapedText))\n                        : propertyName;\n                var descriptor = factory.createPropertyDescriptor({ value: initializer, configurable: true, writable: true, enumerable: true });\n                return factory.createObjectDefinePropertyCall(receiver, name, descriptor);\n            }\n        }\n        function enableSubstitutionForClassAliases() {\n            if ((enabledSubstitutions & 1 /* ClassAliases */) === 0) {\n                enabledSubstitutions |= 1 /* ClassAliases */;\n                // We need to enable substitutions for identifiers. This allows us to\n                // substitute class names inside of a class declaration.\n                context.enableSubstitution(78 /* Identifier */);\n                // Keep track of class aliases.\n                classAliases = [];\n            }\n        }\n        /**\n         * Hooks node substitutions.\n         *\n         * @param hint The context for the emitter.\n         * @param node The node to substitute.\n         */\n        function onSubstituteNode(hint, node) {\n            node = previousOnSubstituteNode(hint, node);\n            if (hint === 1 /* Expression */) {\n                return substituteExpression(node);\n            }\n            return node;\n        }\n        function substituteExpression(node) {\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                    return substituteExpressionIdentifier(node);\n            }\n            return node;\n        }\n        function substituteExpressionIdentifier(node) {\n            return trySubstituteClassAlias(node) || node;\n        }\n        function trySubstituteClassAlias(node) {\n            if (enabledSubstitutions & 1 /* ClassAliases */) {\n                if (resolver.getNodeCheckFlags(node) & 33554432 /* ConstructorReferenceInClass */) {\n                    // Due to the emit for class decorators, any reference to the class from inside of the class body\n                    // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind\n                    // behavior of class names in ES6.\n                    // Also, when emitting statics for class expressions, we must substitute a class alias for\n                    // constructor references in static property initializers.\n                    var declaration = resolver.getReferencedValueDeclaration(node);\n                    if (declaration) {\n                        var classAlias = classAliases[declaration.id]; // TODO: GH#18217\n                        if (classAlias) {\n                            var clone_2 = factory.cloneNode(classAlias);\n                            ts.setSourceMapRange(clone_2, node);\n                            ts.setCommentRange(clone_2, node);\n                            return clone_2;\n                        }\n                    }\n                }\n            }\n            return undefined;\n        }\n        /**\n         * If the name is a computed property, this function transforms it, then either returns an expression which caches the\n         * value of the result or the expression itself if the value is either unused or safe to inline into multiple locations\n         * @param shouldHoist Does the expression need to be reused? (ie, for an initializer or a decorator)\n         */\n        function getPropertyNameExpressionIfNeeded(name, shouldHoist) {\n            if (ts.isComputedPropertyName(name)) {\n                var expression = ts.visitNode(name.expression, visitor, ts.isExpression);\n                var innerExpression = ts.skipPartiallyEmittedExpressions(expression);\n                var inlinable = ts.isSimpleInlineableExpression(innerExpression);\n                var alreadyTransformed = ts.isAssignmentExpression(innerExpression) && ts.isGeneratedIdentifier(innerExpression.left);\n                if (!alreadyTransformed && !inlinable && shouldHoist) {\n                    var generatedName = factory.getGeneratedNameForNode(name);\n                    hoistVariableDeclaration(generatedName);\n                    return factory.createAssignment(generatedName, expression);\n                }\n                return (inlinable || ts.isIdentifier(innerExpression)) ? undefined : expression;\n            }\n        }\n        function startPrivateIdentifierEnvironment() {\n            privateIdentifierEnvironmentStack.push(currentPrivateIdentifierEnvironment);\n            currentPrivateIdentifierEnvironment = undefined;\n        }\n        function endPrivateIdentifierEnvironment() {\n            currentPrivateIdentifierEnvironment = privateIdentifierEnvironmentStack.pop();\n        }\n        function getPrivateIdentifierEnvironment() {\n            return currentPrivateIdentifierEnvironment || (currentPrivateIdentifierEnvironment = new ts.Map());\n        }\n        function getPendingExpressions() {\n            return pendingExpressions || (pendingExpressions = []);\n        }\n        function addPrivateIdentifierToEnvironment(name) {\n            var text = ts.getTextOfPropertyName(name);\n            var weakMapName = factory.createUniqueName(\"_\" + text.substring(1), 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */);\n            hoistVariableDeclaration(weakMapName);\n            getPrivateIdentifierEnvironment().set(name.escapedText, { placement: 0 /* InstanceField */, weakMapName: weakMapName });\n            getPendingExpressions().push(factory.createAssignment(weakMapName, factory.createNewExpression(factory.createIdentifier(\"WeakMap\"), \n            /*typeArguments*/ undefined, [])));\n        }\n        function accessPrivateIdentifier(name) {\n            if (currentPrivateIdentifierEnvironment) {\n                var info = currentPrivateIdentifierEnvironment.get(name.escapedText);\n                if (info) {\n                    return info;\n                }\n            }\n            for (var i = privateIdentifierEnvironmentStack.length - 1; i >= 0; --i) {\n                var env = privateIdentifierEnvironmentStack[i];\n                if (!env) {\n                    continue;\n                }\n                var info = env.get(name.escapedText);\n                if (info) {\n                    return info;\n                }\n            }\n            return undefined;\n        }\n        function wrapPrivateIdentifierForDestructuringTarget(node) {\n            var parameter = factory.getGeneratedNameForNode(node);\n            var info = accessPrivateIdentifier(node.name);\n            if (!info) {\n                return ts.visitEachChild(node, visitor, context);\n            }\n            var receiver = node.expression;\n            // We cannot copy `this` or `super` into the function because they will be bound\n            // differently inside the function.\n            if (ts.isThisProperty(node) || ts.isSuperProperty(node) || !ts.isSimpleCopiableExpression(node.expression)) {\n                receiver = factory.createTempVariable(hoistVariableDeclaration, /*reservedInNestedScopes*/ true);\n                getPendingExpressions().push(factory.createBinaryExpression(receiver, 62 /* EqualsToken */, node.expression));\n            }\n            return factory.createPropertyAccessExpression(\n            // Explicit parens required because of v8 regression (https://bugs.chromium.org/p/v8/issues/detail?id=9560)\n            factory.createParenthesizedExpression(factory.createObjectLiteralExpression([\n                factory.createSetAccessorDeclaration(\n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, \"value\", [factory.createParameterDeclaration(\n                    /*decorators*/ undefined, \n                    /*modifiers*/ undefined, \n                    /*dotDotDotToken*/ undefined, parameter, \n                    /*questionToken*/ undefined, \n                    /*type*/ undefined, \n                    /*initializer*/ undefined)], factory.createBlock([factory.createExpressionStatement(createPrivateIdentifierAssignment(info, receiver, parameter, 62 /* EqualsToken */))]))\n            ])), \"value\");\n        }\n        function visitArrayAssignmentTarget(node) {\n            var target = ts.getTargetOfBindingOrAssignmentElement(node);\n            if (target && ts.isPrivateIdentifierPropertyAccessExpression(target)) {\n                var wrapped = wrapPrivateIdentifierForDestructuringTarget(target);\n                if (ts.isAssignmentExpression(node)) {\n                    return factory.updateBinaryExpression(node, wrapped, node.operatorToken, ts.visitNode(node.right, visitor, ts.isExpression));\n                }\n                else if (ts.isSpreadElement(node)) {\n                    return factory.updateSpreadElement(node, wrapped);\n                }\n                else {\n                    return wrapped;\n                }\n            }\n            return ts.visitNode(node, visitorDestructuringTarget);\n        }\n        function visitObjectAssignmentTarget(node) {\n            if (ts.isPropertyAssignment(node)) {\n                var target = ts.getTargetOfBindingOrAssignmentElement(node);\n                if (target && ts.isPrivateIdentifierPropertyAccessExpression(target)) {\n                    var initializer = ts.getInitializerOfBindingOrAssignmentElement(node);\n                    var wrapped = wrapPrivateIdentifierForDestructuringTarget(target);\n                    return factory.updatePropertyAssignment(node, ts.visitNode(node.name, visitor), initializer ? factory.createAssignment(wrapped, ts.visitNode(initializer, visitor)) : wrapped);\n                }\n                return factory.updatePropertyAssignment(node, ts.visitNode(node.name, visitor), ts.visitNode(node.initializer, visitorDestructuringTarget));\n            }\n            return ts.visitNode(node, visitor);\n        }\n        function visitAssignmentPattern(node) {\n            if (ts.isArrayLiteralExpression(node)) {\n                // Transforms private names in destructuring assignment array bindings.\n                //\n                // Source:\n                // ([ this.#myProp ] = [ \"hello\" ]);\n                //\n                // Transformation:\n                // [ { set value(x) { this.#myProp = x; } }.value ] = [ \"hello\" ];\n                return factory.updateArrayLiteralExpression(node, ts.visitNodes(node.elements, visitArrayAssignmentTarget, ts.isExpression));\n            }\n            else {\n                // Transforms private names in destructuring assignment object bindings.\n                //\n                // Source:\n                // ({ stringProperty: this.#myProp } = { stringProperty: \"hello\" });\n                //\n                // Transformation:\n                // ({ stringProperty: { set value(x) { this.#myProp = x; } }.value }) = { stringProperty: \"hello\" };\n                return factory.updateObjectLiteralExpression(node, ts.visitNodes(node.properties, visitObjectAssignmentTarget, ts.isObjectLiteralElementLike));\n            }\n        }\n    }\n    ts.transformClassFields = transformClassFields;\n    function createPrivateInstanceFieldInitializer(receiver, initializer, weakMapName) {\n        return ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression(weakMapName, \"set\"), \n        /*typeArguments*/ undefined, [receiver, initializer || ts.factory.createVoidZero()]);\n    }\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    var ES2017SubstitutionFlags;\n    (function (ES2017SubstitutionFlags) {\n        /** Enables substitutions for async methods with `super` calls. */\n        ES2017SubstitutionFlags[ES2017SubstitutionFlags[\"AsyncMethodsWithSuper\"] = 1] = \"AsyncMethodsWithSuper\";\n    })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {}));\n    var ContextFlags;\n    (function (ContextFlags) {\n        ContextFlags[ContextFlags[\"NonTopLevel\"] = 1] = \"NonTopLevel\";\n        ContextFlags[ContextFlags[\"HasLexicalThis\"] = 2] = \"HasLexicalThis\";\n    })(ContextFlags || (ContextFlags = {}));\n    function transformES2017(context) {\n        var factory = context.factory, emitHelpers = context.getEmitHelperFactory, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration;\n        var resolver = context.getEmitResolver();\n        var compilerOptions = context.getCompilerOptions();\n        var languageVersion = ts.getEmitScriptTarget(compilerOptions);\n        /**\n         * Keeps track of whether expression substitution has been enabled for specific edge cases.\n         * They are persisted between each SourceFile transformation and should not be reset.\n         */\n        var enabledSubstitutions;\n        /**\n         * This keeps track of containers where `super` is valid, for use with\n         * just-in-time substitution for `super` expressions inside of async methods.\n         */\n        var enclosingSuperContainerFlags = 0;\n        var enclosingFunctionParameterNames;\n        /**\n         * Keeps track of property names accessed on super (`super.x`) within async functions.\n         */\n        var capturedSuperProperties;\n        /** Whether the async function contains an element access on super (`super[x]`). */\n        var hasSuperElementAccess;\n        /** A set of node IDs for generated super accessors (variable statements). */\n        var substitutedSuperAccessors = [];\n        var contextFlags = 0;\n        // Save the previous transformation hooks.\n        var previousOnEmitNode = context.onEmitNode;\n        var previousOnSubstituteNode = context.onSubstituteNode;\n        // Set new transformation hooks.\n        context.onEmitNode = onEmitNode;\n        context.onSubstituteNode = onSubstituteNode;\n        return ts.chainBundle(context, transformSourceFile);\n        function transformSourceFile(node) {\n            if (node.isDeclarationFile) {\n                return node;\n            }\n            setContextFlag(1 /* NonTopLevel */, false);\n            setContextFlag(2 /* HasLexicalThis */, !ts.isEffectiveStrictModeSourceFile(node, compilerOptions));\n            var visited = ts.visitEachChild(node, visitor, context);\n            ts.addEmitHelpers(visited, context.readEmitHelpers());\n            return visited;\n        }\n        function setContextFlag(flag, val) {\n            contextFlags = val ? contextFlags | flag : contextFlags & ~flag;\n        }\n        function inContext(flags) {\n            return (contextFlags & flags) !== 0;\n        }\n        function inTopLevelContext() {\n            return !inContext(1 /* NonTopLevel */);\n        }\n        function inHasLexicalThisContext() {\n            return inContext(2 /* HasLexicalThis */);\n        }\n        function doWithContext(flags, cb, value) {\n            var contextFlagsToSet = flags & ~contextFlags;\n            if (contextFlagsToSet) {\n                setContextFlag(contextFlagsToSet, /*val*/ true);\n                var result = cb(value);\n                setContextFlag(contextFlagsToSet, /*val*/ false);\n                return result;\n            }\n            return cb(value);\n        }\n        function visitDefault(node) {\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitor(node) {\n            if ((node.transformFlags & 64 /* ContainsES2017 */) === 0) {\n                return node;\n            }\n            switch (node.kind) {\n                case 129 /* AsyncKeyword */:\n                    // ES2017 async modifier should be elided for targets < ES2017\n                    return undefined;\n                case 213 /* AwaitExpression */:\n                    return visitAwaitExpression(node);\n                case 165 /* MethodDeclaration */:\n                    return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node);\n                case 251 /* FunctionDeclaration */:\n                    return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node);\n                case 208 /* FunctionExpression */:\n                    return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node);\n                case 209 /* ArrowFunction */:\n                    return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node);\n                case 201 /* PropertyAccessExpression */:\n                    if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 105 /* SuperKeyword */) {\n                        capturedSuperProperties.add(node.name.escapedText);\n                    }\n                    return ts.visitEachChild(node, visitor, context);\n                case 202 /* ElementAccessExpression */:\n                    if (capturedSuperProperties && node.expression.kind === 105 /* SuperKeyword */) {\n                        hasSuperElementAccess = true;\n                    }\n                    return ts.visitEachChild(node, visitor, context);\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                case 166 /* Constructor */:\n                case 252 /* ClassDeclaration */:\n                case 221 /* ClassExpression */:\n                    return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node);\n                default:\n                    return ts.visitEachChild(node, visitor, context);\n            }\n        }\n        function asyncBodyVisitor(node) {\n            if (ts.isNodeWithPossibleHoistedDeclaration(node)) {\n                switch (node.kind) {\n                    case 232 /* VariableStatement */:\n                        return visitVariableStatementInAsyncBody(node);\n                    case 237 /* ForStatement */:\n                        return visitForStatementInAsyncBody(node);\n                    case 238 /* ForInStatement */:\n                        return visitForInStatementInAsyncBody(node);\n                    case 239 /* ForOfStatement */:\n                        return visitForOfStatementInAsyncBody(node);\n                    case 287 /* CatchClause */:\n                        return visitCatchClauseInAsyncBody(node);\n                    case 230 /* Block */:\n                    case 244 /* SwitchStatement */:\n                    case 258 /* CaseBlock */:\n                    case 284 /* CaseClause */:\n                    case 285 /* DefaultClause */:\n                    case 247 /* TryStatement */:\n                    case 235 /* DoStatement */:\n                    case 236 /* WhileStatement */:\n                    case 234 /* IfStatement */:\n                    case 243 /* WithStatement */:\n                    case 245 /* LabeledStatement */:\n                        return ts.visitEachChild(node, asyncBodyVisitor, context);\n                    default:\n                        return ts.Debug.assertNever(node, \"Unhandled node.\");\n                }\n            }\n            return visitor(node);\n        }\n        function visitCatchClauseInAsyncBody(node) {\n            var catchClauseNames = new ts.Set();\n            recordDeclarationName(node.variableDeclaration, catchClauseNames); // TODO: GH#18217\n            // names declared in a catch variable are block scoped\n            var catchClauseUnshadowedNames;\n            catchClauseNames.forEach(function (_, escapedName) {\n                if (enclosingFunctionParameterNames.has(escapedName)) {\n                    if (!catchClauseUnshadowedNames) {\n                        catchClauseUnshadowedNames = new ts.Set(enclosingFunctionParameterNames);\n                    }\n                    catchClauseUnshadowedNames.delete(escapedName);\n                }\n            });\n            if (catchClauseUnshadowedNames) {\n                var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;\n                enclosingFunctionParameterNames = catchClauseUnshadowedNames;\n                var result = ts.visitEachChild(node, asyncBodyVisitor, context);\n                enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames;\n                return result;\n            }\n            else {\n                return ts.visitEachChild(node, asyncBodyVisitor, context);\n            }\n        }\n        function visitVariableStatementInAsyncBody(node) {\n            if (isVariableDeclarationListWithCollidingName(node.declarationList)) {\n                var expression = visitVariableDeclarationListWithCollidingNames(node.declarationList, /*hasReceiver*/ false);\n                return expression ? factory.createExpressionStatement(expression) : undefined;\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitForInStatementInAsyncBody(node) {\n            return factory.updateForInStatement(node, isVariableDeclarationListWithCollidingName(node.initializer)\n                ? visitVariableDeclarationListWithCollidingNames(node.initializer, /*hasReceiver*/ true)\n                : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, factory.liftToBlock));\n        }\n        function visitForOfStatementInAsyncBody(node) {\n            return factory.updateForOfStatement(node, ts.visitNode(node.awaitModifier, visitor, ts.isToken), isVariableDeclarationListWithCollidingName(node.initializer)\n                ? visitVariableDeclarationListWithCollidingNames(node.initializer, /*hasReceiver*/ true)\n                : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, factory.liftToBlock));\n        }\n        function visitForStatementInAsyncBody(node) {\n            var initializer = node.initializer; // TODO: GH#18217\n            return factory.updateForStatement(node, isVariableDeclarationListWithCollidingName(initializer)\n                ? visitVariableDeclarationListWithCollidingNames(initializer, /*hasReceiver*/ false)\n                : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, factory.liftToBlock));\n        }\n        /**\n         * Visits an AwaitExpression node.\n         *\n         * This function will be called any time a ES2017 await expression is encountered.\n         *\n         * @param node The node to visit.\n         */\n        function visitAwaitExpression(node) {\n            // do not downlevel a top-level await as it is module syntax...\n            if (inTopLevelContext()) {\n                return ts.visitEachChild(node, visitor, context);\n            }\n            return ts.setOriginalNode(ts.setTextRange(factory.createYieldExpression(\n            /*asteriskToken*/ undefined, ts.visitNode(node.expression, visitor, ts.isExpression)), node), node);\n        }\n        /**\n         * Visits a MethodDeclaration node.\n         *\n         * This function will be called when one of the following conditions are met:\n         * - The node is marked as async\n         *\n         * @param node The node to visit.\n         */\n        function visitMethodDeclaration(node) {\n            return factory.updateMethodDeclaration(node, \n            /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, \n            /*questionToken*/ undefined, \n            /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), \n            /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* Async */\n                ? transformAsyncFunctionBody(node)\n                : ts.visitFunctionBody(node.body, visitor, context));\n        }\n        /**\n         * Visits a FunctionDeclaration node.\n         *\n         * This function will be called when one of the following conditions are met:\n         * - The node is marked async\n         *\n         * @param node The node to visit.\n         */\n        function visitFunctionDeclaration(node) {\n            return factory.updateFunctionDeclaration(node, \n            /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, \n            /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), \n            /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* Async */\n                ? transformAsyncFunctionBody(node)\n                : ts.visitFunctionBody(node.body, visitor, context));\n        }\n        /**\n         * Visits a FunctionExpression node.\n         *\n         * This function will be called when one of the following conditions are met:\n         * - The node is marked async\n         *\n         * @param node The node to visit.\n         */\n        function visitFunctionExpression(node) {\n            return factory.updateFunctionExpression(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name, \n            /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), \n            /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* Async */\n                ? transformAsyncFunctionBody(node)\n                : ts.visitFunctionBody(node.body, visitor, context));\n        }\n        /**\n         * Visits an ArrowFunction.\n         *\n         * This function will be called when one of the following conditions are met:\n         * - The node is marked async\n         *\n         * @param node The node to visit.\n         */\n        function visitArrowFunction(node) {\n            return factory.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), \n            /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), \n            /*type*/ undefined, node.equalsGreaterThanToken, ts.getFunctionFlags(node) & 2 /* Async */\n                ? transformAsyncFunctionBody(node)\n                : ts.visitFunctionBody(node.body, visitor, context));\n        }\n        function recordDeclarationName(_a, names) {\n            var name = _a.name;\n            if (ts.isIdentifier(name)) {\n                names.add(name.escapedText);\n            }\n            else {\n                for (var _i = 0, _b = name.elements; _i < _b.length; _i++) {\n                    var element = _b[_i];\n                    if (!ts.isOmittedExpression(element)) {\n                        recordDeclarationName(element, names);\n                    }\n                }\n            }\n        }\n        function isVariableDeclarationListWithCollidingName(node) {\n            return !!node\n                && ts.isVariableDeclarationList(node)\n                && !(node.flags & 3 /* BlockScoped */)\n                && node.declarations.some(collidesWithParameterName);\n        }\n        function visitVariableDeclarationListWithCollidingNames(node, hasReceiver) {\n            hoistVariableDeclarationList(node);\n            var variables = ts.getInitializedVariables(node);\n            if (variables.length === 0) {\n                if (hasReceiver) {\n                    return ts.visitNode(factory.converters.convertToAssignmentElementTarget(node.declarations[0].name), visitor, ts.isExpression);\n                }\n                return undefined;\n            }\n            return factory.inlineExpressions(ts.map(variables, transformInitializedVariable));\n        }\n        function hoistVariableDeclarationList(node) {\n            ts.forEach(node.declarations, hoistVariable);\n        }\n        function hoistVariable(_a) {\n            var name = _a.name;\n            if (ts.isIdentifier(name)) {\n                hoistVariableDeclaration(name);\n            }\n            else {\n                for (var _i = 0, _b = name.elements; _i < _b.length; _i++) {\n                    var element = _b[_i];\n                    if (!ts.isOmittedExpression(element)) {\n                        hoistVariable(element);\n                    }\n                }\n            }\n        }\n        function transformInitializedVariable(node) {\n            var converted = ts.setSourceMapRange(factory.createAssignment(factory.converters.convertToAssignmentElementTarget(node.name), node.initializer), node);\n            return ts.visitNode(converted, visitor, ts.isExpression);\n        }\n        function collidesWithParameterName(_a) {\n            var name = _a.name;\n            if (ts.isIdentifier(name)) {\n                return enclosingFunctionParameterNames.has(name.escapedText);\n            }\n            else {\n                for (var _i = 0, _b = name.elements; _i < _b.length; _i++) {\n                    var element = _b[_i];\n                    if (!ts.isOmittedExpression(element) && collidesWithParameterName(element)) {\n                        return true;\n                    }\n                }\n            }\n            return false;\n        }\n        function transformAsyncFunctionBody(node) {\n            resumeLexicalEnvironment();\n            var original = ts.getOriginalNode(node, ts.isFunctionLike);\n            var nodeType = original.type;\n            var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined;\n            var isArrowFunction = node.kind === 209 /* ArrowFunction */;\n            var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0;\n            // An async function is emit as an outer function that calls an inner\n            // generator function. To preserve lexical bindings, we pass the current\n            // `this` and `arguments` objects to `__awaiter`. The generator function\n            // passed to `__awaiter` is executed inside of the callback to the\n            // promise constructor.\n            var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;\n            enclosingFunctionParameterNames = new ts.Set();\n            for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {\n                var parameter = _a[_i];\n                recordDeclarationName(parameter, enclosingFunctionParameterNames);\n            }\n            var savedCapturedSuperProperties = capturedSuperProperties;\n            var savedHasSuperElementAccess = hasSuperElementAccess;\n            if (!isArrowFunction) {\n                capturedSuperProperties = new ts.Set();\n                hasSuperElementAccess = false;\n            }\n            var result;\n            if (!isArrowFunction) {\n                var statements = [];\n                var statementOffset = factory.copyPrologue(node.body.statements, statements, /*ensureUseStrict*/ false, visitor);\n                statements.push(factory.createReturnStatement(emitHelpers().createAwaiterHelper(inHasLexicalThisContext(), hasLexicalArguments, promiseConstructor, transformAsyncFunctionBodyWorker(node.body, statementOffset))));\n                ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());\n                // Minor optimization, emit `_super` helper to capture `super` access in an arrow.\n                // This step isn't needed if we eventually transform this to ES5.\n                var emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* AsyncMethodWithSuperBinding */ | 2048 /* AsyncMethodWithSuper */);\n                if (emitSuperHelpers) {\n                    enableSubstitutionForAsyncMethodsWithSuper();\n                    if (capturedSuperProperties.size) {\n                        var variableStatement = createSuperAccessVariableStatement(factory, resolver, node, capturedSuperProperties);\n                        substitutedSuperAccessors[ts.getNodeId(variableStatement)] = true;\n                        ts.insertStatementsAfterStandardPrologue(statements, [variableStatement]);\n                    }\n                }\n                var block = factory.createBlock(statements, /*multiLine*/ true);\n                ts.setTextRange(block, node.body);\n                if (emitSuperHelpers && hasSuperElementAccess) {\n                    // Emit helpers for super element access expressions (`super[x]`).\n                    if (resolver.getNodeCheckFlags(node) & 4096 /* AsyncMethodWithSuperBinding */) {\n                        ts.addEmitHelper(block, ts.advancedAsyncSuperHelper);\n                    }\n                    else if (resolver.getNodeCheckFlags(node) & 2048 /* AsyncMethodWithSuper */) {\n                        ts.addEmitHelper(block, ts.asyncSuperHelper);\n                    }\n                }\n                result = block;\n            }\n            else {\n                var expression = emitHelpers().createAwaiterHelper(inHasLexicalThisContext(), hasLexicalArguments, promiseConstructor, transformAsyncFunctionBodyWorker(node.body));\n                var declarations = endLexicalEnvironment();\n                if (ts.some(declarations)) {\n                    var block = factory.converters.convertToFunctionBlock(expression);\n                    result = factory.updateBlock(block, ts.setTextRange(factory.createNodeArray(ts.concatenate(declarations, block.statements)), block.statements));\n                }\n                else {\n                    result = expression;\n                }\n            }\n            enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames;\n            if (!isArrowFunction) {\n                capturedSuperProperties = savedCapturedSuperProperties;\n                hasSuperElementAccess = savedHasSuperElementAccess;\n            }\n            return result;\n        }\n        function transformAsyncFunctionBodyWorker(body, start) {\n            if (ts.isBlock(body)) {\n                return factory.updateBlock(body, ts.visitNodes(body.statements, asyncBodyVisitor, ts.isStatement, start));\n            }\n            else {\n                return factory.converters.convertToFunctionBlock(ts.visitNode(body, asyncBodyVisitor, ts.isConciseBody));\n            }\n        }\n        function getPromiseConstructor(type) {\n            var typeName = type && ts.getEntityNameFromTypeNode(type);\n            if (typeName && ts.isEntityName(typeName)) {\n                var serializationKind = resolver.getTypeReferenceSerializationKind(typeName);\n                if (serializationKind === ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue\n                    || serializationKind === ts.TypeReferenceSerializationKind.Unknown) {\n                    return typeName;\n                }\n            }\n            return undefined;\n        }\n        function enableSubstitutionForAsyncMethodsWithSuper() {\n            if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) {\n                enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */;\n                // We need to enable substitutions for call, property access, and element access\n                // if we need to rewrite super calls.\n                context.enableSubstitution(203 /* CallExpression */);\n                context.enableSubstitution(201 /* PropertyAccessExpression */);\n                context.enableSubstitution(202 /* ElementAccessExpression */);\n                // We need to be notified when entering and exiting declarations that bind super.\n                context.enableEmitNotification(252 /* ClassDeclaration */);\n                context.enableEmitNotification(165 /* MethodDeclaration */);\n                context.enableEmitNotification(167 /* GetAccessor */);\n                context.enableEmitNotification(168 /* SetAccessor */);\n                context.enableEmitNotification(166 /* Constructor */);\n                // We need to be notified when entering the generated accessor arrow functions.\n                context.enableEmitNotification(232 /* VariableStatement */);\n            }\n        }\n        /**\n         * Hook for node emit.\n         *\n         * @param hint A hint as to the intended usage of the node.\n         * @param node The node to emit.\n         * @param emit A callback used to emit the node in the printer.\n         */\n        function onEmitNode(hint, node, emitCallback) {\n            // If we need to support substitutions for `super` in an async method,\n            // we should track it here.\n            if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {\n                var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* AsyncMethodWithSuper */ | 4096 /* AsyncMethodWithSuperBinding */);\n                if (superContainerFlags !== enclosingSuperContainerFlags) {\n                    var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;\n                    enclosingSuperContainerFlags = superContainerFlags;\n                    previousOnEmitNode(hint, node, emitCallback);\n                    enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags;\n                    return;\n                }\n            }\n            // Disable substitution in the generated super accessor itself.\n            else if (enabledSubstitutions && substitutedSuperAccessors[ts.getNodeId(node)]) {\n                var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;\n                enclosingSuperContainerFlags = 0;\n                previousOnEmitNode(hint, node, emitCallback);\n                enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags;\n                return;\n            }\n            previousOnEmitNode(hint, node, emitCallback);\n        }\n        /**\n         * Hooks node substitutions.\n         *\n         * @param hint A hint as to the intended usage of the node.\n         * @param node The node to substitute.\n         */\n        function onSubstituteNode(hint, node) {\n            node = previousOnSubstituteNode(hint, node);\n            if (hint === 1 /* Expression */ && enclosingSuperContainerFlags) {\n                return substituteExpression(node);\n            }\n            return node;\n        }\n        function substituteExpression(node) {\n            switch (node.kind) {\n                case 201 /* PropertyAccessExpression */:\n                    return substitutePropertyAccessExpression(node);\n                case 202 /* ElementAccessExpression */:\n                    return substituteElementAccessExpression(node);\n                case 203 /* CallExpression */:\n                    return substituteCallExpression(node);\n            }\n            return node;\n        }\n        function substitutePropertyAccessExpression(node) {\n            if (node.expression.kind === 105 /* SuperKeyword */) {\n                return ts.setTextRange(factory.createPropertyAccessExpression(factory.createUniqueName(\"_super\", 16 /* Optimistic */ | 32 /* FileLevel */), node.name), node);\n            }\n            return node;\n        }\n        function substituteElementAccessExpression(node) {\n            if (node.expression.kind === 105 /* SuperKeyword */) {\n                return createSuperElementAccessInAsyncMethod(node.argumentExpression, node);\n            }\n            return node;\n        }\n        function substituteCallExpression(node) {\n            var expression = node.expression;\n            if (ts.isSuperProperty(expression)) {\n                var argumentExpression = ts.isPropertyAccessExpression(expression)\n                    ? substitutePropertyAccessExpression(expression)\n                    : substituteElementAccessExpression(expression);\n                return factory.createCallExpression(factory.createPropertyAccessExpression(argumentExpression, \"call\"), \n                /*typeArguments*/ undefined, __spreadArray([\n                    factory.createThis()\n                ], node.arguments));\n            }\n            return node;\n        }\n        function isSuperContainer(node) {\n            var kind = node.kind;\n            return kind === 252 /* ClassDeclaration */\n                || kind === 166 /* Constructor */\n                || kind === 165 /* MethodDeclaration */\n                || kind === 167 /* GetAccessor */\n                || kind === 168 /* SetAccessor */;\n        }\n        function createSuperElementAccessInAsyncMethod(argumentExpression, location) {\n            if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) {\n                return ts.setTextRange(factory.createPropertyAccessExpression(factory.createCallExpression(factory.createUniqueName(\"_superIndex\", 16 /* Optimistic */ | 32 /* FileLevel */), \n                /*typeArguments*/ undefined, [argumentExpression]), \"value\"), location);\n            }\n            else {\n                return ts.setTextRange(factory.createCallExpression(factory.createUniqueName(\"_superIndex\", 16 /* Optimistic */ | 32 /* FileLevel */), \n                /*typeArguments*/ undefined, [argumentExpression]), location);\n            }\n        }\n    }\n    ts.transformES2017 = transformES2017;\n    /** Creates a variable named `_super` with accessor properties for the given property names. */\n    function createSuperAccessVariableStatement(factory, resolver, node, names) {\n        // Create a variable declaration with a getter/setter (if binding) definition for each name:\n        //   const _super = Object.create(null, { x: { get: () => super.x, set: (v) => super.x = v }, ... });\n        var hasBinding = (resolver.getNodeCheckFlags(node) & 4096 /* AsyncMethodWithSuperBinding */) !== 0;\n        var accessors = [];\n        names.forEach(function (_, key) {\n            var name = ts.unescapeLeadingUnderscores(key);\n            var getterAndSetter = [];\n            getterAndSetter.push(factory.createPropertyAssignment(\"get\", factory.createArrowFunction(\n            /* modifiers */ undefined, \n            /* typeParameters */ undefined, \n            /* parameters */ [], \n            /* type */ undefined, \n            /* equalsGreaterThanToken */ undefined, ts.setEmitFlags(factory.createPropertyAccessExpression(ts.setEmitFlags(factory.createSuper(), 4 /* NoSubstitution */), name), 4 /* NoSubstitution */))));\n            if (hasBinding) {\n                getterAndSetter.push(factory.createPropertyAssignment(\"set\", factory.createArrowFunction(\n                /* modifiers */ undefined, \n                /* typeParameters */ undefined, \n                /* parameters */ [\n                    factory.createParameterDeclaration(\n                    /* decorators */ undefined, \n                    /* modifiers */ undefined, \n                    /* dotDotDotToken */ undefined, \"v\", \n                    /* questionToken */ undefined, \n                    /* type */ undefined, \n                    /* initializer */ undefined)\n                ], \n                /* type */ undefined, \n                /* equalsGreaterThanToken */ undefined, factory.createAssignment(ts.setEmitFlags(factory.createPropertyAccessExpression(ts.setEmitFlags(factory.createSuper(), 4 /* NoSubstitution */), name), 4 /* NoSubstitution */), factory.createIdentifier(\"v\")))));\n            }\n            accessors.push(factory.createPropertyAssignment(name, factory.createObjectLiteralExpression(getterAndSetter)));\n        });\n        return factory.createVariableStatement(\n        /* modifiers */ undefined, factory.createVariableDeclarationList([\n            factory.createVariableDeclaration(factory.createUniqueName(\"_super\", 16 /* Optimistic */ | 32 /* FileLevel */), \n            /*exclamationToken*/ undefined, \n            /* type */ undefined, factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier(\"Object\"), \"create\"), \n            /* typeArguments */ undefined, [\n                factory.createNull(),\n                factory.createObjectLiteralExpression(accessors, /* multiline */ true)\n            ]))\n        ], 2 /* Const */));\n    }\n    ts.createSuperAccessVariableStatement = createSuperAccessVariableStatement;\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    var ESNextSubstitutionFlags;\n    (function (ESNextSubstitutionFlags) {\n        /** Enables substitutions for async methods with `super` calls. */\n        ESNextSubstitutionFlags[ESNextSubstitutionFlags[\"AsyncMethodsWithSuper\"] = 1] = \"AsyncMethodsWithSuper\";\n    })(ESNextSubstitutionFlags || (ESNextSubstitutionFlags = {}));\n    // Facts we track as we traverse the tree\n    var HierarchyFacts;\n    (function (HierarchyFacts) {\n        HierarchyFacts[HierarchyFacts[\"None\"] = 0] = \"None\";\n        //\n        // Ancestor facts\n        //\n        HierarchyFacts[HierarchyFacts[\"HasLexicalThis\"] = 1] = \"HasLexicalThis\";\n        HierarchyFacts[HierarchyFacts[\"IterationContainer\"] = 2] = \"IterationContainer\";\n        // NOTE: do not add more ancestor flags without also updating AncestorFactsMask below.\n        //\n        // Ancestor masks\n        //\n        HierarchyFacts[HierarchyFacts[\"AncestorFactsMask\"] = 3] = \"AncestorFactsMask\";\n        HierarchyFacts[HierarchyFacts[\"SourceFileIncludes\"] = 1] = \"SourceFileIncludes\";\n        HierarchyFacts[HierarchyFacts[\"SourceFileExcludes\"] = 2] = \"SourceFileExcludes\";\n        HierarchyFacts[HierarchyFacts[\"StrictModeSourceFileIncludes\"] = 0] = \"StrictModeSourceFileIncludes\";\n        HierarchyFacts[HierarchyFacts[\"ClassOrFunctionIncludes\"] = 1] = \"ClassOrFunctionIncludes\";\n        HierarchyFacts[HierarchyFacts[\"ClassOrFunctionExcludes\"] = 2] = \"ClassOrFunctionExcludes\";\n        HierarchyFacts[HierarchyFacts[\"ArrowFunctionIncludes\"] = 0] = \"ArrowFunctionIncludes\";\n        HierarchyFacts[HierarchyFacts[\"ArrowFunctionExcludes\"] = 2] = \"ArrowFunctionExcludes\";\n        HierarchyFacts[HierarchyFacts[\"IterationStatementIncludes\"] = 2] = \"IterationStatementIncludes\";\n        HierarchyFacts[HierarchyFacts[\"IterationStatementExcludes\"] = 0] = \"IterationStatementExcludes\";\n    })(HierarchyFacts || (HierarchyFacts = {}));\n    function transformES2018(context) {\n        var factory = context.factory, emitHelpers = context.getEmitHelperFactory, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration;\n        var resolver = context.getEmitResolver();\n        var compilerOptions = context.getCompilerOptions();\n        var languageVersion = ts.getEmitScriptTarget(compilerOptions);\n        var previousOnEmitNode = context.onEmitNode;\n        context.onEmitNode = onEmitNode;\n        var previousOnSubstituteNode = context.onSubstituteNode;\n        context.onSubstituteNode = onSubstituteNode;\n        var exportedVariableStatement = false;\n        var enabledSubstitutions;\n        var enclosingFunctionFlags;\n        var enclosingSuperContainerFlags = 0;\n        var hierarchyFacts = 0;\n        var currentSourceFile;\n        var taggedTemplateStringDeclarations;\n        /** Keeps track of property names accessed on super (`super.x`) within async functions. */\n        var capturedSuperProperties;\n        /** Whether the async function contains an element access on super (`super[x]`). */\n        var hasSuperElementAccess;\n        /** A set of node IDs for generated super accessors. */\n        var substitutedSuperAccessors = [];\n        return ts.chainBundle(context, transformSourceFile);\n        function affectsSubtree(excludeFacts, includeFacts) {\n            return hierarchyFacts !== (hierarchyFacts & ~excludeFacts | includeFacts);\n        }\n        /**\n         * Sets the `HierarchyFacts` for this node prior to visiting this node's subtree, returning the facts set prior to modification.\n         * @param excludeFacts The existing `HierarchyFacts` to reset before visiting the subtree.\n         * @param includeFacts The new `HierarchyFacts` to set before visiting the subtree.\n         */\n        function enterSubtree(excludeFacts, includeFacts) {\n            var ancestorFacts = hierarchyFacts;\n            hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 3 /* AncestorFactsMask */;\n            return ancestorFacts;\n        }\n        /**\n         * Restores the `HierarchyFacts` for this node's ancestor after visiting this node's\n         * subtree.\n         * @param ancestorFacts The `HierarchyFacts` of the ancestor to restore after visiting the subtree.\n         */\n        function exitSubtree(ancestorFacts) {\n            hierarchyFacts = ancestorFacts;\n        }\n        function recordTaggedTemplateString(temp) {\n            taggedTemplateStringDeclarations = ts.append(taggedTemplateStringDeclarations, factory.createVariableDeclaration(temp));\n        }\n        function transformSourceFile(node) {\n            if (node.isDeclarationFile) {\n                return node;\n            }\n            currentSourceFile = node;\n            var visited = visitSourceFile(node);\n            ts.addEmitHelpers(visited, context.readEmitHelpers());\n            currentSourceFile = undefined;\n            taggedTemplateStringDeclarations = undefined;\n            return visited;\n        }\n        function visitor(node) {\n            return visitorWorker(node, /*expressionResultIsUnused*/ false);\n        }\n        function visitorWithUnusedExpressionResult(node) {\n            return visitorWorker(node, /*expressionResultIsUnused*/ true);\n        }\n        function visitorNoAsyncModifier(node) {\n            if (node.kind === 129 /* AsyncKeyword */) {\n                return undefined;\n            }\n            return node;\n        }\n        function doWithHierarchyFacts(cb, value, excludeFacts, includeFacts) {\n            if (affectsSubtree(excludeFacts, includeFacts)) {\n                var ancestorFacts = enterSubtree(excludeFacts, includeFacts);\n                var result = cb(value);\n                exitSubtree(ancestorFacts);\n                return result;\n            }\n            return cb(value);\n        }\n        function visitDefault(node) {\n            return ts.visitEachChild(node, visitor, context);\n        }\n        /**\n         * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the\n         * expression of an `ExpressionStatement`).\n         */\n        function visitorWorker(node, expressionResultIsUnused) {\n            if ((node.transformFlags & 32 /* ContainsES2018 */) === 0) {\n                return node;\n            }\n            switch (node.kind) {\n                case 213 /* AwaitExpression */:\n                    return visitAwaitExpression(node);\n                case 219 /* YieldExpression */:\n                    return visitYieldExpression(node);\n                case 242 /* ReturnStatement */:\n                    return visitReturnStatement(node);\n                case 245 /* LabeledStatement */:\n                    return visitLabeledStatement(node);\n                case 200 /* ObjectLiteralExpression */:\n                    return visitObjectLiteralExpression(node);\n                case 216 /* BinaryExpression */:\n                    return visitBinaryExpression(node, expressionResultIsUnused);\n                case 337 /* CommaListExpression */:\n                    return visitCommaListExpression(node, expressionResultIsUnused);\n                case 287 /* CatchClause */:\n                    return visitCatchClause(node);\n                case 232 /* VariableStatement */:\n                    return visitVariableStatement(node);\n                case 249 /* VariableDeclaration */:\n                    return visitVariableDeclaration(node);\n                case 235 /* DoStatement */:\n                case 236 /* WhileStatement */:\n                case 238 /* ForInStatement */:\n                    return doWithHierarchyFacts(visitDefault, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */);\n                case 239 /* ForOfStatement */:\n                    return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined);\n                case 237 /* ForStatement */:\n                    return doWithHierarchyFacts(visitForStatement, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */);\n                case 212 /* VoidExpression */:\n                    return visitVoidExpression(node);\n                case 166 /* Constructor */:\n                    return doWithHierarchyFacts(visitConstructorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */);\n                case 165 /* MethodDeclaration */:\n                    return doWithHierarchyFacts(visitMethodDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */);\n                case 167 /* GetAccessor */:\n                    return doWithHierarchyFacts(visitGetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */);\n                case 168 /* SetAccessor */:\n                    return doWithHierarchyFacts(visitSetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */);\n                case 251 /* FunctionDeclaration */:\n                    return doWithHierarchyFacts(visitFunctionDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */);\n                case 208 /* FunctionExpression */:\n                    return doWithHierarchyFacts(visitFunctionExpression, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */);\n                case 209 /* ArrowFunction */:\n                    return doWithHierarchyFacts(visitArrowFunction, node, 2 /* ArrowFunctionExcludes */, 0 /* ArrowFunctionIncludes */);\n                case 160 /* Parameter */:\n                    return visitParameter(node);\n                case 233 /* ExpressionStatement */:\n                    return visitExpressionStatement(node);\n                case 207 /* ParenthesizedExpression */:\n                    return visitParenthesizedExpression(node, expressionResultIsUnused);\n                case 205 /* TaggedTemplateExpression */:\n                    return visitTaggedTemplateExpression(node);\n                case 201 /* PropertyAccessExpression */:\n                    if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 105 /* SuperKeyword */) {\n                        capturedSuperProperties.add(node.name.escapedText);\n                    }\n                    return ts.visitEachChild(node, visitor, context);\n                case 202 /* ElementAccessExpression */:\n                    if (capturedSuperProperties && node.expression.kind === 105 /* SuperKeyword */) {\n                        hasSuperElementAccess = true;\n                    }\n                    return ts.visitEachChild(node, visitor, context);\n                case 252 /* ClassDeclaration */:\n                case 221 /* ClassExpression */:\n                    return doWithHierarchyFacts(visitDefault, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */);\n                default:\n                    return ts.visitEachChild(node, visitor, context);\n            }\n        }\n        function visitAwaitExpression(node) {\n            if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) {\n                return ts.setOriginalNode(ts.setTextRange(factory.createYieldExpression(/*asteriskToken*/ undefined, emitHelpers().createAwaitHelper(ts.visitNode(node.expression, visitor, ts.isExpression))), \n                /*location*/ node), node);\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitYieldExpression(node) {\n            if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) {\n                if (node.asteriskToken) {\n                    var expression = ts.visitNode(ts.Debug.assertDefined(node.expression), visitor, ts.isExpression);\n                    return ts.setOriginalNode(ts.setTextRange(factory.createYieldExpression(\n                    /*asteriskToken*/ undefined, emitHelpers().createAwaitHelper(factory.updateYieldExpression(node, node.asteriskToken, ts.setTextRange(emitHelpers().createAsyncDelegatorHelper(ts.setTextRange(emitHelpers().createAsyncValuesHelper(expression), expression)), expression)))), node), node);\n                }\n                return ts.setOriginalNode(ts.setTextRange(factory.createYieldExpression(\n                /*asteriskToken*/ undefined, createDownlevelAwait(node.expression\n                    ? ts.visitNode(node.expression, visitor, ts.isExpression)\n                    : factory.createVoidZero())), node), node);\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitReturnStatement(node) {\n            if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) {\n                return factory.updateReturnStatement(node, createDownlevelAwait(node.expression ? ts.visitNode(node.expression, visitor, ts.isExpression) : factory.createVoidZero()));\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitLabeledStatement(node) {\n            if (enclosingFunctionFlags & 2 /* Async */) {\n                var statement = ts.unwrapInnermostStatementOfLabel(node);\n                if (statement.kind === 239 /* ForOfStatement */ && statement.awaitModifier) {\n                    return visitForOfStatement(statement, node);\n                }\n                return factory.restoreEnclosingLabel(ts.visitNode(statement, visitor, ts.isStatement, factory.liftToBlock), node);\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function chunkObjectLiteralElements(elements) {\n            var chunkObject;\n            var objects = [];\n            for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) {\n                var e = elements_4[_i];\n                if (e.kind === 290 /* SpreadAssignment */) {\n                    if (chunkObject) {\n                        objects.push(factory.createObjectLiteralExpression(chunkObject));\n                        chunkObject = undefined;\n                    }\n                    var target = e.expression;\n                    objects.push(ts.visitNode(target, visitor, ts.isExpression));\n                }\n                else {\n                    chunkObject = ts.append(chunkObject, e.kind === 288 /* PropertyAssignment */\n                        ? factory.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression))\n                        : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike));\n                }\n            }\n            if (chunkObject) {\n                objects.push(factory.createObjectLiteralExpression(chunkObject));\n            }\n            return objects;\n        }\n        function visitObjectLiteralExpression(node) {\n            if (node.transformFlags & 16384 /* ContainsObjectRestOrSpread */) {\n                // spread elements emit like so:\n                // non-spread elements are chunked together into object literals, and then all are passed to __assign:\n                //     { a, ...o, b } => __assign(__assign({a}, o), {b});\n                // If the first element is a spread element, then the first argument to __assign is {}:\n                //     { ...o, a, b, ...o2 } => __assign(__assign(__assign({}, o), {a, b}), o2)\n                //\n                // We cannot call __assign with more than two elements, since any element could cause side effects. For\n                // example:\n                //      var k = { a: 1, b: 2 };\n                //      var o = { a: 3, ...k, b: k.a++ };\n                //      // expected: { a: 1, b: 1 }\n                // If we translate the above to `__assign({ a: 3 }, k, { b: k.a++ })`, the `k.a++` will evaluate before\n                // `k` is spread and we end up with `{ a: 2, b: 1 }`.\n                //\n                // This also occurs for spread elements, not just property assignments:\n                //      var k = { a: 1, get b() { l = { z: 9 }; return 2; } };\n                //      var l = { c: 3 };\n                //      var o = { ...k, ...l };\n                //      // expected: { a: 1, b: 2, z: 9 }\n                // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we\n                // end up with `{ a: 1, b: 2, c: 3 }`\n                var objects = chunkObjectLiteralElements(node.properties);\n                if (objects.length && objects[0].kind !== 200 /* ObjectLiteralExpression */) {\n                    objects.unshift(factory.createObjectLiteralExpression());\n                }\n                var expression = objects[0];\n                if (objects.length > 1) {\n                    for (var i = 1; i < objects.length; i++) {\n                        expression = emitHelpers().createAssignHelper([expression, objects[i]]);\n                    }\n                    return expression;\n                }\n                else {\n                    return emitHelpers().createAssignHelper(objects);\n                }\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitExpressionStatement(node) {\n            return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);\n        }\n        /**\n         * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the\n         * expression of an `ExpressionStatement`).\n         */\n        function visitParenthesizedExpression(node, expressionResultIsUnused) {\n            return ts.visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context);\n        }\n        function visitSourceFile(node) {\n            var ancestorFacts = enterSubtree(2 /* SourceFileExcludes */, ts.isEffectiveStrictModeSourceFile(node, compilerOptions) ?\n                0 /* StrictModeSourceFileIncludes */ :\n                1 /* SourceFileIncludes */);\n            exportedVariableStatement = false;\n            var visited = ts.visitEachChild(node, visitor, context);\n            var statement = ts.concatenate(visited.statements, taggedTemplateStringDeclarations && [\n                factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList(taggedTemplateStringDeclarations))\n            ]);\n            var result = factory.updateSourceFile(visited, ts.setTextRange(factory.createNodeArray(statement), node.statements));\n            exitSubtree(ancestorFacts);\n            return result;\n        }\n        function visitTaggedTemplateExpression(node) {\n            return ts.processTaggedTemplateExpression(context, node, visitor, currentSourceFile, recordTaggedTemplateString, ts.ProcessLevel.LiftRestriction);\n        }\n        /**\n         * Visits a BinaryExpression that contains a destructuring assignment.\n         *\n         * @param node A BinaryExpression node.\n         * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the\n         * expression of an `ExpressionStatement`).\n         */\n        function visitBinaryExpression(node, expressionResultIsUnused) {\n            if (ts.isDestructuringAssignment(node) && node.left.transformFlags & 16384 /* ContainsObjectRestOrSpread */) {\n                return ts.flattenDestructuringAssignment(node, visitor, context, 1 /* ObjectRest */, !expressionResultIsUnused);\n            }\n            if (node.operatorToken.kind === 27 /* CommaToken */) {\n                return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorWithUnusedExpressionResult, ts.isExpression), node.operatorToken, ts.visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, ts.isExpression));\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        /**\n         * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the\n         * expression of an `ExpressionStatement`).\n         */\n        function visitCommaListExpression(node, expressionResultIsUnused) {\n            if (expressionResultIsUnused) {\n                return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);\n            }\n            var result;\n            for (var i = 0; i < node.elements.length; i++) {\n                var element = node.elements[i];\n                var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression);\n                if (result || visited !== element) {\n                    result || (result = node.elements.slice(0, i));\n                    result.push(visited);\n                }\n            }\n            var elements = result ? ts.setTextRange(factory.createNodeArray(result), node.elements) : node.elements;\n            return factory.updateCommaListExpression(node, elements);\n        }\n        function visitCatchClause(node) {\n            if (node.variableDeclaration &&\n                ts.isBindingPattern(node.variableDeclaration.name) &&\n                node.variableDeclaration.name.transformFlags & 16384 /* ContainsObjectRestOrSpread */) {\n                var name = factory.getGeneratedNameForNode(node.variableDeclaration.name);\n                var updatedDecl = factory.updateVariableDeclaration(node.variableDeclaration, node.variableDeclaration.name, /*exclamationToken*/ undefined, /*type*/ undefined, name);\n                var visitedBindings = ts.flattenDestructuringBinding(updatedDecl, visitor, context, 1 /* ObjectRest */);\n                var block = ts.visitNode(node.block, visitor, ts.isBlock);\n                if (ts.some(visitedBindings)) {\n                    block = factory.updateBlock(block, __spreadArray([\n                        factory.createVariableStatement(/*modifiers*/ undefined, visitedBindings)\n                    ], block.statements));\n                }\n                return factory.updateCatchClause(node, factory.updateVariableDeclaration(node.variableDeclaration, name, /*exclamationToken*/ undefined, /*type*/ undefined, /*initializer*/ undefined), block);\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitVariableStatement(node) {\n            if (ts.hasSyntacticModifier(node, 1 /* Export */)) {\n                var savedExportedVariableStatement = exportedVariableStatement;\n                exportedVariableStatement = true;\n                var visited = ts.visitEachChild(node, visitor, context);\n                exportedVariableStatement = savedExportedVariableStatement;\n                return visited;\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        /**\n         * Visits a VariableDeclaration node with a binding pattern.\n         *\n         * @param node A VariableDeclaration node.\n         */\n        function visitVariableDeclaration(node) {\n            if (exportedVariableStatement) {\n                var savedExportedVariableStatement = exportedVariableStatement;\n                exportedVariableStatement = false;\n                var visited = visitVariableDeclarationWorker(node, /*exportedVariableStatement*/ true);\n                exportedVariableStatement = savedExportedVariableStatement;\n                return visited;\n            }\n            return visitVariableDeclarationWorker(node, /*exportedVariableStatement*/ false);\n        }\n        function visitVariableDeclarationWorker(node, exportedVariableStatement) {\n            // If we are here it is because the name contains a binding pattern with a rest somewhere in it.\n            if (ts.isBindingPattern(node.name) && node.name.transformFlags & 16384 /* ContainsObjectRestOrSpread */) {\n                return ts.flattenDestructuringBinding(node, visitor, context, 1 /* ObjectRest */, \n                /*rval*/ undefined, exportedVariableStatement);\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitForStatement(node) {\n            return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement));\n        }\n        function visitVoidExpression(node) {\n            return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);\n        }\n        /**\n         * Visits a ForOfStatement and converts it into a ES2015-compatible ForOfStatement.\n         *\n         * @param node A ForOfStatement.\n         */\n        function visitForOfStatement(node, outermostLabeledStatement) {\n            var ancestorFacts = enterSubtree(0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */);\n            if (node.initializer.transformFlags & 16384 /* ContainsObjectRestOrSpread */) {\n                node = transformForOfStatementWithObjectRest(node);\n            }\n            var result = node.awaitModifier ?\n                transformForAwaitOfStatement(node, outermostLabeledStatement, ancestorFacts) :\n                factory.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement);\n            exitSubtree(ancestorFacts);\n            return result;\n        }\n        function transformForOfStatementWithObjectRest(node) {\n            var initializerWithoutParens = ts.skipParentheses(node.initializer);\n            if (ts.isVariableDeclarationList(initializerWithoutParens) || ts.isAssignmentPattern(initializerWithoutParens)) {\n                var bodyLocation = void 0;\n                var statementsLocation = void 0;\n                var temp = factory.createTempVariable(/*recordTempVariable*/ undefined);\n                var statements = [ts.createForOfBindingStatement(factory, initializerWithoutParens, temp)];\n                if (ts.isBlock(node.statement)) {\n                    ts.addRange(statements, node.statement.statements);\n                    bodyLocation = node.statement;\n                    statementsLocation = node.statement.statements;\n                }\n                else if (node.statement) {\n                    ts.append(statements, node.statement);\n                    bodyLocation = node.statement;\n                    statementsLocation = node.statement;\n                }\n                return factory.updateForOfStatement(node, node.awaitModifier, ts.setTextRange(factory.createVariableDeclarationList([\n                    ts.setTextRange(factory.createVariableDeclaration(temp), node.initializer)\n                ], 1 /* Let */), node.initializer), node.expression, ts.setTextRange(factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), statementsLocation), \n                /*multiLine*/ true), bodyLocation));\n            }\n            return node;\n        }\n        function convertForOfStatementHead(node, boundValue) {\n            var binding = ts.createForOfBindingStatement(factory, node.initializer, boundValue);\n            var bodyLocation;\n            var statementsLocation;\n            var statements = [ts.visitNode(binding, visitor, ts.isStatement)];\n            var statement = ts.visitNode(node.statement, visitor, ts.isStatement);\n            if (ts.isBlock(statement)) {\n                ts.addRange(statements, statement.statements);\n                bodyLocation = statement;\n                statementsLocation = statement.statements;\n            }\n            else {\n                statements.push(statement);\n            }\n            return ts.setEmitFlags(ts.setTextRange(factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), statementsLocation), \n            /*multiLine*/ true), bodyLocation), 48 /* NoSourceMap */ | 384 /* NoTokenSourceMaps */);\n        }\n        function createDownlevelAwait(expression) {\n            return enclosingFunctionFlags & 1 /* Generator */\n                ? factory.createYieldExpression(/*asteriskToken*/ undefined, emitHelpers().createAwaitHelper(expression))\n                : factory.createAwaitExpression(expression);\n        }\n        function transformForAwaitOfStatement(node, outermostLabeledStatement, ancestorFacts) {\n            var expression = ts.visitNode(node.expression, visitor, ts.isExpression);\n            var iterator = ts.isIdentifier(expression) ? factory.getGeneratedNameForNode(expression) : factory.createTempVariable(/*recordTempVariable*/ undefined);\n            var result = ts.isIdentifier(expression) ? factory.getGeneratedNameForNode(iterator) : factory.createTempVariable(/*recordTempVariable*/ undefined);\n            var errorRecord = factory.createUniqueName(\"e\");\n            var catchVariable = factory.getGeneratedNameForNode(errorRecord);\n            var returnMethod = factory.createTempVariable(/*recordTempVariable*/ undefined);\n            var callValues = ts.setTextRange(emitHelpers().createAsyncValuesHelper(expression), node.expression);\n            var callNext = factory.createCallExpression(factory.createPropertyAccessExpression(iterator, \"next\"), /*typeArguments*/ undefined, []);\n            var getDone = factory.createPropertyAccessExpression(result, \"done\");\n            var getValue = factory.createPropertyAccessExpression(result, \"value\");\n            var callReturn = factory.createFunctionCallCall(returnMethod, iterator, []);\n            hoistVariableDeclaration(errorRecord);\n            hoistVariableDeclaration(returnMethod);\n            // if we are enclosed in an outer loop ensure we reset 'errorRecord' per each iteration\n            var initializer = ancestorFacts & 2 /* IterationContainer */ ?\n                factory.inlineExpressions([factory.createAssignment(errorRecord, factory.createVoidZero()), callValues]) :\n                callValues;\n            var forStatement = ts.setEmitFlags(ts.setTextRange(factory.createForStatement(\n            /*initializer*/ ts.setEmitFlags(ts.setTextRange(factory.createVariableDeclarationList([\n                ts.setTextRange(factory.createVariableDeclaration(iterator, /*exclamationToken*/ undefined, /*type*/ undefined, initializer), node.expression),\n                factory.createVariableDeclaration(result)\n            ]), node.expression), 2097152 /* NoHoisting */), \n            /*condition*/ factory.createComma(factory.createAssignment(result, createDownlevelAwait(callNext)), factory.createLogicalNot(getDone)), \n            /*incrementor*/ undefined, \n            /*statement*/ convertForOfStatementHead(node, getValue)), \n            /*location*/ node), 256 /* NoTokenTrailingSourceMaps */);\n            return factory.createTryStatement(factory.createBlock([\n                factory.restoreEnclosingLabel(forStatement, outermostLabeledStatement)\n            ]), factory.createCatchClause(factory.createVariableDeclaration(catchVariable), ts.setEmitFlags(factory.createBlock([\n                factory.createExpressionStatement(factory.createAssignment(errorRecord, factory.createObjectLiteralExpression([\n                    factory.createPropertyAssignment(\"error\", catchVariable)\n                ])))\n            ]), 1 /* SingleLine */)), factory.createBlock([\n                factory.createTryStatement(\n                /*tryBlock*/ factory.createBlock([\n                    ts.setEmitFlags(factory.createIfStatement(factory.createLogicalAnd(factory.createLogicalAnd(result, factory.createLogicalNot(getDone)), factory.createAssignment(returnMethod, factory.createPropertyAccessExpression(iterator, \"return\"))), factory.createExpressionStatement(createDownlevelAwait(callReturn))), 1 /* SingleLine */)\n                ]), \n                /*catchClause*/ undefined, \n                /*finallyBlock*/ ts.setEmitFlags(factory.createBlock([\n                    ts.setEmitFlags(factory.createIfStatement(errorRecord, factory.createThrowStatement(factory.createPropertyAccessExpression(errorRecord, \"error\"))), 1 /* SingleLine */)\n                ]), 1 /* SingleLine */))\n            ]));\n        }\n        function visitParameter(node) {\n            if (node.transformFlags & 16384 /* ContainsObjectRestOrSpread */) {\n                // Binding patterns are converted into a generated name and are\n                // evaluated inside the function body.\n                return factory.updateParameterDeclaration(node, \n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, node.dotDotDotToken, factory.getGeneratedNameForNode(node), \n                /*questionToken*/ undefined, \n                /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitConstructorDeclaration(node) {\n            var savedEnclosingFunctionFlags = enclosingFunctionFlags;\n            enclosingFunctionFlags = 0 /* Normal */;\n            var updated = factory.updateConstructorDeclaration(node, \n            /*decorators*/ undefined, node.modifiers, ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node));\n            enclosingFunctionFlags = savedEnclosingFunctionFlags;\n            return updated;\n        }\n        function visitGetAccessorDeclaration(node) {\n            var savedEnclosingFunctionFlags = enclosingFunctionFlags;\n            enclosingFunctionFlags = 0 /* Normal */;\n            var updated = factory.updateGetAccessorDeclaration(node, \n            /*decorators*/ undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), \n            /*type*/ undefined, transformFunctionBody(node));\n            enclosingFunctionFlags = savedEnclosingFunctionFlags;\n            return updated;\n        }\n        function visitSetAccessorDeclaration(node) {\n            var savedEnclosingFunctionFlags = enclosingFunctionFlags;\n            enclosingFunctionFlags = 0 /* Normal */;\n            var updated = factory.updateSetAccessorDeclaration(node, \n            /*decorators*/ undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node));\n            enclosingFunctionFlags = savedEnclosingFunctionFlags;\n            return updated;\n        }\n        function visitMethodDeclaration(node) {\n            var savedEnclosingFunctionFlags = enclosingFunctionFlags;\n            enclosingFunctionFlags = ts.getFunctionFlags(node);\n            var updated = factory.updateMethodDeclaration(node, \n            /*decorators*/ undefined, enclosingFunctionFlags & 1 /* Generator */\n                ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier)\n                : node.modifiers, enclosingFunctionFlags & 2 /* Async */\n                ? undefined\n                : node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(/*questionToken*/ undefined, visitor, ts.isToken), \n            /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), \n            /*type*/ undefined, enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */\n                ? transformAsyncGeneratorFunctionBody(node)\n                : transformFunctionBody(node));\n            enclosingFunctionFlags = savedEnclosingFunctionFlags;\n            return updated;\n        }\n        function visitFunctionDeclaration(node) {\n            var savedEnclosingFunctionFlags = enclosingFunctionFlags;\n            enclosingFunctionFlags = ts.getFunctionFlags(node);\n            var updated = factory.updateFunctionDeclaration(node, \n            /*decorators*/ undefined, enclosingFunctionFlags & 1 /* Generator */\n                ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier)\n                : node.modifiers, enclosingFunctionFlags & 2 /* Async */\n                ? undefined\n                : node.asteriskToken, node.name, \n            /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), \n            /*type*/ undefined, enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */\n                ? transformAsyncGeneratorFunctionBody(node)\n                : transformFunctionBody(node));\n            enclosingFunctionFlags = savedEnclosingFunctionFlags;\n            return updated;\n        }\n        function visitArrowFunction(node) {\n            var savedEnclosingFunctionFlags = enclosingFunctionFlags;\n            enclosingFunctionFlags = ts.getFunctionFlags(node);\n            var updated = factory.updateArrowFunction(node, node.modifiers, \n            /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), \n            /*type*/ undefined, node.equalsGreaterThanToken, transformFunctionBody(node));\n            enclosingFunctionFlags = savedEnclosingFunctionFlags;\n            return updated;\n        }\n        function visitFunctionExpression(node) {\n            var savedEnclosingFunctionFlags = enclosingFunctionFlags;\n            enclosingFunctionFlags = ts.getFunctionFlags(node);\n            var updated = factory.updateFunctionExpression(node, enclosingFunctionFlags & 1 /* Generator */\n                ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier)\n                : node.modifiers, enclosingFunctionFlags & 2 /* Async */\n                ? undefined\n                : node.asteriskToken, node.name, \n            /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), \n            /*type*/ undefined, enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */\n                ? transformAsyncGeneratorFunctionBody(node)\n                : transformFunctionBody(node));\n            enclosingFunctionFlags = savedEnclosingFunctionFlags;\n            return updated;\n        }\n        function transformAsyncGeneratorFunctionBody(node) {\n            resumeLexicalEnvironment();\n            var statements = [];\n            var statementOffset = factory.copyPrologue(node.body.statements, statements, /*ensureUseStrict*/ false, visitor);\n            appendObjectRestAssignmentsIfNeeded(statements, node);\n            var savedCapturedSuperProperties = capturedSuperProperties;\n            var savedHasSuperElementAccess = hasSuperElementAccess;\n            capturedSuperProperties = new ts.Set();\n            hasSuperElementAccess = false;\n            var returnStatement = factory.createReturnStatement(emitHelpers().createAsyncGeneratorHelper(factory.createFunctionExpression(\n            /*modifiers*/ undefined, factory.createToken(41 /* AsteriskToken */), node.name && factory.getGeneratedNameForNode(node.name), \n            /*typeParameters*/ undefined, \n            /*parameters*/ [], \n            /*type*/ undefined, factory.updateBlock(node.body, ts.visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset))), !!(hierarchyFacts & 1 /* HasLexicalThis */)));\n            // Minor optimization, emit `_super` helper to capture `super` access in an arrow.\n            // This step isn't needed if we eventually transform this to ES5.\n            var emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* AsyncMethodWithSuperBinding */ | 2048 /* AsyncMethodWithSuper */);\n            if (emitSuperHelpers) {\n                enableSubstitutionForAsyncMethodsWithSuper();\n                var variableStatement = ts.createSuperAccessVariableStatement(factory, resolver, node, capturedSuperProperties);\n                substitutedSuperAccessors[ts.getNodeId(variableStatement)] = true;\n                ts.insertStatementsAfterStandardPrologue(statements, [variableStatement]);\n            }\n            statements.push(returnStatement);\n            ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());\n            var block = factory.updateBlock(node.body, statements);\n            if (emitSuperHelpers && hasSuperElementAccess) {\n                if (resolver.getNodeCheckFlags(node) & 4096 /* AsyncMethodWithSuperBinding */) {\n                    ts.addEmitHelper(block, ts.advancedAsyncSuperHelper);\n                }\n                else if (resolver.getNodeCheckFlags(node) & 2048 /* AsyncMethodWithSuper */) {\n                    ts.addEmitHelper(block, ts.asyncSuperHelper);\n                }\n            }\n            capturedSuperProperties = savedCapturedSuperProperties;\n            hasSuperElementAccess = savedHasSuperElementAccess;\n            return block;\n        }\n        function transformFunctionBody(node) {\n            var _a;\n            resumeLexicalEnvironment();\n            var statementOffset = 0;\n            var statements = [];\n            var body = (_a = ts.visitNode(node.body, visitor, ts.isConciseBody)) !== null && _a !== void 0 ? _a : factory.createBlock([]);\n            if (ts.isBlock(body)) {\n                statementOffset = factory.copyPrologue(body.statements, statements, /*ensureUseStrict*/ false, visitor);\n            }\n            ts.addRange(statements, appendObjectRestAssignmentsIfNeeded(/*statements*/ undefined, node));\n            var leadingStatements = endLexicalEnvironment();\n            if (statementOffset > 0 || ts.some(statements) || ts.some(leadingStatements)) {\n                var block = factory.converters.convertToFunctionBlock(body, /*multiLine*/ true);\n                ts.insertStatementsAfterStandardPrologue(statements, leadingStatements);\n                ts.addRange(statements, block.statements.slice(statementOffset));\n                return factory.updateBlock(block, ts.setTextRange(factory.createNodeArray(statements), block.statements));\n            }\n            return body;\n        }\n        function appendObjectRestAssignmentsIfNeeded(statements, node) {\n            for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {\n                var parameter = _a[_i];\n                if (parameter.transformFlags & 16384 /* ContainsObjectRestOrSpread */) {\n                    var temp = factory.getGeneratedNameForNode(parameter);\n                    var declarations = ts.flattenDestructuringBinding(parameter, visitor, context, 1 /* ObjectRest */, temp, \n                    /*doNotRecordTempVariablesInLine*/ false, \n                    /*skipInitializer*/ true);\n                    if (ts.some(declarations)) {\n                        var statement = factory.createVariableStatement(\n                        /*modifiers*/ undefined, factory.createVariableDeclarationList(declarations));\n                        ts.setEmitFlags(statement, 1048576 /* CustomPrologue */);\n                        statements = ts.append(statements, statement);\n                    }\n                }\n            }\n            return statements;\n        }\n        function enableSubstitutionForAsyncMethodsWithSuper() {\n            if ((enabledSubstitutions & 1 /* AsyncMethodsWithSuper */) === 0) {\n                enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */;\n                // We need to enable substitutions for call, property access, and element access\n                // if we need to rewrite super calls.\n                context.enableSubstitution(203 /* CallExpression */);\n                context.enableSubstitution(201 /* PropertyAccessExpression */);\n                context.enableSubstitution(202 /* ElementAccessExpression */);\n                // We need to be notified when entering and exiting declarations that bind super.\n                context.enableEmitNotification(252 /* ClassDeclaration */);\n                context.enableEmitNotification(165 /* MethodDeclaration */);\n                context.enableEmitNotification(167 /* GetAccessor */);\n                context.enableEmitNotification(168 /* SetAccessor */);\n                context.enableEmitNotification(166 /* Constructor */);\n                // We need to be notified when entering the generated accessor arrow functions.\n                context.enableEmitNotification(232 /* VariableStatement */);\n            }\n        }\n        /**\n         * Called by the printer just before a node is printed.\n         *\n         * @param hint A hint as to the intended usage of the node.\n         * @param node The node to be printed.\n         * @param emitCallback The callback used to emit the node.\n         */\n        function onEmitNode(hint, node, emitCallback) {\n            // If we need to support substitutions for `super` in an async method,\n            // we should track it here.\n            if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {\n                var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* AsyncMethodWithSuper */ | 4096 /* AsyncMethodWithSuperBinding */);\n                if (superContainerFlags !== enclosingSuperContainerFlags) {\n                    var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;\n                    enclosingSuperContainerFlags = superContainerFlags;\n                    previousOnEmitNode(hint, node, emitCallback);\n                    enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags;\n                    return;\n                }\n            }\n            // Disable substitution in the generated super accessor itself.\n            else if (enabledSubstitutions && substitutedSuperAccessors[ts.getNodeId(node)]) {\n                var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;\n                enclosingSuperContainerFlags = 0;\n                previousOnEmitNode(hint, node, emitCallback);\n                enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags;\n                return;\n            }\n            previousOnEmitNode(hint, node, emitCallback);\n        }\n        /**\n         * Hooks node substitutions.\n         *\n         * @param hint The context for the emitter.\n         * @param node The node to substitute.\n         */\n        function onSubstituteNode(hint, node) {\n            node = previousOnSubstituteNode(hint, node);\n            if (hint === 1 /* Expression */ && enclosingSuperContainerFlags) {\n                return substituteExpression(node);\n            }\n            return node;\n        }\n        function substituteExpression(node) {\n            switch (node.kind) {\n                case 201 /* PropertyAccessExpression */:\n                    return substitutePropertyAccessExpression(node);\n                case 202 /* ElementAccessExpression */:\n                    return substituteElementAccessExpression(node);\n                case 203 /* CallExpression */:\n                    return substituteCallExpression(node);\n            }\n            return node;\n        }\n        function substitutePropertyAccessExpression(node) {\n            if (node.expression.kind === 105 /* SuperKeyword */) {\n                return ts.setTextRange(factory.createPropertyAccessExpression(factory.createUniqueName(\"_super\", 16 /* Optimistic */ | 32 /* FileLevel */), node.name), node);\n            }\n            return node;\n        }\n        function substituteElementAccessExpression(node) {\n            if (node.expression.kind === 105 /* SuperKeyword */) {\n                return createSuperElementAccessInAsyncMethod(node.argumentExpression, node);\n            }\n            return node;\n        }\n        function substituteCallExpression(node) {\n            var expression = node.expression;\n            if (ts.isSuperProperty(expression)) {\n                var argumentExpression = ts.isPropertyAccessExpression(expression)\n                    ? substitutePropertyAccessExpression(expression)\n                    : substituteElementAccessExpression(expression);\n                return factory.createCallExpression(factory.createPropertyAccessExpression(argumentExpression, \"call\"), \n                /*typeArguments*/ undefined, __spreadArray([\n                    factory.createThis()\n                ], node.arguments));\n            }\n            return node;\n        }\n        function isSuperContainer(node) {\n            var kind = node.kind;\n            return kind === 252 /* ClassDeclaration */\n                || kind === 166 /* Constructor */\n                || kind === 165 /* MethodDeclaration */\n                || kind === 167 /* GetAccessor */\n                || kind === 168 /* SetAccessor */;\n        }\n        function createSuperElementAccessInAsyncMethod(argumentExpression, location) {\n            if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) {\n                return ts.setTextRange(factory.createPropertyAccessExpression(factory.createCallExpression(factory.createIdentifier(\"_superIndex\"), \n                /*typeArguments*/ undefined, [argumentExpression]), \"value\"), location);\n            }\n            else {\n                return ts.setTextRange(factory.createCallExpression(factory.createIdentifier(\"_superIndex\"), \n                /*typeArguments*/ undefined, [argumentExpression]), location);\n            }\n        }\n    }\n    ts.transformES2018 = transformES2018;\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    function transformES2019(context) {\n        var factory = context.factory;\n        return ts.chainBundle(context, transformSourceFile);\n        function transformSourceFile(node) {\n            if (node.isDeclarationFile) {\n                return node;\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitor(node) {\n            if ((node.transformFlags & 16 /* ContainsES2019 */) === 0) {\n                return node;\n            }\n            switch (node.kind) {\n                case 287 /* CatchClause */:\n                    return visitCatchClause(node);\n                default:\n                    return ts.visitEachChild(node, visitor, context);\n            }\n        }\n        function visitCatchClause(node) {\n            if (!node.variableDeclaration) {\n                return factory.updateCatchClause(node, factory.createVariableDeclaration(factory.createTempVariable(/*recordTempVariable*/ undefined)), ts.visitNode(node.block, visitor, ts.isBlock));\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n    }\n    ts.transformES2019 = transformES2019;\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    function transformES2020(context) {\n        var factory = context.factory, hoistVariableDeclaration = context.hoistVariableDeclaration;\n        return ts.chainBundle(context, transformSourceFile);\n        function transformSourceFile(node) {\n            if (node.isDeclarationFile) {\n                return node;\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitor(node) {\n            if ((node.transformFlags & 8 /* ContainsES2020 */) === 0) {\n                return node;\n            }\n            switch (node.kind) {\n                case 201 /* PropertyAccessExpression */:\n                case 202 /* ElementAccessExpression */:\n                case 203 /* CallExpression */:\n                    if (node.flags & 32 /* OptionalChain */) {\n                        var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false);\n                        ts.Debug.assertNotNode(updated, ts.isSyntheticReference);\n                        return updated;\n                    }\n                    return ts.visitEachChild(node, visitor, context);\n                case 216 /* BinaryExpression */:\n                    if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) {\n                        return transformNullishCoalescingExpression(node);\n                    }\n                    return ts.visitEachChild(node, visitor, context);\n                case 210 /* DeleteExpression */:\n                    return visitDeleteExpression(node);\n                default:\n                    return ts.visitEachChild(node, visitor, context);\n            }\n        }\n        function flattenChain(chain) {\n            ts.Debug.assertNotNode(chain, ts.isNonNullChain);\n            var links = [chain];\n            while (!chain.questionDotToken && !ts.isTaggedTemplateExpression(chain)) {\n                chain = ts.cast(ts.skipPartiallyEmittedExpressions(chain.expression), ts.isOptionalChain);\n                ts.Debug.assertNotNode(chain, ts.isNonNullChain);\n                links.unshift(chain);\n            }\n            return { expression: chain.expression, chain: links };\n        }\n        function visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete) {\n            var expression = visitNonOptionalExpression(node.expression, captureThisArg, isDelete);\n            if (ts.isSyntheticReference(expression)) {\n                // `(a.b)` -> { expression `((_a = a).b)`, thisArg: `_a` }\n                // `(a[b])` -> { expression `((_a = a)[b])`, thisArg: `_a` }\n                return factory.createSyntheticReferenceExpression(factory.updateParenthesizedExpression(node, expression.expression), expression.thisArg);\n            }\n            return factory.updateParenthesizedExpression(node, expression);\n        }\n        function visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete) {\n            if (ts.isOptionalChain(node)) {\n                // If `node` is an optional chain, then it is the outermost chain of an optional expression.\n                return visitOptionalExpression(node, captureThisArg, isDelete);\n            }\n            var expression = ts.visitNode(node.expression, visitor, ts.isExpression);\n            ts.Debug.assertNotNode(expression, ts.isSyntheticReference);\n            var thisArg;\n            if (captureThisArg) {\n                if (!ts.isSimpleCopiableExpression(expression)) {\n                    thisArg = factory.createTempVariable(hoistVariableDeclaration);\n                    expression = factory.createAssignment(thisArg, expression);\n                }\n                else {\n                    thisArg = expression;\n                }\n            }\n            expression = node.kind === 201 /* PropertyAccessExpression */\n                ? factory.updatePropertyAccessExpression(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier))\n                : factory.updateElementAccessExpression(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression));\n            return thisArg ? factory.createSyntheticReferenceExpression(expression, thisArg) : expression;\n        }\n        function visitNonOptionalCallExpression(node, captureThisArg) {\n            if (ts.isOptionalChain(node)) {\n                // If `node` is an optional chain, then it is the outermost chain of an optional expression.\n                return visitOptionalExpression(node, captureThisArg, /*isDelete*/ false);\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitNonOptionalExpression(node, captureThisArg, isDelete) {\n            switch (node.kind) {\n                case 207 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete);\n                case 201 /* PropertyAccessExpression */:\n                case 202 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete);\n                case 203 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg);\n                default: return ts.visitNode(node, visitor, ts.isExpression);\n            }\n        }\n        function visitOptionalExpression(node, captureThisArg, isDelete) {\n            var _a = flattenChain(node), expression = _a.expression, chain = _a.chain;\n            var left = visitNonOptionalExpression(expression, ts.isCallChain(chain[0]), /*isDelete*/ false);\n            var leftThisArg = ts.isSyntheticReference(left) ? left.thisArg : undefined;\n            var leftExpression = ts.isSyntheticReference(left) ? left.expression : left;\n            var capturedLeft = leftExpression;\n            if (!ts.isSimpleCopiableExpression(leftExpression)) {\n                capturedLeft = factory.createTempVariable(hoistVariableDeclaration);\n                leftExpression = factory.createAssignment(capturedLeft, leftExpression);\n            }\n            var rightExpression = capturedLeft;\n            var thisArg;\n            for (var i = 0; i < chain.length; i++) {\n                var segment = chain[i];\n                switch (segment.kind) {\n                    case 201 /* PropertyAccessExpression */:\n                    case 202 /* ElementAccessExpression */:\n                        if (i === chain.length - 1 && captureThisArg) {\n                            if (!ts.isSimpleCopiableExpression(rightExpression)) {\n                                thisArg = factory.createTempVariable(hoistVariableDeclaration);\n                                rightExpression = factory.createAssignment(thisArg, rightExpression);\n                            }\n                            else {\n                                thisArg = rightExpression;\n                            }\n                        }\n                        rightExpression = segment.kind === 201 /* PropertyAccessExpression */\n                            ? factory.createPropertyAccessExpression(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier))\n                            : factory.createElementAccessExpression(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression));\n                        break;\n                    case 203 /* CallExpression */:\n                        if (i === 0 && leftThisArg) {\n                            rightExpression = factory.createFunctionCallCall(rightExpression, leftThisArg.kind === 105 /* SuperKeyword */ ? factory.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression));\n                        }\n                        else {\n                            rightExpression = factory.createCallExpression(rightExpression, \n                            /*typeArguments*/ undefined, ts.visitNodes(segment.arguments, visitor, ts.isExpression));\n                        }\n                        break;\n                }\n                ts.setOriginalNode(rightExpression, segment);\n            }\n            var target = isDelete\n                ? factory.createConditionalExpression(createNotNullCondition(leftExpression, capturedLeft, /*invert*/ true), /*questionToken*/ undefined, factory.createTrue(), /*colonToken*/ undefined, factory.createDeleteExpression(rightExpression))\n                : factory.createConditionalExpression(createNotNullCondition(leftExpression, capturedLeft, /*invert*/ true), /*questionToken*/ undefined, factory.createVoidZero(), /*colonToken*/ undefined, rightExpression);\n            ts.setTextRange(target, node);\n            return thisArg ? factory.createSyntheticReferenceExpression(target, thisArg) : target;\n        }\n        function createNotNullCondition(left, right, invert) {\n            return factory.createBinaryExpression(factory.createBinaryExpression(left, factory.createToken(invert ? 36 /* EqualsEqualsEqualsToken */ : 37 /* ExclamationEqualsEqualsToken */), factory.createNull()), factory.createToken(invert ? 56 /* BarBarToken */ : 55 /* AmpersandAmpersandToken */), factory.createBinaryExpression(right, factory.createToken(invert ? 36 /* EqualsEqualsEqualsToken */ : 37 /* ExclamationEqualsEqualsToken */), factory.createVoidZero()));\n        }\n        function transformNullishCoalescingExpression(node) {\n            var left = ts.visitNode(node.left, visitor, ts.isExpression);\n            var right = left;\n            if (!ts.isSimpleCopiableExpression(left)) {\n                right = factory.createTempVariable(hoistVariableDeclaration);\n                left = factory.createAssignment(right, left);\n            }\n            return ts.setTextRange(factory.createConditionalExpression(createNotNullCondition(left, right), \n            /*questionToken*/ undefined, right, \n            /*colonToken*/ undefined, ts.visitNode(node.right, visitor, ts.isExpression)), node);\n        }\n        function visitDeleteExpression(node) {\n            return ts.isOptionalChain(ts.skipParentheses(node.expression))\n                ? ts.setOriginalNode(visitNonOptionalExpression(node.expression, /*captureThisArg*/ false, /*isDelete*/ true), node)\n                : factory.updateDeleteExpression(node, ts.visitNode(node.expression, visitor, ts.isExpression));\n        }\n    }\n    ts.transformES2020 = transformES2020;\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    function transformESNext(context) {\n        var hoistVariableDeclaration = context.hoistVariableDeclaration, factory = context.factory;\n        return ts.chainBundle(context, transformSourceFile);\n        function transformSourceFile(node) {\n            if (node.isDeclarationFile) {\n                return node;\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitor(node) {\n            if ((node.transformFlags & 4 /* ContainsESNext */) === 0) {\n                return node;\n            }\n            switch (node.kind) {\n                case 216 /* BinaryExpression */:\n                    var binaryExpression = node;\n                    if (ts.isLogicalOrCoalescingAssignmentExpression(binaryExpression)) {\n                        return transformLogicalAssignment(binaryExpression);\n                    }\n                // falls through\n                default:\n                    return ts.visitEachChild(node, visitor, context);\n            }\n        }\n        function transformLogicalAssignment(binaryExpression) {\n            var operator = binaryExpression.operatorToken;\n            var nonAssignmentOperator = ts.getNonAssignmentOperatorForCompoundAssignment(operator.kind);\n            var left = ts.skipParentheses(ts.visitNode(binaryExpression.left, visitor, ts.isLeftHandSideExpression));\n            var assignmentTarget = left;\n            var right = ts.skipParentheses(ts.visitNode(binaryExpression.right, visitor, ts.isExpression));\n            if (ts.isAccessExpression(left)) {\n                var propertyAccessTargetSimpleCopiable = ts.isSimpleCopiableExpression(left.expression);\n                var propertyAccessTarget = propertyAccessTargetSimpleCopiable ? left.expression :\n                    factory.createTempVariable(hoistVariableDeclaration);\n                var propertyAccessTargetAssignment = propertyAccessTargetSimpleCopiable ? left.expression : factory.createAssignment(propertyAccessTarget, left.expression);\n                if (ts.isPropertyAccessExpression(left)) {\n                    assignmentTarget = factory.createPropertyAccessExpression(propertyAccessTarget, left.name);\n                    left = factory.createPropertyAccessExpression(propertyAccessTargetAssignment, left.name);\n                }\n                else {\n                    var elementAccessArgumentSimpleCopiable = ts.isSimpleCopiableExpression(left.argumentExpression);\n                    var elementAccessArgument = elementAccessArgumentSimpleCopiable ? left.argumentExpression :\n                        factory.createTempVariable(hoistVariableDeclaration);\n                    assignmentTarget = factory.createElementAccessExpression(propertyAccessTarget, elementAccessArgument);\n                    left = factory.createElementAccessExpression(propertyAccessTargetAssignment, elementAccessArgumentSimpleCopiable ? left.argumentExpression : factory.createAssignment(elementAccessArgument, left.argumentExpression));\n                }\n            }\n            return factory.createBinaryExpression(left, nonAssignmentOperator, factory.createParenthesizedExpression(factory.createAssignment(assignmentTarget, right)));\n        }\n    }\n    ts.transformESNext = transformESNext;\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    function transformJsx(context) {\n        var factory = context.factory, emitHelpers = context.getEmitHelperFactory;\n        var compilerOptions = context.getCompilerOptions();\n        var currentSourceFile;\n        var currentFileState;\n        return ts.chainBundle(context, transformSourceFile);\n        function getCurrentFileNameExpression() {\n            if (currentFileState.filenameDeclaration) {\n                return currentFileState.filenameDeclaration.name;\n            }\n            var declaration = factory.createVariableDeclaration(factory.createUniqueName(\"_jsxFileName\", 16 /* Optimistic */ | 32 /* FileLevel */), /*exclaimationToken*/ undefined, /*type*/ undefined, factory.createStringLiteral(currentSourceFile.fileName));\n            currentFileState.filenameDeclaration = declaration;\n            return currentFileState.filenameDeclaration.name;\n        }\n        function getJsxFactoryCalleePrimitive(childrenLength) {\n            return compilerOptions.jsx === 5 /* ReactJSXDev */ ? \"jsxDEV\" : childrenLength > 1 ? \"jsxs\" : \"jsx\";\n        }\n        function getJsxFactoryCallee(childrenLength) {\n            var type = getJsxFactoryCalleePrimitive(childrenLength);\n            return getImplicitImportForName(type);\n        }\n        function getImplicitJsxFragmentReference() {\n            return getImplicitImportForName(\"Fragment\");\n        }\n        function getImplicitImportForName(name) {\n            var _a, _b;\n            var importSource = name === \"createElement\"\n                ? currentFileState.importSpecifier\n                : ts.getJSXRuntimeImport(currentFileState.importSpecifier, compilerOptions);\n            var existing = (_b = (_a = currentFileState.utilizedImplicitRuntimeImports) === null || _a === void 0 ? void 0 : _a.get(importSource)) === null || _b === void 0 ? void 0 : _b.get(name);\n            if (existing) {\n                return existing.name;\n            }\n            if (!currentFileState.utilizedImplicitRuntimeImports) {\n                currentFileState.utilizedImplicitRuntimeImports = ts.createMap();\n            }\n            var specifierSourceImports = currentFileState.utilizedImplicitRuntimeImports.get(importSource);\n            if (!specifierSourceImports) {\n                specifierSourceImports = ts.createMap();\n                currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);\n            }\n            var generatedName = factory.createUniqueName(\"_\" + name, 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);\n            var specifier = factory.createImportSpecifier(factory.createIdentifier(name), generatedName);\n            generatedName.generatedImportReference = specifier;\n            specifierSourceImports.set(name, specifier);\n            return generatedName;\n        }\n        /**\n         * Transform JSX-specific syntax in a SourceFile.\n         *\n         * @param node A SourceFile node.\n         */\n        function transformSourceFile(node) {\n            if (node.isDeclarationFile) {\n                return node;\n            }\n            currentSourceFile = node;\n            currentFileState = {};\n            currentFileState.importSpecifier = ts.getJSXImplicitImportBase(compilerOptions, node);\n            var visited = ts.visitEachChild(node, visitor, context);\n            ts.addEmitHelpers(visited, context.readEmitHelpers());\n            var statements = visited.statements;\n            if (currentFileState.filenameDeclaration) {\n                statements = ts.insertStatementAfterCustomPrologue(statements.slice(), factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([currentFileState.filenameDeclaration], 2 /* Const */)));\n            }\n            if (currentFileState.utilizedImplicitRuntimeImports) {\n                for (var _i = 0, _a = ts.arrayFrom(currentFileState.utilizedImplicitRuntimeImports.entries()); _i < _a.length; _i++) {\n                    var _b = _a[_i], importSource = _b[0], importSpecifiersMap = _b[1];\n                    if (ts.isExternalModule(node)) {\n                        // Add `import` statement\n                        var importStatement = factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, factory.createImportClause(/*typeOnly*/ false, /*name*/ undefined, factory.createNamedImports(ts.arrayFrom(importSpecifiersMap.values()))), factory.createStringLiteral(importSource));\n                        ts.setParentRecursive(importStatement, /*incremental*/ false);\n                        statements = ts.insertStatementAfterCustomPrologue(statements.slice(), importStatement);\n                    }\n                    else if (ts.isExternalOrCommonJsModule(node)) {\n                        // Add `require` statement\n                        var requireStatement = factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([\n                            factory.createVariableDeclaration(factory.createObjectBindingPattern(ts.map(ts.arrayFrom(importSpecifiersMap.values()), function (s) { return factory.createBindingElement(/*dotdotdot*/ undefined, s.propertyName, s.name); })), \n                            /*exclaimationToken*/ undefined, \n                            /*type*/ undefined, factory.createCallExpression(factory.createIdentifier(\"require\"), /*typeArguments*/ undefined, [factory.createStringLiteral(importSource)]))\n                        ], 2 /* Const */));\n                        ts.setParentRecursive(requireStatement, /*incremental*/ false);\n                        statements = ts.insertStatementAfterCustomPrologue(statements.slice(), requireStatement);\n                    }\n                    else {\n                        // Do nothing (script file) - consider an error in the checker?\n                    }\n                }\n            }\n            if (statements !== visited.statements) {\n                visited = factory.updateSourceFile(visited, statements);\n            }\n            currentFileState = undefined;\n            return visited;\n        }\n        function visitor(node) {\n            if (node.transformFlags & 2 /* ContainsJsx */) {\n                return visitorWorker(node);\n            }\n            else {\n                return node;\n            }\n        }\n        function visitorWorker(node) {\n            switch (node.kind) {\n                case 273 /* JsxElement */:\n                    return visitJsxElement(node, /*isChild*/ false);\n                case 274 /* JsxSelfClosingElement */:\n                    return visitJsxSelfClosingElement(node, /*isChild*/ false);\n                case 277 /* JsxFragment */:\n                    return visitJsxFragment(node, /*isChild*/ false);\n                case 283 /* JsxExpression */:\n                    return visitJsxExpression(node);\n                default:\n                    return ts.visitEachChild(node, visitor, context);\n            }\n        }\n        function transformJsxChildToExpression(node) {\n            switch (node.kind) {\n                case 11 /* JsxText */:\n                    return visitJsxText(node);\n                case 283 /* JsxExpression */:\n                    return visitJsxExpression(node);\n                case 273 /* JsxElement */:\n                    return visitJsxElement(node, /*isChild*/ true);\n                case 274 /* JsxSelfClosingElement */:\n                    return visitJsxSelfClosingElement(node, /*isChild*/ true);\n                case 277 /* JsxFragment */:\n                    return visitJsxFragment(node, /*isChild*/ true);\n                default:\n                    return ts.Debug.failBadSyntaxKind(node);\n            }\n        }\n        /**\n         * The react jsx/jsxs transform falls back to `createElement` when an explicit `key` argument comes after a spread\n         */\n        function hasKeyAfterPropsSpread(node) {\n            var spread = false;\n            for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) {\n                var elem = _a[_i];\n                if (ts.isJsxSpreadAttribute(elem)) {\n                    spread = true;\n                }\n                else if (spread && ts.isJsxAttribute(elem) && elem.name.escapedText === \"key\") {\n                    return true;\n                }\n            }\n            return false;\n        }\n        function shouldUseCreateElement(node) {\n            return currentFileState.importSpecifier === undefined || hasKeyAfterPropsSpread(node);\n        }\n        function visitJsxElement(node, isChild) {\n            var tagTransform = shouldUseCreateElement(node.openingElement) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX;\n            return tagTransform(node.openingElement, node.children, isChild, /*location*/ node);\n        }\n        function visitJsxSelfClosingElement(node, isChild) {\n            var tagTransform = shouldUseCreateElement(node) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX;\n            return tagTransform(node, /*children*/ undefined, isChild, /*location*/ node);\n        }\n        function visitJsxFragment(node, isChild) {\n            var tagTransform = currentFileState.importSpecifier === undefined ? visitJsxOpeningFragmentCreateElement : visitJsxOpeningFragmentJSX;\n            return tagTransform(node.openingFragment, node.children, isChild, /*location*/ node);\n        }\n        function convertJsxChildrenToChildrenPropObject(children) {\n            var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);\n            if (ts.length(nonWhitespaceChildren) === 1) {\n                var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]);\n                return result_13 && factory.createObjectLiteralExpression([\n                    factory.createPropertyAssignment(\"children\", result_13)\n                ]);\n            }\n            var result = ts.mapDefined(children, transformJsxChildToExpression);\n            return !result.length ? undefined : factory.createObjectLiteralExpression([\n                factory.createPropertyAssignment(\"children\", factory.createArrayLiteralExpression(result))\n            ]);\n        }\n        function visitJsxOpeningLikeElementJSX(node, children, isChild, location) {\n            var tagName = getTagName(node);\n            var objectProperties;\n            var keyAttr = ts.find(node.attributes.properties, function (p) { return !!p.name && ts.isIdentifier(p.name) && p.name.escapedText === \"key\"; });\n            var attrs = keyAttr ? ts.filter(node.attributes.properties, function (p) { return p !== keyAttr; }) : node.attributes.properties;\n            var segments = [];\n            if (attrs.length) {\n                // Map spans of JsxAttribute nodes into object literals and spans\n                // of JsxSpreadAttribute nodes into expressions.\n                segments = ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) { return isSpread\n                    ? ts.map(attrs, transformJsxSpreadAttributeToExpression)\n                    : factory.createObjectLiteralExpression(ts.map(attrs, transformJsxAttributeToObjectLiteralElement)); }));\n                if (ts.isJsxSpreadAttribute(attrs[0])) {\n                    // We must always emit at least one object literal before a spread\n                    // argument.factory.createObjectLiteral\n                    segments.unshift(factory.createObjectLiteralExpression());\n                }\n            }\n            if (children && children.length) {\n                var result = convertJsxChildrenToChildrenPropObject(children);\n                if (result) {\n                    segments.push(result);\n                }\n            }\n            if (segments.length === 0) {\n                objectProperties = factory.createObjectLiteralExpression([]);\n                // When there are no attributes, React wants {}\n            }\n            else {\n                // Either emit one big object literal (no spread attribs), or\n                // a call to the __assign helper.\n                objectProperties = ts.singleOrUndefined(segments) || emitHelpers().createAssignHelper(segments);\n            }\n            return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, ts.length(ts.getSemanticJsxChildren(children || ts.emptyArray)), isChild, location);\n        }\n        function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, childrenLength, isChild, location) {\n            var args = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)];\n            if (compilerOptions.jsx === 5 /* ReactJSXDev */) {\n                var originalFile = ts.getOriginalNode(currentSourceFile);\n                if (originalFile && ts.isSourceFile(originalFile)) {\n                    // isStaticChildren development flag\n                    args.push(childrenLength > 1 ? factory.createTrue() : factory.createFalse());\n                    // __source development flag\n                    var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos);\n                    args.push(factory.createObjectLiteralExpression([\n                        factory.createPropertyAssignment(\"fileName\", getCurrentFileNameExpression()),\n                        factory.createPropertyAssignment(\"lineNumber\", factory.createNumericLiteral(lineCol.line + 1)),\n                        factory.createPropertyAssignment(\"columnNumber\", factory.createNumericLiteral(lineCol.character + 1))\n                    ]));\n                    // __self development flag\n                    args.push(factory.createThis());\n                }\n            }\n            var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(childrenLength), /*typeArguments*/ undefined, args), location);\n            if (isChild) {\n                ts.startOnNewLine(element);\n            }\n            return element;\n        }\n        function visitJsxOpeningLikeElementCreateElement(node, children, isChild, location) {\n            var tagName = getTagName(node);\n            var objectProperties;\n            var attrs = node.attributes.properties;\n            if (attrs.length === 0) {\n                objectProperties = factory.createNull();\n                // When there are no attributes, React wants \"null\"\n            }\n            else {\n                // Map spans of JsxAttribute nodes into object literals and spans\n                // of JsxSpreadAttribute nodes into expressions.\n                var segments = ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) { return isSpread\n                    ? ts.map(attrs, transformJsxSpreadAttributeToExpression)\n                    : factory.createObjectLiteralExpression(ts.map(attrs, transformJsxAttributeToObjectLiteralElement)); }));\n                if (ts.isJsxSpreadAttribute(attrs[0])) {\n                    // We must always emit at least one object literal before a spread\n                    // argument.factory.createObjectLiteral\n                    segments.unshift(factory.createObjectLiteralExpression());\n                }\n                // Either emit one big object literal (no spread attribs), or\n                // a call to the __assign helper.\n                objectProperties = ts.singleOrUndefined(segments);\n                if (!objectProperties) {\n                    objectProperties = emitHelpers().createAssignHelper(segments);\n                }\n            }\n            var callee = currentFileState.importSpecifier === undefined\n                ? ts.createJsxFactoryExpression(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217\n                node)\n                : getImplicitImportForName(\"createElement\");\n            var element = ts.createExpressionForJsxElement(factory, callee, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), location);\n            if (isChild) {\n                ts.startOnNewLine(element);\n            }\n            return element;\n        }\n        function visitJsxOpeningFragmentJSX(_node, children, isChild, location) {\n            var childrenProps;\n            if (children && children.length) {\n                var result = convertJsxChildrenToChildrenPropObject(children);\n                if (result) {\n                    childrenProps = result;\n                }\n            }\n            return visitJsxOpeningLikeElementOrFragmentJSX(getImplicitJsxFragmentReference(), childrenProps || factory.createObjectLiteralExpression([]), \n            /*keyAttr*/ undefined, ts.length(ts.getSemanticJsxChildren(children)), isChild, location);\n        }\n        function visitJsxOpeningFragmentCreateElement(node, children, isChild, location) {\n            var element = ts.createExpressionForJsxFragment(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), context.getEmitResolver().getJsxFragmentFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217\n            ts.mapDefined(children, transformJsxChildToExpression), node, location);\n            if (isChild) {\n                ts.startOnNewLine(element);\n            }\n            return element;\n        }\n        function transformJsxSpreadAttributeToExpression(node) {\n            return ts.visitNode(node.expression, visitor, ts.isExpression);\n        }\n        function transformJsxAttributeToObjectLiteralElement(node) {\n            var name = getAttributeName(node);\n            var expression = transformJsxAttributeInitializer(node.initializer);\n            return factory.createPropertyAssignment(name, expression);\n        }\n        function transformJsxAttributeInitializer(node) {\n            if (node === undefined) {\n                return factory.createTrue();\n            }\n            else if (node.kind === 10 /* StringLiteral */) {\n                // Always recreate the literal to escape any escape sequences or newlines which may be in the original jsx string and which\n                // Need to be escaped to be handled correctly in a normal string\n                var singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile);\n                var literal = factory.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote);\n                return ts.setTextRange(literal, node);\n            }\n            else if (node.kind === 283 /* JsxExpression */) {\n                if (node.expression === undefined) {\n                    return factory.createTrue();\n                }\n                return ts.visitNode(node.expression, visitor, ts.isExpression);\n            }\n            else {\n                return ts.Debug.failBadSyntaxKind(node);\n            }\n        }\n        function visitJsxText(node) {\n            var fixed = fixupWhitespaceAndDecodeEntities(node.text);\n            return fixed === undefined ? undefined : factory.createStringLiteral(fixed);\n        }\n        /**\n         * JSX trims whitespace at the end and beginning of lines, except that the\n         * start/end of a tag is considered a start/end of a line only if that line is\n         * on the same line as the closing tag. See examples in\n         * tests/cases/conformance/jsx/tsxReactEmitWhitespace.tsx\n         * See also https://www.w3.org/TR/html4/struct/text.html#h-9.1 and https://www.w3.org/TR/CSS2/text.html#white-space-model\n         *\n         * An equivalent algorithm would be:\n         * - If there is only one line, return it.\n         * - If there is only whitespace (but multiple lines), return `undefined`.\n         * - Split the text into lines.\n         * - 'trimRight' the first line, 'trimLeft' the last line, 'trim' middle lines.\n         * - Decode entities on each line (individually).\n         * - Remove empty lines and join the rest with \" \".\n         */\n        function fixupWhitespaceAndDecodeEntities(text) {\n            var acc;\n            // First non-whitespace character on this line.\n            var firstNonWhitespace = 0;\n            // Last non-whitespace character on this line.\n            var lastNonWhitespace = -1;\n            // These initial values are special because the first line is:\n            // firstNonWhitespace = 0 to indicate that we want leading whitsepace,\n            // but lastNonWhitespace = -1 as a special flag to indicate that we *don't* include the line if it's all whitespace.\n            for (var i = 0; i < text.length; i++) {\n                var c = text.charCodeAt(i);\n                if (ts.isLineBreak(c)) {\n                    // If we've seen any non-whitespace characters on this line, add the 'trim' of the line.\n                    // (lastNonWhitespace === -1 is a special flag to detect whether the first line is all whitespace.)\n                    if (firstNonWhitespace !== -1 && lastNonWhitespace !== -1) {\n                        acc = addLineOfJsxText(acc, text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1));\n                    }\n                    // Reset firstNonWhitespace for the next line.\n                    // Don't bother to reset lastNonWhitespace because we ignore it if firstNonWhitespace = -1.\n                    firstNonWhitespace = -1;\n                }\n                else if (!ts.isWhiteSpaceSingleLine(c)) {\n                    lastNonWhitespace = i;\n                    if (firstNonWhitespace === -1) {\n                        firstNonWhitespace = i;\n                    }\n                }\n            }\n            return firstNonWhitespace !== -1\n                // Last line had a non-whitespace character. Emit the 'trimLeft', meaning keep trailing whitespace.\n                ? addLineOfJsxText(acc, text.substr(firstNonWhitespace))\n                // Last line was all whitespace, so ignore it\n                : acc;\n        }\n        function addLineOfJsxText(acc, trimmedLine) {\n            // We do not escape the string here as that is handled by the printer\n            // when it emits the literal. We do, however, need to decode JSX entities.\n            var decoded = decodeEntities(trimmedLine);\n            return acc === undefined ? decoded : acc + \" \" + decoded;\n        }\n        /**\n         * Replace entities like \"&nbsp;\", \"&#123;\", and \"&#xDEADBEEF;\" with the characters they encode.\n         * See https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references\n         */\n        function decodeEntities(text) {\n            return text.replace(/&((#((\\d+)|x([\\da-fA-F]+)))|(\\w+));/g, function (match, _all, _number, _digits, decimal, hex, word) {\n                if (decimal) {\n                    return ts.utf16EncodeAsString(parseInt(decimal, 10));\n                }\n                else if (hex) {\n                    return ts.utf16EncodeAsString(parseInt(hex, 16));\n                }\n                else {\n                    var ch = entities.get(word);\n                    // If this is not a valid entity, then just use `match` (replace it with itself, i.e. don't replace)\n                    return ch ? ts.utf16EncodeAsString(ch) : match;\n                }\n            });\n        }\n        /** Like `decodeEntities` but returns `undefined` if there were no entities to decode. */\n        function tryDecodeEntities(text) {\n            var decoded = decodeEntities(text);\n            return decoded === text ? undefined : decoded;\n        }\n        function getTagName(node) {\n            if (node.kind === 273 /* JsxElement */) {\n                return getTagName(node.openingElement);\n            }\n            else {\n                var name = node.tagName;\n                if (ts.isIdentifier(name) && ts.isIntrinsicJsxName(name.escapedText)) {\n                    return factory.createStringLiteral(ts.idText(name));\n                }\n                else {\n                    return ts.createExpressionFromEntityName(factory, name);\n                }\n            }\n        }\n        /**\n         * Emit an attribute name, which is quoted if it needs to be quoted. Because\n         * these emit into an object literal property name, we don't need to be worried\n         * about keywords, just non-identifier characters\n         */\n        function getAttributeName(node) {\n            var name = node.name;\n            var text = ts.idText(name);\n            if (/^[A-Za-z_]\\w*$/.test(text)) {\n                return name;\n            }\n            else {\n                return factory.createStringLiteral(text);\n            }\n        }\n        function visitJsxExpression(node) {\n            return ts.visitNode(node.expression, visitor, ts.isExpression);\n        }\n    }\n    ts.transformJsx = transformJsx;\n    var entities = new ts.Map(ts.getEntries({\n        quot: 0x0022,\n        amp: 0x0026,\n        apos: 0x0027,\n        lt: 0x003C,\n        gt: 0x003E,\n        nbsp: 0x00A0,\n        iexcl: 0x00A1,\n        cent: 0x00A2,\n        pound: 0x00A3,\n        curren: 0x00A4,\n        yen: 0x00A5,\n        brvbar: 0x00A6,\n        sect: 0x00A7,\n        uml: 0x00A8,\n        copy: 0x00A9,\n        ordf: 0x00AA,\n        laquo: 0x00AB,\n        not: 0x00AC,\n        shy: 0x00AD,\n        reg: 0x00AE,\n        macr: 0x00AF,\n        deg: 0x00B0,\n        plusmn: 0x00B1,\n        sup2: 0x00B2,\n        sup3: 0x00B3,\n        acute: 0x00B4,\n        micro: 0x00B5,\n        para: 0x00B6,\n        middot: 0x00B7,\n        cedil: 0x00B8,\n        sup1: 0x00B9,\n        ordm: 0x00BA,\n        raquo: 0x00BB,\n        frac14: 0x00BC,\n        frac12: 0x00BD,\n        frac34: 0x00BE,\n        iquest: 0x00BF,\n        Agrave: 0x00C0,\n        Aacute: 0x00C1,\n        Acirc: 0x00C2,\n        Atilde: 0x00C3,\n        Auml: 0x00C4,\n        Aring: 0x00C5,\n        AElig: 0x00C6,\n        Ccedil: 0x00C7,\n        Egrave: 0x00C8,\n        Eacute: 0x00C9,\n        Ecirc: 0x00CA,\n        Euml: 0x00CB,\n        Igrave: 0x00CC,\n        Iacute: 0x00CD,\n        Icirc: 0x00CE,\n        Iuml: 0x00CF,\n        ETH: 0x00D0,\n        Ntilde: 0x00D1,\n        Ograve: 0x00D2,\n        Oacute: 0x00D3,\n        Ocirc: 0x00D4,\n        Otilde: 0x00D5,\n        Ouml: 0x00D6,\n        times: 0x00D7,\n        Oslash: 0x00D8,\n        Ugrave: 0x00D9,\n        Uacute: 0x00DA,\n        Ucirc: 0x00DB,\n        Uuml: 0x00DC,\n        Yacute: 0x00DD,\n        THORN: 0x00DE,\n        szlig: 0x00DF,\n        agrave: 0x00E0,\n        aacute: 0x00E1,\n        acirc: 0x00E2,\n        atilde: 0x00E3,\n        auml: 0x00E4,\n        aring: 0x00E5,\n        aelig: 0x00E6,\n        ccedil: 0x00E7,\n        egrave: 0x00E8,\n        eacute: 0x00E9,\n        ecirc: 0x00EA,\n        euml: 0x00EB,\n        igrave: 0x00EC,\n        iacute: 0x00ED,\n        icirc: 0x00EE,\n        iuml: 0x00EF,\n        eth: 0x00F0,\n        ntilde: 0x00F1,\n        ograve: 0x00F2,\n        oacute: 0x00F3,\n        ocirc: 0x00F4,\n        otilde: 0x00F5,\n        ouml: 0x00F6,\n        divide: 0x00F7,\n        oslash: 0x00F8,\n        ugrave: 0x00F9,\n        uacute: 0x00FA,\n        ucirc: 0x00FB,\n        uuml: 0x00FC,\n        yacute: 0x00FD,\n        thorn: 0x00FE,\n        yuml: 0x00FF,\n        OElig: 0x0152,\n        oelig: 0x0153,\n        Scaron: 0x0160,\n        scaron: 0x0161,\n        Yuml: 0x0178,\n        fnof: 0x0192,\n        circ: 0x02C6,\n        tilde: 0x02DC,\n        Alpha: 0x0391,\n        Beta: 0x0392,\n        Gamma: 0x0393,\n        Delta: 0x0394,\n        Epsilon: 0x0395,\n        Zeta: 0x0396,\n        Eta: 0x0397,\n        Theta: 0x0398,\n        Iota: 0x0399,\n        Kappa: 0x039A,\n        Lambda: 0x039B,\n        Mu: 0x039C,\n        Nu: 0x039D,\n        Xi: 0x039E,\n        Omicron: 0x039F,\n        Pi: 0x03A0,\n        Rho: 0x03A1,\n        Sigma: 0x03A3,\n        Tau: 0x03A4,\n        Upsilon: 0x03A5,\n        Phi: 0x03A6,\n        Chi: 0x03A7,\n        Psi: 0x03A8,\n        Omega: 0x03A9,\n        alpha: 0x03B1,\n        beta: 0x03B2,\n        gamma: 0x03B3,\n        delta: 0x03B4,\n        epsilon: 0x03B5,\n        zeta: 0x03B6,\n        eta: 0x03B7,\n        theta: 0x03B8,\n        iota: 0x03B9,\n        kappa: 0x03BA,\n        lambda: 0x03BB,\n        mu: 0x03BC,\n        nu: 0x03BD,\n        xi: 0x03BE,\n        omicron: 0x03BF,\n        pi: 0x03C0,\n        rho: 0x03C1,\n        sigmaf: 0x03C2,\n        sigma: 0x03C3,\n        tau: 0x03C4,\n        upsilon: 0x03C5,\n        phi: 0x03C6,\n        chi: 0x03C7,\n        psi: 0x03C8,\n        omega: 0x03C9,\n        thetasym: 0x03D1,\n        upsih: 0x03D2,\n        piv: 0x03D6,\n        ensp: 0x2002,\n        emsp: 0x2003,\n        thinsp: 0x2009,\n        zwnj: 0x200C,\n        zwj: 0x200D,\n        lrm: 0x200E,\n        rlm: 0x200F,\n        ndash: 0x2013,\n        mdash: 0x2014,\n        lsquo: 0x2018,\n        rsquo: 0x2019,\n        sbquo: 0x201A,\n        ldquo: 0x201C,\n        rdquo: 0x201D,\n        bdquo: 0x201E,\n        dagger: 0x2020,\n        Dagger: 0x2021,\n        bull: 0x2022,\n        hellip: 0x2026,\n        permil: 0x2030,\n        prime: 0x2032,\n        Prime: 0x2033,\n        lsaquo: 0x2039,\n        rsaquo: 0x203A,\n        oline: 0x203E,\n        frasl: 0x2044,\n        euro: 0x20AC,\n        image: 0x2111,\n        weierp: 0x2118,\n        real: 0x211C,\n        trade: 0x2122,\n        alefsym: 0x2135,\n        larr: 0x2190,\n        uarr: 0x2191,\n        rarr: 0x2192,\n        darr: 0x2193,\n        harr: 0x2194,\n        crarr: 0x21B5,\n        lArr: 0x21D0,\n        uArr: 0x21D1,\n        rArr: 0x21D2,\n        dArr: 0x21D3,\n        hArr: 0x21D4,\n        forall: 0x2200,\n        part: 0x2202,\n        exist: 0x2203,\n        empty: 0x2205,\n        nabla: 0x2207,\n        isin: 0x2208,\n        notin: 0x2209,\n        ni: 0x220B,\n        prod: 0x220F,\n        sum: 0x2211,\n        minus: 0x2212,\n        lowast: 0x2217,\n        radic: 0x221A,\n        prop: 0x221D,\n        infin: 0x221E,\n        ang: 0x2220,\n        and: 0x2227,\n        or: 0x2228,\n        cap: 0x2229,\n        cup: 0x222A,\n        int: 0x222B,\n        there4: 0x2234,\n        sim: 0x223C,\n        cong: 0x2245,\n        asymp: 0x2248,\n        ne: 0x2260,\n        equiv: 0x2261,\n        le: 0x2264,\n        ge: 0x2265,\n        sub: 0x2282,\n        sup: 0x2283,\n        nsub: 0x2284,\n        sube: 0x2286,\n        supe: 0x2287,\n        oplus: 0x2295,\n        otimes: 0x2297,\n        perp: 0x22A5,\n        sdot: 0x22C5,\n        lceil: 0x2308,\n        rceil: 0x2309,\n        lfloor: 0x230A,\n        rfloor: 0x230B,\n        lang: 0x2329,\n        rang: 0x232A,\n        loz: 0x25CA,\n        spades: 0x2660,\n        clubs: 0x2663,\n        hearts: 0x2665,\n        diams: 0x2666\n    }));\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    function transformES2016(context) {\n        var factory = context.factory, hoistVariableDeclaration = context.hoistVariableDeclaration;\n        return ts.chainBundle(context, transformSourceFile);\n        function transformSourceFile(node) {\n            if (node.isDeclarationFile) {\n                return node;\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitor(node) {\n            if ((node.transformFlags & 128 /* ContainsES2016 */) === 0) {\n                return node;\n            }\n            switch (node.kind) {\n                case 216 /* BinaryExpression */:\n                    return visitBinaryExpression(node);\n                default:\n                    return ts.visitEachChild(node, visitor, context);\n            }\n        }\n        function visitBinaryExpression(node) {\n            switch (node.operatorToken.kind) {\n                case 66 /* AsteriskAsteriskEqualsToken */:\n                    return visitExponentiationAssignmentExpression(node);\n                case 42 /* AsteriskAsteriskToken */:\n                    return visitExponentiationExpression(node);\n                default:\n                    return ts.visitEachChild(node, visitor, context);\n            }\n        }\n        function visitExponentiationAssignmentExpression(node) {\n            var target;\n            var value;\n            var left = ts.visitNode(node.left, visitor, ts.isExpression);\n            var right = ts.visitNode(node.right, visitor, ts.isExpression);\n            if (ts.isElementAccessExpression(left)) {\n                // Transforms `a[x] **= b` into `(_a = a)[_x = x] = Math.pow(_a[_x], b)`\n                var expressionTemp = factory.createTempVariable(hoistVariableDeclaration);\n                var argumentExpressionTemp = factory.createTempVariable(hoistVariableDeclaration);\n                target = ts.setTextRange(factory.createElementAccessExpression(ts.setTextRange(factory.createAssignment(expressionTemp, left.expression), left.expression), ts.setTextRange(factory.createAssignment(argumentExpressionTemp, left.argumentExpression), left.argumentExpression)), left);\n                value = ts.setTextRange(factory.createElementAccessExpression(expressionTemp, argumentExpressionTemp), left);\n            }\n            else if (ts.isPropertyAccessExpression(left)) {\n                // Transforms `a.x **= b` into `(_a = a).x = Math.pow(_a.x, b)`\n                var expressionTemp = factory.createTempVariable(hoistVariableDeclaration);\n                target = ts.setTextRange(factory.createPropertyAccessExpression(ts.setTextRange(factory.createAssignment(expressionTemp, left.expression), left.expression), left.name), left);\n                value = ts.setTextRange(factory.createPropertyAccessExpression(expressionTemp, left.name), left);\n            }\n            else {\n                // Transforms `a **= b` into `a = Math.pow(a, b)`\n                target = left;\n                value = left;\n            }\n            return ts.setTextRange(factory.createAssignment(target, ts.setTextRange(factory.createGlobalMethodCall(\"Math\", \"pow\", [value, right]), node)), node);\n        }\n        function visitExponentiationExpression(node) {\n            // Transforms `a ** b` into `Math.pow(a, b)`\n            var left = ts.visitNode(node.left, visitor, ts.isExpression);\n            var right = ts.visitNode(node.right, visitor, ts.isExpression);\n            return ts.setTextRange(factory.createGlobalMethodCall(\"Math\", \"pow\", [left, right]), node);\n        }\n    }\n    ts.transformES2016 = transformES2016;\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    var ES2015SubstitutionFlags;\n    (function (ES2015SubstitutionFlags) {\n        /** Enables substitutions for captured `this` */\n        ES2015SubstitutionFlags[ES2015SubstitutionFlags[\"CapturedThis\"] = 1] = \"CapturedThis\";\n        /** Enables substitutions for block-scoped bindings. */\n        ES2015SubstitutionFlags[ES2015SubstitutionFlags[\"BlockScopedBindings\"] = 2] = \"BlockScopedBindings\";\n    })(ES2015SubstitutionFlags || (ES2015SubstitutionFlags = {}));\n    var LoopOutParameterFlags;\n    (function (LoopOutParameterFlags) {\n        LoopOutParameterFlags[LoopOutParameterFlags[\"Body\"] = 1] = \"Body\";\n        LoopOutParameterFlags[LoopOutParameterFlags[\"Initializer\"] = 2] = \"Initializer\";\n    })(LoopOutParameterFlags || (LoopOutParameterFlags = {}));\n    var CopyDirection;\n    (function (CopyDirection) {\n        CopyDirection[CopyDirection[\"ToOriginal\"] = 0] = \"ToOriginal\";\n        CopyDirection[CopyDirection[\"ToOutParameter\"] = 1] = \"ToOutParameter\";\n    })(CopyDirection || (CopyDirection = {}));\n    var Jump;\n    (function (Jump) {\n        Jump[Jump[\"Break\"] = 2] = \"Break\";\n        Jump[Jump[\"Continue\"] = 4] = \"Continue\";\n        Jump[Jump[\"Return\"] = 8] = \"Return\";\n    })(Jump || (Jump = {}));\n    // Facts we track as we traverse the tree\n    var HierarchyFacts;\n    (function (HierarchyFacts) {\n        HierarchyFacts[HierarchyFacts[\"None\"] = 0] = \"None\";\n        //\n        // Ancestor facts\n        //\n        HierarchyFacts[HierarchyFacts[\"Function\"] = 1] = \"Function\";\n        HierarchyFacts[HierarchyFacts[\"ArrowFunction\"] = 2] = \"ArrowFunction\";\n        HierarchyFacts[HierarchyFacts[\"AsyncFunctionBody\"] = 4] = \"AsyncFunctionBody\";\n        HierarchyFacts[HierarchyFacts[\"NonStaticClassElement\"] = 8] = \"NonStaticClassElement\";\n        HierarchyFacts[HierarchyFacts[\"CapturesThis\"] = 16] = \"CapturesThis\";\n        HierarchyFacts[HierarchyFacts[\"ExportedVariableStatement\"] = 32] = \"ExportedVariableStatement\";\n        HierarchyFacts[HierarchyFacts[\"TopLevel\"] = 64] = \"TopLevel\";\n        HierarchyFacts[HierarchyFacts[\"Block\"] = 128] = \"Block\";\n        HierarchyFacts[HierarchyFacts[\"IterationStatement\"] = 256] = \"IterationStatement\";\n        HierarchyFacts[HierarchyFacts[\"IterationStatementBlock\"] = 512] = \"IterationStatementBlock\";\n        HierarchyFacts[HierarchyFacts[\"IterationContainer\"] = 1024] = \"IterationContainer\";\n        HierarchyFacts[HierarchyFacts[\"ForStatement\"] = 2048] = \"ForStatement\";\n        HierarchyFacts[HierarchyFacts[\"ForInOrForOfStatement\"] = 4096] = \"ForInOrForOfStatement\";\n        HierarchyFacts[HierarchyFacts[\"ConstructorWithCapturedSuper\"] = 8192] = \"ConstructorWithCapturedSuper\";\n        // NOTE: do not add more ancestor flags without also updating AncestorFactsMask below.\n        // NOTE: when adding a new ancestor flag, be sure to update the subtree flags below.\n        //\n        // Ancestor masks\n        //\n        HierarchyFacts[HierarchyFacts[\"AncestorFactsMask\"] = 16383] = \"AncestorFactsMask\";\n        // We are always in *some* kind of block scope, but only specific block-scope containers are\n        // top-level or Blocks.\n        HierarchyFacts[HierarchyFacts[\"BlockScopeIncludes\"] = 0] = \"BlockScopeIncludes\";\n        HierarchyFacts[HierarchyFacts[\"BlockScopeExcludes\"] = 7104] = \"BlockScopeExcludes\";\n        // A source file is a top-level block scope.\n        HierarchyFacts[HierarchyFacts[\"SourceFileIncludes\"] = 64] = \"SourceFileIncludes\";\n        HierarchyFacts[HierarchyFacts[\"SourceFileExcludes\"] = 8064] = \"SourceFileExcludes\";\n        // Functions, methods, and accessors are both new lexical scopes and new block scopes.\n        HierarchyFacts[HierarchyFacts[\"FunctionIncludes\"] = 65] = \"FunctionIncludes\";\n        HierarchyFacts[HierarchyFacts[\"FunctionExcludes\"] = 16286] = \"FunctionExcludes\";\n        HierarchyFacts[HierarchyFacts[\"AsyncFunctionBodyIncludes\"] = 69] = \"AsyncFunctionBodyIncludes\";\n        HierarchyFacts[HierarchyFacts[\"AsyncFunctionBodyExcludes\"] = 16278] = \"AsyncFunctionBodyExcludes\";\n        // Arrow functions are lexically scoped to their container, but are new block scopes.\n        HierarchyFacts[HierarchyFacts[\"ArrowFunctionIncludes\"] = 66] = \"ArrowFunctionIncludes\";\n        HierarchyFacts[HierarchyFacts[\"ArrowFunctionExcludes\"] = 15232] = \"ArrowFunctionExcludes\";\n        // Constructors are both new lexical scopes and new block scopes. Constructors are also\n        // always considered non-static members of a class.\n        HierarchyFacts[HierarchyFacts[\"ConstructorIncludes\"] = 73] = \"ConstructorIncludes\";\n        HierarchyFacts[HierarchyFacts[\"ConstructorExcludes\"] = 16278] = \"ConstructorExcludes\";\n        // 'do' and 'while' statements are not block scopes. We track that the subtree is contained\n        // within an IterationStatement to indicate whether the embedded statement is an\n        // IterationStatementBlock.\n        HierarchyFacts[HierarchyFacts[\"DoOrWhileStatementIncludes\"] = 1280] = \"DoOrWhileStatementIncludes\";\n        HierarchyFacts[HierarchyFacts[\"DoOrWhileStatementExcludes\"] = 0] = \"DoOrWhileStatementExcludes\";\n        // 'for' statements are new block scopes and have special handling for 'let' declarations.\n        HierarchyFacts[HierarchyFacts[\"ForStatementIncludes\"] = 3328] = \"ForStatementIncludes\";\n        HierarchyFacts[HierarchyFacts[\"ForStatementExcludes\"] = 5056] = \"ForStatementExcludes\";\n        // 'for-in' and 'for-of' statements are new block scopes and have special handling for\n        // 'let' declarations.\n        HierarchyFacts[HierarchyFacts[\"ForInOrForOfStatementIncludes\"] = 5376] = \"ForInOrForOfStatementIncludes\";\n        HierarchyFacts[HierarchyFacts[\"ForInOrForOfStatementExcludes\"] = 3008] = \"ForInOrForOfStatementExcludes\";\n        // Blocks (other than function bodies) are new block scopes.\n        HierarchyFacts[HierarchyFacts[\"BlockIncludes\"] = 128] = \"BlockIncludes\";\n        HierarchyFacts[HierarchyFacts[\"BlockExcludes\"] = 6976] = \"BlockExcludes\";\n        HierarchyFacts[HierarchyFacts[\"IterationStatementBlockIncludes\"] = 512] = \"IterationStatementBlockIncludes\";\n        HierarchyFacts[HierarchyFacts[\"IterationStatementBlockExcludes\"] = 7104] = \"IterationStatementBlockExcludes\";\n        //\n        // Subtree facts\n        //\n        HierarchyFacts[HierarchyFacts[\"NewTarget\"] = 16384] = \"NewTarget\";\n        HierarchyFacts[HierarchyFacts[\"CapturedLexicalThis\"] = 32768] = \"CapturedLexicalThis\";\n        //\n        // Subtree masks\n        //\n        HierarchyFacts[HierarchyFacts[\"SubtreeFactsMask\"] = -16384] = \"SubtreeFactsMask\";\n        HierarchyFacts[HierarchyFacts[\"ArrowFunctionSubtreeExcludes\"] = 0] = \"ArrowFunctionSubtreeExcludes\";\n        HierarchyFacts[HierarchyFacts[\"FunctionSubtreeExcludes\"] = 49152] = \"FunctionSubtreeExcludes\";\n    })(HierarchyFacts || (HierarchyFacts = {}));\n    function transformES2015(context) {\n        var factory = context.factory, emitHelpers = context.getEmitHelperFactory, startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration;\n        var compilerOptions = context.getCompilerOptions();\n        var resolver = context.getEmitResolver();\n        var previousOnSubstituteNode = context.onSubstituteNode;\n        var previousOnEmitNode = context.onEmitNode;\n        context.onEmitNode = onEmitNode;\n        context.onSubstituteNode = onSubstituteNode;\n        var currentSourceFile;\n        var currentText;\n        var hierarchyFacts;\n        var taggedTemplateStringDeclarations;\n        function recordTaggedTemplateString(temp) {\n            taggedTemplateStringDeclarations = ts.append(taggedTemplateStringDeclarations, factory.createVariableDeclaration(temp));\n        }\n        /**\n         * Used to track if we are emitting body of the converted loop\n         */\n        var convertedLoopState;\n        /**\n         * Keeps track of whether substitutions have been enabled for specific cases.\n         * They are persisted between each SourceFile transformation and should not\n         * be reset.\n         */\n        var enabledSubstitutions;\n        return ts.chainBundle(context, transformSourceFile);\n        function transformSourceFile(node) {\n            if (node.isDeclarationFile) {\n                return node;\n            }\n            currentSourceFile = node;\n            currentText = node.text;\n            var visited = visitSourceFile(node);\n            ts.addEmitHelpers(visited, context.readEmitHelpers());\n            currentSourceFile = undefined;\n            currentText = undefined;\n            taggedTemplateStringDeclarations = undefined;\n            hierarchyFacts = 0 /* None */;\n            return visited;\n        }\n        /**\n         * Sets the `HierarchyFacts` for this node prior to visiting this node's subtree, returning the facts set prior to modification.\n         * @param excludeFacts The existing `HierarchyFacts` to reset before visiting the subtree.\n         * @param includeFacts The new `HierarchyFacts` to set before visiting the subtree.\n         */\n        function enterSubtree(excludeFacts, includeFacts) {\n            var ancestorFacts = hierarchyFacts;\n            hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 16383 /* AncestorFactsMask */;\n            return ancestorFacts;\n        }\n        /**\n         * Restores the `HierarchyFacts` for this node's ancestor after visiting this node's\n         * subtree, propagating specific facts from the subtree.\n         * @param ancestorFacts The `HierarchyFacts` of the ancestor to restore after visiting the subtree.\n         * @param excludeFacts The existing `HierarchyFacts` of the subtree that should not be propagated.\n         * @param includeFacts The new `HierarchyFacts` of the subtree that should be propagated.\n         */\n        function exitSubtree(ancestorFacts, excludeFacts, includeFacts) {\n            hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -16384 /* SubtreeFactsMask */ | ancestorFacts;\n        }\n        function isReturnVoidStatementInConstructorWithCapturedSuper(node) {\n            return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0\n                && node.kind === 242 /* ReturnStatement */\n                && !node.expression;\n        }\n        function isOrMayContainReturnCompletion(node) {\n            return node.transformFlags & 1048576 /* ContainsHoistedDeclarationOrCompletion */\n                && (ts.isReturnStatement(node)\n                    || ts.isIfStatement(node)\n                    || ts.isWithStatement(node)\n                    || ts.isSwitchStatement(node)\n                    || ts.isCaseBlock(node)\n                    || ts.isCaseClause(node)\n                    || ts.isDefaultClause(node)\n                    || ts.isTryStatement(node)\n                    || ts.isCatchClause(node)\n                    || ts.isLabeledStatement(node)\n                    || ts.isIterationStatement(node, /*lookInLabeledStatements*/ false)\n                    || ts.isBlock(node));\n        }\n        function shouldVisitNode(node) {\n            return (node.transformFlags & 256 /* ContainsES2015 */) !== 0\n                || convertedLoopState !== undefined\n                || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && isOrMayContainReturnCompletion(node))\n                || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatement(node))\n                || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0;\n        }\n        function visitor(node) {\n            return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ false) : node;\n        }\n        function visitorWithUnusedExpressionResult(node) {\n            return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ true) : node;\n        }\n        function callExpressionVisitor(node) {\n            if (node.kind === 105 /* SuperKeyword */) {\n                return visitSuperKeyword(/*isExpressionOfCall*/ true);\n            }\n            return visitor(node);\n        }\n        function visitorWorker(node, expressionResultIsUnused) {\n            switch (node.kind) {\n                case 123 /* StaticKeyword */:\n                    return undefined; // elide static keyword\n                case 252 /* ClassDeclaration */:\n                    return visitClassDeclaration(node);\n                case 221 /* ClassExpression */:\n                    return visitClassExpression(node);\n                case 160 /* Parameter */:\n                    return visitParameter(node);\n                case 251 /* FunctionDeclaration */:\n                    return visitFunctionDeclaration(node);\n                case 209 /* ArrowFunction */:\n                    return visitArrowFunction(node);\n                case 208 /* FunctionExpression */:\n                    return visitFunctionExpression(node);\n                case 249 /* VariableDeclaration */:\n                    return visitVariableDeclaration(node);\n                case 78 /* Identifier */:\n                    return visitIdentifier(node);\n                case 250 /* VariableDeclarationList */:\n                    return visitVariableDeclarationList(node);\n                case 244 /* SwitchStatement */:\n                    return visitSwitchStatement(node);\n                case 258 /* CaseBlock */:\n                    return visitCaseBlock(node);\n                case 230 /* Block */:\n                    return visitBlock(node, /*isFunctionBody*/ false);\n                case 241 /* BreakStatement */:\n                case 240 /* ContinueStatement */:\n                    return visitBreakOrContinueStatement(node);\n                case 245 /* LabeledStatement */:\n                    return visitLabeledStatement(node);\n                case 235 /* DoStatement */:\n                case 236 /* WhileStatement */:\n                    return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined);\n                case 237 /* ForStatement */:\n                    return visitForStatement(node, /*outermostLabeledStatement*/ undefined);\n                case 238 /* ForInStatement */:\n                    return visitForInStatement(node, /*outermostLabeledStatement*/ undefined);\n                case 239 /* ForOfStatement */:\n                    return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined);\n                case 233 /* ExpressionStatement */:\n                    return visitExpressionStatement(node);\n                case 200 /* ObjectLiteralExpression */:\n                    return visitObjectLiteralExpression(node);\n                case 287 /* CatchClause */:\n                    return visitCatchClause(node);\n                case 289 /* ShorthandPropertyAssignment */:\n                    return visitShorthandPropertyAssignment(node);\n                case 158 /* ComputedPropertyName */:\n                    return visitComputedPropertyName(node);\n                case 199 /* ArrayLiteralExpression */:\n                    return visitArrayLiteralExpression(node);\n                case 203 /* CallExpression */:\n                    return visitCallExpression(node);\n                case 204 /* NewExpression */:\n                    return visitNewExpression(node);\n                case 207 /* ParenthesizedExpression */:\n                    return visitParenthesizedExpression(node, expressionResultIsUnused);\n                case 216 /* BinaryExpression */:\n                    return visitBinaryExpression(node, expressionResultIsUnused);\n                case 337 /* CommaListExpression */:\n                    return visitCommaListExpression(node, expressionResultIsUnused);\n                case 14 /* NoSubstitutionTemplateLiteral */:\n                case 15 /* TemplateHead */:\n                case 16 /* TemplateMiddle */:\n                case 17 /* TemplateTail */:\n                    return visitTemplateLiteral(node);\n                case 10 /* StringLiteral */:\n                    return visitStringLiteral(node);\n                case 8 /* NumericLiteral */:\n                    return visitNumericLiteral(node);\n                case 205 /* TaggedTemplateExpression */:\n                    return visitTaggedTemplateExpression(node);\n                case 218 /* TemplateExpression */:\n                    return visitTemplateExpression(node);\n                case 219 /* YieldExpression */:\n                    return visitYieldExpression(node);\n                case 220 /* SpreadElement */:\n                    return visitSpreadElement(node);\n                case 105 /* SuperKeyword */:\n                    return visitSuperKeyword(/*isExpressionOfCall*/ false);\n                case 107 /* ThisKeyword */:\n                    return visitThisKeyword(node);\n                case 226 /* MetaProperty */:\n                    return visitMetaProperty(node);\n                case 165 /* MethodDeclaration */:\n                    return visitMethodDeclaration(node);\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    return visitAccessorDeclaration(node);\n                case 232 /* VariableStatement */:\n                    return visitVariableStatement(node);\n                case 242 /* ReturnStatement */:\n                    return visitReturnStatement(node);\n                case 212 /* VoidExpression */:\n                    return visitVoidExpression(node);\n                default:\n                    return ts.visitEachChild(node, visitor, context);\n            }\n        }\n        function visitSourceFile(node) {\n            var ancestorFacts = enterSubtree(8064 /* SourceFileExcludes */, 64 /* SourceFileIncludes */);\n            var prologue = [];\n            var statements = [];\n            startLexicalEnvironment();\n            var statementOffset = factory.copyPrologue(node.statements, prologue, /*ensureUseStrict*/ false, visitor);\n            ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset));\n            if (taggedTemplateStringDeclarations) {\n                statements.push(factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList(taggedTemplateStringDeclarations)));\n            }\n            factory.mergeLexicalEnvironment(prologue, endLexicalEnvironment());\n            insertCaptureThisForNodeIfNeeded(prologue, node);\n            exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */);\n            return factory.updateSourceFile(node, ts.setTextRange(factory.createNodeArray(ts.concatenate(prologue, statements)), node.statements));\n        }\n        function visitSwitchStatement(node) {\n            if (convertedLoopState !== undefined) {\n                var savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps;\n                // for switch statement allow only non-labeled break\n                convertedLoopState.allowedNonLabeledJumps |= 2 /* Break */;\n                var result = ts.visitEachChild(node, visitor, context);\n                convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps;\n                return result;\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitCaseBlock(node) {\n            var ancestorFacts = enterSubtree(7104 /* BlockScopeExcludes */, 0 /* BlockScopeIncludes */);\n            var updated = ts.visitEachChild(node, visitor, context);\n            exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */);\n            return updated;\n        }\n        function returnCapturedThis(node) {\n            return ts.setOriginalNode(factory.createReturnStatement(factory.createUniqueName(\"_this\", 16 /* Optimistic */ | 32 /* FileLevel */)), node);\n        }\n        function visitReturnStatement(node) {\n            if (convertedLoopState) {\n                convertedLoopState.nonLocalJumps |= 8 /* Return */;\n                if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) {\n                    node = returnCapturedThis(node);\n                }\n                return factory.createReturnStatement(factory.createObjectLiteralExpression([\n                    factory.createPropertyAssignment(factory.createIdentifier(\"value\"), node.expression\n                        ? ts.visitNode(node.expression, visitor, ts.isExpression)\n                        : factory.createVoidZero())\n                ]));\n            }\n            else if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) {\n                return returnCapturedThis(node);\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitThisKeyword(node) {\n            if (hierarchyFacts & 2 /* ArrowFunction */) {\n                hierarchyFacts |= 32768 /* CapturedLexicalThis */;\n            }\n            if (convertedLoopState) {\n                if (hierarchyFacts & 2 /* ArrowFunction */) {\n                    // if the enclosing function is an ArrowFunction then we use the captured 'this' keyword.\n                    convertedLoopState.containsLexicalThis = true;\n                    return node;\n                }\n                return convertedLoopState.thisName || (convertedLoopState.thisName = factory.createUniqueName(\"this\"));\n            }\n            return node;\n        }\n        function visitVoidExpression(node) {\n            return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);\n        }\n        function visitIdentifier(node) {\n            if (!convertedLoopState) {\n                return node;\n            }\n            if (resolver.isArgumentsLocalBinding(node)) {\n                return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory.createUniqueName(\"arguments\"));\n            }\n            return node;\n        }\n        function visitBreakOrContinueStatement(node) {\n            if (convertedLoopState) {\n                // check if we can emit break/continue as is\n                // it is possible if either\n                //   - break/continue is labeled and label is located inside the converted loop\n                //   - break/continue is non-labeled and located in non-converted loop/switch statement\n                var jump = node.kind === 241 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */;\n                var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) ||\n                    (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump));\n                if (!canUseBreakOrContinue) {\n                    var labelMarker = void 0;\n                    var label = node.label;\n                    if (!label) {\n                        if (node.kind === 241 /* BreakStatement */) {\n                            convertedLoopState.nonLocalJumps |= 2 /* Break */;\n                            labelMarker = \"break\";\n                        }\n                        else {\n                            convertedLoopState.nonLocalJumps |= 4 /* Continue */;\n                            // note: return value is emitted only to simplify debugging, call to converted loop body does not do any dispatching on it.\n                            labelMarker = \"continue\";\n                        }\n                    }\n                    else {\n                        if (node.kind === 241 /* BreakStatement */) {\n                            labelMarker = \"break-\" + label.escapedText;\n                            setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker);\n                        }\n                        else {\n                            labelMarker = \"continue-\" + label.escapedText;\n                            setLabeledJump(convertedLoopState, /*isBreak*/ false, ts.idText(label), labelMarker);\n                        }\n                    }\n                    var returnExpression = factory.createStringLiteral(labelMarker);\n                    if (convertedLoopState.loopOutParameters.length) {\n                        var outParams = convertedLoopState.loopOutParameters;\n                        var expr = void 0;\n                        for (var i = 0; i < outParams.length; i++) {\n                            var copyExpr = copyOutParameter(outParams[i], 1 /* ToOutParameter */);\n                            if (i === 0) {\n                                expr = copyExpr;\n                            }\n                            else {\n                                expr = factory.createBinaryExpression(expr, 27 /* CommaToken */, copyExpr);\n                            }\n                        }\n                        returnExpression = factory.createBinaryExpression(expr, 27 /* CommaToken */, returnExpression);\n                    }\n                    return factory.createReturnStatement(returnExpression);\n                }\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        /**\n         * Visits a ClassDeclaration and transforms it into a variable statement.\n         *\n         * @param node A ClassDeclaration node.\n         */\n        function visitClassDeclaration(node) {\n            // [source]\n            //      class C { }\n            //\n            // [output]\n            //      var C = (function () {\n            //          function C() {\n            //          }\n            //          return C;\n            //      }());\n            var variable = factory.createVariableDeclaration(factory.getLocalName(node, /*allowComments*/ true), \n            /*exclamationToken*/ undefined, \n            /*type*/ undefined, transformClassLikeDeclarationToExpression(node));\n            ts.setOriginalNode(variable, node);\n            var statements = [];\n            var statement = factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([variable]));\n            ts.setOriginalNode(statement, node);\n            ts.setTextRange(statement, node);\n            ts.startOnNewLine(statement);\n            statements.push(statement);\n            // Add an `export default` statement for default exports (for `--target es5 --module es6`)\n            if (ts.hasSyntacticModifier(node, 1 /* Export */)) {\n                var exportStatement = ts.hasSyntacticModifier(node, 512 /* Default */)\n                    ? factory.createExportDefault(factory.getLocalName(node))\n                    : factory.createExternalModuleExport(factory.getLocalName(node));\n                ts.setOriginalNode(exportStatement, statement);\n                statements.push(exportStatement);\n            }\n            var emitFlags = ts.getEmitFlags(node);\n            if ((emitFlags & 4194304 /* HasEndOfDeclarationMarker */) === 0) {\n                // Add a DeclarationMarker as a marker for the end of the declaration\n                statements.push(factory.createEndOfDeclarationMarker(node));\n                ts.setEmitFlags(statement, emitFlags | 4194304 /* HasEndOfDeclarationMarker */);\n            }\n            return ts.singleOrMany(statements);\n        }\n        /**\n         * Visits a ClassExpression and transforms it into an expression.\n         *\n         * @param node A ClassExpression node.\n         */\n        function visitClassExpression(node) {\n            // [source]\n            //      C = class { }\n            //\n            // [output]\n            //      C = (function () {\n            //          function class_1() {\n            //          }\n            //          return class_1;\n            //      }())\n            return transformClassLikeDeclarationToExpression(node);\n        }\n        /**\n         * Transforms a ClassExpression or ClassDeclaration into an expression.\n         *\n         * @param node A ClassExpression or ClassDeclaration node.\n         */\n        function transformClassLikeDeclarationToExpression(node) {\n            // [source]\n            //      class C extends D {\n            //          constructor() {}\n            //          method() {}\n            //          get prop() {}\n            //          set prop(v) {}\n            //      }\n            //\n            // [output]\n            //      (function (_super) {\n            //          __extends(C, _super);\n            //          function C() {\n            //          }\n            //          C.prototype.method = function () {}\n            //          Object.defineProperty(C.prototype, \"prop\", {\n            //              get: function() {},\n            //              set: function() {},\n            //              enumerable: true,\n            //              configurable: true\n            //          });\n            //          return C;\n            //      }(D))\n            if (node.name) {\n                enableSubstitutionsForBlockScopedBindings();\n            }\n            var extendsClauseElement = ts.getClassExtendsHeritageElement(node);\n            var classFunction = factory.createFunctionExpression(\n            /*modifiers*/ undefined, \n            /*asteriskToken*/ undefined, \n            /*name*/ undefined, \n            /*typeParameters*/ undefined, extendsClauseElement ? [factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, factory.createUniqueName(\"_super\", 16 /* Optimistic */ | 32 /* FileLevel */))] : [], \n            /*type*/ undefined, transformClassBody(node, extendsClauseElement));\n            // To preserve the behavior of the old emitter, we explicitly indent\n            // the body of the function here if it was requested in an earlier\n            // transformation.\n            ts.setEmitFlags(classFunction, (ts.getEmitFlags(node) & 65536 /* Indented */) | 524288 /* ReuseTempVariableScope */);\n            // \"inner\" and \"outer\" below are added purely to preserve source map locations from\n            // the old emitter\n            var inner = factory.createPartiallyEmittedExpression(classFunction);\n            ts.setTextRangeEnd(inner, node.end);\n            ts.setEmitFlags(inner, 1536 /* NoComments */);\n            var outer = factory.createPartiallyEmittedExpression(inner);\n            ts.setTextRangeEnd(outer, ts.skipTrivia(currentText, node.pos));\n            ts.setEmitFlags(outer, 1536 /* NoComments */);\n            var result = factory.createParenthesizedExpression(factory.createCallExpression(outer, \n            /*typeArguments*/ undefined, extendsClauseElement\n                ? [ts.visitNode(extendsClauseElement.expression, visitor, ts.isExpression)]\n                : []));\n            ts.addSyntheticLeadingComment(result, 3 /* MultiLineCommentTrivia */, \"* @class \");\n            return result;\n        }\n        /**\n         * Transforms a ClassExpression or ClassDeclaration into a function body.\n         *\n         * @param node A ClassExpression or ClassDeclaration node.\n         * @param extendsClauseElement The expression for the class `extends` clause.\n         */\n        function transformClassBody(node, extendsClauseElement) {\n            var statements = [];\n            var name = factory.getInternalName(node);\n            var constructorLikeName = ts.isIdentifierANonContextualKeyword(name) ? factory.getGeneratedNameForNode(name) : name;\n            startLexicalEnvironment();\n            addExtendsHelperIfNeeded(statements, node, extendsClauseElement);\n            addConstructor(statements, node, constructorLikeName, extendsClauseElement);\n            addClassMembers(statements, node);\n            // Create a synthetic text range for the return statement.\n            var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 19 /* CloseBraceToken */);\n            // The following partially-emitted expression exists purely to align our sourcemap\n            // emit with the original emitter.\n            var outer = factory.createPartiallyEmittedExpression(constructorLikeName);\n            ts.setTextRangeEnd(outer, closingBraceLocation.end);\n            ts.setEmitFlags(outer, 1536 /* NoComments */);\n            var statement = factory.createReturnStatement(outer);\n            ts.setTextRangePos(statement, closingBraceLocation.pos);\n            ts.setEmitFlags(statement, 1536 /* NoComments */ | 384 /* NoTokenSourceMaps */);\n            statements.push(statement);\n            ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());\n            var block = factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), /*location*/ node.members), /*multiLine*/ true);\n            ts.setEmitFlags(block, 1536 /* NoComments */);\n            return block;\n        }\n        /**\n         * Adds a call to the `__extends` helper if needed for a class.\n         *\n         * @param statements The statements of the class body function.\n         * @param node The ClassExpression or ClassDeclaration node.\n         * @param extendsClauseElement The expression for the class `extends` clause.\n         */\n        function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) {\n            if (extendsClauseElement) {\n                statements.push(ts.setTextRange(factory.createExpressionStatement(emitHelpers().createExtendsHelper(factory.getInternalName(node))), \n                /*location*/ extendsClauseElement));\n            }\n        }\n        /**\n         * Adds the constructor of the class to a class body function.\n         *\n         * @param statements The statements of the class body function.\n         * @param node The ClassExpression or ClassDeclaration node.\n         * @param extendsClauseElement The expression for the class `extends` clause.\n         */\n        function addConstructor(statements, node, name, extendsClauseElement) {\n            var savedConvertedLoopState = convertedLoopState;\n            convertedLoopState = undefined;\n            var ancestorFacts = enterSubtree(16278 /* ConstructorExcludes */, 73 /* ConstructorIncludes */);\n            var constructor = ts.getFirstConstructorWithBody(node);\n            var hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== undefined);\n            var constructorFunction = factory.createFunctionDeclaration(\n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, \n            /*asteriskToken*/ undefined, name, \n            /*typeParameters*/ undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), \n            /*type*/ undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper));\n            ts.setTextRange(constructorFunction, constructor || node);\n            if (extendsClauseElement) {\n                ts.setEmitFlags(constructorFunction, 8 /* CapturesThis */);\n            }\n            statements.push(constructorFunction);\n            exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */);\n            convertedLoopState = savedConvertedLoopState;\n        }\n        /**\n         * Transforms the parameters of the constructor declaration of a class.\n         *\n         * @param constructor The constructor for the class.\n         * @param hasSynthesizedSuper A value indicating whether the constructor starts with a\n         *                            synthesized `super` call.\n         */\n        function transformConstructorParameters(constructor, hasSynthesizedSuper) {\n            // If the TypeScript transformer needed to synthesize a constructor for property\n            // initializers, it would have also added a synthetic `...args` parameter and\n            // `super` call.\n            // If this is the case, we do not include the synthetic `...args` parameter and\n            // will instead use the `arguments` object in ES5/3.\n            return ts.visitParameterList(constructor && !hasSynthesizedSuper ? constructor.parameters : undefined, visitor, context)\n                || [];\n        }\n        function createDefaultConstructorBody(node, isDerivedClass) {\n            // We must be here because the user didn't write a constructor\n            // but we needed to call 'super(...args)' anyway as per 14.5.14 of the ES2016 spec.\n            // If that's the case we can just immediately return the result of a 'super()' call.\n            var statements = [];\n            resumeLexicalEnvironment();\n            factory.mergeLexicalEnvironment(statements, endLexicalEnvironment());\n            if (isDerivedClass) {\n                // return _super !== null && _super.apply(this, arguments) || this;\n                statements.push(factory.createReturnStatement(createDefaultSuperCallOrThis()));\n            }\n            var statementsArray = factory.createNodeArray(statements);\n            ts.setTextRange(statementsArray, node.members);\n            var block = factory.createBlock(statementsArray, /*multiLine*/ true);\n            ts.setTextRange(block, node);\n            ts.setEmitFlags(block, 1536 /* NoComments */);\n            return block;\n        }\n        /**\n         * Transforms the body of a constructor declaration of a class.\n         *\n         * @param constructor The constructor for the class.\n         * @param node The node which contains the constructor.\n         * @param extendsClauseElement The expression for the class `extends` clause.\n         * @param hasSynthesizedSuper A value indicating whether the constructor starts with a\n         *                            synthesized `super` call.\n         */\n        function transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper) {\n            // determine whether the class is known syntactically to be a derived class (e.g. a\n            // class that extends a value that is not syntactically known to be `null`).\n            var isDerivedClass = !!extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 103 /* NullKeyword */;\n            // When the subclass does not have a constructor, we synthesize a *default* constructor using the following\n            // representation:\n            //\n            // ```\n            // // es2015 (source)\n            // class C extends Base { }\n            //\n            // // es5 (transformed)\n            // var C = (function (_super) {\n            //     function C() {\n            //         return _super.apply(this, arguments) || this;\n            //     }\n            //     return C;\n            // })(Base);\n            // ```\n            if (!constructor)\n                return createDefaultConstructorBody(node, isDerivedClass);\n            // The prologue will contain all leading standard and custom prologue statements added by this transform\n            var prologue = [];\n            var statements = [];\n            resumeLexicalEnvironment();\n            // If a super call has already been synthesized,\n            // we're going to assume that we should just transform everything after that.\n            // The assumption is that no prior step in the pipeline has added any prologue directives.\n            var statementOffset = 0;\n            if (!hasSynthesizedSuper)\n                statementOffset = factory.copyStandardPrologue(constructor.body.statements, prologue, /*ensureUseStrict*/ false);\n            addDefaultValueAssignmentsIfNeeded(statements, constructor);\n            addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper);\n            if (!hasSynthesizedSuper)\n                statementOffset = factory.copyCustomPrologue(constructor.body.statements, statements, statementOffset, visitor);\n            // If the first statement is a call to `super()`, visit the statement directly\n            var superCallExpression;\n            if (hasSynthesizedSuper) {\n                superCallExpression = createDefaultSuperCallOrThis();\n            }\n            else if (isDerivedClass && statementOffset < constructor.body.statements.length) {\n                var firstStatement = constructor.body.statements[statementOffset];\n                if (ts.isExpressionStatement(firstStatement) && ts.isSuperCall(firstStatement.expression)) {\n                    superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression);\n                }\n            }\n            if (superCallExpression) {\n                hierarchyFacts |= 8192 /* ConstructorWithCapturedSuper */;\n                statementOffset++; // skip this statement, we will add it after visiting the rest of the body.\n            }\n            // visit the remaining statements\n            ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, /*start*/ statementOffset));\n            factory.mergeLexicalEnvironment(prologue, endLexicalEnvironment());\n            insertCaptureNewTargetIfNeeded(prologue, constructor, /*copyOnWrite*/ false);\n            if (isDerivedClass) {\n                if (superCallExpression && statementOffset === constructor.body.statements.length && !(constructor.body.transformFlags & 4096 /* ContainsLexicalThis */)) {\n                    // If the subclass constructor does *not* contain `this` and *ends* with a `super()` call, we will use the\n                    // following representation:\n                    //\n                    // ```\n                    // // es2015 (source)\n                    // class C extends Base {\n                    //     constructor() {\n                    //         super(\"foo\");\n                    //     }\n                    // }\n                    //\n                    // // es5 (transformed)\n                    // var C = (function (_super) {\n                    //     function C() {\n                    //         return _super.call(this, \"foo\") || this;\n                    //     }\n                    //     return C;\n                    // })(Base);\n                    // ```\n                    var superCall = ts.cast(ts.cast(superCallExpression, ts.isBinaryExpression).left, ts.isCallExpression);\n                    var returnStatement = factory.createReturnStatement(superCallExpression);\n                    ts.setCommentRange(returnStatement, ts.getCommentRange(superCall));\n                    ts.setEmitFlags(superCall, 1536 /* NoComments */);\n                    statements.push(returnStatement);\n                }\n                else {\n                    // Otherwise, we will use the following transformed representation for calls to `super()` in a constructor:\n                    //\n                    // ```\n                    // // es2015 (source)\n                    // class C extends Base {\n                    //     constructor() {\n                    //         super(\"foo\");\n                    //         this.x = 1;\n                    //     }\n                    // }\n                    //\n                    // // es5 (transformed)\n                    // var C = (function (_super) {\n                    //     function C() {\n                    //         var _this = _super.call(this, \"foo\") || this;\n                    //         _this.x = 1;\n                    //         return _this;\n                    //     }\n                    //     return C;\n                    // })(Base);\n                    // ```\n                    // Since the `super()` call was the first statement, we insert the `this` capturing call to\n                    // `super()` at the top of the list of `statements` (after any pre-existing custom prologues).\n                    insertCaptureThisForNode(statements, constructor, superCallExpression || createActualThis());\n                    if (!isSufficientlyCoveredByReturnStatements(constructor.body)) {\n                        statements.push(factory.createReturnStatement(factory.createUniqueName(\"_this\", 16 /* Optimistic */ | 32 /* FileLevel */)));\n                    }\n                }\n            }\n            else {\n                // If a class is not derived from a base class or does not have a call to `super()`, `this` is only\n                // captured when necessitated by an arrow function capturing the lexical `this`:\n                //\n                // ```\n                // // es2015\n                // class C {}\n                //\n                // // es5\n                // var C = (function () {\n                //     function C() {\n                //     }\n                //     return C;\n                // })();\n                // ```\n                insertCaptureThisForNodeIfNeeded(prologue, constructor);\n            }\n            var block = factory.createBlock(ts.setTextRange(factory.createNodeArray(ts.concatenate(prologue, statements)), \n            /*location*/ constructor.body.statements), \n            /*multiLine*/ true);\n            ts.setTextRange(block, constructor.body);\n            return block;\n        }\n        /**\n         * We want to try to avoid emitting a return statement in certain cases if a user already returned something.\n         * It would generate obviously dead code, so we'll try to make things a little bit prettier\n         * by doing a minimal check on whether some common patterns always explicitly return.\n         */\n        function isSufficientlyCoveredByReturnStatements(statement) {\n            // A return statement is considered covered.\n            if (statement.kind === 242 /* ReturnStatement */) {\n                return true;\n            }\n            // An if-statement with two covered branches is covered.\n            else if (statement.kind === 234 /* IfStatement */) {\n                var ifStatement = statement;\n                if (ifStatement.elseStatement) {\n                    return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) &&\n                        isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement);\n                }\n            }\n            // A block is covered if it has a last statement which is covered.\n            else if (statement.kind === 230 /* Block */) {\n                var lastStatement = ts.lastOrUndefined(statement.statements);\n                if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) {\n                    return true;\n                }\n            }\n            return false;\n        }\n        function createActualThis() {\n            return ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */);\n        }\n        function createDefaultSuperCallOrThis() {\n            return factory.createLogicalOr(factory.createLogicalAnd(factory.createStrictInequality(factory.createUniqueName(\"_super\", 16 /* Optimistic */ | 32 /* FileLevel */), factory.createNull()), factory.createFunctionApplyCall(factory.createUniqueName(\"_super\", 16 /* Optimistic */ | 32 /* FileLevel */), createActualThis(), factory.createIdentifier(\"arguments\"))), createActualThis());\n        }\n        /**\n         * Visits a parameter declaration.\n         *\n         * @param node A ParameterDeclaration node.\n         */\n        function visitParameter(node) {\n            if (node.dotDotDotToken) {\n                // rest parameters are elided\n                return undefined;\n            }\n            else if (ts.isBindingPattern(node.name)) {\n                // Binding patterns are converted into a generated name and are\n                // evaluated inside the function body.\n                return ts.setOriginalNode(ts.setTextRange(factory.createParameterDeclaration(\n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, \n                /*dotDotDotToken*/ undefined, factory.getGeneratedNameForNode(node), \n                /*questionToken*/ undefined, \n                /*type*/ undefined, \n                /*initializer*/ undefined), \n                /*location*/ node), \n                /*original*/ node);\n            }\n            else if (node.initializer) {\n                // Initializers are elided\n                return ts.setOriginalNode(ts.setTextRange(factory.createParameterDeclaration(\n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, \n                /*dotDotDotToken*/ undefined, node.name, \n                /*questionToken*/ undefined, \n                /*type*/ undefined, \n                /*initializer*/ undefined), \n                /*location*/ node), \n                /*original*/ node);\n            }\n            else {\n                return node;\n            }\n        }\n        function hasDefaultValueOrBindingPattern(node) {\n            return node.initializer !== undefined\n                || ts.isBindingPattern(node.name);\n        }\n        /**\n         * Adds statements to the body of a function-like node if it contains parameters with\n         * binding patterns or initializers.\n         *\n         * @param statements The statements for the new function body.\n         * @param node A function-like node.\n         */\n        function addDefaultValueAssignmentsIfNeeded(statements, node) {\n            if (!ts.some(node.parameters, hasDefaultValueOrBindingPattern)) {\n                return false;\n            }\n            var added = false;\n            for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {\n                var parameter = _a[_i];\n                var name = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken;\n                // A rest parameter cannot have a binding pattern or an initializer,\n                // so let's just ignore it.\n                if (dotDotDotToken) {\n                    continue;\n                }\n                if (ts.isBindingPattern(name)) {\n                    added = insertDefaultValueAssignmentForBindingPattern(statements, parameter, name, initializer) || added;\n                }\n                else if (initializer) {\n                    insertDefaultValueAssignmentForInitializer(statements, parameter, name, initializer);\n                    added = true;\n                }\n            }\n            return added;\n        }\n        /**\n         * Adds statements to the body of a function-like node for parameters with binding patterns\n         *\n         * @param statements The statements for the new function body.\n         * @param parameter The parameter for the function.\n         * @param name The name of the parameter.\n         * @param initializer The initializer for the parameter.\n         */\n        function insertDefaultValueAssignmentForBindingPattern(statements, parameter, name, initializer) {\n            // In cases where a binding pattern is simply '[]' or '{}',\n            // we usually don't want to emit a var declaration; however, in the presence\n            // of an initializer, we must emit that expression to preserve side effects.\n            if (name.elements.length > 0) {\n                ts.insertStatementAfterCustomPrologue(statements, ts.setEmitFlags(factory.createVariableStatement(\n                /*modifiers*/ undefined, factory.createVariableDeclarationList(ts.flattenDestructuringBinding(parameter, visitor, context, 0 /* All */, factory.getGeneratedNameForNode(parameter)))), 1048576 /* CustomPrologue */));\n                return true;\n            }\n            else if (initializer) {\n                ts.insertStatementAfterCustomPrologue(statements, ts.setEmitFlags(factory.createExpressionStatement(factory.createAssignment(factory.getGeneratedNameForNode(parameter), ts.visitNode(initializer, visitor, ts.isExpression))), 1048576 /* CustomPrologue */));\n                return true;\n            }\n            return false;\n        }\n        /**\n         * Adds statements to the body of a function-like node for parameters with initializers.\n         *\n         * @param statements The statements for the new function body.\n         * @param parameter The parameter for the function.\n         * @param name The name of the parameter.\n         * @param initializer The initializer for the parameter.\n         */\n        function insertDefaultValueAssignmentForInitializer(statements, parameter, name, initializer) {\n            initializer = ts.visitNode(initializer, visitor, ts.isExpression);\n            var statement = factory.createIfStatement(factory.createTypeCheck(factory.cloneNode(name), \"undefined\"), ts.setEmitFlags(ts.setTextRange(factory.createBlock([\n                factory.createExpressionStatement(ts.setEmitFlags(ts.setTextRange(factory.createAssignment(\n                // TODO(rbuckton): Does this need to be parented?\n                ts.setEmitFlags(ts.setParent(ts.setTextRange(factory.cloneNode(name), name), name.parent), 48 /* NoSourceMap */), ts.setEmitFlags(initializer, 48 /* NoSourceMap */ | ts.getEmitFlags(initializer) | 1536 /* NoComments */)), parameter), 1536 /* NoComments */))\n            ]), parameter), 1 /* SingleLine */ | 32 /* NoTrailingSourceMap */ | 384 /* NoTokenSourceMaps */ | 1536 /* NoComments */));\n            ts.startOnNewLine(statement);\n            ts.setTextRange(statement, parameter);\n            ts.setEmitFlags(statement, 384 /* NoTokenSourceMaps */ | 32 /* NoTrailingSourceMap */ | 1048576 /* CustomPrologue */ | 1536 /* NoComments */);\n            ts.insertStatementAfterCustomPrologue(statements, statement);\n        }\n        /**\n         * Gets a value indicating whether we need to add statements to handle a rest parameter.\n         *\n         * @param node A ParameterDeclaration node.\n         * @param inConstructorWithSynthesizedSuper A value indicating whether the parameter is\n         *                                          part of a constructor declaration with a\n         *                                          synthesized call to `super`\n         */\n        function shouldAddRestParameter(node, inConstructorWithSynthesizedSuper) {\n            return !!(node && node.dotDotDotToken && !inConstructorWithSynthesizedSuper);\n        }\n        /**\n         * Adds statements to the body of a function-like node if it contains a rest parameter.\n         *\n         * @param statements The statements for the new function body.\n         * @param node A function-like node.\n         * @param inConstructorWithSynthesizedSuper A value indicating whether the parameter is\n         *                                          part of a constructor declaration with a\n         *                                          synthesized call to `super`\n         */\n        function addRestParameterIfNeeded(statements, node, inConstructorWithSynthesizedSuper) {\n            var prologueStatements = [];\n            var parameter = ts.lastOrUndefined(node.parameters);\n            if (!shouldAddRestParameter(parameter, inConstructorWithSynthesizedSuper)) {\n                return false;\n            }\n            // `declarationName` is the name of the local declaration for the parameter.\n            // TODO(rbuckton): Does this need to be parented?\n            var declarationName = parameter.name.kind === 78 /* Identifier */ ? ts.setParent(ts.setTextRange(factory.cloneNode(parameter.name), parameter.name), parameter.name.parent) : factory.createTempVariable(/*recordTempVariable*/ undefined);\n            ts.setEmitFlags(declarationName, 48 /* NoSourceMap */);\n            // `expressionName` is the name of the parameter used in expressions.\n            var expressionName = parameter.name.kind === 78 /* Identifier */ ? factory.cloneNode(parameter.name) : declarationName;\n            var restIndex = node.parameters.length - 1;\n            var temp = factory.createLoopVariable();\n            // var param = [];\n            prologueStatements.push(ts.setEmitFlags(ts.setTextRange(factory.createVariableStatement(\n            /*modifiers*/ undefined, factory.createVariableDeclarationList([\n                factory.createVariableDeclaration(declarationName, \n                /*exclamationToken*/ undefined, \n                /*type*/ undefined, factory.createArrayLiteralExpression([]))\n            ])), \n            /*location*/ parameter), 1048576 /* CustomPrologue */));\n            // for (var _i = restIndex; _i < arguments.length; _i++) {\n            //   param[_i - restIndex] = arguments[_i];\n            // }\n            var forStatement = factory.createForStatement(ts.setTextRange(factory.createVariableDeclarationList([\n                factory.createVariableDeclaration(temp, /*exclamationToken*/ undefined, /*type*/ undefined, factory.createNumericLiteral(restIndex))\n            ]), parameter), ts.setTextRange(factory.createLessThan(temp, factory.createPropertyAccessExpression(factory.createIdentifier(\"arguments\"), \"length\")), parameter), ts.setTextRange(factory.createPostfixIncrement(temp), parameter), factory.createBlock([\n                ts.startOnNewLine(ts.setTextRange(factory.createExpressionStatement(factory.createAssignment(factory.createElementAccessExpression(expressionName, restIndex === 0\n                    ? temp\n                    : factory.createSubtract(temp, factory.createNumericLiteral(restIndex))), factory.createElementAccessExpression(factory.createIdentifier(\"arguments\"), temp))), \n                /*location*/ parameter))\n            ]));\n            ts.setEmitFlags(forStatement, 1048576 /* CustomPrologue */);\n            ts.startOnNewLine(forStatement);\n            prologueStatements.push(forStatement);\n            if (parameter.name.kind !== 78 /* Identifier */) {\n                // do the actual destructuring of the rest parameter if necessary\n                prologueStatements.push(ts.setEmitFlags(ts.setTextRange(factory.createVariableStatement(\n                /*modifiers*/ undefined, factory.createVariableDeclarationList(ts.flattenDestructuringBinding(parameter, visitor, context, 0 /* All */, expressionName))), parameter), 1048576 /* CustomPrologue */));\n            }\n            ts.insertStatementsAfterCustomPrologue(statements, prologueStatements);\n            return true;\n        }\n        /**\n         * Adds a statement to capture the `this` of a function declaration if it is needed.\n         * NOTE: This must be executed *after* the subtree has been visited.\n         *\n         * @param statements The statements for the new function body.\n         * @param node A node.\n         */\n        function insertCaptureThisForNodeIfNeeded(statements, node) {\n            if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 209 /* ArrowFunction */) {\n                insertCaptureThisForNode(statements, node, factory.createThis());\n                return true;\n            }\n            return false;\n        }\n        function insertCaptureThisForNode(statements, node, initializer) {\n            enableSubstitutionsForCapturedThis();\n            var captureThisStatement = factory.createVariableStatement(\n            /*modifiers*/ undefined, factory.createVariableDeclarationList([\n                factory.createVariableDeclaration(factory.createUniqueName(\"_this\", 16 /* Optimistic */ | 32 /* FileLevel */), \n                /*exclamationToken*/ undefined, \n                /*type*/ undefined, initializer)\n            ]));\n            ts.setEmitFlags(captureThisStatement, 1536 /* NoComments */ | 1048576 /* CustomPrologue */);\n            ts.setSourceMapRange(captureThisStatement, node);\n            ts.insertStatementAfterCustomPrologue(statements, captureThisStatement);\n        }\n        function insertCaptureNewTargetIfNeeded(statements, node, copyOnWrite) {\n            if (hierarchyFacts & 16384 /* NewTarget */) {\n                var newTarget = void 0;\n                switch (node.kind) {\n                    case 209 /* ArrowFunction */:\n                        return statements;\n                    case 165 /* MethodDeclaration */:\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                        // Methods and accessors cannot be constructors, so 'new.target' will\n                        // always return 'undefined'.\n                        newTarget = factory.createVoidZero();\n                        break;\n                    case 166 /* Constructor */:\n                        // Class constructors can only be called with `new`, so `this.constructor`\n                        // should be relatively safe to use.\n                        newTarget = factory.createPropertyAccessExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), \"constructor\");\n                        break;\n                    case 251 /* FunctionDeclaration */:\n                    case 208 /* FunctionExpression */:\n                        // Functions can be called or constructed, and may have a `this` due to\n                        // being a member or when calling an imported function via `other_1.f()`.\n                        newTarget = factory.createConditionalExpression(factory.createLogicalAnd(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), factory.createBinaryExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), 101 /* InstanceOfKeyword */, factory.getLocalName(node))), \n                        /*questionToken*/ undefined, factory.createPropertyAccessExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), \"constructor\"), \n                        /*colonToken*/ undefined, factory.createVoidZero());\n                        break;\n                    default:\n                        return ts.Debug.failBadSyntaxKind(node);\n                }\n                var captureNewTargetStatement = factory.createVariableStatement(\n                /*modifiers*/ undefined, factory.createVariableDeclarationList([\n                    factory.createVariableDeclaration(factory.createUniqueName(\"_newTarget\", 16 /* Optimistic */ | 32 /* FileLevel */), \n                    /*exclamationToken*/ undefined, \n                    /*type*/ undefined, newTarget)\n                ]));\n                ts.setEmitFlags(captureNewTargetStatement, 1536 /* NoComments */ | 1048576 /* CustomPrologue */);\n                if (copyOnWrite) {\n                    statements = statements.slice();\n                }\n                ts.insertStatementAfterCustomPrologue(statements, captureNewTargetStatement);\n            }\n            return statements;\n        }\n        /**\n         * Adds statements to the class body function for a class to define the members of the\n         * class.\n         *\n         * @param statements The statements for the class body function.\n         * @param node The ClassExpression or ClassDeclaration node.\n         */\n        function addClassMembers(statements, node) {\n            for (var _i = 0, _a = node.members; _i < _a.length; _i++) {\n                var member = _a[_i];\n                switch (member.kind) {\n                    case 229 /* SemicolonClassElement */:\n                        statements.push(transformSemicolonClassElementToStatement(member));\n                        break;\n                    case 165 /* MethodDeclaration */:\n                        statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node));\n                        break;\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                        var accessors = ts.getAllAccessorDeclarations(node.members, member);\n                        if (member === accessors.firstAccessor) {\n                            statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node));\n                        }\n                        break;\n                    case 166 /* Constructor */:\n                        // Constructors are handled in visitClassExpression/visitClassDeclaration\n                        break;\n                    default:\n                        ts.Debug.failBadSyntaxKind(member, currentSourceFile && currentSourceFile.fileName);\n                        break;\n                }\n            }\n        }\n        /**\n         * Transforms a SemicolonClassElement into a statement for a class body function.\n         *\n         * @param member The SemicolonClassElement node.\n         */\n        function transformSemicolonClassElementToStatement(member) {\n            return ts.setTextRange(factory.createEmptyStatement(), member);\n        }\n        /**\n         * Transforms a MethodDeclaration into a statement for a class body function.\n         *\n         * @param receiver The receiver for the member.\n         * @param member The MethodDeclaration node.\n         */\n        function transformClassMethodDeclarationToStatement(receiver, member, container) {\n            var commentRange = ts.getCommentRange(member);\n            var sourceMapRange = ts.getSourceMapRange(member);\n            var memberFunction = transformFunctionLikeToExpression(member, /*location*/ member, /*name*/ undefined, container);\n            var propertyName = ts.visitNode(member.name, visitor, ts.isPropertyName);\n            var e;\n            if (!ts.isPrivateIdentifier(propertyName) && context.getCompilerOptions().useDefineForClassFields) {\n                var name = ts.isComputedPropertyName(propertyName) ? propertyName.expression\n                    : ts.isIdentifier(propertyName) ? factory.createStringLiteral(ts.unescapeLeadingUnderscores(propertyName.escapedText))\n                        : propertyName;\n                e = factory.createObjectDefinePropertyCall(receiver, name, factory.createPropertyDescriptor({ value: memberFunction, enumerable: false, writable: true, configurable: true }));\n            }\n            else {\n                var memberName = ts.createMemberAccessForPropertyName(factory, receiver, propertyName, /*location*/ member.name);\n                e = factory.createAssignment(memberName, memberFunction);\n            }\n            ts.setEmitFlags(memberFunction, 1536 /* NoComments */);\n            ts.setSourceMapRange(memberFunction, sourceMapRange);\n            var statement = ts.setTextRange(factory.createExpressionStatement(e), /*location*/ member);\n            ts.setOriginalNode(statement, member);\n            ts.setCommentRange(statement, commentRange);\n            // The location for the statement is used to emit comments only.\n            // No source map should be emitted for this statement to align with the\n            // old emitter.\n            ts.setEmitFlags(statement, 48 /* NoSourceMap */);\n            return statement;\n        }\n        /**\n         * Transforms a set of related of get/set accessors into a statement for a class body function.\n         *\n         * @param receiver The receiver for the member.\n         * @param accessors The set of related get/set accessors.\n         */\n        function transformAccessorsToStatement(receiver, accessors, container) {\n            var statement = factory.createExpressionStatement(transformAccessorsToExpression(receiver, accessors, container, /*startsOnNewLine*/ false));\n            // The location for the statement is used to emit source maps only.\n            // No comments should be emitted for this statement to align with the\n            // old emitter.\n            ts.setEmitFlags(statement, 1536 /* NoComments */);\n            ts.setSourceMapRange(statement, ts.getSourceMapRange(accessors.firstAccessor));\n            return statement;\n        }\n        /**\n         * Transforms a set of related get/set accessors into an expression for either a class\n         * body function or an ObjectLiteralExpression with computed properties.\n         *\n         * @param receiver The receiver for the member.\n         */\n        function transformAccessorsToExpression(receiver, _a, container, startsOnNewLine) {\n            var firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor;\n            // To align with source maps in the old emitter, the receiver and property name\n            // arguments are both mapped contiguously to the accessor name.\n            // TODO(rbuckton): Does this need to be parented?\n            var target = ts.setParent(ts.setTextRange(factory.cloneNode(receiver), receiver), receiver.parent);\n            ts.setEmitFlags(target, 1536 /* NoComments */ | 32 /* NoTrailingSourceMap */);\n            ts.setSourceMapRange(target, firstAccessor.name);\n            var visitedAccessorName = ts.visitNode(firstAccessor.name, visitor, ts.isPropertyName);\n            if (ts.isPrivateIdentifier(visitedAccessorName)) {\n                return ts.Debug.failBadSyntaxKind(visitedAccessorName, \"Encountered unhandled private identifier while transforming ES2015.\");\n            }\n            var propertyName = ts.createExpressionForPropertyName(factory, visitedAccessorName);\n            ts.setEmitFlags(propertyName, 1536 /* NoComments */ | 16 /* NoLeadingSourceMap */);\n            ts.setSourceMapRange(propertyName, firstAccessor.name);\n            var properties = [];\n            if (getAccessor) {\n                var getterFunction = transformFunctionLikeToExpression(getAccessor, /*location*/ undefined, /*name*/ undefined, container);\n                ts.setSourceMapRange(getterFunction, ts.getSourceMapRange(getAccessor));\n                ts.setEmitFlags(getterFunction, 512 /* NoLeadingComments */);\n                var getter = factory.createPropertyAssignment(\"get\", getterFunction);\n                ts.setCommentRange(getter, ts.getCommentRange(getAccessor));\n                properties.push(getter);\n            }\n            if (setAccessor) {\n                var setterFunction = transformFunctionLikeToExpression(setAccessor, /*location*/ undefined, /*name*/ undefined, container);\n                ts.setSourceMapRange(setterFunction, ts.getSourceMapRange(setAccessor));\n                ts.setEmitFlags(setterFunction, 512 /* NoLeadingComments */);\n                var setter = factory.createPropertyAssignment(\"set\", setterFunction);\n                ts.setCommentRange(setter, ts.getCommentRange(setAccessor));\n                properties.push(setter);\n            }\n            properties.push(factory.createPropertyAssignment(\"enumerable\", getAccessor || setAccessor ? factory.createFalse() : factory.createTrue()), factory.createPropertyAssignment(\"configurable\", factory.createTrue()));\n            var call = factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier(\"Object\"), \"defineProperty\"), \n            /*typeArguments*/ undefined, [\n                target,\n                propertyName,\n                factory.createObjectLiteralExpression(properties, /*multiLine*/ true)\n            ]);\n            if (startsOnNewLine) {\n                ts.startOnNewLine(call);\n            }\n            return call;\n        }\n        /**\n         * Visits an ArrowFunction and transforms it into a FunctionExpression.\n         *\n         * @param node An ArrowFunction node.\n         */\n        function visitArrowFunction(node) {\n            if (node.transformFlags & 4096 /* ContainsLexicalThis */) {\n                hierarchyFacts |= 32768 /* CapturedLexicalThis */;\n            }\n            var savedConvertedLoopState = convertedLoopState;\n            convertedLoopState = undefined;\n            var ancestorFacts = enterSubtree(15232 /* ArrowFunctionExcludes */, 66 /* ArrowFunctionIncludes */);\n            var func = factory.createFunctionExpression(\n            /*modifiers*/ undefined, \n            /*asteriskToken*/ undefined, \n            /*name*/ undefined, \n            /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), \n            /*type*/ undefined, transformFunctionBody(node));\n            ts.setTextRange(func, node);\n            ts.setOriginalNode(func, node);\n            ts.setEmitFlags(func, 8 /* CapturesThis */);\n            if (hierarchyFacts & 32768 /* CapturedLexicalThis */) {\n                enableSubstitutionsForCapturedThis();\n            }\n            // If an arrow function contains\n            exitSubtree(ancestorFacts, 0 /* ArrowFunctionSubtreeExcludes */, 0 /* None */);\n            convertedLoopState = savedConvertedLoopState;\n            return func;\n        }\n        /**\n         * Visits a FunctionExpression node.\n         *\n         * @param node a FunctionExpression node.\n         */\n        function visitFunctionExpression(node) {\n            var ancestorFacts = ts.getEmitFlags(node) & 262144 /* AsyncFunctionBody */\n                ? enterSubtree(16278 /* AsyncFunctionBodyExcludes */, 69 /* AsyncFunctionBodyIncludes */)\n                : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */);\n            var savedConvertedLoopState = convertedLoopState;\n            convertedLoopState = undefined;\n            var parameters = ts.visitParameterList(node.parameters, visitor, context);\n            var body = transformFunctionBody(node);\n            var name = hierarchyFacts & 16384 /* NewTarget */\n                ? factory.getLocalName(node)\n                : node.name;\n            exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */);\n            convertedLoopState = savedConvertedLoopState;\n            return factory.updateFunctionExpression(node, \n            /*modifiers*/ undefined, node.asteriskToken, name, \n            /*typeParameters*/ undefined, parameters, \n            /*type*/ undefined, body);\n        }\n        /**\n         * Visits a FunctionDeclaration node.\n         *\n         * @param node a FunctionDeclaration node.\n         */\n        function visitFunctionDeclaration(node) {\n            var savedConvertedLoopState = convertedLoopState;\n            convertedLoopState = undefined;\n            var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */);\n            var parameters = ts.visitParameterList(node.parameters, visitor, context);\n            var body = transformFunctionBody(node);\n            var name = hierarchyFacts & 16384 /* NewTarget */\n                ? factory.getLocalName(node)\n                : node.name;\n            exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */);\n            convertedLoopState = savedConvertedLoopState;\n            return factory.updateFunctionDeclaration(node, \n            /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, name, \n            /*typeParameters*/ undefined, parameters, \n            /*type*/ undefined, body);\n        }\n        /**\n         * Transforms a function-like node into a FunctionExpression.\n         *\n         * @param node The function-like node to transform.\n         * @param location The source-map location for the new FunctionExpression.\n         * @param name The name of the new FunctionExpression.\n         */\n        function transformFunctionLikeToExpression(node, location, name, container) {\n            var savedConvertedLoopState = convertedLoopState;\n            convertedLoopState = undefined;\n            var ancestorFacts = container && ts.isClassLike(container) && !ts.hasSyntacticModifier(node, 32 /* Static */)\n                ? enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */ | 8 /* NonStaticClassElement */)\n                : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */);\n            var parameters = ts.visitParameterList(node.parameters, visitor, context);\n            var body = transformFunctionBody(node);\n            if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */)) {\n                name = factory.getGeneratedNameForNode(node);\n            }\n            exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */);\n            convertedLoopState = savedConvertedLoopState;\n            return ts.setOriginalNode(ts.setTextRange(factory.createFunctionExpression(\n            /*modifiers*/ undefined, node.asteriskToken, name, \n            /*typeParameters*/ undefined, parameters, \n            /*type*/ undefined, body), location), \n            /*original*/ node);\n        }\n        /**\n         * Transforms the body of a function-like node.\n         *\n         * @param node A function-like node.\n         */\n        function transformFunctionBody(node) {\n            var multiLine = false; // indicates whether the block *must* be emitted as multiple lines\n            var singleLine = false; // indicates whether the block *may* be emitted as a single line\n            var statementsLocation;\n            var closeBraceLocation;\n            var prologue = [];\n            var statements = [];\n            var body = node.body;\n            var statementOffset;\n            resumeLexicalEnvironment();\n            if (ts.isBlock(body)) {\n                // ensureUseStrict is false because no new prologue-directive should be added.\n                // addStandardPrologue will put already-existing directives at the beginning of the target statement-array\n                statementOffset = factory.copyStandardPrologue(body.statements, prologue, /*ensureUseStrict*/ false);\n                statementOffset = factory.copyCustomPrologue(body.statements, statements, statementOffset, visitor, ts.isHoistedFunction);\n                statementOffset = factory.copyCustomPrologue(body.statements, statements, statementOffset, visitor, ts.isHoistedVariableStatement);\n            }\n            multiLine = addDefaultValueAssignmentsIfNeeded(statements, node) || multiLine;\n            multiLine = addRestParameterIfNeeded(statements, node, /*inConstructorWithSynthesizedSuper*/ false) || multiLine;\n            if (ts.isBlock(body)) {\n                // addCustomPrologue puts already-existing directives at the beginning of the target statement-array\n                statementOffset = factory.copyCustomPrologue(body.statements, statements, statementOffset, visitor);\n                statementsLocation = body.statements;\n                ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, statementOffset));\n                // If the original body was a multi-line block, this must be a multi-line block.\n                if (!multiLine && body.multiLine) {\n                    multiLine = true;\n                }\n            }\n            else {\n                ts.Debug.assert(node.kind === 209 /* ArrowFunction */);\n                // To align with the old emitter, we use a synthetic end position on the location\n                // for the statement list we synthesize when we down-level an arrow function with\n                // an expression function body. This prevents both comments and source maps from\n                // being emitted for the end position only.\n                statementsLocation = ts.moveRangeEnd(body, -1);\n                var equalsGreaterThanToken = node.equalsGreaterThanToken;\n                if (!ts.nodeIsSynthesized(equalsGreaterThanToken) && !ts.nodeIsSynthesized(body)) {\n                    if (ts.rangeEndIsOnSameLineAsRangeStart(equalsGreaterThanToken, body, currentSourceFile)) {\n                        singleLine = true;\n                    }\n                    else {\n                        multiLine = true;\n                    }\n                }\n                var expression = ts.visitNode(body, visitor, ts.isExpression);\n                var returnStatement = factory.createReturnStatement(expression);\n                ts.setTextRange(returnStatement, body);\n                ts.moveSyntheticComments(returnStatement, body);\n                ts.setEmitFlags(returnStatement, 384 /* NoTokenSourceMaps */ | 32 /* NoTrailingSourceMap */ | 1024 /* NoTrailingComments */);\n                statements.push(returnStatement);\n                // To align with the source map emit for the old emitter, we set a custom\n                // source map location for the close brace.\n                closeBraceLocation = body;\n            }\n            factory.mergeLexicalEnvironment(prologue, endLexicalEnvironment());\n            insertCaptureNewTargetIfNeeded(prologue, node, /*copyOnWrite*/ false);\n            insertCaptureThisForNodeIfNeeded(prologue, node);\n            // If we added any final generated statements, this must be a multi-line block\n            if (ts.some(prologue)) {\n                multiLine = true;\n            }\n            statements.unshift.apply(statements, prologue);\n            if (ts.isBlock(body) && ts.arrayIsEqualTo(statements, body.statements)) {\n                // no changes were made, preserve the tree\n                return body;\n            }\n            var block = factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), statementsLocation), multiLine);\n            ts.setTextRange(block, node.body);\n            if (!multiLine && singleLine) {\n                ts.setEmitFlags(block, 1 /* SingleLine */);\n            }\n            if (closeBraceLocation) {\n                ts.setTokenSourceMapRange(block, 19 /* CloseBraceToken */, closeBraceLocation);\n            }\n            ts.setOriginalNode(block, node.body);\n            return block;\n        }\n        function visitBlock(node, isFunctionBody) {\n            if (isFunctionBody) {\n                // A function body is not a block scope.\n                return ts.visitEachChild(node, visitor, context);\n            }\n            var ancestorFacts = hierarchyFacts & 256 /* IterationStatement */\n                ? enterSubtree(7104 /* IterationStatementBlockExcludes */, 512 /* IterationStatementBlockIncludes */)\n                : enterSubtree(6976 /* BlockExcludes */, 128 /* BlockIncludes */);\n            var updated = ts.visitEachChild(node, visitor, context);\n            exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */);\n            return updated;\n        }\n        /**\n         * Visits an ExpressionStatement that contains a destructuring assignment.\n         *\n         * @param node An ExpressionStatement node.\n         */\n        function visitExpressionStatement(node) {\n            return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);\n        }\n        /**\n         * Visits a ParenthesizedExpression that may contain a destructuring assignment.\n         *\n         * @param node A ParenthesizedExpression node.\n         * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the\n         * expression of an `ExpressionStatement`).\n         */\n        function visitParenthesizedExpression(node, expressionResultIsUnused) {\n            return ts.visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context);\n        }\n        /**\n         * Visits a BinaryExpression that contains a destructuring assignment.\n         *\n         * @param node A BinaryExpression node.\n         * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the\n         * expression of an `ExpressionStatement`).\n         */\n        function visitBinaryExpression(node, expressionResultIsUnused) {\n            // If we are here it is because this is a destructuring assignment.\n            if (ts.isDestructuringAssignment(node)) {\n                return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, !expressionResultIsUnused);\n            }\n            if (node.operatorToken.kind === 27 /* CommaToken */) {\n                return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorWithUnusedExpressionResult, ts.isExpression), node.operatorToken, ts.visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, ts.isExpression));\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        /**\n         * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the\n         * expression of an `ExpressionStatement`).\n         */\n        function visitCommaListExpression(node, expressionResultIsUnused) {\n            if (expressionResultIsUnused) {\n                return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);\n            }\n            var result;\n            for (var i = 0; i < node.elements.length; i++) {\n                var element = node.elements[i];\n                var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression);\n                if (result || visited !== element) {\n                    result || (result = node.elements.slice(0, i));\n                    result.push(visited);\n                }\n            }\n            var elements = result ? ts.setTextRange(factory.createNodeArray(result), node.elements) : node.elements;\n            return factory.updateCommaListExpression(node, elements);\n        }\n        function isVariableStatementOfTypeScriptClassWrapper(node) {\n            return node.declarationList.declarations.length === 1\n                && !!node.declarationList.declarations[0].initializer\n                && !!(ts.getEmitFlags(node.declarationList.declarations[0].initializer) & 33554432 /* TypeScriptClassWrapper */);\n        }\n        function visitVariableStatement(node) {\n            var ancestorFacts = enterSubtree(0 /* None */, ts.hasSyntacticModifier(node, 1 /* Export */) ? 32 /* ExportedVariableStatement */ : 0 /* None */);\n            var updated;\n            if (convertedLoopState && (node.declarationList.flags & 3 /* BlockScoped */) === 0 && !isVariableStatementOfTypeScriptClassWrapper(node)) {\n                // we are inside a converted loop - hoist variable declarations\n                var assignments = void 0;\n                for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {\n                    var decl = _a[_i];\n                    hoistVariableDeclarationDeclaredInConvertedLoop(convertedLoopState, decl);\n                    if (decl.initializer) {\n                        var assignment = void 0;\n                        if (ts.isBindingPattern(decl.name)) {\n                            assignment = ts.flattenDestructuringAssignment(decl, visitor, context, 0 /* All */);\n                        }\n                        else {\n                            assignment = factory.createBinaryExpression(decl.name, 62 /* EqualsToken */, ts.visitNode(decl.initializer, visitor, ts.isExpression));\n                            ts.setTextRange(assignment, decl);\n                        }\n                        assignments = ts.append(assignments, assignment);\n                    }\n                }\n                if (assignments) {\n                    updated = ts.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(assignments)), node);\n                }\n                else {\n                    // none of declarations has initializer - the entire variable statement can be deleted\n                    updated = undefined;\n                }\n            }\n            else {\n                updated = ts.visitEachChild(node, visitor, context);\n            }\n            exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */);\n            return updated;\n        }\n        /**\n         * Visits a VariableDeclarationList that is block scoped (e.g. `let` or `const`).\n         *\n         * @param node A VariableDeclarationList node.\n         */\n        function visitVariableDeclarationList(node) {\n            if (node.flags & 3 /* BlockScoped */ || node.transformFlags & 131072 /* ContainsBindingPattern */) {\n                if (node.flags & 3 /* BlockScoped */) {\n                    enableSubstitutionsForBlockScopedBindings();\n                }\n                var declarations = ts.flatMap(node.declarations, node.flags & 1 /* Let */\n                    ? visitVariableDeclarationInLetDeclarationList\n                    : visitVariableDeclaration);\n                var declarationList = factory.createVariableDeclarationList(declarations);\n                ts.setOriginalNode(declarationList, node);\n                ts.setTextRange(declarationList, node);\n                ts.setCommentRange(declarationList, node);\n                // If the first or last declaration is a binding pattern, we need to modify\n                // the source map range for the declaration list.\n                if (node.transformFlags & 131072 /* ContainsBindingPattern */\n                    && (ts.isBindingPattern(node.declarations[0].name) || ts.isBindingPattern(ts.last(node.declarations).name))) {\n                    ts.setSourceMapRange(declarationList, getRangeUnion(declarations));\n                }\n                return declarationList;\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function getRangeUnion(declarations) {\n            // declarations may not be sorted by position.\n            // pos should be the minimum* position over all nodes (that's not -1), end should be the maximum end over all nodes.\n            var pos = -1, end = -1;\n            for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) {\n                var node = declarations_10[_i];\n                pos = pos === -1 ? node.pos : node.pos === -1 ? pos : Math.min(pos, node.pos);\n                end = Math.max(end, node.end);\n            }\n            return ts.createRange(pos, end);\n        }\n        /**\n         * Gets a value indicating whether we should emit an explicit initializer for a variable\n         * declaration in a `let` declaration list.\n         *\n         * @param node A VariableDeclaration node.\n         */\n        function shouldEmitExplicitInitializerForLetDeclaration(node) {\n            // Nested let bindings might need to be initialized explicitly to preserve\n            // ES6 semantic:\n            //\n            //  { let x = 1; }\n            //  { let x; } // x here should be undefined. not 1\n            //\n            // Top level bindings never collide with anything and thus don't require\n            // explicit initialization. As for nested let bindings there are two cases:\n            //\n            // - Nested let bindings that were not renamed definitely should be\n            //   initialized explicitly:\n            //\n            //    { let x = 1; }\n            //    { let x; if (some-condition) { x = 1}; if (x) { /*1*/ } }\n            //\n            //   Without explicit initialization code in /*1*/ can be executed even if\n            //   some-condition is evaluated to false.\n            //\n            // - Renaming introduces fresh name that should not collide with any\n            //   existing names, however renamed bindings sometimes also should be\n            //   explicitly initialized. One particular case: non-captured binding\n            //   declared inside loop body (but not in loop initializer):\n            //\n            //    let x;\n            //    for (;;) {\n            //        let x;\n            //    }\n            //\n            //   In downlevel codegen inner 'x' will be renamed so it won't collide\n            //   with outer 'x' however it will should be reset on every iteration as\n            //   if it was declared anew.\n            //\n            //   * Why non-captured binding?\n            //     - Because if loop contains block scoped binding captured in some\n            //       function then loop body will be rewritten to have a fresh scope\n            //       on every iteration so everything will just work.\n            //\n            //   * Why loop initializer is excluded?\n            //     - Since we've introduced a fresh name it already will be undefined.\n            var flags = resolver.getNodeCheckFlags(node);\n            var isCapturedInFunction = flags & 262144 /* CapturedBlockScopedBinding */;\n            var isDeclaredInLoop = flags & 524288 /* BlockScopedBindingInLoop */;\n            var emittedAsTopLevel = (hierarchyFacts & 64 /* TopLevel */) !== 0\n                || (isCapturedInFunction\n                    && isDeclaredInLoop\n                    && (hierarchyFacts & 512 /* IterationStatementBlock */) !== 0);\n            var emitExplicitInitializer = !emittedAsTopLevel\n                && (hierarchyFacts & 4096 /* ForInOrForOfStatement */) === 0\n                && (!resolver.isDeclarationWithCollidingName(node)\n                    || (isDeclaredInLoop\n                        && !isCapturedInFunction\n                        && (hierarchyFacts & (2048 /* ForStatement */ | 4096 /* ForInOrForOfStatement */)) === 0));\n            return emitExplicitInitializer;\n        }\n        /**\n         * Visits a VariableDeclaration in a `let` declaration list.\n         *\n         * @param node A VariableDeclaration node.\n         */\n        function visitVariableDeclarationInLetDeclarationList(node) {\n            // For binding pattern names that lack initializers there is no point to emit\n            // explicit initializer since downlevel codegen for destructuring will fail\n            // in the absence of initializer so all binding elements will say uninitialized\n            var name = node.name;\n            if (ts.isBindingPattern(name)) {\n                return visitVariableDeclaration(node);\n            }\n            if (!node.initializer && shouldEmitExplicitInitializerForLetDeclaration(node)) {\n                return factory.updateVariableDeclaration(node, node.name, /*exclamationToken*/ undefined, /*type*/ undefined, factory.createVoidZero());\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        /**\n         * Visits a VariableDeclaration node with a binding pattern.\n         *\n         * @param node A VariableDeclaration node.\n         */\n        function visitVariableDeclaration(node) {\n            var ancestorFacts = enterSubtree(32 /* ExportedVariableStatement */, 0 /* None */);\n            var updated;\n            if (ts.isBindingPattern(node.name)) {\n                updated = ts.flattenDestructuringBinding(node, visitor, context, 0 /* All */, \n                /*value*/ undefined, (ancestorFacts & 32 /* ExportedVariableStatement */) !== 0);\n            }\n            else {\n                updated = ts.visitEachChild(node, visitor, context);\n            }\n            exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */);\n            return updated;\n        }\n        function recordLabel(node) {\n            convertedLoopState.labels.set(ts.idText(node.label), true);\n        }\n        function resetLabel(node) {\n            convertedLoopState.labels.set(ts.idText(node.label), false);\n        }\n        function visitLabeledStatement(node) {\n            if (convertedLoopState && !convertedLoopState.labels) {\n                convertedLoopState.labels = new ts.Map();\n            }\n            var statement = ts.unwrapInnermostStatementOfLabel(node, convertedLoopState && recordLabel);\n            return ts.isIterationStatement(statement, /*lookInLabeledStatements*/ false)\n                ? visitIterationStatement(statement, /*outermostLabeledStatement*/ node)\n                : factory.restoreEnclosingLabel(ts.visitNode(statement, visitor, ts.isStatement, factory.liftToBlock), node, convertedLoopState && resetLabel);\n        }\n        function visitIterationStatement(node, outermostLabeledStatement) {\n            switch (node.kind) {\n                case 235 /* DoStatement */:\n                case 236 /* WhileStatement */:\n                    return visitDoOrWhileStatement(node, outermostLabeledStatement);\n                case 237 /* ForStatement */:\n                    return visitForStatement(node, outermostLabeledStatement);\n                case 238 /* ForInStatement */:\n                    return visitForInStatement(node, outermostLabeledStatement);\n                case 239 /* ForOfStatement */:\n                    return visitForOfStatement(node, outermostLabeledStatement);\n            }\n        }\n        function visitIterationStatementWithFacts(excludeFacts, includeFacts, node, outermostLabeledStatement, convert) {\n            var ancestorFacts = enterSubtree(excludeFacts, includeFacts);\n            var updated = convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, ancestorFacts, convert);\n            exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */);\n            return updated;\n        }\n        function visitDoOrWhileStatement(node, outermostLabeledStatement) {\n            return visitIterationStatementWithFacts(0 /* DoOrWhileStatementExcludes */, 1280 /* DoOrWhileStatementIncludes */, node, outermostLabeledStatement);\n        }\n        function visitForStatement(node, outermostLabeledStatement) {\n            return visitIterationStatementWithFacts(5056 /* ForStatementExcludes */, 3328 /* ForStatementIncludes */, node, outermostLabeledStatement);\n        }\n        function visitEachChildOfForStatement(node) {\n            return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock));\n        }\n        function visitForInStatement(node, outermostLabeledStatement) {\n            return visitIterationStatementWithFacts(3008 /* ForInOrForOfStatementExcludes */, 5376 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement);\n        }\n        function visitForOfStatement(node, outermostLabeledStatement) {\n            return visitIterationStatementWithFacts(3008 /* ForInOrForOfStatementExcludes */, 5376 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement, compilerOptions.downlevelIteration ? convertForOfStatementForIterable : convertForOfStatementForArray);\n        }\n        function convertForOfStatementHead(node, boundValue, convertedLoopBodyStatements) {\n            var statements = [];\n            var initializer = node.initializer;\n            if (ts.isVariableDeclarationList(initializer)) {\n                if (node.initializer.flags & 3 /* BlockScoped */) {\n                    enableSubstitutionsForBlockScopedBindings();\n                }\n                var firstOriginalDeclaration = ts.firstOrUndefined(initializer.declarations);\n                if (firstOriginalDeclaration && ts.isBindingPattern(firstOriginalDeclaration.name)) {\n                    // This works whether the declaration is a var, let, or const.\n                    // It will use rhsIterationValue _a[_i] as the initializer.\n                    var declarations = ts.flattenDestructuringBinding(firstOriginalDeclaration, visitor, context, 0 /* All */, boundValue);\n                    var declarationList = ts.setTextRange(factory.createVariableDeclarationList(declarations), node.initializer);\n                    ts.setOriginalNode(declarationList, node.initializer);\n                    // Adjust the source map range for the first declaration to align with the old\n                    // emitter.\n                    ts.setSourceMapRange(declarationList, ts.createRange(declarations[0].pos, ts.last(declarations).end));\n                    statements.push(factory.createVariableStatement(\n                    /*modifiers*/ undefined, declarationList));\n                }\n                else {\n                    // The following call does not include the initializer, so we have\n                    // to emit it separately.\n                    statements.push(ts.setTextRange(factory.createVariableStatement(\n                    /*modifiers*/ undefined, ts.setOriginalNode(ts.setTextRange(factory.createVariableDeclarationList([\n                        factory.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : factory.createTempVariable(/*recordTempVariable*/ undefined), \n                        /*exclamationToken*/ undefined, \n                        /*type*/ undefined, boundValue)\n                    ]), ts.moveRangePos(initializer, -1)), initializer)), ts.moveRangeEnd(initializer, -1)));\n                }\n            }\n            else {\n                // Initializer is an expression. Emit the expression in the body, so that it's\n                // evaluated on every iteration.\n                var assignment = factory.createAssignment(initializer, boundValue);\n                if (ts.isDestructuringAssignment(assignment)) {\n                    statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, /*expressionResultIsUnused*/ true)));\n                }\n                else {\n                    ts.setTextRangeEnd(assignment, initializer.end);\n                    statements.push(ts.setTextRange(factory.createExpressionStatement(ts.visitNode(assignment, visitor, ts.isExpression)), ts.moveRangeEnd(initializer, -1)));\n                }\n            }\n            if (convertedLoopBodyStatements) {\n                return createSyntheticBlockForConvertedStatements(ts.addRange(statements, convertedLoopBodyStatements));\n            }\n            else {\n                var statement = ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock);\n                if (ts.isBlock(statement)) {\n                    return factory.updateBlock(statement, ts.setTextRange(factory.createNodeArray(ts.concatenate(statements, statement.statements)), statement.statements));\n                }\n                else {\n                    statements.push(statement);\n                    return createSyntheticBlockForConvertedStatements(statements);\n                }\n            }\n        }\n        function createSyntheticBlockForConvertedStatements(statements) {\n            return ts.setEmitFlags(factory.createBlock(factory.createNodeArray(statements), \n            /*multiLine*/ true), 48 /* NoSourceMap */ | 384 /* NoTokenSourceMaps */);\n        }\n        function convertForOfStatementForArray(node, outermostLabeledStatement, convertedLoopBodyStatements) {\n            // The following ES6 code:\n            //\n            //    for (let v of expr) { }\n            //\n            // should be emitted as\n            //\n            //    for (var _i = 0, _a = expr; _i < _a.length; _i++) {\n            //        var v = _a[_i];\n            //    }\n            //\n            // where _a and _i are temps emitted to capture the RHS and the counter,\n            // respectively.\n            // When the left hand side is an expression instead of a let declaration,\n            // the \"let v\" is not emitted.\n            // When the left hand side is a let/const, the v is renamed if there is\n            // another v in scope.\n            // Note that all assignments to the LHS are emitted in the body, including\n            // all destructuring.\n            // Note also that because an extra statement is needed to assign to the LHS,\n            // for-of bodies are always emitted as blocks.\n            var expression = ts.visitNode(node.expression, visitor, ts.isExpression);\n            // In the case where the user wrote an identifier as the RHS, like this:\n            //\n            //     for (let v of arr) { }\n            //\n            // we don't want to emit a temporary variable for the RHS, just use it directly.\n            var counter = factory.createLoopVariable();\n            var rhsReference = ts.isIdentifier(expression) ? factory.getGeneratedNameForNode(expression) : factory.createTempVariable(/*recordTempVariable*/ undefined);\n            // The old emitter does not emit source maps for the expression\n            ts.setEmitFlags(expression, 48 /* NoSourceMap */ | ts.getEmitFlags(expression));\n            var forStatement = ts.setTextRange(factory.createForStatement(\n            /*initializer*/ ts.setEmitFlags(ts.setTextRange(factory.createVariableDeclarationList([\n                ts.setTextRange(factory.createVariableDeclaration(counter, /*exclamationToken*/ undefined, /*type*/ undefined, factory.createNumericLiteral(0)), ts.moveRangePos(node.expression, -1)),\n                ts.setTextRange(factory.createVariableDeclaration(rhsReference, /*exclamationToken*/ undefined, /*type*/ undefined, expression), node.expression)\n            ]), node.expression), 2097152 /* NoHoisting */), \n            /*condition*/ ts.setTextRange(factory.createLessThan(counter, factory.createPropertyAccessExpression(rhsReference, \"length\")), node.expression), \n            /*incrementor*/ ts.setTextRange(factory.createPostfixIncrement(counter), node.expression), \n            /*statement*/ convertForOfStatementHead(node, factory.createElementAccessExpression(rhsReference, counter), convertedLoopBodyStatements)), \n            /*location*/ node);\n            // Disable trailing source maps for the OpenParenToken to align source map emit with the old emitter.\n            ts.setEmitFlags(forStatement, 256 /* NoTokenTrailingSourceMaps */);\n            ts.setTextRange(forStatement, node);\n            return factory.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel);\n        }\n        function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements, ancestorFacts) {\n            var expression = ts.visitNode(node.expression, visitor, ts.isExpression);\n            var iterator = ts.isIdentifier(expression) ? factory.getGeneratedNameForNode(expression) : factory.createTempVariable(/*recordTempVariable*/ undefined);\n            var result = ts.isIdentifier(expression) ? factory.getGeneratedNameForNode(iterator) : factory.createTempVariable(/*recordTempVariable*/ undefined);\n            var errorRecord = factory.createUniqueName(\"e\");\n            var catchVariable = factory.getGeneratedNameForNode(errorRecord);\n            var returnMethod = factory.createTempVariable(/*recordTempVariable*/ undefined);\n            var values = ts.setTextRange(emitHelpers().createValuesHelper(expression), node.expression);\n            var next = factory.createCallExpression(factory.createPropertyAccessExpression(iterator, \"next\"), /*typeArguments*/ undefined, []);\n            hoistVariableDeclaration(errorRecord);\n            hoistVariableDeclaration(returnMethod);\n            // if we are enclosed in an outer loop ensure we reset 'errorRecord' per each iteration\n            var initializer = ancestorFacts & 1024 /* IterationContainer */\n                ? factory.inlineExpressions([factory.createAssignment(errorRecord, factory.createVoidZero()), values])\n                : values;\n            var forStatement = ts.setEmitFlags(ts.setTextRange(factory.createForStatement(\n            /*initializer*/ ts.setEmitFlags(ts.setTextRange(factory.createVariableDeclarationList([\n                ts.setTextRange(factory.createVariableDeclaration(iterator, /*exclamationToken*/ undefined, /*type*/ undefined, initializer), node.expression),\n                factory.createVariableDeclaration(result, /*exclamationToken*/ undefined, /*type*/ undefined, next)\n            ]), node.expression), 2097152 /* NoHoisting */), \n            /*condition*/ factory.createLogicalNot(factory.createPropertyAccessExpression(result, \"done\")), \n            /*incrementor*/ factory.createAssignment(result, next), \n            /*statement*/ convertForOfStatementHead(node, factory.createPropertyAccessExpression(result, \"value\"), convertedLoopBodyStatements)), \n            /*location*/ node), 256 /* NoTokenTrailingSourceMaps */);\n            return factory.createTryStatement(factory.createBlock([\n                factory.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel)\n            ]), factory.createCatchClause(factory.createVariableDeclaration(catchVariable), ts.setEmitFlags(factory.createBlock([\n                factory.createExpressionStatement(factory.createAssignment(errorRecord, factory.createObjectLiteralExpression([\n                    factory.createPropertyAssignment(\"error\", catchVariable)\n                ])))\n            ]), 1 /* SingleLine */)), factory.createBlock([\n                factory.createTryStatement(\n                /*tryBlock*/ factory.createBlock([\n                    ts.setEmitFlags(factory.createIfStatement(factory.createLogicalAnd(factory.createLogicalAnd(result, factory.createLogicalNot(factory.createPropertyAccessExpression(result, \"done\"))), factory.createAssignment(returnMethod, factory.createPropertyAccessExpression(iterator, \"return\"))), factory.createExpressionStatement(factory.createFunctionCallCall(returnMethod, iterator, []))), 1 /* SingleLine */),\n                ]), \n                /*catchClause*/ undefined, \n                /*finallyBlock*/ ts.setEmitFlags(factory.createBlock([\n                    ts.setEmitFlags(factory.createIfStatement(errorRecord, factory.createThrowStatement(factory.createPropertyAccessExpression(errorRecord, \"error\"))), 1 /* SingleLine */)\n                ]), 1 /* SingleLine */))\n            ]));\n        }\n        /**\n         * Visits an ObjectLiteralExpression with computed property names.\n         *\n         * @param node An ObjectLiteralExpression node.\n         */\n        function visitObjectLiteralExpression(node) {\n            var properties = node.properties;\n            // Find the first computed property.\n            // Everything until that point can be emitted as part of the initial object literal.\n            var numInitialProperties = -1, hasComputed = false;\n            for (var i = 0; i < properties.length; i++) {\n                var property = properties[i];\n                if ((property.transformFlags & 262144 /* ContainsYield */ &&\n                    hierarchyFacts & 4 /* AsyncFunctionBody */)\n                    || (hasComputed = ts.Debug.checkDefined(property.name).kind === 158 /* ComputedPropertyName */)) {\n                    numInitialProperties = i;\n                    break;\n                }\n            }\n            if (numInitialProperties < 0) {\n                return ts.visitEachChild(node, visitor, context);\n            }\n            // For computed properties, we need to create a unique handle to the object\n            // literal so we can modify it without risking internal assignments tainting the object.\n            var temp = factory.createTempVariable(hoistVariableDeclaration);\n            // Write out the first non-computed properties, then emit the rest through indexing on the temp variable.\n            var expressions = [];\n            var assignment = factory.createAssignment(temp, ts.setEmitFlags(factory.createObjectLiteralExpression(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), node.multiLine), hasComputed ? 65536 /* Indented */ : 0));\n            if (node.multiLine) {\n                ts.startOnNewLine(assignment);\n            }\n            expressions.push(assignment);\n            addObjectLiteralMembers(expressions, node, temp, numInitialProperties);\n            // We need to clone the temporary identifier so that we can write it on a\n            // new line\n            expressions.push(node.multiLine ? ts.startOnNewLine(ts.setParent(ts.setTextRange(factory.cloneNode(temp), temp), temp.parent)) : temp);\n            return factory.inlineExpressions(expressions);\n        }\n        function shouldConvertPartOfIterationStatement(node) {\n            return (resolver.getNodeCheckFlags(node) & 131072 /* ContainsCapturedBlockScopeBinding */) !== 0;\n        }\n        function shouldConvertInitializerOfForStatement(node) {\n            return ts.isForStatement(node) && !!node.initializer && shouldConvertPartOfIterationStatement(node.initializer);\n        }\n        function shouldConvertConditionOfForStatement(node) {\n            return ts.isForStatement(node) && !!node.condition && shouldConvertPartOfIterationStatement(node.condition);\n        }\n        function shouldConvertIncrementorOfForStatement(node) {\n            return ts.isForStatement(node) && !!node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor);\n        }\n        function shouldConvertIterationStatement(node) {\n            return shouldConvertBodyOfIterationStatement(node)\n                || shouldConvertInitializerOfForStatement(node);\n        }\n        function shouldConvertBodyOfIterationStatement(node) {\n            return (resolver.getNodeCheckFlags(node) & 65536 /* LoopWithCapturedBlockScopedBinding */) !== 0;\n        }\n        /**\n         * Records constituents of name for the given variable to be hoisted in the outer scope.\n         */\n        function hoistVariableDeclarationDeclaredInConvertedLoop(state, node) {\n            if (!state.hoistedLocalVariables) {\n                state.hoistedLocalVariables = [];\n            }\n            visit(node.name);\n            function visit(node) {\n                if (node.kind === 78 /* Identifier */) {\n                    state.hoistedLocalVariables.push(node);\n                }\n                else {\n                    for (var _i = 0, _a = node.elements; _i < _a.length; _i++) {\n                        var element = _a[_i];\n                        if (!ts.isOmittedExpression(element)) {\n                            visit(element.name);\n                        }\n                    }\n                }\n            }\n        }\n        function convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, ancestorFacts, convert) {\n            if (!shouldConvertIterationStatement(node)) {\n                var saveAllowedNonLabeledJumps = void 0;\n                if (convertedLoopState) {\n                    // we get here if we are trying to emit normal loop loop inside converted loop\n                    // set allowedNonLabeledJumps to Break | Continue to mark that break\\continue inside the loop should be emitted as is\n                    saveAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps;\n                    convertedLoopState.allowedNonLabeledJumps = 2 /* Break */ | 4 /* Continue */;\n                }\n                var result = convert\n                    ? convert(node, outermostLabeledStatement, /*convertedLoopBodyStatements*/ undefined, ancestorFacts)\n                    : factory.restoreEnclosingLabel(ts.isForStatement(node) ? visitEachChildOfForStatement(node) : ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel);\n                if (convertedLoopState) {\n                    convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps;\n                }\n                return result;\n            }\n            var currentState = createConvertedLoopState(node);\n            var statements = [];\n            var outerConvertedLoopState = convertedLoopState;\n            convertedLoopState = currentState;\n            var initializerFunction = shouldConvertInitializerOfForStatement(node) ? createFunctionForInitializerOfForStatement(node, currentState) : undefined;\n            var bodyFunction = shouldConvertBodyOfIterationStatement(node) ? createFunctionForBodyOfIterationStatement(node, currentState, outerConvertedLoopState) : undefined;\n            convertedLoopState = outerConvertedLoopState;\n            if (initializerFunction)\n                statements.push(initializerFunction.functionDeclaration);\n            if (bodyFunction)\n                statements.push(bodyFunction.functionDeclaration);\n            addExtraDeclarationsForConvertedLoop(statements, currentState, outerConvertedLoopState);\n            if (initializerFunction) {\n                statements.push(generateCallToConvertedLoopInitializer(initializerFunction.functionName, initializerFunction.containsYield));\n            }\n            var loop;\n            if (bodyFunction) {\n                if (convert) {\n                    loop = convert(node, outermostLabeledStatement, bodyFunction.part, ancestorFacts);\n                }\n                else {\n                    var clone_3 = convertIterationStatementCore(node, initializerFunction, factory.createBlock(bodyFunction.part, /*multiLine*/ true));\n                    loop = factory.restoreEnclosingLabel(clone_3, outermostLabeledStatement, convertedLoopState && resetLabel);\n                }\n            }\n            else {\n                var clone_4 = convertIterationStatementCore(node, initializerFunction, ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock));\n                loop = factory.restoreEnclosingLabel(clone_4, outermostLabeledStatement, convertedLoopState && resetLabel);\n            }\n            statements.push(loop);\n            return statements;\n        }\n        function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) {\n            switch (node.kind) {\n                case 237 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody);\n                case 238 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody);\n                case 239 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody);\n                case 235 /* DoStatement */: return convertDoStatement(node, convertedLoopBody);\n                case 236 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody);\n                default: return ts.Debug.failBadSyntaxKind(node, \"IterationStatement expected\");\n            }\n        }\n        function convertForStatement(node, initializerFunction, convertedLoopBody) {\n            var shouldConvertCondition = node.condition && shouldConvertPartOfIterationStatement(node.condition);\n            var shouldConvertIncrementor = shouldConvertCondition || node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor);\n            return factory.updateForStatement(node, ts.visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(shouldConvertCondition ? undefined : node.condition, visitor, ts.isExpression), ts.visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), convertedLoopBody);\n        }\n        function convertForOfStatement(node, convertedLoopBody) {\n            return factory.updateForOfStatement(node, \n            /*awaitModifier*/ undefined, ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), convertedLoopBody);\n        }\n        function convertForInStatement(node, convertedLoopBody) {\n            return factory.updateForInStatement(node, ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), convertedLoopBody);\n        }\n        function convertDoStatement(node, convertedLoopBody) {\n            return factory.updateDoStatement(node, convertedLoopBody, ts.visitNode(node.expression, visitor, ts.isExpression));\n        }\n        function convertWhileStatement(node, convertedLoopBody) {\n            return factory.updateWhileStatement(node, ts.visitNode(node.expression, visitor, ts.isExpression), convertedLoopBody);\n        }\n        function createConvertedLoopState(node) {\n            var loopInitializer;\n            switch (node.kind) {\n                case 237 /* ForStatement */:\n                case 238 /* ForInStatement */:\n                case 239 /* ForOfStatement */:\n                    var initializer = node.initializer;\n                    if (initializer && initializer.kind === 250 /* VariableDeclarationList */) {\n                        loopInitializer = initializer;\n                    }\n                    break;\n            }\n            // variables that will be passed to the loop as parameters\n            var loopParameters = [];\n            // variables declared in the loop initializer that will be changed inside the loop\n            var loopOutParameters = [];\n            if (loopInitializer && (ts.getCombinedNodeFlags(loopInitializer) & 3 /* BlockScoped */)) {\n                var hasCapturedBindingsInForInitializer = shouldConvertInitializerOfForStatement(node);\n                for (var _i = 0, _a = loopInitializer.declarations; _i < _a.length; _i++) {\n                    var decl = _a[_i];\n                    processLoopVariableDeclaration(node, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForInitializer);\n                }\n            }\n            var currentState = { loopParameters: loopParameters, loopOutParameters: loopOutParameters };\n            if (convertedLoopState) {\n                // convertedOuterLoopState !== undefined means that this converted loop is nested in another converted loop.\n                // if outer converted loop has already accumulated some state - pass it through\n                if (convertedLoopState.argumentsName) {\n                    // outer loop has already used 'arguments' so we've already have some name to alias it\n                    // use the same name in all nested loops\n                    currentState.argumentsName = convertedLoopState.argumentsName;\n                }\n                if (convertedLoopState.thisName) {\n                    // outer loop has already used 'this' so we've already have some name to alias it\n                    // use the same name in all nested loops\n                    currentState.thisName = convertedLoopState.thisName;\n                }\n                if (convertedLoopState.hoistedLocalVariables) {\n                    // we've already collected some non-block scoped variable declarations in enclosing loop\n                    // use the same storage in nested loop\n                    currentState.hoistedLocalVariables = convertedLoopState.hoistedLocalVariables;\n                }\n            }\n            return currentState;\n        }\n        function addExtraDeclarationsForConvertedLoop(statements, state, outerState) {\n            var extraVariableDeclarations;\n            // propagate state from the inner loop to the outer loop if necessary\n            if (state.argumentsName) {\n                // if alias for arguments is set\n                if (outerState) {\n                    // pass it to outer converted loop\n                    outerState.argumentsName = state.argumentsName;\n                }\n                else {\n                    // this is top level converted loop and we need to create an alias for 'arguments' object\n                    (extraVariableDeclarations || (extraVariableDeclarations = [])).push(factory.createVariableDeclaration(state.argumentsName, \n                    /*exclamationToken*/ undefined, \n                    /*type*/ undefined, factory.createIdentifier(\"arguments\")));\n                }\n            }\n            if (state.thisName) {\n                // if alias for this is set\n                if (outerState) {\n                    // pass it to outer converted loop\n                    outerState.thisName = state.thisName;\n                }\n                else {\n                    // this is top level converted loop so we need to create an alias for 'this' here\n                    // NOTE:\n                    // if converted loops were all nested in arrow function then we'll always emit '_this' so convertedLoopState.thisName will not be set.\n                    // If it is set this means that all nested loops are not nested in arrow function and it is safe to capture 'this'.\n                    (extraVariableDeclarations || (extraVariableDeclarations = [])).push(factory.createVariableDeclaration(state.thisName, \n                    /*exclamationToken*/ undefined, \n                    /*type*/ undefined, factory.createIdentifier(\"this\")));\n                }\n            }\n            if (state.hoistedLocalVariables) {\n                // if hoistedLocalVariables !== undefined this means that we've possibly collected some variable declarations to be hoisted later\n                if (outerState) {\n                    // pass them to outer converted loop\n                    outerState.hoistedLocalVariables = state.hoistedLocalVariables;\n                }\n                else {\n                    if (!extraVariableDeclarations) {\n                        extraVariableDeclarations = [];\n                    }\n                    // hoist collected variable declarations\n                    for (var _i = 0, _a = state.hoistedLocalVariables; _i < _a.length; _i++) {\n                        var identifier = _a[_i];\n                        extraVariableDeclarations.push(factory.createVariableDeclaration(identifier));\n                    }\n                }\n            }\n            // add extra variables to hold out parameters if necessary\n            if (state.loopOutParameters.length) {\n                if (!extraVariableDeclarations) {\n                    extraVariableDeclarations = [];\n                }\n                for (var _b = 0, _c = state.loopOutParameters; _b < _c.length; _b++) {\n                    var outParam = _c[_b];\n                    extraVariableDeclarations.push(factory.createVariableDeclaration(outParam.outParamName));\n                }\n            }\n            if (state.conditionVariable) {\n                if (!extraVariableDeclarations) {\n                    extraVariableDeclarations = [];\n                }\n                extraVariableDeclarations.push(factory.createVariableDeclaration(state.conditionVariable, /*exclamationToken*/ undefined, /*type*/ undefined, factory.createFalse()));\n            }\n            // create variable statement to hold all introduced variable declarations\n            if (extraVariableDeclarations) {\n                statements.push(factory.createVariableStatement(\n                /*modifiers*/ undefined, factory.createVariableDeclarationList(extraVariableDeclarations)));\n            }\n        }\n        function createOutVariable(p) {\n            return factory.createVariableDeclaration(p.originalName, /*exclamationToken*/ undefined, /*type*/ undefined, p.outParamName);\n        }\n        /**\n         * Creates a `_loop_init` function for a `ForStatement` with a block-scoped initializer\n         * that is captured in a closure inside of the initializer. The `_loop_init` function is\n         * used to preserve the per-iteration environment semantics of\n         * [13.7.4.8 RS: ForBodyEvaluation](https://tc39.github.io/ecma262/#sec-forbodyevaluation).\n         */\n        function createFunctionForInitializerOfForStatement(node, currentState) {\n            var functionName = factory.createUniqueName(\"_loop_init\");\n            var containsYield = (node.initializer.transformFlags & 262144 /* ContainsYield */) !== 0;\n            var emitFlags = 0 /* None */;\n            if (currentState.containsLexicalThis)\n                emitFlags |= 8 /* CapturesThis */;\n            if (containsYield && hierarchyFacts & 4 /* AsyncFunctionBody */)\n                emitFlags |= 262144 /* AsyncFunctionBody */;\n            var statements = [];\n            statements.push(factory.createVariableStatement(/*modifiers*/ undefined, node.initializer));\n            copyOutParameters(currentState.loopOutParameters, 2 /* Initializer */, 1 /* ToOutParameter */, statements);\n            // This transforms the following ES2015 syntax:\n            //\n            //  for (let i = (setImmediate(() => console.log(i)), 0); i < 2; i++) {\n            //      // loop body\n            //  }\n            //\n            // Into the following ES5 syntax:\n            //\n            //  var _loop_init_1 = function () {\n            //      var i = (setImmediate(() => console.log(i)), 0);\n            //      out_i_1 = i;\n            //  };\n            //  var out_i_1;\n            //  _loop_init_1();\n            //  for (var i = out_i_1; i < 2; i++) {\n            //      // loop body\n            //  }\n            //\n            // Which prevents mutations to `i` in the per-iteration environment of the body\n            // from affecting the initial value for `i` outside of the per-iteration environment.\n            var functionDeclaration = factory.createVariableStatement(\n            /*modifiers*/ undefined, ts.setEmitFlags(factory.createVariableDeclarationList([\n                factory.createVariableDeclaration(functionName, \n                /*exclamationToken*/ undefined, \n                /*type*/ undefined, ts.setEmitFlags(factory.createFunctionExpression(\n                /*modifiers*/ undefined, containsYield ? factory.createToken(41 /* AsteriskToken */) : undefined, \n                /*name*/ undefined, \n                /*typeParameters*/ undefined, \n                /*parameters*/ undefined, \n                /*type*/ undefined, ts.visitNode(factory.createBlock(statements, /*multiLine*/ true), visitor, ts.isBlock)), emitFlags))\n            ]), 2097152 /* NoHoisting */));\n            var part = factory.createVariableDeclarationList(ts.map(currentState.loopOutParameters, createOutVariable));\n            return { functionName: functionName, containsYield: containsYield, functionDeclaration: functionDeclaration, part: part };\n        }\n        /**\n         * Creates a `_loop` function for an `IterationStatement` with a block-scoped initializer\n         * that is captured in a closure inside of the loop body. The `_loop` function is used to\n         * preserve the per-iteration environment semantics of\n         * [13.7.4.8 RS: ForBodyEvaluation](https://tc39.github.io/ecma262/#sec-forbodyevaluation).\n         */\n        function createFunctionForBodyOfIterationStatement(node, currentState, outerState) {\n            var functionName = factory.createUniqueName(\"_loop\");\n            startLexicalEnvironment();\n            var statement = ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock);\n            var lexicalEnvironment = endLexicalEnvironment();\n            var statements = [];\n            if (shouldConvertConditionOfForStatement(node) || shouldConvertIncrementorOfForStatement(node)) {\n                // If a block-scoped variable declared in the initializer of `node` is captured in\n                // the condition or incrementor, we must move the condition and incrementor into\n                // the body of the for loop.\n                //\n                // This transforms the following ES2015 syntax:\n                //\n                //  for (let i = 0; setImmediate(() => console.log(i)), i < 2; setImmediate(() => console.log(i)), i++) {\n                //      // loop body\n                //  }\n                //\n                // Into the following ES5 syntax:\n                //\n                //  var _loop_1 = function (i) {\n                //      if (inc_1)\n                //          setImmediate(() => console.log(i)), i++;\n                //      else\n                //          inc_1 = true;\n                //      if (!(setImmediate(() => console.log(i)), i < 2))\n                //          return out_i_1 = i, \"break\";\n                //      // loop body\n                //      out_i_1 = i;\n                //  }\n                //  var out_i_1, inc_1 = false;\n                //  for (var i = 0;;) {\n                //      var state_1 = _loop_1(i);\n                //      i = out_i_1;\n                //      if (state_1 === \"break\")\n                //          break;\n                //  }\n                //\n                // Which prevents mutations to `i` in the per-iteration environment of the body\n                // from affecting the value of `i` in the previous per-iteration environment.\n                //\n                // Note that the incrementor of a `for` loop is evaluated in a *new* per-iteration\n                // environment that is carried over to the next iteration of the loop. As a result,\n                // we must indicate whether this is the first evaluation of the loop body so that\n                // we only evaluate the incrementor on subsequent evaluations.\n                currentState.conditionVariable = factory.createUniqueName(\"inc\");\n                if (node.incrementor) {\n                    statements.push(factory.createIfStatement(currentState.conditionVariable, factory.createExpressionStatement(ts.visitNode(node.incrementor, visitor, ts.isExpression)), factory.createExpressionStatement(factory.createAssignment(currentState.conditionVariable, factory.createTrue()))));\n                }\n                else {\n                    statements.push(factory.createIfStatement(factory.createLogicalNot(currentState.conditionVariable), factory.createExpressionStatement(factory.createAssignment(currentState.conditionVariable, factory.createTrue()))));\n                }\n                if (shouldConvertConditionOfForStatement(node)) {\n                    statements.push(factory.createIfStatement(factory.createPrefixUnaryExpression(53 /* ExclamationToken */, ts.visitNode(node.condition, visitor, ts.isExpression)), ts.visitNode(factory.createBreakStatement(), visitor, ts.isStatement)));\n                }\n            }\n            if (ts.isBlock(statement)) {\n                ts.addRange(statements, statement.statements);\n            }\n            else {\n                statements.push(statement);\n            }\n            copyOutParameters(currentState.loopOutParameters, 1 /* Body */, 1 /* ToOutParameter */, statements);\n            ts.insertStatementsAfterStandardPrologue(statements, lexicalEnvironment);\n            var loopBody = factory.createBlock(statements, /*multiLine*/ true);\n            if (ts.isBlock(statement))\n                ts.setOriginalNode(loopBody, statement);\n            var containsYield = (node.statement.transformFlags & 262144 /* ContainsYield */) !== 0;\n            var emitFlags = 524288 /* ReuseTempVariableScope */;\n            if (currentState.containsLexicalThis)\n                emitFlags |= 8 /* CapturesThis */;\n            if (containsYield && (hierarchyFacts & 4 /* AsyncFunctionBody */) !== 0)\n                emitFlags |= 262144 /* AsyncFunctionBody */;\n            // This transforms the following ES2015 syntax (in addition to other variations):\n            //\n            //  for (let i = 0; i < 2; i++) {\n            //      setImmediate(() => console.log(i));\n            //  }\n            //\n            // Into the following ES5 syntax:\n            //\n            //  var _loop_1 = function (i) {\n            //      setImmediate(() => console.log(i));\n            //  };\n            //  for (var i = 0; i < 2; i++) {\n            //      _loop_1(i);\n            //  }\n            var functionDeclaration = factory.createVariableStatement(\n            /*modifiers*/ undefined, ts.setEmitFlags(factory.createVariableDeclarationList([\n                factory.createVariableDeclaration(functionName, \n                /*exclamationToken*/ undefined, \n                /*type*/ undefined, ts.setEmitFlags(factory.createFunctionExpression(\n                /*modifiers*/ undefined, containsYield ? factory.createToken(41 /* AsteriskToken */) : undefined, \n                /*name*/ undefined, \n                /*typeParameters*/ undefined, currentState.loopParameters, \n                /*type*/ undefined, loopBody), emitFlags))\n            ]), 2097152 /* NoHoisting */));\n            var part = generateCallToConvertedLoop(functionName, currentState, outerState, containsYield);\n            return { functionName: functionName, containsYield: containsYield, functionDeclaration: functionDeclaration, part: part };\n        }\n        function copyOutParameter(outParam, copyDirection) {\n            var source = copyDirection === 0 /* ToOriginal */ ? outParam.outParamName : outParam.originalName;\n            var target = copyDirection === 0 /* ToOriginal */ ? outParam.originalName : outParam.outParamName;\n            return factory.createBinaryExpression(target, 62 /* EqualsToken */, source);\n        }\n        function copyOutParameters(outParams, partFlags, copyDirection, statements) {\n            for (var _i = 0, outParams_1 = outParams; _i < outParams_1.length; _i++) {\n                var outParam = outParams_1[_i];\n                if (outParam.flags & partFlags) {\n                    statements.push(factory.createExpressionStatement(copyOutParameter(outParam, copyDirection)));\n                }\n            }\n        }\n        function generateCallToConvertedLoopInitializer(initFunctionExpressionName, containsYield) {\n            var call = factory.createCallExpression(initFunctionExpressionName, /*typeArguments*/ undefined, []);\n            var callResult = containsYield\n                ? factory.createYieldExpression(factory.createToken(41 /* AsteriskToken */), ts.setEmitFlags(call, 8388608 /* Iterator */))\n                : call;\n            return factory.createExpressionStatement(callResult);\n        }\n        function generateCallToConvertedLoop(loopFunctionExpressionName, state, outerState, containsYield) {\n            var statements = [];\n            // loop is considered simple if it does not have any return statements or break\\continue that transfer control outside of the loop\n            // simple loops are emitted as just 'loop()';\n            // NOTE: if loop uses only 'continue' it still will be emitted as simple loop\n            var isSimpleLoop = !(state.nonLocalJumps & ~4 /* Continue */) &&\n                !state.labeledNonLocalBreaks &&\n                !state.labeledNonLocalContinues;\n            var call = factory.createCallExpression(loopFunctionExpressionName, /*typeArguments*/ undefined, ts.map(state.loopParameters, function (p) { return p.name; }));\n            var callResult = containsYield\n                ? factory.createYieldExpression(factory.createToken(41 /* AsteriskToken */), ts.setEmitFlags(call, 8388608 /* Iterator */))\n                : call;\n            if (isSimpleLoop) {\n                statements.push(factory.createExpressionStatement(callResult));\n                copyOutParameters(state.loopOutParameters, 1 /* Body */, 0 /* ToOriginal */, statements);\n            }\n            else {\n                var loopResultName = factory.createUniqueName(\"state\");\n                var stateVariable = factory.createVariableStatement(\n                /*modifiers*/ undefined, factory.createVariableDeclarationList([factory.createVariableDeclaration(loopResultName, /*exclamationToken*/ undefined, /*type*/ undefined, callResult)]));\n                statements.push(stateVariable);\n                copyOutParameters(state.loopOutParameters, 1 /* Body */, 0 /* ToOriginal */, statements);\n                if (state.nonLocalJumps & 8 /* Return */) {\n                    var returnStatement = void 0;\n                    if (outerState) {\n                        outerState.nonLocalJumps |= 8 /* Return */;\n                        returnStatement = factory.createReturnStatement(loopResultName);\n                    }\n                    else {\n                        returnStatement = factory.createReturnStatement(factory.createPropertyAccessExpression(loopResultName, \"value\"));\n                    }\n                    statements.push(factory.createIfStatement(factory.createTypeCheck(loopResultName, \"object\"), returnStatement));\n                }\n                if (state.nonLocalJumps & 2 /* Break */) {\n                    statements.push(factory.createIfStatement(factory.createStrictEquality(loopResultName, factory.createStringLiteral(\"break\")), factory.createBreakStatement()));\n                }\n                if (state.labeledNonLocalBreaks || state.labeledNonLocalContinues) {\n                    var caseClauses = [];\n                    processLabeledJumps(state.labeledNonLocalBreaks, /*isBreak*/ true, loopResultName, outerState, caseClauses);\n                    processLabeledJumps(state.labeledNonLocalContinues, /*isBreak*/ false, loopResultName, outerState, caseClauses);\n                    statements.push(factory.createSwitchStatement(loopResultName, factory.createCaseBlock(caseClauses)));\n                }\n            }\n            return statements;\n        }\n        function setLabeledJump(state, isBreak, labelText, labelMarker) {\n            if (isBreak) {\n                if (!state.labeledNonLocalBreaks) {\n                    state.labeledNonLocalBreaks = new ts.Map();\n                }\n                state.labeledNonLocalBreaks.set(labelText, labelMarker);\n            }\n            else {\n                if (!state.labeledNonLocalContinues) {\n                    state.labeledNonLocalContinues = new ts.Map();\n                }\n                state.labeledNonLocalContinues.set(labelText, labelMarker);\n            }\n        }\n        function processLabeledJumps(table, isBreak, loopResultName, outerLoop, caseClauses) {\n            if (!table) {\n                return;\n            }\n            table.forEach(function (labelMarker, labelText) {\n                var statements = [];\n                // if there are no outer converted loop or outer label in question is located inside outer converted loop\n                // then emit labeled break\\continue\n                // otherwise propagate pair 'label -> marker' to outer converted loop and emit 'return labelMarker' so outer loop can later decide what to do\n                if (!outerLoop || (outerLoop.labels && outerLoop.labels.get(labelText))) {\n                    var label = factory.createIdentifier(labelText);\n                    statements.push(isBreak ? factory.createBreakStatement(label) : factory.createContinueStatement(label));\n                }\n                else {\n                    setLabeledJump(outerLoop, isBreak, labelText, labelMarker);\n                    statements.push(factory.createReturnStatement(loopResultName));\n                }\n                caseClauses.push(factory.createCaseClause(factory.createStringLiteral(labelMarker), statements));\n            });\n        }\n        function processLoopVariableDeclaration(container, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForInitializer) {\n            var name = decl.name;\n            if (ts.isBindingPattern(name)) {\n                for (var _i = 0, _a = name.elements; _i < _a.length; _i++) {\n                    var element = _a[_i];\n                    if (!ts.isOmittedExpression(element)) {\n                        processLoopVariableDeclaration(container, element, loopParameters, loopOutParameters, hasCapturedBindingsInForInitializer);\n                    }\n                }\n            }\n            else {\n                loopParameters.push(factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, name));\n                var checkFlags = resolver.getNodeCheckFlags(decl);\n                if (checkFlags & 4194304 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForInitializer) {\n                    var outParamName = factory.createUniqueName(\"out_\" + ts.idText(name));\n                    var flags = 0;\n                    if (checkFlags & 4194304 /* NeedsLoopOutParameter */) {\n                        flags |= 1 /* Body */;\n                    }\n                    if (ts.isForStatement(container) && container.initializer && resolver.isBindingCapturedByNode(container.initializer, decl)) {\n                        flags |= 2 /* Initializer */;\n                    }\n                    loopOutParameters.push({ flags: flags, originalName: name, outParamName: outParamName });\n                }\n            }\n        }\n        /**\n         * Adds the members of an object literal to an array of expressions.\n         *\n         * @param expressions An array of expressions.\n         * @param node An ObjectLiteralExpression node.\n         * @param receiver The receiver for members of the ObjectLiteralExpression.\n         * @param numInitialNonComputedProperties The number of initial properties without\n         *                                        computed property names.\n         */\n        function addObjectLiteralMembers(expressions, node, receiver, start) {\n            var properties = node.properties;\n            var numProperties = properties.length;\n            for (var i = start; i < numProperties; i++) {\n                var property = properties[i];\n                switch (property.kind) {\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                        var accessors = ts.getAllAccessorDeclarations(node.properties, property);\n                        if (property === accessors.firstAccessor) {\n                            expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine));\n                        }\n                        break;\n                    case 165 /* MethodDeclaration */:\n                        expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine));\n                        break;\n                    case 288 /* PropertyAssignment */:\n                        expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine));\n                        break;\n                    case 289 /* ShorthandPropertyAssignment */:\n                        expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine));\n                        break;\n                    default:\n                        ts.Debug.failBadSyntaxKind(node);\n                        break;\n                }\n            }\n        }\n        /**\n         * Transforms a PropertyAssignment node into an expression.\n         *\n         * @param node The ObjectLiteralExpression that contains the PropertyAssignment.\n         * @param property The PropertyAssignment node.\n         * @param receiver The receiver for the assignment.\n         */\n        function transformPropertyAssignmentToExpression(property, receiver, startsOnNewLine) {\n            var expression = factory.createAssignment(ts.createMemberAccessForPropertyName(factory, receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), ts.visitNode(property.initializer, visitor, ts.isExpression));\n            ts.setTextRange(expression, property);\n            if (startsOnNewLine) {\n                ts.startOnNewLine(expression);\n            }\n            return expression;\n        }\n        /**\n         * Transforms a ShorthandPropertyAssignment node into an expression.\n         *\n         * @param node The ObjectLiteralExpression that contains the ShorthandPropertyAssignment.\n         * @param property The ShorthandPropertyAssignment node.\n         * @param receiver The receiver for the assignment.\n         */\n        function transformShorthandPropertyAssignmentToExpression(property, receiver, startsOnNewLine) {\n            var expression = factory.createAssignment(ts.createMemberAccessForPropertyName(factory, receiver, ts.visitNode(property.name, visitor, ts.isPropertyName)), factory.cloneNode(property.name));\n            ts.setTextRange(expression, property);\n            if (startsOnNewLine) {\n                ts.startOnNewLine(expression);\n            }\n            return expression;\n        }\n        /**\n         * Transforms a MethodDeclaration of an ObjectLiteralExpression into an expression.\n         *\n         * @param node The ObjectLiteralExpression that contains the MethodDeclaration.\n         * @param method The MethodDeclaration node.\n         * @param receiver The receiver for the assignment.\n         */\n        function transformObjectLiteralMethodDeclarationToExpression(method, receiver, container, startsOnNewLine) {\n            var expression = factory.createAssignment(ts.createMemberAccessForPropertyName(factory, receiver, ts.visitNode(method.name, visitor, ts.isPropertyName)), transformFunctionLikeToExpression(method, /*location*/ method, /*name*/ undefined, container));\n            ts.setTextRange(expression, method);\n            if (startsOnNewLine) {\n                ts.startOnNewLine(expression);\n            }\n            return expression;\n        }\n        function visitCatchClause(node) {\n            var ancestorFacts = enterSubtree(7104 /* BlockScopeExcludes */, 0 /* BlockScopeIncludes */);\n            var updated;\n            ts.Debug.assert(!!node.variableDeclaration, \"Catch clause variable should always be present when downleveling ES2015.\");\n            if (ts.isBindingPattern(node.variableDeclaration.name)) {\n                var temp = factory.createTempVariable(/*recordTempVariable*/ undefined);\n                var newVariableDeclaration = factory.createVariableDeclaration(temp);\n                ts.setTextRange(newVariableDeclaration, node.variableDeclaration);\n                var vars = ts.flattenDestructuringBinding(node.variableDeclaration, visitor, context, 0 /* All */, temp);\n                var list = factory.createVariableDeclarationList(vars);\n                ts.setTextRange(list, node.variableDeclaration);\n                var destructure = factory.createVariableStatement(/*modifiers*/ undefined, list);\n                updated = factory.updateCatchClause(node, newVariableDeclaration, addStatementToStartOfBlock(node.block, destructure));\n            }\n            else {\n                updated = ts.visitEachChild(node, visitor, context);\n            }\n            exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */);\n            return updated;\n        }\n        function addStatementToStartOfBlock(block, statement) {\n            var transformedStatements = ts.visitNodes(block.statements, visitor, ts.isStatement);\n            return factory.updateBlock(block, __spreadArray([statement], transformedStatements));\n        }\n        /**\n         * Visits a MethodDeclaration of an ObjectLiteralExpression and transforms it into a\n         * PropertyAssignment.\n         *\n         * @param node A MethodDeclaration node.\n         */\n        function visitMethodDeclaration(node) {\n            // We should only get here for methods on an object literal with regular identifier names.\n            // Methods on classes are handled in visitClassDeclaration/visitClassExpression.\n            // Methods with computed property names are handled in visitObjectLiteralExpression.\n            ts.Debug.assert(!ts.isComputedPropertyName(node.name));\n            var functionExpression = transformFunctionLikeToExpression(node, /*location*/ ts.moveRangePos(node, -1), /*name*/ undefined, /*container*/ undefined);\n            ts.setEmitFlags(functionExpression, 512 /* NoLeadingComments */ | ts.getEmitFlags(functionExpression));\n            return ts.setTextRange(factory.createPropertyAssignment(node.name, functionExpression), \n            /*location*/ node);\n        }\n        /**\n         * Visits an AccessorDeclaration of an ObjectLiteralExpression.\n         *\n         * @param node An AccessorDeclaration node.\n         */\n        function visitAccessorDeclaration(node) {\n            ts.Debug.assert(!ts.isComputedPropertyName(node.name));\n            var savedConvertedLoopState = convertedLoopState;\n            convertedLoopState = undefined;\n            var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */);\n            var updated;\n            var parameters = ts.visitParameterList(node.parameters, visitor, context);\n            var body = transformFunctionBody(node);\n            if (node.kind === 167 /* GetAccessor */) {\n                updated = factory.updateGetAccessorDeclaration(node, node.decorators, node.modifiers, node.name, parameters, node.type, body);\n            }\n            else {\n                updated = factory.updateSetAccessorDeclaration(node, node.decorators, node.modifiers, node.name, parameters, body);\n            }\n            exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */);\n            convertedLoopState = savedConvertedLoopState;\n            return updated;\n        }\n        /**\n         * Visits a ShorthandPropertyAssignment and transforms it into a PropertyAssignment.\n         *\n         * @param node A ShorthandPropertyAssignment node.\n         */\n        function visitShorthandPropertyAssignment(node) {\n            return ts.setTextRange(factory.createPropertyAssignment(node.name, visitIdentifier(factory.cloneNode(node.name))), \n            /*location*/ node);\n        }\n        function visitComputedPropertyName(node) {\n            return ts.visitEachChild(node, visitor, context);\n        }\n        /**\n         * Visits a YieldExpression node.\n         *\n         * @param node A YieldExpression node.\n         */\n        function visitYieldExpression(node) {\n            // `yield` expressions are transformed using the generators transformer.\n            return ts.visitEachChild(node, visitor, context);\n        }\n        /**\n         * Visits an ArrayLiteralExpression that contains a spread element.\n         *\n         * @param node An ArrayLiteralExpression node.\n         */\n        function visitArrayLiteralExpression(node) {\n            if (ts.some(node.elements, ts.isSpreadElement)) {\n                // We are here because we contain a SpreadElementExpression.\n                return transformAndSpreadElements(node.elements, /*needsUniqueCopy*/ true, !!node.multiLine, /*hasTrailingComma*/ !!node.elements.hasTrailingComma);\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        /**\n         * Visits a CallExpression that contains either a spread element or `super`.\n         *\n         * @param node a CallExpression.\n         */\n        function visitCallExpression(node) {\n            if (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) {\n                return visitTypeScriptClassWrapper(node);\n            }\n            var expression = ts.skipOuterExpressions(node.expression);\n            if (expression.kind === 105 /* SuperKeyword */ ||\n                ts.isSuperProperty(expression) ||\n                ts.some(node.arguments, ts.isSpreadElement)) {\n                return visitCallExpressionWithPotentialCapturedThisAssignment(node, /*assignToCapturedThis*/ true);\n            }\n            return factory.updateCallExpression(node, ts.visitNode(node.expression, callExpressionVisitor, ts.isExpression), \n            /*typeArguments*/ undefined, ts.visitNodes(node.arguments, visitor, ts.isExpression));\n        }\n        function visitTypeScriptClassWrapper(node) {\n            // This is a call to a class wrapper function (an IIFE) created by the 'ts' transformer.\n            // The wrapper has a form similar to:\n            //\n            //  (function() {\n            //      class C { // 1\n            //      }\n            //      C.x = 1; // 2\n            //      return C;\n            //  }())\n            //\n            // When we transform the class, we end up with something like this:\n            //\n            //  (function () {\n            //      var C = (function () { // 3\n            //          function C() {\n            //          }\n            //          return C; // 4\n            //      }());\n            //      C.x = 1;\n            //      return C;\n            //  }())\n            //\n            // We want to simplify the two nested IIFEs to end up with something like this:\n            //\n            //  (function () {\n            //      function C() {\n            //      }\n            //      C.x = 1;\n            //      return C;\n            //  }())\n            // We skip any outer expressions in a number of places to get to the innermost\n            // expression, but we will restore them later to preserve comments and source maps.\n            var body = ts.cast(ts.cast(ts.skipOuterExpressions(node.expression), ts.isArrowFunction).body, ts.isBlock);\n            // The class statements are the statements generated by visiting the first statement with initializer of the\n            // body (1), while all other statements are added to remainingStatements (2)\n            var isVariableStatementWithInitializer = function (stmt) { return ts.isVariableStatement(stmt) && !!ts.first(stmt.declarationList.declarations).initializer; };\n            // visit the class body statements outside of any converted loop body.\n            var savedConvertedLoopState = convertedLoopState;\n            convertedLoopState = undefined;\n            var bodyStatements = ts.visitNodes(body.statements, visitor, ts.isStatement);\n            convertedLoopState = savedConvertedLoopState;\n            var classStatements = ts.filter(bodyStatements, isVariableStatementWithInitializer);\n            var remainingStatements = ts.filter(bodyStatements, function (stmt) { return !isVariableStatementWithInitializer(stmt); });\n            var varStatement = ts.cast(ts.first(classStatements), ts.isVariableStatement);\n            // We know there is only one variable declaration here as we verified this in an\n            // earlier call to isTypeScriptClassWrapper\n            var variable = varStatement.declarationList.declarations[0];\n            var initializer = ts.skipOuterExpressions(variable.initializer);\n            // Under certain conditions, the 'ts' transformer may introduce a class alias, which\n            // we see as an assignment, for example:\n            //\n            //  (function () {\n            //      var C_1;\n            //      var C = C_1 = (function () {\n            //          function C() {\n            //          }\n            //          C.x = function () { return C_1; }\n            //          return C;\n            //      }());\n            //      C = C_1 = __decorate([dec], C);\n            //      return C;\n            //  }())\n            //\n            var aliasAssignment = ts.tryCast(initializer, ts.isAssignmentExpression);\n            // The underlying call (3) is another IIFE that may contain a '_super' argument.\n            var call = ts.cast(aliasAssignment ? ts.skipOuterExpressions(aliasAssignment.right) : initializer, ts.isCallExpression);\n            var func = ts.cast(ts.skipOuterExpressions(call.expression), ts.isFunctionExpression);\n            var funcStatements = func.body.statements;\n            var classBodyStart = 0;\n            var classBodyEnd = -1;\n            var statements = [];\n            if (aliasAssignment) {\n                // If we have a class alias assignment, we need to move it to the down-level constructor\n                // function we generated for the class.\n                var extendsCall = ts.tryCast(funcStatements[classBodyStart], ts.isExpressionStatement);\n                if (extendsCall) {\n                    statements.push(extendsCall);\n                    classBodyStart++;\n                }\n                // The next statement is the function declaration.\n                statements.push(funcStatements[classBodyStart]);\n                classBodyStart++;\n                // Add the class alias following the declaration.\n                statements.push(factory.createExpressionStatement(factory.createAssignment(aliasAssignment.left, ts.cast(variable.name, ts.isIdentifier))));\n            }\n            // Find the trailing 'return' statement (4)\n            while (!ts.isReturnStatement(ts.elementAt(funcStatements, classBodyEnd))) {\n                classBodyEnd--;\n            }\n            // When we extract the statements of the inner IIFE, we exclude the 'return' statement (4)\n            // as we already have one that has been introduced by the 'ts' transformer.\n            ts.addRange(statements, funcStatements, classBodyStart, classBodyEnd);\n            if (classBodyEnd < -1) {\n                // If there were any hoisted declarations following the return statement, we should\n                // append them.\n                ts.addRange(statements, funcStatements, classBodyEnd + 1);\n            }\n            // Add the remaining statements of the outer wrapper.\n            ts.addRange(statements, remainingStatements);\n            // The 'es2015' class transform may add an end-of-declaration marker. If so we will add it\n            // after the remaining statements from the 'ts' transformer.\n            ts.addRange(statements, classStatements, /*start*/ 1);\n            // Recreate any outer parentheses or partially-emitted expressions to preserve source map\n            // and comment locations.\n            return factory.restoreOuterExpressions(node.expression, factory.restoreOuterExpressions(variable.initializer, factory.restoreOuterExpressions(aliasAssignment && aliasAssignment.right, factory.updateCallExpression(call, factory.restoreOuterExpressions(call.expression, factory.updateFunctionExpression(func, \n            /*modifiers*/ undefined, \n            /*asteriskToken*/ undefined, \n            /*name*/ undefined, \n            /*typeParameters*/ undefined, func.parameters, \n            /*type*/ undefined, factory.updateBlock(func.body, statements))), \n            /*typeArguments*/ undefined, call.arguments))));\n        }\n        function visitImmediateSuperCallInBody(node) {\n            return visitCallExpressionWithPotentialCapturedThisAssignment(node, /*assignToCapturedThis*/ false);\n        }\n        function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) {\n            // We are here either because SuperKeyword was used somewhere in the expression, or\n            // because we contain a SpreadElementExpression.\n            if (node.transformFlags & 8192 /* ContainsRestOrSpread */ ||\n                node.expression.kind === 105 /* SuperKeyword */ ||\n                ts.isSuperProperty(ts.skipOuterExpressions(node.expression))) {\n                var _a = factory.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;\n                if (node.expression.kind === 105 /* SuperKeyword */) {\n                    ts.setEmitFlags(thisArg, 4 /* NoSubstitution */);\n                }\n                var resultingCall = void 0;\n                if (node.transformFlags & 8192 /* ContainsRestOrSpread */) {\n                    // [source]\n                    //      f(...a, b)\n                    //      x.m(...a, b)\n                    //      super(...a, b)\n                    //      super.m(...a, b) // in static\n                    //      super.m(...a, b) // in instance\n                    //\n                    // [output]\n                    //      f.apply(void 0, a.concat([b]))\n                    //      (_a = x).m.apply(_a, a.concat([b]))\n                    //      _super.apply(this, a.concat([b]))\n                    //      _super.m.apply(this, a.concat([b]))\n                    //      _super.prototype.m.apply(this, a.concat([b]))\n                    resultingCall = factory.createFunctionApplyCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), node.expression.kind === 105 /* SuperKeyword */ ? thisArg : ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false));\n                }\n                else {\n                    // [source]\n                    //      super(a)\n                    //      super.m(a) // in static\n                    //      super.m(a) // in instance\n                    //\n                    // [output]\n                    //      _super.call(this, a)\n                    //      _super.m.call(this, a)\n                    //      _super.prototype.m.call(this, a)\n                    resultingCall = ts.setTextRange(factory.createFunctionCallCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), node.expression.kind === 105 /* SuperKeyword */ ? thisArg : ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression)), node);\n                }\n                if (node.expression.kind === 105 /* SuperKeyword */) {\n                    var initializer = factory.createLogicalOr(resultingCall, createActualThis());\n                    resultingCall = assignToCapturedThis\n                        ? factory.createAssignment(factory.createUniqueName(\"_this\", 16 /* Optimistic */ | 32 /* FileLevel */), initializer)\n                        : initializer;\n                }\n                return ts.setOriginalNode(resultingCall, node);\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        /**\n         * Visits a NewExpression that contains a spread element.\n         *\n         * @param node A NewExpression node.\n         */\n        function visitNewExpression(node) {\n            if (ts.some(node.arguments, ts.isSpreadElement)) {\n                // We are here because we contain a SpreadElementExpression.\n                // [source]\n                //      new C(...a)\n                //\n                // [output]\n                //      new ((_a = C).bind.apply(_a, [void 0].concat(a)))()\n                var _a = factory.createCallBinding(factory.createPropertyAccessExpression(node.expression, \"bind\"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;\n                return factory.createNewExpression(factory.createFunctionApplyCall(ts.visitNode(target, visitor, ts.isExpression), thisArg, transformAndSpreadElements(factory.createNodeArray(__spreadArray([factory.createVoidZero()], node.arguments)), /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)), \n                /*typeArguments*/ undefined, []);\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        /**\n         * Transforms an array of Expression nodes that contains a SpreadExpression.\n         *\n         * @param elements The array of Expression nodes.\n         * @param needsUniqueCopy A value indicating whether to ensure that the result is a fresh array.\n         * This should be `true` when spreading into an `ArrayLiteral`, and `false` when spreading into an\n         * argument list.\n         * @param multiLine A value indicating whether the result should be emitted on multiple lines.\n         */\n        function transformAndSpreadElements(elements, needsUniqueCopy, multiLine, hasTrailingComma) {\n            // When there is no leading SpreadElement:\n            //\n            // [source]\n            //      [a, ...b, c]\n            //\n            // [output (downlevelIteration)]\n            //      __spreadArray(__spreadArray([a], __read(b)), [c])\n            //\n            // [output]\n            //      __spreadArray(__spreadArray([a], b), [c])\n            //\n            // When there *is* a leading SpreadElement:\n            //\n            // [source]\n            //      [...a, b]\n            //\n            // [output (downlevelIteration)]\n            //      __spreadArray(__spreadArray([], __read(a)), [b])\n            //\n            // [output]\n            //      __spreadArray(__spreadArray([], a), [b])\n            //\n            // NOTE: We use `isPackedArrayLiteral` below rather than just `isArrayLiteral`\n            // because ES2015 spread will replace _missing_ array elements with `undefined`,\n            // so we cannot just use an array as is. For example:\n            //\n            // `[1, ...[2, , 3]]` becomes `[1, 2, undefined, 3]`\n            //\n            // However, for packed array literals (i.e., an array literal with no OmittedExpression\n            // elements), we can use the array as-is.\n            // Map spans of spread expressions into their expressions and spans of other\n            // expressions into an array literal.\n            var numElements = elements.length;\n            var segments = ts.flatten(ts.spanMap(elements, partitionSpread, function (partition, visitPartition, _start, end) {\n                return visitPartition(partition, multiLine, hasTrailingComma && end === numElements);\n            }));\n            if (segments.length === 1) {\n                var firstSegment = segments[0];\n                // If we don't need a unique copy, then we are spreading into an argument list for\n                // a CallExpression or NewExpression. When using `--downlevelIteration`, we need\n                // to coerce this into an array for use with `apply`, so we will use the code path\n                // that follows instead.\n                if (!needsUniqueCopy && !compilerOptions.downlevelIteration\n                    || ts.isPackedArrayLiteral(firstSegment) // see NOTE (above)\n                    || ts.isCallToHelper(firstSegment, \"___spreadArray\")) {\n                    return segments[0];\n                }\n            }\n            var helpers = emitHelpers();\n            var startsWithSpread = ts.isSpreadElement(elements[0]);\n            var expression = startsWithSpread ? factory.createArrayLiteralExpression() :\n                segments[0];\n            for (var i = startsWithSpread ? 0 : 1; i < segments.length; i++) {\n                expression = helpers.createSpreadArrayHelper(expression, compilerOptions.downlevelIteration && !ts.isPackedArrayLiteral(segments[i]) ? // see NOTE (above)\n                    helpers.createReadHelper(segments[i], /*count*/ undefined) :\n                    segments[i]);\n            }\n            return expression;\n        }\n        function partitionSpread(node) {\n            return ts.isSpreadElement(node)\n                ? visitSpanOfSpreads\n                : visitSpanOfNonSpreads;\n        }\n        function visitSpanOfSpreads(chunk) {\n            return ts.map(chunk, visitExpressionOfSpread);\n        }\n        function visitSpanOfNonSpreads(chunk, multiLine, hasTrailingComma) {\n            return factory.createArrayLiteralExpression(ts.visitNodes(factory.createNodeArray(chunk, hasTrailingComma), visitor, ts.isExpression), multiLine);\n        }\n        function visitSpreadElement(node) {\n            return ts.visitNode(node.expression, visitor, ts.isExpression);\n        }\n        /**\n         * Transforms the expression of a SpreadExpression node.\n         *\n         * @param node A SpreadExpression node.\n         */\n        function visitExpressionOfSpread(node) {\n            return ts.visitNode(node.expression, visitor, ts.isExpression);\n        }\n        /**\n         * Visits a template literal.\n         *\n         * @param node A template literal.\n         */\n        function visitTemplateLiteral(node) {\n            return ts.setTextRange(factory.createStringLiteral(node.text), node);\n        }\n        /**\n         * Visits a string literal with an extended unicode escape.\n         *\n         * @param node A string literal.\n         */\n        function visitStringLiteral(node) {\n            if (node.hasExtendedUnicodeEscape) {\n                return ts.setTextRange(factory.createStringLiteral(node.text), node);\n            }\n            return node;\n        }\n        /**\n         * Visits a binary or octal (ES6) numeric literal.\n         *\n         * @param node A string literal.\n         */\n        function visitNumericLiteral(node) {\n            if (node.numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */) {\n                return ts.setTextRange(factory.createNumericLiteral(node.text), node);\n            }\n            return node;\n        }\n        /**\n         * Visits a TaggedTemplateExpression node.\n         *\n         * @param node A TaggedTemplateExpression node.\n         */\n        function visitTaggedTemplateExpression(node) {\n            return ts.processTaggedTemplateExpression(context, node, visitor, currentSourceFile, recordTaggedTemplateString, ts.ProcessLevel.All);\n        }\n        /**\n         * Visits a TemplateExpression node.\n         *\n         * @param node A TemplateExpression node.\n         */\n        function visitTemplateExpression(node) {\n            var expressions = [];\n            addTemplateHead(expressions, node);\n            addTemplateSpans(expressions, node);\n            // createAdd will check if each expression binds less closely than binary '+'.\n            // If it does, it wraps the expression in parentheses. Otherwise, something like\n            //    `abc${ 1 << 2 }`\n            // becomes\n            //    \"abc\" + 1 << 2 + \"\"\n            // which is really\n            //    (\"abc\" + 1) << (2 + \"\")\n            // rather than\n            //    \"abc\" + (1 << 2) + \"\"\n            var expression = ts.reduceLeft(expressions, factory.createAdd);\n            if (ts.nodeIsSynthesized(expression)) {\n                ts.setTextRange(expression, node);\n            }\n            return expression;\n        }\n        /**\n         * Gets a value indicating whether we need to include the head of a TemplateExpression.\n         *\n         * @param node A TemplateExpression node.\n         */\n        function shouldAddTemplateHead(node) {\n            // If this expression has an empty head literal and the first template span has a non-empty\n            // literal, then emitting the empty head literal is not necessary.\n            //     `${ foo } and ${ bar }`\n            // can be emitted as\n            //     foo + \" and \" + bar\n            // This is because it is only required that one of the first two operands in the emit\n            // output must be a string literal, so that the other operand and all following operands\n            // are forced into strings.\n            //\n            // If the first template span has an empty literal, then the head must still be emitted.\n            //     `${ foo }${ bar }`\n            // must still be emitted as\n            //     \"\" + foo + bar\n            // There is always atleast one templateSpan in this code path, since\n            // NoSubstitutionTemplateLiterals are directly emitted via emitLiteral()\n            ts.Debug.assert(node.templateSpans.length !== 0);\n            return node.head.text.length !== 0 || node.templateSpans[0].literal.text.length === 0;\n        }\n        /**\n         * Adds the head of a TemplateExpression to an array of expressions.\n         *\n         * @param expressions An array of expressions.\n         * @param node A TemplateExpression node.\n         */\n        function addTemplateHead(expressions, node) {\n            if (!shouldAddTemplateHead(node)) {\n                return;\n            }\n            expressions.push(factory.createStringLiteral(node.head.text));\n        }\n        /**\n         * Visits and adds the template spans of a TemplateExpression to an array of expressions.\n         *\n         * @param expressions An array of expressions.\n         * @param node A TemplateExpression node.\n         */\n        function addTemplateSpans(expressions, node) {\n            for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) {\n                var span = _a[_i];\n                expressions.push(ts.visitNode(span.expression, visitor, ts.isExpression));\n                // Only emit if the literal is non-empty.\n                // The binary '+' operator is left-associative, so the first string concatenation\n                // with the head will force the result up to this point to be a string.\n                // Emitting a '+ \"\"' has no semantic effect for middles and tails.\n                if (span.literal.text.length !== 0) {\n                    expressions.push(factory.createStringLiteral(span.literal.text));\n                }\n            }\n        }\n        /**\n         * Visits the `super` keyword\n         */\n        function visitSuperKeyword(isExpressionOfCall) {\n            return hierarchyFacts & 8 /* NonStaticClassElement */\n                && !isExpressionOfCall\n                ? factory.createPropertyAccessExpression(factory.createUniqueName(\"_super\", 16 /* Optimistic */ | 32 /* FileLevel */), \"prototype\")\n                : factory.createUniqueName(\"_super\", 16 /* Optimistic */ | 32 /* FileLevel */);\n        }\n        function visitMetaProperty(node) {\n            if (node.keywordToken === 102 /* NewKeyword */ && node.name.escapedText === \"target\") {\n                hierarchyFacts |= 16384 /* NewTarget */;\n                return factory.createUniqueName(\"_newTarget\", 16 /* Optimistic */ | 32 /* FileLevel */);\n            }\n            return node;\n        }\n        /**\n         * Called by the printer just before a node is printed.\n         *\n         * @param hint A hint as to the intended usage of the node.\n         * @param node The node to be printed.\n         * @param emitCallback The callback used to emit the node.\n         */\n        function onEmitNode(hint, node, emitCallback) {\n            if (enabledSubstitutions & 1 /* CapturedThis */ && ts.isFunctionLike(node)) {\n                // If we are tracking a captured `this`, keep track of the enclosing function.\n                var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, ts.getEmitFlags(node) & 8 /* CapturesThis */\n                    ? 65 /* FunctionIncludes */ | 16 /* CapturesThis */\n                    : 65 /* FunctionIncludes */);\n                previousOnEmitNode(hint, node, emitCallback);\n                exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */);\n                return;\n            }\n            previousOnEmitNode(hint, node, emitCallback);\n        }\n        /**\n         * Enables a more costly code path for substitutions when we determine a source file\n         * contains block-scoped bindings (e.g. `let` or `const`).\n         */\n        function enableSubstitutionsForBlockScopedBindings() {\n            if ((enabledSubstitutions & 2 /* BlockScopedBindings */) === 0) {\n                enabledSubstitutions |= 2 /* BlockScopedBindings */;\n                context.enableSubstitution(78 /* Identifier */);\n            }\n        }\n        /**\n         * Enables a more costly code path for substitutions when we determine a source file\n         * contains a captured `this`.\n         */\n        function enableSubstitutionsForCapturedThis() {\n            if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) {\n                enabledSubstitutions |= 1 /* CapturedThis */;\n                context.enableSubstitution(107 /* ThisKeyword */);\n                context.enableEmitNotification(166 /* Constructor */);\n                context.enableEmitNotification(165 /* MethodDeclaration */);\n                context.enableEmitNotification(167 /* GetAccessor */);\n                context.enableEmitNotification(168 /* SetAccessor */);\n                context.enableEmitNotification(209 /* ArrowFunction */);\n                context.enableEmitNotification(208 /* FunctionExpression */);\n                context.enableEmitNotification(251 /* FunctionDeclaration */);\n            }\n        }\n        /**\n         * Hooks node substitutions.\n         *\n         * @param hint The context for the emitter.\n         * @param node The node to substitute.\n         */\n        function onSubstituteNode(hint, node) {\n            node = previousOnSubstituteNode(hint, node);\n            if (hint === 1 /* Expression */) {\n                return substituteExpression(node);\n            }\n            if (ts.isIdentifier(node)) {\n                return substituteIdentifier(node);\n            }\n            return node;\n        }\n        /**\n         * Hooks substitutions for non-expression identifiers.\n         */\n        function substituteIdentifier(node) {\n            // Only substitute the identifier if we have enabled substitutions for block-scoped\n            // bindings.\n            if (enabledSubstitutions & 2 /* BlockScopedBindings */ && !ts.isInternalName(node)) {\n                var original = ts.getParseTreeNode(node, ts.isIdentifier);\n                if (original && isNameOfDeclarationWithCollidingName(original)) {\n                    return ts.setTextRange(factory.getGeneratedNameForNode(original), node);\n                }\n            }\n            return node;\n        }\n        /**\n         * Determines whether a name is the name of a declaration with a colliding name.\n         * NOTE: This function expects to be called with an original source tree node.\n         *\n         * @param node An original source tree node.\n         */\n        function isNameOfDeclarationWithCollidingName(node) {\n            switch (node.parent.kind) {\n                case 198 /* BindingElement */:\n                case 252 /* ClassDeclaration */:\n                case 255 /* EnumDeclaration */:\n                case 249 /* VariableDeclaration */:\n                    return node.parent.name === node\n                        && resolver.isDeclarationWithCollidingName(node.parent);\n            }\n            return false;\n        }\n        /**\n         * Substitutes an expression.\n         *\n         * @param node An Expression node.\n         */\n        function substituteExpression(node) {\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                    return substituteExpressionIdentifier(node);\n                case 107 /* ThisKeyword */:\n                    return substituteThisKeyword(node);\n            }\n            return node;\n        }\n        /**\n         * Substitutes an expression identifier.\n         *\n         * @param node An Identifier node.\n         */\n        function substituteExpressionIdentifier(node) {\n            if (enabledSubstitutions & 2 /* BlockScopedBindings */ && !ts.isInternalName(node)) {\n                var declaration = resolver.getReferencedDeclarationWithCollidingName(node);\n                if (declaration && !(ts.isClassLike(declaration) && isPartOfClassBody(declaration, node))) {\n                    return ts.setTextRange(factory.getGeneratedNameForNode(ts.getNameOfDeclaration(declaration)), node);\n                }\n            }\n            return node;\n        }\n        function isPartOfClassBody(declaration, node) {\n            var currentNode = ts.getParseTreeNode(node);\n            if (!currentNode || currentNode === declaration || currentNode.end <= declaration.pos || currentNode.pos >= declaration.end) {\n                // if the node has no correlation to a parse tree node, its definitely not\n                // part of the body.\n                // if the node is outside of the document range of the declaration, its\n                // definitely not part of the body.\n                return false;\n            }\n            var blockScope = ts.getEnclosingBlockScopeContainer(declaration);\n            while (currentNode) {\n                if (currentNode === blockScope || currentNode === declaration) {\n                    // if we are in the enclosing block scope of the declaration, we are definitely\n                    // not inside the class body.\n                    return false;\n                }\n                if (ts.isClassElement(currentNode) && currentNode.parent === declaration) {\n                    return true;\n                }\n                currentNode = currentNode.parent;\n            }\n            return false;\n        }\n        /**\n         * Substitutes `this` when contained within an arrow function.\n         *\n         * @param node The ThisKeyword node.\n         */\n        function substituteThisKeyword(node) {\n            if (enabledSubstitutions & 1 /* CapturedThis */\n                && hierarchyFacts & 16 /* CapturesThis */) {\n                return ts.setTextRange(factory.createUniqueName(\"_this\", 16 /* Optimistic */ | 32 /* FileLevel */), node);\n            }\n            return node;\n        }\n        function getClassMemberPrefix(node, member) {\n            return ts.hasSyntacticModifier(member, 32 /* Static */)\n                ? factory.getInternalName(node)\n                : factory.createPropertyAccessExpression(factory.getInternalName(node), \"prototype\");\n        }\n        function hasSynthesizedDefaultSuperCall(constructor, hasExtendsClause) {\n            if (!constructor || !hasExtendsClause) {\n                return false;\n            }\n            if (ts.some(constructor.parameters)) {\n                return false;\n            }\n            var statement = ts.firstOrUndefined(constructor.body.statements);\n            if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 233 /* ExpressionStatement */) {\n                return false;\n            }\n            var statementExpression = statement.expression;\n            if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 203 /* CallExpression */) {\n                return false;\n            }\n            var callTarget = statementExpression.expression;\n            if (!ts.nodeIsSynthesized(callTarget) || callTarget.kind !== 105 /* SuperKeyword */) {\n                return false;\n            }\n            var callArgument = ts.singleOrUndefined(statementExpression.arguments);\n            if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 220 /* SpreadElement */) {\n                return false;\n            }\n            var expression = callArgument.expression;\n            return ts.isIdentifier(expression) && expression.escapedText === \"arguments\";\n        }\n    }\n    ts.transformES2015 = transformES2015;\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    /**\n     * Transforms ES5 syntax into ES3 syntax.\n     *\n     * @param context Context and state information for the transformation.\n     */\n    function transformES5(context) {\n        var factory = context.factory;\n        var compilerOptions = context.getCompilerOptions();\n        // enable emit notification only if using --jsx preserve or react-native\n        var previousOnEmitNode;\n        var noSubstitution;\n        if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) {\n            previousOnEmitNode = context.onEmitNode;\n            context.onEmitNode = onEmitNode;\n            context.enableEmitNotification(275 /* JsxOpeningElement */);\n            context.enableEmitNotification(276 /* JsxClosingElement */);\n            context.enableEmitNotification(274 /* JsxSelfClosingElement */);\n            noSubstitution = [];\n        }\n        var previousOnSubstituteNode = context.onSubstituteNode;\n        context.onSubstituteNode = onSubstituteNode;\n        context.enableSubstitution(201 /* PropertyAccessExpression */);\n        context.enableSubstitution(288 /* PropertyAssignment */);\n        return ts.chainBundle(context, transformSourceFile);\n        /**\n         * Transforms an ES5 source file to ES3.\n         *\n         * @param node A SourceFile\n         */\n        function transformSourceFile(node) {\n            return node;\n        }\n        /**\n         * Called by the printer just before a node is printed.\n         *\n         * @param hint A hint as to the intended usage of the node.\n         * @param node The node to emit.\n         * @param emitCallback A callback used to emit the node.\n         */\n        function onEmitNode(hint, node, emitCallback) {\n            switch (node.kind) {\n                case 275 /* JsxOpeningElement */:\n                case 276 /* JsxClosingElement */:\n                case 274 /* JsxSelfClosingElement */:\n                    var tagName = node.tagName;\n                    noSubstitution[ts.getOriginalNodeId(tagName)] = true;\n                    break;\n            }\n            previousOnEmitNode(hint, node, emitCallback);\n        }\n        /**\n         * Hooks node substitutions.\n         *\n         * @param hint A hint as to the intended usage of the node.\n         * @param node The node to substitute.\n         */\n        function onSubstituteNode(hint, node) {\n            if (node.id && noSubstitution && noSubstitution[node.id]) {\n                return previousOnSubstituteNode(hint, node);\n            }\n            node = previousOnSubstituteNode(hint, node);\n            if (ts.isPropertyAccessExpression(node)) {\n                return substitutePropertyAccessExpression(node);\n            }\n            else if (ts.isPropertyAssignment(node)) {\n                return substitutePropertyAssignment(node);\n            }\n            return node;\n        }\n        /**\n         * Substitutes a PropertyAccessExpression whose name is a reserved word.\n         *\n         * @param node A PropertyAccessExpression\n         */\n        function substitutePropertyAccessExpression(node) {\n            if (ts.isPrivateIdentifier(node.name)) {\n                return node;\n            }\n            var literalName = trySubstituteReservedName(node.name);\n            if (literalName) {\n                return ts.setTextRange(factory.createElementAccessExpression(node.expression, literalName), node);\n            }\n            return node;\n        }\n        /**\n         * Substitutes a PropertyAssignment whose name is a reserved word.\n         *\n         * @param node A PropertyAssignment\n         */\n        function substitutePropertyAssignment(node) {\n            var literalName = ts.isIdentifier(node.name) && trySubstituteReservedName(node.name);\n            if (literalName) {\n                return factory.updatePropertyAssignment(node, literalName, node.initializer);\n            }\n            return node;\n        }\n        /**\n         * If an identifier name is a reserved word, returns a string literal for the name.\n         *\n         * @param name An Identifier\n         */\n        function trySubstituteReservedName(name) {\n            var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(ts.idText(name)) : undefined);\n            if (token !== undefined && token >= 80 /* FirstReservedWord */ && token <= 115 /* LastReservedWord */) {\n                return ts.setTextRange(factory.createStringLiteralFromNode(name), name);\n            }\n            return undefined;\n        }\n    }\n    ts.transformES5 = transformES5;\n})(ts || (ts = {}));\n// Transforms generator functions into a compatible ES5 representation with similar runtime\n// semantics. This is accomplished by first transforming the body of each generator\n// function into an intermediate representation that is the compiled into a JavaScript\n// switch statement.\n//\n// Many functions in this transformer will contain comments indicating the expected\n// intermediate representation. For illustrative purposes, the following intermediate\n// language is used to define this intermediate representation:\n//\n//  .nop                            - Performs no operation.\n//  .local NAME, ...                - Define local variable declarations.\n//  .mark LABEL                     - Mark the location of a label.\n//  .br LABEL                       - Jump to a label. If jumping out of a protected\n//                                    region, all .finally blocks are executed.\n//  .brtrue LABEL, (x)              - Jump to a label IIF the expression `x` is truthy.\n//                                    If jumping out of a protected region, all .finally\n//                                    blocks are executed.\n//  .brfalse LABEL, (x)             - Jump to a label IIF the expression `x` is falsey.\n//                                    If jumping out of a protected region, all .finally\n//                                    blocks are executed.\n//  .yield (x)                      - Yield the value of the optional expression `x`.\n//                                    Resume at the next label.\n//  .yieldstar (x)                  - Delegate yield to the value of the optional\n//                                    expression `x`. Resume at the next label.\n//                                    NOTE: `x` must be an Iterator, not an Iterable.\n//  .loop CONTINUE, BREAK           - Marks the beginning of a loop. Any \"continue\" or\n//                                    \"break\" abrupt completions jump to the CONTINUE or\n//                                    BREAK labels, respectively.\n//  .endloop                        - Marks the end of a loop.\n//  .with (x)                       - Marks the beginning of a WithStatement block, using\n//                                    the supplied expression.\n//  .endwith                        - Marks the end of a WithStatement.\n//  .switch                         - Marks the beginning of a SwitchStatement.\n//  .endswitch                      - Marks the end of a SwitchStatement.\n//  .labeled NAME                   - Marks the beginning of a LabeledStatement with the\n//                                    supplied name.\n//  .endlabeled                     - Marks the end of a LabeledStatement.\n//  .try TRY, CATCH, FINALLY, END   - Marks the beginning of a protected region, and the\n//                                    labels for each block.\n//  .catch (x)                      - Marks the beginning of a catch block.\n//  .finally                        - Marks the beginning of a finally block.\n//  .endfinally                     - Marks the end of a finally block.\n//  .endtry                         - Marks the end of a protected region.\n//  .throw (x)                      - Throws the value of the expression `x`.\n//  .return (x)                     - Returns the value of the expression `x`.\n//\n// In addition, the illustrative intermediate representation introduces some special\n// variables:\n//\n//  %sent%                          - Either returns the next value sent to the generator,\n//                                    returns the result of a delegated yield, or throws\n//                                    the exception sent to the generator.\n//  %error%                         - Returns the value of the current exception in a\n//                                    catch block.\n//\n// This intermediate representation is then compiled into JavaScript syntax. The resulting\n// compilation output looks something like the following:\n//\n//  function f() {\n//      var /*locals*/;\n//      /*functions*/\n//      return __generator(function (state) {\n//          switch (state.label) {\n//              /*cases per label*/\n//          }\n//      });\n//  }\n//\n// Each of the above instructions corresponds to JavaScript emit similar to the following:\n//\n//  .local NAME                   | var NAME;\n// -------------------------------|----------------------------------------------\n//  .mark LABEL                   | case LABEL:\n// -------------------------------|----------------------------------------------\n//  .br LABEL                     |     return [3 /*break*/, LABEL];\n// -------------------------------|----------------------------------------------\n//  .brtrue LABEL, (x)            |     if (x) return [3 /*break*/, LABEL];\n// -------------------------------|----------------------------------------------\n//  .brfalse LABEL, (x)           |     if (!(x)) return [3, /*break*/, LABEL];\n// -------------------------------|----------------------------------------------\n//  .yield (x)                    |     return [4 /*yield*/, x];\n//  .mark RESUME                  | case RESUME:\n//      a = %sent%;               |     a = state.sent();\n// -------------------------------|----------------------------------------------\n//  .yieldstar (x)                |     return [5 /*yield**/, x];\n//  .mark RESUME                  | case RESUME:\n//      a = %sent%;               |     a = state.sent();\n// -------------------------------|----------------------------------------------\n//  .with (_a)                    |     with (_a) {\n//      a();                      |         a();\n//                                |     }\n//                                |     state.label = LABEL;\n//  .mark LABEL                   | case LABEL:\n//                                |     with (_a) {\n//      b();                      |         b();\n//                                |     }\n//  .endwith                      |\n// -------------------------------|----------------------------------------------\n//                                | case 0:\n//                                |     state.trys = [];\n//                                | ...\n//  .try TRY, CATCH, FINALLY, END |\n//  .mark TRY                     | case TRY:\n//                                |     state.trys.push([TRY, CATCH, FINALLY, END]);\n//  .nop                          |\n//      a();                      |     a();\n//  .br END                       |     return [3 /*break*/, END];\n//  .catch (e)                    |\n//  .mark CATCH                   | case CATCH:\n//                                |     e = state.sent();\n//      b();                      |     b();\n//  .br END                       |     return [3 /*break*/, END];\n//  .finally                      |\n//  .mark FINALLY                 | case FINALLY:\n//      c();                      |     c();\n//  .endfinally                   |     return [7 /*endfinally*/];\n//  .endtry                       |\n//  .mark END                     | case END:\n/*@internal*/\nvar ts;\n(function (ts) {\n    var OpCode;\n    (function (OpCode) {\n        OpCode[OpCode[\"Nop\"] = 0] = \"Nop\";\n        OpCode[OpCode[\"Statement\"] = 1] = \"Statement\";\n        OpCode[OpCode[\"Assign\"] = 2] = \"Assign\";\n        OpCode[OpCode[\"Break\"] = 3] = \"Break\";\n        OpCode[OpCode[\"BreakWhenTrue\"] = 4] = \"BreakWhenTrue\";\n        OpCode[OpCode[\"BreakWhenFalse\"] = 5] = \"BreakWhenFalse\";\n        OpCode[OpCode[\"Yield\"] = 6] = \"Yield\";\n        OpCode[OpCode[\"YieldStar\"] = 7] = \"YieldStar\";\n        OpCode[OpCode[\"Return\"] = 8] = \"Return\";\n        OpCode[OpCode[\"Throw\"] = 9] = \"Throw\";\n        OpCode[OpCode[\"Endfinally\"] = 10] = \"Endfinally\"; // Marks the end of a `finally` block\n    })(OpCode || (OpCode = {}));\n    // whether a generated code block is opening or closing at the current operation for a FunctionBuilder\n    var BlockAction;\n    (function (BlockAction) {\n        BlockAction[BlockAction[\"Open\"] = 0] = \"Open\";\n        BlockAction[BlockAction[\"Close\"] = 1] = \"Close\";\n    })(BlockAction || (BlockAction = {}));\n    // the kind for a generated code block in a FunctionBuilder\n    var CodeBlockKind;\n    (function (CodeBlockKind) {\n        CodeBlockKind[CodeBlockKind[\"Exception\"] = 0] = \"Exception\";\n        CodeBlockKind[CodeBlockKind[\"With\"] = 1] = \"With\";\n        CodeBlockKind[CodeBlockKind[\"Switch\"] = 2] = \"Switch\";\n        CodeBlockKind[CodeBlockKind[\"Loop\"] = 3] = \"Loop\";\n        CodeBlockKind[CodeBlockKind[\"Labeled\"] = 4] = \"Labeled\";\n    })(CodeBlockKind || (CodeBlockKind = {}));\n    // the state for a generated code exception block\n    var ExceptionBlockState;\n    (function (ExceptionBlockState) {\n        ExceptionBlockState[ExceptionBlockState[\"Try\"] = 0] = \"Try\";\n        ExceptionBlockState[ExceptionBlockState[\"Catch\"] = 1] = \"Catch\";\n        ExceptionBlockState[ExceptionBlockState[\"Finally\"] = 2] = \"Finally\";\n        ExceptionBlockState[ExceptionBlockState[\"Done\"] = 3] = \"Done\";\n    })(ExceptionBlockState || (ExceptionBlockState = {}));\n    // NOTE: changes to this enum should be reflected in the __generator helper.\n    var Instruction;\n    (function (Instruction) {\n        Instruction[Instruction[\"Next\"] = 0] = \"Next\";\n        Instruction[Instruction[\"Throw\"] = 1] = \"Throw\";\n        Instruction[Instruction[\"Return\"] = 2] = \"Return\";\n        Instruction[Instruction[\"Break\"] = 3] = \"Break\";\n        Instruction[Instruction[\"Yield\"] = 4] = \"Yield\";\n        Instruction[Instruction[\"YieldStar\"] = 5] = \"YieldStar\";\n        Instruction[Instruction[\"Catch\"] = 6] = \"Catch\";\n        Instruction[Instruction[\"Endfinally\"] = 7] = \"Endfinally\";\n    })(Instruction || (Instruction = {}));\n    function getInstructionName(instruction) {\n        switch (instruction) {\n            case 2 /* Return */: return \"return\";\n            case 3 /* Break */: return \"break\";\n            case 4 /* Yield */: return \"yield\";\n            case 5 /* YieldStar */: return \"yield*\";\n            case 7 /* Endfinally */: return \"endfinally\";\n            default: return undefined; // TODO: GH#18217\n        }\n    }\n    function transformGenerators(context) {\n        var factory = context.factory, emitHelpers = context.getEmitHelperFactory, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistFunctionDeclaration = context.hoistFunctionDeclaration, hoistVariableDeclaration = context.hoistVariableDeclaration;\n        var compilerOptions = context.getCompilerOptions();\n        var languageVersion = ts.getEmitScriptTarget(compilerOptions);\n        var resolver = context.getEmitResolver();\n        var previousOnSubstituteNode = context.onSubstituteNode;\n        context.onSubstituteNode = onSubstituteNode;\n        var renamedCatchVariables;\n        var renamedCatchVariableDeclarations;\n        var inGeneratorFunctionBody;\n        var inStatementContainingYield;\n        // The following three arrays store information about generated code blocks.\n        // All three arrays are correlated by their index. This approach is used over allocating\n        // objects to store the same information to avoid GC overhead.\n        //\n        var blocks; // Information about the code block\n        var blockOffsets; // The operation offset at which a code block begins or ends\n        var blockActions; // Whether the code block is opened or closed\n        var blockStack; // A stack of currently open code blocks\n        // Labels are used to mark locations in the code that can be the target of a Break (jump)\n        // operation. These are translated into case clauses in a switch statement.\n        // The following two arrays are correlated by their index. This approach is used over\n        // allocating objects to store the same information to avoid GC overhead.\n        //\n        var labelOffsets; // The operation offset at which the label is defined.\n        var labelExpressions; // The NumericLiteral nodes bound to each label.\n        var nextLabelId = 1; // The next label id to use.\n        // Operations store information about generated code for the function body. This\n        // Includes things like statements, assignments, breaks (jumps), and yields.\n        // The following three arrays are correlated by their index. This approach is used over\n        // allocating objects to store the same information to avoid GC overhead.\n        //\n        var operations; // The operation to perform.\n        var operationArguments; // The arguments to the operation.\n        var operationLocations; // The source map location for the operation.\n        var state; // The name of the state object used by the generator at runtime.\n        // The following variables store information used by the `build` function:\n        //\n        var blockIndex = 0; // The index of the current block.\n        var labelNumber = 0; // The current label number.\n        var labelNumbers;\n        var lastOperationWasAbrupt; // Indicates whether the last operation was abrupt (break/continue).\n        var lastOperationWasCompletion; // Indicates whether the last operation was a completion (return/throw).\n        var clauses; // The case clauses generated for labels.\n        var statements; // The statements for the current label.\n        var exceptionBlockStack; // A stack of containing exception blocks.\n        var currentExceptionBlock; // The current exception block.\n        var withBlockStack; // A stack containing `with` blocks.\n        return ts.chainBundle(context, transformSourceFile);\n        function transformSourceFile(node) {\n            if (node.isDeclarationFile || (node.transformFlags & 512 /* ContainsGenerator */) === 0) {\n                return node;\n            }\n            var visited = ts.visitEachChild(node, visitor, context);\n            ts.addEmitHelpers(visited, context.readEmitHelpers());\n            return visited;\n        }\n        /**\n         * Visits a node.\n         *\n         * @param node The node to visit.\n         */\n        function visitor(node) {\n            var transformFlags = node.transformFlags;\n            if (inStatementContainingYield) {\n                return visitJavaScriptInStatementContainingYield(node);\n            }\n            else if (inGeneratorFunctionBody) {\n                return visitJavaScriptInGeneratorFunctionBody(node);\n            }\n            else if (ts.isFunctionLikeDeclaration(node) && node.asteriskToken) {\n                return visitGenerator(node);\n            }\n            else if (transformFlags & 512 /* ContainsGenerator */) {\n                return ts.visitEachChild(node, visitor, context);\n            }\n            else {\n                return node;\n            }\n        }\n        /**\n         * Visits a node that is contained within a statement that contains yield.\n         *\n         * @param node The node to visit.\n         */\n        function visitJavaScriptInStatementContainingYield(node) {\n            switch (node.kind) {\n                case 235 /* DoStatement */:\n                    return visitDoStatement(node);\n                case 236 /* WhileStatement */:\n                    return visitWhileStatement(node);\n                case 244 /* SwitchStatement */:\n                    return visitSwitchStatement(node);\n                case 245 /* LabeledStatement */:\n                    return visitLabeledStatement(node);\n                default:\n                    return visitJavaScriptInGeneratorFunctionBody(node);\n            }\n        }\n        /**\n         * Visits a node that is contained within a generator function.\n         *\n         * @param node The node to visit.\n         */\n        function visitJavaScriptInGeneratorFunctionBody(node) {\n            switch (node.kind) {\n                case 251 /* FunctionDeclaration */:\n                    return visitFunctionDeclaration(node);\n                case 208 /* FunctionExpression */:\n                    return visitFunctionExpression(node);\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    return visitAccessorDeclaration(node);\n                case 232 /* VariableStatement */:\n                    return visitVariableStatement(node);\n                case 237 /* ForStatement */:\n                    return visitForStatement(node);\n                case 238 /* ForInStatement */:\n                    return visitForInStatement(node);\n                case 241 /* BreakStatement */:\n                    return visitBreakStatement(node);\n                case 240 /* ContinueStatement */:\n                    return visitContinueStatement(node);\n                case 242 /* ReturnStatement */:\n                    return visitReturnStatement(node);\n                default:\n                    if (node.transformFlags & 262144 /* ContainsYield */) {\n                        return visitJavaScriptContainingYield(node);\n                    }\n                    else if (node.transformFlags & (512 /* ContainsGenerator */ | 1048576 /* ContainsHoistedDeclarationOrCompletion */)) {\n                        return ts.visitEachChild(node, visitor, context);\n                    }\n                    else {\n                        return node;\n                    }\n            }\n        }\n        /**\n         * Visits a node that contains a YieldExpression.\n         *\n         * @param node The node to visit.\n         */\n        function visitJavaScriptContainingYield(node) {\n            switch (node.kind) {\n                case 216 /* BinaryExpression */:\n                    return visitBinaryExpression(node);\n                case 337 /* CommaListExpression */:\n                    return visitCommaListExpression(node);\n                case 217 /* ConditionalExpression */:\n                    return visitConditionalExpression(node);\n                case 219 /* YieldExpression */:\n                    return visitYieldExpression(node);\n                case 199 /* ArrayLiteralExpression */:\n                    return visitArrayLiteralExpression(node);\n                case 200 /* ObjectLiteralExpression */:\n                    return visitObjectLiteralExpression(node);\n                case 202 /* ElementAccessExpression */:\n                    return visitElementAccessExpression(node);\n                case 203 /* CallExpression */:\n                    return visitCallExpression(node);\n                case 204 /* NewExpression */:\n                    return visitNewExpression(node);\n                default:\n                    return ts.visitEachChild(node, visitor, context);\n            }\n        }\n        /**\n         * Visits a generator function.\n         *\n         * @param node The node to visit.\n         */\n        function visitGenerator(node) {\n            switch (node.kind) {\n                case 251 /* FunctionDeclaration */:\n                    return visitFunctionDeclaration(node);\n                case 208 /* FunctionExpression */:\n                    return visitFunctionExpression(node);\n                default:\n                    return ts.Debug.failBadSyntaxKind(node);\n            }\n        }\n        /**\n         * Visits a function declaration.\n         *\n         * This will be called when one of the following conditions are met:\n         * - The function declaration is a generator function.\n         * - The function declaration is contained within the body of a generator function.\n         *\n         * @param node The node to visit.\n         */\n        function visitFunctionDeclaration(node) {\n            // Currently, we only support generators that were originally async functions.\n            if (node.asteriskToken) {\n                node = ts.setOriginalNode(ts.setTextRange(factory.createFunctionDeclaration(\n                /*decorators*/ undefined, node.modifiers, \n                /*asteriskToken*/ undefined, node.name, \n                /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), \n                /*type*/ undefined, transformGeneratorFunctionBody(node.body)), \n                /*location*/ node), node);\n            }\n            else {\n                var savedInGeneratorFunctionBody = inGeneratorFunctionBody;\n                var savedInStatementContainingYield = inStatementContainingYield;\n                inGeneratorFunctionBody = false;\n                inStatementContainingYield = false;\n                node = ts.visitEachChild(node, visitor, context);\n                inGeneratorFunctionBody = savedInGeneratorFunctionBody;\n                inStatementContainingYield = savedInStatementContainingYield;\n            }\n            if (inGeneratorFunctionBody) {\n                // Function declarations in a generator function body are hoisted\n                // to the top of the lexical scope and elided from the current statement.\n                hoistFunctionDeclaration(node);\n                return undefined;\n            }\n            else {\n                return node;\n            }\n        }\n        /**\n         * Visits a function expression.\n         *\n         * This will be called when one of the following conditions are met:\n         * - The function expression is a generator function.\n         * - The function expression is contained within the body of a generator function.\n         *\n         * @param node The node to visit.\n         */\n        function visitFunctionExpression(node) {\n            // Currently, we only support generators that were originally async functions.\n            if (node.asteriskToken) {\n                node = ts.setOriginalNode(ts.setTextRange(factory.createFunctionExpression(\n                /*modifiers*/ undefined, \n                /*asteriskToken*/ undefined, node.name, \n                /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context), \n                /*type*/ undefined, transformGeneratorFunctionBody(node.body)), \n                /*location*/ node), node);\n            }\n            else {\n                var savedInGeneratorFunctionBody = inGeneratorFunctionBody;\n                var savedInStatementContainingYield = inStatementContainingYield;\n                inGeneratorFunctionBody = false;\n                inStatementContainingYield = false;\n                node = ts.visitEachChild(node, visitor, context);\n                inGeneratorFunctionBody = savedInGeneratorFunctionBody;\n                inStatementContainingYield = savedInStatementContainingYield;\n            }\n            return node;\n        }\n        /**\n         * Visits a get or set accessor declaration.\n         *\n         * This will be called when one of the following conditions are met:\n         * - The accessor is contained within the body of a generator function.\n         *\n         * @param node The node to visit.\n         */\n        function visitAccessorDeclaration(node) {\n            var savedInGeneratorFunctionBody = inGeneratorFunctionBody;\n            var savedInStatementContainingYield = inStatementContainingYield;\n            inGeneratorFunctionBody = false;\n            inStatementContainingYield = false;\n            node = ts.visitEachChild(node, visitor, context);\n            inGeneratorFunctionBody = savedInGeneratorFunctionBody;\n            inStatementContainingYield = savedInStatementContainingYield;\n            return node;\n        }\n        /**\n         * Transforms the body of a generator function declaration.\n         *\n         * @param node The function body to transform.\n         */\n        function transformGeneratorFunctionBody(body) {\n            // Save existing generator state\n            var statements = [];\n            var savedInGeneratorFunctionBody = inGeneratorFunctionBody;\n            var savedInStatementContainingYield = inStatementContainingYield;\n            var savedBlocks = blocks;\n            var savedBlockOffsets = blockOffsets;\n            var savedBlockActions = blockActions;\n            var savedBlockStack = blockStack;\n            var savedLabelOffsets = labelOffsets;\n            var savedLabelExpressions = labelExpressions;\n            var savedNextLabelId = nextLabelId;\n            var savedOperations = operations;\n            var savedOperationArguments = operationArguments;\n            var savedOperationLocations = operationLocations;\n            var savedState = state;\n            // Initialize generator state\n            inGeneratorFunctionBody = true;\n            inStatementContainingYield = false;\n            blocks = undefined;\n            blockOffsets = undefined;\n            blockActions = undefined;\n            blockStack = undefined;\n            labelOffsets = undefined;\n            labelExpressions = undefined;\n            nextLabelId = 1;\n            operations = undefined;\n            operationArguments = undefined;\n            operationLocations = undefined;\n            state = factory.createTempVariable(/*recordTempVariable*/ undefined);\n            // Build the generator\n            resumeLexicalEnvironment();\n            var statementOffset = factory.copyPrologue(body.statements, statements, /*ensureUseStrict*/ false, visitor);\n            transformAndEmitStatements(body.statements, statementOffset);\n            var buildResult = build();\n            ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());\n            statements.push(factory.createReturnStatement(buildResult));\n            // Restore previous generator state\n            inGeneratorFunctionBody = savedInGeneratorFunctionBody;\n            inStatementContainingYield = savedInStatementContainingYield;\n            blocks = savedBlocks;\n            blockOffsets = savedBlockOffsets;\n            blockActions = savedBlockActions;\n            blockStack = savedBlockStack;\n            labelOffsets = savedLabelOffsets;\n            labelExpressions = savedLabelExpressions;\n            nextLabelId = savedNextLabelId;\n            operations = savedOperations;\n            operationArguments = savedOperationArguments;\n            operationLocations = savedOperationLocations;\n            state = savedState;\n            return ts.setTextRange(factory.createBlock(statements, body.multiLine), body);\n        }\n        /**\n         * Visits a variable statement.\n         *\n         * This will be called when one of the following conditions are met:\n         * - The variable statement is contained within the body of a generator function.\n         *\n         * @param node The node to visit.\n         */\n        function visitVariableStatement(node) {\n            if (node.transformFlags & 262144 /* ContainsYield */) {\n                transformAndEmitVariableDeclarationList(node.declarationList);\n                return undefined;\n            }\n            else {\n                // Do not hoist custom prologues.\n                if (ts.getEmitFlags(node) & 1048576 /* CustomPrologue */) {\n                    return node;\n                }\n                for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {\n                    var variable = _a[_i];\n                    hoistVariableDeclaration(variable.name);\n                }\n                var variables = ts.getInitializedVariables(node.declarationList);\n                if (variables.length === 0) {\n                    return undefined;\n                }\n                return ts.setSourceMapRange(factory.createExpressionStatement(factory.inlineExpressions(ts.map(variables, transformInitializedVariable))), node);\n            }\n        }\n        /**\n         * Visits a binary expression.\n         *\n         * This will be called when one of the following conditions are met:\n         * - The node contains a YieldExpression.\n         *\n         * @param node The node to visit.\n         */\n        function visitBinaryExpression(node) {\n            var assoc = ts.getExpressionAssociativity(node);\n            switch (assoc) {\n                case 0 /* Left */:\n                    return visitLeftAssociativeBinaryExpression(node);\n                case 1 /* Right */:\n                    return visitRightAssociativeBinaryExpression(node);\n                default:\n                    return ts.Debug.assertNever(assoc);\n            }\n        }\n        /**\n         * Visits a right-associative binary expression containing `yield`.\n         *\n         * @param node The node to visit.\n         */\n        function visitRightAssociativeBinaryExpression(node) {\n            var left = node.left, right = node.right;\n            if (containsYield(right)) {\n                var target = void 0;\n                switch (left.kind) {\n                    case 201 /* PropertyAccessExpression */:\n                        // [source]\n                        //      a.b = yield;\n                        //\n                        // [intermediate]\n                        //  .local _a\n                        //      _a = a;\n                        //  .yield resumeLabel\n                        //  .mark resumeLabel\n                        //      _a.b = %sent%;\n                        target = factory.updatePropertyAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name);\n                        break;\n                    case 202 /* ElementAccessExpression */:\n                        // [source]\n                        //      a[b] = yield;\n                        //\n                        // [intermediate]\n                        //  .local _a, _b\n                        //      _a = a;\n                        //      _b = b;\n                        //  .yield resumeLabel\n                        //  .mark resumeLabel\n                        //      _a[_b] = %sent%;\n                        target = factory.updateElementAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression)));\n                        break;\n                    default:\n                        target = ts.visitNode(left, visitor, ts.isExpression);\n                        break;\n                }\n                var operator = node.operatorToken.kind;\n                if (ts.isCompoundAssignment(operator)) {\n                    return ts.setTextRange(factory.createAssignment(target, ts.setTextRange(factory.createBinaryExpression(cacheExpression(target), ts.getNonAssignmentOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression)), node)), node);\n                }\n                else {\n                    return factory.updateBinaryExpression(node, target, node.operatorToken, ts.visitNode(right, visitor, ts.isExpression));\n                }\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitLeftAssociativeBinaryExpression(node) {\n            if (containsYield(node.right)) {\n                if (ts.isLogicalOperator(node.operatorToken.kind)) {\n                    return visitLogicalBinaryExpression(node);\n                }\n                else if (node.operatorToken.kind === 27 /* CommaToken */) {\n                    return visitCommaExpression(node);\n                }\n                // [source]\n                //      a() + (yield) + c()\n                //\n                // [intermediate]\n                //  .local _a\n                //      _a = a();\n                //  .yield resumeLabel\n                //      _a + %sent% + c()\n                return factory.updateBinaryExpression(node, cacheExpression(ts.visitNode(node.left, visitor, ts.isExpression)), node.operatorToken, ts.visitNode(node.right, visitor, ts.isExpression));\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        /**\n         * Visits a comma expression containing `yield`.\n         *\n         * @param node The node to visit.\n         */\n        function visitCommaExpression(node) {\n            // [source]\n            //      x = a(), yield, b();\n            //\n            // [intermediate]\n            //      a();\n            //  .yield resumeLabel\n            //  .mark resumeLabel\n            //      x = %sent%, b();\n            var pendingExpressions = [];\n            visit(node.left);\n            visit(node.right);\n            return factory.inlineExpressions(pendingExpressions);\n            function visit(node) {\n                if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) {\n                    visit(node.left);\n                    visit(node.right);\n                }\n                else {\n                    if (containsYield(node) && pendingExpressions.length > 0) {\n                        emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]);\n                        pendingExpressions = [];\n                    }\n                    pendingExpressions.push(ts.visitNode(node, visitor, ts.isExpression));\n                }\n            }\n        }\n        /**\n         * Visits a comma-list expression.\n         *\n         * @param node The node to visit.\n         */\n        function visitCommaListExpression(node) {\n            // flattened version of `visitCommaExpression`\n            var pendingExpressions = [];\n            for (var _i = 0, _a = node.elements; _i < _a.length; _i++) {\n                var elem = _a[_i];\n                if (ts.isBinaryExpression(elem) && elem.operatorToken.kind === 27 /* CommaToken */) {\n                    pendingExpressions.push(visitCommaExpression(elem));\n                }\n                else {\n                    if (containsYield(elem) && pendingExpressions.length > 0) {\n                        emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]);\n                        pendingExpressions = [];\n                    }\n                    pendingExpressions.push(ts.visitNode(elem, visitor, ts.isExpression));\n                }\n            }\n            return factory.inlineExpressions(pendingExpressions);\n        }\n        /**\n         * Visits a logical binary expression containing `yield`.\n         *\n         * @param node A node to visit.\n         */\n        function visitLogicalBinaryExpression(node) {\n            // Logical binary expressions (`&&` and `||`) are shortcutting expressions and need\n            // to be transformed as such:\n            //\n            // [source]\n            //      x = a() && yield;\n            //\n            // [intermediate]\n            //  .local _a\n            //      _a = a();\n            //  .brfalse resultLabel, (_a)\n            //  .yield resumeLabel\n            //  .mark resumeLabel\n            //      _a = %sent%;\n            //  .mark resultLabel\n            //      x = _a;\n            //\n            // [source]\n            //      x = a() || yield;\n            //\n            // [intermediate]\n            //  .local _a\n            //      _a = a();\n            //  .brtrue resultLabel, (_a)\n            //  .yield resumeLabel\n            //  .mark resumeLabel\n            //      _a = %sent%;\n            //  .mark resultLabel\n            //      x = _a;\n            var resultLabel = defineLabel();\n            var resultLocal = declareLocal();\n            emitAssignment(resultLocal, ts.visitNode(node.left, visitor, ts.isExpression), /*location*/ node.left);\n            if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) {\n                // Logical `&&` shortcuts when the left-hand operand is falsey.\n                emitBreakWhenFalse(resultLabel, resultLocal, /*location*/ node.left);\n            }\n            else {\n                // Logical `||` shortcuts when the left-hand operand is truthy.\n                emitBreakWhenTrue(resultLabel, resultLocal, /*location*/ node.left);\n            }\n            emitAssignment(resultLocal, ts.visitNode(node.right, visitor, ts.isExpression), /*location*/ node.right);\n            markLabel(resultLabel);\n            return resultLocal;\n        }\n        /**\n         * Visits a conditional expression containing `yield`.\n         *\n         * @param node The node to visit.\n         */\n        function visitConditionalExpression(node) {\n            // [source]\n            //      x = a() ? yield : b();\n            //\n            // [intermediate]\n            //  .local _a\n            //  .brfalse whenFalseLabel, (a())\n            //  .yield resumeLabel\n            //  .mark resumeLabel\n            //      _a = %sent%;\n            //  .br resultLabel\n            //  .mark whenFalseLabel\n            //      _a = b();\n            //  .mark resultLabel\n            //      x = _a;\n            // We only need to perform a specific transformation if a `yield` expression exists\n            // in either the `whenTrue` or `whenFalse` branches.\n            // A `yield` in the condition will be handled by the normal visitor.\n            if (containsYield(node.whenTrue) || containsYield(node.whenFalse)) {\n                var whenFalseLabel = defineLabel();\n                var resultLabel = defineLabel();\n                var resultLocal = declareLocal();\n                emitBreakWhenFalse(whenFalseLabel, ts.visitNode(node.condition, visitor, ts.isExpression), /*location*/ node.condition);\n                emitAssignment(resultLocal, ts.visitNode(node.whenTrue, visitor, ts.isExpression), /*location*/ node.whenTrue);\n                emitBreak(resultLabel);\n                markLabel(whenFalseLabel);\n                emitAssignment(resultLocal, ts.visitNode(node.whenFalse, visitor, ts.isExpression), /*location*/ node.whenFalse);\n                markLabel(resultLabel);\n                return resultLocal;\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        /**\n         * Visits a `yield` expression.\n         *\n         * @param node The node to visit.\n         */\n        function visitYieldExpression(node) {\n            // [source]\n            //      x = yield a();\n            //\n            // [intermediate]\n            //  .yield resumeLabel, (a())\n            //  .mark resumeLabel\n            //      x = %sent%;\n            var resumeLabel = defineLabel();\n            var expression = ts.visitNode(node.expression, visitor, ts.isExpression);\n            if (node.asteriskToken) {\n                // NOTE: `expression` must be defined for `yield*`.\n                var iterator = (ts.getEmitFlags(node.expression) & 8388608 /* Iterator */) === 0\n                    ? ts.setTextRange(emitHelpers().createValuesHelper(expression), node)\n                    : expression;\n                emitYieldStar(iterator, /*location*/ node);\n            }\n            else {\n                emitYield(expression, /*location*/ node);\n            }\n            markLabel(resumeLabel);\n            return createGeneratorResume(/*location*/ node);\n        }\n        /**\n         * Visits an ArrayLiteralExpression that contains a YieldExpression.\n         *\n         * @param node The node to visit.\n         */\n        function visitArrayLiteralExpression(node) {\n            return visitElements(node.elements, /*leadingElement*/ undefined, /*location*/ undefined, node.multiLine);\n        }\n        /**\n         * Visits an array of expressions containing one or more YieldExpression nodes\n         * and returns an expression for the resulting value.\n         *\n         * @param elements The elements to visit.\n         * @param multiLine Whether array literals created should be emitted on multiple lines.\n         */\n        function visitElements(elements, leadingElement, location, multiLine) {\n            // [source]\n            //      ar = [1, yield, 2];\n            //\n            // [intermediate]\n            //  .local _a\n            //      _a = [1];\n            //  .yield resumeLabel\n            //  .mark resumeLabel\n            //      ar = _a.concat([%sent%, 2]);\n            var numInitialElements = countInitialNodesWithoutYield(elements);\n            var temp;\n            if (numInitialElements > 0) {\n                temp = declareLocal();\n                var initialElements = ts.visitNodes(elements, visitor, ts.isExpression, 0, numInitialElements);\n                emitAssignment(temp, factory.createArrayLiteralExpression(leadingElement\n                    ? __spreadArray([leadingElement], initialElements) : initialElements));\n                leadingElement = undefined;\n            }\n            var expressions = ts.reduceLeft(elements, reduceElement, [], numInitialElements);\n            return temp\n                ? factory.createArrayConcatCall(temp, [factory.createArrayLiteralExpression(expressions, multiLine)])\n                : ts.setTextRange(factory.createArrayLiteralExpression(leadingElement ? __spreadArray([leadingElement], expressions) : expressions, multiLine), location);\n            function reduceElement(expressions, element) {\n                if (containsYield(element) && expressions.length > 0) {\n                    var hasAssignedTemp = temp !== undefined;\n                    if (!temp) {\n                        temp = declareLocal();\n                    }\n                    emitAssignment(temp, hasAssignedTemp\n                        ? factory.createArrayConcatCall(temp, [factory.createArrayLiteralExpression(expressions, multiLine)])\n                        : factory.createArrayLiteralExpression(leadingElement ? __spreadArray([leadingElement], expressions) : expressions, multiLine));\n                    leadingElement = undefined;\n                    expressions = [];\n                }\n                expressions.push(ts.visitNode(element, visitor, ts.isExpression));\n                return expressions;\n            }\n        }\n        function visitObjectLiteralExpression(node) {\n            // [source]\n            //      o = {\n            //          a: 1,\n            //          b: yield,\n            //          c: 2\n            //      };\n            //\n            // [intermediate]\n            //  .local _a\n            //      _a = {\n            //          a: 1\n            //      };\n            //  .yield resumeLabel\n            //  .mark resumeLabel\n            //      o = (_a.b = %sent%,\n            //          _a.c = 2,\n            //          _a);\n            var properties = node.properties;\n            var multiLine = node.multiLine;\n            var numInitialProperties = countInitialNodesWithoutYield(properties);\n            var temp = declareLocal();\n            emitAssignment(temp, factory.createObjectLiteralExpression(ts.visitNodes(properties, visitor, ts.isObjectLiteralElementLike, 0, numInitialProperties), multiLine));\n            var expressions = ts.reduceLeft(properties, reduceProperty, [], numInitialProperties);\n            // TODO(rbuckton): Does this need to be parented?\n            expressions.push(multiLine ? ts.startOnNewLine(ts.setParent(ts.setTextRange(factory.cloneNode(temp), temp), temp.parent)) : temp);\n            return factory.inlineExpressions(expressions);\n            function reduceProperty(expressions, property) {\n                if (containsYield(property) && expressions.length > 0) {\n                    emitStatement(factory.createExpressionStatement(factory.inlineExpressions(expressions)));\n                    expressions = [];\n                }\n                var expression = ts.createExpressionForObjectLiteralElementLike(factory, node, property, temp);\n                var visited = ts.visitNode(expression, visitor, ts.isExpression);\n                if (visited) {\n                    if (multiLine) {\n                        ts.startOnNewLine(visited);\n                    }\n                    expressions.push(visited);\n                }\n                return expressions;\n            }\n        }\n        /**\n         * Visits an ElementAccessExpression that contains a YieldExpression.\n         *\n         * @param node The node to visit.\n         */\n        function visitElementAccessExpression(node) {\n            if (containsYield(node.argumentExpression)) {\n                // [source]\n                //      a = x[yield];\n                //\n                // [intermediate]\n                //  .local _a\n                //      _a = x;\n                //  .yield resumeLabel\n                //  .mark resumeLabel\n                //      a = _a[%sent%]\n                return factory.updateElementAccessExpression(node, cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)), ts.visitNode(node.argumentExpression, visitor, ts.isExpression));\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitCallExpression(node) {\n            if (!ts.isImportCall(node) && ts.forEach(node.arguments, containsYield)) {\n                // [source]\n                //      a.b(1, yield, 2);\n                //\n                // [intermediate]\n                //  .local _a, _b, _c\n                //      _b = (_a = a).b;\n                //      _c = [1];\n                //  .yield resumeLabel\n                //  .mark resumeLabel\n                //      _b.apply(_a, _c.concat([%sent%, 2]));\n                var _a = factory.createCallBinding(node.expression, hoistVariableDeclaration, languageVersion, /*cacheIdentifiers*/ true), target = _a.target, thisArg = _a.thisArg;\n                return ts.setOriginalNode(ts.setTextRange(factory.createFunctionApplyCall(cacheExpression(ts.visitNode(target, visitor, ts.isLeftHandSideExpression)), thisArg, visitElements(node.arguments)), node), node);\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function visitNewExpression(node) {\n            if (ts.forEach(node.arguments, containsYield)) {\n                // [source]\n                //      new a.b(1, yield, 2);\n                //\n                // [intermediate]\n                //  .local _a, _b, _c\n                //      _b = (_a = a.b).bind;\n                //      _c = [1];\n                //  .yield resumeLabel\n                //  .mark resumeLabel\n                //      new (_b.apply(_a, _c.concat([%sent%, 2])));\n                var _a = factory.createCallBinding(factory.createPropertyAccessExpression(node.expression, \"bind\"), hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg;\n                return ts.setOriginalNode(ts.setTextRange(factory.createNewExpression(factory.createFunctionApplyCall(cacheExpression(ts.visitNode(target, visitor, ts.isExpression)), thisArg, visitElements(node.arguments, \n                /*leadingElement*/ factory.createVoidZero())), \n                /*typeArguments*/ undefined, []), node), node);\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function transformAndEmitStatements(statements, start) {\n            if (start === void 0) { start = 0; }\n            var numStatements = statements.length;\n            for (var i = start; i < numStatements; i++) {\n                transformAndEmitStatement(statements[i]);\n            }\n        }\n        function transformAndEmitEmbeddedStatement(node) {\n            if (ts.isBlock(node)) {\n                transformAndEmitStatements(node.statements);\n            }\n            else {\n                transformAndEmitStatement(node);\n            }\n        }\n        function transformAndEmitStatement(node) {\n            var savedInStatementContainingYield = inStatementContainingYield;\n            if (!inStatementContainingYield) {\n                inStatementContainingYield = containsYield(node);\n            }\n            transformAndEmitStatementWorker(node);\n            inStatementContainingYield = savedInStatementContainingYield;\n        }\n        function transformAndEmitStatementWorker(node) {\n            switch (node.kind) {\n                case 230 /* Block */:\n                    return transformAndEmitBlock(node);\n                case 233 /* ExpressionStatement */:\n                    return transformAndEmitExpressionStatement(node);\n                case 234 /* IfStatement */:\n                    return transformAndEmitIfStatement(node);\n                case 235 /* DoStatement */:\n                    return transformAndEmitDoStatement(node);\n                case 236 /* WhileStatement */:\n                    return transformAndEmitWhileStatement(node);\n                case 237 /* ForStatement */:\n                    return transformAndEmitForStatement(node);\n                case 238 /* ForInStatement */:\n                    return transformAndEmitForInStatement(node);\n                case 240 /* ContinueStatement */:\n                    return transformAndEmitContinueStatement(node);\n                case 241 /* BreakStatement */:\n                    return transformAndEmitBreakStatement(node);\n                case 242 /* ReturnStatement */:\n                    return transformAndEmitReturnStatement(node);\n                case 243 /* WithStatement */:\n                    return transformAndEmitWithStatement(node);\n                case 244 /* SwitchStatement */:\n                    return transformAndEmitSwitchStatement(node);\n                case 245 /* LabeledStatement */:\n                    return transformAndEmitLabeledStatement(node);\n                case 246 /* ThrowStatement */:\n                    return transformAndEmitThrowStatement(node);\n                case 247 /* TryStatement */:\n                    return transformAndEmitTryStatement(node);\n                default:\n                    return emitStatement(ts.visitNode(node, visitor, ts.isStatement));\n            }\n        }\n        function transformAndEmitBlock(node) {\n            if (containsYield(node)) {\n                transformAndEmitStatements(node.statements);\n            }\n            else {\n                emitStatement(ts.visitNode(node, visitor, ts.isStatement));\n            }\n        }\n        function transformAndEmitExpressionStatement(node) {\n            emitStatement(ts.visitNode(node, visitor, ts.isStatement));\n        }\n        function transformAndEmitVariableDeclarationList(node) {\n            for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) {\n                var variable = _a[_i];\n                var name = factory.cloneNode(variable.name);\n                ts.setCommentRange(name, variable.name);\n                hoistVariableDeclaration(name);\n            }\n            var variables = ts.getInitializedVariables(node);\n            var numVariables = variables.length;\n            var variablesWritten = 0;\n            var pendingExpressions = [];\n            while (variablesWritten < numVariables) {\n                for (var i = variablesWritten; i < numVariables; i++) {\n                    var variable = variables[i];\n                    if (containsYield(variable.initializer) && pendingExpressions.length > 0) {\n                        break;\n                    }\n                    pendingExpressions.push(transformInitializedVariable(variable));\n                }\n                if (pendingExpressions.length) {\n                    emitStatement(factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions)));\n                    variablesWritten += pendingExpressions.length;\n                    pendingExpressions = [];\n                }\n            }\n            return undefined;\n        }\n        function transformInitializedVariable(node) {\n            return ts.setSourceMapRange(factory.createAssignment(ts.setSourceMapRange(factory.cloneNode(node.name), node.name), ts.visitNode(node.initializer, visitor, ts.isExpression)), node);\n        }\n        function transformAndEmitIfStatement(node) {\n            if (containsYield(node)) {\n                // [source]\n                //      if (x)\n                //          /*thenStatement*/\n                //      else\n                //          /*elseStatement*/\n                //\n                // [intermediate]\n                //  .brfalse elseLabel, (x)\n                //      /*thenStatement*/\n                //  .br endLabel\n                //  .mark elseLabel\n                //      /*elseStatement*/\n                //  .mark endLabel\n                if (containsYield(node.thenStatement) || containsYield(node.elseStatement)) {\n                    var endLabel = defineLabel();\n                    var elseLabel = node.elseStatement ? defineLabel() : undefined;\n                    emitBreakWhenFalse(node.elseStatement ? elseLabel : endLabel, ts.visitNode(node.expression, visitor, ts.isExpression), /*location*/ node.expression);\n                    transformAndEmitEmbeddedStatement(node.thenStatement);\n                    if (node.elseStatement) {\n                        emitBreak(endLabel);\n                        markLabel(elseLabel);\n                        transformAndEmitEmbeddedStatement(node.elseStatement);\n                    }\n                    markLabel(endLabel);\n                }\n                else {\n                    emitStatement(ts.visitNode(node, visitor, ts.isStatement));\n                }\n            }\n            else {\n                emitStatement(ts.visitNode(node, visitor, ts.isStatement));\n            }\n        }\n        function transformAndEmitDoStatement(node) {\n            if (containsYield(node)) {\n                // [source]\n                //      do {\n                //          /*body*/\n                //      }\n                //      while (i < 10);\n                //\n                // [intermediate]\n                //  .loop conditionLabel, endLabel\n                //  .mark loopLabel\n                //      /*body*/\n                //  .mark conditionLabel\n                //  .brtrue loopLabel, (i < 10)\n                //  .endloop\n                //  .mark endLabel\n                var conditionLabel = defineLabel();\n                var loopLabel = defineLabel();\n                beginLoopBlock(/*continueLabel*/ conditionLabel);\n                markLabel(loopLabel);\n                transformAndEmitEmbeddedStatement(node.statement);\n                markLabel(conditionLabel);\n                emitBreakWhenTrue(loopLabel, ts.visitNode(node.expression, visitor, ts.isExpression));\n                endLoopBlock();\n            }\n            else {\n                emitStatement(ts.visitNode(node, visitor, ts.isStatement));\n            }\n        }\n        function visitDoStatement(node) {\n            if (inStatementContainingYield) {\n                beginScriptLoopBlock();\n                node = ts.visitEachChild(node, visitor, context);\n                endLoopBlock();\n                return node;\n            }\n            else {\n                return ts.visitEachChild(node, visitor, context);\n            }\n        }\n        function transformAndEmitWhileStatement(node) {\n            if (containsYield(node)) {\n                // [source]\n                //      while (i < 10) {\n                //          /*body*/\n                //      }\n                //\n                // [intermediate]\n                //  .loop loopLabel, endLabel\n                //  .mark loopLabel\n                //  .brfalse endLabel, (i < 10)\n                //      /*body*/\n                //  .br loopLabel\n                //  .endloop\n                //  .mark endLabel\n                var loopLabel = defineLabel();\n                var endLabel = beginLoopBlock(loopLabel);\n                markLabel(loopLabel);\n                emitBreakWhenFalse(endLabel, ts.visitNode(node.expression, visitor, ts.isExpression));\n                transformAndEmitEmbeddedStatement(node.statement);\n                emitBreak(loopLabel);\n                endLoopBlock();\n            }\n            else {\n                emitStatement(ts.visitNode(node, visitor, ts.isStatement));\n            }\n        }\n        function visitWhileStatement(node) {\n            if (inStatementContainingYield) {\n                beginScriptLoopBlock();\n                node = ts.visitEachChild(node, visitor, context);\n                endLoopBlock();\n                return node;\n            }\n            else {\n                return ts.visitEachChild(node, visitor, context);\n            }\n        }\n        function transformAndEmitForStatement(node) {\n            if (containsYield(node)) {\n                // [source]\n                //      for (var i = 0; i < 10; i++) {\n                //          /*body*/\n                //      }\n                //\n                // [intermediate]\n                //  .local i\n                //      i = 0;\n                //  .loop incrementLabel, endLoopLabel\n                //  .mark conditionLabel\n                //  .brfalse endLoopLabel, (i < 10)\n                //      /*body*/\n                //  .mark incrementLabel\n                //      i++;\n                //  .br conditionLabel\n                //  .endloop\n                //  .mark endLoopLabel\n                var conditionLabel = defineLabel();\n                var incrementLabel = defineLabel();\n                var endLabel = beginLoopBlock(incrementLabel);\n                if (node.initializer) {\n                    var initializer = node.initializer;\n                    if (ts.isVariableDeclarationList(initializer)) {\n                        transformAndEmitVariableDeclarationList(initializer);\n                    }\n                    else {\n                        emitStatement(ts.setTextRange(factory.createExpressionStatement(ts.visitNode(initializer, visitor, ts.isExpression)), initializer));\n                    }\n                }\n                markLabel(conditionLabel);\n                if (node.condition) {\n                    emitBreakWhenFalse(endLabel, ts.visitNode(node.condition, visitor, ts.isExpression));\n                }\n                transformAndEmitEmbeddedStatement(node.statement);\n                markLabel(incrementLabel);\n                if (node.incrementor) {\n                    emitStatement(ts.setTextRange(factory.createExpressionStatement(ts.visitNode(node.incrementor, visitor, ts.isExpression)), node.incrementor));\n                }\n                emitBreak(conditionLabel);\n                endLoopBlock();\n            }\n            else {\n                emitStatement(ts.visitNode(node, visitor, ts.isStatement));\n            }\n        }\n        function visitForStatement(node) {\n            if (inStatementContainingYield) {\n                beginScriptLoopBlock();\n            }\n            var initializer = node.initializer;\n            if (initializer && ts.isVariableDeclarationList(initializer)) {\n                for (var _i = 0, _a = initializer.declarations; _i < _a.length; _i++) {\n                    var variable = _a[_i];\n                    hoistVariableDeclaration(variable.name);\n                }\n                var variables = ts.getInitializedVariables(initializer);\n                node = factory.updateForStatement(node, variables.length > 0\n                    ? factory.inlineExpressions(ts.map(variables, transformInitializedVariable))\n                    : undefined, ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock));\n            }\n            else {\n                node = ts.visitEachChild(node, visitor, context);\n            }\n            if (inStatementContainingYield) {\n                endLoopBlock();\n            }\n            return node;\n        }\n        function transformAndEmitForInStatement(node) {\n            // TODO(rbuckton): Source map locations\n            if (containsYield(node)) {\n                // [source]\n                //      for (var p in o) {\n                //          /*body*/\n                //      }\n                //\n                // [intermediate]\n                //  .local _a, _b, _i\n                //      _a = [];\n                //      for (_b in o) _a.push(_b);\n                //      _i = 0;\n                //  .loop incrementLabel, endLoopLabel\n                //  .mark conditionLabel\n                //  .brfalse endLoopLabel, (_i < _a.length)\n                //      p = _a[_i];\n                //      /*body*/\n                //  .mark incrementLabel\n                //      _b++;\n                //  .br conditionLabel\n                //  .endloop\n                //  .mark endLoopLabel\n                var keysArray = declareLocal(); // _a\n                var key = declareLocal(); // _b\n                var keysIndex = factory.createLoopVariable(); // _i\n                var initializer = node.initializer;\n                hoistVariableDeclaration(keysIndex);\n                emitAssignment(keysArray, factory.createArrayLiteralExpression());\n                emitStatement(factory.createForInStatement(key, ts.visitNode(node.expression, visitor, ts.isExpression), factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(keysArray, \"push\"), \n                /*typeArguments*/ undefined, [key]))));\n                emitAssignment(keysIndex, factory.createNumericLiteral(0));\n                var conditionLabel = defineLabel();\n                var incrementLabel = defineLabel();\n                var endLabel = beginLoopBlock(incrementLabel);\n                markLabel(conditionLabel);\n                emitBreakWhenFalse(endLabel, factory.createLessThan(keysIndex, factory.createPropertyAccessExpression(keysArray, \"length\")));\n                var variable = void 0;\n                if (ts.isVariableDeclarationList(initializer)) {\n                    for (var _i = 0, _a = initializer.declarations; _i < _a.length; _i++) {\n                        var variable_1 = _a[_i];\n                        hoistVariableDeclaration(variable_1.name);\n                    }\n                    variable = factory.cloneNode(initializer.declarations[0].name);\n                }\n                else {\n                    variable = ts.visitNode(initializer, visitor, ts.isExpression);\n                    ts.Debug.assert(ts.isLeftHandSideExpression(variable));\n                }\n                emitAssignment(variable, factory.createElementAccessExpression(keysArray, keysIndex));\n                transformAndEmitEmbeddedStatement(node.statement);\n                markLabel(incrementLabel);\n                emitStatement(factory.createExpressionStatement(factory.createPostfixIncrement(keysIndex)));\n                emitBreak(conditionLabel);\n                endLoopBlock();\n            }\n            else {\n                emitStatement(ts.visitNode(node, visitor, ts.isStatement));\n            }\n        }\n        function visitForInStatement(node) {\n            // [source]\n            //      for (var x in a) {\n            //          /*body*/\n            //      }\n            //\n            // [intermediate]\n            //  .local x\n            //  .loop\n            //      for (x in a) {\n            //          /*body*/\n            //      }\n            //  .endloop\n            if (inStatementContainingYield) {\n                beginScriptLoopBlock();\n            }\n            var initializer = node.initializer;\n            if (ts.isVariableDeclarationList(initializer)) {\n                for (var _i = 0, _a = initializer.declarations; _i < _a.length; _i++) {\n                    var variable = _a[_i];\n                    hoistVariableDeclaration(variable.name);\n                }\n                node = factory.updateForInStatement(node, initializer.declarations[0].name, ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock));\n            }\n            else {\n                node = ts.visitEachChild(node, visitor, context);\n            }\n            if (inStatementContainingYield) {\n                endLoopBlock();\n            }\n            return node;\n        }\n        function transformAndEmitContinueStatement(node) {\n            var label = findContinueTarget(node.label ? ts.idText(node.label) : undefined);\n            if (label > 0) {\n                emitBreak(label, /*location*/ node);\n            }\n            else {\n                // invalid continue without a containing loop. Leave the node as is, per #17875.\n                emitStatement(node);\n            }\n        }\n        function visitContinueStatement(node) {\n            if (inStatementContainingYield) {\n                var label = findContinueTarget(node.label && ts.idText(node.label));\n                if (label > 0) {\n                    return createInlineBreak(label, /*location*/ node);\n                }\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function transformAndEmitBreakStatement(node) {\n            var label = findBreakTarget(node.label ? ts.idText(node.label) : undefined);\n            if (label > 0) {\n                emitBreak(label, /*location*/ node);\n            }\n            else {\n                // invalid break without a containing loop, switch, or labeled statement. Leave the node as is, per #17875.\n                emitStatement(node);\n            }\n        }\n        function visitBreakStatement(node) {\n            if (inStatementContainingYield) {\n                var label = findBreakTarget(node.label && ts.idText(node.label));\n                if (label > 0) {\n                    return createInlineBreak(label, /*location*/ node);\n                }\n            }\n            return ts.visitEachChild(node, visitor, context);\n        }\n        function transformAndEmitReturnStatement(node) {\n            emitReturn(ts.visitNode(node.expression, visitor, ts.isExpression), \n            /*location*/ node);\n        }\n        function visitReturnStatement(node) {\n            return createInlineReturn(ts.visitNode(node.expression, visitor, ts.isExpression), \n            /*location*/ node);\n        }\n        function transformAndEmitWithStatement(node) {\n            if (containsYield(node)) {\n                // [source]\n                //      with (x) {\n                //          /*body*/\n                //      }\n                //\n                // [intermediate]\n                //  .with (x)\n                //      /*body*/\n                //  .endwith\n                beginWithBlock(cacheExpression(ts.visitNode(node.expression, visitor, ts.isExpression)));\n                transformAndEmitEmbeddedStatement(node.statement);\n                endWithBlock();\n            }\n            else {\n                emitStatement(ts.visitNode(node, visitor, ts.isStatement));\n            }\n        }\n        function transformAndEmitSwitchStatement(node) {\n            if (containsYield(node.caseBlock)) {\n                // [source]\n                //      switch (x) {\n                //          case a:\n                //              /*caseStatements*/\n                //          case b:\n                //              /*caseStatements*/\n                //          default:\n                //              /*defaultStatements*/\n                //      }\n                //\n                // [intermediate]\n                //  .local _a\n                //  .switch endLabel\n                //      _a = x;\n                //      switch (_a) {\n                //          case a:\n                //  .br clauseLabels[0]\n                //      }\n                //      switch (_a) {\n                //          case b:\n                //  .br clauseLabels[1]\n                //      }\n                //  .br clauseLabels[2]\n                //  .mark clauseLabels[0]\n                //      /*caseStatements*/\n                //  .mark clauseLabels[1]\n                //      /*caseStatements*/\n                //  .mark clauseLabels[2]\n                //      /*caseStatements*/\n                //  .endswitch\n                //  .mark endLabel\n                var caseBlock = node.caseBlock;\n                var numClauses = caseBlock.clauses.length;\n                var endLabel = beginSwitchBlock();\n                var expression = cacheExpression(ts.visitNode(node.expression, visitor, ts.isExpression));\n                // Create labels for each clause and find the index of the first default clause.\n                var clauseLabels = [];\n                var defaultClauseIndex = -1;\n                for (var i = 0; i < numClauses; i++) {\n                    var clause = caseBlock.clauses[i];\n                    clauseLabels.push(defineLabel());\n                    if (clause.kind === 285 /* DefaultClause */ && defaultClauseIndex === -1) {\n                        defaultClauseIndex = i;\n                    }\n                }\n                // Emit switch statements for each run of case clauses either from the first case\n                // clause or the next case clause with a `yield` in its expression, up to the next\n                // case clause with a `yield` in its expression.\n                var clausesWritten = 0;\n                var pendingClauses = [];\n                while (clausesWritten < numClauses) {\n                    var defaultClausesSkipped = 0;\n                    for (var i = clausesWritten; i < numClauses; i++) {\n                        var clause = caseBlock.clauses[i];\n                        if (clause.kind === 284 /* CaseClause */) {\n                            if (containsYield(clause.expression) && pendingClauses.length > 0) {\n                                break;\n                            }\n                            pendingClauses.push(factory.createCaseClause(ts.visitNode(clause.expression, visitor, ts.isExpression), [\n                                createInlineBreak(clauseLabels[i], /*location*/ clause.expression)\n                            ]));\n                        }\n                        else {\n                            defaultClausesSkipped++;\n                        }\n                    }\n                    if (pendingClauses.length) {\n                        emitStatement(factory.createSwitchStatement(expression, factory.createCaseBlock(pendingClauses)));\n                        clausesWritten += pendingClauses.length;\n                        pendingClauses = [];\n                    }\n                    if (defaultClausesSkipped > 0) {\n                        clausesWritten += defaultClausesSkipped;\n                        defaultClausesSkipped = 0;\n                    }\n                }\n                if (defaultClauseIndex >= 0) {\n                    emitBreak(clauseLabels[defaultClauseIndex]);\n                }\n                else {\n                    emitBreak(endLabel);\n                }\n                for (var i = 0; i < numClauses; i++) {\n                    markLabel(clauseLabels[i]);\n                    transformAndEmitStatements(caseBlock.clauses[i].statements);\n                }\n                endSwitchBlock();\n            }\n            else {\n                emitStatement(ts.visitNode(node, visitor, ts.isStatement));\n            }\n        }\n        function visitSwitchStatement(node) {\n            if (inStatementContainingYield) {\n                beginScriptSwitchBlock();\n            }\n            node = ts.visitEachChild(node, visitor, context);\n            if (inStatementContainingYield) {\n                endSwitchBlock();\n            }\n            return node;\n        }\n        function transformAndEmitLabeledStatement(node) {\n            if (containsYield(node)) {\n                // [source]\n                //      x: {\n                //          /*body*/\n                //      }\n                //\n                // [intermediate]\n                //  .labeled \"x\", endLabel\n                //      /*body*/\n                //  .endlabeled\n                //  .mark endLabel\n                beginLabeledBlock(ts.idText(node.label));\n                transformAndEmitEmbeddedStatement(node.statement);\n                endLabeledBlock();\n            }\n            else {\n                emitStatement(ts.visitNode(node, visitor, ts.isStatement));\n            }\n        }\n        function visitLabeledStatement(node) {\n            if (inStatementContainingYield) {\n                beginScriptLabeledBlock(ts.idText(node.label));\n            }\n            node = ts.visitEachChild(node, visitor, context);\n            if (inStatementContainingYield) {\n                endLabeledBlock();\n            }\n            return node;\n        }\n        function transformAndEmitThrowStatement(node) {\n            var _a;\n            // TODO(rbuckton): `expression` should be required on `throw`.\n            emitThrow(ts.visitNode((_a = node.expression) !== null && _a !== void 0 ? _a : factory.createVoidZero(), visitor, ts.isExpression), \n            /*location*/ node);\n        }\n        function transformAndEmitTryStatement(node) {\n            if (containsYield(node)) {\n                // [source]\n                //      try {\n                //          /*tryBlock*/\n                //      }\n                //      catch (e) {\n                //          /*catchBlock*/\n                //      }\n                //      finally {\n                //          /*finallyBlock*/\n                //      }\n                //\n                // [intermediate]\n                //  .local _a\n                //  .try tryLabel, catchLabel, finallyLabel, endLabel\n                //  .mark tryLabel\n                //  .nop\n                //      /*tryBlock*/\n                //  .br endLabel\n                //  .catch\n                //  .mark catchLabel\n                //      _a = %error%;\n                //      /*catchBlock*/\n                //  .br endLabel\n                //  .finally\n                //  .mark finallyLabel\n                //      /*finallyBlock*/\n                //  .endfinally\n                //  .endtry\n                //  .mark endLabel\n                beginExceptionBlock();\n                transformAndEmitEmbeddedStatement(node.tryBlock);\n                if (node.catchClause) {\n                    beginCatchBlock(node.catchClause.variableDeclaration); // TODO: GH#18217\n                    transformAndEmitEmbeddedStatement(node.catchClause.block);\n                }\n                if (node.finallyBlock) {\n                    beginFinallyBlock();\n                    transformAndEmitEmbeddedStatement(node.finallyBlock);\n                }\n                endExceptionBlock();\n            }\n            else {\n                emitStatement(ts.visitEachChild(node, visitor, context));\n            }\n        }\n        function containsYield(node) {\n            return !!node && (node.transformFlags & 262144 /* ContainsYield */) !== 0;\n        }\n        function countInitialNodesWithoutYield(nodes) {\n            var numNodes = nodes.length;\n            for (var i = 0; i < numNodes; i++) {\n                if (containsYield(nodes[i])) {\n                    return i;\n                }\n            }\n            return -1;\n        }\n        function onSubstituteNode(hint, node) {\n            node = previousOnSubstituteNode(hint, node);\n            if (hint === 1 /* Expression */) {\n                return substituteExpression(node);\n            }\n            return node;\n        }\n        function substituteExpression(node) {\n            if (ts.isIdentifier(node)) {\n                return substituteExpressionIdentifier(node);\n            }\n            return node;\n        }\n        function substituteExpressionIdentifier(node) {\n            if (!ts.isGeneratedIdentifier(node) && renamedCatchVariables && renamedCatchVariables.has(ts.idText(node))) {\n                var original = ts.getOriginalNode(node);\n                if (ts.isIdentifier(original) && original.parent) {\n                    var declaration = resolver.getReferencedValueDeclaration(original);\n                    if (declaration) {\n                        var name = renamedCatchVariableDeclarations[ts.getOriginalNodeId(declaration)];\n                        if (name) {\n                            // TODO(rbuckton): Does this need to be parented?\n                            var clone_5 = ts.setParent(ts.setTextRange(factory.cloneNode(name), name), name.parent);\n                            ts.setSourceMapRange(clone_5, node);\n                            ts.setCommentRange(clone_5, node);\n                            return clone_5;\n                        }\n                    }\n                }\n            }\n            return node;\n        }\n        function cacheExpression(node) {\n            if (ts.isGeneratedIdentifier(node) || ts.getEmitFlags(node) & 4096 /* HelperName */) {\n                return node;\n            }\n            var temp = factory.createTempVariable(hoistVariableDeclaration);\n            emitAssignment(temp, node, /*location*/ node);\n            return temp;\n        }\n        function declareLocal(name) {\n            var temp = name\n                ? factory.createUniqueName(name)\n                : factory.createTempVariable(/*recordTempVariable*/ undefined);\n            hoistVariableDeclaration(temp);\n            return temp;\n        }\n        /**\n         * Defines a label, uses as the target of a Break operation.\n         */\n        function defineLabel() {\n            if (!labelOffsets) {\n                labelOffsets = [];\n            }\n            var label = nextLabelId;\n            nextLabelId++;\n            labelOffsets[label] = -1;\n            return label;\n        }\n        /**\n         * Marks the current operation with the specified label.\n         */\n        function markLabel(label) {\n            ts.Debug.assert(labelOffsets !== undefined, \"No labels were defined.\");\n            labelOffsets[label] = operations ? operations.length : 0;\n        }\n        /**\n         * Begins a block operation (With, Break/Continue, Try/Catch/Finally)\n         *\n         * @param block Information about the block.\n         */\n        function beginBlock(block) {\n            if (!blocks) {\n                blocks = [];\n                blockActions = [];\n                blockOffsets = [];\n                blockStack = [];\n            }\n            var index = blockActions.length;\n            blockActions[index] = 0 /* Open */;\n            blockOffsets[index] = operations ? operations.length : 0;\n            blocks[index] = block;\n            blockStack.push(block);\n            return index;\n        }\n        /**\n         * Ends the current block operation.\n         */\n        function endBlock() {\n            var block = peekBlock();\n            if (block === undefined)\n                return ts.Debug.fail(\"beginBlock was never called.\");\n            var index = blockActions.length;\n            blockActions[index] = 1 /* Close */;\n            blockOffsets[index] = operations ? operations.length : 0;\n            blocks[index] = block;\n            blockStack.pop();\n            return block;\n        }\n        /**\n         * Gets the current open block.\n         */\n        function peekBlock() {\n            return ts.lastOrUndefined(blockStack);\n        }\n        /**\n         * Gets the kind of the current open block.\n         */\n        function peekBlockKind() {\n            var block = peekBlock();\n            return block && block.kind;\n        }\n        /**\n         * Begins a code block for a generated `with` statement.\n         *\n         * @param expression An identifier representing expression for the `with` block.\n         */\n        function beginWithBlock(expression) {\n            var startLabel = defineLabel();\n            var endLabel = defineLabel();\n            markLabel(startLabel);\n            beginBlock({\n                kind: 1 /* With */,\n                expression: expression,\n                startLabel: startLabel,\n                endLabel: endLabel\n            });\n        }\n        /**\n         * Ends a code block for a generated `with` statement.\n         */\n        function endWithBlock() {\n            ts.Debug.assert(peekBlockKind() === 1 /* With */);\n            var block = endBlock();\n            markLabel(block.endLabel);\n        }\n        /**\n         * Begins a code block for a generated `try` statement.\n         */\n        function beginExceptionBlock() {\n            var startLabel = defineLabel();\n            var endLabel = defineLabel();\n            markLabel(startLabel);\n            beginBlock({\n                kind: 0 /* Exception */,\n                state: 0 /* Try */,\n                startLabel: startLabel,\n                endLabel: endLabel\n            });\n            emitNop();\n            return endLabel;\n        }\n        /**\n         * Enters the `catch` clause of a generated `try` statement.\n         *\n         * @param variable The catch variable.\n         */\n        function beginCatchBlock(variable) {\n            ts.Debug.assert(peekBlockKind() === 0 /* Exception */);\n            // generated identifiers should already be unique within a file\n            var name;\n            if (ts.isGeneratedIdentifier(variable.name)) {\n                name = variable.name;\n                hoistVariableDeclaration(variable.name);\n            }\n            else {\n                var text = ts.idText(variable.name);\n                name = declareLocal(text);\n                if (!renamedCatchVariables) {\n                    renamedCatchVariables = new ts.Map();\n                    renamedCatchVariableDeclarations = [];\n                    context.enableSubstitution(78 /* Identifier */);\n                }\n                renamedCatchVariables.set(text, true);\n                renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name;\n            }\n            var exception = peekBlock();\n            ts.Debug.assert(exception.state < 1 /* Catch */);\n            var endLabel = exception.endLabel;\n            emitBreak(endLabel);\n            var catchLabel = defineLabel();\n            markLabel(catchLabel);\n            exception.state = 1 /* Catch */;\n            exception.catchVariable = name;\n            exception.catchLabel = catchLabel;\n            emitAssignment(name, factory.createCallExpression(factory.createPropertyAccessExpression(state, \"sent\"), /*typeArguments*/ undefined, []));\n            emitNop();\n        }\n        /**\n         * Enters the `finally` block of a generated `try` statement.\n         */\n        function beginFinallyBlock() {\n            ts.Debug.assert(peekBlockKind() === 0 /* Exception */);\n            var exception = peekBlock();\n            ts.Debug.assert(exception.state < 2 /* Finally */);\n            var endLabel = exception.endLabel;\n            emitBreak(endLabel);\n            var finallyLabel = defineLabel();\n            markLabel(finallyLabel);\n            exception.state = 2 /* Finally */;\n            exception.finallyLabel = finallyLabel;\n        }\n        /**\n         * Ends the code block for a generated `try` statement.\n         */\n        function endExceptionBlock() {\n            ts.Debug.assert(peekBlockKind() === 0 /* Exception */);\n            var exception = endBlock();\n            var state = exception.state;\n            if (state < 2 /* Finally */) {\n                emitBreak(exception.endLabel);\n            }\n            else {\n                emitEndfinally();\n            }\n            markLabel(exception.endLabel);\n            emitNop();\n            exception.state = 3 /* Done */;\n        }\n        /**\n         * Begins a code block that supports `break` or `continue` statements that are defined in\n         * the source tree and not from generated code.\n         *\n         * @param labelText Names from containing labeled statements.\n         */\n        function beginScriptLoopBlock() {\n            beginBlock({\n                kind: 3 /* Loop */,\n                isScript: true,\n                breakLabel: -1,\n                continueLabel: -1\n            });\n        }\n        /**\n         * Begins a code block that supports `break` or `continue` statements that are defined in\n         * generated code. Returns a label used to mark the operation to which to jump when a\n         * `break` statement targets this block.\n         *\n         * @param continueLabel A Label used to mark the operation to which to jump when a\n         *                      `continue` statement targets this block.\n         */\n        function beginLoopBlock(continueLabel) {\n            var breakLabel = defineLabel();\n            beginBlock({\n                kind: 3 /* Loop */,\n                isScript: false,\n                breakLabel: breakLabel,\n                continueLabel: continueLabel,\n            });\n            return breakLabel;\n        }\n        /**\n         * Ends a code block that supports `break` or `continue` statements that are defined in\n         * generated code or in the source tree.\n         */\n        function endLoopBlock() {\n            ts.Debug.assert(peekBlockKind() === 3 /* Loop */);\n            var block = endBlock();\n            var breakLabel = block.breakLabel;\n            if (!block.isScript) {\n                markLabel(breakLabel);\n            }\n        }\n        /**\n         * Begins a code block that supports `break` statements that are defined in the source\n         * tree and not from generated code.\n         *\n         */\n        function beginScriptSwitchBlock() {\n            beginBlock({\n                kind: 2 /* Switch */,\n                isScript: true,\n                breakLabel: -1\n            });\n        }\n        /**\n         * Begins a code block that supports `break` statements that are defined in generated code.\n         * Returns a label used to mark the operation to which to jump when a `break` statement\n         * targets this block.\n         */\n        function beginSwitchBlock() {\n            var breakLabel = defineLabel();\n            beginBlock({\n                kind: 2 /* Switch */,\n                isScript: false,\n                breakLabel: breakLabel,\n            });\n            return breakLabel;\n        }\n        /**\n         * Ends a code block that supports `break` statements that are defined in generated code.\n         */\n        function endSwitchBlock() {\n            ts.Debug.assert(peekBlockKind() === 2 /* Switch */);\n            var block = endBlock();\n            var breakLabel = block.breakLabel;\n            if (!block.isScript) {\n                markLabel(breakLabel);\n            }\n        }\n        function beginScriptLabeledBlock(labelText) {\n            beginBlock({\n                kind: 4 /* Labeled */,\n                isScript: true,\n                labelText: labelText,\n                breakLabel: -1\n            });\n        }\n        function beginLabeledBlock(labelText) {\n            var breakLabel = defineLabel();\n            beginBlock({\n                kind: 4 /* Labeled */,\n                isScript: false,\n                labelText: labelText,\n                breakLabel: breakLabel\n            });\n        }\n        function endLabeledBlock() {\n            ts.Debug.assert(peekBlockKind() === 4 /* Labeled */);\n            var block = endBlock();\n            if (!block.isScript) {\n                markLabel(block.breakLabel);\n            }\n        }\n        /**\n         * Indicates whether the provided block supports `break` statements.\n         *\n         * @param block A code block.\n         */\n        function supportsUnlabeledBreak(block) {\n            return block.kind === 2 /* Switch */\n                || block.kind === 3 /* Loop */;\n        }\n        /**\n         * Indicates whether the provided block supports `break` statements with labels.\n         *\n         * @param block A code block.\n         */\n        function supportsLabeledBreakOrContinue(block) {\n            return block.kind === 4 /* Labeled */;\n        }\n        /**\n         * Indicates whether the provided block supports `continue` statements.\n         *\n         * @param block A code block.\n         */\n        function supportsUnlabeledContinue(block) {\n            return block.kind === 3 /* Loop */;\n        }\n        function hasImmediateContainingLabeledBlock(labelText, start) {\n            for (var j = start; j >= 0; j--) {\n                var containingBlock = blockStack[j];\n                if (supportsLabeledBreakOrContinue(containingBlock)) {\n                    if (containingBlock.labelText === labelText) {\n                        return true;\n                    }\n                }\n                else {\n                    break;\n                }\n            }\n            return false;\n        }\n        /**\n         * Finds the label that is the target for a `break` statement.\n         *\n         * @param labelText An optional name of a containing labeled statement.\n         */\n        function findBreakTarget(labelText) {\n            if (blockStack) {\n                if (labelText) {\n                    for (var i = blockStack.length - 1; i >= 0; i--) {\n                        var block = blockStack[i];\n                        if (supportsLabeledBreakOrContinue(block) && block.labelText === labelText) {\n                            return block.breakLabel;\n                        }\n                        else if (supportsUnlabeledBreak(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) {\n                            return block.breakLabel;\n                        }\n                    }\n                }\n                else {\n                    for (var i = blockStack.length - 1; i >= 0; i--) {\n                        var block = blockStack[i];\n                        if (supportsUnlabeledBreak(block)) {\n                            return block.breakLabel;\n                        }\n                    }\n                }\n            }\n            return 0;\n        }\n        /**\n         * Finds the label that is the target for a `continue` statement.\n         *\n         * @param labelText An optional name of a containing labeled statement.\n         */\n        function findContinueTarget(labelText) {\n            if (blockStack) {\n                if (labelText) {\n                    for (var i = blockStack.length - 1; i >= 0; i--) {\n                        var block = blockStack[i];\n                        if (supportsUnlabeledContinue(block) && hasImmediateContainingLabeledBlock(labelText, i - 1)) {\n                            return block.continueLabel;\n                        }\n                    }\n                }\n                else {\n                    for (var i = blockStack.length - 1; i >= 0; i--) {\n                        var block = blockStack[i];\n                        if (supportsUnlabeledContinue(block)) {\n                            return block.continueLabel;\n                        }\n                    }\n                }\n            }\n            return 0;\n        }\n        /**\n         * Creates an expression that can be used to indicate the value for a label.\n         *\n         * @param label A label.\n         */\n        function createLabel(label) {\n            if (label !== undefined && label > 0) {\n                if (labelExpressions === undefined) {\n                    labelExpressions = [];\n                }\n                var expression = factory.createNumericLiteral(-1);\n                if (labelExpressions[label] === undefined) {\n                    labelExpressions[label] = [expression];\n                }\n                else {\n                    labelExpressions[label].push(expression);\n                }\n                return expression;\n            }\n            return factory.createOmittedExpression();\n        }\n        /**\n         * Creates a numeric literal for the provided instruction.\n         */\n        function createInstruction(instruction) {\n            var literal = factory.createNumericLiteral(instruction);\n            ts.addSyntheticTrailingComment(literal, 3 /* MultiLineCommentTrivia */, getInstructionName(instruction));\n            return literal;\n        }\n        /**\n         * Creates a statement that can be used indicate a Break operation to the provided label.\n         *\n         * @param label A label.\n         * @param location An optional source map location for the statement.\n         */\n        function createInlineBreak(label, location) {\n            ts.Debug.assertLessThan(0, label, \"Invalid label\");\n            return ts.setTextRange(factory.createReturnStatement(factory.createArrayLiteralExpression([\n                createInstruction(3 /* Break */),\n                createLabel(label)\n            ])), location);\n        }\n        /**\n         * Creates a statement that can be used indicate a Return operation.\n         *\n         * @param expression The expression for the return statement.\n         * @param location An optional source map location for the statement.\n         */\n        function createInlineReturn(expression, location) {\n            return ts.setTextRange(factory.createReturnStatement(factory.createArrayLiteralExpression(expression\n                ? [createInstruction(2 /* Return */), expression]\n                : [createInstruction(2 /* Return */)])), location);\n        }\n        /**\n         * Creates an expression that can be used to resume from a Yield operation.\n         */\n        function createGeneratorResume(location) {\n            return ts.setTextRange(factory.createCallExpression(factory.createPropertyAccessExpression(state, \"sent\"), \n            /*typeArguments*/ undefined, []), location);\n        }\n        /**\n         * Emits an empty instruction.\n         */\n        function emitNop() {\n            emitWorker(0 /* Nop */);\n        }\n        /**\n         * Emits a Statement.\n         *\n         * @param node A statement.\n         */\n        function emitStatement(node) {\n            if (node) {\n                emitWorker(1 /* Statement */, [node]);\n            }\n            else {\n                emitNop();\n            }\n        }\n        /**\n         * Emits an Assignment operation.\n         *\n         * @param left The left-hand side of the assignment.\n         * @param right The right-hand side of the assignment.\n         * @param location An optional source map location for the assignment.\n         */\n        function emitAssignment(left, right, location) {\n            emitWorker(2 /* Assign */, [left, right], location);\n        }\n        /**\n         * Emits a Break operation to the specified label.\n         *\n         * @param label A label.\n         * @param location An optional source map location for the assignment.\n         */\n        function emitBreak(label, location) {\n            emitWorker(3 /* Break */, [label], location);\n        }\n        /**\n         * Emits a Break operation to the specified label when a condition evaluates to a truthy\n         * value at runtime.\n         *\n         * @param label A label.\n         * @param condition The condition.\n         * @param location An optional source map location for the assignment.\n         */\n        function emitBreakWhenTrue(label, condition, location) {\n            emitWorker(4 /* BreakWhenTrue */, [label, condition], location);\n        }\n        /**\n         * Emits a Break to the specified label when a condition evaluates to a falsey value at\n         * runtime.\n         *\n         * @param label A label.\n         * @param condition The condition.\n         * @param location An optional source map location for the assignment.\n         */\n        function emitBreakWhenFalse(label, condition, location) {\n            emitWorker(5 /* BreakWhenFalse */, [label, condition], location);\n        }\n        /**\n         * Emits a YieldStar operation for the provided expression.\n         *\n         * @param expression An optional value for the yield operation.\n         * @param location An optional source map location for the assignment.\n         */\n        function emitYieldStar(expression, location) {\n            emitWorker(7 /* YieldStar */, [expression], location);\n        }\n        /**\n         * Emits a Yield operation for the provided expression.\n         *\n         * @param expression An optional value for the yield operation.\n         * @param location An optional source map location for the assignment.\n         */\n        function emitYield(expression, location) {\n            emitWorker(6 /* Yield */, [expression], location);\n        }\n        /**\n         * Emits a Return operation for the provided expression.\n         *\n         * @param expression An optional value for the operation.\n         * @param location An optional source map location for the assignment.\n         */\n        function emitReturn(expression, location) {\n            emitWorker(8 /* Return */, [expression], location);\n        }\n        /**\n         * Emits a Throw operation for the provided expression.\n         *\n         * @param expression A value for the operation.\n         * @param location An optional source map location for the assignment.\n         */\n        function emitThrow(expression, location) {\n            emitWorker(9 /* Throw */, [expression], location);\n        }\n        /**\n         * Emits an Endfinally operation. This is used to handle `finally` block semantics.\n         */\n        function emitEndfinally() {\n            emitWorker(10 /* Endfinally */);\n        }\n        /**\n         * Emits an operation.\n         *\n         * @param code The OpCode for the operation.\n         * @param args The optional arguments for the operation.\n         */\n        function emitWorker(code, args, location) {\n            if (operations === undefined) {\n                operations = [];\n                operationArguments = [];\n                operationLocations = [];\n            }\n            if (labelOffsets === undefined) {\n                // mark entry point\n                markLabel(defineLabel());\n            }\n            var operationIndex = operations.length;\n            operations[operationIndex] = code;\n            operationArguments[operationIndex] = args;\n            operationLocations[operationIndex] = location;\n        }\n        /**\n         * Builds the generator function body.\n         */\n        function build() {\n            blockIndex = 0;\n            labelNumber = 0;\n            labelNumbers = undefined;\n            lastOperationWasAbrupt = false;\n            lastOperationWasCompletion = false;\n            clauses = undefined;\n            statements = undefined;\n            exceptionBlockStack = undefined;\n            currentExceptionBlock = undefined;\n            withBlockStack = undefined;\n            var buildResult = buildStatements();\n            return emitHelpers().createGeneratorHelper(ts.setEmitFlags(factory.createFunctionExpression(\n            /*modifiers*/ undefined, \n            /*asteriskToken*/ undefined, \n            /*name*/ undefined, \n            /*typeParameters*/ undefined, [factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, state)], \n            /*type*/ undefined, factory.createBlock(buildResult, \n            /*multiLine*/ buildResult.length > 0)), 524288 /* ReuseTempVariableScope */));\n        }\n        /**\n         * Builds the statements for the generator function body.\n         */\n        function buildStatements() {\n            if (operations) {\n                for (var operationIndex = 0; operationIndex < operations.length; operationIndex++) {\n                    writeOperation(operationIndex);\n                }\n                flushFinalLabel(operations.length);\n            }\n            else {\n                flushFinalLabel(0);\n            }\n            if (clauses) {\n                var labelExpression = factory.createPropertyAccessExpression(state, \"label\");\n                var switchStatement = factory.createSwitchStatement(labelExpression, factory.createCaseBlock(clauses));\n                return [ts.startOnNewLine(switchStatement)];\n            }\n            if (statements) {\n                return statements;\n            }\n            return [];\n        }\n        /**\n         * Flush the current label and advance to a new label.\n         */\n        function flushLabel() {\n            if (!statements) {\n                return;\n            }\n            appendLabel(/*markLabelEnd*/ !lastOperationWasAbrupt);\n            lastOperationWasAbrupt = false;\n            lastOperationWasCompletion = false;\n            labelNumber++;\n        }\n        /**\n         * Flush the final label of the generator function body.\n         */\n        function flushFinalLabel(operationIndex) {\n            if (isFinalLabelReachable(operationIndex)) {\n                tryEnterLabel(operationIndex);\n                withBlockStack = undefined;\n                writeReturn(/*expression*/ undefined, /*operationLocation*/ undefined);\n            }\n            if (statements && clauses) {\n                appendLabel(/*markLabelEnd*/ false);\n            }\n            updateLabelExpressions();\n        }\n        /**\n         * Tests whether the final label of the generator function body\n         * is reachable by user code.\n         */\n        function isFinalLabelReachable(operationIndex) {\n            // if the last operation was *not* a completion (return/throw) then\n            // the final label is reachable.\n            if (!lastOperationWasCompletion) {\n                return true;\n            }\n            // if there are no labels defined or referenced, then the final label is\n            // not reachable.\n            if (!labelOffsets || !labelExpressions) {\n                return false;\n            }\n            // if the label for this offset is referenced, then the final label\n            // is reachable.\n            for (var label = 0; label < labelOffsets.length; label++) {\n                if (labelOffsets[label] === operationIndex && labelExpressions[label]) {\n                    return true;\n                }\n            }\n            return false;\n        }\n        /**\n         * Appends a case clause for the last label and sets the new label.\n         *\n         * @param markLabelEnd Indicates that the transition between labels was a fall-through\n         *                     from a previous case clause and the change in labels should be\n         *                     reflected on the `state` object.\n         */\n        function appendLabel(markLabelEnd) {\n            if (!clauses) {\n                clauses = [];\n            }\n            if (statements) {\n                if (withBlockStack) {\n                    // The previous label was nested inside one or more `with` blocks, so we\n                    // surround the statements in generated `with` blocks to create the same environment.\n                    for (var i = withBlockStack.length - 1; i >= 0; i--) {\n                        var withBlock = withBlockStack[i];\n                        statements = [factory.createWithStatement(withBlock.expression, factory.createBlock(statements))];\n                    }\n                }\n                if (currentExceptionBlock) {\n                    // The previous label was nested inside of an exception block, so we must\n                    // indicate entry into a protected region by pushing the label numbers\n                    // for each block in the protected region.\n                    var startLabel = currentExceptionBlock.startLabel, catchLabel = currentExceptionBlock.catchLabel, finallyLabel = currentExceptionBlock.finallyLabel, endLabel = currentExceptionBlock.endLabel;\n                    statements.unshift(factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createPropertyAccessExpression(state, \"trys\"), \"push\"), \n                    /*typeArguments*/ undefined, [\n                        factory.createArrayLiteralExpression([\n                            createLabel(startLabel),\n                            createLabel(catchLabel),\n                            createLabel(finallyLabel),\n                            createLabel(endLabel)\n                        ])\n                    ])));\n                    currentExceptionBlock = undefined;\n                }\n                if (markLabelEnd) {\n                    // The case clause for the last label falls through to this label, so we\n                    // add an assignment statement to reflect the change in labels.\n                    statements.push(factory.createExpressionStatement(factory.createAssignment(factory.createPropertyAccessExpression(state, \"label\"), factory.createNumericLiteral(labelNumber + 1))));\n                }\n            }\n            clauses.push(factory.createCaseClause(factory.createNumericLiteral(labelNumber), statements || []));\n            statements = undefined;\n        }\n        /**\n         * Tries to enter into a new label at the current operation index.\n         */\n        function tryEnterLabel(operationIndex) {\n            if (!labelOffsets) {\n                return;\n            }\n            for (var label = 0; label < labelOffsets.length; label++) {\n                if (labelOffsets[label] === operationIndex) {\n                    flushLabel();\n                    if (labelNumbers === undefined) {\n                        labelNumbers = [];\n                    }\n                    if (labelNumbers[labelNumber] === undefined) {\n                        labelNumbers[labelNumber] = [label];\n                    }\n                    else {\n                        labelNumbers[labelNumber].push(label);\n                    }\n                }\n            }\n        }\n        /**\n         * Updates literal expressions for labels with actual label numbers.\n         */\n        function updateLabelExpressions() {\n            if (labelExpressions !== undefined && labelNumbers !== undefined) {\n                for (var labelNumber_1 = 0; labelNumber_1 < labelNumbers.length; labelNumber_1++) {\n                    var labels = labelNumbers[labelNumber_1];\n                    if (labels !== undefined) {\n                        for (var _i = 0, labels_1 = labels; _i < labels_1.length; _i++) {\n                            var label = labels_1[_i];\n                            var expressions = labelExpressions[label];\n                            if (expressions !== undefined) {\n                                for (var _a = 0, expressions_1 = expressions; _a < expressions_1.length; _a++) {\n                                    var expression = expressions_1[_a];\n                                    expression.text = String(labelNumber_1);\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        /**\n         * Tries to enter or leave a code block.\n         */\n        function tryEnterOrLeaveBlock(operationIndex) {\n            if (blocks) {\n                for (; blockIndex < blockActions.length && blockOffsets[blockIndex] <= operationIndex; blockIndex++) {\n                    var block = blocks[blockIndex];\n                    var blockAction = blockActions[blockIndex];\n                    switch (block.kind) {\n                        case 0 /* Exception */:\n                            if (blockAction === 0 /* Open */) {\n                                if (!exceptionBlockStack) {\n                                    exceptionBlockStack = [];\n                                }\n                                if (!statements) {\n                                    statements = [];\n                                }\n                                exceptionBlockStack.push(currentExceptionBlock);\n                                currentExceptionBlock = block;\n                            }\n                            else if (blockAction === 1 /* Close */) {\n                                currentExceptionBlock = exceptionBlockStack.pop();\n                            }\n                            break;\n                        case 1 /* With */:\n                            if (blockAction === 0 /* Open */) {\n                                if (!withBlockStack) {\n                                    withBlockStack = [];\n                                }\n                                withBlockStack.push(block);\n                            }\n                            else if (blockAction === 1 /* Close */) {\n                                withBlockStack.pop();\n                            }\n                            break;\n                        // default: do nothing\n                    }\n                }\n            }\n        }\n        /**\n         * Writes an operation as a statement to the current label's statement list.\n         *\n         * @param operation The OpCode of the operation\n         */\n        function writeOperation(operationIndex) {\n            tryEnterLabel(operationIndex);\n            tryEnterOrLeaveBlock(operationIndex);\n            // early termination, nothing else to process in this label\n            if (lastOperationWasAbrupt) {\n                return;\n            }\n            lastOperationWasAbrupt = false;\n            lastOperationWasCompletion = false;\n            var opcode = operations[operationIndex];\n            if (opcode === 0 /* Nop */) {\n                return;\n            }\n            else if (opcode === 10 /* Endfinally */) {\n                return writeEndfinally();\n            }\n            var args = operationArguments[operationIndex];\n            if (opcode === 1 /* Statement */) {\n                return writeStatement(args[0]);\n            }\n            var location = operationLocations[operationIndex];\n            switch (opcode) {\n                case 2 /* Assign */:\n                    return writeAssign(args[0], args[1], location);\n                case 3 /* Break */:\n                    return writeBreak(args[0], location);\n                case 4 /* BreakWhenTrue */:\n                    return writeBreakWhenTrue(args[0], args[1], location);\n                case 5 /* BreakWhenFalse */:\n                    return writeBreakWhenFalse(args[0], args[1], location);\n                case 6 /* Yield */:\n                    return writeYield(args[0], location);\n                case 7 /* YieldStar */:\n                    return writeYieldStar(args[0], location);\n                case 8 /* Return */:\n                    return writeReturn(args[0], location);\n                case 9 /* Throw */:\n                    return writeThrow(args[0], location);\n            }\n        }\n        /**\n         * Writes a statement to the current label's statement list.\n         *\n         * @param statement A statement to write.\n         */\n        function writeStatement(statement) {\n            if (statement) {\n                if (!statements) {\n                    statements = [statement];\n                }\n                else {\n                    statements.push(statement);\n                }\n            }\n        }\n        /**\n         * Writes an Assign operation to the current label's statement list.\n         *\n         * @param left The left-hand side of the assignment.\n         * @param right The right-hand side of the assignment.\n         * @param operationLocation The source map location for the operation.\n         */\n        function writeAssign(left, right, operationLocation) {\n            writeStatement(ts.setTextRange(factory.createExpressionStatement(factory.createAssignment(left, right)), operationLocation));\n        }\n        /**\n         * Writes a Throw operation to the current label's statement list.\n         *\n         * @param expression The value to throw.\n         * @param operationLocation The source map location for the operation.\n         */\n        function writeThrow(expression, operationLocation) {\n            lastOperationWasAbrupt = true;\n            lastOperationWasCompletion = true;\n            writeStatement(ts.setTextRange(factory.createThrowStatement(expression), operationLocation));\n        }\n        /**\n         * Writes a Return operation to the current label's statement list.\n         *\n         * @param expression The value to return.\n         * @param operationLocation The source map location for the operation.\n         */\n        function writeReturn(expression, operationLocation) {\n            lastOperationWasAbrupt = true;\n            lastOperationWasCompletion = true;\n            writeStatement(ts.setEmitFlags(ts.setTextRange(factory.createReturnStatement(factory.createArrayLiteralExpression(expression\n                ? [createInstruction(2 /* Return */), expression]\n                : [createInstruction(2 /* Return */)])), operationLocation), 384 /* NoTokenSourceMaps */));\n        }\n        /**\n         * Writes a Break operation to the current label's statement list.\n         *\n         * @param label The label for the Break.\n         * @param operationLocation The source map location for the operation.\n         */\n        function writeBreak(label, operationLocation) {\n            lastOperationWasAbrupt = true;\n            writeStatement(ts.setEmitFlags(ts.setTextRange(factory.createReturnStatement(factory.createArrayLiteralExpression([\n                createInstruction(3 /* Break */),\n                createLabel(label)\n            ])), operationLocation), 384 /* NoTokenSourceMaps */));\n        }\n        /**\n         * Writes a BreakWhenTrue operation to the current label's statement list.\n         *\n         * @param label The label for the Break.\n         * @param condition The condition for the Break.\n         * @param operationLocation The source map location for the operation.\n         */\n        function writeBreakWhenTrue(label, condition, operationLocation) {\n            writeStatement(ts.setEmitFlags(factory.createIfStatement(condition, ts.setEmitFlags(ts.setTextRange(factory.createReturnStatement(factory.createArrayLiteralExpression([\n                createInstruction(3 /* Break */),\n                createLabel(label)\n            ])), operationLocation), 384 /* NoTokenSourceMaps */)), 1 /* SingleLine */));\n        }\n        /**\n         * Writes a BreakWhenFalse operation to the current label's statement list.\n         *\n         * @param label The label for the Break.\n         * @param condition The condition for the Break.\n         * @param operationLocation The source map location for the operation.\n         */\n        function writeBreakWhenFalse(label, condition, operationLocation) {\n            writeStatement(ts.setEmitFlags(factory.createIfStatement(factory.createLogicalNot(condition), ts.setEmitFlags(ts.setTextRange(factory.createReturnStatement(factory.createArrayLiteralExpression([\n                createInstruction(3 /* Break */),\n                createLabel(label)\n            ])), operationLocation), 384 /* NoTokenSourceMaps */)), 1 /* SingleLine */));\n        }\n        /**\n         * Writes a Yield operation to the current label's statement list.\n         *\n         * @param expression The expression to yield.\n         * @param operationLocation The source map location for the operation.\n         */\n        function writeYield(expression, operationLocation) {\n            lastOperationWasAbrupt = true;\n            writeStatement(ts.setEmitFlags(ts.setTextRange(factory.createReturnStatement(factory.createArrayLiteralExpression(expression\n                ? [createInstruction(4 /* Yield */), expression]\n                : [createInstruction(4 /* Yield */)])), operationLocation), 384 /* NoTokenSourceMaps */));\n        }\n        /**\n         * Writes a YieldStar instruction to the current label's statement list.\n         *\n         * @param expression The expression to yield.\n         * @param operationLocation The source map location for the operation.\n         */\n        function writeYieldStar(expression, operationLocation) {\n            lastOperationWasAbrupt = true;\n            writeStatement(ts.setEmitFlags(ts.setTextRange(factory.createReturnStatement(factory.createArrayLiteralExpression([\n                createInstruction(5 /* YieldStar */),\n                expression\n            ])), operationLocation), 384 /* NoTokenSourceMaps */));\n        }\n        /**\n         * Writes an Endfinally instruction to the current label's statement list.\n         */\n        function writeEndfinally() {\n            lastOperationWasAbrupt = true;\n            writeStatement(factory.createReturnStatement(factory.createArrayLiteralExpression([\n                createInstruction(7 /* Endfinally */)\n            ])));\n        }\n    }\n    ts.transformGenerators = transformGenerators;\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    function transformModule(context) {\n        function getTransformModuleDelegate(moduleKind) {\n            switch (moduleKind) {\n                case ts.ModuleKind.AMD: return transformAMDModule;\n                case ts.ModuleKind.UMD: return transformUMDModule;\n                default: return transformCommonJSModule;\n            }\n        }\n        var factory = context.factory, emitHelpers = context.getEmitHelperFactory, startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration;\n        var compilerOptions = context.getCompilerOptions();\n        var resolver = context.getEmitResolver();\n        var host = context.getEmitHost();\n        var languageVersion = ts.getEmitScriptTarget(compilerOptions);\n        var moduleKind = ts.getEmitModuleKind(compilerOptions);\n        var previousOnSubstituteNode = context.onSubstituteNode;\n        var previousOnEmitNode = context.onEmitNode;\n        context.onSubstituteNode = onSubstituteNode;\n        context.onEmitNode = onEmitNode;\n        context.enableSubstitution(78 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols.\n        context.enableSubstitution(216 /* BinaryExpression */); // Substitutes assignments to exported symbols.\n        context.enableSubstitution(214 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols.\n        context.enableSubstitution(215 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols.\n        context.enableSubstitution(289 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols.\n        context.enableEmitNotification(297 /* SourceFile */); // Restore state when substituting nodes in a file.\n        var moduleInfoMap = []; // The ExternalModuleInfo for each file.\n        var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found.\n        var currentSourceFile; // The current file.\n        var currentModuleInfo; // The ExternalModuleInfo for the current file.\n        var noSubstitution; // Set of nodes for which substitution rules should be ignored.\n        var needUMDDynamicImportHelper;\n        return ts.chainBundle(context, transformSourceFile);\n        /**\n         * Transforms the module aspects of a SourceFile.\n         *\n         * @param node The SourceFile node.\n         */\n        function transformSourceFile(node) {\n            if (node.isDeclarationFile ||\n                !(ts.isEffectiveExternalModule(node, compilerOptions) ||\n                    node.transformFlags & 2097152 /* ContainsDynamicImport */ ||\n                    (ts.isJsonSourceFile(node) && ts.hasJsonModuleEmitEnabled(compilerOptions) && ts.outFile(compilerOptions)))) {\n                return node;\n            }\n            currentSourceFile = node;\n            currentModuleInfo = ts.collectExternalModuleInfo(context, node, resolver, compilerOptions);\n            moduleInfoMap[ts.getOriginalNodeId(node)] = currentModuleInfo;\n            // Perform the transformation.\n            var transformModule = getTransformModuleDelegate(moduleKind);\n            var updated = transformModule(node);\n            currentSourceFile = undefined;\n            currentModuleInfo = undefined;\n            needUMDDynamicImportHelper = false;\n            return updated;\n        }\n        function shouldEmitUnderscoreUnderscoreESModule() {\n            if (!currentModuleInfo.exportEquals && ts.isExternalModule(currentSourceFile)) {\n                return true;\n            }\n            return false;\n        }\n        /**\n         * Transforms a SourceFile into a CommonJS module.\n         *\n         * @param node The SourceFile node.\n         */\n        function transformCommonJSModule(node) {\n            startLexicalEnvironment();\n            var statements = [];\n            var ensureUseStrict = ts.getStrictOptionValue(compilerOptions, \"alwaysStrict\") || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile));\n            var statementOffset = factory.copyPrologue(node.statements, statements, ensureUseStrict && !ts.isJsonSourceFile(node), sourceElementVisitor);\n            if (shouldEmitUnderscoreUnderscoreESModule()) {\n                ts.append(statements, createUnderscoreUnderscoreESModule());\n            }\n            if (ts.length(currentModuleInfo.exportedNames)) {\n                var chunkSize = 50;\n                for (var i = 0; i < currentModuleInfo.exportedNames.length; i += chunkSize) {\n                    ts.append(statements, factory.createExpressionStatement(ts.reduceLeft(currentModuleInfo.exportedNames.slice(i, i + chunkSize), function (prev, nextId) { return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier(\"exports\"), factory.createIdentifier(ts.idText(nextId))), prev); }, factory.createVoidZero())));\n                }\n            }\n            ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement));\n            ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset));\n            addExportEqualsIfNeeded(statements, /*emitAsReturn*/ false);\n            ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());\n            var updated = factory.updateSourceFile(node, ts.setTextRange(factory.createNodeArray(statements), node.statements));\n            ts.addEmitHelpers(updated, context.readEmitHelpers());\n            return updated;\n        }\n        /**\n         * Transforms a SourceFile into an AMD module.\n         *\n         * @param node The SourceFile node.\n         */\n        function transformAMDModule(node) {\n            var define = factory.createIdentifier(\"define\");\n            var moduleName = ts.tryGetModuleNameFromFile(factory, node, host, compilerOptions);\n            var jsonSourceFile = ts.isJsonSourceFile(node) && node;\n            // An AMD define function has the following shape:\n            //\n            //     define(id?, dependencies?, factory);\n            //\n            // This has the shape of the following:\n            //\n            //     define(name, [\"module1\", \"module2\"], function (module1Alias) { ... }\n            //\n            // The location of the alias in the parameter list in the factory function needs to\n            // match the position of the module name in the dependency list.\n            //\n            // To ensure this is true in cases of modules with no aliases, e.g.:\n            //\n            //     import \"module\"\n            //\n            // or\n            //\n            //     /// <amd-dependency path= \"a.css\" />\n            //\n            // we need to add modules without alias names to the end of the dependencies list\n            var _a = collectAsynchronousDependencies(node, /*includeNonAmdDependencies*/ true), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames;\n            // Create an updated SourceFile:\n            //\n            //     define(mofactory.updateSourceFile\", \"module2\"], function ...\n            var updated = factory.updateSourceFile(node, ts.setTextRange(factory.createNodeArray([\n                factory.createExpressionStatement(factory.createCallExpression(define, \n                /*typeArguments*/ undefined, __spreadArray(__spreadArray([], (moduleName ? [moduleName] : [])), [\n                    // Add the dependency array argument:\n                    //\n                    //     [\"require\", \"exports\", module1\", \"module2\", ...]\n                    factory.createArrayLiteralExpression(jsonSourceFile ? ts.emptyArray : __spreadArray(__spreadArray([\n                        factory.createStringLiteral(\"require\"),\n                        factory.createStringLiteral(\"exports\")\n                    ], aliasedModuleNames), unaliasedModuleNames)),\n                    // Add the module body function argument:\n                    //\n                    //     function (require, exports, module1, module2) ...\n                    jsonSourceFile ?\n                        jsonSourceFile.statements.length ? jsonSourceFile.statements[0].expression : factory.createObjectLiteralExpression() :\n                        factory.createFunctionExpression(\n                        /*modifiers*/ undefined, \n                        /*asteriskToken*/ undefined, \n                        /*name*/ undefined, \n                        /*typeParameters*/ undefined, __spreadArray([\n                            factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, \"require\"),\n                            factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, \"exports\")\n                        ], importAliasNames), \n                        /*type*/ undefined, transformAsynchronousModuleBody(node))\n                ])))\n            ]), \n            /*location*/ node.statements));\n            ts.addEmitHelpers(updated, context.readEmitHelpers());\n            return updated;\n        }\n        /**\n         * Transforms a SourceFile into a UMD module.\n         *\n         * @param node The SourceFile node.\n         */\n        function transformUMDModule(node) {\n            var _a = collectAsynchronousDependencies(node, /*includeNonAmdDependencies*/ false), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames;\n            var moduleName = ts.tryGetModuleNameFromFile(factory, node, host, compilerOptions);\n            var umdHeader = factory.createFunctionExpression(\n            /*modifiers*/ undefined, \n            /*asteriskToken*/ undefined, \n            /*name*/ undefined, \n            /*typeParameters*/ undefined, [factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, \"factory\")], \n            /*type*/ undefined, ts.setTextRange(factory.createBlock([\n                factory.createIfStatement(factory.createLogicalAnd(factory.createTypeCheck(factory.createIdentifier(\"module\"), \"object\"), factory.createTypeCheck(factory.createPropertyAccessExpression(factory.createIdentifier(\"module\"), \"exports\"), \"object\")), factory.createBlock([\n                    factory.createVariableStatement(\n                    /*modifiers*/ undefined, [\n                        factory.createVariableDeclaration(\"v\", \n                        /*exclamationToken*/ undefined, \n                        /*type*/ undefined, factory.createCallExpression(factory.createIdentifier(\"factory\"), \n                        /*typeArguments*/ undefined, [\n                            factory.createIdentifier(\"require\"),\n                            factory.createIdentifier(\"exports\")\n                        ]))\n                    ]),\n                    ts.setEmitFlags(factory.createIfStatement(factory.createStrictInequality(factory.createIdentifier(\"v\"), factory.createIdentifier(\"undefined\")), factory.createExpressionStatement(factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier(\"module\"), \"exports\"), factory.createIdentifier(\"v\")))), 1 /* SingleLine */)\n                ]), factory.createIfStatement(factory.createLogicalAnd(factory.createTypeCheck(factory.createIdentifier(\"define\"), \"function\"), factory.createPropertyAccessExpression(factory.createIdentifier(\"define\"), \"amd\")), factory.createBlock([\n                    factory.createExpressionStatement(factory.createCallExpression(factory.createIdentifier(\"define\"), \n                    /*typeArguments*/ undefined, __spreadArray(__spreadArray([], (moduleName ? [moduleName] : [])), [\n                        factory.createArrayLiteralExpression(__spreadArray(__spreadArray([\n                            factory.createStringLiteral(\"require\"),\n                            factory.createStringLiteral(\"exports\")\n                        ], aliasedModuleNames), unaliasedModuleNames)),\n                        factory.createIdentifier(\"factory\")\n                    ])))\n                ])))\n            ], \n            /*multiLine*/ true), \n            /*location*/ undefined));\n            // Create an updated SourceFile:\n            //\n            //  (function (factory) {\n            //      if (typeof module === \"object\" && typeof module.exports === \"object\") {\n            //          var v = factory(require, exports);\n            //          if (v !== undefined) module.exports = v;\n            //      }\n            //      else if (typeof define === 'function' && define.amd) {\n            //          define([\"require\", \"exports\"], factory);\n            //      }\n            //  })(function ...)\n            var updated = factory.updateSourceFile(node, ts.setTextRange(factory.createNodeArray([\n                factory.createExpressionStatement(factory.createCallExpression(umdHeader, \n                /*typeArguments*/ undefined, [\n                    // Add the module body function argument:\n                    //\n                    //     function (require, exports) ...\n                    factory.createFunctionExpression(\n                    /*modifiers*/ undefined, \n                    /*asteriskToken*/ undefined, \n                    /*name*/ undefined, \n                    /*typeParameters*/ undefined, __spreadArray([\n                        factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, \"require\"),\n                        factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, \"exports\")\n                    ], importAliasNames), \n                    /*type*/ undefined, transformAsynchronousModuleBody(node))\n                ]))\n            ]), \n            /*location*/ node.statements));\n            ts.addEmitHelpers(updated, context.readEmitHelpers());\n            return updated;\n        }\n        /**\n         * Collect the additional asynchronous dependencies for the module.\n         *\n         * @param node The source file.\n         * @param includeNonAmdDependencies A value indicating whether to include non-AMD dependencies.\n         */\n        function collectAsynchronousDependencies(node, includeNonAmdDependencies) {\n            // names of modules with corresponding parameter in the factory function\n            var aliasedModuleNames = [];\n            // names of modules with no corresponding parameters in factory function\n            var unaliasedModuleNames = [];\n            // names of the parameters in the factory function; these\n            // parameters need to match the indexes of the corresponding\n            // module names in aliasedModuleNames.\n            var importAliasNames = [];\n            // Fill in amd-dependency tags\n            for (var _i = 0, _a = node.amdDependencies; _i < _a.length; _i++) {\n                var amdDependency = _a[_i];\n                if (amdDependency.name) {\n                    aliasedModuleNames.push(factory.createStringLiteral(amdDependency.path));\n                    importAliasNames.push(factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, amdDependency.name));\n                }\n                else {\n                    unaliasedModuleNames.push(factory.createStringLiteral(amdDependency.path));\n                }\n            }\n            for (var _b = 0, _c = currentModuleInfo.externalImports; _b < _c.length; _b++) {\n                var importNode = _c[_b];\n                // Find the name of the external module\n                var externalModuleName = ts.getExternalModuleNameLiteral(factory, importNode, currentSourceFile, host, resolver, compilerOptions);\n                // Find the name of the module alias, if there is one\n                var importAliasName = ts.getLocalNameForExternalImport(factory, importNode, currentSourceFile);\n                // It is possible that externalModuleName is undefined if it is not string literal.\n                // This can happen in the invalid import syntax.\n                // E.g : \"import * from alias from 'someLib';\"\n                if (externalModuleName) {\n                    if (includeNonAmdDependencies && importAliasName) {\n                        // Set emitFlags on the name of the classDeclaration\n                        // This is so that when printer will not substitute the identifier\n                        ts.setEmitFlags(importAliasName, 4 /* NoSubstitution */);\n                        aliasedModuleNames.push(externalModuleName);\n                        importAliasNames.push(factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, importAliasName));\n                    }\n                    else {\n                        unaliasedModuleNames.push(externalModuleName);\n                    }\n                }\n            }\n            return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames };\n        }\n        function getAMDImportExpressionForImport(node) {\n            if (ts.isImportEqualsDeclaration(node) || ts.isExportDeclaration(node) || !ts.getExternalModuleNameLiteral(factory, node, currentSourceFile, host, resolver, compilerOptions)) {\n                return undefined;\n            }\n            var name = ts.getLocalNameForExternalImport(factory, node, currentSourceFile); // TODO: GH#18217\n            var expr = getHelperExpressionForImport(node, name);\n            if (expr === name) {\n                return undefined;\n            }\n            return factory.createExpressionStatement(factory.createAssignment(name, expr));\n        }\n        /**\n         * Transforms a SourceFile into an AMD or UMD module body.\n         *\n         * @param node The SourceFile node.\n         */\n        function transformAsynchronousModuleBody(node) {\n            startLexicalEnvironment();\n            var statements = [];\n            var statementOffset = factory.copyPrologue(node.statements, statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor);\n            if (shouldEmitUnderscoreUnderscoreESModule()) {\n                ts.append(statements, createUnderscoreUnderscoreESModule());\n            }\n            if (ts.length(currentModuleInfo.exportedNames)) {\n                ts.append(statements, factory.createExpressionStatement(ts.reduceLeft(currentModuleInfo.exportedNames, function (prev, nextId) { return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier(\"exports\"), factory.createIdentifier(ts.idText(nextId))), prev); }, factory.createVoidZero())));\n            }\n            // Visit each statement of the module body.\n            ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement));\n            if (moduleKind === ts.ModuleKind.AMD) {\n                ts.addRange(statements, ts.mapDefined(currentModuleInfo.externalImports, getAMDImportExpressionForImport));\n            }\n            ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset));\n            // Append the 'export =' statement if provided.\n            addExportEqualsIfNeeded(statements, /*emitAsReturn*/ true);\n            // End the lexical environment for the module body\n            // and merge any new lexical declarations.\n            ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());\n            var body = factory.createBlock(statements, /*multiLine*/ true);\n            if (needUMDDynamicImportHelper) {\n                ts.addEmitHelper(body, dynamicImportUMDHelper);\n            }\n            return body;\n        }\n        /**\n         * Adds the down-level representation of `export=` to the statement list if one exists\n         * in the source file.\n         *\n         * @param statements The Statement list to modify.\n         * @param emitAsReturn A value indicating whether to emit the `export=` statement as a\n         * return statement.\n         */\n        function addExportEqualsIfNeeded(statements, emitAsReturn) {\n            if (currentModuleInfo.exportEquals) {\n                var expressionResult = ts.visitNode(currentModuleInfo.exportEquals.expression, moduleExpressionElementVisitor);\n                if (expressionResult) {\n                    if (emitAsReturn) {\n                        var statement = factory.createReturnStatement(expressionResult);\n                        ts.setTextRange(statement, currentModuleInfo.exportEquals);\n                        ts.setEmitFlags(statement, 384 /* NoTokenSourceMaps */ | 1536 /* NoComments */);\n                        statements.push(statement);\n                    }\n                    else {\n                        var statement = factory.createExpressionStatement(factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier(\"module\"), \"exports\"), expressionResult));\n                        ts.setTextRange(statement, currentModuleInfo.exportEquals);\n                        ts.setEmitFlags(statement, 1536 /* NoComments */);\n                        statements.push(statement);\n                    }\n                }\n            }\n        }\n        //\n        // Top-Level Source Element Visitors\n        //\n        /**\n         * Visits a node at the top level of the source file.\n         *\n         * @param node The node to visit.\n         */\n        function sourceElementVisitor(node) {\n            switch (node.kind) {\n                case 261 /* ImportDeclaration */:\n                    return visitImportDeclaration(node);\n                case 260 /* ImportEqualsDeclaration */:\n                    return visitImportEqualsDeclaration(node);\n                case 267 /* ExportDeclaration */:\n                    return visitExportDeclaration(node);\n                case 266 /* ExportAssignment */:\n                    return visitExportAssignment(node);\n                case 232 /* VariableStatement */:\n                    return visitVariableStatement(node);\n                case 251 /* FunctionDeclaration */:\n                    return visitFunctionDeclaration(node);\n                case 252 /* ClassDeclaration */:\n                    return visitClassDeclaration(node);\n                case 338 /* MergeDeclarationMarker */:\n                    return visitMergeDeclarationMarker(node);\n                case 339 /* EndOfDeclarationMarker */:\n                    return visitEndOfDeclarationMarker(node);\n                default:\n                    return ts.visitEachChild(node, moduleExpressionElementVisitor, context);\n            }\n        }\n        function moduleExpressionElementVisitor(node) {\n            // This visitor does not need to descend into the tree if there is no dynamic import or destructuring assignment,\n            // as export/import statements are only transformed at the top level of a file.\n            if (!(node.transformFlags & 2097152 /* ContainsDynamicImport */) && !(node.transformFlags & 1024 /* ContainsDestructuringAssignment */)) {\n                return node;\n            }\n            if (ts.isImportCall(node)) {\n                return visitImportCallExpression(node);\n            }\n            else if (ts.isDestructuringAssignment(node)) {\n                return visitDestructuringAssignment(node);\n            }\n            else {\n                return ts.visitEachChild(node, moduleExpressionElementVisitor, context);\n            }\n        }\n        function destructuringNeedsFlattening(node) {\n            if (ts.isObjectLiteralExpression(node)) {\n                for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {\n                    var elem = _a[_i];\n                    switch (elem.kind) {\n                        case 288 /* PropertyAssignment */:\n                            if (destructuringNeedsFlattening(elem.initializer)) {\n                                return true;\n                            }\n                            break;\n                        case 289 /* ShorthandPropertyAssignment */:\n                            if (destructuringNeedsFlattening(elem.name)) {\n                                return true;\n                            }\n                            break;\n                        case 290 /* SpreadAssignment */:\n                            if (destructuringNeedsFlattening(elem.expression)) {\n                                return true;\n                            }\n                            break;\n                        case 165 /* MethodDeclaration */:\n                        case 167 /* GetAccessor */:\n                        case 168 /* SetAccessor */:\n                            return false;\n                        default: ts.Debug.assertNever(elem, \"Unhandled object member kind\");\n                    }\n                }\n            }\n            else if (ts.isArrayLiteralExpression(node)) {\n                for (var _b = 0, _c = node.elements; _b < _c.length; _b++) {\n                    var elem = _c[_b];\n                    if (ts.isSpreadElement(elem)) {\n                        if (destructuringNeedsFlattening(elem.expression)) {\n                            return true;\n                        }\n                    }\n                    else if (destructuringNeedsFlattening(elem)) {\n                        return true;\n                    }\n                }\n            }\n            else if (ts.isIdentifier(node)) {\n                return ts.length(getExports(node)) > (ts.isExportName(node) ? 1 : 0);\n            }\n            return false;\n        }\n        function visitDestructuringAssignment(node) {\n            if (destructuringNeedsFlattening(node.left)) {\n                return ts.flattenDestructuringAssignment(node, moduleExpressionElementVisitor, context, 0 /* All */, /*needsValue*/ false, createAllExportExpressions);\n            }\n            return ts.visitEachChild(node, moduleExpressionElementVisitor, context);\n        }\n        function visitImportCallExpression(node) {\n            var externalModuleName = ts.getExternalModuleNameLiteral(factory, node, currentSourceFile, host, resolver, compilerOptions);\n            var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), moduleExpressionElementVisitor);\n            // Only use the external module name if it differs from the first argument. This allows us to preserve the quote style of the argument on output.\n            var argument = externalModuleName && (!firstArgument || !ts.isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument;\n            var containsLexicalThis = !!(node.transformFlags & 4096 /* ContainsLexicalThis */);\n            switch (compilerOptions.module) {\n                case ts.ModuleKind.AMD:\n                    return createImportCallExpressionAMD(argument, containsLexicalThis);\n                case ts.ModuleKind.UMD:\n                    return createImportCallExpressionUMD(argument !== null && argument !== void 0 ? argument : factory.createVoidZero(), containsLexicalThis);\n                case ts.ModuleKind.CommonJS:\n                default:\n                    return createImportCallExpressionCommonJS(argument, containsLexicalThis);\n            }\n        }\n        function createImportCallExpressionUMD(arg, containsLexicalThis) {\n            // (function (factory) {\n            //      ... (regular UMD)\n            // }\n            // })(function (require, exports, useSyncRequire) {\n            //      \"use strict\";\n            //      Object.defineProperty(exports, \"__esModule\", { value: true });\n            //      var __syncRequire = typeof module === \"object\" && typeof module.exports === \"object\";\n            //      var __resolved = new Promise(function (resolve) { resolve(); });\n            //      .....\n            //      __syncRequire\n            //          ? __resolved.then(function () { return require(x); }) /*CommonJs Require*/\n            //          : new Promise(function (_a, _b) { require([x], _a, _b); }); /*Amd Require*/\n            // });\n            needUMDDynamicImportHelper = true;\n            if (ts.isSimpleCopiableExpression(arg)) {\n                var argClone = ts.isGeneratedIdentifier(arg) ? arg : ts.isStringLiteral(arg) ? factory.createStringLiteralFromNode(arg) : ts.setEmitFlags(ts.setTextRange(factory.cloneNode(arg), arg), 1536 /* NoComments */);\n                return factory.createConditionalExpression(\n                /*condition*/ factory.createIdentifier(\"__syncRequire\"), \n                /*questionToken*/ undefined, \n                /*whenTrue*/ createImportCallExpressionCommonJS(arg, containsLexicalThis), \n                /*colonToken*/ undefined, \n                /*whenFalse*/ createImportCallExpressionAMD(argClone, containsLexicalThis));\n            }\n            else {\n                var temp = factory.createTempVariable(hoistVariableDeclaration);\n                return factory.createComma(factory.createAssignment(temp, arg), factory.createConditionalExpression(\n                /*condition*/ factory.createIdentifier(\"__syncRequire\"), \n                /*questionToken*/ undefined, \n                /*whenTrue*/ createImportCallExpressionCommonJS(temp, containsLexicalThis), \n                /*colonToken*/ undefined, \n                /*whenFalse*/ createImportCallExpressionAMD(temp, containsLexicalThis)));\n            }\n        }\n        function createImportCallExpressionAMD(arg, containsLexicalThis) {\n            // improt(\"./blah\")\n            // emit as\n            // define([\"require\", \"exports\", \"blah\"], function (require, exports) {\n            //     ...\n            //     new Promise(function (_a, _b) { require([x], _a, _b); }); /*Amd Require*/\n            // });\n            var resolve = factory.createUniqueName(\"resolve\");\n            var reject = factory.createUniqueName(\"reject\");\n            var parameters = [\n                factory.createParameterDeclaration(/*decorator*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, /*name*/ resolve),\n                factory.createParameterDeclaration(/*decorator*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, /*name*/ reject)\n            ];\n            var body = factory.createBlock([\n                factory.createExpressionStatement(factory.createCallExpression(factory.createIdentifier(\"require\"), \n                /*typeArguments*/ undefined, [factory.createArrayLiteralExpression([arg || factory.createOmittedExpression()]), resolve, reject]))\n            ]);\n            var func;\n            if (languageVersion >= 2 /* ES2015 */) {\n                func = factory.createArrowFunction(\n                /*modifiers*/ undefined, \n                /*typeParameters*/ undefined, parameters, \n                /*type*/ undefined, \n                /*equalsGreaterThanToken*/ undefined, body);\n            }\n            else {\n                func = factory.createFunctionExpression(\n                /*modifiers*/ undefined, \n                /*asteriskToken*/ undefined, \n                /*name*/ undefined, \n                /*typeParameters*/ undefined, parameters, \n                /*type*/ undefined, body);\n                // if there is a lexical 'this' in the import call arguments, ensure we indicate\n                // that this new function expression indicates it captures 'this' so that the\n                // es2015 transformer will properly substitute 'this' with '_this'.\n                if (containsLexicalThis) {\n                    ts.setEmitFlags(func, 8 /* CapturesThis */);\n                }\n            }\n            var promise = factory.createNewExpression(factory.createIdentifier(\"Promise\"), /*typeArguments*/ undefined, [func]);\n            if (compilerOptions.esModuleInterop) {\n                return factory.createCallExpression(factory.createPropertyAccessExpression(promise, factory.createIdentifier(\"then\")), /*typeArguments*/ undefined, [emitHelpers().createImportStarCallbackHelper()]);\n            }\n            return promise;\n        }\n        function createImportCallExpressionCommonJS(arg, containsLexicalThis) {\n            // import(\"./blah\")\n            // emit as\n            // Promise.resolve().then(function () { return require(x); }) /*CommonJs Require*/\n            // We have to wrap require in then callback so that require is done in asynchronously\n            // if we simply do require in resolve callback in Promise constructor. We will execute the loading immediately\n            var promiseResolveCall = factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier(\"Promise\"), \"resolve\"), /*typeArguments*/ undefined, /*argumentsArray*/ []);\n            var requireCall = factory.createCallExpression(factory.createIdentifier(\"require\"), /*typeArguments*/ undefined, arg ? [arg] : []);\n            if (compilerOptions.esModuleInterop) {\n                requireCall = emitHelpers().createImportStarHelper(requireCall);\n            }\n            var func;\n            if (languageVersion >= 2 /* ES2015 */) {\n                func = factory.createArrowFunction(\n                /*modifiers*/ undefined, \n                /*typeParameters*/ undefined, \n                /*parameters*/ [], \n                /*type*/ undefined, \n                /*equalsGreaterThanToken*/ undefined, requireCall);\n            }\n            else {\n                func = factory.createFunctionExpression(\n                /*modifiers*/ undefined, \n                /*asteriskToken*/ undefined, \n                /*name*/ undefined, \n                /*typeParameters*/ undefined, \n                /*parameters*/ [], \n                /*type*/ undefined, factory.createBlock([factory.createReturnStatement(requireCall)]));\n                // if there is a lexical 'this' in the import call arguments, ensure we indicate\n                // that this new function expression indicates it captures 'this' so that the\n                // es2015 transformer will properly substitute 'this' with '_this'.\n                if (containsLexicalThis) {\n                    ts.setEmitFlags(func, 8 /* CapturesThis */);\n                }\n            }\n            return factory.createCallExpression(factory.createPropertyAccessExpression(promiseResolveCall, \"then\"), /*typeArguments*/ undefined, [func]);\n        }\n        function getHelperExpressionForExport(node, innerExpr) {\n            if (!compilerOptions.esModuleInterop || ts.getEmitFlags(node) & 67108864 /* NeverApplyImportHelper */) {\n                return innerExpr;\n            }\n            if (ts.getExportNeedsImportStarHelper(node)) {\n                return emitHelpers().createImportStarHelper(innerExpr);\n            }\n            return innerExpr;\n        }\n        function getHelperExpressionForImport(node, innerExpr) {\n            if (!compilerOptions.esModuleInterop || ts.getEmitFlags(node) & 67108864 /* NeverApplyImportHelper */) {\n                return innerExpr;\n            }\n            if (ts.getImportNeedsImportStarHelper(node)) {\n                return emitHelpers().createImportStarHelper(innerExpr);\n            }\n            if (ts.getImportNeedsImportDefaultHelper(node)) {\n                return emitHelpers().createImportDefaultHelper(innerExpr);\n            }\n            return innerExpr;\n        }\n        /**\n         * Visits an ImportDeclaration node.\n         *\n         * @param node The node to visit.\n         */\n        function visitImportDeclaration(node) {\n            var statements;\n            var namespaceDeclaration = ts.getNamespaceDeclarationNode(node);\n            if (moduleKind !== ts.ModuleKind.AMD) {\n                if (!node.importClause) {\n                    // import \"mod\";\n                    return ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(createRequireCall(node)), node), node);\n                }\n                else {\n                    var variables = [];\n                    if (namespaceDeclaration && !ts.isDefaultImport(node)) {\n                        // import * as n from \"mod\";\n                        variables.push(factory.createVariableDeclaration(factory.cloneNode(namespaceDeclaration.name), \n                        /*exclamationToken*/ undefined, \n                        /*type*/ undefined, getHelperExpressionForImport(node, createRequireCall(node))));\n                    }\n                    else {\n                        // import d from \"mod\";\n                        // import { x, y } from \"mod\";\n                        // import d, { x, y } from \"mod\";\n                        // import d, * as n from \"mod\";\n                        variables.push(factory.createVariableDeclaration(factory.getGeneratedNameForNode(node), \n                        /*exclamationToken*/ undefined, \n                        /*type*/ undefined, getHelperExpressionForImport(node, createRequireCall(node))));\n                        if (namespaceDeclaration && ts.isDefaultImport(node)) {\n                            variables.push(factory.createVariableDeclaration(factory.cloneNode(namespaceDeclaration.name), \n                            /*exclamationToken*/ undefined, \n                            /*type*/ undefined, factory.getGeneratedNameForNode(node)));\n                        }\n                    }\n                    statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createVariableStatement(\n                    /*modifiers*/ undefined, factory.createVariableDeclarationList(variables, languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */)), \n                    /*location*/ node), \n                    /*original*/ node));\n                }\n            }\n            else if (namespaceDeclaration && ts.isDefaultImport(node)) {\n                // import d, * as n from \"mod\";\n                statements = ts.append(statements, factory.createVariableStatement(\n                /*modifiers*/ undefined, factory.createVariableDeclarationList([\n                    ts.setOriginalNode(ts.setTextRange(factory.createVariableDeclaration(factory.cloneNode(namespaceDeclaration.name), \n                    /*exclamationToken*/ undefined, \n                    /*type*/ undefined, factory.getGeneratedNameForNode(node)), \n                    /*location*/ node), \n                    /*original*/ node)\n                ], languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */)));\n            }\n            if (hasAssociatedEndOfDeclarationMarker(node)) {\n                // Defer exports until we encounter an EndOfDeclarationMarker node\n                var id = ts.getOriginalNodeId(node);\n                deferredExports[id] = appendExportsOfImportDeclaration(deferredExports[id], node);\n            }\n            else {\n                statements = appendExportsOfImportDeclaration(statements, node);\n            }\n            return ts.singleOrMany(statements);\n        }\n        /**\n         * Creates a `require()` call to import an external module.\n         *\n         * @param importNode The declararation to import.\n         */\n        function createRequireCall(importNode) {\n            var moduleName = ts.getExternalModuleNameLiteral(factory, importNode, currentSourceFile, host, resolver, compilerOptions);\n            var args = [];\n            if (moduleName) {\n                args.push(moduleName);\n            }\n            return factory.createCallExpression(factory.createIdentifier(\"require\"), /*typeArguments*/ undefined, args);\n        }\n        /**\n         * Visits an ImportEqualsDeclaration node.\n         *\n         * @param node The node to visit.\n         */\n        function visitImportEqualsDeclaration(node) {\n            ts.Debug.assert(ts.isExternalModuleImportEqualsDeclaration(node), \"import= for internal module references should be handled in an earlier transformer.\");\n            var statements;\n            if (moduleKind !== ts.ModuleKind.AMD) {\n                if (ts.hasSyntacticModifier(node, 1 /* Export */)) {\n                    statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(createExportExpression(node.name, createRequireCall(node))), node), node));\n                }\n                else {\n                    statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createVariableStatement(\n                    /*modifiers*/ undefined, factory.createVariableDeclarationList([\n                        factory.createVariableDeclaration(factory.cloneNode(node.name), \n                        /*exclamationToken*/ undefined, \n                        /*type*/ undefined, createRequireCall(node))\n                    ], \n                    /*flags*/ languageVersion >= 2 /* ES2015 */ ? 2 /* Const */ : 0 /* None */)), node), node));\n                }\n            }\n            else {\n                if (ts.hasSyntacticModifier(node, 1 /* Export */)) {\n                    statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(createExportExpression(factory.getExportName(node), factory.getLocalName(node))), node), node));\n                }\n            }\n            if (hasAssociatedEndOfDeclarationMarker(node)) {\n                // Defer exports until we encounter an EndOfDeclarationMarker node\n                var id = ts.getOriginalNodeId(node);\n                deferredExports[id] = appendExportsOfImportEqualsDeclaration(deferredExports[id], node);\n            }\n            else {\n                statements = appendExportsOfImportEqualsDeclaration(statements, node);\n            }\n            return ts.singleOrMany(statements);\n        }\n        /**\n         * Visits an ExportDeclaration node.\n         *\n         * @param The node to visit.\n         */\n        function visitExportDeclaration(node) {\n            if (!node.moduleSpecifier) {\n                // Elide export declarations with no module specifier as they are handled\n                // elsewhere.\n                return undefined;\n            }\n            var generatedName = factory.getGeneratedNameForNode(node);\n            if (node.exportClause && ts.isNamedExports(node.exportClause)) {\n                var statements = [];\n                // export { x, y } from \"mod\";\n                if (moduleKind !== ts.ModuleKind.AMD) {\n                    statements.push(ts.setOriginalNode(ts.setTextRange(factory.createVariableStatement(\n                    /*modifiers*/ undefined, factory.createVariableDeclarationList([\n                        factory.createVariableDeclaration(generatedName, \n                        /*exclamationToken*/ undefined, \n                        /*type*/ undefined, createRequireCall(node))\n                    ])), \n                    /*location*/ node), \n                    /* original */ node));\n                }\n                for (var _i = 0, _a = node.exportClause.elements; _i < _a.length; _i++) {\n                    var specifier = _a[_i];\n                    if (languageVersion === 0 /* ES3 */) {\n                        statements.push(ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(emitHelpers().createCreateBindingHelper(generatedName, factory.createStringLiteralFromNode(specifier.propertyName || specifier.name), specifier.propertyName ? factory.createStringLiteralFromNode(specifier.name) : undefined)), specifier), specifier));\n                    }\n                    else {\n                        var exportNeedsImportDefault = !!compilerOptions.esModuleInterop &&\n                            !(ts.getEmitFlags(node) & 67108864 /* NeverApplyImportHelper */) &&\n                            ts.idText(specifier.propertyName || specifier.name) === \"default\";\n                        var exportedValue = factory.createPropertyAccessExpression(exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName, specifier.propertyName || specifier.name);\n                        statements.push(ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(createExportExpression(factory.getExportName(specifier), exportedValue, /* location */ undefined, /* liveBinding */ true)), specifier), specifier));\n                    }\n                }\n                return ts.singleOrMany(statements);\n            }\n            else if (node.exportClause) {\n                var statements = [];\n                // export * as ns from \"mod\";\n                // export * as default from \"mod\";\n                statements.push(ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(createExportExpression(factory.cloneNode(node.exportClause.name), getHelperExpressionForExport(node, moduleKind !== ts.ModuleKind.AMD ?\n                    createRequireCall(node) :\n                    ts.isExportNamespaceAsDefaultDeclaration(node) ? generatedName :\n                        factory.createIdentifier(ts.idText(node.exportClause.name))))), node), node));\n                return ts.singleOrMany(statements);\n            }\n            else {\n                // export * from \"mod\";\n                return ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(emitHelpers().createExportStarHelper(moduleKind !== ts.ModuleKind.AMD ? createRequireCall(node) : generatedName)), node), node);\n            }\n        }\n        /**\n         * Visits an ExportAssignment node.\n         *\n         * @param node The node to visit.\n         */\n        function visitExportAssignment(node) {\n            if (node.isExportEquals) {\n                return undefined;\n            }\n            var statements;\n            var original = node.original;\n            if (original && hasAssociatedEndOfDeclarationMarker(original)) {\n                // Defer exports until we encounter an EndOfDeclarationMarker node\n                var id = ts.getOriginalNodeId(node);\n                deferredExports[id] = appendExportStatement(deferredExports[id], factory.createIdentifier(\"default\"), ts.visitNode(node.expression, moduleExpressionElementVisitor), /*location*/ node, /*allowComments*/ true);\n            }\n            else {\n                statements = appendExportStatement(statements, factory.createIdentifier(\"default\"), ts.visitNode(node.expression, moduleExpressionElementVisitor), /*location*/ node, /*allowComments*/ true);\n            }\n            return ts.singleOrMany(statements);\n        }\n        /**\n         * Visits a FunctionDeclaration node.\n         *\n         * @param node The node to visit.\n         */\n        function visitFunctionDeclaration(node) {\n            var statements;\n            if (ts.hasSyntacticModifier(node, 1 /* Export */)) {\n                statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createFunctionDeclaration(\n                /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, factory.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), \n                /*typeParameters*/ undefined, ts.visitNodes(node.parameters, moduleExpressionElementVisitor), \n                /*type*/ undefined, ts.visitEachChild(node.body, moduleExpressionElementVisitor, context)), \n                /*location*/ node), \n                /*original*/ node));\n            }\n            else {\n                statements = ts.append(statements, ts.visitEachChild(node, moduleExpressionElementVisitor, context));\n            }\n            if (hasAssociatedEndOfDeclarationMarker(node)) {\n                // Defer exports until we encounter an EndOfDeclarationMarker node\n                var id = ts.getOriginalNodeId(node);\n                deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node);\n            }\n            else {\n                statements = appendExportsOfHoistedDeclaration(statements, node);\n            }\n            return ts.singleOrMany(statements);\n        }\n        /**\n         * Visits a ClassDeclaration node.\n         *\n         * @param node The node to visit.\n         */\n        function visitClassDeclaration(node) {\n            var statements;\n            if (ts.hasSyntacticModifier(node, 1 /* Export */)) {\n                statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createClassDeclaration(\n                /*decorators*/ undefined, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), factory.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), \n                /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, moduleExpressionElementVisitor), ts.visitNodes(node.members, moduleExpressionElementVisitor)), node), node));\n            }\n            else {\n                statements = ts.append(statements, ts.visitEachChild(node, moduleExpressionElementVisitor, context));\n            }\n            if (hasAssociatedEndOfDeclarationMarker(node)) {\n                // Defer exports until we encounter an EndOfDeclarationMarker node\n                var id = ts.getOriginalNodeId(node);\n                deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node);\n            }\n            else {\n                statements = appendExportsOfHoistedDeclaration(statements, node);\n            }\n            return ts.singleOrMany(statements);\n        }\n        /**\n         * Visits a VariableStatement node.\n         *\n         * @param node The node to visit.\n         */\n        function visitVariableStatement(node) {\n            var statements;\n            var variables;\n            var expressions;\n            if (ts.hasSyntacticModifier(node, 1 /* Export */)) {\n                var modifiers = void 0;\n                var removeCommentsOnExpressions = false;\n                // If we're exporting these variables, then these just become assignments to 'exports.x'.\n                for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {\n                    var variable = _a[_i];\n                    if (ts.isIdentifier(variable.name) && ts.isLocalName(variable.name)) {\n                        if (!modifiers) {\n                            modifiers = ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier);\n                        }\n                        variables = ts.append(variables, variable);\n                    }\n                    else if (variable.initializer) {\n                        if (!ts.isBindingPattern(variable.name) && (ts.isArrowFunction(variable.initializer) || ts.isFunctionExpression(variable.initializer) || ts.isClassExpression(variable.initializer))) {\n                            var expression = factory.createAssignment(ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier(\"exports\"), variable.name), \n                            /*location*/ variable.name), factory.createIdentifier(ts.getTextOfIdentifierOrLiteral(variable.name)));\n                            var updatedVariable = factory.createVariableDeclaration(variable.name, variable.exclamationToken, variable.type, ts.visitNode(variable.initializer, moduleExpressionElementVisitor));\n                            variables = ts.append(variables, updatedVariable);\n                            expressions = ts.append(expressions, expression);\n                            removeCommentsOnExpressions = true;\n                        }\n                        else {\n                            expressions = ts.append(expressions, transformInitializedVariable(variable));\n                        }\n                    }\n                }\n                if (variables) {\n                    statements = ts.append(statements, factory.updateVariableStatement(node, modifiers, factory.updateVariableDeclarationList(node.declarationList, variables)));\n                }\n                if (expressions) {\n                    var statement = ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(expressions)), node), node);\n                    if (removeCommentsOnExpressions) {\n                        ts.removeAllComments(statement);\n                    }\n                    statements = ts.append(statements, statement);\n                }\n            }\n            else {\n                statements = ts.append(statements, ts.visitEachChild(node, moduleExpressionElementVisitor, context));\n            }\n            if (hasAssociatedEndOfDeclarationMarker(node)) {\n                // Defer exports until we encounter an EndOfDeclarationMarker node\n                var id = ts.getOriginalNodeId(node);\n                deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node);\n            }\n            else {\n                statements = appendExportsOfVariableStatement(statements, node);\n            }\n            return ts.singleOrMany(statements);\n        }\n        function createAllExportExpressions(name, value, location) {\n            var exportedNames = getExports(name);\n            if (exportedNames) {\n                // For each additional export of the declaration, apply an export assignment.\n                var expression = ts.isExportName(name) ? value : factory.createAssignment(name, value);\n                for (var _i = 0, exportedNames_1 = exportedNames; _i < exportedNames_1.length; _i++) {\n                    var exportName = exportedNames_1[_i];\n                    // Mark the node to prevent triggering substitution.\n                    ts.setEmitFlags(expression, 4 /* NoSubstitution */);\n                    expression = createExportExpression(exportName, expression, /*location*/ location);\n                }\n                return expression;\n            }\n            return factory.createAssignment(name, value);\n        }\n        /**\n         * Transforms an exported variable with an initializer into an expression.\n         *\n         * @param node The node to transform.\n         */\n        function transformInitializedVariable(node) {\n            if (ts.isBindingPattern(node.name)) {\n                return ts.flattenDestructuringAssignment(ts.visitNode(node, moduleExpressionElementVisitor), \n                /*visitor*/ undefined, context, 0 /* All */, \n                /*needsValue*/ false, createAllExportExpressions);\n            }\n            else {\n                return factory.createAssignment(ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier(\"exports\"), node.name), \n                /*location*/ node.name), node.initializer ? ts.visitNode(node.initializer, moduleExpressionElementVisitor) : factory.createVoidZero());\n            }\n        }\n        /**\n         * Visits a MergeDeclarationMarker used as a placeholder for the beginning of a merged\n         * and transformed declaration.\n         *\n         * @param node The node to visit.\n         */\n        function visitMergeDeclarationMarker(node) {\n            // For an EnumDeclaration or ModuleDeclaration that merges with a preceeding\n            // declaration we do not emit a leading variable declaration. To preserve the\n            // begin/end semantics of the declararation and to properly handle exports\n            // we wrapped the leading variable declaration in a `MergeDeclarationMarker`.\n            //\n            // To balance the declaration, add the exports of the elided variable\n            // statement.\n            if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 232 /* VariableStatement */) {\n                var id = ts.getOriginalNodeId(node);\n                deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original);\n            }\n            return node;\n        }\n        /**\n         * Determines whether a node has an associated EndOfDeclarationMarker.\n         *\n         * @param node The node to test.\n         */\n        function hasAssociatedEndOfDeclarationMarker(node) {\n            return (ts.getEmitFlags(node) & 4194304 /* HasEndOfDeclarationMarker */) !== 0;\n        }\n        /**\n         * Visits a DeclarationMarker used as a placeholder for the end of a transformed\n         * declaration.\n         *\n         * @param node The node to visit.\n         */\n        function visitEndOfDeclarationMarker(node) {\n            // For some transformations we emit an `EndOfDeclarationMarker` to mark the actual\n            // end of the transformed declaration. We use this marker to emit any deferred exports\n            // of the declaration.\n            var id = ts.getOriginalNodeId(node);\n            var statements = deferredExports[id];\n            if (statements) {\n                delete deferredExports[id];\n                return ts.append(statements, node);\n            }\n            return node;\n        }\n        /**\n         * Appends the exports of an ImportDeclaration to a statement list, returning the\n         * statement list.\n         *\n         * @param statements A statement list to which the down-level export statements are to be\n         * appended. If `statements` is `undefined`, a new array is allocated if statements are\n         * appended.\n         * @param decl The declaration whose exports are to be recorded.\n         */\n        function appendExportsOfImportDeclaration(statements, decl) {\n            if (currentModuleInfo.exportEquals) {\n                return statements;\n            }\n            var importClause = decl.importClause;\n            if (!importClause) {\n                return statements;\n            }\n            if (importClause.name) {\n                statements = appendExportsOfDeclaration(statements, importClause);\n            }\n            var namedBindings = importClause.namedBindings;\n            if (namedBindings) {\n                switch (namedBindings.kind) {\n                    case 263 /* NamespaceImport */:\n                        statements = appendExportsOfDeclaration(statements, namedBindings);\n                        break;\n                    case 264 /* NamedImports */:\n                        for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) {\n                            var importBinding = _a[_i];\n                            statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true);\n                        }\n                        break;\n                }\n            }\n            return statements;\n        }\n        /**\n         * Appends the exports of an ImportEqualsDeclaration to a statement list, returning the\n         * statement list.\n         *\n         * @param statements A statement list to which the down-level export statements are to be\n         * appended. If `statements` is `undefined`, a new array is allocated if statements are\n         * appended.\n         * @param decl The declaration whose exports are to be recorded.\n         */\n        function appendExportsOfImportEqualsDeclaration(statements, decl) {\n            if (currentModuleInfo.exportEquals) {\n                return statements;\n            }\n            return appendExportsOfDeclaration(statements, decl);\n        }\n        /**\n         * Appends the exports of a VariableStatement to a statement list, returning the statement\n         * list.\n         *\n         * @param statements A statement list to which the down-level export statements are to be\n         * appended. If `statements` is `undefined`, a new array is allocated if statements are\n         * appended.\n         * @param node The VariableStatement whose exports are to be recorded.\n         */\n        function appendExportsOfVariableStatement(statements, node) {\n            if (currentModuleInfo.exportEquals) {\n                return statements;\n            }\n            for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {\n                var decl = _a[_i];\n                statements = appendExportsOfBindingElement(statements, decl);\n            }\n            return statements;\n        }\n        /**\n         * Appends the exports of a VariableDeclaration or BindingElement to a statement list,\n         * returning the statement list.\n         *\n         * @param statements A statement list to which the down-level export statements are to be\n         * appended. If `statements` is `undefined`, a new array is allocated if statements are\n         * appended.\n         * @param decl The declaration whose exports are to be recorded.\n         */\n        function appendExportsOfBindingElement(statements, decl) {\n            if (currentModuleInfo.exportEquals) {\n                return statements;\n            }\n            if (ts.isBindingPattern(decl.name)) {\n                for (var _i = 0, _a = decl.name.elements; _i < _a.length; _i++) {\n                    var element = _a[_i];\n                    if (!ts.isOmittedExpression(element)) {\n                        statements = appendExportsOfBindingElement(statements, element);\n                    }\n                }\n            }\n            else if (!ts.isGeneratedIdentifier(decl.name)) {\n                statements = appendExportsOfDeclaration(statements, decl);\n            }\n            return statements;\n        }\n        /**\n         * Appends the exports of a ClassDeclaration or FunctionDeclaration to a statement list,\n         * returning the statement list.\n         *\n         * @param statements A statement list to which the down-level export statements are to be\n         * appended. If `statements` is `undefined`, a new array is allocated if statements are\n         * appended.\n         * @param decl The declaration whose exports are to be recorded.\n         */\n        function appendExportsOfHoistedDeclaration(statements, decl) {\n            if (currentModuleInfo.exportEquals) {\n                return statements;\n            }\n            if (ts.hasSyntacticModifier(decl, 1 /* Export */)) {\n                var exportName = ts.hasSyntacticModifier(decl, 512 /* Default */) ? factory.createIdentifier(\"default\") : factory.getDeclarationName(decl);\n                statements = appendExportStatement(statements, exportName, factory.getLocalName(decl), /*location*/ decl);\n            }\n            if (decl.name) {\n                statements = appendExportsOfDeclaration(statements, decl);\n            }\n            return statements;\n        }\n        /**\n         * Appends the exports of a declaration to a statement list, returning the statement list.\n         *\n         * @param statements A statement list to which the down-level export statements are to be\n         * appended. If `statements` is `undefined`, a new array is allocated if statements are\n         * appended.\n         * @param decl The declaration to export.\n         */\n        function appendExportsOfDeclaration(statements, decl, liveBinding) {\n            var name = factory.getDeclarationName(decl);\n            var exportSpecifiers = currentModuleInfo.exportSpecifiers.get(ts.idText(name));\n            if (exportSpecifiers) {\n                for (var _i = 0, exportSpecifiers_1 = exportSpecifiers; _i < exportSpecifiers_1.length; _i++) {\n                    var exportSpecifier = exportSpecifiers_1[_i];\n                    statements = appendExportStatement(statements, exportSpecifier.name, name, /*location*/ exportSpecifier.name, /* allowComments */ undefined, liveBinding);\n                }\n            }\n            return statements;\n        }\n        /**\n         * Appends the down-level representation of an export to a statement list, returning the\n         * statement list.\n         *\n         * @param statements A statement list to which the down-level export statements are to be\n         * appended. If `statements` is `undefined`, a new array is allocated if statements are\n         * appended.\n         * @param exportName The name of the export.\n         * @param expression The expression to export.\n         * @param location The location to use for source maps and comments for the export.\n         * @param allowComments Whether to allow comments on the export.\n         */\n        function appendExportStatement(statements, exportName, expression, location, allowComments, liveBinding) {\n            statements = ts.append(statements, createExportStatement(exportName, expression, location, allowComments, liveBinding));\n            return statements;\n        }\n        function createUnderscoreUnderscoreESModule() {\n            var statement;\n            if (languageVersion === 0 /* ES3 */) {\n                statement = factory.createExpressionStatement(createExportExpression(factory.createIdentifier(\"__esModule\"), factory.createTrue()));\n            }\n            else {\n                statement = factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier(\"Object\"), \"defineProperty\"), \n                /*typeArguments*/ undefined, [\n                    factory.createIdentifier(\"exports\"),\n                    factory.createStringLiteral(\"__esModule\"),\n                    factory.createObjectLiteralExpression([\n                        factory.createPropertyAssignment(\"value\", factory.createTrue())\n                    ])\n                ]));\n            }\n            ts.setEmitFlags(statement, 1048576 /* CustomPrologue */);\n            return statement;\n        }\n        /**\n         * Creates a call to the current file's export function to export a value.\n         *\n         * @param name The bound name of the export.\n         * @param value The exported value.\n         * @param location The location to use for source maps and comments for the export.\n         * @param allowComments An optional value indicating whether to emit comments for the statement.\n         */\n        function createExportStatement(name, value, location, allowComments, liveBinding) {\n            var statement = ts.setTextRange(factory.createExpressionStatement(createExportExpression(name, value, /* location */ undefined, liveBinding)), location);\n            ts.startOnNewLine(statement);\n            if (!allowComments) {\n                ts.setEmitFlags(statement, 1536 /* NoComments */);\n            }\n            return statement;\n        }\n        /**\n         * Creates a call to the current file's export function to export a value.\n         *\n         * @param name The bound name of the export.\n         * @param value The exported value.\n         * @param location The location to use for source maps and comments for the export.\n         */\n        function createExportExpression(name, value, location, liveBinding) {\n            return ts.setTextRange(liveBinding && languageVersion !== 0 /* ES3 */ ? factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier(\"Object\"), \"defineProperty\"), \n            /*typeArguments*/ undefined, [\n                factory.createIdentifier(\"exports\"),\n                factory.createStringLiteralFromNode(name),\n                factory.createObjectLiteralExpression([\n                    factory.createPropertyAssignment(\"enumerable\", factory.createTrue()),\n                    factory.createPropertyAssignment(\"get\", factory.createFunctionExpression(\n                    /*modifiers*/ undefined, \n                    /*asteriskToken*/ undefined, \n                    /*name*/ undefined, \n                    /*typeParameters*/ undefined, \n                    /*parameters*/ [], \n                    /*type*/ undefined, factory.createBlock([factory.createReturnStatement(value)])))\n                ])\n            ]) : factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier(\"exports\"), factory.cloneNode(name)), value), location);\n        }\n        //\n        // Modifier Visitors\n        //\n        /**\n         * Visit nodes to elide module-specific modifiers.\n         *\n         * @param node The node to visit.\n         */\n        function modifierVisitor(node) {\n            // Elide module-specific modifiers.\n            switch (node.kind) {\n                case 92 /* ExportKeyword */:\n                case 87 /* DefaultKeyword */:\n                    return undefined;\n            }\n            return node;\n        }\n        //\n        // Emit Notification\n        //\n        /**\n         * Hook for node emit notifications.\n         *\n         * @param hint A hint as to the intended usage of the node.\n         * @param node The node to emit.\n         * @param emit A callback used to emit the node in the printer.\n         */\n        function onEmitNode(hint, node, emitCallback) {\n            if (node.kind === 297 /* SourceFile */) {\n                currentSourceFile = node;\n                currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)];\n                noSubstitution = [];\n                previousOnEmitNode(hint, node, emitCallback);\n                currentSourceFile = undefined;\n                currentModuleInfo = undefined;\n                noSubstitution = undefined;\n            }\n            else {\n                previousOnEmitNode(hint, node, emitCallback);\n            }\n        }\n        //\n        // Substitutions\n        //\n        /**\n         * Hooks node substitutions.\n         *\n         * @param hint A hint as to the intended usage of the node.\n         * @param node The node to substitute.\n         */\n        function onSubstituteNode(hint, node) {\n            node = previousOnSubstituteNode(hint, node);\n            if (node.id && noSubstitution[node.id]) {\n                return node;\n            }\n            if (hint === 1 /* Expression */) {\n                return substituteExpression(node);\n            }\n            else if (ts.isShorthandPropertyAssignment(node)) {\n                return substituteShorthandPropertyAssignment(node);\n            }\n            return node;\n        }\n        /**\n         * Substitution for a ShorthandPropertyAssignment whose declaration name is an imported\n         * or exported symbol.\n         *\n         * @param node The node to substitute.\n         */\n        function substituteShorthandPropertyAssignment(node) {\n            var name = node.name;\n            var exportedOrImportedName = substituteExpressionIdentifier(name);\n            if (exportedOrImportedName !== name) {\n                // A shorthand property with an assignment initializer is probably part of a\n                // destructuring assignment\n                if (node.objectAssignmentInitializer) {\n                    var initializer = factory.createAssignment(exportedOrImportedName, node.objectAssignmentInitializer);\n                    return ts.setTextRange(factory.createPropertyAssignment(name, initializer), node);\n                }\n                return ts.setTextRange(factory.createPropertyAssignment(name, exportedOrImportedName), node);\n            }\n            return node;\n        }\n        /**\n         * Substitution for an Expression that may contain an imported or exported symbol.\n         *\n         * @param node The node to substitute.\n         */\n        function substituteExpression(node) {\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                    return substituteExpressionIdentifier(node);\n                case 216 /* BinaryExpression */:\n                    return substituteBinaryExpression(node);\n                case 215 /* PostfixUnaryExpression */:\n                case 214 /* PrefixUnaryExpression */:\n                    return substituteUnaryExpression(node);\n            }\n            return node;\n        }\n        /**\n         * Substitution for an Identifier expression that may contain an imported or exported\n         * symbol.\n         *\n         * @param node The node to substitute.\n         */\n        function substituteExpressionIdentifier(node) {\n            var _a, _b;\n            if (ts.getEmitFlags(node) & 4096 /* HelperName */) {\n                var externalHelpersModuleName = ts.getExternalHelpersModuleName(currentSourceFile);\n                if (externalHelpersModuleName) {\n                    return factory.createPropertyAccessExpression(externalHelpersModuleName, node);\n                }\n                return node;\n            }\n            if (!(ts.isGeneratedIdentifier(node) && !(node.autoGenerateFlags & 64 /* AllowNameSubstitution */)) && !ts.isLocalName(node)) {\n                var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node));\n                if (exportContainer && exportContainer.kind === 297 /* SourceFile */) {\n                    return ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier(\"exports\"), factory.cloneNode(node)), \n                    /*location*/ node);\n                }\n                var importDeclaration = resolver.getReferencedImportDeclaration(node);\n                if (importDeclaration) {\n                    if (ts.isImportClause(importDeclaration)) {\n                        return ts.setTextRange(factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(importDeclaration.parent), factory.createIdentifier(\"default\")), \n                        /*location*/ node);\n                    }\n                    else if (ts.isImportSpecifier(importDeclaration)) {\n                        var name = importDeclaration.propertyName || importDeclaration.name;\n                        return ts.setTextRange(factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent) || importDeclaration), factory.cloneNode(name)), \n                        /*location*/ node);\n                    }\n                }\n            }\n            return node;\n        }\n        /**\n         * Substitution for a BinaryExpression that may contain an imported or exported symbol.\n         *\n         * @param node The node to substitute.\n         */\n        function substituteBinaryExpression(node) {\n            // When we see an assignment expression whose left-hand side is an exported symbol,\n            // we should ensure all exports of that symbol are updated with the correct value.\n            //\n            // - We do not substitute generated identifiers for any reason.\n            // - We do not substitute identifiers tagged with the LocalName flag.\n            // - We do not substitute identifiers that were originally the name of an enum or\n            //   namespace due to how they are transformed in TypeScript.\n            // - We only substitute identifiers that are exported at the top level.\n            if (ts.isAssignmentOperator(node.operatorToken.kind)\n                && ts.isIdentifier(node.left)\n                && !ts.isGeneratedIdentifier(node.left)\n                && !ts.isLocalName(node.left)\n                && !ts.isDeclarationNameOfEnumOrNamespace(node.left)) {\n                var exportedNames = getExports(node.left);\n                if (exportedNames) {\n                    // For each additional export of the declaration, apply an export assignment.\n                    var expression = node;\n                    for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) {\n                        var exportName = exportedNames_2[_i];\n                        // Mark the node to prevent triggering this rule again.\n                        noSubstitution[ts.getNodeId(expression)] = true;\n                        expression = createExportExpression(exportName, expression, /*location*/ node);\n                    }\n                    return expression;\n                }\n            }\n            return node;\n        }\n        /**\n         * Substitution for a UnaryExpression that may contain an imported or exported symbol.\n         *\n         * @param node The node to substitute.\n         */\n        function substituteUnaryExpression(node) {\n            // When we see a prefix or postfix increment expression whose operand is an exported\n            // symbol, we should ensure all exports of that symbol are updated with the correct\n            // value.\n            //\n            // - We do not substitute generated identifiers for any reason.\n            // - We do not substitute identifiers tagged with the LocalName flag.\n            // - We do not substitute identifiers that were originally the name of an enum or\n            //   namespace due to how they are transformed in TypeScript.\n            // - We only substitute identifiers that are exported at the top level.\n            if ((node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */)\n                && ts.isIdentifier(node.operand)\n                && !ts.isGeneratedIdentifier(node.operand)\n                && !ts.isLocalName(node.operand)\n                && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) {\n                var exportedNames = getExports(node.operand);\n                if (exportedNames) {\n                    var expression = node.kind === 215 /* PostfixUnaryExpression */\n                        ? ts.setTextRange(factory.createBinaryExpression(node.operand, factory.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), factory.createNumericLiteral(1)), \n                        /*location*/ node)\n                        : node;\n                    for (var _i = 0, exportedNames_3 = exportedNames; _i < exportedNames_3.length; _i++) {\n                        var exportName = exportedNames_3[_i];\n                        // Mark the node to prevent triggering this rule again.\n                        noSubstitution[ts.getNodeId(expression)] = true;\n                        expression = factory.createParenthesizedExpression(createExportExpression(exportName, expression));\n                    }\n                    return expression;\n                }\n            }\n            return node;\n        }\n        /**\n         * Gets the additional exports of a name.\n         *\n         * @param name The name.\n         */\n        function getExports(name) {\n            if (!ts.isGeneratedIdentifier(name)) {\n                var valueDeclaration = resolver.getReferencedImportDeclaration(name)\n                    || resolver.getReferencedValueDeclaration(name);\n                if (valueDeclaration) {\n                    return currentModuleInfo\n                        && currentModuleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)];\n                }\n            }\n        }\n    }\n    ts.transformModule = transformModule;\n    // emit helper for dynamic import\n    var dynamicImportUMDHelper = {\n        name: \"typescript:dynamicimport-sync-require\",\n        scoped: true,\n        text: \"\\n            var __syncRequire = typeof module === \\\"object\\\" && typeof module.exports === \\\"object\\\";\"\n    };\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    function transformSystemModule(context) {\n        var factory = context.factory, startLexicalEnvironment = context.startLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration;\n        var compilerOptions = context.getCompilerOptions();\n        var resolver = context.getEmitResolver();\n        var host = context.getEmitHost();\n        var previousOnSubstituteNode = context.onSubstituteNode;\n        var previousOnEmitNode = context.onEmitNode;\n        context.onSubstituteNode = onSubstituteNode;\n        context.onEmitNode = onEmitNode;\n        context.enableSubstitution(78 /* Identifier */); // Substitutes expression identifiers for imported symbols.\n        context.enableSubstitution(289 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols\n        context.enableSubstitution(216 /* BinaryExpression */); // Substitutes assignments to exported symbols.\n        context.enableSubstitution(214 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols.\n        context.enableSubstitution(215 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols.\n        context.enableSubstitution(226 /* MetaProperty */); // Substitutes 'import.meta'\n        context.enableEmitNotification(297 /* SourceFile */); // Restore state when substituting nodes in a file.\n        var moduleInfoMap = []; // The ExternalModuleInfo for each file.\n        var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found.\n        var exportFunctionsMap = []; // The export function associated with a source file.\n        var noSubstitutionMap = []; // Set of nodes for which substitution rules should be ignored for each file.\n        var contextObjectMap = []; // The context object associated with a source file.\n        var currentSourceFile; // The current file.\n        var moduleInfo; // ExternalModuleInfo for the current file.\n        var exportFunction; // The export function for the current file.\n        var contextObject; // The context object for the current file.\n        var hoistedStatements;\n        var enclosingBlockScopedContainer;\n        var noSubstitution; // Set of nodes for which substitution rules should be ignored.\n        return ts.chainBundle(context, transformSourceFile);\n        /**\n         * Transforms the module aspects of a SourceFile.\n         *\n         * @param node The SourceFile node.\n         */\n        function transformSourceFile(node) {\n            if (node.isDeclarationFile || !(ts.isEffectiveExternalModule(node, compilerOptions) || node.transformFlags & 2097152 /* ContainsDynamicImport */)) {\n                return node;\n            }\n            var id = ts.getOriginalNodeId(node);\n            currentSourceFile = node;\n            enclosingBlockScopedContainer = node;\n            // System modules have the following shape:\n            //\n            //     System.register(['dep-1', ... 'dep-n'], function(exports) {/* module body function */})\n            //\n            // The parameter 'exports' here is a callback '<T>(name: string, value: T) => T' that\n            // is used to publish exported values. 'exports' returns its 'value' argument so in\n            // most cases expressions that mutate exported values can be rewritten as:\n            //\n            //     expr -> exports('name', expr)\n            //\n            // The only exception in this rule is postfix unary operators,\n            // see comment to 'substitutePostfixUnaryExpression' for more details\n            // Collect information about the external module and dependency groups.\n            moduleInfo = moduleInfoMap[id] = ts.collectExternalModuleInfo(context, node, resolver, compilerOptions);\n            // Make sure that the name of the 'exports' function does not conflict with\n            // existing identifiers.\n            exportFunction = factory.createUniqueName(\"exports\");\n            exportFunctionsMap[id] = exportFunction;\n            contextObject = contextObjectMap[id] = factory.createUniqueName(\"context\");\n            // Add the body of the module.\n            var dependencyGroups = collectDependencyGroups(moduleInfo.externalImports);\n            var moduleBodyBlock = createSystemModuleBody(node, dependencyGroups);\n            var moduleBodyFunction = factory.createFunctionExpression(\n            /*modifiers*/ undefined, \n            /*asteriskToken*/ undefined, \n            /*name*/ undefined, \n            /*typeParameters*/ undefined, [\n                factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, exportFunction),\n                factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, contextObject)\n            ], \n            /*type*/ undefined, moduleBodyBlock);\n            // Write the call to `System.register`\n            // Clear the emit-helpers flag for later passes since we'll have already used it in the module body\n            // So the helper will be emit at the correct position instead of at the top of the source-file\n            var moduleName = ts.tryGetModuleNameFromFile(factory, node, host, compilerOptions);\n            var dependencies = factory.createArrayLiteralExpression(ts.map(dependencyGroups, function (dependencyGroup) { return dependencyGroup.name; }));\n            var updated = ts.setEmitFlags(factory.updateSourceFile(node, ts.setTextRange(factory.createNodeArray([\n                factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier(\"System\"), \"register\"), \n                /*typeArguments*/ undefined, moduleName\n                    ? [moduleName, dependencies, moduleBodyFunction]\n                    : [dependencies, moduleBodyFunction]))\n            ]), node.statements)), 1024 /* NoTrailingComments */);\n            if (!ts.outFile(compilerOptions)) {\n                ts.moveEmitHelpers(updated, moduleBodyBlock, function (helper) { return !helper.scoped; });\n            }\n            if (noSubstitution) {\n                noSubstitutionMap[id] = noSubstitution;\n                noSubstitution = undefined;\n            }\n            currentSourceFile = undefined;\n            moduleInfo = undefined;\n            exportFunction = undefined;\n            contextObject = undefined;\n            hoistedStatements = undefined;\n            enclosingBlockScopedContainer = undefined;\n            return updated;\n        }\n        /**\n         * Collects the dependency groups for this files imports.\n         *\n         * @param externalImports The imports for the file.\n         */\n        function collectDependencyGroups(externalImports) {\n            var groupIndices = new ts.Map();\n            var dependencyGroups = [];\n            for (var _i = 0, externalImports_1 = externalImports; _i < externalImports_1.length; _i++) {\n                var externalImport = externalImports_1[_i];\n                var externalModuleName = ts.getExternalModuleNameLiteral(factory, externalImport, currentSourceFile, host, resolver, compilerOptions);\n                if (externalModuleName) {\n                    var text = externalModuleName.text;\n                    var groupIndex = groupIndices.get(text);\n                    if (groupIndex !== undefined) {\n                        // deduplicate/group entries in dependency list by the dependency name\n                        dependencyGroups[groupIndex].externalImports.push(externalImport);\n                    }\n                    else {\n                        groupIndices.set(text, dependencyGroups.length);\n                        dependencyGroups.push({\n                            name: externalModuleName,\n                            externalImports: [externalImport]\n                        });\n                    }\n                }\n            }\n            return dependencyGroups;\n        }\n        /**\n         * Adds the statements for the module body function for the source file.\n         *\n         * @param node The source file for the module.\n         * @param dependencyGroups The grouped dependencies of the module.\n         */\n        function createSystemModuleBody(node, dependencyGroups) {\n            // Shape of the body in system modules:\n            //\n            //  function (exports) {\n            //      <list of local aliases for imports>\n            //      <hoisted variable declarations>\n            //      <hoisted function declarations>\n            //      return {\n            //          setters: [\n            //              <list of setter function for imports>\n            //          ],\n            //          execute: function() {\n            //              <module statements>\n            //          }\n            //      }\n            //      <temp declarations>\n            //  }\n            //\n            // i.e:\n            //\n            //   import {x} from 'file1'\n            //   var y = 1;\n            //   export function foo() { return y + x(); }\n            //   console.log(y);\n            //\n            // Will be transformed to:\n            //\n            //  function(exports) {\n            //      function foo() { return y + file_1.x(); }\n            //      exports(\"foo\", foo);\n            //      var file_1, y;\n            //      return {\n            //          setters: [\n            //              function(v) { file_1 = v }\n            //          ],\n            //          execute(): function() {\n            //              y = 1;\n            //              console.log(y);\n            //          }\n            //      };\n            //  }\n            var statements = [];\n            // We start a new lexical environment in this function body, but *not* in the\n            // body of the execute function. This allows us to emit temporary declarations\n            // only in the outer module body and not in the inner one.\n            startLexicalEnvironment();\n            // Add any prologue directives.\n            var ensureUseStrict = ts.getStrictOptionValue(compilerOptions, \"alwaysStrict\") || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile));\n            var statementOffset = factory.copyPrologue(node.statements, statements, ensureUseStrict, sourceElementVisitor);\n            // var __moduleName = context_1 && context_1.id;\n            statements.push(factory.createVariableStatement(\n            /*modifiers*/ undefined, factory.createVariableDeclarationList([\n                factory.createVariableDeclaration(\"__moduleName\", \n                /*exclamationToken*/ undefined, \n                /*type*/ undefined, factory.createLogicalAnd(contextObject, factory.createPropertyAccessExpression(contextObject, \"id\")))\n            ])));\n            // Visit the synthetic external helpers import declaration if present\n            ts.visitNode(moduleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement);\n            // Visit the statements of the source file, emitting any transformations into\n            // the `executeStatements` array. We do this *before* we fill the `setters` array\n            // as we both emit transformations as well as aggregate some data used when creating\n            // setters. This allows us to reduce the number of times we need to loop through the\n            // statements of the source file.\n            var executeStatements = ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset);\n            // Emit early exports for function declarations.\n            ts.addRange(statements, hoistedStatements);\n            // We emit hoisted variables early to align roughly with our previous emit output.\n            // Two key differences in this approach are:\n            // - Temporary variables will appear at the top rather than at the bottom of the file\n            ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());\n            var exportStarFunction = addExportStarIfNeeded(statements); // TODO: GH#18217\n            var modifiers = node.transformFlags & 524288 /* ContainsAwait */ ?\n                factory.createModifiersFromModifierFlags(256 /* Async */) :\n                undefined;\n            var moduleObject = factory.createObjectLiteralExpression([\n                factory.createPropertyAssignment(\"setters\", createSettersArray(exportStarFunction, dependencyGroups)),\n                factory.createPropertyAssignment(\"execute\", factory.createFunctionExpression(modifiers, \n                /*asteriskToken*/ undefined, \n                /*name*/ undefined, \n                /*typeParameters*/ undefined, \n                /*parameters*/ [], \n                /*type*/ undefined, factory.createBlock(executeStatements, /*multiLine*/ true)))\n            ], /*multiLine*/ true);\n            statements.push(factory.createReturnStatement(moduleObject));\n            return factory.createBlock(statements, /*multiLine*/ true);\n        }\n        /**\n         * Adds an exportStar function to a statement list if it is needed for the file.\n         *\n         * @param statements A statement list.\n         */\n        function addExportStarIfNeeded(statements) {\n            if (!moduleInfo.hasExportStarsToExportValues) {\n                return;\n            }\n            // when resolving exports local exported entries/indirect exported entries in the module\n            // should always win over entries with similar names that were added via star exports\n            // to support this we store names of local/indirect exported entries in a set.\n            // this set is used to filter names brought by star expors.\n            // local names set should only be added if we have anything exported\n            if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) {\n                // no exported declarations (export var ...) or export specifiers (export {x})\n                // check if we have any non star export declarations.\n                var hasExportDeclarationWithExportClause = false;\n                for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) {\n                    var externalImport = _a[_i];\n                    if (externalImport.kind === 267 /* ExportDeclaration */ && externalImport.exportClause) {\n                        hasExportDeclarationWithExportClause = true;\n                        break;\n                    }\n                }\n                if (!hasExportDeclarationWithExportClause) {\n                    // we still need to emit exportStar helper\n                    var exportStarFunction_1 = createExportStarFunction(/*localNames*/ undefined);\n                    statements.push(exportStarFunction_1);\n                    return exportStarFunction_1.name;\n                }\n            }\n            var exportedNames = [];\n            if (moduleInfo.exportedNames) {\n                for (var _b = 0, _c = moduleInfo.exportedNames; _b < _c.length; _b++) {\n                    var exportedLocalName = _c[_b];\n                    if (exportedLocalName.escapedText === \"default\") {\n                        continue;\n                    }\n                    // write name of exported declaration, i.e 'export var x...'\n                    exportedNames.push(factory.createPropertyAssignment(factory.createStringLiteralFromNode(exportedLocalName), factory.createTrue()));\n                }\n            }\n            var exportedNamesStorageRef = factory.createUniqueName(\"exportedNames\");\n            statements.push(factory.createVariableStatement(\n            /*modifiers*/ undefined, factory.createVariableDeclarationList([\n                factory.createVariableDeclaration(exportedNamesStorageRef, \n                /*exclamationToken*/ undefined, \n                /*type*/ undefined, factory.createObjectLiteralExpression(exportedNames, /*multiline*/ true))\n            ])));\n            var exportStarFunction = createExportStarFunction(exportedNamesStorageRef);\n            statements.push(exportStarFunction);\n            return exportStarFunction.name;\n        }\n        /**\n         * Creates an exportStar function for the file, with an optional set of excluded local\n         * names.\n         *\n         * @param localNames An optional reference to an object containing a set of excluded local\n         * names.\n         */\n        function createExportStarFunction(localNames) {\n            var exportStarFunction = factory.createUniqueName(\"exportStar\");\n            var m = factory.createIdentifier(\"m\");\n            var n = factory.createIdentifier(\"n\");\n            var exports = factory.createIdentifier(\"exports\");\n            var condition = factory.createStrictInequality(n, factory.createStringLiteral(\"default\"));\n            if (localNames) {\n                condition = factory.createLogicalAnd(condition, factory.createLogicalNot(factory.createCallExpression(factory.createPropertyAccessExpression(localNames, \"hasOwnProperty\"), \n                /*typeArguments*/ undefined, [n])));\n            }\n            return factory.createFunctionDeclaration(\n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, \n            /*asteriskToken*/ undefined, exportStarFunction, \n            /*typeParameters*/ undefined, [factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, m)], \n            /*type*/ undefined, factory.createBlock([\n                factory.createVariableStatement(\n                /*modifiers*/ undefined, factory.createVariableDeclarationList([\n                    factory.createVariableDeclaration(exports, \n                    /*exclamationToken*/ undefined, \n                    /*type*/ undefined, factory.createObjectLiteralExpression([]))\n                ])),\n                factory.createForInStatement(factory.createVariableDeclarationList([\n                    factory.createVariableDeclaration(n)\n                ]), m, factory.createBlock([\n                    ts.setEmitFlags(factory.createIfStatement(condition, factory.createExpressionStatement(factory.createAssignment(factory.createElementAccessExpression(exports, n), factory.createElementAccessExpression(m, n)))), 1 /* SingleLine */)\n                ])),\n                factory.createExpressionStatement(factory.createCallExpression(exportFunction, \n                /*typeArguments*/ undefined, [exports]))\n            ], /*multiline*/ true));\n        }\n        /**\n         * Creates an array setter callbacks for each dependency group.\n         *\n         * @param exportStarFunction A reference to an exportStarFunction for the file.\n         * @param dependencyGroups An array of grouped dependencies.\n         */\n        function createSettersArray(exportStarFunction, dependencyGroups) {\n            var setters = [];\n            for (var _i = 0, dependencyGroups_1 = dependencyGroups; _i < dependencyGroups_1.length; _i++) {\n                var group_2 = dependencyGroups_1[_i];\n                // derive a unique name for parameter from the first named entry in the group\n                var localName = ts.forEach(group_2.externalImports, function (i) { return ts.getLocalNameForExternalImport(factory, i, currentSourceFile); });\n                var parameterName = localName ? factory.getGeneratedNameForNode(localName) : factory.createUniqueName(\"\");\n                var statements = [];\n                for (var _a = 0, _b = group_2.externalImports; _a < _b.length; _a++) {\n                    var entry = _b[_a];\n                    var importVariableName = ts.getLocalNameForExternalImport(factory, entry, currentSourceFile); // TODO: GH#18217\n                    switch (entry.kind) {\n                        case 261 /* ImportDeclaration */:\n                            if (!entry.importClause) {\n                                // 'import \"...\"' case\n                                // module is imported only for side-effects, no emit required\n                                break;\n                            }\n                        // falls through\n                        case 260 /* ImportEqualsDeclaration */:\n                            ts.Debug.assert(importVariableName !== undefined);\n                            // save import into the local\n                            statements.push(factory.createExpressionStatement(factory.createAssignment(importVariableName, parameterName)));\n                            break;\n                        case 267 /* ExportDeclaration */:\n                            ts.Debug.assert(importVariableName !== undefined);\n                            if (entry.exportClause) {\n                                if (ts.isNamedExports(entry.exportClause)) {\n                                    //  export {a, b as c} from 'foo'\n                                    //\n                                    // emit as:\n                                    //\n                                    //  exports_({\n                                    //     \"a\": _[\"a\"],\n                                    //     \"c\": _[\"b\"]\n                                    //  });\n                                    var properties = [];\n                                    for (var _c = 0, _d = entry.exportClause.elements; _c < _d.length; _c++) {\n                                        var e = _d[_c];\n                                        properties.push(factory.createPropertyAssignment(factory.createStringLiteral(ts.idText(e.name)), factory.createElementAccessExpression(parameterName, factory.createStringLiteral(ts.idText(e.propertyName || e.name)))));\n                                    }\n                                    statements.push(factory.createExpressionStatement(factory.createCallExpression(exportFunction, \n                                    /*typeArguments*/ undefined, [factory.createObjectLiteralExpression(properties, /*multiline*/ true)])));\n                                }\n                                else {\n                                    statements.push(factory.createExpressionStatement(factory.createCallExpression(exportFunction, \n                                    /*typeArguments*/ undefined, [\n                                        factory.createStringLiteral(ts.idText(entry.exportClause.name)),\n                                        parameterName\n                                    ])));\n                                }\n                            }\n                            else {\n                                //  export * from 'foo'\n                                //\n                                // emit as:\n                                //\n                                //  exportStar(foo_1_1);\n                                statements.push(factory.createExpressionStatement(factory.createCallExpression(exportStarFunction, \n                                /*typeArguments*/ undefined, [parameterName])));\n                            }\n                            break;\n                    }\n                }\n                setters.push(factory.createFunctionExpression(\n                /*modifiers*/ undefined, \n                /*asteriskToken*/ undefined, \n                /*name*/ undefined, \n                /*typeParameters*/ undefined, [factory.createParameterDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, parameterName)], \n                /*type*/ undefined, factory.createBlock(statements, /*multiLine*/ true)));\n            }\n            return factory.createArrayLiteralExpression(setters, /*multiLine*/ true);\n        }\n        //\n        // Top-level Source Element Visitors\n        //\n        /**\n         * Visit source elements at the top-level of a module.\n         *\n         * @param node The node to visit.\n         */\n        function sourceElementVisitor(node) {\n            switch (node.kind) {\n                case 261 /* ImportDeclaration */:\n                    return visitImportDeclaration(node);\n                case 260 /* ImportEqualsDeclaration */:\n                    return visitImportEqualsDeclaration(node);\n                case 267 /* ExportDeclaration */:\n                    return visitExportDeclaration(node);\n                case 266 /* ExportAssignment */:\n                    return visitExportAssignment(node);\n                default:\n                    return nestedElementVisitor(node);\n            }\n        }\n        /**\n         * Visits an ImportDeclaration node.\n         *\n         * @param node The node to visit.\n         */\n        function visitImportDeclaration(node) {\n            var statements;\n            if (node.importClause) {\n                hoistVariableDeclaration(ts.getLocalNameForExternalImport(factory, node, currentSourceFile)); // TODO: GH#18217\n            }\n            if (hasAssociatedEndOfDeclarationMarker(node)) {\n                // Defer exports until we encounter an EndOfDeclarationMarker node\n                var id = ts.getOriginalNodeId(node);\n                deferredExports[id] = appendExportsOfImportDeclaration(deferredExports[id], node);\n            }\n            else {\n                statements = appendExportsOfImportDeclaration(statements, node);\n            }\n            return ts.singleOrMany(statements);\n        }\n        function visitExportDeclaration(node) {\n            ts.Debug.assertIsDefined(node);\n            return undefined;\n        }\n        /**\n         * Visits an ImportEqualsDeclaration node.\n         *\n         * @param node The node to visit.\n         */\n        function visitImportEqualsDeclaration(node) {\n            ts.Debug.assert(ts.isExternalModuleImportEqualsDeclaration(node), \"import= for internal module references should be handled in an earlier transformer.\");\n            var statements;\n            hoistVariableDeclaration(ts.getLocalNameForExternalImport(factory, node, currentSourceFile)); // TODO: GH#18217\n            if (hasAssociatedEndOfDeclarationMarker(node)) {\n                // Defer exports until we encounter an EndOfDeclarationMarker node\n                var id = ts.getOriginalNodeId(node);\n                deferredExports[id] = appendExportsOfImportEqualsDeclaration(deferredExports[id], node);\n            }\n            else {\n                statements = appendExportsOfImportEqualsDeclaration(statements, node);\n            }\n            return ts.singleOrMany(statements);\n        }\n        /**\n         * Visits an ExportAssignment node.\n         *\n         * @param node The node to visit.\n         */\n        function visitExportAssignment(node) {\n            if (node.isExportEquals) {\n                // Elide `export=` as it is illegal in a SystemJS module.\n                return undefined;\n            }\n            var expression = ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression);\n            var original = node.original;\n            if (original && hasAssociatedEndOfDeclarationMarker(original)) {\n                // Defer exports until we encounter an EndOfDeclarationMarker node\n                var id = ts.getOriginalNodeId(node);\n                deferredExports[id] = appendExportStatement(deferredExports[id], factory.createIdentifier(\"default\"), expression, /*allowComments*/ true);\n            }\n            else {\n                return createExportStatement(factory.createIdentifier(\"default\"), expression, /*allowComments*/ true);\n            }\n        }\n        /**\n         * Visits a FunctionDeclaration, hoisting it to the outer module body function.\n         *\n         * @param node The node to visit.\n         */\n        function visitFunctionDeclaration(node) {\n            if (ts.hasSyntacticModifier(node, 1 /* Export */)) {\n                hoistedStatements = ts.append(hoistedStatements, factory.updateFunctionDeclaration(node, node.decorators, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, factory.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true), \n                /*typeParameters*/ undefined, ts.visitNodes(node.parameters, destructuringAndImportCallVisitor, ts.isParameterDeclaration), \n                /*type*/ undefined, ts.visitNode(node.body, destructuringAndImportCallVisitor, ts.isBlock)));\n            }\n            else {\n                hoistedStatements = ts.append(hoistedStatements, ts.visitEachChild(node, destructuringAndImportCallVisitor, context));\n            }\n            if (hasAssociatedEndOfDeclarationMarker(node)) {\n                // Defer exports until we encounter an EndOfDeclarationMarker node\n                var id = ts.getOriginalNodeId(node);\n                deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node);\n            }\n            else {\n                hoistedStatements = appendExportsOfHoistedDeclaration(hoistedStatements, node);\n            }\n            return undefined;\n        }\n        /**\n         * Visits a ClassDeclaration, hoisting its name to the outer module body function.\n         *\n         * @param node The node to visit.\n         */\n        function visitClassDeclaration(node) {\n            var statements;\n            // Hoist the name of the class declaration to the outer module body function.\n            var name = factory.getLocalName(node);\n            hoistVariableDeclaration(name);\n            // Rewrite the class declaration into an assignment of a class expression.\n            statements = ts.append(statements, ts.setTextRange(factory.createExpressionStatement(factory.createAssignment(name, ts.setTextRange(factory.createClassExpression(ts.visitNodes(node.decorators, destructuringAndImportCallVisitor, ts.isDecorator), \n            /*modifiers*/ undefined, node.name, \n            /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, destructuringAndImportCallVisitor, ts.isHeritageClause), ts.visitNodes(node.members, destructuringAndImportCallVisitor, ts.isClassElement)), node))), node));\n            if (hasAssociatedEndOfDeclarationMarker(node)) {\n                // Defer exports until we encounter an EndOfDeclarationMarker node\n                var id = ts.getOriginalNodeId(node);\n                deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node);\n            }\n            else {\n                statements = appendExportsOfHoistedDeclaration(statements, node);\n            }\n            return ts.singleOrMany(statements);\n        }\n        /**\n         * Visits a variable statement, hoisting declared names to the top-level module body.\n         * Each declaration is rewritten into an assignment expression.\n         *\n         * @param node The node to visit.\n         */\n        function visitVariableStatement(node) {\n            if (!shouldHoistVariableDeclarationList(node.declarationList)) {\n                return ts.visitNode(node, destructuringAndImportCallVisitor, ts.isStatement);\n            }\n            var expressions;\n            var isExportedDeclaration = ts.hasSyntacticModifier(node, 1 /* Export */);\n            var isMarkedDeclaration = hasAssociatedEndOfDeclarationMarker(node);\n            for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {\n                var variable = _a[_i];\n                if (variable.initializer) {\n                    expressions = ts.append(expressions, transformInitializedVariable(variable, isExportedDeclaration && !isMarkedDeclaration));\n                }\n                else {\n                    hoistBindingElement(variable);\n                }\n            }\n            var statements;\n            if (expressions) {\n                statements = ts.append(statements, ts.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(expressions)), node));\n            }\n            if (isMarkedDeclaration) {\n                // Defer exports until we encounter an EndOfDeclarationMarker node\n                var id = ts.getOriginalNodeId(node);\n                deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node, isExportedDeclaration);\n            }\n            else {\n                statements = appendExportsOfVariableStatement(statements, node, /*exportSelf*/ false);\n            }\n            return ts.singleOrMany(statements);\n        }\n        /**\n         * Hoists the declared names of a VariableDeclaration or BindingElement.\n         *\n         * @param node The declaration to hoist.\n         */\n        function hoistBindingElement(node) {\n            if (ts.isBindingPattern(node.name)) {\n                for (var _i = 0, _a = node.name.elements; _i < _a.length; _i++) {\n                    var element = _a[_i];\n                    if (!ts.isOmittedExpression(element)) {\n                        hoistBindingElement(element);\n                    }\n                }\n            }\n            else {\n                hoistVariableDeclaration(factory.cloneNode(node.name));\n            }\n        }\n        /**\n         * Determines whether a VariableDeclarationList should be hoisted.\n         *\n         * @param node The node to test.\n         */\n        function shouldHoistVariableDeclarationList(node) {\n            // hoist only non-block scoped declarations or block scoped declarations parented by source file\n            return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0\n                && (enclosingBlockScopedContainer.kind === 297 /* SourceFile */\n                    || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0);\n        }\n        /**\n         * Transform an initialized variable declaration into an expression.\n         *\n         * @param node The node to transform.\n         * @param isExportedDeclaration A value indicating whether the variable is exported.\n         */\n        function transformInitializedVariable(node, isExportedDeclaration) {\n            var createAssignment = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment;\n            return ts.isBindingPattern(node.name)\n                ? ts.flattenDestructuringAssignment(node, destructuringAndImportCallVisitor, context, 0 /* All */, \n                /*needsValue*/ false, createAssignment)\n                : node.initializer ? createAssignment(node.name, ts.visitNode(node.initializer, destructuringAndImportCallVisitor, ts.isExpression)) : node.name;\n        }\n        /**\n         * Creates an assignment expression for an exported variable declaration.\n         *\n         * @param name The name of the variable.\n         * @param value The value of the variable's initializer.\n         * @param location The source map location for the assignment.\n         */\n        function createExportedVariableAssignment(name, value, location) {\n            return createVariableAssignment(name, value, location, /*isExportedDeclaration*/ true);\n        }\n        /**\n         * Creates an assignment expression for a non-exported variable declaration.\n         *\n         * @param name The name of the variable.\n         * @param value The value of the variable's initializer.\n         * @param location The source map location for the assignment.\n         */\n        function createNonExportedVariableAssignment(name, value, location) {\n            return createVariableAssignment(name, value, location, /*isExportedDeclaration*/ false);\n        }\n        /**\n         * Creates an assignment expression for a variable declaration.\n         *\n         * @param name The name of the variable.\n         * @param value The value of the variable's initializer.\n         * @param location The source map location for the assignment.\n         * @param isExportedDeclaration A value indicating whether the variable is exported.\n         */\n        function createVariableAssignment(name, value, location, isExportedDeclaration) {\n            hoistVariableDeclaration(factory.cloneNode(name));\n            return isExportedDeclaration\n                ? createExportExpression(name, preventSubstitution(ts.setTextRange(factory.createAssignment(name, value), location)))\n                : preventSubstitution(ts.setTextRange(factory.createAssignment(name, value), location));\n        }\n        /**\n         * Visits a MergeDeclarationMarker used as a placeholder for the beginning of a merged\n         * and transformed declaration.\n         *\n         * @param node The node to visit.\n         */\n        function visitMergeDeclarationMarker(node) {\n            // For an EnumDeclaration or ModuleDeclaration that merges with a preceeding\n            // declaration we do not emit a leading variable declaration. To preserve the\n            // begin/end semantics of the declararation and to properly handle exports\n            // we wrapped the leading variable declaration in a `MergeDeclarationMarker`.\n            //\n            // To balance the declaration, we defer the exports of the elided variable\n            // statement until we visit this declaration's `EndOfDeclarationMarker`.\n            if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 232 /* VariableStatement */) {\n                var id = ts.getOriginalNodeId(node);\n                var isExportedDeclaration = ts.hasSyntacticModifier(node.original, 1 /* Export */);\n                deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration);\n            }\n            return node;\n        }\n        /**\n         * Determines whether a node has an associated EndOfDeclarationMarker.\n         *\n         * @param node The node to test.\n         */\n        function hasAssociatedEndOfDeclarationMarker(node) {\n            return (ts.getEmitFlags(node) & 4194304 /* HasEndOfDeclarationMarker */) !== 0;\n        }\n        /**\n         * Visits a DeclarationMarker used as a placeholder for the end of a transformed\n         * declaration.\n         *\n         * @param node The node to visit.\n         */\n        function visitEndOfDeclarationMarker(node) {\n            // For some transformations we emit an `EndOfDeclarationMarker` to mark the actual\n            // end of the transformed declaration. We use this marker to emit any deferred exports\n            // of the declaration.\n            var id = ts.getOriginalNodeId(node);\n            var statements = deferredExports[id];\n            if (statements) {\n                delete deferredExports[id];\n                return ts.append(statements, node);\n            }\n            else {\n                var original = ts.getOriginalNode(node);\n                if (ts.isModuleOrEnumDeclaration(original)) {\n                    return ts.append(appendExportsOfDeclaration(statements, original), node);\n                }\n            }\n            return node;\n        }\n        /**\n         * Appends the exports of an ImportDeclaration to a statement list, returning the\n         * statement list.\n         *\n         * @param statements A statement list to which the down-level export statements are to be\n         * appended. If `statements` is `undefined`, a new array is allocated if statements are\n         * appended.\n         * @param decl The declaration whose exports are to be recorded.\n         */\n        function appendExportsOfImportDeclaration(statements, decl) {\n            if (moduleInfo.exportEquals) {\n                return statements;\n            }\n            var importClause = decl.importClause;\n            if (!importClause) {\n                return statements;\n            }\n            if (importClause.name) {\n                statements = appendExportsOfDeclaration(statements, importClause);\n            }\n            var namedBindings = importClause.namedBindings;\n            if (namedBindings) {\n                switch (namedBindings.kind) {\n                    case 263 /* NamespaceImport */:\n                        statements = appendExportsOfDeclaration(statements, namedBindings);\n                        break;\n                    case 264 /* NamedImports */:\n                        for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) {\n                            var importBinding = _a[_i];\n                            statements = appendExportsOfDeclaration(statements, importBinding);\n                        }\n                        break;\n                }\n            }\n            return statements;\n        }\n        /**\n         * Appends the export of an ImportEqualsDeclaration to a statement list, returning the\n         * statement list.\n         *\n         * @param statements A statement list to which the down-level export statements are to be\n         * appended. If `statements` is `undefined`, a new array is allocated if statements are\n         * appended.\n         * @param decl The declaration whose exports are to be recorded.\n         */\n        function appendExportsOfImportEqualsDeclaration(statements, decl) {\n            if (moduleInfo.exportEquals) {\n                return statements;\n            }\n            return appendExportsOfDeclaration(statements, decl);\n        }\n        /**\n         * Appends the exports of a VariableStatement to a statement list, returning the statement\n         * list.\n         *\n         * @param statements A statement list to which the down-level export statements are to be\n         * appended. If `statements` is `undefined`, a new array is allocated if statements are\n         * appended.\n         * @param node The VariableStatement whose exports are to be recorded.\n         * @param exportSelf A value indicating whether to also export each VariableDeclaration of\n         * `nodes` declaration list.\n         */\n        function appendExportsOfVariableStatement(statements, node, exportSelf) {\n            if (moduleInfo.exportEquals) {\n                return statements;\n            }\n            for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {\n                var decl = _a[_i];\n                if (decl.initializer || exportSelf) {\n                    statements = appendExportsOfBindingElement(statements, decl, exportSelf);\n                }\n            }\n            return statements;\n        }\n        /**\n         * Appends the exports of a VariableDeclaration or BindingElement to a statement list,\n         * returning the statement list.\n         *\n         * @param statements A statement list to which the down-level export statements are to be\n         * appended. If `statements` is `undefined`, a new array is allocated if statements are\n         * appended.\n         * @param decl The declaration whose exports are to be recorded.\n         * @param exportSelf A value indicating whether to also export the declaration itself.\n         */\n        function appendExportsOfBindingElement(statements, decl, exportSelf) {\n            if (moduleInfo.exportEquals) {\n                return statements;\n            }\n            if (ts.isBindingPattern(decl.name)) {\n                for (var _i = 0, _a = decl.name.elements; _i < _a.length; _i++) {\n                    var element = _a[_i];\n                    if (!ts.isOmittedExpression(element)) {\n                        statements = appendExportsOfBindingElement(statements, element, exportSelf);\n                    }\n                }\n            }\n            else if (!ts.isGeneratedIdentifier(decl.name)) {\n                var excludeName = void 0;\n                if (exportSelf) {\n                    statements = appendExportStatement(statements, decl.name, factory.getLocalName(decl));\n                    excludeName = ts.idText(decl.name);\n                }\n                statements = appendExportsOfDeclaration(statements, decl, excludeName);\n            }\n            return statements;\n        }\n        /**\n         * Appends the exports of a ClassDeclaration or FunctionDeclaration to a statement list,\n         * returning the statement list.\n         *\n         * @param statements A statement list to which the down-level export statements are to be\n         * appended. If `statements` is `undefined`, a new array is allocated if statements are\n         * appended.\n         * @param decl The declaration whose exports are to be recorded.\n         */\n        function appendExportsOfHoistedDeclaration(statements, decl) {\n            if (moduleInfo.exportEquals) {\n                return statements;\n            }\n            var excludeName;\n            if (ts.hasSyntacticModifier(decl, 1 /* Export */)) {\n                var exportName = ts.hasSyntacticModifier(decl, 512 /* Default */) ? factory.createStringLiteral(\"default\") : decl.name;\n                statements = appendExportStatement(statements, exportName, factory.getLocalName(decl));\n                excludeName = ts.getTextOfIdentifierOrLiteral(exportName);\n            }\n            if (decl.name) {\n                statements = appendExportsOfDeclaration(statements, decl, excludeName);\n            }\n            return statements;\n        }\n        /**\n         * Appends the exports of a declaration to a statement list, returning the statement list.\n         *\n         * @param statements A statement list to which the down-level export statements are to be\n         * appended. If `statements` is `undefined`, a new array is allocated if statements are\n         * appended.\n         * @param decl The declaration to export.\n         * @param excludeName An optional name to exclude from exports.\n         */\n        function appendExportsOfDeclaration(statements, decl, excludeName) {\n            if (moduleInfo.exportEquals) {\n                return statements;\n            }\n            var name = factory.getDeclarationName(decl);\n            var exportSpecifiers = moduleInfo.exportSpecifiers.get(ts.idText(name));\n            if (exportSpecifiers) {\n                for (var _i = 0, exportSpecifiers_2 = exportSpecifiers; _i < exportSpecifiers_2.length; _i++) {\n                    var exportSpecifier = exportSpecifiers_2[_i];\n                    if (exportSpecifier.name.escapedText !== excludeName) {\n                        statements = appendExportStatement(statements, exportSpecifier.name, name);\n                    }\n                }\n            }\n            return statements;\n        }\n        /**\n         * Appends the down-level representation of an export to a statement list, returning the\n         * statement list.\n         *\n         * @param statements A statement list to which the down-level export statements are to be\n         * appended. If `statements` is `undefined`, a new array is allocated if statements are\n         * appended.\n         * @param exportName The name of the export.\n         * @param expression The expression to export.\n         * @param allowComments Whether to allow comments on the export.\n         */\n        function appendExportStatement(statements, exportName, expression, allowComments) {\n            statements = ts.append(statements, createExportStatement(exportName, expression, allowComments));\n            return statements;\n        }\n        /**\n         * Creates a call to the current file's export function to export a value.\n         *\n         * @param name The bound name of the export.\n         * @param value The exported value.\n         * @param allowComments An optional value indicating whether to emit comments for the statement.\n         */\n        function createExportStatement(name, value, allowComments) {\n            var statement = factory.createExpressionStatement(createExportExpression(name, value));\n            ts.startOnNewLine(statement);\n            if (!allowComments) {\n                ts.setEmitFlags(statement, 1536 /* NoComments */);\n            }\n            return statement;\n        }\n        /**\n         * Creates a call to the current file's export function to export a value.\n         *\n         * @param name The bound name of the export.\n         * @param value The exported value.\n         */\n        function createExportExpression(name, value) {\n            var exportName = ts.isIdentifier(name) ? factory.createStringLiteralFromNode(name) : name;\n            ts.setEmitFlags(value, ts.getEmitFlags(value) | 1536 /* NoComments */);\n            return ts.setCommentRange(factory.createCallExpression(exportFunction, /*typeArguments*/ undefined, [exportName, value]), value);\n        }\n        //\n        // Top-Level or Nested Source Element Visitors\n        //\n        /**\n         * Visit nested elements at the top-level of a module.\n         *\n         * @param node The node to visit.\n         */\n        function nestedElementVisitor(node) {\n            switch (node.kind) {\n                case 232 /* VariableStatement */:\n                    return visitVariableStatement(node);\n                case 251 /* FunctionDeclaration */:\n                    return visitFunctionDeclaration(node);\n                case 252 /* ClassDeclaration */:\n                    return visitClassDeclaration(node);\n                case 237 /* ForStatement */:\n                    return visitForStatement(node);\n                case 238 /* ForInStatement */:\n                    return visitForInStatement(node);\n                case 239 /* ForOfStatement */:\n                    return visitForOfStatement(node);\n                case 235 /* DoStatement */:\n                    return visitDoStatement(node);\n                case 236 /* WhileStatement */:\n                    return visitWhileStatement(node);\n                case 245 /* LabeledStatement */:\n                    return visitLabeledStatement(node);\n                case 243 /* WithStatement */:\n                    return visitWithStatement(node);\n                case 244 /* SwitchStatement */:\n                    return visitSwitchStatement(node);\n                case 258 /* CaseBlock */:\n                    return visitCaseBlock(node);\n                case 284 /* CaseClause */:\n                    return visitCaseClause(node);\n                case 285 /* DefaultClause */:\n                    return visitDefaultClause(node);\n                case 247 /* TryStatement */:\n                    return visitTryStatement(node);\n                case 287 /* CatchClause */:\n                    return visitCatchClause(node);\n                case 230 /* Block */:\n                    return visitBlock(node);\n                case 338 /* MergeDeclarationMarker */:\n                    return visitMergeDeclarationMarker(node);\n                case 339 /* EndOfDeclarationMarker */:\n                    return visitEndOfDeclarationMarker(node);\n                default:\n                    return destructuringAndImportCallVisitor(node);\n            }\n        }\n        /**\n         * Visits the body of a ForStatement to hoist declarations.\n         *\n         * @param node The node to visit.\n         */\n        function visitForStatement(node) {\n            var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer;\n            enclosingBlockScopedContainer = node;\n            node = factory.updateForStatement(node, node.initializer && visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.incrementor, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement));\n            enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer;\n            return node;\n        }\n        /**\n         * Visits the body of a ForInStatement to hoist declarations.\n         *\n         * @param node The node to visit.\n         */\n        function visitForInStatement(node) {\n            var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer;\n            enclosingBlockScopedContainer = node;\n            node = factory.updateForInStatement(node, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, factory.liftToBlock));\n            enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer;\n            return node;\n        }\n        /**\n         * Visits the body of a ForOfStatement to hoist declarations.\n         *\n         * @param node The node to visit.\n         */\n        function visitForOfStatement(node) {\n            var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer;\n            enclosingBlockScopedContainer = node;\n            node = factory.updateForOfStatement(node, node.awaitModifier, visitForInitializer(node.initializer), ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, factory.liftToBlock));\n            enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer;\n            return node;\n        }\n        /**\n         * Determines whether to hoist the initializer of a ForStatement, ForInStatement, or\n         * ForOfStatement.\n         *\n         * @param node The node to test.\n         */\n        function shouldHoistForInitializer(node) {\n            return ts.isVariableDeclarationList(node)\n                && shouldHoistVariableDeclarationList(node);\n        }\n        /**\n         * Visits the initializer of a ForStatement, ForInStatement, or ForOfStatement\n         *\n         * @param node The node to visit.\n         */\n        function visitForInitializer(node) {\n            if (shouldHoistForInitializer(node)) {\n                var expressions = void 0;\n                for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) {\n                    var variable = _a[_i];\n                    expressions = ts.append(expressions, transformInitializedVariable(variable, /*isExportedDeclaration*/ false));\n                    if (!variable.initializer) {\n                        hoistBindingElement(variable);\n                    }\n                }\n                return expressions ? factory.inlineExpressions(expressions) : factory.createOmittedExpression();\n            }\n            else {\n                return ts.visitEachChild(node, nestedElementVisitor, context);\n            }\n        }\n        /**\n         * Visits the body of a DoStatement to hoist declarations.\n         *\n         * @param node The node to visit.\n         */\n        function visitDoStatement(node) {\n            return factory.updateDoStatement(node, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, factory.liftToBlock), ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression));\n        }\n        /**\n         * Visits the body of a WhileStatement to hoist declarations.\n         *\n         * @param node The node to visit.\n         */\n        function visitWhileStatement(node) {\n            return factory.updateWhileStatement(node, ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, factory.liftToBlock));\n        }\n        /**\n         * Visits the body of a LabeledStatement to hoist declarations.\n         *\n         * @param node The node to visit.\n         */\n        function visitLabeledStatement(node) {\n            return factory.updateLabeledStatement(node, node.label, ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, factory.liftToBlock));\n        }\n        /**\n         * Visits the body of a WithStatement to hoist declarations.\n         *\n         * @param node The node to visit.\n         */\n        function visitWithStatement(node) {\n            return factory.updateWithStatement(node, ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement, factory.liftToBlock));\n        }\n        /**\n         * Visits the body of a SwitchStatement to hoist declarations.\n         *\n         * @param node The node to visit.\n         */\n        function visitSwitchStatement(node) {\n            return factory.updateSwitchStatement(node, ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.caseBlock, nestedElementVisitor, ts.isCaseBlock));\n        }\n        /**\n         * Visits the body of a CaseBlock to hoist declarations.\n         *\n         * @param node The node to visit.\n         */\n        function visitCaseBlock(node) {\n            var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer;\n            enclosingBlockScopedContainer = node;\n            node = factory.updateCaseBlock(node, ts.visitNodes(node.clauses, nestedElementVisitor, ts.isCaseOrDefaultClause));\n            enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer;\n            return node;\n        }\n        /**\n         * Visits the body of a CaseClause to hoist declarations.\n         *\n         * @param node The node to visit.\n         */\n        function visitCaseClause(node) {\n            return factory.updateCaseClause(node, ts.visitNode(node.expression, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNodes(node.statements, nestedElementVisitor, ts.isStatement));\n        }\n        /**\n         * Visits the body of a DefaultClause to hoist declarations.\n         *\n         * @param node The node to visit.\n         */\n        function visitDefaultClause(node) {\n            return ts.visitEachChild(node, nestedElementVisitor, context);\n        }\n        /**\n         * Visits the body of a TryStatement to hoist declarations.\n         *\n         * @param node The node to visit.\n         */\n        function visitTryStatement(node) {\n            return ts.visitEachChild(node, nestedElementVisitor, context);\n        }\n        /**\n         * Visits the body of a CatchClause to hoist declarations.\n         *\n         * @param node The node to visit.\n         */\n        function visitCatchClause(node) {\n            var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer;\n            enclosingBlockScopedContainer = node;\n            node = factory.updateCatchClause(node, node.variableDeclaration, ts.visitNode(node.block, nestedElementVisitor, ts.isBlock));\n            enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer;\n            return node;\n        }\n        /**\n         * Visits the body of a Block to hoist declarations.\n         *\n         * @param node The node to visit.\n         */\n        function visitBlock(node) {\n            var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer;\n            enclosingBlockScopedContainer = node;\n            node = ts.visitEachChild(node, nestedElementVisitor, context);\n            enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer;\n            return node;\n        }\n        //\n        // Destructuring Assignment Visitors\n        //\n        /**\n         * Visit nodes to flatten destructuring assignments to exported symbols.\n         *\n         * @param node The node to visit.\n         */\n        function destructuringAndImportCallVisitor(node) {\n            if (ts.isDestructuringAssignment(node)) {\n                return visitDestructuringAssignment(node);\n            }\n            else if (ts.isImportCall(node)) {\n                return visitImportCallExpression(node);\n            }\n            else if ((node.transformFlags & 1024 /* ContainsDestructuringAssignment */) || (node.transformFlags & 2097152 /* ContainsDynamicImport */)) {\n                return ts.visitEachChild(node, destructuringAndImportCallVisitor, context);\n            }\n            else {\n                return node;\n            }\n        }\n        function visitImportCallExpression(node) {\n            // import(\"./blah\")\n            // emit as\n            // System.register([], function (_export, _context) {\n            //     return {\n            //         setters: [],\n            //         execute: () => {\n            //             _context.import('./blah');\n            //         }\n            //     };\n            // });\n            var externalModuleName = ts.getExternalModuleNameLiteral(factory, node, currentSourceFile, host, resolver, compilerOptions);\n            var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), destructuringAndImportCallVisitor);\n            // Only use the external module name if it differs from the first argument. This allows us to preserve the quote style of the argument on output.\n            var argument = externalModuleName && (!firstArgument || !ts.isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument;\n            return factory.createCallExpression(factory.createPropertyAccessExpression(contextObject, factory.createIdentifier(\"import\")), \n            /*typeArguments*/ undefined, argument ? [argument] : []);\n        }\n        /**\n         * Visits a DestructuringAssignment to flatten destructuring to exported symbols.\n         *\n         * @param node The node to visit.\n         */\n        function visitDestructuringAssignment(node) {\n            if (hasExportedReferenceInDestructuringTarget(node.left)) {\n                return ts.flattenDestructuringAssignment(node, destructuringAndImportCallVisitor, context, 0 /* All */, \n                /*needsValue*/ true);\n            }\n            return ts.visitEachChild(node, destructuringAndImportCallVisitor, context);\n        }\n        /**\n         * Determines whether the target of a destructuring assigment refers to an exported symbol.\n         *\n         * @param node The destructuring target.\n         */\n        function hasExportedReferenceInDestructuringTarget(node) {\n            if (ts.isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) {\n                return hasExportedReferenceInDestructuringTarget(node.left);\n            }\n            else if (ts.isSpreadElement(node)) {\n                return hasExportedReferenceInDestructuringTarget(node.expression);\n            }\n            else if (ts.isObjectLiteralExpression(node)) {\n                return ts.some(node.properties, hasExportedReferenceInDestructuringTarget);\n            }\n            else if (ts.isArrayLiteralExpression(node)) {\n                return ts.some(node.elements, hasExportedReferenceInDestructuringTarget);\n            }\n            else if (ts.isShorthandPropertyAssignment(node)) {\n                return hasExportedReferenceInDestructuringTarget(node.name);\n            }\n            else if (ts.isPropertyAssignment(node)) {\n                return hasExportedReferenceInDestructuringTarget(node.initializer);\n            }\n            else if (ts.isIdentifier(node)) {\n                var container = resolver.getReferencedExportContainer(node);\n                return container !== undefined && container.kind === 297 /* SourceFile */;\n            }\n            else {\n                return false;\n            }\n        }\n        //\n        // Modifier Visitors\n        //\n        /**\n         * Visit nodes to elide module-specific modifiers.\n         *\n         * @param node The node to visit.\n         */\n        function modifierVisitor(node) {\n            switch (node.kind) {\n                case 92 /* ExportKeyword */:\n                case 87 /* DefaultKeyword */:\n                    return undefined;\n            }\n            return node;\n        }\n        //\n        // Emit Notification\n        //\n        /**\n         * Hook for node emit notifications.\n         *\n         * @param hint A hint as to the intended usage of the node.\n         * @param node The node to emit.\n         * @param emitCallback A callback used to emit the node in the printer.\n         */\n        function onEmitNode(hint, node, emitCallback) {\n            if (node.kind === 297 /* SourceFile */) {\n                var id = ts.getOriginalNodeId(node);\n                currentSourceFile = node;\n                moduleInfo = moduleInfoMap[id];\n                exportFunction = exportFunctionsMap[id];\n                noSubstitution = noSubstitutionMap[id];\n                contextObject = contextObjectMap[id];\n                if (noSubstitution) {\n                    delete noSubstitutionMap[id];\n                }\n                previousOnEmitNode(hint, node, emitCallback);\n                currentSourceFile = undefined;\n                moduleInfo = undefined;\n                exportFunction = undefined;\n                contextObject = undefined;\n                noSubstitution = undefined;\n            }\n            else {\n                previousOnEmitNode(hint, node, emitCallback);\n            }\n        }\n        //\n        // Substitutions\n        //\n        /**\n         * Hooks node substitutions.\n         *\n         * @param hint A hint as to the intended usage of the node.\n         * @param node The node to substitute.\n         */\n        function onSubstituteNode(hint, node) {\n            node = previousOnSubstituteNode(hint, node);\n            if (isSubstitutionPrevented(node)) {\n                return node;\n            }\n            if (hint === 1 /* Expression */) {\n                return substituteExpression(node);\n            }\n            else if (hint === 4 /* Unspecified */) {\n                return substituteUnspecified(node);\n            }\n            return node;\n        }\n        /**\n         * Substitute the node, if necessary.\n         *\n         * @param node The node to substitute.\n         */\n        function substituteUnspecified(node) {\n            switch (node.kind) {\n                case 289 /* ShorthandPropertyAssignment */:\n                    return substituteShorthandPropertyAssignment(node);\n            }\n            return node;\n        }\n        /**\n         * Substitution for a ShorthandPropertyAssignment whose name that may contain an imported or exported symbol.\n         *\n         * @param node The node to substitute.\n         */\n        function substituteShorthandPropertyAssignment(node) {\n            var _a, _b;\n            var name = node.name;\n            if (!ts.isGeneratedIdentifier(name) && !ts.isLocalName(name)) {\n                var importDeclaration = resolver.getReferencedImportDeclaration(name);\n                if (importDeclaration) {\n                    if (ts.isImportClause(importDeclaration)) {\n                        return ts.setTextRange(factory.createPropertyAssignment(factory.cloneNode(name), factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(importDeclaration.parent), factory.createIdentifier(\"default\"))), \n                        /*location*/ node);\n                    }\n                    else if (ts.isImportSpecifier(importDeclaration)) {\n                        return ts.setTextRange(factory.createPropertyAssignment(factory.cloneNode(name), factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent) || importDeclaration), factory.cloneNode(importDeclaration.propertyName || importDeclaration.name))), \n                        /*location*/ node);\n                    }\n                }\n            }\n            return node;\n        }\n        /**\n         * Substitute the expression, if necessary.\n         *\n         * @param node The node to substitute.\n         */\n        function substituteExpression(node) {\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                    return substituteExpressionIdentifier(node);\n                case 216 /* BinaryExpression */:\n                    return substituteBinaryExpression(node);\n                case 214 /* PrefixUnaryExpression */:\n                case 215 /* PostfixUnaryExpression */:\n                    return substituteUnaryExpression(node);\n                case 226 /* MetaProperty */:\n                    return substituteMetaProperty(node);\n            }\n            return node;\n        }\n        /**\n         * Substitution for an Identifier expression that may contain an imported or exported symbol.\n         *\n         * @param node The node to substitute.\n         */\n        function substituteExpressionIdentifier(node) {\n            var _a, _b;\n            if (ts.getEmitFlags(node) & 4096 /* HelperName */) {\n                var externalHelpersModuleName = ts.getExternalHelpersModuleName(currentSourceFile);\n                if (externalHelpersModuleName) {\n                    return factory.createPropertyAccessExpression(externalHelpersModuleName, node);\n                }\n                return node;\n            }\n            // When we see an identifier in an expression position that\n            // points to an imported symbol, we should substitute a qualified\n            // reference to the imported symbol if one is needed.\n            //\n            // - We do not substitute generated identifiers for any reason.\n            // - We do not substitute identifiers tagged with the LocalName flag.\n            if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) {\n                var importDeclaration = resolver.getReferencedImportDeclaration(node);\n                if (importDeclaration) {\n                    if (ts.isImportClause(importDeclaration)) {\n                        return ts.setTextRange(factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(importDeclaration.parent), factory.createIdentifier(\"default\")), \n                        /*location*/ node);\n                    }\n                    else if (ts.isImportSpecifier(importDeclaration)) {\n                        return ts.setTextRange(factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent) || importDeclaration), factory.cloneNode(importDeclaration.propertyName || importDeclaration.name)), \n                        /*location*/ node);\n                    }\n                }\n            }\n            return node;\n        }\n        /**\n         * Substitution for a BinaryExpression that may contain an imported or exported symbol.\n         *\n         * @param node The node to substitute.\n         */\n        function substituteBinaryExpression(node) {\n            // When we see an assignment expression whose left-hand side is an exported symbol,\n            // we should ensure all exports of that symbol are updated with the correct value.\n            //\n            // - We do not substitute generated identifiers for any reason.\n            // - We do not substitute identifiers tagged with the LocalName flag.\n            // - We do not substitute identifiers that were originally the name of an enum or\n            //   namespace due to how they are transformed in TypeScript.\n            // - We only substitute identifiers that are exported at the top level.\n            if (ts.isAssignmentOperator(node.operatorToken.kind)\n                && ts.isIdentifier(node.left)\n                && !ts.isGeneratedIdentifier(node.left)\n                && !ts.isLocalName(node.left)\n                && !ts.isDeclarationNameOfEnumOrNamespace(node.left)) {\n                var exportedNames = getExports(node.left);\n                if (exportedNames) {\n                    // For each additional export of the declaration, apply an export assignment.\n                    var expression = node;\n                    for (var _i = 0, exportedNames_4 = exportedNames; _i < exportedNames_4.length; _i++) {\n                        var exportName = exportedNames_4[_i];\n                        expression = createExportExpression(exportName, preventSubstitution(expression));\n                    }\n                    return expression;\n                }\n            }\n            return node;\n        }\n        /**\n         * Substitution for a UnaryExpression that may contain an imported or exported symbol.\n         *\n         * @param node The node to substitute.\n         */\n        function substituteUnaryExpression(node) {\n            // When we see a prefix or postfix increment expression whose operand is an exported\n            // symbol, we should ensure all exports of that symbol are updated with the correct\n            // value.\n            //\n            // - We do not substitute generated identifiers for any reason.\n            // - We do not substitute identifiers tagged with the LocalName flag.\n            // - We do not substitute identifiers that were originally the name of an enum or\n            //   namespace due to how they are transformed in TypeScript.\n            // - We only substitute identifiers that are exported at the top level.\n            if ((node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */)\n                && ts.isIdentifier(node.operand)\n                && !ts.isGeneratedIdentifier(node.operand)\n                && !ts.isLocalName(node.operand)\n                && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) {\n                var exportedNames = getExports(node.operand);\n                if (exportedNames) {\n                    var expression = node.kind === 215 /* PostfixUnaryExpression */\n                        ? ts.setTextRange(factory.createPrefixUnaryExpression(node.operator, node.operand), node)\n                        : node;\n                    for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) {\n                        var exportName = exportedNames_5[_i];\n                        expression = createExportExpression(exportName, preventSubstitution(expression));\n                    }\n                    if (node.kind === 215 /* PostfixUnaryExpression */) {\n                        expression = node.operator === 45 /* PlusPlusToken */\n                            ? factory.createSubtract(preventSubstitution(expression), factory.createNumericLiteral(1))\n                            : factory.createAdd(preventSubstitution(expression), factory.createNumericLiteral(1));\n                    }\n                    return expression;\n                }\n            }\n            return node;\n        }\n        function substituteMetaProperty(node) {\n            if (ts.isImportMeta(node)) {\n                return factory.createPropertyAccessExpression(contextObject, factory.createIdentifier(\"meta\"));\n            }\n            return node;\n        }\n        /**\n         * Gets the exports of a name.\n         *\n         * @param name The name.\n         */\n        function getExports(name) {\n            var exportedNames;\n            if (!ts.isGeneratedIdentifier(name)) {\n                var valueDeclaration = resolver.getReferencedImportDeclaration(name)\n                    || resolver.getReferencedValueDeclaration(name);\n                if (valueDeclaration) {\n                    var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false);\n                    if (exportContainer && exportContainer.kind === 297 /* SourceFile */) {\n                        exportedNames = ts.append(exportedNames, factory.getDeclarationName(valueDeclaration));\n                    }\n                    exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]);\n                }\n            }\n            return exportedNames;\n        }\n        /**\n         * Prevent substitution of a node for this transformer.\n         *\n         * @param node The node which should not be substituted.\n         */\n        function preventSubstitution(node) {\n            if (noSubstitution === undefined)\n                noSubstitution = [];\n            noSubstitution[ts.getNodeId(node)] = true;\n            return node;\n        }\n        /**\n         * Determines whether a node should not be substituted.\n         *\n         * @param node The node to test.\n         */\n        function isSubstitutionPrevented(node) {\n            return noSubstitution && node.id && noSubstitution[node.id];\n        }\n    }\n    ts.transformSystemModule = transformSystemModule;\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    function transformECMAScriptModule(context) {\n        var factory = context.factory, emitHelpers = context.getEmitHelperFactory;\n        var compilerOptions = context.getCompilerOptions();\n        var previousOnEmitNode = context.onEmitNode;\n        var previousOnSubstituteNode = context.onSubstituteNode;\n        context.onEmitNode = onEmitNode;\n        context.onSubstituteNode = onSubstituteNode;\n        context.enableEmitNotification(297 /* SourceFile */);\n        context.enableSubstitution(78 /* Identifier */);\n        var helperNameSubstitutions;\n        return ts.chainBundle(context, transformSourceFile);\n        function transformSourceFile(node) {\n            if (node.isDeclarationFile) {\n                return node;\n            }\n            if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {\n                var result = updateExternalModule(node);\n                if (!ts.isExternalModule(node) || ts.some(result.statements, ts.isExternalModuleIndicator)) {\n                    return result;\n                }\n                return factory.updateSourceFile(result, ts.setTextRange(factory.createNodeArray(__spreadArray(__spreadArray([], result.statements), [ts.createEmptyExports(factory)])), result.statements));\n            }\n            return node;\n        }\n        function updateExternalModule(node) {\n            var externalHelpersImportDeclaration = ts.createExternalHelpersImportDeclarationIfNeeded(factory, emitHelpers(), node, compilerOptions);\n            if (externalHelpersImportDeclaration) {\n                var statements = [];\n                var statementOffset = factory.copyPrologue(node.statements, statements);\n                ts.append(statements, externalHelpersImportDeclaration);\n                ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset));\n                return factory.updateSourceFile(node, ts.setTextRange(factory.createNodeArray(statements), node.statements));\n            }\n            else {\n                return ts.visitEachChild(node, visitor, context);\n            }\n        }\n        function visitor(node) {\n            switch (node.kind) {\n                case 260 /* ImportEqualsDeclaration */:\n                    // Elide `import=` as it is not legal with --module ES6\n                    return undefined;\n                case 266 /* ExportAssignment */:\n                    return visitExportAssignment(node);\n                case 267 /* ExportDeclaration */:\n                    var exportDecl = node;\n                    return visitExportDeclaration(exportDecl);\n            }\n            return node;\n        }\n        function visitExportAssignment(node) {\n            // Elide `export=` as it is not legal with --module ES6\n            return node.isExportEquals ? undefined : node;\n        }\n        function visitExportDeclaration(node) {\n            // `export * as ns` only needs to be transformed in ES2015\n            if (compilerOptions.module !== undefined && compilerOptions.module > ts.ModuleKind.ES2015) {\n                return node;\n            }\n            // Either ill-formed or don't need to be tranformed.\n            if (!node.exportClause || !ts.isNamespaceExport(node.exportClause) || !node.moduleSpecifier) {\n                return node;\n            }\n            var oldIdentifier = node.exportClause.name;\n            var synthName = factory.getGeneratedNameForNode(oldIdentifier);\n            var importDecl = factory.createImportDeclaration(\n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, factory.createImportClause(\n            /*isTypeOnly*/ false, \n            /*name*/ undefined, factory.createNamespaceImport(synthName)), node.moduleSpecifier);\n            ts.setOriginalNode(importDecl, node.exportClause);\n            var exportDecl = ts.isExportNamespaceAsDefaultDeclaration(node) ? factory.createExportDefault(synthName) : factory.createExportDeclaration(\n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, \n            /*isTypeOnly*/ false, factory.createNamedExports([factory.createExportSpecifier(synthName, oldIdentifier)]));\n            ts.setOriginalNode(exportDecl, node);\n            return [importDecl, exportDecl];\n        }\n        //\n        // Emit Notification\n        //\n        /**\n         * Hook for node emit.\n         *\n         * @param hint A hint as to the intended usage of the node.\n         * @param node The node to emit.\n         * @param emit A callback used to emit the node in the printer.\n         */\n        function onEmitNode(hint, node, emitCallback) {\n            if (ts.isSourceFile(node)) {\n                if ((ts.isExternalModule(node) || compilerOptions.isolatedModules) && compilerOptions.importHelpers) {\n                    helperNameSubstitutions = new ts.Map();\n                }\n                previousOnEmitNode(hint, node, emitCallback);\n                helperNameSubstitutions = undefined;\n            }\n            else {\n                previousOnEmitNode(hint, node, emitCallback);\n            }\n        }\n        //\n        // Substitutions\n        //\n        /**\n         * Hooks node substitutions.\n         *\n         * @param hint A hint as to the intended usage of the node.\n         * @param node The node to substitute.\n         */\n        function onSubstituteNode(hint, node) {\n            node = previousOnSubstituteNode(hint, node);\n            if (helperNameSubstitutions && ts.isIdentifier(node) && ts.getEmitFlags(node) & 4096 /* HelperName */) {\n                return substituteHelperName(node);\n            }\n            return node;\n        }\n        function substituteHelperName(node) {\n            var name = ts.idText(node);\n            var substitution = helperNameSubstitutions.get(name);\n            if (!substitution) {\n                helperNameSubstitutions.set(name, substitution = factory.createUniqueName(name, 16 /* Optimistic */ | 32 /* FileLevel */));\n            }\n            return substitution;\n        }\n    }\n    ts.transformECMAScriptModule = transformECMAScriptModule;\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    function canProduceDiagnostics(node) {\n        return ts.isVariableDeclaration(node) ||\n            ts.isPropertyDeclaration(node) ||\n            ts.isPropertySignature(node) ||\n            ts.isBindingElement(node) ||\n            ts.isSetAccessor(node) ||\n            ts.isGetAccessor(node) ||\n            ts.isConstructSignatureDeclaration(node) ||\n            ts.isCallSignatureDeclaration(node) ||\n            ts.isMethodDeclaration(node) ||\n            ts.isMethodSignature(node) ||\n            ts.isFunctionDeclaration(node) ||\n            ts.isParameter(node) ||\n            ts.isTypeParameterDeclaration(node) ||\n            ts.isExpressionWithTypeArguments(node) ||\n            ts.isImportEqualsDeclaration(node) ||\n            ts.isTypeAliasDeclaration(node) ||\n            ts.isConstructorDeclaration(node) ||\n            ts.isIndexSignatureDeclaration(node) ||\n            ts.isPropertyAccessExpression(node) ||\n            ts.isJSDocTypeAlias(node);\n    }\n    ts.canProduceDiagnostics = canProduceDiagnostics;\n    function createGetSymbolAccessibilityDiagnosticForNodeName(node) {\n        if (ts.isSetAccessor(node) || ts.isGetAccessor(node)) {\n            return getAccessorNameVisibilityError;\n        }\n        else if (ts.isMethodSignature(node) || ts.isMethodDeclaration(node)) {\n            return getMethodNameVisibilityError;\n        }\n        else {\n            return createGetSymbolAccessibilityDiagnosticForNode(node);\n        }\n        function getAccessorNameVisibilityError(symbolAccessibilityResult) {\n            var diagnosticMessage = getAccessorNameVisibilityDiagnosticMessage(symbolAccessibilityResult);\n            return diagnosticMessage !== undefined ? {\n                diagnosticMessage: diagnosticMessage,\n                errorNode: node,\n                typeName: node.name\n            } : undefined;\n        }\n        function getAccessorNameVisibilityDiagnosticMessage(symbolAccessibilityResult) {\n            if (ts.hasSyntacticModifier(node, 32 /* Static */)) {\n                return symbolAccessibilityResult.errorModuleName ?\n                    symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                        ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :\n                        ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :\n                    ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;\n            }\n            else if (node.parent.kind === 252 /* ClassDeclaration */) {\n                return symbolAccessibilityResult.errorModuleName ?\n                    symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                        ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :\n                        ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :\n                    ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1;\n            }\n            else {\n                return symbolAccessibilityResult.errorModuleName ?\n                    ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 :\n                    ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1;\n            }\n        }\n        function getMethodNameVisibilityError(symbolAccessibilityResult) {\n            var diagnosticMessage = getMethodNameVisibilityDiagnosticMessage(symbolAccessibilityResult);\n            return diagnosticMessage !== undefined ? {\n                diagnosticMessage: diagnosticMessage,\n                errorNode: node,\n                typeName: node.name\n            } : undefined;\n        }\n        function getMethodNameVisibilityDiagnosticMessage(symbolAccessibilityResult) {\n            if (ts.hasSyntacticModifier(node, 32 /* Static */)) {\n                return symbolAccessibilityResult.errorModuleName ?\n                    symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                        ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :\n                        ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :\n                    ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1;\n            }\n            else if (node.parent.kind === 252 /* ClassDeclaration */) {\n                return symbolAccessibilityResult.errorModuleName ?\n                    symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                        ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :\n                        ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :\n                    ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1;\n            }\n            else {\n                return symbolAccessibilityResult.errorModuleName ?\n                    ts.Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 :\n                    ts.Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1;\n            }\n        }\n    }\n    ts.createGetSymbolAccessibilityDiagnosticForNodeName = createGetSymbolAccessibilityDiagnosticForNodeName;\n    function createGetSymbolAccessibilityDiagnosticForNode(node) {\n        if (ts.isVariableDeclaration(node) || ts.isPropertyDeclaration(node) || ts.isPropertySignature(node) || ts.isPropertyAccessExpression(node) || ts.isBindingElement(node) || ts.isConstructorDeclaration(node)) {\n            return getVariableDeclarationTypeVisibilityError;\n        }\n        else if (ts.isSetAccessor(node) || ts.isGetAccessor(node)) {\n            return getAccessorDeclarationTypeVisibilityError;\n        }\n        else if (ts.isConstructSignatureDeclaration(node) || ts.isCallSignatureDeclaration(node) || ts.isMethodDeclaration(node) || ts.isMethodSignature(node) || ts.isFunctionDeclaration(node) || ts.isIndexSignatureDeclaration(node)) {\n            return getReturnTypeVisibilityError;\n        }\n        else if (ts.isParameter(node)) {\n            if (ts.isParameterPropertyDeclaration(node, node.parent) && ts.hasSyntacticModifier(node.parent, 8 /* Private */)) {\n                return getVariableDeclarationTypeVisibilityError;\n            }\n            return getParameterDeclarationTypeVisibilityError;\n        }\n        else if (ts.isTypeParameterDeclaration(node)) {\n            return getTypeParameterConstraintVisibilityError;\n        }\n        else if (ts.isExpressionWithTypeArguments(node)) {\n            return getHeritageClauseVisibilityError;\n        }\n        else if (ts.isImportEqualsDeclaration(node)) {\n            return getImportEntityNameVisibilityError;\n        }\n        else if (ts.isTypeAliasDeclaration(node) || ts.isJSDocTypeAlias(node)) {\n            return getTypeAliasDeclarationVisibilityError;\n        }\n        else {\n            return ts.Debug.assertNever(node, \"Attempted to set a declaration diagnostic context for unhandled node kind: \" + ts.SyntaxKind[node.kind]);\n        }\n        function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {\n            if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) {\n                return symbolAccessibilityResult.errorModuleName ?\n                    symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                        ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :\n                        ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 :\n                    ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;\n            }\n            // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit\n            // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all.\n            else if (node.kind === 163 /* PropertyDeclaration */ || node.kind === 201 /* PropertyAccessExpression */ || node.kind === 162 /* PropertySignature */ ||\n                (node.kind === 160 /* Parameter */ && ts.hasSyntacticModifier(node.parent, 8 /* Private */))) {\n                // TODO(jfreeman): Deal with computed properties in error reporting.\n                if (ts.hasSyntacticModifier(node, 32 /* Static */)) {\n                    return symbolAccessibilityResult.errorModuleName ?\n                        symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                            ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :\n                            ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :\n                        ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;\n                }\n                else if (node.parent.kind === 252 /* ClassDeclaration */ || node.kind === 160 /* Parameter */) {\n                    return symbolAccessibilityResult.errorModuleName ?\n                        symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                            ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :\n                            ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 :\n                        ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1;\n                }\n                else {\n                    // Interfaces cannot have types that cannot be named\n                    return symbolAccessibilityResult.errorModuleName ?\n                        ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 :\n                        ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1;\n                }\n            }\n        }\n        function getVariableDeclarationTypeVisibilityError(symbolAccessibilityResult) {\n            var diagnosticMessage = getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult);\n            return diagnosticMessage !== undefined ? {\n                diagnosticMessage: diagnosticMessage,\n                errorNode: node,\n                typeName: node.name\n            } : undefined;\n        }\n        function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) {\n            var diagnosticMessage;\n            if (node.kind === 168 /* SetAccessor */) {\n                // Getters can infer the return type from the returned expression, but setters cannot, so the\n                // \"_from_external_module_1_but_cannot_be_named\" case cannot occur.\n                if (ts.hasSyntacticModifier(node, 32 /* Static */)) {\n                    diagnosticMessage = symbolAccessibilityResult.errorModuleName ?\n                        ts.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 :\n                        ts.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1;\n                }\n                else {\n                    diagnosticMessage = symbolAccessibilityResult.errorModuleName ?\n                        ts.Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 :\n                        ts.Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1;\n                }\n            }\n            else {\n                if (ts.hasSyntacticModifier(node, 32 /* Static */)) {\n                    diagnosticMessage = symbolAccessibilityResult.errorModuleName ?\n                        symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                            ts.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :\n                            ts.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 :\n                        ts.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1;\n                }\n                else {\n                    diagnosticMessage = symbolAccessibilityResult.errorModuleName ?\n                        symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                            ts.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :\n                            ts.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 :\n                        ts.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1;\n                }\n            }\n            return {\n                diagnosticMessage: diagnosticMessage,\n                errorNode: node.name,\n                typeName: node.name\n            };\n        }\n        function getReturnTypeVisibilityError(symbolAccessibilityResult) {\n            var diagnosticMessage;\n            switch (node.kind) {\n                case 170 /* ConstructSignature */:\n                    // Interfaces cannot have return types that cannot be named\n                    diagnosticMessage = symbolAccessibilityResult.errorModuleName ?\n                        ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :\n                        ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;\n                    break;\n                case 169 /* CallSignature */:\n                    // Interfaces cannot have return types that cannot be named\n                    diagnosticMessage = symbolAccessibilityResult.errorModuleName ?\n                        ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :\n                        ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;\n                    break;\n                case 171 /* IndexSignature */:\n                    // Interfaces cannot have return types that cannot be named\n                    diagnosticMessage = symbolAccessibilityResult.errorModuleName ?\n                        ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :\n                        ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;\n                    break;\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                    if (ts.hasSyntacticModifier(node, 32 /* Static */)) {\n                        diagnosticMessage = symbolAccessibilityResult.errorModuleName ?\n                            symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                                ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named :\n                                ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 :\n                            ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0;\n                    }\n                    else if (node.parent.kind === 252 /* ClassDeclaration */) {\n                        diagnosticMessage = symbolAccessibilityResult.errorModuleName ?\n                            symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                                ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named :\n                                ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 :\n                            ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0;\n                    }\n                    else {\n                        // Interfaces cannot have return types that cannot be named\n                        diagnosticMessage = symbolAccessibilityResult.errorModuleName ?\n                            ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 :\n                            ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;\n                    }\n                    break;\n                case 251 /* FunctionDeclaration */:\n                    diagnosticMessage = symbolAccessibilityResult.errorModuleName ?\n                        symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                            ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named :\n                            ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 :\n                        ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0;\n                    break;\n                default:\n                    return ts.Debug.fail(\"This is unknown kind for signature: \" + node.kind);\n            }\n            return {\n                diagnosticMessage: diagnosticMessage,\n                errorNode: node.name || node\n            };\n        }\n        function getParameterDeclarationTypeVisibilityError(symbolAccessibilityResult) {\n            var diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult);\n            return diagnosticMessage !== undefined ? {\n                diagnosticMessage: diagnosticMessage,\n                errorNode: node,\n                typeName: node.name\n            } : undefined;\n        }\n        function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {\n            switch (node.parent.kind) {\n                case 166 /* Constructor */:\n                    return symbolAccessibilityResult.errorModuleName ?\n                        symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                            ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :\n                            ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 :\n                        ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;\n                case 170 /* ConstructSignature */:\n                case 175 /* ConstructorType */:\n                    // Interfaces cannot have parameter types that cannot be named\n                    return symbolAccessibilityResult.errorModuleName ?\n                        ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :\n                        ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;\n                case 169 /* CallSignature */:\n                    // Interfaces cannot have parameter types that cannot be named\n                    return symbolAccessibilityResult.errorModuleName ?\n                        ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :\n                        ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;\n                case 171 /* IndexSignature */:\n                    // Interfaces cannot have parameter types that cannot be named\n                    return symbolAccessibilityResult.errorModuleName ?\n                        ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :\n                        ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1;\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                    if (ts.hasSyntacticModifier(node.parent, 32 /* Static */)) {\n                        return symbolAccessibilityResult.errorModuleName ?\n                            symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                                ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :\n                                ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 :\n                            ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;\n                    }\n                    else if (node.parent.parent.kind === 252 /* ClassDeclaration */) {\n                        return symbolAccessibilityResult.errorModuleName ?\n                            symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                                ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :\n                                ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 :\n                            ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1;\n                    }\n                    else {\n                        // Interfaces cannot have parameter types that cannot be named\n                        return symbolAccessibilityResult.errorModuleName ?\n                            ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 :\n                            ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;\n                    }\n                case 251 /* FunctionDeclaration */:\n                case 174 /* FunctionType */:\n                    return symbolAccessibilityResult.errorModuleName ?\n                        symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                            ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :\n                            ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 :\n                        ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1;\n                case 168 /* SetAccessor */:\n                case 167 /* GetAccessor */:\n                    return symbolAccessibilityResult.errorModuleName ?\n                        symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ?\n                            ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named :\n                            ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 :\n                        ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;\n                default:\n                    return ts.Debug.fail(\"Unknown parent for parameter: \" + ts.SyntaxKind[node.parent.kind]);\n            }\n        }\n        function getTypeParameterConstraintVisibilityError() {\n            // Type parameter constraints are named by user so we should always be able to name it\n            var diagnosticMessage;\n            switch (node.parent.kind) {\n                case 252 /* ClassDeclaration */:\n                    diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;\n                    break;\n                case 253 /* InterfaceDeclaration */:\n                    diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;\n                    break;\n                case 190 /* MappedType */:\n                    diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1;\n                    break;\n                case 175 /* ConstructorType */:\n                case 170 /* ConstructSignature */:\n                    diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;\n                    break;\n                case 169 /* CallSignature */:\n                    diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;\n                    break;\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                    if (ts.hasSyntacticModifier(node.parent, 32 /* Static */)) {\n                        diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1;\n                    }\n                    else if (node.parent.parent.kind === 252 /* ClassDeclaration */) {\n                        diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1;\n                    }\n                    else {\n                        diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;\n                    }\n                    break;\n                case 174 /* FunctionType */:\n                case 251 /* FunctionDeclaration */:\n                    diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;\n                    break;\n                case 254 /* TypeAliasDeclaration */:\n                    diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;\n                    break;\n                default:\n                    return ts.Debug.fail(\"This is unknown parent for type parameter: \" + node.parent.kind);\n            }\n            return {\n                diagnosticMessage: diagnosticMessage,\n                errorNode: node,\n                typeName: node.name\n            };\n        }\n        function getHeritageClauseVisibilityError() {\n            var diagnosticMessage;\n            // Heritage clause is written by user so it can always be named\n            if (ts.isClassDeclaration(node.parent.parent)) {\n                // Class or Interface implemented/extended is inaccessible\n                diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 116 /* ImplementsKeyword */ ?\n                    ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 :\n                    node.parent.parent.name ? ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1 :\n                        ts.Diagnostics.extends_clause_of_exported_class_has_or_is_using_private_name_0;\n            }\n            else {\n                // interface is inaccessible\n                diagnosticMessage = ts.Diagnostics.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1;\n            }\n            return {\n                diagnosticMessage: diagnosticMessage,\n                errorNode: node,\n                typeName: ts.getNameOfDeclaration(node.parent.parent)\n            };\n        }\n        function getImportEntityNameVisibilityError() {\n            return {\n                diagnosticMessage: ts.Diagnostics.Import_declaration_0_is_using_private_name_1,\n                errorNode: node,\n                typeName: node.name\n            };\n        }\n        function getTypeAliasDeclarationVisibilityError(symbolAccessibilityResult) {\n            return {\n                diagnosticMessage: symbolAccessibilityResult.errorModuleName\n                    ? ts.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2\n                    : ts.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1,\n                errorNode: ts.isJSDocTypeAlias(node) ? ts.Debug.checkDefined(node.typeExpression) : node.type,\n                typeName: ts.isJSDocTypeAlias(node) ? ts.getNameOfDeclaration(node) : node.name,\n            };\n        }\n    }\n    ts.createGetSymbolAccessibilityDiagnosticForNode = createGetSymbolAccessibilityDiagnosticForNode;\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    function getDeclarationDiagnostics(host, resolver, file) {\n        var compilerOptions = host.getCompilerOptions();\n        var result = ts.transformNodes(resolver, host, ts.factory, compilerOptions, file ? [file] : ts.filter(host.getSourceFiles(), ts.isSourceFileNotJson), [transformDeclarations], /*allowDtsFiles*/ false);\n        return result.diagnostics;\n    }\n    ts.getDeclarationDiagnostics = getDeclarationDiagnostics;\n    function hasInternalAnnotation(range, currentSourceFile) {\n        var comment = currentSourceFile.text.substring(range.pos, range.end);\n        return ts.stringContains(comment, \"@internal\");\n    }\n    function isInternalDeclaration(node, currentSourceFile) {\n        var parseTreeNode = ts.getParseTreeNode(node);\n        if (parseTreeNode && parseTreeNode.kind === 160 /* Parameter */) {\n            var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);\n            var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined;\n            var text = currentSourceFile.text;\n            var commentRanges = previousSibling\n                ? ts.concatenate(\n                // to handle\n                // ... parameters, /* @internal */\n                // public param: string\n                ts.getTrailingCommentRanges(text, ts.skipTrivia(text, previousSibling.end + 1, /* stopAfterLineBreak */ false, /* stopAtComments */ true)), ts.getLeadingCommentRanges(text, node.pos))\n                : ts.getTrailingCommentRanges(text, ts.skipTrivia(text, node.pos, /* stopAfterLineBreak */ false, /* stopAtComments */ true));\n            return commentRanges && commentRanges.length && hasInternalAnnotation(ts.last(commentRanges), currentSourceFile);\n        }\n        var leadingCommentRanges = parseTreeNode && ts.getLeadingCommentRangesOfNode(parseTreeNode, currentSourceFile);\n        return !!ts.forEach(leadingCommentRanges, function (range) {\n            return hasInternalAnnotation(range, currentSourceFile);\n        });\n    }\n    ts.isInternalDeclaration = isInternalDeclaration;\n    var declarationEmitNodeBuilderFlags = 1024 /* MultilineObjectLiterals */ |\n        2048 /* WriteClassExpressionAsTypeLiteral */ |\n        4096 /* UseTypeOfFunction */ |\n        8 /* UseStructuralFallback */ |\n        524288 /* AllowEmptyTuple */ |\n        4 /* GenerateNamesForShadowedTypeParams */ |\n        1 /* NoTruncation */;\n    /**\n     * Transforms a ts file into a .d.ts file\n     * This process requires type information, which is retrieved through the emit resolver. Because of this,\n     * in many places this transformer assumes it will be operating on parse tree nodes directly.\n     * This means that _no transforms should be allowed to occur before this one_.\n     */\n    function transformDeclarations(context) {\n        var throwDiagnostic = function () { return ts.Debug.fail(\"Diagnostic emitted without context\"); };\n        var getSymbolAccessibilityDiagnostic = throwDiagnostic;\n        var needsDeclare = true;\n        var isBundledEmit = false;\n        var resultHasExternalModuleIndicator = false;\n        var needsScopeFixMarker = false;\n        var resultHasScopeMarker = false;\n        var enclosingDeclaration;\n        var necessaryTypeReferences;\n        var lateMarkedStatements;\n        var lateStatementReplacementMap;\n        var suppressNewDiagnosticContexts;\n        var exportedModulesFromDeclarationEmit;\n        var factory = context.factory;\n        var host = context.getEmitHost();\n        var symbolTracker = {\n            trackSymbol: trackSymbol,\n            reportInaccessibleThisError: reportInaccessibleThisError,\n            reportInaccessibleUniqueSymbolError: reportInaccessibleUniqueSymbolError,\n            reportCyclicStructureError: reportCyclicStructureError,\n            reportPrivateInBaseOfClassExpression: reportPrivateInBaseOfClassExpression,\n            reportLikelyUnsafeImportRequiredError: reportLikelyUnsafeImportRequiredError,\n            reportTruncationError: reportTruncationError,\n            moduleResolverHost: host,\n            trackReferencedAmbientModule: trackReferencedAmbientModule,\n            trackExternalModuleSymbolOfImportTypeNode: trackExternalModuleSymbolOfImportTypeNode,\n            reportNonlocalAugmentation: reportNonlocalAugmentation\n        };\n        var errorNameNode;\n        var errorFallbackNode;\n        var currentSourceFile;\n        var refs;\n        var libs;\n        var emittedImports; // must be declared in container so it can be `undefined` while transformer's first pass\n        var resolver = context.getEmitResolver();\n        var options = context.getCompilerOptions();\n        var noResolve = options.noResolve, stripInternal = options.stripInternal;\n        return transformRoot;\n        function recordTypeReferenceDirectivesIfNecessary(typeReferenceDirectives) {\n            if (!typeReferenceDirectives) {\n                return;\n            }\n            necessaryTypeReferences = necessaryTypeReferences || new ts.Set();\n            for (var _i = 0, typeReferenceDirectives_2 = typeReferenceDirectives; _i < typeReferenceDirectives_2.length; _i++) {\n                var ref = typeReferenceDirectives_2[_i];\n                necessaryTypeReferences.add(ref);\n            }\n        }\n        function trackReferencedAmbientModule(node, symbol) {\n            // If it is visible via `// <reference types=\"...\"/>`, then we should just use that\n            var directives = resolver.getTypeReferenceDirectivesForSymbol(symbol, 67108863 /* All */);\n            if (ts.length(directives)) {\n                return recordTypeReferenceDirectivesIfNecessary(directives);\n            }\n            // Otherwise we should emit a path-based reference\n            var container = ts.getSourceFileOfNode(node);\n            refs.set(ts.getOriginalNodeId(container), container);\n        }\n        function handleSymbolAccessibilityError(symbolAccessibilityResult) {\n            if (symbolAccessibilityResult.accessibility === 0 /* Accessible */) {\n                // Add aliases back onto the possible imports list if they're not there so we can try them again with updated visibility info\n                if (symbolAccessibilityResult && symbolAccessibilityResult.aliasesToMakeVisible) {\n                    if (!lateMarkedStatements) {\n                        lateMarkedStatements = symbolAccessibilityResult.aliasesToMakeVisible;\n                    }\n                    else {\n                        for (var _i = 0, _a = symbolAccessibilityResult.aliasesToMakeVisible; _i < _a.length; _i++) {\n                            var ref = _a[_i];\n                            ts.pushIfUnique(lateMarkedStatements, ref);\n                        }\n                    }\n                }\n                // TODO: Do all these accessibility checks inside/after the first pass in the checker when declarations are enabled, if possible\n            }\n            else {\n                // Report error\n                var errorInfo = getSymbolAccessibilityDiagnostic(symbolAccessibilityResult);\n                if (errorInfo) {\n                    if (errorInfo.typeName) {\n                        context.addDiagnostic(ts.createDiagnosticForNode(symbolAccessibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getTextOfNode(errorInfo.typeName), symbolAccessibilityResult.errorSymbolName, symbolAccessibilityResult.errorModuleName));\n                    }\n                    else {\n                        context.addDiagnostic(ts.createDiagnosticForNode(symbolAccessibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccessibilityResult.errorSymbolName, symbolAccessibilityResult.errorModuleName));\n                    }\n                }\n            }\n        }\n        function trackExternalModuleSymbolOfImportTypeNode(symbol) {\n            if (!isBundledEmit) {\n                (exportedModulesFromDeclarationEmit || (exportedModulesFromDeclarationEmit = [])).push(symbol);\n            }\n        }\n        function trackSymbol(symbol, enclosingDeclaration, meaning) {\n            if (symbol.flags & 262144 /* TypeParameter */)\n                return;\n            handleSymbolAccessibilityError(resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning, /*shouldComputeAliasesToMakeVisible*/ true));\n            recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForSymbol(symbol, meaning));\n        }\n        function reportPrivateInBaseOfClassExpression(propertyName) {\n            if (errorNameNode || errorFallbackNode) {\n                context.addDiagnostic(ts.createDiagnosticForNode((errorNameNode || errorFallbackNode), ts.Diagnostics.Property_0_of_exported_class_expression_may_not_be_private_or_protected, propertyName));\n            }\n        }\n        function reportInaccessibleUniqueSymbolError() {\n            if (errorNameNode) {\n                context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), \"unique symbol\"));\n            }\n        }\n        function reportCyclicStructureError() {\n            if (errorNameNode) {\n                context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode)));\n            }\n        }\n        function reportInaccessibleThisError() {\n            if (errorNameNode) {\n                context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), \"this\"));\n            }\n        }\n        function reportLikelyUnsafeImportRequiredError(specifier) {\n            if (errorNameNode) {\n                context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), specifier));\n            }\n        }\n        function reportTruncationError() {\n            if (errorNameNode || errorFallbackNode) {\n                context.addDiagnostic(ts.createDiagnosticForNode((errorNameNode || errorFallbackNode), ts.Diagnostics.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed));\n            }\n        }\n        function reportNonlocalAugmentation(containingFile, parentSymbol, symbol) {\n            var primaryDeclaration = ts.find(parentSymbol.declarations, function (d) { return ts.getSourceFileOfNode(d) === containingFile; });\n            var augmentingDeclarations = ts.filter(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== containingFile; });\n            for (var _i = 0, augmentingDeclarations_1 = augmentingDeclarations; _i < augmentingDeclarations_1.length; _i++) {\n                var augmentations = augmentingDeclarations_1[_i];\n                context.addDiagnostic(ts.addRelatedInfo(ts.createDiagnosticForNode(augmentations, ts.Diagnostics.Declaration_augments_declaration_in_another_file_This_cannot_be_serialized), ts.createDiagnosticForNode(primaryDeclaration, ts.Diagnostics.This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file)));\n            }\n        }\n        function transformDeclarationsForJS(sourceFile, bundled) {\n            var oldDiag = getSymbolAccessibilityDiagnostic;\n            getSymbolAccessibilityDiagnostic = function (s) { return (s.errorNode && ts.canProduceDiagnostics(s.errorNode) ? ts.createGetSymbolAccessibilityDiagnosticForNode(s.errorNode)(s) : ({\n                diagnosticMessage: s.errorModuleName\n                    ? ts.Diagnostics.Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit\n                    : ts.Diagnostics.Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit,\n                errorNode: s.errorNode || sourceFile\n            })); };\n            var result = resolver.getDeclarationStatementsForSourceFile(sourceFile, declarationEmitNodeBuilderFlags, symbolTracker, bundled);\n            getSymbolAccessibilityDiagnostic = oldDiag;\n            return result;\n        }\n        function transformRoot(node) {\n            if (node.kind === 297 /* SourceFile */ && node.isDeclarationFile) {\n                return node;\n            }\n            if (node.kind === 298 /* Bundle */) {\n                isBundledEmit = true;\n                refs = new ts.Map();\n                libs = new ts.Map();\n                var hasNoDefaultLib_1 = false;\n                var bundle = factory.createBundle(ts.map(node.sourceFiles, function (sourceFile) {\n                    if (sourceFile.isDeclarationFile)\n                        return undefined; // Omit declaration files from bundle results, too // TODO: GH#18217\n                    hasNoDefaultLib_1 = hasNoDefaultLib_1 || sourceFile.hasNoDefaultLib;\n                    currentSourceFile = sourceFile;\n                    enclosingDeclaration = sourceFile;\n                    lateMarkedStatements = undefined;\n                    suppressNewDiagnosticContexts = false;\n                    lateStatementReplacementMap = new ts.Map();\n                    getSymbolAccessibilityDiagnostic = throwDiagnostic;\n                    needsScopeFixMarker = false;\n                    resultHasScopeMarker = false;\n                    collectReferences(sourceFile, refs);\n                    collectLibs(sourceFile, libs);\n                    if (ts.isExternalOrCommonJsModule(sourceFile) || ts.isJsonSourceFile(sourceFile)) {\n                        resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules)\n                        needsDeclare = false;\n                        var statements = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements);\n                        var newFile = factory.updateSourceFile(sourceFile, [factory.createModuleDeclaration([], [factory.createModifier(133 /* DeclareKeyword */)], factory.createStringLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), factory.createModuleBlock(ts.setTextRange(factory.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []);\n                        return newFile;\n                    }\n                    needsDeclare = true;\n                    var updated = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements);\n                    return factory.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []);\n                }), ts.mapDefined(node.prepends, function (prepend) {\n                    if (prepend.kind === 300 /* InputFiles */) {\n                        var sourceFile = ts.createUnparsedSourceFile(prepend, \"dts\", stripInternal);\n                        hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib;\n                        collectReferences(sourceFile, refs);\n                        recordTypeReferenceDirectivesIfNecessary(sourceFile.typeReferenceDirectives);\n                        collectLibs(sourceFile, libs);\n                        return sourceFile;\n                    }\n                    return prepend;\n                }));\n                bundle.syntheticFileReferences = [];\n                bundle.syntheticTypeReferences = getFileReferencesForUsedTypeReferences();\n                bundle.syntheticLibReferences = getLibReferences();\n                bundle.hasNoDefaultLib = hasNoDefaultLib_1;\n                var outputFilePath_1 = ts.getDirectoryPath(ts.normalizeSlashes(ts.getOutputPathsFor(node, host, /*forceDtsPaths*/ true).declarationFilePath));\n                var referenceVisitor_1 = mapReferencesIntoArray(bundle.syntheticFileReferences, outputFilePath_1);\n                refs.forEach(referenceVisitor_1);\n                return bundle;\n            }\n            // Single source file\n            needsDeclare = true;\n            needsScopeFixMarker = false;\n            resultHasScopeMarker = false;\n            enclosingDeclaration = node;\n            currentSourceFile = node;\n            getSymbolAccessibilityDiagnostic = throwDiagnostic;\n            isBundledEmit = false;\n            resultHasExternalModuleIndicator = false;\n            suppressNewDiagnosticContexts = false;\n            lateMarkedStatements = undefined;\n            lateStatementReplacementMap = new ts.Map();\n            necessaryTypeReferences = undefined;\n            refs = collectReferences(currentSourceFile, new ts.Map());\n            libs = collectLibs(currentSourceFile, new ts.Map());\n            var references = [];\n            var outputFilePath = ts.getDirectoryPath(ts.normalizeSlashes(ts.getOutputPathsFor(node, host, /*forceDtsPaths*/ true).declarationFilePath));\n            var referenceVisitor = mapReferencesIntoArray(references, outputFilePath);\n            var combinedStatements;\n            if (ts.isSourceFileJS(currentSourceFile)) {\n                combinedStatements = factory.createNodeArray(transformDeclarationsForJS(node));\n                refs.forEach(referenceVisitor);\n                emittedImports = ts.filter(combinedStatements, ts.isAnyImportSyntax);\n            }\n            else {\n                var statements = ts.visitNodes(node.statements, visitDeclarationStatements);\n                combinedStatements = ts.setTextRange(factory.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), node.statements);\n                refs.forEach(referenceVisitor);\n                emittedImports = ts.filter(combinedStatements, ts.isAnyImportSyntax);\n                if (ts.isExternalModule(node) && (!resultHasExternalModuleIndicator || (needsScopeFixMarker && !resultHasScopeMarker))) {\n                    combinedStatements = ts.setTextRange(factory.createNodeArray(__spreadArray(__spreadArray([], combinedStatements), [ts.createEmptyExports(factory)])), combinedStatements);\n                }\n            }\n            var updated = factory.updateSourceFile(node, combinedStatements, /*isDeclarationFile*/ true, references, getFileReferencesForUsedTypeReferences(), node.hasNoDefaultLib, getLibReferences());\n            updated.exportedModulesFromDeclarationEmit = exportedModulesFromDeclarationEmit;\n            return updated;\n            function getLibReferences() {\n                return ts.map(ts.arrayFrom(libs.keys()), function (lib) { return ({ fileName: lib, pos: -1, end: -1 }); });\n            }\n            function getFileReferencesForUsedTypeReferences() {\n                return necessaryTypeReferences ? ts.mapDefined(ts.arrayFrom(necessaryTypeReferences.keys()), getFileReferenceForTypeName) : [];\n            }\n            function getFileReferenceForTypeName(typeName) {\n                // Elide type references for which we have imports\n                if (emittedImports) {\n                    for (var _i = 0, emittedImports_1 = emittedImports; _i < emittedImports_1.length; _i++) {\n                        var importStatement = emittedImports_1[_i];\n                        if (ts.isImportEqualsDeclaration(importStatement) && ts.isExternalModuleReference(importStatement.moduleReference)) {\n                            var expr = importStatement.moduleReference.expression;\n                            if (ts.isStringLiteralLike(expr) && expr.text === typeName) {\n                                return undefined;\n                            }\n                        }\n                        else if (ts.isImportDeclaration(importStatement) && ts.isStringLiteral(importStatement.moduleSpecifier) && importStatement.moduleSpecifier.text === typeName) {\n                            return undefined;\n                        }\n                    }\n                }\n                return { fileName: typeName, pos: -1, end: -1 };\n            }\n            function mapReferencesIntoArray(references, outputFilePath) {\n                return function (file) {\n                    var declFileName;\n                    if (file.isDeclarationFile) { // Neither decl files or js should have their refs changed\n                        declFileName = file.fileName;\n                    }\n                    else {\n                        if (isBundledEmit && ts.contains(node.sourceFiles, file))\n                            return; // Omit references to files which are being merged\n                        var paths = ts.getOutputPathsFor(file, host, /*forceDtsPaths*/ true);\n                        declFileName = paths.declarationFilePath || paths.jsFilePath || file.fileName;\n                    }\n                    if (declFileName) {\n                        var specifier = ts.moduleSpecifiers.getModuleSpecifier(__assign(__assign({}, options), { baseUrl: options.baseUrl && ts.toPath(options.baseUrl, host.getCurrentDirectory(), host.getCanonicalFileName) }), currentSourceFile, ts.toPath(outputFilePath, host.getCurrentDirectory(), host.getCanonicalFileName), ts.toPath(declFileName, host.getCurrentDirectory(), host.getCanonicalFileName), host, \n                        /*preferences*/ undefined);\n                        if (!ts.pathIsRelative(specifier)) {\n                            // If some compiler option/symlink/whatever allows access to the file containing the ambient module declaration\n                            // via a non-relative name, emit a type reference directive to that non-relative name, rather than\n                            // a relative path to the declaration file\n                            recordTypeReferenceDirectivesIfNecessary([specifier]);\n                            return;\n                        }\n                        var fileName = ts.getRelativePathToDirectoryOrUrl(outputFilePath, declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, \n                        /*isAbsolutePathAnUrl*/ false);\n                        if (ts.startsWith(fileName, \"./\") && ts.hasExtension(fileName)) {\n                            fileName = fileName.substring(2);\n                        }\n                        // omit references to files from node_modules (npm may disambiguate module\n                        // references when installing this package, making the path is unreliable).\n                        if (ts.startsWith(fileName, \"node_modules/\") || ts.pathContainsNodeModules(fileName)) {\n                            return;\n                        }\n                        references.push({ pos: -1, end: -1, fileName: fileName });\n                    }\n                };\n            }\n        }\n        function collectReferences(sourceFile, ret) {\n            if (noResolve || (!ts.isUnparsedSource(sourceFile) && ts.isSourceFileJS(sourceFile)))\n                return ret;\n            ts.forEach(sourceFile.referencedFiles, function (f) {\n                var elem = host.getSourceFileFromReference(sourceFile, f);\n                if (elem) {\n                    ret.set(ts.getOriginalNodeId(elem), elem);\n                }\n            });\n            return ret;\n        }\n        function collectLibs(sourceFile, ret) {\n            ts.forEach(sourceFile.libReferenceDirectives, function (ref) {\n                var lib = host.getLibFileFromReference(ref);\n                if (lib) {\n                    ret.set(ts.toFileNameLowerCase(ref.fileName), true);\n                }\n            });\n            return ret;\n        }\n        function filterBindingPatternInitializers(name) {\n            if (name.kind === 78 /* Identifier */) {\n                return name;\n            }\n            else {\n                if (name.kind === 197 /* ArrayBindingPattern */) {\n                    return factory.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement));\n                }\n                else {\n                    return factory.updateObjectBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement));\n                }\n            }\n            function visitBindingElement(elem) {\n                if (elem.kind === 222 /* OmittedExpression */) {\n                    return elem;\n                }\n                return factory.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined);\n            }\n        }\n        function ensureParameter(p, modifierMask, type) {\n            var oldDiag;\n            if (!suppressNewDiagnosticContexts) {\n                oldDiag = getSymbolAccessibilityDiagnostic;\n                getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(p);\n            }\n            var newParam = factory.updateParameterDeclaration(p, \n            /*decorators*/ undefined, maskModifiers(p, modifierMask), p.dotDotDotToken, filterBindingPatternInitializers(p.name), resolver.isOptionalParameter(p) ? (p.questionToken || factory.createToken(57 /* QuestionToken */)) : undefined, ensureType(p, type || p.type, /*ignorePrivate*/ true), // Ignore private param props, since this type is going straight back into a param\n            ensureNoInitializer(p));\n            if (!suppressNewDiagnosticContexts) {\n                getSymbolAccessibilityDiagnostic = oldDiag;\n            }\n            return newParam;\n        }\n        function shouldPrintWithInitializer(node) {\n            return canHaveLiteralInitializer(node) && resolver.isLiteralConstDeclaration(ts.getParseTreeNode(node)); // TODO: Make safe\n        }\n        function ensureNoInitializer(node) {\n            if (shouldPrintWithInitializer(node)) {\n                return resolver.createLiteralConstValue(ts.getParseTreeNode(node), symbolTracker); // TODO: Make safe\n            }\n            return undefined;\n        }\n        function ensureType(node, type, ignorePrivate) {\n            if (!ignorePrivate && ts.hasEffectiveModifier(node, 8 /* Private */)) {\n                // Private nodes emit no types (except private parameter properties, whose parameter types are actually visible)\n                return;\n            }\n            if (shouldPrintWithInitializer(node)) {\n                // Literal const declarations will have an initializer ensured rather than a type\n                return;\n            }\n            var shouldUseResolverType = node.kind === 160 /* Parameter */ &&\n                (resolver.isRequiredInitializedParameter(node) ||\n                    resolver.isOptionalUninitializedParameterProperty(node));\n            if (type && !shouldUseResolverType) {\n                return ts.visitNode(type, visitDeclarationSubtree);\n            }\n            if (!ts.getParseTreeNode(node)) {\n                return type ? ts.visitNode(type, visitDeclarationSubtree) : factory.createKeywordTypeNode(128 /* AnyKeyword */);\n            }\n            if (node.kind === 168 /* SetAccessor */) {\n                // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now\n                // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that)\n                return factory.createKeywordTypeNode(128 /* AnyKeyword */);\n            }\n            errorNameNode = node.name;\n            var oldDiag;\n            if (!suppressNewDiagnosticContexts) {\n                oldDiag = getSymbolAccessibilityDiagnostic;\n                getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node);\n            }\n            if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) {\n                return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));\n            }\n            if (node.kind === 160 /* Parameter */\n                || node.kind === 163 /* PropertyDeclaration */\n                || node.kind === 162 /* PropertySignature */) {\n                if (!node.initializer)\n                    return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType));\n                return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));\n            }\n            return cleanup(resolver.createReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));\n            function cleanup(returnValue) {\n                errorNameNode = undefined;\n                if (!suppressNewDiagnosticContexts) {\n                    getSymbolAccessibilityDiagnostic = oldDiag;\n                }\n                return returnValue || factory.createKeywordTypeNode(128 /* AnyKeyword */);\n            }\n        }\n        function isDeclarationAndNotVisible(node) {\n            node = ts.getParseTreeNode(node);\n            switch (node.kind) {\n                case 251 /* FunctionDeclaration */:\n                case 256 /* ModuleDeclaration */:\n                case 253 /* InterfaceDeclaration */:\n                case 252 /* ClassDeclaration */:\n                case 254 /* TypeAliasDeclaration */:\n                case 255 /* EnumDeclaration */:\n                    return !resolver.isDeclarationVisible(node);\n                // The following should be doing their own visibility checks based on filtering their members\n                case 249 /* VariableDeclaration */:\n                    return !getBindingNameVisible(node);\n                case 260 /* ImportEqualsDeclaration */:\n                case 261 /* ImportDeclaration */:\n                case 267 /* ExportDeclaration */:\n                case 266 /* ExportAssignment */:\n                    return false;\n            }\n            return false;\n        }\n        function getBindingNameVisible(elem) {\n            if (ts.isOmittedExpression(elem)) {\n                return false;\n            }\n            if (ts.isBindingPattern(elem.name)) {\n                // If any child binding pattern element has been marked visible (usually by collect linked aliases), then this is visible\n                return ts.some(elem.name.elements, getBindingNameVisible);\n            }\n            else {\n                return resolver.isDeclarationVisible(elem);\n            }\n        }\n        function updateParamsList(node, params, modifierMask) {\n            if (ts.hasEffectiveModifier(node, 8 /* Private */)) {\n                return undefined; // TODO: GH#18217\n            }\n            var newParams = ts.map(params, function (p) { return ensureParameter(p, modifierMask); });\n            if (!newParams) {\n                return undefined; // TODO: GH#18217\n            }\n            return factory.createNodeArray(newParams, params.hasTrailingComma);\n        }\n        function updateAccessorParamsList(input, isPrivate) {\n            var newParams;\n            if (!isPrivate) {\n                var thisParameter = ts.getThisParameter(input);\n                if (thisParameter) {\n                    newParams = [ensureParameter(thisParameter)];\n                }\n            }\n            if (ts.isSetAccessorDeclaration(input)) {\n                var newValueParameter = void 0;\n                if (!isPrivate) {\n                    var valueParameter = ts.getSetAccessorValueParameter(input);\n                    if (valueParameter) {\n                        var accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input));\n                        newValueParameter = ensureParameter(valueParameter, /*modifierMask*/ undefined, accessorType);\n                    }\n                }\n                if (!newValueParameter) {\n                    newValueParameter = factory.createParameterDeclaration(\n                    /*decorators*/ undefined, \n                    /*modifiers*/ undefined, \n                    /*dotDotDotToken*/ undefined, \"value\");\n                }\n                newParams = ts.append(newParams, newValueParameter);\n            }\n            return factory.createNodeArray(newParams || ts.emptyArray);\n        }\n        function ensureTypeParams(node, params) {\n            return ts.hasEffectiveModifier(node, 8 /* Private */) ? undefined : ts.visitNodes(params, visitDeclarationSubtree);\n        }\n        function isEnclosingDeclaration(node) {\n            return ts.isSourceFile(node)\n                || ts.isTypeAliasDeclaration(node)\n                || ts.isModuleDeclaration(node)\n                || ts.isClassDeclaration(node)\n                || ts.isInterfaceDeclaration(node)\n                || ts.isFunctionLike(node)\n                || ts.isIndexSignatureDeclaration(node)\n                || ts.isMappedTypeNode(node);\n        }\n        function checkEntityNameVisibility(entityName, enclosingDeclaration) {\n            var visibilityResult = resolver.isEntityNameVisible(entityName, enclosingDeclaration);\n            handleSymbolAccessibilityError(visibilityResult);\n            recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName));\n        }\n        function preserveJsDoc(updated, original) {\n            if (ts.hasJSDocNodes(updated) && ts.hasJSDocNodes(original)) {\n                updated.jsDoc = original.jsDoc;\n            }\n            return ts.setCommentRange(updated, ts.getCommentRange(original));\n        }\n        function rewriteModuleSpecifier(parent, input) {\n            if (!input)\n                return undefined; // TODO: GH#18217\n            resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 256 /* ModuleDeclaration */ && parent.kind !== 195 /* ImportType */);\n            if (ts.isStringLiteralLike(input)) {\n                if (isBundledEmit) {\n                    var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent);\n                    if (newName) {\n                        return factory.createStringLiteral(newName);\n                    }\n                }\n                else {\n                    var symbol = resolver.getSymbolOfExternalModuleSpecifier(input);\n                    if (symbol) {\n                        (exportedModulesFromDeclarationEmit || (exportedModulesFromDeclarationEmit = [])).push(symbol);\n                    }\n                }\n            }\n            return input;\n        }\n        function transformImportEqualsDeclaration(decl) {\n            if (!resolver.isDeclarationVisible(decl))\n                return;\n            if (decl.moduleReference.kind === 272 /* ExternalModuleReference */) {\n                // Rewrite external module names if necessary\n                var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl);\n                return factory.updateImportEqualsDeclaration(decl, \n                /*decorators*/ undefined, decl.modifiers, decl.isTypeOnly, decl.name, factory.updateExternalModuleReference(decl.moduleReference, rewriteModuleSpecifier(decl, specifier)));\n            }\n            else {\n                var oldDiag = getSymbolAccessibilityDiagnostic;\n                getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(decl);\n                checkEntityNameVisibility(decl.moduleReference, enclosingDeclaration);\n                getSymbolAccessibilityDiagnostic = oldDiag;\n                return decl;\n            }\n        }\n        function transformImportDeclaration(decl) {\n            if (!decl.importClause) {\n                // import \"mod\" - possibly needed for side effects? (global interface patches, module augmentations, etc)\n                return factory.updateImportDeclaration(decl, \n                /*decorators*/ undefined, decl.modifiers, decl.importClause, rewriteModuleSpecifier(decl, decl.moduleSpecifier));\n            }\n            // The `importClause` visibility corresponds to the default's visibility.\n            var visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : undefined;\n            if (!decl.importClause.namedBindings) {\n                // No named bindings (either namespace or list), meaning the import is just default or should be elided\n                return visibleDefaultBinding && factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, \n                /*namedBindings*/ undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier));\n            }\n            if (decl.importClause.namedBindings.kind === 263 /* NamespaceImport */) {\n                // Namespace import (optionally with visible default)\n                var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined;\n                return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined;\n            }\n            // Named imports (optionally with visible default)\n            var bindingList = ts.mapDefined(decl.importClause.namedBindings.elements, function (b) { return resolver.isDeclarationVisible(b) ? b : undefined; });\n            if ((bindingList && bindingList.length) || visibleDefaultBinding) {\n                return factory.updateImportDeclaration(decl, \n                /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, bindingList && bindingList.length ? factory.updateNamedImports(decl.importClause.namedBindings, bindingList) : undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier));\n            }\n            // Augmentation of export depends on import\n            if (resolver.isImportRequiredByAugmentation(decl)) {\n                return factory.updateImportDeclaration(decl, \n                /*decorators*/ undefined, decl.modifiers, \n                /*importClause*/ undefined, rewriteModuleSpecifier(decl, decl.moduleSpecifier));\n            }\n            // Nothing visible\n        }\n        function transformAndReplaceLatePaintedStatements(statements) {\n            // This is a `while` loop because `handleSymbolAccessibilityError` can see additional import aliases marked as visible during\n            // error handling which must now be included in the output and themselves checked for errors.\n            // For example:\n            // ```\n            // module A {\n            //   export module Q {}\n            //   import B = Q;\n            //   import C = B;\n            //   export import D = C;\n            // }\n            // ```\n            // In such a scenario, only Q and D are initially visible, but we don't consider imports as private names - instead we say they if they are referenced they must\n            // be recorded. So while checking D's visibility we mark C as visible, then we must check C which in turn marks B, completing the chain of\n            // dependent imports and allowing a valid declaration file output. Today, this dependent alias marking only happens for internal import aliases.\n            while (ts.length(lateMarkedStatements)) {\n                var i = lateMarkedStatements.shift();\n                if (!ts.isLateVisibilityPaintedStatement(i)) {\n                    return ts.Debug.fail(\"Late replaced statement was found which is not handled by the declaration transformer!: \" + (ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind));\n                }\n                var priorNeedsDeclare = needsDeclare;\n                needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit);\n                var result = transformTopLevelDeclaration(i);\n                needsDeclare = priorNeedsDeclare;\n                lateStatementReplacementMap.set(ts.getOriginalNodeId(i), result);\n            }\n            // And lastly, we need to get the final form of all those indetermine import declarations from before and add them to the output list\n            // (and remove them from the set to examine for outter declarations)\n            return ts.visitNodes(statements, visitLateVisibilityMarkedStatements);\n            function visitLateVisibilityMarkedStatements(statement) {\n                if (ts.isLateVisibilityPaintedStatement(statement)) {\n                    var key = ts.getOriginalNodeId(statement);\n                    if (lateStatementReplacementMap.has(key)) {\n                        var result = lateStatementReplacementMap.get(key);\n                        lateStatementReplacementMap.delete(key);\n                        if (result) {\n                            if (ts.isArray(result) ? ts.some(result, ts.needsScopeMarker) : ts.needsScopeMarker(result)) {\n                                // Top-level declarations in .d.ts files are always considered exported even without a modifier unless there's an export assignment or specifier\n                                needsScopeFixMarker = true;\n                            }\n                            if (ts.isSourceFile(statement.parent) && (ts.isArray(result) ? ts.some(result, ts.isExternalModuleIndicator) : ts.isExternalModuleIndicator(result))) {\n                                resultHasExternalModuleIndicator = true;\n                            }\n                        }\n                        return result;\n                    }\n                }\n                return statement;\n            }\n        }\n        function visitDeclarationSubtree(input) {\n            if (shouldStripInternal(input))\n                return;\n            if (ts.isDeclaration(input)) {\n                if (isDeclarationAndNotVisible(input))\n                    return;\n                if (ts.hasDynamicName(input) && !resolver.isLateBound(ts.getParseTreeNode(input))) {\n                    return;\n                }\n            }\n            // Elide implementation signatures from overload sets\n            if (ts.isFunctionLike(input) && resolver.isImplementationOfOverload(input))\n                return;\n            // Elide semicolon class statements\n            if (ts.isSemicolonClassElement(input))\n                return;\n            var previousEnclosingDeclaration;\n            if (isEnclosingDeclaration(input)) {\n                previousEnclosingDeclaration = enclosingDeclaration;\n                enclosingDeclaration = input;\n            }\n            var oldDiag = getSymbolAccessibilityDiagnostic;\n            // Setup diagnostic-related flags before first potential `cleanup` call, otherwise\n            // We'd see a TDZ violation at runtime\n            var canProduceDiagnostic = ts.canProduceDiagnostics(input);\n            var oldWithinObjectLiteralType = suppressNewDiagnosticContexts;\n            var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 177 /* TypeLiteral */ || input.kind === 190 /* MappedType */) && input.parent.kind !== 254 /* TypeAliasDeclaration */);\n            // Emit methods which are private as properties with no type information\n            if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) {\n                if (ts.hasEffectiveModifier(input, 8 /* Private */)) {\n                    if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input)\n                        return; // Elide all but the first overload\n                    return cleanup(factory.createPropertyDeclaration(/*decorators*/ undefined, ensureModifiers(input), input.name, /*questionToken*/ undefined, /*type*/ undefined, /*initializer*/ undefined));\n                }\n            }\n            if (canProduceDiagnostic && !suppressNewDiagnosticContexts) {\n                getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(input);\n            }\n            if (ts.isTypeQueryNode(input)) {\n                checkEntityNameVisibility(input.exprName, enclosingDeclaration);\n            }\n            if (shouldEnterSuppressNewDiagnosticsContextContext) {\n                // We stop making new diagnostic contexts within object literal types. Unless it's an object type on the RHS of a type alias declaration. Then we do.\n                suppressNewDiagnosticContexts = true;\n            }\n            if (isProcessedComponent(input)) {\n                switch (input.kind) {\n                    case 223 /* ExpressionWithTypeArguments */: {\n                        if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) {\n                            checkEntityNameVisibility(input.expression, enclosingDeclaration);\n                        }\n                        var node = ts.visitEachChild(input, visitDeclarationSubtree, context);\n                        return cleanup(factory.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments));\n                    }\n                    case 173 /* TypeReference */: {\n                        checkEntityNameVisibility(input.typeName, enclosingDeclaration);\n                        var node = ts.visitEachChild(input, visitDeclarationSubtree, context);\n                        return cleanup(factory.updateTypeReferenceNode(node, node.typeName, node.typeArguments));\n                    }\n                    case 170 /* ConstructSignature */:\n                        return cleanup(factory.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)));\n                    case 166 /* Constructor */: {\n                        // A constructor declaration may not have a type annotation\n                        var ctor = factory.createConstructorDeclaration(\n                        /*decorators*/ undefined, \n                        /*modifiers*/ ensureModifiers(input), updateParamsList(input, input.parameters, 0 /* None */), \n                        /*body*/ undefined);\n                        return cleanup(ctor);\n                    }\n                    case 165 /* MethodDeclaration */: {\n                        if (ts.isPrivateIdentifier(input.name)) {\n                            return cleanup(/*returnValue*/ undefined);\n                        }\n                        var sig = factory.createMethodDeclaration(\n                        /*decorators*/ undefined, ensureModifiers(input), \n                        /*asteriskToken*/ undefined, input.name, input.questionToken, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), \n                        /*body*/ undefined);\n                        return cleanup(sig);\n                    }\n                    case 167 /* GetAccessor */: {\n                        if (ts.isPrivateIdentifier(input.name)) {\n                            return cleanup(/*returnValue*/ undefined);\n                        }\n                        var accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input));\n                        return cleanup(factory.updateGetAccessorDeclaration(input, \n                        /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasEffectiveModifier(input, 8 /* Private */)), ensureType(input, accessorType), \n                        /*body*/ undefined));\n                    }\n                    case 168 /* SetAccessor */: {\n                        if (ts.isPrivateIdentifier(input.name)) {\n                            return cleanup(/*returnValue*/ undefined);\n                        }\n                        return cleanup(factory.updateSetAccessorDeclaration(input, \n                        /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasEffectiveModifier(input, 8 /* Private */)), \n                        /*body*/ undefined));\n                    }\n                    case 163 /* PropertyDeclaration */:\n                        if (ts.isPrivateIdentifier(input.name)) {\n                            return cleanup(/*returnValue*/ undefined);\n                        }\n                        return cleanup(factory.updatePropertyDeclaration(input, \n                        /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input)));\n                    case 162 /* PropertySignature */:\n                        if (ts.isPrivateIdentifier(input.name)) {\n                            return cleanup(/*returnValue*/ undefined);\n                        }\n                        return cleanup(factory.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type)));\n                    case 164 /* MethodSignature */: {\n                        if (ts.isPrivateIdentifier(input.name)) {\n                            return cleanup(/*returnValue*/ undefined);\n                        }\n                        return cleanup(factory.updateMethodSignature(input, ensureModifiers(input), input.name, input.questionToken, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)));\n                    }\n                    case 169 /* CallSignature */: {\n                        return cleanup(factory.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)));\n                    }\n                    case 171 /* IndexSignature */: {\n                        return cleanup(factory.updateIndexSignature(input, \n                        /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || factory.createKeywordTypeNode(128 /* AnyKeyword */)));\n                    }\n                    case 249 /* VariableDeclaration */: {\n                        if (ts.isBindingPattern(input.name)) {\n                            return recreateBindingPattern(input.name);\n                        }\n                        shouldEnterSuppressNewDiagnosticsContextContext = true;\n                        suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types\n                        return cleanup(factory.updateVariableDeclaration(input, input.name, /*exclamationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input)));\n                    }\n                    case 159 /* TypeParameter */: {\n                        if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) {\n                            return cleanup(factory.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined));\n                        }\n                        return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context));\n                    }\n                    case 184 /* ConditionalType */: {\n                        // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration\n                        // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type.\n                        var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree);\n                        var extendsType = ts.visitNode(input.extendsType, visitDeclarationSubtree);\n                        var oldEnclosingDecl = enclosingDeclaration;\n                        enclosingDeclaration = input.trueType;\n                        var trueType = ts.visitNode(input.trueType, visitDeclarationSubtree);\n                        enclosingDeclaration = oldEnclosingDecl;\n                        var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree);\n                        return cleanup(factory.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));\n                    }\n                    case 174 /* FunctionType */: {\n                        return cleanup(factory.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree)));\n                    }\n                    case 175 /* ConstructorType */: {\n                        return cleanup(factory.updateConstructorTypeNode(input, ensureModifiers(input), ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree)));\n                    }\n                    case 195 /* ImportType */: {\n                        if (!ts.isLiteralImportTypeNode(input))\n                            return cleanup(input);\n                        return cleanup(factory.updateImportTypeNode(input, factory.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf));\n                    }\n                    default: ts.Debug.assertNever(input, \"Attempted to process unhandled node kind: \" + ts.SyntaxKind[input.kind]);\n                }\n            }\n            if (ts.isTupleTypeNode(input) && (ts.getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === ts.getLineAndCharacterOfPosition(currentSourceFile, input.end).line)) {\n                ts.setEmitFlags(input, 1 /* SingleLine */);\n            }\n            return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context));\n            function cleanup(returnValue) {\n                if (returnValue && canProduceDiagnostic && ts.hasDynamicName(input)) {\n                    checkName(input);\n                }\n                if (isEnclosingDeclaration(input)) {\n                    enclosingDeclaration = previousEnclosingDeclaration;\n                }\n                if (canProduceDiagnostic && !suppressNewDiagnosticContexts) {\n                    getSymbolAccessibilityDiagnostic = oldDiag;\n                }\n                if (shouldEnterSuppressNewDiagnosticsContextContext) {\n                    suppressNewDiagnosticContexts = oldWithinObjectLiteralType;\n                }\n                if (returnValue === input) {\n                    return returnValue;\n                }\n                return returnValue && ts.setOriginalNode(preserveJsDoc(returnValue, input), input);\n            }\n        }\n        function isPrivateMethodTypeParameter(node) {\n            return node.parent.kind === 165 /* MethodDeclaration */ && ts.hasEffectiveModifier(node.parent, 8 /* Private */);\n        }\n        function visitDeclarationStatements(input) {\n            if (!isPreservedDeclarationStatement(input)) {\n                // return undefined for unmatched kinds to omit them from the tree\n                return;\n            }\n            if (shouldStripInternal(input))\n                return;\n            switch (input.kind) {\n                case 267 /* ExportDeclaration */: {\n                    if (ts.isSourceFile(input.parent)) {\n                        resultHasExternalModuleIndicator = true;\n                    }\n                    resultHasScopeMarker = true;\n                    // Always visible if the parent node isn't dropped for being not visible\n                    // Rewrite external module names if necessary\n                    return factory.updateExportDeclaration(input, \n                    /*decorators*/ undefined, input.modifiers, input.isTypeOnly, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier));\n                }\n                case 266 /* ExportAssignment */: {\n                    // Always visible if the parent node isn't dropped for being not visible\n                    if (ts.isSourceFile(input.parent)) {\n                        resultHasExternalModuleIndicator = true;\n                    }\n                    resultHasScopeMarker = true;\n                    if (input.expression.kind === 78 /* Identifier */) {\n                        return input;\n                    }\n                    else {\n                        var newId = factory.createUniqueName(\"_default\", 16 /* Optimistic */);\n                        getSymbolAccessibilityDiagnostic = function () { return ({\n                            diagnosticMessage: ts.Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0,\n                            errorNode: input\n                        }); };\n                        errorFallbackNode = input;\n                        var varDecl = factory.createVariableDeclaration(newId, /*exclamationToken*/ undefined, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined);\n                        errorFallbackNode = undefined;\n                        var statement = factory.createVariableStatement(needsDeclare ? [factory.createModifier(133 /* DeclareKeyword */)] : [], factory.createVariableDeclarationList([varDecl], 2 /* Const */));\n                        return [statement, factory.updateExportAssignment(input, input.decorators, input.modifiers, newId)];\n                    }\n                }\n            }\n            var result = transformTopLevelDeclaration(input);\n            // Don't actually transform yet; just leave as original node - will be elided/swapped by late pass\n            lateStatementReplacementMap.set(ts.getOriginalNodeId(input), result);\n            return input;\n        }\n        function stripExportModifiers(statement) {\n            if (ts.isImportEqualsDeclaration(statement) || ts.hasEffectiveModifier(statement, 512 /* Default */) || !ts.canHaveModifiers(statement)) {\n                // `export import` statements should remain as-is, as imports are _not_ implicitly exported in an ambient namespace\n                // Likewise, `export default` classes and the like and just be `default`, so we preserve their `export` modifiers, too\n                return statement;\n            }\n            var modifiers = factory.createModifiersFromModifierFlags(ts.getEffectiveModifierFlags(statement) & (11263 /* All */ ^ 1 /* Export */));\n            return factory.updateModifiers(statement, modifiers);\n        }\n        function transformTopLevelDeclaration(input) {\n            if (shouldStripInternal(input))\n                return;\n            switch (input.kind) {\n                case 260 /* ImportEqualsDeclaration */: {\n                    return transformImportEqualsDeclaration(input);\n                }\n                case 261 /* ImportDeclaration */: {\n                    return transformImportDeclaration(input);\n                }\n            }\n            if (ts.isDeclaration(input) && isDeclarationAndNotVisible(input))\n                return;\n            // Elide implementation signatures from overload sets\n            if (ts.isFunctionLike(input) && resolver.isImplementationOfOverload(input))\n                return;\n            var previousEnclosingDeclaration;\n            if (isEnclosingDeclaration(input)) {\n                previousEnclosingDeclaration = enclosingDeclaration;\n                enclosingDeclaration = input;\n            }\n            var canProdiceDiagnostic = ts.canProduceDiagnostics(input);\n            var oldDiag = getSymbolAccessibilityDiagnostic;\n            if (canProdiceDiagnostic) {\n                getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(input);\n            }\n            var previousNeedsDeclare = needsDeclare;\n            switch (input.kind) {\n                case 254 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all\n                    return cleanup(factory.updateTypeAliasDeclaration(input, \n                    /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode)));\n                case 253 /* InterfaceDeclaration */: {\n                    return cleanup(factory.updateInterfaceDeclaration(input, \n                    /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree)));\n                }\n                case 251 /* FunctionDeclaration */: {\n                    // Generators lose their generator-ness, excepting their return type\n                    var clean = cleanup(factory.updateFunctionDeclaration(input, \n                    /*decorators*/ undefined, ensureModifiers(input), \n                    /*asteriskToken*/ undefined, input.name, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), \n                    /*body*/ undefined));\n                    if (clean && resolver.isExpandoFunctionDeclaration(input)) {\n                        var props = resolver.getPropertiesOfContainerFunction(input);\n                        // Use parseNodeFactory so it is usable as an enclosing declaration\n                        var fakespace_1 = ts.parseNodeFactory.createModuleDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, clean.name || factory.createIdentifier(\"_default\"), factory.createModuleBlock([]), 16 /* Namespace */);\n                        ts.setParent(fakespace_1, enclosingDeclaration);\n                        fakespace_1.locals = ts.createSymbolTable(props);\n                        fakespace_1.symbol = props[0].parent;\n                        var exportMappings_1 = [];\n                        var declarations = ts.mapDefined(props, function (p) {\n                            if (!ts.isPropertyAccessExpression(p.valueDeclaration)) {\n                                return undefined; // TODO GH#33569: Handle element access expressions that created late bound names (rather than silently omitting them)\n                            }\n                            getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);\n                            var type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace_1, declarationEmitNodeBuilderFlags, symbolTracker);\n                            getSymbolAccessibilityDiagnostic = oldDiag;\n                            var nameStr = ts.unescapeLeadingUnderscores(p.escapedName);\n                            var isNonContextualKeywordName = ts.isStringANonContextualKeyword(nameStr);\n                            var name = isNonContextualKeywordName ? factory.getGeneratedNameForNode(p.valueDeclaration) : factory.createIdentifier(nameStr);\n                            if (isNonContextualKeywordName) {\n                                exportMappings_1.push([name, nameStr]);\n                            }\n                            var varDecl = factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, type, /*initializer*/ undefined);\n                            return factory.createVariableStatement(isNonContextualKeywordName ? undefined : [factory.createToken(92 /* ExportKeyword */)], factory.createVariableDeclarationList([varDecl]));\n                        });\n                        if (!exportMappings_1.length) {\n                            declarations = ts.mapDefined(declarations, function (declaration) { return factory.updateModifiers(declaration, 0 /* None */); });\n                        }\n                        else {\n                            declarations.push(factory.createExportDeclaration(\n                            /*decorators*/ undefined, \n                            /*modifiers*/ undefined, \n                            /*isTypeOnly*/ false, factory.createNamedExports(ts.map(exportMappings_1, function (_a) {\n                                var gen = _a[0], exp = _a[1];\n                                return factory.createExportSpecifier(gen, exp);\n                            }))));\n                        }\n                        var namespaceDecl = factory.createModuleDeclaration(/*decorators*/ undefined, ensureModifiers(input), input.name, factory.createModuleBlock(declarations), 16 /* Namespace */);\n                        if (!ts.hasEffectiveModifier(clean, 512 /* Default */)) {\n                            return [clean, namespaceDecl];\n                        }\n                        var modifiers = factory.createModifiersFromModifierFlags((ts.getEffectiveModifierFlags(clean) & ~513 /* ExportDefault */) | 2 /* Ambient */);\n                        var cleanDeclaration = factory.updateFunctionDeclaration(clean, \n                        /*decorators*/ undefined, modifiers, \n                        /*asteriskToken*/ undefined, clean.name, clean.typeParameters, clean.parameters, clean.type, \n                        /*body*/ undefined);\n                        var namespaceDeclaration = factory.updateModuleDeclaration(namespaceDecl, \n                        /*decorators*/ undefined, modifiers, namespaceDecl.name, namespaceDecl.body);\n                        var exportDefaultDeclaration = factory.createExportAssignment(\n                        /*decorators*/ undefined, \n                        /*modifiers*/ undefined, \n                        /*isExportEquals*/ false, namespaceDecl.name);\n                        if (ts.isSourceFile(input.parent)) {\n                            resultHasExternalModuleIndicator = true;\n                        }\n                        resultHasScopeMarker = true;\n                        return [cleanDeclaration, namespaceDeclaration, exportDefaultDeclaration];\n                    }\n                    else {\n                        return clean;\n                    }\n                }\n                case 256 /* ModuleDeclaration */: {\n                    needsDeclare = false;\n                    var inner = input.body;\n                    if (inner && inner.kind === 257 /* ModuleBlock */) {\n                        var oldNeedsScopeFix = needsScopeFixMarker;\n                        var oldHasScopeFix = resultHasScopeMarker;\n                        resultHasScopeMarker = false;\n                        needsScopeFixMarker = false;\n                        var statements = ts.visitNodes(inner.statements, visitDeclarationStatements);\n                        var lateStatements = transformAndReplaceLatePaintedStatements(statements);\n                        if (input.flags & 8388608 /* Ambient */) {\n                            needsScopeFixMarker = false; // If it was `declare`'d everything is implicitly exported already, ignore late printed \"privates\"\n                        }\n                        // With the final list of statements, there are 3 possibilities:\n                        // 1. There's an export assignment or export declaration in the namespace - do nothing\n                        // 2. Everything is exported and there are no export assignments or export declarations - strip all export modifiers\n                        // 3. Some things are exported, some are not, and there's no marker - add an empty marker\n                        if (!ts.isGlobalScopeAugmentation(input) && !hasScopeMarker(lateStatements) && !resultHasScopeMarker) {\n                            if (needsScopeFixMarker) {\n                                lateStatements = factory.createNodeArray(__spreadArray(__spreadArray([], lateStatements), [ts.createEmptyExports(factory)]));\n                            }\n                            else {\n                                lateStatements = ts.visitNodes(lateStatements, stripExportModifiers);\n                            }\n                        }\n                        var body = factory.updateModuleBlock(inner, lateStatements);\n                        needsDeclare = previousNeedsDeclare;\n                        needsScopeFixMarker = oldNeedsScopeFix;\n                        resultHasScopeMarker = oldHasScopeFix;\n                        var mods = ensureModifiers(input);\n                        return cleanup(factory.updateModuleDeclaration(input, \n                        /*decorators*/ undefined, mods, ts.isExternalModuleAugmentation(input) ? rewriteModuleSpecifier(input, input.name) : input.name, body));\n                    }\n                    else {\n                        needsDeclare = previousNeedsDeclare;\n                        var mods = ensureModifiers(input);\n                        needsDeclare = false;\n                        ts.visitNode(inner, visitDeclarationStatements);\n                        // eagerly transform nested namespaces (the nesting doesn't need any elision or painting done)\n                        var id = ts.getOriginalNodeId(inner); // TODO: GH#18217\n                        var body = lateStatementReplacementMap.get(id);\n                        lateStatementReplacementMap.delete(id);\n                        return cleanup(factory.updateModuleDeclaration(input, \n                        /*decorators*/ undefined, mods, input.name, body));\n                    }\n                }\n                case 252 /* ClassDeclaration */: {\n                    errorNameNode = input.name;\n                    errorFallbackNode = input;\n                    var modifiers = factory.createNodeArray(ensureModifiers(input));\n                    var typeParameters = ensureTypeParams(input, input.typeParameters);\n                    var ctor = ts.getFirstConstructorWithBody(input);\n                    var parameterProperties = void 0;\n                    if (ctor) {\n                        var oldDiag_1 = getSymbolAccessibilityDiagnostic;\n                        parameterProperties = ts.compact(ts.flatMap(ctor.parameters, function (param) {\n                            if (!ts.hasSyntacticModifier(param, 92 /* ParameterPropertyModifier */) || shouldStripInternal(param))\n                                return;\n                            getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(param);\n                            if (param.name.kind === 78 /* Identifier */) {\n                                return preserveJsDoc(factory.createPropertyDeclaration(\n                                /*decorators*/ undefined, ensureModifiers(param), param.name, param.questionToken, ensureType(param, param.type), ensureNoInitializer(param)), param);\n                            }\n                            else {\n                                // Pattern - this is currently an error, but we emit declarations for it somewhat correctly\n                                return walkBindingPattern(param.name);\n                            }\n                            function walkBindingPattern(pattern) {\n                                var elems;\n                                for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {\n                                    var elem = _a[_i];\n                                    if (ts.isOmittedExpression(elem))\n                                        continue;\n                                    if (ts.isBindingPattern(elem.name)) {\n                                        elems = ts.concatenate(elems, walkBindingPattern(elem.name));\n                                    }\n                                    elems = elems || [];\n                                    elems.push(factory.createPropertyDeclaration(\n                                    /*decorators*/ undefined, ensureModifiers(param), elem.name, \n                                    /*questionToken*/ undefined, ensureType(elem, /*type*/ undefined), \n                                    /*initializer*/ undefined));\n                                }\n                                return elems;\n                            }\n                        }));\n                        getSymbolAccessibilityDiagnostic = oldDiag_1;\n                    }\n                    var hasPrivateIdentifier = ts.some(input.members, function (member) { return !!member.name && ts.isPrivateIdentifier(member.name); });\n                    // When the class has at least one private identifier, create a unique constant identifier to retain the nominal typing behavior\n                    // Prevents other classes with the same public members from being used in place of the current class\n                    var privateIdentifier = hasPrivateIdentifier ? [\n                        factory.createPropertyDeclaration(\n                        /*decorators*/ undefined, \n                        /*modifiers*/ undefined, factory.createPrivateIdentifier(\"#private\"), \n                        /*questionToken*/ undefined, \n                        /*type*/ undefined, \n                        /*initializer*/ undefined)\n                    ] : undefined;\n                    var memberNodes = ts.concatenate(ts.concatenate(privateIdentifier, parameterProperties), ts.visitNodes(input.members, visitDeclarationSubtree));\n                    var members = factory.createNodeArray(memberNodes);\n                    var extendsClause_1 = ts.getEffectiveBaseTypeNode(input);\n                    if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 103 /* NullKeyword */) {\n                        // We must add a temporary declaration for the extends clause expression\n                        var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : \"default\";\n                        var newId_1 = factory.createUniqueName(oldId + \"_base\", 16 /* Optimistic */);\n                        getSymbolAccessibilityDiagnostic = function () { return ({\n                            diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,\n                            errorNode: extendsClause_1,\n                            typeName: input.name\n                        }); };\n                        var varDecl = factory.createVariableDeclaration(newId_1, /*exclamationToken*/ undefined, resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined);\n                        var statement = factory.createVariableStatement(needsDeclare ? [factory.createModifier(133 /* DeclareKeyword */)] : [], factory.createVariableDeclarationList([varDecl], 2 /* Const */));\n                        var heritageClauses = factory.createNodeArray(ts.map(input.heritageClauses, function (clause) {\n                            if (clause.token === 93 /* ExtendsKeyword */) {\n                                var oldDiag_2 = getSymbolAccessibilityDiagnostic;\n                                getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(clause.types[0]);\n                                var newClause = factory.updateHeritageClause(clause, ts.map(clause.types, function (t) { return factory.updateExpressionWithTypeArguments(t, newId_1, ts.visitNodes(t.typeArguments, visitDeclarationSubtree)); }));\n                                getSymbolAccessibilityDiagnostic = oldDiag_2;\n                                return newClause;\n                            }\n                            return factory.updateHeritageClause(clause, ts.visitNodes(factory.createNodeArray(ts.filter(clause.types, function (t) { return ts.isEntityNameExpression(t.expression) || t.expression.kind === 103 /* NullKeyword */; })), visitDeclarationSubtree));\n                        }));\n                        return [statement, cleanup(factory.updateClassDeclaration(input, \n                            /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members))]; // TODO: GH#18217\n                    }\n                    else {\n                        var heritageClauses = transformHeritageClauses(input.heritageClauses);\n                        return cleanup(factory.updateClassDeclaration(input, \n                        /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members));\n                    }\n                }\n                case 232 /* VariableStatement */: {\n                    return cleanup(transformVariableStatement(input));\n                }\n                case 255 /* EnumDeclaration */: {\n                    return cleanup(factory.updateEnumDeclaration(input, /*decorators*/ undefined, factory.createNodeArray(ensureModifiers(input)), input.name, factory.createNodeArray(ts.mapDefined(input.members, function (m) {\n                        if (shouldStripInternal(m))\n                            return;\n                        // Rewrite enum values to their constants, if available\n                        var constValue = resolver.getConstantValue(m);\n                        return preserveJsDoc(factory.updateEnumMember(m, m.name, constValue !== undefined ? typeof constValue === \"string\" ? factory.createStringLiteral(constValue) : factory.createNumericLiteral(constValue) : undefined), m);\n                    }))));\n                }\n            }\n            // Anything left unhandled is an error, so this should be unreachable\n            return ts.Debug.assertNever(input, \"Unhandled top-level node in declaration emit: \" + ts.SyntaxKind[input.kind]);\n            function cleanup(node) {\n                if (isEnclosingDeclaration(input)) {\n                    enclosingDeclaration = previousEnclosingDeclaration;\n                }\n                if (canProdiceDiagnostic) {\n                    getSymbolAccessibilityDiagnostic = oldDiag;\n                }\n                if (input.kind === 256 /* ModuleDeclaration */) {\n                    needsDeclare = previousNeedsDeclare;\n                }\n                if (node === input) {\n                    return node;\n                }\n                errorFallbackNode = undefined;\n                errorNameNode = undefined;\n                return node && ts.setOriginalNode(preserveJsDoc(node, input), input);\n            }\n        }\n        function transformVariableStatement(input) {\n            if (!ts.forEach(input.declarationList.declarations, getBindingNameVisible))\n                return;\n            var nodes = ts.visitNodes(input.declarationList.declarations, visitDeclarationSubtree);\n            if (!ts.length(nodes))\n                return;\n            return factory.updateVariableStatement(input, factory.createNodeArray(ensureModifiers(input)), factory.updateVariableDeclarationList(input.declarationList, nodes));\n        }\n        function recreateBindingPattern(d) {\n            return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); }));\n        }\n        function recreateBindingElement(e) {\n            if (e.kind === 222 /* OmittedExpression */) {\n                return;\n            }\n            if (e.name) {\n                if (!getBindingNameVisible(e))\n                    return;\n                if (ts.isBindingPattern(e.name)) {\n                    return recreateBindingPattern(e.name);\n                }\n                else {\n                    return factory.createVariableDeclaration(e.name, /*exclamationToken*/ undefined, ensureType(e, /*type*/ undefined), /*initializer*/ undefined);\n                }\n            }\n        }\n        function checkName(node) {\n            var oldDiag;\n            if (!suppressNewDiagnosticContexts) {\n                oldDiag = getSymbolAccessibilityDiagnostic;\n                getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNodeName(node);\n            }\n            errorNameNode = node.name;\n            ts.Debug.assert(resolver.isLateBound(ts.getParseTreeNode(node))); // Should only be called with dynamic names\n            var decl = node;\n            var entityName = decl.name.expression;\n            checkEntityNameVisibility(entityName, enclosingDeclaration);\n            if (!suppressNewDiagnosticContexts) {\n                getSymbolAccessibilityDiagnostic = oldDiag;\n            }\n            errorNameNode = undefined;\n        }\n        function shouldStripInternal(node) {\n            return !!stripInternal && !!node && isInternalDeclaration(node, currentSourceFile);\n        }\n        function isScopeMarker(node) {\n            return ts.isExportAssignment(node) || ts.isExportDeclaration(node);\n        }\n        function hasScopeMarker(statements) {\n            return ts.some(statements, isScopeMarker);\n        }\n        function ensureModifiers(node) {\n            var currentFlags = ts.getEffectiveModifierFlags(node);\n            var newFlags = ensureModifierFlags(node);\n            if (currentFlags === newFlags) {\n                return node.modifiers;\n            }\n            return factory.createModifiersFromModifierFlags(newFlags);\n        }\n        function ensureModifierFlags(node) {\n            var mask = 11263 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files\n            var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */;\n            var parentIsFile = node.parent.kind === 297 /* SourceFile */;\n            if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) {\n                mask ^= 2 /* Ambient */;\n                additions = 0 /* None */;\n            }\n            return maskModifierFlags(node, mask, additions);\n        }\n        function getTypeAnnotationFromAllAccessorDeclarations(node, accessors) {\n            var accessorType = getTypeAnnotationFromAccessor(node);\n            if (!accessorType && node !== accessors.firstAccessor) {\n                accessorType = getTypeAnnotationFromAccessor(accessors.firstAccessor);\n                // If we end up pulling the type from the second accessor, we also need to change the diagnostic context to get the expected error message\n                getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(accessors.firstAccessor);\n            }\n            if (!accessorType && accessors.secondAccessor && node !== accessors.secondAccessor) {\n                accessorType = getTypeAnnotationFromAccessor(accessors.secondAccessor);\n                // If we end up pulling the type from the second accessor, we also need to change the diagnostic context to get the expected error message\n                getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(accessors.secondAccessor);\n            }\n            return accessorType;\n        }\n        function transformHeritageClauses(nodes) {\n            return factory.createNodeArray(ts.filter(ts.map(nodes, function (clause) { return factory.updateHeritageClause(clause, ts.visitNodes(factory.createNodeArray(ts.filter(clause.types, function (t) {\n                return ts.isEntityNameExpression(t.expression) || (clause.token === 93 /* ExtendsKeyword */ && t.expression.kind === 103 /* NullKeyword */);\n            })), visitDeclarationSubtree)); }), function (clause) { return clause.types && !!clause.types.length; }));\n        }\n    }\n    ts.transformDeclarations = transformDeclarations;\n    function isAlwaysType(node) {\n        if (node.kind === 253 /* InterfaceDeclaration */) {\n            return true;\n        }\n        return false;\n    }\n    // Elide \"public\" modifier, as it is the default\n    function maskModifiers(node, modifierMask, modifierAdditions) {\n        return ts.factory.createModifiersFromModifierFlags(maskModifierFlags(node, modifierMask, modifierAdditions));\n    }\n    function maskModifierFlags(node, modifierMask, modifierAdditions) {\n        if (modifierMask === void 0) { modifierMask = 11263 /* All */ ^ 4 /* Public */; }\n        if (modifierAdditions === void 0) { modifierAdditions = 0 /* None */; }\n        var flags = (ts.getEffectiveModifierFlags(node) & modifierMask) | modifierAdditions;\n        if (flags & 512 /* Default */ && !(flags & 1 /* Export */)) {\n            // A non-exported default is a nonsequitor - we usually try to remove all export modifiers\n            // from statements in ambient declarations; but a default export must retain its export modifier to be syntactically valid\n            flags ^= 1 /* Export */;\n        }\n        if (flags & 512 /* Default */ && flags & 2 /* Ambient */) {\n            flags ^= 2 /* Ambient */; // `declare` is never required alongside `default` (and would be an error if printed)\n        }\n        return flags;\n    }\n    function getTypeAnnotationFromAccessor(accessor) {\n        if (accessor) {\n            return accessor.kind === 167 /* GetAccessor */\n                ? accessor.type // Getter - return type\n                : accessor.parameters.length > 0\n                    ? accessor.parameters[0].type // Setter parameter type\n                    : undefined;\n        }\n    }\n    function canHaveLiteralInitializer(node) {\n        switch (node.kind) {\n            case 163 /* PropertyDeclaration */:\n            case 162 /* PropertySignature */:\n                return !ts.hasEffectiveModifier(node, 8 /* Private */);\n            case 160 /* Parameter */:\n            case 249 /* VariableDeclaration */:\n                return true;\n        }\n        return false;\n    }\n    function isPreservedDeclarationStatement(node) {\n        switch (node.kind) {\n            case 251 /* FunctionDeclaration */:\n            case 256 /* ModuleDeclaration */:\n            case 260 /* ImportEqualsDeclaration */:\n            case 253 /* InterfaceDeclaration */:\n            case 252 /* ClassDeclaration */:\n            case 254 /* TypeAliasDeclaration */:\n            case 255 /* EnumDeclaration */:\n            case 232 /* VariableStatement */:\n            case 261 /* ImportDeclaration */:\n            case 267 /* ExportDeclaration */:\n            case 266 /* ExportAssignment */:\n                return true;\n        }\n        return false;\n    }\n    function isProcessedComponent(node) {\n        switch (node.kind) {\n            case 170 /* ConstructSignature */:\n            case 166 /* Constructor */:\n            case 165 /* MethodDeclaration */:\n            case 167 /* GetAccessor */:\n            case 168 /* SetAccessor */:\n            case 163 /* PropertyDeclaration */:\n            case 162 /* PropertySignature */:\n            case 164 /* MethodSignature */:\n            case 169 /* CallSignature */:\n            case 171 /* IndexSignature */:\n            case 249 /* VariableDeclaration */:\n            case 159 /* TypeParameter */:\n            case 223 /* ExpressionWithTypeArguments */:\n            case 173 /* TypeReference */:\n            case 184 /* ConditionalType */:\n            case 174 /* FunctionType */:\n            case 175 /* ConstructorType */:\n            case 195 /* ImportType */:\n                return true;\n        }\n        return false;\n    }\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    function getModuleTransformer(moduleKind) {\n        switch (moduleKind) {\n            case ts.ModuleKind.ESNext:\n            case ts.ModuleKind.ES2020:\n            case ts.ModuleKind.ES2015:\n                return ts.transformECMAScriptModule;\n            case ts.ModuleKind.System:\n                return ts.transformSystemModule;\n            default:\n                return ts.transformModule;\n        }\n    }\n    var TransformationState;\n    (function (TransformationState) {\n        TransformationState[TransformationState[\"Uninitialized\"] = 0] = \"Uninitialized\";\n        TransformationState[TransformationState[\"Initialized\"] = 1] = \"Initialized\";\n        TransformationState[TransformationState[\"Completed\"] = 2] = \"Completed\";\n        TransformationState[TransformationState[\"Disposed\"] = 3] = \"Disposed\";\n    })(TransformationState || (TransformationState = {}));\n    var SyntaxKindFeatureFlags;\n    (function (SyntaxKindFeatureFlags) {\n        SyntaxKindFeatureFlags[SyntaxKindFeatureFlags[\"Substitution\"] = 1] = \"Substitution\";\n        SyntaxKindFeatureFlags[SyntaxKindFeatureFlags[\"EmitNotifications\"] = 2] = \"EmitNotifications\";\n    })(SyntaxKindFeatureFlags || (SyntaxKindFeatureFlags = {}));\n    ts.noTransformers = { scriptTransformers: ts.emptyArray, declarationTransformers: ts.emptyArray };\n    function getTransformers(compilerOptions, customTransformers, emitOnlyDtsFiles) {\n        return {\n            scriptTransformers: getScriptTransformers(compilerOptions, customTransformers, emitOnlyDtsFiles),\n            declarationTransformers: getDeclarationTransformers(customTransformers),\n        };\n    }\n    ts.getTransformers = getTransformers;\n    function getScriptTransformers(compilerOptions, customTransformers, emitOnlyDtsFiles) {\n        if (emitOnlyDtsFiles)\n            return ts.emptyArray;\n        var languageVersion = ts.getEmitScriptTarget(compilerOptions);\n        var moduleKind = ts.getEmitModuleKind(compilerOptions);\n        var transformers = [];\n        ts.addRange(transformers, customTransformers && ts.map(customTransformers.before, wrapScriptTransformerFactory));\n        transformers.push(ts.transformTypeScript);\n        transformers.push(ts.transformClassFields);\n        if (ts.getJSXTransformEnabled(compilerOptions)) {\n            transformers.push(ts.transformJsx);\n        }\n        if (languageVersion < 99 /* ESNext */) {\n            transformers.push(ts.transformESNext);\n        }\n        if (languageVersion < 7 /* ES2020 */) {\n            transformers.push(ts.transformES2020);\n        }\n        if (languageVersion < 6 /* ES2019 */) {\n            transformers.push(ts.transformES2019);\n        }\n        if (languageVersion < 5 /* ES2018 */) {\n            transformers.push(ts.transformES2018);\n        }\n        if (languageVersion < 4 /* ES2017 */) {\n            transformers.push(ts.transformES2017);\n        }\n        if (languageVersion < 3 /* ES2016 */) {\n            transformers.push(ts.transformES2016);\n        }\n        if (languageVersion < 2 /* ES2015 */) {\n            transformers.push(ts.transformES2015);\n            transformers.push(ts.transformGenerators);\n        }\n        transformers.push(getModuleTransformer(moduleKind));\n        // The ES5 transformer is last so that it can substitute expressions like `exports.default`\n        // for ES3.\n        if (languageVersion < 1 /* ES5 */) {\n            transformers.push(ts.transformES5);\n        }\n        ts.addRange(transformers, customTransformers && ts.map(customTransformers.after, wrapScriptTransformerFactory));\n        return transformers;\n    }\n    function getDeclarationTransformers(customTransformers) {\n        var transformers = [];\n        transformers.push(ts.transformDeclarations);\n        ts.addRange(transformers, customTransformers && ts.map(customTransformers.afterDeclarations, wrapDeclarationTransformerFactory));\n        return transformers;\n    }\n    /**\n     * Wrap a custom script or declaration transformer object in a `Transformer` callback with fallback support for transforming bundles.\n     */\n    function wrapCustomTransformer(transformer) {\n        return function (node) { return ts.isBundle(node) ? transformer.transformBundle(node) : transformer.transformSourceFile(node); };\n    }\n    /**\n     * Wrap a transformer factory that may return a custom script or declaration transformer object.\n     */\n    function wrapCustomTransformerFactory(transformer, handleDefault) {\n        return function (context) {\n            var customTransformer = transformer(context);\n            return typeof customTransformer === \"function\"\n                ? handleDefault(context, customTransformer)\n                : wrapCustomTransformer(customTransformer);\n        };\n    }\n    function wrapScriptTransformerFactory(transformer) {\n        return wrapCustomTransformerFactory(transformer, ts.chainBundle);\n    }\n    function wrapDeclarationTransformerFactory(transformer) {\n        return wrapCustomTransformerFactory(transformer, function (_, node) { return node; });\n    }\n    function noEmitSubstitution(_hint, node) {\n        return node;\n    }\n    ts.noEmitSubstitution = noEmitSubstitution;\n    function noEmitNotification(hint, node, callback) {\n        callback(hint, node);\n    }\n    ts.noEmitNotification = noEmitNotification;\n    /**\n     * Transforms an array of SourceFiles by passing them through each transformer.\n     *\n     * @param resolver The emit resolver provided by the checker.\n     * @param host The emit host object used to interact with the file system.\n     * @param options Compiler options to surface in the `TransformationContext`.\n     * @param nodes An array of nodes to transform.\n     * @param transforms An array of `TransformerFactory` callbacks.\n     * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files.\n     */\n    function transformNodes(resolver, host, factory, options, nodes, transformers, allowDtsFiles) {\n        var enabledSyntaxKindFeatures = new Array(341 /* Count */);\n        var lexicalEnvironmentVariableDeclarations;\n        var lexicalEnvironmentFunctionDeclarations;\n        var lexicalEnvironmentStatements;\n        var lexicalEnvironmentFlags = 0 /* None */;\n        var lexicalEnvironmentVariableDeclarationsStack = [];\n        var lexicalEnvironmentFunctionDeclarationsStack = [];\n        var lexicalEnvironmentStatementsStack = [];\n        var lexicalEnvironmentFlagsStack = [];\n        var lexicalEnvironmentStackOffset = 0;\n        var lexicalEnvironmentSuspended = false;\n        var emitHelpers;\n        var onSubstituteNode = noEmitSubstitution;\n        var onEmitNode = noEmitNotification;\n        var state = 0 /* Uninitialized */;\n        var diagnostics = [];\n        // The transformation context is provided to each transformer as part of transformer\n        // initialization.\n        var context = {\n            factory: factory,\n            getCompilerOptions: function () { return options; },\n            getEmitResolver: function () { return resolver; },\n            getEmitHost: function () { return host; },\n            getEmitHelperFactory: ts.memoize(function () { return ts.createEmitHelperFactory(context); }),\n            startLexicalEnvironment: startLexicalEnvironment,\n            suspendLexicalEnvironment: suspendLexicalEnvironment,\n            resumeLexicalEnvironment: resumeLexicalEnvironment,\n            endLexicalEnvironment: endLexicalEnvironment,\n            setLexicalEnvironmentFlags: setLexicalEnvironmentFlags,\n            getLexicalEnvironmentFlags: getLexicalEnvironmentFlags,\n            hoistVariableDeclaration: hoistVariableDeclaration,\n            hoistFunctionDeclaration: hoistFunctionDeclaration,\n            addInitializationStatement: addInitializationStatement,\n            requestEmitHelper: requestEmitHelper,\n            readEmitHelpers: readEmitHelpers,\n            enableSubstitution: enableSubstitution,\n            enableEmitNotification: enableEmitNotification,\n            isSubstitutionEnabled: isSubstitutionEnabled,\n            isEmitNotificationEnabled: isEmitNotificationEnabled,\n            get onSubstituteNode() { return onSubstituteNode; },\n            set onSubstituteNode(value) {\n                ts.Debug.assert(state < 1 /* Initialized */, \"Cannot modify transformation hooks after initialization has completed.\");\n                ts.Debug.assert(value !== undefined, \"Value must not be 'undefined'\");\n                onSubstituteNode = value;\n            },\n            get onEmitNode() { return onEmitNode; },\n            set onEmitNode(value) {\n                ts.Debug.assert(state < 1 /* Initialized */, \"Cannot modify transformation hooks after initialization has completed.\");\n                ts.Debug.assert(value !== undefined, \"Value must not be 'undefined'\");\n                onEmitNode = value;\n            },\n            addDiagnostic: function (diag) {\n                diagnostics.push(diag);\n            }\n        };\n        // Ensure the parse tree is clean before applying transformations\n        for (var _i = 0, nodes_2 = nodes; _i < nodes_2.length; _i++) {\n            var node = nodes_2[_i];\n            ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node)));\n        }\n        ts.performance.mark(\"beforeTransform\");\n        // Chain together and initialize each transformer.\n        var transformersWithContext = transformers.map(function (t) { return t(context); });\n        var transformation = function (node) {\n            for (var _i = 0, transformersWithContext_1 = transformersWithContext; _i < transformersWithContext_1.length; _i++) {\n                var transform = transformersWithContext_1[_i];\n                node = transform(node);\n            }\n            return node;\n        };\n        // prevent modification of transformation hooks.\n        state = 1 /* Initialized */;\n        // Transform each node.\n        var transformed = [];\n        for (var _a = 0, nodes_3 = nodes; _a < nodes_3.length; _a++) {\n            var node = nodes_3[_a];\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"emit\" /* Emit */, \"transformNodes\", node.kind === 297 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end });\n            transformed.push((allowDtsFiles ? transformation : transformRoot)(node));\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n        }\n        // prevent modification of the lexical environment.\n        state = 2 /* Completed */;\n        ts.performance.mark(\"afterTransform\");\n        ts.performance.measure(\"transformTime\", \"beforeTransform\", \"afterTransform\");\n        return {\n            transformed: transformed,\n            substituteNode: substituteNode,\n            emitNodeWithNotification: emitNodeWithNotification,\n            isEmitNotificationEnabled: isEmitNotificationEnabled,\n            dispose: dispose,\n            diagnostics: diagnostics\n        };\n        function transformRoot(node) {\n            return node && (!ts.isSourceFile(node) || !node.isDeclarationFile) ? transformation(node) : node;\n        }\n        /**\n         * Enables expression substitutions in the pretty printer for the provided SyntaxKind.\n         */\n        function enableSubstitution(kind) {\n            ts.Debug.assert(state < 2 /* Completed */, \"Cannot modify the transformation context after transformation has completed.\");\n            enabledSyntaxKindFeatures[kind] |= 1 /* Substitution */;\n        }\n        /**\n         * Determines whether expression substitutions are enabled for the provided node.\n         */\n        function isSubstitutionEnabled(node) {\n            return (enabledSyntaxKindFeatures[node.kind] & 1 /* Substitution */) !== 0\n                && (ts.getEmitFlags(node) & 4 /* NoSubstitution */) === 0;\n        }\n        /**\n         * Emits a node with possible substitution.\n         *\n         * @param hint A hint as to the intended usage of the node.\n         * @param node The node to emit.\n         * @param emitCallback The callback used to emit the node or its substitute.\n         */\n        function substituteNode(hint, node) {\n            ts.Debug.assert(state < 3 /* Disposed */, \"Cannot substitute a node after the result is disposed.\");\n            return node && isSubstitutionEnabled(node) && onSubstituteNode(hint, node) || node;\n        }\n        /**\n         * Enables before/after emit notifications in the pretty printer for the provided SyntaxKind.\n         */\n        function enableEmitNotification(kind) {\n            ts.Debug.assert(state < 2 /* Completed */, \"Cannot modify the transformation context after transformation has completed.\");\n            enabledSyntaxKindFeatures[kind] |= 2 /* EmitNotifications */;\n        }\n        /**\n         * Determines whether before/after emit notifications should be raised in the pretty\n         * printer when it emits a node.\n         */\n        function isEmitNotificationEnabled(node) {\n            return (enabledSyntaxKindFeatures[node.kind] & 2 /* EmitNotifications */) !== 0\n                || (ts.getEmitFlags(node) & 2 /* AdviseOnEmitNode */) !== 0;\n        }\n        /**\n         * Emits a node with possible emit notification.\n         *\n         * @param hint A hint as to the intended usage of the node.\n         * @param node The node to emit.\n         * @param emitCallback The callback used to emit the node.\n         */\n        function emitNodeWithNotification(hint, node, emitCallback) {\n            ts.Debug.assert(state < 3 /* Disposed */, \"Cannot invoke TransformationResult callbacks after the result is disposed.\");\n            if (node) {\n                // TODO: Remove check and unconditionally use onEmitNode when API is breakingly changed\n                // (see https://github.com/microsoft/TypeScript/pull/36248/files/5062623f39120171b98870c71344b3242eb03d23#r369766739)\n                if (isEmitNotificationEnabled(node)) {\n                    onEmitNode(hint, node, emitCallback);\n                }\n                else {\n                    emitCallback(hint, node);\n                }\n            }\n        }\n        /**\n         * Records a hoisted variable declaration for the provided name within a lexical environment.\n         */\n        function hoistVariableDeclaration(name) {\n            ts.Debug.assert(state > 0 /* Uninitialized */, \"Cannot modify the lexical environment during initialization.\");\n            ts.Debug.assert(state < 2 /* Completed */, \"Cannot modify the lexical environment after transformation has completed.\");\n            var decl = ts.setEmitFlags(factory.createVariableDeclaration(name), 64 /* NoNestedSourceMaps */);\n            if (!lexicalEnvironmentVariableDeclarations) {\n                lexicalEnvironmentVariableDeclarations = [decl];\n            }\n            else {\n                lexicalEnvironmentVariableDeclarations.push(decl);\n            }\n            if (lexicalEnvironmentFlags & 1 /* InParameters */) {\n                lexicalEnvironmentFlags |= 2 /* VariablesHoistedInParameters */;\n            }\n        }\n        /**\n         * Records a hoisted function declaration within a lexical environment.\n         */\n        function hoistFunctionDeclaration(func) {\n            ts.Debug.assert(state > 0 /* Uninitialized */, \"Cannot modify the lexical environment during initialization.\");\n            ts.Debug.assert(state < 2 /* Completed */, \"Cannot modify the lexical environment after transformation has completed.\");\n            ts.setEmitFlags(func, 1048576 /* CustomPrologue */);\n            if (!lexicalEnvironmentFunctionDeclarations) {\n                lexicalEnvironmentFunctionDeclarations = [func];\n            }\n            else {\n                lexicalEnvironmentFunctionDeclarations.push(func);\n            }\n        }\n        /**\n         * Adds an initialization statement to the top of the lexical environment.\n         */\n        function addInitializationStatement(node) {\n            ts.Debug.assert(state > 0 /* Uninitialized */, \"Cannot modify the lexical environment during initialization.\");\n            ts.Debug.assert(state < 2 /* Completed */, \"Cannot modify the lexical environment after transformation has completed.\");\n            ts.setEmitFlags(node, 1048576 /* CustomPrologue */);\n            if (!lexicalEnvironmentStatements) {\n                lexicalEnvironmentStatements = [node];\n            }\n            else {\n                lexicalEnvironmentStatements.push(node);\n            }\n        }\n        /**\n         * Starts a new lexical environment. Any existing hoisted variable or function declarations\n         * are pushed onto a stack, and the related storage variables are reset.\n         */\n        function startLexicalEnvironment() {\n            ts.Debug.assert(state > 0 /* Uninitialized */, \"Cannot modify the lexical environment during initialization.\");\n            ts.Debug.assert(state < 2 /* Completed */, \"Cannot modify the lexical environment after transformation has completed.\");\n            ts.Debug.assert(!lexicalEnvironmentSuspended, \"Lexical environment is suspended.\");\n            // Save the current lexical environment. Rather than resizing the array we adjust the\n            // stack size variable. This allows us to reuse existing array slots we've\n            // already allocated between transformations to avoid allocation and GC overhead during\n            // transformation.\n            lexicalEnvironmentVariableDeclarationsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentVariableDeclarations;\n            lexicalEnvironmentFunctionDeclarationsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentFunctionDeclarations;\n            lexicalEnvironmentStatementsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentStatements;\n            lexicalEnvironmentFlagsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentFlags;\n            lexicalEnvironmentStackOffset++;\n            lexicalEnvironmentVariableDeclarations = undefined;\n            lexicalEnvironmentFunctionDeclarations = undefined;\n            lexicalEnvironmentStatements = undefined;\n            lexicalEnvironmentFlags = 0 /* None */;\n        }\n        /** Suspends the current lexical environment, usually after visiting a parameter list. */\n        function suspendLexicalEnvironment() {\n            ts.Debug.assert(state > 0 /* Uninitialized */, \"Cannot modify the lexical environment during initialization.\");\n            ts.Debug.assert(state < 2 /* Completed */, \"Cannot modify the lexical environment after transformation has completed.\");\n            ts.Debug.assert(!lexicalEnvironmentSuspended, \"Lexical environment is already suspended.\");\n            lexicalEnvironmentSuspended = true;\n        }\n        /** Resumes a suspended lexical environment, usually before visiting a function body. */\n        function resumeLexicalEnvironment() {\n            ts.Debug.assert(state > 0 /* Uninitialized */, \"Cannot modify the lexical environment during initialization.\");\n            ts.Debug.assert(state < 2 /* Completed */, \"Cannot modify the lexical environment after transformation has completed.\");\n            ts.Debug.assert(lexicalEnvironmentSuspended, \"Lexical environment is not suspended.\");\n            lexicalEnvironmentSuspended = false;\n        }\n        /**\n         * Ends a lexical environment. The previous set of hoisted declarations are restored and\n         * any hoisted declarations added in this environment are returned.\n         */\n        function endLexicalEnvironment() {\n            ts.Debug.assert(state > 0 /* Uninitialized */, \"Cannot modify the lexical environment during initialization.\");\n            ts.Debug.assert(state < 2 /* Completed */, \"Cannot modify the lexical environment after transformation has completed.\");\n            ts.Debug.assert(!lexicalEnvironmentSuspended, \"Lexical environment is suspended.\");\n            var statements;\n            if (lexicalEnvironmentVariableDeclarations ||\n                lexicalEnvironmentFunctionDeclarations ||\n                lexicalEnvironmentStatements) {\n                if (lexicalEnvironmentFunctionDeclarations) {\n                    statements = __spreadArray([], lexicalEnvironmentFunctionDeclarations);\n                }\n                if (lexicalEnvironmentVariableDeclarations) {\n                    var statement = factory.createVariableStatement(\n                    /*modifiers*/ undefined, factory.createVariableDeclarationList(lexicalEnvironmentVariableDeclarations));\n                    ts.setEmitFlags(statement, 1048576 /* CustomPrologue */);\n                    if (!statements) {\n                        statements = [statement];\n                    }\n                    else {\n                        statements.push(statement);\n                    }\n                }\n                if (lexicalEnvironmentStatements) {\n                    if (!statements) {\n                        statements = __spreadArray([], lexicalEnvironmentStatements);\n                    }\n                    else {\n                        statements = __spreadArray(__spreadArray([], statements), lexicalEnvironmentStatements);\n                    }\n                }\n            }\n            // Restore the previous lexical environment.\n            lexicalEnvironmentStackOffset--;\n            lexicalEnvironmentVariableDeclarations = lexicalEnvironmentVariableDeclarationsStack[lexicalEnvironmentStackOffset];\n            lexicalEnvironmentFunctionDeclarations = lexicalEnvironmentFunctionDeclarationsStack[lexicalEnvironmentStackOffset];\n            lexicalEnvironmentStatements = lexicalEnvironmentStatementsStack[lexicalEnvironmentStackOffset];\n            lexicalEnvironmentFlags = lexicalEnvironmentFlagsStack[lexicalEnvironmentStackOffset];\n            if (lexicalEnvironmentStackOffset === 0) {\n                lexicalEnvironmentVariableDeclarationsStack = [];\n                lexicalEnvironmentFunctionDeclarationsStack = [];\n                lexicalEnvironmentStatementsStack = [];\n                lexicalEnvironmentFlagsStack = [];\n            }\n            return statements;\n        }\n        function setLexicalEnvironmentFlags(flags, value) {\n            lexicalEnvironmentFlags = value ?\n                lexicalEnvironmentFlags | flags :\n                lexicalEnvironmentFlags & ~flags;\n        }\n        function getLexicalEnvironmentFlags() {\n            return lexicalEnvironmentFlags;\n        }\n        function requestEmitHelper(helper) {\n            ts.Debug.assert(state > 0 /* Uninitialized */, \"Cannot modify the transformation context during initialization.\");\n            ts.Debug.assert(state < 2 /* Completed */, \"Cannot modify the transformation context after transformation has completed.\");\n            ts.Debug.assert(!helper.scoped, \"Cannot request a scoped emit helper.\");\n            if (helper.dependencies) {\n                for (var _i = 0, _a = helper.dependencies; _i < _a.length; _i++) {\n                    var h = _a[_i];\n                    requestEmitHelper(h);\n                }\n            }\n            emitHelpers = ts.append(emitHelpers, helper);\n        }\n        function readEmitHelpers() {\n            ts.Debug.assert(state > 0 /* Uninitialized */, \"Cannot modify the transformation context during initialization.\");\n            ts.Debug.assert(state < 2 /* Completed */, \"Cannot modify the transformation context after transformation has completed.\");\n            var helpers = emitHelpers;\n            emitHelpers = undefined;\n            return helpers;\n        }\n        function dispose() {\n            if (state < 3 /* Disposed */) {\n                // Clean up emit nodes on parse tree\n                for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) {\n                    var node = nodes_4[_i];\n                    ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node)));\n                }\n                // Release references to external entries for GC purposes.\n                lexicalEnvironmentVariableDeclarations = undefined;\n                lexicalEnvironmentVariableDeclarationsStack = undefined;\n                lexicalEnvironmentFunctionDeclarations = undefined;\n                lexicalEnvironmentFunctionDeclarationsStack = undefined;\n                onSubstituteNode = undefined;\n                onEmitNode = undefined;\n                emitHelpers = undefined;\n                // Prevent further use of the transformation result.\n                state = 3 /* Disposed */;\n            }\n        }\n    }\n    ts.transformNodes = transformNodes;\n    ts.nullTransformationContext = {\n        get factory() { return ts.factory; },\n        enableEmitNotification: ts.noop,\n        enableSubstitution: ts.noop,\n        endLexicalEnvironment: ts.returnUndefined,\n        getCompilerOptions: function () { return ({}); },\n        getEmitHost: ts.notImplemented,\n        getEmitResolver: ts.notImplemented,\n        getEmitHelperFactory: ts.notImplemented,\n        setLexicalEnvironmentFlags: ts.noop,\n        getLexicalEnvironmentFlags: function () { return 0; },\n        hoistFunctionDeclaration: ts.noop,\n        hoistVariableDeclaration: ts.noop,\n        addInitializationStatement: ts.noop,\n        isEmitNotificationEnabled: ts.notImplemented,\n        isSubstitutionEnabled: ts.notImplemented,\n        onEmitNode: ts.noop,\n        onSubstituteNode: ts.notImplemented,\n        readEmitHelpers: ts.notImplemented,\n        requestEmitHelper: ts.noop,\n        resumeLexicalEnvironment: ts.noop,\n        startLexicalEnvironment: ts.noop,\n        suspendLexicalEnvironment: ts.noop,\n        addDiagnostic: ts.noop,\n    };\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    var brackets = createBracketsMap();\n    var syntheticParent = { pos: -1, end: -1 };\n    /*@internal*/\n    function isBuildInfoFile(file) {\n        return ts.fileExtensionIs(file, \".tsbuildinfo\" /* TsBuildInfo */);\n    }\n    ts.isBuildInfoFile = isBuildInfoFile;\n    /*@internal*/\n    /**\n     * Iterates over the source files that are expected to have an emit output.\n     *\n     * @param host An EmitHost.\n     * @param action The action to execute.\n     * @param sourceFilesOrTargetSourceFile\n     *   If an array, the full list of source files to emit.\n     *   Else, calls `getSourceFilesToEmit` with the (optional) target source file to determine the list of source files to emit.\n     */\n    function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, forceDtsEmit, onlyBuildInfo, includeBuildInfo) {\n        if (forceDtsEmit === void 0) { forceDtsEmit = false; }\n        var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile, forceDtsEmit);\n        var options = host.getCompilerOptions();\n        if (ts.outFile(options)) {\n            var prepends = host.getPrependNodes();\n            if (sourceFiles.length || prepends.length) {\n                var bundle = ts.factory.createBundle(sourceFiles, prepends);\n                var result = action(getOutputPathsFor(bundle, host, forceDtsEmit), bundle);\n                if (result) {\n                    return result;\n                }\n            }\n        }\n        else {\n            if (!onlyBuildInfo) {\n                for (var _a = 0, sourceFiles_1 = sourceFiles; _a < sourceFiles_1.length; _a++) {\n                    var sourceFile = sourceFiles_1[_a];\n                    var result = action(getOutputPathsFor(sourceFile, host, forceDtsEmit), sourceFile);\n                    if (result) {\n                        return result;\n                    }\n                }\n            }\n            if (includeBuildInfo) {\n                var buildInfoPath = getTsBuildInfoEmitOutputFilePath(options);\n                if (buildInfoPath)\n                    return action({ buildInfoPath: buildInfoPath }, /*sourceFileOrBundle*/ undefined);\n            }\n        }\n    }\n    ts.forEachEmittedFile = forEachEmittedFile;\n    function getTsBuildInfoEmitOutputFilePath(options) {\n        var configFile = options.configFilePath;\n        if (!ts.isIncrementalCompilation(options))\n            return undefined;\n        if (options.tsBuildInfoFile)\n            return options.tsBuildInfoFile;\n        var outPath = ts.outFile(options);\n        var buildInfoExtensionLess;\n        if (outPath) {\n            buildInfoExtensionLess = ts.removeFileExtension(outPath);\n        }\n        else {\n            if (!configFile)\n                return undefined;\n            var configFileExtensionLess = ts.removeFileExtension(configFile);\n            buildInfoExtensionLess = options.outDir ?\n                options.rootDir ?\n                    ts.resolvePath(options.outDir, ts.getRelativePathFromDirectory(options.rootDir, configFileExtensionLess, /*ignoreCase*/ true)) :\n                    ts.combinePaths(options.outDir, ts.getBaseFileName(configFileExtensionLess)) :\n                configFileExtensionLess;\n        }\n        return buildInfoExtensionLess + \".tsbuildinfo\" /* TsBuildInfo */;\n    }\n    ts.getTsBuildInfoEmitOutputFilePath = getTsBuildInfoEmitOutputFilePath;\n    /*@internal*/\n    function getOutputPathsForBundle(options, forceDtsPaths) {\n        var outPath = ts.outFile(options);\n        var jsFilePath = options.emitDeclarationOnly ? undefined : outPath;\n        var sourceMapFilePath = jsFilePath && getSourceMapFilePath(jsFilePath, options);\n        var declarationFilePath = (forceDtsPaths || ts.getEmitDeclarations(options)) ? ts.removeFileExtension(outPath) + \".d.ts\" /* Dts */ : undefined;\n        var declarationMapPath = declarationFilePath && ts.getAreDeclarationMapsEnabled(options) ? declarationFilePath + \".map\" : undefined;\n        var buildInfoPath = getTsBuildInfoEmitOutputFilePath(options);\n        return { jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath, declarationMapPath: declarationMapPath, buildInfoPath: buildInfoPath };\n    }\n    ts.getOutputPathsForBundle = getOutputPathsForBundle;\n    /*@internal*/\n    function getOutputPathsFor(sourceFile, host, forceDtsPaths) {\n        var options = host.getCompilerOptions();\n        if (sourceFile.kind === 298 /* Bundle */) {\n            return getOutputPathsForBundle(options, forceDtsPaths);\n        }\n        else {\n            var ownOutputFilePath = ts.getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile, options));\n            var isJsonFile = ts.isJsonSourceFile(sourceFile);\n            // If json file emits to the same location skip writing it, if emitDeclarationOnly skip writing it\n            var isJsonEmittedToSameLocation = isJsonFile &&\n                ts.comparePaths(sourceFile.fileName, ownOutputFilePath, host.getCurrentDirectory(), !host.useCaseSensitiveFileNames()) === 0 /* EqualTo */;\n            var jsFilePath = options.emitDeclarationOnly || isJsonEmittedToSameLocation ? undefined : ownOutputFilePath;\n            var sourceMapFilePath = !jsFilePath || ts.isJsonSourceFile(sourceFile) ? undefined : getSourceMapFilePath(jsFilePath, options);\n            var declarationFilePath = (forceDtsPaths || (ts.getEmitDeclarations(options) && !isJsonFile)) ? ts.getDeclarationEmitOutputFilePath(sourceFile.fileName, host) : undefined;\n            var declarationMapPath = declarationFilePath && ts.getAreDeclarationMapsEnabled(options) ? declarationFilePath + \".map\" : undefined;\n            return { jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath, declarationMapPath: declarationMapPath, buildInfoPath: undefined };\n        }\n    }\n    ts.getOutputPathsFor = getOutputPathsFor;\n    function getSourceMapFilePath(jsFilePath, options) {\n        return (options.sourceMap && !options.inlineSourceMap) ? jsFilePath + \".map\" : undefined;\n    }\n    // JavaScript files are always LanguageVariant.JSX, as JSX syntax is allowed in .js files also.\n    // So for JavaScript files, '.jsx' is only emitted if the input was '.jsx', and JsxEmit.Preserve.\n    // For TypeScript, the only time to emit with a '.jsx' extension, is on JSX input, and JsxEmit.Preserve\n    /* @internal */\n    function getOutputExtension(sourceFile, options) {\n        if (ts.isJsonSourceFile(sourceFile)) {\n            return \".json\" /* Json */;\n        }\n        if (options.jsx === 1 /* Preserve */) {\n            if (ts.isSourceFileJS(sourceFile)) {\n                if (ts.fileExtensionIs(sourceFile.fileName, \".jsx\" /* Jsx */)) {\n                    return \".jsx\" /* Jsx */;\n                }\n            }\n            else if (sourceFile.languageVariant === 1 /* JSX */) {\n                // TypeScript source file preserving JSX syntax\n                return \".jsx\" /* Jsx */;\n            }\n        }\n        return \".js\" /* Js */;\n    }\n    ts.getOutputExtension = getOutputExtension;\n    function getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, outputDir, getCommonSourceDirectory) {\n        return outputDir ?\n            ts.resolvePath(outputDir, ts.getRelativePathFromDirectory(getCommonSourceDirectory ? getCommonSourceDirectory() : getCommonSourceDirectoryOfConfig(configFile, ignoreCase), inputFileName, ignoreCase)) :\n            inputFileName;\n    }\n    /* @internal */\n    function getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory) {\n        ts.Debug.assert(!ts.fileExtensionIs(inputFileName, \".d.ts\" /* Dts */) && !ts.fileExtensionIs(inputFileName, \".json\" /* Json */));\n        return ts.changeExtension(getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.declarationDir || configFile.options.outDir, getCommonSourceDirectory), \".d.ts\" /* Dts */);\n    }\n    ts.getOutputDeclarationFileName = getOutputDeclarationFileName;\n    function getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory) {\n        if (configFile.options.emitDeclarationOnly)\n            return undefined;\n        var isJsonFile = ts.fileExtensionIs(inputFileName, \".json\" /* Json */);\n        var outputFileName = ts.changeExtension(getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.outDir, getCommonSourceDirectory), isJsonFile ?\n            \".json\" /* Json */ :\n            configFile.options.jsx === 1 /* Preserve */ && (ts.fileExtensionIs(inputFileName, \".tsx\" /* Tsx */) || ts.fileExtensionIs(inputFileName, \".jsx\" /* Jsx */)) ?\n                \".jsx\" /* Jsx */ :\n                \".js\" /* Js */);\n        return !isJsonFile || ts.comparePaths(inputFileName, outputFileName, ts.Debug.checkDefined(configFile.options.configFilePath), ignoreCase) !== 0 /* EqualTo */ ?\n            outputFileName :\n            undefined;\n    }\n    function createAddOutput() {\n        var outputs;\n        return { addOutput: addOutput, getOutputs: getOutputs };\n        function addOutput(path) {\n            if (path) {\n                (outputs || (outputs = [])).push(path);\n            }\n        }\n        function getOutputs() {\n            return outputs || ts.emptyArray;\n        }\n    }\n    function getSingleOutputFileNames(configFile, addOutput) {\n        var _a = getOutputPathsForBundle(configFile.options, /*forceDtsPaths*/ false), jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath, buildInfoPath = _a.buildInfoPath;\n        addOutput(jsFilePath);\n        addOutput(sourceMapFilePath);\n        addOutput(declarationFilePath);\n        addOutput(declarationMapPath);\n        addOutput(buildInfoPath);\n    }\n    function getOwnOutputFileNames(configFile, inputFileName, ignoreCase, addOutput, getCommonSourceDirectory) {\n        if (ts.fileExtensionIs(inputFileName, \".d.ts\" /* Dts */))\n            return;\n        var js = getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);\n        addOutput(js);\n        if (ts.fileExtensionIs(inputFileName, \".json\" /* Json */))\n            return;\n        if (js && configFile.options.sourceMap) {\n            addOutput(js + \".map\");\n        }\n        if (ts.getEmitDeclarations(configFile.options)) {\n            var dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);\n            addOutput(dts);\n            if (configFile.options.declarationMap) {\n                addOutput(dts + \".map\");\n            }\n        }\n    }\n    /*@internal*/\n    function getCommonSourceDirectory(options, emittedFiles, currentDirectory, getCanonicalFileName, checkSourceFilesBelongToPath) {\n        var commonSourceDirectory;\n        if (options.rootDir) {\n            // If a rootDir is specified use it as the commonSourceDirectory\n            commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory);\n            checkSourceFilesBelongToPath === null || checkSourceFilesBelongToPath === void 0 ? void 0 : checkSourceFilesBelongToPath(options.rootDir);\n        }\n        else if (options.composite && options.configFilePath) {\n            // Project compilations never infer their root from the input source paths\n            commonSourceDirectory = ts.getDirectoryPath(ts.normalizeSlashes(options.configFilePath));\n            checkSourceFilesBelongToPath === null || checkSourceFilesBelongToPath === void 0 ? void 0 : checkSourceFilesBelongToPath(commonSourceDirectory);\n        }\n        else {\n            commonSourceDirectory = ts.computeCommonSourceDirectoryOfFilenames(emittedFiles(), currentDirectory, getCanonicalFileName);\n        }\n        if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) {\n            // Make sure directory path ends with directory separator so this string can directly\n            // used to replace with \"\" to get the relative path of the source file and the relative path doesn't\n            // start with / making it rooted path\n            commonSourceDirectory += ts.directorySeparator;\n        }\n        return commonSourceDirectory;\n    }\n    ts.getCommonSourceDirectory = getCommonSourceDirectory;\n    /*@internal*/\n    function getCommonSourceDirectoryOfConfig(_a, ignoreCase) {\n        var options = _a.options, fileNames = _a.fileNames;\n        return getCommonSourceDirectory(options, function () { return ts.filter(fileNames, function (file) { return !(options.noEmitForJsFiles && ts.fileExtensionIsOneOf(file, ts.supportedJSExtensions)) && !ts.fileExtensionIs(file, \".d.ts\" /* Dts */); }); }, ts.getDirectoryPath(ts.normalizeSlashes(ts.Debug.checkDefined(options.configFilePath))), ts.createGetCanonicalFileName(!ignoreCase));\n    }\n    ts.getCommonSourceDirectoryOfConfig = getCommonSourceDirectoryOfConfig;\n    /*@internal*/\n    function getAllProjectOutputs(configFile, ignoreCase) {\n        var _a = createAddOutput(), addOutput = _a.addOutput, getOutputs = _a.getOutputs;\n        if (ts.outFile(configFile.options)) {\n            getSingleOutputFileNames(configFile, addOutput);\n        }\n        else {\n            var getCommonSourceDirectory_1 = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });\n            for (var _b = 0, _c = configFile.fileNames; _b < _c.length; _b++) {\n                var inputFileName = _c[_b];\n                getOwnOutputFileNames(configFile, inputFileName, ignoreCase, addOutput, getCommonSourceDirectory_1);\n            }\n            addOutput(getTsBuildInfoEmitOutputFilePath(configFile.options));\n        }\n        return getOutputs();\n    }\n    ts.getAllProjectOutputs = getAllProjectOutputs;\n    function getOutputFileNames(commandLine, inputFileName, ignoreCase) {\n        inputFileName = ts.normalizePath(inputFileName);\n        ts.Debug.assert(ts.contains(commandLine.fileNames, inputFileName), \"Expected fileName to be present in command line\");\n        var _a = createAddOutput(), addOutput = _a.addOutput, getOutputs = _a.getOutputs;\n        if (ts.outFile(commandLine.options)) {\n            getSingleOutputFileNames(commandLine, addOutput);\n        }\n        else {\n            getOwnOutputFileNames(commandLine, inputFileName, ignoreCase, addOutput);\n        }\n        return getOutputs();\n    }\n    ts.getOutputFileNames = getOutputFileNames;\n    /*@internal*/\n    function getFirstProjectOutput(configFile, ignoreCase) {\n        if (ts.outFile(configFile.options)) {\n            var jsFilePath = getOutputPathsForBundle(configFile.options, /*forceDtsPaths*/ false).jsFilePath;\n            return ts.Debug.checkDefined(jsFilePath, \"project \" + configFile.options.configFilePath + \" expected to have at least one output\");\n        }\n        var getCommonSourceDirectory = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });\n        for (var _a = 0, _b = configFile.fileNames; _a < _b.length; _a++) {\n            var inputFileName = _b[_a];\n            if (ts.fileExtensionIs(inputFileName, \".d.ts\" /* Dts */))\n                continue;\n            var jsFilePath = getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);\n            if (jsFilePath)\n                return jsFilePath;\n            if (ts.fileExtensionIs(inputFileName, \".json\" /* Json */))\n                continue;\n            if (ts.getEmitDeclarations(configFile.options)) {\n                return getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);\n            }\n        }\n        var buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options);\n        if (buildInfoPath)\n            return buildInfoPath;\n        return ts.Debug.fail(\"project \" + configFile.options.configFilePath + \" expected to have at least one output\");\n    }\n    ts.getFirstProjectOutput = getFirstProjectOutput;\n    /*@internal*/\n    // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature\n    function emitFiles(resolver, host, targetSourceFile, _a, emitOnlyDtsFiles, onlyBuildInfo, forceDtsEmit) {\n        var scriptTransformers = _a.scriptTransformers, declarationTransformers = _a.declarationTransformers;\n        var compilerOptions = host.getCompilerOptions();\n        var sourceMapDataList = (compilerOptions.sourceMap || compilerOptions.inlineSourceMap || ts.getAreDeclarationMapsEnabled(compilerOptions)) ? [] : undefined;\n        var emittedFilesList = compilerOptions.listEmittedFiles ? [] : undefined;\n        var emitterDiagnostics = ts.createDiagnosticCollection();\n        var newLine = ts.getNewLineCharacter(compilerOptions, function () { return host.getNewLine(); });\n        var writer = ts.createTextWriter(newLine);\n        var _b = ts.performance.createTimer(\"printTime\", \"beforePrint\", \"afterPrint\"), enter = _b.enter, exit = _b.exit;\n        var bundleBuildInfo;\n        var emitSkipped = false;\n        var exportedModulesFromDeclarationEmit;\n        // Emit each output file\n        enter();\n        forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit), forceDtsEmit, onlyBuildInfo, !targetSourceFile);\n        exit();\n        return {\n            emitSkipped: emitSkipped,\n            diagnostics: emitterDiagnostics.getDiagnostics(),\n            emittedFiles: emittedFilesList,\n            sourceMaps: sourceMapDataList,\n            exportedModulesFromDeclarationEmit: exportedModulesFromDeclarationEmit\n        };\n        function emitSourceFileOrBundle(_a, sourceFileOrBundle) {\n            var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath, buildInfoPath = _a.buildInfoPath;\n            var buildInfoDirectory;\n            if (buildInfoPath && sourceFileOrBundle && ts.isBundle(sourceFileOrBundle)) {\n                buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));\n                bundleBuildInfo = {\n                    commonSourceDirectory: relativeToBuildInfo(host.getCommonSourceDirectory()),\n                    sourceFiles: sourceFileOrBundle.sourceFiles.map(function (file) { return relativeToBuildInfo(ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory())); })\n                };\n            }\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"emit\" /* Emit */, \"emitJsFileOrBundle\", { jsFilePath: jsFilePath });\n            emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo);\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"emit\" /* Emit */, \"emitDeclarationFileOrBundle\", { declarationFilePath: declarationFilePath });\n            emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo);\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"emit\" /* Emit */, \"emitBuildInfo\", { buildInfoPath: buildInfoPath });\n            emitBuildInfo(bundleBuildInfo, buildInfoPath);\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n            if (!emitSkipped && emittedFilesList) {\n                if (!emitOnlyDtsFiles) {\n                    if (jsFilePath) {\n                        emittedFilesList.push(jsFilePath);\n                    }\n                    if (sourceMapFilePath) {\n                        emittedFilesList.push(sourceMapFilePath);\n                    }\n                    if (buildInfoPath) {\n                        emittedFilesList.push(buildInfoPath);\n                    }\n                }\n                if (declarationFilePath) {\n                    emittedFilesList.push(declarationFilePath);\n                }\n                if (declarationMapPath) {\n                    emittedFilesList.push(declarationMapPath);\n                }\n            }\n            function relativeToBuildInfo(path) {\n                return ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(buildInfoDirectory, path, host.getCanonicalFileName));\n            }\n        }\n        function emitBuildInfo(bundle, buildInfoPath) {\n            // Write build information if applicable\n            if (!buildInfoPath || targetSourceFile || emitSkipped)\n                return;\n            var program = host.getProgramBuildInfo();\n            if (host.isEmitBlocked(buildInfoPath)) {\n                emitSkipped = true;\n                return;\n            }\n            var version = ts.version; // Extracted into a const so the form is stable between namespace and module\n            ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText({ bundle: bundle, program: program, version: version }), /*writeByteOrderMark*/ false);\n        }\n        function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo) {\n            if (!sourceFileOrBundle || emitOnlyDtsFiles || !jsFilePath) {\n                return;\n            }\n            // Make sure not to write js file and source map file if any of them cannot be written\n            if ((jsFilePath && host.isEmitBlocked(jsFilePath)) || compilerOptions.noEmit) {\n                emitSkipped = true;\n                return;\n            }\n            // Transform the source files\n            var transform = ts.transformNodes(resolver, host, ts.factory, compilerOptions, [sourceFileOrBundle], scriptTransformers, /*allowDtsFiles*/ false);\n            var printerOptions = {\n                removeComments: compilerOptions.removeComments,\n                newLine: compilerOptions.newLine,\n                noEmitHelpers: compilerOptions.noEmitHelpers,\n                module: compilerOptions.module,\n                target: compilerOptions.target,\n                sourceMap: compilerOptions.sourceMap,\n                inlineSourceMap: compilerOptions.inlineSourceMap,\n                inlineSources: compilerOptions.inlineSources,\n                extendedDiagnostics: compilerOptions.extendedDiagnostics,\n                writeBundleFileInfo: !!bundleBuildInfo,\n                relativeToBuildInfo: relativeToBuildInfo\n            };\n            // Create a printer to print the nodes\n            var printer = createPrinter(printerOptions, {\n                // resolver hooks\n                hasGlobalName: resolver.hasGlobalName,\n                // transform hooks\n                onEmitNode: transform.emitNodeWithNotification,\n                isEmitNotificationEnabled: transform.isEmitNotificationEnabled,\n                substituteNode: transform.substituteNode,\n            });\n            ts.Debug.assert(transform.transformed.length === 1, \"Should only see one output from the transform\");\n            printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform.transformed[0], printer, compilerOptions);\n            // Clean up emit nodes on parse tree\n            transform.dispose();\n            if (bundleBuildInfo)\n                bundleBuildInfo.js = printer.bundleFileInfo;\n        }\n        function emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo) {\n            if (!sourceFileOrBundle)\n                return;\n            if (!declarationFilePath) {\n                if (emitOnlyDtsFiles || compilerOptions.emitDeclarationOnly)\n                    emitSkipped = true;\n                return;\n            }\n            var sourceFiles = ts.isSourceFile(sourceFileOrBundle) ? [sourceFileOrBundle] : sourceFileOrBundle.sourceFiles;\n            var filesForEmit = forceDtsEmit ? sourceFiles : ts.filter(sourceFiles, ts.isSourceFileNotJson);\n            // Setup and perform the transformation to retrieve declarations from the input files\n            var inputListOrBundle = ts.outFile(compilerOptions) ? [ts.factory.createBundle(filesForEmit, !ts.isSourceFile(sourceFileOrBundle) ? sourceFileOrBundle.prepends : undefined)] : filesForEmit;\n            if (emitOnlyDtsFiles && !ts.getEmitDeclarations(compilerOptions)) {\n                // Checker wont collect the linked aliases since thats only done when declaration is enabled.\n                // Do that here when emitting only dts files\n                filesForEmit.forEach(collectLinkedAliases);\n            }\n            var declarationTransform = ts.transformNodes(resolver, host, ts.factory, compilerOptions, inputListOrBundle, declarationTransformers, /*allowDtsFiles*/ false);\n            if (ts.length(declarationTransform.diagnostics)) {\n                for (var _a = 0, _b = declarationTransform.diagnostics; _a < _b.length; _a++) {\n                    var diagnostic = _b[_a];\n                    emitterDiagnostics.add(diagnostic);\n                }\n            }\n            var printerOptions = {\n                removeComments: compilerOptions.removeComments,\n                newLine: compilerOptions.newLine,\n                noEmitHelpers: true,\n                module: compilerOptions.module,\n                target: compilerOptions.target,\n                sourceMap: compilerOptions.sourceMap,\n                inlineSourceMap: compilerOptions.inlineSourceMap,\n                extendedDiagnostics: compilerOptions.extendedDiagnostics,\n                onlyPrintJsDocStyle: true,\n                writeBundleFileInfo: !!bundleBuildInfo,\n                recordInternalSection: !!bundleBuildInfo,\n                relativeToBuildInfo: relativeToBuildInfo\n            };\n            var declarationPrinter = createPrinter(printerOptions, {\n                // resolver hooks\n                hasGlobalName: resolver.hasGlobalName,\n                // transform hooks\n                onEmitNode: declarationTransform.emitNodeWithNotification,\n                isEmitNotificationEnabled: declarationTransform.isEmitNotificationEnabled,\n                substituteNode: declarationTransform.substituteNode,\n            });\n            var declBlocked = (!!declarationTransform.diagnostics && !!declarationTransform.diagnostics.length) || !!host.isEmitBlocked(declarationFilePath) || !!compilerOptions.noEmit;\n            emitSkipped = emitSkipped || declBlocked;\n            if (!declBlocked || forceDtsEmit) {\n                ts.Debug.assert(declarationTransform.transformed.length === 1, \"Should only see one output from the decl transform\");\n                printSourceFileOrBundle(declarationFilePath, declarationMapPath, declarationTransform.transformed[0], declarationPrinter, {\n                    sourceMap: compilerOptions.declarationMap,\n                    sourceRoot: compilerOptions.sourceRoot,\n                    mapRoot: compilerOptions.mapRoot,\n                    extendedDiagnostics: compilerOptions.extendedDiagnostics,\n                    // Explicitly do not passthru either `inline` option\n                });\n                if (forceDtsEmit && declarationTransform.transformed[0].kind === 297 /* SourceFile */) {\n                    var sourceFile = declarationTransform.transformed[0];\n                    exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit;\n                }\n            }\n            declarationTransform.dispose();\n            if (bundleBuildInfo)\n                bundleBuildInfo.dts = declarationPrinter.bundleFileInfo;\n        }\n        function collectLinkedAliases(node) {\n            if (ts.isExportAssignment(node)) {\n                if (node.expression.kind === 78 /* Identifier */) {\n                    resolver.collectLinkedAliases(node.expression, /*setVisibility*/ true);\n                }\n                return;\n            }\n            else if (ts.isExportSpecifier(node)) {\n                resolver.collectLinkedAliases(node.propertyName || node.name, /*setVisibility*/ true);\n                return;\n            }\n            ts.forEachChild(node, collectLinkedAliases);\n        }\n        function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) {\n            var bundle = sourceFileOrBundle.kind === 298 /* Bundle */ ? sourceFileOrBundle : undefined;\n            var sourceFile = sourceFileOrBundle.kind === 297 /* SourceFile */ ? sourceFileOrBundle : undefined;\n            var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile];\n            var sourceMapGenerator;\n            if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) {\n                sourceMapGenerator = ts.createSourceMapGenerator(host, ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)), getSourceRoot(mapOptions), getSourceMapDirectory(mapOptions, jsFilePath, sourceFile), mapOptions);\n            }\n            if (bundle) {\n                printer.writeBundle(bundle, writer, sourceMapGenerator);\n            }\n            else {\n                printer.writeFile(sourceFile, writer, sourceMapGenerator);\n            }\n            if (sourceMapGenerator) {\n                if (sourceMapDataList) {\n                    sourceMapDataList.push({\n                        inputSourceFileNames: sourceMapGenerator.getSources(),\n                        sourceMap: sourceMapGenerator.toJSON()\n                    });\n                }\n                var sourceMappingURL = getSourceMappingURL(mapOptions, sourceMapGenerator, jsFilePath, sourceMapFilePath, sourceFile);\n                if (sourceMappingURL) {\n                    if (!writer.isAtStartOfLine())\n                        writer.rawWrite(newLine);\n                    writer.writeComment(\"//# \" + \"sourceMappingURL\" + \"=\" + sourceMappingURL); // Tools can sometimes see this line as a source mapping url comment\n                }\n                // Write the source map\n                if (sourceMapFilePath) {\n                    var sourceMap = sourceMapGenerator.toString();\n                    ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap, /*writeByteOrderMark*/ false, sourceFiles);\n                }\n            }\n            else {\n                writer.writeLine();\n            }\n            // Write the output file\n            ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), !!compilerOptions.emitBOM, sourceFiles);\n            // Reset state\n            writer.clear();\n        }\n        function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) {\n            return (mapOptions.sourceMap || mapOptions.inlineSourceMap)\n                && (sourceFileOrBundle.kind !== 297 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, \".json\" /* Json */));\n        }\n        function getSourceRoot(mapOptions) {\n            // Normalize source root and make sure it has trailing \"/\" so that it can be used to combine paths with the\n            // relative paths of the sources list in the sourcemap\n            var sourceRoot = ts.normalizeSlashes(mapOptions.sourceRoot || \"\");\n            return sourceRoot ? ts.ensureTrailingDirectorySeparator(sourceRoot) : sourceRoot;\n        }\n        function getSourceMapDirectory(mapOptions, filePath, sourceFile) {\n            if (mapOptions.sourceRoot)\n                return host.getCommonSourceDirectory();\n            if (mapOptions.mapRoot) {\n                var sourceMapDir = ts.normalizeSlashes(mapOptions.mapRoot);\n                if (sourceFile) {\n                    // For modules or multiple emit files the mapRoot will have directory structure like the sources\n                    // So if src\\a.ts and src\\lib\\b.ts are compiled together user would be moving the maps into mapRoot\\a.js.map and mapRoot\\lib\\b.js.map\n                    sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFile.fileName, host, sourceMapDir));\n                }\n                if (ts.getRootLength(sourceMapDir) === 0) {\n                    // The relative paths are relative to the common directory\n                    sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir);\n                }\n                return sourceMapDir;\n            }\n            return ts.getDirectoryPath(ts.normalizePath(filePath));\n        }\n        function getSourceMappingURL(mapOptions, sourceMapGenerator, filePath, sourceMapFilePath, sourceFile) {\n            if (mapOptions.inlineSourceMap) {\n                // Encode the sourceMap into the sourceMap url\n                var sourceMapText = sourceMapGenerator.toString();\n                var base64SourceMapText = ts.base64encode(ts.sys, sourceMapText);\n                return \"data:application/json;base64,\" + base64SourceMapText;\n            }\n            var sourceMapFile = ts.getBaseFileName(ts.normalizeSlashes(ts.Debug.checkDefined(sourceMapFilePath)));\n            if (mapOptions.mapRoot) {\n                var sourceMapDir = ts.normalizeSlashes(mapOptions.mapRoot);\n                if (sourceFile) {\n                    // For modules or multiple emit files the mapRoot will have directory structure like the sources\n                    // So if src\\a.ts and src\\lib\\b.ts are compiled together user would be moving the maps into mapRoot\\a.js.map and mapRoot\\lib\\b.js.map\n                    sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFile.fileName, host, sourceMapDir));\n                }\n                if (ts.getRootLength(sourceMapDir) === 0) {\n                    // The relative paths are relative to the common directory\n                    sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir);\n                    return encodeURI(ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), // get the relative sourceMapDir path based on jsFilePath\n                    ts.combinePaths(sourceMapDir, sourceMapFile), // this is where user expects to see sourceMap\n                    host.getCurrentDirectory(), host.getCanonicalFileName, \n                    /*isAbsolutePathAnUrl*/ true));\n                }\n                else {\n                    return encodeURI(ts.combinePaths(sourceMapDir, sourceMapFile));\n                }\n            }\n            return encodeURI(sourceMapFile);\n        }\n    }\n    ts.emitFiles = emitFiles;\n    /*@internal*/\n    function getBuildInfoText(buildInfo) {\n        return JSON.stringify(buildInfo, undefined, 2);\n    }\n    ts.getBuildInfoText = getBuildInfoText;\n    /*@internal*/\n    function getBuildInfo(buildInfoText) {\n        return JSON.parse(buildInfoText);\n    }\n    ts.getBuildInfo = getBuildInfo;\n    /*@internal*/\n    ts.notImplementedResolver = {\n        hasGlobalName: ts.notImplemented,\n        getReferencedExportContainer: ts.notImplemented,\n        getReferencedImportDeclaration: ts.notImplemented,\n        getReferencedDeclarationWithCollidingName: ts.notImplemented,\n        isDeclarationWithCollidingName: ts.notImplemented,\n        isValueAliasDeclaration: ts.notImplemented,\n        isReferencedAliasDeclaration: ts.notImplemented,\n        isTopLevelValueImportEqualsWithEntityName: ts.notImplemented,\n        getNodeCheckFlags: ts.notImplemented,\n        isDeclarationVisible: ts.notImplemented,\n        isLateBound: function (_node) { return false; },\n        collectLinkedAliases: ts.notImplemented,\n        isImplementationOfOverload: ts.notImplemented,\n        isRequiredInitializedParameter: ts.notImplemented,\n        isOptionalUninitializedParameterProperty: ts.notImplemented,\n        isExpandoFunctionDeclaration: ts.notImplemented,\n        getPropertiesOfContainerFunction: ts.notImplemented,\n        createTypeOfDeclaration: ts.notImplemented,\n        createReturnTypeOfSignatureDeclaration: ts.notImplemented,\n        createTypeOfExpression: ts.notImplemented,\n        createLiteralConstValue: ts.notImplemented,\n        isSymbolAccessible: ts.notImplemented,\n        isEntityNameVisible: ts.notImplemented,\n        // Returns the constant value this property access resolves to: notImplemented, or 'undefined' for a non-constant\n        getConstantValue: ts.notImplemented,\n        getReferencedValueDeclaration: ts.notImplemented,\n        getTypeReferenceSerializationKind: ts.notImplemented,\n        isOptionalParameter: ts.notImplemented,\n        moduleExportsSomeValue: ts.notImplemented,\n        isArgumentsLocalBinding: ts.notImplemented,\n        getExternalModuleFileFromDeclaration: ts.notImplemented,\n        getTypeReferenceDirectivesForEntityName: ts.notImplemented,\n        getTypeReferenceDirectivesForSymbol: ts.notImplemented,\n        isLiteralConstDeclaration: ts.notImplemented,\n        getJsxFactoryEntity: ts.notImplemented,\n        getJsxFragmentFactoryEntity: ts.notImplemented,\n        getAllAccessorDeclarations: ts.notImplemented,\n        getSymbolOfExternalModuleSpecifier: ts.notImplemented,\n        isBindingCapturedByNode: ts.notImplemented,\n        getDeclarationStatementsForSourceFile: ts.notImplemented,\n        isImportRequiredByAugmentation: ts.notImplemented,\n    };\n    function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) {\n        var _a;\n        var jsBundle = ts.Debug.checkDefined(bundle.js);\n        var prologueMap = ((_a = jsBundle.sources) === null || _a === void 0 ? void 0 : _a.prologues) && ts.arrayToMap(jsBundle.sources.prologues, function (prologueInfo) { return prologueInfo.file; });\n        return bundle.sourceFiles.map(function (fileName, index) {\n            var _a, _b;\n            var prologueInfo = prologueMap === null || prologueMap === void 0 ? void 0 : prologueMap.get(index);\n            var statements = prologueInfo === null || prologueInfo === void 0 ? void 0 : prologueInfo.directives.map(function (directive) {\n                var literal = ts.setTextRange(ts.factory.createStringLiteral(directive.expression.text), directive.expression);\n                var statement = ts.setTextRange(ts.factory.createExpressionStatement(literal), directive);\n                ts.setParent(literal, statement);\n                return statement;\n            });\n            var eofToken = ts.factory.createToken(1 /* EndOfFileToken */);\n            var sourceFile = ts.factory.createSourceFile(statements !== null && statements !== void 0 ? statements : [], eofToken, 0 /* None */);\n            sourceFile.fileName = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), ts.getNormalizedAbsolutePath(fileName, buildInfoDirectory), !host.useCaseSensitiveFileNames());\n            sourceFile.text = (_a = prologueInfo === null || prologueInfo === void 0 ? void 0 : prologueInfo.text) !== null && _a !== void 0 ? _a : \"\";\n            ts.setTextRangePosWidth(sourceFile, 0, (_b = prologueInfo === null || prologueInfo === void 0 ? void 0 : prologueInfo.text.length) !== null && _b !== void 0 ? _b : 0);\n            ts.setEachParent(sourceFile.statements, sourceFile);\n            ts.setTextRangePosWidth(eofToken, sourceFile.end, 0);\n            ts.setParent(eofToken, sourceFile);\n            return sourceFile;\n        });\n    }\n    /*@internal*/\n    function emitUsingBuildInfo(config, host, getCommandLine, customTransformers) {\n        var _a = getOutputPathsForBundle(config.options, /*forceDtsPaths*/ false), buildInfoPath = _a.buildInfoPath, jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath;\n        var buildInfoText = host.readFile(ts.Debug.checkDefined(buildInfoPath));\n        if (!buildInfoText)\n            return buildInfoPath;\n        var jsFileText = host.readFile(ts.Debug.checkDefined(jsFilePath));\n        if (!jsFileText)\n            return jsFilePath;\n        var sourceMapText = sourceMapFilePath && host.readFile(sourceMapFilePath);\n        // error if no source map or for now if inline sourcemap\n        if ((sourceMapFilePath && !sourceMapText) || config.options.inlineSourceMap)\n            return sourceMapFilePath || \"inline sourcemap decoding\";\n        // read declaration text\n        var declarationText = declarationFilePath && host.readFile(declarationFilePath);\n        if (declarationFilePath && !declarationText)\n            return declarationFilePath;\n        var declarationMapText = declarationMapPath && host.readFile(declarationMapPath);\n        // error if no source map or for now if inline sourcemap\n        if ((declarationMapPath && !declarationMapText) || config.options.inlineSourceMap)\n            return declarationMapPath || \"inline sourcemap decoding\";\n        var buildInfo = getBuildInfo(buildInfoText);\n        if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationText && !buildInfo.bundle.dts))\n            return buildInfoPath;\n        var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));\n        var ownPrependInput = ts.createInputFiles(jsFileText, declarationText, sourceMapFilePath, sourceMapText, declarationMapPath, declarationMapText, jsFilePath, declarationFilePath, buildInfoPath, buildInfo, \n        /*onlyOwnText*/ true);\n        var outputFiles = [];\n        var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });\n        var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);\n        var emitHost = {\n            getPrependNodes: ts.memoize(function () { return __spreadArray(__spreadArray([], prependNodes), [ownPrependInput]); }),\n            getCanonicalFileName: host.getCanonicalFileName,\n            getCommonSourceDirectory: function () { return ts.getNormalizedAbsolutePath(buildInfo.bundle.commonSourceDirectory, buildInfoDirectory); },\n            getCompilerOptions: function () { return config.options; },\n            getCurrentDirectory: function () { return host.getCurrentDirectory(); },\n            getNewLine: function () { return host.getNewLine(); },\n            getSourceFile: ts.returnUndefined,\n            getSourceFileByPath: ts.returnUndefined,\n            getSourceFiles: function () { return sourceFilesForJsEmit; },\n            getLibFileFromReference: ts.notImplemented,\n            isSourceFileFromExternalLibrary: ts.returnFalse,\n            getResolvedProjectReferenceToRedirect: ts.returnUndefined,\n            getProjectReferenceRedirect: ts.returnUndefined,\n            isSourceOfProjectReferenceRedirect: ts.returnFalse,\n            writeFile: function (name, text, writeByteOrderMark) {\n                switch (name) {\n                    case jsFilePath:\n                        if (jsFileText === text)\n                            return;\n                        break;\n                    case sourceMapFilePath:\n                        if (sourceMapText === text)\n                            return;\n                        break;\n                    case buildInfoPath:\n                        var newBuildInfo = getBuildInfo(text);\n                        newBuildInfo.program = buildInfo.program;\n                        // Update sourceFileInfo\n                        var _a = buildInfo.bundle, js = _a.js, dts = _a.dts, sourceFiles = _a.sourceFiles;\n                        newBuildInfo.bundle.js.sources = js.sources;\n                        if (dts) {\n                            newBuildInfo.bundle.dts.sources = dts.sources;\n                        }\n                        newBuildInfo.bundle.sourceFiles = sourceFiles;\n                        outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark });\n                        return;\n                    case declarationFilePath:\n                        if (declarationText === text)\n                            return;\n                        break;\n                    case declarationMapPath:\n                        if (declarationMapText === text)\n                            return;\n                        break;\n                    default:\n                        ts.Debug.fail(\"Unexpected path: \" + name);\n                }\n                outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark });\n            },\n            isEmitBlocked: ts.returnFalse,\n            readFile: function (f) { return host.readFile(f); },\n            fileExists: function (f) { return host.fileExists(f); },\n            useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); },\n            getProgramBuildInfo: ts.returnUndefined,\n            getSourceFileFromReference: ts.returnUndefined,\n            redirectTargetsMap: ts.createMultiMap(),\n            getFileIncludeReasons: ts.notImplemented,\n        };\n        emitFiles(ts.notImplementedResolver, emitHost, \n        /*targetSourceFile*/ undefined, ts.getTransformers(config.options, customTransformers));\n        return outputFiles;\n    }\n    ts.emitUsingBuildInfo = emitUsingBuildInfo;\n    var PipelinePhase;\n    (function (PipelinePhase) {\n        PipelinePhase[PipelinePhase[\"Notification\"] = 0] = \"Notification\";\n        PipelinePhase[PipelinePhase[\"Substitution\"] = 1] = \"Substitution\";\n        PipelinePhase[PipelinePhase[\"Comments\"] = 2] = \"Comments\";\n        PipelinePhase[PipelinePhase[\"SourceMaps\"] = 3] = \"SourceMaps\";\n        PipelinePhase[PipelinePhase[\"Emit\"] = 4] = \"Emit\";\n    })(PipelinePhase || (PipelinePhase = {}));\n    function createPrinter(printerOptions, handlers) {\n        if (printerOptions === void 0) { printerOptions = {}; }\n        if (handlers === void 0) { handlers = {}; }\n        var hasGlobalName = handlers.hasGlobalName, _a = handlers.onEmitNode, onEmitNode = _a === void 0 ? ts.noEmitNotification : _a, isEmitNotificationEnabled = handlers.isEmitNotificationEnabled, _b = handlers.substituteNode, substituteNode = _b === void 0 ? ts.noEmitSubstitution : _b, onBeforeEmitNodeArray = handlers.onBeforeEmitNodeArray, onAfterEmitNodeArray = handlers.onAfterEmitNodeArray, onBeforeEmitToken = handlers.onBeforeEmitToken, onAfterEmitToken = handlers.onAfterEmitToken;\n        var extendedDiagnostics = !!printerOptions.extendedDiagnostics;\n        var newLine = ts.getNewLineCharacter(printerOptions);\n        var moduleKind = ts.getEmitModuleKind(printerOptions);\n        var bundledHelpers = new ts.Map();\n        var currentSourceFile;\n        var nodeIdToGeneratedName; // Map of generated names for specific nodes.\n        var autoGeneratedIdToGeneratedName; // Map of generated names for temp and loop variables.\n        var generatedNames; // Set of names generated by the NameGenerator.\n        var tempFlagsStack; // Stack of enclosing name generation scopes.\n        var tempFlags; // TempFlags for the current name generation scope.\n        var reservedNamesStack; // Stack of TempFlags reserved in enclosing name generation scopes.\n        var reservedNames; // TempFlags to reserve in nested name generation scopes.\n        var preserveSourceNewlines = printerOptions.preserveSourceNewlines; // Can be overridden inside nodes with the `IgnoreSourceNewlines` emit flag.\n        var nextListElementPos; // See comment in `getLeadingLineTerminatorCount`.\n        var writer;\n        var ownWriter; // Reusable `EmitTextWriter` for basic printing.\n        var write = writeBase;\n        var isOwnFileEmit;\n        var bundleFileInfo = printerOptions.writeBundleFileInfo ? { sections: [] } : undefined;\n        var relativeToBuildInfo = bundleFileInfo ? ts.Debug.checkDefined(printerOptions.relativeToBuildInfo) : undefined;\n        var recordInternalSection = printerOptions.recordInternalSection;\n        var sourceFileTextPos = 0;\n        var sourceFileTextKind = \"text\" /* Text */;\n        // Source Maps\n        var sourceMapsDisabled = true;\n        var sourceMapGenerator;\n        var sourceMapSource;\n        var sourceMapSourceIndex = -1;\n        var mostRecentlyAddedSourceMapSource;\n        var mostRecentlyAddedSourceMapSourceIndex = -1;\n        // Comments\n        var containerPos = -1;\n        var containerEnd = -1;\n        var declarationListContainerEnd = -1;\n        var currentLineMap;\n        var detachedCommentsInfo;\n        var hasWrittenComment = false;\n        var commentsDisabled = !!printerOptions.removeComments;\n        var lastNode;\n        var lastSubstitution;\n        var _c = ts.performance.createTimerIf(extendedDiagnostics, \"commentTime\", \"beforeComment\", \"afterComment\"), enterComment = _c.enter, exitComment = _c.exit;\n        reset();\n        return {\n            // public API\n            printNode: printNode,\n            printList: printList,\n            printFile: printFile,\n            printBundle: printBundle,\n            // internal API\n            writeNode: writeNode,\n            writeList: writeList,\n            writeFile: writeFile,\n            writeBundle: writeBundle,\n            bundleFileInfo: bundleFileInfo\n        };\n        function printNode(hint, node, sourceFile) {\n            switch (hint) {\n                case 0 /* SourceFile */:\n                    ts.Debug.assert(ts.isSourceFile(node), \"Expected a SourceFile node.\");\n                    break;\n                case 2 /* IdentifierName */:\n                    ts.Debug.assert(ts.isIdentifier(node), \"Expected an Identifier node.\");\n                    break;\n                case 1 /* Expression */:\n                    ts.Debug.assert(ts.isExpression(node), \"Expected an Expression node.\");\n                    break;\n            }\n            switch (node.kind) {\n                case 297 /* SourceFile */: return printFile(node);\n                case 298 /* Bundle */: return printBundle(node);\n                case 299 /* UnparsedSource */: return printUnparsedSource(node);\n            }\n            writeNode(hint, node, sourceFile, beginPrint());\n            return endPrint();\n        }\n        function printList(format, nodes, sourceFile) {\n            writeList(format, nodes, sourceFile, beginPrint());\n            return endPrint();\n        }\n        function printBundle(bundle) {\n            writeBundle(bundle, beginPrint(), /*sourceMapEmitter*/ undefined);\n            return endPrint();\n        }\n        function printFile(sourceFile) {\n            writeFile(sourceFile, beginPrint(), /*sourceMapEmitter*/ undefined);\n            return endPrint();\n        }\n        function printUnparsedSource(unparsed) {\n            writeUnparsedSource(unparsed, beginPrint());\n            return endPrint();\n        }\n        function writeNode(hint, node, sourceFile, output) {\n            var previousWriter = writer;\n            setWriter(output, /*_sourceMapGenerator*/ undefined);\n            print(hint, node, sourceFile);\n            reset();\n            writer = previousWriter;\n        }\n        function writeList(format, nodes, sourceFile, output) {\n            var previousWriter = writer;\n            setWriter(output, /*_sourceMapGenerator*/ undefined);\n            if (sourceFile) {\n                setSourceFile(sourceFile);\n            }\n            emitList(syntheticParent, nodes, format);\n            reset();\n            writer = previousWriter;\n        }\n        function getTextPosWithWriteLine() {\n            return writer.getTextPosWithWriteLine ? writer.getTextPosWithWriteLine() : writer.getTextPos();\n        }\n        function updateOrPushBundleFileTextLike(pos, end, kind) {\n            var last = ts.lastOrUndefined(bundleFileInfo.sections);\n            if (last && last.kind === kind) {\n                last.end = end;\n            }\n            else {\n                bundleFileInfo.sections.push({ pos: pos, end: end, kind: kind });\n            }\n        }\n        function recordBundleFileInternalSectionStart(node) {\n            if (recordInternalSection &&\n                bundleFileInfo &&\n                currentSourceFile &&\n                (ts.isDeclaration(node) || ts.isVariableStatement(node)) &&\n                ts.isInternalDeclaration(node, currentSourceFile) &&\n                sourceFileTextKind !== \"internal\" /* Internal */) {\n                var prevSourceFileTextKind = sourceFileTextKind;\n                recordBundleFileTextLikeSection(writer.getTextPos());\n                sourceFileTextPos = getTextPosWithWriteLine();\n                sourceFileTextKind = \"internal\" /* Internal */;\n                return prevSourceFileTextKind;\n            }\n            return undefined;\n        }\n        function recordBundleFileInternalSectionEnd(prevSourceFileTextKind) {\n            if (prevSourceFileTextKind) {\n                recordBundleFileTextLikeSection(writer.getTextPos());\n                sourceFileTextPos = getTextPosWithWriteLine();\n                sourceFileTextKind = prevSourceFileTextKind;\n            }\n        }\n        function recordBundleFileTextLikeSection(end) {\n            if (sourceFileTextPos < end) {\n                updateOrPushBundleFileTextLike(sourceFileTextPos, end, sourceFileTextKind);\n                return true;\n            }\n            return false;\n        }\n        function writeBundle(bundle, output, sourceMapGenerator) {\n            var _a;\n            isOwnFileEmit = false;\n            var previousWriter = writer;\n            setWriter(output, sourceMapGenerator);\n            emitShebangIfNeeded(bundle);\n            emitPrologueDirectivesIfNeeded(bundle);\n            emitHelpers(bundle);\n            emitSyntheticTripleSlashReferencesIfNeeded(bundle);\n            for (var _b = 0, _c = bundle.prepends; _b < _c.length; _b++) {\n                var prepend = _c[_b];\n                writeLine();\n                var pos = writer.getTextPos();\n                var savedSections = bundleFileInfo && bundleFileInfo.sections;\n                if (savedSections)\n                    bundleFileInfo.sections = [];\n                print(4 /* Unspecified */, prepend, /*sourceFile*/ undefined);\n                if (bundleFileInfo) {\n                    var newSections = bundleFileInfo.sections;\n                    bundleFileInfo.sections = savedSections;\n                    if (prepend.oldFileOfCurrentEmit)\n                        (_a = bundleFileInfo.sections).push.apply(_a, newSections);\n                    else {\n                        newSections.forEach(function (section) { return ts.Debug.assert(ts.isBundleFileTextLike(section)); });\n                        bundleFileInfo.sections.push({\n                            pos: pos,\n                            end: writer.getTextPos(),\n                            kind: \"prepend\" /* Prepend */,\n                            data: relativeToBuildInfo(prepend.fileName),\n                            texts: newSections\n                        });\n                    }\n                }\n            }\n            sourceFileTextPos = getTextPosWithWriteLine();\n            for (var _d = 0, _e = bundle.sourceFiles; _d < _e.length; _d++) {\n                var sourceFile = _e[_d];\n                print(0 /* SourceFile */, sourceFile, sourceFile);\n            }\n            if (bundleFileInfo && bundle.sourceFiles.length) {\n                var end = writer.getTextPos();\n                if (recordBundleFileTextLikeSection(end)) {\n                    // Store prologues\n                    var prologues = getPrologueDirectivesFromBundledSourceFiles(bundle);\n                    if (prologues) {\n                        if (!bundleFileInfo.sources)\n                            bundleFileInfo.sources = {};\n                        bundleFileInfo.sources.prologues = prologues;\n                    }\n                    // Store helpes\n                    var helpers = getHelpersFromBundledSourceFiles(bundle);\n                    if (helpers) {\n                        if (!bundleFileInfo.sources)\n                            bundleFileInfo.sources = {};\n                        bundleFileInfo.sources.helpers = helpers;\n                    }\n                }\n            }\n            reset();\n            writer = previousWriter;\n        }\n        function writeUnparsedSource(unparsed, output) {\n            var previousWriter = writer;\n            setWriter(output, /*_sourceMapGenerator*/ undefined);\n            print(4 /* Unspecified */, unparsed, /*sourceFile*/ undefined);\n            reset();\n            writer = previousWriter;\n        }\n        function writeFile(sourceFile, output, sourceMapGenerator) {\n            isOwnFileEmit = true;\n            var previousWriter = writer;\n            setWriter(output, sourceMapGenerator);\n            emitShebangIfNeeded(sourceFile);\n            emitPrologueDirectivesIfNeeded(sourceFile);\n            print(0 /* SourceFile */, sourceFile, sourceFile);\n            reset();\n            writer = previousWriter;\n        }\n        function beginPrint() {\n            return ownWriter || (ownWriter = ts.createTextWriter(newLine));\n        }\n        function endPrint() {\n            var text = ownWriter.getText();\n            ownWriter.clear();\n            return text;\n        }\n        function print(hint, node, sourceFile) {\n            if (sourceFile) {\n                setSourceFile(sourceFile);\n            }\n            pipelineEmit(hint, node);\n        }\n        function setSourceFile(sourceFile) {\n            currentSourceFile = sourceFile;\n            currentLineMap = undefined;\n            detachedCommentsInfo = undefined;\n            if (sourceFile) {\n                setSourceMapSource(sourceFile);\n            }\n        }\n        function setWriter(_writer, _sourceMapGenerator) {\n            if (_writer && printerOptions.omitTrailingSemicolon) {\n                _writer = ts.getTrailingSemicolonDeferringWriter(_writer);\n            }\n            writer = _writer; // TODO: GH#18217\n            sourceMapGenerator = _sourceMapGenerator;\n            sourceMapsDisabled = !writer || !sourceMapGenerator;\n        }\n        function reset() {\n            nodeIdToGeneratedName = [];\n            autoGeneratedIdToGeneratedName = [];\n            generatedNames = new ts.Set();\n            tempFlagsStack = [];\n            tempFlags = 0 /* Auto */;\n            reservedNamesStack = [];\n            currentSourceFile = undefined;\n            currentLineMap = undefined;\n            detachedCommentsInfo = undefined;\n            lastNode = undefined;\n            lastSubstitution = undefined;\n            setWriter(/*output*/ undefined, /*_sourceMapGenerator*/ undefined);\n        }\n        function getCurrentLineMap() {\n            return currentLineMap || (currentLineMap = ts.getLineStarts(currentSourceFile));\n        }\n        function emit(node) {\n            if (node === undefined)\n                return;\n            var prevSourceFileTextKind = recordBundleFileInternalSectionStart(node);\n            var substitute = pipelineEmit(4 /* Unspecified */, node);\n            recordBundleFileInternalSectionEnd(prevSourceFileTextKind);\n            return substitute;\n        }\n        function emitIdentifierName(node) {\n            if (node === undefined)\n                return;\n            return pipelineEmit(2 /* IdentifierName */, node);\n        }\n        function emitExpression(node) {\n            if (node === undefined)\n                return;\n            return pipelineEmit(1 /* Expression */, node);\n        }\n        function emitJsxAttributeValue(node) {\n            return pipelineEmit(ts.isStringLiteral(node) ? 6 /* JsxAttributeValue */ : 4 /* Unspecified */, node);\n        }\n        function pipelineEmit(emitHint, node) {\n            var savedLastNode = lastNode;\n            var savedLastSubstitution = lastSubstitution;\n            var savedPreserveSourceNewlines = preserveSourceNewlines;\n            lastNode = node;\n            lastSubstitution = undefined;\n            if (preserveSourceNewlines && !!(ts.getEmitFlags(node) & 134217728 /* IgnoreSourceNewlines */)) {\n                preserveSourceNewlines = false;\n            }\n            var pipelinePhase = getPipelinePhase(0 /* Notification */, emitHint, node);\n            pipelinePhase(emitHint, node);\n            ts.Debug.assert(lastNode === node);\n            var substitute = lastSubstitution;\n            lastNode = savedLastNode;\n            lastSubstitution = savedLastSubstitution;\n            preserveSourceNewlines = savedPreserveSourceNewlines;\n            return substitute || node;\n        }\n        function getPipelinePhase(phase, emitHint, node) {\n            switch (phase) {\n                case 0 /* Notification */:\n                    if (onEmitNode !== ts.noEmitNotification && (!isEmitNotificationEnabled || isEmitNotificationEnabled(node))) {\n                        return pipelineEmitWithNotification;\n                    }\n                // falls through\n                case 1 /* Substitution */:\n                    if (substituteNode !== ts.noEmitSubstitution && (lastSubstitution = substituteNode(emitHint, node)) !== node) {\n                        return pipelineEmitWithSubstitution;\n                    }\n                // falls through\n                case 2 /* Comments */:\n                    if (!commentsDisabled && node.kind !== 297 /* SourceFile */) {\n                        return pipelineEmitWithComments;\n                    }\n                // falls through\n                case 3 /* SourceMaps */:\n                    if (!sourceMapsDisabled && node.kind !== 297 /* SourceFile */ && !ts.isInJsonFile(node)) {\n                        return pipelineEmitWithSourceMap;\n                    }\n                // falls through\n                case 4 /* Emit */:\n                    return pipelineEmitWithHint;\n                default:\n                    return ts.Debug.assertNever(phase);\n            }\n        }\n        function getNextPipelinePhase(currentPhase, emitHint, node) {\n            return getPipelinePhase(currentPhase + 1, emitHint, node);\n        }\n        function pipelineEmitWithNotification(hint, node) {\n            ts.Debug.assert(lastNode === node);\n            var pipelinePhase = getNextPipelinePhase(0 /* Notification */, hint, node);\n            onEmitNode(hint, node, pipelinePhase);\n            ts.Debug.assert(lastNode === node);\n        }\n        function pipelineEmitWithHint(hint, node) {\n            ts.Debug.assert(lastNode === node || lastSubstitution === node);\n            if (hint === 0 /* SourceFile */)\n                return emitSourceFile(ts.cast(node, ts.isSourceFile));\n            if (hint === 2 /* IdentifierName */)\n                return emitIdentifier(ts.cast(node, ts.isIdentifier));\n            if (hint === 6 /* JsxAttributeValue */)\n                return emitLiteral(ts.cast(node, ts.isStringLiteral), /*jsxAttributeEscape*/ true);\n            if (hint === 3 /* MappedTypeParameter */)\n                return emitMappedTypeParameter(ts.cast(node, ts.isTypeParameterDeclaration));\n            if (hint === 5 /* EmbeddedStatement */) {\n                ts.Debug.assertNode(node, ts.isEmptyStatement);\n                return emitEmptyStatement(/*isEmbeddedStatement*/ true);\n            }\n            if (hint === 4 /* Unspecified */) {\n                if (ts.isKeyword(node.kind))\n                    return writeTokenNode(node, writeKeyword);\n                switch (node.kind) {\n                    // Pseudo-literals\n                    case 15 /* TemplateHead */:\n                    case 16 /* TemplateMiddle */:\n                    case 17 /* TemplateTail */:\n                        return emitLiteral(node, /*jsxAttributeEscape*/ false);\n                    case 299 /* UnparsedSource */:\n                    case 293 /* UnparsedPrepend */:\n                        return emitUnparsedSourceOrPrepend(node);\n                    case 292 /* UnparsedPrologue */:\n                        return writeUnparsedNode(node);\n                    case 294 /* UnparsedText */:\n                    case 295 /* UnparsedInternalText */:\n                        return emitUnparsedTextLike(node);\n                    case 296 /* UnparsedSyntheticReference */:\n                        return emitUnparsedSyntheticReference(node);\n                    // Identifiers\n                    case 78 /* Identifier */:\n                        return emitIdentifier(node);\n                    // PrivateIdentifiers\n                    case 79 /* PrivateIdentifier */:\n                        return emitPrivateIdentifier(node);\n                    // Parse tree nodes\n                    // Names\n                    case 157 /* QualifiedName */:\n                        return emitQualifiedName(node);\n                    case 158 /* ComputedPropertyName */:\n                        return emitComputedPropertyName(node);\n                    // Signature elements\n                    case 159 /* TypeParameter */:\n                        return emitTypeParameter(node);\n                    case 160 /* Parameter */:\n                        return emitParameter(node);\n                    case 161 /* Decorator */:\n                        return emitDecorator(node);\n                    // Type members\n                    case 162 /* PropertySignature */:\n                        return emitPropertySignature(node);\n                    case 163 /* PropertyDeclaration */:\n                        return emitPropertyDeclaration(node);\n                    case 164 /* MethodSignature */:\n                        return emitMethodSignature(node);\n                    case 165 /* MethodDeclaration */:\n                        return emitMethodDeclaration(node);\n                    case 166 /* Constructor */:\n                        return emitConstructor(node);\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                        return emitAccessorDeclaration(node);\n                    case 169 /* CallSignature */:\n                        return emitCallSignature(node);\n                    case 170 /* ConstructSignature */:\n                        return emitConstructSignature(node);\n                    case 171 /* IndexSignature */:\n                        return emitIndexSignature(node);\n                    case 194 /* TemplateLiteralTypeSpan */:\n                        return emitTemplateTypeSpan(node);\n                    // Types\n                    case 172 /* TypePredicate */:\n                        return emitTypePredicate(node);\n                    case 173 /* TypeReference */:\n                        return emitTypeReference(node);\n                    case 174 /* FunctionType */:\n                        return emitFunctionType(node);\n                    case 308 /* JSDocFunctionType */:\n                        return emitJSDocFunctionType(node);\n                    case 175 /* ConstructorType */:\n                        return emitConstructorType(node);\n                    case 176 /* TypeQuery */:\n                        return emitTypeQuery(node);\n                    case 177 /* TypeLiteral */:\n                        return emitTypeLiteral(node);\n                    case 178 /* ArrayType */:\n                        return emitArrayType(node);\n                    case 179 /* TupleType */:\n                        return emitTupleType(node);\n                    case 180 /* OptionalType */:\n                        return emitOptionalType(node);\n                    case 182 /* UnionType */:\n                        return emitUnionType(node);\n                    case 183 /* IntersectionType */:\n                        return emitIntersectionType(node);\n                    case 184 /* ConditionalType */:\n                        return emitConditionalType(node);\n                    case 185 /* InferType */:\n                        return emitInferType(node);\n                    case 186 /* ParenthesizedType */:\n                        return emitParenthesizedType(node);\n                    case 223 /* ExpressionWithTypeArguments */:\n                        return emitExpressionWithTypeArguments(node);\n                    case 187 /* ThisType */:\n                        return emitThisType();\n                    case 188 /* TypeOperator */:\n                        return emitTypeOperator(node);\n                    case 189 /* IndexedAccessType */:\n                        return emitIndexedAccessType(node);\n                    case 190 /* MappedType */:\n                        return emitMappedType(node);\n                    case 191 /* LiteralType */:\n                        return emitLiteralType(node);\n                    case 193 /* TemplateLiteralType */:\n                        return emitTemplateType(node);\n                    case 195 /* ImportType */:\n                        return emitImportTypeNode(node);\n                    case 303 /* JSDocAllType */:\n                        writePunctuation(\"*\");\n                        return;\n                    case 304 /* JSDocUnknownType */:\n                        writePunctuation(\"?\");\n                        return;\n                    case 305 /* JSDocNullableType */:\n                        return emitJSDocNullableType(node);\n                    case 306 /* JSDocNonNullableType */:\n                        return emitJSDocNonNullableType(node);\n                    case 307 /* JSDocOptionalType */:\n                        return emitJSDocOptionalType(node);\n                    case 181 /* RestType */:\n                    case 309 /* JSDocVariadicType */:\n                        return emitRestOrJSDocVariadicType(node);\n                    case 192 /* NamedTupleMember */:\n                        return emitNamedTupleMember(node);\n                    // Binding patterns\n                    case 196 /* ObjectBindingPattern */:\n                        return emitObjectBindingPattern(node);\n                    case 197 /* ArrayBindingPattern */:\n                        return emitArrayBindingPattern(node);\n                    case 198 /* BindingElement */:\n                        return emitBindingElement(node);\n                    // Misc\n                    case 228 /* TemplateSpan */:\n                        return emitTemplateSpan(node);\n                    case 229 /* SemicolonClassElement */:\n                        return emitSemicolonClassElement();\n                    // Statements\n                    case 230 /* Block */:\n                        return emitBlock(node);\n                    case 232 /* VariableStatement */:\n                        return emitVariableStatement(node);\n                    case 231 /* EmptyStatement */:\n                        return emitEmptyStatement(/*isEmbeddedStatement*/ false);\n                    case 233 /* ExpressionStatement */:\n                        return emitExpressionStatement(node);\n                    case 234 /* IfStatement */:\n                        return emitIfStatement(node);\n                    case 235 /* DoStatement */:\n                        return emitDoStatement(node);\n                    case 236 /* WhileStatement */:\n                        return emitWhileStatement(node);\n                    case 237 /* ForStatement */:\n                        return emitForStatement(node);\n                    case 238 /* ForInStatement */:\n                        return emitForInStatement(node);\n                    case 239 /* ForOfStatement */:\n                        return emitForOfStatement(node);\n                    case 240 /* ContinueStatement */:\n                        return emitContinueStatement(node);\n                    case 241 /* BreakStatement */:\n                        return emitBreakStatement(node);\n                    case 242 /* ReturnStatement */:\n                        return emitReturnStatement(node);\n                    case 243 /* WithStatement */:\n                        return emitWithStatement(node);\n                    case 244 /* SwitchStatement */:\n                        return emitSwitchStatement(node);\n                    case 245 /* LabeledStatement */:\n                        return emitLabeledStatement(node);\n                    case 246 /* ThrowStatement */:\n                        return emitThrowStatement(node);\n                    case 247 /* TryStatement */:\n                        return emitTryStatement(node);\n                    case 248 /* DebuggerStatement */:\n                        return emitDebuggerStatement(node);\n                    // Declarations\n                    case 249 /* VariableDeclaration */:\n                        return emitVariableDeclaration(node);\n                    case 250 /* VariableDeclarationList */:\n                        return emitVariableDeclarationList(node);\n                    case 251 /* FunctionDeclaration */:\n                        return emitFunctionDeclaration(node);\n                    case 252 /* ClassDeclaration */:\n                        return emitClassDeclaration(node);\n                    case 253 /* InterfaceDeclaration */:\n                        return emitInterfaceDeclaration(node);\n                    case 254 /* TypeAliasDeclaration */:\n                        return emitTypeAliasDeclaration(node);\n                    case 255 /* EnumDeclaration */:\n                        return emitEnumDeclaration(node);\n                    case 256 /* ModuleDeclaration */:\n                        return emitModuleDeclaration(node);\n                    case 257 /* ModuleBlock */:\n                        return emitModuleBlock(node);\n                    case 258 /* CaseBlock */:\n                        return emitCaseBlock(node);\n                    case 259 /* NamespaceExportDeclaration */:\n                        return emitNamespaceExportDeclaration(node);\n                    case 260 /* ImportEqualsDeclaration */:\n                        return emitImportEqualsDeclaration(node);\n                    case 261 /* ImportDeclaration */:\n                        return emitImportDeclaration(node);\n                    case 262 /* ImportClause */:\n                        return emitImportClause(node);\n                    case 263 /* NamespaceImport */:\n                        return emitNamespaceImport(node);\n                    case 269 /* NamespaceExport */:\n                        return emitNamespaceExport(node);\n                    case 264 /* NamedImports */:\n                        return emitNamedImports(node);\n                    case 265 /* ImportSpecifier */:\n                        return emitImportSpecifier(node);\n                    case 266 /* ExportAssignment */:\n                        return emitExportAssignment(node);\n                    case 267 /* ExportDeclaration */:\n                        return emitExportDeclaration(node);\n                    case 268 /* NamedExports */:\n                        return emitNamedExports(node);\n                    case 270 /* ExportSpecifier */:\n                        return emitExportSpecifier(node);\n                    case 271 /* MissingDeclaration */:\n                        return;\n                    // Module references\n                    case 272 /* ExternalModuleReference */:\n                        return emitExternalModuleReference(node);\n                    // JSX (non-expression)\n                    case 11 /* JsxText */:\n                        return emitJsxText(node);\n                    case 275 /* JsxOpeningElement */:\n                    case 278 /* JsxOpeningFragment */:\n                        return emitJsxOpeningElementOrFragment(node);\n                    case 276 /* JsxClosingElement */:\n                    case 279 /* JsxClosingFragment */:\n                        return emitJsxClosingElementOrFragment(node);\n                    case 280 /* JsxAttribute */:\n                        return emitJsxAttribute(node);\n                    case 281 /* JsxAttributes */:\n                        return emitJsxAttributes(node);\n                    case 282 /* JsxSpreadAttribute */:\n                        return emitJsxSpreadAttribute(node);\n                    case 283 /* JsxExpression */:\n                        return emitJsxExpression(node);\n                    // Clauses\n                    case 284 /* CaseClause */:\n                        return emitCaseClause(node);\n                    case 285 /* DefaultClause */:\n                        return emitDefaultClause(node);\n                    case 286 /* HeritageClause */:\n                        return emitHeritageClause(node);\n                    case 287 /* CatchClause */:\n                        return emitCatchClause(node);\n                    // Property assignments\n                    case 288 /* PropertyAssignment */:\n                        return emitPropertyAssignment(node);\n                    case 289 /* ShorthandPropertyAssignment */:\n                        return emitShorthandPropertyAssignment(node);\n                    case 290 /* SpreadAssignment */:\n                        return emitSpreadAssignment(node);\n                    // Enum\n                    case 291 /* EnumMember */:\n                        return emitEnumMember(node);\n                    // JSDoc nodes (only used in codefixes currently)\n                    case 326 /* JSDocParameterTag */:\n                    case 333 /* JSDocPropertyTag */:\n                        return emitJSDocPropertyLikeTag(node);\n                    case 327 /* JSDocReturnTag */:\n                    case 329 /* JSDocTypeTag */:\n                    case 328 /* JSDocThisTag */:\n                    case 325 /* JSDocEnumTag */:\n                        return emitJSDocSimpleTypedTag(node);\n                    case 316 /* JSDocImplementsTag */:\n                    case 315 /* JSDocAugmentsTag */:\n                        return emitJSDocHeritageTag(node);\n                    case 330 /* JSDocTemplateTag */:\n                        return emitJSDocTemplateTag(node);\n                    case 331 /* JSDocTypedefTag */:\n                        return emitJSDocTypedefTag(node);\n                    case 324 /* JSDocCallbackTag */:\n                        return emitJSDocCallbackTag(node);\n                    case 313 /* JSDocSignature */:\n                        return emitJSDocSignature(node);\n                    case 312 /* JSDocTypeLiteral */:\n                        return emitJSDocTypeLiteral(node);\n                    case 319 /* JSDocClassTag */:\n                    case 314 /* JSDocTag */:\n                        return emitJSDocSimpleTag(node);\n                    case 332 /* JSDocSeeTag */:\n                        return emitJSDocSeeTag(node);\n                    case 302 /* JSDocNameReference */:\n                        return emitJSDocNameReference(node);\n                    case 311 /* JSDocComment */:\n                        return emitJSDoc(node);\n                    // Transformation nodes (ignored)\n                }\n                if (ts.isExpression(node)) {\n                    hint = 1 /* Expression */;\n                    if (substituteNode !== ts.noEmitSubstitution) {\n                        lastSubstitution = node = substituteNode(hint, node);\n                    }\n                }\n                else if (ts.isToken(node)) {\n                    return writeTokenNode(node, writePunctuation);\n                }\n            }\n            if (hint === 1 /* Expression */) {\n                switch (node.kind) {\n                    // Literals\n                    case 8 /* NumericLiteral */:\n                    case 9 /* BigIntLiteral */:\n                        return emitNumericOrBigIntLiteral(node);\n                    case 10 /* StringLiteral */:\n                    case 13 /* RegularExpressionLiteral */:\n                    case 14 /* NoSubstitutionTemplateLiteral */:\n                        return emitLiteral(node, /*jsxAttributeEscape*/ false);\n                    // Identifiers\n                    case 78 /* Identifier */:\n                        return emitIdentifier(node);\n                    // Reserved words\n                    case 94 /* FalseKeyword */:\n                    case 103 /* NullKeyword */:\n                    case 105 /* SuperKeyword */:\n                    case 109 /* TrueKeyword */:\n                    case 107 /* ThisKeyword */:\n                    case 99 /* ImportKeyword */:\n                        writeTokenNode(node, writeKeyword);\n                        return;\n                    // Expressions\n                    case 199 /* ArrayLiteralExpression */:\n                        return emitArrayLiteralExpression(node);\n                    case 200 /* ObjectLiteralExpression */:\n                        return emitObjectLiteralExpression(node);\n                    case 201 /* PropertyAccessExpression */:\n                        return emitPropertyAccessExpression(node);\n                    case 202 /* ElementAccessExpression */:\n                        return emitElementAccessExpression(node);\n                    case 203 /* CallExpression */:\n                        return emitCallExpression(node);\n                    case 204 /* NewExpression */:\n                        return emitNewExpression(node);\n                    case 205 /* TaggedTemplateExpression */:\n                        return emitTaggedTemplateExpression(node);\n                    case 206 /* TypeAssertionExpression */:\n                        return emitTypeAssertionExpression(node);\n                    case 207 /* ParenthesizedExpression */:\n                        return emitParenthesizedExpression(node);\n                    case 208 /* FunctionExpression */:\n                        return emitFunctionExpression(node);\n                    case 209 /* ArrowFunction */:\n                        return emitArrowFunction(node);\n                    case 210 /* DeleteExpression */:\n                        return emitDeleteExpression(node);\n                    case 211 /* TypeOfExpression */:\n                        return emitTypeOfExpression(node);\n                    case 212 /* VoidExpression */:\n                        return emitVoidExpression(node);\n                    case 213 /* AwaitExpression */:\n                        return emitAwaitExpression(node);\n                    case 214 /* PrefixUnaryExpression */:\n                        return emitPrefixUnaryExpression(node);\n                    case 215 /* PostfixUnaryExpression */:\n                        return emitPostfixUnaryExpression(node);\n                    case 216 /* BinaryExpression */:\n                        return emitBinaryExpression(node);\n                    case 217 /* ConditionalExpression */:\n                        return emitConditionalExpression(node);\n                    case 218 /* TemplateExpression */:\n                        return emitTemplateExpression(node);\n                    case 219 /* YieldExpression */:\n                        return emitYieldExpression(node);\n                    case 220 /* SpreadElement */:\n                        return emitSpreadExpression(node);\n                    case 221 /* ClassExpression */:\n                        return emitClassExpression(node);\n                    case 222 /* OmittedExpression */:\n                        return;\n                    case 224 /* AsExpression */:\n                        return emitAsExpression(node);\n                    case 225 /* NonNullExpression */:\n                        return emitNonNullExpression(node);\n                    case 226 /* MetaProperty */:\n                        return emitMetaProperty(node);\n                    // JSX\n                    case 273 /* JsxElement */:\n                        return emitJsxElement(node);\n                    case 274 /* JsxSelfClosingElement */:\n                        return emitJsxSelfClosingElement(node);\n                    case 277 /* JsxFragment */:\n                        return emitJsxFragment(node);\n                    // Transformation nodes\n                    case 336 /* PartiallyEmittedExpression */:\n                        return emitPartiallyEmittedExpression(node);\n                    case 337 /* CommaListExpression */:\n                        return emitCommaList(node);\n                }\n            }\n        }\n        function emitMappedTypeParameter(node) {\n            emit(node.name);\n            writeSpace();\n            writeKeyword(\"in\");\n            writeSpace();\n            emit(node.constraint);\n        }\n        function pipelineEmitWithSubstitution(hint, node) {\n            ts.Debug.assert(lastNode === node || lastSubstitution === node);\n            var pipelinePhase = getNextPipelinePhase(1 /* Substitution */, hint, node);\n            pipelinePhase(hint, lastSubstitution);\n            ts.Debug.assert(lastNode === node || lastSubstitution === node);\n        }\n        function getHelpersFromBundledSourceFiles(bundle) {\n            var result;\n            if (moduleKind === ts.ModuleKind.None || printerOptions.noEmitHelpers) {\n                return undefined;\n            }\n            var bundledHelpers = new ts.Map();\n            for (var _a = 0, _b = bundle.sourceFiles; _a < _b.length; _a++) {\n                var sourceFile = _b[_a];\n                var shouldSkip = ts.getExternalHelpersModuleName(sourceFile) !== undefined;\n                var helpers = getSortedEmitHelpers(sourceFile);\n                if (!helpers)\n                    continue;\n                for (var _c = 0, helpers_5 = helpers; _c < helpers_5.length; _c++) {\n                    var helper = helpers_5[_c];\n                    if (!helper.scoped && !shouldSkip && !bundledHelpers.get(helper.name)) {\n                        bundledHelpers.set(helper.name, true);\n                        (result || (result = [])).push(helper.name);\n                    }\n                }\n            }\n            return result;\n        }\n        function emitHelpers(node) {\n            var helpersEmitted = false;\n            var bundle = node.kind === 298 /* Bundle */ ? node : undefined;\n            if (bundle && moduleKind === ts.ModuleKind.None) {\n                return;\n            }\n            var numPrepends = bundle ? bundle.prepends.length : 0;\n            var numNodes = bundle ? bundle.sourceFiles.length + numPrepends : 1;\n            for (var i = 0; i < numNodes; i++) {\n                var currentNode = bundle ? i < numPrepends ? bundle.prepends[i] : bundle.sourceFiles[i - numPrepends] : node;\n                var sourceFile = ts.isSourceFile(currentNode) ? currentNode : ts.isUnparsedSource(currentNode) ? undefined : currentSourceFile;\n                var shouldSkip = printerOptions.noEmitHelpers || (!!sourceFile && ts.hasRecordedExternalHelpers(sourceFile));\n                var shouldBundle = (ts.isSourceFile(currentNode) || ts.isUnparsedSource(currentNode)) && !isOwnFileEmit;\n                var helpers = ts.isUnparsedSource(currentNode) ? currentNode.helpers : getSortedEmitHelpers(currentNode);\n                if (helpers) {\n                    for (var _a = 0, helpers_6 = helpers; _a < helpers_6.length; _a++) {\n                        var helper = helpers_6[_a];\n                        if (!helper.scoped) {\n                            // Skip the helper if it can be skipped and the noEmitHelpers compiler\n                            // option is set, or if it can be imported and the importHelpers compiler\n                            // option is set.\n                            if (shouldSkip)\n                                continue;\n                            // Skip the helper if it can be bundled but hasn't already been emitted and we\n                            // are emitting a bundled module.\n                            if (shouldBundle) {\n                                if (bundledHelpers.get(helper.name)) {\n                                    continue;\n                                }\n                                bundledHelpers.set(helper.name, true);\n                            }\n                        }\n                        else if (bundle) {\n                            // Skip the helper if it is scoped and we are emitting bundled helpers\n                            continue;\n                        }\n                        var pos = getTextPosWithWriteLine();\n                        if (typeof helper.text === \"string\") {\n                            writeLines(helper.text);\n                        }\n                        else {\n                            writeLines(helper.text(makeFileLevelOptimisticUniqueName));\n                        }\n                        if (bundleFileInfo)\n                            bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: \"emitHelpers\" /* EmitHelpers */, data: helper.name });\n                        helpersEmitted = true;\n                    }\n                }\n            }\n            return helpersEmitted;\n        }\n        function getSortedEmitHelpers(node) {\n            var helpers = ts.getEmitHelpers(node);\n            return helpers && ts.stableSort(helpers, ts.compareEmitHelpers);\n        }\n        //\n        // Literals/Pseudo-literals\n        //\n        // SyntaxKind.NumericLiteral\n        // SyntaxKind.BigIntLiteral\n        function emitNumericOrBigIntLiteral(node) {\n            emitLiteral(node, /*jsxAttributeEscape*/ false);\n        }\n        // SyntaxKind.StringLiteral\n        // SyntaxKind.RegularExpressionLiteral\n        // SyntaxKind.NoSubstitutionTemplateLiteral\n        // SyntaxKind.TemplateHead\n        // SyntaxKind.TemplateMiddle\n        // SyntaxKind.TemplateTail\n        function emitLiteral(node, jsxAttributeEscape) {\n            var text = getLiteralTextOfNode(node, printerOptions.neverAsciiEscape, jsxAttributeEscape);\n            if ((printerOptions.sourceMap || printerOptions.inlineSourceMap)\n                && (node.kind === 10 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) {\n                writeLiteral(text);\n            }\n            else {\n                // Quick info expects all literals to be called with writeStringLiteral, as there's no specific type for numberLiterals\n                writeStringLiteral(text);\n            }\n        }\n        // SyntaxKind.UnparsedSource\n        // SyntaxKind.UnparsedPrepend\n        function emitUnparsedSourceOrPrepend(unparsed) {\n            for (var _a = 0, _b = unparsed.texts; _a < _b.length; _a++) {\n                var text = _b[_a];\n                writeLine();\n                emit(text);\n            }\n        }\n        // SyntaxKind.UnparsedPrologue\n        // SyntaxKind.UnparsedText\n        // SyntaxKind.UnparsedInternal\n        // SyntaxKind.UnparsedSyntheticReference\n        function writeUnparsedNode(unparsed) {\n            writer.rawWrite(unparsed.parent.text.substring(unparsed.pos, unparsed.end));\n        }\n        // SyntaxKind.UnparsedText\n        // SyntaxKind.UnparsedInternal\n        function emitUnparsedTextLike(unparsed) {\n            var pos = getTextPosWithWriteLine();\n            writeUnparsedNode(unparsed);\n            if (bundleFileInfo) {\n                updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 294 /* UnparsedText */ ?\n                    \"text\" /* Text */ :\n                    \"internal\" /* Internal */);\n            }\n        }\n        // SyntaxKind.UnparsedSyntheticReference\n        function emitUnparsedSyntheticReference(unparsed) {\n            var pos = getTextPosWithWriteLine();\n            writeUnparsedNode(unparsed);\n            if (bundleFileInfo) {\n                var section = ts.clone(unparsed.section);\n                section.pos = pos;\n                section.end = writer.getTextPos();\n                bundleFileInfo.sections.push(section);\n            }\n        }\n        //\n        // Identifiers\n        //\n        function emitIdentifier(node) {\n            var writeText = node.symbol ? writeSymbol : write;\n            writeText(getTextOfNode(node, /*includeTrivia*/ false), node.symbol);\n            emitList(node, node.typeArguments, 53776 /* TypeParameters */); // Call emitList directly since it could be an array of TypeParameterDeclarations _or_ type arguments\n        }\n        //\n        // Names\n        //\n        function emitPrivateIdentifier(node) {\n            var writeText = node.symbol ? writeSymbol : write;\n            writeText(getTextOfNode(node, /*includeTrivia*/ false), node.symbol);\n        }\n        function emitQualifiedName(node) {\n            emitEntityName(node.left);\n            writePunctuation(\".\");\n            emit(node.right);\n        }\n        function emitEntityName(node) {\n            if (node.kind === 78 /* Identifier */) {\n                emitExpression(node);\n            }\n            else {\n                emit(node);\n            }\n        }\n        function emitComputedPropertyName(node) {\n            writePunctuation(\"[\");\n            emitExpression(node.expression);\n            writePunctuation(\"]\");\n        }\n        //\n        // Signature elements\n        //\n        function emitTypeParameter(node) {\n            emit(node.name);\n            if (node.constraint) {\n                writeSpace();\n                writeKeyword(\"extends\");\n                writeSpace();\n                emit(node.constraint);\n            }\n            if (node.default) {\n                writeSpace();\n                writeOperator(\"=\");\n                writeSpace();\n                emit(node.default);\n            }\n        }\n        function emitParameter(node) {\n            emitDecorators(node, node.decorators);\n            emitModifiers(node, node.modifiers);\n            emit(node.dotDotDotToken);\n            emitNodeWithWriter(node.name, writeParameter);\n            emit(node.questionToken);\n            if (node.parent && node.parent.kind === 308 /* JSDocFunctionType */ && !node.name) {\n                emit(node.type);\n            }\n            else {\n                emitTypeAnnotation(node.type);\n            }\n            // The comment position has to fallback to any present node within the parameterdeclaration because as it turns out, the parser can make parameter declarations with _just_ an initializer.\n            emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name ? node.name.end : node.modifiers ? node.modifiers.end : node.decorators ? node.decorators.end : node.pos, node);\n        }\n        function emitDecorator(decorator) {\n            writePunctuation(\"@\");\n            emitExpression(decorator.expression);\n        }\n        //\n        // Type members\n        //\n        function emitPropertySignature(node) {\n            emitDecorators(node, node.decorators);\n            emitModifiers(node, node.modifiers);\n            emitNodeWithWriter(node.name, writeProperty);\n            emit(node.questionToken);\n            emitTypeAnnotation(node.type);\n            writeTrailingSemicolon();\n        }\n        function emitPropertyDeclaration(node) {\n            emitDecorators(node, node.decorators);\n            emitModifiers(node, node.modifiers);\n            emit(node.name);\n            emit(node.questionToken);\n            emit(node.exclamationToken);\n            emitTypeAnnotation(node.type);\n            emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name.end, node);\n            writeTrailingSemicolon();\n        }\n        function emitMethodSignature(node) {\n            pushNameGenerationScope(node);\n            emitDecorators(node, node.decorators);\n            emitModifiers(node, node.modifiers);\n            emit(node.name);\n            emit(node.questionToken);\n            emitTypeParameters(node, node.typeParameters);\n            emitParameters(node, node.parameters);\n            emitTypeAnnotation(node.type);\n            writeTrailingSemicolon();\n            popNameGenerationScope(node);\n        }\n        function emitMethodDeclaration(node) {\n            emitDecorators(node, node.decorators);\n            emitModifiers(node, node.modifiers);\n            emit(node.asteriskToken);\n            emit(node.name);\n            emit(node.questionToken);\n            emitSignatureAndBody(node, emitSignatureHead);\n        }\n        function emitConstructor(node) {\n            emitModifiers(node, node.modifiers);\n            writeKeyword(\"constructor\");\n            emitSignatureAndBody(node, emitSignatureHead);\n        }\n        function emitAccessorDeclaration(node) {\n            emitDecorators(node, node.decorators);\n            emitModifiers(node, node.modifiers);\n            writeKeyword(node.kind === 167 /* GetAccessor */ ? \"get\" : \"set\");\n            writeSpace();\n            emit(node.name);\n            emitSignatureAndBody(node, emitSignatureHead);\n        }\n        function emitCallSignature(node) {\n            pushNameGenerationScope(node);\n            emitDecorators(node, node.decorators);\n            emitModifiers(node, node.modifiers);\n            emitTypeParameters(node, node.typeParameters);\n            emitParameters(node, node.parameters);\n            emitTypeAnnotation(node.type);\n            writeTrailingSemicolon();\n            popNameGenerationScope(node);\n        }\n        function emitConstructSignature(node) {\n            pushNameGenerationScope(node);\n            emitDecorators(node, node.decorators);\n            emitModifiers(node, node.modifiers);\n            writeKeyword(\"new\");\n            writeSpace();\n            emitTypeParameters(node, node.typeParameters);\n            emitParameters(node, node.parameters);\n            emitTypeAnnotation(node.type);\n            writeTrailingSemicolon();\n            popNameGenerationScope(node);\n        }\n        function emitIndexSignature(node) {\n            emitDecorators(node, node.decorators);\n            emitModifiers(node, node.modifiers);\n            emitParametersForIndexSignature(node, node.parameters);\n            emitTypeAnnotation(node.type);\n            writeTrailingSemicolon();\n        }\n        function emitTemplateTypeSpan(node) {\n            emit(node.type);\n            emit(node.literal);\n        }\n        function emitSemicolonClassElement() {\n            writeTrailingSemicolon();\n        }\n        //\n        // Types\n        //\n        function emitTypePredicate(node) {\n            if (node.assertsModifier) {\n                emit(node.assertsModifier);\n                writeSpace();\n            }\n            emit(node.parameterName);\n            if (node.type) {\n                writeSpace();\n                writeKeyword(\"is\");\n                writeSpace();\n                emit(node.type);\n            }\n        }\n        function emitTypeReference(node) {\n            emit(node.typeName);\n            emitTypeArguments(node, node.typeArguments);\n        }\n        function emitFunctionType(node) {\n            pushNameGenerationScope(node);\n            emitTypeParameters(node, node.typeParameters);\n            emitParametersForArrow(node, node.parameters);\n            writeSpace();\n            writePunctuation(\"=>\");\n            writeSpace();\n            emit(node.type);\n            popNameGenerationScope(node);\n        }\n        function emitJSDocFunctionType(node) {\n            writeKeyword(\"function\");\n            emitParameters(node, node.parameters);\n            writePunctuation(\":\");\n            emit(node.type);\n        }\n        function emitJSDocNullableType(node) {\n            writePunctuation(\"?\");\n            emit(node.type);\n        }\n        function emitJSDocNonNullableType(node) {\n            writePunctuation(\"!\");\n            emit(node.type);\n        }\n        function emitJSDocOptionalType(node) {\n            emit(node.type);\n            writePunctuation(\"=\");\n        }\n        function emitConstructorType(node) {\n            pushNameGenerationScope(node);\n            emitModifiers(node, node.modifiers);\n            writeKeyword(\"new\");\n            writeSpace();\n            emitTypeParameters(node, node.typeParameters);\n            emitParameters(node, node.parameters);\n            writeSpace();\n            writePunctuation(\"=>\");\n            writeSpace();\n            emit(node.type);\n            popNameGenerationScope(node);\n        }\n        function emitTypeQuery(node) {\n            writeKeyword(\"typeof\");\n            writeSpace();\n            emit(node.exprName);\n        }\n        function emitTypeLiteral(node) {\n            writePunctuation(\"{\");\n            var flags = ts.getEmitFlags(node) & 1 /* SingleLine */ ? 768 /* SingleLineTypeLiteralMembers */ : 32897 /* MultiLineTypeLiteralMembers */;\n            emitList(node, node.members, flags | 524288 /* NoSpaceIfEmpty */);\n            writePunctuation(\"}\");\n        }\n        function emitArrayType(node) {\n            emit(node.elementType);\n            writePunctuation(\"[\");\n            writePunctuation(\"]\");\n        }\n        function emitRestOrJSDocVariadicType(node) {\n            writePunctuation(\"...\");\n            emit(node.type);\n        }\n        function emitTupleType(node) {\n            emitTokenWithComment(22 /* OpenBracketToken */, node.pos, writePunctuation, node);\n            var flags = ts.getEmitFlags(node) & 1 /* SingleLine */ ? 528 /* SingleLineTupleTypeElements */ : 657 /* MultiLineTupleTypeElements */;\n            emitList(node, node.elements, flags | 524288 /* NoSpaceIfEmpty */);\n            emitTokenWithComment(23 /* CloseBracketToken */, node.elements.end, writePunctuation, node);\n        }\n        function emitNamedTupleMember(node) {\n            emit(node.dotDotDotToken);\n            emit(node.name);\n            emit(node.questionToken);\n            emitTokenWithComment(58 /* ColonToken */, node.name.end, writePunctuation, node);\n            writeSpace();\n            emit(node.type);\n        }\n        function emitOptionalType(node) {\n            emit(node.type);\n            writePunctuation(\"?\");\n        }\n        function emitUnionType(node) {\n            emitList(node, node.types, 516 /* UnionTypeConstituents */);\n        }\n        function emitIntersectionType(node) {\n            emitList(node, node.types, 520 /* IntersectionTypeConstituents */);\n        }\n        function emitConditionalType(node) {\n            emit(node.checkType);\n            writeSpace();\n            writeKeyword(\"extends\");\n            writeSpace();\n            emit(node.extendsType);\n            writeSpace();\n            writePunctuation(\"?\");\n            writeSpace();\n            emit(node.trueType);\n            writeSpace();\n            writePunctuation(\":\");\n            writeSpace();\n            emit(node.falseType);\n        }\n        function emitInferType(node) {\n            writeKeyword(\"infer\");\n            writeSpace();\n            emit(node.typeParameter);\n        }\n        function emitParenthesizedType(node) {\n            writePunctuation(\"(\");\n            emit(node.type);\n            writePunctuation(\")\");\n        }\n        function emitThisType() {\n            writeKeyword(\"this\");\n        }\n        function emitTypeOperator(node) {\n            writeTokenText(node.operator, writeKeyword);\n            writeSpace();\n            emit(node.type);\n        }\n        function emitIndexedAccessType(node) {\n            emit(node.objectType);\n            writePunctuation(\"[\");\n            emit(node.indexType);\n            writePunctuation(\"]\");\n        }\n        function emitMappedType(node) {\n            var emitFlags = ts.getEmitFlags(node);\n            writePunctuation(\"{\");\n            if (emitFlags & 1 /* SingleLine */) {\n                writeSpace();\n            }\n            else {\n                writeLine();\n                increaseIndent();\n            }\n            if (node.readonlyToken) {\n                emit(node.readonlyToken);\n                if (node.readonlyToken.kind !== 142 /* ReadonlyKeyword */) {\n                    writeKeyword(\"readonly\");\n                }\n                writeSpace();\n            }\n            writePunctuation(\"[\");\n            pipelineEmit(3 /* MappedTypeParameter */, node.typeParameter);\n            if (node.nameType) {\n                writeSpace();\n                writeKeyword(\"as\");\n                writeSpace();\n                emit(node.nameType);\n            }\n            writePunctuation(\"]\");\n            if (node.questionToken) {\n                emit(node.questionToken);\n                if (node.questionToken.kind !== 57 /* QuestionToken */) {\n                    writePunctuation(\"?\");\n                }\n            }\n            writePunctuation(\":\");\n            writeSpace();\n            emit(node.type);\n            writeTrailingSemicolon();\n            if (emitFlags & 1 /* SingleLine */) {\n                writeSpace();\n            }\n            else {\n                writeLine();\n                decreaseIndent();\n            }\n            writePunctuation(\"}\");\n        }\n        function emitLiteralType(node) {\n            emitExpression(node.literal);\n        }\n        function emitTemplateType(node) {\n            emit(node.head);\n            emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */);\n        }\n        function emitImportTypeNode(node) {\n            if (node.isTypeOf) {\n                writeKeyword(\"typeof\");\n                writeSpace();\n            }\n            writeKeyword(\"import\");\n            writePunctuation(\"(\");\n            emit(node.argument);\n            writePunctuation(\")\");\n            if (node.qualifier) {\n                writePunctuation(\".\");\n                emit(node.qualifier);\n            }\n            emitTypeArguments(node, node.typeArguments);\n        }\n        //\n        // Binding patterns\n        //\n        function emitObjectBindingPattern(node) {\n            writePunctuation(\"{\");\n            emitList(node, node.elements, 525136 /* ObjectBindingPatternElements */);\n            writePunctuation(\"}\");\n        }\n        function emitArrayBindingPattern(node) {\n            writePunctuation(\"[\");\n            emitList(node, node.elements, 524880 /* ArrayBindingPatternElements */);\n            writePunctuation(\"]\");\n        }\n        function emitBindingElement(node) {\n            emit(node.dotDotDotToken);\n            if (node.propertyName) {\n                emit(node.propertyName);\n                writePunctuation(\":\");\n                writeSpace();\n            }\n            emit(node.name);\n            emitInitializer(node.initializer, node.name.end, node);\n        }\n        //\n        // Expressions\n        //\n        function emitArrayLiteralExpression(node) {\n            var elements = node.elements;\n            var preferNewLine = node.multiLine ? 65536 /* PreferNewLine */ : 0 /* None */;\n            emitExpressionList(node, elements, 8914 /* ArrayLiteralExpressionElements */ | preferNewLine);\n        }\n        function emitObjectLiteralExpression(node) {\n            ts.forEach(node.properties, generateMemberNames);\n            var indentedFlag = ts.getEmitFlags(node) & 65536 /* Indented */;\n            if (indentedFlag) {\n                increaseIndent();\n            }\n            var preferNewLine = node.multiLine ? 65536 /* PreferNewLine */ : 0 /* None */;\n            var allowTrailingComma = currentSourceFile.languageVersion >= 1 /* ES5 */ && !ts.isJsonSourceFile(currentSourceFile) ? 64 /* AllowTrailingComma */ : 0 /* None */;\n            emitList(node, node.properties, 526226 /* ObjectLiteralExpressionProperties */ | allowTrailingComma | preferNewLine);\n            if (indentedFlag) {\n                decreaseIndent();\n            }\n        }\n        function emitPropertyAccessExpression(node) {\n            var expression = ts.cast(emitExpression(node.expression), ts.isExpression);\n            var token = node.questionDotToken || ts.setTextRangePosEnd(ts.factory.createToken(24 /* DotToken */), node.expression.end, node.name.pos);\n            var linesBeforeDot = getLinesBetweenNodes(node, node.expression, token);\n            var linesAfterDot = getLinesBetweenNodes(node, token, node.name);\n            writeLinesAndIndent(linesBeforeDot, /*writeSpaceIfNotIndenting*/ false);\n            var shouldEmitDotDot = token.kind !== 28 /* QuestionDotToken */ &&\n                mayNeedDotDotForPropertyAccess(expression) &&\n                !writer.hasTrailingComment() &&\n                !writer.hasTrailingWhitespace();\n            if (shouldEmitDotDot) {\n                writePunctuation(\".\");\n            }\n            if (node.questionDotToken) {\n                emit(token);\n            }\n            else {\n                emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node);\n            }\n            writeLinesAndIndent(linesAfterDot, /*writeSpaceIfNotIndenting*/ false);\n            emit(node.name);\n            decreaseIndentIf(linesBeforeDot, linesAfterDot);\n        }\n        // 1..toString is a valid property access, emit a dot after the literal\n        // Also emit a dot if expression is a integer const enum value - it will appear in generated code as numeric literal\n        function mayNeedDotDotForPropertyAccess(expression) {\n            expression = ts.skipPartiallyEmittedExpressions(expression);\n            if (ts.isNumericLiteral(expression)) {\n                // check if numeric literal is a decimal literal that was originally written with a dot\n                var text = getLiteralTextOfNode(expression, /*neverAsciiEscape*/ true, /*jsxAttributeEscape*/ false);\n                // If he number will be printed verbatim and it doesn't already contain a dot, add one\n                // if the expression doesn't have any comments that will be emitted.\n                return !expression.numericLiteralFlags && !ts.stringContains(text, ts.tokenToString(24 /* DotToken */));\n            }\n            else if (ts.isAccessExpression(expression)) {\n                // check if constant enum value is integer\n                var constantValue = ts.getConstantValue(expression);\n                // isFinite handles cases when constantValue is undefined\n                return typeof constantValue === \"number\" && isFinite(constantValue)\n                    && Math.floor(constantValue) === constantValue;\n            }\n        }\n        function emitElementAccessExpression(node) {\n            emitExpression(node.expression);\n            emit(node.questionDotToken);\n            emitTokenWithComment(22 /* OpenBracketToken */, node.expression.end, writePunctuation, node);\n            emitExpression(node.argumentExpression);\n            emitTokenWithComment(23 /* CloseBracketToken */, node.argumentExpression.end, writePunctuation, node);\n        }\n        function emitCallExpression(node) {\n            emitExpression(node.expression);\n            emit(node.questionDotToken);\n            emitTypeArguments(node, node.typeArguments);\n            emitExpressionList(node, node.arguments, 2576 /* CallExpressionArguments */);\n        }\n        function emitNewExpression(node) {\n            emitTokenWithComment(102 /* NewKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            emitExpression(node.expression);\n            emitTypeArguments(node, node.typeArguments);\n            emitExpressionList(node, node.arguments, 18960 /* NewExpressionArguments */);\n        }\n        function emitTaggedTemplateExpression(node) {\n            emitExpression(node.tag);\n            emitTypeArguments(node, node.typeArguments);\n            writeSpace();\n            emitExpression(node.template);\n        }\n        function emitTypeAssertionExpression(node) {\n            writePunctuation(\"<\");\n            emit(node.type);\n            writePunctuation(\">\");\n            emitExpression(node.expression);\n        }\n        function emitParenthesizedExpression(node) {\n            var openParenPos = emitTokenWithComment(20 /* OpenParenToken */, node.pos, writePunctuation, node);\n            var indented = writeLineSeparatorsAndIndentBefore(node.expression, node);\n            emitExpression(node.expression);\n            writeLineSeparatorsAfter(node.expression, node);\n            decreaseIndentIf(indented);\n            emitTokenWithComment(21 /* CloseParenToken */, node.expression ? node.expression.end : openParenPos, writePunctuation, node);\n        }\n        function emitFunctionExpression(node) {\n            generateNameIfNeeded(node.name);\n            emitFunctionDeclarationOrExpression(node);\n        }\n        function emitArrowFunction(node) {\n            emitDecorators(node, node.decorators);\n            emitModifiers(node, node.modifiers);\n            emitSignatureAndBody(node, emitArrowFunctionHead);\n        }\n        function emitArrowFunctionHead(node) {\n            emitTypeParameters(node, node.typeParameters);\n            emitParametersForArrow(node, node.parameters);\n            emitTypeAnnotation(node.type);\n            writeSpace();\n            emit(node.equalsGreaterThanToken);\n        }\n        function emitDeleteExpression(node) {\n            emitTokenWithComment(88 /* DeleteKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            emitExpression(node.expression);\n        }\n        function emitTypeOfExpression(node) {\n            emitTokenWithComment(111 /* TypeOfKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            emitExpression(node.expression);\n        }\n        function emitVoidExpression(node) {\n            emitTokenWithComment(113 /* VoidKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            emitExpression(node.expression);\n        }\n        function emitAwaitExpression(node) {\n            emitTokenWithComment(130 /* AwaitKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            emitExpression(node.expression);\n        }\n        function emitPrefixUnaryExpression(node) {\n            writeTokenText(node.operator, writeOperator);\n            if (shouldEmitWhitespaceBeforeOperand(node)) {\n                writeSpace();\n            }\n            emitExpression(node.operand);\n        }\n        function shouldEmitWhitespaceBeforeOperand(node) {\n            // In some cases, we need to emit a space between the operator and the operand. One obvious case\n            // is when the operator is an identifier, like delete or typeof. We also need to do this for plus\n            // and minus expressions in certain cases. Specifically, consider the following two cases (parens\n            // are just for clarity of exposition, and not part of the source code):\n            //\n            //  (+(+1))\n            //  (+(++1))\n            //\n            // We need to emit a space in both cases. In the first case, the absence of a space will make\n            // the resulting expression a prefix increment operation. And in the second, it will make the resulting\n            // expression a prefix increment whose operand is a plus expression - (++(+x))\n            // The same is true of minus of course.\n            var operand = node.operand;\n            return operand.kind === 214 /* PrefixUnaryExpression */\n                && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */))\n                    || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */)));\n        }\n        function emitPostfixUnaryExpression(node) {\n            emitExpression(node.operand);\n            writeTokenText(node.operator, writeOperator);\n        }\n        var EmitBinaryExpressionState;\n        (function (EmitBinaryExpressionState) {\n            EmitBinaryExpressionState[EmitBinaryExpressionState[\"EmitLeft\"] = 0] = \"EmitLeft\";\n            EmitBinaryExpressionState[EmitBinaryExpressionState[\"EmitRight\"] = 1] = \"EmitRight\";\n            EmitBinaryExpressionState[EmitBinaryExpressionState[\"FinishEmit\"] = 2] = \"FinishEmit\";\n        })(EmitBinaryExpressionState || (EmitBinaryExpressionState = {}));\n        /**\n         * emitBinaryExpression includes an embedded work stack to attempt to handle as many nested binary expressions\n         * as possible without creating any additional stack frames. This can only be done when the emit pipeline does\n         * not require notification/substitution/comment/sourcemap decorations.\n         */\n        function emitBinaryExpression(node) {\n            var nodeStack = [node];\n            var stateStack = [0 /* EmitLeft */];\n            var stackIndex = 0;\n            while (stackIndex >= 0) {\n                node = nodeStack[stackIndex];\n                switch (stateStack[stackIndex]) {\n                    case 0 /* EmitLeft */: {\n                        maybePipelineEmitExpression(node.left);\n                        break;\n                    }\n                    case 1 /* EmitRight */: {\n                        var isCommaOperator = node.operatorToken.kind !== 27 /* CommaToken */;\n                        var linesBeforeOperator = getLinesBetweenNodes(node, node.left, node.operatorToken);\n                        var linesAfterOperator = getLinesBetweenNodes(node, node.operatorToken, node.right);\n                        writeLinesAndIndent(linesBeforeOperator, isCommaOperator);\n                        emitLeadingCommentsOfPosition(node.operatorToken.pos);\n                        writeTokenNode(node.operatorToken, node.operatorToken.kind === 100 /* InKeyword */ ? writeKeyword : writeOperator);\n                        emitTrailingCommentsOfPosition(node.operatorToken.end, /*prefixSpace*/ true); // Binary operators should have a space before the comment starts\n                        writeLinesAndIndent(linesAfterOperator, /*writeSpaceIfNotIndenting*/ true);\n                        maybePipelineEmitExpression(node.right);\n                        break;\n                    }\n                    case 2 /* FinishEmit */: {\n                        var linesBeforeOperator = getLinesBetweenNodes(node, node.left, node.operatorToken);\n                        var linesAfterOperator = getLinesBetweenNodes(node, node.operatorToken, node.right);\n                        decreaseIndentIf(linesBeforeOperator, linesAfterOperator);\n                        stackIndex--;\n                        break;\n                    }\n                    default: return ts.Debug.fail(\"Invalid state \" + stateStack[stackIndex] + \" for emitBinaryExpressionWorker\");\n                }\n            }\n            function maybePipelineEmitExpression(next) {\n                // Advance the state of this unit of work,\n                stateStack[stackIndex]++;\n                // Then actually do the work of emitting the node `next` returned by the prior state\n                // The following section should be identical to `pipelineEmit` save it assumes EmitHint.Expression and offloads\n                // binary expression handling, where possible, to the contained work queue\n                // #region trampolinePipelineEmit\n                var savedLastNode = lastNode;\n                var savedLastSubstitution = lastSubstitution;\n                lastNode = next;\n                lastSubstitution = undefined;\n                var pipelinePhase = getPipelinePhase(0 /* Notification */, 1 /* Expression */, next);\n                if (pipelinePhase === pipelineEmitWithHint && ts.isBinaryExpression(next)) {\n                    // If the target pipeline phase is emit directly, and the next node's also a binary expression,\n                    // skip all the intermediate indirection and push the expression directly onto the work stack\n                    stackIndex++;\n                    stateStack[stackIndex] = 0 /* EmitLeft */;\n                    nodeStack[stackIndex] = next;\n                }\n                else {\n                    pipelinePhase(1 /* Expression */, next);\n                }\n                ts.Debug.assert(lastNode === next);\n                lastNode = savedLastNode;\n                lastSubstitution = savedLastSubstitution;\n                // #endregion trampolinePipelineEmit\n            }\n        }\n        function emitConditionalExpression(node) {\n            var linesBeforeQuestion = getLinesBetweenNodes(node, node.condition, node.questionToken);\n            var linesAfterQuestion = getLinesBetweenNodes(node, node.questionToken, node.whenTrue);\n            var linesBeforeColon = getLinesBetweenNodes(node, node.whenTrue, node.colonToken);\n            var linesAfterColon = getLinesBetweenNodes(node, node.colonToken, node.whenFalse);\n            emitExpression(node.condition);\n            writeLinesAndIndent(linesBeforeQuestion, /*writeSpaceIfNotIndenting*/ true);\n            emit(node.questionToken);\n            writeLinesAndIndent(linesAfterQuestion, /*writeSpaceIfNotIndenting*/ true);\n            emitExpression(node.whenTrue);\n            decreaseIndentIf(linesBeforeQuestion, linesAfterQuestion);\n            writeLinesAndIndent(linesBeforeColon, /*writeSpaceIfNotIndenting*/ true);\n            emit(node.colonToken);\n            writeLinesAndIndent(linesAfterColon, /*writeSpaceIfNotIndenting*/ true);\n            emitExpression(node.whenFalse);\n            decreaseIndentIf(linesBeforeColon, linesAfterColon);\n        }\n        function emitTemplateExpression(node) {\n            emit(node.head);\n            emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */);\n        }\n        function emitYieldExpression(node) {\n            emitTokenWithComment(124 /* YieldKeyword */, node.pos, writeKeyword, node);\n            emit(node.asteriskToken);\n            emitExpressionWithLeadingSpace(node.expression);\n        }\n        function emitSpreadExpression(node) {\n            emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node);\n            emitExpression(node.expression);\n        }\n        function emitClassExpression(node) {\n            generateNameIfNeeded(node.name);\n            emitClassDeclarationOrExpression(node);\n        }\n        function emitExpressionWithTypeArguments(node) {\n            emitExpression(node.expression);\n            emitTypeArguments(node, node.typeArguments);\n        }\n        function emitAsExpression(node) {\n            emitExpression(node.expression);\n            if (node.type) {\n                writeSpace();\n                writeKeyword(\"as\");\n                writeSpace();\n                emit(node.type);\n            }\n        }\n        function emitNonNullExpression(node) {\n            emitExpression(node.expression);\n            writeOperator(\"!\");\n        }\n        function emitMetaProperty(node) {\n            writeToken(node.keywordToken, node.pos, writePunctuation);\n            writePunctuation(\".\");\n            emit(node.name);\n        }\n        //\n        // Misc\n        //\n        function emitTemplateSpan(node) {\n            emitExpression(node.expression);\n            emit(node.literal);\n        }\n        //\n        // Statements\n        //\n        function emitBlock(node) {\n            emitBlockStatements(node, /*forceSingleLine*/ !node.multiLine && isEmptyBlock(node));\n        }\n        function emitBlockStatements(node, forceSingleLine) {\n            emitTokenWithComment(18 /* OpenBraceToken */, node.pos, writePunctuation, /*contextNode*/ node);\n            var format = forceSingleLine || ts.getEmitFlags(node) & 1 /* SingleLine */ ? 768 /* SingleLineBlockStatements */ : 129 /* MultiLineBlockStatements */;\n            emitList(node, node.statements, format);\n            emitTokenWithComment(19 /* CloseBraceToken */, node.statements.end, writePunctuation, /*contextNode*/ node, /*indentLeading*/ !!(format & 1 /* MultiLine */));\n        }\n        function emitVariableStatement(node) {\n            emitModifiers(node, node.modifiers);\n            emit(node.declarationList);\n            writeTrailingSemicolon();\n        }\n        function emitEmptyStatement(isEmbeddedStatement) {\n            // While most trailing semicolons are possibly insignificant, an embedded \"empty\"\n            // statement is significant and cannot be elided by a trailing-semicolon-omitting writer.\n            if (isEmbeddedStatement) {\n                writePunctuation(\";\");\n            }\n            else {\n                writeTrailingSemicolon();\n            }\n        }\n        function emitExpressionStatement(node) {\n            emitExpression(node.expression);\n            // Emit semicolon in non json files\n            // or if json file that created synthesized expression(eg.define expression statement when --out and amd code generation)\n            if (!ts.isJsonSourceFile(currentSourceFile) || ts.nodeIsSynthesized(node.expression)) {\n                writeTrailingSemicolon();\n            }\n        }\n        function emitIfStatement(node) {\n            var openParenPos = emitTokenWithComment(98 /* IfKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);\n            emitExpression(node.expression);\n            emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node);\n            emitEmbeddedStatement(node, node.thenStatement);\n            if (node.elseStatement) {\n                writeLineOrSpace(node, node.thenStatement, node.elseStatement);\n                emitTokenWithComment(90 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node);\n                if (node.elseStatement.kind === 234 /* IfStatement */) {\n                    writeSpace();\n                    emit(node.elseStatement);\n                }\n                else {\n                    emitEmbeddedStatement(node, node.elseStatement);\n                }\n            }\n        }\n        function emitWhileClause(node, startPos) {\n            var openParenPos = emitTokenWithComment(114 /* WhileKeyword */, startPos, writeKeyword, node);\n            writeSpace();\n            emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);\n            emitExpression(node.expression);\n            emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node);\n        }\n        function emitDoStatement(node) {\n            emitTokenWithComment(89 /* DoKeyword */, node.pos, writeKeyword, node);\n            emitEmbeddedStatement(node, node.statement);\n            if (ts.isBlock(node.statement) && !preserveSourceNewlines) {\n                writeSpace();\n            }\n            else {\n                writeLineOrSpace(node, node.statement, node.expression);\n            }\n            emitWhileClause(node, node.statement.end);\n            writeTrailingSemicolon();\n        }\n        function emitWhileStatement(node) {\n            emitWhileClause(node, node.pos);\n            emitEmbeddedStatement(node, node.statement);\n        }\n        function emitForStatement(node) {\n            var openParenPos = emitTokenWithComment(96 /* ForKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            var pos = emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, /*contextNode*/ node);\n            emitForBinding(node.initializer);\n            pos = emitTokenWithComment(26 /* SemicolonToken */, node.initializer ? node.initializer.end : pos, writePunctuation, node);\n            emitExpressionWithLeadingSpace(node.condition);\n            pos = emitTokenWithComment(26 /* SemicolonToken */, node.condition ? node.condition.end : pos, writePunctuation, node);\n            emitExpressionWithLeadingSpace(node.incrementor);\n            emitTokenWithComment(21 /* CloseParenToken */, node.incrementor ? node.incrementor.end : pos, writePunctuation, node);\n            emitEmbeddedStatement(node, node.statement);\n        }\n        function emitForInStatement(node) {\n            var openParenPos = emitTokenWithComment(96 /* ForKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);\n            emitForBinding(node.initializer);\n            writeSpace();\n            emitTokenWithComment(100 /* InKeyword */, node.initializer.end, writeKeyword, node);\n            writeSpace();\n            emitExpression(node.expression);\n            emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node);\n            emitEmbeddedStatement(node, node.statement);\n        }\n        function emitForOfStatement(node) {\n            var openParenPos = emitTokenWithComment(96 /* ForKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            emitWithTrailingSpace(node.awaitModifier);\n            emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);\n            emitForBinding(node.initializer);\n            writeSpace();\n            emitTokenWithComment(156 /* OfKeyword */, node.initializer.end, writeKeyword, node);\n            writeSpace();\n            emitExpression(node.expression);\n            emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node);\n            emitEmbeddedStatement(node, node.statement);\n        }\n        function emitForBinding(node) {\n            if (node !== undefined) {\n                if (node.kind === 250 /* VariableDeclarationList */) {\n                    emit(node);\n                }\n                else {\n                    emitExpression(node);\n                }\n            }\n        }\n        function emitContinueStatement(node) {\n            emitTokenWithComment(85 /* ContinueKeyword */, node.pos, writeKeyword, node);\n            emitWithLeadingSpace(node.label);\n            writeTrailingSemicolon();\n        }\n        function emitBreakStatement(node) {\n            emitTokenWithComment(80 /* BreakKeyword */, node.pos, writeKeyword, node);\n            emitWithLeadingSpace(node.label);\n            writeTrailingSemicolon();\n        }\n        function emitTokenWithComment(token, pos, writer, contextNode, indentLeading) {\n            var node = ts.getParseTreeNode(contextNode);\n            var isSimilarNode = node && node.kind === contextNode.kind;\n            var startPos = pos;\n            if (isSimilarNode && currentSourceFile) {\n                pos = ts.skipTrivia(currentSourceFile.text, pos);\n            }\n            if (isSimilarNode && contextNode.pos !== startPos) {\n                var needsIndent = indentLeading && currentSourceFile && !ts.positionsAreOnSameLine(startPos, pos, currentSourceFile);\n                if (needsIndent) {\n                    increaseIndent();\n                }\n                emitLeadingCommentsOfPosition(startPos);\n                if (needsIndent) {\n                    decreaseIndent();\n                }\n            }\n            pos = writeTokenText(token, writer, pos);\n            if (isSimilarNode && contextNode.end !== pos) {\n                var isJsxExprContext = contextNode.kind === 283 /* JsxExpression */;\n                emitTrailingCommentsOfPosition(pos, /*prefixSpace*/ !isJsxExprContext, /*forceNoNewline*/ isJsxExprContext);\n            }\n            return pos;\n        }\n        function emitReturnStatement(node) {\n            emitTokenWithComment(104 /* ReturnKeyword */, node.pos, writeKeyword, /*contextNode*/ node);\n            emitExpressionWithLeadingSpace(node.expression);\n            writeTrailingSemicolon();\n        }\n        function emitWithStatement(node) {\n            var openParenPos = emitTokenWithComment(115 /* WithKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);\n            emitExpression(node.expression);\n            emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node);\n            emitEmbeddedStatement(node, node.statement);\n        }\n        function emitSwitchStatement(node) {\n            var openParenPos = emitTokenWithComment(106 /* SwitchKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);\n            emitExpression(node.expression);\n            emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node);\n            writeSpace();\n            emit(node.caseBlock);\n        }\n        function emitLabeledStatement(node) {\n            emit(node.label);\n            emitTokenWithComment(58 /* ColonToken */, node.label.end, writePunctuation, node);\n            writeSpace();\n            emit(node.statement);\n        }\n        function emitThrowStatement(node) {\n            emitTokenWithComment(108 /* ThrowKeyword */, node.pos, writeKeyword, node);\n            emitExpressionWithLeadingSpace(node.expression);\n            writeTrailingSemicolon();\n        }\n        function emitTryStatement(node) {\n            emitTokenWithComment(110 /* TryKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            emit(node.tryBlock);\n            if (node.catchClause) {\n                writeLineOrSpace(node, node.tryBlock, node.catchClause);\n                emit(node.catchClause);\n            }\n            if (node.finallyBlock) {\n                writeLineOrSpace(node, node.catchClause || node.tryBlock, node.finallyBlock);\n                emitTokenWithComment(95 /* FinallyKeyword */, (node.catchClause || node.tryBlock).end, writeKeyword, node);\n                writeSpace();\n                emit(node.finallyBlock);\n            }\n        }\n        function emitDebuggerStatement(node) {\n            writeToken(86 /* DebuggerKeyword */, node.pos, writeKeyword);\n            writeTrailingSemicolon();\n        }\n        //\n        // Declarations\n        //\n        function emitVariableDeclaration(node) {\n            emit(node.name);\n            emit(node.exclamationToken);\n            emitTypeAnnotation(node.type);\n            emitInitializer(node.initializer, node.type ? node.type.end : node.name.end, node);\n        }\n        function emitVariableDeclarationList(node) {\n            writeKeyword(ts.isLet(node) ? \"let\" : ts.isVarConst(node) ? \"const\" : \"var\");\n            writeSpace();\n            emitList(node, node.declarations, 528 /* VariableDeclarationList */);\n        }\n        function emitFunctionDeclaration(node) {\n            emitFunctionDeclarationOrExpression(node);\n        }\n        function emitFunctionDeclarationOrExpression(node) {\n            emitDecorators(node, node.decorators);\n            emitModifiers(node, node.modifiers);\n            writeKeyword(\"function\");\n            emit(node.asteriskToken);\n            writeSpace();\n            emitIdentifierName(node.name);\n            emitSignatureAndBody(node, emitSignatureHead);\n        }\n        function emitBlockCallback(_hint, body) {\n            emitBlockFunctionBody(body);\n        }\n        function emitSignatureAndBody(node, emitSignatureHead) {\n            var body = node.body;\n            if (body) {\n                if (ts.isBlock(body)) {\n                    var indentedFlag = ts.getEmitFlags(node) & 65536 /* Indented */;\n                    if (indentedFlag) {\n                        increaseIndent();\n                    }\n                    pushNameGenerationScope(node);\n                    ts.forEach(node.parameters, generateNames);\n                    generateNames(node.body);\n                    emitSignatureHead(node);\n                    if (onEmitNode) {\n                        onEmitNode(4 /* Unspecified */, body, emitBlockCallback);\n                    }\n                    else {\n                        emitBlockFunctionBody(body);\n                    }\n                    popNameGenerationScope(node);\n                    if (indentedFlag) {\n                        decreaseIndent();\n                    }\n                }\n                else {\n                    emitSignatureHead(node);\n                    writeSpace();\n                    emitExpression(body);\n                }\n            }\n            else {\n                emitSignatureHead(node);\n                writeTrailingSemicolon();\n            }\n        }\n        function emitSignatureHead(node) {\n            emitTypeParameters(node, node.typeParameters);\n            emitParameters(node, node.parameters);\n            emitTypeAnnotation(node.type);\n        }\n        function shouldEmitBlockFunctionBodyOnSingleLine(body) {\n            // We must emit a function body as a single-line body in the following case:\n            // * The body has NodeEmitFlags.SingleLine specified.\n            // We must emit a function body as a multi-line body in the following cases:\n            // * The body is explicitly marked as multi-line.\n            // * A non-synthesized body's start and end position are on different lines.\n            // * Any statement in the body starts on a new line.\n            if (ts.getEmitFlags(body) & 1 /* SingleLine */) {\n                return true;\n            }\n            if (body.multiLine) {\n                return false;\n            }\n            if (!ts.nodeIsSynthesized(body) && !ts.rangeIsOnSingleLine(body, currentSourceFile)) {\n                return false;\n            }\n            if (getLeadingLineTerminatorCount(body, body.statements, 2 /* PreserveLines */)\n                || getClosingLineTerminatorCount(body, body.statements, 2 /* PreserveLines */)) {\n                return false;\n            }\n            var previousStatement;\n            for (var _a = 0, _b = body.statements; _a < _b.length; _a++) {\n                var statement = _b[_a];\n                if (getSeparatingLineTerminatorCount(previousStatement, statement, 2 /* PreserveLines */) > 0) {\n                    return false;\n                }\n                previousStatement = statement;\n            }\n            return true;\n        }\n        function emitBlockFunctionBody(body) {\n            writeSpace();\n            writePunctuation(\"{\");\n            increaseIndent();\n            var emitBlockFunctionBody = shouldEmitBlockFunctionBodyOnSingleLine(body)\n                ? emitBlockFunctionBodyOnSingleLine\n                : emitBlockFunctionBodyWorker;\n            if (emitBodyWithDetachedComments) {\n                emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody);\n            }\n            else {\n                emitBlockFunctionBody(body);\n            }\n            decreaseIndent();\n            writeToken(19 /* CloseBraceToken */, body.statements.end, writePunctuation, body);\n        }\n        function emitBlockFunctionBodyOnSingleLine(body) {\n            emitBlockFunctionBodyWorker(body, /*emitBlockFunctionBodyOnSingleLine*/ true);\n        }\n        function emitBlockFunctionBodyWorker(body, emitBlockFunctionBodyOnSingleLine) {\n            // Emit all the prologue directives (like \"use strict\").\n            var statementOffset = emitPrologueDirectives(body.statements);\n            var pos = writer.getTextPos();\n            emitHelpers(body);\n            if (statementOffset === 0 && pos === writer.getTextPos() && emitBlockFunctionBodyOnSingleLine) {\n                decreaseIndent();\n                emitList(body, body.statements, 768 /* SingleLineFunctionBodyStatements */);\n                increaseIndent();\n            }\n            else {\n                emitList(body, body.statements, 1 /* MultiLineFunctionBodyStatements */, statementOffset);\n            }\n        }\n        function emitClassDeclaration(node) {\n            emitClassDeclarationOrExpression(node);\n        }\n        function emitClassDeclarationOrExpression(node) {\n            ts.forEach(node.members, generateMemberNames);\n            emitDecorators(node, node.decorators);\n            emitModifiers(node, node.modifiers);\n            writeKeyword(\"class\");\n            if (node.name) {\n                writeSpace();\n                emitIdentifierName(node.name);\n            }\n            var indentedFlag = ts.getEmitFlags(node) & 65536 /* Indented */;\n            if (indentedFlag) {\n                increaseIndent();\n            }\n            emitTypeParameters(node, node.typeParameters);\n            emitList(node, node.heritageClauses, 0 /* ClassHeritageClauses */);\n            writeSpace();\n            writePunctuation(\"{\");\n            emitList(node, node.members, 129 /* ClassMembers */);\n            writePunctuation(\"}\");\n            if (indentedFlag) {\n                decreaseIndent();\n            }\n        }\n        function emitInterfaceDeclaration(node) {\n            emitDecorators(node, node.decorators);\n            emitModifiers(node, node.modifiers);\n            writeKeyword(\"interface\");\n            writeSpace();\n            emit(node.name);\n            emitTypeParameters(node, node.typeParameters);\n            emitList(node, node.heritageClauses, 512 /* HeritageClauses */);\n            writeSpace();\n            writePunctuation(\"{\");\n            emitList(node, node.members, 129 /* InterfaceMembers */);\n            writePunctuation(\"}\");\n        }\n        function emitTypeAliasDeclaration(node) {\n            emitDecorators(node, node.decorators);\n            emitModifiers(node, node.modifiers);\n            writeKeyword(\"type\");\n            writeSpace();\n            emit(node.name);\n            emitTypeParameters(node, node.typeParameters);\n            writeSpace();\n            writePunctuation(\"=\");\n            writeSpace();\n            emit(node.type);\n            writeTrailingSemicolon();\n        }\n        function emitEnumDeclaration(node) {\n            emitModifiers(node, node.modifiers);\n            writeKeyword(\"enum\");\n            writeSpace();\n            emit(node.name);\n            writeSpace();\n            writePunctuation(\"{\");\n            emitList(node, node.members, 145 /* EnumMembers */);\n            writePunctuation(\"}\");\n        }\n        function emitModuleDeclaration(node) {\n            emitModifiers(node, node.modifiers);\n            if (~node.flags & 1024 /* GlobalAugmentation */) {\n                writeKeyword(node.flags & 16 /* Namespace */ ? \"namespace\" : \"module\");\n                writeSpace();\n            }\n            emit(node.name);\n            var body = node.body;\n            if (!body)\n                return writeTrailingSemicolon();\n            while (body.kind === 256 /* ModuleDeclaration */) {\n                writePunctuation(\".\");\n                emit(body.name);\n                body = body.body;\n            }\n            writeSpace();\n            emit(body);\n        }\n        function emitModuleBlock(node) {\n            pushNameGenerationScope(node);\n            ts.forEach(node.statements, generateNames);\n            emitBlockStatements(node, /*forceSingleLine*/ isEmptyBlock(node));\n            popNameGenerationScope(node);\n        }\n        function emitCaseBlock(node) {\n            emitTokenWithComment(18 /* OpenBraceToken */, node.pos, writePunctuation, node);\n            emitList(node, node.clauses, 129 /* CaseBlockClauses */);\n            emitTokenWithComment(19 /* CloseBraceToken */, node.clauses.end, writePunctuation, node, /*indentLeading*/ true);\n        }\n        function emitImportEqualsDeclaration(node) {\n            emitModifiers(node, node.modifiers);\n            emitTokenWithComment(99 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node);\n            writeSpace();\n            if (node.isTypeOnly) {\n                emitTokenWithComment(149 /* TypeKeyword */, node.pos, writeKeyword, node);\n                writeSpace();\n            }\n            emit(node.name);\n            writeSpace();\n            emitTokenWithComment(62 /* EqualsToken */, node.name.end, writePunctuation, node);\n            writeSpace();\n            emitModuleReference(node.moduleReference);\n            writeTrailingSemicolon();\n        }\n        function emitModuleReference(node) {\n            if (node.kind === 78 /* Identifier */) {\n                emitExpression(node);\n            }\n            else {\n                emit(node);\n            }\n        }\n        function emitImportDeclaration(node) {\n            emitModifiers(node, node.modifiers);\n            emitTokenWithComment(99 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node);\n            writeSpace();\n            if (node.importClause) {\n                emit(node.importClause);\n                writeSpace();\n                emitTokenWithComment(153 /* FromKeyword */, node.importClause.end, writeKeyword, node);\n                writeSpace();\n            }\n            emitExpression(node.moduleSpecifier);\n            writeTrailingSemicolon();\n        }\n        function emitImportClause(node) {\n            if (node.isTypeOnly) {\n                emitTokenWithComment(149 /* TypeKeyword */, node.pos, writeKeyword, node);\n                writeSpace();\n            }\n            emit(node.name);\n            if (node.name && node.namedBindings) {\n                emitTokenWithComment(27 /* CommaToken */, node.name.end, writePunctuation, node);\n                writeSpace();\n            }\n            emit(node.namedBindings);\n        }\n        function emitNamespaceImport(node) {\n            var asPos = emitTokenWithComment(41 /* AsteriskToken */, node.pos, writePunctuation, node);\n            writeSpace();\n            emitTokenWithComment(126 /* AsKeyword */, asPos, writeKeyword, node);\n            writeSpace();\n            emit(node.name);\n        }\n        function emitNamedImports(node) {\n            emitNamedImportsOrExports(node);\n        }\n        function emitImportSpecifier(node) {\n            emitImportOrExportSpecifier(node);\n        }\n        function emitExportAssignment(node) {\n            var nextPos = emitTokenWithComment(92 /* ExportKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            if (node.isExportEquals) {\n                emitTokenWithComment(62 /* EqualsToken */, nextPos, writeOperator, node);\n            }\n            else {\n                emitTokenWithComment(87 /* DefaultKeyword */, nextPos, writeKeyword, node);\n            }\n            writeSpace();\n            emitExpression(node.expression);\n            writeTrailingSemicolon();\n        }\n        function emitExportDeclaration(node) {\n            var nextPos = emitTokenWithComment(92 /* ExportKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            if (node.isTypeOnly) {\n                nextPos = emitTokenWithComment(149 /* TypeKeyword */, nextPos, writeKeyword, node);\n                writeSpace();\n            }\n            if (node.exportClause) {\n                emit(node.exportClause);\n            }\n            else {\n                nextPos = emitTokenWithComment(41 /* AsteriskToken */, nextPos, writePunctuation, node);\n            }\n            if (node.moduleSpecifier) {\n                writeSpace();\n                var fromPos = node.exportClause ? node.exportClause.end : nextPos;\n                emitTokenWithComment(153 /* FromKeyword */, fromPos, writeKeyword, node);\n                writeSpace();\n                emitExpression(node.moduleSpecifier);\n            }\n            writeTrailingSemicolon();\n        }\n        function emitNamespaceExportDeclaration(node) {\n            var nextPos = emitTokenWithComment(92 /* ExportKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            nextPos = emitTokenWithComment(126 /* AsKeyword */, nextPos, writeKeyword, node);\n            writeSpace();\n            nextPos = emitTokenWithComment(140 /* NamespaceKeyword */, nextPos, writeKeyword, node);\n            writeSpace();\n            emit(node.name);\n            writeTrailingSemicolon();\n        }\n        function emitNamespaceExport(node) {\n            var asPos = emitTokenWithComment(41 /* AsteriskToken */, node.pos, writePunctuation, node);\n            writeSpace();\n            emitTokenWithComment(126 /* AsKeyword */, asPos, writeKeyword, node);\n            writeSpace();\n            emit(node.name);\n        }\n        function emitNamedExports(node) {\n            emitNamedImportsOrExports(node);\n        }\n        function emitExportSpecifier(node) {\n            emitImportOrExportSpecifier(node);\n        }\n        function emitNamedImportsOrExports(node) {\n            writePunctuation(\"{\");\n            emitList(node, node.elements, 525136 /* NamedImportsOrExportsElements */);\n            writePunctuation(\"}\");\n        }\n        function emitImportOrExportSpecifier(node) {\n            if (node.propertyName) {\n                emit(node.propertyName);\n                writeSpace();\n                emitTokenWithComment(126 /* AsKeyword */, node.propertyName.end, writeKeyword, node);\n                writeSpace();\n            }\n            emit(node.name);\n        }\n        //\n        // Module references\n        //\n        function emitExternalModuleReference(node) {\n            writeKeyword(\"require\");\n            writePunctuation(\"(\");\n            emitExpression(node.expression);\n            writePunctuation(\")\");\n        }\n        //\n        // JSX\n        //\n        function emitJsxElement(node) {\n            emit(node.openingElement);\n            emitList(node, node.children, 262144 /* JsxElementOrFragmentChildren */);\n            emit(node.closingElement);\n        }\n        function emitJsxSelfClosingElement(node) {\n            writePunctuation(\"<\");\n            emitJsxTagName(node.tagName);\n            emitTypeArguments(node, node.typeArguments);\n            writeSpace();\n            emit(node.attributes);\n            writePunctuation(\"/>\");\n        }\n        function emitJsxFragment(node) {\n            emit(node.openingFragment);\n            emitList(node, node.children, 262144 /* JsxElementOrFragmentChildren */);\n            emit(node.closingFragment);\n        }\n        function emitJsxOpeningElementOrFragment(node) {\n            writePunctuation(\"<\");\n            if (ts.isJsxOpeningElement(node)) {\n                var indented = writeLineSeparatorsAndIndentBefore(node.tagName, node);\n                emitJsxTagName(node.tagName);\n                emitTypeArguments(node, node.typeArguments);\n                if (node.attributes.properties && node.attributes.properties.length > 0) {\n                    writeSpace();\n                }\n                emit(node.attributes);\n                writeLineSeparatorsAfter(node.attributes, node);\n                decreaseIndentIf(indented);\n            }\n            writePunctuation(\">\");\n        }\n        function emitJsxText(node) {\n            writer.writeLiteral(node.text);\n        }\n        function emitJsxClosingElementOrFragment(node) {\n            writePunctuation(\"</\");\n            if (ts.isJsxClosingElement(node)) {\n                emitJsxTagName(node.tagName);\n            }\n            writePunctuation(\">\");\n        }\n        function emitJsxAttributes(node) {\n            emitList(node, node.properties, 262656 /* JsxElementAttributes */);\n        }\n        function emitJsxAttribute(node) {\n            emit(node.name);\n            emitNodeWithPrefix(\"=\", writePunctuation, node.initializer, emitJsxAttributeValue);\n        }\n        function emitJsxSpreadAttribute(node) {\n            writePunctuation(\"{...\");\n            emitExpression(node.expression);\n            writePunctuation(\"}\");\n        }\n        function hasTrailingCommentsAtPosition(pos) {\n            var result = false;\n            ts.forEachTrailingCommentRange((currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.text) || \"\", pos + 1, function () { return result = true; });\n            return result;\n        }\n        function hasLeadingCommentsAtPosition(pos) {\n            var result = false;\n            ts.forEachLeadingCommentRange((currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.text) || \"\", pos + 1, function () { return result = true; });\n            return result;\n        }\n        function hasCommentsAtPosition(pos) {\n            return hasTrailingCommentsAtPosition(pos) || hasLeadingCommentsAtPosition(pos);\n        }\n        function emitJsxExpression(node) {\n            var _a;\n            if (node.expression || (!commentsDisabled && !ts.nodeIsSynthesized(node) && hasCommentsAtPosition(node.pos))) { // preserve empty expressions if they contain comments!\n                var isMultiline = currentSourceFile && !ts.nodeIsSynthesized(node) && ts.getLineAndCharacterOfPosition(currentSourceFile, node.pos).line !== ts.getLineAndCharacterOfPosition(currentSourceFile, node.end).line;\n                if (isMultiline) {\n                    writer.increaseIndent();\n                }\n                var end = emitTokenWithComment(18 /* OpenBraceToken */, node.pos, writePunctuation, node);\n                emit(node.dotDotDotToken);\n                emitExpression(node.expression);\n                emitTokenWithComment(19 /* CloseBraceToken */, ((_a = node.expression) === null || _a === void 0 ? void 0 : _a.end) || end, writePunctuation, node);\n                if (isMultiline) {\n                    writer.decreaseIndent();\n                }\n            }\n        }\n        function emitJsxTagName(node) {\n            if (node.kind === 78 /* Identifier */) {\n                emitExpression(node);\n            }\n            else {\n                emit(node);\n            }\n        }\n        //\n        // Clauses\n        //\n        function emitCaseClause(node) {\n            emitTokenWithComment(81 /* CaseKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            emitExpression(node.expression);\n            emitCaseOrDefaultClauseRest(node, node.statements, node.expression.end);\n        }\n        function emitDefaultClause(node) {\n            var pos = emitTokenWithComment(87 /* DefaultKeyword */, node.pos, writeKeyword, node);\n            emitCaseOrDefaultClauseRest(node, node.statements, pos);\n        }\n        function emitCaseOrDefaultClauseRest(parentNode, statements, colonPos) {\n            var emitAsSingleStatement = statements.length === 1 &&\n                (\n                // treat synthesized nodes as located on the same line for emit purposes\n                ts.nodeIsSynthesized(parentNode) ||\n                    ts.nodeIsSynthesized(statements[0]) ||\n                    ts.rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile));\n            var format = 163969 /* CaseOrDefaultClauseStatements */;\n            if (emitAsSingleStatement) {\n                writeToken(58 /* ColonToken */, colonPos, writePunctuation, parentNode);\n                writeSpace();\n                format &= ~(1 /* MultiLine */ | 128 /* Indented */);\n            }\n            else {\n                emitTokenWithComment(58 /* ColonToken */, colonPos, writePunctuation, parentNode);\n            }\n            emitList(parentNode, statements, format);\n        }\n        function emitHeritageClause(node) {\n            writeSpace();\n            writeTokenText(node.token, writeKeyword);\n            writeSpace();\n            emitList(node, node.types, 528 /* HeritageClauseTypes */);\n        }\n        function emitCatchClause(node) {\n            var openParenPos = emitTokenWithComment(82 /* CatchKeyword */, node.pos, writeKeyword, node);\n            writeSpace();\n            if (node.variableDeclaration) {\n                emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node);\n                emit(node.variableDeclaration);\n                emitTokenWithComment(21 /* CloseParenToken */, node.variableDeclaration.end, writePunctuation, node);\n                writeSpace();\n            }\n            emit(node.block);\n        }\n        //\n        // Property assignments\n        //\n        function emitPropertyAssignment(node) {\n            emit(node.name);\n            writePunctuation(\":\");\n            writeSpace();\n            // This is to ensure that we emit comment in the following case:\n            //      For example:\n            //          obj = {\n            //              id: /*comment1*/ ()=>void\n            //          }\n            // \"comment1\" is not considered to be leading comment for node.initializer\n            // but rather a trailing comment on the previous node.\n            var initializer = node.initializer;\n            if ((ts.getEmitFlags(initializer) & 512 /* NoLeadingComments */) === 0) {\n                var commentRange = ts.getCommentRange(initializer);\n                emitTrailingCommentsOfPosition(commentRange.pos);\n            }\n            emitExpression(initializer);\n        }\n        function emitShorthandPropertyAssignment(node) {\n            emit(node.name);\n            if (node.objectAssignmentInitializer) {\n                writeSpace();\n                writePunctuation(\"=\");\n                writeSpace();\n                emitExpression(node.objectAssignmentInitializer);\n            }\n        }\n        function emitSpreadAssignment(node) {\n            if (node.expression) {\n                emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node);\n                emitExpression(node.expression);\n            }\n        }\n        //\n        // Enum\n        //\n        function emitEnumMember(node) {\n            emit(node.name);\n            emitInitializer(node.initializer, node.name.end, node);\n        }\n        //\n        // JSDoc\n        //\n        function emitJSDoc(node) {\n            write(\"/**\");\n            if (node.comment) {\n                var lines = node.comment.split(/\\r\\n?|\\n/g);\n                for (var _a = 0, lines_2 = lines; _a < lines_2.length; _a++) {\n                    var line = lines_2[_a];\n                    writeLine();\n                    writeSpace();\n                    writePunctuation(\"*\");\n                    writeSpace();\n                    write(line);\n                }\n            }\n            if (node.tags) {\n                if (node.tags.length === 1 && node.tags[0].kind === 329 /* JSDocTypeTag */ && !node.comment) {\n                    writeSpace();\n                    emit(node.tags[0]);\n                }\n                else {\n                    emitList(node, node.tags, 33 /* JSDocComment */);\n                }\n            }\n            writeSpace();\n            write(\"*/\");\n        }\n        function emitJSDocSimpleTypedTag(tag) {\n            emitJSDocTagName(tag.tagName);\n            emitJSDocTypeExpression(tag.typeExpression);\n            emitJSDocComment(tag.comment);\n        }\n        function emitJSDocSeeTag(tag) {\n            emitJSDocTagName(tag.tagName);\n            emit(tag.name);\n            emitJSDocComment(tag.comment);\n        }\n        function emitJSDocNameReference(node) {\n            writeSpace();\n            writePunctuation(\"{\");\n            emit(node.name);\n            writePunctuation(\"}\");\n        }\n        function emitJSDocHeritageTag(tag) {\n            emitJSDocTagName(tag.tagName);\n            writeSpace();\n            writePunctuation(\"{\");\n            emit(tag.class);\n            writePunctuation(\"}\");\n            emitJSDocComment(tag.comment);\n        }\n        function emitJSDocTemplateTag(tag) {\n            emitJSDocTagName(tag.tagName);\n            emitJSDocTypeExpression(tag.constraint);\n            writeSpace();\n            emitList(tag, tag.typeParameters, 528 /* CommaListElements */);\n            emitJSDocComment(tag.comment);\n        }\n        function emitJSDocTypedefTag(tag) {\n            emitJSDocTagName(tag.tagName);\n            if (tag.typeExpression) {\n                if (tag.typeExpression.kind === 301 /* JSDocTypeExpression */) {\n                    emitJSDocTypeExpression(tag.typeExpression);\n                }\n                else {\n                    writeSpace();\n                    writePunctuation(\"{\");\n                    write(\"Object\");\n                    if (tag.typeExpression.isArrayType) {\n                        writePunctuation(\"[\");\n                        writePunctuation(\"]\");\n                    }\n                    writePunctuation(\"}\");\n                }\n            }\n            if (tag.fullName) {\n                writeSpace();\n                emit(tag.fullName);\n            }\n            emitJSDocComment(tag.comment);\n            if (tag.typeExpression && tag.typeExpression.kind === 312 /* JSDocTypeLiteral */) {\n                emitJSDocTypeLiteral(tag.typeExpression);\n            }\n        }\n        function emitJSDocCallbackTag(tag) {\n            emitJSDocTagName(tag.tagName);\n            if (tag.name) {\n                writeSpace();\n                emit(tag.name);\n            }\n            emitJSDocComment(tag.comment);\n            emitJSDocSignature(tag.typeExpression);\n        }\n        function emitJSDocSimpleTag(tag) {\n            emitJSDocTagName(tag.tagName);\n            emitJSDocComment(tag.comment);\n        }\n        function emitJSDocTypeLiteral(lit) {\n            emitList(lit, ts.factory.createNodeArray(lit.jsDocPropertyTags), 33 /* JSDocComment */);\n        }\n        function emitJSDocSignature(sig) {\n            if (sig.typeParameters) {\n                emitList(sig, ts.factory.createNodeArray(sig.typeParameters), 33 /* JSDocComment */);\n            }\n            if (sig.parameters) {\n                emitList(sig, ts.factory.createNodeArray(sig.parameters), 33 /* JSDocComment */);\n            }\n            if (sig.type) {\n                writeLine();\n                writeSpace();\n                writePunctuation(\"*\");\n                writeSpace();\n                emit(sig.type);\n            }\n        }\n        function emitJSDocPropertyLikeTag(param) {\n            emitJSDocTagName(param.tagName);\n            emitJSDocTypeExpression(param.typeExpression);\n            writeSpace();\n            if (param.isBracketed) {\n                writePunctuation(\"[\");\n            }\n            emit(param.name);\n            if (param.isBracketed) {\n                writePunctuation(\"]\");\n            }\n            emitJSDocComment(param.comment);\n        }\n        function emitJSDocTagName(tagName) {\n            writePunctuation(\"@\");\n            emit(tagName);\n        }\n        function emitJSDocComment(comment) {\n            if (comment) {\n                writeSpace();\n                write(comment);\n            }\n        }\n        function emitJSDocTypeExpression(typeExpression) {\n            if (typeExpression) {\n                writeSpace();\n                writePunctuation(\"{\");\n                emit(typeExpression.type);\n                writePunctuation(\"}\");\n            }\n        }\n        //\n        // Top-level nodes\n        //\n        function emitSourceFile(node) {\n            writeLine();\n            var statements = node.statements;\n            if (emitBodyWithDetachedComments) {\n                // Emit detached comment if there are no prologue directives or if the first node is synthesized.\n                // The synthesized node will have no leading comment so some comments may be missed.\n                var shouldEmitDetachedComment = statements.length === 0 ||\n                    !ts.isPrologueDirective(statements[0]) ||\n                    ts.nodeIsSynthesized(statements[0]);\n                if (shouldEmitDetachedComment) {\n                    emitBodyWithDetachedComments(node, statements, emitSourceFileWorker);\n                    return;\n                }\n            }\n            emitSourceFileWorker(node);\n        }\n        function emitSyntheticTripleSlashReferencesIfNeeded(node) {\n            emitTripleSlashDirectives(!!node.hasNoDefaultLib, node.syntheticFileReferences || [], node.syntheticTypeReferences || [], node.syntheticLibReferences || []);\n            for (var _a = 0, _b = node.prepends; _a < _b.length; _a++) {\n                var prepend = _b[_a];\n                if (ts.isUnparsedSource(prepend) && prepend.syntheticReferences) {\n                    for (var _c = 0, _d = prepend.syntheticReferences; _c < _d.length; _c++) {\n                        var ref = _d[_c];\n                        emit(ref);\n                        writeLine();\n                    }\n                }\n            }\n        }\n        function emitTripleSlashDirectivesIfNeeded(node) {\n            if (node.isDeclarationFile)\n                emitTripleSlashDirectives(node.hasNoDefaultLib, node.referencedFiles, node.typeReferenceDirectives, node.libReferenceDirectives);\n        }\n        function emitTripleSlashDirectives(hasNoDefaultLib, files, types, libs) {\n            if (hasNoDefaultLib) {\n                var pos = writer.getTextPos();\n                writeComment(\"/// <reference no-default-lib=\\\"true\\\"/>\");\n                if (bundleFileInfo)\n                    bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: \"no-default-lib\" /* NoDefaultLib */ });\n                writeLine();\n            }\n            if (currentSourceFile && currentSourceFile.moduleName) {\n                writeComment(\"/// <amd-module name=\\\"\" + currentSourceFile.moduleName + \"\\\" />\");\n                writeLine();\n            }\n            if (currentSourceFile && currentSourceFile.amdDependencies) {\n                for (var _a = 0, _b = currentSourceFile.amdDependencies; _a < _b.length; _a++) {\n                    var dep = _b[_a];\n                    if (dep.name) {\n                        writeComment(\"/// <amd-dependency name=\\\"\" + dep.name + \"\\\" path=\\\"\" + dep.path + \"\\\" />\");\n                    }\n                    else {\n                        writeComment(\"/// <amd-dependency path=\\\"\" + dep.path + \"\\\" />\");\n                    }\n                    writeLine();\n                }\n            }\n            for (var _c = 0, files_1 = files; _c < files_1.length; _c++) {\n                var directive = files_1[_c];\n                var pos = writer.getTextPos();\n                writeComment(\"/// <reference path=\\\"\" + directive.fileName + \"\\\" />\");\n                if (bundleFileInfo)\n                    bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: \"reference\" /* Reference */, data: directive.fileName });\n                writeLine();\n            }\n            for (var _d = 0, types_25 = types; _d < types_25.length; _d++) {\n                var directive = types_25[_d];\n                var pos = writer.getTextPos();\n                writeComment(\"/// <reference types=\\\"\" + directive.fileName + \"\\\" />\");\n                if (bundleFileInfo)\n                    bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: \"type\" /* Type */, data: directive.fileName });\n                writeLine();\n            }\n            for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {\n                var directive = libs_1[_e];\n                var pos = writer.getTextPos();\n                writeComment(\"/// <reference lib=\\\"\" + directive.fileName + \"\\\" />\");\n                if (bundleFileInfo)\n                    bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: \"lib\" /* Lib */, data: directive.fileName });\n                writeLine();\n            }\n        }\n        function emitSourceFileWorker(node) {\n            var statements = node.statements;\n            pushNameGenerationScope(node);\n            ts.forEach(node.statements, generateNames);\n            emitHelpers(node);\n            var index = ts.findIndex(statements, function (statement) { return !ts.isPrologueDirective(statement); });\n            emitTripleSlashDirectivesIfNeeded(node);\n            emitList(node, statements, 1 /* MultiLine */, index === -1 ? statements.length : index);\n            popNameGenerationScope(node);\n        }\n        // Transformation nodes\n        function emitPartiallyEmittedExpression(node) {\n            emitExpression(node.expression);\n        }\n        function emitCommaList(node) {\n            emitExpressionList(node, node.elements, 528 /* CommaListElements */);\n        }\n        /**\n         * Emits any prologue directives at the start of a Statement list, returning the\n         * number of prologue directives written to the output.\n         */\n        function emitPrologueDirectives(statements, sourceFile, seenPrologueDirectives, recordBundleFileSection) {\n            var needsToSetSourceFile = !!sourceFile;\n            for (var i = 0; i < statements.length; i++) {\n                var statement = statements[i];\n                if (ts.isPrologueDirective(statement)) {\n                    var shouldEmitPrologueDirective = seenPrologueDirectives ? !seenPrologueDirectives.has(statement.expression.text) : true;\n                    if (shouldEmitPrologueDirective) {\n                        if (needsToSetSourceFile) {\n                            needsToSetSourceFile = false;\n                            setSourceFile(sourceFile);\n                        }\n                        writeLine();\n                        var pos = writer.getTextPos();\n                        emit(statement);\n                        if (recordBundleFileSection && bundleFileInfo)\n                            bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: \"prologue\" /* Prologue */, data: statement.expression.text });\n                        if (seenPrologueDirectives) {\n                            seenPrologueDirectives.add(statement.expression.text);\n                        }\n                    }\n                }\n                else {\n                    // return index of the first non prologue directive\n                    return i;\n                }\n            }\n            return statements.length;\n        }\n        function emitUnparsedPrologues(prologues, seenPrologueDirectives) {\n            for (var _a = 0, prologues_1 = prologues; _a < prologues_1.length; _a++) {\n                var prologue = prologues_1[_a];\n                if (!seenPrologueDirectives.has(prologue.data)) {\n                    writeLine();\n                    var pos = writer.getTextPos();\n                    emit(prologue);\n                    if (bundleFileInfo)\n                        bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: \"prologue\" /* Prologue */, data: prologue.data });\n                    if (seenPrologueDirectives) {\n                        seenPrologueDirectives.add(prologue.data);\n                    }\n                }\n            }\n        }\n        function emitPrologueDirectivesIfNeeded(sourceFileOrBundle) {\n            if (ts.isSourceFile(sourceFileOrBundle)) {\n                emitPrologueDirectives(sourceFileOrBundle.statements, sourceFileOrBundle);\n            }\n            else {\n                var seenPrologueDirectives = new ts.Set();\n                for (var _a = 0, _b = sourceFileOrBundle.prepends; _a < _b.length; _a++) {\n                    var prepend = _b[_a];\n                    emitUnparsedPrologues(prepend.prologues, seenPrologueDirectives);\n                }\n                for (var _c = 0, _d = sourceFileOrBundle.sourceFiles; _c < _d.length; _c++) {\n                    var sourceFile = _d[_c];\n                    emitPrologueDirectives(sourceFile.statements, sourceFile, seenPrologueDirectives, /*recordBundleFileSection*/ true);\n                }\n                setSourceFile(undefined);\n            }\n        }\n        function getPrologueDirectivesFromBundledSourceFiles(bundle) {\n            var seenPrologueDirectives = new ts.Set();\n            var prologues;\n            for (var index = 0; index < bundle.sourceFiles.length; index++) {\n                var sourceFile = bundle.sourceFiles[index];\n                var directives = void 0;\n                var end = 0;\n                for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) {\n                    var statement = _b[_a];\n                    if (!ts.isPrologueDirective(statement))\n                        break;\n                    if (seenPrologueDirectives.has(statement.expression.text))\n                        continue;\n                    seenPrologueDirectives.add(statement.expression.text);\n                    (directives || (directives = [])).push({\n                        pos: statement.pos,\n                        end: statement.end,\n                        expression: {\n                            pos: statement.expression.pos,\n                            end: statement.expression.end,\n                            text: statement.expression.text\n                        }\n                    });\n                    end = end < statement.end ? statement.end : end;\n                }\n                if (directives)\n                    (prologues || (prologues = [])).push({ file: index, text: sourceFile.text.substring(0, end), directives: directives });\n            }\n            return prologues;\n        }\n        function emitShebangIfNeeded(sourceFileOrBundle) {\n            if (ts.isSourceFile(sourceFileOrBundle) || ts.isUnparsedSource(sourceFileOrBundle)) {\n                var shebang = ts.getShebang(sourceFileOrBundle.text);\n                if (shebang) {\n                    writeComment(shebang);\n                    writeLine();\n                    return true;\n                }\n            }\n            else {\n                for (var _a = 0, _b = sourceFileOrBundle.prepends; _a < _b.length; _a++) {\n                    var prepend = _b[_a];\n                    ts.Debug.assertNode(prepend, ts.isUnparsedSource);\n                    if (emitShebangIfNeeded(prepend)) {\n                        return true;\n                    }\n                }\n                for (var _c = 0, _d = sourceFileOrBundle.sourceFiles; _c < _d.length; _c++) {\n                    var sourceFile = _d[_c];\n                    // Emit only the first encountered shebang\n                    if (emitShebangIfNeeded(sourceFile)) {\n                        return true;\n                    }\n                }\n            }\n        }\n        //\n        // Helpers\n        //\n        function emitNodeWithWriter(node, writer) {\n            if (!node)\n                return;\n            var savedWrite = write;\n            write = writer;\n            emit(node);\n            write = savedWrite;\n        }\n        function emitModifiers(node, modifiers) {\n            if (modifiers && modifiers.length) {\n                emitList(node, modifiers, 262656 /* Modifiers */);\n                writeSpace();\n            }\n        }\n        function emitTypeAnnotation(node) {\n            if (node) {\n                writePunctuation(\":\");\n                writeSpace();\n                emit(node);\n            }\n        }\n        function emitInitializer(node, equalCommentStartPos, container) {\n            if (node) {\n                writeSpace();\n                emitTokenWithComment(62 /* EqualsToken */, equalCommentStartPos, writeOperator, container);\n                writeSpace();\n                emitExpression(node);\n            }\n        }\n        function emitNodeWithPrefix(prefix, prefixWriter, node, emit) {\n            if (node) {\n                prefixWriter(prefix);\n                emit(node);\n            }\n        }\n        function emitWithLeadingSpace(node) {\n            if (node) {\n                writeSpace();\n                emit(node);\n            }\n        }\n        function emitExpressionWithLeadingSpace(node) {\n            if (node) {\n                writeSpace();\n                emitExpression(node);\n            }\n        }\n        function emitWithTrailingSpace(node) {\n            if (node) {\n                emit(node);\n                writeSpace();\n            }\n        }\n        function emitEmbeddedStatement(parent, node) {\n            if (ts.isBlock(node) || ts.getEmitFlags(parent) & 1 /* SingleLine */) {\n                writeSpace();\n                emit(node);\n            }\n            else {\n                writeLine();\n                increaseIndent();\n                if (ts.isEmptyStatement(node)) {\n                    pipelineEmit(5 /* EmbeddedStatement */, node);\n                }\n                else {\n                    emit(node);\n                }\n                decreaseIndent();\n            }\n        }\n        function emitDecorators(parentNode, decorators) {\n            emitList(parentNode, decorators, 2146305 /* Decorators */);\n        }\n        function emitTypeArguments(parentNode, typeArguments) {\n            emitList(parentNode, typeArguments, 53776 /* TypeArguments */);\n        }\n        function emitTypeParameters(parentNode, typeParameters) {\n            if (ts.isFunctionLike(parentNode) && parentNode.typeArguments) { // Quick info uses type arguments in place of type parameters on instantiated signatures\n                return emitTypeArguments(parentNode, parentNode.typeArguments);\n            }\n            emitList(parentNode, typeParameters, 53776 /* TypeParameters */);\n        }\n        function emitParameters(parentNode, parameters) {\n            emitList(parentNode, parameters, 2576 /* Parameters */);\n        }\n        function canEmitSimpleArrowHead(parentNode, parameters) {\n            var parameter = ts.singleOrUndefined(parameters);\n            return parameter\n                && parameter.pos === parentNode.pos // may not have parsed tokens between parent and parameter\n                && ts.isArrowFunction(parentNode) // only arrow functions may have simple arrow head\n                && !parentNode.type // arrow function may not have return type annotation\n                && !ts.some(parentNode.decorators) // parent may not have decorators\n                && !ts.some(parentNode.modifiers) // parent may not have modifiers\n                && !ts.some(parentNode.typeParameters) // parent may not have type parameters\n                && !ts.some(parameter.decorators) // parameter may not have decorators\n                && !ts.some(parameter.modifiers) // parameter may not have modifiers\n                && !parameter.dotDotDotToken // parameter may not be rest\n                && !parameter.questionToken // parameter may not be optional\n                && !parameter.type // parameter may not have a type annotation\n                && !parameter.initializer // parameter may not have an initializer\n                && ts.isIdentifier(parameter.name); // parameter name must be identifier\n        }\n        function emitParametersForArrow(parentNode, parameters) {\n            if (canEmitSimpleArrowHead(parentNode, parameters)) {\n                emitList(parentNode, parameters, 2576 /* Parameters */ & ~2048 /* Parenthesis */);\n            }\n            else {\n                emitParameters(parentNode, parameters);\n            }\n        }\n        function emitParametersForIndexSignature(parentNode, parameters) {\n            emitList(parentNode, parameters, 8848 /* IndexSignatureParameters */);\n        }\n        function emitList(parentNode, children, format, start, count) {\n            emitNodeList(emit, parentNode, children, format, start, count);\n        }\n        function emitExpressionList(parentNode, children, format, start, count) {\n            emitNodeList(emitExpression, parentNode, children, format, start, count); // TODO: GH#18217\n        }\n        function writeDelimiter(format) {\n            switch (format & 60 /* DelimitersMask */) {\n                case 0 /* None */:\n                    break;\n                case 16 /* CommaDelimited */:\n                    writePunctuation(\",\");\n                    break;\n                case 4 /* BarDelimited */:\n                    writeSpace();\n                    writePunctuation(\"|\");\n                    break;\n                case 32 /* AsteriskDelimited */:\n                    writeSpace();\n                    writePunctuation(\"*\");\n                    writeSpace();\n                    break;\n                case 8 /* AmpersandDelimited */:\n                    writeSpace();\n                    writePunctuation(\"&\");\n                    break;\n            }\n        }\n        function emitNodeList(emit, parentNode, children, format, start, count) {\n            if (start === void 0) { start = 0; }\n            if (count === void 0) { count = children ? children.length - start : 0; }\n            var isUndefined = children === undefined;\n            if (isUndefined && format & 16384 /* OptionalIfUndefined */) {\n                return;\n            }\n            var isEmpty = children === undefined || start >= children.length || count === 0;\n            if (isEmpty && format & 32768 /* OptionalIfEmpty */) {\n                if (onBeforeEmitNodeArray) {\n                    onBeforeEmitNodeArray(children);\n                }\n                if (onAfterEmitNodeArray) {\n                    onAfterEmitNodeArray(children);\n                }\n                return;\n            }\n            if (format & 15360 /* BracketsMask */) {\n                writePunctuation(getOpeningBracket(format));\n                if (isEmpty && !isUndefined) {\n                    // TODO: GH#18217\n                    emitTrailingCommentsOfPosition(children.pos, /*prefixSpace*/ true); // Emit comments within empty bracketed lists\n                }\n            }\n            if (onBeforeEmitNodeArray) {\n                onBeforeEmitNodeArray(children);\n            }\n            if (isEmpty) {\n                // Write a line terminator if the parent node was multi-line\n                if (format & 1 /* MultiLine */ && !(preserveSourceNewlines && ts.rangeIsOnSingleLine(parentNode, currentSourceFile))) {\n                    writeLine();\n                }\n                else if (format & 256 /* SpaceBetweenBraces */ && !(format & 524288 /* NoSpaceIfEmpty */)) {\n                    writeSpace();\n                }\n            }\n            else {\n                // Write the opening line terminator or leading whitespace.\n                var mayEmitInterveningComments = (format & 262144 /* NoInterveningComments */) === 0;\n                var shouldEmitInterveningComments = mayEmitInterveningComments;\n                var leadingLineTerminatorCount = getLeadingLineTerminatorCount(parentNode, children, format); // TODO: GH#18217\n                if (leadingLineTerminatorCount) {\n                    writeLine(leadingLineTerminatorCount);\n                    shouldEmitInterveningComments = false;\n                }\n                else if (format & 256 /* SpaceBetweenBraces */) {\n                    writeSpace();\n                }\n                // Increase the indent, if requested.\n                if (format & 128 /* Indented */) {\n                    increaseIndent();\n                }\n                // Emit each child.\n                var previousSibling = void 0;\n                var previousSourceFileTextKind = void 0;\n                var shouldDecreaseIndentAfterEmit = false;\n                for (var i = 0; i < count; i++) {\n                    var child = children[start + i];\n                    // Write the delimiter if this is not the first node.\n                    if (format & 32 /* AsteriskDelimited */) {\n                        // always write JSDoc in the format \"\\n *\"\n                        writeLine();\n                        writeDelimiter(format);\n                    }\n                    else if (previousSibling) {\n                        // i.e\n                        //      function commentedParameters(\n                        //          /* Parameter a */\n                        //          a\n                        //          /* End of parameter a */ -> this comment isn't considered to be trailing comment of parameter \"a\" due to newline\n                        //          ,\n                        if (format & 60 /* DelimitersMask */ && previousSibling.end !== parentNode.end) {\n                            emitLeadingCommentsOfPosition(previousSibling.end);\n                        }\n                        writeDelimiter(format);\n                        recordBundleFileInternalSectionEnd(previousSourceFileTextKind);\n                        // Write either a line terminator or whitespace to separate the elements.\n                        var separatingLineTerminatorCount = getSeparatingLineTerminatorCount(previousSibling, child, format);\n                        if (separatingLineTerminatorCount > 0) {\n                            // If a synthesized node in a single-line list starts on a new\n                            // line, we should increase the indent.\n                            if ((format & (3 /* LinesMask */ | 128 /* Indented */)) === 0 /* SingleLine */) {\n                                increaseIndent();\n                                shouldDecreaseIndentAfterEmit = true;\n                            }\n                            writeLine(separatingLineTerminatorCount);\n                            shouldEmitInterveningComments = false;\n                        }\n                        else if (previousSibling && format & 512 /* SpaceBetweenSiblings */) {\n                            writeSpace();\n                        }\n                    }\n                    // Emit this child.\n                    previousSourceFileTextKind = recordBundleFileInternalSectionStart(child);\n                    if (shouldEmitInterveningComments) {\n                        if (emitTrailingCommentsOfPosition) {\n                            var commentRange = ts.getCommentRange(child);\n                            emitTrailingCommentsOfPosition(commentRange.pos);\n                        }\n                    }\n                    else {\n                        shouldEmitInterveningComments = mayEmitInterveningComments;\n                    }\n                    nextListElementPos = child.pos;\n                    emit(child);\n                    if (shouldDecreaseIndentAfterEmit) {\n                        decreaseIndent();\n                        shouldDecreaseIndentAfterEmit = false;\n                    }\n                    previousSibling = child;\n                }\n                // Write a trailing comma, if requested.\n                var emitFlags = previousSibling ? ts.getEmitFlags(previousSibling) : 0;\n                var skipTrailingComments = commentsDisabled || !!(emitFlags & 1024 /* NoTrailingComments */);\n                var hasTrailingComma = (children === null || children === void 0 ? void 0 : children.hasTrailingComma) && (format & 64 /* AllowTrailingComma */) && (format & 16 /* CommaDelimited */);\n                if (hasTrailingComma) {\n                    if (previousSibling && !skipTrailingComments) {\n                        emitTokenWithComment(27 /* CommaToken */, previousSibling.end, writePunctuation, previousSibling);\n                    }\n                    else {\n                        writePunctuation(\",\");\n                    }\n                }\n                // Emit any trailing comment of the last element in the list\n                // i.e\n                //       var array = [...\n                //          2\n                //          /* end of element 2 */\n                //       ];\n                if (previousSibling && parentNode.end !== previousSibling.end && (format & 60 /* DelimitersMask */) && !skipTrailingComments) {\n                    emitLeadingCommentsOfPosition(hasTrailingComma && (children === null || children === void 0 ? void 0 : children.end) ? children.end : previousSibling.end);\n                }\n                // Decrease the indent, if requested.\n                if (format & 128 /* Indented */) {\n                    decreaseIndent();\n                }\n                recordBundleFileInternalSectionEnd(previousSourceFileTextKind);\n                // Write the closing line terminator or closing whitespace.\n                var closingLineTerminatorCount = getClosingLineTerminatorCount(parentNode, children, format);\n                if (closingLineTerminatorCount) {\n                    writeLine(closingLineTerminatorCount);\n                }\n                else if (format & (2097152 /* SpaceAfterList */ | 256 /* SpaceBetweenBraces */)) {\n                    writeSpace();\n                }\n            }\n            if (onAfterEmitNodeArray) {\n                onAfterEmitNodeArray(children);\n            }\n            if (format & 15360 /* BracketsMask */) {\n                if (isEmpty && !isUndefined) {\n                    // TODO: GH#18217\n                    emitLeadingCommentsOfPosition(children.end); // Emit leading comments within empty lists\n                }\n                writePunctuation(getClosingBracket(format));\n            }\n        }\n        // Writers\n        function writeLiteral(s) {\n            writer.writeLiteral(s);\n        }\n        function writeStringLiteral(s) {\n            writer.writeStringLiteral(s);\n        }\n        function writeBase(s) {\n            writer.write(s);\n        }\n        function writeSymbol(s, sym) {\n            writer.writeSymbol(s, sym);\n        }\n        function writePunctuation(s) {\n            writer.writePunctuation(s);\n        }\n        function writeTrailingSemicolon() {\n            writer.writeTrailingSemicolon(\";\");\n        }\n        function writeKeyword(s) {\n            writer.writeKeyword(s);\n        }\n        function writeOperator(s) {\n            writer.writeOperator(s);\n        }\n        function writeParameter(s) {\n            writer.writeParameter(s);\n        }\n        function writeComment(s) {\n            writer.writeComment(s);\n        }\n        function writeSpace() {\n            writer.writeSpace(\" \");\n        }\n        function writeProperty(s) {\n            writer.writeProperty(s);\n        }\n        function writeLine(count) {\n            if (count === void 0) { count = 1; }\n            for (var i = 0; i < count; i++) {\n                writer.writeLine(i > 0);\n            }\n        }\n        function increaseIndent() {\n            writer.increaseIndent();\n        }\n        function decreaseIndent() {\n            writer.decreaseIndent();\n        }\n        function writeToken(token, pos, writer, contextNode) {\n            return !sourceMapsDisabled\n                ? emitTokenWithSourceMap(contextNode, token, writer, pos, writeTokenText)\n                : writeTokenText(token, writer, pos);\n        }\n        function writeTokenNode(node, writer) {\n            if (onBeforeEmitToken) {\n                onBeforeEmitToken(node);\n            }\n            writer(ts.tokenToString(node.kind));\n            if (onAfterEmitToken) {\n                onAfterEmitToken(node);\n            }\n        }\n        function writeTokenText(token, writer, pos) {\n            var tokenString = ts.tokenToString(token);\n            writer(tokenString);\n            return pos < 0 ? pos : pos + tokenString.length;\n        }\n        function writeLineOrSpace(parentNode, prevChildNode, nextChildNode) {\n            if (ts.getEmitFlags(parentNode) & 1 /* SingleLine */) {\n                writeSpace();\n            }\n            else if (preserveSourceNewlines) {\n                var lines = getLinesBetweenNodes(parentNode, prevChildNode, nextChildNode);\n                if (lines) {\n                    writeLine(lines);\n                }\n                else {\n                    writeSpace();\n                }\n            }\n            else {\n                writeLine();\n            }\n        }\n        function writeLines(text) {\n            var lines = text.split(/\\r\\n?|\\n/g);\n            var indentation = ts.guessIndentation(lines);\n            for (var _a = 0, lines_3 = lines; _a < lines_3.length; _a++) {\n                var lineText = lines_3[_a];\n                var line = indentation ? lineText.slice(indentation) : lineText;\n                if (line.length) {\n                    writeLine();\n                    write(line);\n                }\n            }\n        }\n        function writeLinesAndIndent(lineCount, writeSpaceIfNotIndenting) {\n            if (lineCount) {\n                increaseIndent();\n                writeLine(lineCount);\n            }\n            else if (writeSpaceIfNotIndenting) {\n                writeSpace();\n            }\n        }\n        // Helper function to decrease the indent if we previously indented.  Allows multiple\n        // previous indent values to be considered at a time.  This also allows caller to just\n        // call this once, passing in all their appropriate indent values, instead of needing\n        // to call this helper function multiple times.\n        function decreaseIndentIf(value1, value2) {\n            if (value1) {\n                decreaseIndent();\n            }\n            if (value2) {\n                decreaseIndent();\n            }\n        }\n        function getLeadingLineTerminatorCount(parentNode, children, format) {\n            if (format & 2 /* PreserveLines */ || preserveSourceNewlines) {\n                if (format & 65536 /* PreferNewLine */) {\n                    return 1;\n                }\n                var firstChild_1 = children[0];\n                if (firstChild_1 === undefined) {\n                    return ts.rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1;\n                }\n                if (firstChild_1.pos === nextListElementPos) {\n                    // If this child starts at the beginning of a list item in a parent list, its leading\n                    // line terminators have already been written as the separating line terminators of the\n                    // parent list. Example:\n                    //\n                    // class Foo {\n                    //   constructor() {}\n                    //   public foo() {}\n                    // }\n                    //\n                    // The outer list is the list of class members, with one line terminator between the\n                    // constructor and the method. The constructor is written, the separating line terminator\n                    // is written, and then we start emitting the method. Its modifiers ([public]) constitute an inner\n                    // list, so we look for its leading line terminators. If we didn't know that we had already\n                    // written a newline as part of the parent list, it would appear that we need to write a\n                    // leading newline to start the modifiers.\n                    return 0;\n                }\n                if (firstChild_1.kind === 11 /* JsxText */) {\n                    // JsxText will be written with its leading whitespace, so don't add more manually.\n                    return 0;\n                }\n                if (!ts.positionIsSynthesized(parentNode.pos) &&\n                    !ts.nodeIsSynthesized(firstChild_1) &&\n                    (!firstChild_1.parent || ts.getOriginalNode(firstChild_1.parent) === ts.getOriginalNode(parentNode))) {\n                    if (preserveSourceNewlines) {\n                        return getEffectiveLines(function (includeComments) { return ts.getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter(firstChild_1.pos, parentNode.pos, currentSourceFile, includeComments); });\n                    }\n                    return ts.rangeStartPositionsAreOnSameLine(parentNode, firstChild_1, currentSourceFile) ? 0 : 1;\n                }\n                if (synthesizedNodeStartsOnNewLine(firstChild_1, format)) {\n                    return 1;\n                }\n            }\n            return format & 1 /* MultiLine */ ? 1 : 0;\n        }\n        function getSeparatingLineTerminatorCount(previousNode, nextNode, format) {\n            if (format & 2 /* PreserveLines */ || preserveSourceNewlines) {\n                if (previousNode === undefined || nextNode === undefined) {\n                    return 0;\n                }\n                if (nextNode.kind === 11 /* JsxText */) {\n                    // JsxText will be written with its leading whitespace, so don't add more manually.\n                    return 0;\n                }\n                else if (!ts.nodeIsSynthesized(previousNode) && !ts.nodeIsSynthesized(nextNode) && previousNode.parent === nextNode.parent) {\n                    if (preserveSourceNewlines) {\n                        return getEffectiveLines(function (includeComments) { return ts.getLinesBetweenRangeEndAndRangeStart(previousNode, nextNode, currentSourceFile, includeComments); });\n                    }\n                    return ts.rangeEndIsOnSameLineAsRangeStart(previousNode, nextNode, currentSourceFile) ? 0 : 1;\n                }\n                else if (synthesizedNodeStartsOnNewLine(previousNode, format) || synthesizedNodeStartsOnNewLine(nextNode, format)) {\n                    return 1;\n                }\n            }\n            else if (ts.getStartsOnNewLine(nextNode)) {\n                return 1;\n            }\n            return format & 1 /* MultiLine */ ? 1 : 0;\n        }\n        function getClosingLineTerminatorCount(parentNode, children, format) {\n            if (format & 2 /* PreserveLines */ || preserveSourceNewlines) {\n                if (format & 65536 /* PreferNewLine */) {\n                    return 1;\n                }\n                var lastChild = ts.lastOrUndefined(children);\n                if (lastChild === undefined) {\n                    return ts.rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1;\n                }\n                if (!ts.positionIsSynthesized(parentNode.pos) && !ts.nodeIsSynthesized(lastChild) && (!lastChild.parent || lastChild.parent === parentNode)) {\n                    if (preserveSourceNewlines) {\n                        var end_1 = ts.isNodeArray(children) && !ts.positionIsSynthesized(children.end) ? children.end : lastChild.end;\n                        return getEffectiveLines(function (includeComments) { return ts.getLinesBetweenPositionAndNextNonWhitespaceCharacter(end_1, parentNode.end, currentSourceFile, includeComments); });\n                    }\n                    return ts.rangeEndPositionsAreOnSameLine(parentNode, lastChild, currentSourceFile) ? 0 : 1;\n                }\n                if (synthesizedNodeStartsOnNewLine(lastChild, format)) {\n                    return 1;\n                }\n            }\n            if (format & 1 /* MultiLine */ && !(format & 131072 /* NoTrailingNewLine */)) {\n                return 1;\n            }\n            return 0;\n        }\n        function getEffectiveLines(getLineDifference) {\n            // If 'preserveSourceNewlines' is disabled, we should never call this function\n            // because it could be more expensive than alternative approximations.\n            ts.Debug.assert(!!preserveSourceNewlines);\n            // We start by measuring the line difference from a position to its adjacent comments,\n            // so that this is counted as a one-line difference, not two:\n            //\n            //   node1;\n            //   // NODE2 COMMENT\n            //   node2;\n            var lines = getLineDifference(/*includeComments*/ true);\n            if (lines === 0) {\n                // However, if the line difference considering comments was 0, we might have this:\n                //\n                //   node1; // NODE2 COMMENT\n                //   node2;\n                //\n                // in which case we should be ignoring node2's comment, so this too is counted as\n                // a one-line difference, not zero.\n                return getLineDifference(/*includeComments*/ false);\n            }\n            return lines;\n        }\n        function writeLineSeparatorsAndIndentBefore(node, parent) {\n            var leadingNewlines = preserveSourceNewlines && getLeadingLineTerminatorCount(parent, [node], 0 /* None */);\n            if (leadingNewlines) {\n                writeLinesAndIndent(leadingNewlines, /*writeLinesIfNotIndenting*/ false);\n            }\n            return !!leadingNewlines;\n        }\n        function writeLineSeparatorsAfter(node, parent) {\n            var trailingNewlines = preserveSourceNewlines && getClosingLineTerminatorCount(parent, [node], 0 /* None */);\n            if (trailingNewlines) {\n                writeLine(trailingNewlines);\n            }\n        }\n        function synthesizedNodeStartsOnNewLine(node, format) {\n            if (ts.nodeIsSynthesized(node)) {\n                var startsOnNewLine = ts.getStartsOnNewLine(node);\n                if (startsOnNewLine === undefined) {\n                    return (format & 65536 /* PreferNewLine */) !== 0;\n                }\n                return startsOnNewLine;\n            }\n            return (format & 65536 /* PreferNewLine */) !== 0;\n        }\n        function getLinesBetweenNodes(parent, node1, node2) {\n            if (ts.getEmitFlags(parent) & 131072 /* NoIndentation */) {\n                return 0;\n            }\n            parent = skipSynthesizedParentheses(parent);\n            node1 = skipSynthesizedParentheses(node1);\n            node2 = skipSynthesizedParentheses(node2);\n            // Always use a newline for synthesized code if the synthesizer desires it.\n            if (ts.getStartsOnNewLine(node2)) {\n                return 1;\n            }\n            if (!ts.nodeIsSynthesized(parent) && !ts.nodeIsSynthesized(node1) && !ts.nodeIsSynthesized(node2)) {\n                if (preserveSourceNewlines) {\n                    return getEffectiveLines(function (includeComments) { return ts.getLinesBetweenRangeEndAndRangeStart(node1, node2, currentSourceFile, includeComments); });\n                }\n                return ts.rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile) ? 0 : 1;\n            }\n            return 0;\n        }\n        function isEmptyBlock(block) {\n            return block.statements.length === 0\n                && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile);\n        }\n        function skipSynthesizedParentheses(node) {\n            while (node.kind === 207 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) {\n                node = node.expression;\n            }\n            return node;\n        }\n        function getTextOfNode(node, includeTrivia) {\n            if (ts.isGeneratedIdentifier(node)) {\n                return generateName(node);\n            }\n            else if ((ts.isIdentifier(node) || ts.isPrivateIdentifier(node)) && (ts.nodeIsSynthesized(node) || !node.parent || !currentSourceFile || (node.parent && currentSourceFile && ts.getSourceFileOfNode(node) !== ts.getOriginalNode(currentSourceFile)))) {\n                return ts.idText(node);\n            }\n            else if (node.kind === 10 /* StringLiteral */ && node.textSourceNode) {\n                return getTextOfNode(node.textSourceNode, includeTrivia);\n            }\n            else if (ts.isLiteralExpression(node) && (ts.nodeIsSynthesized(node) || !node.parent)) {\n                return node.text;\n            }\n            return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node, includeTrivia);\n        }\n        function getLiteralTextOfNode(node, neverAsciiEscape, jsxAttributeEscape) {\n            if (node.kind === 10 /* StringLiteral */ && node.textSourceNode) {\n                var textSourceNode = node.textSourceNode;\n                if (ts.isIdentifier(textSourceNode) || ts.isNumericLiteral(textSourceNode)) {\n                    var text = ts.isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode(textSourceNode);\n                    return jsxAttributeEscape ? \"\\\"\" + ts.escapeJsxAttributeString(text) + \"\\\"\" :\n                        neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? \"\\\"\" + ts.escapeString(text) + \"\\\"\" :\n                            \"\\\"\" + ts.escapeNonAsciiString(text) + \"\\\"\";\n                }\n                else {\n                    return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);\n                }\n            }\n            var flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0)\n                | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0)\n                | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0)\n                | (printerOptions.target && printerOptions.target === 99 /* ESNext */ ? 8 /* AllowNumericSeparator */ : 0);\n            return ts.getLiteralText(node, currentSourceFile, flags);\n        }\n        /**\n         * Push a new name generation scope.\n         */\n        function pushNameGenerationScope(node) {\n            if (node && ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) {\n                return;\n            }\n            tempFlagsStack.push(tempFlags);\n            tempFlags = 0;\n            reservedNamesStack.push(reservedNames);\n        }\n        /**\n         * Pop the current name generation scope.\n         */\n        function popNameGenerationScope(node) {\n            if (node && ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) {\n                return;\n            }\n            tempFlags = tempFlagsStack.pop();\n            reservedNames = reservedNamesStack.pop();\n        }\n        function reserveNameInNestedScopes(name) {\n            if (!reservedNames || reservedNames === ts.lastOrUndefined(reservedNamesStack)) {\n                reservedNames = new ts.Set();\n            }\n            reservedNames.add(name);\n        }\n        function generateNames(node) {\n            if (!node)\n                return;\n            switch (node.kind) {\n                case 230 /* Block */:\n                    ts.forEach(node.statements, generateNames);\n                    break;\n                case 245 /* LabeledStatement */:\n                case 243 /* WithStatement */:\n                case 235 /* DoStatement */:\n                case 236 /* WhileStatement */:\n                    generateNames(node.statement);\n                    break;\n                case 234 /* IfStatement */:\n                    generateNames(node.thenStatement);\n                    generateNames(node.elseStatement);\n                    break;\n                case 237 /* ForStatement */:\n                case 239 /* ForOfStatement */:\n                case 238 /* ForInStatement */:\n                    generateNames(node.initializer);\n                    generateNames(node.statement);\n                    break;\n                case 244 /* SwitchStatement */:\n                    generateNames(node.caseBlock);\n                    break;\n                case 258 /* CaseBlock */:\n                    ts.forEach(node.clauses, generateNames);\n                    break;\n                case 284 /* CaseClause */:\n                case 285 /* DefaultClause */:\n                    ts.forEach(node.statements, generateNames);\n                    break;\n                case 247 /* TryStatement */:\n                    generateNames(node.tryBlock);\n                    generateNames(node.catchClause);\n                    generateNames(node.finallyBlock);\n                    break;\n                case 287 /* CatchClause */:\n                    generateNames(node.variableDeclaration);\n                    generateNames(node.block);\n                    break;\n                case 232 /* VariableStatement */:\n                    generateNames(node.declarationList);\n                    break;\n                case 250 /* VariableDeclarationList */:\n                    ts.forEach(node.declarations, generateNames);\n                    break;\n                case 249 /* VariableDeclaration */:\n                case 160 /* Parameter */:\n                case 198 /* BindingElement */:\n                case 252 /* ClassDeclaration */:\n                    generateNameIfNeeded(node.name);\n                    break;\n                case 251 /* FunctionDeclaration */:\n                    generateNameIfNeeded(node.name);\n                    if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) {\n                        ts.forEach(node.parameters, generateNames);\n                        generateNames(node.body);\n                    }\n                    break;\n                case 196 /* ObjectBindingPattern */:\n                case 197 /* ArrayBindingPattern */:\n                    ts.forEach(node.elements, generateNames);\n                    break;\n                case 261 /* ImportDeclaration */:\n                    generateNames(node.importClause);\n                    break;\n                case 262 /* ImportClause */:\n                    generateNameIfNeeded(node.name);\n                    generateNames(node.namedBindings);\n                    break;\n                case 263 /* NamespaceImport */:\n                    generateNameIfNeeded(node.name);\n                    break;\n                case 269 /* NamespaceExport */:\n                    generateNameIfNeeded(node.name);\n                    break;\n                case 264 /* NamedImports */:\n                    ts.forEach(node.elements, generateNames);\n                    break;\n                case 265 /* ImportSpecifier */:\n                    generateNameIfNeeded(node.propertyName || node.name);\n                    break;\n            }\n        }\n        function generateMemberNames(node) {\n            if (!node)\n                return;\n            switch (node.kind) {\n                case 288 /* PropertyAssignment */:\n                case 289 /* ShorthandPropertyAssignment */:\n                case 163 /* PropertyDeclaration */:\n                case 165 /* MethodDeclaration */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    generateNameIfNeeded(node.name);\n                    break;\n            }\n        }\n        function generateNameIfNeeded(name) {\n            if (name) {\n                if (ts.isGeneratedIdentifier(name)) {\n                    generateName(name);\n                }\n                else if (ts.isBindingPattern(name)) {\n                    generateNames(name);\n                }\n            }\n        }\n        /**\n         * Generate the text for a generated identifier.\n         */\n        function generateName(name) {\n            if ((name.autoGenerateFlags & 7 /* KindMask */) === 4 /* Node */) {\n                // Node names generate unique names based on their original node\n                // and are cached based on that node's id.\n                return generateNameCached(getNodeForGeneratedName(name), name.autoGenerateFlags);\n            }\n            else {\n                // Auto, Loop, and Unique names are cached based on their unique\n                // autoGenerateId.\n                var autoGenerateId = name.autoGenerateId;\n                return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name));\n            }\n        }\n        function generateNameCached(node, flags) {\n            var nodeId = ts.getNodeId(node);\n            return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = generateNameForNode(node, flags));\n        }\n        /**\n         * Returns a value indicating whether a name is unique globally, within the current file,\n         * or within the NameGenerator.\n         */\n        function isUniqueName(name) {\n            return isFileLevelUniqueName(name)\n                && !generatedNames.has(name)\n                && !(reservedNames && reservedNames.has(name));\n        }\n        /**\n         * Returns a value indicating whether a name is unique globally or within the current file.\n         */\n        function isFileLevelUniqueName(name) {\n            return currentSourceFile ? ts.isFileLevelUniqueName(currentSourceFile, name, hasGlobalName) : true;\n        }\n        /**\n         * Returns a value indicating whether a name is unique within a container.\n         */\n        function isUniqueLocalName(name, container) {\n            for (var node = container; ts.isNodeDescendantOf(node, container); node = node.nextContainer) {\n                if (node.locals) {\n                    var local = node.locals.get(ts.escapeLeadingUnderscores(name));\n                    // We conservatively include alias symbols to cover cases where they're emitted as locals\n                    if (local && local.flags & (111551 /* Value */ | 1048576 /* ExportValue */ | 2097152 /* Alias */)) {\n                        return false;\n                    }\n                }\n            }\n            return true;\n        }\n        /**\n         * Return the next available name in the pattern _a ... _z, _0, _1, ...\n         * TempFlags._i or TempFlags._n may be used to express a preference for that dedicated name.\n         * Note that names generated by makeTempVariableName and makeUniqueName will never conflict.\n         */\n        function makeTempVariableName(flags, reservedInNestedScopes) {\n            if (flags && !(tempFlags & flags)) {\n                var name = flags === 268435456 /* _i */ ? \"_i\" : \"_n\";\n                if (isUniqueName(name)) {\n                    tempFlags |= flags;\n                    if (reservedInNestedScopes) {\n                        reserveNameInNestedScopes(name);\n                    }\n                    return name;\n                }\n            }\n            while (true) {\n                var count = tempFlags & 268435455 /* CountMask */;\n                tempFlags++;\n                // Skip over 'i' and 'n'\n                if (count !== 8 && count !== 13) {\n                    var name = count < 26\n                        ? \"_\" + String.fromCharCode(97 /* a */ + count)\n                        : \"_\" + (count - 26);\n                    if (isUniqueName(name)) {\n                        if (reservedInNestedScopes) {\n                            reserveNameInNestedScopes(name);\n                        }\n                        return name;\n                    }\n                }\n            }\n        }\n        /**\n         * Generate a name that is unique within the current file and doesn't conflict with any names\n         * in global scope. The name is formed by adding an '_n' suffix to the specified base name,\n         * where n is a positive integer. Note that names generated by makeTempVariableName and\n         * makeUniqueName are guaranteed to never conflict.\n         * If `optimistic` is set, the first instance will use 'baseName' verbatim instead of 'baseName_1'\n         */\n        function makeUniqueName(baseName, checkFn, optimistic, scoped) {\n            if (checkFn === void 0) { checkFn = isUniqueName; }\n            if (optimistic) {\n                if (checkFn(baseName)) {\n                    if (scoped) {\n                        reserveNameInNestedScopes(baseName);\n                    }\n                    else {\n                        generatedNames.add(baseName);\n                    }\n                    return baseName;\n                }\n            }\n            // Find the first unique 'name_n', where n is a positive number\n            if (baseName.charCodeAt(baseName.length - 1) !== 95 /* _ */) {\n                baseName += \"_\";\n            }\n            var i = 1;\n            while (true) {\n                var generatedName = baseName + i;\n                if (checkFn(generatedName)) {\n                    if (scoped) {\n                        reserveNameInNestedScopes(generatedName);\n                    }\n                    else {\n                        generatedNames.add(generatedName);\n                    }\n                    return generatedName;\n                }\n                i++;\n            }\n        }\n        function makeFileLevelOptimisticUniqueName(name) {\n            return makeUniqueName(name, isFileLevelUniqueName, /*optimistic*/ true);\n        }\n        /**\n         * Generates a unique name for a ModuleDeclaration or EnumDeclaration.\n         */\n        function generateNameForModuleOrEnum(node) {\n            var name = getTextOfNode(node.name);\n            // Use module/enum name itself if it is unique, otherwise make a unique variation\n            return isUniqueLocalName(name, node) ? name : makeUniqueName(name);\n        }\n        /**\n         * Generates a unique name for an ImportDeclaration or ExportDeclaration.\n         */\n        function generateNameForImportOrExportDeclaration(node) {\n            var expr = ts.getExternalModuleName(node); // TODO: GH#18217\n            var baseName = ts.isStringLiteral(expr) ?\n                ts.makeIdentifierFromModuleName(expr.text) : \"module\";\n            return makeUniqueName(baseName);\n        }\n        /**\n         * Generates a unique name for a default export.\n         */\n        function generateNameForExportDefault() {\n            return makeUniqueName(\"default\");\n        }\n        /**\n         * Generates a unique name for a class expression.\n         */\n        function generateNameForClassExpression() {\n            return makeUniqueName(\"class\");\n        }\n        function generateNameForMethodOrAccessor(node) {\n            if (ts.isIdentifier(node.name)) {\n                return generateNameCached(node.name);\n            }\n            return makeTempVariableName(0 /* Auto */);\n        }\n        /**\n         * Generates a unique name from a node.\n         */\n        function generateNameForNode(node, flags) {\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                    return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */));\n                case 256 /* ModuleDeclaration */:\n                case 255 /* EnumDeclaration */:\n                    return generateNameForModuleOrEnum(node);\n                case 261 /* ImportDeclaration */:\n                case 267 /* ExportDeclaration */:\n                    return generateNameForImportOrExportDeclaration(node);\n                case 251 /* FunctionDeclaration */:\n                case 252 /* ClassDeclaration */:\n                case 266 /* ExportAssignment */:\n                    return generateNameForExportDefault();\n                case 221 /* ClassExpression */:\n                    return generateNameForClassExpression();\n                case 165 /* MethodDeclaration */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    return generateNameForMethodOrAccessor(node);\n                case 158 /* ComputedPropertyName */:\n                    return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true);\n                default:\n                    return makeTempVariableName(0 /* Auto */);\n            }\n        }\n        /**\n         * Generates a unique identifier for a node.\n         */\n        function makeName(name) {\n            switch (name.autoGenerateFlags & 7 /* KindMask */) {\n                case 1 /* Auto */:\n                    return makeTempVariableName(0 /* Auto */, !!(name.autoGenerateFlags & 8 /* ReservedInNestedScopes */));\n                case 2 /* Loop */:\n                    return makeTempVariableName(268435456 /* _i */, !!(name.autoGenerateFlags & 8 /* ReservedInNestedScopes */));\n                case 3 /* Unique */:\n                    return makeUniqueName(ts.idText(name), (name.autoGenerateFlags & 32 /* FileLevel */) ? isFileLevelUniqueName : isUniqueName, !!(name.autoGenerateFlags & 16 /* Optimistic */), !!(name.autoGenerateFlags & 8 /* ReservedInNestedScopes */));\n            }\n            return ts.Debug.fail(\"Unsupported GeneratedIdentifierKind.\");\n        }\n        /**\n         * Gets the node from which a name should be generated.\n         */\n        function getNodeForGeneratedName(name) {\n            var autoGenerateId = name.autoGenerateId;\n            var node = name;\n            var original = node.original;\n            while (original) {\n                node = original;\n                // if \"node\" is a different generated name (having a different\n                // \"autoGenerateId\"), use it and stop traversing.\n                if (ts.isIdentifier(node)\n                    && !!(node.autoGenerateFlags & 4 /* Node */)\n                    && node.autoGenerateId !== autoGenerateId) {\n                    break;\n                }\n                original = node.original;\n            }\n            // otherwise, return the original node for the source;\n            return node;\n        }\n        // Comments\n        function pipelineEmitWithComments(hint, node) {\n            ts.Debug.assert(lastNode === node || lastSubstitution === node);\n            enterComment();\n            hasWrittenComment = false;\n            var emitFlags = ts.getEmitFlags(node);\n            var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end;\n            var isEmittedNode = node.kind !== 335 /* NotEmittedStatement */;\n            // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is \"preserve\" we will not do any transformation.\n            // It is expensive to walk entire tree just to set one kind of node to have no comments.\n            var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */;\n            var skipTrailingComments = end < 0 || (emitFlags & 1024 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */;\n            // Save current container state on the stack.\n            var savedContainerPos = containerPos;\n            var savedContainerEnd = containerEnd;\n            var savedDeclarationListContainerEnd = declarationListContainerEnd;\n            if ((pos > 0 || end > 0) && pos !== end) {\n                // Emit leading comments if the position is not synthesized and the node\n                // has not opted out from emitting leading comments.\n                if (!skipLeadingComments) {\n                    emitLeadingComments(pos, isEmittedNode);\n                }\n                if (!skipLeadingComments || (pos >= 0 && (emitFlags & 512 /* NoLeadingComments */) !== 0)) {\n                    // Advance the container position if comments get emitted or if they've been disabled explicitly using NoLeadingComments.\n                    containerPos = pos;\n                }\n                if (!skipTrailingComments || (end >= 0 && (emitFlags & 1024 /* NoTrailingComments */) !== 0)) {\n                    // As above.\n                    containerEnd = end;\n                    // To avoid invalid comment emit in a down-level binding pattern, we\n                    // keep track of the last declaration list container's end\n                    if (node.kind === 250 /* VariableDeclarationList */) {\n                        declarationListContainerEnd = end;\n                    }\n                }\n            }\n            ts.forEach(ts.getSyntheticLeadingComments(node), emitLeadingSynthesizedComment);\n            exitComment();\n            var pipelinePhase = getNextPipelinePhase(2 /* Comments */, hint, node);\n            if (emitFlags & 2048 /* NoNestedComments */) {\n                commentsDisabled = true;\n                pipelinePhase(hint, node);\n                commentsDisabled = false;\n            }\n            else {\n                pipelinePhase(hint, node);\n            }\n            enterComment();\n            ts.forEach(ts.getSyntheticTrailingComments(node), emitTrailingSynthesizedComment);\n            if ((pos > 0 || end > 0) && pos !== end) {\n                // Restore previous container state.\n                containerPos = savedContainerPos;\n                containerEnd = savedContainerEnd;\n                declarationListContainerEnd = savedDeclarationListContainerEnd;\n                // Emit trailing comments if the position is not synthesized and the node\n                // has not opted out from emitting leading comments and is an emitted node.\n                if (!skipTrailingComments && isEmittedNode) {\n                    emitTrailingComments(end);\n                }\n            }\n            exitComment();\n            ts.Debug.assert(lastNode === node || lastSubstitution === node);\n        }\n        function emitLeadingSynthesizedComment(comment) {\n            if (comment.hasLeadingNewline || comment.kind === 2 /* SingleLineCommentTrivia */) {\n                writer.writeLine();\n            }\n            writeSynthesizedComment(comment);\n            if (comment.hasTrailingNewLine || comment.kind === 2 /* SingleLineCommentTrivia */) {\n                writer.writeLine();\n            }\n            else {\n                writer.writeSpace(\" \");\n            }\n        }\n        function emitTrailingSynthesizedComment(comment) {\n            if (!writer.isAtStartOfLine()) {\n                writer.writeSpace(\" \");\n            }\n            writeSynthesizedComment(comment);\n            if (comment.hasTrailingNewLine) {\n                writer.writeLine();\n            }\n        }\n        function writeSynthesizedComment(comment) {\n            var text = formatSynthesizedComment(comment);\n            var lineMap = comment.kind === 3 /* MultiLineCommentTrivia */ ? ts.computeLineStarts(text) : undefined;\n            ts.writeCommentRange(text, lineMap, writer, 0, text.length, newLine);\n        }\n        function formatSynthesizedComment(comment) {\n            return comment.kind === 3 /* MultiLineCommentTrivia */\n                ? \"/*\" + comment.text + \"*/\"\n                : \"//\" + comment.text;\n        }\n        function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {\n            enterComment();\n            var pos = detachedRange.pos, end = detachedRange.end;\n            var emitFlags = ts.getEmitFlags(node);\n            var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0;\n            var skipTrailingComments = commentsDisabled || end < 0 || (emitFlags & 1024 /* NoTrailingComments */) !== 0;\n            if (!skipLeadingComments) {\n                emitDetachedCommentsAndUpdateCommentsInfo(detachedRange);\n            }\n            exitComment();\n            if (emitFlags & 2048 /* NoNestedComments */ && !commentsDisabled) {\n                commentsDisabled = true;\n                emitCallback(node);\n                commentsDisabled = false;\n            }\n            else {\n                emitCallback(node);\n            }\n            enterComment();\n            if (!skipTrailingComments) {\n                emitLeadingComments(detachedRange.end, /*isEmittedNode*/ true);\n                if (hasWrittenComment && !writer.isAtStartOfLine()) {\n                    writer.writeLine();\n                }\n            }\n            exitComment();\n        }\n        function emitLeadingComments(pos, isEmittedNode) {\n            hasWrittenComment = false;\n            if (isEmittedNode) {\n                if (pos === 0 && (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.isDeclarationFile)) {\n                    forEachLeadingCommentToEmit(pos, emitNonTripleSlashLeadingComment);\n                }\n                else {\n                    forEachLeadingCommentToEmit(pos, emitLeadingComment);\n                }\n            }\n            else if (pos === 0) {\n                // If the node will not be emitted in JS, remove all the comments(normal, pinned and ///) associated with the node,\n                // unless it is a triple slash comment at the top of the file.\n                // For Example:\n                //      /// <reference-path ...>\n                //      declare var x;\n                //      /// <reference-path ...>\n                //      interface F {}\n                //  The first /// will NOT be removed while the second one will be removed even though both node will not be emitted\n                forEachLeadingCommentToEmit(pos, emitTripleSlashLeadingComment);\n            }\n        }\n        function emitTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) {\n            if (isTripleSlashComment(commentPos, commentEnd)) {\n                emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos);\n            }\n        }\n        function emitNonTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) {\n            if (!isTripleSlashComment(commentPos, commentEnd)) {\n                emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos);\n            }\n        }\n        function shouldWriteComment(text, pos) {\n            if (printerOptions.onlyPrintJsDocStyle) {\n                return (ts.isJSDocLikeText(text, pos) || ts.isPinnedComment(text, pos));\n            }\n            return true;\n        }\n        function emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) {\n            if (!shouldWriteComment(currentSourceFile.text, commentPos))\n                return;\n            if (!hasWrittenComment) {\n                ts.emitNewLineBeforeLeadingCommentOfPosition(getCurrentLineMap(), writer, rangePos, commentPos);\n                hasWrittenComment = true;\n            }\n            // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space\n            emitPos(commentPos);\n            ts.writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine);\n            emitPos(commentEnd);\n            if (hasTrailingNewLine) {\n                writer.writeLine();\n            }\n            else if (kind === 3 /* MultiLineCommentTrivia */) {\n                writer.writeSpace(\" \");\n            }\n        }\n        function emitLeadingCommentsOfPosition(pos) {\n            if (commentsDisabled || pos === -1) {\n                return;\n            }\n            emitLeadingComments(pos, /*isEmittedNode*/ true);\n        }\n        function emitTrailingComments(pos) {\n            forEachTrailingCommentToEmit(pos, emitTrailingComment);\n        }\n        function emitTrailingComment(commentPos, commentEnd, _kind, hasTrailingNewLine) {\n            if (!shouldWriteComment(currentSourceFile.text, commentPos))\n                return;\n            // trailing comments are emitted at space/*trailing comment1 */space/*trailing comment2*/\n            if (!writer.isAtStartOfLine()) {\n                writer.writeSpace(\" \");\n            }\n            emitPos(commentPos);\n            ts.writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine);\n            emitPos(commentEnd);\n            if (hasTrailingNewLine) {\n                writer.writeLine();\n            }\n        }\n        function emitTrailingCommentsOfPosition(pos, prefixSpace, forceNoNewline) {\n            if (commentsDisabled) {\n                return;\n            }\n            enterComment();\n            forEachTrailingCommentToEmit(pos, prefixSpace ? emitTrailingComment : forceNoNewline ? emitTrailingCommentOfPositionNoNewline : emitTrailingCommentOfPosition);\n            exitComment();\n        }\n        function emitTrailingCommentOfPositionNoNewline(commentPos, commentEnd, kind) {\n            // trailing comments of a position are emitted at /*trailing comment1 */space/*trailing comment*/space\n            emitPos(commentPos);\n            ts.writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine);\n            emitPos(commentEnd);\n            if (kind === 2 /* SingleLineCommentTrivia */) {\n                writer.writeLine(); // still write a newline for single-line comments, so closing tokens aren't written on the same line\n            }\n        }\n        function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) {\n            // trailing comments of a position are emitted at /*trailing comment1 */space/*trailing comment*/space\n            emitPos(commentPos);\n            ts.writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine);\n            emitPos(commentEnd);\n            if (hasTrailingNewLine) {\n                writer.writeLine();\n            }\n            else {\n                writer.writeSpace(\" \");\n            }\n        }\n        function forEachLeadingCommentToEmit(pos, cb) {\n            // Emit the leading comments only if the container's pos doesn't match because the container should take care of emitting these comments\n            if (currentSourceFile && (containerPos === -1 || pos !== containerPos)) {\n                if (hasDetachedComments(pos)) {\n                    forEachLeadingCommentWithoutDetachedComments(cb);\n                }\n                else {\n                    ts.forEachLeadingCommentRange(currentSourceFile.text, pos, cb, /*state*/ pos);\n                }\n            }\n        }\n        function forEachTrailingCommentToEmit(end, cb) {\n            // Emit the trailing comments only if the container's end doesn't match because the container should take care of emitting these comments\n            if (currentSourceFile && (containerEnd === -1 || (end !== containerEnd && end !== declarationListContainerEnd))) {\n                ts.forEachTrailingCommentRange(currentSourceFile.text, end, cb);\n            }\n        }\n        function hasDetachedComments(pos) {\n            return detachedCommentsInfo !== undefined && ts.last(detachedCommentsInfo).nodePos === pos;\n        }\n        function forEachLeadingCommentWithoutDetachedComments(cb) {\n            // get the leading comments from detachedPos\n            var pos = ts.last(detachedCommentsInfo).detachedCommentEndPos;\n            if (detachedCommentsInfo.length - 1) {\n                detachedCommentsInfo.pop();\n            }\n            else {\n                detachedCommentsInfo = undefined;\n            }\n            ts.forEachLeadingCommentRange(currentSourceFile.text, pos, cb, /*state*/ pos);\n        }\n        function emitDetachedCommentsAndUpdateCommentsInfo(range) {\n            var currentDetachedCommentInfo = ts.emitDetachedComments(currentSourceFile.text, getCurrentLineMap(), writer, emitComment, range, newLine, commentsDisabled);\n            if (currentDetachedCommentInfo) {\n                if (detachedCommentsInfo) {\n                    detachedCommentsInfo.push(currentDetachedCommentInfo);\n                }\n                else {\n                    detachedCommentsInfo = [currentDetachedCommentInfo];\n                }\n            }\n        }\n        function emitComment(text, lineMap, writer, commentPos, commentEnd, newLine) {\n            if (!shouldWriteComment(currentSourceFile.text, commentPos))\n                return;\n            emitPos(commentPos);\n            ts.writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine);\n            emitPos(commentEnd);\n        }\n        /**\n         * Determine if the given comment is a triple-slash\n         *\n         * @return true if the comment is a triple-slash comment else false\n         */\n        function isTripleSlashComment(commentPos, commentEnd) {\n            return ts.isRecognizedTripleSlashComment(currentSourceFile.text, commentPos, commentEnd);\n        }\n        // Source Maps\n        function getParsedSourceMap(node) {\n            if (node.parsedSourceMap === undefined && node.sourceMapText !== undefined) {\n                node.parsedSourceMap = ts.tryParseRawSourceMap(node.sourceMapText) || false;\n            }\n            return node.parsedSourceMap || undefined;\n        }\n        function pipelineEmitWithSourceMap(hint, node) {\n            ts.Debug.assert(lastNode === node || lastSubstitution === node);\n            var pipelinePhase = getNextPipelinePhase(3 /* SourceMaps */, hint, node);\n            if (ts.isUnparsedSource(node) || ts.isUnparsedPrepend(node)) {\n                pipelinePhase(hint, node);\n            }\n            else if (ts.isUnparsedNode(node)) {\n                var parsed = getParsedSourceMap(node.parent);\n                if (parsed && sourceMapGenerator) {\n                    sourceMapGenerator.appendSourceMap(writer.getLine(), writer.getColumn(), parsed, node.parent.sourceMapPath, node.parent.getLineAndCharacterOfPosition(node.pos), node.parent.getLineAndCharacterOfPosition(node.end));\n                }\n                pipelinePhase(hint, node);\n            }\n            else {\n                var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b;\n                var emitFlags = ts.getEmitFlags(node);\n                if (node.kind !== 335 /* NotEmittedStatement */\n                    && (emitFlags & 16 /* NoLeadingSourceMap */) === 0\n                    && pos >= 0) {\n                    emitSourcePos(source, skipSourceTrivia(source, pos));\n                }\n                if (emitFlags & 64 /* NoNestedSourceMaps */) {\n                    sourceMapsDisabled = true;\n                    pipelinePhase(hint, node);\n                    sourceMapsDisabled = false;\n                }\n                else {\n                    pipelinePhase(hint, node);\n                }\n                if (node.kind !== 335 /* NotEmittedStatement */\n                    && (emitFlags & 32 /* NoTrailingSourceMap */) === 0\n                    && end >= 0) {\n                    emitSourcePos(source, end);\n                }\n            }\n            ts.Debug.assert(lastNode === node || lastSubstitution === node);\n        }\n        /**\n         * Skips trivia such as comments and white-space that can be optionally overridden by the source-map source\n         */\n        function skipSourceTrivia(source, pos) {\n            return source.skipTrivia ? source.skipTrivia(pos) : ts.skipTrivia(source.text, pos);\n        }\n        /**\n         * Emits a mapping.\n         *\n         * If the position is synthetic (undefined or a negative value), no mapping will be\n         * created.\n         *\n         * @param pos The position.\n         */\n        function emitPos(pos) {\n            if (sourceMapsDisabled || ts.positionIsSynthesized(pos) || isJsonSourceMapSource(sourceMapSource)) {\n                return;\n            }\n            var _a = ts.getLineAndCharacterOfPosition(sourceMapSource, pos), sourceLine = _a.line, sourceCharacter = _a.character;\n            sourceMapGenerator.addMapping(writer.getLine(), writer.getColumn(), sourceMapSourceIndex, sourceLine, sourceCharacter, \n            /*nameIndex*/ undefined);\n        }\n        function emitSourcePos(source, pos) {\n            if (source !== sourceMapSource) {\n                var savedSourceMapSource = sourceMapSource;\n                var savedSourceMapSourceIndex = sourceMapSourceIndex;\n                setSourceMapSource(source);\n                emitPos(pos);\n                resetSourceMapSource(savedSourceMapSource, savedSourceMapSourceIndex);\n            }\n            else {\n                emitPos(pos);\n            }\n        }\n        /**\n         * Emits a token of a node with possible leading and trailing source maps.\n         *\n         * @param node The node containing the token.\n         * @param token The token to emit.\n         * @param tokenStartPos The start pos of the token.\n         * @param emitCallback The callback used to emit the token.\n         */\n        function emitTokenWithSourceMap(node, token, writer, tokenPos, emitCallback) {\n            if (sourceMapsDisabled || node && ts.isInJsonFile(node)) {\n                return emitCallback(token, writer, tokenPos);\n            }\n            var emitNode = node && node.emitNode;\n            var emitFlags = emitNode && emitNode.flags || 0 /* None */;\n            var range = emitNode && emitNode.tokenSourceMapRanges && emitNode.tokenSourceMapRanges[token];\n            var source = range && range.source || sourceMapSource;\n            tokenPos = skipSourceTrivia(source, range ? range.pos : tokenPos);\n            if ((emitFlags & 128 /* NoTokenLeadingSourceMaps */) === 0 && tokenPos >= 0) {\n                emitSourcePos(source, tokenPos);\n            }\n            tokenPos = emitCallback(token, writer, tokenPos);\n            if (range)\n                tokenPos = range.end;\n            if ((emitFlags & 256 /* NoTokenTrailingSourceMaps */) === 0 && tokenPos >= 0) {\n                emitSourcePos(source, tokenPos);\n            }\n            return tokenPos;\n        }\n        function setSourceMapSource(source) {\n            if (sourceMapsDisabled) {\n                return;\n            }\n            sourceMapSource = source;\n            if (source === mostRecentlyAddedSourceMapSource) {\n                // Fast path for when the new source map is the most recently added, in which case\n                // we use its captured index without going through the source map generator.\n                sourceMapSourceIndex = mostRecentlyAddedSourceMapSourceIndex;\n                return;\n            }\n            if (isJsonSourceMapSource(source)) {\n                return;\n            }\n            sourceMapSourceIndex = sourceMapGenerator.addSource(source.fileName);\n            if (printerOptions.inlineSources) {\n                sourceMapGenerator.setSourceContent(sourceMapSourceIndex, source.text);\n            }\n            mostRecentlyAddedSourceMapSource = source;\n            mostRecentlyAddedSourceMapSourceIndex = sourceMapSourceIndex;\n        }\n        function resetSourceMapSource(source, sourceIndex) {\n            sourceMapSource = source;\n            sourceMapSourceIndex = sourceIndex;\n        }\n        function isJsonSourceMapSource(sourceFile) {\n            return ts.fileExtensionIs(sourceFile.fileName, \".json\" /* Json */);\n        }\n    }\n    ts.createPrinter = createPrinter;\n    function createBracketsMap() {\n        var brackets = [];\n        brackets[1024 /* Braces */] = [\"{\", \"}\"];\n        brackets[2048 /* Parenthesis */] = [\"(\", \")\"];\n        brackets[4096 /* AngleBrackets */] = [\"<\", \">\"];\n        brackets[8192 /* SquareBrackets */] = [\"[\", \"]\"];\n        return brackets;\n    }\n    function getOpeningBracket(format) {\n        return brackets[format & 15360 /* BracketsMask */][0];\n    }\n    function getClosingBracket(format) {\n        return brackets[format & 15360 /* BracketsMask */][1];\n    }\n    // Flags enum to track count of temp variables and a few dedicated names\n    var TempFlags;\n    (function (TempFlags) {\n        TempFlags[TempFlags[\"Auto\"] = 0] = \"Auto\";\n        TempFlags[TempFlags[\"CountMask\"] = 268435455] = \"CountMask\";\n        TempFlags[TempFlags[\"_i\"] = 268435456] = \"_i\";\n    })(TempFlags || (TempFlags = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames) {\n        if (!host.getDirectories || !host.readDirectory) {\n            return undefined;\n        }\n        var cachedReadDirectoryResult = new ts.Map();\n        var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);\n        return {\n            useCaseSensitiveFileNames: useCaseSensitiveFileNames,\n            fileExists: fileExists,\n            readFile: function (path, encoding) { return host.readFile(path, encoding); },\n            directoryExists: host.directoryExists && directoryExists,\n            getDirectories: getDirectories,\n            readDirectory: readDirectory,\n            createDirectory: host.createDirectory && createDirectory,\n            writeFile: host.writeFile && writeFile,\n            addOrDeleteFileOrDirectory: addOrDeleteFileOrDirectory,\n            addOrDeleteFile: addOrDeleteFile,\n            clearCache: clearCache,\n            realpath: host.realpath && realpath\n        };\n        function toPath(fileName) {\n            return ts.toPath(fileName, currentDirectory, getCanonicalFileName);\n        }\n        function getCachedFileSystemEntries(rootDirPath) {\n            return cachedReadDirectoryResult.get(ts.ensureTrailingDirectorySeparator(rootDirPath));\n        }\n        function getCachedFileSystemEntriesForBaseDir(path) {\n            return getCachedFileSystemEntries(ts.getDirectoryPath(path));\n        }\n        function getBaseNameOfFileName(fileName) {\n            return ts.getBaseFileName(ts.normalizePath(fileName));\n        }\n        function createCachedFileSystemEntries(rootDir, rootDirPath) {\n            var resultFromHost = {\n                files: ts.map(host.readDirectory(rootDir, /*extensions*/ undefined, /*exclude*/ undefined, /*include*/ [\"*.*\"]), getBaseNameOfFileName) || [],\n                directories: host.getDirectories(rootDir) || []\n            };\n            cachedReadDirectoryResult.set(ts.ensureTrailingDirectorySeparator(rootDirPath), resultFromHost);\n            return resultFromHost;\n        }\n        /**\n         * If the readDirectory result was already cached, it returns that\n         * Otherwise gets result from host and caches it.\n         * The host request is done under try catch block to avoid caching incorrect result\n         */\n        function tryReadDirectory(rootDir, rootDirPath) {\n            rootDirPath = ts.ensureTrailingDirectorySeparator(rootDirPath);\n            var cachedResult = getCachedFileSystemEntries(rootDirPath);\n            if (cachedResult) {\n                return cachedResult;\n            }\n            try {\n                return createCachedFileSystemEntries(rootDir, rootDirPath);\n            }\n            catch (_e) {\n                // If there is exception to read directories, dont cache the result and direct the calls to host\n                ts.Debug.assert(!cachedReadDirectoryResult.has(ts.ensureTrailingDirectorySeparator(rootDirPath)));\n                return undefined;\n            }\n        }\n        function fileNameEqual(name1, name2) {\n            return getCanonicalFileName(name1) === getCanonicalFileName(name2);\n        }\n        function hasEntry(entries, name) {\n            return ts.some(entries, function (file) { return fileNameEqual(file, name); });\n        }\n        function updateFileSystemEntry(entries, baseName, isValid) {\n            if (hasEntry(entries, baseName)) {\n                if (!isValid) {\n                    return ts.filterMutate(entries, function (entry) { return !fileNameEqual(entry, baseName); });\n                }\n            }\n            else if (isValid) {\n                return entries.push(baseName);\n            }\n        }\n        function writeFile(fileName, data, writeByteOrderMark) {\n            var path = toPath(fileName);\n            var result = getCachedFileSystemEntriesForBaseDir(path);\n            if (result) {\n                updateFilesOfFileSystemEntry(result, getBaseNameOfFileName(fileName), /*fileExists*/ true);\n            }\n            return host.writeFile(fileName, data, writeByteOrderMark);\n        }\n        function fileExists(fileName) {\n            var path = toPath(fileName);\n            var result = getCachedFileSystemEntriesForBaseDir(path);\n            return result && hasEntry(result.files, getBaseNameOfFileName(fileName)) ||\n                host.fileExists(fileName);\n        }\n        function directoryExists(dirPath) {\n            var path = toPath(dirPath);\n            return cachedReadDirectoryResult.has(ts.ensureTrailingDirectorySeparator(path)) || host.directoryExists(dirPath);\n        }\n        function createDirectory(dirPath) {\n            var path = toPath(dirPath);\n            var result = getCachedFileSystemEntriesForBaseDir(path);\n            var baseFileName = getBaseNameOfFileName(dirPath);\n            if (result) {\n                updateFileSystemEntry(result.directories, baseFileName, /*isValid*/ true);\n            }\n            host.createDirectory(dirPath);\n        }\n        function getDirectories(rootDir) {\n            var rootDirPath = toPath(rootDir);\n            var result = tryReadDirectory(rootDir, rootDirPath);\n            if (result) {\n                return result.directories.slice();\n            }\n            return host.getDirectories(rootDir);\n        }\n        function readDirectory(rootDir, extensions, excludes, includes, depth) {\n            var rootDirPath = toPath(rootDir);\n            var result = tryReadDirectory(rootDir, rootDirPath);\n            if (result) {\n                return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath);\n            }\n            return host.readDirectory(rootDir, extensions, excludes, includes, depth);\n            function getFileSystemEntries(dir) {\n                var path = toPath(dir);\n                if (path === rootDirPath) {\n                    return result;\n                }\n                return tryReadDirectory(dir, path) || ts.emptyFileSystemEntries;\n            }\n        }\n        function realpath(s) {\n            return host.realpath ? host.realpath(s) : s;\n        }\n        function addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath) {\n            var existingResult = getCachedFileSystemEntries(fileOrDirectoryPath);\n            if (existingResult) {\n                // Just clear the cache for now\n                // For now just clear the cache, since this could mean that multiple level entries might need to be re-evaluated\n                clearCache();\n                return undefined;\n            }\n            var parentResult = getCachedFileSystemEntriesForBaseDir(fileOrDirectoryPath);\n            if (!parentResult) {\n                return undefined;\n            }\n            // This was earlier a file (hence not in cached directory contents)\n            // or we never cached the directory containing it\n            if (!host.directoryExists) {\n                // Since host doesnt support directory exists, clear the cache as otherwise it might not be same\n                clearCache();\n                return undefined;\n            }\n            var baseName = getBaseNameOfFileName(fileOrDirectory);\n            var fsQueryResult = {\n                fileExists: host.fileExists(fileOrDirectoryPath),\n                directoryExists: host.directoryExists(fileOrDirectoryPath)\n            };\n            if (fsQueryResult.directoryExists || hasEntry(parentResult.directories, baseName)) {\n                // Folder added or removed, clear the cache instead of updating the folder and its structure\n                clearCache();\n            }\n            else {\n                // No need to update the directory structure, just files\n                updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists);\n            }\n            return fsQueryResult;\n        }\n        function addOrDeleteFile(fileName, filePath, eventKind) {\n            if (eventKind === ts.FileWatcherEventKind.Changed) {\n                return;\n            }\n            var parentResult = getCachedFileSystemEntriesForBaseDir(filePath);\n            if (parentResult) {\n                updateFilesOfFileSystemEntry(parentResult, getBaseNameOfFileName(fileName), eventKind === ts.FileWatcherEventKind.Created);\n            }\n        }\n        function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists) {\n            updateFileSystemEntry(parentResult.files, baseName, fileExists);\n        }\n        function clearCache() {\n            cachedReadDirectoryResult.clear();\n        }\n    }\n    ts.createCachedDirectoryStructureHost = createCachedDirectoryStructureHost;\n    var ConfigFileProgramReloadLevel;\n    (function (ConfigFileProgramReloadLevel) {\n        ConfigFileProgramReloadLevel[ConfigFileProgramReloadLevel[\"None\"] = 0] = \"None\";\n        /** Update the file name list from the disk */\n        ConfigFileProgramReloadLevel[ConfigFileProgramReloadLevel[\"Partial\"] = 1] = \"Partial\";\n        /** Reload completely by re-reading contents of config file from disk and updating program */\n        ConfigFileProgramReloadLevel[ConfigFileProgramReloadLevel[\"Full\"] = 2] = \"Full\";\n    })(ConfigFileProgramReloadLevel = ts.ConfigFileProgramReloadLevel || (ts.ConfigFileProgramReloadLevel = {}));\n    /**\n     * Updates the map of shared extended config file watches with a new set of extended config files from a base config file of the project\n     */\n    function updateSharedExtendedConfigFileWatcher(projectPath, parsed, extendedConfigFilesMap, createExtendedConfigFileWatch, toPath) {\n        var _a;\n        var extendedConfigs = ts.arrayToMap(((_a = parsed === null || parsed === void 0 ? void 0 : parsed.options.configFile) === null || _a === void 0 ? void 0 : _a.extendedSourceFiles) || ts.emptyArray, toPath);\n        // remove project from all unrelated watchers\n        extendedConfigFilesMap.forEach(function (watcher, extendedConfigFilePath) {\n            if (!extendedConfigs.has(extendedConfigFilePath)) {\n                watcher.projects.delete(projectPath);\n                watcher.close();\n            }\n        });\n        // Update the extended config files watcher\n        extendedConfigs.forEach(function (extendedConfigFileName, extendedConfigFilePath) {\n            var existing = extendedConfigFilesMap.get(extendedConfigFilePath);\n            if (existing) {\n                existing.projects.add(projectPath);\n            }\n            else {\n                // start watching previously unseen extended config\n                extendedConfigFilesMap.set(extendedConfigFilePath, {\n                    projects: new ts.Set([projectPath]),\n                    fileWatcher: createExtendedConfigFileWatch(extendedConfigFileName, extendedConfigFilePath),\n                    close: function () {\n                        var existing = extendedConfigFilesMap.get(extendedConfigFilePath);\n                        if (!existing || existing.projects.size !== 0)\n                            return;\n                        existing.fileWatcher.close();\n                        extendedConfigFilesMap.delete(extendedConfigFilePath);\n                    },\n                });\n            }\n        });\n    }\n    ts.updateSharedExtendedConfigFileWatcher = updateSharedExtendedConfigFileWatcher;\n    /**\n     * Updates the existing missing file watches with the new set of missing files after new program is created\n     */\n    function updateMissingFilePathsWatch(program, missingFileWatches, createMissingFileWatch) {\n        var missingFilePaths = program.getMissingFilePaths();\n        // TODO(rbuckton): Should be a `Set` but that requires changing the below code that uses `mutateMap`\n        var newMissingFilePathMap = ts.arrayToMap(missingFilePaths, ts.identity, ts.returnTrue);\n        // Update the missing file paths watcher\n        ts.mutateMap(missingFileWatches, newMissingFilePathMap, {\n            // Watch the missing files\n            createNewValue: createMissingFileWatch,\n            // Files that are no longer missing (e.g. because they are no longer required)\n            // should no longer be watched.\n            onDeleteValue: ts.closeFileWatcher\n        });\n    }\n    ts.updateMissingFilePathsWatch = updateMissingFilePathsWatch;\n    /**\n     * Updates the existing wild card directory watches with the new set of wild card directories from the config file\n     * after new program is created because the config file was reloaded or program was created first time from the config file\n     * Note that there is no need to call this function when the program is updated with additional files without reloading config files,\n     * as wildcard directories wont change unless reloading config file\n     */\n    function updateWatchingWildcardDirectories(existingWatchedForWildcards, wildcardDirectories, watchDirectory) {\n        ts.mutateMap(existingWatchedForWildcards, wildcardDirectories, {\n            // Create new watch and recursive info\n            createNewValue: createWildcardDirectoryWatcher,\n            // Close existing watch thats not needed any more\n            onDeleteValue: closeFileWatcherOf,\n            // Close existing watch that doesnt match in the flags\n            onExistingValue: updateWildcardDirectoryWatcher\n        });\n        function createWildcardDirectoryWatcher(directory, flags) {\n            // Create new watch and recursive info\n            return {\n                watcher: watchDirectory(directory, flags),\n                flags: flags\n            };\n        }\n        function updateWildcardDirectoryWatcher(existingWatcher, flags, directory) {\n            // Watcher needs to be updated if the recursive flags dont match\n            if (existingWatcher.flags === flags) {\n                return;\n            }\n            existingWatcher.watcher.close();\n            existingWatchedForWildcards.set(directory, createWildcardDirectoryWatcher(directory, flags));\n        }\n    }\n    ts.updateWatchingWildcardDirectories = updateWatchingWildcardDirectories;\n    /* @internal */\n    function isIgnoredFileFromWildCardWatching(_a) {\n        var watchedDirPath = _a.watchedDirPath, fileOrDirectory = _a.fileOrDirectory, fileOrDirectoryPath = _a.fileOrDirectoryPath, configFileName = _a.configFileName, options = _a.options, program = _a.program, extraFileExtensions = _a.extraFileExtensions, currentDirectory = _a.currentDirectory, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, writeLog = _a.writeLog;\n        var newPath = ts.removeIgnoredPath(fileOrDirectoryPath);\n        if (!newPath) {\n            writeLog(\"Project: \" + configFileName + \" Detected ignored path: \" + fileOrDirectory);\n            return true;\n        }\n        fileOrDirectoryPath = newPath;\n        if (fileOrDirectoryPath === watchedDirPath)\n            return false;\n        // If the the added or created file or directory is not supported file name, ignore the file\n        // But when watched directory is added/removed, we need to reload the file list\n        if (ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {\n            writeLog(\"Project: \" + configFileName + \" Detected file add/remove of non supported extension: \" + fileOrDirectory);\n            return true;\n        }\n        if (ts.isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) {\n            writeLog(\"Project: \" + configFileName + \" Detected excluded file: \" + fileOrDirectory);\n            return true;\n        }\n        if (!program)\n            return false;\n        // We want to ignore emit file check if file is not going to be emitted next to source file\n        // In that case we follow config file inclusion rules\n        if (options.outFile || options.outDir)\n            return false;\n        // File if emitted next to input needs to be ignored\n        if (ts.fileExtensionIs(fileOrDirectoryPath, \".d.ts\" /* Dts */)) {\n            // If its declaration directory: its not ignored if not excluded by config\n            if (options.declarationDir)\n                return false;\n        }\n        else if (!ts.fileExtensionIsOneOf(fileOrDirectoryPath, ts.supportedJSExtensions)) {\n            return false;\n        }\n        // just check if sourceFile with the name exists\n        var filePathWithoutExtension = ts.removeFileExtension(fileOrDirectoryPath);\n        var realProgram = isBuilderProgram(program) ? program.getProgramOrUndefined() : program;\n        if (hasSourceFile((filePathWithoutExtension + \".ts\" /* Ts */)) ||\n            hasSourceFile((filePathWithoutExtension + \".tsx\" /* Tsx */))) {\n            writeLog(\"Project: \" + configFileName + \" Detected output file: \" + fileOrDirectory);\n            return true;\n        }\n        return false;\n        function hasSourceFile(file) {\n            return realProgram ?\n                !!realProgram.getSourceFileByPath(file) :\n                program.getState().fileInfos.has(file);\n        }\n    }\n    ts.isIgnoredFileFromWildCardWatching = isIgnoredFileFromWildCardWatching;\n    function isBuilderProgram(program) {\n        return !!program.getState;\n    }\n    function isEmittedFileOfProgram(program, file) {\n        if (!program) {\n            return false;\n        }\n        return program.isEmittedFile(file);\n    }\n    ts.isEmittedFileOfProgram = isEmittedFileOfProgram;\n    var WatchLogLevel;\n    (function (WatchLogLevel) {\n        WatchLogLevel[WatchLogLevel[\"None\"] = 0] = \"None\";\n        WatchLogLevel[WatchLogLevel[\"TriggerOnly\"] = 1] = \"TriggerOnly\";\n        WatchLogLevel[WatchLogLevel[\"Verbose\"] = 2] = \"Verbose\";\n    })(WatchLogLevel = ts.WatchLogLevel || (ts.WatchLogLevel = {}));\n    function getWatchFactory(host, watchLogLevel, log, getDetailWatchInfo) {\n        ts.setSysLog(watchLogLevel === WatchLogLevel.Verbose ? log : ts.noop);\n        var plainInvokeFactory = {\n            watchFile: function (file, callback, pollingInterval, options) { return host.watchFile(file, callback, pollingInterval, options); },\n            watchDirectory: function (directory, callback, flags, options) { return host.watchDirectory(directory, callback, (flags & 1 /* Recursive */) !== 0, options); },\n        };\n        var triggerInvokingFactory = watchLogLevel !== WatchLogLevel.None ?\n            {\n                watchFile: createTriggerLoggingAddWatch(\"watchFile\"),\n                watchDirectory: createTriggerLoggingAddWatch(\"watchDirectory\")\n            } :\n            undefined;\n        var factory = watchLogLevel === WatchLogLevel.Verbose ?\n            {\n                watchFile: createFileWatcherWithLogging,\n                watchDirectory: createDirectoryWatcherWithLogging\n            } :\n            triggerInvokingFactory || plainInvokeFactory;\n        var excludeWatcherFactory = watchLogLevel === WatchLogLevel.Verbose ?\n            createExcludeWatcherWithLogging :\n            ts.returnNoopFileWatcher;\n        return {\n            watchFile: createExcludeHandlingAddWatch(\"watchFile\"),\n            watchDirectory: createExcludeHandlingAddWatch(\"watchDirectory\")\n        };\n        function createExcludeHandlingAddWatch(key) {\n            return function (file, cb, flags, options, detailInfo1, detailInfo2) {\n                var _a;\n                return !ts.matchesExclude(file, key === \"watchFile\" ? options === null || options === void 0 ? void 0 : options.excludeFiles : options === null || options === void 0 ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames(), ((_a = host.getCurrentDirectory) === null || _a === void 0 ? void 0 : _a.call(host)) || \"\") ?\n                    factory[key].call(/*thisArgs*/ undefined, file, cb, flags, options, detailInfo1, detailInfo2) :\n                    excludeWatcherFactory(file, flags, options, detailInfo1, detailInfo2);\n            };\n        }\n        function useCaseSensitiveFileNames() {\n            return typeof host.useCaseSensitiveFileNames === \"boolean\" ?\n                host.useCaseSensitiveFileNames :\n                host.useCaseSensitiveFileNames();\n        }\n        function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {\n            log(\"ExcludeWatcher:: Added:: \" + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));\n            return {\n                close: function () { return log(\"ExcludeWatcher:: Close:: \" + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)); }\n            };\n        }\n        function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {\n            log(\"FileWatcher:: Added:: \" + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));\n            var watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2);\n            return {\n                close: function () {\n                    log(\"FileWatcher:: Close:: \" + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));\n                    watcher.close();\n                }\n            };\n        }\n        function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {\n            var watchInfo = \"DirectoryWatcher:: Added:: \" + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);\n            log(watchInfo);\n            var start = ts.timestamp();\n            var watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2);\n            var elapsed = ts.timestamp() - start;\n            log(\"Elapsed:: \" + elapsed + \"ms \" + watchInfo);\n            return {\n                close: function () {\n                    var watchInfo = \"DirectoryWatcher:: Close:: \" + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);\n                    log(watchInfo);\n                    var start = ts.timestamp();\n                    watcher.close();\n                    var elapsed = ts.timestamp() - start;\n                    log(\"Elapsed:: \" + elapsed + \"ms \" + watchInfo);\n                }\n            };\n        }\n        function createTriggerLoggingAddWatch(key) {\n            return function (file, cb, flags, options, detailInfo1, detailInfo2) { return plainInvokeFactory[key].call(/*thisArgs*/ undefined, file, function () {\n                var args = [];\n                for (var _i = 0; _i < arguments.length; _i++) {\n                    args[_i] = arguments[_i];\n                }\n                var triggerredInfo = (key === \"watchFile\" ? \"FileWatcher\" : \"DirectoryWatcher\") + \":: Triggered with \" + args[0] + \" \" + (args[1] !== undefined ? args[1] : \"\") + \":: \" + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);\n                log(triggerredInfo);\n                var start = ts.timestamp();\n                cb.call.apply(cb, __spreadArray([/*thisArg*/ undefined], args));\n                var elapsed = ts.timestamp() - start;\n                log(\"Elapsed:: \" + elapsed + \"ms \" + triggerredInfo);\n            }, flags, options, detailInfo1, detailInfo2); };\n        }\n        function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo) {\n            return \"WatchInfo: \" + file + \" \" + flags + \" \" + JSON.stringify(options) + \" \" + (getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : detailInfo1 + \" \" + detailInfo2);\n        }\n    }\n    ts.getWatchFactory = getWatchFactory;\n    function getFallbackOptions(options) {\n        var fallbackPolling = options === null || options === void 0 ? void 0 : options.fallbackPolling;\n        return {\n            watchFile: fallbackPolling !== undefined ?\n                fallbackPolling :\n                ts.WatchFileKind.PriorityPollingInterval\n        };\n    }\n    ts.getFallbackOptions = getFallbackOptions;\n    function closeFileWatcherOf(objWithWatcher) {\n        objWithWatcher.watcher.close();\n    }\n    ts.closeFileWatcherOf = closeFileWatcherOf;\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    function findConfigFile(searchPath, fileExists, configName) {\n        if (configName === void 0) { configName = \"tsconfig.json\"; }\n        return ts.forEachAncestorDirectory(searchPath, function (ancestor) {\n            var fileName = ts.combinePaths(ancestor, configName);\n            return fileExists(fileName) ? fileName : undefined;\n        });\n    }\n    ts.findConfigFile = findConfigFile;\n    function resolveTripleslashReference(moduleName, containingFile) {\n        var basePath = ts.getDirectoryPath(containingFile);\n        var referencedFileName = ts.isRootedDiskPath(moduleName) ? moduleName : ts.combinePaths(basePath, moduleName);\n        return ts.normalizePath(referencedFileName);\n    }\n    ts.resolveTripleslashReference = resolveTripleslashReference;\n    /* @internal */\n    function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, getCanonicalFileName) {\n        var commonPathComponents;\n        var failed = ts.forEach(fileNames, function (sourceFile) {\n            // Each file contributes into common source file path\n            var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile, currentDirectory);\n            sourcePathComponents.pop(); // The base file name is not part of the common directory path\n            if (!commonPathComponents) {\n                // first file\n                commonPathComponents = sourcePathComponents;\n                return;\n            }\n            var n = Math.min(commonPathComponents.length, sourcePathComponents.length);\n            for (var i = 0; i < n; i++) {\n                if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) {\n                    if (i === 0) {\n                        // Failed to find any common path component\n                        return true;\n                    }\n                    // New common path found that is 0 -> i-1\n                    commonPathComponents.length = i;\n                    break;\n                }\n            }\n            // If the sourcePathComponents was shorter than the commonPathComponents, truncate to the sourcePathComponents\n            if (sourcePathComponents.length < commonPathComponents.length) {\n                commonPathComponents.length = sourcePathComponents.length;\n            }\n        });\n        // A common path can not be found when paths span multiple drives on windows, for example\n        if (failed) {\n            return \"\";\n        }\n        if (!commonPathComponents) { // Can happen when all input files are .d.ts files\n            return currentDirectory;\n        }\n        return ts.getPathFromPathComponents(commonPathComponents);\n    }\n    ts.computeCommonSourceDirectoryOfFilenames = computeCommonSourceDirectoryOfFilenames;\n    function createCompilerHost(options, setParentNodes) {\n        return createCompilerHostWorker(options, setParentNodes);\n    }\n    ts.createCompilerHost = createCompilerHost;\n    /*@internal*/\n    // TODO(shkamat): update this after reworking ts build API\n    function createCompilerHostWorker(options, setParentNodes, system) {\n        if (system === void 0) { system = ts.sys; }\n        var existingDirectories = new ts.Map();\n        var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames);\n        var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash;\n        function getSourceFile(fileName, languageVersion, onError) {\n            var text;\n            try {\n                ts.performance.mark(\"beforeIORead\");\n                text = compilerHost.readFile(fileName);\n                ts.performance.mark(\"afterIORead\");\n                ts.performance.measure(\"I/O Read\", \"beforeIORead\", \"afterIORead\");\n            }\n            catch (e) {\n                if (onError) {\n                    onError(e.message);\n                }\n                text = \"\";\n            }\n            return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined;\n        }\n        function directoryExists(directoryPath) {\n            if (existingDirectories.has(directoryPath)) {\n                return true;\n            }\n            if ((compilerHost.directoryExists || system.directoryExists)(directoryPath)) {\n                existingDirectories.set(directoryPath, true);\n                return true;\n            }\n            return false;\n        }\n        function writeFile(fileName, data, writeByteOrderMark, onError) {\n            try {\n                ts.performance.mark(\"beforeIOWrite\");\n                // NOTE: If patchWriteFileEnsuringDirectory has been called,\n                // the system.writeFile will do its own directory creation and\n                // the ensureDirectoriesExist call will always be redundant.\n                ts.writeFileEnsuringDirectories(fileName, data, writeByteOrderMark, function (path, data, writeByteOrderMark) { return writeFileWorker(path, data, writeByteOrderMark); }, function (path) { return (compilerHost.createDirectory || system.createDirectory)(path); }, function (path) { return directoryExists(path); });\n                ts.performance.mark(\"afterIOWrite\");\n                ts.performance.measure(\"I/O Write\", \"beforeIOWrite\", \"afterIOWrite\");\n            }\n            catch (e) {\n                if (onError) {\n                    onError(e.message);\n                }\n            }\n        }\n        var outputFingerprints;\n        function writeFileWorker(fileName, data, writeByteOrderMark) {\n            if (!ts.isWatchSet(options) || !system.getModifiedTime) {\n                system.writeFile(fileName, data, writeByteOrderMark);\n                return;\n            }\n            if (!outputFingerprints) {\n                outputFingerprints = new ts.Map();\n            }\n            var hash = computeHash(data);\n            var mtimeBefore = system.getModifiedTime(fileName);\n            if (mtimeBefore) {\n                var fingerprint = outputFingerprints.get(fileName);\n                // If output has not been changed, and the file has no external modification\n                if (fingerprint &&\n                    fingerprint.byteOrderMark === writeByteOrderMark &&\n                    fingerprint.hash === hash &&\n                    fingerprint.mtime.getTime() === mtimeBefore.getTime()) {\n                    return;\n                }\n            }\n            system.writeFile(fileName, data, writeByteOrderMark);\n            var mtimeAfter = system.getModifiedTime(fileName) || ts.missingFileModifiedTime;\n            outputFingerprints.set(fileName, {\n                hash: hash,\n                byteOrderMark: writeByteOrderMark,\n                mtime: mtimeAfter\n            });\n        }\n        function getDefaultLibLocation() {\n            return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath()));\n        }\n        var newLine = ts.getNewLineCharacter(options, function () { return system.newLine; });\n        var realpath = system.realpath && (function (path) { return system.realpath(path); });\n        var compilerHost = {\n            getSourceFile: getSourceFile,\n            getDefaultLibLocation: getDefaultLibLocation,\n            getDefaultLibFileName: function (options) { return ts.combinePaths(getDefaultLibLocation(), ts.getDefaultLibFileName(options)); },\n            writeFile: writeFile,\n            getCurrentDirectory: ts.memoize(function () { return system.getCurrentDirectory(); }),\n            useCaseSensitiveFileNames: function () { return system.useCaseSensitiveFileNames; },\n            getCanonicalFileName: getCanonicalFileName,\n            getNewLine: function () { return newLine; },\n            fileExists: function (fileName) { return system.fileExists(fileName); },\n            readFile: function (fileName) { return system.readFile(fileName); },\n            trace: function (s) { return system.write(s + newLine); },\n            directoryExists: function (directoryName) { return system.directoryExists(directoryName); },\n            getEnvironmentVariable: function (name) { return system.getEnvironmentVariable ? system.getEnvironmentVariable(name) : \"\"; },\n            getDirectories: function (path) { return system.getDirectories(path); },\n            realpath: realpath,\n            readDirectory: function (path, extensions, include, exclude, depth) { return system.readDirectory(path, extensions, include, exclude, depth); },\n            createDirectory: function (d) { return system.createDirectory(d); },\n            createHash: ts.maybeBind(system, system.createHash)\n        };\n        return compilerHost;\n    }\n    ts.createCompilerHostWorker = createCompilerHostWorker;\n    /*@internal*/\n    function changeCompilerHostLikeToUseCache(host, toPath, getSourceFile) {\n        var originalReadFile = host.readFile;\n        var originalFileExists = host.fileExists;\n        var originalDirectoryExists = host.directoryExists;\n        var originalCreateDirectory = host.createDirectory;\n        var originalWriteFile = host.writeFile;\n        var readFileCache = new ts.Map();\n        var fileExistsCache = new ts.Map();\n        var directoryExistsCache = new ts.Map();\n        var sourceFileCache = new ts.Map();\n        var readFileWithCache = function (fileName) {\n            var key = toPath(fileName);\n            var value = readFileCache.get(key);\n            if (value !== undefined)\n                return value !== false ? value : undefined;\n            return setReadFileCache(key, fileName);\n        };\n        var setReadFileCache = function (key, fileName) {\n            var newValue = originalReadFile.call(host, fileName);\n            readFileCache.set(key, newValue !== undefined ? newValue : false);\n            return newValue;\n        };\n        host.readFile = function (fileName) {\n            var key = toPath(fileName);\n            var value = readFileCache.get(key);\n            if (value !== undefined)\n                return value !== false ? value : undefined; // could be .d.ts from output\n            // Cache json or buildInfo\n            if (!ts.fileExtensionIs(fileName, \".json\" /* Json */) && !ts.isBuildInfoFile(fileName)) {\n                return originalReadFile.call(host, fileName);\n            }\n            return setReadFileCache(key, fileName);\n        };\n        var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersion, onError, shouldCreateNewSourceFile) {\n            var key = toPath(fileName);\n            var value = sourceFileCache.get(key);\n            if (value)\n                return value;\n            var sourceFile = getSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);\n            if (sourceFile && (ts.isDeclarationFileName(fileName) || ts.fileExtensionIs(fileName, \".json\" /* Json */))) {\n                sourceFileCache.set(key, sourceFile);\n            }\n            return sourceFile;\n        } : undefined;\n        // fileExists for any kind of extension\n        host.fileExists = function (fileName) {\n            var key = toPath(fileName);\n            var value = fileExistsCache.get(key);\n            if (value !== undefined)\n                return value;\n            var newValue = originalFileExists.call(host, fileName);\n            fileExistsCache.set(key, !!newValue);\n            return newValue;\n        };\n        if (originalWriteFile) {\n            host.writeFile = function (fileName, data, writeByteOrderMark, onError, sourceFiles) {\n                var key = toPath(fileName);\n                fileExistsCache.delete(key);\n                var value = readFileCache.get(key);\n                if (value !== undefined && value !== data) {\n                    readFileCache.delete(key);\n                    sourceFileCache.delete(key);\n                }\n                else if (getSourceFileWithCache) {\n                    var sourceFile = sourceFileCache.get(key);\n                    if (sourceFile && sourceFile.text !== data) {\n                        sourceFileCache.delete(key);\n                    }\n                }\n                originalWriteFile.call(host, fileName, data, writeByteOrderMark, onError, sourceFiles);\n            };\n        }\n        // directoryExists\n        if (originalDirectoryExists && originalCreateDirectory) {\n            host.directoryExists = function (directory) {\n                var key = toPath(directory);\n                var value = directoryExistsCache.get(key);\n                if (value !== undefined)\n                    return value;\n                var newValue = originalDirectoryExists.call(host, directory);\n                directoryExistsCache.set(key, !!newValue);\n                return newValue;\n            };\n            host.createDirectory = function (directory) {\n                var key = toPath(directory);\n                directoryExistsCache.delete(key);\n                originalCreateDirectory.call(host, directory);\n            };\n        }\n        return {\n            originalReadFile: originalReadFile,\n            originalFileExists: originalFileExists,\n            originalDirectoryExists: originalDirectoryExists,\n            originalCreateDirectory: originalCreateDirectory,\n            originalWriteFile: originalWriteFile,\n            getSourceFileWithCache: getSourceFileWithCache,\n            readFileWithCache: readFileWithCache\n        };\n    }\n    ts.changeCompilerHostLikeToUseCache = changeCompilerHostLikeToUseCache;\n    function getPreEmitDiagnostics(program, sourceFile, cancellationToken) {\n        var diagnostics;\n        diagnostics = ts.addRange(diagnostics, program.getConfigFileParsingDiagnostics());\n        diagnostics = ts.addRange(diagnostics, program.getOptionsDiagnostics(cancellationToken));\n        diagnostics = ts.addRange(diagnostics, program.getSyntacticDiagnostics(sourceFile, cancellationToken));\n        diagnostics = ts.addRange(diagnostics, program.getGlobalDiagnostics(cancellationToken));\n        diagnostics = ts.addRange(diagnostics, program.getSemanticDiagnostics(sourceFile, cancellationToken));\n        if (ts.getEmitDeclarations(program.getCompilerOptions())) {\n            diagnostics = ts.addRange(diagnostics, program.getDeclarationDiagnostics(sourceFile, cancellationToken));\n        }\n        return ts.sortAndDeduplicateDiagnostics(diagnostics || ts.emptyArray);\n    }\n    ts.getPreEmitDiagnostics = getPreEmitDiagnostics;\n    function formatDiagnostics(diagnostics, host) {\n        var output = \"\";\n        for (var _i = 0, diagnostics_3 = diagnostics; _i < diagnostics_3.length; _i++) {\n            var diagnostic = diagnostics_3[_i];\n            output += formatDiagnostic(diagnostic, host);\n        }\n        return output;\n    }\n    ts.formatDiagnostics = formatDiagnostics;\n    function formatDiagnostic(diagnostic, host) {\n        var errorMessage = ts.diagnosticCategoryName(diagnostic) + \" TS\" + diagnostic.code + \": \" + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) + host.getNewLine();\n        if (diagnostic.file) {\n            var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character; // TODO: GH#18217\n            var fileName = diagnostic.file.fileName;\n            var relativeFileName = ts.convertToRelativePath(fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); });\n            return relativeFileName + \"(\" + (line + 1) + \",\" + (character + 1) + \"): \" + errorMessage;\n        }\n        return errorMessage;\n    }\n    ts.formatDiagnostic = formatDiagnostic;\n    /** @internal */\n    var ForegroundColorEscapeSequences;\n    (function (ForegroundColorEscapeSequences) {\n        ForegroundColorEscapeSequences[\"Grey\"] = \"\\u001B[90m\";\n        ForegroundColorEscapeSequences[\"Red\"] = \"\\u001B[91m\";\n        ForegroundColorEscapeSequences[\"Yellow\"] = \"\\u001B[93m\";\n        ForegroundColorEscapeSequences[\"Blue\"] = \"\\u001B[94m\";\n        ForegroundColorEscapeSequences[\"Cyan\"] = \"\\u001B[96m\";\n    })(ForegroundColorEscapeSequences = ts.ForegroundColorEscapeSequences || (ts.ForegroundColorEscapeSequences = {}));\n    var gutterStyleSequence = \"\\u001b[7m\";\n    var gutterSeparator = \" \";\n    var resetEscapeSequence = \"\\u001b[0m\";\n    var ellipsis = \"...\";\n    var halfIndent = \"  \";\n    var indent = \"    \";\n    function getCategoryFormat(category) {\n        switch (category) {\n            case ts.DiagnosticCategory.Error: return ForegroundColorEscapeSequences.Red;\n            case ts.DiagnosticCategory.Warning: return ForegroundColorEscapeSequences.Yellow;\n            case ts.DiagnosticCategory.Suggestion: return ts.Debug.fail(\"Should never get an Info diagnostic on the command line.\");\n            case ts.DiagnosticCategory.Message: return ForegroundColorEscapeSequences.Blue;\n        }\n    }\n    /** @internal */\n    function formatColorAndReset(text, formatStyle) {\n        return formatStyle + text + resetEscapeSequence;\n    }\n    ts.formatColorAndReset = formatColorAndReset;\n    function formatCodeSpan(file, start, length, indent, squiggleColor, host) {\n        var _a = ts.getLineAndCharacterOfPosition(file, start), firstLine = _a.line, firstLineChar = _a.character;\n        var _b = ts.getLineAndCharacterOfPosition(file, start + length), lastLine = _b.line, lastLineChar = _b.character;\n        var lastLineInFile = ts.getLineAndCharacterOfPosition(file, file.text.length).line;\n        var hasMoreThanFiveLines = (lastLine - firstLine) >= 4;\n        var gutterWidth = (lastLine + 1 + \"\").length;\n        if (hasMoreThanFiveLines) {\n            gutterWidth = Math.max(ellipsis.length, gutterWidth);\n        }\n        var context = \"\";\n        for (var i = firstLine; i <= lastLine; i++) {\n            context += host.getNewLine();\n            // If the error spans over 5 lines, we'll only show the first 2 and last 2 lines,\n            // so we'll skip ahead to the second-to-last line.\n            if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) {\n                context += indent + formatColorAndReset(ts.padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine();\n                i = lastLine - 1;\n            }\n            var lineStart = ts.getPositionOfLineAndCharacter(file, i, 0);\n            var lineEnd = i < lastLineInFile ? ts.getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;\n            var lineContent = file.text.slice(lineStart, lineEnd);\n            lineContent = lineContent.replace(/\\s+$/g, \"\"); // trim from end\n            lineContent = lineContent.replace(/\\t/g, \" \"); // convert tabs to single spaces\n            // Output the gutter and the actual contents of the line.\n            context += indent + formatColorAndReset(ts.padLeft(i + 1 + \"\", gutterWidth), gutterStyleSequence) + gutterSeparator;\n            context += lineContent + host.getNewLine();\n            // Output the gutter and the error span for the line using tildes.\n            context += indent + formatColorAndReset(ts.padLeft(\"\", gutterWidth), gutterStyleSequence) + gutterSeparator;\n            context += squiggleColor;\n            if (i === firstLine) {\n                // If we're on the last line, then limit it to the last character of the last line.\n                // Otherwise, we'll just squiggle the rest of the line, giving 'slice' no end position.\n                var lastCharForLine = i === lastLine ? lastLineChar : undefined;\n                context += lineContent.slice(0, firstLineChar).replace(/\\S/g, \" \");\n                context += lineContent.slice(firstLineChar, lastCharForLine).replace(/./g, \"~\");\n            }\n            else if (i === lastLine) {\n                context += lineContent.slice(0, lastLineChar).replace(/./g, \"~\");\n            }\n            else {\n                // Squiggle the entire line.\n                context += lineContent.replace(/./g, \"~\");\n            }\n            context += resetEscapeSequence;\n        }\n        return context;\n    }\n    /* @internal */\n    function formatLocation(file, start, host, color) {\n        if (color === void 0) { color = formatColorAndReset; }\n        var _a = ts.getLineAndCharacterOfPosition(file, start), firstLine = _a.line, firstLineChar = _a.character; // TODO: GH#18217\n        var relativeFileName = host ? ts.convertToRelativePath(file.fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); }) : file.fileName;\n        var output = \"\";\n        output += color(relativeFileName, ForegroundColorEscapeSequences.Cyan);\n        output += \":\";\n        output += color(\"\" + (firstLine + 1), ForegroundColorEscapeSequences.Yellow);\n        output += \":\";\n        output += color(\"\" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);\n        return output;\n    }\n    ts.formatLocation = formatLocation;\n    function formatDiagnosticsWithColorAndContext(diagnostics, host) {\n        var output = \"\";\n        for (var _i = 0, diagnostics_4 = diagnostics; _i < diagnostics_4.length; _i++) {\n            var diagnostic = diagnostics_4[_i];\n            if (diagnostic.file) {\n                var file = diagnostic.file, start = diagnostic.start;\n                output += formatLocation(file, start, host); // TODO: GH#18217\n                output += \" - \";\n            }\n            output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));\n            output += formatColorAndReset(\" TS\" + diagnostic.code + \": \", ForegroundColorEscapeSequences.Grey);\n            output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());\n            if (diagnostic.file) {\n                output += host.getNewLine();\n                output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, \"\", getCategoryFormat(diagnostic.category), host); // TODO: GH#18217\n            }\n            if (diagnostic.relatedInformation) {\n                output += host.getNewLine();\n                for (var _a = 0, _b = diagnostic.relatedInformation; _a < _b.length; _a++) {\n                    var _c = _b[_a], file = _c.file, start = _c.start, length_9 = _c.length, messageText = _c.messageText;\n                    if (file) {\n                        output += host.getNewLine();\n                        output += halfIndent + formatLocation(file, start, host); // TODO: GH#18217\n                        output += formatCodeSpan(file, start, length_9, indent, ForegroundColorEscapeSequences.Cyan, host); // TODO: GH#18217\n                    }\n                    output += host.getNewLine();\n                    output += indent + flattenDiagnosticMessageText(messageText, host.getNewLine());\n                }\n            }\n            output += host.getNewLine();\n        }\n        return output;\n    }\n    ts.formatDiagnosticsWithColorAndContext = formatDiagnosticsWithColorAndContext;\n    function flattenDiagnosticMessageText(diag, newLine, indent) {\n        if (indent === void 0) { indent = 0; }\n        if (ts.isString(diag)) {\n            return diag;\n        }\n        else if (diag === undefined) {\n            return \"\";\n        }\n        var result = \"\";\n        if (indent) {\n            result += newLine;\n            for (var i = 0; i < indent; i++) {\n                result += \"  \";\n            }\n        }\n        result += diag.messageText;\n        indent++;\n        if (diag.next) {\n            for (var _i = 0, _a = diag.next; _i < _a.length; _i++) {\n                var kid = _a[_i];\n                result += flattenDiagnosticMessageText(kid, newLine, indent);\n            }\n        }\n        return result;\n    }\n    ts.flattenDiagnosticMessageText = flattenDiagnosticMessageText;\n    /* @internal */\n    function loadWithLocalCache(names, containingFile, redirectedReference, loader) {\n        if (names.length === 0) {\n            return [];\n        }\n        var resolutions = [];\n        var cache = new ts.Map();\n        for (var _i = 0, names_2 = names; _i < names_2.length; _i++) {\n            var name = names_2[_i];\n            var result = void 0;\n            if (cache.has(name)) {\n                result = cache.get(name);\n            }\n            else {\n                cache.set(name, result = loader(name, containingFile, redirectedReference));\n            }\n            resolutions.push(result);\n        }\n        return resolutions;\n    }\n    ts.loadWithLocalCache = loadWithLocalCache;\n    /* @internal */\n    function forEachResolvedProjectReference(resolvedProjectReferences, cb) {\n        return forEachProjectReference(/*projectReferences*/ undefined, resolvedProjectReferences, function (resolvedRef, parent) { return resolvedRef && cb(resolvedRef, parent); });\n    }\n    ts.forEachResolvedProjectReference = forEachResolvedProjectReference;\n    function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) {\n        var seenResolvedRefs;\n        return worker(projectReferences, resolvedProjectReferences, /*parent*/ undefined);\n        function worker(projectReferences, resolvedProjectReferences, parent) {\n            // Visit project references first\n            if (cbRef) {\n                var result = cbRef(projectReferences, parent);\n                if (result) {\n                    return result;\n                }\n            }\n            return ts.forEach(resolvedProjectReferences, function (resolvedRef, index) {\n                if (resolvedRef && (seenResolvedRefs === null || seenResolvedRefs === void 0 ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) {\n                    // ignore recursives\n                    return undefined;\n                }\n                var result = cbResolvedRef(resolvedRef, parent, index);\n                if (result || !resolvedRef)\n                    return result;\n                (seenResolvedRefs || (seenResolvedRefs = new ts.Set())).add(resolvedRef.sourceFile.path);\n                return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef);\n            });\n        }\n    }\n    /* @internal */\n    ts.inferredTypesContainingFile = \"__inferred type names__.ts\";\n    /*@internal*/\n    function isReferencedFile(reason) {\n        switch (reason === null || reason === void 0 ? void 0 : reason.kind) {\n            case ts.FileIncludeKind.Import:\n            case ts.FileIncludeKind.ReferenceFile:\n            case ts.FileIncludeKind.TypeReferenceDirective:\n            case ts.FileIncludeKind.LibReferenceDirective:\n                return true;\n            default:\n                return false;\n        }\n    }\n    ts.isReferencedFile = isReferencedFile;\n    /*@internal*/\n    function isReferenceFileLocation(location) {\n        return location.pos !== undefined;\n    }\n    ts.isReferenceFileLocation = isReferenceFileLocation;\n    /*@internal*/\n    function getReferencedFileLocation(getSourceFileByPath, ref) {\n        var _a, _b, _c;\n        var _d, _e, _f, _g;\n        var file = ts.Debug.checkDefined(getSourceFileByPath(ref.file));\n        var kind = ref.kind, index = ref.index;\n        var pos, end, packageId;\n        switch (kind) {\n            case ts.FileIncludeKind.Import:\n                var importLiteral = getModuleNameStringLiteralAt(file, index);\n                packageId = (_e = (_d = file.resolvedModules) === null || _d === void 0 ? void 0 : _d.get(importLiteral.text)) === null || _e === void 0 ? void 0 : _e.packageId;\n                if (importLiteral.pos === -1)\n                    return { file: file, packageId: packageId, text: importLiteral.text };\n                pos = ts.skipTrivia(file.text, importLiteral.pos);\n                end = importLiteral.end;\n                break;\n            case ts.FileIncludeKind.ReferenceFile:\n                (_a = file.referencedFiles[index], pos = _a.pos, end = _a.end);\n                break;\n            case ts.FileIncludeKind.TypeReferenceDirective:\n                (_b = file.typeReferenceDirectives[index], pos = _b.pos, end = _b.end);\n                packageId = (_g = (_f = file.resolvedTypeReferenceDirectiveNames) === null || _f === void 0 ? void 0 : _f.get(ts.toFileNameLowerCase(file.typeReferenceDirectives[index].fileName))) === null || _g === void 0 ? void 0 : _g.packageId;\n                break;\n            case ts.FileIncludeKind.LibReferenceDirective:\n                (_c = file.libReferenceDirectives[index], pos = _c.pos, end = _c.end);\n                break;\n            default:\n                return ts.Debug.assertNever(kind);\n        }\n        return { file: file, pos: pos, end: end, packageId: packageId };\n    }\n    ts.getReferencedFileLocation = getReferencedFileLocation;\n    /**\n     * Determines if program structure is upto date or needs to be recreated\n     */\n    /* @internal */\n    function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, projectReferences) {\n        // If we haven't created a program yet or have changed automatic type directives, then it is not up-to-date\n        if (!program || (hasChangedAutomaticTypeDirectiveNames === null || hasChangedAutomaticTypeDirectiveNames === void 0 ? void 0 : hasChangedAutomaticTypeDirectiveNames())) {\n            return false;\n        }\n        // If root file names don't match\n        if (!ts.arrayIsEqualTo(program.getRootFileNames(), rootFileNames)) {\n            return false;\n        }\n        var seenResolvedRefs;\n        // If project references don't match\n        if (!ts.arrayIsEqualTo(program.getProjectReferences(), projectReferences, projectReferenceUptoDate)) {\n            return false;\n        }\n        // If any file is not up-to-date, then the whole program is not up-to-date\n        if (program.getSourceFiles().some(sourceFileNotUptoDate)) {\n            return false;\n        }\n        // If any of the missing file paths are now created\n        if (program.getMissingFilePaths().some(fileExists)) {\n            return false;\n        }\n        var currentOptions = program.getCompilerOptions();\n        // If the compilation settings do no match, then the program is not up-to-date\n        if (!ts.compareDataObjects(currentOptions, newOptions)) {\n            return false;\n        }\n        // If everything matches but the text of config file is changed,\n        // error locations can change for program options, so update the program\n        if (currentOptions.configFile && newOptions.configFile) {\n            return currentOptions.configFile.text === newOptions.configFile.text;\n        }\n        return true;\n        function sourceFileNotUptoDate(sourceFile) {\n            return !sourceFileVersionUptoDate(sourceFile) ||\n                hasInvalidatedResolution(sourceFile.path);\n        }\n        function sourceFileVersionUptoDate(sourceFile) {\n            return sourceFile.version === getSourceVersion(sourceFile.resolvedPath, sourceFile.fileName);\n        }\n        function projectReferenceUptoDate(oldRef, newRef, index) {\n            if (!ts.projectReferenceIsEqualTo(oldRef, newRef)) {\n                return false;\n            }\n            return resolvedProjectReferenceUptoDate(program.getResolvedProjectReferences()[index], oldRef);\n        }\n        function resolvedProjectReferenceUptoDate(oldResolvedRef, oldRef) {\n            if (oldResolvedRef) {\n                if (ts.contains(seenResolvedRefs, oldResolvedRef)) {\n                    // Assume true\n                    return true;\n                }\n                // If sourceFile for the oldResolvedRef existed, check the version for uptodate\n                if (!sourceFileVersionUptoDate(oldResolvedRef.sourceFile)) {\n                    return false;\n                }\n                // Add to seen before checking the referenced paths of this config file\n                (seenResolvedRefs || (seenResolvedRefs = [])).push(oldResolvedRef);\n                // If child project references are upto date, this project reference is uptodate\n                return !ts.forEach(oldResolvedRef.references, function (childResolvedRef, index) {\n                    return !resolvedProjectReferenceUptoDate(childResolvedRef, oldResolvedRef.commandLine.projectReferences[index]);\n                });\n            }\n            // In old program, not able to resolve project reference path,\n            // so if config file doesnt exist, it is uptodate.\n            return !fileExists(resolveProjectReferencePath(oldRef));\n        }\n    }\n    ts.isProgramUptoDate = isProgramUptoDate;\n    function getConfigFileParsingDiagnostics(configFileParseResult) {\n        return configFileParseResult.options.configFile ? __spreadArray(__spreadArray([], configFileParseResult.options.configFile.parseDiagnostics), configFileParseResult.errors) :\n            configFileParseResult.errors;\n    }\n    ts.getConfigFileParsingDiagnostics = getConfigFileParsingDiagnostics;\n    /**\n     * Determine if source file needs to be re-created even if its text hasn't changed\n     */\n    function shouldProgramCreateNewSourceFiles(program, newOptions) {\n        if (!program)\n            return false;\n        // If any compiler options change, we can't reuse old source file even if version match\n        // The change in options like these could result in change in syntax tree or `sourceFile.bindDiagnostics`.\n        var oldOptions = program.getCompilerOptions();\n        return !!ts.sourceFileAffectingCompilerOptions.some(function (option) {\n            return !ts.isJsonEqual(ts.getCompilerOptionValue(oldOptions, option), ts.getCompilerOptionValue(newOptions, option));\n        });\n    }\n    function createCreateProgramOptions(rootNames, options, host, oldProgram, configFileParsingDiagnostics) {\n        return {\n            rootNames: rootNames,\n            options: options,\n            host: host,\n            oldProgram: oldProgram,\n            configFileParsingDiagnostics: configFileParsingDiagnostics\n        };\n    }\n    function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {\n        var _a, _b, _c;\n        var createProgramOptions = ts.isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions; // TODO: GH#18217\n        var rootNames = createProgramOptions.rootNames, options = createProgramOptions.options, configFileParsingDiagnostics = createProgramOptions.configFileParsingDiagnostics, projectReferences = createProgramOptions.projectReferences;\n        var oldProgram = createProgramOptions.oldProgram;\n        var processingDefaultLibFiles;\n        var processingOtherFiles;\n        var files;\n        var symlinks;\n        var commonSourceDirectory;\n        var diagnosticsProducingTypeChecker;\n        var noDiagnosticsTypeChecker;\n        var classifiableNames;\n        var ambientModuleNameToUnmodifiedFileName = new ts.Map();\n        var fileReasons = ts.createMultiMap();\n        var cachedBindAndCheckDiagnosticsForFile = {};\n        var cachedDeclarationDiagnosticsForFile = {};\n        var resolvedTypeReferenceDirectives = new ts.Map();\n        var fileProcessingDiagnostics;\n        // The below settings are to track if a .js file should be add to the program if loaded via searching under node_modules.\n        // This works as imported modules are discovered recursively in a depth first manner, specifically:\n        // - For each root file, findSourceFile is called.\n        // - This calls processImportedModules for each module imported in the source file.\n        // - This calls resolveModuleNames, and then calls findSourceFile for each resolved module.\n        // As all these operations happen - and are nested - within the createProgram call, they close over the below variables.\n        // The current resolution depth is tracked by incrementing/decrementing as the depth first search progresses.\n        var maxNodeModuleJsDepth = typeof options.maxNodeModuleJsDepth === \"number\" ? options.maxNodeModuleJsDepth : 0;\n        var currentNodeModulesDepth = 0;\n        // If a module has some of its imports skipped due to being at the depth limit under node_modules, then track\n        // this, as it may be imported at a shallower depth later, and then it will need its skipped imports processed.\n        var modulesWithElidedImports = new ts.Map();\n        // Track source files that are source files found by searching under node_modules, as these shouldn't be compiled.\n        var sourceFilesFoundSearchingNodeModules = new ts.Map();\n        ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"program\" /* Program */, \"createProgram\", { configFilePath: options.configFilePath, rootDir: options.rootDir }, /*separateBeginAndEnd*/ true);\n        ts.performance.mark(\"beforeProgram\");\n        var host = createProgramOptions.host || createCompilerHost(options);\n        var configParsingHost = parseConfigHostFromCompilerHostLike(host);\n        var skipDefaultLib = options.noLib;\n        var getDefaultLibraryFileName = ts.memoize(function () { return host.getDefaultLibFileName(options); });\n        var defaultLibraryPath = host.getDefaultLibLocation ? host.getDefaultLibLocation() : ts.getDirectoryPath(getDefaultLibraryFileName());\n        var programDiagnostics = ts.createDiagnosticCollection();\n        var currentDirectory = host.getCurrentDirectory();\n        var supportedExtensions = ts.getSupportedExtensions(options);\n        var supportedExtensionsWithJsonIfResolveJsonModule = ts.getSuppoertedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions);\n        // Map storing if there is emit blocking diagnostics for given input\n        var hasEmitBlockingDiagnostics = new ts.Map();\n        var _compilerOptionsObjectLiteralSyntax;\n        var moduleResolutionCache;\n        var actualResolveModuleNamesWorker;\n        var hasInvalidatedResolution = host.hasInvalidatedResolution || ts.returnFalse;\n        if (host.resolveModuleNames) {\n            actualResolveModuleNamesWorker = function (moduleNames, containingFile, reusedNames, redirectedReference) { return host.resolveModuleNames(ts.Debug.checkEachDefined(moduleNames), containingFile, reusedNames, redirectedReference, options).map(function (resolved) {\n                // An older host may have omitted extension, in which case we should infer it from the file extension of resolvedFileName.\n                if (!resolved || resolved.extension !== undefined) {\n                    return resolved;\n                }\n                var withExtension = ts.clone(resolved);\n                withExtension.extension = ts.extensionFromPath(resolved.resolvedFileName);\n                return withExtension;\n            }); };\n        }\n        else {\n            moduleResolutionCache = ts.createModuleResolutionCache(currentDirectory, function (x) { return host.getCanonicalFileName(x); }, options);\n            var loader_1 = function (moduleName, containingFile, redirectedReference) { return ts.resolveModuleName(moduleName, containingFile, options, host, moduleResolutionCache, redirectedReference).resolvedModule; }; // TODO: GH#18217\n            actualResolveModuleNamesWorker = function (moduleNames, containingFile, _reusedNames, redirectedReference) { return loadWithLocalCache(ts.Debug.checkEachDefined(moduleNames), containingFile, redirectedReference, loader_1); };\n        }\n        var actualResolveTypeReferenceDirectiveNamesWorker;\n        if (host.resolveTypeReferenceDirectives) {\n            actualResolveTypeReferenceDirectiveNamesWorker = function (typeDirectiveNames, containingFile, redirectedReference) { return host.resolveTypeReferenceDirectives(ts.Debug.checkEachDefined(typeDirectiveNames), containingFile, redirectedReference, options); };\n        }\n        else {\n            var loader_2 = function (typesRef, containingFile, redirectedReference) { return ts.resolveTypeReferenceDirective(typesRef, containingFile, options, host, redirectedReference).resolvedTypeReferenceDirective; }; // TODO: GH#18217\n            actualResolveTypeReferenceDirectiveNamesWorker = function (typeReferenceDirectiveNames, containingFile, redirectedReference) { return loadWithLocalCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, loader_2); };\n        }\n        // Map from a stringified PackageId to the source file with that id.\n        // Only one source file may have a given packageId. Others become redirects (see createRedirectSourceFile).\n        // `packageIdToSourceFile` is only used while building the program, while `sourceFileToPackageName` and `isSourceFileTargetOfRedirect` are kept around.\n        var packageIdToSourceFile = new ts.Map();\n        // Maps from a SourceFile's `.path` to the name of the package it was imported with.\n        var sourceFileToPackageName = new ts.Map();\n        // Key is a file name. Value is the (non-empty, or undefined) list of files that redirect to it.\n        var redirectTargetsMap = ts.createMultiMap();\n        /**\n         * map with\n         * - SourceFile if present\n         * - false if sourceFile missing for source of project reference redirect\n         * - undefined otherwise\n         */\n        var filesByName = new ts.Map();\n        var missingFilePaths;\n        // stores 'filename -> file association' ignoring case\n        // used to track cases when two file names differ only in casing\n        var filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? new ts.Map() : undefined;\n        // A parallel array to projectReferences storing the results of reading in the referenced tsconfig files\n        var resolvedProjectReferences;\n        var projectReferenceRedirects;\n        var mapFromFileToProjectReferenceRedirects;\n        var mapFromToProjectReferenceRedirectSource;\n        var useSourceOfProjectReferenceRedirect = !!((_a = host.useSourceOfProjectReferenceRedirect) === null || _a === void 0 ? void 0 : _a.call(host)) &&\n            !options.disableSourceOfProjectReferenceRedirect;\n        var _d = updateHostForUseSourceOfProjectReferenceRedirect({\n            compilerHost: host,\n            getSymlinkCache: getSymlinkCache,\n            useSourceOfProjectReferenceRedirect: useSourceOfProjectReferenceRedirect,\n            toPath: toPath,\n            getResolvedProjectReferences: getResolvedProjectReferences,\n            getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect,\n            forEachResolvedProjectReference: forEachResolvedProjectReference\n        }), onProgramCreateComplete = _d.onProgramCreateComplete, fileExists = _d.fileExists, directoryExists = _d.directoryExists;\n        ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"program\" /* Program */, \"shouldProgramCreateNewSourceFiles\", { hasOldProgram: !!oldProgram });\n        var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options);\n        ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n        // We set `structuralIsReused` to `undefined` because `tryReuseStructureFromOldProgram` calls `tryReuseStructureFromOldProgram` which checks\n        // `structuralIsReused`, which would be a TDZ violation if it was not set in advance to `undefined`.\n        var structureIsReused;\n        ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"program\" /* Program */, \"tryReuseStructureFromOldProgram\", {});\n        structureIsReused = tryReuseStructureFromOldProgram(); // eslint-disable-line prefer-const\n        ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n        if (structureIsReused !== 2 /* Completely */) {\n            processingDefaultLibFiles = [];\n            processingOtherFiles = [];\n            if (projectReferences) {\n                if (!resolvedProjectReferences) {\n                    resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile);\n                }\n                if (rootNames.length) {\n                    resolvedProjectReferences === null || resolvedProjectReferences === void 0 ? void 0 : resolvedProjectReferences.forEach(function (parsedRef, index) {\n                        if (!parsedRef)\n                            return;\n                        var out = ts.outFile(parsedRef.commandLine.options);\n                        if (useSourceOfProjectReferenceRedirect) {\n                            if (out || ts.getEmitModuleKind(parsedRef.commandLine.options) === ts.ModuleKind.None) {\n                                for (var _i = 0, _a = parsedRef.commandLine.fileNames; _i < _a.length; _i++) {\n                                    var fileName = _a[_i];\n                                    processProjectReferenceFile(fileName, { kind: ts.FileIncludeKind.SourceFromProjectReference, index: index });\n                                }\n                            }\n                        }\n                        else {\n                            if (out) {\n                                processProjectReferenceFile(ts.changeExtension(out, \".d.ts\"), { kind: ts.FileIncludeKind.OutputFromProjectReference, index: index });\n                            }\n                            else if (ts.getEmitModuleKind(parsedRef.commandLine.options) === ts.ModuleKind.None) {\n                                var getCommonSourceDirectory_2 = ts.memoize(function () { return ts.getCommonSourceDirectoryOfConfig(parsedRef.commandLine, !host.useCaseSensitiveFileNames()); });\n                                for (var _b = 0, _c = parsedRef.commandLine.fileNames; _b < _c.length; _b++) {\n                                    var fileName = _c[_b];\n                                    if (!ts.fileExtensionIs(fileName, \".d.ts\" /* Dts */) && !ts.fileExtensionIs(fileName, \".json\" /* Json */)) {\n                                        processProjectReferenceFile(ts.getOutputDeclarationFileName(fileName, parsedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory_2), { kind: ts.FileIncludeKind.OutputFromProjectReference, index: index });\n                                    }\n                                }\n                            }\n                        }\n                    });\n                }\n            }\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"program\" /* Program */, \"processRootFiles\", { count: rootNames.length });\n            ts.forEach(rootNames, function (name, index) { return processRootFile(name, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, { kind: ts.FileIncludeKind.RootFile, index: index }); });\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n            // load type declarations specified via 'types' argument or implicitly from types/ and node_modules/@types folders\n            var typeReferences = rootNames.length ? ts.getAutomaticTypeDirectiveNames(options, host) : ts.emptyArray;\n            if (typeReferences.length) {\n                ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"program\" /* Program */, \"processTypeReferences\", { count: typeReferences.length });\n                // This containingFilename needs to match with the one used in managed-side\n                var containingDirectory = options.configFilePath ? ts.getDirectoryPath(options.configFilePath) : host.getCurrentDirectory();\n                var containingFilename = ts.combinePaths(containingDirectory, ts.inferredTypesContainingFile);\n                var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename);\n                for (var i = 0; i < typeReferences.length; i++) {\n                    processTypeReferenceDirective(typeReferences[i], resolutions[i], { kind: ts.FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i], packageId: (_b = resolutions[i]) === null || _b === void 0 ? void 0 : _b.packageId });\n                }\n                ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n            }\n            // Do not process the default library if:\n            //  - The '--noLib' flag is used.\n            //  - A 'no-default-lib' reference comment is encountered in\n            //      processing the root files.\n            if (rootNames.length && !skipDefaultLib) {\n                // If '--lib' is not specified, include default library file according to '--target'\n                // otherwise, using options specified in '--lib' instead of '--target' default library file\n                var defaultLibraryFileName = getDefaultLibraryFileName();\n                if (!options.lib && defaultLibraryFileName) {\n                    processRootFile(defaultLibraryFileName, /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ false, { kind: ts.FileIncludeKind.LibFile });\n                }\n                else {\n                    ts.forEach(options.lib, function (libFileName, index) {\n                        processRootFile(ts.combinePaths(defaultLibraryPath, libFileName), /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ false, { kind: ts.FileIncludeKind.LibFile, index: index });\n                    });\n                }\n            }\n            missingFilePaths = ts.arrayFrom(ts.mapDefinedIterator(filesByName.entries(), function (_a) {\n                var path = _a[0], file = _a[1];\n                return file === undefined ? path : undefined;\n            }));\n            files = ts.stableSort(processingDefaultLibFiles, compareDefaultLibFiles).concat(processingOtherFiles);\n            processingDefaultLibFiles = undefined;\n            processingOtherFiles = undefined;\n        }\n        ts.Debug.assert(!!missingFilePaths);\n        // Release any files we have acquired in the old program but are\n        // not part of the new program.\n        if (oldProgram && host.onReleaseOldSourceFile) {\n            var oldSourceFiles = oldProgram.getSourceFiles();\n            for (var _i = 0, oldSourceFiles_1 = oldSourceFiles; _i < oldSourceFiles_1.length; _i++) {\n                var oldSourceFile = oldSourceFiles_1[_i];\n                var newFile = getSourceFileByPath(oldSourceFile.resolvedPath);\n                if (shouldCreateNewSourceFile || !newFile ||\n                    // old file wasn't redirect but new file is\n                    (oldSourceFile.resolvedPath === oldSourceFile.path && newFile.resolvedPath !== oldSourceFile.path)) {\n                    host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path));\n                }\n            }\n            oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference) {\n                if (!getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) {\n                    host.onReleaseOldSourceFile(resolvedProjectReference.sourceFile, oldProgram.getCompilerOptions(), /*hasSourceFileByPath*/ false);\n                }\n            });\n        }\n        // unconditionally set oldProgram to undefined to prevent it from being captured in closure\n        oldProgram = undefined;\n        var program = {\n            getRootFileNames: function () { return rootNames; },\n            getSourceFile: getSourceFile,\n            getSourceFileByPath: getSourceFileByPath,\n            getSourceFiles: function () { return files; },\n            getMissingFilePaths: function () { return missingFilePaths; },\n            getFilesByNameMap: function () { return filesByName; },\n            getCompilerOptions: function () { return options; },\n            getSyntacticDiagnostics: getSyntacticDiagnostics,\n            getOptionsDiagnostics: getOptionsDiagnostics,\n            getGlobalDiagnostics: getGlobalDiagnostics,\n            getSemanticDiagnostics: getSemanticDiagnostics,\n            getCachedSemanticDiagnostics: getCachedSemanticDiagnostics,\n            getSuggestionDiagnostics: getSuggestionDiagnostics,\n            getDeclarationDiagnostics: getDeclarationDiagnostics,\n            getBindAndCheckDiagnostics: getBindAndCheckDiagnostics,\n            getProgramDiagnostics: getProgramDiagnostics,\n            getTypeChecker: getTypeChecker,\n            getClassifiableNames: getClassifiableNames,\n            getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker,\n            getCommonSourceDirectory: getCommonSourceDirectory,\n            emit: emit,\n            getCurrentDirectory: function () { return currentDirectory; },\n            getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); },\n            getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); },\n            getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); },\n            getTypeCatalog: function () { return getDiagnosticsProducingTypeChecker().getTypeCatalog(); },\n            getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); },\n            getInstantiationCount: function () { return getDiagnosticsProducingTypeChecker().getInstantiationCount(); },\n            getRelationCacheSizes: function () { return getDiagnosticsProducingTypeChecker().getRelationCacheSizes(); },\n            getFileProcessingDiagnostics: function () { return fileProcessingDiagnostics; },\n            getResolvedTypeReferenceDirectives: function () { return resolvedTypeReferenceDirectives; },\n            isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary,\n            isSourceFileDefaultLibrary: isSourceFileDefaultLibrary,\n            dropDiagnosticsProducingTypeChecker: dropDiagnosticsProducingTypeChecker,\n            getSourceFileFromReference: getSourceFileFromReference,\n            getLibFileFromReference: getLibFileFromReference,\n            sourceFileToPackageName: sourceFileToPackageName,\n            redirectTargetsMap: redirectTargetsMap,\n            isEmittedFile: isEmittedFile,\n            getConfigFileParsingDiagnostics: getConfigFileParsingDiagnostics,\n            getResolvedModuleWithFailedLookupLocationsFromCache: getResolvedModuleWithFailedLookupLocationsFromCache,\n            getProjectReferences: getProjectReferences,\n            getResolvedProjectReferences: getResolvedProjectReferences,\n            getProjectReferenceRedirect: getProjectReferenceRedirect,\n            getResolvedProjectReferenceToRedirect: getResolvedProjectReferenceToRedirect,\n            getResolvedProjectReferenceByPath: getResolvedProjectReferenceByPath,\n            forEachResolvedProjectReference: forEachResolvedProjectReference,\n            isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect,\n            emitBuildInfo: emitBuildInfo,\n            fileExists: fileExists,\n            directoryExists: directoryExists,\n            getSymlinkCache: getSymlinkCache,\n            realpath: (_c = host.realpath) === null || _c === void 0 ? void 0 : _c.bind(host),\n            useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); },\n            getFileIncludeReasons: function () { return fileReasons; },\n            structureIsReused: structureIsReused,\n        };\n        onProgramCreateComplete();\n        // Add file processingDiagnostics\n        fileProcessingDiagnostics === null || fileProcessingDiagnostics === void 0 ? void 0 : fileProcessingDiagnostics.forEach(function (diagnostic) {\n            switch (diagnostic.kind) {\n                case 1 /* FilePreprocessingFileExplainingDiagnostic */:\n                    return programDiagnostics.add(createDiagnosticExplainingFile(diagnostic.file && getSourceFileByPath(diagnostic.file), diagnostic.fileProcessingReason, diagnostic.diagnostic, diagnostic.args || ts.emptyArray));\n                case 0 /* FilePreprocessingReferencedDiagnostic */:\n                    var _a = getReferencedFileLocation(getSourceFileByPath, diagnostic.reason), file = _a.file, pos = _a.pos, end = _a.end;\n                    return programDiagnostics.add(ts.createFileDiagnostic.apply(void 0, __spreadArray([file, ts.Debug.checkDefined(pos), ts.Debug.checkDefined(end) - pos, diagnostic.diagnostic], diagnostic.args || ts.emptyArray)));\n                default:\n                    ts.Debug.assertNever(diagnostic);\n            }\n        });\n        verifyCompilerOptions();\n        ts.performance.mark(\"afterProgram\");\n        ts.performance.measure(\"Program\", \"beforeProgram\", \"afterProgram\");\n        ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n        return program;\n        function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames) {\n            if (!moduleNames.length)\n                return ts.emptyArray;\n            var containingFileName = ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory);\n            var redirectedReference = getRedirectReferenceForResolution(containingFile);\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"program\" /* Program */, \"resolveModuleNamesWorker\", { containingFileName: containingFileName });\n            ts.performance.mark(\"beforeResolveModule\");\n            var result = actualResolveModuleNamesWorker(moduleNames, containingFileName, reusedNames, redirectedReference);\n            ts.performance.mark(\"afterResolveModule\");\n            ts.performance.measure(\"ResolveModule\", \"beforeResolveModule\", \"afterResolveModule\");\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n            return result;\n        }\n        function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile) {\n            if (!typeDirectiveNames.length)\n                return [];\n            var containingFileName = !ts.isString(containingFile) ? ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile;\n            var redirectedReference = !ts.isString(containingFile) ? getRedirectReferenceForResolution(containingFile) : undefined;\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"program\" /* Program */, \"resolveTypeReferenceDirectiveNamesWorker\", { containingFileName: containingFileName });\n            ts.performance.mark(\"beforeResolveTypeReference\");\n            var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference);\n            ts.performance.mark(\"afterResolveTypeReference\");\n            ts.performance.measure(\"ResolveTypeReference\", \"beforeResolveTypeReference\", \"afterResolveTypeReference\");\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n            return result;\n        }\n        function getRedirectReferenceForResolution(file) {\n            var redirect = getResolvedProjectReferenceToRedirect(file.originalFileName);\n            if (redirect || !ts.fileExtensionIs(file.originalFileName, \".d.ts\" /* Dts */))\n                return redirect;\n            // The originalFileName could not be actual source file name if file found was d.ts from referecned project\n            // So in this case try to look up if this is output from referenced project, if it is use the redirected project in that case\n            var resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.originalFileName, file.path);\n            if (resultFromDts)\n                return resultFromDts;\n            // If preserveSymlinks is true, module resolution wont jump the symlink\n            // but the resolved real path may be the .d.ts from project reference\n            // Note:: Currently we try the real path only if the\n            // file is from node_modules to avoid having to run real path on all file paths\n            if (!host.realpath || !options.preserveSymlinks || !ts.stringContains(file.originalFileName, ts.nodeModulesPathPart))\n                return undefined;\n            var realDeclarationFileName = host.realpath(file.originalFileName);\n            var realDeclarationPath = toPath(realDeclarationFileName);\n            return realDeclarationPath === file.path ? undefined : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationFileName, realDeclarationPath);\n        }\n        function getRedirectReferenceForResolutionFromSourceOfProject(fileName, filePath) {\n            var source = getSourceOfProjectReferenceRedirect(fileName);\n            if (ts.isString(source))\n                return getResolvedProjectReferenceToRedirect(source);\n            if (!source)\n                return undefined;\n            // Output of .d.ts file so return resolved ref that matches the out file name\n            return forEachResolvedProjectReference(function (resolvedRef) {\n                var out = ts.outFile(resolvedRef.commandLine.options);\n                if (!out)\n                    return undefined;\n                return toPath(out) === filePath ? resolvedRef : undefined;\n            });\n        }\n        function compareDefaultLibFiles(a, b) {\n            return ts.compareValues(getDefaultLibFilePriority(a), getDefaultLibFilePriority(b));\n        }\n        function getDefaultLibFilePriority(a) {\n            if (ts.containsPath(defaultLibraryPath, a.fileName, /*ignoreCase*/ false)) {\n                var basename = ts.getBaseFileName(a.fileName);\n                if (basename === \"lib.d.ts\" || basename === \"lib.es6.d.ts\")\n                    return 0;\n                var name = ts.removeSuffix(ts.removePrefix(basename, \"lib.\"), \".d.ts\");\n                var index = ts.libs.indexOf(name);\n                if (index !== -1)\n                    return index + 1;\n            }\n            return ts.libs.length + 2;\n        }\n        function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile) {\n            return moduleResolutionCache && ts.resolveModuleNameFromCache(moduleName, containingFile, moduleResolutionCache);\n        }\n        function toPath(fileName) {\n            return ts.toPath(fileName, currentDirectory, getCanonicalFileName);\n        }\n        function getCommonSourceDirectory() {\n            if (commonSourceDirectory === undefined) {\n                var emittedFiles_1 = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, program); });\n                commonSourceDirectory = ts.getCommonSourceDirectory(options, function () { return ts.mapDefined(emittedFiles_1, function (file) { return file.isDeclarationFile ? undefined : file.fileName; }); }, currentDirectory, getCanonicalFileName, function (commonSourceDirectory) { return checkSourceFilesBelongToPath(emittedFiles_1, commonSourceDirectory); });\n            }\n            return commonSourceDirectory;\n        }\n        function getClassifiableNames() {\n            var _a;\n            if (!classifiableNames) {\n                // Initialize a checker so that all our files are bound.\n                getTypeChecker();\n                classifiableNames = new ts.Set();\n                for (var _i = 0, files_2 = files; _i < files_2.length; _i++) {\n                    var sourceFile = files_2[_i];\n                    (_a = sourceFile.classifiableNames) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return classifiableNames.add(value); });\n                }\n            }\n            return classifiableNames;\n        }\n        function resolveModuleNamesReusingOldState(moduleNames, file) {\n            if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) {\n                // If the old program state does not permit reusing resolutions and `file` does not contain locally defined ambient modules,\n                // the best we can do is fallback to the default logic.\n                return resolveModuleNamesWorker(moduleNames, file, /*reusedNames*/ undefined);\n            }\n            var oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);\n            if (oldSourceFile !== file && file.resolvedModules) {\n                // `file` was created for the new program.\n                //\n                // We only set `file.resolvedModules` via work from the current function,\n                // so it is defined iff we already called the current function on `file`.\n                // That call happened no later than the creation of the `file` object,\n                // which per above occurred during the current program creation.\n                // Since we assume the filesystem does not change during program creation,\n                // it is safe to reuse resolutions from the earlier call.\n                var result_14 = [];\n                for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {\n                    var moduleName = moduleNames_1[_i];\n                    var resolvedModule = file.resolvedModules.get(moduleName);\n                    result_14.push(resolvedModule);\n                }\n                return result_14;\n            }\n            // At this point, we know at least one of the following hold:\n            // - file has local declarations for ambient modules\n            // - old program state is available\n            // With this information, we can infer some module resolutions without performing resolution.\n            /** An ordered list of module names for which we cannot recover the resolution. */\n            var unknownModuleNames;\n            /**\n             * The indexing of elements in this list matches that of `moduleNames`.\n             *\n             * Before combining results, result[i] is in one of the following states:\n             * * undefined: needs to be recomputed,\n             * * predictedToResolveToAmbientModuleMarker: known to be an ambient module.\n             * Needs to be reset to undefined before returning,\n             * * ResolvedModuleFull instance: can be reused.\n             */\n            var result;\n            var reusedNames;\n            /** A transient placeholder used to mark predicted resolution in the result list. */\n            var predictedToResolveToAmbientModuleMarker = {};\n            for (var i = 0; i < moduleNames.length; i++) {\n                var moduleName = moduleNames[i];\n                // If the source file is unchanged and doesnt have invalidated resolution, reuse the module resolutions\n                if (file === oldSourceFile && !hasInvalidatedResolution(oldSourceFile.path)) {\n                    var oldResolvedModule = ts.getResolvedModule(oldSourceFile, moduleName);\n                    if (oldResolvedModule) {\n                        if (ts.isTraceEnabled(options, host)) {\n                            ts.trace(host, ts.Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory));\n                        }\n                        (result || (result = new Array(moduleNames.length)))[i] = oldResolvedModule;\n                        (reusedNames || (reusedNames = [])).push(moduleName);\n                        continue;\n                    }\n                }\n                // We know moduleName resolves to an ambient module provided that moduleName:\n                // - is in the list of ambient modules locally declared in the current source file.\n                // - resolved to an ambient module in the old program whose declaration is in an unmodified file\n                //   (so the same module declaration will land in the new program)\n                var resolvesToAmbientModuleInNonModifiedFile = false;\n                if (ts.contains(file.ambientModuleNames, moduleName)) {\n                    resolvesToAmbientModuleInNonModifiedFile = true;\n                    if (ts.isTraceEnabled(options, host)) {\n                        ts.trace(host, ts.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory));\n                    }\n                }\n                else {\n                    resolvesToAmbientModuleInNonModifiedFile = moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName);\n                }\n                if (resolvesToAmbientModuleInNonModifiedFile) {\n                    (result || (result = new Array(moduleNames.length)))[i] = predictedToResolveToAmbientModuleMarker;\n                }\n                else {\n                    // Resolution failed in the old program, or resolved to an ambient module for which we can't reuse the result.\n                    (unknownModuleNames || (unknownModuleNames = [])).push(moduleName);\n                }\n            }\n            var resolutions = unknownModuleNames && unknownModuleNames.length\n                ? resolveModuleNamesWorker(unknownModuleNames, file, reusedNames)\n                : ts.emptyArray;\n            // Combine results of resolutions and predicted results\n            if (!result) {\n                // There were no unresolved/ambient resolutions.\n                ts.Debug.assert(resolutions.length === moduleNames.length);\n                return resolutions;\n            }\n            var j = 0;\n            for (var i = 0; i < result.length; i++) {\n                if (result[i]) {\n                    // `result[i]` is either a `ResolvedModuleFull` or a marker.\n                    // If it is the former, we can leave it as is.\n                    if (result[i] === predictedToResolveToAmbientModuleMarker) {\n                        result[i] = undefined; // TODO: GH#18217\n                    }\n                }\n                else {\n                    result[i] = resolutions[j];\n                    j++;\n                }\n            }\n            ts.Debug.assert(j === resolutions.length);\n            return result;\n            // If we change our policy of rechecking failed lookups on each program create,\n            // we should adjust the value returned here.\n            function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) {\n                var resolutionToFile = ts.getResolvedModule(oldSourceFile, moduleName);\n                var resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName);\n                if (resolutionToFile && resolvedFile) {\n                    // In the old program, we resolved to an ambient module that was in the same\n                    //   place as we expected to find an actual module file.\n                    // We actually need to return 'false' here even though this seems like a 'true' case\n                    //   because the normal module resolution algorithm will find this anyway.\n                    return false;\n                }\n                // at least one of declarations should come from non-modified source file\n                var unmodifiedFile = ambientModuleNameToUnmodifiedFileName.get(moduleName);\n                if (!unmodifiedFile) {\n                    return false;\n                }\n                if (ts.isTraceEnabled(options, host)) {\n                    ts.trace(host, ts.Diagnostics.Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified, moduleName, unmodifiedFile);\n                }\n                return true;\n            }\n        }\n        function canReuseProjectReferences() {\n            return !forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function (oldResolvedRef, parent, index) {\n                var newRef = (parent ? parent.commandLine.projectReferences : projectReferences)[index];\n                var newResolvedRef = parseProjectReferenceConfigFile(newRef);\n                if (oldResolvedRef) {\n                    // Resolved project reference has gone missing or changed\n                    return !newResolvedRef || newResolvedRef.sourceFile !== oldResolvedRef.sourceFile;\n                }\n                else {\n                    // A previously-unresolved reference may be resolved now\n                    return newResolvedRef !== undefined;\n                }\n            }, function (oldProjectReferences, parent) {\n                // If array of references is changed, we cant resue old program\n                var newReferences = parent ? getResolvedProjectReferenceByPath(parent.sourceFile.path).commandLine.projectReferences : projectReferences;\n                return !ts.arrayIsEqualTo(oldProjectReferences, newReferences, ts.projectReferenceIsEqualTo);\n            });\n        }\n        function tryReuseStructureFromOldProgram() {\n            var _a;\n            if (!oldProgram) {\n                return 0 /* Not */;\n            }\n            // check properties that can affect structure of the program or module resolution strategy\n            // if any of these properties has changed - structure cannot be reused\n            var oldOptions = oldProgram.getCompilerOptions();\n            if (ts.changesAffectModuleResolution(oldOptions, options)) {\n                return 0 /* Not */;\n            }\n            // there is an old program, check if we can reuse its structure\n            var oldRootNames = oldProgram.getRootFileNames();\n            if (!ts.arrayIsEqualTo(oldRootNames, rootNames)) {\n                return 0 /* Not */;\n            }\n            if (!ts.arrayIsEqualTo(options.types, oldOptions.types)) {\n                return 0 /* Not */;\n            }\n            // Check if any referenced project tsconfig files are different\n            if (!canReuseProjectReferences()) {\n                return 0 /* Not */;\n            }\n            if (projectReferences) {\n                resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile);\n            }\n            // check if program source files has changed in the way that can affect structure of the program\n            var newSourceFiles = [];\n            var modifiedSourceFiles = [];\n            structureIsReused = 2 /* Completely */;\n            // If the missing file paths are now present, it can change the progam structure,\n            // and hence cant reuse the structure.\n            // This is same as how we dont reuse the structure if one of the file from old program is now missing\n            if (oldProgram.getMissingFilePaths().some(function (missingFilePath) { return host.fileExists(missingFilePath); })) {\n                return 0 /* Not */;\n            }\n            var oldSourceFiles = oldProgram.getSourceFiles();\n            var SeenPackageName;\n            (function (SeenPackageName) {\n                SeenPackageName[SeenPackageName[\"Exists\"] = 0] = \"Exists\";\n                SeenPackageName[SeenPackageName[\"Modified\"] = 1] = \"Modified\";\n            })(SeenPackageName || (SeenPackageName = {}));\n            var seenPackageNames = new ts.Map();\n            for (var _i = 0, oldSourceFiles_2 = oldSourceFiles; _i < oldSourceFiles_2.length; _i++) {\n                var oldSourceFile = oldSourceFiles_2[_i];\n                var newSourceFile = host.getSourceFileByPath\n                    ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, options.target, /*onError*/ undefined, shouldCreateNewSourceFile)\n                    : host.getSourceFile(oldSourceFile.fileName, options.target, /*onError*/ undefined, shouldCreateNewSourceFile); // TODO: GH#18217\n                if (!newSourceFile) {\n                    return 0 /* Not */;\n                }\n                ts.Debug.assert(!newSourceFile.redirectInfo, \"Host should not return a redirect source file from `getSourceFile`\");\n                var fileChanged = void 0;\n                if (oldSourceFile.redirectInfo) {\n                    // We got `newSourceFile` by path, so it is actually for the unredirected file.\n                    // This lets us know if the unredirected file has changed. If it has we should break the redirect.\n                    if (newSourceFile !== oldSourceFile.redirectInfo.unredirected) {\n                        // Underlying file has changed. Might not redirect anymore. Must rebuild program.\n                        return 0 /* Not */;\n                    }\n                    fileChanged = false;\n                    newSourceFile = oldSourceFile; // Use the redirect.\n                }\n                else if (oldProgram.redirectTargetsMap.has(oldSourceFile.path)) {\n                    // If a redirected-to source file changes, the redirect may be broken.\n                    if (newSourceFile !== oldSourceFile) {\n                        return 0 /* Not */;\n                    }\n                    fileChanged = false;\n                }\n                else {\n                    fileChanged = newSourceFile !== oldSourceFile;\n                }\n                // Since the project references havent changed, its right to set originalFileName and resolvedPath here\n                newSourceFile.path = oldSourceFile.path;\n                newSourceFile.originalFileName = oldSourceFile.originalFileName;\n                newSourceFile.resolvedPath = oldSourceFile.resolvedPath;\n                newSourceFile.fileName = oldSourceFile.fileName;\n                var packageName = oldProgram.sourceFileToPackageName.get(oldSourceFile.path);\n                if (packageName !== undefined) {\n                    // If there are 2 different source files for the same package name and at least one of them changes,\n                    // they might become redirects. So we must rebuild the program.\n                    var prevKind = seenPackageNames.get(packageName);\n                    var newKind = fileChanged ? 1 /* Modified */ : 0 /* Exists */;\n                    if ((prevKind !== undefined && newKind === 1 /* Modified */) || prevKind === 1 /* Modified */) {\n                        return 0 /* Not */;\n                    }\n                    seenPackageNames.set(packageName, newKind);\n                }\n                if (fileChanged) {\n                    // The `newSourceFile` object was created for the new program.\n                    if (!ts.arrayIsEqualTo(oldSourceFile.libReferenceDirectives, newSourceFile.libReferenceDirectives, fileReferenceIsEqualTo)) {\n                        // 'lib' references has changed. Matches behavior in changesAffectModuleResolution\n                        return 0 /* Not */;\n                    }\n                    if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) {\n                        // value of no-default-lib has changed\n                        // this will affect if default library is injected into the list of files\n                        structureIsReused = 1 /* SafeModules */;\n                    }\n                    // check tripleslash references\n                    if (!ts.arrayIsEqualTo(oldSourceFile.referencedFiles, newSourceFile.referencedFiles, fileReferenceIsEqualTo)) {\n                        // tripleslash references has changed\n                        structureIsReused = 1 /* SafeModules */;\n                    }\n                    // check imports and module augmentations\n                    collectExternalModuleReferences(newSourceFile);\n                    if (!ts.arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) {\n                        // imports has changed\n                        structureIsReused = 1 /* SafeModules */;\n                    }\n                    if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) {\n                        // moduleAugmentations has changed\n                        structureIsReused = 1 /* SafeModules */;\n                    }\n                    if ((oldSourceFile.flags & 3145728 /* PermanentlySetIncrementalFlags */) !== (newSourceFile.flags & 3145728 /* PermanentlySetIncrementalFlags */)) {\n                        // dynamicImport has changed\n                        structureIsReused = 1 /* SafeModules */;\n                    }\n                    if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) {\n                        // 'types' references has changed\n                        structureIsReused = 1 /* SafeModules */;\n                    }\n                    // tentatively approve the file\n                    modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile });\n                }\n                else if (hasInvalidatedResolution(oldSourceFile.path)) {\n                    // 'module/types' references could have changed\n                    structureIsReused = 1 /* SafeModules */;\n                    // add file to the modified list so that we will resolve it later\n                    modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile });\n                }\n                // if file has passed all checks it should be safe to reuse it\n                newSourceFiles.push(newSourceFile);\n            }\n            if (structureIsReused !== 2 /* Completely */) {\n                return structureIsReused;\n            }\n            var modifiedFiles = modifiedSourceFiles.map(function (f) { return f.oldFile; });\n            for (var _b = 0, oldSourceFiles_3 = oldSourceFiles; _b < oldSourceFiles_3.length; _b++) {\n                var oldFile = oldSourceFiles_3[_b];\n                if (!ts.contains(modifiedFiles, oldFile)) {\n                    for (var _c = 0, _d = oldFile.ambientModuleNames; _c < _d.length; _c++) {\n                        var moduleName = _d[_c];\n                        ambientModuleNameToUnmodifiedFileName.set(moduleName, oldFile.fileName);\n                    }\n                }\n            }\n            // try to verify results of module resolution\n            for (var _e = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _e < modifiedSourceFiles_1.length; _e++) {\n                var _f = modifiedSourceFiles_1[_e], oldSourceFile = _f.oldFile, newSourceFile = _f.newFile;\n                var moduleNames = getModuleNames(newSourceFile);\n                var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile);\n                // ensure that module resolution results are still correct\n                var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, ts.moduleResolutionIsEqualTo);\n                if (resolutionsChanged) {\n                    structureIsReused = 1 /* SafeModules */;\n                    newSourceFile.resolvedModules = ts.zipToMap(moduleNames, resolutions);\n                }\n                else {\n                    newSourceFile.resolvedModules = oldSourceFile.resolvedModules;\n                }\n                // We lower-case all type references because npm automatically lowercases all packages. See GH#9824.\n                var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); });\n                var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile);\n                // ensure that types resolutions are still correct\n                var typeReferenceEesolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, ts.typeDirectiveIsEqualTo);\n                if (typeReferenceEesolutionsChanged) {\n                    structureIsReused = 1 /* SafeModules */;\n                    newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToMap(typesReferenceDirectives, typeReferenceResolutions);\n                }\n                else {\n                    newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames;\n                }\n            }\n            if (structureIsReused !== 2 /* Completely */) {\n                return structureIsReused;\n            }\n            if ((_a = host.hasChangedAutomaticTypeDirectiveNames) === null || _a === void 0 ? void 0 : _a.call(host)) {\n                return 1 /* SafeModules */;\n            }\n            missingFilePaths = oldProgram.getMissingFilePaths();\n            // update fileName -> file mapping\n            ts.Debug.assert(newSourceFiles.length === oldProgram.getSourceFiles().length);\n            for (var _g = 0, newSourceFiles_1 = newSourceFiles; _g < newSourceFiles_1.length; _g++) {\n                var newSourceFile = newSourceFiles_1[_g];\n                filesByName.set(newSourceFile.path, newSourceFile);\n            }\n            var oldFilesByNameMap = oldProgram.getFilesByNameMap();\n            oldFilesByNameMap.forEach(function (oldFile, path) {\n                if (!oldFile) {\n                    filesByName.set(path, oldFile);\n                    return;\n                }\n                if (oldFile.path === path) {\n                    // Set the file as found during node modules search if it was found that way in old progra,\n                    if (oldProgram.isSourceFileFromExternalLibrary(oldFile)) {\n                        sourceFilesFoundSearchingNodeModules.set(oldFile.path, true);\n                    }\n                    return;\n                }\n                filesByName.set(path, filesByName.get(oldFile.path));\n            });\n            files = newSourceFiles;\n            fileReasons = oldProgram.getFileIncludeReasons();\n            fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics();\n            resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives();\n            sourceFileToPackageName = oldProgram.sourceFileToPackageName;\n            redirectTargetsMap = oldProgram.redirectTargetsMap;\n            return 2 /* Completely */;\n        }\n        function getEmitHost(writeFileCallback) {\n            return {\n                getPrependNodes: getPrependNodes,\n                getCanonicalFileName: getCanonicalFileName,\n                getCommonSourceDirectory: program.getCommonSourceDirectory,\n                getCompilerOptions: program.getCompilerOptions,\n                getCurrentDirectory: function () { return currentDirectory; },\n                getNewLine: function () { return host.getNewLine(); },\n                getSourceFile: program.getSourceFile,\n                getSourceFileByPath: program.getSourceFileByPath,\n                getSourceFiles: program.getSourceFiles,\n                getLibFileFromReference: program.getLibFileFromReference,\n                isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary,\n                getResolvedProjectReferenceToRedirect: getResolvedProjectReferenceToRedirect,\n                getProjectReferenceRedirect: getProjectReferenceRedirect,\n                isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect,\n                getSymlinkCache: getSymlinkCache,\n                writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError, sourceFiles) { return host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles); }),\n                isEmitBlocked: isEmitBlocked,\n                readFile: function (f) { return host.readFile(f); },\n                fileExists: function (f) {\n                    // Use local caches\n                    var path = toPath(f);\n                    if (getSourceFileByPath(path))\n                        return true;\n                    if (ts.contains(missingFilePaths, path))\n                        return false;\n                    // Before falling back to the host\n                    return host.fileExists(f);\n                },\n                useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); },\n                getProgramBuildInfo: function () { return program.getProgramBuildInfo && program.getProgramBuildInfo(); },\n                getSourceFileFromReference: function (file, ref) { return program.getSourceFileFromReference(file, ref); },\n                redirectTargetsMap: redirectTargetsMap,\n                getFileIncludeReasons: program.getFileIncludeReasons,\n            };\n        }\n        function emitBuildInfo(writeFileCallback) {\n            ts.Debug.assert(!ts.outFile(options));\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"emit\" /* Emit */, \"emitBuildInfo\", {}, /*separateBeginAndEnd*/ true);\n            ts.performance.mark(\"beforeEmit\");\n            var emitResult = ts.emitFiles(ts.notImplementedResolver, getEmitHost(writeFileCallback), \n            /*targetSourceFile*/ undefined, \n            /*transformers*/ ts.noTransformers, \n            /*emitOnlyDtsFiles*/ false, \n            /*onlyBuildInfo*/ true);\n            ts.performance.mark(\"afterEmit\");\n            ts.performance.measure(\"Emit\", \"beforeEmit\", \"afterEmit\");\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n            return emitResult;\n        }\n        function getResolvedProjectReferences() {\n            return resolvedProjectReferences;\n        }\n        function getProjectReferences() {\n            return projectReferences;\n        }\n        function getPrependNodes() {\n            return createPrependNodes(projectReferences, function (_ref, index) { var _a; return (_a = resolvedProjectReferences[index]) === null || _a === void 0 ? void 0 : _a.commandLine; }, function (fileName) {\n                var path = toPath(fileName);\n                var sourceFile = getSourceFileByPath(path);\n                return sourceFile ? sourceFile.text : filesByName.has(path) ? undefined : host.readFile(path);\n            });\n        }\n        function isSourceFileFromExternalLibrary(file) {\n            return !!sourceFilesFoundSearchingNodeModules.get(file.path);\n        }\n        function isSourceFileDefaultLibrary(file) {\n            if (file.hasNoDefaultLib) {\n                return true;\n            }\n            if (!options.noLib) {\n                return false;\n            }\n            // If '--lib' is not specified, include default library file according to '--target'\n            // otherwise, using options specified in '--lib' instead of '--target' default library file\n            var equalityComparer = host.useCaseSensitiveFileNames() ? ts.equateStringsCaseSensitive : ts.equateStringsCaseInsensitive;\n            if (!options.lib) {\n                return equalityComparer(file.fileName, getDefaultLibraryFileName());\n            }\n            else {\n                return ts.some(options.lib, function (libFileName) { return equalityComparer(file.fileName, ts.combinePaths(defaultLibraryPath, libFileName)); });\n            }\n        }\n        function getDiagnosticsProducingTypeChecker() {\n            return diagnosticsProducingTypeChecker || (diagnosticsProducingTypeChecker = ts.createTypeChecker(program, /*produceDiagnostics:*/ true));\n        }\n        function dropDiagnosticsProducingTypeChecker() {\n            diagnosticsProducingTypeChecker = undefined;\n        }\n        function getTypeChecker() {\n            return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, /*produceDiagnostics:*/ false));\n        }\n        function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit) {\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"emit\" /* Emit */, \"emit\", { path: sourceFile === null || sourceFile === void 0 ? void 0 : sourceFile.path }, /*separateBeginAndEnd*/ true);\n            var result = runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit); });\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n            return result;\n        }\n        function isEmitBlocked(emitFileName) {\n            return hasEmitBlockingDiagnostics.has(toPath(emitFileName));\n        }\n        function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, customTransformers, forceDtsEmit) {\n            if (!forceDtsEmit) {\n                var result = handleNoEmitOptions(program, sourceFile, writeFileCallback, cancellationToken);\n                if (result)\n                    return result;\n            }\n            // Create the emit resolver outside of the \"emitTime\" tracking code below.  That way\n            // any cost associated with it (like type checking) are appropriate associated with\n            // the type-checking counter.\n            //\n            // If the -out option is specified, we should not pass the source file to getEmitResolver.\n            // This is because in the -out scenario all files need to be emitted, and therefore all\n            // files need to be type checked. And the way to specify that all files need to be type\n            // checked is to not pass the file to getEmitResolver.\n            var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver(ts.outFile(options) ? undefined : sourceFile, cancellationToken);\n            ts.performance.mark(\"beforeEmit\");\n            var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, ts.getTransformers(options, customTransformers, emitOnlyDtsFiles), emitOnlyDtsFiles, \n            /*onlyBuildInfo*/ false, forceDtsEmit);\n            ts.performance.mark(\"afterEmit\");\n            ts.performance.measure(\"Emit\", \"beforeEmit\", \"afterEmit\");\n            return emitResult;\n        }\n        function getSourceFile(fileName) {\n            return getSourceFileByPath(toPath(fileName));\n        }\n        function getSourceFileByPath(path) {\n            return filesByName.get(path) || undefined;\n        }\n        function getDiagnosticsHelper(sourceFile, getDiagnostics, cancellationToken) {\n            if (sourceFile) {\n                return getDiagnostics(sourceFile, cancellationToken);\n            }\n            return ts.sortAndDeduplicateDiagnostics(ts.flatMap(program.getSourceFiles(), function (sourceFile) {\n                if (cancellationToken) {\n                    cancellationToken.throwIfCancellationRequested();\n                }\n                return getDiagnostics(sourceFile, cancellationToken);\n            }));\n        }\n        function getSyntacticDiagnostics(sourceFile, cancellationToken) {\n            return getDiagnosticsHelper(sourceFile, getSyntacticDiagnosticsForFile, cancellationToken);\n        }\n        function getSemanticDiagnostics(sourceFile, cancellationToken) {\n            return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken);\n        }\n        function getCachedSemanticDiagnostics(sourceFile) {\n            var _a;\n            return sourceFile\n                ? (_a = cachedBindAndCheckDiagnosticsForFile.perFile) === null || _a === void 0 ? void 0 : _a.get(sourceFile.path)\n                : cachedBindAndCheckDiagnosticsForFile.allDiagnostics;\n        }\n        function getBindAndCheckDiagnostics(sourceFile, cancellationToken) {\n            return getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken);\n        }\n        function getProgramDiagnostics(sourceFile) {\n            var _a;\n            if (ts.skipTypeChecking(sourceFile, options, program)) {\n                return ts.emptyArray;\n            }\n            var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName);\n            if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) {\n                return programDiagnosticsInFile;\n            }\n            return getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, programDiagnosticsInFile).diagnostics;\n        }\n        function getDeclarationDiagnostics(sourceFile, cancellationToken) {\n            var options = program.getCompilerOptions();\n            // collect diagnostics from the program only once if either no source file was specified or out/outFile is set (bundled emit)\n            if (!sourceFile || ts.outFile(options)) {\n                return getDeclarationDiagnosticsWorker(sourceFile, cancellationToken);\n            }\n            else {\n                return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken);\n            }\n        }\n        function getSyntacticDiagnosticsForFile(sourceFile) {\n            // For JavaScript files, we report semantic errors for using TypeScript-only\n            // constructs from within a JavaScript file as syntactic errors.\n            if (ts.isSourceFileJS(sourceFile)) {\n                if (!sourceFile.additionalSyntacticDiagnostics) {\n                    sourceFile.additionalSyntacticDiagnostics = getJSSyntacticDiagnosticsForFile(sourceFile);\n                }\n                return ts.concatenate(sourceFile.additionalSyntacticDiagnostics, sourceFile.parseDiagnostics);\n            }\n            return sourceFile.parseDiagnostics;\n        }\n        function runWithCancellationToken(func) {\n            try {\n                return func();\n            }\n            catch (e) {\n                if (e instanceof ts.OperationCanceledException) {\n                    // We were canceled while performing the operation.  Because our type checker\n                    // might be a bad state, we need to throw it away.\n                    //\n                    // Note: we are overly aggressive here.  We do not actually *have* to throw away\n                    // the \"noDiagnosticsTypeChecker\".  However, for simplicity, i'd like to keep\n                    // the lifetimes of these two TypeCheckers the same.  Also, we generally only\n                    // cancel when the user has made a change anyways.  And, in that case, we (the\n                    // program instance) will get thrown away anyways.  So trying to keep one of\n                    // these type checkers alive doesn't serve much purpose.\n                    noDiagnosticsTypeChecker = undefined;\n                    diagnosticsProducingTypeChecker = undefined;\n                }\n                throw e;\n            }\n        }\n        function getSemanticDiagnosticsForFile(sourceFile, cancellationToken) {\n            return ts.concatenate(filterSemanticDiagnotics(getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken), options), getProgramDiagnostics(sourceFile));\n        }\n        function getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken) {\n            return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedBindAndCheckDiagnosticsForFile, getBindAndCheckDiagnosticsForFileNoCache);\n        }\n        function getBindAndCheckDiagnosticsForFileNoCache(sourceFile, cancellationToken) {\n            return runWithCancellationToken(function () {\n                if (ts.skipTypeChecking(sourceFile, options, program)) {\n                    return ts.emptyArray;\n                }\n                var typeChecker = getDiagnosticsProducingTypeChecker();\n                ts.Debug.assert(!!sourceFile.bindDiagnostics);\n                var isCheckJs = ts.isCheckJsEnabledForFile(sourceFile, options);\n                var isTsNoCheck = !!sourceFile.checkJsDirective && sourceFile.checkJsDirective.enabled === false;\n                // By default, only type-check .ts, .tsx, 'Deferred' and 'External' files (external files are added by plugins)\n                var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* TS */ || sourceFile.scriptKind === 4 /* TSX */ ||\n                    sourceFile.scriptKind === 5 /* External */ || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */);\n                var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;\n                var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;\n                return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);\n            });\n        }\n        function getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics) {\n            var _a;\n            var allDiagnostics = [];\n            for (var _i = 2; _i < arguments.length; _i++) {\n                allDiagnostics[_i - 2] = arguments[_i];\n            }\n            var flatDiagnostics = ts.flatten(allDiagnostics);\n            if (!includeBindAndCheckDiagnostics || !((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) {\n                return flatDiagnostics;\n            }\n            var _b = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics), diagnostics = _b.diagnostics, directives = _b.directives;\n            for (var _c = 0, _d = directives.getUnusedExpectations(); _c < _d.length; _c++) {\n                var errorExpectation = _d[_c];\n                diagnostics.push(ts.createDiagnosticForRange(sourceFile, errorExpectation.range, ts.Diagnostics.Unused_ts_expect_error_directive));\n            }\n            return diagnostics;\n        }\n        /**\n         * Creates a map of comment directives along with the diagnostics immediately preceded by one of them.\n         * Comments that match to any of those diagnostics are marked as used.\n         */\n        function getDiagnosticsWithPrecedingDirectives(sourceFile, commentDirectives, flatDiagnostics) {\n            // Diagnostics are only reported if there is no comment directive preceding them\n            // This will modify the directives map by marking \"used\" ones with a corresponding diagnostic\n            var directives = ts.createCommentDirectivesMap(sourceFile, commentDirectives);\n            var diagnostics = flatDiagnostics.filter(function (diagnostic) { return markPrecedingCommentDirectiveLine(diagnostic, directives) === -1; });\n            return { diagnostics: diagnostics, directives: directives };\n        }\n        function getSuggestionDiagnostics(sourceFile, cancellationToken) {\n            return runWithCancellationToken(function () {\n                return getDiagnosticsProducingTypeChecker().getSuggestionDiagnostics(sourceFile, cancellationToken);\n            });\n        }\n        /**\n         * @returns The line index marked as preceding the diagnostic, or -1 if none was.\n         */\n        function markPrecedingCommentDirectiveLine(diagnostic, directives) {\n            var file = diagnostic.file, start = diagnostic.start;\n            if (!file) {\n                return -1;\n            }\n            // Start out with the line just before the text\n            var lineStarts = ts.getLineStarts(file);\n            var line = ts.computeLineAndCharacterOfPosition(lineStarts, start).line - 1; // TODO: GH#18217\n            while (line >= 0) {\n                // As soon as that line is known to have a comment directive, use that\n                if (directives.markUsed(line)) {\n                    return line;\n                }\n                // Stop searching if the line is not empty and not a comment\n                var lineText = file.text.slice(lineStarts[line], lineStarts[line + 1]).trim();\n                if (lineText !== \"\" && !/^(\\s*)\\/\\/(.*)$/.test(lineText)) {\n                    return -1;\n                }\n                line--;\n            }\n            return -1;\n        }\n        function getJSSyntacticDiagnosticsForFile(sourceFile) {\n            return runWithCancellationToken(function () {\n                var diagnostics = [];\n                walk(sourceFile, sourceFile);\n                ts.forEachChildRecursively(sourceFile, walk, walkArray);\n                return diagnostics;\n                function walk(node, parent) {\n                    // Return directly from the case if the given node doesnt want to visit each child\n                    // Otherwise break to visit each child\n                    switch (parent.kind) {\n                        case 160 /* Parameter */:\n                        case 163 /* PropertyDeclaration */:\n                        case 165 /* MethodDeclaration */:\n                            if (parent.questionToken === node) {\n                                diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, \"?\"));\n                                return \"skip\";\n                            }\n                        // falls through\n                        case 164 /* MethodSignature */:\n                        case 166 /* Constructor */:\n                        case 167 /* GetAccessor */:\n                        case 168 /* SetAccessor */:\n                        case 208 /* FunctionExpression */:\n                        case 251 /* FunctionDeclaration */:\n                        case 209 /* ArrowFunction */:\n                        case 249 /* VariableDeclaration */:\n                            // type annotation\n                            if (parent.type === node) {\n                                diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files));\n                                return \"skip\";\n                            }\n                    }\n                    switch (node.kind) {\n                        case 262 /* ImportClause */:\n                            if (node.isTypeOnly) {\n                                diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, \"import type\"));\n                                return \"skip\";\n                            }\n                            break;\n                        case 267 /* ExportDeclaration */:\n                            if (node.isTypeOnly) {\n                                diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, \"export type\"));\n                                return \"skip\";\n                            }\n                            break;\n                        case 260 /* ImportEqualsDeclaration */:\n                            diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files));\n                            return \"skip\";\n                        case 266 /* ExportAssignment */:\n                            if (node.isExportEquals) {\n                                diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files));\n                                return \"skip\";\n                            }\n                            break;\n                        case 286 /* HeritageClause */:\n                            var heritageClause = node;\n                            if (heritageClause.token === 116 /* ImplementsKeyword */) {\n                                diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files));\n                                return \"skip\";\n                            }\n                            break;\n                        case 253 /* InterfaceDeclaration */:\n                            var interfaceKeyword = ts.tokenToString(117 /* InterfaceKeyword */);\n                            ts.Debug.assertIsDefined(interfaceKeyword);\n                            diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword));\n                            return \"skip\";\n                        case 256 /* ModuleDeclaration */:\n                            var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(140 /* NamespaceKeyword */) : ts.tokenToString(139 /* ModuleKeyword */);\n                            ts.Debug.assertIsDefined(moduleKeyword);\n                            diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword));\n                            return \"skip\";\n                        case 254 /* TypeAliasDeclaration */:\n                            diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files));\n                            return \"skip\";\n                        case 255 /* EnumDeclaration */:\n                            var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(91 /* EnumKeyword */));\n                            diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword));\n                            return \"skip\";\n                        case 225 /* NonNullExpression */:\n                            diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files));\n                            return \"skip\";\n                        case 224 /* AsExpression */:\n                            diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files));\n                            return \"skip\";\n                        case 206 /* TypeAssertionExpression */:\n                            ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX.\n                    }\n                }\n                function walkArray(nodes, parent) {\n                    if (parent.decorators === nodes && !options.experimentalDecorators) {\n                        diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning));\n                    }\n                    switch (parent.kind) {\n                        case 252 /* ClassDeclaration */:\n                        case 221 /* ClassExpression */:\n                        case 165 /* MethodDeclaration */:\n                        case 166 /* Constructor */:\n                        case 167 /* GetAccessor */:\n                        case 168 /* SetAccessor */:\n                        case 208 /* FunctionExpression */:\n                        case 251 /* FunctionDeclaration */:\n                        case 209 /* ArrowFunction */:\n                            // Check type parameters\n                            if (nodes === parent.typeParameters) {\n                                diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files));\n                                return \"skip\";\n                            }\n                        // falls through\n                        case 232 /* VariableStatement */:\n                            // Check modifiers\n                            if (nodes === parent.modifiers) {\n                                checkModifiers(parent.modifiers, parent.kind === 232 /* VariableStatement */);\n                                return \"skip\";\n                            }\n                            break;\n                        case 163 /* PropertyDeclaration */:\n                            // Check modifiers of property declaration\n                            if (nodes === parent.modifiers) {\n                                for (var _i = 0, _a = nodes; _i < _a.length; _i++) {\n                                    var modifier = _a[_i];\n                                    if (modifier.kind !== 123 /* StaticKeyword */) {\n                                        diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind)));\n                                    }\n                                }\n                                return \"skip\";\n                            }\n                            break;\n                        case 160 /* Parameter */:\n                            // Check modifiers of parameter declaration\n                            if (nodes === parent.modifiers) {\n                                diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files));\n                                return \"skip\";\n                            }\n                            break;\n                        case 203 /* CallExpression */:\n                        case 204 /* NewExpression */:\n                        case 223 /* ExpressionWithTypeArguments */:\n                        case 274 /* JsxSelfClosingElement */:\n                        case 275 /* JsxOpeningElement */:\n                        case 205 /* TaggedTemplateExpression */:\n                            // Check type arguments\n                            if (nodes === parent.typeArguments) {\n                                diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files));\n                                return \"skip\";\n                            }\n                            break;\n                    }\n                }\n                function checkModifiers(modifiers, isConstValid) {\n                    for (var _i = 0, modifiers_2 = modifiers; _i < modifiers_2.length; _i++) {\n                        var modifier = modifiers_2[_i];\n                        switch (modifier.kind) {\n                            case 84 /* ConstKeyword */:\n                                if (isConstValid) {\n                                    continue;\n                                }\n                            // to report error,\n                            // falls through\n                            case 122 /* PublicKeyword */:\n                            case 120 /* PrivateKeyword */:\n                            case 121 /* ProtectedKeyword */:\n                            case 142 /* ReadonlyKeyword */:\n                            case 133 /* DeclareKeyword */:\n                            case 125 /* AbstractKeyword */:\n                                diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind)));\n                                break;\n                            // These are all legal modifiers.\n                            case 123 /* StaticKeyword */:\n                            case 92 /* ExportKeyword */:\n                            case 87 /* DefaultKeyword */:\n                        }\n                    }\n                }\n                function createDiagnosticForNodeArray(nodes, message, arg0, arg1, arg2) {\n                    var start = nodes.pos;\n                    return ts.createFileDiagnostic(sourceFile, start, nodes.end - start, message, arg0, arg1, arg2);\n                }\n                // Since these are syntactic diagnostics, parent might not have been set\n                // this means the sourceFile cannot be infered from the node\n                function createDiagnosticForNode(node, message, arg0, arg1, arg2) {\n                    return ts.createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2);\n                }\n            });\n        }\n        function getDeclarationDiagnosticsWorker(sourceFile, cancellationToken) {\n            return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedDeclarationDiagnosticsForFile, getDeclarationDiagnosticsForFileNoCache);\n        }\n        function getDeclarationDiagnosticsForFileNoCache(sourceFile, cancellationToken) {\n            return runWithCancellationToken(function () {\n                var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile, cancellationToken);\n                // Don't actually write any files since we're just getting diagnostics.\n                return ts.getDeclarationDiagnostics(getEmitHost(ts.noop), resolver, sourceFile) || ts.emptyArray;\n            });\n        }\n        function getAndCacheDiagnostics(sourceFile, cancellationToken, cache, getDiagnostics) {\n            var _a;\n            var cachedResult = sourceFile\n                ? (_a = cache.perFile) === null || _a === void 0 ? void 0 : _a.get(sourceFile.path)\n                : cache.allDiagnostics;\n            if (cachedResult) {\n                return cachedResult;\n            }\n            var result = getDiagnostics(sourceFile, cancellationToken);\n            if (sourceFile) {\n                (cache.perFile || (cache.perFile = new ts.Map())).set(sourceFile.path, result);\n            }\n            else {\n                cache.allDiagnostics = result;\n            }\n            return result;\n        }\n        function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) {\n            return sourceFile.isDeclarationFile ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken);\n        }\n        function getOptionsDiagnostics() {\n            return ts.sortAndDeduplicateDiagnostics(ts.concatenate(programDiagnostics.getGlobalDiagnostics(), getOptionsDiagnosticsOfConfigFile()));\n        }\n        function getOptionsDiagnosticsOfConfigFile() {\n            if (!options.configFile) {\n                return ts.emptyArray;\n            }\n            var diagnostics = programDiagnostics.getDiagnostics(options.configFile.fileName);\n            forEachResolvedProjectReference(function (resolvedRef) {\n                diagnostics = ts.concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName));\n            });\n            return diagnostics;\n        }\n        function getGlobalDiagnostics() {\n            return rootNames.length ? ts.sortAndDeduplicateDiagnostics(getDiagnosticsProducingTypeChecker().getGlobalDiagnostics().slice()) : ts.emptyArray;\n        }\n        function getConfigFileParsingDiagnostics() {\n            return configFileParsingDiagnostics || ts.emptyArray;\n        }\n        function processRootFile(fileName, isDefaultLib, ignoreNoDefaultLib, reason) {\n            processSourceFile(ts.normalizePath(fileName), isDefaultLib, ignoreNoDefaultLib, /*packageId*/ undefined, reason);\n        }\n        function fileReferenceIsEqualTo(a, b) {\n            return a.fileName === b.fileName;\n        }\n        function moduleNameIsEqualTo(a, b) {\n            return a.kind === 78 /* Identifier */\n                ? b.kind === 78 /* Identifier */ && a.escapedText === b.escapedText\n                : b.kind === 10 /* StringLiteral */ && a.text === b.text;\n        }\n        function createSyntheticImport(text, file) {\n            var externalHelpersModuleReference = ts.factory.createStringLiteral(text);\n            var importDecl = ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference);\n            ts.addEmitFlags(importDecl, 67108864 /* NeverApplyImportHelper */);\n            ts.setParent(externalHelpersModuleReference, importDecl);\n            ts.setParent(importDecl, file);\n            // explicitly unset the synthesized flag on these declarations so the checker API will answer questions about them\n            // (which is required to build the dependency graph for incremental emit)\n            externalHelpersModuleReference.flags &= ~8 /* Synthesized */;\n            importDecl.flags &= ~8 /* Synthesized */;\n            return externalHelpersModuleReference;\n        }\n        function collectExternalModuleReferences(file) {\n            if (file.imports) {\n                return;\n            }\n            var isJavaScriptFile = ts.isSourceFileJS(file);\n            var isExternalModuleFile = ts.isExternalModule(file);\n            // file.imports may not be undefined if there exists dynamic import\n            var imports;\n            var moduleAugmentations;\n            var ambientModules;\n            // If we are importing helpers, we need to add a synthetic reference to resolve the\n            // helpers library.\n            if ((options.isolatedModules || isExternalModuleFile)\n                && !file.isDeclarationFile) {\n                if (options.importHelpers) {\n                    // synthesize 'import \"tslib\"' declaration\n                    imports = [createSyntheticImport(ts.externalHelpersModuleNameText, file)];\n                }\n                var jsxImport = ts.getJSXRuntimeImport(ts.getJSXImplicitImportBase(options, file), options);\n                if (jsxImport) {\n                    // synthesize `import \"base/jsx-runtime\"` declaration\n                    (imports || (imports = [])).push(createSyntheticImport(jsxImport, file));\n                }\n            }\n            for (var _i = 0, _a = file.statements; _i < _a.length; _i++) {\n                var node = _a[_i];\n                collectModuleReferences(node, /*inAmbientModule*/ false);\n            }\n            if ((file.flags & 1048576 /* PossiblyContainsDynamicImport */) || isJavaScriptFile) {\n                collectDynamicImportOrRequireCalls(file);\n            }\n            file.imports = imports || ts.emptyArray;\n            file.moduleAugmentations = moduleAugmentations || ts.emptyArray;\n            file.ambientModuleNames = ambientModules || ts.emptyArray;\n            return;\n            function collectModuleReferences(node, inAmbientModule) {\n                if (ts.isAnyImportOrReExport(node)) {\n                    var moduleNameExpr = ts.getExternalModuleName(node);\n                    // TypeScript 1.0 spec (April 2014): 12.1.6\n                    // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference other external modules\n                    // only through top - level external module names. Relative external module names are not permitted.\n                    if (moduleNameExpr && ts.isStringLiteral(moduleNameExpr) && moduleNameExpr.text && (!inAmbientModule || !ts.isExternalModuleNameRelative(moduleNameExpr.text))) {\n                        imports = ts.append(imports, moduleNameExpr);\n                    }\n                }\n                else if (ts.isModuleDeclaration(node)) {\n                    if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasSyntacticModifier(node, 2 /* Ambient */) || file.isDeclarationFile)) {\n                        var nameText = ts.getTextOfIdentifierOrLiteral(node.name);\n                        // Ambient module declarations can be interpreted as augmentations for some existing external modules.\n                        // This will happen in two cases:\n                        // - if current file is external module then module augmentation is a ambient module declaration defined in the top level scope\n                        // - if current file is not external module then module augmentation is an ambient module declaration with non-relative module name\n                        //   immediately nested in top level ambient module declaration .\n                        if (isExternalModuleFile || (inAmbientModule && !ts.isExternalModuleNameRelative(nameText))) {\n                            (moduleAugmentations || (moduleAugmentations = [])).push(node.name);\n                        }\n                        else if (!inAmbientModule) {\n                            if (file.isDeclarationFile) {\n                                // for global .d.ts files record name of ambient module\n                                (ambientModules || (ambientModules = [])).push(nameText);\n                            }\n                            // An AmbientExternalModuleDeclaration declares an external module.\n                            // This type of declaration is permitted only in the global module.\n                            // The StringLiteral must specify a top - level external module name.\n                            // Relative external module names are not permitted\n                            // NOTE: body of ambient module is always a module block, if it exists\n                            var body = node.body;\n                            if (body) {\n                                for (var _i = 0, _a = body.statements; _i < _a.length; _i++) {\n                                    var statement = _a[_i];\n                                    collectModuleReferences(statement, /*inAmbientModule*/ true);\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n            function collectDynamicImportOrRequireCalls(file) {\n                var r = /import|require/g;\n                while (r.exec(file.text) !== null) { // eslint-disable-line no-null/no-null\n                    var node = getNodeAtPosition(file, r.lastIndex);\n                    if (isJavaScriptFile && ts.isRequireCall(node, /*checkArgumentIsStringLiteralLike*/ true)) {\n                        imports = ts.append(imports, node.arguments[0]);\n                    }\n                    // we have to check the argument list has length of 1. We will still have to process these even though we have parsing error.\n                    else if (ts.isImportCall(node) && node.arguments.length === 1 && ts.isStringLiteralLike(node.arguments[0])) {\n                        imports = ts.append(imports, node.arguments[0]);\n                    }\n                    else if (ts.isLiteralImportTypeNode(node)) {\n                        imports = ts.append(imports, node.argument.literal);\n                    }\n                }\n            }\n            /** Returns a token if position is in [start-of-leading-trivia, end), includes JSDoc only in JS files */\n            function getNodeAtPosition(sourceFile, position) {\n                var current = sourceFile;\n                var getContainingChild = function (child) {\n                    if (child.pos <= position && (position < child.end || (position === child.end && (child.kind === 1 /* EndOfFileToken */)))) {\n                        return child;\n                    }\n                };\n                while (true) {\n                    var child = isJavaScriptFile && ts.hasJSDocNodes(current) && ts.forEach(current.jsDoc, getContainingChild) || ts.forEachChild(current, getContainingChild);\n                    if (!child) {\n                        return current;\n                    }\n                    current = child;\n                }\n            }\n        }\n        function getLibFileFromReference(ref) {\n            var libName = ts.toFileNameLowerCase(ref.fileName);\n            var libFileName = ts.libMap.get(libName);\n            if (libFileName) {\n                return getSourceFile(ts.combinePaths(defaultLibraryPath, libFileName));\n            }\n        }\n        /** This should have similar behavior to 'processSourceFile' without diagnostics or mutation. */\n        function getSourceFileFromReference(referencingFile, ref) {\n            return getSourceFileFromReferenceWorker(resolveTripleslashReference(ref.fileName, referencingFile.fileName), getSourceFile);\n        }\n        function getSourceFileFromReferenceWorker(fileName, getSourceFile, fail, reason) {\n            if (ts.hasExtension(fileName)) {\n                var canonicalFileName_1 = host.getCanonicalFileName(fileName);\n                if (!options.allowNonTsExtensions && !ts.forEach(supportedExtensionsWithJsonIfResolveJsonModule, function (extension) { return ts.fileExtensionIs(canonicalFileName_1, extension); })) {\n                    if (fail) {\n                        if (ts.hasJSFileExtension(canonicalFileName_1)) {\n                            fail(ts.Diagnostics.File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option, fileName);\n                        }\n                        else {\n                            fail(ts.Diagnostics.File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1, fileName, \"'\" + supportedExtensions.join(\"', '\") + \"'\");\n                        }\n                    }\n                    return undefined;\n                }\n                var sourceFile = getSourceFile(fileName);\n                if (fail) {\n                    if (!sourceFile) {\n                        var redirect = getProjectReferenceRedirect(fileName);\n                        if (redirect) {\n                            fail(ts.Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, fileName);\n                        }\n                        else {\n                            fail(ts.Diagnostics.File_0_not_found, fileName);\n                        }\n                    }\n                    else if (isReferencedFile(reason) && canonicalFileName_1 === host.getCanonicalFileName(getSourceFileByPath(reason.file).fileName)) {\n                        fail(ts.Diagnostics.A_file_cannot_have_a_reference_to_itself);\n                    }\n                }\n                return sourceFile;\n            }\n            else {\n                var sourceFileNoExtension = options.allowNonTsExtensions && getSourceFile(fileName);\n                if (sourceFileNoExtension)\n                    return sourceFileNoExtension;\n                if (fail && options.allowNonTsExtensions) {\n                    fail(ts.Diagnostics.File_0_not_found, fileName);\n                    return undefined;\n                }\n                var sourceFileWithAddedExtension = ts.forEach(supportedExtensions, function (extension) { return getSourceFile(fileName + extension); });\n                if (fail && !sourceFileWithAddedExtension)\n                    fail(ts.Diagnostics.Could_not_resolve_the_path_0_with_the_extensions_Colon_1, fileName, \"'\" + supportedExtensions.join(\"', '\") + \"'\");\n                return sourceFileWithAddedExtension;\n            }\n        }\n        /** This has side effects through `findSourceFile`. */\n        function processSourceFile(fileName, isDefaultLib, ignoreNoDefaultLib, packageId, reason) {\n            getSourceFileFromReferenceWorker(fileName, function (fileName) { return findSourceFile(fileName, toPath(fileName), isDefaultLib, ignoreNoDefaultLib, reason, packageId); }, // TODO: GH#18217\n            function (diagnostic) {\n                var args = [];\n                for (var _i = 1; _i < arguments.length; _i++) {\n                    args[_i - 1] = arguments[_i];\n                }\n                return addFilePreprocessingFileExplainingDiagnostic(/*file*/ undefined, reason, diagnostic, args);\n            }, reason);\n        }\n        function processProjectReferenceFile(fileName, reason) {\n            return processSourceFile(fileName, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined, reason);\n        }\n        function reportFileNamesDifferOnlyInCasingError(fileName, existingFile, reason) {\n            var hasExistingReasonToReportErrorOn = !isReferencedFile(reason) && ts.some(fileReasons.get(existingFile.path), isReferencedFile);\n            if (hasExistingReasonToReportErrorOn) {\n                addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, ts.Diagnostics.Already_included_file_name_0_differs_from_file_name_1_only_in_casing, [existingFile.fileName, fileName]);\n            }\n            else {\n                addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, [fileName, existingFile.fileName]);\n            }\n        }\n        function createRedirectSourceFile(redirectTarget, unredirected, fileName, path, resolvedPath, originalFileName) {\n            var redirect = Object.create(redirectTarget);\n            redirect.fileName = fileName;\n            redirect.path = path;\n            redirect.resolvedPath = resolvedPath;\n            redirect.originalFileName = originalFileName;\n            redirect.redirectInfo = { redirectTarget: redirectTarget, unredirected: unredirected };\n            sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0);\n            Object.defineProperties(redirect, {\n                id: {\n                    get: function () { return this.redirectInfo.redirectTarget.id; },\n                    set: function (value) { this.redirectInfo.redirectTarget.id = value; },\n                },\n                symbol: {\n                    get: function () { return this.redirectInfo.redirectTarget.symbol; },\n                    set: function (value) { this.redirectInfo.redirectTarget.symbol = value; },\n                },\n            });\n            return redirect;\n        }\n        // Get source file from normalized fileName\n        function findSourceFile(fileName, path, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"program\" /* Program */, \"findSourceFile\", {\n                fileName: fileName,\n                isDefaultLib: isDefaultLib || undefined,\n                fileIncludeKind: ts.FileIncludeKind[reason.kind],\n            });\n            var result = findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, reason, packageId);\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n            return result;\n        }\n        function findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {\n            if (useSourceOfProjectReferenceRedirect) {\n                var source = getSourceOfProjectReferenceRedirect(fileName);\n                // If preserveSymlinks is true, module resolution wont jump the symlink\n                // but the resolved real path may be the .d.ts from project reference\n                // Note:: Currently we try the real path only if the\n                // file is from node_modules to avoid having to run real path on all file paths\n                if (!source &&\n                    host.realpath &&\n                    options.preserveSymlinks &&\n                    ts.isDeclarationFileName(fileName) &&\n                    ts.stringContains(fileName, ts.nodeModulesPathPart)) {\n                    var realPath = host.realpath(fileName);\n                    if (realPath !== fileName)\n                        source = getSourceOfProjectReferenceRedirect(realPath);\n                }\n                if (source) {\n                    var file_1 = ts.isString(source) ?\n                        findSourceFile(source, toPath(source), isDefaultLib, ignoreNoDefaultLib, reason, packageId) :\n                        undefined;\n                    if (file_1)\n                        addFileToFilesByName(file_1, path, /*redirectedPath*/ undefined);\n                    return file_1;\n                }\n            }\n            var originalFileName = fileName;\n            if (filesByName.has(path)) {\n                var file_2 = filesByName.get(path);\n                addFileIncludeReason(file_2 || undefined, reason);\n                // try to check if we've already seen this file but with a different casing in path\n                // NOTE: this only makes sense for case-insensitive file systems, and only on files which are not redirected\n                if (file_2 && options.forceConsistentCasingInFileNames) {\n                    var checkedName = file_2.fileName;\n                    var isRedirect = toPath(checkedName) !== toPath(fileName);\n                    if (isRedirect) {\n                        fileName = getProjectReferenceRedirect(fileName) || fileName;\n                    }\n                    // Check if it differs only in drive letters its ok to ignore that error:\n                    var checkedAbsolutePath = ts.getNormalizedAbsolutePathWithoutRoot(checkedName, currentDirectory);\n                    var inputAbsolutePath = ts.getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory);\n                    if (checkedAbsolutePath !== inputAbsolutePath) {\n                        reportFileNamesDifferOnlyInCasingError(fileName, file_2, reason);\n                    }\n                }\n                // If the file was previously found via a node_modules search, but is now being processed as a root file,\n                // then everything it sucks in may also be marked incorrectly, and needs to be checked again.\n                if (file_2 && sourceFilesFoundSearchingNodeModules.get(file_2.path) && currentNodeModulesDepth === 0) {\n                    sourceFilesFoundSearchingNodeModules.set(file_2.path, false);\n                    if (!options.noResolve) {\n                        processReferencedFiles(file_2, isDefaultLib);\n                        processTypeReferenceDirectives(file_2);\n                    }\n                    if (!options.noLib) {\n                        processLibReferenceDirectives(file_2);\n                    }\n                    modulesWithElidedImports.set(file_2.path, false);\n                    processImportedModules(file_2);\n                }\n                // See if we need to reprocess the imports due to prior skipped imports\n                else if (file_2 && modulesWithElidedImports.get(file_2.path)) {\n                    if (currentNodeModulesDepth < maxNodeModuleJsDepth) {\n                        modulesWithElidedImports.set(file_2.path, false);\n                        processImportedModules(file_2);\n                    }\n                }\n                return file_2 || undefined;\n            }\n            var redirectedPath;\n            if (isReferencedFile(reason) && !useSourceOfProjectReferenceRedirect) {\n                var redirectProject = getProjectReferenceRedirectProject(fileName);\n                if (redirectProject) {\n                    if (ts.outFile(redirectProject.commandLine.options)) {\n                        // Shouldnt create many to 1 mapping file in --out scenario\n                        return undefined;\n                    }\n                    var redirect = getProjectReferenceOutputName(redirectProject, fileName);\n                    fileName = redirect;\n                    // Once we start redirecting to a file, we can potentially come back to it\n                    // via a back-reference from another file in the .d.ts folder. If that happens we'll\n                    // end up trying to add it to the program *again* because we were tracking it via its\n                    // original (un-redirected) name. So we have to map both the original path and the redirected path\n                    // to the source file we're about to find/create\n                    redirectedPath = toPath(redirect);\n                }\n            }\n            // We haven't looked for this file, do so now and cache result\n            var file = host.getSourceFile(fileName, options.target, function (hostErrorMessage) { return addFilePreprocessingFileExplainingDiagnostic(/*file*/ undefined, reason, ts.Diagnostics.Cannot_read_file_0_Colon_1, [fileName, hostErrorMessage]); }, shouldCreateNewSourceFile);\n            if (packageId) {\n                var packageIdKey = ts.packageIdToString(packageId);\n                var fileFromPackageId = packageIdToSourceFile.get(packageIdKey);\n                if (fileFromPackageId) {\n                    // Some other SourceFile already exists with this package name and version.\n                    // Instead of creating a duplicate, just redirect to the existing one.\n                    var dupFile = createRedirectSourceFile(fileFromPackageId, file, fileName, path, toPath(fileName), originalFileName); // TODO: GH#18217\n                    redirectTargetsMap.add(fileFromPackageId.path, fileName);\n                    addFileToFilesByName(dupFile, path, redirectedPath);\n                    addFileIncludeReason(dupFile, reason);\n                    sourceFileToPackageName.set(path, packageId.name);\n                    processingOtherFiles.push(dupFile);\n                    return dupFile;\n                }\n                else if (file) {\n                    // This is the first source file to have this packageId.\n                    packageIdToSourceFile.set(packageIdKey, file);\n                    sourceFileToPackageName.set(path, packageId.name);\n                }\n            }\n            addFileToFilesByName(file, path, redirectedPath);\n            if (file) {\n                sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0);\n                file.fileName = fileName; // Ensure that source file has same name as what we were looking for\n                file.path = path;\n                file.resolvedPath = toPath(fileName);\n                file.originalFileName = originalFileName;\n                addFileIncludeReason(file, reason);\n                if (host.useCaseSensitiveFileNames()) {\n                    var pathLowerCase = ts.toFileNameLowerCase(path);\n                    // for case-sensitive file systems check if we've already seen some file with similar filename ignoring case\n                    var existingFile = filesByNameIgnoreCase.get(pathLowerCase);\n                    if (existingFile) {\n                        reportFileNamesDifferOnlyInCasingError(fileName, existingFile, reason);\n                    }\n                    else {\n                        filesByNameIgnoreCase.set(pathLowerCase, file);\n                    }\n                }\n                skipDefaultLib = skipDefaultLib || (file.hasNoDefaultLib && !ignoreNoDefaultLib);\n                if (!options.noResolve) {\n                    processReferencedFiles(file, isDefaultLib);\n                    processTypeReferenceDirectives(file);\n                }\n                if (!options.noLib) {\n                    processLibReferenceDirectives(file);\n                }\n                // always process imported modules to record module name resolutions\n                processImportedModules(file);\n                if (isDefaultLib) {\n                    processingDefaultLibFiles.push(file);\n                }\n                else {\n                    processingOtherFiles.push(file);\n                }\n            }\n            return file;\n        }\n        function addFileIncludeReason(file, reason) {\n            if (file)\n                fileReasons.add(file.path, reason);\n        }\n        function addFileToFilesByName(file, path, redirectedPath) {\n            if (redirectedPath) {\n                filesByName.set(redirectedPath, file);\n                filesByName.set(path, file || false);\n            }\n            else {\n                filesByName.set(path, file);\n            }\n        }\n        function getProjectReferenceRedirect(fileName) {\n            var referencedProject = getProjectReferenceRedirectProject(fileName);\n            return referencedProject && getProjectReferenceOutputName(referencedProject, fileName);\n        }\n        function getProjectReferenceRedirectProject(fileName) {\n            // Ignore dts or any json files\n            if (!resolvedProjectReferences || !resolvedProjectReferences.length || ts.fileExtensionIs(fileName, \".d.ts\" /* Dts */) || ts.fileExtensionIs(fileName, \".json\" /* Json */)) {\n                return undefined;\n            }\n            // If this file is produced by a referenced project, we need to rewrite it to\n            // look in the output folder of the referenced project rather than the input\n            return getResolvedProjectReferenceToRedirect(fileName);\n        }\n        function getProjectReferenceOutputName(referencedProject, fileName) {\n            var out = ts.outFile(referencedProject.commandLine.options);\n            return out ?\n                ts.changeExtension(out, \".d.ts\" /* Dts */) :\n                ts.getOutputDeclarationFileName(fileName, referencedProject.commandLine, !host.useCaseSensitiveFileNames());\n        }\n        /**\n         * Get the referenced project if the file is input file from that reference project\n         */\n        function getResolvedProjectReferenceToRedirect(fileName) {\n            if (mapFromFileToProjectReferenceRedirects === undefined) {\n                mapFromFileToProjectReferenceRedirects = new ts.Map();\n                forEachResolvedProjectReference(function (referencedProject) {\n                    // not input file from the referenced project, ignore\n                    if (toPath(options.configFilePath) !== referencedProject.sourceFile.path) {\n                        referencedProject.commandLine.fileNames.forEach(function (f) {\n                            return mapFromFileToProjectReferenceRedirects.set(toPath(f), referencedProject.sourceFile.path);\n                        });\n                    }\n                });\n            }\n            var referencedProjectPath = mapFromFileToProjectReferenceRedirects.get(toPath(fileName));\n            return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath);\n        }\n        function forEachResolvedProjectReference(cb) {\n            return ts.forEachResolvedProjectReference(resolvedProjectReferences, cb);\n        }\n        function getSourceOfProjectReferenceRedirect(file) {\n            if (!ts.isDeclarationFileName(file))\n                return undefined;\n            if (mapFromToProjectReferenceRedirectSource === undefined) {\n                mapFromToProjectReferenceRedirectSource = new ts.Map();\n                forEachResolvedProjectReference(function (resolvedRef) {\n                    var out = ts.outFile(resolvedRef.commandLine.options);\n                    if (out) {\n                        // Dont know which source file it means so return true?\n                        var outputDts = ts.changeExtension(out, \".d.ts\" /* Dts */);\n                        mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), true);\n                    }\n                    else {\n                        var getCommonSourceDirectory_3 = ts.memoize(function () { return ts.getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames()); });\n                        ts.forEach(resolvedRef.commandLine.fileNames, function (fileName) {\n                            if (!ts.fileExtensionIs(fileName, \".d.ts\" /* Dts */) && !ts.fileExtensionIs(fileName, \".json\" /* Json */)) {\n                                var outputDts = ts.getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory_3);\n                                mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), fileName);\n                            }\n                        });\n                    }\n                });\n            }\n            return mapFromToProjectReferenceRedirectSource.get(toPath(file));\n        }\n        function isSourceOfProjectReferenceRedirect(fileName) {\n            return useSourceOfProjectReferenceRedirect && !!getResolvedProjectReferenceToRedirect(fileName);\n        }\n        function getResolvedProjectReferenceByPath(projectReferencePath) {\n            if (!projectReferenceRedirects) {\n                return undefined;\n            }\n            return projectReferenceRedirects.get(projectReferencePath) || undefined;\n        }\n        function processReferencedFiles(file, isDefaultLib) {\n            ts.forEach(file.referencedFiles, function (ref, index) {\n                processSourceFile(resolveTripleslashReference(ref.fileName, file.fileName), isDefaultLib, \n                /*ignoreNoDefaultLib*/ false, \n                /*packageId*/ undefined, { kind: ts.FileIncludeKind.ReferenceFile, file: file.path, index: index, });\n            });\n        }\n        function processTypeReferenceDirectives(file) {\n            // We lower-case all type references because npm automatically lowercases all packages. See GH#9824.\n            var typeDirectives = ts.map(file.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); });\n            if (!typeDirectives) {\n                return;\n            }\n            var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file);\n            for (var index = 0; index < typeDirectives.length; index++) {\n                var ref = file.typeReferenceDirectives[index];\n                var resolvedTypeReferenceDirective = resolutions[index];\n                // store resolved type directive on the file\n                var fileName = ts.toFileNameLowerCase(ref.fileName);\n                ts.setResolvedTypeReferenceDirective(file, fileName, resolvedTypeReferenceDirective);\n                processTypeReferenceDirective(fileName, resolvedTypeReferenceDirective, { kind: ts.FileIncludeKind.TypeReferenceDirective, file: file.path, index: index, });\n            }\n        }\n        function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, reason) {\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push(\"program\" /* Program */, \"processTypeReferenceDirective\", { directive: typeReferenceDirective, hasResolved: !!resolveModuleNamesReusingOldState, refKind: reason.kind, refPath: isReferencedFile(reason) ? reason.file : undefined });\n            processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, reason);\n            ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();\n        }\n        function processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, reason) {\n            // If we already found this library as a primary reference - nothing to do\n            var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective);\n            if (previousResolution && previousResolution.primary) {\n                return;\n            }\n            var saveResolution = true;\n            if (resolvedTypeReferenceDirective) {\n                if (resolvedTypeReferenceDirective.isExternalLibraryImport)\n                    currentNodeModulesDepth++;\n                if (resolvedTypeReferenceDirective.primary) {\n                    // resolved from the primary path\n                    processSourceFile(resolvedTypeReferenceDirective.resolvedFileName, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, resolvedTypeReferenceDirective.packageId, reason); // TODO: GH#18217\n                }\n                else {\n                    // If we already resolved to this file, it must have been a secondary reference. Check file contents\n                    // for sameness and possibly issue an error\n                    if (previousResolution) {\n                        // Don't bother reading the file again if it's the same file.\n                        if (resolvedTypeReferenceDirective.resolvedFileName !== previousResolution.resolvedFileName) {\n                            var otherFileText = host.readFile(resolvedTypeReferenceDirective.resolvedFileName);\n                            var existingFile = getSourceFile(previousResolution.resolvedFileName);\n                            if (otherFileText !== existingFile.text) {\n                                addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, ts.Diagnostics.Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict, [typeReferenceDirective, resolvedTypeReferenceDirective.resolvedFileName, previousResolution.resolvedFileName]);\n                            }\n                        }\n                        // don't overwrite previous resolution result\n                        saveResolution = false;\n                    }\n                    else {\n                        // First resolution of this library\n                        processSourceFile(resolvedTypeReferenceDirective.resolvedFileName, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, resolvedTypeReferenceDirective.packageId, reason);\n                    }\n                }\n                if (resolvedTypeReferenceDirective.isExternalLibraryImport)\n                    currentNodeModulesDepth--;\n            }\n            else {\n                addFilePreprocessingFileExplainingDiagnostic(/*file*/ undefined, reason, ts.Diagnostics.Cannot_find_type_definition_file_for_0, [typeReferenceDirective]);\n            }\n            if (saveResolution) {\n                resolvedTypeReferenceDirectives.set(typeReferenceDirective, resolvedTypeReferenceDirective);\n            }\n        }\n        function processLibReferenceDirectives(file) {\n            ts.forEach(file.libReferenceDirectives, function (libReference, index) {\n                var libName = ts.toFileNameLowerCase(libReference.fileName);\n                var libFileName = ts.libMap.get(libName);\n                if (libFileName) {\n                    // we ignore any 'no-default-lib' reference set on this file.\n                    processRootFile(ts.combinePaths(defaultLibraryPath, libFileName), /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ true, { kind: ts.FileIncludeKind.LibReferenceDirective, file: file.path, index: index, });\n                }\n                else {\n                    var unqualifiedLibName = ts.removeSuffix(ts.removePrefix(libName, \"lib.\"), \".d.ts\");\n                    var suggestion = ts.getSpellingSuggestion(unqualifiedLibName, ts.libs, ts.identity);\n                    var diagnostic = suggestion ? ts.Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1 : ts.Diagnostics.Cannot_find_lib_definition_for_0;\n                    (fileProcessingDiagnostics || (fileProcessingDiagnostics = [])).push({\n                        kind: 0 /* FilePreprocessingReferencedDiagnostic */,\n                        reason: { kind: ts.FileIncludeKind.LibReferenceDirective, file: file.path, index: index, },\n                        diagnostic: diagnostic,\n                        args: [libName, suggestion]\n                    });\n                }\n            });\n        }\n        function getCanonicalFileName(fileName) {\n            return host.getCanonicalFileName(fileName);\n        }\n        function processImportedModules(file) {\n            collectExternalModuleReferences(file);\n            if (file.imports.length || file.moduleAugmentations.length) {\n                // Because global augmentation doesn't have string literal name, we can check for global augmentation as such.\n                var moduleNames = getModuleNames(file);\n                var resolutions = resolveModuleNamesReusingOldState(moduleNames, file);\n                ts.Debug.assert(resolutions.length === moduleNames.length);\n                for (var index = 0; index < moduleNames.length; index++) {\n                    var resolution = resolutions[index];\n                    ts.setResolvedModule(file, moduleNames[index], resolution);\n                    if (!resolution) {\n                        continue;\n                    }\n                    var isFromNodeModulesSearch = resolution.isExternalLibraryImport;\n                    var isJsFile = !ts.resolutionExtensionIsTSOrJson(resolution.extension);\n                    var isJsFileFromNodeModules = isFromNodeModulesSearch && isJsFile;\n                    var resolvedFileName = resolution.resolvedFileName;\n                    if (isFromNodeModulesSearch) {\n                        currentNodeModulesDepth++;\n                    }\n                    // add file to program only if:\n                    // - resolution was successful\n                    // - noResolve is falsy\n                    // - module name comes from the list of imports\n                    // - it's not a top level JavaScript module that exceeded the search max\n                    var elideImport = isJsFileFromNodeModules && currentNodeModulesDepth > maxNodeModuleJsDepth;\n                    // Don't add the file if it has a bad extension (e.g. 'tsx' if we don't have '--allowJs')\n                    // This may still end up being an untyped module -- the file won't be included but imports will be allowed.\n                    var shouldAddFile = resolvedFileName\n                        && !getResolutionDiagnostic(options, resolution)\n                        && !options.noResolve\n                        && index < file.imports.length\n                        && !elideImport\n                        && !(isJsFile && !ts.getAllowJSCompilerOption(options))\n                        && (ts.isInJSFile(file.imports[index]) || !(file.imports[index].flags & 4194304 /* JSDoc */));\n                    if (elideImport) {\n                        modulesWithElidedImports.set(file.path, true);\n                    }\n                    else if (shouldAddFile) {\n                        var path = toPath(resolvedFileName);\n                        findSourceFile(resolvedFileName, path, \n                        /*isDefaultLib*/ false, \n                        /*ignoreNoDefaultLib*/ false, { kind: ts.FileIncludeKind.Import, file: file.path, index: index, }, resolution.packageId);\n                    }\n                    if (isFromNodeModulesSearch) {\n                        currentNodeModulesDepth--;\n                    }\n                }\n            }\n            else {\n                // no imports - drop cached module resolutions\n                file.resolvedModules = undefined;\n            }\n        }\n        function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) {\n            var allFilesBelongToPath = true;\n            var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory));\n            for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) {\n                var sourceFile = sourceFiles_2[_i];\n                if (!sourceFile.isDeclarationFile) {\n                    var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory));\n                    if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) {\n                        addProgramDiagnosticExplainingFile(sourceFile, ts.Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, [sourceFile.fileName, rootDirectory]);\n                        allFilesBelongToPath = false;\n                    }\n                }\n            }\n            return allFilesBelongToPath;\n        }\n        function parseProjectReferenceConfigFile(ref) {\n            if (!projectReferenceRedirects) {\n                projectReferenceRedirects = new ts.Map();\n            }\n            // The actual filename (i.e. add \"/tsconfig.json\" if necessary)\n            var refPath = resolveProjectReferencePath(ref);\n            var sourceFilePath = toPath(refPath);\n            var fromCache = projectReferenceRedirects.get(sourceFilePath);\n            if (fromCache !== undefined) {\n                return fromCache || undefined;\n            }\n            var commandLine;\n            var sourceFile;\n            if (host.getParsedCommandLine) {\n                commandLine = host.getParsedCommandLine(refPath);\n                if (!commandLine) {\n                    addFileToFilesByName(/*sourceFile*/ undefined, sourceFilePath, /*redirectedPath*/ undefined);\n                    projectReferenceRedirects.set(sourceFilePath, false);\n                    return undefined;\n                }\n                sourceFile = ts.Debug.checkDefined(commandLine.options.configFile);\n                ts.Debug.assert(!sourceFile.path || sourceFile.path === sourceFilePath);\n                addFileToFilesByName(sourceFile, sourceFilePath, /*redirectedPath*/ undefined);\n            }\n            else {\n                // An absolute path pointing to the containing directory of the config file\n                var basePath = ts.getNormalizedAbsolutePath(ts.getDirectoryPath(refPath), host.getCurrentDirectory());\n                sourceFile = host.getSourceFile(refPath, 100 /* JSON */);\n                addFileToFilesByName(sourceFile, sourceFilePath, /*redirectedPath*/ undefined);\n                if (sourceFile === undefined) {\n                    projectReferenceRedirects.set(sourceFilePath, false);\n                    return undefined;\n                }\n                commandLine = ts.parseJsonSourceFileConfigFileContent(sourceFile, configParsingHost, basePath, /*existingOptions*/ undefined, refPath);\n            }\n            sourceFile.fileName = refPath;\n            sourceFile.path = sourceFilePath;\n            sourceFile.resolvedPath = sourceFilePath;\n            sourceFile.originalFileName = refPath;\n            var resolvedRef = { commandLine: commandLine, sourceFile: sourceFile };\n            projectReferenceRedirects.set(sourceFilePath, resolvedRef);\n            if (commandLine.projectReferences) {\n                resolvedRef.references = commandLine.projectReferences.map(parseProjectReferenceConfigFile);\n            }\n            return resolvedRef;\n        }\n        function verifyCompilerOptions() {\n            if (options.strictPropertyInitialization && !ts.getStrictOptionValue(options, \"strictNullChecks\")) {\n                createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, \"strictPropertyInitialization\", \"strictNullChecks\");\n            }\n            if (options.isolatedModules) {\n                if (options.out) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, \"out\", \"isolatedModules\");\n                }\n                if (options.outFile) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, \"outFile\", \"isolatedModules\");\n                }\n            }\n            if (options.inlineSourceMap) {\n                if (options.sourceMap) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, \"sourceMap\", \"inlineSourceMap\");\n                }\n                if (options.mapRoot) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, \"mapRoot\", \"inlineSourceMap\");\n                }\n            }\n            if (options.composite) {\n                if (options.declaration === false) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Composite_projects_may_not_disable_declaration_emit, \"declaration\");\n                }\n                if (options.incremental === false) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Composite_projects_may_not_disable_incremental_compilation, \"declaration\");\n                }\n            }\n            var outputFile = ts.outFile(options);\n            if (options.tsBuildInfoFile) {\n                if (!ts.isIncrementalCompilation(options)) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, \"tsBuildInfoFile\", \"incremental\", \"composite\");\n                }\n            }\n            else if (options.incremental && !outputFile && !options.configFilePath) {\n                programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));\n            }\n            verifyProjectReferences();\n            // List of collected files is complete; validate exhautiveness if this is a project with a file list\n            if (options.composite) {\n                var rootPaths = new ts.Set(rootNames.map(toPath));\n                for (var _i = 0, files_3 = files; _i < files_3.length; _i++) {\n                    var file = files_3[_i];\n                    // Ignore file that is not emitted\n                    if (ts.sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) {\n                        addProgramDiagnosticExplainingFile(file, ts.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern, [file.fileName, options.configFilePath || \"\"]);\n                    }\n                }\n            }\n            if (options.paths) {\n                for (var key in options.paths) {\n                    if (!ts.hasProperty(options.paths, key)) {\n                        continue;\n                    }\n                    if (!ts.hasZeroOrOneAsteriskCharacter(key)) {\n                        createDiagnosticForOptionPaths(/*onKey*/ true, key, ts.Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character, key);\n                    }\n                    if (ts.isArray(options.paths[key])) {\n                        var len = options.paths[key].length;\n                        if (len === 0) {\n                            createDiagnosticForOptionPaths(/*onKey*/ false, key, ts.Diagnostics.Substitutions_for_pattern_0_shouldn_t_be_an_empty_array, key);\n                        }\n                        for (var i = 0; i < len; i++) {\n                            var subst = options.paths[key][i];\n                            var typeOfSubst = typeof subst;\n                            if (typeOfSubst === \"string\") {\n                                if (!ts.hasZeroOrOneAsteriskCharacter(subst)) {\n                                    createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character, subst, key);\n                                }\n                                if (!options.baseUrl && !ts.pathIsRelative(subst) && !ts.pathIsAbsolute(subst)) {\n                                    createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash);\n                                }\n                            }\n                            else {\n                                createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2, subst, key, typeOfSubst);\n                            }\n                        }\n                    }\n                    else {\n                        createDiagnosticForOptionPaths(/*onKey*/ false, key, ts.Diagnostics.Substitutions_for_pattern_0_should_be_an_array, key);\n                    }\n                }\n            }\n            if (!options.sourceMap && !options.inlineSourceMap) {\n                if (options.inlineSources) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided, \"inlineSources\");\n                }\n                if (options.sourceRoot) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided, \"sourceRoot\");\n                }\n            }\n            if (options.out && options.outFile) {\n                createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, \"out\", \"outFile\");\n            }\n            if (options.mapRoot && !(options.sourceMap || options.declarationMap)) {\n                // Error to specify --mapRoot without --sourcemap\n                createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, \"mapRoot\", \"sourceMap\", \"declarationMap\");\n            }\n            if (options.declarationDir) {\n                if (!ts.getEmitDeclarations(options)) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, \"declarationDir\", \"declaration\", \"composite\");\n                }\n                if (outputFile) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, \"declarationDir\", options.out ? \"out\" : \"outFile\");\n                }\n            }\n            if (options.declarationMap && !ts.getEmitDeclarations(options)) {\n                createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, \"declarationMap\", \"declaration\", \"composite\");\n            }\n            if (options.lib && options.noLib) {\n                createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, \"lib\", \"noLib\");\n            }\n            if (options.noImplicitUseStrict && ts.getStrictOptionValue(options, \"alwaysStrict\")) {\n                createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, \"noImplicitUseStrict\", \"alwaysStrict\");\n            }\n            var languageVersion = options.target || 0 /* ES3 */;\n            var firstNonAmbientExternalModuleSourceFile = ts.find(files, function (f) { return ts.isExternalModule(f) && !f.isDeclarationFile; });\n            if (options.isolatedModules) {\n                if (options.module === ts.ModuleKind.None && languageVersion < 2 /* ES2015 */) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher, \"isolatedModules\", \"target\");\n                }\n                if (options.preserveConstEnums === false) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, \"preserveConstEnums\", \"isolatedModules\");\n                }\n                var firstNonExternalModuleSourceFile = ts.find(files, function (f) { return !ts.isExternalModule(f) && !ts.isSourceFileJS(f) && !f.isDeclarationFile && f.scriptKind !== 6 /* JSON */; });\n                if (firstNonExternalModuleSourceFile) {\n                    var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile);\n                    programDiagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, ts.getBaseFileName(firstNonExternalModuleSourceFile.fileName)));\n                }\n            }\n            else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ES2015 */ && options.module === ts.ModuleKind.None) {\n                // We cannot use createDiagnosticFromNode because nodes do not have parents yet\n                var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);\n                programDiagnostics.add(ts.createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none));\n            }\n            // Cannot specify module gen that isn't amd or system with --out\n            if (outputFile && !options.emitDeclarationOnly) {\n                if (options.module && !(options.module === ts.ModuleKind.AMD || options.module === ts.ModuleKind.System)) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? \"out\" : \"outFile\", \"module\");\n                }\n                else if (options.module === undefined && firstNonAmbientExternalModuleSourceFile) {\n                    var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);\n                    programDiagnostics.add(ts.createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, options.out ? \"out\" : \"outFile\"));\n                }\n            }\n            if (options.resolveJsonModule) {\n                if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, \"resolveJsonModule\");\n                }\n                // Any emit other than common js, amd, es2015 or esnext is error\n                else if (!ts.hasJsonModuleEmitEnabled(options)) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext, \"resolveJsonModule\", \"module\");\n                }\n            }\n            // there has to be common source directory if user specified --outdir || --sourceRoot\n            // if user specified --mapRoot, there needs to be common source directory if there would be multiple files being emitted\n            if (options.outDir || // there is --outDir specified\n                options.sourceRoot || // there is --sourceRoot specified\n                options.mapRoot) { // there is --mapRoot specified\n                // Precalculate and cache the common source directory\n                var dir = getCommonSourceDirectory();\n                // If we failed to find a good common directory, but outDir is specified and at least one of our files is on a windows drive/URL/other resource, add a failure\n                if (options.outDir && dir === \"\" && files.some(function (file) { return ts.getRootLength(file.fileName) > 1; })) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files, \"outDir\");\n                }\n            }\n            if (options.useDefineForClassFields && languageVersion === 0 /* ES3 */) {\n                createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3, \"useDefineForClassFields\");\n            }\n            if (options.checkJs && !ts.getAllowJSCompilerOption(options)) {\n                programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, \"checkJs\", \"allowJs\"));\n            }\n            if (options.emitDeclarationOnly) {\n                if (!ts.getEmitDeclarations(options)) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, \"emitDeclarationOnly\", \"declaration\", \"composite\");\n                }\n                if (options.noEmit) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, \"emitDeclarationOnly\", \"noEmit\");\n                }\n            }\n            if (options.emitDecoratorMetadata &&\n                !options.experimentalDecorators) {\n                createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, \"emitDecoratorMetadata\", \"experimentalDecorators\");\n            }\n            if (options.jsxFactory) {\n                if (options.reactNamespace) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, \"reactNamespace\", \"jsxFactory\");\n                }\n                if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, \"jsxFactory\", ts.inverseJsxOptionMap.get(\"\" + options.jsx));\n                }\n                if (!ts.parseIsolatedEntityName(options.jsxFactory, languageVersion)) {\n                    createOptionValueDiagnostic(\"jsxFactory\", ts.Diagnostics.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFactory);\n                }\n            }\n            else if (options.reactNamespace && !ts.isIdentifierText(options.reactNamespace, languageVersion)) {\n                createOptionValueDiagnostic(\"reactNamespace\", ts.Diagnostics.Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier, options.reactNamespace);\n            }\n            if (options.jsxFragmentFactory) {\n                if (!options.jsxFactory) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, \"jsxFragmentFactory\", \"jsxFactory\");\n                }\n                if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, \"jsxFragmentFactory\", ts.inverseJsxOptionMap.get(\"\" + options.jsx));\n                }\n                if (!ts.parseIsolatedEntityName(options.jsxFragmentFactory, languageVersion)) {\n                    createOptionValueDiagnostic(\"jsxFragmentFactory\", ts.Diagnostics.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFragmentFactory);\n                }\n            }\n            if (options.reactNamespace) {\n                if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, \"reactNamespace\", ts.inverseJsxOptionMap.get(\"\" + options.jsx));\n                }\n            }\n            if (options.jsxImportSource) {\n                if (options.jsx === 2 /* React */) {\n                    createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, \"jsxImportSource\", ts.inverseJsxOptionMap.get(\"\" + options.jsx));\n                }\n            }\n            // If the emit is enabled make sure that every output file is unique and not overwriting any of the input files\n            if (!options.noEmit && !options.suppressOutputPathCheck) {\n                var emitHost = getEmitHost();\n                var emitFilesSeen_1 = new ts.Set();\n                ts.forEachEmittedFile(emitHost, function (emitFileNames) {\n                    if (!options.emitDeclarationOnly) {\n                        verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1);\n                    }\n                    verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1);\n                });\n            }\n            // Verify that all the emit files are unique and don't overwrite input files\n            function verifyEmitFilePath(emitFileName, emitFilesSeen) {\n                if (emitFileName) {\n                    var emitFilePath = toPath(emitFileName);\n                    // Report error if the output overwrites input file\n                    if (filesByName.has(emitFilePath)) {\n                        var chain = void 0;\n                        if (!options.configFilePath) {\n                            // The program is from either an inferred project or an external project\n                            chain = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig);\n                        }\n                        chain = ts.chainDiagnosticMessages(chain, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName);\n                        blockEmittingOfFile(emitFileName, ts.createCompilerDiagnosticFromMessageChain(chain));\n                    }\n                    var emitFileKey = !host.useCaseSensitiveFileNames() ? ts.toFileNameLowerCase(emitFilePath) : emitFilePath;\n                    // Report error if multiple files write into same file\n                    if (emitFilesSeen.has(emitFileKey)) {\n                        // Already seen the same emit file - report error\n                        blockEmittingOfFile(emitFileName, ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files, emitFileName));\n                    }\n                    else {\n                        emitFilesSeen.add(emitFileKey);\n                    }\n                }\n            }\n        }\n        function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) {\n            var _a;\n            var fileIncludeReasons;\n            var relatedInfo;\n            var locationReason = isReferencedFile(fileProcessingReason) ? fileProcessingReason : undefined;\n            if (file)\n                (_a = fileReasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(processReason);\n            if (fileProcessingReason)\n                processReason(fileProcessingReason);\n            // If we have location and there is only one reason file is in which is the location, dont add details for file include\n            if (locationReason && (fileIncludeReasons === null || fileIncludeReasons === void 0 ? void 0 : fileIncludeReasons.length) === 1)\n                fileIncludeReasons = undefined;\n            var location = locationReason && getReferencedFileLocation(getSourceFileByPath, locationReason);\n            var fileIncludeReasonDetails = fileIncludeReasons && ts.chainDiagnosticMessages(fileIncludeReasons, ts.Diagnostics.The_file_is_in_the_program_because_Colon);\n            var redirectInfo = file && ts.explainIfFileIsRedirect(file);\n            var chain = ts.chainDiagnosticMessages.apply(void 0, __spreadArray([redirectInfo ? fileIncludeReasonDetails ? __spreadArray([fileIncludeReasonDetails], redirectInfo) : redirectInfo : fileIncludeReasonDetails, diagnostic], args || ts.emptyArray));\n            return location && isReferenceFileLocation(location) ?\n                ts.createFileDiagnosticFromMessageChain(location.file, location.pos, location.end - location.pos, chain, relatedInfo) :\n                ts.createCompilerDiagnosticFromMessageChain(chain, relatedInfo);\n            function processReason(reason) {\n                (fileIncludeReasons || (fileIncludeReasons = [])).push(ts.fileIncludeReasonToDiagnostics(program, reason));\n                if (!locationReason && isReferencedFile(reason)) {\n                    // Report error at first reference file or file currently in processing and dont report in related information\n                    locationReason = reason;\n                }\n                else if (locationReason !== reason) {\n                    relatedInfo = ts.append(relatedInfo, fileIncludeReasonToRelatedInformation(reason));\n                }\n                // Remove fileProcessingReason if its already included in fileReasons of the program\n                if (reason === fileProcessingReason)\n                    fileProcessingReason = undefined;\n            }\n        }\n        function addFilePreprocessingFileExplainingDiagnostic(file, fileProcessingReason, diagnostic, args) {\n            (fileProcessingDiagnostics || (fileProcessingDiagnostics = [])).push({\n                kind: 1 /* FilePreprocessingFileExplainingDiagnostic */,\n                file: file && file.path,\n                fileProcessingReason: fileProcessingReason,\n                diagnostic: diagnostic,\n                args: args\n            });\n        }\n        function addProgramDiagnosticExplainingFile(file, diagnostic, args) {\n            programDiagnostics.add(createDiagnosticExplainingFile(file, /*fileProcessingReason*/ undefined, diagnostic, args));\n        }\n        function fileIncludeReasonToRelatedInformation(reason) {\n            if (isReferencedFile(reason)) {\n                var referenceLocation = getReferencedFileLocation(getSourceFileByPath, reason);\n                var message_2;\n                switch (reason.kind) {\n                    case ts.FileIncludeKind.Import:\n                        message_2 = ts.Diagnostics.File_is_included_via_import_here;\n                        break;\n                    case ts.FileIncludeKind.ReferenceFile:\n                        message_2 = ts.Diagnostics.File_is_included_via_reference_here;\n                        break;\n                    case ts.FileIncludeKind.TypeReferenceDirective:\n                        message_2 = ts.Diagnostics.File_is_included_via_type_library_reference_here;\n                        break;\n                    case ts.FileIncludeKind.LibReferenceDirective:\n                        message_2 = ts.Diagnostics.File_is_included_via_library_reference_here;\n                        break;\n                    default:\n                        ts.Debug.assertNever(reason);\n                }\n                return isReferenceFileLocation(referenceLocation) ? ts.createFileDiagnostic(referenceLocation.file, referenceLocation.pos, referenceLocation.end - referenceLocation.pos, message_2) : undefined;\n            }\n            if (!options.configFile)\n                return undefined;\n            var configFileNode;\n            var message;\n            switch (reason.kind) {\n                case ts.FileIncludeKind.RootFile:\n                    if (!options.configFile.configFileSpecs)\n                        return undefined;\n                    var fileName = ts.getNormalizedAbsolutePath(rootNames[reason.index], currentDirectory);\n                    var matchedByFiles = ts.getMatchedFileSpec(program, fileName);\n                    if (matchedByFiles) {\n                        configFileNode = ts.getTsConfigPropArrayElementValue(options.configFile, \"files\", matchedByFiles);\n                        message = ts.Diagnostics.File_is_matched_by_files_list_specified_here;\n                        break;\n                    }\n                    var matchedByInclude = ts.getMatchedIncludeSpec(program, fileName);\n                    // Could be additional files specified as roots\n                    if (!matchedByInclude)\n                        return undefined;\n                    configFileNode = ts.getTsConfigPropArrayElementValue(options.configFile, \"include\", matchedByInclude);\n                    message = ts.Diagnostics.File_is_matched_by_include_pattern_specified_here;\n                    break;\n                case ts.FileIncludeKind.SourceFromProjectReference:\n                case ts.FileIncludeKind.OutputFromProjectReference:\n                    var referencedResolvedRef_1 = ts.Debug.checkDefined(resolvedProjectReferences === null || resolvedProjectReferences === void 0 ? void 0 : resolvedProjectReferences[reason.index]);\n                    var referenceInfo = forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, parent, index) {\n                        return resolvedRef === referencedResolvedRef_1 ? { sourceFile: (parent === null || parent === void 0 ? void 0 : parent.sourceFile) || options.configFile, index: index } : undefined;\n                    });\n                    if (!referenceInfo)\n                        return undefined;\n                    var sourceFile = referenceInfo.sourceFile, index = referenceInfo.index;\n                    var referencesSyntax = ts.firstDefined(ts.getTsConfigPropArray(sourceFile, \"references\"), function (property) { return ts.isArrayLiteralExpression(property.initializer) ? property.initializer : undefined; });\n                    return referencesSyntax && referencesSyntax.elements.length > index ?\n                        ts.createDiagnosticForNodeInSourceFile(sourceFile, referencesSyntax.elements[index], reason.kind === ts.FileIncludeKind.OutputFromProjectReference ?\n                            ts.Diagnostics.File_is_output_from_referenced_project_specified_here :\n                            ts.Diagnostics.File_is_source_from_referenced_project_specified_here) :\n                        undefined;\n                case ts.FileIncludeKind.AutomaticTypeDirectiveFile:\n                    if (!options.types)\n                        return undefined;\n                    configFileNode = getOptionsSyntaxByArrayElementValue(\"types\", reason.typeReference);\n                    message = ts.Diagnostics.File_is_entry_point_of_type_library_specified_here;\n                    break;\n                case ts.FileIncludeKind.LibFile:\n                    if (reason.index !== undefined) {\n                        configFileNode = getOptionsSyntaxByArrayElementValue(\"lib\", options.lib[reason.index]);\n                        message = ts.Diagnostics.File_is_library_specified_here;\n                        break;\n                    }\n                    var target = ts.forEachEntry(ts.targetOptionDeclaration.type, function (value, key) { return value === options.target ? key : undefined; });\n                    configFileNode = target ? getOptionsSyntaxByValue(\"target\", target) : undefined;\n                    message = ts.Diagnostics.File_is_default_library_for_target_specified_here;\n                    break;\n                default:\n                    ts.Debug.assertNever(reason);\n            }\n            return configFileNode && ts.createDiagnosticForNodeInSourceFile(options.configFile, configFileNode, message);\n        }\n        function verifyProjectReferences() {\n            var buildInfoPath = !options.suppressOutputPathCheck ? ts.getTsBuildInfoEmitOutputFilePath(options) : undefined;\n            forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, parent, index) {\n                var ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index];\n                var parentFile = parent && parent.sourceFile;\n                if (!resolvedRef) {\n                    createDiagnosticForReference(parentFile, index, ts.Diagnostics.File_0_not_found, ref.path);\n                    return;\n                }\n                var options = resolvedRef.commandLine.options;\n                if (!options.composite || options.noEmit) {\n                    // ok to not have composite if the current program is container only\n                    var inputs = parent ? parent.commandLine.fileNames : rootNames;\n                    if (inputs.length) {\n                        if (!options.composite)\n                            createDiagnosticForReference(parentFile, index, ts.Diagnostics.Referenced_project_0_must_have_setting_composite_Colon_true, ref.path);\n                        if (options.noEmit)\n                            createDiagnosticForReference(parentFile, index, ts.Diagnostics.Referenced_project_0_may_not_disable_emit, ref.path);\n                    }\n                }\n                if (ref.prepend) {\n                    var out = ts.outFile(options);\n                    if (out) {\n                        if (!host.fileExists(out)) {\n                            createDiagnosticForReference(parentFile, index, ts.Diagnostics.Output_file_0_from_project_1_does_not_exist, out, ref.path);\n                        }\n                    }\n                    else {\n                        createDiagnosticForReference(parentFile, index, ts.Diagnostics.Cannot_prepend_project_0_because_it_does_not_have_outFile_set, ref.path);\n                    }\n                }\n                if (!parent && buildInfoPath && buildInfoPath === ts.getTsBuildInfoEmitOutputFilePath(options)) {\n                    createDiagnosticForReference(parentFile, index, ts.Diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1, buildInfoPath, ref.path);\n                    hasEmitBlockingDiagnostics.set(toPath(buildInfoPath), true);\n                }\n            });\n        }\n        function createDiagnosticForOptionPathKeyValue(key, valueIndex, message, arg0, arg1, arg2) {\n            var needCompilerDiagnostic = true;\n            var pathsSyntax = getOptionPathsSyntax();\n            for (var _i = 0, pathsSyntax_1 = pathsSyntax; _i < pathsSyntax_1.length; _i++) {\n                var pathProp = pathsSyntax_1[_i];\n                if (ts.isObjectLiteralExpression(pathProp.initializer)) {\n                    for (var _a = 0, _b = ts.getPropertyAssignment(pathProp.initializer, key); _a < _b.length; _a++) {\n                        var keyProps = _b[_a];\n                        var initializer = keyProps.initializer;\n                        if (ts.isArrayLiteralExpression(initializer) && initializer.elements.length > valueIndex) {\n                            programDiagnostics.add(ts.createDiagnosticForNodeInSourceFile(options.configFile, initializer.elements[valueIndex], message, arg0, arg1, arg2));\n                            needCompilerDiagnostic = false;\n                        }\n                    }\n                }\n            }\n            if (needCompilerDiagnostic) {\n                programDiagnostics.add(ts.createCompilerDiagnostic(message, arg0, arg1, arg2));\n            }\n        }\n        function createDiagnosticForOptionPaths(onKey, key, message, arg0) {\n            var needCompilerDiagnostic = true;\n            var pathsSyntax = getOptionPathsSyntax();\n            for (var _i = 0, pathsSyntax_2 = pathsSyntax; _i < pathsSyntax_2.length; _i++) {\n                var pathProp = pathsSyntax_2[_i];\n                if (ts.isObjectLiteralExpression(pathProp.initializer) &&\n                    createOptionDiagnosticInObjectLiteralSyntax(pathProp.initializer, onKey, key, /*key2*/ undefined, message, arg0)) {\n                    needCompilerDiagnostic = false;\n                }\n            }\n            if (needCompilerDiagnostic) {\n                programDiagnostics.add(ts.createCompilerDiagnostic(message, arg0));\n            }\n        }\n        function getOptionsSyntaxByName(name) {\n            var compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax();\n            return compilerOptionsObjectLiteralSyntax && ts.getPropertyAssignment(compilerOptionsObjectLiteralSyntax, name);\n        }\n        function getOptionPathsSyntax() {\n            return getOptionsSyntaxByName(\"paths\") || ts.emptyArray;\n        }\n        function getOptionsSyntaxByValue(name, value) {\n            var syntaxByName = getOptionsSyntaxByName(name);\n            return syntaxByName && ts.firstDefined(syntaxByName, function (property) { return ts.isStringLiteral(property.initializer) && property.initializer.text === value ? property.initializer : undefined; });\n        }\n        function getOptionsSyntaxByArrayElementValue(name, value) {\n            var compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax();\n            return compilerOptionsObjectLiteralSyntax && ts.getPropertyArrayElementValue(compilerOptionsObjectLiteralSyntax, name, value);\n        }\n        function createDiagnosticForOptionName(message, option1, option2, option3) {\n            createDiagnosticForOption(/*onKey*/ true, option1, option2, message, option1, option2, option3);\n        }\n        function createOptionValueDiagnostic(option1, message, arg0) {\n            createDiagnosticForOption(/*onKey*/ false, option1, /*option2*/ undefined, message, arg0);\n        }\n        function createDiagnosticForReference(sourceFile, index, message, arg0, arg1) {\n            var referencesSyntax = ts.firstDefined(ts.getTsConfigPropArray(sourceFile || options.configFile, \"references\"), function (property) { return ts.isArrayLiteralExpression(property.initializer) ? property.initializer : undefined; });\n            if (referencesSyntax && referencesSyntax.elements.length > index) {\n                programDiagnostics.add(ts.createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1));\n            }\n            else {\n                programDiagnostics.add(ts.createCompilerDiagnostic(message, arg0, arg1));\n            }\n        }\n        function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2) {\n            var compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax();\n            var needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax ||\n                !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2);\n            if (needCompilerDiagnostic) {\n                programDiagnostics.add(ts.createCompilerDiagnostic(message, arg0, arg1, arg2));\n            }\n        }\n        function getCompilerOptionsObjectLiteralSyntax() {\n            if (_compilerOptionsObjectLiteralSyntax === undefined) {\n                _compilerOptionsObjectLiteralSyntax = false;\n                var jsonObjectLiteral = ts.getTsConfigObjectLiteralExpression(options.configFile);\n                if (jsonObjectLiteral) {\n                    for (var _i = 0, _a = ts.getPropertyAssignment(jsonObjectLiteral, \"compilerOptions\"); _i < _a.length; _i++) {\n                        var prop = _a[_i];\n                        if (ts.isObjectLiteralExpression(prop.initializer)) {\n                            _compilerOptionsObjectLiteralSyntax = prop.initializer;\n                            break;\n                        }\n                    }\n                }\n            }\n            return _compilerOptionsObjectLiteralSyntax || undefined;\n        }\n        function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2) {\n            var props = ts.getPropertyAssignment(objectLiteral, key1, key2);\n            for (var _i = 0, props_3 = props; _i < props_3.length; _i++) {\n                var prop = props_3[_i];\n                programDiagnostics.add(ts.createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2));\n            }\n            return !!props.length;\n        }\n        function blockEmittingOfFile(emitFileName, diag) {\n            hasEmitBlockingDiagnostics.set(toPath(emitFileName), true);\n            programDiagnostics.add(diag);\n        }\n        function isEmittedFile(file) {\n            if (options.noEmit) {\n                return false;\n            }\n            // If this is source file, its not emitted file\n            var filePath = toPath(file);\n            if (getSourceFileByPath(filePath)) {\n                return false;\n            }\n            // If options have --outFile or --out just check that\n            var out = ts.outFile(options);\n            if (out) {\n                return isSameFile(filePath, out) || isSameFile(filePath, ts.removeFileExtension(out) + \".d.ts\" /* Dts */);\n            }\n            // If declarationDir is specified, return if its a file in that directory\n            if (options.declarationDir && ts.containsPath(options.declarationDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames())) {\n                return true;\n            }\n            // If --outDir, check if file is in that directory\n            if (options.outDir) {\n                return ts.containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames());\n            }\n            if (ts.fileExtensionIsOneOf(filePath, ts.supportedJSExtensions) || ts.fileExtensionIs(filePath, \".d.ts\" /* Dts */)) {\n                // Otherwise just check if sourceFile with the name exists\n                var filePathWithoutExtension = ts.removeFileExtension(filePath);\n                return !!getSourceFileByPath((filePathWithoutExtension + \".ts\" /* Ts */)) ||\n                    !!getSourceFileByPath((filePathWithoutExtension + \".tsx\" /* Tsx */));\n            }\n            return false;\n        }\n        function isSameFile(file1, file2) {\n            return ts.comparePaths(file1, file2, currentDirectory, !host.useCaseSensitiveFileNames()) === 0 /* EqualTo */;\n        }\n        function getSymlinkCache() {\n            if (host.getSymlinkCache) {\n                return host.getSymlinkCache();\n            }\n            return symlinks || (symlinks = ts.discoverProbableSymlinks(files, getCanonicalFileName, host.getCurrentDirectory()));\n        }\n    }\n    ts.createProgram = createProgram;\n    function updateHostForUseSourceOfProjectReferenceRedirect(host) {\n        var setOfDeclarationDirectories;\n        var originalFileExists = host.compilerHost.fileExists;\n        var originalDirectoryExists = host.compilerHost.directoryExists;\n        var originalGetDirectories = host.compilerHost.getDirectories;\n        var originalRealpath = host.compilerHost.realpath;\n        if (!host.useSourceOfProjectReferenceRedirect)\n            return { onProgramCreateComplete: ts.noop, fileExists: fileExists };\n        host.compilerHost.fileExists = fileExists;\n        var directoryExists;\n        if (originalDirectoryExists) {\n            // This implementation of directoryExists checks if the directory being requested is\n            // directory of .d.ts file for the referenced Project.\n            // If it is it returns true irrespective of whether that directory exists on host\n            directoryExists = host.compilerHost.directoryExists = function (path) {\n                if (originalDirectoryExists.call(host.compilerHost, path)) {\n                    handleDirectoryCouldBeSymlink(path);\n                    return true;\n                }\n                if (!host.getResolvedProjectReferences())\n                    return false;\n                if (!setOfDeclarationDirectories) {\n                    setOfDeclarationDirectories = new ts.Set();\n                    host.forEachResolvedProjectReference(function (ref) {\n                        var out = ts.outFile(ref.commandLine.options);\n                        if (out) {\n                            setOfDeclarationDirectories.add(ts.getDirectoryPath(host.toPath(out)));\n                        }\n                        else {\n                            // Set declaration's in different locations only, if they are next to source the directory present doesnt change\n                            var declarationDir = ref.commandLine.options.declarationDir || ref.commandLine.options.outDir;\n                            if (declarationDir) {\n                                setOfDeclarationDirectories.add(host.toPath(declarationDir));\n                            }\n                        }\n                    });\n                }\n                return fileOrDirectoryExistsUsingSource(path, /*isFile*/ false);\n            };\n        }\n        if (originalGetDirectories) {\n            // Call getDirectories only if directory actually present on the host\n            // This is needed to ensure that we arent getting directories that we fake about presence for\n            host.compilerHost.getDirectories = function (path) {\n                return !host.getResolvedProjectReferences() || (originalDirectoryExists && originalDirectoryExists.call(host.compilerHost, path)) ?\n                    originalGetDirectories.call(host.compilerHost, path) :\n                    [];\n            };\n        }\n        // This is something we keep for life time of the host\n        if (originalRealpath) {\n            host.compilerHost.realpath = function (s) {\n                var _a;\n                return ((_a = host.getSymlinkCache().getSymlinkedFiles()) === null || _a === void 0 ? void 0 : _a.get(host.toPath(s))) ||\n                    originalRealpath.call(host.compilerHost, s);\n            };\n        }\n        return { onProgramCreateComplete: onProgramCreateComplete, fileExists: fileExists, directoryExists: directoryExists };\n        function onProgramCreateComplete() {\n            host.compilerHost.fileExists = originalFileExists;\n            host.compilerHost.directoryExists = originalDirectoryExists;\n            host.compilerHost.getDirectories = originalGetDirectories;\n            // DO not revert realpath as it could be used later\n        }\n        // This implementation of fileExists checks if the file being requested is\n        // .d.ts file for the referenced Project.\n        // If it is it returns true irrespective of whether that file exists on host\n        function fileExists(file) {\n            if (originalFileExists.call(host.compilerHost, file))\n                return true;\n            if (!host.getResolvedProjectReferences())\n                return false;\n            if (!ts.isDeclarationFileName(file))\n                return false;\n            // Project references go to source file instead of .d.ts file\n            return fileOrDirectoryExistsUsingSource(file, /*isFile*/ true);\n        }\n        function fileExistsIfProjectReferenceDts(file) {\n            var source = host.getSourceOfProjectReferenceRedirect(file);\n            return source !== undefined ?\n                ts.isString(source) ? originalFileExists.call(host.compilerHost, source) : true :\n                undefined;\n        }\n        function directoryExistsIfProjectReferenceDeclDir(dir) {\n            var dirPath = host.toPath(dir);\n            var dirPathWithTrailingDirectorySeparator = \"\" + dirPath + ts.directorySeparator;\n            return ts.forEachKey(setOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath ||\n                // Any parent directory of declaration dir\n                ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) ||\n                // Any directory inside declaration dir\n                ts.startsWith(dirPath, declDirPath + \"/\"); });\n        }\n        function handleDirectoryCouldBeSymlink(directory) {\n            var _a;\n            if (!host.getResolvedProjectReferences() || ts.containsIgnoredPath(directory))\n                return;\n            // Because we already watch node_modules, handle symlinks in there\n            if (!originalRealpath || !ts.stringContains(directory, ts.nodeModulesPathPart))\n                return;\n            var symlinkCache = host.getSymlinkCache();\n            var directoryPath = ts.ensureTrailingDirectorySeparator(host.toPath(directory));\n            if ((_a = symlinkCache.getSymlinkedDirectories()) === null || _a === void 0 ? void 0 : _a.has(directoryPath))\n                return;\n            var real = ts.normalizePath(originalRealpath.call(host.compilerHost, directory));\n            var realPath;\n            if (real === directory ||\n                (realPath = ts.ensureTrailingDirectorySeparator(host.toPath(real))) === directoryPath) {\n                // not symlinked\n                symlinkCache.setSymlinkedDirectory(directoryPath, false);\n                return;\n            }\n            symlinkCache.setSymlinkedDirectory(directory, {\n                real: ts.ensureTrailingDirectorySeparator(real),\n                realPath: realPath\n            });\n        }\n        function fileOrDirectoryExistsUsingSource(fileOrDirectory, isFile) {\n            var _a;\n            var fileOrDirectoryExistsUsingSource = isFile ?\n                function (file) { return fileExistsIfProjectReferenceDts(file); } :\n                function (dir) { return directoryExistsIfProjectReferenceDeclDir(dir); };\n            // Check current directory or file\n            var result = fileOrDirectoryExistsUsingSource(fileOrDirectory);\n            if (result !== undefined)\n                return result;\n            var symlinkCache = host.getSymlinkCache();\n            var symlinkedDirectories = symlinkCache.getSymlinkedDirectories();\n            if (!symlinkedDirectories)\n                return false;\n            var fileOrDirectoryPath = host.toPath(fileOrDirectory);\n            if (!ts.stringContains(fileOrDirectoryPath, ts.nodeModulesPathPart))\n                return false;\n            if (isFile && ((_a = symlinkCache.getSymlinkedFiles()) === null || _a === void 0 ? void 0 : _a.has(fileOrDirectoryPath)))\n                return true;\n            // If it contains node_modules check if its one of the symlinked path we know of\n            return ts.firstDefinedIterator(symlinkedDirectories.entries(), function (_a) {\n                var directoryPath = _a[0], symlinkedDirectory = _a[1];\n                if (!symlinkedDirectory || !ts.startsWith(fileOrDirectoryPath, directoryPath))\n                    return undefined;\n                var result = fileOrDirectoryExistsUsingSource(fileOrDirectoryPath.replace(directoryPath, symlinkedDirectory.realPath));\n                if (isFile && result) {\n                    // Store the real path for the file'\n                    var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory());\n                    symlinkCache.setSymlinkedFile(fileOrDirectoryPath, \"\" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, \"i\"), \"\"));\n                }\n                return result;\n            }) || false;\n        }\n    }\n    /*@internal*/\n    ts.emitSkippedWithNoDiagnostics = { diagnostics: ts.emptyArray, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true };\n    /*@internal*/\n    function handleNoEmitOptions(program, sourceFile, writeFile, cancellationToken) {\n        var options = program.getCompilerOptions();\n        if (options.noEmit) {\n            // Cache the semantic diagnostics\n            program.getSemanticDiagnostics(sourceFile, cancellationToken);\n            return sourceFile || ts.outFile(options) ?\n                ts.emitSkippedWithNoDiagnostics :\n                program.emitBuildInfo(writeFile, cancellationToken);\n        }\n        // If the noEmitOnError flag is set, then check if we have any errors so far.  If so,\n        // immediately bail out.  Note that we pass 'undefined' for 'sourceFile' so that we\n        // get any preEmit diagnostics, not just the ones\n        if (!options.noEmitOnError)\n            return undefined;\n        var diagnostics = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], program.getOptionsDiagnostics(cancellationToken)), program.getSyntacticDiagnostics(sourceFile, cancellationToken)), program.getGlobalDiagnostics(cancellationToken)), program.getSemanticDiagnostics(sourceFile, cancellationToken));\n        if (diagnostics.length === 0 && ts.getEmitDeclarations(program.getCompilerOptions())) {\n            diagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken);\n        }\n        if (!diagnostics.length)\n            return undefined;\n        var emittedFiles;\n        if (!sourceFile && !ts.outFile(options)) {\n            var emitResult = program.emitBuildInfo(writeFile, cancellationToken);\n            if (emitResult.diagnostics)\n                diagnostics = __spreadArray(__spreadArray([], diagnostics), emitResult.diagnostics);\n            emittedFiles = emitResult.emittedFiles;\n        }\n        return { diagnostics: diagnostics, sourceMaps: undefined, emittedFiles: emittedFiles, emitSkipped: true };\n    }\n    ts.handleNoEmitOptions = handleNoEmitOptions;\n    /*@internal*/\n    function filterSemanticDiagnotics(diagnostic, option) {\n        return ts.filter(diagnostic, function (d) { return !d.skippedOn || !option[d.skippedOn]; });\n    }\n    ts.filterSemanticDiagnotics = filterSemanticDiagnotics;\n    /* @internal */\n    function parseConfigHostFromCompilerHostLike(host, directoryStructureHost) {\n        if (directoryStructureHost === void 0) { directoryStructureHost = host; }\n        return {\n            fileExists: function (f) { return directoryStructureHost.fileExists(f); },\n            readDirectory: function (root, extensions, excludes, includes, depth) {\n                ts.Debug.assertIsDefined(directoryStructureHost.readDirectory, \"'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'\");\n                return directoryStructureHost.readDirectory(root, extensions, excludes, includes, depth);\n            },\n            readFile: function (f) { return directoryStructureHost.readFile(f); },\n            useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(),\n            getCurrentDirectory: function () { return host.getCurrentDirectory(); },\n            onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || ts.returnUndefined,\n            trace: host.trace ? function (s) { return host.trace(s); } : undefined\n        };\n    }\n    ts.parseConfigHostFromCompilerHostLike = parseConfigHostFromCompilerHostLike;\n    /* @internal */\n    function createPrependNodes(projectReferences, getCommandLine, readFile) {\n        if (!projectReferences)\n            return ts.emptyArray;\n        var nodes;\n        for (var i = 0; i < projectReferences.length; i++) {\n            var ref = projectReferences[i];\n            var resolvedRefOpts = getCommandLine(ref, i);\n            if (ref.prepend && resolvedRefOpts && resolvedRefOpts.options) {\n                var out = ts.outFile(resolvedRefOpts.options);\n                // Upstream project didn't have outFile set -- skip (error will have been issued earlier)\n                if (!out)\n                    continue;\n                var _a = ts.getOutputPathsForBundle(resolvedRefOpts.options, /*forceDtsPaths*/ true), jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath, buildInfoPath = _a.buildInfoPath;\n                var node = ts.createInputFiles(readFile, jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath);\n                (nodes || (nodes = [])).push(node);\n            }\n        }\n        return nodes || ts.emptyArray;\n    }\n    ts.createPrependNodes = createPrependNodes;\n    function resolveProjectReferencePath(hostOrRef, ref) {\n        var passedInRef = ref ? ref : hostOrRef;\n        return ts.resolveConfigFileProjectName(passedInRef.path);\n    }\n    ts.resolveProjectReferencePath = resolveProjectReferencePath;\n    /* @internal */\n    /**\n     * Returns a DiagnosticMessage if we won't include a resolved module due to its extension.\n     * The DiagnosticMessage's parameters are the imported module name, and the filename it resolved to.\n     * This returns a diagnostic even if the module will be an untyped module.\n     */\n    function getResolutionDiagnostic(options, _a) {\n        var extension = _a.extension;\n        switch (extension) {\n            case \".ts\" /* Ts */:\n            case \".d.ts\" /* Dts */:\n                // These are always allowed.\n                return undefined;\n            case \".tsx\" /* Tsx */:\n                return needJsx();\n            case \".jsx\" /* Jsx */:\n                return needJsx() || needAllowJs();\n            case \".js\" /* Js */:\n                return needAllowJs();\n            case \".json\" /* Json */:\n                return needResolveJsonModule();\n        }\n        function needJsx() {\n            return options.jsx ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set;\n        }\n        function needAllowJs() {\n            return ts.getAllowJSCompilerOption(options) || !ts.getStrictOptionValue(options, \"noImplicitAny\") ? undefined : ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type;\n        }\n        function needResolveJsonModule() {\n            return options.resolveJsonModule ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used;\n        }\n    }\n    ts.getResolutionDiagnostic = getResolutionDiagnostic;\n    function getModuleNames(_a) {\n        var imports = _a.imports, moduleAugmentations = _a.moduleAugmentations;\n        var res = imports.map(function (i) { return i.text; });\n        for (var _i = 0, moduleAugmentations_1 = moduleAugmentations; _i < moduleAugmentations_1.length; _i++) {\n            var aug = moduleAugmentations_1[_i];\n            if (aug.kind === 10 /* StringLiteral */) {\n                res.push(aug.text);\n            }\n            // Do nothing if it's an Identifier; we don't need to do module resolution for `declare global`.\n        }\n        return res;\n    }\n    /* @internal */\n    function getModuleNameStringLiteralAt(_a, index) {\n        var imports = _a.imports, moduleAugmentations = _a.moduleAugmentations;\n        if (index < imports.length)\n            return imports[index];\n        var augIndex = imports.length;\n        for (var _i = 0, moduleAugmentations_2 = moduleAugmentations; _i < moduleAugmentations_2.length; _i++) {\n            var aug = moduleAugmentations_2[_i];\n            if (aug.kind === 10 /* StringLiteral */) {\n                if (index === augIndex)\n                    return aug;\n                augIndex++;\n            }\n            // Do nothing if it's an Identifier; we don't need to do module resolution for `declare global`.\n        }\n        ts.Debug.fail(\"should never ask for module name at index higher than possible module name\");\n    }\n    ts.getModuleNameStringLiteralAt = getModuleNameStringLiteralAt;\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers, forceDtsEmit) {\n        var outputFiles = [];\n        var _a = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers, forceDtsEmit), emitSkipped = _a.emitSkipped, diagnostics = _a.diagnostics, exportedModulesFromDeclarationEmit = _a.exportedModulesFromDeclarationEmit;\n        return { outputFiles: outputFiles, emitSkipped: emitSkipped, diagnostics: diagnostics, exportedModulesFromDeclarationEmit: exportedModulesFromDeclarationEmit };\n        function writeFile(fileName, text, writeByteOrderMark) {\n            outputFiles.push({ name: fileName, writeByteOrderMark: writeByteOrderMark, text: text });\n        }\n    }\n    ts.getFileEmitOutput = getFileEmitOutput;\n    var BuilderState;\n    (function (BuilderState) {\n        /**\n         * Get the referencedFile from the imported module symbol\n         */\n        function getReferencedFileFromImportedModuleSymbol(symbol) {\n            if (symbol.declarations && symbol.declarations[0]) {\n                var declarationSourceFile = ts.getSourceFileOfNode(symbol.declarations[0]);\n                return declarationSourceFile && declarationSourceFile.resolvedPath;\n            }\n        }\n        /**\n         * Get the referencedFile from the import name node from file\n         */\n        function getReferencedFileFromImportLiteral(checker, importName) {\n            var symbol = checker.getSymbolAtLocation(importName);\n            return symbol && getReferencedFileFromImportedModuleSymbol(symbol);\n        }\n        /**\n         * Gets the path to reference file from file name, it could be resolvedPath if present otherwise path\n         */\n        function getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName) {\n            return ts.toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName);\n        }\n        /**\n         * Gets the referenced files for a file from the program with values for the keys as referenced file's path to be true\n         */\n        function getReferencedFiles(program, sourceFile, getCanonicalFileName) {\n            var referencedFiles;\n            // We need to use a set here since the code can contain the same import twice,\n            // but that will only be one dependency.\n            // To avoid invernal conversion, the key of the referencedFiles map must be of type Path\n            if (sourceFile.imports && sourceFile.imports.length > 0) {\n                var checker = program.getTypeChecker();\n                for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) {\n                    var importName = _a[_i];\n                    var declarationSourceFilePath = getReferencedFileFromImportLiteral(checker, importName);\n                    if (declarationSourceFilePath) {\n                        addReferencedFile(declarationSourceFilePath);\n                    }\n                }\n            }\n            var sourceFileDirectory = ts.getDirectoryPath(sourceFile.resolvedPath);\n            // Handle triple slash references\n            if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) {\n                for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) {\n                    var referencedFile = _c[_b];\n                    var referencedPath = getReferencedFileFromFileName(program, referencedFile.fileName, sourceFileDirectory, getCanonicalFileName);\n                    addReferencedFile(referencedPath);\n                }\n            }\n            // Handle type reference directives\n            if (sourceFile.resolvedTypeReferenceDirectiveNames) {\n                sourceFile.resolvedTypeReferenceDirectiveNames.forEach(function (resolvedTypeReferenceDirective) {\n                    if (!resolvedTypeReferenceDirective) {\n                        return;\n                    }\n                    var fileName = resolvedTypeReferenceDirective.resolvedFileName; // TODO: GH#18217\n                    var typeFilePath = getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName);\n                    addReferencedFile(typeFilePath);\n                });\n            }\n            // Add module augmentation as references\n            if (sourceFile.moduleAugmentations.length) {\n                var checker = program.getTypeChecker();\n                for (var _d = 0, _e = sourceFile.moduleAugmentations; _d < _e.length; _d++) {\n                    var moduleName = _e[_d];\n                    if (!ts.isStringLiteral(moduleName)) {\n                        continue;\n                    }\n                    var symbol = checker.getSymbolAtLocation(moduleName);\n                    if (!symbol) {\n                        continue;\n                    }\n                    // Add any file other than our own as reference\n                    addReferenceFromAmbientModule(symbol);\n                }\n            }\n            // From ambient modules\n            for (var _f = 0, _g = program.getTypeChecker().getAmbientModules(); _f < _g.length; _f++) {\n                var ambientModule = _g[_f];\n                if (ambientModule.declarations.length > 1) {\n                    addReferenceFromAmbientModule(ambientModule);\n                }\n            }\n            return referencedFiles;\n            function addReferenceFromAmbientModule(symbol) {\n                // Add any file other than our own as reference\n                for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                    var declaration = _a[_i];\n                    var declarationSourceFile = ts.getSourceFileOfNode(declaration);\n                    if (declarationSourceFile &&\n                        declarationSourceFile !== sourceFile) {\n                        addReferencedFile(declarationSourceFile.resolvedPath);\n                    }\n                }\n            }\n            function addReferencedFile(referencedPath) {\n                (referencedFiles || (referencedFiles = new ts.Set())).add(referencedPath);\n            }\n        }\n        /**\n         * Returns true if oldState is reusable, that is the emitKind = module/non module has not changed\n         */\n        function canReuseOldState(newReferencedMap, oldState) {\n            return oldState && !oldState.referencedMap === !newReferencedMap;\n        }\n        BuilderState.canReuseOldState = canReuseOldState;\n        /**\n         * Creates the state of file references and signature for the new program from oldState if it is safe\n         */\n        function create(newProgram, getCanonicalFileName, oldState) {\n            var fileInfos = new ts.Map();\n            var referencedMap = newProgram.getCompilerOptions().module !== ts.ModuleKind.None ? new ts.Map() : undefined;\n            var exportedModulesMap = referencedMap ? new ts.Map() : undefined;\n            var hasCalledUpdateShapeSignature = new ts.Set();\n            var useOldState = canReuseOldState(referencedMap, oldState);\n            // Ensure source files have parent pointers set\n            newProgram.getTypeChecker();\n            // Create the reference map, and set the file infos\n            for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) {\n                var sourceFile = _a[_i];\n                var version_2 = ts.Debug.checkDefined(sourceFile.version, \"Program intended to be used with Builder should have source files with versions set\");\n                var oldInfo = useOldState ? oldState.fileInfos.get(sourceFile.resolvedPath) : undefined;\n                if (referencedMap) {\n                    var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);\n                    if (newReferences) {\n                        referencedMap.set(sourceFile.resolvedPath, newReferences);\n                    }\n                    // Copy old visible to outside files map\n                    if (useOldState) {\n                        var exportedModules = oldState.exportedModulesMap.get(sourceFile.resolvedPath);\n                        if (exportedModules) {\n                            exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);\n                        }\n                    }\n                }\n                fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) });\n            }\n            return {\n                fileInfos: fileInfos,\n                referencedMap: referencedMap,\n                exportedModulesMap: exportedModulesMap,\n                hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature\n            };\n        }\n        BuilderState.create = create;\n        /**\n         * Releases needed properties\n         */\n        function releaseCache(state) {\n            state.allFilesExcludingDefaultLibraryFile = undefined;\n            state.allFileNames = undefined;\n        }\n        BuilderState.releaseCache = releaseCache;\n        /**\n         * Creates a clone of the state\n         */\n        function clone(state) {\n            // Dont need to backup allFiles info since its cache anyway\n            return {\n                fileInfos: new ts.Map(state.fileInfos),\n                referencedMap: state.referencedMap && new ts.Map(state.referencedMap),\n                exportedModulesMap: state.exportedModulesMap && new ts.Map(state.exportedModulesMap),\n                hasCalledUpdateShapeSignature: new ts.Set(state.hasCalledUpdateShapeSignature),\n            };\n        }\n        BuilderState.clone = clone;\n        /**\n         * Gets the files affected by the path from the program\n         */\n        function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash, cacheToUpdateSignature, exportedModulesMapCache) {\n            // Since the operation could be cancelled, the signatures are always stored in the cache\n            // They will be committed once it is safe to use them\n            // eg when calling this api from tsserver, if there is no cancellation of the operation\n            // In the other cases the affected files signatures are committed only after the iteration through the result is complete\n            var signatureCache = cacheToUpdateSignature || new ts.Map();\n            var sourceFile = programOfThisState.getSourceFileByPath(path);\n            if (!sourceFile) {\n                return ts.emptyArray;\n            }\n            if (!updateShapeSignature(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash, exportedModulesMapCache)) {\n                return [sourceFile];\n            }\n            var result = (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash, exportedModulesMapCache);\n            if (!cacheToUpdateSignature) {\n                // Commit all the signatures in the signature cache\n                updateSignaturesFromCache(state, signatureCache);\n            }\n            return result;\n        }\n        BuilderState.getFilesAffectedBy = getFilesAffectedBy;\n        /**\n         * Updates the signatures from the cache into state's fileinfo signatures\n         * This should be called whenever it is safe to commit the state of the builder\n         */\n        function updateSignaturesFromCache(state, signatureCache) {\n            signatureCache.forEach(function (signature, path) { return updateSignatureOfFile(state, signature, path); });\n        }\n        BuilderState.updateSignaturesFromCache = updateSignaturesFromCache;\n        function updateSignatureOfFile(state, signature, path) {\n            state.fileInfos.get(path).signature = signature;\n            state.hasCalledUpdateShapeSignature.add(path);\n        }\n        BuilderState.updateSignatureOfFile = updateSignatureOfFile;\n        /**\n         * Returns if the shape of the signature has changed since last emit\n         */\n        function updateShapeSignature(state, programOfThisState, sourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache) {\n            ts.Debug.assert(!!sourceFile);\n            ts.Debug.assert(!exportedModulesMapCache || !!state.exportedModulesMap, \"Compute visible to outside map only if visibleToOutsideReferencedMap present in the state\");\n            // If we have cached the result for this file, that means hence forth we should assume file shape is uptodate\n            if (state.hasCalledUpdateShapeSignature.has(sourceFile.resolvedPath) || cacheToUpdateSignature.has(sourceFile.resolvedPath)) {\n                return false;\n            }\n            var info = state.fileInfos.get(sourceFile.resolvedPath);\n            if (!info)\n                return ts.Debug.fail();\n            var prevSignature = info.signature;\n            var latestSignature;\n            if (sourceFile.isDeclarationFile) {\n                latestSignature = sourceFile.version;\n                if (exportedModulesMapCache && latestSignature !== prevSignature) {\n                    // All the references in this file are exported\n                    var references = state.referencedMap ? state.referencedMap.get(sourceFile.resolvedPath) : undefined;\n                    exportedModulesMapCache.set(sourceFile.resolvedPath, references || false);\n                }\n            }\n            else {\n                var emitOutput_1 = getFileEmitOutput(programOfThisState, sourceFile, \n                /*emitOnlyDtsFiles*/ true, cancellationToken, \n                /*customTransformers*/ undefined, \n                /*forceDtsEmit*/ true);\n                var firstDts_1 = emitOutput_1.outputFiles &&\n                    programOfThisState.getCompilerOptions().declarationMap ?\n                    emitOutput_1.outputFiles.length > 1 ? emitOutput_1.outputFiles[1] : undefined :\n                    emitOutput_1.outputFiles.length > 0 ? emitOutput_1.outputFiles[0] : undefined;\n                if (firstDts_1) {\n                    ts.Debug.assert(ts.fileExtensionIs(firstDts_1.name, \".d.ts\" /* Dts */), \"File extension for signature expected to be dts\", function () { return \"Found: \" + ts.getAnyExtensionFromPath(firstDts_1.name) + \" for \" + firstDts_1.name + \":: All output files: \" + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); });\n                    latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);\n                    if (exportedModulesMapCache && latestSignature !== prevSignature) {\n                        updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);\n                    }\n                }\n                else {\n                    latestSignature = prevSignature; // TODO: GH#18217\n                }\n            }\n            cacheToUpdateSignature.set(sourceFile.resolvedPath, latestSignature);\n            return !prevSignature || latestSignature !== prevSignature;\n        }\n        BuilderState.updateShapeSignature = updateShapeSignature;\n        /**\n         * Coverts the declaration emit result into exported modules map\n         */\n        function updateExportedModules(sourceFile, exportedModulesFromDeclarationEmit, exportedModulesMapCache) {\n            if (!exportedModulesFromDeclarationEmit) {\n                exportedModulesMapCache.set(sourceFile.resolvedPath, false);\n                return;\n            }\n            var exportedModules;\n            exportedModulesFromDeclarationEmit.forEach(function (symbol) { return addExportedModule(getReferencedFileFromImportedModuleSymbol(symbol)); });\n            exportedModulesMapCache.set(sourceFile.resolvedPath, exportedModules || false);\n            function addExportedModule(exportedModulePath) {\n                if (exportedModulePath) {\n                    if (!exportedModules) {\n                        exportedModules = new ts.Set();\n                    }\n                    exportedModules.add(exportedModulePath);\n                }\n            }\n        }\n        /**\n         * Updates the exported modules from cache into state's exported modules map\n         * This should be called whenever it is safe to commit the state of the builder\n         */\n        function updateExportedFilesMapFromCache(state, exportedModulesMapCache) {\n            if (exportedModulesMapCache) {\n                ts.Debug.assert(!!state.exportedModulesMap);\n                exportedModulesMapCache.forEach(function (exportedModules, path) {\n                    if (exportedModules) {\n                        state.exportedModulesMap.set(path, exportedModules);\n                    }\n                    else {\n                        state.exportedModulesMap.delete(path);\n                    }\n                });\n            }\n        }\n        BuilderState.updateExportedFilesMapFromCache = updateExportedFilesMapFromCache;\n        /**\n         * Get all the dependencies of the sourceFile\n         */\n        function getAllDependencies(state, programOfThisState, sourceFile) {\n            var compilerOptions = programOfThisState.getCompilerOptions();\n            // With --out or --outFile all outputs go into single file, all files depend on each other\n            if (ts.outFile(compilerOptions)) {\n                return getAllFileNames(state, programOfThisState);\n            }\n            // If this is non module emit, or its a global file, it depends on all the source files\n            if (!state.referencedMap || isFileAffectingGlobalScope(sourceFile)) {\n                return getAllFileNames(state, programOfThisState);\n            }\n            // Get the references, traversing deep from the referenceMap\n            var seenMap = new ts.Set();\n            var queue = [sourceFile.resolvedPath];\n            while (queue.length) {\n                var path = queue.pop();\n                if (!seenMap.has(path)) {\n                    seenMap.add(path);\n                    var references = state.referencedMap.get(path);\n                    if (references) {\n                        var iterator = references.keys();\n                        for (var iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) {\n                            queue.push(iterResult.value);\n                        }\n                    }\n                }\n            }\n            return ts.arrayFrom(ts.mapDefinedIterator(seenMap.keys(), function (path) { var _a, _b; return (_b = (_a = programOfThisState.getSourceFileByPath(path)) === null || _a === void 0 ? void 0 : _a.fileName) !== null && _b !== void 0 ? _b : path; }));\n        }\n        BuilderState.getAllDependencies = getAllDependencies;\n        /**\n         * Gets the names of all files from the program\n         */\n        function getAllFileNames(state, programOfThisState) {\n            if (!state.allFileNames) {\n                var sourceFiles = programOfThisState.getSourceFiles();\n                state.allFileNames = sourceFiles === ts.emptyArray ? ts.emptyArray : sourceFiles.map(function (file) { return file.fileName; });\n            }\n            return state.allFileNames;\n        }\n        /**\n         * Gets the files referenced by the the file path\n         */\n        function getReferencedByPaths(state, referencedFilePath) {\n            return ts.arrayFrom(ts.mapDefinedIterator(state.referencedMap.entries(), function (_a) {\n                var filePath = _a[0], referencesInFile = _a[1];\n                return referencesInFile.has(referencedFilePath) ? filePath : undefined;\n            }));\n        }\n        BuilderState.getReferencedByPaths = getReferencedByPaths;\n        /**\n         * For script files that contains only ambient external modules, although they are not actually external module files,\n         * they can only be consumed via importing elements from them. Regular script files cannot consume them. Therefore,\n         * there are no point to rebuild all script files if these special files have changed. However, if any statement\n         * in the file is not ambient external module, we treat it as a regular script file.\n         */\n        function containsOnlyAmbientModules(sourceFile) {\n            for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {\n                var statement = _a[_i];\n                if (!ts.isModuleWithStringLiteralName(statement)) {\n                    return false;\n                }\n            }\n            return true;\n        }\n        /**\n         * Return true if file contains anything that augments to global scope we need to build them as if\n         * they are global files as well as module\n         */\n        function containsGlobalScopeAugmentation(sourceFile) {\n            return ts.some(sourceFile.moduleAugmentations, function (augmentation) { return ts.isGlobalScopeAugmentation(augmentation.parent); });\n        }\n        /**\n         * Return true if the file will invalidate all files because it affectes global scope\n         */\n        function isFileAffectingGlobalScope(sourceFile) {\n            return containsGlobalScopeAugmentation(sourceFile) ||\n                !ts.isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile);\n        }\n        /**\n         * Gets all files of the program excluding the default library file\n         */\n        function getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, firstSourceFile) {\n            // Use cached result\n            if (state.allFilesExcludingDefaultLibraryFile) {\n                return state.allFilesExcludingDefaultLibraryFile;\n            }\n            var result;\n            if (firstSourceFile)\n                addSourceFile(firstSourceFile);\n            for (var _i = 0, _a = programOfThisState.getSourceFiles(); _i < _a.length; _i++) {\n                var sourceFile = _a[_i];\n                if (sourceFile !== firstSourceFile) {\n                    addSourceFile(sourceFile);\n                }\n            }\n            state.allFilesExcludingDefaultLibraryFile = result || ts.emptyArray;\n            return state.allFilesExcludingDefaultLibraryFile;\n            function addSourceFile(sourceFile) {\n                if (!programOfThisState.isSourceFileDefaultLibrary(sourceFile)) {\n                    (result || (result = [])).push(sourceFile);\n                }\n            }\n        }\n        BuilderState.getAllFilesExcludingDefaultLibraryFile = getAllFilesExcludingDefaultLibraryFile;\n        /**\n         * When program emits non modular code, gets the files affected by the sourceFile whose shape has changed\n         */\n        function getFilesAffectedByUpdatedShapeWhenNonModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape) {\n            var compilerOptions = programOfThisState.getCompilerOptions();\n            // If `--out` or `--outFile` is specified, any new emit will result in re-emitting the entire project,\n            // so returning the file itself is good enough.\n            if (compilerOptions && ts.outFile(compilerOptions)) {\n                return [sourceFileWithUpdatedShape];\n            }\n            return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);\n        }\n        /**\n         * When program emits modular code, gets the files affected by the sourceFile whose shape has changed\n         */\n        function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache) {\n            if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) {\n                return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);\n            }\n            var compilerOptions = programOfThisState.getCompilerOptions();\n            if (compilerOptions && (compilerOptions.isolatedModules || ts.outFile(compilerOptions))) {\n                return [sourceFileWithUpdatedShape];\n            }\n            // Now we need to if each file in the referencedBy list has a shape change as well.\n            // Because if so, its own referencedBy files need to be saved as well to make the\n            // emitting result consistent with files on disk.\n            var seenFileNamesMap = new ts.Map();\n            // Start with the paths this file was referenced by\n            seenFileNamesMap.set(sourceFileWithUpdatedShape.resolvedPath, sourceFileWithUpdatedShape);\n            var queue = getReferencedByPaths(state, sourceFileWithUpdatedShape.resolvedPath);\n            while (queue.length > 0) {\n                var currentPath = queue.pop();\n                if (!seenFileNamesMap.has(currentPath)) {\n                    var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath);\n                    seenFileNamesMap.set(currentPath, currentSourceFile);\n                    if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) {\n                        queue.push.apply(queue, getReferencedByPaths(state, currentSourceFile.resolvedPath));\n                    }\n                }\n            }\n            // Return array of values that needs emit\n            return ts.arrayFrom(ts.mapDefinedIterator(seenFileNamesMap.values(), function (value) { return value; }));\n        }\n    })(BuilderState = ts.BuilderState || (ts.BuilderState = {}));\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    var BuilderFileEmit;\n    (function (BuilderFileEmit) {\n        BuilderFileEmit[BuilderFileEmit[\"DtsOnly\"] = 0] = \"DtsOnly\";\n        BuilderFileEmit[BuilderFileEmit[\"Full\"] = 1] = \"Full\";\n    })(BuilderFileEmit = ts.BuilderFileEmit || (ts.BuilderFileEmit = {}));\n    function hasSameKeys(map1, map2) {\n        // Has same size and every key is present in both maps\n        return map1 === map2 || map1 !== undefined && map2 !== undefined && map1.size === map2.size && !ts.forEachKey(map1, function (key) { return !map2.has(key); });\n    }\n    /**\n     * Create the state so that we can iterate on changedFiles/affected files\n     */\n    function createBuilderProgramState(newProgram, getCanonicalFileName, oldState) {\n        var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState);\n        state.program = newProgram;\n        var compilerOptions = newProgram.getCompilerOptions();\n        state.compilerOptions = compilerOptions;\n        // With --out or --outFile, any change affects all semantic diagnostics so no need to cache them\n        if (!ts.outFile(compilerOptions)) {\n            state.semanticDiagnosticsPerFile = new ts.Map();\n        }\n        state.changedFilesSet = new ts.Set();\n        var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState);\n        var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;\n        var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&\n            !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);\n        if (useOldState) {\n            // Verify the sanity of old state\n            if (!oldState.currentChangedFilePath) {\n                var affectedSignatures = oldState.currentAffectedFilesSignatures;\n                ts.Debug.assert(!oldState.affectedFiles && (!affectedSignatures || !affectedSignatures.size), \"Cannot reuse if only few affected files of currentChangedFile were iterated\");\n            }\n            var changedFilesSet = oldState.changedFilesSet;\n            if (canCopySemanticDiagnostics) {\n                ts.Debug.assert(!changedFilesSet || !ts.forEachKey(changedFilesSet, function (path) { return oldState.semanticDiagnosticsPerFile.has(path); }), \"Semantic diagnostics shouldnt be available for changed files\");\n            }\n            // Copy old state's changed files set\n            changedFilesSet === null || changedFilesSet === void 0 ? void 0 : changedFilesSet.forEach(function (value) { return state.changedFilesSet.add(value); });\n            if (!ts.outFile(compilerOptions) && oldState.affectedFilesPendingEmit) {\n                state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit.slice();\n                state.affectedFilesPendingEmitKind = oldState.affectedFilesPendingEmitKind && new ts.Map(oldState.affectedFilesPendingEmitKind);\n                state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex;\n                state.seenAffectedFiles = new ts.Set();\n            }\n        }\n        // Update changed files and copy semantic diagnostics if we can\n        var referencedMap = state.referencedMap;\n        var oldReferencedMap = useOldState ? oldState.referencedMap : undefined;\n        var copyDeclarationFileDiagnostics = canCopySemanticDiagnostics && !compilerOptions.skipLibCheck === !oldCompilerOptions.skipLibCheck;\n        var copyLibFileDiagnostics = copyDeclarationFileDiagnostics && !compilerOptions.skipDefaultLibCheck === !oldCompilerOptions.skipDefaultLibCheck;\n        state.fileInfos.forEach(function (info, sourceFilePath) {\n            var oldInfo;\n            var newReferences;\n            // if not using old state, every file is changed\n            if (!useOldState ||\n                // File wasn't present in old state\n                !(oldInfo = oldState.fileInfos.get(sourceFilePath)) ||\n                // versions dont match\n                oldInfo.version !== info.version ||\n                // Referenced files changed\n                !hasSameKeys(newReferences = referencedMap && referencedMap.get(sourceFilePath), oldReferencedMap && oldReferencedMap.get(sourceFilePath)) ||\n                // Referenced file was deleted in the new program\n                newReferences && ts.forEachKey(newReferences, function (path) { return !state.fileInfos.has(path) && oldState.fileInfos.has(path); })) {\n                // Register file as changed file and do not copy semantic diagnostics, since all changed files need to be re-evaluated\n                state.changedFilesSet.add(sourceFilePath);\n            }\n            else if (canCopySemanticDiagnostics) {\n                var sourceFile = newProgram.getSourceFileByPath(sourceFilePath);\n                if (sourceFile.isDeclarationFile && !copyDeclarationFileDiagnostics) {\n                    return;\n                }\n                if (sourceFile.hasNoDefaultLib && !copyLibFileDiagnostics) {\n                    return;\n                }\n                // Unchanged file copy diagnostics\n                var diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath);\n                if (diagnostics) {\n                    state.semanticDiagnosticsPerFile.set(sourceFilePath, oldState.hasReusableDiagnostic ? convertToDiagnostics(diagnostics, newProgram, getCanonicalFileName) : diagnostics);\n                    if (!state.semanticDiagnosticsFromOldState) {\n                        state.semanticDiagnosticsFromOldState = new ts.Set();\n                    }\n                    state.semanticDiagnosticsFromOldState.add(sourceFilePath);\n                }\n            }\n        });\n        // If the global file is removed, add all files as changed\n        if (useOldState && ts.forEachEntry(oldState.fileInfos, function (info, sourceFilePath) { return info.affectsGlobalScope && !state.fileInfos.has(sourceFilePath); })) {\n            ts.BuilderState.getAllFilesExcludingDefaultLibraryFile(state, newProgram, /*firstSourceFile*/ undefined)\n                .forEach(function (file) { return state.changedFilesSet.add(file.resolvedPath); });\n        }\n        else if (oldCompilerOptions && !ts.outFile(compilerOptions) && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) {\n            // Add all files to affectedFilesPendingEmit since emit changed\n            newProgram.getSourceFiles().forEach(function (f) { return addToAffectedFilesPendingEmit(state, f.resolvedPath, 1 /* Full */); });\n            ts.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size);\n            state.seenAffectedFiles = state.seenAffectedFiles || new ts.Set();\n        }\n        state.buildInfoEmitPending = !!state.changedFilesSet.size;\n        return state;\n    }\n    function convertToDiagnostics(diagnostics, newProgram, getCanonicalFileName) {\n        if (!diagnostics.length)\n            return ts.emptyArray;\n        var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(ts.getTsBuildInfoEmitOutputFilePath(newProgram.getCompilerOptions()), newProgram.getCurrentDirectory()));\n        return diagnostics.map(function (diagnostic) {\n            var result = convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath);\n            result.reportsUnnecessary = diagnostic.reportsUnnecessary;\n            result.reportsDeprecated = diagnostic.reportDeprecated;\n            result.source = diagnostic.source;\n            result.skippedOn = diagnostic.skippedOn;\n            var relatedInformation = diagnostic.relatedInformation;\n            result.relatedInformation = relatedInformation ?\n                relatedInformation.length ?\n                    relatedInformation.map(function (r) { return convertToDiagnosticRelatedInformation(r, newProgram, toPath); }) :\n                    [] :\n                undefined;\n            return result;\n        });\n        function toPath(path) {\n            return ts.toPath(path, buildInfoDirectory, getCanonicalFileName);\n        }\n    }\n    function convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath) {\n        var file = diagnostic.file;\n        return __assign(__assign({}, diagnostic), { file: file ? newProgram.getSourceFileByPath(toPath(file)) : undefined });\n    }\n    /**\n     * Releases program and other related not needed properties\n     */\n    function releaseCache(state) {\n        ts.BuilderState.releaseCache(state);\n        state.program = undefined;\n    }\n    /**\n     * Creates a clone of the state\n     */\n    function cloneBuilderProgramState(state) {\n        var newState = ts.BuilderState.clone(state);\n        newState.semanticDiagnosticsPerFile = state.semanticDiagnosticsPerFile && new ts.Map(state.semanticDiagnosticsPerFile);\n        newState.changedFilesSet = new ts.Set(state.changedFilesSet);\n        newState.affectedFiles = state.affectedFiles;\n        newState.affectedFilesIndex = state.affectedFilesIndex;\n        newState.currentChangedFilePath = state.currentChangedFilePath;\n        newState.currentAffectedFilesSignatures = state.currentAffectedFilesSignatures && new ts.Map(state.currentAffectedFilesSignatures);\n        newState.currentAffectedFilesExportedModulesMap = state.currentAffectedFilesExportedModulesMap && new ts.Map(state.currentAffectedFilesExportedModulesMap);\n        newState.seenAffectedFiles = state.seenAffectedFiles && new ts.Set(state.seenAffectedFiles);\n        newState.cleanedDiagnosticsOfLibFiles = state.cleanedDiagnosticsOfLibFiles;\n        newState.semanticDiagnosticsFromOldState = state.semanticDiagnosticsFromOldState && new ts.Set(state.semanticDiagnosticsFromOldState);\n        newState.program = state.program;\n        newState.compilerOptions = state.compilerOptions;\n        newState.affectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice();\n        newState.affectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind);\n        newState.affectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex;\n        newState.seenEmittedFiles = state.seenEmittedFiles && new ts.Map(state.seenEmittedFiles);\n        newState.programEmitComplete = state.programEmitComplete;\n        return newState;\n    }\n    /**\n     * Verifies that source file is ok to be used in calls that arent handled by next\n     */\n    function assertSourceFileOkWithoutNextAffectedCall(state, sourceFile) {\n        ts.Debug.assert(!sourceFile || !state.affectedFiles || state.affectedFiles[state.affectedFilesIndex - 1] !== sourceFile || !state.semanticDiagnosticsPerFile.has(sourceFile.resolvedPath));\n    }\n    /**\n     * This function returns the next affected file to be processed.\n     * Note that until doneAffected is called it would keep reporting same result\n     * This is to allow the callers to be able to actually remove affected file only when the operation is complete\n     * eg. if during diagnostics check cancellation token ends up cancelling the request, the affected file should be retained\n     */\n    function getNextAffectedFile(state, cancellationToken, computeHash) {\n        while (true) {\n            var affectedFiles = state.affectedFiles;\n            if (affectedFiles) {\n                var seenAffectedFiles = state.seenAffectedFiles;\n                var affectedFilesIndex = state.affectedFilesIndex; // TODO: GH#18217\n                while (affectedFilesIndex < affectedFiles.length) {\n                    var affectedFile = affectedFiles[affectedFilesIndex];\n                    if (!seenAffectedFiles.has(affectedFile.resolvedPath)) {\n                        // Set the next affected file as seen and remove the cached semantic diagnostics\n                        state.affectedFilesIndex = affectedFilesIndex;\n                        handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash);\n                        return affectedFile;\n                    }\n                    affectedFilesIndex++;\n                }\n                // Remove the changed file from the change set\n                state.changedFilesSet.delete(state.currentChangedFilePath);\n                state.currentChangedFilePath = undefined;\n                // Commit the changes in file signature\n                ts.BuilderState.updateSignaturesFromCache(state, state.currentAffectedFilesSignatures);\n                state.currentAffectedFilesSignatures.clear();\n                ts.BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);\n                state.affectedFiles = undefined;\n            }\n            // Get next changed file\n            var nextKey = state.changedFilesSet.keys().next();\n            if (nextKey.done) {\n                // Done\n                return undefined;\n            }\n            // With --out or --outFile all outputs go into single file\n            // so operations are performed directly on program, return program\n            var program = ts.Debug.checkDefined(state.program);\n            var compilerOptions = program.getCompilerOptions();\n            if (ts.outFile(compilerOptions)) {\n                ts.Debug.assert(!state.semanticDiagnosticsPerFile);\n                return program;\n            }\n            // Get next batch of affected files\n            if (!state.currentAffectedFilesSignatures)\n                state.currentAffectedFilesSignatures = new ts.Map();\n            if (state.exportedModulesMap) {\n                if (!state.currentAffectedFilesExportedModulesMap)\n                    state.currentAffectedFilesExportedModulesMap = new ts.Map();\n            }\n            state.affectedFiles = ts.BuilderState.getFilesAffectedBy(state, program, nextKey.value, cancellationToken, computeHash, state.currentAffectedFilesSignatures, state.currentAffectedFilesExportedModulesMap);\n            state.currentChangedFilePath = nextKey.value;\n            state.affectedFilesIndex = 0;\n            if (!state.seenAffectedFiles)\n                state.seenAffectedFiles = new ts.Set();\n        }\n    }\n    /**\n     * Returns next file to be emitted from files that retrieved semantic diagnostics but did not emit yet\n     */\n    function getNextAffectedFilePendingEmit(state) {\n        var affectedFilesPendingEmit = state.affectedFilesPendingEmit;\n        if (affectedFilesPendingEmit) {\n            var seenEmittedFiles = (state.seenEmittedFiles || (state.seenEmittedFiles = new ts.Map()));\n            for (var i = state.affectedFilesPendingEmitIndex; i < affectedFilesPendingEmit.length; i++) {\n                var affectedFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(affectedFilesPendingEmit[i]);\n                if (affectedFile) {\n                    var seenKind = seenEmittedFiles.get(affectedFile.resolvedPath);\n                    var emitKind = ts.Debug.checkDefined(ts.Debug.checkDefined(state.affectedFilesPendingEmitKind).get(affectedFile.resolvedPath));\n                    if (seenKind === undefined || seenKind < emitKind) {\n                        // emit this file\n                        state.affectedFilesPendingEmitIndex = i;\n                        return { affectedFile: affectedFile, emitKind: emitKind };\n                    }\n                }\n            }\n            state.affectedFilesPendingEmit = undefined;\n            state.affectedFilesPendingEmitKind = undefined;\n            state.affectedFilesPendingEmitIndex = undefined;\n        }\n        return undefined;\n    }\n    /**\n     *  Handles semantic diagnostics and dts emit for affectedFile and files, that are referencing modules that export entities from affected file\n     *  This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change\n     */\n    function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash) {\n        removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);\n        // If affected files is everything except default library, then nothing more to do\n        if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {\n            if (!state.cleanedDiagnosticsOfLibFiles) {\n                state.cleanedDiagnosticsOfLibFiles = true;\n                var program_1 = ts.Debug.checkDefined(state.program);\n                var options_2 = program_1.getCompilerOptions();\n                ts.forEach(program_1.getSourceFiles(), function (f) {\n                    return program_1.isSourceFileDefaultLibrary(f) &&\n                        !ts.skipTypeChecking(f, options_2, program_1) &&\n                        removeSemanticDiagnosticsOf(state, f.resolvedPath);\n                });\n            }\n            return;\n        }\n        if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) {\n            forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash); });\n        }\n    }\n    /**\n     * Handle the dts may change, so they need to be added to pending emit if dts emit is enabled,\n     * Also we need to make sure signature is updated for these files\n     */\n    function handleDtsMayChangeOf(state, path, cancellationToken, computeHash) {\n        removeSemanticDiagnosticsOf(state, path);\n        if (!state.changedFilesSet.has(path)) {\n            var program = ts.Debug.checkDefined(state.program);\n            var sourceFile = program.getSourceFileByPath(path);\n            if (sourceFile) {\n                // Even though the js emit doesnt change and we are already handling dts emit and semantic diagnostics\n                // we need to update the signature to reflect correctness of the signature(which is output d.ts emit) of this file\n                // This ensures that we dont later during incremental builds considering wrong signature.\n                // Eg where this also is needed to ensure that .tsbuildinfo generated by incremental build should be same as if it was first fresh build\n                ts.BuilderState.updateShapeSignature(state, program, sourceFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap);\n                // If not dts emit, nothing more to do\n                if (ts.getEmitDeclarations(state.compilerOptions)) {\n                    addToAffectedFilesPendingEmit(state, path, 0 /* DtsOnly */);\n                }\n            }\n        }\n        return false;\n    }\n    /**\n     * Removes semantic diagnostics for path and\n     * returns true if there are no more semantic diagnostics from the old state\n     */\n    function removeSemanticDiagnosticsOf(state, path) {\n        if (!state.semanticDiagnosticsFromOldState) {\n            return true;\n        }\n        state.semanticDiagnosticsFromOldState.delete(path);\n        state.semanticDiagnosticsPerFile.delete(path);\n        return !state.semanticDiagnosticsFromOldState.size;\n    }\n    function isChangedSignature(state, path) {\n        var newSignature = ts.Debug.checkDefined(state.currentAffectedFilesSignatures).get(path);\n        var oldSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;\n        return newSignature !== oldSignature;\n    }\n    /**\n     * Iterate on referencing modules that export entities from affected file\n     */\n    function forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, fn) {\n        // If there was change in signature (dts output) for the changed file,\n        // then only we need to handle pending file emit\n        if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath)) {\n            return;\n        }\n        if (!isChangedSignature(state, affectedFile.resolvedPath))\n            return;\n        // Since isolated modules dont change js files, files affected by change in signature is itself\n        // But we need to cleanup semantic diagnostics and queue dts emit for affected files\n        if (state.compilerOptions.isolatedModules) {\n            var seenFileNamesMap = new ts.Map();\n            seenFileNamesMap.set(affectedFile.resolvedPath, true);\n            var queue = ts.BuilderState.getReferencedByPaths(state, affectedFile.resolvedPath);\n            while (queue.length > 0) {\n                var currentPath = queue.pop();\n                if (!seenFileNamesMap.has(currentPath)) {\n                    seenFileNamesMap.set(currentPath, true);\n                    var result = fn(state, currentPath);\n                    if (result && isChangedSignature(state, currentPath)) {\n                        var currentSourceFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(currentPath);\n                        queue.push.apply(queue, ts.BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));\n                    }\n                }\n            }\n        }\n        ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);\n        var seenFileAndExportsOfFile = new ts.Set();\n        // Go through exported modules from cache first\n        // If exported modules has path, all files referencing file exported from are affected\n        if (ts.forEachEntry(state.currentAffectedFilesExportedModulesMap, function (exportedModules, exportedFromPath) {\n            return exportedModules &&\n                exportedModules.has(affectedFile.resolvedPath) &&\n                forEachFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile, fn);\n        })) {\n            return;\n        }\n        // If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected\n        ts.forEachEntry(state.exportedModulesMap, function (exportedModules, exportedFromPath) {\n            return !state.currentAffectedFilesExportedModulesMap.has(exportedFromPath) && // If we already iterated this through cache, ignore it\n                exportedModules.has(affectedFile.resolvedPath) &&\n                forEachFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile, fn);\n        });\n    }\n    /**\n     * Iterate on files referencing referencedPath\n     */\n    function forEachFilesReferencingPath(state, referencedPath, seenFileAndExportsOfFile, fn) {\n        return ts.forEachEntry(state.referencedMap, function (referencesInFile, filePath) {\n            return referencesInFile.has(referencedPath) && forEachFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, fn);\n        });\n    }\n    /**\n     * fn on file and iterate on anything that exports this file\n     */\n    function forEachFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, fn) {\n        if (!ts.tryAddToSet(seenFileAndExportsOfFile, filePath)) {\n            return false;\n        }\n        if (fn(state, filePath)) {\n            // If there are no more diagnostics from old cache, done\n            return true;\n        }\n        ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);\n        // Go through exported modules from cache first\n        // If exported modules has path, all files referencing file exported from are affected\n        if (ts.forEachEntry(state.currentAffectedFilesExportedModulesMap, function (exportedModules, exportedFromPath) {\n            return exportedModules &&\n                exportedModules.has(filePath) &&\n                forEachFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, fn);\n        })) {\n            return true;\n        }\n        // If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected\n        if (ts.forEachEntry(state.exportedModulesMap, function (exportedModules, exportedFromPath) {\n            return !state.currentAffectedFilesExportedModulesMap.has(exportedFromPath) && // If we already iterated this through cache, ignore it\n                exportedModules.has(filePath) &&\n                forEachFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, fn);\n        })) {\n            return true;\n        }\n        // Remove diagnostics of files that import this file (without going to exports of referencing files)\n        return !!ts.forEachEntry(state.referencedMap, function (referencesInFile, referencingFilePath) {\n            return referencesInFile.has(filePath) &&\n                !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file\n                fn(state, referencingFilePath);\n        } // Dont add to seen since this is not yet done with the export removal\n        );\n    }\n    /**\n     * This is called after completing operation on the next affected file.\n     * The operations here are postponed to ensure that cancellation during the iteration is handled correctly\n     */\n    function doneWithAffectedFile(state, affected, emitKind, isPendingEmit, isBuildInfoEmit) {\n        if (isBuildInfoEmit) {\n            state.buildInfoEmitPending = false;\n        }\n        else if (affected === state.program) {\n            state.changedFilesSet.clear();\n            state.programEmitComplete = true;\n        }\n        else {\n            state.seenAffectedFiles.add(affected.resolvedPath);\n            if (emitKind !== undefined) {\n                (state.seenEmittedFiles || (state.seenEmittedFiles = new ts.Map())).set(affected.resolvedPath, emitKind);\n            }\n            if (isPendingEmit) {\n                state.affectedFilesPendingEmitIndex++;\n                state.buildInfoEmitPending = true;\n            }\n            else {\n                state.affectedFilesIndex++;\n            }\n        }\n    }\n    /**\n     * Returns the result with affected file\n     */\n    function toAffectedFileResult(state, result, affected) {\n        doneWithAffectedFile(state, affected);\n        return { result: result, affected: affected };\n    }\n    /**\n     * Returns the result with affected file\n     */\n    function toAffectedFileEmitResult(state, result, affected, emitKind, isPendingEmit, isBuildInfoEmit) {\n        doneWithAffectedFile(state, affected, emitKind, isPendingEmit, isBuildInfoEmit);\n        return { result: result, affected: affected };\n    }\n    /**\n     * Gets semantic diagnostics for the file which are\n     * bindAndCheckDiagnostics (from cache) and program diagnostics\n     */\n    function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken) {\n        return ts.concatenate(getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken), ts.Debug.checkDefined(state.program).getProgramDiagnostics(sourceFile));\n    }\n    /**\n     * Gets the binder and checker diagnostics either from cache if present, or otherwise from program and caches it\n     * Note that it is assumed that when asked about binder and checker diagnostics, the file has been taken out of affected files/changed file set\n     */\n    function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken) {\n        var path = sourceFile.resolvedPath;\n        if (state.semanticDiagnosticsPerFile) {\n            var cachedDiagnostics = state.semanticDiagnosticsPerFile.get(path);\n            // Report the bind and check diagnostics from the cache if we already have those diagnostics present\n            if (cachedDiagnostics) {\n                return ts.filterSemanticDiagnotics(cachedDiagnostics, state.compilerOptions);\n            }\n        }\n        // Diagnostics werent cached, get them from program, and cache the result\n        var diagnostics = ts.Debug.checkDefined(state.program).getBindAndCheckDiagnostics(sourceFile, cancellationToken);\n        if (state.semanticDiagnosticsPerFile) {\n            state.semanticDiagnosticsPerFile.set(path, diagnostics);\n        }\n        return ts.filterSemanticDiagnotics(diagnostics, state.compilerOptions);\n    }\n    /**\n     * Gets the program information to be emitted in buildInfo so that we can use it to create new program\n     */\n    function getProgramBuildInfo(state, getCanonicalFileName) {\n        if (ts.outFile(state.compilerOptions))\n            return undefined;\n        var currentDirectory = ts.Debug.checkDefined(state.program).getCurrentDirectory();\n        var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(ts.getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));\n        var fileInfos = {};\n        state.fileInfos.forEach(function (value, key) {\n            var signature = state.currentAffectedFilesSignatures && state.currentAffectedFilesSignatures.get(key);\n            fileInfos[relativeToBuildInfo(key)] = signature === undefined ? value : { version: value.version, signature: signature, affectsGlobalScope: value.affectsGlobalScope };\n        });\n        var result = {\n            fileInfos: fileInfos,\n            options: convertToReusableCompilerOptions(state.compilerOptions, relativeToBuildInfoEnsuringAbsolutePath)\n        };\n        if (state.referencedMap) {\n            var referencedMap = {};\n            for (var _i = 0, _a = ts.arrayFrom(state.referencedMap.keys()).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {\n                var key = _a[_i];\n                referencedMap[relativeToBuildInfo(key)] = ts.arrayFrom(state.referencedMap.get(key).keys(), relativeToBuildInfo).sort(ts.compareStringsCaseSensitive);\n            }\n            result.referencedMap = referencedMap;\n        }\n        if (state.exportedModulesMap) {\n            var exportedModulesMap = {};\n            for (var _b = 0, _c = ts.arrayFrom(state.exportedModulesMap.keys()).sort(ts.compareStringsCaseSensitive); _b < _c.length; _b++) {\n                var key = _c[_b];\n                var newValue = state.currentAffectedFilesExportedModulesMap && state.currentAffectedFilesExportedModulesMap.get(key);\n                // Not in temporary cache, use existing value\n                if (newValue === undefined)\n                    exportedModulesMap[relativeToBuildInfo(key)] = ts.arrayFrom(state.exportedModulesMap.get(key).keys(), relativeToBuildInfo).sort(ts.compareStringsCaseSensitive);\n                // Value in cache and has updated value map, use that\n                else if (newValue)\n                    exportedModulesMap[relativeToBuildInfo(key)] = ts.arrayFrom(newValue.keys(), relativeToBuildInfo).sort(ts.compareStringsCaseSensitive);\n            }\n            result.exportedModulesMap = exportedModulesMap;\n        }\n        if (state.semanticDiagnosticsPerFile) {\n            var semanticDiagnosticsPerFile = [];\n            for (var _d = 0, _e = ts.arrayFrom(state.semanticDiagnosticsPerFile.keys()).sort(ts.compareStringsCaseSensitive); _d < _e.length; _d++) {\n                var key = _e[_d];\n                var value = state.semanticDiagnosticsPerFile.get(key);\n                semanticDiagnosticsPerFile.push(value.length ?\n                    [\n                        relativeToBuildInfo(key),\n                        state.hasReusableDiagnostic ?\n                            value :\n                            convertToReusableDiagnostics(value, relativeToBuildInfo)\n                    ] :\n                    relativeToBuildInfo(key));\n            }\n            result.semanticDiagnosticsPerFile = semanticDiagnosticsPerFile;\n        }\n        if (state.affectedFilesPendingEmit) {\n            var affectedFilesPendingEmit = [];\n            var seenFiles = new ts.Set();\n            for (var _f = 0, _g = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts.compareStringsCaseSensitive); _f < _g.length; _f++) {\n                var path = _g[_f];\n                if (ts.tryAddToSet(seenFiles, path)) {\n                    affectedFilesPendingEmit.push([relativeToBuildInfo(path), state.affectedFilesPendingEmitKind.get(path)]);\n                }\n            }\n            result.affectedFilesPendingEmit = affectedFilesPendingEmit;\n        }\n        return result;\n        function relativeToBuildInfoEnsuringAbsolutePath(path) {\n            return relativeToBuildInfo(ts.getNormalizedAbsolutePath(path, currentDirectory));\n        }\n        function relativeToBuildInfo(path) {\n            return ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(buildInfoDirectory, path, getCanonicalFileName));\n        }\n    }\n    function convertToReusableCompilerOptions(options, relativeToBuildInfo) {\n        var result = {};\n        var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;\n        for (var name in options) {\n            if (ts.hasProperty(options, name)) {\n                result[name] = convertToReusableCompilerOptionValue(optionsNameMap.get(name.toLowerCase()), options[name], relativeToBuildInfo);\n            }\n        }\n        if (result.configFilePath) {\n            result.configFilePath = relativeToBuildInfo(result.configFilePath);\n        }\n        return result;\n    }\n    function convertToReusableCompilerOptionValue(option, value, relativeToBuildInfo) {\n        if (option) {\n            if (option.type === \"list\") {\n                var values = value;\n                if (option.element.isFilePath && values.length) {\n                    return values.map(relativeToBuildInfo);\n                }\n            }\n            else if (option.isFilePath) {\n                return relativeToBuildInfo(value);\n            }\n        }\n        return value;\n    }\n    function convertToReusableDiagnostics(diagnostics, relativeToBuildInfo) {\n        ts.Debug.assert(!!diagnostics.length);\n        return diagnostics.map(function (diagnostic) {\n            var result = convertToReusableDiagnosticRelatedInformation(diagnostic, relativeToBuildInfo);\n            result.reportsUnnecessary = diagnostic.reportsUnnecessary;\n            result.reportDeprecated = diagnostic.reportsDeprecated;\n            result.source = diagnostic.source;\n            result.skippedOn = diagnostic.skippedOn;\n            var relatedInformation = diagnostic.relatedInformation;\n            result.relatedInformation = relatedInformation ?\n                relatedInformation.length ?\n                    relatedInformation.map(function (r) { return convertToReusableDiagnosticRelatedInformation(r, relativeToBuildInfo); }) :\n                    [] :\n                undefined;\n            return result;\n        });\n    }\n    function convertToReusableDiagnosticRelatedInformation(diagnostic, relativeToBuildInfo) {\n        var file = diagnostic.file;\n        return __assign(__assign({}, diagnostic), { file: file ? relativeToBuildInfo(file.resolvedPath) : undefined });\n    }\n    var BuilderProgramKind;\n    (function (BuilderProgramKind) {\n        BuilderProgramKind[BuilderProgramKind[\"SemanticDiagnosticsBuilderProgram\"] = 0] = \"SemanticDiagnosticsBuilderProgram\";\n        BuilderProgramKind[BuilderProgramKind[\"EmitAndSemanticDiagnosticsBuilderProgram\"] = 1] = \"EmitAndSemanticDiagnosticsBuilderProgram\";\n    })(BuilderProgramKind = ts.BuilderProgramKind || (ts.BuilderProgramKind = {}));\n    function getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {\n        var host;\n        var newProgram;\n        var oldProgram;\n        if (newProgramOrRootNames === undefined) {\n            ts.Debug.assert(hostOrOptions === undefined);\n            host = oldProgramOrHost;\n            oldProgram = configFileParsingDiagnosticsOrOldProgram;\n            ts.Debug.assert(!!oldProgram);\n            newProgram = oldProgram.getProgram();\n        }\n        else if (ts.isArray(newProgramOrRootNames)) {\n            oldProgram = configFileParsingDiagnosticsOrOldProgram;\n            newProgram = ts.createProgram({\n                rootNames: newProgramOrRootNames,\n                options: hostOrOptions,\n                host: oldProgramOrHost,\n                oldProgram: oldProgram && oldProgram.getProgramOrUndefined(),\n                configFileParsingDiagnostics: configFileParsingDiagnostics,\n                projectReferences: projectReferences\n            });\n            host = oldProgramOrHost;\n        }\n        else {\n            newProgram = newProgramOrRootNames;\n            host = hostOrOptions;\n            oldProgram = oldProgramOrHost;\n            configFileParsingDiagnostics = configFileParsingDiagnosticsOrOldProgram;\n        }\n        return { host: host, newProgram: newProgram, oldProgram: oldProgram, configFileParsingDiagnostics: configFileParsingDiagnostics || ts.emptyArray };\n    }\n    ts.getBuilderCreationParameters = getBuilderCreationParameters;\n    function createBuilderProgram(kind, _a) {\n        var newProgram = _a.newProgram, host = _a.host, oldProgram = _a.oldProgram, configFileParsingDiagnostics = _a.configFileParsingDiagnostics;\n        // Return same program if underlying program doesnt change\n        var oldState = oldProgram && oldProgram.getState();\n        if (oldState && newProgram === oldState.program && configFileParsingDiagnostics === newProgram.getConfigFileParsingDiagnostics()) {\n            newProgram = undefined; // TODO: GH#18217\n            oldState = undefined;\n            return oldProgram;\n        }\n        /**\n         * Create the canonical file name for identity\n         */\n        var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());\n        /**\n         * Computing hash to for signature verification\n         */\n        var computeHash = ts.maybeBind(host, host.createHash);\n        var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState);\n        var backupState;\n        newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); };\n        // To ensure that we arent storing any references to old program or new program without state\n        newProgram = undefined; // TODO: GH#18217\n        oldProgram = undefined;\n        oldState = undefined;\n        var builderProgram = createRedirectedBuilderProgram(state, configFileParsingDiagnostics);\n        builderProgram.getState = function () { return state; };\n        builderProgram.backupState = function () {\n            ts.Debug.assert(backupState === undefined);\n            backupState = cloneBuilderProgramState(state);\n        };\n        builderProgram.restoreState = function () {\n            state = ts.Debug.checkDefined(backupState);\n            backupState = undefined;\n        };\n        builderProgram.getAllDependencies = function (sourceFile) { return ts.BuilderState.getAllDependencies(state, ts.Debug.checkDefined(state.program), sourceFile); };\n        builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;\n        builderProgram.emit = emit;\n        builderProgram.releaseProgram = function () {\n            releaseCache(state);\n            backupState = undefined;\n        };\n        if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) {\n            builderProgram.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile;\n        }\n        else if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {\n            builderProgram.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile;\n            builderProgram.emitNextAffectedFile = emitNextAffectedFile;\n            builderProgram.emitBuildInfo = emitBuildInfo;\n        }\n        else {\n            ts.notImplemented();\n        }\n        return builderProgram;\n        function emitBuildInfo(writeFile, cancellationToken) {\n            if (state.buildInfoEmitPending) {\n                var result = ts.Debug.checkDefined(state.program).emitBuildInfo(writeFile || ts.maybeBind(host, host.writeFile), cancellationToken);\n                state.buildInfoEmitPending = false;\n                return result;\n            }\n            return ts.emitSkippedWithNoDiagnostics;\n        }\n        /**\n         * Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete\n         * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host\n         * in that order would be used to write the files\n         */\n        function emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {\n            var affected = getNextAffectedFile(state, cancellationToken, computeHash);\n            var emitKind = 1 /* Full */;\n            var isPendingEmitFile = false;\n            if (!affected) {\n                if (!ts.outFile(state.compilerOptions)) {\n                    var pendingAffectedFile = getNextAffectedFilePendingEmit(state);\n                    if (!pendingAffectedFile) {\n                        if (!state.buildInfoEmitPending) {\n                            return undefined;\n                        }\n                        var affected_1 = ts.Debug.checkDefined(state.program);\n                        return toAffectedFileEmitResult(state, \n                        // When whole program is affected, do emit only once (eg when --out or --outFile is specified)\n                        // Otherwise just affected file\n                        affected_1.emitBuildInfo(writeFile || ts.maybeBind(host, host.writeFile), cancellationToken), affected_1, 1 /* Full */, \n                        /*isPendingEmitFile*/ false, \n                        /*isBuildInfoEmit*/ true);\n                    }\n                    (affected = pendingAffectedFile.affectedFile, emitKind = pendingAffectedFile.emitKind);\n                    isPendingEmitFile = true;\n                }\n                else {\n                    var program = ts.Debug.checkDefined(state.program);\n                    if (state.programEmitComplete)\n                        return undefined;\n                    affected = program;\n                }\n            }\n            return toAffectedFileEmitResult(state, \n            // When whole program is affected, do emit only once (eg when --out or --outFile is specified)\n            // Otherwise just affected file\n            ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles || emitKind === 0 /* DtsOnly */, customTransformers), affected, emitKind, isPendingEmitFile);\n        }\n        /**\n         * Emits the JavaScript and declaration files.\n         * When targetSource file is specified, emits the files corresponding to that source file,\n         * otherwise for the whole program.\n         * In case of EmitAndSemanticDiagnosticsBuilderProgram, when targetSourceFile is specified,\n         * it is assumed that that file is handled from affected file list. If targetSourceFile is not specified,\n         * it will only emit all the affected files instead of whole program\n         *\n         * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host\n         * in that order would be used to write the files\n         */\n        function emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {\n            var restorePendingEmitOnHandlingNoEmitSuccess = false;\n            var savedAffectedFilesPendingEmit;\n            var savedAffectedFilesPendingEmitKind;\n            var savedAffectedFilesPendingEmitIndex;\n            // Backup and restore affected pendings emit state for non emit Builder if noEmitOnError is enabled and emitBuildInfo could be written in case there are errors\n            // This ensures pending files to emit is updated in tsbuildinfo\n            // Note that when there are no errors, emit proceeds as if everything is emitted as it is callers reponsibility to write the files to disk if at all (because its builder that doesnt track files to emit)\n            if (kind !== BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram &&\n                !targetSourceFile &&\n                !ts.outFile(state.compilerOptions) &&\n                !state.compilerOptions.noEmit &&\n                state.compilerOptions.noEmitOnError) {\n                restorePendingEmitOnHandlingNoEmitSuccess = true;\n                savedAffectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice();\n                savedAffectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind);\n                savedAffectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex;\n            }\n            if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {\n                assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile);\n            }\n            var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken);\n            if (result)\n                return result;\n            if (restorePendingEmitOnHandlingNoEmitSuccess) {\n                state.affectedFilesPendingEmit = savedAffectedFilesPendingEmit;\n                state.affectedFilesPendingEmitKind = savedAffectedFilesPendingEmitKind;\n                state.affectedFilesPendingEmitIndex = savedAffectedFilesPendingEmitIndex;\n            }\n            // Emit only affected files if using builder for emit\n            if (!targetSourceFile && kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {\n                // Emit and report any errors we ran into.\n                var sourceMaps = [];\n                var emitSkipped = false;\n                var diagnostics = void 0;\n                var emittedFiles = [];\n                var affectedEmitResult = void 0;\n                while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) {\n                    emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped;\n                    diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics);\n                    emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles);\n                    sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps);\n                }\n                return {\n                    emitSkipped: emitSkipped,\n                    diagnostics: diagnostics || ts.emptyArray,\n                    emittedFiles: emittedFiles,\n                    sourceMaps: sourceMaps\n                };\n            }\n            return ts.Debug.checkDefined(state.program).emit(targetSourceFile, writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers);\n        }\n        /**\n         * Return the semantic diagnostics for the next affected file or undefined if iteration is complete\n         * If provided ignoreSourceFile would be called before getting the diagnostics and would ignore the sourceFile if the returned value was true\n         */\n        function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) {\n            while (true) {\n                var affected = getNextAffectedFile(state, cancellationToken, computeHash);\n                if (!affected) {\n                    // Done\n                    return undefined;\n                }\n                else if (affected === state.program) {\n                    // When whole program is affected, get all semantic diagnostics (eg when --out or --outFile is specified)\n                    return toAffectedFileResult(state, state.program.getSemanticDiagnostics(/*targetSourceFile*/ undefined, cancellationToken), affected);\n                }\n                // Add file to affected file pending emit to handle for later emit time\n                // Apart for emit builder do this for tsbuildinfo, do this for non emit builder when noEmit is set as tsbuildinfo is written and reused between emitters\n                if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram || state.compilerOptions.noEmit || state.compilerOptions.noEmitOnError) {\n                    addToAffectedFilesPendingEmit(state, affected.resolvedPath, 1 /* Full */);\n                }\n                // Get diagnostics for the affected file if its not ignored\n                if (ignoreSourceFile && ignoreSourceFile(affected)) {\n                    // Get next affected file\n                    doneWithAffectedFile(state, affected);\n                    continue;\n                }\n                return toAffectedFileResult(state, getSemanticDiagnosticsOfFile(state, affected, cancellationToken), affected);\n            }\n        }\n        /**\n         * Gets the semantic diagnostics from the program corresponding to this state of file (if provided) or whole program\n         * The semantic diagnostics are cached and managed here\n         * Note that it is assumed that when asked about semantic diagnostics through this API,\n         * the file has been taken out of affected files so it is safe to use cache or get from program and cache the diagnostics\n         * In case of SemanticDiagnosticsBuilderProgram if the source file is not provided,\n         * it will iterate through all the affected files, to ensure that cache stays valid and yet provide a way to get all semantic diagnostics\n         */\n        function getSemanticDiagnostics(sourceFile, cancellationToken) {\n            assertSourceFileOkWithoutNextAffectedCall(state, sourceFile);\n            var compilerOptions = ts.Debug.checkDefined(state.program).getCompilerOptions();\n            if (ts.outFile(compilerOptions)) {\n                ts.Debug.assert(!state.semanticDiagnosticsPerFile);\n                // We dont need to cache the diagnostics just return them from program\n                return ts.Debug.checkDefined(state.program).getSemanticDiagnostics(sourceFile, cancellationToken);\n            }\n            if (sourceFile) {\n                return getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken);\n            }\n            // When semantic builder asks for diagnostics of the whole program,\n            // ensure that all the affected files are handled\n            // eslint-disable-next-line no-empty\n            while (getSemanticDiagnosticsOfNextAffectedFile(cancellationToken)) {\n            }\n            var diagnostics;\n            for (var _i = 0, _a = ts.Debug.checkDefined(state.program).getSourceFiles(); _i < _a.length; _i++) {\n                var sourceFile_1 = _a[_i];\n                diagnostics = ts.addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile_1, cancellationToken));\n            }\n            return diagnostics || ts.emptyArray;\n        }\n    }\n    ts.createBuilderProgram = createBuilderProgram;\n    function addToAffectedFilesPendingEmit(state, affectedFilePendingEmit, kind) {\n        if (!state.affectedFilesPendingEmit)\n            state.affectedFilesPendingEmit = [];\n        if (!state.affectedFilesPendingEmitKind)\n            state.affectedFilesPendingEmitKind = new ts.Map();\n        var existingKind = state.affectedFilesPendingEmitKind.get(affectedFilePendingEmit);\n        state.affectedFilesPendingEmit.push(affectedFilePendingEmit);\n        state.affectedFilesPendingEmitKind.set(affectedFilePendingEmit, existingKind || kind);\n        // affectedFilesPendingEmitIndex === undefined\n        // - means the emit state.affectedFilesPendingEmit was undefined before adding current affected files\n        //   so start from 0 as array would be affectedFilesPendingEmit\n        // else, continue to iterate from existing index, the current set is appended to existing files\n        if (state.affectedFilesPendingEmitIndex === undefined) {\n            state.affectedFilesPendingEmitIndex = 0;\n        }\n    }\n    function getMapOfReferencedSet(mapLike, toPath) {\n        if (!mapLike)\n            return undefined;\n        var map = new ts.Map();\n        // Copies keys/values from template. Note that for..in will not throw if\n        // template is undefined, and instead will just exit the loop.\n        for (var key in mapLike) {\n            if (ts.hasProperty(mapLike, key)) {\n                map.set(toPath(key), new ts.Set(mapLike[key].map(toPath)));\n            }\n        }\n        return map;\n    }\n    function createBuildProgramUsingProgramBuildInfo(program, buildInfoPath, host) {\n        var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));\n        var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());\n        var fileInfos = new ts.Map();\n        for (var key in program.fileInfos) {\n            if (ts.hasProperty(program.fileInfos, key)) {\n                fileInfos.set(toPath(key), program.fileInfos[key]);\n            }\n        }\n        var state = {\n            fileInfos: fileInfos,\n            compilerOptions: ts.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath),\n            referencedMap: getMapOfReferencedSet(program.referencedMap, toPath),\n            exportedModulesMap: getMapOfReferencedSet(program.exportedModulesMap, toPath),\n            semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && ts.arrayToMap(program.semanticDiagnosticsPerFile, function (value) { return toPath(ts.isString(value) ? value : value[0]); }, function (value) { return ts.isString(value) ? ts.emptyArray : value[1]; }),\n            hasReusableDiagnostic: true,\n            affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toPath(value[0]); }),\n            affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toPath(value[0]); }, function (value) { return value[1]; }),\n            affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,\n        };\n        return {\n            getState: function () { return state; },\n            backupState: ts.noop,\n            restoreState: ts.noop,\n            getProgram: ts.notImplemented,\n            getProgramOrUndefined: ts.returnUndefined,\n            releaseProgram: ts.noop,\n            getCompilerOptions: function () { return state.compilerOptions; },\n            getSourceFile: ts.notImplemented,\n            getSourceFiles: ts.notImplemented,\n            getOptionsDiagnostics: ts.notImplemented,\n            getGlobalDiagnostics: ts.notImplemented,\n            getConfigFileParsingDiagnostics: ts.notImplemented,\n            getSyntacticDiagnostics: ts.notImplemented,\n            getDeclarationDiagnostics: ts.notImplemented,\n            getSemanticDiagnostics: ts.notImplemented,\n            emit: ts.notImplemented,\n            getAllDependencies: ts.notImplemented,\n            getCurrentDirectory: ts.notImplemented,\n            emitNextAffectedFile: ts.notImplemented,\n            getSemanticDiagnosticsOfNextAffectedFile: ts.notImplemented,\n            emitBuildInfo: ts.notImplemented,\n            close: ts.noop,\n        };\n        function toPath(path) {\n            return ts.toPath(path, buildInfoDirectory, getCanonicalFileName);\n        }\n        function toAbsolutePath(path) {\n            return ts.getNormalizedAbsolutePath(path, buildInfoDirectory);\n        }\n    }\n    ts.createBuildProgramUsingProgramBuildInfo = createBuildProgramUsingProgramBuildInfo;\n    function createRedirectedBuilderProgram(state, configFileParsingDiagnostics) {\n        return {\n            getState: ts.notImplemented,\n            backupState: ts.noop,\n            restoreState: ts.noop,\n            getProgram: getProgram,\n            getProgramOrUndefined: function () { return state.program; },\n            releaseProgram: function () { return state.program = undefined; },\n            getCompilerOptions: function () { return state.compilerOptions; },\n            getSourceFile: function (fileName) { return getProgram().getSourceFile(fileName); },\n            getSourceFiles: function () { return getProgram().getSourceFiles(); },\n            getOptionsDiagnostics: function (cancellationToken) { return getProgram().getOptionsDiagnostics(cancellationToken); },\n            getGlobalDiagnostics: function (cancellationToken) { return getProgram().getGlobalDiagnostics(cancellationToken); },\n            getConfigFileParsingDiagnostics: function () { return configFileParsingDiagnostics; },\n            getSyntacticDiagnostics: function (sourceFile, cancellationToken) { return getProgram().getSyntacticDiagnostics(sourceFile, cancellationToken); },\n            getDeclarationDiagnostics: function (sourceFile, cancellationToken) { return getProgram().getDeclarationDiagnostics(sourceFile, cancellationToken); },\n            getSemanticDiagnostics: function (sourceFile, cancellationToken) { return getProgram().getSemanticDiagnostics(sourceFile, cancellationToken); },\n            emit: function (sourceFile, writeFile, cancellationToken, emitOnlyDts, customTransformers) { return getProgram().emit(sourceFile, writeFile, cancellationToken, emitOnlyDts, customTransformers); },\n            emitBuildInfo: function (writeFile, cancellationToken) { return getProgram().emitBuildInfo(writeFile, cancellationToken); },\n            getAllDependencies: ts.notImplemented,\n            getCurrentDirectory: function () { return getProgram().getCurrentDirectory(); },\n            close: ts.noop,\n        };\n        function getProgram() {\n            return ts.Debug.checkDefined(state.program);\n        }\n    }\n    ts.createRedirectedBuilderProgram = createRedirectedBuilderProgram;\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    function createSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {\n        return ts.createBuilderProgram(ts.BuilderProgramKind.SemanticDiagnosticsBuilderProgram, ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences));\n    }\n    ts.createSemanticDiagnosticsBuilderProgram = createSemanticDiagnosticsBuilderProgram;\n    function createEmitAndSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {\n        return ts.createBuilderProgram(ts.BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram, ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences));\n    }\n    ts.createEmitAndSemanticDiagnosticsBuilderProgram = createEmitAndSemanticDiagnosticsBuilderProgram;\n    function createAbstractBuilder(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {\n        var _a = ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences), newProgram = _a.newProgram, newConfigFileParsingDiagnostics = _a.configFileParsingDiagnostics;\n        return ts.createRedirectedBuilderProgram({ program: newProgram, compilerOptions: newProgram.getCompilerOptions() }, newConfigFileParsingDiagnostics);\n    }\n    ts.createAbstractBuilder = createAbstractBuilder;\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    function removeIgnoredPath(path) {\n        // Consider whole staging folder as if node_modules changed.\n        if (ts.endsWith(path, \"/node_modules/.staging\")) {\n            return ts.removeSuffix(path, \"/.staging\");\n        }\n        return ts.some(ts.ignoredPaths, function (searchPath) { return ts.stringContains(path, searchPath); }) ?\n            undefined :\n            path;\n    }\n    ts.removeIgnoredPath = removeIgnoredPath;\n    /**\n     * Filter out paths like\n     * \"/\", \"/user\", \"/user/username\", \"/user/username/folderAtRoot\",\n     * \"c:/\", \"c:/users\", \"c:/users/username\", \"c:/users/username/folderAtRoot\", \"c:/folderAtRoot\"\n     * @param dirPath\n     */\n    function canWatchDirectory(dirPath) {\n        var rootLength = ts.getRootLength(dirPath);\n        if (dirPath.length === rootLength) {\n            // Ignore \"/\", \"c:/\"\n            return false;\n        }\n        var nextDirectorySeparator = dirPath.indexOf(ts.directorySeparator, rootLength);\n        if (nextDirectorySeparator === -1) {\n            // ignore \"/user\", \"c:/users\" or \"c:/folderAtRoot\"\n            return false;\n        }\n        var pathPartForUserCheck = dirPath.substring(rootLength, nextDirectorySeparator + 1);\n        var isNonDirectorySeparatorRoot = rootLength > 1 || dirPath.charCodeAt(0) !== 47 /* slash */;\n        if (isNonDirectorySeparatorRoot &&\n            dirPath.search(/[a-zA-Z]:/) !== 0 && // Non dos style paths\n            pathPartForUserCheck.search(/[a-zA-z]\\$\\//) === 0) { // Dos style nextPart\n            nextDirectorySeparator = dirPath.indexOf(ts.directorySeparator, nextDirectorySeparator + 1);\n            if (nextDirectorySeparator === -1) {\n                // ignore \"//vda1cs4850/c$/folderAtRoot\"\n                return false;\n            }\n            pathPartForUserCheck = dirPath.substring(rootLength + pathPartForUserCheck.length, nextDirectorySeparator + 1);\n        }\n        if (isNonDirectorySeparatorRoot &&\n            pathPartForUserCheck.search(/users\\//i) !== 0) {\n            // Paths like c:/folderAtRoot/subFolder are allowed\n            return true;\n        }\n        for (var searchIndex = nextDirectorySeparator + 1, searchLevels = 2; searchLevels > 0; searchLevels--) {\n            searchIndex = dirPath.indexOf(ts.directorySeparator, searchIndex) + 1;\n            if (searchIndex === 0) {\n                // Folder isnt at expected minimum levels\n                return false;\n            }\n        }\n        return true;\n    }\n    ts.canWatchDirectory = canWatchDirectory;\n    function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) {\n        var filesWithChangedSetOfUnresolvedImports;\n        var filesWithInvalidatedResolutions;\n        var filesWithInvalidatedNonRelativeUnresolvedImports;\n        var nonRelativeExternalModuleResolutions = ts.createMultiMap();\n        var resolutionsWithFailedLookups = [];\n        var resolvedFileToResolution = ts.createMultiMap();\n        var hasChangedAutomaticTypeDirectiveNames = false;\n        var failedLookupChecks = [];\n        var startsWithPathChecks = [];\n        var isInDirectoryChecks = [];\n        var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); // TODO: GH#18217\n        var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost();\n        // The resolvedModuleNames and resolvedTypeReferenceDirectives are the cache of resolutions per file.\n        // The key in the map is source file's path.\n        // The values are Map of resolutions with key being name lookedup.\n        var resolvedModuleNames = new ts.Map();\n        var perDirectoryResolvedModuleNames = ts.createCacheWithRedirects();\n        var nonRelativeModuleNameCache = ts.createCacheWithRedirects();\n        var moduleResolutionCache = ts.createModuleResolutionCacheWithMaps(perDirectoryResolvedModuleNames, nonRelativeModuleNameCache, getCurrentDirectory(), resolutionHost.getCanonicalFileName);\n        var resolvedTypeReferenceDirectives = new ts.Map();\n        var perDirectoryResolvedTypeReferenceDirectives = ts.createCacheWithRedirects();\n        /**\n         * These are the extensions that failed lookup files will have by default,\n         * any other extension of failed lookup will be store that path in custom failed lookup path\n         * This helps in not having to comb through all resolutions when files are added/removed\n         * Note that .d.ts file also has .d.ts extension hence will be part of default extensions\n         */\n        var failedLookupDefaultExtensions = [\".ts\" /* Ts */, \".tsx\" /* Tsx */, \".js\" /* Js */, \".jsx\" /* Jsx */, \".json\" /* Json */];\n        var customFailedLookupPaths = new ts.Map();\n        var directoryWatchesOfFailedLookups = new ts.Map();\n        var rootDir = rootDirForResolution && ts.removeTrailingDirectorySeparator(ts.getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory()));\n        var rootPath = (rootDir && resolutionHost.toPath(rootDir)); // TODO: GH#18217\n        var rootSplitLength = rootPath !== undefined ? rootPath.split(ts.directorySeparator).length : 0;\n        // TypeRoot watches for the types that get added as part of getAutomaticTypeDirectiveNames\n        var typeRootsWatches = new ts.Map();\n        return {\n            startRecordingFilesWithChangedResolutions: startRecordingFilesWithChangedResolutions,\n            finishRecordingFilesWithChangedResolutions: finishRecordingFilesWithChangedResolutions,\n            // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update\n            // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution)\n            startCachingPerDirectoryResolution: clearPerDirectoryResolutions,\n            finishCachingPerDirectoryResolution: finishCachingPerDirectoryResolution,\n            resolveModuleNames: resolveModuleNames,\n            getResolvedModuleWithFailedLookupLocationsFromCache: getResolvedModuleWithFailedLookupLocationsFromCache,\n            resolveTypeReferenceDirectives: resolveTypeReferenceDirectives,\n            removeResolutionsFromProjectReferenceRedirects: removeResolutionsFromProjectReferenceRedirects,\n            removeResolutionsOfFile: removeResolutionsOfFile,\n            hasChangedAutomaticTypeDirectiveNames: function () { return hasChangedAutomaticTypeDirectiveNames; },\n            invalidateResolutionOfFile: invalidateResolutionOfFile,\n            invalidateResolutionsOfFailedLookupLocations: invalidateResolutionsOfFailedLookupLocations,\n            setFilesWithInvalidatedNonRelativeUnresolvedImports: setFilesWithInvalidatedNonRelativeUnresolvedImports,\n            createHasInvalidatedResolution: createHasInvalidatedResolution,\n            isFileWithInvalidatedNonRelativeUnresolvedImports: isFileWithInvalidatedNonRelativeUnresolvedImports,\n            updateTypeRootsWatch: updateTypeRootsWatch,\n            closeTypeRootsWatch: closeTypeRootsWatch,\n            clear: clear\n        };\n        function getResolvedModule(resolution) {\n            return resolution.resolvedModule;\n        }\n        function getResolvedTypeReferenceDirective(resolution) {\n            return resolution.resolvedTypeReferenceDirective;\n        }\n        function isInDirectoryPath(dir, file) {\n            if (dir === undefined || file.length <= dir.length) {\n                return false;\n            }\n            return ts.startsWith(file, dir) && file[dir.length] === ts.directorySeparator;\n        }\n        function clear() {\n            ts.clearMap(directoryWatchesOfFailedLookups, ts.closeFileWatcherOf);\n            customFailedLookupPaths.clear();\n            nonRelativeExternalModuleResolutions.clear();\n            closeTypeRootsWatch();\n            resolvedModuleNames.clear();\n            resolvedTypeReferenceDirectives.clear();\n            resolvedFileToResolution.clear();\n            resolutionsWithFailedLookups.length = 0;\n            failedLookupChecks.length = 0;\n            startsWithPathChecks.length = 0;\n            isInDirectoryChecks.length = 0;\n            // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update\n            // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution)\n            clearPerDirectoryResolutions();\n            hasChangedAutomaticTypeDirectiveNames = false;\n        }\n        function startRecordingFilesWithChangedResolutions() {\n            filesWithChangedSetOfUnresolvedImports = [];\n        }\n        function finishRecordingFilesWithChangedResolutions() {\n            var collected = filesWithChangedSetOfUnresolvedImports;\n            filesWithChangedSetOfUnresolvedImports = undefined;\n            return collected;\n        }\n        function isFileWithInvalidatedNonRelativeUnresolvedImports(path) {\n            if (!filesWithInvalidatedNonRelativeUnresolvedImports) {\n                return false;\n            }\n            // Invalidated if file has unresolved imports\n            var value = filesWithInvalidatedNonRelativeUnresolvedImports.get(path);\n            return !!value && !!value.length;\n        }\n        function createHasInvalidatedResolution(forceAllFilesAsInvalidated) {\n            // Ensure pending resolutions are applied\n            invalidateResolutionsOfFailedLookupLocations();\n            if (forceAllFilesAsInvalidated) {\n                // Any file asked would have invalidated resolution\n                filesWithInvalidatedResolutions = undefined;\n                return ts.returnTrue;\n            }\n            var collected = filesWithInvalidatedResolutions;\n            filesWithInvalidatedResolutions = undefined;\n            return function (path) { return (!!collected && collected.has(path)) ||\n                isFileWithInvalidatedNonRelativeUnresolvedImports(path); };\n        }\n        function clearPerDirectoryResolutions() {\n            perDirectoryResolvedModuleNames.clear();\n            nonRelativeModuleNameCache.clear();\n            perDirectoryResolvedTypeReferenceDirectives.clear();\n            nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfNonRelativeModuleResolutions);\n            nonRelativeExternalModuleResolutions.clear();\n        }\n        function finishCachingPerDirectoryResolution() {\n            filesWithInvalidatedNonRelativeUnresolvedImports = undefined;\n            clearPerDirectoryResolutions();\n            directoryWatchesOfFailedLookups.forEach(function (watcher, path) {\n                if (watcher.refCount === 0) {\n                    directoryWatchesOfFailedLookups.delete(path);\n                    watcher.watcher.close();\n                }\n            });\n            hasChangedAutomaticTypeDirectiveNames = false;\n        }\n        function resolveModuleName(moduleName, containingFile, compilerOptions, host, redirectedReference) {\n            var _a;\n            var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference);\n            // return result immediately only if global cache support is not enabled or if it is .ts, .tsx or .d.ts\n            if (!resolutionHost.getGlobalCache) {\n                return primaryResult;\n            }\n            // otherwise try to load typings from @types\n            var globalCache = resolutionHost.getGlobalCache();\n            if (globalCache !== undefined && !ts.isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && ts.extensionIsTS(primaryResult.resolvedModule.extension))) {\n                // create different collection of failed lookup locations for second pass\n                // if it will fail and we've already found something during the first pass - we don't want to pollute its results\n                var _b = ts.loadModuleFromGlobalCache(ts.Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName), resolutionHost.projectName, compilerOptions, host, globalCache), resolvedModule = _b.resolvedModule, failedLookupLocations = _b.failedLookupLocations;\n                if (resolvedModule) {\n                    // Modify existing resolution so its saved in the directory cache as well\n                    primaryResult.resolvedModule = resolvedModule;\n                    (_a = primaryResult.failedLookupLocations).push.apply(_a, failedLookupLocations);\n                    return primaryResult;\n                }\n            }\n            // Default return the result from the first pass\n            return primaryResult;\n        }\n        function resolveNamesWithLocalCache(_a) {\n            var _b;\n            var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges;\n            var path = resolutionHost.toPath(containingFile);\n            var resolutionsInFile = cache.get(path) || cache.set(path, new ts.Map()).get(path);\n            var dirPath = ts.getDirectoryPath(path);\n            var perDirectoryCache = perDirectoryCacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference);\n            var perDirectoryResolution = perDirectoryCache.get(dirPath);\n            if (!perDirectoryResolution) {\n                perDirectoryResolution = new ts.Map();\n                perDirectoryCache.set(dirPath, perDirectoryResolution);\n            }\n            var resolvedModules = [];\n            var compilerOptions = resolutionHost.getCompilationSettings();\n            var hasInvalidatedNonRelativeUnresolvedImport = logChanges && isFileWithInvalidatedNonRelativeUnresolvedImports(path);\n            // All the resolutions in this file are invalidated if this file wasn't resolved using same redirect\n            var program = resolutionHost.getCurrentProgram();\n            var oldRedirect = program && program.getResolvedProjectReferenceToRedirect(containingFile);\n            var unmatchedRedirects = oldRedirect ?\n                !redirectedReference || redirectedReference.sourceFile.path !== oldRedirect.sourceFile.path :\n                !!redirectedReference;\n            var seenNamesInFile = new ts.Map();\n            for (var _i = 0, names_3 = names; _i < names_3.length; _i++) {\n                var name = names_3[_i];\n                var resolution = resolutionsInFile.get(name);\n                // Resolution is valid if it is present and not invalidated\n                if (!seenNamesInFile.has(name) &&\n                    unmatchedRedirects || !resolution || resolution.isInvalidated ||\n                    // If the name is unresolved import that was invalidated, recalculate\n                    (hasInvalidatedNonRelativeUnresolvedImport && !ts.isExternalModuleNameRelative(name) && shouldRetryResolution(resolution))) {\n                    var existingResolution = resolution;\n                    var resolutionInDirectory = perDirectoryResolution.get(name);\n                    if (resolutionInDirectory) {\n                        resolution = resolutionInDirectory;\n                    }\n                    else {\n                        resolution = loader(name, containingFile, compilerOptions, ((_b = resolutionHost.getCompilerHost) === null || _b === void 0 ? void 0 : _b.call(resolutionHost)) || resolutionHost, redirectedReference);\n                        perDirectoryResolution.set(name, resolution);\n                    }\n                    resolutionsInFile.set(name, resolution);\n                    watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName);\n                    if (existingResolution) {\n                        stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);\n                    }\n                    if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) {\n                        filesWithChangedSetOfUnresolvedImports.push(path);\n                        // reset log changes to avoid recording the same file multiple times\n                        logChanges = false;\n                    }\n                }\n                ts.Debug.assert(resolution !== undefined && !resolution.isInvalidated);\n                seenNamesInFile.set(name, true);\n                resolvedModules.push(getResolutionWithResolvedFileName(resolution));\n            }\n            // Stop watching and remove the unused name\n            resolutionsInFile.forEach(function (resolution, name) {\n                if (!seenNamesInFile.has(name) && !ts.contains(reusedNames, name)) {\n                    stopWatchFailedLookupLocationOfResolution(resolution, path, getResolutionWithResolvedFileName);\n                    resolutionsInFile.delete(name);\n                }\n            });\n            return resolvedModules;\n            function resolutionIsEqualTo(oldResolution, newResolution) {\n                if (oldResolution === newResolution) {\n                    return true;\n                }\n                if (!oldResolution || !newResolution) {\n                    return false;\n                }\n                var oldResult = getResolutionWithResolvedFileName(oldResolution);\n                var newResult = getResolutionWithResolvedFileName(newResolution);\n                if (oldResult === newResult) {\n                    return true;\n                }\n                if (!oldResult || !newResult) {\n                    return false;\n                }\n                return oldResult.resolvedFileName === newResult.resolvedFileName;\n            }\n        }\n        function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference) {\n            return resolveNamesWithLocalCache({\n                names: typeDirectiveNames,\n                containingFile: containingFile,\n                redirectedReference: redirectedReference,\n                cache: resolvedTypeReferenceDirectives,\n                perDirectoryCacheWithRedirects: perDirectoryResolvedTypeReferenceDirectives,\n                loader: ts.resolveTypeReferenceDirective,\n                getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective,\n                shouldRetryResolution: function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; },\n            });\n        }\n        function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference) {\n            return resolveNamesWithLocalCache({\n                names: moduleNames,\n                containingFile: containingFile,\n                redirectedReference: redirectedReference,\n                cache: resolvedModuleNames,\n                perDirectoryCacheWithRedirects: perDirectoryResolvedModuleNames,\n                loader: resolveModuleName,\n                getResolutionWithResolvedFileName: getResolvedModule,\n                shouldRetryResolution: function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); },\n                reusedNames: reusedNames,\n                logChanges: logChangesWhenResolvingModule,\n            });\n        }\n        function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile) {\n            var cache = resolvedModuleNames.get(resolutionHost.toPath(containingFile));\n            return cache && cache.get(moduleName);\n        }\n        function isNodeModulesAtTypesDirectory(dirPath) {\n            return ts.endsWith(dirPath, \"/node_modules/@types\");\n        }\n        function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath) {\n            if (isInDirectoryPath(rootPath, failedLookupLocationPath)) {\n                // Ensure failed look up is normalized path\n                failedLookupLocation = ts.isRootedDiskPath(failedLookupLocation) ? ts.normalizePath(failedLookupLocation) : ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());\n                var failedLookupPathSplit = failedLookupLocationPath.split(ts.directorySeparator);\n                var failedLookupSplit = failedLookupLocation.split(ts.directorySeparator);\n                ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, \"FailedLookup: \" + failedLookupLocation + \" failedLookupLocationPath: \" + failedLookupLocationPath);\n                if (failedLookupPathSplit.length > rootSplitLength + 1) {\n                    // Instead of watching root, watch directory in root to avoid watching excluded directories not needed for module resolution\n                    return {\n                        dir: failedLookupSplit.slice(0, rootSplitLength + 1).join(ts.directorySeparator),\n                        dirPath: failedLookupPathSplit.slice(0, rootSplitLength + 1).join(ts.directorySeparator)\n                    };\n                }\n                else {\n                    // Always watch root directory non recursively\n                    return {\n                        dir: rootDir,\n                        dirPath: rootPath,\n                        nonRecursive: false\n                    };\n                }\n            }\n            return getDirectoryToWatchFromFailedLookupLocationDirectory(ts.getDirectoryPath(ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory())), ts.getDirectoryPath(failedLookupLocationPath));\n        }\n        function getDirectoryToWatchFromFailedLookupLocationDirectory(dir, dirPath) {\n            // If directory path contains node module, get the most parent node_modules directory for watching\n            while (ts.pathContainsNodeModules(dirPath)) {\n                dir = ts.getDirectoryPath(dir);\n                dirPath = ts.getDirectoryPath(dirPath);\n            }\n            // If the directory is node_modules use it to watch, always watch it recursively\n            if (ts.isNodeModulesDirectory(dirPath)) {\n                return canWatchDirectory(ts.getDirectoryPath(dirPath)) ? { dir: dir, dirPath: dirPath } : undefined;\n            }\n            var nonRecursive = true;\n            // Use some ancestor of the root directory\n            var subDirectoryPath, subDirectory;\n            if (rootPath !== undefined) {\n                while (!isInDirectoryPath(dirPath, rootPath)) {\n                    var parentPath = ts.getDirectoryPath(dirPath);\n                    if (parentPath === dirPath) {\n                        break;\n                    }\n                    nonRecursive = false;\n                    subDirectoryPath = dirPath;\n                    subDirectory = dir;\n                    dirPath = parentPath;\n                    dir = ts.getDirectoryPath(dir);\n                }\n            }\n            return canWatchDirectory(dirPath) ? { dir: subDirectory || dir, dirPath: subDirectoryPath || dirPath, nonRecursive: nonRecursive } : undefined;\n        }\n        function isPathWithDefaultFailedLookupExtension(path) {\n            return ts.fileExtensionIsOneOf(path, failedLookupDefaultExtensions);\n        }\n        function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) {\n            if (resolution.refCount) {\n                resolution.refCount++;\n                ts.Debug.assertDefined(resolution.files);\n            }\n            else {\n                resolution.refCount = 1;\n                ts.Debug.assert(ts.length(resolution.files) === 0); // This resolution shouldnt be referenced by any file yet\n                if (ts.isExternalModuleNameRelative(name)) {\n                    watchFailedLookupLocationOfResolution(resolution);\n                }\n                else {\n                    nonRelativeExternalModuleResolutions.add(name, resolution);\n                }\n                var resolved = getResolutionWithResolvedFileName(resolution);\n                if (resolved && resolved.resolvedFileName) {\n                    resolvedFileToResolution.add(resolutionHost.toPath(resolved.resolvedFileName), resolution);\n                }\n            }\n            (resolution.files || (resolution.files = [])).push(filePath);\n        }\n        function watchFailedLookupLocationOfResolution(resolution) {\n            ts.Debug.assert(!!resolution.refCount);\n            var failedLookupLocations = resolution.failedLookupLocations;\n            if (!failedLookupLocations.length)\n                return;\n            resolutionsWithFailedLookups.push(resolution);\n            var setAtRoot = false;\n            for (var _i = 0, failedLookupLocations_1 = failedLookupLocations; _i < failedLookupLocations_1.length; _i++) {\n                var failedLookupLocation = failedLookupLocations_1[_i];\n                var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);\n                var toWatch = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath);\n                if (toWatch) {\n                    var dir = toWatch.dir, dirPath = toWatch.dirPath, nonRecursive = toWatch.nonRecursive;\n                    // If the failed lookup location path is not one of the supported extensions,\n                    // store it in the custom path\n                    if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) {\n                        var refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0;\n                        customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1);\n                    }\n                    if (dirPath === rootPath) {\n                        ts.Debug.assert(!nonRecursive);\n                        setAtRoot = true;\n                    }\n                    else {\n                        setDirectoryWatcher(dir, dirPath, nonRecursive);\n                    }\n                }\n            }\n            if (setAtRoot) {\n                // This is always non recursive\n                setDirectoryWatcher(rootDir, rootPath, /*nonRecursive*/ true); // TODO: GH#18217\n            }\n        }\n        function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) {\n            var program = resolutionHost.getCurrentProgram();\n            if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) {\n                resolutions.forEach(watchFailedLookupLocationOfResolution);\n            }\n        }\n        function setDirectoryWatcher(dir, dirPath, nonRecursive) {\n            var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);\n            if (dirWatcher) {\n                ts.Debug.assert(!!nonRecursive === !!dirWatcher.nonRecursive);\n                dirWatcher.refCount++;\n            }\n            else {\n                directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive: nonRecursive });\n            }\n        }\n        function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) {\n            ts.unorderedRemoveItem(ts.Debug.assertDefined(resolution.files), filePath);\n            resolution.refCount--;\n            if (resolution.refCount) {\n                return;\n            }\n            var resolved = getResolutionWithResolvedFileName(resolution);\n            if (resolved && resolved.resolvedFileName) {\n                resolvedFileToResolution.remove(resolutionHost.toPath(resolved.resolvedFileName), resolution);\n            }\n            if (!ts.unorderedRemoveItem(resolutionsWithFailedLookups, resolution)) {\n                // If not watching failed lookups, it wont be there in resolutionsWithFailedLookups\n                return;\n            }\n            var failedLookupLocations = resolution.failedLookupLocations;\n            var removeAtRoot = false;\n            for (var _i = 0, failedLookupLocations_2 = failedLookupLocations; _i < failedLookupLocations_2.length; _i++) {\n                var failedLookupLocation = failedLookupLocations_2[_i];\n                var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);\n                var toWatch = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath);\n                if (toWatch) {\n                    var dirPath = toWatch.dirPath;\n                    var refCount = customFailedLookupPaths.get(failedLookupLocationPath);\n                    if (refCount) {\n                        if (refCount === 1) {\n                            customFailedLookupPaths.delete(failedLookupLocationPath);\n                        }\n                        else {\n                            ts.Debug.assert(refCount > 1);\n                            customFailedLookupPaths.set(failedLookupLocationPath, refCount - 1);\n                        }\n                    }\n                    if (dirPath === rootPath) {\n                        removeAtRoot = true;\n                    }\n                    else {\n                        removeDirectoryWatcher(dirPath);\n                    }\n                }\n            }\n            if (removeAtRoot) {\n                removeDirectoryWatcher(rootPath);\n            }\n        }\n        function removeDirectoryWatcher(dirPath) {\n            var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);\n            // Do not close the watcher yet since it might be needed by other failed lookup locations.\n            dirWatcher.refCount--;\n        }\n        function createDirectoryWatcher(directory, dirPath, nonRecursive) {\n            return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, function (fileOrDirectory) {\n                var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory);\n                if (cachedDirectoryStructureHost) {\n                    // Since the file existence changed, update the sourceFiles cache\n                    cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);\n                }\n                scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath);\n            }, nonRecursive ? 0 /* None */ : 1 /* Recursive */);\n        }\n        function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) {\n            // Deleted file, stop watching failed lookups for all the resolutions in the file\n            var resolutions = cache.get(filePath);\n            if (resolutions) {\n                resolutions.forEach(function (resolution) { return stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName); });\n                cache.delete(filePath);\n            }\n        }\n        function removeResolutionsFromProjectReferenceRedirects(filePath) {\n            if (!ts.fileExtensionIs(filePath, \".json\" /* Json */)) {\n                return;\n            }\n            var program = resolutionHost.getCurrentProgram();\n            if (!program) {\n                return;\n            }\n            // If this file is input file for the referenced project, get it\n            var resolvedProjectReference = program.getResolvedProjectReferenceByPath(filePath);\n            if (!resolvedProjectReference) {\n                return;\n            }\n            // filePath is for the projectReference and the containing file is from this project reference, invalidate the resolution\n            resolvedProjectReference.commandLine.fileNames.forEach(function (f) { return removeResolutionsOfFile(resolutionHost.toPath(f)); });\n        }\n        function removeResolutionsOfFile(filePath) {\n            removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule);\n            removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective);\n        }\n        function invalidateResolutions(resolutions, canInvalidate) {\n            if (!resolutions)\n                return false;\n            var invalidated = false;\n            for (var _i = 0, resolutions_1 = resolutions; _i < resolutions_1.length; _i++) {\n                var resolution = resolutions_1[_i];\n                if (resolution.isInvalidated || !canInvalidate(resolution))\n                    continue;\n                resolution.isInvalidated = invalidated = true;\n                for (var _a = 0, _b = ts.Debug.assertDefined(resolution.files); _a < _b.length; _a++) {\n                    var containingFilePath = _b[_a];\n                    (filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = new ts.Set())).add(containingFilePath);\n                    // When its a file with inferred types resolution, invalidate type reference directive resolution\n                    hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames || ts.endsWith(containingFilePath, ts.inferredTypesContainingFile);\n                }\n            }\n            return invalidated;\n        }\n        function invalidateResolutionOfFile(filePath) {\n            removeResolutionsOfFile(filePath);\n            // Resolution is invalidated if the resulting file name is same as the deleted file path\n            var prevHasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames;\n            if (invalidateResolutions(resolvedFileToResolution.get(filePath), ts.returnTrue) &&\n                hasChangedAutomaticTypeDirectiveNames &&\n                !prevHasChangedAutomaticTypeDirectiveNames) {\n                resolutionHost.onChangedAutomaticTypeDirectiveNames();\n            }\n        }\n        function setFilesWithInvalidatedNonRelativeUnresolvedImports(filesMap) {\n            ts.Debug.assert(filesWithInvalidatedNonRelativeUnresolvedImports === filesMap || filesWithInvalidatedNonRelativeUnresolvedImports === undefined);\n            filesWithInvalidatedNonRelativeUnresolvedImports = filesMap;\n        }\n        function scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, isCreatingWatchedDirectory) {\n            if (isCreatingWatchedDirectory) {\n                // Watching directory is created\n                // Invalidate any resolution has failed lookup in this directory\n                isInDirectoryChecks.push(fileOrDirectoryPath);\n            }\n            else {\n                // If something to do with folder/file starting with \".\" in node_modules folder, skip it\n                var updatedPath = removeIgnoredPath(fileOrDirectoryPath);\n                if (!updatedPath)\n                    return false;\n                fileOrDirectoryPath = updatedPath;\n                // prevent saving an open file from over-eagerly triggering invalidation\n                if (resolutionHost.fileIsOpen(fileOrDirectoryPath)) {\n                    return false;\n                }\n                // Some file or directory in the watching directory is created\n                // Return early if it does not have any of the watching extension or not the custom failed lookup path\n                var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath);\n                if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || ts.isNodeModulesDirectory(fileOrDirectoryPath) ||\n                    isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || ts.isNodeModulesDirectory(dirOfFileOrDirectory)) {\n                    // Invalidate any resolution from this directory\n                    failedLookupChecks.push(fileOrDirectoryPath);\n                    startsWithPathChecks.push(fileOrDirectoryPath);\n                }\n                else {\n                    if (!isPathWithDefaultFailedLookupExtension(fileOrDirectoryPath) && !customFailedLookupPaths.has(fileOrDirectoryPath)) {\n                        return false;\n                    }\n                    // Ignore emits from the program\n                    if (ts.isEmittedFileOfProgram(resolutionHost.getCurrentProgram(), fileOrDirectoryPath)) {\n                        return false;\n                    }\n                    // Resolution need to be invalidated if failed lookup location is same as the file or directory getting created\n                    failedLookupChecks.push(fileOrDirectoryPath);\n                }\n            }\n            resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();\n        }\n        function invalidateResolutionsOfFailedLookupLocations() {\n            if (!failedLookupChecks.length && !startsWithPathChecks.length && !isInDirectoryChecks.length) {\n                return false;\n            }\n            var invalidated = invalidateResolutions(resolutionsWithFailedLookups, canInvalidateFailedLookupResolution);\n            failedLookupChecks.length = 0;\n            startsWithPathChecks.length = 0;\n            isInDirectoryChecks.length = 0;\n            return invalidated;\n        }\n        function canInvalidateFailedLookupResolution(resolution) {\n            return resolution.failedLookupLocations.some(function (location) {\n                var locationPath = resolutionHost.toPath(location);\n                return ts.contains(failedLookupChecks, locationPath) ||\n                    startsWithPathChecks.some(function (fileOrDirectoryPath) { return ts.startsWith(locationPath, fileOrDirectoryPath); }) ||\n                    isInDirectoryChecks.some(function (fileOrDirectoryPath) { return isInDirectoryPath(fileOrDirectoryPath, locationPath); });\n            });\n        }\n        function closeTypeRootsWatch() {\n            ts.clearMap(typeRootsWatches, ts.closeFileWatcher);\n        }\n        function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath) {\n            if (isInDirectoryPath(rootPath, typeRootPath)) {\n                return rootPath;\n            }\n            var toWatch = getDirectoryToWatchFromFailedLookupLocationDirectory(typeRoot, typeRootPath);\n            return toWatch && directoryWatchesOfFailedLookups.has(toWatch.dirPath) ? toWatch.dirPath : undefined;\n        }\n        function createTypeRootsWatch(typeRootPath, typeRoot) {\n            // Create new watch and recursive info\n            return resolutionHost.watchTypeRootsDirectory(typeRoot, function (fileOrDirectory) {\n                var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory);\n                if (cachedDirectoryStructureHost) {\n                    // Since the file existence changed, update the sourceFiles cache\n                    cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);\n                }\n                // For now just recompile\n                // We could potentially store more data here about whether it was/would be really be used or not\n                // and with that determine to trigger compilation but for now this is enough\n                hasChangedAutomaticTypeDirectiveNames = true;\n                resolutionHost.onChangedAutomaticTypeDirectiveNames();\n                // Since directory watchers invoked are flaky, the failed lookup location events might not be triggered\n                // So handle to failed lookup locations here as well to ensure we are invalidating resolutions\n                var dirPath = getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath);\n                if (dirPath) {\n                    scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath);\n                }\n            }, 1 /* Recursive */);\n        }\n        /**\n         * Watches the types that would get added as part of getAutomaticTypeDirectiveNames\n         * To be called when compiler options change\n         */\n        function updateTypeRootsWatch() {\n            var options = resolutionHost.getCompilationSettings();\n            if (options.types) {\n                // No need to do any watch since resolution cache is going to handle the failed lookups\n                // for the types added by this\n                closeTypeRootsWatch();\n                return;\n            }\n            // we need to assume the directories exist to ensure that we can get all the type root directories that get included\n            // But filter directories that are at root level to say directory doesnt exist, so that we arent watching them\n            var typeRoots = ts.getEffectiveTypeRoots(options, { directoryExists: directoryExistsForTypeRootWatch, getCurrentDirectory: getCurrentDirectory });\n            if (typeRoots) {\n                ts.mutateMap(typeRootsWatches, ts.arrayToMap(typeRoots, function (tr) { return resolutionHost.toPath(tr); }), {\n                    createNewValue: createTypeRootsWatch,\n                    onDeleteValue: ts.closeFileWatcher\n                });\n            }\n            else {\n                closeTypeRootsWatch();\n            }\n        }\n        /**\n         * Use this function to return if directory exists to get type roots to watch\n         * If we return directory exists then only the paths will be added to type roots\n         * Hence return true for all directories except root directories which are filtered from watching\n         */\n        function directoryExistsForTypeRootWatch(nodeTypesDirectory) {\n            var dir = ts.getDirectoryPath(ts.getDirectoryPath(nodeTypesDirectory));\n            var dirPath = resolutionHost.toPath(dir);\n            return dirPath === rootPath || canWatchDirectory(dirPath);\n        }\n    }\n    ts.createResolutionCache = createResolutionCache;\n})(ts || (ts = {}));\n// Used by importFixes, getEditsForFileRename, and declaration emit to synthesize import module specifiers.\n/* @internal */\nvar ts;\n(function (ts) {\n    var moduleSpecifiers;\n    (function (moduleSpecifiers) {\n        var RelativePreference;\n        (function (RelativePreference) {\n            RelativePreference[RelativePreference[\"Relative\"] = 0] = \"Relative\";\n            RelativePreference[RelativePreference[\"NonRelative\"] = 1] = \"NonRelative\";\n            RelativePreference[RelativePreference[\"Shortest\"] = 2] = \"Shortest\";\n            RelativePreference[RelativePreference[\"ExternalNonRelative\"] = 3] = \"ExternalNonRelative\";\n        })(RelativePreference || (RelativePreference = {}));\n        // See UserPreferences#importPathEnding\n        var Ending;\n        (function (Ending) {\n            Ending[Ending[\"Minimal\"] = 0] = \"Minimal\";\n            Ending[Ending[\"Index\"] = 1] = \"Index\";\n            Ending[Ending[\"JsExtension\"] = 2] = \"JsExtension\";\n        })(Ending || (Ending = {}));\n        function getPreferences(_a, compilerOptions, importingSourceFile) {\n            var importModuleSpecifierPreference = _a.importModuleSpecifierPreference, importModuleSpecifierEnding = _a.importModuleSpecifierEnding;\n            return {\n                relativePreference: importModuleSpecifierPreference === \"relative\" ? 0 /* Relative */ :\n                    importModuleSpecifierPreference === \"non-relative\" ? 1 /* NonRelative */ :\n                        importModuleSpecifierPreference === \"project-relative\" ? 3 /* ExternalNonRelative */ :\n                            2 /* Shortest */,\n                ending: getEnding(),\n            };\n            function getEnding() {\n                switch (importModuleSpecifierEnding) {\n                    case \"minimal\": return 0 /* Minimal */;\n                    case \"index\": return 1 /* Index */;\n                    case \"js\": return 2 /* JsExtension */;\n                    default: return usesJsExtensionOnImports(importingSourceFile) ? 2 /* JsExtension */\n                        : ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeJs ? 1 /* Index */ : 0 /* Minimal */;\n                }\n            }\n        }\n        function getPreferencesForUpdate(compilerOptions, oldImportSpecifier) {\n            return {\n                relativePreference: ts.isExternalModuleNameRelative(oldImportSpecifier) ? 0 /* Relative */ : 1 /* NonRelative */,\n                ending: ts.hasJSFileExtension(oldImportSpecifier) ?\n                    2 /* JsExtension */ :\n                    ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeJs || ts.endsWith(oldImportSpecifier, \"index\") ? 1 /* Index */ : 0 /* Minimal */,\n            };\n        }\n        function updateModuleSpecifier(compilerOptions, importingSourceFileName, toFileName, host, oldImportSpecifier) {\n            var res = getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, getPreferencesForUpdate(compilerOptions, oldImportSpecifier));\n            if (res === oldImportSpecifier)\n                return undefined;\n            return res;\n        }\n        moduleSpecifiers.updateModuleSpecifier = updateModuleSpecifier;\n        // Note: importingSourceFile is just for usesJsExtensionOnImports\n        function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, preferences) {\n            if (preferences === void 0) { preferences = {}; }\n            return getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, getPreferences(preferences, compilerOptions, importingSourceFile));\n        }\n        moduleSpecifiers.getModuleSpecifier = getModuleSpecifier;\n        function getNodeModulesPackageName(compilerOptions, importingSourceFileName, nodeModulesFileName, host) {\n            var info = getInfo(importingSourceFileName, host);\n            var modulePaths = getAllModulePaths(importingSourceFileName, nodeModulesFileName, host);\n            return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions, /*packageNameOnly*/ true); });\n        }\n        moduleSpecifiers.getNodeModulesPackageName = getNodeModulesPackageName;\n        function getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, preferences) {\n            var info = getInfo(importingSourceFileName, host);\n            var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host);\n            return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions); }) ||\n                getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences);\n        }\n        /** Returns an import for each symlink and for the realpath. */\n        function getModuleSpecifiers(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences) {\n            var ambient = tryGetModuleNameFromAmbientModule(moduleSymbol, checker);\n            if (ambient)\n                return [ambient];\n            var info = getInfo(importingSourceFile.path, host);\n            var moduleSourceFile = ts.getSourceFileOfNode(moduleSymbol.valueDeclaration || ts.getNonAugmentationDeclaration(moduleSymbol));\n            var modulePaths = getAllModulePaths(importingSourceFile.path, moduleSourceFile.originalFileName, host);\n            var preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile);\n            var existingSpecifier = ts.forEach(modulePaths, function (modulePath) { return ts.forEach(host.getFileIncludeReasons().get(ts.toPath(modulePath.path, host.getCurrentDirectory(), info.getCanonicalFileName)), function (reason) {\n                if (reason.kind !== ts.FileIncludeKind.Import || reason.file !== importingSourceFile.path)\n                    return undefined;\n                var specifier = ts.getModuleNameStringLiteralAt(importingSourceFile, reason.index).text;\n                // If the preference is for non relative and the module specifier is relative, ignore it\n                return preferences.relativePreference !== 1 /* NonRelative */ || !ts.pathIsRelative(specifier) ?\n                    specifier :\n                    undefined;\n            }); });\n            if (existingSpecifier)\n                return [existingSpecifier];\n            var importedFileIsInNodeModules = ts.some(modulePaths, function (p) { return p.isInNodeModules; });\n            // Module specifier priority:\n            //   1. \"Bare package specifiers\" (e.g. \"@foo/bar\") resulting from a path through node_modules to a package.json's \"types\" entry\n            //   2. Specifiers generated using \"paths\" from tsconfig\n            //   3. Non-relative specfiers resulting from a path through node_modules (e.g. \"@foo/bar/path/to/file\")\n            //   4. Relative paths\n            var nodeModulesSpecifiers;\n            var pathsSpecifiers;\n            var relativeSpecifiers;\n            for (var _i = 0, modulePaths_1 = modulePaths; _i < modulePaths_1.length; _i++) {\n                var modulePath = modulePaths_1[_i];\n                var specifier = tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions);\n                nodeModulesSpecifiers = ts.append(nodeModulesSpecifiers, specifier);\n                if (specifier && modulePath.isRedirect) {\n                    // If we got a specifier for a redirect, it was a bare package specifier (e.g. \"@foo/bar\",\n                    // not \"@foo/bar/path/to/file\"). No other specifier will be this good, so stop looking.\n                    return nodeModulesSpecifiers;\n                }\n                if (!specifier && !modulePath.isRedirect) {\n                    var local = getLocalModuleSpecifier(modulePath.path, info, compilerOptions, host, preferences);\n                    if (ts.pathIsBareSpecifier(local)) {\n                        pathsSpecifiers = ts.append(pathsSpecifiers, local);\n                    }\n                    else if (!importedFileIsInNodeModules || modulePath.isInNodeModules) {\n                        // Why this extra conditional, not just an `else`? If some path to the file contained\n                        // 'node_modules', but we can't create a non-relative specifier (e.g. \"@foo/bar/path/to/file\"),\n                        // that means we had to go through a *sibling's* node_modules, not one we can access directly.\n                        // If some path to the file was in node_modules but another was not, this likely indicates that\n                        // we have a monorepo structure with symlinks. In this case, the non-node_modules path is\n                        // probably the realpath, e.g. \"../bar/path/to/file\", but a relative path to another package\n                        // in a monorepo is probably not portable. So, the module specifier we actually go with will be\n                        // the relative path through node_modules, so that the declaration emitter can produce a\n                        // portability error. (See declarationEmitReexportedSymlinkReference3)\n                        relativeSpecifiers = ts.append(relativeSpecifiers, local);\n                    }\n                }\n            }\n            return (pathsSpecifiers === null || pathsSpecifiers === void 0 ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers :\n                (nodeModulesSpecifiers === null || nodeModulesSpecifiers === void 0 ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers :\n                    ts.Debug.checkDefined(relativeSpecifiers);\n        }\n        moduleSpecifiers.getModuleSpecifiers = getModuleSpecifiers;\n        // importingSourceFileName is separate because getEditsForFileRename may need to specify an updated path\n        function getInfo(importingSourceFileName, host) {\n            var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : true);\n            var sourceDirectory = ts.getDirectoryPath(importingSourceFileName);\n            return { getCanonicalFileName: getCanonicalFileName, importingSourceFileName: importingSourceFileName, sourceDirectory: sourceDirectory };\n        }\n        function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, _a) {\n            var ending = _a.ending, relativePreference = _a.relativePreference;\n            var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths, rootDirs = compilerOptions.rootDirs;\n            var sourceDirectory = info.sourceDirectory, getCanonicalFileName = info.getCanonicalFileName;\n            var relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) ||\n                removeExtensionAndIndexPostFix(ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), ending, compilerOptions);\n            if (!baseUrl && !paths || relativePreference === 0 /* Relative */) {\n                return relativePath;\n            }\n            var baseDirectory = ts.getPathsBasePath(compilerOptions, host) || baseUrl;\n            var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseDirectory, getCanonicalFileName);\n            if (!relativeToBaseUrl) {\n                return relativePath;\n            }\n            var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions);\n            var fromPaths = paths && tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths);\n            var nonRelative = fromPaths === undefined && baseUrl !== undefined ? importRelativeToBaseUrl : fromPaths;\n            if (!nonRelative) {\n                return relativePath;\n            }\n            if (relativePreference === 1 /* NonRelative */) {\n                return nonRelative;\n            }\n            if (relativePreference === 3 /* ExternalNonRelative */) {\n                var projectDirectory = host.getCurrentDirectory();\n                var modulePath = ts.toPath(moduleFileName, projectDirectory, getCanonicalFileName);\n                var sourceIsInternal = ts.startsWith(sourceDirectory, projectDirectory);\n                var targetIsInternal = ts.startsWith(modulePath, projectDirectory);\n                if (sourceIsInternal && !targetIsInternal || !sourceIsInternal && targetIsInternal) {\n                    // 1. The import path crosses the boundary of the tsconfig.json-containing directory.\n                    //\n                    //      src/\n                    //        tsconfig.json\n                    //        index.ts -------\n                    //      lib/              | (path crosses tsconfig.json)\n                    //        imported.ts <---\n                    //\n                    return nonRelative;\n                }\n                var nearestTargetPackageJson = getNearestAncestorDirectoryWithPackageJson(host, ts.getDirectoryPath(modulePath));\n                var nearestSourcePackageJson = getNearestAncestorDirectoryWithPackageJson(host, sourceDirectory);\n                if (nearestSourcePackageJson !== nearestTargetPackageJson) {\n                    // 2. The importing and imported files are part of different packages.\n                    //\n                    //      packages/a/\n                    //        package.json\n                    //        index.ts --------\n                    //      packages/b/        | (path crosses package.json)\n                    //        package.json     |\n                    //        component.ts <---\n                    //\n                    return nonRelative;\n                }\n                return relativePath;\n            }\n            if (relativePreference !== 2 /* Shortest */)\n                ts.Debug.assertNever(relativePreference);\n            // Prefer a relative import over a baseUrl import if it has fewer components.\n            return isPathRelativeToParent(nonRelative) || countPathComponents(relativePath) < countPathComponents(nonRelative) ? relativePath : nonRelative;\n        }\n        function countPathComponents(path) {\n            var count = 0;\n            for (var i = ts.startsWith(path, \"./\") ? 2 : 0; i < path.length; i++) {\n                if (path.charCodeAt(i) === 47 /* slash */)\n                    count++;\n            }\n            return count;\n        }\n        moduleSpecifiers.countPathComponents = countPathComponents;\n        function usesJsExtensionOnImports(_a) {\n            var imports = _a.imports;\n            return ts.firstDefined(imports, function (_a) {\n                var text = _a.text;\n                return ts.pathIsRelative(text) ? ts.hasJSFileExtension(text) : undefined;\n            }) || false;\n        }\n        function comparePathsByRedirectAndNumberOfDirectorySeparators(a, b) {\n            return ts.compareBooleans(b.isRedirect, a.isRedirect) || ts.compareNumberOfDirectorySeparators(a.path, b.path);\n        }\n        function getNearestAncestorDirectoryWithPackageJson(host, fileName) {\n            if (host.getNearestAncestorDirectoryWithPackageJson) {\n                return host.getNearestAncestorDirectoryWithPackageJson(fileName);\n            }\n            return !!ts.forEachAncestorDirectory(fileName, function (directory) {\n                return host.fileExists(ts.combinePaths(directory, \"package.json\")) ? true : undefined;\n            });\n        }\n        function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) {\n            var getCanonicalFileName = ts.hostGetCanonicalFileName(host);\n            var cwd = host.getCurrentDirectory();\n            var referenceRedirect = host.isSourceOfProjectReferenceRedirect(importedFileName) ? host.getProjectReferenceRedirect(importedFileName) : undefined;\n            var importedPath = ts.toPath(importedFileName, cwd, getCanonicalFileName);\n            var redirects = host.redirectTargetsMap.get(importedPath) || ts.emptyArray;\n            var importedFileNames = __spreadArray(__spreadArray(__spreadArray([], (referenceRedirect ? [referenceRedirect] : ts.emptyArray)), [importedFileName]), redirects);\n            var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });\n            var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);\n            if (!preferSymlinks) {\n                // Symlinks inside ignored paths are already filtered out of the symlink cache,\n                // so we only need to remove them from the realpath filenames.\n                var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });\n                if (result_15)\n                    return result_15;\n            }\n            var links = host.getSymlinkCache\n                ? host.getSymlinkCache()\n                : ts.discoverProbableSymlinks(host.getSourceFiles(), getCanonicalFileName, cwd);\n            var symlinkedDirectories = links.getSymlinkedDirectoriesByRealpath();\n            var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);\n            var result = symlinkedDirectories && ts.forEachAncestorDirectory(ts.getDirectoryPath(fullImportedFileName), function (realPathDirectory) {\n                var symlinkDirectories = symlinkedDirectories.get(ts.ensureTrailingDirectorySeparator(ts.toPath(realPathDirectory, cwd, getCanonicalFileName)));\n                if (!symlinkDirectories)\n                    return undefined; // Continue to ancestor directory\n                // Don't want to a package to globally import from itself (importNameCodeFix_symlink_own_package.ts)\n                if (ts.startsWithDirectory(importingFileName, realPathDirectory, getCanonicalFileName)) {\n                    return false; // Stop search, each ancestor directory will also hit this condition\n                }\n                return ts.forEach(targets, function (target) {\n                    if (!ts.startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) {\n                        return;\n                    }\n                    var relative = ts.getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName);\n                    for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {\n                        var symlinkDirectory = symlinkDirectories_1[_i];\n                        var option = ts.resolvePath(symlinkDirectory, relative);\n                        var result_16 = cb(option, target === referenceRedirect);\n                        shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths\n                        if (result_16)\n                            return result_16;\n                    }\n                });\n            });\n            return result || (preferSymlinks\n                ? ts.forEach(targets, function (p) { return shouldFilterIgnoredPaths && ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })\n                : undefined);\n        }\n        moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule;\n        /**\n         * Looks for existing imports that use symlinks to this module.\n         * Symlinks will be returned first so they are preferred over the real path.\n         */\n        function getAllModulePaths(importingFileName, importedFileName, host) {\n            var cwd = host.getCurrentDirectory();\n            var getCanonicalFileName = ts.hostGetCanonicalFileName(host);\n            var allFileNames = new ts.Map();\n            var importedFileFromNodeModules = false;\n            forEachFileNameOfModule(importingFileName, importedFileName, host, \n            /*preferSymlinks*/ true, function (path, isRedirect) {\n                var isInNodeModules = ts.pathContainsNodeModules(path);\n                allFileNames.set(path, { path: getCanonicalFileName(path), isRedirect: isRedirect, isInNodeModules: isInNodeModules });\n                importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;\n                // don't return value, so we collect everything\n            });\n            // Sort by paths closest to importing file Name directory\n            var sortedPaths = [];\n            var _loop_24 = function (directory) {\n                var directoryStart = ts.ensureTrailingDirectorySeparator(directory);\n                var pathsInDirectory;\n                allFileNames.forEach(function (_a, fileName) {\n                    var path = _a.path, isRedirect = _a.isRedirect, isInNodeModules = _a.isInNodeModules;\n                    if (ts.startsWith(path, directoryStart)) {\n                        (pathsInDirectory || (pathsInDirectory = [])).push({ path: fileName, isRedirect: isRedirect, isInNodeModules: isInNodeModules });\n                        allFileNames.delete(fileName);\n                    }\n                });\n                if (pathsInDirectory) {\n                    if (pathsInDirectory.length > 1) {\n                        pathsInDirectory.sort(comparePathsByRedirectAndNumberOfDirectorySeparators);\n                    }\n                    sortedPaths.push.apply(sortedPaths, pathsInDirectory);\n                }\n                var newDirectory = ts.getDirectoryPath(directory);\n                if (newDirectory === directory)\n                    return out_directory_1 = directory, \"break\";\n                directory = newDirectory;\n                out_directory_1 = directory;\n            };\n            var out_directory_1;\n            for (var directory = ts.getDirectoryPath(ts.toPath(importingFileName, cwd, getCanonicalFileName)); allFileNames.size !== 0;) {\n                var state_8 = _loop_24(directory);\n                directory = out_directory_1;\n                if (state_8 === \"break\")\n                    break;\n            }\n            if (allFileNames.size) {\n                var remainingPaths = ts.arrayFrom(allFileNames.values());\n                if (remainingPaths.length > 1)\n                    remainingPaths.sort(comparePathsByRedirectAndNumberOfDirectorySeparators);\n                sortedPaths.push.apply(sortedPaths, remainingPaths);\n            }\n            return sortedPaths;\n        }\n        function tryGetModuleNameFromAmbientModule(moduleSymbol, checker) {\n            var decl = ts.find(moduleSymbol.declarations, function (d) { return ts.isNonGlobalAmbientModule(d) && (!ts.isExternalModuleAugmentation(d) || !ts.isExternalModuleNameRelative(ts.getTextOfIdentifierOrLiteral(d.name))); });\n            if (decl) {\n                return decl.name.text;\n            }\n            // the module could be a namespace, which is export through \"export=\" from an ambient module.\n            /**\n             * declare module \"m\" {\n             *     namespace ns {\n             *         class c {}\n             *     }\n             *     export = ns;\n             * }\n             */\n            // `import {c} from \"m\";` is valid, in which case, `moduleSymbol` is \"ns\", but the module name should be \"m\"\n            var ambientModuleDeclareCandidates = ts.mapDefined(moduleSymbol.declarations, function (d) {\n                var _a, _b, _c, _d;\n                if (!ts.isModuleDeclaration(d))\n                    return;\n                var topNamespace = getTopNamespace(d);\n                if (!(((_a = topNamespace === null || topNamespace === void 0 ? void 0 : topNamespace.parent) === null || _a === void 0 ? void 0 : _a.parent)\n                    && ts.isModuleBlock(topNamespace.parent) && ts.isAmbientModule(topNamespace.parent.parent) && ts.isSourceFile(topNamespace.parent.parent.parent)))\n                    return;\n                var exportAssignment = (_d = (_c = (_b = topNamespace.parent.parent.symbol.exports) === null || _b === void 0 ? void 0 : _b.get(\"export=\")) === null || _c === void 0 ? void 0 : _c.valueDeclaration) === null || _d === void 0 ? void 0 : _d.expression;\n                if (!exportAssignment)\n                    return;\n                var exportSymbol = checker.getSymbolAtLocation(exportAssignment);\n                if (!exportSymbol)\n                    return;\n                var originalExportSymbol = (exportSymbol === null || exportSymbol === void 0 ? void 0 : exportSymbol.flags) & 2097152 /* Alias */ ? checker.getAliasedSymbol(exportSymbol) : exportSymbol;\n                if (originalExportSymbol === d.symbol)\n                    return topNamespace.parent.parent;\n                function getTopNamespace(namespaceDeclaration) {\n                    while (namespaceDeclaration.flags & 4 /* NestedNamespace */) {\n                        namespaceDeclaration = namespaceDeclaration.parent;\n                    }\n                    return namespaceDeclaration;\n                }\n            });\n            var ambientModuleDeclare = ambientModuleDeclareCandidates[0];\n            if (ambientModuleDeclare) {\n                return ambientModuleDeclare.name.text;\n            }\n        }\n        function tryGetModuleNameFromPaths(relativeToBaseUrlWithIndex, relativeToBaseUrl, paths) {\n            for (var key in paths) {\n                for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) {\n                    var patternText_1 = _a[_i];\n                    var pattern = ts.removeFileExtension(ts.normalizePath(patternText_1));\n                    var indexOfStar = pattern.indexOf(\"*\");\n                    if (indexOfStar !== -1) {\n                        var prefix = pattern.substr(0, indexOfStar);\n                        var suffix = pattern.substr(indexOfStar + 1);\n                        if (relativeToBaseUrl.length >= prefix.length + suffix.length &&\n                            ts.startsWith(relativeToBaseUrl, prefix) &&\n                            ts.endsWith(relativeToBaseUrl, suffix) ||\n                            !suffix && relativeToBaseUrl === ts.removeTrailingDirectorySeparator(prefix)) {\n                            var matchedStar = relativeToBaseUrl.substr(prefix.length, relativeToBaseUrl.length - suffix.length);\n                            return key.replace(\"*\", matchedStar);\n                        }\n                    }\n                    else if (pattern === relativeToBaseUrl || pattern === relativeToBaseUrlWithIndex) {\n                        return key;\n                    }\n                }\n            }\n        }\n        function tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) {\n            var normalizedTargetPath = getPathRelativeToRootDirs(moduleFileName, rootDirs, getCanonicalFileName);\n            if (normalizedTargetPath === undefined) {\n                return undefined;\n            }\n            var normalizedSourcePath = getPathRelativeToRootDirs(sourceDirectory, rootDirs, getCanonicalFileName);\n            var relativePath = normalizedSourcePath !== undefined ? ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(normalizedSourcePath, normalizedTargetPath, getCanonicalFileName)) : normalizedTargetPath;\n            return ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs\n                ? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions)\n                : ts.removeFileExtension(relativePath);\n        }\n        function tryGetModuleNameAsNodeModule(_a, _b, host, options, packageNameOnly) {\n            var path = _a.path, isRedirect = _a.isRedirect;\n            var getCanonicalFileName = _b.getCanonicalFileName, sourceDirectory = _b.sourceDirectory;\n            if (!host.fileExists || !host.readFile) {\n                return undefined;\n            }\n            var parts = getNodeModulePathParts(path);\n            if (!parts) {\n                return undefined;\n            }\n            // Simplify the full file path to something that can be resolved by Node.\n            var moduleSpecifier = path;\n            var isPackageRootPath = false;\n            if (!packageNameOnly) {\n                var packageRootIndex = parts.packageRootIndex;\n                var moduleFileNameForExtensionless = void 0;\n                while (true) {\n                    // If the module could be imported by a directory name, use that directory's name\n                    var _c = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _c.moduleFileToTry, packageRootPath = _c.packageRootPath;\n                    if (packageRootPath) {\n                        moduleSpecifier = packageRootPath;\n                        isPackageRootPath = true;\n                        break;\n                    }\n                    if (!moduleFileNameForExtensionless)\n                        moduleFileNameForExtensionless = moduleFileToTry;\n                    // try with next level of directory\n                    packageRootIndex = path.indexOf(ts.directorySeparator, packageRootIndex + 1);\n                    if (packageRootIndex === -1) {\n                        moduleSpecifier = getExtensionlessFileName(moduleFileNameForExtensionless);\n                        break;\n                    }\n                }\n            }\n            if (isRedirect && !isPackageRootPath) {\n                return undefined;\n            }\n            var globalTypingsCacheLocation = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation();\n            // Get a path that's relative to node_modules or the importing file's path\n            // if node_modules folder is in this folder or any of its parent folders, no need to keep it.\n            var pathToTopLevelNodeModules = getCanonicalFileName(moduleSpecifier.substring(0, parts.topLevelNodeModulesIndex));\n            if (!(ts.startsWith(sourceDirectory, pathToTopLevelNodeModules) || globalTypingsCacheLocation && ts.startsWith(getCanonicalFileName(globalTypingsCacheLocation), pathToTopLevelNodeModules))) {\n                return undefined;\n            }\n            // If the module was found in @types, get the actual Node package name\n            var nodeModulesDirectoryName = moduleSpecifier.substring(parts.topLevelPackageNameIndex + 1);\n            var packageName = ts.getPackageNameFromTypesPackageName(nodeModulesDirectoryName);\n            // For classic resolution, only allow importing from node_modules/@types, not other node_modules\n            return ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs && packageName === nodeModulesDirectoryName ? undefined : packageName;\n            function tryDirectoryWithPackageJson(packageRootIndex) {\n                var packageRootPath = path.substring(0, packageRootIndex);\n                var packageJsonPath = ts.combinePaths(packageRootPath, \"package.json\");\n                var moduleFileToTry = path;\n                if (host.fileExists(packageJsonPath)) {\n                    var packageJsonContent = JSON.parse(host.readFile(packageJsonPath));\n                    var versionPaths = packageJsonContent.typesVersions\n                        ? ts.getPackageJsonTypesVersionsPaths(packageJsonContent.typesVersions)\n                        : undefined;\n                    if (versionPaths) {\n                        var subModuleName = path.slice(packageRootPath.length + 1);\n                        var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(subModuleName), removeExtensionAndIndexPostFix(subModuleName, 0 /* Minimal */, options), versionPaths.paths);\n                        if (fromPaths !== undefined) {\n                            moduleFileToTry = ts.combinePaths(packageRootPath, fromPaths);\n                        }\n                    }\n                    // If the file is the main module, it can be imported by the package name\n                    var mainFileRelative = packageJsonContent.typings || packageJsonContent.types || packageJsonContent.main;\n                    if (ts.isString(mainFileRelative)) {\n                        var mainExportFile = ts.toPath(mainFileRelative, packageRootPath, getCanonicalFileName);\n                        if (ts.removeFileExtension(mainExportFile) === ts.removeFileExtension(getCanonicalFileName(moduleFileToTry))) {\n                            return { packageRootPath: packageRootPath, moduleFileToTry: moduleFileToTry };\n                        }\n                    }\n                }\n                return { moduleFileToTry: moduleFileToTry };\n            }\n            function getExtensionlessFileName(path) {\n                // We still have a file name - remove the extension\n                var fullModulePathWithoutExtension = ts.removeFileExtension(path);\n                // If the file is /index, it can be imported by its directory name\n                // IFF there is not _also_ a file by the same name\n                if (getCanonicalFileName(fullModulePathWithoutExtension.substring(parts.fileNameIndex)) === \"/index\" && !tryGetAnyFileFromPath(host, fullModulePathWithoutExtension.substring(0, parts.fileNameIndex))) {\n                    return fullModulePathWithoutExtension.substring(0, parts.fileNameIndex);\n                }\n                return fullModulePathWithoutExtension;\n            }\n        }\n        function tryGetAnyFileFromPath(host, path) {\n            if (!host.fileExists)\n                return;\n            // We check all js, `node` and `json` extensions in addition to TS, since node module resolution would also choose those over the directory\n            var extensions = ts.getSupportedExtensions({ allowJs: true }, [{ extension: \"node\", isMixedContent: false }, { extension: \"json\", isMixedContent: false, scriptKind: 6 /* JSON */ }]);\n            for (var _i = 0, extensions_3 = extensions; _i < extensions_3.length; _i++) {\n                var e = extensions_3[_i];\n                var fullPath = path + e;\n                if (host.fileExists(fullPath)) {\n                    return fullPath;\n                }\n            }\n        }\n        function getNodeModulePathParts(fullPath) {\n            // If fullPath can't be valid module file within node_modules, returns undefined.\n            // Example of expected pattern: /base/path/node_modules/[@scope/otherpackage/@otherscope/node_modules/]package/[subdirectory/]file.js\n            // Returns indices:                       ^            ^                                                      ^             ^\n            var topLevelNodeModulesIndex = 0;\n            var topLevelPackageNameIndex = 0;\n            var packageRootIndex = 0;\n            var fileNameIndex = 0;\n            var States;\n            (function (States) {\n                States[States[\"BeforeNodeModules\"] = 0] = \"BeforeNodeModules\";\n                States[States[\"NodeModules\"] = 1] = \"NodeModules\";\n                States[States[\"Scope\"] = 2] = \"Scope\";\n                States[States[\"PackageContent\"] = 3] = \"PackageContent\";\n            })(States || (States = {}));\n            var partStart = 0;\n            var partEnd = 0;\n            var state = 0 /* BeforeNodeModules */;\n            while (partEnd >= 0) {\n                partStart = partEnd;\n                partEnd = fullPath.indexOf(\"/\", partStart + 1);\n                switch (state) {\n                    case 0 /* BeforeNodeModules */:\n                        if (fullPath.indexOf(ts.nodeModulesPathPart, partStart) === partStart) {\n                            topLevelNodeModulesIndex = partStart;\n                            topLevelPackageNameIndex = partEnd;\n                            state = 1 /* NodeModules */;\n                        }\n                        break;\n                    case 1 /* NodeModules */:\n                    case 2 /* Scope */:\n                        if (state === 1 /* NodeModules */ && fullPath.charAt(partStart + 1) === \"@\") {\n                            state = 2 /* Scope */;\n                        }\n                        else {\n                            packageRootIndex = partEnd;\n                            state = 3 /* PackageContent */;\n                        }\n                        break;\n                    case 3 /* PackageContent */:\n                        if (fullPath.indexOf(ts.nodeModulesPathPart, partStart) === partStart) {\n                            state = 1 /* NodeModules */;\n                        }\n                        else {\n                            state = 3 /* PackageContent */;\n                        }\n                        break;\n                }\n            }\n            fileNameIndex = partStart;\n            return state > 1 /* NodeModules */ ? { topLevelNodeModulesIndex: topLevelNodeModulesIndex, topLevelPackageNameIndex: topLevelPackageNameIndex, packageRootIndex: packageRootIndex, fileNameIndex: fileNameIndex } : undefined;\n        }\n        function getPathRelativeToRootDirs(path, rootDirs, getCanonicalFileName) {\n            return ts.firstDefined(rootDirs, function (rootDir) {\n                var relativePath = getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName); // TODO: GH#18217\n                return isPathRelativeToParent(relativePath) ? undefined : relativePath;\n            });\n        }\n        function removeExtensionAndIndexPostFix(fileName, ending, options) {\n            if (ts.fileExtensionIs(fileName, \".json\" /* Json */))\n                return fileName;\n            var noExtension = ts.removeFileExtension(fileName);\n            switch (ending) {\n                case 0 /* Minimal */:\n                    return ts.removeSuffix(noExtension, \"/index\");\n                case 1 /* Index */:\n                    return noExtension;\n                case 2 /* JsExtension */:\n                    return noExtension + getJSExtensionForFile(fileName, options);\n                default:\n                    return ts.Debug.assertNever(ending);\n            }\n        }\n        function getJSExtensionForFile(fileName, options) {\n            var ext = ts.extensionFromPath(fileName);\n            switch (ext) {\n                case \".ts\" /* Ts */:\n                case \".d.ts\" /* Dts */:\n                    return \".js\" /* Js */;\n                case \".tsx\" /* Tsx */:\n                    return options.jsx === 1 /* Preserve */ ? \".jsx\" /* Jsx */ : \".js\" /* Js */;\n                case \".js\" /* Js */:\n                case \".jsx\" /* Jsx */:\n                case \".json\" /* Json */:\n                    return ext;\n                case \".tsbuildinfo\" /* TsBuildInfo */:\n                    return ts.Debug.fail(\"Extension \" + \".tsbuildinfo\" /* TsBuildInfo */ + \" is unsupported:: FileName:: \" + fileName);\n                default:\n                    return ts.Debug.assertNever(ext);\n            }\n        }\n        function getRelativePathIfInDirectory(path, directoryPath, getCanonicalFileName) {\n            var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false);\n            return ts.isRootedDiskPath(relativePath) ? undefined : relativePath;\n        }\n        function isPathRelativeToParent(path) {\n            return ts.startsWith(path, \"..\");\n        }\n    })(moduleSpecifiers = ts.moduleSpecifiers || (ts.moduleSpecifiers = {}));\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    var sysFormatDiagnosticsHost = ts.sys ? {\n        getCurrentDirectory: function () { return ts.sys.getCurrentDirectory(); },\n        getNewLine: function () { return ts.sys.newLine; },\n        getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)\n    } : undefined; // TODO: GH#18217\n    /**\n     * Create a function that reports error by writing to the system and handles the formating of the diagnostic\n     */\n    function createDiagnosticReporter(system, pretty) {\n        var host = system === ts.sys ? sysFormatDiagnosticsHost : {\n            getCurrentDirectory: function () { return system.getCurrentDirectory(); },\n            getNewLine: function () { return system.newLine; },\n            getCanonicalFileName: ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames),\n        };\n        if (!pretty) {\n            return function (diagnostic) { return system.write(ts.formatDiagnostic(diagnostic, host)); };\n        }\n        var diagnostics = new Array(1);\n        return function (diagnostic) {\n            diagnostics[0] = diagnostic;\n            system.write(ts.formatDiagnosticsWithColorAndContext(diagnostics, host) + host.getNewLine());\n            diagnostics[0] = undefined; // TODO: GH#18217\n        };\n    }\n    ts.createDiagnosticReporter = createDiagnosticReporter;\n    /**\n     * @returns Whether the screen was cleared.\n     */\n    function clearScreenIfNotWatchingForFileChanges(system, diagnostic, options) {\n        if (system.clearScreen &&\n            !options.preserveWatchOutput &&\n            !options.extendedDiagnostics &&\n            !options.diagnostics &&\n            ts.contains(ts.screenStartingMessageCodes, diagnostic.code)) {\n            system.clearScreen();\n            return true;\n        }\n        return false;\n    }\n    ts.screenStartingMessageCodes = [\n        ts.Diagnostics.Starting_compilation_in_watch_mode.code,\n        ts.Diagnostics.File_change_detected_Starting_incremental_compilation.code,\n    ];\n    function getPlainDiagnosticFollowingNewLines(diagnostic, newLine) {\n        return ts.contains(ts.screenStartingMessageCodes, diagnostic.code)\n            ? newLine + newLine\n            : newLine;\n    }\n    /**\n     * Get locale specific time based on whether we are in test mode\n     */\n    function getLocaleTimeString(system) {\n        return !system.now ?\n            new Date().toLocaleTimeString() :\n            system.now().toLocaleTimeString(\"en-US\", { timeZone: \"UTC\" });\n    }\n    ts.getLocaleTimeString = getLocaleTimeString;\n    /**\n     * Create a function that reports watch status by writing to the system and handles the formating of the diagnostic\n     */\n    function createWatchStatusReporter(system, pretty) {\n        return pretty ?\n            function (diagnostic, newLine, options) {\n                clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);\n                var output = \"[\" + ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + \"] \";\n                output += \"\" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (newLine + newLine);\n                system.write(output);\n            } :\n            function (diagnostic, newLine, options) {\n                var output = \"\";\n                if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) {\n                    output += newLine;\n                }\n                output += getLocaleTimeString(system) + \" - \";\n                output += \"\" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + getPlainDiagnosticFollowingNewLines(diagnostic, newLine);\n                system.write(output);\n            };\n    }\n    ts.createWatchStatusReporter = createWatchStatusReporter;\n    /** Parses config file using System interface */\n    function parseConfigFileWithSystem(configFileName, optionsToExtend, watchOptionsToExtend, system, reportDiagnostic) {\n        var host = system;\n        host.onUnRecoverableConfigFileDiagnostic = function (diagnostic) { return reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic); };\n        var result = ts.getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, /*extendedConfigCache*/ undefined, watchOptionsToExtend);\n        host.onUnRecoverableConfigFileDiagnostic = undefined; // TODO: GH#18217\n        return result;\n    }\n    ts.parseConfigFileWithSystem = parseConfigFileWithSystem;\n    function getErrorCountForSummary(diagnostics) {\n        return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });\n    }\n    ts.getErrorCountForSummary = getErrorCountForSummary;\n    function getWatchErrorSummaryDiagnosticMessage(errorCount) {\n        return errorCount === 1 ?\n            ts.Diagnostics.Found_1_error_Watching_for_file_changes :\n            ts.Diagnostics.Found_0_errors_Watching_for_file_changes;\n    }\n    ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;\n    function getErrorSummaryText(errorCount, newLine) {\n        if (errorCount === 0)\n            return \"\";\n        var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);\n        return \"\" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;\n    }\n    ts.getErrorSummaryText = getErrorSummaryText;\n    function isBuilderProgram(program) {\n        return !!program.getState;\n    }\n    ts.isBuilderProgram = isBuilderProgram;\n    function listFiles(program, write) {\n        var options = program.getCompilerOptions();\n        if (options.explainFiles) {\n            explainFiles(isBuilderProgram(program) ? program.getProgram() : program, write);\n        }\n        else if (options.listFiles || options.listFilesOnly) {\n            ts.forEach(program.getSourceFiles(), function (file) {\n                write(file.fileName);\n            });\n        }\n    }\n    ts.listFiles = listFiles;\n    function explainFiles(program, write) {\n        var _a, _b;\n        var reasons = program.getFileIncludeReasons();\n        var getCanonicalFileName = ts.createGetCanonicalFileName(program.useCaseSensitiveFileNames());\n        var relativeFileName = function (fileName) { return ts.convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName); };\n        for (var _i = 0, _c = program.getSourceFiles(); _i < _c.length; _i++) {\n            var file = _c[_i];\n            write(\"\" + toFileName(file, relativeFileName));\n            (_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(\"  \" + fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText); });\n            (_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(\"  \" + d.messageText); });\n        }\n    }\n    ts.explainFiles = explainFiles;\n    function explainIfFileIsRedirect(file, fileNameConvertor) {\n        var result;\n        if (file.path !== file.resolvedPath) {\n            (result || (result = [])).push(ts.chainDiagnosticMessages(\n            /*details*/ undefined, ts.Diagnostics.File_is_output_of_project_reference_source_0, toFileName(file.originalFileName, fileNameConvertor)));\n        }\n        if (file.redirectInfo) {\n            (result || (result = [])).push(ts.chainDiagnosticMessages(\n            /*details*/ undefined, ts.Diagnostics.File_redirects_to_file_0, toFileName(file.redirectInfo.redirectTarget, fileNameConvertor)));\n        }\n        return result;\n    }\n    ts.explainIfFileIsRedirect = explainIfFileIsRedirect;\n    function getMatchedFileSpec(program, fileName) {\n        var _a;\n        var configFile = program.getCompilerOptions().configFile;\n        if (!((_a = configFile === null || configFile === void 0 ? void 0 : configFile.configFileSpecs) === null || _a === void 0 ? void 0 : _a.validatedFilesSpec))\n            return undefined;\n        var getCanonicalFileName = ts.createGetCanonicalFileName(program.useCaseSensitiveFileNames());\n        var filePath = getCanonicalFileName(fileName);\n        var basePath = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));\n        return ts.find(configFile.configFileSpecs.validatedFilesSpec, function (fileSpec) { return getCanonicalFileName(ts.getNormalizedAbsolutePath(fileSpec, basePath)) === filePath; });\n    }\n    ts.getMatchedFileSpec = getMatchedFileSpec;\n    function getMatchedIncludeSpec(program, fileName) {\n        var _a, _b;\n        var configFile = program.getCompilerOptions().configFile;\n        if (!((_a = configFile === null || configFile === void 0 ? void 0 : configFile.configFileSpecs) === null || _a === void 0 ? void 0 : _a.validatedIncludeSpecs))\n            return undefined;\n        var isJsonFile = ts.fileExtensionIs(fileName, \".json\" /* Json */);\n        var basePath = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));\n        var useCaseSensitiveFileNames = program.useCaseSensitiveFileNames();\n        return ts.find((_b = configFile === null || configFile === void 0 ? void 0 : configFile.configFileSpecs) === null || _b === void 0 ? void 0 : _b.validatedIncludeSpecs, function (includeSpec) {\n            if (isJsonFile && !ts.endsWith(includeSpec, \".json\" /* Json */))\n                return false;\n            var pattern = ts.getPatternFromSpec(includeSpec, basePath, \"files\");\n            return !!pattern && ts.getRegexFromPattern(\"(\" + pattern + \")$\", useCaseSensitiveFileNames).test(fileName);\n        });\n    }\n    ts.getMatchedIncludeSpec = getMatchedIncludeSpec;\n    function fileIncludeReasonToDiagnostics(program, reason, fileNameConvertor) {\n        var _a, _b;\n        var options = program.getCompilerOptions();\n        if (ts.isReferencedFile(reason)) {\n            var referenceLocation = ts.getReferencedFileLocation(function (path) { return program.getSourceFileByPath(path); }, reason);\n            var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : \"\\\"\" + referenceLocation.text + \"\\\"\";\n            var message = void 0;\n            ts.Debug.assert(ts.isReferenceFileLocation(referenceLocation) || reason.kind === ts.FileIncludeKind.Import, \"Only synthetic references are imports\");\n            switch (reason.kind) {\n                case ts.FileIncludeKind.Import:\n                    if (ts.isReferenceFileLocation(referenceLocation)) {\n                        message = referenceLocation.packageId ?\n                            ts.Diagnostics.Imported_via_0_from_file_1_with_packageId_2 :\n                            ts.Diagnostics.Imported_via_0_from_file_1;\n                    }\n                    else if (referenceLocation.text === ts.externalHelpersModuleNameText) {\n                        message = referenceLocation.packageId ?\n                            ts.Diagnostics.Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions :\n                            ts.Diagnostics.Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions;\n                    }\n                    else {\n                        message = referenceLocation.packageId ?\n                            ts.Diagnostics.Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions :\n                            ts.Diagnostics.Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions;\n                    }\n                    break;\n                case ts.FileIncludeKind.ReferenceFile:\n                    ts.Debug.assert(!referenceLocation.packageId);\n                    message = ts.Diagnostics.Referenced_via_0_from_file_1;\n                    break;\n                case ts.FileIncludeKind.TypeReferenceDirective:\n                    message = referenceLocation.packageId ?\n                        ts.Diagnostics.Type_library_referenced_via_0_from_file_1_with_packageId_2 :\n                        ts.Diagnostics.Type_library_referenced_via_0_from_file_1;\n                    break;\n                case ts.FileIncludeKind.LibReferenceDirective:\n                    ts.Debug.assert(!referenceLocation.packageId);\n                    message = ts.Diagnostics.Library_referenced_via_0_from_file_1;\n                    break;\n                default:\n                    ts.Debug.assertNever(reason);\n            }\n            return ts.chainDiagnosticMessages(\n            /*details*/ undefined, message, referenceText, toFileName(referenceLocation.file, fileNameConvertor), referenceLocation.packageId && ts.packageIdToString(referenceLocation.packageId));\n        }\n        switch (reason.kind) {\n            case ts.FileIncludeKind.RootFile:\n                if (!((_a = options.configFile) === null || _a === void 0 ? void 0 : _a.configFileSpecs))\n                    return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Root_file_specified_for_compilation);\n                var fileName = ts.getNormalizedAbsolutePath(program.getRootFileNames()[reason.index], program.getCurrentDirectory());\n                var matchedByFiles = getMatchedFileSpec(program, fileName);\n                if (matchedByFiles)\n                    return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Part_of_files_list_in_tsconfig_json);\n                var matchedByInclude = getMatchedIncludeSpec(program, fileName);\n                return matchedByInclude ?\n                    ts.chainDiagnosticMessages(\n                    /*details*/ undefined, ts.Diagnostics.Matched_by_include_pattern_0_in_1, matchedByInclude, toFileName(options.configFile, fileNameConvertor)) :\n                    // Could be additional files specified as roots\n                    ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Root_file_specified_for_compilation);\n            case ts.FileIncludeKind.SourceFromProjectReference:\n            case ts.FileIncludeKind.OutputFromProjectReference:\n                var isOutput = reason.kind === ts.FileIncludeKind.OutputFromProjectReference;\n                var referencedResolvedRef = ts.Debug.checkDefined((_b = program.getResolvedProjectReferences()) === null || _b === void 0 ? void 0 : _b[reason.index]);\n                return ts.chainDiagnosticMessages(\n                /*details*/ undefined, ts.outFile(options) ?\n                    isOutput ?\n                        ts.Diagnostics.Output_from_referenced_project_0_included_because_1_specified :\n                        ts.Diagnostics.Source_from_referenced_project_0_included_because_1_specified :\n                    isOutput ?\n                        ts.Diagnostics.Output_from_referenced_project_0_included_because_module_is_specified_as_none :\n                        ts.Diagnostics.Source_from_referenced_project_0_included_because_module_is_specified_as_none, toFileName(referencedResolvedRef.sourceFile.fileName, fileNameConvertor), options.outFile ? \"--outFile\" : \"--out\");\n            case ts.FileIncludeKind.AutomaticTypeDirectiveFile:\n                return ts.chainDiagnosticMessages(\n                /*details*/ undefined, options.types ?\n                    reason.packageId ?\n                        ts.Diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1 :\n                        ts.Diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions :\n                    reason.packageId ?\n                        ts.Diagnostics.Entry_point_for_implicit_type_library_0_with_packageId_1 :\n                        ts.Diagnostics.Entry_point_for_implicit_type_library_0, reason.typeReference, reason.packageId && ts.packageIdToString(reason.packageId));\n            case ts.FileIncludeKind.LibFile:\n                if (reason.index !== undefined)\n                    return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Library_0_specified_in_compilerOptions, options.lib[reason.index]);\n                var target = ts.forEachEntry(ts.targetOptionDeclaration.type, function (value, key) { return value === options.target ? key : undefined; });\n                return ts.chainDiagnosticMessages(\n                /*details*/ undefined, target ?\n                    ts.Diagnostics.Default_library_for_target_0 :\n                    ts.Diagnostics.Default_library, target);\n            default:\n                ts.Debug.assertNever(reason);\n        }\n    }\n    ts.fileIncludeReasonToDiagnostics = fileIncludeReasonToDiagnostics;\n    function toFileName(file, fileNameConvertor) {\n        var fileName = ts.isString(file) ? file : file.fileName;\n        return fileNameConvertor ? fileNameConvertor(fileName) : fileName;\n    }\n    /**\n     * Helper that emit files, report diagnostics and lists emitted and/or source files depending on compiler options\n     */\n    function emitFilesAndReportErrors(program, reportDiagnostic, write, reportSummary, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {\n        var isListFilesOnly = !!program.getCompilerOptions().listFilesOnly;\n        // First get and report any syntactic errors.\n        var allDiagnostics = program.getConfigFileParsingDiagnostics().slice();\n        var configFileParsingDiagnosticsLength = allDiagnostics.length;\n        ts.addRange(allDiagnostics, program.getSyntacticDiagnostics(/*sourceFile*/ undefined, cancellationToken));\n        // If we didn't have any syntactic errors, then also try getting the global and\n        // semantic errors.\n        if (allDiagnostics.length === configFileParsingDiagnosticsLength) {\n            ts.addRange(allDiagnostics, program.getOptionsDiagnostics(cancellationToken));\n            if (!isListFilesOnly) {\n                ts.addRange(allDiagnostics, program.getGlobalDiagnostics(cancellationToken));\n                if (allDiagnostics.length === configFileParsingDiagnosticsLength) {\n                    ts.addRange(allDiagnostics, program.getSemanticDiagnostics(/*sourceFile*/ undefined, cancellationToken));\n                }\n            }\n        }\n        // Emit and report any errors we ran into.\n        var emitResult = isListFilesOnly\n            ? { emitSkipped: true, diagnostics: ts.emptyArray }\n            : program.emit(/*targetSourceFile*/ undefined, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers);\n        var emittedFiles = emitResult.emittedFiles, emitDiagnostics = emitResult.diagnostics;\n        ts.addRange(allDiagnostics, emitDiagnostics);\n        var diagnostics = ts.sortAndDeduplicateDiagnostics(allDiagnostics);\n        diagnostics.forEach(reportDiagnostic);\n        if (write) {\n            var currentDir_1 = program.getCurrentDirectory();\n            ts.forEach(emittedFiles, function (file) {\n                var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1);\n                write(\"TSFILE: \" + filepath);\n            });\n            listFiles(program, write);\n        }\n        if (reportSummary) {\n            reportSummary(getErrorCountForSummary(diagnostics));\n        }\n        return {\n            emitResult: emitResult,\n            diagnostics: diagnostics,\n        };\n    }\n    ts.emitFilesAndReportErrors = emitFilesAndReportErrors;\n    function emitFilesAndReportErrorsAndGetExitStatus(program, reportDiagnostic, write, reportSummary, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {\n        var _a = emitFilesAndReportErrors(program, reportDiagnostic, write, reportSummary, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers), emitResult = _a.emitResult, diagnostics = _a.diagnostics;\n        if (emitResult.emitSkipped && diagnostics.length > 0) {\n            // If the emitter didn't emit anything, then pass that value along.\n            return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;\n        }\n        else if (diagnostics.length > 0) {\n            // The emitter emitted something, inform the caller if that happened in the presence\n            // of diagnostics or not.\n            return ts.ExitStatus.DiagnosticsPresent_OutputsGenerated;\n        }\n        return ts.ExitStatus.Success;\n    }\n    ts.emitFilesAndReportErrorsAndGetExitStatus = emitFilesAndReportErrorsAndGetExitStatus;\n    ts.noopFileWatcher = { close: ts.noop };\n    ts.returnNoopFileWatcher = function () { return ts.noopFileWatcher; };\n    function createWatchHost(system, reportWatchStatus) {\n        if (system === void 0) { system = ts.sys; }\n        var onWatchStatusChange = reportWatchStatus || createWatchStatusReporter(system);\n        return {\n            onWatchStatusChange: onWatchStatusChange,\n            watchFile: ts.maybeBind(system, system.watchFile) || ts.returnNoopFileWatcher,\n            watchDirectory: ts.maybeBind(system, system.watchDirectory) || ts.returnNoopFileWatcher,\n            setTimeout: ts.maybeBind(system, system.setTimeout) || ts.noop,\n            clearTimeout: ts.maybeBind(system, system.clearTimeout) || ts.noop\n        };\n    }\n    ts.createWatchHost = createWatchHost;\n    ts.WatchType = {\n        ConfigFile: \"Config file\",\n        ExtendedConfigFile: \"Extended config file\",\n        SourceFile: \"Source file\",\n        MissingFile: \"Missing file\",\n        WildcardDirectory: \"Wild card directory\",\n        FailedLookupLocations: \"Failed Lookup Locations\",\n        TypeRoots: \"Type roots\"\n    };\n    function createWatchFactory(host, options) {\n        var watchLogLevel = host.trace ? options.extendedDiagnostics ? ts.WatchLogLevel.Verbose : options.diagnostics ? ts.WatchLogLevel.TriggerOnly : ts.WatchLogLevel.None : ts.WatchLogLevel.None;\n        var writeLog = watchLogLevel !== ts.WatchLogLevel.None ? (function (s) { return host.trace(s); }) : ts.noop;\n        var result = ts.getWatchFactory(host, watchLogLevel, writeLog);\n        result.writeLog = writeLog;\n        return result;\n    }\n    ts.createWatchFactory = createWatchFactory;\n    function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost) {\n        if (directoryStructureHost === void 0) { directoryStructureHost = host; }\n        var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();\n        var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });\n        return {\n            getSourceFile: function (fileName, languageVersion, onError) {\n                var text;\n                try {\n                    ts.performance.mark(\"beforeIORead\");\n                    text = host.readFile(fileName, getCompilerOptions().charset);\n                    ts.performance.mark(\"afterIORead\");\n                    ts.performance.measure(\"I/O Read\", \"beforeIORead\", \"afterIORead\");\n                }\n                catch (e) {\n                    if (onError) {\n                        onError(e.message);\n                    }\n                    text = \"\";\n                }\n                return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined;\n            },\n            getDefaultLibLocation: ts.maybeBind(host, host.getDefaultLibLocation),\n            getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); },\n            writeFile: writeFile,\n            getCurrentDirectory: ts.memoize(function () { return host.getCurrentDirectory(); }),\n            useCaseSensitiveFileNames: function () { return useCaseSensitiveFileNames; },\n            getCanonicalFileName: ts.createGetCanonicalFileName(useCaseSensitiveFileNames),\n            getNewLine: function () { return ts.getNewLineCharacter(getCompilerOptions(), hostGetNewLine); },\n            fileExists: function (f) { return host.fileExists(f); },\n            readFile: function (f) { return host.readFile(f); },\n            trace: ts.maybeBind(host, host.trace),\n            directoryExists: ts.maybeBind(directoryStructureHost, directoryStructureHost.directoryExists),\n            getDirectories: ts.maybeBind(directoryStructureHost, directoryStructureHost.getDirectories),\n            realpath: ts.maybeBind(host, host.realpath),\n            getEnvironmentVariable: ts.maybeBind(host, host.getEnvironmentVariable) || (function () { return \"\"; }),\n            createHash: ts.maybeBind(host, host.createHash),\n            readDirectory: ts.maybeBind(host, host.readDirectory),\n        };\n        function writeFile(fileName, text, writeByteOrderMark, onError) {\n            try {\n                ts.performance.mark(\"beforeIOWrite\");\n                // NOTE: If patchWriteFileEnsuringDirectory has been called,\n                // the host.writeFile will do its own directory creation and\n                // the ensureDirectoriesExist call will always be redundant.\n                ts.writeFileEnsuringDirectories(fileName, text, writeByteOrderMark, function (path, data, writeByteOrderMark) { return host.writeFile(path, data, writeByteOrderMark); }, function (path) { return host.createDirectory(path); }, function (path) { return host.directoryExists(path); });\n                ts.performance.mark(\"afterIOWrite\");\n                ts.performance.measure(\"I/O Write\", \"beforeIOWrite\", \"afterIOWrite\");\n            }\n            catch (e) {\n                if (onError) {\n                    onError(e.message);\n                }\n            }\n        }\n    }\n    ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;\n    function setGetSourceFileAsHashVersioned(compilerHost, host) {\n        var originalGetSourceFile = compilerHost.getSourceFile;\n        var computeHash = ts.maybeBind(host, host.createHash) || ts.generateDjb2Hash;\n        compilerHost.getSourceFile = function () {\n            var args = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                args[_i] = arguments[_i];\n            }\n            var result = originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArray([compilerHost], args));\n            if (result) {\n                result.version = computeHash(result.text);\n            }\n            return result;\n        };\n    }\n    ts.setGetSourceFileAsHashVersioned = setGetSourceFileAsHashVersioned;\n    /**\n     * Creates the watch compiler host that can be extended with config file or root file names and options host\n     */\n    function createProgramHost(system, createProgram) {\n        var getDefaultLibLocation = ts.memoize(function () { return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath())); });\n        return {\n            useCaseSensitiveFileNames: function () { return system.useCaseSensitiveFileNames; },\n            getNewLine: function () { return system.newLine; },\n            getCurrentDirectory: ts.memoize(function () { return system.getCurrentDirectory(); }),\n            getDefaultLibLocation: getDefaultLibLocation,\n            getDefaultLibFileName: function (options) { return ts.combinePaths(getDefaultLibLocation(), ts.getDefaultLibFileName(options)); },\n            fileExists: function (path) { return system.fileExists(path); },\n            readFile: function (path, encoding) { return system.readFile(path, encoding); },\n            directoryExists: function (path) { return system.directoryExists(path); },\n            getDirectories: function (path) { return system.getDirectories(path); },\n            readDirectory: function (path, extensions, exclude, include, depth) { return system.readDirectory(path, extensions, exclude, include, depth); },\n            realpath: ts.maybeBind(system, system.realpath),\n            getEnvironmentVariable: ts.maybeBind(system, system.getEnvironmentVariable),\n            trace: function (s) { return system.write(s + system.newLine); },\n            createDirectory: function (path) { return system.createDirectory(path); },\n            writeFile: function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); },\n            createHash: ts.maybeBind(system, system.createHash),\n            createProgram: createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram\n        };\n    }\n    ts.createProgramHost = createProgramHost;\n    /**\n     * Creates the watch compiler host that can be extended with config file or root file names and options host\n     */\n    function createWatchCompilerHost(system, createProgram, reportDiagnostic, reportWatchStatus) {\n        if (system === void 0) { system = ts.sys; }\n        var write = function (s) { return system.write(s + system.newLine); };\n        var result = createProgramHost(system, createProgram);\n        ts.copyProperties(result, createWatchHost(system, reportWatchStatus));\n        result.afterProgramCreate = function (builderProgram) {\n            var compilerOptions = builderProgram.getCompilerOptions();\n            var newLine = ts.getNewLineCharacter(compilerOptions, function () { return system.newLine; });\n            emitFilesAndReportErrors(builderProgram, reportDiagnostic, write, function (errorCount) { return result.onWatchStatusChange(ts.createCompilerDiagnostic(getWatchErrorSummaryDiagnosticMessage(errorCount), errorCount), newLine, compilerOptions, errorCount); });\n        };\n        return result;\n    }\n    /**\n     * Report error and exit\n     */\n    function reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic) {\n        reportDiagnostic(diagnostic);\n        system.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped);\n    }\n    /**\n     * Creates the watch compiler host from system for config file in watch mode\n     */\n    function createWatchCompilerHostOfConfigFile(_a) {\n        var configFileName = _a.configFileName, optionsToExtend = _a.optionsToExtend, watchOptionsToExtend = _a.watchOptionsToExtend, extraFileExtensions = _a.extraFileExtensions, system = _a.system, createProgram = _a.createProgram, reportDiagnostic = _a.reportDiagnostic, reportWatchStatus = _a.reportWatchStatus;\n        var diagnosticReporter = reportDiagnostic || createDiagnosticReporter(system);\n        var host = createWatchCompilerHost(system, createProgram, diagnosticReporter, reportWatchStatus);\n        host.onUnRecoverableConfigFileDiagnostic = function (diagnostic) { return reportUnrecoverableDiagnostic(system, diagnosticReporter, diagnostic); };\n        host.configFileName = configFileName;\n        host.optionsToExtend = optionsToExtend;\n        host.watchOptionsToExtend = watchOptionsToExtend;\n        host.extraFileExtensions = extraFileExtensions;\n        return host;\n    }\n    ts.createWatchCompilerHostOfConfigFile = createWatchCompilerHostOfConfigFile;\n    /**\n     * Creates the watch compiler host from system for compiling root files and options in watch mode\n     */\n    function createWatchCompilerHostOfFilesAndCompilerOptions(_a) {\n        var rootFiles = _a.rootFiles, options = _a.options, watchOptions = _a.watchOptions, projectReferences = _a.projectReferences, system = _a.system, createProgram = _a.createProgram, reportDiagnostic = _a.reportDiagnostic, reportWatchStatus = _a.reportWatchStatus;\n        var host = createWatchCompilerHost(system, createProgram, reportDiagnostic || createDiagnosticReporter(system), reportWatchStatus);\n        host.rootFiles = rootFiles;\n        host.options = options;\n        host.watchOptions = watchOptions;\n        host.projectReferences = projectReferences;\n        return host;\n    }\n    ts.createWatchCompilerHostOfFilesAndCompilerOptions = createWatchCompilerHostOfFilesAndCompilerOptions;\n    function performIncrementalCompilation(input) {\n        var system = input.system || ts.sys;\n        var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));\n        var builderProgram = ts.createIncrementalProgram(input);\n        var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount) { return system.write(getErrorSummaryText(errorCount, system.newLine)); } : undefined);\n        if (input.afterProgramEmitAndDiagnostics)\n            input.afterProgramEmitAndDiagnostics(builderProgram);\n        return exitStatus;\n    }\n    ts.performIncrementalCompilation = performIncrementalCompilation;\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    function readBuilderProgram(compilerOptions, host) {\n        if (ts.outFile(compilerOptions))\n            return undefined;\n        var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(compilerOptions);\n        if (!buildInfoPath)\n            return undefined;\n        var content = host.readFile(buildInfoPath);\n        if (!content)\n            return undefined;\n        var buildInfo = ts.getBuildInfo(content);\n        if (buildInfo.version !== ts.version)\n            return undefined;\n        if (!buildInfo.program)\n            return undefined;\n        return ts.createBuildProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);\n    }\n    ts.readBuilderProgram = readBuilderProgram;\n    function createIncrementalCompilerHost(options, system) {\n        if (system === void 0) { system = ts.sys; }\n        var host = ts.createCompilerHostWorker(options, /*setParentNodes*/ undefined, system);\n        host.createHash = ts.maybeBind(system, system.createHash);\n        ts.setGetSourceFileAsHashVersioned(host, system);\n        ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });\n        return host;\n    }\n    ts.createIncrementalCompilerHost = createIncrementalCompilerHost;\n    function createIncrementalProgram(_a) {\n        var rootNames = _a.rootNames, options = _a.options, configFileParsingDiagnostics = _a.configFileParsingDiagnostics, projectReferences = _a.projectReferences, host = _a.host, createProgram = _a.createProgram;\n        host = host || createIncrementalCompilerHost(options);\n        createProgram = createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram;\n        var oldProgram = readBuilderProgram(options, host);\n        return createProgram(rootNames, options, host, oldProgram, configFileParsingDiagnostics, projectReferences);\n    }\n    ts.createIncrementalProgram = createIncrementalProgram;\n    function createWatchCompilerHost(rootFilesOrConfigFileName, options, system, createProgram, reportDiagnostic, reportWatchStatus, projectReferencesOrWatchOptionsToExtend, watchOptionsOrExtraFileExtensions) {\n        if (ts.isArray(rootFilesOrConfigFileName)) {\n            return ts.createWatchCompilerHostOfFilesAndCompilerOptions({\n                rootFiles: rootFilesOrConfigFileName,\n                options: options,\n                watchOptions: watchOptionsOrExtraFileExtensions,\n                projectReferences: projectReferencesOrWatchOptionsToExtend,\n                system: system,\n                createProgram: createProgram,\n                reportDiagnostic: reportDiagnostic,\n                reportWatchStatus: reportWatchStatus,\n            });\n        }\n        else {\n            return ts.createWatchCompilerHostOfConfigFile({\n                configFileName: rootFilesOrConfigFileName,\n                optionsToExtend: options,\n                watchOptionsToExtend: projectReferencesOrWatchOptionsToExtend,\n                extraFileExtensions: watchOptionsOrExtraFileExtensions,\n                system: system,\n                createProgram: createProgram,\n                reportDiagnostic: reportDiagnostic,\n                reportWatchStatus: reportWatchStatus,\n            });\n        }\n    }\n    ts.createWatchCompilerHost = createWatchCompilerHost;\n    function createWatchProgram(host) {\n        var builderProgram;\n        var reloadLevel; // level to indicate if the program needs to be reloaded from config file/just filenames etc\n        var extendedConfigFilesMap; // Map of file watchers for the extended config files\n        var missingFilesMap; // Map of file watchers for the missing files\n        var watchedWildcardDirectories; // map of watchers for the wild card directories in the config file\n        var timerToUpdateProgram; // timer callback to recompile the program\n        var timerToInvalidateFailedLookupResolutions; // timer callback to invalidate resolutions for changes in failed lookup locations\n        var sourceFilesCache = new ts.Map(); // Cache that stores the source file and version info\n        var missingFilePathsRequestedForRelease; // These paths are held temporarily so that we can remove the entry from source file cache if the file is not tracked by missing files\n        var hasChangedCompilerOptions = false; // True if the compiler options have changed between compilations\n        var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();\n        var currentDirectory = host.getCurrentDirectory();\n        var configFileName = host.configFileName, _a = host.optionsToExtend, optionsToExtendForConfigFile = _a === void 0 ? {} : _a, watchOptionsToExtend = host.watchOptionsToExtend, extraFileExtensions = host.extraFileExtensions, createProgram = host.createProgram;\n        var rootFileNames = host.rootFiles, compilerOptions = host.options, watchOptions = host.watchOptions, projectReferences = host.projectReferences;\n        var wildcardDirectories;\n        var configFileParsingDiagnostics;\n        var canConfigFileJsonReportNoInputFiles = false;\n        var hasChangedConfigFileParsingErrors = false;\n        var cachedDirectoryStructureHost = configFileName === undefined ? undefined : ts.createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames);\n        var directoryStructureHost = cachedDirectoryStructureHost || host;\n        var parseConfigFileHost = ts.parseConfigHostFromCompilerHostLike(host, directoryStructureHost);\n        // From tsc we want to get already parsed result and hence check for rootFileNames\n        var newLine = updateNewLine();\n        if (configFileName && host.configFileParsingResult) {\n            setConfigFileParsingResult(host.configFileParsingResult);\n            newLine = updateNewLine();\n        }\n        reportWatchDiagnostic(ts.Diagnostics.Starting_compilation_in_watch_mode);\n        if (configFileName && !host.configFileParsingResult) {\n            newLine = ts.getNewLineCharacter(optionsToExtendForConfigFile, function () { return host.getNewLine(); });\n            ts.Debug.assert(!rootFileNames);\n            parseConfigFile();\n            newLine = updateNewLine();\n        }\n        var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;\n        var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);\n        writeLog(\"Current directory: \" + currentDirectory + \" CaseSensitiveFileNames: \" + useCaseSensitiveFileNames);\n        var configFileWatcher;\n        if (configFileName) {\n            configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);\n        }\n        var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost);\n        ts.setGetSourceFileAsHashVersioned(compilerHost, host);\n        // Members for CompilerHost\n        var getNewSourceFile = compilerHost.getSourceFile;\n        compilerHost.getSourceFile = function (fileName) {\n            var args = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                args[_i - 1] = arguments[_i];\n            }\n            return getVersionedSourceFileByPath.apply(void 0, __spreadArray([fileName, toPath(fileName)], args));\n        };\n        compilerHost.getSourceFileByPath = getVersionedSourceFileByPath;\n        compilerHost.getNewLine = function () { return newLine; };\n        compilerHost.fileExists = fileExists;\n        compilerHost.onReleaseOldSourceFile = onReleaseOldSourceFile;\n        // Members for ResolutionCacheHost\n        compilerHost.toPath = toPath;\n        compilerHost.getCompilationSettings = function () { return compilerOptions; };\n        compilerHost.useSourceOfProjectReferenceRedirect = ts.maybeBind(host, host.useSourceOfProjectReferenceRedirect);\n        compilerHost.watchDirectoryOfFailedLookupLocation = function (dir, cb, flags) { return watchDirectory(dir, cb, flags, watchOptions, ts.WatchType.FailedLookupLocations); };\n        compilerHost.watchTypeRootsDirectory = function (dir, cb, flags) { return watchDirectory(dir, cb, flags, watchOptions, ts.WatchType.TypeRoots); };\n        compilerHost.getCachedDirectoryStructureHost = function () { return cachedDirectoryStructureHost; };\n        compilerHost.scheduleInvalidateResolutionsOfFailedLookupLocations = scheduleInvalidateResolutionsOfFailedLookupLocations;\n        compilerHost.onInvalidatedResolution = scheduleProgramUpdate;\n        compilerHost.onChangedAutomaticTypeDirectiveNames = scheduleProgramUpdate;\n        compilerHost.fileIsOpen = ts.returnFalse;\n        compilerHost.getCurrentProgram = getCurrentProgram;\n        compilerHost.writeLog = writeLog;\n        // Cache for the module resolution\n        var resolutionCache = ts.createResolutionCache(compilerHost, configFileName ?\n            ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFileName, currentDirectory)) :\n            currentDirectory, \n        /*logChangesWhenResolvingModule*/ false);\n        // Resolve module using host module resolution strategy if provided otherwise use resolution cache to resolve module names\n        compilerHost.resolveModuleNames = host.resolveModuleNames ?\n            (function () {\n                var args = [];\n                for (var _i = 0; _i < arguments.length; _i++) {\n                    args[_i] = arguments[_i];\n                }\n                return host.resolveModuleNames.apply(host, args);\n            }) :\n            (function (moduleNames, containingFile, reusedNames, redirectedReference) { return resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference); });\n        compilerHost.resolveTypeReferenceDirectives = host.resolveTypeReferenceDirectives ?\n            (function () {\n                var args = [];\n                for (var _i = 0; _i < arguments.length; _i++) {\n                    args[_i] = arguments[_i];\n                }\n                return host.resolveTypeReferenceDirectives.apply(host, args);\n            }) :\n            (function (typeDirectiveNames, containingFile, redirectedReference) { return resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference); });\n        var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;\n        builderProgram = readBuilderProgram(compilerOptions, compilerHost);\n        synchronizeProgram();\n        // Update the wild card directory watch\n        watchConfigFileWildCardDirectories();\n        // Update extended config file watch\n        watchExtendedConfigFiles();\n        return configFileName ?\n            { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close: close } :\n            { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames: updateRootFileNames, close: close };\n        function close() {\n            clearInvalidateResolutionsOfFailedLookupLocations();\n            resolutionCache.clear();\n            ts.clearMap(sourceFilesCache, function (value) {\n                if (value && value.fileWatcher) {\n                    value.fileWatcher.close();\n                    value.fileWatcher = undefined;\n                }\n            });\n            if (configFileWatcher) {\n                configFileWatcher.close();\n                configFileWatcher = undefined;\n            }\n            if (extendedConfigFilesMap) {\n                ts.clearMap(extendedConfigFilesMap, ts.closeFileWatcher);\n                extendedConfigFilesMap = undefined;\n            }\n            if (watchedWildcardDirectories) {\n                ts.clearMap(watchedWildcardDirectories, ts.closeFileWatcherOf);\n                watchedWildcardDirectories = undefined;\n            }\n            if (missingFilesMap) {\n                ts.clearMap(missingFilesMap, ts.closeFileWatcher);\n                missingFilesMap = undefined;\n            }\n        }\n        function getCurrentBuilderProgram() {\n            return builderProgram;\n        }\n        function getCurrentProgram() {\n            return builderProgram && builderProgram.getProgramOrUndefined();\n        }\n        function synchronizeProgram() {\n            writeLog(\"Synchronizing program\");\n            clearInvalidateResolutionsOfFailedLookupLocations();\n            var program = getCurrentBuilderProgram();\n            if (hasChangedCompilerOptions) {\n                newLine = updateNewLine();\n                if (program && ts.changesAffectModuleResolution(program.getCompilerOptions(), compilerOptions)) {\n                    resolutionCache.clear();\n                }\n            }\n            // All resolutions are invalid if user provided resolutions\n            var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution);\n            if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, projectReferences)) {\n                if (hasChangedConfigFileParsingErrors) {\n                    builderProgram = createProgram(/*rootNames*/ undefined, /*options*/ undefined, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);\n                    hasChangedConfigFileParsingErrors = false;\n                }\n            }\n            else {\n                createNewProgram(hasInvalidatedResolution);\n            }\n            if (host.afterProgramCreate && program !== builderProgram) {\n                host.afterProgramCreate(builderProgram);\n            }\n            return builderProgram;\n        }\n        function createNewProgram(hasInvalidatedResolution) {\n            // Compile the program\n            writeLog(\"CreatingProgramWith::\");\n            writeLog(\"  roots: \" + JSON.stringify(rootFileNames));\n            writeLog(\"  options: \" + JSON.stringify(compilerOptions));\n            var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram();\n            hasChangedCompilerOptions = false;\n            hasChangedConfigFileParsingErrors = false;\n            resolutionCache.startCachingPerDirectoryResolution();\n            compilerHost.hasInvalidatedResolution = hasInvalidatedResolution;\n            compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames;\n            builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);\n            resolutionCache.finishCachingPerDirectoryResolution();\n            // Update watches\n            ts.updateMissingFilePathsWatch(builderProgram.getProgram(), missingFilesMap || (missingFilesMap = new ts.Map()), watchMissingFilePath);\n            if (needsUpdateInTypeRootWatch) {\n                resolutionCache.updateTypeRootsWatch();\n            }\n            if (missingFilePathsRequestedForRelease) {\n                // These are the paths that program creater told us as not in use any more but were missing on the disk.\n                // We didnt remove the entry for them from sourceFiles cache so that we dont have to do File IO,\n                // if there is already watcher for it (for missing files)\n                // At this point our watches were updated, hence now we know that these paths are not tracked and need to be removed\n                // so that at later time we have correct result of their presence\n                for (var _i = 0, missingFilePathsRequestedForRelease_1 = missingFilePathsRequestedForRelease; _i < missingFilePathsRequestedForRelease_1.length; _i++) {\n                    var missingFilePath = missingFilePathsRequestedForRelease_1[_i];\n                    if (!missingFilesMap.has(missingFilePath)) {\n                        sourceFilesCache.delete(missingFilePath);\n                    }\n                }\n                missingFilePathsRequestedForRelease = undefined;\n            }\n        }\n        function updateRootFileNames(files) {\n            ts.Debug.assert(!configFileName, \"Cannot update root file names with config file watch mode\");\n            rootFileNames = files;\n            scheduleProgramUpdate();\n        }\n        function updateNewLine() {\n            return ts.getNewLineCharacter(compilerOptions || optionsToExtendForConfigFile, function () { return host.getNewLine(); });\n        }\n        function toPath(fileName) {\n            return ts.toPath(fileName, currentDirectory, getCanonicalFileName);\n        }\n        function isFileMissingOnHost(hostSourceFile) {\n            return typeof hostSourceFile === \"boolean\";\n        }\n        function isFilePresenceUnknownOnHost(hostSourceFile) {\n            return typeof hostSourceFile.version === \"boolean\";\n        }\n        function fileExists(fileName) {\n            var path = toPath(fileName);\n            // If file is missing on host from cache, we can definitely say file doesnt exist\n            // otherwise we need to ensure from the disk\n            if (isFileMissingOnHost(sourceFilesCache.get(path))) {\n                return false;\n            }\n            return directoryStructureHost.fileExists(fileName);\n        }\n        function getVersionedSourceFileByPath(fileName, path, languageVersion, onError, shouldCreateNewSourceFile) {\n            var hostSourceFile = sourceFilesCache.get(path);\n            // No source file on the host\n            if (isFileMissingOnHost(hostSourceFile)) {\n                return undefined;\n            }\n            // Create new source file if requested or the versions dont match\n            if (hostSourceFile === undefined || shouldCreateNewSourceFile || isFilePresenceUnknownOnHost(hostSourceFile)) {\n                var sourceFile = getNewSourceFile(fileName, languageVersion, onError);\n                if (hostSourceFile) {\n                    if (sourceFile) {\n                        // Set the source file and create file watcher now that file was present on the disk\n                        hostSourceFile.sourceFile = sourceFile;\n                        hostSourceFile.version = sourceFile.version;\n                        if (!hostSourceFile.fileWatcher) {\n                            hostSourceFile.fileWatcher = watchFilePath(path, fileName, onSourceFileChange, ts.PollingInterval.Low, watchOptions, ts.WatchType.SourceFile);\n                        }\n                    }\n                    else {\n                        // There is no source file on host any more, close the watch, missing file paths will track it\n                        if (hostSourceFile.fileWatcher) {\n                            hostSourceFile.fileWatcher.close();\n                        }\n                        sourceFilesCache.set(path, false);\n                    }\n                }\n                else {\n                    if (sourceFile) {\n                        var fileWatcher = watchFilePath(path, fileName, onSourceFileChange, ts.PollingInterval.Low, watchOptions, ts.WatchType.SourceFile);\n                        sourceFilesCache.set(path, { sourceFile: sourceFile, version: sourceFile.version, fileWatcher: fileWatcher });\n                    }\n                    else {\n                        sourceFilesCache.set(path, false);\n                    }\n                }\n                return sourceFile;\n            }\n            return hostSourceFile.sourceFile;\n        }\n        function nextSourceFileVersion(path) {\n            var hostSourceFile = sourceFilesCache.get(path);\n            if (hostSourceFile !== undefined) {\n                if (isFileMissingOnHost(hostSourceFile)) {\n                    // The next version, lets set it as presence unknown file\n                    sourceFilesCache.set(path, { version: false });\n                }\n                else {\n                    hostSourceFile.version = false;\n                }\n            }\n        }\n        function getSourceVersion(path) {\n            var hostSourceFile = sourceFilesCache.get(path);\n            return !hostSourceFile || !hostSourceFile.version ? undefined : hostSourceFile.version;\n        }\n        function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {\n            var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);\n            // If this is the source file thats in the cache and new program doesnt need it,\n            // remove the cached entry.\n            // Note we arent deleting entry if file became missing in new program or\n            // there was version update and new source file was created.\n            if (hostSourceFileInfo !== undefined) {\n                // record the missing file paths so they can be removed later if watchers arent tracking them\n                if (isFileMissingOnHost(hostSourceFileInfo)) {\n                    (missingFilePathsRequestedForRelease || (missingFilePathsRequestedForRelease = [])).push(oldSourceFile.path);\n                }\n                else if (hostSourceFileInfo.sourceFile === oldSourceFile) {\n                    if (hostSourceFileInfo.fileWatcher) {\n                        hostSourceFileInfo.fileWatcher.close();\n                    }\n                    sourceFilesCache.delete(oldSourceFile.resolvedPath);\n                    if (!hasSourceFileByPath) {\n                        resolutionCache.removeResolutionsOfFile(oldSourceFile.path);\n                    }\n                }\n            }\n        }\n        function reportWatchDiagnostic(message) {\n            if (host.onWatchStatusChange) {\n                host.onWatchStatusChange(ts.createCompilerDiagnostic(message), newLine, compilerOptions || optionsToExtendForConfigFile);\n            }\n        }\n        function hasChangedAutomaticTypeDirectiveNames() {\n            return resolutionCache.hasChangedAutomaticTypeDirectiveNames();\n        }\n        function clearInvalidateResolutionsOfFailedLookupLocations() {\n            if (!timerToInvalidateFailedLookupResolutions)\n                return false;\n            host.clearTimeout(timerToInvalidateFailedLookupResolutions);\n            timerToInvalidateFailedLookupResolutions = undefined;\n            return true;\n        }\n        function scheduleInvalidateResolutionsOfFailedLookupLocations() {\n            if (!host.setTimeout || !host.clearTimeout) {\n                return resolutionCache.invalidateResolutionsOfFailedLookupLocations();\n            }\n            var pending = clearInvalidateResolutionsOfFailedLookupLocations();\n            writeLog(\"Scheduling invalidateFailedLookup\" + (pending ? \", Cancelled earlier one\" : \"\"));\n            timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250);\n        }\n        function invalidateResolutionsOfFailedLookup() {\n            timerToInvalidateFailedLookupResolutions = undefined;\n            if (resolutionCache.invalidateResolutionsOfFailedLookupLocations()) {\n                scheduleProgramUpdate();\n            }\n        }\n        // Upon detecting a file change, wait for 250ms and then perform a recompilation. This gives batch\n        // operations (such as saving all modified files in an editor) a chance to complete before we kick\n        // off a new compilation.\n        function scheduleProgramUpdate() {\n            if (!host.setTimeout || !host.clearTimeout) {\n                return;\n            }\n            if (timerToUpdateProgram) {\n                host.clearTimeout(timerToUpdateProgram);\n            }\n            writeLog(\"Scheduling update\");\n            timerToUpdateProgram = host.setTimeout(updateProgramWithWatchStatus, 250);\n        }\n        function scheduleProgramReload() {\n            ts.Debug.assert(!!configFileName);\n            reloadLevel = ts.ConfigFileProgramReloadLevel.Full;\n            scheduleProgramUpdate();\n        }\n        function updateProgramWithWatchStatus() {\n            timerToUpdateProgram = undefined;\n            reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);\n            updateProgram();\n        }\n        function updateProgram() {\n            switch (reloadLevel) {\n                case ts.ConfigFileProgramReloadLevel.Partial:\n                    ts.perfLogger.logStartUpdateProgram(\"PartialConfigReload\");\n                    reloadFileNamesFromConfigFile();\n                    break;\n                case ts.ConfigFileProgramReloadLevel.Full:\n                    ts.perfLogger.logStartUpdateProgram(\"FullConfigReload\");\n                    reloadConfigFile();\n                    break;\n                default:\n                    ts.perfLogger.logStartUpdateProgram(\"SynchronizeProgram\");\n                    synchronizeProgram();\n                    break;\n            }\n            ts.perfLogger.logStopUpdateProgram(\"Done\");\n            return getCurrentBuilderProgram();\n        }\n        function reloadFileNamesFromConfigFile() {\n            writeLog(\"Reloading new file names and options\");\n            rootFileNames = ts.getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);\n            if (ts.updateErrorForNoInputFiles(rootFileNames, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {\n                hasChangedConfigFileParsingErrors = true;\n            }\n            // Update the program\n            synchronizeProgram();\n        }\n        function reloadConfigFile() {\n            writeLog(\"Reloading config file: \" + configFileName);\n            reloadLevel = ts.ConfigFileProgramReloadLevel.None;\n            if (cachedDirectoryStructureHost) {\n                cachedDirectoryStructureHost.clearCache();\n            }\n            parseConfigFile();\n            hasChangedCompilerOptions = true;\n            synchronizeProgram();\n            // Update the wild card directory watch\n            watchConfigFileWildCardDirectories();\n            // Update extended config file watch\n            watchExtendedConfigFiles();\n        }\n        function parseConfigFile() {\n            setConfigFileParsingResult(ts.getParsedCommandLineOfConfigFile(configFileName, optionsToExtendForConfigFile, parseConfigFileHost, /*extendedConfigCache*/ undefined, watchOptionsToExtend, extraFileExtensions)); // TODO: GH#18217\n        }\n        function setConfigFileParsingResult(configFileParseResult) {\n            rootFileNames = configFileParseResult.fileNames;\n            compilerOptions = configFileParseResult.options;\n            watchOptions = configFileParseResult.watchOptions;\n            projectReferences = configFileParseResult.projectReferences;\n            wildcardDirectories = configFileParseResult.wildcardDirectories;\n            configFileParsingDiagnostics = ts.getConfigFileParsingDiagnostics(configFileParseResult).slice();\n            canConfigFileJsonReportNoInputFiles = ts.canJsonReportNoInputFiles(configFileParseResult.raw);\n            hasChangedConfigFileParsingErrors = true;\n        }\n        function watchFilePath(path, file, callback, pollingInterval, options, watchType) {\n            return watchFile(file, function (fileName, eventKind) { return callback(fileName, eventKind, path); }, pollingInterval, options, watchType);\n        }\n        function onSourceFileChange(fileName, eventKind, path) {\n            updateCachedSystemWithFile(fileName, path, eventKind);\n            // Update the source file cache\n            if (eventKind === ts.FileWatcherEventKind.Deleted && sourceFilesCache.has(path)) {\n                resolutionCache.invalidateResolutionOfFile(path);\n            }\n            resolutionCache.removeResolutionsFromProjectReferenceRedirects(path);\n            nextSourceFileVersion(path);\n            // Update the program\n            scheduleProgramUpdate();\n        }\n        function updateCachedSystemWithFile(fileName, path, eventKind) {\n            if (cachedDirectoryStructureHost) {\n                cachedDirectoryStructureHost.addOrDeleteFile(fileName, path, eventKind);\n            }\n        }\n        function watchMissingFilePath(missingFilePath) {\n            return watchFilePath(missingFilePath, missingFilePath, onMissingFileChange, ts.PollingInterval.Medium, watchOptions, ts.WatchType.MissingFile);\n        }\n        function onMissingFileChange(fileName, eventKind, missingFilePath) {\n            updateCachedSystemWithFile(fileName, missingFilePath, eventKind);\n            if (eventKind === ts.FileWatcherEventKind.Created && missingFilesMap.has(missingFilePath)) {\n                missingFilesMap.get(missingFilePath).close();\n                missingFilesMap.delete(missingFilePath);\n                // Delete the entry in the source files cache so that new source file is created\n                nextSourceFileVersion(missingFilePath);\n                // When a missing file is created, we should update the graph.\n                scheduleProgramUpdate();\n            }\n        }\n        function watchConfigFileWildCardDirectories() {\n            if (wildcardDirectories) {\n                ts.updateWatchingWildcardDirectories(watchedWildcardDirectories || (watchedWildcardDirectories = new ts.Map()), new ts.Map(ts.getEntries(wildcardDirectories)), watchWildcardDirectory);\n            }\n            else if (watchedWildcardDirectories) {\n                ts.clearMap(watchedWildcardDirectories, ts.closeFileWatcherOf);\n            }\n        }\n        function watchWildcardDirectory(directory, flags) {\n            return watchDirectory(directory, function (fileOrDirectory) {\n                ts.Debug.assert(!!configFileName);\n                var fileOrDirectoryPath = toPath(fileOrDirectory);\n                // Since the file existence changed, update the sourceFiles cache\n                if (cachedDirectoryStructureHost) {\n                    cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);\n                }\n                nextSourceFileVersion(fileOrDirectoryPath);\n                if (ts.isIgnoredFileFromWildCardWatching({\n                    watchedDirPath: toPath(directory),\n                    fileOrDirectory: fileOrDirectory,\n                    fileOrDirectoryPath: fileOrDirectoryPath,\n                    configFileName: configFileName,\n                    extraFileExtensions: extraFileExtensions,\n                    options: compilerOptions,\n                    program: getCurrentBuilderProgram(),\n                    currentDirectory: currentDirectory,\n                    useCaseSensitiveFileNames: useCaseSensitiveFileNames,\n                    writeLog: writeLog\n                }))\n                    return;\n                // Reload is pending, do the reload\n                if (reloadLevel !== ts.ConfigFileProgramReloadLevel.Full) {\n                    reloadLevel = ts.ConfigFileProgramReloadLevel.Partial;\n                    // Schedule Update the program\n                    scheduleProgramUpdate();\n                }\n            }, flags, watchOptions, ts.WatchType.WildcardDirectory);\n        }\n        function watchExtendedConfigFiles() {\n            var _a;\n            // Update the extended config files watcher\n            ts.mutateMap(extendedConfigFilesMap || (extendedConfigFilesMap = new ts.Map()), ts.arrayToMap(((_a = compilerOptions.configFile) === null || _a === void 0 ? void 0 : _a.extendedSourceFiles) || ts.emptyArray, toPath), {\n                // Watch the extended config files\n                createNewValue: watchExtendedConfigFile,\n                // Config files that are no longer extended should no longer be watched.\n                onDeleteValue: ts.closeFileWatcher\n            });\n        }\n        function watchExtendedConfigFile(extendedConfigFile) {\n            return watchFile(extendedConfigFile, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ExtendedConfigFile);\n        }\n    }\n    ts.createWatchProgram = createWatchProgram;\n})(ts || (ts = {}));\n/*@internal*/\nvar ts;\n(function (ts) {\n    var UpToDateStatusType;\n    (function (UpToDateStatusType) {\n        UpToDateStatusType[UpToDateStatusType[\"Unbuildable\"] = 0] = \"Unbuildable\";\n        UpToDateStatusType[UpToDateStatusType[\"UpToDate\"] = 1] = \"UpToDate\";\n        /**\n         * The project appears out of date because its upstream inputs are newer than its outputs,\n         * but all of its outputs are actually newer than the previous identical outputs of its (.d.ts) inputs.\n         * This means we can Pseudo-build (just touch timestamps), as if we had actually built this project.\n         */\n        UpToDateStatusType[UpToDateStatusType[\"UpToDateWithUpstreamTypes\"] = 2] = \"UpToDateWithUpstreamTypes\";\n        /**\n         * The project appears out of date because its upstream inputs are newer than its outputs,\n         * but all of its outputs are actually newer than the previous identical outputs of its (.d.ts) inputs.\n         * This means we can Pseudo-build (just manipulate outputs), as if we had actually built this project.\n         */\n        UpToDateStatusType[UpToDateStatusType[\"OutOfDateWithPrepend\"] = 3] = \"OutOfDateWithPrepend\";\n        UpToDateStatusType[UpToDateStatusType[\"OutputMissing\"] = 4] = \"OutputMissing\";\n        UpToDateStatusType[UpToDateStatusType[\"OutOfDateWithSelf\"] = 5] = \"OutOfDateWithSelf\";\n        UpToDateStatusType[UpToDateStatusType[\"OutOfDateWithUpstream\"] = 6] = \"OutOfDateWithUpstream\";\n        UpToDateStatusType[UpToDateStatusType[\"UpstreamOutOfDate\"] = 7] = \"UpstreamOutOfDate\";\n        UpToDateStatusType[UpToDateStatusType[\"UpstreamBlocked\"] = 8] = \"UpstreamBlocked\";\n        UpToDateStatusType[UpToDateStatusType[\"ComputingUpstream\"] = 9] = \"ComputingUpstream\";\n        UpToDateStatusType[UpToDateStatusType[\"TsVersionOutputOfDate\"] = 10] = \"TsVersionOutputOfDate\";\n        /**\n         * Projects with no outputs (i.e. \"solution\" files)\n         */\n        UpToDateStatusType[UpToDateStatusType[\"ContainerOnly\"] = 11] = \"ContainerOnly\";\n    })(UpToDateStatusType = ts.UpToDateStatusType || (ts.UpToDateStatusType = {}));\n    function resolveConfigFileProjectName(project) {\n        if (ts.fileExtensionIs(project, \".json\" /* Json */)) {\n            return project;\n        }\n        return ts.combinePaths(project, \"tsconfig.json\");\n    }\n    ts.resolveConfigFileProjectName = resolveConfigFileProjectName;\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    var minimumDate = new Date(-8640000000000000);\n    var maximumDate = new Date(8640000000000000);\n    var BuildResultFlags;\n    (function (BuildResultFlags) {\n        BuildResultFlags[BuildResultFlags[\"None\"] = 0] = \"None\";\n        /**\n         * No errors of any kind occurred during build\n         */\n        BuildResultFlags[BuildResultFlags[\"Success\"] = 1] = \"Success\";\n        /**\n         * None of the .d.ts files emitted by this build were\n         * different from the existing files on disk\n         */\n        BuildResultFlags[BuildResultFlags[\"DeclarationOutputUnchanged\"] = 2] = \"DeclarationOutputUnchanged\";\n        BuildResultFlags[BuildResultFlags[\"ConfigFileErrors\"] = 4] = \"ConfigFileErrors\";\n        BuildResultFlags[BuildResultFlags[\"SyntaxErrors\"] = 8] = \"SyntaxErrors\";\n        BuildResultFlags[BuildResultFlags[\"TypeErrors\"] = 16] = \"TypeErrors\";\n        BuildResultFlags[BuildResultFlags[\"DeclarationEmitErrors\"] = 32] = \"DeclarationEmitErrors\";\n        BuildResultFlags[BuildResultFlags[\"EmitErrors\"] = 64] = \"EmitErrors\";\n        BuildResultFlags[BuildResultFlags[\"AnyErrors\"] = 124] = \"AnyErrors\";\n    })(BuildResultFlags || (BuildResultFlags = {}));\n    function getOrCreateValueFromConfigFileMap(configFileMap, resolved, createT) {\n        var existingValue = configFileMap.get(resolved);\n        var newValue;\n        if (!existingValue) {\n            newValue = createT();\n            configFileMap.set(resolved, newValue);\n        }\n        return existingValue || newValue;\n    }\n    function getOrCreateValueMapFromConfigFileMap(configFileMap, resolved) {\n        return getOrCreateValueFromConfigFileMap(configFileMap, resolved, function () { return new ts.Map(); });\n    }\n    function newer(date1, date2) {\n        return date2 > date1 ? date2 : date1;\n    }\n    function isDeclarationFile(fileName) {\n        return ts.fileExtensionIs(fileName, \".d.ts\" /* Dts */);\n    }\n    /*@internal*/\n    function isCircularBuildOrder(buildOrder) {\n        return !!buildOrder && !!buildOrder.buildOrder;\n    }\n    ts.isCircularBuildOrder = isCircularBuildOrder;\n    /*@internal*/\n    function getBuildOrderFromAnyBuildOrder(anyBuildOrder) {\n        return isCircularBuildOrder(anyBuildOrder) ? anyBuildOrder.buildOrder : anyBuildOrder;\n    }\n    ts.getBuildOrderFromAnyBuildOrder = getBuildOrderFromAnyBuildOrder;\n    /**\n     * Create a function that reports watch status by writing to the system and handles the formating of the diagnostic\n     */\n    function createBuilderStatusReporter(system, pretty) {\n        return function (diagnostic) {\n            var output = pretty ? \"[\" + ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + \"] \" : ts.getLocaleTimeString(system) + \" - \";\n            output += \"\" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (system.newLine + system.newLine);\n            system.write(output);\n        };\n    }\n    ts.createBuilderStatusReporter = createBuilderStatusReporter;\n    function createSolutionBuilderHostBase(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus) {\n        var host = ts.createProgramHost(system, createProgram);\n        host.getModifiedTime = system.getModifiedTime ? function (path) { return system.getModifiedTime(path); } : ts.returnUndefined;\n        host.setModifiedTime = system.setModifiedTime ? function (path, date) { return system.setModifiedTime(path, date); } : ts.noop;\n        host.deleteFile = system.deleteFile ? function (path) { return system.deleteFile(path); } : ts.noop;\n        host.reportDiagnostic = reportDiagnostic || ts.createDiagnosticReporter(system);\n        host.reportSolutionBuilderStatus = reportSolutionBuilderStatus || createBuilderStatusReporter(system);\n        host.now = ts.maybeBind(system, system.now); // For testing\n        return host;\n    }\n    function createSolutionBuilderHost(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus, reportErrorSummary) {\n        if (system === void 0) { system = ts.sys; }\n        var host = createSolutionBuilderHostBase(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus);\n        host.reportErrorSummary = reportErrorSummary;\n        return host;\n    }\n    ts.createSolutionBuilderHost = createSolutionBuilderHost;\n    function createSolutionBuilderWithWatchHost(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus, reportWatchStatus) {\n        if (system === void 0) { system = ts.sys; }\n        var host = createSolutionBuilderHostBase(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus);\n        var watchHost = ts.createWatchHost(system, reportWatchStatus);\n        ts.copyProperties(host, watchHost);\n        return host;\n    }\n    ts.createSolutionBuilderWithWatchHost = createSolutionBuilderWithWatchHost;\n    function getCompilerOptionsOfBuildOptions(buildOptions) {\n        var result = {};\n        ts.commonOptionsWithBuild.forEach(function (option) {\n            if (ts.hasProperty(buildOptions, option.name))\n                result[option.name] = buildOptions[option.name];\n        });\n        return result;\n    }\n    function createSolutionBuilder(host, rootNames, defaultOptions) {\n        return createSolutionBuilderWorker(/*watch*/ false, host, rootNames, defaultOptions);\n    }\n    ts.createSolutionBuilder = createSolutionBuilder;\n    function createSolutionBuilderWithWatch(host, rootNames, defaultOptions, baseWatchOptions) {\n        return createSolutionBuilderWorker(/*watch*/ true, host, rootNames, defaultOptions, baseWatchOptions);\n    }\n    ts.createSolutionBuilderWithWatch = createSolutionBuilderWithWatch;\n    function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions) {\n        var host = hostOrHostWithWatch;\n        var hostWithWatch = hostOrHostWithWatch;\n        var currentDirectory = host.getCurrentDirectory();\n        var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());\n        // State of the solution\n        var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);\n        var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return state.projectCompilerOptions; });\n        ts.setGetSourceFileAsHashVersioned(compilerHost, host);\n        compilerHost.getParsedCommandLine = function (fileName) { return parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); };\n        compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames);\n        compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives);\n        var moduleResolutionCache = !compilerHost.resolveModuleNames ? ts.createModuleResolutionCache(currentDirectory, getCanonicalFileName) : undefined;\n        if (!compilerHost.resolveModuleNames) {\n            var loader_3 = function (moduleName, containingFile, redirectedReference) { return ts.resolveModuleName(moduleName, containingFile, state.projectCompilerOptions, compilerHost, moduleResolutionCache, redirectedReference).resolvedModule; };\n            compilerHost.resolveModuleNames = function (moduleNames, containingFile, _reusedNames, redirectedReference) {\n                return ts.loadWithLocalCache(ts.Debug.checkEachDefined(moduleNames), containingFile, redirectedReference, loader_3);\n            };\n        }\n        var _a = ts.createWatchFactory(hostWithWatch, options), watchFile = _a.watchFile, watchDirectory = _a.watchDirectory, writeLog = _a.writeLog;\n        var state = {\n            host: host,\n            hostWithWatch: hostWithWatch,\n            currentDirectory: currentDirectory,\n            getCanonicalFileName: getCanonicalFileName,\n            parseConfigFileHost: ts.parseConfigHostFromCompilerHostLike(host),\n            write: ts.maybeBind(host, host.trace),\n            // State of solution\n            options: options,\n            baseCompilerOptions: baseCompilerOptions,\n            rootNames: rootNames,\n            baseWatchOptions: baseWatchOptions,\n            resolvedConfigFilePaths: new ts.Map(),\n            configFileCache: new ts.Map(),\n            projectStatus: new ts.Map(),\n            buildInfoChecked: new ts.Map(),\n            extendedConfigCache: new ts.Map(),\n            builderPrograms: new ts.Map(),\n            diagnostics: new ts.Map(),\n            projectPendingBuild: new ts.Map(),\n            projectErrorsReported: new ts.Map(),\n            compilerHost: compilerHost,\n            moduleResolutionCache: moduleResolutionCache,\n            // Mutable state\n            buildOrder: undefined,\n            readFileWithCache: function (f) { return host.readFile(f); },\n            projectCompilerOptions: baseCompilerOptions,\n            cache: undefined,\n            allProjectBuildPending: true,\n            needsSummary: true,\n            watchAllProjectsPending: watch,\n            currentInvalidatedProject: undefined,\n            // Watch state\n            watch: watch,\n            allWatchedWildcardDirectories: new ts.Map(),\n            allWatchedInputFiles: new ts.Map(),\n            allWatchedConfigFiles: new ts.Map(),\n            allWatchedExtendedConfigFiles: new ts.Map(),\n            timerToBuildInvalidatedProject: undefined,\n            reportFileChangeDetected: false,\n            watchFile: watchFile,\n            watchDirectory: watchDirectory,\n            writeLog: writeLog,\n        };\n        return state;\n    }\n    function toPath(state, fileName) {\n        return ts.toPath(fileName, state.currentDirectory, state.getCanonicalFileName);\n    }\n    function toResolvedConfigFilePath(state, fileName) {\n        var resolvedConfigFilePaths = state.resolvedConfigFilePaths;\n        var path = resolvedConfigFilePaths.get(fileName);\n        if (path !== undefined)\n            return path;\n        var resolvedPath = toPath(state, fileName);\n        resolvedConfigFilePaths.set(fileName, resolvedPath);\n        return resolvedPath;\n    }\n    function isParsedCommandLine(entry) {\n        return !!entry.options;\n    }\n    function parseConfigFile(state, configFileName, configFilePath) {\n        var configFileCache = state.configFileCache;\n        var value = configFileCache.get(configFilePath);\n        if (value) {\n            return isParsedCommandLine(value) ? value : undefined;\n        }\n        var diagnostic;\n        var parseConfigFileHost = state.parseConfigFileHost, baseCompilerOptions = state.baseCompilerOptions, baseWatchOptions = state.baseWatchOptions, extendedConfigCache = state.extendedConfigCache, host = state.host;\n        var parsed;\n        if (host.getParsedCommandLine) {\n            parsed = host.getParsedCommandLine(configFileName);\n            if (!parsed)\n                diagnostic = ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, configFileName);\n        }\n        else {\n            parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = function (d) { return diagnostic = d; };\n            parsed = ts.getParsedCommandLineOfConfigFile(configFileName, baseCompilerOptions, parseConfigFileHost, extendedConfigCache, baseWatchOptions);\n            parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = ts.noop;\n        }\n        configFileCache.set(configFilePath, parsed || diagnostic);\n        return parsed;\n    }\n    function resolveProjectName(state, name) {\n        return ts.resolveConfigFileProjectName(ts.resolvePath(state.currentDirectory, name));\n    }\n    function createBuildOrder(state, roots) {\n        var temporaryMarks = new ts.Map();\n        var permanentMarks = new ts.Map();\n        var circularityReportStack = [];\n        var buildOrder;\n        var circularDiagnostics;\n        for (var _i = 0, roots_1 = roots; _i < roots_1.length; _i++) {\n            var root = roots_1[_i];\n            visit(root);\n        }\n        return circularDiagnostics ?\n            { buildOrder: buildOrder || ts.emptyArray, circularDiagnostics: circularDiagnostics } :\n            buildOrder || ts.emptyArray;\n        function visit(configFileName, inCircularContext) {\n            var projPath = toResolvedConfigFilePath(state, configFileName);\n            // Already visited\n            if (permanentMarks.has(projPath))\n                return;\n            // Circular\n            if (temporaryMarks.has(projPath)) {\n                if (!inCircularContext) {\n                    (circularDiagnostics || (circularDiagnostics = [])).push(ts.createCompilerDiagnostic(ts.Diagnostics.Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0, circularityReportStack.join(\"\\r\\n\")));\n                }\n                return;\n            }\n            temporaryMarks.set(projPath, true);\n            circularityReportStack.push(configFileName);\n            var parsed = parseConfigFile(state, configFileName, projPath);\n            if (parsed && parsed.projectReferences) {\n                for (var _i = 0, _a = parsed.projectReferences; _i < _a.length; _i++) {\n                    var ref = _a[_i];\n                    var resolvedRefPath = resolveProjectName(state, ref.path);\n                    visit(resolvedRefPath, inCircularContext || ref.circular);\n                }\n            }\n            circularityReportStack.pop();\n            permanentMarks.set(projPath, true);\n            (buildOrder || (buildOrder = [])).push(configFileName);\n        }\n    }\n    function getBuildOrder(state) {\n        return state.buildOrder || createStateBuildOrder(state);\n    }\n    function createStateBuildOrder(state) {\n        var buildOrder = createBuildOrder(state, state.rootNames.map(function (f) { return resolveProjectName(state, f); }));\n        // Clear all to ResolvedConfigFilePaths cache to start fresh\n        state.resolvedConfigFilePaths.clear();\n        // TODO(rbuckton): Should be a `Set`, but that requires changing the code below that uses `mutateMapSkippingNewValues`\n        var currentProjects = new ts.Map(getBuildOrderFromAnyBuildOrder(buildOrder).map(function (resolved) { return [toResolvedConfigFilePath(state, resolved), true]; }));\n        var noopOnDelete = { onDeleteValue: ts.noop };\n        // Config file cache\n        ts.mutateMapSkippingNewValues(state.configFileCache, currentProjects, noopOnDelete);\n        ts.mutateMapSkippingNewValues(state.projectStatus, currentProjects, noopOnDelete);\n        ts.mutateMapSkippingNewValues(state.buildInfoChecked, currentProjects, noopOnDelete);\n        ts.mutateMapSkippingNewValues(state.builderPrograms, currentProjects, noopOnDelete);\n        ts.mutateMapSkippingNewValues(state.diagnostics, currentProjects, noopOnDelete);\n        ts.mutateMapSkippingNewValues(state.projectPendingBuild, currentProjects, noopOnDelete);\n        ts.mutateMapSkippingNewValues(state.projectErrorsReported, currentProjects, noopOnDelete);\n        // Remove watches for the program no longer in the solution\n        if (state.watch) {\n            ts.mutateMapSkippingNewValues(state.allWatchedConfigFiles, currentProjects, { onDeleteValue: ts.closeFileWatcher });\n            state.allWatchedExtendedConfigFiles.forEach(function (watcher) {\n                watcher.projects.forEach(function (project) {\n                    if (!currentProjects.has(project)) {\n                        watcher.projects.delete(project);\n                    }\n                });\n                watcher.close();\n            });\n            ts.mutateMapSkippingNewValues(state.allWatchedWildcardDirectories, currentProjects, { onDeleteValue: function (existingMap) { return existingMap.forEach(ts.closeFileWatcherOf); } });\n            ts.mutateMapSkippingNewValues(state.allWatchedInputFiles, currentProjects, { onDeleteValue: function (existingMap) { return existingMap.forEach(ts.closeFileWatcher); } });\n        }\n        return state.buildOrder = buildOrder;\n    }\n    function getBuildOrderFor(state, project, onlyReferences) {\n        var resolvedProject = project && resolveProjectName(state, project);\n        var buildOrderFromState = getBuildOrder(state);\n        if (isCircularBuildOrder(buildOrderFromState))\n            return buildOrderFromState;\n        if (resolvedProject) {\n            var projectPath_1 = toResolvedConfigFilePath(state, resolvedProject);\n            var projectIndex = ts.findIndex(buildOrderFromState, function (configFileName) { return toResolvedConfigFilePath(state, configFileName) === projectPath_1; });\n            if (projectIndex === -1)\n                return undefined;\n        }\n        var buildOrder = resolvedProject ? createBuildOrder(state, [resolvedProject]) : buildOrderFromState;\n        ts.Debug.assert(!isCircularBuildOrder(buildOrder));\n        ts.Debug.assert(!onlyReferences || resolvedProject !== undefined);\n        ts.Debug.assert(!onlyReferences || buildOrder[buildOrder.length - 1] === resolvedProject);\n        return onlyReferences ? buildOrder.slice(0, buildOrder.length - 1) : buildOrder;\n    }\n    function enableCache(state) {\n        if (state.cache) {\n            disableCache(state);\n        }\n        var compilerHost = state.compilerHost, host = state.host;\n        var originalReadFileWithCache = state.readFileWithCache;\n        var originalGetSourceFile = compilerHost.getSourceFile;\n        var _a = ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return toPath(state, fileName); }, function () {\n            var args = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                args[_i] = arguments[_i];\n            }\n            return originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArray([compilerHost], args));\n        }), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, getSourceFileWithCache = _a.getSourceFileWithCache, readFileWithCache = _a.readFileWithCache;\n        state.readFileWithCache = readFileWithCache;\n        compilerHost.getSourceFile = getSourceFileWithCache;\n        state.cache = {\n            originalReadFile: originalReadFile,\n            originalFileExists: originalFileExists,\n            originalDirectoryExists: originalDirectoryExists,\n            originalCreateDirectory: originalCreateDirectory,\n            originalWriteFile: originalWriteFile,\n            originalReadFileWithCache: originalReadFileWithCache,\n            originalGetSourceFile: originalGetSourceFile,\n        };\n    }\n    function disableCache(state) {\n        if (!state.cache)\n            return;\n        var cache = state.cache, host = state.host, compilerHost = state.compilerHost, extendedConfigCache = state.extendedConfigCache, moduleResolutionCache = state.moduleResolutionCache;\n        host.readFile = cache.originalReadFile;\n        host.fileExists = cache.originalFileExists;\n        host.directoryExists = cache.originalDirectoryExists;\n        host.createDirectory = cache.originalCreateDirectory;\n        host.writeFile = cache.originalWriteFile;\n        compilerHost.getSourceFile = cache.originalGetSourceFile;\n        state.readFileWithCache = cache.originalReadFileWithCache;\n        extendedConfigCache.clear();\n        if (moduleResolutionCache) {\n            moduleResolutionCache.directoryToModuleNameMap.clear();\n            moduleResolutionCache.moduleNameToDirectoryMap.clear();\n        }\n        state.cache = undefined;\n    }\n    function clearProjectStatus(state, resolved) {\n        state.projectStatus.delete(resolved);\n        state.diagnostics.delete(resolved);\n    }\n    function addProjToQueue(_a, proj, reloadLevel) {\n        var projectPendingBuild = _a.projectPendingBuild;\n        var value = projectPendingBuild.get(proj);\n        if (value === undefined) {\n            projectPendingBuild.set(proj, reloadLevel);\n        }\n        else if (value < reloadLevel) {\n            projectPendingBuild.set(proj, reloadLevel);\n        }\n    }\n    function setupInitialBuild(state, cancellationToken) {\n        // Set initial build if not already built\n        if (!state.allProjectBuildPending)\n            return;\n        state.allProjectBuildPending = false;\n        if (state.options.watch) {\n            reportWatchStatus(state, ts.Diagnostics.Starting_compilation_in_watch_mode);\n        }\n        enableCache(state);\n        var buildOrder = getBuildOrderFromAnyBuildOrder(getBuildOrder(state));\n        buildOrder.forEach(function (configFileName) {\n            return state.projectPendingBuild.set(toResolvedConfigFilePath(state, configFileName), ts.ConfigFileProgramReloadLevel.None);\n        });\n        if (cancellationToken) {\n            cancellationToken.throwIfCancellationRequested();\n        }\n    }\n    var InvalidatedProjectKind;\n    (function (InvalidatedProjectKind) {\n        InvalidatedProjectKind[InvalidatedProjectKind[\"Build\"] = 0] = \"Build\";\n        InvalidatedProjectKind[InvalidatedProjectKind[\"UpdateBundle\"] = 1] = \"UpdateBundle\";\n        InvalidatedProjectKind[InvalidatedProjectKind[\"UpdateOutputFileStamps\"] = 2] = \"UpdateOutputFileStamps\";\n    })(InvalidatedProjectKind = ts.InvalidatedProjectKind || (ts.InvalidatedProjectKind = {}));\n    function doneInvalidatedProject(state, projectPath) {\n        state.projectPendingBuild.delete(projectPath);\n        state.currentInvalidatedProject = undefined;\n        return state.diagnostics.has(projectPath) ?\n            ts.ExitStatus.DiagnosticsPresent_OutputsSkipped :\n            ts.ExitStatus.Success;\n    }\n    function createUpdateOutputFileStampsProject(state, project, projectPath, config, buildOrder) {\n        var updateOutputFileStampsPending = true;\n        return {\n            kind: InvalidatedProjectKind.UpdateOutputFileStamps,\n            project: project,\n            projectPath: projectPath,\n            buildOrder: buildOrder,\n            getCompilerOptions: function () { return config.options; },\n            getCurrentDirectory: function () { return state.currentDirectory; },\n            updateOutputFileStatmps: function () {\n                updateOutputTimestamps(state, config, projectPath);\n                updateOutputFileStampsPending = false;\n            },\n            done: function () {\n                if (updateOutputFileStampsPending) {\n                    updateOutputTimestamps(state, config, projectPath);\n                }\n                return doneInvalidatedProject(state, projectPath);\n            }\n        };\n    }\n    var BuildStep;\n    (function (BuildStep) {\n        BuildStep[BuildStep[\"CreateProgram\"] = 0] = \"CreateProgram\";\n        BuildStep[BuildStep[\"SyntaxDiagnostics\"] = 1] = \"SyntaxDiagnostics\";\n        BuildStep[BuildStep[\"SemanticDiagnostics\"] = 2] = \"SemanticDiagnostics\";\n        BuildStep[BuildStep[\"Emit\"] = 3] = \"Emit\";\n        BuildStep[BuildStep[\"EmitBundle\"] = 4] = \"EmitBundle\";\n        BuildStep[BuildStep[\"EmitBuildInfo\"] = 5] = \"EmitBuildInfo\";\n        BuildStep[BuildStep[\"BuildInvalidatedProjectOfBundle\"] = 6] = \"BuildInvalidatedProjectOfBundle\";\n        BuildStep[BuildStep[\"QueueReferencingProjects\"] = 7] = \"QueueReferencingProjects\";\n        BuildStep[BuildStep[\"Done\"] = 8] = \"Done\";\n    })(BuildStep || (BuildStep = {}));\n    function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath, projectIndex, config, buildOrder) {\n        var step = kind === InvalidatedProjectKind.Build ? BuildStep.CreateProgram : BuildStep.EmitBundle;\n        var program;\n        var buildResult;\n        var invalidatedProjectOfBundle;\n        return kind === InvalidatedProjectKind.Build ?\n            {\n                kind: kind,\n                project: project,\n                projectPath: projectPath,\n                buildOrder: buildOrder,\n                getCompilerOptions: function () { return config.options; },\n                getCurrentDirectory: function () { return state.currentDirectory; },\n                getBuilderProgram: function () { return withProgramOrUndefined(ts.identity); },\n                getProgram: function () {\n                    return withProgramOrUndefined(function (program) { return program.getProgramOrUndefined(); });\n                },\n                getSourceFile: function (fileName) {\n                    return withProgramOrUndefined(function (program) { return program.getSourceFile(fileName); });\n                },\n                getSourceFiles: function () {\n                    return withProgramOrEmptyArray(function (program) { return program.getSourceFiles(); });\n                },\n                getOptionsDiagnostics: function (cancellationToken) {\n                    return withProgramOrEmptyArray(function (program) { return program.getOptionsDiagnostics(cancellationToken); });\n                },\n                getGlobalDiagnostics: function (cancellationToken) {\n                    return withProgramOrEmptyArray(function (program) { return program.getGlobalDiagnostics(cancellationToken); });\n                },\n                getConfigFileParsingDiagnostics: function () {\n                    return withProgramOrEmptyArray(function (program) { return program.getConfigFileParsingDiagnostics(); });\n                },\n                getSyntacticDiagnostics: function (sourceFile, cancellationToken) {\n                    return withProgramOrEmptyArray(function (program) { return program.getSyntacticDiagnostics(sourceFile, cancellationToken); });\n                },\n                getAllDependencies: function (sourceFile) {\n                    return withProgramOrEmptyArray(function (program) { return program.getAllDependencies(sourceFile); });\n                },\n                getSemanticDiagnostics: function (sourceFile, cancellationToken) {\n                    return withProgramOrEmptyArray(function (program) { return program.getSemanticDiagnostics(sourceFile, cancellationToken); });\n                },\n                getSemanticDiagnosticsOfNextAffectedFile: function (cancellationToken, ignoreSourceFile) {\n                    return withProgramOrUndefined(function (program) {\n                        return (program.getSemanticDiagnosticsOfNextAffectedFile) &&\n                            program.getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile);\n                    });\n                },\n                emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {\n                    if (targetSourceFile || emitOnlyDtsFiles) {\n                        return withProgramOrUndefined(function (program) { return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); });\n                    }\n                    executeSteps(BuildStep.SemanticDiagnostics, cancellationToken);\n                    if (step === BuildStep.EmitBuildInfo) {\n                        return emitBuildInfo(writeFile, cancellationToken);\n                    }\n                    if (step !== BuildStep.Emit)\n                        return undefined;\n                    return emit(writeFile, cancellationToken, customTransformers);\n                },\n                done: done\n            } :\n            {\n                kind: kind,\n                project: project,\n                projectPath: projectPath,\n                buildOrder: buildOrder,\n                getCompilerOptions: function () { return config.options; },\n                getCurrentDirectory: function () { return state.currentDirectory; },\n                emit: function (writeFile, customTransformers) {\n                    if (step !== BuildStep.EmitBundle)\n                        return invalidatedProjectOfBundle;\n                    return emitBundle(writeFile, customTransformers);\n                },\n                done: done,\n            };\n        function done(cancellationToken, writeFile, customTransformers) {\n            executeSteps(BuildStep.Done, cancellationToken, writeFile, customTransformers);\n            return doneInvalidatedProject(state, projectPath);\n        }\n        function withProgramOrUndefined(action) {\n            executeSteps(BuildStep.CreateProgram);\n            return program && action(program);\n        }\n        function withProgramOrEmptyArray(action) {\n            return withProgramOrUndefined(action) || ts.emptyArray;\n        }\n        function createProgram() {\n            ts.Debug.assert(program === undefined);\n            if (state.options.dry) {\n                reportStatus(state, ts.Diagnostics.A_non_dry_build_would_build_project_0, project);\n                buildResult = BuildResultFlags.Success;\n                step = BuildStep.QueueReferencingProjects;\n                return;\n            }\n            if (state.options.verbose)\n                reportStatus(state, ts.Diagnostics.Building_project_0, project);\n            if (config.fileNames.length === 0) {\n                reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));\n                // Nothing to build - must be a solution file, basically\n                buildResult = BuildResultFlags.None;\n                step = BuildStep.QueueReferencingProjects;\n                return;\n            }\n            var host = state.host, compilerHost = state.compilerHost;\n            state.projectCompilerOptions = config.options;\n            // Update module resolution cache if needed\n            updateModuleResolutionCache(state, project, config);\n            // Create program\n            program = host.createProgram(config.fileNames, config.options, compilerHost, getOldProgram(state, projectPath, config), ts.getConfigFileParsingDiagnostics(config), config.projectReferences);\n            if (state.watch) {\n                state.builderPrograms.set(projectPath, program);\n            }\n            step++;\n        }\n        function handleDiagnostics(diagnostics, errorFlags, errorType) {\n            var _a;\n            if (diagnostics.length) {\n                (_a = buildErrors(state, projectPath, program, config, diagnostics, errorFlags, errorType), buildResult = _a.buildResult, step = _a.step);\n            }\n            else {\n                step++;\n            }\n        }\n        function getSyntaxDiagnostics(cancellationToken) {\n            ts.Debug.assertIsDefined(program);\n            handleDiagnostics(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], program.getConfigFileParsingDiagnostics()), program.getOptionsDiagnostics(cancellationToken)), program.getGlobalDiagnostics(cancellationToken)), program.getSyntacticDiagnostics(/*sourceFile*/ undefined, cancellationToken)), BuildResultFlags.SyntaxErrors, \"Syntactic\");\n        }\n        function getSemanticDiagnostics(cancellationToken) {\n            handleDiagnostics(ts.Debug.checkDefined(program).getSemanticDiagnostics(/*sourceFile*/ undefined, cancellationToken), BuildResultFlags.TypeErrors, \"Semantic\");\n        }\n        function emit(writeFileCallback, cancellationToken, customTransformers) {\n            var _a;\n            ts.Debug.assertIsDefined(program);\n            ts.Debug.assert(step === BuildStep.Emit);\n            // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly\n            program.backupState();\n            var declDiagnostics;\n            var reportDeclarationDiagnostics = function (d) { return (declDiagnostics || (declDiagnostics = [])).push(d); };\n            var outputFiles = [];\n            var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, \n            /*write*/ undefined, \n            /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, \n            /*emitOnlyDts*/ false, customTransformers).emitResult;\n            // Don't emit .d.ts if there are decl file errors\n            if (declDiagnostics) {\n                program.restoreState();\n                (_a = buildErrors(state, projectPath, program, config, declDiagnostics, BuildResultFlags.DeclarationEmitErrors, \"Declaration file\"), buildResult = _a.buildResult, step = _a.step);\n                return {\n                    emitSkipped: true,\n                    diagnostics: emitResult.diagnostics\n                };\n            }\n            // Actual Emit\n            var host = state.host, compilerHost = state.compilerHost;\n            var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;\n            var newestDeclarationFileContentChangedTime = minimumDate;\n            var anyDtsChanged = false;\n            var emitterDiagnostics = ts.createDiagnosticCollection();\n            var emittedOutputs = new ts.Map();\n            outputFiles.forEach(function (_a) {\n                var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;\n                var priorChangeTime;\n                if (!anyDtsChanged && isDeclarationFile(name)) {\n                    // Check for unchanged .d.ts files\n                    if (host.fileExists(name) && state.readFileWithCache(name) === text) {\n                        priorChangeTime = host.getModifiedTime(name);\n                    }\n                    else {\n                        resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;\n                        anyDtsChanged = true;\n                    }\n                }\n                emittedOutputs.set(toPath(state, name), name);\n                ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);\n                if (priorChangeTime !== undefined) {\n                    newestDeclarationFileContentChangedTime = newer(priorChangeTime, newestDeclarationFileContentChangedTime);\n                }\n            });\n            finishEmit(emitterDiagnostics, emittedOutputs, newestDeclarationFileContentChangedTime, \n            /*newestDeclarationFileContentChangedTimeIsMaximumDate*/ anyDtsChanged, outputFiles.length ? outputFiles[0].name : ts.getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()), resultFlags);\n            return emitResult;\n        }\n        function emitBuildInfo(writeFileCallback, cancellationToken) {\n            ts.Debug.assertIsDefined(program);\n            ts.Debug.assert(step === BuildStep.EmitBuildInfo);\n            var emitResult = program.emitBuildInfo(writeFileCallback, cancellationToken);\n            if (emitResult.diagnostics.length) {\n                reportErrors(state, emitResult.diagnostics);\n                state.diagnostics.set(projectPath, __spreadArray(__spreadArray([], state.diagnostics.get(projectPath)), emitResult.diagnostics));\n                buildResult = BuildResultFlags.EmitErrors & buildResult;\n            }\n            if (emitResult.emittedFiles && state.write) {\n                emitResult.emittedFiles.forEach(function (name) { return listEmittedFile(state, config, name); });\n            }\n            afterProgramDone(state, program, config);\n            step = BuildStep.QueueReferencingProjects;\n            return emitResult;\n        }\n        function finishEmit(emitterDiagnostics, emittedOutputs, priorNewestUpdateTime, newestDeclarationFileContentChangedTimeIsMaximumDate, oldestOutputFileName, resultFlags) {\n            var _a;\n            var emitDiagnostics = emitterDiagnostics.getDiagnostics();\n            if (emitDiagnostics.length) {\n                (_a = buildErrors(state, projectPath, program, config, emitDiagnostics, BuildResultFlags.EmitErrors, \"Emit\"), buildResult = _a.buildResult, step = _a.step);\n                return emitDiagnostics;\n            }\n            if (state.write) {\n                emittedOutputs.forEach(function (name) { return listEmittedFile(state, config, name); });\n            }\n            // Update time stamps for rest of the outputs\n            var newestDeclarationFileContentChangedTime = updateOutputTimestampsWorker(state, config, priorNewestUpdateTime, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);\n            state.diagnostics.delete(projectPath);\n            state.projectStatus.set(projectPath, {\n                type: ts.UpToDateStatusType.UpToDate,\n                newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTimeIsMaximumDate ?\n                    maximumDate :\n                    newestDeclarationFileContentChangedTime,\n                oldestOutputFileName: oldestOutputFileName\n            });\n            afterProgramDone(state, program, config);\n            step = BuildStep.QueueReferencingProjects;\n            buildResult = resultFlags;\n            return emitDiagnostics;\n        }\n        function emitBundle(writeFileCallback, customTransformers) {\n            ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle);\n            if (state.options.dry) {\n                reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project);\n                buildResult = BuildResultFlags.Success;\n                step = BuildStep.QueueReferencingProjects;\n                return undefined;\n            }\n            if (state.options.verbose)\n                reportStatus(state, ts.Diagnostics.Updating_output_of_project_0, project);\n            // Update js, and source map\n            var compilerHost = state.compilerHost;\n            state.projectCompilerOptions = config.options;\n            var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) {\n                var refName = resolveProjectName(state, ref.path);\n                return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName));\n            }, customTransformers);\n            if (ts.isString(outputFiles)) {\n                reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles));\n                step = BuildStep.BuildInvalidatedProjectOfBundle;\n                return invalidatedProjectOfBundle = createBuildOrUpdateInvalidedProject(InvalidatedProjectKind.Build, state, project, projectPath, projectIndex, config, buildOrder);\n            }\n            // Actual Emit\n            ts.Debug.assert(!!outputFiles.length);\n            var emitterDiagnostics = ts.createDiagnosticCollection();\n            var emittedOutputs = new ts.Map();\n            outputFiles.forEach(function (_a) {\n                var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;\n                emittedOutputs.set(toPath(state, name), name);\n                ts.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);\n            });\n            var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, minimumDate, \n            /*newestDeclarationFileContentChangedTimeIsMaximumDate*/ false, outputFiles[0].name, BuildResultFlags.DeclarationOutputUnchanged);\n            return { emitSkipped: false, diagnostics: emitDiagnostics };\n        }\n        function executeSteps(till, cancellationToken, writeFile, customTransformers) {\n            while (step <= till && step < BuildStep.Done) {\n                var currentStep = step;\n                switch (step) {\n                    case BuildStep.CreateProgram:\n                        createProgram();\n                        break;\n                    case BuildStep.SyntaxDiagnostics:\n                        getSyntaxDiagnostics(cancellationToken);\n                        break;\n                    case BuildStep.SemanticDiagnostics:\n                        getSemanticDiagnostics(cancellationToken);\n                        break;\n                    case BuildStep.Emit:\n                        emit(writeFile, cancellationToken, customTransformers);\n                        break;\n                    case BuildStep.EmitBuildInfo:\n                        emitBuildInfo(writeFile, cancellationToken);\n                        break;\n                    case BuildStep.EmitBundle:\n                        emitBundle(writeFile, customTransformers);\n                        break;\n                    case BuildStep.BuildInvalidatedProjectOfBundle:\n                        ts.Debug.checkDefined(invalidatedProjectOfBundle).done(cancellationToken);\n                        step = BuildStep.Done;\n                        break;\n                    case BuildStep.QueueReferencingProjects:\n                        queueReferencingProjects(state, project, projectPath, projectIndex, config, buildOrder, ts.Debug.checkDefined(buildResult));\n                        step++;\n                        break;\n                    // Should never be done\n                    case BuildStep.Done:\n                    default:\n                        ts.assertType(step);\n                }\n                ts.Debug.assert(step > currentStep);\n            }\n        }\n    }\n    function needsBuild(_a, status, config) {\n        var options = _a.options;\n        if (status.type !== ts.UpToDateStatusType.OutOfDateWithPrepend || options.force)\n            return true;\n        return config.fileNames.length === 0 ||\n            !!ts.getConfigFileParsingDiagnostics(config).length ||\n            !ts.isIncrementalCompilation(config.options);\n    }\n    function getNextInvalidatedProject(state, buildOrder, reportQueue) {\n        if (!state.projectPendingBuild.size)\n            return undefined;\n        if (isCircularBuildOrder(buildOrder))\n            return undefined;\n        if (state.currentInvalidatedProject) {\n            // Only if same buildOrder the currentInvalidated project can be sent again\n            return ts.arrayIsEqualTo(state.currentInvalidatedProject.buildOrder, buildOrder) ?\n                state.currentInvalidatedProject :\n                undefined;\n        }\n        var options = state.options, projectPendingBuild = state.projectPendingBuild;\n        for (var projectIndex = 0; projectIndex < buildOrder.length; projectIndex++) {\n            var project = buildOrder[projectIndex];\n            var projectPath = toResolvedConfigFilePath(state, project);\n            var reloadLevel = state.projectPendingBuild.get(projectPath);\n            if (reloadLevel === undefined)\n                continue;\n            if (reportQueue) {\n                reportQueue = false;\n                reportBuildQueue(state, buildOrder);\n            }\n            var config = parseConfigFile(state, project, projectPath);\n            if (!config) {\n                reportParseConfigFileDiagnostic(state, projectPath);\n                projectPendingBuild.delete(projectPath);\n                continue;\n            }\n            if (reloadLevel === ts.ConfigFileProgramReloadLevel.Full) {\n                watchConfigFile(state, project, projectPath, config);\n                watchExtendedConfigFiles(state, projectPath, config);\n                watchWildCardDirectories(state, project, projectPath, config);\n                watchInputFiles(state, project, projectPath, config);\n            }\n            else if (reloadLevel === ts.ConfigFileProgramReloadLevel.Partial) {\n                // Update file names\n                config.fileNames = ts.getFileNamesFromConfigSpecs(config.options.configFile.configFileSpecs, ts.getDirectoryPath(project), config.options, state.parseConfigFileHost);\n                ts.updateErrorForNoInputFiles(config.fileNames, project, config.options.configFile.configFileSpecs, config.errors, ts.canJsonReportNoInputFiles(config.raw));\n                watchInputFiles(state, project, projectPath, config);\n            }\n            var status = getUpToDateStatus(state, config, projectPath);\n            verboseReportProjectStatus(state, project, status);\n            if (!options.force) {\n                if (status.type === ts.UpToDateStatusType.UpToDate) {\n                    reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));\n                    projectPendingBuild.delete(projectPath);\n                    // Up to date, skip\n                    if (options.dry) {\n                        // In a dry build, inform the user of this fact\n                        reportStatus(state, ts.Diagnostics.Project_0_is_up_to_date, project);\n                    }\n                    continue;\n                }\n                if (status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes) {\n                    reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));\n                    return createUpdateOutputFileStampsProject(state, project, projectPath, config, buildOrder);\n                }\n            }\n            if (status.type === ts.UpToDateStatusType.UpstreamBlocked) {\n                reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));\n                projectPendingBuild.delete(projectPath);\n                if (options.verbose) {\n                    reportStatus(state, status.upstreamProjectBlocked ?\n                        ts.Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_was_not_built :\n                        ts.Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_has_errors, project, status.upstreamProjectName);\n                }\n                continue;\n            }\n            if (status.type === ts.UpToDateStatusType.ContainerOnly) {\n                reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));\n                projectPendingBuild.delete(projectPath);\n                // Do nothing\n                continue;\n            }\n            return createBuildOrUpdateInvalidedProject(needsBuild(state, status, config) ?\n                InvalidatedProjectKind.Build :\n                InvalidatedProjectKind.UpdateBundle, state, project, projectPath, projectIndex, config, buildOrder);\n        }\n        return undefined;\n    }\n    function listEmittedFile(_a, proj, file) {\n        var write = _a.write;\n        if (write && proj.options.listEmittedFiles) {\n            write(\"TSFILE: \" + file);\n        }\n    }\n    function getOldProgram(_a, proj, parsed) {\n        var options = _a.options, builderPrograms = _a.builderPrograms, compilerHost = _a.compilerHost;\n        if (options.force)\n            return undefined;\n        var value = builderPrograms.get(proj);\n        if (value)\n            return value;\n        return ts.readBuilderProgram(parsed.options, compilerHost);\n    }\n    function afterProgramDone(state, program, config) {\n        if (program) {\n            if (program && state.write)\n                ts.listFiles(program, state.write);\n            if (state.host.afterProgramEmitAndDiagnostics) {\n                state.host.afterProgramEmitAndDiagnostics(program);\n            }\n            program.releaseProgram();\n        }\n        else if (state.host.afterEmitBundle) {\n            state.host.afterEmitBundle(config);\n        }\n        state.projectCompilerOptions = state.baseCompilerOptions;\n    }\n    function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {\n        var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());\n        reportAndStoreErrors(state, resolvedPath, diagnostics);\n        state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + \" errors\" });\n        if (canEmitBuildInfo)\n            return { buildResult: buildResult, step: BuildStep.EmitBuildInfo };\n        afterProgramDone(state, program, config);\n        return { buildResult: buildResult, step: BuildStep.QueueReferencingProjects };\n    }\n    function updateModuleResolutionCache(state, proj, config) {\n        if (!state.moduleResolutionCache)\n            return;\n        // Update module resolution cache if needed\n        var moduleResolutionCache = state.moduleResolutionCache;\n        var projPath = toPath(state, proj);\n        if (moduleResolutionCache.directoryToModuleNameMap.redirectsMap.size === 0) {\n            // The own map will be for projectCompilerOptions\n            ts.Debug.assert(moduleResolutionCache.moduleNameToDirectoryMap.redirectsMap.size === 0);\n            moduleResolutionCache.directoryToModuleNameMap.redirectsMap.set(projPath, moduleResolutionCache.directoryToModuleNameMap.ownMap);\n            moduleResolutionCache.moduleNameToDirectoryMap.redirectsMap.set(projPath, moduleResolutionCache.moduleNameToDirectoryMap.ownMap);\n        }\n        else {\n            // Set correct own map\n            ts.Debug.assert(moduleResolutionCache.moduleNameToDirectoryMap.redirectsMap.size > 0);\n            var ref = {\n                sourceFile: config.options.configFile,\n                commandLine: config\n            };\n            moduleResolutionCache.directoryToModuleNameMap.setOwnMap(moduleResolutionCache.directoryToModuleNameMap.getOrCreateMapOfCacheRedirects(ref));\n            moduleResolutionCache.moduleNameToDirectoryMap.setOwnMap(moduleResolutionCache.moduleNameToDirectoryMap.getOrCreateMapOfCacheRedirects(ref));\n        }\n        moduleResolutionCache.directoryToModuleNameMap.setOwnOptions(config.options);\n        moduleResolutionCache.moduleNameToDirectoryMap.setOwnOptions(config.options);\n    }\n    function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName) {\n        // Check tsconfig time\n        var tsconfigTime = state.host.getModifiedTime(configFile) || ts.missingFileModifiedTime;\n        if (oldestOutputFileTime < tsconfigTime) {\n            return {\n                type: ts.UpToDateStatusType.OutOfDateWithSelf,\n                outOfDateOutputFileName: oldestOutputFileName,\n                newerInputFileName: configFile\n            };\n        }\n    }\n    function getUpToDateStatusWorker(state, project, resolvedPath) {\n        var newestInputFileName = undefined;\n        var newestInputFileTime = minimumDate;\n        var host = state.host;\n        // Get timestamps of input files\n        for (var _i = 0, _a = project.fileNames; _i < _a.length; _i++) {\n            var inputFile = _a[_i];\n            if (!host.fileExists(inputFile)) {\n                return {\n                    type: ts.UpToDateStatusType.Unbuildable,\n                    reason: inputFile + \" does not exist\"\n                };\n            }\n            var inputTime = host.getModifiedTime(inputFile) || ts.missingFileModifiedTime;\n            if (inputTime > newestInputFileTime) {\n                newestInputFileName = inputFile;\n                newestInputFileTime = inputTime;\n            }\n        }\n        // Container if no files are specified in the project\n        if (!project.fileNames.length && !ts.canJsonReportNoInputFiles(project.raw)) {\n            return {\n                type: ts.UpToDateStatusType.ContainerOnly\n            };\n        }\n        // Collect the expected outputs of this project\n        var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());\n        // Now see if all outputs are newer than the newest input\n        var oldestOutputFileName = \"(none)\";\n        var oldestOutputFileTime = maximumDate;\n        var newestOutputFileName = \"(none)\";\n        var newestOutputFileTime = minimumDate;\n        var missingOutputFileName;\n        var newestDeclarationFileContentChangedTime = minimumDate;\n        var isOutOfDateWithInputs = false;\n        for (var _b = 0, outputs_1 = outputs; _b < outputs_1.length; _b++) {\n            var output = outputs_1[_b];\n            // Output is missing; can stop checking\n            // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status\n            if (!host.fileExists(output)) {\n                missingOutputFileName = output;\n                break;\n            }\n            var outputTime = host.getModifiedTime(output) || ts.missingFileModifiedTime;\n            if (outputTime < oldestOutputFileTime) {\n                oldestOutputFileTime = outputTime;\n                oldestOutputFileName = output;\n            }\n            // If an output is older than the newest input, we can stop checking\n            // Don't immediately return because we can still be upstream-blocked, which is a higher-priority status\n            if (outputTime < newestInputFileTime) {\n                isOutOfDateWithInputs = true;\n                break;\n            }\n            if (outputTime > newestOutputFileTime) {\n                newestOutputFileTime = outputTime;\n                newestOutputFileName = output;\n            }\n            // Keep track of when the most recent time a .d.ts file was changed.\n            // In addition to file timestamps, we also keep track of when a .d.ts file\n            // had its file touched but not had its contents changed - this allows us\n            // to skip a downstream typecheck\n            if (isDeclarationFile(output)) {\n                var outputModifiedTime = host.getModifiedTime(output) || ts.missingFileModifiedTime;\n                newestDeclarationFileContentChangedTime = newer(newestDeclarationFileContentChangedTime, outputModifiedTime);\n            }\n        }\n        var pseudoUpToDate = false;\n        var usesPrepend = false;\n        var upstreamChangedProject;\n        if (project.projectReferences) {\n            state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.ComputingUpstream });\n            for (var _c = 0, _d = project.projectReferences; _c < _d.length; _c++) {\n                var ref = _d[_c];\n                usesPrepend = usesPrepend || !!(ref.prepend);\n                var resolvedRef = ts.resolveProjectReferencePath(ref);\n                var resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef);\n                var refStatus = getUpToDateStatus(state, parseConfigFile(state, resolvedRef, resolvedRefPath), resolvedRefPath);\n                // Its a circular reference ignore the status of this project\n                if (refStatus.type === ts.UpToDateStatusType.ComputingUpstream ||\n                    refStatus.type === ts.UpToDateStatusType.ContainerOnly) { // Container only ignore this project\n                    continue;\n                }\n                // An upstream project is blocked\n                if (refStatus.type === ts.UpToDateStatusType.Unbuildable ||\n                    refStatus.type === ts.UpToDateStatusType.UpstreamBlocked) {\n                    return {\n                        type: ts.UpToDateStatusType.UpstreamBlocked,\n                        upstreamProjectName: ref.path,\n                        upstreamProjectBlocked: refStatus.type === ts.UpToDateStatusType.UpstreamBlocked\n                    };\n                }\n                // If the upstream project is out of date, then so are we (someone shouldn't have asked, though?)\n                if (refStatus.type !== ts.UpToDateStatusType.UpToDate) {\n                    return {\n                        type: ts.UpToDateStatusType.UpstreamOutOfDate,\n                        upstreamProjectName: ref.path\n                    };\n                }\n                // Check oldest output file name only if there is no missing output file name\n                if (!missingOutputFileName) {\n                    // If the upstream project's newest file is older than our oldest output, we\n                    // can't be out of date because of it\n                    if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {\n                        continue;\n                    }\n                    // If the upstream project has only change .d.ts files, and we've built\n                    // *after* those files, then we're \"psuedo up to date\" and eligible for a fast rebuild\n                    if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {\n                        pseudoUpToDate = true;\n                        upstreamChangedProject = ref.path;\n                        continue;\n                    }\n                    // We have an output older than an upstream output - we are out of date\n                    ts.Debug.assert(oldestOutputFileName !== undefined, \"Should have an oldest output filename here\");\n                    return {\n                        type: ts.UpToDateStatusType.OutOfDateWithUpstream,\n                        outOfDateOutputFileName: oldestOutputFileName,\n                        newerProjectName: ref.path\n                    };\n                }\n            }\n        }\n        if (missingOutputFileName !== undefined) {\n            return {\n                type: ts.UpToDateStatusType.OutputMissing,\n                missingOutputFileName: missingOutputFileName\n            };\n        }\n        if (isOutOfDateWithInputs) {\n            return {\n                type: ts.UpToDateStatusType.OutOfDateWithSelf,\n                outOfDateOutputFileName: oldestOutputFileName,\n                newerInputFileName: newestInputFileName\n            };\n        }\n        else {\n            // Check tsconfig time\n            var configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName);\n            if (configStatus)\n                return configStatus;\n            // Check extended config time\n            var extendedConfigStatus = ts.forEach(project.options.configFile.extendedSourceFiles || ts.emptyArray, function (configFile) { return checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName); });\n            if (extendedConfigStatus)\n                return extendedConfigStatus;\n        }\n        if (!state.buildInfoChecked.has(resolvedPath)) {\n            state.buildInfoChecked.set(resolvedPath, true);\n            var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(project.options);\n            if (buildInfoPath) {\n                var value = state.readFileWithCache(buildInfoPath);\n                var buildInfo = value && ts.getBuildInfo(value);\n                if (buildInfo && (buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts.version) {\n                    return {\n                        type: ts.UpToDateStatusType.TsVersionOutputOfDate,\n                        version: buildInfo.version\n                    };\n                }\n            }\n        }\n        if (usesPrepend && pseudoUpToDate) {\n            return {\n                type: ts.UpToDateStatusType.OutOfDateWithPrepend,\n                outOfDateOutputFileName: oldestOutputFileName,\n                newerProjectName: upstreamChangedProject\n            };\n        }\n        // Up to date\n        return {\n            type: pseudoUpToDate ? ts.UpToDateStatusType.UpToDateWithUpstreamTypes : ts.UpToDateStatusType.UpToDate,\n            newestDeclarationFileContentChangedTime: newestDeclarationFileContentChangedTime,\n            newestInputFileTime: newestInputFileTime,\n            newestOutputFileTime: newestOutputFileTime,\n            newestInputFileName: newestInputFileName,\n            newestOutputFileName: newestOutputFileName,\n            oldestOutputFileName: oldestOutputFileName\n        };\n    }\n    function getUpToDateStatus(state, project, resolvedPath) {\n        if (project === undefined) {\n            return { type: ts.UpToDateStatusType.Unbuildable, reason: \"File deleted mid-build\" };\n        }\n        var prior = state.projectStatus.get(resolvedPath);\n        if (prior !== undefined) {\n            return prior;\n        }\n        var actual = getUpToDateStatusWorker(state, project, resolvedPath);\n        state.projectStatus.set(resolvedPath, actual);\n        return actual;\n    }\n    function updateOutputTimestampsWorker(state, proj, priorNewestUpdateTime, verboseMessage, skipOutputs) {\n        var host = state.host;\n        var outputs = ts.getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames());\n        if (!skipOutputs || outputs.length !== skipOutputs.size) {\n            var reportVerbose = !!state.options.verbose;\n            var now = host.now ? host.now() : new Date();\n            for (var _i = 0, outputs_2 = outputs; _i < outputs_2.length; _i++) {\n                var file = outputs_2[_i];\n                if (skipOutputs && skipOutputs.has(toPath(state, file))) {\n                    continue;\n                }\n                if (reportVerbose) {\n                    reportVerbose = false;\n                    reportStatus(state, verboseMessage, proj.options.configFilePath);\n                }\n                if (isDeclarationFile(file)) {\n                    priorNewestUpdateTime = newer(priorNewestUpdateTime, host.getModifiedTime(file) || ts.missingFileModifiedTime);\n                }\n                host.setModifiedTime(file, now);\n            }\n        }\n        return priorNewestUpdateTime;\n    }\n    function updateOutputTimestamps(state, proj, resolvedPath) {\n        if (state.options.dry) {\n            return reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0, proj.options.configFilePath);\n        }\n        var priorNewestUpdateTime = updateOutputTimestampsWorker(state, proj, minimumDate, ts.Diagnostics.Updating_output_timestamps_of_project_0);\n        state.projectStatus.set(resolvedPath, {\n            type: ts.UpToDateStatusType.UpToDate,\n            newestDeclarationFileContentChangedTime: priorNewestUpdateTime,\n            oldestOutputFileName: ts.getFirstProjectOutput(proj, !state.host.useCaseSensitiveFileNames())\n        });\n    }\n    function queueReferencingProjects(state, project, projectPath, projectIndex, config, buildOrder, buildResult) {\n        // Queue only if there are no errors\n        if (buildResult & BuildResultFlags.AnyErrors)\n            return;\n        // Only composite projects can be referenced by other projects\n        if (!config.options.composite)\n            return;\n        // Always use build order to queue projects\n        for (var index = projectIndex + 1; index < buildOrder.length; index++) {\n            var nextProject = buildOrder[index];\n            var nextProjectPath = toResolvedConfigFilePath(state, nextProject);\n            if (state.projectPendingBuild.has(nextProjectPath))\n                continue;\n            var nextProjectConfig = parseConfigFile(state, nextProject, nextProjectPath);\n            if (!nextProjectConfig || !nextProjectConfig.projectReferences)\n                continue;\n            for (var _i = 0, _a = nextProjectConfig.projectReferences; _i < _a.length; _i++) {\n                var ref = _a[_i];\n                var resolvedRefPath = resolveProjectName(state, ref.path);\n                if (toResolvedConfigFilePath(state, resolvedRefPath) !== projectPath)\n                    continue;\n                // If the project is referenced with prepend, always build downstream projects,\n                // If declaration output is changed, build the project\n                // otherwise mark the project UpToDateWithUpstreamTypes so it updates output time stamps\n                var status = state.projectStatus.get(nextProjectPath);\n                if (status) {\n                    switch (status.type) {\n                        case ts.UpToDateStatusType.UpToDate:\n                            if (buildResult & BuildResultFlags.DeclarationOutputUnchanged) {\n                                if (ref.prepend) {\n                                    state.projectStatus.set(nextProjectPath, {\n                                        type: ts.UpToDateStatusType.OutOfDateWithPrepend,\n                                        outOfDateOutputFileName: status.oldestOutputFileName,\n                                        newerProjectName: project\n                                    });\n                                }\n                                else {\n                                    status.type = ts.UpToDateStatusType.UpToDateWithUpstreamTypes;\n                                }\n                                break;\n                            }\n                        // falls through\n                        case ts.UpToDateStatusType.UpToDateWithUpstreamTypes:\n                        case ts.UpToDateStatusType.OutOfDateWithPrepend:\n                            if (!(buildResult & BuildResultFlags.DeclarationOutputUnchanged)) {\n                                state.projectStatus.set(nextProjectPath, {\n                                    type: ts.UpToDateStatusType.OutOfDateWithUpstream,\n                                    outOfDateOutputFileName: status.type === ts.UpToDateStatusType.OutOfDateWithPrepend ? status.outOfDateOutputFileName : status.oldestOutputFileName,\n                                    newerProjectName: project\n                                });\n                            }\n                            break;\n                        case ts.UpToDateStatusType.UpstreamBlocked:\n                            if (toResolvedConfigFilePath(state, resolveProjectName(state, status.upstreamProjectName)) === projectPath) {\n                                clearProjectStatus(state, nextProjectPath);\n                            }\n                            break;\n                    }\n                }\n                addProjToQueue(state, nextProjectPath, ts.ConfigFileProgramReloadLevel.None);\n                break;\n            }\n        }\n    }\n    function build(state, project, cancellationToken, onlyReferences) {\n        var buildOrder = getBuildOrderFor(state, project, onlyReferences);\n        if (!buildOrder)\n            return ts.ExitStatus.InvalidProject_OutputsSkipped;\n        setupInitialBuild(state, cancellationToken);\n        var reportQueue = true;\n        var successfulProjects = 0;\n        while (true) {\n            var invalidatedProject = getNextInvalidatedProject(state, buildOrder, reportQueue);\n            if (!invalidatedProject)\n                break;\n            reportQueue = false;\n            invalidatedProject.done(cancellationToken);\n            if (!state.diagnostics.has(invalidatedProject.projectPath))\n                successfulProjects++;\n        }\n        disableCache(state);\n        reportErrorSummary(state, buildOrder);\n        startWatching(state, buildOrder);\n        return isCircularBuildOrder(buildOrder)\n            ? ts.ExitStatus.ProjectReferenceCycle_OutputsSkipped\n            : !buildOrder.some(function (p) { return state.diagnostics.has(toResolvedConfigFilePath(state, p)); })\n                ? ts.ExitStatus.Success\n                : successfulProjects\n                    ? ts.ExitStatus.DiagnosticsPresent_OutputsGenerated\n                    : ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;\n    }\n    function clean(state, project, onlyReferences) {\n        var buildOrder = getBuildOrderFor(state, project, onlyReferences);\n        if (!buildOrder)\n            return ts.ExitStatus.InvalidProject_OutputsSkipped;\n        if (isCircularBuildOrder(buildOrder)) {\n            reportErrors(state, buildOrder.circularDiagnostics);\n            return ts.ExitStatus.ProjectReferenceCycle_OutputsSkipped;\n        }\n        var options = state.options, host = state.host;\n        var filesToDelete = options.dry ? [] : undefined;\n        for (var _i = 0, buildOrder_1 = buildOrder; _i < buildOrder_1.length; _i++) {\n            var proj = buildOrder_1[_i];\n            var resolvedPath = toResolvedConfigFilePath(state, proj);\n            var parsed = parseConfigFile(state, proj, resolvedPath);\n            if (parsed === undefined) {\n                // File has gone missing; fine to ignore here\n                reportParseConfigFileDiagnostic(state, resolvedPath);\n                continue;\n            }\n            var outputs = ts.getAllProjectOutputs(parsed, !host.useCaseSensitiveFileNames());\n            for (var _a = 0, outputs_3 = outputs; _a < outputs_3.length; _a++) {\n                var output = outputs_3[_a];\n                if (host.fileExists(output)) {\n                    if (filesToDelete) {\n                        filesToDelete.push(output);\n                    }\n                    else {\n                        host.deleteFile(output);\n                        invalidateProject(state, resolvedPath, ts.ConfigFileProgramReloadLevel.None);\n                    }\n                }\n            }\n        }\n        if (filesToDelete) {\n            reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return \"\\r\\n * \" + f; }).join(\"\"));\n        }\n        return ts.ExitStatus.Success;\n    }\n    function invalidateProject(state, resolved, reloadLevel) {\n        // If host implements getParsedCommandLine, we cant get list of files from parseConfigFileHost\n        if (state.host.getParsedCommandLine && reloadLevel === ts.ConfigFileProgramReloadLevel.Partial) {\n            reloadLevel = ts.ConfigFileProgramReloadLevel.Full;\n        }\n        if (reloadLevel === ts.ConfigFileProgramReloadLevel.Full) {\n            state.configFileCache.delete(resolved);\n            state.buildOrder = undefined;\n        }\n        state.needsSummary = true;\n        clearProjectStatus(state, resolved);\n        addProjToQueue(state, resolved, reloadLevel);\n        enableCache(state);\n    }\n    function invalidateProjectAndScheduleBuilds(state, resolvedPath, reloadLevel) {\n        state.reportFileChangeDetected = true;\n        invalidateProject(state, resolvedPath, reloadLevel);\n        scheduleBuildInvalidatedProject(state);\n    }\n    function scheduleBuildInvalidatedProject(state) {\n        var hostWithWatch = state.hostWithWatch;\n        if (!hostWithWatch.setTimeout || !hostWithWatch.clearTimeout) {\n            return;\n        }\n        if (state.timerToBuildInvalidatedProject) {\n            hostWithWatch.clearTimeout(state.timerToBuildInvalidatedProject);\n        }\n        state.timerToBuildInvalidatedProject = hostWithWatch.setTimeout(buildNextInvalidatedProject, 250, state);\n    }\n    function buildNextInvalidatedProject(state) {\n        state.timerToBuildInvalidatedProject = undefined;\n        if (state.reportFileChangeDetected) {\n            state.reportFileChangeDetected = false;\n            state.projectErrorsReported.clear();\n            reportWatchStatus(state, ts.Diagnostics.File_change_detected_Starting_incremental_compilation);\n        }\n        var buildOrder = getBuildOrder(state);\n        var invalidatedProject = getNextInvalidatedProject(state, buildOrder, /*reportQueue*/ false);\n        if (invalidatedProject) {\n            invalidatedProject.done();\n            if (state.projectPendingBuild.size) {\n                // Schedule next project for build\n                if (state.watch && !state.timerToBuildInvalidatedProject) {\n                    scheduleBuildInvalidatedProject(state);\n                }\n                return;\n            }\n        }\n        disableCache(state);\n        reportErrorSummary(state, buildOrder);\n    }\n    function watchConfigFile(state, resolved, resolvedPath, parsed) {\n        if (!state.watch || state.allWatchedConfigFiles.has(resolvedPath))\n            return;\n        state.allWatchedConfigFiles.set(resolvedPath, state.watchFile(resolved, function () {\n            invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Full);\n        }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.ConfigFile, resolved));\n    }\n    function watchExtendedConfigFiles(state, resolvedPath, parsed) {\n        ts.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed, state.allWatchedExtendedConfigFiles, function (extendedConfigFileName, extendedConfigFilePath) { return state.watchFile(extendedConfigFileName, function () {\n            var _a;\n            return (_a = state.allWatchedExtendedConfigFiles.get(extendedConfigFilePath)) === null || _a === void 0 ? void 0 : _a.projects.forEach(function (projectConfigFilePath) {\n                return invalidateProjectAndScheduleBuilds(state, projectConfigFilePath, ts.ConfigFileProgramReloadLevel.Full);\n            });\n        }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.ExtendedConfigFile); }, function (fileName) { return toPath(state, fileName); });\n    }\n    function watchWildCardDirectories(state, resolved, resolvedPath, parsed) {\n        if (!state.watch)\n            return;\n        ts.updateWatchingWildcardDirectories(getOrCreateValueMapFromConfigFileMap(state.allWatchedWildcardDirectories, resolvedPath), new ts.Map(ts.getEntries(parsed.wildcardDirectories)), function (dir, flags) { return state.watchDirectory(dir, function (fileOrDirectory) {\n            if (ts.isIgnoredFileFromWildCardWatching({\n                watchedDirPath: toPath(state, dir),\n                fileOrDirectory: fileOrDirectory,\n                fileOrDirectoryPath: toPath(state, fileOrDirectory),\n                configFileName: resolved,\n                currentDirectory: state.currentDirectory,\n                options: parsed.options,\n                program: state.builderPrograms.get(resolvedPath),\n                useCaseSensitiveFileNames: state.parseConfigFileHost.useCaseSensitiveFileNames,\n                writeLog: function (s) { return state.writeLog(s); }\n            }))\n                return;\n            invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Partial);\n        }, flags, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.WildcardDirectory, resolved); });\n    }\n    function watchInputFiles(state, resolved, resolvedPath, parsed) {\n        if (!state.watch)\n            return;\n        ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedInputFiles, resolvedPath), ts.arrayToMap(parsed.fileNames, function (fileName) { return toPath(state, fileName); }), {\n            createNewValue: function (_path, input) { return state.watchFile(input, function () { return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.None); }, ts.PollingInterval.Low, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.SourceFile, resolved); },\n            onDeleteValue: ts.closeFileWatcher,\n        });\n    }\n    function startWatching(state, buildOrder) {\n        if (!state.watchAllProjectsPending)\n            return;\n        state.watchAllProjectsPending = false;\n        for (var _i = 0, _a = getBuildOrderFromAnyBuildOrder(buildOrder); _i < _a.length; _i++) {\n            var resolved = _a[_i];\n            var resolvedPath = toResolvedConfigFilePath(state, resolved);\n            var cfg = parseConfigFile(state, resolved, resolvedPath);\n            // Watch this file\n            watchConfigFile(state, resolved, resolvedPath, cfg);\n            watchExtendedConfigFiles(state, resolvedPath, cfg);\n            if (cfg) {\n                // Update watchers for wildcard directories\n                watchWildCardDirectories(state, resolved, resolvedPath, cfg);\n                // Watch input files\n                watchInputFiles(state, resolved, resolvedPath, cfg);\n            }\n        }\n    }\n    function stopWatching(state) {\n        ts.clearMap(state.allWatchedConfigFiles, ts.closeFileWatcher);\n        ts.clearMap(state.allWatchedExtendedConfigFiles, function (watcher) {\n            watcher.projects.clear();\n            watcher.close();\n        });\n        ts.clearMap(state.allWatchedWildcardDirectories, function (watchedWildcardDirectories) { return ts.clearMap(watchedWildcardDirectories, ts.closeFileWatcherOf); });\n        ts.clearMap(state.allWatchedInputFiles, function (watchedWildcardDirectories) { return ts.clearMap(watchedWildcardDirectories, ts.closeFileWatcher); });\n    }\n    function createSolutionBuilderWorker(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions) {\n        var state = createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions);\n        return {\n            build: function (project, cancellationToken) { return build(state, project, cancellationToken); },\n            clean: function (project) { return clean(state, project); },\n            buildReferences: function (project, cancellationToken) { return build(state, project, cancellationToken, /*onlyReferences*/ true); },\n            cleanReferences: function (project) { return clean(state, project, /*onlyReferences*/ true); },\n            getNextInvalidatedProject: function (cancellationToken) {\n                setupInitialBuild(state, cancellationToken);\n                return getNextInvalidatedProject(state, getBuildOrder(state), /*reportQueue*/ false);\n            },\n            getBuildOrder: function () { return getBuildOrder(state); },\n            getUpToDateStatusOfProject: function (project) {\n                var configFileName = resolveProjectName(state, project);\n                var configFilePath = toResolvedConfigFilePath(state, configFileName);\n                return getUpToDateStatus(state, parseConfigFile(state, configFileName, configFilePath), configFilePath);\n            },\n            invalidateProject: function (configFilePath, reloadLevel) { return invalidateProject(state, configFilePath, reloadLevel || ts.ConfigFileProgramReloadLevel.None); },\n            buildNextInvalidatedProject: function () { return buildNextInvalidatedProject(state); },\n            getAllParsedConfigs: function () { return ts.arrayFrom(ts.mapDefinedIterator(state.configFileCache.values(), function (config) { return isParsedCommandLine(config) ? config : undefined; })); },\n            close: function () { return stopWatching(state); },\n        };\n    }\n    function relName(state, path) {\n        return ts.convertToRelativePath(path, state.currentDirectory, function (f) { return state.getCanonicalFileName(f); });\n    }\n    function reportStatus(state, message) {\n        var args = [];\n        for (var _i = 2; _i < arguments.length; _i++) {\n            args[_i - 2] = arguments[_i];\n        }\n        state.host.reportSolutionBuilderStatus(ts.createCompilerDiagnostic.apply(void 0, __spreadArray([message], args)));\n    }\n    function reportWatchStatus(state, message) {\n        var _a, _b;\n        var args = [];\n        for (var _i = 2; _i < arguments.length; _i++) {\n            args[_i - 2] = arguments[_i];\n        }\n        (_b = (_a = state.hostWithWatch).onWatchStatusChange) === null || _b === void 0 ? void 0 : _b.call(_a, ts.createCompilerDiagnostic.apply(void 0, __spreadArray([message], args)), state.host.getNewLine(), state.baseCompilerOptions);\n    }\n    function reportErrors(_a, errors) {\n        var host = _a.host;\n        errors.forEach(function (err) { return host.reportDiagnostic(err); });\n    }\n    function reportAndStoreErrors(state, proj, errors) {\n        reportErrors(state, errors);\n        state.projectErrorsReported.set(proj, true);\n        if (errors.length) {\n            state.diagnostics.set(proj, errors);\n        }\n    }\n    function reportParseConfigFileDiagnostic(state, proj) {\n        reportAndStoreErrors(state, proj, [state.configFileCache.get(proj)]);\n    }\n    function reportErrorSummary(state, buildOrder) {\n        if (!state.needsSummary)\n            return;\n        state.needsSummary = false;\n        var canReportSummary = state.watch || !!state.host.reportErrorSummary;\n        var diagnostics = state.diagnostics;\n        var totalErrors = 0;\n        if (isCircularBuildOrder(buildOrder)) {\n            reportBuildQueue(state, buildOrder.buildOrder);\n            reportErrors(state, buildOrder.circularDiagnostics);\n            if (canReportSummary)\n                totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);\n        }\n        else {\n            // Report errors from the other projects\n            buildOrder.forEach(function (project) {\n                var projectPath = toResolvedConfigFilePath(state, project);\n                if (!state.projectErrorsReported.has(projectPath)) {\n                    reportErrors(state, diagnostics.get(projectPath) || ts.emptyArray);\n                }\n            });\n            if (canReportSummary)\n                diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });\n        }\n        if (state.watch) {\n            reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);\n        }\n        else if (state.host.reportErrorSummary) {\n            state.host.reportErrorSummary(totalErrors);\n        }\n    }\n    /**\n     * Report the build ordering inferred from the current project graph if we're in verbose mode\n     */\n    function reportBuildQueue(state, buildQueue) {\n        if (state.options.verbose) {\n            reportStatus(state, ts.Diagnostics.Projects_in_this_build_Colon_0, buildQueue.map(function (s) { return \"\\r\\n    * \" + relName(state, s); }).join(\"\"));\n        }\n    }\n    function reportUpToDateStatus(state, configFileName, status) {\n        switch (status.type) {\n            case ts.UpToDateStatusType.OutOfDateWithSelf:\n                return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2, relName(state, configFileName), relName(state, status.outOfDateOutputFileName), relName(state, status.newerInputFileName));\n            case ts.UpToDateStatusType.OutOfDateWithUpstream:\n                return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2, relName(state, configFileName), relName(state, status.outOfDateOutputFileName), relName(state, status.newerProjectName));\n            case ts.UpToDateStatusType.OutputMissing:\n                return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relName(state, configFileName), relName(state, status.missingOutputFileName));\n            case ts.UpToDateStatusType.UpToDate:\n                if (status.newestInputFileTime !== undefined) {\n                    return reportStatus(state, ts.Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2, relName(state, configFileName), relName(state, status.newestInputFileName || \"\"), relName(state, status.oldestOutputFileName || \"\"));\n                }\n                // Don't report anything for \"up to date because it was already built\" -- too verbose\n                break;\n            case ts.UpToDateStatusType.OutOfDateWithPrepend:\n                return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed, relName(state, configFileName), relName(state, status.newerProjectName));\n            case ts.UpToDateStatusType.UpToDateWithUpstreamTypes:\n                return reportStatus(state, ts.Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies, relName(state, configFileName));\n            case ts.UpToDateStatusType.UpstreamOutOfDate:\n                return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date, relName(state, configFileName), relName(state, status.upstreamProjectName));\n            case ts.UpToDateStatusType.UpstreamBlocked:\n                return reportStatus(state, status.upstreamProjectBlocked ?\n                    ts.Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built :\n                    ts.Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors, relName(state, configFileName), relName(state, status.upstreamProjectName));\n            case ts.UpToDateStatusType.Unbuildable:\n                return reportStatus(state, ts.Diagnostics.Failed_to_parse_file_0_Colon_1, relName(state, configFileName), status.reason);\n            case ts.UpToDateStatusType.TsVersionOutputOfDate:\n                return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2, relName(state, configFileName), status.version, ts.version);\n            case ts.UpToDateStatusType.ContainerOnly:\n            // Don't report status on \"solution\" projects\n            // falls through\n            case ts.UpToDateStatusType.ComputingUpstream:\n                // Should never leak from getUptoDateStatusWorker\n                break;\n            default:\n                ts.assertType(status);\n        }\n    }\n    /**\n     * Report the up-to-date status of a project if we're in verbose mode\n     */\n    function verboseReportProjectStatus(state, configFileName, status) {\n        if (state.options.verbose) {\n            reportUpToDateStatus(state, configFileName, status);\n        }\n    }\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    var server;\n    (function (server) {\n        /* @internal */\n        server.ActionSet = \"action::set\";\n        /* @internal */\n        server.ActionInvalidate = \"action::invalidate\";\n        /* @internal */\n        server.ActionPackageInstalled = \"action::packageInstalled\";\n        /* @internal */\n        server.EventTypesRegistry = \"event::typesRegistry\";\n        /* @internal */\n        server.EventBeginInstallTypes = \"event::beginInstallTypes\";\n        /* @internal */\n        server.EventEndInstallTypes = \"event::endInstallTypes\";\n        /* @internal */\n        server.EventInitializationFailed = \"event::initializationFailed\";\n        /* @internal */\n        var Arguments;\n        (function (Arguments) {\n            Arguments.GlobalCacheLocation = \"--globalTypingsCacheLocation\";\n            Arguments.LogFile = \"--logFile\";\n            Arguments.EnableTelemetry = \"--enableTelemetry\";\n            Arguments.TypingSafeListLocation = \"--typingSafeListLocation\";\n            Arguments.TypesMapLocation = \"--typesMapLocation\";\n            /**\n             * This argument specifies the location of the NPM executable.\n             * typingsInstaller will run the command with `${npmLocation} install ...`.\n             */\n            Arguments.NpmLocation = \"--npmLocation\";\n            /**\n             * Flag indicating that the typings installer should try to validate the default npm location.\n             * If the default npm is not found when this flag is enabled, fallback to `npm install`\n             */\n            Arguments.ValidateDefaultNpmLocation = \"--validateDefaultNpmLocation\";\n        })(Arguments = server.Arguments || (server.Arguments = {}));\n        /* @internal */\n        function hasArgument(argumentName) {\n            return ts.sys.args.indexOf(argumentName) >= 0;\n        }\n        server.hasArgument = hasArgument;\n        /* @internal */\n        function findArgument(argumentName) {\n            var index = ts.sys.args.indexOf(argumentName);\n            return index >= 0 && index < ts.sys.args.length - 1\n                ? ts.sys.args[index + 1]\n                : undefined;\n        }\n        server.findArgument = findArgument;\n        /* @internal */\n        function nowString() {\n            // E.g. \"12:34:56.789\"\n            var d = new Date();\n            return ts.padLeft(d.getHours().toString(), 2, \"0\") + \":\" + ts.padLeft(d.getMinutes().toString(), 2, \"0\") + \":\" + ts.padLeft(d.getSeconds().toString(), 2, \"0\") + \".\" + ts.padLeft(d.getMilliseconds().toString(), 3, \"0\");\n        }\n        server.nowString = nowString;\n    })(server = ts.server || (ts.server = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var JsTyping;\n    (function (JsTyping) {\n        function isTypingUpToDate(cachedTyping, availableTypingVersions) {\n            var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, \"ts\" + ts.versionMajorMinor) || ts.getProperty(availableTypingVersions, \"latest\"));\n            return availableVersion.compareTo(cachedTyping.version) <= 0;\n        }\n        JsTyping.isTypingUpToDate = isTypingUpToDate;\n        JsTyping.nodeCoreModuleList = [\n            \"assert\",\n            \"async_hooks\",\n            \"buffer\",\n            \"child_process\",\n            \"cluster\",\n            \"console\",\n            \"constants\",\n            \"crypto\",\n            \"dgram\",\n            \"dns\",\n            \"domain\",\n            \"events\",\n            \"fs\",\n            \"http\",\n            \"https\",\n            \"http2\",\n            \"inspector\",\n            \"net\",\n            \"os\",\n            \"path\",\n            \"perf_hooks\",\n            \"process\",\n            \"punycode\",\n            \"querystring\",\n            \"readline\",\n            \"repl\",\n            \"stream\",\n            \"string_decoder\",\n            \"timers\",\n            \"tls\",\n            \"tty\",\n            \"url\",\n            \"util\",\n            \"v8\",\n            \"vm\",\n            \"zlib\"\n        ];\n        JsTyping.nodeCoreModules = new ts.Set(JsTyping.nodeCoreModuleList);\n        function nonRelativeModuleNameForTypingCache(moduleName) {\n            return JsTyping.nodeCoreModules.has(moduleName) ? \"node\" : moduleName;\n        }\n        JsTyping.nonRelativeModuleNameForTypingCache = nonRelativeModuleNameForTypingCache;\n        function loadSafeList(host, safeListPath) {\n            var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); });\n            return new ts.Map(ts.getEntries(result.config));\n        }\n        JsTyping.loadSafeList = loadSafeList;\n        function loadTypesMap(host, typesMapPath) {\n            var result = ts.readConfigFile(typesMapPath, function (path) { return host.readFile(path); });\n            if (result.config) {\n                return new ts.Map(ts.getEntries(result.config.simpleMap));\n            }\n            return undefined;\n        }\n        JsTyping.loadTypesMap = loadTypesMap;\n        /**\n         * @param host is the object providing I/O related operations.\n         * @param fileNames are the file names that belong to the same project\n         * @param projectRootPath is the path to the project root directory\n         * @param safeListPath is the path used to retrieve the safe list\n         * @param packageNameToTypingLocation is the map of package names to their cached typing locations and installed versions\n         * @param typeAcquisition is used to customize the typing acquisition process\n         * @param compilerOptions are used as a source for typing inference\n         */\n        function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports, typesRegistry) {\n            if (!typeAcquisition || !typeAcquisition.enable) {\n                return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] };\n            }\n            // A typing name to typing file path mapping\n            var inferredTypings = new ts.Map();\n            // Only infer typings for .js and .jsx files\n            fileNames = ts.mapDefined(fileNames, function (fileName) {\n                var path = ts.normalizePath(fileName);\n                if (ts.hasJSFileExtension(path)) {\n                    return path;\n                }\n            });\n            var filesToWatch = [];\n            if (typeAcquisition.include)\n                addInferredTypings(typeAcquisition.include, \"Explicitly included types\");\n            var exclude = typeAcquisition.exclude || [];\n            // Directories to search for package.json, bower.json and other typing information\n            var possibleSearchDirs = new ts.Set(fileNames.map(ts.getDirectoryPath));\n            possibleSearchDirs.add(projectRootPath);\n            possibleSearchDirs.forEach(function (searchDir) {\n                var packageJsonPath = ts.combinePaths(searchDir, \"package.json\");\n                getTypingNamesFromJson(packageJsonPath, filesToWatch);\n                var bowerJsonPath = ts.combinePaths(searchDir, \"bower.json\");\n                getTypingNamesFromJson(bowerJsonPath, filesToWatch);\n                var bowerComponentsPath = ts.combinePaths(searchDir, \"bower_components\");\n                getTypingNamesFromPackagesFolder(bowerComponentsPath, filesToWatch);\n                var nodeModulesPath = ts.combinePaths(searchDir, \"node_modules\");\n                getTypingNamesFromPackagesFolder(nodeModulesPath, filesToWatch);\n            });\n            if (!typeAcquisition.disableFilenameBasedTypeAcquisition) {\n                getTypingNamesFromSourceFileNames(fileNames);\n            }\n            // add typings for unresolved imports\n            if (unresolvedImports) {\n                var module_1 = ts.deduplicate(unresolvedImports.map(nonRelativeModuleNameForTypingCache), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);\n                addInferredTypings(module_1, \"Inferred typings from unresolved imports\");\n            }\n            // Add the cached typing locations for inferred typings that are already installed\n            packageNameToTypingLocation.forEach(function (typing, name) {\n                var registryEntry = typesRegistry.get(name);\n                if (inferredTypings.has(name) && inferredTypings.get(name) === undefined && registryEntry !== undefined && isTypingUpToDate(typing, registryEntry)) {\n                    inferredTypings.set(name, typing.typingLocation);\n                }\n            });\n            // Remove typings that the user has added to the exclude list\n            for (var _i = 0, exclude_1 = exclude; _i < exclude_1.length; _i++) {\n                var excludeTypingName = exclude_1[_i];\n                var didDelete = inferredTypings.delete(excludeTypingName);\n                if (didDelete && log)\n                    log(\"Typing for \" + excludeTypingName + \" is in exclude list, will be ignored.\");\n            }\n            var newTypingNames = [];\n            var cachedTypingPaths = [];\n            inferredTypings.forEach(function (inferred, typing) {\n                if (inferred !== undefined) {\n                    cachedTypingPaths.push(inferred);\n                }\n                else {\n                    newTypingNames.push(typing);\n                }\n            });\n            var result = { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch };\n            if (log)\n                log(\"Result: \" + JSON.stringify(result));\n            return result;\n            function addInferredTyping(typingName) {\n                if (!inferredTypings.has(typingName)) {\n                    inferredTypings.set(typingName, undefined); // TODO: GH#18217\n                }\n            }\n            function addInferredTypings(typingNames, message) {\n                if (log)\n                    log(message + \": \" + JSON.stringify(typingNames));\n                ts.forEach(typingNames, addInferredTyping);\n            }\n            /**\n             * Get the typing info from common package manager json files like package.json or bower.json\n             */\n            function getTypingNamesFromJson(jsonPath, filesToWatch) {\n                if (!host.fileExists(jsonPath)) {\n                    return;\n                }\n                filesToWatch.push(jsonPath);\n                var jsonConfig = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); }).config;\n                var jsonTypingNames = ts.flatMap([jsonConfig.dependencies, jsonConfig.devDependencies, jsonConfig.optionalDependencies, jsonConfig.peerDependencies], ts.getOwnKeys);\n                addInferredTypings(jsonTypingNames, \"Typing names in '\" + jsonPath + \"' dependencies\");\n            }\n            /**\n             * Infer typing names from given file names. For example, the file name \"jquery-min.2.3.4.js\"\n             * should be inferred to the 'jquery' typing name; and \"angular-route.1.2.3.js\" should be inferred\n             * to the 'angular-route' typing name.\n             * @param fileNames are the names for source files in the project\n             */\n            function getTypingNamesFromSourceFileNames(fileNames) {\n                var fromFileNames = ts.mapDefined(fileNames, function (j) {\n                    if (!ts.hasJSFileExtension(j))\n                        return undefined;\n                    var inferredTypingName = ts.removeFileExtension(ts.getBaseFileName(j.toLowerCase()));\n                    var cleanedTypingName = ts.removeMinAndVersionNumbers(inferredTypingName);\n                    return safeList.get(cleanedTypingName);\n                });\n                if (fromFileNames.length) {\n                    addInferredTypings(fromFileNames, \"Inferred typings from file names\");\n                }\n                var hasJsxFile = ts.some(fileNames, function (f) { return ts.fileExtensionIs(f, \".jsx\" /* Jsx */); });\n                if (hasJsxFile) {\n                    if (log)\n                        log(\"Inferred 'react' typings due to presence of '.jsx' extension\");\n                    addInferredTyping(\"react\");\n                }\n            }\n            /**\n             * Infer typing names from packages folder (ex: node_module, bower_components)\n             * @param packagesFolderPath is the path to the packages folder\n             */\n            function getTypingNamesFromPackagesFolder(packagesFolderPath, filesToWatch) {\n                filesToWatch.push(packagesFolderPath);\n                // Todo: add support for ModuleResolutionHost too\n                if (!host.directoryExists(packagesFolderPath)) {\n                    return;\n                }\n                // depth of 2, so we access `node_modules/foo` but not `node_modules/foo/bar`\n                var fileNames = host.readDirectory(packagesFolderPath, [\".json\" /* Json */], /*excludes*/ undefined, /*includes*/ undefined, /*depth*/ 2);\n                if (log)\n                    log(\"Searching for typing names in \" + packagesFolderPath + \"; all files: \" + JSON.stringify(fileNames));\n                var packageNames = [];\n                for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) {\n                    var fileName = fileNames_1[_i];\n                    var normalizedFileName = ts.normalizePath(fileName);\n                    var baseFileName = ts.getBaseFileName(normalizedFileName);\n                    if (baseFileName !== \"package.json\" && baseFileName !== \"bower.json\") {\n                        continue;\n                    }\n                    var result_1 = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); });\n                    var packageJson = result_1.config;\n                    // npm 3's package.json contains a \"_requiredBy\" field\n                    // we should include all the top level module names for npm 2, and only module names whose\n                    // \"_requiredBy\" field starts with \"#\" or equals \"/\" for npm 3.\n                    if (baseFileName === \"package.json\" && packageJson._requiredBy &&\n                        ts.filter(packageJson._requiredBy, function (r) { return r[0] === \"#\" || r === \"/\"; }).length === 0) {\n                        continue;\n                    }\n                    // If the package has its own d.ts typings, those will take precedence. Otherwise the package name will be used\n                    // to download d.ts files from DefinitelyTyped\n                    if (!packageJson.name) {\n                        continue;\n                    }\n                    var ownTypes = packageJson.types || packageJson.typings;\n                    if (ownTypes) {\n                        var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName));\n                        if (log)\n                            log(\"    Package '\" + packageJson.name + \"' provides its own types.\");\n                        inferredTypings.set(packageJson.name, absolutePath);\n                    }\n                    else {\n                        packageNames.push(packageJson.name);\n                    }\n                }\n                addInferredTypings(packageNames, \"    Found package names\");\n            }\n        }\n        JsTyping.discoverTypings = discoverTypings;\n        var NameValidationResult;\n        (function (NameValidationResult) {\n            NameValidationResult[NameValidationResult[\"Ok\"] = 0] = \"Ok\";\n            NameValidationResult[NameValidationResult[\"EmptyName\"] = 1] = \"EmptyName\";\n            NameValidationResult[NameValidationResult[\"NameTooLong\"] = 2] = \"NameTooLong\";\n            NameValidationResult[NameValidationResult[\"NameStartsWithDot\"] = 3] = \"NameStartsWithDot\";\n            NameValidationResult[NameValidationResult[\"NameStartsWithUnderscore\"] = 4] = \"NameStartsWithUnderscore\";\n            NameValidationResult[NameValidationResult[\"NameContainsNonURISafeCharacters\"] = 5] = \"NameContainsNonURISafeCharacters\";\n        })(NameValidationResult = JsTyping.NameValidationResult || (JsTyping.NameValidationResult = {}));\n        var maxPackageNameLength = 214;\n        /**\n         * Validates package name using rules defined at https://docs.npmjs.com/files/package.json\n         */\n        function validatePackageName(packageName) {\n            return validatePackageNameWorker(packageName, /*supportScopedPackage*/ true);\n        }\n        JsTyping.validatePackageName = validatePackageName;\n        function validatePackageNameWorker(packageName, supportScopedPackage) {\n            if (!packageName) {\n                return 1 /* EmptyName */;\n            }\n            if (packageName.length > maxPackageNameLength) {\n                return 2 /* NameTooLong */;\n            }\n            if (packageName.charCodeAt(0) === 46 /* dot */) {\n                return 3 /* NameStartsWithDot */;\n            }\n            if (packageName.charCodeAt(0) === 95 /* _ */) {\n                return 4 /* NameStartsWithUnderscore */;\n            }\n            // check if name is scope package like: starts with @ and has one '/' in the middle\n            // scoped packages are not currently supported\n            if (supportScopedPackage) {\n                var matches = /^@([^/]+)\\/([^/]+)$/.exec(packageName);\n                if (matches) {\n                    var scopeResult = validatePackageNameWorker(matches[1], /*supportScopedPackage*/ false);\n                    if (scopeResult !== 0 /* Ok */) {\n                        return { name: matches[1], isScopeName: true, result: scopeResult };\n                    }\n                    var packageResult = validatePackageNameWorker(matches[2], /*supportScopedPackage*/ false);\n                    if (packageResult !== 0 /* Ok */) {\n                        return { name: matches[2], isScopeName: false, result: packageResult };\n                    }\n                    return 0 /* Ok */;\n                }\n            }\n            if (encodeURIComponent(packageName) !== packageName) {\n                return 5 /* NameContainsNonURISafeCharacters */;\n            }\n            return 0 /* Ok */;\n        }\n        function renderPackageNameValidationFailure(result, typing) {\n            return typeof result === \"object\" ?\n                renderPackageNameValidationFailureWorker(typing, result.result, result.name, result.isScopeName) :\n                renderPackageNameValidationFailureWorker(typing, result, typing, /*isScopeName*/ false);\n        }\n        JsTyping.renderPackageNameValidationFailure = renderPackageNameValidationFailure;\n        function renderPackageNameValidationFailureWorker(typing, result, name, isScopeName) {\n            var kind = isScopeName ? \"Scope\" : \"Package\";\n            switch (result) {\n                case 1 /* EmptyName */:\n                    return \"'\" + typing + \"':: \" + kind + \" name '\" + name + \"' cannot be empty\";\n                case 2 /* NameTooLong */:\n                    return \"'\" + typing + \"':: \" + kind + \" name '\" + name + \"' should be less than \" + maxPackageNameLength + \" characters\";\n                case 3 /* NameStartsWithDot */:\n                    return \"'\" + typing + \"':: \" + kind + \" name '\" + name + \"' cannot start with '.'\";\n                case 4 /* NameStartsWithUnderscore */:\n                    return \"'\" + typing + \"':: \" + kind + \" name '\" + name + \"' cannot start with '_'\";\n                case 5 /* NameContainsNonURISafeCharacters */:\n                    return \"'\" + typing + \"':: \" + kind + \" name '\" + name + \"' contains non URI safe characters\";\n                case 0 /* Ok */:\n                    return ts.Debug.fail(); // Shouldn't have called this.\n                default:\n                    throw ts.Debug.assertNever(result);\n            }\n        }\n    })(JsTyping = ts.JsTyping || (ts.JsTyping = {}));\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    var ScriptSnapshot;\n    (function (ScriptSnapshot) {\n        var StringScriptSnapshot = /** @class */ (function () {\n            function StringScriptSnapshot(text) {\n                this.text = text;\n            }\n            StringScriptSnapshot.prototype.getText = function (start, end) {\n                return start === 0 && end === this.text.length\n                    ? this.text\n                    : this.text.substring(start, end);\n            };\n            StringScriptSnapshot.prototype.getLength = function () {\n                return this.text.length;\n            };\n            StringScriptSnapshot.prototype.getChangeRange = function () {\n                // Text-based snapshots do not support incremental parsing. Return undefined\n                // to signal that to the caller.\n                return undefined;\n            };\n            return StringScriptSnapshot;\n        }());\n        function fromString(text) {\n            return new StringScriptSnapshot(text);\n        }\n        ScriptSnapshot.fromString = fromString;\n    })(ScriptSnapshot = ts.ScriptSnapshot || (ts.ScriptSnapshot = {}));\n    /* @internal */\n    var PackageJsonDependencyGroup;\n    (function (PackageJsonDependencyGroup) {\n        PackageJsonDependencyGroup[PackageJsonDependencyGroup[\"Dependencies\"] = 1] = \"Dependencies\";\n        PackageJsonDependencyGroup[PackageJsonDependencyGroup[\"DevDependencies\"] = 2] = \"DevDependencies\";\n        PackageJsonDependencyGroup[PackageJsonDependencyGroup[\"PeerDependencies\"] = 4] = \"PeerDependencies\";\n        PackageJsonDependencyGroup[PackageJsonDependencyGroup[\"OptionalDependencies\"] = 8] = \"OptionalDependencies\";\n        PackageJsonDependencyGroup[PackageJsonDependencyGroup[\"All\"] = 15] = \"All\";\n    })(PackageJsonDependencyGroup = ts.PackageJsonDependencyGroup || (ts.PackageJsonDependencyGroup = {}));\n    /* @internal */\n    var PackageJsonAutoImportPreference;\n    (function (PackageJsonAutoImportPreference) {\n        PackageJsonAutoImportPreference[PackageJsonAutoImportPreference[\"Off\"] = 0] = \"Off\";\n        PackageJsonAutoImportPreference[PackageJsonAutoImportPreference[\"On\"] = 1] = \"On\";\n        PackageJsonAutoImportPreference[PackageJsonAutoImportPreference[\"Auto\"] = 2] = \"Auto\";\n    })(PackageJsonAutoImportPreference = ts.PackageJsonAutoImportPreference || (ts.PackageJsonAutoImportPreference = {}));\n    var LanguageServiceMode;\n    (function (LanguageServiceMode) {\n        LanguageServiceMode[LanguageServiceMode[\"Semantic\"] = 0] = \"Semantic\";\n        LanguageServiceMode[LanguageServiceMode[\"PartialSemantic\"] = 1] = \"PartialSemantic\";\n        LanguageServiceMode[LanguageServiceMode[\"Syntactic\"] = 2] = \"Syntactic\";\n    })(LanguageServiceMode = ts.LanguageServiceMode || (ts.LanguageServiceMode = {}));\n    /* @internal */\n    ts.emptyOptions = {};\n    var SemanticClassificationFormat;\n    (function (SemanticClassificationFormat) {\n        SemanticClassificationFormat[\"Original\"] = \"original\";\n        SemanticClassificationFormat[\"TwentyTwenty\"] = \"2020\";\n    })(SemanticClassificationFormat = ts.SemanticClassificationFormat || (ts.SemanticClassificationFormat = {}));\n    var HighlightSpanKind;\n    (function (HighlightSpanKind) {\n        HighlightSpanKind[\"none\"] = \"none\";\n        HighlightSpanKind[\"definition\"] = \"definition\";\n        HighlightSpanKind[\"reference\"] = \"reference\";\n        HighlightSpanKind[\"writtenReference\"] = \"writtenReference\";\n    })(HighlightSpanKind = ts.HighlightSpanKind || (ts.HighlightSpanKind = {}));\n    var IndentStyle;\n    (function (IndentStyle) {\n        IndentStyle[IndentStyle[\"None\"] = 0] = \"None\";\n        IndentStyle[IndentStyle[\"Block\"] = 1] = \"Block\";\n        IndentStyle[IndentStyle[\"Smart\"] = 2] = \"Smart\";\n    })(IndentStyle = ts.IndentStyle || (ts.IndentStyle = {}));\n    var SemicolonPreference;\n    (function (SemicolonPreference) {\n        SemicolonPreference[\"Ignore\"] = \"ignore\";\n        SemicolonPreference[\"Insert\"] = \"insert\";\n        SemicolonPreference[\"Remove\"] = \"remove\";\n    })(SemicolonPreference = ts.SemicolonPreference || (ts.SemicolonPreference = {}));\n    function getDefaultFormatCodeSettings(newLineCharacter) {\n        return {\n            indentSize: 4,\n            tabSize: 4,\n            newLineCharacter: newLineCharacter || \"\\n\",\n            convertTabsToSpaces: true,\n            indentStyle: IndentStyle.Smart,\n            insertSpaceAfterConstructor: false,\n            insertSpaceAfterCommaDelimiter: true,\n            insertSpaceAfterSemicolonInForStatements: true,\n            insertSpaceBeforeAndAfterBinaryOperators: true,\n            insertSpaceAfterKeywordsInControlFlowStatements: true,\n            insertSpaceAfterFunctionKeywordForAnonymousFunctions: false,\n            insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false,\n            insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false,\n            insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: true,\n            insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false,\n            insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false,\n            insertSpaceBeforeFunctionParenthesis: false,\n            placeOpenBraceOnNewLineForFunctions: false,\n            placeOpenBraceOnNewLineForControlBlocks: false,\n            semicolons: SemicolonPreference.Ignore,\n            trimTrailingWhitespace: true\n        };\n    }\n    ts.getDefaultFormatCodeSettings = getDefaultFormatCodeSettings;\n    /* @internal */\n    ts.testFormatSettings = getDefaultFormatCodeSettings(\"\\n\");\n    var SymbolDisplayPartKind;\n    (function (SymbolDisplayPartKind) {\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"aliasName\"] = 0] = \"aliasName\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"className\"] = 1] = \"className\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"enumName\"] = 2] = \"enumName\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"fieldName\"] = 3] = \"fieldName\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"interfaceName\"] = 4] = \"interfaceName\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"keyword\"] = 5] = \"keyword\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"lineBreak\"] = 6] = \"lineBreak\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"numericLiteral\"] = 7] = \"numericLiteral\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"stringLiteral\"] = 8] = \"stringLiteral\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"localName\"] = 9] = \"localName\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"methodName\"] = 10] = \"methodName\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"moduleName\"] = 11] = \"moduleName\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"operator\"] = 12] = \"operator\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"parameterName\"] = 13] = \"parameterName\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"propertyName\"] = 14] = \"propertyName\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"punctuation\"] = 15] = \"punctuation\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"space\"] = 16] = \"space\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"text\"] = 17] = \"text\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"typeParameterName\"] = 18] = \"typeParameterName\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"enumMemberName\"] = 19] = \"enumMemberName\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"functionName\"] = 20] = \"functionName\";\n        SymbolDisplayPartKind[SymbolDisplayPartKind[\"regularExpressionLiteral\"] = 21] = \"regularExpressionLiteral\";\n    })(SymbolDisplayPartKind = ts.SymbolDisplayPartKind || (ts.SymbolDisplayPartKind = {}));\n    var OutliningSpanKind;\n    (function (OutliningSpanKind) {\n        /** Single or multi-line comments */\n        OutliningSpanKind[\"Comment\"] = \"comment\";\n        /** Sections marked by '// #region' and '// #endregion' comments */\n        OutliningSpanKind[\"Region\"] = \"region\";\n        /** Declarations and expressions */\n        OutliningSpanKind[\"Code\"] = \"code\";\n        /** Contiguous blocks of import declarations */\n        OutliningSpanKind[\"Imports\"] = \"imports\";\n    })(OutliningSpanKind = ts.OutliningSpanKind || (ts.OutliningSpanKind = {}));\n    var OutputFileType;\n    (function (OutputFileType) {\n        OutputFileType[OutputFileType[\"JavaScript\"] = 0] = \"JavaScript\";\n        OutputFileType[OutputFileType[\"SourceMap\"] = 1] = \"SourceMap\";\n        OutputFileType[OutputFileType[\"Declaration\"] = 2] = \"Declaration\";\n    })(OutputFileType = ts.OutputFileType || (ts.OutputFileType = {}));\n    var EndOfLineState;\n    (function (EndOfLineState) {\n        EndOfLineState[EndOfLineState[\"None\"] = 0] = \"None\";\n        EndOfLineState[EndOfLineState[\"InMultiLineCommentTrivia\"] = 1] = \"InMultiLineCommentTrivia\";\n        EndOfLineState[EndOfLineState[\"InSingleQuoteStringLiteral\"] = 2] = \"InSingleQuoteStringLiteral\";\n        EndOfLineState[EndOfLineState[\"InDoubleQuoteStringLiteral\"] = 3] = \"InDoubleQuoteStringLiteral\";\n        EndOfLineState[EndOfLineState[\"InTemplateHeadOrNoSubstitutionTemplate\"] = 4] = \"InTemplateHeadOrNoSubstitutionTemplate\";\n        EndOfLineState[EndOfLineState[\"InTemplateMiddleOrTail\"] = 5] = \"InTemplateMiddleOrTail\";\n        EndOfLineState[EndOfLineState[\"InTemplateSubstitutionPosition\"] = 6] = \"InTemplateSubstitutionPosition\";\n    })(EndOfLineState = ts.EndOfLineState || (ts.EndOfLineState = {}));\n    var TokenClass;\n    (function (TokenClass) {\n        TokenClass[TokenClass[\"Punctuation\"] = 0] = \"Punctuation\";\n        TokenClass[TokenClass[\"Keyword\"] = 1] = \"Keyword\";\n        TokenClass[TokenClass[\"Operator\"] = 2] = \"Operator\";\n        TokenClass[TokenClass[\"Comment\"] = 3] = \"Comment\";\n        TokenClass[TokenClass[\"Whitespace\"] = 4] = \"Whitespace\";\n        TokenClass[TokenClass[\"Identifier\"] = 5] = \"Identifier\";\n        TokenClass[TokenClass[\"NumberLiteral\"] = 6] = \"NumberLiteral\";\n        TokenClass[TokenClass[\"BigIntLiteral\"] = 7] = \"BigIntLiteral\";\n        TokenClass[TokenClass[\"StringLiteral\"] = 8] = \"StringLiteral\";\n        TokenClass[TokenClass[\"RegExpLiteral\"] = 9] = \"RegExpLiteral\";\n    })(TokenClass = ts.TokenClass || (ts.TokenClass = {}));\n    var ScriptElementKind;\n    (function (ScriptElementKind) {\n        ScriptElementKind[\"unknown\"] = \"\";\n        ScriptElementKind[\"warning\"] = \"warning\";\n        /** predefined type (void) or keyword (class) */\n        ScriptElementKind[\"keyword\"] = \"keyword\";\n        /** top level script node */\n        ScriptElementKind[\"scriptElement\"] = \"script\";\n        /** module foo {} */\n        ScriptElementKind[\"moduleElement\"] = \"module\";\n        /** class X {} */\n        ScriptElementKind[\"classElement\"] = \"class\";\n        /** var x = class X {} */\n        ScriptElementKind[\"localClassElement\"] = \"local class\";\n        /** interface Y {} */\n        ScriptElementKind[\"interfaceElement\"] = \"interface\";\n        /** type T = ... */\n        ScriptElementKind[\"typeElement\"] = \"type\";\n        /** enum E */\n        ScriptElementKind[\"enumElement\"] = \"enum\";\n        ScriptElementKind[\"enumMemberElement\"] = \"enum member\";\n        /**\n         * Inside module and script only\n         * const v = ..\n         */\n        ScriptElementKind[\"variableElement\"] = \"var\";\n        /** Inside function */\n        ScriptElementKind[\"localVariableElement\"] = \"local var\";\n        /**\n         * Inside module and script only\n         * function f() { }\n         */\n        ScriptElementKind[\"functionElement\"] = \"function\";\n        /** Inside function */\n        ScriptElementKind[\"localFunctionElement\"] = \"local function\";\n        /** class X { [public|private]* foo() {} } */\n        ScriptElementKind[\"memberFunctionElement\"] = \"method\";\n        /** class X { [public|private]* [get|set] foo:number; } */\n        ScriptElementKind[\"memberGetAccessorElement\"] = \"getter\";\n        ScriptElementKind[\"memberSetAccessorElement\"] = \"setter\";\n        /**\n         * class X { [public|private]* foo:number; }\n         * interface Y { foo:number; }\n         */\n        ScriptElementKind[\"memberVariableElement\"] = \"property\";\n        /** class X { constructor() { } } */\n        ScriptElementKind[\"constructorImplementationElement\"] = \"constructor\";\n        /** interface Y { ():number; } */\n        ScriptElementKind[\"callSignatureElement\"] = \"call\";\n        /** interface Y { []:number; } */\n        ScriptElementKind[\"indexSignatureElement\"] = \"index\";\n        /** interface Y { new():Y; } */\n        ScriptElementKind[\"constructSignatureElement\"] = \"construct\";\n        /** function foo(*Y*: string) */\n        ScriptElementKind[\"parameterElement\"] = \"parameter\";\n        ScriptElementKind[\"typeParameterElement\"] = \"type parameter\";\n        ScriptElementKind[\"primitiveType\"] = \"primitive type\";\n        ScriptElementKind[\"label\"] = \"label\";\n        ScriptElementKind[\"alias\"] = \"alias\";\n        ScriptElementKind[\"constElement\"] = \"const\";\n        ScriptElementKind[\"letElement\"] = \"let\";\n        ScriptElementKind[\"directory\"] = \"directory\";\n        ScriptElementKind[\"externalModuleName\"] = \"external module name\";\n        /**\n         * <JsxTagName attribute1 attribute2={0} />\n         */\n        ScriptElementKind[\"jsxAttribute\"] = \"JSX attribute\";\n        /** String literal */\n        ScriptElementKind[\"string\"] = \"string\";\n    })(ScriptElementKind = ts.ScriptElementKind || (ts.ScriptElementKind = {}));\n    var ScriptElementKindModifier;\n    (function (ScriptElementKindModifier) {\n        ScriptElementKindModifier[\"none\"] = \"\";\n        ScriptElementKindModifier[\"publicMemberModifier\"] = \"public\";\n        ScriptElementKindModifier[\"privateMemberModifier\"] = \"private\";\n        ScriptElementKindModifier[\"protectedMemberModifier\"] = \"protected\";\n        ScriptElementKindModifier[\"exportedModifier\"] = \"export\";\n        ScriptElementKindModifier[\"ambientModifier\"] = \"declare\";\n        ScriptElementKindModifier[\"staticModifier\"] = \"static\";\n        ScriptElementKindModifier[\"abstractModifier\"] = \"abstract\";\n        ScriptElementKindModifier[\"optionalModifier\"] = \"optional\";\n        ScriptElementKindModifier[\"deprecatedModifier\"] = \"deprecated\";\n        ScriptElementKindModifier[\"dtsModifier\"] = \".d.ts\";\n        ScriptElementKindModifier[\"tsModifier\"] = \".ts\";\n        ScriptElementKindModifier[\"tsxModifier\"] = \".tsx\";\n        ScriptElementKindModifier[\"jsModifier\"] = \".js\";\n        ScriptElementKindModifier[\"jsxModifier\"] = \".jsx\";\n        ScriptElementKindModifier[\"jsonModifier\"] = \".json\";\n    })(ScriptElementKindModifier = ts.ScriptElementKindModifier || (ts.ScriptElementKindModifier = {}));\n    var ClassificationTypeNames;\n    (function (ClassificationTypeNames) {\n        ClassificationTypeNames[\"comment\"] = \"comment\";\n        ClassificationTypeNames[\"identifier\"] = \"identifier\";\n        ClassificationTypeNames[\"keyword\"] = \"keyword\";\n        ClassificationTypeNames[\"numericLiteral\"] = \"number\";\n        ClassificationTypeNames[\"bigintLiteral\"] = \"bigint\";\n        ClassificationTypeNames[\"operator\"] = \"operator\";\n        ClassificationTypeNames[\"stringLiteral\"] = \"string\";\n        ClassificationTypeNames[\"whiteSpace\"] = \"whitespace\";\n        ClassificationTypeNames[\"text\"] = \"text\";\n        ClassificationTypeNames[\"punctuation\"] = \"punctuation\";\n        ClassificationTypeNames[\"className\"] = \"class name\";\n        ClassificationTypeNames[\"enumName\"] = \"enum name\";\n        ClassificationTypeNames[\"interfaceName\"] = \"interface name\";\n        ClassificationTypeNames[\"moduleName\"] = \"module name\";\n        ClassificationTypeNames[\"typeParameterName\"] = \"type parameter name\";\n        ClassificationTypeNames[\"typeAliasName\"] = \"type alias name\";\n        ClassificationTypeNames[\"parameterName\"] = \"parameter name\";\n        ClassificationTypeNames[\"docCommentTagName\"] = \"doc comment tag name\";\n        ClassificationTypeNames[\"jsxOpenTagName\"] = \"jsx open tag name\";\n        ClassificationTypeNames[\"jsxCloseTagName\"] = \"jsx close tag name\";\n        ClassificationTypeNames[\"jsxSelfClosingTagName\"] = \"jsx self closing tag name\";\n        ClassificationTypeNames[\"jsxAttribute\"] = \"jsx attribute\";\n        ClassificationTypeNames[\"jsxText\"] = \"jsx text\";\n        ClassificationTypeNames[\"jsxAttributeStringLiteralValue\"] = \"jsx attribute string literal value\";\n    })(ClassificationTypeNames = ts.ClassificationTypeNames || (ts.ClassificationTypeNames = {}));\n    var ClassificationType;\n    (function (ClassificationType) {\n        ClassificationType[ClassificationType[\"comment\"] = 1] = \"comment\";\n        ClassificationType[ClassificationType[\"identifier\"] = 2] = \"identifier\";\n        ClassificationType[ClassificationType[\"keyword\"] = 3] = \"keyword\";\n        ClassificationType[ClassificationType[\"numericLiteral\"] = 4] = \"numericLiteral\";\n        ClassificationType[ClassificationType[\"operator\"] = 5] = \"operator\";\n        ClassificationType[ClassificationType[\"stringLiteral\"] = 6] = \"stringLiteral\";\n        ClassificationType[ClassificationType[\"regularExpressionLiteral\"] = 7] = \"regularExpressionLiteral\";\n        ClassificationType[ClassificationType[\"whiteSpace\"] = 8] = \"whiteSpace\";\n        ClassificationType[ClassificationType[\"text\"] = 9] = \"text\";\n        ClassificationType[ClassificationType[\"punctuation\"] = 10] = \"punctuation\";\n        ClassificationType[ClassificationType[\"className\"] = 11] = \"className\";\n        ClassificationType[ClassificationType[\"enumName\"] = 12] = \"enumName\";\n        ClassificationType[ClassificationType[\"interfaceName\"] = 13] = \"interfaceName\";\n        ClassificationType[ClassificationType[\"moduleName\"] = 14] = \"moduleName\";\n        ClassificationType[ClassificationType[\"typeParameterName\"] = 15] = \"typeParameterName\";\n        ClassificationType[ClassificationType[\"typeAliasName\"] = 16] = \"typeAliasName\";\n        ClassificationType[ClassificationType[\"parameterName\"] = 17] = \"parameterName\";\n        ClassificationType[ClassificationType[\"docCommentTagName\"] = 18] = \"docCommentTagName\";\n        ClassificationType[ClassificationType[\"jsxOpenTagName\"] = 19] = \"jsxOpenTagName\";\n        ClassificationType[ClassificationType[\"jsxCloseTagName\"] = 20] = \"jsxCloseTagName\";\n        ClassificationType[ClassificationType[\"jsxSelfClosingTagName\"] = 21] = \"jsxSelfClosingTagName\";\n        ClassificationType[ClassificationType[\"jsxAttribute\"] = 22] = \"jsxAttribute\";\n        ClassificationType[ClassificationType[\"jsxText\"] = 23] = \"jsxText\";\n        ClassificationType[ClassificationType[\"jsxAttributeStringLiteralValue\"] = 24] = \"jsxAttributeStringLiteralValue\";\n        ClassificationType[ClassificationType[\"bigintLiteral\"] = 25] = \"bigintLiteral\";\n    })(ClassificationType = ts.ClassificationType || (ts.ClassificationType = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    // These utilities are common to multiple language service features.\n    //#region\n    ts.scanner = ts.createScanner(99 /* Latest */, /*skipTrivia*/ true);\n    var SemanticMeaning;\n    (function (SemanticMeaning) {\n        SemanticMeaning[SemanticMeaning[\"None\"] = 0] = \"None\";\n        SemanticMeaning[SemanticMeaning[\"Value\"] = 1] = \"Value\";\n        SemanticMeaning[SemanticMeaning[\"Type\"] = 2] = \"Type\";\n        SemanticMeaning[SemanticMeaning[\"Namespace\"] = 4] = \"Namespace\";\n        SemanticMeaning[SemanticMeaning[\"All\"] = 7] = \"All\";\n    })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {}));\n    function getMeaningFromDeclaration(node) {\n        switch (node.kind) {\n            case 249 /* VariableDeclaration */:\n                return ts.isInJSFile(node) && ts.getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */;\n            case 160 /* Parameter */:\n            case 198 /* BindingElement */:\n            case 163 /* PropertyDeclaration */:\n            case 162 /* PropertySignature */:\n            case 288 /* PropertyAssignment */:\n            case 289 /* ShorthandPropertyAssignment */:\n            case 165 /* MethodDeclaration */:\n            case 164 /* MethodSignature */:\n            case 166 /* Constructor */:\n            case 167 /* GetAccessor */:\n            case 168 /* SetAccessor */:\n            case 251 /* FunctionDeclaration */:\n            case 208 /* FunctionExpression */:\n            case 209 /* ArrowFunction */:\n            case 287 /* CatchClause */:\n            case 280 /* JsxAttribute */:\n                return 1 /* Value */;\n            case 159 /* TypeParameter */:\n            case 253 /* InterfaceDeclaration */:\n            case 254 /* TypeAliasDeclaration */:\n            case 177 /* TypeLiteral */:\n                return 2 /* Type */;\n            case 331 /* JSDocTypedefTag */:\n                // If it has no name node, it shares the name with the value declaration below it.\n                return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */;\n            case 291 /* EnumMember */:\n            case 252 /* ClassDeclaration */:\n                return 1 /* Value */ | 2 /* Type */;\n            case 256 /* ModuleDeclaration */:\n                if (ts.isAmbientModule(node)) {\n                    return 4 /* Namespace */ | 1 /* Value */;\n                }\n                else if (ts.getModuleInstanceState(node) === 1 /* Instantiated */) {\n                    return 4 /* Namespace */ | 1 /* Value */;\n                }\n                else {\n                    return 4 /* Namespace */;\n                }\n            case 255 /* EnumDeclaration */:\n            case 264 /* NamedImports */:\n            case 265 /* ImportSpecifier */:\n            case 260 /* ImportEqualsDeclaration */:\n            case 261 /* ImportDeclaration */:\n            case 266 /* ExportAssignment */:\n            case 267 /* ExportDeclaration */:\n                return 7 /* All */;\n            // An external module can be a Value\n            case 297 /* SourceFile */:\n                return 4 /* Namespace */ | 1 /* Value */;\n        }\n        return 7 /* All */;\n    }\n    ts.getMeaningFromDeclaration = getMeaningFromDeclaration;\n    function getMeaningFromLocation(node) {\n        node = getAdjustedReferenceLocation(node);\n        if (node.kind === 297 /* SourceFile */) {\n            return 1 /* Value */;\n        }\n        else if (node.parent.kind === 266 /* ExportAssignment */\n            || node.parent.kind === 272 /* ExternalModuleReference */\n            || node.parent.kind === 265 /* ImportSpecifier */\n            || node.parent.kind === 262 /* ImportClause */\n            || ts.isImportEqualsDeclaration(node.parent) && node === node.parent.name) {\n            return 7 /* All */;\n        }\n        else if (isInRightSideOfInternalImportEqualsDeclaration(node)) {\n            return getMeaningFromRightHandSideOfImportEquals(node);\n        }\n        else if (ts.isDeclarationName(node)) {\n            return getMeaningFromDeclaration(node.parent);\n        }\n        else if (ts.isEntityName(node) && ts.isJSDocNameReference(node.parent)) {\n            return 7 /* All */;\n        }\n        else if (isTypeReference(node)) {\n            return 2 /* Type */;\n        }\n        else if (isNamespaceReference(node)) {\n            return 4 /* Namespace */;\n        }\n        else if (ts.isTypeParameterDeclaration(node.parent)) {\n            ts.Debug.assert(ts.isJSDocTemplateTag(node.parent.parent)); // Else would be handled by isDeclarationName\n            return 2 /* Type */;\n        }\n        else if (ts.isLiteralTypeNode(node.parent)) {\n            // This might be T[\"name\"], which is actually referencing a property and not a type. So allow both meanings.\n            return 2 /* Type */ | 1 /* Value */;\n        }\n        else {\n            return 1 /* Value */;\n        }\n    }\n    ts.getMeaningFromLocation = getMeaningFromLocation;\n    function getMeaningFromRightHandSideOfImportEquals(node) {\n        //     import a = |b|; // Namespace\n        //     import a = |b.c|; // Value, type, namespace\n        //     import a = |b.c|.d; // Namespace\n        var name = node.kind === 157 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined;\n        return name && name.parent.kind === 260 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */;\n    }\n    function isInRightSideOfInternalImportEqualsDeclaration(node) {\n        while (node.parent.kind === 157 /* QualifiedName */) {\n            node = node.parent;\n        }\n        return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node;\n    }\n    ts.isInRightSideOfInternalImportEqualsDeclaration = isInRightSideOfInternalImportEqualsDeclaration;\n    function isNamespaceReference(node) {\n        return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node);\n    }\n    function isQualifiedNameNamespaceReference(node) {\n        var root = node;\n        var isLastClause = true;\n        if (root.parent.kind === 157 /* QualifiedName */) {\n            while (root.parent && root.parent.kind === 157 /* QualifiedName */) {\n                root = root.parent;\n            }\n            isLastClause = root.right === node;\n        }\n        return root.parent.kind === 173 /* TypeReference */ && !isLastClause;\n    }\n    function isPropertyAccessNamespaceReference(node) {\n        var root = node;\n        var isLastClause = true;\n        if (root.parent.kind === 201 /* PropertyAccessExpression */) {\n            while (root.parent && root.parent.kind === 201 /* PropertyAccessExpression */) {\n                root = root.parent;\n            }\n            isLastClause = root.name === node;\n        }\n        if (!isLastClause && root.parent.kind === 223 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 286 /* HeritageClause */) {\n            var decl = root.parent.parent.parent;\n            return (decl.kind === 252 /* ClassDeclaration */ && root.parent.parent.token === 116 /* ImplementsKeyword */) ||\n                (decl.kind === 253 /* InterfaceDeclaration */ && root.parent.parent.token === 93 /* ExtendsKeyword */);\n        }\n        return false;\n    }\n    function isTypeReference(node) {\n        if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) {\n            node = node.parent;\n        }\n        switch (node.kind) {\n            case 107 /* ThisKeyword */:\n                return !ts.isExpressionNode(node);\n            case 187 /* ThisType */:\n                return true;\n        }\n        switch (node.parent.kind) {\n            case 173 /* TypeReference */:\n                return true;\n            case 195 /* ImportType */:\n                return !node.parent.isTypeOf;\n            case 223 /* ExpressionWithTypeArguments */:\n                return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent);\n        }\n        return false;\n    }\n    function isCallExpressionTarget(node, includeElementAccess, skipPastOuterExpressions) {\n        if (includeElementAccess === void 0) { includeElementAccess = false; }\n        if (skipPastOuterExpressions === void 0) { skipPastOuterExpressions = false; }\n        return isCalleeWorker(node, ts.isCallExpression, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions);\n    }\n    ts.isCallExpressionTarget = isCallExpressionTarget;\n    function isNewExpressionTarget(node, includeElementAccess, skipPastOuterExpressions) {\n        if (includeElementAccess === void 0) { includeElementAccess = false; }\n        if (skipPastOuterExpressions === void 0) { skipPastOuterExpressions = false; }\n        return isCalleeWorker(node, ts.isNewExpression, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions);\n    }\n    ts.isNewExpressionTarget = isNewExpressionTarget;\n    function isCallOrNewExpressionTarget(node, includeElementAccess, skipPastOuterExpressions) {\n        if (includeElementAccess === void 0) { includeElementAccess = false; }\n        if (skipPastOuterExpressions === void 0) { skipPastOuterExpressions = false; }\n        return isCalleeWorker(node, ts.isCallOrNewExpression, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions);\n    }\n    ts.isCallOrNewExpressionTarget = isCallOrNewExpressionTarget;\n    function isTaggedTemplateTag(node, includeElementAccess, skipPastOuterExpressions) {\n        if (includeElementAccess === void 0) { includeElementAccess = false; }\n        if (skipPastOuterExpressions === void 0) { skipPastOuterExpressions = false; }\n        return isCalleeWorker(node, ts.isTaggedTemplateExpression, selectTagOfTaggedTemplateExpression, includeElementAccess, skipPastOuterExpressions);\n    }\n    ts.isTaggedTemplateTag = isTaggedTemplateTag;\n    function isDecoratorTarget(node, includeElementAccess, skipPastOuterExpressions) {\n        if (includeElementAccess === void 0) { includeElementAccess = false; }\n        if (skipPastOuterExpressions === void 0) { skipPastOuterExpressions = false; }\n        return isCalleeWorker(node, ts.isDecorator, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions);\n    }\n    ts.isDecoratorTarget = isDecoratorTarget;\n    function isJsxOpeningLikeElementTagName(node, includeElementAccess, skipPastOuterExpressions) {\n        if (includeElementAccess === void 0) { includeElementAccess = false; }\n        if (skipPastOuterExpressions === void 0) { skipPastOuterExpressions = false; }\n        return isCalleeWorker(node, ts.isJsxOpeningLikeElement, selectTagNameOfJsxOpeningLikeElement, includeElementAccess, skipPastOuterExpressions);\n    }\n    ts.isJsxOpeningLikeElementTagName = isJsxOpeningLikeElementTagName;\n    function selectExpressionOfCallOrNewExpressionOrDecorator(node) {\n        return node.expression;\n    }\n    function selectTagOfTaggedTemplateExpression(node) {\n        return node.tag;\n    }\n    function selectTagNameOfJsxOpeningLikeElement(node) {\n        return node.tagName;\n    }\n    function isCalleeWorker(node, pred, calleeSelector, includeElementAccess, skipPastOuterExpressions) {\n        var target = includeElementAccess ? climbPastPropertyOrElementAccess(node) : climbPastPropertyAccess(node);\n        if (skipPastOuterExpressions) {\n            target = ts.skipOuterExpressions(target);\n        }\n        return !!target && !!target.parent && pred(target.parent) && calleeSelector(target.parent) === target;\n    }\n    function climbPastPropertyAccess(node) {\n        return isRightSideOfPropertyAccess(node) ? node.parent : node;\n    }\n    ts.climbPastPropertyAccess = climbPastPropertyAccess;\n    function climbPastPropertyOrElementAccess(node) {\n        return isRightSideOfPropertyAccess(node) || isArgumentExpressionOfElementAccess(node) ? node.parent : node;\n    }\n    ts.climbPastPropertyOrElementAccess = climbPastPropertyOrElementAccess;\n    function getTargetLabel(referenceNode, labelName) {\n        while (referenceNode) {\n            if (referenceNode.kind === 245 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) {\n                return referenceNode.label;\n            }\n            referenceNode = referenceNode.parent;\n        }\n        return undefined;\n    }\n    ts.getTargetLabel = getTargetLabel;\n    function hasPropertyAccessExpressionWithName(node, funcName) {\n        if (!ts.isPropertyAccessExpression(node.expression)) {\n            return false;\n        }\n        return node.expression.name.text === funcName;\n    }\n    ts.hasPropertyAccessExpressionWithName = hasPropertyAccessExpressionWithName;\n    function isJumpStatementTarget(node) {\n        var _a;\n        return ts.isIdentifier(node) && ((_a = ts.tryCast(node.parent, ts.isBreakOrContinueStatement)) === null || _a === void 0 ? void 0 : _a.label) === node;\n    }\n    ts.isJumpStatementTarget = isJumpStatementTarget;\n    function isLabelOfLabeledStatement(node) {\n        var _a;\n        return ts.isIdentifier(node) && ((_a = ts.tryCast(node.parent, ts.isLabeledStatement)) === null || _a === void 0 ? void 0 : _a.label) === node;\n    }\n    ts.isLabelOfLabeledStatement = isLabelOfLabeledStatement;\n    function isLabelName(node) {\n        return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node);\n    }\n    ts.isLabelName = isLabelName;\n    function isTagName(node) {\n        var _a;\n        return ((_a = ts.tryCast(node.parent, ts.isJSDocTag)) === null || _a === void 0 ? void 0 : _a.tagName) === node;\n    }\n    ts.isTagName = isTagName;\n    function isRightSideOfQualifiedName(node) {\n        var _a;\n        return ((_a = ts.tryCast(node.parent, ts.isQualifiedName)) === null || _a === void 0 ? void 0 : _a.right) === node;\n    }\n    ts.isRightSideOfQualifiedName = isRightSideOfQualifiedName;\n    function isRightSideOfPropertyAccess(node) {\n        var _a;\n        return ((_a = ts.tryCast(node.parent, ts.isPropertyAccessExpression)) === null || _a === void 0 ? void 0 : _a.name) === node;\n    }\n    ts.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess;\n    function isArgumentExpressionOfElementAccess(node) {\n        var _a;\n        return ((_a = ts.tryCast(node.parent, ts.isElementAccessExpression)) === null || _a === void 0 ? void 0 : _a.argumentExpression) === node;\n    }\n    ts.isArgumentExpressionOfElementAccess = isArgumentExpressionOfElementAccess;\n    function isNameOfModuleDeclaration(node) {\n        var _a;\n        return ((_a = ts.tryCast(node.parent, ts.isModuleDeclaration)) === null || _a === void 0 ? void 0 : _a.name) === node;\n    }\n    ts.isNameOfModuleDeclaration = isNameOfModuleDeclaration;\n    function isNameOfFunctionDeclaration(node) {\n        var _a;\n        return ts.isIdentifier(node) && ((_a = ts.tryCast(node.parent, ts.isFunctionLike)) === null || _a === void 0 ? void 0 : _a.name) === node;\n    }\n    ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration;\n    function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) {\n        switch (node.parent.kind) {\n            case 163 /* PropertyDeclaration */:\n            case 162 /* PropertySignature */:\n            case 288 /* PropertyAssignment */:\n            case 291 /* EnumMember */:\n            case 165 /* MethodDeclaration */:\n            case 164 /* MethodSignature */:\n            case 167 /* GetAccessor */:\n            case 168 /* SetAccessor */:\n            case 256 /* ModuleDeclaration */:\n                return ts.getNameOfDeclaration(node.parent) === node;\n            case 202 /* ElementAccessExpression */:\n                return node.parent.argumentExpression === node;\n            case 158 /* ComputedPropertyName */:\n                return true;\n            case 191 /* LiteralType */:\n                return node.parent.parent.kind === 189 /* IndexedAccessType */;\n            default:\n                return false;\n        }\n    }\n    ts.isLiteralNameOfPropertyDeclarationOrIndexAccess = isLiteralNameOfPropertyDeclarationOrIndexAccess;\n    function isExpressionOfExternalModuleImportEqualsDeclaration(node) {\n        return ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) &&\n            ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node;\n    }\n    ts.isExpressionOfExternalModuleImportEqualsDeclaration = isExpressionOfExternalModuleImportEqualsDeclaration;\n    function getContainerNode(node) {\n        if (ts.isJSDocTypeAlias(node)) {\n            // This doesn't just apply to the node immediately under the comment, but to everything in its parent's scope.\n            // node.parent = the JSDoc comment, node.parent.parent = the node having the comment.\n            // Then we get parent again in the loop.\n            node = node.parent.parent;\n        }\n        while (true) {\n            node = node.parent;\n            if (!node) {\n                return undefined;\n            }\n            switch (node.kind) {\n                case 297 /* SourceFile */:\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                case 251 /* FunctionDeclaration */:\n                case 208 /* FunctionExpression */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                case 252 /* ClassDeclaration */:\n                case 253 /* InterfaceDeclaration */:\n                case 255 /* EnumDeclaration */:\n                case 256 /* ModuleDeclaration */:\n                    return node;\n            }\n        }\n    }\n    ts.getContainerNode = getContainerNode;\n    function getNodeKind(node) {\n        switch (node.kind) {\n            case 297 /* SourceFile */:\n                return ts.isExternalModule(node) ? \"module\" /* moduleElement */ : \"script\" /* scriptElement */;\n            case 256 /* ModuleDeclaration */:\n                return \"module\" /* moduleElement */;\n            case 252 /* ClassDeclaration */:\n            case 221 /* ClassExpression */:\n                return \"class\" /* classElement */;\n            case 253 /* InterfaceDeclaration */: return \"interface\" /* interfaceElement */;\n            case 254 /* TypeAliasDeclaration */:\n            case 324 /* JSDocCallbackTag */:\n            case 331 /* JSDocTypedefTag */:\n                return \"type\" /* typeElement */;\n            case 255 /* EnumDeclaration */: return \"enum\" /* enumElement */;\n            case 249 /* VariableDeclaration */:\n                return getKindOfVariableDeclaration(node);\n            case 198 /* BindingElement */:\n                return getKindOfVariableDeclaration(ts.getRootDeclaration(node));\n            case 209 /* ArrowFunction */:\n            case 251 /* FunctionDeclaration */:\n            case 208 /* FunctionExpression */:\n                return \"function\" /* functionElement */;\n            case 167 /* GetAccessor */: return \"getter\" /* memberGetAccessorElement */;\n            case 168 /* SetAccessor */: return \"setter\" /* memberSetAccessorElement */;\n            case 165 /* MethodDeclaration */:\n            case 164 /* MethodSignature */:\n                return \"method\" /* memberFunctionElement */;\n            case 288 /* PropertyAssignment */:\n                var initializer = node.initializer;\n                return ts.isFunctionLike(initializer) ? \"method\" /* memberFunctionElement */ : \"property\" /* memberVariableElement */;\n            case 163 /* PropertyDeclaration */:\n            case 162 /* PropertySignature */:\n            case 289 /* ShorthandPropertyAssignment */:\n            case 290 /* SpreadAssignment */:\n                return \"property\" /* memberVariableElement */;\n            case 171 /* IndexSignature */: return \"index\" /* indexSignatureElement */;\n            case 170 /* ConstructSignature */: return \"construct\" /* constructSignatureElement */;\n            case 169 /* CallSignature */: return \"call\" /* callSignatureElement */;\n            case 166 /* Constructor */: return \"constructor\" /* constructorImplementationElement */;\n            case 159 /* TypeParameter */: return \"type parameter\" /* typeParameterElement */;\n            case 291 /* EnumMember */: return \"enum member\" /* enumMemberElement */;\n            case 160 /* Parameter */: return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) ? \"property\" /* memberVariableElement */ : \"parameter\" /* parameterElement */;\n            case 260 /* ImportEqualsDeclaration */:\n            case 265 /* ImportSpecifier */:\n            case 270 /* ExportSpecifier */:\n            case 263 /* NamespaceImport */:\n            case 269 /* NamespaceExport */:\n                return \"alias\" /* alias */;\n            case 216 /* BinaryExpression */:\n                var kind = ts.getAssignmentDeclarationKind(node);\n                var right = node.right;\n                switch (kind) {\n                    case 7 /* ObjectDefinePropertyValue */:\n                    case 8 /* ObjectDefinePropertyExports */:\n                    case 9 /* ObjectDefinePrototypeProperty */:\n                    case 0 /* None */:\n                        return \"\" /* unknown */;\n                    case 1 /* ExportsProperty */:\n                    case 2 /* ModuleExports */:\n                        var rightKind = getNodeKind(right);\n                        return rightKind === \"\" /* unknown */ ? \"const\" /* constElement */ : rightKind;\n                    case 3 /* PrototypeProperty */:\n                        return ts.isFunctionExpression(right) ? \"method\" /* memberFunctionElement */ : \"property\" /* memberVariableElement */;\n                    case 4 /* ThisProperty */:\n                        return \"property\" /* memberVariableElement */; // property\n                    case 5 /* Property */:\n                        // static method / property\n                        return ts.isFunctionExpression(right) ? \"method\" /* memberFunctionElement */ : \"property\" /* memberVariableElement */;\n                    case 6 /* Prototype */:\n                        return \"local class\" /* localClassElement */;\n                    default: {\n                        ts.assertType(kind);\n                        return \"\" /* unknown */;\n                    }\n                }\n            case 78 /* Identifier */:\n                return ts.isImportClause(node.parent) ? \"alias\" /* alias */ : \"\" /* unknown */;\n            case 266 /* ExportAssignment */:\n                var scriptKind = getNodeKind(node.expression);\n                // If the expression didn't come back with something (like it does for an identifiers)\n                return scriptKind === \"\" /* unknown */ ? \"const\" /* constElement */ : scriptKind;\n            default:\n                return \"\" /* unknown */;\n        }\n        function getKindOfVariableDeclaration(v) {\n            return ts.isVarConst(v)\n                ? \"const\" /* constElement */\n                : ts.isLet(v)\n                    ? \"let\" /* letElement */\n                    : \"var\" /* variableElement */;\n        }\n    }\n    ts.getNodeKind = getNodeKind;\n    function isThis(node) {\n        switch (node.kind) {\n            case 107 /* ThisKeyword */:\n                // case SyntaxKind.ThisType: TODO: GH#9267\n                return true;\n            case 78 /* Identifier */:\n                // 'this' as a parameter\n                return ts.identifierIsThisKeyword(node) && node.parent.kind === 160 /* Parameter */;\n            default:\n                return false;\n        }\n    }\n    ts.isThis = isThis;\n    // Matches the beginning of a triple slash directive\n    var tripleSlashDirectivePrefixRegex = /^\\/\\/\\/\\s*</;\n    function getLineStartPositionForPosition(position, sourceFile) {\n        var lineStarts = ts.getLineStarts(sourceFile);\n        var line = sourceFile.getLineAndCharacterOfPosition(position).line;\n        return lineStarts[line];\n    }\n    ts.getLineStartPositionForPosition = getLineStartPositionForPosition;\n    function rangeContainsRange(r1, r2) {\n        return startEndContainsRange(r1.pos, r1.end, r2);\n    }\n    ts.rangeContainsRange = rangeContainsRange;\n    function rangeContainsRangeExclusive(r1, r2) {\n        return rangeContainsPositionExclusive(r1, r2.pos) && rangeContainsPositionExclusive(r1, r2.end);\n    }\n    ts.rangeContainsRangeExclusive = rangeContainsRangeExclusive;\n    function rangeContainsPosition(r, pos) {\n        return r.pos <= pos && pos <= r.end;\n    }\n    ts.rangeContainsPosition = rangeContainsPosition;\n    function rangeContainsPositionExclusive(r, pos) {\n        return r.pos < pos && pos < r.end;\n    }\n    ts.rangeContainsPositionExclusive = rangeContainsPositionExclusive;\n    function startEndContainsRange(start, end, range) {\n        return start <= range.pos && end >= range.end;\n    }\n    ts.startEndContainsRange = startEndContainsRange;\n    function rangeContainsStartEnd(range, start, end) {\n        return range.pos <= start && range.end >= end;\n    }\n    ts.rangeContainsStartEnd = rangeContainsStartEnd;\n    function rangeOverlapsWithStartEnd(r1, start, end) {\n        return startEndOverlapsWithStartEnd(r1.pos, r1.end, start, end);\n    }\n    ts.rangeOverlapsWithStartEnd = rangeOverlapsWithStartEnd;\n    function nodeOverlapsWithStartEnd(node, sourceFile, start, end) {\n        return startEndOverlapsWithStartEnd(node.getStart(sourceFile), node.end, start, end);\n    }\n    ts.nodeOverlapsWithStartEnd = nodeOverlapsWithStartEnd;\n    function startEndOverlapsWithStartEnd(start1, end1, start2, end2) {\n        var start = Math.max(start1, start2);\n        var end = Math.min(end1, end2);\n        return start < end;\n    }\n    ts.startEndOverlapsWithStartEnd = startEndOverlapsWithStartEnd;\n    /**\n     * Assumes `candidate.start <= position` holds.\n     */\n    function positionBelongsToNode(candidate, position, sourceFile) {\n        ts.Debug.assert(candidate.pos <= position);\n        return position < candidate.end || !isCompletedNode(candidate, sourceFile);\n    }\n    ts.positionBelongsToNode = positionBelongsToNode;\n    function isCompletedNode(n, sourceFile) {\n        if (n === undefined || ts.nodeIsMissing(n)) {\n            return false;\n        }\n        switch (n.kind) {\n            case 252 /* ClassDeclaration */:\n            case 253 /* InterfaceDeclaration */:\n            case 255 /* EnumDeclaration */:\n            case 200 /* ObjectLiteralExpression */:\n            case 196 /* ObjectBindingPattern */:\n            case 177 /* TypeLiteral */:\n            case 230 /* Block */:\n            case 257 /* ModuleBlock */:\n            case 258 /* CaseBlock */:\n            case 264 /* NamedImports */:\n            case 268 /* NamedExports */:\n                return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile);\n            case 287 /* CatchClause */:\n                return isCompletedNode(n.block, sourceFile);\n            case 204 /* NewExpression */:\n                if (!n.arguments) {\n                    return true;\n                }\n            // falls through\n            case 203 /* CallExpression */:\n            case 207 /* ParenthesizedExpression */:\n            case 186 /* ParenthesizedType */:\n                return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile);\n            case 174 /* FunctionType */:\n            case 175 /* ConstructorType */:\n                return isCompletedNode(n.type, sourceFile);\n            case 166 /* Constructor */:\n            case 167 /* GetAccessor */:\n            case 168 /* SetAccessor */:\n            case 251 /* FunctionDeclaration */:\n            case 208 /* FunctionExpression */:\n            case 165 /* MethodDeclaration */:\n            case 164 /* MethodSignature */:\n            case 170 /* ConstructSignature */:\n            case 169 /* CallSignature */:\n            case 209 /* ArrowFunction */:\n                if (n.body) {\n                    return isCompletedNode(n.body, sourceFile);\n                }\n                if (n.type) {\n                    return isCompletedNode(n.type, sourceFile);\n                }\n                // Even though type parameters can be unclosed, we can get away with\n                // having at least a closing paren.\n                return hasChildOfKind(n, 21 /* CloseParenToken */, sourceFile);\n            case 256 /* ModuleDeclaration */:\n                return !!n.body && isCompletedNode(n.body, sourceFile);\n            case 234 /* IfStatement */:\n                if (n.elseStatement) {\n                    return isCompletedNode(n.elseStatement, sourceFile);\n                }\n                return isCompletedNode(n.thenStatement, sourceFile);\n            case 233 /* ExpressionStatement */:\n                return isCompletedNode(n.expression, sourceFile) ||\n                    hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile);\n            case 199 /* ArrayLiteralExpression */:\n            case 197 /* ArrayBindingPattern */:\n            case 202 /* ElementAccessExpression */:\n            case 158 /* ComputedPropertyName */:\n            case 179 /* TupleType */:\n                return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile);\n            case 171 /* IndexSignature */:\n                if (n.type) {\n                    return isCompletedNode(n.type, sourceFile);\n                }\n                return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile);\n            case 284 /* CaseClause */:\n            case 285 /* DefaultClause */:\n                // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed\n                return false;\n            case 237 /* ForStatement */:\n            case 238 /* ForInStatement */:\n            case 239 /* ForOfStatement */:\n            case 236 /* WhileStatement */:\n                return isCompletedNode(n.statement, sourceFile);\n            case 235 /* DoStatement */:\n                // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')';\n                return hasChildOfKind(n, 114 /* WhileKeyword */, sourceFile)\n                    ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile)\n                    : isCompletedNode(n.statement, sourceFile);\n            case 176 /* TypeQuery */:\n                return isCompletedNode(n.exprName, sourceFile);\n            case 211 /* TypeOfExpression */:\n            case 210 /* DeleteExpression */:\n            case 212 /* VoidExpression */:\n            case 219 /* YieldExpression */:\n            case 220 /* SpreadElement */:\n                var unaryWordExpression = n;\n                return isCompletedNode(unaryWordExpression.expression, sourceFile);\n            case 205 /* TaggedTemplateExpression */:\n                return isCompletedNode(n.template, sourceFile);\n            case 218 /* TemplateExpression */:\n                var lastSpan = ts.lastOrUndefined(n.templateSpans);\n                return isCompletedNode(lastSpan, sourceFile);\n            case 228 /* TemplateSpan */:\n                return ts.nodeIsPresent(n.literal);\n            case 267 /* ExportDeclaration */:\n            case 261 /* ImportDeclaration */:\n                return ts.nodeIsPresent(n.moduleSpecifier);\n            case 214 /* PrefixUnaryExpression */:\n                return isCompletedNode(n.operand, sourceFile);\n            case 216 /* BinaryExpression */:\n                return isCompletedNode(n.right, sourceFile);\n            case 217 /* ConditionalExpression */:\n                return isCompletedNode(n.whenFalse, sourceFile);\n            default:\n                return true;\n        }\n    }\n    /*\n     * Checks if node ends with 'expectedLastToken'.\n     * If child at position 'length - 1' is 'SemicolonToken' it is skipped and 'expectedLastToken' is compared with child at position 'length - 2'.\n     */\n    function nodeEndsWith(n, expectedLastToken, sourceFile) {\n        var children = n.getChildren(sourceFile);\n        if (children.length) {\n            var lastChild = ts.last(children);\n            if (lastChild.kind === expectedLastToken) {\n                return true;\n            }\n            else if (lastChild.kind === 26 /* SemicolonToken */ && children.length !== 1) {\n                return children[children.length - 2].kind === expectedLastToken;\n            }\n        }\n        return false;\n    }\n    function findListItemInfo(node) {\n        var list = findContainingList(node);\n        // It is possible at this point for syntaxList to be undefined, either if\n        // node.parent had no list child, or if none of its list children contained\n        // the span of node. If this happens, return undefined. The caller should\n        // handle this case.\n        if (!list) {\n            return undefined;\n        }\n        var children = list.getChildren();\n        var listItemIndex = ts.indexOfNode(children, node);\n        return {\n            listItemIndex: listItemIndex,\n            list: list\n        };\n    }\n    ts.findListItemInfo = findListItemInfo;\n    function hasChildOfKind(n, kind, sourceFile) {\n        return !!findChildOfKind(n, kind, sourceFile);\n    }\n    ts.hasChildOfKind = hasChildOfKind;\n    function findChildOfKind(n, kind, sourceFile) {\n        return ts.find(n.getChildren(sourceFile), function (c) { return c.kind === kind; });\n    }\n    ts.findChildOfKind = findChildOfKind;\n    function findContainingList(node) {\n        // The node might be a list element (nonsynthetic) or a comma (synthetic). Either way, it will\n        // be parented by the container of the SyntaxList, not the SyntaxList itself.\n        // In order to find the list item index, we first need to locate SyntaxList itself and then search\n        // for the position of the relevant node (or comma).\n        var syntaxList = ts.find(node.parent.getChildren(), function (c) { return ts.isSyntaxList(c) && rangeContainsRange(c, node); });\n        // Either we didn't find an appropriate list, or the list must contain us.\n        ts.Debug.assert(!syntaxList || ts.contains(syntaxList.getChildren(), node));\n        return syntaxList;\n    }\n    ts.findContainingList = findContainingList;\n    function isDefaultModifier(node) {\n        return node.kind === 87 /* DefaultKeyword */;\n    }\n    function isClassKeyword(node) {\n        return node.kind === 83 /* ClassKeyword */;\n    }\n    function isFunctionKeyword(node) {\n        return node.kind === 97 /* FunctionKeyword */;\n    }\n    function getAdjustedLocationForClass(node) {\n        if (ts.isNamedDeclaration(node)) {\n            return node.name;\n        }\n        if (ts.isClassDeclaration(node)) {\n            // for class and function declarations, use the `default` modifier\n            // when the declaration is unnamed.\n            var defaultModifier = ts.find(node.modifiers, isDefaultModifier);\n            if (defaultModifier)\n                return defaultModifier;\n        }\n        if (ts.isClassExpression(node)) {\n            // for class expressions, use the `class` keyword when the class is unnamed\n            var classKeyword = ts.find(node.getChildren(), isClassKeyword);\n            if (classKeyword)\n                return classKeyword;\n        }\n    }\n    function getAdjustedLocationForFunction(node) {\n        if (ts.isNamedDeclaration(node)) {\n            return node.name;\n        }\n        if (ts.isFunctionDeclaration(node)) {\n            // for class and function declarations, use the `default` modifier\n            // when the declaration is unnamed.\n            var defaultModifier = ts.find(node.modifiers, isDefaultModifier);\n            if (defaultModifier)\n                return defaultModifier;\n        }\n        if (ts.isFunctionExpression(node)) {\n            // for function expressions, use the `function` keyword when the function is unnamed\n            var functionKeyword = ts.find(node.getChildren(), isFunctionKeyword);\n            if (functionKeyword)\n                return functionKeyword;\n        }\n    }\n    function getAncestorTypeNode(node) {\n        var lastTypeNode;\n        ts.findAncestor(node, function (a) {\n            if (ts.isTypeNode(a)) {\n                lastTypeNode = a;\n            }\n            return !ts.isQualifiedName(a.parent) && !ts.isTypeNode(a.parent) && !ts.isTypeElement(a.parent);\n        });\n        return lastTypeNode;\n    }\n    function getContextualTypeOrAncestorTypeNodeType(node, checker) {\n        var contextualType = checker.getContextualType(node);\n        if (contextualType) {\n            return contextualType;\n        }\n        var ancestorTypeNode = getAncestorTypeNode(node);\n        return ancestorTypeNode && checker.getTypeAtLocation(ancestorTypeNode);\n    }\n    ts.getContextualTypeOrAncestorTypeNodeType = getContextualTypeOrAncestorTypeNodeType;\n    function getAdjustedLocationForDeclaration(node, forRename) {\n        if (!forRename) {\n            switch (node.kind) {\n                case 252 /* ClassDeclaration */:\n                case 221 /* ClassExpression */:\n                    return getAdjustedLocationForClass(node);\n                case 251 /* FunctionDeclaration */:\n                case 208 /* FunctionExpression */:\n                    return getAdjustedLocationForFunction(node);\n            }\n        }\n        if (ts.isNamedDeclaration(node)) {\n            return node.name;\n        }\n    }\n    function getAdjustedLocationForImportDeclaration(node, forRename) {\n        if (node.importClause) {\n            if (node.importClause.name && node.importClause.namedBindings) {\n                // do not adjust if we have both a name and named bindings\n                return;\n            }\n            // /**/import [|name|] from ...;\n            // import /**/type [|name|] from ...;\n            if (node.importClause.name) {\n                return node.importClause.name;\n            }\n            // /**/import { [|name|] } from ...;\n            // /**/import { propertyName as [|name|] } from ...;\n            // /**/import * as [|name|] from ...;\n            // import /**/type { [|name|] } from ...;\n            // import /**/type { propertyName as [|name|] } from ...;\n            // import /**/type * as [|name|] from ...;\n            if (node.importClause.namedBindings) {\n                if (ts.isNamedImports(node.importClause.namedBindings)) {\n                    // do nothing if there is more than one binding\n                    var onlyBinding = ts.singleOrUndefined(node.importClause.namedBindings.elements);\n                    if (!onlyBinding) {\n                        return;\n                    }\n                    return onlyBinding.name;\n                }\n                else if (ts.isNamespaceImport(node.importClause.namedBindings)) {\n                    return node.importClause.namedBindings.name;\n                }\n            }\n        }\n        if (!forRename) {\n            // /**/import \"[|module|]\";\n            // /**/import ... from \"[|module|]\";\n            // import /**/type ... from \"[|module|]\";\n            return node.moduleSpecifier;\n        }\n    }\n    function getAdjustedLocationForExportDeclaration(node, forRename) {\n        if (node.exportClause) {\n            // /**/export { [|name|] } ...\n            // /**/export { propertyName as [|name|] } ...\n            // /**/export * as [|name|] ...\n            // export /**/type { [|name|] } from ...\n            // export /**/type { propertyName as [|name|] } from ...\n            // export /**/type * as [|name|] ...\n            if (ts.isNamedExports(node.exportClause)) {\n                // do nothing if there is more than one binding\n                var onlyBinding = ts.singleOrUndefined(node.exportClause.elements);\n                if (!onlyBinding) {\n                    return;\n                }\n                return node.exportClause.elements[0].name;\n            }\n            else if (ts.isNamespaceExport(node.exportClause)) {\n                return node.exportClause.name;\n            }\n        }\n        if (!forRename) {\n            // /**/export * from \"[|module|]\";\n            // export /**/type * from \"[|module|]\";\n            return node.moduleSpecifier;\n        }\n    }\n    function getAdjustedLocationForHeritageClause(node) {\n        // /**/extends [|name|]\n        // /**/implements [|name|]\n        if (node.types.length === 1) {\n            return node.types[0].expression;\n        }\n        // /**/extends name1, name2 ...\n        // /**/implements name1, name2 ...\n    }\n    function getAdjustedLocation(node, forRename) {\n        var parent = node.parent;\n        // /**/<modifier> [|name|] ...\n        // /**/<modifier> <class|interface|type|enum|module|namespace|function|get|set> [|name|] ...\n        // /**/<class|interface|type|enum|module|namespace|function|get|set> [|name|] ...\n        // /**/import [|name|] = ...\n        //\n        // NOTE: If the node is a modifier, we don't adjust its location if it is the `default` modifier as that is handled\n        // specially by `getSymbolAtLocation`.\n        if (ts.isModifier(node) && (forRename || node.kind !== 87 /* DefaultKeyword */) ? ts.contains(parent.modifiers, node) :\n            node.kind === 83 /* ClassKeyword */ ? ts.isClassDeclaration(parent) || ts.isClassExpression(node) :\n                node.kind === 97 /* FunctionKeyword */ ? ts.isFunctionDeclaration(parent) || ts.isFunctionExpression(node) :\n                    node.kind === 117 /* InterfaceKeyword */ ? ts.isInterfaceDeclaration(parent) :\n                        node.kind === 91 /* EnumKeyword */ ? ts.isEnumDeclaration(parent) :\n                            node.kind === 149 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) :\n                                node.kind === 140 /* NamespaceKeyword */ || node.kind === 139 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) :\n                                    node.kind === 99 /* ImportKeyword */ ? ts.isImportEqualsDeclaration(parent) :\n                                        node.kind === 134 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) :\n                                            node.kind === 146 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) {\n            var location = getAdjustedLocationForDeclaration(parent, forRename);\n            if (location) {\n                return location;\n            }\n        }\n        // /**/<var|let|const> [|name|] ...\n        if ((node.kind === 112 /* VarKeyword */ || node.kind === 84 /* ConstKeyword */ || node.kind === 118 /* LetKeyword */) &&\n            ts.isVariableDeclarationList(parent) && parent.declarations.length === 1) {\n            var decl = parent.declarations[0];\n            if (ts.isIdentifier(decl.name)) {\n                return decl.name;\n            }\n        }\n        if (node.kind === 149 /* TypeKeyword */) {\n            // import /**/type [|name|] from ...;\n            // import /**/type { [|name|] } from ...;\n            // import /**/type { propertyName as [|name|] } from ...;\n            // import /**/type ... from \"[|module|]\";\n            if (ts.isImportClause(parent) && parent.isTypeOnly) {\n                var location = getAdjustedLocationForImportDeclaration(parent.parent, forRename);\n                if (location) {\n                    return location;\n                }\n            }\n            // export /**/type { [|name|] } from ...;\n            // export /**/type { propertyName as [|name|] } from ...;\n            // export /**/type * from \"[|module|]\";\n            // export /**/type * as ... from \"[|module|]\";\n            if (ts.isExportDeclaration(parent) && parent.isTypeOnly) {\n                var location = getAdjustedLocationForExportDeclaration(parent, forRename);\n                if (location) {\n                    return location;\n                }\n            }\n        }\n        // import { propertyName /**/as [|name|] } ...\n        // import * /**/as [|name|] ...\n        // export { propertyName /**/as [|name|] } ...\n        // export * /**/as [|name|] ...\n        if (node.kind === 126 /* AsKeyword */) {\n            if (ts.isImportSpecifier(parent) && parent.propertyName ||\n                ts.isExportSpecifier(parent) && parent.propertyName ||\n                ts.isNamespaceImport(parent) ||\n                ts.isNamespaceExport(parent)) {\n                return parent.name;\n            }\n            if (ts.isExportDeclaration(parent) && parent.exportClause && ts.isNamespaceExport(parent.exportClause)) {\n                return parent.exportClause.name;\n            }\n        }\n        // /**/import [|name|] from ...;\n        // /**/import { [|name|] } from ...;\n        // /**/import { propertyName as [|name|] } from ...;\n        // /**/import ... from \"[|module|]\";\n        // /**/import \"[|module|]\";\n        if (node.kind === 99 /* ImportKeyword */ && ts.isImportDeclaration(parent)) {\n            var location = getAdjustedLocationForImportDeclaration(parent, forRename);\n            if (location) {\n                return location;\n            }\n        }\n        if (node.kind === 92 /* ExportKeyword */) {\n            // /**/export { [|name|] } ...;\n            // /**/export { propertyName as [|name|] } ...;\n            // /**/export * from \"[|module|]\";\n            // /**/export * as ... from \"[|module|]\";\n            if (ts.isExportDeclaration(parent)) {\n                var location = getAdjustedLocationForExportDeclaration(parent, forRename);\n                if (location) {\n                    return location;\n                }\n            }\n            // NOTE: We don't adjust the location of the `default` keyword as that is handled specially by `getSymbolAtLocation`.\n            // /**/export default [|name|];\n            // /**/export = [|name|];\n            if (ts.isExportAssignment(parent)) {\n                return ts.skipOuterExpressions(parent.expression);\n            }\n        }\n        // import name = /**/require(\"[|module|]\");\n        if (node.kind === 143 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) {\n            return parent.expression;\n        }\n        // import ... /**/from \"[|module|]\";\n        // export ... /**/from \"[|module|]\";\n        if (node.kind === 153 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) {\n            return parent.moduleSpecifier;\n        }\n        // class ... /**/extends [|name|] ...\n        // class ... /**/implements [|name|] ...\n        // class ... /**/implements name1, name2 ...\n        // interface ... /**/extends [|name|] ...\n        // interface ... /**/extends name1, name2 ...\n        if ((node.kind === 93 /* ExtendsKeyword */ || node.kind === 116 /* ImplementsKeyword */) && ts.isHeritageClause(parent) && parent.token === node.kind) {\n            var location = getAdjustedLocationForHeritageClause(parent);\n            if (location) {\n                return location;\n            }\n        }\n        if (node.kind === 93 /* ExtendsKeyword */) {\n            // ... <T /**/extends [|U|]> ...\n            if (ts.isTypeParameterDeclaration(parent) && parent.constraint && ts.isTypeReferenceNode(parent.constraint)) {\n                return parent.constraint.typeName;\n            }\n            // ... T /**/extends [|U|] ? ...\n            if (ts.isConditionalTypeNode(parent) && ts.isTypeReferenceNode(parent.extendsType)) {\n                return parent.extendsType.typeName;\n            }\n        }\n        // ... T extends /**/infer [|U|] ? ...\n        if (node.kind === 135 /* InferKeyword */ && ts.isInferTypeNode(parent)) {\n            return parent.typeParameter.name;\n        }\n        // { [ [|K|] /**/in keyof T]: ... }\n        if (node.kind === 100 /* InKeyword */ && ts.isTypeParameterDeclaration(parent) && ts.isMappedTypeNode(parent.parent)) {\n            return parent.name;\n        }\n        // /**/keyof [|T|]\n        if (node.kind === 138 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 138 /* KeyOfKeyword */ &&\n            ts.isTypeReferenceNode(parent.type)) {\n            return parent.type.typeName;\n        }\n        // /**/readonly [|name|][]\n        if (node.kind === 142 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 142 /* ReadonlyKeyword */ &&\n            ts.isArrayTypeNode(parent.type) && ts.isTypeReferenceNode(parent.type.elementType)) {\n            return parent.type.elementType.typeName;\n        }\n        if (!forRename) {\n            // /**/new [|name|]\n            // /**/void [|name|]\n            // /**/void obj.[|name|]\n            // /**/typeof [|name|]\n            // /**/typeof obj.[|name|]\n            // /**/await [|name|]\n            // /**/await obj.[|name|]\n            // /**/yield [|name|]\n            // /**/yield obj.[|name|]\n            // /**/delete obj.[|name|]\n            if (node.kind === 102 /* NewKeyword */ && ts.isNewExpression(parent) ||\n                node.kind === 113 /* VoidKeyword */ && ts.isVoidExpression(parent) ||\n                node.kind === 111 /* TypeOfKeyword */ && ts.isTypeOfExpression(parent) ||\n                node.kind === 130 /* AwaitKeyword */ && ts.isAwaitExpression(parent) ||\n                node.kind === 124 /* YieldKeyword */ && ts.isYieldExpression(parent) ||\n                node.kind === 88 /* DeleteKeyword */ && ts.isDeleteExpression(parent)) {\n                if (parent.expression) {\n                    return ts.skipOuterExpressions(parent.expression);\n                }\n            }\n            // left /**/in [|name|]\n            // left /**/instanceof [|name|]\n            if ((node.kind === 100 /* InKeyword */ || node.kind === 101 /* InstanceOfKeyword */) && ts.isBinaryExpression(parent) && parent.operatorToken === node) {\n                return ts.skipOuterExpressions(parent.right);\n            }\n            // left /**/as [|name|]\n            if (node.kind === 126 /* AsKeyword */ && ts.isAsExpression(parent) && ts.isTypeReferenceNode(parent.type)) {\n                return parent.type.typeName;\n            }\n            // for (... /**/in [|name|])\n            // for (... /**/of [|name|])\n            if (node.kind === 100 /* InKeyword */ && ts.isForInStatement(parent) ||\n                node.kind === 156 /* OfKeyword */ && ts.isForOfStatement(parent)) {\n                return ts.skipOuterExpressions(parent.expression);\n            }\n        }\n        return node;\n    }\n    /**\n     * Adjusts the location used for \"find references\" and \"go to definition\" when the cursor was not\n     * on a property name.\n     */\n    function getAdjustedReferenceLocation(node) {\n        return getAdjustedLocation(node, /*forRename*/ false);\n    }\n    ts.getAdjustedReferenceLocation = getAdjustedReferenceLocation;\n    /**\n     * Adjusts the location used for \"rename\" when the cursor was not on a property name.\n     */\n    function getAdjustedRenameLocation(node) {\n        return getAdjustedLocation(node, /*forRename*/ true);\n    }\n    ts.getAdjustedRenameLocation = getAdjustedRenameLocation;\n    /**\n     * Gets the token whose text has range [start, end) and\n     * position >= start and (position < end or (position === end && token is literal or keyword or identifier))\n     */\n    function getTouchingPropertyName(sourceFile, position) {\n        return getTouchingToken(sourceFile, position, function (n) { return ts.isPropertyNameLiteral(n) || ts.isKeyword(n.kind) || ts.isPrivateIdentifier(n); });\n    }\n    ts.getTouchingPropertyName = getTouchingPropertyName;\n    /**\n     * Returns the token if position is in [start, end).\n     * If position === end, returns the preceding token if includeItemAtEndPosition(previousToken) === true\n     */\n    function getTouchingToken(sourceFile, position, includePrecedingTokenAtEndPosition) {\n        return getTokenAtPositionWorker(sourceFile, position, /*allowPositionInLeadingTrivia*/ false, includePrecedingTokenAtEndPosition, /*includeEndPosition*/ false);\n    }\n    ts.getTouchingToken = getTouchingToken;\n    /** Returns a token if position is in [start-of-leading-trivia, end) */\n    function getTokenAtPosition(sourceFile, position) {\n        return getTokenAtPositionWorker(sourceFile, position, /*allowPositionInLeadingTrivia*/ true, /*includePrecedingTokenAtEndPosition*/ undefined, /*includeEndPosition*/ false);\n    }\n    ts.getTokenAtPosition = getTokenAtPosition;\n    /** Get the token whose text contains the position */\n    function getTokenAtPositionWorker(sourceFile, position, allowPositionInLeadingTrivia, includePrecedingTokenAtEndPosition, includeEndPosition) {\n        var current = sourceFile;\n        outer: while (true) {\n            // find the child that contains 'position'\n            for (var _i = 0, _a = current.getChildren(sourceFile); _i < _a.length; _i++) {\n                var child = _a[_i];\n                var start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile, /*includeJsDoc*/ true);\n                if (start > position) {\n                    // If this child begins after position, then all subsequent children will as well.\n                    break;\n                }\n                var end = child.getEnd();\n                if (position < end || (position === end && (child.kind === 1 /* EndOfFileToken */ || includeEndPosition))) {\n                    current = child;\n                    continue outer;\n                }\n                else if (includePrecedingTokenAtEndPosition && end === position) {\n                    var previousToken = findPrecedingToken(position, sourceFile, child);\n                    if (previousToken && includePrecedingTokenAtEndPosition(previousToken)) {\n                        return previousToken;\n                    }\n                }\n            }\n            return current;\n        }\n    }\n    /**\n     * The token on the left of the position is the token that strictly includes the position\n     * or sits to the left of the cursor if it is on a boundary. For example\n     *\n     *   fo|o               -> will return foo\n     *   foo <comment> |bar -> will return foo\n     *\n     */\n    function findTokenOnLeftOfPosition(file, position) {\n        // Ideally, getTokenAtPosition should return a token. However, it is currently\n        // broken, so we do a check to make sure the result was indeed a token.\n        var tokenAtPosition = getTokenAtPosition(file, position);\n        if (ts.isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) {\n            return tokenAtPosition;\n        }\n        return findPrecedingToken(position, file);\n    }\n    ts.findTokenOnLeftOfPosition = findTokenOnLeftOfPosition;\n    function findNextToken(previousToken, parent, sourceFile) {\n        return find(parent);\n        function find(n) {\n            if (ts.isToken(n) && n.pos === previousToken.end) {\n                // this is token that starts at the end of previous token - return it\n                return n;\n            }\n            return ts.firstDefined(n.getChildren(sourceFile), function (child) {\n                var shouldDiveInChildNode = \n                // previous token is enclosed somewhere in the child\n                (child.pos <= previousToken.pos && child.end > previousToken.end) ||\n                    // previous token ends exactly at the beginning of child\n                    (child.pos === previousToken.end);\n                return shouldDiveInChildNode && nodeHasTokens(child, sourceFile) ? find(child) : undefined;\n            });\n        }\n    }\n    ts.findNextToken = findNextToken;\n    /**\n     * Finds the rightmost token satisfying `token.end <= position`,\n     * excluding `JsxText` tokens containing only whitespace.\n     */\n    function findPrecedingToken(position, sourceFile, startNode, excludeJsdoc) {\n        var result = find(startNode || sourceFile);\n        ts.Debug.assert(!(result && isWhiteSpaceOnlyJsxText(result)));\n        return result;\n        function find(n) {\n            if (isNonWhitespaceToken(n) && n.kind !== 1 /* EndOfFileToken */) {\n                return n;\n            }\n            var children = n.getChildren(sourceFile);\n            var i = ts.binarySearchKey(children, position, function (_, i) { return i; }, function (middle, _) {\n                // This last callback is more of a selector than a comparator -\n                // `EqualTo` causes the `middle` result to be returned\n                // `GreaterThan` causes recursion on the left of the middle\n                // `LessThan` causes recursion on the right of the middle\n                if (position < children[middle].end) {\n                    // first element whose end position is greater than the input position\n                    if (!children[middle - 1] || position >= children[middle - 1].end) {\n                        return 0 /* EqualTo */;\n                    }\n                    return 1 /* GreaterThan */;\n                }\n                return -1 /* LessThan */;\n            });\n            if (i >= 0 && children[i]) {\n                var child = children[i];\n                // Note that the span of a node's tokens is [node.getStart(...), node.end).\n                // Given that `position < child.end` and child has constituent tokens, we distinguish these cases:\n                // 1) `position` precedes `child`'s tokens or `child` has no tokens (ie: in a comment or whitespace preceding `child`):\n                // we need to find the last token in a previous child.\n                // 2) `position` is within the same span: we recurse on `child`.\n                if (position < child.end) {\n                    var start = child.getStart(sourceFile, /*includeJsDoc*/ !excludeJsdoc);\n                    var lookInPreviousChild = (start >= position) || // cursor in the leading trivia\n                        !nodeHasTokens(child, sourceFile) ||\n                        isWhiteSpaceOnlyJsxText(child);\n                    if (lookInPreviousChild) {\n                        // actual start of the node is past the position - previous token should be at the end of previous child\n                        var candidate_1 = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i, sourceFile);\n                        return candidate_1 && findRightmostToken(candidate_1, sourceFile);\n                    }\n                    else {\n                        // candidate should be in this node\n                        return find(child);\n                    }\n                }\n            }\n            ts.Debug.assert(startNode !== undefined || n.kind === 297 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n));\n            // Here we know that none of child token nodes embrace the position,\n            // the only known case is when position is at the end of the file.\n            // Try to find the rightmost token in the file without filtering.\n            // Namely we are skipping the check: 'position < node.end'\n            var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length, sourceFile);\n            return candidate && findRightmostToken(candidate, sourceFile);\n        }\n    }\n    ts.findPrecedingToken = findPrecedingToken;\n    function isNonWhitespaceToken(n) {\n        return ts.isToken(n) && !isWhiteSpaceOnlyJsxText(n);\n    }\n    function findRightmostToken(n, sourceFile) {\n        if (isNonWhitespaceToken(n)) {\n            return n;\n        }\n        var children = n.getChildren(sourceFile);\n        if (children.length === 0) {\n            return n;\n        }\n        var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length, sourceFile);\n        return candidate && findRightmostToken(candidate, sourceFile);\n    }\n    /**\n     * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens.\n     */\n    function findRightmostChildNodeWithTokens(children, exclusiveStartPosition, sourceFile) {\n        for (var i = exclusiveStartPosition - 1; i >= 0; i--) {\n            var child = children[i];\n            if (isWhiteSpaceOnlyJsxText(child)) {\n                ts.Debug.assert(i > 0, \"`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`\");\n            }\n            else if (nodeHasTokens(children[i], sourceFile)) {\n                return children[i];\n            }\n        }\n    }\n    function isInString(sourceFile, position, previousToken) {\n        if (previousToken === void 0) { previousToken = findPrecedingToken(position, sourceFile); }\n        if (previousToken && ts.isStringTextContainingNode(previousToken)) {\n            var start = previousToken.getStart(sourceFile);\n            var end = previousToken.getEnd();\n            // To be \"in\" one of these literals, the position has to be:\n            //   1. entirely within the token text.\n            //   2. at the end position of an unterminated token.\n            //   3. at the end of a regular expression (due to trailing flags like '/foo/g').\n            if (start < position && position < end) {\n                return true;\n            }\n            if (position === end) {\n                return !!previousToken.isUnterminated;\n            }\n        }\n        return false;\n    }\n    ts.isInString = isInString;\n    /**\n     * returns true if the position is in between the open and close elements of an JSX expression.\n     */\n    function isInsideJsxElementOrAttribute(sourceFile, position) {\n        var token = getTokenAtPosition(sourceFile, position);\n        if (!token) {\n            return false;\n        }\n        if (token.kind === 11 /* JsxText */) {\n            return true;\n        }\n        // <div>Hello |</div>\n        if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 11 /* JsxText */) {\n            return true;\n        }\n        // <div> { | </div> or <div a={| </div>\n        if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 283 /* JsxExpression */) {\n            return true;\n        }\n        // <div> {\n        // |\n        // } < /div>\n        if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 283 /* JsxExpression */) {\n            return true;\n        }\n        // <div>|</div>\n        if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 276 /* JsxClosingElement */) {\n            return true;\n        }\n        return false;\n    }\n    ts.isInsideJsxElementOrAttribute = isInsideJsxElementOrAttribute;\n    function isWhiteSpaceOnlyJsxText(node) {\n        return ts.isJsxText(node) && node.containsOnlyTriviaWhiteSpaces;\n    }\n    function isInTemplateString(sourceFile, position) {\n        var token = getTokenAtPosition(sourceFile, position);\n        return ts.isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile);\n    }\n    ts.isInTemplateString = isInTemplateString;\n    function isInJSXText(sourceFile, position) {\n        var token = getTokenAtPosition(sourceFile, position);\n        if (ts.isJsxText(token)) {\n            return true;\n        }\n        if (token.kind === 18 /* OpenBraceToken */ && ts.isJsxExpression(token.parent) && ts.isJsxElement(token.parent.parent)) {\n            return true;\n        }\n        if (token.kind === 29 /* LessThanToken */ && ts.isJsxOpeningLikeElement(token.parent) && ts.isJsxElement(token.parent.parent)) {\n            return true;\n        }\n        return false;\n    }\n    ts.isInJSXText = isInJSXText;\n    function isInsideJsxElement(sourceFile, position) {\n        function isInsideJsxElementTraversal(node) {\n            while (node) {\n                if (node.kind >= 274 /* JsxSelfClosingElement */ && node.kind <= 283 /* JsxExpression */\n                    || node.kind === 11 /* JsxText */\n                    || node.kind === 29 /* LessThanToken */\n                    || node.kind === 31 /* GreaterThanToken */\n                    || node.kind === 78 /* Identifier */\n                    || node.kind === 19 /* CloseBraceToken */\n                    || node.kind === 18 /* OpenBraceToken */\n                    || node.kind === 43 /* SlashToken */) {\n                    node = node.parent;\n                }\n                else if (node.kind === 273 /* JsxElement */) {\n                    if (position > node.getStart(sourceFile))\n                        return true;\n                    node = node.parent;\n                }\n                else {\n                    return false;\n                }\n            }\n            return false;\n        }\n        return isInsideJsxElementTraversal(getTokenAtPosition(sourceFile, position));\n    }\n    ts.isInsideJsxElement = isInsideJsxElement;\n    function findPrecedingMatchingToken(token, matchingTokenKind, sourceFile) {\n        var closeTokenText = ts.tokenToString(token.kind);\n        var matchingTokenText = ts.tokenToString(matchingTokenKind);\n        var tokenFullStart = token.getFullStart();\n        // Text-scan based fast path - can be bamboozled by comments and other trivia, but often provides\n        // a good, fast approximation without too much extra work in the cases where it fails.\n        var bestGuessIndex = sourceFile.text.lastIndexOf(matchingTokenText, tokenFullStart);\n        if (bestGuessIndex === -1) {\n            return undefined; // if the token text doesn't appear in the file, there can't be a match - super fast bail\n        }\n        // we can only use the textual result directly if we didn't have to count any close tokens within the range\n        if (sourceFile.text.lastIndexOf(closeTokenText, tokenFullStart - 1) < bestGuessIndex) {\n            var nodeAtGuess = findPrecedingToken(bestGuessIndex + 1, sourceFile);\n            if (nodeAtGuess && nodeAtGuess.kind === matchingTokenKind) {\n                return nodeAtGuess;\n            }\n        }\n        var tokenKind = token.kind;\n        var remainingMatchingTokens = 0;\n        while (true) {\n            var preceding = findPrecedingToken(token.getFullStart(), sourceFile);\n            if (!preceding) {\n                return undefined;\n            }\n            token = preceding;\n            if (token.kind === matchingTokenKind) {\n                if (remainingMatchingTokens === 0) {\n                    return token;\n                }\n                remainingMatchingTokens--;\n            }\n            else if (token.kind === tokenKind) {\n                remainingMatchingTokens++;\n            }\n        }\n    }\n    ts.findPrecedingMatchingToken = findPrecedingMatchingToken;\n    function removeOptionality(type, isOptionalExpression, isOptionalChain) {\n        return isOptionalExpression ? type.getNonNullableType() :\n            isOptionalChain ? type.getNonOptionalType() :\n                type;\n    }\n    ts.removeOptionality = removeOptionality;\n    function isPossiblyTypeArgumentPosition(token, sourceFile, checker) {\n        var info = getPossibleTypeArgumentsInfo(token, sourceFile);\n        return info !== undefined && (ts.isPartOfTypeNode(info.called) ||\n            getPossibleGenericSignatures(info.called, info.nTypeArguments, checker).length !== 0 ||\n            isPossiblyTypeArgumentPosition(info.called, sourceFile, checker));\n    }\n    ts.isPossiblyTypeArgumentPosition = isPossiblyTypeArgumentPosition;\n    function getPossibleGenericSignatures(called, typeArgumentCount, checker) {\n        var type = checker.getTypeAtLocation(called);\n        if (ts.isOptionalChain(called.parent)) {\n            type = removeOptionality(type, ts.isOptionalChainRoot(called.parent), /*isOptionalChain*/ true);\n        }\n        var signatures = ts.isNewExpression(called.parent) ? type.getConstructSignatures() : type.getCallSignatures();\n        return signatures.filter(function (candidate) { return !!candidate.typeParameters && candidate.typeParameters.length >= typeArgumentCount; });\n    }\n    ts.getPossibleGenericSignatures = getPossibleGenericSignatures;\n    // Get info for an expression like `f <` that may be the start of type arguments.\n    function getPossibleTypeArgumentsInfo(tokenIn, sourceFile) {\n        // This is a rare case, but one that saves on a _lot_ of work if true - if the source file has _no_ `<` character,\n        // then there obviously can't be any type arguments - no expensive brace-matching backwards scanning required\n        if (sourceFile.text.lastIndexOf(\"<\", tokenIn ? tokenIn.pos : sourceFile.text.length) === -1) {\n            return undefined;\n        }\n        var token = tokenIn;\n        // This function determines if the node could be type argument position\n        // Since during editing, when type argument list is not complete,\n        // the tree could be of any shape depending on the tokens parsed before current node,\n        // scanning of the previous identifier followed by \"<\" before current node would give us better result\n        // Note that we also balance out the already provided type arguments, arrays, object literals while doing so\n        var remainingLessThanTokens = 0;\n        var nTypeArguments = 0;\n        while (token) {\n            switch (token.kind) {\n                case 29 /* LessThanToken */:\n                    // Found the beginning of the generic argument expression\n                    token = findPrecedingToken(token.getFullStart(), sourceFile);\n                    if (token && token.kind === 28 /* QuestionDotToken */) {\n                        token = findPrecedingToken(token.getFullStart(), sourceFile);\n                    }\n                    if (!token || !ts.isIdentifier(token))\n                        return undefined;\n                    if (!remainingLessThanTokens) {\n                        return ts.isDeclarationName(token) ? undefined : { called: token, nTypeArguments: nTypeArguments };\n                    }\n                    remainingLessThanTokens--;\n                    break;\n                case 49 /* GreaterThanGreaterThanGreaterThanToken */:\n                    remainingLessThanTokens = +3;\n                    break;\n                case 48 /* GreaterThanGreaterThanToken */:\n                    remainingLessThanTokens = +2;\n                    break;\n                case 31 /* GreaterThanToken */:\n                    remainingLessThanTokens++;\n                    break;\n                case 19 /* CloseBraceToken */:\n                    // This can be object type, skip until we find the matching open brace token\n                    // Skip until the matching open brace token\n                    token = findPrecedingMatchingToken(token, 18 /* OpenBraceToken */, sourceFile);\n                    if (!token)\n                        return undefined;\n                    break;\n                case 21 /* CloseParenToken */:\n                    // This can be object type, skip until we find the matching open brace token\n                    // Skip until the matching open brace token\n                    token = findPrecedingMatchingToken(token, 20 /* OpenParenToken */, sourceFile);\n                    if (!token)\n                        return undefined;\n                    break;\n                case 23 /* CloseBracketToken */:\n                    // This can be object type, skip until we find the matching open brace token\n                    // Skip until the matching open brace token\n                    token = findPrecedingMatchingToken(token, 22 /* OpenBracketToken */, sourceFile);\n                    if (!token)\n                        return undefined;\n                    break;\n                // Valid tokens in a type name. Skip.\n                case 27 /* CommaToken */:\n                    nTypeArguments++;\n                    break;\n                case 38 /* EqualsGreaterThanToken */:\n                // falls through\n                case 78 /* Identifier */:\n                case 10 /* StringLiteral */:\n                case 8 /* NumericLiteral */:\n                case 9 /* BigIntLiteral */:\n                case 109 /* TrueKeyword */:\n                case 94 /* FalseKeyword */:\n                // falls through\n                case 111 /* TypeOfKeyword */:\n                case 93 /* ExtendsKeyword */:\n                case 138 /* KeyOfKeyword */:\n                case 24 /* DotToken */:\n                case 51 /* BarToken */:\n                case 57 /* QuestionToken */:\n                case 58 /* ColonToken */:\n                    break;\n                default:\n                    if (ts.isTypeNode(token)) {\n                        break;\n                    }\n                    // Invalid token in type\n                    return undefined;\n            }\n            token = findPrecedingToken(token.getFullStart(), sourceFile);\n        }\n        return undefined;\n    }\n    ts.getPossibleTypeArgumentsInfo = getPossibleTypeArgumentsInfo;\n    /**\n     * Returns true if the cursor at position in sourceFile is within a comment.\n     *\n     * @param tokenAtPosition Must equal `getTokenAtPosition(sourceFile, position)\n     * @param predicate Additional predicate to test on the comment range.\n     */\n    function isInComment(sourceFile, position, tokenAtPosition) {\n        return ts.formatting.getRangeOfEnclosingComment(sourceFile, position, /*precedingToken*/ undefined, tokenAtPosition);\n    }\n    ts.isInComment = isInComment;\n    function hasDocComment(sourceFile, position) {\n        var token = getTokenAtPosition(sourceFile, position);\n        return !!ts.findAncestor(token, ts.isJSDoc);\n    }\n    ts.hasDocComment = hasDocComment;\n    function nodeHasTokens(n, sourceFile) {\n        // If we have a token or node that has a non-zero width, it must have tokens.\n        // Note: getWidth() does not take trivia into account.\n        return n.kind === 1 /* EndOfFileToken */ ? !!n.jsDoc : n.getWidth(sourceFile) !== 0;\n    }\n    function getNodeModifiers(node, excludeFlags) {\n        if (excludeFlags === void 0) { excludeFlags = 0 /* None */; }\n        var result = [];\n        var flags = ts.isDeclaration(node)\n            ? ts.getCombinedNodeFlagsAlwaysIncludeJSDoc(node) & ~excludeFlags\n            : 0 /* None */;\n        if (flags & 8 /* Private */)\n            result.push(\"private\" /* privateMemberModifier */);\n        if (flags & 16 /* Protected */)\n            result.push(\"protected\" /* protectedMemberModifier */);\n        if (flags & 4 /* Public */)\n            result.push(\"public\" /* publicMemberModifier */);\n        if (flags & 32 /* Static */)\n            result.push(\"static\" /* staticModifier */);\n        if (flags & 128 /* Abstract */)\n            result.push(\"abstract\" /* abstractModifier */);\n        if (flags & 1 /* Export */)\n            result.push(\"export\" /* exportedModifier */);\n        if (flags & 8192 /* Deprecated */)\n            result.push(\"deprecated\" /* deprecatedModifier */);\n        if (node.flags & 8388608 /* Ambient */)\n            result.push(\"declare\" /* ambientModifier */);\n        if (node.kind === 266 /* ExportAssignment */)\n            result.push(\"export\" /* exportedModifier */);\n        return result.length > 0 ? result.join(\",\") : \"\" /* none */;\n    }\n    ts.getNodeModifiers = getNodeModifiers;\n    function getTypeArgumentOrTypeParameterList(node) {\n        if (node.kind === 173 /* TypeReference */ || node.kind === 203 /* CallExpression */) {\n            return node.typeArguments;\n        }\n        if (ts.isFunctionLike(node) || node.kind === 252 /* ClassDeclaration */ || node.kind === 253 /* InterfaceDeclaration */) {\n            return node.typeParameters;\n        }\n        return undefined;\n    }\n    ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList;\n    function isComment(kind) {\n        return kind === 2 /* SingleLineCommentTrivia */ || kind === 3 /* MultiLineCommentTrivia */;\n    }\n    ts.isComment = isComment;\n    function isStringOrRegularExpressionOrTemplateLiteral(kind) {\n        if (kind === 10 /* StringLiteral */\n            || kind === 13 /* RegularExpressionLiteral */\n            || ts.isTemplateLiteralKind(kind)) {\n            return true;\n        }\n        return false;\n    }\n    ts.isStringOrRegularExpressionOrTemplateLiteral = isStringOrRegularExpressionOrTemplateLiteral;\n    function isPunctuation(kind) {\n        return 18 /* FirstPunctuation */ <= kind && kind <= 77 /* LastPunctuation */;\n    }\n    ts.isPunctuation = isPunctuation;\n    function isInsideTemplateLiteral(node, position, sourceFile) {\n        return ts.isTemplateLiteralKind(node.kind)\n            && (node.getStart(sourceFile) < position && position < node.end) || (!!node.isUnterminated && position === node.end);\n    }\n    ts.isInsideTemplateLiteral = isInsideTemplateLiteral;\n    function isAccessibilityModifier(kind) {\n        switch (kind) {\n            case 122 /* PublicKeyword */:\n            case 120 /* PrivateKeyword */:\n            case 121 /* ProtectedKeyword */:\n                return true;\n        }\n        return false;\n    }\n    ts.isAccessibilityModifier = isAccessibilityModifier;\n    function cloneCompilerOptions(options) {\n        var result = ts.clone(options);\n        ts.setConfigFileInOptions(result, options && options.configFile);\n        return result;\n    }\n    ts.cloneCompilerOptions = cloneCompilerOptions;\n    function isArrayLiteralOrObjectLiteralDestructuringPattern(node) {\n        if (node.kind === 199 /* ArrayLiteralExpression */ ||\n            node.kind === 200 /* ObjectLiteralExpression */) {\n            // [a,b,c] from:\n            // [a, b, c] = someExpression;\n            if (node.parent.kind === 216 /* BinaryExpression */ &&\n                node.parent.left === node &&\n                node.parent.operatorToken.kind === 62 /* EqualsToken */) {\n                return true;\n            }\n            // [a, b, c] from:\n            // for([a, b, c] of expression)\n            if (node.parent.kind === 239 /* ForOfStatement */ &&\n                node.parent.initializer === node) {\n                return true;\n            }\n            // [a, b, c] of\n            // [x, [a, b, c] ] = someExpression\n            // or\n            // {x, a: {a, b, c} } = someExpression\n            if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 288 /* PropertyAssignment */ ? node.parent.parent : node.parent)) {\n                return true;\n            }\n        }\n        return false;\n    }\n    ts.isArrayLiteralOrObjectLiteralDestructuringPattern = isArrayLiteralOrObjectLiteralDestructuringPattern;\n    function isInReferenceComment(sourceFile, position) {\n        return isInReferenceCommentWorker(sourceFile, position, /*shouldBeReference*/ true);\n    }\n    ts.isInReferenceComment = isInReferenceComment;\n    function isInNonReferenceComment(sourceFile, position) {\n        return isInReferenceCommentWorker(sourceFile, position, /*shouldBeReference*/ false);\n    }\n    ts.isInNonReferenceComment = isInNonReferenceComment;\n    function isInReferenceCommentWorker(sourceFile, position, shouldBeReference) {\n        var range = isInComment(sourceFile, position, /*tokenAtPosition*/ undefined);\n        return !!range && shouldBeReference === tripleSlashDirectivePrefixRegex.test(sourceFile.text.substring(range.pos, range.end));\n    }\n    function getReplacementSpanForContextToken(contextToken) {\n        if (!contextToken)\n            return undefined;\n        switch (contextToken.kind) {\n            case 10 /* StringLiteral */:\n            case 14 /* NoSubstitutionTemplateLiteral */:\n                return createTextSpanFromStringLiteralLikeContent(contextToken);\n            default:\n                return createTextSpanFromNode(contextToken);\n        }\n    }\n    ts.getReplacementSpanForContextToken = getReplacementSpanForContextToken;\n    function createTextSpanFromNode(node, sourceFile, endNode) {\n        return ts.createTextSpanFromBounds(node.getStart(sourceFile), (endNode || node).getEnd());\n    }\n    ts.createTextSpanFromNode = createTextSpanFromNode;\n    function createTextSpanFromStringLiteralLikeContent(node) {\n        if (node.isUnterminated)\n            return undefined;\n        return ts.createTextSpanFromBounds(node.getStart() + 1, node.getEnd() - 1);\n    }\n    ts.createTextSpanFromStringLiteralLikeContent = createTextSpanFromStringLiteralLikeContent;\n    function createTextRangeFromNode(node, sourceFile) {\n        return ts.createRange(node.getStart(sourceFile), node.end);\n    }\n    ts.createTextRangeFromNode = createTextRangeFromNode;\n    function createTextSpanFromRange(range) {\n        return ts.createTextSpanFromBounds(range.pos, range.end);\n    }\n    ts.createTextSpanFromRange = createTextSpanFromRange;\n    function createTextRangeFromSpan(span) {\n        return ts.createRange(span.start, span.start + span.length);\n    }\n    ts.createTextRangeFromSpan = createTextRangeFromSpan;\n    function createTextChangeFromStartLength(start, length, newText) {\n        return createTextChange(ts.createTextSpan(start, length), newText);\n    }\n    ts.createTextChangeFromStartLength = createTextChangeFromStartLength;\n    function createTextChange(span, newText) {\n        return { span: span, newText: newText };\n    }\n    ts.createTextChange = createTextChange;\n    ts.typeKeywords = [\n        128 /* AnyKeyword */,\n        127 /* AssertsKeyword */,\n        155 /* BigIntKeyword */,\n        131 /* BooleanKeyword */,\n        94 /* FalseKeyword */,\n        135 /* InferKeyword */,\n        138 /* KeyOfKeyword */,\n        141 /* NeverKeyword */,\n        103 /* NullKeyword */,\n        144 /* NumberKeyword */,\n        145 /* ObjectKeyword */,\n        142 /* ReadonlyKeyword */,\n        147 /* StringKeyword */,\n        148 /* SymbolKeyword */,\n        109 /* TrueKeyword */,\n        113 /* VoidKeyword */,\n        150 /* UndefinedKeyword */,\n        151 /* UniqueKeyword */,\n        152 /* UnknownKeyword */,\n    ];\n    function isTypeKeyword(kind) {\n        return ts.contains(ts.typeKeywords, kind);\n    }\n    ts.isTypeKeyword = isTypeKeyword;\n    function isTypeKeywordToken(node) {\n        return node.kind === 149 /* TypeKeyword */;\n    }\n    ts.isTypeKeywordToken = isTypeKeywordToken;\n    /** True if the symbol is for an external module, as opposed to a namespace. */\n    function isExternalModuleSymbol(moduleSymbol) {\n        return !!(moduleSymbol.flags & 1536 /* Module */) && moduleSymbol.name.charCodeAt(0) === 34 /* doubleQuote */;\n    }\n    ts.isExternalModuleSymbol = isExternalModuleSymbol;\n    function nodeSeenTracker() {\n        var seen = [];\n        return function (node) {\n            var id = ts.getNodeId(node);\n            return !seen[id] && (seen[id] = true);\n        };\n    }\n    ts.nodeSeenTracker = nodeSeenTracker;\n    function getSnapshotText(snap) {\n        return snap.getText(0, snap.getLength());\n    }\n    ts.getSnapshotText = getSnapshotText;\n    function repeatString(str, count) {\n        var result = \"\";\n        for (var i = 0; i < count; i++) {\n            result += str;\n        }\n        return result;\n    }\n    ts.repeatString = repeatString;\n    function skipConstraint(type) {\n        return type.isTypeParameter() ? type.getConstraint() || type : type;\n    }\n    ts.skipConstraint = skipConstraint;\n    function getNameFromPropertyName(name) {\n        return name.kind === 158 /* ComputedPropertyName */\n            // treat computed property names where expression is string/numeric literal as just string/numeric literal\n            ? ts.isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined\n            : ts.isPrivateIdentifier(name) ? ts.idText(name) : ts.getTextOfIdentifierOrLiteral(name);\n    }\n    ts.getNameFromPropertyName = getNameFromPropertyName;\n    function programContainsModules(program) {\n        return program.getSourceFiles().some(function (s) { return !s.isDeclarationFile && !program.isSourceFileFromExternalLibrary(s) && !!(s.externalModuleIndicator || s.commonJsModuleIndicator); });\n    }\n    ts.programContainsModules = programContainsModules;\n    function programContainsEs6Modules(program) {\n        return program.getSourceFiles().some(function (s) { return !s.isDeclarationFile && !program.isSourceFileFromExternalLibrary(s) && !!s.externalModuleIndicator; });\n    }\n    ts.programContainsEs6Modules = programContainsEs6Modules;\n    function compilerOptionsIndicateEs6Modules(compilerOptions) {\n        return !!compilerOptions.module || compilerOptions.target >= 2 /* ES2015 */ || !!compilerOptions.noEmit;\n    }\n    ts.compilerOptionsIndicateEs6Modules = compilerOptionsIndicateEs6Modules;\n    function createModuleSpecifierResolutionHost(program, host) {\n        // Mix in `getProbableSymlinks` from Program when host doesn't have it\n        // in order for non-Project hosts to have a symlinks cache.\n        return {\n            fileExists: function (fileName) { return program.fileExists(fileName); },\n            getCurrentDirectory: function () { return host.getCurrentDirectory(); },\n            readFile: ts.maybeBind(host, host.readFile),\n            useCaseSensitiveFileNames: ts.maybeBind(host, host.useCaseSensitiveFileNames),\n            getSymlinkCache: ts.maybeBind(host, host.getSymlinkCache) || program.getSymlinkCache,\n            getGlobalTypingsCacheLocation: ts.maybeBind(host, host.getGlobalTypingsCacheLocation),\n            getSourceFiles: function () { return program.getSourceFiles(); },\n            redirectTargetsMap: program.redirectTargetsMap,\n            getProjectReferenceRedirect: function (fileName) { return program.getProjectReferenceRedirect(fileName); },\n            isSourceOfProjectReferenceRedirect: function (fileName) { return program.isSourceOfProjectReferenceRedirect(fileName); },\n            getNearestAncestorDirectoryWithPackageJson: ts.maybeBind(host, host.getNearestAncestorDirectoryWithPackageJson),\n            getFileIncludeReasons: function () { return program.getFileIncludeReasons(); },\n        };\n    }\n    ts.createModuleSpecifierResolutionHost = createModuleSpecifierResolutionHost;\n    function getModuleSpecifierResolverHost(program, host) {\n        return __assign(__assign({}, createModuleSpecifierResolutionHost(program, host)), { getCommonSourceDirectory: function () { return program.getCommonSourceDirectory(); } });\n    }\n    ts.getModuleSpecifierResolverHost = getModuleSpecifierResolverHost;\n    function makeImportIfNecessary(defaultImport, namedImports, moduleSpecifier, quotePreference) {\n        return defaultImport || namedImports && namedImports.length ? makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference) : undefined;\n    }\n    ts.makeImportIfNecessary = makeImportIfNecessary;\n    function makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference, isTypeOnly) {\n        return ts.factory.createImportDeclaration(\n        /*decorators*/ undefined, \n        /*modifiers*/ undefined, defaultImport || namedImports\n            ? ts.factory.createImportClause(!!isTypeOnly, defaultImport, namedImports && namedImports.length ? ts.factory.createNamedImports(namedImports) : undefined)\n            : undefined, typeof moduleSpecifier === \"string\" ? makeStringLiteral(moduleSpecifier, quotePreference) : moduleSpecifier);\n    }\n    ts.makeImport = makeImport;\n    function makeStringLiteral(text, quotePreference) {\n        return ts.factory.createStringLiteral(text, quotePreference === 0 /* Single */);\n    }\n    ts.makeStringLiteral = makeStringLiteral;\n    var QuotePreference;\n    (function (QuotePreference) {\n        QuotePreference[QuotePreference[\"Single\"] = 0] = \"Single\";\n        QuotePreference[QuotePreference[\"Double\"] = 1] = \"Double\";\n    })(QuotePreference = ts.QuotePreference || (ts.QuotePreference = {}));\n    function quotePreferenceFromString(str, sourceFile) {\n        return ts.isStringDoubleQuoted(str, sourceFile) ? 1 /* Double */ : 0 /* Single */;\n    }\n    ts.quotePreferenceFromString = quotePreferenceFromString;\n    function getQuotePreference(sourceFile, preferences) {\n        if (preferences.quotePreference && preferences.quotePreference !== \"auto\") {\n            return preferences.quotePreference === \"single\" ? 0 /* Single */ : 1 /* Double */;\n        }\n        else {\n            // ignore synthetic import added when importHelpers: true\n            var firstModuleSpecifier = sourceFile.imports &&\n                ts.find(sourceFile.imports, function (n) { return ts.isStringLiteral(n) && !ts.nodeIsSynthesized(n.parent); });\n            return firstModuleSpecifier ? quotePreferenceFromString(firstModuleSpecifier, sourceFile) : 1 /* Double */;\n        }\n    }\n    ts.getQuotePreference = getQuotePreference;\n    function getQuoteFromPreference(qp) {\n        switch (qp) {\n            case 0 /* Single */: return \"'\";\n            case 1 /* Double */: return '\"';\n            default: return ts.Debug.assertNever(qp);\n        }\n    }\n    ts.getQuoteFromPreference = getQuoteFromPreference;\n    function symbolNameNoDefault(symbol) {\n        var escaped = symbolEscapedNameNoDefault(symbol);\n        return escaped === undefined ? undefined : ts.unescapeLeadingUnderscores(escaped);\n    }\n    ts.symbolNameNoDefault = symbolNameNoDefault;\n    function symbolEscapedNameNoDefault(symbol) {\n        if (symbol.escapedName !== \"default\" /* Default */) {\n            return symbol.escapedName;\n        }\n        return ts.firstDefined(symbol.declarations, function (decl) {\n            var name = ts.getNameOfDeclaration(decl);\n            return name && name.kind === 78 /* Identifier */ ? name.escapedText : undefined;\n        });\n    }\n    ts.symbolEscapedNameNoDefault = symbolEscapedNameNoDefault;\n    function isObjectBindingElementWithoutPropertyName(bindingElement) {\n        return ts.isBindingElement(bindingElement) &&\n            ts.isObjectBindingPattern(bindingElement.parent) &&\n            ts.isIdentifier(bindingElement.name) &&\n            !bindingElement.propertyName;\n    }\n    ts.isObjectBindingElementWithoutPropertyName = isObjectBindingElementWithoutPropertyName;\n    function getPropertySymbolFromBindingElement(checker, bindingElement) {\n        var typeOfPattern = checker.getTypeAtLocation(bindingElement.parent);\n        return typeOfPattern && checker.getPropertyOfType(typeOfPattern, bindingElement.name.text);\n    }\n    ts.getPropertySymbolFromBindingElement = getPropertySymbolFromBindingElement;\n    function getParentNodeInSpan(node, file, span) {\n        if (!node)\n            return undefined;\n        while (node.parent) {\n            if (ts.isSourceFile(node.parent) || !spanContainsNode(span, node.parent, file)) {\n                return node;\n            }\n            node = node.parent;\n        }\n    }\n    ts.getParentNodeInSpan = getParentNodeInSpan;\n    function spanContainsNode(span, node, file) {\n        return ts.textSpanContainsPosition(span, node.getStart(file)) &&\n            node.getEnd() <= ts.textSpanEnd(span);\n    }\n    function findModifier(node, kind) {\n        return node.modifiers && ts.find(node.modifiers, function (m) { return m.kind === kind; });\n    }\n    ts.findModifier = findModifier;\n    function insertImports(changes, sourceFile, imports, blankLineBetween) {\n        var decl = ts.isArray(imports) ? imports[0] : imports;\n        var importKindPredicate = decl.kind === 232 /* VariableStatement */ ? ts.isRequireVariableStatement : ts.isAnyImportSyntax;\n        var existingImportStatements = ts.filter(sourceFile.statements, importKindPredicate);\n        var sortedNewImports = ts.isArray(imports) ? ts.stableSort(imports, ts.OrganizeImports.compareImportsOrRequireStatements) : [imports];\n        if (!existingImportStatements.length) {\n            changes.insertNodesAtTopOfFile(sourceFile, sortedNewImports, blankLineBetween);\n        }\n        else if (existingImportStatements && ts.OrganizeImports.importsAreSorted(existingImportStatements)) {\n            for (var _i = 0, sortedNewImports_1 = sortedNewImports; _i < sortedNewImports_1.length; _i++) {\n                var newImport = sortedNewImports_1[_i];\n                var insertionIndex = ts.OrganizeImports.getImportDeclarationInsertionIndex(existingImportStatements, newImport);\n                if (insertionIndex === 0) {\n                    // If the first import is top-of-file, insert after the leading comment which is likely the header.\n                    var options = existingImportStatements[0] === sourceFile.statements[0] ?\n                        { leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude } : {};\n                    changes.insertNodeBefore(sourceFile, existingImportStatements[0], newImport, /*blankLineBetween*/ false, options);\n                }\n                else {\n                    var prevImport = existingImportStatements[insertionIndex - 1];\n                    changes.insertNodeAfter(sourceFile, prevImport, newImport);\n                }\n            }\n        }\n        else {\n            var lastExistingImport = ts.lastOrUndefined(existingImportStatements);\n            if (lastExistingImport) {\n                changes.insertNodesAfter(sourceFile, lastExistingImport, sortedNewImports);\n            }\n            else {\n                changes.insertNodesAtTopOfFile(sourceFile, sortedNewImports, blankLineBetween);\n            }\n        }\n    }\n    ts.insertImports = insertImports;\n    function getTypeKeywordOfTypeOnlyImport(importClause, sourceFile) {\n        ts.Debug.assert(importClause.isTypeOnly);\n        return ts.cast(importClause.getChildAt(0, sourceFile), isTypeKeywordToken);\n    }\n    ts.getTypeKeywordOfTypeOnlyImport = getTypeKeywordOfTypeOnlyImport;\n    function textSpansEqual(a, b) {\n        return !!a && !!b && a.start === b.start && a.length === b.length;\n    }\n    ts.textSpansEqual = textSpansEqual;\n    function documentSpansEqual(a, b) {\n        return a.fileName === b.fileName && textSpansEqual(a.textSpan, b.textSpan);\n    }\n    ts.documentSpansEqual = documentSpansEqual;\n    /**\n     * Iterates through 'array' by index and performs the callback on each element of array until the callback\n     * returns a truthy value, then returns that value.\n     * If no such value is found, the callback is applied to each element of array and undefined is returned.\n     */\n    function forEachUnique(array, callback) {\n        if (array) {\n            for (var i = 0; i < array.length; i++) {\n                if (array.indexOf(array[i]) === i) {\n                    var result = callback(array[i], i);\n                    if (result) {\n                        return result;\n                    }\n                }\n            }\n        }\n        return undefined;\n    }\n    ts.forEachUnique = forEachUnique;\n    function isTextWhiteSpaceLike(text, startPos, endPos) {\n        for (var i = startPos; i < endPos; i++) {\n            if (!ts.isWhiteSpaceLike(text.charCodeAt(i))) {\n                return false;\n            }\n        }\n        return true;\n    }\n    ts.isTextWhiteSpaceLike = isTextWhiteSpaceLike;\n    // #endregion\n    // Display-part writer helpers\n    // #region\n    function isFirstDeclarationOfSymbolParameter(symbol) {\n        return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 160 /* Parameter */;\n    }\n    ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter;\n    var displayPartWriter = getDisplayPartWriter();\n    function getDisplayPartWriter() {\n        var absoluteMaximumLength = ts.defaultMaximumTruncationLength * 10; // A hard cutoff to avoid overloading the messaging channel in worst-case scenarios\n        var displayParts;\n        var lineStart;\n        var indent;\n        var length;\n        resetWriter();\n        var unknownWrite = function (text) { return writeKind(text, ts.SymbolDisplayPartKind.text); };\n        return {\n            displayParts: function () {\n                var finalText = displayParts.length && displayParts[displayParts.length - 1].text;\n                if (length > absoluteMaximumLength && finalText && finalText !== \"...\") {\n                    if (!ts.isWhiteSpaceLike(finalText.charCodeAt(finalText.length - 1))) {\n                        displayParts.push(displayPart(\" \", ts.SymbolDisplayPartKind.space));\n                    }\n                    displayParts.push(displayPart(\"...\", ts.SymbolDisplayPartKind.punctuation));\n                }\n                return displayParts;\n            },\n            writeKeyword: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.keyword); },\n            writeOperator: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.operator); },\n            writePunctuation: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.punctuation); },\n            writeTrailingSemicolon: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.punctuation); },\n            writeSpace: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.space); },\n            writeStringLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); },\n            writeParameter: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.parameterName); },\n            writeProperty: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.propertyName); },\n            writeLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); },\n            writeSymbol: writeSymbol,\n            writeLine: writeLine,\n            write: unknownWrite,\n            writeComment: unknownWrite,\n            getText: function () { return \"\"; },\n            getTextPos: function () { return 0; },\n            getColumn: function () { return 0; },\n            getLine: function () { return 0; },\n            isAtStartOfLine: function () { return false; },\n            hasTrailingWhitespace: function () { return false; },\n            hasTrailingComment: function () { return false; },\n            rawWrite: ts.notImplemented,\n            getIndent: function () { return indent; },\n            increaseIndent: function () { indent++; },\n            decreaseIndent: function () { indent--; },\n            clear: resetWriter,\n            trackSymbol: ts.noop,\n            reportInaccessibleThisError: ts.noop,\n            reportInaccessibleUniqueSymbolError: ts.noop,\n            reportPrivateInBaseOfClassExpression: ts.noop,\n        };\n        function writeIndent() {\n            if (length > absoluteMaximumLength)\n                return;\n            if (lineStart) {\n                var indentString = ts.getIndentString(indent);\n                if (indentString) {\n                    length += indentString.length;\n                    displayParts.push(displayPart(indentString, ts.SymbolDisplayPartKind.space));\n                }\n                lineStart = false;\n            }\n        }\n        function writeKind(text, kind) {\n            if (length > absoluteMaximumLength)\n                return;\n            writeIndent();\n            length += text.length;\n            displayParts.push(displayPart(text, kind));\n        }\n        function writeSymbol(text, symbol) {\n            if (length > absoluteMaximumLength)\n                return;\n            writeIndent();\n            length += text.length;\n            displayParts.push(symbolPart(text, symbol));\n        }\n        function writeLine() {\n            if (length > absoluteMaximumLength)\n                return;\n            length += 1;\n            displayParts.push(lineBreakPart());\n            lineStart = true;\n        }\n        function resetWriter() {\n            displayParts = [];\n            lineStart = true;\n            indent = 0;\n            length = 0;\n        }\n    }\n    function symbolPart(text, symbol) {\n        return displayPart(text, displayPartKind(symbol));\n        function displayPartKind(symbol) {\n            var flags = symbol.flags;\n            if (flags & 3 /* Variable */) {\n                return isFirstDeclarationOfSymbolParameter(symbol) ? ts.SymbolDisplayPartKind.parameterName : ts.SymbolDisplayPartKind.localName;\n            }\n            else if (flags & 4 /* Property */) {\n                return ts.SymbolDisplayPartKind.propertyName;\n            }\n            else if (flags & 32768 /* GetAccessor */) {\n                return ts.SymbolDisplayPartKind.propertyName;\n            }\n            else if (flags & 65536 /* SetAccessor */) {\n                return ts.SymbolDisplayPartKind.propertyName;\n            }\n            else if (flags & 8 /* EnumMember */) {\n                return ts.SymbolDisplayPartKind.enumMemberName;\n            }\n            else if (flags & 16 /* Function */) {\n                return ts.SymbolDisplayPartKind.functionName;\n            }\n            else if (flags & 32 /* Class */) {\n                return ts.SymbolDisplayPartKind.className;\n            }\n            else if (flags & 64 /* Interface */) {\n                return ts.SymbolDisplayPartKind.interfaceName;\n            }\n            else if (flags & 384 /* Enum */) {\n                return ts.SymbolDisplayPartKind.enumName;\n            }\n            else if (flags & 1536 /* Module */) {\n                return ts.SymbolDisplayPartKind.moduleName;\n            }\n            else if (flags & 8192 /* Method */) {\n                return ts.SymbolDisplayPartKind.methodName;\n            }\n            else if (flags & 262144 /* TypeParameter */) {\n                return ts.SymbolDisplayPartKind.typeParameterName;\n            }\n            else if (flags & 524288 /* TypeAlias */) {\n                return ts.SymbolDisplayPartKind.aliasName;\n            }\n            else if (flags & 2097152 /* Alias */) {\n                return ts.SymbolDisplayPartKind.aliasName;\n            }\n            return ts.SymbolDisplayPartKind.text;\n        }\n    }\n    ts.symbolPart = symbolPart;\n    function displayPart(text, kind) {\n        return { text: text, kind: ts.SymbolDisplayPartKind[kind] };\n    }\n    ts.displayPart = displayPart;\n    function spacePart() {\n        return displayPart(\" \", ts.SymbolDisplayPartKind.space);\n    }\n    ts.spacePart = spacePart;\n    function keywordPart(kind) {\n        return displayPart(ts.tokenToString(kind), ts.SymbolDisplayPartKind.keyword);\n    }\n    ts.keywordPart = keywordPart;\n    function punctuationPart(kind) {\n        return displayPart(ts.tokenToString(kind), ts.SymbolDisplayPartKind.punctuation);\n    }\n    ts.punctuationPart = punctuationPart;\n    function operatorPart(kind) {\n        return displayPart(ts.tokenToString(kind), ts.SymbolDisplayPartKind.operator);\n    }\n    ts.operatorPart = operatorPart;\n    function textOrKeywordPart(text) {\n        var kind = ts.stringToToken(text);\n        return kind === undefined\n            ? textPart(text)\n            : keywordPart(kind);\n    }\n    ts.textOrKeywordPart = textOrKeywordPart;\n    function textPart(text) {\n        return displayPart(text, ts.SymbolDisplayPartKind.text);\n    }\n    ts.textPart = textPart;\n    var carriageReturnLineFeed = \"\\r\\n\";\n    /**\n     * The default is CRLF.\n     */\n    function getNewLineOrDefaultFromHost(host, formatSettings) {\n        var _a;\n        return (formatSettings === null || formatSettings === void 0 ? void 0 : formatSettings.newLineCharacter) ||\n            ((_a = host.getNewLine) === null || _a === void 0 ? void 0 : _a.call(host)) ||\n            carriageReturnLineFeed;\n    }\n    ts.getNewLineOrDefaultFromHost = getNewLineOrDefaultFromHost;\n    function lineBreakPart() {\n        return displayPart(\"\\n\", ts.SymbolDisplayPartKind.lineBreak);\n    }\n    ts.lineBreakPart = lineBreakPart;\n    function mapToDisplayParts(writeDisplayParts) {\n        try {\n            writeDisplayParts(displayPartWriter);\n            return displayPartWriter.displayParts();\n        }\n        finally {\n            displayPartWriter.clear();\n        }\n    }\n    ts.mapToDisplayParts = mapToDisplayParts;\n    function typeToDisplayParts(typechecker, type, enclosingDeclaration, flags) {\n        if (flags === void 0) { flags = 0 /* None */; }\n        return mapToDisplayParts(function (writer) {\n            typechecker.writeType(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer);\n        });\n    }\n    ts.typeToDisplayParts = typeToDisplayParts;\n    function symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration, meaning, flags) {\n        if (flags === void 0) { flags = 0 /* None */; }\n        return mapToDisplayParts(function (writer) {\n            typeChecker.writeSymbol(symbol, enclosingDeclaration, meaning, flags | 8 /* UseAliasDefinedOutsideCurrentScope */, writer);\n        });\n    }\n    ts.symbolToDisplayParts = symbolToDisplayParts;\n    function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags) {\n        if (flags === void 0) { flags = 0 /* None */; }\n        flags |= 16384 /* UseAliasDefinedOutsideCurrentScope */ | 1024 /* MultilineObjectLiterals */ | 32 /* WriteTypeArgumentsOfSignature */ | 8192 /* OmitParameterModifiers */;\n        return mapToDisplayParts(function (writer) {\n            typechecker.writeSignature(signature, enclosingDeclaration, flags, /*signatureKind*/ undefined, writer);\n        });\n    }\n    ts.signatureToDisplayParts = signatureToDisplayParts;\n    function isImportOrExportSpecifierName(location) {\n        return !!location.parent && ts.isImportOrExportSpecifier(location.parent) && location.parent.propertyName === location;\n    }\n    ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName;\n    function getScriptKind(fileName, host) {\n        // First check to see if the script kind was specified by the host. Chances are the host\n        // may override the default script kind for the file extension.\n        return ts.ensureScriptKind(fileName, host.getScriptKind && host.getScriptKind(fileName));\n    }\n    ts.getScriptKind = getScriptKind;\n    function getSymbolTarget(symbol, checker) {\n        var next = symbol;\n        while (isAliasSymbol(next) || (isTransientSymbol(next) && next.target)) {\n            if (isTransientSymbol(next) && next.target) {\n                next = next.target;\n            }\n            else {\n                next = ts.skipAlias(next, checker);\n            }\n        }\n        return next;\n    }\n    ts.getSymbolTarget = getSymbolTarget;\n    function isTransientSymbol(symbol) {\n        return (symbol.flags & 33554432 /* Transient */) !== 0;\n    }\n    function isAliasSymbol(symbol) {\n        return (symbol.flags & 2097152 /* Alias */) !== 0;\n    }\n    function getUniqueSymbolId(symbol, checker) {\n        return ts.getSymbolId(ts.skipAlias(symbol, checker));\n    }\n    ts.getUniqueSymbolId = getUniqueSymbolId;\n    function getFirstNonSpaceCharacterPosition(text, position) {\n        while (ts.isWhiteSpaceLike(text.charCodeAt(position))) {\n            position += 1;\n        }\n        return position;\n    }\n    ts.getFirstNonSpaceCharacterPosition = getFirstNonSpaceCharacterPosition;\n    function getPrecedingNonSpaceCharacterPosition(text, position) {\n        while (position > -1 && ts.isWhiteSpaceSingleLine(text.charCodeAt(position))) {\n            position -= 1;\n        }\n        return position + 1;\n    }\n    ts.getPrecedingNonSpaceCharacterPosition = getPrecedingNonSpaceCharacterPosition;\n    /**\n     * Creates a deep, memberwise clone of a node with no source map location.\n     *\n     * WARNING: This is an expensive operation and is only intended to be used in refactorings\n     * and code fixes (because those are triggered by explicit user actions).\n     */\n    function getSynthesizedDeepClone(node, includeTrivia) {\n        if (includeTrivia === void 0) { includeTrivia = true; }\n        var clone = node && getSynthesizedDeepCloneWorker(node);\n        if (clone && !includeTrivia)\n            suppressLeadingAndTrailingTrivia(clone);\n        return clone;\n    }\n    ts.getSynthesizedDeepClone = getSynthesizedDeepClone;\n    function getSynthesizedDeepCloneWithReplacements(node, includeTrivia, replaceNode) {\n        var clone = replaceNode(node);\n        if (clone) {\n            ts.setOriginalNode(clone, node);\n        }\n        else {\n            clone = getSynthesizedDeepCloneWorker(node, replaceNode);\n        }\n        if (clone && !includeTrivia)\n            suppressLeadingAndTrailingTrivia(clone);\n        return clone;\n    }\n    ts.getSynthesizedDeepCloneWithReplacements = getSynthesizedDeepCloneWithReplacements;\n    function getSynthesizedDeepCloneWorker(node, replaceNode) {\n        var visited = replaceNode ?\n            ts.visitEachChild(node, function (n) { return getSynthesizedDeepCloneWithReplacements(n, /*includeTrivia*/ true, replaceNode); }, ts.nullTransformationContext) :\n            ts.visitEachChild(node, getSynthesizedDeepClone, ts.nullTransformationContext);\n        if (visited === node) {\n            // This only happens for leaf nodes - internal nodes always see their children change.\n            var clone_1 = ts.isStringLiteral(node) ? ts.setOriginalNode(ts.factory.createStringLiteralFromNode(node), node) :\n                ts.isNumericLiteral(node) ? ts.setOriginalNode(ts.factory.createNumericLiteral(node.text, node.numericLiteralFlags), node) :\n                    ts.factory.cloneNode(node);\n            return ts.setTextRange(clone_1, node);\n        }\n        // PERF: As an optimization, rather than calling getSynthesizedClone, we'll update\n        // the new node created by visitEachChild with the extra changes getSynthesizedClone\n        // would have made.\n        visited.parent = undefined;\n        return visited;\n    }\n    function getSynthesizedDeepClones(nodes, includeTrivia) {\n        if (includeTrivia === void 0) { includeTrivia = true; }\n        return nodes && ts.factory.createNodeArray(nodes.map(function (n) { return getSynthesizedDeepClone(n, includeTrivia); }), nodes.hasTrailingComma);\n    }\n    ts.getSynthesizedDeepClones = getSynthesizedDeepClones;\n    function getSynthesizedDeepClonesWithReplacements(nodes, includeTrivia, replaceNode) {\n        return ts.factory.createNodeArray(nodes.map(function (n) { return getSynthesizedDeepCloneWithReplacements(n, includeTrivia, replaceNode); }), nodes.hasTrailingComma);\n    }\n    ts.getSynthesizedDeepClonesWithReplacements = getSynthesizedDeepClonesWithReplacements;\n    /**\n     * Sets EmitFlags to suppress leading and trailing trivia on the node.\n     */\n    function suppressLeadingAndTrailingTrivia(node) {\n        suppressLeadingTrivia(node);\n        suppressTrailingTrivia(node);\n    }\n    ts.suppressLeadingAndTrailingTrivia = suppressLeadingAndTrailingTrivia;\n    /**\n     * Sets EmitFlags to suppress leading trivia on the node.\n     */\n    function suppressLeadingTrivia(node) {\n        addEmitFlagsRecursively(node, 512 /* NoLeadingComments */, getFirstChild);\n    }\n    ts.suppressLeadingTrivia = suppressLeadingTrivia;\n    /**\n     * Sets EmitFlags to suppress trailing trivia on the node.\n     */\n    function suppressTrailingTrivia(node) {\n        addEmitFlagsRecursively(node, 1024 /* NoTrailingComments */, ts.getLastChild);\n    }\n    ts.suppressTrailingTrivia = suppressTrailingTrivia;\n    function copyComments(sourceNode, targetNode) {\n        var sourceFile = sourceNode.getSourceFile();\n        var text = sourceFile.text;\n        if (hasLeadingLineBreak(sourceNode, text)) {\n            copyLeadingComments(sourceNode, targetNode, sourceFile);\n        }\n        else {\n            copyTrailingAsLeadingComments(sourceNode, targetNode, sourceFile);\n        }\n        copyTrailingComments(sourceNode, targetNode, sourceFile);\n    }\n    ts.copyComments = copyComments;\n    function hasLeadingLineBreak(node, text) {\n        var start = node.getFullStart();\n        var end = node.getStart();\n        for (var i = start; i < end; i++) {\n            if (text.charCodeAt(i) === 10 /* lineFeed */)\n                return true;\n        }\n        return false;\n    }\n    function addEmitFlagsRecursively(node, flag, getChild) {\n        ts.addEmitFlags(node, flag);\n        var child = getChild(node);\n        if (child)\n            addEmitFlagsRecursively(child, flag, getChild);\n    }\n    function getFirstChild(node) {\n        return node.forEachChild(function (child) { return child; });\n    }\n    function getUniqueName(baseName, sourceFile) {\n        var nameText = baseName;\n        for (var i = 1; !ts.isFileLevelUniqueName(sourceFile, nameText); i++) {\n            nameText = baseName + \"_\" + i;\n        }\n        return nameText;\n    }\n    ts.getUniqueName = getUniqueName;\n    /**\n     * @return The index of the (only) reference to the extracted symbol.  We want the cursor\n     * to be on the reference, rather than the declaration, because it's closer to where the\n     * user was before extracting it.\n     */\n    function getRenameLocation(edits, renameFilename, name, preferLastLocation) {\n        var delta = 0;\n        var lastPos = -1;\n        for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) {\n            var _a = edits_1[_i], fileName = _a.fileName, textChanges_2 = _a.textChanges;\n            ts.Debug.assert(fileName === renameFilename);\n            for (var _b = 0, textChanges_1 = textChanges_2; _b < textChanges_1.length; _b++) {\n                var change = textChanges_1[_b];\n                var span = change.span, newText = change.newText;\n                var index = indexInTextChange(newText, name);\n                if (index !== -1) {\n                    lastPos = span.start + delta + index;\n                    // If the reference comes first, return immediately.\n                    if (!preferLastLocation) {\n                        return lastPos;\n                    }\n                }\n                delta += newText.length - span.length;\n            }\n        }\n        // If the declaration comes first, return the position of the last occurrence.\n        ts.Debug.assert(preferLastLocation);\n        ts.Debug.assert(lastPos >= 0);\n        return lastPos;\n    }\n    ts.getRenameLocation = getRenameLocation;\n    function copyLeadingComments(sourceNode, targetNode, sourceFile, commentKind, hasTrailingNewLine) {\n        ts.forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, getAddCommentsFunction(targetNode, sourceFile, commentKind, hasTrailingNewLine, ts.addSyntheticLeadingComment));\n    }\n    ts.copyLeadingComments = copyLeadingComments;\n    function copyTrailingComments(sourceNode, targetNode, sourceFile, commentKind, hasTrailingNewLine) {\n        ts.forEachTrailingCommentRange(sourceFile.text, sourceNode.end, getAddCommentsFunction(targetNode, sourceFile, commentKind, hasTrailingNewLine, ts.addSyntheticTrailingComment));\n    }\n    ts.copyTrailingComments = copyTrailingComments;\n    /**\n     * This function copies the trailing comments for the token that comes before `sourceNode`, as leading comments of `targetNode`.\n     * This is useful because sometimes a comment that refers to `sourceNode` will be a leading comment for `sourceNode`, according to the\n     * notion of trivia ownership, and instead will be a trailing comment for the token before `sourceNode`, e.g.:\n     * `function foo(\\* not leading comment for a *\\ a: string) {}`\n     * The comment refers to `a` but belongs to the `(` token, but we might want to copy it.\n     */\n    function copyTrailingAsLeadingComments(sourceNode, targetNode, sourceFile, commentKind, hasTrailingNewLine) {\n        ts.forEachTrailingCommentRange(sourceFile.text, sourceNode.pos, getAddCommentsFunction(targetNode, sourceFile, commentKind, hasTrailingNewLine, ts.addSyntheticLeadingComment));\n    }\n    ts.copyTrailingAsLeadingComments = copyTrailingAsLeadingComments;\n    function getAddCommentsFunction(targetNode, sourceFile, commentKind, hasTrailingNewLine, cb) {\n        return function (pos, end, kind, htnl) {\n            if (kind === 3 /* MultiLineCommentTrivia */) {\n                // Remove leading /*\n                pos += 2;\n                // Remove trailing */\n                end -= 2;\n            }\n            else {\n                // Remove leading //\n                pos += 2;\n            }\n            cb(targetNode, commentKind || kind, sourceFile.text.slice(pos, end), hasTrailingNewLine !== undefined ? hasTrailingNewLine : htnl);\n        };\n    }\n    function indexInTextChange(change, name) {\n        if (ts.startsWith(change, name))\n            return 0;\n        // Add a \" \" to avoid references inside words\n        var idx = change.indexOf(\" \" + name);\n        if (idx === -1)\n            idx = change.indexOf(\".\" + name);\n        if (idx === -1)\n            idx = change.indexOf('\"' + name);\n        return idx === -1 ? -1 : idx + 1;\n    }\n    /* @internal */\n    function needsParentheses(expression) {\n        return ts.isBinaryExpression(expression) && expression.operatorToken.kind === 27 /* CommaToken */ || ts.isObjectLiteralExpression(expression);\n    }\n    ts.needsParentheses = needsParentheses;\n    function getContextualTypeFromParent(node, checker) {\n        var parent = node.parent;\n        switch (parent.kind) {\n            case 204 /* NewExpression */:\n                return checker.getContextualType(parent);\n            case 216 /* BinaryExpression */: {\n                var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right;\n                return isEqualityOperatorKind(operatorToken.kind)\n                    ? checker.getTypeAtLocation(node === right ? left : right)\n                    : checker.getContextualType(node);\n            }\n            case 284 /* CaseClause */:\n                return parent.expression === node ? getSwitchedType(parent, checker) : undefined;\n            default:\n                return checker.getContextualType(node);\n        }\n    }\n    ts.getContextualTypeFromParent = getContextualTypeFromParent;\n    function quote(sourceFile, preferences, text) {\n        // Editors can pass in undefined or empty string - we want to infer the preference in those cases.\n        var quotePreference = getQuotePreference(sourceFile, preferences);\n        var quoted = JSON.stringify(text);\n        return quotePreference === 0 /* Single */ ? \"'\" + ts.stripQuotes(quoted).replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\" : quoted;\n    }\n    ts.quote = quote;\n    function isEqualityOperatorKind(kind) {\n        switch (kind) {\n            case 36 /* EqualsEqualsEqualsToken */:\n            case 34 /* EqualsEqualsToken */:\n            case 37 /* ExclamationEqualsEqualsToken */:\n            case 35 /* ExclamationEqualsToken */:\n                return true;\n            default:\n                return false;\n        }\n    }\n    ts.isEqualityOperatorKind = isEqualityOperatorKind;\n    function isStringLiteralOrTemplate(node) {\n        switch (node.kind) {\n            case 10 /* StringLiteral */:\n            case 14 /* NoSubstitutionTemplateLiteral */:\n            case 218 /* TemplateExpression */:\n            case 205 /* TaggedTemplateExpression */:\n                return true;\n            default:\n                return false;\n        }\n    }\n    ts.isStringLiteralOrTemplate = isStringLiteralOrTemplate;\n    function hasIndexSignature(type) {\n        return !!type.getStringIndexType() || !!type.getNumberIndexType();\n    }\n    ts.hasIndexSignature = hasIndexSignature;\n    function getSwitchedType(caseClause, checker) {\n        return checker.getTypeAtLocation(caseClause.parent.parent.expression);\n    }\n    ts.getSwitchedType = getSwitchedType;\n    ts.ANONYMOUS = \"anonymous function\";\n    function getTypeNodeIfAccessible(type, enclosingScope, program, host) {\n        var checker = program.getTypeChecker();\n        var typeIsAccessible = true;\n        var notAccessible = function () { typeIsAccessible = false; };\n        var res = checker.typeToTypeNode(type, enclosingScope, 1 /* NoTruncation */, {\n            trackSymbol: function (symbol, declaration, meaning) {\n                typeIsAccessible = typeIsAccessible && checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility === 0 /* Accessible */;\n            },\n            reportInaccessibleThisError: notAccessible,\n            reportPrivateInBaseOfClassExpression: notAccessible,\n            reportInaccessibleUniqueSymbolError: notAccessible,\n            moduleResolverHost: getModuleSpecifierResolverHost(program, host)\n        });\n        return typeIsAccessible ? res : undefined;\n    }\n    ts.getTypeNodeIfAccessible = getTypeNodeIfAccessible;\n    function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) {\n        return kind === 169 /* CallSignature */\n            || kind === 170 /* ConstructSignature */\n            || kind === 171 /* IndexSignature */\n            || kind === 162 /* PropertySignature */\n            || kind === 164 /* MethodSignature */;\n    }\n    ts.syntaxRequiresTrailingCommaOrSemicolonOrASI = syntaxRequiresTrailingCommaOrSemicolonOrASI;\n    function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) {\n        return kind === 251 /* FunctionDeclaration */\n            || kind === 166 /* Constructor */\n            || kind === 165 /* MethodDeclaration */\n            || kind === 167 /* GetAccessor */\n            || kind === 168 /* SetAccessor */;\n    }\n    ts.syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI = syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI;\n    function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) {\n        return kind === 256 /* ModuleDeclaration */;\n    }\n    ts.syntaxRequiresTrailingModuleBlockOrSemicolonOrASI = syntaxRequiresTrailingModuleBlockOrSemicolonOrASI;\n    function syntaxRequiresTrailingSemicolonOrASI(kind) {\n        return kind === 232 /* VariableStatement */\n            || kind === 233 /* ExpressionStatement */\n            || kind === 235 /* DoStatement */\n            || kind === 240 /* ContinueStatement */\n            || kind === 241 /* BreakStatement */\n            || kind === 242 /* ReturnStatement */\n            || kind === 246 /* ThrowStatement */\n            || kind === 248 /* DebuggerStatement */\n            || kind === 163 /* PropertyDeclaration */\n            || kind === 254 /* TypeAliasDeclaration */\n            || kind === 261 /* ImportDeclaration */\n            || kind === 260 /* ImportEqualsDeclaration */\n            || kind === 267 /* ExportDeclaration */\n            || kind === 259 /* NamespaceExportDeclaration */\n            || kind === 266 /* ExportAssignment */;\n    }\n    ts.syntaxRequiresTrailingSemicolonOrASI = syntaxRequiresTrailingSemicolonOrASI;\n    ts.syntaxMayBeASICandidate = ts.or(syntaxRequiresTrailingCommaOrSemicolonOrASI, syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI, syntaxRequiresTrailingModuleBlockOrSemicolonOrASI, syntaxRequiresTrailingSemicolonOrASI);\n    function nodeIsASICandidate(node, sourceFile) {\n        var lastToken = node.getLastToken(sourceFile);\n        if (lastToken && lastToken.kind === 26 /* SemicolonToken */) {\n            return false;\n        }\n        if (syntaxRequiresTrailingCommaOrSemicolonOrASI(node.kind)) {\n            if (lastToken && lastToken.kind === 27 /* CommaToken */) {\n                return false;\n            }\n        }\n        else if (syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(node.kind)) {\n            var lastChild = ts.last(node.getChildren(sourceFile));\n            if (lastChild && ts.isModuleBlock(lastChild)) {\n                return false;\n            }\n        }\n        else if (syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(node.kind)) {\n            var lastChild = ts.last(node.getChildren(sourceFile));\n            if (lastChild && ts.isFunctionBlock(lastChild)) {\n                return false;\n            }\n        }\n        else if (!syntaxRequiresTrailingSemicolonOrASI(node.kind)) {\n            return false;\n        }\n        // See comment in parser’s `parseDoStatement`\n        if (node.kind === 235 /* DoStatement */) {\n            return true;\n        }\n        var topNode = ts.findAncestor(node, function (ancestor) { return !ancestor.parent; });\n        var nextToken = findNextToken(node, topNode, sourceFile);\n        if (!nextToken || nextToken.kind === 19 /* CloseBraceToken */) {\n            return true;\n        }\n        var startLine = sourceFile.getLineAndCharacterOfPosition(node.getEnd()).line;\n        var endLine = sourceFile.getLineAndCharacterOfPosition(nextToken.getStart(sourceFile)).line;\n        return startLine !== endLine;\n    }\n    function positionIsASICandidate(pos, context, sourceFile) {\n        var contextAncestor = ts.findAncestor(context, function (ancestor) {\n            if (ancestor.end !== pos) {\n                return \"quit\";\n            }\n            return ts.syntaxMayBeASICandidate(ancestor.kind);\n        });\n        return !!contextAncestor && nodeIsASICandidate(contextAncestor, sourceFile);\n    }\n    ts.positionIsASICandidate = positionIsASICandidate;\n    function probablyUsesSemicolons(sourceFile) {\n        var withSemicolon = 0;\n        var withoutSemicolon = 0;\n        var nStatementsToObserve = 5;\n        ts.forEachChild(sourceFile, function visit(node) {\n            if (syntaxRequiresTrailingSemicolonOrASI(node.kind)) {\n                var lastToken = node.getLastToken(sourceFile);\n                if (lastToken && lastToken.kind === 26 /* SemicolonToken */) {\n                    withSemicolon++;\n                }\n                else {\n                    withoutSemicolon++;\n                }\n            }\n            if (withSemicolon + withoutSemicolon >= nStatementsToObserve) {\n                return true;\n            }\n            return ts.forEachChild(node, visit);\n        });\n        // One statement missing a semicolon isn’t sufficient evidence to say the user\n        // doesn’t want semicolons, because they may not even be done writing that statement.\n        if (withSemicolon === 0 && withoutSemicolon <= 1) {\n            return true;\n        }\n        // If even 2/5 places have a semicolon, the user probably wants semicolons\n        return withSemicolon / withoutSemicolon > 1 / nStatementsToObserve;\n    }\n    ts.probablyUsesSemicolons = probablyUsesSemicolons;\n    function tryGetDirectories(host, directoryName) {\n        return tryIOAndConsumeErrors(host, host.getDirectories, directoryName) || [];\n    }\n    ts.tryGetDirectories = tryGetDirectories;\n    function tryReadDirectory(host, path, extensions, exclude, include) {\n        return tryIOAndConsumeErrors(host, host.readDirectory, path, extensions, exclude, include) || ts.emptyArray;\n    }\n    ts.tryReadDirectory = tryReadDirectory;\n    function tryFileExists(host, path) {\n        return tryIOAndConsumeErrors(host, host.fileExists, path);\n    }\n    ts.tryFileExists = tryFileExists;\n    function tryDirectoryExists(host, path) {\n        return tryAndIgnoreErrors(function () { return ts.directoryProbablyExists(path, host); }) || false;\n    }\n    ts.tryDirectoryExists = tryDirectoryExists;\n    function tryAndIgnoreErrors(cb) {\n        try {\n            return cb();\n        }\n        catch (_a) {\n            return undefined;\n        }\n    }\n    ts.tryAndIgnoreErrors = tryAndIgnoreErrors;\n    function tryIOAndConsumeErrors(host, toApply) {\n        var args = [];\n        for (var _i = 2; _i < arguments.length; _i++) {\n            args[_i - 2] = arguments[_i];\n        }\n        return tryAndIgnoreErrors(function () { return toApply && toApply.apply(host, args); });\n    }\n    ts.tryIOAndConsumeErrors = tryIOAndConsumeErrors;\n    function findPackageJsons(startDirectory, host, stopDirectory) {\n        var paths = [];\n        ts.forEachAncestorDirectory(startDirectory, function (ancestor) {\n            if (ancestor === stopDirectory) {\n                return true;\n            }\n            var currentConfigPath = ts.combinePaths(ancestor, \"package.json\");\n            if (tryFileExists(host, currentConfigPath)) {\n                paths.push(currentConfigPath);\n            }\n        });\n        return paths;\n    }\n    ts.findPackageJsons = findPackageJsons;\n    function findPackageJson(directory, host) {\n        var packageJson;\n        ts.forEachAncestorDirectory(directory, function (ancestor) {\n            if (ancestor === \"node_modules\")\n                return true;\n            packageJson = ts.findConfigFile(ancestor, function (f) { return tryFileExists(host, f); }, \"package.json\");\n            if (packageJson) {\n                return true; // break out\n            }\n        });\n        return packageJson;\n    }\n    ts.findPackageJson = findPackageJson;\n    function getPackageJsonsVisibleToFile(fileName, host) {\n        if (!host.fileExists) {\n            return [];\n        }\n        var packageJsons = [];\n        ts.forEachAncestorDirectory(ts.getDirectoryPath(fileName), function (ancestor) {\n            var packageJsonFileName = ts.combinePaths(ancestor, \"package.json\");\n            if (host.fileExists(packageJsonFileName)) {\n                var info = createPackageJsonInfo(packageJsonFileName, host);\n                if (info) {\n                    packageJsons.push(info);\n                }\n            }\n        });\n        return packageJsons;\n    }\n    ts.getPackageJsonsVisibleToFile = getPackageJsonsVisibleToFile;\n    function createPackageJsonInfo(fileName, host) {\n        if (!host.readFile) {\n            return undefined;\n        }\n        var dependencyKeys = [\"dependencies\", \"devDependencies\", \"optionalDependencies\", \"peerDependencies\"];\n        var stringContent = host.readFile(fileName) || \"\";\n        var content = tryParseJson(stringContent);\n        var info = {};\n        if (content) {\n            for (var _i = 0, dependencyKeys_1 = dependencyKeys; _i < dependencyKeys_1.length; _i++) {\n                var key = dependencyKeys_1[_i];\n                var dependencies = content[key];\n                if (!dependencies) {\n                    continue;\n                }\n                var dependencyMap = new ts.Map();\n                for (var packageName in dependencies) {\n                    dependencyMap.set(packageName, dependencies[packageName]);\n                }\n                info[key] = dependencyMap;\n            }\n        }\n        var dependencyGroups = [\n            [1 /* Dependencies */, info.dependencies],\n            [2 /* DevDependencies */, info.devDependencies],\n            [8 /* OptionalDependencies */, info.optionalDependencies],\n            [4 /* PeerDependencies */, info.peerDependencies],\n        ];\n        return __assign(__assign({}, info), { parseable: !!content, fileName: fileName,\n            get: get,\n            has: function (dependencyName, inGroups) {\n                return !!get(dependencyName, inGroups);\n            } });\n        function get(dependencyName, inGroups) {\n            if (inGroups === void 0) { inGroups = 15 /* All */; }\n            for (var _i = 0, dependencyGroups_1 = dependencyGroups; _i < dependencyGroups_1.length; _i++) {\n                var _a = dependencyGroups_1[_i], group_1 = _a[0], deps = _a[1];\n                if (deps && (inGroups & group_1)) {\n                    var dep = deps.get(dependencyName);\n                    if (dep !== undefined) {\n                        return dep;\n                    }\n                }\n            }\n        }\n    }\n    ts.createPackageJsonInfo = createPackageJsonInfo;\n    function tryParseJson(text) {\n        try {\n            return JSON.parse(text);\n        }\n        catch (_a) {\n            return undefined;\n        }\n    }\n    function consumesNodeCoreModules(sourceFile) {\n        return ts.some(sourceFile.imports, function (_a) {\n            var text = _a.text;\n            return ts.JsTyping.nodeCoreModules.has(text);\n        });\n    }\n    ts.consumesNodeCoreModules = consumesNodeCoreModules;\n    function isInsideNodeModules(fileOrDirectory) {\n        return ts.contains(ts.getPathComponents(fileOrDirectory), \"node_modules\");\n    }\n    ts.isInsideNodeModules = isInsideNodeModules;\n    function isDiagnosticWithLocation(diagnostic) {\n        return diagnostic.file !== undefined && diagnostic.start !== undefined && diagnostic.length !== undefined;\n    }\n    ts.isDiagnosticWithLocation = isDiagnosticWithLocation;\n    function findDiagnosticForNode(node, sortedFileDiagnostics) {\n        var span = createTextSpanFromNode(node);\n        var index = ts.binarySearchKey(sortedFileDiagnostics, span, ts.identity, ts.compareTextSpans);\n        if (index >= 0) {\n            var diagnostic = sortedFileDiagnostics[index];\n            ts.Debug.assertEqual(diagnostic.file, node.getSourceFile(), \"Diagnostics proided to 'findDiagnosticForNode' must be from a single SourceFile\");\n            return ts.cast(diagnostic, isDiagnosticWithLocation);\n        }\n    }\n    ts.findDiagnosticForNode = findDiagnosticForNode;\n    function getDiagnosticsWithinSpan(span, sortedFileDiagnostics) {\n        var _a;\n        var index = ts.binarySearchKey(sortedFileDiagnostics, span.start, function (diag) { return diag.start; }, ts.compareValues);\n        if (index < 0) {\n            index = ~index;\n        }\n        while (((_a = sortedFileDiagnostics[index - 1]) === null || _a === void 0 ? void 0 : _a.start) === span.start) {\n            index--;\n        }\n        var result = [];\n        var end = ts.textSpanEnd(span);\n        while (true) {\n            var diagnostic = ts.tryCast(sortedFileDiagnostics[index], isDiagnosticWithLocation);\n            if (!diagnostic || diagnostic.start > end) {\n                break;\n            }\n            if (ts.textSpanContainsTextSpan(span, diagnostic)) {\n                result.push(diagnostic);\n            }\n            index++;\n        }\n        return result;\n    }\n    ts.getDiagnosticsWithinSpan = getDiagnosticsWithinSpan;\n    /* @internal */\n    function getRefactorContextSpan(_a) {\n        var startPosition = _a.startPosition, endPosition = _a.endPosition;\n        return ts.createTextSpanFromBounds(startPosition, endPosition === undefined ? startPosition : endPosition);\n    }\n    ts.getRefactorContextSpan = getRefactorContextSpan;\n    function mapOneOrMany(valueOrArray, f, resultSelector) {\n        if (resultSelector === void 0) { resultSelector = ts.identity; }\n        return valueOrArray ? ts.isArray(valueOrArray) ? resultSelector(ts.map(valueOrArray, f)) : f(valueOrArray, 0) : undefined;\n    }\n    ts.mapOneOrMany = mapOneOrMany;\n    /**\n     * If the provided value is an array, the first element of the array is returned; otherwise, the provided value is returned instead.\n     */\n    function firstOrOnly(valueOrArray) {\n        return ts.isArray(valueOrArray) ? ts.first(valueOrArray) : valueOrArray;\n    }\n    ts.firstOrOnly = firstOrOnly;\n    function getNameForExportedSymbol(symbol, scriptTarget) {\n        if (!(symbol.flags & 33554432 /* Transient */) && (symbol.escapedName === \"export=\" /* ExportEquals */ || symbol.escapedName === \"default\" /* Default */)) {\n            // Name of \"export default foo;\" is \"foo\". Name of \"export default 0\" is the filename converted to camelCase.\n            return ts.firstDefined(symbol.declarations, function (d) { var _a; return ts.isExportAssignment(d) ? (_a = ts.tryCast(ts.skipOuterExpressions(d.expression), ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text : undefined; })\n                || ts.codefix.moduleSymbolToValidIdentifier(getSymbolParentOrFail(symbol), scriptTarget);\n        }\n        return symbol.name;\n    }\n    ts.getNameForExportedSymbol = getNameForExportedSymbol;\n    function getSymbolParentOrFail(symbol) {\n        var _a;\n        return ts.Debug.checkDefined(symbol.parent, \"Symbol parent was undefined. Flags: \" + ts.Debug.formatSymbolFlags(symbol.flags) + \". \" +\n            (\"Declarations: \" + ((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.map(function (d) {\n                var kind = ts.Debug.formatSyntaxKind(d.kind);\n                var inJS = ts.isInJSFile(d);\n                var expression = d.expression;\n                return (inJS ? \"[JS]\" : \"\") + kind + (expression ? \" (expression: \" + ts.Debug.formatSyntaxKind(expression.kind) + \")\" : \"\");\n            }).join(\", \")) + \".\"));\n    }\n    /**\n     * Useful to check whether a string contains another string at a specific index\n     * without allocating another string or traversing the entire contents of the outer string.\n     *\n     * This function is useful in place of either of the following:\n     *\n     * ```ts\n     * // Allocates\n     * haystack.substr(startIndex, needle.length) === needle\n     *\n     * // Full traversal\n     * haystack.indexOf(needle, startIndex) === startIndex\n     * ```\n     *\n     * @param haystack The string that potentially contains `needle`.\n     * @param needle The string whose content might sit within `haystack`.\n     * @param startIndex The index within `haystack` to start searching for `needle`.\n     */\n    function stringContainsAt(haystack, needle, startIndex) {\n        var needleLength = needle.length;\n        if (needleLength + startIndex > haystack.length) {\n            return false;\n        }\n        for (var i = 0; i < needleLength; i++) {\n            if (needle.charCodeAt(i) !== haystack.charCodeAt(i + startIndex))\n                return false;\n        }\n        return true;\n    }\n    ts.stringContainsAt = stringContainsAt;\n    function startsWithUnderscore(name) {\n        return name.charCodeAt(0) === 95 /* _ */;\n    }\n    ts.startsWithUnderscore = startsWithUnderscore;\n    function isGlobalDeclaration(declaration) {\n        return !isNonGlobalDeclaration(declaration);\n    }\n    ts.isGlobalDeclaration = isGlobalDeclaration;\n    function isNonGlobalDeclaration(declaration) {\n        var sourceFile = declaration.getSourceFile();\n        // If the file is not a module, the declaration is global\n        if (!sourceFile.externalModuleIndicator && !sourceFile.commonJsModuleIndicator) {\n            return false;\n        }\n        // If the file is a module written in TypeScript, it still might be in a `declare global` augmentation\n        return ts.isInJSFile(declaration) || !ts.findAncestor(declaration, ts.isGlobalScopeAugmentation);\n    }\n    ts.isNonGlobalDeclaration = isNonGlobalDeclaration;\n    // #endregion\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    /** The classifier is used for syntactic highlighting in editors via the TSServer */\n    function createClassifier() {\n        var scanner = ts.createScanner(99 /* Latest */, /*skipTrivia*/ false);\n        function getClassificationsForLine(text, lexState, syntacticClassifierAbsent) {\n            return convertClassificationsToResult(getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent), text);\n        }\n        // If there is a syntactic classifier ('syntacticClassifierAbsent' is false),\n        // we will be more conservative in order to avoid conflicting with the syntactic classifier.\n        function getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent) {\n            var token = 0 /* Unknown */;\n            var lastNonTriviaToken = 0 /* Unknown */;\n            // Just a stack of TemplateHeads and OpenCurlyBraces, used to perform rudimentary (inexact)\n            // classification on template strings. Because of the context free nature of templates,\n            // the only precise way to classify a template portion would be by propagating the stack across\n            // lines, just as we do with the end-of-line state. However, this is a burden for implementers,\n            // and the behavior is entirely subsumed by the syntactic classifier anyway, so we instead\n            // flatten any nesting when the template stack is non-empty and encode it in the end-of-line state.\n            // Situations in which this fails are\n            //  1) When template strings are nested across different lines:\n            //          `hello ${ `world\n            //          ` }`\n            //\n            //     Where on the second line, you will get the closing of a template,\n            //     a closing curly, and a new template.\n            //\n            //  2) When substitution expressions have curly braces and the curly brace falls on the next line:\n            //          `hello ${ () => {\n            //          return \"world\" } } `\n            //\n            //     Where on the second line, you will get the 'return' keyword,\n            //     a string literal, and a template end consisting of '} } `'.\n            var templateStack = [];\n            var _a = getPrefixFromLexState(lexState), prefix = _a.prefix, pushTemplate = _a.pushTemplate;\n            text = prefix + text;\n            var offset = prefix.length;\n            if (pushTemplate) {\n                templateStack.push(15 /* TemplateHead */);\n            }\n            scanner.setText(text);\n            var endOfLineState = 0 /* None */;\n            var spans = [];\n            // We can run into an unfortunate interaction between the lexical and syntactic classifier\n            // when the user is typing something generic.  Consider the case where the user types:\n            //\n            //      Foo<number\n            //\n            // From the lexical classifier's perspective, 'number' is a keyword, and so the word will\n            // be classified as such.  However, from the syntactic classifier's tree-based perspective\n            // this is simply an expression with the identifier 'number' on the RHS of the less than\n            // token.  So the classification will go back to being an identifier.  The moment the user\n            // types again, number will become a keyword, then an identifier, etc. etc.\n            //\n            // To try to avoid this problem, we avoid classifying contextual keywords as keywords\n            // when the user is potentially typing something generic.  We just can't do a good enough\n            // job at the lexical level, and so well leave it up to the syntactic classifier to make\n            // the determination.\n            //\n            // In order to determine if the user is potentially typing something generic, we use a\n            // weak heuristic where we track < and > tokens.  It's a weak heuristic, but should\n            // work well enough in practice.\n            var angleBracketStack = 0;\n            do {\n                token = scanner.scan();\n                if (!ts.isTrivia(token)) {\n                    handleToken();\n                    lastNonTriviaToken = token;\n                }\n                var end = scanner.getTextPos();\n                pushEncodedClassification(scanner.getTokenPos(), end, offset, classFromKind(token), spans);\n                if (end >= text.length) {\n                    var end_1 = getNewEndOfLineState(scanner, token, ts.lastOrUndefined(templateStack));\n                    if (end_1 !== undefined) {\n                        endOfLineState = end_1;\n                    }\n                }\n            } while (token !== 1 /* EndOfFileToken */);\n            function handleToken() {\n                switch (token) {\n                    case 43 /* SlashToken */:\n                    case 67 /* SlashEqualsToken */:\n                        if (!noRegexTable[lastNonTriviaToken] && scanner.reScanSlashToken() === 13 /* RegularExpressionLiteral */) {\n                            token = 13 /* RegularExpressionLiteral */;\n                        }\n                        break;\n                    case 29 /* LessThanToken */:\n                        if (lastNonTriviaToken === 78 /* Identifier */) {\n                            // Could be the start of something generic.  Keep track of that by bumping\n                            // up the current count of generic contexts we may be in.\n                            angleBracketStack++;\n                        }\n                        break;\n                    case 31 /* GreaterThanToken */:\n                        if (angleBracketStack > 0) {\n                            // If we think we're currently in something generic, then mark that that\n                            // generic entity is complete.\n                            angleBracketStack--;\n                        }\n                        break;\n                    case 128 /* AnyKeyword */:\n                    case 147 /* StringKeyword */:\n                    case 144 /* NumberKeyword */:\n                    case 131 /* BooleanKeyword */:\n                    case 148 /* SymbolKeyword */:\n                        if (angleBracketStack > 0 && !syntacticClassifierAbsent) {\n                            // If it looks like we're could be in something generic, don't classify this\n                            // as a keyword.  We may just get overwritten by the syntactic classifier,\n                            // causing a noisy experience for the user.\n                            token = 78 /* Identifier */;\n                        }\n                        break;\n                    case 15 /* TemplateHead */:\n                        templateStack.push(token);\n                        break;\n                    case 18 /* OpenBraceToken */:\n                        // If we don't have anything on the template stack,\n                        // then we aren't trying to keep track of a previously scanned template head.\n                        if (templateStack.length > 0) {\n                            templateStack.push(token);\n                        }\n                        break;\n                    case 19 /* CloseBraceToken */:\n                        // If we don't have anything on the template stack,\n                        // then we aren't trying to keep track of a previously scanned template head.\n                        if (templateStack.length > 0) {\n                            var lastTemplateStackToken = ts.lastOrUndefined(templateStack);\n                            if (lastTemplateStackToken === 15 /* TemplateHead */) {\n                                token = scanner.reScanTemplateToken(/* isTaggedTemplate */ false);\n                                // Only pop on a TemplateTail; a TemplateMiddle indicates there is more for us.\n                                if (token === 17 /* TemplateTail */) {\n                                    templateStack.pop();\n                                }\n                                else {\n                                    ts.Debug.assertEqual(token, 16 /* TemplateMiddle */, \"Should have been a template middle.\");\n                                }\n                            }\n                            else {\n                                ts.Debug.assertEqual(lastTemplateStackToken, 18 /* OpenBraceToken */, \"Should have been an open brace\");\n                                templateStack.pop();\n                            }\n                        }\n                        break;\n                    default:\n                        if (!ts.isKeyword(token)) {\n                            break;\n                        }\n                        if (lastNonTriviaToken === 24 /* DotToken */) {\n                            token = 78 /* Identifier */;\n                        }\n                        else if (ts.isKeyword(lastNonTriviaToken) && ts.isKeyword(token) && !canFollow(lastNonTriviaToken, token)) {\n                            // We have two keywords in a row.  Only treat the second as a keyword if\n                            // it's a sequence that could legally occur in the language.  Otherwise\n                            // treat it as an identifier.  This way, if someone writes \"private var\"\n                            // we recognize that 'var' is actually an identifier here.\n                            token = 78 /* Identifier */;\n                        }\n                }\n            }\n            return { endOfLineState: endOfLineState, spans: spans };\n        }\n        return { getClassificationsForLine: getClassificationsForLine, getEncodedLexicalClassifications: getEncodedLexicalClassifications };\n    }\n    ts.createClassifier = createClassifier;\n    /// We do not have a full parser support to know when we should parse a regex or not\n    /// If we consider every slash token to be a regex, we could be missing cases like \"1/2/3\", where\n    /// we have a series of divide operator. this list allows us to be more accurate by ruling out\n    /// locations where a regexp cannot exist.\n    var noRegexTable = ts.arrayToNumericMap([\n        78 /* Identifier */,\n        10 /* StringLiteral */,\n        8 /* NumericLiteral */,\n        9 /* BigIntLiteral */,\n        13 /* RegularExpressionLiteral */,\n        107 /* ThisKeyword */,\n        45 /* PlusPlusToken */,\n        46 /* MinusMinusToken */,\n        21 /* CloseParenToken */,\n        23 /* CloseBracketToken */,\n        19 /* CloseBraceToken */,\n        109 /* TrueKeyword */,\n        94 /* FalseKeyword */,\n    ], function (token) { return token; }, function () { return true; });\n    function getNewEndOfLineState(scanner, token, lastOnTemplateStack) {\n        switch (token) {\n            case 10 /* StringLiteral */: {\n                // Check to see if we finished up on a multiline string literal.\n                if (!scanner.isUnterminated())\n                    return undefined;\n                var tokenText = scanner.getTokenText();\n                var lastCharIndex = tokenText.length - 1;\n                var numBackslashes = 0;\n                while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === 92 /* backslash */) {\n                    numBackslashes++;\n                }\n                // If we have an odd number of backslashes, then the multiline string is unclosed\n                if ((numBackslashes & 1) === 0)\n                    return undefined;\n                return tokenText.charCodeAt(0) === 34 /* doubleQuote */ ? 3 /* InDoubleQuoteStringLiteral */ : 2 /* InSingleQuoteStringLiteral */;\n            }\n            case 3 /* MultiLineCommentTrivia */:\n                // Check to see if the multiline comment was unclosed.\n                return scanner.isUnterminated() ? 1 /* InMultiLineCommentTrivia */ : undefined;\n            default:\n                if (ts.isTemplateLiteralKind(token)) {\n                    if (!scanner.isUnterminated()) {\n                        return undefined;\n                    }\n                    switch (token) {\n                        case 17 /* TemplateTail */:\n                            return 5 /* InTemplateMiddleOrTail */;\n                        case 14 /* NoSubstitutionTemplateLiteral */:\n                            return 4 /* InTemplateHeadOrNoSubstitutionTemplate */;\n                        default:\n                            return ts.Debug.fail(\"Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #\" + token);\n                    }\n                }\n                return lastOnTemplateStack === 15 /* TemplateHead */ ? 6 /* InTemplateSubstitutionPosition */ : undefined;\n        }\n    }\n    function pushEncodedClassification(start, end, offset, classification, result) {\n        if (classification === 8 /* whiteSpace */) {\n            // Don't bother with whitespace classifications.  They're not needed.\n            return;\n        }\n        if (start === 0 && offset > 0) {\n            // We're classifying the first token, and this was a case where we prepended text.\n            // We should consider the start of this token to be at the start of the original text.\n            start += offset;\n        }\n        var length = end - start;\n        if (length > 0) {\n            // All our tokens are in relation to the augmented text.  Move them back to be\n            // relative to the original text.\n            result.push(start - offset, length, classification);\n        }\n    }\n    function convertClassificationsToResult(classifications, text) {\n        var entries = [];\n        var dense = classifications.spans;\n        var lastEnd = 0;\n        for (var i = 0; i < dense.length; i += 3) {\n            var start = dense[i];\n            var length_1 = dense[i + 1];\n            var type = dense[i + 2];\n            // Make a whitespace entry between the last item and this one.\n            if (lastEnd >= 0) {\n                var whitespaceLength_1 = start - lastEnd;\n                if (whitespaceLength_1 > 0) {\n                    entries.push({ length: whitespaceLength_1, classification: ts.TokenClass.Whitespace });\n                }\n            }\n            entries.push({ length: length_1, classification: convertClassification(type) });\n            lastEnd = start + length_1;\n        }\n        var whitespaceLength = text.length - lastEnd;\n        if (whitespaceLength > 0) {\n            entries.push({ length: whitespaceLength, classification: ts.TokenClass.Whitespace });\n        }\n        return { entries: entries, finalLexState: classifications.endOfLineState };\n    }\n    function convertClassification(type) {\n        switch (type) {\n            case 1 /* comment */: return ts.TokenClass.Comment;\n            case 3 /* keyword */: return ts.TokenClass.Keyword;\n            case 4 /* numericLiteral */: return ts.TokenClass.NumberLiteral;\n            case 25 /* bigintLiteral */: return ts.TokenClass.BigIntLiteral;\n            case 5 /* operator */: return ts.TokenClass.Operator;\n            case 6 /* stringLiteral */: return ts.TokenClass.StringLiteral;\n            case 8 /* whiteSpace */: return ts.TokenClass.Whitespace;\n            case 10 /* punctuation */: return ts.TokenClass.Punctuation;\n            case 2 /* identifier */:\n            case 11 /* className */:\n            case 12 /* enumName */:\n            case 13 /* interfaceName */:\n            case 14 /* moduleName */:\n            case 15 /* typeParameterName */:\n            case 16 /* typeAliasName */:\n            case 9 /* text */:\n            case 17 /* parameterName */:\n                return ts.TokenClass.Identifier;\n            default:\n                return undefined; // TODO: GH#18217 Debug.assertNever(type);\n        }\n    }\n    /** Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. */\n    function canFollow(keyword1, keyword2) {\n        if (!ts.isAccessibilityModifier(keyword1)) {\n            // Assume any other keyword combination is legal.\n            // This can be refined in the future if there are more cases we want the classifier to be better at.\n            return true;\n        }\n        switch (keyword2) {\n            case 134 /* GetKeyword */:\n            case 146 /* SetKeyword */:\n            case 132 /* ConstructorKeyword */:\n            case 123 /* StaticKeyword */:\n                return true; // Allow things like \"public get\", \"public constructor\" and \"public static\".\n            default:\n                return false; // Any other keyword following \"public\" is actually an identifier, not a real keyword.\n        }\n    }\n    function getPrefixFromLexState(lexState) {\n        // If we're in a string literal, then prepend: \"\\\n        // (and a newline).  That way when we lex we'll think we're still in a string literal.\n        //\n        // If we're in a multiline comment, then prepend: /*\n        // (and a newline).  That way when we lex we'll think we're still in a multiline comment.\n        switch (lexState) {\n            case 3 /* InDoubleQuoteStringLiteral */:\n                return { prefix: \"\\\"\\\\\\n\" };\n            case 2 /* InSingleQuoteStringLiteral */:\n                return { prefix: \"'\\\\\\n\" };\n            case 1 /* InMultiLineCommentTrivia */:\n                return { prefix: \"/*\\n\" };\n            case 4 /* InTemplateHeadOrNoSubstitutionTemplate */:\n                return { prefix: \"`\\n\" };\n            case 5 /* InTemplateMiddleOrTail */:\n                return { prefix: \"}\\n\", pushTemplate: true };\n            case 6 /* InTemplateSubstitutionPosition */:\n                return { prefix: \"\", pushTemplate: true };\n            case 0 /* None */:\n                return { prefix: \"\" };\n            default:\n                return ts.Debug.assertNever(lexState);\n        }\n    }\n    function isBinaryExpressionOperatorToken(token) {\n        switch (token) {\n            case 41 /* AsteriskToken */:\n            case 43 /* SlashToken */:\n            case 44 /* PercentToken */:\n            case 39 /* PlusToken */:\n            case 40 /* MinusToken */:\n            case 47 /* LessThanLessThanToken */:\n            case 48 /* GreaterThanGreaterThanToken */:\n            case 49 /* GreaterThanGreaterThanGreaterThanToken */:\n            case 29 /* LessThanToken */:\n            case 31 /* GreaterThanToken */:\n            case 32 /* LessThanEqualsToken */:\n            case 33 /* GreaterThanEqualsToken */:\n            case 101 /* InstanceOfKeyword */:\n            case 100 /* InKeyword */:\n            case 126 /* AsKeyword */:\n            case 34 /* EqualsEqualsToken */:\n            case 35 /* ExclamationEqualsToken */:\n            case 36 /* EqualsEqualsEqualsToken */:\n            case 37 /* ExclamationEqualsEqualsToken */:\n            case 50 /* AmpersandToken */:\n            case 52 /* CaretToken */:\n            case 51 /* BarToken */:\n            case 55 /* AmpersandAmpersandToken */:\n            case 56 /* BarBarToken */:\n            case 73 /* BarEqualsToken */:\n            case 72 /* AmpersandEqualsToken */:\n            case 77 /* CaretEqualsToken */:\n            case 69 /* LessThanLessThanEqualsToken */:\n            case 70 /* GreaterThanGreaterThanEqualsToken */:\n            case 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */:\n            case 63 /* PlusEqualsToken */:\n            case 64 /* MinusEqualsToken */:\n            case 65 /* AsteriskEqualsToken */:\n            case 67 /* SlashEqualsToken */:\n            case 68 /* PercentEqualsToken */:\n            case 62 /* EqualsToken */:\n            case 27 /* CommaToken */:\n            case 60 /* QuestionQuestionToken */:\n            case 74 /* BarBarEqualsToken */:\n            case 75 /* AmpersandAmpersandEqualsToken */:\n            case 76 /* QuestionQuestionEqualsToken */:\n                return true;\n            default:\n                return false;\n        }\n    }\n    function isPrefixUnaryExpressionOperatorToken(token) {\n        switch (token) {\n            case 39 /* PlusToken */:\n            case 40 /* MinusToken */:\n            case 54 /* TildeToken */:\n            case 53 /* ExclamationToken */:\n            case 45 /* PlusPlusToken */:\n            case 46 /* MinusMinusToken */:\n                return true;\n            default:\n                return false;\n        }\n    }\n    function classFromKind(token) {\n        if (ts.isKeyword(token)) {\n            return 3 /* keyword */;\n        }\n        else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) {\n            return 5 /* operator */;\n        }\n        else if (token >= 18 /* FirstPunctuation */ && token <= 77 /* LastPunctuation */) {\n            return 10 /* punctuation */;\n        }\n        switch (token) {\n            case 8 /* NumericLiteral */:\n                return 4 /* numericLiteral */;\n            case 9 /* BigIntLiteral */:\n                return 25 /* bigintLiteral */;\n            case 10 /* StringLiteral */:\n                return 6 /* stringLiteral */;\n            case 13 /* RegularExpressionLiteral */:\n                return 7 /* regularExpressionLiteral */;\n            case 7 /* ConflictMarkerTrivia */:\n            case 3 /* MultiLineCommentTrivia */:\n            case 2 /* SingleLineCommentTrivia */:\n                return 1 /* comment */;\n            case 5 /* WhitespaceTrivia */:\n            case 4 /* NewLineTrivia */:\n                return 8 /* whiteSpace */;\n            case 78 /* Identifier */:\n            default:\n                if (ts.isTemplateLiteralKind(token)) {\n                    return 6 /* stringLiteral */;\n                }\n                return 2 /* identifier */;\n        }\n    }\n    /* @internal */\n    function getSemanticClassifications(typeChecker, cancellationToken, sourceFile, classifiableNames, span) {\n        return convertClassificationsToSpans(getEncodedSemanticClassifications(typeChecker, cancellationToken, sourceFile, classifiableNames, span));\n    }\n    ts.getSemanticClassifications = getSemanticClassifications;\n    function checkForClassificationCancellation(cancellationToken, kind) {\n        // We don't want to actually call back into our host on every node to find out if we've\n        // been canceled.  That would be an enormous amount of chattyness, along with the all\n        // the overhead of marshalling the data to/from the host.  So instead we pick a few\n        // reasonable node kinds to bother checking on.  These node kinds represent high level\n        // constructs that we would expect to see commonly, but just at a far less frequent\n        // interval.\n        //\n        // For example, in checker.ts (around 750k) we only have around 600 of these constructs.\n        // That means we're calling back into the host around every 1.2k of the file we process.\n        // Lib.d.ts has similar numbers.\n        switch (kind) {\n            case 256 /* ModuleDeclaration */:\n            case 252 /* ClassDeclaration */:\n            case 253 /* InterfaceDeclaration */:\n            case 251 /* FunctionDeclaration */:\n            case 221 /* ClassExpression */:\n            case 208 /* FunctionExpression */:\n            case 209 /* ArrowFunction */:\n                cancellationToken.throwIfCancellationRequested();\n        }\n    }\n    /* @internal */\n    function getEncodedSemanticClassifications(typeChecker, cancellationToken, sourceFile, classifiableNames, span) {\n        var spans = [];\n        sourceFile.forEachChild(function cb(node) {\n            // Only walk into nodes that intersect the requested span.\n            if (!node || !ts.textSpanIntersectsWith(span, node.pos, node.getFullWidth())) {\n                return;\n            }\n            checkForClassificationCancellation(cancellationToken, node.kind);\n            // Only bother calling into the typechecker if this is an identifier that\n            // could possibly resolve to a type name.  This makes classification run\n            // in a third of the time it would normally take.\n            if (ts.isIdentifier(node) && !ts.nodeIsMissing(node) && classifiableNames.has(node.escapedText)) {\n                var symbol = typeChecker.getSymbolAtLocation(node);\n                var type = symbol && classifySymbol(symbol, ts.getMeaningFromLocation(node), typeChecker);\n                if (type) {\n                    pushClassification(node.getStart(sourceFile), node.getEnd(), type);\n                }\n            }\n            node.forEachChild(cb);\n        });\n        return { spans: spans, endOfLineState: 0 /* None */ };\n        function pushClassification(start, end, type) {\n            var length = end - start;\n            ts.Debug.assert(length > 0, \"Classification had non-positive length of \" + length);\n            spans.push(start);\n            spans.push(length);\n            spans.push(type);\n        }\n    }\n    ts.getEncodedSemanticClassifications = getEncodedSemanticClassifications;\n    function classifySymbol(symbol, meaningAtPosition, checker) {\n        var flags = symbol.getFlags();\n        if ((flags & 2885600 /* Classifiable */) === 0 /* None */) {\n            return undefined;\n        }\n        else if (flags & 32 /* Class */) {\n            return 11 /* className */;\n        }\n        else if (flags & 384 /* Enum */) {\n            return 12 /* enumName */;\n        }\n        else if (flags & 524288 /* TypeAlias */) {\n            return 16 /* typeAliasName */;\n        }\n        else if (flags & 1536 /* Module */) {\n            // Only classify a module as such if\n            //  - It appears in a namespace context.\n            //  - There exists a module declaration which actually impacts the value side.\n            return meaningAtPosition & 4 /* Namespace */ || meaningAtPosition & 1 /* Value */ && hasValueSideModule(symbol) ? 14 /* moduleName */ : undefined;\n        }\n        else if (flags & 2097152 /* Alias */) {\n            return classifySymbol(checker.getAliasedSymbol(symbol), meaningAtPosition, checker);\n        }\n        else if (meaningAtPosition & 2 /* Type */) {\n            return flags & 64 /* Interface */ ? 13 /* interfaceName */ : flags & 262144 /* TypeParameter */ ? 15 /* typeParameterName */ : undefined;\n        }\n        else {\n            return undefined;\n        }\n    }\n    /** Returns true if there exists a module that introduces entities on the value side. */\n    function hasValueSideModule(symbol) {\n        return ts.some(symbol.declarations, function (declaration) {\n            return ts.isModuleDeclaration(declaration) && ts.getModuleInstanceState(declaration) === 1 /* Instantiated */;\n        });\n    }\n    function getClassificationTypeName(type) {\n        switch (type) {\n            case 1 /* comment */: return \"comment\" /* comment */;\n            case 2 /* identifier */: return \"identifier\" /* identifier */;\n            case 3 /* keyword */: return \"keyword\" /* keyword */;\n            case 4 /* numericLiteral */: return \"number\" /* numericLiteral */;\n            case 25 /* bigintLiteral */: return \"bigint\" /* bigintLiteral */;\n            case 5 /* operator */: return \"operator\" /* operator */;\n            case 6 /* stringLiteral */: return \"string\" /* stringLiteral */;\n            case 8 /* whiteSpace */: return \"whitespace\" /* whiteSpace */;\n            case 9 /* text */: return \"text\" /* text */;\n            case 10 /* punctuation */: return \"punctuation\" /* punctuation */;\n            case 11 /* className */: return \"class name\" /* className */;\n            case 12 /* enumName */: return \"enum name\" /* enumName */;\n            case 13 /* interfaceName */: return \"interface name\" /* interfaceName */;\n            case 14 /* moduleName */: return \"module name\" /* moduleName */;\n            case 15 /* typeParameterName */: return \"type parameter name\" /* typeParameterName */;\n            case 16 /* typeAliasName */: return \"type alias name\" /* typeAliasName */;\n            case 17 /* parameterName */: return \"parameter name\" /* parameterName */;\n            case 18 /* docCommentTagName */: return \"doc comment tag name\" /* docCommentTagName */;\n            case 19 /* jsxOpenTagName */: return \"jsx open tag name\" /* jsxOpenTagName */;\n            case 20 /* jsxCloseTagName */: return \"jsx close tag name\" /* jsxCloseTagName */;\n            case 21 /* jsxSelfClosingTagName */: return \"jsx self closing tag name\" /* jsxSelfClosingTagName */;\n            case 22 /* jsxAttribute */: return \"jsx attribute\" /* jsxAttribute */;\n            case 23 /* jsxText */: return \"jsx text\" /* jsxText */;\n            case 24 /* jsxAttributeStringLiteralValue */: return \"jsx attribute string literal value\" /* jsxAttributeStringLiteralValue */;\n            default: return undefined; // TODO: GH#18217 throw Debug.assertNever(type);\n        }\n    }\n    function convertClassificationsToSpans(classifications) {\n        ts.Debug.assert(classifications.spans.length % 3 === 0);\n        var dense = classifications.spans;\n        var result = [];\n        for (var i = 0; i < dense.length; i += 3) {\n            result.push({\n                textSpan: ts.createTextSpan(dense[i], dense[i + 1]),\n                classificationType: getClassificationTypeName(dense[i + 2])\n            });\n        }\n        return result;\n    }\n    /* @internal */\n    function getSyntacticClassifications(cancellationToken, sourceFile, span) {\n        return convertClassificationsToSpans(getEncodedSyntacticClassifications(cancellationToken, sourceFile, span));\n    }\n    ts.getSyntacticClassifications = getSyntacticClassifications;\n    /* @internal */\n    function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span) {\n        var spanStart = span.start;\n        var spanLength = span.length;\n        // Make a scanner we can get trivia from.\n        var triviaScanner = ts.createScanner(99 /* Latest */, /*skipTrivia*/ false, sourceFile.languageVariant, sourceFile.text);\n        var mergeConflictScanner = ts.createScanner(99 /* Latest */, /*skipTrivia*/ false, sourceFile.languageVariant, sourceFile.text);\n        var result = [];\n        processElement(sourceFile);\n        return { spans: result, endOfLineState: 0 /* None */ };\n        function pushClassification(start, length, type) {\n            result.push(start);\n            result.push(length);\n            result.push(type);\n        }\n        function classifyLeadingTriviaAndGetTokenStart(token) {\n            triviaScanner.setTextPos(token.pos);\n            while (true) {\n                var start = triviaScanner.getTextPos();\n                // only bother scanning if we have something that could be trivia.\n                if (!ts.couldStartTrivia(sourceFile.text, start)) {\n                    return start;\n                }\n                var kind = triviaScanner.scan();\n                var end = triviaScanner.getTextPos();\n                var width = end - start;\n                // The moment we get something that isn't trivia, then stop processing.\n                if (!ts.isTrivia(kind)) {\n                    return start;\n                }\n                switch (kind) {\n                    case 4 /* NewLineTrivia */:\n                    case 5 /* WhitespaceTrivia */:\n                        // Don't bother with newlines/whitespace.\n                        continue;\n                    case 2 /* SingleLineCommentTrivia */:\n                    case 3 /* MultiLineCommentTrivia */:\n                        // Only bother with the trivia if it at least intersects the span of interest.\n                        classifyComment(token, kind, start, width);\n                        // Classifying a comment might cause us to reuse the trivia scanner\n                        // (because of jsdoc comments).  So after we classify the comment make\n                        // sure we set the scanner position back to where it needs to be.\n                        triviaScanner.setTextPos(end);\n                        continue;\n                    case 7 /* ConflictMarkerTrivia */:\n                        var text = sourceFile.text;\n                        var ch = text.charCodeAt(start);\n                        // for the <<<<<<< and >>>>>>> markers, we just add them in as comments\n                        // in the classification stream.\n                        if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) {\n                            pushClassification(start, width, 1 /* comment */);\n                            continue;\n                        }\n                        // for the ||||||| and ======== markers, add a comment for the first line,\n                        // and then lex all subsequent lines up until the end of the conflict marker.\n                        ts.Debug.assert(ch === 124 /* bar */ || ch === 61 /* equals */);\n                        classifyDisabledMergeCode(text, start, end);\n                        break;\n                    case 6 /* ShebangTrivia */:\n                        // TODO: Maybe we should classify these.\n                        break;\n                    default:\n                        ts.Debug.assertNever(kind);\n                }\n            }\n        }\n        function classifyComment(token, kind, start, width) {\n            if (kind === 3 /* MultiLineCommentTrivia */) {\n                // See if this is a doc comment.  If so, we'll classify certain portions of it\n                // specially.\n                var docCommentAndDiagnostics = ts.parseIsolatedJSDocComment(sourceFile.text, start, width);\n                if (docCommentAndDiagnostics && docCommentAndDiagnostics.jsDoc) {\n                    // TODO: This should be predicated on `token[\"kind\"]` being compatible with `HasJSDoc[\"kind\"]`\n                    ts.setParent(docCommentAndDiagnostics.jsDoc, token);\n                    classifyJSDocComment(docCommentAndDiagnostics.jsDoc);\n                    return;\n                }\n            }\n            else if (kind === 2 /* SingleLineCommentTrivia */) {\n                if (tryClassifyTripleSlashComment(start, width)) {\n                    return;\n                }\n            }\n            // Simple comment.  Just add as is.\n            pushCommentRange(start, width);\n        }\n        function pushCommentRange(start, width) {\n            pushClassification(start, width, 1 /* comment */);\n        }\n        function classifyJSDocComment(docComment) {\n            var pos = docComment.pos;\n            if (docComment.tags) {\n                for (var _i = 0, _a = docComment.tags; _i < _a.length; _i++) {\n                    var tag = _a[_i];\n                    // As we walk through each tag, classify the portion of text from the end of\n                    // the last tag (or the start of the entire doc comment) as 'comment'.\n                    if (tag.pos !== pos) {\n                        pushCommentRange(pos, tag.pos - pos);\n                    }\n                    pushClassification(tag.pos, 1, 10 /* punctuation */); // \"@\"\n                    pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. \"param\"\n                    pos = tag.tagName.end;\n                    switch (tag.kind) {\n                        case 326 /* JSDocParameterTag */:\n                            processJSDocParameterTag(tag);\n                            break;\n                        case 330 /* JSDocTemplateTag */:\n                            processJSDocTemplateTag(tag);\n                            pos = tag.end;\n                            break;\n                        case 329 /* JSDocTypeTag */:\n                            processElement(tag.typeExpression);\n                            pos = tag.end;\n                            break;\n                        case 327 /* JSDocReturnTag */:\n                            processElement(tag.typeExpression);\n                            pos = tag.end;\n                            break;\n                    }\n                }\n            }\n            if (pos !== docComment.end) {\n                pushCommentRange(pos, docComment.end - pos);\n            }\n            return;\n            function processJSDocParameterTag(tag) {\n                if (tag.isNameFirst) {\n                    pushCommentRange(pos, tag.name.pos - pos);\n                    pushClassification(tag.name.pos, tag.name.end - tag.name.pos, 17 /* parameterName */);\n                    pos = tag.name.end;\n                }\n                if (tag.typeExpression) {\n                    pushCommentRange(pos, tag.typeExpression.pos - pos);\n                    processElement(tag.typeExpression);\n                    pos = tag.typeExpression.end;\n                }\n                if (!tag.isNameFirst) {\n                    pushCommentRange(pos, tag.name.pos - pos);\n                    pushClassification(tag.name.pos, tag.name.end - tag.name.pos, 17 /* parameterName */);\n                    pos = tag.name.end;\n                }\n            }\n        }\n        function tryClassifyTripleSlashComment(start, width) {\n            var tripleSlashXMLCommentRegEx = /^(\\/\\/\\/\\s*)(<)(?:(\\S+)((?:[^/]|\\/[^>])*)(\\/>)?)?/im;\n            var attributeRegex = /(\\S+)(\\s*)(=)(\\s*)('[^']+'|\"[^\"]+\")/img;\n            var text = sourceFile.text.substr(start, width);\n            var match = tripleSlashXMLCommentRegEx.exec(text);\n            if (!match) {\n                return false;\n            }\n            // Limiting classification to exactly the elements and attributes\n            // defined in `ts.commentPragmas` would be excessive, but we can avoid\n            // some obvious false positives (e.g. in XML-like doc comments) by\n            // checking the element name.\n            // eslint-disable-next-line no-in-operator\n            if (!match[3] || !(match[3] in ts.commentPragmas)) {\n                return false;\n            }\n            var pos = start;\n            pushCommentRange(pos, match[1].length); // ///\n            pos += match[1].length;\n            pushClassification(pos, match[2].length, 10 /* punctuation */); // <\n            pos += match[2].length;\n            pushClassification(pos, match[3].length, 21 /* jsxSelfClosingTagName */); // element name\n            pos += match[3].length;\n            var attrText = match[4];\n            var attrPos = pos;\n            while (true) {\n                var attrMatch = attributeRegex.exec(attrText);\n                if (!attrMatch) {\n                    break;\n                }\n                var newAttrPos = pos + attrMatch.index;\n                if (newAttrPos > attrPos) {\n                    pushCommentRange(attrPos, newAttrPos - attrPos);\n                    attrPos = newAttrPos;\n                }\n                pushClassification(attrPos, attrMatch[1].length, 22 /* jsxAttribute */); // attribute name\n                attrPos += attrMatch[1].length;\n                if (attrMatch[2].length) {\n                    pushCommentRange(attrPos, attrMatch[2].length); // whitespace\n                    attrPos += attrMatch[2].length;\n                }\n                pushClassification(attrPos, attrMatch[3].length, 5 /* operator */); // =\n                attrPos += attrMatch[3].length;\n                if (attrMatch[4].length) {\n                    pushCommentRange(attrPos, attrMatch[4].length); // whitespace\n                    attrPos += attrMatch[4].length;\n                }\n                pushClassification(attrPos, attrMatch[5].length, 24 /* jsxAttributeStringLiteralValue */); // attribute value\n                attrPos += attrMatch[5].length;\n            }\n            pos += match[4].length;\n            if (pos > attrPos) {\n                pushCommentRange(attrPos, pos - attrPos);\n            }\n            if (match[5]) {\n                pushClassification(pos, match[5].length, 10 /* punctuation */); // />\n                pos += match[5].length;\n            }\n            var end = start + width;\n            if (pos < end) {\n                pushCommentRange(pos, end - pos);\n            }\n            return true;\n        }\n        function processJSDocTemplateTag(tag) {\n            for (var _i = 0, _a = tag.getChildren(); _i < _a.length; _i++) {\n                var child = _a[_i];\n                processElement(child);\n            }\n        }\n        function classifyDisabledMergeCode(text, start, end) {\n            // Classify the line that the ||||||| or ======= marker is on as a comment.\n            // Then just lex all further tokens and add them to the result.\n            var i;\n            for (i = start; i < end; i++) {\n                if (ts.isLineBreak(text.charCodeAt(i))) {\n                    break;\n                }\n            }\n            pushClassification(start, i - start, 1 /* comment */);\n            mergeConflictScanner.setTextPos(i);\n            while (mergeConflictScanner.getTextPos() < end) {\n                classifyDisabledCodeToken();\n            }\n        }\n        function classifyDisabledCodeToken() {\n            var start = mergeConflictScanner.getTextPos();\n            var tokenKind = mergeConflictScanner.scan();\n            var end = mergeConflictScanner.getTextPos();\n            var type = classifyTokenType(tokenKind);\n            if (type) {\n                pushClassification(start, end - start, type);\n            }\n        }\n        /**\n         * Returns true if node should be treated as classified and no further processing is required.\n         * False will mean that node is not classified and traverse routine should recurse into node contents.\n         */\n        function tryClassifyNode(node) {\n            if (ts.isJSDoc(node)) {\n                return true;\n            }\n            if (ts.nodeIsMissing(node)) {\n                return true;\n            }\n            var classifiedElementName = tryClassifyJsxElementName(node);\n            if (!ts.isToken(node) && node.kind !== 11 /* JsxText */ && classifiedElementName === undefined) {\n                return false;\n            }\n            var tokenStart = node.kind === 11 /* JsxText */ ? node.pos : classifyLeadingTriviaAndGetTokenStart(node);\n            var tokenWidth = node.end - tokenStart;\n            ts.Debug.assert(tokenWidth >= 0);\n            if (tokenWidth > 0) {\n                var type = classifiedElementName || classifyTokenType(node.kind, node);\n                if (type) {\n                    pushClassification(tokenStart, tokenWidth, type);\n                }\n            }\n            return true;\n        }\n        function tryClassifyJsxElementName(token) {\n            switch (token.parent && token.parent.kind) {\n                case 275 /* JsxOpeningElement */:\n                    if (token.parent.tagName === token) {\n                        return 19 /* jsxOpenTagName */;\n                    }\n                    break;\n                case 276 /* JsxClosingElement */:\n                    if (token.parent.tagName === token) {\n                        return 20 /* jsxCloseTagName */;\n                    }\n                    break;\n                case 274 /* JsxSelfClosingElement */:\n                    if (token.parent.tagName === token) {\n                        return 21 /* jsxSelfClosingTagName */;\n                    }\n                    break;\n                case 280 /* JsxAttribute */:\n                    if (token.parent.name === token) {\n                        return 22 /* jsxAttribute */;\n                    }\n                    break;\n            }\n            return undefined;\n        }\n        // for accurate classification, the actual token should be passed in.  however, for\n        // cases like 'disabled merge code' classification, we just get the token kind and\n        // classify based on that instead.\n        function classifyTokenType(tokenKind, token) {\n            if (ts.isKeyword(tokenKind)) {\n                return 3 /* keyword */;\n            }\n            // Special case `<` and `>`: If they appear in a generic context they are punctuation,\n            // not operators.\n            if (tokenKind === 29 /* LessThanToken */ || tokenKind === 31 /* GreaterThanToken */) {\n                // If the node owning the token has a type argument list or type parameter list, then\n                // we can effectively assume that a '<' and '>' belong to those lists.\n                if (token && ts.getTypeArgumentOrTypeParameterList(token.parent)) {\n                    return 10 /* punctuation */;\n                }\n            }\n            if (ts.isPunctuation(tokenKind)) {\n                if (token) {\n                    var parent = token.parent;\n                    if (tokenKind === 62 /* EqualsToken */) {\n                        // the '=' in a variable declaration is special cased here.\n                        if (parent.kind === 249 /* VariableDeclaration */ ||\n                            parent.kind === 163 /* PropertyDeclaration */ ||\n                            parent.kind === 160 /* Parameter */ ||\n                            parent.kind === 280 /* JsxAttribute */) {\n                            return 5 /* operator */;\n                        }\n                    }\n                    if (parent.kind === 216 /* BinaryExpression */ ||\n                        parent.kind === 214 /* PrefixUnaryExpression */ ||\n                        parent.kind === 215 /* PostfixUnaryExpression */ ||\n                        parent.kind === 217 /* ConditionalExpression */) {\n                        return 5 /* operator */;\n                    }\n                }\n                return 10 /* punctuation */;\n            }\n            else if (tokenKind === 8 /* NumericLiteral */) {\n                return 4 /* numericLiteral */;\n            }\n            else if (tokenKind === 9 /* BigIntLiteral */) {\n                return 25 /* bigintLiteral */;\n            }\n            else if (tokenKind === 10 /* StringLiteral */) {\n                return token && token.parent.kind === 280 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */;\n            }\n            else if (tokenKind === 13 /* RegularExpressionLiteral */) {\n                // TODO: we should get another classification type for these literals.\n                return 6 /* stringLiteral */;\n            }\n            else if (ts.isTemplateLiteralKind(tokenKind)) {\n                // TODO (drosen): we should *also* get another classification type for these literals.\n                return 6 /* stringLiteral */;\n            }\n            else if (tokenKind === 11 /* JsxText */) {\n                return 23 /* jsxText */;\n            }\n            else if (tokenKind === 78 /* Identifier */) {\n                if (token) {\n                    switch (token.parent.kind) {\n                        case 252 /* ClassDeclaration */:\n                            if (token.parent.name === token) {\n                                return 11 /* className */;\n                            }\n                            return;\n                        case 159 /* TypeParameter */:\n                            if (token.parent.name === token) {\n                                return 15 /* typeParameterName */;\n                            }\n                            return;\n                        case 253 /* InterfaceDeclaration */:\n                            if (token.parent.name === token) {\n                                return 13 /* interfaceName */;\n                            }\n                            return;\n                        case 255 /* EnumDeclaration */:\n                            if (token.parent.name === token) {\n                                return 12 /* enumName */;\n                            }\n                            return;\n                        case 256 /* ModuleDeclaration */:\n                            if (token.parent.name === token) {\n                                return 14 /* moduleName */;\n                            }\n                            return;\n                        case 160 /* Parameter */:\n                            if (token.parent.name === token) {\n                                return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */;\n                            }\n                            return;\n                    }\n                }\n                return 2 /* identifier */;\n            }\n        }\n        function processElement(element) {\n            if (!element) {\n                return;\n            }\n            // Ignore nodes that don't intersect the original span to classify.\n            if (ts.decodedTextSpanIntersectsWith(spanStart, spanLength, element.pos, element.getFullWidth())) {\n                checkForClassificationCancellation(cancellationToken, element.kind);\n                for (var _i = 0, _a = element.getChildren(sourceFile); _i < _a.length; _i++) {\n                    var child = _a[_i];\n                    if (!tryClassifyNode(child)) {\n                        // Recurse into our child nodes.\n                        processElement(child);\n                    }\n                }\n            }\n        }\n    }\n    ts.getEncodedSyntacticClassifications = getEncodedSyntacticClassifications;\n})(ts || (ts = {}));\n/** @internal */\nvar ts;\n(function (ts) {\n    var classifier;\n    (function (classifier) {\n        var v2020;\n        (function (v2020) {\n            var TokenEncodingConsts;\n            (function (TokenEncodingConsts) {\n                TokenEncodingConsts[TokenEncodingConsts[\"typeOffset\"] = 8] = \"typeOffset\";\n                TokenEncodingConsts[TokenEncodingConsts[\"modifierMask\"] = 255] = \"modifierMask\";\n            })(TokenEncodingConsts = v2020.TokenEncodingConsts || (v2020.TokenEncodingConsts = {}));\n            var TokenType;\n            (function (TokenType) {\n                TokenType[TokenType[\"class\"] = 0] = \"class\";\n                TokenType[TokenType[\"enum\"] = 1] = \"enum\";\n                TokenType[TokenType[\"interface\"] = 2] = \"interface\";\n                TokenType[TokenType[\"namespace\"] = 3] = \"namespace\";\n                TokenType[TokenType[\"typeParameter\"] = 4] = \"typeParameter\";\n                TokenType[TokenType[\"type\"] = 5] = \"type\";\n                TokenType[TokenType[\"parameter\"] = 6] = \"parameter\";\n                TokenType[TokenType[\"variable\"] = 7] = \"variable\";\n                TokenType[TokenType[\"enumMember\"] = 8] = \"enumMember\";\n                TokenType[TokenType[\"property\"] = 9] = \"property\";\n                TokenType[TokenType[\"function\"] = 10] = \"function\";\n                TokenType[TokenType[\"member\"] = 11] = \"member\";\n            })(TokenType = v2020.TokenType || (v2020.TokenType = {}));\n            var TokenModifier;\n            (function (TokenModifier) {\n                TokenModifier[TokenModifier[\"declaration\"] = 0] = \"declaration\";\n                TokenModifier[TokenModifier[\"static\"] = 1] = \"static\";\n                TokenModifier[TokenModifier[\"async\"] = 2] = \"async\";\n                TokenModifier[TokenModifier[\"readonly\"] = 3] = \"readonly\";\n                TokenModifier[TokenModifier[\"defaultLibrary\"] = 4] = \"defaultLibrary\";\n                TokenModifier[TokenModifier[\"local\"] = 5] = \"local\";\n            })(TokenModifier = v2020.TokenModifier || (v2020.TokenModifier = {}));\n            /** This is mainly used internally for testing */\n            function getSemanticClassifications(program, cancellationToken, sourceFile, span) {\n                var classifications = getEncodedSemanticClassifications(program, cancellationToken, sourceFile, span);\n                ts.Debug.assert(classifications.spans.length % 3 === 0);\n                var dense = classifications.spans;\n                var result = [];\n                for (var i = 0; i < dense.length; i += 3) {\n                    result.push({\n                        textSpan: ts.createTextSpan(dense[i], dense[i + 1]),\n                        classificationType: dense[i + 2]\n                    });\n                }\n                return result;\n            }\n            v2020.getSemanticClassifications = getSemanticClassifications;\n            function getEncodedSemanticClassifications(program, cancellationToken, sourceFile, span) {\n                return {\n                    spans: getSemanticTokens(program, sourceFile, span, cancellationToken),\n                    endOfLineState: 0 /* None */\n                };\n            }\n            v2020.getEncodedSemanticClassifications = getEncodedSemanticClassifications;\n            function getSemanticTokens(program, sourceFile, span, cancellationToken) {\n                var resultTokens = [];\n                var collector = function (node, typeIdx, modifierSet) {\n                    resultTokens.push(node.getStart(sourceFile), node.getWidth(sourceFile), ((typeIdx + 1) << 8 /* typeOffset */) + modifierSet);\n                };\n                if (program && sourceFile) {\n                    collectTokens(program, sourceFile, span, collector, cancellationToken);\n                }\n                return resultTokens;\n            }\n            function collectTokens(program, sourceFile, span, collector, cancellationToken) {\n                var typeChecker = program.getTypeChecker();\n                var inJSXElement = false;\n                function visit(node) {\n                    switch (node.kind) {\n                        case 256 /* ModuleDeclaration */:\n                        case 252 /* ClassDeclaration */:\n                        case 253 /* InterfaceDeclaration */:\n                        case 251 /* FunctionDeclaration */:\n                        case 221 /* ClassExpression */:\n                        case 208 /* FunctionExpression */:\n                        case 209 /* ArrowFunction */:\n                            cancellationToken.throwIfCancellationRequested();\n                    }\n                    if (!node || !ts.textSpanIntersectsWith(span, node.pos, node.getFullWidth()) || node.getFullWidth() === 0) {\n                        return;\n                    }\n                    var prevInJSXElement = inJSXElement;\n                    if (ts.isJsxElement(node) || ts.isJsxSelfClosingElement(node)) {\n                        inJSXElement = true;\n                    }\n                    if (ts.isJsxExpression(node)) {\n                        inJSXElement = false;\n                    }\n                    if (ts.isIdentifier(node) && !inJSXElement && !inImportClause(node)) {\n                        var symbol = typeChecker.getSymbolAtLocation(node);\n                        if (symbol) {\n                            if (symbol.flags & 2097152 /* Alias */) {\n                                symbol = typeChecker.getAliasedSymbol(symbol);\n                            }\n                            var typeIdx = classifySymbol(symbol, ts.getMeaningFromLocation(node));\n                            if (typeIdx !== undefined) {\n                                var modifierSet = 0;\n                                if (node.parent) {\n                                    var parentIsDeclaration = (ts.isBindingElement(node.parent) || tokenFromDeclarationMapping.get(node.parent.kind) === typeIdx);\n                                    if (parentIsDeclaration && node.parent.name === node) {\n                                        modifierSet = 1 << 0 /* declaration */;\n                                    }\n                                }\n                                // property declaration in constructor\n                                if (typeIdx === 6 /* parameter */ && isRightSideOfQualifiedNameOrPropertyAccess(node)) {\n                                    typeIdx = 9 /* property */;\n                                }\n                                typeIdx = reclassifyByType(typeChecker, node, typeIdx);\n                                var decl = symbol.valueDeclaration;\n                                if (decl) {\n                                    var modifiers = ts.getCombinedModifierFlags(decl);\n                                    var nodeFlags = ts.getCombinedNodeFlags(decl);\n                                    if (modifiers & 32 /* Static */) {\n                                        modifierSet |= 1 << 1 /* static */;\n                                    }\n                                    if (modifiers & 256 /* Async */) {\n                                        modifierSet |= 1 << 2 /* async */;\n                                    }\n                                    if (typeIdx !== 0 /* class */ && typeIdx !== 2 /* interface */) {\n                                        if ((modifiers & 64 /* Readonly */) || (nodeFlags & 2 /* Const */) || (symbol.getFlags() & 8 /* EnumMember */)) {\n                                            modifierSet |= 1 << 3 /* readonly */;\n                                        }\n                                    }\n                                    if ((typeIdx === 7 /* variable */ || typeIdx === 10 /* function */) && isLocalDeclaration(decl, sourceFile)) {\n                                        modifierSet |= 1 << 5 /* local */;\n                                    }\n                                    if (program.isSourceFileDefaultLibrary(decl.getSourceFile())) {\n                                        modifierSet |= 1 << 4 /* defaultLibrary */;\n                                    }\n                                }\n                                else if (symbol.declarations && symbol.declarations.some(function (d) { return program.isSourceFileDefaultLibrary(d.getSourceFile()); })) {\n                                    modifierSet |= 1 << 4 /* defaultLibrary */;\n                                }\n                                collector(node, typeIdx, modifierSet);\n                            }\n                        }\n                    }\n                    ts.forEachChild(node, visit);\n                    inJSXElement = prevInJSXElement;\n                }\n                visit(sourceFile);\n            }\n            function classifySymbol(symbol, meaning) {\n                var flags = symbol.getFlags();\n                if (flags & 32 /* Class */) {\n                    return 0 /* class */;\n                }\n                else if (flags & 384 /* Enum */) {\n                    return 1 /* enum */;\n                }\n                else if (flags & 524288 /* TypeAlias */) {\n                    return 5 /* type */;\n                }\n                else if (flags & 64 /* Interface */) {\n                    if (meaning & 2 /* Type */) {\n                        return 2 /* interface */;\n                    }\n                }\n                else if (flags & 262144 /* TypeParameter */) {\n                    return 4 /* typeParameter */;\n                }\n                var decl = symbol.valueDeclaration || symbol.declarations && symbol.declarations[0];\n                if (decl && ts.isBindingElement(decl)) {\n                    decl = getDeclarationForBindingElement(decl);\n                }\n                return decl && tokenFromDeclarationMapping.get(decl.kind);\n            }\n            function reclassifyByType(typeChecker, node, typeIdx) {\n                // type based classifications\n                if (typeIdx === 7 /* variable */ || typeIdx === 9 /* property */ || typeIdx === 6 /* parameter */) {\n                    var type_1 = typeChecker.getTypeAtLocation(node);\n                    if (type_1) {\n                        var test = function (condition) {\n                            return condition(type_1) || type_1.isUnion() && type_1.types.some(condition);\n                        };\n                        if (typeIdx !== 6 /* parameter */ && test(function (t) { return t.getConstructSignatures().length > 0; })) {\n                            return 0 /* class */;\n                        }\n                        if (test(function (t) { return t.getCallSignatures().length > 0; }) && !test(function (t) { return t.getProperties().length > 0; }) || isExpressionInCallExpression(node)) {\n                            return typeIdx === 9 /* property */ ? 11 /* member */ : 10 /* function */;\n                        }\n                    }\n                }\n                return typeIdx;\n            }\n            function isLocalDeclaration(decl, sourceFile) {\n                if (ts.isBindingElement(decl)) {\n                    decl = getDeclarationForBindingElement(decl);\n                }\n                if (ts.isVariableDeclaration(decl)) {\n                    return (!ts.isSourceFile(decl.parent.parent.parent) || ts.isCatchClause(decl.parent)) && decl.getSourceFile() === sourceFile;\n                }\n                else if (ts.isFunctionDeclaration(decl)) {\n                    return !ts.isSourceFile(decl.parent) && decl.getSourceFile() === sourceFile;\n                }\n                return false;\n            }\n            function getDeclarationForBindingElement(element) {\n                while (true) {\n                    if (ts.isBindingElement(element.parent.parent)) {\n                        element = element.parent.parent;\n                    }\n                    else {\n                        return element.parent.parent;\n                    }\n                }\n            }\n            function inImportClause(node) {\n                var parent = node.parent;\n                return parent && (ts.isImportClause(parent) || ts.isImportSpecifier(parent) || ts.isNamespaceImport(parent));\n            }\n            function isExpressionInCallExpression(node) {\n                while (isRightSideOfQualifiedNameOrPropertyAccess(node)) {\n                    node = node.parent;\n                }\n                return ts.isCallExpression(node.parent) && node.parent.expression === node;\n            }\n            function isRightSideOfQualifiedNameOrPropertyAccess(node) {\n                return (ts.isQualifiedName(node.parent) && node.parent.right === node) || (ts.isPropertyAccessExpression(node.parent) && node.parent.name === node);\n            }\n            var tokenFromDeclarationMapping = new ts.Map([\n                [249 /* VariableDeclaration */, 7 /* variable */],\n                [160 /* Parameter */, 6 /* parameter */],\n                [163 /* PropertyDeclaration */, 9 /* property */],\n                [256 /* ModuleDeclaration */, 3 /* namespace */],\n                [255 /* EnumDeclaration */, 1 /* enum */],\n                [291 /* EnumMember */, 8 /* enumMember */],\n                [252 /* ClassDeclaration */, 0 /* class */],\n                [165 /* MethodDeclaration */, 11 /* member */],\n                [251 /* FunctionDeclaration */, 10 /* function */],\n                [208 /* FunctionExpression */, 10 /* function */],\n                [164 /* MethodSignature */, 11 /* member */],\n                [167 /* GetAccessor */, 9 /* property */],\n                [168 /* SetAccessor */, 9 /* property */],\n                [162 /* PropertySignature */, 9 /* property */],\n                [253 /* InterfaceDeclaration */, 2 /* interface */],\n                [254 /* TypeAliasDeclaration */, 5 /* type */],\n                [159 /* TypeParameter */, 4 /* typeParameter */],\n                [288 /* PropertyAssignment */, 9 /* property */],\n                [289 /* ShorthandPropertyAssignment */, 9 /* property */]\n            ]);\n        })(v2020 = classifier.v2020 || (classifier.v2020 = {}));\n    })(classifier = ts.classifier || (ts.classifier = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var Completions;\n    (function (Completions) {\n        var StringCompletions;\n        (function (StringCompletions) {\n            function getStringLiteralCompletions(sourceFile, position, contextToken, checker, options, host, log, preferences) {\n                if (ts.isInReferenceComment(sourceFile, position)) {\n                    var entries = getTripleSlashReferenceCompletion(sourceFile, position, options, host);\n                    return entries && convertPathCompletions(entries);\n                }\n                if (ts.isInString(sourceFile, position, contextToken)) {\n                    if (!contextToken || !ts.isStringLiteralLike(contextToken))\n                        return undefined;\n                    var entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, checker, options, host);\n                    return convertStringLiteralCompletions(entries, contextToken, sourceFile, checker, log, preferences);\n                }\n            }\n            StringCompletions.getStringLiteralCompletions = getStringLiteralCompletions;\n            function convertStringLiteralCompletions(completion, contextToken, sourceFile, checker, log, preferences) {\n                if (completion === undefined) {\n                    return undefined;\n                }\n                var optionalReplacementSpan = ts.createTextSpanFromStringLiteralLikeContent(contextToken);\n                switch (completion.kind) {\n                    case 0 /* Paths */:\n                        return convertPathCompletions(completion.paths);\n                    case 1 /* Properties */: {\n                        var entries = [];\n                        Completions.getCompletionEntriesFromSymbols(completion.symbols, entries, contextToken, sourceFile, sourceFile, checker, 99 /* ESNext */, log, 4 /* String */, preferences); // Target will not be used, so arbitrary\n                        return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan: optionalReplacementSpan, entries: entries };\n                    }\n                    case 2 /* Types */: {\n                        var entries = completion.types.map(function (type) { return ({\n                            name: type.value,\n                            kindModifiers: \"\" /* none */,\n                            kind: \"string\" /* string */,\n                            sortText: Completions.SortText.LocationPriority,\n                            replacementSpan: ts.getReplacementSpanForContextToken(contextToken)\n                        }); });\n                        return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: completion.isNewIdentifier, optionalReplacementSpan: optionalReplacementSpan, entries: entries };\n                    }\n                    default:\n                        return ts.Debug.assertNever(completion);\n                }\n            }\n            function getStringLiteralCompletionDetails(name, sourceFile, position, contextToken, checker, options, host, cancellationToken) {\n                if (!contextToken || !ts.isStringLiteralLike(contextToken))\n                    return undefined;\n                var completions = getStringLiteralCompletionEntries(sourceFile, contextToken, position, checker, options, host);\n                return completions && stringLiteralCompletionDetails(name, contextToken, completions, sourceFile, checker, cancellationToken);\n            }\n            StringCompletions.getStringLiteralCompletionDetails = getStringLiteralCompletionDetails;\n            function stringLiteralCompletionDetails(name, location, completion, sourceFile, checker, cancellationToken) {\n                switch (completion.kind) {\n                    case 0 /* Paths */: {\n                        var match = ts.find(completion.paths, function (p) { return p.name === name; });\n                        return match && Completions.createCompletionDetails(name, kindModifiersFromExtension(match.extension), match.kind, [ts.textPart(name)]);\n                    }\n                    case 1 /* Properties */: {\n                        var match = ts.find(completion.symbols, function (s) { return s.name === name; });\n                        return match && Completions.createCompletionDetailsForSymbol(match, checker, sourceFile, location, cancellationToken);\n                    }\n                    case 2 /* Types */:\n                        return ts.find(completion.types, function (t) { return t.value === name; }) ? Completions.createCompletionDetails(name, \"\" /* none */, \"type\" /* typeElement */, [ts.textPart(name)]) : undefined;\n                    default:\n                        return ts.Debug.assertNever(completion);\n                }\n            }\n            function convertPathCompletions(pathCompletions) {\n                var isGlobalCompletion = false; // We don't want the editor to offer any other completions, such as snippets, inside a comment.\n                var isNewIdentifierLocation = true; // The user may type in a path that doesn't yet exist, creating a \"new identifier\" with respect to the collection of identifiers the server is aware of.\n                var entries = pathCompletions.map(function (_a) {\n                    var name = _a.name, kind = _a.kind, span = _a.span, extension = _a.extension;\n                    return ({ name: name, kind: kind, kindModifiers: kindModifiersFromExtension(extension), sortText: Completions.SortText.LocationPriority, replacementSpan: span });\n                });\n                return { isGlobalCompletion: isGlobalCompletion, isMemberCompletion: false, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries };\n            }\n            function kindModifiersFromExtension(extension) {\n                switch (extension) {\n                    case \".d.ts\" /* Dts */: return \".d.ts\" /* dtsModifier */;\n                    case \".js\" /* Js */: return \".js\" /* jsModifier */;\n                    case \".json\" /* Json */: return \".json\" /* jsonModifier */;\n                    case \".jsx\" /* Jsx */: return \".jsx\" /* jsxModifier */;\n                    case \".ts\" /* Ts */: return \".ts\" /* tsModifier */;\n                    case \".tsx\" /* Tsx */: return \".tsx\" /* tsxModifier */;\n                    case \".tsbuildinfo\" /* TsBuildInfo */: return ts.Debug.fail(\"Extension \" + \".tsbuildinfo\" /* TsBuildInfo */ + \" is unsupported.\");\n                    case undefined: return \"\" /* none */;\n                    default:\n                        return ts.Debug.assertNever(extension);\n                }\n            }\n            var StringLiteralCompletionKind;\n            (function (StringLiteralCompletionKind) {\n                StringLiteralCompletionKind[StringLiteralCompletionKind[\"Paths\"] = 0] = \"Paths\";\n                StringLiteralCompletionKind[StringLiteralCompletionKind[\"Properties\"] = 1] = \"Properties\";\n                StringLiteralCompletionKind[StringLiteralCompletionKind[\"Types\"] = 2] = \"Types\";\n            })(StringLiteralCompletionKind || (StringLiteralCompletionKind = {}));\n            function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) {\n                var parent = walkUpParentheses(node.parent);\n                switch (parent.kind) {\n                    case 191 /* LiteralType */: {\n                        var grandParent = walkUpParentheses(parent.parent);\n                        switch (grandParent.kind) {\n                            case 173 /* TypeReference */: {\n                                var typeReference_1 = grandParent;\n                                var typeArgument = ts.findAncestor(parent, function (n) { return n.parent === typeReference_1; });\n                                if (typeArgument) {\n                                    return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false };\n                                }\n                                return undefined;\n                            }\n                            case 189 /* IndexedAccessType */:\n                                // Get all apparent property names\n                                // i.e. interface Foo {\n                                //          foo: string;\n                                //          bar: string;\n                                //      }\n                                //      let x: Foo[\"/*completion position*/\"]\n                                var _a = grandParent, indexType = _a.indexType, objectType = _a.objectType;\n                                if (!ts.rangeContainsPosition(indexType, position)) {\n                                    return undefined;\n                                }\n                                return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType));\n                            case 195 /* ImportType */:\n                                return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) };\n                            case 182 /* UnionType */: {\n                                if (!ts.isTypeReferenceNode(grandParent.parent)) {\n                                    return undefined;\n                                }\n                                var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(grandParent, parent);\n                                var types = getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(grandParent)).filter(function (t) { return !ts.contains(alreadyUsedTypes_1, t.value); });\n                                return { kind: 2 /* Types */, types: types, isNewIdentifier: false };\n                            }\n                            default:\n                                return undefined;\n                        }\n                    }\n                    case 288 /* PropertyAssignment */:\n                        if (ts.isObjectLiteralExpression(parent.parent) && parent.name === node) {\n                            // Get quoted name of properties of the object literal expression\n                            // i.e. interface ConfigFiles {\n                            //          'jspm:dev': string\n                            //      }\n                            //      let files: ConfigFiles = {\n                            //          '/*completion position*/'\n                            //      }\n                            //\n                            //      function foo(c: ConfigFiles) {}\n                            //      foo({\n                            //          '/*completion position*/'\n                            //      });\n                            return stringLiteralCompletionsForObjectLiteral(typeChecker, parent.parent);\n                        }\n                        return fromContextualType();\n                    case 202 /* ElementAccessExpression */: {\n                        var _b = parent, expression = _b.expression, argumentExpression = _b.argumentExpression;\n                        if (node === ts.skipParentheses(argumentExpression)) {\n                            // Get all names of properties on the expression\n                            // i.e. interface A {\n                            //      'prop1': string\n                            // }\n                            // let a: A;\n                            // a['/*completion position*/']\n                            return stringLiteralCompletionsFromProperties(typeChecker.getTypeAtLocation(expression));\n                        }\n                        return undefined;\n                    }\n                    case 203 /* CallExpression */:\n                    case 204 /* NewExpression */:\n                        if (!ts.isRequireCall(parent, /*checkArgumentIsStringLiteralLike*/ false) && !ts.isImportCall(parent)) {\n                            var argumentInfo = ts.SignatureHelp.getArgumentInfoForCompletions(node, position, sourceFile);\n                            // Get string literal completions from specialized signatures of the target\n                            // i.e. declare function f(a: 'A');\n                            // f(\"/*completion position*/\")\n                            return argumentInfo ? getStringLiteralCompletionsFromSignature(argumentInfo, typeChecker) : fromContextualType();\n                        }\n                    // falls through (is `require(\"\")` or `import(\"\")`)\n                    case 261 /* ImportDeclaration */:\n                    case 267 /* ExportDeclaration */:\n                    case 272 /* ExternalModuleReference */:\n                        // Get all known external module names or complete a path to a module\n                        // i.e. import * as ns from \"/*completion position*/\";\n                        //      var y = import(\"/*completion position*/\");\n                        //      import x = require(\"/*completion position*/\");\n                        //      var y = require(\"/*completion position*/\");\n                        //      export * from \"/*completion position*/\";\n                        return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) };\n                    default:\n                        return fromContextualType();\n                }\n                function fromContextualType() {\n                    // Get completion for string literal from string literal type\n                    // i.e. var x: \"hi\" | \"hello\" = \"/*completion position*/\"\n                    return { kind: 2 /* Types */, types: getStringLiteralTypes(ts.getContextualTypeFromParent(node, typeChecker)), isNewIdentifier: false };\n                }\n            }\n            function walkUpParentheses(node) {\n                switch (node.kind) {\n                    case 186 /* ParenthesizedType */:\n                        return ts.walkUpParenthesizedTypes(node);\n                    case 207 /* ParenthesizedExpression */:\n                        return ts.walkUpParenthesizedExpressions(node);\n                    default:\n                        return node;\n                }\n            }\n            function getAlreadyUsedTypesInStringLiteralUnion(union, current) {\n                return ts.mapDefined(union.types, function (type) {\n                    return type !== current && ts.isLiteralTypeNode(type) && ts.isStringLiteral(type.literal) ? type.literal.text : undefined;\n                });\n            }\n            function getStringLiteralCompletionsFromSignature(argumentInfo, checker) {\n                var isNewIdentifier = false;\n                var uniques = new ts.Map();\n                var candidates = [];\n                checker.getResolvedSignature(argumentInfo.invocation, candidates, argumentInfo.argumentCount);\n                var types = ts.flatMap(candidates, function (candidate) {\n                    if (!ts.signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)\n                        return;\n                    var type = checker.getParameterType(candidate, argumentInfo.argumentIndex);\n                    isNewIdentifier = isNewIdentifier || !!(type.flags & 4 /* String */);\n                    return getStringLiteralTypes(type, uniques);\n                });\n                return { kind: 2 /* Types */, types: types, isNewIdentifier: isNewIdentifier };\n            }\n            function stringLiteralCompletionsFromProperties(type) {\n                return type && {\n                    kind: 1 /* Properties */,\n                    symbols: ts.filter(type.getApparentProperties(), function (prop) { return !(prop.valueDeclaration && ts.isPrivateIdentifierPropertyDeclaration(prop.valueDeclaration)); }),\n                    hasIndexSignature: ts.hasIndexSignature(type)\n                };\n            }\n            function stringLiteralCompletionsForObjectLiteral(checker, objectLiteralExpression) {\n                var contextualType = checker.getContextualType(objectLiteralExpression);\n                if (!contextualType)\n                    return undefined;\n                var completionsType = checker.getContextualType(objectLiteralExpression, 4 /* Completions */);\n                var symbols = Completions.getPropertiesForObjectExpression(contextualType, completionsType, objectLiteralExpression, checker);\n                return {\n                    kind: 1 /* Properties */,\n                    symbols: symbols,\n                    hasIndexSignature: ts.hasIndexSignature(contextualType)\n                };\n            }\n            function getStringLiteralTypes(type, uniques) {\n                if (uniques === void 0) { uniques = new ts.Map(); }\n                if (!type)\n                    return ts.emptyArray;\n                type = ts.skipConstraint(type);\n                return type.isUnion() ? ts.flatMap(type.types, function (t) { return getStringLiteralTypes(t, uniques); }) :\n                    type.isStringLiteral() && !(type.flags & 1024 /* EnumLiteral */) && ts.addToSeen(uniques, type.value) ? [type] : ts.emptyArray;\n            }\n            function nameAndKind(name, kind, extension) {\n                return { name: name, kind: kind, extension: extension };\n            }\n            function directoryResult(name) {\n                return nameAndKind(name, \"directory\" /* directory */, /*extension*/ undefined);\n            }\n            function addReplacementSpans(text, textStart, names) {\n                var span = getDirectoryFragmentTextSpan(text, textStart);\n                var wholeSpan = text.length === 0 ? undefined : ts.createTextSpan(textStart, text.length);\n                return names.map(function (_a) {\n                    var name = _a.name, kind = _a.kind, extension = _a.extension;\n                    return Math.max(name.indexOf(ts.directorySeparator), name.indexOf(ts.altDirectorySeparator)) !== -1 ? { name: name, kind: kind, extension: extension, span: wholeSpan } : { name: name, kind: kind, extension: extension, span: span };\n                });\n            }\n            function getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) {\n                return addReplacementSpans(node.text, node.getStart(sourceFile) + 1, getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, compilerOptions, host, typeChecker));\n            }\n            function getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, compilerOptions, host, typeChecker) {\n                var literalValue = ts.normalizeSlashes(node.text);\n                var scriptPath = sourceFile.path;\n                var scriptDirectory = ts.getDirectoryPath(scriptPath);\n                return isPathRelativeToScript(literalValue) || !compilerOptions.baseUrl && (ts.isRootedDiskPath(literalValue) || ts.isUrl(literalValue))\n                    ? getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, compilerOptions, host, scriptPath)\n                    : getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, compilerOptions, host, typeChecker);\n            }\n            function getExtensionOptions(compilerOptions, includeExtensions) {\n                if (includeExtensions === void 0) { includeExtensions = false; }\n                return { extensions: getSupportedExtensionsForModuleResolution(compilerOptions), includeExtensions: includeExtensions };\n            }\n            function getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, compilerOptions, host, scriptPath) {\n                var extensionOptions = getExtensionOptions(compilerOptions);\n                if (compilerOptions.rootDirs) {\n                    return getCompletionEntriesForDirectoryFragmentWithRootDirs(compilerOptions.rootDirs, literalValue, scriptDirectory, extensionOptions, compilerOptions, host, scriptPath);\n                }\n                else {\n                    return getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, extensionOptions, host, scriptPath);\n                }\n            }\n            function getSupportedExtensionsForModuleResolution(compilerOptions) {\n                var extensions = ts.getSupportedExtensions(compilerOptions);\n                return compilerOptions.resolveJsonModule && ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs ?\n                    extensions.concat(\".json\" /* Json */) :\n                    extensions;\n            }\n            /**\n             * Takes a script path and returns paths for all potential folders that could be merged with its\n             * containing folder via the \"rootDirs\" compiler option\n             */\n            function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase) {\n                // Make all paths absolute/normalized if they are not already\n                rootDirs = rootDirs.map(function (rootDirectory) { return ts.normalizePath(ts.isRootedDiskPath(rootDirectory) ? rootDirectory : ts.combinePaths(basePath, rootDirectory)); });\n                // Determine the path to the directory containing the script relative to the root directory it is contained within\n                var relativeDirectory = ts.firstDefined(rootDirs, function (rootDirectory) {\n                    return ts.containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : undefined;\n                }); // TODO: GH#18217\n                // Now find a path for each potential directory that is to be merged with the one containing the script\n                return ts.deduplicate(__spreadArray(__spreadArray([], rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); })), [scriptDirectory]), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive);\n            }\n            function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptDirectory, extensionOptions, compilerOptions, host, exclude) {\n                var basePath = compilerOptions.project || host.getCurrentDirectory();\n                var ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames());\n                var baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase);\n                return ts.flatMap(baseDirectories, function (baseDirectory) { return getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensionOptions, host, exclude); });\n            }\n            /**\n             * Given a path ending at a directory, gets the completions for the path, and filters for those entries containing the basename.\n             */\n            function getCompletionEntriesForDirectoryFragment(fragment, scriptPath, _a, host, exclude, result) {\n                var extensions = _a.extensions, includeExtensions = _a.includeExtensions;\n                if (result === void 0) { result = []; }\n                if (fragment === undefined) {\n                    fragment = \"\";\n                }\n                fragment = ts.normalizeSlashes(fragment);\n                /**\n                 * Remove the basename from the path. Note that we don't use the basename to filter completions;\n                 * the client is responsible for refining completions.\n                 */\n                if (!ts.hasTrailingDirectorySeparator(fragment)) {\n                    fragment = ts.getDirectoryPath(fragment);\n                }\n                if (fragment === \"\") {\n                    fragment = \".\" + ts.directorySeparator;\n                }\n                fragment = ts.ensureTrailingDirectorySeparator(fragment);\n                // const absolutePath = normalizeAndPreserveTrailingSlash(isRootedDiskPath(fragment) ? fragment : combinePaths(scriptPath, fragment)); // TODO(rbuckton): should use resolvePaths\n                var absolutePath = ts.resolvePath(scriptPath, fragment);\n                var baseDirectory = ts.hasTrailingDirectorySeparator(absolutePath) ? absolutePath : ts.getDirectoryPath(absolutePath);\n                var ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames());\n                if (!ts.tryDirectoryExists(host, baseDirectory))\n                    return result;\n                // Enumerate the available files if possible\n                var files = ts.tryReadDirectory(host, baseDirectory, extensions, /*exclude*/ undefined, /*include*/ [\"./*\"]);\n                if (files) {\n                    /**\n                     * Multiple file entries might map to the same truncated name once we remove extensions\n                     * (happens iff includeExtensions === false)so we use a set-like data structure. Eg:\n                     *\n                     * both foo.ts and foo.tsx become foo\n                     */\n                    var foundFiles = new ts.Map(); // maps file to its extension\n                    for (var _i = 0, files_1 = files; _i < files_1.length; _i++) {\n                        var filePath = files_1[_i];\n                        filePath = ts.normalizePath(filePath);\n                        if (exclude && ts.comparePaths(filePath, exclude, scriptPath, ignoreCase) === 0 /* EqualTo */) {\n                            continue;\n                        }\n                        var foundFileName = includeExtensions || ts.fileExtensionIs(filePath, \".json\" /* Json */) ? ts.getBaseFileName(filePath) : ts.removeFileExtension(ts.getBaseFileName(filePath));\n                        foundFiles.set(foundFileName, ts.tryGetExtensionFromPath(filePath));\n                    }\n                    foundFiles.forEach(function (ext, foundFile) {\n                        result.push(nameAndKind(foundFile, \"script\" /* scriptElement */, ext));\n                    });\n                }\n                // If possible, get folder completion as well\n                var directories = ts.tryGetDirectories(host, baseDirectory);\n                if (directories) {\n                    for (var _b = 0, directories_1 = directories; _b < directories_1.length; _b++) {\n                        var directory = directories_1[_b];\n                        var directoryName = ts.getBaseFileName(ts.normalizePath(directory));\n                        if (directoryName !== \"@types\") {\n                            result.push(directoryResult(directoryName));\n                        }\n                    }\n                }\n                // check for a version redirect\n                var packageJsonPath = ts.findPackageJson(baseDirectory, host);\n                if (packageJsonPath) {\n                    var packageJson = ts.readJson(packageJsonPath, host);\n                    var typesVersions = packageJson.typesVersions;\n                    if (typeof typesVersions === \"object\") {\n                        var versionResult = ts.getPackageJsonTypesVersionsPaths(typesVersions);\n                        var versionPaths = versionResult && versionResult.paths;\n                        var rest = absolutePath.slice(ts.ensureTrailingDirectorySeparator(baseDirectory).length);\n                        if (versionPaths) {\n                            addCompletionEntriesFromPaths(result, rest, baseDirectory, extensions, versionPaths, host);\n                        }\n                    }\n                }\n                return result;\n            }\n            function addCompletionEntriesFromPaths(result, fragment, baseDirectory, fileExtensions, paths, host) {\n                for (var path in paths) {\n                    if (!ts.hasProperty(paths, path))\n                        continue;\n                    var patterns = paths[path];\n                    if (patterns) {\n                        var _loop_1 = function (name, kind, extension) {\n                            // Path mappings may provide a duplicate way to get to something we've already added, so don't add again.\n                            if (!result.some(function (entry) { return entry.name === name; })) {\n                                result.push(nameAndKind(name, kind, extension));\n                            }\n                        };\n                        for (var _i = 0, _a = getCompletionsForPathMapping(path, patterns, fragment, baseDirectory, fileExtensions, host); _i < _a.length; _i++) {\n                            var _b = _a[_i], name = _b.name, kind = _b.kind, extension = _b.extension;\n                            _loop_1(name, kind, extension);\n                        }\n                    }\n                }\n            }\n            /**\n             * Check all of the declared modules and those in node modules. Possible sources of modules:\n             *      Modules that are found by the type checker\n             *      Modules found relative to \"baseUrl\" compliler options (including patterns from \"paths\" compiler option)\n             *      Modules from node_modules (i.e. those listed in package.json)\n             *          This includes all files that are found in node_modules/moduleName/ with acceptable file extensions\n             */\n            function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, compilerOptions, host, typeChecker) {\n                var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths;\n                var result = [];\n                var extensionOptions = getExtensionOptions(compilerOptions);\n                if (baseUrl) {\n                    var projectDir = compilerOptions.project || host.getCurrentDirectory();\n                    var absolute = ts.normalizePath(ts.combinePaths(projectDir, baseUrl));\n                    getCompletionEntriesForDirectoryFragment(fragment, absolute, extensionOptions, host, /*exclude*/ undefined, result);\n                    if (paths) {\n                        addCompletionEntriesFromPaths(result, fragment, absolute, extensionOptions.extensions, paths, host);\n                    }\n                }\n                var fragmentDirectory = getFragmentDirectory(fragment);\n                for (var _i = 0, _a = getAmbientModuleCompletions(fragment, fragmentDirectory, typeChecker); _i < _a.length; _i++) {\n                    var ambientName = _a[_i];\n                    result.push(nameAndKind(ambientName, \"external module name\" /* externalModuleName */, /*extension*/ undefined));\n                }\n                getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, fragmentDirectory, extensionOptions, result);\n                if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs) {\n                    // If looking for a global package name, don't just include everything in `node_modules` because that includes dependencies' own dependencies.\n                    // (But do if we didn't find anything, e.g. 'package.json' missing.)\n                    var foundGlobal = false;\n                    if (fragmentDirectory === undefined) {\n                        var _loop_2 = function (moduleName) {\n                            if (!result.some(function (entry) { return entry.name === moduleName; })) {\n                                foundGlobal = true;\n                                result.push(nameAndKind(moduleName, \"external module name\" /* externalModuleName */, /*extension*/ undefined));\n                            }\n                        };\n                        for (var _b = 0, _c = enumerateNodeModulesVisibleToScript(host, scriptPath); _b < _c.length; _b++) {\n                            var moduleName = _c[_b];\n                            _loop_2(moduleName);\n                        }\n                    }\n                    if (!foundGlobal) {\n                        ts.forEachAncestorDirectory(scriptPath, function (ancestor) {\n                            var nodeModules = ts.combinePaths(ancestor, \"node_modules\");\n                            if (ts.tryDirectoryExists(host, nodeModules)) {\n                                getCompletionEntriesForDirectoryFragment(fragment, nodeModules, extensionOptions, host, /*exclude*/ undefined, result);\n                            }\n                        });\n                    }\n                }\n                return result;\n            }\n            function getFragmentDirectory(fragment) {\n                return containsSlash(fragment) ? ts.hasTrailingDirectorySeparator(fragment) ? fragment : ts.getDirectoryPath(fragment) : undefined;\n            }\n            function getCompletionsForPathMapping(path, patterns, fragment, baseUrl, fileExtensions, host) {\n                if (!ts.endsWith(path, \"*\")) {\n                    // For a path mapping \"foo\": [\"/x/y/z.ts\"], add \"foo\" itself as a completion.\n                    return !ts.stringContains(path, \"*\") ? justPathMappingName(path) : ts.emptyArray;\n                }\n                var pathPrefix = path.slice(0, path.length - 1);\n                var remainingFragment = ts.tryRemovePrefix(fragment, pathPrefix);\n                return remainingFragment === undefined ? justPathMappingName(pathPrefix) : ts.flatMap(patterns, function (pattern) {\n                    return getModulesForPathsPattern(remainingFragment, baseUrl, pattern, fileExtensions, host);\n                });\n                function justPathMappingName(name) {\n                    return ts.startsWith(name, fragment) ? [directoryResult(name)] : ts.emptyArray;\n                }\n            }\n            function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host) {\n                if (!host.readDirectory) {\n                    return undefined;\n                }\n                var parsed = ts.hasZeroOrOneAsteriskCharacter(pattern) ? ts.tryParsePattern(pattern) : undefined;\n                if (!parsed) {\n                    return undefined;\n                }\n                // The prefix has two effective parts: the directory path and the base component after the filepath that is not a\n                // full directory component. For example: directory/path/of/prefix/base*\n                var normalizedPrefix = ts.resolvePath(parsed.prefix);\n                var normalizedPrefixDirectory = ts.hasTrailingDirectorySeparator(parsed.prefix) ? normalizedPrefix : ts.getDirectoryPath(normalizedPrefix);\n                var normalizedPrefixBase = ts.hasTrailingDirectorySeparator(parsed.prefix) ? \"\" : ts.getBaseFileName(normalizedPrefix);\n                var fragmentHasPath = containsSlash(fragment);\n                var fragmentDirectory = fragmentHasPath ? ts.hasTrailingDirectorySeparator(fragment) ? fragment : ts.getDirectoryPath(fragment) : undefined;\n                // Try and expand the prefix to include any path from the fragment so that we can limit the readDirectory call\n                var expandedPrefixDirectory = fragmentHasPath ? ts.combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + fragmentDirectory) : normalizedPrefixDirectory;\n                var normalizedSuffix = ts.normalizePath(parsed.suffix);\n                // Need to normalize after combining: If we combinePaths(\"a\", \"../b\"), we want \"b\" and not \"a/../b\".\n                var baseDirectory = ts.normalizePath(ts.combinePaths(baseUrl, expandedPrefixDirectory));\n                var completePrefix = fragmentHasPath ? baseDirectory : ts.ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase;\n                // If we have a suffix, then we need to read the directory all the way down. We could create a glob\n                // that encodes the suffix, but we would have to escape the character \"?\" which readDirectory\n                // doesn't support. For now, this is safer but slower\n                var includeGlob = normalizedSuffix ? \"**/*\" : \"./*\";\n                var matches = ts.mapDefined(ts.tryReadDirectory(host, baseDirectory, fileExtensions, /*exclude*/ undefined, [includeGlob]), function (match) {\n                    var extension = ts.tryGetExtensionFromPath(match);\n                    var name = trimPrefixAndSuffix(match);\n                    return name === undefined ? undefined : nameAndKind(ts.removeFileExtension(name), \"script\" /* scriptElement */, extension);\n                });\n                var directories = ts.mapDefined(ts.tryGetDirectories(host, baseDirectory).map(function (d) { return ts.combinePaths(baseDirectory, d); }), function (dir) {\n                    var name = trimPrefixAndSuffix(dir);\n                    return name === undefined ? undefined : directoryResult(name);\n                });\n                return __spreadArray(__spreadArray([], matches), directories);\n                function trimPrefixAndSuffix(path) {\n                    var inner = withoutStartAndEnd(ts.normalizePath(path), completePrefix, normalizedSuffix);\n                    return inner === undefined ? undefined : removeLeadingDirectorySeparator(inner);\n                }\n            }\n            function withoutStartAndEnd(s, start, end) {\n                return ts.startsWith(s, start) && ts.endsWith(s, end) ? s.slice(start.length, s.length - end.length) : undefined;\n            }\n            function removeLeadingDirectorySeparator(path) {\n                return path[0] === ts.directorySeparator ? path.slice(1) : path;\n            }\n            function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) {\n                // Get modules that the type checker picked up\n                var ambientModules = checker.getAmbientModules().map(function (sym) { return ts.stripQuotes(sym.name); });\n                var nonRelativeModuleNames = ambientModules.filter(function (moduleName) { return ts.startsWith(moduleName, fragment); });\n                // Nested modules of the form \"module-name/sub\" need to be adjusted to only return the string\n                // after the last '/' that appears in the fragment because that's where the replacement span\n                // starts\n                if (fragmentDirectory !== undefined) {\n                    var moduleNameWithSeparator_1 = ts.ensureTrailingDirectorySeparator(fragmentDirectory);\n                    return nonRelativeModuleNames.map(function (nonRelativeModuleName) { return ts.removePrefix(nonRelativeModuleName, moduleNameWithSeparator_1); });\n                }\n                return nonRelativeModuleNames;\n            }\n            function getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host) {\n                var token = ts.getTokenAtPosition(sourceFile, position);\n                var commentRanges = ts.getLeadingCommentRanges(sourceFile.text, token.pos);\n                var range = commentRanges && ts.find(commentRanges, function (commentRange) { return position >= commentRange.pos && position <= commentRange.end; });\n                if (!range) {\n                    return undefined;\n                }\n                var text = sourceFile.text.slice(range.pos, position);\n                var match = tripleSlashDirectiveFragmentRegex.exec(text);\n                if (!match) {\n                    return undefined;\n                }\n                var prefix = match[1], kind = match[2], toComplete = match[3];\n                var scriptPath = ts.getDirectoryPath(sourceFile.path);\n                var names = kind === \"path\" ? getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, getExtensionOptions(compilerOptions, /*includeExtensions*/ true), host, sourceFile.path)\n                    : kind === \"types\" ? getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, getFragmentDirectory(toComplete), getExtensionOptions(compilerOptions))\n                        : ts.Debug.fail();\n                return addReplacementSpans(toComplete, range.pos + prefix.length, names);\n            }\n            function getCompletionEntriesFromTypings(host, options, scriptPath, fragmentDirectory, extensionOptions, result) {\n                if (result === void 0) { result = []; }\n                // Check for typings specified in compiler options\n                var seen = new ts.Map();\n                var typeRoots = ts.tryAndIgnoreErrors(function () { return ts.getEffectiveTypeRoots(options, host); }) || ts.emptyArray;\n                for (var _i = 0, typeRoots_1 = typeRoots; _i < typeRoots_1.length; _i++) {\n                    var root = typeRoots_1[_i];\n                    getCompletionEntriesFromDirectories(root);\n                }\n                // Also get all @types typings installed in visible node_modules directories\n                for (var _a = 0, _b = ts.findPackageJsons(scriptPath, host); _a < _b.length; _a++) {\n                    var packageJson = _b[_a];\n                    var typesDir = ts.combinePaths(ts.getDirectoryPath(packageJson), \"node_modules/@types\");\n                    getCompletionEntriesFromDirectories(typesDir);\n                }\n                return result;\n                function getCompletionEntriesFromDirectories(directory) {\n                    if (!ts.tryDirectoryExists(host, directory))\n                        return;\n                    for (var _i = 0, _a = ts.tryGetDirectories(host, directory); _i < _a.length; _i++) {\n                        var typeDirectoryName = _a[_i];\n                        var packageName = ts.unmangleScopedPackageName(typeDirectoryName);\n                        if (options.types && !ts.contains(options.types, packageName))\n                            continue;\n                        if (fragmentDirectory === undefined) {\n                            if (!seen.has(packageName)) {\n                                result.push(nameAndKind(packageName, \"external module name\" /* externalModuleName */, /*extension*/ undefined));\n                                seen.set(packageName, true);\n                            }\n                        }\n                        else {\n                            var baseDirectory = ts.combinePaths(directory, typeDirectoryName);\n                            var remainingFragment = ts.tryRemoveDirectoryPrefix(fragmentDirectory, packageName, ts.hostGetCanonicalFileName(host));\n                            if (remainingFragment !== undefined) {\n                                getCompletionEntriesForDirectoryFragment(remainingFragment, baseDirectory, extensionOptions, host, /*exclude*/ undefined, result);\n                            }\n                        }\n                    }\n                }\n            }\n            function enumerateNodeModulesVisibleToScript(host, scriptPath) {\n                if (!host.readFile || !host.fileExists)\n                    return ts.emptyArray;\n                var result = [];\n                for (var _i = 0, _a = ts.findPackageJsons(scriptPath, host); _i < _a.length; _i++) {\n                    var packageJson = _a[_i];\n                    var contents = ts.readJson(packageJson, host); // Cast to assert that readFile is defined\n                    // Provide completions for all non @types dependencies\n                    for (var _b = 0, nodeModulesDependencyKeys_1 = nodeModulesDependencyKeys; _b < nodeModulesDependencyKeys_1.length; _b++) {\n                        var key = nodeModulesDependencyKeys_1[_b];\n                        var dependencies = contents[key];\n                        if (!dependencies)\n                            continue;\n                        for (var dep in dependencies) {\n                            if (dependencies.hasOwnProperty(dep) && !ts.startsWith(dep, \"@types/\")) {\n                                result.push(dep);\n                            }\n                        }\n                    }\n                }\n                return result;\n            }\n            // Replace everything after the last directory separator that appears\n            function getDirectoryFragmentTextSpan(text, textStart) {\n                var index = Math.max(text.lastIndexOf(ts.directorySeparator), text.lastIndexOf(ts.altDirectorySeparator));\n                var offset = index !== -1 ? index + 1 : 0;\n                // If the range is an identifier, span is unnecessary.\n                var length = text.length - offset;\n                return length === 0 || ts.isIdentifierText(text.substr(offset, length), 99 /* ESNext */) ? undefined : ts.createTextSpan(textStart + offset, length);\n            }\n            // Returns true if the path is explicitly relative to the script (i.e. relative to . or ..)\n            function isPathRelativeToScript(path) {\n                if (path && path.length >= 2 && path.charCodeAt(0) === 46 /* dot */) {\n                    var slashIndex = path.length >= 3 && path.charCodeAt(1) === 46 /* dot */ ? 2 : 1;\n                    var slashCharCode = path.charCodeAt(slashIndex);\n                    return slashCharCode === 47 /* slash */ || slashCharCode === 92 /* backslash */;\n                }\n                return false;\n            }\n            /**\n             * Matches a triple slash reference directive with an incomplete string literal for its path. Used\n             * to determine if the caret is currently within the string literal and capture the literal fragment\n             * for completions.\n             * For example, this matches\n             *\n             * /// <reference path=\"fragment\n             *\n             * but not\n             *\n             * /// <reference path=\"fragment\"\n             */\n            var tripleSlashDirectiveFragmentRegex = /^(\\/\\/\\/\\s*<reference\\s+(path|types)\\s*=\\s*(?:'|\"))([^\\3\"]*)$/;\n            var nodeModulesDependencyKeys = [\"dependencies\", \"devDependencies\", \"peerDependencies\", \"optionalDependencies\"];\n            function containsSlash(fragment) {\n                return ts.stringContains(fragment, ts.directorySeparator);\n            }\n        })(StringCompletions = Completions.StringCompletions || (Completions.StringCompletions = {}));\n    })(Completions = ts.Completions || (ts.Completions = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var Completions;\n    (function (Completions) {\n        var SortText;\n        (function (SortText) {\n            SortText[\"LocalDeclarationPriority\"] = \"0\";\n            SortText[\"LocationPriority\"] = \"1\";\n            SortText[\"OptionalMember\"] = \"2\";\n            SortText[\"MemberDeclaredBySpreadAssignment\"] = \"3\";\n            SortText[\"SuggestedClassMembers\"] = \"4\";\n            SortText[\"GlobalsOrKeywords\"] = \"5\";\n            SortText[\"AutoImportSuggestions\"] = \"6\";\n            SortText[\"JavascriptIdentifiers\"] = \"7\";\n        })(SortText = Completions.SortText || (Completions.SortText = {}));\n        /**\n         * Special values for `CompletionInfo['source']` used to disambiguate\n         * completion items with the same `name`. (Each completion item must\n         * have a unique name/source combination, because those two fields\n         * comprise `CompletionEntryIdentifier` in `getCompletionEntryDetails`.\n         *\n         * When the completion item is an auto-import suggestion, the source\n         * is the module specifier of the suggestion. To avoid collisions,\n         * the values here should not be a module specifier we would ever\n         * generate for an auto-import.\n         */\n        var CompletionSource;\n        (function (CompletionSource) {\n            /** Completions that require `this.` insertion text */\n            CompletionSource[\"ThisProperty\"] = \"ThisProperty/\";\n        })(CompletionSource = Completions.CompletionSource || (Completions.CompletionSource = {}));\n        var SymbolOriginInfoKind;\n        (function (SymbolOriginInfoKind) {\n            SymbolOriginInfoKind[SymbolOriginInfoKind[\"ThisType\"] = 1] = \"ThisType\";\n            SymbolOriginInfoKind[SymbolOriginInfoKind[\"SymbolMember\"] = 2] = \"SymbolMember\";\n            SymbolOriginInfoKind[SymbolOriginInfoKind[\"Export\"] = 4] = \"Export\";\n            SymbolOriginInfoKind[SymbolOriginInfoKind[\"Promise\"] = 8] = \"Promise\";\n            SymbolOriginInfoKind[SymbolOriginInfoKind[\"Nullable\"] = 16] = \"Nullable\";\n            SymbolOriginInfoKind[SymbolOriginInfoKind[\"SymbolMemberNoExport\"] = 2] = \"SymbolMemberNoExport\";\n            SymbolOriginInfoKind[SymbolOriginInfoKind[\"SymbolMemberExport\"] = 6] = \"SymbolMemberExport\";\n        })(SymbolOriginInfoKind || (SymbolOriginInfoKind = {}));\n        function originIsThisType(origin) {\n            return !!(origin.kind & 1 /* ThisType */);\n        }\n        function originIsSymbolMember(origin) {\n            return !!(origin.kind & 2 /* SymbolMember */);\n        }\n        function originIsExport(origin) {\n            return !!(origin && origin.kind & 4 /* Export */);\n        }\n        function originIsPackageJsonImport(origin) {\n            return originIsExport(origin) && !!origin.isFromPackageJson;\n        }\n        function originIsPromise(origin) {\n            return !!(origin.kind & 8 /* Promise */);\n        }\n        function originIsNullableMember(origin) {\n            return !!(origin.kind & 16 /* Nullable */);\n        }\n        var KeywordCompletionFilters;\n        (function (KeywordCompletionFilters) {\n            KeywordCompletionFilters[KeywordCompletionFilters[\"None\"] = 0] = \"None\";\n            KeywordCompletionFilters[KeywordCompletionFilters[\"All\"] = 1] = \"All\";\n            KeywordCompletionFilters[KeywordCompletionFilters[\"ClassElementKeywords\"] = 2] = \"ClassElementKeywords\";\n            KeywordCompletionFilters[KeywordCompletionFilters[\"InterfaceElementKeywords\"] = 3] = \"InterfaceElementKeywords\";\n            KeywordCompletionFilters[KeywordCompletionFilters[\"ConstructorParameterKeywords\"] = 4] = \"ConstructorParameterKeywords\";\n            KeywordCompletionFilters[KeywordCompletionFilters[\"FunctionLikeBodyKeywords\"] = 5] = \"FunctionLikeBodyKeywords\";\n            KeywordCompletionFilters[KeywordCompletionFilters[\"TypeAssertionKeywords\"] = 6] = \"TypeAssertionKeywords\";\n            KeywordCompletionFilters[KeywordCompletionFilters[\"TypeKeywords\"] = 7] = \"TypeKeywords\";\n            KeywordCompletionFilters[KeywordCompletionFilters[\"Last\"] = 7] = \"Last\";\n        })(KeywordCompletionFilters || (KeywordCompletionFilters = {}));\n        var GlobalsSearch;\n        (function (GlobalsSearch) {\n            GlobalsSearch[GlobalsSearch[\"Continue\"] = 0] = \"Continue\";\n            GlobalsSearch[GlobalsSearch[\"Success\"] = 1] = \"Success\";\n            GlobalsSearch[GlobalsSearch[\"Fail\"] = 2] = \"Fail\";\n        })(GlobalsSearch || (GlobalsSearch = {}));\n        function createImportSuggestionsForFileCache() {\n            var cache;\n            var projectVersion;\n            var fileName;\n            return {\n                isEmpty: function () {\n                    return !cache;\n                },\n                clear: function () {\n                    cache = undefined;\n                    fileName = undefined;\n                    projectVersion = undefined;\n                },\n                set: function (file, suggestions, version) {\n                    cache = suggestions;\n                    fileName = file;\n                    if (version) {\n                        projectVersion = version;\n                    }\n                },\n                get: function (file, checker, version) {\n                    if (file !== fileName) {\n                        return undefined;\n                    }\n                    if (version) {\n                        return projectVersion === version ? cache : undefined;\n                    }\n                    ts.forEach(cache, function (suggestion) {\n                        var _a, _b, _c;\n                        // If the symbol/moduleSymbol was a merged symbol, it will have a new identity\n                        // in the checker, even though the symbols to merge are the same (guaranteed by\n                        // cache invalidation in synchronizeHostData).\n                        if ((_a = suggestion.symbol.declarations) === null || _a === void 0 ? void 0 : _a.length) {\n                            suggestion.symbol = checker.getMergedSymbol(suggestion.origin.isDefaultExport\n                                ? (_b = suggestion.symbol.declarations[0].localSymbol) !== null && _b !== void 0 ? _b : suggestion.symbol.declarations[0].symbol\n                                : suggestion.symbol.declarations[0].symbol);\n                        }\n                        if ((_c = suggestion.origin.moduleSymbol.declarations) === null || _c === void 0 ? void 0 : _c.length) {\n                            suggestion.origin.moduleSymbol = checker.getMergedSymbol(suggestion.origin.moduleSymbol.declarations[0].symbol);\n                        }\n                    });\n                    return cache;\n                },\n            };\n        }\n        Completions.createImportSuggestionsForFileCache = createImportSuggestionsForFileCache;\n        function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter) {\n            var typeChecker = program.getTypeChecker();\n            var compilerOptions = program.getCompilerOptions();\n            var contextToken = ts.findPrecedingToken(position, sourceFile);\n            if (triggerCharacter && !ts.isInString(sourceFile, position, contextToken) && !isValidTrigger(sourceFile, triggerCharacter, contextToken, position)) {\n                return undefined;\n            }\n            var stringCompletions = Completions.StringCompletions.getStringLiteralCompletions(sourceFile, position, contextToken, typeChecker, compilerOptions, host, log, preferences);\n            if (stringCompletions) {\n                return stringCompletions;\n            }\n            if (contextToken && ts.isBreakOrContinueStatement(contextToken.parent)\n                && (contextToken.kind === 80 /* BreakKeyword */ || contextToken.kind === 85 /* ContinueKeyword */ || contextToken.kind === 78 /* Identifier */)) {\n                return getLabelCompletionAtPosition(contextToken.parent);\n            }\n            var completionData = getCompletionData(program, log, sourceFile, isUncheckedFile(sourceFile, compilerOptions), position, preferences, /*detailsEntryId*/ undefined, host);\n            if (!completionData) {\n                return undefined;\n            }\n            switch (completionData.kind) {\n                case 0 /* Data */:\n                    return completionInfoFromData(sourceFile, typeChecker, compilerOptions, log, completionData, preferences);\n                case 1 /* JsDocTagName */:\n                    // If the current position is a jsDoc tag name, only tag names should be provided for completion\n                    return jsdocCompletionInfo(ts.JsDoc.getJSDocTagNameCompletions());\n                case 2 /* JsDocTag */:\n                    // If the current position is a jsDoc tag, only tags should be provided for completion\n                    return jsdocCompletionInfo(ts.JsDoc.getJSDocTagCompletions());\n                case 3 /* JsDocParameterName */:\n                    return jsdocCompletionInfo(ts.JsDoc.getJSDocParameterNameCompletions(completionData.tag));\n                default:\n                    return ts.Debug.assertNever(completionData);\n            }\n        }\n        Completions.getCompletionsAtPosition = getCompletionsAtPosition;\n        function jsdocCompletionInfo(entries) {\n            return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries };\n        }\n        function getOptionalReplacementSpan(location) {\n            // StringLiteralLike locations are handled separately in stringCompletions.ts\n            return (location === null || location === void 0 ? void 0 : location.kind) === 78 /* Identifier */ ? ts.createTextSpanFromNode(location) : undefined;\n        }\n        function completionInfoFromData(sourceFile, typeChecker, compilerOptions, log, completionData, preferences) {\n            var symbols = completionData.symbols, completionKind = completionData.completionKind, isInSnippetScope = completionData.isInSnippetScope, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, propertyAccessToConvert = completionData.propertyAccessToConvert, keywordFilters = completionData.keywordFilters, literals = completionData.literals, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, recommendedCompletion = completionData.recommendedCompletion, isJsxInitializer = completionData.isJsxInitializer, insideJsDocTagTypeExpression = completionData.insideJsDocTagTypeExpression, symbolToSortTextMap = completionData.symbolToSortTextMap;\n            if (location && location.parent && ts.isJsxClosingElement(location.parent)) {\n                // In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag,\n                // instead of simply giving unknown value, the completion will return the tag-name of an associated opening-element.\n                // For example:\n                //     var x = <div> </ /*1*/\n                // The completion list at \"1\" will contain \"div>\" with type any\n                // And at `<div> </ /*1*/ >` (with a closing `>`), the completion list will contain \"div\".\n                var tagName = location.parent.parent.openingElement.tagName;\n                var hasClosingAngleBracket = !!ts.findChildOfKind(location.parent, 31 /* GreaterThanToken */, sourceFile);\n                var entry = {\n                    name: tagName.getFullText(sourceFile) + (hasClosingAngleBracket ? \"\" : \">\"),\n                    kind: \"class\" /* classElement */,\n                    kindModifiers: undefined,\n                    sortText: SortText.LocationPriority,\n                };\n                return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, optionalReplacementSpan: getOptionalReplacementSpan(location), entries: [entry] };\n            }\n            var entries = [];\n            if (isUncheckedFile(sourceFile, compilerOptions)) {\n                var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, \n                /* contextToken */ undefined, location, sourceFile, typeChecker, compilerOptions.target, log, completionKind, preferences, propertyAccessToConvert, completionData.isJsxIdentifierExpected, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap);\n                getJSCompletionEntries(sourceFile, location.pos, uniqueNames, compilerOptions.target, entries); // TODO: GH#18217\n            }\n            else {\n                if (!isNewIdentifierLocation && (!symbols || symbols.length === 0) && keywordFilters === 0 /* None */) {\n                    return undefined;\n                }\n                getCompletionEntriesFromSymbols(symbols, entries, \n                /* contextToken */ undefined, location, sourceFile, typeChecker, compilerOptions.target, log, completionKind, preferences, propertyAccessToConvert, completionData.isJsxIdentifierExpected, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap);\n            }\n            if (keywordFilters !== 0 /* None */) {\n                var entryNames = new ts.Set(entries.map(function (e) { return e.name; }));\n                for (var _i = 0, _a = getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && ts.isSourceFileJS(sourceFile)); _i < _a.length; _i++) {\n                    var keywordEntry = _a[_i];\n                    if (!entryNames.has(keywordEntry.name)) {\n                        entries.push(keywordEntry);\n                    }\n                }\n            }\n            for (var _b = 0, literals_1 = literals; _b < literals_1.length; _b++) {\n                var literal = literals_1[_b];\n                entries.push(createCompletionEntryForLiteral(sourceFile, preferences, literal));\n            }\n            return {\n                isGlobalCompletion: isInSnippetScope,\n                isMemberCompletion: isMemberCompletionKind(completionKind),\n                isNewIdentifierLocation: isNewIdentifierLocation,\n                optionalReplacementSpan: getOptionalReplacementSpan(location),\n                entries: entries\n            };\n        }\n        function isUncheckedFile(sourceFile, compilerOptions) {\n            return ts.isSourceFileJS(sourceFile) && !ts.isCheckJsEnabledForFile(sourceFile, compilerOptions);\n        }\n        function isMemberCompletionKind(kind) {\n            switch (kind) {\n                case 0 /* ObjectPropertyDeclaration */:\n                case 3 /* MemberLike */:\n                case 2 /* PropertyAccess */:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n        function getJSCompletionEntries(sourceFile, position, uniqueNames, target, entries) {\n            ts.getNameTable(sourceFile).forEach(function (pos, name) {\n                // Skip identifiers produced only from the current location\n                if (pos === position) {\n                    return;\n                }\n                var realName = ts.unescapeLeadingUnderscores(name);\n                if (!uniqueNames.has(realName) && ts.isIdentifierText(realName, target)) {\n                    uniqueNames.add(realName);\n                    entries.push({\n                        name: realName,\n                        kind: \"warning\" /* warning */,\n                        kindModifiers: \"\",\n                        sortText: SortText.JavascriptIdentifiers,\n                        isFromUncheckedFile: true\n                    });\n                }\n            });\n        }\n        function completionNameForLiteral(sourceFile, preferences, literal) {\n            return typeof literal === \"object\" ? ts.pseudoBigIntToString(literal) + \"n\" :\n                ts.isString(literal) ? ts.quote(sourceFile, preferences, literal) : JSON.stringify(literal);\n        }\n        function createCompletionEntryForLiteral(sourceFile, preferences, literal) {\n            return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: \"string\" /* string */, kindModifiers: \"\" /* none */, sortText: SortText.LocationPriority };\n        }\n        function createCompletionEntry(symbol, sortText, contextToken, location, sourceFile, typeChecker, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, preferences) {\n            var insertText;\n            var replacementSpan = ts.getReplacementSpanForContextToken(contextToken);\n            var insertQuestionDot = origin && originIsNullableMember(origin);\n            var useBraces = origin && originIsSymbolMember(origin) || needsConvertPropertyAccess;\n            if (origin && originIsThisType(origin)) {\n                insertText = needsConvertPropertyAccess\n                    ? \"this\" + (insertQuestionDot ? \"?.\" : \"\") + \"[\" + quotePropertyName(sourceFile, preferences, name) + \"]\"\n                    : \"this\" + (insertQuestionDot ? \"?.\" : \".\") + name;\n            }\n            // We should only have needsConvertPropertyAccess if there's a property access to convert. But see #21790.\n            // Somehow there was a global with a non-identifier name. Hopefully someone will complain about getting a \"foo bar\" global completion and provide a repro.\n            else if ((useBraces || insertQuestionDot) && propertyAccessToConvert) {\n                insertText = useBraces ? needsConvertPropertyAccess ? \"[\" + quotePropertyName(sourceFile, preferences, name) + \"]\" : \"[\" + name + \"]\" : name;\n                if (insertQuestionDot || propertyAccessToConvert.questionDotToken) {\n                    insertText = \"?.\" + insertText;\n                }\n                var dot = ts.findChildOfKind(propertyAccessToConvert, 24 /* DotToken */, sourceFile) ||\n                    ts.findChildOfKind(propertyAccessToConvert, 28 /* QuestionDotToken */, sourceFile);\n                if (!dot) {\n                    return undefined;\n                }\n                // If the text after the '.' starts with this name, write over it. Else, add new text.\n                var end = ts.startsWith(name, propertyAccessToConvert.name.text) ? propertyAccessToConvert.name.end : dot.end;\n                replacementSpan = ts.createTextSpanFromBounds(dot.getStart(sourceFile), end);\n            }\n            if (isJsxInitializer) {\n                if (insertText === undefined)\n                    insertText = name;\n                insertText = \"{\" + insertText + \"}\";\n                if (typeof isJsxInitializer !== \"boolean\") {\n                    replacementSpan = ts.createTextSpanFromNode(isJsxInitializer, sourceFile);\n                }\n            }\n            if (origin && originIsPromise(origin) && propertyAccessToConvert) {\n                if (insertText === undefined)\n                    insertText = name;\n                var precedingToken = ts.findPrecedingToken(propertyAccessToConvert.pos, sourceFile);\n                var awaitText = \"\";\n                if (precedingToken && ts.positionIsASICandidate(precedingToken.end, precedingToken.parent, sourceFile)) {\n                    awaitText = \";\";\n                }\n                awaitText += \"(await \" + propertyAccessToConvert.expression.getText() + \")\";\n                insertText = needsConvertPropertyAccess ? \"\" + awaitText + insertText : \"\" + awaitText + (insertQuestionDot ? \"?.\" : \".\") + insertText;\n                replacementSpan = ts.createTextSpanFromBounds(propertyAccessToConvert.getStart(sourceFile), propertyAccessToConvert.end);\n            }\n            if (insertText !== undefined && !preferences.includeCompletionsWithInsertText) {\n                return undefined;\n            }\n            // TODO(drosen): Right now we just permit *all* semantic meanings when calling\n            // 'getSymbolKind' which is permissible given that it is backwards compatible; but\n            // really we should consider passing the meaning for the node so that we don't report\n            // that a suggestion for a value is an interface.  We COULD also just do what\n            // 'getSymbolModifiers' does, which is to use the first declaration.\n            // Use a 'sortText' of 0' so that all symbol completion entries come before any other\n            // entries (like JavaScript identifier entries).\n            return {\n                name: name,\n                kind: ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location),\n                kindModifiers: ts.SymbolDisplay.getSymbolModifiers(typeChecker, symbol),\n                sortText: sortText,\n                source: getSourceFromOrigin(origin),\n                hasAction: origin && originIsExport(origin) || undefined,\n                isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || undefined,\n                insertText: insertText,\n                replacementSpan: replacementSpan,\n                isPackageJsonImport: originIsPackageJsonImport(origin) || undefined,\n            };\n        }\n        function quotePropertyName(sourceFile, preferences, name) {\n            if (/^\\d+$/.test(name)) {\n                return name;\n            }\n            return ts.quote(sourceFile, preferences, name);\n        }\n        function isRecommendedCompletionMatch(localSymbol, recommendedCompletion, checker) {\n            return localSymbol === recommendedCompletion ||\n                !!(localSymbol.flags & 1048576 /* ExportValue */) && checker.getExportSymbolOfSymbol(localSymbol) === recommendedCompletion;\n        }\n        function getSourceFromOrigin(origin) {\n            if (originIsExport(origin)) {\n                return ts.stripQuotes(origin.moduleSymbol.name);\n            }\n            if ((origin === null || origin === void 0 ? void 0 : origin.kind) === 1 /* ThisType */) {\n                return CompletionSource.ThisProperty;\n            }\n        }\n        function getCompletionEntriesFromSymbols(symbols, entries, contextToken, location, sourceFile, typeChecker, target, log, kind, preferences, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap) {\n            var start = ts.timestamp();\n            // Tracks unique names.\n            // Value is set to false for global variables or completions from external module exports, because we can have multiple of those;\n            // true otherwise. Based on the order we add things we will always see locals first, then globals, then module exports.\n            // So adding a completion for a local will prevent us from adding completions for external module exports sharing the same name.\n            var uniques = new ts.Map();\n            for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) {\n                var symbol = symbols_1[_i];\n                var origin = symbolToOriginInfoMap ? symbolToOriginInfoMap[ts.getSymbolId(symbol)] : undefined;\n                var info = getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, !!jsxIdentifierExpected);\n                if (!info) {\n                    continue;\n                }\n                var name = info.name, needsConvertPropertyAccess = info.needsConvertPropertyAccess;\n                if (uniques.get(name)) {\n                    continue;\n                }\n                var entry = createCompletionEntry(symbol, symbolToSortTextMap && symbolToSortTextMap[ts.getSymbolId(symbol)] || SortText.LocationPriority, contextToken, location, sourceFile, typeChecker, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, preferences);\n                if (!entry) {\n                    continue;\n                }\n                /** True for locals; false for globals, module exports from other files, `this.` completions. */\n                var shouldShadowLaterSymbols = !origin && !(symbol.parent === undefined && !ts.some(symbol.declarations, function (d) { return d.getSourceFile() === location.getSourceFile(); }));\n                uniques.set(name, shouldShadowLaterSymbols);\n                entries.push(entry);\n            }\n            log(\"getCompletionsAtPosition: getCompletionEntriesFromSymbols: \" + (ts.timestamp() - start));\n            // Prevent consumers of this map from having to worry about\n            // the boolean value. Externally, it should be seen as the\n            // set of all names.\n            return {\n                has: function (name) { return uniques.has(name); },\n                add: function (name) { return uniques.set(name, true); },\n            };\n        }\n        Completions.getCompletionEntriesFromSymbols = getCompletionEntriesFromSymbols;\n        function getLabelCompletionAtPosition(node) {\n            var entries = getLabelStatementCompletions(node);\n            if (entries.length) {\n                return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries };\n            }\n        }\n        function getLabelStatementCompletions(node) {\n            var entries = [];\n            var uniques = new ts.Map();\n            var current = node;\n            while (current) {\n                if (ts.isFunctionLike(current)) {\n                    break;\n                }\n                if (ts.isLabeledStatement(current)) {\n                    var name = current.label.text;\n                    if (!uniques.has(name)) {\n                        uniques.set(name, true);\n                        entries.push({\n                            name: name,\n                            kindModifiers: \"\" /* none */,\n                            kind: \"label\" /* label */,\n                            sortText: SortText.LocationPriority\n                        });\n                    }\n                }\n                current = current.parent;\n            }\n            return entries;\n        }\n        function getSymbolCompletionFromEntryId(program, log, sourceFile, position, entryId, host, preferences) {\n            var compilerOptions = program.getCompilerOptions();\n            var completionData = getCompletionData(program, log, sourceFile, isUncheckedFile(sourceFile, compilerOptions), position, { includeCompletionsForModuleExports: true, includeCompletionsWithInsertText: true }, entryId, host);\n            if (!completionData) {\n                return { type: \"none\" };\n            }\n            if (completionData.kind !== 0 /* Data */) {\n                return { type: \"request\", request: completionData };\n            }\n            var symbols = completionData.symbols, literals = completionData.literals, location = completionData.location, completionKind = completionData.completionKind, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, previousToken = completionData.previousToken, isJsxInitializer = completionData.isJsxInitializer, isTypeOnlyLocation = completionData.isTypeOnlyLocation;\n            var literal = ts.find(literals, function (l) { return completionNameForLiteral(sourceFile, preferences, l) === entryId.name; });\n            if (literal !== undefined)\n                return { type: \"literal\", literal: literal };\n            // Find the symbol with the matching entry name.\n            // We don't need to perform character checks here because we're only comparing the\n            // name against 'entryName' (which is known to be good), not building a new\n            // completion entry.\n            return ts.firstDefined(symbols, function (symbol) {\n                var origin = symbolToOriginInfoMap[ts.getSymbolId(symbol)];\n                var info = getCompletionEntryDisplayNameForSymbol(symbol, compilerOptions.target, origin, completionKind, completionData.isJsxIdentifierExpected);\n                return info && info.name === entryId.name && getSourceFromOrigin(origin) === entryId.source\n                    ? { type: \"symbol\", symbol: symbol, location: location, symbolToOriginInfoMap: symbolToOriginInfoMap, previousToken: previousToken, isJsxInitializer: isJsxInitializer, isTypeOnlyLocation: isTypeOnlyLocation }\n                    : undefined;\n            }) || { type: \"none\" };\n        }\n        function getCompletionEntryDetails(program, log, sourceFile, position, entryId, host, formatContext, preferences, cancellationToken) {\n            var typeChecker = program.getTypeChecker();\n            var compilerOptions = program.getCompilerOptions();\n            var name = entryId.name;\n            var contextToken = ts.findPrecedingToken(position, sourceFile);\n            if (ts.isInString(sourceFile, position, contextToken)) {\n                return Completions.StringCompletions.getStringLiteralCompletionDetails(name, sourceFile, position, contextToken, typeChecker, compilerOptions, host, cancellationToken);\n            }\n            // Compute all the completion symbols again.\n            var symbolCompletion = getSymbolCompletionFromEntryId(program, log, sourceFile, position, entryId, host, preferences);\n            switch (symbolCompletion.type) {\n                case \"request\": {\n                    var request = symbolCompletion.request;\n                    switch (request.kind) {\n                        case 1 /* JsDocTagName */:\n                            return ts.JsDoc.getJSDocTagNameCompletionDetails(name);\n                        case 2 /* JsDocTag */:\n                            return ts.JsDoc.getJSDocTagCompletionDetails(name);\n                        case 3 /* JsDocParameterName */:\n                            return ts.JsDoc.getJSDocParameterNameCompletionDetails(name);\n                        default:\n                            return ts.Debug.assertNever(request);\n                    }\n                }\n                case \"symbol\": {\n                    var symbol = symbolCompletion.symbol, location = symbolCompletion.location, symbolToOriginInfoMap = symbolCompletion.symbolToOriginInfoMap, previousToken = symbolCompletion.previousToken;\n                    var _a = getCompletionEntryCodeActionsAndSourceDisplay(symbolToOriginInfoMap, symbol, program, typeChecker, host, compilerOptions, sourceFile, position, previousToken, formatContext, preferences), codeActions = _a.codeActions, sourceDisplay = _a.sourceDisplay;\n                    return createCompletionDetailsForSymbol(symbol, typeChecker, sourceFile, location, cancellationToken, codeActions, sourceDisplay); // TODO: GH#18217\n                }\n                case \"literal\": {\n                    var literal = symbolCompletion.literal;\n                    return createSimpleDetails(completionNameForLiteral(sourceFile, preferences, literal), \"string\" /* string */, typeof literal === \"string\" ? ts.SymbolDisplayPartKind.stringLiteral : ts.SymbolDisplayPartKind.numericLiteral);\n                }\n                case \"none\":\n                    // Didn't find a symbol with this name.  See if we can find a keyword instead.\n                    return allKeywordsCompletions().some(function (c) { return c.name === name; }) ? createSimpleDetails(name, \"keyword\" /* keyword */, ts.SymbolDisplayPartKind.keyword) : undefined;\n                default:\n                    ts.Debug.assertNever(symbolCompletion);\n            }\n        }\n        Completions.getCompletionEntryDetails = getCompletionEntryDetails;\n        function createSimpleDetails(name, kind, kind2) {\n            return createCompletionDetails(name, \"\" /* none */, kind, [ts.displayPart(name, kind2)]);\n        }\n        function createCompletionDetailsForSymbol(symbol, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) {\n            var _a = checker.runWithCancellationToken(cancellationToken, function (checker) {\n                return ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, sourceFile, location, location, 7 /* All */);\n            }), displayParts = _a.displayParts, documentation = _a.documentation, symbolKind = _a.symbolKind, tags = _a.tags;\n            return createCompletionDetails(symbol.name, ts.SymbolDisplay.getSymbolModifiers(checker, symbol), symbolKind, displayParts, documentation, tags, codeActions, sourceDisplay);\n        }\n        Completions.createCompletionDetailsForSymbol = createCompletionDetailsForSymbol;\n        function createCompletionDetails(name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source) {\n            return { name: name, kindModifiers: kindModifiers, kind: kind, displayParts: displayParts, documentation: documentation, tags: tags, codeActions: codeActions, source: source };\n        }\n        Completions.createCompletionDetails = createCompletionDetails;\n        function getCompletionEntryCodeActionsAndSourceDisplay(symbolToOriginInfoMap, symbol, program, checker, host, compilerOptions, sourceFile, position, previousToken, formatContext, preferences) {\n            var symbolOriginInfo = symbolToOriginInfoMap[ts.getSymbolId(symbol)];\n            if (!symbolOriginInfo || !originIsExport(symbolOriginInfo)) {\n                return { codeActions: undefined, sourceDisplay: undefined };\n            }\n            var moduleSymbol = symbolOriginInfo.moduleSymbol;\n            var exportedSymbol = checker.getMergedSymbol(ts.skipAlias(symbol.exportSymbol || symbol, checker));\n            var _a = ts.codefix.getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, ts.getNameForExportedSymbol(symbol, compilerOptions.target), host, program, formatContext, previousToken && ts.isIdentifier(previousToken) ? previousToken.getStart(sourceFile) : position, preferences), moduleSpecifier = _a.moduleSpecifier, codeAction = _a.codeAction;\n            return { sourceDisplay: [ts.textPart(moduleSpecifier)], codeActions: [codeAction] };\n        }\n        function getCompletionEntrySymbol(program, log, sourceFile, position, entryId, host, preferences) {\n            var completion = getSymbolCompletionFromEntryId(program, log, sourceFile, position, entryId, host, preferences);\n            return completion.type === \"symbol\" ? completion.symbol : undefined;\n        }\n        Completions.getCompletionEntrySymbol = getCompletionEntrySymbol;\n        var CompletionDataKind;\n        (function (CompletionDataKind) {\n            CompletionDataKind[CompletionDataKind[\"Data\"] = 0] = \"Data\";\n            CompletionDataKind[CompletionDataKind[\"JsDocTagName\"] = 1] = \"JsDocTagName\";\n            CompletionDataKind[CompletionDataKind[\"JsDocTag\"] = 2] = \"JsDocTag\";\n            CompletionDataKind[CompletionDataKind[\"JsDocParameterName\"] = 3] = \"JsDocParameterName\";\n        })(CompletionDataKind || (CompletionDataKind = {}));\n        var CompletionKind;\n        (function (CompletionKind) {\n            CompletionKind[CompletionKind[\"ObjectPropertyDeclaration\"] = 0] = \"ObjectPropertyDeclaration\";\n            CompletionKind[CompletionKind[\"Global\"] = 1] = \"Global\";\n            CompletionKind[CompletionKind[\"PropertyAccess\"] = 2] = \"PropertyAccess\";\n            CompletionKind[CompletionKind[\"MemberLike\"] = 3] = \"MemberLike\";\n            CompletionKind[CompletionKind[\"String\"] = 4] = \"String\";\n            CompletionKind[CompletionKind[\"None\"] = 5] = \"None\";\n        })(CompletionKind = Completions.CompletionKind || (Completions.CompletionKind = {}));\n        function getRecommendedCompletion(previousToken, contextualType, checker) {\n            // For a union, return the first one with a recommended completion.\n            return ts.firstDefined(contextualType && (contextualType.isUnion() ? contextualType.types : [contextualType]), function (type) {\n                var symbol = type && type.symbol;\n                // Don't include make a recommended completion for an abstract class\n                return symbol && (symbol.flags & (8 /* EnumMember */ | 384 /* Enum */ | 32 /* Class */) && !ts.isAbstractConstructorSymbol(symbol))\n                    ? getFirstSymbolInChain(symbol, previousToken, checker)\n                    : undefined;\n            });\n        }\n        function getContextualType(previousToken, position, sourceFile, checker) {\n            var parent = previousToken.parent;\n            switch (previousToken.kind) {\n                case 78 /* Identifier */:\n                    return ts.getContextualTypeFromParent(previousToken, checker);\n                case 62 /* EqualsToken */:\n                    switch (parent.kind) {\n                        case 249 /* VariableDeclaration */:\n                            return checker.getContextualType(parent.initializer); // TODO: GH#18217\n                        case 216 /* BinaryExpression */:\n                            return checker.getTypeAtLocation(parent.left);\n                        case 280 /* JsxAttribute */:\n                            return checker.getContextualTypeForJsxAttribute(parent);\n                        default:\n                            return undefined;\n                    }\n                case 102 /* NewKeyword */:\n                    return checker.getContextualType(parent);\n                case 81 /* CaseKeyword */:\n                    return ts.getSwitchedType(ts.cast(parent, ts.isCaseClause), checker);\n                case 18 /* OpenBraceToken */:\n                    return ts.isJsxExpression(parent) && parent.parent.kind !== 273 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined;\n                default:\n                    var argInfo = ts.SignatureHelp.getArgumentInfoForCompletions(previousToken, position, sourceFile);\n                    return argInfo ?\n                        // At `,`, treat this as the next argument after the comma.\n                        checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex + (previousToken.kind === 27 /* CommaToken */ ? 1 : 0)) :\n                        ts.isEqualityOperatorKind(previousToken.kind) && ts.isBinaryExpression(parent) && ts.isEqualityOperatorKind(parent.operatorToken.kind) ?\n                            // completion at `x ===/**/` should be for the right side\n                            checker.getTypeAtLocation(parent.left) :\n                            checker.getContextualType(previousToken);\n            }\n        }\n        function getFirstSymbolInChain(symbol, enclosingDeclaration, checker) {\n            var chain = checker.getAccessibleSymbolChain(symbol, enclosingDeclaration, /*meaning*/ 67108863 /* All */, /*useOnlyExternalAliasing*/ false);\n            if (chain)\n                return ts.first(chain);\n            return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker));\n        }\n        function isModuleSymbol(symbol) {\n            return symbol.declarations.some(function (d) { return d.kind === 297 /* SourceFile */; });\n        }\n        function getCompletionData(program, log, sourceFile, isUncheckedFile, position, preferences, detailsEntryId, host) {\n            var typeChecker = program.getTypeChecker();\n            var compilerOptions = program.getCompilerOptions();\n            var start = ts.timestamp();\n            var currentToken = ts.getTokenAtPosition(sourceFile, position); // TODO: GH#15853\n            // We will check for jsdoc comments with insideComment and getJsDocTagAtPosition. (TODO: that seems rather inefficient to check the same thing so many times.)\n            log(\"getCompletionData: Get current token: \" + (ts.timestamp() - start));\n            start = ts.timestamp();\n            var insideComment = ts.isInComment(sourceFile, position, currentToken);\n            log(\"getCompletionData: Is inside comment: \" + (ts.timestamp() - start));\n            var insideJsDocTagTypeExpression = false;\n            var isInSnippetScope = false;\n            if (insideComment) {\n                if (ts.hasDocComment(sourceFile, position)) {\n                    if (sourceFile.text.charCodeAt(position - 1) === 64 /* at */) {\n                        // The current position is next to the '@' sign, when no tag name being provided yet.\n                        // Provide a full list of tag names\n                        return { kind: 1 /* JsDocTagName */ };\n                    }\n                    else {\n                        // When completion is requested without \"@\", we will have check to make sure that\n                        // there are no comments prefix the request position. We will only allow \"*\" and space.\n                        // e.g\n                        //   /** |c| /*\n                        //\n                        //   /**\n                        //     |c|\n                        //    */\n                        //\n                        //   /**\n                        //    * |c|\n                        //    */\n                        //\n                        //   /**\n                        //    *         |c|\n                        //    */\n                        var lineStart = ts.getLineStartPositionForPosition(position, sourceFile);\n                        if (!/[^\\*|\\s(/)]/.test(sourceFile.text.substring(lineStart, position))) {\n                            return { kind: 2 /* JsDocTag */ };\n                        }\n                    }\n                }\n                // Completion should work inside certain JsDoc tags. For example:\n                //     /** @type {number | string} */\n                // Completion should work in the brackets\n                var tag = getJsDocTagAtPosition(currentToken, position);\n                if (tag) {\n                    if (tag.tagName.pos <= position && position <= tag.tagName.end) {\n                        return { kind: 1 /* JsDocTagName */ };\n                    }\n                    if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 301 /* JSDocTypeExpression */) {\n                        currentToken = ts.getTokenAtPosition(sourceFile, position);\n                        if (!currentToken ||\n                            (!ts.isDeclarationName(currentToken) &&\n                                (currentToken.parent.kind !== 333 /* JSDocPropertyTag */ ||\n                                    currentToken.parent.name !== currentToken))) {\n                            // Use as type location if inside tag's type expression\n                            insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression);\n                        }\n                    }\n                    if (!insideJsDocTagTypeExpression && ts.isJSDocParameterTag(tag) && (ts.nodeIsMissing(tag.name) || tag.name.pos <= position && position <= tag.name.end)) {\n                        return { kind: 3 /* JsDocParameterName */, tag: tag };\n                    }\n                }\n                if (!insideJsDocTagTypeExpression) {\n                    // Proceed if the current position is in jsDoc tag expression; otherwise it is a normal\n                    // comment or the plain text part of a jsDoc comment, so no completion should be available\n                    log(\"Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment.\");\n                    return undefined;\n                }\n            }\n            start = ts.timestamp();\n            var previousToken = ts.findPrecedingToken(position, sourceFile, /*startNode*/ undefined); // TODO: GH#18217\n            log(\"getCompletionData: Get previous token 1: \" + (ts.timestamp() - start));\n            // The decision to provide completion depends on the contextToken, which is determined through the previousToken.\n            // Note: 'previousToken' (and thus 'contextToken') can be undefined if we are the beginning of the file\n            var contextToken = previousToken;\n            // Check if the caret is at the end of an identifier; this is a partial identifier that we want to complete: e.g. a.toS|\n            // Skip this partial identifier and adjust the contextToken to the token that precedes it.\n            if (contextToken && position <= contextToken.end && (ts.isIdentifierOrPrivateIdentifier(contextToken) || ts.isKeyword(contextToken.kind))) {\n                var start_1 = ts.timestamp();\n                contextToken = ts.findPrecedingToken(contextToken.getFullStart(), sourceFile, /*startNode*/ undefined); // TODO: GH#18217\n                log(\"getCompletionData: Get previous token 2: \" + (ts.timestamp() - start_1));\n            }\n            // Find the node where completion is requested on.\n            // Also determine whether we are trying to complete with members of that node\n            // or attributes of a JSX tag.\n            var node = currentToken;\n            var propertyAccessToConvert;\n            var isRightOfDot = false;\n            var isRightOfQuestionDot = false;\n            var isRightOfOpenTag = false;\n            var isStartingCloseTag = false;\n            var isJsxInitializer = false;\n            var isJsxIdentifierExpected = false;\n            var location = ts.getTouchingPropertyName(sourceFile, position);\n            if (contextToken) {\n                // Bail out if this is a known invalid completion location\n                if (isCompletionListBlocker(contextToken)) {\n                    log(\"Returning an empty list because completion was requested in an invalid position.\");\n                    return undefined;\n                }\n                var parent = contextToken.parent;\n                if (contextToken.kind === 24 /* DotToken */ || contextToken.kind === 28 /* QuestionDotToken */) {\n                    isRightOfDot = contextToken.kind === 24 /* DotToken */;\n                    isRightOfQuestionDot = contextToken.kind === 28 /* QuestionDotToken */;\n                    switch (parent.kind) {\n                        case 201 /* PropertyAccessExpression */:\n                            propertyAccessToConvert = parent;\n                            node = propertyAccessToConvert.expression;\n                            if ((ts.isCallExpression(node) || ts.isFunctionLike(node)) &&\n                                node.end === contextToken.pos &&\n                                node.getChildCount(sourceFile) &&\n                                ts.last(node.getChildren(sourceFile)).kind !== 21 /* CloseParenToken */) {\n                                // This is likely dot from incorrectly parsed expression and user is starting to write spread\n                                // eg: Math.min(./**/)\n                                // const x = function (./**/) {}\n                                return undefined;\n                            }\n                            break;\n                        case 157 /* QualifiedName */:\n                            node = parent.left;\n                            break;\n                        case 256 /* ModuleDeclaration */:\n                            node = parent.name;\n                            break;\n                        case 195 /* ImportType */:\n                        case 226 /* MetaProperty */:\n                            node = parent;\n                            break;\n                        default:\n                            // There is nothing that precedes the dot, so this likely just a stray character\n                            // or leading into a '...' token. Just bail out instead.\n                            return undefined;\n                    }\n                }\n                else if (sourceFile.languageVariant === 1 /* JSX */) {\n                    // <UI.Test /* completion position */ />\n                    // If the tagname is a property access expression, we will then walk up to the top most of property access expression.\n                    // Then, try to get a JSX container and its associated attributes type.\n                    if (parent && parent.kind === 201 /* PropertyAccessExpression */) {\n                        contextToken = parent;\n                        parent = parent.parent;\n                    }\n                    // Fix location\n                    if (currentToken.parent === location) {\n                        switch (currentToken.kind) {\n                            case 31 /* GreaterThanToken */:\n                                if (currentToken.parent.kind === 273 /* JsxElement */ || currentToken.parent.kind === 275 /* JsxOpeningElement */) {\n                                    location = currentToken;\n                                }\n                                break;\n                            case 43 /* SlashToken */:\n                                if (currentToken.parent.kind === 274 /* JsxSelfClosingElement */) {\n                                    location = currentToken;\n                                }\n                                break;\n                        }\n                    }\n                    switch (parent.kind) {\n                        case 276 /* JsxClosingElement */:\n                            if (contextToken.kind === 43 /* SlashToken */) {\n                                isStartingCloseTag = true;\n                                location = contextToken;\n                            }\n                            break;\n                        case 216 /* BinaryExpression */:\n                            if (!binaryExpressionMayBeOpenTag(parent)) {\n                                break;\n                            }\n                        // falls through\n                        case 274 /* JsxSelfClosingElement */:\n                        case 273 /* JsxElement */:\n                        case 275 /* JsxOpeningElement */:\n                            isJsxIdentifierExpected = true;\n                            if (contextToken.kind === 29 /* LessThanToken */) {\n                                isRightOfOpenTag = true;\n                                location = contextToken;\n                            }\n                            break;\n                        case 283 /* JsxExpression */:\n                            // For `<div foo={true} [||] ></div>`, `parent` will be `{true}` and `previousToken` will be `}`\n                            if (previousToken.kind === 19 /* CloseBraceToken */ && currentToken.kind === 31 /* GreaterThanToken */) {\n                                isJsxIdentifierExpected = true;\n                            }\n                            break;\n                        case 280 /* JsxAttribute */:\n                            // For `<div className=\"x\" [||] ></div>`, `parent` will be JsxAttribute and `previousToken` will be its initializer\n                            if (parent.initializer === previousToken &&\n                                previousToken.end < position) {\n                                isJsxIdentifierExpected = true;\n                                break;\n                            }\n                            switch (previousToken.kind) {\n                                case 62 /* EqualsToken */:\n                                    isJsxInitializer = true;\n                                    break;\n                                case 78 /* Identifier */:\n                                    isJsxIdentifierExpected = true;\n                                    // For `<div x=[|f/**/|]`, `parent` will be `x` and `previousToken.parent` will be `f` (which is its own JsxAttribute)\n                                    // Note for `<div someBool f>` we don't want to treat this as a jsx inializer, instead it's the attribute name.\n                                    if (parent !== previousToken.parent &&\n                                        !parent.initializer &&\n                                        ts.findChildOfKind(parent, 62 /* EqualsToken */, sourceFile)) {\n                                        isJsxInitializer = previousToken;\n                                    }\n                            }\n                            break;\n                    }\n                }\n            }\n            var semanticStart = ts.timestamp();\n            var completionKind = 5 /* None */;\n            var isNewIdentifierLocation = false;\n            var isNonContextualObjectLiteral = false;\n            var keywordFilters = 0 /* None */;\n            // This also gets mutated in nested-functions after the return\n            var symbols = [];\n            var symbolToOriginInfoMap = [];\n            var symbolToSortTextMap = [];\n            var importSuggestionsCache = host.getImportSuggestionsCache && host.getImportSuggestionsCache();\n            var isTypeOnly = isTypeOnlyCompletion();\n            if (isRightOfDot || isRightOfQuestionDot) {\n                getTypeScriptMemberSymbols();\n            }\n            else if (isRightOfOpenTag) {\n                var tagSymbols = typeChecker.getJsxIntrinsicTagNamesAt(location);\n                ts.Debug.assertEachIsDefined(tagSymbols, \"getJsxIntrinsicTagNames() should all be defined\");\n                tryGetGlobalSymbols();\n                symbols = tagSymbols.concat(symbols);\n                completionKind = 3 /* MemberLike */;\n                keywordFilters = 0 /* None */;\n            }\n            else if (isStartingCloseTag) {\n                var tagName = contextToken.parent.parent.openingElement.tagName;\n                var tagSymbol = typeChecker.getSymbolAtLocation(tagName);\n                if (tagSymbol) {\n                    symbols = [tagSymbol];\n                }\n                completionKind = 3 /* MemberLike */;\n                keywordFilters = 0 /* None */;\n            }\n            else {\n                // For JavaScript or TypeScript, if we're not after a dot, then just try to get the\n                // global symbols in scope.  These results should be valid for either language as\n                // the set of symbols that can be referenced from this location.\n                if (!tryGetGlobalSymbols()) {\n                    return undefined;\n                }\n            }\n            log(\"getCompletionData: Semantic work: \" + (ts.timestamp() - semanticStart));\n            var contextualType = previousToken && getContextualType(previousToken, position, sourceFile, typeChecker);\n            var literals = ts.mapDefined(contextualType && (contextualType.isUnion() ? contextualType.types : [contextualType]), function (t) { return t.isLiteral() ? t.value : undefined; });\n            var recommendedCompletion = previousToken && contextualType && getRecommendedCompletion(previousToken, contextualType, typeChecker);\n            return {\n                kind: 0 /* Data */,\n                symbols: symbols,\n                completionKind: completionKind,\n                isInSnippetScope: isInSnippetScope,\n                propertyAccessToConvert: propertyAccessToConvert,\n                isNewIdentifierLocation: isNewIdentifierLocation,\n                location: location,\n                keywordFilters: keywordFilters,\n                literals: literals,\n                symbolToOriginInfoMap: symbolToOriginInfoMap,\n                recommendedCompletion: recommendedCompletion,\n                previousToken: previousToken,\n                isJsxInitializer: isJsxInitializer,\n                insideJsDocTagTypeExpression: insideJsDocTagTypeExpression,\n                symbolToSortTextMap: symbolToSortTextMap,\n                isTypeOnlyLocation: isTypeOnly,\n                isJsxIdentifierExpected: isJsxIdentifierExpected,\n            };\n            function isTagWithTypeExpression(tag) {\n                switch (tag.kind) {\n                    case 326 /* JSDocParameterTag */:\n                    case 333 /* JSDocPropertyTag */:\n                    case 327 /* JSDocReturnTag */:\n                    case 329 /* JSDocTypeTag */:\n                    case 331 /* JSDocTypedefTag */:\n                        return true;\n                    default:\n                        return false;\n                }\n            }\n            function getTypeScriptMemberSymbols() {\n                // Right of dot member completion list\n                completionKind = 2 /* PropertyAccess */;\n                // Since this is qualified name check it's a type node location\n                var isImportType = ts.isLiteralImportTypeNode(node);\n                var isTypeLocation = insideJsDocTagTypeExpression\n                    || (isImportType && !node.isTypeOf)\n                    || ts.isPartOfTypeNode(node.parent)\n                    || ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker);\n                var isRhsOfImportDeclaration = ts.isInRightSideOfInternalImportEqualsDeclaration(node);\n                if (ts.isEntityName(node) || isImportType || ts.isPropertyAccessExpression(node)) {\n                    var isNamespaceName = ts.isModuleDeclaration(node.parent);\n                    if (isNamespaceName)\n                        isNewIdentifierLocation = true;\n                    var symbol = typeChecker.getSymbolAtLocation(node);\n                    if (symbol) {\n                        symbol = ts.skipAlias(symbol, typeChecker);\n                        if (symbol.flags & (1536 /* Module */ | 384 /* Enum */)) {\n                            // Extract module or enum members\n                            var exportedSymbols = typeChecker.getExportsOfModule(symbol);\n                            ts.Debug.assertEachIsDefined(exportedSymbols, \"getExportsOfModule() should all be defined\");\n                            var isValidValueAccess_1 = function (symbol) { return typeChecker.isValidPropertyAccess(isImportType ? node : (node.parent), symbol.name); };\n                            var isValidTypeAccess_1 = function (symbol) { return symbolCanBeReferencedAtTypeLocation(symbol); };\n                            var isValidAccess = isNamespaceName\n                                // At `namespace N.M/**/`, if this is the only declaration of `M`, don't include `M` as a completion.\n                                ? function (symbol) { return !!(symbol.flags & 1920 /* Namespace */) && !symbol.declarations.every(function (d) { return d.parent === node.parent; }); }\n                                : isRhsOfImportDeclaration ?\n                                    // Any kind is allowed when dotting off namespace in internal import equals declaration\n                                    function (symbol) { return isValidTypeAccess_1(symbol) || isValidValueAccess_1(symbol); } :\n                                    isTypeLocation ? isValidTypeAccess_1 : isValidValueAccess_1;\n                            for (var _i = 0, exportedSymbols_1 = exportedSymbols; _i < exportedSymbols_1.length; _i++) {\n                                var exportedSymbol = exportedSymbols_1[_i];\n                                if (isValidAccess(exportedSymbol)) {\n                                    symbols.push(exportedSymbol);\n                                }\n                            }\n                            // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods).\n                            if (!isTypeLocation &&\n                                symbol.declarations &&\n                                symbol.declarations.some(function (d) { return d.kind !== 297 /* SourceFile */ && d.kind !== 256 /* ModuleDeclaration */ && d.kind !== 255 /* EnumDeclaration */; })) {\n                                var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType();\n                                var insertQuestionDot = false;\n                                if (type.isNullableType()) {\n                                    var canCorrectToQuestionDot = isRightOfDot &&\n                                        !isRightOfQuestionDot &&\n                                        preferences.includeAutomaticOptionalChainCompletions !== false;\n                                    if (canCorrectToQuestionDot || isRightOfQuestionDot) {\n                                        type = type.getNonNullableType();\n                                        if (canCorrectToQuestionDot) {\n                                            insertQuestionDot = true;\n                                        }\n                                    }\n                                }\n                                addTypeProperties(type, !!(node.flags & 32768 /* AwaitContext */), insertQuestionDot);\n                            }\n                            return;\n                        }\n                    }\n                }\n                if (ts.isMetaProperty(node) && (node.keywordToken === 102 /* NewKeyword */ || node.keywordToken === 99 /* ImportKeyword */) && contextToken === node.getChildAt(1)) {\n                    var completion = (node.keywordToken === 102 /* NewKeyword */) ? \"target\" : \"meta\";\n                    symbols.push(typeChecker.createSymbol(4 /* Property */, ts.escapeLeadingUnderscores(completion)));\n                    return;\n                }\n                if (!isTypeLocation) {\n                    var type = typeChecker.getTypeAtLocation(node).getNonOptionalType();\n                    var insertQuestionDot = false;\n                    if (type.isNullableType()) {\n                        var canCorrectToQuestionDot = isRightOfDot &&\n                            !isRightOfQuestionDot &&\n                            preferences.includeAutomaticOptionalChainCompletions !== false;\n                        if (canCorrectToQuestionDot || isRightOfQuestionDot) {\n                            type = type.getNonNullableType();\n                            if (canCorrectToQuestionDot) {\n                                insertQuestionDot = true;\n                            }\n                        }\n                    }\n                    addTypeProperties(type, !!(node.flags & 32768 /* AwaitContext */), insertQuestionDot);\n                }\n            }\n            function addTypeProperties(type, insertAwait, insertQuestionDot) {\n                isNewIdentifierLocation = !!type.getStringIndexType();\n                if (isRightOfQuestionDot && ts.some(type.getCallSignatures())) {\n                    isNewIdentifierLocation = true;\n                }\n                var propertyAccess = node.kind === 195 /* ImportType */ ? node : node.parent;\n                if (isUncheckedFile) {\n                    // In javascript files, for union types, we don't just get the members that\n                    // the individual types have in common, we also include all the members that\n                    // each individual type has. This is because we're going to add all identifiers\n                    // anyways. So we might as well elevate the members that were at least part\n                    // of the individual types to a higher status since we know what they are.\n                    symbols.push.apply(symbols, ts.filter(getPropertiesForCompletion(type, typeChecker), function (s) { return typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type, s); }));\n                }\n                else {\n                    for (var _i = 0, _a = type.getApparentProperties(); _i < _a.length; _i++) {\n                        var symbol = _a[_i];\n                        if (typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type, symbol)) {\n                            addPropertySymbol(symbol, /* insertAwait */ false, insertQuestionDot);\n                        }\n                    }\n                }\n                if (insertAwait && preferences.includeCompletionsWithInsertText) {\n                    var promiseType = typeChecker.getPromisedTypeOfPromise(type);\n                    if (promiseType) {\n                        for (var _b = 0, _c = promiseType.getApparentProperties(); _b < _c.length; _b++) {\n                            var symbol = _c[_b];\n                            if (typeChecker.isValidPropertyAccessForCompletions(propertyAccess, promiseType, symbol)) {\n                                addPropertySymbol(symbol, /* insertAwait */ true, insertQuestionDot);\n                            }\n                        }\n                    }\n                }\n            }\n            function addPropertySymbol(symbol, insertAwait, insertQuestionDot) {\n                // For a computed property with an accessible name like `Symbol.iterator`,\n                // we'll add a completion for the *name* `Symbol` instead of for the property.\n                // If this is e.g. [Symbol.iterator], add a completion for `Symbol`.\n                var computedPropertyName = ts.firstDefined(symbol.declarations, function (decl) { return ts.tryCast(ts.getNameOfDeclaration(decl), ts.isComputedPropertyName); });\n                if (computedPropertyName) {\n                    var leftMostName = getLeftMostName(computedPropertyName.expression); // The completion is for `Symbol`, not `iterator`.\n                    var nameSymbol = leftMostName && typeChecker.getSymbolAtLocation(leftMostName);\n                    // If this is nested like for `namespace N { export const sym = Symbol(); }`, we'll add the completion for `N`.\n                    var firstAccessibleSymbol = nameSymbol && getFirstSymbolInChain(nameSymbol, contextToken, typeChecker);\n                    if (firstAccessibleSymbol && !symbolToOriginInfoMap[ts.getSymbolId(firstAccessibleSymbol)]) {\n                        symbols.push(firstAccessibleSymbol);\n                        var moduleSymbol = firstAccessibleSymbol.parent;\n                        symbolToOriginInfoMap[ts.getSymbolId(firstAccessibleSymbol)] =\n                            !moduleSymbol || !ts.isExternalModuleSymbol(moduleSymbol)\n                                ? { kind: getNullableSymbolOriginInfoKind(2 /* SymbolMemberNoExport */) }\n                                : { kind: getNullableSymbolOriginInfoKind(6 /* SymbolMemberExport */), moduleSymbol: moduleSymbol, isDefaultExport: false };\n                    }\n                    else if (preferences.includeCompletionsWithInsertText) {\n                        addSymbolOriginInfo(symbol);\n                        addSymbolSortInfo(symbol);\n                        symbols.push(symbol);\n                    }\n                }\n                else {\n                    addSymbolOriginInfo(symbol);\n                    addSymbolSortInfo(symbol);\n                    symbols.push(symbol);\n                }\n                function addSymbolSortInfo(symbol) {\n                    if (isStaticProperty(symbol)) {\n                        symbolToSortTextMap[ts.getSymbolId(symbol)] = SortText.LocalDeclarationPriority;\n                    }\n                }\n                function addSymbolOriginInfo(symbol) {\n                    if (preferences.includeCompletionsWithInsertText) {\n                        if (insertAwait && !symbolToOriginInfoMap[ts.getSymbolId(symbol)]) {\n                            symbolToOriginInfoMap[ts.getSymbolId(symbol)] = { kind: getNullableSymbolOriginInfoKind(8 /* Promise */) };\n                        }\n                        else if (insertQuestionDot) {\n                            symbolToOriginInfoMap[ts.getSymbolId(symbol)] = { kind: 16 /* Nullable */ };\n                        }\n                    }\n                }\n                function getNullableSymbolOriginInfoKind(kind) {\n                    return insertQuestionDot ? kind | 16 /* Nullable */ : kind;\n                }\n            }\n            /** Given 'a.b.c', returns 'a'. */\n            function getLeftMostName(e) {\n                return ts.isIdentifier(e) ? e : ts.isPropertyAccessExpression(e) ? getLeftMostName(e.expression) : undefined;\n            }\n            function tryGetGlobalSymbols() {\n                var result = tryGetObjectLikeCompletionSymbols()\n                    || tryGetImportOrExportClauseCompletionSymbols()\n                    || tryGetLocalNamedExportCompletionSymbols()\n                    || tryGetConstructorCompletion()\n                    || tryGetClassLikeCompletionSymbols()\n                    || tryGetJsxCompletionSymbols()\n                    || (getGlobalCompletions(), 1 /* Success */);\n                return result === 1 /* Success */;\n            }\n            function tryGetConstructorCompletion() {\n                if (!tryGetConstructorLikeCompletionContainer(contextToken))\n                    return 0 /* Continue */;\n                // no members, only keywords\n                completionKind = 5 /* None */;\n                // Declaring new property/method/accessor\n                isNewIdentifierLocation = true;\n                // Has keywords for constructor parameter\n                keywordFilters = 4 /* ConstructorParameterKeywords */;\n                return 1 /* Success */;\n            }\n            function tryGetJsxCompletionSymbols() {\n                var jsxContainer = tryGetContainingJsxElement(contextToken);\n                // Cursor is inside a JSX self-closing element or opening element\n                var attrsType = jsxContainer && typeChecker.getContextualType(jsxContainer.attributes);\n                if (!attrsType)\n                    return 0 /* Continue */;\n                var completionsType = jsxContainer && typeChecker.getContextualType(jsxContainer.attributes, 4 /* Completions */);\n                symbols = filterJsxAttributes(getPropertiesForObjectExpression(attrsType, completionsType, jsxContainer.attributes, typeChecker), jsxContainer.attributes.properties);\n                setSortTextToOptionalMember();\n                completionKind = 3 /* MemberLike */;\n                isNewIdentifierLocation = false;\n                return 1 /* Success */;\n            }\n            function getGlobalCompletions() {\n                keywordFilters = tryGetFunctionLikeBodyCompletionContainer(contextToken) ? 5 /* FunctionLikeBodyKeywords */ : 1 /* All */;\n                // Get all entities in the current scope.\n                completionKind = 1 /* Global */;\n                isNewIdentifierLocation = isNewIdentifierDefinitionLocation();\n                if (previousToken !== contextToken) {\n                    ts.Debug.assert(!!previousToken, \"Expected 'contextToken' to be defined when different from 'previousToken'.\");\n                }\n                // We need to find the node that will give us an appropriate scope to begin\n                // aggregating completion candidates. This is achieved in 'getScopeNode'\n                // by finding the first node that encompasses a position, accounting for whether a node\n                // is \"complete\" to decide whether a position belongs to the node.\n                //\n                // However, at the end of an identifier, we are interested in the scope of the identifier\n                // itself, but fall outside of the identifier. For instance:\n                //\n                //      xyz => x$\n                //\n                // the cursor is outside of both the 'x' and the arrow function 'xyz => x',\n                // so 'xyz' is not returned in our results.\n                //\n                // We define 'adjustedPosition' so that we may appropriately account for\n                // being at the end of an identifier. The intention is that if requesting completion\n                // at the end of an identifier, it should be effectively equivalent to requesting completion\n                // anywhere inside/at the beginning of the identifier. So in the previous case, the\n                // 'adjustedPosition' will work as if requesting completion in the following:\n                //\n                //      xyz => $x\n                //\n                // If previousToken !== contextToken, then\n                //   - 'contextToken' was adjusted to the token prior to 'previousToken'\n                //      because we were at the end of an identifier.\n                //   - 'previousToken' is defined.\n                var adjustedPosition = previousToken !== contextToken ?\n                    previousToken.getStart() :\n                    position;\n                var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile;\n                isInSnippetScope = isSnippetScope(scopeNode);\n                var symbolMeanings = (isTypeOnly ? 0 /* None */ : 111551 /* Value */) | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */;\n                symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings);\n                ts.Debug.assertEachIsDefined(symbols, \"getSymbolsInScope() should all be defined\");\n                for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) {\n                    var symbol = symbols_2[_i];\n                    if (!typeChecker.isArgumentsSymbol(symbol) &&\n                        !ts.some(symbol.declarations, function (d) { return d.getSourceFile() === sourceFile; })) {\n                        symbolToSortTextMap[ts.getSymbolId(symbol)] = SortText.GlobalsOrKeywords;\n                    }\n                }\n                // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions`\n                if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 297 /* SourceFile */) {\n                    var thisType = typeChecker.tryGetThisTypeAt(scopeNode, /*includeGlobalThis*/ false);\n                    if (thisType && !isProbablyGlobalType(thisType, sourceFile, typeChecker)) {\n                        for (var _a = 0, _b = getPropertiesForCompletion(thisType, typeChecker); _a < _b.length; _a++) {\n                            var symbol = _b[_a];\n                            symbolToOriginInfoMap[ts.getSymbolId(symbol)] = { kind: 1 /* ThisType */ };\n                            symbols.push(symbol);\n                            symbolToSortTextMap[ts.getSymbolId(symbol)] = SortText.SuggestedClassMembers;\n                        }\n                    }\n                }\n                if (shouldOfferImportCompletions()) {\n                    var lowerCaseTokenText_1 = previousToken && ts.isIdentifier(previousToken) ? previousToken.text.toLowerCase() : \"\";\n                    var autoImportSuggestions = getSymbolsFromOtherSourceFileExports(program.getCompilerOptions().target, host);\n                    if (!detailsEntryId && importSuggestionsCache) {\n                        importSuggestionsCache.set(sourceFile.fileName, autoImportSuggestions, host.getProjectVersion && host.getProjectVersion());\n                    }\n                    autoImportSuggestions.forEach(function (_a) {\n                        var symbol = _a.symbol, symbolName = _a.symbolName, skipFilter = _a.skipFilter, origin = _a.origin;\n                        if (detailsEntryId) {\n                            if (detailsEntryId.source && ts.stripQuotes(origin.moduleSymbol.name) !== detailsEntryId.source) {\n                                return;\n                            }\n                        }\n                        else if (!skipFilter && !stringContainsCharactersInOrder(symbolName.toLowerCase(), lowerCaseTokenText_1)) {\n                            return;\n                        }\n                        var symbolId = ts.getSymbolId(symbol);\n                        symbols.push(symbol);\n                        symbolToOriginInfoMap[symbolId] = origin;\n                        symbolToSortTextMap[symbolId] = SortText.AutoImportSuggestions;\n                    });\n                }\n                filterGlobalCompletion(symbols);\n            }\n            function shouldOfferImportCompletions() {\n                // If current completion is for non-contextual Object literal shortahands, ignore auto-import symbols\n                if (isNonContextualObjectLiteral)\n                    return false;\n                // If not already a module, must have modules enabled.\n                if (!preferences.includeCompletionsForModuleExports)\n                    return false;\n                // If already using ES6 modules, OK to continue using them.\n                if (sourceFile.externalModuleIndicator || sourceFile.commonJsModuleIndicator)\n                    return true;\n                // If module transpilation is enabled or we're targeting es6 or above, or not emitting, OK.\n                if (ts.compilerOptionsIndicateEs6Modules(program.getCompilerOptions()))\n                    return true;\n                // If some file is using ES6 modules, assume that it's OK to add more.\n                return ts.programContainsModules(program);\n            }\n            function isSnippetScope(scopeNode) {\n                switch (scopeNode.kind) {\n                    case 297 /* SourceFile */:\n                    case 218 /* TemplateExpression */:\n                    case 283 /* JsxExpression */:\n                    case 230 /* Block */:\n                        return true;\n                    default:\n                        return ts.isStatement(scopeNode);\n                }\n            }\n            function filterGlobalCompletion(symbols) {\n                var isTypeOnly = isTypeOnlyCompletion();\n                if (isTypeOnly) {\n                    keywordFilters = contextToken && ts.isAssertionExpression(contextToken.parent)\n                        ? 6 /* TypeAssertionKeywords */\n                        : 7 /* TypeKeywords */;\n                }\n                var variableDeclaration = getVariableDeclaration(location);\n                ts.filterMutate(symbols, function (symbol) {\n                    if (!ts.isSourceFile(location)) {\n                        // export = /**/ here we want to get all meanings, so any symbol is ok\n                        if (ts.isExportAssignment(location.parent)) {\n                            return true;\n                        }\n                        // Filter out variables from their own initializers\n                        // `const a = /* no 'a' here */`\n                        if (variableDeclaration && symbol.valueDeclaration === variableDeclaration) {\n                            return false;\n                        }\n                        // External modules can have global export declarations that will be\n                        // available as global keywords in all scopes. But if the external module\n                        // already has an explicit export and user only wants to user explicit\n                        // module imports then the global keywords will be filtered out so auto\n                        // import suggestions will win in the completion\n                        var symbolOrigin = ts.skipAlias(symbol, typeChecker);\n                        // We only want to filter out the global keywords\n                        // Auto Imports are not available for scripts so this conditional is always false\n                        if (!!sourceFile.externalModuleIndicator\n                            && !compilerOptions.allowUmdGlobalAccess\n                            && symbolToSortTextMap[ts.getSymbolId(symbol)] === SortText.GlobalsOrKeywords\n                            && symbolToSortTextMap[ts.getSymbolId(symbolOrigin)] === SortText.AutoImportSuggestions) {\n                            return false;\n                        }\n                        // Continue with origin symbol\n                        symbol = symbolOrigin;\n                        // import m = /**/ <-- It can only access namespace (if typing import = x. this would get member symbols and not namespace)\n                        if (ts.isInRightSideOfInternalImportEqualsDeclaration(location)) {\n                            return !!(symbol.flags & 1920 /* Namespace */);\n                        }\n                        if (isTypeOnly) {\n                            // It's a type, but you can reach it by namespace.type as well\n                            return symbolCanBeReferencedAtTypeLocation(symbol);\n                        }\n                    }\n                    // expressions are value space (which includes the value namespaces)\n                    return !!(ts.getCombinedLocalAndExportSymbolFlags(symbol) & 111551 /* Value */);\n                });\n            }\n            function getVariableDeclaration(property) {\n                var variableDeclaration = ts.findAncestor(property, function (node) {\n                    return ts.isFunctionBlock(node) || isArrowFunctionBody(node) || ts.isBindingPattern(node)\n                        ? \"quit\"\n                        : ts.isVariableDeclaration(node);\n                });\n                return variableDeclaration;\n            }\n            function isArrowFunctionBody(node) {\n                return node.parent && ts.isArrowFunction(node.parent) && node.parent.body === node;\n            }\n            ;\n            function isTypeOnlyCompletion() {\n                return insideJsDocTagTypeExpression\n                    || !isContextTokenValueLocation(contextToken) &&\n                        (ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker)\n                            || ts.isPartOfTypeNode(location)\n                            || isContextTokenTypeLocation(contextToken));\n            }\n            function isContextTokenValueLocation(contextToken) {\n                return contextToken &&\n                    contextToken.kind === 111 /* TypeOfKeyword */ &&\n                    (contextToken.parent.kind === 176 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent));\n            }\n            function isContextTokenTypeLocation(contextToken) {\n                if (contextToken) {\n                    var parentKind = contextToken.parent.kind;\n                    switch (contextToken.kind) {\n                        case 58 /* ColonToken */:\n                            return parentKind === 163 /* PropertyDeclaration */ ||\n                                parentKind === 162 /* PropertySignature */ ||\n                                parentKind === 160 /* Parameter */ ||\n                                parentKind === 249 /* VariableDeclaration */ ||\n                                ts.isFunctionLikeKind(parentKind);\n                        case 62 /* EqualsToken */:\n                            return parentKind === 254 /* TypeAliasDeclaration */;\n                        case 126 /* AsKeyword */:\n                            return parentKind === 224 /* AsExpression */;\n                        case 29 /* LessThanToken */:\n                            return parentKind === 173 /* TypeReference */ ||\n                                parentKind === 206 /* TypeAssertionExpression */;\n                        case 93 /* ExtendsKeyword */:\n                            return parentKind === 159 /* TypeParameter */;\n                    }\n                }\n                return false;\n            }\n            /** True if symbol is a type or a module containing at least one type. */\n            function symbolCanBeReferencedAtTypeLocation(symbol, seenModules) {\n                if (seenModules === void 0) { seenModules = new ts.Map(); }\n                var sym = ts.skipAlias(symbol.exportSymbol || symbol, typeChecker);\n                return !!(sym.flags & 788968 /* Type */) ||\n                    !!(sym.flags & 1536 /* Module */) &&\n                        ts.addToSeen(seenModules, ts.getSymbolId(sym)) &&\n                        typeChecker.getExportsOfModule(sym).some(function (e) { return symbolCanBeReferencedAtTypeLocation(e, seenModules); });\n            }\n            /**\n             * Gathers symbols that can be imported from other files, de-duplicating along the way. Symbols can be \"duplicates\"\n             * if re-exported from another module, e.g. `export { foo } from \"./a\"`. That syntax creates a fresh symbol, but\n             * it’s just an alias to the first, and both have the same name, so we generally want to filter those aliases out,\n             * if and only if the the first can be imported (it may be excluded due to package.json filtering in\n             * `codefix.forEachExternalModuleToImportFrom`).\n             *\n             * Example. Imagine a chain of node_modules re-exporting one original symbol:\n             *\n             * ```js\n             *  node_modules/x/index.js         node_modules/y/index.js           node_modules/z/index.js\n             * +-----------------------+      +--------------------------+      +--------------------------+\n             * |                       |      |                          |      |                          |\n             * | export const foo = 0; | <--- | export { foo } from 'x'; | <--- | export { foo } from 'y'; |\n             * |                       |      |                          |      |                          |\n             * +-----------------------+      +--------------------------+      +--------------------------+\n             * ```\n             *\n             * Also imagine three buckets, which we’ll reference soon:\n             *\n             * ```md\n             * |                  |      |                      |      |                   |\n             * |   **Bucket A**   |      |    **Bucket B**      |      |    **Bucket C**   |\n             * |    Symbols to    |      | Aliases to symbols   |      | Symbols to return |\n             * |    definitely    |      | in Buckets A or C    |      | if nothing better |\n             * |      return      |      | (don’t return these) |      |    comes along    |\n             * |__________________|      |______________________|      |___________________|\n             * ```\n             *\n             * We _probably_ want to show `foo` from 'x', but not from 'y' or 'z'. However, if 'x' is not in a package.json, it\n             * will not appear in a `forEachExternalModuleToImportFrom` iteration. Furthermore, the order of iterations is not\n             * guaranteed, as it is host-dependent. Therefore, when presented with the symbol `foo` from module 'y' alone, we\n             * may not be sure whether or not it should go in the list. So, we’ll take the following steps:\n             *\n             * 1. Resolve alias `foo` from 'y' to the export declaration in 'x', get the symbol there, and see if that symbol is\n             *    already in Bucket A (symbols we already know will be returned). If it is, put `foo` from 'y' in Bucket B\n             *    (symbols that are aliases to symbols in Bucket A). If it’s not, put it in Bucket C.\n             * 2. Next, imagine we see `foo` from module 'z'. Again, we resolve the alias to the nearest export, which is in 'y'.\n             *    At this point, if that nearest export from 'y' is in _any_ of the three buckets, we know the symbol in 'z'\n             *    should never be returned in the final list, so put it in Bucket B.\n             * 3. Next, imagine we see `foo` from module 'x', the original. Syntactically, it doesn’t look like a re-export, so\n             *    we can just check Bucket C to see if we put any aliases to the original in there. If they exist, throw them out.\n             *    Put this symbol in Bucket A.\n             * 4. After we’ve iterated through every symbol of every module, any symbol left in Bucket C means that step 3 didn’t\n             *    occur for that symbol---that is, the original symbol is not in Bucket A, so we should include the alias. Move\n             *    everything from Bucket C to Bucket A.\n             */\n            function getSymbolsFromOtherSourceFileExports(target, host) {\n                var cached = importSuggestionsCache && importSuggestionsCache.get(sourceFile.fileName, typeChecker, detailsEntryId && host.getProjectVersion ? host.getProjectVersion() : undefined);\n                if (cached) {\n                    log(\"getSymbolsFromOtherSourceFileExports: Using cached list\");\n                    return cached;\n                }\n                var startTime = ts.timestamp();\n                log(\"getSymbolsFromOtherSourceFileExports: Recomputing list\" + (detailsEntryId ? \" for details entry\" : \"\"));\n                var seenResolvedModules = new ts.Map();\n                var seenExports = new ts.Map();\n                /** Bucket B */\n                var aliasesToAlreadyIncludedSymbols = new ts.Map();\n                /** Bucket C */\n                var aliasesToReturnIfOriginalsAreMissing = new ts.Map();\n                /** Bucket A */\n                var results = [];\n                /** Ids present in `results` for faster lookup */\n                var resultSymbolIds = new ts.Map();\n                ts.codefix.forEachExternalModuleToImportFrom(program, host, sourceFile, !detailsEntryId, /*useAutoImportProvider*/ true, function (moduleSymbol, _, program, isFromPackageJson) {\n                    // Perf -- ignore other modules if this is a request for details\n                    if (detailsEntryId && detailsEntryId.source && ts.stripQuotes(moduleSymbol.name) !== detailsEntryId.source) {\n                        return;\n                    }\n                    var typeChecker = program.getTypeChecker();\n                    var resolvedModuleSymbol = typeChecker.resolveExternalModuleSymbol(moduleSymbol);\n                    // resolvedModuleSymbol may be a namespace. A namespace may be `export =` by multiple module declarations, but only keep the first one.\n                    if (!ts.addToSeen(seenResolvedModules, ts.getSymbolId(resolvedModuleSymbol))) {\n                        return;\n                    }\n                    // Don't add another completion for `export =` of a symbol that's already global.\n                    // So in `declare namespace foo {} declare module \"foo\" { export = foo; }`, there will just be the global completion for `foo`.\n                    if (resolvedModuleSymbol !== moduleSymbol && ts.every(resolvedModuleSymbol.declarations, ts.isNonGlobalDeclaration)) {\n                        pushSymbol(resolvedModuleSymbol, moduleSymbol, isFromPackageJson, /*skipFilter*/ true);\n                    }\n                    for (var _i = 0, _a = typeChecker.getExportsAndPropertiesOfModule(moduleSymbol); _i < _a.length; _i++) {\n                        var symbol = _a[_i];\n                        var symbolId = ts.getSymbolId(symbol).toString();\n                        // `getExportsAndPropertiesOfModule` can include duplicates\n                        if (!ts.addToSeen(seenExports, symbolId)) {\n                            continue;\n                        }\n                        // If this is `export { _break as break };` (a keyword) -- skip this and prefer the keyword completion.\n                        if (ts.some(symbol.declarations, function (d) { return ts.isExportSpecifier(d) && !!d.propertyName && ts.isIdentifierANonContextualKeyword(d.name); })) {\n                            continue;\n                        }\n                        // If `symbol.parent !== moduleSymbol`, this is an `export * from \"foo\"` re-export. Those don't create new symbols.\n                        var isExportStarFromReExport = typeChecker.getMergedSymbol(symbol.parent) !== resolvedModuleSymbol;\n                        // If `!!d.parent.parent.moduleSpecifier`, this is `export { foo } from \"foo\"` re-export, which creates a new symbol (thus isn't caught by the first check).\n                        if (isExportStarFromReExport || ts.some(symbol.declarations, function (d) { return ts.isExportSpecifier(d) && !d.propertyName && !!d.parent.parent.moduleSpecifier; })) {\n                            // Walk the export chain back one module (step 1 or 2 in diagrammed example).\n                            // Or, in the case of `export * from \"foo\"`, `symbol` already points to the original export, so just use that.\n                            var nearestExportSymbol = isExportStarFromReExport ? symbol : getNearestExportSymbol(symbol);\n                            if (!nearestExportSymbol)\n                                continue;\n                            var nearestExportSymbolId = ts.getSymbolId(nearestExportSymbol).toString();\n                            var symbolHasBeenSeen = resultSymbolIds.has(nearestExportSymbolId) || aliasesToAlreadyIncludedSymbols.has(nearestExportSymbolId);\n                            if (!symbolHasBeenSeen) {\n                                aliasesToReturnIfOriginalsAreMissing.set(nearestExportSymbolId, { alias: symbol, moduleSymbol: moduleSymbol, isFromPackageJson: isFromPackageJson });\n                                aliasesToAlreadyIncludedSymbols.set(symbolId, true);\n                            }\n                            else {\n                                // Perf - we know this symbol is an alias to one that’s already covered in `symbols`, so store it here\n                                // in case another symbol re-exports this one; that way we can short-circuit as soon as we see this symbol id.\n                                ts.addToSeen(aliasesToAlreadyIncludedSymbols, symbolId);\n                            }\n                        }\n                        else {\n                            // This is not a re-export, so see if we have any aliases pending and remove them (step 3 in diagrammed example)\n                            aliasesToReturnIfOriginalsAreMissing.delete(symbolId);\n                            pushSymbol(symbol, moduleSymbol, isFromPackageJson, /*skipFilter*/ false);\n                        }\n                    }\n                });\n                // By this point, any potential duplicates that were actually duplicates have been\n                // removed, so the rest need to be added. (Step 4 in diagrammed example)\n                aliasesToReturnIfOriginalsAreMissing.forEach(function (_a) {\n                    var alias = _a.alias, moduleSymbol = _a.moduleSymbol, isFromPackageJson = _a.isFromPackageJson;\n                    return pushSymbol(alias, moduleSymbol, isFromPackageJson, /*skipFilter*/ false);\n                });\n                log(\"getSymbolsFromOtherSourceFileExports: \" + (ts.timestamp() - startTime));\n                return results;\n                function pushSymbol(symbol, moduleSymbol, isFromPackageJson, skipFilter) {\n                    var isDefaultExport = symbol.escapedName === \"default\" /* Default */;\n                    if (isDefaultExport) {\n                        symbol = ts.getLocalSymbolForExportDefault(symbol) || symbol;\n                    }\n                    if (typeChecker.isUndefinedSymbol(symbol)) {\n                        return;\n                    }\n                    ts.addToSeen(resultSymbolIds, ts.getSymbolId(symbol));\n                    var origin = { kind: 4 /* Export */, moduleSymbol: moduleSymbol, isDefaultExport: isDefaultExport, isFromPackageJson: isFromPackageJson };\n                    results.push({\n                        symbol: symbol,\n                        symbolName: ts.getNameForExportedSymbol(symbol, target),\n                        origin: origin,\n                        skipFilter: skipFilter,\n                    });\n                }\n            }\n            function getNearestExportSymbol(fromSymbol) {\n                return findAlias(typeChecker, fromSymbol, function (alias) {\n                    return ts.some(alias.declarations, function (d) { return ts.isExportSpecifier(d) || !!d.localSymbol; });\n                });\n            }\n            /**\n             * True if you could remove some characters in `a` to get `b`.\n             * E.g., true for \"abcdef\" and \"bdf\".\n             * But not true for \"abcdef\" and \"dbf\".\n             */\n            function stringContainsCharactersInOrder(str, characters) {\n                if (characters.length === 0) {\n                    return true;\n                }\n                var characterIndex = 0;\n                for (var strIndex = 0; strIndex < str.length; strIndex++) {\n                    if (str.charCodeAt(strIndex) === characters.charCodeAt(characterIndex)) {\n                        characterIndex++;\n                        if (characterIndex === characters.length) {\n                            return true;\n                        }\n                    }\n                }\n                // Did not find all characters\n                return false;\n            }\n            /**\n             * Finds the first node that \"embraces\" the position, so that one may\n             * accurately aggregate locals from the closest containing scope.\n             */\n            function getScopeNode(initialToken, position, sourceFile) {\n                var scope = initialToken;\n                while (scope && !ts.positionBelongsToNode(scope, position, sourceFile)) {\n                    scope = scope.parent;\n                }\n                return scope;\n            }\n            function isCompletionListBlocker(contextToken) {\n                var start = ts.timestamp();\n                var result = isInStringOrRegularExpressionOrTemplateLiteral(contextToken) ||\n                    isSolelyIdentifierDefinitionLocation(contextToken) ||\n                    isDotOfNumericLiteral(contextToken) ||\n                    isInJsxText(contextToken);\n                log(\"getCompletionsAtPosition: isCompletionListBlocker: \" + (ts.timestamp() - start));\n                return result;\n            }\n            function isInJsxText(contextToken) {\n                if (contextToken.kind === 11 /* JsxText */) {\n                    return true;\n                }\n                if (contextToken.kind === 31 /* GreaterThanToken */ && contextToken.parent) {\n                    if (contextToken.parent.kind === 275 /* JsxOpeningElement */) {\n                        // Two possibilities:\n                        //   1. <div>/**/\n                        //      - contextToken: GreaterThanToken (before cursor)\n                        //      - location: JSXElement\n                        //      - different parents (JSXOpeningElement, JSXElement)\n                        //   2. <Component<string> /**/>\n                        //      - contextToken: GreaterThanToken (before cursor)\n                        //      - location: GreaterThanToken (after cursor)\n                        //      - same parent (JSXOpeningElement)\n                        return location.parent.kind !== 275 /* JsxOpeningElement */;\n                    }\n                    if (contextToken.parent.kind === 276 /* JsxClosingElement */ || contextToken.parent.kind === 274 /* JsxSelfClosingElement */) {\n                        return !!contextToken.parent.parent && contextToken.parent.parent.kind === 273 /* JsxElement */;\n                    }\n                }\n                return false;\n            }\n            function isNewIdentifierDefinitionLocation() {\n                if (contextToken) {\n                    var containingNodeKind = contextToken.parent.kind;\n                    // Previous token may have been a keyword that was converted to an identifier.\n                    switch (keywordForNode(contextToken)) {\n                        case 27 /* CommaToken */:\n                            return containingNodeKind === 203 /* CallExpression */ // func( a, |\n                                || containingNodeKind === 166 /* Constructor */ // constructor( a, |   /* public, protected, private keywords are allowed here, so show completion */\n                                || containingNodeKind === 204 /* NewExpression */ // new C(a, |\n                                || containingNodeKind === 199 /* ArrayLiteralExpression */ // [a, |\n                                || containingNodeKind === 216 /* BinaryExpression */ // const x = (a, |\n                                || containingNodeKind === 174 /* FunctionType */ // var x: (s: string, list|\n                                || containingNodeKind === 200 /* ObjectLiteralExpression */; // const obj = { x, |\n                        case 20 /* OpenParenToken */:\n                            return containingNodeKind === 203 /* CallExpression */ // func( |\n                                || containingNodeKind === 166 /* Constructor */ // constructor( |\n                                || containingNodeKind === 204 /* NewExpression */ // new C(a|\n                                || containingNodeKind === 207 /* ParenthesizedExpression */ // const x = (a|\n                                || containingNodeKind === 186 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */\n                        case 22 /* OpenBracketToken */:\n                            return containingNodeKind === 199 /* ArrayLiteralExpression */ // [ |\n                                || containingNodeKind === 171 /* IndexSignature */ // [ | : string ]\n                                || containingNodeKind === 158 /* ComputedPropertyName */; // [ |    /* this can become an index signature */\n                        case 139 /* ModuleKeyword */: // module |\n                        case 140 /* NamespaceKeyword */: // namespace |\n                            return true;\n                        case 24 /* DotToken */:\n                            return containingNodeKind === 256 /* ModuleDeclaration */; // module A.|\n                        case 18 /* OpenBraceToken */:\n                            return containingNodeKind === 252 /* ClassDeclaration */ // class A { |\n                                || containingNodeKind === 200 /* ObjectLiteralExpression */; // const obj = { |\n                        case 62 /* EqualsToken */:\n                            return containingNodeKind === 249 /* VariableDeclaration */ // const x = a|\n                                || containingNodeKind === 216 /* BinaryExpression */; // x = a|\n                        case 15 /* TemplateHead */:\n                            return containingNodeKind === 218 /* TemplateExpression */; // `aa ${|\n                        case 16 /* TemplateMiddle */:\n                            return containingNodeKind === 228 /* TemplateSpan */; // `aa ${10} dd ${|\n                        case 122 /* PublicKeyword */:\n                        case 120 /* PrivateKeyword */:\n                        case 121 /* ProtectedKeyword */:\n                            return containingNodeKind === 163 /* PropertyDeclaration */; // class A{ public |\n                    }\n                }\n                return false;\n            }\n            function isInStringOrRegularExpressionOrTemplateLiteral(contextToken) {\n                // To be \"in\" one of these literals, the position has to be:\n                //   1. entirely within the token text.\n                //   2. at the end position of an unterminated token.\n                //   3. at the end of a regular expression (due to trailing flags like '/foo/g').\n                return (ts.isRegularExpressionLiteral(contextToken) || ts.isStringTextContainingNode(contextToken)) && (ts.rangeContainsPositionExclusive(ts.createTextRangeFromSpan(ts.createTextSpanFromNode(contextToken)), position) ||\n                    position === contextToken.end && (!!contextToken.isUnterminated || ts.isRegularExpressionLiteral(contextToken)));\n            }\n            /**\n             * Aggregates relevant symbols for completion in object literals and object binding patterns.\n             * Relevant symbols are stored in the captured 'symbols' variable.\n             *\n             * @returns true if 'symbols' was successfully populated; false otherwise.\n             */\n            function tryGetObjectLikeCompletionSymbols() {\n                var objectLikeContainer = tryGetObjectLikeCompletionContainer(contextToken);\n                if (!objectLikeContainer)\n                    return 0 /* Continue */;\n                // We're looking up possible property names from contextual/inferred/declared type.\n                completionKind = 0 /* ObjectPropertyDeclaration */;\n                var typeMembers;\n                var existingMembers;\n                if (objectLikeContainer.kind === 200 /* ObjectLiteralExpression */) {\n                    var instantiatedType = tryGetObjectLiteralContextualType(objectLikeContainer, typeChecker);\n                    // Check completions for Object property value shorthand\n                    if (instantiatedType === undefined) {\n                        if (objectLikeContainer.flags & 16777216 /* InWithStatement */) {\n                            return 2 /* Fail */;\n                        }\n                        isNonContextualObjectLiteral = true;\n                        return 0 /* Continue */;\n                    }\n                    var completionsType = typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */);\n                    var hasStringIndexType = (completionsType || instantiatedType).getStringIndexType();\n                    var hasNumberIndextype = (completionsType || instantiatedType).getNumberIndexType();\n                    isNewIdentifierLocation = !!hasStringIndexType || !!hasNumberIndextype;\n                    typeMembers = getPropertiesForObjectExpression(instantiatedType, completionsType, objectLikeContainer, typeChecker);\n                    existingMembers = objectLikeContainer.properties;\n                    if (typeMembers.length === 0) {\n                        // Edge case: If NumberIndexType exists\n                        if (!hasNumberIndextype) {\n                            isNonContextualObjectLiteral = true;\n                            return 0 /* Continue */;\n                        }\n                    }\n                }\n                else {\n                    ts.Debug.assert(objectLikeContainer.kind === 196 /* ObjectBindingPattern */);\n                    // We are *only* completing on properties from the type being destructured.\n                    isNewIdentifierLocation = false;\n                    var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent);\n                    if (!ts.isVariableLike(rootDeclaration))\n                        return ts.Debug.fail(\"Root declaration is not variable-like.\");\n                    // We don't want to complete using the type acquired by the shape\n                    // of the binding pattern; we are only interested in types acquired\n                    // through type declaration or inference.\n                    // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed -\n                    // type of parameter will flow in from the contextual type of the function\n                    var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 239 /* ForOfStatement */;\n                    if (!canGetType && rootDeclaration.kind === 160 /* Parameter */) {\n                        if (ts.isExpression(rootDeclaration.parent)) {\n                            canGetType = !!typeChecker.getContextualType(rootDeclaration.parent);\n                        }\n                        else if (rootDeclaration.parent.kind === 165 /* MethodDeclaration */ || rootDeclaration.parent.kind === 168 /* SetAccessor */) {\n                            canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent);\n                        }\n                    }\n                    if (canGetType) {\n                        var typeForObject_1 = typeChecker.getTypeAtLocation(objectLikeContainer);\n                        if (!typeForObject_1)\n                            return 2 /* Fail */;\n                        // In a binding pattern, get only known properties (unless in the same scope).\n                        // Everywhere else we will get all possible properties.\n                        var containerClass_1 = ts.getContainingClass(objectLikeContainer);\n                        typeMembers = typeChecker.getPropertiesOfType(typeForObject_1).filter(function (symbol) {\n                            // either public\n                            return !(ts.getDeclarationModifierFlagsFromSymbol(symbol) & 24 /* NonPublicAccessibilityModifier */)\n                                // or we're in it\n                                || containerClass_1 && ts.contains(typeForObject_1.symbol.declarations, containerClass_1);\n                        });\n                        existingMembers = objectLikeContainer.elements;\n                    }\n                }\n                if (typeMembers && typeMembers.length > 0) {\n                    // Add filtered items to the completion list\n                    symbols = filterObjectMembersList(typeMembers, ts.Debug.checkDefined(existingMembers));\n                }\n                setSortTextToOptionalMember();\n                return 1 /* Success */;\n            }\n            /**\n             * Aggregates relevant symbols for completion in import clauses and export clauses\n             * whose declarations have a module specifier; for instance, symbols will be aggregated for\n             *\n             *      import { | } from \"moduleName\";\n             *      export { a as foo, | } from \"moduleName\";\n             *\n             * but not for\n             *\n             *      export { | };\n             *\n             * Relevant symbols are stored in the captured 'symbols' variable.\n             */\n            function tryGetImportOrExportClauseCompletionSymbols() {\n                // `import { |` or `import { a as 0, | }`\n                var namedImportsOrExports = contextToken && (contextToken.kind === 18 /* OpenBraceToken */ || contextToken.kind === 27 /* CommaToken */)\n                    ? ts.tryCast(contextToken.parent, ts.isNamedImportsOrExports) : undefined;\n                if (!namedImportsOrExports)\n                    return 0 /* Continue */;\n                // try to show exported member for imported/re-exported module\n                var moduleSpecifier = (namedImportsOrExports.kind === 264 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier;\n                if (!moduleSpecifier)\n                    return namedImportsOrExports.kind === 264 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */;\n                var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); // TODO: GH#18217\n                if (!moduleSpecifierSymbol)\n                    return 2 /* Fail */;\n                completionKind = 3 /* MemberLike */;\n                isNewIdentifierLocation = false;\n                var exports = typeChecker.getExportsAndPropertiesOfModule(moduleSpecifierSymbol);\n                var existing = new ts.Set(namedImportsOrExports.elements.filter(function (n) { return !isCurrentlyEditingNode(n); }).map(function (n) { return (n.propertyName || n.name).escapedText; }));\n                symbols = exports.filter(function (e) { return e.escapedName !== \"default\" /* Default */ && !existing.has(e.escapedName); });\n                return 1 /* Success */;\n            }\n            /**\n             * Adds local declarations for completions in named exports:\n             *\n             *   export { | };\n             *\n             * Does not check for the absence of a module specifier (`export {} from \"./other\"`)\n             * because `tryGetImportOrExportClauseCompletionSymbols` runs first and handles that,\n             * preventing this function from running.\n             */\n            function tryGetLocalNamedExportCompletionSymbols() {\n                var _a;\n                var namedExports = contextToken && (contextToken.kind === 18 /* OpenBraceToken */ || contextToken.kind === 27 /* CommaToken */)\n                    ? ts.tryCast(contextToken.parent, ts.isNamedExports)\n                    : undefined;\n                if (!namedExports) {\n                    return 0 /* Continue */;\n                }\n                var localsContainer = ts.findAncestor(namedExports, ts.or(ts.isSourceFile, ts.isModuleDeclaration));\n                completionKind = 5 /* None */;\n                isNewIdentifierLocation = false;\n                (_a = localsContainer.locals) === null || _a === void 0 ? void 0 : _a.forEach(function (symbol, name) {\n                    var _a, _b;\n                    symbols.push(symbol);\n                    if ((_b = (_a = localsContainer.symbol) === null || _a === void 0 ? void 0 : _a.exports) === null || _b === void 0 ? void 0 : _b.has(name)) {\n                        symbolToSortTextMap[ts.getSymbolId(symbol)] = SortText.OptionalMember;\n                    }\n                });\n                return 1 /* Success */;\n            }\n            /**\n             * Aggregates relevant symbols for completion in class declaration\n             * Relevant symbols are stored in the captured 'symbols' variable.\n             */\n            function tryGetClassLikeCompletionSymbols() {\n                var decl = tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position);\n                if (!decl)\n                    return 0 /* Continue */;\n                // We're looking up possible property names from parent type.\n                completionKind = 3 /* MemberLike */;\n                // Declaring new property/method/accessor\n                isNewIdentifierLocation = true;\n                keywordFilters = contextToken.kind === 41 /* AsteriskToken */ ? 0 /* None */ :\n                    ts.isClassLike(decl) ? 2 /* ClassElementKeywords */ : 3 /* InterfaceElementKeywords */;\n                // If you're in an interface you don't want to repeat things from super-interface. So just stop here.\n                if (!ts.isClassLike(decl))\n                    return 1 /* Success */;\n                var classElement = contextToken.kind === 26 /* SemicolonToken */ ? contextToken.parent.parent : contextToken.parent;\n                var classElementModifierFlags = ts.isClassElement(classElement) ? ts.getEffectiveModifierFlags(classElement) : 0 /* None */;\n                // If this is context token is not something we are editing now, consider if this would lead to be modifier\n                if (contextToken.kind === 78 /* Identifier */ && !isCurrentlyEditingNode(contextToken)) {\n                    switch (contextToken.getText()) {\n                        case \"private\":\n                            classElementModifierFlags = classElementModifierFlags | 8 /* Private */;\n                            break;\n                        case \"static\":\n                            classElementModifierFlags = classElementModifierFlags | 32 /* Static */;\n                            break;\n                    }\n                }\n                // No member list for private methods\n                if (!(classElementModifierFlags & 8 /* Private */)) {\n                    // List of property symbols of base type that are not private and already implemented\n                    var baseSymbols = ts.flatMap(ts.getAllSuperTypeNodes(decl), function (baseTypeNode) {\n                        var type = typeChecker.getTypeAtLocation(baseTypeNode);\n                        return classElementModifierFlags & 32 /* Static */ ?\n                            (type === null || type === void 0 ? void 0 : type.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl)) :\n                            type && typeChecker.getPropertiesOfType(type);\n                    });\n                    symbols = filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags);\n                }\n                return 1 /* Success */;\n            }\n            /**\n             * Returns the immediate owning object literal or binding pattern of a context token,\n             * on the condition that one exists and that the context implies completion should be given.\n             */\n            function tryGetObjectLikeCompletionContainer(contextToken) {\n                if (contextToken) {\n                    var parent = contextToken.parent;\n                    switch (contextToken.kind) {\n                        case 18 /* OpenBraceToken */: // const x = { |\n                        case 27 /* CommaToken */: // const x = { a: 0, |\n                            if (ts.isObjectLiteralExpression(parent) || ts.isObjectBindingPattern(parent)) {\n                                return parent;\n                            }\n                            break;\n                        case 41 /* AsteriskToken */:\n                            return ts.isMethodDeclaration(parent) ? ts.tryCast(parent.parent, ts.isObjectLiteralExpression) : undefined;\n                        case 78 /* Identifier */:\n                            return contextToken.text === \"async\" && ts.isShorthandPropertyAssignment(contextToken.parent)\n                                ? contextToken.parent.parent : undefined;\n                    }\n                }\n                return undefined;\n            }\n            function isConstructorParameterCompletion(node) {\n                return !!node.parent && ts.isParameter(node.parent) && ts.isConstructorDeclaration(node.parent.parent)\n                    && (ts.isParameterPropertyModifier(node.kind) || ts.isDeclarationName(node));\n            }\n            /**\n             * Returns the immediate owning class declaration of a context token,\n             * on the condition that one exists and that the context implies completion should be given.\n             */\n            function tryGetConstructorLikeCompletionContainer(contextToken) {\n                if (contextToken) {\n                    var parent = contextToken.parent;\n                    switch (contextToken.kind) {\n                        case 20 /* OpenParenToken */:\n                        case 27 /* CommaToken */:\n                            return ts.isConstructorDeclaration(contextToken.parent) ? contextToken.parent : undefined;\n                        default:\n                            if (isConstructorParameterCompletion(contextToken)) {\n                                return parent.parent;\n                            }\n                    }\n                }\n                return undefined;\n            }\n            function tryGetFunctionLikeBodyCompletionContainer(contextToken) {\n                if (contextToken) {\n                    var prev_1;\n                    var container = ts.findAncestor(contextToken.parent, function (node) {\n                        if (ts.isClassLike(node)) {\n                            return \"quit\";\n                        }\n                        if (ts.isFunctionLikeDeclaration(node) && prev_1 === node.body) {\n                            return true;\n                        }\n                        prev_1 = node;\n                        return false;\n                    });\n                    return container && container;\n                }\n            }\n            function tryGetContainingJsxElement(contextToken) {\n                if (contextToken) {\n                    var parent = contextToken.parent;\n                    switch (contextToken.kind) {\n                        case 31 /* GreaterThanToken */: // End of a type argument list\n                        case 30 /* LessThanSlashToken */:\n                        case 43 /* SlashToken */:\n                        case 78 /* Identifier */:\n                        case 201 /* PropertyAccessExpression */:\n                        case 281 /* JsxAttributes */:\n                        case 280 /* JsxAttribute */:\n                        case 282 /* JsxSpreadAttribute */:\n                            if (parent && (parent.kind === 274 /* JsxSelfClosingElement */ || parent.kind === 275 /* JsxOpeningElement */)) {\n                                if (contextToken.kind === 31 /* GreaterThanToken */) {\n                                    var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined);\n                                    if (!parent.typeArguments || (precedingToken && precedingToken.kind === 43 /* SlashToken */))\n                                        break;\n                                }\n                                return parent;\n                            }\n                            else if (parent.kind === 280 /* JsxAttribute */) {\n                                // Currently we parse JsxOpeningLikeElement as:\n                                //      JsxOpeningLikeElement\n                                //          attributes: JsxAttributes\n                                //             properties: NodeArray<JsxAttributeLike>\n                                return parent.parent.parent;\n                            }\n                            break;\n                        // The context token is the closing } or \" of an attribute, which means\n                        // its parent is a JsxExpression, whose parent is a JsxAttribute,\n                        // whose parent is a JsxOpeningLikeElement\n                        case 10 /* StringLiteral */:\n                            if (parent && ((parent.kind === 280 /* JsxAttribute */) || (parent.kind === 282 /* JsxSpreadAttribute */))) {\n                                // Currently we parse JsxOpeningLikeElement as:\n                                //      JsxOpeningLikeElement\n                                //          attributes: JsxAttributes\n                                //             properties: NodeArray<JsxAttributeLike>\n                                return parent.parent.parent;\n                            }\n                            break;\n                        case 19 /* CloseBraceToken */:\n                            if (parent &&\n                                parent.kind === 283 /* JsxExpression */ &&\n                                parent.parent && parent.parent.kind === 280 /* JsxAttribute */) {\n                                // Currently we parse JsxOpeningLikeElement as:\n                                //      JsxOpeningLikeElement\n                                //          attributes: JsxAttributes\n                                //             properties: NodeArray<JsxAttributeLike>\n                                //                  each JsxAttribute can have initializer as JsxExpression\n                                return parent.parent.parent.parent;\n                            }\n                            if (parent && parent.kind === 282 /* JsxSpreadAttribute */) {\n                                // Currently we parse JsxOpeningLikeElement as:\n                                //      JsxOpeningLikeElement\n                                //          attributes: JsxAttributes\n                                //             properties: NodeArray<JsxAttributeLike>\n                                return parent.parent.parent;\n                            }\n                            break;\n                    }\n                }\n                return undefined;\n            }\n            /**\n             * @returns true if we are certain that the currently edited location must define a new location; false otherwise.\n             */\n            function isSolelyIdentifierDefinitionLocation(contextToken) {\n                var parent = contextToken.parent;\n                var containingNodeKind = parent.kind;\n                switch (contextToken.kind) {\n                    case 27 /* CommaToken */:\n                        return containingNodeKind === 249 /* VariableDeclaration */ ||\n                            isVariableDeclarationListButNotTypeArgument(contextToken) ||\n                            containingNodeKind === 232 /* VariableStatement */ ||\n                            containingNodeKind === 255 /* EnumDeclaration */ || // enum a { foo, |\n                            isFunctionLikeButNotConstructor(containingNodeKind) ||\n                            containingNodeKind === 253 /* InterfaceDeclaration */ || // interface A<T, |\n                            containingNodeKind === 197 /* ArrayBindingPattern */ || // var [x, y|\n                            containingNodeKind === 254 /* TypeAliasDeclaration */ || // type Map, K, |\n                            // class A<T, |\n                            // var C = class D<T, |\n                            (ts.isClassLike(parent) &&\n                                !!parent.typeParameters &&\n                                parent.typeParameters.end >= contextToken.pos);\n                    case 24 /* DotToken */:\n                        return containingNodeKind === 197 /* ArrayBindingPattern */; // var [.|\n                    case 58 /* ColonToken */:\n                        return containingNodeKind === 198 /* BindingElement */; // var {x :html|\n                    case 22 /* OpenBracketToken */:\n                        return containingNodeKind === 197 /* ArrayBindingPattern */; // var [x|\n                    case 20 /* OpenParenToken */:\n                        return containingNodeKind === 287 /* CatchClause */ ||\n                            isFunctionLikeButNotConstructor(containingNodeKind);\n                    case 18 /* OpenBraceToken */:\n                        return containingNodeKind === 255 /* EnumDeclaration */; // enum a { |\n                    case 29 /* LessThanToken */:\n                        return containingNodeKind === 252 /* ClassDeclaration */ || // class A< |\n                            containingNodeKind === 221 /* ClassExpression */ || // var C = class D< |\n                            containingNodeKind === 253 /* InterfaceDeclaration */ || // interface A< |\n                            containingNodeKind === 254 /* TypeAliasDeclaration */ || // type List< |\n                            ts.isFunctionLikeKind(containingNodeKind);\n                    case 123 /* StaticKeyword */:\n                        return containingNodeKind === 163 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent);\n                    case 25 /* DotDotDotToken */:\n                        return containingNodeKind === 160 /* Parameter */ ||\n                            (!!parent.parent && parent.parent.kind === 197 /* ArrayBindingPattern */); // var [...z|\n                    case 122 /* PublicKeyword */:\n                    case 120 /* PrivateKeyword */:\n                    case 121 /* ProtectedKeyword */:\n                        return containingNodeKind === 160 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent);\n                    case 126 /* AsKeyword */:\n                        return containingNodeKind === 265 /* ImportSpecifier */ ||\n                            containingNodeKind === 270 /* ExportSpecifier */ ||\n                            containingNodeKind === 263 /* NamespaceImport */;\n                    case 134 /* GetKeyword */:\n                    case 146 /* SetKeyword */:\n                        return !isFromObjectTypeDeclaration(contextToken);\n                    case 83 /* ClassKeyword */:\n                    case 91 /* EnumKeyword */:\n                    case 117 /* InterfaceKeyword */:\n                    case 97 /* FunctionKeyword */:\n                    case 112 /* VarKeyword */:\n                    case 99 /* ImportKeyword */:\n                    case 118 /* LetKeyword */:\n                    case 84 /* ConstKeyword */:\n                    case 135 /* InferKeyword */:\n                    case 149 /* TypeKeyword */: // type htm|\n                        return true;\n                    case 41 /* AsteriskToken */:\n                        return ts.isFunctionLike(contextToken.parent) && !ts.isMethodDeclaration(contextToken.parent);\n                }\n                // If the previous token is keyword correspoding to class member completion keyword\n                // there will be completion available here\n                if (isClassMemberCompletionKeyword(keywordForNode(contextToken)) && isFromObjectTypeDeclaration(contextToken)) {\n                    return false;\n                }\n                if (isConstructorParameterCompletion(contextToken)) {\n                    // constructor parameter completion is available only if\n                    // - its modifier of the constructor parameter or\n                    // - its name of the parameter and not being edited\n                    // eg. constructor(a |<- this shouldnt show completion\n                    if (!ts.isIdentifier(contextToken) ||\n                        ts.isParameterPropertyModifier(keywordForNode(contextToken)) ||\n                        isCurrentlyEditingNode(contextToken)) {\n                        return false;\n                    }\n                }\n                // Previous token may have been a keyword that was converted to an identifier.\n                switch (keywordForNode(contextToken)) {\n                    case 125 /* AbstractKeyword */:\n                    case 83 /* ClassKeyword */:\n                    case 84 /* ConstKeyword */:\n                    case 133 /* DeclareKeyword */:\n                    case 91 /* EnumKeyword */:\n                    case 97 /* FunctionKeyword */:\n                    case 117 /* InterfaceKeyword */:\n                    case 118 /* LetKeyword */:\n                    case 120 /* PrivateKeyword */:\n                    case 121 /* ProtectedKeyword */:\n                    case 122 /* PublicKeyword */:\n                    case 123 /* StaticKeyword */:\n                    case 112 /* VarKeyword */:\n                        return true;\n                    case 129 /* AsyncKeyword */:\n                        return ts.isPropertyDeclaration(contextToken.parent);\n                }\n                return ts.isDeclarationName(contextToken)\n                    && !ts.isShorthandPropertyAssignment(contextToken.parent)\n                    && !ts.isJsxAttribute(contextToken.parent)\n                    // Don't block completions if we're in `class C /**/`, because we're *past* the end of the identifier and might want to complete `extends`.\n                    // If `contextToken !== previousToken`, this is `class C ex/**/`.\n                    && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end));\n            }\n            function isFunctionLikeButNotConstructor(kind) {\n                return ts.isFunctionLikeKind(kind) && kind !== 166 /* Constructor */;\n            }\n            function isDotOfNumericLiteral(contextToken) {\n                if (contextToken.kind === 8 /* NumericLiteral */) {\n                    var text = contextToken.getFullText();\n                    return text.charAt(text.length - 1) === \".\";\n                }\n                return false;\n            }\n            function isVariableDeclarationListButNotTypeArgument(node) {\n                return node.parent.kind === 250 /* VariableDeclarationList */\n                    && !ts.isPossiblyTypeArgumentPosition(node, sourceFile, typeChecker);\n            }\n            /**\n             * Filters out completion suggestions for named imports or exports.\n             *\n             * @returns Symbols to be suggested in an object binding pattern or object literal expression, barring those whose declarations\n             *          do not occur at the current position and have not otherwise been typed.\n             */\n            function filterObjectMembersList(contextualMemberSymbols, existingMembers) {\n                if (existingMembers.length === 0) {\n                    return contextualMemberSymbols;\n                }\n                var membersDeclaredBySpreadAssignment = new ts.Set();\n                var existingMemberNames = new ts.Set();\n                for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) {\n                    var m = existingMembers_1[_i];\n                    // Ignore omitted expressions for missing members\n                    if (m.kind !== 288 /* PropertyAssignment */ &&\n                        m.kind !== 289 /* ShorthandPropertyAssignment */ &&\n                        m.kind !== 198 /* BindingElement */ &&\n                        m.kind !== 165 /* MethodDeclaration */ &&\n                        m.kind !== 167 /* GetAccessor */ &&\n                        m.kind !== 168 /* SetAccessor */ &&\n                        m.kind !== 290 /* SpreadAssignment */) {\n                        continue;\n                    }\n                    // If this is the current item we are editing right now, do not filter it out\n                    if (isCurrentlyEditingNode(m)) {\n                        continue;\n                    }\n                    var existingName = void 0;\n                    if (ts.isSpreadAssignment(m)) {\n                        setMembersDeclaredBySpreadAssignment(m, membersDeclaredBySpreadAssignment);\n                    }\n                    else if (ts.isBindingElement(m) && m.propertyName) {\n                        // include only identifiers in completion list\n                        if (m.propertyName.kind === 78 /* Identifier */) {\n                            existingName = m.propertyName.escapedText;\n                        }\n                    }\n                    else {\n                        // TODO: Account for computed property name\n                        // NOTE: if one only performs this step when m.name is an identifier,\n                        // things like '__proto__' are not filtered out.\n                        var name = ts.getNameOfDeclaration(m);\n                        existingName = name && ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined;\n                    }\n                    if (existingName !== undefined) {\n                        existingMemberNames.add(existingName);\n                    }\n                }\n                var filteredSymbols = contextualMemberSymbols.filter(function (m) { return !existingMemberNames.has(m.escapedName); });\n                setSortTextToMemberDeclaredBySpreadAssignment(membersDeclaredBySpreadAssignment, filteredSymbols);\n                return filteredSymbols;\n            }\n            function setMembersDeclaredBySpreadAssignment(declaration, membersDeclaredBySpreadAssignment) {\n                var expression = declaration.expression;\n                var symbol = typeChecker.getSymbolAtLocation(expression);\n                var type = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, expression);\n                var properties = type && type.properties;\n                if (properties) {\n                    properties.forEach(function (property) {\n                        membersDeclaredBySpreadAssignment.add(property.name);\n                    });\n                }\n            }\n            // Set SortText to OptionalMember if it is an optional member\n            function setSortTextToOptionalMember() {\n                symbols.forEach(function (m) {\n                    if (m.flags & 16777216 /* Optional */) {\n                        symbolToSortTextMap[ts.getSymbolId(m)] = symbolToSortTextMap[ts.getSymbolId(m)] || SortText.OptionalMember;\n                    }\n                });\n            }\n            // Set SortText to MemberDeclaredBySpreadAssignment if it is fulfilled by spread assignment\n            function setSortTextToMemberDeclaredBySpreadAssignment(membersDeclaredBySpreadAssignment, contextualMemberSymbols) {\n                if (membersDeclaredBySpreadAssignment.size === 0) {\n                    return;\n                }\n                for (var _i = 0, contextualMemberSymbols_1 = contextualMemberSymbols; _i < contextualMemberSymbols_1.length; _i++) {\n                    var contextualMemberSymbol = contextualMemberSymbols_1[_i];\n                    if (membersDeclaredBySpreadAssignment.has(contextualMemberSymbol.name)) {\n                        symbolToSortTextMap[ts.getSymbolId(contextualMemberSymbol)] = SortText.MemberDeclaredBySpreadAssignment;\n                    }\n                }\n            }\n            /**\n             * Filters out completion suggestions for class elements.\n             *\n             * @returns Symbols to be suggested in an class element depending on existing memebers and symbol flags\n             */\n            function filterClassMembersList(baseSymbols, existingMembers, currentClassElementModifierFlags) {\n                var existingMemberNames = new ts.Set();\n                for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) {\n                    var m = existingMembers_2[_i];\n                    // Ignore omitted expressions for missing members\n                    if (m.kind !== 163 /* PropertyDeclaration */ &&\n                        m.kind !== 165 /* MethodDeclaration */ &&\n                        m.kind !== 167 /* GetAccessor */ &&\n                        m.kind !== 168 /* SetAccessor */) {\n                        continue;\n                    }\n                    // If this is the current item we are editing right now, do not filter it out\n                    if (isCurrentlyEditingNode(m)) {\n                        continue;\n                    }\n                    // Dont filter member even if the name matches if it is declared private in the list\n                    if (ts.hasEffectiveModifier(m, 8 /* Private */)) {\n                        continue;\n                    }\n                    // do not filter it out if the static presence doesnt match\n                    if (ts.hasEffectiveModifier(m, 32 /* Static */) !== !!(currentClassElementModifierFlags & 32 /* Static */)) {\n                        continue;\n                    }\n                    var existingName = ts.getPropertyNameForPropertyNameNode(m.name);\n                    if (existingName) {\n                        existingMemberNames.add(existingName);\n                    }\n                }\n                return baseSymbols.filter(function (propertySymbol) {\n                    return !existingMemberNames.has(propertySymbol.escapedName) &&\n                        !!propertySymbol.declarations &&\n                        !(ts.getDeclarationModifierFlagsFromSymbol(propertySymbol) & 8 /* Private */) &&\n                        !(propertySymbol.valueDeclaration && ts.isPrivateIdentifierPropertyDeclaration(propertySymbol.valueDeclaration));\n                });\n            }\n            /**\n             * Filters out completion suggestions from 'symbols' according to existing JSX attributes.\n             *\n             * @returns Symbols to be suggested in a JSX element, barring those whose attributes\n             *          do not occur at the current position and have not otherwise been typed.\n             */\n            function filterJsxAttributes(symbols, attributes) {\n                var seenNames = new ts.Set();\n                var membersDeclaredBySpreadAssignment = new ts.Set();\n                for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {\n                    var attr = attributes_1[_i];\n                    // If this is the current item we are editing right now, do not filter it out\n                    if (isCurrentlyEditingNode(attr)) {\n                        continue;\n                    }\n                    if (attr.kind === 280 /* JsxAttribute */) {\n                        seenNames.add(attr.name.escapedText);\n                    }\n                    else if (ts.isJsxSpreadAttribute(attr)) {\n                        setMembersDeclaredBySpreadAssignment(attr, membersDeclaredBySpreadAssignment);\n                    }\n                }\n                var filteredSymbols = symbols.filter(function (a) { return !seenNames.has(a.escapedName); });\n                setSortTextToMemberDeclaredBySpreadAssignment(membersDeclaredBySpreadAssignment, filteredSymbols);\n                return filteredSymbols;\n            }\n            function isCurrentlyEditingNode(node) {\n                return node.getStart(sourceFile) <= position && position <= node.getEnd();\n            }\n        }\n        function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, jsxIdentifierExpected) {\n            var name = originIsExport(origin) ? ts.getNameForExportedSymbol(symbol, target) : symbol.name;\n            if (name === undefined\n                // If the symbol is external module, don't show it in the completion list\n                // (i.e declare module \"http\" { const x; } | // <= request completion here, \"http\" should not be there)\n                || symbol.flags & 1536 /* Module */ && ts.isSingleOrDoubleQuote(name.charCodeAt(0))\n                // If the symbol is the internal name of an ES symbol, it is not a valid entry. Internal names for ES symbols start with \"__@\"\n                || ts.isKnownSymbol(symbol)) {\n                return undefined;\n            }\n            var validNameResult = { name: name, needsConvertPropertyAccess: false };\n            if (ts.isIdentifierText(name, target, jsxIdentifierExpected ? 1 /* JSX */ : 0 /* Standard */) || symbol.valueDeclaration && ts.isPrivateIdentifierPropertyDeclaration(symbol.valueDeclaration)) {\n                return validNameResult;\n            }\n            switch (kind) {\n                case 3 /* MemberLike */:\n                    return undefined;\n                case 0 /* ObjectPropertyDeclaration */:\n                    // TODO: GH#18169\n                    return { name: JSON.stringify(name), needsConvertPropertyAccess: false };\n                case 2 /* PropertyAccess */:\n                case 1 /* Global */: // For a 'this.' completion it will be in a global context, but may have a non-identifier name.\n                    // Don't add a completion for a name starting with a space. See https://github.com/Microsoft/TypeScript/pull/20547\n                    return name.charCodeAt(0) === 32 /* space */ ? undefined : { name: name, needsConvertPropertyAccess: true };\n                case 5 /* None */:\n                case 4 /* String */:\n                    return validNameResult;\n                default:\n                    ts.Debug.assertNever(kind);\n            }\n        }\n        // A cache of completion entries for keywords, these do not change between sessions\n        var _keywordCompletions = [];\n        var allKeywordsCompletions = ts.memoize(function () {\n            var res = [];\n            for (var i = 80 /* FirstKeyword */; i <= 156 /* LastKeyword */; i++) {\n                res.push({\n                    name: ts.tokenToString(i),\n                    kind: \"keyword\" /* keyword */,\n                    kindModifiers: \"\" /* none */,\n                    sortText: SortText.GlobalsOrKeywords\n                });\n            }\n            return res;\n        });\n        function getKeywordCompletions(keywordFilter, filterOutTsOnlyKeywords) {\n            if (!filterOutTsOnlyKeywords)\n                return getTypescriptKeywordCompletions(keywordFilter);\n            var index = keywordFilter + 7 /* Last */ + 1;\n            return _keywordCompletions[index] ||\n                (_keywordCompletions[index] = getTypescriptKeywordCompletions(keywordFilter)\n                    .filter(function (entry) { return !isTypeScriptOnlyKeyword(ts.stringToToken(entry.name)); }));\n        }\n        function getTypescriptKeywordCompletions(keywordFilter) {\n            return _keywordCompletions[keywordFilter] || (_keywordCompletions[keywordFilter] = allKeywordsCompletions().filter(function (entry) {\n                var kind = ts.stringToToken(entry.name);\n                switch (keywordFilter) {\n                    case 0 /* None */:\n                        return false;\n                    case 1 /* All */:\n                        return isFunctionLikeBodyKeyword(kind)\n                            || kind === 133 /* DeclareKeyword */\n                            || kind === 139 /* ModuleKeyword */\n                            || kind === 149 /* TypeKeyword */\n                            || kind === 140 /* NamespaceKeyword */\n                            || ts.isTypeKeyword(kind) && kind !== 150 /* UndefinedKeyword */;\n                    case 5 /* FunctionLikeBodyKeywords */:\n                        return isFunctionLikeBodyKeyword(kind);\n                    case 2 /* ClassElementKeywords */:\n                        return isClassMemberCompletionKeyword(kind);\n                    case 3 /* InterfaceElementKeywords */:\n                        return isInterfaceOrTypeLiteralCompletionKeyword(kind);\n                    case 4 /* ConstructorParameterKeywords */:\n                        return ts.isParameterPropertyModifier(kind);\n                    case 6 /* TypeAssertionKeywords */:\n                        return ts.isTypeKeyword(kind) || kind === 84 /* ConstKeyword */;\n                    case 7 /* TypeKeywords */:\n                        return ts.isTypeKeyword(kind);\n                    default:\n                        return ts.Debug.assertNever(keywordFilter);\n                }\n            }));\n        }\n        function isTypeScriptOnlyKeyword(kind) {\n            switch (kind) {\n                case 125 /* AbstractKeyword */:\n                case 128 /* AnyKeyword */:\n                case 155 /* BigIntKeyword */:\n                case 131 /* BooleanKeyword */:\n                case 133 /* DeclareKeyword */:\n                case 91 /* EnumKeyword */:\n                case 154 /* GlobalKeyword */:\n                case 116 /* ImplementsKeyword */:\n                case 135 /* InferKeyword */:\n                case 117 /* InterfaceKeyword */:\n                case 137 /* IsKeyword */:\n                case 138 /* KeyOfKeyword */:\n                case 139 /* ModuleKeyword */:\n                case 140 /* NamespaceKeyword */:\n                case 141 /* NeverKeyword */:\n                case 144 /* NumberKeyword */:\n                case 145 /* ObjectKeyword */:\n                case 120 /* PrivateKeyword */:\n                case 121 /* ProtectedKeyword */:\n                case 122 /* PublicKeyword */:\n                case 142 /* ReadonlyKeyword */:\n                case 147 /* StringKeyword */:\n                case 148 /* SymbolKeyword */:\n                case 149 /* TypeKeyword */:\n                case 151 /* UniqueKeyword */:\n                case 152 /* UnknownKeyword */:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n        function isInterfaceOrTypeLiteralCompletionKeyword(kind) {\n            return kind === 142 /* ReadonlyKeyword */;\n        }\n        function isClassMemberCompletionKeyword(kind) {\n            switch (kind) {\n                case 125 /* AbstractKeyword */:\n                case 132 /* ConstructorKeyword */:\n                case 134 /* GetKeyword */:\n                case 146 /* SetKeyword */:\n                case 129 /* AsyncKeyword */:\n                case 133 /* DeclareKeyword */:\n                    return true;\n                default:\n                    return ts.isClassMemberModifier(kind);\n            }\n        }\n        function isFunctionLikeBodyKeyword(kind) {\n            return kind === 129 /* AsyncKeyword */\n                || kind === 130 /* AwaitKeyword */\n                || kind === 126 /* AsKeyword */\n                || !ts.isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind);\n        }\n        function keywordForNode(node) {\n            return ts.isIdentifier(node) ? node.originalKeywordKind || 0 /* Unknown */ : node.kind;\n        }\n        /** Get the corresponding JSDocTag node if the position is in a jsDoc comment */\n        function getJsDocTagAtPosition(node, position) {\n            var jsdoc = ts.findAncestor(node, ts.isJSDoc);\n            return jsdoc && jsdoc.tags && (ts.rangeContainsPosition(jsdoc, position) ? ts.findLast(jsdoc.tags, function (tag) { return tag.pos < position; }) : undefined);\n        }\n        function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) {\n            var hasCompletionsType = completionsType && completionsType !== contextualType;\n            var type = hasCompletionsType && !(completionsType.flags & 3 /* AnyOrUnknown */)\n                ? checker.getUnionType([contextualType, completionsType])\n                : contextualType;\n            var properties = type.isUnion()\n                ? checker.getAllPossiblePropertiesOfTypes(type.types.filter(function (memberType) {\n                    // If we're providing completions for an object literal, skip primitive, array-like, or callable types since those shouldn't be implemented by object literals.\n                    return !(memberType.flags & 131068 /* Primitive */ ||\n                        checker.isArrayLikeType(memberType) ||\n                        ts.typeHasCallOrConstructSignatures(memberType, checker) ||\n                        checker.isTypeInvalidDueToUnionDiscriminant(memberType, obj));\n                }))\n                : type.getApparentProperties();\n            return hasCompletionsType ? properties.filter(hasDeclarationOtherThanSelf) : properties;\n            // Filter out members whose only declaration is the object literal itself to avoid\n            // self-fulfilling completions like:\n            //\n            // function f<T>(x: T) {}\n            // f({ abc/**/: \"\" }) // `abc` is a member of `T` but only because it declares itself\n            function hasDeclarationOtherThanSelf(member) {\n                return ts.some(member.declarations, function (decl) { return decl.parent !== obj; });\n            }\n        }\n        Completions.getPropertiesForObjectExpression = getPropertiesForObjectExpression;\n        /**\n         * Gets all properties on a type, but if that type is a union of several types,\n         * excludes array-like types or callable/constructable types.\n         */\n        function getPropertiesForCompletion(type, checker) {\n            return type.isUnion()\n                ? ts.Debug.checkEachDefined(checker.getAllPossiblePropertiesOfTypes(type.types), \"getAllPossiblePropertiesOfTypes() should all be defined\")\n                : ts.Debug.checkEachDefined(type.getApparentProperties(), \"getApparentProperties() should all be defined\");\n        }\n        /**\n         * Returns the immediate owning class declaration of a context token,\n         * on the condition that one exists and that the context implies completion should be given.\n         */\n        function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) {\n            // class c { method() { } | method2() { } }\n            switch (location.kind) {\n                case 334 /* SyntaxList */:\n                    return ts.tryCast(location.parent, ts.isObjectTypeDeclaration);\n                case 1 /* EndOfFileToken */:\n                    var cls = ts.tryCast(ts.lastOrUndefined(ts.cast(location.parent, ts.isSourceFile).statements), ts.isObjectTypeDeclaration);\n                    if (cls && !ts.findChildOfKind(cls, 19 /* CloseBraceToken */, sourceFile)) {\n                        return cls;\n                    }\n                    break;\n                case 78 /* Identifier */: {\n                    // class c { public prop = c| }\n                    if (ts.isPropertyDeclaration(location.parent) && location.parent.initializer === location) {\n                        return undefined;\n                    }\n                    // class c extends React.Component { a: () => 1\\n compon| }\n                    if (isFromObjectTypeDeclaration(location)) {\n                        return ts.findAncestor(location, ts.isObjectTypeDeclaration);\n                    }\n                }\n            }\n            if (!contextToken)\n                return undefined;\n            switch (contextToken.kind) {\n                case 62 /* EqualsToken */: // class c { public prop = | /* global completions */ }\n                    return undefined;\n                case 26 /* SemicolonToken */: // class c {getValue(): number; | }\n                case 19 /* CloseBraceToken */: // class c { method() { } | }\n                    // class c { method() { } b| }\n                    return isFromObjectTypeDeclaration(location) && location.parent.name === location\n                        ? location.parent.parent\n                        : ts.tryCast(location, ts.isObjectTypeDeclaration);\n                case 18 /* OpenBraceToken */: // class c { |\n                case 27 /* CommaToken */: // class c {getValue(): number, | }\n                    return ts.tryCast(contextToken.parent, ts.isObjectTypeDeclaration);\n                default:\n                    if (!isFromObjectTypeDeclaration(contextToken)) {\n                        // class c extends React.Component { a: () => 1\\n| }\n                        if (ts.getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line !== ts.getLineAndCharacterOfPosition(sourceFile, position).line && ts.isObjectTypeDeclaration(location)) {\n                            return location;\n                        }\n                        return undefined;\n                    }\n                    var isValidKeyword = ts.isClassLike(contextToken.parent.parent) ? isClassMemberCompletionKeyword : isInterfaceOrTypeLiteralCompletionKeyword;\n                    return (isValidKeyword(contextToken.kind) || contextToken.kind === 41 /* AsteriskToken */ || ts.isIdentifier(contextToken) && isValidKeyword(ts.stringToToken(contextToken.text))) // TODO: GH#18217\n                        ? contextToken.parent.parent : undefined;\n            }\n        }\n        // TODO: GH#19856 Would like to return `node is Node & { parent: (ClassElement | TypeElement) & { parent: ObjectTypeDeclaration } }` but then compilation takes > 10 minutes\n        function isFromObjectTypeDeclaration(node) {\n            return node.parent && ts.isClassOrTypeElement(node.parent) && ts.isObjectTypeDeclaration(node.parent.parent);\n        }\n        function isValidTrigger(sourceFile, triggerCharacter, contextToken, position) {\n            switch (triggerCharacter) {\n                case \".\":\n                case \"@\":\n                    return true;\n                case '\"':\n                case \"'\":\n                case \"`\":\n                    // Only automatically bring up completions if this is an opening quote.\n                    return !!contextToken && ts.isStringLiteralOrTemplate(contextToken) && position === contextToken.getStart(sourceFile) + 1;\n                case \"#\":\n                    return !!contextToken && ts.isPrivateIdentifier(contextToken) && !!ts.getContainingClass(contextToken);\n                case \"<\":\n                    // Opening JSX tag\n                    return !!contextToken && contextToken.kind === 29 /* LessThanToken */ && (!ts.isBinaryExpression(contextToken.parent) || binaryExpressionMayBeOpenTag(contextToken.parent));\n                case \"/\":\n                    return !!contextToken && (ts.isStringLiteralLike(contextToken)\n                        ? !!ts.tryGetImportFromModuleSpecifier(contextToken)\n                        : contextToken.kind === 43 /* SlashToken */ && ts.isJsxClosingElement(contextToken.parent));\n                default:\n                    return ts.Debug.assertNever(triggerCharacter);\n            }\n        }\n        function binaryExpressionMayBeOpenTag(_a) {\n            var left = _a.left;\n            return ts.nodeIsMissing(left);\n        }\n        function findAlias(typeChecker, symbol, predicate) {\n            var currentAlias = symbol;\n            while (currentAlias.flags & 2097152 /* Alias */ && (currentAlias = typeChecker.getImmediateAliasedSymbol(currentAlias))) {\n                if (predicate(currentAlias)) {\n                    return currentAlias;\n                }\n            }\n        }\n        /** Determines if a type is exactly the same type resolved by the global 'self', 'global', or 'globalThis'. */\n        function isProbablyGlobalType(type, sourceFile, checker) {\n            // The type of `self` and `window` is the same in lib.dom.d.ts, but `window` does not exist in\n            // lib.webworker.d.ts, so checking against `self` is also a check against `window` when it exists.\n            var selfSymbol = checker.resolveName(\"self\", /*location*/ undefined, 111551 /* Value */, /*excludeGlobals*/ false);\n            if (selfSymbol && checker.getTypeOfSymbolAtLocation(selfSymbol, sourceFile) === type) {\n                return true;\n            }\n            var globalSymbol = checker.resolveName(\"global\", /*location*/ undefined, 111551 /* Value */, /*excludeGlobals*/ false);\n            if (globalSymbol && checker.getTypeOfSymbolAtLocation(globalSymbol, sourceFile) === type) {\n                return true;\n            }\n            var globalThisSymbol = checker.resolveName(\"globalThis\", /*location*/ undefined, 111551 /* Value */, /*excludeGlobals*/ false);\n            if (globalThisSymbol && checker.getTypeOfSymbolAtLocation(globalThisSymbol, sourceFile) === type) {\n                return true;\n            }\n            return false;\n        }\n        function isStaticProperty(symbol) {\n            return !!(symbol.valueDeclaration && ts.getEffectiveModifierFlags(symbol.valueDeclaration) & 32 /* Static */ && ts.isClassLike(symbol.valueDeclaration.parent));\n        }\n        function tryGetObjectLiteralContextualType(node, typeChecker) {\n            var type = typeChecker.getContextualType(node);\n            if (type) {\n                return type;\n            }\n            if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 62 /* EqualsToken */) {\n                return typeChecker.getTypeAtLocation(node.parent);\n            }\n            return undefined;\n        }\n    })(Completions = ts.Completions || (ts.Completions = {}));\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    /* @internal */\n    var DocumentHighlights;\n    (function (DocumentHighlights) {\n        function getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch) {\n            var node = ts.getTouchingPropertyName(sourceFile, position);\n            if (node.parent && (ts.isJsxOpeningElement(node.parent) && node.parent.tagName === node || ts.isJsxClosingElement(node.parent))) {\n                // For a JSX element, just highlight the matching tag, not all references.\n                var _a = node.parent.parent, openingElement = _a.openingElement, closingElement = _a.closingElement;\n                var highlightSpans = [openingElement, closingElement].map(function (_a) {\n                    var tagName = _a.tagName;\n                    return getHighlightSpanForNode(tagName, sourceFile);\n                });\n                return [{ fileName: sourceFile.fileName, highlightSpans: highlightSpans }];\n            }\n            return getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) || getSyntacticDocumentHighlights(node, sourceFile);\n        }\n        DocumentHighlights.getDocumentHighlights = getDocumentHighlights;\n        function getHighlightSpanForNode(node, sourceFile) {\n            return {\n                fileName: sourceFile.fileName,\n                textSpan: ts.createTextSpanFromNode(node, sourceFile),\n                kind: \"none\" /* none */\n            };\n        }\n        function getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) {\n            var sourceFilesSet = new ts.Set(sourceFilesToSearch.map(function (f) { return f.fileName; }));\n            var referenceEntries = ts.FindAllReferences.getReferenceEntriesForNode(position, node, program, sourceFilesToSearch, cancellationToken, /*options*/ undefined, sourceFilesSet);\n            if (!referenceEntries)\n                return undefined;\n            var map = ts.arrayToMultiMap(referenceEntries.map(ts.FindAllReferences.toHighlightSpan), function (e) { return e.fileName; }, function (e) { return e.span; });\n            return ts.arrayFrom(map.entries(), function (_a) {\n                var fileName = _a[0], highlightSpans = _a[1];\n                if (!sourceFilesSet.has(fileName)) {\n                    ts.Debug.assert(program.redirectTargetsMap.has(fileName));\n                    var redirectTarget_1 = program.getSourceFile(fileName);\n                    var redirect = ts.find(sourceFilesToSearch, function (f) { return !!f.redirectInfo && f.redirectInfo.redirectTarget === redirectTarget_1; });\n                    fileName = redirect.fileName;\n                    ts.Debug.assert(sourceFilesSet.has(fileName));\n                }\n                return { fileName: fileName, highlightSpans: highlightSpans };\n            });\n        }\n        function getSyntacticDocumentHighlights(node, sourceFile) {\n            var highlightSpans = getHighlightSpans(node, sourceFile);\n            return highlightSpans && [{ fileName: sourceFile.fileName, highlightSpans: highlightSpans }];\n        }\n        function getHighlightSpans(node, sourceFile) {\n            switch (node.kind) {\n                case 98 /* IfKeyword */:\n                case 90 /* ElseKeyword */:\n                    return ts.isIfStatement(node.parent) ? getIfElseOccurrences(node.parent, sourceFile) : undefined;\n                case 104 /* ReturnKeyword */:\n                    return useParent(node.parent, ts.isReturnStatement, getReturnOccurrences);\n                case 108 /* ThrowKeyword */:\n                    return useParent(node.parent, ts.isThrowStatement, getThrowOccurrences);\n                case 110 /* TryKeyword */:\n                case 82 /* CatchKeyword */:\n                case 95 /* FinallyKeyword */:\n                    var tryStatement = node.kind === 82 /* CatchKeyword */ ? node.parent.parent : node.parent;\n                    return useParent(tryStatement, ts.isTryStatement, getTryCatchFinallyOccurrences);\n                case 106 /* SwitchKeyword */:\n                    return useParent(node.parent, ts.isSwitchStatement, getSwitchCaseDefaultOccurrences);\n                case 81 /* CaseKeyword */:\n                case 87 /* DefaultKeyword */: {\n                    if (ts.isDefaultClause(node.parent) || ts.isCaseClause(node.parent)) {\n                        return useParent(node.parent.parent.parent, ts.isSwitchStatement, getSwitchCaseDefaultOccurrences);\n                    }\n                    return undefined;\n                }\n                case 80 /* BreakKeyword */:\n                case 85 /* ContinueKeyword */:\n                    return useParent(node.parent, ts.isBreakOrContinueStatement, getBreakOrContinueStatementOccurrences);\n                case 96 /* ForKeyword */:\n                case 114 /* WhileKeyword */:\n                case 89 /* DoKeyword */:\n                    return useParent(node.parent, function (n) { return ts.isIterationStatement(n, /*lookInLabeledStatements*/ true); }, getLoopBreakContinueOccurrences);\n                case 132 /* ConstructorKeyword */:\n                    return getFromAllDeclarations(ts.isConstructorDeclaration, [132 /* ConstructorKeyword */]);\n                case 134 /* GetKeyword */:\n                case 146 /* SetKeyword */:\n                    return getFromAllDeclarations(ts.isAccessor, [134 /* GetKeyword */, 146 /* SetKeyword */]);\n                case 130 /* AwaitKeyword */:\n                    return useParent(node.parent, ts.isAwaitExpression, getAsyncAndAwaitOccurrences);\n                case 129 /* AsyncKeyword */:\n                    return highlightSpans(getAsyncAndAwaitOccurrences(node));\n                case 124 /* YieldKeyword */:\n                    return highlightSpans(getYieldOccurrences(node));\n                default:\n                    return ts.isModifierKind(node.kind) && (ts.isDeclaration(node.parent) || ts.isVariableStatement(node.parent))\n                        ? highlightSpans(getModifierOccurrences(node.kind, node.parent))\n                        : undefined;\n            }\n            function getFromAllDeclarations(nodeTest, keywords) {\n                return useParent(node.parent, nodeTest, function (decl) { return ts.mapDefined(decl.symbol.declarations, function (d) {\n                    return nodeTest(d) ? ts.find(d.getChildren(sourceFile), function (c) { return ts.contains(keywords, c.kind); }) : undefined;\n                }); });\n            }\n            function useParent(node, nodeTest, getNodes) {\n                return nodeTest(node) ? highlightSpans(getNodes(node, sourceFile)) : undefined;\n            }\n            function highlightSpans(nodes) {\n                return nodes && nodes.map(function (node) { return getHighlightSpanForNode(node, sourceFile); });\n            }\n        }\n        /**\n         * Aggregates all throw-statements within this node *without* crossing\n         * into function boundaries and try-blocks with catch-clauses.\n         */\n        function aggregateOwnedThrowStatements(node) {\n            if (ts.isThrowStatement(node)) {\n                return [node];\n            }\n            else if (ts.isTryStatement(node)) {\n                // Exceptions thrown within a try block lacking a catch clause are \"owned\" in the current context.\n                return ts.concatenate(node.catchClause ? aggregateOwnedThrowStatements(node.catchClause) : node.tryBlock && aggregateOwnedThrowStatements(node.tryBlock), node.finallyBlock && aggregateOwnedThrowStatements(node.finallyBlock));\n            }\n            // Do not cross function boundaries.\n            return ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateOwnedThrowStatements);\n        }\n        /**\n         * For lack of a better name, this function takes a throw statement and returns the\n         * nearest ancestor that is a try-block (whose try statement has a catch clause),\n         * function-block, or source file.\n         */\n        function getThrowStatementOwner(throwStatement) {\n            var child = throwStatement;\n            while (child.parent) {\n                var parent = child.parent;\n                if (ts.isFunctionBlock(parent) || parent.kind === 297 /* SourceFile */) {\n                    return parent;\n                }\n                // A throw-statement is only owned by a try-statement if the try-statement has\n                // a catch clause, and if the throw-statement occurs within the try block.\n                if (ts.isTryStatement(parent) && parent.tryBlock === child && parent.catchClause) {\n                    return child;\n                }\n                child = parent;\n            }\n            return undefined;\n        }\n        function aggregateAllBreakAndContinueStatements(node) {\n            return ts.isBreakOrContinueStatement(node) ? [node] : ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateAllBreakAndContinueStatements);\n        }\n        function flatMapChildren(node, cb) {\n            var result = [];\n            node.forEachChild(function (child) {\n                var value = cb(child);\n                if (value !== undefined) {\n                    result.push.apply(result, ts.toArray(value));\n                }\n            });\n            return result;\n        }\n        function ownsBreakOrContinueStatement(owner, statement) {\n            var actualOwner = getBreakOrContinueOwner(statement);\n            return !!actualOwner && actualOwner === owner;\n        }\n        function getBreakOrContinueOwner(statement) {\n            return ts.findAncestor(statement, function (node) {\n                switch (node.kind) {\n                    case 244 /* SwitchStatement */:\n                        if (statement.kind === 240 /* ContinueStatement */) {\n                            return false;\n                        }\n                    // falls through\n                    case 237 /* ForStatement */:\n                    case 238 /* ForInStatement */:\n                    case 239 /* ForOfStatement */:\n                    case 236 /* WhileStatement */:\n                    case 235 /* DoStatement */:\n                        return !statement.label || isLabeledBy(node, statement.label.escapedText);\n                    default:\n                        // Don't cross function boundaries.\n                        // TODO: GH#20090\n                        return ts.isFunctionLike(node) && \"quit\";\n                }\n            });\n        }\n        function getModifierOccurrences(modifier, declaration) {\n            return ts.mapDefined(getNodesToSearchForModifier(declaration, ts.modifierToFlag(modifier)), function (node) { return ts.findModifier(node, modifier); });\n        }\n        function getNodesToSearchForModifier(declaration, modifierFlag) {\n            // Types of node whose children might have modifiers.\n            var container = declaration.parent;\n            switch (container.kind) {\n                case 257 /* ModuleBlock */:\n                case 297 /* SourceFile */:\n                case 230 /* Block */:\n                case 284 /* CaseClause */:\n                case 285 /* DefaultClause */:\n                    // Container is either a class declaration or the declaration is a classDeclaration\n                    if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) {\n                        return __spreadArray(__spreadArray([], declaration.members), [declaration]);\n                    }\n                    else {\n                        return container.statements;\n                    }\n                case 166 /* Constructor */:\n                case 165 /* MethodDeclaration */:\n                case 251 /* FunctionDeclaration */:\n                    return __spreadArray(__spreadArray([], container.parameters), (ts.isClassLike(container.parent) ? container.parent.members : []));\n                case 252 /* ClassDeclaration */:\n                case 221 /* ClassExpression */:\n                case 253 /* InterfaceDeclaration */:\n                case 177 /* TypeLiteral */:\n                    var nodes = container.members;\n                    // If we're an accessibility modifier, we're in an instance member and should search\n                    // the constructor's parameter list for instance members as well.\n                    if (modifierFlag & (28 /* AccessibilityModifier */ | 64 /* Readonly */)) {\n                        var constructor = ts.find(container.members, ts.isConstructorDeclaration);\n                        if (constructor) {\n                            return __spreadArray(__spreadArray([], nodes), constructor.parameters);\n                        }\n                    }\n                    else if (modifierFlag & 128 /* Abstract */) {\n                        return __spreadArray(__spreadArray([], nodes), [container]);\n                    }\n                    return nodes;\n                // Syntactically invalid positions that the parser might produce anyway\n                case 200 /* ObjectLiteralExpression */:\n                    return undefined;\n                default:\n                    ts.Debug.assertNever(container, \"Invalid container kind.\");\n            }\n        }\n        function pushKeywordIf(keywordList, token) {\n            var expected = [];\n            for (var _i = 2; _i < arguments.length; _i++) {\n                expected[_i - 2] = arguments[_i];\n            }\n            if (token && ts.contains(expected, token.kind)) {\n                keywordList.push(token);\n                return true;\n            }\n            return false;\n        }\n        function getLoopBreakContinueOccurrences(loopNode) {\n            var keywords = [];\n            if (pushKeywordIf(keywords, loopNode.getFirstToken(), 96 /* ForKeyword */, 114 /* WhileKeyword */, 89 /* DoKeyword */)) {\n                // If we succeeded and got a do-while loop, then start looking for a 'while' keyword.\n                if (loopNode.kind === 235 /* DoStatement */) {\n                    var loopTokens = loopNode.getChildren();\n                    for (var i = loopTokens.length - 1; i >= 0; i--) {\n                        if (pushKeywordIf(keywords, loopTokens[i], 114 /* WhileKeyword */)) {\n                            break;\n                        }\n                    }\n                }\n            }\n            ts.forEach(aggregateAllBreakAndContinueStatements(loopNode.statement), function (statement) {\n                if (ownsBreakOrContinueStatement(loopNode, statement)) {\n                    pushKeywordIf(keywords, statement.getFirstToken(), 80 /* BreakKeyword */, 85 /* ContinueKeyword */);\n                }\n            });\n            return keywords;\n        }\n        function getBreakOrContinueStatementOccurrences(breakOrContinueStatement) {\n            var owner = getBreakOrContinueOwner(breakOrContinueStatement);\n            if (owner) {\n                switch (owner.kind) {\n                    case 237 /* ForStatement */:\n                    case 238 /* ForInStatement */:\n                    case 239 /* ForOfStatement */:\n                    case 235 /* DoStatement */:\n                    case 236 /* WhileStatement */:\n                        return getLoopBreakContinueOccurrences(owner);\n                    case 244 /* SwitchStatement */:\n                        return getSwitchCaseDefaultOccurrences(owner);\n                }\n            }\n            return undefined;\n        }\n        function getSwitchCaseDefaultOccurrences(switchStatement) {\n            var keywords = [];\n            pushKeywordIf(keywords, switchStatement.getFirstToken(), 106 /* SwitchKeyword */);\n            // Go through each clause in the switch statement, collecting the 'case'/'default' keywords.\n            ts.forEach(switchStatement.caseBlock.clauses, function (clause) {\n                pushKeywordIf(keywords, clause.getFirstToken(), 81 /* CaseKeyword */, 87 /* DefaultKeyword */);\n                ts.forEach(aggregateAllBreakAndContinueStatements(clause), function (statement) {\n                    if (ownsBreakOrContinueStatement(switchStatement, statement)) {\n                        pushKeywordIf(keywords, statement.getFirstToken(), 80 /* BreakKeyword */);\n                    }\n                });\n            });\n            return keywords;\n        }\n        function getTryCatchFinallyOccurrences(tryStatement, sourceFile) {\n            var keywords = [];\n            pushKeywordIf(keywords, tryStatement.getFirstToken(), 110 /* TryKeyword */);\n            if (tryStatement.catchClause) {\n                pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 82 /* CatchKeyword */);\n            }\n            if (tryStatement.finallyBlock) {\n                var finallyKeyword = ts.findChildOfKind(tryStatement, 95 /* FinallyKeyword */, sourceFile);\n                pushKeywordIf(keywords, finallyKeyword, 95 /* FinallyKeyword */);\n            }\n            return keywords;\n        }\n        function getThrowOccurrences(throwStatement, sourceFile) {\n            var owner = getThrowStatementOwner(throwStatement);\n            if (!owner) {\n                return undefined;\n            }\n            var keywords = [];\n            ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) {\n                keywords.push(ts.findChildOfKind(throwStatement, 108 /* ThrowKeyword */, sourceFile));\n            });\n            // If the \"owner\" is a function, then we equate 'return' and 'throw' statements in their\n            // ability to \"jump out\" of the function, and include occurrences for both.\n            if (ts.isFunctionBlock(owner)) {\n                ts.forEachReturnStatement(owner, function (returnStatement) {\n                    keywords.push(ts.findChildOfKind(returnStatement, 104 /* ReturnKeyword */, sourceFile));\n                });\n            }\n            return keywords;\n        }\n        function getReturnOccurrences(returnStatement, sourceFile) {\n            var func = ts.getContainingFunction(returnStatement);\n            if (!func) {\n                return undefined;\n            }\n            var keywords = [];\n            ts.forEachReturnStatement(ts.cast(func.body, ts.isBlock), function (returnStatement) {\n                keywords.push(ts.findChildOfKind(returnStatement, 104 /* ReturnKeyword */, sourceFile));\n            });\n            // Include 'throw' statements that do not occur within a try block.\n            ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) {\n                keywords.push(ts.findChildOfKind(throwStatement, 108 /* ThrowKeyword */, sourceFile));\n            });\n            return keywords;\n        }\n        function getAsyncAndAwaitOccurrences(node) {\n            var func = ts.getContainingFunction(node);\n            if (!func) {\n                return undefined;\n            }\n            var keywords = [];\n            if (func.modifiers) {\n                func.modifiers.forEach(function (modifier) {\n                    pushKeywordIf(keywords, modifier, 129 /* AsyncKeyword */);\n                });\n            }\n            ts.forEachChild(func, function (child) {\n                traverseWithoutCrossingFunction(child, function (node) {\n                    if (ts.isAwaitExpression(node)) {\n                        pushKeywordIf(keywords, node.getFirstToken(), 130 /* AwaitKeyword */);\n                    }\n                });\n            });\n            return keywords;\n        }\n        function getYieldOccurrences(node) {\n            var func = ts.getContainingFunction(node);\n            if (!func) {\n                return undefined;\n            }\n            var keywords = [];\n            ts.forEachChild(func, function (child) {\n                traverseWithoutCrossingFunction(child, function (node) {\n                    if (ts.isYieldExpression(node)) {\n                        pushKeywordIf(keywords, node.getFirstToken(), 124 /* YieldKeyword */);\n                    }\n                });\n            });\n            return keywords;\n        }\n        // Do not cross function/class/interface/module/type boundaries.\n        function traverseWithoutCrossingFunction(node, cb) {\n            cb(node);\n            if (!ts.isFunctionLike(node) && !ts.isClassLike(node) && !ts.isInterfaceDeclaration(node) && !ts.isModuleDeclaration(node) && !ts.isTypeAliasDeclaration(node) && !ts.isTypeNode(node)) {\n                ts.forEachChild(node, function (child) { return traverseWithoutCrossingFunction(child, cb); });\n            }\n        }\n        function getIfElseOccurrences(ifStatement, sourceFile) {\n            var keywords = getIfElseKeywords(ifStatement, sourceFile);\n            var result = [];\n            // We'd like to highlight else/ifs together if they are only separated by whitespace\n            // (i.e. the keywords are separated by no comments, no newlines).\n            for (var i = 0; i < keywords.length; i++) {\n                if (keywords[i].kind === 90 /* ElseKeyword */ && i < keywords.length - 1) {\n                    var elseKeyword = keywords[i];\n                    var ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword.\n                    var shouldCombineElseAndIf = true;\n                    // Avoid recalculating getStart() by iterating backwards.\n                    for (var j = ifKeyword.getStart(sourceFile) - 1; j >= elseKeyword.end; j--) {\n                        if (!ts.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j))) {\n                            shouldCombineElseAndIf = false;\n                            break;\n                        }\n                    }\n                    if (shouldCombineElseAndIf) {\n                        result.push({\n                            fileName: sourceFile.fileName,\n                            textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end),\n                            kind: \"reference\" /* reference */\n                        });\n                        i++; // skip the next keyword\n                        continue;\n                    }\n                }\n                // Ordinary case: just highlight the keyword.\n                result.push(getHighlightSpanForNode(keywords[i], sourceFile));\n            }\n            return result;\n        }\n        function getIfElseKeywords(ifStatement, sourceFile) {\n            var keywords = [];\n            // Traverse upwards through all parent if-statements linked by their else-branches.\n            while (ts.isIfStatement(ifStatement.parent) && ifStatement.parent.elseStatement === ifStatement) {\n                ifStatement = ifStatement.parent;\n            }\n            // Now traverse back down through the else branches, aggregating if/else keywords of if-statements.\n            while (true) {\n                var children = ifStatement.getChildren(sourceFile);\n                pushKeywordIf(keywords, children[0], 98 /* IfKeyword */);\n                // Generally the 'else' keyword is second-to-last, so we traverse backwards.\n                for (var i = children.length - 1; i >= 0; i--) {\n                    if (pushKeywordIf(keywords, children[i], 90 /* ElseKeyword */)) {\n                        break;\n                    }\n                }\n                if (!ifStatement.elseStatement || !ts.isIfStatement(ifStatement.elseStatement)) {\n                    break;\n                }\n                ifStatement = ifStatement.elseStatement;\n            }\n            return keywords;\n        }\n        /**\n         * Whether or not a 'node' is preceded by a label of the given string.\n         * Note: 'node' cannot be a SourceFile.\n         */\n        function isLabeledBy(node, labelName) {\n            return !!ts.findAncestor(node.parent, function (owner) { return !ts.isLabeledStatement(owner) ? \"quit\" : owner.label.escapedText === labelName; });\n        }\n    })(DocumentHighlights = ts.DocumentHighlights || (ts.DocumentHighlights = {}));\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    function createDocumentRegistry(useCaseSensitiveFileNames, currentDirectory) {\n        return createDocumentRegistryInternal(useCaseSensitiveFileNames, currentDirectory);\n    }\n    ts.createDocumentRegistry = createDocumentRegistry;\n    /*@internal*/\n    function createDocumentRegistryInternal(useCaseSensitiveFileNames, currentDirectory, externalCache) {\n        if (currentDirectory === void 0) { currentDirectory = \"\"; }\n        // Maps from compiler setting target (ES3, ES5, etc.) to all the cached documents we have\n        // for those settings.\n        var buckets = new ts.Map();\n        var getCanonicalFileName = ts.createGetCanonicalFileName(!!useCaseSensitiveFileNames);\n        function reportStats() {\n            var bucketInfoArray = ts.arrayFrom(buckets.keys()).filter(function (name) { return name && name.charAt(0) === \"_\"; }).map(function (name) {\n                var entries = buckets.get(name);\n                var sourceFiles = [];\n                entries.forEach(function (entry, name) {\n                    sourceFiles.push({\n                        name: name,\n                        refCount: entry.languageServiceRefCount\n                    });\n                });\n                sourceFiles.sort(function (x, y) { return y.refCount - x.refCount; });\n                return {\n                    bucket: name,\n                    sourceFiles: sourceFiles\n                };\n            });\n            return JSON.stringify(bucketInfoArray, undefined, 2);\n        }\n        function acquireDocument(fileName, compilationSettings, scriptSnapshot, version, scriptKind) {\n            var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName);\n            var key = getKeyForCompilationSettings(compilationSettings);\n            return acquireDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind);\n        }\n        function acquireDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind) {\n            return acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, /*acquiring*/ true, scriptKind);\n        }\n        function updateDocument(fileName, compilationSettings, scriptSnapshot, version, scriptKind) {\n            var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName);\n            var key = getKeyForCompilationSettings(compilationSettings);\n            return updateDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind);\n        }\n        function updateDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind) {\n            return acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, /*acquiring*/ false, scriptKind);\n        }\n        function acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, acquiring, scriptKind) {\n            var bucket = ts.getOrUpdate(buckets, key, function () { return new ts.Map(); });\n            var entry = bucket.get(path);\n            var scriptTarget = scriptKind === 6 /* JSON */ ? 100 /* JSON */ : compilationSettings.target || 1 /* ES5 */;\n            if (!entry && externalCache) {\n                var sourceFile = externalCache.getDocument(key, path);\n                if (sourceFile) {\n                    ts.Debug.assert(acquiring);\n                    entry = {\n                        sourceFile: sourceFile,\n                        languageServiceRefCount: 0\n                    };\n                    bucket.set(path, entry);\n                }\n            }\n            if (!entry) {\n                // Have never seen this file with these settings.  Create a new source file for it.\n                var sourceFile = ts.createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, /*setNodeParents*/ false, scriptKind);\n                if (externalCache) {\n                    externalCache.setDocument(key, path, sourceFile);\n                }\n                entry = {\n                    sourceFile: sourceFile,\n                    languageServiceRefCount: 1,\n                };\n                bucket.set(path, entry);\n            }\n            else {\n                // We have an entry for this file.  However, it may be for a different version of\n                // the script snapshot.  If so, update it appropriately.  Otherwise, we can just\n                // return it as is.\n                if (entry.sourceFile.version !== version) {\n                    entry.sourceFile = ts.updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot)); // TODO: GH#18217\n                    if (externalCache) {\n                        externalCache.setDocument(key, path, entry.sourceFile);\n                    }\n                }\n                // If we're acquiring, then this is the first time this LS is asking for this document.\n                // Increase our ref count so we know there's another LS using the document.  If we're\n                // not acquiring, then that means the LS is 'updating' the file instead, and that means\n                // it has already acquired the document previously.  As such, we do not need to increase\n                // the ref count.\n                if (acquiring) {\n                    entry.languageServiceRefCount++;\n                }\n            }\n            ts.Debug.assert(entry.languageServiceRefCount !== 0);\n            return entry.sourceFile;\n        }\n        function releaseDocument(fileName, compilationSettings) {\n            var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName);\n            var key = getKeyForCompilationSettings(compilationSettings);\n            return releaseDocumentWithKey(path, key);\n        }\n        function releaseDocumentWithKey(path, key) {\n            var bucket = ts.Debug.checkDefined(buckets.get(key));\n            var entry = bucket.get(path);\n            entry.languageServiceRefCount--;\n            ts.Debug.assert(entry.languageServiceRefCount >= 0);\n            if (entry.languageServiceRefCount === 0) {\n                bucket.delete(path);\n            }\n        }\n        function getLanguageServiceRefCounts(path) {\n            return ts.arrayFrom(buckets.entries(), function (_a) {\n                var key = _a[0], bucket = _a[1];\n                var entry = bucket.get(path);\n                return [key, entry && entry.languageServiceRefCount];\n            });\n        }\n        return {\n            acquireDocument: acquireDocument,\n            acquireDocumentWithKey: acquireDocumentWithKey,\n            updateDocument: updateDocument,\n            updateDocumentWithKey: updateDocumentWithKey,\n            releaseDocument: releaseDocument,\n            releaseDocumentWithKey: releaseDocumentWithKey,\n            getLanguageServiceRefCounts: getLanguageServiceRefCounts,\n            reportStats: reportStats,\n            getKeyForCompilationSettings: getKeyForCompilationSettings\n        };\n    }\n    ts.createDocumentRegistryInternal = createDocumentRegistryInternal;\n    function getKeyForCompilationSettings(settings) {\n        return ts.sourceFileAffectingCompilerOptions.map(function (option) { return ts.getCompilerOptionValue(settings, option); }).join(\"|\");\n    }\n})(ts || (ts = {}));\n/* Code for finding imports of an exported symbol. Used only by FindAllReferences. */\n/* @internal */\nvar ts;\n(function (ts) {\n    var FindAllReferences;\n    (function (FindAllReferences) {\n        /** Creates the imports map and returns an ImportTracker that uses it. Call this lazily to avoid calling `getDirectImportsMap` unnecessarily.  */\n        function createImportTracker(sourceFiles, sourceFilesSet, checker, cancellationToken) {\n            var allDirectImports = getDirectImportsMap(sourceFiles, checker, cancellationToken);\n            return function (exportSymbol, exportInfo, isForRename) {\n                var _a = getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, exportInfo, checker, cancellationToken), directImports = _a.directImports, indirectUsers = _a.indirectUsers;\n                return __assign({ indirectUsers: indirectUsers }, getSearchesFromDirectImports(directImports, exportSymbol, exportInfo.exportKind, checker, isForRename));\n            };\n        }\n        FindAllReferences.createImportTracker = createImportTracker;\n        var ExportKind;\n        (function (ExportKind) {\n            ExportKind[ExportKind[\"Named\"] = 0] = \"Named\";\n            ExportKind[ExportKind[\"Default\"] = 1] = \"Default\";\n            ExportKind[ExportKind[\"ExportEquals\"] = 2] = \"ExportEquals\";\n        })(ExportKind = FindAllReferences.ExportKind || (FindAllReferences.ExportKind = {}));\n        var ImportExport;\n        (function (ImportExport) {\n            ImportExport[ImportExport[\"Import\"] = 0] = \"Import\";\n            ImportExport[ImportExport[\"Export\"] = 1] = \"Export\";\n        })(ImportExport = FindAllReferences.ImportExport || (FindAllReferences.ImportExport = {}));\n        /** Returns import statements that directly reference the exporting module, and a list of files that may access the module through a namespace. */\n        function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, _a, checker, cancellationToken) {\n            var exportingModuleSymbol = _a.exportingModuleSymbol, exportKind = _a.exportKind;\n            var markSeenDirectImport = ts.nodeSeenTracker();\n            var markSeenIndirectUser = ts.nodeSeenTracker();\n            var directImports = [];\n            var isAvailableThroughGlobal = !!exportingModuleSymbol.globalExports;\n            var indirectUserDeclarations = isAvailableThroughGlobal ? undefined : [];\n            handleDirectImports(exportingModuleSymbol);\n            return { directImports: directImports, indirectUsers: getIndirectUsers() };\n            function getIndirectUsers() {\n                if (isAvailableThroughGlobal) {\n                    // It has `export as namespace`, so anything could potentially use it.\n                    return sourceFiles;\n                }\n                // Module augmentations may use this module's exports without importing it.\n                for (var _i = 0, _a = exportingModuleSymbol.declarations; _i < _a.length; _i++) {\n                    var decl = _a[_i];\n                    if (ts.isExternalModuleAugmentation(decl) && sourceFilesSet.has(decl.getSourceFile().fileName)) {\n                        addIndirectUser(decl);\n                    }\n                }\n                // This may return duplicates (if there are multiple module declarations in a single source file, all importing the same thing as a namespace), but `State.markSearchedSymbol` will handle that.\n                return indirectUserDeclarations.map(ts.getSourceFileOfNode);\n            }\n            function handleDirectImports(exportingModuleSymbol) {\n                var theseDirectImports = getDirectImports(exportingModuleSymbol);\n                if (theseDirectImports) {\n                    for (var _i = 0, theseDirectImports_1 = theseDirectImports; _i < theseDirectImports_1.length; _i++) {\n                        var direct = theseDirectImports_1[_i];\n                        if (!markSeenDirectImport(direct)) {\n                            continue;\n                        }\n                        if (cancellationToken)\n                            cancellationToken.throwIfCancellationRequested();\n                        switch (direct.kind) {\n                            case 203 /* CallExpression */:\n                                if (ts.isImportCall(direct)) {\n                                    handleImportCall(direct);\n                                    break;\n                                }\n                                if (!isAvailableThroughGlobal) {\n                                    var parent = direct.parent;\n                                    if (exportKind === 2 /* ExportEquals */ && parent.kind === 249 /* VariableDeclaration */) {\n                                        var name = parent.name;\n                                        if (name.kind === 78 /* Identifier */) {\n                                            directImports.push(name);\n                                            break;\n                                        }\n                                    }\n                                }\n                                break;\n                            case 78 /* Identifier */: // for 'const x = require(\"y\");\n                                break; // TODO: GH#23879\n                            case 260 /* ImportEqualsDeclaration */:\n                                handleNamespaceImport(direct, direct.name, ts.hasSyntacticModifier(direct, 1 /* Export */), /*alreadyAddedDirect*/ false);\n                                break;\n                            case 261 /* ImportDeclaration */:\n                                directImports.push(direct);\n                                var namedBindings = direct.importClause && direct.importClause.namedBindings;\n                                if (namedBindings && namedBindings.kind === 263 /* NamespaceImport */) {\n                                    handleNamespaceImport(direct, namedBindings.name, /*isReExport*/ false, /*alreadyAddedDirect*/ true);\n                                }\n                                else if (!isAvailableThroughGlobal && ts.isDefaultImport(direct)) {\n                                    addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); // Add a check for indirect uses to handle synthetic default imports\n                                }\n                                break;\n                            case 267 /* ExportDeclaration */:\n                                if (!direct.exportClause) {\n                                    // This is `export * from \"foo\"`, so imports of this module may import the export too.\n                                    handleDirectImports(getContainingModuleSymbol(direct, checker));\n                                }\n                                else if (direct.exportClause.kind === 269 /* NamespaceExport */) {\n                                    // `export * as foo from \"foo\"` add to indirect uses\n                                    addIndirectUser(getSourceFileLikeForImportDeclaration(direct), /** addTransitiveDependencies */ true);\n                                }\n                                else {\n                                    // This is `export { foo } from \"foo\"` and creates an alias symbol, so recursive search will get handle re-exports.\n                                    directImports.push(direct);\n                                }\n                                break;\n                            case 195 /* ImportType */:\n                                // Only check for typeof import('xyz')\n                                if (direct.isTypeOf && !direct.qualifier && isExported(direct)) {\n                                    addIndirectUser(direct.getSourceFile(), /** addTransitiveDependencies */ true);\n                                }\n                                directImports.push(direct);\n                                break;\n                            default:\n                                ts.Debug.failBadSyntaxKind(direct, \"Unexpected import kind.\");\n                        }\n                    }\n                }\n            }\n            function handleImportCall(importCall) {\n                var top = ts.findAncestor(importCall, isAmbientModuleDeclaration) || importCall.getSourceFile();\n                addIndirectUser(top, /** addTransitiveDependencies */ !!isExported(importCall, /** stopAtAmbientModule */ true));\n            }\n            function isExported(node, stopAtAmbientModule) {\n                if (stopAtAmbientModule === void 0) { stopAtAmbientModule = false; }\n                return ts.findAncestor(node, function (node) {\n                    if (stopAtAmbientModule && isAmbientModuleDeclaration(node))\n                        return \"quit\";\n                    return ts.some(node.modifiers, function (mod) { return mod.kind === 92 /* ExportKeyword */; });\n                });\n            }\n            function handleNamespaceImport(importDeclaration, name, isReExport, alreadyAddedDirect) {\n                if (exportKind === 2 /* ExportEquals */) {\n                    // This is a direct import, not import-as-namespace.\n                    if (!alreadyAddedDirect)\n                        directImports.push(importDeclaration);\n                }\n                else if (!isAvailableThroughGlobal) {\n                    var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration);\n                    ts.Debug.assert(sourceFileLike.kind === 297 /* SourceFile */ || sourceFileLike.kind === 256 /* ModuleDeclaration */);\n                    if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) {\n                        addIndirectUser(sourceFileLike, /** addTransitiveDependencies */ true);\n                    }\n                    else {\n                        addIndirectUser(sourceFileLike);\n                    }\n                }\n            }\n            /** Adds a module and all of its transitive dependencies as possible indirect users. */\n            function addIndirectUser(sourceFileLike, addTransitiveDependencies) {\n                if (addTransitiveDependencies === void 0) { addTransitiveDependencies = false; }\n                ts.Debug.assert(!isAvailableThroughGlobal);\n                var isNew = markSeenIndirectUser(sourceFileLike);\n                if (!isNew)\n                    return;\n                indirectUserDeclarations.push(sourceFileLike); // TODO: GH#18217\n                if (!addTransitiveDependencies)\n                    return;\n                var moduleSymbol = checker.getMergedSymbol(sourceFileLike.symbol);\n                if (!moduleSymbol)\n                    return;\n                ts.Debug.assert(!!(moduleSymbol.flags & 1536 /* Module */));\n                var directImports = getDirectImports(moduleSymbol);\n                if (directImports) {\n                    for (var _i = 0, directImports_1 = directImports; _i < directImports_1.length; _i++) {\n                        var directImport = directImports_1[_i];\n                        if (!ts.isImportTypeNode(directImport)) {\n                            addIndirectUser(getSourceFileLikeForImportDeclaration(directImport), /** addTransitiveDependencies */ true);\n                        }\n                    }\n                }\n            }\n            function getDirectImports(moduleSymbol) {\n                return allDirectImports.get(ts.getSymbolId(moduleSymbol).toString());\n            }\n        }\n        /**\n         * Given the set of direct imports of a module, we need to find which ones import the particular exported symbol.\n         * The returned `importSearches` will result in the entire source file being searched.\n         * But re-exports will be placed in 'singleReferences' since they cannot be locally referenced.\n         */\n        function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, checker, isForRename) {\n            var importSearches = [];\n            var singleReferences = [];\n            function addSearch(location, symbol) {\n                importSearches.push([location, symbol]);\n            }\n            if (directImports) {\n                for (var _i = 0, directImports_2 = directImports; _i < directImports_2.length; _i++) {\n                    var decl = directImports_2[_i];\n                    handleImport(decl);\n                }\n            }\n            return { importSearches: importSearches, singleReferences: singleReferences };\n            function handleImport(decl) {\n                if (decl.kind === 260 /* ImportEqualsDeclaration */) {\n                    if (isExternalModuleImportEquals(decl)) {\n                        handleNamespaceImportLike(decl.name);\n                    }\n                    return;\n                }\n                if (decl.kind === 78 /* Identifier */) {\n                    handleNamespaceImportLike(decl);\n                    return;\n                }\n                if (decl.kind === 195 /* ImportType */) {\n                    if (decl.qualifier) {\n                        var firstIdentifier = ts.getFirstIdentifier(decl.qualifier);\n                        if (firstIdentifier.escapedText === ts.symbolName(exportSymbol)) {\n                            singleReferences.push(firstIdentifier);\n                        }\n                    }\n                    else if (exportKind === 2 /* ExportEquals */) {\n                        singleReferences.push(decl.argument.literal);\n                    }\n                    return;\n                }\n                // Ignore if there's a grammar error\n                if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) {\n                    return;\n                }\n                if (decl.kind === 267 /* ExportDeclaration */) {\n                    if (decl.exportClause && ts.isNamedExports(decl.exportClause)) {\n                        searchForNamedImport(decl.exportClause);\n                    }\n                    return;\n                }\n                var _a = decl.importClause || { name: undefined, namedBindings: undefined }, name = _a.name, namedBindings = _a.namedBindings;\n                if (namedBindings) {\n                    switch (namedBindings.kind) {\n                        case 263 /* NamespaceImport */:\n                            handleNamespaceImportLike(namedBindings.name);\n                            break;\n                        case 264 /* NamedImports */:\n                            // 'default' might be accessed as a named import `{ default as foo }`.\n                            if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) {\n                                searchForNamedImport(namedBindings);\n                            }\n                            break;\n                        default:\n                            ts.Debug.assertNever(namedBindings);\n                    }\n                }\n                // `export =` might be imported by a default import if `--allowSyntheticDefaultImports` is on, so this handles both ExportKind.Default and ExportKind.ExportEquals.\n                // If a default import has the same name as the default export, allow to rename it.\n                // Given `import f` and `export default function f`, we will rename both, but for `import g` we will rename just that.\n                if (name && (exportKind === 1 /* Default */ || exportKind === 2 /* ExportEquals */) && (!isForRename || name.escapedText === ts.symbolEscapedNameNoDefault(exportSymbol))) {\n                    var defaultImportAlias = checker.getSymbolAtLocation(name);\n                    addSearch(name, defaultImportAlias);\n                }\n            }\n            /**\n             * `import x = require(\"./x\")` or `import * as x from \"./x\"`.\n             * An `export =` may be imported by this syntax, so it may be a direct import.\n             * If it's not a direct import, it will be in `indirectUsers`, so we don't have to do anything here.\n             */\n            function handleNamespaceImportLike(importName) {\n                // Don't rename an import that already has a different name than the export.\n                if (exportKind === 2 /* ExportEquals */ && (!isForRename || isNameMatch(importName.escapedText))) {\n                    addSearch(importName, checker.getSymbolAtLocation(importName));\n                }\n            }\n            function searchForNamedImport(namedBindings) {\n                if (!namedBindings) {\n                    return;\n                }\n                for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) {\n                    var element = _a[_i];\n                    var name = element.name, propertyName = element.propertyName;\n                    if (!isNameMatch((propertyName || name).escapedText)) {\n                        continue;\n                    }\n                    if (propertyName) {\n                        // This is `import { foo as bar } from \"./a\"` or `export { foo as bar } from \"./a\"`. `foo` isn't a local in the file, so just add it as a single reference.\n                        singleReferences.push(propertyName);\n                        // If renaming `{ foo as bar }`, don't touch `bar`, just `foo`.\n                        // But do rename `foo` in ` { default as foo }` if that's the original export name.\n                        if (!isForRename || name.escapedText === exportSymbol.escapedName) {\n                            // Search locally for `bar`.\n                            addSearch(name, checker.getSymbolAtLocation(name));\n                        }\n                    }\n                    else {\n                        var localSymbol = element.kind === 270 /* ExportSpecifier */ && element.propertyName\n                            ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol.\n                            : checker.getSymbolAtLocation(name);\n                        addSearch(name, localSymbol);\n                    }\n                }\n            }\n            function isNameMatch(name) {\n                // Use name of \"default\" even in `export =` case because we may have allowSyntheticDefaultImports\n                return name === exportSymbol.escapedName || exportKind !== 0 /* Named */ && name === \"default\" /* Default */;\n            }\n        }\n        /** Returns 'true' is the namespace 'name' is re-exported from this module, and 'false' if it is only used locally. */\n        function findNamespaceReExports(sourceFileLike, name, checker) {\n            var namespaceImportSymbol = checker.getSymbolAtLocation(name);\n            return !!forEachPossibleImportOrExportStatement(sourceFileLike, function (statement) {\n                if (!ts.isExportDeclaration(statement))\n                    return;\n                var exportClause = statement.exportClause, moduleSpecifier = statement.moduleSpecifier;\n                return !moduleSpecifier && exportClause && ts.isNamedExports(exportClause) &&\n                    exportClause.elements.some(function (element) { return checker.getExportSpecifierLocalTargetSymbol(element) === namespaceImportSymbol; });\n            });\n        }\n        function findModuleReferences(program, sourceFiles, searchModuleSymbol) {\n            var refs = [];\n            var checker = program.getTypeChecker();\n            for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) {\n                var referencingFile = sourceFiles_1[_i];\n                var searchSourceFile = searchModuleSymbol.valueDeclaration;\n                if (searchSourceFile.kind === 297 /* SourceFile */) {\n                    for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) {\n                        var ref = _b[_a];\n                        if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) {\n                            refs.push({ kind: \"reference\", referencingFile: referencingFile, ref: ref });\n                        }\n                    }\n                    for (var _c = 0, _d = referencingFile.typeReferenceDirectives; _c < _d.length; _c++) {\n                        var ref = _d[_c];\n                        var referenced = program.getResolvedTypeReferenceDirectives().get(ref.fileName);\n                        if (referenced !== undefined && referenced.resolvedFileName === searchSourceFile.fileName) {\n                            refs.push({ kind: \"reference\", referencingFile: referencingFile, ref: ref });\n                        }\n                    }\n                }\n                forEachImport(referencingFile, function (_importDecl, moduleSpecifier) {\n                    var moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier);\n                    if (moduleSymbol === searchModuleSymbol) {\n                        refs.push({ kind: \"import\", literal: moduleSpecifier });\n                    }\n                });\n            }\n            return refs;\n        }\n        FindAllReferences.findModuleReferences = findModuleReferences;\n        /** Returns a map from a module symbol Id to all import statements that directly reference the module. */\n        function getDirectImportsMap(sourceFiles, checker, cancellationToken) {\n            var map = new ts.Map();\n            for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) {\n                var sourceFile = sourceFiles_2[_i];\n                if (cancellationToken)\n                    cancellationToken.throwIfCancellationRequested();\n                forEachImport(sourceFile, function (importDecl, moduleSpecifier) {\n                    var moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier);\n                    if (moduleSymbol) {\n                        var id = ts.getSymbolId(moduleSymbol).toString();\n                        var imports = map.get(id);\n                        if (!imports) {\n                            map.set(id, imports = []);\n                        }\n                        imports.push(importDecl);\n                    }\n                });\n            }\n            return map;\n        }\n        /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */\n        function forEachPossibleImportOrExportStatement(sourceFileLike, action) {\n            return ts.forEach(sourceFileLike.kind === 297 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) {\n                return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action));\n            });\n        }\n        /** Calls `action` for each import, re-export, or require() in a file. */\n        function forEachImport(sourceFile, action) {\n            if (sourceFile.externalModuleIndicator || sourceFile.imports !== undefined) {\n                for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) {\n                    var i = _a[_i];\n                    action(ts.importFromModuleSpecifier(i), i);\n                }\n            }\n            else {\n                forEachPossibleImportOrExportStatement(sourceFile, function (statement) {\n                    switch (statement.kind) {\n                        case 267 /* ExportDeclaration */:\n                        case 261 /* ImportDeclaration */: {\n                            var decl = statement;\n                            if (decl.moduleSpecifier && ts.isStringLiteral(decl.moduleSpecifier)) {\n                                action(decl, decl.moduleSpecifier);\n                            }\n                            break;\n                        }\n                        case 260 /* ImportEqualsDeclaration */: {\n                            var decl = statement;\n                            if (isExternalModuleImportEquals(decl)) {\n                                action(decl, decl.moduleReference.expression);\n                            }\n                            break;\n                        }\n                    }\n                });\n            }\n        }\n        /**\n         * Given a local reference, we might notice that it's an import/export and recursively search for references of that.\n         * If at an import, look locally for the symbol it imports.\n         * If at an export, look for all imports of it.\n         * This doesn't handle export specifiers; that is done in `getReferencesAtExportSpecifier`.\n         * @param comingFromExport If we are doing a search for all exports, don't bother looking backwards for the imported symbol, since that's the reason we're here.\n         */\n        function getImportOrExportSymbol(node, symbol, checker, comingFromExport) {\n            return comingFromExport ? getExport() : getExport() || getImport();\n            function getExport() {\n                var parent = node.parent;\n                var grandParent = parent.parent;\n                if (symbol.exportSymbol) {\n                    if (parent.kind === 201 /* PropertyAccessExpression */) {\n                        // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use.\n                        // So check that we are at the declaration.\n                        return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(grandParent)\n                            ? getSpecialPropertyExport(grandParent, /*useLhsSymbol*/ false)\n                            : undefined;\n                    }\n                    else {\n                        return exportInfo(symbol.exportSymbol, getExportKindForDeclaration(parent));\n                    }\n                }\n                else {\n                    var exportNode = getExportNode(parent, node);\n                    if (exportNode && ts.hasSyntacticModifier(exportNode, 1 /* Export */)) {\n                        if (ts.isImportEqualsDeclaration(exportNode) && exportNode.moduleReference === node) {\n                            // We're at `Y` in `export import X = Y`. This is not the exported symbol, the left-hand-side is. So treat this as an import statement.\n                            if (comingFromExport) {\n                                return undefined;\n                            }\n                            var lhsSymbol = checker.getSymbolAtLocation(exportNode.name);\n                            return { kind: 0 /* Import */, symbol: lhsSymbol };\n                        }\n                        else {\n                            return exportInfo(symbol, getExportKindForDeclaration(exportNode));\n                        }\n                    }\n                    else if (ts.isNamespaceExport(parent)) {\n                        return exportInfo(symbol, 0 /* Named */);\n                    }\n                    // If we are in `export = a;` or `export default a;`, `parent` is the export assignment.\n                    else if (ts.isExportAssignment(parent)) {\n                        return getExportAssignmentExport(parent);\n                    }\n                    // If we are in `export = class A {};` (or `export = class A {};`) at `A`, `parent.parent` is the export assignment.\n                    else if (ts.isExportAssignment(grandParent)) {\n                        return getExportAssignmentExport(grandParent);\n                    }\n                    // Similar for `module.exports =` and `exports.A =`.\n                    else if (ts.isBinaryExpression(parent)) {\n                        return getSpecialPropertyExport(parent, /*useLhsSymbol*/ true);\n                    }\n                    else if (ts.isBinaryExpression(grandParent)) {\n                        return getSpecialPropertyExport(grandParent, /*useLhsSymbol*/ true);\n                    }\n                    else if (ts.isJSDocTypedefTag(parent)) {\n                        return exportInfo(symbol, 0 /* Named */);\n                    }\n                }\n                function getExportAssignmentExport(ex) {\n                    // Get the symbol for the `export =` node; its parent is the module it's the export of.\n                    var exportingModuleSymbol = ts.Debug.checkDefined(ex.symbol.parent, \"Expected export symbol to have a parent\");\n                    var exportKind = ex.isExportEquals ? 2 /* ExportEquals */ : 1 /* Default */;\n                    return { kind: 1 /* Export */, symbol: symbol, exportInfo: { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } };\n                }\n                function getSpecialPropertyExport(node, useLhsSymbol) {\n                    var kind;\n                    switch (ts.getAssignmentDeclarationKind(node)) {\n                        case 1 /* ExportsProperty */:\n                            kind = 0 /* Named */;\n                            break;\n                        case 2 /* ModuleExports */:\n                            kind = 2 /* ExportEquals */;\n                            break;\n                        default:\n                            return undefined;\n                    }\n                    var sym = useLhsSymbol ? checker.getSymbolAtLocation(ts.getNameOfAccessExpression(ts.cast(node.left, ts.isAccessExpression))) : symbol;\n                    return sym && exportInfo(sym, kind);\n                }\n            }\n            function getImport() {\n                var isImport = isNodeImport(node);\n                if (!isImport)\n                    return undefined;\n                // A symbol being imported is always an alias. So get what that aliases to find the local symbol.\n                var importedSymbol = checker.getImmediateAliasedSymbol(symbol);\n                if (!importedSymbol)\n                    return undefined;\n                // Search on the local symbol in the exporting module, not the exported symbol.\n                importedSymbol = skipExportSpecifierSymbol(importedSymbol, checker);\n                // Similarly, skip past the symbol for 'export ='\n                if (importedSymbol.escapedName === \"export=\") {\n                    importedSymbol = getExportEqualsLocalSymbol(importedSymbol, checker);\n                }\n                // If the import has a different name than the export, do not continue searching.\n                // If `importedName` is undefined, do continue searching as the export is anonymous.\n                // (All imports returned from this function will be ignored anyway if we are in rename and this is a not a named export.)\n                var importedName = ts.symbolEscapedNameNoDefault(importedSymbol);\n                if (importedName === undefined || importedName === \"default\" /* Default */ || importedName === symbol.escapedName) {\n                    return { kind: 0 /* Import */, symbol: importedSymbol };\n                }\n            }\n            function exportInfo(symbol, kind) {\n                var exportInfo = getExportInfo(symbol, kind, checker);\n                return exportInfo && { kind: 1 /* Export */, symbol: symbol, exportInfo: exportInfo };\n            }\n            // Not meant for use with export specifiers or export assignment.\n            function getExportKindForDeclaration(node) {\n                return ts.hasSyntacticModifier(node, 512 /* Default */) ? 1 /* Default */ : 0 /* Named */;\n            }\n        }\n        FindAllReferences.getImportOrExportSymbol = getImportOrExportSymbol;\n        function getExportEqualsLocalSymbol(importedSymbol, checker) {\n            if (importedSymbol.flags & 2097152 /* Alias */) {\n                return ts.Debug.checkDefined(checker.getImmediateAliasedSymbol(importedSymbol));\n            }\n            var decl = importedSymbol.valueDeclaration;\n            if (ts.isExportAssignment(decl)) { // `export = class {}`\n                return ts.Debug.checkDefined(decl.expression.symbol);\n            }\n            else if (ts.isBinaryExpression(decl)) { // `module.exports = class {}`\n                return ts.Debug.checkDefined(decl.right.symbol);\n            }\n            else if (ts.isSourceFile(decl)) { // json module\n                return ts.Debug.checkDefined(decl.symbol);\n            }\n            return ts.Debug.fail();\n        }\n        // If a reference is a class expression, the exported node would be its parent.\n        // If a reference is a variable declaration, the exported node would be the variable statement.\n        function getExportNode(parent, node) {\n            var declaration = ts.isVariableDeclaration(parent) ? parent : ts.isBindingElement(parent) ? ts.walkUpBindingElementsAndPatterns(parent) : undefined;\n            if (declaration) {\n                return parent.name !== node ? undefined :\n                    ts.isCatchClause(declaration.parent) ? undefined : ts.isVariableStatement(declaration.parent.parent) ? declaration.parent.parent : undefined;\n            }\n            else {\n                return parent;\n            }\n        }\n        function isNodeImport(node) {\n            var parent = node.parent;\n            switch (parent.kind) {\n                case 260 /* ImportEqualsDeclaration */:\n                    return parent.name === node && isExternalModuleImportEquals(parent);\n                case 265 /* ImportSpecifier */:\n                    // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`.\n                    return !parent.propertyName;\n                case 262 /* ImportClause */:\n                case 263 /* NamespaceImport */:\n                    ts.Debug.assert(parent.name === node);\n                    return true;\n                case 198 /* BindingElement */:\n                    return ts.isInJSFile(node) && ts.isRequireVariableDeclaration(parent, /*requireStringLiteralLikeArgument*/ true);\n                default:\n                    return false;\n            }\n        }\n        function getExportInfo(exportSymbol, exportKind, checker) {\n            var moduleSymbol = exportSymbol.parent;\n            if (!moduleSymbol)\n                return undefined; // This can happen if an `export` is not at the top-level (which is a compile error).\n            var exportingModuleSymbol = checker.getMergedSymbol(moduleSymbol); // Need to get merged symbol in case there's an augmentation.\n            // `export` may appear in a namespace. In that case, just rely on global search.\n            return ts.isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } : undefined;\n        }\n        FindAllReferences.getExportInfo = getExportInfo;\n        /** If at an export specifier, go to the symbol it refers to. */\n        function skipExportSpecifierSymbol(symbol, checker) {\n            // For `export { foo } from './bar\", there's nothing to skip, because it does not create a new alias. But `export { foo } does.\n            if (symbol.declarations) {\n                for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                    var declaration = _a[_i];\n                    if (ts.isExportSpecifier(declaration) && !declaration.propertyName && !declaration.parent.parent.moduleSpecifier) {\n                        return checker.getExportSpecifierLocalTargetSymbol(declaration);\n                    }\n                    else if (ts.isPropertyAccessExpression(declaration) && ts.isModuleExportsAccessExpression(declaration.expression) && !ts.isPrivateIdentifier(declaration.name)) {\n                        return checker.getExportSpecifierLocalTargetSymbol(declaration.name);\n                    }\n                    else if (ts.isShorthandPropertyAssignment(declaration)\n                        && ts.isBinaryExpression(declaration.parent.parent)\n                        && ts.getAssignmentDeclarationKind(declaration.parent.parent) === 2 /* ModuleExports */) {\n                        return checker.getExportSpecifierLocalTargetSymbol(declaration.name);\n                    }\n                }\n            }\n            return symbol;\n        }\n        function getContainingModuleSymbol(importer, checker) {\n            return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol);\n        }\n        function getSourceFileLikeForImportDeclaration(node) {\n            if (node.kind === 203 /* CallExpression */) {\n                return node.getSourceFile();\n            }\n            var parent = node.parent;\n            if (parent.kind === 297 /* SourceFile */) {\n                return parent;\n            }\n            ts.Debug.assert(parent.kind === 257 /* ModuleBlock */);\n            return ts.cast(parent.parent, isAmbientModuleDeclaration);\n        }\n        function isAmbientModuleDeclaration(node) {\n            return node.kind === 256 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */;\n        }\n        function isExternalModuleImportEquals(eq) {\n            return eq.moduleReference.kind === 272 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */;\n        }\n    })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var FindAllReferences;\n    (function (FindAllReferences) {\n        var DefinitionKind;\n        (function (DefinitionKind) {\n            DefinitionKind[DefinitionKind[\"Symbol\"] = 0] = \"Symbol\";\n            DefinitionKind[DefinitionKind[\"Label\"] = 1] = \"Label\";\n            DefinitionKind[DefinitionKind[\"Keyword\"] = 2] = \"Keyword\";\n            DefinitionKind[DefinitionKind[\"This\"] = 3] = \"This\";\n            DefinitionKind[DefinitionKind[\"String\"] = 4] = \"String\";\n            DefinitionKind[DefinitionKind[\"TripleSlashReference\"] = 5] = \"TripleSlashReference\";\n        })(DefinitionKind = FindAllReferences.DefinitionKind || (FindAllReferences.DefinitionKind = {}));\n        var EntryKind;\n        (function (EntryKind) {\n            EntryKind[EntryKind[\"Span\"] = 0] = \"Span\";\n            EntryKind[EntryKind[\"Node\"] = 1] = \"Node\";\n            EntryKind[EntryKind[\"StringLiteral\"] = 2] = \"StringLiteral\";\n            EntryKind[EntryKind[\"SearchedLocalFoundProperty\"] = 3] = \"SearchedLocalFoundProperty\";\n            EntryKind[EntryKind[\"SearchedPropertyFoundLocal\"] = 4] = \"SearchedPropertyFoundLocal\";\n        })(EntryKind = FindAllReferences.EntryKind || (FindAllReferences.EntryKind = {}));\n        function nodeEntry(node, kind) {\n            if (kind === void 0) { kind = 1 /* Node */; }\n            return {\n                kind: kind,\n                node: node.name || node,\n                context: getContextNodeForNodeEntry(node)\n            };\n        }\n        FindAllReferences.nodeEntry = nodeEntry;\n        function isContextWithStartAndEndNode(node) {\n            return node && node.kind === undefined;\n        }\n        FindAllReferences.isContextWithStartAndEndNode = isContextWithStartAndEndNode;\n        function getContextNodeForNodeEntry(node) {\n            if (ts.isDeclaration(node)) {\n                return getContextNode(node);\n            }\n            if (!node.parent)\n                return undefined;\n            if (!ts.isDeclaration(node.parent) && !ts.isExportAssignment(node.parent)) {\n                // Special property assignment in javascript\n                if (ts.isInJSFile(node)) {\n                    var binaryExpression = ts.isBinaryExpression(node.parent) ?\n                        node.parent :\n                        ts.isAccessExpression(node.parent) &&\n                            ts.isBinaryExpression(node.parent.parent) &&\n                            node.parent.parent.left === node.parent ?\n                            node.parent.parent :\n                            undefined;\n                    if (binaryExpression && ts.getAssignmentDeclarationKind(binaryExpression) !== 0 /* None */) {\n                        return getContextNode(binaryExpression);\n                    }\n                }\n                // Jsx Tags\n                if (ts.isJsxOpeningElement(node.parent) || ts.isJsxClosingElement(node.parent)) {\n                    return node.parent.parent;\n                }\n                else if (ts.isJsxSelfClosingElement(node.parent) ||\n                    ts.isLabeledStatement(node.parent) ||\n                    ts.isBreakOrContinueStatement(node.parent)) {\n                    return node.parent;\n                }\n                else if (ts.isStringLiteralLike(node)) {\n                    var validImport = ts.tryGetImportFromModuleSpecifier(node);\n                    if (validImport) {\n                        var declOrStatement = ts.findAncestor(validImport, function (node) {\n                            return ts.isDeclaration(node) ||\n                                ts.isStatement(node) ||\n                                ts.isJSDocTag(node);\n                        });\n                        return ts.isDeclaration(declOrStatement) ?\n                            getContextNode(declOrStatement) :\n                            declOrStatement;\n                    }\n                }\n                // Handle computed property name\n                var propertyName = ts.findAncestor(node, ts.isComputedPropertyName);\n                return propertyName ?\n                    getContextNode(propertyName.parent) :\n                    undefined;\n            }\n            if (node.parent.name === node || // node is name of declaration, use parent\n                ts.isConstructorDeclaration(node.parent) ||\n                ts.isExportAssignment(node.parent) ||\n                // Property name of the import export specifier or binding pattern, use parent\n                ((ts.isImportOrExportSpecifier(node.parent) || ts.isBindingElement(node.parent))\n                    && node.parent.propertyName === node) ||\n                // Is default export\n                (node.kind === 87 /* DefaultKeyword */ && ts.hasSyntacticModifier(node.parent, 513 /* ExportDefault */))) {\n                return getContextNode(node.parent);\n            }\n            return undefined;\n        }\n        function getContextNode(node) {\n            if (!node)\n                return undefined;\n            switch (node.kind) {\n                case 249 /* VariableDeclaration */:\n                    return !ts.isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ?\n                        node :\n                        ts.isVariableStatement(node.parent.parent) ?\n                            node.parent.parent :\n                            ts.isForInOrOfStatement(node.parent.parent) ?\n                                getContextNode(node.parent.parent) :\n                                node.parent;\n                case 198 /* BindingElement */:\n                    return getContextNode(node.parent.parent);\n                case 265 /* ImportSpecifier */:\n                    return node.parent.parent.parent;\n                case 270 /* ExportSpecifier */:\n                case 263 /* NamespaceImport */:\n                    return node.parent.parent;\n                case 262 /* ImportClause */:\n                case 269 /* NamespaceExport */:\n                    return node.parent;\n                case 216 /* BinaryExpression */:\n                    return ts.isExpressionStatement(node.parent) ?\n                        node.parent :\n                        node;\n                case 239 /* ForOfStatement */:\n                case 238 /* ForInStatement */:\n                    return {\n                        start: node.initializer,\n                        end: node.expression\n                    };\n                case 288 /* PropertyAssignment */:\n                case 289 /* ShorthandPropertyAssignment */:\n                    return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ?\n                        getContextNode(ts.findAncestor(node.parent, function (node) {\n                            return ts.isBinaryExpression(node) || ts.isForInOrOfStatement(node);\n                        })) :\n                        node;\n                default:\n                    return node;\n            }\n        }\n        FindAllReferences.getContextNode = getContextNode;\n        function toContextSpan(textSpan, sourceFile, context) {\n            if (!context)\n                return undefined;\n            var contextSpan = isContextWithStartAndEndNode(context) ?\n                getTextSpan(context.start, sourceFile, context.end) :\n                getTextSpan(context, sourceFile);\n            return contextSpan.start !== textSpan.start || contextSpan.length !== textSpan.length ?\n                { contextSpan: contextSpan } :\n                undefined;\n        }\n        FindAllReferences.toContextSpan = toContextSpan;\n        var FindReferencesUse;\n        (function (FindReferencesUse) {\n            /**\n             * When searching for references to a symbol, the location will not be adjusted (this is the default behavior when not specified).\n             */\n            FindReferencesUse[FindReferencesUse[\"Other\"] = 0] = \"Other\";\n            /**\n             * When searching for references to a symbol, the location will be adjusted if the cursor was on a keyword.\n             */\n            FindReferencesUse[FindReferencesUse[\"References\"] = 1] = \"References\";\n            /**\n             * When searching for references to a symbol, the location will be adjusted if the cursor was on a keyword.\n             * Unlike `References`, the location will only be adjusted keyword belonged to a declaration with a valid name.\n             * If set, we will find fewer references -- if it is referenced by several different names, we still only find references for the original name.\n             */\n            FindReferencesUse[FindReferencesUse[\"Rename\"] = 2] = \"Rename\";\n        })(FindReferencesUse = FindAllReferences.FindReferencesUse || (FindAllReferences.FindReferencesUse = {}));\n        function findReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position) {\n            var node = ts.getTouchingPropertyName(sourceFile, position);\n            var referencedSymbols = Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, { use: 1 /* References */ });\n            var checker = program.getTypeChecker();\n            return !referencedSymbols || !referencedSymbols.length ? undefined : ts.mapDefined(referencedSymbols, function (_a) {\n                var definition = _a.definition, references = _a.references;\n                // Only include referenced symbols that have a valid definition.\n                return definition && {\n                    definition: checker.runWithCancellationToken(cancellationToken, function (checker) { return definitionToReferencedSymbolDefinitionInfo(definition, checker, node); }),\n                    references: references.map(toReferenceEntry)\n                };\n            });\n        }\n        FindAllReferences.findReferencedSymbols = findReferencedSymbols;\n        function getImplementationsAtPosition(program, cancellationToken, sourceFiles, sourceFile, position) {\n            var node = ts.getTouchingPropertyName(sourceFile, position);\n            var referenceEntries;\n            var entries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position);\n            if (node.parent.kind === 201 /* PropertyAccessExpression */\n                || node.parent.kind === 198 /* BindingElement */\n                || node.parent.kind === 202 /* ElementAccessExpression */\n                || node.kind === 105 /* SuperKeyword */) {\n                referenceEntries = entries && __spreadArray([], entries);\n            }\n            else {\n                var queue = entries && __spreadArray([], entries);\n                var seenNodes = new ts.Map();\n                while (queue && queue.length) {\n                    var entry = queue.shift();\n                    if (!ts.addToSeen(seenNodes, ts.getNodeId(entry.node))) {\n                        continue;\n                    }\n                    referenceEntries = ts.append(referenceEntries, entry);\n                    var entries_1 = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, entry.node, entry.node.pos);\n                    if (entries_1) {\n                        queue.push.apply(queue, entries_1);\n                    }\n                }\n            }\n            var checker = program.getTypeChecker();\n            return ts.map(referenceEntries, function (entry) { return toImplementationLocation(entry, checker); });\n        }\n        FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition;\n        function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) {\n            if (node.kind === 297 /* SourceFile */) {\n                return undefined;\n            }\n            var checker = program.getTypeChecker();\n            // If invoked directly on a shorthand property assignment, then return\n            // the declaration of the symbol being assigned (not the symbol being assigned to).\n            if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) {\n                var result_1 = [];\n                Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_1.push(nodeEntry(node)); });\n                return result_1;\n            }\n            else if (node.kind === 105 /* SuperKeyword */ || ts.isSuperProperty(node.parent)) {\n                // References to and accesses on the super keyword only have one possible implementation, so no\n                // need to \"Find all References\"\n                var symbol = checker.getSymbolAtLocation(node);\n                return symbol.valueDeclaration && [nodeEntry(symbol.valueDeclaration)];\n            }\n            else {\n                // Perform \"Find all References\" and retrieve only those that are implementations\n                return getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, { implementations: true, use: 1 /* References */ });\n            }\n        }\n        function findReferenceOrRenameEntries(program, cancellationToken, sourceFiles, node, position, options, convertEntry) {\n            return ts.map(flattenEntries(Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), function (entry) { return convertEntry(entry, node, program.getTypeChecker()); });\n        }\n        FindAllReferences.findReferenceOrRenameEntries = findReferenceOrRenameEntries;\n        function getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, options, sourceFilesSet) {\n            if (options === void 0) { options = {}; }\n            if (sourceFilesSet === void 0) { sourceFilesSet = new ts.Set(sourceFiles.map(function (f) { return f.fileName; })); }\n            return flattenEntries(Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options, sourceFilesSet));\n        }\n        FindAllReferences.getReferenceEntriesForNode = getReferenceEntriesForNode;\n        function flattenEntries(referenceSymbols) {\n            return referenceSymbols && ts.flatMap(referenceSymbols, function (r) { return r.references; });\n        }\n        function definitionToReferencedSymbolDefinitionInfo(def, checker, originalNode) {\n            var info = (function () {\n                switch (def.type) {\n                    case 0 /* Symbol */: {\n                        var symbol = def.symbol;\n                        var _a = getDefinitionKindAndDisplayParts(symbol, checker, originalNode), displayParts_1 = _a.displayParts, kind_1 = _a.kind;\n                        var name_1 = displayParts_1.map(function (p) { return p.text; }).join(\"\");\n                        var declaration = symbol.declarations && ts.firstOrUndefined(symbol.declarations);\n                        var node = declaration ? (ts.getNameOfDeclaration(declaration) || declaration) : originalNode;\n                        return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1,\n                            kind: kind_1,\n                            displayParts: displayParts_1, context: getContextNode(declaration) });\n                    }\n                    case 1 /* Label */: {\n                        var node = def.node;\n                        return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: node.text, kind: \"label\" /* label */, displayParts: [ts.displayPart(node.text, ts.SymbolDisplayPartKind.text)] });\n                    }\n                    case 2 /* Keyword */: {\n                        var node = def.node;\n                        var name_2 = ts.tokenToString(node.kind);\n                        return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_2, kind: \"keyword\" /* keyword */, displayParts: [{ text: name_2, kind: \"keyword\" /* keyword */ }] });\n                    }\n                    case 3 /* This */: {\n                        var node = def.node;\n                        var symbol = checker.getSymbolAtLocation(node);\n                        var displayParts_2 = symbol && ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node.getSourceFile(), ts.getContainerNode(node), node).displayParts || [ts.textPart(\"this\")];\n                        return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: \"this\", kind: \"var\" /* variableElement */, displayParts: displayParts_2 });\n                    }\n                    case 4 /* String */: {\n                        var node = def.node;\n                        return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: node.text, kind: \"var\" /* variableElement */, displayParts: [ts.displayPart(ts.getTextOfNode(node), ts.SymbolDisplayPartKind.stringLiteral)] });\n                    }\n                    case 5 /* TripleSlashReference */: {\n                        return {\n                            textSpan: ts.createTextSpanFromRange(def.reference),\n                            sourceFile: def.file,\n                            name: def.reference.fileName,\n                            kind: \"string\" /* string */,\n                            displayParts: [ts.displayPart(\"\\\"\" + def.reference.fileName + \"\\\"\", ts.SymbolDisplayPartKind.stringLiteral)]\n                        };\n                    }\n                    default:\n                        return ts.Debug.assertNever(def);\n                }\n            })();\n            var sourceFile = info.sourceFile, textSpan = info.textSpan, name = info.name, kind = info.kind, displayParts = info.displayParts, context = info.context;\n            return __assign({ containerKind: \"\" /* unknown */, containerName: \"\", fileName: sourceFile.fileName, kind: kind,\n                name: name,\n                textSpan: textSpan,\n                displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context));\n        }\n        function getFileAndTextSpanFromNode(node) {\n            var sourceFile = node.getSourceFile();\n            return {\n                sourceFile: sourceFile,\n                textSpan: getTextSpan(ts.isComputedPropertyName(node) ? node.expression : node, sourceFile)\n            };\n        }\n        function getDefinitionKindAndDisplayParts(symbol, checker, node) {\n            var meaning = Core.getIntersectingMeaningFromDeclarations(node, symbol);\n            var enclosingDeclaration = symbol.declarations && ts.firstOrUndefined(symbol.declarations) || node;\n            var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, enclosingDeclaration.getSourceFile(), enclosingDeclaration, enclosingDeclaration, meaning), displayParts = _a.displayParts, symbolKind = _a.symbolKind;\n            return { displayParts: displayParts, kind: symbolKind };\n        }\n        function toRenameLocation(entry, originalNode, checker, providePrefixAndSuffixText) {\n            return __assign(__assign({}, entryToDocumentSpan(entry)), (providePrefixAndSuffixText && getPrefixAndSuffixText(entry, originalNode, checker)));\n        }\n        FindAllReferences.toRenameLocation = toRenameLocation;\n        function toReferenceEntry(entry) {\n            var documentSpan = entryToDocumentSpan(entry);\n            if (entry.kind === 0 /* Span */) {\n                return __assign(__assign({}, documentSpan), { isWriteAccess: false, isDefinition: false });\n            }\n            var kind = entry.kind, node = entry.node;\n            return __assign(__assign({}, documentSpan), { isWriteAccess: isWriteAccessForReference(node), isDefinition: isDefinitionForReference(node), isInString: kind === 2 /* StringLiteral */ ? true : undefined });\n        }\n        FindAllReferences.toReferenceEntry = toReferenceEntry;\n        function entryToDocumentSpan(entry) {\n            if (entry.kind === 0 /* Span */) {\n                return { textSpan: entry.textSpan, fileName: entry.fileName };\n            }\n            else {\n                var sourceFile = entry.node.getSourceFile();\n                var textSpan = getTextSpan(entry.node, sourceFile);\n                return __assign({ textSpan: textSpan, fileName: sourceFile.fileName }, toContextSpan(textSpan, sourceFile, entry.context));\n            }\n        }\n        function getPrefixAndSuffixText(entry, originalNode, checker) {\n            if (entry.kind !== 0 /* Span */ && ts.isIdentifier(originalNode)) {\n                var node = entry.node, kind = entry.kind;\n                var parent = node.parent;\n                var name = originalNode.text;\n                var isShorthandAssignment = ts.isShorthandPropertyAssignment(parent);\n                if (isShorthandAssignment || (ts.isObjectBindingElementWithoutPropertyName(parent) && parent.name === node && parent.dotDotDotToken === undefined)) {\n                    var prefixColon = { prefixText: name + \": \" };\n                    var suffixColon = { suffixText: \": \" + name };\n                    if (kind === 3 /* SearchedLocalFoundProperty */) {\n                        return prefixColon;\n                    }\n                    if (kind === 4 /* SearchedPropertyFoundLocal */) {\n                        return suffixColon;\n                    }\n                    // In `const o = { x }; o.x`, symbolAtLocation at `x` in `{ x }` is the property symbol.\n                    // For a binding element `const { x } = o;`, symbolAtLocation at `x` is the property symbol.\n                    if (isShorthandAssignment) {\n                        var grandParent = parent.parent;\n                        if (ts.isObjectLiteralExpression(grandParent) &&\n                            ts.isBinaryExpression(grandParent.parent) &&\n                            ts.isModuleExportsAccessExpression(grandParent.parent.left)) {\n                            return prefixColon;\n                        }\n                        return suffixColon;\n                    }\n                    else {\n                        return prefixColon;\n                    }\n                }\n                else if (ts.isImportSpecifier(parent) && !parent.propertyName) {\n                    // If the original symbol was using this alias, just rename the alias.\n                    var originalSymbol = ts.isExportSpecifier(originalNode.parent) ? checker.getExportSpecifierLocalTargetSymbol(originalNode.parent) : checker.getSymbolAtLocation(originalNode);\n                    return ts.contains(originalSymbol.declarations, parent) ? { prefixText: name + \" as \" } : ts.emptyOptions;\n                }\n                else if (ts.isExportSpecifier(parent) && !parent.propertyName) {\n                    // If the symbol for the node is same as declared node symbol use prefix text\n                    return originalNode === entry.node || checker.getSymbolAtLocation(originalNode) === checker.getSymbolAtLocation(entry.node) ?\n                        { prefixText: name + \" as \" } :\n                        { suffixText: \" as \" + name };\n                }\n            }\n            return ts.emptyOptions;\n        }\n        function toImplementationLocation(entry, checker) {\n            var documentSpan = entryToDocumentSpan(entry);\n            if (entry.kind !== 0 /* Span */) {\n                var node = entry.node;\n                return __assign(__assign({}, documentSpan), implementationKindDisplayParts(node, checker));\n            }\n            else {\n                return __assign(__assign({}, documentSpan), { kind: \"\" /* unknown */, displayParts: [] });\n            }\n        }\n        function implementationKindDisplayParts(node, checker) {\n            var symbol = checker.getSymbolAtLocation(ts.isDeclaration(node) && node.name ? node.name : node);\n            if (symbol) {\n                return getDefinitionKindAndDisplayParts(symbol, checker, node);\n            }\n            else if (node.kind === 200 /* ObjectLiteralExpression */) {\n                return {\n                    kind: \"interface\" /* interfaceElement */,\n                    displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart(\"object literal\"), ts.punctuationPart(21 /* CloseParenToken */)]\n                };\n            }\n            else if (node.kind === 221 /* ClassExpression */) {\n                return {\n                    kind: \"local class\" /* localClassElement */,\n                    displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart(\"anonymous local class\"), ts.punctuationPart(21 /* CloseParenToken */)]\n                };\n            }\n            else {\n                return { kind: ts.getNodeKind(node), displayParts: [] };\n            }\n        }\n        function toHighlightSpan(entry) {\n            var documentSpan = entryToDocumentSpan(entry);\n            if (entry.kind === 0 /* Span */) {\n                return {\n                    fileName: documentSpan.fileName,\n                    span: {\n                        textSpan: documentSpan.textSpan,\n                        kind: \"reference\" /* reference */\n                    }\n                };\n            }\n            var writeAccess = isWriteAccessForReference(entry.node);\n            var span = __assign({ textSpan: documentSpan.textSpan, kind: writeAccess ? \"writtenReference\" /* writtenReference */ : \"reference\" /* reference */, isInString: entry.kind === 2 /* StringLiteral */ ? true : undefined }, documentSpan.contextSpan && { contextSpan: documentSpan.contextSpan });\n            return { fileName: documentSpan.fileName, span: span };\n        }\n        FindAllReferences.toHighlightSpan = toHighlightSpan;\n        function getTextSpan(node, sourceFile, endNode) {\n            var start = node.getStart(sourceFile);\n            var end = (endNode || node).getEnd();\n            if (ts.isStringLiteralLike(node)) {\n                ts.Debug.assert(endNode === undefined);\n                start += 1;\n                end -= 1;\n            }\n            return ts.createTextSpanFromBounds(start, end);\n        }\n        function getTextSpanOfEntry(entry) {\n            return entry.kind === 0 /* Span */ ? entry.textSpan :\n                getTextSpan(entry.node, entry.node.getSourceFile());\n        }\n        FindAllReferences.getTextSpanOfEntry = getTextSpanOfEntry;\n        /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */\n        function isWriteAccessForReference(node) {\n            var decl = ts.getDeclarationFromName(node);\n            return !!decl && declarationIsWriteAccess(decl) || node.kind === 87 /* DefaultKeyword */ || ts.isWriteAccess(node);\n        }\n        function isDefinitionForReference(node) {\n            return node.kind === 87 /* DefaultKeyword */\n                || !!ts.getDeclarationFromName(node)\n                || ts.isLiteralComputedPropertyDeclarationName(node)\n                || (node.kind === 132 /* ConstructorKeyword */ && ts.isConstructorDeclaration(node.parent));\n        }\n        /**\n         * True if 'decl' provides a value, as in `function f() {}`;\n         * false if 'decl' is just a location for a future write, as in 'let x;'\n         */\n        function declarationIsWriteAccess(decl) {\n            // Consider anything in an ambient declaration to be a write access since it may be coming from JS.\n            if (!!(decl.flags & 8388608 /* Ambient */))\n                return true;\n            switch (decl.kind) {\n                case 216 /* BinaryExpression */:\n                case 198 /* BindingElement */:\n                case 252 /* ClassDeclaration */:\n                case 221 /* ClassExpression */:\n                case 87 /* DefaultKeyword */:\n                case 255 /* EnumDeclaration */:\n                case 291 /* EnumMember */:\n                case 270 /* ExportSpecifier */:\n                case 262 /* ImportClause */: // default import\n                case 260 /* ImportEqualsDeclaration */:\n                case 265 /* ImportSpecifier */:\n                case 253 /* InterfaceDeclaration */:\n                case 324 /* JSDocCallbackTag */:\n                case 331 /* JSDocTypedefTag */:\n                case 280 /* JsxAttribute */:\n                case 256 /* ModuleDeclaration */:\n                case 259 /* NamespaceExportDeclaration */:\n                case 263 /* NamespaceImport */:\n                case 269 /* NamespaceExport */:\n                case 160 /* Parameter */:\n                case 289 /* ShorthandPropertyAssignment */:\n                case 254 /* TypeAliasDeclaration */:\n                case 159 /* TypeParameter */:\n                    return true;\n                case 288 /* PropertyAssignment */:\n                    // In `({ x: y } = 0);`, `x` is not a write access. (Won't call this function for `y`.)\n                    return !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent);\n                case 251 /* FunctionDeclaration */:\n                case 208 /* FunctionExpression */:\n                case 166 /* Constructor */:\n                case 165 /* MethodDeclaration */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    return !!decl.body;\n                case 249 /* VariableDeclaration */:\n                case 163 /* PropertyDeclaration */:\n                    return !!decl.initializer || ts.isCatchClause(decl.parent);\n                case 164 /* MethodSignature */:\n                case 162 /* PropertySignature */:\n                case 333 /* JSDocPropertyTag */:\n                case 326 /* JSDocParameterTag */:\n                    return false;\n                default:\n                    return ts.Debug.failBadSyntaxKind(decl);\n            }\n        }\n        /** Encapsulates the core find-all-references algorithm. */\n        var Core;\n        (function (Core) {\n            /** Core find-all-references algorithm. Handles special cases before delegating to `getReferencedSymbolsForSymbol`. */\n            function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options, sourceFilesSet) {\n                var _a, _b;\n                if (options === void 0) { options = {}; }\n                if (sourceFilesSet === void 0) { sourceFilesSet = new ts.Set(sourceFiles.map(function (f) { return f.fileName; })); }\n                if (options.use === 1 /* References */) {\n                    node = ts.getAdjustedReferenceLocation(node);\n                }\n                else if (options.use === 2 /* Rename */) {\n                    node = ts.getAdjustedRenameLocation(node);\n                }\n                if (ts.isSourceFile(node)) {\n                    var resolvedRef = ts.GoToDefinition.getReferenceAtPosition(node, position, program);\n                    if (!resolvedRef) {\n                        return undefined;\n                    }\n                    var moduleSymbol = program.getTypeChecker().getMergedSymbol(resolvedRef.file.symbol);\n                    if (moduleSymbol) {\n                        return getReferencedSymbolsForModule(program, moduleSymbol, /*excludeImportTypeOfExportEquals*/ false, sourceFiles, sourceFilesSet);\n                    }\n                    var fileIncludeReasons = program.getFileIncludeReasons();\n                    if (!fileIncludeReasons) {\n                        return undefined;\n                    }\n                    return [{\n                            definition: { type: 5 /* TripleSlashReference */, reference: resolvedRef.reference, file: node },\n                            references: getReferencesForNonModule(resolvedRef.file, fileIncludeReasons, program) || ts.emptyArray\n                        }];\n                }\n                if (!options.implementations) {\n                    var special = getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken);\n                    if (special) {\n                        return special;\n                    }\n                }\n                var checker = program.getTypeChecker();\n                // constructors should use the class symbol, detected by name, if present\n                var symbol = checker.getSymbolAtLocation(ts.isConstructorDeclaration(node) && node.parent.name || node);\n                // Could not find a symbol e.g. unknown identifier\n                if (!symbol) {\n                    // String literal might be a property (and thus have a symbol), so do this here rather than in getReferencedSymbolsSpecial.\n                    if (!options.implementations && ts.isStringLiteralLike(node)) {\n                        if (ts.isRequireCall(node.parent, /*requireStringLiteralLikeArgument*/ true) || ts.isExternalModuleReference(node.parent) || ts.isImportDeclaration(node.parent) || ts.isImportCall(node.parent)) {\n                            var fileIncludeReasons = program.getFileIncludeReasons();\n                            var referencedFileName = (_b = (_a = node.getSourceFile().resolvedModules) === null || _a === void 0 ? void 0 : _a.get(node.text)) === null || _b === void 0 ? void 0 : _b.resolvedFileName;\n                            var referencedFile = referencedFileName ? program.getSourceFile(referencedFileName) : undefined;\n                            if (referencedFile) {\n                                return [{ definition: { type: 4 /* String */, node: node }, references: getReferencesForNonModule(referencedFile, fileIncludeReasons, program) || ts.emptyArray }];\n                            }\n                            // Fall through to string literal references. This is not very likely to return\n                            // anything useful, but I guess it's better than nothing, and there's an existing\n                            // test that expects this to happen (fourslash/cases/untypedModuleImport.ts).\n                        }\n                        return getReferencesForStringLiteral(node, sourceFiles, checker, cancellationToken);\n                    }\n                    return undefined;\n                }\n                if (symbol.escapedName === \"export=\" /* ExportEquals */) {\n                    return getReferencedSymbolsForModule(program, symbol.parent, /*excludeImportTypeOfExportEquals*/ false, sourceFiles, sourceFilesSet);\n                }\n                var moduleReferences = getReferencedSymbolsForModuleIfDeclaredBySourceFile(symbol, program, sourceFiles, cancellationToken, options, sourceFilesSet);\n                if (moduleReferences && !(symbol.flags & 33554432 /* Transient */)) {\n                    return moduleReferences;\n                }\n                var aliasedSymbol = getMergedAliasedSymbolOfNamespaceExportDeclaration(node, symbol, checker);\n                var moduleReferencesOfExportTarget = aliasedSymbol &&\n                    getReferencedSymbolsForModuleIfDeclaredBySourceFile(aliasedSymbol, program, sourceFiles, cancellationToken, options, sourceFilesSet);\n                var references = getReferencedSymbolsForSymbol(symbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options);\n                return mergeReferences(program, moduleReferences, references, moduleReferencesOfExportTarget);\n            }\n            Core.getReferencedSymbolsForNode = getReferencedSymbolsForNode;\n            function getReferencesForFileName(fileName, program, sourceFiles, sourceFilesSet) {\n                var _a, _b;\n                if (sourceFilesSet === void 0) { sourceFilesSet = new ts.Set(sourceFiles.map(function (f) { return f.fileName; })); }\n                var moduleSymbol = (_a = program.getSourceFile(fileName)) === null || _a === void 0 ? void 0 : _a.symbol;\n                if (moduleSymbol) {\n                    return ((_b = getReferencedSymbolsForModule(program, moduleSymbol, /*excludeImportTypeOfExportEquals*/ false, sourceFiles, sourceFilesSet)[0]) === null || _b === void 0 ? void 0 : _b.references) || ts.emptyArray;\n                }\n                var fileIncludeReasons = program.getFileIncludeReasons();\n                var referencedFile = program.getSourceFile(fileName);\n                return referencedFile && fileIncludeReasons && getReferencesForNonModule(referencedFile, fileIncludeReasons, program) || ts.emptyArray;\n            }\n            Core.getReferencesForFileName = getReferencesForFileName;\n            function getReferencesForNonModule(referencedFile, refFileMap, program) {\n                var entries;\n                var references = refFileMap.get(referencedFile.path) || ts.emptyArray;\n                for (var _i = 0, references_1 = references; _i < references_1.length; _i++) {\n                    var ref = references_1[_i];\n                    if (ts.isReferencedFile(ref)) {\n                        var referencingFile = program.getSourceFileByPath(ref.file);\n                        var location = ts.getReferencedFileLocation(program.getSourceFileByPath, ref);\n                        if (ts.isReferenceFileLocation(location)) {\n                            entries = ts.append(entries, {\n                                kind: 0 /* Span */,\n                                fileName: referencingFile.fileName,\n                                textSpan: ts.createTextSpanFromRange(location)\n                            });\n                        }\n                    }\n                }\n                return entries;\n            }\n            function getMergedAliasedSymbolOfNamespaceExportDeclaration(node, symbol, checker) {\n                if (node.parent && ts.isNamespaceExportDeclaration(node.parent)) {\n                    var aliasedSymbol = checker.getAliasedSymbol(symbol);\n                    var targetSymbol = checker.getMergedSymbol(aliasedSymbol);\n                    if (aliasedSymbol !== targetSymbol) {\n                        return targetSymbol;\n                    }\n                }\n                return undefined;\n            }\n            function getReferencedSymbolsForModuleIfDeclaredBySourceFile(symbol, program, sourceFiles, cancellationToken, options, sourceFilesSet) {\n                var moduleSourceFile = (symbol.flags & 1536 /* Module */) && symbol.declarations && ts.find(symbol.declarations, ts.isSourceFile);\n                if (!moduleSourceFile)\n                    return undefined;\n                var exportEquals = symbol.exports.get(\"export=\" /* ExportEquals */);\n                // If !!exportEquals, we're about to add references to `import(\"mod\")` anyway, so don't double-count them.\n                var moduleReferences = getReferencedSymbolsForModule(program, symbol, !!exportEquals, sourceFiles, sourceFilesSet);\n                if (!exportEquals || !sourceFilesSet.has(moduleSourceFile.fileName))\n                    return moduleReferences;\n                // Continue to get references to 'export ='.\n                var checker = program.getTypeChecker();\n                symbol = ts.skipAlias(exportEquals, checker);\n                return mergeReferences(program, moduleReferences, getReferencedSymbolsForSymbol(symbol, /*node*/ undefined, sourceFiles, sourceFilesSet, checker, cancellationToken, options));\n            }\n            /**\n             * Merges the references by sorting them (by file index in sourceFiles and their location in it) that point to same definition symbol\n             */\n            function mergeReferences(program) {\n                var referencesToMerge = [];\n                for (var _i = 1; _i < arguments.length; _i++) {\n                    referencesToMerge[_i - 1] = arguments[_i];\n                }\n                var result;\n                for (var _a = 0, referencesToMerge_1 = referencesToMerge; _a < referencesToMerge_1.length; _a++) {\n                    var references = referencesToMerge_1[_a];\n                    if (!references || !references.length)\n                        continue;\n                    if (!result) {\n                        result = references;\n                        continue;\n                    }\n                    var _loop_3 = function (entry) {\n                        if (!entry.definition || entry.definition.type !== 0 /* Symbol */) {\n                            result.push(entry);\n                            return \"continue\";\n                        }\n                        var symbol = entry.definition.symbol;\n                        var refIndex = ts.findIndex(result, function (ref) { return !!ref.definition &&\n                            ref.definition.type === 0 /* Symbol */ &&\n                            ref.definition.symbol === symbol; });\n                        if (refIndex === -1) {\n                            result.push(entry);\n                            return \"continue\";\n                        }\n                        var reference = result[refIndex];\n                        result[refIndex] = {\n                            definition: reference.definition,\n                            references: reference.references.concat(entry.references).sort(function (entry1, entry2) {\n                                var entry1File = getSourceFileIndexOfEntry(program, entry1);\n                                var entry2File = getSourceFileIndexOfEntry(program, entry2);\n                                if (entry1File !== entry2File) {\n                                    return ts.compareValues(entry1File, entry2File);\n                                }\n                                var entry1Span = getTextSpanOfEntry(entry1);\n                                var entry2Span = getTextSpanOfEntry(entry2);\n                                return entry1Span.start !== entry2Span.start ?\n                                    ts.compareValues(entry1Span.start, entry2Span.start) :\n                                    ts.compareValues(entry1Span.length, entry2Span.length);\n                            })\n                        };\n                    };\n                    for (var _b = 0, references_2 = references; _b < references_2.length; _b++) {\n                        var entry = references_2[_b];\n                        _loop_3(entry);\n                    }\n                }\n                return result;\n            }\n            function getSourceFileIndexOfEntry(program, entry) {\n                var sourceFile = entry.kind === 0 /* Span */ ?\n                    program.getSourceFile(entry.fileName) :\n                    entry.node.getSourceFile();\n                return program.getSourceFiles().indexOf(sourceFile);\n            }\n            function getReferencedSymbolsForModule(program, symbol, excludeImportTypeOfExportEquals, sourceFiles, sourceFilesSet) {\n                ts.Debug.assert(!!symbol.valueDeclaration);\n                var references = ts.mapDefined(FindAllReferences.findModuleReferences(program, sourceFiles, symbol), function (reference) {\n                    if (reference.kind === \"import\") {\n                        var parent = reference.literal.parent;\n                        if (ts.isLiteralTypeNode(parent)) {\n                            var importType = ts.cast(parent.parent, ts.isImportTypeNode);\n                            if (excludeImportTypeOfExportEquals && !importType.qualifier) {\n                                return undefined;\n                            }\n                        }\n                        // import(\"foo\") with no qualifier will reference the `export =` of the module, which may be referenced anyway.\n                        return nodeEntry(reference.literal);\n                    }\n                    else {\n                        return {\n                            kind: 0 /* Span */,\n                            fileName: reference.referencingFile.fileName,\n                            textSpan: ts.createTextSpanFromRange(reference.ref),\n                        };\n                    }\n                });\n                if (symbol.declarations) {\n                    for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                        var decl = _a[_i];\n                        switch (decl.kind) {\n                            case 297 /* SourceFile */:\n                                // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.)\n                                break;\n                            case 256 /* ModuleDeclaration */:\n                                if (sourceFilesSet.has(decl.getSourceFile().fileName)) {\n                                    references.push(nodeEntry(decl.name));\n                                }\n                                break;\n                            default:\n                                // This may be merged with something.\n                                ts.Debug.assert(!!(symbol.flags & 33554432 /* Transient */), \"Expected a module symbol to be declared by a SourceFile or ModuleDeclaration.\");\n                        }\n                    }\n                }\n                var exported = symbol.exports.get(\"export=\" /* ExportEquals */);\n                if (exported) {\n                    for (var _b = 0, _c = exported.declarations; _b < _c.length; _b++) {\n                        var decl = _c[_b];\n                        var sourceFile = decl.getSourceFile();\n                        if (sourceFilesSet.has(sourceFile.fileName)) {\n                            // At `module.exports = ...`, reference node is `module`\n                            var node = ts.isBinaryExpression(decl) && ts.isPropertyAccessExpression(decl.left) ? decl.left.expression :\n                                ts.isExportAssignment(decl) ? ts.Debug.checkDefined(ts.findChildOfKind(decl, 92 /* ExportKeyword */, sourceFile)) :\n                                    ts.getNameOfDeclaration(decl) || decl;\n                            references.push(nodeEntry(node));\n                        }\n                    }\n                }\n                return references.length ? [{ definition: { type: 0 /* Symbol */, symbol: symbol }, references: references }] : ts.emptyArray;\n            }\n            /** As in a `readonly prop: any` or `constructor(readonly prop: any)`, not a `readonly any[]`. */\n            function isReadonlyTypeOperator(node) {\n                return node.kind === 142 /* ReadonlyKeyword */\n                    && ts.isTypeOperatorNode(node.parent)\n                    && node.parent.operator === 142 /* ReadonlyKeyword */;\n            }\n            /** getReferencedSymbols for special node kinds. */\n            function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) {\n                if (ts.isTypeKeyword(node.kind)) {\n                    // A void expression (i.e., `void foo()`) is not special, but the `void` type is.\n                    if (node.kind === 113 /* VoidKeyword */ && ts.isVoidExpression(node.parent)) {\n                        return undefined;\n                    }\n                    // A modifier readonly (like on a property declaration) is not special;\n                    // a readonly type keyword (like `readonly string[]`) is.\n                    if (node.kind === 142 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) {\n                        return undefined;\n                    }\n                    // Likewise, when we *are* looking for a special keyword, make sure we\n                    // *don’t* include readonly member modifiers.\n                    return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 142 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined);\n                }\n                // Labels\n                if (ts.isJumpStatementTarget(node)) {\n                    var labelDefinition = ts.getTargetLabel(node.parent, node.text);\n                    // if we have a label definition, look within its statement for references, if not, then\n                    // the label is undefined and we have no results..\n                    return labelDefinition && getLabelReferencesInNode(labelDefinition.parent, labelDefinition);\n                }\n                else if (ts.isLabelOfLabeledStatement(node)) {\n                    // it is a label definition and not a target, search within the parent labeledStatement\n                    return getLabelReferencesInNode(node.parent, node);\n                }\n                if (ts.isThis(node)) {\n                    return getReferencesForThisKeyword(node, sourceFiles, cancellationToken);\n                }\n                if (node.kind === 105 /* SuperKeyword */) {\n                    return getReferencesForSuperKeyword(node);\n                }\n                return undefined;\n            }\n            /** Core find-all-references algorithm for a normal symbol. */\n            function getReferencedSymbolsForSymbol(originalSymbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options) {\n                var symbol = node && skipPastExportOrImportSpecifierOrUnion(originalSymbol, node, checker, /*useLocalSymbolForExportSpecifier*/ !isForRenameWithPrefixAndSuffixText(options)) || originalSymbol;\n                // Compute the meaning from the location and the symbol it references\n                var searchMeaning = node ? getIntersectingMeaningFromDeclarations(node, symbol) : 7 /* All */;\n                var result = [];\n                var state = new State(sourceFiles, sourceFilesSet, node ? getSpecialSearchKind(node) : 0 /* None */, checker, cancellationToken, searchMeaning, options, result);\n                var exportSpecifier = !isForRenameWithPrefixAndSuffixText(options) ? undefined : ts.find(symbol.declarations, ts.isExportSpecifier);\n                if (exportSpecifier) {\n                    // When renaming at an export specifier, rename the export and not the thing being exported.\n                    getReferencesAtExportSpecifier(exportSpecifier.name, symbol, exportSpecifier, state.createSearch(node, originalSymbol, /*comingFrom*/ undefined), state, /*addReferencesHere*/ true, /*alwaysGetReferences*/ true);\n                }\n                else if (node && node.kind === 87 /* DefaultKeyword */) {\n                    addReference(node, symbol, state);\n                    searchForImportsOfExport(node, symbol, { exportingModuleSymbol: ts.Debug.checkDefined(symbol.parent, \"Expected export symbol to have a parent\"), exportKind: 1 /* Default */ }, state);\n                }\n                else {\n                    var search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: node ? populateSearchSymbolSet(symbol, node, checker, options.use === 2 /* Rename */, !!options.providePrefixAndSuffixTextForRename, !!options.implementations) : [symbol] });\n                    getReferencesInContainerOrFiles(symbol, state, search);\n                }\n                return result;\n            }\n            function getReferencesInContainerOrFiles(symbol, state, search) {\n                // Try to get the smallest valid scope that we can limit our search to;\n                // otherwise we'll need to search globally (i.e. include each file).\n                var scope = getSymbolScope(symbol);\n                if (scope) {\n                    getReferencesInContainer(scope, scope.getSourceFile(), search, state, /*addReferencesHere*/ !(ts.isSourceFile(scope) && !ts.contains(state.sourceFiles, scope)));\n                }\n                else {\n                    // Global search\n                    for (var _i = 0, _a = state.sourceFiles; _i < _a.length; _i++) {\n                        var sourceFile = _a[_i];\n                        state.cancellationToken.throwIfCancellationRequested();\n                        searchForName(sourceFile, search, state);\n                    }\n                }\n            }\n            function getSpecialSearchKind(node) {\n                switch (node.kind) {\n                    case 166 /* Constructor */:\n                    case 132 /* ConstructorKeyword */:\n                        return 1 /* Constructor */;\n                    case 78 /* Identifier */:\n                        if (ts.isClassLike(node.parent)) {\n                            ts.Debug.assert(node.parent.name === node);\n                            return 2 /* Class */;\n                        }\n                    // falls through\n                    default:\n                        return 0 /* None */;\n                }\n            }\n            /** Handle a few special cases relating to export/import specifiers. */\n            function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker, useLocalSymbolForExportSpecifier) {\n                var parent = node.parent;\n                if (ts.isExportSpecifier(parent) && useLocalSymbolForExportSpecifier) {\n                    return getLocalSymbolForExportSpecifier(node, symbol, parent, checker);\n                }\n                // If the symbol is declared as part of a declaration like `{ type: \"a\" } | { type: \"b\" }`, use the property on the union type to get more references.\n                return ts.firstDefined(symbol.declarations, function (decl) {\n                    if (!decl.parent) {\n                        // Ignore UMD module and global merge\n                        if (symbol.flags & 33554432 /* Transient */)\n                            return undefined;\n                        // Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here.\n                        ts.Debug.fail(\"Unexpected symbol at \" + ts.Debug.formatSyntaxKind(node.kind) + \": \" + ts.Debug.formatSymbol(symbol));\n                    }\n                    return ts.isTypeLiteralNode(decl.parent) && ts.isUnionTypeNode(decl.parent.parent)\n                        ? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name)\n                        : undefined;\n                });\n            }\n            var SpecialSearchKind;\n            (function (SpecialSearchKind) {\n                SpecialSearchKind[SpecialSearchKind[\"None\"] = 0] = \"None\";\n                SpecialSearchKind[SpecialSearchKind[\"Constructor\"] = 1] = \"Constructor\";\n                SpecialSearchKind[SpecialSearchKind[\"Class\"] = 2] = \"Class\";\n            })(SpecialSearchKind || (SpecialSearchKind = {}));\n            function getNonModuleSymbolOfMergedModuleSymbol(symbol) {\n                if (!(symbol.flags & (1536 /* Module */ | 33554432 /* Transient */)))\n                    return undefined;\n                var decl = symbol.declarations && ts.find(symbol.declarations, function (d) { return !ts.isSourceFile(d) && !ts.isModuleDeclaration(d); });\n                return decl && decl.symbol;\n            }\n            /**\n             * Holds all state needed for the finding references.\n             * Unlike `Search`, there is only one `State`.\n             */\n            var State = /** @class */ (function () {\n                function State(sourceFiles, sourceFilesSet, specialSearchKind, checker, cancellationToken, searchMeaning, options, result) {\n                    this.sourceFiles = sourceFiles;\n                    this.sourceFilesSet = sourceFilesSet;\n                    this.specialSearchKind = specialSearchKind;\n                    this.checker = checker;\n                    this.cancellationToken = cancellationToken;\n                    this.searchMeaning = searchMeaning;\n                    this.options = options;\n                    this.result = result;\n                    /** Cache for `explicitlyinheritsFrom`. */\n                    this.inheritsFromCache = new ts.Map();\n                    /**\n                     * Type nodes can contain multiple references to the same type. For example:\n                     *      let x: Foo & (Foo & Bar) = ...\n                     * Because we are returning the implementation locations and not the identifier locations,\n                     * duplicate entries would be returned here as each of the type references is part of\n                     * the same implementation. For that reason, check before we add a new entry.\n                     */\n                    this.markSeenContainingTypeReference = ts.nodeSeenTracker();\n                    /**\n                     * It's possible that we will encounter the right side of `export { foo as bar } from \"x\";` more than once.\n                     * For example:\n                     *     // b.ts\n                     *     export { foo as bar } from \"./a\";\n                     *     import { bar } from \"./b\";\n                     *\n                     * Normally at `foo as bar` we directly add `foo` and do not locally search for it (since it doesn't declare a local).\n                     * But another reference to it may appear in the same source file.\n                     * See `tests/cases/fourslash/transitiveExportImports3.ts`.\n                     */\n                    this.markSeenReExportRHS = ts.nodeSeenTracker();\n                    this.symbolIdToReferences = [];\n                    // Source file ID → symbol ID → Whether the symbol has been searched for in the source file.\n                    this.sourceFileToSeenSymbols = [];\n                }\n                State.prototype.includesSourceFile = function (sourceFile) {\n                    return this.sourceFilesSet.has(sourceFile.fileName);\n                };\n                /** Gets every place to look for references of an exported symbols. See `ImportsResult` in `importTracker.ts` for more documentation. */\n                State.prototype.getImportSearches = function (exportSymbol, exportInfo) {\n                    if (!this.importTracker)\n                        this.importTracker = FindAllReferences.createImportTracker(this.sourceFiles, this.sourceFilesSet, this.checker, this.cancellationToken);\n                    return this.importTracker(exportSymbol, exportInfo, this.options.use === 2 /* Rename */);\n                };\n                /** @param allSearchSymbols set of additional symbols for use by `includes`. */\n                State.prototype.createSearch = function (location, symbol, comingFrom, searchOptions) {\n                    if (searchOptions === void 0) { searchOptions = {}; }\n                    // Note: if this is an external module symbol, the name doesn't include quotes.\n                    // Note: getLocalSymbolForExportDefault handles `export default class C {}`, but not `export default C` or `export { C as default }`.\n                    // The other two forms seem to be handled downstream (e.g. in `skipPastExportOrImportSpecifier`), so special-casing the first form\n                    // here appears to be intentional).\n                    var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.symbolName(ts.getLocalSymbolForExportDefault(symbol) || getNonModuleSymbolOfMergedModuleSymbol(symbol) || symbol)) : _a, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? [symbol] : _b;\n                    var escapedText = ts.escapeLeadingUnderscores(text);\n                    var parents = this.options.implementations && location ? getParentSymbolsOfPropertyAccess(location, symbol, this.checker) : undefined;\n                    return { symbol: symbol, comingFrom: comingFrom, text: text, escapedText: escapedText, parents: parents, allSearchSymbols: allSearchSymbols, includes: function (sym) { return ts.contains(allSearchSymbols, sym); } };\n                };\n                /**\n                 * Callback to add references for a particular searched symbol.\n                 * This initializes a reference group, so only call this if you will add at least one reference.\n                 */\n                State.prototype.referenceAdder = function (searchSymbol) {\n                    var symbolId = ts.getSymbolId(searchSymbol);\n                    var references = this.symbolIdToReferences[symbolId];\n                    if (!references) {\n                        references = this.symbolIdToReferences[symbolId] = [];\n                        this.result.push({ definition: { type: 0 /* Symbol */, symbol: searchSymbol }, references: references });\n                    }\n                    return function (node, kind) { return references.push(nodeEntry(node, kind)); };\n                };\n                /** Add a reference with no associated definition. */\n                State.prototype.addStringOrCommentReference = function (fileName, textSpan) {\n                    this.result.push({\n                        definition: undefined,\n                        references: [{ kind: 0 /* Span */, fileName: fileName, textSpan: textSpan }]\n                    });\n                };\n                /** Returns `true` the first time we search for a symbol in a file and `false` afterwards. */\n                State.prototype.markSearchedSymbols = function (sourceFile, symbols) {\n                    var sourceId = ts.getNodeId(sourceFile);\n                    var seenSymbols = this.sourceFileToSeenSymbols[sourceId] || (this.sourceFileToSeenSymbols[sourceId] = new ts.Set());\n                    var anyNewSymbols = false;\n                    for (var _i = 0, symbols_3 = symbols; _i < symbols_3.length; _i++) {\n                        var sym = symbols_3[_i];\n                        anyNewSymbols = ts.tryAddToSet(seenSymbols, ts.getSymbolId(sym)) || anyNewSymbols;\n                    }\n                    return anyNewSymbols;\n                };\n                return State;\n            }());\n            /** Search for all imports of a given exported symbol using `State.getImportSearches`. */\n            function searchForImportsOfExport(exportLocation, exportSymbol, exportInfo, state) {\n                var _a = state.getImportSearches(exportSymbol, exportInfo), importSearches = _a.importSearches, singleReferences = _a.singleReferences, indirectUsers = _a.indirectUsers;\n                // For `import { foo as bar }` just add the reference to `foo`, and don't otherwise search in the file.\n                if (singleReferences.length) {\n                    var addRef = state.referenceAdder(exportSymbol);\n                    for (var _i = 0, singleReferences_1 = singleReferences; _i < singleReferences_1.length; _i++) {\n                        var singleRef = singleReferences_1[_i];\n                        if (shouldAddSingleReference(singleRef, state))\n                            addRef(singleRef);\n                    }\n                }\n                // For each import, find all references to that import in its source file.\n                for (var _b = 0, importSearches_1 = importSearches; _b < importSearches_1.length; _b++) {\n                    var _c = importSearches_1[_b], importLocation = _c[0], importSymbol = _c[1];\n                    getReferencesInSourceFile(importLocation.getSourceFile(), state.createSearch(importLocation, importSymbol, 1 /* Export */), state);\n                }\n                if (indirectUsers.length) {\n                    var indirectSearch = void 0;\n                    switch (exportInfo.exportKind) {\n                        case 0 /* Named */:\n                            indirectSearch = state.createSearch(exportLocation, exportSymbol, 1 /* Export */);\n                            break;\n                        case 1 /* Default */:\n                            // Search for a property access to '.default'. This can't be renamed.\n                            indirectSearch = state.options.use === 2 /* Rename */ ? undefined : state.createSearch(exportLocation, exportSymbol, 1 /* Export */, { text: \"default\" });\n                            break;\n                        case 2 /* ExportEquals */:\n                            break;\n                    }\n                    if (indirectSearch) {\n                        for (var _d = 0, indirectUsers_1 = indirectUsers; _d < indirectUsers_1.length; _d++) {\n                            var indirectUser = indirectUsers_1[_d];\n                            searchForName(indirectUser, indirectSearch, state);\n                        }\n                    }\n                }\n            }\n            function eachExportReference(sourceFiles, checker, cancellationToken, exportSymbol, exportingModuleSymbol, exportName, isDefaultExport, cb) {\n                var importTracker = FindAllReferences.createImportTracker(sourceFiles, new ts.Set(sourceFiles.map(function (f) { return f.fileName; })), checker, cancellationToken);\n                var _a = importTracker(exportSymbol, { exportKind: isDefaultExport ? 1 /* Default */ : 0 /* Named */, exportingModuleSymbol: exportingModuleSymbol }, /*isForRename*/ false), importSearches = _a.importSearches, indirectUsers = _a.indirectUsers;\n                for (var _i = 0, importSearches_2 = importSearches; _i < importSearches_2.length; _i++) {\n                    var importLocation = importSearches_2[_i][0];\n                    cb(importLocation);\n                }\n                for (var _b = 0, indirectUsers_2 = indirectUsers; _b < indirectUsers_2.length; _b++) {\n                    var indirectUser = indirectUsers_2[_b];\n                    for (var _c = 0, _d = getPossibleSymbolReferenceNodes(indirectUser, isDefaultExport ? \"default\" : exportName); _c < _d.length; _c++) {\n                        var node = _d[_c];\n                        // Import specifiers should be handled by importSearches\n                        if (ts.isIdentifier(node) && !ts.isImportOrExportSpecifier(node.parent) && checker.getSymbolAtLocation(node) === exportSymbol) {\n                            cb(node);\n                        }\n                    }\n                }\n            }\n            Core.eachExportReference = eachExportReference;\n            function shouldAddSingleReference(singleRef, state) {\n                if (!hasMatchingMeaning(singleRef, state))\n                    return false;\n                if (state.options.use !== 2 /* Rename */)\n                    return true;\n                // Don't rename an import type `import(\"./module-name\")` when renaming `name` in `export = name;`\n                if (!ts.isIdentifier(singleRef))\n                    return false;\n                // At `default` in `import { default as x }` or `export { default as x }`, do add a reference, but do not rename.\n                return !(ts.isImportOrExportSpecifier(singleRef.parent) && singleRef.escapedText === \"default\" /* Default */);\n            }\n            // Go to the symbol we imported from and find references for it.\n            function searchForImportedSymbol(symbol, state) {\n                if (!symbol.declarations)\n                    return;\n                for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                    var declaration = _a[_i];\n                    var exportingFile = declaration.getSourceFile();\n                    // Need to search in the file even if it's not in the search-file set, because it might export the symbol.\n                    getReferencesInSourceFile(exportingFile, state.createSearch(declaration, symbol, 0 /* Import */), state, state.includesSourceFile(exportingFile));\n                }\n            }\n            /** Search for all occurences of an identifier in a source file (and filter out the ones that match). */\n            function searchForName(sourceFile, search, state) {\n                if (ts.getNameTable(sourceFile).get(search.escapedText) !== undefined) {\n                    getReferencesInSourceFile(sourceFile, search, state);\n                }\n            }\n            function getPropertySymbolOfDestructuringAssignment(location, checker) {\n                return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(location.parent.parent)\n                    ? checker.getPropertySymbolOfDestructuringAssignment(location)\n                    : undefined;\n            }\n            /**\n             * Determines the smallest scope in which a symbol may have named references.\n             * Note that not every construct has been accounted for. This function can\n             * probably be improved.\n             *\n             * @returns undefined if the scope cannot be determined, implying that\n             * a reference to a symbol can occur anywhere.\n             */\n            function getSymbolScope(symbol) {\n                // If this is the symbol of a named function expression or named class expression,\n                // then named references are limited to its own scope.\n                var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration;\n                if (valueDeclaration && (valueDeclaration.kind === 208 /* FunctionExpression */ || valueDeclaration.kind === 221 /* ClassExpression */)) {\n                    return valueDeclaration;\n                }\n                if (!declarations) {\n                    return undefined;\n                }\n                // If this is private property or method, the scope is the containing class\n                if (flags & (4 /* Property */ | 8192 /* Method */)) {\n                    var privateDeclaration = ts.find(declarations, function (d) { return ts.hasEffectiveModifier(d, 8 /* Private */) || ts.isPrivateIdentifierPropertyDeclaration(d); });\n                    if (privateDeclaration) {\n                        return ts.getAncestor(privateDeclaration, 252 /* ClassDeclaration */);\n                    }\n                    // Else this is a public property and could be accessed from anywhere.\n                    return undefined;\n                }\n                // If symbol is of object binding pattern element without property name we would want to\n                // look for property too and that could be anywhere\n                if (declarations.some(ts.isObjectBindingElementWithoutPropertyName)) {\n                    return undefined;\n                }\n                /*\n                If the symbol has a parent, it's globally visible unless:\n                - It's a private property (handled above).\n                - It's a type parameter.\n                - The parent is an external module: then we should only search in the module (and recurse on the export later).\n                - But if the parent has `export as namespace`, the symbol is globally visible through that namespace.\n                */\n                var exposedByParent = parent && !(symbol.flags & 262144 /* TypeParameter */);\n                if (exposedByParent && !(ts.isExternalModuleSymbol(parent) && !parent.globalExports)) {\n                    return undefined;\n                }\n                var scope;\n                for (var _i = 0, declarations_1 = declarations; _i < declarations_1.length; _i++) {\n                    var declaration = declarations_1[_i];\n                    var container = ts.getContainerNode(declaration);\n                    if (scope && scope !== container) {\n                        // Different declarations have different containers, bail out\n                        return undefined;\n                    }\n                    if (!container || container.kind === 297 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) {\n                        // This is a global variable and not an external module, any declaration defined\n                        // within this scope is visible outside the file\n                        return undefined;\n                    }\n                    scope = container;\n                    if (ts.isFunctionExpression(scope)) {\n                        var next = void 0;\n                        while (next = ts.getNextJSDocCommentLocation(scope)) {\n                            scope = next;\n                        }\n                    }\n                }\n                // If symbol.parent, this means we are in an export of an external module. (Otherwise we would have returned `undefined` above.)\n                // For an export of a module, we may be in a declaration file, and it may be accessed elsewhere. E.g.:\n                //     declare module \"a\" { export type T = number; }\n                //     declare module \"b\" { import { T } from \"a\"; export const x: T; }\n                // So we must search the whole source file. (Because we will mark the source file as seen, we we won't return to it when searching for imports.)\n                return exposedByParent ? scope.getSourceFile() : scope; // TODO: GH#18217\n            }\n            /** Used as a quick check for whether a symbol is used at all in a file (besides its definition). */\n            function isSymbolReferencedInFile(definition, checker, sourceFile, searchContainer) {\n                if (searchContainer === void 0) { searchContainer = sourceFile; }\n                return eachSymbolReferenceInFile(definition, checker, sourceFile, function () { return true; }, searchContainer) || false;\n            }\n            Core.isSymbolReferencedInFile = isSymbolReferencedInFile;\n            function eachSymbolReferenceInFile(definition, checker, sourceFile, cb, searchContainer) {\n                if (searchContainer === void 0) { searchContainer = sourceFile; }\n                var symbol = ts.isParameterPropertyDeclaration(definition.parent, definition.parent.parent)\n                    ? ts.first(checker.getSymbolsOfParameterPropertyDeclaration(definition.parent, definition.text))\n                    : checker.getSymbolAtLocation(definition);\n                if (!symbol)\n                    return undefined;\n                for (var _i = 0, _a = getPossibleSymbolReferenceNodes(sourceFile, symbol.name, searchContainer); _i < _a.length; _i++) {\n                    var token = _a[_i];\n                    if (!ts.isIdentifier(token) || token === definition || token.escapedText !== definition.escapedText)\n                        continue;\n                    var referenceSymbol = checker.getSymbolAtLocation(token); // See GH#19955 for why the type annotation is necessary\n                    if (referenceSymbol === symbol\n                        || checker.getShorthandAssignmentValueSymbol(token.parent) === symbol\n                        || ts.isExportSpecifier(token.parent) && getLocalSymbolForExportSpecifier(token, referenceSymbol, token.parent, checker) === symbol) {\n                        var res = cb(token);\n                        if (res)\n                            return res;\n                    }\n                }\n            }\n            Core.eachSymbolReferenceInFile = eachSymbolReferenceInFile;\n            function someSignatureUsage(signature, sourceFiles, checker, cb) {\n                if (!signature.name || !ts.isIdentifier(signature.name))\n                    return false;\n                var symbol = ts.Debug.checkDefined(checker.getSymbolAtLocation(signature.name));\n                for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) {\n                    var sourceFile = sourceFiles_3[_i];\n                    for (var _a = 0, _b = getPossibleSymbolReferenceNodes(sourceFile, symbol.name); _a < _b.length; _a++) {\n                        var name = _b[_a];\n                        if (!ts.isIdentifier(name) || name === signature.name || name.escapedText !== signature.name.escapedText)\n                            continue;\n                        var called = ts.climbPastPropertyAccess(name);\n                        var call = ts.isCallExpression(called.parent) && called.parent.expression === called ? called.parent : undefined;\n                        var referenceSymbol = checker.getSymbolAtLocation(name);\n                        if (referenceSymbol && checker.getRootSymbols(referenceSymbol).some(function (s) { return s === symbol; })) {\n                            if (cb(name, call)) {\n                                return true;\n                            }\n                        }\n                    }\n                }\n                return false;\n            }\n            Core.someSignatureUsage = someSignatureUsage;\n            function getPossibleSymbolReferenceNodes(sourceFile, symbolName, container) {\n                if (container === void 0) { container = sourceFile; }\n                return getPossibleSymbolReferencePositions(sourceFile, symbolName, container).map(function (pos) { return ts.getTouchingPropertyName(sourceFile, pos); });\n            }\n            function getPossibleSymbolReferencePositions(sourceFile, symbolName, container) {\n                if (container === void 0) { container = sourceFile; }\n                var positions = [];\n                /// TODO: Cache symbol existence for files to save text search\n                // Also, need to make this work for unicode escapes.\n                // Be resilient in the face of a symbol with no name or zero length name\n                if (!symbolName || !symbolName.length) {\n                    return positions;\n                }\n                var text = sourceFile.text;\n                var sourceLength = text.length;\n                var symbolNameLength = symbolName.length;\n                var position = text.indexOf(symbolName, container.pos);\n                while (position >= 0) {\n                    // If we are past the end, stop looking\n                    if (position > container.end)\n                        break;\n                    // We found a match.  Make sure it's not part of a larger word (i.e. the char\n                    // before and after it have to be a non-identifier char).\n                    var endPosition = position + symbolNameLength;\n                    if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 99 /* Latest */)) &&\n                        (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 99 /* Latest */))) {\n                        // Found a real match.  Keep searching.\n                        positions.push(position);\n                    }\n                    position = text.indexOf(symbolName, position + symbolNameLength + 1);\n                }\n                return positions;\n            }\n            function getLabelReferencesInNode(container, targetLabel) {\n                var sourceFile = container.getSourceFile();\n                var labelName = targetLabel.text;\n                var references = ts.mapDefined(getPossibleSymbolReferenceNodes(sourceFile, labelName, container), function (node) {\n                    // Only pick labels that are either the target label, or have a target that is the target label\n                    return node === targetLabel || (ts.isJumpStatementTarget(node) && ts.getTargetLabel(node, labelName) === targetLabel) ? nodeEntry(node) : undefined;\n                });\n                return [{ definition: { type: 1 /* Label */, node: targetLabel }, references: references }];\n            }\n            function isValidReferencePosition(node, searchSymbolName) {\n                // Compare the length so we filter out strict superstrings of the symbol we are looking for\n                switch (node.kind) {\n                    case 79 /* PrivateIdentifier */:\n                    case 78 /* Identifier */:\n                        return node.text.length === searchSymbolName.length;\n                    case 14 /* NoSubstitutionTemplateLiteral */:\n                    case 10 /* StringLiteral */: {\n                        var str = node;\n                        return (ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(str) || ts.isNameOfModuleDeclaration(node) || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node) || (ts.isCallExpression(node.parent) && ts.isBindableObjectDefinePropertyCall(node.parent) && node.parent.arguments[1] === node)) &&\n                            str.text.length === searchSymbolName.length;\n                    }\n                    case 8 /* NumericLiteral */:\n                        return ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && node.text.length === searchSymbolName.length;\n                    case 87 /* DefaultKeyword */:\n                        return \"default\".length === searchSymbolName.length;\n                    default:\n                        return false;\n                }\n            }\n            function getAllReferencesForKeyword(sourceFiles, keywordKind, cancellationToken, filter) {\n                var references = ts.flatMap(sourceFiles, function (sourceFile) {\n                    cancellationToken.throwIfCancellationRequested();\n                    return ts.mapDefined(getPossibleSymbolReferenceNodes(sourceFile, ts.tokenToString(keywordKind), sourceFile), function (referenceLocation) {\n                        if (referenceLocation.kind === keywordKind && (!filter || filter(referenceLocation))) {\n                            return nodeEntry(referenceLocation);\n                        }\n                    });\n                });\n                return references.length ? [{ definition: { type: 2 /* Keyword */, node: references[0].node }, references: references }] : undefined;\n            }\n            function getReferencesInSourceFile(sourceFile, search, state, addReferencesHere) {\n                if (addReferencesHere === void 0) { addReferencesHere = true; }\n                state.cancellationToken.throwIfCancellationRequested();\n                return getReferencesInContainer(sourceFile, sourceFile, search, state, addReferencesHere);\n            }\n            /**\n             * Search within node \"container\" for references for a search value, where the search value is defined as a\n             * tuple of(searchSymbol, searchText, searchLocation, and searchMeaning).\n             * searchLocation: a node where the search value\n             */\n            function getReferencesInContainer(container, sourceFile, search, state, addReferencesHere) {\n                if (!state.markSearchedSymbols(sourceFile, search.allSearchSymbols)) {\n                    return;\n                }\n                for (var _i = 0, _a = getPossibleSymbolReferencePositions(sourceFile, search.text, container); _i < _a.length; _i++) {\n                    var position = _a[_i];\n                    getReferencesAtLocation(sourceFile, position, search, state, addReferencesHere);\n                }\n            }\n            function hasMatchingMeaning(referenceLocation, state) {\n                return !!(ts.getMeaningFromLocation(referenceLocation) & state.searchMeaning);\n            }\n            function getReferencesAtLocation(sourceFile, position, search, state, addReferencesHere) {\n                var referenceLocation = ts.getTouchingPropertyName(sourceFile, position);\n                if (!isValidReferencePosition(referenceLocation, search.text)) {\n                    // This wasn't the start of a token.  Check to see if it might be a\n                    // match in a comment or string if that's what the caller is asking\n                    // for.\n                    if (!state.options.implementations && (state.options.findInStrings && ts.isInString(sourceFile, position) || state.options.findInComments && ts.isInNonReferenceComment(sourceFile, position))) {\n                        // In the case where we're looking inside comments/strings, we don't have\n                        // an actual definition.  So just use 'undefined' here.  Features like\n                        // 'Rename' won't care (as they ignore the definitions), and features like\n                        // 'FindReferences' will just filter out these results.\n                        state.addStringOrCommentReference(sourceFile.fileName, ts.createTextSpan(position, search.text.length));\n                    }\n                    return;\n                }\n                if (!hasMatchingMeaning(referenceLocation, state))\n                    return;\n                var referenceSymbol = state.checker.getSymbolAtLocation(referenceLocation);\n                if (!referenceSymbol) {\n                    return;\n                }\n                var parent = referenceLocation.parent;\n                if (ts.isImportSpecifier(parent) && parent.propertyName === referenceLocation) {\n                    // This is added through `singleReferences` in ImportsResult. If we happen to see it again, don't add it again.\n                    return;\n                }\n                if (ts.isExportSpecifier(parent)) {\n                    ts.Debug.assert(referenceLocation.kind === 78 /* Identifier */);\n                    getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, parent, search, state, addReferencesHere);\n                    return;\n                }\n                var relatedSymbol = getRelatedSymbol(search, referenceSymbol, referenceLocation, state);\n                if (!relatedSymbol) {\n                    getReferenceForShorthandProperty(referenceSymbol, search, state);\n                    return;\n                }\n                switch (state.specialSearchKind) {\n                    case 0 /* None */:\n                        if (addReferencesHere)\n                            addReference(referenceLocation, relatedSymbol, state);\n                        break;\n                    case 1 /* Constructor */:\n                        addConstructorReferences(referenceLocation, sourceFile, search, state);\n                        break;\n                    case 2 /* Class */:\n                        addClassStaticThisReferences(referenceLocation, search, state);\n                        break;\n                    default:\n                        ts.Debug.assertNever(state.specialSearchKind);\n                }\n                getImportOrExportReferences(referenceLocation, referenceSymbol, search, state);\n            }\n            function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state, addReferencesHere, alwaysGetReferences) {\n                ts.Debug.assert(!alwaysGetReferences || !!state.options.providePrefixAndSuffixTextForRename, \"If alwaysGetReferences is true, then prefix/suffix text must be enabled\");\n                var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name;\n                var exportDeclaration = parent.parent;\n                var localSymbol = getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, state.checker);\n                if (!alwaysGetReferences && !search.includes(localSymbol)) {\n                    return;\n                }\n                if (!propertyName) {\n                    // Don't rename at `export { default } from \"m\";`. (but do continue to search for imports of the re-export)\n                    if (!(state.options.use === 2 /* Rename */ && (name.escapedText === \"default\" /* Default */))) {\n                        addRef();\n                    }\n                }\n                else if (referenceLocation === propertyName) {\n                    // For `export { foo as bar } from \"baz\"`, \"`foo`\" will be added from the singleReferences for import searches of the original export.\n                    // For `export { foo as bar };`, where `foo` is a local, so add it now.\n                    if (!exportDeclaration.moduleSpecifier) {\n                        addRef();\n                    }\n                    if (addReferencesHere && state.options.use !== 2 /* Rename */ && state.markSeenReExportRHS(name)) {\n                        addReference(name, ts.Debug.checkDefined(exportSpecifier.symbol), state);\n                    }\n                }\n                else {\n                    if (state.markSeenReExportRHS(referenceLocation)) {\n                        addRef();\n                    }\n                }\n                // For `export { foo as bar }`, rename `foo`, but not `bar`.\n                if (!isForRenameWithPrefixAndSuffixText(state.options) || alwaysGetReferences) {\n                    var isDefaultExport = referenceLocation.originalKeywordKind === 87 /* DefaultKeyword */\n                        || exportSpecifier.name.originalKeywordKind === 87 /* DefaultKeyword */;\n                    var exportKind = isDefaultExport ? 1 /* Default */ : 0 /* Named */;\n                    var exportSymbol = ts.Debug.checkDefined(exportSpecifier.symbol);\n                    var exportInfo = FindAllReferences.getExportInfo(exportSymbol, exportKind, state.checker);\n                    if (exportInfo) {\n                        searchForImportsOfExport(referenceLocation, exportSymbol, exportInfo, state);\n                    }\n                }\n                // At `export { x } from \"foo\"`, also search for the imported symbol `\"foo\".x`.\n                if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName && !isForRenameWithPrefixAndSuffixText(state.options)) {\n                    var imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier);\n                    if (imported)\n                        searchForImportedSymbol(imported, state);\n                }\n                function addRef() {\n                    if (addReferencesHere)\n                        addReference(referenceLocation, localSymbol, state);\n                }\n            }\n            function getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, checker) {\n                return isExportSpecifierAlias(referenceLocation, exportSpecifier) && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) || referenceSymbol;\n            }\n            function isExportSpecifierAlias(referenceLocation, exportSpecifier) {\n                var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name;\n                ts.Debug.assert(propertyName === referenceLocation || name === referenceLocation);\n                if (propertyName) {\n                    // Given `export { foo as bar } [from \"someModule\"]`: It's an alias at `foo`, but at `bar` it's a new symbol.\n                    return propertyName === referenceLocation;\n                }\n                else {\n                    // `export { foo } from \"foo\"` is a re-export.\n                    // `export { foo };` is not a re-export, it creates an alias for the local variable `foo`.\n                    return !parent.parent.moduleSpecifier;\n                }\n            }\n            function getImportOrExportReferences(referenceLocation, referenceSymbol, search, state) {\n                var importOrExport = FindAllReferences.getImportOrExportSymbol(referenceLocation, referenceSymbol, state.checker, search.comingFrom === 1 /* Export */);\n                if (!importOrExport)\n                    return;\n                var symbol = importOrExport.symbol;\n                if (importOrExport.kind === 0 /* Import */) {\n                    if (!(isForRenameWithPrefixAndSuffixText(state.options))) {\n                        searchForImportedSymbol(symbol, state);\n                    }\n                }\n                else {\n                    searchForImportsOfExport(referenceLocation, symbol, importOrExport.exportInfo, state);\n                }\n            }\n            function getReferenceForShorthandProperty(_a, search, state) {\n                var flags = _a.flags, valueDeclaration = _a.valueDeclaration;\n                var shorthandValueSymbol = state.checker.getShorthandAssignmentValueSymbol(valueDeclaration);\n                var name = valueDeclaration && ts.getNameOfDeclaration(valueDeclaration);\n                /*\n                * Because in short-hand property assignment, an identifier which stored as name of the short-hand property assignment\n                * has two meanings: property name and property value. Therefore when we do findAllReference at the position where\n                * an identifier is declared, the language service should return the position of the variable declaration as well as\n                * the position in short-hand property assignment excluding property accessing. However, if we do findAllReference at the\n                * position of property accessing, the referenceEntry of such position will be handled in the first case.\n                */\n                if (!(flags & 33554432 /* Transient */) && name && search.includes(shorthandValueSymbol)) {\n                    addReference(name, shorthandValueSymbol, state);\n                }\n            }\n            function addReference(referenceLocation, relatedSymbol, state) {\n                var _a = \"kind\" in relatedSymbol ? relatedSymbol : { kind: undefined, symbol: relatedSymbol }, kind = _a.kind, symbol = _a.symbol; // eslint-disable-line no-in-operator\n                var addRef = state.referenceAdder(symbol);\n                if (state.options.implementations) {\n                    addImplementationReferences(referenceLocation, addRef, state);\n                }\n                else {\n                    addRef(referenceLocation, kind);\n                }\n            }\n            /** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses.  */\n            function addConstructorReferences(referenceLocation, sourceFile, search, state) {\n                if (ts.isNewExpressionTarget(referenceLocation)) {\n                    addReference(referenceLocation, search.symbol, state);\n                }\n                var pusher = function () { return state.referenceAdder(search.symbol); };\n                if (ts.isClassLike(referenceLocation.parent)) {\n                    ts.Debug.assert(referenceLocation.kind === 87 /* DefaultKeyword */ || referenceLocation.parent.name === referenceLocation);\n                    // This is the class declaration containing the constructor.\n                    findOwnConstructorReferences(search.symbol, sourceFile, pusher());\n                }\n                else {\n                    // If this class appears in `extends C`, then the extending class' \"super\" calls are references.\n                    var classExtending = tryGetClassByExtendingIdentifier(referenceLocation);\n                    if (classExtending) {\n                        findSuperConstructorAccesses(classExtending, pusher());\n                        findInheritedConstructorReferences(classExtending, state);\n                    }\n                }\n            }\n            function addClassStaticThisReferences(referenceLocation, search, state) {\n                addReference(referenceLocation, search.symbol, state);\n                var classLike = referenceLocation.parent;\n                if (state.options.use === 2 /* Rename */ || !ts.isClassLike(classLike))\n                    return;\n                ts.Debug.assert(classLike.name === referenceLocation);\n                var addRef = state.referenceAdder(search.symbol);\n                for (var _i = 0, _a = classLike.members; _i < _a.length; _i++) {\n                    var member = _a[_i];\n                    if (!(ts.isMethodOrAccessor(member) && ts.hasSyntacticModifier(member, 32 /* Static */))) {\n                        continue;\n                    }\n                    if (member.body) {\n                        member.body.forEachChild(function cb(node) {\n                            if (node.kind === 107 /* ThisKeyword */) {\n                                addRef(node);\n                            }\n                            else if (!ts.isFunctionLike(node) && !ts.isClassLike(node)) {\n                                node.forEachChild(cb);\n                            }\n                        });\n                    }\n                }\n            }\n            /**\n             * `classSymbol` is the class where the constructor was defined.\n             * Reference the constructor and all calls to `new this()`.\n             */\n            function findOwnConstructorReferences(classSymbol, sourceFile, addNode) {\n                var constructorSymbol = getClassConstructorSymbol(classSymbol);\n                if (constructorSymbol && constructorSymbol.declarations) {\n                    for (var _i = 0, _a = constructorSymbol.declarations; _i < _a.length; _i++) {\n                        var decl = _a[_i];\n                        var ctrKeyword = ts.findChildOfKind(decl, 132 /* ConstructorKeyword */, sourceFile);\n                        ts.Debug.assert(decl.kind === 166 /* Constructor */ && !!ctrKeyword);\n                        addNode(ctrKeyword);\n                    }\n                }\n                if (classSymbol.exports) {\n                    classSymbol.exports.forEach(function (member) {\n                        var decl = member.valueDeclaration;\n                        if (decl && decl.kind === 165 /* MethodDeclaration */) {\n                            var body = decl.body;\n                            if (body) {\n                                forEachDescendantOfKind(body, 107 /* ThisKeyword */, function (thisKeyword) {\n                                    if (ts.isNewExpressionTarget(thisKeyword)) {\n                                        addNode(thisKeyword);\n                                    }\n                                });\n                            }\n                        }\n                    });\n                }\n            }\n            function getClassConstructorSymbol(classSymbol) {\n                return classSymbol.members && classSymbol.members.get(\"__constructor\" /* Constructor */);\n            }\n            /** Find references to `super` in the constructor of an extending class.  */\n            function findSuperConstructorAccesses(classDeclaration, addNode) {\n                var constructor = getClassConstructorSymbol(classDeclaration.symbol);\n                if (!(constructor && constructor.declarations)) {\n                    return;\n                }\n                for (var _i = 0, _a = constructor.declarations; _i < _a.length; _i++) {\n                    var decl = _a[_i];\n                    ts.Debug.assert(decl.kind === 166 /* Constructor */);\n                    var body = decl.body;\n                    if (body) {\n                        forEachDescendantOfKind(body, 105 /* SuperKeyword */, function (node) {\n                            if (ts.isCallExpressionTarget(node)) {\n                                addNode(node);\n                            }\n                        });\n                    }\n                }\n            }\n            function hasOwnConstructor(classDeclaration) {\n                return !!getClassConstructorSymbol(classDeclaration.symbol);\n            }\n            function findInheritedConstructorReferences(classDeclaration, state) {\n                if (hasOwnConstructor(classDeclaration))\n                    return;\n                var classSymbol = classDeclaration.symbol;\n                var search = state.createSearch(/*location*/ undefined, classSymbol, /*comingFrom*/ undefined);\n                getReferencesInContainerOrFiles(classSymbol, state, search);\n            }\n            function addImplementationReferences(refNode, addReference, state) {\n                // Check if we found a function/propertyAssignment/method with an implementation or initializer\n                if (ts.isDeclarationName(refNode) && isImplementation(refNode.parent)) {\n                    addReference(refNode);\n                    return;\n                }\n                if (refNode.kind !== 78 /* Identifier */) {\n                    return;\n                }\n                if (refNode.parent.kind === 289 /* ShorthandPropertyAssignment */) {\n                    // Go ahead and dereference the shorthand assignment by going to its definition\n                    getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference);\n                }\n                // Check if the node is within an extends or implements clause\n                var containingClass = getContainingClassIfInHeritageClause(refNode);\n                if (containingClass) {\n                    addReference(containingClass);\n                    return;\n                }\n                // If we got a type reference, try and see if the reference applies to any expressions that can implement an interface\n                // Find the first node whose parent isn't a type node -- i.e., the highest type node.\n                var typeNode = ts.findAncestor(refNode, function (a) { return !ts.isQualifiedName(a.parent) && !ts.isTypeNode(a.parent) && !ts.isTypeElement(a.parent); });\n                var typeHavingNode = typeNode.parent;\n                if (ts.hasType(typeHavingNode) && typeHavingNode.type === typeNode && state.markSeenContainingTypeReference(typeHavingNode)) {\n                    if (ts.hasInitializer(typeHavingNode)) {\n                        addIfImplementation(typeHavingNode.initializer);\n                    }\n                    else if (ts.isFunctionLike(typeHavingNode) && typeHavingNode.body) {\n                        var body = typeHavingNode.body;\n                        if (body.kind === 230 /* Block */) {\n                            ts.forEachReturnStatement(body, function (returnStatement) {\n                                if (returnStatement.expression)\n                                    addIfImplementation(returnStatement.expression);\n                            });\n                        }\n                        else {\n                            addIfImplementation(body);\n                        }\n                    }\n                    else if (ts.isAssertionExpression(typeHavingNode)) {\n                        addIfImplementation(typeHavingNode.expression);\n                    }\n                }\n                function addIfImplementation(e) {\n                    if (isImplementationExpression(e))\n                        addReference(e);\n                }\n            }\n            function getContainingClassIfInHeritageClause(node) {\n                return ts.isIdentifier(node) || ts.isPropertyAccessExpression(node) ? getContainingClassIfInHeritageClause(node.parent)\n                    : ts.isExpressionWithTypeArguments(node) ? ts.tryCast(node.parent.parent, ts.isClassLike) : undefined;\n            }\n            /**\n             * Returns true if this is an expression that can be considered an implementation\n             */\n            function isImplementationExpression(node) {\n                switch (node.kind) {\n                    case 207 /* ParenthesizedExpression */:\n                        return isImplementationExpression(node.expression);\n                    case 209 /* ArrowFunction */:\n                    case 208 /* FunctionExpression */:\n                    case 200 /* ObjectLiteralExpression */:\n                    case 221 /* ClassExpression */:\n                    case 199 /* ArrayLiteralExpression */:\n                        return true;\n                    default:\n                        return false;\n                }\n            }\n            /**\n             * Determines if the parent symbol occurs somewhere in the child's ancestry. If the parent symbol\n             * is an interface, determines if some ancestor of the child symbol extends or inherits from it.\n             * Also takes in a cache of previous results which makes this slightly more efficient and is\n             * necessary to avoid potential loops like so:\n             *     class A extends B { }\n             *     class B extends A { }\n             *\n             * We traverse the AST rather than using the type checker because users are typically only interested\n             * in explicit implementations of an interface/class when calling \"Go to Implementation\". Sibling\n             * implementations of types that share a common ancestor with the type whose implementation we are\n             * searching for need to be filtered out of the results. The type checker doesn't let us make the\n             * distinction between structurally compatible implementations and explicit implementations, so we\n             * must use the AST.\n             *\n             * @param symbol         A class or interface Symbol\n             * @param parent        Another class or interface Symbol\n             * @param cachedResults A map of symbol id pairs (i.e. \"child,parent\") to booleans indicating previous results\n             */\n            function explicitlyInheritsFrom(symbol, parent, cachedResults, checker) {\n                if (symbol === parent) {\n                    return true;\n                }\n                var key = ts.getSymbolId(symbol) + \",\" + ts.getSymbolId(parent);\n                var cached = cachedResults.get(key);\n                if (cached !== undefined) {\n                    return cached;\n                }\n                // Set the key so that we don't infinitely recurse\n                cachedResults.set(key, false);\n                var inherits = !!symbol.declarations && symbol.declarations.some(function (declaration) {\n                    return ts.getAllSuperTypeNodes(declaration).some(function (typeReference) {\n                        var type = checker.getTypeAtLocation(typeReference);\n                        return !!type && !!type.symbol && explicitlyInheritsFrom(type.symbol, parent, cachedResults, checker);\n                    });\n                });\n                cachedResults.set(key, inherits);\n                return inherits;\n            }\n            function getReferencesForSuperKeyword(superKeyword) {\n                var searchSpaceNode = ts.getSuperContainer(superKeyword, /*stopOnFunctions*/ false);\n                if (!searchSpaceNode) {\n                    return undefined;\n                }\n                // Whether 'super' occurs in a static context within a class.\n                var staticFlag = 32 /* Static */;\n                switch (searchSpaceNode.kind) {\n                    case 163 /* PropertyDeclaration */:\n                    case 162 /* PropertySignature */:\n                    case 165 /* MethodDeclaration */:\n                    case 164 /* MethodSignature */:\n                    case 166 /* Constructor */:\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                        staticFlag &= ts.getSyntacticModifierFlags(searchSpaceNode);\n                        searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class\n                        break;\n                    default:\n                        return undefined;\n                }\n                var sourceFile = searchSpaceNode.getSourceFile();\n                var references = ts.mapDefined(getPossibleSymbolReferenceNodes(sourceFile, \"super\", searchSpaceNode), function (node) {\n                    if (node.kind !== 105 /* SuperKeyword */) {\n                        return;\n                    }\n                    var container = ts.getSuperContainer(node, /*stopOnFunctions*/ false);\n                    // If we have a 'super' container, we must have an enclosing class.\n                    // Now make sure the owning class is the same as the search-space\n                    // and has the same static qualifier as the original 'super's owner.\n                    return container && (32 /* Static */ & ts.getSyntacticModifierFlags(container)) === staticFlag && container.parent.symbol === searchSpaceNode.symbol ? nodeEntry(node) : undefined;\n                });\n                return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references: references }];\n            }\n            function isParameterName(node) {\n                return node.kind === 78 /* Identifier */ && node.parent.kind === 160 /* Parameter */ && node.parent.name === node;\n            }\n            function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) {\n                var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false);\n                // Whether 'this' occurs in a static context within a class.\n                var staticFlag = 32 /* Static */;\n                switch (searchSpaceNode.kind) {\n                    case 165 /* MethodDeclaration */:\n                    case 164 /* MethodSignature */:\n                        if (ts.isObjectLiteralMethod(searchSpaceNode)) {\n                            break;\n                        }\n                    // falls through\n                    case 163 /* PropertyDeclaration */:\n                    case 162 /* PropertySignature */:\n                    case 166 /* Constructor */:\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                        staticFlag &= ts.getSyntacticModifierFlags(searchSpaceNode);\n                        searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class\n                        break;\n                    case 297 /* SourceFile */:\n                        if (ts.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) {\n                            return undefined;\n                        }\n                    // falls through\n                    case 251 /* FunctionDeclaration */:\n                    case 208 /* FunctionExpression */:\n                        break;\n                    // Computed properties in classes are not handled here because references to this are illegal,\n                    // so there is no point finding references to them.\n                    default:\n                        return undefined;\n                }\n                var references = ts.flatMap(searchSpaceNode.kind === 297 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) {\n                    cancellationToken.throwIfCancellationRequested();\n                    return getPossibleSymbolReferenceNodes(sourceFile, \"this\", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(function (node) {\n                        if (!ts.isThis(node)) {\n                            return false;\n                        }\n                        var container = ts.getThisContainer(node, /* includeArrowFunctions */ false);\n                        switch (searchSpaceNode.kind) {\n                            case 208 /* FunctionExpression */:\n                            case 251 /* FunctionDeclaration */:\n                                return searchSpaceNode.symbol === container.symbol;\n                            case 165 /* MethodDeclaration */:\n                            case 164 /* MethodSignature */:\n                                return ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol;\n                            case 221 /* ClassExpression */:\n                            case 252 /* ClassDeclaration */:\n                                // Make sure the container belongs to the same class\n                                // and has the appropriate static modifier from the original container.\n                                return container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getSyntacticModifierFlags(container) & 32 /* Static */) === staticFlag;\n                            case 297 /* SourceFile */:\n                                return container.kind === 297 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node);\n                        }\n                    });\n                }).map(function (n) { return nodeEntry(n); });\n                var thisParameter = ts.firstDefined(references, function (r) { return ts.isParameter(r.node.parent) ? r.node : undefined; });\n                return [{\n                        definition: { type: 3 /* This */, node: thisParameter || thisOrSuperKeyword },\n                        references: references\n                    }];\n            }\n            function getReferencesForStringLiteral(node, sourceFiles, checker, cancellationToken) {\n                var type = ts.getContextualTypeOrAncestorTypeNodeType(node, checker);\n                var references = ts.flatMap(sourceFiles, function (sourceFile) {\n                    cancellationToken.throwIfCancellationRequested();\n                    return ts.mapDefined(getPossibleSymbolReferenceNodes(sourceFile, node.text), function (ref) {\n                        if (ts.isStringLiteralLike(ref) && ref.text === node.text) {\n                            if (type) {\n                                var refType = ts.getContextualTypeOrAncestorTypeNodeType(ref, checker);\n                                if (type !== checker.getStringType() && type === refType) {\n                                    return nodeEntry(ref, 2 /* StringLiteral */);\n                                }\n                            }\n                            else {\n                                return nodeEntry(ref, 2 /* StringLiteral */);\n                            }\n                        }\n                    });\n                });\n                return [{\n                        definition: { type: 4 /* String */, node: node },\n                        references: references\n                    }];\n            }\n            // For certain symbol kinds, we need to include other symbols in the search set.\n            // This is not needed when searching for re-exports.\n            function populateSearchSymbolSet(symbol, location, checker, isForRename, providePrefixAndSuffixText, implementations) {\n                var result = [];\n                forEachRelatedSymbol(symbol, location, checker, isForRename, !(isForRename && providePrefixAndSuffixText), function (sym, root, base) {\n                    // static method/property and instance method/property might have the same name. Only include static or only include instance.\n                    if (base) {\n                        if (isStatic(symbol) !== isStatic(base)) {\n                            base = undefined;\n                        }\n                    }\n                    result.push(base || root || sym);\n                }, \n                // when try to find implementation, implementations is true, and not allowed to find base class\n                /*allowBaseTypes*/ function () { return !implementations; });\n                return result;\n            }\n            /**\n             * @param allowBaseTypes return true means it would try to find in base class or interface.\n             */\n            function forEachRelatedSymbol(symbol, location, checker, isForRenamePopulateSearchSymbolSet, onlyIncludeBindingElementAtReferenceLocation, \n            /**\n             * @param baseSymbol This symbol means one property/mehtod from base class or interface when it is not null or undefined,\n             */\n            cbSymbol, allowBaseTypes) {\n                var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(location);\n                if (containingObjectLiteralElement) {\n                    /* Because in short-hand property assignment, location has two meaning : property name and as value of the property\n                    * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of\n                    * property name and variable declaration of the identifier.\n                    * Like in below example, when querying for all references for an identifier 'name', of the property assignment, the language service\n                    * should show both 'name' in 'obj' and 'name' in variable declaration\n                    *      const name = \"Foo\";\n                    *      const obj = { name };\n                    * In order to do that, we will populate the search set with the value symbol of the identifier as a value of the property assignment\n                    * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration\n                    * will be included correctly.\n                    */\n                    var shorthandValueSymbol = checker.getShorthandAssignmentValueSymbol(location.parent); // gets the local symbol\n                    if (shorthandValueSymbol && isForRenamePopulateSearchSymbolSet) {\n                        // When renaming 'x' in `const o = { x }`, just rename the local variable, not the property.\n                        return cbSymbol(shorthandValueSymbol, /*rootSymbol*/ undefined, /*baseSymbol*/ undefined, 3 /* SearchedLocalFoundProperty */);\n                    }\n                    // If the location is in a context sensitive location (i.e. in an object literal) try\n                    // to get a contextual type for it, and add the property symbol from the contextual\n                    // type to the search set\n                    var contextualType = checker.getContextualType(containingObjectLiteralElement.parent);\n                    var res_1 = contextualType && ts.firstDefined(ts.getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker, contextualType, /*unionSymbolOk*/ true), function (sym) { return fromRoot(sym, 4 /* SearchedPropertyFoundLocal */); });\n                    if (res_1)\n                        return res_1;\n                    // If the location is name of property symbol from object literal destructuring pattern\n                    // Search the property symbol\n                    //      for ( { property: p2 } of elems) { }\n                    var propertySymbol = getPropertySymbolOfDestructuringAssignment(location, checker);\n                    var res1 = propertySymbol && cbSymbol(propertySymbol, /*rootSymbol*/ undefined, /*baseSymbol*/ undefined, 4 /* SearchedPropertyFoundLocal */);\n                    if (res1)\n                        return res1;\n                    var res2 = shorthandValueSymbol && cbSymbol(shorthandValueSymbol, /*rootSymbol*/ undefined, /*baseSymbol*/ undefined, 3 /* SearchedLocalFoundProperty */);\n                    if (res2)\n                        return res2;\n                }\n                var aliasedSymbol = getMergedAliasedSymbolOfNamespaceExportDeclaration(location, symbol, checker);\n                if (aliasedSymbol) {\n                    // In case of UMD module and global merging, search for global as well\n                    var res_2 = cbSymbol(aliasedSymbol, /*rootSymbol*/ undefined, /*baseSymbol*/ undefined, 1 /* Node */);\n                    if (res_2)\n                        return res_2;\n                }\n                var res = fromRoot(symbol);\n                if (res)\n                    return res;\n                if (symbol.valueDeclaration && ts.isParameterPropertyDeclaration(symbol.valueDeclaration, symbol.valueDeclaration.parent)) {\n                    // For a parameter property, now try on the other symbol (property if this was a parameter, parameter if this was a property).\n                    var paramProps = checker.getSymbolsOfParameterPropertyDeclaration(ts.cast(symbol.valueDeclaration, ts.isParameter), symbol.name);\n                    ts.Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */)); // is [parameter, property]\n                    return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]);\n                }\n                var exportSpecifier = ts.getDeclarationOfKind(symbol, 270 /* ExportSpecifier */);\n                if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) {\n                    var localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier);\n                    if (localSymbol) {\n                        var res_3 = cbSymbol(localSymbol, /*rootSymbol*/ undefined, /*baseSymbol*/ undefined, 1 /* Node */);\n                        if (res_3)\n                            return res_3;\n                    }\n                }\n                // symbolAtLocation for a binding element is the local symbol. See if the search symbol is the property.\n                // Don't do this when populating search set for a rename when prefix and suffix text will be provided -- just rename the local.\n                if (!isForRenamePopulateSearchSymbolSet) {\n                    var bindingElementPropertySymbol = void 0;\n                    if (onlyIncludeBindingElementAtReferenceLocation) {\n                        bindingElementPropertySymbol = ts.isObjectBindingElementWithoutPropertyName(location.parent) ? ts.getPropertySymbolFromBindingElement(checker, location.parent) : undefined;\n                    }\n                    else {\n                        bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker);\n                    }\n                    return bindingElementPropertySymbol && fromRoot(bindingElementPropertySymbol, 4 /* SearchedPropertyFoundLocal */);\n                }\n                ts.Debug.assert(isForRenamePopulateSearchSymbolSet);\n                // due to the above assert and the arguments at the uses of this function,\n                // (onlyIncludeBindingElementAtReferenceLocation <=> !providePrefixAndSuffixTextForRename) holds\n                var includeOriginalSymbolOfBindingElement = onlyIncludeBindingElementAtReferenceLocation;\n                if (includeOriginalSymbolOfBindingElement) {\n                    var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker);\n                    return bindingElementPropertySymbol && fromRoot(bindingElementPropertySymbol, 4 /* SearchedPropertyFoundLocal */);\n                }\n                function fromRoot(sym, kind) {\n                    // If this is a union property:\n                    //   - In populateSearchSymbolsSet we will add all the symbols from all its source symbols in all unioned types.\n                    //   - In findRelatedSymbol, we will just use the union symbol if any source symbol is included in the search.\n                    // If the symbol is an instantiation from a another symbol (e.g. widened symbol):\n                    //   - In populateSearchSymbolsSet, add the root the list\n                    //   - In findRelatedSymbol, return the source symbol if that is in the search. (Do not return the instantiation symbol.)\n                    return ts.firstDefined(checker.getRootSymbols(sym), function (rootSymbol) {\n                        return cbSymbol(sym, rootSymbol, /*baseSymbol*/ undefined, kind)\n                            // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions\n                            || (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */) && allowBaseTypes(rootSymbol)\n                                ? getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, checker, function (base) { return cbSymbol(sym, rootSymbol, base, kind); })\n                                : undefined);\n                    });\n                }\n                function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) {\n                    var bindingElement = ts.getDeclarationOfKind(symbol, 198 /* BindingElement */);\n                    if (bindingElement && ts.isObjectBindingElementWithoutPropertyName(bindingElement)) {\n                        return ts.getPropertySymbolFromBindingElement(checker, bindingElement);\n                    }\n                }\n            }\n            /**\n             * Find symbol of the given property-name and add the symbol to the given result array\n             * @param symbol a symbol to start searching for the given propertyName\n             * @param propertyName a name of property to search for\n             * @param result an array of symbol of found property symbols\n             * @param previousIterationSymbolsCache a cache of symbol from previous iterations of calling this function to prevent infinite revisiting of the same symbol.\n             *                                The value of previousIterationSymbol is undefined when the function is first called.\n             */\n            function getPropertySymbolsFromBaseTypes(symbol, propertyName, checker, cb) {\n                var seen = new ts.Map();\n                return recur(symbol);\n                function recur(symbol) {\n                    // Use `addToSeen` to ensure we don't infinitely recurse in this situation:\n                    //      interface C extends C {\n                    //          /*findRef*/propName: string;\n                    //      }\n                    if (!(symbol.flags & (32 /* Class */ | 64 /* Interface */)) || !ts.addToSeen(seen, ts.getSymbolId(symbol)))\n                        return;\n                    return ts.firstDefined(symbol.declarations, function (declaration) { return ts.firstDefined(ts.getAllSuperTypeNodes(declaration), function (typeReference) {\n                        var type = checker.getTypeAtLocation(typeReference);\n                        var propertySymbol = type && type.symbol && checker.getPropertyOfType(type, propertyName);\n                        // Visit the typeReference as well to see if it directly or indirectly uses that property\n                        return type && propertySymbol && (ts.firstDefined(checker.getRootSymbols(propertySymbol), cb) || recur(type.symbol));\n                    }); });\n                }\n            }\n            function isStatic(symbol) {\n                if (!symbol.valueDeclaration) {\n                    return false;\n                }\n                var modifierFlags = ts.getEffectiveModifierFlags(symbol.valueDeclaration);\n                return !!(modifierFlags & 32 /* Static */);\n            }\n            function getRelatedSymbol(search, referenceSymbol, referenceLocation, state) {\n                var checker = state.checker;\n                return forEachRelatedSymbol(referenceSymbol, referenceLocation, checker, /*isForRenamePopulateSearchSymbolSet*/ false, \n                /*onlyIncludeBindingElementAtReferenceLocation*/ state.options.use !== 2 /* Rename */ || !!state.options.providePrefixAndSuffixTextForRename, function (sym, rootSymbol, baseSymbol, kind) {\n                    // check whether the symbol used to search itself is just the searched one.\n                    if (baseSymbol) {\n                        // static method/property and instance method/property might have the same name. Only check static or only check instance.\n                        if (isStatic(referenceSymbol) !== isStatic(baseSymbol)) {\n                            baseSymbol = undefined;\n                        }\n                    }\n                    return search.includes(baseSymbol || rootSymbol || sym)\n                        // For a base type, use the symbol for the derived type. For a synthetic (e.g. union) property, use the union symbol.\n                        ? { symbol: rootSymbol && !(ts.getCheckFlags(sym) & 6 /* Synthetic */) ? rootSymbol : sym, kind: kind }\n                        : undefined;\n                }, \n                /*allowBaseTypes*/ function (rootSymbol) {\n                    return !(search.parents && !search.parents.some(function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, state.inheritsFromCache, checker); }));\n                });\n            }\n            /**\n             * Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations\n             * of the corresponding symbol. e.g. if we are searching for \"Foo\" in value position, but \"Foo\" references a class\n             * then we need to widen the search to include type positions as well.\n             * On the contrary, if we are searching for \"Bar\" in type position and we trace bar to an interface, and an uninstantiated\n             * module, we want to keep the search limited to only types, as the two declarations (interface and uninstantiated module)\n             * do not intersect in any of the three spaces.\n             */\n            function getIntersectingMeaningFromDeclarations(node, symbol) {\n                var meaning = ts.getMeaningFromLocation(node);\n                var declarations = symbol.declarations;\n                if (declarations) {\n                    var lastIterationMeaning = void 0;\n                    do {\n                        // The result is order-sensitive, for instance if initialMeaning === Namespace, and declarations = [class, instantiated module]\n                        // we need to consider both as they initialMeaning intersects with the module in the namespace space, and the module\n                        // intersects with the class in the value space.\n                        // To achieve that we will keep iterating until the result stabilizes.\n                        // Remember the last meaning\n                        lastIterationMeaning = meaning;\n                        for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) {\n                            var declaration = declarations_2[_i];\n                            var declarationMeaning = ts.getMeaningFromDeclaration(declaration);\n                            if (declarationMeaning & meaning) {\n                                meaning |= declarationMeaning;\n                            }\n                        }\n                    } while (meaning !== lastIterationMeaning);\n                }\n                return meaning;\n            }\n            Core.getIntersectingMeaningFromDeclarations = getIntersectingMeaningFromDeclarations;\n            function isImplementation(node) {\n                return !!(node.flags & 8388608 /* Ambient */) ? !(ts.isInterfaceDeclaration(node) || ts.isTypeAliasDeclaration(node)) :\n                    (ts.isVariableLike(node) ? ts.hasInitializer(node) :\n                        ts.isFunctionLikeDeclaration(node) ? !!node.body :\n                            ts.isClassLike(node) || ts.isModuleOrEnumDeclaration(node));\n            }\n            function getReferenceEntriesForShorthandPropertyAssignment(node, checker, addReference) {\n                var refSymbol = checker.getSymbolAtLocation(node);\n                var shorthandSymbol = checker.getShorthandAssignmentValueSymbol(refSymbol.valueDeclaration);\n                if (shorthandSymbol) {\n                    for (var _i = 0, _a = shorthandSymbol.getDeclarations(); _i < _a.length; _i++) {\n                        var declaration = _a[_i];\n                        if (ts.getMeaningFromDeclaration(declaration) & 1 /* Value */) {\n                            addReference(declaration);\n                        }\n                    }\n                }\n            }\n            Core.getReferenceEntriesForShorthandPropertyAssignment = getReferenceEntriesForShorthandPropertyAssignment;\n            function forEachDescendantOfKind(node, kind, action) {\n                ts.forEachChild(node, function (child) {\n                    if (child.kind === kind) {\n                        action(child);\n                    }\n                    forEachDescendantOfKind(child, kind, action);\n                });\n            }\n            /** Get `C` given `N` if `N` is in the position `class C extends N` or `class C extends foo.N` where `N` is an identifier. */\n            function tryGetClassByExtendingIdentifier(node) {\n                return ts.tryGetClassExtendingExpressionWithTypeArguments(ts.climbPastPropertyAccess(node).parent);\n            }\n            /**\n             * If we are just looking for implementations and this is a property access expression, we need to get the\n             * symbol of the local type of the symbol the property is being accessed on. This is because our search\n             * symbol may have a different parent symbol if the local type's symbol does not declare the property\n             * being accessed (i.e. it is declared in some parent class or interface)\n             */\n            function getParentSymbolsOfPropertyAccess(location, symbol, checker) {\n                var propertyAccessExpression = ts.isRightSideOfPropertyAccess(location) ? location.parent : undefined;\n                var lhsType = propertyAccessExpression && checker.getTypeAtLocation(propertyAccessExpression.expression);\n                var res = ts.mapDefined(lhsType && (lhsType.isUnionOrIntersection() ? lhsType.types : lhsType.symbol === symbol.parent ? undefined : [lhsType]), function (t) {\n                    return t.symbol && t.symbol.flags & (32 /* Class */ | 64 /* Interface */) ? t.symbol : undefined;\n                });\n                return res.length === 0 ? undefined : res;\n            }\n            function isForRenameWithPrefixAndSuffixText(options) {\n                return options.use === 2 /* Rename */ && options.providePrefixAndSuffixTextForRename;\n            }\n        })(Core = FindAllReferences.Core || (FindAllReferences.Core = {}));\n    })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var CallHierarchy;\n    (function (CallHierarchy) {\n        /** Indictates whether a node is named function or class expression. */\n        function isNamedExpression(node) {\n            return (ts.isFunctionExpression(node) || ts.isClassExpression(node)) && ts.isNamedDeclaration(node);\n        }\n        /** Indicates whether a node is a function, arrow, or class expression assigned to a constant variable. */\n        function isConstNamedExpression(node) {\n            return (ts.isFunctionExpression(node) || ts.isArrowFunction(node) || ts.isClassExpression(node))\n                && ts.isVariableDeclaration(node.parent)\n                && node === node.parent.initializer\n                && ts.isIdentifier(node.parent.name)\n                && !!(ts.getCombinedNodeFlags(node.parent) & 2 /* Const */);\n        }\n        /**\n         * Indicates whether a node could possibly be a call hierarchy declaration.\n         *\n         * See `resolveCallHierarchyDeclaration` for the specific rules.\n         */\n        function isPossibleCallHierarchyDeclaration(node) {\n            return ts.isSourceFile(node)\n                || ts.isModuleDeclaration(node)\n                || ts.isFunctionDeclaration(node)\n                || ts.isFunctionExpression(node)\n                || ts.isClassDeclaration(node)\n                || ts.isClassExpression(node)\n                || ts.isMethodDeclaration(node)\n                || ts.isMethodSignature(node)\n                || ts.isGetAccessorDeclaration(node)\n                || ts.isSetAccessorDeclaration(node);\n        }\n        /**\n         * Indicates whether a node is a valid a call hierarchy declaration.\n         *\n         * See `resolveCallHierarchyDeclaration` for the specific rules.\n         */\n        function isValidCallHierarchyDeclaration(node) {\n            return ts.isSourceFile(node)\n                || ts.isModuleDeclaration(node) && ts.isIdentifier(node.name)\n                || ts.isFunctionDeclaration(node)\n                || ts.isClassDeclaration(node)\n                || ts.isMethodDeclaration(node)\n                || ts.isMethodSignature(node)\n                || ts.isGetAccessorDeclaration(node)\n                || ts.isSetAccessorDeclaration(node)\n                || isNamedExpression(node)\n                || isConstNamedExpression(node);\n        }\n        /** Gets the node that can be used as a reference to a call hierarchy declaration. */\n        function getCallHierarchyDeclarationReferenceNode(node) {\n            if (ts.isSourceFile(node))\n                return node;\n            if (ts.isNamedDeclaration(node))\n                return node.name;\n            if (isConstNamedExpression(node))\n                return node.parent.name;\n            return ts.Debug.checkDefined(node.modifiers && ts.find(node.modifiers, isDefaultModifier));\n        }\n        function isDefaultModifier(node) {\n            return node.kind === 87 /* DefaultKeyword */;\n        }\n        /** Gets the symbol for a call hierarchy declaration. */\n        function getSymbolOfCallHierarchyDeclaration(typeChecker, node) {\n            var location = getCallHierarchyDeclarationReferenceNode(node);\n            return location && typeChecker.getSymbolAtLocation(location);\n        }\n        /** Gets the text and range for the name of a call hierarchy declaration. */\n        function getCallHierarchyItemName(program, node) {\n            if (ts.isSourceFile(node)) {\n                return { text: node.fileName, pos: 0, end: 0 };\n            }\n            if ((ts.isFunctionDeclaration(node) || ts.isClassDeclaration(node)) && !ts.isNamedDeclaration(node)) {\n                var defaultModifier = node.modifiers && ts.find(node.modifiers, isDefaultModifier);\n                if (defaultModifier) {\n                    return { text: \"default\", pos: defaultModifier.getStart(), end: defaultModifier.getEnd() };\n                }\n            }\n            var declName = isConstNamedExpression(node) ? node.parent.name :\n                ts.Debug.checkDefined(ts.getNameOfDeclaration(node), \"Expected call hierarchy item to have a name\");\n            var text = ts.isIdentifier(declName) ? ts.idText(declName) :\n                ts.isStringOrNumericLiteralLike(declName) ? declName.text :\n                    ts.isComputedPropertyName(declName) ?\n                        ts.isStringOrNumericLiteralLike(declName.expression) ? declName.expression.text :\n                            undefined :\n                        undefined;\n            if (text === undefined) {\n                var typeChecker = program.getTypeChecker();\n                var symbol = typeChecker.getSymbolAtLocation(declName);\n                if (symbol) {\n                    text = typeChecker.symbolToString(symbol, node);\n                }\n            }\n            if (text === undefined) {\n                // get the text from printing the node on a single line without comments...\n                var printer_1 = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true });\n                text = ts.usingSingleLineStringWriter(function (writer) { return printer_1.writeNode(4 /* Unspecified */, node, node.getSourceFile(), writer); });\n            }\n            return { text: text, pos: declName.getStart(), end: declName.getEnd() };\n        }\n        function getCallHierarchItemContainerName(node) {\n            var _a, _b;\n            if (isConstNamedExpression(node)) {\n                if (ts.isModuleBlock(node.parent.parent.parent.parent) && ts.isIdentifier(node.parent.parent.parent.parent.parent.name)) {\n                    return node.parent.parent.parent.parent.parent.name.getText();\n                }\n                return;\n            }\n            switch (node.kind) {\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                case 165 /* MethodDeclaration */:\n                    if (node.parent.kind === 200 /* ObjectLiteralExpression */) {\n                        return (_a = ts.getAssignedName(node.parent)) === null || _a === void 0 ? void 0 : _a.getText();\n                    }\n                    return (_b = ts.getNameOfDeclaration(node.parent)) === null || _b === void 0 ? void 0 : _b.getText();\n                case 251 /* FunctionDeclaration */:\n                case 252 /* ClassDeclaration */:\n                case 256 /* ModuleDeclaration */:\n                    if (ts.isModuleBlock(node.parent) && ts.isIdentifier(node.parent.parent.name)) {\n                        return node.parent.parent.name.getText();\n                    }\n            }\n        }\n        function findImplementation(typeChecker, node) {\n            if (node.body) {\n                return node;\n            }\n            if (ts.isConstructorDeclaration(node)) {\n                return ts.getFirstConstructorWithBody(node.parent);\n            }\n            if (ts.isFunctionDeclaration(node) || ts.isMethodDeclaration(node)) {\n                var symbol = getSymbolOfCallHierarchyDeclaration(typeChecker, node);\n                if (symbol && symbol.valueDeclaration && ts.isFunctionLikeDeclaration(symbol.valueDeclaration) && symbol.valueDeclaration.body) {\n                    return symbol.valueDeclaration;\n                }\n                return undefined;\n            }\n            return node;\n        }\n        function findAllInitialDeclarations(typeChecker, node) {\n            var symbol = getSymbolOfCallHierarchyDeclaration(typeChecker, node);\n            var declarations;\n            if (symbol && symbol.declarations) {\n                var indices = ts.indicesOf(symbol.declarations);\n                var keys_1 = ts.map(symbol.declarations, function (decl) { return ({ file: decl.getSourceFile().fileName, pos: decl.pos }); });\n                indices.sort(function (a, b) { return ts.compareStringsCaseSensitive(keys_1[a].file, keys_1[b].file) || keys_1[a].pos - keys_1[b].pos; });\n                var sortedDeclarations = ts.map(indices, function (i) { return symbol.declarations[i]; });\n                var lastDecl = void 0;\n                for (var _i = 0, sortedDeclarations_1 = sortedDeclarations; _i < sortedDeclarations_1.length; _i++) {\n                    var decl = sortedDeclarations_1[_i];\n                    if (isValidCallHierarchyDeclaration(decl)) {\n                        if (!lastDecl || lastDecl.parent !== decl.parent || lastDecl.end !== decl.pos) {\n                            declarations = ts.append(declarations, decl);\n                        }\n                        lastDecl = decl;\n                    }\n                }\n            }\n            return declarations;\n        }\n        /** Find the implementation or the first declaration for a call hierarchy declaration. */\n        function findImplementationOrAllInitialDeclarations(typeChecker, node) {\n            var _a, _b, _c;\n            if (ts.isFunctionLikeDeclaration(node)) {\n                return (_b = (_a = findImplementation(typeChecker, node)) !== null && _a !== void 0 ? _a : findAllInitialDeclarations(typeChecker, node)) !== null && _b !== void 0 ? _b : node;\n            }\n            return (_c = findAllInitialDeclarations(typeChecker, node)) !== null && _c !== void 0 ? _c : node;\n        }\n        /** Resolves the call hierarchy declaration for a node. */\n        function resolveCallHierarchyDeclaration(program, location) {\n            // A call hierarchy item must refer to either a SourceFile, Module Declaration, or something intrinsically callable that has a name:\n            // - Class Declarations\n            // - Class Expressions (with a name)\n            // - Function Declarations\n            // - Function Expressions (with a name or assigned to a const variable)\n            // - Arrow Functions (assigned to a const variable)\n            // - Constructors\n            // - Methods\n            // - Accessors\n            //\n            // If a call is contained in a non-named callable Node (function expression, arrow function, etc.), then\n            // its containing `CallHierarchyItem` is a containing function or SourceFile that matches the above list.\n            var typeChecker = program.getTypeChecker();\n            var followingSymbol = false;\n            while (true) {\n                if (isValidCallHierarchyDeclaration(location)) {\n                    return findImplementationOrAllInitialDeclarations(typeChecker, location);\n                }\n                if (isPossibleCallHierarchyDeclaration(location)) {\n                    var ancestor = ts.findAncestor(location, isValidCallHierarchyDeclaration);\n                    return ancestor && findImplementationOrAllInitialDeclarations(typeChecker, ancestor);\n                }\n                if (ts.isDeclarationName(location)) {\n                    if (isValidCallHierarchyDeclaration(location.parent)) {\n                        return findImplementationOrAllInitialDeclarations(typeChecker, location.parent);\n                    }\n                    if (isPossibleCallHierarchyDeclaration(location.parent)) {\n                        var ancestor = ts.findAncestor(location.parent, isValidCallHierarchyDeclaration);\n                        return ancestor && findImplementationOrAllInitialDeclarations(typeChecker, ancestor);\n                    }\n                    if (ts.isVariableDeclaration(location.parent) && location.parent.initializer && isConstNamedExpression(location.parent.initializer)) {\n                        return location.parent.initializer;\n                    }\n                    return undefined;\n                }\n                if (ts.isConstructorDeclaration(location)) {\n                    if (isValidCallHierarchyDeclaration(location.parent)) {\n                        return location.parent;\n                    }\n                    return undefined;\n                }\n                // #39453\n                if (ts.isVariableDeclaration(location) && location.initializer && isConstNamedExpression(location.initializer)) {\n                    return location.initializer;\n                }\n                if (!followingSymbol) {\n                    var symbol = typeChecker.getSymbolAtLocation(location);\n                    if (symbol) {\n                        if (symbol.flags & 2097152 /* Alias */) {\n                            symbol = typeChecker.getAliasedSymbol(symbol);\n                        }\n                        if (symbol.valueDeclaration) {\n                            followingSymbol = true;\n                            location = symbol.valueDeclaration;\n                            continue;\n                        }\n                    }\n                }\n                return undefined;\n            }\n        }\n        CallHierarchy.resolveCallHierarchyDeclaration = resolveCallHierarchyDeclaration;\n        /** Creates a `CallHierarchyItem` for a call hierarchy declaration. */\n        function createCallHierarchyItem(program, node) {\n            var sourceFile = node.getSourceFile();\n            var name = getCallHierarchyItemName(program, node);\n            var containerName = getCallHierarchItemContainerName(node);\n            var kind = ts.getNodeKind(node);\n            var kindModifiers = ts.getNodeModifiers(node);\n            var span = ts.createTextSpanFromBounds(ts.skipTrivia(sourceFile.text, node.getFullStart(), /*stopAfterLineBreak*/ false, /*stopAtComments*/ true), node.getEnd());\n            var selectionSpan = ts.createTextSpanFromBounds(name.pos, name.end);\n            return { file: sourceFile.fileName, kind: kind, kindModifiers: kindModifiers, name: name.text, containerName: containerName, span: span, selectionSpan: selectionSpan };\n        }\n        CallHierarchy.createCallHierarchyItem = createCallHierarchyItem;\n        function isDefined(x) {\n            return x !== undefined;\n        }\n        function convertEntryToCallSite(entry) {\n            if (entry.kind === 1 /* Node */) {\n                var node = entry.node;\n                if (ts.isCallOrNewExpressionTarget(node, /*includeElementAccess*/ true, /*skipPastOuterExpressions*/ true)\n                    || ts.isTaggedTemplateTag(node, /*includeElementAccess*/ true, /*skipPastOuterExpressions*/ true)\n                    || ts.isDecoratorTarget(node, /*includeElementAccess*/ true, /*skipPastOuterExpressions*/ true)\n                    || ts.isJsxOpeningLikeElementTagName(node, /*includeElementAccess*/ true, /*skipPastOuterExpressions*/ true)\n                    || ts.isRightSideOfPropertyAccess(node)\n                    || ts.isArgumentExpressionOfElementAccess(node)) {\n                    var sourceFile = node.getSourceFile();\n                    var ancestor = ts.findAncestor(node, isValidCallHierarchyDeclaration) || sourceFile;\n                    return { declaration: ancestor, range: ts.createTextRangeFromNode(node, sourceFile) };\n                }\n            }\n        }\n        function getCallSiteGroupKey(entry) {\n            return ts.getNodeId(entry.declaration);\n        }\n        function createCallHierarchyIncomingCall(from, fromSpans) {\n            return { from: from, fromSpans: fromSpans };\n        }\n        function convertCallSiteGroupToIncomingCall(program, entries) {\n            return createCallHierarchyIncomingCall(createCallHierarchyItem(program, entries[0].declaration), ts.map(entries, function (entry) { return ts.createTextSpanFromRange(entry.range); }));\n        }\n        /** Gets the call sites that call into the provided call hierarchy declaration. */\n        function getIncomingCalls(program, declaration, cancellationToken) {\n            // Source files and modules have no incoming calls.\n            if (ts.isSourceFile(declaration) || ts.isModuleDeclaration(declaration)) {\n                return [];\n            }\n            var location = getCallHierarchyDeclarationReferenceNode(declaration);\n            var calls = ts.filter(ts.FindAllReferences.findReferenceOrRenameEntries(program, cancellationToken, program.getSourceFiles(), location, /*position*/ 0, { use: 1 /* References */ }, convertEntryToCallSite), isDefined);\n            return calls ? ts.group(calls, getCallSiteGroupKey, function (entries) { return convertCallSiteGroupToIncomingCall(program, entries); }) : [];\n        }\n        CallHierarchy.getIncomingCalls = getIncomingCalls;\n        function createCallSiteCollector(program, callSites) {\n            function recordCallSite(node) {\n                var target = ts.isTaggedTemplateExpression(node) ? node.tag :\n                    ts.isJsxOpeningLikeElement(node) ? node.tagName :\n                        ts.isAccessExpression(node) ? node :\n                            node.expression;\n                var declaration = resolveCallHierarchyDeclaration(program, target);\n                if (declaration) {\n                    var range = ts.createTextRangeFromNode(target, node.getSourceFile());\n                    if (ts.isArray(declaration)) {\n                        for (var _i = 0, declaration_1 = declaration; _i < declaration_1.length; _i++) {\n                            var decl = declaration_1[_i];\n                            callSites.push({ declaration: decl, range: range });\n                        }\n                    }\n                    else {\n                        callSites.push({ declaration: declaration, range: range });\n                    }\n                }\n            }\n            function collect(node) {\n                if (!node)\n                    return;\n                if (node.flags & 8388608 /* Ambient */) {\n                    // do not descend into ambient nodes.\n                    return;\n                }\n                if (isValidCallHierarchyDeclaration(node)) {\n                    // do not descend into other call site declarations, other than class member names\n                    if (ts.isClassLike(node)) {\n                        for (var _i = 0, _a = node.members; _i < _a.length; _i++) {\n                            var member = _a[_i];\n                            if (member.name && ts.isComputedPropertyName(member.name)) {\n                                collect(member.name.expression);\n                            }\n                        }\n                    }\n                    return;\n                }\n                switch (node.kind) {\n                    case 78 /* Identifier */:\n                    case 260 /* ImportEqualsDeclaration */:\n                    case 261 /* ImportDeclaration */:\n                    case 267 /* ExportDeclaration */:\n                    case 253 /* InterfaceDeclaration */:\n                    case 254 /* TypeAliasDeclaration */:\n                        // do not descend into nodes that cannot contain callable nodes\n                        return;\n                    case 206 /* TypeAssertionExpression */:\n                    case 224 /* AsExpression */:\n                        // do not descend into the type side of an assertion\n                        collect(node.expression);\n                        return;\n                    case 249 /* VariableDeclaration */:\n                    case 160 /* Parameter */:\n                        // do not descend into the type of a variable or parameter declaration\n                        collect(node.name);\n                        collect(node.initializer);\n                        return;\n                    case 203 /* CallExpression */:\n                        // do not descend into the type arguments of a call expression\n                        recordCallSite(node);\n                        collect(node.expression);\n                        ts.forEach(node.arguments, collect);\n                        return;\n                    case 204 /* NewExpression */:\n                        // do not descend into the type arguments of a new expression\n                        recordCallSite(node);\n                        collect(node.expression);\n                        ts.forEach(node.arguments, collect);\n                        return;\n                    case 205 /* TaggedTemplateExpression */:\n                        // do not descend into the type arguments of a tagged template expression\n                        recordCallSite(node);\n                        collect(node.tag);\n                        collect(node.template);\n                        return;\n                    case 275 /* JsxOpeningElement */:\n                    case 274 /* JsxSelfClosingElement */:\n                        // do not descend into the type arguments of a JsxOpeningLikeElement\n                        recordCallSite(node);\n                        collect(node.tagName);\n                        collect(node.attributes);\n                        return;\n                    case 161 /* Decorator */:\n                        recordCallSite(node);\n                        collect(node.expression);\n                        return;\n                    case 201 /* PropertyAccessExpression */:\n                    case 202 /* ElementAccessExpression */:\n                        recordCallSite(node);\n                        ts.forEachChild(node, collect);\n                        break;\n                }\n                if (ts.isPartOfTypeNode(node)) {\n                    // do not descend into types\n                    return;\n                }\n                ts.forEachChild(node, collect);\n            }\n            return collect;\n        }\n        function collectCallSitesOfSourceFile(node, collect) {\n            ts.forEach(node.statements, collect);\n        }\n        function collectCallSitesOfModuleDeclaration(node, collect) {\n            if (!ts.hasSyntacticModifier(node, 2 /* Ambient */) && node.body && ts.isModuleBlock(node.body)) {\n                ts.forEach(node.body.statements, collect);\n            }\n        }\n        function collectCallSitesOfFunctionLikeDeclaration(typeChecker, node, collect) {\n            var implementation = findImplementation(typeChecker, node);\n            if (implementation) {\n                ts.forEach(implementation.parameters, collect);\n                collect(implementation.body);\n            }\n        }\n        function collectCallSitesOfClassLikeDeclaration(node, collect) {\n            ts.forEach(node.decorators, collect);\n            var heritage = ts.getClassExtendsHeritageElement(node);\n            if (heritage) {\n                collect(heritage.expression);\n            }\n            for (var _i = 0, _a = node.members; _i < _a.length; _i++) {\n                var member = _a[_i];\n                ts.forEach(member.decorators, collect);\n                if (ts.isPropertyDeclaration(member)) {\n                    collect(member.initializer);\n                }\n                else if (ts.isConstructorDeclaration(member) && member.body) {\n                    ts.forEach(member.parameters, collect);\n                    collect(member.body);\n                }\n            }\n        }\n        function collectCallSites(program, node) {\n            var callSites = [];\n            var collect = createCallSiteCollector(program, callSites);\n            switch (node.kind) {\n                case 297 /* SourceFile */:\n                    collectCallSitesOfSourceFile(node, collect);\n                    break;\n                case 256 /* ModuleDeclaration */:\n                    collectCallSitesOfModuleDeclaration(node, collect);\n                    break;\n                case 251 /* FunctionDeclaration */:\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                case 165 /* MethodDeclaration */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect);\n                    break;\n                case 252 /* ClassDeclaration */:\n                case 221 /* ClassExpression */:\n                    collectCallSitesOfClassLikeDeclaration(node, collect);\n                    break;\n                default:\n                    ts.Debug.assertNever(node);\n            }\n            return callSites;\n        }\n        function createCallHierarchyOutgoingCall(to, fromSpans) {\n            return { to: to, fromSpans: fromSpans };\n        }\n        function convertCallSiteGroupToOutgoingCall(program, entries) {\n            return createCallHierarchyOutgoingCall(createCallHierarchyItem(program, entries[0].declaration), ts.map(entries, function (entry) { return ts.createTextSpanFromRange(entry.range); }));\n        }\n        /** Gets the call sites that call out of the provided call hierarchy declaration. */\n        function getOutgoingCalls(program, declaration) {\n            if (declaration.flags & 8388608 /* Ambient */ || ts.isMethodSignature(declaration)) {\n                return [];\n            }\n            return ts.group(collectCallSites(program, declaration), getCallSiteGroupKey, function (entries) { return convertCallSiteGroupToOutgoingCall(program, entries); });\n        }\n        CallHierarchy.getOutgoingCalls = getOutgoingCalls;\n    })(CallHierarchy = ts.CallHierarchy || (ts.CallHierarchy = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    function getEditsForFileRename(program, oldFileOrDirPath, newFileOrDirPath, host, formatContext, preferences, sourceMapper) {\n        var useCaseSensitiveFileNames = ts.hostUsesCaseSensitiveFileNames(host);\n        var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);\n        var oldToNew = getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName, sourceMapper);\n        var newToOld = getPathUpdater(newFileOrDirPath, oldFileOrDirPath, getCanonicalFileName, sourceMapper);\n        return ts.textChanges.ChangeTracker.with({ host: host, formatContext: formatContext, preferences: preferences }, function (changeTracker) {\n            updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, host.getCurrentDirectory(), useCaseSensitiveFileNames);\n            updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName);\n        });\n    }\n    ts.getEditsForFileRename = getEditsForFileRename;\n    // exported for tests\n    function getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName, sourceMapper) {\n        var canonicalOldPath = getCanonicalFileName(oldFileOrDirPath);\n        return function (path) {\n            var originalPath = sourceMapper && sourceMapper.tryGetSourcePosition({ fileName: path, pos: 0 });\n            var updatedPath = getUpdatedPath(originalPath ? originalPath.fileName : path);\n            return originalPath\n                ? updatedPath === undefined ? undefined : makeCorrespondingRelativeChange(originalPath.fileName, updatedPath, path, getCanonicalFileName)\n                : updatedPath;\n        };\n        function getUpdatedPath(pathToUpdate) {\n            if (getCanonicalFileName(pathToUpdate) === canonicalOldPath)\n                return newFileOrDirPath;\n            var suffix = ts.tryRemoveDirectoryPrefix(pathToUpdate, canonicalOldPath, getCanonicalFileName);\n            return suffix === undefined ? undefined : newFileOrDirPath + \"/\" + suffix;\n        }\n    }\n    ts.getPathUpdater = getPathUpdater;\n    // Relative path from a0 to b0 should be same as relative path from a1 to b1. Returns b1.\n    function makeCorrespondingRelativeChange(a0, b0, a1, getCanonicalFileName) {\n        var rel = ts.getRelativePathFromFile(a0, b0, getCanonicalFileName);\n        return combinePathsSafe(ts.getDirectoryPath(a1), rel);\n    }\n    function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, currentDirectory, useCaseSensitiveFileNames) {\n        var configFile = program.getCompilerOptions().configFile;\n        if (!configFile)\n            return;\n        var configDir = ts.getDirectoryPath(configFile.fileName);\n        var jsonObjectLiteral = ts.getTsConfigObjectLiteralExpression(configFile);\n        if (!jsonObjectLiteral)\n            return;\n        forEachProperty(jsonObjectLiteral, function (property, propertyName) {\n            switch (propertyName) {\n                case \"files\":\n                case \"include\":\n                case \"exclude\": {\n                    var foundExactMatch = updatePaths(property);\n                    if (!foundExactMatch && propertyName === \"include\" && ts.isArrayLiteralExpression(property.initializer)) {\n                        var includes = ts.mapDefined(property.initializer.elements, function (e) { return ts.isStringLiteral(e) ? e.text : undefined; });\n                        var matchers = ts.getFileMatcherPatterns(configDir, /*excludes*/ [], includes, useCaseSensitiveFileNames, currentDirectory);\n                        // If there isn't some include for this, add a new one.\n                        if (ts.getRegexFromPattern(ts.Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames).test(oldFileOrDirPath) &&\n                            !ts.getRegexFromPattern(ts.Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames).test(newFileOrDirPath)) {\n                            changeTracker.insertNodeAfter(configFile, ts.last(property.initializer.elements), ts.factory.createStringLiteral(relativePath(newFileOrDirPath)));\n                        }\n                    }\n                    break;\n                }\n                case \"compilerOptions\":\n                    forEachProperty(property.initializer, function (property, propertyName) {\n                        var option = ts.getOptionFromName(propertyName);\n                        if (option && (option.isFilePath || option.type === \"list\" && option.element.isFilePath)) {\n                            updatePaths(property);\n                        }\n                        else if (propertyName === \"paths\") {\n                            forEachProperty(property.initializer, function (pathsProperty) {\n                                if (!ts.isArrayLiteralExpression(pathsProperty.initializer))\n                                    return;\n                                for (var _i = 0, _a = pathsProperty.initializer.elements; _i < _a.length; _i++) {\n                                    var e = _a[_i];\n                                    tryUpdateString(e);\n                                }\n                            });\n                        }\n                    });\n                    break;\n            }\n        });\n        function updatePaths(property) {\n            // Type annotation needed due to #7294\n            var elements = ts.isArrayLiteralExpression(property.initializer) ? property.initializer.elements : [property.initializer];\n            var foundExactMatch = false;\n            for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {\n                var element = elements_1[_i];\n                foundExactMatch = tryUpdateString(element) || foundExactMatch;\n            }\n            return foundExactMatch;\n        }\n        function tryUpdateString(element) {\n            if (!ts.isStringLiteral(element))\n                return false;\n            var elementFileName = combinePathsSafe(configDir, element.text);\n            var updated = oldToNew(elementFileName);\n            if (updated !== undefined) {\n                changeTracker.replaceRangeWithText(configFile, createStringRange(element, configFile), relativePath(updated));\n                return true;\n            }\n            return false;\n        }\n        function relativePath(path) {\n            return ts.getRelativePathFromDirectory(configDir, path, /*ignoreCase*/ !useCaseSensitiveFileNames);\n        }\n    }\n    function updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName) {\n        var allFiles = program.getSourceFiles();\n        var _loop_4 = function (sourceFile) {\n            var newFromOld = oldToNew(sourceFile.fileName);\n            var newImportFromPath = newFromOld !== null && newFromOld !== void 0 ? newFromOld : sourceFile.fileName;\n            var newImportFromDirectory = ts.getDirectoryPath(newImportFromPath);\n            var oldFromNew = newToOld(sourceFile.fileName);\n            var oldImportFromPath = oldFromNew || sourceFile.fileName;\n            var oldImportFromDirectory = ts.getDirectoryPath(oldImportFromPath);\n            var importingSourceFileMoved = newFromOld !== undefined || oldFromNew !== undefined;\n            updateImportsWorker(sourceFile, changeTracker, function (referenceText) {\n                if (!ts.pathIsRelative(referenceText))\n                    return undefined;\n                var oldAbsolute = combinePathsSafe(oldImportFromDirectory, referenceText);\n                var newAbsolute = oldToNew(oldAbsolute);\n                return newAbsolute === undefined ? undefined : ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(newImportFromDirectory, newAbsolute, getCanonicalFileName));\n            }, function (importLiteral) {\n                var importedModuleSymbol = program.getTypeChecker().getSymbolAtLocation(importLiteral);\n                // No need to update if it's an ambient module^M\n                if (importedModuleSymbol && importedModuleSymbol.declarations.some(function (d) { return ts.isAmbientModule(d); }))\n                    return undefined;\n                var toImport = oldFromNew !== undefined\n                    // If we're at the new location (file was already renamed), need to redo module resolution starting from the old location.\n                    // TODO:GH#18217\n                    ? getSourceFileToImportFromResolved(importLiteral, ts.resolveModuleName(importLiteral.text, oldImportFromPath, program.getCompilerOptions(), host), oldToNew, allFiles)\n                    : getSourceFileToImport(importedModuleSymbol, importLiteral, sourceFile, program, host, oldToNew);\n                // Need an update if the imported file moved, or the importing file moved and was using a relative path.\n                return toImport !== undefined && (toImport.updated || (importingSourceFileMoved && ts.pathIsRelative(importLiteral.text)))\n                    ? ts.moduleSpecifiers.updateModuleSpecifier(program.getCompilerOptions(), getCanonicalFileName(newImportFromPath), toImport.newFileName, ts.createModuleSpecifierResolutionHost(program, host), importLiteral.text)\n                    : undefined;\n            });\n        };\n        for (var _i = 0, allFiles_1 = allFiles; _i < allFiles_1.length; _i++) {\n            var sourceFile = allFiles_1[_i];\n            _loop_4(sourceFile);\n        }\n    }\n    function combineNormal(pathA, pathB) {\n        return ts.normalizePath(ts.combinePaths(pathA, pathB));\n    }\n    function combinePathsSafe(pathA, pathB) {\n        return ts.ensurePathIsNonModuleName(combineNormal(pathA, pathB));\n    }\n    function getSourceFileToImport(importedModuleSymbol, importLiteral, importingSourceFile, program, host, oldToNew) {\n        if (importedModuleSymbol) {\n            // `find` should succeed because we checked for ambient modules before calling this function.\n            var oldFileName = ts.find(importedModuleSymbol.declarations, ts.isSourceFile).fileName;\n            var newFileName = oldToNew(oldFileName);\n            return newFileName === undefined ? { newFileName: oldFileName, updated: false } : { newFileName: newFileName, updated: true };\n        }\n        else {\n            var resolved = host.resolveModuleNames\n                ? host.getResolvedModuleWithFailedLookupLocationsFromCache && host.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName)\n                : program.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName);\n            return getSourceFileToImportFromResolved(importLiteral, resolved, oldToNew, program.getSourceFiles());\n        }\n    }\n    function getSourceFileToImportFromResolved(importLiteral, resolved, oldToNew, sourceFiles) {\n        // Search through all locations looking for a moved file, and only then test already existing files.\n        // This is because if `a.ts` is compiled to `a.js` and `a.ts` is moved, we don't want to resolve anything to `a.js`, but to `a.ts`'s new location.\n        if (!resolved)\n            return undefined;\n        // First try resolved module\n        if (resolved.resolvedModule) {\n            var result_2 = tryChange(resolved.resolvedModule.resolvedFileName);\n            if (result_2)\n                return result_2;\n        }\n        // Then failed lookups that are in the list of sources\n        var result = ts.forEach(resolved.failedLookupLocations, tryChangeWithIgnoringPackageJsonExisting)\n            // Then failed lookups except package.json since we dont want to touch them (only included ts/js files).\n            // At this point, the confidence level of this fix being correct is too low to change bare specifiers or absolute paths.\n            || ts.pathIsRelative(importLiteral.text) && ts.forEach(resolved.failedLookupLocations, tryChangeWithIgnoringPackageJson);\n        if (result)\n            return result;\n        // If nothing changed, then result is resolved module file thats not updated\n        return resolved.resolvedModule && { newFileName: resolved.resolvedModule.resolvedFileName, updated: false };\n        function tryChangeWithIgnoringPackageJsonExisting(oldFileName) {\n            var newFileName = oldToNew(oldFileName);\n            return newFileName && ts.find(sourceFiles, function (src) { return src.fileName === newFileName; })\n                ? tryChangeWithIgnoringPackageJson(oldFileName) : undefined;\n        }\n        function tryChangeWithIgnoringPackageJson(oldFileName) {\n            return !ts.endsWith(oldFileName, \"/package.json\") ? tryChange(oldFileName) : undefined;\n        }\n        function tryChange(oldFileName) {\n            var newFileName = oldToNew(oldFileName);\n            return newFileName && { newFileName: newFileName, updated: true };\n        }\n    }\n    function updateImportsWorker(sourceFile, changeTracker, updateRef, updateImport) {\n        for (var _i = 0, _a = sourceFile.referencedFiles || ts.emptyArray; _i < _a.length; _i++) { // TODO: GH#26162\n            var ref = _a[_i];\n            var updated = updateRef(ref.fileName);\n            if (updated !== undefined && updated !== sourceFile.text.slice(ref.pos, ref.end))\n                changeTracker.replaceRangeWithText(sourceFile, ref, updated);\n        }\n        for (var _b = 0, _c = sourceFile.imports; _b < _c.length; _b++) {\n            var importStringLiteral = _c[_b];\n            var updated = updateImport(importStringLiteral);\n            if (updated !== undefined && updated !== importStringLiteral.text)\n                changeTracker.replaceRangeWithText(sourceFile, createStringRange(importStringLiteral, sourceFile), updated);\n        }\n    }\n    function createStringRange(node, sourceFile) {\n        return ts.createRange(node.getStart(sourceFile) + 1, node.end - 1);\n    }\n    function forEachProperty(objectLiteral, cb) {\n        if (!ts.isObjectLiteralExpression(objectLiteral))\n            return;\n        for (var _i = 0, _a = objectLiteral.properties; _i < _a.length; _i++) {\n            var property = _a[_i];\n            if (ts.isPropertyAssignment(property) && ts.isStringLiteral(property.name)) {\n                cb(property, property.name.text);\n            }\n        }\n    }\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var GoToDefinition;\n    (function (GoToDefinition) {\n        function getDefinitionAtPosition(program, sourceFile, position) {\n            var resolvedRef = getReferenceAtPosition(sourceFile, position, program);\n            if (resolvedRef) {\n                return [getDefinitionInfoForFileReference(resolvedRef.reference.fileName, resolvedRef.file.fileName)];\n            }\n            var node = ts.getTouchingPropertyName(sourceFile, position);\n            if (node === sourceFile) {\n                return undefined;\n            }\n            var parent = node.parent;\n            var typeChecker = program.getTypeChecker();\n            // Labels\n            if (ts.isJumpStatementTarget(node)) {\n                var label = ts.getTargetLabel(node.parent, node.text);\n                return label ? [createDefinitionInfoFromName(typeChecker, label, \"label\" /* label */, node.text, /*containerName*/ undefined)] : undefined; // TODO: GH#18217\n            }\n            var symbol = getSymbol(node, typeChecker);\n            // Could not find a symbol e.g. node is string or number keyword,\n            // or the symbol was an internal symbol and does not have a declaration e.g. undefined symbol\n            if (!symbol) {\n                return getDefinitionInfoForIndexSignatures(node, typeChecker);\n            }\n            var calledDeclaration = tryGetSignatureDeclaration(typeChecker, node);\n            // Don't go to the component constructor definition for a JSX element, just go to the component definition.\n            if (calledDeclaration && !(ts.isJsxOpeningLikeElement(node.parent) && isConstructorLike(calledDeclaration))) {\n                var sigInfo = createDefinitionFromSignatureDeclaration(typeChecker, calledDeclaration);\n                // For a function, if this is the original function definition, return just sigInfo.\n                // If this is the original constructor definition, parent is the class.\n                if (typeChecker.getRootSymbols(symbol).some(function (s) { return symbolMatchesSignature(s, calledDeclaration); })) {\n                    return [sigInfo];\n                }\n                else {\n                    var defs = getDefinitionFromSymbol(typeChecker, symbol, node, calledDeclaration) || ts.emptyArray;\n                    // For a 'super()' call, put the signature first, else put the variable first.\n                    return node.kind === 105 /* SuperKeyword */ ? __spreadArray([sigInfo], defs) : __spreadArray(__spreadArray([], defs), [sigInfo]);\n                }\n            }\n            // Because name in short-hand property assignment has two different meanings: property name and property value,\n            // using go-to-definition at such position should go to the variable declaration of the property value rather than\n            // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition\n            // is performed at the location of property access, we would like to go to definition of the property in the short-hand\n            // assignment. This case and others are handled by the following code.\n            if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) {\n                var shorthandSymbol_1 = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);\n                return shorthandSymbol_1 ? shorthandSymbol_1.declarations.map(function (decl) { return createDefinitionInfo(decl, typeChecker, shorthandSymbol_1, node); }) : [];\n            }\n            // If the node is the name of a BindingElement within an ObjectBindingPattern instead of just returning the\n            // declaration the symbol (which is itself), we should try to get to the original type of the ObjectBindingPattern\n            // and return the property declaration for the referenced property.\n            // For example:\n            //      import('./foo').then(({ b/*goto*/ar }) => undefined); => should get use to the declaration in file \"./foo\"\n            //\n            //      function bar<T>(onfulfilled: (value: T) => void) { //....}\n            //      interface Test {\n            //          pr/*destination*/op1: number\n            //      }\n            //      bar<Test>(({pr/*goto*/op1})=>{});\n            if (ts.isPropertyName(node) && ts.isBindingElement(parent) && ts.isObjectBindingPattern(parent.parent) &&\n                (node === (parent.propertyName || parent.name))) {\n                var name_3 = ts.getNameFromPropertyName(node);\n                var type = typeChecker.getTypeAtLocation(parent.parent);\n                return name_3 === undefined ? ts.emptyArray : ts.flatMap(type.isUnion() ? type.types : [type], function (t) {\n                    var prop = t.getProperty(name_3);\n                    return prop && getDefinitionFromSymbol(typeChecker, prop, node);\n                });\n            }\n            // If the current location we want to find its definition is in an object literal, try to get the contextual type for the\n            // object literal, lookup the property symbol in the contextual type, and use this for goto-definition.\n            // For example\n            //      interface Props{\n            //          /*first*/prop1: number\n            //          prop2: boolean\n            //      }\n            //      function Foo(arg: Props) {}\n            //      Foo( { pr/*1*/op1: 10, prop2: true })\n            var element = ts.getContainingObjectLiteralElement(node);\n            if (element) {\n                var contextualType = element && typeChecker.getContextualType(element.parent);\n                if (contextualType) {\n                    return ts.flatMap(ts.getPropertySymbolsFromContextualType(element, typeChecker, contextualType, /*unionSymbolOk*/ false), function (propertySymbol) {\n                        return getDefinitionFromSymbol(typeChecker, propertySymbol, node);\n                    });\n                }\n            }\n            return getDefinitionFromSymbol(typeChecker, symbol, node);\n        }\n        GoToDefinition.getDefinitionAtPosition = getDefinitionAtPosition;\n        /**\n         * True if we should not add definitions for both the signature symbol and the definition symbol.\n         * True for `const |f = |() => 0`, false for `function |f() {} const |g = f;`.\n         * Also true for any assignment RHS.\n         */\n        function symbolMatchesSignature(s, calledDeclaration) {\n            return s === calledDeclaration.symbol\n                || s === calledDeclaration.symbol.parent\n                || ts.isAssignmentExpression(calledDeclaration.parent)\n                || (!ts.isCallLikeExpression(calledDeclaration.parent) && s === calledDeclaration.parent.symbol);\n        }\n        function getReferenceAtPosition(sourceFile, position, program) {\n            var referencePath = findReferenceInPosition(sourceFile.referencedFiles, position);\n            if (referencePath) {\n                var file = program.getSourceFileFromReference(sourceFile, referencePath);\n                return file && { reference: referencePath, file: file };\n            }\n            var typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position);\n            if (typeReferenceDirective) {\n                var reference = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName);\n                var file = reference && program.getSourceFile(reference.resolvedFileName); // TODO:GH#18217\n                return file && { reference: typeReferenceDirective, file: file };\n            }\n            var libReferenceDirective = findReferenceInPosition(sourceFile.libReferenceDirectives, position);\n            if (libReferenceDirective) {\n                var file = program.getLibFileFromReference(libReferenceDirective);\n                return file && { reference: libReferenceDirective, file: file };\n            }\n            return undefined;\n        }\n        GoToDefinition.getReferenceAtPosition = getReferenceAtPosition;\n        /// Goto type\n        function getTypeDefinitionAtPosition(typeChecker, sourceFile, position) {\n            var node = ts.getTouchingPropertyName(sourceFile, position);\n            if (node === sourceFile) {\n                return undefined;\n            }\n            var symbol = typeChecker.getSymbolAtLocation(node);\n            if (!symbol)\n                return undefined;\n            var typeAtLocation = typeChecker.getTypeOfSymbolAtLocation(symbol, node);\n            var returnType = tryGetReturnTypeOfFunction(symbol, typeAtLocation, typeChecker);\n            var fromReturnType = returnType && definitionFromType(returnType, typeChecker, node);\n            // If a function returns 'void' or some other type with no definition, just return the function definition.\n            return fromReturnType && fromReturnType.length !== 0 ? fromReturnType : definitionFromType(typeAtLocation, typeChecker, node);\n        }\n        GoToDefinition.getTypeDefinitionAtPosition = getTypeDefinitionAtPosition;\n        function definitionFromType(type, checker, node) {\n            return ts.flatMap(type.isUnion() && !(type.flags & 32 /* Enum */) ? type.types : [type], function (t) {\n                return t.symbol && getDefinitionFromSymbol(checker, t.symbol, node);\n            });\n        }\n        function tryGetReturnTypeOfFunction(symbol, type, checker) {\n            // If the type is just a function's inferred type,\n            // go-to-type should go to the return type instead, since go-to-definition takes you to the function anyway.\n            if (type.symbol === symbol ||\n                // At `const f = () => {}`, the symbol is `f` and the type symbol is at `() => {}`\n                symbol.valueDeclaration && type.symbol && ts.isVariableDeclaration(symbol.valueDeclaration) && symbol.valueDeclaration.initializer === type.symbol.valueDeclaration) {\n                var sigs = type.getCallSignatures();\n                if (sigs.length === 1)\n                    return checker.getReturnTypeOfSignature(ts.first(sigs));\n            }\n            return undefined;\n        }\n        function getDefinitionAndBoundSpan(program, sourceFile, position) {\n            var definitions = getDefinitionAtPosition(program, sourceFile, position);\n            if (!definitions || definitions.length === 0) {\n                return undefined;\n            }\n            // Check if position is on triple slash reference.\n            var comment = findReferenceInPosition(sourceFile.referencedFiles, position) ||\n                findReferenceInPosition(sourceFile.typeReferenceDirectives, position) ||\n                findReferenceInPosition(sourceFile.libReferenceDirectives, position);\n            if (comment) {\n                return { definitions: definitions, textSpan: ts.createTextSpanFromRange(comment) };\n            }\n            var node = ts.getTouchingPropertyName(sourceFile, position);\n            var textSpan = ts.createTextSpan(node.getStart(), node.getWidth());\n            return { definitions: definitions, textSpan: textSpan };\n        }\n        GoToDefinition.getDefinitionAndBoundSpan = getDefinitionAndBoundSpan;\n        // At 'x.foo', see if the type of 'x' has an index signature, and if so find its declarations.\n        function getDefinitionInfoForIndexSignatures(node, checker) {\n            if (!ts.isPropertyAccessExpression(node.parent) || node.parent.name !== node)\n                return;\n            var type = checker.getTypeAtLocation(node.parent.expression);\n            return ts.mapDefined(type.isUnionOrIntersection() ? type.types : [type], function (nonUnionType) {\n                var info = checker.getIndexInfoOfType(nonUnionType, 0 /* String */);\n                return info && info.declaration && createDefinitionFromSignatureDeclaration(checker, info.declaration);\n            });\n        }\n        function getSymbol(node, checker) {\n            var symbol = checker.getSymbolAtLocation(node);\n            // If this is an alias, and the request came at the declaration location\n            // get the aliased symbol instead. This allows for goto def on an import e.g.\n            //   import {A, B} from \"mod\";\n            // to jump to the implementation directly.\n            if (symbol && symbol.flags & 2097152 /* Alias */ && shouldSkipAlias(node, symbol.declarations[0])) {\n                var aliased = checker.getAliasedSymbol(symbol);\n                if (aliased.declarations) {\n                    return aliased;\n                }\n            }\n            return symbol;\n        }\n        // Go to the original declaration for cases:\n        //\n        //   (1) when the aliased symbol was declared in the location(parent).\n        //   (2) when the aliased symbol is originating from an import.\n        //\n        function shouldSkipAlias(node, declaration) {\n            if (node.kind !== 78 /* Identifier */) {\n                return false;\n            }\n            if (node.parent === declaration) {\n                return true;\n            }\n            switch (declaration.kind) {\n                case 262 /* ImportClause */:\n                case 260 /* ImportEqualsDeclaration */:\n                    return true;\n                case 265 /* ImportSpecifier */:\n                    return declaration.parent.kind === 264 /* NamedImports */;\n                case 198 /* BindingElement */:\n                case 249 /* VariableDeclaration */:\n                    return ts.isInJSFile(declaration) && ts.isRequireVariableDeclaration(declaration, /*requireStringLiteralLikeArgument*/ true);\n                default:\n                    return false;\n            }\n        }\n        function getDefinitionFromSymbol(typeChecker, symbol, node, declarationNode) {\n            // There are cases when you extend a function by adding properties to it afterwards,\n            // we want to strip those extra properties.\n            // For deduping purposes, we also want to exclude any declarationNodes if provided.\n            var filteredDeclarations = ts.filter(symbol.declarations, function (d) { return d !== declarationNode && (!ts.isAssignmentDeclaration(d) || d === symbol.valueDeclaration); })\n                || undefined;\n            return getConstructSignatureDefinition() || getCallSignatureDefinition() || ts.map(filteredDeclarations, function (declaration) { return createDefinitionInfo(declaration, typeChecker, symbol, node); });\n            function getConstructSignatureDefinition() {\n                // Applicable only if we are in a new expression, or we are on a constructor declaration\n                // and in either case the symbol has a construct signature definition, i.e. class\n                if (symbol.flags & 32 /* Class */ && !(symbol.flags & (16 /* Function */ | 3 /* Variable */)) && (ts.isNewExpressionTarget(node) || node.kind === 132 /* ConstructorKeyword */)) {\n                    var cls = ts.find(filteredDeclarations, ts.isClassLike) || ts.Debug.fail(\"Expected declaration to have at least one class-like declaration\");\n                    return getSignatureDefinition(cls.members, /*selectConstructors*/ true);\n                }\n            }\n            function getCallSignatureDefinition() {\n                return ts.isCallOrNewExpressionTarget(node) || ts.isNameOfFunctionDeclaration(node)\n                    ? getSignatureDefinition(filteredDeclarations, /*selectConstructors*/ false)\n                    : undefined;\n            }\n            function getSignatureDefinition(signatureDeclarations, selectConstructors) {\n                if (!signatureDeclarations) {\n                    return undefined;\n                }\n                var declarations = signatureDeclarations.filter(selectConstructors ? ts.isConstructorDeclaration : ts.isFunctionLike);\n                var declarationsWithBody = declarations.filter(function (d) { return !!d.body; });\n                // declarations defined on the global scope can be defined on multiple files. Get all of them.\n                return declarations.length\n                    ? declarationsWithBody.length !== 0\n                        ? declarationsWithBody.map(function (x) { return createDefinitionInfo(x, typeChecker, symbol, node); })\n                        : [createDefinitionInfo(ts.last(declarations), typeChecker, symbol, node)]\n                    : undefined;\n            }\n        }\n        /** Creates a DefinitionInfo from a Declaration, using the declaration's name if possible. */\n        function createDefinitionInfo(declaration, checker, symbol, node) {\n            var symbolName = checker.symbolToString(symbol); // Do not get scoped name, just the name of the symbol\n            var symbolKind = ts.SymbolDisplay.getSymbolKind(checker, symbol, node);\n            var containerName = symbol.parent ? checker.symbolToString(symbol.parent, node) : \"\";\n            return createDefinitionInfoFromName(checker, declaration, symbolKind, symbolName, containerName);\n        }\n        /** Creates a DefinitionInfo directly from the name of a declaration. */\n        function createDefinitionInfoFromName(checker, declaration, symbolKind, symbolName, containerName) {\n            var name = ts.getNameOfDeclaration(declaration) || declaration;\n            var sourceFile = name.getSourceFile();\n            var textSpan = ts.createTextSpanFromNode(name, sourceFile);\n            return __assign(__assign({ fileName: sourceFile.fileName, textSpan: textSpan, kind: symbolKind, name: symbolName, containerKind: undefined, // TODO: GH#18217\n                containerName: containerName }, ts.FindAllReferences.toContextSpan(textSpan, sourceFile, ts.FindAllReferences.getContextNode(declaration))), { isLocal: !checker.isDeclarationVisible(declaration) });\n        }\n        function createDefinitionFromSignatureDeclaration(typeChecker, decl) {\n            return createDefinitionInfo(decl, typeChecker, decl.symbol, decl);\n        }\n        function findReferenceInPosition(refs, pos) {\n            return ts.find(refs, function (ref) { return ts.textRangeContainsPositionInclusive(ref, pos); });\n        }\n        GoToDefinition.findReferenceInPosition = findReferenceInPosition;\n        function getDefinitionInfoForFileReference(name, targetFileName) {\n            return {\n                fileName: targetFileName,\n                textSpan: ts.createTextSpanFromBounds(0, 0),\n                kind: \"script\" /* scriptElement */,\n                name: name,\n                containerName: undefined,\n                containerKind: undefined, // TODO: GH#18217\n            };\n        }\n        /** Returns a CallLikeExpression where `node` is the target being invoked. */\n        function getAncestorCallLikeExpression(node) {\n            var target = ts.findAncestor(node, function (n) { return !ts.isRightSideOfPropertyAccess(n); });\n            var callLike = target === null || target === void 0 ? void 0 : target.parent;\n            return callLike && ts.isCallLikeExpression(callLike) && ts.getInvokedExpression(callLike) === target ? callLike : undefined;\n        }\n        function tryGetSignatureDeclaration(typeChecker, node) {\n            var callLike = getAncestorCallLikeExpression(node);\n            var signature = callLike && typeChecker.getResolvedSignature(callLike);\n            // Don't go to a function type, go to the value having that type.\n            return ts.tryCast(signature && signature.declaration, function (d) { return ts.isFunctionLike(d) && !ts.isFunctionTypeNode(d); });\n        }\n        function isConstructorLike(node) {\n            switch (node.kind) {\n                case 166 /* Constructor */:\n                case 175 /* ConstructorType */:\n                case 170 /* ConstructSignature */:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n    })(GoToDefinition = ts.GoToDefinition || (ts.GoToDefinition = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var JsDoc;\n    (function (JsDoc) {\n        var jsDocTagNames = [\n            \"abstract\",\n            \"access\",\n            \"alias\",\n            \"argument\",\n            \"async\",\n            \"augments\",\n            \"author\",\n            \"borrows\",\n            \"callback\",\n            \"class\",\n            \"classdesc\",\n            \"constant\",\n            \"constructor\",\n            \"constructs\",\n            \"copyright\",\n            \"default\",\n            \"deprecated\",\n            \"description\",\n            \"emits\",\n            \"enum\",\n            \"event\",\n            \"example\",\n            \"exports\",\n            \"extends\",\n            \"external\",\n            \"field\",\n            \"file\",\n            \"fileoverview\",\n            \"fires\",\n            \"function\",\n            \"generator\",\n            \"global\",\n            \"hideconstructor\",\n            \"host\",\n            \"ignore\",\n            \"implements\",\n            \"inheritdoc\",\n            \"inner\",\n            \"instance\",\n            \"interface\",\n            \"kind\",\n            \"lends\",\n            \"license\",\n            \"listens\",\n            \"member\",\n            \"memberof\",\n            \"method\",\n            \"mixes\",\n            \"module\",\n            \"name\",\n            \"namespace\",\n            \"override\",\n            \"package\",\n            \"param\",\n            \"private\",\n            \"property\",\n            \"protected\",\n            \"public\",\n            \"readonly\",\n            \"requires\",\n            \"returns\",\n            \"see\",\n            \"since\",\n            \"static\",\n            \"summary\",\n            \"template\",\n            \"this\",\n            \"throws\",\n            \"todo\",\n            \"tutorial\",\n            \"type\",\n            \"typedef\",\n            \"var\",\n            \"variation\",\n            \"version\",\n            \"virtual\",\n            \"yields\"\n        ];\n        var jsDocTagNameCompletionEntries;\n        var jsDocTagCompletionEntries;\n        function getJsDocCommentsFromDeclarations(declarations) {\n            // Only collect doc comments from duplicate declarations once:\n            // In case of a union property there might be same declaration multiple times\n            // which only varies in type parameter\n            // Eg. const a: Array<string> | Array<number>; a.length\n            // The property length will have two declarations of property length coming\n            // from Array<T> - Array<string> and Array<number>\n            var documentationComment = [];\n            ts.forEachUnique(declarations, function (declaration) {\n                for (var _i = 0, _a = getCommentHavingNodes(declaration); _i < _a.length; _i++) {\n                    var comment = _a[_i].comment;\n                    if (comment === undefined)\n                        continue;\n                    ts.pushIfUnique(documentationComment, comment);\n                }\n            });\n            return ts.intersperse(ts.map(documentationComment, ts.textPart), ts.lineBreakPart());\n        }\n        JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations;\n        function getCommentHavingNodes(declaration) {\n            switch (declaration.kind) {\n                case 326 /* JSDocParameterTag */:\n                case 333 /* JSDocPropertyTag */:\n                    return [declaration];\n                case 324 /* JSDocCallbackTag */:\n                case 331 /* JSDocTypedefTag */:\n                    return [declaration, declaration.parent];\n                default:\n                    return ts.getJSDocCommentsAndTags(declaration);\n            }\n        }\n        function getJsDocTagsFromDeclarations(declarations) {\n            // Only collect doc comments from duplicate declarations once.\n            var tags = [];\n            ts.forEachUnique(declarations, function (declaration) {\n                for (var _i = 0, _a = ts.getJSDocTags(declaration); _i < _a.length; _i++) {\n                    var tag = _a[_i];\n                    tags.push({ name: tag.tagName.text, text: getCommentText(tag) });\n                }\n            });\n            return tags;\n        }\n        JsDoc.getJsDocTagsFromDeclarations = getJsDocTagsFromDeclarations;\n        function getCommentText(tag) {\n            var comment = tag.comment;\n            switch (tag.kind) {\n                case 316 /* JSDocImplementsTag */:\n                    return withNode(tag.class);\n                case 315 /* JSDocAugmentsTag */:\n                    return withNode(tag.class);\n                case 330 /* JSDocTemplateTag */:\n                    return withList(tag.typeParameters);\n                case 329 /* JSDocTypeTag */:\n                    return withNode(tag.typeExpression);\n                case 331 /* JSDocTypedefTag */:\n                case 324 /* JSDocCallbackTag */:\n                case 333 /* JSDocPropertyTag */:\n                case 326 /* JSDocParameterTag */:\n                case 332 /* JSDocSeeTag */:\n                    var name = tag.name;\n                    return name ? withNode(name) : comment;\n                default:\n                    return comment;\n            }\n            function withNode(node) {\n                return addComment(node.getText());\n            }\n            function withList(list) {\n                return addComment(list.map(function (x) { return x.getText(); }).join(\", \"));\n            }\n            function addComment(s) {\n                return comment === undefined ? s : s + \" \" + comment;\n            }\n        }\n        function getJSDocTagNameCompletions() {\n            return jsDocTagNameCompletionEntries || (jsDocTagNameCompletionEntries = ts.map(jsDocTagNames, function (tagName) {\n                return {\n                    name: tagName,\n                    kind: \"keyword\" /* keyword */,\n                    kindModifiers: \"\",\n                    sortText: ts.Completions.SortText.LocationPriority,\n                };\n            }));\n        }\n        JsDoc.getJSDocTagNameCompletions = getJSDocTagNameCompletions;\n        JsDoc.getJSDocTagNameCompletionDetails = getJSDocTagCompletionDetails;\n        function getJSDocTagCompletions() {\n            return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = ts.map(jsDocTagNames, function (tagName) {\n                return {\n                    name: \"@\" + tagName,\n                    kind: \"keyword\" /* keyword */,\n                    kindModifiers: \"\",\n                    sortText: ts.Completions.SortText.LocationPriority\n                };\n            }));\n        }\n        JsDoc.getJSDocTagCompletions = getJSDocTagCompletions;\n        function getJSDocTagCompletionDetails(name) {\n            return {\n                name: name,\n                kind: \"\" /* unknown */,\n                kindModifiers: \"\",\n                displayParts: [ts.textPart(name)],\n                documentation: ts.emptyArray,\n                tags: undefined,\n                codeActions: undefined,\n            };\n        }\n        JsDoc.getJSDocTagCompletionDetails = getJSDocTagCompletionDetails;\n        function getJSDocParameterNameCompletions(tag) {\n            if (!ts.isIdentifier(tag.name)) {\n                return ts.emptyArray;\n            }\n            var nameThusFar = tag.name.text;\n            var jsdoc = tag.parent;\n            var fn = jsdoc.parent;\n            if (!ts.isFunctionLike(fn))\n                return [];\n            return ts.mapDefined(fn.parameters, function (param) {\n                if (!ts.isIdentifier(param.name))\n                    return undefined;\n                var name = param.name.text;\n                if (jsdoc.tags.some(function (t) { return t !== tag && ts.isJSDocParameterTag(t) && ts.isIdentifier(t.name) && t.name.escapedText === name; }) // TODO: GH#18217\n                    || nameThusFar !== undefined && !ts.startsWith(name, nameThusFar)) {\n                    return undefined;\n                }\n                return { name: name, kind: \"parameter\" /* parameterElement */, kindModifiers: \"\", sortText: ts.Completions.SortText.LocationPriority };\n            });\n        }\n        JsDoc.getJSDocParameterNameCompletions = getJSDocParameterNameCompletions;\n        function getJSDocParameterNameCompletionDetails(name) {\n            return {\n                name: name,\n                kind: \"parameter\" /* parameterElement */,\n                kindModifiers: \"\",\n                displayParts: [ts.textPart(name)],\n                documentation: ts.emptyArray,\n                tags: undefined,\n                codeActions: undefined,\n            };\n        }\n        JsDoc.getJSDocParameterNameCompletionDetails = getJSDocParameterNameCompletionDetails;\n        /**\n         * Checks if position points to a valid position to add JSDoc comments, and if so,\n         * returns the appropriate template. Otherwise returns an empty string.\n         * Valid positions are\n         *      - outside of comments, statements, and expressions, and\n         *      - preceding a:\n         *          - function/constructor/method declaration\n         *          - class declarations\n         *          - variable statements\n         *          - namespace declarations\n         *          - interface declarations\n         *          - method signatures\n         *          - type alias declarations\n         *\n         * Hosts should ideally check that:\n         * - The line is all whitespace up to 'position' before performing the insertion.\n         * - If the keystroke sequence \"/\\*\\*\" induced the call, we also check that the next\n         * non-whitespace character is '*', which (approximately) indicates whether we added\n         * the second '*' to complete an existing (JSDoc) comment.\n         * @param fileName The file in which to perform the check.\n         * @param position The (character-indexed) position in the file where the check should\n         * be performed.\n         */\n        function getDocCommentTemplateAtPosition(newLine, sourceFile, position, options) {\n            var tokenAtPos = ts.getTokenAtPosition(sourceFile, position);\n            var existingDocComment = ts.findAncestor(tokenAtPos, ts.isJSDoc);\n            if (existingDocComment && (existingDocComment.comment !== undefined || ts.length(existingDocComment.tags))) {\n                // Non-empty comment already exists.\n                return undefined;\n            }\n            var tokenStart = tokenAtPos.getStart(sourceFile);\n            // Don't provide a doc comment template based on a *previous* node. (But an existing empty jsdoc comment will likely start before `position`.)\n            if (!existingDocComment && tokenStart < position) {\n                return undefined;\n            }\n            var commentOwnerInfo = getCommentOwnerInfo(tokenAtPos, options);\n            if (!commentOwnerInfo) {\n                return undefined;\n            }\n            var commentOwner = commentOwnerInfo.commentOwner, parameters = commentOwnerInfo.parameters, hasReturn = commentOwnerInfo.hasReturn;\n            if (commentOwner.getStart(sourceFile) < position) {\n                return undefined;\n            }\n            var indentationStr = getIndentationStringAtPosition(sourceFile, position);\n            var isJavaScriptFile = ts.hasJSFileExtension(sourceFile.fileName);\n            var tags = (parameters ? parameterDocComments(parameters || [], isJavaScriptFile, indentationStr, newLine) : \"\") +\n                (hasReturn ? returnsDocComment(indentationStr, newLine) : \"\");\n            // A doc comment consists of the following\n            // * The opening comment line\n            // * the first line (without a param) for the object's untagged info (this is also where the caret ends up)\n            // * the '@param'-tagged lines\n            // * the '@returns'-tag\n            // * TODO: other tags.\n            // * the closing comment line\n            // * if the caret was directly in front of the object, then we add an extra line and indentation.\n            var openComment = \"/**\";\n            var closeComment = \" */\";\n            if (tags) {\n                var preamble = openComment + newLine + indentationStr + \" * \";\n                var endLine = tokenStart === position ? newLine + indentationStr : \"\";\n                var result = preamble + newLine + tags + indentationStr + closeComment + endLine;\n                return { newText: result, caretOffset: preamble.length };\n            }\n            return { newText: openComment + closeComment, caretOffset: 3 };\n        }\n        JsDoc.getDocCommentTemplateAtPosition = getDocCommentTemplateAtPosition;\n        function getIndentationStringAtPosition(sourceFile, position) {\n            var text = sourceFile.text;\n            var lineStart = ts.getLineStartPositionForPosition(position, sourceFile);\n            var pos = lineStart;\n            for (; pos <= position && ts.isWhiteSpaceSingleLine(text.charCodeAt(pos)); pos++)\n                ;\n            return text.slice(lineStart, pos);\n        }\n        function parameterDocComments(parameters, isJavaScriptFile, indentationStr, newLine) {\n            return parameters.map(function (_a, i) {\n                var name = _a.name, dotDotDotToken = _a.dotDotDotToken;\n                var paramName = name.kind === 78 /* Identifier */ ? name.text : \"param\" + i;\n                var type = isJavaScriptFile ? (dotDotDotToken ? \"{...any} \" : \"{any} \") : \"\";\n                return indentationStr + \" * @param \" + type + paramName + newLine;\n            }).join(\"\");\n        }\n        function returnsDocComment(indentationStr, newLine) {\n            return indentationStr + \" * @returns\" + newLine;\n        }\n        function getCommentOwnerInfo(tokenAtPos, options) {\n            return ts.forEachAncestor(tokenAtPos, function (n) { return getCommentOwnerInfoWorker(n, options); });\n        }\n        function getCommentOwnerInfoWorker(commentOwner, options) {\n            switch (commentOwner.kind) {\n                case 251 /* FunctionDeclaration */:\n                case 208 /* FunctionExpression */:\n                case 165 /* MethodDeclaration */:\n                case 166 /* Constructor */:\n                case 164 /* MethodSignature */:\n                case 209 /* ArrowFunction */:\n                    var host = commentOwner;\n                    return { commentOwner: commentOwner, parameters: host.parameters, hasReturn: hasReturn(host, options) };\n                case 288 /* PropertyAssignment */:\n                    return getCommentOwnerInfoWorker(commentOwner.initializer, options);\n                case 252 /* ClassDeclaration */:\n                case 253 /* InterfaceDeclaration */:\n                case 162 /* PropertySignature */:\n                case 255 /* EnumDeclaration */:\n                case 291 /* EnumMember */:\n                case 254 /* TypeAliasDeclaration */:\n                    return { commentOwner: commentOwner };\n                case 232 /* VariableStatement */: {\n                    var varStatement = commentOwner;\n                    var varDeclarations = varStatement.declarationList.declarations;\n                    var host_1 = varDeclarations.length === 1 && varDeclarations[0].initializer\n                        ? getRightHandSideOfAssignment(varDeclarations[0].initializer)\n                        : undefined;\n                    return host_1\n                        ? { commentOwner: commentOwner, parameters: host_1.parameters, hasReturn: hasReturn(host_1, options) }\n                        : { commentOwner: commentOwner };\n                }\n                case 297 /* SourceFile */:\n                    return \"quit\";\n                case 256 /* ModuleDeclaration */:\n                    // If in walking up the tree, we hit a a nested namespace declaration,\n                    // then we must be somewhere within a dotted namespace name; however we don't\n                    // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'.\n                    return commentOwner.parent.kind === 256 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner };\n                case 233 /* ExpressionStatement */:\n                    return getCommentOwnerInfoWorker(commentOwner.expression, options);\n                case 216 /* BinaryExpression */: {\n                    var be = commentOwner;\n                    if (ts.getAssignmentDeclarationKind(be) === 0 /* None */) {\n                        return \"quit\";\n                    }\n                    return ts.isFunctionLike(be.right)\n                        ? { commentOwner: commentOwner, parameters: be.right.parameters, hasReturn: hasReturn(be.right, options) }\n                        : { commentOwner: commentOwner };\n                }\n                case 163 /* PropertyDeclaration */:\n                    var init = commentOwner.initializer;\n                    if (init && (ts.isFunctionExpression(init) || ts.isArrowFunction(init))) {\n                        return { commentOwner: commentOwner, parameters: init.parameters, hasReturn: hasReturn(init, options) };\n                    }\n            }\n        }\n        function hasReturn(node, options) {\n            return !!(options === null || options === void 0 ? void 0 : options.generateReturnInDocTemplate) &&\n                (ts.isArrowFunction(node) && ts.isExpression(node.body)\n                    || ts.isFunctionLikeDeclaration(node) && node.body && ts.isBlock(node.body) && !!ts.forEachReturnStatement(node.body, function (n) { return n; }));\n        }\n        function getRightHandSideOfAssignment(rightHandSide) {\n            while (rightHandSide.kind === 207 /* ParenthesizedExpression */) {\n                rightHandSide = rightHandSide.expression;\n            }\n            switch (rightHandSide.kind) {\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                    return rightHandSide;\n                case 221 /* ClassExpression */:\n                    return ts.find(rightHandSide.members, ts.isConstructorDeclaration);\n            }\n        }\n    })(JsDoc = ts.JsDoc || (ts.JsDoc = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var NavigateTo;\n    (function (NavigateTo) {\n        function getNavigateToItems(sourceFiles, checker, cancellationToken, searchValue, maxResultCount, excludeDtsFiles) {\n            var patternMatcher = ts.createPatternMatcher(searchValue);\n            if (!patternMatcher)\n                return ts.emptyArray;\n            var rawItems = [];\n            var _loop_5 = function (sourceFile) {\n                cancellationToken.throwIfCancellationRequested();\n                if (excludeDtsFiles && sourceFile.isDeclarationFile) {\n                    return \"continue\";\n                }\n                sourceFile.getNamedDeclarations().forEach(function (declarations, name) {\n                    getItemsFromNamedDeclaration(patternMatcher, name, declarations, checker, sourceFile.fileName, rawItems);\n                });\n            };\n            // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[]\n            for (var _i = 0, sourceFiles_4 = sourceFiles; _i < sourceFiles_4.length; _i++) {\n                var sourceFile = sourceFiles_4[_i];\n                _loop_5(sourceFile);\n            }\n            rawItems.sort(compareNavigateToItems);\n            return (maxResultCount === undefined ? rawItems : rawItems.slice(0, maxResultCount)).map(createNavigateToItem);\n        }\n        NavigateTo.getNavigateToItems = getNavigateToItems;\n        function getItemsFromNamedDeclaration(patternMatcher, name, declarations, checker, fileName, rawItems) {\n            // First do a quick check to see if the name of the declaration matches the\n            // last portion of the (possibly) dotted name they're searching for.\n            var match = patternMatcher.getMatchForLastSegmentOfPattern(name);\n            if (!match) {\n                return; // continue to next named declarations\n            }\n            for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) {\n                var declaration = declarations_3[_i];\n                if (!shouldKeepItem(declaration, checker))\n                    continue;\n                if (patternMatcher.patternContainsDots) {\n                    // If the pattern has dots in it, then also see if the declaration container matches as well.\n                    var fullMatch = patternMatcher.getFullMatch(getContainers(declaration), name);\n                    if (fullMatch) {\n                        rawItems.push({ name: name, fileName: fileName, matchKind: fullMatch.kind, isCaseSensitive: fullMatch.isCaseSensitive, declaration: declaration });\n                    }\n                }\n                else {\n                    rawItems.push({ name: name, fileName: fileName, matchKind: match.kind, isCaseSensitive: match.isCaseSensitive, declaration: declaration });\n                }\n            }\n        }\n        function shouldKeepItem(declaration, checker) {\n            switch (declaration.kind) {\n                case 262 /* ImportClause */:\n                case 265 /* ImportSpecifier */:\n                case 260 /* ImportEqualsDeclaration */:\n                    var importer = checker.getSymbolAtLocation(declaration.name); // TODO: GH#18217\n                    var imported = checker.getAliasedSymbol(importer);\n                    return importer.escapedName !== imported.escapedName;\n                default:\n                    return true;\n            }\n        }\n        function tryAddSingleDeclarationName(declaration, containers) {\n            var name = ts.getNameOfDeclaration(declaration);\n            return !!name && (pushLiteral(name, containers) || name.kind === 158 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers));\n        }\n        // Only added the names of computed properties if they're simple dotted expressions, like:\n        //\n        //      [X.Y.Z]() { }\n        function tryAddComputedPropertyName(expression, containers) {\n            return pushLiteral(expression, containers)\n                || ts.isPropertyAccessExpression(expression) && (containers.push(expression.name.text), true) && tryAddComputedPropertyName(expression.expression, containers);\n        }\n        function pushLiteral(node, containers) {\n            return ts.isPropertyNameLiteral(node) && (containers.push(ts.getTextOfIdentifierOrLiteral(node)), true);\n        }\n        function getContainers(declaration) {\n            var containers = [];\n            // First, if we started with a computed property name, then add all but the last\n            // portion into the container array.\n            var name = ts.getNameOfDeclaration(declaration);\n            if (name && name.kind === 158 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) {\n                return ts.emptyArray;\n            }\n            // Don't include the last portion.\n            containers.shift();\n            // Now, walk up our containers, adding all their names to the container array.\n            var container = ts.getContainerNode(declaration);\n            while (container) {\n                if (!tryAddSingleDeclarationName(container, containers)) {\n                    return ts.emptyArray;\n                }\n                container = ts.getContainerNode(container);\n            }\n            return containers.reverse();\n        }\n        function compareNavigateToItems(i1, i2) {\n            // TODO(cyrusn): get the gamut of comparisons that VS already uses here.\n            return ts.compareValues(i1.matchKind, i2.matchKind)\n                || ts.compareStringsCaseSensitiveUI(i1.name, i2.name);\n        }\n        function createNavigateToItem(rawItem) {\n            var declaration = rawItem.declaration;\n            var container = ts.getContainerNode(declaration);\n            var containerName = container && ts.getNameOfDeclaration(container);\n            return {\n                name: rawItem.name,\n                kind: ts.getNodeKind(declaration),\n                kindModifiers: ts.getNodeModifiers(declaration),\n                matchKind: ts.PatternMatchKind[rawItem.matchKind],\n                isCaseSensitive: rawItem.isCaseSensitive,\n                fileName: rawItem.fileName,\n                textSpan: ts.createTextSpanFromNode(declaration),\n                // TODO(jfreeman): What should be the containerName when the container has a computed name?\n                containerName: containerName ? containerName.text : \"\",\n                containerKind: containerName ? ts.getNodeKind(container) : \"\" /* unknown */, // TODO: GH#18217 Just use `container ? ...`\n            };\n        }\n    })(NavigateTo = ts.NavigateTo || (ts.NavigateTo = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var NavigationBar;\n    (function (NavigationBar) {\n        var _a;\n        /**\n         * Matches all whitespace characters in a string. Eg:\n         *\n         * \"app.\n         *\n         * onactivated\"\n         *\n         * matches because of the newline, whereas\n         *\n         * \"app.onactivated\"\n         *\n         * does not match.\n         */\n        var whiteSpaceRegex = /\\s+/g;\n        /**\n         * Maximum amount of characters to return\n         * The amount was chosen arbitrarily.\n         */\n        var maxLength = 150;\n        // Keep sourceFile handy so we don't have to search for it every time we need to call `getText`.\n        var curCancellationToken;\n        var curSourceFile;\n        /**\n         * For performance, we keep navigation bar parents on a stack rather than passing them through each recursion.\n         * `parent` is the current parent and is *not* stored in parentsStack.\n         * `startNode` sets a new parent and `endNode` returns to the previous parent.\n         */\n        var parentsStack = [];\n        var parent;\n        var trackedEs5ClassesStack = [];\n        var trackedEs5Classes;\n        // NavigationBarItem requires an array, but will not mutate it, so just give it this for performance.\n        var emptyChildItemArray = [];\n        function getNavigationBarItems(sourceFile, cancellationToken) {\n            curCancellationToken = cancellationToken;\n            curSourceFile = sourceFile;\n            try {\n                return ts.map(primaryNavBarMenuItems(rootNavigationBarNode(sourceFile)), convertToPrimaryNavBarMenuItem);\n            }\n            finally {\n                reset();\n            }\n        }\n        NavigationBar.getNavigationBarItems = getNavigationBarItems;\n        function getNavigationTree(sourceFile, cancellationToken) {\n            curCancellationToken = cancellationToken;\n            curSourceFile = sourceFile;\n            try {\n                return convertToTree(rootNavigationBarNode(sourceFile));\n            }\n            finally {\n                reset();\n            }\n        }\n        NavigationBar.getNavigationTree = getNavigationTree;\n        function reset() {\n            curSourceFile = undefined;\n            curCancellationToken = undefined;\n            parentsStack = [];\n            parent = undefined;\n            emptyChildItemArray = [];\n        }\n        function nodeText(node) {\n            return cleanText(node.getText(curSourceFile));\n        }\n        function navigationBarNodeKind(n) {\n            return n.node.kind;\n        }\n        function pushChild(parent, child) {\n            if (parent.children) {\n                parent.children.push(child);\n            }\n            else {\n                parent.children = [child];\n            }\n        }\n        function rootNavigationBarNode(sourceFile) {\n            ts.Debug.assert(!parentsStack.length);\n            var root = { node: sourceFile, name: undefined, additionalNodes: undefined, parent: undefined, children: undefined, indent: 0 };\n            parent = root;\n            for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {\n                var statement = _a[_i];\n                addChildrenRecursively(statement);\n            }\n            endNode();\n            ts.Debug.assert(!parent && !parentsStack.length);\n            return root;\n        }\n        function addLeafNode(node, name) {\n            pushChild(parent, emptyNavigationBarNode(node, name));\n        }\n        function emptyNavigationBarNode(node, name) {\n            return {\n                node: node,\n                name: name || (ts.isDeclaration(node) || ts.isExpression(node) ? ts.getNameOfDeclaration(node) : undefined),\n                additionalNodes: undefined,\n                parent: parent,\n                children: undefined,\n                indent: parent.indent + 1\n            };\n        }\n        function addTrackedEs5Class(name) {\n            if (!trackedEs5Classes) {\n                trackedEs5Classes = new ts.Map();\n            }\n            trackedEs5Classes.set(name, true);\n        }\n        function endNestedNodes(depth) {\n            for (var i = 0; i < depth; i++)\n                endNode();\n        }\n        function startNestedNodes(targetNode, entityName) {\n            var names = [];\n            while (!ts.isPropertyNameLiteral(entityName)) {\n                var name = ts.getNameOrArgument(entityName);\n                var nameText = ts.getElementOrPropertyAccessName(entityName);\n                entityName = entityName.expression;\n                if (nameText === \"prototype\" || ts.isPrivateIdentifier(name))\n                    continue;\n                names.push(name);\n            }\n            names.push(entityName);\n            for (var i = names.length - 1; i > 0; i--) {\n                var name = names[i];\n                startNode(targetNode, name);\n            }\n            return [names.length - 1, names[0]];\n        }\n        /**\n         * Add a new level of NavigationBarNodes.\n         * This pushes to the stack, so you must call `endNode` when you are done adding to this node.\n         */\n        function startNode(node, name) {\n            var navNode = emptyNavigationBarNode(node, name);\n            pushChild(parent, navNode);\n            // Save the old parent\n            parentsStack.push(parent);\n            trackedEs5ClassesStack.push(trackedEs5Classes);\n            trackedEs5Classes = undefined;\n            parent = navNode;\n        }\n        /** Call after calling `startNode` and adding children to it. */\n        function endNode() {\n            if (parent.children) {\n                mergeChildren(parent.children, parent);\n                sortChildren(parent.children);\n            }\n            parent = parentsStack.pop();\n            trackedEs5Classes = trackedEs5ClassesStack.pop();\n        }\n        function addNodeWithRecursiveChild(node, child, name) {\n            startNode(node, name);\n            addChildrenRecursively(child);\n            endNode();\n        }\n        function addNodeWithRecursiveInitializer(node) {\n            if (node.initializer && isFunctionOrClassExpression(node.initializer)) {\n                startNode(node);\n                ts.forEachChild(node.initializer, addChildrenRecursively);\n                endNode();\n            }\n            else {\n                addNodeWithRecursiveChild(node, node.initializer);\n            }\n        }\n        /** Look for navigation bar items in node's subtree, adding them to the current `parent`. */\n        function addChildrenRecursively(node) {\n            var _a;\n            curCancellationToken.throwIfCancellationRequested();\n            if (!node || ts.isToken(node)) {\n                return;\n            }\n            switch (node.kind) {\n                case 166 /* Constructor */:\n                    // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it.\n                    var ctr = node;\n                    addNodeWithRecursiveChild(ctr, ctr.body);\n                    // Parameter properties are children of the class, not the constructor.\n                    for (var _i = 0, _b = ctr.parameters; _i < _b.length; _i++) {\n                        var param = _b[_i];\n                        if (ts.isParameterPropertyDeclaration(param, ctr)) {\n                            addLeafNode(param);\n                        }\n                    }\n                    break;\n                case 165 /* MethodDeclaration */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                case 164 /* MethodSignature */:\n                    if (!ts.hasDynamicName(node)) {\n                        addNodeWithRecursiveChild(node, node.body);\n                    }\n                    break;\n                case 163 /* PropertyDeclaration */:\n                    if (!ts.hasDynamicName(node)) {\n                        addNodeWithRecursiveInitializer(node);\n                    }\n                    break;\n                case 162 /* PropertySignature */:\n                    if (!ts.hasDynamicName(node)) {\n                        addLeafNode(node);\n                    }\n                    break;\n                case 262 /* ImportClause */:\n                    var importClause = node;\n                    // Handle default import case e.g.:\n                    //    import d from \"mod\";\n                    if (importClause.name) {\n                        addLeafNode(importClause.name);\n                    }\n                    // Handle named bindings in imports e.g.:\n                    //    import * as NS from \"mod\";\n                    //    import {a, b as B} from \"mod\";\n                    var namedBindings = importClause.namedBindings;\n                    if (namedBindings) {\n                        if (namedBindings.kind === 263 /* NamespaceImport */) {\n                            addLeafNode(namedBindings);\n                        }\n                        else {\n                            for (var _c = 0, _d = namedBindings.elements; _c < _d.length; _c++) {\n                                var element = _d[_c];\n                                addLeafNode(element);\n                            }\n                        }\n                    }\n                    break;\n                case 289 /* ShorthandPropertyAssignment */:\n                    addNodeWithRecursiveChild(node, node.name);\n                    break;\n                case 290 /* SpreadAssignment */:\n                    var expression = node.expression;\n                    // Use the expression as the name of the SpreadAssignment, otherwise show as <unknown>.\n                    ts.isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node);\n                    break;\n                case 198 /* BindingElement */:\n                case 288 /* PropertyAssignment */:\n                case 249 /* VariableDeclaration */: {\n                    var child = node;\n                    if (ts.isBindingPattern(child.name)) {\n                        addChildrenRecursively(child.name);\n                    }\n                    else {\n                        addNodeWithRecursiveInitializer(child);\n                    }\n                    break;\n                }\n                case 251 /* FunctionDeclaration */:\n                    var nameNode = node.name;\n                    // If we see a function declaration track as a possible ES5 class\n                    if (nameNode && ts.isIdentifier(nameNode)) {\n                        addTrackedEs5Class(nameNode.text);\n                    }\n                    addNodeWithRecursiveChild(node, node.body);\n                    break;\n                case 209 /* ArrowFunction */:\n                case 208 /* FunctionExpression */:\n                    addNodeWithRecursiveChild(node, node.body);\n                    break;\n                case 255 /* EnumDeclaration */:\n                    startNode(node);\n                    for (var _e = 0, _f = node.members; _e < _f.length; _e++) {\n                        var member = _f[_e];\n                        if (!isComputedProperty(member)) {\n                            addLeafNode(member);\n                        }\n                    }\n                    endNode();\n                    break;\n                case 252 /* ClassDeclaration */:\n                case 221 /* ClassExpression */:\n                case 253 /* InterfaceDeclaration */:\n                    startNode(node);\n                    for (var _g = 0, _h = node.members; _g < _h.length; _g++) {\n                        var member = _h[_g];\n                        addChildrenRecursively(member);\n                    }\n                    endNode();\n                    break;\n                case 256 /* ModuleDeclaration */:\n                    addNodeWithRecursiveChild(node, getInteriorModule(node).body);\n                    break;\n                case 266 /* ExportAssignment */: {\n                    var expression_1 = node.expression;\n                    var child = ts.isObjectLiteralExpression(expression_1) || ts.isCallExpression(expression_1) ? expression_1 :\n                        ts.isArrowFunction(expression_1) || ts.isFunctionExpression(expression_1) ? expression_1.body : undefined;\n                    if (child) {\n                        startNode(node);\n                        addChildrenRecursively(child);\n                        endNode();\n                    }\n                    else {\n                        addLeafNode(node);\n                    }\n                    break;\n                }\n                case 270 /* ExportSpecifier */:\n                case 260 /* ImportEqualsDeclaration */:\n                case 171 /* IndexSignature */:\n                case 169 /* CallSignature */:\n                case 170 /* ConstructSignature */:\n                case 254 /* TypeAliasDeclaration */:\n                    addLeafNode(node);\n                    break;\n                case 203 /* CallExpression */:\n                case 216 /* BinaryExpression */: {\n                    var special = ts.getAssignmentDeclarationKind(node);\n                    switch (special) {\n                        case 1 /* ExportsProperty */:\n                        case 2 /* ModuleExports */:\n                            addNodeWithRecursiveChild(node, node.right);\n                            return;\n                        case 6 /* Prototype */:\n                        case 3 /* PrototypeProperty */: {\n                            var binaryExpression = node;\n                            var assignmentTarget = binaryExpression.left;\n                            var prototypeAccess = special === 3 /* PrototypeProperty */ ?\n                                assignmentTarget.expression :\n                                assignmentTarget;\n                            var depth = 0;\n                            var className = void 0;\n                            // If we see a prototype assignment, start tracking the target as a class\n                            // This is only done for simple classes not nested assignments.\n                            if (ts.isIdentifier(prototypeAccess.expression)) {\n                                addTrackedEs5Class(prototypeAccess.expression.text);\n                                className = prototypeAccess.expression;\n                            }\n                            else {\n                                _a = startNestedNodes(binaryExpression, prototypeAccess.expression), depth = _a[0], className = _a[1];\n                            }\n                            if (special === 6 /* Prototype */) {\n                                if (ts.isObjectLiteralExpression(binaryExpression.right)) {\n                                    if (binaryExpression.right.properties.length > 0) {\n                                        startNode(binaryExpression, className);\n                                        ts.forEachChild(binaryExpression.right, addChildrenRecursively);\n                                        endNode();\n                                    }\n                                }\n                            }\n                            else if (ts.isFunctionExpression(binaryExpression.right) || ts.isArrowFunction(binaryExpression.right)) {\n                                addNodeWithRecursiveChild(node, binaryExpression.right, className);\n                            }\n                            else {\n                                startNode(binaryExpression, className);\n                                addNodeWithRecursiveChild(node, binaryExpression.right, assignmentTarget.name);\n                                endNode();\n                            }\n                            endNestedNodes(depth);\n                            return;\n                        }\n                        case 7 /* ObjectDefinePropertyValue */:\n                        case 9 /* ObjectDefinePrototypeProperty */: {\n                            var defineCall = node;\n                            var className = special === 7 /* ObjectDefinePropertyValue */ ?\n                                defineCall.arguments[0] :\n                                defineCall.arguments[0].expression;\n                            var memberName = defineCall.arguments[1];\n                            var _j = startNestedNodes(node, className), depth = _j[0], classNameIdentifier = _j[1];\n                            startNode(node, classNameIdentifier);\n                            startNode(node, ts.setTextRange(ts.factory.createIdentifier(memberName.text), memberName));\n                            addChildrenRecursively(node.arguments[2]);\n                            endNode();\n                            endNode();\n                            endNestedNodes(depth);\n                            return;\n                        }\n                        case 5 /* Property */: {\n                            var binaryExpression = node;\n                            var assignmentTarget = binaryExpression.left;\n                            var targetFunction = assignmentTarget.expression;\n                            if (ts.isIdentifier(targetFunction) && ts.getElementOrPropertyAccessName(assignmentTarget) !== \"prototype\" &&\n                                trackedEs5Classes && trackedEs5Classes.has(targetFunction.text)) {\n                                if (ts.isFunctionExpression(binaryExpression.right) || ts.isArrowFunction(binaryExpression.right)) {\n                                    addNodeWithRecursiveChild(node, binaryExpression.right, targetFunction);\n                                }\n                                else if (ts.isBindableStaticAccessExpression(assignmentTarget)) {\n                                    startNode(binaryExpression, targetFunction);\n                                    addNodeWithRecursiveChild(binaryExpression.left, binaryExpression.right, ts.getNameOrArgument(assignmentTarget));\n                                    endNode();\n                                }\n                                return;\n                            }\n                            break;\n                        }\n                        case 4 /* ThisProperty */:\n                        case 0 /* None */:\n                        case 8 /* ObjectDefinePropertyExports */:\n                            break;\n                        default:\n                            ts.Debug.assertNever(special);\n                    }\n                }\n                // falls through\n                default:\n                    if (ts.hasJSDocNodes(node)) {\n                        ts.forEach(node.jsDoc, function (jsDoc) {\n                            ts.forEach(jsDoc.tags, function (tag) {\n                                if (ts.isJSDocTypeAlias(tag)) {\n                                    addLeafNode(tag);\n                                }\n                            });\n                        });\n                    }\n                    ts.forEachChild(node, addChildrenRecursively);\n            }\n        }\n        /** Merge declarations of the same kind. */\n        function mergeChildren(children, node) {\n            var nameToItems = new ts.Map();\n            ts.filterMutate(children, function (child, index) {\n                var declName = child.name || ts.getNameOfDeclaration(child.node);\n                var name = declName && nodeText(declName);\n                if (!name) {\n                    // Anonymous items are never merged.\n                    return true;\n                }\n                var itemsWithSameName = nameToItems.get(name);\n                if (!itemsWithSameName) {\n                    nameToItems.set(name, child);\n                    return true;\n                }\n                if (itemsWithSameName instanceof Array) {\n                    for (var _i = 0, itemsWithSameName_1 = itemsWithSameName; _i < itemsWithSameName_1.length; _i++) {\n                        var itemWithSameName = itemsWithSameName_1[_i];\n                        if (tryMerge(itemWithSameName, child, index, node)) {\n                            return false;\n                        }\n                    }\n                    itemsWithSameName.push(child);\n                    return true;\n                }\n                else {\n                    var itemWithSameName = itemsWithSameName;\n                    if (tryMerge(itemWithSameName, child, index, node)) {\n                        return false;\n                    }\n                    nameToItems.set(name, [itemWithSameName, child]);\n                    return true;\n                }\n            });\n        }\n        var isEs5ClassMember = (_a = {},\n            _a[5 /* Property */] = true,\n            _a[3 /* PrototypeProperty */] = true,\n            _a[7 /* ObjectDefinePropertyValue */] = true,\n            _a[9 /* ObjectDefinePrototypeProperty */] = true,\n            _a[0 /* None */] = false,\n            _a[1 /* ExportsProperty */] = false,\n            _a[2 /* ModuleExports */] = false,\n            _a[8 /* ObjectDefinePropertyExports */] = false,\n            _a[6 /* Prototype */] = true,\n            _a[4 /* ThisProperty */] = false,\n            _a);\n        function tryMergeEs5Class(a, b, bIndex, parent) {\n            function isPossibleConstructor(node) {\n                return ts.isFunctionExpression(node) || ts.isFunctionDeclaration(node) || ts.isVariableDeclaration(node);\n            }\n            var bAssignmentDeclarationKind = ts.isBinaryExpression(b.node) || ts.isCallExpression(b.node) ?\n                ts.getAssignmentDeclarationKind(b.node) :\n                0 /* None */;\n            var aAssignmentDeclarationKind = ts.isBinaryExpression(a.node) || ts.isCallExpression(a.node) ?\n                ts.getAssignmentDeclarationKind(a.node) :\n                0 /* None */;\n            // We treat this as an es5 class and merge the nodes in in one of several cases\n            if ((isEs5ClassMember[bAssignmentDeclarationKind] && isEs5ClassMember[aAssignmentDeclarationKind]) // merge two class elements\n                || (isPossibleConstructor(a.node) && isEs5ClassMember[bAssignmentDeclarationKind]) // ctor function & member\n                || (isPossibleConstructor(b.node) && isEs5ClassMember[aAssignmentDeclarationKind]) // member & ctor function\n                || (ts.isClassDeclaration(a.node) && isSynthesized(a.node) && isEs5ClassMember[bAssignmentDeclarationKind]) // class (generated) & member\n                || (ts.isClassDeclaration(b.node) && isEs5ClassMember[aAssignmentDeclarationKind]) // member & class (generated)\n                || (ts.isClassDeclaration(a.node) && isSynthesized(a.node) && isPossibleConstructor(b.node)) // class (generated) & ctor\n                || (ts.isClassDeclaration(b.node) && isPossibleConstructor(a.node) && isSynthesized(a.node)) // ctor & class (generated)\n            ) {\n                var lastANode = a.additionalNodes && ts.lastOrUndefined(a.additionalNodes) || a.node;\n                if ((!ts.isClassDeclaration(a.node) && !ts.isClassDeclaration(b.node)) // If neither outline node is a class\n                    || isPossibleConstructor(a.node) || isPossibleConstructor(b.node) // If either function is a constructor function\n                ) {\n                    var ctorFunction = isPossibleConstructor(a.node) ? a.node :\n                        isPossibleConstructor(b.node) ? b.node :\n                            undefined;\n                    if (ctorFunction !== undefined) {\n                        var ctorNode = ts.setTextRange(ts.factory.createConstructorDeclaration(/* decorators */ undefined, /* modifiers */ undefined, [], /* body */ undefined), ctorFunction);\n                        var ctor = emptyNavigationBarNode(ctorNode);\n                        ctor.indent = a.indent + 1;\n                        ctor.children = a.node === ctorFunction ? a.children : b.children;\n                        a.children = a.node === ctorFunction ? ts.concatenate([ctor], b.children || [b]) : ts.concatenate(a.children || [__assign({}, a)], [ctor]);\n                    }\n                    else {\n                        if (a.children || b.children) {\n                            a.children = ts.concatenate(a.children || [__assign({}, a)], b.children || [b]);\n                            if (a.children) {\n                                mergeChildren(a.children, a);\n                                sortChildren(a.children);\n                            }\n                        }\n                    }\n                    lastANode = a.node = ts.setTextRange(ts.factory.createClassDeclaration(\n                    /* decorators */ undefined, \n                    /* modifiers */ undefined, a.name || ts.factory.createIdentifier(\"__class__\"), \n                    /* typeParameters */ undefined, \n                    /* heritageClauses */ undefined, []), a.node);\n                }\n                else {\n                    a.children = ts.concatenate(a.children, b.children);\n                    if (a.children) {\n                        mergeChildren(a.children, a);\n                    }\n                }\n                var bNode = b.node;\n                // We merge if the outline node previous to b (bIndex - 1) is already part of the current class\n                // We do this so that statements between class members that do not generate outline nodes do not split up the class outline:\n                // Ex This should produce one outline node C:\n                //    function C() {}; a = 1; C.prototype.m = function () {}\n                // Ex This will produce 3 outline nodes: C, a, C\n                //    function C() {}; let a = 1; C.prototype.m = function () {}\n                if (parent.children[bIndex - 1].node.end === lastANode.end) {\n                    ts.setTextRange(lastANode, { pos: lastANode.pos, end: bNode.end });\n                }\n                else {\n                    if (!a.additionalNodes)\n                        a.additionalNodes = [];\n                    a.additionalNodes.push(ts.setTextRange(ts.factory.createClassDeclaration(\n                    /* decorators */ undefined, \n                    /* modifiers */ undefined, a.name || ts.factory.createIdentifier(\"__class__\"), \n                    /* typeParameters */ undefined, \n                    /* heritageClauses */ undefined, []), b.node));\n                }\n                return true;\n            }\n            return bAssignmentDeclarationKind === 0 /* None */ ? false : true;\n        }\n        function tryMerge(a, b, bIndex, parent) {\n            // const v = false as boolean;\n            if (tryMergeEs5Class(a, b, bIndex, parent)) {\n                return true;\n            }\n            if (shouldReallyMerge(a.node, b.node, parent)) {\n                merge(a, b);\n                return true;\n            }\n            return false;\n        }\n        /** a and b have the same name, but they may not be mergeable. */\n        function shouldReallyMerge(a, b, parent) {\n            if (a.kind !== b.kind || a.parent !== b.parent && !(isOwnChild(a, parent) && isOwnChild(b, parent))) {\n                return false;\n            }\n            switch (a.kind) {\n                case 163 /* PropertyDeclaration */:\n                case 165 /* MethodDeclaration */:\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                    return ts.hasSyntacticModifier(a, 32 /* Static */) === ts.hasSyntacticModifier(b, 32 /* Static */);\n                case 256 /* ModuleDeclaration */:\n                    return areSameModule(a, b);\n                default:\n                    return true;\n            }\n        }\n        function isSynthesized(node) {\n            return !!(node.flags & 8 /* Synthesized */);\n        }\n        // We want to merge own children like `I` in in `module A { interface I {} } module A { interface I {} }`\n        // We don't want to merge unrelated children like `m` in `const o = { a: { m() {} }, b: { m() {} } };`\n        function isOwnChild(n, parent) {\n            var par = ts.isModuleBlock(n.parent) ? n.parent.parent : n.parent;\n            return par === parent.node || ts.contains(parent.additionalNodes, par);\n        }\n        // We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes.\n        // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'!\n        function areSameModule(a, b) {\n            // TODO: GH#18217\n            return a.body.kind === b.body.kind && (a.body.kind !== 256 /* ModuleDeclaration */ || areSameModule(a.body, b.body));\n        }\n        /** Merge source into target. Source should be thrown away after this is called. */\n        function merge(target, source) {\n            var _a;\n            target.additionalNodes = target.additionalNodes || [];\n            target.additionalNodes.push(source.node);\n            if (source.additionalNodes) {\n                (_a = target.additionalNodes).push.apply(_a, source.additionalNodes);\n            }\n            target.children = ts.concatenate(target.children, source.children);\n            if (target.children) {\n                mergeChildren(target.children, target);\n                sortChildren(target.children);\n            }\n        }\n        /** Recursively ensure that each NavNode's children are in sorted order. */\n        function sortChildren(children) {\n            children.sort(compareChildren);\n        }\n        function compareChildren(child1, child2) {\n            return ts.compareStringsCaseSensitiveUI(tryGetName(child1.node), tryGetName(child2.node)) // TODO: GH#18217\n                || ts.compareValues(navigationBarNodeKind(child1), navigationBarNodeKind(child2));\n        }\n        /**\n         * This differs from getItemName because this is just used for sorting.\n         * We only sort nodes by name that have a more-or-less \"direct\" name, as opposed to `new()` and the like.\n         * So `new()` can still come before an `aardvark` method.\n         */\n        function tryGetName(node) {\n            if (node.kind === 256 /* ModuleDeclaration */) {\n                return getModuleName(node);\n            }\n            var declName = ts.getNameOfDeclaration(node);\n            if (declName && ts.isPropertyName(declName)) {\n                var propertyName = ts.getPropertyNameForPropertyNameNode(declName);\n                return propertyName && ts.unescapeLeadingUnderscores(propertyName);\n            }\n            switch (node.kind) {\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                case 221 /* ClassExpression */:\n                    return getFunctionOrClassName(node);\n                default:\n                    return undefined;\n            }\n        }\n        function getItemName(node, name) {\n            if (node.kind === 256 /* ModuleDeclaration */) {\n                return cleanText(getModuleName(node));\n            }\n            if (name) {\n                var text = ts.isIdentifier(name) ? name.text\n                    : ts.isElementAccessExpression(name) ? \"[\" + nodeText(name.argumentExpression) + \"]\"\n                        : nodeText(name);\n                if (text.length > 0) {\n                    return cleanText(text);\n                }\n            }\n            switch (node.kind) {\n                case 297 /* SourceFile */:\n                    var sourceFile = node;\n                    return ts.isExternalModule(sourceFile)\n                        ? \"\\\"\" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + \"\\\"\"\n                        : \"<global>\";\n                case 266 /* ExportAssignment */:\n                    return ts.isExportAssignment(node) && node.isExportEquals ? \"export=\" /* ExportEquals */ : \"default\" /* Default */;\n                case 209 /* ArrowFunction */:\n                case 251 /* FunctionDeclaration */:\n                case 208 /* FunctionExpression */:\n                case 252 /* ClassDeclaration */:\n                case 221 /* ClassExpression */:\n                    if (ts.getSyntacticModifierFlags(node) & 512 /* Default */) {\n                        return \"default\";\n                    }\n                    // We may get a string with newlines or other whitespace in the case of an object dereference\n                    // (eg: \"app\\n.onactivated\"), so we should remove the whitespace for readability in the\n                    // navigation bar.\n                    return getFunctionOrClassName(node);\n                case 166 /* Constructor */:\n                    return \"constructor\";\n                case 170 /* ConstructSignature */:\n                    return \"new()\";\n                case 169 /* CallSignature */:\n                    return \"()\";\n                case 171 /* IndexSignature */:\n                    return \"[]\";\n                default:\n                    return \"<unknown>\";\n            }\n        }\n        /** Flattens the NavNode tree to a list of items to appear in the primary navbar menu. */\n        function primaryNavBarMenuItems(root) {\n            // The primary (middle) navbar menu displays the general code navigation hierarchy, similar to the navtree.\n            // The secondary (right) navbar menu displays the child items of whichever primary item is selected.\n            // Some less interesting items without their own child navigation items (e.g. a local variable declaration) only show up in the secondary menu.\n            var primaryNavBarMenuItems = [];\n            function recur(item) {\n                if (shouldAppearInPrimaryNavBarMenu(item)) {\n                    primaryNavBarMenuItems.push(item);\n                    if (item.children) {\n                        for (var _i = 0, _a = item.children; _i < _a.length; _i++) {\n                            var child = _a[_i];\n                            recur(child);\n                        }\n                    }\n                }\n            }\n            recur(root);\n            return primaryNavBarMenuItems;\n            /** Determines if a node should appear in the primary navbar menu. */\n            function shouldAppearInPrimaryNavBarMenu(item) {\n                // Items with children should always appear in the primary navbar menu.\n                if (item.children) {\n                    return true;\n                }\n                // Some nodes are otherwise important enough to always include in the primary navigation menu.\n                switch (navigationBarNodeKind(item)) {\n                    case 252 /* ClassDeclaration */:\n                    case 221 /* ClassExpression */:\n                    case 255 /* EnumDeclaration */:\n                    case 253 /* InterfaceDeclaration */:\n                    case 256 /* ModuleDeclaration */:\n                    case 297 /* SourceFile */:\n                    case 254 /* TypeAliasDeclaration */:\n                    case 331 /* JSDocTypedefTag */:\n                    case 324 /* JSDocCallbackTag */:\n                        return true;\n                    case 209 /* ArrowFunction */:\n                    case 251 /* FunctionDeclaration */:\n                    case 208 /* FunctionExpression */:\n                        return isTopLevelFunctionDeclaration(item);\n                    default:\n                        return false;\n                }\n                function isTopLevelFunctionDeclaration(item) {\n                    if (!item.node.body) {\n                        return false;\n                    }\n                    switch (navigationBarNodeKind(item.parent)) {\n                        case 257 /* ModuleBlock */:\n                        case 297 /* SourceFile */:\n                        case 165 /* MethodDeclaration */:\n                        case 166 /* Constructor */:\n                            return true;\n                        default:\n                            return false;\n                    }\n                }\n            }\n        }\n        function convertToTree(n) {\n            return {\n                text: getItemName(n.node, n.name),\n                kind: ts.getNodeKind(n.node),\n                kindModifiers: getModifiers(n.node),\n                spans: getSpans(n),\n                nameSpan: n.name && getNodeSpan(n.name),\n                childItems: ts.map(n.children, convertToTree)\n            };\n        }\n        function convertToPrimaryNavBarMenuItem(n) {\n            return {\n                text: getItemName(n.node, n.name),\n                kind: ts.getNodeKind(n.node),\n                kindModifiers: getModifiers(n.node),\n                spans: getSpans(n),\n                childItems: ts.map(n.children, convertToSecondaryNavBarMenuItem) || emptyChildItemArray,\n                indent: n.indent,\n                bolded: false,\n                grayed: false\n            };\n            function convertToSecondaryNavBarMenuItem(n) {\n                return {\n                    text: getItemName(n.node, n.name),\n                    kind: ts.getNodeKind(n.node),\n                    kindModifiers: ts.getNodeModifiers(n.node),\n                    spans: getSpans(n),\n                    childItems: emptyChildItemArray,\n                    indent: 0,\n                    bolded: false,\n                    grayed: false\n                };\n            }\n        }\n        function getSpans(n) {\n            var spans = [getNodeSpan(n.node)];\n            if (n.additionalNodes) {\n                for (var _i = 0, _a = n.additionalNodes; _i < _a.length; _i++) {\n                    var node = _a[_i];\n                    spans.push(getNodeSpan(node));\n                }\n            }\n            return spans;\n        }\n        function getModuleName(moduleDeclaration) {\n            // We want to maintain quotation marks.\n            if (ts.isAmbientModule(moduleDeclaration)) {\n                return ts.getTextOfNode(moduleDeclaration.name);\n            }\n            // Otherwise, we need to aggregate each identifier to build up the qualified name.\n            var result = [ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)];\n            while (moduleDeclaration.body && moduleDeclaration.body.kind === 256 /* ModuleDeclaration */) {\n                moduleDeclaration = moduleDeclaration.body;\n                result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name));\n            }\n            return result.join(\".\");\n        }\n        /**\n         * For 'module A.B.C', we want to get the node for 'C'.\n         * We store 'A' as associated with a NavNode, and use getModuleName to traverse down again.\n         */\n        function getInteriorModule(decl) {\n            return decl.body && ts.isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl;\n        }\n        function isComputedProperty(member) {\n            return !member.name || member.name.kind === 158 /* ComputedPropertyName */;\n        }\n        function getNodeSpan(node) {\n            return node.kind === 297 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile);\n        }\n        function getModifiers(node) {\n            if (node.parent && node.parent.kind === 249 /* VariableDeclaration */) {\n                node = node.parent;\n            }\n            return ts.getNodeModifiers(node);\n        }\n        function getFunctionOrClassName(node) {\n            var parent = node.parent;\n            if (node.name && ts.getFullWidth(node.name) > 0) {\n                return cleanText(ts.declarationNameToString(node.name));\n            }\n            // See if it is a var initializer. If so, use the var name.\n            else if (ts.isVariableDeclaration(parent)) {\n                return cleanText(ts.declarationNameToString(parent.name));\n            }\n            // See if it is of the form \"<expr> = function(){...}\". If so, use the text from the left-hand side.\n            else if (ts.isBinaryExpression(parent) && parent.operatorToken.kind === 62 /* EqualsToken */) {\n                return nodeText(parent.left).replace(whiteSpaceRegex, \"\");\n            }\n            // See if it is a property assignment, and if so use the property name\n            else if (ts.isPropertyAssignment(parent)) {\n                return nodeText(parent.name);\n            }\n            // Default exports are named \"default\"\n            else if (ts.getSyntacticModifierFlags(node) & 512 /* Default */) {\n                return \"default\";\n            }\n            else if (ts.isClassLike(node)) {\n                return \"<class>\";\n            }\n            else if (ts.isCallExpression(parent)) {\n                var name = getCalledExpressionName(parent.expression);\n                if (name !== undefined) {\n                    name = cleanText(name);\n                    if (name.length > maxLength) {\n                        return name + \" callback\";\n                    }\n                    var args = cleanText(ts.mapDefined(parent.arguments, function (a) { return ts.isStringLiteralLike(a) ? a.getText(curSourceFile) : undefined; }).join(\", \"));\n                    return name + \"(\" + args + \") callback\";\n                }\n            }\n            return \"<function>\";\n        }\n        // See also 'tryGetPropertyAccessOrIdentifierToString'\n        function getCalledExpressionName(expr) {\n            if (ts.isIdentifier(expr)) {\n                return expr.text;\n            }\n            else if (ts.isPropertyAccessExpression(expr)) {\n                var left = getCalledExpressionName(expr.expression);\n                var right = expr.name.text;\n                return left === undefined ? right : left + \".\" + right;\n            }\n            else {\n                return undefined;\n            }\n        }\n        function isFunctionOrClassExpression(node) {\n            switch (node.kind) {\n                case 209 /* ArrowFunction */:\n                case 208 /* FunctionExpression */:\n                case 221 /* ClassExpression */:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n        function cleanText(text) {\n            // Truncate to maximum amount of characters as we don't want to do a big replace operation.\n            text = text.length > maxLength ? text.substring(0, maxLength) + \"...\" : text;\n            // Replaces ECMAScript line terminators and removes the trailing `\\` from each line:\n            // \\n - Line Feed\n            // \\r - Carriage Return\n            // \\u2028 - Line separator\n            // \\u2029 - Paragraph separator\n            return text.replace(/\\\\?(\\r?\\n|\\r|\\u2028|\\u2029)/g, \"\");\n        }\n    })(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var OrganizeImports;\n    (function (OrganizeImports) {\n        /**\n         * Organize imports by:\n         *   1) Removing unused imports\n         *   2) Coalescing imports from the same module\n         *   3) Sorting imports\n         */\n        function organizeImports(sourceFile, formatContext, host, program, preferences) {\n            var changeTracker = ts.textChanges.ChangeTracker.fromContext({ host: host, formatContext: formatContext, preferences: preferences });\n            var coalesceAndOrganizeImports = function (importGroup) { return ts.stableSort(coalesceImports(removeUnusedImports(importGroup, sourceFile, program)), function (s1, s2) { return compareImportsOrRequireStatements(s1, s2); }); };\n            // All of the old ImportDeclarations in the file, in syntactic order.\n            var topLevelImportDecls = sourceFile.statements.filter(ts.isImportDeclaration);\n            organizeImportsWorker(topLevelImportDecls, coalesceAndOrganizeImports);\n            // All of the old ExportDeclarations in the file, in syntactic order.\n            var topLevelExportDecls = sourceFile.statements.filter(ts.isExportDeclaration);\n            organizeImportsWorker(topLevelExportDecls, coalesceExports);\n            for (var _i = 0, _a = sourceFile.statements.filter(ts.isAmbientModule); _i < _a.length; _i++) {\n                var ambientModule = _a[_i];\n                if (!ambientModule.body) {\n                    continue;\n                }\n                var ambientModuleImportDecls = ambientModule.body.statements.filter(ts.isImportDeclaration);\n                organizeImportsWorker(ambientModuleImportDecls, coalesceAndOrganizeImports);\n                var ambientModuleExportDecls = ambientModule.body.statements.filter(ts.isExportDeclaration);\n                organizeImportsWorker(ambientModuleExportDecls, coalesceExports);\n            }\n            return changeTracker.getChanges();\n            function organizeImportsWorker(oldImportDecls, coalesce) {\n                if (ts.length(oldImportDecls) === 0) {\n                    return;\n                }\n                // Special case: normally, we'd expect leading and trailing trivia to follow each import\n                // around as it's sorted.  However, we do not want this to happen for leading trivia\n                // on the first import because it is probably the header comment for the file.\n                // Consider: we could do a more careful check that this trivia is actually a header,\n                // but the consequences of being wrong are very minor.\n                ts.suppressLeadingTrivia(oldImportDecls[0]);\n                var oldImportGroups = ts.group(oldImportDecls, function (importDecl) { return getExternalModuleName(importDecl.moduleSpecifier); });\n                var sortedImportGroups = ts.stableSort(oldImportGroups, function (group1, group2) { return compareModuleSpecifiers(group1[0].moduleSpecifier, group2[0].moduleSpecifier); });\n                var newImportDecls = ts.flatMap(sortedImportGroups, function (importGroup) {\n                    return getExternalModuleName(importGroup[0].moduleSpecifier)\n                        ? coalesce(importGroup)\n                        : importGroup;\n                });\n                // Delete or replace the first import.\n                if (newImportDecls.length === 0) {\n                    changeTracker.delete(sourceFile, oldImportDecls[0]);\n                }\n                else {\n                    // Note: Delete the surrounding trivia because it will have been retained in newImportDecls.\n                    changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, {\n                        leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude,\n                        trailingTriviaOption: ts.textChanges.TrailingTriviaOption.Include,\n                        suffix: ts.getNewLineOrDefaultFromHost(host, formatContext.options),\n                    });\n                }\n                // Delete any subsequent imports.\n                for (var i = 1; i < oldImportDecls.length; i++) {\n                    changeTracker.deleteNode(sourceFile, oldImportDecls[i]);\n                }\n            }\n        }\n        OrganizeImports.organizeImports = organizeImports;\n        function removeUnusedImports(oldImports, sourceFile, program) {\n            var typeChecker = program.getTypeChecker();\n            var jsxNamespace = typeChecker.getJsxNamespace(sourceFile);\n            var jsxFragmentFactory = typeChecker.getJsxFragmentFactory(sourceFile);\n            var jsxElementsPresent = !!(sourceFile.transformFlags & 2 /* ContainsJsx */);\n            var usedImports = [];\n            for (var _i = 0, oldImports_1 = oldImports; _i < oldImports_1.length; _i++) {\n                var importDecl = oldImports_1[_i];\n                var importClause = importDecl.importClause, moduleSpecifier = importDecl.moduleSpecifier;\n                if (!importClause) {\n                    // Imports without import clauses are assumed to be included for their side effects and are not removed.\n                    usedImports.push(importDecl);\n                    continue;\n                }\n                var name = importClause.name, namedBindings = importClause.namedBindings;\n                // Default import\n                if (name && !isDeclarationUsed(name)) {\n                    name = undefined;\n                }\n                if (namedBindings) {\n                    if (ts.isNamespaceImport(namedBindings)) {\n                        // Namespace import\n                        if (!isDeclarationUsed(namedBindings.name)) {\n                            namedBindings = undefined;\n                        }\n                    }\n                    else {\n                        // List of named imports\n                        var newElements = namedBindings.elements.filter(function (e) { return isDeclarationUsed(e.name); });\n                        if (newElements.length < namedBindings.elements.length) {\n                            namedBindings = newElements.length\n                                ? ts.factory.updateNamedImports(namedBindings, newElements)\n                                : undefined;\n                        }\n                    }\n                }\n                if (name || namedBindings) {\n                    usedImports.push(updateImportDeclarationAndClause(importDecl, name, namedBindings));\n                }\n                // If a module is imported to be augmented, it’s used\n                else if (hasModuleDeclarationMatchingSpecifier(sourceFile, moduleSpecifier)) {\n                    // If we’re in a declaration file, it’s safe to remove the import clause from it\n                    if (sourceFile.isDeclarationFile) {\n                        usedImports.push(ts.factory.createImportDeclaration(importDecl.decorators, importDecl.modifiers, \n                        /*importClause*/ undefined, moduleSpecifier));\n                    }\n                    // If we’re not in a declaration file, we can’t remove the import clause even though\n                    // the imported symbols are unused, because removing them makes it look like the import\n                    // declaration has side effects, which will cause it to be preserved in the JS emit.\n                    else {\n                        usedImports.push(importDecl);\n                    }\n                }\n            }\n            return usedImports;\n            function isDeclarationUsed(identifier) {\n                // The JSX factory symbol is always used if JSX elements are present - even if they are not allowed.\n                return jsxElementsPresent && (identifier.text === jsxNamespace || jsxFragmentFactory && identifier.text === jsxFragmentFactory) ||\n                    ts.FindAllReferences.Core.isSymbolReferencedInFile(identifier, typeChecker, sourceFile);\n            }\n        }\n        function hasModuleDeclarationMatchingSpecifier(sourceFile, moduleSpecifier) {\n            var moduleSpecifierText = ts.isStringLiteral(moduleSpecifier) && moduleSpecifier.text;\n            return ts.isString(moduleSpecifierText) && ts.some(sourceFile.moduleAugmentations, function (moduleName) {\n                return ts.isStringLiteral(moduleName)\n                    && moduleName.text === moduleSpecifierText;\n            });\n        }\n        function getExternalModuleName(specifier) {\n            return specifier !== undefined && ts.isStringLiteralLike(specifier)\n                ? specifier.text\n                : undefined;\n        }\n        // Internal for testing\n        /**\n         * @param importGroup a list of ImportDeclarations, all with the same module name.\n         */\n        function coalesceImports(importGroup) {\n            var _a;\n            if (importGroup.length === 0) {\n                return importGroup;\n            }\n            var _b = getCategorizedImports(importGroup), importWithoutClause = _b.importWithoutClause, typeOnlyImports = _b.typeOnlyImports, regularImports = _b.regularImports;\n            var coalescedImports = [];\n            if (importWithoutClause) {\n                coalescedImports.push(importWithoutClause);\n            }\n            for (var _i = 0, _c = [regularImports, typeOnlyImports]; _i < _c.length; _i++) {\n                var group_2 = _c[_i];\n                var isTypeOnly = group_2 === typeOnlyImports;\n                var defaultImports = group_2.defaultImports, namespaceImports = group_2.namespaceImports, namedImports = group_2.namedImports;\n                // Normally, we don't combine default and namespace imports, but it would be silly to\n                // produce two import declarations in this special case.\n                if (!isTypeOnly && defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) {\n                    // Add the namespace import to the existing default ImportDeclaration.\n                    var defaultImport = defaultImports[0];\n                    coalescedImports.push(updateImportDeclarationAndClause(defaultImport, defaultImport.importClause.name, namespaceImports[0].importClause.namedBindings)); // TODO: GH#18217\n                    continue;\n                }\n                var sortedNamespaceImports = ts.stableSort(namespaceImports, function (i1, i2) {\n                    return compareIdentifiers(i1.importClause.namedBindings.name, i2.importClause.namedBindings.name);\n                }); // TODO: GH#18217\n                for (var _d = 0, sortedNamespaceImports_1 = sortedNamespaceImports; _d < sortedNamespaceImports_1.length; _d++) {\n                    var namespaceImport = sortedNamespaceImports_1[_d];\n                    // Drop the name, if any\n                    coalescedImports.push(updateImportDeclarationAndClause(namespaceImport, /*name*/ undefined, namespaceImport.importClause.namedBindings)); // TODO: GH#18217\n                }\n                if (defaultImports.length === 0 && namedImports.length === 0) {\n                    continue;\n                }\n                var newDefaultImport = void 0;\n                var newImportSpecifiers = [];\n                if (defaultImports.length === 1) {\n                    newDefaultImport = defaultImports[0].importClause.name;\n                }\n                else {\n                    for (var _e = 0, defaultImports_1 = defaultImports; _e < defaultImports_1.length; _e++) {\n                        var defaultImport = defaultImports_1[_e];\n                        newImportSpecifiers.push(ts.factory.createImportSpecifier(ts.factory.createIdentifier(\"default\"), defaultImport.importClause.name)); // TODO: GH#18217\n                    }\n                }\n                newImportSpecifiers.push.apply(newImportSpecifiers, ts.flatMap(namedImports, function (i) { return i.importClause.namedBindings.elements; })); // TODO: GH#18217\n                var sortedImportSpecifiers = sortSpecifiers(newImportSpecifiers);\n                var importDecl = defaultImports.length > 0\n                    ? defaultImports[0]\n                    : namedImports[0];\n                var newNamedImports = sortedImportSpecifiers.length === 0\n                    ? newDefaultImport\n                        ? undefined\n                        : ts.factory.createNamedImports(ts.emptyArray)\n                    : namedImports.length === 0\n                        ? ts.factory.createNamedImports(sortedImportSpecifiers)\n                        : ts.factory.updateNamedImports(namedImports[0].importClause.namedBindings, sortedImportSpecifiers); // TODO: GH#18217\n                // Type-only imports are not allowed to mix default, namespace, and named imports in any combination.\n                // We could rewrite a default import as a named import (`import { default as name }`), but we currently\n                // choose not to as a stylistic preference.\n                if (isTypeOnly && newDefaultImport && newNamedImports) {\n                    coalescedImports.push(updateImportDeclarationAndClause(importDecl, newDefaultImport, /*namedBindings*/ undefined));\n                    coalescedImports.push(updateImportDeclarationAndClause((_a = namedImports[0]) !== null && _a !== void 0 ? _a : importDecl, /*name*/ undefined, newNamedImports));\n                }\n                else {\n                    coalescedImports.push(updateImportDeclarationAndClause(importDecl, newDefaultImport, newNamedImports));\n                }\n            }\n            return coalescedImports;\n        }\n        OrganizeImports.coalesceImports = coalesceImports;\n        /*\n         * Returns entire import declarations because they may already have been rewritten and\n         * may lack parent pointers.  The desired parts can easily be recovered based on the\n         * categorization.\n         *\n         * NB: There may be overlap between `defaultImports` and `namespaceImports`/`namedImports`.\n         */\n        function getCategorizedImports(importGroup) {\n            var importWithoutClause;\n            var typeOnlyImports = { defaultImports: [], namespaceImports: [], namedImports: [] };\n            var regularImports = { defaultImports: [], namespaceImports: [], namedImports: [] };\n            for (var _i = 0, importGroup_1 = importGroup; _i < importGroup_1.length; _i++) {\n                var importDeclaration = importGroup_1[_i];\n                if (importDeclaration.importClause === undefined) {\n                    // Only the first such import is interesting - the others are redundant.\n                    // Note: Unfortunately, we will lose trivia that was on this node.\n                    importWithoutClause = importWithoutClause || importDeclaration;\n                    continue;\n                }\n                var group_3 = importDeclaration.importClause.isTypeOnly ? typeOnlyImports : regularImports;\n                var _a = importDeclaration.importClause, name = _a.name, namedBindings = _a.namedBindings;\n                if (name) {\n                    group_3.defaultImports.push(importDeclaration);\n                }\n                if (namedBindings) {\n                    if (ts.isNamespaceImport(namedBindings)) {\n                        group_3.namespaceImports.push(importDeclaration);\n                    }\n                    else {\n                        group_3.namedImports.push(importDeclaration);\n                    }\n                }\n            }\n            return {\n                importWithoutClause: importWithoutClause,\n                typeOnlyImports: typeOnlyImports,\n                regularImports: regularImports,\n            };\n        }\n        // Internal for testing\n        /**\n         * @param exportGroup a list of ExportDeclarations, all with the same module name.\n         */\n        function coalesceExports(exportGroup) {\n            if (exportGroup.length === 0) {\n                return exportGroup;\n            }\n            var _a = getCategorizedExports(exportGroup), exportWithoutClause = _a.exportWithoutClause, namedExports = _a.namedExports, typeOnlyExports = _a.typeOnlyExports;\n            var coalescedExports = [];\n            if (exportWithoutClause) {\n                coalescedExports.push(exportWithoutClause);\n            }\n            for (var _i = 0, _b = [namedExports, typeOnlyExports]; _i < _b.length; _i++) {\n                var exportGroup_1 = _b[_i];\n                if (exportGroup_1.length === 0) {\n                    continue;\n                }\n                var newExportSpecifiers = [];\n                newExportSpecifiers.push.apply(newExportSpecifiers, ts.flatMap(exportGroup_1, function (i) { return i.exportClause && ts.isNamedExports(i.exportClause) ? i.exportClause.elements : ts.emptyArray; }));\n                var sortedExportSpecifiers = sortSpecifiers(newExportSpecifiers);\n                var exportDecl = exportGroup_1[0];\n                coalescedExports.push(ts.factory.updateExportDeclaration(exportDecl, exportDecl.decorators, exportDecl.modifiers, exportDecl.isTypeOnly, exportDecl.exportClause && (ts.isNamedExports(exportDecl.exportClause) ?\n                    ts.factory.updateNamedExports(exportDecl.exportClause, sortedExportSpecifiers) :\n                    ts.factory.updateNamespaceExport(exportDecl.exportClause, exportDecl.exportClause.name)), exportDecl.moduleSpecifier));\n            }\n            return coalescedExports;\n            /*\n             * Returns entire export declarations because they may already have been rewritten and\n             * may lack parent pointers.  The desired parts can easily be recovered based on the\n             * categorization.\n             */\n            function getCategorizedExports(exportGroup) {\n                var exportWithoutClause;\n                var namedExports = [];\n                var typeOnlyExports = [];\n                for (var _i = 0, exportGroup_2 = exportGroup; _i < exportGroup_2.length; _i++) {\n                    var exportDeclaration = exportGroup_2[_i];\n                    if (exportDeclaration.exportClause === undefined) {\n                        // Only the first such export is interesting - the others are redundant.\n                        // Note: Unfortunately, we will lose trivia that was on this node.\n                        exportWithoutClause = exportWithoutClause || exportDeclaration;\n                    }\n                    else if (exportDeclaration.isTypeOnly) {\n                        typeOnlyExports.push(exportDeclaration);\n                    }\n                    else {\n                        namedExports.push(exportDeclaration);\n                    }\n                }\n                return {\n                    exportWithoutClause: exportWithoutClause,\n                    namedExports: namedExports,\n                    typeOnlyExports: typeOnlyExports,\n                };\n            }\n        }\n        OrganizeImports.coalesceExports = coalesceExports;\n        function updateImportDeclarationAndClause(importDeclaration, name, namedBindings) {\n            return ts.factory.updateImportDeclaration(importDeclaration, importDeclaration.decorators, importDeclaration.modifiers, ts.factory.updateImportClause(importDeclaration.importClause, importDeclaration.importClause.isTypeOnly, name, namedBindings), // TODO: GH#18217\n            importDeclaration.moduleSpecifier);\n        }\n        function sortSpecifiers(specifiers) {\n            return ts.stableSort(specifiers, compareImportOrExportSpecifiers);\n        }\n        function compareImportOrExportSpecifiers(s1, s2) {\n            return compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name)\n                || compareIdentifiers(s1.name, s2.name);\n        }\n        OrganizeImports.compareImportOrExportSpecifiers = compareImportOrExportSpecifiers;\n        /* internal */ // Exported for testing\n        function compareModuleSpecifiers(m1, m2) {\n            var name1 = m1 === undefined ? undefined : getExternalModuleName(m1);\n            var name2 = m2 === undefined ? undefined : getExternalModuleName(m2);\n            return ts.compareBooleans(name1 === undefined, name2 === undefined) ||\n                ts.compareBooleans(ts.isExternalModuleNameRelative(name1), ts.isExternalModuleNameRelative(name2)) ||\n                ts.compareStringsCaseInsensitive(name1, name2);\n        }\n        OrganizeImports.compareModuleSpecifiers = compareModuleSpecifiers;\n        function compareIdentifiers(s1, s2) {\n            return ts.compareStringsCaseInsensitive(s1.text, s2.text);\n        }\n        function getModuleSpecifierExpression(declaration) {\n            var _a;\n            switch (declaration.kind) {\n                case 260 /* ImportEqualsDeclaration */:\n                    return (_a = ts.tryCast(declaration.moduleReference, ts.isExternalModuleReference)) === null || _a === void 0 ? void 0 : _a.expression;\n                case 261 /* ImportDeclaration */:\n                    return declaration.moduleSpecifier;\n                case 232 /* VariableStatement */:\n                    return declaration.declarationList.declarations[0].initializer.arguments[0];\n            }\n        }\n        function importsAreSorted(imports) {\n            return ts.arrayIsSorted(imports, compareImportsOrRequireStatements);\n        }\n        OrganizeImports.importsAreSorted = importsAreSorted;\n        function importSpecifiersAreSorted(imports) {\n            return ts.arrayIsSorted(imports, compareImportOrExportSpecifiers);\n        }\n        OrganizeImports.importSpecifiersAreSorted = importSpecifiersAreSorted;\n        function getImportDeclarationInsertionIndex(sortedImports, newImport) {\n            var index = ts.binarySearch(sortedImports, newImport, ts.identity, compareImportsOrRequireStatements);\n            return index < 0 ? ~index : index;\n        }\n        OrganizeImports.getImportDeclarationInsertionIndex = getImportDeclarationInsertionIndex;\n        function getImportSpecifierInsertionIndex(sortedImports, newImport) {\n            var index = ts.binarySearch(sortedImports, newImport, ts.identity, compareImportOrExportSpecifiers);\n            return index < 0 ? ~index : index;\n        }\n        OrganizeImports.getImportSpecifierInsertionIndex = getImportSpecifierInsertionIndex;\n        function compareImportsOrRequireStatements(s1, s2) {\n            return compareModuleSpecifiers(getModuleSpecifierExpression(s1), getModuleSpecifierExpression(s2)) || compareImportKind(s1, s2);\n        }\n        OrganizeImports.compareImportsOrRequireStatements = compareImportsOrRequireStatements;\n        function compareImportKind(s1, s2) {\n            return ts.compareValues(getImportKindOrder(s1), getImportKindOrder(s2));\n        }\n        // 1. Side-effect imports\n        // 2. Type-only imports\n        // 3. Namespace imports\n        // 4. Default imports\n        // 5. Named imports\n        // 6. ImportEqualsDeclarations\n        // 7. Require variable statements\n        function getImportKindOrder(s1) {\n            var _a;\n            switch (s1.kind) {\n                case 261 /* ImportDeclaration */:\n                    if (!s1.importClause)\n                        return 0;\n                    if (s1.importClause.isTypeOnly)\n                        return 1;\n                    if (((_a = s1.importClause.namedBindings) === null || _a === void 0 ? void 0 : _a.kind) === 263 /* NamespaceImport */)\n                        return 2;\n                    if (s1.importClause.name)\n                        return 3;\n                    return 4;\n                case 260 /* ImportEqualsDeclaration */:\n                    return 5;\n                case 232 /* VariableStatement */:\n                    return 6;\n            }\n        }\n    })(OrganizeImports = ts.OrganizeImports || (ts.OrganizeImports = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var OutliningElementsCollector;\n    (function (OutliningElementsCollector) {\n        function collectElements(sourceFile, cancellationToken) {\n            var res = [];\n            addNodeOutliningSpans(sourceFile, cancellationToken, res);\n            addRegionOutliningSpans(sourceFile, res);\n            return res.sort(function (span1, span2) { return span1.textSpan.start - span2.textSpan.start; });\n        }\n        OutliningElementsCollector.collectElements = collectElements;\n        function addNodeOutliningSpans(sourceFile, cancellationToken, out) {\n            var depthRemaining = 40;\n            var current = 0;\n            // Includes the EOF Token so that comments which aren't attached to statements are included\n            var statements = __spreadArray(__spreadArray([], sourceFile.statements), [sourceFile.endOfFileToken]);\n            var n = statements.length;\n            while (current < n) {\n                while (current < n && !ts.isAnyImportSyntax(statements[current])) {\n                    visitNonImportNode(statements[current]);\n                    current++;\n                }\n                if (current === n)\n                    break;\n                var firstImport = current;\n                while (current < n && ts.isAnyImportSyntax(statements[current])) {\n                    addOutliningForLeadingCommentsForNode(statements[current], sourceFile, cancellationToken, out);\n                    current++;\n                }\n                var lastImport = current - 1;\n                if (lastImport !== firstImport) {\n                    out.push(createOutliningSpanFromBounds(ts.findChildOfKind(statements[firstImport], 99 /* ImportKeyword */, sourceFile).getStart(sourceFile), statements[lastImport].getEnd(), \"imports\" /* Imports */));\n                }\n            }\n            function visitNonImportNode(n) {\n                var _a;\n                if (depthRemaining === 0)\n                    return;\n                cancellationToken.throwIfCancellationRequested();\n                if (ts.isDeclaration(n) || ts.isVariableStatement(n) || n.kind === 1 /* EndOfFileToken */) {\n                    addOutliningForLeadingCommentsForNode(n, sourceFile, cancellationToken, out);\n                }\n                if (ts.isFunctionLike(n) && ts.isBinaryExpression(n.parent) && ts.isPropertyAccessExpression(n.parent.left)) {\n                    addOutliningForLeadingCommentsForNode(n.parent.left, sourceFile, cancellationToken, out);\n                }\n                var span = getOutliningSpanForNode(n, sourceFile);\n                if (span)\n                    out.push(span);\n                depthRemaining--;\n                if (ts.isCallExpression(n)) {\n                    depthRemaining++;\n                    visitNonImportNode(n.expression);\n                    depthRemaining--;\n                    n.arguments.forEach(visitNonImportNode);\n                    (_a = n.typeArguments) === null || _a === void 0 ? void 0 : _a.forEach(visitNonImportNode);\n                }\n                else if (ts.isIfStatement(n) && n.elseStatement && ts.isIfStatement(n.elseStatement)) {\n                    // Consider an 'else if' to be on the same depth as the 'if'.\n                    visitNonImportNode(n.expression);\n                    visitNonImportNode(n.thenStatement);\n                    depthRemaining++;\n                    visitNonImportNode(n.elseStatement);\n                    depthRemaining--;\n                }\n                else {\n                    n.forEachChild(visitNonImportNode);\n                }\n                depthRemaining++;\n            }\n        }\n        function addRegionOutliningSpans(sourceFile, out) {\n            var regions = [];\n            var lineStarts = sourceFile.getLineStarts();\n            for (var _i = 0, lineStarts_1 = lineStarts; _i < lineStarts_1.length; _i++) {\n                var currentLineStart = lineStarts_1[_i];\n                var lineEnd = sourceFile.getLineEndOfPosition(currentLineStart);\n                var lineText = sourceFile.text.substring(currentLineStart, lineEnd);\n                var result = isRegionDelimiter(lineText);\n                if (!result || ts.isInComment(sourceFile, currentLineStart)) {\n                    continue;\n                }\n                if (!result[1]) {\n                    var span = ts.createTextSpanFromBounds(sourceFile.text.indexOf(\"//\", currentLineStart), lineEnd);\n                    regions.push(createOutliningSpan(span, \"region\" /* Region */, span, /*autoCollapse*/ false, result[2] || \"#region\"));\n                }\n                else {\n                    var region = regions.pop();\n                    if (region) {\n                        region.textSpan.length = lineEnd - region.textSpan.start;\n                        region.hintSpan.length = lineEnd - region.textSpan.start;\n                        out.push(region);\n                    }\n                }\n            }\n        }\n        var regionDelimiterRegExp = /^\\s*\\/\\/\\s*#(end)?region(?:\\s+(.*))?(?:\\r)?$/;\n        function isRegionDelimiter(lineText) {\n            return regionDelimiterRegExp.exec(lineText);\n        }\n        function addOutliningForLeadingCommentsForNode(n, sourceFile, cancellationToken, out) {\n            var comments = ts.getLeadingCommentRangesOfNode(n, sourceFile);\n            if (!comments)\n                return;\n            var firstSingleLineCommentStart = -1;\n            var lastSingleLineCommentEnd = -1;\n            var singleLineCommentCount = 0;\n            var sourceText = sourceFile.getFullText();\n            for (var _i = 0, comments_1 = comments; _i < comments_1.length; _i++) {\n                var _a = comments_1[_i], kind = _a.kind, pos = _a.pos, end = _a.end;\n                cancellationToken.throwIfCancellationRequested();\n                switch (kind) {\n                    case 2 /* SingleLineCommentTrivia */:\n                        // never fold region delimiters into single-line comment regions\n                        var commentText = sourceText.slice(pos, end);\n                        if (isRegionDelimiter(commentText)) {\n                            combineAndAddMultipleSingleLineComments();\n                            singleLineCommentCount = 0;\n                            break;\n                        }\n                        // For single line comments, combine consecutive ones (2 or more) into\n                        // a single span from the start of the first till the end of the last\n                        if (singleLineCommentCount === 0) {\n                            firstSingleLineCommentStart = pos;\n                        }\n                        lastSingleLineCommentEnd = end;\n                        singleLineCommentCount++;\n                        break;\n                    case 3 /* MultiLineCommentTrivia */:\n                        combineAndAddMultipleSingleLineComments();\n                        out.push(createOutliningSpanFromBounds(pos, end, \"comment\" /* Comment */));\n                        singleLineCommentCount = 0;\n                        break;\n                    default:\n                        ts.Debug.assertNever(kind);\n                }\n            }\n            combineAndAddMultipleSingleLineComments();\n            function combineAndAddMultipleSingleLineComments() {\n                // Only outline spans of two or more consecutive single line comments\n                if (singleLineCommentCount > 1) {\n                    out.push(createOutliningSpanFromBounds(firstSingleLineCommentStart, lastSingleLineCommentEnd, \"comment\" /* Comment */));\n                }\n            }\n        }\n        function createOutliningSpanFromBounds(pos, end, kind) {\n            return createOutliningSpan(ts.createTextSpanFromBounds(pos, end), kind);\n        }\n        function getOutliningSpanForNode(n, sourceFile) {\n            switch (n.kind) {\n                case 230 /* Block */:\n                    if (ts.isFunctionLike(n.parent)) {\n                        return functionSpan(n.parent, n, sourceFile);\n                    }\n                    // Check if the block is standalone, or 'attached' to some parent statement.\n                    // If the latter, we want to collapse the block, but consider its hint span\n                    // to be the entire span of the parent.\n                    switch (n.parent.kind) {\n                        case 235 /* DoStatement */:\n                        case 238 /* ForInStatement */:\n                        case 239 /* ForOfStatement */:\n                        case 237 /* ForStatement */:\n                        case 234 /* IfStatement */:\n                        case 236 /* WhileStatement */:\n                        case 243 /* WithStatement */:\n                        case 287 /* CatchClause */:\n                            return spanForNode(n.parent);\n                        case 247 /* TryStatement */:\n                            // Could be the try-block, or the finally-block.\n                            var tryStatement = n.parent;\n                            if (tryStatement.tryBlock === n) {\n                                return spanForNode(n.parent);\n                            }\n                            else if (tryStatement.finallyBlock === n) {\n                                var node = ts.findChildOfKind(tryStatement, 95 /* FinallyKeyword */, sourceFile);\n                                if (node)\n                                    return spanForNode(node);\n                            }\n                        // falls through\n                        default:\n                            // Block was a standalone block.  In this case we want to only collapse\n                            // the span of the block, independent of any parent span.\n                            return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile), \"code\" /* Code */);\n                    }\n                case 257 /* ModuleBlock */:\n                    return spanForNode(n.parent);\n                case 252 /* ClassDeclaration */:\n                case 221 /* ClassExpression */:\n                case 253 /* InterfaceDeclaration */:\n                case 255 /* EnumDeclaration */:\n                case 258 /* CaseBlock */:\n                case 177 /* TypeLiteral */:\n                case 196 /* ObjectBindingPattern */:\n                    return spanForNode(n);\n                case 179 /* TupleType */:\n                    return spanForNode(n, /*autoCollapse*/ false, /*useFullStart*/ !ts.isTupleTypeNode(n.parent), 22 /* OpenBracketToken */);\n                case 284 /* CaseClause */:\n                case 285 /* DefaultClause */:\n                    return spanForNodeArray(n.statements);\n                case 200 /* ObjectLiteralExpression */:\n                    return spanForObjectOrArrayLiteral(n);\n                case 199 /* ArrayLiteralExpression */:\n                    return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */);\n                case 273 /* JsxElement */:\n                    return spanForJSXElement(n);\n                case 277 /* JsxFragment */:\n                    return spanForJSXFragment(n);\n                case 274 /* JsxSelfClosingElement */:\n                case 275 /* JsxOpeningElement */:\n                    return spanForJSXAttributes(n.attributes);\n                case 218 /* TemplateExpression */:\n                case 14 /* NoSubstitutionTemplateLiteral */:\n                    return spanForTemplateLiteral(n);\n                case 197 /* ArrayBindingPattern */:\n                    return spanForNode(n, /*autoCollapse*/ false, /*useFullStart*/ !ts.isBindingElement(n.parent), 22 /* OpenBracketToken */);\n                case 209 /* ArrowFunction */:\n                    return spanForArrowFunction(n);\n                case 203 /* CallExpression */:\n                    return spanForCallExpression(n);\n            }\n            function spanForCallExpression(node) {\n                if (!node.arguments.length) {\n                    return undefined;\n                }\n                var openToken = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile);\n                var closeToken = ts.findChildOfKind(node, 21 /* CloseParenToken */, sourceFile);\n                if (!openToken || !closeToken || ts.positionsAreOnSameLine(openToken.pos, closeToken.pos, sourceFile)) {\n                    return undefined;\n                }\n                return spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ false, /*useFullStart*/ true);\n            }\n            function spanForArrowFunction(node) {\n                if (ts.isBlock(node.body) || ts.positionsAreOnSameLine(node.body.getFullStart(), node.body.getEnd(), sourceFile)) {\n                    return undefined;\n                }\n                var textSpan = ts.createTextSpanFromBounds(node.body.getFullStart(), node.body.getEnd());\n                return createOutliningSpan(textSpan, \"code\" /* Code */, ts.createTextSpanFromNode(node));\n            }\n            function spanForJSXElement(node) {\n                var textSpan = ts.createTextSpanFromBounds(node.openingElement.getStart(sourceFile), node.closingElement.getEnd());\n                var tagName = node.openingElement.tagName.getText(sourceFile);\n                var bannerText = \"<\" + tagName + \">...</\" + tagName + \">\";\n                return createOutliningSpan(textSpan, \"code\" /* Code */, textSpan, /*autoCollapse*/ false, bannerText);\n            }\n            function spanForJSXFragment(node) {\n                var textSpan = ts.createTextSpanFromBounds(node.openingFragment.getStart(sourceFile), node.closingFragment.getEnd());\n                var bannerText = \"<>...</>\";\n                return createOutliningSpan(textSpan, \"code\" /* Code */, textSpan, /*autoCollapse*/ false, bannerText);\n            }\n            function spanForJSXAttributes(node) {\n                if (node.properties.length === 0) {\n                    return undefined;\n                }\n                return createOutliningSpanFromBounds(node.getStart(sourceFile), node.getEnd(), \"code\" /* Code */);\n            }\n            function spanForTemplateLiteral(node) {\n                if (node.kind === 14 /* NoSubstitutionTemplateLiteral */ && node.text.length === 0) {\n                    return undefined;\n                }\n                return createOutliningSpanFromBounds(node.getStart(sourceFile), node.getEnd(), \"code\" /* Code */);\n            }\n            function spanForObjectOrArrayLiteral(node, open) {\n                if (open === void 0) { open = 18 /* OpenBraceToken */; }\n                // If the block has no leading keywords and is inside an array literal or call expression,\n                // we only want to collapse the span of the block.\n                // Otherwise, the collapsed section will include the end of the previous line.\n                return spanForNode(node, /*autoCollapse*/ false, /*useFullStart*/ !ts.isArrayLiteralExpression(node.parent) && !ts.isCallExpression(node.parent), open);\n            }\n            function spanForNode(hintSpanNode, autoCollapse, useFullStart, open, close) {\n                if (autoCollapse === void 0) { autoCollapse = false; }\n                if (useFullStart === void 0) { useFullStart = true; }\n                if (open === void 0) { open = 18 /* OpenBraceToken */; }\n                if (close === void 0) { close = open === 18 /* OpenBraceToken */ ? 19 /* CloseBraceToken */ : 23 /* CloseBracketToken */; }\n                var openToken = ts.findChildOfKind(n, open, sourceFile);\n                var closeToken = ts.findChildOfKind(n, close, sourceFile);\n                return openToken && closeToken && spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart);\n            }\n            function spanForNodeArray(nodeArray) {\n                return nodeArray.length ? createOutliningSpan(ts.createTextSpanFromRange(nodeArray), \"code\" /* Code */) : undefined;\n            }\n        }\n        function functionSpan(node, body, sourceFile) {\n            var openToken = tryGetFunctionOpenToken(node, body, sourceFile);\n            var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile);\n            return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 209 /* ArrowFunction */);\n        }\n        function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) {\n            if (autoCollapse === void 0) { autoCollapse = false; }\n            if (useFullStart === void 0) { useFullStart = true; }\n            var textSpan = ts.createTextSpanFromBounds(useFullStart ? openToken.getFullStart() : openToken.getStart(sourceFile), closeToken.getEnd());\n            return createOutliningSpan(textSpan, \"code\" /* Code */, ts.createTextSpanFromNode(hintSpanNode, sourceFile), autoCollapse);\n        }\n        function createOutliningSpan(textSpan, kind, hintSpan, autoCollapse, bannerText) {\n            if (hintSpan === void 0) { hintSpan = textSpan; }\n            if (autoCollapse === void 0) { autoCollapse = false; }\n            if (bannerText === void 0) { bannerText = \"...\"; }\n            return { textSpan: textSpan, kind: kind, hintSpan: hintSpan, bannerText: bannerText, autoCollapse: autoCollapse };\n        }\n        function tryGetFunctionOpenToken(node, body, sourceFile) {\n            if (ts.isNodeArrayMultiLine(node.parameters, sourceFile)) {\n                var openParenToken = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile);\n                if (openParenToken) {\n                    return openParenToken;\n                }\n            }\n            return ts.findChildOfKind(body, 18 /* OpenBraceToken */, sourceFile);\n        }\n    })(OutliningElementsCollector = ts.OutliningElementsCollector || (ts.OutliningElementsCollector = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    // Note(cyrusn): this enum is ordered from strongest match type to weakest match type.\n    var PatternMatchKind;\n    (function (PatternMatchKind) {\n        PatternMatchKind[PatternMatchKind[\"exact\"] = 0] = \"exact\";\n        PatternMatchKind[PatternMatchKind[\"prefix\"] = 1] = \"prefix\";\n        PatternMatchKind[PatternMatchKind[\"substring\"] = 2] = \"substring\";\n        PatternMatchKind[PatternMatchKind[\"camelCase\"] = 3] = \"camelCase\";\n    })(PatternMatchKind = ts.PatternMatchKind || (ts.PatternMatchKind = {}));\n    function createPatternMatch(kind, isCaseSensitive) {\n        return {\n            kind: kind,\n            isCaseSensitive: isCaseSensitive\n        };\n    }\n    function createPatternMatcher(pattern) {\n        // We'll often see the same candidate string many times when searching (For example, when\n        // we see the name of a module that is used everywhere, or the name of an overload).  As\n        // such, we cache the information we compute about the candidate for the life of this\n        // pattern matcher so we don't have to compute it multiple times.\n        var stringToWordSpans = new ts.Map();\n        var dotSeparatedSegments = pattern.trim().split(\".\").map(function (p) { return createSegment(p.trim()); });\n        // A segment is considered invalid if we couldn't find any words in it.\n        if (dotSeparatedSegments.some(function (segment) { return !segment.subWordTextChunks.length; }))\n            return undefined;\n        return {\n            getFullMatch: function (containers, candidate) { return getFullMatch(containers, candidate, dotSeparatedSegments, stringToWordSpans); },\n            getMatchForLastSegmentOfPattern: function (candidate) { return matchSegment(candidate, ts.last(dotSeparatedSegments), stringToWordSpans); },\n            patternContainsDots: dotSeparatedSegments.length > 1\n        };\n    }\n    ts.createPatternMatcher = createPatternMatcher;\n    function getFullMatch(candidateContainers, candidate, dotSeparatedSegments, stringToWordSpans) {\n        // First, check that the last part of the dot separated pattern matches the name of the\n        // candidate.  If not, then there's no point in proceeding and doing the more\n        // expensive work.\n        var candidateMatch = matchSegment(candidate, ts.last(dotSeparatedSegments), stringToWordSpans);\n        if (!candidateMatch) {\n            return undefined;\n        }\n        // -1 because the last part was checked against the name, and only the rest\n        // of the parts are checked against the container.\n        if (dotSeparatedSegments.length - 1 > candidateContainers.length) {\n            // There weren't enough container parts to match against the pattern parts.\n            // So this definitely doesn't match.\n            return undefined;\n        }\n        var bestMatch;\n        for (var i = dotSeparatedSegments.length - 2, j = candidateContainers.length - 1; i >= 0; i -= 1, j -= 1) {\n            bestMatch = betterMatch(bestMatch, matchSegment(candidateContainers[j], dotSeparatedSegments[i], stringToWordSpans));\n        }\n        return bestMatch;\n    }\n    function getWordSpans(word, stringToWordSpans) {\n        var spans = stringToWordSpans.get(word);\n        if (!spans) {\n            stringToWordSpans.set(word, spans = breakIntoWordSpans(word));\n        }\n        return spans;\n    }\n    function matchTextChunk(candidate, chunk, stringToWordSpans) {\n        var index = indexOfIgnoringCase(candidate, chunk.textLowerCase);\n        if (index === 0) {\n            // a) Check if the word is a prefix of the candidate, in a case insensitive or\n            //    sensitive manner. If it does, return that there was an exact match if the word and candidate are the same length, else a prefix match.\n            return createPatternMatch(chunk.text.length === candidate.length ? PatternMatchKind.exact : PatternMatchKind.prefix, /*isCaseSensitive:*/ ts.startsWith(candidate, chunk.text));\n        }\n        if (chunk.isLowerCase) {\n            if (index === -1)\n                return undefined;\n            // b) If the part is entirely lowercase, then check if it is contained anywhere in the\n            //    candidate in a case insensitive manner.  If so, return that there was a substring\n            //    match.\n            //\n            //    Note: We only have a substring match if the lowercase part is prefix match of some\n            //    word part. That way we don't match something like 'Class' when the user types 'a'.\n            //    But we would match 'FooAttribute' (since 'Attribute' starts with 'a').\n            var wordSpans = getWordSpans(candidate, stringToWordSpans);\n            for (var _i = 0, wordSpans_1 = wordSpans; _i < wordSpans_1.length; _i++) {\n                var span = wordSpans_1[_i];\n                if (partStartsWith(candidate, span, chunk.text, /*ignoreCase:*/ true)) {\n                    return createPatternMatch(PatternMatchKind.substring, /*isCaseSensitive:*/ partStartsWith(candidate, span, chunk.text, /*ignoreCase:*/ false));\n                }\n            }\n            // c) Is the pattern a substring of the candidate starting on one of the candidate's word boundaries?\n            // We could check every character boundary start of the candidate for the pattern. However, that's\n            // an m * n operation in the wost case. Instead, find the first instance of the pattern\n            // substring, and see if it starts on a capital letter. It seems unlikely that the user will try to\n            // filter the list based on a substring that starts on a capital letter and also with a lowercase one.\n            // (Pattern: fogbar, Candidate: quuxfogbarFogBar).\n            if (chunk.text.length < candidate.length && isUpperCaseLetter(candidate.charCodeAt(index))) {\n                return createPatternMatch(PatternMatchKind.substring, /*isCaseSensitive:*/ false);\n            }\n        }\n        else {\n            // d) If the part was not entirely lowercase, then check if it is contained in the\n            //    candidate in a case *sensitive* manner. If so, return that there was a substring\n            //    match.\n            if (candidate.indexOf(chunk.text) > 0) {\n                return createPatternMatch(PatternMatchKind.substring, /*isCaseSensitive:*/ true);\n            }\n            // e) If the part was not entirely lowercase, then attempt a camel cased match as well.\n            if (chunk.characterSpans.length > 0) {\n                var candidateParts = getWordSpans(candidate, stringToWordSpans);\n                var isCaseSensitive = tryCamelCaseMatch(candidate, candidateParts, chunk, /*ignoreCase:*/ false) ? true\n                    : tryCamelCaseMatch(candidate, candidateParts, chunk, /*ignoreCase:*/ true) ? false : undefined;\n                if (isCaseSensitive !== undefined) {\n                    return createPatternMatch(PatternMatchKind.camelCase, isCaseSensitive);\n                }\n            }\n        }\n    }\n    function matchSegment(candidate, segment, stringToWordSpans) {\n        // First check if the segment matches as is.  This is also useful if the segment contains\n        // characters we would normally strip when splitting into parts that we also may want to\n        // match in the candidate.  For example if the segment is \"@int\" and the candidate is\n        // \"@int\", then that will show up as an exact match here.\n        //\n        // Note: if the segment contains a space or an asterisk then we must assume that it's a\n        // multi-word segment.\n        if (every(segment.totalTextChunk.text, function (ch) { return ch !== 32 /* space */ && ch !== 42 /* asterisk */; })) {\n            var match = matchTextChunk(candidate, segment.totalTextChunk, stringToWordSpans);\n            if (match)\n                return match;\n        }\n        // The logic for pattern matching is now as follows:\n        //\n        // 1) Break the segment passed in into words.  Breaking is rather simple and a\n        //    good way to think about it that if gives you all the individual alphanumeric words\n        //    of the pattern.\n        //\n        // 2) For each word try to match the word against the candidate value.\n        //\n        // 3) Matching is as follows:\n        //\n        //   a) Check if the word is a prefix of the candidate, in a case insensitive or\n        //      sensitive manner. If it does, return that there was an exact match if the word and candidate are the same length, else a prefix match.\n        //\n        //   If the word is entirely lowercase:\n        //      b) Then check if it is contained anywhere in the\n        //          candidate in a case insensitive manner.  If so, return that there was a substring\n        //          match.\n        //\n        //          Note: We only have a substring match if the lowercase part is prefix match of\n        //          some word part. That way we don't match something like 'Class' when the user\n        //          types 'a'. But we would match 'FooAttribute' (since 'Attribute' starts with\n        //          'a').\n        //\n        //       c) The word is all lower case. Is it a case insensitive substring of the candidate starting\n        //          on a part boundary of the candidate?\n        //\n        //   Else:\n        //       d) If the word was not entirely lowercase, then check if it is contained in the\n        //          candidate in a case *sensitive* manner. If so, return that there was a substring\n        //          match.\n        //\n        //       e) If the word was not entirely lowercase, then attempt a camel cased match as\n        //          well.\n        //\n        // Only if all words have some sort of match is the pattern considered matched.\n        var subWordTextChunks = segment.subWordTextChunks;\n        var bestMatch;\n        for (var _i = 0, subWordTextChunks_1 = subWordTextChunks; _i < subWordTextChunks_1.length; _i++) {\n            var subWordTextChunk = subWordTextChunks_1[_i];\n            bestMatch = betterMatch(bestMatch, matchTextChunk(candidate, subWordTextChunk, stringToWordSpans));\n        }\n        return bestMatch;\n    }\n    function betterMatch(a, b) {\n        return ts.min(a, b, compareMatches);\n    }\n    function compareMatches(a, b) {\n        return a === undefined ? 1 /* GreaterThan */ : b === undefined ? -1 /* LessThan */\n            : ts.compareValues(a.kind, b.kind) || ts.compareBooleans(!a.isCaseSensitive, !b.isCaseSensitive);\n    }\n    function partStartsWith(candidate, candidateSpan, pattern, ignoreCase, patternSpan) {\n        if (patternSpan === void 0) { patternSpan = { start: 0, length: pattern.length }; }\n        return patternSpan.length <= candidateSpan.length // If pattern part is longer than the candidate part there can never be a match.\n            && everyInRange(0, patternSpan.length, function (i) { return equalChars(pattern.charCodeAt(patternSpan.start + i), candidate.charCodeAt(candidateSpan.start + i), ignoreCase); });\n    }\n    function equalChars(ch1, ch2, ignoreCase) {\n        return ignoreCase ? toLowerCase(ch1) === toLowerCase(ch2) : ch1 === ch2;\n    }\n    function tryCamelCaseMatch(candidate, candidateParts, chunk, ignoreCase) {\n        var chunkCharacterSpans = chunk.characterSpans;\n        // Note: we may have more pattern parts than candidate parts.  This is because multiple\n        // pattern parts may match a candidate part.  For example \"SiUI\" against \"SimpleUI\".\n        // We'll have 3 pattern parts Si/U/I against two candidate parts Simple/UI.  However, U\n        // and I will both match in UI.\n        var currentCandidate = 0;\n        var currentChunkSpan = 0;\n        var firstMatch;\n        var contiguous;\n        while (true) {\n            // Let's consider our termination cases\n            if (currentChunkSpan === chunkCharacterSpans.length) {\n                return true;\n            }\n            else if (currentCandidate === candidateParts.length) {\n                // No match, since we still have more of the pattern to hit\n                return false;\n            }\n            var candidatePart = candidateParts[currentCandidate];\n            var gotOneMatchThisCandidate = false;\n            // Consider the case of matching SiUI against SimpleUIElement. The candidate parts\n            // will be Simple/UI/Element, and the pattern parts will be Si/U/I.  We'll match 'Si'\n            // against 'Simple' first.  Then we'll match 'U' against 'UI'. However, we want to\n            // still keep matching pattern parts against that candidate part.\n            for (; currentChunkSpan < chunkCharacterSpans.length; currentChunkSpan++) {\n                var chunkCharacterSpan = chunkCharacterSpans[currentChunkSpan];\n                if (gotOneMatchThisCandidate) {\n                    // We've already gotten one pattern part match in this candidate.  We will\n                    // only continue trying to consumer pattern parts if the last part and this\n                    // part are both upper case.\n                    if (!isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan - 1].start)) ||\n                        !isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan].start))) {\n                        break;\n                    }\n                }\n                if (!partStartsWith(candidate, candidatePart, chunk.text, ignoreCase, chunkCharacterSpan)) {\n                    break;\n                }\n                gotOneMatchThisCandidate = true;\n                firstMatch = firstMatch === undefined ? currentCandidate : firstMatch;\n                // If we were contiguous, then keep that value.  If we weren't, then keep that\n                // value.  If we don't know, then set the value to 'true' as an initial match is\n                // obviously contiguous.\n                contiguous = contiguous === undefined ? true : contiguous;\n                candidatePart = ts.createTextSpan(candidatePart.start + chunkCharacterSpan.length, candidatePart.length - chunkCharacterSpan.length);\n            }\n            // Check if we matched anything at all.  If we didn't, then we need to unset the\n            // contiguous bit if we currently had it set.\n            // If we haven't set the bit yet, then that means we haven't matched anything so\n            // far, and we don't want to change that.\n            if (!gotOneMatchThisCandidate && contiguous !== undefined) {\n                contiguous = false;\n            }\n            // Move onto the next candidate.\n            currentCandidate++;\n        }\n    }\n    function createSegment(text) {\n        return {\n            totalTextChunk: createTextChunk(text),\n            subWordTextChunks: breakPatternIntoTextChunks(text)\n        };\n    }\n    function isUpperCaseLetter(ch) {\n        // Fast check for the ascii range.\n        if (ch >= 65 /* A */ && ch <= 90 /* Z */) {\n            return true;\n        }\n        if (ch < 127 /* maxAsciiCharacter */ || !ts.isUnicodeIdentifierStart(ch, 99 /* Latest */)) {\n            return false;\n        }\n        // TODO: find a way to determine this for any unicode characters in a\n        // non-allocating manner.\n        var str = String.fromCharCode(ch);\n        return str === str.toUpperCase();\n    }\n    function isLowerCaseLetter(ch) {\n        // Fast check for the ascii range.\n        if (ch >= 97 /* a */ && ch <= 122 /* z */) {\n            return true;\n        }\n        if (ch < 127 /* maxAsciiCharacter */ || !ts.isUnicodeIdentifierStart(ch, 99 /* Latest */)) {\n            return false;\n        }\n        // TODO: find a way to determine this for any unicode characters in a\n        // non-allocating manner.\n        var str = String.fromCharCode(ch);\n        return str === str.toLowerCase();\n    }\n    // Assumes 'value' is already lowercase.\n    function indexOfIgnoringCase(str, value) {\n        var n = str.length - value.length;\n        var _loop_6 = function (start) {\n            if (every(value, function (valueChar, i) { return toLowerCase(str.charCodeAt(i + start)) === valueChar; })) {\n                return { value: start };\n            }\n        };\n        for (var start = 0; start <= n; start++) {\n            var state_1 = _loop_6(start);\n            if (typeof state_1 === \"object\")\n                return state_1.value;\n        }\n        return -1;\n    }\n    function toLowerCase(ch) {\n        // Fast convert for the ascii range.\n        if (ch >= 65 /* A */ && ch <= 90 /* Z */) {\n            return 97 /* a */ + (ch - 65 /* A */);\n        }\n        if (ch < 127 /* maxAsciiCharacter */) {\n            return ch;\n        }\n        // TODO: find a way to compute this for any unicode characters in a\n        // non-allocating manner.\n        return String.fromCharCode(ch).toLowerCase().charCodeAt(0);\n    }\n    function isDigit(ch) {\n        // TODO(cyrusn): Find a way to support this for unicode digits.\n        return ch >= 48 /* _0 */ && ch <= 57 /* _9 */;\n    }\n    function isWordChar(ch) {\n        return isUpperCaseLetter(ch) || isLowerCaseLetter(ch) || isDigit(ch) || ch === 95 /* _ */ || ch === 36 /* $ */;\n    }\n    function breakPatternIntoTextChunks(pattern) {\n        var result = [];\n        var wordStart = 0;\n        var wordLength = 0;\n        for (var i = 0; i < pattern.length; i++) {\n            var ch = pattern.charCodeAt(i);\n            if (isWordChar(ch)) {\n                if (wordLength === 0) {\n                    wordStart = i;\n                }\n                wordLength++;\n            }\n            else {\n                if (wordLength > 0) {\n                    result.push(createTextChunk(pattern.substr(wordStart, wordLength)));\n                    wordLength = 0;\n                }\n            }\n        }\n        if (wordLength > 0) {\n            result.push(createTextChunk(pattern.substr(wordStart, wordLength)));\n        }\n        return result;\n    }\n    function createTextChunk(text) {\n        var textLowerCase = text.toLowerCase();\n        return {\n            text: text,\n            textLowerCase: textLowerCase,\n            isLowerCase: text === textLowerCase,\n            characterSpans: breakIntoCharacterSpans(text)\n        };\n    }\n    function breakIntoCharacterSpans(identifier) {\n        return breakIntoSpans(identifier, /*word:*/ false);\n    }\n    ts.breakIntoCharacterSpans = breakIntoCharacterSpans;\n    function breakIntoWordSpans(identifier) {\n        return breakIntoSpans(identifier, /*word:*/ true);\n    }\n    ts.breakIntoWordSpans = breakIntoWordSpans;\n    function breakIntoSpans(identifier, word) {\n        var result = [];\n        var wordStart = 0;\n        for (var i = 1; i < identifier.length; i++) {\n            var lastIsDigit = isDigit(identifier.charCodeAt(i - 1));\n            var currentIsDigit = isDigit(identifier.charCodeAt(i));\n            var hasTransitionFromLowerToUpper = transitionFromLowerToUpper(identifier, word, i);\n            var hasTransitionFromUpperToLower = word && transitionFromUpperToLower(identifier, i, wordStart);\n            if (charIsPunctuation(identifier.charCodeAt(i - 1)) ||\n                charIsPunctuation(identifier.charCodeAt(i)) ||\n                lastIsDigit !== currentIsDigit ||\n                hasTransitionFromLowerToUpper ||\n                hasTransitionFromUpperToLower) {\n                if (!isAllPunctuation(identifier, wordStart, i)) {\n                    result.push(ts.createTextSpan(wordStart, i - wordStart));\n                }\n                wordStart = i;\n            }\n        }\n        if (!isAllPunctuation(identifier, wordStart, identifier.length)) {\n            result.push(ts.createTextSpan(wordStart, identifier.length - wordStart));\n        }\n        return result;\n    }\n    function charIsPunctuation(ch) {\n        switch (ch) {\n            case 33 /* exclamation */:\n            case 34 /* doubleQuote */:\n            case 35 /* hash */:\n            case 37 /* percent */:\n            case 38 /* ampersand */:\n            case 39 /* singleQuote */:\n            case 40 /* openParen */:\n            case 41 /* closeParen */:\n            case 42 /* asterisk */:\n            case 44 /* comma */:\n            case 45 /* minus */:\n            case 46 /* dot */:\n            case 47 /* slash */:\n            case 58 /* colon */:\n            case 59 /* semicolon */:\n            case 63 /* question */:\n            case 64 /* at */:\n            case 91 /* openBracket */:\n            case 92 /* backslash */:\n            case 93 /* closeBracket */:\n            case 95 /* _ */:\n            case 123 /* openBrace */:\n            case 125 /* closeBrace */:\n                return true;\n        }\n        return false;\n    }\n    function isAllPunctuation(identifier, start, end) {\n        return every(identifier, function (ch) { return charIsPunctuation(ch) && ch !== 95 /* _ */; }, start, end);\n    }\n    function transitionFromUpperToLower(identifier, index, wordStart) {\n        // Cases this supports:\n        // 1) IDisposable -> I, Disposable\n        // 2) UIElement -> UI, Element\n        // 3) HTMLDocument -> HTML, Document\n        //\n        // etc.\n        // We have a transition from an upper to a lower letter here.  But we only\n        // want to break if all the letters that preceded are uppercase.  i.e. if we\n        // have \"Foo\" we don't want to break that into \"F, oo\".  But if we have\n        // \"IFoo\" or \"UIFoo\", then we want to break that into \"I, Foo\" and \"UI,\n        // Foo\".  i.e. the last uppercase letter belongs to the lowercase letters\n        // that follows.  Note: this will make the following not split properly:\n        // \"HELLOthere\".  However, these sorts of names do not show up in .Net\n        // programs.\n        return index !== wordStart\n            && index + 1 < identifier.length\n            && isUpperCaseLetter(identifier.charCodeAt(index))\n            && isLowerCaseLetter(identifier.charCodeAt(index + 1))\n            && every(identifier, isUpperCaseLetter, wordStart, index);\n    }\n    function transitionFromLowerToUpper(identifier, word, index) {\n        var lastIsUpper = isUpperCaseLetter(identifier.charCodeAt(index - 1));\n        var currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index));\n        // See if the casing indicates we're starting a new word. Note: if we're breaking on\n        // words, then just seeing an upper case character isn't enough.  Instead, it has to\n        // be uppercase and the previous character can't be uppercase.\n        //\n        // For example, breaking \"AddMetadata\" on words would make: Add Metadata\n        //\n        // on characters would be: A dd M etadata\n        //\n        // Break \"AM\" on words would be: AM\n        //\n        // on characters would be: A M\n        //\n        // We break the search string on characters.  But we break the symbol name on words.\n        return currentIsUpper && (!word || !lastIsUpper);\n    }\n    function everyInRange(start, end, pred) {\n        for (var i = start; i < end; i++) {\n            if (!pred(i)) {\n                return false;\n            }\n        }\n        return true;\n    }\n    function every(s, pred, start, end) {\n        if (start === void 0) { start = 0; }\n        if (end === void 0) { end = s.length; }\n        return everyInRange(start, end, function (i) { return pred(s.charCodeAt(i), i); });\n    }\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    function preProcessFile(sourceText, readImportFiles, detectJavaScriptImports) {\n        if (readImportFiles === void 0) { readImportFiles = true; }\n        if (detectJavaScriptImports === void 0) { detectJavaScriptImports = false; }\n        var pragmaContext = {\n            languageVersion: 1 /* ES5 */,\n            pragmas: undefined,\n            checkJsDirective: undefined,\n            referencedFiles: [],\n            typeReferenceDirectives: [],\n            libReferenceDirectives: [],\n            amdDependencies: [],\n            hasNoDefaultLib: undefined,\n            moduleName: undefined\n        };\n        var importedFiles = [];\n        var ambientExternalModules;\n        var lastToken;\n        var currentToken;\n        var braceNesting = 0;\n        // assume that text represent an external module if it contains at least one top level import/export\n        // ambient modules that are found inside external modules are interpreted as module augmentations\n        var externalModule = false;\n        function nextToken() {\n            lastToken = currentToken;\n            currentToken = ts.scanner.scan();\n            if (currentToken === 18 /* OpenBraceToken */) {\n                braceNesting++;\n            }\n            else if (currentToken === 19 /* CloseBraceToken */) {\n                braceNesting--;\n            }\n            return currentToken;\n        }\n        function getFileReference() {\n            var fileName = ts.scanner.getTokenValue();\n            var pos = ts.scanner.getTokenPos();\n            return { fileName: fileName, pos: pos, end: pos + fileName.length };\n        }\n        function recordAmbientExternalModule() {\n            if (!ambientExternalModules) {\n                ambientExternalModules = [];\n            }\n            ambientExternalModules.push({ ref: getFileReference(), depth: braceNesting });\n        }\n        function recordModuleName() {\n            importedFiles.push(getFileReference());\n            markAsExternalModuleIfTopLevel();\n        }\n        function markAsExternalModuleIfTopLevel() {\n            if (braceNesting === 0) {\n                externalModule = true;\n            }\n        }\n        /**\n         * Returns true if at least one token was consumed from the stream\n         */\n        function tryConsumeDeclare() {\n            var token = ts.scanner.getToken();\n            if (token === 133 /* DeclareKeyword */) {\n                // declare module \"mod\"\n                token = nextToken();\n                if (token === 139 /* ModuleKeyword */) {\n                    token = nextToken();\n                    if (token === 10 /* StringLiteral */) {\n                        recordAmbientExternalModule();\n                    }\n                }\n                return true;\n            }\n            return false;\n        }\n        /**\n         * Returns true if at least one token was consumed from the stream\n         */\n        function tryConsumeImport() {\n            if (lastToken === 24 /* DotToken */) {\n                return false;\n            }\n            var token = ts.scanner.getToken();\n            if (token === 99 /* ImportKeyword */) {\n                token = nextToken();\n                if (token === 20 /* OpenParenToken */) {\n                    token = nextToken();\n                    if (token === 10 /* StringLiteral */ || token === 14 /* NoSubstitutionTemplateLiteral */) {\n                        // import(\"mod\");\n                        recordModuleName();\n                        return true;\n                    }\n                }\n                else if (token === 10 /* StringLiteral */) {\n                    // import \"mod\";\n                    recordModuleName();\n                    return true;\n                }\n                else {\n                    if (token === 149 /* TypeKeyword */) {\n                        var skipTypeKeyword = ts.scanner.lookAhead(function () {\n                            var token = ts.scanner.scan();\n                            return token !== 153 /* FromKeyword */ && (token === 41 /* AsteriskToken */ ||\n                                token === 18 /* OpenBraceToken */ ||\n                                token === 78 /* Identifier */ ||\n                                ts.isKeyword(token));\n                        });\n                        if (skipTypeKeyword) {\n                            token = nextToken();\n                        }\n                    }\n                    if (token === 78 /* Identifier */ || ts.isKeyword(token)) {\n                        token = nextToken();\n                        if (token === 153 /* FromKeyword */) {\n                            token = nextToken();\n                            if (token === 10 /* StringLiteral */) {\n                                // import d from \"mod\";\n                                recordModuleName();\n                                return true;\n                            }\n                        }\n                        else if (token === 62 /* EqualsToken */) {\n                            if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) {\n                                return true;\n                            }\n                        }\n                        else if (token === 27 /* CommaToken */) {\n                            // consume comma and keep going\n                            token = nextToken();\n                        }\n                        else {\n                            // unknown syntax\n                            return true;\n                        }\n                    }\n                    if (token === 18 /* OpenBraceToken */) {\n                        token = nextToken();\n                        // consume \"{ a as B, c, d as D}\" clauses\n                        // make sure that it stops on EOF\n                        while (token !== 19 /* CloseBraceToken */ && token !== 1 /* EndOfFileToken */) {\n                            token = nextToken();\n                        }\n                        if (token === 19 /* CloseBraceToken */) {\n                            token = nextToken();\n                            if (token === 153 /* FromKeyword */) {\n                                token = nextToken();\n                                if (token === 10 /* StringLiteral */) {\n                                    // import {a as A} from \"mod\";\n                                    // import d, {a, b as B} from \"mod\"\n                                    recordModuleName();\n                                }\n                            }\n                        }\n                    }\n                    else if (token === 41 /* AsteriskToken */) {\n                        token = nextToken();\n                        if (token === 126 /* AsKeyword */) {\n                            token = nextToken();\n                            if (token === 78 /* Identifier */ || ts.isKeyword(token)) {\n                                token = nextToken();\n                                if (token === 153 /* FromKeyword */) {\n                                    token = nextToken();\n                                    if (token === 10 /* StringLiteral */) {\n                                        // import * as NS from \"mod\"\n                                        // import d, * as NS from \"mod\"\n                                        recordModuleName();\n                                    }\n                                }\n                            }\n                        }\n                    }\n                }\n                return true;\n            }\n            return false;\n        }\n        function tryConsumeExport() {\n            var token = ts.scanner.getToken();\n            if (token === 92 /* ExportKeyword */) {\n                markAsExternalModuleIfTopLevel();\n                token = nextToken();\n                if (token === 149 /* TypeKeyword */) {\n                    var skipTypeKeyword = ts.scanner.lookAhead(function () {\n                        var token = ts.scanner.scan();\n                        return token === 41 /* AsteriskToken */ ||\n                            token === 18 /* OpenBraceToken */;\n                    });\n                    if (skipTypeKeyword) {\n                        token = nextToken();\n                    }\n                }\n                if (token === 18 /* OpenBraceToken */) {\n                    token = nextToken();\n                    // consume \"{ a as B, c, d as D}\" clauses\n                    // make sure it stops on EOF\n                    while (token !== 19 /* CloseBraceToken */ && token !== 1 /* EndOfFileToken */) {\n                        token = nextToken();\n                    }\n                    if (token === 19 /* CloseBraceToken */) {\n                        token = nextToken();\n                        if (token === 153 /* FromKeyword */) {\n                            token = nextToken();\n                            if (token === 10 /* StringLiteral */) {\n                                // export {a as A} from \"mod\";\n                                // export {a, b as B} from \"mod\"\n                                recordModuleName();\n                            }\n                        }\n                    }\n                }\n                else if (token === 41 /* AsteriskToken */) {\n                    token = nextToken();\n                    if (token === 153 /* FromKeyword */) {\n                        token = nextToken();\n                        if (token === 10 /* StringLiteral */) {\n                            // export * from \"mod\"\n                            recordModuleName();\n                        }\n                    }\n                }\n                else if (token === 99 /* ImportKeyword */) {\n                    token = nextToken();\n                    if (token === 149 /* TypeKeyword */) {\n                        var skipTypeKeyword = ts.scanner.lookAhead(function () {\n                            var token = ts.scanner.scan();\n                            return token === 78 /* Identifier */ ||\n                                ts.isKeyword(token);\n                        });\n                        if (skipTypeKeyword) {\n                            token = nextToken();\n                        }\n                    }\n                    if (token === 78 /* Identifier */ || ts.isKeyword(token)) {\n                        token = nextToken();\n                        if (token === 62 /* EqualsToken */) {\n                            if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) {\n                                return true;\n                            }\n                        }\n                    }\n                }\n                return true;\n            }\n            return false;\n        }\n        function tryConsumeRequireCall(skipCurrentToken, allowTemplateLiterals) {\n            if (allowTemplateLiterals === void 0) { allowTemplateLiterals = false; }\n            var token = skipCurrentToken ? nextToken() : ts.scanner.getToken();\n            if (token === 143 /* RequireKeyword */) {\n                token = nextToken();\n                if (token === 20 /* OpenParenToken */) {\n                    token = nextToken();\n                    if (token === 10 /* StringLiteral */ ||\n                        allowTemplateLiterals && token === 14 /* NoSubstitutionTemplateLiteral */) {\n                        //  require(\"mod\");\n                        recordModuleName();\n                    }\n                }\n                return true;\n            }\n            return false;\n        }\n        function tryConsumeDefine() {\n            var token = ts.scanner.getToken();\n            if (token === 78 /* Identifier */ && ts.scanner.getTokenValue() === \"define\") {\n                token = nextToken();\n                if (token !== 20 /* OpenParenToken */) {\n                    return true;\n                }\n                token = nextToken();\n                if (token === 10 /* StringLiteral */ || token === 14 /* NoSubstitutionTemplateLiteral */) {\n                    // looks like define (\"modname\", ... - skip string literal and comma\n                    token = nextToken();\n                    if (token === 27 /* CommaToken */) {\n                        token = nextToken();\n                    }\n                    else {\n                        // unexpected token\n                        return true;\n                    }\n                }\n                // should be start of dependency list\n                if (token !== 22 /* OpenBracketToken */) {\n                    return true;\n                }\n                // skip open bracket\n                token = nextToken();\n                // scan until ']' or EOF\n                while (token !== 23 /* CloseBracketToken */ && token !== 1 /* EndOfFileToken */) {\n                    // record string literals as module names\n                    if (token === 10 /* StringLiteral */ || token === 14 /* NoSubstitutionTemplateLiteral */) {\n                        recordModuleName();\n                    }\n                    token = nextToken();\n                }\n                return true;\n            }\n            return false;\n        }\n        function processImports() {\n            ts.scanner.setText(sourceText);\n            nextToken();\n            // Look for:\n            //    import \"mod\";\n            //    import d from \"mod\"\n            //    import {a as A } from \"mod\";\n            //    import * as NS from \"mod\"\n            //    import d, {a, b as B} from \"mod\"\n            //    import i = require(\"mod\");\n            //    import(\"mod\");\n            //    export * from \"mod\"\n            //    export {a as b} from \"mod\"\n            //    export import i = require(\"mod\")\n            //    (for JavaScript files) require(\"mod\")\n            // Do not look for:\n            //    AnySymbol.import(\"mod\")\n            //    AnySymbol.nested.import(\"mod\")\n            while (true) {\n                if (ts.scanner.getToken() === 1 /* EndOfFileToken */) {\n                    break;\n                }\n                // check if at least one of alternative have moved scanner forward\n                if (tryConsumeDeclare() ||\n                    tryConsumeImport() ||\n                    tryConsumeExport() ||\n                    (detectJavaScriptImports && (tryConsumeRequireCall(/*skipCurrentToken*/ false, /*allowTemplateLiterals*/ true) ||\n                        tryConsumeDefine()))) {\n                    continue;\n                }\n                else {\n                    nextToken();\n                }\n            }\n            ts.scanner.setText(undefined);\n        }\n        if (readImportFiles) {\n            processImports();\n        }\n        ts.processCommentPragmas(pragmaContext, sourceText);\n        ts.processPragmasIntoFields(pragmaContext, ts.noop);\n        if (externalModule) {\n            // for external modules module all nested ambient modules are augmentations\n            if (ambientExternalModules) {\n                // move all detected ambient modules to imported files since they need to be resolved\n                for (var _i = 0, ambientExternalModules_1 = ambientExternalModules; _i < ambientExternalModules_1.length; _i++) {\n                    var decl = ambientExternalModules_1[_i];\n                    importedFiles.push(decl.ref);\n                }\n            }\n            return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, libReferenceDirectives: pragmaContext.libReferenceDirectives, importedFiles: importedFiles, isLibFile: !!pragmaContext.hasNoDefaultLib, ambientExternalModules: undefined };\n        }\n        else {\n            // for global scripts ambient modules still can have augmentations - look for ambient modules with depth > 0\n            var ambientModuleNames = void 0;\n            if (ambientExternalModules) {\n                for (var _a = 0, ambientExternalModules_2 = ambientExternalModules; _a < ambientExternalModules_2.length; _a++) {\n                    var decl = ambientExternalModules_2[_a];\n                    if (decl.depth === 0) {\n                        if (!ambientModuleNames) {\n                            ambientModuleNames = [];\n                        }\n                        ambientModuleNames.push(decl.ref.fileName);\n                    }\n                    else {\n                        importedFiles.push(decl.ref);\n                    }\n                }\n            }\n            return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, libReferenceDirectives: pragmaContext.libReferenceDirectives, importedFiles: importedFiles, isLibFile: !!pragmaContext.hasNoDefaultLib, ambientExternalModules: ambientModuleNames };\n        }\n    }\n    ts.preProcessFile = preProcessFile;\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var Rename;\n    (function (Rename) {\n        function getRenameInfo(program, sourceFile, position, options) {\n            var node = ts.getAdjustedRenameLocation(ts.getTouchingPropertyName(sourceFile, position));\n            if (nodeIsEligibleForRename(node)) {\n                var renameInfo = getRenameInfoForNode(node, program.getTypeChecker(), sourceFile, function (declaration) { return program.isSourceFileDefaultLibrary(declaration.getSourceFile()); }, options);\n                if (renameInfo) {\n                    return renameInfo;\n                }\n            }\n            return getRenameInfoError(ts.Diagnostics.You_cannot_rename_this_element);\n        }\n        Rename.getRenameInfo = getRenameInfo;\n        function getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile, options) {\n            var symbol = typeChecker.getSymbolAtLocation(node);\n            if (!symbol) {\n                if (ts.isStringLiteralLike(node)) {\n                    var type = ts.getContextualTypeOrAncestorTypeNodeType(node, typeChecker);\n                    if (type && ((type.flags & 128 /* StringLiteral */) || ((type.flags & 1048576 /* Union */) && ts.every(type.types, function (type) { return !!(type.flags & 128 /* StringLiteral */); })))) {\n                        return getRenameInfoSuccess(node.text, node.text, \"string\" /* string */, \"\", node, sourceFile);\n                    }\n                }\n                else if (ts.isLabelName(node)) {\n                    var name = ts.getTextOfNode(node);\n                    return getRenameInfoSuccess(name, name, \"label\" /* label */, \"\" /* none */, node, sourceFile);\n                }\n                return undefined;\n            }\n            // Only allow a symbol to be renamed if it actually has at least one declaration.\n            var declarations = symbol.declarations;\n            if (!declarations || declarations.length === 0)\n                return;\n            // Disallow rename for elements that are defined in the standard TypeScript library.\n            if (declarations.some(isDefinedInLibraryFile)) {\n                return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library);\n            }\n            // Cannot rename `default` as in `import { default as foo } from \"./someModule\";\n            if (ts.isIdentifier(node) && node.originalKeywordKind === 87 /* DefaultKeyword */ && symbol.parent && symbol.parent.flags & 1536 /* Module */) {\n                return undefined;\n            }\n            if (ts.isStringLiteralLike(node) && ts.tryGetImportFromModuleSpecifier(node)) {\n                return options && options.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : undefined;\n            }\n            var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node);\n            var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 158 /* ComputedPropertyName */)\n                ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node))\n                : undefined;\n            var displayName = specifierName || typeChecker.symbolToString(symbol);\n            var fullDisplayName = specifierName || typeChecker.getFullyQualifiedName(symbol);\n            return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts.SymbolDisplay.getSymbolModifiers(typeChecker, symbol), node, sourceFile);\n        }\n        function getRenameInfoForModule(node, sourceFile, moduleSymbol) {\n            if (!ts.isExternalModuleNameRelative(node.text)) {\n                return getRenameInfoError(ts.Diagnostics.You_cannot_rename_a_module_via_a_global_import);\n            }\n            var moduleSourceFile = ts.find(moduleSymbol.declarations, ts.isSourceFile);\n            if (!moduleSourceFile)\n                return undefined;\n            var withoutIndex = ts.endsWith(node.text, \"/index\") || ts.endsWith(node.text, \"/index.js\") ? undefined : ts.tryRemoveSuffix(ts.removeFileExtension(moduleSourceFile.fileName), \"/index\");\n            var name = withoutIndex === undefined ? moduleSourceFile.fileName : withoutIndex;\n            var kind = withoutIndex === undefined ? \"module\" /* moduleElement */ : \"directory\" /* directory */;\n            var indexAfterLastSlash = node.text.lastIndexOf(\"/\") + 1;\n            // Span should only be the last component of the path. + 1 to account for the quote character.\n            var triggerSpan = ts.createTextSpan(node.getStart(sourceFile) + 1 + indexAfterLastSlash, node.text.length - indexAfterLastSlash);\n            return {\n                canRename: true,\n                fileToRename: name,\n                kind: kind,\n                displayName: name,\n                fullDisplayName: name,\n                kindModifiers: \"\" /* none */,\n                triggerSpan: triggerSpan,\n            };\n        }\n        function getRenameInfoSuccess(displayName, fullDisplayName, kind, kindModifiers, node, sourceFile) {\n            return {\n                canRename: true,\n                fileToRename: undefined,\n                kind: kind,\n                displayName: displayName,\n                fullDisplayName: fullDisplayName,\n                kindModifiers: kindModifiers,\n                triggerSpan: createTriggerSpanForNode(node, sourceFile)\n            };\n        }\n        function getRenameInfoError(diagnostic) {\n            return { canRename: false, localizedErrorMessage: ts.getLocaleSpecificMessage(diagnostic) };\n        }\n        function createTriggerSpanForNode(node, sourceFile) {\n            var start = node.getStart(sourceFile);\n            var width = node.getWidth(sourceFile);\n            if (ts.isStringLiteralLike(node)) {\n                // Exclude the quotes\n                start += 1;\n                width -= 2;\n            }\n            return ts.createTextSpan(start, width);\n        }\n        function nodeIsEligibleForRename(node) {\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                case 79 /* PrivateIdentifier */:\n                case 10 /* StringLiteral */:\n                case 14 /* NoSubstitutionTemplateLiteral */:\n                case 107 /* ThisKeyword */:\n                    return true;\n                case 8 /* NumericLiteral */:\n                    return ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node);\n                default:\n                    return false;\n            }\n        }\n    })(Rename = ts.Rename || (ts.Rename = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var SmartSelectionRange;\n    (function (SmartSelectionRange) {\n        function getSmartSelectionRange(pos, sourceFile) {\n            var _a;\n            var selectionRange = {\n                textSpan: ts.createTextSpanFromBounds(sourceFile.getFullStart(), sourceFile.getEnd())\n            };\n            var parentNode = sourceFile;\n            outer: while (true) {\n                var children = getSelectionChildren(parentNode);\n                if (!children.length)\n                    break;\n                for (var i = 0; i < children.length; i++) {\n                    var prevNode = children[i - 1];\n                    var node = children[i];\n                    var nextNode = children[i + 1];\n                    if (ts.getTokenPosOfNode(node, sourceFile, /*includeJsDoc*/ true) > pos) {\n                        break outer;\n                    }\n                    if (positionShouldSnapToNode(sourceFile, pos, node)) {\n                        // 1. Blocks are effectively redundant with SyntaxLists.\n                        // 2. TemplateSpans, along with the SyntaxLists containing them, are a somewhat unintuitive grouping\n                        //    of things that should be considered independently.\n                        // 3. A VariableStatement’s children are just a VaraiableDeclarationList and a semicolon.\n                        // 4. A lone VariableDeclaration in a VaraibleDeclaration feels redundant with the VariableStatement.\n                        // Dive in without pushing a selection range.\n                        if (ts.isBlock(node)\n                            || ts.isTemplateSpan(node) || ts.isTemplateHead(node) || ts.isTemplateTail(node)\n                            || prevNode && ts.isTemplateHead(prevNode)\n                            || ts.isVariableDeclarationList(node) && ts.isVariableStatement(parentNode)\n                            || ts.isSyntaxList(node) && ts.isVariableDeclarationList(parentNode)\n                            || ts.isVariableDeclaration(node) && ts.isSyntaxList(parentNode) && children.length === 1\n                            || ts.isJSDocTypeExpression(node) || ts.isJSDocSignature(node) || ts.isJSDocTypeLiteral(node)) {\n                            parentNode = node;\n                            break;\n                        }\n                        // Synthesize a stop for '${ ... }' since '${' and '}' actually belong to siblings.\n                        if (ts.isTemplateSpan(parentNode) && nextNode && ts.isTemplateMiddleOrTemplateTail(nextNode)) {\n                            var start_2 = node.getFullStart() - \"${\".length;\n                            var end_2 = nextNode.getStart() + \"}\".length;\n                            pushSelectionRange(start_2, end_2);\n                        }\n                        // Blocks with braces, brackets, parens, or JSX tags on separate lines should be\n                        // selected from open to close, including whitespace but not including the braces/etc. themselves.\n                        var isBetweenMultiLineBookends = ts.isSyntaxList(node) && isListOpener(prevNode) && isListCloser(nextNode)\n                            && !ts.positionsAreOnSameLine(prevNode.getStart(), nextNode.getStart(), sourceFile);\n                        var start = isBetweenMultiLineBookends ? prevNode.getEnd() : node.getStart();\n                        var end = isBetweenMultiLineBookends ? nextNode.getStart() : getEndPos(sourceFile, node);\n                        if (ts.hasJSDocNodes(node) && ((_a = node.jsDoc) === null || _a === void 0 ? void 0 : _a.length)) {\n                            pushSelectionRange(ts.first(node.jsDoc).getStart(), end);\n                        }\n                        pushSelectionRange(start, end);\n                        // String literals should have a stop both inside and outside their quotes.\n                        if (ts.isStringLiteral(node) || ts.isTemplateLiteral(node)) {\n                            pushSelectionRange(start + 1, end - 1);\n                        }\n                        parentNode = node;\n                        break;\n                    }\n                    // If we made it to the end of the for loop, we’re done.\n                    // In practice, I’ve only seen this happen at the very end\n                    // of a SourceFile.\n                    if (i === children.length - 1) {\n                        break outer;\n                    }\n                }\n            }\n            return selectionRange;\n            function pushSelectionRange(start, end) {\n                // Skip empty ranges\n                if (start !== end) {\n                    var textSpan = ts.createTextSpanFromBounds(start, end);\n                    if (!selectionRange || (\n                    // Skip ranges that are identical to the parent\n                    !ts.textSpansEqual(textSpan, selectionRange.textSpan) &&\n                        // Skip ranges that don’t contain the original position\n                        ts.textSpanIntersectsWithPosition(textSpan, pos))) {\n                        selectionRange = __assign({ textSpan: textSpan }, selectionRange && { parent: selectionRange });\n                    }\n                }\n            }\n        }\n        SmartSelectionRange.getSmartSelectionRange = getSmartSelectionRange;\n        /**\n         * Like `ts.positionBelongsToNode`, except positions immediately after nodes\n         * count too, unless that position belongs to the next node. In effect, makes\n         * selections able to snap to preceding tokens when the cursor is on the tail\n         * end of them with only whitespace ahead.\n         * @param sourceFile The source file containing the nodes.\n         * @param pos The position to check.\n         * @param node The candidate node to snap to.\n         */\n        function positionShouldSnapToNode(sourceFile, pos, node) {\n            // Can’t use 'ts.positionBelongsToNode()' here because it cleverly accounts\n            // for missing nodes, which can’t really be considered when deciding what\n            // to select.\n            ts.Debug.assert(node.pos <= pos);\n            if (pos < node.end) {\n                return true;\n            }\n            var nodeEnd = node.getEnd();\n            if (nodeEnd === pos) {\n                return ts.getTouchingPropertyName(sourceFile, pos).pos < node.end;\n            }\n            return false;\n        }\n        var isImport = ts.or(ts.isImportDeclaration, ts.isImportEqualsDeclaration);\n        /**\n         * Gets the children of a node to be considered for selection ranging,\n         * transforming them into an artificial tree according to their intuitive\n         * grouping where no grouping actually exists in the parse tree. For example,\n         * top-level imports are grouped into their own SyntaxList so they can be\n         * selected all together, even though in the AST they’re just siblings of each\n         * other as well as of other top-level statements and declarations.\n         */\n        function getSelectionChildren(node) {\n            // Group top-level imports\n            if (ts.isSourceFile(node)) {\n                return groupChildren(node.getChildAt(0).getChildren(), isImport);\n            }\n            // Mapped types _look_ like ObjectTypes with a single member,\n            // but in fact don’t contain a SyntaxList or a node containing\n            // the “key/value” pair like ObjectTypes do, but it seems intuitive\n            // that the selection would snap to those points. The philosophy\n            // of choosing a selection range is not so much about what the\n            // syntax currently _is_ as what the syntax might easily become\n            // if the user is making a selection; e.g., we synthesize a selection\n            // around the “key/value” pair not because there’s a node there, but\n            // because it allows the mapped type to become an object type with a\n            // few keystrokes.\n            if (ts.isMappedTypeNode(node)) {\n                var _a = node.getChildren(), openBraceToken = _a[0], children = _a.slice(1);\n                var closeBraceToken = ts.Debug.checkDefined(children.pop());\n                ts.Debug.assertEqual(openBraceToken.kind, 18 /* OpenBraceToken */);\n                ts.Debug.assertEqual(closeBraceToken.kind, 19 /* CloseBraceToken */);\n                // Group `-/+readonly` and `-/+?`\n                var groupedWithPlusMinusTokens = groupChildren(children, function (child) {\n                    return child === node.readonlyToken || child.kind === 142 /* ReadonlyKeyword */ ||\n                        child === node.questionToken || child.kind === 57 /* QuestionToken */;\n                });\n                // Group type parameter with surrounding brackets\n                var groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, function (_a) {\n                    var kind = _a.kind;\n                    return kind === 22 /* OpenBracketToken */ ||\n                        kind === 159 /* TypeParameter */ ||\n                        kind === 23 /* CloseBracketToken */;\n                });\n                return [\n                    openBraceToken,\n                    // Pivot on `:`\n                    createSyntaxList(splitChildren(groupedWithBrackets, function (_a) {\n                        var kind = _a.kind;\n                        return kind === 58 /* ColonToken */;\n                    })),\n                    closeBraceToken,\n                ];\n            }\n            // Group modifiers and property name, then pivot on `:`.\n            if (ts.isPropertySignature(node)) {\n                var children = groupChildren(node.getChildren(), function (child) {\n                    return child === node.name || ts.contains(node.modifiers, child);\n                });\n                return splitChildren(children, function (_a) {\n                    var kind = _a.kind;\n                    return kind === 58 /* ColonToken */;\n                });\n            }\n            // Group the parameter name with its `...`, then that group with its `?`, then pivot on `=`.\n            if (ts.isParameter(node)) {\n                var groupedDotDotDotAndName_1 = groupChildren(node.getChildren(), function (child) {\n                    return child === node.dotDotDotToken || child === node.name;\n                });\n                var groupedWithQuestionToken = groupChildren(groupedDotDotDotAndName_1, function (child) {\n                    return child === groupedDotDotDotAndName_1[0] || child === node.questionToken;\n                });\n                return splitChildren(groupedWithQuestionToken, function (_a) {\n                    var kind = _a.kind;\n                    return kind === 62 /* EqualsToken */;\n                });\n            }\n            // Pivot on '='\n            if (ts.isBindingElement(node)) {\n                return splitChildren(node.getChildren(), function (_a) {\n                    var kind = _a.kind;\n                    return kind === 62 /* EqualsToken */;\n                });\n            }\n            return node.getChildren();\n        }\n        /**\n         * Groups sibling nodes together into their own SyntaxList if they\n         * a) are adjacent, AND b) match a predicate function.\n         */\n        function groupChildren(children, groupOn) {\n            var result = [];\n            var group;\n            for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {\n                var child = children_1[_i];\n                if (groupOn(child)) {\n                    group = group || [];\n                    group.push(child);\n                }\n                else {\n                    if (group) {\n                        result.push(createSyntaxList(group));\n                        group = undefined;\n                    }\n                    result.push(child);\n                }\n            }\n            if (group) {\n                result.push(createSyntaxList(group));\n            }\n            return result;\n        }\n        /**\n         * Splits sibling nodes into up to four partitions:\n         * 1) everything left of the first node matched by `pivotOn`,\n         * 2) the first node matched by `pivotOn`,\n         * 3) everything right of the first node matched by `pivotOn`,\n         * 4) a trailing semicolon, if `separateTrailingSemicolon` is enabled.\n         * The left and right groups, if not empty, will each be grouped into their own containing SyntaxList.\n         * @param children The sibling nodes to split.\n         * @param pivotOn The predicate function to match the node to be the pivot. The first node that matches\n         * the predicate will be used; any others that may match will be included into the right-hand group.\n         * @param separateTrailingSemicolon If the last token is a semicolon, it will be returned as a separate\n         * child rather than be included in the right-hand group.\n         */\n        function splitChildren(children, pivotOn, separateTrailingSemicolon) {\n            if (separateTrailingSemicolon === void 0) { separateTrailingSemicolon = true; }\n            if (children.length < 2) {\n                return children;\n            }\n            var splitTokenIndex = ts.findIndex(children, pivotOn);\n            if (splitTokenIndex === -1) {\n                return children;\n            }\n            var leftChildren = children.slice(0, splitTokenIndex);\n            var splitToken = children[splitTokenIndex];\n            var lastToken = ts.last(children);\n            var separateLastToken = separateTrailingSemicolon && lastToken.kind === 26 /* SemicolonToken */;\n            var rightChildren = children.slice(splitTokenIndex + 1, separateLastToken ? children.length - 1 : undefined);\n            var result = ts.compact([\n                leftChildren.length ? createSyntaxList(leftChildren) : undefined,\n                splitToken,\n                rightChildren.length ? createSyntaxList(rightChildren) : undefined,\n            ]);\n            return separateLastToken ? result.concat(lastToken) : result;\n        }\n        function createSyntaxList(children) {\n            ts.Debug.assertGreaterThanOrEqual(children.length, 1);\n            return ts.setTextRangePosEnd(ts.parseNodeFactory.createSyntaxList(children), children[0].pos, ts.last(children).end);\n        }\n        function isListOpener(token) {\n            var kind = token && token.kind;\n            return kind === 18 /* OpenBraceToken */\n                || kind === 22 /* OpenBracketToken */\n                || kind === 20 /* OpenParenToken */\n                || kind === 275 /* JsxOpeningElement */;\n        }\n        function isListCloser(token) {\n            var kind = token && token.kind;\n            return kind === 19 /* CloseBraceToken */\n                || kind === 23 /* CloseBracketToken */\n                || kind === 21 /* CloseParenToken */\n                || kind === 276 /* JsxClosingElement */;\n        }\n        function getEndPos(sourceFile, node) {\n            switch (node.kind) {\n                case 326 /* JSDocParameterTag */:\n                case 324 /* JSDocCallbackTag */:\n                case 333 /* JSDocPropertyTag */:\n                case 331 /* JSDocTypedefTag */:\n                case 328 /* JSDocThisTag */:\n                    return sourceFile.getLineEndOfPosition(node.getStart());\n                default:\n                    return node.getEnd();\n            }\n        }\n    })(SmartSelectionRange = ts.SmartSelectionRange || (ts.SmartSelectionRange = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var SignatureHelp;\n    (function (SignatureHelp) {\n        var InvocationKind;\n        (function (InvocationKind) {\n            InvocationKind[InvocationKind[\"Call\"] = 0] = \"Call\";\n            InvocationKind[InvocationKind[\"TypeArgs\"] = 1] = \"TypeArgs\";\n            InvocationKind[InvocationKind[\"Contextual\"] = 2] = \"Contextual\";\n        })(InvocationKind || (InvocationKind = {}));\n        function getSignatureHelpItems(program, sourceFile, position, triggerReason, cancellationToken) {\n            var typeChecker = program.getTypeChecker();\n            // Decide whether to show signature help\n            var startingToken = ts.findTokenOnLeftOfPosition(sourceFile, position);\n            if (!startingToken) {\n                // We are at the beginning of the file\n                return undefined;\n            }\n            // Only need to be careful if the user typed a character and signature help wasn't showing.\n            var onlyUseSyntacticOwners = !!triggerReason && triggerReason.kind === \"characterTyped\";\n            // Bail out quickly in the middle of a string or comment, don't provide signature help unless the user explicitly requested it.\n            if (onlyUseSyntacticOwners && (ts.isInString(sourceFile, position, startingToken) || ts.isInComment(sourceFile, position))) {\n                return undefined;\n            }\n            var isManuallyInvoked = !!triggerReason && triggerReason.kind === \"invoked\";\n            var argumentInfo = getContainingArgumentInfo(startingToken, position, sourceFile, typeChecker, isManuallyInvoked);\n            if (!argumentInfo)\n                return undefined;\n            cancellationToken.throwIfCancellationRequested();\n            // Extra syntactic and semantic filtering of signature help\n            var candidateInfo = getCandidateOrTypeInfo(argumentInfo, typeChecker, sourceFile, startingToken, onlyUseSyntacticOwners);\n            cancellationToken.throwIfCancellationRequested();\n            if (!candidateInfo) {\n                // We didn't have any sig help items produced by the TS compiler.  If this is a JS\n                // file, then see if we can figure out anything better.\n                return ts.isSourceFileJS(sourceFile) ? createJSSignatureHelpItems(argumentInfo, program, cancellationToken) : undefined;\n            }\n            return typeChecker.runWithCancellationToken(cancellationToken, function (typeChecker) {\n                return candidateInfo.kind === 0 /* Candidate */\n                    ? createSignatureHelpItems(candidateInfo.candidates, candidateInfo.resolvedSignature, argumentInfo, sourceFile, typeChecker)\n                    : createTypeHelpItems(candidateInfo.symbol, argumentInfo, sourceFile, typeChecker);\n            });\n        }\n        SignatureHelp.getSignatureHelpItems = getSignatureHelpItems;\n        var CandidateOrTypeKind;\n        (function (CandidateOrTypeKind) {\n            CandidateOrTypeKind[CandidateOrTypeKind[\"Candidate\"] = 0] = \"Candidate\";\n            CandidateOrTypeKind[CandidateOrTypeKind[\"Type\"] = 1] = \"Type\";\n        })(CandidateOrTypeKind || (CandidateOrTypeKind = {}));\n        function getCandidateOrTypeInfo(_a, checker, sourceFile, startingToken, onlyUseSyntacticOwners) {\n            var invocation = _a.invocation, argumentCount = _a.argumentCount;\n            switch (invocation.kind) {\n                case 0 /* Call */: {\n                    if (onlyUseSyntacticOwners && !isSyntacticOwner(startingToken, invocation.node, sourceFile)) {\n                        return undefined;\n                    }\n                    var candidates = [];\n                    var resolvedSignature = checker.getResolvedSignatureForSignatureHelp(invocation.node, candidates, argumentCount); // TODO: GH#18217\n                    return candidates.length === 0 ? undefined : { kind: 0 /* Candidate */, candidates: candidates, resolvedSignature: resolvedSignature };\n                }\n                case 1 /* TypeArgs */: {\n                    var called = invocation.called;\n                    if (onlyUseSyntacticOwners && !containsPrecedingToken(startingToken, sourceFile, ts.isIdentifier(called) ? called.parent : called)) {\n                        return undefined;\n                    }\n                    var candidates = ts.getPossibleGenericSignatures(called, argumentCount, checker);\n                    if (candidates.length !== 0)\n                        return { kind: 0 /* Candidate */, candidates: candidates, resolvedSignature: ts.first(candidates) };\n                    var symbol = checker.getSymbolAtLocation(called);\n                    return symbol && { kind: 1 /* Type */, symbol: symbol };\n                }\n                case 2 /* Contextual */:\n                    return { kind: 0 /* Candidate */, candidates: [invocation.signature], resolvedSignature: invocation.signature };\n                default:\n                    return ts.Debug.assertNever(invocation);\n            }\n        }\n        function isSyntacticOwner(startingToken, node, sourceFile) {\n            if (!ts.isCallOrNewExpression(node))\n                return false;\n            var invocationChildren = node.getChildren(sourceFile);\n            switch (startingToken.kind) {\n                case 20 /* OpenParenToken */:\n                    return ts.contains(invocationChildren, startingToken);\n                case 27 /* CommaToken */: {\n                    var containingList = ts.findContainingList(startingToken);\n                    return !!containingList && ts.contains(invocationChildren, containingList);\n                }\n                case 29 /* LessThanToken */:\n                    return containsPrecedingToken(startingToken, sourceFile, node.expression);\n                default:\n                    return false;\n            }\n        }\n        function createJSSignatureHelpItems(argumentInfo, program, cancellationToken) {\n            if (argumentInfo.invocation.kind === 2 /* Contextual */)\n                return undefined;\n            // See if we can find some symbol with the call expression name that has call signatures.\n            var expression = getExpressionFromInvocation(argumentInfo.invocation);\n            var name = ts.isPropertyAccessExpression(expression) ? expression.name.text : undefined;\n            var typeChecker = program.getTypeChecker();\n            return name === undefined ? undefined : ts.firstDefined(program.getSourceFiles(), function (sourceFile) {\n                return ts.firstDefined(sourceFile.getNamedDeclarations().get(name), function (declaration) {\n                    var type = declaration.symbol && typeChecker.getTypeOfSymbolAtLocation(declaration.symbol, declaration);\n                    var callSignatures = type && type.getCallSignatures();\n                    if (callSignatures && callSignatures.length) {\n                        return typeChecker.runWithCancellationToken(cancellationToken, function (typeChecker) { return createSignatureHelpItems(callSignatures, callSignatures[0], argumentInfo, sourceFile, typeChecker, \n                        /*useFullPrefix*/ true); });\n                    }\n                });\n            });\n        }\n        function containsPrecedingToken(startingToken, sourceFile, container) {\n            var pos = startingToken.getFullStart();\n            // There’s a possibility that `startingToken.parent` contains only `startingToken` and\n            // missing nodes, none of which are valid to be returned by `findPrecedingToken`. In that\n            // case, the preceding token we want is actually higher up the tree—almost definitely the\n            // next parent, but theoretically the situation with missing nodes might be happening on\n            // multiple nested levels.\n            var currentParent = startingToken.parent;\n            while (currentParent) {\n                var precedingToken = ts.findPrecedingToken(pos, sourceFile, currentParent, /*excludeJsdoc*/ true);\n                if (precedingToken) {\n                    return ts.rangeContainsRange(container, precedingToken);\n                }\n                currentParent = currentParent.parent;\n            }\n            return ts.Debug.fail(\"Could not find preceding token\");\n        }\n        function getArgumentInfoForCompletions(node, position, sourceFile) {\n            var info = getImmediatelyContainingArgumentInfo(node, position, sourceFile);\n            return !info || info.isTypeParameterList || info.invocation.kind !== 0 /* Call */ ? undefined\n                : { invocation: info.invocation.node, argumentCount: info.argumentCount, argumentIndex: info.argumentIndex };\n        }\n        SignatureHelp.getArgumentInfoForCompletions = getArgumentInfoForCompletions;\n        function getArgumentOrParameterListInfo(node, sourceFile) {\n            var info = getArgumentOrParameterListAndIndex(node, sourceFile);\n            if (!info)\n                return undefined;\n            var list = info.list, argumentIndex = info.argumentIndex;\n            var argumentCount = getArgumentCount(list);\n            if (argumentIndex !== 0) {\n                ts.Debug.assertLessThan(argumentIndex, argumentCount);\n            }\n            var argumentsSpan = getApplicableSpanForArguments(list, sourceFile);\n            return { list: list, argumentIndex: argumentIndex, argumentCount: argumentCount, argumentsSpan: argumentsSpan };\n        }\n        function getArgumentOrParameterListAndIndex(node, sourceFile) {\n            if (node.kind === 29 /* LessThanToken */ || node.kind === 20 /* OpenParenToken */) {\n                // Find the list that starts right *after* the < or ( token.\n                // If the user has just opened a list, consider this item 0.\n                return { list: getChildListThatStartsWithOpenerToken(node.parent, node, sourceFile), argumentIndex: 0 };\n            }\n            else {\n                // findListItemInfo can return undefined if we are not in parent's argument list\n                // or type argument list. This includes cases where the cursor is:\n                //   - To the right of the closing parenthesis, non-substitution template, or template tail.\n                //   - Between the type arguments and the arguments (greater than token)\n                //   - On the target of the call (parent.func)\n                //   - On the 'new' keyword in a 'new' expression\n                var list = ts.findContainingList(node);\n                return list && { list: list, argumentIndex: getArgumentIndex(list, node) };\n            }\n        }\n        /**\n         * Returns relevant information for the argument list and the current argument if we are\n         * in the argument of an invocation; returns undefined otherwise.\n         */\n        function getImmediatelyContainingArgumentInfo(node, position, sourceFile) {\n            var parent = node.parent;\n            if (ts.isCallOrNewExpression(parent)) {\n                var invocation = parent;\n                // There are 3 cases to handle:\n                //   1. The token introduces a list, and should begin a signature help session\n                //   2. The token is either not associated with a list, or ends a list, so the session should end\n                //   3. The token is buried inside a list, and should give signature help\n                //\n                // The following are examples of each:\n                //\n                //    Case 1:\n                //          foo<#T, U>(#a, b)    -> The token introduces a list, and should begin a signature help session\n                //    Case 2:\n                //          fo#o<T, U>#(a, b)#   -> The token is either not associated with a list, or ends a list, so the session should end\n                //    Case 3:\n                //          foo<T#, U#>(a#, #b#) -> The token is buried inside a list, and should give signature help\n                // Find out if 'node' is an argument, a type argument, or neither\n                var info = getArgumentOrParameterListInfo(node, sourceFile);\n                if (!info)\n                    return undefined;\n                var list = info.list, argumentIndex = info.argumentIndex, argumentCount = info.argumentCount, argumentsSpan = info.argumentsSpan;\n                var isTypeParameterList = !!parent.typeArguments && parent.typeArguments.pos === list.pos;\n                return { isTypeParameterList: isTypeParameterList, invocation: { kind: 0 /* Call */, node: invocation }, argumentsSpan: argumentsSpan, argumentIndex: argumentIndex, argumentCount: argumentCount };\n            }\n            else if (ts.isNoSubstitutionTemplateLiteral(node) && ts.isTaggedTemplateExpression(parent)) {\n                // Check if we're actually inside the template;\n                // otherwise we'll fall out and return undefined.\n                if (ts.isInsideTemplateLiteral(node, position, sourceFile)) {\n                    return getArgumentListInfoForTemplate(parent, /*argumentIndex*/ 0, sourceFile);\n                }\n                return undefined;\n            }\n            else if (ts.isTemplateHead(node) && parent.parent.kind === 205 /* TaggedTemplateExpression */) {\n                var templateExpression = parent;\n                var tagExpression = templateExpression.parent;\n                ts.Debug.assert(templateExpression.kind === 218 /* TemplateExpression */);\n                var argumentIndex = ts.isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1;\n                return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile);\n            }\n            else if (ts.isTemplateSpan(parent) && ts.isTaggedTemplateExpression(parent.parent.parent)) {\n                var templateSpan = parent;\n                var tagExpression = parent.parent.parent;\n                // If we're just after a template tail, don't show signature help.\n                if (ts.isTemplateTail(node) && !ts.isInsideTemplateLiteral(node, position, sourceFile)) {\n                    return undefined;\n                }\n                var spanIndex = templateSpan.parent.templateSpans.indexOf(templateSpan);\n                var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node, position, sourceFile);\n                return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile);\n            }\n            else if (ts.isJsxOpeningLikeElement(parent)) {\n                // Provide a signature help for JSX opening element or JSX self-closing element.\n                // This is not guarantee that JSX tag-name is resolved into stateless function component. (that is done in \"getSignatureHelpItems\")\n                // i.e\n                //      export function MainButton(props: ButtonProps, context: any): JSX.Element { ... }\n                //      <MainButton /*signatureHelp*/\n                var attributeSpanStart = parent.attributes.pos;\n                var attributeSpanEnd = ts.skipTrivia(sourceFile.text, parent.attributes.end, /*stopAfterLineBreak*/ false);\n                return {\n                    isTypeParameterList: false,\n                    invocation: { kind: 0 /* Call */, node: parent },\n                    argumentsSpan: ts.createTextSpan(attributeSpanStart, attributeSpanEnd - attributeSpanStart),\n                    argumentIndex: 0,\n                    argumentCount: 1\n                };\n            }\n            else {\n                var typeArgInfo = ts.getPossibleTypeArgumentsInfo(node, sourceFile);\n                if (typeArgInfo) {\n                    var called = typeArgInfo.called, nTypeArguments = typeArgInfo.nTypeArguments;\n                    var invocation = { kind: 1 /* TypeArgs */, called: called };\n                    var argumentsSpan = ts.createTextSpanFromBounds(called.getStart(sourceFile), node.end);\n                    return { isTypeParameterList: true, invocation: invocation, argumentsSpan: argumentsSpan, argumentIndex: nTypeArguments, argumentCount: nTypeArguments + 1 };\n                }\n                return undefined;\n            }\n        }\n        function getImmediatelyContainingArgumentOrContextualParameterInfo(node, position, sourceFile, checker) {\n            return tryGetParameterInfo(node, position, sourceFile, checker) || getImmediatelyContainingArgumentInfo(node, position, sourceFile);\n        }\n        function getHighestBinary(b) {\n            return ts.isBinaryExpression(b.parent) ? getHighestBinary(b.parent) : b;\n        }\n        function countBinaryExpressionParameters(b) {\n            return ts.isBinaryExpression(b.left) ? countBinaryExpressionParameters(b.left) + 1 : 2;\n        }\n        function tryGetParameterInfo(startingToken, _position, sourceFile, checker) {\n            var info = getContextualSignatureLocationInfo(startingToken, sourceFile, checker);\n            if (!info)\n                return undefined;\n            var contextualType = info.contextualType, argumentIndex = info.argumentIndex, argumentCount = info.argumentCount, argumentsSpan = info.argumentsSpan;\n            // for optional function condition.\n            var nonNullableContextualType = contextualType.getNonNullableType();\n            var signatures = nonNullableContextualType.getCallSignatures();\n            if (signatures.length !== 1)\n                return undefined;\n            var invocation = { kind: 2 /* Contextual */, signature: ts.first(signatures), node: startingToken, symbol: chooseBetterSymbol(nonNullableContextualType.symbol) };\n            return { isTypeParameterList: false, invocation: invocation, argumentsSpan: argumentsSpan, argumentIndex: argumentIndex, argumentCount: argumentCount };\n        }\n        function getContextualSignatureLocationInfo(startingToken, sourceFile, checker) {\n            if (startingToken.kind !== 20 /* OpenParenToken */ && startingToken.kind !== 27 /* CommaToken */)\n                return undefined;\n            var parent = startingToken.parent;\n            switch (parent.kind) {\n                case 207 /* ParenthesizedExpression */:\n                case 165 /* MethodDeclaration */:\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                    var info = getArgumentOrParameterListInfo(startingToken, sourceFile);\n                    if (!info)\n                        return undefined;\n                    var argumentIndex = info.argumentIndex, argumentCount = info.argumentCount, argumentsSpan = info.argumentsSpan;\n                    var contextualType = ts.isMethodDeclaration(parent) ? checker.getContextualTypeForObjectLiteralElement(parent) : checker.getContextualType(parent);\n                    return contextualType && { contextualType: contextualType, argumentIndex: argumentIndex, argumentCount: argumentCount, argumentsSpan: argumentsSpan };\n                case 216 /* BinaryExpression */: {\n                    var highestBinary = getHighestBinary(parent);\n                    var contextualType_1 = checker.getContextualType(highestBinary);\n                    var argumentIndex_1 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent) - 1;\n                    var argumentCount_1 = countBinaryExpressionParameters(highestBinary);\n                    return contextualType_1 && { contextualType: contextualType_1, argumentIndex: argumentIndex_1, argumentCount: argumentCount_1, argumentsSpan: ts.createTextSpanFromNode(parent) };\n                }\n                default:\n                    return undefined;\n            }\n        }\n        // The type of a function type node has a symbol at that node, but it's better to use the symbol for a parameter or type alias.\n        function chooseBetterSymbol(s) {\n            return s.name === \"__type\" /* Type */\n                ? ts.firstDefined(s.declarations, function (d) { return ts.isFunctionTypeNode(d) ? d.parent.symbol : undefined; }) || s\n                : s;\n        }\n        function getArgumentIndex(argumentsList, node) {\n            // The list we got back can include commas.  In the presence of errors it may\n            // also just have nodes without commas.  For example \"Foo(a b c)\" will have 3\n            // args without commas. We want to find what index we're at.  So we count\n            // forward until we hit ourselves, only incrementing the index if it isn't a\n            // comma.\n            //\n            // Note: the subtlety around trailing commas (in getArgumentCount) does not apply\n            // here.  That's because we're only walking forward until we hit the node we're\n            // on.  In that case, even if we're after the trailing comma, we'll still see\n            // that trailing comma in the list, and we'll have generated the appropriate\n            // arg index.\n            var argumentIndex = 0;\n            for (var _i = 0, _a = argumentsList.getChildren(); _i < _a.length; _i++) {\n                var child = _a[_i];\n                if (child === node) {\n                    break;\n                }\n                if (child.kind !== 27 /* CommaToken */) {\n                    argumentIndex++;\n                }\n            }\n            return argumentIndex;\n        }\n        function getArgumentCount(argumentsList) {\n            // The argument count for a list is normally the number of non-comma children it has.\n            // For example, if you have \"Foo(a,b)\" then there will be three children of the arg\n            // list 'a' '<comma>' 'b'.  So, in this case the arg count will be 2.  However, there\n            // is a small subtlety.  If you have \"Foo(a,)\", then the child list will just have\n            // 'a' '<comma>'.  So, in the case where the last child is a comma, we increase the\n            // arg count by one to compensate.\n            //\n            // Note: this subtlety only applies to the last comma.  If you had \"Foo(a,,\" then\n            // we'll have: 'a' '<comma>' '<missing>'\n            // That will give us 2 non-commas.  We then add one for the last comma, giving us an\n            // arg count of 3.\n            var listChildren = argumentsList.getChildren();\n            var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 27 /* CommaToken */; });\n            if (listChildren.length > 0 && ts.last(listChildren).kind === 27 /* CommaToken */) {\n                argumentCount++;\n            }\n            return argumentCount;\n        }\n        // spanIndex is either the index for a given template span.\n        // This does not give appropriate results for a NoSubstitutionTemplateLiteral\n        function getArgumentIndexForTemplatePiece(spanIndex, node, position, sourceFile) {\n            // Because the TemplateStringsArray is the first argument, we have to offset each substitution expression by 1.\n            // There are three cases we can encounter:\n            //      1. We are precisely in the template literal (argIndex = 0).\n            //      2. We are in or to the right of the substitution expression (argIndex = spanIndex + 1).\n            //      3. We are directly to the right of the template literal, but because we look for the token on the left,\n            //          not enough to put us in the substitution expression; we should consider ourselves part of\n            //          the *next* span's expression by offsetting the index (argIndex = (spanIndex + 1) + 1).\n            //\n            /* eslint-disable no-double-space */\n            // Example: f  `# abcd $#{#  1 + 1#  }# efghi ${ #\"#hello\"#  }  #  `\n            //              ^       ^ ^       ^   ^          ^ ^      ^     ^\n            // Case:        1       1 3       2   1          3 2      2     1\n            /* eslint-enable no-double-space */\n            ts.Debug.assert(position >= node.getStart(), \"Assumed 'position' could not occur before node.\");\n            if (ts.isTemplateLiteralToken(node)) {\n                if (ts.isInsideTemplateLiteral(node, position, sourceFile)) {\n                    return 0;\n                }\n                return spanIndex + 2;\n            }\n            return spanIndex + 1;\n        }\n        function getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile) {\n            // argumentCount is either 1 or (numSpans + 1) to account for the template strings array argument.\n            var argumentCount = ts.isNoSubstitutionTemplateLiteral(tagExpression.template) ? 1 : tagExpression.template.templateSpans.length + 1;\n            if (argumentIndex !== 0) {\n                ts.Debug.assertLessThan(argumentIndex, argumentCount);\n            }\n            return {\n                isTypeParameterList: false,\n                invocation: { kind: 0 /* Call */, node: tagExpression },\n                argumentsSpan: getApplicableSpanForTaggedTemplate(tagExpression, sourceFile),\n                argumentIndex: argumentIndex,\n                argumentCount: argumentCount\n            };\n        }\n        function getApplicableSpanForArguments(argumentsList, sourceFile) {\n            // We use full start and skip trivia on the end because we want to include trivia on\n            // both sides. For example,\n            //\n            //    foo(   /*comment */     a, b, c      /*comment*/     )\n            //        |                                               |\n            //\n            // The applicable span is from the first bar to the second bar (inclusive,\n            // but not including parentheses)\n            var applicableSpanStart = argumentsList.getFullStart();\n            var applicableSpanEnd = ts.skipTrivia(sourceFile.text, argumentsList.getEnd(), /*stopAfterLineBreak*/ false);\n            return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart);\n        }\n        function getApplicableSpanForTaggedTemplate(taggedTemplate, sourceFile) {\n            var template = taggedTemplate.template;\n            var applicableSpanStart = template.getStart();\n            var applicableSpanEnd = template.getEnd();\n            // We need to adjust the end position for the case where the template does not have a tail.\n            // Otherwise, we will not show signature help past the expression.\n            // For example,\n            //\n            //      ` ${ 1 + 1 foo(10)\n            //       |       |\n            // This is because a Missing node has no width. However, what we actually want is to include trivia\n            // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail.\n            if (template.kind === 218 /* TemplateExpression */) {\n                var lastSpan = ts.last(template.templateSpans);\n                if (lastSpan.literal.getFullWidth() === 0) {\n                    applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false);\n                }\n            }\n            return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart);\n        }\n        function getContainingArgumentInfo(node, position, sourceFile, checker, isManuallyInvoked) {\n            var _loop_7 = function (n) {\n                // If the node is not a subspan of its parent, this is a big problem.\n                // There have been crashes that might be caused by this violation.\n                ts.Debug.assert(ts.rangeContainsRange(n.parent, n), \"Not a subspan\", function () { return \"Child: \" + ts.Debug.formatSyntaxKind(n.kind) + \", parent: \" + ts.Debug.formatSyntaxKind(n.parent.kind); });\n                var argumentInfo = getImmediatelyContainingArgumentOrContextualParameterInfo(n, position, sourceFile, checker);\n                if (argumentInfo) {\n                    return { value: argumentInfo };\n                }\n            };\n            for (var n = node; !ts.isSourceFile(n) && (isManuallyInvoked || !ts.isBlock(n)); n = n.parent) {\n                var state_2 = _loop_7(n);\n                if (typeof state_2 === \"object\")\n                    return state_2.value;\n            }\n            return undefined;\n        }\n        function getChildListThatStartsWithOpenerToken(parent, openerToken, sourceFile) {\n            var children = parent.getChildren(sourceFile);\n            var indexOfOpenerToken = children.indexOf(openerToken);\n            ts.Debug.assert(indexOfOpenerToken >= 0 && children.length > indexOfOpenerToken + 1);\n            return children[indexOfOpenerToken + 1];\n        }\n        function getExpressionFromInvocation(invocation) {\n            return invocation.kind === 0 /* Call */ ? ts.getInvokedExpression(invocation.node) : invocation.called;\n        }\n        function getEnclosingDeclarationFromInvocation(invocation) {\n            return invocation.kind === 0 /* Call */ ? invocation.node : invocation.kind === 1 /* TypeArgs */ ? invocation.called : invocation.node;\n        }\n        var signatureHelpNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 70221824 /* IgnoreErrors */ | 16384 /* UseAliasDefinedOutsideCurrentScope */;\n        function createSignatureHelpItems(candidates, resolvedSignature, _a, sourceFile, typeChecker, useFullPrefix) {\n            var _b;\n            var isTypeParameterList = _a.isTypeParameterList, argumentCount = _a.argumentCount, applicableSpan = _a.argumentsSpan, invocation = _a.invocation, argumentIndex = _a.argumentIndex;\n            var enclosingDeclaration = getEnclosingDeclarationFromInvocation(invocation);\n            var callTargetSymbol = invocation.kind === 2 /* Contextual */ ? invocation.symbol : (typeChecker.getSymbolAtLocation(getExpressionFromInvocation(invocation)) || useFullPrefix && ((_b = resolvedSignature.declaration) === null || _b === void 0 ? void 0 : _b.symbol));\n            var callTargetDisplayParts = callTargetSymbol ? ts.symbolToDisplayParts(typeChecker, callTargetSymbol, useFullPrefix ? sourceFile : undefined, /*meaning*/ undefined) : ts.emptyArray;\n            var items = ts.map(candidates, function (candidateSignature) { return getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, typeChecker, enclosingDeclaration, sourceFile); });\n            if (argumentIndex !== 0) {\n                ts.Debug.assertLessThan(argumentIndex, argumentCount);\n            }\n            var selectedItemIndex = 0;\n            var itemsSeen = 0;\n            for (var i = 0; i < items.length; i++) {\n                var item = items[i];\n                if (candidates[i] === resolvedSignature) {\n                    selectedItemIndex = itemsSeen;\n                    if (item.length > 1) {\n                        // check to see if any items in the list better match than the first one, as the checker isn't filtering the nested lists\n                        // (those come from tuple parameter expansion)\n                        var count = 0;\n                        for (var _i = 0, item_1 = item; _i < item_1.length; _i++) {\n                            var i_1 = item_1[_i];\n                            if (i_1.isVariadic || i_1.parameters.length >= argumentCount) {\n                                selectedItemIndex = itemsSeen + count;\n                                break;\n                            }\n                            count++;\n                        }\n                    }\n                }\n                itemsSeen += item.length;\n            }\n            ts.Debug.assert(selectedItemIndex !== -1); // If candidates is non-empty it should always include bestSignature. We check for an empty candidates before calling this function.\n            var help = { items: ts.flatMapToMutable(items, ts.identity), applicableSpan: applicableSpan, selectedItemIndex: selectedItemIndex, argumentIndex: argumentIndex, argumentCount: argumentCount };\n            var selected = help.items[selectedItemIndex];\n            if (selected.isVariadic) {\n                var firstRest = ts.findIndex(selected.parameters, function (p) { return !!p.isRest; });\n                if (-1 < firstRest && firstRest < selected.parameters.length - 1) {\n                    // We don't have any code to get this correct; instead, don't highlight a current parameter AT ALL\n                    help.argumentIndex = selected.parameters.length;\n                }\n                else {\n                    help.argumentIndex = Math.min(help.argumentIndex, selected.parameters.length - 1);\n                }\n            }\n            return help;\n        }\n        function createTypeHelpItems(symbol, _a, sourceFile, checker) {\n            var argumentCount = _a.argumentCount, applicableSpan = _a.argumentsSpan, invocation = _a.invocation, argumentIndex = _a.argumentIndex;\n            var typeParameters = checker.getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol);\n            if (!typeParameters)\n                return undefined;\n            var items = [getTypeHelpItem(symbol, typeParameters, checker, getEnclosingDeclarationFromInvocation(invocation), sourceFile)];\n            return { items: items, applicableSpan: applicableSpan, selectedItemIndex: 0, argumentIndex: argumentIndex, argumentCount: argumentCount };\n        }\n        function getTypeHelpItem(symbol, typeParameters, checker, enclosingDeclaration, sourceFile) {\n            var typeSymbolDisplay = ts.symbolToDisplayParts(checker, symbol);\n            var printer = ts.createPrinter({ removeComments: true });\n            var parameters = typeParameters.map(function (t) { return createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer); });\n            var documentation = symbol.getDocumentationComment(checker);\n            var tags = symbol.getJsDocTags();\n            var prefixDisplayParts = __spreadArray(__spreadArray([], typeSymbolDisplay), [ts.punctuationPart(29 /* LessThanToken */)]);\n            return { isVariadic: false, prefixDisplayParts: prefixDisplayParts, suffixDisplayParts: [ts.punctuationPart(31 /* GreaterThanToken */)], separatorDisplayParts: separatorDisplayParts, parameters: parameters, documentation: documentation, tags: tags };\n        }\n        var separatorDisplayParts = [ts.punctuationPart(27 /* CommaToken */), ts.spacePart()];\n        function getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, checker, enclosingDeclaration, sourceFile) {\n            var infos = (isTypeParameterList ? itemInfoForTypeParameters : itemInfoForParameters)(candidateSignature, checker, enclosingDeclaration, sourceFile);\n            return ts.map(infos, function (_a) {\n                var isVariadic = _a.isVariadic, parameters = _a.parameters, prefix = _a.prefix, suffix = _a.suffix;\n                var prefixDisplayParts = __spreadArray(__spreadArray([], callTargetDisplayParts), prefix);\n                var suffixDisplayParts = __spreadArray(__spreadArray([], suffix), returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker));\n                var documentation = candidateSignature.getDocumentationComment(checker);\n                var tags = candidateSignature.getJsDocTags();\n                return { isVariadic: isVariadic, prefixDisplayParts: prefixDisplayParts, suffixDisplayParts: suffixDisplayParts, separatorDisplayParts: separatorDisplayParts, parameters: parameters, documentation: documentation, tags: tags };\n            });\n        }\n        function returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker) {\n            return ts.mapToDisplayParts(function (writer) {\n                writer.writePunctuation(\":\");\n                writer.writeSpace(\" \");\n                var predicate = checker.getTypePredicateOfSignature(candidateSignature);\n                if (predicate) {\n                    checker.writeTypePredicate(predicate, enclosingDeclaration, /*flags*/ undefined, writer);\n                }\n                else {\n                    checker.writeType(checker.getReturnTypeOfSignature(candidateSignature), enclosingDeclaration, /*flags*/ undefined, writer);\n                }\n            });\n        }\n        function itemInfoForTypeParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) {\n            var typeParameters = (candidateSignature.target || candidateSignature).typeParameters;\n            var printer = ts.createPrinter({ removeComments: true });\n            var parameters = (typeParameters || ts.emptyArray).map(function (t) { return createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer); });\n            var thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : [];\n            return checker.getExpandedParameters(candidateSignature).map(function (paramList) {\n                var params = ts.factory.createNodeArray(__spreadArray(__spreadArray([], thisParameter), ts.map(paramList, function (param) { return checker.symbolToParameterDeclaration(param, enclosingDeclaration, signatureHelpNodeBuilderFlags); })));\n                var parameterParts = ts.mapToDisplayParts(function (writer) {\n                    printer.writeList(2576 /* CallExpressionArguments */, params, sourceFile, writer);\n                });\n                return { isVariadic: false, parameters: parameters, prefix: [ts.punctuationPart(29 /* LessThanToken */)], suffix: __spreadArray([ts.punctuationPart(31 /* GreaterThanToken */)], parameterParts) };\n            });\n        }\n        function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) {\n            var isVariadic = checker.hasEffectiveRestParameter(candidateSignature);\n            var printer = ts.createPrinter({ removeComments: true });\n            var typeParameterParts = ts.mapToDisplayParts(function (writer) {\n                if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) {\n                    var args = ts.factory.createNodeArray(candidateSignature.typeParameters.map(function (p) { return checker.typeParameterToDeclaration(p, enclosingDeclaration, signatureHelpNodeBuilderFlags); }));\n                    printer.writeList(53776 /* TypeParameters */, args, sourceFile, writer);\n                }\n            });\n            var lists = checker.getExpandedParameters(candidateSignature);\n            return lists.map(function (parameterList) {\n                return {\n                    isVariadic: isVariadic && (lists.length === 1 || !!(parameterList[parameterList.length - 1].checkFlags & 32768 /* RestParameter */)),\n                    parameters: parameterList.map(function (p) { return createSignatureHelpParameterForParameter(p, checker, enclosingDeclaration, sourceFile, printer); }),\n                    prefix: __spreadArray(__spreadArray([], typeParameterParts), [ts.punctuationPart(20 /* OpenParenToken */)]),\n                    suffix: [ts.punctuationPart(21 /* CloseParenToken */)]\n                };\n            });\n        }\n        function createSignatureHelpParameterForParameter(parameter, checker, enclosingDeclaration, sourceFile, printer) {\n            var displayParts = ts.mapToDisplayParts(function (writer) {\n                var param = checker.symbolToParameterDeclaration(parameter, enclosingDeclaration, signatureHelpNodeBuilderFlags);\n                printer.writeNode(4 /* Unspecified */, param, sourceFile, writer);\n            });\n            var isOptional = checker.isOptionalParameter(parameter.valueDeclaration);\n            var isRest = !!(parameter.checkFlags & 32768 /* RestParameter */);\n            return { name: parameter.name, documentation: parameter.getDocumentationComment(checker), displayParts: displayParts, isOptional: isOptional, isRest: isRest };\n        }\n        function createSignatureHelpParameterForTypeParameter(typeParameter, checker, enclosingDeclaration, sourceFile, printer) {\n            var displayParts = ts.mapToDisplayParts(function (writer) {\n                var param = checker.typeParameterToDeclaration(typeParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags);\n                printer.writeNode(4 /* Unspecified */, param, sourceFile, writer);\n            });\n            return { name: typeParameter.symbol.name, documentation: typeParameter.symbol.getDocumentationComment(checker), displayParts: displayParts, isOptional: false, isRest: false };\n        }\n    })(SignatureHelp = ts.SignatureHelp || (ts.SignatureHelp = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var base64UrlRegExp = /^data:(?:application\\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+\\/=]+)$)?/;\n    function getSourceMapper(host) {\n        var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());\n        var currentDirectory = host.getCurrentDirectory();\n        var sourceFileLike = new ts.Map();\n        var documentPositionMappers = new ts.Map();\n        return { tryGetSourcePosition: tryGetSourcePosition, tryGetGeneratedPosition: tryGetGeneratedPosition, toLineColumnOffset: toLineColumnOffset, clearCache: clearCache };\n        function toPath(fileName) {\n            return ts.toPath(fileName, currentDirectory, getCanonicalFileName);\n        }\n        function getDocumentPositionMapper(generatedFileName, sourceFileName) {\n            var path = toPath(generatedFileName);\n            var value = documentPositionMappers.get(path);\n            if (value)\n                return value;\n            var mapper;\n            if (host.getDocumentPositionMapper) {\n                mapper = host.getDocumentPositionMapper(generatedFileName, sourceFileName);\n            }\n            else if (host.readFile) {\n                var file = getSourceFileLike(generatedFileName);\n                mapper = file && ts.getDocumentPositionMapper({ getSourceFileLike: getSourceFileLike, getCanonicalFileName: getCanonicalFileName, log: function (s) { return host.log(s); } }, generatedFileName, ts.getLineInfo(file.text, ts.getLineStarts(file)), function (f) { return !host.fileExists || host.fileExists(f) ? host.readFile(f) : undefined; });\n            }\n            documentPositionMappers.set(path, mapper || ts.identitySourceMapConsumer);\n            return mapper || ts.identitySourceMapConsumer;\n        }\n        function tryGetSourcePosition(info) {\n            if (!ts.isDeclarationFileName(info.fileName))\n                return undefined;\n            var file = getSourceFile(info.fileName);\n            if (!file)\n                return undefined;\n            var newLoc = getDocumentPositionMapper(info.fileName).getSourcePosition(info);\n            return !newLoc || newLoc === info ? undefined : tryGetSourcePosition(newLoc) || newLoc;\n        }\n        function tryGetGeneratedPosition(info) {\n            if (ts.isDeclarationFileName(info.fileName))\n                return undefined;\n            var sourceFile = getSourceFile(info.fileName);\n            if (!sourceFile)\n                return undefined;\n            var program = host.getProgram();\n            // If this is source file of project reference source (instead of redirect) there is no generated position\n            if (program.isSourceOfProjectReferenceRedirect(sourceFile.fileName)) {\n                return undefined;\n            }\n            var options = program.getCompilerOptions();\n            var outPath = ts.outFile(options);\n            var declarationPath = outPath ?\n                ts.removeFileExtension(outPath) + \".d.ts\" /* Dts */ :\n                ts.getDeclarationEmitOutputFilePathWorker(info.fileName, program.getCompilerOptions(), currentDirectory, program.getCommonSourceDirectory(), getCanonicalFileName);\n            if (declarationPath === undefined)\n                return undefined;\n            var newLoc = getDocumentPositionMapper(declarationPath, info.fileName).getGeneratedPosition(info);\n            return newLoc === info ? undefined : newLoc;\n        }\n        function getSourceFile(fileName) {\n            var program = host.getProgram();\n            if (!program)\n                return undefined;\n            var path = toPath(fileName);\n            // file returned here could be .d.ts when asked for .ts file if projectReferences and module resolution created this source file\n            var file = program.getSourceFileByPath(path);\n            return file && file.resolvedPath === path ? file : undefined;\n        }\n        function getOrCreateSourceFileLike(fileName) {\n            var path = toPath(fileName);\n            var fileFromCache = sourceFileLike.get(path);\n            if (fileFromCache !== undefined)\n                return fileFromCache ? fileFromCache : undefined;\n            if (!host.readFile || host.fileExists && !host.fileExists(path)) {\n                sourceFileLike.set(path, false);\n                return undefined;\n            }\n            // And failing that, check the disk\n            var text = host.readFile(path);\n            var file = text ? createSourceFileLike(text) : false;\n            sourceFileLike.set(path, file);\n            return file ? file : undefined;\n        }\n        // This can be called from source mapper in either source program or program that includes generated file\n        function getSourceFileLike(fileName) {\n            return !host.getSourceFileLike ?\n                getSourceFile(fileName) || getOrCreateSourceFileLike(fileName) :\n                host.getSourceFileLike(fileName);\n        }\n        function toLineColumnOffset(fileName, position) {\n            var file = getSourceFileLike(fileName); // TODO: GH#18217\n            return file.getLineAndCharacterOfPosition(position);\n        }\n        function clearCache() {\n            sourceFileLike.clear();\n            documentPositionMappers.clear();\n        }\n    }\n    ts.getSourceMapper = getSourceMapper;\n    function getDocumentPositionMapper(host, generatedFileName, generatedFileLineInfo, readMapFile) {\n        var mapFileName = ts.tryGetSourceMappingURL(generatedFileLineInfo);\n        if (mapFileName) {\n            var match = base64UrlRegExp.exec(mapFileName);\n            if (match) {\n                if (match[1]) {\n                    var base64Object = match[1];\n                    return convertDocumentToSourceMapper(host, ts.base64decode(ts.sys, base64Object), generatedFileName);\n                }\n                // Not a data URL we can parse, skip it\n                mapFileName = undefined;\n            }\n        }\n        var possibleMapLocations = [];\n        if (mapFileName) {\n            possibleMapLocations.push(mapFileName);\n        }\n        possibleMapLocations.push(generatedFileName + \".map\");\n        var originalMapFileName = mapFileName && ts.getNormalizedAbsolutePath(mapFileName, ts.getDirectoryPath(generatedFileName));\n        for (var _i = 0, possibleMapLocations_1 = possibleMapLocations; _i < possibleMapLocations_1.length; _i++) {\n            var location = possibleMapLocations_1[_i];\n            var mapFileName_1 = ts.getNormalizedAbsolutePath(location, ts.getDirectoryPath(generatedFileName));\n            var mapFileContents = readMapFile(mapFileName_1, originalMapFileName);\n            if (ts.isString(mapFileContents)) {\n                return convertDocumentToSourceMapper(host, mapFileContents, mapFileName_1);\n            }\n            if (mapFileContents !== undefined) {\n                return mapFileContents || undefined;\n            }\n        }\n        return undefined;\n    }\n    ts.getDocumentPositionMapper = getDocumentPositionMapper;\n    function convertDocumentToSourceMapper(host, contents, mapFileName) {\n        var map = ts.tryParseRawSourceMap(contents);\n        if (!map || !map.sources || !map.file || !map.mappings) {\n            // obviously invalid map\n            return undefined;\n        }\n        // Dont support sourcemaps that contain inlined sources\n        if (map.sourcesContent && map.sourcesContent.some(ts.isString))\n            return undefined;\n        return ts.createDocumentPositionMapper(host, map, mapFileName);\n    }\n    function createSourceFileLike(text, lineMap) {\n        return {\n            text: text,\n            lineMap: lineMap,\n            getLineAndCharacterOfPosition: function (pos) {\n                return ts.computeLineAndCharacterOfPosition(ts.getLineStarts(this), pos);\n            }\n        };\n    }\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var visitedNestedConvertibleFunctions = new ts.Map();\n    function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) {\n        program.getSemanticDiagnostics(sourceFile, cancellationToken);\n        var diags = [];\n        var checker = program.getTypeChecker();\n        if (sourceFile.commonJsModuleIndicator &&\n            (ts.programContainsEs6Modules(program) || ts.compilerOptionsIndicateEs6Modules(program.getCompilerOptions())) &&\n            containsTopLevelCommonjs(sourceFile)) {\n            diags.push(ts.createDiagnosticForNode(getErrorNodeFromCommonJsIndicator(sourceFile.commonJsModuleIndicator), ts.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module));\n        }\n        var isJsFile = ts.isSourceFileJS(sourceFile);\n        visitedNestedConvertibleFunctions.clear();\n        check(sourceFile);\n        if (ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())) {\n            for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) {\n                var moduleSpecifier = _a[_i];\n                var importNode = ts.importFromModuleSpecifier(moduleSpecifier);\n                var name = importNameForConvertToDefaultImport(importNode);\n                if (!name)\n                    continue;\n                var module_1 = ts.getResolvedModule(sourceFile, moduleSpecifier.text);\n                var resolvedFile = module_1 && program.getSourceFile(module_1.resolvedFileName);\n                if (resolvedFile && resolvedFile.externalModuleIndicator && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals) {\n                    diags.push(ts.createDiagnosticForNode(name, ts.Diagnostics.Import_may_be_converted_to_a_default_import));\n                }\n            }\n        }\n        ts.addRange(diags, sourceFile.bindSuggestionDiagnostics);\n        ts.addRange(diags, program.getSuggestionDiagnostics(sourceFile, cancellationToken));\n        return diags.sort(function (d1, d2) { return d1.start - d2.start; });\n        function check(node) {\n            if (isJsFile) {\n                if (canBeConvertedToClass(node, checker)) {\n                    diags.push(ts.createDiagnosticForNode(ts.isVariableDeclaration(node.parent) ? node.parent.name : node, ts.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration));\n                }\n            }\n            else {\n                if (ts.isVariableStatement(node) &&\n                    node.parent === sourceFile &&\n                    node.declarationList.flags & 2 /* Const */ &&\n                    node.declarationList.declarations.length === 1) {\n                    var init = node.declarationList.declarations[0].initializer;\n                    if (init && ts.isRequireCall(init, /*checkArgumentIsStringLiteralLike*/ true)) {\n                        diags.push(ts.createDiagnosticForNode(init, ts.Diagnostics.require_call_may_be_converted_to_an_import));\n                    }\n                }\n                if (ts.codefix.parameterShouldGetTypeFromJSDoc(node)) {\n                    diags.push(ts.createDiagnosticForNode(node.name || node, ts.Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types));\n                }\n            }\n            if (ts.isFunctionLikeDeclaration(node)) {\n                addConvertToAsyncFunctionDiagnostics(node, checker, diags);\n            }\n            node.forEachChild(check);\n        }\n    }\n    ts.computeSuggestionDiagnostics = computeSuggestionDiagnostics;\n    // convertToEs6Module only works on top-level, so don't trigger it if commonjs code only appears in nested scopes.\n    function containsTopLevelCommonjs(sourceFile) {\n        return sourceFile.statements.some(function (statement) {\n            switch (statement.kind) {\n                case 232 /* VariableStatement */:\n                    return statement.declarationList.declarations.some(function (decl) {\n                        return !!decl.initializer && ts.isRequireCall(propertyAccessLeftHandSide(decl.initializer), /*checkArgumentIsStringLiteralLike*/ true);\n                    });\n                case 233 /* ExpressionStatement */: {\n                    var expression = statement.expression;\n                    if (!ts.isBinaryExpression(expression))\n                        return ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true);\n                    var kind = ts.getAssignmentDeclarationKind(expression);\n                    return kind === 1 /* ExportsProperty */ || kind === 2 /* ModuleExports */;\n                }\n                default:\n                    return false;\n            }\n        });\n    }\n    function propertyAccessLeftHandSide(node) {\n        return ts.isPropertyAccessExpression(node) ? propertyAccessLeftHandSide(node.expression) : node;\n    }\n    function importNameForConvertToDefaultImport(node) {\n        switch (node.kind) {\n            case 261 /* ImportDeclaration */:\n                var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier;\n                return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 263 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier)\n                    ? importClause.namedBindings.name\n                    : undefined;\n            case 260 /* ImportEqualsDeclaration */:\n                return node.name;\n            default:\n                return undefined;\n        }\n    }\n    function addConvertToAsyncFunctionDiagnostics(node, checker, diags) {\n        // need to check function before checking map so that deeper levels of nested callbacks are checked\n        if (isConvertibleFunction(node, checker) && !visitedNestedConvertibleFunctions.has(getKeyFromNode(node))) {\n            diags.push(ts.createDiagnosticForNode(!node.name && ts.isVariableDeclaration(node.parent) && ts.isIdentifier(node.parent.name) ? node.parent.name : node, ts.Diagnostics.This_may_be_converted_to_an_async_function));\n        }\n    }\n    function isConvertibleFunction(node, checker) {\n        return !ts.isAsyncFunction(node) &&\n            node.body &&\n            ts.isBlock(node.body) &&\n            hasReturnStatementWithPromiseHandler(node.body, checker) &&\n            returnsPromise(node, checker);\n    }\n    function returnsPromise(node, checker) {\n        var functionType = checker.getTypeAtLocation(node);\n        var callSignatures = checker.getSignaturesOfType(functionType, 0 /* Call */);\n        var returnType = callSignatures.length ? checker.getReturnTypeOfSignature(callSignatures[0]) : undefined;\n        return !!returnType && !!checker.getPromisedTypeOfPromise(returnType);\n    }\n    function getErrorNodeFromCommonJsIndicator(commonJsModuleIndicator) {\n        return ts.isBinaryExpression(commonJsModuleIndicator) ? commonJsModuleIndicator.left : commonJsModuleIndicator;\n    }\n    function hasReturnStatementWithPromiseHandler(body, checker) {\n        return !!ts.forEachReturnStatement(body, function (statement) { return isReturnStatementWithFixablePromiseHandler(statement, checker); });\n    }\n    function isReturnStatementWithFixablePromiseHandler(node, checker) {\n        return ts.isReturnStatement(node) && !!node.expression && isFixablePromiseHandler(node.expression, checker);\n    }\n    ts.isReturnStatementWithFixablePromiseHandler = isReturnStatementWithFixablePromiseHandler;\n    // Should be kept up to date with transformExpression in convertToAsyncFunction.ts\n    function isFixablePromiseHandler(node, checker) {\n        // ensure outermost call exists and is a promise handler\n        if (!isPromiseHandler(node) || !node.arguments.every(function (arg) { return isFixablePromiseArgument(arg, checker); })) {\n            return false;\n        }\n        // ensure all chained calls are valid\n        var currentNode = node.expression;\n        while (isPromiseHandler(currentNode) || ts.isPropertyAccessExpression(currentNode)) {\n            if (ts.isCallExpression(currentNode) && !currentNode.arguments.every(function (arg) { return isFixablePromiseArgument(arg, checker); })) {\n                return false;\n            }\n            currentNode = currentNode.expression;\n        }\n        return true;\n    }\n    ts.isFixablePromiseHandler = isFixablePromiseHandler;\n    function isPromiseHandler(node) {\n        return ts.isCallExpression(node) && (ts.hasPropertyAccessExpressionWithName(node, \"then\") && hasSupportedNumberOfArguments(node) ||\n            ts.hasPropertyAccessExpressionWithName(node, \"catch\"));\n    }\n    function hasSupportedNumberOfArguments(node) {\n        if (node.arguments.length > 2)\n            return false;\n        if (node.arguments.length < 2)\n            return true;\n        return ts.some(node.arguments, function (arg) {\n            return arg.kind === 103 /* NullKeyword */ ||\n                ts.isIdentifier(arg) && arg.text === \"undefined\";\n        });\n    }\n    // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts\n    function isFixablePromiseArgument(arg, checker) {\n        switch (arg.kind) {\n            case 251 /* FunctionDeclaration */:\n            case 208 /* FunctionExpression */:\n            case 209 /* ArrowFunction */:\n                visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true);\n            // falls through\n            case 103 /* NullKeyword */:\n                return true;\n            case 78 /* Identifier */:\n            case 201 /* PropertyAccessExpression */: {\n                var symbol = checker.getSymbolAtLocation(arg);\n                if (!symbol) {\n                    return false;\n                }\n                return checker.isUndefinedSymbol(symbol) ||\n                    ts.some(ts.skipAlias(symbol, checker).declarations, function (d) { return ts.isFunctionLike(d) || ts.hasInitializer(d) && !!d.initializer && ts.isFunctionLike(d.initializer); });\n            }\n            default:\n                return false;\n        }\n    }\n    function getKeyFromNode(exp) {\n        return exp.pos.toString() + \":\" + exp.end.toString();\n    }\n    function canBeConvertedToClass(node, checker) {\n        var _a, _b, _c, _d;\n        if (node.kind === 208 /* FunctionExpression */) {\n            if (ts.isVariableDeclaration(node.parent) && ((_a = node.symbol.members) === null || _a === void 0 ? void 0 : _a.size)) {\n                return true;\n            }\n            var symbol = checker.getSymbolOfExpando(node, /*allowDeclaration*/ false);\n            return !!(symbol && (((_b = symbol.exports) === null || _b === void 0 ? void 0 : _b.size) || ((_c = symbol.members) === null || _c === void 0 ? void 0 : _c.size)));\n        }\n        if (node.kind === 251 /* FunctionDeclaration */) {\n            return !!((_d = node.symbol.members) === null || _d === void 0 ? void 0 : _d.size);\n        }\n        return false;\n    }\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var SymbolDisplay;\n    (function (SymbolDisplay) {\n        var symbolDisplayNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 70221824 /* IgnoreErrors */ | 16384 /* UseAliasDefinedOutsideCurrentScope */;\n        // TODO(drosen): use contextual SemanticMeaning.\n        function getSymbolKind(typeChecker, symbol, location) {\n            var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location);\n            if (result !== \"\" /* unknown */) {\n                return result;\n            }\n            var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol);\n            if (flags & 32 /* Class */) {\n                return ts.getDeclarationOfKind(symbol, 221 /* ClassExpression */) ?\n                    \"local class\" /* localClassElement */ : \"class\" /* classElement */;\n            }\n            if (flags & 384 /* Enum */)\n                return \"enum\" /* enumElement */;\n            if (flags & 524288 /* TypeAlias */)\n                return \"type\" /* typeElement */;\n            if (flags & 64 /* Interface */)\n                return \"interface\" /* interfaceElement */;\n            if (flags & 262144 /* TypeParameter */)\n                return \"type parameter\" /* typeParameterElement */;\n            if (flags & 8 /* EnumMember */)\n                return \"enum member\" /* enumMemberElement */;\n            if (flags & 2097152 /* Alias */)\n                return \"alias\" /* alias */;\n            if (flags & 1536 /* Module */)\n                return \"module\" /* moduleElement */;\n            return result;\n        }\n        SymbolDisplay.getSymbolKind = getSymbolKind;\n        function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location) {\n            var roots = typeChecker.getRootSymbols(symbol);\n            // If this is a method from a mapped type, leave as a method so long as it still has a call signature.\n            if (roots.length === 1\n                && ts.first(roots).flags & 8192 /* Method */\n                // Ensure the mapped version is still a method, as opposed to `{ [K in keyof I]: number }`.\n                && typeChecker.getTypeOfSymbolAtLocation(symbol, location).getNonNullableType().getCallSignatures().length !== 0) {\n                return \"method\" /* memberFunctionElement */;\n            }\n            if (typeChecker.isUndefinedSymbol(symbol)) {\n                return \"var\" /* variableElement */;\n            }\n            if (typeChecker.isArgumentsSymbol(symbol)) {\n                return \"local var\" /* localVariableElement */;\n            }\n            if (location.kind === 107 /* ThisKeyword */ && ts.isExpression(location)) {\n                return \"parameter\" /* parameterElement */;\n            }\n            var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol);\n            if (flags & 3 /* Variable */) {\n                if (ts.isFirstDeclarationOfSymbolParameter(symbol)) {\n                    return \"parameter\" /* parameterElement */;\n                }\n                else if (symbol.valueDeclaration && ts.isVarConst(symbol.valueDeclaration)) {\n                    return \"const\" /* constElement */;\n                }\n                else if (ts.forEach(symbol.declarations, ts.isLet)) {\n                    return \"let\" /* letElement */;\n                }\n                return isLocalVariableOrFunction(symbol) ? \"local var\" /* localVariableElement */ : \"var\" /* variableElement */;\n            }\n            if (flags & 16 /* Function */)\n                return isLocalVariableOrFunction(symbol) ? \"local function\" /* localFunctionElement */ : \"function\" /* functionElement */;\n            if (flags & 32768 /* GetAccessor */)\n                return \"getter\" /* memberGetAccessorElement */;\n            if (flags & 65536 /* SetAccessor */)\n                return \"setter\" /* memberSetAccessorElement */;\n            if (flags & 8192 /* Method */)\n                return \"method\" /* memberFunctionElement */;\n            if (flags & 16384 /* Constructor */)\n                return \"constructor\" /* constructorImplementationElement */;\n            if (flags & 4 /* Property */) {\n                if (flags & 33554432 /* Transient */ && symbol.checkFlags & 6 /* Synthetic */) {\n                    // If union property is result of union of non method (property/accessors/variables), it is labeled as property\n                    var unionPropertyKind = ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) {\n                        var rootSymbolFlags = rootSymbol.getFlags();\n                        if (rootSymbolFlags & (98308 /* PropertyOrAccessor */ | 3 /* Variable */)) {\n                            return \"property\" /* memberVariableElement */;\n                        }\n                    });\n                    if (!unionPropertyKind) {\n                        // If this was union of all methods,\n                        // make sure it has call signatures before we can label it as method\n                        var typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location);\n                        if (typeOfUnionProperty.getCallSignatures().length) {\n                            return \"method\" /* memberFunctionElement */;\n                        }\n                        return \"property\" /* memberVariableElement */;\n                    }\n                    return unionPropertyKind;\n                }\n                // If we requested completions after `x.` at the top-level, we may be at a source file location.\n                switch (location.parent && location.parent.kind) {\n                    // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'.\n                    case 275 /* JsxOpeningElement */:\n                    case 273 /* JsxElement */:\n                    case 274 /* JsxSelfClosingElement */:\n                        return location.kind === 78 /* Identifier */ ? \"property\" /* memberVariableElement */ : \"JSX attribute\" /* jsxAttribute */;\n                    case 280 /* JsxAttribute */:\n                        return \"JSX attribute\" /* jsxAttribute */;\n                    default:\n                        return \"property\" /* memberVariableElement */;\n                }\n            }\n            return \"\" /* unknown */;\n        }\n        function isDeprecatedDeclaration(decl) {\n            return !!(ts.getCombinedNodeFlagsAlwaysIncludeJSDoc(decl) & 8192 /* Deprecated */);\n        }\n        function getNormalizedSymbolModifiers(symbol) {\n            if (symbol.declarations && symbol.declarations.length) {\n                var _a = symbol.declarations, declaration = _a[0], declarations = _a.slice(1);\n                // omit deprecated flag if some declarations are not deprecated\n                var excludeFlags = ts.length(declarations) && isDeprecatedDeclaration(declaration) && ts.some(declarations, function (d) { return !isDeprecatedDeclaration(d); })\n                    ? 8192 /* Deprecated */\n                    : 0 /* None */;\n                var modifiers = ts.getNodeModifiers(declaration, excludeFlags);\n                if (modifiers) {\n                    return modifiers.split(\",\");\n                }\n            }\n            return [];\n        }\n        function getSymbolModifiers(typeChecker, symbol) {\n            if (!symbol) {\n                return \"\" /* none */;\n            }\n            var modifiers = new ts.Set(getNormalizedSymbolModifiers(symbol));\n            if (symbol.flags & 2097152 /* Alias */) {\n                var resolvedSymbol = typeChecker.getAliasedSymbol(symbol);\n                if (resolvedSymbol !== symbol) {\n                    ts.forEach(getNormalizedSymbolModifiers(resolvedSymbol), function (modifier) {\n                        modifiers.add(modifier);\n                    });\n                }\n            }\n            if (symbol.flags & 16777216 /* Optional */) {\n                modifiers.add(\"optional\" /* optionalModifier */);\n            }\n            return modifiers.size > 0 ? ts.arrayFrom(modifiers.values()).join(\",\") : \"\" /* none */;\n        }\n        SymbolDisplay.getSymbolModifiers = getSymbolModifiers;\n        // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location\n        function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning, alias) {\n            if (semanticMeaning === void 0) { semanticMeaning = ts.getMeaningFromLocation(location); }\n            var displayParts = [];\n            var documentation = [];\n            var tags = [];\n            var symbolFlags = ts.getCombinedLocalAndExportSymbolFlags(symbol);\n            var symbolKind = semanticMeaning & 1 /* Value */ ? getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location) : \"\" /* unknown */;\n            var hasAddedSymbolInfo = false;\n            var isThisExpression = location.kind === 107 /* ThisKeyword */ && ts.isInExpressionContext(location);\n            var type;\n            var printer;\n            var documentationFromAlias;\n            var tagsFromAlias;\n            var hasMultipleSignatures = false;\n            if (location.kind === 107 /* ThisKeyword */ && !isThisExpression) {\n                return { displayParts: [ts.keywordPart(107 /* ThisKeyword */)], documentation: [], symbolKind: \"primitive type\" /* primitiveType */, tags: undefined };\n            }\n            // Class at constructor site need to be shown as constructor apart from property,method, vars\n            if (symbolKind !== \"\" /* unknown */ || symbolFlags & 32 /* Class */ || symbolFlags & 2097152 /* Alias */) {\n                // If it is accessor they are allowed only if location is at name of the accessor\n                if (symbolKind === \"getter\" /* memberGetAccessorElement */ || symbolKind === \"setter\" /* memberSetAccessorElement */) {\n                    symbolKind = \"property\" /* memberVariableElement */;\n                }\n                var signature = void 0;\n                type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location);\n                if (location.parent && location.parent.kind === 201 /* PropertyAccessExpression */) {\n                    var right = location.parent.name;\n                    // Either the location is on the right of a property access, or on the left and the right is missing\n                    if (right === location || (right && right.getFullWidth() === 0)) {\n                        location = location.parent;\n                    }\n                }\n                // try get the call/construct signature from the type if it matches\n                var callExpressionLike = void 0;\n                if (ts.isCallOrNewExpression(location)) {\n                    callExpressionLike = location;\n                }\n                else if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location)) {\n                    callExpressionLike = location.parent;\n                }\n                else if (location.parent && (ts.isJsxOpeningLikeElement(location.parent) || ts.isTaggedTemplateExpression(location.parent)) && ts.isFunctionLike(symbol.valueDeclaration)) {\n                    callExpressionLike = location.parent;\n                }\n                if (callExpressionLike) {\n                    signature = typeChecker.getResolvedSignature(callExpressionLike); // TODO: GH#18217\n                    var useConstructSignatures = callExpressionLike.kind === 204 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 105 /* SuperKeyword */);\n                    var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures();\n                    if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) {\n                        // Get the first signature if there is one -- allSignatures may contain\n                        // either the original signature or its target, so check for either\n                        signature = allSignatures.length ? allSignatures[0] : undefined;\n                    }\n                    if (signature) {\n                        if (useConstructSignatures && (symbolFlags & 32 /* Class */)) {\n                            // Constructor\n                            symbolKind = \"constructor\" /* constructorImplementationElement */;\n                            addPrefixForAnyFunctionOrVar(type.symbol, symbolKind);\n                        }\n                        else if (symbolFlags & 2097152 /* Alias */) {\n                            symbolKind = \"alias\" /* alias */;\n                            pushSymbolKind(symbolKind);\n                            displayParts.push(ts.spacePart());\n                            if (useConstructSignatures) {\n                                if (signature.flags & 4 /* Abstract */) {\n                                    displayParts.push(ts.keywordPart(125 /* AbstractKeyword */));\n                                    displayParts.push(ts.spacePart());\n                                }\n                                displayParts.push(ts.keywordPart(102 /* NewKeyword */));\n                                displayParts.push(ts.spacePart());\n                            }\n                            addFullSymbolName(symbol);\n                        }\n                        else {\n                            addPrefixForAnyFunctionOrVar(symbol, symbolKind);\n                        }\n                        switch (symbolKind) {\n                            case \"JSX attribute\" /* jsxAttribute */:\n                            case \"property\" /* memberVariableElement */:\n                            case \"var\" /* variableElement */:\n                            case \"const\" /* constElement */:\n                            case \"let\" /* letElement */:\n                            case \"parameter\" /* parameterElement */:\n                            case \"local var\" /* localVariableElement */:\n                                // If it is call or construct signature of lambda's write type name\n                                displayParts.push(ts.punctuationPart(58 /* ColonToken */));\n                                displayParts.push(ts.spacePart());\n                                if (!(ts.getObjectFlags(type) & 16 /* Anonymous */) && type.symbol) {\n                                    ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, 4 /* AllowAnyNodeKind */ | 1 /* WriteTypeParametersOrArguments */));\n                                    displayParts.push(ts.lineBreakPart());\n                                }\n                                if (useConstructSignatures) {\n                                    if (signature.flags & 4 /* Abstract */) {\n                                        displayParts.push(ts.keywordPart(125 /* AbstractKeyword */));\n                                        displayParts.push(ts.spacePart());\n                                    }\n                                    displayParts.push(ts.keywordPart(102 /* NewKeyword */));\n                                    displayParts.push(ts.spacePart());\n                                }\n                                addSignatureDisplayParts(signature, allSignatures, 262144 /* WriteArrowStyleSignature */);\n                                break;\n                            default:\n                                // Just signature\n                                addSignatureDisplayParts(signature, allSignatures);\n                        }\n                        hasAddedSymbolInfo = true;\n                        hasMultipleSignatures = allSignatures.length > 1;\n                    }\n                }\n                else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration\n                    (location.kind === 132 /* ConstructorKeyword */ && location.parent.kind === 166 /* Constructor */)) { // At constructor keyword of constructor declaration\n                    // get the signature from the declaration and write it\n                    var functionDeclaration_1 = location.parent;\n                    // Use function declaration to write the signatures only if the symbol corresponding to this declaration\n                    var locationIsSymbolDeclaration = symbol.declarations && ts.find(symbol.declarations, function (declaration) {\n                        return declaration === (location.kind === 132 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1);\n                    });\n                    if (locationIsSymbolDeclaration) {\n                        var allSignatures = functionDeclaration_1.kind === 166 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures();\n                        if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) {\n                            signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); // TODO: GH#18217\n                        }\n                        else {\n                            signature = allSignatures[0];\n                        }\n                        if (functionDeclaration_1.kind === 166 /* Constructor */) {\n                            // show (constructor) Type(...) signature\n                            symbolKind = \"constructor\" /* constructorImplementationElement */;\n                            addPrefixForAnyFunctionOrVar(type.symbol, symbolKind);\n                        }\n                        else {\n                            // (function/method) symbol(..signature)\n                            addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 169 /* CallSignature */ &&\n                                !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind);\n                        }\n                        addSignatureDisplayParts(signature, allSignatures);\n                        hasAddedSymbolInfo = true;\n                        hasMultipleSignatures = allSignatures.length > 1;\n                    }\n                }\n            }\n            if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) {\n                addAliasPrefixIfNecessary();\n                if (ts.getDeclarationOfKind(symbol, 221 /* ClassExpression */)) {\n                    // Special case for class expressions because we would like to indicate that\n                    // the class name is local to the class body (similar to function expression)\n                    //      (local class) class <className>\n                    pushSymbolKind(\"local class\" /* localClassElement */);\n                }\n                else {\n                    // Class declaration has name which is not local.\n                    displayParts.push(ts.keywordPart(83 /* ClassKeyword */));\n                }\n                displayParts.push(ts.spacePart());\n                addFullSymbolName(symbol);\n                writeTypeParametersOfSymbol(symbol, sourceFile);\n            }\n            if ((symbolFlags & 64 /* Interface */) && (semanticMeaning & 2 /* Type */)) {\n                prefixNextMeaning();\n                displayParts.push(ts.keywordPart(117 /* InterfaceKeyword */));\n                displayParts.push(ts.spacePart());\n                addFullSymbolName(symbol);\n                writeTypeParametersOfSymbol(symbol, sourceFile);\n            }\n            if ((symbolFlags & 524288 /* TypeAlias */) && (semanticMeaning & 2 /* Type */)) {\n                prefixNextMeaning();\n                displayParts.push(ts.keywordPart(149 /* TypeKeyword */));\n                displayParts.push(ts.spacePart());\n                addFullSymbolName(symbol);\n                writeTypeParametersOfSymbol(symbol, sourceFile);\n                displayParts.push(ts.spacePart());\n                displayParts.push(ts.operatorPart(62 /* EqualsToken */));\n                displayParts.push(ts.spacePart());\n                ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));\n            }\n            if (symbolFlags & 384 /* Enum */) {\n                prefixNextMeaning();\n                if (ts.some(symbol.declarations, function (d) { return ts.isEnumDeclaration(d) && ts.isEnumConst(d); })) {\n                    displayParts.push(ts.keywordPart(84 /* ConstKeyword */));\n                    displayParts.push(ts.spacePart());\n                }\n                displayParts.push(ts.keywordPart(91 /* EnumKeyword */));\n                displayParts.push(ts.spacePart());\n                addFullSymbolName(symbol);\n            }\n            if (symbolFlags & 1536 /* Module */ && !isThisExpression) {\n                prefixNextMeaning();\n                var declaration = ts.getDeclarationOfKind(symbol, 256 /* ModuleDeclaration */);\n                var isNamespace = declaration && declaration.name && declaration.name.kind === 78 /* Identifier */;\n                displayParts.push(ts.keywordPart(isNamespace ? 140 /* NamespaceKeyword */ : 139 /* ModuleKeyword */));\n                displayParts.push(ts.spacePart());\n                addFullSymbolName(symbol);\n            }\n            if ((symbolFlags & 262144 /* TypeParameter */) && (semanticMeaning & 2 /* Type */)) {\n                prefixNextMeaning();\n                displayParts.push(ts.punctuationPart(20 /* OpenParenToken */));\n                displayParts.push(ts.textPart(\"type parameter\"));\n                displayParts.push(ts.punctuationPart(21 /* CloseParenToken */));\n                displayParts.push(ts.spacePart());\n                addFullSymbolName(symbol);\n                if (symbol.parent) {\n                    // Class/Interface type parameter\n                    addInPrefix();\n                    addFullSymbolName(symbol.parent, enclosingDeclaration);\n                    writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration);\n                }\n                else {\n                    // Method/function type parameter\n                    var decl = ts.getDeclarationOfKind(symbol, 159 /* TypeParameter */);\n                    if (decl === undefined)\n                        return ts.Debug.fail();\n                    var declaration = decl.parent;\n                    if (declaration) {\n                        if (ts.isFunctionLikeKind(declaration.kind)) {\n                            addInPrefix();\n                            var signature = typeChecker.getSignatureFromDeclaration(declaration); // TODO: GH#18217\n                            if (declaration.kind === 170 /* ConstructSignature */) {\n                                displayParts.push(ts.keywordPart(102 /* NewKeyword */));\n                                displayParts.push(ts.spacePart());\n                            }\n                            else if (declaration.kind !== 169 /* CallSignature */ && declaration.name) {\n                                addFullSymbolName(declaration.symbol);\n                            }\n                            ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */));\n                        }\n                        else if (declaration.kind === 254 /* TypeAliasDeclaration */) {\n                            // Type alias type parameter\n                            // For example\n                            //      type list<T> = T[]; // Both T will go through same code path\n                            addInPrefix();\n                            displayParts.push(ts.keywordPart(149 /* TypeKeyword */));\n                            displayParts.push(ts.spacePart());\n                            addFullSymbolName(declaration.symbol);\n                            writeTypeParametersOfSymbol(declaration.symbol, sourceFile);\n                        }\n                    }\n                }\n            }\n            if (symbolFlags & 8 /* EnumMember */) {\n                symbolKind = \"enum member\" /* enumMemberElement */;\n                addPrefixForAnyFunctionOrVar(symbol, \"enum member\");\n                var declaration = symbol.declarations[0];\n                if (declaration.kind === 291 /* EnumMember */) {\n                    var constantValue = typeChecker.getConstantValue(declaration);\n                    if (constantValue !== undefined) {\n                        displayParts.push(ts.spacePart());\n                        displayParts.push(ts.operatorPart(62 /* EqualsToken */));\n                        displayParts.push(ts.spacePart());\n                        displayParts.push(ts.displayPart(ts.getTextOfConstantValue(constantValue), typeof constantValue === \"number\" ? ts.SymbolDisplayPartKind.numericLiteral : ts.SymbolDisplayPartKind.stringLiteral));\n                    }\n                }\n            }\n            // don't use symbolFlags since getAliasedSymbol requires the flag on the symbol itself\n            if (symbol.flags & 2097152 /* Alias */) {\n                prefixNextMeaning();\n                if (!hasAddedSymbolInfo) {\n                    var resolvedSymbol = typeChecker.getAliasedSymbol(symbol);\n                    if (resolvedSymbol !== symbol && resolvedSymbol.declarations && resolvedSymbol.declarations.length > 0) {\n                        var resolvedNode = resolvedSymbol.declarations[0];\n                        var declarationName = ts.getNameOfDeclaration(resolvedNode);\n                        if (declarationName) {\n                            var isExternalModuleDeclaration = ts.isModuleWithStringLiteralName(resolvedNode) &&\n                                ts.hasSyntacticModifier(resolvedNode, 2 /* Ambient */);\n                            var shouldUseAliasName = symbol.name !== \"default\" && !isExternalModuleDeclaration;\n                            var resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, resolvedSymbol, ts.getSourceFileOfNode(resolvedNode), resolvedNode, declarationName, semanticMeaning, shouldUseAliasName ? symbol : resolvedSymbol);\n                            displayParts.push.apply(displayParts, resolvedInfo.displayParts);\n                            displayParts.push(ts.lineBreakPart());\n                            documentationFromAlias = resolvedInfo.documentation;\n                            tagsFromAlias = resolvedInfo.tags;\n                        }\n                        else {\n                            documentationFromAlias = resolvedSymbol.getContextualDocumentationComment(resolvedNode, typeChecker);\n                            tagsFromAlias = resolvedSymbol.getJsDocTags();\n                        }\n                    }\n                }\n                switch (symbol.declarations[0].kind) {\n                    case 259 /* NamespaceExportDeclaration */:\n                        displayParts.push(ts.keywordPart(92 /* ExportKeyword */));\n                        displayParts.push(ts.spacePart());\n                        displayParts.push(ts.keywordPart(140 /* NamespaceKeyword */));\n                        break;\n                    case 266 /* ExportAssignment */:\n                        displayParts.push(ts.keywordPart(92 /* ExportKeyword */));\n                        displayParts.push(ts.spacePart());\n                        displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 62 /* EqualsToken */ : 87 /* DefaultKeyword */));\n                        break;\n                    case 270 /* ExportSpecifier */:\n                        displayParts.push(ts.keywordPart(92 /* ExportKeyword */));\n                        break;\n                    default:\n                        displayParts.push(ts.keywordPart(99 /* ImportKeyword */));\n                }\n                displayParts.push(ts.spacePart());\n                addFullSymbolName(symbol);\n                ts.forEach(symbol.declarations, function (declaration) {\n                    if (declaration.kind === 260 /* ImportEqualsDeclaration */) {\n                        var importEqualsDeclaration = declaration;\n                        if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) {\n                            displayParts.push(ts.spacePart());\n                            displayParts.push(ts.operatorPart(62 /* EqualsToken */));\n                            displayParts.push(ts.spacePart());\n                            displayParts.push(ts.keywordPart(143 /* RequireKeyword */));\n                            displayParts.push(ts.punctuationPart(20 /* OpenParenToken */));\n                            displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral));\n                            displayParts.push(ts.punctuationPart(21 /* CloseParenToken */));\n                        }\n                        else {\n                            var internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference);\n                            if (internalAliasSymbol) {\n                                displayParts.push(ts.spacePart());\n                                displayParts.push(ts.operatorPart(62 /* EqualsToken */));\n                                displayParts.push(ts.spacePart());\n                                addFullSymbolName(internalAliasSymbol, enclosingDeclaration);\n                            }\n                        }\n                        return true;\n                    }\n                });\n            }\n            if (!hasAddedSymbolInfo) {\n                if (symbolKind !== \"\" /* unknown */) {\n                    if (type) {\n                        if (isThisExpression) {\n                            prefixNextMeaning();\n                            displayParts.push(ts.keywordPart(107 /* ThisKeyword */));\n                        }\n                        else {\n                            addPrefixForAnyFunctionOrVar(symbol, symbolKind);\n                        }\n                        // For properties, variables and local vars: show the type\n                        if (symbolKind === \"property\" /* memberVariableElement */ ||\n                            symbolKind === \"JSX attribute\" /* jsxAttribute */ ||\n                            symbolFlags & 3 /* Variable */ ||\n                            symbolKind === \"local var\" /* localVariableElement */ ||\n                            isThisExpression) {\n                            displayParts.push(ts.punctuationPart(58 /* ColonToken */));\n                            displayParts.push(ts.spacePart());\n                            // If the type is type parameter, format it specially\n                            if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */) {\n                                var typeParameterParts = ts.mapToDisplayParts(function (writer) {\n                                    var param = typeChecker.typeParameterToDeclaration(type, enclosingDeclaration, symbolDisplayNodeBuilderFlags);\n                                    getPrinter().writeNode(4 /* Unspecified */, param, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosingDeclaration)), writer);\n                                });\n                                ts.addRange(displayParts, typeParameterParts);\n                            }\n                            else {\n                                ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, type, enclosingDeclaration));\n                            }\n                            if (symbol.target && symbol.target.tupleLabelDeclaration) {\n                                var labelDecl = symbol.target.tupleLabelDeclaration;\n                                ts.Debug.assertNode(labelDecl.name, ts.isIdentifier);\n                                displayParts.push(ts.spacePart());\n                                displayParts.push(ts.punctuationPart(20 /* OpenParenToken */));\n                                displayParts.push(ts.textPart(ts.idText(labelDecl.name)));\n                                displayParts.push(ts.punctuationPart(21 /* CloseParenToken */));\n                            }\n                        }\n                        else if (symbolFlags & 16 /* Function */ ||\n                            symbolFlags & 8192 /* Method */ ||\n                            symbolFlags & 16384 /* Constructor */ ||\n                            symbolFlags & 131072 /* Signature */ ||\n                            symbolFlags & 98304 /* Accessor */ ||\n                            symbolKind === \"method\" /* memberFunctionElement */) {\n                            var allSignatures = type.getNonNullableType().getCallSignatures();\n                            if (allSignatures.length) {\n                                addSignatureDisplayParts(allSignatures[0], allSignatures);\n                                hasMultipleSignatures = allSignatures.length > 1;\n                            }\n                        }\n                    }\n                }\n                else {\n                    symbolKind = getSymbolKind(typeChecker, symbol, location);\n                }\n            }\n            if (documentation.length === 0 && !hasMultipleSignatures) {\n                documentation = symbol.getContextualDocumentationComment(enclosingDeclaration, typeChecker);\n            }\n            if (documentation.length === 0 && symbolFlags & 4 /* Property */) {\n                // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo`\n                // there documentation comments might be attached to the right hand side symbol of their declarations.\n                // The pattern of such special property access is that the parent symbol is the symbol of the file.\n                if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 297 /* SourceFile */; })) {\n                    for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                        var declaration = _a[_i];\n                        if (!declaration.parent || declaration.parent.kind !== 216 /* BinaryExpression */) {\n                            continue;\n                        }\n                        var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right);\n                        if (!rhsSymbol) {\n                            continue;\n                        }\n                        documentation = rhsSymbol.getDocumentationComment(typeChecker);\n                        tags = rhsSymbol.getJsDocTags();\n                        if (documentation.length > 0) {\n                            break;\n                        }\n                    }\n                }\n            }\n            if (tags.length === 0 && !hasMultipleSignatures) {\n                tags = symbol.getJsDocTags();\n            }\n            if (documentation.length === 0 && documentationFromAlias) {\n                documentation = documentationFromAlias;\n            }\n            if (tags.length === 0 && tagsFromAlias) {\n                tags = tagsFromAlias;\n            }\n            return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind, tags: tags.length === 0 ? undefined : tags };\n            function getPrinter() {\n                if (!printer) {\n                    printer = ts.createPrinter({ removeComments: true });\n                }\n                return printer;\n            }\n            function prefixNextMeaning() {\n                if (displayParts.length) {\n                    displayParts.push(ts.lineBreakPart());\n                }\n                addAliasPrefixIfNecessary();\n            }\n            function addAliasPrefixIfNecessary() {\n                if (alias) {\n                    pushSymbolKind(\"alias\" /* alias */);\n                    displayParts.push(ts.spacePart());\n                }\n            }\n            function addInPrefix() {\n                displayParts.push(ts.spacePart());\n                displayParts.push(ts.keywordPart(100 /* InKeyword */));\n                displayParts.push(ts.spacePart());\n            }\n            function addFullSymbolName(symbolToDisplay, enclosingDeclaration) {\n                if (alias && symbolToDisplay === symbol) {\n                    symbolToDisplay = alias;\n                }\n                var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbolToDisplay, enclosingDeclaration || sourceFile, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */ | 4 /* AllowAnyNodeKind */);\n                ts.addRange(displayParts, fullSymbolDisplayParts);\n                if (symbol.flags & 16777216 /* Optional */) {\n                    displayParts.push(ts.punctuationPart(57 /* QuestionToken */));\n                }\n            }\n            function addPrefixForAnyFunctionOrVar(symbol, symbolKind) {\n                prefixNextMeaning();\n                if (symbolKind) {\n                    pushSymbolKind(symbolKind);\n                    if (symbol && !ts.some(symbol.declarations, function (d) { return ts.isArrowFunction(d) || (ts.isFunctionExpression(d) || ts.isClassExpression(d)) && !d.name; })) {\n                        displayParts.push(ts.spacePart());\n                        addFullSymbolName(symbol);\n                    }\n                }\n            }\n            function pushSymbolKind(symbolKind) {\n                switch (symbolKind) {\n                    case \"var\" /* variableElement */:\n                    case \"function\" /* functionElement */:\n                    case \"let\" /* letElement */:\n                    case \"const\" /* constElement */:\n                    case \"constructor\" /* constructorImplementationElement */:\n                        displayParts.push(ts.textOrKeywordPart(symbolKind));\n                        return;\n                    default:\n                        displayParts.push(ts.punctuationPart(20 /* OpenParenToken */));\n                        displayParts.push(ts.textOrKeywordPart(symbolKind));\n                        displayParts.push(ts.punctuationPart(21 /* CloseParenToken */));\n                        return;\n                }\n            }\n            function addSignatureDisplayParts(signature, allSignatures, flags) {\n                if (flags === void 0) { flags = 0 /* None */; }\n                ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */));\n                if (allSignatures.length > 1) {\n                    displayParts.push(ts.spacePart());\n                    displayParts.push(ts.punctuationPart(20 /* OpenParenToken */));\n                    displayParts.push(ts.operatorPart(39 /* PlusToken */));\n                    displayParts.push(ts.displayPart((allSignatures.length - 1).toString(), ts.SymbolDisplayPartKind.numericLiteral));\n                    displayParts.push(ts.spacePart());\n                    displayParts.push(ts.textPart(allSignatures.length === 2 ? \"overload\" : \"overloads\"));\n                    displayParts.push(ts.punctuationPart(21 /* CloseParenToken */));\n                }\n                documentation = signature.getDocumentationComment(typeChecker);\n                tags = signature.getJsDocTags();\n                if (allSignatures.length > 1 && documentation.length === 0 && tags.length === 0) {\n                    documentation = allSignatures[0].getDocumentationComment(typeChecker);\n                    tags = allSignatures[0].getJsDocTags();\n                }\n            }\n            function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) {\n                var typeParameterParts = ts.mapToDisplayParts(function (writer) {\n                    var params = typeChecker.symbolToTypeParameterDeclarations(symbol, enclosingDeclaration, symbolDisplayNodeBuilderFlags);\n                    getPrinter().writeList(53776 /* TypeParameters */, params, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosingDeclaration)), writer);\n                });\n                ts.addRange(displayParts, typeParameterParts);\n            }\n        }\n        SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind;\n        function isLocalVariableOrFunction(symbol) {\n            if (symbol.parent) {\n                return false; // This is exported symbol\n            }\n            return ts.forEach(symbol.declarations, function (declaration) {\n                // Function expressions are local\n                if (declaration.kind === 208 /* FunctionExpression */) {\n                    return true;\n                }\n                if (declaration.kind !== 249 /* VariableDeclaration */ && declaration.kind !== 251 /* FunctionDeclaration */) {\n                    return false;\n                }\n                // If the parent is not sourceFile or module block it is local variable\n                for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) {\n                    // Reached source file or module block\n                    if (parent.kind === 297 /* SourceFile */ || parent.kind === 257 /* ModuleBlock */) {\n                        return false;\n                    }\n                }\n                // parent is in function block\n                return true;\n            });\n        }\n    })(SymbolDisplay = ts.SymbolDisplay || (ts.SymbolDisplay = {}));\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    /*\n     * This function will compile source text from 'input' argument using specified compiler options.\n     * If not options are provided - it will use a set of default compiler options.\n     * Extra compiler options that will unconditionally be used by this function are:\n     * - isolatedModules = true\n     * - allowNonTsExtensions = true\n     * - noLib = true\n     * - noResolve = true\n     */\n    function transpileModule(input, transpileOptions) {\n        var diagnostics = [];\n        var options = transpileOptions.compilerOptions ? fixupCompilerOptions(transpileOptions.compilerOptions, diagnostics) : {};\n        // mix in default options\n        var defaultOptions = ts.getDefaultCompilerOptions();\n        for (var key in defaultOptions) {\n            if (ts.hasProperty(defaultOptions, key) && options[key] === undefined) {\n                options[key] = defaultOptions[key];\n            }\n        }\n        for (var _i = 0, transpileOptionValueCompilerOptions_1 = ts.transpileOptionValueCompilerOptions; _i < transpileOptionValueCompilerOptions_1.length; _i++) {\n            var option = transpileOptionValueCompilerOptions_1[_i];\n            options[option.name] = option.transpileOptionValue;\n        }\n        // transpileModule does not write anything to disk so there is no need to verify that there are no conflicts between input and output paths.\n        options.suppressOutputPathCheck = true;\n        // Filename can be non-ts file.\n        options.allowNonTsExtensions = true;\n        // if jsx is specified then treat file as .tsx\n        var inputFileName = transpileOptions.fileName || (transpileOptions.compilerOptions && transpileOptions.compilerOptions.jsx ? \"module.tsx\" : \"module.ts\");\n        var sourceFile = ts.createSourceFile(inputFileName, input, options.target); // TODO: GH#18217\n        if (transpileOptions.moduleName) {\n            sourceFile.moduleName = transpileOptions.moduleName;\n        }\n        if (transpileOptions.renamedDependencies) {\n            sourceFile.renamedDependencies = new ts.Map(ts.getEntries(transpileOptions.renamedDependencies));\n        }\n        var newLine = ts.getNewLineCharacter(options);\n        // Output\n        var outputText;\n        var sourceMapText;\n        // Create a compilerHost object to allow the compiler to read and write files\n        var compilerHost = {\n            getSourceFile: function (fileName) { return fileName === ts.normalizePath(inputFileName) ? sourceFile : undefined; },\n            writeFile: function (name, text) {\n                if (ts.fileExtensionIs(name, \".map\")) {\n                    ts.Debug.assertEqual(sourceMapText, undefined, \"Unexpected multiple source map outputs, file:\", name);\n                    sourceMapText = text;\n                }\n                else {\n                    ts.Debug.assertEqual(outputText, undefined, \"Unexpected multiple outputs, file:\", name);\n                    outputText = text;\n                }\n            },\n            getDefaultLibFileName: function () { return \"lib.d.ts\"; },\n            useCaseSensitiveFileNames: function () { return false; },\n            getCanonicalFileName: function (fileName) { return fileName; },\n            getCurrentDirectory: function () { return \"\"; },\n            getNewLine: function () { return newLine; },\n            fileExists: function (fileName) { return fileName === inputFileName; },\n            readFile: function () { return \"\"; },\n            directoryExists: function () { return true; },\n            getDirectories: function () { return []; }\n        };\n        var program = ts.createProgram([inputFileName], options, compilerHost);\n        if (transpileOptions.reportDiagnostics) {\n            ts.addRange(/*to*/ diagnostics, /*from*/ program.getSyntacticDiagnostics(sourceFile));\n            ts.addRange(/*to*/ diagnostics, /*from*/ program.getOptionsDiagnostics());\n        }\n        // Emit\n        program.emit(/*targetSourceFile*/ undefined, /*writeFile*/ undefined, /*cancellationToken*/ undefined, /*emitOnlyDtsFiles*/ undefined, transpileOptions.transformers);\n        if (outputText === undefined)\n            return ts.Debug.fail(\"Output generation failed\");\n        return { outputText: outputText, diagnostics: diagnostics, sourceMapText: sourceMapText };\n    }\n    ts.transpileModule = transpileModule;\n    /*\n     * This is a shortcut function for transpileModule - it accepts transpileOptions as parameters and returns only outputText part of the result.\n     */\n    function transpile(input, compilerOptions, fileName, diagnostics, moduleName) {\n        var output = transpileModule(input, { compilerOptions: compilerOptions, fileName: fileName, reportDiagnostics: !!diagnostics, moduleName: moduleName });\n        // addRange correctly handles cases when wither 'from' or 'to' argument is missing\n        ts.addRange(diagnostics, output.diagnostics);\n        return output.outputText;\n    }\n    ts.transpile = transpile;\n    var commandLineOptionsStringToEnum;\n    /** JS users may pass in string values for enum compiler options (such as ModuleKind), so convert. */\n    /*@internal*/\n    function fixupCompilerOptions(options, diagnostics) {\n        // Lazily create this value to fix module loading errors.\n        commandLineOptionsStringToEnum = commandLineOptionsStringToEnum || ts.filter(ts.optionDeclarations, function (o) {\n            return typeof o.type === \"object\" && !ts.forEachEntry(o.type, function (v) { return typeof v !== \"number\"; });\n        });\n        options = ts.cloneCompilerOptions(options);\n        var _loop_8 = function (opt) {\n            if (!ts.hasProperty(options, opt.name)) {\n                return \"continue\";\n            }\n            var value = options[opt.name];\n            // Value should be a key of opt.type\n            if (ts.isString(value)) {\n                // If value is not a string, this will fail\n                options[opt.name] = ts.parseCustomTypeOption(opt, value, diagnostics);\n            }\n            else {\n                if (!ts.forEachEntry(opt.type, function (v) { return v === value; })) {\n                    // Supplied value isn't a valid enum value.\n                    diagnostics.push(ts.createCompilerDiagnosticForInvalidCustomType(opt));\n                }\n            }\n        };\n        for (var _i = 0, commandLineOptionsStringToEnum_1 = commandLineOptionsStringToEnum; _i < commandLineOptionsStringToEnum_1.length; _i++) {\n            var opt = commandLineOptionsStringToEnum_1[_i];\n            _loop_8(opt);\n        }\n        return options;\n    }\n    ts.fixupCompilerOptions = fixupCompilerOptions;\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var formatting;\n    (function (formatting) {\n        var FormattingRequestKind;\n        (function (FormattingRequestKind) {\n            FormattingRequestKind[FormattingRequestKind[\"FormatDocument\"] = 0] = \"FormatDocument\";\n            FormattingRequestKind[FormattingRequestKind[\"FormatSelection\"] = 1] = \"FormatSelection\";\n            FormattingRequestKind[FormattingRequestKind[\"FormatOnEnter\"] = 2] = \"FormatOnEnter\";\n            FormattingRequestKind[FormattingRequestKind[\"FormatOnSemicolon\"] = 3] = \"FormatOnSemicolon\";\n            FormattingRequestKind[FormattingRequestKind[\"FormatOnOpeningCurlyBrace\"] = 4] = \"FormatOnOpeningCurlyBrace\";\n            FormattingRequestKind[FormattingRequestKind[\"FormatOnClosingCurlyBrace\"] = 5] = \"FormatOnClosingCurlyBrace\";\n        })(FormattingRequestKind = formatting.FormattingRequestKind || (formatting.FormattingRequestKind = {}));\n        var FormattingContext = /** @class */ (function () {\n            function FormattingContext(sourceFile, formattingRequestKind, options) {\n                this.sourceFile = sourceFile;\n                this.formattingRequestKind = formattingRequestKind;\n                this.options = options;\n            }\n            FormattingContext.prototype.updateContext = function (currentRange, currentTokenParent, nextRange, nextTokenParent, commonParent) {\n                this.currentTokenSpan = ts.Debug.checkDefined(currentRange);\n                this.currentTokenParent = ts.Debug.checkDefined(currentTokenParent);\n                this.nextTokenSpan = ts.Debug.checkDefined(nextRange);\n                this.nextTokenParent = ts.Debug.checkDefined(nextTokenParent);\n                this.contextNode = ts.Debug.checkDefined(commonParent);\n                // drop cached results\n                this.contextNodeAllOnSameLine = undefined;\n                this.nextNodeAllOnSameLine = undefined;\n                this.tokensAreOnSameLine = undefined;\n                this.contextNodeBlockIsOnOneLine = undefined;\n                this.nextNodeBlockIsOnOneLine = undefined;\n            };\n            FormattingContext.prototype.ContextNodeAllOnSameLine = function () {\n                if (this.contextNodeAllOnSameLine === undefined) {\n                    this.contextNodeAllOnSameLine = this.NodeIsOnOneLine(this.contextNode);\n                }\n                return this.contextNodeAllOnSameLine;\n            };\n            FormattingContext.prototype.NextNodeAllOnSameLine = function () {\n                if (this.nextNodeAllOnSameLine === undefined) {\n                    this.nextNodeAllOnSameLine = this.NodeIsOnOneLine(this.nextTokenParent);\n                }\n                return this.nextNodeAllOnSameLine;\n            };\n            FormattingContext.prototype.TokensAreOnSameLine = function () {\n                if (this.tokensAreOnSameLine === undefined) {\n                    var startLine = this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line;\n                    var endLine = this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line;\n                    this.tokensAreOnSameLine = (startLine === endLine);\n                }\n                return this.tokensAreOnSameLine;\n            };\n            FormattingContext.prototype.ContextNodeBlockIsOnOneLine = function () {\n                if (this.contextNodeBlockIsOnOneLine === undefined) {\n                    this.contextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.contextNode);\n                }\n                return this.contextNodeBlockIsOnOneLine;\n            };\n            FormattingContext.prototype.NextNodeBlockIsOnOneLine = function () {\n                if (this.nextNodeBlockIsOnOneLine === undefined) {\n                    this.nextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.nextTokenParent);\n                }\n                return this.nextNodeBlockIsOnOneLine;\n            };\n            FormattingContext.prototype.NodeIsOnOneLine = function (node) {\n                var startLine = this.sourceFile.getLineAndCharacterOfPosition(node.getStart(this.sourceFile)).line;\n                var endLine = this.sourceFile.getLineAndCharacterOfPosition(node.getEnd()).line;\n                return startLine === endLine;\n            };\n            FormattingContext.prototype.BlockIsOnOneLine = function (node) {\n                var openBrace = ts.findChildOfKind(node, 18 /* OpenBraceToken */, this.sourceFile);\n                var closeBrace = ts.findChildOfKind(node, 19 /* CloseBraceToken */, this.sourceFile);\n                if (openBrace && closeBrace) {\n                    var startLine = this.sourceFile.getLineAndCharacterOfPosition(openBrace.getEnd()).line;\n                    var endLine = this.sourceFile.getLineAndCharacterOfPosition(closeBrace.getStart(this.sourceFile)).line;\n                    return startLine === endLine;\n                }\n                return false;\n            };\n            return FormattingContext;\n        }());\n        formatting.FormattingContext = FormattingContext;\n    })(formatting = ts.formatting || (ts.formatting = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var formatting;\n    (function (formatting) {\n        var standardScanner = ts.createScanner(99 /* Latest */, /*skipTrivia*/ false, 0 /* Standard */);\n        var jsxScanner = ts.createScanner(99 /* Latest */, /*skipTrivia*/ false, 1 /* JSX */);\n        var ScanAction;\n        (function (ScanAction) {\n            ScanAction[ScanAction[\"Scan\"] = 0] = \"Scan\";\n            ScanAction[ScanAction[\"RescanGreaterThanToken\"] = 1] = \"RescanGreaterThanToken\";\n            ScanAction[ScanAction[\"RescanSlashToken\"] = 2] = \"RescanSlashToken\";\n            ScanAction[ScanAction[\"RescanTemplateToken\"] = 3] = \"RescanTemplateToken\";\n            ScanAction[ScanAction[\"RescanJsxIdentifier\"] = 4] = \"RescanJsxIdentifier\";\n            ScanAction[ScanAction[\"RescanJsxText\"] = 5] = \"RescanJsxText\";\n            ScanAction[ScanAction[\"RescanJsxAttributeValue\"] = 6] = \"RescanJsxAttributeValue\";\n        })(ScanAction || (ScanAction = {}));\n        function getFormattingScanner(text, languageVariant, startPos, endPos, cb) {\n            var scanner = languageVariant === 1 /* JSX */ ? jsxScanner : standardScanner;\n            scanner.setText(text);\n            scanner.setTextPos(startPos);\n            var wasNewLine = true;\n            var leadingTrivia;\n            var trailingTrivia;\n            var savedPos;\n            var lastScanAction;\n            var lastTokenInfo;\n            var res = cb({\n                advance: advance,\n                readTokenInfo: readTokenInfo,\n                readEOFTokenRange: readEOFTokenRange,\n                isOnToken: isOnToken,\n                isOnEOF: isOnEOF,\n                getCurrentLeadingTrivia: function () { return leadingTrivia; },\n                lastTrailingTriviaWasNewLine: function () { return wasNewLine; },\n                skipToEndOf: skipToEndOf,\n                skipToStartOf: skipToStartOf,\n            });\n            lastTokenInfo = undefined;\n            scanner.setText(undefined);\n            return res;\n            function advance() {\n                lastTokenInfo = undefined;\n                var isStarted = scanner.getStartPos() !== startPos;\n                if (isStarted) {\n                    wasNewLine = !!trailingTrivia && ts.last(trailingTrivia).kind === 4 /* NewLineTrivia */;\n                }\n                else {\n                    scanner.scan();\n                }\n                leadingTrivia = undefined;\n                trailingTrivia = undefined;\n                var pos = scanner.getStartPos();\n                // Read leading trivia and token\n                while (pos < endPos) {\n                    var t = scanner.getToken();\n                    if (!ts.isTrivia(t)) {\n                        break;\n                    }\n                    // consume leading trivia\n                    scanner.scan();\n                    var item = {\n                        pos: pos,\n                        end: scanner.getStartPos(),\n                        kind: t\n                    };\n                    pos = scanner.getStartPos();\n                    leadingTrivia = ts.append(leadingTrivia, item);\n                }\n                savedPos = scanner.getStartPos();\n            }\n            function shouldRescanGreaterThanToken(node) {\n                switch (node.kind) {\n                    case 33 /* GreaterThanEqualsToken */:\n                    case 70 /* GreaterThanGreaterThanEqualsToken */:\n                    case 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */:\n                    case 49 /* GreaterThanGreaterThanGreaterThanToken */:\n                    case 48 /* GreaterThanGreaterThanToken */:\n                        return true;\n                }\n                return false;\n            }\n            function shouldRescanJsxIdentifier(node) {\n                if (node.parent) {\n                    switch (node.parent.kind) {\n                        case 280 /* JsxAttribute */:\n                        case 275 /* JsxOpeningElement */:\n                        case 276 /* JsxClosingElement */:\n                        case 274 /* JsxSelfClosingElement */:\n                            // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier.\n                            return ts.isKeyword(node.kind) || node.kind === 78 /* Identifier */;\n                    }\n                }\n                return false;\n            }\n            function shouldRescanJsxText(node) {\n                var isJSXText = ts.isJsxText(node);\n                if (isJSXText) {\n                    var containingElement = ts.findAncestor(node.parent, function (p) { return ts.isJsxElement(p); });\n                    if (!containingElement)\n                        return false; // should never happen\n                    return !ts.isParenthesizedExpression(containingElement.parent);\n                }\n                return false;\n            }\n            function shouldRescanSlashToken(container) {\n                return container.kind === 13 /* RegularExpressionLiteral */;\n            }\n            function shouldRescanTemplateToken(container) {\n                return container.kind === 16 /* TemplateMiddle */ ||\n                    container.kind === 17 /* TemplateTail */;\n            }\n            function shouldRescanJsxAttributeValue(node) {\n                return node.parent && ts.isJsxAttribute(node.parent) && node.parent.initializer === node;\n            }\n            function startsWithSlashToken(t) {\n                return t === 43 /* SlashToken */ || t === 67 /* SlashEqualsToken */;\n            }\n            function readTokenInfo(n) {\n                ts.Debug.assert(isOnToken());\n                // normally scanner returns the smallest available token\n                // check the kind of context node to determine if scanner should have more greedy behavior and consume more text.\n                var expectedScanAction = shouldRescanGreaterThanToken(n) ? 1 /* RescanGreaterThanToken */ :\n                    shouldRescanSlashToken(n) ? 2 /* RescanSlashToken */ :\n                        shouldRescanTemplateToken(n) ? 3 /* RescanTemplateToken */ :\n                            shouldRescanJsxIdentifier(n) ? 4 /* RescanJsxIdentifier */ :\n                                shouldRescanJsxText(n) ? 5 /* RescanJsxText */ :\n                                    shouldRescanJsxAttributeValue(n) ? 6 /* RescanJsxAttributeValue */ :\n                                        0 /* Scan */;\n                if (lastTokenInfo && expectedScanAction === lastScanAction) {\n                    // readTokenInfo was called before with the same expected scan action.\n                    // No need to re-scan text, return existing 'lastTokenInfo'\n                    // it is ok to call fixTokenKind here since it does not affect\n                    // what portion of text is consumed. In contrast rescanning can change it,\n                    // i.e. for '>=' when originally scanner eats just one character\n                    // and rescanning forces it to consume more.\n                    return fixTokenKind(lastTokenInfo, n);\n                }\n                if (scanner.getStartPos() !== savedPos) {\n                    ts.Debug.assert(lastTokenInfo !== undefined);\n                    // readTokenInfo was called before but scan action differs - rescan text\n                    scanner.setTextPos(savedPos);\n                    scanner.scan();\n                }\n                var currentToken = getNextToken(n, expectedScanAction);\n                var token = formatting.createTextRangeWithKind(scanner.getStartPos(), scanner.getTextPos(), currentToken);\n                // consume trailing trivia\n                if (trailingTrivia) {\n                    trailingTrivia = undefined;\n                }\n                while (scanner.getStartPos() < endPos) {\n                    currentToken = scanner.scan();\n                    if (!ts.isTrivia(currentToken)) {\n                        break;\n                    }\n                    var trivia = formatting.createTextRangeWithKind(scanner.getStartPos(), scanner.getTextPos(), currentToken);\n                    if (!trailingTrivia) {\n                        trailingTrivia = [];\n                    }\n                    trailingTrivia.push(trivia);\n                    if (currentToken === 4 /* NewLineTrivia */) {\n                        // move past new line\n                        scanner.scan();\n                        break;\n                    }\n                }\n                lastTokenInfo = { leadingTrivia: leadingTrivia, trailingTrivia: trailingTrivia, token: token };\n                return fixTokenKind(lastTokenInfo, n);\n            }\n            function getNextToken(n, expectedScanAction) {\n                var token = scanner.getToken();\n                lastScanAction = 0 /* Scan */;\n                switch (expectedScanAction) {\n                    case 1 /* RescanGreaterThanToken */:\n                        if (token === 31 /* GreaterThanToken */) {\n                            lastScanAction = 1 /* RescanGreaterThanToken */;\n                            var newToken = scanner.reScanGreaterToken();\n                            ts.Debug.assert(n.kind === newToken);\n                            return newToken;\n                        }\n                        break;\n                    case 2 /* RescanSlashToken */:\n                        if (startsWithSlashToken(token)) {\n                            lastScanAction = 2 /* RescanSlashToken */;\n                            var newToken = scanner.reScanSlashToken();\n                            ts.Debug.assert(n.kind === newToken);\n                            return newToken;\n                        }\n                        break;\n                    case 3 /* RescanTemplateToken */:\n                        if (token === 19 /* CloseBraceToken */) {\n                            lastScanAction = 3 /* RescanTemplateToken */;\n                            return scanner.reScanTemplateToken(/* isTaggedTemplate */ false);\n                        }\n                        break;\n                    case 4 /* RescanJsxIdentifier */:\n                        lastScanAction = 4 /* RescanJsxIdentifier */;\n                        return scanner.scanJsxIdentifier();\n                    case 5 /* RescanJsxText */:\n                        lastScanAction = 5 /* RescanJsxText */;\n                        return scanner.reScanJsxToken();\n                    case 6 /* RescanJsxAttributeValue */:\n                        lastScanAction = 6 /* RescanJsxAttributeValue */;\n                        return scanner.reScanJsxAttributeValue();\n                    case 0 /* Scan */:\n                        break;\n                    default:\n                        ts.Debug.assertNever(expectedScanAction);\n                }\n                return token;\n            }\n            function readEOFTokenRange() {\n                ts.Debug.assert(isOnEOF());\n                return formatting.createTextRangeWithKind(scanner.getStartPos(), scanner.getTextPos(), 1 /* EndOfFileToken */);\n            }\n            function isOnToken() {\n                var current = lastTokenInfo ? lastTokenInfo.token.kind : scanner.getToken();\n                var startPos = lastTokenInfo ? lastTokenInfo.token.pos : scanner.getStartPos();\n                return startPos < endPos && current !== 1 /* EndOfFileToken */ && !ts.isTrivia(current);\n            }\n            function isOnEOF() {\n                var current = lastTokenInfo ? lastTokenInfo.token.kind : scanner.getToken();\n                return current === 1 /* EndOfFileToken */;\n            }\n            // when containing node in the tree is token\n            // but its kind differs from the kind that was returned by the scanner,\n            // then kind needs to be fixed. This might happen in cases\n            // when parser interprets token differently, i.e keyword treated as identifier\n            function fixTokenKind(tokenInfo, container) {\n                if (ts.isToken(container) && tokenInfo.token.kind !== container.kind) {\n                    tokenInfo.token.kind = container.kind;\n                }\n                return tokenInfo;\n            }\n            function skipToEndOf(node) {\n                scanner.setTextPos(node.end);\n                savedPos = scanner.getStartPos();\n                lastScanAction = undefined;\n                lastTokenInfo = undefined;\n                wasNewLine = false;\n                leadingTrivia = undefined;\n                trailingTrivia = undefined;\n            }\n            function skipToStartOf(node) {\n                scanner.setTextPos(node.pos);\n                savedPos = scanner.getStartPos();\n                lastScanAction = undefined;\n                lastTokenInfo = undefined;\n                wasNewLine = false;\n                leadingTrivia = undefined;\n                trailingTrivia = undefined;\n            }\n        }\n        formatting.getFormattingScanner = getFormattingScanner;\n    })(formatting = ts.formatting || (ts.formatting = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var formatting;\n    (function (formatting) {\n        formatting.anyContext = ts.emptyArray;\n        var RuleAction;\n        (function (RuleAction) {\n            RuleAction[RuleAction[\"StopProcessingSpaceActions\"] = 1] = \"StopProcessingSpaceActions\";\n            RuleAction[RuleAction[\"StopProcessingTokenActions\"] = 2] = \"StopProcessingTokenActions\";\n            RuleAction[RuleAction[\"InsertSpace\"] = 4] = \"InsertSpace\";\n            RuleAction[RuleAction[\"InsertNewLine\"] = 8] = \"InsertNewLine\";\n            RuleAction[RuleAction[\"DeleteSpace\"] = 16] = \"DeleteSpace\";\n            RuleAction[RuleAction[\"DeleteToken\"] = 32] = \"DeleteToken\";\n            RuleAction[RuleAction[\"InsertTrailingSemicolon\"] = 64] = \"InsertTrailingSemicolon\";\n            RuleAction[RuleAction[\"StopAction\"] = 3] = \"StopAction\";\n            RuleAction[RuleAction[\"ModifySpaceAction\"] = 28] = \"ModifySpaceAction\";\n            RuleAction[RuleAction[\"ModifyTokenAction\"] = 96] = \"ModifyTokenAction\";\n        })(RuleAction = formatting.RuleAction || (formatting.RuleAction = {}));\n        var RuleFlags;\n        (function (RuleFlags) {\n            RuleFlags[RuleFlags[\"None\"] = 0] = \"None\";\n            RuleFlags[RuleFlags[\"CanDeleteNewLines\"] = 1] = \"CanDeleteNewLines\";\n        })(RuleFlags = formatting.RuleFlags || (formatting.RuleFlags = {}));\n    })(formatting = ts.formatting || (ts.formatting = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var formatting;\n    (function (formatting) {\n        function getAllRules() {\n            var allTokens = [];\n            for (var token = 0 /* FirstToken */; token <= 156 /* LastToken */; token++) {\n                if (token !== 1 /* EndOfFileToken */) {\n                    allTokens.push(token);\n                }\n            }\n            function anyTokenExcept() {\n                var tokens = [];\n                for (var _i = 0; _i < arguments.length; _i++) {\n                    tokens[_i] = arguments[_i];\n                }\n                return { tokens: allTokens.filter(function (t) { return !tokens.some(function (t2) { return t2 === t; }); }), isSpecific: false };\n            }\n            var anyToken = { tokens: allTokens, isSpecific: false };\n            var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArray(__spreadArray([], allTokens), [3 /* MultiLineCommentTrivia */]));\n            var anyTokenIncludingEOF = tokenRangeFrom(__spreadArray(__spreadArray([], allTokens), [1 /* EndOfFileToken */]));\n            var keywords = tokenRangeFromRange(80 /* FirstKeyword */, 156 /* LastKeyword */);\n            var binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 77 /* LastBinaryOperator */);\n            var binaryKeywordOperators = [100 /* InKeyword */, 101 /* InstanceOfKeyword */, 156 /* OfKeyword */, 126 /* AsKeyword */, 137 /* IsKeyword */];\n            var unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */];\n            var unaryPrefixExpressions = [\n                8 /* NumericLiteral */, 9 /* BigIntLiteral */, 78 /* Identifier */, 20 /* OpenParenToken */,\n                22 /* OpenBracketToken */, 18 /* OpenBraceToken */, 107 /* ThisKeyword */, 102 /* NewKeyword */\n            ];\n            var unaryPreincrementExpressions = [78 /* Identifier */, 20 /* OpenParenToken */, 107 /* ThisKeyword */, 102 /* NewKeyword */];\n            var unaryPostincrementExpressions = [78 /* Identifier */, 21 /* CloseParenToken */, 23 /* CloseBracketToken */, 102 /* NewKeyword */];\n            var unaryPredecrementExpressions = [78 /* Identifier */, 20 /* OpenParenToken */, 107 /* ThisKeyword */, 102 /* NewKeyword */];\n            var unaryPostdecrementExpressions = [78 /* Identifier */, 21 /* CloseParenToken */, 23 /* CloseBracketToken */, 102 /* NewKeyword */];\n            var comments = [2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */];\n            var typeNames = __spreadArray([78 /* Identifier */], ts.typeKeywords);\n            // Place a space before open brace in a function declaration\n            // TypeScript: Function can have return types, which can be made of tons of different token kinds\n            var functionOpenBraceLeftTokenRange = anyTokenIncludingMultilineComments;\n            // Place a space before open brace in a TypeScript declaration that has braces as children (class, module, enum, etc)\n            var typeScriptOpenBraceLeftTokenRange = tokenRangeFrom([78 /* Identifier */, 3 /* MultiLineCommentTrivia */, 83 /* ClassKeyword */, 92 /* ExportKeyword */, 99 /* ImportKeyword */]);\n            // Place a space before open brace in a control flow construct\n            var controlOpenBraceLeftTokenRange = tokenRangeFrom([21 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 89 /* DoKeyword */, 110 /* TryKeyword */, 95 /* FinallyKeyword */, 90 /* ElseKeyword */]);\n            // These rules are higher in priority than user-configurable\n            var highPriorityCommonRules = [\n                // Leave comments alone\n                rule(\"IgnoreBeforeComment\", anyToken, comments, formatting.anyContext, 1 /* StopProcessingSpaceActions */),\n                rule(\"IgnoreAfterLineComment\", 2 /* SingleLineCommentTrivia */, anyToken, formatting.anyContext, 1 /* StopProcessingSpaceActions */),\n                rule(\"NotSpaceBeforeColon\", anyToken, 58 /* ColonToken */, [isNonJsxSameLineTokenContext, isNotBinaryOpContext, isNotTypeAnnotationContext], 16 /* DeleteSpace */),\n                rule(\"SpaceAfterColon\", 58 /* ColonToken */, anyToken, [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceBeforeQuestionMark\", anyToken, 57 /* QuestionToken */, [isNonJsxSameLineTokenContext, isNotBinaryOpContext, isNotTypeAnnotationContext], 16 /* DeleteSpace */),\n                // insert space after '?' only when it is used in conditional operator\n                rule(\"SpaceAfterQuestionMarkInConditionalOperator\", 57 /* QuestionToken */, anyToken, [isNonJsxSameLineTokenContext, isConditionalOperatorContext], 4 /* InsertSpace */),\n                // in other cases there should be no space between '?' and next token\n                rule(\"NoSpaceAfterQuestionMark\", 57 /* QuestionToken */, anyToken, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceBeforeDot\", anyToken, [24 /* DotToken */, 28 /* QuestionDotToken */], [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceAfterDot\", [24 /* DotToken */, 28 /* QuestionDotToken */], anyToken, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceBetweenImportParenInImportType\", 99 /* ImportKeyword */, 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext, isImportTypeContext], 16 /* DeleteSpace */),\n                // Special handling of unary operators.\n                // Prefix operators generally shouldn't have a space between\n                // them and their target unary expression.\n                rule(\"NoSpaceAfterUnaryPrefixOperator\", unaryPrefixOperators, unaryPrefixExpressions, [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceAfterUnaryPreincrementOperator\", 45 /* PlusPlusToken */, unaryPreincrementExpressions, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceAfterUnaryPredecrementOperator\", 46 /* MinusMinusToken */, unaryPredecrementExpressions, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceBeforeUnaryPostincrementOperator\", unaryPostincrementExpressions, 45 /* PlusPlusToken */, [isNonJsxSameLineTokenContext, isNotStatementConditionContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceBeforeUnaryPostdecrementOperator\", unaryPostdecrementExpressions, 46 /* MinusMinusToken */, [isNonJsxSameLineTokenContext, isNotStatementConditionContext], 16 /* DeleteSpace */),\n                // More unary operator special-casing.\n                // DevDiv 181814: Be careful when removing leading whitespace\n                // around unary operators.  Examples:\n                //      1 - -2  --X--> 1--2\n                //      a + ++b --X--> a+++b\n                rule(\"SpaceAfterPostincrementWhenFollowedByAdd\", 45 /* PlusPlusToken */, 39 /* PlusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */),\n                rule(\"SpaceAfterAddWhenFollowedByUnaryPlus\", 39 /* PlusToken */, 39 /* PlusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */),\n                rule(\"SpaceAfterAddWhenFollowedByPreincrement\", 39 /* PlusToken */, 45 /* PlusPlusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */),\n                rule(\"SpaceAfterPostdecrementWhenFollowedBySubtract\", 46 /* MinusMinusToken */, 40 /* MinusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */),\n                rule(\"SpaceAfterSubtractWhenFollowedByUnaryMinus\", 40 /* MinusToken */, 40 /* MinusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */),\n                rule(\"SpaceAfterSubtractWhenFollowedByPredecrement\", 40 /* MinusToken */, 46 /* MinusMinusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceAfterCloseBrace\", 19 /* CloseBraceToken */, [27 /* CommaToken */, 26 /* SemicolonToken */], [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                // For functions and control block place } on a new line [multi-line rule]\n                rule(\"NewLineBeforeCloseBraceInBlockContext\", anyTokenIncludingMultilineComments, 19 /* CloseBraceToken */, [isMultilineBlockContext], 8 /* InsertNewLine */),\n                // Space/new line after }.\n                rule(\"SpaceAfterCloseBrace\", 19 /* CloseBraceToken */, anyTokenExcept(21 /* CloseParenToken */), [isNonJsxSameLineTokenContext, isAfterCodeBlockContext], 4 /* InsertSpace */),\n                // Special case for (}, else) and (}, while) since else & while tokens are not part of the tree which makes SpaceAfterCloseBrace rule not applied\n                // Also should not apply to })\n                rule(\"SpaceBetweenCloseBraceAndElse\", 19 /* CloseBraceToken */, 90 /* ElseKeyword */, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                rule(\"SpaceBetweenCloseBraceAndWhile\", 19 /* CloseBraceToken */, 114 /* WhileKeyword */, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceBetweenEmptyBraceBrackets\", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectContext], 16 /* DeleteSpace */),\n                // Add a space after control dec context if the next character is an open bracket ex: 'if (false)[a, b] = [1, 2];' -> 'if (false) [a, b] = [1, 2];'\n                rule(\"SpaceAfterConditionalClosingParen\", 21 /* CloseParenToken */, 22 /* OpenBracketToken */, [isControlDeclContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceBetweenFunctionKeywordAndStar\", 97 /* FunctionKeyword */, 41 /* AsteriskToken */, [isFunctionDeclarationOrFunctionExpressionContext], 16 /* DeleteSpace */),\n                rule(\"SpaceAfterStarInGeneratorDeclaration\", 41 /* AsteriskToken */, 78 /* Identifier */, [isFunctionDeclarationOrFunctionExpressionContext], 4 /* InsertSpace */),\n                rule(\"SpaceAfterFunctionInFuncDecl\", 97 /* FunctionKeyword */, anyToken, [isFunctionDeclContext], 4 /* InsertSpace */),\n                // Insert new line after { and before } in multi-line contexts.\n                rule(\"NewLineAfterOpenBraceInBlockContext\", 18 /* OpenBraceToken */, anyToken, [isMultilineBlockContext], 8 /* InsertNewLine */),\n                // For get/set members, we check for (identifier,identifier) since get/set don't have tokens and they are represented as just an identifier token.\n                // Though, we do extra check on the context to make sure we are dealing with get/set node. Example:\n                //      get x() {}\n                //      set x(val) {}\n                rule(\"SpaceAfterGetSetInMember\", [134 /* GetKeyword */, 146 /* SetKeyword */], 78 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceBetweenYieldKeywordAndStar\", 124 /* YieldKeyword */, 41 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 16 /* DeleteSpace */),\n                rule(\"SpaceBetweenYieldOrYieldStarAndOperand\", [124 /* YieldKeyword */, 41 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 4 /* InsertSpace */),\n                rule(\"NoSpaceBetweenReturnAndSemicolon\", 104 /* ReturnKeyword */, 26 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"SpaceAfterCertainKeywords\", [112 /* VarKeyword */, 108 /* ThrowKeyword */, 102 /* NewKeyword */, 88 /* DeleteKeyword */, 104 /* ReturnKeyword */, 111 /* TypeOfKeyword */, 130 /* AwaitKeyword */], anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                rule(\"SpaceAfterLetConstInVariableDeclaration\", [118 /* LetKeyword */, 84 /* ConstKeyword */], anyToken, [isNonJsxSameLineTokenContext, isStartOfVariableDeclarationList], 4 /* InsertSpace */),\n                rule(\"NoSpaceBeforeOpenParenInFuncCall\", anyToken, 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext, isFunctionCallOrNewContext, isPreviousTokenNotComma], 16 /* DeleteSpace */),\n                // Special case for binary operators (that are keywords). For these we have to add a space and shouldn't follow any user options.\n                rule(\"SpaceBeforeBinaryKeywordOperator\", anyToken, binaryKeywordOperators, [isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */),\n                rule(\"SpaceAfterBinaryKeywordOperator\", binaryKeywordOperators, anyToken, [isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */),\n                rule(\"SpaceAfterVoidOperator\", 113 /* VoidKeyword */, anyToken, [isNonJsxSameLineTokenContext, isVoidOpContext], 4 /* InsertSpace */),\n                // Async-await\n                rule(\"SpaceBetweenAsyncAndOpenParen\", 129 /* AsyncKeyword */, 20 /* OpenParenToken */, [isArrowFunctionContext, isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                rule(\"SpaceBetweenAsyncAndFunctionKeyword\", 129 /* AsyncKeyword */, [97 /* FunctionKeyword */, 78 /* Identifier */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                // Template string\n                rule(\"NoSpaceBetweenTagAndTemplateString\", [78 /* Identifier */, 21 /* CloseParenToken */], [14 /* NoSubstitutionTemplateLiteral */, 15 /* TemplateHead */], [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                // JSX opening elements\n                rule(\"SpaceBeforeJsxAttribute\", anyToken, 78 /* Identifier */, [isNextTokenParentJsxAttribute, isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                rule(\"SpaceBeforeSlashInJsxOpeningElement\", anyToken, 43 /* SlashToken */, [isJsxSelfClosingElementContext, isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceBeforeGreaterThanTokenInJsxOpeningElement\", 43 /* SlashToken */, 31 /* GreaterThanToken */, [isJsxSelfClosingElementContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceBeforeEqualInJsxAttribute\", anyToken, 62 /* EqualsToken */, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceAfterEqualInJsxAttribute\", 62 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                // TypeScript-specific rules\n                // Use of module as a function call. e.g.: import m2 = module(\"m2\");\n                rule(\"NoSpaceAfterModuleImport\", [139 /* ModuleKeyword */, 143 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                // Add a space around certain TypeScript keywords\n                rule(\"SpaceAfterCertainTypeScriptKeywords\", [\n                    125 /* AbstractKeyword */,\n                    83 /* ClassKeyword */,\n                    133 /* DeclareKeyword */,\n                    87 /* DefaultKeyword */,\n                    91 /* EnumKeyword */,\n                    92 /* ExportKeyword */,\n                    93 /* ExtendsKeyword */,\n                    134 /* GetKeyword */,\n                    116 /* ImplementsKeyword */,\n                    99 /* ImportKeyword */,\n                    117 /* InterfaceKeyword */,\n                    139 /* ModuleKeyword */,\n                    140 /* NamespaceKeyword */,\n                    120 /* PrivateKeyword */,\n                    122 /* PublicKeyword */,\n                    121 /* ProtectedKeyword */,\n                    142 /* ReadonlyKeyword */,\n                    146 /* SetKeyword */,\n                    123 /* StaticKeyword */,\n                    149 /* TypeKeyword */,\n                    153 /* FromKeyword */,\n                    138 /* KeyOfKeyword */,\n                    135 /* InferKeyword */,\n                ], anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                rule(\"SpaceBeforeCertainTypeScriptKeywords\", anyToken, [93 /* ExtendsKeyword */, 116 /* ImplementsKeyword */, 153 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module \"m2\" {\n                rule(\"SpaceAfterModuleName\", 10 /* StringLiteral */, 18 /* OpenBraceToken */, [isModuleDeclContext], 4 /* InsertSpace */),\n                // Lambda expressions\n                rule(\"SpaceBeforeArrow\", anyToken, 38 /* EqualsGreaterThanToken */, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                rule(\"SpaceAfterArrow\", 38 /* EqualsGreaterThanToken */, anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                // Optional parameters and let args\n                rule(\"NoSpaceAfterEllipsis\", 25 /* DotDotDotToken */, 78 /* Identifier */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceAfterOptionalParameters\", 57 /* QuestionToken */, [21 /* CloseParenToken */, 27 /* CommaToken */], [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 16 /* DeleteSpace */),\n                // Remove spaces in empty interface literals. e.g.: x: {}\n                rule(\"NoSpaceBetweenEmptyInterfaceBraceBrackets\", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectTypeContext], 16 /* DeleteSpace */),\n                // generics and type assertions\n                rule(\"NoSpaceBeforeOpenAngularBracket\", typeNames, 29 /* LessThanToken */, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceBetweenCloseParenAndAngularBracket\", 21 /* CloseParenToken */, 29 /* LessThanToken */, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceAfterOpenAngularBracket\", 29 /* LessThanToken */, anyToken, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceBeforeCloseAngularBracket\", anyToken, 31 /* GreaterThanToken */, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceAfterCloseAngularBracket\", 31 /* GreaterThanToken */, [20 /* OpenParenToken */, 22 /* OpenBracketToken */, 31 /* GreaterThanToken */, 27 /* CommaToken */], [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext, isNotFunctionDeclContext /*To prevent an interference with the SpaceBeforeOpenParenInFuncDecl rule*/], 16 /* DeleteSpace */),\n                // decorators\n                rule(\"SpaceBeforeAt\", [21 /* CloseParenToken */, 78 /* Identifier */], 59 /* AtToken */, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceAfterAt\", 59 /* AtToken */, anyToken, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                // Insert space after @ in decorator\n                rule(\"SpaceAfterDecorator\", anyToken, [\n                    125 /* AbstractKeyword */,\n                    78 /* Identifier */,\n                    92 /* ExportKeyword */,\n                    87 /* DefaultKeyword */,\n                    83 /* ClassKeyword */,\n                    123 /* StaticKeyword */,\n                    122 /* PublicKeyword */,\n                    120 /* PrivateKeyword */,\n                    121 /* ProtectedKeyword */,\n                    134 /* GetKeyword */,\n                    146 /* SetKeyword */,\n                    22 /* OpenBracketToken */,\n                    41 /* AsteriskToken */,\n                ], [isEndOfDecoratorContextOnSameLine], 4 /* InsertSpace */),\n                rule(\"NoSpaceBeforeNonNullAssertionOperator\", anyToken, 53 /* ExclamationToken */, [isNonJsxSameLineTokenContext, isNonNullAssertionContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceAfterNewKeywordOnConstructorSignature\", 102 /* NewKeyword */, 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext, isConstructorSignatureContext], 16 /* DeleteSpace */),\n                rule(\"SpaceLessThanAndNonJSXTypeAnnotation\", 29 /* LessThanToken */, 29 /* LessThanToken */, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n            ];\n            // These rules are applied after high priority\n            var userConfigurableRules = [\n                // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses\n                rule(\"SpaceAfterConstructor\", 132 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled(\"insertSpaceAfterConstructor\"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceAfterConstructor\", 132 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined(\"insertSpaceAfterConstructor\"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"SpaceAfterComma\", 27 /* CommaToken */, anyToken, [isOptionEnabled(\"insertSpaceAfterCommaDelimiter\"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket, isNextTokenNotCloseParen], 4 /* InsertSpace */),\n                rule(\"NoSpaceAfterComma\", 27 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined(\"insertSpaceAfterCommaDelimiter\"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], 16 /* DeleteSpace */),\n                // Insert space after function keyword for anonymous functions\n                rule(\"SpaceAfterAnonymousFunctionKeyword\", [97 /* FunctionKeyword */, 41 /* AsteriskToken */], 20 /* OpenParenToken */, [isOptionEnabled(\"insertSpaceAfterFunctionKeywordForAnonymousFunctions\"), isFunctionDeclContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceAfterAnonymousFunctionKeyword\", [97 /* FunctionKeyword */, 41 /* AsteriskToken */], 20 /* OpenParenToken */, [isOptionDisabledOrUndefined(\"insertSpaceAfterFunctionKeywordForAnonymousFunctions\"), isFunctionDeclContext], 16 /* DeleteSpace */),\n                // Insert space after keywords in control flow statements\n                rule(\"SpaceAfterKeywordInControl\", keywords, 20 /* OpenParenToken */, [isOptionEnabled(\"insertSpaceAfterKeywordsInControlFlowStatements\"), isControlDeclContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceAfterKeywordInControl\", keywords, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined(\"insertSpaceAfterKeywordsInControlFlowStatements\"), isControlDeclContext], 16 /* DeleteSpace */),\n                // Insert space after opening and before closing nonempty parenthesis\n                rule(\"SpaceAfterOpenParen\", 20 /* OpenParenToken */, anyToken, [isOptionEnabled(\"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis\"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                rule(\"SpaceBeforeCloseParen\", anyToken, 21 /* CloseParenToken */, [isOptionEnabled(\"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis\"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                rule(\"SpaceBetweenOpenParens\", 20 /* OpenParenToken */, 20 /* OpenParenToken */, [isOptionEnabled(\"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis\"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceBetweenParens\", 20 /* OpenParenToken */, 21 /* CloseParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceAfterOpenParen\", 20 /* OpenParenToken */, anyToken, [isOptionDisabledOrUndefined(\"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis\"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceBeforeCloseParen\", anyToken, 21 /* CloseParenToken */, [isOptionDisabledOrUndefined(\"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis\"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                // Insert space after opening and before closing nonempty brackets\n                rule(\"SpaceAfterOpenBracket\", 22 /* OpenBracketToken */, anyToken, [isOptionEnabled(\"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets\"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                rule(\"SpaceBeforeCloseBracket\", anyToken, 23 /* CloseBracketToken */, [isOptionEnabled(\"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets\"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceBetweenBrackets\", 22 /* OpenBracketToken */, 23 /* CloseBracketToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceAfterOpenBracket\", 22 /* OpenBracketToken */, anyToken, [isOptionDisabledOrUndefined(\"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets\"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceBeforeCloseBracket\", anyToken, 23 /* CloseBracketToken */, [isOptionDisabledOrUndefined(\"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets\"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                // Insert a space after { and before } in single-line contexts, but remove space from empty object literals {}.\n                rule(\"SpaceAfterOpenBrace\", 18 /* OpenBraceToken */, anyToken, [isOptionEnabledOrUndefined(\"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces\"), isBraceWrappedContext], 4 /* InsertSpace */),\n                rule(\"SpaceBeforeCloseBrace\", anyToken, 19 /* CloseBraceToken */, [isOptionEnabledOrUndefined(\"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces\"), isBraceWrappedContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceBetweenEmptyBraceBrackets\", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceAfterOpenBrace\", 18 /* OpenBraceToken */, anyToken, [isOptionDisabled(\"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces\"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceBeforeCloseBrace\", anyToken, 19 /* CloseBraceToken */, [isOptionDisabled(\"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces\"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                // Insert a space after opening and before closing empty brace brackets\n                rule(\"SpaceBetweenEmptyBraceBrackets\", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isOptionEnabled(\"insertSpaceAfterOpeningAndBeforeClosingEmptyBraces\")], 4 /* InsertSpace */),\n                rule(\"NoSpaceBetweenEmptyBraceBrackets\", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isOptionDisabled(\"insertSpaceAfterOpeningAndBeforeClosingEmptyBraces\"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                // Insert space after opening and before closing template string braces\n                rule(\"SpaceAfterTemplateHeadAndMiddle\", [15 /* TemplateHead */, 16 /* TemplateMiddle */], anyToken, [isOptionEnabled(\"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces\"), isNonJsxTextContext], 4 /* InsertSpace */, 1 /* CanDeleteNewLines */),\n                rule(\"SpaceBeforeTemplateMiddleAndTail\", anyToken, [16 /* TemplateMiddle */, 17 /* TemplateTail */], [isOptionEnabled(\"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces\"), isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceAfterTemplateHeadAndMiddle\", [15 /* TemplateHead */, 16 /* TemplateMiddle */], anyToken, [isOptionDisabledOrUndefined(\"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces\"), isNonJsxTextContext], 16 /* DeleteSpace */, 1 /* CanDeleteNewLines */),\n                rule(\"NoSpaceBeforeTemplateMiddleAndTail\", anyToken, [16 /* TemplateMiddle */, 17 /* TemplateTail */], [isOptionDisabledOrUndefined(\"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces\"), isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                // No space after { and before } in JSX expression\n                rule(\"SpaceAfterOpenBraceInJsxExpression\", 18 /* OpenBraceToken */, anyToken, [isOptionEnabled(\"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces\"), isNonJsxSameLineTokenContext, isJsxExpressionContext], 4 /* InsertSpace */),\n                rule(\"SpaceBeforeCloseBraceInJsxExpression\", anyToken, 19 /* CloseBraceToken */, [isOptionEnabled(\"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces\"), isNonJsxSameLineTokenContext, isJsxExpressionContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceAfterOpenBraceInJsxExpression\", 18 /* OpenBraceToken */, anyToken, [isOptionDisabledOrUndefined(\"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces\"), isNonJsxSameLineTokenContext, isJsxExpressionContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceBeforeCloseBraceInJsxExpression\", anyToken, 19 /* CloseBraceToken */, [isOptionDisabledOrUndefined(\"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces\"), isNonJsxSameLineTokenContext, isJsxExpressionContext], 16 /* DeleteSpace */),\n                // Insert space after semicolon in for statement\n                rule(\"SpaceAfterSemicolonInFor\", 26 /* SemicolonToken */, anyToken, [isOptionEnabled(\"insertSpaceAfterSemicolonInForStatements\"), isNonJsxSameLineTokenContext, isForContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceAfterSemicolonInFor\", 26 /* SemicolonToken */, anyToken, [isOptionDisabledOrUndefined(\"insertSpaceAfterSemicolonInForStatements\"), isNonJsxSameLineTokenContext, isForContext], 16 /* DeleteSpace */),\n                // Insert space before and after binary operators\n                rule(\"SpaceBeforeBinaryOperator\", anyToken, binaryOperators, [isOptionEnabled(\"insertSpaceBeforeAndAfterBinaryOperators\"), isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */),\n                rule(\"SpaceAfterBinaryOperator\", binaryOperators, anyToken, [isOptionEnabled(\"insertSpaceBeforeAndAfterBinaryOperators\"), isNonJsxSameLineTokenContext, isBinaryOpContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceBeforeBinaryOperator\", anyToken, binaryOperators, [isOptionDisabledOrUndefined(\"insertSpaceBeforeAndAfterBinaryOperators\"), isNonJsxSameLineTokenContext, isBinaryOpContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceAfterBinaryOperator\", binaryOperators, anyToken, [isOptionDisabledOrUndefined(\"insertSpaceBeforeAndAfterBinaryOperators\"), isNonJsxSameLineTokenContext, isBinaryOpContext], 16 /* DeleteSpace */),\n                rule(\"SpaceBeforeOpenParenInFuncDecl\", anyToken, 20 /* OpenParenToken */, [isOptionEnabled(\"insertSpaceBeforeFunctionParenthesis\"), isNonJsxSameLineTokenContext, isFunctionDeclContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceBeforeOpenParenInFuncDecl\", anyToken, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined(\"insertSpaceBeforeFunctionParenthesis\"), isNonJsxSameLineTokenContext, isFunctionDeclContext], 16 /* DeleteSpace */),\n                // Open Brace braces after control block\n                rule(\"NewLineBeforeOpenBraceInControl\", controlOpenBraceLeftTokenRange, 18 /* OpenBraceToken */, [isOptionEnabled(\"placeOpenBraceOnNewLineForControlBlocks\"), isControlDeclContext, isBeforeMultilineBlockContext], 8 /* InsertNewLine */, 1 /* CanDeleteNewLines */),\n                // Open Brace braces after function\n                // TypeScript: Function can have return types, which can be made of tons of different token kinds\n                rule(\"NewLineBeforeOpenBraceInFunction\", functionOpenBraceLeftTokenRange, 18 /* OpenBraceToken */, [isOptionEnabled(\"placeOpenBraceOnNewLineForFunctions\"), isFunctionDeclContext, isBeforeMultilineBlockContext], 8 /* InsertNewLine */, 1 /* CanDeleteNewLines */),\n                // Open Brace braces after TypeScript module/class/interface\n                rule(\"NewLineBeforeOpenBraceInTypeScriptDeclWithBlock\", typeScriptOpenBraceLeftTokenRange, 18 /* OpenBraceToken */, [isOptionEnabled(\"placeOpenBraceOnNewLineForFunctions\"), isTypeScriptDeclWithBlockContext, isBeforeMultilineBlockContext], 8 /* InsertNewLine */, 1 /* CanDeleteNewLines */),\n                rule(\"SpaceAfterTypeAssertion\", 31 /* GreaterThanToken */, anyToken, [isOptionEnabled(\"insertSpaceAfterTypeAssertion\"), isNonJsxSameLineTokenContext, isTypeAssertionContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceAfterTypeAssertion\", 31 /* GreaterThanToken */, anyToken, [isOptionDisabledOrUndefined(\"insertSpaceAfterTypeAssertion\"), isNonJsxSameLineTokenContext, isTypeAssertionContext], 16 /* DeleteSpace */),\n                rule(\"SpaceBeforeTypeAnnotation\", anyToken, [57 /* QuestionToken */, 58 /* ColonToken */], [isOptionEnabled(\"insertSpaceBeforeTypeAnnotation\"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], 4 /* InsertSpace */),\n                rule(\"NoSpaceBeforeTypeAnnotation\", anyToken, [57 /* QuestionToken */, 58 /* ColonToken */], [isOptionDisabledOrUndefined(\"insertSpaceBeforeTypeAnnotation\"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], 16 /* DeleteSpace */),\n                rule(\"NoOptionalSemicolon\", 26 /* SemicolonToken */, anyTokenIncludingEOF, [optionEquals(\"semicolons\", ts.SemicolonPreference.Remove), isSemicolonDeletionContext], 32 /* DeleteToken */),\n                rule(\"OptionalSemicolon\", anyToken, anyTokenIncludingEOF, [optionEquals(\"semicolons\", ts.SemicolonPreference.Insert), isSemicolonInsertionContext], 64 /* InsertTrailingSemicolon */),\n            ];\n            // These rules are lower in priority than user-configurable. Rules earlier in this list have priority over rules later in the list.\n            var lowPriorityCommonRules = [\n                // Space after keyword but not before ; or : or ?\n                rule(\"NoSpaceBeforeSemicolon\", anyToken, 26 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"SpaceBeforeOpenBraceInControl\", controlOpenBraceLeftTokenRange, 18 /* OpenBraceToken */, [isOptionDisabledOrUndefinedOrTokensOnSameLine(\"placeOpenBraceOnNewLineForControlBlocks\"), isControlDeclContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], 4 /* InsertSpace */, 1 /* CanDeleteNewLines */),\n                rule(\"SpaceBeforeOpenBraceInFunction\", functionOpenBraceLeftTokenRange, 18 /* OpenBraceToken */, [isOptionDisabledOrUndefinedOrTokensOnSameLine(\"placeOpenBraceOnNewLineForFunctions\"), isFunctionDeclContext, isBeforeBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], 4 /* InsertSpace */, 1 /* CanDeleteNewLines */),\n                rule(\"SpaceBeforeOpenBraceInTypeScriptDeclWithBlock\", typeScriptOpenBraceLeftTokenRange, 18 /* OpenBraceToken */, [isOptionDisabledOrUndefinedOrTokensOnSameLine(\"placeOpenBraceOnNewLineForFunctions\"), isTypeScriptDeclWithBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], 4 /* InsertSpace */, 1 /* CanDeleteNewLines */),\n                rule(\"NoSpaceBeforeComma\", anyToken, 27 /* CommaToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                // No space before and after indexer `x[]`\n                rule(\"NoSpaceBeforeOpenBracket\", anyTokenExcept(129 /* AsyncKeyword */, 81 /* CaseKeyword */), 22 /* OpenBracketToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),\n                rule(\"NoSpaceAfterCloseBracket\", 23 /* CloseBracketToken */, anyToken, [isNonJsxSameLineTokenContext, isNotBeforeBlockInFunctionDeclarationContext], 16 /* DeleteSpace */),\n                rule(\"SpaceAfterSemicolon\", 26 /* SemicolonToken */, anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                // Remove extra space between for and await\n                rule(\"SpaceBetweenForAndAwaitKeyword\", 96 /* ForKeyword */, 130 /* AwaitKeyword */, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n                // Add a space between statements. All keywords except (do,else,case) has open/close parens after them.\n                // So, we have a rule to add a space for [),Any], [do,Any], [else,Any], and [case,Any]\n                rule(\"SpaceBetweenStatements\", [21 /* CloseParenToken */, 89 /* DoKeyword */, 90 /* ElseKeyword */, 81 /* CaseKeyword */], anyToken, [isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNotForContext], 4 /* InsertSpace */),\n                // This low-pri rule takes care of \"try {\", \"catch {\" and \"finally {\" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter.\n                rule(\"SpaceAfterTryCatchFinally\", [110 /* TryKeyword */, 82 /* CatchKeyword */, 95 /* FinallyKeyword */], 18 /* OpenBraceToken */, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */),\n            ];\n            return __spreadArray(__spreadArray(__spreadArray([], highPriorityCommonRules), userConfigurableRules), lowPriorityCommonRules);\n        }\n        formatting.getAllRules = getAllRules;\n        /**\n         * A rule takes a two tokens (left/right) and a particular context\n         * for which you're meant to look at them. You then declare what should the\n         * whitespace annotation be between these tokens via the action param.\n         *\n         * @param debugName Name to print\n         * @param left The left side of the comparison\n         * @param right The right side of the comparison\n         * @param context A set of filters to narrow down the space in which this formatter rule applies\n         * @param action a declaration of the expected whitespace\n         * @param flags whether the rule deletes a line or not, defaults to no-op\n         */\n        function rule(debugName, left, right, context, action, flags) {\n            if (flags === void 0) { flags = 0 /* None */; }\n            return { leftTokenRange: toTokenRange(left), rightTokenRange: toTokenRange(right), rule: { debugName: debugName, context: context, action: action, flags: flags } };\n        }\n        function tokenRangeFrom(tokens) {\n            return { tokens: tokens, isSpecific: true };\n        }\n        function toTokenRange(arg) {\n            return typeof arg === \"number\" ? tokenRangeFrom([arg]) : ts.isArray(arg) ? tokenRangeFrom(arg) : arg;\n        }\n        function tokenRangeFromRange(from, to, except) {\n            if (except === void 0) { except = []; }\n            var tokens = [];\n            for (var token = from; token <= to; token++) {\n                if (!ts.contains(except, token)) {\n                    tokens.push(token);\n                }\n            }\n            return tokenRangeFrom(tokens);\n        }\n        ///\n        /// Contexts\n        ///\n        function optionEquals(optionName, optionValue) {\n            return function (context) { return context.options && context.options[optionName] === optionValue; };\n        }\n        function isOptionEnabled(optionName) {\n            return function (context) { return context.options && context.options.hasOwnProperty(optionName) && !!context.options[optionName]; };\n        }\n        function isOptionDisabled(optionName) {\n            return function (context) { return context.options && context.options.hasOwnProperty(optionName) && !context.options[optionName]; };\n        }\n        function isOptionDisabledOrUndefined(optionName) {\n            return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !context.options[optionName]; };\n        }\n        function isOptionDisabledOrUndefinedOrTokensOnSameLine(optionName) {\n            return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !context.options[optionName] || context.TokensAreOnSameLine(); };\n        }\n        function isOptionEnabledOrUndefined(optionName) {\n            return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; };\n        }\n        function isForContext(context) {\n            return context.contextNode.kind === 237 /* ForStatement */;\n        }\n        function isNotForContext(context) {\n            return !isForContext(context);\n        }\n        function isBinaryOpContext(context) {\n            switch (context.contextNode.kind) {\n                case 216 /* BinaryExpression */:\n                    return context.contextNode.operatorToken.kind !== 27 /* CommaToken */;\n                case 217 /* ConditionalExpression */:\n                case 184 /* ConditionalType */:\n                case 224 /* AsExpression */:\n                case 270 /* ExportSpecifier */:\n                case 265 /* ImportSpecifier */:\n                case 172 /* TypePredicate */:\n                case 182 /* UnionType */:\n                case 183 /* IntersectionType */:\n                    return true;\n                // equals in binding elements: function foo([[x, y] = [1, 2]])\n                case 198 /* BindingElement */:\n                // equals in type X = ...\n                // falls through\n                case 254 /* TypeAliasDeclaration */:\n                // equal in import a = module('a');\n                // falls through\n                case 260 /* ImportEqualsDeclaration */:\n                // equal in let a = 0\n                // falls through\n                case 249 /* VariableDeclaration */:\n                // equal in p = 0\n                // falls through\n                case 160 /* Parameter */:\n                case 291 /* EnumMember */:\n                case 163 /* PropertyDeclaration */:\n                case 162 /* PropertySignature */:\n                    return context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */;\n                // \"in\" keyword in for (let x in []) { }\n                case 238 /* ForInStatement */:\n                // \"in\" keyword in [P in keyof T]: T[P]\n                // falls through\n                case 159 /* TypeParameter */:\n                    return context.currentTokenSpan.kind === 100 /* InKeyword */ || context.nextTokenSpan.kind === 100 /* InKeyword */ || context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */;\n                // Technically, \"of\" is not a binary operator, but format it the same way as \"in\"\n                case 239 /* ForOfStatement */:\n                    return context.currentTokenSpan.kind === 156 /* OfKeyword */ || context.nextTokenSpan.kind === 156 /* OfKeyword */;\n            }\n            return false;\n        }\n        function isNotBinaryOpContext(context) {\n            return !isBinaryOpContext(context);\n        }\n        function isNotTypeAnnotationContext(context) {\n            return !isTypeAnnotationContext(context);\n        }\n        function isTypeAnnotationContext(context) {\n            var contextKind = context.contextNode.kind;\n            return contextKind === 163 /* PropertyDeclaration */ ||\n                contextKind === 162 /* PropertySignature */ ||\n                contextKind === 160 /* Parameter */ ||\n                contextKind === 249 /* VariableDeclaration */ ||\n                ts.isFunctionLikeKind(contextKind);\n        }\n        function isConditionalOperatorContext(context) {\n            return context.contextNode.kind === 217 /* ConditionalExpression */ ||\n                context.contextNode.kind === 184 /* ConditionalType */;\n        }\n        function isSameLineTokenOrBeforeBlockContext(context) {\n            return context.TokensAreOnSameLine() || isBeforeBlockContext(context);\n        }\n        function isBraceWrappedContext(context) {\n            return context.contextNode.kind === 196 /* ObjectBindingPattern */ ||\n                context.contextNode.kind === 190 /* MappedType */ ||\n                isSingleLineBlockContext(context);\n        }\n        // This check is done before an open brace in a control construct, a function, or a typescript block declaration\n        function isBeforeMultilineBlockContext(context) {\n            return isBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine());\n        }\n        function isMultilineBlockContext(context) {\n            return isBlockContext(context) && !(context.ContextNodeAllOnSameLine() || context.ContextNodeBlockIsOnOneLine());\n        }\n        function isSingleLineBlockContext(context) {\n            return isBlockContext(context) && (context.ContextNodeAllOnSameLine() || context.ContextNodeBlockIsOnOneLine());\n        }\n        function isBlockContext(context) {\n            return nodeIsBlockContext(context.contextNode);\n        }\n        function isBeforeBlockContext(context) {\n            return nodeIsBlockContext(context.nextTokenParent);\n        }\n        // IMPORTANT!!! This method must return true ONLY for nodes with open and close braces as immediate children\n        function nodeIsBlockContext(node) {\n            if (nodeIsTypeScriptDeclWithBlockContext(node)) {\n                // This means we are in a context that looks like a block to the user, but in the grammar is actually not a node (it's a class, module, enum, object type literal, etc).\n                return true;\n            }\n            switch (node.kind) {\n                case 230 /* Block */:\n                case 258 /* CaseBlock */:\n                case 200 /* ObjectLiteralExpression */:\n                case 257 /* ModuleBlock */:\n                    return true;\n            }\n            return false;\n        }\n        function isFunctionDeclContext(context) {\n            switch (context.contextNode.kind) {\n                case 251 /* FunctionDeclaration */:\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                // case SyntaxKind.MemberFunctionDeclaration:\n                // falls through\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */:\n                // case SyntaxKind.MethodSignature:\n                // falls through\n                case 169 /* CallSignature */:\n                case 208 /* FunctionExpression */:\n                case 166 /* Constructor */:\n                case 209 /* ArrowFunction */:\n                // case SyntaxKind.ConstructorDeclaration:\n                // case SyntaxKind.SimpleArrowFunctionExpression:\n                // case SyntaxKind.ParenthesizedArrowFunctionExpression:\n                // falls through\n                case 253 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one\n                    return true;\n            }\n            return false;\n        }\n        function isNotFunctionDeclContext(context) {\n            return !isFunctionDeclContext(context);\n        }\n        function isFunctionDeclarationOrFunctionExpressionContext(context) {\n            return context.contextNode.kind === 251 /* FunctionDeclaration */ || context.contextNode.kind === 208 /* FunctionExpression */;\n        }\n        function isTypeScriptDeclWithBlockContext(context) {\n            return nodeIsTypeScriptDeclWithBlockContext(context.contextNode);\n        }\n        function nodeIsTypeScriptDeclWithBlockContext(node) {\n            switch (node.kind) {\n                case 252 /* ClassDeclaration */:\n                case 221 /* ClassExpression */:\n                case 253 /* InterfaceDeclaration */:\n                case 255 /* EnumDeclaration */:\n                case 177 /* TypeLiteral */:\n                case 256 /* ModuleDeclaration */:\n                case 267 /* ExportDeclaration */:\n                case 268 /* NamedExports */:\n                case 261 /* ImportDeclaration */:\n                case 264 /* NamedImports */:\n                    return true;\n            }\n            return false;\n        }\n        function isAfterCodeBlockContext(context) {\n            switch (context.currentTokenParent.kind) {\n                case 252 /* ClassDeclaration */:\n                case 256 /* ModuleDeclaration */:\n                case 255 /* EnumDeclaration */:\n                case 287 /* CatchClause */:\n                case 257 /* ModuleBlock */:\n                case 244 /* SwitchStatement */:\n                    return true;\n                case 230 /* Block */: {\n                    var blockParent = context.currentTokenParent.parent;\n                    // In a codefix scenario, we can't rely on parents being set. So just always return true.\n                    if (!blockParent || blockParent.kind !== 209 /* ArrowFunction */ && blockParent.kind !== 208 /* FunctionExpression */) {\n                        return true;\n                    }\n                }\n            }\n            return false;\n        }\n        function isControlDeclContext(context) {\n            switch (context.contextNode.kind) {\n                case 234 /* IfStatement */:\n                case 244 /* SwitchStatement */:\n                case 237 /* ForStatement */:\n                case 238 /* ForInStatement */:\n                case 239 /* ForOfStatement */:\n                case 236 /* WhileStatement */:\n                case 247 /* TryStatement */:\n                case 235 /* DoStatement */:\n                case 243 /* WithStatement */:\n                // TODO\n                // case SyntaxKind.ElseClause:\n                // falls through\n                case 287 /* CatchClause */:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n        function isObjectContext(context) {\n            return context.contextNode.kind === 200 /* ObjectLiteralExpression */;\n        }\n        function isFunctionCallContext(context) {\n            return context.contextNode.kind === 203 /* CallExpression */;\n        }\n        function isNewContext(context) {\n            return context.contextNode.kind === 204 /* NewExpression */;\n        }\n        function isFunctionCallOrNewContext(context) {\n            return isFunctionCallContext(context) || isNewContext(context);\n        }\n        function isPreviousTokenNotComma(context) {\n            return context.currentTokenSpan.kind !== 27 /* CommaToken */;\n        }\n        function isNextTokenNotCloseBracket(context) {\n            return context.nextTokenSpan.kind !== 23 /* CloseBracketToken */;\n        }\n        function isNextTokenNotCloseParen(context) {\n            return context.nextTokenSpan.kind !== 21 /* CloseParenToken */;\n        }\n        function isArrowFunctionContext(context) {\n            return context.contextNode.kind === 209 /* ArrowFunction */;\n        }\n        function isImportTypeContext(context) {\n            return context.contextNode.kind === 195 /* ImportType */;\n        }\n        function isNonJsxSameLineTokenContext(context) {\n            return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */;\n        }\n        function isNonJsxTextContext(context) {\n            return context.contextNode.kind !== 11 /* JsxText */;\n        }\n        function isNonJsxElementOrFragmentContext(context) {\n            return context.contextNode.kind !== 273 /* JsxElement */ && context.contextNode.kind !== 277 /* JsxFragment */;\n        }\n        function isJsxExpressionContext(context) {\n            return context.contextNode.kind === 283 /* JsxExpression */ || context.contextNode.kind === 282 /* JsxSpreadAttribute */;\n        }\n        function isNextTokenParentJsxAttribute(context) {\n            return context.nextTokenParent.kind === 280 /* JsxAttribute */;\n        }\n        function isJsxAttributeContext(context) {\n            return context.contextNode.kind === 280 /* JsxAttribute */;\n        }\n        function isJsxSelfClosingElementContext(context) {\n            return context.contextNode.kind === 274 /* JsxSelfClosingElement */;\n        }\n        function isNotBeforeBlockInFunctionDeclarationContext(context) {\n            return !isFunctionDeclContext(context) && !isBeforeBlockContext(context);\n        }\n        function isEndOfDecoratorContextOnSameLine(context) {\n            return context.TokensAreOnSameLine() &&\n                !!context.contextNode.decorators &&\n                nodeIsInDecoratorContext(context.currentTokenParent) &&\n                !nodeIsInDecoratorContext(context.nextTokenParent);\n        }\n        function nodeIsInDecoratorContext(node) {\n            while (ts.isExpressionNode(node)) {\n                node = node.parent;\n            }\n            return node.kind === 161 /* Decorator */;\n        }\n        function isStartOfVariableDeclarationList(context) {\n            return context.currentTokenParent.kind === 250 /* VariableDeclarationList */ &&\n                context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos;\n        }\n        function isNotFormatOnEnter(context) {\n            return context.formattingRequestKind !== 2 /* FormatOnEnter */;\n        }\n        function isModuleDeclContext(context) {\n            return context.contextNode.kind === 256 /* ModuleDeclaration */;\n        }\n        function isObjectTypeContext(context) {\n            return context.contextNode.kind === 177 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration;\n        }\n        function isConstructorSignatureContext(context) {\n            return context.contextNode.kind === 170 /* ConstructSignature */;\n        }\n        function isTypeArgumentOrParameterOrAssertion(token, parent) {\n            if (token.kind !== 29 /* LessThanToken */ && token.kind !== 31 /* GreaterThanToken */) {\n                return false;\n            }\n            switch (parent.kind) {\n                case 173 /* TypeReference */:\n                case 206 /* TypeAssertionExpression */:\n                case 254 /* TypeAliasDeclaration */:\n                case 252 /* ClassDeclaration */:\n                case 221 /* ClassExpression */:\n                case 253 /* InterfaceDeclaration */:\n                case 251 /* FunctionDeclaration */:\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                case 169 /* CallSignature */:\n                case 170 /* ConstructSignature */:\n                case 203 /* CallExpression */:\n                case 204 /* NewExpression */:\n                case 223 /* ExpressionWithTypeArguments */:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n        function isTypeArgumentOrParameterOrAssertionContext(context) {\n            return isTypeArgumentOrParameterOrAssertion(context.currentTokenSpan, context.currentTokenParent) ||\n                isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent);\n        }\n        function isTypeAssertionContext(context) {\n            return context.contextNode.kind === 206 /* TypeAssertionExpression */;\n        }\n        function isVoidOpContext(context) {\n            return context.currentTokenSpan.kind === 113 /* VoidKeyword */ && context.currentTokenParent.kind === 212 /* VoidExpression */;\n        }\n        function isYieldOrYieldStarWithOperand(context) {\n            return context.contextNode.kind === 219 /* YieldExpression */ && context.contextNode.expression !== undefined;\n        }\n        function isNonNullAssertionContext(context) {\n            return context.contextNode.kind === 225 /* NonNullExpression */;\n        }\n        function isNotStatementConditionContext(context) {\n            return !isStatementConditionContext(context);\n        }\n        function isStatementConditionContext(context) {\n            switch (context.contextNode.kind) {\n                case 234 /* IfStatement */:\n                case 237 /* ForStatement */:\n                case 238 /* ForInStatement */:\n                case 239 /* ForOfStatement */:\n                case 235 /* DoStatement */:\n                case 236 /* WhileStatement */:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n        function isSemicolonDeletionContext(context) {\n            var nextTokenKind = context.nextTokenSpan.kind;\n            var nextTokenStart = context.nextTokenSpan.pos;\n            if (ts.isTrivia(nextTokenKind)) {\n                var nextRealToken = context.nextTokenParent === context.currentTokenParent\n                    ? ts.findNextToken(context.currentTokenParent, ts.findAncestor(context.currentTokenParent, function (a) { return !a.parent; }), context.sourceFile)\n                    : context.nextTokenParent.getFirstToken(context.sourceFile);\n                if (!nextRealToken) {\n                    return true;\n                }\n                nextTokenKind = nextRealToken.kind;\n                nextTokenStart = nextRealToken.getStart(context.sourceFile);\n            }\n            var startLine = context.sourceFile.getLineAndCharacterOfPosition(context.currentTokenSpan.pos).line;\n            var endLine = context.sourceFile.getLineAndCharacterOfPosition(nextTokenStart).line;\n            if (startLine === endLine) {\n                return nextTokenKind === 19 /* CloseBraceToken */\n                    || nextTokenKind === 1 /* EndOfFileToken */;\n            }\n            if (nextTokenKind === 229 /* SemicolonClassElement */ ||\n                nextTokenKind === 26 /* SemicolonToken */) {\n                return false;\n            }\n            if (context.contextNode.kind === 253 /* InterfaceDeclaration */ ||\n                context.contextNode.kind === 254 /* TypeAliasDeclaration */) {\n                // Can’t remove semicolon after `foo`; it would parse as a method declaration:\n                //\n                // interface I {\n                //   foo;\n                //   (): void\n                // }\n                return !ts.isPropertySignature(context.currentTokenParent)\n                    || !!context.currentTokenParent.type\n                    || nextTokenKind !== 20 /* OpenParenToken */;\n            }\n            if (ts.isPropertyDeclaration(context.currentTokenParent)) {\n                return !context.currentTokenParent.initializer;\n            }\n            return context.currentTokenParent.kind !== 237 /* ForStatement */\n                && context.currentTokenParent.kind !== 231 /* EmptyStatement */\n                && context.currentTokenParent.kind !== 229 /* SemicolonClassElement */\n                && nextTokenKind !== 22 /* OpenBracketToken */\n                && nextTokenKind !== 20 /* OpenParenToken */\n                && nextTokenKind !== 39 /* PlusToken */\n                && nextTokenKind !== 40 /* MinusToken */\n                && nextTokenKind !== 43 /* SlashToken */\n                && nextTokenKind !== 13 /* RegularExpressionLiteral */\n                && nextTokenKind !== 27 /* CommaToken */\n                && nextTokenKind !== 218 /* TemplateExpression */\n                && nextTokenKind !== 15 /* TemplateHead */\n                && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */\n                && nextTokenKind !== 24 /* DotToken */;\n        }\n        function isSemicolonInsertionContext(context) {\n            return ts.positionIsASICandidate(context.currentTokenSpan.end, context.currentTokenParent, context.sourceFile);\n        }\n    })(formatting = ts.formatting || (ts.formatting = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var formatting;\n    (function (formatting) {\n        function getFormatContext(options, host) {\n            return { options: options, getRules: getRulesMap(), host: host };\n        }\n        formatting.getFormatContext = getFormatContext;\n        var rulesMapCache;\n        function getRulesMap() {\n            if (rulesMapCache === undefined) {\n                rulesMapCache = createRulesMap(formatting.getAllRules());\n            }\n            return rulesMapCache;\n        }\n        /**\n         * For a given rule action, gets a mask of other rule actions that\n         * cannot be applied at the same position.\n         */\n        function getRuleActionExclusion(ruleAction) {\n            var mask = 0;\n            if (ruleAction & 1 /* StopProcessingSpaceActions */) {\n                mask |= 28 /* ModifySpaceAction */;\n            }\n            if (ruleAction & 2 /* StopProcessingTokenActions */) {\n                mask |= 96 /* ModifyTokenAction */;\n            }\n            if (ruleAction & 28 /* ModifySpaceAction */) {\n                mask |= 28 /* ModifySpaceAction */;\n            }\n            if (ruleAction & 96 /* ModifyTokenAction */) {\n                mask |= 96 /* ModifyTokenAction */;\n            }\n            return mask;\n        }\n        function createRulesMap(rules) {\n            var map = buildMap(rules);\n            return function (context) {\n                var bucket = map[getRuleBucketIndex(context.currentTokenSpan.kind, context.nextTokenSpan.kind)];\n                if (bucket) {\n                    var rules_1 = [];\n                    var ruleActionMask = 0;\n                    for (var _i = 0, bucket_1 = bucket; _i < bucket_1.length; _i++) {\n                        var rule = bucket_1[_i];\n                        var acceptRuleActions = ~getRuleActionExclusion(ruleActionMask);\n                        if (rule.action & acceptRuleActions && ts.every(rule.context, function (c) { return c(context); })) {\n                            rules_1.push(rule);\n                            ruleActionMask |= rule.action;\n                        }\n                    }\n                    if (rules_1.length) {\n                        return rules_1;\n                    }\n                }\n            };\n        }\n        function buildMap(rules) {\n            // Map from bucket index to array of rules\n            var map = new Array(mapRowLength * mapRowLength);\n            // This array is used only during construction of the rulesbucket in the map\n            var rulesBucketConstructionStateList = new Array(map.length);\n            for (var _i = 0, rules_2 = rules; _i < rules_2.length; _i++) {\n                var rule = rules_2[_i];\n                var specificRule = rule.leftTokenRange.isSpecific && rule.rightTokenRange.isSpecific;\n                for (var _a = 0, _b = rule.leftTokenRange.tokens; _a < _b.length; _a++) {\n                    var left = _b[_a];\n                    for (var _c = 0, _d = rule.rightTokenRange.tokens; _c < _d.length; _c++) {\n                        var right = _d[_c];\n                        var index = getRuleBucketIndex(left, right);\n                        var rulesBucket = map[index];\n                        if (rulesBucket === undefined) {\n                            rulesBucket = map[index] = [];\n                        }\n                        addRule(rulesBucket, rule.rule, specificRule, rulesBucketConstructionStateList, index);\n                    }\n                }\n            }\n            return map;\n        }\n        function getRuleBucketIndex(row, column) {\n            ts.Debug.assert(row <= 156 /* LastKeyword */ && column <= 156 /* LastKeyword */, \"Must compute formatting context from tokens\");\n            return (row * mapRowLength) + column;\n        }\n        var maskBitSize = 5;\n        var mask = 31; // MaskBitSize bits\n        var mapRowLength = 156 /* LastToken */ + 1;\n        var RulesPosition;\n        (function (RulesPosition) {\n            RulesPosition[RulesPosition[\"StopRulesSpecific\"] = 0] = \"StopRulesSpecific\";\n            RulesPosition[RulesPosition[\"StopRulesAny\"] = maskBitSize * 1] = \"StopRulesAny\";\n            RulesPosition[RulesPosition[\"ContextRulesSpecific\"] = maskBitSize * 2] = \"ContextRulesSpecific\";\n            RulesPosition[RulesPosition[\"ContextRulesAny\"] = maskBitSize * 3] = \"ContextRulesAny\";\n            RulesPosition[RulesPosition[\"NoContextRulesSpecific\"] = maskBitSize * 4] = \"NoContextRulesSpecific\";\n            RulesPosition[RulesPosition[\"NoContextRulesAny\"] = maskBitSize * 5] = \"NoContextRulesAny\";\n        })(RulesPosition || (RulesPosition = {}));\n        // The Rules list contains all the inserted rules into a rulebucket in the following order:\n        //    1- Ignore rules with specific token combination\n        //    2- Ignore rules with any token combination\n        //    3- Context rules with specific token combination\n        //    4- Context rules with any token combination\n        //    5- Non-context rules with specific token combination\n        //    6- Non-context rules with any token combination\n        //\n        // The member rulesInsertionIndexBitmap is used to describe the number of rules\n        // in each sub-bucket (above) hence can be used to know the index of where to insert\n        // the next rule. It's a bitmap which contains 6 different sections each is given 5 bits.\n        //\n        // Example:\n        // In order to insert a rule to the end of sub-bucket (3), we get the index by adding\n        // the values in the bitmap segments 3rd, 2nd, and 1st.\n        function addRule(rules, rule, specificTokens, constructionState, rulesBucketIndex) {\n            var position = rule.action & 3 /* StopAction */ ?\n                specificTokens ? RulesPosition.StopRulesSpecific : RulesPosition.StopRulesAny :\n                rule.context !== formatting.anyContext ?\n                    specificTokens ? RulesPosition.ContextRulesSpecific : RulesPosition.ContextRulesAny :\n                    specificTokens ? RulesPosition.NoContextRulesSpecific : RulesPosition.NoContextRulesAny;\n            var state = constructionState[rulesBucketIndex] || 0;\n            rules.splice(getInsertionIndex(state, position), 0, rule);\n            constructionState[rulesBucketIndex] = increaseInsertionIndex(state, position);\n        }\n        function getInsertionIndex(indexBitmap, maskPosition) {\n            var index = 0;\n            for (var pos = 0; pos <= maskPosition; pos += maskBitSize) {\n                index += indexBitmap & mask;\n                indexBitmap >>= maskBitSize;\n            }\n            return index;\n        }\n        function increaseInsertionIndex(indexBitmap, maskPosition) {\n            var value = ((indexBitmap >> maskPosition) & mask) + 1;\n            ts.Debug.assert((value & mask) === value, \"Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules.\");\n            return (indexBitmap & ~(mask << maskPosition)) | (value << maskPosition);\n        }\n    })(formatting = ts.formatting || (ts.formatting = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var formatting;\n    (function (formatting) {\n        function createTextRangeWithKind(pos, end, kind) {\n            var textRangeWithKind = { pos: pos, end: end, kind: kind };\n            if (ts.Debug.isDebugging) {\n                Object.defineProperty(textRangeWithKind, \"__debugKind\", {\n                    get: function () { return ts.Debug.formatSyntaxKind(kind); },\n                });\n            }\n            return textRangeWithKind;\n        }\n        formatting.createTextRangeWithKind = createTextRangeWithKind;\n        var Constants;\n        (function (Constants) {\n            Constants[Constants[\"Unknown\"] = -1] = \"Unknown\";\n        })(Constants || (Constants = {}));\n        function formatOnEnter(position, sourceFile, formatContext) {\n            var line = sourceFile.getLineAndCharacterOfPosition(position).line;\n            if (line === 0) {\n                return [];\n            }\n            // After the enter key, the cursor is now at a new line. The new line may or may not contain non-whitespace characters.\n            // If the new line has only whitespaces, we won't want to format this line, because that would remove the indentation as\n            // trailing whitespaces. So the end of the formatting span should be the later one between:\n            //  1. the end of the previous line\n            //  2. the last non-whitespace character in the current line\n            var endOfFormatSpan = ts.getEndLinePosition(line, sourceFile);\n            while (ts.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(endOfFormatSpan))) {\n                endOfFormatSpan--;\n            }\n            // if the character at the end of the span is a line break, we shouldn't include it, because it indicates we don't want to\n            // touch the current line at all. Also, on some OSes the line break consists of two characters (\\r\\n), we should test if the\n            // previous character before the end of format span is line break character as well.\n            if (ts.isLineBreak(sourceFile.text.charCodeAt(endOfFormatSpan))) {\n                endOfFormatSpan--;\n            }\n            var span = {\n                // get start position for the previous line\n                pos: ts.getStartPositionOfLine(line - 1, sourceFile),\n                // end value is exclusive so add 1 to the result\n                end: endOfFormatSpan + 1\n            };\n            return formatSpan(span, sourceFile, formatContext, 2 /* FormatOnEnter */);\n        }\n        formatting.formatOnEnter = formatOnEnter;\n        function formatOnSemicolon(position, sourceFile, formatContext) {\n            var semicolon = findImmediatelyPrecedingTokenOfKind(position, 26 /* SemicolonToken */, sourceFile);\n            return formatNodeLines(findOutermostNodeWithinListLevel(semicolon), sourceFile, formatContext, 3 /* FormatOnSemicolon */);\n        }\n        formatting.formatOnSemicolon = formatOnSemicolon;\n        function formatOnOpeningCurly(position, sourceFile, formatContext) {\n            var openingCurly = findImmediatelyPrecedingTokenOfKind(position, 18 /* OpenBraceToken */, sourceFile);\n            if (!openingCurly) {\n                return [];\n            }\n            var curlyBraceRange = openingCurly.parent;\n            var outermostNode = findOutermostNodeWithinListLevel(curlyBraceRange);\n            /**\n             * We limit the span to end at the opening curly to handle the case where\n             * the brace matched to that just typed will be incorrect after further edits.\n             * For example, we could type the opening curly for the following method\n             * body without brace-matching activated:\n             * ```\n             * class C {\n             *     foo()\n             * }\n             * ```\n             * and we wouldn't want to move the closing brace.\n             */\n            var textRange = {\n                pos: ts.getLineStartPositionForPosition(outermostNode.getStart(sourceFile), sourceFile),\n                end: position\n            };\n            return formatSpan(textRange, sourceFile, formatContext, 4 /* FormatOnOpeningCurlyBrace */);\n        }\n        formatting.formatOnOpeningCurly = formatOnOpeningCurly;\n        function formatOnClosingCurly(position, sourceFile, formatContext) {\n            var precedingToken = findImmediatelyPrecedingTokenOfKind(position, 19 /* CloseBraceToken */, sourceFile);\n            return formatNodeLines(findOutermostNodeWithinListLevel(precedingToken), sourceFile, formatContext, 5 /* FormatOnClosingCurlyBrace */);\n        }\n        formatting.formatOnClosingCurly = formatOnClosingCurly;\n        function formatDocument(sourceFile, formatContext) {\n            var span = {\n                pos: 0,\n                end: sourceFile.text.length\n            };\n            return formatSpan(span, sourceFile, formatContext, 0 /* FormatDocument */);\n        }\n        formatting.formatDocument = formatDocument;\n        function formatSelection(start, end, sourceFile, formatContext) {\n            // format from the beginning of the line\n            var span = {\n                pos: ts.getLineStartPositionForPosition(start, sourceFile),\n                end: end,\n            };\n            return formatSpan(span, sourceFile, formatContext, 1 /* FormatSelection */);\n        }\n        formatting.formatSelection = formatSelection;\n        /**\n         * Validating `expectedTokenKind` ensures the token was typed in the context we expect (eg: not a comment).\n         * @param expectedTokenKind The kind of the last token constituting the desired parent node.\n         */\n        function findImmediatelyPrecedingTokenOfKind(end, expectedTokenKind, sourceFile) {\n            var precedingToken = ts.findPrecedingToken(end, sourceFile);\n            return precedingToken && precedingToken.kind === expectedTokenKind && end === precedingToken.getEnd() ?\n                precedingToken :\n                undefined;\n        }\n        /**\n         * Finds the highest node enclosing `node` at the same list level as `node`\n         * and whose end does not exceed `node.end`.\n         *\n         * Consider typing the following\n         * ```\n         * let x = 1;\n         * while (true) {\n         * }\n         * ```\n         * Upon typing the closing curly, we want to format the entire `while`-statement, but not the preceding\n         * variable declaration.\n         */\n        function findOutermostNodeWithinListLevel(node) {\n            var current = node;\n            while (current &&\n                current.parent &&\n                current.parent.end === node.end &&\n                !isListElement(current.parent, current)) {\n                current = current.parent;\n            }\n            return current;\n        }\n        // Returns true if node is a element in some list in parent\n        // i.e. parent is class declaration with the list of members and node is one of members.\n        function isListElement(parent, node) {\n            switch (parent.kind) {\n                case 252 /* ClassDeclaration */:\n                case 253 /* InterfaceDeclaration */:\n                    return ts.rangeContainsRange(parent.members, node);\n                case 256 /* ModuleDeclaration */:\n                    var body = parent.body;\n                    return !!body && body.kind === 257 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node);\n                case 297 /* SourceFile */:\n                case 230 /* Block */:\n                case 257 /* ModuleBlock */:\n                    return ts.rangeContainsRange(parent.statements, node);\n                case 287 /* CatchClause */:\n                    return ts.rangeContainsRange(parent.block.statements, node);\n            }\n            return false;\n        }\n        /** find node that fully contains given text range */\n        function findEnclosingNode(range, sourceFile) {\n            return find(sourceFile);\n            function find(n) {\n                var candidate = ts.forEachChild(n, function (c) { return ts.startEndContainsRange(c.getStart(sourceFile), c.end, range) && c; });\n                if (candidate) {\n                    var result = find(candidate);\n                    if (result) {\n                        return result;\n                    }\n                }\n                return n;\n            }\n        }\n        /** formatting is not applied to ranges that contain parse errors.\n         * This function will return a predicate that for a given text range will tell\n         * if there are any parse errors that overlap with the range.\n         */\n        function prepareRangeContainsErrorFunction(errors, originalRange) {\n            if (!errors.length) {\n                return rangeHasNoErrors;\n            }\n            // pick only errors that fall in range\n            var sorted = errors\n                .filter(function (d) { return ts.rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length); }) // TODO: GH#18217\n                .sort(function (e1, e2) { return e1.start - e2.start; });\n            if (!sorted.length) {\n                return rangeHasNoErrors;\n            }\n            var index = 0;\n            return function (r) {\n                // in current implementation sequence of arguments [r1, r2...] is monotonically increasing.\n                // 'index' tracks the index of the most recent error that was checked.\n                while (true) {\n                    if (index >= sorted.length) {\n                        // all errors in the range were already checked -> no error in specified range\n                        return false;\n                    }\n                    var error = sorted[index];\n                    if (r.end <= error.start) {\n                        // specified range ends before the error referred by 'index' - no error in range\n                        return false;\n                    }\n                    if (ts.startEndOverlapsWithStartEnd(r.pos, r.end, error.start, error.start + error.length)) {\n                        // specified range overlaps with error range\n                        return true;\n                    }\n                    index++;\n                }\n            };\n            function rangeHasNoErrors() {\n                return false;\n            }\n        }\n        /**\n         * Start of the original range might fall inside the comment - scanner will not yield appropriate results\n         * This function will look for token that is located before the start of target range\n         * and return its end as start position for the scanner.\n         */\n        function getScanStartPosition(enclosingNode, originalRange, sourceFile) {\n            var start = enclosingNode.getStart(sourceFile);\n            if (start === originalRange.pos && enclosingNode.end === originalRange.end) {\n                return start;\n            }\n            var precedingToken = ts.findPrecedingToken(originalRange.pos, sourceFile);\n            if (!precedingToken) {\n                // no preceding token found - start from the beginning of enclosing node\n                return enclosingNode.pos;\n            }\n            // preceding token ends after the start of original range (i.e when originalRange.pos falls in the middle of literal)\n            // start from the beginning of enclosingNode to handle the entire 'originalRange'\n            if (precedingToken.end >= originalRange.pos) {\n                return enclosingNode.pos;\n            }\n            return precedingToken.end;\n        }\n        /*\n         * For cases like\n         * if (a ||\n         *     b ||$\n         *     c) {...}\n         * If we hit Enter at $ we want line '    b ||' to be indented.\n         * Formatting will be applied to the last two lines.\n         * Node that fully encloses these lines is binary expression 'a ||...'.\n         * Initial indentation for this node will be 0.\n         * Binary expressions don't introduce new indentation scopes, however it is possible\n         * that some parent node on the same line does - like if statement in this case.\n         * Note that we are considering parents only from the same line with initial node -\n         * if parent is on the different line - its delta was already contributed\n         * to the initial indentation.\n         */\n        function getOwnOrInheritedDelta(n, options, sourceFile) {\n            var previousLine = -1 /* Unknown */;\n            var child;\n            while (n) {\n                var line = sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)).line;\n                if (previousLine !== -1 /* Unknown */ && line !== previousLine) {\n                    break;\n                }\n                if (formatting.SmartIndenter.shouldIndentChildNode(options, n, child, sourceFile)) {\n                    return options.indentSize;\n                }\n                previousLine = line;\n                child = n;\n                n = n.parent;\n            }\n            return 0;\n        }\n        function formatNodeGivenIndentation(node, sourceFileLike, languageVariant, initialIndentation, delta, formatContext) {\n            var range = { pos: 0, end: sourceFileLike.text.length };\n            return formatting.getFormattingScanner(sourceFileLike.text, languageVariant, range.pos, range.end, function (scanner) { return formatSpanWorker(range, node, initialIndentation, delta, scanner, formatContext, 1 /* FormatSelection */, function (_) { return false; }, // assume that node does not have any errors\n            sourceFileLike); });\n        }\n        formatting.formatNodeGivenIndentation = formatNodeGivenIndentation;\n        function formatNodeLines(node, sourceFile, formatContext, requestKind) {\n            if (!node) {\n                return [];\n            }\n            var span = {\n                pos: ts.getLineStartPositionForPosition(node.getStart(sourceFile), sourceFile),\n                end: node.end\n            };\n            return formatSpan(span, sourceFile, formatContext, requestKind);\n        }\n        function formatSpan(originalRange, sourceFile, formatContext, requestKind) {\n            // find the smallest node that fully wraps the range and compute the initial indentation for the node\n            var enclosingNode = findEnclosingNode(originalRange, sourceFile);\n            return formatting.getFormattingScanner(sourceFile.text, sourceFile.languageVariant, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end, function (scanner) { return formatSpanWorker(originalRange, enclosingNode, formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, formatContext.options), getOwnOrInheritedDelta(enclosingNode, formatContext.options, sourceFile), scanner, formatContext, requestKind, prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange), sourceFile); });\n        }\n        function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delta, formattingScanner, _a, requestKind, rangeContainsError, sourceFile) {\n            var options = _a.options, getRules = _a.getRules, host = _a.host;\n            // formatting context is used by rules provider\n            var formattingContext = new formatting.FormattingContext(sourceFile, requestKind, options);\n            var previousRange;\n            var previousParent;\n            var previousRangeStartLine;\n            var lastIndentedLine;\n            var indentationOnLastIndentedLine = -1 /* Unknown */;\n            var edits = [];\n            formattingScanner.advance();\n            if (formattingScanner.isOnToken()) {\n                var startLine = sourceFile.getLineAndCharacterOfPosition(enclosingNode.getStart(sourceFile)).line;\n                var undecoratedStartLine = startLine;\n                if (enclosingNode.decorators) {\n                    undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(ts.getNonDecoratorTokenPosOfNode(enclosingNode, sourceFile)).line;\n                }\n                processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta);\n            }\n            if (!formattingScanner.isOnToken()) {\n                var indentation = formatting.SmartIndenter.nodeWillIndentChild(options, enclosingNode, /*child*/ undefined, sourceFile, /*indentByDefault*/ false)\n                    ? initialIndentation + options.indentSize\n                    : initialIndentation;\n                var leadingTrivia = formattingScanner.getCurrentLeadingTrivia();\n                if (leadingTrivia) {\n                    indentTriviaItems(leadingTrivia, indentation, /*indentNextTokenOrTrivia*/ false, function (item) { return processRange(item, sourceFile.getLineAndCharacterOfPosition(item.pos), enclosingNode, enclosingNode, /*dynamicIndentation*/ undefined); });\n                }\n            }\n            if (options.trimTrailingWhitespace !== false) {\n                trimTrailingWhitespacesForRemainingRange();\n            }\n            return edits;\n            // local functions\n            /** Tries to compute the indentation for a list element.\n             * If list element is not in range then\n             * function will pick its actual indentation\n             * so it can be pushed downstream as inherited indentation.\n             * If list element is in the range - its indentation will be equal\n             * to inherited indentation from its predecessors.\n             */\n            function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range, inheritedIndentation) {\n                if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos) ||\n                    ts.rangeContainsStartEnd(range, startPos, endPos) /* Not to miss zero-range nodes e.g. JsxText */) {\n                    if (inheritedIndentation !== -1 /* Unknown */) {\n                        return inheritedIndentation;\n                    }\n                }\n                else {\n                    var startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line;\n                    var startLinePosition = ts.getLineStartPositionForPosition(startPos, sourceFile);\n                    var column = formatting.SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options);\n                    if (startLine !== parentStartLine || startPos === column) {\n                        // Use the base indent size if it is greater than\n                        // the indentation of the inherited predecessor.\n                        var baseIndentSize = formatting.SmartIndenter.getBaseIndentation(options);\n                        return baseIndentSize > column ? baseIndentSize : column;\n                    }\n                }\n                return -1 /* Unknown */;\n            }\n            function computeIndentation(node, startLine, inheritedIndentation, parent, parentDynamicIndentation, effectiveParentStartLine) {\n                var delta = formatting.SmartIndenter.shouldIndentChildNode(options, node) ? options.indentSize : 0;\n                if (effectiveParentStartLine === startLine) {\n                    // if node is located on the same line with the parent\n                    // - inherit indentation from the parent\n                    // - push children if either parent of node itself has non-zero delta\n                    return {\n                        indentation: startLine === lastIndentedLine ? indentationOnLastIndentedLine : parentDynamicIndentation.getIndentation(),\n                        delta: Math.min(options.indentSize, parentDynamicIndentation.getDelta(node) + delta)\n                    };\n                }\n                else if (inheritedIndentation === -1 /* Unknown */) {\n                    if (node.kind === 20 /* OpenParenToken */ && startLine === lastIndentedLine) {\n                        // the is used for chaining methods formatting\n                        // - we need to get the indentation on last line and the delta of parent\n                        return { indentation: indentationOnLastIndentedLine, delta: parentDynamicIndentation.getDelta(node) };\n                    }\n                    else if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile) ||\n                        formatting.SmartIndenter.childIsUnindentedBranchOfConditionalExpression(parent, node, startLine, sourceFile) ||\n                        formatting.SmartIndenter.argumentStartsOnSameLineAsPreviousArgument(parent, node, startLine, sourceFile)) {\n                        return { indentation: parentDynamicIndentation.getIndentation(), delta: delta };\n                    }\n                    else {\n                        return { indentation: parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(node), delta: delta };\n                    }\n                }\n                else {\n                    return { indentation: inheritedIndentation, delta: delta };\n                }\n            }\n            function getFirstNonDecoratorTokenOfNode(node) {\n                if (node.modifiers && node.modifiers.length) {\n                    return node.modifiers[0].kind;\n                }\n                switch (node.kind) {\n                    case 252 /* ClassDeclaration */: return 83 /* ClassKeyword */;\n                    case 253 /* InterfaceDeclaration */: return 117 /* InterfaceKeyword */;\n                    case 251 /* FunctionDeclaration */: return 97 /* FunctionKeyword */;\n                    case 255 /* EnumDeclaration */: return 255 /* EnumDeclaration */;\n                    case 167 /* GetAccessor */: return 134 /* GetKeyword */;\n                    case 168 /* SetAccessor */: return 146 /* SetKeyword */;\n                    case 165 /* MethodDeclaration */:\n                        if (node.asteriskToken) {\n                            return 41 /* AsteriskToken */;\n                        }\n                    // falls through\n                    case 163 /* PropertyDeclaration */:\n                    case 160 /* Parameter */:\n                        var name = ts.getNameOfDeclaration(node);\n                        if (name) {\n                            return name.kind;\n                        }\n                }\n            }\n            function getDynamicIndentation(node, nodeStartLine, indentation, delta) {\n                return {\n                    getIndentationForComment: function (kind, tokenIndentation, container) {\n                        switch (kind) {\n                            // preceding comment to the token that closes the indentation scope inherits the indentation from the scope\n                            // ..  {\n                            //     // comment\n                            // }\n                            case 19 /* CloseBraceToken */:\n                            case 23 /* CloseBracketToken */:\n                            case 21 /* CloseParenToken */:\n                                return indentation + getDelta(container);\n                        }\n                        return tokenIndentation !== -1 /* Unknown */ ? tokenIndentation : indentation;\n                    },\n                    // if list end token is LessThanToken '>' then its delta should be explicitly suppressed\n                    // so that LessThanToken as a binary operator can still be indented.\n                    // foo.then\n                    //     <\n                    //         number,\n                    //         string,\n                    //     >();\n                    // vs\n                    // var a = xValue\n                    //     > yValue;\n                    getIndentationForToken: function (line, kind, container, suppressDelta) {\n                        return !suppressDelta && shouldAddDelta(line, kind, container) ? indentation + getDelta(container) : indentation;\n                    },\n                    getIndentation: function () { return indentation; },\n                    getDelta: getDelta,\n                    recomputeIndentation: function (lineAdded, parent) {\n                        if (formatting.SmartIndenter.shouldIndentChildNode(options, parent, node, sourceFile)) {\n                            indentation += lineAdded ? options.indentSize : -options.indentSize;\n                            delta = formatting.SmartIndenter.shouldIndentChildNode(options, node) ? options.indentSize : 0;\n                        }\n                    }\n                };\n                function shouldAddDelta(line, kind, container) {\n                    switch (kind) {\n                        // open and close brace, 'else' and 'while' (in do statement) tokens has indentation of the parent\n                        case 18 /* OpenBraceToken */:\n                        case 19 /* CloseBraceToken */:\n                        case 21 /* CloseParenToken */:\n                        case 90 /* ElseKeyword */:\n                        case 114 /* WhileKeyword */:\n                        case 59 /* AtToken */:\n                            return false;\n                        case 43 /* SlashToken */:\n                        case 31 /* GreaterThanToken */:\n                            switch (container.kind) {\n                                case 275 /* JsxOpeningElement */:\n                                case 276 /* JsxClosingElement */:\n                                case 274 /* JsxSelfClosingElement */:\n                                case 223 /* ExpressionWithTypeArguments */:\n                                    return false;\n                            }\n                            break;\n                        case 22 /* OpenBracketToken */:\n                        case 23 /* CloseBracketToken */:\n                            if (container.kind !== 190 /* MappedType */) {\n                                return false;\n                            }\n                            break;\n                    }\n                    // if token line equals to the line of containing node (this is a first token in the node) - use node indentation\n                    return nodeStartLine !== line\n                        // if this token is the first token following the list of decorators, we do not need to indent\n                        && !(node.decorators && kind === getFirstNonDecoratorTokenOfNode(node));\n                }\n                function getDelta(child) {\n                    // Delta value should be zero when the node explicitly prevents indentation of the child node\n                    return formatting.SmartIndenter.nodeWillIndentChild(options, node, child, sourceFile, /*indentByDefault*/ true) ? delta : 0;\n                }\n            }\n            function processNode(node, contextNode, nodeStartLine, undecoratedNodeStartLine, indentation, delta) {\n                if (!ts.rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) {\n                    return;\n                }\n                var nodeDynamicIndentation = getDynamicIndentation(node, nodeStartLine, indentation, delta);\n                // a useful observations when tracking context node\n                //        /\n                //      [a]\n                //   /   |   \\\n                //  [b] [c] [d]\n                // node 'a' is a context node for nodes 'b', 'c', 'd'\n                // except for the leftmost leaf token in [b] - in this case context node ('e') is located somewhere above 'a'\n                // this rule can be applied recursively to child nodes of 'a'.\n                //\n                // context node is set to parent node value after processing every child node\n                // context node is set to parent of the token after processing every token\n                var childContextNode = contextNode;\n                // if there are any tokens that logically belong to node and interleave child nodes\n                // such tokens will be consumed in processChildNode for the child that follows them\n                ts.forEachChild(node, function (child) {\n                    processChildNode(child, /*inheritedIndentation*/ -1 /* Unknown */, node, nodeDynamicIndentation, nodeStartLine, undecoratedNodeStartLine, /*isListItem*/ false);\n                }, function (nodes) {\n                    processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation);\n                });\n                // proceed any tokens in the node that are located after child nodes\n                while (formattingScanner.isOnToken()) {\n                    var tokenInfo = formattingScanner.readTokenInfo(node);\n                    if (tokenInfo.token.end > node.end) {\n                        break;\n                    }\n                    if (node.kind === 11 /* JsxText */) {\n                        // Intentation rules for jsx text are handled by `indentMultilineCommentOrJsxText` inside `processChildNode`; just fastforward past it here\n                        formattingScanner.advance();\n                        continue;\n                    }\n                    consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation, node);\n                }\n                if (!node.parent && formattingScanner.isOnEOF()) {\n                    var token = formattingScanner.readEOFTokenRange();\n                    if (token.end <= node.end && previousRange) {\n                        processPair(token, sourceFile.getLineAndCharacterOfPosition(token.pos).line, node, previousRange, previousRangeStartLine, previousParent, contextNode, nodeDynamicIndentation);\n                    }\n                }\n                function processChildNode(child, inheritedIndentation, parent, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) {\n                    var childStartPos = child.getStart(sourceFile);\n                    var childStartLine = sourceFile.getLineAndCharacterOfPosition(childStartPos).line;\n                    var undecoratedChildStartLine = childStartLine;\n                    if (child.decorators) {\n                        undecoratedChildStartLine = sourceFile.getLineAndCharacterOfPosition(ts.getNonDecoratorTokenPosOfNode(child, sourceFile)).line;\n                    }\n                    // if child is a list item - try to get its indentation, only if parent is within the original range.\n                    var childIndentationAmount = -1 /* Unknown */;\n                    if (isListItem && ts.rangeContainsRange(originalRange, parent)) {\n                        childIndentationAmount = tryComputeIndentationForListItem(childStartPos, child.end, parentStartLine, originalRange, inheritedIndentation);\n                        if (childIndentationAmount !== -1 /* Unknown */) {\n                            inheritedIndentation = childIndentationAmount;\n                        }\n                    }\n                    // child node is outside the target range - do not dive inside\n                    if (!ts.rangeOverlapsWithStartEnd(originalRange, child.pos, child.end)) {\n                        if (child.end < originalRange.pos) {\n                            formattingScanner.skipToEndOf(child);\n                        }\n                        return inheritedIndentation;\n                    }\n                    if (child.getFullWidth() === 0) {\n                        return inheritedIndentation;\n                    }\n                    while (formattingScanner.isOnToken()) {\n                        // proceed any parent tokens that are located prior to child.getStart()\n                        var tokenInfo = formattingScanner.readTokenInfo(node);\n                        if (tokenInfo.token.end > childStartPos) {\n                            if (tokenInfo.token.pos > childStartPos) {\n                                formattingScanner.skipToStartOf(child);\n                            }\n                            // stop when formatting scanner advances past the beginning of the child\n                            break;\n                        }\n                        consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, node);\n                    }\n                    if (!formattingScanner.isOnToken()) {\n                        return inheritedIndentation;\n                    }\n                    if (ts.isToken(child)) {\n                        // if child node is a token, it does not impact indentation, proceed it using parent indentation scope rules\n                        var tokenInfo = formattingScanner.readTokenInfo(child);\n                        // JSX text shouldn't affect indenting\n                        if (child.kind !== 11 /* JsxText */) {\n                            ts.Debug.assert(tokenInfo.token.end === child.end, \"Token end is child end\");\n                            consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child);\n                            return inheritedIndentation;\n                        }\n                    }\n                    var effectiveParentStartLine = child.kind === 161 /* Decorator */ ? childStartLine : undecoratedParentStartLine;\n                    var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine);\n                    processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta);\n                    if (child.kind === 11 /* JsxText */) {\n                        var range = { pos: child.getStart(), end: child.getEnd() };\n                        if (range.pos !== range.end) { // don't indent zero-width jsx text\n                            var siblings = parent.getChildren(sourceFile);\n                            var currentIndex = ts.findIndex(siblings, function (arg) { return arg.pos === child.pos; });\n                            var previousNode = siblings[currentIndex - 1];\n                            if (previousNode) {\n                                // The jsx text needs no indentation whatsoever if it ends on the same line the previous sibling ends on\n                                if (sourceFile.getLineAndCharacterOfPosition(range.end).line !== sourceFile.getLineAndCharacterOfPosition(previousNode.end).line) {\n                                    // The first line is (already) \"indented\" if the text starts on the same line as the previous sibling element ends on\n                                    var firstLineIsIndented = sourceFile.getLineAndCharacterOfPosition(range.pos).line === sourceFile.getLineAndCharacterOfPosition(previousNode.end).line;\n                                    indentMultilineCommentOrJsxText(range, childIndentation.indentation, firstLineIsIndented, /*indentFinalLine*/ false, /*jsxStyle*/ true);\n                                }\n                            }\n                        }\n                    }\n                    childContextNode = node;\n                    if (isFirstListItem && parent.kind === 199 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) {\n                        inheritedIndentation = childIndentation.indentation;\n                    }\n                    return inheritedIndentation;\n                }\n                function processChildNodes(nodes, parent, parentStartLine, parentDynamicIndentation) {\n                    ts.Debug.assert(ts.isNodeArray(nodes));\n                    var listStartToken = getOpenTokenForList(parent, nodes);\n                    var listDynamicIndentation = parentDynamicIndentation;\n                    var startLine = parentStartLine;\n                    if (listStartToken !== 0 /* Unknown */) {\n                        // introduce a new indentation scope for lists (including list start and end tokens)\n                        while (formattingScanner.isOnToken()) {\n                            var tokenInfo = formattingScanner.readTokenInfo(parent);\n                            if (tokenInfo.token.end > nodes.pos) {\n                                // stop when formatting scanner moves past the beginning of node list\n                                break;\n                            }\n                            else if (tokenInfo.token.kind === listStartToken) {\n                                // consume list start token\n                                startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line;\n                                consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation, parent);\n                                var indentationOnListStartToken = void 0;\n                                if (indentationOnLastIndentedLine !== -1 /* Unknown */) {\n                                    // scanner just processed list start token so consider last indentation as list indentation\n                                    // function foo(): { // last indentation was 0, list item will be indented based on this value\n                                    //   foo: number;\n                                    // }: {};\n                                    indentationOnListStartToken = indentationOnLastIndentedLine;\n                                }\n                                else {\n                                    var startLinePosition = ts.getLineStartPositionForPosition(tokenInfo.token.pos, sourceFile);\n                                    indentationOnListStartToken = formatting.SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, tokenInfo.token.pos, sourceFile, options);\n                                }\n                                listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentationOnListStartToken, options.indentSize); // TODO: GH#18217\n                            }\n                            else {\n                                // consume any tokens that precede the list as child elements of 'node' using its indentation scope\n                                consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation, parent);\n                            }\n                        }\n                    }\n                    var inheritedIndentation = -1 /* Unknown */;\n                    for (var i = 0; i < nodes.length; i++) {\n                        var child = nodes[i];\n                        inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, startLine, startLine, /*isListItem*/ true, /*isFirstListItem*/ i === 0);\n                    }\n                    var listEndToken = getCloseTokenForOpenToken(listStartToken);\n                    if (listEndToken !== 0 /* Unknown */ && formattingScanner.isOnToken()) {\n                        var tokenInfo = formattingScanner.readTokenInfo(parent);\n                        if (tokenInfo.token.kind === 27 /* CommaToken */ && ts.isCallLikeExpression(parent)) {\n                            var commaTokenLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line;\n                            if (startLine !== commaTokenLine) {\n                                formattingScanner.advance();\n                                tokenInfo = formattingScanner.isOnToken() ? formattingScanner.readTokenInfo(parent) : undefined;\n                            }\n                        }\n                        // consume the list end token only if it is still belong to the parent\n                        // there might be the case when current token matches end token but does not considered as one\n                        // function (x: function) <--\n                        // without this check close paren will be interpreted as list end token for function expression which is wrong\n                        if (tokenInfo && tokenInfo.token.kind === listEndToken && ts.rangeContainsRange(parent, tokenInfo.token)) {\n                            // consume list end token\n                            consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation, parent, /*isListEndToken*/ true);\n                        }\n                    }\n                }\n                function consumeTokenAndAdvanceScanner(currentTokenInfo, parent, dynamicIndentation, container, isListEndToken) {\n                    ts.Debug.assert(ts.rangeContainsRange(parent, currentTokenInfo.token));\n                    var lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine();\n                    var indentToken = false;\n                    if (currentTokenInfo.leadingTrivia) {\n                        processTrivia(currentTokenInfo.leadingTrivia, parent, childContextNode, dynamicIndentation);\n                    }\n                    var lineAction = 0 /* None */;\n                    var isTokenInRange = ts.rangeContainsRange(originalRange, currentTokenInfo.token);\n                    var tokenStart = sourceFile.getLineAndCharacterOfPosition(currentTokenInfo.token.pos);\n                    if (isTokenInRange) {\n                        var rangeHasError = rangeContainsError(currentTokenInfo.token);\n                        // save previousRange since processRange will overwrite this value with current one\n                        var savePreviousRange = previousRange;\n                        lineAction = processRange(currentTokenInfo.token, tokenStart, parent, childContextNode, dynamicIndentation);\n                        // do not indent comments\\token if token range overlaps with some error\n                        if (!rangeHasError) {\n                            if (lineAction === 0 /* None */) {\n                                // indent token only if end line of previous range does not match start line of the token\n                                var prevEndLine = savePreviousRange && sourceFile.getLineAndCharacterOfPosition(savePreviousRange.end).line;\n                                indentToken = lastTriviaWasNewLine && tokenStart.line !== prevEndLine;\n                            }\n                            else {\n                                indentToken = lineAction === 1 /* LineAdded */;\n                            }\n                        }\n                    }\n                    if (currentTokenInfo.trailingTrivia) {\n                        processTrivia(currentTokenInfo.trailingTrivia, parent, childContextNode, dynamicIndentation);\n                    }\n                    if (indentToken) {\n                        var tokenIndentation = (isTokenInRange && !rangeContainsError(currentTokenInfo.token)) ?\n                            dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind, container, !!isListEndToken) :\n                            -1 /* Unknown */;\n                        var indentNextTokenOrTrivia = true;\n                        if (currentTokenInfo.leadingTrivia) {\n                            var commentIndentation_1 = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind, tokenIndentation, container);\n                            indentNextTokenOrTrivia = indentTriviaItems(currentTokenInfo.leadingTrivia, commentIndentation_1, indentNextTokenOrTrivia, function (item) { return insertIndentation(item.pos, commentIndentation_1, /*lineAdded*/ false); });\n                        }\n                        // indent token only if is it is in target range and does not overlap with any error ranges\n                        if (tokenIndentation !== -1 /* Unknown */ && indentNextTokenOrTrivia) {\n                            insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAction === 1 /* LineAdded */);\n                            lastIndentedLine = tokenStart.line;\n                            indentationOnLastIndentedLine = tokenIndentation;\n                        }\n                    }\n                    formattingScanner.advance();\n                    childContextNode = parent;\n                }\n            }\n            function indentTriviaItems(trivia, commentIndentation, indentNextTokenOrTrivia, indentSingleLine) {\n                for (var _i = 0, trivia_1 = trivia; _i < trivia_1.length; _i++) {\n                    var triviaItem = trivia_1[_i];\n                    var triviaInRange = ts.rangeContainsRange(originalRange, triviaItem);\n                    switch (triviaItem.kind) {\n                        case 3 /* MultiLineCommentTrivia */:\n                            if (triviaInRange) {\n                                indentMultilineCommentOrJsxText(triviaItem, commentIndentation, /*firstLineIsIndented*/ !indentNextTokenOrTrivia);\n                            }\n                            indentNextTokenOrTrivia = false;\n                            break;\n                        case 2 /* SingleLineCommentTrivia */:\n                            if (indentNextTokenOrTrivia && triviaInRange) {\n                                indentSingleLine(triviaItem);\n                            }\n                            indentNextTokenOrTrivia = false;\n                            break;\n                        case 4 /* NewLineTrivia */:\n                            indentNextTokenOrTrivia = true;\n                            break;\n                    }\n                }\n                return indentNextTokenOrTrivia;\n            }\n            function processTrivia(trivia, parent, contextNode, dynamicIndentation) {\n                for (var _i = 0, trivia_2 = trivia; _i < trivia_2.length; _i++) {\n                    var triviaItem = trivia_2[_i];\n                    if (ts.isComment(triviaItem.kind) && ts.rangeContainsRange(originalRange, triviaItem)) {\n                        var triviaItemStart = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos);\n                        processRange(triviaItem, triviaItemStart, parent, contextNode, dynamicIndentation);\n                    }\n                }\n            }\n            function processRange(range, rangeStart, parent, contextNode, dynamicIndentation) {\n                var rangeHasError = rangeContainsError(range);\n                var lineAction = 0 /* None */;\n                if (!rangeHasError) {\n                    if (!previousRange) {\n                        // trim whitespaces starting from the beginning of the span up to the current line\n                        var originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos);\n                        trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line);\n                    }\n                    else {\n                        lineAction =\n                            processPair(range, rangeStart.line, parent, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation);\n                    }\n                }\n                previousRange = range;\n                previousParent = parent;\n                previousRangeStartLine = rangeStart.line;\n                return lineAction;\n            }\n            function processPair(currentItem, currentStartLine, currentParent, previousItem, previousStartLine, previousParent, contextNode, dynamicIndentation) {\n                formattingContext.updateContext(previousItem, previousParent, currentItem, currentParent, contextNode);\n                var rules = getRules(formattingContext);\n                var trimTrailingWhitespaces = formattingContext.options.trimTrailingWhitespace !== false;\n                var lineAction = 0 /* None */;\n                if (rules) {\n                    // Apply rules in reverse order so that higher priority rules (which are first in the array)\n                    // win in a conflict with lower priority rules.\n                    ts.forEachRight(rules, function (rule) {\n                        lineAction = applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine);\n                        switch (lineAction) {\n                            case 2 /* LineRemoved */:\n                                // Handle the case where the next line is moved to be the end of this line.\n                                // In this case we don't indent the next line in the next pass.\n                                if (currentParent.getStart(sourceFile) === currentItem.pos) {\n                                    dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ false, contextNode);\n                                }\n                                break;\n                            case 1 /* LineAdded */:\n                                // Handle the case where token2 is moved to the new line.\n                                // In this case we indent token2 in the next pass but we set\n                                // sameLineIndent flag to notify the indenter that the indentation is within the line.\n                                if (currentParent.getStart(sourceFile) === currentItem.pos) {\n                                    dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ true, contextNode);\n                                }\n                                break;\n                            default:\n                                ts.Debug.assert(lineAction === 0 /* None */);\n                        }\n                        // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line\n                        trimTrailingWhitespaces = trimTrailingWhitespaces && !(rule.action & 16 /* DeleteSpace */) && rule.flags !== 1 /* CanDeleteNewLines */;\n                    });\n                }\n                else {\n                    trimTrailingWhitespaces = trimTrailingWhitespaces && currentItem.kind !== 1 /* EndOfFileToken */;\n                }\n                if (currentStartLine !== previousStartLine && trimTrailingWhitespaces) {\n                    // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line\n                    trimTrailingWhitespacesForLines(previousStartLine, currentStartLine, previousItem);\n                }\n                return lineAction;\n            }\n            function insertIndentation(pos, indentation, lineAdded) {\n                var indentationString = getIndentationString(indentation, options);\n                if (lineAdded) {\n                    // new line is added before the token by the formatting rules\n                    // insert indentation string at the very beginning of the token\n                    recordReplace(pos, 0, indentationString);\n                }\n                else {\n                    var tokenStart = sourceFile.getLineAndCharacterOfPosition(pos);\n                    var startLinePosition = ts.getStartPositionOfLine(tokenStart.line, sourceFile);\n                    if (indentation !== characterToColumn(startLinePosition, tokenStart.character) || indentationIsDifferent(indentationString, startLinePosition)) {\n                        recordReplace(startLinePosition, tokenStart.character, indentationString);\n                    }\n                }\n            }\n            function characterToColumn(startLinePosition, characterInLine) {\n                var column = 0;\n                for (var i = 0; i < characterInLine; i++) {\n                    if (sourceFile.text.charCodeAt(startLinePosition + i) === 9 /* tab */) {\n                        column += options.tabSize - column % options.tabSize;\n                    }\n                    else {\n                        column++;\n                    }\n                }\n                return column;\n            }\n            function indentationIsDifferent(indentationString, startLinePosition) {\n                return indentationString !== sourceFile.text.substr(startLinePosition, indentationString.length);\n            }\n            function indentMultilineCommentOrJsxText(commentRange, indentation, firstLineIsIndented, indentFinalLine, jsxTextStyleIndent) {\n                if (indentFinalLine === void 0) { indentFinalLine = true; }\n                // split comment in lines\n                var startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line;\n                var endLine = sourceFile.getLineAndCharacterOfPosition(commentRange.end).line;\n                if (startLine === endLine) {\n                    if (!firstLineIsIndented) {\n                        // treat as single line comment\n                        insertIndentation(commentRange.pos, indentation, /*lineAdded*/ false);\n                    }\n                    return;\n                }\n                var parts = [];\n                var startPos = commentRange.pos;\n                for (var line = startLine; line < endLine; line++) {\n                    var endOfLine = ts.getEndLinePosition(line, sourceFile);\n                    parts.push({ pos: startPos, end: endOfLine });\n                    startPos = ts.getStartPositionOfLine(line + 1, sourceFile);\n                }\n                if (indentFinalLine) {\n                    parts.push({ pos: startPos, end: commentRange.end });\n                }\n                if (parts.length === 0)\n                    return;\n                var startLinePos = ts.getStartPositionOfLine(startLine, sourceFile);\n                var nonWhitespaceColumnInFirstPart = formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(startLinePos, parts[0].pos, sourceFile, options);\n                var startIndex = 0;\n                if (firstLineIsIndented) {\n                    startIndex = 1;\n                    startLine++;\n                }\n                // shift all parts on the delta size\n                var delta = indentation - nonWhitespaceColumnInFirstPart.column;\n                for (var i = startIndex; i < parts.length; i++, startLine++) {\n                    var startLinePos_1 = ts.getStartPositionOfLine(startLine, sourceFile);\n                    var nonWhitespaceCharacterAndColumn = i === 0\n                        ? nonWhitespaceColumnInFirstPart\n                        : formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(parts[i].pos, parts[i].end, sourceFile, options);\n                    if (jsxTextStyleIndent) {\n                        // skip adding indentation to blank lines\n                        if (ts.isLineBreak(sourceFile.text.charCodeAt(ts.getStartPositionOfLine(startLine, sourceFile))))\n                            continue;\n                        // reset delta on every line\n                        delta = indentation - nonWhitespaceCharacterAndColumn.column;\n                    }\n                    var newIndentation = nonWhitespaceCharacterAndColumn.column + delta;\n                    if (newIndentation > 0) {\n                        var indentationString = getIndentationString(newIndentation, options);\n                        recordReplace(startLinePos_1, nonWhitespaceCharacterAndColumn.character, indentationString);\n                    }\n                    else {\n                        recordDelete(startLinePos_1, nonWhitespaceCharacterAndColumn.character);\n                    }\n                }\n            }\n            function trimTrailingWhitespacesForLines(line1, line2, range) {\n                for (var line = line1; line < line2; line++) {\n                    var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile);\n                    var lineEndPosition = ts.getEndLinePosition(line, sourceFile);\n                    // do not trim whitespaces in comments or template expression\n                    if (range && (ts.isComment(range.kind) || ts.isStringOrRegularExpressionOrTemplateLiteral(range.kind)) && range.pos <= lineEndPosition && range.end > lineEndPosition) {\n                        continue;\n                    }\n                    var whitespaceStart = getTrailingWhitespaceStartPosition(lineStartPosition, lineEndPosition);\n                    if (whitespaceStart !== -1) {\n                        ts.Debug.assert(whitespaceStart === lineStartPosition || !ts.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(whitespaceStart - 1)));\n                        recordDelete(whitespaceStart, lineEndPosition + 1 - whitespaceStart);\n                    }\n                }\n            }\n            /**\n             * @param start The position of the first character in range\n             * @param end The position of the last character in range\n             */\n            function getTrailingWhitespaceStartPosition(start, end) {\n                var pos = end;\n                while (pos >= start && ts.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(pos))) {\n                    pos--;\n                }\n                if (pos !== end) {\n                    return pos + 1;\n                }\n                return -1;\n            }\n            /**\n             * Trimming will be done for lines after the previous range\n             */\n            function trimTrailingWhitespacesForRemainingRange() {\n                var startPosition = previousRange ? previousRange.end : originalRange.pos;\n                var startLine = sourceFile.getLineAndCharacterOfPosition(startPosition).line;\n                var endLine = sourceFile.getLineAndCharacterOfPosition(originalRange.end).line;\n                trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange);\n            }\n            function recordDelete(start, len) {\n                if (len) {\n                    edits.push(ts.createTextChangeFromStartLength(start, len, \"\"));\n                }\n            }\n            function recordReplace(start, len, newText) {\n                if (len || newText) {\n                    edits.push(ts.createTextChangeFromStartLength(start, len, newText));\n                }\n            }\n            function recordInsert(start, text) {\n                if (text) {\n                    edits.push(ts.createTextChangeFromStartLength(start, 0, text));\n                }\n            }\n            function applyRuleEdits(rule, previousRange, previousStartLine, currentRange, currentStartLine) {\n                var onLaterLine = currentStartLine !== previousStartLine;\n                switch (rule.action) {\n                    case 1 /* StopProcessingSpaceActions */:\n                        // no action required\n                        return 0 /* None */;\n                    case 16 /* DeleteSpace */:\n                        if (previousRange.end !== currentRange.pos) {\n                            // delete characters starting from t1.end up to t2.pos exclusive\n                            recordDelete(previousRange.end, currentRange.pos - previousRange.end);\n                            return onLaterLine ? 2 /* LineRemoved */ : 0 /* None */;\n                        }\n                        break;\n                    case 32 /* DeleteToken */:\n                        recordDelete(previousRange.pos, previousRange.end - previousRange.pos);\n                        break;\n                    case 8 /* InsertNewLine */:\n                        // exit early if we on different lines and rule cannot change number of newlines\n                        // if line1 and line2 are on subsequent lines then no edits are required - ok to exit\n                        // if line1 and line2 are separated with more than one newline - ok to exit since we cannot delete extra new lines\n                        if (rule.flags !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) {\n                            return 0 /* None */;\n                        }\n                        // edit should not be applied if we have one line feed between elements\n                        var lineDelta = currentStartLine - previousStartLine;\n                        if (lineDelta !== 1) {\n                            recordReplace(previousRange.end, currentRange.pos - previousRange.end, ts.getNewLineOrDefaultFromHost(host, options));\n                            return onLaterLine ? 0 /* None */ : 1 /* LineAdded */;\n                        }\n                        break;\n                    case 4 /* InsertSpace */:\n                        // exit early if we on different lines and rule cannot change number of newlines\n                        if (rule.flags !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) {\n                            return 0 /* None */;\n                        }\n                        var posDelta = currentRange.pos - previousRange.end;\n                        if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange.end) !== 32 /* space */) {\n                            recordReplace(previousRange.end, currentRange.pos - previousRange.end, \" \");\n                            return onLaterLine ? 2 /* LineRemoved */ : 0 /* None */;\n                        }\n                        break;\n                    case 64 /* InsertTrailingSemicolon */:\n                        recordInsert(previousRange.end, \";\");\n                }\n                return 0 /* None */;\n            }\n        }\n        var LineAction;\n        (function (LineAction) {\n            LineAction[LineAction[\"None\"] = 0] = \"None\";\n            LineAction[LineAction[\"LineAdded\"] = 1] = \"LineAdded\";\n            LineAction[LineAction[\"LineRemoved\"] = 2] = \"LineRemoved\";\n        })(LineAction || (LineAction = {}));\n        /**\n         * @param precedingToken pass `null` if preceding token was already computed and result was `undefined`.\n         */\n        function getRangeOfEnclosingComment(sourceFile, position, precedingToken, tokenAtPosition) {\n            if (tokenAtPosition === void 0) { tokenAtPosition = ts.getTokenAtPosition(sourceFile, position); }\n            var jsdoc = ts.findAncestor(tokenAtPosition, ts.isJSDoc);\n            if (jsdoc)\n                tokenAtPosition = jsdoc.parent;\n            var tokenStart = tokenAtPosition.getStart(sourceFile);\n            if (tokenStart <= position && position < tokenAtPosition.getEnd()) {\n                return undefined;\n            }\n            // eslint-disable-next-line no-null/no-null\n            precedingToken = precedingToken === null ? undefined : precedingToken === undefined ? ts.findPrecedingToken(position, sourceFile) : precedingToken;\n            // Between two consecutive tokens, all comments are either trailing on the former\n            // or leading on the latter (and none are in both lists).\n            var trailingRangesOfPreviousToken = precedingToken && ts.getTrailingCommentRanges(sourceFile.text, precedingToken.end);\n            var leadingCommentRangesOfNextToken = ts.getLeadingCommentRangesOfNode(tokenAtPosition, sourceFile);\n            var commentRanges = ts.concatenate(trailingRangesOfPreviousToken, leadingCommentRangesOfNextToken);\n            return commentRanges && ts.find(commentRanges, function (range) { return ts.rangeContainsPositionExclusive(range, position) ||\n                // The end marker of a single-line comment does not include the newline character.\n                // With caret at `^`, in the following case, we are inside a comment (^ denotes the cursor position):\n                //\n                //    // asdf   ^\\n\n                //\n                // But for closed multi-line comments, we don't want to be inside the comment in the following case:\n                //\n                //    /* asdf */^\n                //\n                // However, unterminated multi-line comments *do* contain their end.\n                //\n                // Internally, we represent the end of the comment at the newline and closing '/', respectively.\n                //\n                position === range.end && (range.kind === 2 /* SingleLineCommentTrivia */ || position === sourceFile.getFullWidth()); });\n        }\n        formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment;\n        function getOpenTokenForList(node, list) {\n            switch (node.kind) {\n                case 166 /* Constructor */:\n                case 251 /* FunctionDeclaration */:\n                case 208 /* FunctionExpression */:\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                case 209 /* ArrowFunction */:\n                    if (node.typeParameters === list) {\n                        return 29 /* LessThanToken */;\n                    }\n                    else if (node.parameters === list) {\n                        return 20 /* OpenParenToken */;\n                    }\n                    break;\n                case 203 /* CallExpression */:\n                case 204 /* NewExpression */:\n                    if (node.typeArguments === list) {\n                        return 29 /* LessThanToken */;\n                    }\n                    else if (node.arguments === list) {\n                        return 20 /* OpenParenToken */;\n                    }\n                    break;\n                case 173 /* TypeReference */:\n                    if (node.typeArguments === list) {\n                        return 29 /* LessThanToken */;\n                    }\n                    break;\n                case 177 /* TypeLiteral */:\n                    return 18 /* OpenBraceToken */;\n            }\n            return 0 /* Unknown */;\n        }\n        function getCloseTokenForOpenToken(kind) {\n            switch (kind) {\n                case 20 /* OpenParenToken */:\n                    return 21 /* CloseParenToken */;\n                case 29 /* LessThanToken */:\n                    return 31 /* GreaterThanToken */;\n                case 18 /* OpenBraceToken */:\n                    return 19 /* CloseBraceToken */;\n            }\n            return 0 /* Unknown */;\n        }\n        var internedSizes;\n        var internedTabsIndentation;\n        var internedSpacesIndentation;\n        function getIndentationString(indentation, options) {\n            // reset interned strings if FormatCodeOptions were changed\n            var resetInternedStrings = !internedSizes || (internedSizes.tabSize !== options.tabSize || internedSizes.indentSize !== options.indentSize);\n            if (resetInternedStrings) {\n                internedSizes = { tabSize: options.tabSize, indentSize: options.indentSize };\n                internedTabsIndentation = internedSpacesIndentation = undefined;\n            }\n            if (!options.convertTabsToSpaces) {\n                var tabs = Math.floor(indentation / options.tabSize);\n                var spaces = indentation - tabs * options.tabSize;\n                var tabString = void 0;\n                if (!internedTabsIndentation) {\n                    internedTabsIndentation = [];\n                }\n                if (internedTabsIndentation[tabs] === undefined) {\n                    internedTabsIndentation[tabs] = tabString = ts.repeatString(\"\\t\", tabs);\n                }\n                else {\n                    tabString = internedTabsIndentation[tabs];\n                }\n                return spaces ? tabString + ts.repeatString(\" \", spaces) : tabString;\n            }\n            else {\n                var spacesString = void 0;\n                var quotient = Math.floor(indentation / options.indentSize);\n                var remainder = indentation % options.indentSize;\n                if (!internedSpacesIndentation) {\n                    internedSpacesIndentation = [];\n                }\n                if (internedSpacesIndentation[quotient] === undefined) {\n                    spacesString = ts.repeatString(\" \", options.indentSize * quotient);\n                    internedSpacesIndentation[quotient] = spacesString;\n                }\n                else {\n                    spacesString = internedSpacesIndentation[quotient];\n                }\n                return remainder ? spacesString + ts.repeatString(\" \", remainder) : spacesString;\n            }\n        }\n        formatting.getIndentationString = getIndentationString;\n    })(formatting = ts.formatting || (ts.formatting = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var formatting;\n    (function (formatting) {\n        var SmartIndenter;\n        (function (SmartIndenter) {\n            var Value;\n            (function (Value) {\n                Value[Value[\"Unknown\"] = -1] = \"Unknown\";\n            })(Value || (Value = {}));\n            /**\n             * @param assumeNewLineBeforeCloseBrace\n             * `false` when called on text from a real source file.\n             * `true` when we need to assume `position` is on a newline.\n             *\n             * This is useful for codefixes. Consider\n             * ```\n             * function f() {\n             * |}\n             * ```\n             * with `position` at `|`.\n             *\n             * When inserting some text after an open brace, we would like to get indentation as if a newline was already there.\n             * By default indentation at `position` will be 0 so 'assumeNewLineBeforeCloseBrace' overrides this behavior.\n             */\n            function getIndentation(position, sourceFile, options, assumeNewLineBeforeCloseBrace) {\n                if (assumeNewLineBeforeCloseBrace === void 0) { assumeNewLineBeforeCloseBrace = false; }\n                if (position > sourceFile.text.length) {\n                    return getBaseIndentation(options); // past EOF\n                }\n                // no indentation when the indent style is set to none,\n                // so we can return fast\n                if (options.indentStyle === ts.IndentStyle.None) {\n                    return 0;\n                }\n                var precedingToken = ts.findPrecedingToken(position, sourceFile, /*startNode*/ undefined, /*excludeJsdoc*/ true);\n                // eslint-disable-next-line no-null/no-null\n                var enclosingCommentRange = formatting.getRangeOfEnclosingComment(sourceFile, position, precedingToken || null);\n                if (enclosingCommentRange && enclosingCommentRange.kind === 3 /* MultiLineCommentTrivia */) {\n                    return getCommentIndent(sourceFile, position, options, enclosingCommentRange);\n                }\n                if (!precedingToken) {\n                    return getBaseIndentation(options);\n                }\n                // no indentation in string \\regex\\template literals\n                var precedingTokenIsLiteral = ts.isStringOrRegularExpressionOrTemplateLiteral(precedingToken.kind);\n                if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && position < precedingToken.end) {\n                    return 0;\n                }\n                var lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line;\n                // indentation is first non-whitespace character in a previous line\n                // for block indentation, we should look for a line which contains something that's not\n                // whitespace.\n                if (options.indentStyle === ts.IndentStyle.Block) {\n                    return getBlockIndent(sourceFile, position, options);\n                }\n                if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 216 /* BinaryExpression */) {\n                    // previous token is comma that separates items in list - find the previous item and try to derive indentation from it\n                    var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options);\n                    if (actualIndentation !== -1 /* Unknown */) {\n                        return actualIndentation;\n                    }\n                }\n                var containerList = getListByPosition(position, precedingToken.parent, sourceFile);\n                // use list position if the preceding token is before any list items\n                if (containerList && !ts.rangeContainsRange(containerList, precedingToken)) {\n                    return getActualIndentationForListStartLine(containerList, sourceFile, options) + options.indentSize; // TODO: GH#18217\n                }\n                return getSmartIndent(sourceFile, position, precedingToken, lineAtPosition, assumeNewLineBeforeCloseBrace, options);\n            }\n            SmartIndenter.getIndentation = getIndentation;\n            function getCommentIndent(sourceFile, position, options, enclosingCommentRange) {\n                var previousLine = ts.getLineAndCharacterOfPosition(sourceFile, position).line - 1;\n                var commentStartLine = ts.getLineAndCharacterOfPosition(sourceFile, enclosingCommentRange.pos).line;\n                ts.Debug.assert(commentStartLine >= 0);\n                if (previousLine <= commentStartLine) {\n                    return findFirstNonWhitespaceColumn(ts.getStartPositionOfLine(commentStartLine, sourceFile), position, sourceFile, options);\n                }\n                var startPositionOfLine = ts.getStartPositionOfLine(previousLine, sourceFile);\n                var _a = findFirstNonWhitespaceCharacterAndColumn(startPositionOfLine, position, sourceFile, options), column = _a.column, character = _a.character;\n                if (column === 0) {\n                    return column;\n                }\n                var firstNonWhitespaceCharacterCode = sourceFile.text.charCodeAt(startPositionOfLine + character);\n                return firstNonWhitespaceCharacterCode === 42 /* asterisk */ ? column - 1 : column;\n            }\n            function getBlockIndent(sourceFile, position, options) {\n                // move backwards until we find a line with a non-whitespace character,\n                // then find the first non-whitespace character for that line.\n                var current = position;\n                while (current > 0) {\n                    var char = sourceFile.text.charCodeAt(current);\n                    if (!ts.isWhiteSpaceLike(char)) {\n                        break;\n                    }\n                    current--;\n                }\n                var lineStart = ts.getLineStartPositionForPosition(current, sourceFile);\n                return findFirstNonWhitespaceColumn(lineStart, current, sourceFile, options);\n            }\n            function getSmartIndent(sourceFile, position, precedingToken, lineAtPosition, assumeNewLineBeforeCloseBrace, options) {\n                // try to find node that can contribute to indentation and includes 'position' starting from 'precedingToken'\n                // if such node is found - compute initial indentation for 'position' inside this node\n                var previous;\n                var current = precedingToken;\n                while (current) {\n                    if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(options, current, previous, sourceFile, /*isNextChild*/ true)) {\n                        var currentStart = getStartLineAndCharacterForNode(current, sourceFile);\n                        var nextTokenKind = nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile);\n                        var indentationDelta = nextTokenKind !== 0 /* Unknown */\n                            // handle cases when codefix is about to be inserted before the close brace\n                            ? assumeNewLineBeforeCloseBrace && nextTokenKind === 2 /* CloseBrace */ ? options.indentSize : 0\n                            : lineAtPosition !== currentStart.line ? options.indentSize : 0;\n                        return getIndentationForNodeWorker(current, currentStart, /*ignoreActualIndentationRange*/ undefined, indentationDelta, sourceFile, /*isNextChild*/ true, options); // TODO: GH#18217\n                    }\n                    // check if current node is a list item - if yes, take indentation from it\n                    // do not consider parent-child line sharing yet:\n                    // function foo(a\n                    //    | preceding node 'a' does share line with its parent but indentation is expected\n                    var actualIndentation = getActualIndentationForListItem(current, sourceFile, options, /*listIndentsChild*/ true);\n                    if (actualIndentation !== -1 /* Unknown */) {\n                        return actualIndentation;\n                    }\n                    previous = current;\n                    current = current.parent;\n                }\n                // no parent was found - return the base indentation of the SourceFile\n                return getBaseIndentation(options);\n            }\n            function getIndentationForNode(n, ignoreActualIndentationRange, sourceFile, options) {\n                var start = sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile));\n                return getIndentationForNodeWorker(n, start, ignoreActualIndentationRange, /*indentationDelta*/ 0, sourceFile, /*isNextChild*/ false, options);\n            }\n            SmartIndenter.getIndentationForNode = getIndentationForNode;\n            function getBaseIndentation(options) {\n                return options.baseIndentSize || 0;\n            }\n            SmartIndenter.getBaseIndentation = getBaseIndentation;\n            function getIndentationForNodeWorker(current, currentStart, ignoreActualIndentationRange, indentationDelta, sourceFile, isNextChild, options) {\n                var _a;\n                var parent = current.parent;\n                // Walk up the tree and collect indentation for parent-child node pairs. Indentation is not added if\n                // * parent and child nodes start on the same line, or\n                // * parent is an IfStatement and child starts on the same line as an 'else clause'.\n                while (parent) {\n                    var useActualIndentation = true;\n                    if (ignoreActualIndentationRange) {\n                        var start = current.getStart(sourceFile);\n                        useActualIndentation = start < ignoreActualIndentationRange.pos || start > ignoreActualIndentationRange.end;\n                    }\n                    var containingListOrParentStart = getContainingListOrParentStart(parent, current, sourceFile);\n                    var parentAndChildShareLine = containingListOrParentStart.line === currentStart.line ||\n                        childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile);\n                    if (useActualIndentation) {\n                        // check if current node is a list item - if yes, take indentation from it\n                        var firstListChild = (_a = getContainingList(current, sourceFile)) === null || _a === void 0 ? void 0 : _a[0];\n                        // A list indents its children if the children begin on a later line than the list itself:\n                        //\n                        // f1(               L0 - List start\n                        //   {               L1 - First child start: indented, along with all other children\n                        //     prop: 0\n                        //   },\n                        //   {\n                        //     prop: 1\n                        //   }\n                        // )\n                        //\n                        // f2({             L0 - List start and first child start: children are not indented.\n                        //   prop: 0             Object properties are indented only one level, because the list\n                        // }, {                  itself contributes nothing.\n                        //   prop: 1        L3 - The indentation of the second object literal is best understood by\n                        // })                    looking at the relationship between the list and *first* list item.\n                        var listIndentsChild = !!firstListChild && getStartLineAndCharacterForNode(firstListChild, sourceFile).line > containingListOrParentStart.line;\n                        var actualIndentation = getActualIndentationForListItem(current, sourceFile, options, listIndentsChild);\n                        if (actualIndentation !== -1 /* Unknown */) {\n                            return actualIndentation + indentationDelta;\n                        }\n                        // try to fetch actual indentation for current node from source text\n                        actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options);\n                        if (actualIndentation !== -1 /* Unknown */) {\n                            return actualIndentation + indentationDelta;\n                        }\n                    }\n                    // increase indentation if parent node wants its content to be indented and parent and child nodes don't start on the same line\n                    if (shouldIndentChildNode(options, parent, current, sourceFile, isNextChild) && !parentAndChildShareLine) {\n                        indentationDelta += options.indentSize;\n                    }\n                    // In our AST, a call argument's `parent` is the call-expression, not the argument list.\n                    // We would like to increase indentation based on the relationship between an argument and its argument-list,\n                    // so we spoof the starting position of the (parent) call-expression to match the (non-parent) argument-list.\n                    // But, the spoofed start-value could then cause a problem when comparing the start position of the call-expression\n                    // to *its* parent (in the case of an iife, an expression statement), adding an extra level of indentation.\n                    //\n                    // Instead, when at an argument, we unspoof the starting position of the enclosing call expression\n                    // *after* applying indentation for the argument.\n                    var useTrueStart = isArgumentAndStartLineOverlapsExpressionBeingCalled(parent, current, currentStart.line, sourceFile);\n                    current = parent;\n                    parent = current.parent;\n                    currentStart = useTrueStart ? sourceFile.getLineAndCharacterOfPosition(current.getStart(sourceFile)) : containingListOrParentStart;\n                }\n                return indentationDelta + getBaseIndentation(options);\n            }\n            function getContainingListOrParentStart(parent, child, sourceFile) {\n                var containingList = getContainingList(child, sourceFile);\n                var startPos = containingList ? containingList.pos : parent.getStart(sourceFile);\n                return sourceFile.getLineAndCharacterOfPosition(startPos);\n            }\n            /*\n             * Function returns Value.Unknown if indentation cannot be determined\n             */\n            function getActualIndentationForListItemBeforeComma(commaToken, sourceFile, options) {\n                // previous token is comma that separates items in list - find the previous item and try to derive indentation from it\n                var commaItemInfo = ts.findListItemInfo(commaToken);\n                if (commaItemInfo && commaItemInfo.listItemIndex > 0) {\n                    return deriveActualIndentationFromList(commaItemInfo.list.getChildren(), commaItemInfo.listItemIndex - 1, sourceFile, options);\n                }\n                else {\n                    // handle broken code gracefully\n                    return -1 /* Unknown */;\n                }\n            }\n            /*\n             * Function returns Value.Unknown if actual indentation for node should not be used (i.e because node is nested expression)\n             */\n            function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) {\n                // actual indentation is used for statements\\declarations if one of cases below is true:\n                // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually\n                // - parent and child are not on the same line\n                var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) &&\n                    (parent.kind === 297 /* SourceFile */ || !parentAndChildShareLine);\n                if (!useActualIndentation) {\n                    return -1 /* Unknown */;\n                }\n                return findColumnForFirstNonWhitespaceCharacterInLine(currentLineAndChar, sourceFile, options);\n            }\n            var NextTokenKind;\n            (function (NextTokenKind) {\n                NextTokenKind[NextTokenKind[\"Unknown\"] = 0] = \"Unknown\";\n                NextTokenKind[NextTokenKind[\"OpenBrace\"] = 1] = \"OpenBrace\";\n                NextTokenKind[NextTokenKind[\"CloseBrace\"] = 2] = \"CloseBrace\";\n            })(NextTokenKind || (NextTokenKind = {}));\n            function nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile) {\n                var nextToken = ts.findNextToken(precedingToken, current, sourceFile);\n                if (!nextToken) {\n                    return 0 /* Unknown */;\n                }\n                if (nextToken.kind === 18 /* OpenBraceToken */) {\n                    // open braces are always indented at the parent level\n                    return 1 /* OpenBrace */;\n                }\n                else if (nextToken.kind === 19 /* CloseBraceToken */) {\n                    // close braces are indented at the parent level if they are located on the same line with cursor\n                    // this means that if new line will be added at $ position, this case will be indented\n                    // class A {\n                    //    $\n                    // }\n                    /// and this one - not\n                    // class A {\n                    // $}\n                    var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line;\n                    return lineAtPosition === nextTokenStartLine ? 2 /* CloseBrace */ : 0 /* Unknown */;\n                }\n                return 0 /* Unknown */;\n            }\n            function getStartLineAndCharacterForNode(n, sourceFile) {\n                return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile));\n            }\n            function isArgumentAndStartLineOverlapsExpressionBeingCalled(parent, child, childStartLine, sourceFile) {\n                if (!(ts.isCallExpression(parent) && ts.contains(parent.arguments, child))) {\n                    return false;\n                }\n                var expressionOfCallExpressionEnd = parent.expression.getEnd();\n                var expressionOfCallExpressionEndLine = ts.getLineAndCharacterOfPosition(sourceFile, expressionOfCallExpressionEnd).line;\n                return expressionOfCallExpressionEndLine === childStartLine;\n            }\n            SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled;\n            function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) {\n                if (parent.kind === 234 /* IfStatement */ && parent.elseStatement === child) {\n                    var elseKeyword = ts.findChildOfKind(parent, 90 /* ElseKeyword */, sourceFile);\n                    ts.Debug.assert(elseKeyword !== undefined);\n                    var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line;\n                    return elseKeywordStartLine === childStartLine;\n                }\n                return false;\n            }\n            SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement = childStartsOnTheSameLineWithElseInIfStatement;\n            // A multiline conditional typically increases the indentation of its whenTrue and whenFalse children:\n            //\n            // condition\n            //   ? whenTrue\n            //   : whenFalse;\n            //\n            // However, that indentation does not apply if the subexpressions themselves span multiple lines,\n            // applying their own indentation:\n            //\n            // (() => {\n            //   return complexCalculationForCondition();\n            // })() ? {\n            //   whenTrue: 'multiline object literal'\n            // } : (\n            //   whenFalse('multiline parenthesized expression')\n            // );\n            //\n            // In these cases, we must discard the indentation increase that would otherwise be applied to the\n            // whenTrue and whenFalse children to avoid double-indenting their contents. To identify this scenario,\n            // we check for the whenTrue branch beginning on the line that the condition ends, and the whenFalse\n            // branch beginning on the line that the whenTrue branch ends.\n            function childIsUnindentedBranchOfConditionalExpression(parent, child, childStartLine, sourceFile) {\n                if (ts.isConditionalExpression(parent) && (child === parent.whenTrue || child === parent.whenFalse)) {\n                    var conditionEndLine = ts.getLineAndCharacterOfPosition(sourceFile, parent.condition.end).line;\n                    if (child === parent.whenTrue) {\n                        return childStartLine === conditionEndLine;\n                    }\n                    else {\n                        // On the whenFalse side, we have to look at the whenTrue side, because if that one was\n                        // indented, whenFalse must also be indented:\n                        //\n                        // const y = true\n                        //   ? 1 : (          L1: whenTrue indented because it's on a new line\n                        //     0              L2: indented two stops, one because whenTrue was indented\n                        //   );                   and one because of the parentheses spanning multiple lines\n                        var trueStartLine = getStartLineAndCharacterForNode(parent.whenTrue, sourceFile).line;\n                        var trueEndLine = ts.getLineAndCharacterOfPosition(sourceFile, parent.whenTrue.end).line;\n                        return conditionEndLine === trueStartLine && trueEndLine === childStartLine;\n                    }\n                }\n                return false;\n            }\n            SmartIndenter.childIsUnindentedBranchOfConditionalExpression = childIsUnindentedBranchOfConditionalExpression;\n            function argumentStartsOnSameLineAsPreviousArgument(parent, child, childStartLine, sourceFile) {\n                if (ts.isCallOrNewExpression(parent)) {\n                    if (!parent.arguments)\n                        return false;\n                    var currentNode = ts.find(parent.arguments, function (arg) { return arg.pos === child.pos; });\n                    // If it's not one of the arguments, don't look past this\n                    if (!currentNode)\n                        return false;\n                    var currentIndex = parent.arguments.indexOf(currentNode);\n                    if (currentIndex === 0)\n                        return false; // Can't look at previous node if first\n                    var previousNode = parent.arguments[currentIndex - 1];\n                    var lineOfPreviousNode = ts.getLineAndCharacterOfPosition(sourceFile, previousNode.getEnd()).line;\n                    if (childStartLine === lineOfPreviousNode) {\n                        return true;\n                    }\n                }\n                return false;\n            }\n            SmartIndenter.argumentStartsOnSameLineAsPreviousArgument = argumentStartsOnSameLineAsPreviousArgument;\n            function getContainingList(node, sourceFile) {\n                return node.parent && getListByRange(node.getStart(sourceFile), node.getEnd(), node.parent, sourceFile);\n            }\n            SmartIndenter.getContainingList = getContainingList;\n            function getListByPosition(pos, node, sourceFile) {\n                return node && getListByRange(pos, pos, node, sourceFile);\n            }\n            function getListByRange(start, end, node, sourceFile) {\n                switch (node.kind) {\n                    case 173 /* TypeReference */:\n                        return getList(node.typeArguments);\n                    case 200 /* ObjectLiteralExpression */:\n                        return getList(node.properties);\n                    case 199 /* ArrayLiteralExpression */:\n                        return getList(node.elements);\n                    case 177 /* TypeLiteral */:\n                        return getList(node.members);\n                    case 251 /* FunctionDeclaration */:\n                    case 208 /* FunctionExpression */:\n                    case 209 /* ArrowFunction */:\n                    case 165 /* MethodDeclaration */:\n                    case 164 /* MethodSignature */:\n                    case 169 /* CallSignature */:\n                    case 166 /* Constructor */:\n                    case 175 /* ConstructorType */:\n                    case 170 /* ConstructSignature */:\n                        return getList(node.typeParameters) || getList(node.parameters);\n                    case 252 /* ClassDeclaration */:\n                    case 221 /* ClassExpression */:\n                    case 253 /* InterfaceDeclaration */:\n                    case 254 /* TypeAliasDeclaration */:\n                    case 330 /* JSDocTemplateTag */:\n                        return getList(node.typeParameters);\n                    case 204 /* NewExpression */:\n                    case 203 /* CallExpression */:\n                        return getList(node.typeArguments) || getList(node.arguments);\n                    case 250 /* VariableDeclarationList */:\n                        return getList(node.declarations);\n                    case 264 /* NamedImports */:\n                    case 268 /* NamedExports */:\n                        return getList(node.elements);\n                    case 196 /* ObjectBindingPattern */:\n                    case 197 /* ArrayBindingPattern */:\n                        return getList(node.elements);\n                }\n                function getList(list) {\n                    return list && ts.rangeContainsStartEnd(getVisualListRange(node, list, sourceFile), start, end) ? list : undefined;\n                }\n            }\n            function getVisualListRange(node, list, sourceFile) {\n                var children = node.getChildren(sourceFile);\n                for (var i = 1; i < children.length - 1; i++) {\n                    if (children[i].pos === list.pos && children[i].end === list.end) {\n                        return { pos: children[i - 1].end, end: children[i + 1].getStart(sourceFile) };\n                    }\n                }\n                return list;\n            }\n            function getActualIndentationForListStartLine(list, sourceFile, options) {\n                if (!list) {\n                    return -1 /* Unknown */;\n                }\n                return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options);\n            }\n            function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) {\n                if (node.parent && node.parent.kind === 250 /* VariableDeclarationList */) {\n                    // VariableDeclarationList has no wrapping tokens\n                    return -1 /* Unknown */;\n                }\n                var containingList = getContainingList(node, sourceFile);\n                if (containingList) {\n                    var index = containingList.indexOf(node);\n                    if (index !== -1) {\n                        var result = deriveActualIndentationFromList(containingList, index, sourceFile, options);\n                        if (result !== -1 /* Unknown */) {\n                            return result;\n                        }\n                    }\n                    return getActualIndentationForListStartLine(containingList, sourceFile, options) + (listIndentsChild ? options.indentSize : 0); // TODO: GH#18217\n                }\n                return -1 /* Unknown */;\n            }\n            function deriveActualIndentationFromList(list, index, sourceFile, options) {\n                ts.Debug.assert(index >= 0 && index < list.length);\n                var node = list[index];\n                // walk toward the start of the list starting from current node and check if the line is the same for all items.\n                // if end line for item [i - 1] differs from the start line for item [i] - find column of the first non-whitespace character on the line of item [i]\n                var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile);\n                for (var i = index - 1; i >= 0; i--) {\n                    if (list[i].kind === 27 /* CommaToken */) {\n                        continue;\n                    }\n                    // skip list items that ends on the same line with the current list element\n                    var prevEndLine = sourceFile.getLineAndCharacterOfPosition(list[i].end).line;\n                    if (prevEndLine !== lineAndCharacter.line) {\n                        return findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options);\n                    }\n                    lineAndCharacter = getStartLineAndCharacterForNode(list[i], sourceFile);\n                }\n                return -1 /* Unknown */;\n            }\n            function findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options) {\n                var lineStart = sourceFile.getPositionOfLineAndCharacter(lineAndCharacter.line, 0);\n                return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options);\n            }\n            /**\n             * Character is the actual index of the character since the beginning of the line.\n             * Column - position of the character after expanding tabs to spaces.\n             * \"0\\t2$\"\n             * value of 'character' for '$' is 3\n             * value of 'column' for '$' is 6 (assuming that tab size is 4)\n             */\n            function findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options) {\n                var character = 0;\n                var column = 0;\n                for (var pos = startPos; pos < endPos; pos++) {\n                    var ch = sourceFile.text.charCodeAt(pos);\n                    if (!ts.isWhiteSpaceSingleLine(ch)) {\n                        break;\n                    }\n                    if (ch === 9 /* tab */) {\n                        column += options.tabSize + (column % options.tabSize);\n                    }\n                    else {\n                        column++;\n                    }\n                    character++;\n                }\n                return { column: column, character: character };\n            }\n            SmartIndenter.findFirstNonWhitespaceCharacterAndColumn = findFirstNonWhitespaceCharacterAndColumn;\n            function findFirstNonWhitespaceColumn(startPos, endPos, sourceFile, options) {\n                return findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options).column;\n            }\n            SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn;\n            function nodeWillIndentChild(settings, parent, child, sourceFile, indentByDefault) {\n                var childKind = child ? child.kind : 0 /* Unknown */;\n                switch (parent.kind) {\n                    case 233 /* ExpressionStatement */:\n                    case 252 /* ClassDeclaration */:\n                    case 221 /* ClassExpression */:\n                    case 253 /* InterfaceDeclaration */:\n                    case 255 /* EnumDeclaration */:\n                    case 254 /* TypeAliasDeclaration */:\n                    case 199 /* ArrayLiteralExpression */:\n                    case 230 /* Block */:\n                    case 257 /* ModuleBlock */:\n                    case 200 /* ObjectLiteralExpression */:\n                    case 177 /* TypeLiteral */:\n                    case 190 /* MappedType */:\n                    case 179 /* TupleType */:\n                    case 258 /* CaseBlock */:\n                    case 285 /* DefaultClause */:\n                    case 284 /* CaseClause */:\n                    case 207 /* ParenthesizedExpression */:\n                    case 201 /* PropertyAccessExpression */:\n                    case 203 /* CallExpression */:\n                    case 204 /* NewExpression */:\n                    case 232 /* VariableStatement */:\n                    case 266 /* ExportAssignment */:\n                    case 242 /* ReturnStatement */:\n                    case 217 /* ConditionalExpression */:\n                    case 197 /* ArrayBindingPattern */:\n                    case 196 /* ObjectBindingPattern */:\n                    case 275 /* JsxOpeningElement */:\n                    case 278 /* JsxOpeningFragment */:\n                    case 274 /* JsxSelfClosingElement */:\n                    case 283 /* JsxExpression */:\n                    case 164 /* MethodSignature */:\n                    case 169 /* CallSignature */:\n                    case 170 /* ConstructSignature */:\n                    case 160 /* Parameter */:\n                    case 174 /* FunctionType */:\n                    case 175 /* ConstructorType */:\n                    case 186 /* ParenthesizedType */:\n                    case 205 /* TaggedTemplateExpression */:\n                    case 213 /* AwaitExpression */:\n                    case 268 /* NamedExports */:\n                    case 264 /* NamedImports */:\n                    case 270 /* ExportSpecifier */:\n                    case 265 /* ImportSpecifier */:\n                    case 163 /* PropertyDeclaration */:\n                        return true;\n                    case 249 /* VariableDeclaration */:\n                    case 288 /* PropertyAssignment */:\n                    case 216 /* BinaryExpression */:\n                        if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 200 /* ObjectLiteralExpression */) { // TODO: GH#18217\n                            return rangeIsOnOneLine(sourceFile, child);\n                        }\n                        if (parent.kind !== 216 /* BinaryExpression */) {\n                            return true;\n                        }\n                        break;\n                    case 235 /* DoStatement */:\n                    case 236 /* WhileStatement */:\n                    case 238 /* ForInStatement */:\n                    case 239 /* ForOfStatement */:\n                    case 237 /* ForStatement */:\n                    case 234 /* IfStatement */:\n                    case 251 /* FunctionDeclaration */:\n                    case 208 /* FunctionExpression */:\n                    case 165 /* MethodDeclaration */:\n                    case 166 /* Constructor */:\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                        return childKind !== 230 /* Block */;\n                    case 209 /* ArrowFunction */:\n                        if (sourceFile && childKind === 207 /* ParenthesizedExpression */) {\n                            return rangeIsOnOneLine(sourceFile, child);\n                        }\n                        return childKind !== 230 /* Block */;\n                    case 267 /* ExportDeclaration */:\n                        return childKind !== 268 /* NamedExports */;\n                    case 261 /* ImportDeclaration */:\n                        return childKind !== 262 /* ImportClause */ ||\n                            (!!child.namedBindings && child.namedBindings.kind !== 264 /* NamedImports */);\n                    case 273 /* JsxElement */:\n                        return childKind !== 276 /* JsxClosingElement */;\n                    case 277 /* JsxFragment */:\n                        return childKind !== 279 /* JsxClosingFragment */;\n                    case 183 /* IntersectionType */:\n                    case 182 /* UnionType */:\n                        if (childKind === 177 /* TypeLiteral */ || childKind === 179 /* TupleType */) {\n                            return false;\n                        }\n                        break;\n                }\n                // No explicit rule for given nodes so the result will follow the default value argument\n                return indentByDefault;\n            }\n            SmartIndenter.nodeWillIndentChild = nodeWillIndentChild;\n            function isControlFlowEndingStatement(kind, parent) {\n                switch (kind) {\n                    case 242 /* ReturnStatement */:\n                    case 246 /* ThrowStatement */:\n                    case 240 /* ContinueStatement */:\n                    case 241 /* BreakStatement */:\n                        return parent.kind !== 230 /* Block */;\n                    default:\n                        return false;\n                }\n            }\n            /**\n             * True when the parent node should indent the given child by an explicit rule.\n             * @param isNextChild If true, we are judging indent of a hypothetical child *after* this one, not the current child.\n             */\n            function shouldIndentChildNode(settings, parent, child, sourceFile, isNextChild) {\n                if (isNextChild === void 0) { isNextChild = false; }\n                return nodeWillIndentChild(settings, parent, child, sourceFile, /*indentByDefault*/ false)\n                    && !(isNextChild && child && isControlFlowEndingStatement(child.kind, parent));\n            }\n            SmartIndenter.shouldIndentChildNode = shouldIndentChildNode;\n            function rangeIsOnOneLine(sourceFile, range) {\n                var rangeStart = ts.skipTrivia(sourceFile.text, range.pos);\n                var startLine = sourceFile.getLineAndCharacterOfPosition(rangeStart).line;\n                var endLine = sourceFile.getLineAndCharacterOfPosition(range.end).line;\n                return startLine === endLine;\n            }\n        })(SmartIndenter = formatting.SmartIndenter || (formatting.SmartIndenter = {}));\n    })(formatting = ts.formatting || (ts.formatting = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var textChanges;\n    (function (textChanges_3) {\n        /**\n         * Currently for simplicity we store recovered positions on the node itself.\n         * It can be changed to side-table later if we decide that current design is too invasive.\n         */\n        function getPos(n) {\n            var result = n.__pos;\n            ts.Debug.assert(typeof result === \"number\");\n            return result;\n        }\n        function setPos(n, pos) {\n            ts.Debug.assert(typeof pos === \"number\");\n            n.__pos = pos;\n        }\n        function getEnd(n) {\n            var result = n.__end;\n            ts.Debug.assert(typeof result === \"number\");\n            return result;\n        }\n        function setEnd(n, end) {\n            ts.Debug.assert(typeof end === \"number\");\n            n.__end = end;\n        }\n        var LeadingTriviaOption;\n        (function (LeadingTriviaOption) {\n            /** Exclude all leading trivia (use getStart()) */\n            LeadingTriviaOption[LeadingTriviaOption[\"Exclude\"] = 0] = \"Exclude\";\n            /** Include leading trivia and,\n             * if there are no line breaks between the node and the previous token,\n             * include all trivia between the node and the previous token\n             */\n            LeadingTriviaOption[LeadingTriviaOption[\"IncludeAll\"] = 1] = \"IncludeAll\";\n            /**\n             * Include attached JSDoc comments\n             */\n            LeadingTriviaOption[LeadingTriviaOption[\"JSDoc\"] = 2] = \"JSDoc\";\n            /**\n             * Only delete trivia on the same line as getStart().\n             * Used to avoid deleting leading comments\n             */\n            LeadingTriviaOption[LeadingTriviaOption[\"StartLine\"] = 3] = \"StartLine\";\n        })(LeadingTriviaOption = textChanges_3.LeadingTriviaOption || (textChanges_3.LeadingTriviaOption = {}));\n        var TrailingTriviaOption;\n        (function (TrailingTriviaOption) {\n            /** Exclude all trailing trivia (use getEnd()) */\n            TrailingTriviaOption[TrailingTriviaOption[\"Exclude\"] = 0] = \"Exclude\";\n            /** Doesn't include whitespace, but does strip comments */\n            TrailingTriviaOption[TrailingTriviaOption[\"ExcludeWhitespace\"] = 1] = \"ExcludeWhitespace\";\n            /** Include trailing trivia */\n            TrailingTriviaOption[TrailingTriviaOption[\"Include\"] = 2] = \"Include\";\n        })(TrailingTriviaOption = textChanges_3.TrailingTriviaOption || (textChanges_3.TrailingTriviaOption = {}));\n        function skipWhitespacesAndLineBreaks(text, start) {\n            return ts.skipTrivia(text, start, /*stopAfterLineBreak*/ false, /*stopAtComments*/ true);\n        }\n        function hasCommentsBeforeLineBreak(text, start) {\n            var i = start;\n            while (i < text.length) {\n                var ch = text.charCodeAt(i);\n                if (ts.isWhiteSpaceSingleLine(ch)) {\n                    i++;\n                    continue;\n                }\n                return ch === 47 /* slash */;\n            }\n            return false;\n        }\n        var useNonAdjustedPositions = {\n            leadingTriviaOption: LeadingTriviaOption.Exclude,\n            trailingTriviaOption: TrailingTriviaOption.Exclude,\n        };\n        var ChangeKind;\n        (function (ChangeKind) {\n            ChangeKind[ChangeKind[\"Remove\"] = 0] = \"Remove\";\n            ChangeKind[ChangeKind[\"ReplaceWithSingleNode\"] = 1] = \"ReplaceWithSingleNode\";\n            ChangeKind[ChangeKind[\"ReplaceWithMultipleNodes\"] = 2] = \"ReplaceWithMultipleNodes\";\n            ChangeKind[ChangeKind[\"Text\"] = 3] = \"Text\";\n        })(ChangeKind || (ChangeKind = {}));\n        function getAdjustedRange(sourceFile, startNode, endNode, options) {\n            return { pos: getAdjustedStartPosition(sourceFile, startNode, options), end: getAdjustedEndPosition(sourceFile, endNode, options) };\n        }\n        function getAdjustedStartPosition(sourceFile, node, options) {\n            var leadingTriviaOption = options.leadingTriviaOption;\n            if (leadingTriviaOption === LeadingTriviaOption.Exclude) {\n                return node.getStart(sourceFile);\n            }\n            if (leadingTriviaOption === LeadingTriviaOption.StartLine) {\n                return ts.getLineStartPositionForPosition(node.getStart(sourceFile), sourceFile);\n            }\n            if (leadingTriviaOption === LeadingTriviaOption.JSDoc) {\n                var JSDocComments = ts.getJSDocCommentRanges(node, sourceFile.text);\n                if (JSDocComments === null || JSDocComments === void 0 ? void 0 : JSDocComments.length) {\n                    return ts.getLineStartPositionForPosition(JSDocComments[0].pos, sourceFile);\n                }\n            }\n            var fullStart = node.getFullStart();\n            var start = node.getStart(sourceFile);\n            if (fullStart === start) {\n                return start;\n            }\n            var fullStartLine = ts.getLineStartPositionForPosition(fullStart, sourceFile);\n            var startLine = ts.getLineStartPositionForPosition(start, sourceFile);\n            if (startLine === fullStartLine) {\n                // full start and start of the node are on the same line\n                //   a,     b;\n                //    ^     ^\n                //    |   start\n                // fullstart\n                // when b is replaced - we usually want to keep the leading trvia\n                // when b is deleted - we delete it\n                return leadingTriviaOption === LeadingTriviaOption.IncludeAll ? fullStart : start;\n            }\n            // get start position of the line following the line that contains fullstart position\n            // (but only if the fullstart isn't the very beginning of the file)\n            var nextLineStart = fullStart > 0 ? 1 : 0;\n            var adjustedStartPosition = ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, fullStartLine) + nextLineStart, sourceFile);\n            // skip whitespaces/newlines\n            adjustedStartPosition = skipWhitespacesAndLineBreaks(sourceFile.text, adjustedStartPosition);\n            return ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile);\n        }\n        function getAdjustedEndPosition(sourceFile, node, options) {\n            var _a;\n            var end = node.end;\n            var trailingTriviaOption = options.trailingTriviaOption;\n            if (trailingTriviaOption === TrailingTriviaOption.Exclude) {\n                return end;\n            }\n            if (trailingTriviaOption === TrailingTriviaOption.ExcludeWhitespace) {\n                var comments = ts.concatenate(ts.getTrailingCommentRanges(sourceFile.text, end), ts.getLeadingCommentRanges(sourceFile.text, end));\n                var realEnd = (_a = comments === null || comments === void 0 ? void 0 : comments[comments.length - 1]) === null || _a === void 0 ? void 0 : _a.end;\n                if (realEnd) {\n                    return realEnd;\n                }\n                return end;\n            }\n            var newEnd = ts.skipTrivia(sourceFile.text, end, /*stopAfterLineBreak*/ true);\n            return newEnd !== end && (trailingTriviaOption === TrailingTriviaOption.Include || ts.isLineBreak(sourceFile.text.charCodeAt(newEnd - 1)))\n                ? newEnd\n                : end;\n        }\n        /**\n         * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element\n         */\n        function isSeparator(node, candidate) {\n            return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 200 /* ObjectLiteralExpression */));\n        }\n        function spaces(count) {\n            var s = \"\";\n            for (var i = 0; i < count; i++) {\n                s += \" \";\n            }\n            return s;\n        }\n        function isThisTypeAnnotatable(containingFunction) {\n            return ts.isFunctionExpression(containingFunction) || ts.isFunctionDeclaration(containingFunction);\n        }\n        textChanges_3.isThisTypeAnnotatable = isThisTypeAnnotatable;\n        var ChangeTracker = /** @class */ (function () {\n            /** Public for tests only. Other callers should use `ChangeTracker.with`. */\n            function ChangeTracker(newLineCharacter, formatContext) {\n                this.newLineCharacter = newLineCharacter;\n                this.formatContext = formatContext;\n                this.changes = [];\n                this.newFiles = [];\n                this.classesWithNodesInsertedAtStart = new ts.Map(); // Set<ClassDeclaration> implemented as Map<node id, ClassDeclaration>\n                this.deletedNodes = [];\n            }\n            ChangeTracker.fromContext = function (context) {\n                return new ChangeTracker(ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options), context.formatContext);\n            };\n            ChangeTracker.with = function (context, cb) {\n                var tracker = ChangeTracker.fromContext(context);\n                cb(tracker);\n                return tracker.getChanges();\n            };\n            ChangeTracker.prototype.pushRaw = function (sourceFile, change) {\n                ts.Debug.assertEqual(sourceFile.fileName, change.fileName);\n                for (var _i = 0, _a = change.textChanges; _i < _a.length; _i++) {\n                    var c = _a[_i];\n                    this.changes.push({\n                        kind: ChangeKind.Text,\n                        sourceFile: sourceFile,\n                        text: c.newText,\n                        range: ts.createTextRangeFromSpan(c.span),\n                    });\n                }\n            };\n            ChangeTracker.prototype.deleteRange = function (sourceFile, range) {\n                this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: range });\n            };\n            ChangeTracker.prototype.delete = function (sourceFile, node) {\n                this.deletedNodes.push({ sourceFile: sourceFile, node: node });\n            };\n            ChangeTracker.prototype.deleteNode = function (sourceFile, node, options) {\n                if (options === void 0) { options = { leadingTriviaOption: LeadingTriviaOption.IncludeAll }; }\n                this.deleteRange(sourceFile, getAdjustedRange(sourceFile, node, node, options));\n            };\n            ChangeTracker.prototype.deleteModifier = function (sourceFile, modifier) {\n                this.deleteRange(sourceFile, { pos: modifier.getStart(sourceFile), end: ts.skipTrivia(sourceFile.text, modifier.end, /*stopAfterLineBreak*/ true) });\n            };\n            ChangeTracker.prototype.deleteNodeRange = function (sourceFile, startNode, endNode, options) {\n                if (options === void 0) { options = { leadingTriviaOption: LeadingTriviaOption.IncludeAll }; }\n                var startPosition = getAdjustedStartPosition(sourceFile, startNode, options);\n                var endPosition = getAdjustedEndPosition(sourceFile, endNode, options);\n                this.deleteRange(sourceFile, { pos: startPosition, end: endPosition });\n            };\n            ChangeTracker.prototype.deleteNodeRangeExcludingEnd = function (sourceFile, startNode, afterEndNode, options) {\n                if (options === void 0) { options = { leadingTriviaOption: LeadingTriviaOption.IncludeAll }; }\n                var startPosition = getAdjustedStartPosition(sourceFile, startNode, options);\n                var endPosition = afterEndNode === undefined ? sourceFile.text.length : getAdjustedStartPosition(sourceFile, afterEndNode, options);\n                this.deleteRange(sourceFile, { pos: startPosition, end: endPosition });\n            };\n            ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) {\n                if (options === void 0) { options = {}; }\n                this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: range, options: options, node: newNode });\n            };\n            ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) {\n                if (options === void 0) { options = useNonAdjustedPositions; }\n                this.replaceRange(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNode, options);\n            };\n            ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) {\n                if (options === void 0) { options = useNonAdjustedPositions; }\n                this.replaceRange(sourceFile, getAdjustedRange(sourceFile, startNode, endNode, options), newNode, options);\n            };\n            ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) {\n                if (options === void 0) { options = {}; }\n                this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile: sourceFile, range: range, options: options, nodes: newNodes });\n            };\n            ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes, options) {\n                if (options === void 0) { options = useNonAdjustedPositions; }\n                this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNodes, options);\n            };\n            ChangeTracker.prototype.replaceNodeWithText = function (sourceFile, oldNode, text) {\n                this.replaceRangeWithText(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, useNonAdjustedPositions), text);\n            };\n            ChangeTracker.prototype.replaceNodeRangeWithNodes = function (sourceFile, startNode, endNode, newNodes, options) {\n                if (options === void 0) { options = useNonAdjustedPositions; }\n                this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, startNode, endNode, options), newNodes, options);\n            };\n            ChangeTracker.prototype.nextCommaToken = function (sourceFile, node) {\n                var next = ts.findNextToken(node, node.parent, sourceFile);\n                return next && next.kind === 27 /* CommaToken */ ? next : undefined;\n            };\n            ChangeTracker.prototype.replacePropertyAssignment = function (sourceFile, oldNode, newNode) {\n                var suffix = this.nextCommaToken(sourceFile, oldNode) ? \"\" : (\",\" + this.newLineCharacter);\n                this.replaceNode(sourceFile, oldNode, newNode, { suffix: suffix });\n            };\n            ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) {\n                if (options === void 0) { options = {}; }\n                this.replaceRange(sourceFile, ts.createRange(pos), newNode, options);\n            };\n            ChangeTracker.prototype.insertNodesAt = function (sourceFile, pos, newNodes, options) {\n                if (options === void 0) { options = {}; }\n                this.replaceRangeWithNodes(sourceFile, ts.createRange(pos), newNodes, options);\n            };\n            ChangeTracker.prototype.insertNodeAtTopOfFile = function (sourceFile, newNode, blankLineBetween) {\n                this.insertAtTopOfFile(sourceFile, newNode, blankLineBetween);\n            };\n            ChangeTracker.prototype.insertNodesAtTopOfFile = function (sourceFile, newNodes, blankLineBetween) {\n                this.insertAtTopOfFile(sourceFile, newNodes, blankLineBetween);\n            };\n            ChangeTracker.prototype.insertAtTopOfFile = function (sourceFile, insert, blankLineBetween) {\n                var pos = getInsertionPositionAtSourceFileTop(sourceFile);\n                var options = {\n                    prefix: pos === 0 ? undefined : this.newLineCharacter,\n                    suffix: (ts.isLineBreak(sourceFile.text.charCodeAt(pos)) ? \"\" : this.newLineCharacter) + (blankLineBetween ? this.newLineCharacter : \"\"),\n                };\n                if (ts.isArray(insert)) {\n                    this.insertNodesAt(sourceFile, pos, insert, options);\n                }\n                else {\n                    this.insertNodeAt(sourceFile, pos, insert, options);\n                }\n            };\n            ChangeTracker.prototype.insertFirstParameter = function (sourceFile, parameters, newParam) {\n                var p0 = ts.firstOrUndefined(parameters);\n                if (p0) {\n                    this.insertNodeBefore(sourceFile, p0, newParam);\n                }\n                else {\n                    this.insertNodeAt(sourceFile, parameters.pos, newParam);\n                }\n            };\n            ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, blankLineBetween, options) {\n                if (blankLineBetween === void 0) { blankLineBetween = false; }\n                if (options === void 0) { options = {}; }\n                this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before, options), newNode, this.getOptionsForInsertNodeBefore(before, newNode, blankLineBetween));\n            };\n            ChangeTracker.prototype.insertModifierAt = function (sourceFile, pos, modifier, options) {\n                if (options === void 0) { options = {}; }\n                this.insertNodeAt(sourceFile, pos, ts.factory.createToken(modifier), options);\n            };\n            ChangeTracker.prototype.insertModifierBefore = function (sourceFile, modifier, before) {\n                return this.insertModifierAt(sourceFile, before.getStart(sourceFile), modifier, { suffix: \" \" });\n            };\n            ChangeTracker.prototype.insertCommentBeforeLine = function (sourceFile, lineNumber, position, commentText) {\n                var lineStartPosition = ts.getStartPositionOfLine(lineNumber, sourceFile);\n                var startPosition = ts.getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition);\n                // First try to see if we can put the comment on the previous line.\n                // We need to make sure that we are not in the middle of a string literal or a comment.\n                // If so, we do not want to separate the node from its comment if we can.\n                // Otherwise, add an extra new line immediately before the error span.\n                var insertAtLineStart = isValidLocationToAddComment(sourceFile, startPosition);\n                var token = ts.getTouchingToken(sourceFile, insertAtLineStart ? startPosition : position);\n                var indent = sourceFile.text.slice(lineStartPosition, startPosition);\n                var text = (insertAtLineStart ? \"\" : this.newLineCharacter) + \"//\" + commentText + this.newLineCharacter + indent;\n                this.insertText(sourceFile, token.getStart(sourceFile), text);\n            };\n            ChangeTracker.prototype.insertJsdocCommentBefore = function (sourceFile, node, tag) {\n                var fnStart = node.getStart(sourceFile);\n                if (node.jsDoc) {\n                    for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) {\n                        var jsdoc = _a[_i];\n                        this.deleteRange(sourceFile, {\n                            pos: ts.getLineStartPositionForPosition(jsdoc.getStart(sourceFile), sourceFile),\n                            end: getAdjustedEndPosition(sourceFile, jsdoc, /*options*/ {})\n                        });\n                    }\n                }\n                var startPosition = ts.getPrecedingNonSpaceCharacterPosition(sourceFile.text, fnStart - 1);\n                var indent = sourceFile.text.slice(startPosition, fnStart);\n                this.insertNodeAt(sourceFile, fnStart, tag, { preserveLeadingWhitespace: false, suffix: this.newLineCharacter + indent });\n            };\n            ChangeTracker.prototype.replaceRangeWithText = function (sourceFile, range, text) {\n                this.changes.push({ kind: ChangeKind.Text, sourceFile: sourceFile, range: range, text: text });\n            };\n            ChangeTracker.prototype.insertText = function (sourceFile, pos, text) {\n                this.replaceRangeWithText(sourceFile, ts.createRange(pos), text);\n            };\n            /** Prefer this over replacing a node with another that has a type annotation, as it avoids reformatting the other parts of the node. */\n            ChangeTracker.prototype.tryInsertTypeAnnotation = function (sourceFile, node, type) {\n                var _a;\n                var endNode;\n                if (ts.isFunctionLike(node)) {\n                    endNode = ts.findChildOfKind(node, 21 /* CloseParenToken */, sourceFile);\n                    if (!endNode) {\n                        if (!ts.isArrowFunction(node))\n                            return false; // Function missing parentheses, give up\n                        // If no `)`, is an arrow function `x => x`, so use the end of the first parameter\n                        endNode = ts.first(node.parameters);\n                    }\n                }\n                else {\n                    endNode = (_a = (node.kind === 249 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken)) !== null && _a !== void 0 ? _a : node.name;\n                }\n                this.insertNodeAt(sourceFile, endNode.end, type, { prefix: \": \" });\n                return true;\n            };\n            ChangeTracker.prototype.tryInsertThisTypeAnnotation = function (sourceFile, node, type) {\n                var start = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile).getStart(sourceFile) + 1;\n                var suffix = node.parameters.length ? \", \" : \"\";\n                this.insertNodeAt(sourceFile, start, type, { prefix: \"this: \", suffix: suffix });\n            };\n            ChangeTracker.prototype.insertTypeParameters = function (sourceFile, node, typeParameters) {\n                // If no `(`, is an arrow function `x => x`, so use the pos of the first parameter\n                var start = (ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile) || ts.first(node.parameters)).getStart(sourceFile);\n                this.insertNodesAt(sourceFile, start, typeParameters, { prefix: \"<\", suffix: \">\", joiner: \", \" });\n            };\n            ChangeTracker.prototype.getOptionsForInsertNodeBefore = function (before, inserted, blankLineBetween) {\n                if (ts.isStatement(before) || ts.isClassElement(before)) {\n                    return { suffix: blankLineBetween ? this.newLineCharacter + this.newLineCharacter : this.newLineCharacter };\n                }\n                else if (ts.isVariableDeclaration(before)) { // insert `x = 1, ` into `const x = 1, y = 2;\n                    return { suffix: \", \" };\n                }\n                else if (ts.isParameter(before)) {\n                    return ts.isParameter(inserted) ? { suffix: \", \" } : {};\n                }\n                else if (ts.isStringLiteral(before) && ts.isImportDeclaration(before.parent) || ts.isNamedImports(before)) {\n                    return { suffix: \", \" };\n                }\n                else if (ts.isImportSpecifier(before)) {\n                    return { suffix: \",\" + (blankLineBetween ? this.newLineCharacter : \" \") };\n                }\n                return ts.Debug.failBadSyntaxKind(before); // We haven't handled this kind of node yet -- add it\n            };\n            ChangeTracker.prototype.insertNodeAtConstructorStart = function (sourceFile, ctr, newStatement) {\n                var firstStatement = ts.firstOrUndefined(ctr.body.statements);\n                if (!firstStatement || !ctr.body.multiLine) {\n                    this.replaceConstructorBody(sourceFile, ctr, __spreadArray([newStatement], ctr.body.statements));\n                }\n                else {\n                    this.insertNodeBefore(sourceFile, firstStatement, newStatement);\n                }\n            };\n            ChangeTracker.prototype.insertNodeAtConstructorEnd = function (sourceFile, ctr, newStatement) {\n                var lastStatement = ts.lastOrUndefined(ctr.body.statements);\n                if (!lastStatement || !ctr.body.multiLine) {\n                    this.replaceConstructorBody(sourceFile, ctr, __spreadArray(__spreadArray([], ctr.body.statements), [newStatement]));\n                }\n                else {\n                    this.insertNodeAfter(sourceFile, lastStatement, newStatement);\n                }\n            };\n            ChangeTracker.prototype.replaceConstructorBody = function (sourceFile, ctr, statements) {\n                this.replaceNode(sourceFile, ctr.body, ts.factory.createBlock(statements, /*multiLine*/ true));\n            };\n            ChangeTracker.prototype.insertNodeAtEndOfScope = function (sourceFile, scope, newNode) {\n                var pos = getAdjustedStartPosition(sourceFile, scope.getLastToken(), {});\n                this.insertNodeAt(sourceFile, pos, newNode, {\n                    prefix: ts.isLineBreak(sourceFile.text.charCodeAt(scope.getLastToken().pos)) ? this.newLineCharacter : this.newLineCharacter + this.newLineCharacter,\n                    suffix: this.newLineCharacter\n                });\n            };\n            ChangeTracker.prototype.insertNodeAtClassStart = function (sourceFile, cls, newElement) {\n                this.insertNodeAtStartWorker(sourceFile, cls, newElement);\n            };\n            ChangeTracker.prototype.insertNodeAtObjectStart = function (sourceFile, obj, newElement) {\n                this.insertNodeAtStartWorker(sourceFile, obj, newElement);\n            };\n            ChangeTracker.prototype.insertNodeAtStartWorker = function (sourceFile, cls, newElement) {\n                var _a;\n                var indentation = (_a = this.guessIndentationFromExistingMembers(sourceFile, cls)) !== null && _a !== void 0 ? _a : this.computeIndentationForNewMember(sourceFile, cls);\n                this.insertNodeAt(sourceFile, getMembersOrProperties(cls).pos, newElement, this.getInsertNodeAtStartInsertOptions(sourceFile, cls, indentation));\n            };\n            /**\n             * Tries to guess the indentation from the existing members of a class/interface/object. All members must be on\n             * new lines and must share the same indentation.\n             */\n            ChangeTracker.prototype.guessIndentationFromExistingMembers = function (sourceFile, cls) {\n                var indentation;\n                var lastRange = cls;\n                for (var _i = 0, _a = getMembersOrProperties(cls); _i < _a.length; _i++) {\n                    var member = _a[_i];\n                    if (ts.rangeStartPositionsAreOnSameLine(lastRange, member, sourceFile)) {\n                        // each indented member must be on a new line\n                        return undefined;\n                    }\n                    var memberStart = member.getStart(sourceFile);\n                    var memberIndentation = ts.formatting.SmartIndenter.findFirstNonWhitespaceColumn(ts.getLineStartPositionForPosition(memberStart, sourceFile), memberStart, sourceFile, this.formatContext.options);\n                    if (indentation === undefined) {\n                        indentation = memberIndentation;\n                    }\n                    else if (memberIndentation !== indentation) {\n                        // indentation of multiple members is not consistent\n                        return undefined;\n                    }\n                    lastRange = member;\n                }\n                return indentation;\n            };\n            ChangeTracker.prototype.computeIndentationForNewMember = function (sourceFile, cls) {\n                var _a;\n                var clsStart = cls.getStart(sourceFile);\n                return ts.formatting.SmartIndenter.findFirstNonWhitespaceColumn(ts.getLineStartPositionForPosition(clsStart, sourceFile), clsStart, sourceFile, this.formatContext.options)\n                    + ((_a = this.formatContext.options.indentSize) !== null && _a !== void 0 ? _a : 4);\n            };\n            ChangeTracker.prototype.getInsertNodeAtStartInsertOptions = function (sourceFile, cls, indentation) {\n                // Rules:\n                // - Always insert leading newline.\n                // - For object literals:\n                //   - Add a trailing comma if there are existing members in the node, or the source file is not a JSON file\n                //     (because trailing commas are generally illegal in a JSON file).\n                //   - Add a leading comma if the source file is not a JSON file, there are existing insertions,\n                //     and the node is empty (because we didn't add a trailing comma per the previous rule).\n                // - Only insert a trailing newline if body is single-line and there are no other insertions for the node.\n                //   NOTE: This is handled in `finishClassesWithNodesInsertedAtStart`.\n                var members = getMembersOrProperties(cls);\n                var isEmpty = members.length === 0;\n                var isFirstInsertion = ts.addToSeen(this.classesWithNodesInsertedAtStart, ts.getNodeId(cls), { node: cls, sourceFile: sourceFile });\n                var insertTrailingComma = ts.isObjectLiteralExpression(cls) && (!ts.isJsonSourceFile(sourceFile) || !isEmpty);\n                var insertLeadingComma = ts.isObjectLiteralExpression(cls) && ts.isJsonSourceFile(sourceFile) && isEmpty && !isFirstInsertion;\n                return {\n                    indentation: indentation,\n                    prefix: (insertLeadingComma ? \",\" : \"\") + this.newLineCharacter,\n                    suffix: insertTrailingComma ? \",\" : \"\"\n                };\n            };\n            ChangeTracker.prototype.insertNodeAfterComma = function (sourceFile, after, newNode) {\n                var endPosition = this.insertNodeAfterWorker(sourceFile, this.nextCommaToken(sourceFile, after) || after, newNode);\n                this.insertNodeAt(sourceFile, endPosition, newNode, this.getInsertNodeAfterOptions(sourceFile, after));\n            };\n            ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode) {\n                var endPosition = this.insertNodeAfterWorker(sourceFile, after, newNode);\n                this.insertNodeAt(sourceFile, endPosition, newNode, this.getInsertNodeAfterOptions(sourceFile, after));\n            };\n            ChangeTracker.prototype.insertNodeAtEndOfList = function (sourceFile, list, newNode) {\n                this.insertNodeAt(sourceFile, list.end, newNode, { prefix: \", \" });\n            };\n            ChangeTracker.prototype.insertNodesAfter = function (sourceFile, after, newNodes) {\n                var endPosition = this.insertNodeAfterWorker(sourceFile, after, ts.first(newNodes));\n                this.insertNodesAt(sourceFile, endPosition, newNodes, this.getInsertNodeAfterOptions(sourceFile, after));\n            };\n            ChangeTracker.prototype.insertNodeAfterWorker = function (sourceFile, after, newNode) {\n                if (needSemicolonBetween(after, newNode)) {\n                    // check if previous statement ends with semicolon\n                    // if not - insert semicolon to preserve the code from changing the meaning due to ASI\n                    if (sourceFile.text.charCodeAt(after.end - 1) !== 59 /* semicolon */) {\n                        this.replaceRange(sourceFile, ts.createRange(after.end), ts.factory.createToken(26 /* SemicolonToken */));\n                    }\n                }\n                var endPosition = getAdjustedEndPosition(sourceFile, after, {});\n                return endPosition;\n            };\n            ChangeTracker.prototype.getInsertNodeAfterOptions = function (sourceFile, after) {\n                var options = this.getInsertNodeAfterOptionsWorker(after);\n                return __assign(__assign({}, options), { prefix: after.end === sourceFile.end && ts.isStatement(after) ? (options.prefix ? \"\\n\" + options.prefix : \"\\n\") : options.prefix });\n            };\n            ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) {\n                switch (node.kind) {\n                    case 252 /* ClassDeclaration */:\n                    case 256 /* ModuleDeclaration */:\n                        return { prefix: this.newLineCharacter, suffix: this.newLineCharacter };\n                    case 249 /* VariableDeclaration */:\n                    case 10 /* StringLiteral */:\n                    case 78 /* Identifier */:\n                        return { prefix: \", \" };\n                    case 288 /* PropertyAssignment */:\n                        return { suffix: \",\" + this.newLineCharacter };\n                    case 92 /* ExportKeyword */:\n                        return { prefix: \" \" };\n                    case 160 /* Parameter */:\n                        return {};\n                    default:\n                        ts.Debug.assert(ts.isStatement(node) || ts.isClassOrTypeElement(node)); // Else we haven't handled this kind of node yet -- add it\n                        return { suffix: this.newLineCharacter };\n                }\n            };\n            ChangeTracker.prototype.insertName = function (sourceFile, node, name) {\n                ts.Debug.assert(!node.name);\n                if (node.kind === 209 /* ArrowFunction */) {\n                    var arrow = ts.findChildOfKind(node, 38 /* EqualsGreaterThanToken */, sourceFile);\n                    var lparen = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile);\n                    if (lparen) {\n                        // `() => {}` --> `function f() {}`\n                        this.insertNodesAt(sourceFile, lparen.getStart(sourceFile), [ts.factory.createToken(97 /* FunctionKeyword */), ts.factory.createIdentifier(name)], { joiner: \" \" });\n                        deleteNode(this, sourceFile, arrow);\n                    }\n                    else {\n                        // `x => {}` -> `function f(x) {}`\n                        this.insertText(sourceFile, ts.first(node.parameters).getStart(sourceFile), \"function \" + name + \"(\");\n                        // Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)`\n                        this.replaceRange(sourceFile, arrow, ts.factory.createToken(21 /* CloseParenToken */));\n                    }\n                    if (node.body.kind !== 230 /* Block */) {\n                        // `() => 0` => `function f() { return 0; }`\n                        this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts.factory.createToken(18 /* OpenBraceToken */), ts.factory.createToken(104 /* ReturnKeyword */)], { joiner: \" \", suffix: \" \" });\n                        this.insertNodesAt(sourceFile, node.body.end, [ts.factory.createToken(26 /* SemicolonToken */), ts.factory.createToken(19 /* CloseBraceToken */)], { joiner: \" \" });\n                    }\n                }\n                else {\n                    var pos = ts.findChildOfKind(node, node.kind === 208 /* FunctionExpression */ ? 97 /* FunctionKeyword */ : 83 /* ClassKeyword */, sourceFile).end;\n                    this.insertNodeAt(sourceFile, pos, ts.factory.createIdentifier(name), { prefix: \" \" });\n                }\n            };\n            ChangeTracker.prototype.insertExportModifier = function (sourceFile, node) {\n                this.insertText(sourceFile, node.getStart(sourceFile), \"export \");\n            };\n            /**\n             * This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range,\n             * i.e. arguments in arguments lists, parameters in parameter lists etc.\n             * Note that separators are part of the node in statements and class elements.\n             */\n            ChangeTracker.prototype.insertNodeInListAfter = function (sourceFile, after, newNode, containingList) {\n                if (containingList === void 0) { containingList = ts.formatting.SmartIndenter.getContainingList(after, sourceFile); }\n                if (!containingList) {\n                    ts.Debug.fail(\"node is not a list element\");\n                    return;\n                }\n                var index = ts.indexOfNode(containingList, after);\n                if (index < 0) {\n                    return;\n                }\n                var end = after.getEnd();\n                if (index !== containingList.length - 1) {\n                    // any element except the last one\n                    // use next sibling as an anchor\n                    var nextToken = ts.getTokenAtPosition(sourceFile, after.end);\n                    if (nextToken && isSeparator(after, nextToken)) {\n                        // for list\n                        // a, b, c\n                        // create change for adding 'e' after 'a' as\n                        // - find start of next element after a (it is b)\n                        // - use this start as start and end position in final change\n                        // - build text of change by formatting the text of node + separator + whitespace trivia of b\n                        // in multiline case it will work as\n                        //   a,\n                        //   b,\n                        //   c,\n                        // result - '*' denotes leading trivia that will be inserted after new text (displayed as '#')\n                        //   a,*\n                        // ***insertedtext<separator>#\n                        // ###b,\n                        //   c,\n                        // find line and character of the next element\n                        var lineAndCharOfNextElement = ts.getLineAndCharacterOfPosition(sourceFile, skipWhitespacesAndLineBreaks(sourceFile.text, containingList[index + 1].getFullStart()));\n                        // find line and character of the token that precedes next element (usually it is separator)\n                        var lineAndCharOfNextToken = ts.getLineAndCharacterOfPosition(sourceFile, nextToken.end);\n                        var prefix = void 0;\n                        var startPos = void 0;\n                        if (lineAndCharOfNextToken.line === lineAndCharOfNextElement.line) {\n                            // next element is located on the same line with separator:\n                            // a,$$$$b\n                            //  ^    ^\n                            //  |    |-next element\n                            //  |-separator\n                            // where $$$ is some leading trivia\n                            // for a newly inserted node we'll maintain the same relative position comparing to separator and replace leading trivia with spaces\n                            // a,    x,$$$$b\n                            //  ^    ^     ^\n                            //  |    |     |-next element\n                            //  |    |-new inserted node padded with spaces\n                            //  |-separator\n                            startPos = nextToken.end;\n                            prefix = spaces(lineAndCharOfNextElement.character - lineAndCharOfNextToken.character);\n                        }\n                        else {\n                            // next element is located on different line that separator\n                            // let insert position be the beginning of the line that contains next element\n                            startPos = ts.getStartPositionOfLine(lineAndCharOfNextElement.line, sourceFile);\n                        }\n                        // write separator and leading trivia of the next element as suffix\n                        var suffix = \"\" + ts.tokenToString(nextToken.kind) + sourceFile.text.substring(nextToken.end, containingList[index + 1].getStart(sourceFile));\n                        this.replaceRange(sourceFile, ts.createRange(startPos, containingList[index + 1].getStart(sourceFile)), newNode, { prefix: prefix, suffix: suffix });\n                    }\n                }\n                else {\n                    var afterStart = after.getStart(sourceFile);\n                    var afterStartLinePosition = ts.getLineStartPositionForPosition(afterStart, sourceFile);\n                    var separator = void 0;\n                    var multilineList = false;\n                    // insert element after the last element in the list that has more than one item\n                    // pick the element preceding the after element to:\n                    // - pick the separator\n                    // - determine if list is a multiline\n                    if (containingList.length === 1) {\n                        // if list has only one element then we'll format is as multiline if node has comment in trailing trivia, or as singleline otherwise\n                        // i.e. var x = 1 // this is x\n                        //     | new element will be inserted at this position\n                        separator = 27 /* CommaToken */;\n                    }\n                    else {\n                        // element has more than one element, pick separator from the list\n                        var tokenBeforeInsertPosition = ts.findPrecedingToken(after.pos, sourceFile);\n                        separator = isSeparator(after, tokenBeforeInsertPosition) ? tokenBeforeInsertPosition.kind : 27 /* CommaToken */;\n                        // determine if list is multiline by checking lines of after element and element that precedes it.\n                        var afterMinusOneStartLinePosition = ts.getLineStartPositionForPosition(containingList[index - 1].getStart(sourceFile), sourceFile);\n                        multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition;\n                    }\n                    if (hasCommentsBeforeLineBreak(sourceFile.text, after.end)) {\n                        // in this case we'll always treat containing list as multiline\n                        multilineList = true;\n                    }\n                    if (multilineList) {\n                        // insert separator immediately following the 'after' node to preserve comments in trailing trivia\n                        this.replaceRange(sourceFile, ts.createRange(end), ts.factory.createToken(separator));\n                        // use the same indentation as 'after' item\n                        var indentation = ts.formatting.SmartIndenter.findFirstNonWhitespaceColumn(afterStartLinePosition, afterStart, sourceFile, this.formatContext.options);\n                        // insert element before the line break on the line that contains 'after' element\n                        var insertPos = ts.skipTrivia(sourceFile.text, end, /*stopAfterLineBreak*/ true, /*stopAtComments*/ false);\n                        // find position before \"\\n\" or \"\\r\\n\"\n                        while (insertPos !== end && ts.isLineBreak(sourceFile.text.charCodeAt(insertPos - 1))) {\n                            insertPos--;\n                        }\n                        this.replaceRange(sourceFile, ts.createRange(insertPos), newNode, { indentation: indentation, prefix: this.newLineCharacter });\n                    }\n                    else {\n                        this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix: ts.tokenToString(separator) + \" \" });\n                    }\n                }\n            };\n            ChangeTracker.prototype.parenthesizeExpression = function (sourceFile, expression) {\n                this.replaceRange(sourceFile, ts.rangeOfNode(expression), ts.factory.createParenthesizedExpression(expression));\n            };\n            ChangeTracker.prototype.finishClassesWithNodesInsertedAtStart = function () {\n                var _this = this;\n                this.classesWithNodesInsertedAtStart.forEach(function (_a) {\n                    var node = _a.node, sourceFile = _a.sourceFile;\n                    var _b = getClassOrObjectBraceEnds(node, sourceFile), openBraceEnd = _b[0], closeBraceEnd = _b[1];\n                    if (openBraceEnd !== undefined && closeBraceEnd !== undefined) {\n                        var isEmpty = getMembersOrProperties(node).length === 0;\n                        var isSingleLine = ts.positionsAreOnSameLine(openBraceEnd, closeBraceEnd, sourceFile);\n                        if (isEmpty && isSingleLine && openBraceEnd !== closeBraceEnd - 1) {\n                            // For `class C { }` remove the whitespace inside the braces.\n                            _this.deleteRange(sourceFile, ts.createRange(openBraceEnd, closeBraceEnd - 1));\n                        }\n                        if (isSingleLine) {\n                            _this.insertText(sourceFile, closeBraceEnd - 1, _this.newLineCharacter);\n                        }\n                    }\n                });\n            };\n            ChangeTracker.prototype.finishDeleteDeclarations = function () {\n                var _this = this;\n                var deletedNodesInLists = new ts.Set(); // Stores nodes in lists that we already deleted. Used to avoid deleting `, ` twice in `a, b`.\n                var _loop_9 = function (sourceFile, node) {\n                    if (!this_1.deletedNodes.some(function (d) { return d.sourceFile === sourceFile && ts.rangeContainsRangeExclusive(d.node, node); })) {\n                        if (ts.isArray(node)) {\n                            this_1.deleteRange(sourceFile, ts.rangeOfTypeParameters(sourceFile, node));\n                        }\n                        else {\n                            deleteDeclaration.deleteDeclaration(this_1, deletedNodesInLists, sourceFile, node);\n                        }\n                    }\n                };\n                var this_1 = this;\n                for (var _i = 0, _a = this.deletedNodes; _i < _a.length; _i++) {\n                    var _b = _a[_i], sourceFile = _b.sourceFile, node = _b.node;\n                    _loop_9(sourceFile, node);\n                }\n                deletedNodesInLists.forEach(function (node) {\n                    var sourceFile = node.getSourceFile();\n                    var list = ts.formatting.SmartIndenter.getContainingList(node, sourceFile);\n                    if (node !== ts.last(list))\n                        return;\n                    var lastNonDeletedIndex = ts.findLastIndex(list, function (n) { return !deletedNodesInLists.has(n); }, list.length - 2);\n                    if (lastNonDeletedIndex !== -1) {\n                        _this.deleteRange(sourceFile, { pos: list[lastNonDeletedIndex].end, end: startPositionToDeleteNodeInList(sourceFile, list[lastNonDeletedIndex + 1]) });\n                    }\n                });\n            };\n            /**\n             * Note: after calling this, the TextChanges object must be discarded!\n             * @param validate only for tests\n             *    The reason we must validate as part of this method is that `getNonFormattedText` changes the node's positions,\n             *    so we can only call this once and can't get the non-formatted text separately.\n             */\n            ChangeTracker.prototype.getChanges = function (validate) {\n                this.finishDeleteDeclarations();\n                this.finishClassesWithNodesInsertedAtStart();\n                var changes = changesToText.getTextChangesFromChanges(this.changes, this.newLineCharacter, this.formatContext, validate);\n                for (var _i = 0, _a = this.newFiles; _i < _a.length; _i++) {\n                    var _b = _a[_i], oldFile = _b.oldFile, fileName = _b.fileName, statements = _b.statements;\n                    changes.push(changesToText.newFileChanges(oldFile, fileName, statements, this.newLineCharacter, this.formatContext));\n                }\n                return changes;\n            };\n            ChangeTracker.prototype.createNewFile = function (oldFile, fileName, statements) {\n                this.newFiles.push({ oldFile: oldFile, fileName: fileName, statements: statements });\n            };\n            return ChangeTracker;\n        }());\n        textChanges_3.ChangeTracker = ChangeTracker;\n        // find first non-whitespace position in the leading trivia of the node\n        function startPositionToDeleteNodeInList(sourceFile, node) {\n            return ts.skipTrivia(sourceFile.text, getAdjustedStartPosition(sourceFile, node, { leadingTriviaOption: LeadingTriviaOption.IncludeAll }), /*stopAfterLineBreak*/ false, /*stopAtComments*/ true);\n        }\n        function getClassOrObjectBraceEnds(cls, sourceFile) {\n            var open = ts.findChildOfKind(cls, 18 /* OpenBraceToken */, sourceFile);\n            var close = ts.findChildOfKind(cls, 19 /* CloseBraceToken */, sourceFile);\n            return [open === null || open === void 0 ? void 0 : open.end, close === null || close === void 0 ? void 0 : close.end];\n        }\n        function getMembersOrProperties(cls) {\n            return ts.isObjectLiteralExpression(cls) ? cls.properties : cls.members;\n        }\n        function getNewFileText(statements, scriptKind, newLineCharacter, formatContext) {\n            return changesToText.newFileChangesWorker(/*oldFile*/ undefined, scriptKind, statements, newLineCharacter, formatContext);\n        }\n        textChanges_3.getNewFileText = getNewFileText;\n        var changesToText;\n        (function (changesToText) {\n            function getTextChangesFromChanges(changes, newLineCharacter, formatContext, validate) {\n                return ts.mapDefined(ts.group(changes, function (c) { return c.sourceFile.path; }), function (changesInFile) {\n                    var sourceFile = changesInFile[0].sourceFile;\n                    // order changes by start position\n                    // If the start position is the same, put the shorter range first, since an empty range (x, x) may precede (x, y) but not vice-versa.\n                    var normalized = ts.stableSort(changesInFile, function (a, b) { return (a.range.pos - b.range.pos) || (a.range.end - b.range.end); });\n                    var _loop_10 = function (i) {\n                        ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, \"Changes overlap\", function () {\n                            return JSON.stringify(normalized[i].range) + \" and \" + JSON.stringify(normalized[i + 1].range);\n                        });\n                    };\n                    // verify that change intervals do not overlap, except possibly at end points.\n                    for (var i = 0; i < normalized.length - 1; i++) {\n                        _loop_10(i);\n                    }\n                    var textChanges = ts.mapDefined(normalized, function (c) {\n                        var span = ts.createTextSpanFromRange(c.range);\n                        var newText = computeNewText(c, sourceFile, newLineCharacter, formatContext, validate);\n                        // Filter out redundant changes.\n                        if (span.length === newText.length && ts.stringContainsAt(sourceFile.text, newText, span.start)) {\n                            return undefined;\n                        }\n                        return ts.createTextChange(span, newText);\n                    });\n                    return textChanges.length > 0 ? { fileName: sourceFile.fileName, textChanges: textChanges } : undefined;\n                });\n            }\n            changesToText.getTextChangesFromChanges = getTextChangesFromChanges;\n            function newFileChanges(oldFile, fileName, statements, newLineCharacter, formatContext) {\n                var text = newFileChangesWorker(oldFile, ts.getScriptKindFromFileName(fileName), statements, newLineCharacter, formatContext);\n                return { fileName: fileName, textChanges: [ts.createTextChange(ts.createTextSpan(0, 0), text)], isNewFile: true };\n            }\n            changesToText.newFileChanges = newFileChanges;\n            function newFileChangesWorker(oldFile, scriptKind, statements, newLineCharacter, formatContext) {\n                // TODO: this emits the file, parses it back, then formats it that -- may be a less roundabout way to do this\n                var nonFormattedText = statements.map(function (s) { return s === 4 /* NewLineTrivia */ ? \"\" : getNonformattedText(s, oldFile, newLineCharacter).text; }).join(newLineCharacter);\n                var sourceFile = ts.createSourceFile(\"any file name\", nonFormattedText, 99 /* ESNext */, /*setParentNodes*/ true, scriptKind);\n                var changes = ts.formatting.formatDocument(sourceFile, formatContext);\n                return applyChanges(nonFormattedText, changes) + newLineCharacter;\n            }\n            changesToText.newFileChangesWorker = newFileChangesWorker;\n            function computeNewText(change, sourceFile, newLineCharacter, formatContext, validate) {\n                if (change.kind === ChangeKind.Remove) {\n                    return \"\";\n                }\n                if (change.kind === ChangeKind.Text) {\n                    return change.text;\n                }\n                var _a = change.options, options = _a === void 0 ? {} : _a, pos = change.range.pos;\n                var format = function (n) { return getFormattedTextOfNode(n, sourceFile, pos, options, newLineCharacter, formatContext, validate); };\n                var text = change.kind === ChangeKind.ReplaceWithMultipleNodes\n                    ? change.nodes.map(function (n) { return ts.removeSuffix(format(n), newLineCharacter); }).join(change.options.joiner || newLineCharacter) // TODO: GH#18217\n                    : format(change.node);\n                // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line\n                var noIndent = (options.preserveLeadingWhitespace || options.indentation !== undefined || ts.getLineStartPositionForPosition(pos, sourceFile) === pos) ? text : text.replace(/^\\s+/, \"\");\n                return (options.prefix || \"\") + noIndent\n                    + ((!options.suffix || ts.endsWith(noIndent, options.suffix))\n                        ? \"\" : options.suffix);\n            }\n            function getFormatCodeSettingsForWriting(_a, sourceFile) {\n                var options = _a.options;\n                var shouldAutoDetectSemicolonPreference = !options.semicolons || options.semicolons === ts.SemicolonPreference.Ignore;\n                var shouldRemoveSemicolons = options.semicolons === ts.SemicolonPreference.Remove || shouldAutoDetectSemicolonPreference && !ts.probablyUsesSemicolons(sourceFile);\n                return __assign(__assign({}, options), { semicolons: shouldRemoveSemicolons ? ts.SemicolonPreference.Remove : ts.SemicolonPreference.Ignore });\n            }\n            /** Note: this may mutate `nodeIn`. */\n            function getFormattedTextOfNode(nodeIn, sourceFile, pos, _a, newLineCharacter, formatContext, validate) {\n                var indentation = _a.indentation, prefix = _a.prefix, delta = _a.delta;\n                var _b = getNonformattedText(nodeIn, sourceFile, newLineCharacter), node = _b.node, text = _b.text;\n                if (validate)\n                    validate(node, text);\n                var formatOptions = getFormatCodeSettingsForWriting(formatContext, sourceFile);\n                var initialIndentation = indentation !== undefined\n                    ? indentation\n                    : ts.formatting.SmartIndenter.getIndentation(pos, sourceFile, formatOptions, prefix === newLineCharacter || ts.getLineStartPositionForPosition(pos, sourceFile) === pos);\n                if (delta === undefined) {\n                    delta = ts.formatting.SmartIndenter.shouldIndentChildNode(formatOptions, nodeIn) ? (formatOptions.indentSize || 0) : 0;\n                }\n                var file = { text: text, getLineAndCharacterOfPosition: function (pos) { return ts.getLineAndCharacterOfPosition(this, pos); } };\n                var changes = ts.formatting.formatNodeGivenIndentation(node, file, sourceFile.languageVariant, initialIndentation, delta, __assign(__assign({}, formatContext), { options: formatOptions }));\n                return applyChanges(text, changes);\n            }\n            /** Note: output node may be mutated input node. */\n            function getNonformattedText(node, sourceFile, newLineCharacter) {\n                var writer = createWriter(newLineCharacter);\n                var newLine = newLineCharacter === \"\\n\" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */;\n                ts.createPrinter({\n                    newLine: newLine,\n                    neverAsciiEscape: true,\n                    preserveSourceNewlines: true,\n                    terminateUnterminatedLiterals: true\n                }, writer).writeNode(4 /* Unspecified */, node, sourceFile, writer);\n                return { text: writer.getText(), node: assignPositionsToNode(node) };\n            }\n            changesToText.getNonformattedText = getNonformattedText;\n        })(changesToText || (changesToText = {}));\n        function applyChanges(text, changes) {\n            for (var i = changes.length - 1; i >= 0; i--) {\n                var _a = changes[i], span = _a.span, newText = _a.newText;\n                text = \"\" + text.substring(0, span.start) + newText + text.substring(ts.textSpanEnd(span));\n            }\n            return text;\n        }\n        textChanges_3.applyChanges = applyChanges;\n        function isTrivia(s) {\n            return ts.skipTrivia(s, 0) === s.length;\n        }\n        function assignPositionsToNode(node) {\n            var visited = ts.visitEachChild(node, assignPositionsToNode, ts.nullTransformationContext, assignPositionsToNodeArray, assignPositionsToNode); // TODO: GH#18217\n            // create proxy node for non synthesized nodes\n            var newNode = ts.nodeIsSynthesized(visited) ? visited : Object.create(visited);\n            ts.setTextRangePosEnd(newNode, getPos(node), getEnd(node));\n            return newNode;\n        }\n        function assignPositionsToNodeArray(nodes, visitor, test, start, count) {\n            var visited = ts.visitNodes(nodes, visitor, test, start, count);\n            if (!visited) {\n                return visited;\n            }\n            // clone nodearray if necessary\n            var nodeArray = visited === nodes ? ts.factory.createNodeArray(visited.slice(0)) : visited;\n            ts.setTextRangePosEnd(nodeArray, getPos(nodes), getEnd(nodes));\n            return nodeArray;\n        }\n        function createWriter(newLine) {\n            var lastNonTriviaPosition = 0;\n            var writer = ts.createTextWriter(newLine);\n            var onEmitNode = function (hint, node, printCallback) {\n                if (node) {\n                    setPos(node, lastNonTriviaPosition);\n                }\n                printCallback(hint, node);\n                if (node) {\n                    setEnd(node, lastNonTriviaPosition);\n                }\n            };\n            var onBeforeEmitNodeArray = function (nodes) {\n                if (nodes) {\n                    setPos(nodes, lastNonTriviaPosition);\n                }\n            };\n            var onAfterEmitNodeArray = function (nodes) {\n                if (nodes) {\n                    setEnd(nodes, lastNonTriviaPosition);\n                }\n            };\n            var onBeforeEmitToken = function (node) {\n                if (node) {\n                    setPos(node, lastNonTriviaPosition);\n                }\n            };\n            var onAfterEmitToken = function (node) {\n                if (node) {\n                    setEnd(node, lastNonTriviaPosition);\n                }\n            };\n            function setLastNonTriviaPosition(s, force) {\n                if (force || !isTrivia(s)) {\n                    lastNonTriviaPosition = writer.getTextPos();\n                    var i = 0;\n                    while (ts.isWhiteSpaceLike(s.charCodeAt(s.length - i - 1))) {\n                        i++;\n                    }\n                    // trim trailing whitespaces\n                    lastNonTriviaPosition -= i;\n                }\n            }\n            function write(s) {\n                writer.write(s);\n                setLastNonTriviaPosition(s, /*force*/ false);\n            }\n            function writeComment(s) {\n                writer.writeComment(s);\n            }\n            function writeKeyword(s) {\n                writer.writeKeyword(s);\n                setLastNonTriviaPosition(s, /*force*/ false);\n            }\n            function writeOperator(s) {\n                writer.writeOperator(s);\n                setLastNonTriviaPosition(s, /*force*/ false);\n            }\n            function writePunctuation(s) {\n                writer.writePunctuation(s);\n                setLastNonTriviaPosition(s, /*force*/ false);\n            }\n            function writeTrailingSemicolon(s) {\n                writer.writeTrailingSemicolon(s);\n                setLastNonTriviaPosition(s, /*force*/ false);\n            }\n            function writeParameter(s) {\n                writer.writeParameter(s);\n                setLastNonTriviaPosition(s, /*force*/ false);\n            }\n            function writeProperty(s) {\n                writer.writeProperty(s);\n                setLastNonTriviaPosition(s, /*force*/ false);\n            }\n            function writeSpace(s) {\n                writer.writeSpace(s);\n                setLastNonTriviaPosition(s, /*force*/ false);\n            }\n            function writeStringLiteral(s) {\n                writer.writeStringLiteral(s);\n                setLastNonTriviaPosition(s, /*force*/ false);\n            }\n            function writeSymbol(s, sym) {\n                writer.writeSymbol(s, sym);\n                setLastNonTriviaPosition(s, /*force*/ false);\n            }\n            function writeLine(force) {\n                writer.writeLine(force);\n            }\n            function increaseIndent() {\n                writer.increaseIndent();\n            }\n            function decreaseIndent() {\n                writer.decreaseIndent();\n            }\n            function getText() {\n                return writer.getText();\n            }\n            function rawWrite(s) {\n                writer.rawWrite(s);\n                setLastNonTriviaPosition(s, /*force*/ false);\n            }\n            function writeLiteral(s) {\n                writer.writeLiteral(s);\n                setLastNonTriviaPosition(s, /*force*/ true);\n            }\n            function getTextPos() {\n                return writer.getTextPos();\n            }\n            function getLine() {\n                return writer.getLine();\n            }\n            function getColumn() {\n                return writer.getColumn();\n            }\n            function getIndent() {\n                return writer.getIndent();\n            }\n            function isAtStartOfLine() {\n                return writer.isAtStartOfLine();\n            }\n            function clear() {\n                writer.clear();\n                lastNonTriviaPosition = 0;\n            }\n            return {\n                onEmitNode: onEmitNode,\n                onBeforeEmitNodeArray: onBeforeEmitNodeArray,\n                onAfterEmitNodeArray: onAfterEmitNodeArray,\n                onBeforeEmitToken: onBeforeEmitToken,\n                onAfterEmitToken: onAfterEmitToken,\n                write: write,\n                writeComment: writeComment,\n                writeKeyword: writeKeyword,\n                writeOperator: writeOperator,\n                writePunctuation: writePunctuation,\n                writeTrailingSemicolon: writeTrailingSemicolon,\n                writeParameter: writeParameter,\n                writeProperty: writeProperty,\n                writeSpace: writeSpace,\n                writeStringLiteral: writeStringLiteral,\n                writeSymbol: writeSymbol,\n                writeLine: writeLine,\n                increaseIndent: increaseIndent,\n                decreaseIndent: decreaseIndent,\n                getText: getText,\n                rawWrite: rawWrite,\n                writeLiteral: writeLiteral,\n                getTextPos: getTextPos,\n                getLine: getLine,\n                getColumn: getColumn,\n                getIndent: getIndent,\n                isAtStartOfLine: isAtStartOfLine,\n                hasTrailingComment: function () { return writer.hasTrailingComment(); },\n                hasTrailingWhitespace: function () { return writer.hasTrailingWhitespace(); },\n                clear: clear\n            };\n        }\n        function getInsertionPositionAtSourceFileTop(sourceFile) {\n            var lastPrologue;\n            for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {\n                var node = _a[_i];\n                if (ts.isPrologueDirective(node)) {\n                    lastPrologue = node;\n                }\n                else {\n                    break;\n                }\n            }\n            var position = 0;\n            var text = sourceFile.text;\n            if (lastPrologue) {\n                position = lastPrologue.end;\n                advancePastLineBreak();\n                return position;\n            }\n            var shebang = ts.getShebang(text);\n            if (shebang !== undefined) {\n                position = shebang.length;\n                advancePastLineBreak();\n            }\n            var ranges = ts.getLeadingCommentRanges(text, position);\n            if (!ranges)\n                return position;\n            // Find the first attached comment to the first node and add before it\n            var lastComment;\n            var firstNodeLine;\n            for (var _b = 0, ranges_1 = ranges; _b < ranges_1.length; _b++) {\n                var range = ranges_1[_b];\n                if (range.kind === 3 /* MultiLineCommentTrivia */) {\n                    if (ts.isPinnedComment(text, range.pos)) {\n                        lastComment = { range: range, pinnedOrTripleSlash: true };\n                        continue;\n                    }\n                }\n                else if (ts.isRecognizedTripleSlashComment(text, range.pos, range.end)) {\n                    lastComment = { range: range, pinnedOrTripleSlash: true };\n                    continue;\n                }\n                if (lastComment) {\n                    // Always insert after pinned or triple slash comments\n                    if (lastComment.pinnedOrTripleSlash)\n                        break;\n                    // There was a blank line between the last comment and this comment.\n                    // This comment is not part of the copyright comments\n                    var commentLine = sourceFile.getLineAndCharacterOfPosition(range.pos).line;\n                    var lastCommentEndLine = sourceFile.getLineAndCharacterOfPosition(lastComment.range.end).line;\n                    if (commentLine >= lastCommentEndLine + 2)\n                        break;\n                }\n                if (sourceFile.statements.length) {\n                    if (firstNodeLine === undefined)\n                        firstNodeLine = sourceFile.getLineAndCharacterOfPosition(sourceFile.statements[0].getStart()).line;\n                    var commentEndLine = sourceFile.getLineAndCharacterOfPosition(range.end).line;\n                    if (firstNodeLine < commentEndLine + 2)\n                        break;\n                }\n                lastComment = { range: range, pinnedOrTripleSlash: false };\n            }\n            if (lastComment) {\n                position = lastComment.range.end;\n                advancePastLineBreak();\n            }\n            return position;\n            function advancePastLineBreak() {\n                if (position < text.length) {\n                    var charCode = text.charCodeAt(position);\n                    if (ts.isLineBreak(charCode)) {\n                        position++;\n                        if (position < text.length && charCode === 13 /* carriageReturn */ && text.charCodeAt(position) === 10 /* lineFeed */) {\n                            position++;\n                        }\n                    }\n                }\n            }\n        }\n        function isValidLocationToAddComment(sourceFile, position) {\n            return !ts.isInComment(sourceFile, position) && !ts.isInString(sourceFile, position) && !ts.isInTemplateString(sourceFile, position) && !ts.isInJSXText(sourceFile, position);\n        }\n        textChanges_3.isValidLocationToAddComment = isValidLocationToAddComment;\n        function needSemicolonBetween(a, b) {\n            return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 158 /* ComputedPropertyName */\n                || ts.isStatementButNotDeclaration(a) && ts.isStatementButNotDeclaration(b); // TODO: only if b would start with a `(` or `[`\n        }\n        var deleteDeclaration;\n        (function (deleteDeclaration_1) {\n            function deleteDeclaration(changes, deletedNodesInLists, sourceFile, node) {\n                switch (node.kind) {\n                    case 160 /* Parameter */: {\n                        var oldFunction = node.parent;\n                        if (ts.isArrowFunction(oldFunction) &&\n                            oldFunction.parameters.length === 1 &&\n                            !ts.findChildOfKind(oldFunction, 20 /* OpenParenToken */, sourceFile)) {\n                            // Lambdas with exactly one parameter are special because, after removal, there\n                            // must be an empty parameter list (i.e. `()`) and this won't necessarily be the\n                            // case if the parameter is simply removed (e.g. in `x => 1`).\n                            changes.replaceNodeWithText(sourceFile, node, \"()\");\n                        }\n                        else {\n                            deleteNodeInList(changes, deletedNodesInLists, sourceFile, node);\n                        }\n                        break;\n                    }\n                    case 261 /* ImportDeclaration */:\n                    case 260 /* ImportEqualsDeclaration */:\n                        var isFirstImport = sourceFile.imports.length && node === ts.first(sourceFile.imports).parent || node === ts.find(sourceFile.statements, ts.isAnyImportSyntax);\n                        // For first import, leave header comment in place, otherwise only delete JSDoc comments\n                        deleteNode(changes, sourceFile, node, { leadingTriviaOption: isFirstImport ? LeadingTriviaOption.Exclude : ts.hasJSDocNodes(node) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine });\n                        break;\n                    case 198 /* BindingElement */:\n                        var pattern = node.parent;\n                        var preserveComma = pattern.kind === 197 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements);\n                        if (preserveComma) {\n                            deleteNode(changes, sourceFile, node);\n                        }\n                        else {\n                            deleteNodeInList(changes, deletedNodesInLists, sourceFile, node);\n                        }\n                        break;\n                    case 249 /* VariableDeclaration */:\n                        deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node);\n                        break;\n                    case 159 /* TypeParameter */:\n                        deleteNodeInList(changes, deletedNodesInLists, sourceFile, node);\n                        break;\n                    case 265 /* ImportSpecifier */:\n                        var namedImports = node.parent;\n                        if (namedImports.elements.length === 1) {\n                            deleteImportBinding(changes, sourceFile, namedImports);\n                        }\n                        else {\n                            deleteNodeInList(changes, deletedNodesInLists, sourceFile, node);\n                        }\n                        break;\n                    case 263 /* NamespaceImport */:\n                        deleteImportBinding(changes, sourceFile, node);\n                        break;\n                    case 26 /* SemicolonToken */:\n                        deleteNode(changes, sourceFile, node, { trailingTriviaOption: TrailingTriviaOption.Exclude });\n                        break;\n                    case 97 /* FunctionKeyword */:\n                        deleteNode(changes, sourceFile, node, { leadingTriviaOption: LeadingTriviaOption.Exclude });\n                        break;\n                    case 252 /* ClassDeclaration */:\n                    case 251 /* FunctionDeclaration */:\n                        deleteNode(changes, sourceFile, node, { leadingTriviaOption: ts.hasJSDocNodes(node) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine });\n                        break;\n                    default:\n                        if (ts.isImportClause(node.parent) && node.parent.name === node) {\n                            deleteDefaultImport(changes, sourceFile, node.parent);\n                        }\n                        else if (ts.isCallExpression(node.parent) && ts.contains(node.parent.arguments, node)) {\n                            deleteNodeInList(changes, deletedNodesInLists, sourceFile, node);\n                        }\n                        else {\n                            deleteNode(changes, sourceFile, node);\n                        }\n                }\n            }\n            deleteDeclaration_1.deleteDeclaration = deleteDeclaration;\n            function deleteDefaultImport(changes, sourceFile, importClause) {\n                if (!importClause.namedBindings) {\n                    // Delete the whole import\n                    deleteNode(changes, sourceFile, importClause.parent);\n                }\n                else {\n                    // import |d,| * as ns from './file'\n                    var start = importClause.name.getStart(sourceFile);\n                    var nextToken = ts.getTokenAtPosition(sourceFile, importClause.name.end);\n                    if (nextToken && nextToken.kind === 27 /* CommaToken */) {\n                        // shift first non-whitespace position after comma to the start position of the node\n                        var end = ts.skipTrivia(sourceFile.text, nextToken.end, /*stopAfterLineBreaks*/ false, /*stopAtComments*/ true);\n                        changes.deleteRange(sourceFile, { pos: start, end: end });\n                    }\n                    else {\n                        deleteNode(changes, sourceFile, importClause.name);\n                    }\n                }\n            }\n            function deleteImportBinding(changes, sourceFile, node) {\n                if (node.parent.name) {\n                    // Delete named imports while preserving the default import\n                    // import d|, * as ns| from './file'\n                    // import d|, { a }| from './file'\n                    var previousToken = ts.Debug.checkDefined(ts.getTokenAtPosition(sourceFile, node.pos - 1));\n                    changes.deleteRange(sourceFile, { pos: previousToken.getStart(sourceFile), end: node.end });\n                }\n                else {\n                    // Delete the entire import declaration\n                    // |import * as ns from './file'|\n                    // |import { a } from './file'|\n                    var importDecl = ts.getAncestor(node, 261 /* ImportDeclaration */);\n                    deleteNode(changes, sourceFile, importDecl);\n                }\n            }\n            function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) {\n                var parent = node.parent;\n                if (parent.kind === 287 /* CatchClause */) {\n                    // TODO: There's currently no unused diagnostic for this, could be a suggestion\n                    changes.deleteNodeRange(sourceFile, ts.findChildOfKind(parent, 20 /* OpenParenToken */, sourceFile), ts.findChildOfKind(parent, 21 /* CloseParenToken */, sourceFile));\n                    return;\n                }\n                if (parent.declarations.length !== 1) {\n                    deleteNodeInList(changes, deletedNodesInLists, sourceFile, node);\n                    return;\n                }\n                var gp = parent.parent;\n                switch (gp.kind) {\n                    case 239 /* ForOfStatement */:\n                    case 238 /* ForInStatement */:\n                        changes.replaceNode(sourceFile, node, ts.factory.createObjectLiteralExpression());\n                        break;\n                    case 237 /* ForStatement */:\n                        deleteNode(changes, sourceFile, parent);\n                        break;\n                    case 232 /* VariableStatement */:\n                        deleteNode(changes, sourceFile, gp, { leadingTriviaOption: ts.hasJSDocNodes(gp) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine });\n                        break;\n                    default:\n                        ts.Debug.assertNever(gp);\n                }\n            }\n        })(deleteDeclaration || (deleteDeclaration = {}));\n        /** Warning: This deletes comments too. See `copyComments` in `convertFunctionToEs6Class`. */\n        // Exported for tests only! (TODO: improve tests to not need this)\n        function deleteNode(changes, sourceFile, node, options) {\n            if (options === void 0) { options = { leadingTriviaOption: LeadingTriviaOption.IncludeAll }; }\n            var startPosition = getAdjustedStartPosition(sourceFile, node, options);\n            var endPosition = getAdjustedEndPosition(sourceFile, node, options);\n            changes.deleteRange(sourceFile, { pos: startPosition, end: endPosition });\n        }\n        textChanges_3.deleteNode = deleteNode;\n        function deleteNodeInList(changes, deletedNodesInLists, sourceFile, node) {\n            var containingList = ts.Debug.checkDefined(ts.formatting.SmartIndenter.getContainingList(node, sourceFile));\n            var index = ts.indexOfNode(containingList, node);\n            ts.Debug.assert(index !== -1);\n            if (containingList.length === 1) {\n                deleteNode(changes, sourceFile, node);\n                return;\n            }\n            // Note: We will only delete a comma *after* a node. This will leave a trailing comma if we delete the last node.\n            // That's handled in the end by `finishTrailingCommaAfterDeletingNodesInList`.\n            ts.Debug.assert(!deletedNodesInLists.has(node), \"Deleting a node twice\");\n            deletedNodesInLists.add(node);\n            changes.deleteRange(sourceFile, {\n                pos: startPositionToDeleteNodeInList(sourceFile, node),\n                end: index === containingList.length - 1 ? getAdjustedEndPosition(sourceFile, node, {}) : startPositionToDeleteNodeInList(sourceFile, containingList[index + 1]),\n            });\n        }\n    })(textChanges = ts.textChanges || (ts.textChanges = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var errorCodeToFixes = ts.createMultiMap();\n        var fixIdToRegistration = new ts.Map();\n        function diagnosticToString(diag) {\n            return ts.isArray(diag)\n                ? ts.formatStringFromArgs(ts.getLocaleSpecificMessage(diag[0]), diag.slice(1))\n                : ts.getLocaleSpecificMessage(diag);\n        }\n        function createCodeFixActionWithoutFixAll(fixName, changes, description) {\n            return createCodeFixActionWorker(fixName, diagnosticToString(description), changes, /*fixId*/ undefined, /*fixAllDescription*/ undefined);\n        }\n        codefix.createCodeFixActionWithoutFixAll = createCodeFixActionWithoutFixAll;\n        function createCodeFixAction(fixName, changes, description, fixId, fixAllDescription, command) {\n            return createCodeFixActionWorker(fixName, diagnosticToString(description), changes, fixId, diagnosticToString(fixAllDescription), command);\n        }\n        codefix.createCodeFixAction = createCodeFixAction;\n        function createCodeFixActionWorker(fixName, description, changes, fixId, fixAllDescription, command) {\n            return { fixName: fixName, description: description, changes: changes, fixId: fixId, fixAllDescription: fixAllDescription, commands: command ? [command] : undefined };\n        }\n        function registerCodeFix(reg) {\n            for (var _i = 0, _a = reg.errorCodes; _i < _a.length; _i++) {\n                var error = _a[_i];\n                errorCodeToFixes.add(String(error), reg);\n            }\n            if (reg.fixIds) {\n                for (var _b = 0, _c = reg.fixIds; _b < _c.length; _b++) {\n                    var fixId = _c[_b];\n                    ts.Debug.assert(!fixIdToRegistration.has(fixId));\n                    fixIdToRegistration.set(fixId, reg);\n                }\n            }\n        }\n        codefix.registerCodeFix = registerCodeFix;\n        function getSupportedErrorCodes() {\n            return ts.arrayFrom(errorCodeToFixes.keys());\n        }\n        codefix.getSupportedErrorCodes = getSupportedErrorCodes;\n        function removeFixIdIfFixAllUnavailable(registration, diagnostics) {\n            var errorCodes = registration.errorCodes;\n            var maybeFixableDiagnostics = 0;\n            for (var _i = 0, diagnostics_1 = diagnostics; _i < diagnostics_1.length; _i++) {\n                var diag = diagnostics_1[_i];\n                if (ts.contains(errorCodes, diag.code))\n                    maybeFixableDiagnostics++;\n                if (maybeFixableDiagnostics > 1)\n                    break;\n            }\n            var fixAllUnavailable = maybeFixableDiagnostics < 2;\n            return function (_a) {\n                var fixId = _a.fixId, fixAllDescription = _a.fixAllDescription, action = __rest(_a, [\"fixId\", \"fixAllDescription\"]);\n                return fixAllUnavailable ? action : __assign(__assign({}, action), { fixId: fixId, fixAllDescription: fixAllDescription });\n            };\n        }\n        function getFixes(context) {\n            var diagnostics = getDiagnostics(context);\n            var registrations = errorCodeToFixes.get(String(context.errorCode));\n            return ts.flatMap(registrations, function (f) { return ts.map(f.getCodeActions(context), removeFixIdIfFixAllUnavailable(f, diagnostics)); });\n        }\n        codefix.getFixes = getFixes;\n        function getAllFixes(context) {\n            // Currently fixId is always a string.\n            return fixIdToRegistration.get(ts.cast(context.fixId, ts.isString)).getAllCodeActions(context);\n        }\n        codefix.getAllFixes = getAllFixes;\n        function createCombinedCodeActions(changes, commands) {\n            return { changes: changes, commands: commands };\n        }\n        codefix.createCombinedCodeActions = createCombinedCodeActions;\n        function createFileTextChanges(fileName, textChanges) {\n            return { fileName: fileName, textChanges: textChanges };\n        }\n        codefix.createFileTextChanges = createFileTextChanges;\n        function codeFixAll(context, errorCodes, use) {\n            var commands = [];\n            var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return eachDiagnostic(context, errorCodes, function (diag) { return use(t, diag, commands); }); });\n            return createCombinedCodeActions(changes, commands.length === 0 ? undefined : commands);\n        }\n        codefix.codeFixAll = codeFixAll;\n        function eachDiagnostic(context, errorCodes, cb) {\n            for (var _i = 0, _a = getDiagnostics(context); _i < _a.length; _i++) {\n                var diag = _a[_i];\n                if (ts.contains(errorCodes, diag.code)) {\n                    cb(diag);\n                }\n            }\n        }\n        codefix.eachDiagnostic = eachDiagnostic;\n        function getDiagnostics(_a) {\n            var program = _a.program, sourceFile = _a.sourceFile, cancellationToken = _a.cancellationToken;\n            return __spreadArray(__spreadArray(__spreadArray([], program.getSemanticDiagnostics(sourceFile, cancellationToken)), program.getSyntacticDiagnostics(sourceFile, cancellationToken)), ts.computeSuggestionDiagnostics(sourceFile, program, cancellationToken));\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var refactor;\n    (function (refactor_1) {\n        // A map with the refactor code as key, the refactor itself as value\n        // e.g.  nonSuggestableRefactors[refactorCode] -> the refactor you want\n        var refactors = new ts.Map();\n        /** @param name An unique code associated with each refactor. Does not have to be human-readable. */\n        function registerRefactor(name, refactor) {\n            refactors.set(name, refactor);\n        }\n        refactor_1.registerRefactor = registerRefactor;\n        function getApplicableRefactors(context) {\n            return ts.arrayFrom(ts.flatMapIterator(refactors.values(), function (refactor) {\n                var _a;\n                return context.cancellationToken && context.cancellationToken.isCancellationRequested() ||\n                    !((_a = refactor.kinds) === null || _a === void 0 ? void 0 : _a.some(function (kind) { return refactor_1.refactorKindBeginsWith(kind, context.kind); })) ? undefined :\n                    refactor.getAvailableActions(context);\n            }));\n        }\n        refactor_1.getApplicableRefactors = getApplicableRefactors;\n        function getEditsForRefactor(context, refactorName, actionName) {\n            var refactor = refactors.get(refactorName);\n            return refactor && refactor.getEditsForAction(context, actionName);\n        }\n        refactor_1.getEditsForRefactor = getEditsForRefactor;\n    })(refactor = ts.refactor || (ts.refactor = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"addConvertToUnknownForNonOverlappingTypes\";\n        var errorCodes = [ts.Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_unknown_conversion_for_non_overlapping_types, fixId, ts.Diagnostics.Add_unknown_to_all_conversions_of_non_overlapping_types)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag.start); }); },\n        });\n        function makeChange(changeTracker, sourceFile, pos) {\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            var assertion = ts.Debug.checkDefined(ts.findAncestor(token, function (n) { return ts.isAsExpression(n) || ts.isTypeAssertionExpression(n); }), \"Expected to find an assertion expression\");\n            var replacement = ts.isAsExpression(assertion)\n                ? ts.factory.createAsExpression(assertion.expression, ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */))\n                : ts.factory.createTypeAssertion(ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */), assertion.expression);\n            changeTracker.replaceNode(sourceFile, assertion.expression, replacement);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        codefix.registerCodeFix({\n            errorCodes: [\n                ts.Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,\n                ts.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,\n            ],\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (changes) {\n                    var exportDeclaration = ts.factory.createExportDeclaration(\n                    /*decorators*/ undefined, \n                    /*modifiers*/ undefined, \n                    /*isTypeOnly*/ false, ts.factory.createNamedExports([]), \n                    /*moduleSpecifier*/ undefined);\n                    changes.insertNodeAtEndOfScope(sourceFile, sourceFile, exportDeclaration);\n                });\n                return [codefix.createCodeFixActionWithoutFixAll(\"addEmptyExportDeclaration\", changes, ts.Diagnostics.Add_export_to_make_this_file_into_a_module)];\n            },\n        });\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"addMissingAsync\";\n        var errorCodes = [\n            ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,\n            ts.Diagnostics.Type_0_is_not_assignable_to_type_1.code,\n            ts.Diagnostics.Type_0_is_not_comparable_to_type_1.code\n        ];\n        codefix.registerCodeFix({\n            fixIds: [fixId],\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, errorCode = context.errorCode, cancellationToken = context.cancellationToken, program = context.program, span = context.span;\n                var diagnostic = ts.find(program.getDiagnosticsProducingTypeChecker().getDiagnostics(sourceFile, cancellationToken), getIsMatchingAsyncError(span, errorCode));\n                var directSpan = diagnostic && diagnostic.relatedInformation && ts.find(diagnostic.relatedInformation, function (r) { return r.code === ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code; });\n                var decl = getFixableErrorSpanDeclaration(sourceFile, directSpan);\n                if (!decl) {\n                    return;\n                }\n                var trackChanges = function (cb) { return ts.textChanges.ChangeTracker.with(context, cb); };\n                return [getFix(context, decl, trackChanges)];\n            },\n            getAllCodeActions: function (context) {\n                var sourceFile = context.sourceFile;\n                var fixedDeclarations = new ts.Set();\n                return codefix.codeFixAll(context, errorCodes, function (t, diagnostic) {\n                    var span = diagnostic.relatedInformation && ts.find(diagnostic.relatedInformation, function (r) { return r.code === ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code; });\n                    var decl = getFixableErrorSpanDeclaration(sourceFile, span);\n                    if (!decl) {\n                        return;\n                    }\n                    var trackChanges = function (cb) { return (cb(t), []); };\n                    return getFix(context, decl, trackChanges, fixedDeclarations);\n                });\n            },\n        });\n        function getFix(context, decl, trackChanges, fixedDeclarations) {\n            var changes = trackChanges(function (t) { return makeChange(t, context.sourceFile, decl, fixedDeclarations); });\n            return codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_async_modifier_to_containing_function, fixId, ts.Diagnostics.Add_all_missing_async_modifiers);\n        }\n        function makeChange(changeTracker, sourceFile, insertionSite, fixedDeclarations) {\n            if (fixedDeclarations) {\n                if (fixedDeclarations.has(ts.getNodeId(insertionSite))) {\n                    return;\n                }\n            }\n            fixedDeclarations === null || fixedDeclarations === void 0 ? void 0 : fixedDeclarations.add(ts.getNodeId(insertionSite));\n            var cloneWithModifier = ts.factory.updateModifiers(ts.getSynthesizedDeepClone(insertionSite, /*includeTrivia*/ true), ts.factory.createNodeArray(ts.factory.createModifiersFromModifierFlags(ts.getSyntacticModifierFlags(insertionSite) | 256 /* Async */)));\n            changeTracker.replaceNode(sourceFile, insertionSite, cloneWithModifier);\n        }\n        function getFixableErrorSpanDeclaration(sourceFile, span) {\n            if (!span)\n                return undefined;\n            var token = ts.getTokenAtPosition(sourceFile, span.start);\n            // Checker has already done work to determine that async might be possible, and has attached\n            // related info to the node, so start by finding the signature that exactly matches up\n            // with the diagnostic range.\n            var decl = ts.findAncestor(token, function (node) {\n                if (node.getStart(sourceFile) < span.start || node.getEnd() > ts.textSpanEnd(span)) {\n                    return \"quit\";\n                }\n                return (ts.isArrowFunction(node) || ts.isMethodDeclaration(node) || ts.isFunctionExpression(node) || ts.isFunctionDeclaration(node)) && ts.textSpansEqual(span, ts.createTextSpanFromNode(node, sourceFile));\n            });\n            return decl;\n        }\n        function getIsMatchingAsyncError(span, errorCode) {\n            return function (_a) {\n                var start = _a.start, length = _a.length, relatedInformation = _a.relatedInformation, code = _a.code;\n                return ts.isNumber(start) && ts.isNumber(length) && ts.textSpansEqual({ start: start, length: length }, span) &&\n                    code === errorCode &&\n                    !!relatedInformation &&\n                    ts.some(relatedInformation, function (related) { return related.code === ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code; });\n            };\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"addMissingAwait\";\n        var propertyAccessCode = ts.Diagnostics.Property_0_does_not_exist_on_type_1.code;\n        var callableConstructableErrorCodes = [\n            ts.Diagnostics.This_expression_is_not_callable.code,\n            ts.Diagnostics.This_expression_is_not_constructable.code,\n        ];\n        var errorCodes = __spreadArray([\n            ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code,\n            ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,\n            ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,\n            ts.Diagnostics.Operator_0_cannot_be_applied_to_type_1.code,\n            ts.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2.code,\n            ts.Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap.code,\n            ts.Diagnostics.Type_0_is_not_an_array_type.code,\n            ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type.code,\n            ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators.code,\n            ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,\n            ts.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,\n            ts.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code,\n            ts.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code,\n            ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,\n            propertyAccessCode\n        ], callableConstructableErrorCodes);\n        codefix.registerCodeFix({\n            fixIds: [fixId],\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, errorCode = context.errorCode, span = context.span, cancellationToken = context.cancellationToken, program = context.program;\n                var expression = getFixableErrorSpanExpression(sourceFile, errorCode, span, cancellationToken, program);\n                if (!expression) {\n                    return;\n                }\n                var checker = context.program.getTypeChecker();\n                var trackChanges = function (cb) { return ts.textChanges.ChangeTracker.with(context, cb); };\n                return ts.compact([\n                    getDeclarationSiteFix(context, expression, errorCode, checker, trackChanges),\n                    getUseSiteFix(context, expression, errorCode, checker, trackChanges)\n                ]);\n            },\n            getAllCodeActions: function (context) {\n                var sourceFile = context.sourceFile, program = context.program, cancellationToken = context.cancellationToken;\n                var checker = context.program.getTypeChecker();\n                var fixedDeclarations = new ts.Set();\n                return codefix.codeFixAll(context, errorCodes, function (t, diagnostic) {\n                    var expression = getFixableErrorSpanExpression(sourceFile, diagnostic.code, diagnostic, cancellationToken, program);\n                    if (!expression) {\n                        return;\n                    }\n                    var trackChanges = function (cb) { return (cb(t), []); };\n                    return getDeclarationSiteFix(context, expression, diagnostic.code, checker, trackChanges, fixedDeclarations)\n                        || getUseSiteFix(context, expression, diagnostic.code, checker, trackChanges, fixedDeclarations);\n                });\n            },\n        });\n        function getDeclarationSiteFix(context, expression, errorCode, checker, trackChanges, fixedDeclarations) {\n            var sourceFile = context.sourceFile, program = context.program, cancellationToken = context.cancellationToken;\n            var awaitableInitializers = findAwaitableInitializers(expression, sourceFile, cancellationToken, program, checker);\n            if (awaitableInitializers) {\n                var initializerChanges = trackChanges(function (t) {\n                    ts.forEach(awaitableInitializers.initializers, function (_a) {\n                        var expression = _a.expression;\n                        return makeChange(t, errorCode, sourceFile, checker, expression, fixedDeclarations);\n                    });\n                    if (fixedDeclarations && awaitableInitializers.needsSecondPassForFixAll) {\n                        makeChange(t, errorCode, sourceFile, checker, expression, fixedDeclarations);\n                    }\n                });\n                // No fix-all because it will already be included once with the use site fix,\n                // and for simplicity the fix-all doesn‘t let the user choose between use-site and declaration-site fixes.\n                return codefix.createCodeFixActionWithoutFixAll(\"addMissingAwaitToInitializer\", initializerChanges, awaitableInitializers.initializers.length === 1\n                    ? [ts.Diagnostics.Add_await_to_initializer_for_0, awaitableInitializers.initializers[0].declarationSymbol.name]\n                    : ts.Diagnostics.Add_await_to_initializers);\n            }\n        }\n        function getUseSiteFix(context, expression, errorCode, checker, trackChanges, fixedDeclarations) {\n            var changes = trackChanges(function (t) { return makeChange(t, errorCode, context.sourceFile, checker, expression, fixedDeclarations); });\n            return codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_await, fixId, ts.Diagnostics.Fix_all_expressions_possibly_missing_await);\n        }\n        function isMissingAwaitError(sourceFile, errorCode, span, cancellationToken, program) {\n            var checker = program.getDiagnosticsProducingTypeChecker();\n            var diagnostics = checker.getDiagnostics(sourceFile, cancellationToken);\n            return ts.some(diagnostics, function (_a) {\n                var start = _a.start, length = _a.length, relatedInformation = _a.relatedInformation, code = _a.code;\n                return ts.isNumber(start) && ts.isNumber(length) && ts.textSpansEqual({ start: start, length: length }, span) &&\n                    code === errorCode &&\n                    !!relatedInformation &&\n                    ts.some(relatedInformation, function (related) { return related.code === ts.Diagnostics.Did_you_forget_to_use_await.code; });\n            });\n        }\n        function getFixableErrorSpanExpression(sourceFile, errorCode, span, cancellationToken, program) {\n            var token = ts.getTokenAtPosition(sourceFile, span.start);\n            // Checker has already done work to determine that await might be possible, and has attached\n            // related info to the node, so start by finding the expression that exactly matches up\n            // with the diagnostic range.\n            var expression = ts.findAncestor(token, function (node) {\n                if (node.getStart(sourceFile) < span.start || node.getEnd() > ts.textSpanEnd(span)) {\n                    return \"quit\";\n                }\n                return ts.isExpression(node) && ts.textSpansEqual(span, ts.createTextSpanFromNode(node, sourceFile));\n            });\n            return expression\n                && isMissingAwaitError(sourceFile, errorCode, span, cancellationToken, program)\n                && isInsideAwaitableBody(expression) ? expression : undefined;\n        }\n        function findAwaitableInitializers(expression, sourceFile, cancellationToken, program, checker) {\n            var identifiers = getIdentifiersFromErrorSpanExpression(expression, checker);\n            if (!identifiers) {\n                return;\n            }\n            var isCompleteFix = identifiers.isCompleteFix;\n            var initializers;\n            var _loop_11 = function (identifier) {\n                var symbol = checker.getSymbolAtLocation(identifier);\n                if (!symbol) {\n                    return \"continue\";\n                }\n                var declaration = ts.tryCast(symbol.valueDeclaration, ts.isVariableDeclaration);\n                var variableName = declaration && ts.tryCast(declaration.name, ts.isIdentifier);\n                var variableStatement = ts.getAncestor(declaration, 232 /* VariableStatement */);\n                if (!declaration || !variableStatement ||\n                    declaration.type ||\n                    !declaration.initializer ||\n                    variableStatement.getSourceFile() !== sourceFile ||\n                    ts.hasSyntacticModifier(variableStatement, 1 /* Export */) ||\n                    !variableName ||\n                    !isInsideAwaitableBody(declaration.initializer)) {\n                    isCompleteFix = false;\n                    return \"continue\";\n                }\n                var diagnostics = program.getSemanticDiagnostics(sourceFile, cancellationToken);\n                var isUsedElsewhere = ts.FindAllReferences.Core.eachSymbolReferenceInFile(variableName, checker, sourceFile, function (reference) {\n                    return identifier !== reference && !symbolReferenceIsAlsoMissingAwait(reference, diagnostics, sourceFile, checker);\n                });\n                if (isUsedElsewhere) {\n                    isCompleteFix = false;\n                    return \"continue\";\n                }\n                (initializers || (initializers = [])).push({\n                    expression: declaration.initializer,\n                    declarationSymbol: symbol,\n                });\n            };\n            for (var _i = 0, _a = identifiers.identifiers; _i < _a.length; _i++) {\n                var identifier = _a[_i];\n                _loop_11(identifier);\n            }\n            return initializers && {\n                initializers: initializers,\n                needsSecondPassForFixAll: !isCompleteFix,\n            };\n        }\n        function getIdentifiersFromErrorSpanExpression(expression, checker) {\n            if (ts.isPropertyAccessExpression(expression.parent) && ts.isIdentifier(expression.parent.expression)) {\n                return { identifiers: [expression.parent.expression], isCompleteFix: true };\n            }\n            if (ts.isIdentifier(expression)) {\n                return { identifiers: [expression], isCompleteFix: true };\n            }\n            if (ts.isBinaryExpression(expression)) {\n                var sides = void 0;\n                var isCompleteFix = true;\n                for (var _i = 0, _a = [expression.left, expression.right]; _i < _a.length; _i++) {\n                    var side = _a[_i];\n                    var type = checker.getTypeAtLocation(side);\n                    if (checker.getPromisedTypeOfPromise(type)) {\n                        if (!ts.isIdentifier(side)) {\n                            isCompleteFix = false;\n                            continue;\n                        }\n                        (sides || (sides = [])).push(side);\n                    }\n                }\n                return sides && { identifiers: sides, isCompleteFix: isCompleteFix };\n            }\n        }\n        function symbolReferenceIsAlsoMissingAwait(reference, diagnostics, sourceFile, checker) {\n            var errorNode = ts.isPropertyAccessExpression(reference.parent) ? reference.parent.name :\n                ts.isBinaryExpression(reference.parent) ? reference.parent :\n                    reference;\n            var diagnostic = ts.find(diagnostics, function (diagnostic) {\n                return diagnostic.start === errorNode.getStart(sourceFile) &&\n                    (diagnostic.start + diagnostic.length) === errorNode.getEnd();\n            });\n            return diagnostic && ts.contains(errorCodes, diagnostic.code) ||\n                // A Promise is usually not correct in a binary expression (it’s not valid\n                // in an arithmetic expression and an equality comparison seems unusual),\n                // but if the other side of the binary expression has an error, the side\n                // is typed `any` which will squash the error that would identify this\n                // Promise as an invalid operand. So if the whole binary expression is\n                // typed `any` as a result, there is a strong likelihood that this Promise\n                // is accidentally missing `await`.\n                checker.getTypeAtLocation(errorNode).flags & 1 /* Any */;\n        }\n        function isInsideAwaitableBody(node) {\n            return node.kind & 32768 /* AwaitContext */ || !!ts.findAncestor(node, function (ancestor) {\n                return ancestor.parent && ts.isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor ||\n                    ts.isBlock(ancestor) && (ancestor.parent.kind === 251 /* FunctionDeclaration */ ||\n                        ancestor.parent.kind === 208 /* FunctionExpression */ ||\n                        ancestor.parent.kind === 209 /* ArrowFunction */ ||\n                        ancestor.parent.kind === 165 /* MethodDeclaration */);\n            });\n        }\n        function makeChange(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) {\n            if (ts.isBinaryExpression(insertionSite)) {\n                for (var _i = 0, _a = [insertionSite.left, insertionSite.right]; _i < _a.length; _i++) {\n                    var side = _a[_i];\n                    if (fixedDeclarations && ts.isIdentifier(side)) {\n                        var symbol = checker.getSymbolAtLocation(side);\n                        if (symbol && fixedDeclarations.has(ts.getSymbolId(symbol))) {\n                            continue;\n                        }\n                    }\n                    var type = checker.getTypeAtLocation(side);\n                    var newNode = checker.getPromisedTypeOfPromise(type) ? ts.factory.createAwaitExpression(side) : side;\n                    changeTracker.replaceNode(sourceFile, side, newNode);\n                }\n            }\n            else if (errorCode === propertyAccessCode && ts.isPropertyAccessExpression(insertionSite.parent)) {\n                if (fixedDeclarations && ts.isIdentifier(insertionSite.parent.expression)) {\n                    var symbol = checker.getSymbolAtLocation(insertionSite.parent.expression);\n                    if (symbol && fixedDeclarations.has(ts.getSymbolId(symbol))) {\n                        return;\n                    }\n                }\n                changeTracker.replaceNode(sourceFile, insertionSite.parent.expression, ts.factory.createParenthesizedExpression(ts.factory.createAwaitExpression(insertionSite.parent.expression)));\n                insertLeadingSemicolonIfNeeded(changeTracker, insertionSite.parent.expression, sourceFile);\n            }\n            else if (ts.contains(callableConstructableErrorCodes, errorCode) && ts.isCallOrNewExpression(insertionSite.parent)) {\n                if (fixedDeclarations && ts.isIdentifier(insertionSite)) {\n                    var symbol = checker.getSymbolAtLocation(insertionSite);\n                    if (symbol && fixedDeclarations.has(ts.getSymbolId(symbol))) {\n                        return;\n                    }\n                }\n                changeTracker.replaceNode(sourceFile, insertionSite, ts.factory.createParenthesizedExpression(ts.factory.createAwaitExpression(insertionSite)));\n                insertLeadingSemicolonIfNeeded(changeTracker, insertionSite, sourceFile);\n            }\n            else {\n                if (fixedDeclarations && ts.isVariableDeclaration(insertionSite.parent) && ts.isIdentifier(insertionSite.parent.name)) {\n                    var symbol = checker.getSymbolAtLocation(insertionSite.parent.name);\n                    if (symbol && !ts.tryAddToSet(fixedDeclarations, ts.getSymbolId(symbol))) {\n                        return;\n                    }\n                }\n                changeTracker.replaceNode(sourceFile, insertionSite, ts.factory.createAwaitExpression(insertionSite));\n            }\n        }\n        function insertLeadingSemicolonIfNeeded(changeTracker, beforeNode, sourceFile) {\n            var precedingToken = ts.findPrecedingToken(beforeNode.pos, sourceFile);\n            if (precedingToken && ts.positionIsASICandidate(precedingToken.end, precedingToken.parent, sourceFile)) {\n                changeTracker.insertText(sourceFile, beforeNode.getStart(sourceFile), \";\");\n            }\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"addMissingConst\";\n        var errorCodes = [\n            ts.Diagnostics.Cannot_find_name_0.code,\n            ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start, context.program); });\n                if (changes.length > 0) {\n                    return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_const_to_unresolved_variable, fixId, ts.Diagnostics.Add_const_to_all_unresolved_variables)];\n                }\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) {\n                var fixedNodes = new ts.Set();\n                return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag.start, context.program, fixedNodes); });\n            },\n        });\n        function makeChange(changeTracker, sourceFile, pos, program, fixedNodes) {\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            var forInitializer = ts.findAncestor(token, function (node) {\n                return ts.isForInOrOfStatement(node.parent) ? node.parent.initializer === node :\n                    isPossiblyPartOfDestructuring(node) ? false : \"quit\";\n            });\n            if (forInitializer)\n                return applyChange(changeTracker, forInitializer, sourceFile, fixedNodes);\n            var parent = token.parent;\n            if (ts.isBinaryExpression(parent) && parent.operatorToken.kind === 62 /* EqualsToken */ && ts.isExpressionStatement(parent.parent)) {\n                return applyChange(changeTracker, token, sourceFile, fixedNodes);\n            }\n            if (ts.isArrayLiteralExpression(parent)) {\n                var checker_1 = program.getTypeChecker();\n                if (!ts.every(parent.elements, function (element) { return arrayElementCouldBeVariableDeclaration(element, checker_1); })) {\n                    return;\n                }\n                return applyChange(changeTracker, parent, sourceFile, fixedNodes);\n            }\n            var commaExpression = ts.findAncestor(token, function (node) {\n                return ts.isExpressionStatement(node.parent) ? true :\n                    isPossiblyPartOfCommaSeperatedInitializer(node) ? false : \"quit\";\n            });\n            if (commaExpression) {\n                var checker = program.getTypeChecker();\n                if (!expressionCouldBeVariableDeclaration(commaExpression, checker)) {\n                    return;\n                }\n                return applyChange(changeTracker, commaExpression, sourceFile, fixedNodes);\n            }\n        }\n        function applyChange(changeTracker, initializer, sourceFile, fixedNodes) {\n            if (!fixedNodes || ts.tryAddToSet(fixedNodes, initializer)) {\n                changeTracker.insertModifierBefore(sourceFile, 84 /* ConstKeyword */, initializer);\n            }\n        }\n        function isPossiblyPartOfDestructuring(node) {\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                case 199 /* ArrayLiteralExpression */:\n                case 200 /* ObjectLiteralExpression */:\n                case 288 /* PropertyAssignment */:\n                case 289 /* ShorthandPropertyAssignment */:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n        function arrayElementCouldBeVariableDeclaration(expression, checker) {\n            var identifier = ts.isIdentifier(expression) ? expression :\n                ts.isAssignmentExpression(expression, /*excludeCompoundAssignment*/ true) && ts.isIdentifier(expression.left) ? expression.left :\n                    undefined;\n            return !!identifier && !checker.getSymbolAtLocation(identifier);\n        }\n        function isPossiblyPartOfCommaSeperatedInitializer(node) {\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                case 216 /* BinaryExpression */:\n                case 27 /* CommaToken */:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n        function expressionCouldBeVariableDeclaration(expression, checker) {\n            if (!ts.isBinaryExpression(expression)) {\n                return false;\n            }\n            if (expression.operatorToken.kind === 27 /* CommaToken */) {\n                return ts.every([expression.left, expression.right], function (expression) { return expressionCouldBeVariableDeclaration(expression, checker); });\n            }\n            return expression.operatorToken.kind === 62 /* EqualsToken */\n                && ts.isIdentifier(expression.left)\n                && !checker.getSymbolAtLocation(expression.left);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"addMissingDeclareProperty\";\n        var errorCodes = [\n            ts.Diagnostics.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration.code,\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start); });\n                if (changes.length > 0) {\n                    return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Prefix_with_declare, fixId, ts.Diagnostics.Prefix_all_incorrect_property_declarations_with_declare)];\n                }\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) {\n                var fixedNodes = new ts.Set();\n                return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag.start, fixedNodes); });\n            },\n        });\n        function makeChange(changeTracker, sourceFile, pos, fixedNodes) {\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            if (!ts.isIdentifier(token)) {\n                return;\n            }\n            var declaration = token.parent;\n            if (declaration.kind === 163 /* PropertyDeclaration */ &&\n                (!fixedNodes || ts.tryAddToSet(fixedNodes, declaration))) {\n                changeTracker.insertModifierBefore(sourceFile, 133 /* DeclareKeyword */, declaration);\n            }\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"addMissingInvocationForDecorator\";\n        var errorCodes = [ts.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Call_decorator_expression, fixId, ts.Diagnostics.Add_to_all_uncalled_decorators)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag.start); }); },\n        });\n        function makeChange(changeTracker, sourceFile, pos) {\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            var decorator = ts.findAncestor(token, ts.isDecorator);\n            ts.Debug.assert(!!decorator, \"Expected position to be owned by a decorator.\");\n            var replacement = ts.factory.createCallExpression(decorator.expression, /*typeArguments*/ undefined, /*argumentsArray*/ undefined);\n            changeTracker.replaceNode(sourceFile, decorator.expression, replacement);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"addNameToNamelessParameter\";\n        var errorCodes = [ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_parameter_name, fixId, ts.Diagnostics.Add_names_to_all_parameters_without_names)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag.start); }); },\n        });\n        function makeChange(changeTracker, sourceFile, pos) {\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            if (!ts.isIdentifier(token)) {\n                return ts.Debug.fail(\"add-name-to-nameless-parameter operates on identifiers, but got a \" + ts.Debug.formatSyntaxKind(token.kind));\n            }\n            var param = token.parent;\n            if (!ts.isParameter(param)) {\n                return ts.Debug.fail(\"Tried to add a parameter name to a non-parameter: \" + ts.Debug.formatSyntaxKind(token.kind));\n            }\n            var i = param.parent.parameters.indexOf(param);\n            ts.Debug.assert(!param.type, \"Tried to add a parameter name to a parameter that already had one.\");\n            ts.Debug.assert(i > -1, \"Parameter not found in parent parameter list.\");\n            var replacement = ts.factory.createParameterDeclaration(\n            /*decorators*/ undefined, param.modifiers, param.dotDotDotToken, \"arg\" + i, param.questionToken, ts.factory.createTypeReferenceNode(token, /*typeArguments*/ undefined), param.initializer);\n            changeTracker.replaceNode(sourceFile, token, replacement);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"annotateWithTypeFromJSDoc\";\n        var errorCodes = [ts.Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var decl = getDeclaration(context.sourceFile, context.span.start);\n                if (!decl)\n                    return;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, decl); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Annotate_with_type_from_JSDoc, fixId, ts.Diagnostics.Annotate_everything_with_types_from_JSDoc)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                var decl = getDeclaration(diag.file, diag.start);\n                if (decl)\n                    doChange(changes, diag.file, decl);\n            }); },\n        });\n        function getDeclaration(file, pos) {\n            var name = ts.getTokenAtPosition(file, pos);\n            // For an arrow function with no name, 'name' lands on the first parameter.\n            return ts.tryCast(ts.isParameter(name.parent) ? name.parent.parent : name.parent, parameterShouldGetTypeFromJSDoc);\n        }\n        function parameterShouldGetTypeFromJSDoc(node) {\n            return isDeclarationWithType(node) && hasUsableJSDoc(node);\n        }\n        codefix.parameterShouldGetTypeFromJSDoc = parameterShouldGetTypeFromJSDoc;\n        function hasUsableJSDoc(decl) {\n            return ts.isFunctionLikeDeclaration(decl)\n                ? decl.parameters.some(hasUsableJSDoc) || (!decl.type && !!ts.getJSDocReturnType(decl))\n                : !decl.type && !!ts.getJSDocType(decl);\n        }\n        function doChange(changes, sourceFile, decl) {\n            if (ts.isFunctionLikeDeclaration(decl) && (ts.getJSDocReturnType(decl) || decl.parameters.some(function (p) { return !!ts.getJSDocType(p); }))) {\n                if (!decl.typeParameters) {\n                    var typeParameters = ts.getJSDocTypeParameterDeclarations(decl);\n                    if (typeParameters.length)\n                        changes.insertTypeParameters(sourceFile, decl, typeParameters);\n                }\n                var needParens = ts.isArrowFunction(decl) && !ts.findChildOfKind(decl, 20 /* OpenParenToken */, sourceFile);\n                if (needParens)\n                    changes.insertNodeBefore(sourceFile, ts.first(decl.parameters), ts.factory.createToken(20 /* OpenParenToken */));\n                for (var _i = 0, _a = decl.parameters; _i < _a.length; _i++) {\n                    var param = _a[_i];\n                    if (!param.type) {\n                        var paramType = ts.getJSDocType(param);\n                        if (paramType)\n                            changes.tryInsertTypeAnnotation(sourceFile, param, transformJSDocType(paramType));\n                    }\n                }\n                if (needParens)\n                    changes.insertNodeAfter(sourceFile, ts.last(decl.parameters), ts.factory.createToken(21 /* CloseParenToken */));\n                if (!decl.type) {\n                    var returnType = ts.getJSDocReturnType(decl);\n                    if (returnType)\n                        changes.tryInsertTypeAnnotation(sourceFile, decl, transformJSDocType(returnType));\n                }\n            }\n            else {\n                var jsdocType = ts.Debug.checkDefined(ts.getJSDocType(decl), \"A JSDocType for this declaration should exist\"); // If not defined, shouldn't have been an error to fix\n                ts.Debug.assert(!decl.type, \"The JSDocType decl should have a type\"); // If defined, shouldn't have been an error to fix.\n                changes.tryInsertTypeAnnotation(sourceFile, decl, transformJSDocType(jsdocType));\n            }\n        }\n        function isDeclarationWithType(node) {\n            return ts.isFunctionLikeDeclaration(node) ||\n                node.kind === 249 /* VariableDeclaration */ ||\n                node.kind === 162 /* PropertySignature */ ||\n                node.kind === 163 /* PropertyDeclaration */;\n        }\n        function transformJSDocType(node) {\n            switch (node.kind) {\n                case 303 /* JSDocAllType */:\n                case 304 /* JSDocUnknownType */:\n                    return ts.factory.createTypeReferenceNode(\"any\", ts.emptyArray);\n                case 307 /* JSDocOptionalType */:\n                    return transformJSDocOptionalType(node);\n                case 306 /* JSDocNonNullableType */:\n                    return transformJSDocType(node.type);\n                case 305 /* JSDocNullableType */:\n                    return transformJSDocNullableType(node);\n                case 309 /* JSDocVariadicType */:\n                    return transformJSDocVariadicType(node);\n                case 308 /* JSDocFunctionType */:\n                    return transformJSDocFunctionType(node);\n                case 173 /* TypeReference */:\n                    return transformJSDocTypeReference(node);\n                default:\n                    var visited = ts.visitEachChild(node, transformJSDocType, ts.nullTransformationContext);\n                    ts.setEmitFlags(visited, 1 /* SingleLine */);\n                    return visited;\n            }\n        }\n        function transformJSDocOptionalType(node) {\n            return ts.factory.createUnionTypeNode([ts.visitNode(node.type, transformJSDocType), ts.factory.createTypeReferenceNode(\"undefined\", ts.emptyArray)]);\n        }\n        function transformJSDocNullableType(node) {\n            return ts.factory.createUnionTypeNode([ts.visitNode(node.type, transformJSDocType), ts.factory.createTypeReferenceNode(\"null\", ts.emptyArray)]);\n        }\n        function transformJSDocVariadicType(node) {\n            return ts.factory.createArrayTypeNode(ts.visitNode(node.type, transformJSDocType));\n        }\n        function transformJSDocFunctionType(node) {\n            var _a;\n            // TODO: This does not properly handle `function(new:C, string)` per https://github.com/google/closure-compiler/wiki/Types-in-the-Closure-Type-System#the-javascript-type-language\n            //       however we do handle it correctly in `serializeTypeForDeclaration` in checker.ts\n            return ts.factory.createFunctionTypeNode(ts.emptyArray, node.parameters.map(transformJSDocParameter), (_a = node.type) !== null && _a !== void 0 ? _a : ts.factory.createKeywordTypeNode(128 /* AnyKeyword */));\n        }\n        function transformJSDocParameter(node) {\n            var index = node.parent.parameters.indexOf(node);\n            var isRest = node.type.kind === 309 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217\n            var name = node.name || (isRest ? \"rest\" : \"arg\" + index);\n            var dotdotdot = isRest ? ts.factory.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken;\n            return ts.factory.createParameterDeclaration(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer);\n        }\n        function transformJSDocTypeReference(node) {\n            var name = node.typeName;\n            var args = node.typeArguments;\n            if (ts.isIdentifier(node.typeName)) {\n                if (ts.isJSDocIndexSignature(node)) {\n                    return transformJSDocIndexSignature(node);\n                }\n                var text = node.typeName.text;\n                switch (node.typeName.text) {\n                    case \"String\":\n                    case \"Boolean\":\n                    case \"Object\":\n                    case \"Number\":\n                        text = text.toLowerCase();\n                        break;\n                    case \"array\":\n                    case \"date\":\n                    case \"promise\":\n                        text = text[0].toUpperCase() + text.slice(1);\n                        break;\n                }\n                name = ts.factory.createIdentifier(text);\n                if ((text === \"Array\" || text === \"Promise\") && !node.typeArguments) {\n                    args = ts.factory.createNodeArray([ts.factory.createTypeReferenceNode(\"any\", ts.emptyArray)]);\n                }\n                else {\n                    args = ts.visitNodes(node.typeArguments, transformJSDocType);\n                }\n            }\n            return ts.factory.createTypeReferenceNode(name, args);\n        }\n        function transformJSDocIndexSignature(node) {\n            var index = ts.factory.createParameterDeclaration(\n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, \n            /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 144 /* NumberKeyword */ ? \"n\" : \"s\", \n            /*questionToken*/ undefined, ts.factory.createTypeReferenceNode(node.typeArguments[0].kind === 144 /* NumberKeyword */ ? \"number\" : \"string\", []), \n            /*initializer*/ undefined);\n            var indexSignature = ts.factory.createTypeLiteralNode([ts.factory.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]);\n            ts.setEmitFlags(indexSignature, 1 /* SingleLine */);\n            return indexSignature;\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"convertFunctionToEs6Class\";\n        var errorCodes = [ts.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) {\n                    return doChange(t, context.sourceFile, context.span.start, context.program.getTypeChecker(), context.preferences, context.program.getCompilerOptions());\n                });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Convert_function_to_an_ES2015_class, fixId, ts.Diagnostics.Convert_all_constructor_functions_to_classes)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, err) {\n                return doChange(changes, err.file, err.start, context.program.getTypeChecker(), context.preferences, context.program.getCompilerOptions());\n            }); },\n        });\n        function doChange(changes, sourceFile, position, checker, preferences, compilerOptions) {\n            var ctorSymbol = checker.getSymbolAtLocation(ts.getTokenAtPosition(sourceFile, position));\n            if (!ctorSymbol || !(ctorSymbol.flags & (16 /* Function */ | 3 /* Variable */))) {\n                // Bad input\n                return undefined;\n            }\n            var ctorDeclaration = ctorSymbol.valueDeclaration;\n            if (ts.isFunctionDeclaration(ctorDeclaration)) {\n                changes.replaceNode(sourceFile, ctorDeclaration, createClassFromFunctionDeclaration(ctorDeclaration));\n            }\n            else if (ts.isVariableDeclaration(ctorDeclaration)) {\n                var classDeclaration = createClassFromVariableDeclaration(ctorDeclaration);\n                if (!classDeclaration) {\n                    return undefined;\n                }\n                var ancestor = ctorDeclaration.parent.parent;\n                if (ts.isVariableDeclarationList(ctorDeclaration.parent) && ctorDeclaration.parent.declarations.length > 1) {\n                    changes.delete(sourceFile, ctorDeclaration);\n                    changes.insertNodeAfter(sourceFile, ancestor, classDeclaration);\n                }\n                else {\n                    changes.replaceNode(sourceFile, ancestor, classDeclaration);\n                }\n            }\n            function createClassElementsFromSymbol(symbol) {\n                var memberElements = [];\n                // all instance members are stored in the \"member\" array of symbol\n                if (symbol.members) {\n                    symbol.members.forEach(function (member, key) {\n                        if (key === \"constructor\") {\n                            // fn.prototype.constructor = fn\n                            changes.delete(sourceFile, member.valueDeclaration.parent);\n                            return;\n                        }\n                        var memberElement = createClassElement(member, /*modifiers*/ undefined);\n                        if (memberElement) {\n                            memberElements.push.apply(memberElements, memberElement);\n                        }\n                    });\n                }\n                // all static members are stored in the \"exports\" array of symbol\n                if (symbol.exports) {\n                    symbol.exports.forEach(function (member) {\n                        if (member.name === \"prototype\") {\n                            var firstDeclaration = member.declarations[0];\n                            // only one \"x.prototype = { ... }\" will pass\n                            if (member.declarations.length === 1 &&\n                                ts.isPropertyAccessExpression(firstDeclaration) &&\n                                ts.isBinaryExpression(firstDeclaration.parent) &&\n                                firstDeclaration.parent.operatorToken.kind === 62 /* EqualsToken */ &&\n                                ts.isObjectLiteralExpression(firstDeclaration.parent.right)) {\n                                var prototypes = firstDeclaration.parent.right;\n                                var memberElement = createClassElement(prototypes.symbol, /** modifiers */ undefined);\n                                if (memberElement) {\n                                    memberElements.push.apply(memberElements, memberElement);\n                                }\n                            }\n                        }\n                        else {\n                            var memberElement = createClassElement(member, [ts.factory.createToken(123 /* StaticKeyword */)]);\n                            if (memberElement) {\n                                memberElements.push.apply(memberElements, memberElement);\n                            }\n                        }\n                    });\n                }\n                return memberElements;\n                function shouldConvertDeclaration(_target, source) {\n                    // Right now the only thing we can convert are function expressions, get/set accessors and methods\n                    // other values like normal value fields ({a: 1}) shouldn't get transformed.\n                    // We can update this once ES public class properties are available.\n                    if (ts.isAccessExpression(_target)) {\n                        if (ts.isPropertyAccessExpression(_target) && isConstructorAssignment(_target))\n                            return true;\n                        return ts.isFunctionLike(source);\n                    }\n                    else {\n                        return ts.every(_target.properties, function (property) {\n                            // a() {}\n                            if (ts.isMethodDeclaration(property) || ts.isGetOrSetAccessorDeclaration(property))\n                                return true;\n                            // a: function() {}\n                            if (ts.isPropertyAssignment(property) && ts.isFunctionExpression(property.initializer) && !!property.name)\n                                return true;\n                            // x.prototype.constructor = fn\n                            if (isConstructorAssignment(property))\n                                return true;\n                            return false;\n                        });\n                    }\n                }\n                function createClassElement(symbol, modifiers) {\n                    // Right now the only thing we can convert are function expressions, which are marked as methods\n                    // or { x: y } type prototype assignments, which are marked as ObjectLiteral\n                    var members = [];\n                    if (!(symbol.flags & 8192 /* Method */) && !(symbol.flags & 4096 /* ObjectLiteral */)) {\n                        return members;\n                    }\n                    var memberDeclaration = symbol.valueDeclaration;\n                    var assignmentBinaryExpression = memberDeclaration.parent;\n                    var assignmentExpr = assignmentBinaryExpression.right;\n                    if (!shouldConvertDeclaration(memberDeclaration, assignmentExpr)) {\n                        return members;\n                    }\n                    // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end\n                    var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 233 /* ExpressionStatement */\n                        ? assignmentBinaryExpression.parent : assignmentBinaryExpression;\n                    changes.delete(sourceFile, nodeToDelete);\n                    if (!assignmentExpr) {\n                        members.push(ts.factory.createPropertyDeclaration([], modifiers, symbol.name, /*questionToken*/ undefined, \n                        /*type*/ undefined, /*initializer*/ undefined));\n                        return members;\n                    }\n                    // f.x = expr\n                    if (ts.isAccessExpression(memberDeclaration) && (ts.isFunctionExpression(assignmentExpr) || ts.isArrowFunction(assignmentExpr))) {\n                        var quotePreference = ts.getQuotePreference(sourceFile, preferences);\n                        var name = tryGetPropertyName(memberDeclaration, compilerOptions, quotePreference);\n                        if (name) {\n                            return createFunctionLikeExpressionMember(members, assignmentExpr, name);\n                        }\n                        return members;\n                    }\n                    // f.prototype = { ... }\n                    else if (ts.isObjectLiteralExpression(assignmentExpr)) {\n                        return ts.flatMap(assignmentExpr.properties, function (property) {\n                            if (ts.isMethodDeclaration(property) || ts.isGetOrSetAccessorDeclaration(property)) {\n                                // MethodDeclaration and AccessorDeclaration can appear in a class directly\n                                return members.concat(property);\n                            }\n                            if (ts.isPropertyAssignment(property) && ts.isFunctionExpression(property.initializer)) {\n                                return createFunctionLikeExpressionMember(members, property.initializer, property.name);\n                            }\n                            // Drop constructor assignments\n                            if (isConstructorAssignment(property))\n                                return members;\n                            return [];\n                        });\n                    }\n                    else {\n                        // Don't try to declare members in JavaScript files\n                        if (ts.isSourceFileJS(sourceFile))\n                            return members;\n                        if (!ts.isPropertyAccessExpression(memberDeclaration))\n                            return members;\n                        var prop = ts.factory.createPropertyDeclaration(/*decorators*/ undefined, modifiers, memberDeclaration.name, /*questionToken*/ undefined, /*type*/ undefined, assignmentExpr);\n                        ts.copyLeadingComments(assignmentBinaryExpression.parent, prop, sourceFile);\n                        members.push(prop);\n                        return members;\n                    }\n                    function createFunctionLikeExpressionMember(members, expression, name) {\n                        if (ts.isFunctionExpression(expression))\n                            return createFunctionExpressionMember(members, expression, name);\n                        else\n                            return createArrowFunctionExpressionMember(members, expression, name);\n                    }\n                    function createFunctionExpressionMember(members, functionExpression, name) {\n                        var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 129 /* AsyncKeyword */));\n                        var method = ts.factory.createMethodDeclaration(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, name, /*questionToken*/ undefined, \n                        /*typeParameters*/ undefined, functionExpression.parameters, /*type*/ undefined, functionExpression.body);\n                        ts.copyLeadingComments(assignmentBinaryExpression, method, sourceFile);\n                        return members.concat(method);\n                    }\n                    function createArrowFunctionExpressionMember(members, arrowFunction, name) {\n                        var arrowFunctionBody = arrowFunction.body;\n                        var bodyBlock;\n                        // case 1: () => { return [1,2,3] }\n                        if (arrowFunctionBody.kind === 230 /* Block */) {\n                            bodyBlock = arrowFunctionBody;\n                        }\n                        // case 2: () => [1,2,3]\n                        else {\n                            bodyBlock = ts.factory.createBlock([ts.factory.createReturnStatement(arrowFunctionBody)]);\n                        }\n                        var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(arrowFunction, 129 /* AsyncKeyword */));\n                        var method = ts.factory.createMethodDeclaration(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, name, /*questionToken*/ undefined, \n                        /*typeParameters*/ undefined, arrowFunction.parameters, /*type*/ undefined, bodyBlock);\n                        ts.copyLeadingComments(assignmentBinaryExpression, method, sourceFile);\n                        return members.concat(method);\n                    }\n                }\n            }\n            function createClassFromVariableDeclaration(node) {\n                var initializer = node.initializer;\n                if (!initializer || !ts.isFunctionExpression(initializer) || !ts.isIdentifier(node.name)) {\n                    return undefined;\n                }\n                var memberElements = createClassElementsFromSymbol(node.symbol);\n                if (initializer.body) {\n                    memberElements.unshift(ts.factory.createConstructorDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, initializer.parameters, initializer.body));\n                }\n                var modifiers = getModifierKindFromSource(node.parent.parent, 92 /* ExportKeyword */);\n                var cls = ts.factory.createClassDeclaration(/*decorators*/ undefined, modifiers, node.name, \n                /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements);\n                // Don't call copyComments here because we'll already leave them in place\n                return cls;\n            }\n            function createClassFromFunctionDeclaration(node) {\n                var memberElements = createClassElementsFromSymbol(ctorSymbol);\n                if (node.body) {\n                    memberElements.unshift(ts.factory.createConstructorDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, node.parameters, node.body));\n                }\n                var modifiers = getModifierKindFromSource(node, 92 /* ExportKeyword */);\n                var cls = ts.factory.createClassDeclaration(/*decorators*/ undefined, modifiers, node.name, \n                /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements);\n                // Don't call copyComments here because we'll already leave them in place\n                return cls;\n            }\n        }\n        function getModifierKindFromSource(source, kind) {\n            return ts.filter(source.modifiers, function (modifier) { return modifier.kind === kind; });\n        }\n        function isConstructorAssignment(x) {\n            if (!x.name)\n                return false;\n            if (ts.isIdentifier(x.name) && x.name.text === \"constructor\")\n                return true;\n            return false;\n        }\n        function tryGetPropertyName(node, compilerOptions, quotePreference) {\n            if (ts.isPropertyAccessExpression(node)) {\n                return node.name;\n            }\n            var propName = node.argumentExpression;\n            if (ts.isNumericLiteral(propName)) {\n                return propName;\n            }\n            if (ts.isStringLiteralLike(propName)) {\n                return ts.isIdentifierText(propName.text, compilerOptions.target) ? ts.factory.createIdentifier(propName.text)\n                    : ts.isNoSubstitutionTemplateLiteral(propName) ? ts.factory.createStringLiteral(propName.text, quotePreference === 0 /* Single */)\n                        : propName;\n            }\n            return undefined;\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"convertToAsyncFunction\";\n        var errorCodes = [ts.Diagnostics.This_may_be_converted_to_an_async_function.code];\n        var codeActionSucceeded = true;\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                codeActionSucceeded = true;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return convertToAsyncFunction(t, context.sourceFile, context.span.start, context.program.getTypeChecker()); });\n                return codeActionSucceeded ? [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Convert_to_async_function, fixId, ts.Diagnostics.Convert_all_to_async_functions)] : [];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, err) { return convertToAsyncFunction(changes, err.file, err.start, context.program.getTypeChecker()); }); },\n        });\n        var SynthBindingNameKind;\n        (function (SynthBindingNameKind) {\n            SynthBindingNameKind[SynthBindingNameKind[\"Identifier\"] = 0] = \"Identifier\";\n            SynthBindingNameKind[SynthBindingNameKind[\"BindingPattern\"] = 1] = \"BindingPattern\";\n        })(SynthBindingNameKind || (SynthBindingNameKind = {}));\n        function convertToAsyncFunction(changes, sourceFile, position, checker) {\n            // get the function declaration - returns a promise\n            var tokenAtPosition = ts.getTokenAtPosition(sourceFile, position);\n            var functionToConvert;\n            // if the parent of a FunctionLikeDeclaration is a variable declaration, the convertToAsync diagnostic will be reported on the variable name\n            if (ts.isIdentifier(tokenAtPosition) && ts.isVariableDeclaration(tokenAtPosition.parent) &&\n                tokenAtPosition.parent.initializer && ts.isFunctionLikeDeclaration(tokenAtPosition.parent.initializer)) {\n                functionToConvert = tokenAtPosition.parent.initializer;\n            }\n            else {\n                functionToConvert = ts.tryCast(ts.getContainingFunction(ts.getTokenAtPosition(sourceFile, position)), ts.isFunctionLikeDeclaration);\n            }\n            if (!functionToConvert) {\n                return;\n            }\n            var synthNamesMap = new ts.Map();\n            var isInJavascript = ts.isInJSFile(functionToConvert);\n            var setOfExpressionsToReturn = getAllPromiseExpressionsToReturn(functionToConvert, checker);\n            var functionToConvertRenamed = renameCollidingVarNames(functionToConvert, checker, synthNamesMap);\n            var returnStatements = functionToConvertRenamed.body && ts.isBlock(functionToConvertRenamed.body) ? getReturnStatementsWithPromiseHandlers(functionToConvertRenamed.body, checker) : ts.emptyArray;\n            var transformer = { checker: checker, synthNamesMap: synthNamesMap, setOfExpressionsToReturn: setOfExpressionsToReturn, isInJSFile: isInJavascript };\n            if (!returnStatements.length) {\n                return;\n            }\n            var pos = functionToConvert.modifiers ? functionToConvert.modifiers.end :\n                functionToConvert.decorators ? ts.skipTrivia(sourceFile.text, functionToConvert.decorators.end) :\n                    functionToConvert.getStart(sourceFile);\n            var options = functionToConvert.modifiers ? { prefix: \" \" } : { suffix: \" \" };\n            changes.insertModifierAt(sourceFile, pos, 129 /* AsyncKeyword */, options);\n            var _loop_12 = function (returnStatement) {\n                ts.forEachChild(returnStatement, function visit(node) {\n                    if (ts.isCallExpression(node)) {\n                        var newNodes = transformExpression(node, transformer);\n                        changes.replaceNodeWithNodes(sourceFile, returnStatement, newNodes);\n                    }\n                    else if (!ts.isFunctionLike(node)) {\n                        ts.forEachChild(node, visit);\n                    }\n                });\n            };\n            for (var _i = 0, returnStatements_1 = returnStatements; _i < returnStatements_1.length; _i++) {\n                var returnStatement = returnStatements_1[_i];\n                _loop_12(returnStatement);\n            }\n        }\n        function getReturnStatementsWithPromiseHandlers(body, checker) {\n            var res = [];\n            ts.forEachReturnStatement(body, function (ret) {\n                if (ts.isReturnStatementWithFixablePromiseHandler(ret, checker))\n                    res.push(ret);\n            });\n            return res;\n        }\n        /*\n            Finds all of the expressions of promise type that should not be saved in a variable during the refactor\n        */\n        function getAllPromiseExpressionsToReturn(func, checker) {\n            if (!func.body) {\n                return new ts.Set();\n            }\n            var setOfExpressionsToReturn = new ts.Set();\n            ts.forEachChild(func.body, function visit(node) {\n                if (isPromiseReturningCallExpression(node, checker, \"then\")) {\n                    setOfExpressionsToReturn.add(ts.getNodeId(node));\n                    ts.forEach(node.arguments, visit);\n                }\n                else if (isPromiseReturningCallExpression(node, checker, \"catch\")) {\n                    setOfExpressionsToReturn.add(ts.getNodeId(node));\n                    // if .catch() is the last call in the chain, move leftward in the chain until we hit something else that should be returned\n                    ts.forEachChild(node, visit);\n                }\n                else if (isPromiseTypedExpression(node, checker)) {\n                    setOfExpressionsToReturn.add(ts.getNodeId(node));\n                    // don't recurse here, since we won't refactor any children or arguments of the expression\n                }\n                else {\n                    ts.forEachChild(node, visit);\n                }\n            });\n            return setOfExpressionsToReturn;\n        }\n        function isPromiseReturningCallExpression(node, checker, name) {\n            if (!ts.isCallExpression(node))\n                return false;\n            var isExpressionOfName = ts.hasPropertyAccessExpressionWithName(node, name);\n            var nodeType = isExpressionOfName && checker.getTypeAtLocation(node);\n            return !!(nodeType && checker.getPromisedTypeOfPromise(nodeType));\n        }\n        function isPromiseTypedExpression(node, checker) {\n            if (!ts.isExpression(node))\n                return false;\n            return !!checker.getPromisedTypeOfPromise(checker.getTypeAtLocation(node));\n        }\n        /*\n            Renaming of identifiers may be necessary as the refactor changes scopes -\n            This function collects all existing identifier names and names of identifiers that will be created in the refactor.\n            It then checks for any collisions and renames them through getSynthesizedDeepClone\n        */\n        function renameCollidingVarNames(nodeToRename, checker, synthNamesMap) {\n            var identsToRenameMap = new ts.Map(); // key is the symbol id\n            var collidingSymbolMap = ts.createMultiMap();\n            ts.forEachChild(nodeToRename, function visit(node) {\n                if (!ts.isIdentifier(node)) {\n                    ts.forEachChild(node, visit);\n                    return;\n                }\n                var symbol = checker.getSymbolAtLocation(node);\n                if (symbol) {\n                    var type = checker.getTypeAtLocation(node);\n                    // Note - the choice of the last call signature is arbitrary\n                    var lastCallSignature = getLastCallSignature(type, checker);\n                    var symbolIdString = ts.getSymbolId(symbol).toString();\n                    // If the identifier refers to a function, we want to add the new synthesized variable for the declaration. Example:\n                    //   fetch('...').then(response => { ... })\n                    // will eventually become\n                    //   const response = await fetch('...')\n                    // so we push an entry for 'response'.\n                    if (lastCallSignature && !ts.isParameter(node.parent) && !ts.isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) {\n                        var firstParameter = ts.firstOrUndefined(lastCallSignature.parameters);\n                        var ident = firstParameter && ts.isParameter(firstParameter.valueDeclaration) && ts.tryCast(firstParameter.valueDeclaration.name, ts.isIdentifier) || ts.factory.createUniqueName(\"result\", 16 /* Optimistic */);\n                        var synthName = getNewNameIfConflict(ident, collidingSymbolMap);\n                        synthNamesMap.set(symbolIdString, synthName);\n                        collidingSymbolMap.add(ident.text, symbol);\n                    }\n                    // We only care about identifiers that are parameters, variable declarations, or binding elements\n                    else if (node.parent && (ts.isParameter(node.parent) || ts.isVariableDeclaration(node.parent) || ts.isBindingElement(node.parent))) {\n                        var originalName = node.text;\n                        var collidingSymbols = collidingSymbolMap.get(originalName);\n                        // if the identifier name conflicts with a different identifier that we've already seen\n                        if (collidingSymbols && collidingSymbols.some(function (prevSymbol) { return prevSymbol !== symbol; })) {\n                            var newName = getNewNameIfConflict(node, collidingSymbolMap);\n                            identsToRenameMap.set(symbolIdString, newName.identifier);\n                            synthNamesMap.set(symbolIdString, newName);\n                            collidingSymbolMap.add(originalName, symbol);\n                        }\n                        else {\n                            var identifier = ts.getSynthesizedDeepClone(node);\n                            synthNamesMap.set(symbolIdString, createSynthIdentifier(identifier));\n                            collidingSymbolMap.add(originalName, symbol);\n                        }\n                    }\n                }\n            });\n            return ts.getSynthesizedDeepCloneWithReplacements(nodeToRename, /*includeTrivia*/ true, function (original) {\n                if (ts.isBindingElement(original) && ts.isIdentifier(original.name) && ts.isObjectBindingPattern(original.parent)) {\n                    var symbol = checker.getSymbolAtLocation(original.name);\n                    var renameInfo = symbol && identsToRenameMap.get(String(ts.getSymbolId(symbol)));\n                    if (renameInfo && renameInfo.text !== (original.name || original.propertyName).getText()) {\n                        return ts.factory.createBindingElement(original.dotDotDotToken, original.propertyName || original.name, renameInfo, original.initializer);\n                    }\n                }\n                else if (ts.isIdentifier(original)) {\n                    var symbol = checker.getSymbolAtLocation(original);\n                    var renameInfo = symbol && identsToRenameMap.get(String(ts.getSymbolId(symbol)));\n                    if (renameInfo) {\n                        return ts.factory.createIdentifier(renameInfo.text);\n                    }\n                }\n            });\n        }\n        function getNewNameIfConflict(name, originalNames) {\n            var numVarsSameName = (originalNames.get(name.text) || ts.emptyArray).length;\n            var identifier = numVarsSameName === 0 ? name : ts.factory.createIdentifier(name.text + \"_\" + numVarsSameName);\n            return createSynthIdentifier(identifier);\n        }\n        function silentFail() {\n            codeActionSucceeded = false;\n            return ts.emptyArray;\n        }\n        // dispatch function to recursively build the refactoring\n        // should be kept up to date with isFixablePromiseHandler in suggestionDiagnostics.ts\n        function transformExpression(node, transformer, prevArgName) {\n            if (isPromiseReturningCallExpression(node, transformer.checker, \"then\")) {\n                if (node.arguments.length === 0)\n                    return silentFail();\n                return transformThen(node, transformer, prevArgName);\n            }\n            if (isPromiseReturningCallExpression(node, transformer.checker, \"catch\")) {\n                return transformCatch(node, transformer, prevArgName);\n            }\n            if (ts.isPropertyAccessExpression(node)) {\n                return transformExpression(node.expression, transformer, prevArgName);\n            }\n            var nodeType = transformer.checker.getTypeAtLocation(node);\n            if (nodeType && transformer.checker.getPromisedTypeOfPromise(nodeType)) {\n                ts.Debug.assertNode(node.original.parent, ts.isPropertyAccessExpression);\n                return transformPromiseExpressionOfPropertyAccess(node, transformer, prevArgName);\n            }\n            return silentFail();\n        }\n        function transformCatch(node, transformer, prevArgName) {\n            var func = ts.singleOrUndefined(node.arguments);\n            var argName = func ? getArgBindingName(func, transformer) : undefined;\n            var possibleNameForVarDecl;\n            // If there is another call in the chain after the .catch() we are transforming, we will need to save the result of both paths (try block and catch block)\n            // To do this, we will need to synthesize a variable that we were not aware of while we were adding identifiers to the synthNamesMap\n            // We will use the prevArgName and then update the synthNamesMap with a new variable name for the next transformation step\n            if (prevArgName && !shouldReturn(node, transformer)) {\n                if (isSynthIdentifier(prevArgName)) {\n                    possibleNameForVarDecl = prevArgName;\n                    transformer.synthNamesMap.forEach(function (val, key) {\n                        if (val.identifier.text === prevArgName.identifier.text) {\n                            var newSynthName = createUniqueSynthName(prevArgName);\n                            transformer.synthNamesMap.set(key, newSynthName);\n                        }\n                    });\n                }\n                else {\n                    possibleNameForVarDecl = createSynthIdentifier(ts.factory.createUniqueName(\"result\", 16 /* Optimistic */), prevArgName.types);\n                }\n                // We are about to write a 'let' variable declaration, but `transformExpression` for both\n                // the try block and catch block will assign to this name. Setting this flag indicates\n                // that future assignments should be written as `name = value` instead of `const name = value`.\n                possibleNameForVarDecl.hasBeenDeclared = true;\n            }\n            var tryBlock = ts.factory.createBlock(transformExpression(node.expression, transformer, possibleNameForVarDecl));\n            var transformationBody = func ? getTransformationBody(func, possibleNameForVarDecl, argName, node, transformer) : ts.emptyArray;\n            var catchArg = argName ? isSynthIdentifier(argName) ? argName.identifier.text : argName.bindingPattern : \"e\";\n            var catchVariableDeclaration = ts.factory.createVariableDeclaration(catchArg);\n            var catchClause = ts.factory.createCatchClause(catchVariableDeclaration, ts.factory.createBlock(transformationBody));\n            // In order to avoid an implicit any, we will synthesize a type for the declaration using the unions of the types of both paths (try block and catch block)\n            var varDeclList;\n            var varDeclIdentifier;\n            if (possibleNameForVarDecl && !shouldReturn(node, transformer)) {\n                varDeclIdentifier = ts.getSynthesizedDeepClone(possibleNameForVarDecl.identifier);\n                var typeArray = possibleNameForVarDecl.types;\n                var unionType = transformer.checker.getUnionType(typeArray, 2 /* Subtype */);\n                var unionTypeNode = transformer.isInJSFile ? undefined : transformer.checker.typeToTypeNode(unionType, /*enclosingDeclaration*/ undefined, /*flags*/ undefined);\n                var varDecl = [ts.factory.createVariableDeclaration(varDeclIdentifier, /*exclamationToken*/ undefined, unionTypeNode)];\n                varDeclList = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList(varDecl, 1 /* Let */));\n            }\n            var tryStatement = ts.factory.createTryStatement(tryBlock, catchClause, /*finallyBlock*/ undefined);\n            var destructuredResult = prevArgName && varDeclIdentifier && isSynthBindingPattern(prevArgName)\n                && ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(ts.getSynthesizedDeepClone(prevArgName.bindingPattern), /*exclamationToken*/ undefined, /*type*/ undefined, varDeclIdentifier)], 2 /* Const */));\n            return ts.compact([varDeclList, tryStatement, destructuredResult]);\n        }\n        function createUniqueSynthName(prevArgName) {\n            var renamedPrevArg = ts.factory.createUniqueName(prevArgName.identifier.text, 16 /* Optimistic */);\n            return createSynthIdentifier(renamedPrevArg);\n        }\n        function transformThen(node, transformer, prevArgName) {\n            var _a = node.arguments, onFulfilled = _a[0], onRejected = _a[1];\n            var onFulfilledArgumentName = getArgBindingName(onFulfilled, transformer);\n            var transformationBody = getTransformationBody(onFulfilled, prevArgName, onFulfilledArgumentName, node, transformer);\n            if (onRejected) {\n                var onRejectedArgumentName = getArgBindingName(onRejected, transformer);\n                var tryBlock = ts.factory.createBlock(transformExpression(node.expression, transformer, onFulfilledArgumentName).concat(transformationBody));\n                var transformationBody2 = getTransformationBody(onRejected, prevArgName, onRejectedArgumentName, node, transformer);\n                var catchArg = onRejectedArgumentName ? isSynthIdentifier(onRejectedArgumentName) ? onRejectedArgumentName.identifier.text : onRejectedArgumentName.bindingPattern : \"e\";\n                var catchVariableDeclaration = ts.factory.createVariableDeclaration(catchArg);\n                var catchClause = ts.factory.createCatchClause(catchVariableDeclaration, ts.factory.createBlock(transformationBody2));\n                return [ts.factory.createTryStatement(tryBlock, catchClause, /* finallyBlock */ undefined)];\n            }\n            return transformExpression(node.expression, transformer, onFulfilledArgumentName).concat(transformationBody);\n        }\n        /**\n         * Transforms the 'x' part of `x.then(...)`, or the 'y()' part of `y().catch(...)`, where 'x' and 'y()' are Promises.\n         */\n        function transformPromiseExpressionOfPropertyAccess(node, transformer, prevArgName) {\n            if (shouldReturn(node, transformer)) {\n                return [ts.factory.createReturnStatement(ts.getSynthesizedDeepClone(node))];\n            }\n            return createVariableOrAssignmentOrExpressionStatement(prevArgName, ts.factory.createAwaitExpression(node), /*typeAnnotation*/ undefined);\n        }\n        function createVariableOrAssignmentOrExpressionStatement(variableName, rightHandSide, typeAnnotation) {\n            if (!variableName || isEmptyBindingName(variableName)) {\n                // if there's no argName to assign to, there still might be side effects\n                return [ts.factory.createExpressionStatement(rightHandSide)];\n            }\n            if (isSynthIdentifier(variableName) && variableName.hasBeenDeclared) {\n                // if the variable has already been declared, we don't need \"let\" or \"const\"\n                return [ts.factory.createExpressionStatement(ts.factory.createAssignment(ts.getSynthesizedDeepClone(variableName.identifier), rightHandSide))];\n            }\n            return [\n                ts.factory.createVariableStatement(\n                /*modifiers*/ undefined, ts.factory.createVariableDeclarationList([\n                    ts.factory.createVariableDeclaration(ts.getSynthesizedDeepClone(getNode(variableName)), \n                    /*exclamationToken*/ undefined, typeAnnotation, rightHandSide)\n                ], 2 /* Const */))\n            ];\n        }\n        function maybeAnnotateAndReturn(expressionToReturn, typeAnnotation) {\n            if (typeAnnotation && expressionToReturn) {\n                var name = ts.factory.createUniqueName(\"result\", 16 /* Optimistic */);\n                return __spreadArray(__spreadArray([], createVariableOrAssignmentOrExpressionStatement(createSynthIdentifier(name), expressionToReturn, typeAnnotation)), [\n                    ts.factory.createReturnStatement(name)\n                ]);\n            }\n            return [ts.factory.createReturnStatement(expressionToReturn)];\n        }\n        // should be kept up to date with isFixablePromiseArgument in suggestionDiagnostics.ts\n        function getTransformationBody(func, prevArgName, argName, parent, transformer) {\n            var _a, _b, _c, _d, _e;\n            switch (func.kind) {\n                case 103 /* NullKeyword */:\n                    // do not produce a transformed statement for a null argument\n                    break;\n                case 201 /* PropertyAccessExpression */:\n                case 78 /* Identifier */: // identifier includes undefined\n                    if (!argName) {\n                        // undefined was argument passed to promise handler\n                        break;\n                    }\n                    var synthCall = ts.factory.createCallExpression(ts.getSynthesizedDeepClone(func), /*typeArguments*/ undefined, isSynthIdentifier(argName) ? [argName.identifier] : []);\n                    if (shouldReturn(parent, transformer)) {\n                        return maybeAnnotateAndReturn(synthCall, (_a = parent.typeArguments) === null || _a === void 0 ? void 0 : _a[0]);\n                    }\n                    var type = transformer.checker.getTypeAtLocation(func);\n                    var callSignatures = transformer.checker.getSignaturesOfType(type, 0 /* Call */);\n                    if (!callSignatures.length) {\n                        // if identifier in handler has no call signatures, it's invalid\n                        return silentFail();\n                    }\n                    var returnType = callSignatures[0].getReturnType();\n                    var varDeclOrAssignment = createVariableOrAssignmentOrExpressionStatement(prevArgName, ts.factory.createAwaitExpression(synthCall), (_b = parent.typeArguments) === null || _b === void 0 ? void 0 : _b[0]);\n                    if (prevArgName) {\n                        prevArgName.types.push(returnType);\n                    }\n                    return varDeclOrAssignment;\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */: {\n                    var funcBody = func.body;\n                    var returnType_1 = (_c = getLastCallSignature(transformer.checker.getTypeAtLocation(func), transformer.checker)) === null || _c === void 0 ? void 0 : _c.getReturnType();\n                    // Arrow functions with block bodies { } will enter this control flow\n                    if (ts.isBlock(funcBody)) {\n                        var refactoredStmts = [];\n                        var seenReturnStatement = false;\n                        for (var _i = 0, _f = funcBody.statements; _i < _f.length; _i++) {\n                            var statement = _f[_i];\n                            if (ts.isReturnStatement(statement)) {\n                                seenReturnStatement = true;\n                                if (ts.isReturnStatementWithFixablePromiseHandler(statement, transformer.checker)) {\n                                    refactoredStmts = refactoredStmts.concat(getInnerTransformationBody(transformer, [statement], prevArgName));\n                                }\n                                else {\n                                    var possiblyAwaitedRightHandSide = returnType_1 && statement.expression ? getPossiblyAwaitedRightHandSide(transformer.checker, returnType_1, statement.expression) : statement.expression;\n                                    refactoredStmts.push.apply(refactoredStmts, maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, (_d = parent.typeArguments) === null || _d === void 0 ? void 0 : _d[0]));\n                                }\n                            }\n                            else {\n                                refactoredStmts.push(statement);\n                            }\n                        }\n                        return shouldReturn(parent, transformer)\n                            ? refactoredStmts.map(function (s) { return ts.getSynthesizedDeepClone(s); })\n                            : removeReturns(refactoredStmts, prevArgName, transformer, seenReturnStatement);\n                    }\n                    else {\n                        var innerRetStmts = ts.isFixablePromiseHandler(funcBody, transformer.checker) ? [ts.factory.createReturnStatement(funcBody)] : ts.emptyArray;\n                        var innerCbBody = getInnerTransformationBody(transformer, innerRetStmts, prevArgName);\n                        if (innerCbBody.length > 0) {\n                            return innerCbBody;\n                        }\n                        if (returnType_1) {\n                            var possiblyAwaitedRightHandSide = getPossiblyAwaitedRightHandSide(transformer.checker, returnType_1, funcBody);\n                            if (!shouldReturn(parent, transformer)) {\n                                var transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide, /*typeAnnotation*/ undefined);\n                                if (prevArgName) {\n                                    prevArgName.types.push(returnType_1);\n                                }\n                                return transformedStatement;\n                            }\n                            else {\n                                return maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, (_e = parent.typeArguments) === null || _e === void 0 ? void 0 : _e[0]);\n                            }\n                        }\n                        else {\n                            return silentFail();\n                        }\n                    }\n                }\n                default:\n                    // If no cases apply, we've found a transformation body we don't know how to handle, so the refactoring should no-op to avoid deleting code.\n                    return silentFail();\n            }\n            return ts.emptyArray;\n        }\n        function getPossiblyAwaitedRightHandSide(checker, type, expr) {\n            var rightHandSide = ts.getSynthesizedDeepClone(expr);\n            return !!checker.getPromisedTypeOfPromise(type) ? ts.factory.createAwaitExpression(rightHandSide) : rightHandSide;\n        }\n        function getLastCallSignature(type, checker) {\n            var callSignatures = checker.getSignaturesOfType(type, 0 /* Call */);\n            return ts.lastOrUndefined(callSignatures);\n        }\n        function removeReturns(stmts, prevArgName, transformer, seenReturnStatement) {\n            var ret = [];\n            for (var _i = 0, stmts_1 = stmts; _i < stmts_1.length; _i++) {\n                var stmt = stmts_1[_i];\n                if (ts.isReturnStatement(stmt)) {\n                    if (stmt.expression) {\n                        var possiblyAwaitedExpression = isPromiseTypedExpression(stmt.expression, transformer.checker) ? ts.factory.createAwaitExpression(stmt.expression) : stmt.expression;\n                        if (prevArgName === undefined) {\n                            ret.push(ts.factory.createExpressionStatement(possiblyAwaitedExpression));\n                        }\n                        else {\n                            ret.push(ts.factory.createVariableStatement(/*modifiers*/ undefined, (ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(getNode(prevArgName), /*exclamationToken*/ undefined, /*type*/ undefined, possiblyAwaitedExpression)], 2 /* Const */))));\n                        }\n                    }\n                }\n                else {\n                    ret.push(ts.getSynthesizedDeepClone(stmt));\n                }\n            }\n            // if block has no return statement, need to define prevArgName as undefined to prevent undeclared variables\n            if (!seenReturnStatement && prevArgName !== undefined) {\n                ret.push(ts.factory.createVariableStatement(/*modifiers*/ undefined, (ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(getNode(prevArgName), /*exclamationToken*/ undefined, /*type*/ undefined, ts.factory.createIdentifier(\"undefined\"))], 2 /* Const */))));\n            }\n            return ret;\n        }\n        function getInnerTransformationBody(transformer, innerRetStmts, prevArgName) {\n            var innerCbBody = [];\n            for (var _i = 0, innerRetStmts_1 = innerRetStmts; _i < innerRetStmts_1.length; _i++) {\n                var stmt = innerRetStmts_1[_i];\n                ts.forEachChild(stmt, function visit(node) {\n                    if (ts.isCallExpression(node)) {\n                        var temp = transformExpression(node, transformer, prevArgName);\n                        innerCbBody = innerCbBody.concat(temp);\n                        if (innerCbBody.length > 0) {\n                            return;\n                        }\n                    }\n                    else if (!ts.isFunctionLike(node)) {\n                        ts.forEachChild(node, visit);\n                    }\n                });\n            }\n            return innerCbBody;\n        }\n        function getArgBindingName(funcNode, transformer) {\n            var types = [];\n            var name;\n            if (ts.isFunctionLikeDeclaration(funcNode)) {\n                if (funcNode.parameters.length > 0) {\n                    var param = funcNode.parameters[0].name;\n                    name = getMappedBindingNameOrDefault(param);\n                }\n            }\n            else if (ts.isIdentifier(funcNode)) {\n                name = getMapEntryOrDefault(funcNode);\n            }\n            else if (ts.isPropertyAccessExpression(funcNode) && ts.isIdentifier(funcNode.name)) {\n                name = getMapEntryOrDefault(funcNode.name);\n            }\n            // return undefined argName when arg is null or undefined\n            // eslint-disable-next-line no-in-operator\n            if (!name || \"identifier\" in name && name.identifier.text === \"undefined\") {\n                return undefined;\n            }\n            return name;\n            function getMappedBindingNameOrDefault(bindingName) {\n                if (ts.isIdentifier(bindingName))\n                    return getMapEntryOrDefault(bindingName);\n                var elements = ts.flatMap(bindingName.elements, function (element) {\n                    if (ts.isOmittedExpression(element))\n                        return [];\n                    return [getMappedBindingNameOrDefault(element.name)];\n                });\n                return createSynthBindingPattern(bindingName, elements);\n            }\n            function getMapEntryOrDefault(identifier) {\n                var originalNode = getOriginalNode(identifier);\n                var symbol = getSymbol(originalNode);\n                if (!symbol) {\n                    return createSynthIdentifier(identifier, types);\n                }\n                var mapEntry = transformer.synthNamesMap.get(ts.getSymbolId(symbol).toString());\n                return mapEntry || createSynthIdentifier(identifier, types);\n            }\n            function getSymbol(node) {\n                return node.symbol ? node.symbol : transformer.checker.getSymbolAtLocation(node);\n            }\n            function getOriginalNode(node) {\n                return node.original ? node.original : node;\n            }\n        }\n        function isEmptyBindingName(bindingName) {\n            if (!bindingName) {\n                return true;\n            }\n            if (isSynthIdentifier(bindingName)) {\n                return !bindingName.identifier.text;\n            }\n            return ts.every(bindingName.elements, isEmptyBindingName);\n        }\n        function getNode(bindingName) {\n            return isSynthIdentifier(bindingName) ? bindingName.identifier : bindingName.bindingPattern;\n        }\n        function createSynthIdentifier(identifier, types) {\n            if (types === void 0) { types = []; }\n            return { kind: 0 /* Identifier */, identifier: identifier, types: types, hasBeenDeclared: false };\n        }\n        function createSynthBindingPattern(bindingPattern, elements, types) {\n            if (elements === void 0) { elements = ts.emptyArray; }\n            if (types === void 0) { types = []; }\n            return { kind: 1 /* BindingPattern */, bindingPattern: bindingPattern, elements: elements, types: types };\n        }\n        function isSynthIdentifier(bindingName) {\n            return bindingName.kind === 0 /* Identifier */;\n        }\n        function isSynthBindingPattern(bindingName) {\n            return bindingName.kind === 1 /* BindingPattern */;\n        }\n        function shouldReturn(expression, transformer) {\n            return !!expression.original && transformer.setOfExpressionsToReturn.has(ts.getNodeId(expression.original));\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        codefix.registerCodeFix({\n            errorCodes: [ts.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module.code],\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, program = context.program, preferences = context.preferences;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (changes) {\n                    var moduleExportsChangedToDefault = convertFileToEs6Module(sourceFile, program.getTypeChecker(), changes, program.getCompilerOptions().target, ts.getQuotePreference(sourceFile, preferences));\n                    if (moduleExportsChangedToDefault) {\n                        for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {\n                            var importingFile = _a[_i];\n                            fixImportOfModuleExports(importingFile, sourceFile, changes, ts.getQuotePreference(importingFile, preferences));\n                        }\n                    }\n                });\n                // No support for fix-all since this applies to the whole file at once anyway.\n                return [codefix.createCodeFixActionWithoutFixAll(\"convertToEs6Module\", changes, ts.Diagnostics.Convert_to_ES6_module)];\n            },\n        });\n        function fixImportOfModuleExports(importingFile, exportingFile, changes, quotePreference) {\n            for (var _i = 0, _a = importingFile.imports; _i < _a.length; _i++) {\n                var moduleSpecifier = _a[_i];\n                var imported = ts.getResolvedModule(importingFile, moduleSpecifier.text);\n                if (!imported || imported.resolvedFileName !== exportingFile.fileName) {\n                    continue;\n                }\n                var importNode = ts.importFromModuleSpecifier(moduleSpecifier);\n                switch (importNode.kind) {\n                    case 260 /* ImportEqualsDeclaration */:\n                        changes.replaceNode(importingFile, importNode, ts.makeImport(importNode.name, /*namedImports*/ undefined, moduleSpecifier, quotePreference));\n                        break;\n                    case 203 /* CallExpression */:\n                        if (ts.isRequireCall(importNode, /*checkArgumentIsStringLiteralLike*/ false)) {\n                            changes.replaceNode(importingFile, importNode, ts.factory.createPropertyAccessExpression(ts.getSynthesizedDeepClone(importNode), \"default\"));\n                        }\n                        break;\n                }\n            }\n        }\n        /** @returns Whether we converted a `module.exports =` to a default export. */\n        function convertFileToEs6Module(sourceFile, checker, changes, target, quotePreference) {\n            var identifiers = { original: collectFreeIdentifiers(sourceFile), additional: new ts.Set() };\n            var exports = collectExportRenames(sourceFile, checker, identifiers);\n            convertExportsAccesses(sourceFile, exports, changes);\n            var moduleExportsChangedToDefault = false;\n            var useSitesToUnqualify;\n            // Process variable statements first to collect use sites that need to be updated inside other transformations\n            for (var _i = 0, _a = ts.filter(sourceFile.statements, ts.isVariableStatement); _i < _a.length; _i++) {\n                var statement = _a[_i];\n                var newUseSites = convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference);\n                if (newUseSites) {\n                    ts.copyEntries(newUseSites, useSitesToUnqualify !== null && useSitesToUnqualify !== void 0 ? useSitesToUnqualify : (useSitesToUnqualify = new ts.Map()));\n                }\n            }\n            // `convertStatement` will delete entries from `useSitesToUnqualify` when containing statements are replaced\n            for (var _b = 0, _c = ts.filter(sourceFile.statements, function (s) { return !ts.isVariableStatement(s); }); _b < _c.length; _b++) {\n                var statement = _c[_b];\n                var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, useSitesToUnqualify, quotePreference);\n                moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged;\n            }\n            // Remaining use sites can be changed directly\n            useSitesToUnqualify === null || useSitesToUnqualify === void 0 ? void 0 : useSitesToUnqualify.forEach(function (replacement, original) {\n                changes.replaceNode(sourceFile, original, replacement);\n            });\n            return moduleExportsChangedToDefault;\n        }\n        function collectExportRenames(sourceFile, checker, identifiers) {\n            var res = new ts.Map();\n            forEachExportReference(sourceFile, function (node) {\n                var _a = node.name, text = _a.text, originalKeywordKind = _a.originalKeywordKind;\n                if (!res.has(text) && (originalKeywordKind !== undefined && ts.isNonContextualKeyword(originalKeywordKind)\n                    || checker.resolveName(text, node, 111551 /* Value */, /*excludeGlobals*/ true))) {\n                    // Unconditionally add an underscore in case `text` is a keyword.\n                    res.set(text, makeUniqueName(\"_\" + text, identifiers));\n                }\n            });\n            return res;\n        }\n        function convertExportsAccesses(sourceFile, exports, changes) {\n            forEachExportReference(sourceFile, function (node, isAssignmentLhs) {\n                if (isAssignmentLhs) {\n                    return;\n                }\n                var text = node.name.text;\n                changes.replaceNode(sourceFile, node, ts.factory.createIdentifier(exports.get(text) || text));\n            });\n        }\n        function forEachExportReference(sourceFile, cb) {\n            sourceFile.forEachChild(function recur(node) {\n                if (ts.isPropertyAccessExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression) && ts.isIdentifier(node.name)) {\n                    var parent = node.parent;\n                    cb(node, ts.isBinaryExpression(parent) && parent.left === node && parent.operatorToken.kind === 62 /* EqualsToken */);\n                }\n                node.forEachChild(recur);\n            });\n        }\n        function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, useSitesToUnqualify, quotePreference) {\n            switch (statement.kind) {\n                case 232 /* VariableStatement */:\n                    convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference);\n                    return false;\n                case 233 /* ExpressionStatement */: {\n                    var expression = statement.expression;\n                    switch (expression.kind) {\n                        case 203 /* CallExpression */: {\n                            if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true)) {\n                                // For side-effecting require() call, just make a side-effecting import.\n                                changes.replaceNode(sourceFile, statement, ts.makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0], quotePreference));\n                            }\n                            return false;\n                        }\n                        case 216 /* BinaryExpression */: {\n                            var operatorToken = expression.operatorToken;\n                            return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports, useSitesToUnqualify);\n                        }\n                    }\n                }\n                // falls through\n                default:\n                    return false;\n            }\n        }\n        function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference) {\n            var declarationList = statement.declarationList;\n            var foundImport = false;\n            var converted = ts.map(declarationList.declarations, function (decl) {\n                var name = decl.name, initializer = decl.initializer;\n                if (initializer) {\n                    if (ts.isExportsOrModuleExportsOrAlias(sourceFile, initializer)) {\n                        // `const alias = module.exports;` can be removed.\n                        foundImport = true;\n                        return convertedImports([]);\n                    }\n                    else if (ts.isRequireCall(initializer, /*checkArgumentIsStringLiteralLike*/ true)) {\n                        foundImport = true;\n                        return convertSingleImport(name, initializer.arguments[0], checker, identifiers, target, quotePreference);\n                    }\n                    else if (ts.isPropertyAccessExpression(initializer) && ts.isRequireCall(initializer.expression, /*checkArgumentIsStringLiteralLike*/ true)) {\n                        foundImport = true;\n                        return convertPropertyAccessImport(name, initializer.name.text, initializer.expression.arguments[0], identifiers, quotePreference);\n                    }\n                }\n                // Move it out to its own variable statement. (This will not be used if `!foundImport`)\n                return convertedImports([ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([decl], declarationList.flags))]);\n            });\n            if (foundImport) {\n                // useNonAdjustedEndPosition to ensure we don't eat the newline after the statement.\n                changes.replaceNodeWithNodes(sourceFile, statement, ts.flatMap(converted, function (c) { return c.newImports; }));\n                var combinedUseSites_1;\n                ts.forEach(converted, function (c) {\n                    if (c.useSitesToUnqualify) {\n                        ts.copyEntries(c.useSitesToUnqualify, combinedUseSites_1 !== null && combinedUseSites_1 !== void 0 ? combinedUseSites_1 : (combinedUseSites_1 = new ts.Map()));\n                    }\n                });\n                return combinedUseSites_1;\n            }\n        }\n        /** Converts `const name = require(\"moduleSpecifier\").propertyName` */\n        function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) {\n            switch (name.kind) {\n                case 196 /* ObjectBindingPattern */:\n                case 197 /* ArrayBindingPattern */: {\n                    // `const [a, b] = require(\"c\").d` --> `import { d } from \"c\"; const [a, b] = d;`\n                    var tmp = makeUniqueName(propertyName, identifiers);\n                    return convertedImports([\n                        makeSingleImport(tmp, propertyName, moduleSpecifier, quotePreference),\n                        makeConst(/*modifiers*/ undefined, name, ts.factory.createIdentifier(tmp)),\n                    ]);\n                }\n                case 78 /* Identifier */:\n                    // `const a = require(\"b\").c` --> `import { c as a } from \"./b\";\n                    return convertedImports([makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]);\n                default:\n                    return ts.Debug.assertNever(name, \"Convert to ES6 module got invalid syntax form \" + name.kind);\n            }\n        }\n        function convertAssignment(sourceFile, checker, assignment, changes, exports, useSitesToUnqualify) {\n            var left = assignment.left, right = assignment.right;\n            if (!ts.isPropertyAccessExpression(left)) {\n                return false;\n            }\n            if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left)) {\n                if (ts.isExportsOrModuleExportsOrAlias(sourceFile, right)) {\n                    // `const alias = module.exports;` or `module.exports = alias;` can be removed.\n                    changes.delete(sourceFile, assignment.parent);\n                }\n                else {\n                    var replacement = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right, useSitesToUnqualify)\n                        : ts.isRequireCall(right, /*checkArgumentIsStringLiteralLike*/ true) ? convertReExportAll(right.arguments[0], checker)\n                            : undefined;\n                    if (replacement) {\n                        changes.replaceNodeWithNodes(sourceFile, assignment.parent, replacement[0]);\n                        return replacement[1];\n                    }\n                    else {\n                        changes.replaceRangeWithText(sourceFile, ts.createRange(left.getStart(sourceFile), right.pos), \"export default\");\n                        return true;\n                    }\n                }\n            }\n            else if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left.expression)) {\n                convertNamedExport(sourceFile, assignment, changes, exports);\n            }\n            return false;\n        }\n        /**\n         * Convert `module.exports = { ... }` to individual exports..\n         * We can't always do this if the module has interesting members -- then it will be a default export instead.\n         */\n        function tryChangeModuleExportsObject(object, useSitesToUnqualify) {\n            var statements = ts.mapAllOrFail(object.properties, function (prop) {\n                switch (prop.kind) {\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                    // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`.\n                    // falls through\n                    case 289 /* ShorthandPropertyAssignment */:\n                    case 290 /* SpreadAssignment */:\n                        return undefined;\n                    case 288 /* PropertyAssignment */:\n                        return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer, useSitesToUnqualify);\n                    case 165 /* MethodDeclaration */:\n                        return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.factory.createToken(92 /* ExportKeyword */)], prop, useSitesToUnqualify);\n                    default:\n                        ts.Debug.assertNever(prop, \"Convert to ES6 got invalid prop kind \" + prop.kind);\n                }\n            });\n            return statements && [statements, false];\n        }\n        function convertNamedExport(sourceFile, assignment, changes, exports) {\n            // If \"originalKeywordKind\" was set, this is e.g. `exports.\n            var text = assignment.left.name.text;\n            var rename = exports.get(text);\n            if (rename !== undefined) {\n                /*\n                const _class = 0;\n                export { _class as class };\n                */\n                var newNodes = [\n                    makeConst(/*modifiers*/ undefined, rename, assignment.right),\n                    makeExportDeclaration([ts.factory.createExportSpecifier(rename, text)]),\n                ];\n                changes.replaceNodeWithNodes(sourceFile, assignment.parent, newNodes);\n            }\n            else {\n                convertExportsPropertyAssignment(assignment, sourceFile, changes);\n            }\n        }\n        function convertReExportAll(reExported, checker) {\n            // `module.exports = require(\"x\");` ==> `export * from \"x\"; export { default } from \"x\";`\n            var moduleSpecifier = reExported.text;\n            var moduleSymbol = checker.getSymbolAtLocation(reExported);\n            var exports = moduleSymbol ? moduleSymbol.exports : ts.emptyMap;\n            return exports.has(\"export=\" /* ExportEquals */) ? [[reExportDefault(moduleSpecifier)], true] :\n                !exports.has(\"default\" /* Default */) ? [[reExportStar(moduleSpecifier)], false] :\n                    // If there's some non-default export, must include both `export *` and `export default`.\n                    exports.size > 1 ? [[reExportStar(moduleSpecifier), reExportDefault(moduleSpecifier)], true] : [[reExportDefault(moduleSpecifier)], true];\n        }\n        function reExportStar(moduleSpecifier) {\n            return makeExportDeclaration(/*exportClause*/ undefined, moduleSpecifier);\n        }\n        function reExportDefault(moduleSpecifier) {\n            return makeExportDeclaration([ts.factory.createExportSpecifier(/*propertyName*/ undefined, \"default\")], moduleSpecifier);\n        }\n        function convertExportsPropertyAssignment(_a, sourceFile, changes) {\n            var left = _a.left, right = _a.right, parent = _a.parent;\n            var name = left.name.text;\n            if ((ts.isFunctionExpression(right) || ts.isArrowFunction(right) || ts.isClassExpression(right)) && (!right.name || right.name.text === name)) {\n                // `exports.f = function() {}` -> `export function f() {}` -- Replace `exports.f = ` with `export `, and insert the name after `function`.\n                changes.replaceRange(sourceFile, { pos: left.getStart(sourceFile), end: right.getStart(sourceFile) }, ts.factory.createToken(92 /* ExportKeyword */), { suffix: \" \" });\n                if (!right.name)\n                    changes.insertName(sourceFile, right, name);\n                var semi = ts.findChildOfKind(parent, 26 /* SemicolonToken */, sourceFile);\n                if (semi)\n                    changes.delete(sourceFile, semi);\n            }\n            else {\n                // `exports.f = function g() {}` -> `export const f = function g() {}` -- just replace `exports.` with `export const `\n                changes.replaceNodeRangeWithNodes(sourceFile, left.expression, ts.findChildOfKind(left, 24 /* DotToken */, sourceFile), [ts.factory.createToken(92 /* ExportKeyword */), ts.factory.createToken(84 /* ConstKeyword */)], { joiner: \" \", suffix: \" \" });\n            }\n        }\n        // TODO: GH#22492 this will cause an error if a change has been made inside the body of the node.\n        function convertExportsDotXEquals_replaceNode(name, exported, useSitesToUnqualify) {\n            var modifiers = [ts.factory.createToken(92 /* ExportKeyword */)];\n            switch (exported.kind) {\n                case 208 /* FunctionExpression */: {\n                    var expressionName = exported.name;\n                    if (expressionName && expressionName.text !== name) {\n                        // `exports.f = function g() {}` -> `export const f = function g() {}`\n                        return exportConst();\n                    }\n                }\n                // falls through\n                case 209 /* ArrowFunction */:\n                    // `exports.f = function() {}` --> `export function f() {}`\n                    return functionExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify);\n                case 221 /* ClassExpression */:\n                    // `exports.C = class {}` --> `export class C {}`\n                    return classExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify);\n                default:\n                    return exportConst();\n            }\n            function exportConst() {\n                // `exports.x = 0;` --> `export const x = 0;`\n                return makeConst(modifiers, ts.factory.createIdentifier(name), replaceImportUseSites(exported, useSitesToUnqualify)); // TODO: GH#18217\n            }\n        }\n        function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) {\n            if (!useSitesToUnqualify || !ts.some(ts.arrayFrom(useSitesToUnqualify.keys()), function (original) { return ts.rangeContainsRange(nodeOrNodes, original); })) {\n                return nodeOrNodes;\n            }\n            return ts.isArray(nodeOrNodes)\n                ? ts.getSynthesizedDeepClonesWithReplacements(nodeOrNodes, /*includeTrivia*/ true, replaceNode)\n                : ts.getSynthesizedDeepCloneWithReplacements(nodeOrNodes, /*includeTrivia*/ true, replaceNode);\n            function replaceNode(original) {\n                // We are replacing `mod.SomeExport` wih `SomeExport`, so we only need to look at PropertyAccessExpressions\n                if (original.kind === 201 /* PropertyAccessExpression */) {\n                    var replacement = useSitesToUnqualify.get(original);\n                    // Remove entry from `useSitesToUnqualify` so the refactor knows it's taken care of by the parent statement we're replacing\n                    useSitesToUnqualify.delete(original);\n                    return replacement;\n                }\n            }\n        }\n        /**\n         * Converts `const <<name>> = require(\"x\");`.\n         * Returns nodes that will replace the variable declaration for the commonjs import.\n         * May also make use `changes` to remove qualifiers at the use sites of imports, to change `mod.x` to `x`.\n         */\n        function convertSingleImport(name, moduleSpecifier, checker, identifiers, target, quotePreference) {\n            switch (name.kind) {\n                case 196 /* ObjectBindingPattern */: {\n                    var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) {\n                        return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name)\n                            ? undefined\n                            // (TODO: GH#18217)\n                            // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n                            : makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text);\n                    });\n                    if (importSpecifiers) {\n                        return convertedImports([ts.makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier, quotePreference)]);\n                    }\n                }\n                // falls through -- object destructuring has an interesting pattern and must be a variable declaration\n                case 197 /* ArrayBindingPattern */: {\n                    /*\n                    import x from \"x\";\n                    const [a, b, c] = x;\n                    */\n                    var tmp = makeUniqueName(codefix.moduleSpecifierToValidIdentifier(moduleSpecifier.text, target), identifiers);\n                    return convertedImports([\n                        ts.makeImport(ts.factory.createIdentifier(tmp), /*namedImports*/ undefined, moduleSpecifier, quotePreference),\n                        makeConst(/*modifiers*/ undefined, ts.getSynthesizedDeepClone(name), ts.factory.createIdentifier(tmp)),\n                    ]);\n                }\n                case 78 /* Identifier */:\n                    return convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference);\n                default:\n                    return ts.Debug.assertNever(name, \"Convert to ES6 module got invalid name kind \" + name.kind);\n            }\n        }\n        /**\n         * Convert `import x = require(\"x\").`\n         * Also converts uses like `x.y()` to `y()` and uses a named import.\n         */\n        function convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference) {\n            var nameSymbol = checker.getSymbolAtLocation(name);\n            // Maps from module property name to name actually used. (The same if there isn't shadowing.)\n            var namedBindingsNames = new ts.Map();\n            // True if there is some non-property use like `x()` or `f(x)`.\n            var needDefaultImport = false;\n            var useSitesToUnqualify;\n            for (var _i = 0, _a = identifiers.original.get(name.text); _i < _a.length; _i++) {\n                var use = _a[_i];\n                if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name) {\n                    // This was a use of a different symbol with the same name, due to shadowing. Ignore.\n                    continue;\n                }\n                var parent = use.parent;\n                if (ts.isPropertyAccessExpression(parent)) {\n                    var expression = parent.expression, propertyName = parent.name.text;\n                    ts.Debug.assert(expression === use, \"Didn't expect expression === use\"); // Else shouldn't have been in `collectIdentifiers`\n                    var idName = namedBindingsNames.get(propertyName);\n                    if (idName === undefined) {\n                        idName = makeUniqueName(propertyName, identifiers);\n                        namedBindingsNames.set(propertyName, idName);\n                    }\n                    (useSitesToUnqualify !== null && useSitesToUnqualify !== void 0 ? useSitesToUnqualify : (useSitesToUnqualify = new ts.Map())).set(parent, ts.factory.createIdentifier(idName));\n                }\n                else {\n                    needDefaultImport = true;\n                }\n            }\n            var namedBindings = namedBindingsNames.size === 0 ? undefined : ts.arrayFrom(ts.mapIterator(namedBindingsNames.entries(), function (_a) {\n                var propertyName = _a[0], idName = _a[1];\n                return ts.factory.createImportSpecifier(propertyName === idName ? undefined : ts.factory.createIdentifier(propertyName), ts.factory.createIdentifier(idName));\n            }));\n            if (!namedBindings) {\n                // If it was unused, ensure that we at least import *something*.\n                needDefaultImport = true;\n            }\n            return convertedImports([ts.makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier, quotePreference)], useSitesToUnqualify);\n        }\n        // Identifiers helpers\n        function makeUniqueName(name, identifiers) {\n            while (identifiers.original.has(name) || identifiers.additional.has(name)) {\n                name = \"_\" + name;\n            }\n            identifiers.additional.add(name);\n            return name;\n        }\n        function collectFreeIdentifiers(file) {\n            var map = ts.createMultiMap();\n            forEachFreeIdentifier(file, function (id) { return map.add(id.text, id); });\n            return map;\n        }\n        /**\n         * A free identifier is an identifier that can be accessed through name lookup as a local variable.\n         * In the expression `x.y`, `x` is a free identifier, but `y` is not.\n         */\n        function forEachFreeIdentifier(node, cb) {\n            if (ts.isIdentifier(node) && isFreeIdentifier(node))\n                cb(node);\n            node.forEachChild(function (child) { return forEachFreeIdentifier(child, cb); });\n        }\n        function isFreeIdentifier(node) {\n            var parent = node.parent;\n            switch (parent.kind) {\n                case 201 /* PropertyAccessExpression */:\n                    return parent.name !== node;\n                case 198 /* BindingElement */:\n                    return parent.propertyName !== node;\n                case 265 /* ImportSpecifier */:\n                    return parent.propertyName !== node;\n                default:\n                    return true;\n            }\n        }\n        // Node helpers\n        function functionExpressionToDeclaration(name, additionalModifiers, fn, useSitesToUnqualify) {\n            return ts.factory.createFunctionDeclaration(ts.getSynthesizedDeepClones(fn.decorators), // TODO: GH#19915 Don't think this is even legal.\n            ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.factory.converters.convertToFunctionBlock(replaceImportUseSites(fn.body, useSitesToUnqualify)));\n        }\n        function classExpressionToDeclaration(name, additionalModifiers, cls, useSitesToUnqualify) {\n            return ts.factory.createClassDeclaration(ts.getSynthesizedDeepClones(cls.decorators), // TODO: GH#19915 Don't think this is even legal.\n            ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), replaceImportUseSites(cls.members, useSitesToUnqualify));\n        }\n        function makeSingleImport(localName, propertyName, moduleSpecifier, quotePreference) {\n            return propertyName === \"default\"\n                ? ts.makeImport(ts.factory.createIdentifier(localName), /*namedImports*/ undefined, moduleSpecifier, quotePreference)\n                : ts.makeImport(/*name*/ undefined, [makeImportSpecifier(propertyName, localName)], moduleSpecifier, quotePreference);\n        }\n        function makeImportSpecifier(propertyName, name) {\n            return ts.factory.createImportSpecifier(propertyName !== undefined && propertyName !== name ? ts.factory.createIdentifier(propertyName) : undefined, ts.factory.createIdentifier(name));\n        }\n        function makeConst(modifiers, name, init) {\n            return ts.factory.createVariableStatement(modifiers, ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, /*type*/ undefined, init)], 2 /* Const */));\n        }\n        function makeExportDeclaration(exportSpecifiers, moduleSpecifier) {\n            return ts.factory.createExportDeclaration(\n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, \n            /*isTypeOnly*/ false, exportSpecifiers && ts.factory.createNamedExports(exportSpecifiers), moduleSpecifier === undefined ? undefined : ts.factory.createStringLiteral(moduleSpecifier));\n        }\n        function convertedImports(newImports, useSitesToUnqualify) {\n            return {\n                newImports: newImports,\n                useSitesToUnqualify: useSitesToUnqualify\n            };\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"correctQualifiedNameToIndexedAccessType\";\n        var errorCodes = [ts.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var qualifiedName = getQualifiedName(context.sourceFile, context.span.start);\n                if (!qualifiedName)\n                    return undefined;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, qualifiedName); });\n                var newText = qualifiedName.left.text + \"[\\\"\" + qualifiedName.right.text + \"\\\"]\";\n                return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Rewrite_as_the_indexed_access_type_0, newText], fixId, ts.Diagnostics.Rewrite_all_as_indexed_access_types)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                var q = getQualifiedName(diag.file, diag.start);\n                if (q) {\n                    doChange(changes, diag.file, q);\n                }\n            }); },\n        });\n        function getQualifiedName(sourceFile, pos) {\n            var qualifiedName = ts.findAncestor(ts.getTokenAtPosition(sourceFile, pos), ts.isQualifiedName);\n            ts.Debug.assert(!!qualifiedName, \"Expected position to be owned by a qualified name.\");\n            return ts.isIdentifier(qualifiedName.left) ? qualifiedName : undefined;\n        }\n        function doChange(changeTracker, sourceFile, qualifiedName) {\n            var rightText = qualifiedName.right.text;\n            var replacement = ts.factory.createIndexedAccessTypeNode(ts.factory.createTypeReferenceNode(qualifiedName.left, /*typeArguments*/ undefined), ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(rightText)));\n            changeTracker.replaceNode(sourceFile, qualifiedName, replacement);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var errorCodes = [ts.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type.code];\n        var fixId = \"convertToTypeOnlyExport\";\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return fixSingleExportDeclaration(t, getExportSpecifierForDiagnosticSpan(context.span, context.sourceFile), context); });\n                if (changes.length) {\n                    return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Convert_to_type_only_export, fixId, ts.Diagnostics.Convert_all_re_exported_types_to_type_only_exports)];\n                }\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) {\n                var fixedExportDeclarations = new ts.Map();\n                return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                    var exportSpecifier = getExportSpecifierForDiagnosticSpan(diag, context.sourceFile);\n                    if (exportSpecifier && ts.addToSeen(fixedExportDeclarations, ts.getNodeId(exportSpecifier.parent.parent))) {\n                        fixSingleExportDeclaration(changes, exportSpecifier, context);\n                    }\n                });\n            }\n        });\n        function getExportSpecifierForDiagnosticSpan(span, sourceFile) {\n            return ts.tryCast(ts.getTokenAtPosition(sourceFile, span.start).parent, ts.isExportSpecifier);\n        }\n        function fixSingleExportDeclaration(changes, exportSpecifier, context) {\n            if (!exportSpecifier) {\n                return;\n            }\n            var exportClause = exportSpecifier.parent;\n            var exportDeclaration = exportClause.parent;\n            var typeExportSpecifiers = getTypeExportSpecifiers(exportSpecifier, context);\n            if (typeExportSpecifiers.length === exportClause.elements.length) {\n                changes.insertModifierBefore(context.sourceFile, 149 /* TypeKeyword */, exportClause);\n            }\n            else {\n                var valueExportDeclaration = ts.factory.updateExportDeclaration(exportDeclaration, exportDeclaration.decorators, exportDeclaration.modifiers, \n                /*isTypeOnly*/ false, ts.factory.updateNamedExports(exportClause, ts.filter(exportClause.elements, function (e) { return !ts.contains(typeExportSpecifiers, e); })), exportDeclaration.moduleSpecifier);\n                var typeExportDeclaration = ts.factory.createExportDeclaration(\n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, \n                /*isTypeOnly*/ true, ts.factory.createNamedExports(typeExportSpecifiers), exportDeclaration.moduleSpecifier);\n                changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration, {\n                    leadingTriviaOption: ts.textChanges.LeadingTriviaOption.IncludeAll,\n                    trailingTriviaOption: ts.textChanges.TrailingTriviaOption.Exclude\n                });\n                changes.insertNodeAfter(context.sourceFile, exportDeclaration, typeExportDeclaration);\n            }\n        }\n        function getTypeExportSpecifiers(originExportSpecifier, context) {\n            var exportClause = originExportSpecifier.parent;\n            if (exportClause.elements.length === 1) {\n                return exportClause.elements;\n            }\n            var diagnostics = ts.getDiagnosticsWithinSpan(ts.createTextSpanFromNode(exportClause), context.program.getSemanticDiagnostics(context.sourceFile, context.cancellationToken));\n            return ts.filter(exportClause.elements, function (element) {\n                var _a;\n                return element === originExportSpecifier || ((_a = ts.findDiagnosticForNode(element, diagnostics)) === null || _a === void 0 ? void 0 : _a.code) === errorCodes[0];\n            });\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var errorCodes = [ts.Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code];\n        var fixId = \"convertToTypeOnlyImport\";\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) {\n                    var importDeclaration = getImportDeclarationForDiagnosticSpan(context.span, context.sourceFile);\n                    fixSingleImportDeclaration(t, importDeclaration, context);\n                });\n                if (changes.length) {\n                    return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Convert_to_type_only_import, fixId, ts.Diagnostics.Convert_all_imports_not_used_as_a_value_to_type_only_imports)];\n                }\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) {\n                return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                    var importDeclaration = getImportDeclarationForDiagnosticSpan(diag, context.sourceFile);\n                    fixSingleImportDeclaration(changes, importDeclaration, context);\n                });\n            }\n        });\n        function getImportDeclarationForDiagnosticSpan(span, sourceFile) {\n            return ts.tryCast(ts.getTokenAtPosition(sourceFile, span.start).parent, ts.isImportDeclaration);\n        }\n        function fixSingleImportDeclaration(changes, importDeclaration, context) {\n            if (!(importDeclaration === null || importDeclaration === void 0 ? void 0 : importDeclaration.importClause)) {\n                return;\n            }\n            var importClause = importDeclaration.importClause;\n            // `changes.insertModifierBefore` produces a range that might overlap further changes\n            changes.insertText(context.sourceFile, importDeclaration.getStart() + \"import\".length, \" type\");\n            // `import type foo, { Bar }` is not allowed, so move `foo` to new declaration\n            if (importClause.name && importClause.namedBindings) {\n                changes.deleteNodeRangeExcludingEnd(context.sourceFile, importClause.name, importDeclaration.importClause.namedBindings);\n                changes.insertNodeBefore(context.sourceFile, importDeclaration, ts.factory.updateImportDeclaration(importDeclaration, \n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, ts.factory.createImportClause(\n                /*isTypeOnly*/ true, importClause.name, \n                /*namedBindings*/ undefined), importDeclaration.moduleSpecifier));\n            }\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"convertLiteralTypeToMappedType\";\n        var errorCodes = [ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, span = context.span;\n                var info = getInfo(sourceFile, span.start);\n                if (!info) {\n                    return undefined;\n                }\n                var name = info.name, constraint = info.constraint;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info); });\n                return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Convert_0_to_1_in_0, constraint, name], fixId, ts.Diagnostics.Convert_all_type_literals_to_mapped_type)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                var info = getInfo(diag.file, diag.start);\n                if (info) {\n                    doChange(changes, diag.file, info);\n                }\n            }); }\n        });\n        function getInfo(sourceFile, pos) {\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            if (ts.isIdentifier(token)) {\n                var propertySignature = ts.cast(token.parent.parent, ts.isPropertySignature);\n                var propertyName = token.getText(sourceFile);\n                return {\n                    container: ts.cast(propertySignature.parent, ts.isTypeLiteralNode),\n                    typeNode: propertySignature.type,\n                    constraint: propertyName,\n                    name: propertyName === \"K\" ? \"P\" : \"K\",\n                };\n            }\n            return undefined;\n        }\n        function doChange(changes, sourceFile, _a) {\n            var container = _a.container, typeNode = _a.typeNode, constraint = _a.constraint, name = _a.name;\n            changes.replaceNode(sourceFile, container, ts.factory.createMappedTypeNode(/*readonlyToken*/ undefined, ts.factory.createTypeParameterDeclaration(name, ts.factory.createTypeReferenceNode(constraint)), /*nameType*/ undefined, /*questionToken*/ undefined, typeNode));\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var errorCodes = [\n            ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code,\n            ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code\n        ];\n        var fixId = \"fixClassIncorrectlyImplementsInterface\"; // TODO: share a group with fixClassDoesntImplementInheritedAbstractMember?\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, span = context.span;\n                var classDeclaration = getClass(sourceFile, span.start);\n                return ts.mapDefined(ts.getEffectiveImplementsTypeNodes(classDeclaration), function (implementedTypeNode) {\n                    var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingDeclarations(context, implementedTypeNode, sourceFile, classDeclaration, t, context.preferences); });\n                    return changes.length === 0 ? undefined : codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Implement_interface_0, implementedTypeNode.getText(sourceFile)], fixId, ts.Diagnostics.Implement_all_unimplemented_interfaces);\n                });\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) {\n                var seenClassDeclarations = new ts.Map();\n                return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                    var classDeclaration = getClass(diag.file, diag.start);\n                    if (ts.addToSeen(seenClassDeclarations, ts.getNodeId(classDeclaration))) {\n                        for (var _i = 0, _a = ts.getEffectiveImplementsTypeNodes(classDeclaration); _i < _a.length; _i++) {\n                            var implementedTypeNode = _a[_i];\n                            addMissingDeclarations(context, implementedTypeNode, diag.file, classDeclaration, changes, context.preferences);\n                        }\n                    }\n                });\n            },\n        });\n        function getClass(sourceFile, pos) {\n            return ts.Debug.checkDefined(ts.getContainingClass(ts.getTokenAtPosition(sourceFile, pos)), \"There should be a containing class\");\n        }\n        function symbolPointsToNonPrivateMember(symbol) {\n            return !symbol.valueDeclaration || !(ts.getEffectiveModifierFlags(symbol.valueDeclaration) & 8 /* Private */);\n        }\n        function addMissingDeclarations(context, implementedTypeNode, sourceFile, classDeclaration, changeTracker, preferences) {\n            var checker = context.program.getTypeChecker();\n            var maybeHeritageClauseSymbol = getHeritageClauseSymbolTable(classDeclaration, checker);\n            // Note that this is ultimately derived from a map indexed by symbol names,\n            // so duplicates cannot occur.\n            var implementedType = checker.getTypeAtLocation(implementedTypeNode);\n            var implementedTypeSymbols = checker.getPropertiesOfType(implementedType);\n            var nonPrivateAndNotExistedInHeritageClauseMembers = implementedTypeSymbols.filter(ts.and(symbolPointsToNonPrivateMember, function (symbol) { return !maybeHeritageClauseSymbol.has(symbol.escapedName); }));\n            var classType = checker.getTypeAtLocation(classDeclaration);\n            var constructor = ts.find(classDeclaration.members, function (m) { return ts.isConstructorDeclaration(m); });\n            if (!classType.getNumberIndexType()) {\n                createMissingIndexSignatureDeclaration(implementedType, 1 /* Number */);\n            }\n            if (!classType.getStringIndexType()) {\n                createMissingIndexSignatureDeclaration(implementedType, 0 /* String */);\n            }\n            var importAdder = codefix.createImportAdder(sourceFile, context.program, preferences, context.host);\n            codefix.createMissingMemberNodes(classDeclaration, nonPrivateAndNotExistedInHeritageClauseMembers, sourceFile, context, preferences, importAdder, function (member) { return insertInterfaceMemberNode(sourceFile, classDeclaration, member); });\n            importAdder.writeFixes(changeTracker);\n            function createMissingIndexSignatureDeclaration(type, kind) {\n                var indexInfoOfKind = checker.getIndexInfoOfType(type, kind);\n                if (indexInfoOfKind) {\n                    insertInterfaceMemberNode(sourceFile, classDeclaration, checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration, /*flags*/ undefined, codefix.getNoopSymbolTrackerWithResolver(context)));\n                }\n            }\n            // Either adds the node at the top of the class, or if there's a constructor right after that\n            function insertInterfaceMemberNode(sourceFile, cls, newElement) {\n                if (constructor) {\n                    changeTracker.insertNodeAfter(sourceFile, constructor, newElement);\n                }\n                else {\n                    changeTracker.insertNodeAtClassStart(sourceFile, cls, newElement);\n                }\n            }\n        }\n        function getHeritageClauseSymbolTable(classDeclaration, checker) {\n            var heritageClauseNode = ts.getEffectiveBaseTypeNode(classDeclaration);\n            if (!heritageClauseNode)\n                return ts.createSymbolTable();\n            var heritageClauseType = checker.getTypeAtLocation(heritageClauseNode);\n            var heritageClauseTypeSymbols = checker.getPropertiesOfType(heritageClauseType);\n            return ts.createSymbolTable(heritageClauseTypeSymbols.filter(symbolPointsToNonPrivateMember));\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        codefix.importFixName = \"import\";\n        var importFixId = \"fixMissingImport\";\n        var errorCodes = [\n            ts.Diagnostics.Cannot_find_name_0.code,\n            ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code,\n            ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,\n            ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,\n            ts.Diagnostics.Cannot_find_namespace_0.code,\n            ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code,\n            ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here.code,\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var errorCode = context.errorCode, preferences = context.preferences, sourceFile = context.sourceFile, span = context.span;\n                var info = getFixesInfo(context, errorCode, span.start, /*useAutoImportProvider*/ true);\n                if (!info)\n                    return undefined;\n                var fixes = info.fixes, symbolName = info.symbolName;\n                var quotePreference = ts.getQuotePreference(sourceFile, preferences);\n                return fixes.map(function (fix) { return codeActionForFix(context, sourceFile, symbolName, fix, quotePreference); });\n            },\n            fixIds: [importFixId],\n            getAllCodeActions: function (context) {\n                var sourceFile = context.sourceFile, program = context.program, preferences = context.preferences, host = context.host;\n                var importAdder = createImportAdderWorker(sourceFile, program, /*useAutoImportProvider*/ true, preferences, host);\n                codefix.eachDiagnostic(context, errorCodes, function (diag) { return importAdder.addImportFromDiagnostic(diag, context); });\n                return codefix.createCombinedCodeActions(ts.textChanges.ChangeTracker.with(context, importAdder.writeFixes));\n            },\n        });\n        function createImportAdder(sourceFile, program, preferences, host) {\n            return createImportAdderWorker(sourceFile, program, /*useAutoImportProvider*/ false, preferences, host);\n        }\n        codefix.createImportAdder = createImportAdder;\n        function createImportAdderWorker(sourceFile, program, useAutoImportProvider, preferences, host) {\n            var compilerOptions = program.getCompilerOptions();\n            // Namespace fixes don't conflict, so just build a list.\n            var addToNamespace = [];\n            var importType = [];\n            // Keys are import clause node IDs.\n            var addToExisting = new ts.Map();\n            var newImports = new ts.Map();\n            return { addImportFromDiagnostic: addImportFromDiagnostic, addImportFromExportedSymbol: addImportFromExportedSymbol, writeFixes: writeFixes };\n            function addImportFromDiagnostic(diagnostic, context) {\n                var info = getFixesInfo(context, diagnostic.code, diagnostic.start, useAutoImportProvider);\n                if (!info || !info.fixes.length)\n                    return;\n                addImport(info);\n            }\n            function addImportFromExportedSymbol(exportedSymbol, usageIsTypeOnly) {\n                var moduleSymbol = ts.Debug.checkDefined(exportedSymbol.parent);\n                var symbolName = ts.getNameForExportedSymbol(exportedSymbol, ts.getEmitScriptTarget(compilerOptions));\n                var checker = program.getTypeChecker();\n                var symbol = checker.getMergedSymbol(ts.skipAlias(exportedSymbol, checker));\n                var exportInfos = getAllReExportingModules(sourceFile, symbol, moduleSymbol, symbolName, host, program, useAutoImportProvider);\n                var preferTypeOnlyImport = !!usageIsTypeOnly && compilerOptions.importsNotUsedAsValues === 2 /* Error */;\n                var useRequire = shouldUseRequire(sourceFile, program);\n                var fix = getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, /*position*/ undefined, preferTypeOnlyImport, useRequire, host, preferences);\n                addImport({ fixes: [fix], symbolName: symbolName });\n            }\n            function addImport(info) {\n                var fixes = info.fixes, symbolName = info.symbolName;\n                var fix = ts.first(fixes);\n                switch (fix.kind) {\n                    case 0 /* UseNamespace */:\n                        addToNamespace.push(fix);\n                        break;\n                    case 1 /* ImportType */:\n                        importType.push(fix);\n                        break;\n                    case 2 /* AddToExisting */: {\n                        var importClauseOrBindingPattern = fix.importClauseOrBindingPattern, importKind = fix.importKind, canUseTypeOnlyImport = fix.canUseTypeOnlyImport;\n                        var key = String(ts.getNodeId(importClauseOrBindingPattern));\n                        var entry = addToExisting.get(key);\n                        if (!entry) {\n                            addToExisting.set(key, entry = { importClauseOrBindingPattern: importClauseOrBindingPattern, defaultImport: undefined, namedImports: [], canUseTypeOnlyImport: canUseTypeOnlyImport });\n                        }\n                        if (importKind === 0 /* Named */) {\n                            ts.pushIfUnique(entry.namedImports, symbolName);\n                        }\n                        else {\n                            ts.Debug.assert(entry.defaultImport === undefined || entry.defaultImport === symbolName, \"(Add to Existing) Default import should be missing or match symbolName\");\n                            entry.defaultImport = symbolName;\n                        }\n                        break;\n                    }\n                    case 3 /* AddNew */: {\n                        var moduleSpecifier = fix.moduleSpecifier, importKind = fix.importKind, useRequire = fix.useRequire, typeOnly = fix.typeOnly;\n                        var entry = newImports.get(moduleSpecifier);\n                        if (!entry) {\n                            newImports.set(moduleSpecifier, entry = { namedImports: [], namespaceLikeImport: undefined, typeOnly: typeOnly, useRequire: useRequire });\n                        }\n                        else {\n                            // An import clause can only be type-only if every import fix contributing to it can be type-only.\n                            entry.typeOnly = entry.typeOnly && typeOnly;\n                        }\n                        switch (importKind) {\n                            case 1 /* Default */:\n                                ts.Debug.assert(entry.defaultImport === undefined || entry.defaultImport === symbolName, \"(Add new) Default import should be missing or match symbolName\");\n                                entry.defaultImport = symbolName;\n                                break;\n                            case 0 /* Named */:\n                                ts.pushIfUnique(entry.namedImports || (entry.namedImports = []), symbolName);\n                                break;\n                            case 3 /* CommonJS */:\n                            case 2 /* Namespace */:\n                                ts.Debug.assert(entry.namespaceLikeImport === undefined || entry.namespaceLikeImport.name === symbolName, \"Namespacelike import shoudl be missing or match symbolName\");\n                                entry.namespaceLikeImport = { importKind: importKind, name: symbolName };\n                                break;\n                        }\n                        break;\n                    }\n                    default:\n                        ts.Debug.assertNever(fix, \"fix wasn't never - got kind \" + fix.kind);\n                }\n            }\n            function writeFixes(changeTracker) {\n                var quotePreference = ts.getQuotePreference(sourceFile, preferences);\n                for (var _i = 0, addToNamespace_1 = addToNamespace; _i < addToNamespace_1.length; _i++) {\n                    var fix = addToNamespace_1[_i];\n                    addNamespaceQualifier(changeTracker, sourceFile, fix);\n                }\n                for (var _a = 0, importType_1 = importType; _a < importType_1.length; _a++) {\n                    var fix = importType_1[_a];\n                    addImportType(changeTracker, sourceFile, fix, quotePreference);\n                }\n                addToExisting.forEach(function (_a) {\n                    var importClauseOrBindingPattern = _a.importClauseOrBindingPattern, defaultImport = _a.defaultImport, namedImports = _a.namedImports, canUseTypeOnlyImport = _a.canUseTypeOnlyImport;\n                    doAddExistingFix(changeTracker, sourceFile, importClauseOrBindingPattern, defaultImport, namedImports, canUseTypeOnlyImport);\n                });\n                var newDeclarations;\n                newImports.forEach(function (_a, moduleSpecifier) {\n                    var useRequire = _a.useRequire, imports = __rest(_a, [\"useRequire\"]);\n                    var getDeclarations = useRequire ? getNewRequires : getNewImports;\n                    newDeclarations = ts.combine(newDeclarations, getDeclarations(moduleSpecifier, quotePreference, imports));\n                });\n                if (newDeclarations) {\n                    ts.insertImports(changeTracker, sourceFile, newDeclarations, /*blankLineBetween*/ true);\n                }\n            }\n        }\n        // Sorted with the preferred fix coming first.\n        var ImportFixKind;\n        (function (ImportFixKind) {\n            ImportFixKind[ImportFixKind[\"UseNamespace\"] = 0] = \"UseNamespace\";\n            ImportFixKind[ImportFixKind[\"ImportType\"] = 1] = \"ImportType\";\n            ImportFixKind[ImportFixKind[\"AddToExisting\"] = 2] = \"AddToExisting\";\n            ImportFixKind[ImportFixKind[\"AddNew\"] = 3] = \"AddNew\";\n        })(ImportFixKind || (ImportFixKind = {}));\n        var ImportKind;\n        (function (ImportKind) {\n            ImportKind[ImportKind[\"Named\"] = 0] = \"Named\";\n            ImportKind[ImportKind[\"Default\"] = 1] = \"Default\";\n            ImportKind[ImportKind[\"Namespace\"] = 2] = \"Namespace\";\n            ImportKind[ImportKind[\"CommonJS\"] = 3] = \"CommonJS\";\n        })(ImportKind || (ImportKind = {}));\n        function getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, symbolName, host, program, formatContext, position, preferences) {\n            var compilerOptions = program.getCompilerOptions();\n            var exportInfos = ts.pathIsBareSpecifier(ts.stripQuotes(moduleSymbol.name))\n                ? [getSymbolExportInfoForSymbol(exportedSymbol, moduleSymbol, sourceFile, program, host)]\n                : getAllReExportingModules(sourceFile, exportedSymbol, moduleSymbol, symbolName, host, program, /*useAutoImportProvider*/ true);\n            var useRequire = shouldUseRequire(sourceFile, program);\n            var preferTypeOnlyImport = compilerOptions.importsNotUsedAsValues === 2 /* Error */ && !ts.isSourceFileJS(sourceFile) && ts.isValidTypeOnlyAliasUseSite(ts.getTokenAtPosition(sourceFile, position));\n            var moduleSpecifier = getBestFix(getNewImportInfos(program, sourceFile, position, preferTypeOnlyImport, useRequire, exportInfos, host, preferences), sourceFile, program, host).moduleSpecifier;\n            var fix = getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, position, preferTypeOnlyImport, useRequire, host, preferences);\n            return { moduleSpecifier: moduleSpecifier, codeAction: codeFixActionToCodeAction(codeActionForFix({ host: host, formatContext: formatContext, preferences: preferences }, sourceFile, symbolName, fix, ts.getQuotePreference(sourceFile, preferences))) };\n        }\n        codefix.getImportCompletionAction = getImportCompletionAction;\n        function getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, position, preferTypeOnlyImport, useRequire, host, preferences) {\n            ts.Debug.assert(exportInfos.some(function (info) { return info.moduleSymbol === moduleSymbol; }), \"Some exportInfo should match the specified moduleSymbol\");\n            // We sort the best codefixes first, so taking `first` is best.\n            return getBestFix(getFixForImport(exportInfos, symbolName, position, preferTypeOnlyImport, useRequire, program, sourceFile, host, preferences), sourceFile, program, host);\n        }\n        function codeFixActionToCodeAction(_a) {\n            var description = _a.description, changes = _a.changes, commands = _a.commands;\n            return { description: description, changes: changes, commands: commands };\n        }\n        function getSymbolExportInfoForSymbol(symbol, moduleSymbol, importingFile, program, host) {\n            var _a, _b;\n            var compilerOptions = program.getCompilerOptions();\n            var mainProgramInfo = getInfoWithChecker(program.getTypeChecker());\n            if (mainProgramInfo) {\n                return mainProgramInfo;\n            }\n            var autoImportProvider = (_b = (_a = host.getPackageJsonAutoImportProvider) === null || _a === void 0 ? void 0 : _a.call(host)) === null || _b === void 0 ? void 0 : _b.getTypeChecker();\n            return ts.Debug.checkDefined(autoImportProvider && getInfoWithChecker(autoImportProvider), \"Could not find symbol in specified module for code actions\");\n            function getInfoWithChecker(checker) {\n                var defaultInfo = getDefaultLikeExportInfo(importingFile, moduleSymbol, checker, compilerOptions);\n                if (defaultInfo && ts.skipAlias(defaultInfo.symbol, checker) === symbol) {\n                    return { moduleSymbol: moduleSymbol, importKind: defaultInfo.kind, exportedSymbolIsTypeOnly: isTypeOnlySymbol(symbol, checker) };\n                }\n                var named = checker.tryGetMemberInModuleExportsAndProperties(symbol.name, moduleSymbol);\n                if (named && ts.skipAlias(named, checker) === symbol) {\n                    return { moduleSymbol: moduleSymbol, importKind: 0 /* Named */, exportedSymbolIsTypeOnly: isTypeOnlySymbol(symbol, checker) };\n                }\n            }\n        }\n        function getAllReExportingModules(importingFile, exportedSymbol, exportingModuleSymbol, symbolName, host, program, useAutoImportProvider) {\n            var result = [];\n            var compilerOptions = program.getCompilerOptions();\n            forEachExternalModuleToImportFrom(program, host, importingFile, /*filterByPackageJson*/ false, useAutoImportProvider, function (moduleSymbol, moduleFile, program) {\n                var checker = program.getTypeChecker();\n                // Don't import from a re-export when looking \"up\" like to `./index` or `../index`.\n                if (moduleFile && moduleSymbol !== exportingModuleSymbol && ts.startsWith(importingFile.fileName, ts.getDirectoryPath(moduleFile.fileName))) {\n                    return;\n                }\n                var defaultInfo = getDefaultLikeExportInfo(importingFile, moduleSymbol, checker, compilerOptions);\n                if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && ts.skipAlias(defaultInfo.symbol, checker) === exportedSymbol) {\n                    result.push({ moduleSymbol: moduleSymbol, importKind: defaultInfo.kind, exportedSymbolIsTypeOnly: isTypeOnlySymbol(defaultInfo.symbol, checker) });\n                }\n                for (var _i = 0, _a = checker.getExportsAndPropertiesOfModule(moduleSymbol); _i < _a.length; _i++) {\n                    var exported = _a[_i];\n                    if (exported.name === symbolName && ts.skipAlias(exported, checker) === exportedSymbol) {\n                        result.push({ moduleSymbol: moduleSymbol, importKind: 0 /* Named */, exportedSymbolIsTypeOnly: isTypeOnlySymbol(exported, checker) });\n                    }\n                }\n            });\n            return result;\n        }\n        function isTypeOnlySymbol(s, checker) {\n            return !(ts.skipAlias(s, checker).flags & 111551 /* Value */);\n        }\n        function isTypeOnlyPosition(sourceFile, position) {\n            return ts.isValidTypeOnlyAliasUseSite(ts.getTokenAtPosition(sourceFile, position));\n        }\n        function getFixForImport(exportInfos, symbolName, \n        /** undefined only for missing JSX namespace */\n        position, preferTypeOnlyImport, useRequire, program, sourceFile, host, preferences) {\n            var checker = program.getTypeChecker();\n            var existingImports = ts.flatMap(exportInfos, function (info) { return getExistingImportDeclarations(info, checker, sourceFile); });\n            var useNamespace = position === undefined ? undefined : tryUseExistingNamespaceImport(existingImports, symbolName, position, checker);\n            var addToExisting = tryAddToExistingImport(existingImports, position !== undefined && isTypeOnlyPosition(sourceFile, position));\n            // Don't bother providing an action to add a new import if we can add to an existing one.\n            var addImport = addToExisting ? [addToExisting] : getFixesForAddImport(exportInfos, existingImports, program, sourceFile, position, preferTypeOnlyImport, useRequire, host, preferences);\n            return __spreadArray(__spreadArray([], (useNamespace ? [useNamespace] : ts.emptyArray)), addImport);\n        }\n        function tryUseExistingNamespaceImport(existingImports, symbolName, position, checker) {\n            // It is possible that multiple import statements with the same specifier exist in the file.\n            // e.g.\n            //\n            //     import * as ns from \"foo\";\n            //     import { member1, member2 } from \"foo\";\n            //\n            //     member3/**/ <-- cusor here\n            //\n            // in this case we should provie 2 actions:\n            //     1. change \"member3\" to \"ns.member3\"\n            //     2. add \"member3\" to the second import statement's import list\n            // and it is up to the user to decide which one fits best.\n            return ts.firstDefined(existingImports, function (_a) {\n                var declaration = _a.declaration;\n                var namespacePrefix = getNamespaceLikeImportText(declaration);\n                if (namespacePrefix) {\n                    var moduleSymbol = getTargetModuleFromNamespaceLikeImport(declaration, checker);\n                    if (moduleSymbol && moduleSymbol.exports.has(ts.escapeLeadingUnderscores(symbolName))) {\n                        return { kind: 0 /* UseNamespace */, namespacePrefix: namespacePrefix, position: position };\n                    }\n                }\n            });\n        }\n        function getTargetModuleFromNamespaceLikeImport(declaration, checker) {\n            var _a;\n            switch (declaration.kind) {\n                case 249 /* VariableDeclaration */:\n                    return checker.resolveExternalModuleName(declaration.initializer.arguments[0]);\n                case 260 /* ImportEqualsDeclaration */:\n                    return checker.getAliasedSymbol(declaration.symbol);\n                case 261 /* ImportDeclaration */:\n                    var namespaceImport = ts.tryCast((_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings, ts.isNamespaceImport);\n                    return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol);\n                default:\n                    return ts.Debug.assertNever(declaration);\n            }\n        }\n        function getNamespaceLikeImportText(declaration) {\n            var _a, _b, _c;\n            switch (declaration.kind) {\n                case 249 /* VariableDeclaration */:\n                    return (_a = ts.tryCast(declaration.name, ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text;\n                case 260 /* ImportEqualsDeclaration */:\n                    return declaration.name.text;\n                case 261 /* ImportDeclaration */:\n                    return (_c = ts.tryCast((_b = declaration.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings, ts.isNamespaceImport)) === null || _c === void 0 ? void 0 : _c.name.text;\n                default:\n                    return ts.Debug.assertNever(declaration);\n            }\n        }\n        function tryAddToExistingImport(existingImports, canUseTypeOnlyImport) {\n            return ts.firstDefined(existingImports, function (_a) {\n                var declaration = _a.declaration, importKind = _a.importKind;\n                if (declaration.kind === 260 /* ImportEqualsDeclaration */)\n                    return undefined;\n                if (declaration.kind === 249 /* VariableDeclaration */) {\n                    return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 196 /* ObjectBindingPattern */\n                        ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind: importKind, moduleSpecifier: declaration.initializer.arguments[0].text, canUseTypeOnlyImport: false }\n                        : undefined;\n                }\n                var importClause = declaration.importClause;\n                if (!importClause)\n                    return undefined;\n                var name = importClause.name, namedBindings = importClause.namedBindings;\n                return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 264 /* NamedImports */)\n                    ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: importClause, importKind: importKind, moduleSpecifier: declaration.moduleSpecifier.getText(), canUseTypeOnlyImport: canUseTypeOnlyImport }\n                    : undefined;\n            });\n        }\n        function getExistingImportDeclarations(_a, checker, sourceFile) {\n            var moduleSymbol = _a.moduleSymbol, importKind = _a.importKind, exportedSymbolIsTypeOnly = _a.exportedSymbolIsTypeOnly;\n            // Can't use an es6 import for a type in JS.\n            return exportedSymbolIsTypeOnly && ts.isSourceFileJS(sourceFile) ? ts.emptyArray : ts.mapDefined(sourceFile.imports, function (moduleSpecifier) {\n                var i = ts.importFromModuleSpecifier(moduleSpecifier);\n                if (ts.isRequireVariableDeclaration(i.parent, /*requireStringLiteralLikeArgument*/ true)) {\n                    return checker.resolveExternalModuleName(moduleSpecifier) === moduleSymbol ? { declaration: i.parent, importKind: importKind } : undefined;\n                }\n                if (i.kind === 261 /* ImportDeclaration */ || i.kind === 260 /* ImportEqualsDeclaration */) {\n                    return checker.getSymbolAtLocation(moduleSpecifier) === moduleSymbol ? { declaration: i, importKind: importKind } : undefined;\n                }\n            });\n        }\n        function shouldUseRequire(sourceFile, program) {\n            // 1. TypeScript files don't use require variable declarations\n            if (!ts.isSourceFileJS(sourceFile)) {\n                return false;\n            }\n            // 2. If the current source file is unambiguously CJS or ESM, go with that\n            if (sourceFile.commonJsModuleIndicator && !sourceFile.externalModuleIndicator)\n                return true;\n            if (sourceFile.externalModuleIndicator && !sourceFile.commonJsModuleIndicator)\n                return false;\n            // 3. If there's a tsconfig/jsconfig, use its module setting\n            var compilerOptions = program.getCompilerOptions();\n            if (compilerOptions.configFile) {\n                return ts.getEmitModuleKind(compilerOptions) < ts.ModuleKind.ES2015;\n            }\n            // 4. Match the first other JS file in the program that's unambiguously CJS or ESM\n            for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {\n                var otherFile = _a[_i];\n                if (otherFile === sourceFile || !ts.isSourceFileJS(otherFile) || program.isSourceFileFromExternalLibrary(otherFile))\n                    continue;\n                if (otherFile.commonJsModuleIndicator && !otherFile.externalModuleIndicator)\n                    return true;\n                if (otherFile.externalModuleIndicator && !otherFile.commonJsModuleIndicator)\n                    return false;\n            }\n            // 5. Literally nothing to go on\n            return true;\n        }\n        function getNewImportInfos(program, sourceFile, position, preferTypeOnlyImport, useRequire, moduleSymbols, host, preferences) {\n            var isJs = ts.isSourceFileJS(sourceFile);\n            var compilerOptions = program.getCompilerOptions();\n            return ts.flatMap(moduleSymbols, function (_a) {\n                var moduleSymbol = _a.moduleSymbol, importKind = _a.importKind, exportedSymbolIsTypeOnly = _a.exportedSymbolIsTypeOnly;\n                return ts.moduleSpecifiers.getModuleSpecifiers(moduleSymbol, program.getTypeChecker(), compilerOptions, sourceFile, ts.createModuleSpecifierResolutionHost(program, host), preferences)\n                    .map(function (moduleSpecifier) {\n                    // `position` should only be undefined at a missing jsx namespace, in which case we shouldn't be looking for pure types.\n                    return exportedSymbolIsTypeOnly && isJs\n                        ? { kind: 1 /* ImportType */, moduleSpecifier: moduleSpecifier, position: ts.Debug.checkDefined(position, \"position should be defined\") }\n                        : { kind: 3 /* AddNew */, moduleSpecifier: moduleSpecifier, importKind: importKind, useRequire: useRequire, typeOnly: preferTypeOnlyImport };\n                });\n            });\n        }\n        function getFixesForAddImport(exportInfos, existingImports, program, sourceFile, position, preferTypeOnlyImport, useRequire, host, preferences) {\n            var existingDeclaration = ts.firstDefined(existingImports, function (info) { return newImportInfoFromExistingSpecifier(info, preferTypeOnlyImport, useRequire); });\n            return existingDeclaration ? [existingDeclaration] : getNewImportInfos(program, sourceFile, position, preferTypeOnlyImport, useRequire, exportInfos, host, preferences);\n        }\n        function newImportInfoFromExistingSpecifier(_a, preferTypeOnlyImport, useRequire) {\n            var declaration = _a.declaration, importKind = _a.importKind;\n            var moduleSpecifier = declaration.kind === 261 /* ImportDeclaration */ ? declaration.moduleSpecifier :\n                declaration.kind === 249 /* VariableDeclaration */ ? declaration.initializer.arguments[0] :\n                    declaration.moduleReference.kind === 272 /* ExternalModuleReference */ ? declaration.moduleReference.expression :\n                        undefined;\n            return moduleSpecifier && ts.isStringLiteral(moduleSpecifier)\n                ? { kind: 3 /* AddNew */, moduleSpecifier: moduleSpecifier.text, importKind: importKind, typeOnly: preferTypeOnlyImport, useRequire: useRequire }\n                : undefined;\n        }\n        function getFixesInfo(context, errorCode, pos, useAutoImportProvider) {\n            var symbolToken = ts.getTokenAtPosition(context.sourceFile, pos);\n            var info = errorCode === ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code\n                ? getFixesInfoForUMDImport(context, symbolToken)\n                : ts.isIdentifier(symbolToken) ? getFixesInfoForNonUMDImport(context, symbolToken, useAutoImportProvider) : undefined;\n            return info && __assign(__assign({}, info), { fixes: sortFixes(info.fixes, context.sourceFile, context.program, context.host) });\n        }\n        function sortFixes(fixes, sourceFile, program, host) {\n            var allowsImportingSpecifier = createAutoImportFilter(sourceFile, program, host).allowsImportingSpecifier;\n            return ts.sort(fixes, function (a, b) { return ts.compareValues(a.kind, b.kind) || compareModuleSpecifiers(a, b, allowsImportingSpecifier); });\n        }\n        function getBestFix(fixes, sourceFile, program, host) {\n            // These will always be placed first if available, and are better than other kinds\n            if (fixes[0].kind === 0 /* UseNamespace */ || fixes[0].kind === 2 /* AddToExisting */) {\n                return fixes[0];\n            }\n            var allowsImportingSpecifier = createAutoImportFilter(sourceFile, program, host).allowsImportingSpecifier;\n            return fixes.reduce(function (best, fix) {\n                return compareModuleSpecifiers(fix, best, allowsImportingSpecifier) === -1 /* LessThan */ ? fix : best;\n            });\n        }\n        function compareModuleSpecifiers(a, b, allowsImportingSpecifier) {\n            if (a.kind !== 0 /* UseNamespace */ && b.kind !== 0 /* UseNamespace */) {\n                return ts.compareBooleans(allowsImportingSpecifier(a.moduleSpecifier), allowsImportingSpecifier(b.moduleSpecifier))\n                    || ts.compareNumberOfDirectorySeparators(a.moduleSpecifier, b.moduleSpecifier);\n            }\n            return 0 /* EqualTo */;\n        }\n        function getFixesInfoForUMDImport(_a, token) {\n            var sourceFile = _a.sourceFile, program = _a.program, host = _a.host, preferences = _a.preferences;\n            var checker = program.getTypeChecker();\n            var umdSymbol = getUmdSymbol(token, checker);\n            if (!umdSymbol)\n                return undefined;\n            var symbol = checker.getAliasedSymbol(umdSymbol);\n            var symbolName = umdSymbol.name;\n            var exportInfos = [{ moduleSymbol: symbol, importKind: getUmdImportKind(sourceFile, program.getCompilerOptions()), exportedSymbolIsTypeOnly: false }];\n            var useRequire = shouldUseRequire(sourceFile, program);\n            var fixes = getFixForImport(exportInfos, symbolName, ts.isIdentifier(token) ? token.getStart(sourceFile) : undefined, /*preferTypeOnlyImport*/ false, useRequire, program, sourceFile, host, preferences);\n            return { fixes: fixes, symbolName: symbolName };\n        }\n        function getUmdSymbol(token, checker) {\n            // try the identifier to see if it is the umd symbol\n            var umdSymbol = ts.isIdentifier(token) ? checker.getSymbolAtLocation(token) : undefined;\n            if (ts.isUMDExportSymbol(umdSymbol))\n                return umdSymbol;\n            // The error wasn't for the symbolAtLocation, it was for the JSX tag itself, which needs access to e.g. `React`.\n            var parent = token.parent;\n            return (ts.isJsxOpeningLikeElement(parent) && parent.tagName === token) || ts.isJsxOpeningFragment(parent)\n                ? ts.tryCast(checker.resolveName(checker.getJsxNamespace(parent), ts.isJsxOpeningLikeElement(parent) ? token : parent, 111551 /* Value */, /*excludeGlobals*/ false), ts.isUMDExportSymbol)\n                : undefined;\n        }\n        function getUmdImportKind(importingFile, compilerOptions) {\n            // Import a synthetic `default` if enabled.\n            if (ts.getAllowSyntheticDefaultImports(compilerOptions)) {\n                return 1 /* Default */;\n            }\n            // When a synthetic `default` is unavailable, use `import..require` if the module kind supports it.\n            var moduleKind = ts.getEmitModuleKind(compilerOptions);\n            switch (moduleKind) {\n                case ts.ModuleKind.AMD:\n                case ts.ModuleKind.CommonJS:\n                case ts.ModuleKind.UMD:\n                    if (ts.isInJSFile(importingFile)) {\n                        return ts.isExternalModule(importingFile) ? 2 /* Namespace */ : 3 /* CommonJS */;\n                    }\n                    return 3 /* CommonJS */;\n                case ts.ModuleKind.System:\n                case ts.ModuleKind.ES2015:\n                case ts.ModuleKind.ES2020:\n                case ts.ModuleKind.ESNext:\n                case ts.ModuleKind.None:\n                    // Fall back to the `import * as ns` style import.\n                    return 2 /* Namespace */;\n                default:\n                    return ts.Debug.assertNever(moduleKind, \"Unexpected moduleKind \" + moduleKind);\n            }\n        }\n        function getFixesInfoForNonUMDImport(_a, symbolToken, useAutoImportProvider) {\n            var sourceFile = _a.sourceFile, program = _a.program, cancellationToken = _a.cancellationToken, host = _a.host, preferences = _a.preferences;\n            var checker = program.getTypeChecker();\n            var symbolName = getSymbolName(sourceFile, checker, symbolToken);\n            // \"default\" is a keyword and not a legal identifier for the import, so we don't expect it here\n            ts.Debug.assert(symbolName !== \"default\" /* Default */, \"'default' isn't a legal identifier and couldn't occur here\");\n            var compilerOptions = program.getCompilerOptions();\n            var preferTypeOnlyImport = compilerOptions.importsNotUsedAsValues === 2 /* Error */ && ts.isValidTypeOnlyAliasUseSite(symbolToken);\n            var useRequire = shouldUseRequire(sourceFile, program);\n            var exportInfos = getExportInfos(symbolName, ts.getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host);\n            var fixes = ts.arrayFrom(ts.flatMapIterator(exportInfos.entries(), function (_a) {\n                var _ = _a[0], exportInfos = _a[1];\n                return getFixForImport(exportInfos, symbolName, symbolToken.getStart(sourceFile), preferTypeOnlyImport, useRequire, program, sourceFile, host, preferences);\n            }));\n            return { fixes: fixes, symbolName: symbolName };\n        }\n        function getSymbolName(sourceFile, checker, symbolToken) {\n            var parent = symbolToken.parent;\n            if ((ts.isJsxOpeningLikeElement(parent) || ts.isJsxClosingElement(parent)) && parent.tagName === symbolToken) {\n                var jsxNamespace = checker.getJsxNamespace(sourceFile);\n                if (ts.isIntrinsicJsxName(symbolToken.text) || !checker.resolveName(jsxNamespace, parent, 111551 /* Value */, /*excludeGlobals*/ true)) {\n                    return jsxNamespace;\n                }\n            }\n            return symbolToken.text;\n        }\n        // Returns a map from an exported symbol's ID to a list of every way it's (re-)exported.\n        function getExportInfos(symbolName, currentTokenMeaning, cancellationToken, sourceFile, program, useAutoImportProvider, host) {\n            // For each original symbol, keep all re-exports of that symbol together so we can call `getCodeActionsForImport` on the whole group at once.\n            // Maps symbol id to info for modules providing that symbol (original export + re-exports).\n            var originalSymbolToExportInfos = ts.createMultiMap();\n            function addSymbol(moduleSymbol, exportedSymbol, importKind, checker) {\n                originalSymbolToExportInfos.add(ts.getUniqueSymbolId(exportedSymbol, checker).toString(), { moduleSymbol: moduleSymbol, importKind: importKind, exportedSymbolIsTypeOnly: isTypeOnlySymbol(exportedSymbol, checker) });\n            }\n            forEachExternalModuleToImportFrom(program, host, sourceFile, /*filterByPackageJson*/ true, useAutoImportProvider, function (moduleSymbol, _, program) {\n                var checker = program.getTypeChecker();\n                cancellationToken.throwIfCancellationRequested();\n                var compilerOptions = program.getCompilerOptions();\n                var defaultInfo = getDefaultLikeExportInfo(sourceFile, moduleSymbol, checker, compilerOptions);\n                if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && symbolHasMeaning(defaultInfo.symbolForMeaning, currentTokenMeaning)) {\n                    addSymbol(moduleSymbol, defaultInfo.symbol, defaultInfo.kind, checker);\n                }\n                // check exports with the same name\n                var exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName, moduleSymbol);\n                if (exportSymbolWithIdenticalName && symbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) {\n                    addSymbol(moduleSymbol, exportSymbolWithIdenticalName, 0 /* Named */, checker);\n                }\n            });\n            return originalSymbolToExportInfos;\n        }\n        function getDefaultLikeExportInfo(importingFile, moduleSymbol, checker, compilerOptions) {\n            var exported = getDefaultLikeExportWorker(importingFile, moduleSymbol, checker, compilerOptions);\n            if (!exported)\n                return undefined;\n            var symbol = exported.symbol, kind = exported.kind;\n            var info = getDefaultExportInfoWorker(symbol, checker, compilerOptions);\n            return info && __assign({ symbol: symbol, kind: kind }, info);\n        }\n        function getDefaultLikeExportWorker(importingFile, moduleSymbol, checker, compilerOptions) {\n            var defaultExport = checker.tryGetMemberInModuleExports(\"default\" /* Default */, moduleSymbol);\n            if (defaultExport)\n                return { symbol: defaultExport, kind: 1 /* Default */ };\n            var exportEquals = checker.resolveExternalModuleSymbol(moduleSymbol);\n            return exportEquals === moduleSymbol ? undefined : { symbol: exportEquals, kind: getExportEqualsImportKind(importingFile, compilerOptions) };\n        }\n        function getExportEqualsImportKind(importingFile, compilerOptions) {\n            var allowSyntheticDefaults = ts.getAllowSyntheticDefaultImports(compilerOptions);\n            // 1. 'import =' will not work in es2015+, so the decision is between a default\n            //    and a namespace import, based on allowSyntheticDefaultImports/esModuleInterop.\n            if (ts.getEmitModuleKind(compilerOptions) >= ts.ModuleKind.ES2015) {\n                return allowSyntheticDefaults ? 1 /* Default */ : 2 /* Namespace */;\n            }\n            // 2. 'import =' will not work in JavaScript, so the decision is between a default\n            //    and const/require.\n            if (ts.isInJSFile(importingFile)) {\n                return ts.isExternalModule(importingFile) ? 1 /* Default */ : 3 /* CommonJS */;\n            }\n            // 3. At this point the most correct choice is probably 'import =', but people\n            //    really hate that, so look to see if the importing file has any precedent\n            //    on how to handle it.\n            for (var _i = 0, _a = importingFile.statements; _i < _a.length; _i++) {\n                var statement = _a[_i];\n                if (ts.isImportEqualsDeclaration(statement)) {\n                    return 3 /* CommonJS */;\n                }\n            }\n            // 4. We have no precedent to go on, so just use a default import if\n            //    allowSyntheticDefaultImports/esModuleInterop is enabled.\n            return allowSyntheticDefaults ? 1 /* Default */ : 3 /* CommonJS */;\n        }\n        function getDefaultExportInfoWorker(defaultExport, checker, compilerOptions) {\n            var localSymbol = ts.getLocalSymbolForExportDefault(defaultExport);\n            if (localSymbol)\n                return { symbolForMeaning: localSymbol, name: localSymbol.name };\n            var name = getNameForExportDefault(defaultExport);\n            if (name !== undefined)\n                return { symbolForMeaning: defaultExport, name: name };\n            if (defaultExport.flags & 2097152 /* Alias */) {\n                var aliased = checker.getImmediateAliasedSymbol(defaultExport);\n                if (aliased && aliased.parent) {\n                    // - `aliased` will be undefined if the module is exporting an unresolvable name,\n                    //    but we can still offer completions for it.\n                    // - `aliased.parent` will be undefined if the module is exporting `globalThis.something`,\n                    //    or another expression that resolves to a global.\n                    return getDefaultExportInfoWorker(aliased, checker, compilerOptions);\n                }\n            }\n            if (defaultExport.escapedName !== \"default\" /* Default */ &&\n                defaultExport.escapedName !== \"export=\" /* ExportEquals */) {\n                return { symbolForMeaning: defaultExport, name: defaultExport.getName() };\n            }\n            return { symbolForMeaning: defaultExport, name: ts.getNameForExportedSymbol(defaultExport, compilerOptions.target) };\n        }\n        function getNameForExportDefault(symbol) {\n            return symbol.declarations && ts.firstDefined(symbol.declarations, function (declaration) {\n                var _a;\n                if (ts.isExportAssignment(declaration)) {\n                    return (_a = ts.tryCast(ts.skipOuterExpressions(declaration.expression), ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text;\n                }\n                else if (ts.isExportSpecifier(declaration)) {\n                    ts.Debug.assert(declaration.name.text === \"default\" /* Default */, \"Expected the specifier to be a default export\");\n                    return declaration.propertyName && declaration.propertyName.text;\n                }\n            });\n        }\n        function codeActionForFix(context, sourceFile, symbolName, fix, quotePreference) {\n            var diag;\n            var changes = ts.textChanges.ChangeTracker.with(context, function (tracker) {\n                diag = codeActionForFixWorker(tracker, sourceFile, symbolName, fix, quotePreference);\n            });\n            return codefix.createCodeFixAction(codefix.importFixName, changes, diag, importFixId, ts.Diagnostics.Add_all_missing_imports);\n        }\n        function codeActionForFixWorker(changes, sourceFile, symbolName, fix, quotePreference) {\n            switch (fix.kind) {\n                case 0 /* UseNamespace */:\n                    addNamespaceQualifier(changes, sourceFile, fix);\n                    return [ts.Diagnostics.Change_0_to_1, symbolName, fix.namespacePrefix + \".\" + symbolName];\n                case 1 /* ImportType */:\n                    addImportType(changes, sourceFile, fix, quotePreference);\n                    return [ts.Diagnostics.Change_0_to_1, symbolName, getImportTypePrefix(fix.moduleSpecifier, quotePreference) + symbolName];\n                case 2 /* AddToExisting */: {\n                    var importClauseOrBindingPattern = fix.importClauseOrBindingPattern, importKind = fix.importKind, canUseTypeOnlyImport = fix.canUseTypeOnlyImport, moduleSpecifier = fix.moduleSpecifier;\n                    doAddExistingFix(changes, sourceFile, importClauseOrBindingPattern, importKind === 1 /* Default */ ? symbolName : undefined, importKind === 0 /* Named */ ? [symbolName] : ts.emptyArray, canUseTypeOnlyImport);\n                    var moduleSpecifierWithoutQuotes = ts.stripQuotes(moduleSpecifier);\n                    return [importKind === 1 /* Default */ ? ts.Diagnostics.Add_default_import_0_to_existing_import_declaration_from_1 : ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, symbolName, moduleSpecifierWithoutQuotes]; // you too!\n                }\n                case 3 /* AddNew */: {\n                    var importKind = fix.importKind, moduleSpecifier = fix.moduleSpecifier, typeOnly = fix.typeOnly, useRequire = fix.useRequire;\n                    var getDeclarations = useRequire ? getNewRequires : getNewImports;\n                    var importsCollection = importKind === 1 /* Default */ ? { defaultImport: symbolName, typeOnly: typeOnly } :\n                        importKind === 0 /* Named */ ? { namedImports: [symbolName], typeOnly: typeOnly } :\n                            { namespaceLikeImport: { importKind: importKind, name: symbolName }, typeOnly: typeOnly };\n                    ts.insertImports(changes, sourceFile, getDeclarations(moduleSpecifier, quotePreference, importsCollection), /*blankLineBetween*/ true);\n                    return [importKind === 1 /* Default */ ? ts.Diagnostics.Import_default_0_from_module_1 : ts.Diagnostics.Import_0_from_module_1, symbolName, moduleSpecifier];\n                }\n                default:\n                    return ts.Debug.assertNever(fix, \"Unexpected fix kind \" + fix.kind);\n            }\n        }\n        function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, canUseTypeOnlyImport) {\n            if (clause.kind === 196 /* ObjectBindingPattern */) {\n                if (defaultImport) {\n                    addElementToBindingPattern(clause, defaultImport, \"default\");\n                }\n                for (var _i = 0, namedImports_1 = namedImports; _i < namedImports_1.length; _i++) {\n                    var specifier = namedImports_1[_i];\n                    addElementToBindingPattern(clause, specifier, /*propertyName*/ undefined);\n                }\n                return;\n            }\n            var convertTypeOnlyToRegular = !canUseTypeOnlyImport && clause.isTypeOnly;\n            if (defaultImport) {\n                ts.Debug.assert(!clause.name, \"Cannot add a default import to an import clause that already has one\");\n                changes.insertNodeAt(sourceFile, clause.getStart(sourceFile), ts.factory.createIdentifier(defaultImport), { suffix: \", \" });\n            }\n            if (namedImports.length) {\n                var existingSpecifiers = clause.namedBindings && ts.cast(clause.namedBindings, ts.isNamedImports).elements;\n                var newSpecifiers = ts.stableSort(namedImports.map(function (name) { return ts.factory.createImportSpecifier(/*propertyName*/ undefined, ts.factory.createIdentifier(name)); }), ts.OrganizeImports.compareImportOrExportSpecifiers);\n                if ((existingSpecifiers === null || existingSpecifiers === void 0 ? void 0 : existingSpecifiers.length) && ts.OrganizeImports.importSpecifiersAreSorted(existingSpecifiers)) {\n                    for (var _a = 0, newSpecifiers_1 = newSpecifiers; _a < newSpecifiers_1.length; _a++) {\n                        var spec = newSpecifiers_1[_a];\n                        var insertionIndex = ts.OrganizeImports.getImportSpecifierInsertionIndex(existingSpecifiers, spec);\n                        var prevSpecifier = clause.namedBindings.elements[insertionIndex - 1];\n                        if (prevSpecifier) {\n                            changes.insertNodeInListAfter(sourceFile, prevSpecifier, spec);\n                        }\n                        else {\n                            changes.insertNodeBefore(sourceFile, existingSpecifiers[0], spec, !ts.positionsAreOnSameLine(existingSpecifiers[0].getStart(), clause.parent.getStart(), sourceFile));\n                        }\n                    }\n                }\n                else if (existingSpecifiers === null || existingSpecifiers === void 0 ? void 0 : existingSpecifiers.length) {\n                    for (var _b = 0, newSpecifiers_2 = newSpecifiers; _b < newSpecifiers_2.length; _b++) {\n                        var spec = newSpecifiers_2[_b];\n                        changes.insertNodeInListAfter(sourceFile, ts.last(existingSpecifiers), spec, existingSpecifiers);\n                    }\n                }\n                else {\n                    if (newSpecifiers.length) {\n                        var namedImports_2 = ts.factory.createNamedImports(newSpecifiers);\n                        if (clause.namedBindings) {\n                            changes.replaceNode(sourceFile, clause.namedBindings, namedImports_2);\n                        }\n                        else {\n                            changes.insertNodeAfter(sourceFile, ts.Debug.checkDefined(clause.name, \"Import clause must have either named imports or a default import\"), namedImports_2);\n                        }\n                    }\n                }\n            }\n            if (convertTypeOnlyToRegular) {\n                changes.delete(sourceFile, ts.getTypeKeywordOfTypeOnlyImport(clause, sourceFile));\n            }\n            function addElementToBindingPattern(bindingPattern, name, propertyName) {\n                var element = ts.factory.createBindingElement(/*dotDotDotToken*/ undefined, propertyName, name);\n                if (bindingPattern.elements.length) {\n                    changes.insertNodeInListAfter(sourceFile, ts.last(bindingPattern.elements), element);\n                }\n                else {\n                    changes.replaceNode(sourceFile, bindingPattern, ts.factory.createObjectBindingPattern([element]));\n                }\n            }\n        }\n        function addNamespaceQualifier(changes, sourceFile, _a) {\n            var namespacePrefix = _a.namespacePrefix, position = _a.position;\n            changes.insertText(sourceFile, position, namespacePrefix + \".\");\n        }\n        function addImportType(changes, sourceFile, _a, quotePreference) {\n            var moduleSpecifier = _a.moduleSpecifier, position = _a.position;\n            changes.insertText(sourceFile, position, getImportTypePrefix(moduleSpecifier, quotePreference));\n        }\n        function getImportTypePrefix(moduleSpecifier, quotePreference) {\n            var quote = ts.getQuoteFromPreference(quotePreference);\n            return \"import(\" + quote + moduleSpecifier + quote + \").\";\n        }\n        function getNewImports(moduleSpecifier, quotePreference, imports) {\n            var _a, _b;\n            var quotedModuleSpecifier = ts.makeStringLiteral(moduleSpecifier, quotePreference);\n            var statements;\n            if (imports.defaultImport !== undefined || ((_a = imports.namedImports) === null || _a === void 0 ? void 0 : _a.length)) {\n                statements = ts.combine(statements, ts.makeImport(imports.defaultImport === undefined ? undefined : ts.factory.createIdentifier(imports.defaultImport), (_b = imports.namedImports) === null || _b === void 0 ? void 0 : _b.map(function (n) { return ts.factory.createImportSpecifier(/*propertyName*/ undefined, ts.factory.createIdentifier(n)); }), moduleSpecifier, quotePreference, imports.typeOnly));\n            }\n            var namespaceLikeImport = imports.namespaceLikeImport, typeOnly = imports.typeOnly;\n            if (namespaceLikeImport) {\n                var declaration = namespaceLikeImport.importKind === 3 /* CommonJS */\n                    ? ts.factory.createImportEqualsDeclaration(\n                    /*decorators*/ undefined, \n                    /*modifiers*/ undefined, typeOnly, ts.factory.createIdentifier(namespaceLikeImport.name), ts.factory.createExternalModuleReference(quotedModuleSpecifier))\n                    : ts.factory.createImportDeclaration(\n                    /*decorators*/ undefined, \n                    /*modifiers*/ undefined, ts.factory.createImportClause(typeOnly, \n                    /*name*/ undefined, ts.factory.createNamespaceImport(ts.factory.createIdentifier(namespaceLikeImport.name))), quotedModuleSpecifier);\n                statements = ts.combine(statements, declaration);\n            }\n            return ts.Debug.checkDefined(statements);\n        }\n        function getNewRequires(moduleSpecifier, quotePreference, imports) {\n            var _a, _b;\n            var quotedModuleSpecifier = ts.makeStringLiteral(moduleSpecifier, quotePreference);\n            var statements;\n            // const { default: foo, bar, etc } = require('./mod');\n            if (imports.defaultImport || ((_a = imports.namedImports) === null || _a === void 0 ? void 0 : _a.length)) {\n                var bindingElements = ((_b = imports.namedImports) === null || _b === void 0 ? void 0 : _b.map(function (name) { return ts.factory.createBindingElement(/*dotDotDotToken*/ undefined, /*propertyName*/ undefined, name); })) || [];\n                if (imports.defaultImport) {\n                    bindingElements.unshift(ts.factory.createBindingElement(/*dotDotDotToken*/ undefined, \"default\", imports.defaultImport));\n                }\n                var declaration = createConstEqualsRequireDeclaration(ts.factory.createObjectBindingPattern(bindingElements), quotedModuleSpecifier);\n                statements = ts.combine(statements, declaration);\n            }\n            // const foo = require('./mod');\n            if (imports.namespaceLikeImport) {\n                var declaration = createConstEqualsRequireDeclaration(imports.namespaceLikeImport.name, quotedModuleSpecifier);\n                statements = ts.combine(statements, declaration);\n            }\n            return ts.Debug.checkDefined(statements);\n        }\n        function createConstEqualsRequireDeclaration(name, quotedModuleSpecifier) {\n            return ts.factory.createVariableStatement(\n            /*modifiers*/ undefined, ts.factory.createVariableDeclarationList([\n                ts.factory.createVariableDeclaration(typeof name === \"string\" ? ts.factory.createIdentifier(name) : name, \n                /*exclamationToken*/ undefined, \n                /*type*/ undefined, ts.factory.createCallExpression(ts.factory.createIdentifier(\"require\"), /*typeArguments*/ undefined, [quotedModuleSpecifier]))\n            ], 2 /* Const */));\n        }\n        function symbolHasMeaning(_a, meaning) {\n            var declarations = _a.declarations;\n            return ts.some(declarations, function (decl) { return !!(ts.getMeaningFromDeclaration(decl) & meaning); });\n        }\n        function forEachExternalModuleToImportFrom(program, host, from, filterByPackageJson, useAutoImportProvider, cb) {\n            var _a, _b;\n            forEachExternalModuleToImportFromInProgram(program, host, from, filterByPackageJson, function (module, file) { return cb(module, file, program, /*isFromPackageJson*/ false); });\n            var autoImportProvider = useAutoImportProvider && ((_a = host.getPackageJsonAutoImportProvider) === null || _a === void 0 ? void 0 : _a.call(host));\n            if (autoImportProvider) {\n                var start = ts.timestamp();\n                forEachExternalModuleToImportFromInProgram(autoImportProvider, host, from, filterByPackageJson, function (module, file) { return cb(module, file, autoImportProvider, /*isFromPackageJson*/ true); });\n                (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, \"forEachExternalModuleToImportFrom autoImportProvider: \" + (ts.timestamp() - start));\n            }\n        }\n        codefix.forEachExternalModuleToImportFrom = forEachExternalModuleToImportFrom;\n        function forEachExternalModuleToImportFromInProgram(program, host, from, filterByPackageJson, cb) {\n            var _a;\n            var filteredCount = 0;\n            var moduleSpecifierResolutionHost = ts.createModuleSpecifierResolutionHost(program, host);\n            var packageJson = filterByPackageJson && createAutoImportFilter(from, program, host, moduleSpecifierResolutionHost);\n            forEachExternalModule(program.getTypeChecker(), program.getSourceFiles(), function (module, sourceFile) {\n                if (sourceFile === undefined) {\n                    if (!packageJson || packageJson.allowsImportingAmbientModule(module)) {\n                        cb(module, sourceFile);\n                    }\n                    else if (packageJson) {\n                        filteredCount++;\n                    }\n                }\n                else if (sourceFile &&\n                    sourceFile !== from &&\n                    isImportableFile(program, from, sourceFile, moduleSpecifierResolutionHost)) {\n                    if (!packageJson || packageJson.allowsImportingSourceFile(sourceFile)) {\n                        cb(module, sourceFile);\n                    }\n                    else if (packageJson) {\n                        filteredCount++;\n                    }\n                }\n            });\n            (_a = host.log) === null || _a === void 0 ? void 0 : _a.call(host, \"forEachExternalModuleToImportFrom: filtered out \" + filteredCount + \" modules by package.json contents\");\n        }\n        function forEachExternalModule(checker, allSourceFiles, cb) {\n            for (var _i = 0, _a = checker.getAmbientModules(); _i < _a.length; _i++) {\n                var ambient = _a[_i];\n                cb(ambient, /*sourceFile*/ undefined);\n            }\n            for (var _b = 0, allSourceFiles_1 = allSourceFiles; _b < allSourceFiles_1.length; _b++) {\n                var sourceFile = allSourceFiles_1[_b];\n                if (ts.isExternalOrCommonJsModule(sourceFile)) {\n                    cb(checker.getMergedSymbol(sourceFile.symbol), sourceFile);\n                }\n            }\n        }\n        function isImportableFile(program, from, to, moduleSpecifierResolutionHost) {\n            var _a;\n            var getCanonicalFileName = ts.hostGetCanonicalFileName(moduleSpecifierResolutionHost);\n            var globalTypingsCache = (_a = moduleSpecifierResolutionHost.getGlobalTypingsCacheLocation) === null || _a === void 0 ? void 0 : _a.call(moduleSpecifierResolutionHost);\n            return !!ts.moduleSpecifiers.forEachFileNameOfModule(from.fileName, to.fileName, moduleSpecifierResolutionHost, \n            /*preferSymlinks*/ false, function (toPath) {\n                var toFile = program.getSourceFile(toPath);\n                // Determine to import using toPath only if toPath is what we were looking at\n                // or there doesnt exist the file in the program by the symlink\n                return (toFile === to || !toFile) &&\n                    isImportablePath(from.fileName, toPath, getCanonicalFileName, globalTypingsCache);\n            });\n        }\n        /**\n         * Don't include something from a `node_modules` that isn't actually reachable by a global import.\n         * A relative import to node_modules is usually a bad idea.\n         */\n        function isImportablePath(fromPath, toPath, getCanonicalFileName, globalCachePath) {\n            // If it's in a `node_modules` but is not reachable from here via a global import, don't bother.\n            var toNodeModules = ts.forEachAncestorDirectory(toPath, function (ancestor) { return ts.getBaseFileName(ancestor) === \"node_modules\" ? ancestor : undefined; });\n            var toNodeModulesParent = toNodeModules && ts.getDirectoryPath(getCanonicalFileName(toNodeModules));\n            return toNodeModulesParent === undefined\n                || ts.startsWith(getCanonicalFileName(fromPath), toNodeModulesParent)\n                || (!!globalCachePath && ts.startsWith(getCanonicalFileName(globalCachePath), toNodeModulesParent));\n        }\n        function moduleSymbolToValidIdentifier(moduleSymbol, target) {\n            return moduleSpecifierToValidIdentifier(ts.removeFileExtension(ts.stripQuotes(moduleSymbol.name)), target);\n        }\n        codefix.moduleSymbolToValidIdentifier = moduleSymbolToValidIdentifier;\n        function moduleSpecifierToValidIdentifier(moduleSpecifier, target) {\n            var baseName = ts.getBaseFileName(ts.removeSuffix(moduleSpecifier, \"/index\"));\n            var res = \"\";\n            var lastCharWasValid = true;\n            var firstCharCode = baseName.charCodeAt(0);\n            if (ts.isIdentifierStart(firstCharCode, target)) {\n                res += String.fromCharCode(firstCharCode);\n            }\n            else {\n                lastCharWasValid = false;\n            }\n            for (var i = 1; i < baseName.length; i++) {\n                var ch = baseName.charCodeAt(i);\n                var isValid = ts.isIdentifierPart(ch, target);\n                if (isValid) {\n                    var char = String.fromCharCode(ch);\n                    if (!lastCharWasValid) {\n                        char = char.toUpperCase();\n                    }\n                    res += char;\n                }\n                lastCharWasValid = isValid;\n            }\n            // Need `|| \"_\"` to ensure result isn't empty.\n            return !ts.isStringANonContextualKeyword(res) ? res || \"_\" : \"_\" + res;\n        }\n        codefix.moduleSpecifierToValidIdentifier = moduleSpecifierToValidIdentifier;\n        function createAutoImportFilter(fromFile, program, host, moduleSpecifierResolutionHost) {\n            if (moduleSpecifierResolutionHost === void 0) { moduleSpecifierResolutionHost = ts.createModuleSpecifierResolutionHost(program, host); }\n            var packageJsons = ((host.getPackageJsonsVisibleToFile && host.getPackageJsonsVisibleToFile(fromFile.fileName)) || ts.getPackageJsonsVisibleToFile(fromFile.fileName, host)).filter(function (p) { return p.parseable; });\n            var usesNodeCoreModules;\n            return { allowsImportingAmbientModule: allowsImportingAmbientModule, allowsImportingSourceFile: allowsImportingSourceFile, allowsImportingSpecifier: allowsImportingSpecifier, moduleSpecifierResolutionHost: moduleSpecifierResolutionHost };\n            function moduleSpecifierIsCoveredByPackageJson(specifier) {\n                var packageName = getNodeModuleRootSpecifier(specifier);\n                for (var _i = 0, packageJsons_1 = packageJsons; _i < packageJsons_1.length; _i++) {\n                    var packageJson = packageJsons_1[_i];\n                    if (packageJson.has(packageName) || packageJson.has(ts.getTypesPackageName(packageName))) {\n                        return true;\n                    }\n                }\n                return false;\n            }\n            function allowsImportingAmbientModule(moduleSymbol) {\n                if (!packageJsons.length) {\n                    return true;\n                }\n                var declaringSourceFile = moduleSymbol.valueDeclaration.getSourceFile();\n                var declaringNodeModuleName = getNodeModulesPackageNameFromFileName(declaringSourceFile.fileName);\n                if (typeof declaringNodeModuleName === \"undefined\") {\n                    return true;\n                }\n                var declaredModuleSpecifier = ts.stripQuotes(moduleSymbol.getName());\n                if (isAllowedCoreNodeModulesImport(declaredModuleSpecifier)) {\n                    return true;\n                }\n                return moduleSpecifierIsCoveredByPackageJson(declaringNodeModuleName)\n                    || moduleSpecifierIsCoveredByPackageJson(declaredModuleSpecifier);\n            }\n            function allowsImportingSourceFile(sourceFile) {\n                if (!packageJsons.length) {\n                    return true;\n                }\n                var moduleSpecifier = getNodeModulesPackageNameFromFileName(sourceFile.fileName);\n                if (!moduleSpecifier) {\n                    return true;\n                }\n                return moduleSpecifierIsCoveredByPackageJson(moduleSpecifier);\n            }\n            /**\n             * Use for a specific module specifier that has already been resolved.\n             * Use `allowsImportingAmbientModule` or `allowsImportingSourceFile` to resolve\n             * the best module specifier for a given module _and_ determine if it’s importable.\n             */\n            function allowsImportingSpecifier(moduleSpecifier) {\n                if (!packageJsons.length || isAllowedCoreNodeModulesImport(moduleSpecifier)) {\n                    return true;\n                }\n                if (ts.pathIsRelative(moduleSpecifier) || ts.isRootedDiskPath(moduleSpecifier)) {\n                    return true;\n                }\n                return moduleSpecifierIsCoveredByPackageJson(moduleSpecifier);\n            }\n            function isAllowedCoreNodeModulesImport(moduleSpecifier) {\n                // If we’re in JavaScript, it can be difficult to tell whether the user wants to import\n                // from Node core modules or not. We can start by seeing if the user is actually using\n                // any node core modules, as opposed to simply having @types/node accidentally as a\n                // dependency of a dependency.\n                if (ts.isSourceFileJS(fromFile) && ts.JsTyping.nodeCoreModules.has(moduleSpecifier)) {\n                    if (usesNodeCoreModules === undefined) {\n                        usesNodeCoreModules = ts.consumesNodeCoreModules(fromFile);\n                    }\n                    if (usesNodeCoreModules) {\n                        return true;\n                    }\n                }\n                return false;\n            }\n            function getNodeModulesPackageNameFromFileName(importedFileName) {\n                if (!ts.stringContains(importedFileName, \"node_modules\")) {\n                    return undefined;\n                }\n                var specifier = ts.moduleSpecifiers.getNodeModulesPackageName(host.getCompilationSettings(), fromFile.path, importedFileName, moduleSpecifierResolutionHost);\n                if (!specifier) {\n                    return undefined;\n                }\n                // Paths here are not node_modules, so we don’t care about them;\n                // returning anything will trigger a lookup in package.json.\n                if (!ts.pathIsRelative(specifier) && !ts.isRootedDiskPath(specifier)) {\n                    return getNodeModuleRootSpecifier(specifier);\n                }\n            }\n            function getNodeModuleRootSpecifier(fullSpecifier) {\n                var components = ts.getPathComponents(ts.getPackageNameFromTypesPackageName(fullSpecifier)).slice(1);\n                // Scoped packages\n                if (ts.startsWith(components[0], \"@\")) {\n                    return components[0] + \"/\" + components[1];\n                }\n                return components[0];\n            }\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"fixNoPropertyAccessFromIndexSignature\";\n        var errorCodes = [\n            ts.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0.code\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            fixIds: [fixId],\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, span = context.span, preferences = context.preferences;\n                var property = getPropertyAccessExpression(sourceFile, span.start);\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, property, preferences); });\n                return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Use_element_access_for_0, property.name.text], fixId, ts.Diagnostics.Use_element_access_for_all_undeclared_properties)];\n            },\n            getAllCodeActions: function (context) {\n                return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return doChange(changes, diag.file, getPropertyAccessExpression(diag.file, diag.start), context.preferences); });\n            }\n        });\n        function doChange(changes, sourceFile, node, preferences) {\n            var quotePreference = ts.getQuotePreference(sourceFile, preferences);\n            var argumentsExpression = ts.factory.createStringLiteral(node.name.text, quotePreference === 0 /* Single */);\n            changes.replaceNode(sourceFile, node, ts.isPropertyAccessChain(node) ?\n                ts.factory.createElementAccessChain(node.expression, node.questionDotToken, argumentsExpression) :\n                ts.factory.createElementAccessExpression(node.expression, argumentsExpression));\n        }\n        function getPropertyAccessExpression(sourceFile, pos) {\n            return ts.cast(ts.getTokenAtPosition(sourceFile, pos).parent, ts.isPropertyAccessExpression);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"fixImplicitThis\";\n        var errorCodes = [ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, program = context.program, span = context.span;\n                var diagnostic;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) {\n                    diagnostic = doChange(t, sourceFile, span.start, program.getTypeChecker());\n                });\n                return diagnostic ? [codefix.createCodeFixAction(fixId, changes, diagnostic, fixId, ts.Diagnostics.Fix_all_implicit_this_errors)] : ts.emptyArray;\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                doChange(changes, diag.file, diag.start, context.program.getTypeChecker());\n            }); },\n        });\n        function doChange(changes, sourceFile, pos, checker) {\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            ts.Debug.assert(token.kind === 107 /* ThisKeyword */);\n            var fn = ts.getThisContainer(token, /*includeArrowFunctions*/ false);\n            if (!ts.isFunctionDeclaration(fn) && !ts.isFunctionExpression(fn))\n                return undefined;\n            if (!ts.isSourceFile(ts.getThisContainer(fn, /*includeArrowFunctions*/ false))) { // 'this' is defined outside, convert to arrow function\n                var fnKeyword = ts.Debug.assertDefined(ts.findChildOfKind(fn, 97 /* FunctionKeyword */, sourceFile));\n                var name = fn.name;\n                var body = ts.Debug.assertDefined(fn.body); // Should be defined because the function contained a 'this' expression\n                if (ts.isFunctionExpression(fn)) {\n                    if (name && ts.FindAllReferences.Core.isSymbolReferencedInFile(name, checker, sourceFile, body)) {\n                        // Function expression references itself. To fix we would have to extract it to a const.\n                        return undefined;\n                    }\n                    // `function() {}` --> `() => {}`\n                    changes.delete(sourceFile, fnKeyword);\n                    if (name) {\n                        changes.delete(sourceFile, name);\n                    }\n                    changes.insertText(sourceFile, body.pos, \" =>\");\n                    return [ts.Diagnostics.Convert_function_expression_0_to_arrow_function, name ? name.text : ts.ANONYMOUS];\n                }\n                else {\n                    // `function f() {}` => `const f = () => {}`\n                    // `name` should be defined because we only do this in inner contexts, and name is only undefined for `export default function() {}`.\n                    changes.replaceNode(sourceFile, fnKeyword, ts.factory.createToken(84 /* ConstKeyword */));\n                    changes.insertText(sourceFile, name.end, \" = \");\n                    changes.insertText(sourceFile, body.pos, \" =>\");\n                    return [ts.Diagnostics.Convert_function_declaration_0_to_arrow_function, name.text];\n                }\n            }\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"fixIncorrectNamedTupleSyntax\";\n        var errorCodes = [\n            ts.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type.code,\n            ts.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type.code\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, span = context.span;\n                var namedTupleMember = getNamedTupleMember(sourceFile, span.start);\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, namedTupleMember); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Move_labeled_tuple_element_modifiers_to_labels, fixId, ts.Diagnostics.Move_labeled_tuple_element_modifiers_to_labels)];\n            },\n            fixIds: [fixId]\n        });\n        function getNamedTupleMember(sourceFile, pos) {\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            return ts.findAncestor(token, function (t) { return t.kind === 192 /* NamedTupleMember */; });\n        }\n        function doChange(changes, sourceFile, namedTupleMember) {\n            if (!namedTupleMember) {\n                return;\n            }\n            var unwrappedType = namedTupleMember.type;\n            var sawOptional = false;\n            var sawRest = false;\n            while (unwrappedType.kind === 180 /* OptionalType */ || unwrappedType.kind === 181 /* RestType */ || unwrappedType.kind === 186 /* ParenthesizedType */) {\n                if (unwrappedType.kind === 180 /* OptionalType */) {\n                    sawOptional = true;\n                }\n                else if (unwrappedType.kind === 181 /* RestType */) {\n                    sawRest = true;\n                }\n                unwrappedType = unwrappedType.type;\n            }\n            var updated = ts.factory.updateNamedTupleMember(namedTupleMember, namedTupleMember.dotDotDotToken || (sawRest ? ts.factory.createToken(25 /* DotDotDotToken */) : undefined), namedTupleMember.name, namedTupleMember.questionToken || (sawOptional ? ts.factory.createToken(57 /* QuestionToken */) : undefined), unwrappedType);\n            if (updated === namedTupleMember) {\n                return;\n            }\n            changes.replaceNode(sourceFile, namedTupleMember, updated);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"fixSpelling\";\n        var errorCodes = [\n            ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,\n            ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code,\n            ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,\n            ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,\n            ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code,\n            // for JSX class components\n            ts.Diagnostics.No_overload_matches_this_call.code,\n            // for JSX FC\n            ts.Diagnostics.Type_0_is_not_assignable_to_type_1.code,\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, errorCode = context.errorCode;\n                var info = getInfo(sourceFile, context.span.start, context, errorCode);\n                if (!info)\n                    return undefined;\n                var node = info.node, suggestedSymbol = info.suggestedSymbol;\n                var target = context.host.getCompilationSettings().target;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, node, suggestedSymbol, target); });\n                return [codefix.createCodeFixAction(\"spelling\", changes, [ts.Diagnostics.Change_spelling_to_0, ts.symbolName(suggestedSymbol)], fixId, ts.Diagnostics.Fix_all_detected_spelling_errors)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                var info = getInfo(diag.file, diag.start, context, diag.code);\n                var target = context.host.getCompilationSettings().target;\n                if (info)\n                    doChange(changes, context.sourceFile, info.node, info.suggestedSymbol, target);\n            }); },\n        });\n        function getInfo(sourceFile, pos, context, errorCode) {\n            // This is the identifier of the misspelled word. eg:\n            // this.speling = 1;\n            //      ^^^^^^^\n            var node = ts.getTokenAtPosition(sourceFile, pos);\n            var parent = node.parent;\n            // Only fix spelling for No_overload_matches_this_call emitted on the React class component\n            if ((errorCode === ts.Diagnostics.No_overload_matches_this_call.code ||\n                errorCode === ts.Diagnostics.Type_0_is_not_assignable_to_type_1.code) &&\n                !ts.isJsxAttribute(parent))\n                return undefined;\n            var checker = context.program.getTypeChecker();\n            var suggestedSymbol;\n            if (ts.isPropertyAccessExpression(parent) && parent.name === node) {\n                ts.Debug.assert(ts.isIdentifierOrPrivateIdentifier(node), \"Expected an identifier for spelling (property access)\");\n                var containingType = checker.getTypeAtLocation(parent.expression);\n                if (parent.flags & 32 /* OptionalChain */) {\n                    containingType = checker.getNonNullableType(containingType);\n                }\n                suggestedSymbol = checker.getSuggestedSymbolForNonexistentProperty(node, containingType);\n            }\n            else if (ts.isQualifiedName(parent) && parent.right === node) {\n                var symbol = checker.getSymbolAtLocation(parent.left);\n                if (symbol && symbol.flags & 1536 /* Module */) {\n                    suggestedSymbol = checker.getSuggestedSymbolForNonexistentModule(parent.right, symbol);\n                }\n            }\n            else if (ts.isImportSpecifier(parent) && parent.name === node) {\n                ts.Debug.assertNode(node, ts.isIdentifier, \"Expected an identifier for spelling (import)\");\n                var importDeclaration = ts.findAncestor(node, ts.isImportDeclaration);\n                var resolvedSourceFile = getResolvedSourceFileFromImportDeclaration(sourceFile, context, importDeclaration);\n                if (resolvedSourceFile && resolvedSourceFile.symbol) {\n                    suggestedSymbol = checker.getSuggestedSymbolForNonexistentModule(node, resolvedSourceFile.symbol);\n                }\n            }\n            else if (ts.isJsxAttribute(parent) && parent.name === node) {\n                ts.Debug.assertNode(node, ts.isIdentifier, \"Expected an identifier for JSX attribute\");\n                var tag = ts.findAncestor(node, ts.isJsxOpeningLikeElement);\n                var props = checker.getContextualTypeForArgumentAtIndex(tag, 0);\n                suggestedSymbol = checker.getSuggestedSymbolForNonexistentJSXAttribute(node, props);\n            }\n            else {\n                var meaning = ts.getMeaningFromLocation(node);\n                var name = ts.getTextOfNode(node);\n                ts.Debug.assert(name !== undefined, \"name should be defined\");\n                suggestedSymbol = checker.getSuggestedSymbolForNonexistentSymbol(node, name, convertSemanticMeaningToSymbolFlags(meaning));\n            }\n            return suggestedSymbol === undefined ? undefined : { node: node, suggestedSymbol: suggestedSymbol };\n        }\n        function doChange(changes, sourceFile, node, suggestedSymbol, target) {\n            var suggestion = ts.symbolName(suggestedSymbol);\n            if (!ts.isIdentifierText(suggestion, target) && ts.isPropertyAccessExpression(node.parent)) {\n                var valDecl = suggestedSymbol.valueDeclaration;\n                if (ts.isNamedDeclaration(valDecl) && ts.isPrivateIdentifier(valDecl.name)) {\n                    changes.replaceNode(sourceFile, node, ts.factory.createIdentifier(suggestion));\n                }\n                else {\n                    changes.replaceNode(sourceFile, node.parent, ts.factory.createElementAccessExpression(node.parent.expression, ts.factory.createStringLiteral(suggestion)));\n                }\n            }\n            else {\n                changes.replaceNode(sourceFile, node, ts.factory.createIdentifier(suggestion));\n            }\n        }\n        function convertSemanticMeaningToSymbolFlags(meaning) {\n            var flags = 0;\n            if (meaning & 4 /* Namespace */) {\n                flags |= 1920 /* Namespace */;\n            }\n            if (meaning & 2 /* Type */) {\n                flags |= 788968 /* Type */;\n            }\n            if (meaning & 1 /* Value */) {\n                flags |= 111551 /* Value */;\n            }\n            return flags;\n        }\n        function getResolvedSourceFileFromImportDeclaration(sourceFile, context, importDeclaration) {\n            if (!importDeclaration || !ts.isStringLiteralLike(importDeclaration.moduleSpecifier))\n                return undefined;\n            var resolvedModule = ts.getResolvedModule(sourceFile, importDeclaration.moduleSpecifier.text);\n            if (!resolvedModule)\n                return undefined;\n            return context.program.getSourceFile(resolvedModule.resolvedFileName);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"returnValueCorrect\";\n        var fixIdAddReturnStatement = \"fixAddReturnStatement\";\n        var fixRemoveBracesFromArrowFunctionBody = \"fixRemoveBracesFromArrowFunctionBody\";\n        var fixIdWrapTheBlockWithParen = \"fixWrapTheBlockWithParen\";\n        var errorCodes = [\n            ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value.code,\n            ts.Diagnostics.Type_0_is_not_assignable_to_type_1.code,\n            ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code\n        ];\n        var ProblemKind;\n        (function (ProblemKind) {\n            ProblemKind[ProblemKind[\"MissingReturnStatement\"] = 0] = \"MissingReturnStatement\";\n            ProblemKind[ProblemKind[\"MissingParentheses\"] = 1] = \"MissingParentheses\";\n        })(ProblemKind || (ProblemKind = {}));\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            fixIds: [fixIdAddReturnStatement, fixRemoveBracesFromArrowFunctionBody, fixIdWrapTheBlockWithParen],\n            getCodeActions: function (context) {\n                var program = context.program, sourceFile = context.sourceFile, start = context.span.start, errorCode = context.errorCode;\n                var info = getInfo(program.getTypeChecker(), sourceFile, start, errorCode);\n                if (!info)\n                    return undefined;\n                if (info.kind === ProblemKind.MissingReturnStatement) {\n                    return ts.append([getActionForfixAddReturnStatement(context, info.expression, info.statement)], ts.isArrowFunction(info.declaration) ? getActionForFixRemoveBracesFromArrowFunctionBody(context, info.declaration, info.expression, info.commentSource) : undefined);\n                }\n                else {\n                    return [getActionForfixWrapTheBlockWithParen(context, info.declaration, info.expression)];\n                }\n            },\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                var info = getInfo(context.program.getTypeChecker(), diag.file, diag.start, diag.code);\n                if (!info)\n                    return undefined;\n                switch (context.fixId) {\n                    case fixIdAddReturnStatement:\n                        addReturnStatement(changes, diag.file, info.expression, info.statement);\n                        break;\n                    case fixRemoveBracesFromArrowFunctionBody:\n                        if (!ts.isArrowFunction(info.declaration))\n                            return undefined;\n                        removeBlockBodyBrace(changes, diag.file, info.declaration, info.expression, info.commentSource, /* withParen */ false);\n                        break;\n                    case fixIdWrapTheBlockWithParen:\n                        if (!ts.isArrowFunction(info.declaration))\n                            return undefined;\n                        wrapBlockWithParen(changes, diag.file, info.declaration, info.expression);\n                        break;\n                    default:\n                        ts.Debug.fail(JSON.stringify(context.fixId));\n                }\n            }); },\n        });\n        function createObjectTypeFromLabeledExpression(checker, label, expression) {\n            var member = checker.createSymbol(4 /* Property */, label.escapedText);\n            member.type = checker.getTypeAtLocation(expression);\n            var members = ts.createSymbolTable([member]);\n            return checker.createAnonymousType(/*symbol*/ undefined, members, [], [], /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined);\n        }\n        function getFixInfo(checker, declaration, expectType, isFunctionType) {\n            if (!declaration.body || !ts.isBlock(declaration.body) || ts.length(declaration.body.statements) !== 1)\n                return undefined;\n            var firstStatement = ts.first(declaration.body.statements);\n            if (ts.isExpressionStatement(firstStatement) && checkFixedAssignableTo(checker, declaration, checker.getTypeAtLocation(firstStatement.expression), expectType, isFunctionType)) {\n                return {\n                    declaration: declaration,\n                    kind: ProblemKind.MissingReturnStatement,\n                    expression: firstStatement.expression,\n                    statement: firstStatement,\n                    commentSource: firstStatement.expression\n                };\n            }\n            else if (ts.isLabeledStatement(firstStatement) && ts.isExpressionStatement(firstStatement.statement)) {\n                var node = ts.factory.createObjectLiteralExpression([ts.factory.createPropertyAssignment(firstStatement.label, firstStatement.statement.expression)]);\n                var nodeType = createObjectTypeFromLabeledExpression(checker, firstStatement.label, firstStatement.statement.expression);\n                if (checkFixedAssignableTo(checker, declaration, nodeType, expectType, isFunctionType)) {\n                    return ts.isArrowFunction(declaration) ? {\n                        declaration: declaration,\n                        kind: ProblemKind.MissingParentheses,\n                        expression: node,\n                        statement: firstStatement,\n                        commentSource: firstStatement.statement.expression\n                    } : {\n                        declaration: declaration,\n                        kind: ProblemKind.MissingReturnStatement,\n                        expression: node,\n                        statement: firstStatement,\n                        commentSource: firstStatement.statement.expression\n                    };\n                }\n            }\n            else if (ts.isBlock(firstStatement) && ts.length(firstStatement.statements) === 1) {\n                var firstBlockStatement = ts.first(firstStatement.statements);\n                if (ts.isLabeledStatement(firstBlockStatement) && ts.isExpressionStatement(firstBlockStatement.statement)) {\n                    var node = ts.factory.createObjectLiteralExpression([ts.factory.createPropertyAssignment(firstBlockStatement.label, firstBlockStatement.statement.expression)]);\n                    var nodeType = createObjectTypeFromLabeledExpression(checker, firstBlockStatement.label, firstBlockStatement.statement.expression);\n                    if (checkFixedAssignableTo(checker, declaration, nodeType, expectType, isFunctionType)) {\n                        return {\n                            declaration: declaration,\n                            kind: ProblemKind.MissingReturnStatement,\n                            expression: node,\n                            statement: firstStatement,\n                            commentSource: firstBlockStatement\n                        };\n                    }\n                }\n            }\n            return undefined;\n        }\n        function checkFixedAssignableTo(checker, declaration, exprType, type, isFunctionType) {\n            if (isFunctionType) {\n                var sig = checker.getSignatureFromDeclaration(declaration);\n                if (sig) {\n                    if (ts.hasSyntacticModifier(declaration, 256 /* Async */)) {\n                        exprType = checker.createPromiseType(exprType);\n                    }\n                    var newSig = checker.createSignature(declaration, sig.typeParameters, sig.thisParameter, sig.parameters, exprType, \n                    /*typePredicate*/ undefined, sig.minArgumentCount, sig.flags);\n                    exprType = checker.createAnonymousType(\n                    /*symbol*/ undefined, ts.createSymbolTable(), [newSig], [], \n                    /*stringIndexInfo*/ undefined, \n                    /*numberIndexInfo*/ undefined);\n                }\n                else {\n                    exprType = checker.getAnyType();\n                }\n            }\n            return checker.isTypeAssignableTo(exprType, type);\n        }\n        function getInfo(checker, sourceFile, position, errorCode) {\n            var node = ts.getTokenAtPosition(sourceFile, position);\n            if (!node.parent)\n                return undefined;\n            var declaration = ts.findAncestor(node.parent, ts.isFunctionLikeDeclaration);\n            switch (errorCode) {\n                case ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value.code:\n                    if (!declaration || !declaration.body || !declaration.type || !ts.rangeContainsRange(declaration.type, node))\n                        return undefined;\n                    return getFixInfo(checker, declaration, checker.getTypeFromTypeNode(declaration.type), /* isFunctionType */ false);\n                case ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code:\n                    if (!declaration || !ts.isCallExpression(declaration.parent) || !declaration.body)\n                        return undefined;\n                    var pos = declaration.parent.arguments.indexOf(declaration);\n                    var type = checker.getContextualTypeForArgumentAtIndex(declaration.parent, pos);\n                    if (!type)\n                        return undefined;\n                    return getFixInfo(checker, declaration, type, /* isFunctionType */ true);\n                case ts.Diagnostics.Type_0_is_not_assignable_to_type_1.code:\n                    if (!ts.isDeclarationName(node) || !ts.isVariableLike(node.parent) && !ts.isJsxAttribute(node.parent))\n                        return undefined;\n                    var initializer = getVariableLikeInitializer(node.parent);\n                    if (!initializer || !ts.isFunctionLikeDeclaration(initializer) || !initializer.body)\n                        return undefined;\n                    return getFixInfo(checker, initializer, checker.getTypeAtLocation(node.parent), /* isFunctionType */ true);\n            }\n            return undefined;\n        }\n        function getVariableLikeInitializer(declaration) {\n            switch (declaration.kind) {\n                case 249 /* VariableDeclaration */:\n                case 160 /* Parameter */:\n                case 198 /* BindingElement */:\n                case 163 /* PropertyDeclaration */:\n                case 288 /* PropertyAssignment */:\n                    return declaration.initializer;\n                case 280 /* JsxAttribute */:\n                    return declaration.initializer && (ts.isJsxExpression(declaration.initializer) ? declaration.initializer.expression : undefined);\n                case 289 /* ShorthandPropertyAssignment */:\n                case 162 /* PropertySignature */:\n                case 291 /* EnumMember */:\n                case 333 /* JSDocPropertyTag */:\n                case 326 /* JSDocParameterTag */:\n                    return undefined;\n            }\n        }\n        function addReturnStatement(changes, sourceFile, expression, statement) {\n            ts.suppressLeadingAndTrailingTrivia(expression);\n            var probablyNeedSemi = ts.probablyUsesSemicolons(sourceFile);\n            changes.replaceNode(sourceFile, statement, ts.factory.createReturnStatement(expression), {\n                leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude,\n                trailingTriviaOption: ts.textChanges.TrailingTriviaOption.Exclude,\n                suffix: probablyNeedSemi ? \";\" : undefined\n            });\n        }\n        function removeBlockBodyBrace(changes, sourceFile, declaration, expression, commentSource, withParen) {\n            var newBody = (withParen || ts.needsParentheses(expression)) ? ts.factory.createParenthesizedExpression(expression) : expression;\n            ts.suppressLeadingAndTrailingTrivia(commentSource);\n            ts.copyComments(commentSource, newBody);\n            changes.replaceNode(sourceFile, declaration.body, newBody);\n        }\n        function wrapBlockWithParen(changes, sourceFile, declaration, expression) {\n            changes.replaceNode(sourceFile, declaration.body, ts.factory.createParenthesizedExpression(expression));\n        }\n        function getActionForfixAddReturnStatement(context, expression, statement) {\n            var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addReturnStatement(t, context.sourceFile, expression, statement); });\n            return codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_a_return_statement, fixIdAddReturnStatement, ts.Diagnostics.Add_all_missing_return_statement);\n        }\n        function getActionForFixRemoveBracesFromArrowFunctionBody(context, declaration, expression, commentSource) {\n            var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return removeBlockBodyBrace(t, context.sourceFile, declaration, expression, commentSource, /* withParen */ false); });\n            return codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Remove_braces_from_arrow_function_body, fixRemoveBracesFromArrowFunctionBody, ts.Diagnostics.Remove_braces_from_all_arrow_function_bodies_with_relevant_issues);\n        }\n        function getActionForfixWrapTheBlockWithParen(context, declaration, expression) {\n            var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return wrapBlockWithParen(t, context.sourceFile, declaration, expression); });\n            return codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal, fixIdWrapTheBlockWithParen, ts.Diagnostics.Wrap_all_object_literal_with_parentheses);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixMissingMember = \"fixMissingMember\";\n        var fixMissingFunctionDeclaration = \"fixMissingFunctionDeclaration\";\n        var errorCodes = [\n            ts.Diagnostics.Property_0_does_not_exist_on_type_1.code,\n            ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,\n            ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2.code,\n            ts.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code,\n            ts.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code,\n            ts.Diagnostics.Cannot_find_name_0.code\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var typeChecker = context.program.getTypeChecker();\n                var info = getInfo(context.sourceFile, context.span.start, typeChecker, context.program);\n                if (!info) {\n                    return undefined;\n                }\n                if (info.kind === 2 /* Function */) {\n                    var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addFunctionDeclaration(t, context, info); });\n                    return [codefix.createCodeFixAction(fixMissingFunctionDeclaration, changes, [ts.Diagnostics.Add_missing_function_declaration_0, info.token.text], fixMissingFunctionDeclaration, ts.Diagnostics.Add_all_missing_function_declarations)];\n                }\n                if (info.kind === 0 /* Enum */) {\n                    var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addEnumMemberDeclaration(t, context.program.getTypeChecker(), info); });\n                    return [codefix.createCodeFixAction(fixMissingMember, changes, [ts.Diagnostics.Add_missing_enum_member_0, info.token.text], fixMissingMember, ts.Diagnostics.Add_all_missing_members)];\n                }\n                return ts.concatenate(getActionsForMissingMethodDeclaration(context, info), getActionsForMissingMemberDeclaration(context, info));\n            },\n            fixIds: [fixMissingMember, fixMissingFunctionDeclaration],\n            getAllCodeActions: function (context) {\n                var program = context.program, fixId = context.fixId;\n                var checker = program.getTypeChecker();\n                var seen = new ts.Map();\n                var typeDeclToMembers = new ts.Map();\n                return codefix.createCombinedCodeActions(ts.textChanges.ChangeTracker.with(context, function (changes) {\n                    codefix.eachDiagnostic(context, errorCodes, function (diag) {\n                        var info = getInfo(diag.file, diag.start, checker, context.program);\n                        if (!info || !ts.addToSeen(seen, ts.getNodeId(info.parentDeclaration) + \"#\" + info.token.text)) {\n                            return;\n                        }\n                        if (fixId === fixMissingFunctionDeclaration) {\n                            if (info.kind === 2 /* Function */) {\n                                addFunctionDeclaration(changes, context, info);\n                            }\n                        }\n                        else {\n                            if (info.kind === 0 /* Enum */) {\n                                addEnumMemberDeclaration(changes, checker, info);\n                            }\n                            if (info.kind === 1 /* ClassOrInterface */) {\n                                var parentDeclaration = info.parentDeclaration, token_1 = info.token;\n                                var infos = ts.getOrUpdate(typeDeclToMembers, parentDeclaration, function () { return []; });\n                                if (!infos.some(function (i) { return i.token.text === token_1.text; })) {\n                                    infos.push(info);\n                                }\n                            }\n                        }\n                    });\n                    typeDeclToMembers.forEach(function (infos, classDeclaration) {\n                        var supers = codefix.getAllSupers(classDeclaration, checker);\n                        var _loop_13 = function (info) {\n                            // If some superclass added this property, don't add it again.\n                            if (supers.some(function (superClassOrInterface) {\n                                var superInfos = typeDeclToMembers.get(superClassOrInterface);\n                                return !!superInfos && superInfos.some(function (_a) {\n                                    var token = _a.token;\n                                    return token.text === info.token.text;\n                                });\n                            }))\n                                return \"continue\";\n                            var parentDeclaration = info.parentDeclaration, declSourceFile = info.declSourceFile, modifierFlags = info.modifierFlags, token = info.token, call = info.call, isJSFile = info.isJSFile;\n                            // Always prefer to add a method declaration if possible.\n                            if (call && !ts.isPrivateIdentifier(token)) {\n                                addMethodDeclaration(context, changes, call, token, modifierFlags & 32 /* Static */, parentDeclaration, declSourceFile);\n                            }\n                            else {\n                                if (isJSFile && !ts.isInterfaceDeclaration(parentDeclaration)) {\n                                    addMissingMemberInJs(changes, declSourceFile, parentDeclaration, token, !!(modifierFlags & 32 /* Static */));\n                                }\n                                else {\n                                    var typeNode = getTypeNode(program.getTypeChecker(), parentDeclaration, token);\n                                    addPropertyDeclaration(changes, declSourceFile, parentDeclaration, token.text, typeNode, modifierFlags & 32 /* Static */);\n                                }\n                            }\n                        };\n                        for (var _i = 0, infos_1 = infos; _i < infos_1.length; _i++) {\n                            var info = infos_1[_i];\n                            _loop_13(info);\n                        }\n                    });\n                }));\n            },\n        });\n        var InfoKind;\n        (function (InfoKind) {\n            InfoKind[InfoKind[\"Enum\"] = 0] = \"Enum\";\n            InfoKind[InfoKind[\"ClassOrInterface\"] = 1] = \"ClassOrInterface\";\n            InfoKind[InfoKind[\"Function\"] = 2] = \"Function\";\n        })(InfoKind || (InfoKind = {}));\n        function getInfo(sourceFile, tokenPos, checker, program) {\n            // The identifier of the missing property. eg:\n            // this.missing = 1;\n            //      ^^^^^^^\n            var token = ts.getTokenAtPosition(sourceFile, tokenPos);\n            if (!ts.isIdentifier(token) && !ts.isPrivateIdentifier(token)) {\n                return undefined;\n            }\n            var parent = token.parent;\n            if (ts.isIdentifier(token) && ts.isCallExpression(parent)) {\n                return { kind: 2 /* Function */, token: token, call: parent, sourceFile: sourceFile, modifierFlags: 0 /* None */, parentDeclaration: sourceFile };\n            }\n            if (!ts.isPropertyAccessExpression(parent)) {\n                return undefined;\n            }\n            var leftExpressionType = ts.skipConstraint(checker.getTypeAtLocation(parent.expression));\n            var symbol = leftExpressionType.symbol;\n            if (!symbol || !symbol.declarations) {\n                return undefined;\n            }\n            if (ts.isIdentifier(token) && ts.isCallExpression(parent.parent)) {\n                var moduleDeclaration = ts.find(symbol.declarations, ts.isModuleDeclaration);\n                var moduleDeclarationSourceFile = moduleDeclaration === null || moduleDeclaration === void 0 ? void 0 : moduleDeclaration.getSourceFile();\n                if (moduleDeclaration && moduleDeclarationSourceFile && !program.isSourceFileFromExternalLibrary(moduleDeclarationSourceFile)) {\n                    return { kind: 2 /* Function */, token: token, call: parent.parent, sourceFile: sourceFile, modifierFlags: 1 /* Export */, parentDeclaration: moduleDeclaration };\n                }\n                var moduleSourceFile = ts.find(symbol.declarations, ts.isSourceFile);\n                if (sourceFile.commonJsModuleIndicator) {\n                    return;\n                }\n                if (moduleSourceFile && !program.isSourceFileFromExternalLibrary(moduleSourceFile)) {\n                    return { kind: 2 /* Function */, token: token, call: parent.parent, sourceFile: moduleSourceFile, modifierFlags: 1 /* Export */, parentDeclaration: moduleSourceFile };\n                }\n            }\n            var classDeclaration = ts.find(symbol.declarations, ts.isClassLike);\n            // Don't suggest adding private identifiers to anything other than a class.\n            if (!classDeclaration && ts.isPrivateIdentifier(token)) {\n                return undefined;\n            }\n            // Prefer to change the class instead of the interface if they are merged\n            var classOrInterface = classDeclaration || ts.find(symbol.declarations, ts.isInterfaceDeclaration);\n            if (classOrInterface && !program.isSourceFileFromExternalLibrary(classOrInterface.getSourceFile())) {\n                var makeStatic = (leftExpressionType.target || leftExpressionType) !== checker.getDeclaredTypeOfSymbol(symbol);\n                if (makeStatic && (ts.isPrivateIdentifier(token) || ts.isInterfaceDeclaration(classOrInterface))) {\n                    return undefined;\n                }\n                var declSourceFile = classOrInterface.getSourceFile();\n                var modifierFlags = (makeStatic ? 32 /* Static */ : 0) | (ts.startsWithUnderscore(token.text) ? 8 /* Private */ : 0);\n                var isJSFile = ts.isSourceFileJS(declSourceFile);\n                var call = ts.tryCast(parent.parent, ts.isCallExpression);\n                return { kind: 1 /* ClassOrInterface */, token: token, call: call, modifierFlags: modifierFlags, parentDeclaration: classOrInterface, declSourceFile: declSourceFile, isJSFile: isJSFile };\n            }\n            var enumDeclaration = ts.find(symbol.declarations, ts.isEnumDeclaration);\n            if (enumDeclaration && !ts.isPrivateIdentifier(token) && !program.isSourceFileFromExternalLibrary(enumDeclaration.getSourceFile())) {\n                return { kind: 0 /* Enum */, token: token, parentDeclaration: enumDeclaration };\n            }\n            return undefined;\n        }\n        function getActionsForMissingMemberDeclaration(context, info) {\n            return info.isJSFile ? ts.singleElementArray(createActionForAddMissingMemberInJavascriptFile(context, info)) :\n                createActionsForAddMissingMemberInTypeScriptFile(context, info);\n        }\n        function createActionForAddMissingMemberInJavascriptFile(context, _a) {\n            var parentDeclaration = _a.parentDeclaration, declSourceFile = _a.declSourceFile, modifierFlags = _a.modifierFlags, token = _a.token;\n            if (ts.isInterfaceDeclaration(parentDeclaration)) {\n                return undefined;\n            }\n            var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingMemberInJs(t, declSourceFile, parentDeclaration, token, !!(modifierFlags & 32 /* Static */)); });\n            if (changes.length === 0) {\n                return undefined;\n            }\n            var diagnostic = modifierFlags & 32 /* Static */ ? ts.Diagnostics.Initialize_static_property_0 :\n                ts.isPrivateIdentifier(token) ? ts.Diagnostics.Declare_a_private_field_named_0 : ts.Diagnostics.Initialize_property_0_in_the_constructor;\n            return codefix.createCodeFixAction(fixMissingMember, changes, [diagnostic, token.text], fixMissingMember, ts.Diagnostics.Add_all_missing_members);\n        }\n        function addMissingMemberInJs(changeTracker, declSourceFile, classDeclaration, token, makeStatic) {\n            var tokenName = token.text;\n            if (makeStatic) {\n                if (classDeclaration.kind === 221 /* ClassExpression */) {\n                    return;\n                }\n                var className = classDeclaration.name.getText();\n                var staticInitialization = initializePropertyToUndefined(ts.factory.createIdentifier(className), tokenName);\n                changeTracker.insertNodeAfter(declSourceFile, classDeclaration, staticInitialization);\n            }\n            else if (ts.isPrivateIdentifier(token)) {\n                var property = ts.factory.createPropertyDeclaration(\n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, tokenName, \n                /*questionToken*/ undefined, \n                /*type*/ undefined, \n                /*initializer*/ undefined);\n                var lastProp = getNodeToInsertPropertyAfter(classDeclaration);\n                if (lastProp) {\n                    changeTracker.insertNodeAfter(declSourceFile, lastProp, property);\n                }\n                else {\n                    changeTracker.insertNodeAtClassStart(declSourceFile, classDeclaration, property);\n                }\n            }\n            else {\n                var classConstructor = ts.getFirstConstructorWithBody(classDeclaration);\n                if (!classConstructor) {\n                    return;\n                }\n                var propertyInitialization = initializePropertyToUndefined(ts.factory.createThis(), tokenName);\n                changeTracker.insertNodeAtConstructorEnd(declSourceFile, classConstructor, propertyInitialization);\n            }\n        }\n        function initializePropertyToUndefined(obj, propertyName) {\n            return ts.factory.createExpressionStatement(ts.factory.createAssignment(ts.factory.createPropertyAccessExpression(obj, propertyName), ts.factory.createIdentifier(\"undefined\")));\n        }\n        function createActionsForAddMissingMemberInTypeScriptFile(context, _a) {\n            var parentDeclaration = _a.parentDeclaration, declSourceFile = _a.declSourceFile, modifierFlags = _a.modifierFlags, token = _a.token;\n            var memberName = token.text;\n            var isStatic = modifierFlags & 32 /* Static */;\n            var typeNode = getTypeNode(context.program.getTypeChecker(), parentDeclaration, token);\n            var addPropertyDeclarationChanges = function (modifierFlags) { return ts.textChanges.ChangeTracker.with(context, function (t) { return addPropertyDeclaration(t, declSourceFile, parentDeclaration, memberName, typeNode, modifierFlags); }); };\n            var actions = [codefix.createCodeFixAction(fixMissingMember, addPropertyDeclarationChanges(modifierFlags & 32 /* Static */), [isStatic ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0, memberName], fixMissingMember, ts.Diagnostics.Add_all_missing_members)];\n            if (isStatic || ts.isPrivateIdentifier(token)) {\n                return actions;\n            }\n            if (modifierFlags & 8 /* Private */) {\n                actions.unshift(codefix.createCodeFixActionWithoutFixAll(fixMissingMember, addPropertyDeclarationChanges(8 /* Private */), [ts.Diagnostics.Declare_private_property_0, memberName]));\n            }\n            actions.push(createAddIndexSignatureAction(context, declSourceFile, parentDeclaration, token.text, typeNode));\n            return actions;\n        }\n        function getTypeNode(checker, classDeclaration, token) {\n            var typeNode;\n            if (token.parent.parent.kind === 216 /* BinaryExpression */) {\n                var binaryExpression = token.parent.parent;\n                var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left;\n                var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression)));\n                typeNode = checker.typeToTypeNode(widenedType, classDeclaration, /*flags*/ undefined);\n            }\n            else {\n                var contextualType = checker.getContextualType(token.parent);\n                typeNode = contextualType ? checker.typeToTypeNode(contextualType, /*enclosingDeclaration*/ undefined, /*flags*/ undefined) : undefined;\n            }\n            return typeNode || ts.factory.createKeywordTypeNode(128 /* AnyKeyword */);\n        }\n        function addPropertyDeclaration(changeTracker, declSourceFile, classDeclaration, tokenName, typeNode, modifierFlags) {\n            var property = ts.factory.createPropertyDeclaration(\n            /*decorators*/ undefined, \n            /*modifiers*/ modifierFlags ? ts.factory.createNodeArray(ts.factory.createModifiersFromModifierFlags(modifierFlags)) : undefined, tokenName, \n            /*questionToken*/ undefined, typeNode, \n            /*initializer*/ undefined);\n            var lastProp = getNodeToInsertPropertyAfter(classDeclaration);\n            if (lastProp) {\n                changeTracker.insertNodeAfter(declSourceFile, lastProp, property);\n            }\n            else {\n                changeTracker.insertNodeAtClassStart(declSourceFile, classDeclaration, property);\n            }\n        }\n        // Gets the last of the first run of PropertyDeclarations, or undefined if the class does not start with a PropertyDeclaration.\n        function getNodeToInsertPropertyAfter(cls) {\n            var res;\n            for (var _i = 0, _a = cls.members; _i < _a.length; _i++) {\n                var member = _a[_i];\n                if (!ts.isPropertyDeclaration(member))\n                    break;\n                res = member;\n            }\n            return res;\n        }\n        function createAddIndexSignatureAction(context, declSourceFile, classDeclaration, tokenName, typeNode) {\n            // Index signatures cannot have the static modifier.\n            var stringTypeNode = ts.factory.createKeywordTypeNode(147 /* StringKeyword */);\n            var indexingParameter = ts.factory.createParameterDeclaration(\n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, \n            /*dotDotDotToken*/ undefined, \"x\", \n            /*questionToken*/ undefined, stringTypeNode, \n            /*initializer*/ undefined);\n            var indexSignature = ts.factory.createIndexSignature(\n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, [indexingParameter], typeNode);\n            var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.insertNodeAtClassStart(declSourceFile, classDeclaration, indexSignature); });\n            // No fixId here because code-fix-all currently only works on adding individual named properties.\n            return codefix.createCodeFixActionWithoutFixAll(fixMissingMember, changes, [ts.Diagnostics.Add_index_signature_for_property_0, tokenName]);\n        }\n        function getActionsForMissingMethodDeclaration(context, info) {\n            var parentDeclaration = info.parentDeclaration, declSourceFile = info.declSourceFile, modifierFlags = info.modifierFlags, token = info.token, call = info.call;\n            if (call === undefined) {\n                return undefined;\n            }\n            // Private methods are not implemented yet.\n            if (ts.isPrivateIdentifier(token)) {\n                return undefined;\n            }\n            var methodName = token.text;\n            var addMethodDeclarationChanges = function (modifierFlags) { return ts.textChanges.ChangeTracker.with(context, function (t) { return addMethodDeclaration(context, t, call, token, modifierFlags, parentDeclaration, declSourceFile); }); };\n            var actions = [codefix.createCodeFixAction(fixMissingMember, addMethodDeclarationChanges(modifierFlags & 32 /* Static */), [modifierFlags & 32 /* Static */ ? ts.Diagnostics.Declare_static_method_0 : ts.Diagnostics.Declare_method_0, methodName], fixMissingMember, ts.Diagnostics.Add_all_missing_members)];\n            if (modifierFlags & 8 /* Private */) {\n                actions.unshift(codefix.createCodeFixActionWithoutFixAll(fixMissingMember, addMethodDeclarationChanges(8 /* Private */), [ts.Diagnostics.Declare_private_method_0, methodName]));\n            }\n            return actions;\n        }\n        function addMethodDeclaration(context, changes, callExpression, name, modifierFlags, parentDeclaration, sourceFile) {\n            var importAdder = codefix.createImportAdder(sourceFile, context.program, context.preferences, context.host);\n            var methodDeclaration = codefix.createSignatureDeclarationFromCallExpression(165 /* MethodDeclaration */, context, importAdder, callExpression, name, modifierFlags, parentDeclaration);\n            var containingMethodDeclaration = ts.findAncestor(callExpression, function (n) { return ts.isMethodDeclaration(n) || ts.isConstructorDeclaration(n); });\n            if (containingMethodDeclaration && containingMethodDeclaration.parent === parentDeclaration) {\n                changes.insertNodeAfter(sourceFile, containingMethodDeclaration, methodDeclaration);\n            }\n            else {\n                changes.insertNodeAtClassStart(sourceFile, parentDeclaration, methodDeclaration);\n            }\n            importAdder.writeFixes(changes);\n        }\n        function addEnumMemberDeclaration(changes, checker, _a) {\n            var token = _a.token, parentDeclaration = _a.parentDeclaration;\n            /**\n             * create initializer only literal enum that has string initializer.\n             * value of initializer is a string literal that equal to name of enum member.\n             * numeric enum or empty enum will not create initializer.\n             */\n            var hasStringInitializer = ts.some(parentDeclaration.members, function (member) {\n                var type = checker.getTypeAtLocation(member);\n                return !!(type && type.flags & 402653316 /* StringLike */);\n            });\n            var enumMember = ts.factory.createEnumMember(token, hasStringInitializer ? ts.factory.createStringLiteral(token.text) : undefined);\n            changes.replaceNode(parentDeclaration.getSourceFile(), parentDeclaration, ts.factory.updateEnumDeclaration(parentDeclaration, parentDeclaration.decorators, parentDeclaration.modifiers, parentDeclaration.name, ts.concatenate(parentDeclaration.members, ts.singleElementArray(enumMember))), {\n                leadingTriviaOption: ts.textChanges.LeadingTriviaOption.IncludeAll,\n                trailingTriviaOption: ts.textChanges.TrailingTriviaOption.Exclude\n            });\n        }\n        function addFunctionDeclaration(changes, context, info) {\n            var importAdder = codefix.createImportAdder(context.sourceFile, context.program, context.preferences, context.host);\n            var functionDeclaration = codefix.createSignatureDeclarationFromCallExpression(251 /* FunctionDeclaration */, context, importAdder, info.call, ts.idText(info.token), info.modifierFlags, info.parentDeclaration);\n            changes.insertNodeAtEndOfScope(info.sourceFile, info.parentDeclaration, functionDeclaration);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"addMissingNewOperator\";\n        var errorCodes = [ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, span = context.span;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingNewOperator(t, sourceFile, span); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_missing_new_operator_to_call, fixId, ts.Diagnostics.Add_missing_new_operator_to_all_calls)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                return addMissingNewOperator(changes, context.sourceFile, diag);\n            }); },\n        });\n        function addMissingNewOperator(changes, sourceFile, span) {\n            var call = ts.cast(findAncestorMatchingSpan(sourceFile, span), ts.isCallExpression);\n            var newExpression = ts.factory.createNewExpression(call.expression, call.typeArguments, call.arguments);\n            changes.replaceNode(sourceFile, call, newExpression);\n        }\n        function findAncestorMatchingSpan(sourceFile, span) {\n            var token = ts.getTokenAtPosition(sourceFile, span.start);\n            var end = ts.textSpanEnd(span);\n            while (token.end < end) {\n                token = token.parent;\n            }\n            return token;\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixName = \"fixCannotFindModule\";\n        var fixIdInstallTypesPackage = \"installTypesPackage\";\n        var errorCodeCannotFindModule = ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations.code;\n        var errorCodes = [\n            errorCodeCannotFindModule,\n            ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code,\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var host = context.host, sourceFile = context.sourceFile, start = context.span.start;\n                var packageName = tryGetImportedPackageName(sourceFile, start);\n                if (packageName === undefined)\n                    return undefined;\n                var typesPackageName = getTypesPackageNameToInstall(packageName, host, context.errorCode);\n                return typesPackageName === undefined\n                    ? []\n                    : [codefix.createCodeFixAction(fixName, /*changes*/ [], [ts.Diagnostics.Install_0, typesPackageName], fixIdInstallTypesPackage, ts.Diagnostics.Install_all_missing_types_packages, getInstallCommand(sourceFile.fileName, typesPackageName))];\n            },\n            fixIds: [fixIdInstallTypesPackage],\n            getAllCodeActions: function (context) {\n                return codefix.codeFixAll(context, errorCodes, function (_changes, diag, commands) {\n                    var packageName = tryGetImportedPackageName(diag.file, diag.start);\n                    if (packageName === undefined)\n                        return undefined;\n                    switch (context.fixId) {\n                        case fixIdInstallTypesPackage: {\n                            var pkg = getTypesPackageNameToInstall(packageName, context.host, diag.code);\n                            if (pkg) {\n                                commands.push(getInstallCommand(diag.file.fileName, pkg));\n                            }\n                            break;\n                        }\n                        default:\n                            ts.Debug.fail(\"Bad fixId: \" + context.fixId);\n                    }\n                });\n            },\n        });\n        function getInstallCommand(fileName, packageName) {\n            return { type: \"install package\", file: fileName, packageName: packageName };\n        }\n        function tryGetImportedPackageName(sourceFile, pos) {\n            var moduleName = ts.cast(ts.getTokenAtPosition(sourceFile, pos), ts.isStringLiteral).text;\n            var packageName = ts.parsePackageName(moduleName).packageName;\n            return ts.isExternalModuleNameRelative(packageName) ? undefined : packageName;\n        }\n        function getTypesPackageNameToInstall(packageName, host, diagCode) {\n            var _a;\n            return diagCode === errorCodeCannotFindModule\n                ? (ts.JsTyping.nodeCoreModules.has(packageName) ? \"@types/node\" : undefined)\n                : (((_a = host.isKnownTypesPackageName) === null || _a === void 0 ? void 0 : _a.call(host, packageName)) ? ts.getTypesPackageName(packageName) : undefined);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var errorCodes = [\n            ts.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code,\n            ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code,\n        ];\n        var fixId = \"fixClassDoesntImplementInheritedAbstractMember\";\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, span = context.span;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) {\n                    return addMissingMembers(getClass(sourceFile, span.start), sourceFile, context, t, context.preferences);\n                });\n                return changes.length === 0 ? undefined : [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Implement_inherited_abstract_class, fixId, ts.Diagnostics.Implement_all_inherited_abstract_classes)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) {\n                var seenClassDeclarations = new ts.Map();\n                return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                    var classDeclaration = getClass(diag.file, diag.start);\n                    if (ts.addToSeen(seenClassDeclarations, ts.getNodeId(classDeclaration))) {\n                        addMissingMembers(classDeclaration, context.sourceFile, context, changes, context.preferences);\n                    }\n                });\n            },\n        });\n        function getClass(sourceFile, pos) {\n            // Token is the identifier in the case of a class declaration\n            // or the class keyword token in the case of a class expression.\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            return ts.cast(token.parent, ts.isClassLike);\n        }\n        function addMissingMembers(classDeclaration, sourceFile, context, changeTracker, preferences) {\n            var extendsNode = ts.getEffectiveBaseTypeNode(classDeclaration);\n            var checker = context.program.getTypeChecker();\n            var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode);\n            // Note that this is ultimately derived from a map indexed by symbol names,\n            // so duplicates cannot occur.\n            var abstractAndNonPrivateExtendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType).filter(symbolPointsToNonPrivateAndAbstractMember);\n            var importAdder = codefix.createImportAdder(sourceFile, context.program, preferences, context.host);\n            codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, sourceFile, context, preferences, importAdder, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); });\n            importAdder.writeFixes(changeTracker);\n        }\n        function symbolPointsToNonPrivateAndAbstractMember(symbol) {\n            // See `codeFixClassExtendAbstractProtectedProperty.ts` in https://github.com/Microsoft/TypeScript/pull/11547/files\n            // (now named `codeFixClassExtendAbstractPrivateProperty.ts`)\n            var flags = ts.getSyntacticModifierFlags(ts.first(symbol.getDeclarations()));\n            return !(flags & 8 /* Private */) && !!(flags & 128 /* Abstract */);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"classSuperMustPrecedeThisAccess\";\n        var errorCodes = [ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, span = context.span;\n                var nodes = getNodes(sourceFile, span.start);\n                if (!nodes)\n                    return undefined;\n                var constructor = nodes.constructor, superCall = nodes.superCall;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, constructor, superCall); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Make_super_call_the_first_statement_in_the_constructor, fixId, ts.Diagnostics.Make_all_super_calls_the_first_statement_in_their_constructor)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) {\n                var sourceFile = context.sourceFile;\n                var seenClasses = new ts.Map(); // Ensure we only do this once per class.\n                return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                    var nodes = getNodes(diag.file, diag.start);\n                    if (!nodes)\n                        return;\n                    var constructor = nodes.constructor, superCall = nodes.superCall;\n                    if (ts.addToSeen(seenClasses, ts.getNodeId(constructor.parent))) {\n                        doChange(changes, sourceFile, constructor, superCall);\n                    }\n                });\n            },\n        });\n        function doChange(changes, sourceFile, constructor, superCall) {\n            changes.insertNodeAtConstructorStart(sourceFile, constructor, superCall);\n            changes.delete(sourceFile, superCall);\n        }\n        function getNodes(sourceFile, pos) {\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            if (token.kind !== 107 /* ThisKeyword */)\n                return undefined;\n            var constructor = ts.getContainingFunction(token);\n            var superCall = findSuperCall(constructor.body);\n            // figure out if the `this` access is actually inside the supercall\n            // i.e. super(this.a), since in that case we won't suggest a fix\n            return superCall && !superCall.expression.arguments.some(function (arg) { return ts.isPropertyAccessExpression(arg) && arg.expression === token; }) ? { constructor: constructor, superCall: superCall } : undefined;\n        }\n        function findSuperCall(n) {\n            return ts.isExpressionStatement(n) && ts.isSuperCall(n.expression)\n                ? n\n                : ts.isFunctionLike(n)\n                    ? undefined\n                    : ts.forEachChild(n, findSuperCall);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"constructorForDerivedNeedSuperCall\";\n        var errorCodes = [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, span = context.span;\n                var ctr = getNode(sourceFile, span.start);\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, ctr); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_missing_super_call, fixId, ts.Diagnostics.Add_all_missing_super_calls)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                return doChange(changes, context.sourceFile, getNode(diag.file, diag.start));\n            }); },\n        });\n        function getNode(sourceFile, pos) {\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            ts.Debug.assert(ts.isConstructorDeclaration(token.parent), \"token should be at the constructor declaration\");\n            return token.parent;\n        }\n        function doChange(changes, sourceFile, ctr) {\n            var superCall = ts.factory.createExpressionStatement(ts.factory.createCallExpression(ts.factory.createSuper(), /*typeArguments*/ undefined, /*argumentsArray*/ ts.emptyArray));\n            changes.insertNodeAtConstructorStart(sourceFile, ctr, superCall);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"enableExperimentalDecorators\";\n        var errorCodes = [\n            ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning.code\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var configFile = context.program.getCompilerOptions().configFile;\n                if (configFile === undefined) {\n                    return undefined;\n                }\n                var changes = ts.textChanges.ChangeTracker.with(context, function (changeTracker) { return doChange(changeTracker, configFile); });\n                return [codefix.createCodeFixActionWithoutFixAll(fixId, changes, ts.Diagnostics.Enable_the_experimentalDecorators_option_in_your_configuration_file)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes) {\n                var configFile = context.program.getCompilerOptions().configFile;\n                if (configFile === undefined) {\n                    return undefined;\n                }\n                doChange(changes, configFile);\n            }); },\n        });\n        function doChange(changeTracker, configFile) {\n            codefix.setJsonCompilerOptionValue(changeTracker, configFile, \"experimentalDecorators\", ts.factory.createTrue());\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixID = \"fixEnableJsxFlag\";\n        var errorCodes = [ts.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var configFile = context.program.getCompilerOptions().configFile;\n                if (configFile === undefined) {\n                    return undefined;\n                }\n                var changes = ts.textChanges.ChangeTracker.with(context, function (changeTracker) {\n                    return doChange(changeTracker, configFile);\n                });\n                return [\n                    codefix.createCodeFixActionWithoutFixAll(fixID, changes, ts.Diagnostics.Enable_the_jsx_flag_in_your_configuration_file)\n                ];\n            },\n            fixIds: [fixID],\n            getAllCodeActions: function (context) {\n                return codefix.codeFixAll(context, errorCodes, function (changes) {\n                    var configFile = context.program.getCompilerOptions().configFile;\n                    if (configFile === undefined) {\n                        return undefined;\n                    }\n                    doChange(changes, configFile);\n                });\n            }\n        });\n        function doChange(changeTracker, configFile) {\n            codefix.setJsonCompilerOptionValue(changeTracker, configFile, \"jsx\", ts.factory.createStringLiteral(\"react\"));\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        codefix.registerCodeFix({\n            errorCodes: [\n                ts.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_esnext_or_system_and_the_target_option_is_set_to_es2017_or_higher.code,\n                ts.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_esnext_or_system_and_the_target_option_is_set_to_es2017_or_higher.code,\n            ],\n            getCodeActions: function (context) {\n                var compilerOptions = context.program.getCompilerOptions();\n                var configFile = compilerOptions.configFile;\n                if (configFile === undefined) {\n                    return undefined;\n                }\n                var codeFixes = [];\n                var moduleKind = ts.getEmitModuleKind(compilerOptions);\n                var moduleOutOfRange = moduleKind >= ts.ModuleKind.ES2015 && moduleKind < ts.ModuleKind.ESNext;\n                if (moduleOutOfRange) {\n                    var changes = ts.textChanges.ChangeTracker.with(context, function (changes) {\n                        codefix.setJsonCompilerOptionValue(changes, configFile, \"module\", ts.factory.createStringLiteral(\"esnext\"));\n                    });\n                    codeFixes.push(codefix.createCodeFixActionWithoutFixAll(\"fixModuleOption\", changes, [ts.Diagnostics.Set_the_module_option_in_your_configuration_file_to_0, \"esnext\"]));\n                }\n                var target = ts.getEmitScriptTarget(compilerOptions);\n                var targetOutOfRange = target < 4 /* ES2017 */ || target > 99 /* ESNext */;\n                if (targetOutOfRange) {\n                    var changes = ts.textChanges.ChangeTracker.with(context, function (tracker) {\n                        var configObject = ts.getTsConfigObjectLiteralExpression(configFile);\n                        if (!configObject)\n                            return;\n                        var options = [[\"target\", ts.factory.createStringLiteral(\"es2017\")]];\n                        if (moduleKind === ts.ModuleKind.CommonJS) {\n                            // Ensure we preserve the default module kind (commonjs), as targets >= ES2015 have a default module kind of es2015.\n                            options.push([\"module\", ts.factory.createStringLiteral(\"commonjs\")]);\n                        }\n                        codefix.setJsonCompilerOptionValues(tracker, configFile, options);\n                    });\n                    codeFixes.push(codefix.createCodeFixActionWithoutFixAll(\"fixTargetOption\", changes, [ts.Diagnostics.Set_the_target_option_in_your_configuration_file_to_0, \"es2017\"]));\n                }\n                return codeFixes.length ? codeFixes : undefined;\n            }\n        });\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"fixPropertyAssignment\";\n        var errorCodes = [\n            ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            fixIds: [fixId],\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, span = context.span;\n                var property = getProperty(sourceFile, span.start);\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, property); });\n                return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Change_0_to_1, \"=\", \":\"], fixId, [ts.Diagnostics.Switch_each_misused_0_to_1, \"=\", \":\"])];\n            },\n            getAllCodeActions: function (context) {\n                return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return doChange(changes, diag.file, getProperty(diag.file, diag.start)); });\n            }\n        });\n        function doChange(changes, sourceFile, node) {\n            changes.replaceNode(sourceFile, node, ts.factory.createPropertyAssignment(node.name, node.objectAssignmentInitializer));\n        }\n        function getProperty(sourceFile, pos) {\n            return ts.cast(ts.getTokenAtPosition(sourceFile, pos).parent, ts.isShorthandPropertyAssignment);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"extendsInterfaceBecomesImplements\";\n        var errorCodes = [ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile;\n                var nodes = getNodes(sourceFile, context.span.start);\n                if (!nodes)\n                    return undefined;\n                var extendsToken = nodes.extendsToken, heritageClauses = nodes.heritageClauses;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChanges(t, sourceFile, extendsToken, heritageClauses); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Change_extends_to_implements, fixId, ts.Diagnostics.Change_all_extended_interfaces_to_implements)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                var nodes = getNodes(diag.file, diag.start);\n                if (nodes)\n                    doChanges(changes, diag.file, nodes.extendsToken, nodes.heritageClauses);\n            }); },\n        });\n        function getNodes(sourceFile, pos) {\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            var heritageClauses = ts.getContainingClass(token).heritageClauses;\n            var extendsToken = heritageClauses[0].getFirstToken();\n            return extendsToken.kind === 93 /* ExtendsKeyword */ ? { extendsToken: extendsToken, heritageClauses: heritageClauses } : undefined;\n        }\n        function doChanges(changes, sourceFile, extendsToken, heritageClauses) {\n            changes.replaceNode(sourceFile, extendsToken, ts.factory.createToken(116 /* ImplementsKeyword */));\n            // If there is already an implements clause, replace the implements keyword with a comma.\n            if (heritageClauses.length === 2 &&\n                heritageClauses[0].token === 93 /* ExtendsKeyword */ &&\n                heritageClauses[1].token === 116 /* ImplementsKeyword */) {\n                var implementsToken = heritageClauses[1].getFirstToken();\n                var implementsFullStart = implementsToken.getFullStart();\n                changes.replaceRange(sourceFile, { pos: implementsFullStart, end: implementsFullStart }, ts.factory.createToken(27 /* CommaToken */));\n                // Rough heuristic: delete trailing whitespace after keyword so that it's not excessive.\n                // (Trailing because leading might be indentation, which is more sensitive.)\n                var text = sourceFile.text;\n                var end = implementsToken.end;\n                while (end < text.length && ts.isWhiteSpaceSingleLine(text.charCodeAt(end))) {\n                    end++;\n                }\n                changes.deleteRange(sourceFile, { pos: implementsToken.getStart(), end: end });\n            }\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"forgottenThisPropertyAccess\";\n        var didYouMeanStaticMemberCode = ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code;\n        var errorCodes = [\n            ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,\n            ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code,\n            didYouMeanStaticMemberCode,\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile;\n                var info = getInfo(sourceFile, context.span.start, context.errorCode);\n                if (!info) {\n                    return undefined;\n                }\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info); });\n                return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Add_0_to_unresolved_variable, info.className || \"this\"], fixId, ts.Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                var info = getInfo(diag.file, diag.start, diag.code);\n                if (info)\n                    doChange(changes, context.sourceFile, info);\n            }); },\n        });\n        function getInfo(sourceFile, pos, diagCode) {\n            var node = ts.getTokenAtPosition(sourceFile, pos);\n            if (ts.isIdentifier(node)) {\n                return { node: node, className: diagCode === didYouMeanStaticMemberCode ? ts.getContainingClass(node).name.text : undefined };\n            }\n        }\n        function doChange(changes, sourceFile, _a) {\n            var node = _a.node, className = _a.className;\n            // TODO (https://github.com/Microsoft/TypeScript/issues/21246): use shared helper\n            ts.suppressLeadingAndTrailingTrivia(node);\n            changes.replaceNode(sourceFile, node, ts.factory.createPropertyAccessExpression(className ? ts.factory.createIdentifier(className) : ts.factory.createThis(), node));\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixIdExpression = \"fixInvalidJsxCharacters_expression\";\n        var fixIdHtmlEntity = \"fixInvalidJsxCharacters_htmlEntity\";\n        var errorCodes = [\n            ts.Diagnostics.Unexpected_token_Did_you_mean_or_gt.code,\n            ts.Diagnostics.Unexpected_token_Did_you_mean_or_rbrace.code\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            fixIds: [fixIdExpression, fixIdHtmlEntity],\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, preferences = context.preferences, span = context.span;\n                var changeToExpression = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, preferences, sourceFile, span.start, /* useHtmlEntity */ false); });\n                var changeToHtmlEntity = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, preferences, sourceFile, span.start, /* useHtmlEntity */ true); });\n                return [\n                    codefix.createCodeFixAction(fixIdExpression, changeToExpression, ts.Diagnostics.Wrap_invalid_character_in_an_expression_container, fixIdExpression, ts.Diagnostics.Wrap_all_invalid_characters_in_an_expression_container),\n                    codefix.createCodeFixAction(fixIdHtmlEntity, changeToHtmlEntity, ts.Diagnostics.Convert_invalid_character_to_its_html_entity_code, fixIdHtmlEntity, ts.Diagnostics.Convert_all_invalid_characters_to_HTML_entity_code)\n                ];\n            },\n            getAllCodeActions: function (context) {\n                return codefix.codeFixAll(context, errorCodes, function (changes, diagnostic) { return doChange(changes, context.preferences, diagnostic.file, diagnostic.start, context.fixId === fixIdHtmlEntity); });\n            }\n        });\n        var htmlEntity = {\n            \">\": \"&gt;\",\n            \"}\": \"&rbrace;\",\n        };\n        function isValidCharacter(character) {\n            return ts.hasProperty(htmlEntity, character);\n        }\n        function doChange(changes, preferences, sourceFile, start, useHtmlEntity) {\n            var character = sourceFile.getText()[start];\n            // sanity check\n            if (!isValidCharacter(character)) {\n                return;\n            }\n            var replacement = useHtmlEntity ? htmlEntity[character] : \"{\" + ts.quote(sourceFile, preferences, character) + \"}\";\n            changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixName = \"unusedIdentifier\";\n        var fixIdPrefix = \"unusedIdentifier_prefix\";\n        var fixIdDelete = \"unusedIdentifier_delete\";\n        var fixIdDeleteImports = \"unusedIdentifier_deleteImports\";\n        var fixIdInfer = \"unusedIdentifier_infer\";\n        var errorCodes = [\n            ts.Diagnostics._0_is_declared_but_its_value_is_never_read.code,\n            ts.Diagnostics._0_is_declared_but_never_used.code,\n            ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code,\n            ts.Diagnostics.All_imports_in_import_declaration_are_unused.code,\n            ts.Diagnostics.All_destructured_elements_are_unused.code,\n            ts.Diagnostics.All_variables_are_unused.code,\n            ts.Diagnostics.All_type_parameters_are_unused.code,\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var errorCode = context.errorCode, sourceFile = context.sourceFile, program = context.program, cancellationToken = context.cancellationToken;\n                var checker = program.getTypeChecker();\n                var sourceFiles = program.getSourceFiles();\n                var token = ts.getTokenAtPosition(sourceFile, context.span.start);\n                if (ts.isJSDocTemplateTag(token)) {\n                    return [createDeleteFix(ts.textChanges.ChangeTracker.with(context, function (t) { return t.delete(sourceFile, token); }), ts.Diagnostics.Remove_template_tag)];\n                }\n                if (token.kind === 29 /* LessThanToken */) {\n                    var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return deleteTypeParameters(t, sourceFile, token); });\n                    return [createDeleteFix(changes, ts.Diagnostics.Remove_type_parameters)];\n                }\n                var importDecl = tryGetFullImport(token);\n                if (importDecl) {\n                    var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.delete(sourceFile, importDecl); });\n                    return [codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Remove_import_from_0, ts.showModuleSpecifier(importDecl)], fixIdDeleteImports, ts.Diagnostics.Delete_all_unused_imports)];\n                }\n                else if (isImport(token)) {\n                    var deletion = ts.textChanges.ChangeTracker.with(context, function (t) { return tryDeleteDeclaration(sourceFile, token, t, checker, sourceFiles, program, cancellationToken, /*isFixAll*/ false); });\n                    if (deletion.length) {\n                        return [codefix.createCodeFixAction(fixName, deletion, [ts.Diagnostics.Remove_unused_declaration_for_Colon_0, token.getText(sourceFile)], fixIdDeleteImports, ts.Diagnostics.Delete_all_unused_imports)];\n                    }\n                }\n                if (ts.isObjectBindingPattern(token.parent) || ts.isArrayBindingPattern(token.parent)) {\n                    if (ts.isParameter(token.parent.parent)) {\n                        var elements = token.parent.elements;\n                        var diagnostic = [\n                            elements.length > 1 ? ts.Diagnostics.Remove_unused_declarations_for_Colon_0 : ts.Diagnostics.Remove_unused_declaration_for_Colon_0,\n                            ts.map(elements, function (e) { return e.getText(sourceFile); }).join(\", \")\n                        ];\n                        return [\n                            createDeleteFix(ts.textChanges.ChangeTracker.with(context, function (t) {\n                                return deleteDestructuringElements(t, sourceFile, token.parent);\n                            }), diagnostic)\n                        ];\n                    }\n                    return [\n                        createDeleteFix(ts.textChanges.ChangeTracker.with(context, function (t) {\n                            return t.delete(sourceFile, token.parent.parent);\n                        }), ts.Diagnostics.Remove_unused_destructuring_declaration)\n                    ];\n                }\n                if (canDeleteEntireVariableStatement(sourceFile, token)) {\n                    return [\n                        createDeleteFix(ts.textChanges.ChangeTracker.with(context, function (t) {\n                            return deleteEntireVariableStatement(t, sourceFile, token.parent);\n                        }), ts.Diagnostics.Remove_variable_statement)\n                    ];\n                }\n                var result = [];\n                if (token.kind === 135 /* InferKeyword */) {\n                    var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return changeInferToUnknown(t, sourceFile, token); });\n                    var name = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name.text;\n                    result.push(codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Replace_infer_0_with_unknown, name], fixIdInfer, ts.Diagnostics.Replace_all_unused_infer_with_unknown));\n                }\n                else {\n                    var deletion = ts.textChanges.ChangeTracker.with(context, function (t) {\n                        return tryDeleteDeclaration(sourceFile, token, t, checker, sourceFiles, program, cancellationToken, /*isFixAll*/ false);\n                    });\n                    if (deletion.length) {\n                        var name = ts.isComputedPropertyName(token.parent) ? token.parent : token;\n                        result.push(createDeleteFix(deletion, [ts.Diagnostics.Remove_unused_declaration_for_Colon_0, name.getText(sourceFile)]));\n                    }\n                }\n                var prefix = ts.textChanges.ChangeTracker.with(context, function (t) { return tryPrefixDeclaration(t, errorCode, sourceFile, token); });\n                if (prefix.length) {\n                    result.push(codefix.createCodeFixAction(fixName, prefix, [ts.Diagnostics.Prefix_0_with_an_underscore, token.getText(sourceFile)], fixIdPrefix, ts.Diagnostics.Prefix_all_unused_declarations_with_where_possible));\n                }\n                return result;\n            },\n            fixIds: [fixIdPrefix, fixIdDelete, fixIdDeleteImports, fixIdInfer],\n            getAllCodeActions: function (context) {\n                var sourceFile = context.sourceFile, program = context.program, cancellationToken = context.cancellationToken;\n                var checker = program.getTypeChecker();\n                var sourceFiles = program.getSourceFiles();\n                return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                    var token = ts.getTokenAtPosition(sourceFile, diag.start);\n                    switch (context.fixId) {\n                        case fixIdPrefix:\n                            tryPrefixDeclaration(changes, diag.code, sourceFile, token);\n                            break;\n                        case fixIdDeleteImports: {\n                            var importDecl = tryGetFullImport(token);\n                            if (importDecl) {\n                                changes.delete(sourceFile, importDecl);\n                            }\n                            else if (isImport(token)) {\n                                tryDeleteDeclaration(sourceFile, token, changes, checker, sourceFiles, program, cancellationToken, /*isFixAll*/ true);\n                            }\n                            break;\n                        }\n                        case fixIdDelete: {\n                            if (token.kind === 135 /* InferKeyword */ || isImport(token)) {\n                                break; // Can't delete\n                            }\n                            else if (ts.isJSDocTemplateTag(token)) {\n                                changes.delete(sourceFile, token);\n                            }\n                            else if (token.kind === 29 /* LessThanToken */) {\n                                deleteTypeParameters(changes, sourceFile, token);\n                            }\n                            else if (ts.isObjectBindingPattern(token.parent)) {\n                                if (token.parent.parent.initializer) {\n                                    break;\n                                }\n                                else if (!ts.isParameter(token.parent.parent) || isNotProvidedArguments(token.parent.parent, checker, sourceFiles)) {\n                                    changes.delete(sourceFile, token.parent.parent);\n                                }\n                            }\n                            else if (ts.isArrayBindingPattern(token.parent.parent) && token.parent.parent.parent.initializer) {\n                                break;\n                            }\n                            else if (canDeleteEntireVariableStatement(sourceFile, token)) {\n                                deleteEntireVariableStatement(changes, sourceFile, token.parent);\n                            }\n                            else {\n                                tryDeleteDeclaration(sourceFile, token, changes, checker, sourceFiles, program, cancellationToken, /*isFixAll*/ true);\n                            }\n                            break;\n                        }\n                        case fixIdInfer:\n                            if (token.kind === 135 /* InferKeyword */) {\n                                changeInferToUnknown(changes, sourceFile, token);\n                            }\n                            break;\n                        default:\n                            ts.Debug.fail(JSON.stringify(context.fixId));\n                    }\n                });\n            },\n        });\n        function changeInferToUnknown(changes, sourceFile, token) {\n            changes.replaceNode(sourceFile, token.parent, ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */));\n        }\n        function createDeleteFix(changes, diag) {\n            return codefix.createCodeFixAction(fixName, changes, diag, fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations);\n        }\n        function deleteTypeParameters(changes, sourceFile, token) {\n            changes.delete(sourceFile, ts.Debug.checkDefined(ts.cast(token.parent, ts.isDeclarationWithTypeParameterChildren).typeParameters, \"The type parameter to delete should exist\"));\n        }\n        function isImport(token) {\n            return token.kind === 99 /* ImportKeyword */\n                || token.kind === 78 /* Identifier */ && (token.parent.kind === 265 /* ImportSpecifier */ || token.parent.kind === 262 /* ImportClause */);\n        }\n        /** Sometimes the diagnostic span is an entire ImportDeclaration, so we should remove the whole thing. */\n        function tryGetFullImport(token) {\n            return token.kind === 99 /* ImportKeyword */ ? ts.tryCast(token.parent, ts.isImportDeclaration) : undefined;\n        }\n        function canDeleteEntireVariableStatement(sourceFile, token) {\n            return ts.isVariableDeclarationList(token.parent) && ts.first(token.parent.getChildren(sourceFile)) === token;\n        }\n        function deleteEntireVariableStatement(changes, sourceFile, node) {\n            changes.delete(sourceFile, node.parent.kind === 232 /* VariableStatement */ ? node.parent : node);\n        }\n        function deleteDestructuringElements(changes, sourceFile, node) {\n            ts.forEach(node.elements, function (n) { return changes.delete(sourceFile, n); });\n        }\n        function tryPrefixDeclaration(changes, errorCode, sourceFile, token) {\n            // Don't offer to prefix a property.\n            if (errorCode === ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code)\n                return;\n            if (token.kind === 135 /* InferKeyword */) {\n                token = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name;\n            }\n            if (ts.isIdentifier(token) && canPrefix(token)) {\n                changes.replaceNode(sourceFile, token, ts.factory.createIdentifier(\"_\" + token.text));\n                if (ts.isParameter(token.parent)) {\n                    ts.getJSDocParameterTags(token.parent).forEach(function (tag) {\n                        if (ts.isIdentifier(tag.name)) {\n                            changes.replaceNode(sourceFile, tag.name, ts.factory.createIdentifier(\"_\" + tag.name.text));\n                        }\n                    });\n                }\n            }\n        }\n        function canPrefix(token) {\n            switch (token.parent.kind) {\n                case 160 /* Parameter */:\n                case 159 /* TypeParameter */:\n                    return true;\n                case 249 /* VariableDeclaration */: {\n                    var varDecl = token.parent;\n                    switch (varDecl.parent.parent.kind) {\n                        case 239 /* ForOfStatement */:\n                        case 238 /* ForInStatement */:\n                            return true;\n                    }\n                }\n            }\n            return false;\n        }\n        function tryDeleteDeclaration(sourceFile, token, changes, checker, sourceFiles, program, cancellationToken, isFixAll) {\n            tryDeleteDeclarationWorker(token, changes, sourceFile, checker, sourceFiles, program, cancellationToken, isFixAll);\n            if (ts.isIdentifier(token)) {\n                ts.FindAllReferences.Core.eachSymbolReferenceInFile(token, checker, sourceFile, function (ref) {\n                    if (ts.isPropertyAccessExpression(ref.parent) && ref.parent.name === ref)\n                        ref = ref.parent;\n                    if (!isFixAll && mayDeleteExpression(ref)) {\n                        changes.delete(sourceFile, ref.parent.parent);\n                    }\n                });\n            }\n        }\n        function tryDeleteDeclarationWorker(token, changes, sourceFile, checker, sourceFiles, program, cancellationToken, isFixAll) {\n            var parent = token.parent;\n            if (ts.isParameter(parent)) {\n                tryDeleteParameter(changes, sourceFile, parent, checker, sourceFiles, program, cancellationToken, isFixAll);\n            }\n            else if (!isFixAll || !(ts.isIdentifier(token) && ts.FindAllReferences.Core.isSymbolReferencedInFile(token, checker, sourceFile))) {\n                changes.delete(sourceFile, ts.isImportClause(parent) ? token : ts.isComputedPropertyName(parent) ? parent.parent : parent);\n            }\n        }\n        function tryDeleteParameter(changes, sourceFile, parameter, checker, sourceFiles, program, cancellationToken, isFixAll) {\n            if (isFixAll === void 0) { isFixAll = false; }\n            if (mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program, cancellationToken, isFixAll)) {\n                if (parameter.modifiers && parameter.modifiers.length > 0 &&\n                    (!ts.isIdentifier(parameter.name) || ts.FindAllReferences.Core.isSymbolReferencedInFile(parameter.name, checker, sourceFile))) {\n                    parameter.modifiers.forEach(function (modifier) { return changes.deleteModifier(sourceFile, modifier); });\n                }\n                else if (!parameter.initializer && isNotProvidedArguments(parameter, checker, sourceFiles)) {\n                    changes.delete(sourceFile, parameter);\n                }\n            }\n        }\n        function isNotProvidedArguments(parameter, checker, sourceFiles) {\n            var index = parameter.parent.parameters.indexOf(parameter);\n            // Just in case the call didn't provide enough arguments.\n            return !ts.FindAllReferences.Core.someSignatureUsage(parameter.parent, sourceFiles, checker, function (_, call) { return !call || call.arguments.length > index; });\n        }\n        function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program, cancellationToken, isFixAll) {\n            var parent = parameter.parent;\n            switch (parent.kind) {\n                case 165 /* MethodDeclaration */:\n                case 166 /* Constructor */:\n                    var index = parent.parameters.indexOf(parameter);\n                    var referent = ts.isMethodDeclaration(parent) ? parent.name : parent;\n                    var entries = ts.FindAllReferences.Core.getReferencedSymbolsForNode(parent.pos, referent, program, sourceFiles, cancellationToken);\n                    if (entries) {\n                        for (var _i = 0, entries_2 = entries; _i < entries_2.length; _i++) {\n                            var entry = entries_2[_i];\n                            for (var _a = 0, _b = entry.references; _a < _b.length; _a++) {\n                                var reference = _b[_a];\n                                if (reference.kind === 1 /* Node */) {\n                                    // argument in super(...)\n                                    var isSuperCall_1 = ts.isSuperKeyword(reference.node)\n                                        && ts.isCallExpression(reference.node.parent)\n                                        && reference.node.parent.arguments.length > index;\n                                    // argument in super.m(...)\n                                    var isSuperMethodCall = ts.isPropertyAccessExpression(reference.node.parent)\n                                        && ts.isSuperKeyword(reference.node.parent.expression)\n                                        && ts.isCallExpression(reference.node.parent.parent)\n                                        && reference.node.parent.parent.arguments.length > index;\n                                    // parameter in overridden or overriding method\n                                    var isOverriddenMethod = (ts.isMethodDeclaration(reference.node.parent) || ts.isMethodSignature(reference.node.parent))\n                                        && reference.node.parent !== parameter.parent\n                                        && reference.node.parent.parameters.length > index;\n                                    if (isSuperCall_1 || isSuperMethodCall || isOverriddenMethod)\n                                        return false;\n                                }\n                            }\n                        }\n                    }\n                    return true;\n                case 251 /* FunctionDeclaration */: {\n                    if (parent.name && isCallbackLike(checker, sourceFile, parent.name)) {\n                        return isLastParameter(parent, parameter, isFixAll);\n                    }\n                    return true;\n                }\n                case 208 /* FunctionExpression */:\n                case 209 /* ArrowFunction */:\n                    // Can't remove a non-last parameter in a callback. Can remove a parameter in code-fix-all if future parameters are also unused.\n                    return isLastParameter(parent, parameter, isFixAll);\n                case 168 /* SetAccessor */:\n                    // Setter must have a parameter\n                    return false;\n                default:\n                    return ts.Debug.failBadSyntaxKind(parent);\n            }\n        }\n        function isCallbackLike(checker, sourceFile, name) {\n            return !!ts.FindAllReferences.Core.eachSymbolReferenceInFile(name, checker, sourceFile, function (reference) {\n                return ts.isIdentifier(reference) && ts.isCallExpression(reference.parent) && reference.parent.arguments.indexOf(reference) >= 0;\n            });\n        }\n        function isLastParameter(func, parameter, isFixAll) {\n            var parameters = func.parameters;\n            var index = parameters.indexOf(parameter);\n            ts.Debug.assert(index !== -1, \"The parameter should already be in the list\");\n            return isFixAll ?\n                parameters.slice(index + 1).every(function (p) { return ts.isIdentifier(p.name) && !p.symbol.isReferenced; }) :\n                index === parameters.length - 1;\n        }\n        function mayDeleteExpression(node) {\n            return ((ts.isBinaryExpression(node.parent) && node.parent.left === node) ||\n                ((ts.isPostfixUnaryExpression(node.parent) || ts.isPrefixUnaryExpression(node.parent)) && node.parent.operand === node)) && ts.isExpressionStatement(node.parent.parent);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"fixUnreachableCode\";\n        var errorCodes = [ts.Diagnostics.Unreachable_code_detected.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, context.span.start, context.span.length, context.errorCode); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Remove_unreachable_code, fixId, ts.Diagnostics.Remove_all_unreachable_code)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return doChange(changes, diag.file, diag.start, diag.length, diag.code); }); },\n        });\n        function doChange(changes, sourceFile, start, length, errorCode) {\n            var token = ts.getTokenAtPosition(sourceFile, start);\n            var statement = ts.findAncestor(token, ts.isStatement);\n            if (statement.getStart(sourceFile) !== token.getStart(sourceFile)) {\n                var logData = JSON.stringify({\n                    statementKind: ts.Debug.formatSyntaxKind(statement.kind),\n                    tokenKind: ts.Debug.formatSyntaxKind(token.kind),\n                    errorCode: errorCode,\n                    start: start,\n                    length: length\n                });\n                ts.Debug.fail(\"Token and statement should start at the same point. \" + logData);\n            }\n            var container = (ts.isBlock(statement.parent) ? statement.parent : statement).parent;\n            if (!ts.isBlock(statement.parent) || statement === ts.first(statement.parent.statements)) {\n                switch (container.kind) {\n                    case 234 /* IfStatement */:\n                        if (container.elseStatement) {\n                            if (ts.isBlock(statement.parent)) {\n                                break;\n                            }\n                            else {\n                                changes.replaceNode(sourceFile, statement, ts.factory.createBlock(ts.emptyArray));\n                            }\n                            return;\n                        }\n                    // falls through\n                    case 236 /* WhileStatement */:\n                    case 237 /* ForStatement */:\n                        changes.delete(sourceFile, container);\n                        return;\n                }\n            }\n            if (ts.isBlock(statement.parent)) {\n                var end_3 = start + length;\n                var lastStatement = ts.Debug.checkDefined(lastWhere(ts.sliceAfter(statement.parent.statements, statement), function (s) { return s.pos < end_3; }), \"Some statement should be last\");\n                changes.deleteNodeRange(sourceFile, statement, lastStatement);\n            }\n            else {\n                changes.delete(sourceFile, statement);\n            }\n        }\n        function lastWhere(a, pred) {\n            var last;\n            for (var _i = 0, a_1 = a; _i < a_1.length; _i++) {\n                var value = a_1[_i];\n                if (!pred(value))\n                    break;\n                last = value;\n            }\n            return last;\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"fixUnusedLabel\";\n        var errorCodes = [ts.Diagnostics.Unused_label.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, context.span.start); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Remove_unused_label, fixId, ts.Diagnostics.Remove_all_unused_labels)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return doChange(changes, diag.file, diag.start); }); },\n        });\n        function doChange(changes, sourceFile, start) {\n            var token = ts.getTokenAtPosition(sourceFile, start);\n            var labeledStatement = ts.cast(token.parent, ts.isLabeledStatement);\n            var pos = token.getStart(sourceFile);\n            var statementPos = labeledStatement.statement.getStart(sourceFile);\n            // If label is on a separate line, just delete the rest of that line, but not the indentation of the labeled statement.\n            var end = ts.positionsAreOnSameLine(pos, statementPos, sourceFile) ? statementPos\n                : ts.skipTrivia(sourceFile.text, ts.findChildOfKind(labeledStatement, 58 /* ColonToken */, sourceFile).end, /*stopAfterLineBreak*/ true);\n            changes.deleteRange(sourceFile, { pos: pos, end: end });\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixIdPlain = \"fixJSDocTypes_plain\";\n        var fixIdNullable = \"fixJSDocTypes_nullable\";\n        var errorCodes = [ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile;\n                var checker = context.program.getTypeChecker();\n                var info = getInfo(sourceFile, context.span.start, checker);\n                if (!info)\n                    return undefined;\n                var typeNode = info.typeNode, type = info.type;\n                var original = typeNode.getText(sourceFile);\n                var actions = [fix(type, fixIdPlain, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)];\n                if (typeNode.kind === 305 /* JSDocNullableType */) {\n                    // for nullable types, suggest the flow-compatible `T | null | undefined`\n                    // in addition to the jsdoc/closure-compatible `T | null`\n                    actions.push(fix(checker.getNullableType(type, 32768 /* Undefined */), fixIdNullable, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types));\n                }\n                return actions;\n                function fix(type, fixId, fixAllDescription) {\n                    var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, typeNode, type, checker); });\n                    return codefix.createCodeFixAction(\"jdocTypes\", changes, [ts.Diagnostics.Change_0_to_1, original, checker.typeToString(type)], fixId, fixAllDescription);\n                }\n            },\n            fixIds: [fixIdPlain, fixIdNullable],\n            getAllCodeActions: function (context) {\n                var fixId = context.fixId, program = context.program, sourceFile = context.sourceFile;\n                var checker = program.getTypeChecker();\n                return codefix.codeFixAll(context, errorCodes, function (changes, err) {\n                    var info = getInfo(err.file, err.start, checker);\n                    if (!info)\n                        return;\n                    var typeNode = info.typeNode, type = info.type;\n                    var fixedType = typeNode.kind === 305 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type;\n                    doChange(changes, sourceFile, typeNode, fixedType, checker);\n                });\n            }\n        });\n        function doChange(changes, sourceFile, oldTypeNode, newType, checker) {\n            changes.replaceNode(sourceFile, oldTypeNode, checker.typeToTypeNode(newType, /*enclosingDeclaration*/ oldTypeNode, /*flags*/ undefined)); // TODO: GH#18217\n        }\n        function getInfo(sourceFile, pos, checker) {\n            var decl = ts.findAncestor(ts.getTokenAtPosition(sourceFile, pos), isTypeContainer);\n            var typeNode = decl && decl.type;\n            return typeNode && { typeNode: typeNode, type: checker.getTypeFromTypeNode(typeNode) };\n        }\n        function isTypeContainer(node) {\n            // NOTE: Some locations are not handled yet:\n            // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments\n            switch (node.kind) {\n                case 224 /* AsExpression */:\n                case 169 /* CallSignature */:\n                case 170 /* ConstructSignature */:\n                case 251 /* FunctionDeclaration */:\n                case 167 /* GetAccessor */:\n                case 171 /* IndexSignature */:\n                case 190 /* MappedType */:\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                case 160 /* Parameter */:\n                case 163 /* PropertyDeclaration */:\n                case 162 /* PropertySignature */:\n                case 168 /* SetAccessor */:\n                case 254 /* TypeAliasDeclaration */:\n                case 206 /* TypeAssertionExpression */:\n                case 249 /* VariableDeclaration */:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"fixMissingCallParentheses\";\n        var errorCodes = [\n            ts.Diagnostics.This_condition_will_always_return_true_since_the_function_is_always_defined_Did_you_mean_to_call_it_instead.code,\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            fixIds: [fixId],\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, span = context.span;\n                var callName = getCallName(sourceFile, span.start);\n                if (!callName)\n                    return;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, callName); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_missing_call_parentheses, fixId, ts.Diagnostics.Add_all_missing_call_parentheses)];\n            },\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                var callName = getCallName(diag.file, diag.start);\n                if (callName)\n                    doChange(changes, diag.file, callName);\n            }); }\n        });\n        function doChange(changes, sourceFile, name) {\n            changes.replaceNodeWithText(sourceFile, name, name.text + \"()\");\n        }\n        function getCallName(sourceFile, start) {\n            var token = ts.getTokenAtPosition(sourceFile, start);\n            if (ts.isPropertyAccessExpression(token.parent)) {\n                var current = token.parent;\n                while (ts.isPropertyAccessExpression(current.parent)) {\n                    current = current.parent;\n                }\n                return current.name;\n            }\n            if (ts.isIdentifier(token)) {\n                return token;\n            }\n            return undefined;\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"fixAwaitInSyncFunction\";\n        var errorCodes = [\n            ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,\n            ts.Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, span = context.span;\n                var nodes = getNodes(sourceFile, span.start);\n                if (!nodes)\n                    return undefined;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, nodes); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_async_modifier_to_containing_function, fixId, ts.Diagnostics.Add_all_missing_async_modifiers)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) {\n                var seen = new ts.Map();\n                return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                    var nodes = getNodes(diag.file, diag.start);\n                    if (!nodes || !ts.addToSeen(seen, ts.getNodeId(nodes.insertBefore)))\n                        return;\n                    doChange(changes, context.sourceFile, nodes);\n                });\n            },\n        });\n        function getReturnType(expr) {\n            if (expr.type) {\n                return expr.type;\n            }\n            if (ts.isVariableDeclaration(expr.parent) &&\n                expr.parent.type &&\n                ts.isFunctionTypeNode(expr.parent.type)) {\n                return expr.parent.type.type;\n            }\n        }\n        function getNodes(sourceFile, start) {\n            var token = ts.getTokenAtPosition(sourceFile, start);\n            var containingFunction = ts.getContainingFunction(token);\n            if (!containingFunction) {\n                return;\n            }\n            var insertBefore;\n            switch (containingFunction.kind) {\n                case 165 /* MethodDeclaration */:\n                    insertBefore = containingFunction.name;\n                    break;\n                case 251 /* FunctionDeclaration */:\n                case 208 /* FunctionExpression */:\n                    insertBefore = ts.findChildOfKind(containingFunction, 97 /* FunctionKeyword */, sourceFile);\n                    break;\n                case 209 /* ArrowFunction */:\n                    insertBefore = ts.findChildOfKind(containingFunction, 20 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters);\n                    break;\n                default:\n                    return;\n            }\n            return insertBefore && {\n                insertBefore: insertBefore,\n                returnType: getReturnType(containingFunction)\n            };\n        }\n        function doChange(changes, sourceFile, _a) {\n            var insertBefore = _a.insertBefore, returnType = _a.returnType;\n            if (returnType) {\n                var entityName = ts.getEntityNameFromTypeNode(returnType);\n                if (!entityName || entityName.kind !== 78 /* Identifier */ || entityName.text !== \"Promise\") {\n                    changes.replaceNode(sourceFile, returnType, ts.factory.createTypeReferenceNode(\"Promise\", ts.factory.createNodeArray([returnType])));\n                }\n            }\n            changes.insertModifierBefore(sourceFile, 129 /* AsyncKeyword */, insertBefore);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var errorCodes = [\n            ts.Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code,\n            ts.Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code,\n        ];\n        var fixId = \"fixPropertyOverrideAccessor\";\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var edits = doChange(context.sourceFile, context.span.start, context.span.length, context.errorCode, context);\n                if (edits) {\n                    return [codefix.createCodeFixAction(fixId, edits, ts.Diagnostics.Generate_get_and_set_accessors, fixId, ts.Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)];\n                }\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                var edits = doChange(diag.file, diag.start, diag.length, diag.code, context);\n                if (edits) {\n                    for (var _i = 0, edits_2 = edits; _i < edits_2.length; _i++) {\n                        var edit = edits_2[_i];\n                        changes.pushRaw(context.sourceFile, edit);\n                    }\n                }\n            }); },\n        });\n        function doChange(file, start, length, code, context) {\n            var startPosition;\n            var endPosition;\n            if (code === ts.Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code) {\n                startPosition = start;\n                endPosition = start + length;\n            }\n            else if (code === ts.Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code) {\n                var checker = context.program.getTypeChecker();\n                var node = ts.getTokenAtPosition(file, start).parent;\n                ts.Debug.assert(ts.isAccessor(node), \"error span of fixPropertyOverrideAccessor should only be on an accessor\");\n                var containingClass = node.parent;\n                ts.Debug.assert(ts.isClassLike(containingClass), \"erroneous accessors should only be inside classes\");\n                var base = ts.singleOrUndefined(codefix.getAllSupers(containingClass, checker));\n                if (!base)\n                    return [];\n                var name = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(node.name));\n                var baseProp = checker.getPropertyOfType(checker.getTypeAtLocation(base), name);\n                if (!baseProp || !baseProp.valueDeclaration)\n                    return [];\n                startPosition = baseProp.valueDeclaration.pos;\n                endPosition = baseProp.valueDeclaration.end;\n                file = ts.getSourceFileOfNode(baseProp.valueDeclaration);\n            }\n            else {\n                ts.Debug.fail(\"fixPropertyOverrideAccessor codefix got unexpected error code \" + code);\n            }\n            return codefix.generateAccessorFromProperty(file, context.program, startPosition, endPosition, context, ts.Diagnostics.Generate_get_and_set_accessors.message);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"inferFromUsage\";\n        var errorCodes = [\n            // Variable declarations\n            ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code,\n            // Variable uses\n            ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code,\n            // Parameter declarations\n            ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code,\n            ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code,\n            // Get Accessor declarations\n            ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code,\n            ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code,\n            // Set Accessor declarations\n            ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code,\n            // Property declarations\n            ts.Diagnostics.Member_0_implicitly_has_an_1_type.code,\n            //// Suggestions\n            // Variable declarations\n            ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code,\n            // Variable uses\n            ts.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,\n            // Parameter declarations\n            ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,\n            ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code,\n            // Get Accessor declarations\n            ts.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code,\n            ts.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code,\n            // Set Accessor declarations\n            ts.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code,\n            // Property declarations\n            ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,\n            // Function expressions and declarations\n            ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code,\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, program = context.program, start = context.span.start, errorCode = context.errorCode, cancellationToken = context.cancellationToken, host = context.host, preferences = context.preferences;\n                var token = ts.getTokenAtPosition(sourceFile, start);\n                var declaration;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (changes) { declaration = doChange(changes, sourceFile, token, errorCode, program, cancellationToken, /*markSeen*/ ts.returnTrue, host, preferences); });\n                var name = declaration && ts.getNameOfDeclaration(declaration);\n                return !name || changes.length === 0 ? undefined\n                    : [codefix.createCodeFixAction(fixId, changes, [getDiagnostic(errorCode, token), name.getText(sourceFile)], fixId, ts.Diagnostics.Infer_all_types_from_usage)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) {\n                var sourceFile = context.sourceFile, program = context.program, cancellationToken = context.cancellationToken, host = context.host, preferences = context.preferences;\n                var markSeen = ts.nodeSeenTracker();\n                return codefix.codeFixAll(context, errorCodes, function (changes, err) {\n                    doChange(changes, sourceFile, ts.getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences);\n                });\n            },\n        });\n        function getDiagnostic(errorCode, token) {\n            switch (errorCode) {\n                case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code:\n                case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:\n                    return ts.isSetAccessorDeclaration(ts.getContainingFunction(token)) ? ts.Diagnostics.Infer_type_of_0_from_usage : ts.Diagnostics.Infer_parameter_types_from_usage; // TODO: GH#18217\n                case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code:\n                case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:\n                    return ts.Diagnostics.Infer_parameter_types_from_usage;\n                case ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:\n                    return ts.Diagnostics.Infer_this_type_of_0_from_usage;\n                default:\n                    return ts.Diagnostics.Infer_type_of_0_from_usage;\n            }\n        }\n        /** Map suggestion code to error code */\n        function mapSuggestionDiagnostic(errorCode) {\n            switch (errorCode) {\n                case ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code:\n                    return ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code;\n                case ts.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:\n                    return ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code;\n                case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:\n                    return ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code;\n                case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:\n                    return ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code;\n                case ts.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code:\n                    return ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code;\n                case ts.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code:\n                    return ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code;\n                case ts.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code:\n                    return ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code;\n                case ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:\n                    return ts.Diagnostics.Member_0_implicitly_has_an_1_type.code;\n            }\n            return errorCode;\n        }\n        function doChange(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) {\n            if (!ts.isParameterPropertyModifier(token.kind) && token.kind !== 78 /* Identifier */ && token.kind !== 25 /* DotDotDotToken */ && token.kind !== 107 /* ThisKeyword */) {\n                return undefined;\n            }\n            var parent = token.parent;\n            var importAdder = codefix.createImportAdder(sourceFile, program, preferences, host);\n            errorCode = mapSuggestionDiagnostic(errorCode);\n            switch (errorCode) {\n                // Variable and Property declarations\n                case ts.Diagnostics.Member_0_implicitly_has_an_1_type.code:\n                case ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code:\n                    if ((ts.isVariableDeclaration(parent) && markSeen(parent)) || ts.isPropertyDeclaration(parent) || ts.isPropertySignature(parent)) { // handle bad location\n                        annotateVariableDeclaration(changes, importAdder, sourceFile, parent, program, host, cancellationToken);\n                        importAdder.writeFixes(changes);\n                        return parent;\n                    }\n                    if (ts.isPropertyAccessExpression(parent)) {\n                        var type = inferTypeForVariableFromUsage(parent.name, program, cancellationToken);\n                        var typeNode = ts.getTypeNodeIfAccessible(type, parent, program, host);\n                        if (typeNode) {\n                            // Note that the codefix will never fire with an existing `@type` tag, so there is no need to merge tags\n                            var typeTag = ts.factory.createJSDocTypeTag(/*tagName*/ undefined, ts.factory.createJSDocTypeExpression(typeNode), /*comment*/ \"\");\n                            addJSDocTags(changes, sourceFile, ts.cast(parent.parent.parent, ts.isExpressionStatement), [typeTag]);\n                        }\n                        importAdder.writeFixes(changes);\n                        return parent;\n                    }\n                    return undefined;\n                case ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code: {\n                    var symbol = program.getTypeChecker().getSymbolAtLocation(token);\n                    if (symbol && symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && markSeen(symbol.valueDeclaration)) {\n                        annotateVariableDeclaration(changes, importAdder, sourceFile, symbol.valueDeclaration, program, host, cancellationToken);\n                        importAdder.writeFixes(changes);\n                        return symbol.valueDeclaration;\n                    }\n                    return undefined;\n                }\n            }\n            var containingFunction = ts.getContainingFunction(token);\n            if (containingFunction === undefined) {\n                return undefined;\n            }\n            var declaration;\n            switch (errorCode) {\n                // Parameter declarations\n                case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code:\n                    if (ts.isSetAccessorDeclaration(containingFunction)) {\n                        annotateSetAccessor(changes, importAdder, sourceFile, containingFunction, program, host, cancellationToken);\n                        declaration = containingFunction;\n                        break;\n                    }\n                // falls through\n                case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code:\n                    if (markSeen(containingFunction)) {\n                        var param = ts.cast(parent, ts.isParameter);\n                        annotateParameters(changes, importAdder, sourceFile, param, containingFunction, program, host, cancellationToken);\n                        declaration = param;\n                    }\n                    break;\n                // Get Accessor declarations\n                case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code:\n                case ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code:\n                    if (ts.isGetAccessorDeclaration(containingFunction) && ts.isIdentifier(containingFunction.name)) {\n                        annotate(changes, importAdder, sourceFile, containingFunction, inferTypeForVariableFromUsage(containingFunction.name, program, cancellationToken), program, host);\n                        declaration = containingFunction;\n                    }\n                    break;\n                // Set Accessor declarations\n                case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code:\n                    if (ts.isSetAccessorDeclaration(containingFunction)) {\n                        annotateSetAccessor(changes, importAdder, sourceFile, containingFunction, program, host, cancellationToken);\n                        declaration = containingFunction;\n                    }\n                    break;\n                // Function 'this'\n                case ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:\n                    if (ts.textChanges.isThisTypeAnnotatable(containingFunction) && markSeen(containingFunction)) {\n                        annotateThis(changes, sourceFile, containingFunction, program, host, cancellationToken);\n                        declaration = containingFunction;\n                    }\n                    break;\n                default:\n                    return ts.Debug.fail(String(errorCode));\n            }\n            importAdder.writeFixes(changes);\n            return declaration;\n        }\n        function annotateVariableDeclaration(changes, importAdder, sourceFile, declaration, program, host, cancellationToken) {\n            if (ts.isIdentifier(declaration.name)) {\n                annotate(changes, importAdder, sourceFile, declaration, inferTypeForVariableFromUsage(declaration.name, program, cancellationToken), program, host);\n            }\n        }\n        function annotateParameters(changes, importAdder, sourceFile, parameterDeclaration, containingFunction, program, host, cancellationToken) {\n            if (!ts.isIdentifier(parameterDeclaration.name)) {\n                return;\n            }\n            var parameterInferences = inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken);\n            ts.Debug.assert(containingFunction.parameters.length === parameterInferences.length, \"Parameter count and inference count should match\");\n            if (ts.isInJSFile(containingFunction)) {\n                annotateJSDocParameters(changes, sourceFile, parameterInferences, program, host);\n            }\n            else {\n                var needParens = ts.isArrowFunction(containingFunction) && !ts.findChildOfKind(containingFunction, 20 /* OpenParenToken */, sourceFile);\n                if (needParens)\n                    changes.insertNodeBefore(sourceFile, ts.first(containingFunction.parameters), ts.factory.createToken(20 /* OpenParenToken */));\n                for (var _i = 0, parameterInferences_1 = parameterInferences; _i < parameterInferences_1.length; _i++) {\n                    var _a = parameterInferences_1[_i], declaration = _a.declaration, type = _a.type;\n                    if (declaration && !declaration.type && !declaration.initializer) {\n                        annotate(changes, importAdder, sourceFile, declaration, type, program, host);\n                    }\n                }\n                if (needParens)\n                    changes.insertNodeAfter(sourceFile, ts.last(containingFunction.parameters), ts.factory.createToken(21 /* CloseParenToken */));\n            }\n        }\n        function annotateThis(changes, sourceFile, containingFunction, program, host, cancellationToken) {\n            var references = getFunctionReferences(containingFunction, sourceFile, program, cancellationToken);\n            if (!references || !references.length) {\n                return;\n            }\n            var thisInference = inferTypeFromReferences(program, references, cancellationToken).thisParameter();\n            var typeNode = ts.getTypeNodeIfAccessible(thisInference, containingFunction, program, host);\n            if (!typeNode) {\n                return;\n            }\n            if (ts.isInJSFile(containingFunction)) {\n                annotateJSDocThis(changes, sourceFile, containingFunction, typeNode);\n            }\n            else {\n                changes.tryInsertThisTypeAnnotation(sourceFile, containingFunction, typeNode);\n            }\n        }\n        function annotateJSDocThis(changes, sourceFile, containingFunction, typeNode) {\n            addJSDocTags(changes, sourceFile, containingFunction, [\n                ts.factory.createJSDocThisTag(/*tagName*/ undefined, ts.factory.createJSDocTypeExpression(typeNode)),\n            ]);\n        }\n        function annotateSetAccessor(changes, importAdder, sourceFile, setAccessorDeclaration, program, host, cancellationToken) {\n            var param = ts.firstOrUndefined(setAccessorDeclaration.parameters);\n            if (param && ts.isIdentifier(setAccessorDeclaration.name) && ts.isIdentifier(param.name)) {\n                var type = inferTypeForVariableFromUsage(setAccessorDeclaration.name, program, cancellationToken);\n                if (type === program.getTypeChecker().getAnyType()) {\n                    type = inferTypeForVariableFromUsage(param.name, program, cancellationToken);\n                }\n                if (ts.isInJSFile(setAccessorDeclaration)) {\n                    annotateJSDocParameters(changes, sourceFile, [{ declaration: param, type: type }], program, host);\n                }\n                else {\n                    annotate(changes, importAdder, sourceFile, param, type, program, host);\n                }\n            }\n        }\n        function annotate(changes, importAdder, sourceFile, declaration, type, program, host) {\n            var typeNode = ts.getTypeNodeIfAccessible(type, declaration, program, host);\n            if (typeNode) {\n                if (ts.isInJSFile(sourceFile) && declaration.kind !== 162 /* PropertySignature */) {\n                    var parent = ts.isVariableDeclaration(declaration) ? ts.tryCast(declaration.parent.parent, ts.isVariableStatement) : declaration;\n                    if (!parent) {\n                        return;\n                    }\n                    var typeExpression = ts.factory.createJSDocTypeExpression(typeNode);\n                    var typeTag = ts.isGetAccessorDeclaration(declaration) ? ts.factory.createJSDocReturnTag(/*tagName*/ undefined, typeExpression, \"\") : ts.factory.createJSDocTypeTag(/*tagName*/ undefined, typeExpression, \"\");\n                    addJSDocTags(changes, sourceFile, parent, [typeTag]);\n                }\n                else if (!tryReplaceImportTypeNodeWithAutoImport(typeNode, declaration, sourceFile, changes, importAdder, ts.getEmitScriptTarget(program.getCompilerOptions()))) {\n                    changes.tryInsertTypeAnnotation(sourceFile, declaration, typeNode);\n                }\n            }\n        }\n        function tryReplaceImportTypeNodeWithAutoImport(typeNode, declaration, sourceFile, changes, importAdder, scriptTarget) {\n            var importableReference = codefix.tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget);\n            if (importableReference && changes.tryInsertTypeAnnotation(sourceFile, declaration, importableReference.typeNode)) {\n                ts.forEach(importableReference.symbols, function (s) { return importAdder.addImportFromExportedSymbol(s, /*usageIsTypeOnly*/ true); });\n                return true;\n            }\n            return false;\n        }\n        function annotateJSDocParameters(changes, sourceFile, parameterInferences, program, host) {\n            var signature = parameterInferences.length && parameterInferences[0].declaration.parent;\n            if (!signature) {\n                return;\n            }\n            var inferences = ts.mapDefined(parameterInferences, function (inference) {\n                var param = inference.declaration;\n                // only infer parameters that have (1) no type and (2) an accessible inferred type\n                if (param.initializer || ts.getJSDocType(param) || !ts.isIdentifier(param.name)) {\n                    return;\n                }\n                var typeNode = inference.type && ts.getTypeNodeIfAccessible(inference.type, param, program, host);\n                if (typeNode) {\n                    var name = ts.factory.cloneNode(param.name);\n                    ts.setEmitFlags(name, 1536 /* NoComments */ | 2048 /* NoNestedComments */);\n                    return { name: ts.factory.cloneNode(param.name), param: param, isOptional: !!inference.isOptional, typeNode: typeNode };\n                }\n            });\n            if (!inferences.length) {\n                return;\n            }\n            if (ts.isArrowFunction(signature) || ts.isFunctionExpression(signature)) {\n                var needParens = ts.isArrowFunction(signature) && !ts.findChildOfKind(signature, 20 /* OpenParenToken */, sourceFile);\n                if (needParens) {\n                    changes.insertNodeBefore(sourceFile, ts.first(signature.parameters), ts.factory.createToken(20 /* OpenParenToken */));\n                }\n                ts.forEach(inferences, function (_a) {\n                    var typeNode = _a.typeNode, param = _a.param;\n                    var typeTag = ts.factory.createJSDocTypeTag(/*tagName*/ undefined, ts.factory.createJSDocTypeExpression(typeNode));\n                    var jsDoc = ts.factory.createJSDocComment(/*comment*/ undefined, [typeTag]);\n                    changes.insertNodeAt(sourceFile, param.getStart(sourceFile), jsDoc, { suffix: \" \" });\n                });\n                if (needParens) {\n                    changes.insertNodeAfter(sourceFile, ts.last(signature.parameters), ts.factory.createToken(21 /* CloseParenToken */));\n                }\n            }\n            else {\n                var paramTags = ts.map(inferences, function (_a) {\n                    var name = _a.name, typeNode = _a.typeNode, isOptional = _a.isOptional;\n                    return ts.factory.createJSDocParameterTag(/*tagName*/ undefined, name, /*isBracketed*/ !!isOptional, ts.factory.createJSDocTypeExpression(typeNode), /* isNameFirst */ false, \"\");\n                });\n                addJSDocTags(changes, sourceFile, signature, paramTags);\n            }\n        }\n        function addJSDocTags(changes, sourceFile, parent, newTags) {\n            var comments = ts.mapDefined(parent.jsDoc, function (j) { return j.comment; });\n            var oldTags = ts.flatMapToMutable(parent.jsDoc, function (j) { return j.tags; });\n            var unmergedNewTags = newTags.filter(function (newTag) { return !oldTags || !oldTags.some(function (tag, i) {\n                var merged = tryMergeJsdocTags(tag, newTag);\n                if (merged)\n                    oldTags[i] = merged;\n                return !!merged;\n            }); });\n            var tag = ts.factory.createJSDocComment(comments.join(\"\\n\"), ts.factory.createNodeArray(__spreadArray(__spreadArray([], (oldTags || ts.emptyArray)), unmergedNewTags)));\n            var jsDocNode = parent.kind === 209 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent;\n            jsDocNode.jsDoc = parent.jsDoc;\n            jsDocNode.jsDocCache = parent.jsDocCache;\n            changes.insertJsdocCommentBefore(sourceFile, jsDocNode, tag);\n        }\n        codefix.addJSDocTags = addJSDocTags;\n        function getJsDocNodeForArrowFunction(signature) {\n            if (signature.parent.kind === 163 /* PropertyDeclaration */) {\n                return signature.parent;\n            }\n            return signature.parent.parent;\n        }\n        function tryMergeJsdocTags(oldTag, newTag) {\n            if (oldTag.kind !== newTag.kind) {\n                return undefined;\n            }\n            switch (oldTag.kind) {\n                case 326 /* JSDocParameterTag */: {\n                    var oldParam = oldTag;\n                    var newParam = newTag;\n                    return ts.isIdentifier(oldParam.name) && ts.isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText\n                        ? ts.factory.createJSDocParameterTag(/*tagName*/ undefined, newParam.name, /*isBracketed*/ false, newParam.typeExpression, newParam.isNameFirst, oldParam.comment)\n                        : undefined;\n                }\n                case 327 /* JSDocReturnTag */:\n                    return ts.factory.createJSDocReturnTag(/*tagName*/ undefined, newTag.typeExpression, oldTag.comment);\n            }\n        }\n        function getReferences(token, program, cancellationToken) {\n            // Position shouldn't matter since token is not a SourceFile.\n            return ts.mapDefined(ts.FindAllReferences.getReferenceEntriesForNode(-1, token, program, program.getSourceFiles(), cancellationToken), function (entry) {\n                return entry.kind !== 0 /* Span */ ? ts.tryCast(entry.node, ts.isIdentifier) : undefined;\n            });\n        }\n        function inferTypeForVariableFromUsage(token, program, cancellationToken) {\n            var references = getReferences(token, program, cancellationToken);\n            return inferTypeFromReferences(program, references, cancellationToken).single();\n        }\n        function inferTypeForParametersFromUsage(func, sourceFile, program, cancellationToken) {\n            var references = getFunctionReferences(func, sourceFile, program, cancellationToken);\n            return references && inferTypeFromReferences(program, references, cancellationToken).parameters(func) ||\n                func.parameters.map(function (p) { return ({\n                    declaration: p,\n                    type: ts.isIdentifier(p.name) ? inferTypeForVariableFromUsage(p.name, program, cancellationToken) : program.getTypeChecker().getAnyType()\n                }); });\n        }\n        function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) {\n            var searchToken;\n            switch (containingFunction.kind) {\n                case 166 /* Constructor */:\n                    searchToken = ts.findChildOfKind(containingFunction, 132 /* ConstructorKeyword */, sourceFile);\n                    break;\n                case 209 /* ArrowFunction */:\n                case 208 /* FunctionExpression */:\n                    var parent = containingFunction.parent;\n                    searchToken = (ts.isVariableDeclaration(parent) || ts.isPropertyDeclaration(parent)) && ts.isIdentifier(parent.name) ?\n                        parent.name :\n                        containingFunction.name;\n                    break;\n                case 251 /* FunctionDeclaration */:\n                case 165 /* MethodDeclaration */:\n                case 164 /* MethodSignature */:\n                    searchToken = containingFunction.name;\n                    break;\n            }\n            if (!searchToken) {\n                return undefined;\n            }\n            return getReferences(searchToken, program, cancellationToken);\n        }\n        function inferTypeFromReferences(program, references, cancellationToken) {\n            var checker = program.getTypeChecker();\n            var builtinConstructors = {\n                string: function () { return checker.getStringType(); },\n                number: function () { return checker.getNumberType(); },\n                Array: function (t) { return checker.createArrayType(t); },\n                Promise: function (t) { return checker.createPromiseType(t); },\n            };\n            var builtins = [\n                checker.getStringType(),\n                checker.getNumberType(),\n                checker.createArrayType(checker.getAnyType()),\n                checker.createPromiseType(checker.getAnyType()),\n            ];\n            return {\n                single: single,\n                parameters: parameters,\n                thisParameter: thisParameter,\n            };\n            function createEmptyUsage() {\n                return {\n                    isNumber: undefined,\n                    isString: undefined,\n                    isNumberOrString: undefined,\n                    candidateTypes: undefined,\n                    properties: undefined,\n                    calls: undefined,\n                    constructs: undefined,\n                    numberIndex: undefined,\n                    stringIndex: undefined,\n                    candidateThisTypes: undefined,\n                    inferredTypes: undefined,\n                };\n            }\n            function combineUsages(usages) {\n                var combinedProperties = new ts.Map();\n                for (var _i = 0, usages_1 = usages; _i < usages_1.length; _i++) {\n                    var u = usages_1[_i];\n                    if (u.properties) {\n                        u.properties.forEach(function (p, name) {\n                            if (!combinedProperties.has(name)) {\n                                combinedProperties.set(name, []);\n                            }\n                            combinedProperties.get(name).push(p);\n                        });\n                    }\n                }\n                var properties = new ts.Map();\n                combinedProperties.forEach(function (ps, name) {\n                    properties.set(name, combineUsages(ps));\n                });\n                return {\n                    isNumber: usages.some(function (u) { return u.isNumber; }),\n                    isString: usages.some(function (u) { return u.isString; }),\n                    isNumberOrString: usages.some(function (u) { return u.isNumberOrString; }),\n                    candidateTypes: ts.flatMap(usages, function (u) { return u.candidateTypes; }),\n                    properties: properties,\n                    calls: ts.flatMap(usages, function (u) { return u.calls; }),\n                    constructs: ts.flatMap(usages, function (u) { return u.constructs; }),\n                    numberIndex: ts.forEach(usages, function (u) { return u.numberIndex; }),\n                    stringIndex: ts.forEach(usages, function (u) { return u.stringIndex; }),\n                    candidateThisTypes: ts.flatMap(usages, function (u) { return u.candidateThisTypes; }),\n                    inferredTypes: undefined, // clear type cache\n                };\n            }\n            function single() {\n                return combineTypes(inferTypesFromReferencesSingle(references));\n            }\n            function parameters(declaration) {\n                if (references.length === 0 || !declaration.parameters) {\n                    return undefined;\n                }\n                var usage = createEmptyUsage();\n                for (var _i = 0, references_3 = references; _i < references_3.length; _i++) {\n                    var reference = references_3[_i];\n                    cancellationToken.throwIfCancellationRequested();\n                    calculateUsageOfNode(reference, usage);\n                }\n                var calls = __spreadArray(__spreadArray([], usage.constructs || []), usage.calls || []);\n                return declaration.parameters.map(function (parameter, parameterIndex) {\n                    var types = [];\n                    var isRest = ts.isRestParameter(parameter);\n                    var isOptional = false;\n                    for (var _i = 0, calls_1 = calls; _i < calls_1.length; _i++) {\n                        var call = calls_1[_i];\n                        if (call.argumentTypes.length <= parameterIndex) {\n                            isOptional = ts.isInJSFile(declaration);\n                            types.push(checker.getUndefinedType());\n                        }\n                        else if (isRest) {\n                            for (var i = parameterIndex; i < call.argumentTypes.length; i++) {\n                                types.push(checker.getBaseTypeOfLiteralType(call.argumentTypes[i]));\n                            }\n                        }\n                        else {\n                            types.push(checker.getBaseTypeOfLiteralType(call.argumentTypes[parameterIndex]));\n                        }\n                    }\n                    if (ts.isIdentifier(parameter.name)) {\n                        var inferred = inferTypesFromReferencesSingle(getReferences(parameter.name, program, cancellationToken));\n                        types.push.apply(types, (isRest ? ts.mapDefined(inferred, checker.getElementTypeOfArrayType) : inferred));\n                    }\n                    var type = combineTypes(types);\n                    return {\n                        type: isRest ? checker.createArrayType(type) : type,\n                        isOptional: isOptional && !isRest,\n                        declaration: parameter\n                    };\n                });\n            }\n            function thisParameter() {\n                var usage = createEmptyUsage();\n                for (var _i = 0, references_4 = references; _i < references_4.length; _i++) {\n                    var reference = references_4[_i];\n                    cancellationToken.throwIfCancellationRequested();\n                    calculateUsageOfNode(reference, usage);\n                }\n                return combineTypes(usage.candidateThisTypes || ts.emptyArray);\n            }\n            function inferTypesFromReferencesSingle(references) {\n                var usage = createEmptyUsage();\n                for (var _i = 0, references_5 = references; _i < references_5.length; _i++) {\n                    var reference = references_5[_i];\n                    cancellationToken.throwIfCancellationRequested();\n                    calculateUsageOfNode(reference, usage);\n                }\n                return inferTypes(usage);\n            }\n            function calculateUsageOfNode(node, usage) {\n                while (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) {\n                    node = node.parent;\n                }\n                switch (node.parent.kind) {\n                    case 233 /* ExpressionStatement */:\n                        inferTypeFromExpressionStatement(node, usage);\n                        break;\n                    case 215 /* PostfixUnaryExpression */:\n                        usage.isNumber = true;\n                        break;\n                    case 214 /* PrefixUnaryExpression */:\n                        inferTypeFromPrefixUnaryExpression(node.parent, usage);\n                        break;\n                    case 216 /* BinaryExpression */:\n                        inferTypeFromBinaryExpression(node, node.parent, usage);\n                        break;\n                    case 284 /* CaseClause */:\n                    case 285 /* DefaultClause */:\n                        inferTypeFromSwitchStatementLabel(node.parent, usage);\n                        break;\n                    case 203 /* CallExpression */:\n                    case 204 /* NewExpression */:\n                        if (node.parent.expression === node) {\n                            inferTypeFromCallExpression(node.parent, usage);\n                        }\n                        else {\n                            inferTypeFromContextualType(node, usage);\n                        }\n                        break;\n                    case 201 /* PropertyAccessExpression */:\n                        inferTypeFromPropertyAccessExpression(node.parent, usage);\n                        break;\n                    case 202 /* ElementAccessExpression */:\n                        inferTypeFromPropertyElementExpression(node.parent, node, usage);\n                        break;\n                    case 288 /* PropertyAssignment */:\n                    case 289 /* ShorthandPropertyAssignment */:\n                        inferTypeFromPropertyAssignment(node.parent, usage);\n                        break;\n                    case 163 /* PropertyDeclaration */:\n                        inferTypeFromPropertyDeclaration(node.parent, usage);\n                        break;\n                    case 249 /* VariableDeclaration */: {\n                        var _a = node.parent, name = _a.name, initializer = _a.initializer;\n                        if (node === name) {\n                            if (initializer) { // This can happen for `let x = null;` which still has an implicit-any error.\n                                addCandidateType(usage, checker.getTypeAtLocation(initializer));\n                            }\n                            break;\n                        }\n                    }\n                    // falls through\n                    default:\n                        return inferTypeFromContextualType(node, usage);\n                }\n            }\n            function inferTypeFromContextualType(node, usage) {\n                if (ts.isExpressionNode(node)) {\n                    addCandidateType(usage, checker.getContextualType(node));\n                }\n            }\n            function inferTypeFromExpressionStatement(node, usage) {\n                addCandidateType(usage, ts.isCallExpression(node) ? checker.getVoidType() : checker.getAnyType());\n            }\n            function inferTypeFromPrefixUnaryExpression(node, usage) {\n                switch (node.operator) {\n                    case 45 /* PlusPlusToken */:\n                    case 46 /* MinusMinusToken */:\n                    case 40 /* MinusToken */:\n                    case 54 /* TildeToken */:\n                        usage.isNumber = true;\n                        break;\n                    case 39 /* PlusToken */:\n                        usage.isNumberOrString = true;\n                        break;\n                    // case SyntaxKind.ExclamationToken:\n                    // no inferences here;\n                }\n            }\n            function inferTypeFromBinaryExpression(node, parent, usage) {\n                switch (parent.operatorToken.kind) {\n                    // ExponentiationOperator\n                    case 42 /* AsteriskAsteriskToken */:\n                    // MultiplicativeOperator\n                    // falls through\n                    case 41 /* AsteriskToken */:\n                    case 43 /* SlashToken */:\n                    case 44 /* PercentToken */:\n                    // ShiftOperator\n                    // falls through\n                    case 47 /* LessThanLessThanToken */:\n                    case 48 /* GreaterThanGreaterThanToken */:\n                    case 49 /* GreaterThanGreaterThanGreaterThanToken */:\n                    // BitwiseOperator\n                    // falls through\n                    case 50 /* AmpersandToken */:\n                    case 51 /* BarToken */:\n                    case 52 /* CaretToken */:\n                    // CompoundAssignmentOperator\n                    // falls through\n                    case 64 /* MinusEqualsToken */:\n                    case 66 /* AsteriskAsteriskEqualsToken */:\n                    case 65 /* AsteriskEqualsToken */:\n                    case 67 /* SlashEqualsToken */:\n                    case 68 /* PercentEqualsToken */:\n                    case 72 /* AmpersandEqualsToken */:\n                    case 73 /* BarEqualsToken */:\n                    case 77 /* CaretEqualsToken */:\n                    case 69 /* LessThanLessThanEqualsToken */:\n                    case 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */:\n                    case 70 /* GreaterThanGreaterThanEqualsToken */:\n                    // AdditiveOperator\n                    // falls through\n                    case 40 /* MinusToken */:\n                    // RelationalOperator\n                    // falls through\n                    case 29 /* LessThanToken */:\n                    case 32 /* LessThanEqualsToken */:\n                    case 31 /* GreaterThanToken */:\n                    case 33 /* GreaterThanEqualsToken */:\n                        var operandType = checker.getTypeAtLocation(parent.left === node ? parent.right : parent.left);\n                        if (operandType.flags & 1056 /* EnumLike */) {\n                            addCandidateType(usage, operandType);\n                        }\n                        else {\n                            usage.isNumber = true;\n                        }\n                        break;\n                    case 63 /* PlusEqualsToken */:\n                    case 39 /* PlusToken */:\n                        var otherOperandType = checker.getTypeAtLocation(parent.left === node ? parent.right : parent.left);\n                        if (otherOperandType.flags & 1056 /* EnumLike */) {\n                            addCandidateType(usage, otherOperandType);\n                        }\n                        else if (otherOperandType.flags & 296 /* NumberLike */) {\n                            usage.isNumber = true;\n                        }\n                        else if (otherOperandType.flags & 402653316 /* StringLike */) {\n                            usage.isString = true;\n                        }\n                        else if (otherOperandType.flags & 1 /* Any */) {\n                            // do nothing, maybe we'll learn something elsewhere\n                        }\n                        else {\n                            usage.isNumberOrString = true;\n                        }\n                        break;\n                    //  AssignmentOperators\n                    case 62 /* EqualsToken */:\n                    case 34 /* EqualsEqualsToken */:\n                    case 36 /* EqualsEqualsEqualsToken */:\n                    case 37 /* ExclamationEqualsEqualsToken */:\n                    case 35 /* ExclamationEqualsToken */:\n                        addCandidateType(usage, checker.getTypeAtLocation(parent.left === node ? parent.right : parent.left));\n                        break;\n                    case 100 /* InKeyword */:\n                        if (node === parent.left) {\n                            usage.isString = true;\n                        }\n                        break;\n                    // LogicalOperator Or NullishCoalescing\n                    case 56 /* BarBarToken */:\n                    case 60 /* QuestionQuestionToken */:\n                        if (node === parent.left &&\n                            (node.parent.parent.kind === 249 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) {\n                            // var x = x || {};\n                            // TODO: use getFalsyflagsOfType\n                            addCandidateType(usage, checker.getTypeAtLocation(parent.right));\n                        }\n                        break;\n                    case 55 /* AmpersandAmpersandToken */:\n                    case 27 /* CommaToken */:\n                    case 101 /* InstanceOfKeyword */:\n                        // nothing to infer here\n                        break;\n                }\n            }\n            function inferTypeFromSwitchStatementLabel(parent, usage) {\n                addCandidateType(usage, checker.getTypeAtLocation(parent.parent.parent.expression));\n            }\n            function inferTypeFromCallExpression(parent, usage) {\n                var call = {\n                    argumentTypes: [],\n                    return_: createEmptyUsage()\n                };\n                if (parent.arguments) {\n                    for (var _i = 0, _a = parent.arguments; _i < _a.length; _i++) {\n                        var argument = _a[_i];\n                        call.argumentTypes.push(checker.getTypeAtLocation(argument));\n                    }\n                }\n                calculateUsageOfNode(parent, call.return_);\n                if (parent.kind === 203 /* CallExpression */) {\n                    (usage.calls || (usage.calls = [])).push(call);\n                }\n                else {\n                    (usage.constructs || (usage.constructs = [])).push(call);\n                }\n            }\n            function inferTypeFromPropertyAccessExpression(parent, usage) {\n                var name = ts.escapeLeadingUnderscores(parent.name.text);\n                if (!usage.properties) {\n                    usage.properties = new ts.Map();\n                }\n                var propertyUsage = usage.properties.get(name) || createEmptyUsage();\n                calculateUsageOfNode(parent, propertyUsage);\n                usage.properties.set(name, propertyUsage);\n            }\n            function inferTypeFromPropertyElementExpression(parent, node, usage) {\n                if (node === parent.argumentExpression) {\n                    usage.isNumberOrString = true;\n                    return;\n                }\n                else {\n                    var indexType = checker.getTypeAtLocation(parent.argumentExpression);\n                    var indexUsage = createEmptyUsage();\n                    calculateUsageOfNode(parent, indexUsage);\n                    if (indexType.flags & 296 /* NumberLike */) {\n                        usage.numberIndex = indexUsage;\n                    }\n                    else {\n                        usage.stringIndex = indexUsage;\n                    }\n                }\n            }\n            function inferTypeFromPropertyAssignment(assignment, usage) {\n                var nodeWithRealType = ts.isVariableDeclaration(assignment.parent.parent) ?\n                    assignment.parent.parent :\n                    assignment.parent;\n                addCandidateThisType(usage, checker.getTypeAtLocation(nodeWithRealType));\n            }\n            function inferTypeFromPropertyDeclaration(declaration, usage) {\n                addCandidateThisType(usage, checker.getTypeAtLocation(declaration.parent));\n            }\n            function removeLowPriorityInferences(inferences, priorities) {\n                var toRemove = [];\n                for (var _i = 0, inferences_1 = inferences; _i < inferences_1.length; _i++) {\n                    var i = inferences_1[_i];\n                    for (var _a = 0, priorities_1 = priorities; _a < priorities_1.length; _a++) {\n                        var _b = priorities_1[_a], high = _b.high, low = _b.low;\n                        if (high(i)) {\n                            ts.Debug.assert(!low(i), \"Priority can't have both low and high\");\n                            toRemove.push(low);\n                        }\n                    }\n                }\n                return inferences.filter(function (i) { return toRemove.every(function (f) { return !f(i); }); });\n            }\n            function combineFromUsage(usage) {\n                return combineTypes(inferTypes(usage));\n            }\n            function combineTypes(inferences) {\n                if (!inferences.length)\n                    return checker.getAnyType();\n                // 1. string or number individually override string | number\n                // 2. non-any, non-void overrides any or void\n                // 3. non-nullable, non-any, non-void, non-anonymous overrides anonymous types\n                var stringNumber = checker.getUnionType([checker.getStringType(), checker.getNumberType()]);\n                var priorities = [\n                    {\n                        high: function (t) { return t === checker.getStringType() || t === checker.getNumberType(); },\n                        low: function (t) { return t === stringNumber; }\n                    },\n                    {\n                        high: function (t) { return !(t.flags & (1 /* Any */ | 16384 /* Void */)); },\n                        low: function (t) { return !!(t.flags & (1 /* Any */ | 16384 /* Void */)); }\n                    },\n                    {\n                        high: function (t) { return !(t.flags & (98304 /* Nullable */ | 1 /* Any */ | 16384 /* Void */)) && !(ts.getObjectFlags(t) & 16 /* Anonymous */); },\n                        low: function (t) { return !!(ts.getObjectFlags(t) & 16 /* Anonymous */); }\n                    }\n                ];\n                var good = removeLowPriorityInferences(inferences, priorities);\n                var anons = good.filter(function (i) { return ts.getObjectFlags(i) & 16 /* Anonymous */; });\n                if (anons.length) {\n                    good = good.filter(function (i) { return !(ts.getObjectFlags(i) & 16 /* Anonymous */); });\n                    good.push(combineAnonymousTypes(anons));\n                }\n                return checker.getWidenedType(checker.getUnionType(good.map(checker.getBaseTypeOfLiteralType), 2 /* Subtype */));\n            }\n            function combineAnonymousTypes(anons) {\n                if (anons.length === 1) {\n                    return anons[0];\n                }\n                var calls = [];\n                var constructs = [];\n                var stringIndices = [];\n                var numberIndices = [];\n                var stringIndexReadonly = false;\n                var numberIndexReadonly = false;\n                var props = ts.createMultiMap();\n                for (var _i = 0, anons_1 = anons; _i < anons_1.length; _i++) {\n                    var anon = anons_1[_i];\n                    for (var _a = 0, _b = checker.getPropertiesOfType(anon); _a < _b.length; _a++) {\n                        var p = _b[_a];\n                        props.add(p.name, checker.getTypeOfSymbolAtLocation(p, p.valueDeclaration));\n                    }\n                    calls.push.apply(calls, checker.getSignaturesOfType(anon, 0 /* Call */));\n                    constructs.push.apply(constructs, checker.getSignaturesOfType(anon, 1 /* Construct */));\n                    if (anon.stringIndexInfo) {\n                        stringIndices.push(anon.stringIndexInfo.type);\n                        stringIndexReadonly = stringIndexReadonly || anon.stringIndexInfo.isReadonly;\n                    }\n                    if (anon.numberIndexInfo) {\n                        numberIndices.push(anon.numberIndexInfo.type);\n                        numberIndexReadonly = numberIndexReadonly || anon.numberIndexInfo.isReadonly;\n                    }\n                }\n                var members = ts.mapEntries(props, function (name, types) {\n                    var isOptional = types.length < anons.length ? 16777216 /* Optional */ : 0;\n                    var s = checker.createSymbol(4 /* Property */ | isOptional, name);\n                    s.type = checker.getUnionType(types);\n                    return [name, s];\n                });\n                return checker.createAnonymousType(anons[0].symbol, members, calls, constructs, stringIndices.length ? checker.createIndexInfo(checker.getUnionType(stringIndices), stringIndexReadonly) : undefined, numberIndices.length ? checker.createIndexInfo(checker.getUnionType(numberIndices), numberIndexReadonly) : undefined);\n            }\n            function inferTypes(usage) {\n                var _a, _b, _c;\n                var types = [];\n                if (usage.isNumber) {\n                    types.push(checker.getNumberType());\n                }\n                if (usage.isString) {\n                    types.push(checker.getStringType());\n                }\n                if (usage.isNumberOrString) {\n                    types.push(checker.getUnionType([checker.getStringType(), checker.getNumberType()]));\n                }\n                if (usage.numberIndex) {\n                    types.push(checker.createArrayType(combineFromUsage(usage.numberIndex)));\n                }\n                if (((_a = usage.properties) === null || _a === void 0 ? void 0 : _a.size) || ((_b = usage.calls) === null || _b === void 0 ? void 0 : _b.length) || ((_c = usage.constructs) === null || _c === void 0 ? void 0 : _c.length) || usage.stringIndex) {\n                    types.push(inferStructuralType(usage));\n                }\n                types.push.apply(types, (usage.candidateTypes || []).map(function (t) { return checker.getBaseTypeOfLiteralType(t); }));\n                types.push.apply(types, inferNamedTypesFromProperties(usage));\n                return types;\n            }\n            function inferStructuralType(usage) {\n                var members = new ts.Map();\n                if (usage.properties) {\n                    usage.properties.forEach(function (u, name) {\n                        var symbol = checker.createSymbol(4 /* Property */, name);\n                        symbol.type = combineFromUsage(u);\n                        members.set(name, symbol);\n                    });\n                }\n                var callSignatures = usage.calls ? [getSignatureFromCalls(usage.calls)] : [];\n                var constructSignatures = usage.constructs ? [getSignatureFromCalls(usage.constructs)] : [];\n                var stringIndexInfo = usage.stringIndex && checker.createIndexInfo(combineFromUsage(usage.stringIndex), /*isReadonly*/ false);\n                return checker.createAnonymousType(/*symbol*/ undefined, members, callSignatures, constructSignatures, stringIndexInfo, /*numberIndexInfo*/ undefined);\n            }\n            function inferNamedTypesFromProperties(usage) {\n                if (!usage.properties || !usage.properties.size)\n                    return [];\n                var types = builtins.filter(function (t) { return allPropertiesAreAssignableToUsage(t, usage); });\n                if (0 < types.length && types.length < 3) {\n                    return types.map(function (t) { return inferInstantiationFromUsage(t, usage); });\n                }\n                return [];\n            }\n            function allPropertiesAreAssignableToUsage(type, usage) {\n                if (!usage.properties)\n                    return false;\n                return !ts.forEachEntry(usage.properties, function (propUsage, name) {\n                    var source = checker.getTypeOfPropertyOfType(type, name);\n                    if (!source) {\n                        return true;\n                    }\n                    if (propUsage.calls) {\n                        var sigs = checker.getSignaturesOfType(source, 0 /* Call */);\n                        return !sigs.length || !checker.isTypeAssignableTo(source, getFunctionFromCalls(propUsage.calls));\n                    }\n                    else {\n                        return !checker.isTypeAssignableTo(source, combineFromUsage(propUsage));\n                    }\n                });\n            }\n            /**\n             * inference is limited to\n             * 1. generic types with a single parameter\n             * 2. inference to/from calls with a single signature\n             */\n            function inferInstantiationFromUsage(type, usage) {\n                if (!(ts.getObjectFlags(type) & 4 /* Reference */) || !usage.properties) {\n                    return type;\n                }\n                var generic = type.target;\n                var singleTypeParameter = ts.singleOrUndefined(generic.typeParameters);\n                if (!singleTypeParameter)\n                    return type;\n                var types = [];\n                usage.properties.forEach(function (propUsage, name) {\n                    var genericPropertyType = checker.getTypeOfPropertyOfType(generic, name);\n                    ts.Debug.assert(!!genericPropertyType, \"generic should have all the properties of its reference.\");\n                    types.push.apply(types, inferTypeParameters(genericPropertyType, combineFromUsage(propUsage), singleTypeParameter));\n                });\n                return builtinConstructors[type.symbol.escapedName](combineTypes(types));\n            }\n            function inferTypeParameters(genericType, usageType, typeParameter) {\n                if (genericType === typeParameter) {\n                    return [usageType];\n                }\n                else if (genericType.flags & 3145728 /* UnionOrIntersection */) {\n                    return ts.flatMap(genericType.types, function (t) { return inferTypeParameters(t, usageType, typeParameter); });\n                }\n                else if (ts.getObjectFlags(genericType) & 4 /* Reference */ && ts.getObjectFlags(usageType) & 4 /* Reference */) {\n                    // this is wrong because we need a reference to the targetType to, so we can check that it's also a reference\n                    var genericArgs = checker.getTypeArguments(genericType);\n                    var usageArgs = checker.getTypeArguments(usageType);\n                    var types = [];\n                    if (genericArgs && usageArgs) {\n                        for (var i = 0; i < genericArgs.length; i++) {\n                            if (usageArgs[i]) {\n                                types.push.apply(types, inferTypeParameters(genericArgs[i], usageArgs[i], typeParameter));\n                            }\n                        }\n                    }\n                    return types;\n                }\n                var genericSigs = checker.getSignaturesOfType(genericType, 0 /* Call */);\n                var usageSigs = checker.getSignaturesOfType(usageType, 0 /* Call */);\n                if (genericSigs.length === 1 && usageSigs.length === 1) {\n                    return inferFromSignatures(genericSigs[0], usageSigs[0], typeParameter);\n                }\n                return [];\n            }\n            function inferFromSignatures(genericSig, usageSig, typeParameter) {\n                var types = [];\n                for (var i = 0; i < genericSig.parameters.length; i++) {\n                    var genericParam = genericSig.parameters[i];\n                    var usageParam = usageSig.parameters[i];\n                    var isRest = genericSig.declaration && ts.isRestParameter(genericSig.declaration.parameters[i]);\n                    if (!usageParam) {\n                        break;\n                    }\n                    var genericParamType = checker.getTypeOfSymbolAtLocation(genericParam, genericParam.valueDeclaration);\n                    var elementType = isRest && checker.getElementTypeOfArrayType(genericParamType);\n                    if (elementType) {\n                        genericParamType = elementType;\n                    }\n                    var targetType = usageParam.type || checker.getTypeOfSymbolAtLocation(usageParam, usageParam.valueDeclaration);\n                    types.push.apply(types, inferTypeParameters(genericParamType, targetType, typeParameter));\n                }\n                var genericReturn = checker.getReturnTypeOfSignature(genericSig);\n                var usageReturn = checker.getReturnTypeOfSignature(usageSig);\n                types.push.apply(types, inferTypeParameters(genericReturn, usageReturn, typeParameter));\n                return types;\n            }\n            function getFunctionFromCalls(calls) {\n                return checker.createAnonymousType(/*symbol*/ undefined, ts.createSymbolTable(), [getSignatureFromCalls(calls)], ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined);\n            }\n            function getSignatureFromCalls(calls) {\n                var parameters = [];\n                var length = Math.max.apply(Math, calls.map(function (c) { return c.argumentTypes.length; }));\n                var _loop_14 = function (i) {\n                    var symbol = checker.createSymbol(1 /* FunctionScopedVariable */, ts.escapeLeadingUnderscores(\"arg\" + i));\n                    symbol.type = combineTypes(calls.map(function (call) { return call.argumentTypes[i] || checker.getUndefinedType(); }));\n                    if (calls.some(function (call) { return call.argumentTypes[i] === undefined; })) {\n                        symbol.flags |= 16777216 /* Optional */;\n                    }\n                    parameters.push(symbol);\n                };\n                for (var i = 0; i < length; i++) {\n                    _loop_14(i);\n                }\n                var returnType = combineFromUsage(combineUsages(calls.map(function (call) { return call.return_; })));\n                // TODO: GH#18217\n                return checker.createSignature(/*declaration*/ undefined, /*typeParameters*/ undefined, /*thisParameter*/ undefined, parameters, returnType, /*typePredicate*/ undefined, length, 0 /* None */);\n            }\n            function addCandidateType(usage, type) {\n                if (type && !(type.flags & 1 /* Any */) && !(type.flags & 131072 /* Never */)) {\n                    (usage.candidateTypes || (usage.candidateTypes = [])).push(type);\n                }\n            }\n            function addCandidateThisType(usage, type) {\n                if (type && !(type.flags & 1 /* Any */) && !(type.flags & 131072 /* Never */)) {\n                    (usage.candidateThisTypes || (usage.candidateThisTypes = [])).push(type);\n                }\n            }\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"fixReturnTypeInAsyncFunction\";\n        var errorCodes = [\n            ts.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0.code,\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            fixIds: [fixId],\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, program = context.program, span = context.span;\n                var checker = program.getTypeChecker();\n                var info = getInfo(sourceFile, program.getTypeChecker(), span.start);\n                if (!info) {\n                    return undefined;\n                }\n                var returnTypeNode = info.returnTypeNode, returnType = info.returnType, promisedTypeNode = info.promisedTypeNode, promisedType = info.promisedType;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, returnTypeNode, promisedTypeNode); });\n                return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Replace_0_with_Promise_1,\n                        checker.typeToString(returnType), checker.typeToString(promisedType)], fixId, ts.Diagnostics.Fix_all_incorrect_return_type_of_an_async_functions)];\n            },\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                var info = getInfo(diag.file, context.program.getTypeChecker(), diag.start);\n                if (info) {\n                    doChange(changes, diag.file, info.returnTypeNode, info.promisedTypeNode);\n                }\n            }); }\n        });\n        function getInfo(sourceFile, checker, pos) {\n            if (ts.isInJSFile(sourceFile)) {\n                return undefined;\n            }\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            var func = ts.findAncestor(token, ts.isFunctionLikeDeclaration);\n            var returnTypeNode = func === null || func === void 0 ? void 0 : func.type;\n            if (!returnTypeNode) {\n                return undefined;\n            }\n            var returnType = checker.getTypeFromTypeNode(returnTypeNode);\n            var promisedType = checker.getAwaitedType(returnType) || checker.getVoidType();\n            var promisedTypeNode = checker.typeToTypeNode(promisedType, /*enclosingDeclaration*/ returnTypeNode, /*flags*/ undefined);\n            if (promisedTypeNode) {\n                return { returnTypeNode: returnTypeNode, returnType: returnType, promisedTypeNode: promisedTypeNode, promisedType: promisedType };\n            }\n        }\n        function doChange(changes, sourceFile, returnTypeNode, promisedTypeNode) {\n            changes.replaceNode(sourceFile, returnTypeNode, ts.factory.createTypeReferenceNode(\"Promise\", [promisedTypeNode]));\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixName = \"disableJsDiagnostics\";\n        var fixId = \"disableJsDiagnostics\";\n        var errorCodes = ts.mapDefined(Object.keys(ts.Diagnostics), function (key) {\n            var diag = ts.Diagnostics[key];\n            return diag.category === ts.DiagnosticCategory.Error ? diag.code : undefined;\n        });\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, program = context.program, span = context.span, host = context.host, formatContext = context.formatContext;\n                if (!ts.isInJSFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) {\n                    return undefined;\n                }\n                var newLineCharacter = sourceFile.checkJsDirective ? \"\" : ts.getNewLineOrDefaultFromHost(host, formatContext.options);\n                var fixes = [\n                    // fixId unnecessary because adding `// @ts-nocheck` even once will ignore every error in the file.\n                    codefix.createCodeFixActionWithoutFixAll(fixName, [codefix.createFileTextChanges(sourceFile.fileName, [\n                            ts.createTextChange(sourceFile.checkJsDirective\n                                ? ts.createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end)\n                                : ts.createTextSpan(0, 0), \"// @ts-nocheck\" + newLineCharacter),\n                        ])], ts.Diagnostics.Disable_checking_for_this_file),\n                ];\n                if (ts.textChanges.isValidLocationToAddComment(sourceFile, span.start)) {\n                    fixes.unshift(codefix.createCodeFixAction(fixName, ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, sourceFile, span.start); }), ts.Diagnostics.Ignore_this_error_message, fixId, ts.Diagnostics.Add_ts_ignore_to_all_error_messages));\n                }\n                return fixes;\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) {\n                var seenLines = new ts.Set();\n                return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                    if (ts.textChanges.isValidLocationToAddComment(diag.file, diag.start)) {\n                        makeChange(changes, diag.file, diag.start, seenLines);\n                    }\n                });\n            },\n        });\n        function makeChange(changes, sourceFile, position, seenLines) {\n            var lineNumber = ts.getLineAndCharacterOfPosition(sourceFile, position).line;\n            // Only need to add `// @ts-ignore` for a line once.\n            if (!seenLines || ts.tryAddToSet(seenLines, lineNumber)) {\n                changes.insertCommentBeforeLine(sourceFile, lineNumber, position, \" @ts-ignore\");\n            }\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        /**\n         * Finds members of the resolved type that are missing in the class pointed to by class decl\n         * and generates source code for the missing members.\n         * @param possiblyMissingSymbols The collection of symbols to filter and then get insertions for.\n         * @param importAdder If provided, type annotations will use identifier type references instead of ImportTypeNodes, and the missing imports will be added to the importAdder.\n         * @returns Empty string iff there are no member insertions.\n         */\n        function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, sourceFile, context, preferences, importAdder, addClassElement) {\n            var classMembers = classDeclaration.symbol.members;\n            for (var _i = 0, possiblyMissingSymbols_1 = possiblyMissingSymbols; _i < possiblyMissingSymbols_1.length; _i++) {\n                var symbol = possiblyMissingSymbols_1[_i];\n                if (!classMembers.has(symbol.escapedName)) {\n                    addNewNodeForMemberSymbol(symbol, classDeclaration, sourceFile, context, preferences, importAdder, addClassElement);\n                }\n            }\n        }\n        codefix.createMissingMemberNodes = createMissingMemberNodes;\n        function getNoopSymbolTrackerWithResolver(context) {\n            return {\n                trackSymbol: ts.noop,\n                moduleResolverHost: ts.getModuleSpecifierResolverHost(context.program, context.host),\n            };\n        }\n        codefix.getNoopSymbolTrackerWithResolver = getNoopSymbolTrackerWithResolver;\n        /**\n         * @returns Empty string iff there we can't figure out a representation for `symbol` in `enclosingDeclaration`.\n         */\n        function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, context, preferences, importAdder, addClassElement) {\n            var declarations = symbol.getDeclarations();\n            if (!(declarations && declarations.length)) {\n                return undefined;\n            }\n            var checker = context.program.getTypeChecker();\n            var scriptTarget = ts.getEmitScriptTarget(context.program.getCompilerOptions());\n            var declaration = declarations[0];\n            var name = ts.getSynthesizedDeepClone(ts.getNameOfDeclaration(declaration), /*includeTrivia*/ false);\n            var visibilityModifier = createVisibilityModifier(ts.getEffectiveModifierFlags(declaration));\n            var modifiers = visibilityModifier ? ts.factory.createNodeArray([visibilityModifier]) : undefined;\n            var type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration));\n            var optional = !!(symbol.flags & 16777216 /* Optional */);\n            var ambient = !!(enclosingDeclaration.flags & 8388608 /* Ambient */);\n            var quotePreference = ts.getQuotePreference(sourceFile, preferences);\n            switch (declaration.kind) {\n                case 162 /* PropertySignature */:\n                case 163 /* PropertyDeclaration */:\n                    var flags = quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : undefined;\n                    var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context));\n                    if (importAdder) {\n                        var importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget);\n                        if (importableReference) {\n                            typeNode = importableReference.typeNode;\n                            importSymbols(importAdder, importableReference.symbols);\n                        }\n                    }\n                    addClassElement(ts.factory.createPropertyDeclaration(\n                    /*decorators*/ undefined, modifiers, name, optional ? ts.factory.createToken(57 /* QuestionToken */) : undefined, typeNode, \n                    /*initializer*/ undefined));\n                    break;\n                case 167 /* GetAccessor */:\n                case 168 /* SetAccessor */: {\n                    var typeNode_1 = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context));\n                    var allAccessors = ts.getAllAccessorDeclarations(declarations, declaration);\n                    var orderedAccessors = allAccessors.secondAccessor\n                        ? [allAccessors.firstAccessor, allAccessors.secondAccessor]\n                        : [allAccessors.firstAccessor];\n                    if (importAdder) {\n                        var importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode_1, scriptTarget);\n                        if (importableReference) {\n                            typeNode_1 = importableReference.typeNode;\n                            importSymbols(importAdder, importableReference.symbols);\n                        }\n                    }\n                    for (var _i = 0, orderedAccessors_1 = orderedAccessors; _i < orderedAccessors_1.length; _i++) {\n                        var accessor = orderedAccessors_1[_i];\n                        if (ts.isGetAccessorDeclaration(accessor)) {\n                            addClassElement(ts.factory.createGetAccessorDeclaration(\n                            /*decorators*/ undefined, modifiers, name, ts.emptyArray, typeNode_1, ambient ? undefined : createStubbedMethodBody(quotePreference)));\n                        }\n                        else {\n                            ts.Debug.assertNode(accessor, ts.isSetAccessorDeclaration, \"The counterpart to a getter should be a setter\");\n                            var parameter = ts.getSetAccessorValueParameter(accessor);\n                            var parameterName = parameter && ts.isIdentifier(parameter.name) ? ts.idText(parameter.name) : undefined;\n                            addClassElement(ts.factory.createSetAccessorDeclaration(\n                            /*decorators*/ undefined, modifiers, name, createDummyParameters(1, [parameterName], [typeNode_1], 1, /*inJs*/ false), ambient ? undefined : createStubbedMethodBody(quotePreference)));\n                        }\n                    }\n                    break;\n                }\n                case 164 /* MethodSignature */:\n                case 165 /* MethodDeclaration */:\n                    // The signature for the implementation appears as an entry in `signatures` iff\n                    // there is only one signature.\n                    // If there are overloads and an implementation signature, it appears as an\n                    // extra declaration that isn't a signature for `type`.\n                    // If there is more than one overload but no implementation signature\n                    // (eg: an abstract method or interface declaration), there is a 1-1\n                    // correspondence of declarations and signatures.\n                    var signatures = checker.getSignaturesOfType(type, 0 /* Call */);\n                    if (!ts.some(signatures)) {\n                        break;\n                    }\n                    if (declarations.length === 1) {\n                        ts.Debug.assert(signatures.length === 1, \"One declaration implies one signature\");\n                        var signature = signatures[0];\n                        outputMethod(quotePreference, signature, modifiers, name, ambient ? undefined : createStubbedMethodBody(quotePreference));\n                        break;\n                    }\n                    for (var _a = 0, signatures_1 = signatures; _a < signatures_1.length; _a++) {\n                        var signature = signatures_1[_a];\n                        // Need to ensure nodes are fresh each time so they can have different positions.\n                        outputMethod(quotePreference, signature, ts.getSynthesizedDeepClones(modifiers, /*includeTrivia*/ false), ts.getSynthesizedDeepClone(name, /*includeTrivia*/ false));\n                    }\n                    if (!ambient) {\n                        if (declarations.length > signatures.length) {\n                            var signature = checker.getSignatureFromDeclaration(declarations[declarations.length - 1]);\n                            outputMethod(quotePreference, signature, modifiers, name, createStubbedMethodBody(quotePreference));\n                        }\n                        else {\n                            ts.Debug.assert(declarations.length === signatures.length, \"Declarations and signatures should match count\");\n                            addClassElement(createMethodImplementingSignatures(signatures, name, optional, modifiers, quotePreference));\n                        }\n                    }\n                    break;\n            }\n            function outputMethod(quotePreference, signature, modifiers, name, body) {\n                var method = signatureToMethodDeclaration(context, quotePreference, signature, enclosingDeclaration, modifiers, name, optional, body, importAdder);\n                if (method)\n                    addClassElement(method);\n            }\n        }\n        function signatureToMethodDeclaration(context, quotePreference, signature, enclosingDeclaration, modifiers, name, optional, body, importAdder) {\n            var program = context.program;\n            var checker = program.getTypeChecker();\n            var scriptTarget = ts.getEmitScriptTarget(program.getCompilerOptions());\n            var flags = 1 /* NoTruncation */ | 1073741824 /* NoUndefinedOptionalParameterType */ | 256 /* SuppressAnyReturnType */ | (quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0);\n            var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 165 /* MethodDeclaration */, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context));\n            if (!signatureDeclaration) {\n                return undefined;\n            }\n            var typeParameters = signatureDeclaration.typeParameters;\n            var parameters = signatureDeclaration.parameters;\n            var type = signatureDeclaration.type;\n            if (importAdder) {\n                if (typeParameters) {\n                    var newTypeParameters = ts.sameMap(typeParameters, function (typeParameterDecl) {\n                        var constraint = typeParameterDecl.constraint;\n                        var defaultType = typeParameterDecl.default;\n                        if (constraint) {\n                            var importableReference = tryGetAutoImportableReferenceFromTypeNode(constraint, scriptTarget);\n                            if (importableReference) {\n                                constraint = importableReference.typeNode;\n                                importSymbols(importAdder, importableReference.symbols);\n                            }\n                        }\n                        if (defaultType) {\n                            var importableReference = tryGetAutoImportableReferenceFromTypeNode(defaultType, scriptTarget);\n                            if (importableReference) {\n                                defaultType = importableReference.typeNode;\n                                importSymbols(importAdder, importableReference.symbols);\n                            }\n                        }\n                        return ts.factory.updateTypeParameterDeclaration(typeParameterDecl, typeParameterDecl.name, constraint, defaultType);\n                    });\n                    if (typeParameters !== newTypeParameters) {\n                        typeParameters = ts.setTextRange(ts.factory.createNodeArray(newTypeParameters, typeParameters.hasTrailingComma), typeParameters);\n                    }\n                }\n                var newParameters = ts.sameMap(parameters, function (parameterDecl) {\n                    var importableReference = tryGetAutoImportableReferenceFromTypeNode(parameterDecl.type, scriptTarget);\n                    var type = parameterDecl.type;\n                    if (importableReference) {\n                        type = importableReference.typeNode;\n                        importSymbols(importAdder, importableReference.symbols);\n                    }\n                    return ts.factory.updateParameterDeclaration(parameterDecl, parameterDecl.decorators, parameterDecl.modifiers, parameterDecl.dotDotDotToken, parameterDecl.name, parameterDecl.questionToken, type, parameterDecl.initializer);\n                });\n                if (parameters !== newParameters) {\n                    parameters = ts.setTextRange(ts.factory.createNodeArray(newParameters, parameters.hasTrailingComma), parameters);\n                }\n                if (type) {\n                    var importableReference = tryGetAutoImportableReferenceFromTypeNode(type, scriptTarget);\n                    if (importableReference) {\n                        type = importableReference.typeNode;\n                        importSymbols(importAdder, importableReference.symbols);\n                    }\n                }\n            }\n            return ts.factory.updateMethodDeclaration(signatureDeclaration, \n            /*decorators*/ undefined, modifiers, signatureDeclaration.asteriskToken, name, optional ? ts.factory.createToken(57 /* QuestionToken */) : undefined, typeParameters, parameters, type, body);\n        }\n        function createSignatureDeclarationFromCallExpression(kind, context, importAdder, call, name, modifierFlags, contextNode) {\n            var quotePreference = ts.getQuotePreference(context.sourceFile, context.preferences);\n            var scriptTarget = ts.getEmitScriptTarget(context.program.getCompilerOptions());\n            var tracker = getNoopSymbolTrackerWithResolver(context);\n            var checker = context.program.getTypeChecker();\n            var isJs = ts.isInJSFile(contextNode);\n            var typeArguments = call.typeArguments, args = call.arguments, parent = call.parent;\n            var contextualType = isJs ? undefined : checker.getContextualType(call);\n            var names = ts.map(args, function (arg) {\n                return ts.isIdentifier(arg) ? arg.text : ts.isPropertyAccessExpression(arg) && ts.isIdentifier(arg.name) ? arg.name.text : undefined;\n            });\n            var types = isJs ? [] : ts.map(args, function (arg) {\n                return typeToAutoImportableTypeNode(checker, importAdder, checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(arg)), contextNode, scriptTarget, /*flags*/ undefined, tracker);\n            });\n            var modifiers = modifierFlags\n                ? ts.factory.createNodeArray(ts.factory.createModifiersFromModifierFlags(modifierFlags))\n                : undefined;\n            var asteriskToken = ts.isYieldExpression(parent)\n                ? ts.factory.createToken(41 /* AsteriskToken */)\n                : undefined;\n            var typeParameters = isJs || typeArguments === undefined\n                ? undefined\n                : ts.map(typeArguments, function (_, i) {\n                    return ts.factory.createTypeParameterDeclaration(84 /* T */ + typeArguments.length - 1 <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + i) : \"T\" + i);\n                });\n            var parameters = createDummyParameters(args.length, names, types, /*minArgumentCount*/ undefined, isJs);\n            var type = isJs || contextualType === undefined\n                ? undefined\n                : checker.typeToTypeNode(contextualType, contextNode, /*flags*/ undefined, tracker);\n            if (kind === 165 /* MethodDeclaration */) {\n                return ts.factory.createMethodDeclaration(\n                /*decorators*/ undefined, modifiers, asteriskToken, name, \n                /*questionToken*/ undefined, typeParameters, parameters, type, ts.isInterfaceDeclaration(contextNode) ? undefined : createStubbedMethodBody(quotePreference));\n            }\n            return ts.factory.createFunctionDeclaration(\n            /*decorators*/ undefined, modifiers, asteriskToken, name, typeParameters, parameters, type, createStubbedBody(ts.Diagnostics.Function_not_implemented.message, quotePreference));\n        }\n        codefix.createSignatureDeclarationFromCallExpression = createSignatureDeclarationFromCallExpression;\n        function typeToAutoImportableTypeNode(checker, importAdder, type, contextNode, scriptTarget, flags, tracker) {\n            var typeNode = checker.typeToTypeNode(type, contextNode, flags, tracker);\n            if (typeNode && ts.isImportTypeNode(typeNode)) {\n                var importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget);\n                if (importableReference) {\n                    importSymbols(importAdder, importableReference.symbols);\n                    return importableReference.typeNode;\n                }\n            }\n            return typeNode;\n        }\n        codefix.typeToAutoImportableTypeNode = typeToAutoImportableTypeNode;\n        function createDummyParameters(argCount, names, types, minArgumentCount, inJs) {\n            var parameters = [];\n            for (var i = 0; i < argCount; i++) {\n                var newParameter = ts.factory.createParameterDeclaration(\n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, \n                /*dotDotDotToken*/ undefined, \n                /*name*/ names && names[i] || \"arg\" + i, \n                /*questionToken*/ minArgumentCount !== undefined && i >= minArgumentCount ? ts.factory.createToken(57 /* QuestionToken */) : undefined, \n                /*type*/ inJs ? undefined : types && types[i] || ts.factory.createKeywordTypeNode(128 /* AnyKeyword */), \n                /*initializer*/ undefined);\n                parameters.push(newParameter);\n            }\n            return parameters;\n        }\n        function createMethodImplementingSignatures(signatures, name, optional, modifiers, quotePreference) {\n            /** This is *a* signature with the maximal number of arguments,\n             * such that if there is a \"maximal\" signature without rest arguments,\n             * this is one of them.\n             */\n            var maxArgsSignature = signatures[0];\n            var minArgumentCount = signatures[0].minArgumentCount;\n            var someSigHasRestParameter = false;\n            for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) {\n                var sig = signatures_2[_i];\n                minArgumentCount = Math.min(sig.minArgumentCount, minArgumentCount);\n                if (ts.signatureHasRestParameter(sig)) {\n                    someSigHasRestParameter = true;\n                }\n                if (sig.parameters.length >= maxArgsSignature.parameters.length && (!ts.signatureHasRestParameter(sig) || ts.signatureHasRestParameter(maxArgsSignature))) {\n                    maxArgsSignature = sig;\n                }\n            }\n            var maxNonRestArgs = maxArgsSignature.parameters.length - (ts.signatureHasRestParameter(maxArgsSignature) ? 1 : 0);\n            var maxArgsParameterSymbolNames = maxArgsSignature.parameters.map(function (symbol) { return symbol.name; });\n            var parameters = createDummyParameters(maxNonRestArgs, maxArgsParameterSymbolNames, /* types */ undefined, minArgumentCount, /*inJs*/ false);\n            if (someSigHasRestParameter) {\n                var anyArrayType = ts.factory.createArrayTypeNode(ts.factory.createKeywordTypeNode(128 /* AnyKeyword */));\n                var restParameter = ts.factory.createParameterDeclaration(\n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, ts.factory.createToken(25 /* DotDotDotToken */), maxArgsParameterSymbolNames[maxNonRestArgs] || \"rest\", \n                /*questionToken*/ maxNonRestArgs >= minArgumentCount ? ts.factory.createToken(57 /* QuestionToken */) : undefined, anyArrayType, \n                /*initializer*/ undefined);\n                parameters.push(restParameter);\n            }\n            return createStubbedMethod(modifiers, name, optional, \n            /*typeParameters*/ undefined, parameters, \n            /*returnType*/ undefined, quotePreference);\n        }\n        function createStubbedMethod(modifiers, name, optional, typeParameters, parameters, returnType, quotePreference) {\n            return ts.factory.createMethodDeclaration(\n            /*decorators*/ undefined, modifiers, \n            /*asteriskToken*/ undefined, name, optional ? ts.factory.createToken(57 /* QuestionToken */) : undefined, typeParameters, parameters, returnType, createStubbedMethodBody(quotePreference));\n        }\n        function createStubbedMethodBody(quotePreference) {\n            return createStubbedBody(ts.Diagnostics.Method_not_implemented.message, quotePreference);\n        }\n        function createStubbedBody(text, quotePreference) {\n            return ts.factory.createBlock([ts.factory.createThrowStatement(ts.factory.createNewExpression(ts.factory.createIdentifier(\"Error\"), \n                /*typeArguments*/ undefined, \n                // TODO Handle auto quote preference.\n                [ts.factory.createStringLiteral(text, /*isSingleQuote*/ quotePreference === 0 /* Single */)]))], \n            /*multiline*/ true);\n        }\n        codefix.createStubbedBody = createStubbedBody;\n        function createVisibilityModifier(flags) {\n            if (flags & 4 /* Public */) {\n                return ts.factory.createToken(122 /* PublicKeyword */);\n            }\n            else if (flags & 16 /* Protected */) {\n                return ts.factory.createToken(121 /* ProtectedKeyword */);\n            }\n            return undefined;\n        }\n        function setJsonCompilerOptionValues(changeTracker, configFile, options) {\n            var tsconfigObjectLiteral = ts.getTsConfigObjectLiteralExpression(configFile);\n            if (!tsconfigObjectLiteral)\n                return undefined;\n            var compilerOptionsProperty = findJsonProperty(tsconfigObjectLiteral, \"compilerOptions\");\n            if (compilerOptionsProperty === undefined) {\n                changeTracker.insertNodeAtObjectStart(configFile, tsconfigObjectLiteral, createJsonPropertyAssignment(\"compilerOptions\", ts.factory.createObjectLiteralExpression(options.map(function (_a) {\n                    var optionName = _a[0], optionValue = _a[1];\n                    return createJsonPropertyAssignment(optionName, optionValue);\n                }), /*multiLine*/ true)));\n                return;\n            }\n            var compilerOptions = compilerOptionsProperty.initializer;\n            if (!ts.isObjectLiteralExpression(compilerOptions)) {\n                return;\n            }\n            for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {\n                var _a = options_1[_i], optionName = _a[0], optionValue = _a[1];\n                var optionProperty = findJsonProperty(compilerOptions, optionName);\n                if (optionProperty === undefined) {\n                    changeTracker.insertNodeAtObjectStart(configFile, compilerOptions, createJsonPropertyAssignment(optionName, optionValue));\n                }\n                else {\n                    changeTracker.replaceNode(configFile, optionProperty.initializer, optionValue);\n                }\n            }\n        }\n        codefix.setJsonCompilerOptionValues = setJsonCompilerOptionValues;\n        function setJsonCompilerOptionValue(changeTracker, configFile, optionName, optionValue) {\n            setJsonCompilerOptionValues(changeTracker, configFile, [[optionName, optionValue]]);\n        }\n        codefix.setJsonCompilerOptionValue = setJsonCompilerOptionValue;\n        function createJsonPropertyAssignment(name, initializer) {\n            return ts.factory.createPropertyAssignment(ts.factory.createStringLiteral(name), initializer);\n        }\n        codefix.createJsonPropertyAssignment = createJsonPropertyAssignment;\n        function findJsonProperty(obj, name) {\n            return ts.find(obj.properties, function (p) { return ts.isPropertyAssignment(p) && !!p.name && ts.isStringLiteral(p.name) && p.name.text === name; });\n        }\n        codefix.findJsonProperty = findJsonProperty;\n        /**\n         * Given a type node containing 'import(\"./a\").SomeType<import(\"./b\").OtherType<...>>',\n         * returns an equivalent type reference node with any nested ImportTypeNodes also replaced\n         * with type references, and a list of symbols that must be imported to use the type reference.\n         */\n        function tryGetAutoImportableReferenceFromTypeNode(importTypeNode, scriptTarget) {\n            var symbols;\n            var typeNode = ts.visitNode(importTypeNode, visit);\n            if (symbols && typeNode) {\n                return { typeNode: typeNode, symbols: symbols };\n            }\n            function visit(node) {\n                var _a;\n                if (ts.isLiteralImportTypeNode(node) && node.qualifier) {\n                    // Symbol for the left-most thing after the dot\n                    var firstIdentifier = ts.getFirstIdentifier(node.qualifier);\n                    var name = ts.getNameForExportedSymbol(firstIdentifier.symbol, scriptTarget);\n                    var qualifier = name !== firstIdentifier.text\n                        ? replaceFirstIdentifierOfEntityName(node.qualifier, ts.factory.createIdentifier(name))\n                        : node.qualifier;\n                    symbols = ts.append(symbols, firstIdentifier.symbol);\n                    var typeArguments = (_a = node.typeArguments) === null || _a === void 0 ? void 0 : _a.map(visit);\n                    return ts.factory.createTypeReferenceNode(qualifier, typeArguments);\n                }\n                return ts.visitEachChild(node, visit, ts.nullTransformationContext);\n            }\n        }\n        codefix.tryGetAutoImportableReferenceFromTypeNode = tryGetAutoImportableReferenceFromTypeNode;\n        function replaceFirstIdentifierOfEntityName(name, newIdentifier) {\n            if (name.kind === 78 /* Identifier */) {\n                return newIdentifier;\n            }\n            return ts.factory.createQualifiedName(replaceFirstIdentifierOfEntityName(name.left, newIdentifier), name.right);\n        }\n        function importSymbols(importAdder, symbols) {\n            symbols.forEach(function (s) { return importAdder.addImportFromExportedSymbol(s, /*usageIsTypeOnly*/ true); });\n        }\n        codefix.importSymbols = importSymbols;\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        function generateAccessorFromProperty(file, program, start, end, context, _actionName) {\n            var fieldInfo = getAccessorConvertiblePropertyAtPosition(file, program, start, end);\n            if (!fieldInfo || ts.refactor.isRefactorErrorInfo(fieldInfo))\n                return undefined;\n            var changeTracker = ts.textChanges.ChangeTracker.fromContext(context);\n            var isStatic = fieldInfo.isStatic, isReadonly = fieldInfo.isReadonly, fieldName = fieldInfo.fieldName, accessorName = fieldInfo.accessorName, originalName = fieldInfo.originalName, type = fieldInfo.type, container = fieldInfo.container, declaration = fieldInfo.declaration;\n            ts.suppressLeadingAndTrailingTrivia(fieldName);\n            ts.suppressLeadingAndTrailingTrivia(accessorName);\n            ts.suppressLeadingAndTrailingTrivia(declaration);\n            ts.suppressLeadingAndTrailingTrivia(container);\n            var accessorModifiers;\n            var fieldModifiers;\n            if (ts.isClassLike(container)) {\n                var modifierFlags = ts.getEffectiveModifierFlags(declaration);\n                if (ts.isSourceFileJS(file)) {\n                    var modifiers = createModifiers(modifierFlags);\n                    accessorModifiers = modifiers;\n                    fieldModifiers = modifiers;\n                }\n                else {\n                    accessorModifiers = createModifiers(prepareModifierFlagsForAccessor(modifierFlags));\n                    fieldModifiers = createModifiers(prepareModifierFlagsForField(modifierFlags));\n                }\n            }\n            updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, fieldModifiers);\n            var getAccessor = generateGetAccessor(fieldName, accessorName, type, accessorModifiers, isStatic, container);\n            ts.suppressLeadingAndTrailingTrivia(getAccessor);\n            insertAccessor(changeTracker, file, getAccessor, declaration, container);\n            if (isReadonly) {\n                // readonly modifier only existed in classLikeDeclaration\n                var constructor = ts.getFirstConstructorWithBody(container);\n                if (constructor) {\n                    updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName.text, originalName);\n                }\n            }\n            else {\n                var setAccessor = generateSetAccessor(fieldName, accessorName, type, accessorModifiers, isStatic, container);\n                ts.suppressLeadingAndTrailingTrivia(setAccessor);\n                insertAccessor(changeTracker, file, setAccessor, declaration, container);\n            }\n            return changeTracker.getChanges();\n        }\n        codefix.generateAccessorFromProperty = generateAccessorFromProperty;\n        function isConvertibleName(name) {\n            return ts.isIdentifier(name) || ts.isStringLiteral(name);\n        }\n        function isAcceptedDeclaration(node) {\n            return ts.isParameterPropertyDeclaration(node, node.parent) || ts.isPropertyDeclaration(node) || ts.isPropertyAssignment(node);\n        }\n        function createPropertyName(name, originalName) {\n            return ts.isIdentifier(originalName) ? ts.factory.createIdentifier(name) : ts.factory.createStringLiteral(name);\n        }\n        function createAccessorAccessExpression(fieldName, isStatic, container) {\n            var leftHead = isStatic ? container.name : ts.factory.createThis(); // TODO: GH#18217\n            return ts.isIdentifier(fieldName) ? ts.factory.createPropertyAccessExpression(leftHead, fieldName) : ts.factory.createElementAccessExpression(leftHead, ts.factory.createStringLiteralFromNode(fieldName));\n        }\n        function createModifiers(modifierFlags) {\n            return modifierFlags ? ts.factory.createNodeArray(ts.factory.createModifiersFromModifierFlags(modifierFlags)) : undefined;\n        }\n        function prepareModifierFlagsForAccessor(modifierFlags) {\n            modifierFlags &= ~64 /* Readonly */; // avoid Readonly modifier because it will convert to get accessor\n            modifierFlags &= ~8 /* Private */;\n            if (!(modifierFlags & 16 /* Protected */)) {\n                modifierFlags |= 4 /* Public */;\n            }\n            return modifierFlags;\n        }\n        function prepareModifierFlagsForField(modifierFlags) {\n            modifierFlags &= ~4 /* Public */;\n            modifierFlags &= ~16 /* Protected */;\n            modifierFlags |= 8 /* Private */;\n            return modifierFlags;\n        }\n        function getAccessorConvertiblePropertyAtPosition(file, program, start, end, considerEmptySpans) {\n            if (considerEmptySpans === void 0) { considerEmptySpans = true; }\n            var node = ts.getTokenAtPosition(file, start);\n            var cursorRequest = start === end && considerEmptySpans;\n            var declaration = ts.findAncestor(node.parent, isAcceptedDeclaration);\n            // make sure declaration have AccessibilityModifier or Static Modifier or Readonly Modifier\n            var meaning = 28 /* AccessibilityModifier */ | 32 /* Static */ | 64 /* Readonly */;\n            if (!declaration || (!(ts.nodeOverlapsWithStartEnd(declaration.name, file, start, end) || cursorRequest))) {\n                return {\n                    error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_find_property_for_which_to_generate_accessor)\n                };\n            }\n            if (!isConvertibleName(declaration.name)) {\n                return {\n                    error: ts.getLocaleSpecificMessage(ts.Diagnostics.Name_is_not_valid)\n                };\n            }\n            if ((ts.getEffectiveModifierFlags(declaration) | meaning) !== meaning) {\n                return {\n                    error: ts.getLocaleSpecificMessage(ts.Diagnostics.Can_only_convert_property_with_modifier)\n                };\n            }\n            var name = declaration.name.text;\n            var startWithUnderscore = ts.startsWithUnderscore(name);\n            var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName(\"_\" + name, file), declaration.name);\n            var accessorName = createPropertyName(startWithUnderscore ? ts.getUniqueName(name.substring(1), file) : name, declaration.name);\n            return {\n                isStatic: ts.hasStaticModifier(declaration),\n                isReadonly: ts.hasEffectiveReadonlyModifier(declaration),\n                type: getDeclarationType(declaration, program),\n                container: declaration.kind === 160 /* Parameter */ ? declaration.parent.parent : declaration.parent,\n                originalName: declaration.name.text,\n                declaration: declaration,\n                fieldName: fieldName,\n                accessorName: accessorName,\n                renameAccessor: startWithUnderscore\n            };\n        }\n        codefix.getAccessorConvertiblePropertyAtPosition = getAccessorConvertiblePropertyAtPosition;\n        function generateGetAccessor(fieldName, accessorName, type, modifiers, isStatic, container) {\n            return ts.factory.createGetAccessorDeclaration(\n            /*decorators*/ undefined, modifiers, accessorName, \n            /*parameters*/ undefined, // TODO: GH#18217\n            type, ts.factory.createBlock([\n                ts.factory.createReturnStatement(createAccessorAccessExpression(fieldName, isStatic, container))\n            ], /*multiLine*/ true));\n        }\n        function generateSetAccessor(fieldName, accessorName, type, modifiers, isStatic, container) {\n            return ts.factory.createSetAccessorDeclaration(\n            /*decorators*/ undefined, modifiers, accessorName, [ts.factory.createParameterDeclaration(\n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, \n                /*dotDotDotToken*/ undefined, ts.factory.createIdentifier(\"value\"), \n                /*questionToken*/ undefined, type)], ts.factory.createBlock([\n                ts.factory.createExpressionStatement(ts.factory.createAssignment(createAccessorAccessExpression(fieldName, isStatic, container), ts.factory.createIdentifier(\"value\")))\n            ], /*multiLine*/ true));\n        }\n        function updatePropertyDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) {\n            var property = ts.factory.updatePropertyDeclaration(declaration, declaration.decorators, modifiers, fieldName, declaration.questionToken || declaration.exclamationToken, type, declaration.initializer);\n            changeTracker.replaceNode(file, declaration, property);\n        }\n        function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) {\n            var assignment = ts.factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer);\n            changeTracker.replacePropertyAssignment(file, declaration, assignment);\n        }\n        function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) {\n            if (ts.isPropertyDeclaration(declaration)) {\n                updatePropertyDeclaration(changeTracker, file, declaration, type, fieldName, modifiers);\n            }\n            else if (ts.isPropertyAssignment(declaration)) {\n                updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName);\n            }\n            else {\n                changeTracker.replaceNode(file, declaration, ts.factory.updateParameterDeclaration(declaration, declaration.decorators, modifiers, declaration.dotDotDotToken, ts.cast(fieldName, ts.isIdentifier), declaration.questionToken, declaration.type, declaration.initializer));\n            }\n        }\n        function insertAccessor(changeTracker, file, accessor, declaration, container) {\n            ts.isParameterPropertyDeclaration(declaration, declaration.parent) ? changeTracker.insertNodeAtClassStart(file, container, accessor) :\n                ts.isPropertyAssignment(declaration) ? changeTracker.insertNodeAfterComma(file, declaration, accessor) :\n                    changeTracker.insertNodeAfter(file, declaration, accessor);\n        }\n        function updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName, originalName) {\n            if (!constructor.body)\n                return;\n            constructor.body.forEachChild(function recur(node) {\n                if (ts.isElementAccessExpression(node) &&\n                    node.expression.kind === 107 /* ThisKeyword */ &&\n                    ts.isStringLiteral(node.argumentExpression) &&\n                    node.argumentExpression.text === originalName &&\n                    ts.isWriteAccess(node)) {\n                    changeTracker.replaceNode(file, node.argumentExpression, ts.factory.createStringLiteral(fieldName));\n                }\n                if (ts.isPropertyAccessExpression(node) && node.expression.kind === 107 /* ThisKeyword */ && node.name.text === originalName && ts.isWriteAccess(node)) {\n                    changeTracker.replaceNode(file, node.name, ts.factory.createIdentifier(fieldName));\n                }\n                if (!ts.isFunctionLike(node) && !ts.isClassLike(node)) {\n                    node.forEachChild(recur);\n                }\n            });\n        }\n        function getDeclarationType(declaration, program) {\n            var typeNode = ts.getTypeAnnotationNode(declaration);\n            if (ts.isPropertyDeclaration(declaration) && typeNode && declaration.questionToken) {\n                var typeChecker = program.getTypeChecker();\n                var type = typeChecker.getTypeFromTypeNode(typeNode);\n                if (!typeChecker.isTypeAssignableTo(typeChecker.getUndefinedType(), type)) {\n                    var types = ts.isUnionTypeNode(typeNode) ? typeNode.types : [typeNode];\n                    return ts.factory.createUnionTypeNode(__spreadArray(__spreadArray([], types), [ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)]));\n                }\n            }\n            return typeNode;\n        }\n        function getAllSupers(decl, checker) {\n            var res = [];\n            while (decl) {\n                var superElement = ts.getClassExtendsHeritageElement(decl);\n                var superSymbol = superElement && checker.getSymbolAtLocation(superElement.expression);\n                if (!superSymbol)\n                    break;\n                var symbol = superSymbol.flags & 2097152 /* Alias */ ? checker.getAliasedSymbol(superSymbol) : superSymbol;\n                var superDecl = ts.find(symbol.declarations, ts.isClassLike);\n                if (!superDecl)\n                    break;\n                res.push(superDecl);\n                decl = superDecl;\n            }\n            return res;\n        }\n        codefix.getAllSupers = getAllSupers;\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixName = \"invalidImportSyntax\";\n        function getCodeFixesForImportDeclaration(context, node) {\n            var sourceFile = ts.getSourceFileOfNode(node);\n            var namespace = ts.getNamespaceDeclarationNode(node);\n            var opts = context.program.getCompilerOptions();\n            var variations = [];\n            // import Bluebird from \"bluebird\";\n            variations.push(createAction(context, sourceFile, node, ts.makeImport(namespace.name, /*namedImports*/ undefined, node.moduleSpecifier, ts.getQuotePreference(sourceFile, context.preferences))));\n            if (ts.getEmitModuleKind(opts) === ts.ModuleKind.CommonJS) {\n                // import Bluebird = require(\"bluebird\");\n                variations.push(createAction(context, sourceFile, node, ts.factory.createImportEqualsDeclaration(\n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, \n                /*isTypeOnly*/ false, namespace.name, ts.factory.createExternalModuleReference(node.moduleSpecifier))));\n            }\n            return variations;\n        }\n        function createAction(context, sourceFile, node, replacement) {\n            var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, node, replacement); });\n            return codefix.createCodeFixActionWithoutFixAll(fixName, changes, [ts.Diagnostics.Replace_import_with_0, changes[0].textChanges[0].newText]);\n        }\n        codefix.registerCodeFix({\n            errorCodes: [\n                ts.Diagnostics.This_expression_is_not_callable.code,\n                ts.Diagnostics.This_expression_is_not_constructable.code,\n            ],\n            getCodeActions: getActionsForUsageOfInvalidImport\n        });\n        function getActionsForUsageOfInvalidImport(context) {\n            var sourceFile = context.sourceFile;\n            var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 203 /* CallExpression */ : 204 /* NewExpression */;\n            var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start), function (a) { return a.kind === targetKind; });\n            if (!node) {\n                return [];\n            }\n            var expr = node.expression;\n            return getImportCodeFixesForExpression(context, expr);\n        }\n        codefix.registerCodeFix({\n            errorCodes: [\n                // The following error codes cover pretty much all assignability errors that could involve an expression\n                ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,\n                ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1.code,\n                ts.Diagnostics.Type_0_is_not_assignable_to_type_1.code,\n                ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code,\n                ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1.code,\n                ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2.code,\n                ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2.code,\n                ts.Diagnostics.Numeric_index_type_0_is_not_assignable_to_string_index_type_1.code,\n                ts.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2.code,\n                ts.Diagnostics.Property_0_in_type_1_is_not_assignable_to_type_2.code,\n                ts.Diagnostics.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property.code,\n                ts.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1.code,\n            ],\n            getCodeActions: getActionsForInvalidImportLocation\n        });\n        function getActionsForInvalidImportLocation(context) {\n            var sourceFile = context.sourceFile;\n            var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start), function (a) { return a.getStart() === context.span.start && a.getEnd() === (context.span.start + context.span.length); });\n            if (!node) {\n                return [];\n            }\n            return getImportCodeFixesForExpression(context, node);\n        }\n        function getImportCodeFixesForExpression(context, expr) {\n            var type = context.program.getTypeChecker().getTypeAtLocation(expr);\n            if (!(type.symbol && type.symbol.originatingImport)) {\n                return [];\n            }\n            var fixes = [];\n            var relatedImport = type.symbol.originatingImport; // TODO: GH#18217\n            if (!ts.isImportCall(relatedImport)) {\n                ts.addRange(fixes, getCodeFixesForImportDeclaration(context, relatedImport));\n            }\n            if (ts.isExpression(expr) && !(ts.isNamedDeclaration(expr.parent) && expr.parent.name === expr)) {\n                var sourceFile_1 = context.sourceFile;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile_1, expr, ts.factory.createPropertyAccessExpression(expr, \"default\"), {}); });\n                fixes.push(codefix.createCodeFixActionWithoutFixAll(fixName, changes, ts.Diagnostics.Use_synthetic_default_member));\n            }\n            return fixes;\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixName = \"strictClassInitialization\";\n        var fixIdAddDefiniteAssignmentAssertions = \"addMissingPropertyDefiniteAssignmentAssertions\";\n        var fixIdAddUndefinedType = \"addMissingPropertyUndefinedType\";\n        var fixIdAddInitializer = \"addMissingPropertyInitializer\";\n        var errorCodes = [ts.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var propertyDeclaration = getPropertyDeclaration(context.sourceFile, context.span.start);\n                if (!propertyDeclaration)\n                    return;\n                var result = [\n                    getActionForAddMissingUndefinedType(context, propertyDeclaration),\n                    getActionForAddMissingDefiniteAssignmentAssertion(context, propertyDeclaration)\n                ];\n                ts.append(result, getActionForAddMissingInitializer(context, propertyDeclaration));\n                return result;\n            },\n            fixIds: [fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer],\n            getAllCodeActions: function (context) {\n                return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                    var propertyDeclaration = getPropertyDeclaration(diag.file, diag.start);\n                    if (!propertyDeclaration)\n                        return;\n                    switch (context.fixId) {\n                        case fixIdAddDefiniteAssignmentAssertions:\n                            addDefiniteAssignmentAssertion(changes, diag.file, propertyDeclaration);\n                            break;\n                        case fixIdAddUndefinedType:\n                            addUndefinedType(changes, diag.file, propertyDeclaration);\n                            break;\n                        case fixIdAddInitializer:\n                            var checker = context.program.getTypeChecker();\n                            var initializer = getInitializer(checker, propertyDeclaration);\n                            if (!initializer)\n                                return;\n                            addInitializer(changes, diag.file, propertyDeclaration, initializer);\n                            break;\n                        default:\n                            ts.Debug.fail(JSON.stringify(context.fixId));\n                    }\n                });\n            },\n        });\n        function getPropertyDeclaration(sourceFile, pos) {\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            return ts.isIdentifier(token) ? ts.cast(token.parent, ts.isPropertyDeclaration) : undefined;\n        }\n        function getActionForAddMissingDefiniteAssignmentAssertion(context, propertyDeclaration) {\n            var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addDefiniteAssignmentAssertion(t, context.sourceFile, propertyDeclaration); });\n            return codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Add_definite_assignment_assertion_to_property_0, propertyDeclaration.getText()], fixIdAddDefiniteAssignmentAssertions, ts.Diagnostics.Add_definite_assignment_assertions_to_all_uninitialized_properties);\n        }\n        function addDefiniteAssignmentAssertion(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) {\n            var property = ts.factory.updatePropertyDeclaration(propertyDeclaration, propertyDeclaration.decorators, propertyDeclaration.modifiers, propertyDeclaration.name, ts.factory.createToken(53 /* ExclamationToken */), propertyDeclaration.type, propertyDeclaration.initializer);\n            changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration, property);\n        }\n        function getActionForAddMissingUndefinedType(context, propertyDeclaration) {\n            var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addUndefinedType(t, context.sourceFile, propertyDeclaration); });\n            return codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Add_undefined_type_to_property_0, propertyDeclaration.name.getText()], fixIdAddUndefinedType, ts.Diagnostics.Add_undefined_type_to_all_uninitialized_properties);\n        }\n        function addUndefinedType(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) {\n            var undefinedTypeNode = ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */);\n            var type = propertyDeclaration.type; // TODO: GH#18217\n            var types = ts.isUnionTypeNode(type) ? type.types.concat(undefinedTypeNode) : [type, undefinedTypeNode];\n            changeTracker.replaceNode(propertyDeclarationSourceFile, type, ts.factory.createUnionTypeNode(types));\n        }\n        function getActionForAddMissingInitializer(context, propertyDeclaration) {\n            var checker = context.program.getTypeChecker();\n            var initializer = getInitializer(checker, propertyDeclaration);\n            if (!initializer)\n                return undefined;\n            var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addInitializer(t, context.sourceFile, propertyDeclaration, initializer); });\n            return codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Add_initializer_to_property_0, propertyDeclaration.name.getText()], fixIdAddInitializer, ts.Diagnostics.Add_initializers_to_all_uninitialized_properties);\n        }\n        function addInitializer(changeTracker, propertyDeclarationSourceFile, propertyDeclaration, initializer) {\n            var property = ts.factory.updatePropertyDeclaration(propertyDeclaration, propertyDeclaration.decorators, propertyDeclaration.modifiers, propertyDeclaration.name, propertyDeclaration.questionToken, propertyDeclaration.type, initializer);\n            changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration, property);\n        }\n        function getInitializer(checker, propertyDeclaration) {\n            return getDefaultValueFromType(checker, checker.getTypeFromTypeNode(propertyDeclaration.type)); // TODO: GH#18217\n        }\n        function getDefaultValueFromType(checker, type) {\n            if (type.flags & 512 /* BooleanLiteral */) {\n                return (type === checker.getFalseType() || type === checker.getFalseType(/*fresh*/ true)) ? ts.factory.createFalse() : ts.factory.createTrue();\n            }\n            else if (type.isStringLiteral()) {\n                return ts.factory.createStringLiteral(type.value);\n            }\n            else if (type.isNumberLiteral()) {\n                return ts.factory.createNumericLiteral(type.value);\n            }\n            else if (type.flags & 2048 /* BigIntLiteral */) {\n                return ts.factory.createBigIntLiteral(type.value);\n            }\n            else if (type.isUnion()) {\n                return ts.firstDefined(type.types, function (t) { return getDefaultValueFromType(checker, t); });\n            }\n            else if (type.isClass()) {\n                var classDeclaration = ts.getClassLikeDeclarationOfSymbol(type.symbol);\n                if (!classDeclaration || ts.hasSyntacticModifier(classDeclaration, 128 /* Abstract */))\n                    return undefined;\n                var constructorDeclaration = ts.getFirstConstructorWithBody(classDeclaration);\n                if (constructorDeclaration && constructorDeclaration.parameters.length)\n                    return undefined;\n                return ts.factory.createNewExpression(ts.factory.createIdentifier(type.symbol.name), /*typeArguments*/ undefined, /*argumentsArray*/ undefined);\n            }\n            else if (checker.isArrayLikeType(type)) {\n                return ts.factory.createArrayLiteralExpression();\n            }\n            return undefined;\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"requireInTs\";\n        var errorCodes = [ts.Diagnostics.require_call_may_be_converted_to_an_import.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var info = getInfo(context.sourceFile, context.program, context.span.start);\n                if (!info) {\n                    return undefined;\n                }\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, info); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Convert_require_to_import, fixId, ts.Diagnostics.Convert_all_require_to_import)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                var info = getInfo(diag.file, context.program, diag.start);\n                if (info) {\n                    doChange(changes, context.sourceFile, info);\n                }\n            }); },\n        });\n        function doChange(changes, sourceFile, info) {\n            var allowSyntheticDefaults = info.allowSyntheticDefaults, defaultImportName = info.defaultImportName, namedImports = info.namedImports, statement = info.statement, required = info.required;\n            changes.replaceNode(sourceFile, statement, defaultImportName && !allowSyntheticDefaults\n                ? ts.factory.createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ false, defaultImportName, ts.factory.createExternalModuleReference(required))\n                : ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, defaultImportName, namedImports), required));\n        }\n        function getInfo(sourceFile, program, pos) {\n            var parent = ts.getTokenAtPosition(sourceFile, pos).parent;\n            if (!ts.isRequireCall(parent, /*checkArgumentIsStringLiteralLike*/ true)) {\n                throw ts.Debug.failBadSyntaxKind(parent);\n            }\n            var decl = ts.cast(parent.parent, ts.isVariableDeclaration);\n            var defaultImportName = ts.tryCast(decl.name, ts.isIdentifier);\n            var namedImports = ts.isObjectBindingPattern(decl.name) ? tryCreateNamedImportsFromObjectBindingPattern(decl.name) : undefined;\n            if (defaultImportName || namedImports) {\n                return {\n                    allowSyntheticDefaults: ts.getAllowSyntheticDefaultImports(program.getCompilerOptions()),\n                    defaultImportName: defaultImportName,\n                    namedImports: namedImports,\n                    statement: ts.cast(decl.parent.parent, ts.isVariableStatement),\n                    required: ts.first(parent.arguments)\n                };\n            }\n        }\n        function tryCreateNamedImportsFromObjectBindingPattern(node) {\n            var importSpecifiers = [];\n            for (var _i = 0, _a = node.elements; _i < _a.length; _i++) {\n                var element = _a[_i];\n                if (!ts.isIdentifier(element.name) || element.initializer) {\n                    return undefined;\n                }\n                importSpecifiers.push(ts.factory.createImportSpecifier(ts.tryCast(element.propertyName, ts.isIdentifier), element.name));\n            }\n            if (importSpecifiers.length) {\n                return ts.factory.createNamedImports(importSpecifiers);\n            }\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"useDefaultImport\";\n        var errorCodes = [ts.Diagnostics.Import_may_be_converted_to_a_default_import.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, start = context.span.start;\n                var info = getInfo(sourceFile, start);\n                if (!info)\n                    return undefined;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info, context.preferences); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Convert_to_default_import, fixId, ts.Diagnostics.Convert_all_to_default_imports)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                var info = getInfo(diag.file, diag.start);\n                if (info)\n                    doChange(changes, diag.file, info, context.preferences);\n            }); },\n        });\n        function getInfo(sourceFile, pos) {\n            var name = ts.getTokenAtPosition(sourceFile, pos);\n            if (!ts.isIdentifier(name))\n                return undefined; // bad input\n            var parent = name.parent;\n            if (ts.isImportEqualsDeclaration(parent) && ts.isExternalModuleReference(parent.moduleReference)) {\n                return { importNode: parent, name: name, moduleSpecifier: parent.moduleReference.expression };\n            }\n            else if (ts.isNamespaceImport(parent)) {\n                var importNode = parent.parent.parent;\n                return { importNode: importNode, name: name, moduleSpecifier: importNode.moduleSpecifier };\n            }\n        }\n        function doChange(changes, sourceFile, info, preferences) {\n            changes.replaceNode(sourceFile, info.importNode, ts.makeImport(info.name, /*namedImports*/ undefined, info.moduleSpecifier, ts.getQuotePreference(sourceFile, preferences)));\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"useBigintLiteral\";\n        var errorCodes = [\n            ts.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers.code,\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span); });\n                if (changes.length > 0) {\n                    return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Convert_to_a_bigint_numeric_literal, fixId, ts.Diagnostics.Convert_all_to_bigint_numeric_literals)];\n                }\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) {\n                return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag); });\n            },\n        });\n        function makeChange(changeTracker, sourceFile, span) {\n            var numericLiteral = ts.tryCast(ts.getTokenAtPosition(sourceFile, span.start), ts.isNumericLiteral);\n            if (!numericLiteral) {\n                return;\n            }\n            // We use .getText to overcome parser inaccuracies: https://github.com/microsoft/TypeScript/issues/33298\n            var newText = numericLiteral.getText(sourceFile) + \"n\";\n            changeTracker.replaceNode(sourceFile, numericLiteral, ts.factory.createBigIntLiteral(newText));\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixIdAddMissingTypeof = \"fixAddModuleReferTypeMissingTypeof\";\n        var fixId = fixIdAddMissingTypeof;\n        var errorCodes = [ts.Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, span = context.span;\n                var importType = getImportTypeNode(sourceFile, span.start);\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, importType); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_missing_typeof, fixId, ts.Diagnostics.Add_missing_typeof)];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                return doChange(changes, context.sourceFile, getImportTypeNode(diag.file, diag.start));\n            }); },\n        });\n        function getImportTypeNode(sourceFile, pos) {\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            ts.Debug.assert(token.kind === 99 /* ImportKeyword */, \"This token should be an ImportKeyword\");\n            ts.Debug.assert(token.parent.kind === 195 /* ImportType */, \"Token parent should be an ImportType\");\n            return token.parent;\n        }\n        function doChange(changes, sourceFile, importType) {\n            var newTypeNode = ts.factory.updateImportTypeNode(importType, importType.argument, importType.qualifier, importType.typeArguments, /* isTypeOf */ true);\n            changes.replaceNode(sourceFile, importType, newTypeNode);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixID = \"wrapJsxInFragment\";\n        var errorCodes = [ts.Diagnostics.JSX_expressions_must_have_one_parent_element.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var jsx = context.program.getCompilerOptions().jsx;\n                if (jsx !== 2 /* React */ && jsx !== 3 /* ReactNative */) {\n                    return undefined;\n                }\n                var sourceFile = context.sourceFile, span = context.span;\n                var node = findNodeToFix(sourceFile, span.start);\n                if (!node)\n                    return undefined;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, node); });\n                return [codefix.createCodeFixAction(fixID, changes, ts.Diagnostics.Wrap_in_JSX_fragment, fixID, ts.Diagnostics.Wrap_all_unparented_JSX_in_JSX_fragment)];\n            },\n            fixIds: [fixID],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                var node = findNodeToFix(context.sourceFile, diag.start);\n                if (!node)\n                    return undefined;\n                doChange(changes, context.sourceFile, node);\n            }); },\n        });\n        function findNodeToFix(sourceFile, pos) {\n            // The error always at 1st token that is \"<\" in \"<a /><a />\"\n            var lessThanToken = ts.getTokenAtPosition(sourceFile, pos);\n            var firstJsxElementOrOpenElement = lessThanToken.parent;\n            var binaryExpr = firstJsxElementOrOpenElement.parent;\n            if (!ts.isBinaryExpression(binaryExpr)) {\n                // In case the start element is a JsxSelfClosingElement, it the end.\n                // For JsxOpenElement, find one more parent\n                binaryExpr = binaryExpr.parent;\n                if (!ts.isBinaryExpression(binaryExpr))\n                    return undefined;\n            }\n            if (!ts.nodeIsMissing(binaryExpr.operatorToken))\n                return undefined;\n            return binaryExpr;\n        }\n        function doChange(changeTracker, sf, node) {\n            var jsx = flattenInvalidBinaryExpr(node);\n            if (jsx)\n                changeTracker.replaceNode(sf, node, ts.factory.createJsxFragment(ts.factory.createJsxOpeningFragment(), jsx, ts.factory.createJsxJsxClosingFragment()));\n        }\n        // The invalid syntax is constructed as\n        // InvalidJsxTree :: One of\n        //     JsxElement CommaToken InvalidJsxTree\n        //     JsxElement CommaToken JsxElement\n        function flattenInvalidBinaryExpr(node) {\n            var children = [];\n            var current = node;\n            while (true) {\n                if (ts.isBinaryExpression(current) && ts.nodeIsMissing(current.operatorToken) && current.operatorToken.kind === 27 /* CommaToken */) {\n                    children.push(current.left);\n                    if (ts.isJsxChild(current.right)) {\n                        children.push(current.right);\n                        // Indicates the tree has go to the bottom\n                        return children;\n                    }\n                    else if (ts.isBinaryExpression(current.right)) {\n                        current = current.right;\n                        continue;\n                    }\n                    // Unreachable case\n                    else\n                        return undefined;\n                }\n                // Unreachable case\n                else\n                    return undefined;\n            }\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixIdAddMissingTypeof = \"fixConvertToMappedObjectType\";\n        var fixId = fixIdAddMissingTypeof;\n        var errorCodes = [ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, span = context.span;\n                var info = getInfo(sourceFile, span.start);\n                if (!info)\n                    return undefined;\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info); });\n                var name = ts.idText(info.container.name);\n                return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Convert_0_to_mapped_object_type, name], fixId, [ts.Diagnostics.Convert_0_to_mapped_object_type, name])];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                var info = getInfo(diag.file, diag.start);\n                if (info)\n                    doChange(changes, diag.file, info);\n            }); }\n        });\n        function getInfo(sourceFile, pos) {\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            var indexSignature = ts.cast(token.parent.parent, ts.isIndexSignatureDeclaration);\n            if (ts.isClassDeclaration(indexSignature.parent))\n                return undefined;\n            var container = ts.isInterfaceDeclaration(indexSignature.parent) ? indexSignature.parent : ts.cast(indexSignature.parent.parent, ts.isTypeAliasDeclaration);\n            return { indexSignature: indexSignature, container: container };\n        }\n        function createTypeAliasFromInterface(declaration, type) {\n            return ts.factory.createTypeAliasDeclaration(declaration.decorators, declaration.modifiers, declaration.name, declaration.typeParameters, type);\n        }\n        function doChange(changes, sourceFile, _a) {\n            var indexSignature = _a.indexSignature, container = _a.container;\n            var members = ts.isInterfaceDeclaration(container) ? container.members : container.type.members;\n            var otherMembers = members.filter(function (member) { return !ts.isIndexSignatureDeclaration(member); });\n            var parameter = ts.first(indexSignature.parameters);\n            var mappedTypeParameter = ts.factory.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type);\n            var mappedIntersectionType = ts.factory.createMappedTypeNode(ts.hasEffectiveReadonlyModifier(indexSignature) ? ts.factory.createModifier(142 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, \n            /*nameType*/ undefined, indexSignature.questionToken, indexSignature.type);\n            var intersectionType = ts.factory.createIntersectionTypeNode(__spreadArray(__spreadArray(__spreadArray([], ts.getAllSuperTypeNodes(container)), [\n                mappedIntersectionType\n            ]), (otherMembers.length ? [ts.factory.createTypeLiteralNode(otherMembers)] : ts.emptyArray)));\n            changes.replaceNode(sourceFile, container, createTypeAliasFromInterface(container, intersectionType));\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"removeAccidentalCallParentheses\";\n        var errorCodes = [\n            ts.Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code,\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var callExpression = ts.findAncestor(ts.getTokenAtPosition(context.sourceFile, context.span.start), ts.isCallExpression);\n                if (!callExpression) {\n                    return undefined;\n                }\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) {\n                    t.deleteRange(context.sourceFile, { pos: callExpression.expression.end, end: callExpression.end });\n                });\n                return [codefix.createCodeFixActionWithoutFixAll(fixId, changes, ts.Diagnostics.Remove_parentheses)];\n            },\n            fixIds: [fixId],\n        });\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"removeUnnecessaryAwait\";\n        var errorCodes = [\n            ts.Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code,\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span); });\n                if (changes.length > 0) {\n                    return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Remove_unnecessary_await, fixId, ts.Diagnostics.Remove_all_unnecessary_uses_of_await)];\n                }\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) {\n                return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag); });\n            },\n        });\n        function makeChange(changeTracker, sourceFile, span) {\n            var awaitKeyword = ts.tryCast(ts.getTokenAtPosition(sourceFile, span.start), function (node) { return node.kind === 130 /* AwaitKeyword */; });\n            var awaitExpression = awaitKeyword && ts.tryCast(awaitKeyword.parent, ts.isAwaitExpression);\n            if (!awaitExpression) {\n                return;\n            }\n            var expressionToReplace = awaitExpression;\n            var hasSurroundingParens = ts.isParenthesizedExpression(awaitExpression.parent);\n            if (hasSurroundingParens) {\n                var leftMostExpression = ts.getLeftmostExpression(awaitExpression.expression, /*stopAtCallExpressions*/ false);\n                if (ts.isIdentifier(leftMostExpression)) {\n                    var precedingToken = ts.findPrecedingToken(awaitExpression.parent.pos, sourceFile);\n                    if (precedingToken && precedingToken.kind !== 102 /* NewKeyword */) {\n                        expressionToReplace = awaitExpression.parent;\n                    }\n                }\n            }\n            changeTracker.replaceNode(sourceFile, expressionToReplace, awaitExpression.expression);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var errorCodes = [ts.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code];\n        var fixId = \"splitTypeOnlyImport\";\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            fixIds: [fixId],\n            getCodeActions: function (context) {\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) {\n                    return splitTypeOnlyImport(t, getImportDeclaration(context.sourceFile, context.span), context);\n                });\n                if (changes.length) {\n                    return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Split_into_two_separate_import_declarations, fixId, ts.Diagnostics.Split_all_invalid_type_only_imports)];\n                }\n            },\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, error) {\n                splitTypeOnlyImport(changes, getImportDeclaration(context.sourceFile, error), context);\n            }); },\n        });\n        function getImportDeclaration(sourceFile, span) {\n            return ts.findAncestor(ts.getTokenAtPosition(sourceFile, span.start), ts.isImportDeclaration);\n        }\n        function splitTypeOnlyImport(changes, importDeclaration, context) {\n            if (!importDeclaration) {\n                return;\n            }\n            var importClause = ts.Debug.checkDefined(importDeclaration.importClause);\n            changes.replaceNode(context.sourceFile, importDeclaration, ts.factory.updateImportDeclaration(importDeclaration, importDeclaration.decorators, importDeclaration.modifiers, ts.factory.updateImportClause(importClause, importClause.isTypeOnly, importClause.name, /*namedBindings*/ undefined), importDeclaration.moduleSpecifier));\n            changes.insertNodeAfter(context.sourceFile, importDeclaration, ts.factory.createImportDeclaration(\n            /*decorators*/ undefined, \n            /*modifiers*/ undefined, ts.factory.updateImportClause(importClause, importClause.isTypeOnly, /*name*/ undefined, importClause.namedBindings), importDeclaration.moduleSpecifier));\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"fixConvertConstToLet\";\n        var errorCodes = [ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile, span = context.span, program = context.program;\n                var variableStatement = getVariableStatement(sourceFile, span.start, program);\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, variableStatement); });\n                return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Convert_const_to_let, fixId, ts.Diagnostics.Convert_const_to_let)];\n            },\n            fixIds: [fixId]\n        });\n        function getVariableStatement(sourceFile, pos, program) {\n            var token = ts.getTokenAtPosition(sourceFile, pos);\n            var checker = program.getTypeChecker();\n            var symbol = checker.getSymbolAtLocation(token);\n            if (symbol) {\n                return symbol.valueDeclaration.parent.parent;\n            }\n        }\n        function doChange(changes, sourceFile, variableStatement) {\n            if (!variableStatement) {\n                return;\n            }\n            var start = variableStatement.getStart();\n            changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 5 }, \"let\");\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixId = \"fixExpectedComma\";\n        var expectedErrorCode = ts.Diagnostics._0_expected.code;\n        var errorCodes = [expectedErrorCode];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            getCodeActions: function (context) {\n                var sourceFile = context.sourceFile;\n                var info = getInfo(sourceFile, context.span.start, context.errorCode);\n                if (!info) {\n                    return undefined;\n                }\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info); });\n                return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Change_0_to_1, \";\", \",\"], fixId, [ts.Diagnostics.Change_0_to_1, \";\", \",\"])];\n            },\n            fixIds: [fixId],\n            getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {\n                var info = getInfo(diag.file, diag.start, diag.code);\n                if (info)\n                    doChange(changes, context.sourceFile, info);\n            }); },\n        });\n        function getInfo(sourceFile, pos, _) {\n            var node = ts.getTokenAtPosition(sourceFile, pos);\n            return (node.kind === 26 /* SemicolonToken */ &&\n                node.parent &&\n                (ts.isObjectLiteralExpression(node.parent) ||\n                    ts.isArrayLiteralExpression(node.parent))) ? { node: node } : undefined;\n        }\n        function doChange(changes, sourceFile, _a) {\n            var node = _a.node;\n            var newNode = ts.factory.createToken(27 /* CommaToken */);\n            changes.replaceNode(sourceFile, node, newNode);\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var codefix;\n    (function (codefix) {\n        var fixName = \"addVoidToPromise\";\n        var fixId = \"addVoidToPromise\";\n        var errorCodes = [\n            ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code\n        ];\n        codefix.registerCodeFix({\n            errorCodes: errorCodes,\n            fixIds: [fixId],\n            getCodeActions: function (context) {\n                var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span, context.program); });\n                if (changes.length > 0) {\n                    return [codefix.createCodeFixAction(fixName, changes, ts.Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId, ts.Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)];\n                }\n            },\n            getAllCodeActions: function (context) {\n                return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag, context.program, new ts.Set()); });\n            }\n        });\n        function makeChange(changes, sourceFile, span, program, seen) {\n            var node = ts.getTokenAtPosition(sourceFile, span.start);\n            if (!ts.isIdentifier(node) || !ts.isCallExpression(node.parent) || node.parent.expression !== node || node.parent.arguments.length !== 0)\n                return;\n            var checker = program.getTypeChecker();\n            var symbol = checker.getSymbolAtLocation(node);\n            // decl should be `new Promise((<decl>) => {})`\n            var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration;\n            if (!decl || !ts.isParameter(decl) || !ts.isNewExpression(decl.parent.parent))\n                return;\n            // no need to make this change if we have already seen this parameter.\n            if (seen === null || seen === void 0 ? void 0 : seen.has(decl))\n                return;\n            seen === null || seen === void 0 ? void 0 : seen.add(decl);\n            var typeArguments = getEffectiveTypeArguments(decl.parent.parent);\n            if (ts.some(typeArguments)) {\n                // append ` | void` to type argument\n                var typeArgument = typeArguments[0];\n                var needsParens = !ts.isUnionTypeNode(typeArgument) && !ts.isParenthesizedTypeNode(typeArgument) &&\n                    ts.isParenthesizedTypeNode(ts.factory.createUnionTypeNode([typeArgument, ts.factory.createKeywordTypeNode(113 /* VoidKeyword */)]).types[0]);\n                if (needsParens) {\n                    changes.insertText(sourceFile, typeArgument.pos, \"(\");\n                }\n                changes.insertText(sourceFile, typeArgument.end, needsParens ? \") | void\" : \" | void\");\n            }\n            else {\n                // make sure the Promise is type is untyped (i.e., `unknown`)\n                var signature = checker.getResolvedSignature(node.parent);\n                var parameter = signature === null || signature === void 0 ? void 0 : signature.parameters[0];\n                var parameterType = parameter && checker.getTypeOfSymbolAtLocation(parameter, decl.parent.parent);\n                if (ts.isInJSFile(decl)) {\n                    if (!parameterType || parameterType.flags & 3 /* AnyOrUnknown */) {\n                        // give the expression a type\n                        changes.insertText(sourceFile, decl.parent.parent.end, \")\");\n                        changes.insertText(sourceFile, ts.skipTrivia(sourceFile.text, decl.parent.parent.pos), \"/** @type {Promise<void>} */(\");\n                    }\n                }\n                else {\n                    if (!parameterType || parameterType.flags & 2 /* Unknown */) {\n                        // add `void` type argument\n                        changes.insertText(sourceFile, decl.parent.parent.expression.end, \"<void>\");\n                    }\n                }\n            }\n        }\n        function getEffectiveTypeArguments(node) {\n            var _a;\n            if (ts.isInJSFile(node)) {\n                if (ts.isParenthesizedExpression(node.parent)) {\n                    var jsDocType = (_a = ts.getJSDocTypeTag(node.parent)) === null || _a === void 0 ? void 0 : _a.typeExpression.type;\n                    if (jsDocType && ts.isTypeReferenceNode(jsDocType) && ts.isIdentifier(jsDocType.typeName) && ts.idText(jsDocType.typeName) === \"Promise\") {\n                        return jsDocType.typeArguments;\n                    }\n                }\n            }\n            else {\n                return node.typeArguments;\n            }\n        }\n    })(codefix = ts.codefix || (ts.codefix = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var refactor;\n    (function (refactor) {\n        var refactorName = \"Convert export\";\n        var defaultToNamedAction = {\n            name: \"Convert default export to named export\",\n            description: ts.Diagnostics.Convert_default_export_to_named_export.message,\n            kind: \"refactor.rewrite.export.named\"\n        };\n        var namedToDefaultAction = {\n            name: \"Convert named export to default export\",\n            description: ts.Diagnostics.Convert_named_export_to_default_export.message,\n            kind: \"refactor.rewrite.export.default\"\n        };\n        refactor.registerRefactor(refactorName, {\n            kinds: [\n                defaultToNamedAction.kind,\n                namedToDefaultAction.kind\n            ],\n            getAvailableActions: function (context) {\n                var info = getInfo(context, context.triggerReason === \"invoked\");\n                if (!info)\n                    return ts.emptyArray;\n                if (!refactor.isRefactorErrorInfo(info)) {\n                    var action = info.wasDefault ? defaultToNamedAction : namedToDefaultAction;\n                    return [{ name: refactorName, description: action.description, actions: [action] }];\n                }\n                if (context.preferences.provideRefactorNotApplicableReason) {\n                    return [\n                        { name: refactorName, description: ts.Diagnostics.Convert_default_export_to_named_export.message, actions: [\n                                __assign(__assign({}, defaultToNamedAction), { notApplicableReason: info.error }),\n                                __assign(__assign({}, namedToDefaultAction), { notApplicableReason: info.error }),\n                            ] }\n                    ];\n                }\n                return ts.emptyArray;\n            },\n            getEditsForAction: function (context, actionName) {\n                ts.Debug.assert(actionName === defaultToNamedAction.name || actionName === namedToDefaultAction.name, \"Unexpected action name\");\n                var info = getInfo(context);\n                ts.Debug.assert(info && !refactor.isRefactorErrorInfo(info), \"Expected applicable refactor info\");\n                var edits = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(context.file, context.program, info, t, context.cancellationToken); });\n                return { edits: edits, renameFilename: undefined, renameLocation: undefined };\n            },\n        });\n        ;\n        function getInfo(context, considerPartialSpans) {\n            if (considerPartialSpans === void 0) { considerPartialSpans = true; }\n            var file = context.file;\n            var span = ts.getRefactorContextSpan(context);\n            var token = ts.getTokenAtPosition(file, span.start);\n            var exportNode = !!(token.parent && ts.getSyntacticModifierFlags(token.parent) & 1 /* Export */) && considerPartialSpans ? token.parent : ts.getParentNodeInSpan(token, file, span);\n            if (!exportNode || (!ts.isSourceFile(exportNode.parent) && !(ts.isModuleBlock(exportNode.parent) && ts.isAmbientModule(exportNode.parent.parent)))) {\n                return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_find_export_statement) };\n            }\n            var exportingModuleSymbol = ts.isSourceFile(exportNode.parent) ? exportNode.parent.symbol : exportNode.parent.parent.symbol;\n            var flags = ts.getSyntacticModifierFlags(exportNode);\n            var wasDefault = !!(flags & 512 /* Default */);\n            // If source file already has a default export, don't offer refactor.\n            if (!(flags & 1 /* Export */) || !wasDefault && exportingModuleSymbol.exports.has(\"default\" /* Default */)) {\n                return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.This_file_already_has_a_default_export) };\n            }\n            switch (exportNode.kind) {\n                case 251 /* FunctionDeclaration */:\n                case 252 /* ClassDeclaration */:\n                case 253 /* InterfaceDeclaration */:\n                case 255 /* EnumDeclaration */:\n                case 254 /* TypeAliasDeclaration */:\n                case 256 /* ModuleDeclaration */: {\n                    var node = exportNode;\n                    return node.name && ts.isIdentifier(node.name) ? { exportNode: node, exportName: node.name, wasDefault: wasDefault, exportingModuleSymbol: exportingModuleSymbol } : undefined;\n                }\n                case 232 /* VariableStatement */: {\n                    var vs = exportNode;\n                    // Must be `export const x = something;`.\n                    if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) {\n                        return undefined;\n                    }\n                    var decl = ts.first(vs.declarationList.declarations);\n                    if (!decl.initializer)\n                        return undefined;\n                    ts.Debug.assert(!wasDefault, \"Can't have a default flag here\");\n                    return ts.isIdentifier(decl.name) ? { exportNode: vs, exportName: decl.name, wasDefault: wasDefault, exportingModuleSymbol: exportingModuleSymbol } : undefined;\n                }\n                default:\n                    return undefined;\n            }\n        }\n        function doChange(exportingSourceFile, program, info, changes, cancellationToken) {\n            changeExport(exportingSourceFile, info, changes, program.getTypeChecker());\n            changeImports(program, info, changes, cancellationToken);\n        }\n        function changeExport(exportingSourceFile, _a, changes, checker) {\n            var wasDefault = _a.wasDefault, exportNode = _a.exportNode, exportName = _a.exportName;\n            if (wasDefault) {\n                changes.delete(exportingSourceFile, ts.Debug.checkDefined(ts.findModifier(exportNode, 87 /* DefaultKeyword */), \"Should find a default keyword in modifier list\"));\n            }\n            else {\n                var exportKeyword = ts.Debug.checkDefined(ts.findModifier(exportNode, 92 /* ExportKeyword */), \"Should find an export keyword in modifier list\");\n                switch (exportNode.kind) {\n                    case 251 /* FunctionDeclaration */:\n                    case 252 /* ClassDeclaration */:\n                    case 253 /* InterfaceDeclaration */:\n                        changes.insertNodeAfter(exportingSourceFile, exportKeyword, ts.factory.createToken(87 /* DefaultKeyword */));\n                        break;\n                    case 232 /* VariableStatement */:\n                        // If 'x' isn't used in this file and doesn't have type definition, `export const x = 0;` --> `export default 0;`\n                        var decl = ts.first(exportNode.declarationList.declarations);\n                        if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile) && !decl.type) {\n                            // We checked in `getInfo` that an initializer exists.\n                            changes.replaceNode(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.Debug.checkDefined(decl.initializer, \"Initializer was previously known to be present\")));\n                            break;\n                        }\n                    // falls through\n                    case 255 /* EnumDeclaration */:\n                    case 254 /* TypeAliasDeclaration */:\n                    case 256 /* ModuleDeclaration */:\n                        // `export type T = number;` -> `type T = number; export default T;`\n                        changes.deleteModifier(exportingSourceFile, exportKeyword);\n                        changes.insertNodeAfter(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.factory.createIdentifier(exportName.text)));\n                        break;\n                    default:\n                        ts.Debug.assertNever(exportNode, \"Unexpected exportNode kind \" + exportNode.kind);\n                }\n            }\n        }\n        function changeImports(program, _a, changes, cancellationToken) {\n            var wasDefault = _a.wasDefault, exportName = _a.exportName, exportingModuleSymbol = _a.exportingModuleSymbol;\n            var checker = program.getTypeChecker();\n            var exportSymbol = ts.Debug.checkDefined(checker.getSymbolAtLocation(exportName), \"Export name should resolve to a symbol\");\n            ts.FindAllReferences.Core.eachExportReference(program.getSourceFiles(), checker, cancellationToken, exportSymbol, exportingModuleSymbol, exportName.text, wasDefault, function (ref) {\n                var importingSourceFile = ref.getSourceFile();\n                if (wasDefault) {\n                    changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName.text);\n                }\n                else {\n                    changeNamedToDefaultImport(importingSourceFile, ref, changes);\n                }\n            });\n        }\n        function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) {\n            var parent = ref.parent;\n            switch (parent.kind) {\n                case 201 /* PropertyAccessExpression */:\n                    // `a.default` --> `a.foo`\n                    changes.replaceNode(importingSourceFile, ref, ts.factory.createIdentifier(exportName));\n                    break;\n                case 265 /* ImportSpecifier */:\n                case 270 /* ExportSpecifier */: {\n                    var spec = parent;\n                    // `default as foo` --> `foo`, `default as bar` --> `foo as bar`\n                    changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text));\n                    break;\n                }\n                case 262 /* ImportClause */: {\n                    var clause = parent;\n                    ts.Debug.assert(clause.name === ref, \"Import clause name should match provided ref\");\n                    var spec = makeImportSpecifier(exportName, ref.text);\n                    var namedBindings = clause.namedBindings;\n                    if (!namedBindings) {\n                        // `import foo from \"./a\";` --> `import { foo } from \"./a\";`\n                        changes.replaceNode(importingSourceFile, ref, ts.factory.createNamedImports([spec]));\n                    }\n                    else if (namedBindings.kind === 263 /* NamespaceImport */) {\n                        // `import foo, * as a from \"./a\";` --> `import * as a from \".a/\"; import { foo } from \"./a\";`\n                        changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) });\n                        var quotePreference = ts.isStringLiteral(clause.parent.moduleSpecifier) ? ts.quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */;\n                        var newImport = ts.makeImport(/*default*/ undefined, [makeImportSpecifier(exportName, ref.text)], clause.parent.moduleSpecifier, quotePreference);\n                        changes.insertNodeAfter(importingSourceFile, clause.parent, newImport);\n                    }\n                    else {\n                        // `import foo, { bar } from \"./a\"` --> `import { bar, foo } from \"./a\";`\n                        changes.delete(importingSourceFile, ref);\n                        changes.insertNodeAtEndOfList(importingSourceFile, namedBindings.elements, spec);\n                    }\n                    break;\n                }\n                default:\n                    ts.Debug.failBadSyntaxKind(parent);\n            }\n        }\n        function changeNamedToDefaultImport(importingSourceFile, ref, changes) {\n            var parent = ref.parent;\n            switch (parent.kind) {\n                case 201 /* PropertyAccessExpression */:\n                    // `a.foo` --> `a.default`\n                    changes.replaceNode(importingSourceFile, ref, ts.factory.createIdentifier(\"default\"));\n                    break;\n                case 265 /* ImportSpecifier */: {\n                    // `import { foo } from \"./a\";` --> `import foo from \"./a\";`\n                    // `import { foo as bar } from \"./a\";` --> `import bar from \"./a\";`\n                    var defaultImport = ts.factory.createIdentifier(parent.name.text);\n                    if (parent.parent.elements.length === 1) {\n                        changes.replaceNode(importingSourceFile, parent.parent, defaultImport);\n                    }\n                    else {\n                        changes.delete(importingSourceFile, parent);\n                        changes.insertNodeBefore(importingSourceFile, parent.parent, defaultImport);\n                    }\n                    break;\n                }\n                case 270 /* ExportSpecifier */: {\n                    // `export { foo } from \"./a\";` --> `export { default as foo } from \"./a\";`\n                    // `export { foo as bar } from \"./a\";` --> `export { default as bar } from \"./a\";`\n                    // `export { foo as default } from \"./a\";` --> `export { default } from \"./a\";`\n                    // (Because `export foo from \"./a\";` isn't valid syntax.)\n                    changes.replaceNode(importingSourceFile, parent, makeExportSpecifier(\"default\", parent.name.text));\n                    break;\n                }\n                default:\n                    ts.Debug.assertNever(parent, \"Unexpected parent kind \" + parent.kind);\n            }\n        }\n        function makeImportSpecifier(propertyName, name) {\n            return ts.factory.createImportSpecifier(propertyName === name ? undefined : ts.factory.createIdentifier(propertyName), ts.factory.createIdentifier(name));\n        }\n        function makeExportSpecifier(propertyName, name) {\n            return ts.factory.createExportSpecifier(propertyName === name ? undefined : ts.factory.createIdentifier(propertyName), ts.factory.createIdentifier(name));\n        }\n    })(refactor = ts.refactor || (ts.refactor = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var refactor;\n    (function (refactor) {\n        var refactorName = \"Convert import\";\n        var namespaceToNamedAction = {\n            name: \"Convert namespace import to named imports\",\n            description: ts.Diagnostics.Convert_namespace_import_to_named_imports.message,\n            kind: \"refactor.rewrite.import.named\",\n        };\n        var namedToNamespaceAction = {\n            name: \"Convert named imports to namespace import\",\n            description: ts.Diagnostics.Convert_named_imports_to_namespace_import.message,\n            kind: \"refactor.rewrite.import.namespace\",\n        };\n        refactor.registerRefactor(refactorName, {\n            kinds: [\n                namespaceToNamedAction.kind,\n                namedToNamespaceAction.kind\n            ],\n            getAvailableActions: function (context) {\n                var info = getImportToConvert(context, context.triggerReason === \"invoked\");\n                if (!info)\n                    return ts.emptyArray;\n                if (!refactor.isRefactorErrorInfo(info)) {\n                    var namespaceImport = info.kind === 263 /* NamespaceImport */;\n                    var action = namespaceImport ? namespaceToNamedAction : namedToNamespaceAction;\n                    return [{ name: refactorName, description: action.description, actions: [action] }];\n                }\n                if (context.preferences.provideRefactorNotApplicableReason) {\n                    return [\n                        { name: refactorName, description: namespaceToNamedAction.description, actions: [__assign(__assign({}, namespaceToNamedAction), { notApplicableReason: info.error })] },\n                        { name: refactorName, description: namedToNamespaceAction.description, actions: [__assign(__assign({}, namedToNamespaceAction), { notApplicableReason: info.error })] }\n                    ];\n                }\n                return ts.emptyArray;\n            },\n            getEditsForAction: function (context, actionName) {\n                ts.Debug.assert(actionName === namespaceToNamedAction.name || actionName === namedToNamespaceAction.name, \"Unexpected action name\");\n                var info = getImportToConvert(context);\n                ts.Debug.assert(info && !refactor.isRefactorErrorInfo(info), \"Expected applicable refactor info\");\n                var edits = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(context.file, context.program, t, info); });\n                return { edits: edits, renameFilename: undefined, renameLocation: undefined };\n            }\n        });\n        // Can convert imports of the form `import * as m from \"m\";` or `import d, { x, y } from \"m\";`.\n        function getImportToConvert(context, considerPartialSpans) {\n            if (considerPartialSpans === void 0) { considerPartialSpans = true; }\n            var file = context.file;\n            var span = ts.getRefactorContextSpan(context);\n            var token = ts.getTokenAtPosition(file, span.start);\n            var importDecl = considerPartialSpans ? ts.findAncestor(token, ts.isImportDeclaration) : ts.getParentNodeInSpan(token, file, span);\n            if (!importDecl || !ts.isImportDeclaration(importDecl))\n                return { error: \"Selection is not an import declaration.\" };\n            if (importDecl.getEnd() < span.start + span.length)\n                return undefined;\n            var importClause = importDecl.importClause;\n            if (!importClause) {\n                return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_find_import_clause) };\n            }\n            if (!importClause.namedBindings) {\n                return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_find_namespace_import_or_named_imports) };\n            }\n            return importClause.namedBindings;\n        }\n        function doChange(sourceFile, program, changes, toConvert) {\n            var checker = program.getTypeChecker();\n            if (toConvert.kind === 263 /* NamespaceImport */) {\n                doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, ts.getAllowSyntheticDefaultImports(program.getCompilerOptions()));\n            }\n            else {\n                doChangeNamedToNamespace(sourceFile, checker, changes, toConvert);\n            }\n        }\n        function doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, allowSyntheticDefaultImports) {\n            var usedAsNamespaceOrDefault = false;\n            var nodesToReplace = [];\n            var conflictingNames = new ts.Map();\n            ts.FindAllReferences.Core.eachSymbolReferenceInFile(toConvert.name, checker, sourceFile, function (id) {\n                if (!ts.isPropertyAccessOrQualifiedName(id.parent)) {\n                    usedAsNamespaceOrDefault = true;\n                }\n                else {\n                    var exportName = getRightOfPropertyAccessOrQualifiedName(id.parent).text;\n                    if (checker.resolveName(exportName, id, 67108863 /* All */, /*excludeGlobals*/ true)) {\n                        conflictingNames.set(exportName, true);\n                    }\n                    ts.Debug.assert(getLeftOfPropertyAccessOrQualifiedName(id.parent) === id, \"Parent expression should match id\");\n                    nodesToReplace.push(id.parent);\n                }\n            });\n            // We may need to change `mod.x` to `_x` to avoid a name conflict.\n            var exportNameToImportName = new ts.Map();\n            for (var _i = 0, nodesToReplace_1 = nodesToReplace; _i < nodesToReplace_1.length; _i++) {\n                var propertyAccessOrQualifiedName = nodesToReplace_1[_i];\n                var exportName = getRightOfPropertyAccessOrQualifiedName(propertyAccessOrQualifiedName).text;\n                var importName = exportNameToImportName.get(exportName);\n                if (importName === undefined) {\n                    exportNameToImportName.set(exportName, importName = conflictingNames.has(exportName) ? ts.getUniqueName(exportName, sourceFile) : exportName);\n                }\n                changes.replaceNode(sourceFile, propertyAccessOrQualifiedName, ts.factory.createIdentifier(importName));\n            }\n            var importSpecifiers = [];\n            exportNameToImportName.forEach(function (name, propertyName) {\n                importSpecifiers.push(ts.factory.createImportSpecifier(name === propertyName ? undefined : ts.factory.createIdentifier(propertyName), ts.factory.createIdentifier(name)));\n            });\n            var importDecl = toConvert.parent.parent;\n            if (usedAsNamespaceOrDefault && !allowSyntheticDefaultImports) {\n                // Need to leave the namespace import alone\n                changes.insertNodeAfter(sourceFile, importDecl, updateImport(importDecl, /*defaultImportName*/ undefined, importSpecifiers));\n            }\n            else {\n                changes.replaceNode(sourceFile, importDecl, updateImport(importDecl, usedAsNamespaceOrDefault ? ts.factory.createIdentifier(toConvert.name.text) : undefined, importSpecifiers));\n            }\n        }\n        function getRightOfPropertyAccessOrQualifiedName(propertyAccessOrQualifiedName) {\n            return ts.isPropertyAccessExpression(propertyAccessOrQualifiedName) ? propertyAccessOrQualifiedName.name : propertyAccessOrQualifiedName.right;\n        }\n        function getLeftOfPropertyAccessOrQualifiedName(propertyAccessOrQualifiedName) {\n            return ts.isPropertyAccessExpression(propertyAccessOrQualifiedName) ? propertyAccessOrQualifiedName.expression : propertyAccessOrQualifiedName.left;\n        }\n        function doChangeNamedToNamespace(sourceFile, checker, changes, toConvert) {\n            var importDecl = toConvert.parent.parent;\n            var moduleSpecifier = importDecl.moduleSpecifier;\n            var preferredName = moduleSpecifier && ts.isStringLiteral(moduleSpecifier) ? ts.codefix.moduleSpecifierToValidIdentifier(moduleSpecifier.text, 99 /* ESNext */) : \"module\";\n            var namespaceNameConflicts = toConvert.elements.some(function (element) {\n                return ts.FindAllReferences.Core.eachSymbolReferenceInFile(element.name, checker, sourceFile, function (id) {\n                    return !!checker.resolveName(preferredName, id, 67108863 /* All */, /*excludeGlobals*/ true);\n                }) || false;\n            });\n            var namespaceImportName = namespaceNameConflicts ? ts.getUniqueName(preferredName, sourceFile) : preferredName;\n            var neededNamedImports = [];\n            var _loop_15 = function (element) {\n                var propertyName = (element.propertyName || element.name).text;\n                ts.FindAllReferences.Core.eachSymbolReferenceInFile(element.name, checker, sourceFile, function (id) {\n                    var access = ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(namespaceImportName), propertyName);\n                    if (ts.isShorthandPropertyAssignment(id.parent)) {\n                        changes.replaceNode(sourceFile, id.parent, ts.factory.createPropertyAssignment(id.text, access));\n                    }\n                    else if (ts.isExportSpecifier(id.parent) && !id.parent.propertyName) {\n                        if (!neededNamedImports.some(function (n) { return n.name === element.name; })) {\n                            neededNamedImports.push(ts.factory.createImportSpecifier(element.propertyName && ts.factory.createIdentifier(element.propertyName.text), ts.factory.createIdentifier(element.name.text)));\n                        }\n                    }\n                    else {\n                        changes.replaceNode(sourceFile, id, access);\n                    }\n                });\n            };\n            for (var _i = 0, _a = toConvert.elements; _i < _a.length; _i++) {\n                var element = _a[_i];\n                _loop_15(element);\n            }\n            changes.replaceNode(sourceFile, toConvert, ts.factory.createNamespaceImport(ts.factory.createIdentifier(namespaceImportName)));\n            if (neededNamedImports.length) {\n                changes.insertNodeAfter(sourceFile, toConvert.parent.parent, updateImport(importDecl, /*defaultImportName*/ undefined, neededNamedImports));\n            }\n        }\n        function updateImport(old, defaultImportName, elements) {\n            return ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, defaultImportName, elements && elements.length ? ts.factory.createNamedImports(elements) : undefined), old.moduleSpecifier);\n        }\n    })(refactor = ts.refactor || (ts.refactor = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var refactor;\n    (function (refactor) {\n        var convertToOptionalChainExpression;\n        (function (convertToOptionalChainExpression) {\n            var refactorName = \"Convert to optional chain expression\";\n            var convertToOptionalChainExpressionMessage = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_optional_chain_expression);\n            var toOptionalChainAction = {\n                name: refactorName,\n                description: convertToOptionalChainExpressionMessage,\n                kind: \"refactor.rewrite.expression.optionalChain\",\n            };\n            refactor.registerRefactor(refactorName, {\n                kinds: [toOptionalChainAction.kind],\n                getAvailableActions: getAvailableActions,\n                getEditsForAction: getEditsForAction\n            });\n            function getAvailableActions(context) {\n                var info = getInfo(context, context.triggerReason === \"invoked\");\n                if (!info)\n                    return ts.emptyArray;\n                if (!refactor.isRefactorErrorInfo(info)) {\n                    return [{\n                            name: refactorName,\n                            description: convertToOptionalChainExpressionMessage,\n                            actions: [toOptionalChainAction],\n                        }];\n                }\n                if (context.preferences.provideRefactorNotApplicableReason) {\n                    return [{\n                            name: refactorName,\n                            description: convertToOptionalChainExpressionMessage,\n                            actions: [__assign(__assign({}, toOptionalChainAction), { notApplicableReason: info.error })],\n                        }];\n                }\n                return ts.emptyArray;\n            }\n            function getEditsForAction(context, actionName) {\n                var info = getInfo(context);\n                ts.Debug.assert(info && !refactor.isRefactorErrorInfo(info), \"Expected applicable refactor info\");\n                var edits = ts.textChanges.ChangeTracker.with(context, function (t) {\n                    return doChange(context.file, context.program.getTypeChecker(), t, info, actionName);\n                });\n                return { edits: edits, renameFilename: undefined, renameLocation: undefined };\n            }\n            ;\n            function isValidExpression(node) {\n                return ts.isBinaryExpression(node) || ts.isConditionalExpression(node);\n            }\n            function isValidStatement(node) {\n                return ts.isExpressionStatement(node) || ts.isReturnStatement(node) || ts.isVariableStatement(node);\n            }\n            function isValidExpressionOrStatement(node) {\n                return isValidExpression(node) || isValidStatement(node);\n            }\n            function getInfo(context, considerEmptySpans) {\n                if (considerEmptySpans === void 0) { considerEmptySpans = true; }\n                var file = context.file, program = context.program;\n                var span = ts.getRefactorContextSpan(context);\n                var forEmptySpan = span.length === 0;\n                if (forEmptySpan && !considerEmptySpans)\n                    return undefined;\n                // selecting fo[|o && foo.ba|]r should be valid, so adjust span to fit start and end tokens\n                var startToken = ts.getTokenAtPosition(file, span.start);\n                var endToken = ts.findTokenOnLeftOfPosition(file, span.start + span.length);\n                var adjustedSpan = ts.createTextSpanFromBounds(startToken.pos, endToken && endToken.end >= startToken.pos ? endToken.getEnd() : startToken.getEnd());\n                var parent = forEmptySpan ? getValidParentNodeOfEmptySpan(startToken) : getValidParentNodeContainingSpan(startToken, adjustedSpan);\n                var expression = parent && isValidExpressionOrStatement(parent) ? getExpression(parent) : undefined;\n                if (!expression)\n                    return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_find_convertible_access_expression) };\n                var checker = program.getTypeChecker();\n                return ts.isConditionalExpression(expression) ? getConditionalInfo(expression, checker) : getBinaryInfo(expression);\n            }\n            function getConditionalInfo(expression, checker) {\n                var condition = expression.condition;\n                var finalExpression = getFinalExpressionInChain(expression.whenTrue);\n                if (!finalExpression || checker.isNullableType(checker.getTypeAtLocation(finalExpression))) {\n                    return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_find_convertible_access_expression) };\n                }\n                if ((ts.isPropertyAccessExpression(condition) || ts.isIdentifier(condition))\n                    && getMatchingStart(condition, finalExpression.expression)) {\n                    return { finalExpression: finalExpression, occurrences: [condition], expression: expression };\n                }\n                else if (ts.isBinaryExpression(condition)) {\n                    var occurrences = getOccurrencesInExpression(finalExpression.expression, condition);\n                    return occurrences ? { finalExpression: finalExpression, occurrences: occurrences, expression: expression } :\n                        { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_find_matching_access_expressions) };\n                }\n            }\n            function getBinaryInfo(expression) {\n                if (expression.operatorToken.kind !== 55 /* AmpersandAmpersandToken */) {\n                    return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Can_only_convert_logical_AND_access_chains) };\n                }\n                ;\n                var finalExpression = getFinalExpressionInChain(expression.right);\n                if (!finalExpression)\n                    return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_find_convertible_access_expression) };\n                var occurrences = getOccurrencesInExpression(finalExpression.expression, expression.left);\n                return occurrences ? { finalExpression: finalExpression, occurrences: occurrences, expression: expression } :\n                    { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_find_matching_access_expressions) };\n            }\n            /**\n             * Gets a list of property accesses that appear in matchTo and occur in sequence in expression.\n             */\n            function getOccurrencesInExpression(matchTo, expression) {\n                var occurrences = [];\n                while (ts.isBinaryExpression(expression) && expression.operatorToken.kind === 55 /* AmpersandAmpersandToken */) {\n                    var match = getMatchingStart(ts.skipParentheses(matchTo), ts.skipParentheses(expression.right));\n                    if (!match) {\n                        break;\n                    }\n                    occurrences.push(match);\n                    matchTo = match;\n                    expression = expression.left;\n                }\n                var finalMatch = getMatchingStart(matchTo, expression);\n                if (finalMatch) {\n                    occurrences.push(finalMatch);\n                }\n                return occurrences.length > 0 ? occurrences : undefined;\n            }\n            /**\n             * Returns subchain if chain begins with subchain syntactically.\n             */\n            function getMatchingStart(chain, subchain) {\n                if (!ts.isIdentifier(subchain) && !ts.isPropertyAccessExpression(subchain) && !ts.isElementAccessExpression(subchain)) {\n                    return undefined;\n                }\n                return chainStartsWith(chain, subchain) ? subchain : undefined;\n            }\n            /**\n             * Returns true if chain begins with subchain syntactically.\n             */\n            function chainStartsWith(chain, subchain) {\n                // skip until we find a matching identifier.\n                while (ts.isCallExpression(chain) || ts.isPropertyAccessExpression(chain) || ts.isElementAccessExpression(chain)) {\n                    if (getTextOfChainNode(chain) === getTextOfChainNode(subchain))\n                        break;\n                    chain = chain.expression;\n                }\n                // check that the chains match at each access. Call chains in subchain are not valid.\n                while ((ts.isPropertyAccessExpression(chain) && ts.isPropertyAccessExpression(subchain)) ||\n                    (ts.isElementAccessExpression(chain) && ts.isElementAccessExpression(subchain))) {\n                    if (getTextOfChainNode(chain) !== getTextOfChainNode(subchain))\n                        return false;\n                    chain = chain.expression;\n                    subchain = subchain.expression;\n                }\n                // check if we have reached a final identifier.\n                return ts.isIdentifier(chain) && ts.isIdentifier(subchain) && chain.getText() === subchain.getText();\n            }\n            function getTextOfChainNode(node) {\n                if (ts.isIdentifier(node) || ts.isStringOrNumericLiteralLike(node)) {\n                    return node.getText();\n                }\n                if (ts.isPropertyAccessExpression(node)) {\n                    return getTextOfChainNode(node.name);\n                }\n                if (ts.isElementAccessExpression(node)) {\n                    return getTextOfChainNode(node.argumentExpression);\n                }\n                return undefined;\n            }\n            /**\n             * Find the least ancestor of the input node that is a valid type for extraction and contains the input span.\n             */\n            function getValidParentNodeContainingSpan(node, span) {\n                while (node.parent) {\n                    if (isValidExpressionOrStatement(node) && span.length !== 0 && node.end >= span.start + span.length) {\n                        return node;\n                    }\n                    node = node.parent;\n                }\n                return undefined;\n            }\n            /**\n             * Finds an ancestor of the input node that is a valid type for extraction, skipping subexpressions.\n             */\n            function getValidParentNodeOfEmptySpan(node) {\n                while (node.parent) {\n                    if (isValidExpressionOrStatement(node) && !isValidExpressionOrStatement(node.parent)) {\n                        return node;\n                    }\n                    node = node.parent;\n                }\n                return undefined;\n            }\n            /**\n             * Gets an expression of valid extraction type from a valid statement or expression.\n             */\n            function getExpression(node) {\n                if (isValidExpression(node)) {\n                    return node;\n                }\n                if (ts.isVariableStatement(node)) {\n                    var variable = ts.getSingleVariableOfVariableStatement(node);\n                    var initializer = variable === null || variable === void 0 ? void 0 : variable.initializer;\n                    return initializer && isValidExpression(initializer) ? initializer : undefined;\n                }\n                return node.expression && isValidExpression(node.expression) ? node.expression : undefined;\n            }\n            /**\n             * Gets a property access expression which may be nested inside of a binary expression. The final\n             * expression in an && chain will occur as the right child of the parent binary expression, unless\n             * it is followed by a different binary operator.\n             * @param node the right child of a binary expression or a call expression.\n             */\n            function getFinalExpressionInChain(node) {\n                // foo && |foo.bar === 1|; - here the right child of the && binary expression is another binary expression.\n                // the rightmost member of the && chain should be the leftmost child of that expression.\n                node = ts.skipParentheses(node);\n                if (ts.isBinaryExpression(node)) {\n                    return getFinalExpressionInChain(node.left);\n                }\n                // foo && |foo.bar()()| - nested calls are treated like further accesses.\n                else if ((ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) || ts.isCallExpression(node)) && !ts.isOptionalChain(node)) {\n                    return node;\n                }\n                return undefined;\n            }\n            /**\n             * Creates an access chain from toConvert with '?.' accesses at expressions appearing in occurrences.\n             */\n            function convertOccurrences(checker, toConvert, occurrences) {\n                if (ts.isPropertyAccessExpression(toConvert) || ts.isElementAccessExpression(toConvert) || ts.isCallExpression(toConvert)) {\n                    var chain = convertOccurrences(checker, toConvert.expression, occurrences);\n                    var lastOccurrence = occurrences.length > 0 ? occurrences[occurrences.length - 1] : undefined;\n                    var isOccurrence = (lastOccurrence === null || lastOccurrence === void 0 ? void 0 : lastOccurrence.getText()) === toConvert.expression.getText();\n                    if (isOccurrence)\n                        occurrences.pop();\n                    if (ts.isCallExpression(toConvert)) {\n                        return isOccurrence ?\n                            ts.factory.createCallChain(chain, ts.factory.createToken(28 /* QuestionDotToken */), toConvert.typeArguments, toConvert.arguments) :\n                            ts.factory.createCallChain(chain, toConvert.questionDotToken, toConvert.typeArguments, toConvert.arguments);\n                    }\n                    else if (ts.isPropertyAccessExpression(toConvert)) {\n                        return isOccurrence ?\n                            ts.factory.createPropertyAccessChain(chain, ts.factory.createToken(28 /* QuestionDotToken */), toConvert.name) :\n                            ts.factory.createPropertyAccessChain(chain, toConvert.questionDotToken, toConvert.name);\n                    }\n                    else if (ts.isElementAccessExpression(toConvert)) {\n                        return isOccurrence ?\n                            ts.factory.createElementAccessChain(chain, ts.factory.createToken(28 /* QuestionDotToken */), toConvert.argumentExpression) :\n                            ts.factory.createElementAccessChain(chain, toConvert.questionDotToken, toConvert.argumentExpression);\n                    }\n                }\n                return toConvert;\n            }\n            function doChange(sourceFile, checker, changes, info, _actionName) {\n                var finalExpression = info.finalExpression, occurrences = info.occurrences, expression = info.expression;\n                var firstOccurrence = occurrences[occurrences.length - 1];\n                var convertedChain = convertOccurrences(checker, finalExpression, occurrences);\n                if (convertedChain && (ts.isPropertyAccessExpression(convertedChain) || ts.isElementAccessExpression(convertedChain) || ts.isCallExpression(convertedChain))) {\n                    if (ts.isBinaryExpression(expression)) {\n                        changes.replaceNodeRange(sourceFile, firstOccurrence, finalExpression, convertedChain);\n                    }\n                    else if (ts.isConditionalExpression(expression)) {\n                        changes.replaceNode(sourceFile, expression, ts.factory.createBinaryExpression(convertedChain, ts.factory.createToken(60 /* QuestionQuestionToken */), expression.whenFalse));\n                    }\n                }\n            }\n        })(convertToOptionalChainExpression = refactor.convertToOptionalChainExpression || (refactor.convertToOptionalChainExpression = {}));\n    })(refactor = ts.refactor || (ts.refactor = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var refactor;\n    (function (refactor) {\n        var addOrRemoveBracesToArrowFunction;\n        (function (addOrRemoveBracesToArrowFunction) {\n            var refactorName = \"Convert overload list to single signature\";\n            var refactorDescription = ts.Diagnostics.Convert_overload_list_to_single_signature.message;\n            var functionOverloadAction = {\n                name: refactorName,\n                description: refactorDescription,\n                kind: \"refactor.rewrite.function.overloadList\",\n            };\n            refactor.registerRefactor(refactorName, {\n                kinds: [functionOverloadAction.kind],\n                getEditsForAction: getEditsForAction,\n                getAvailableActions: getAvailableActions\n            });\n            function getAvailableActions(context) {\n                var file = context.file, startPosition = context.startPosition, program = context.program;\n                var info = getConvertableOverloadListAtPosition(file, startPosition, program);\n                if (!info)\n                    return ts.emptyArray;\n                return [{\n                        name: refactorName,\n                        description: refactorDescription,\n                        actions: [functionOverloadAction]\n                    }];\n            }\n            function getEditsForAction(context) {\n                var file = context.file, startPosition = context.startPosition, program = context.program;\n                var signatureDecls = getConvertableOverloadListAtPosition(file, startPosition, program);\n                if (!signatureDecls)\n                    return undefined;\n                var checker = program.getTypeChecker();\n                var lastDeclaration = signatureDecls[signatureDecls.length - 1];\n                var updated = lastDeclaration;\n                switch (lastDeclaration.kind) {\n                    case 164 /* MethodSignature */: {\n                        updated = ts.factory.updateMethodSignature(lastDeclaration, lastDeclaration.modifiers, lastDeclaration.name, lastDeclaration.questionToken, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type);\n                        break;\n                    }\n                    case 165 /* MethodDeclaration */: {\n                        updated = ts.factory.updateMethodDeclaration(lastDeclaration, lastDeclaration.decorators, lastDeclaration.modifiers, lastDeclaration.asteriskToken, lastDeclaration.name, lastDeclaration.questionToken, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type, lastDeclaration.body);\n                        break;\n                    }\n                    case 169 /* CallSignature */: {\n                        updated = ts.factory.updateCallSignature(lastDeclaration, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type);\n                        break;\n                    }\n                    case 166 /* Constructor */: {\n                        updated = ts.factory.updateConstructorDeclaration(lastDeclaration, lastDeclaration.decorators, lastDeclaration.modifiers, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.body);\n                        break;\n                    }\n                    case 170 /* ConstructSignature */: {\n                        updated = ts.factory.updateConstructSignature(lastDeclaration, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type);\n                        break;\n                    }\n                    case 251 /* FunctionDeclaration */: {\n                        updated = ts.factory.updateFunctionDeclaration(lastDeclaration, lastDeclaration.decorators, lastDeclaration.modifiers, lastDeclaration.asteriskToken, lastDeclaration.name, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type, lastDeclaration.body);\n                        break;\n                    }\n                    default: return ts.Debug.failBadSyntaxKind(lastDeclaration, \"Unhandled signature kind in overload list conversion refactoring\");\n                }\n                if (updated === lastDeclaration) {\n                    return; // No edits to apply, do nothing\n                }\n                var edits = ts.textChanges.ChangeTracker.with(context, function (t) {\n                    t.replaceNodeRange(file, signatureDecls[0], signatureDecls[signatureDecls.length - 1], updated);\n                });\n                return { renameFilename: undefined, renameLocation: undefined, edits: edits };\n                function getNewParametersForCombinedSignature(signatureDeclarations) {\n                    var lastSig = signatureDeclarations[signatureDeclarations.length - 1];\n                    if (ts.isFunctionLikeDeclaration(lastSig) && lastSig.body) {\n                        // Trim away implementation signature arguments (they should already be compatible with overloads, but are likely less precise to guarantee compatability with the overloads)\n                        signatureDeclarations = signatureDeclarations.slice(0, signatureDeclarations.length - 1);\n                    }\n                    return ts.factory.createNodeArray([\n                        ts.factory.createParameterDeclaration(\n                        /*decorators*/ undefined, \n                        /*modifiers*/ undefined, ts.factory.createToken(25 /* DotDotDotToken */), \"args\", \n                        /*questionToken*/ undefined, ts.factory.createUnionTypeNode(ts.map(signatureDeclarations, convertSignatureParametersToTuple)))\n                    ]);\n                }\n                function convertSignatureParametersToTuple(decl) {\n                    var members = ts.map(decl.parameters, convertParameterToNamedTupleMember);\n                    return ts.setEmitFlags(ts.factory.createTupleTypeNode(members), ts.some(members, function (m) { return !!ts.length(ts.getSyntheticLeadingComments(m)); }) ? 0 /* None */ : 1 /* SingleLine */);\n                }\n                function convertParameterToNamedTupleMember(p) {\n                    ts.Debug.assert(ts.isIdentifier(p.name)); // This is checked during refactoring applicability checking\n                    var result = ts.setTextRange(ts.factory.createNamedTupleMember(p.dotDotDotToken, p.name, p.questionToken, p.type || ts.factory.createKeywordTypeNode(128 /* AnyKeyword */)), p);\n                    var parameterDocComment = p.symbol && p.symbol.getDocumentationComment(checker);\n                    if (parameterDocComment) {\n                        var newComment = ts.displayPartsToString(parameterDocComment);\n                        if (newComment.length) {\n                            ts.setSyntheticLeadingComments(result, [{\n                                    text: \"*\\n\" + newComment.split(\"\\n\").map(function (c) { return \" * \" + c; }).join(\"\\n\") + \"\\n \",\n                                    kind: 3 /* MultiLineCommentTrivia */,\n                                    pos: -1,\n                                    end: -1,\n                                    hasTrailingNewLine: true,\n                                    hasLeadingNewline: true,\n                                }]);\n                        }\n                    }\n                    return result;\n                }\n            }\n            function isConvertableSignatureDeclaration(d) {\n                switch (d.kind) {\n                    case 164 /* MethodSignature */:\n                    case 165 /* MethodDeclaration */:\n                    case 169 /* CallSignature */:\n                    case 166 /* Constructor */:\n                    case 170 /* ConstructSignature */:\n                    case 251 /* FunctionDeclaration */:\n                        return true;\n                }\n                return false;\n            }\n            function getConvertableOverloadListAtPosition(file, startPosition, program) {\n                var node = ts.getTokenAtPosition(file, startPosition);\n                var containingDecl = ts.findAncestor(node, isConvertableSignatureDeclaration);\n                if (!containingDecl) {\n                    return;\n                }\n                var checker = program.getTypeChecker();\n                var signatureSymbol = containingDecl.symbol;\n                if (!signatureSymbol) {\n                    return;\n                }\n                var decls = signatureSymbol.declarations;\n                if (ts.length(decls) <= 1) {\n                    return;\n                }\n                if (!ts.every(decls, function (d) { return ts.getSourceFileOfNode(d) === file; })) {\n                    return;\n                }\n                if (!isConvertableSignatureDeclaration(decls[0])) {\n                    return;\n                }\n                var kindOne = decls[0].kind;\n                if (!ts.every(decls, function (d) { return d.kind === kindOne; })) {\n                    return;\n                }\n                var signatureDecls = decls;\n                if (ts.some(signatureDecls, function (d) { return !!d.typeParameters || ts.some(d.parameters, function (p) { return !!p.decorators || !!p.modifiers || !ts.isIdentifier(p.name); }); })) {\n                    return;\n                }\n                var signatures = ts.mapDefined(signatureDecls, function (d) { return checker.getSignatureFromDeclaration(d); });\n                if (ts.length(signatures) !== ts.length(decls)) {\n                    return;\n                }\n                var returnOne = checker.getReturnTypeOfSignature(signatures[0]);\n                if (!ts.every(signatures, function (s) { return checker.getReturnTypeOfSignature(s) === returnOne; })) {\n                    return;\n                }\n                return signatureDecls;\n            }\n        })(addOrRemoveBracesToArrowFunction = refactor.addOrRemoveBracesToArrowFunction || (refactor.addOrRemoveBracesToArrowFunction = {}));\n    })(refactor = ts.refactor || (ts.refactor = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var refactor;\n    (function (refactor) {\n        var extractSymbol;\n        (function (extractSymbol) {\n            var refactorName = \"Extract Symbol\";\n            var extractConstantAction = {\n                name: \"Extract Constant\",\n                description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_constant),\n                kind: \"refactor.extract.constant\",\n            };\n            var extractFunctionAction = {\n                name: \"Extract Function\",\n                description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_function),\n                kind: \"refactor.extract.function\",\n            };\n            refactor.registerRefactor(refactorName, {\n                kinds: [\n                    extractConstantAction.kind,\n                    extractFunctionAction.kind\n                ],\n                getAvailableActions: getAvailableActions,\n                getEditsForAction: getEditsForAction\n            });\n            /**\n             * Compute the associated code actions\n             * Exported for tests.\n             */\n            function getAvailableActions(context) {\n                var requestedRefactor = context.kind;\n                var rangeToExtract = getRangeToExtract(context.file, ts.getRefactorContextSpan(context), context.triggerReason === \"invoked\");\n                var targetRange = rangeToExtract.targetRange;\n                if (targetRange === undefined) {\n                    if (!rangeToExtract.errors || rangeToExtract.errors.length === 0 || !context.preferences.provideRefactorNotApplicableReason) {\n                        return ts.emptyArray;\n                    }\n                    var errors = [];\n                    if (refactor.refactorKindBeginsWith(extractFunctionAction.kind, requestedRefactor)) {\n                        errors.push({\n                            name: refactorName,\n                            description: extractFunctionAction.description,\n                            actions: [__assign(__assign({}, extractFunctionAction), { notApplicableReason: getStringError(rangeToExtract.errors) })]\n                        });\n                    }\n                    if (refactor.refactorKindBeginsWith(extractConstantAction.kind, requestedRefactor)) {\n                        errors.push({\n                            name: refactorName,\n                            description: extractConstantAction.description,\n                            actions: [__assign(__assign({}, extractConstantAction), { notApplicableReason: getStringError(rangeToExtract.errors) })]\n                        });\n                    }\n                    return errors;\n                }\n                var extractions = getPossibleExtractions(targetRange, context);\n                if (extractions === undefined) {\n                    // No extractions possible\n                    return ts.emptyArray;\n                }\n                var functionActions = [];\n                var usedFunctionNames = new ts.Map();\n                var innermostErrorFunctionAction;\n                var constantActions = [];\n                var usedConstantNames = new ts.Map();\n                var innermostErrorConstantAction;\n                var i = 0;\n                for (var _i = 0, extractions_1 = extractions; _i < extractions_1.length; _i++) {\n                    var _a = extractions_1[_i], functionExtraction = _a.functionExtraction, constantExtraction = _a.constantExtraction;\n                    var description = functionExtraction.description;\n                    if (refactor.refactorKindBeginsWith(extractFunctionAction.kind, requestedRefactor)) {\n                        if (functionExtraction.errors.length === 0) {\n                            // Don't issue refactorings with duplicated names.\n                            // Scopes come back in \"innermost first\" order, so extractions will\n                            // preferentially go into nearer scopes\n                            if (!usedFunctionNames.has(description)) {\n                                usedFunctionNames.set(description, true);\n                                functionActions.push({\n                                    description: description,\n                                    name: \"function_scope_\" + i,\n                                    kind: extractFunctionAction.kind\n                                });\n                            }\n                        }\n                        else if (!innermostErrorFunctionAction) {\n                            innermostErrorFunctionAction = {\n                                description: description,\n                                name: \"function_scope_\" + i,\n                                notApplicableReason: getStringError(functionExtraction.errors),\n                                kind: extractFunctionAction.kind\n                            };\n                        }\n                    }\n                    // Skip these since we don't have a way to report errors yet\n                    if (refactor.refactorKindBeginsWith(extractConstantAction.kind, requestedRefactor)) {\n                        if (constantExtraction.errors.length === 0) {\n                            // Don't issue refactorings with duplicated names.\n                            // Scopes come back in \"innermost first\" order, so extractions will\n                            // preferentially go into nearer scopes\n                            var description_1 = constantExtraction.description;\n                            if (!usedConstantNames.has(description_1)) {\n                                usedConstantNames.set(description_1, true);\n                                constantActions.push({\n                                    description: description_1,\n                                    name: \"constant_scope_\" + i,\n                                    kind: extractConstantAction.kind\n                                });\n                            }\n                        }\n                        else if (!innermostErrorConstantAction) {\n                            innermostErrorConstantAction = {\n                                description: description,\n                                name: \"constant_scope_\" + i,\n                                notApplicableReason: getStringError(constantExtraction.errors),\n                                kind: extractConstantAction.kind\n                            };\n                        }\n                    }\n                    // *do* increment i anyway because we'll look for the i-th scope\n                    // later when actually doing the refactoring if the user requests it\n                    i++;\n                }\n                var infos = [];\n                if (functionActions.length) {\n                    infos.push({\n                        name: refactorName,\n                        description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_function),\n                        actions: functionActions,\n                    });\n                }\n                else if (context.preferences.provideRefactorNotApplicableReason && innermostErrorFunctionAction) {\n                    infos.push({\n                        name: refactorName,\n                        description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_function),\n                        actions: [innermostErrorFunctionAction]\n                    });\n                }\n                if (constantActions.length) {\n                    infos.push({\n                        name: refactorName,\n                        description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_constant),\n                        actions: constantActions\n                    });\n                }\n                else if (context.preferences.provideRefactorNotApplicableReason && innermostErrorConstantAction) {\n                    infos.push({\n                        name: refactorName,\n                        description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_constant),\n                        actions: [innermostErrorConstantAction]\n                    });\n                }\n                return infos.length ? infos : ts.emptyArray;\n                function getStringError(errors) {\n                    var error = errors[0].messageText;\n                    if (typeof error !== \"string\") {\n                        error = error.messageText;\n                    }\n                    return error;\n                }\n            }\n            extractSymbol.getAvailableActions = getAvailableActions;\n            /* Exported for tests */\n            function getEditsForAction(context, actionName) {\n                var rangeToExtract = getRangeToExtract(context.file, ts.getRefactorContextSpan(context));\n                var targetRange = rangeToExtract.targetRange; // TODO:GH#18217\n                var parsedFunctionIndexMatch = /^function_scope_(\\d+)$/.exec(actionName);\n                if (parsedFunctionIndexMatch) {\n                    var index = +parsedFunctionIndexMatch[1];\n                    ts.Debug.assert(isFinite(index), \"Expected to parse a finite number from the function scope index\");\n                    return getFunctionExtractionAtIndex(targetRange, context, index);\n                }\n                var parsedConstantIndexMatch = /^constant_scope_(\\d+)$/.exec(actionName);\n                if (parsedConstantIndexMatch) {\n                    var index = +parsedConstantIndexMatch[1];\n                    ts.Debug.assert(isFinite(index), \"Expected to parse a finite number from the constant scope index\");\n                    return getConstantExtractionAtIndex(targetRange, context, index);\n                }\n                ts.Debug.fail(\"Unrecognized action name\");\n            }\n            extractSymbol.getEditsForAction = getEditsForAction;\n            // Move these into diagnostic messages if they become user-facing\n            var Messages;\n            (function (Messages) {\n                function createMessage(message) {\n                    return { message: message, code: 0, category: ts.DiagnosticCategory.Message, key: message };\n                }\n                Messages.cannotExtractRange = createMessage(\"Cannot extract range.\");\n                Messages.cannotExtractImport = createMessage(\"Cannot extract import statement.\");\n                Messages.cannotExtractSuper = createMessage(\"Cannot extract super call.\");\n                Messages.cannotExtractJSDoc = createMessage(\"Cannot extract JSDoc.\");\n                Messages.cannotExtractEmpty = createMessage(\"Cannot extract empty range.\");\n                Messages.expressionExpected = createMessage(\"expression expected.\");\n                Messages.uselessConstantType = createMessage(\"No reason to extract constant of type.\");\n                Messages.statementOrExpressionExpected = createMessage(\"Statement or expression expected.\");\n                Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements = createMessage(\"Cannot extract range containing conditional break or continue statements.\");\n                Messages.cannotExtractRangeContainingConditionalReturnStatement = createMessage(\"Cannot extract range containing conditional return statement.\");\n                Messages.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange = createMessage(\"Cannot extract range containing labeled break or continue with target outside of the range.\");\n                Messages.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators = createMessage(\"Cannot extract range containing writes to references located outside of the target range in generators.\");\n                Messages.typeWillNotBeVisibleInTheNewScope = createMessage(\"Type will not visible in the new scope.\");\n                Messages.functionWillNotBeVisibleInTheNewScope = createMessage(\"Function will not visible in the new scope.\");\n                Messages.cannotExtractIdentifier = createMessage(\"Select more than a single identifier.\");\n                Messages.cannotExtractExportedEntity = createMessage(\"Cannot extract exported declaration\");\n                Messages.cannotWriteInExpression = createMessage(\"Cannot write back side-effects when extracting an expression\");\n                Messages.cannotExtractReadonlyPropertyInitializerOutsideConstructor = createMessage(\"Cannot move initialization of read-only class property outside of the constructor\");\n                Messages.cannotExtractAmbientBlock = createMessage(\"Cannot extract code from ambient contexts\");\n                Messages.cannotAccessVariablesFromNestedScopes = createMessage(\"Cannot access variables from nested scopes\");\n                Messages.cannotExtractToOtherFunctionLike = createMessage(\"Cannot extract method to a function-like scope that is not a function\");\n                Messages.cannotExtractToJSClass = createMessage(\"Cannot extract constant to a class scope in JS\");\n                Messages.cannotExtractToExpressionArrowFunction = createMessage(\"Cannot extract constant to an arrow function without a block\");\n            })(Messages = extractSymbol.Messages || (extractSymbol.Messages = {}));\n            var RangeFacts;\n            (function (RangeFacts) {\n                RangeFacts[RangeFacts[\"None\"] = 0] = \"None\";\n                RangeFacts[RangeFacts[\"HasReturn\"] = 1] = \"HasReturn\";\n                RangeFacts[RangeFacts[\"IsGenerator\"] = 2] = \"IsGenerator\";\n                RangeFacts[RangeFacts[\"IsAsyncFunction\"] = 4] = \"IsAsyncFunction\";\n                RangeFacts[RangeFacts[\"UsesThis\"] = 8] = \"UsesThis\";\n                /**\n                 * The range is in a function which needs the 'static' modifier in a class\n                 */\n                RangeFacts[RangeFacts[\"InStaticRegion\"] = 16] = \"InStaticRegion\";\n            })(RangeFacts || (RangeFacts = {}));\n            /**\n             * getRangeToExtract takes a span inside a text file and returns either an expression or an array\n             * of statements representing the minimum set of nodes needed to extract the entire span. This\n             * process may fail, in which case a set of errors is returned instead (these are currently\n             * not shown to the user, but can be used by us diagnostically)\n             */\n            // exported only for tests\n            function getRangeToExtract(sourceFile, span, considerEmptySpans) {\n                if (considerEmptySpans === void 0) { considerEmptySpans = true; }\n                var length = span.length;\n                if (length === 0 && !considerEmptySpans) {\n                    return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractEmpty)] };\n                }\n                var cursorRequest = length === 0 && considerEmptySpans;\n                // Walk up starting from the the start position until we find a non-SourceFile node that subsumes the selected span.\n                // This may fail (e.g. you select two statements in the root of a source file)\n                var startToken = ts.getTokenAtPosition(sourceFile, span.start);\n                var start = cursorRequest ? getExtractableParent(startToken) : ts.getParentNodeInSpan(startToken, sourceFile, span);\n                // Do the same for the ending position\n                var endToken = ts.findTokenOnLeftOfPosition(sourceFile, ts.textSpanEnd(span));\n                var end = cursorRequest ? start : ts.getParentNodeInSpan(endToken, sourceFile, span);\n                var declarations = [];\n                // We'll modify these flags as we walk the tree to collect data\n                // about what things need to be done as part of the extraction.\n                var rangeFacts = RangeFacts.None;\n                if (!start || !end) {\n                    // cannot find either start or end node\n                    return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractRange)] };\n                }\n                if (start.parent !== end.parent) {\n                    // start and end nodes belong to different subtrees\n                    return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractRange)] };\n                }\n                if (start !== end) {\n                    // start and end should be statements and parent should be either block or a source file\n                    if (!isBlockLike(start.parent)) {\n                        return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractRange)] };\n                    }\n                    var statements = [];\n                    var start2 = start; // TODO: GH#18217 Need to alias `start` to get this to compile. See https://github.com/Microsoft/TypeScript/issues/19955#issuecomment-344118248\n                    for (var _i = 0, _a = start2.parent.statements; _i < _a.length; _i++) {\n                        var statement = _a[_i];\n                        if (statement === start || statements.length) {\n                            var errors_1 = checkNode(statement);\n                            if (errors_1) {\n                                return { errors: errors_1 };\n                            }\n                            statements.push(statement);\n                        }\n                        if (statement === end) {\n                            break;\n                        }\n                    }\n                    if (!statements.length) {\n                        // https://github.com/Microsoft/TypeScript/issues/20559\n                        // Ranges like [|case 1: break;|] will fail to populate `statements` because\n                        // they will never find `start` in `start.parent.statements`.\n                        // Consider: We could support ranges like [|case 1:|] by refining them to just\n                        // the expression.\n                        return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractRange)] };\n                    }\n                    return { targetRange: { range: statements, facts: rangeFacts, declarations: declarations } };\n                }\n                if (ts.isJSDoc(start)) {\n                    return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractJSDoc)] };\n                }\n                if (ts.isReturnStatement(start) && !start.expression) {\n                    // Makes no sense to extract an expression-less return statement.\n                    return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractRange)] };\n                }\n                // We have a single node (start)\n                var node = refineNode(start);\n                var errors = checkRootNode(node) || checkNode(node);\n                if (errors) {\n                    return { errors: errors };\n                }\n                return { targetRange: { range: getStatementOrExpressionRange(node), facts: rangeFacts, declarations: declarations } }; // TODO: GH#18217\n                /**\n                 * Attempt to refine the extraction node (generally, by shrinking it) to produce better results.\n                 * @param node The unrefined extraction node.\n                 */\n                function refineNode(node) {\n                    if (ts.isReturnStatement(node)) {\n                        if (node.expression) {\n                            return node.expression;\n                        }\n                    }\n                    else if (ts.isVariableStatement(node)) {\n                        var numInitializers = 0;\n                        var lastInitializer = void 0;\n                        for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {\n                            var declaration = _a[_i];\n                            if (declaration.initializer) {\n                                numInitializers++;\n                                lastInitializer = declaration.initializer;\n                            }\n                        }\n                        if (numInitializers === 1) {\n                            return lastInitializer;\n                        }\n                        // No special handling if there are multiple initializers.\n                    }\n                    else if (ts.isVariableDeclaration(node)) {\n                        if (node.initializer) {\n                            return node.initializer;\n                        }\n                    }\n                    return node;\n                }\n                function checkRootNode(node) {\n                    if (ts.isIdentifier(ts.isExpressionStatement(node) ? node.expression : node)) {\n                        return [ts.createDiagnosticForNode(node, Messages.cannotExtractIdentifier)];\n                    }\n                    return undefined;\n                }\n                function checkForStaticContext(nodeToCheck, containingClass) {\n                    var current = nodeToCheck;\n                    while (current !== containingClass) {\n                        if (current.kind === 163 /* PropertyDeclaration */) {\n                            if (ts.hasSyntacticModifier(current, 32 /* Static */)) {\n                                rangeFacts |= RangeFacts.InStaticRegion;\n                            }\n                            break;\n                        }\n                        else if (current.kind === 160 /* Parameter */) {\n                            var ctorOrMethod = ts.getContainingFunction(current);\n                            if (ctorOrMethod.kind === 166 /* Constructor */) {\n                                rangeFacts |= RangeFacts.InStaticRegion;\n                            }\n                            break;\n                        }\n                        else if (current.kind === 165 /* MethodDeclaration */) {\n                            if (ts.hasSyntacticModifier(current, 32 /* Static */)) {\n                                rangeFacts |= RangeFacts.InStaticRegion;\n                            }\n                        }\n                        current = current.parent;\n                    }\n                }\n                // Verifies whether we can actually extract this node or not.\n                function checkNode(nodeToCheck) {\n                    var PermittedJumps;\n                    (function (PermittedJumps) {\n                        PermittedJumps[PermittedJumps[\"None\"] = 0] = \"None\";\n                        PermittedJumps[PermittedJumps[\"Break\"] = 1] = \"Break\";\n                        PermittedJumps[PermittedJumps[\"Continue\"] = 2] = \"Continue\";\n                        PermittedJumps[PermittedJumps[\"Return\"] = 4] = \"Return\";\n                    })(PermittedJumps || (PermittedJumps = {}));\n                    // We believe it's true because the node is from the (unmodified) tree.\n                    ts.Debug.assert(nodeToCheck.pos <= nodeToCheck.end, \"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (1)\");\n                    // For understanding how skipTrivia functioned:\n                    ts.Debug.assert(!ts.positionIsSynthesized(nodeToCheck.pos), \"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (2)\");\n                    if (!ts.isStatement(nodeToCheck) && !(ts.isExpressionNode(nodeToCheck) && isExtractableExpression(nodeToCheck))) {\n                        return [ts.createDiagnosticForNode(nodeToCheck, Messages.statementOrExpressionExpected)];\n                    }\n                    if (nodeToCheck.flags & 8388608 /* Ambient */) {\n                        return [ts.createDiagnosticForNode(nodeToCheck, Messages.cannotExtractAmbientBlock)];\n                    }\n                    // If we're in a class, see whether we're in a static region (static property initializer, static method, class constructor parameter default)\n                    var containingClass = ts.getContainingClass(nodeToCheck);\n                    if (containingClass) {\n                        checkForStaticContext(nodeToCheck, containingClass);\n                    }\n                    var errors;\n                    var permittedJumps = 4 /* Return */;\n                    var seenLabels;\n                    visit(nodeToCheck);\n                    return errors;\n                    function visit(node) {\n                        if (errors) {\n                            // already found an error - can stop now\n                            return true;\n                        }\n                        if (ts.isDeclaration(node)) {\n                            var declaringNode = (node.kind === 249 /* VariableDeclaration */) ? node.parent.parent : node;\n                            if (ts.hasSyntacticModifier(declaringNode, 1 /* Export */)) {\n                                // TODO: GH#18217 Silly to use `errors ||` since it's definitely not defined (see top of `visit`)\n                                // Also, if we're only pushing one error, just use `let error: Diagnostic | undefined`!\n                                // Also TODO: GH#19956\n                                (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractExportedEntity));\n                                return true;\n                            }\n                            declarations.push(node.symbol);\n                        }\n                        // Some things can't be extracted in certain situations\n                        switch (node.kind) {\n                            case 261 /* ImportDeclaration */:\n                                (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport));\n                                return true;\n                            case 266 /* ExportAssignment */:\n                                (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractExportedEntity));\n                                return true;\n                            case 105 /* SuperKeyword */:\n                                // For a super *constructor call*, we have to be extracting the entire class,\n                                // but a super *method call* simply implies a 'this' reference\n                                if (node.parent.kind === 203 /* CallExpression */) {\n                                    // Super constructor call\n                                    var containingClass_1 = ts.getContainingClass(node); // TODO:GH#18217\n                                    if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) {\n                                        (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractSuper));\n                                        return true;\n                                    }\n                                }\n                                else {\n                                    rangeFacts |= RangeFacts.UsesThis;\n                                }\n                                break;\n                            case 209 /* ArrowFunction */:\n                                // check if arrow function uses this\n                                ts.forEachChild(node, function check(n) {\n                                    if (ts.isThis(n)) {\n                                        rangeFacts |= RangeFacts.UsesThis;\n                                    }\n                                    else if (ts.isClassLike(n) || (ts.isFunctionLike(n) && !ts.isArrowFunction(n))) {\n                                        return false;\n                                    }\n                                    else {\n                                        ts.forEachChild(n, check);\n                                    }\n                                });\n                            // falls through\n                            case 252 /* ClassDeclaration */:\n                            case 251 /* FunctionDeclaration */:\n                                if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) {\n                                    // You cannot extract global declarations\n                                    (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope));\n                                }\n                            // falls through\n                            case 221 /* ClassExpression */:\n                            case 208 /* FunctionExpression */:\n                            case 165 /* MethodDeclaration */:\n                            case 166 /* Constructor */:\n                            case 167 /* GetAccessor */:\n                            case 168 /* SetAccessor */:\n                                // do not dive into functions or classes\n                                return false;\n                        }\n                        var savedPermittedJumps = permittedJumps;\n                        switch (node.kind) {\n                            case 234 /* IfStatement */:\n                                permittedJumps = 0 /* None */;\n                                break;\n                            case 247 /* TryStatement */:\n                                // forbid all jumps inside try blocks\n                                permittedJumps = 0 /* None */;\n                                break;\n                            case 230 /* Block */:\n                                if (node.parent && node.parent.kind === 247 /* TryStatement */ && node.parent.finallyBlock === node) {\n                                    // allow unconditional returns from finally blocks\n                                    permittedJumps = 4 /* Return */;\n                                }\n                                break;\n                            case 285 /* DefaultClause */:\n                            case 284 /* CaseClause */:\n                                // allow unlabeled break inside case clauses\n                                permittedJumps |= 1 /* Break */;\n                                break;\n                            default:\n                                if (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false)) {\n                                    // allow unlabeled break/continue inside loops\n                                    permittedJumps |= 1 /* Break */ | 2 /* Continue */;\n                                }\n                                break;\n                        }\n                        switch (node.kind) {\n                            case 187 /* ThisType */:\n                            case 107 /* ThisKeyword */:\n                                rangeFacts |= RangeFacts.UsesThis;\n                                break;\n                            case 245 /* LabeledStatement */: {\n                                var label = node.label;\n                                (seenLabels || (seenLabels = [])).push(label.escapedText);\n                                ts.forEachChild(node, visit);\n                                seenLabels.pop();\n                                break;\n                            }\n                            case 241 /* BreakStatement */:\n                            case 240 /* ContinueStatement */: {\n                                var label = node.label;\n                                if (label) {\n                                    if (!ts.contains(seenLabels, label.escapedText)) {\n                                        // attempts to jump to label that is not in range to be extracted\n                                        (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange));\n                                    }\n                                }\n                                else {\n                                    if (!(permittedJumps & (node.kind === 241 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) {\n                                        // attempt to break or continue in a forbidden context\n                                        (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements));\n                                    }\n                                }\n                                break;\n                            }\n                            case 213 /* AwaitExpression */:\n                                rangeFacts |= RangeFacts.IsAsyncFunction;\n                                break;\n                            case 219 /* YieldExpression */:\n                                rangeFacts |= RangeFacts.IsGenerator;\n                                break;\n                            case 242 /* ReturnStatement */:\n                                if (permittedJumps & 4 /* Return */) {\n                                    rangeFacts |= RangeFacts.HasReturn;\n                                }\n                                else {\n                                    (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalReturnStatement));\n                                }\n                                break;\n                            default:\n                                ts.forEachChild(node, visit);\n                                break;\n                        }\n                        permittedJumps = savedPermittedJumps;\n                    }\n                }\n            }\n            extractSymbol.getRangeToExtract = getRangeToExtract;\n            function getStatementOrExpressionRange(node) {\n                if (ts.isStatement(node)) {\n                    return [node];\n                }\n                else if (ts.isExpressionNode(node)) {\n                    // If our selection is the expression in an ExpressionStatement, expand\n                    // the selection to include the enclosing Statement (this stops us\n                    // from trying to care about the return value of the extracted function\n                    // and eliminates double semicolon insertion in certain scenarios)\n                    return ts.isExpressionStatement(node.parent) ? [node.parent] : node;\n                }\n                return undefined;\n            }\n            function isScope(node) {\n                return ts.isFunctionLikeDeclaration(node) || ts.isSourceFile(node) || ts.isModuleBlock(node) || ts.isClassLike(node);\n            }\n            /**\n             * Computes possible places we could extract the function into. For example,\n             * you may be able to extract into a class method *or* local closure *or* namespace function,\n             * depending on what's in the extracted body.\n             */\n            function collectEnclosingScopes(range) {\n                var current = isReadonlyArray(range.range) ? ts.first(range.range) : range.range;\n                if (range.facts & RangeFacts.UsesThis) {\n                    // if range uses this as keyword or as type inside the class then it can only be extracted to a method of the containing class\n                    var containingClass = ts.getContainingClass(current);\n                    if (containingClass) {\n                        var containingFunction = ts.findAncestor(current, ts.isFunctionLikeDeclaration);\n                        return containingFunction\n                            ? [containingFunction, containingClass]\n                            : [containingClass];\n                    }\n                }\n                var scopes = [];\n                while (true) {\n                    current = current.parent;\n                    // A function parameter's initializer is actually in the outer scope, not the function declaration\n                    if (current.kind === 160 /* Parameter */) {\n                        // Skip all the way to the outer scope of the function that declared this parameter\n                        current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent;\n                    }\n                    // We want to find the nearest parent where we can place an \"equivalent\" sibling to the node we're extracting out of.\n                    // Walk up to the closest parent of a place where we can logically put a sibling:\n                    //  * Function declaration\n                    //  * Class declaration or expression\n                    //  * Module/namespace or source file\n                    if (isScope(current)) {\n                        scopes.push(current);\n                        if (current.kind === 297 /* SourceFile */) {\n                            return scopes;\n                        }\n                    }\n                }\n            }\n            function getFunctionExtractionAtIndex(targetRange, context, requestedChangesIndex) {\n                var _a = getPossibleExtractionsWorker(targetRange, context), scopes = _a.scopes, _b = _a.readsAndWrites, target = _b.target, usagesPerScope = _b.usagesPerScope, functionErrorsPerScope = _b.functionErrorsPerScope, exposedVariableDeclarations = _b.exposedVariableDeclarations;\n                ts.Debug.assert(!functionErrorsPerScope[requestedChangesIndex].length, \"The extraction went missing? How?\");\n                context.cancellationToken.throwIfCancellationRequested(); // TODO: GH#18217\n                return extractFunctionInScope(target, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], exposedVariableDeclarations, targetRange, context);\n            }\n            function getConstantExtractionAtIndex(targetRange, context, requestedChangesIndex) {\n                var _a = getPossibleExtractionsWorker(targetRange, context), scopes = _a.scopes, _b = _a.readsAndWrites, target = _b.target, usagesPerScope = _b.usagesPerScope, constantErrorsPerScope = _b.constantErrorsPerScope, exposedVariableDeclarations = _b.exposedVariableDeclarations;\n                ts.Debug.assert(!constantErrorsPerScope[requestedChangesIndex].length, \"The extraction went missing? How?\");\n                ts.Debug.assert(exposedVariableDeclarations.length === 0, \"Extract constant accepted a range containing a variable declaration?\");\n                context.cancellationToken.throwIfCancellationRequested();\n                var expression = ts.isExpression(target)\n                    ? target\n                    : target.statements[0].expression;\n                return extractConstantInScope(expression, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], targetRange.facts, context);\n            }\n            /**\n             * Given a piece of text to extract ('targetRange'), computes a list of possible extractions.\n             * Each returned ExtractResultForScope corresponds to a possible target scope and is either a set of changes\n             * or an error explaining why we can't extract into that scope.\n             */\n            function getPossibleExtractions(targetRange, context) {\n                var _a = getPossibleExtractionsWorker(targetRange, context), scopes = _a.scopes, _b = _a.readsAndWrites, functionErrorsPerScope = _b.functionErrorsPerScope, constantErrorsPerScope = _b.constantErrorsPerScope;\n                // Need the inner type annotation to avoid https://github.com/Microsoft/TypeScript/issues/7547\n                var extractions = scopes.map(function (scope, i) {\n                    var functionDescriptionPart = getDescriptionForFunctionInScope(scope);\n                    var constantDescriptionPart = getDescriptionForConstantInScope(scope);\n                    var scopeDescription = ts.isFunctionLikeDeclaration(scope)\n                        ? getDescriptionForFunctionLikeDeclaration(scope)\n                        : ts.isClassLike(scope)\n                            ? getDescriptionForClassLikeDeclaration(scope)\n                            : getDescriptionForModuleLikeDeclaration(scope);\n                    var functionDescription;\n                    var constantDescription;\n                    if (scopeDescription === 1 /* Global */) {\n                        functionDescription = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_to_0_in_1_scope), [functionDescriptionPart, \"global\"]);\n                        constantDescription = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_to_0_in_1_scope), [constantDescriptionPart, \"global\"]);\n                    }\n                    else if (scopeDescription === 0 /* Module */) {\n                        functionDescription = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_to_0_in_1_scope), [functionDescriptionPart, \"module\"]);\n                        constantDescription = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_to_0_in_1_scope), [constantDescriptionPart, \"module\"]);\n                    }\n                    else {\n                        functionDescription = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_to_0_in_1), [functionDescriptionPart, scopeDescription]);\n                        constantDescription = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_to_0_in_1), [constantDescriptionPart, scopeDescription]);\n                    }\n                    // Customize the phrasing for the innermost scope to increase clarity.\n                    if (i === 0 && !ts.isClassLike(scope)) {\n                        constantDescription = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_to_0_in_enclosing_scope), [constantDescriptionPart]);\n                    }\n                    return {\n                        functionExtraction: {\n                            description: functionDescription,\n                            errors: functionErrorsPerScope[i],\n                        },\n                        constantExtraction: {\n                            description: constantDescription,\n                            errors: constantErrorsPerScope[i],\n                        },\n                    };\n                });\n                return extractions;\n            }\n            function getPossibleExtractionsWorker(targetRange, context) {\n                var sourceFile = context.file;\n                var scopes = collectEnclosingScopes(targetRange);\n                var enclosingTextRange = getEnclosingTextRange(targetRange, sourceFile);\n                var readsAndWrites = collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFile, context.program.getTypeChecker(), context.cancellationToken);\n                return { scopes: scopes, readsAndWrites: readsAndWrites };\n            }\n            function getDescriptionForFunctionInScope(scope) {\n                return ts.isFunctionLikeDeclaration(scope)\n                    ? \"inner function\"\n                    : ts.isClassLike(scope)\n                        ? \"method\"\n                        : \"function\";\n            }\n            function getDescriptionForConstantInScope(scope) {\n                return ts.isClassLike(scope)\n                    ? \"readonly field\"\n                    : \"constant\";\n            }\n            function getDescriptionForFunctionLikeDeclaration(scope) {\n                switch (scope.kind) {\n                    case 166 /* Constructor */:\n                        return \"constructor\";\n                    case 208 /* FunctionExpression */:\n                    case 251 /* FunctionDeclaration */:\n                        return scope.name\n                            ? \"function '\" + scope.name.text + \"'\"\n                            : ts.ANONYMOUS;\n                    case 209 /* ArrowFunction */:\n                        return \"arrow function\";\n                    case 165 /* MethodDeclaration */:\n                        return \"method '\" + scope.name.getText() + \"'\";\n                    case 167 /* GetAccessor */:\n                        return \"'get \" + scope.name.getText() + \"'\";\n                    case 168 /* SetAccessor */:\n                        return \"'set \" + scope.name.getText() + \"'\";\n                    default:\n                        throw ts.Debug.assertNever(scope, \"Unexpected scope kind \" + scope.kind);\n                }\n            }\n            function getDescriptionForClassLikeDeclaration(scope) {\n                return scope.kind === 252 /* ClassDeclaration */\n                    ? scope.name ? \"class '\" + scope.name.text + \"'\" : \"anonymous class declaration\"\n                    : scope.name ? \"class expression '\" + scope.name.text + \"'\" : \"anonymous class expression\";\n            }\n            function getDescriptionForModuleLikeDeclaration(scope) {\n                return scope.kind === 257 /* ModuleBlock */\n                    ? \"namespace '\" + scope.parent.name.getText() + \"'\"\n                    : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */;\n            }\n            var SpecialScope;\n            (function (SpecialScope) {\n                SpecialScope[SpecialScope[\"Module\"] = 0] = \"Module\";\n                SpecialScope[SpecialScope[\"Global\"] = 1] = \"Global\";\n            })(SpecialScope || (SpecialScope = {}));\n            /**\n             * Result of 'extractRange' operation for a specific scope.\n             * Stores either a list of changes that should be applied to extract a range or a list of errors\n             */\n            function extractFunctionInScope(node, scope, _a, exposedVariableDeclarations, range, context) {\n                var usagesInScope = _a.usages, typeParameterUsages = _a.typeParameterUsages, substitutions = _a.substitutions;\n                var checker = context.program.getTypeChecker();\n                var scriptTarget = ts.getEmitScriptTarget(context.program.getCompilerOptions());\n                var importAdder = ts.codefix.createImportAdder(context.file, context.program, context.preferences, context.host);\n                // Make a unique name for the extracted function\n                var file = scope.getSourceFile();\n                var functionNameText = ts.getUniqueName(ts.isClassLike(scope) ? \"newMethod\" : \"newFunction\", file);\n                var isJS = ts.isInJSFile(scope);\n                var functionName = ts.factory.createIdentifier(functionNameText);\n                var returnType;\n                var parameters = [];\n                var callArguments = [];\n                var writes;\n                usagesInScope.forEach(function (usage, name) {\n                    var typeNode;\n                    if (!isJS) {\n                        var type = checker.getTypeOfSymbolAtLocation(usage.symbol, usage.node);\n                        // Widen the type so we don't emit nonsense annotations like \"function fn(x: 3) {\"\n                        type = checker.getBaseTypeOfLiteralType(type);\n                        typeNode = ts.codefix.typeToAutoImportableTypeNode(checker, importAdder, type, scope, scriptTarget, 1 /* NoTruncation */);\n                    }\n                    var paramDecl = ts.factory.createParameterDeclaration(\n                    /*decorators*/ undefined, \n                    /*modifiers*/ undefined, \n                    /*dotDotDotToken*/ undefined, \n                    /*name*/ name, \n                    /*questionToken*/ undefined, typeNode);\n                    parameters.push(paramDecl);\n                    if (usage.usage === 2 /* Write */) {\n                        (writes || (writes = [])).push(usage);\n                    }\n                    callArguments.push(ts.factory.createIdentifier(name));\n                });\n                var typeParametersAndDeclarations = ts.arrayFrom(typeParameterUsages.values()).map(function (type) { return ({ type: type, declaration: getFirstDeclaration(type) }); });\n                var sortedTypeParametersAndDeclarations = typeParametersAndDeclarations.sort(compareTypesByDeclarationOrder);\n                var typeParameters = sortedTypeParametersAndDeclarations.length === 0\n                    ? undefined\n                    : sortedTypeParametersAndDeclarations.map(function (t) { return t.declaration; });\n                // Strictly speaking, we should check whether each name actually binds to the appropriate type\n                // parameter.  In cases of shadowing, they may not.\n                var callTypeArguments = typeParameters !== undefined\n                    ? typeParameters.map(function (decl) { return ts.factory.createTypeReferenceNode(decl.name, /*typeArguments*/ undefined); })\n                    : undefined;\n                // Provide explicit return types for contextually-typed functions\n                // to avoid problems when there are literal types present\n                if (ts.isExpression(node) && !isJS) {\n                    var contextualType = checker.getContextualType(node);\n                    returnType = checker.typeToTypeNode(contextualType, scope, 1 /* NoTruncation */); // TODO: GH#18217\n                }\n                var _b = transformFunctionBody(node, exposedVariableDeclarations, writes, substitutions, !!(range.facts & RangeFacts.HasReturn)), body = _b.body, returnValueProperty = _b.returnValueProperty;\n                ts.suppressLeadingAndTrailingTrivia(body);\n                var newFunction;\n                if (ts.isClassLike(scope)) {\n                    // always create private method in TypeScript files\n                    var modifiers = isJS ? [] : [ts.factory.createModifier(120 /* PrivateKeyword */)];\n                    if (range.facts & RangeFacts.InStaticRegion) {\n                        modifiers.push(ts.factory.createModifier(123 /* StaticKeyword */));\n                    }\n                    if (range.facts & RangeFacts.IsAsyncFunction) {\n                        modifiers.push(ts.factory.createModifier(129 /* AsyncKeyword */));\n                    }\n                    newFunction = ts.factory.createMethodDeclaration(\n                    /*decorators*/ undefined, modifiers.length ? modifiers : undefined, range.facts & RangeFacts.IsGenerator ? ts.factory.createToken(41 /* AsteriskToken */) : undefined, functionName, \n                    /*questionToken*/ undefined, typeParameters, parameters, returnType, body);\n                }\n                else {\n                    newFunction = ts.factory.createFunctionDeclaration(\n                    /*decorators*/ undefined, range.facts & RangeFacts.IsAsyncFunction ? [ts.factory.createToken(129 /* AsyncKeyword */)] : undefined, range.facts & RangeFacts.IsGenerator ? ts.factory.createToken(41 /* AsteriskToken */) : undefined, functionName, typeParameters, parameters, returnType, body);\n                }\n                var changeTracker = ts.textChanges.ChangeTracker.fromContext(context);\n                var minInsertionPos = (isReadonlyArray(range.range) ? ts.last(range.range) : range.range).end;\n                var nodeToInsertBefore = getNodeToInsertFunctionBefore(minInsertionPos, scope);\n                if (nodeToInsertBefore) {\n                    changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newFunction, /*blankLineBetween*/ true);\n                }\n                else {\n                    changeTracker.insertNodeAtEndOfScope(context.file, scope, newFunction);\n                }\n                importAdder.writeFixes(changeTracker);\n                var newNodes = [];\n                // replace range with function call\n                var called = getCalledExpression(scope, range, functionNameText);\n                var call = ts.factory.createCallExpression(called, callTypeArguments, // Note that no attempt is made to take advantage of type argument inference\n                callArguments);\n                if (range.facts & RangeFacts.IsGenerator) {\n                    call = ts.factory.createYieldExpression(ts.factory.createToken(41 /* AsteriskToken */), call);\n                }\n                if (range.facts & RangeFacts.IsAsyncFunction) {\n                    call = ts.factory.createAwaitExpression(call);\n                }\n                if (isInJSXContent(node)) {\n                    call = ts.factory.createJsxExpression(/*dotDotDotToken*/ undefined, call);\n                }\n                if (exposedVariableDeclarations.length && !writes) {\n                    // No need to mix declarations and writes.\n                    // How could any variables be exposed if there's a return statement?\n                    ts.Debug.assert(!returnValueProperty, \"Expected no returnValueProperty\");\n                    ts.Debug.assert(!(range.facts & RangeFacts.HasReturn), \"Expected RangeFacts.HasReturn flag to be unset\");\n                    if (exposedVariableDeclarations.length === 1) {\n                        // Declaring exactly one variable: let x = newFunction();\n                        var variableDeclaration = exposedVariableDeclarations[0];\n                        newNodes.push(ts.factory.createVariableStatement(\n                        /*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(ts.getSynthesizedDeepClone(variableDeclaration.name), /*exclamationToken*/ undefined, /*type*/ ts.getSynthesizedDeepClone(variableDeclaration.type), /*initializer*/ call)], // TODO (acasey): test binding patterns\n                        variableDeclaration.parent.flags)));\n                    }\n                    else {\n                        // Declaring multiple variables / return properties:\n                        //   let {x, y} = newFunction();\n                        var bindingElements = [];\n                        var typeElements = [];\n                        var commonNodeFlags = exposedVariableDeclarations[0].parent.flags;\n                        var sawExplicitType = false;\n                        for (var _i = 0, exposedVariableDeclarations_1 = exposedVariableDeclarations; _i < exposedVariableDeclarations_1.length; _i++) {\n                            var variableDeclaration = exposedVariableDeclarations_1[_i];\n                            bindingElements.push(ts.factory.createBindingElement(\n                            /*dotDotDotToken*/ undefined, \n                            /*propertyName*/ undefined, \n                            /*name*/ ts.getSynthesizedDeepClone(variableDeclaration.name)));\n                            // Being returned through an object literal will have widened the type.\n                            var variableType = checker.typeToTypeNode(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(variableDeclaration)), scope, 1 /* NoTruncation */);\n                            typeElements.push(ts.factory.createPropertySignature(\n                            /*modifiers*/ undefined, \n                            /*name*/ variableDeclaration.symbol.name, \n                            /*questionToken*/ undefined, \n                            /*type*/ variableType));\n                            sawExplicitType = sawExplicitType || variableDeclaration.type !== undefined;\n                            commonNodeFlags = commonNodeFlags & variableDeclaration.parent.flags;\n                        }\n                        var typeLiteral = sawExplicitType ? ts.factory.createTypeLiteralNode(typeElements) : undefined;\n                        if (typeLiteral) {\n                            ts.setEmitFlags(typeLiteral, 1 /* SingleLine */);\n                        }\n                        newNodes.push(ts.factory.createVariableStatement(\n                        /*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(ts.factory.createObjectBindingPattern(bindingElements), \n                            /*exclamationToken*/ undefined, \n                            /*type*/ typeLiteral, \n                            /*initializer*/ call)], commonNodeFlags)));\n                    }\n                }\n                else if (exposedVariableDeclarations.length || writes) {\n                    if (exposedVariableDeclarations.length) {\n                        // CONSIDER: we're going to create one statement per variable, but we could actually preserve their original grouping.\n                        for (var _c = 0, exposedVariableDeclarations_2 = exposedVariableDeclarations; _c < exposedVariableDeclarations_2.length; _c++) {\n                            var variableDeclaration = exposedVariableDeclarations_2[_c];\n                            var flags = variableDeclaration.parent.flags;\n                            if (flags & 2 /* Const */) {\n                                flags = (flags & ~2 /* Const */) | 1 /* Let */;\n                            }\n                            newNodes.push(ts.factory.createVariableStatement(\n                            /*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(variableDeclaration.symbol.name, /*exclamationToken*/ undefined, getTypeDeepCloneUnionUndefined(variableDeclaration.type))], flags)));\n                        }\n                    }\n                    if (returnValueProperty) {\n                        // has both writes and return, need to create variable declaration to hold return value;\n                        newNodes.push(ts.factory.createVariableStatement(\n                        /*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(returnValueProperty, /*exclamationToken*/ undefined, getTypeDeepCloneUnionUndefined(returnType))], 1 /* Let */)));\n                    }\n                    var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes);\n                    if (returnValueProperty) {\n                        assignments.unshift(ts.factory.createShorthandPropertyAssignment(returnValueProperty));\n                    }\n                    // propagate writes back\n                    if (assignments.length === 1) {\n                        // We would only have introduced a return value property if there had been\n                        // other assignments to make.\n                        ts.Debug.assert(!returnValueProperty, \"Shouldn't have returnValueProperty here\");\n                        newNodes.push(ts.factory.createExpressionStatement(ts.factory.createAssignment(assignments[0].name, call)));\n                        if (range.facts & RangeFacts.HasReturn) {\n                            newNodes.push(ts.factory.createReturnStatement());\n                        }\n                    }\n                    else {\n                        // emit e.g.\n                        //   { a, b, __return } = newFunction(a, b);\n                        //   return __return;\n                        newNodes.push(ts.factory.createExpressionStatement(ts.factory.createAssignment(ts.factory.createObjectLiteralExpression(assignments), call)));\n                        if (returnValueProperty) {\n                            newNodes.push(ts.factory.createReturnStatement(ts.factory.createIdentifier(returnValueProperty)));\n                        }\n                    }\n                }\n                else {\n                    if (range.facts & RangeFacts.HasReturn) {\n                        newNodes.push(ts.factory.createReturnStatement(call));\n                    }\n                    else if (isReadonlyArray(range.range)) {\n                        newNodes.push(ts.factory.createExpressionStatement(call));\n                    }\n                    else {\n                        newNodes.push(call);\n                    }\n                }\n                if (isReadonlyArray(range.range)) {\n                    changeTracker.replaceNodeRangeWithNodes(context.file, ts.first(range.range), ts.last(range.range), newNodes);\n                }\n                else {\n                    changeTracker.replaceNodeWithNodes(context.file, range.range, newNodes);\n                }\n                var edits = changeTracker.getChanges();\n                var renameRange = isReadonlyArray(range.range) ? ts.first(range.range) : range.range;\n                var renameFilename = renameRange.getSourceFile().fileName;\n                var renameLocation = ts.getRenameLocation(edits, renameFilename, functionNameText, /*isDeclaredBeforeUse*/ false);\n                return { renameFilename: renameFilename, renameLocation: renameLocation, edits: edits };\n                function getTypeDeepCloneUnionUndefined(typeNode) {\n                    if (typeNode === undefined) {\n                        return undefined;\n                    }\n                    var clone = ts.getSynthesizedDeepClone(typeNode);\n                    var withoutParens = clone;\n                    while (ts.isParenthesizedTypeNode(withoutParens)) {\n                        withoutParens = withoutParens.type;\n                    }\n                    return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 150 /* UndefinedKeyword */; })\n                        ? clone\n                        : ts.factory.createUnionTypeNode([clone, ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)]);\n                }\n            }\n            /**\n             * Result of 'extractRange' operation for a specific scope.\n             * Stores either a list of changes that should be applied to extract a range or a list of errors\n             */\n            function extractConstantInScope(node, scope, _a, rangeFacts, context) {\n                var _b;\n                var substitutions = _a.substitutions;\n                var checker = context.program.getTypeChecker();\n                // Make a unique name for the extracted variable\n                var file = scope.getSourceFile();\n                var localNameText = ts.getUniqueName(ts.isClassLike(scope) ? \"newProperty\" : \"newLocal\", file);\n                var isJS = ts.isInJSFile(scope);\n                var variableType = isJS || !checker.isContextSensitive(node)\n                    ? undefined\n                    : checker.typeToTypeNode(checker.getContextualType(node), scope, 1 /* NoTruncation */); // TODO: GH#18217\n                var initializer = transformConstantInitializer(node, substitutions);\n                (_b = transformFunctionInitializerAndType(variableType, initializer), variableType = _b.variableType, initializer = _b.initializer);\n                ts.suppressLeadingAndTrailingTrivia(initializer);\n                var changeTracker = ts.textChanges.ChangeTracker.fromContext(context);\n                if (ts.isClassLike(scope)) {\n                    ts.Debug.assert(!isJS, \"Cannot extract to a JS class\"); // See CannotExtractToJSClass\n                    var modifiers = [];\n                    modifiers.push(ts.factory.createModifier(120 /* PrivateKeyword */));\n                    if (rangeFacts & RangeFacts.InStaticRegion) {\n                        modifiers.push(ts.factory.createModifier(123 /* StaticKeyword */));\n                    }\n                    modifiers.push(ts.factory.createModifier(142 /* ReadonlyKeyword */));\n                    var newVariable = ts.factory.createPropertyDeclaration(\n                    /*decorators*/ undefined, modifiers, localNameText, \n                    /*questionToken*/ undefined, variableType, initializer);\n                    var localReference = ts.factory.createPropertyAccessExpression(rangeFacts & RangeFacts.InStaticRegion\n                        ? ts.factory.createIdentifier(scope.name.getText()) // TODO: GH#18217\n                        : ts.factory.createThis(), ts.factory.createIdentifier(localNameText));\n                    if (isInJSXContent(node)) {\n                        localReference = ts.factory.createJsxExpression(/*dotDotDotToken*/ undefined, localReference);\n                    }\n                    // Declare\n                    var maxInsertionPos = node.pos;\n                    var nodeToInsertBefore = getNodeToInsertPropertyBefore(maxInsertionPos, scope);\n                    changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariable, /*blankLineBetween*/ true);\n                    // Consume\n                    changeTracker.replaceNode(context.file, node, localReference);\n                }\n                else {\n                    var newVariableDeclaration = ts.factory.createVariableDeclaration(localNameText, /*exclamationToken*/ undefined, variableType, initializer);\n                    // If the node is part of an initializer in a list of variable declarations, insert a new\n                    // variable declaration into the list (in case it depends on earlier ones).\n                    // CONSIDER: If the declaration list isn't const, we might want to split it into multiple\n                    // lists so that the newly extracted one can be const.\n                    var oldVariableDeclaration = getContainingVariableDeclarationIfInList(node, scope);\n                    if (oldVariableDeclaration) {\n                        // Declare\n                        // CONSIDER: could detect that each is on a separate line (See `extractConstant_VariableList_MultipleLines` in `extractConstants.ts`)\n                        changeTracker.insertNodeBefore(context.file, oldVariableDeclaration, newVariableDeclaration);\n                        // Consume\n                        var localReference = ts.factory.createIdentifier(localNameText);\n                        changeTracker.replaceNode(context.file, node, localReference);\n                    }\n                    else if (node.parent.kind === 233 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) {\n                        // If the parent is an expression statement and the target scope is the immediately enclosing one,\n                        // replace the statement with the declaration.\n                        var newVariableStatement = ts.factory.createVariableStatement(\n                        /*modifiers*/ undefined, ts.factory.createVariableDeclarationList([newVariableDeclaration], 2 /* Const */));\n                        changeTracker.replaceNode(context.file, node.parent, newVariableStatement);\n                    }\n                    else {\n                        var newVariableStatement = ts.factory.createVariableStatement(\n                        /*modifiers*/ undefined, ts.factory.createVariableDeclarationList([newVariableDeclaration], 2 /* Const */));\n                        // Declare\n                        var nodeToInsertBefore = getNodeToInsertConstantBefore(node, scope);\n                        if (nodeToInsertBefore.pos === 0) {\n                            changeTracker.insertNodeAtTopOfFile(context.file, newVariableStatement, /*blankLineBetween*/ false);\n                        }\n                        else {\n                            changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false);\n                        }\n                        // Consume\n                        if (node.parent.kind === 233 /* ExpressionStatement */) {\n                            // If the parent is an expression statement, delete it.\n                            changeTracker.delete(context.file, node.parent);\n                        }\n                        else {\n                            var localReference = ts.factory.createIdentifier(localNameText);\n                            // When extract to a new variable in JSX content, need to wrap a {} out of the new variable\n                            // or it will become a plain text\n                            if (isInJSXContent(node)) {\n                                localReference = ts.factory.createJsxExpression(/*dotDotDotToken*/ undefined, localReference);\n                            }\n                            changeTracker.replaceNode(context.file, node, localReference);\n                        }\n                    }\n                }\n                var edits = changeTracker.getChanges();\n                var renameFilename = node.getSourceFile().fileName;\n                var renameLocation = ts.getRenameLocation(edits, renameFilename, localNameText, /*isDeclaredBeforeUse*/ true);\n                return { renameFilename: renameFilename, renameLocation: renameLocation, edits: edits };\n                function transformFunctionInitializerAndType(variableType, initializer) {\n                    // If no contextual type exists there is nothing to transfer to the function signature\n                    if (variableType === undefined)\n                        return { variableType: variableType, initializer: initializer };\n                    // Only do this for function expressions and arrow functions that are not generic\n                    if (!ts.isFunctionExpression(initializer) && !ts.isArrowFunction(initializer) || !!initializer.typeParameters)\n                        return { variableType: variableType, initializer: initializer };\n                    var functionType = checker.getTypeAtLocation(node);\n                    var functionSignature = ts.singleOrUndefined(checker.getSignaturesOfType(functionType, 0 /* Call */));\n                    // If no function signature, maybe there was an error, do nothing\n                    if (!functionSignature)\n                        return { variableType: variableType, initializer: initializer };\n                    // If the function signature has generic type parameters we don't attempt to move the parameters\n                    if (!!functionSignature.getTypeParameters())\n                        return { variableType: variableType, initializer: initializer };\n                    // We add parameter types if needed\n                    var parameters = [];\n                    var hasAny = false;\n                    for (var _i = 0, _a = initializer.parameters; _i < _a.length; _i++) {\n                        var p = _a[_i];\n                        if (p.type) {\n                            parameters.push(p);\n                        }\n                        else {\n                            var paramType = checker.getTypeAtLocation(p);\n                            if (paramType === checker.getAnyType())\n                                hasAny = true;\n                            parameters.push(ts.factory.updateParameterDeclaration(p, p.decorators, p.modifiers, p.dotDotDotToken, p.name, p.questionToken, p.type || checker.typeToTypeNode(paramType, scope, 1 /* NoTruncation */), p.initializer));\n                        }\n                    }\n                    // If a parameter was inferred as any we skip adding function parameters at all.\n                    // Turning an implicit any (which under common settings is a error) to an explicit\n                    // is probably actually a worse refactor outcome.\n                    if (hasAny)\n                        return { variableType: variableType, initializer: initializer };\n                    variableType = undefined;\n                    if (ts.isArrowFunction(initializer)) {\n                        initializer = ts.factory.updateArrowFunction(initializer, node.modifiers, initializer.typeParameters, parameters, initializer.type || checker.typeToTypeNode(functionSignature.getReturnType(), scope, 1 /* NoTruncation */), initializer.equalsGreaterThanToken, initializer.body);\n                    }\n                    else {\n                        if (functionSignature && !!functionSignature.thisParameter) {\n                            var firstParameter = ts.firstOrUndefined(parameters);\n                            // If the function signature has a this parameter and if the first defined parameter is not the this parameter, we must add it\n                            // Note: If this parameter was already there, it would have been previously updated with the type if not type was present\n                            if ((!firstParameter || (ts.isIdentifier(firstParameter.name) && firstParameter.name.escapedText !== \"this\"))) {\n                                var thisType = checker.getTypeOfSymbolAtLocation(functionSignature.thisParameter, node);\n                                parameters.splice(0, 0, ts.factory.createParameterDeclaration(\n                                /* decorators */ undefined, \n                                /* modifiers */ undefined, \n                                /* dotDotDotToken */ undefined, \"this\", \n                                /* questionToken */ undefined, checker.typeToTypeNode(thisType, scope, 1 /* NoTruncation */)));\n                            }\n                        }\n                        initializer = ts.factory.updateFunctionExpression(initializer, node.modifiers, initializer.asteriskToken, initializer.name, initializer.typeParameters, parameters, initializer.type || checker.typeToTypeNode(functionSignature.getReturnType(), scope, 1 /* NoTruncation */), initializer.body);\n                    }\n                    return { variableType: variableType, initializer: initializer };\n                }\n            }\n            function getContainingVariableDeclarationIfInList(node, scope) {\n                var prevNode;\n                while (node !== undefined && node !== scope) {\n                    if (ts.isVariableDeclaration(node) &&\n                        node.initializer === prevNode &&\n                        ts.isVariableDeclarationList(node.parent) &&\n                        node.parent.declarations.length > 1) {\n                        return node;\n                    }\n                    prevNode = node;\n                    node = node.parent;\n                }\n            }\n            function getFirstDeclaration(type) {\n                var firstDeclaration;\n                var symbol = type.symbol;\n                if (symbol && symbol.declarations) {\n                    for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                        var declaration = _a[_i];\n                        if (firstDeclaration === undefined || declaration.pos < firstDeclaration.pos) {\n                            firstDeclaration = declaration;\n                        }\n                    }\n                }\n                return firstDeclaration;\n            }\n            function compareTypesByDeclarationOrder(_a, _b) {\n                var type1 = _a.type, declaration1 = _a.declaration;\n                var type2 = _b.type, declaration2 = _b.declaration;\n                return ts.compareProperties(declaration1, declaration2, \"pos\", ts.compareValues)\n                    || ts.compareStringsCaseSensitive(type1.symbol ? type1.symbol.getName() : \"\", type2.symbol ? type2.symbol.getName() : \"\")\n                    || ts.compareValues(type1.id, type2.id);\n            }\n            function getCalledExpression(scope, range, functionNameText) {\n                var functionReference = ts.factory.createIdentifier(functionNameText);\n                if (ts.isClassLike(scope)) {\n                    var lhs = range.facts & RangeFacts.InStaticRegion ? ts.factory.createIdentifier(scope.name.text) : ts.factory.createThis(); // TODO: GH#18217\n                    return ts.factory.createPropertyAccessExpression(lhs, functionReference);\n                }\n                else {\n                    return functionReference;\n                }\n            }\n            function transformFunctionBody(body, exposedVariableDeclarations, writes, substitutions, hasReturn) {\n                var hasWritesOrVariableDeclarations = writes !== undefined || exposedVariableDeclarations.length > 0;\n                if (ts.isBlock(body) && !hasWritesOrVariableDeclarations && substitutions.size === 0) {\n                    // already block, no declarations or writes to propagate back, no substitutions - can use node as is\n                    return { body: ts.factory.createBlock(body.statements, /*multLine*/ true), returnValueProperty: undefined };\n                }\n                var returnValueProperty;\n                var ignoreReturns = false;\n                var statements = ts.factory.createNodeArray(ts.isBlock(body) ? body.statements.slice(0) : [ts.isStatement(body) ? body : ts.factory.createReturnStatement(body)]);\n                // rewrite body if either there are writes that should be propagated back via return statements or there are substitutions\n                if (hasWritesOrVariableDeclarations || substitutions.size) {\n                    var rewrittenStatements = ts.visitNodes(statements, visitor).slice();\n                    if (hasWritesOrVariableDeclarations && !hasReturn && ts.isStatement(body)) {\n                        // add return at the end to propagate writes back in case if control flow falls out of the function body\n                        // it is ok to know that range has at least one return since it we only allow unconditional returns\n                        var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes);\n                        if (assignments.length === 1) {\n                            rewrittenStatements.push(ts.factory.createReturnStatement(assignments[0].name));\n                        }\n                        else {\n                            rewrittenStatements.push(ts.factory.createReturnStatement(ts.factory.createObjectLiteralExpression(assignments)));\n                        }\n                    }\n                    return { body: ts.factory.createBlock(rewrittenStatements, /*multiLine*/ true), returnValueProperty: returnValueProperty };\n                }\n                else {\n                    return { body: ts.factory.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined };\n                }\n                function visitor(node) {\n                    if (!ignoreReturns && ts.isReturnStatement(node) && hasWritesOrVariableDeclarations) {\n                        var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes);\n                        if (node.expression) {\n                            if (!returnValueProperty) {\n                                returnValueProperty = \"__return\";\n                            }\n                            assignments.unshift(ts.factory.createPropertyAssignment(returnValueProperty, ts.visitNode(node.expression, visitor)));\n                        }\n                        if (assignments.length === 1) {\n                            return ts.factory.createReturnStatement(assignments[0].name);\n                        }\n                        else {\n                            return ts.factory.createReturnStatement(ts.factory.createObjectLiteralExpression(assignments));\n                        }\n                    }\n                    else {\n                        var oldIgnoreReturns = ignoreReturns;\n                        ignoreReturns = ignoreReturns || ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node);\n                        var substitution = substitutions.get(ts.getNodeId(node).toString());\n                        var result = substitution ? ts.getSynthesizedDeepClone(substitution) : ts.visitEachChild(node, visitor, ts.nullTransformationContext);\n                        ignoreReturns = oldIgnoreReturns;\n                        return result;\n                    }\n                }\n            }\n            function transformConstantInitializer(initializer, substitutions) {\n                return substitutions.size\n                    ? visitor(initializer)\n                    : initializer;\n                function visitor(node) {\n                    var substitution = substitutions.get(ts.getNodeId(node).toString());\n                    return substitution ? ts.getSynthesizedDeepClone(substitution) : ts.visitEachChild(node, visitor, ts.nullTransformationContext);\n                }\n            }\n            function getStatementsOrClassElements(scope) {\n                if (ts.isFunctionLikeDeclaration(scope)) {\n                    var body = scope.body; // TODO: GH#18217\n                    if (ts.isBlock(body)) {\n                        return body.statements;\n                    }\n                }\n                else if (ts.isModuleBlock(scope) || ts.isSourceFile(scope)) {\n                    return scope.statements;\n                }\n                else if (ts.isClassLike(scope)) {\n                    return scope.members;\n                }\n                else {\n                    ts.assertType(scope);\n                }\n                return ts.emptyArray;\n            }\n            /**\n             * If `scope` contains a function after `minPos`, then return the first such function.\n             * Otherwise, return `undefined`.\n             */\n            function getNodeToInsertFunctionBefore(minPos, scope) {\n                return ts.find(getStatementsOrClassElements(scope), function (child) {\n                    return child.pos >= minPos && ts.isFunctionLikeDeclaration(child) && !ts.isConstructorDeclaration(child);\n                });\n            }\n            function getNodeToInsertPropertyBefore(maxPos, scope) {\n                var members = scope.members;\n                ts.Debug.assert(members.length > 0, \"Found no members\"); // There must be at least one child, since we extracted from one.\n                var prevMember;\n                var allProperties = true;\n                for (var _i = 0, members_1 = members; _i < members_1.length; _i++) {\n                    var member = members_1[_i];\n                    if (member.pos > maxPos) {\n                        return prevMember || members[0];\n                    }\n                    if (allProperties && !ts.isPropertyDeclaration(member)) {\n                        // If it is non-vacuously true that all preceding members are properties,\n                        // insert before the current member (i.e. at the end of the list of properties).\n                        if (prevMember !== undefined) {\n                            return member;\n                        }\n                        allProperties = false;\n                    }\n                    prevMember = member;\n                }\n                if (prevMember === undefined)\n                    return ts.Debug.fail(); // If the loop didn't return, then it did set prevMember.\n                return prevMember;\n            }\n            function getNodeToInsertConstantBefore(node, scope) {\n                ts.Debug.assert(!ts.isClassLike(scope));\n                var prevScope;\n                for (var curr = node; curr !== scope; curr = curr.parent) {\n                    if (isScope(curr)) {\n                        prevScope = curr;\n                    }\n                }\n                for (var curr = (prevScope || node).parent;; curr = curr.parent) {\n                    if (isBlockLike(curr)) {\n                        var prevStatement = void 0;\n                        for (var _i = 0, _a = curr.statements; _i < _a.length; _i++) {\n                            var statement = _a[_i];\n                            if (statement.pos > node.pos) {\n                                break;\n                            }\n                            prevStatement = statement;\n                        }\n                        if (!prevStatement && ts.isCaseClause(curr)) {\n                            // We must have been in the expression of the case clause.\n                            ts.Debug.assert(ts.isSwitchStatement(curr.parent.parent), \"Grandparent isn't a switch statement\");\n                            return curr.parent.parent;\n                        }\n                        // There must be at least one statement since we started in one.\n                        return ts.Debug.checkDefined(prevStatement, \"prevStatement failed to get set\");\n                    }\n                    ts.Debug.assert(curr !== scope, \"Didn't encounter a block-like before encountering scope\");\n                }\n            }\n            function getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes) {\n                var variableAssignments = ts.map(exposedVariableDeclarations, function (v) { return ts.factory.createShorthandPropertyAssignment(v.symbol.name); });\n                var writeAssignments = ts.map(writes, function (w) { return ts.factory.createShorthandPropertyAssignment(w.symbol.name); });\n                // TODO: GH#18217 `variableAssignments` not possibly undefined!\n                return variableAssignments === undefined\n                    ? writeAssignments\n                    : writeAssignments === undefined\n                        ? variableAssignments\n                        : variableAssignments.concat(writeAssignments);\n            }\n            function isReadonlyArray(v) {\n                return ts.isArray(v);\n            }\n            /**\n             * Produces a range that spans the entirety of nodes, given a selection\n             * that might start/end in the middle of nodes.\n             *\n             * For example, when the user makes a selection like this\n             *                     v---v\n             *   var someThing = foo + bar;\n             *  this returns     ^-------^\n             */\n            function getEnclosingTextRange(targetRange, sourceFile) {\n                return isReadonlyArray(targetRange.range)\n                    ? { pos: ts.first(targetRange.range).getStart(sourceFile), end: ts.last(targetRange.range).getEnd() }\n                    : targetRange.range;\n            }\n            var Usage;\n            (function (Usage) {\n                // value should be passed to extracted method\n                Usage[Usage[\"Read\"] = 1] = \"Read\";\n                // value should be passed to extracted method and propagated back\n                Usage[Usage[\"Write\"] = 2] = \"Write\";\n            })(Usage || (Usage = {}));\n            function collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFile, checker, cancellationToken) {\n                var allTypeParameterUsages = new ts.Map(); // Key is type ID\n                var usagesPerScope = [];\n                var substitutionsPerScope = [];\n                var functionErrorsPerScope = [];\n                var constantErrorsPerScope = [];\n                var visibleDeclarationsInExtractedRange = [];\n                var exposedVariableSymbolSet = new ts.Map(); // Key is symbol ID\n                var exposedVariableDeclarations = [];\n                var firstExposedNonVariableDeclaration;\n                var expression = !isReadonlyArray(targetRange.range)\n                    ? targetRange.range\n                    : targetRange.range.length === 1 && ts.isExpressionStatement(targetRange.range[0])\n                        ? targetRange.range[0].expression\n                        : undefined;\n                var expressionDiagnostic;\n                if (expression === undefined) {\n                    var statements = targetRange.range;\n                    var start = ts.first(statements).getStart();\n                    var end = ts.last(statements).end;\n                    expressionDiagnostic = ts.createFileDiagnostic(sourceFile, start, end - start, Messages.expressionExpected);\n                }\n                else if (checker.getTypeAtLocation(expression).flags & (16384 /* Void */ | 131072 /* Never */)) {\n                    expressionDiagnostic = ts.createDiagnosticForNode(expression, Messages.uselessConstantType);\n                }\n                // initialize results\n                for (var _i = 0, scopes_1 = scopes; _i < scopes_1.length; _i++) {\n                    var scope = scopes_1[_i];\n                    usagesPerScope.push({ usages: new ts.Map(), typeParameterUsages: new ts.Map(), substitutions: new ts.Map() });\n                    substitutionsPerScope.push(new ts.Map());\n                    functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 251 /* FunctionDeclaration */\n                        ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)]\n                        : []);\n                    var constantErrors = [];\n                    if (expressionDiagnostic) {\n                        constantErrors.push(expressionDiagnostic);\n                    }\n                    if (ts.isClassLike(scope) && ts.isInJSFile(scope)) {\n                        constantErrors.push(ts.createDiagnosticForNode(scope, Messages.cannotExtractToJSClass));\n                    }\n                    if (ts.isArrowFunction(scope) && !ts.isBlock(scope.body)) {\n                        // TODO (https://github.com/Microsoft/TypeScript/issues/18924): allow this\n                        constantErrors.push(ts.createDiagnosticForNode(scope, Messages.cannotExtractToExpressionArrowFunction));\n                    }\n                    constantErrorsPerScope.push(constantErrors);\n                }\n                var seenUsages = new ts.Map();\n                var target = isReadonlyArray(targetRange.range) ? ts.factory.createBlock(targetRange.range) : targetRange.range;\n                var unmodifiedNode = isReadonlyArray(targetRange.range) ? ts.first(targetRange.range) : targetRange.range;\n                var inGenericContext = isInGenericContext(unmodifiedNode);\n                collectUsages(target);\n                // Unfortunately, this code takes advantage of the knowledge that the generated method\n                // will use the contextual type of an expression as the return type of the extracted\n                // method (and will therefore \"use\" all the types involved).\n                if (inGenericContext && !isReadonlyArray(targetRange.range)) {\n                    var contextualType = checker.getContextualType(targetRange.range); // TODO: GH#18217\n                    recordTypeParameterUsages(contextualType);\n                }\n                if (allTypeParameterUsages.size > 0) {\n                    var seenTypeParameterUsages = new ts.Map(); // Key is type ID\n                    var i_2 = 0;\n                    for (var curr = unmodifiedNode; curr !== undefined && i_2 < scopes.length; curr = curr.parent) {\n                        if (curr === scopes[i_2]) {\n                            // Copy current contents of seenTypeParameterUsages into scope.\n                            seenTypeParameterUsages.forEach(function (typeParameter, id) {\n                                usagesPerScope[i_2].typeParameterUsages.set(id, typeParameter);\n                            });\n                            i_2++;\n                        }\n                        // Note that we add the current node's type parameters *after* updating the corresponding scope.\n                        if (ts.isDeclarationWithTypeParameters(curr)) {\n                            for (var _a = 0, _b = ts.getEffectiveTypeParameterDeclarations(curr); _a < _b.length; _a++) {\n                                var typeParameterDecl = _b[_a];\n                                var typeParameter = checker.getTypeAtLocation(typeParameterDecl);\n                                if (allTypeParameterUsages.has(typeParameter.id.toString())) {\n                                    seenTypeParameterUsages.set(typeParameter.id.toString(), typeParameter);\n                                }\n                            }\n                        }\n                    }\n                    // If we didn't get through all the scopes, then there were some that weren't in our\n                    // parent chain (impossible at time of writing).  A conservative solution would be to\n                    // copy allTypeParameterUsages into all remaining scopes.\n                    ts.Debug.assert(i_2 === scopes.length, \"Should have iterated all scopes\");\n                }\n                // If there are any declarations in the extracted block that are used in the same enclosing\n                // lexical scope, we can't move the extraction \"up\" as those declarations will become unreachable\n                if (visibleDeclarationsInExtractedRange.length) {\n                    var containingLexicalScopeOfExtraction = ts.isBlockScope(scopes[0], scopes[0].parent)\n                        ? scopes[0]\n                        : ts.getEnclosingBlockScopeContainer(scopes[0]);\n                    ts.forEachChild(containingLexicalScopeOfExtraction, checkForUsedDeclarations);\n                }\n                var _loop_16 = function (i) {\n                    var scopeUsages = usagesPerScope[i];\n                    // Special case: in the innermost scope, all usages are available.\n                    // (The computed value reflects the value at the top-level of the scope, but the\n                    // local will actually be declared at the same level as the extracted expression).\n                    if (i > 0 && (scopeUsages.usages.size > 0 || scopeUsages.typeParameterUsages.size > 0)) {\n                        var errorNode = isReadonlyArray(targetRange.range) ? targetRange.range[0] : targetRange.range;\n                        constantErrorsPerScope[i].push(ts.createDiagnosticForNode(errorNode, Messages.cannotAccessVariablesFromNestedScopes));\n                    }\n                    var hasWrite = false;\n                    var readonlyClassPropertyWrite;\n                    usagesPerScope[i].usages.forEach(function (value) {\n                        if (value.usage === 2 /* Write */) {\n                            hasWrite = true;\n                            if (value.symbol.flags & 106500 /* ClassMember */ &&\n                                value.symbol.valueDeclaration &&\n                                ts.hasEffectiveModifier(value.symbol.valueDeclaration, 64 /* Readonly */)) {\n                                readonlyClassPropertyWrite = value.symbol.valueDeclaration;\n                            }\n                        }\n                    });\n                    // If an expression was extracted, then there shouldn't have been any variable declarations.\n                    ts.Debug.assert(isReadonlyArray(targetRange.range) || exposedVariableDeclarations.length === 0, \"No variable declarations expected if something was extracted\");\n                    if (hasWrite && !isReadonlyArray(targetRange.range)) {\n                        var diag = ts.createDiagnosticForNode(targetRange.range, Messages.cannotWriteInExpression);\n                        functionErrorsPerScope[i].push(diag);\n                        constantErrorsPerScope[i].push(diag);\n                    }\n                    else if (readonlyClassPropertyWrite && i > 0) {\n                        var diag = ts.createDiagnosticForNode(readonlyClassPropertyWrite, Messages.cannotExtractReadonlyPropertyInitializerOutsideConstructor);\n                        functionErrorsPerScope[i].push(diag);\n                        constantErrorsPerScope[i].push(diag);\n                    }\n                    else if (firstExposedNonVariableDeclaration) {\n                        var diag = ts.createDiagnosticForNode(firstExposedNonVariableDeclaration, Messages.cannotExtractExportedEntity);\n                        functionErrorsPerScope[i].push(diag);\n                        constantErrorsPerScope[i].push(diag);\n                    }\n                };\n                for (var i = 0; i < scopes.length; i++) {\n                    _loop_16(i);\n                }\n                return { target: target, usagesPerScope: usagesPerScope, functionErrorsPerScope: functionErrorsPerScope, constantErrorsPerScope: constantErrorsPerScope, exposedVariableDeclarations: exposedVariableDeclarations };\n                function isInGenericContext(node) {\n                    return !!ts.findAncestor(node, function (n) { return ts.isDeclarationWithTypeParameters(n) && ts.getEffectiveTypeParameterDeclarations(n).length !== 0; });\n                }\n                function recordTypeParameterUsages(type) {\n                    // PERF: This is potentially very expensive.  `type` could be a library type with\n                    // a lot of properties, each of which the walker will visit.  Unfortunately, the\n                    // solution isn't as trivial as filtering to user types because of (e.g.) Array.\n                    var symbolWalker = checker.getSymbolWalker(function () { return (cancellationToken.throwIfCancellationRequested(), true); });\n                    var visitedTypes = symbolWalker.walkType(type).visitedTypes;\n                    for (var _i = 0, visitedTypes_1 = visitedTypes; _i < visitedTypes_1.length; _i++) {\n                        var visitedType = visitedTypes_1[_i];\n                        if (visitedType.isTypeParameter()) {\n                            allTypeParameterUsages.set(visitedType.id.toString(), visitedType);\n                        }\n                    }\n                }\n                function collectUsages(node, valueUsage) {\n                    if (valueUsage === void 0) { valueUsage = 1 /* Read */; }\n                    if (inGenericContext) {\n                        var type = checker.getTypeAtLocation(node);\n                        recordTypeParameterUsages(type);\n                    }\n                    if (ts.isDeclaration(node) && node.symbol) {\n                        visibleDeclarationsInExtractedRange.push(node);\n                    }\n                    if (ts.isAssignmentExpression(node)) {\n                        // use 'write' as default usage for values\n                        collectUsages(node.left, 2 /* Write */);\n                        collectUsages(node.right);\n                    }\n                    else if (ts.isUnaryExpressionWithWrite(node)) {\n                        collectUsages(node.operand, 2 /* Write */);\n                    }\n                    else if (ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) {\n                        // use 'write' as default usage for values\n                        ts.forEachChild(node, collectUsages);\n                    }\n                    else if (ts.isIdentifier(node)) {\n                        if (!node.parent) {\n                            return;\n                        }\n                        if (ts.isQualifiedName(node.parent) && node !== node.parent.left) {\n                            return;\n                        }\n                        if (ts.isPropertyAccessExpression(node.parent) && node !== node.parent.expression) {\n                            return;\n                        }\n                        recordUsage(node, valueUsage, /*isTypeNode*/ ts.isPartOfTypeNode(node));\n                    }\n                    else {\n                        ts.forEachChild(node, collectUsages);\n                    }\n                }\n                function recordUsage(n, usage, isTypeNode) {\n                    var symbolId = recordUsagebySymbol(n, usage, isTypeNode);\n                    if (symbolId) {\n                        for (var i = 0; i < scopes.length; i++) {\n                            // push substitution from map<symbolId, subst> to map<nodeId, subst> to simplify rewriting\n                            var substitution = substitutionsPerScope[i].get(symbolId);\n                            if (substitution) {\n                                usagesPerScope[i].substitutions.set(ts.getNodeId(n).toString(), substitution);\n                            }\n                        }\n                    }\n                }\n                function recordUsagebySymbol(identifier, usage, isTypeName) {\n                    var symbol = getSymbolReferencedByIdentifier(identifier);\n                    if (!symbol) {\n                        // cannot find symbol - do nothing\n                        return undefined;\n                    }\n                    var symbolId = ts.getSymbolId(symbol).toString();\n                    var lastUsage = seenUsages.get(symbolId);\n                    // there are two kinds of value usages\n                    // - reads - if range contains a read from the value located outside of the range then value should be passed as a parameter\n                    // - writes - if range contains a write to a value located outside the range the value should be passed as a parameter and\n                    //   returned as a return value\n                    // 'write' case is a superset of 'read' so if we already have processed 'write' of some symbol there is not need to handle 'read'\n                    // since all information is already recorded\n                    if (lastUsage && lastUsage >= usage) {\n                        return symbolId;\n                    }\n                    seenUsages.set(symbolId, usage);\n                    if (lastUsage) {\n                        // if we get here this means that we are trying to handle 'write' and 'read' was already processed\n                        // walk scopes and update existing records.\n                        for (var _i = 0, usagesPerScope_1 = usagesPerScope; _i < usagesPerScope_1.length; _i++) {\n                            var perScope = usagesPerScope_1[_i];\n                            var prevEntry = perScope.usages.get(identifier.text);\n                            if (prevEntry) {\n                                perScope.usages.set(identifier.text, { usage: usage, symbol: symbol, node: identifier });\n                            }\n                        }\n                        return symbolId;\n                    }\n                    // find first declaration in this file\n                    var decls = symbol.getDeclarations();\n                    var declInFile = decls && ts.find(decls, function (d) { return d.getSourceFile() === sourceFile; });\n                    if (!declInFile) {\n                        return undefined;\n                    }\n                    if (ts.rangeContainsStartEnd(enclosingTextRange, declInFile.getStart(), declInFile.end)) {\n                        // declaration is located in range to be extracted - do nothing\n                        return undefined;\n                    }\n                    if (targetRange.facts & RangeFacts.IsGenerator && usage === 2 /* Write */) {\n                        // this is write to a reference located outside of the target scope and range is extracted into generator\n                        // currently this is unsupported scenario\n                        var diag = ts.createDiagnosticForNode(identifier, Messages.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators);\n                        for (var _a = 0, functionErrorsPerScope_1 = functionErrorsPerScope; _a < functionErrorsPerScope_1.length; _a++) {\n                            var errors = functionErrorsPerScope_1[_a];\n                            errors.push(diag);\n                        }\n                        for (var _b = 0, constantErrorsPerScope_1 = constantErrorsPerScope; _b < constantErrorsPerScope_1.length; _b++) {\n                            var errors = constantErrorsPerScope_1[_b];\n                            errors.push(diag);\n                        }\n                    }\n                    for (var i = 0; i < scopes.length; i++) {\n                        var scope = scopes[i];\n                        var resolvedSymbol = checker.resolveName(symbol.name, scope, symbol.flags, /*excludeGlobals*/ false);\n                        if (resolvedSymbol === symbol) {\n                            continue;\n                        }\n                        if (!substitutionsPerScope[i].has(symbolId)) {\n                            var substitution = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.exportSymbol || symbol, scope, isTypeName);\n                            if (substitution) {\n                                substitutionsPerScope[i].set(symbolId, substitution);\n                            }\n                            else if (isTypeName) {\n                                // If the symbol is a type parameter that won't be in scope, we'll pass it as a type argument\n                                // so there's no problem.\n                                if (!(symbol.flags & 262144 /* TypeParameter */)) {\n                                    var diag = ts.createDiagnosticForNode(identifier, Messages.typeWillNotBeVisibleInTheNewScope);\n                                    functionErrorsPerScope[i].push(diag);\n                                    constantErrorsPerScope[i].push(diag);\n                                }\n                            }\n                            else {\n                                usagesPerScope[i].usages.set(identifier.text, { usage: usage, symbol: symbol, node: identifier });\n                            }\n                        }\n                    }\n                    return symbolId;\n                }\n                function checkForUsedDeclarations(node) {\n                    // If this node is entirely within the original extraction range, we don't need to do anything.\n                    if (node === targetRange.range || (isReadonlyArray(targetRange.range) && targetRange.range.indexOf(node) >= 0)) {\n                        return;\n                    }\n                    // Otherwise check and recurse.\n                    var sym = ts.isIdentifier(node)\n                        ? getSymbolReferencedByIdentifier(node)\n                        : checker.getSymbolAtLocation(node);\n                    if (sym) {\n                        var decl = ts.find(visibleDeclarationsInExtractedRange, function (d) { return d.symbol === sym; });\n                        if (decl) {\n                            if (ts.isVariableDeclaration(decl)) {\n                                var idString = decl.symbol.id.toString();\n                                if (!exposedVariableSymbolSet.has(idString)) {\n                                    exposedVariableDeclarations.push(decl);\n                                    exposedVariableSymbolSet.set(idString, true);\n                                }\n                            }\n                            else {\n                                // CONSIDER: this includes binding elements, which we could\n                                // expose in the same way as variables.\n                                firstExposedNonVariableDeclaration = firstExposedNonVariableDeclaration || decl;\n                            }\n                        }\n                    }\n                    ts.forEachChild(node, checkForUsedDeclarations);\n                }\n                /**\n                 * Return the symbol referenced by an identifier (even if it declares a different symbol).\n                 */\n                function getSymbolReferencedByIdentifier(identifier) {\n                    // If the identifier is both a property name and its value, we're only interested in its value\n                    // (since the name is a declaration and will be included in the extracted range).\n                    return identifier.parent && ts.isShorthandPropertyAssignment(identifier.parent) && identifier.parent.name === identifier\n                        ? checker.getShorthandAssignmentValueSymbol(identifier.parent)\n                        : checker.getSymbolAtLocation(identifier);\n                }\n                function tryReplaceWithQualifiedNameOrPropertyAccess(symbol, scopeDecl, isTypeNode) {\n                    if (!symbol) {\n                        return undefined;\n                    }\n                    var decls = symbol.getDeclarations();\n                    if (decls && decls.some(function (d) { return d.parent === scopeDecl; })) {\n                        return ts.factory.createIdentifier(symbol.name);\n                    }\n                    var prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode);\n                    if (prefix === undefined) {\n                        return undefined;\n                    }\n                    return isTypeNode\n                        ? ts.factory.createQualifiedName(prefix, ts.factory.createIdentifier(symbol.name))\n                        : ts.factory.createPropertyAccessExpression(prefix, symbol.name);\n                }\n            }\n            function getExtractableParent(node) {\n                return ts.findAncestor(node, function (node) { return node.parent && isExtractableExpression(node) && !ts.isBinaryExpression(node.parent); });\n            }\n            /**\n             * Computes whether or not a node represents an expression in a position where it could\n             * be extracted.\n             * The isExpression() in utilities.ts returns some false positives we need to handle,\n             * such as `import x from 'y'` -- the 'y' is a StringLiteral but is *not* an expression\n             * in the sense of something that you could extract on\n             */\n            function isExtractableExpression(node) {\n                var parent = node.parent;\n                switch (parent.kind) {\n                    case 291 /* EnumMember */:\n                        return false;\n                }\n                switch (node.kind) {\n                    case 10 /* StringLiteral */:\n                        return parent.kind !== 261 /* ImportDeclaration */ &&\n                            parent.kind !== 265 /* ImportSpecifier */;\n                    case 220 /* SpreadElement */:\n                    case 196 /* ObjectBindingPattern */:\n                    case 198 /* BindingElement */:\n                        return false;\n                    case 78 /* Identifier */:\n                        return parent.kind !== 198 /* BindingElement */ &&\n                            parent.kind !== 265 /* ImportSpecifier */ &&\n                            parent.kind !== 270 /* ExportSpecifier */;\n                }\n                return true;\n            }\n            function isBlockLike(node) {\n                switch (node.kind) {\n                    case 230 /* Block */:\n                    case 297 /* SourceFile */:\n                    case 257 /* ModuleBlock */:\n                    case 284 /* CaseClause */:\n                        return true;\n                    default:\n                        return false;\n                }\n            }\n            function isInJSXContent(node) {\n                return (ts.isJsxElement(node) || ts.isJsxSelfClosingElement(node) || ts.isJsxFragment(node)) && ts.isJsxElement(node.parent);\n            }\n        })(extractSymbol = refactor.extractSymbol || (refactor.extractSymbol = {}));\n    })(refactor = ts.refactor || (ts.refactor = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var refactor;\n    (function (refactor) {\n        var refactorName = \"Extract type\";\n        var extractToTypeAliasAction = {\n            name: \"Extract to type alias\",\n            description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_to_type_alias),\n            kind: \"refactor.extract.type\",\n        };\n        var extractToInterfaceAction = {\n            name: \"Extract to interface\",\n            description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_to_interface),\n            kind: \"refactor.extract.interface\",\n        };\n        var extractToTypeDefAction = {\n            name: \"Extract to typedef\",\n            description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_to_typedef),\n            kind: \"refactor.extract.typedef\"\n        };\n        refactor.registerRefactor(refactorName, {\n            kinds: [\n                extractToTypeAliasAction.kind,\n                extractToInterfaceAction.kind,\n                extractToTypeDefAction.kind\n            ],\n            getAvailableActions: function (context) {\n                var info = getRangeToExtract(context, context.triggerReason === \"invoked\");\n                if (!info)\n                    return ts.emptyArray;\n                if (!refactor.isRefactorErrorInfo(info)) {\n                    return [{\n                            name: refactorName,\n                            description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_type),\n                            actions: info.isJS ?\n                                [extractToTypeDefAction] : ts.append([extractToTypeAliasAction], info.typeElements && extractToInterfaceAction)\n                        }];\n                }\n                if (context.preferences.provideRefactorNotApplicableReason) {\n                    return [{\n                            name: refactorName,\n                            description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_type),\n                            actions: [\n                                __assign(__assign({}, extractToTypeDefAction), { notApplicableReason: info.error }),\n                                __assign(__assign({}, extractToTypeAliasAction), { notApplicableReason: info.error }),\n                                __assign(__assign({}, extractToInterfaceAction), { notApplicableReason: info.error }),\n                            ]\n                        }];\n                }\n                return ts.emptyArray;\n            },\n            getEditsForAction: function (context, actionName) {\n                var file = context.file;\n                var info = getRangeToExtract(context);\n                ts.Debug.assert(info && !refactor.isRefactorErrorInfo(info), \"Expected to find a range to extract\");\n                var name = ts.getUniqueName(\"NewType\", file);\n                var edits = ts.textChanges.ChangeTracker.with(context, function (changes) {\n                    switch (actionName) {\n                        case extractToTypeAliasAction.name:\n                            ts.Debug.assert(!info.isJS, \"Invalid actionName/JS combo\");\n                            return doTypeAliasChange(changes, file, name, info);\n                        case extractToTypeDefAction.name:\n                            ts.Debug.assert(info.isJS, \"Invalid actionName/JS combo\");\n                            return doTypedefChange(changes, file, name, info);\n                        case extractToInterfaceAction.name:\n                            ts.Debug.assert(!info.isJS && !!info.typeElements, \"Invalid actionName/JS combo\");\n                            return doInterfaceChange(changes, file, name, info);\n                        default:\n                            ts.Debug.fail(\"Unexpected action name\");\n                    }\n                });\n                var renameFilename = file.fileName;\n                var renameLocation = ts.getRenameLocation(edits, renameFilename, name, /*preferLastLocation*/ false);\n                return { edits: edits, renameFilename: renameFilename, renameLocation: renameLocation };\n            }\n        });\n        function getRangeToExtract(context, considerEmptySpans) {\n            if (considerEmptySpans === void 0) { considerEmptySpans = true; }\n            var file = context.file, startPosition = context.startPosition;\n            var isJS = ts.isSourceFileJS(file);\n            var current = ts.getTokenAtPosition(file, startPosition);\n            var range = ts.createTextRangeFromSpan(ts.getRefactorContextSpan(context));\n            var cursorRequest = range.pos === range.end && considerEmptySpans;\n            var selection = ts.findAncestor(current, (function (node) { return node.parent && ts.isTypeNode(node) && !rangeContainsSkipTrivia(range, node.parent, file) &&\n                (cursorRequest || ts.nodeOverlapsWithStartEnd(current, file, range.pos, range.end)); }));\n            if (!selection || !ts.isTypeNode(selection))\n                return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Selection_is_not_a_valid_type_node) };\n            var checker = context.program.getTypeChecker();\n            var firstStatement = ts.Debug.checkDefined(ts.findAncestor(selection, ts.isStatement), \"Should find a statement\");\n            var typeParameters = collectTypeParameters(checker, selection, firstStatement, file);\n            if (!typeParameters)\n                return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.No_type_could_be_extracted_from_this_type_node) };\n            var typeElements = flattenTypeLiteralNodeReference(checker, selection);\n            return { isJS: isJS, selection: selection, firstStatement: firstStatement, typeParameters: typeParameters, typeElements: typeElements };\n        }\n        function flattenTypeLiteralNodeReference(checker, node) {\n            if (!node)\n                return undefined;\n            if (ts.isIntersectionTypeNode(node)) {\n                var result = [];\n                var seen_1 = new ts.Map();\n                for (var _i = 0, _a = node.types; _i < _a.length; _i++) {\n                    var type = _a[_i];\n                    var flattenedTypeMembers = flattenTypeLiteralNodeReference(checker, type);\n                    if (!flattenedTypeMembers || !flattenedTypeMembers.every(function (type) { return type.name && ts.addToSeen(seen_1, ts.getNameFromPropertyName(type.name)); })) {\n                        return undefined;\n                    }\n                    ts.addRange(result, flattenedTypeMembers);\n                }\n                return result;\n            }\n            else if (ts.isParenthesizedTypeNode(node)) {\n                return flattenTypeLiteralNodeReference(checker, node.type);\n            }\n            else if (ts.isTypeLiteralNode(node)) {\n                return node.members;\n            }\n            return undefined;\n        }\n        function rangeContainsSkipTrivia(r1, node, file) {\n            return ts.rangeContainsStartEnd(r1, ts.skipTrivia(file.text, node.pos), node.end);\n        }\n        function collectTypeParameters(checker, selection, statement, file) {\n            var result = [];\n            return visitor(selection) ? undefined : result;\n            function visitor(node) {\n                if (ts.isTypeReferenceNode(node)) {\n                    if (ts.isIdentifier(node.typeName)) {\n                        var symbol = checker.resolveName(node.typeName.text, node.typeName, 262144 /* TypeParameter */, /* excludeGlobals */ true);\n                        if (symbol) {\n                            var declaration = ts.cast(ts.first(symbol.declarations), ts.isTypeParameterDeclaration);\n                            if (rangeContainsSkipTrivia(statement, declaration, file) && !rangeContainsSkipTrivia(selection, declaration, file)) {\n                                ts.pushIfUnique(result, declaration);\n                            }\n                        }\n                    }\n                }\n                else if (ts.isInferTypeNode(node)) {\n                    var conditionalTypeNode = ts.findAncestor(node, function (n) { return ts.isConditionalTypeNode(n) && rangeContainsSkipTrivia(n.extendsType, node, file); });\n                    if (!conditionalTypeNode || !rangeContainsSkipTrivia(selection, conditionalTypeNode, file)) {\n                        return true;\n                    }\n                }\n                else if ((ts.isTypePredicateNode(node) || ts.isThisTypeNode(node))) {\n                    var functionLikeNode = ts.findAncestor(node.parent, ts.isFunctionLike);\n                    if (functionLikeNode && functionLikeNode.type && rangeContainsSkipTrivia(functionLikeNode.type, node, file) && !rangeContainsSkipTrivia(selection, functionLikeNode, file)) {\n                        return true;\n                    }\n                }\n                else if (ts.isTypeQueryNode(node)) {\n                    if (ts.isIdentifier(node.exprName)) {\n                        var symbol = checker.resolveName(node.exprName.text, node.exprName, 111551 /* Value */, /* excludeGlobals */ false);\n                        if (symbol && rangeContainsSkipTrivia(statement, symbol.valueDeclaration, file) && !rangeContainsSkipTrivia(selection, symbol.valueDeclaration, file)) {\n                            return true;\n                        }\n                    }\n                    else {\n                        if (ts.isThisIdentifier(node.exprName.left) && !rangeContainsSkipTrivia(selection, node.parent, file)) {\n                            return true;\n                        }\n                    }\n                }\n                if (file && ts.isTupleTypeNode(node) && (ts.getLineAndCharacterOfPosition(file, node.pos).line === ts.getLineAndCharacterOfPosition(file, node.end).line)) {\n                    ts.setEmitFlags(node, 1 /* SingleLine */);\n                }\n                return ts.forEachChild(node, visitor);\n            }\n        }\n        function doTypeAliasChange(changes, file, name, info) {\n            var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters;\n            var newTypeNode = ts.factory.createTypeAliasDeclaration(\n            /* decorators */ undefined, \n            /* modifiers */ undefined, name, typeParameters.map(function (id) { return ts.factory.updateTypeParameterDeclaration(id, id.name, id.constraint, /* defaultType */ undefined); }), selection);\n            changes.insertNodeBefore(file, firstStatement, ts.ignoreSourceNewlines(newTypeNode), /* blankLineBetween */ true);\n            changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); })), { leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude, trailingTriviaOption: ts.textChanges.TrailingTriviaOption.ExcludeWhitespace });\n        }\n        function doInterfaceChange(changes, file, name, info) {\n            var _a;\n            var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters, typeElements = info.typeElements;\n            var newTypeNode = ts.factory.createInterfaceDeclaration(\n            /* decorators */ undefined, \n            /* modifiers */ undefined, name, typeParameters, \n            /* heritageClauses */ undefined, typeElements);\n            ts.setTextRange(newTypeNode, (_a = typeElements[0]) === null || _a === void 0 ? void 0 : _a.parent);\n            changes.insertNodeBefore(file, firstStatement, ts.ignoreSourceNewlines(newTypeNode), /* blankLineBetween */ true);\n            changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); })), { leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude, trailingTriviaOption: ts.textChanges.TrailingTriviaOption.ExcludeWhitespace });\n        }\n        function doTypedefChange(changes, file, name, info) {\n            var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters;\n            var node = ts.factory.createJSDocTypedefTag(ts.factory.createIdentifier(\"typedef\"), ts.factory.createJSDocTypeExpression(selection), ts.factory.createIdentifier(name));\n            var templates = [];\n            ts.forEach(typeParameters, function (typeParameter) {\n                var constraint = ts.getEffectiveConstraintOfTypeParameter(typeParameter);\n                var parameter = ts.factory.createTypeParameterDeclaration(typeParameter.name);\n                var template = ts.factory.createJSDocTemplateTag(ts.factory.createIdentifier(\"template\"), constraint && ts.cast(constraint, ts.isJSDocTypeExpression), [parameter]);\n                templates.push(template);\n            });\n            changes.insertNodeBefore(file, firstStatement, ts.factory.createJSDocComment(/* comment */ undefined, ts.factory.createNodeArray(ts.concatenate(templates, [node]))), /* blankLineBetween */ true);\n            changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); })));\n        }\n    })(refactor = ts.refactor || (ts.refactor = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var refactor;\n    (function (refactor) {\n        var generateGetAccessorAndSetAccessor;\n        (function (generateGetAccessorAndSetAccessor) {\n            var actionName = \"Generate 'get' and 'set' accessors\";\n            var actionDescription = ts.Diagnostics.Generate_get_and_set_accessors.message;\n            var generateGetSetAction = {\n                name: actionName,\n                description: actionDescription,\n                kind: \"refactor.rewrite.property.generateAccessors\",\n            };\n            refactor.registerRefactor(actionName, {\n                kinds: [generateGetSetAction.kind],\n                getEditsForAction: function (context, actionName) {\n                    if (!context.endPosition)\n                        return undefined;\n                    var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.program, context.startPosition, context.endPosition);\n                    ts.Debug.assert(info && !refactor.isRefactorErrorInfo(info), \"Expected applicable refactor info\");\n                    var edits = ts.codefix.generateAccessorFromProperty(context.file, context.program, context.startPosition, context.endPosition, context, actionName);\n                    if (!edits)\n                        return undefined;\n                    var renameFilename = context.file.fileName;\n                    var nameNeedRename = info.renameAccessor ? info.accessorName : info.fieldName;\n                    var renameLocationOffset = ts.isIdentifier(nameNeedRename) ? 0 : -1;\n                    var renameLocation = renameLocationOffset + ts.getRenameLocation(edits, renameFilename, nameNeedRename.text, /*preferLastLocation*/ ts.isParameter(info.declaration));\n                    return { renameFilename: renameFilename, renameLocation: renameLocation, edits: edits };\n                },\n                getAvailableActions: function (context) {\n                    if (!context.endPosition)\n                        return ts.emptyArray;\n                    var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.program, context.startPosition, context.endPosition, context.triggerReason === \"invoked\");\n                    if (!info)\n                        return ts.emptyArray;\n                    if (!refactor.isRefactorErrorInfo(info)) {\n                        return [{\n                                name: actionName,\n                                description: actionDescription,\n                                actions: [generateGetSetAction],\n                            }];\n                    }\n                    if (context.preferences.provideRefactorNotApplicableReason) {\n                        return [{\n                                name: actionName,\n                                description: actionDescription,\n                                actions: [__assign(__assign({}, generateGetSetAction), { notApplicableReason: info.error })],\n                            }];\n                    }\n                    return ts.emptyArray;\n                }\n            });\n        })(generateGetAccessorAndSetAccessor = refactor.generateGetAccessorAndSetAccessor || (refactor.generateGetAccessorAndSetAccessor = {}));\n    })(refactor = ts.refactor || (ts.refactor = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var refactor;\n    (function (refactor) {\n        ;\n        /**\n         * Checks if some refactor info has refactor error info.\n         */\n        function isRefactorErrorInfo(info) {\n            return info.error !== undefined;\n        }\n        refactor.isRefactorErrorInfo = isRefactorErrorInfo;\n        /**\n         * Checks if string \"known\" begins with string \"requested\".\n         * Used to match requested kinds with a known kind.\n         */\n        function refactorKindBeginsWith(known, requested) {\n            if (!requested)\n                return true;\n            return known.substr(0, requested.length) === requested;\n        }\n        refactor.refactorKindBeginsWith = refactorKindBeginsWith;\n    })(refactor = ts.refactor || (ts.refactor = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var refactor;\n    (function (refactor) {\n        var refactorName = \"Move to a new file\";\n        var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Move_to_a_new_file);\n        var moveToNewFileAction = {\n            name: refactorName,\n            description: description,\n            kind: \"refactor.move.newFile\",\n        };\n        refactor.registerRefactor(refactorName, {\n            kinds: [moveToNewFileAction.kind],\n            getAvailableActions: function (context) {\n                var statements = getStatementsToMove(context);\n                if (context.preferences.allowTextChangesInNewFiles && statements) {\n                    return [{ name: refactorName, description: description, actions: [moveToNewFileAction] }];\n                }\n                if (context.preferences.provideRefactorNotApplicableReason) {\n                    return [{ name: refactorName, description: description, actions: [__assign(__assign({}, moveToNewFileAction), { notApplicableReason: ts.getLocaleSpecificMessage(ts.Diagnostics.Selection_is_not_a_valid_statement_or_statements) })]\n                        }];\n                }\n                return ts.emptyArray;\n            },\n            getEditsForAction: function (context, actionName) {\n                ts.Debug.assert(actionName === refactorName, \"Wrong refactor invoked\");\n                var statements = ts.Debug.checkDefined(getStatementsToMove(context));\n                var edits = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(context.file, context.program, statements, t, context.host, context.preferences); });\n                return { edits: edits, renameFilename: undefined, renameLocation: undefined };\n            }\n        });\n        function getRangeToMove(context) {\n            var file = context.file;\n            var range = ts.createTextRangeFromSpan(ts.getRefactorContextSpan(context));\n            var statements = file.statements;\n            var startNodeIndex = ts.findIndex(statements, function (s) { return s.end > range.pos; });\n            if (startNodeIndex === -1)\n                return undefined;\n            var startStatement = statements[startNodeIndex];\n            if (ts.isNamedDeclaration(startStatement) && startStatement.name && ts.rangeContainsRange(startStatement.name, range)) {\n                return { toMove: [statements[startNodeIndex]], afterLast: statements[startNodeIndex + 1] };\n            }\n            // Can't only partially include the start node or be partially into the next node\n            if (range.pos > startStatement.getStart(file))\n                return undefined;\n            var afterEndNodeIndex = ts.findIndex(statements, function (s) { return s.end > range.end; }, startNodeIndex);\n            // Can't be partially into the next node\n            if (afterEndNodeIndex !== -1 && (afterEndNodeIndex === 0 || statements[afterEndNodeIndex].getStart(file) < range.end))\n                return undefined;\n            return {\n                toMove: statements.slice(startNodeIndex, afterEndNodeIndex === -1 ? statements.length : afterEndNodeIndex),\n                afterLast: afterEndNodeIndex === -1 ? undefined : statements[afterEndNodeIndex],\n            };\n        }\n        function doChange(oldFile, program, toMove, changes, host, preferences) {\n            var checker = program.getTypeChecker();\n            var usage = getUsageInfo(oldFile, toMove.all, checker);\n            var currentDirectory = ts.getDirectoryPath(oldFile.fileName);\n            var extension = ts.extensionFromPath(oldFile.fileName);\n            var newModuleName = makeUniqueModuleName(getNewModuleName(usage.movedSymbols), extension, currentDirectory, host);\n            var newFileNameWithExtension = newModuleName + extension;\n            // If previous file was global, this is easy.\n            changes.createNewFile(oldFile, ts.combinePaths(currentDirectory, newFileNameWithExtension), getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, newModuleName, preferences));\n            addNewFileToTsconfig(program, changes, oldFile.fileName, newFileNameWithExtension, ts.hostGetCanonicalFileName(host));\n        }\n        function getStatementsToMove(context) {\n            var rangeToMove = getRangeToMove(context);\n            if (rangeToMove === undefined)\n                return undefined;\n            var all = [];\n            var ranges = [];\n            var toMove = rangeToMove.toMove, afterLast = rangeToMove.afterLast;\n            ts.getRangesWhere(toMove, isAllowedStatementToMove, function (start, afterEndIndex) {\n                for (var i = start; i < afterEndIndex; i++)\n                    all.push(toMove[i]);\n                ranges.push({ first: toMove[start], afterLast: afterLast });\n            });\n            return all.length === 0 ? undefined : { all: all, ranges: ranges };\n        }\n        function isAllowedStatementToMove(statement) {\n            // Filters imports and prologue directives out of the range of statements to move.\n            // Imports will be copied to the new file anyway, and may still be needed in the old file.\n            // Prologue directives will be copied to the new file and should be left in the old file.\n            return !isPureImport(statement) && !ts.isPrologueDirective(statement);\n            ;\n        }\n        function isPureImport(node) {\n            switch (node.kind) {\n                case 261 /* ImportDeclaration */:\n                    return true;\n                case 260 /* ImportEqualsDeclaration */:\n                    return !ts.hasSyntacticModifier(node, 1 /* Export */);\n                case 232 /* VariableStatement */:\n                    return node.declarationList.declarations.every(function (d) { return !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true); });\n                default:\n                    return false;\n            }\n        }\n        function addNewFileToTsconfig(program, changes, oldFileName, newFileNameWithExtension, getCanonicalFileName) {\n            var cfg = program.getCompilerOptions().configFile;\n            if (!cfg)\n                return;\n            var newFileAbsolutePath = ts.normalizePath(ts.combinePaths(oldFileName, \"..\", newFileNameWithExtension));\n            var newFilePath = ts.getRelativePathFromFile(cfg.fileName, newFileAbsolutePath, getCanonicalFileName);\n            var cfgObject = cfg.statements[0] && ts.tryCast(cfg.statements[0].expression, ts.isObjectLiteralExpression);\n            var filesProp = cfgObject && ts.find(cfgObject.properties, function (prop) {\n                return ts.isPropertyAssignment(prop) && ts.isStringLiteral(prop.name) && prop.name.text === \"files\";\n            });\n            if (filesProp && ts.isArrayLiteralExpression(filesProp.initializer)) {\n                changes.insertNodeInListAfter(cfg, ts.last(filesProp.initializer.elements), ts.factory.createStringLiteral(newFilePath), filesProp.initializer.elements);\n            }\n        }\n        function getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, newModuleName, preferences) {\n            var checker = program.getTypeChecker();\n            var prologueDirectives = ts.takeWhile(oldFile.statements, ts.isPrologueDirective);\n            if (!oldFile.externalModuleIndicator && !oldFile.commonJsModuleIndicator) {\n                deleteMovedStatements(oldFile, toMove.ranges, changes);\n                return __spreadArray(__spreadArray([], prologueDirectives), toMove.all);\n            }\n            var useEs6ModuleSyntax = !!oldFile.externalModuleIndicator;\n            var quotePreference = ts.getQuotePreference(oldFile, preferences);\n            var importsFromNewFile = createOldFileImportsFromNewFile(usage.oldFileImportsFromNewFile, newModuleName, useEs6ModuleSyntax, quotePreference);\n            if (importsFromNewFile) {\n                ts.insertImports(changes, oldFile, importsFromNewFile, /*blankLineBetween*/ true);\n            }\n            deleteUnusedOldImports(oldFile, toMove.all, changes, usage.unusedImportsFromOldFile, checker);\n            deleteMovedStatements(oldFile, toMove.ranges, changes);\n            updateImportsInOtherFiles(changes, program, oldFile, usage.movedSymbols, newModuleName);\n            var imports = getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax, quotePreference);\n            var body = addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEs6ModuleSyntax);\n            if (imports.length && body.length) {\n                return __spreadArray(__spreadArray(__spreadArray(__spreadArray([], prologueDirectives), imports), [\n                    4 /* NewLineTrivia */\n                ]), body);\n            }\n            return __spreadArray(__spreadArray(__spreadArray([], prologueDirectives), imports), body);\n        }\n        function deleteMovedStatements(sourceFile, moved, changes) {\n            for (var _i = 0, moved_1 = moved; _i < moved_1.length; _i++) {\n                var _a = moved_1[_i], first_1 = _a.first, afterLast = _a.afterLast;\n                changes.deleteNodeRangeExcludingEnd(sourceFile, first_1, afterLast);\n            }\n        }\n        function deleteUnusedOldImports(oldFile, toMove, changes, toDelete, checker) {\n            for (var _i = 0, _a = oldFile.statements; _i < _a.length; _i++) {\n                var statement = _a[_i];\n                if (ts.contains(toMove, statement))\n                    continue;\n                forEachImportInStatement(statement, function (i) { return deleteUnusedImports(oldFile, i, changes, function (name) { return toDelete.has(checker.getSymbolAtLocation(name)); }); });\n            }\n        }\n        function updateImportsInOtherFiles(changes, program, oldFile, movedSymbols, newModuleName) {\n            var checker = program.getTypeChecker();\n            var _loop_17 = function (sourceFile) {\n                if (sourceFile === oldFile)\n                    return \"continue\";\n                var _loop_18 = function (statement) {\n                    forEachImportInStatement(statement, function (importNode) {\n                        if (checker.getSymbolAtLocation(moduleSpecifierFromImport(importNode)) !== oldFile.symbol)\n                            return;\n                        var shouldMove = function (name) {\n                            var symbol = ts.isBindingElement(name.parent)\n                                ? ts.getPropertySymbolFromBindingElement(checker, name.parent)\n                                : ts.skipAlias(checker.getSymbolAtLocation(name), checker); // TODO: GH#18217\n                            return !!symbol && movedSymbols.has(symbol);\n                        };\n                        deleteUnusedImports(sourceFile, importNode, changes, shouldMove); // These will be changed to imports from the new file\n                        var newModuleSpecifier = ts.combinePaths(ts.getDirectoryPath(moduleSpecifierFromImport(importNode).text), newModuleName);\n                        var newImportDeclaration = filterImport(importNode, ts.factory.createStringLiteral(newModuleSpecifier), shouldMove);\n                        if (newImportDeclaration)\n                            changes.insertNodeAfter(sourceFile, statement, newImportDeclaration);\n                        var ns = getNamespaceLikeImport(importNode);\n                        if (ns)\n                            updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleName, newModuleSpecifier, ns, importNode);\n                    });\n                };\n                for (var _b = 0, _c = sourceFile.statements; _b < _c.length; _b++) {\n                    var statement = _c[_b];\n                    _loop_18(statement);\n                }\n            };\n            for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {\n                var sourceFile = _a[_i];\n                _loop_17(sourceFile);\n            }\n        }\n        function getNamespaceLikeImport(node) {\n            switch (node.kind) {\n                case 261 /* ImportDeclaration */:\n                    return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 263 /* NamespaceImport */ ?\n                        node.importClause.namedBindings.name : undefined;\n                case 260 /* ImportEqualsDeclaration */:\n                    return node.name;\n                case 249 /* VariableDeclaration */:\n                    return ts.tryCast(node.name, ts.isIdentifier);\n                default:\n                    return ts.Debug.assertNever(node, \"Unexpected node kind \" + node.kind);\n            }\n        }\n        function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleName, newModuleSpecifier, oldImportId, oldImportNode) {\n            var preferredNewNamespaceName = ts.codefix.moduleSpecifierToValidIdentifier(newModuleName, 99 /* ESNext */);\n            var needUniqueName = false;\n            var toChange = [];\n            ts.FindAllReferences.Core.eachSymbolReferenceInFile(oldImportId, checker, sourceFile, function (ref) {\n                if (!ts.isPropertyAccessExpression(ref.parent))\n                    return;\n                needUniqueName = needUniqueName || !!checker.resolveName(preferredNewNamespaceName, ref, 67108863 /* All */, /*excludeGlobals*/ true);\n                if (movedSymbols.has(checker.getSymbolAtLocation(ref.parent.name))) {\n                    toChange.push(ref);\n                }\n            });\n            if (toChange.length) {\n                var newNamespaceName = needUniqueName ? ts.getUniqueName(preferredNewNamespaceName, sourceFile) : preferredNewNamespaceName;\n                for (var _i = 0, toChange_1 = toChange; _i < toChange_1.length; _i++) {\n                    var ref = toChange_1[_i];\n                    changes.replaceNode(sourceFile, ref, ts.factory.createIdentifier(newNamespaceName));\n                }\n                changes.insertNodeAfter(sourceFile, oldImportNode, updateNamespaceLikeImportNode(oldImportNode, newModuleName, newModuleSpecifier));\n            }\n        }\n        function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifier) {\n            var newNamespaceId = ts.factory.createIdentifier(newNamespaceName);\n            var newModuleString = ts.factory.createStringLiteral(newModuleSpecifier);\n            switch (node.kind) {\n                case 261 /* ImportDeclaration */:\n                    return ts.factory.createImportDeclaration(\n                    /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, ts.factory.createNamespaceImport(newNamespaceId)), newModuleString);\n                case 260 /* ImportEqualsDeclaration */:\n                    return ts.factory.createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ false, newNamespaceId, ts.factory.createExternalModuleReference(newModuleString));\n                case 249 /* VariableDeclaration */:\n                    return ts.factory.createVariableDeclaration(newNamespaceId, /*exclamationToken*/ undefined, /*type*/ undefined, createRequireCall(newModuleString));\n                default:\n                    return ts.Debug.assertNever(node, \"Unexpected node kind \" + node.kind);\n            }\n        }\n        function moduleSpecifierFromImport(i) {\n            return (i.kind === 261 /* ImportDeclaration */ ? i.moduleSpecifier\n                : i.kind === 260 /* ImportEqualsDeclaration */ ? i.moduleReference.expression\n                    : i.initializer.arguments[0]);\n        }\n        function forEachImportInStatement(statement, cb) {\n            if (ts.isImportDeclaration(statement)) {\n                if (ts.isStringLiteral(statement.moduleSpecifier))\n                    cb(statement);\n            }\n            else if (ts.isImportEqualsDeclaration(statement)) {\n                if (ts.isExternalModuleReference(statement.moduleReference) && ts.isStringLiteralLike(statement.moduleReference.expression)) {\n                    cb(statement);\n                }\n            }\n            else if (ts.isVariableStatement(statement)) {\n                for (var _i = 0, _a = statement.declarationList.declarations; _i < _a.length; _i++) {\n                    var decl = _a[_i];\n                    if (decl.initializer && ts.isRequireCall(decl.initializer, /*checkArgumentIsStringLiteralLike*/ true)) {\n                        cb(decl);\n                    }\n                }\n            }\n        }\n        function createOldFileImportsFromNewFile(newFileNeedExport, newFileNameWithExtension, useEs6Imports, quotePreference) {\n            var defaultImport;\n            var imports = [];\n            newFileNeedExport.forEach(function (symbol) {\n                if (symbol.escapedName === \"default\" /* Default */) {\n                    defaultImport = ts.factory.createIdentifier(ts.symbolNameNoDefault(symbol)); // TODO: GH#18217\n                }\n                else {\n                    imports.push(symbol.name);\n                }\n            });\n            return makeImportOrRequire(defaultImport, imports, newFileNameWithExtension, useEs6Imports, quotePreference);\n        }\n        function makeImportOrRequire(defaultImport, imports, path, useEs6Imports, quotePreference) {\n            path = ts.ensurePathIsNonModuleName(path);\n            if (useEs6Imports) {\n                var specifiers = imports.map(function (i) { return ts.factory.createImportSpecifier(/*propertyName*/ undefined, ts.factory.createIdentifier(i)); });\n                return ts.makeImportIfNecessary(defaultImport, specifiers, path, quotePreference);\n            }\n            else {\n                ts.Debug.assert(!defaultImport, \"No default import should exist\"); // If there's a default export, it should have been an es6 module.\n                var bindingElements = imports.map(function (i) { return ts.factory.createBindingElement(/*dotDotDotToken*/ undefined, /*propertyName*/ undefined, i); });\n                return bindingElements.length\n                    ? makeVariableStatement(ts.factory.createObjectBindingPattern(bindingElements), /*type*/ undefined, createRequireCall(ts.factory.createStringLiteral(path)))\n                    : undefined;\n            }\n        }\n        function makeVariableStatement(name, type, initializer, flags) {\n            if (flags === void 0) { flags = 2 /* Const */; }\n            return ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, type, initializer)], flags));\n        }\n        function createRequireCall(moduleSpecifier) {\n            return ts.factory.createCallExpression(ts.factory.createIdentifier(\"require\"), /*typeArguments*/ undefined, [moduleSpecifier]);\n        }\n        function addExports(sourceFile, toMove, needExport, useEs6Exports) {\n            return ts.flatMap(toMove, function (statement) {\n                if (isTopLevelDeclarationStatement(statement) &&\n                    !isExported(sourceFile, statement, useEs6Exports) &&\n                    forEachTopLevelDeclaration(statement, function (d) { return needExport.has(ts.Debug.checkDefined(d.symbol)); })) {\n                    var exports = addExport(statement, useEs6Exports);\n                    if (exports)\n                        return exports;\n                }\n                return statement;\n            });\n        }\n        function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) {\n            switch (importDecl.kind) {\n                case 261 /* ImportDeclaration */:\n                    deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused);\n                    break;\n                case 260 /* ImportEqualsDeclaration */:\n                    if (isUnused(importDecl.name)) {\n                        changes.delete(sourceFile, importDecl);\n                    }\n                    break;\n                case 249 /* VariableDeclaration */:\n                    deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused);\n                    break;\n                default:\n                    ts.Debug.assertNever(importDecl, \"Unexpected import decl kind \" + importDecl.kind);\n            }\n        }\n        function deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused) {\n            if (!importDecl.importClause)\n                return;\n            var _a = importDecl.importClause, name = _a.name, namedBindings = _a.namedBindings;\n            var defaultUnused = !name || isUnused(name);\n            var namedBindingsUnused = !namedBindings ||\n                (namedBindings.kind === 263 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); }));\n            if (defaultUnused && namedBindingsUnused) {\n                changes.delete(sourceFile, importDecl);\n            }\n            else {\n                if (name && defaultUnused) {\n                    changes.delete(sourceFile, name);\n                }\n                if (namedBindings) {\n                    if (namedBindingsUnused) {\n                        changes.replaceNode(sourceFile, importDecl.importClause, ts.factory.updateImportClause(importDecl.importClause, importDecl.importClause.isTypeOnly, name, /*namedBindings*/ undefined));\n                    }\n                    else if (namedBindings.kind === 264 /* NamedImports */) {\n                        for (var _i = 0, _b = namedBindings.elements; _i < _b.length; _i++) {\n                            var element = _b[_i];\n                            if (isUnused(element.name))\n                                changes.delete(sourceFile, element);\n                        }\n                    }\n                }\n            }\n        }\n        function deleteUnusedImportsInVariableDeclaration(sourceFile, varDecl, changes, isUnused) {\n            var name = varDecl.name;\n            switch (name.kind) {\n                case 78 /* Identifier */:\n                    if (isUnused(name)) {\n                        changes.delete(sourceFile, name);\n                    }\n                    break;\n                case 197 /* ArrayBindingPattern */:\n                    break;\n                case 196 /* ObjectBindingPattern */:\n                    if (name.elements.every(function (e) { return ts.isIdentifier(e.name) && isUnused(e.name); })) {\n                        changes.delete(sourceFile, ts.isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl);\n                    }\n                    else {\n                        for (var _i = 0, _a = name.elements; _i < _a.length; _i++) {\n                            var element = _a[_i];\n                            if (ts.isIdentifier(element.name) && isUnused(element.name)) {\n                                changes.delete(sourceFile, element.name);\n                            }\n                        }\n                    }\n                    break;\n            }\n        }\n        function getNewFileImportsAndAddExportInOldFile(oldFile, importsToCopy, newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax, quotePreference) {\n            var copiedOldImports = [];\n            for (var _i = 0, _a = oldFile.statements; _i < _a.length; _i++) {\n                var oldStatement = _a[_i];\n                forEachImportInStatement(oldStatement, function (i) {\n                    ts.append(copiedOldImports, filterImport(i, moduleSpecifierFromImport(i), function (name) { return importsToCopy.has(checker.getSymbolAtLocation(name)); }));\n                });\n            }\n            // Also, import things used from the old file, and insert 'export' modifiers as necessary in the old file.\n            var oldFileDefault;\n            var oldFileNamedImports = [];\n            var markSeenTop = ts.nodeSeenTracker(); // Needed because multiple declarations may appear in `const x = 0, y = 1;`.\n            newFileImportsFromOldFile.forEach(function (symbol) {\n                for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                    var decl = _a[_i];\n                    if (!isTopLevelDeclaration(decl))\n                        continue;\n                    var name = nameOfTopLevelDeclaration(decl);\n                    if (!name)\n                        continue;\n                    var top = getTopLevelDeclarationStatement(decl);\n                    if (markSeenTop(top)) {\n                        addExportToChanges(oldFile, top, changes, useEs6ModuleSyntax);\n                    }\n                    if (ts.hasSyntacticModifier(decl, 512 /* Default */)) {\n                        oldFileDefault = name;\n                    }\n                    else {\n                        oldFileNamedImports.push(name.text);\n                    }\n                }\n            });\n            ts.append(copiedOldImports, makeImportOrRequire(oldFileDefault, oldFileNamedImports, ts.removeFileExtension(ts.getBaseFileName(oldFile.fileName)), useEs6ModuleSyntax, quotePreference));\n            return copiedOldImports;\n        }\n        function makeUniqueModuleName(moduleName, extension, inDirectory, host) {\n            var newModuleName = moduleName;\n            for (var i = 1;; i++) {\n                var name = ts.combinePaths(inDirectory, newModuleName + extension);\n                if (!host.fileExists(name))\n                    return newModuleName; // TODO: GH#18217\n                newModuleName = moduleName + \".\" + i;\n            }\n        }\n        function getNewModuleName(movedSymbols) {\n            return movedSymbols.forEachEntry(ts.symbolNameNoDefault) || \"newFile\";\n        }\n        function getUsageInfo(oldFile, toMove, checker) {\n            var movedSymbols = new SymbolSet();\n            var oldImportsNeededByNewFile = new SymbolSet();\n            var newFileImportsFromOldFile = new SymbolSet();\n            var containsJsx = ts.find(toMove, function (statement) { return !!(statement.transformFlags & 2 /* ContainsJsx */); });\n            var jsxNamespaceSymbol = getJsxNamespaceSymbol(containsJsx);\n            if (jsxNamespaceSymbol) { // Might not exist (e.g. in non-compiling code)\n                oldImportsNeededByNewFile.add(jsxNamespaceSymbol);\n            }\n            for (var _i = 0, toMove_1 = toMove; _i < toMove_1.length; _i++) {\n                var statement = toMove_1[_i];\n                forEachTopLevelDeclaration(statement, function (decl) {\n                    movedSymbols.add(ts.Debug.checkDefined(ts.isExpressionStatement(decl) ? checker.getSymbolAtLocation(decl.expression.left) : decl.symbol, \"Need a symbol here\"));\n                });\n            }\n            for (var _a = 0, toMove_2 = toMove; _a < toMove_2.length; _a++) {\n                var statement = toMove_2[_a];\n                forEachReference(statement, checker, function (symbol) {\n                    if (!symbol.declarations)\n                        return;\n                    for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {\n                        var decl = _a[_i];\n                        if (isInImport(decl)) {\n                            oldImportsNeededByNewFile.add(symbol);\n                        }\n                        else if (isTopLevelDeclaration(decl) && sourceFileOfTopLevelDeclaration(decl) === oldFile && !movedSymbols.has(symbol)) {\n                            newFileImportsFromOldFile.add(symbol);\n                        }\n                    }\n                });\n            }\n            var unusedImportsFromOldFile = oldImportsNeededByNewFile.clone();\n            var oldFileImportsFromNewFile = new SymbolSet();\n            for (var _b = 0, _c = oldFile.statements; _b < _c.length; _b++) {\n                var statement = _c[_b];\n                if (ts.contains(toMove, statement))\n                    continue;\n                // jsxNamespaceSymbol will only be set iff it is in oldImportsNeededByNewFile.\n                if (jsxNamespaceSymbol && !!(statement.transformFlags & 2 /* ContainsJsx */)) {\n                    unusedImportsFromOldFile.delete(jsxNamespaceSymbol);\n                }\n                forEachReference(statement, checker, function (symbol) {\n                    if (movedSymbols.has(symbol))\n                        oldFileImportsFromNewFile.add(symbol);\n                    unusedImportsFromOldFile.delete(symbol);\n                });\n            }\n            return { movedSymbols: movedSymbols, newFileImportsFromOldFile: newFileImportsFromOldFile, oldFileImportsFromNewFile: oldFileImportsFromNewFile, oldImportsNeededByNewFile: oldImportsNeededByNewFile, unusedImportsFromOldFile: unusedImportsFromOldFile };\n            function getJsxNamespaceSymbol(containsJsx) {\n                if (containsJsx === undefined) {\n                    return undefined;\n                }\n                var jsxNamespace = checker.getJsxNamespace(containsJsx);\n                // Strictly speaking, this could resolve to a symbol other than the JSX namespace.\n                // This will produce erroneous output (probably, an incorrectly copied import) but\n                // is expected to be very rare and easily reversible.\n                var jsxNamespaceSymbol = checker.resolveName(jsxNamespace, containsJsx, 1920 /* Namespace */, /*excludeGlobals*/ true);\n                return !!jsxNamespaceSymbol && ts.some(jsxNamespaceSymbol.declarations, isInImport)\n                    ? jsxNamespaceSymbol\n                    : undefined;\n            }\n        }\n        // Below should all be utilities\n        function isInImport(decl) {\n            switch (decl.kind) {\n                case 260 /* ImportEqualsDeclaration */:\n                case 265 /* ImportSpecifier */:\n                case 262 /* ImportClause */:\n                case 263 /* NamespaceImport */:\n                    return true;\n                case 249 /* VariableDeclaration */:\n                    return isVariableDeclarationInImport(decl);\n                case 198 /* BindingElement */:\n                    return ts.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent);\n                default:\n                    return false;\n            }\n        }\n        function isVariableDeclarationInImport(decl) {\n            return ts.isSourceFile(decl.parent.parent.parent) &&\n                !!decl.initializer && ts.isRequireCall(decl.initializer, /*checkArgumentIsStringLiteralLike*/ true);\n        }\n        function filterImport(i, moduleSpecifier, keep) {\n            switch (i.kind) {\n                case 261 /* ImportDeclaration */: {\n                    var clause = i.importClause;\n                    if (!clause)\n                        return undefined;\n                    var defaultImport = clause.name && keep(clause.name) ? clause.name : undefined;\n                    var namedBindings = clause.namedBindings && filterNamedBindings(clause.namedBindings, keep);\n                    return defaultImport || namedBindings\n                        ? ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, defaultImport, namedBindings), moduleSpecifier)\n                        : undefined;\n                }\n                case 260 /* ImportEqualsDeclaration */:\n                    return keep(i.name) ? i : undefined;\n                case 249 /* VariableDeclaration */: {\n                    var name = filterBindingName(i.name, keep);\n                    return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined;\n                }\n                default:\n                    return ts.Debug.assertNever(i, \"Unexpected import kind \" + i.kind);\n            }\n        }\n        function filterNamedBindings(namedBindings, keep) {\n            if (namedBindings.kind === 263 /* NamespaceImport */) {\n                return keep(namedBindings.name) ? namedBindings : undefined;\n            }\n            else {\n                var newElements = namedBindings.elements.filter(function (e) { return keep(e.name); });\n                return newElements.length ? ts.factory.createNamedImports(newElements) : undefined;\n            }\n        }\n        function filterBindingName(name, keep) {\n            switch (name.kind) {\n                case 78 /* Identifier */:\n                    return keep(name) ? name : undefined;\n                case 197 /* ArrayBindingPattern */:\n                    return name;\n                case 196 /* ObjectBindingPattern */: {\n                    // We can't handle nested destructurings or property names well here, so just copy them all.\n                    var newElements = name.elements.filter(function (prop) { return prop.propertyName || !ts.isIdentifier(prop.name) || keep(prop.name); });\n                    return newElements.length ? ts.factory.createObjectBindingPattern(newElements) : undefined;\n                }\n            }\n        }\n        function forEachReference(node, checker, onReference) {\n            node.forEachChild(function cb(node) {\n                if (ts.isIdentifier(node) && !ts.isDeclarationName(node)) {\n                    var sym = checker.getSymbolAtLocation(node);\n                    if (sym)\n                        onReference(sym);\n                }\n                else {\n                    node.forEachChild(cb);\n                }\n            });\n        }\n        var SymbolSet = /** @class */ (function () {\n            function SymbolSet() {\n                this.map = new ts.Map();\n            }\n            SymbolSet.prototype.add = function (symbol) {\n                this.map.set(String(ts.getSymbolId(symbol)), symbol);\n            };\n            SymbolSet.prototype.has = function (symbol) {\n                return this.map.has(String(ts.getSymbolId(symbol)));\n            };\n            SymbolSet.prototype.delete = function (symbol) {\n                this.map.delete(String(ts.getSymbolId(symbol)));\n            };\n            SymbolSet.prototype.forEach = function (cb) {\n                this.map.forEach(cb);\n            };\n            SymbolSet.prototype.forEachEntry = function (cb) {\n                return ts.forEachEntry(this.map, cb);\n            };\n            SymbolSet.prototype.clone = function () {\n                var clone = new SymbolSet();\n                ts.copyEntries(this.map, clone.map);\n                return clone;\n            };\n            return SymbolSet;\n        }());\n        function isTopLevelDeclaration(node) {\n            return isNonVariableTopLevelDeclaration(node) && ts.isSourceFile(node.parent) || ts.isVariableDeclaration(node) && ts.isSourceFile(node.parent.parent.parent);\n        }\n        function sourceFileOfTopLevelDeclaration(node) {\n            return ts.isVariableDeclaration(node) ? node.parent.parent.parent : node.parent;\n        }\n        function isTopLevelDeclarationStatement(node) {\n            ts.Debug.assert(ts.isSourceFile(node.parent), \"Node parent should be a SourceFile\");\n            return isNonVariableTopLevelDeclaration(node) || ts.isVariableStatement(node);\n        }\n        function isNonVariableTopLevelDeclaration(node) {\n            switch (node.kind) {\n                case 251 /* FunctionDeclaration */:\n                case 252 /* ClassDeclaration */:\n                case 256 /* ModuleDeclaration */:\n                case 255 /* EnumDeclaration */:\n                case 254 /* TypeAliasDeclaration */:\n                case 253 /* InterfaceDeclaration */:\n                case 260 /* ImportEqualsDeclaration */:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n        function forEachTopLevelDeclaration(statement, cb) {\n            switch (statement.kind) {\n                case 251 /* FunctionDeclaration */:\n                case 252 /* ClassDeclaration */:\n                case 256 /* ModuleDeclaration */:\n                case 255 /* EnumDeclaration */:\n                case 254 /* TypeAliasDeclaration */:\n                case 253 /* InterfaceDeclaration */:\n                case 260 /* ImportEqualsDeclaration */:\n                    return cb(statement);\n                case 232 /* VariableStatement */:\n                    return ts.firstDefined(statement.declarationList.declarations, function (decl) { return forEachTopLevelDeclarationInBindingName(decl.name, cb); });\n                case 233 /* ExpressionStatement */: {\n                    var expression = statement.expression;\n                    return ts.isBinaryExpression(expression) && ts.getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */\n                        ? cb(statement)\n                        : undefined;\n                }\n            }\n        }\n        function forEachTopLevelDeclarationInBindingName(name, cb) {\n            switch (name.kind) {\n                case 78 /* Identifier */:\n                    return cb(ts.cast(name.parent, function (x) { return ts.isVariableDeclaration(x) || ts.isBindingElement(x); }));\n                case 197 /* ArrayBindingPattern */:\n                case 196 /* ObjectBindingPattern */:\n                    return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); });\n                default:\n                    return ts.Debug.assertNever(name, \"Unexpected name kind \" + name.kind);\n            }\n        }\n        function nameOfTopLevelDeclaration(d) {\n            return ts.isExpressionStatement(d) ? ts.tryCast(d.expression.left.name, ts.isIdentifier) : ts.tryCast(d.name, ts.isIdentifier);\n        }\n        function getTopLevelDeclarationStatement(d) {\n            switch (d.kind) {\n                case 249 /* VariableDeclaration */:\n                    return d.parent.parent;\n                case 198 /* BindingElement */:\n                    return getTopLevelDeclarationStatement(ts.cast(d.parent.parent, function (p) { return ts.isVariableDeclaration(p) || ts.isBindingElement(p); }));\n                default:\n                    return d;\n            }\n        }\n        function addExportToChanges(sourceFile, decl, changes, useEs6Exports) {\n            if (isExported(sourceFile, decl, useEs6Exports))\n                return;\n            if (useEs6Exports) {\n                if (!ts.isExpressionStatement(decl))\n                    changes.insertExportModifier(sourceFile, decl);\n            }\n            else {\n                var names = getNamesToExportInCommonJS(decl);\n                if (names.length !== 0)\n                    changes.insertNodesAfter(sourceFile, decl, names.map(createExportAssignment));\n            }\n        }\n        function isExported(sourceFile, decl, useEs6Exports) {\n            if (useEs6Exports) {\n                return !ts.isExpressionStatement(decl) && ts.hasSyntacticModifier(decl, 1 /* Export */);\n            }\n            else {\n                return getNamesToExportInCommonJS(decl).some(function (name) { return sourceFile.symbol.exports.has(ts.escapeLeadingUnderscores(name)); });\n            }\n        }\n        function addExport(decl, useEs6Exports) {\n            return useEs6Exports ? [addEs6Export(decl)] : addCommonjsExport(decl);\n        }\n        function addEs6Export(d) {\n            var modifiers = ts.concatenate([ts.factory.createModifier(92 /* ExportKeyword */)], d.modifiers);\n            switch (d.kind) {\n                case 251 /* FunctionDeclaration */:\n                    return ts.factory.updateFunctionDeclaration(d, d.decorators, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body);\n                case 252 /* ClassDeclaration */:\n                    return ts.factory.updateClassDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members);\n                case 232 /* VariableStatement */:\n                    return ts.factory.updateVariableStatement(d, modifiers, d.declarationList);\n                case 256 /* ModuleDeclaration */:\n                    return ts.factory.updateModuleDeclaration(d, d.decorators, modifiers, d.name, d.body);\n                case 255 /* EnumDeclaration */:\n                    return ts.factory.updateEnumDeclaration(d, d.decorators, modifiers, d.name, d.members);\n                case 254 /* TypeAliasDeclaration */:\n                    return ts.factory.updateTypeAliasDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.type);\n                case 253 /* InterfaceDeclaration */:\n                    return ts.factory.updateInterfaceDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members);\n                case 260 /* ImportEqualsDeclaration */:\n                    return ts.factory.updateImportEqualsDeclaration(d, d.decorators, modifiers, d.isTypeOnly, d.name, d.moduleReference);\n                case 233 /* ExpressionStatement */:\n                    return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...`\n                default:\n                    return ts.Debug.assertNever(d, \"Unexpected declaration kind \" + d.kind);\n            }\n        }\n        function addCommonjsExport(decl) {\n            return __spreadArray([decl], getNamesToExportInCommonJS(decl).map(createExportAssignment));\n        }\n        function getNamesToExportInCommonJS(decl) {\n            switch (decl.kind) {\n                case 251 /* FunctionDeclaration */:\n                case 252 /* ClassDeclaration */:\n                    return [decl.name.text]; // TODO: GH#18217\n                case 232 /* VariableStatement */:\n                    return ts.mapDefined(decl.declarationList.declarations, function (d) { return ts.isIdentifier(d.name) ? d.name.text : undefined; });\n                case 256 /* ModuleDeclaration */:\n                case 255 /* EnumDeclaration */:\n                case 254 /* TypeAliasDeclaration */:\n                case 253 /* InterfaceDeclaration */:\n                case 260 /* ImportEqualsDeclaration */:\n                    return ts.emptyArray;\n                case 233 /* ExpressionStatement */:\n                    return ts.Debug.fail(\"Can't export an ExpressionStatement\"); // Shouldn't try to add 'export' keyword to `exports.x = ...`\n                default:\n                    return ts.Debug.assertNever(decl, \"Unexpected decl kind \" + decl.kind);\n            }\n        }\n        /** Creates `exports.x = x;` */\n        function createExportAssignment(name) {\n            return ts.factory.createExpressionStatement(ts.factory.createBinaryExpression(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(\"exports\"), ts.factory.createIdentifier(name)), 62 /* EqualsToken */, ts.factory.createIdentifier(name)));\n        }\n    })(refactor = ts.refactor || (ts.refactor = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var refactor;\n    (function (refactor) {\n        var addOrRemoveBracesToArrowFunction;\n        (function (addOrRemoveBracesToArrowFunction) {\n            var refactorName = \"Add or remove braces in an arrow function\";\n            var refactorDescription = ts.Diagnostics.Add_or_remove_braces_in_an_arrow_function.message;\n            var addBracesAction = {\n                name: \"Add braces to arrow function\",\n                description: ts.Diagnostics.Add_braces_to_arrow_function.message,\n                kind: \"refactor.rewrite.arrow.braces.add\",\n            };\n            var removeBracesAction = {\n                name: \"Remove braces from arrow function\",\n                description: ts.Diagnostics.Remove_braces_from_arrow_function.message,\n                kind: \"refactor.rewrite.arrow.braces.remove\"\n            };\n            refactor.registerRefactor(refactorName, {\n                kinds: [removeBracesAction.kind],\n                getEditsForAction: getEditsForAction,\n                getAvailableActions: getAvailableActions\n            });\n            function getAvailableActions(context) {\n                var file = context.file, startPosition = context.startPosition, triggerReason = context.triggerReason;\n                var info = getConvertibleArrowFunctionAtPosition(file, startPosition, triggerReason === \"invoked\");\n                if (!info)\n                    return ts.emptyArray;\n                if (!refactor.isRefactorErrorInfo(info)) {\n                    return [{\n                            name: refactorName,\n                            description: refactorDescription,\n                            actions: [\n                                info.addBraces ? addBracesAction : removeBracesAction\n                            ]\n                        }];\n                }\n                if (context.preferences.provideRefactorNotApplicableReason) {\n                    return [{\n                            name: refactorName,\n                            description: refactorDescription,\n                            actions: [\n                                __assign(__assign({}, addBracesAction), { notApplicableReason: info.error }),\n                                __assign(__assign({}, removeBracesAction), { notApplicableReason: info.error }),\n                            ]\n                        }];\n                }\n                return ts.emptyArray;\n            }\n            function getEditsForAction(context, actionName) {\n                var file = context.file, startPosition = context.startPosition;\n                var info = getConvertibleArrowFunctionAtPosition(file, startPosition);\n                ts.Debug.assert(info && !refactor.isRefactorErrorInfo(info), \"Expected applicable refactor info\");\n                var expression = info.expression, returnStatement = info.returnStatement, func = info.func;\n                var body;\n                if (actionName === addBracesAction.name) {\n                    var returnStatement_1 = ts.factory.createReturnStatement(expression);\n                    body = ts.factory.createBlock([returnStatement_1], /* multiLine */ true);\n                    ts.suppressLeadingAndTrailingTrivia(body);\n                    ts.copyLeadingComments(expression, returnStatement_1, file, 3 /* MultiLineCommentTrivia */, /* hasTrailingNewLine */ true);\n                }\n                else if (actionName === removeBracesAction.name && returnStatement) {\n                    var actualExpression = expression || ts.factory.createVoidZero();\n                    body = ts.needsParentheses(actualExpression) ? ts.factory.createParenthesizedExpression(actualExpression) : actualExpression;\n                    ts.suppressLeadingAndTrailingTrivia(body);\n                    ts.copyTrailingAsLeadingComments(returnStatement, body, file, 3 /* MultiLineCommentTrivia */, /* hasTrailingNewLine */ false);\n                    ts.copyLeadingComments(returnStatement, body, file, 3 /* MultiLineCommentTrivia */, /* hasTrailingNewLine */ false);\n                    ts.copyTrailingComments(returnStatement, body, file, 3 /* MultiLineCommentTrivia */, /* hasTrailingNewLine */ false);\n                }\n                else {\n                    ts.Debug.fail(\"invalid action\");\n                }\n                var edits = ts.textChanges.ChangeTracker.with(context, function (t) {\n                    t.replaceNode(file, func.body, body);\n                });\n                return { renameFilename: undefined, renameLocation: undefined, edits: edits };\n            }\n            function getConvertibleArrowFunctionAtPosition(file, startPosition, considerFunctionBodies, kind) {\n                if (considerFunctionBodies === void 0) { considerFunctionBodies = true; }\n                var node = ts.getTokenAtPosition(file, startPosition);\n                var func = ts.getContainingFunction(node);\n                if (!func) {\n                    return {\n                        error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_find_a_containing_arrow_function)\n                    };\n                }\n                if (!ts.isArrowFunction(func)) {\n                    return {\n                        error: ts.getLocaleSpecificMessage(ts.Diagnostics.Containing_function_is_not_an_arrow_function)\n                    };\n                }\n                if ((!ts.rangeContainsRange(func, node) || ts.rangeContainsRange(func.body, node) && !considerFunctionBodies)) {\n                    return undefined;\n                }\n                if (refactor.refactorKindBeginsWith(addBracesAction.kind, kind) && ts.isExpression(func.body)) {\n                    return { func: func, addBraces: true, expression: func.body };\n                }\n                else if (refactor.refactorKindBeginsWith(removeBracesAction.kind, kind) && ts.isBlock(func.body) && func.body.statements.length === 1) {\n                    var firstStatement = ts.first(func.body.statements);\n                    if (ts.isReturnStatement(firstStatement)) {\n                        return { func: func, addBraces: false, expression: firstStatement.expression, returnStatement: firstStatement };\n                    }\n                }\n                return undefined;\n            }\n        })(addOrRemoveBracesToArrowFunction = refactor.addOrRemoveBracesToArrowFunction || (refactor.addOrRemoveBracesToArrowFunction = {}));\n    })(refactor = ts.refactor || (ts.refactor = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var refactor;\n    (function (refactor) {\n        var convertParamsToDestructuredObject;\n        (function (convertParamsToDestructuredObject) {\n            var refactorName = \"Convert parameters to destructured object\";\n            var minimumParameterLength = 2;\n            var refactorDescription = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_parameters_to_destructured_object);\n            var toDestructuredAction = {\n                name: refactorName,\n                description: refactorDescription,\n                kind: \"refactor.rewrite.parameters.toDestructured\"\n            };\n            refactor.registerRefactor(refactorName, {\n                kinds: [toDestructuredAction.kind],\n                getEditsForAction: getEditsForAction,\n                getAvailableActions: getAvailableActions\n            });\n            function getAvailableActions(context) {\n                var file = context.file, startPosition = context.startPosition;\n                var isJSFile = ts.isSourceFileJS(file);\n                if (isJSFile)\n                    return ts.emptyArray; // TODO: GH#30113\n                var functionDeclaration = getFunctionDeclarationAtPosition(file, startPosition, context.program.getTypeChecker());\n                if (!functionDeclaration)\n                    return ts.emptyArray;\n                return [{\n                        name: refactorName,\n                        description: refactorDescription,\n                        actions: [toDestructuredAction]\n                    }];\n            }\n            function getEditsForAction(context, actionName) {\n                ts.Debug.assert(actionName === refactorName, \"Unexpected action name\");\n                var file = context.file, startPosition = context.startPosition, program = context.program, cancellationToken = context.cancellationToken, host = context.host;\n                var functionDeclaration = getFunctionDeclarationAtPosition(file, startPosition, program.getTypeChecker());\n                if (!functionDeclaration || !cancellationToken)\n                    return undefined;\n                var groupedReferences = getGroupedReferences(functionDeclaration, program, cancellationToken);\n                if (groupedReferences.valid) {\n                    var edits = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(file, program, host, t, functionDeclaration, groupedReferences); });\n                    return { renameFilename: undefined, renameLocation: undefined, edits: edits };\n                }\n                return { edits: [] }; // TODO: GH#30113\n            }\n            function doChange(sourceFile, program, host, changes, functionDeclaration, groupedReferences) {\n                var signature = groupedReferences.signature;\n                var newFunctionDeclarationParams = ts.map(createNewParameters(functionDeclaration, program, host), function (param) { return ts.getSynthesizedDeepClone(param); });\n                if (signature) {\n                    var newSignatureParams = ts.map(createNewParameters(signature, program, host), function (param) { return ts.getSynthesizedDeepClone(param); });\n                    replaceParameters(signature, newSignatureParams);\n                }\n                replaceParameters(functionDeclaration, newFunctionDeclarationParams);\n                var functionCalls = ts.sortAndDeduplicate(groupedReferences.functionCalls, /*comparer*/ function (a, b) { return ts.compareValues(a.pos, b.pos); });\n                for (var _i = 0, functionCalls_1 = functionCalls; _i < functionCalls_1.length; _i++) {\n                    var call = functionCalls_1[_i];\n                    if (call.arguments && call.arguments.length) {\n                        var newArgument = ts.getSynthesizedDeepClone(createNewArgument(functionDeclaration, call.arguments), /*includeTrivia*/ true);\n                        changes.replaceNodeRange(ts.getSourceFileOfNode(call), ts.first(call.arguments), ts.last(call.arguments), newArgument, { leadingTriviaOption: ts.textChanges.LeadingTriviaOption.IncludeAll, trailingTriviaOption: ts.textChanges.TrailingTriviaOption.Include });\n                    }\n                }\n                function replaceParameters(declarationOrSignature, parameterDeclarations) {\n                    changes.replaceNodeRangeWithNodes(sourceFile, ts.first(declarationOrSignature.parameters), ts.last(declarationOrSignature.parameters), parameterDeclarations, {\n                        joiner: \", \",\n                        // indentation is set to 0 because otherwise the object parameter will be indented if there is a `this` parameter\n                        indentation: 0,\n                        leadingTriviaOption: ts.textChanges.LeadingTriviaOption.IncludeAll,\n                        trailingTriviaOption: ts.textChanges.TrailingTriviaOption.Include\n                    });\n                }\n            }\n            function getGroupedReferences(functionDeclaration, program, cancellationToken) {\n                var functionNames = getFunctionNames(functionDeclaration);\n                var classNames = ts.isConstructorDeclaration(functionDeclaration) ? getClassNames(functionDeclaration) : [];\n                var names = ts.deduplicate(__spreadArray(__spreadArray([], functionNames), classNames), ts.equateValues);\n                var checker = program.getTypeChecker();\n                var references = ts.flatMap(names, /*mapfn*/ function (/*mapfn*/ name) { return ts.FindAllReferences.getReferenceEntriesForNode(-1, name, program, program.getSourceFiles(), cancellationToken); });\n                var groupedReferences = groupReferences(references);\n                if (!ts.every(groupedReferences.declarations, /*callback*/ function (/*callback*/ decl) { return ts.contains(names, decl); })) {\n                    groupedReferences.valid = false;\n                }\n                return groupedReferences;\n                function groupReferences(referenceEntries) {\n                    var classReferences = { accessExpressions: [], typeUsages: [] };\n                    var groupedReferences = { functionCalls: [], declarations: [], classReferences: classReferences, valid: true };\n                    var functionSymbols = ts.map(functionNames, getSymbolTargetAtLocation);\n                    var classSymbols = ts.map(classNames, getSymbolTargetAtLocation);\n                    var isConstructor = ts.isConstructorDeclaration(functionDeclaration);\n                    var contextualSymbols = ts.map(functionNames, function (name) { return getSymbolForContextualType(name, checker); });\n                    for (var _i = 0, referenceEntries_1 = referenceEntries; _i < referenceEntries_1.length; _i++) {\n                        var entry = referenceEntries_1[_i];\n                        if (entry.kind === 0 /* Span */) {\n                            groupedReferences.valid = false;\n                            continue;\n                        }\n                        /* Declarations in object literals may be implementations of method signatures which have a different symbol from the declaration\n                        For example:\n                            interface IFoo { m(a: number): void }\n                            const foo: IFoo = { m(a: number): void {} }\n                        In these cases we get the symbol for the signature from the contextual type.\n                        */\n                        if (ts.contains(contextualSymbols, getSymbolTargetAtLocation(entry.node))) {\n                            if (isValidMethodSignature(entry.node.parent)) {\n                                groupedReferences.signature = entry.node.parent;\n                                continue;\n                            }\n                            var call = entryToFunctionCall(entry);\n                            if (call) {\n                                groupedReferences.functionCalls.push(call);\n                                continue;\n                            }\n                        }\n                        var contextualSymbol = getSymbolForContextualType(entry.node, checker);\n                        if (contextualSymbol && ts.contains(contextualSymbols, contextualSymbol)) {\n                            var decl = entryToDeclaration(entry);\n                            if (decl) {\n                                groupedReferences.declarations.push(decl);\n                                continue;\n                            }\n                        }\n                        /* We compare symbols because in some cases find all references wil return a reference that may or may not be to the refactored function.\n                        Example from the refactorConvertParamsToDestructuredObject_methodCallUnion.ts test:\n                            class A { foo(a: number, b: number) { return a + b; } }\n                            class B { foo(c: number, d: number) { return c + d; } }\n                            declare const ab: A | B;\n                            ab.foo(1, 2);\n                        Find all references will return `ab.foo(1, 2)` as a reference to A's `foo` but we could be calling B's `foo`.\n                        When looking for constructor calls, however, the symbol on the constructor call reference is going to be the corresponding class symbol.\n                        So we need to add a special case for this because when calling a constructor of a class through one of its subclasses,\n                        the symbols are going to be different.\n                        */\n                        if (ts.contains(functionSymbols, getSymbolTargetAtLocation(entry.node)) || ts.isNewExpressionTarget(entry.node)) {\n                            var importOrExportReference = entryToImportOrExport(entry);\n                            if (importOrExportReference) {\n                                continue;\n                            }\n                            var decl = entryToDeclaration(entry);\n                            if (decl) {\n                                groupedReferences.declarations.push(decl);\n                                continue;\n                            }\n                            var call = entryToFunctionCall(entry);\n                            if (call) {\n                                groupedReferences.functionCalls.push(call);\n                                continue;\n                            }\n                        }\n                        // if the refactored function is a constructor, we must also check if the references to its class are valid\n                        if (isConstructor && ts.contains(classSymbols, getSymbolTargetAtLocation(entry.node))) {\n                            var importOrExportReference = entryToImportOrExport(entry);\n                            if (importOrExportReference) {\n                                continue;\n                            }\n                            var decl = entryToDeclaration(entry);\n                            if (decl) {\n                                groupedReferences.declarations.push(decl);\n                                continue;\n                            }\n                            var accessExpression = entryToAccessExpression(entry);\n                            if (accessExpression) {\n                                classReferences.accessExpressions.push(accessExpression);\n                                continue;\n                            }\n                            // Only class declarations are allowed to be used as a type (in a heritage clause),\n                            // otherwise `findAllReferences` might not be able to track constructor calls.\n                            if (ts.isClassDeclaration(functionDeclaration.parent)) {\n                                var type = entryToType(entry);\n                                if (type) {\n                                    classReferences.typeUsages.push(type);\n                                    continue;\n                                }\n                            }\n                        }\n                        groupedReferences.valid = false;\n                    }\n                    return groupedReferences;\n                }\n                function getSymbolTargetAtLocation(node) {\n                    var symbol = checker.getSymbolAtLocation(node);\n                    return symbol && ts.getSymbolTarget(symbol, checker);\n                }\n            }\n            /**\n             * Gets the symbol for the contextual type of the node if it is not a union or intersection.\n             */\n            function getSymbolForContextualType(node, checker) {\n                var element = ts.getContainingObjectLiteralElement(node);\n                if (element) {\n                    var contextualType = checker.getContextualTypeForObjectLiteralElement(element);\n                    var symbol = contextualType === null || contextualType === void 0 ? void 0 : contextualType.getSymbol();\n                    if (symbol && !(ts.getCheckFlags(symbol) & 6 /* Synthetic */)) {\n                        return symbol;\n                    }\n                }\n            }\n            function entryToImportOrExport(entry) {\n                var node = entry.node;\n                if (ts.isImportSpecifier(node.parent)\n                    || ts.isImportClause(node.parent)\n                    || ts.isImportEqualsDeclaration(node.parent)\n                    || ts.isNamespaceImport(node.parent)) {\n                    return node;\n                }\n                if (ts.isExportSpecifier(node.parent) || ts.isExportAssignment(node.parent)) {\n                    return node;\n                }\n                return undefined;\n            }\n            function entryToDeclaration(entry) {\n                if (ts.isDeclaration(entry.node.parent)) {\n                    return entry.node;\n                }\n                return undefined;\n            }\n            function entryToFunctionCall(entry) {\n                if (entry.node.parent) {\n                    var functionReference = entry.node;\n                    var parent = functionReference.parent;\n                    switch (parent.kind) {\n                        // foo(...) or super(...) or new Foo(...)\n                        case 203 /* CallExpression */:\n                        case 204 /* NewExpression */:\n                            var callOrNewExpression = ts.tryCast(parent, ts.isCallOrNewExpression);\n                            if (callOrNewExpression && callOrNewExpression.expression === functionReference) {\n                                return callOrNewExpression;\n                            }\n                            break;\n                        // x.foo(...)\n                        case 201 /* PropertyAccessExpression */:\n                            var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression);\n                            if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) {\n                                var callOrNewExpression_1 = ts.tryCast(propertyAccessExpression.parent, ts.isCallOrNewExpression);\n                                if (callOrNewExpression_1 && callOrNewExpression_1.expression === propertyAccessExpression) {\n                                    return callOrNewExpression_1;\n                                }\n                            }\n                            break;\n                        // x[\"foo\"](...)\n                        case 202 /* ElementAccessExpression */:\n                            var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression);\n                            if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) {\n                                var callOrNewExpression_2 = ts.tryCast(elementAccessExpression.parent, ts.isCallOrNewExpression);\n                                if (callOrNewExpression_2 && callOrNewExpression_2.expression === elementAccessExpression) {\n                                    return callOrNewExpression_2;\n                                }\n                            }\n                            break;\n                    }\n                }\n                return undefined;\n            }\n            function entryToAccessExpression(entry) {\n                if (entry.node.parent) {\n                    var reference = entry.node;\n                    var parent = reference.parent;\n                    switch (parent.kind) {\n                        // `C.foo`\n                        case 201 /* PropertyAccessExpression */:\n                            var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression);\n                            if (propertyAccessExpression && propertyAccessExpression.expression === reference) {\n                                return propertyAccessExpression;\n                            }\n                            break;\n                        // `C[\"foo\"]`\n                        case 202 /* ElementAccessExpression */:\n                            var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression);\n                            if (elementAccessExpression && elementAccessExpression.expression === reference) {\n                                return elementAccessExpression;\n                            }\n                            break;\n                    }\n                }\n                return undefined;\n            }\n            function entryToType(entry) {\n                var reference = entry.node;\n                if (ts.getMeaningFromLocation(reference) === 2 /* Type */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(reference.parent)) {\n                    return reference;\n                }\n                return undefined;\n            }\n            function getFunctionDeclarationAtPosition(file, startPosition, checker) {\n                var node = ts.getTouchingToken(file, startPosition);\n                var functionDeclaration = ts.getContainingFunctionDeclaration(node);\n                // don't offer refactor on top-level JSDoc\n                if (isTopLevelJSDoc(node))\n                    return undefined;\n                if (functionDeclaration\n                    && isValidFunctionDeclaration(functionDeclaration, checker)\n                    && ts.rangeContainsRange(functionDeclaration, node)\n                    && !(functionDeclaration.body && ts.rangeContainsRange(functionDeclaration.body, node)))\n                    return functionDeclaration;\n                return undefined;\n            }\n            function isTopLevelJSDoc(node) {\n                var containingJSDoc = ts.findAncestor(node, ts.isJSDocNode);\n                if (containingJSDoc) {\n                    var containingNonJSDoc = ts.findAncestor(containingJSDoc, function (n) { return !ts.isJSDocNode(n); });\n                    return !!containingNonJSDoc && ts.isFunctionLikeDeclaration(containingNonJSDoc);\n                }\n                return false;\n            }\n            function isValidMethodSignature(node) {\n                return ts.isMethodSignature(node) && (ts.isInterfaceDeclaration(node.parent) || ts.isTypeLiteralNode(node.parent));\n            }\n            function isValidFunctionDeclaration(functionDeclaration, checker) {\n                if (!isValidParameterNodeArray(functionDeclaration.parameters, checker))\n                    return false;\n                switch (functionDeclaration.kind) {\n                    case 251 /* FunctionDeclaration */:\n                        return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker);\n                    case 165 /* MethodDeclaration */:\n                        if (ts.isObjectLiteralExpression(functionDeclaration.parent)) {\n                            var contextualSymbol = getSymbolForContextualType(functionDeclaration.name, checker);\n                            // don't offer the refactor when there are multiple signatures since we won't know which ones the user wants to change\n                            return (contextualSymbol === null || contextualSymbol === void 0 ? void 0 : contextualSymbol.declarations.length) === 1 && isSingleImplementation(functionDeclaration, checker);\n                        }\n                        return isSingleImplementation(functionDeclaration, checker);\n                    case 166 /* Constructor */:\n                        if (ts.isClassDeclaration(functionDeclaration.parent)) {\n                            return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker);\n                        }\n                        else {\n                            return isValidVariableDeclaration(functionDeclaration.parent.parent)\n                                && isSingleImplementation(functionDeclaration, checker);\n                        }\n                    case 208 /* FunctionExpression */:\n                    case 209 /* ArrowFunction */:\n                        return isValidVariableDeclaration(functionDeclaration.parent);\n                }\n                return false;\n            }\n            function isSingleImplementation(functionDeclaration, checker) {\n                return !!functionDeclaration.body && !checker.isImplementationOfOverload(functionDeclaration);\n            }\n            function hasNameOrDefault(functionOrClassDeclaration) {\n                if (!functionOrClassDeclaration.name) {\n                    var defaultKeyword = ts.findModifier(functionOrClassDeclaration, 87 /* DefaultKeyword */);\n                    return !!defaultKeyword;\n                }\n                return true;\n            }\n            function isValidParameterNodeArray(parameters, checker) {\n                return getRefactorableParametersLength(parameters) >= minimumParameterLength\n                    && ts.every(parameters, /*callback*/ function (/*callback*/ paramDecl) { return isValidParameterDeclaration(paramDecl, checker); });\n            }\n            function isValidParameterDeclaration(parameterDeclaration, checker) {\n                if (ts.isRestParameter(parameterDeclaration)) {\n                    var type = checker.getTypeAtLocation(parameterDeclaration);\n                    if (!checker.isArrayType(type) && !checker.isTupleType(type))\n                        return false;\n                }\n                return !parameterDeclaration.modifiers && !parameterDeclaration.decorators && ts.isIdentifier(parameterDeclaration.name);\n            }\n            function isValidVariableDeclaration(node) {\n                return ts.isVariableDeclaration(node) && ts.isVarConst(node) && ts.isIdentifier(node.name) && !node.type; // TODO: GH#30113\n            }\n            function hasThisParameter(parameters) {\n                return parameters.length > 0 && ts.isThis(parameters[0].name);\n            }\n            function getRefactorableParametersLength(parameters) {\n                if (hasThisParameter(parameters)) {\n                    return parameters.length - 1;\n                }\n                return parameters.length;\n            }\n            function getRefactorableParameters(parameters) {\n                if (hasThisParameter(parameters)) {\n                    parameters = ts.factory.createNodeArray(parameters.slice(1), parameters.hasTrailingComma);\n                }\n                return parameters;\n            }\n            function createPropertyOrShorthandAssignment(name, initializer) {\n                if (ts.isIdentifier(initializer) && ts.getTextOfIdentifierOrLiteral(initializer) === name) {\n                    return ts.factory.createShorthandPropertyAssignment(name);\n                }\n                return ts.factory.createPropertyAssignment(name, initializer);\n            }\n            function createNewArgument(functionDeclaration, functionArguments) {\n                var parameters = getRefactorableParameters(functionDeclaration.parameters);\n                var hasRestParameter = ts.isRestParameter(ts.last(parameters));\n                var nonRestArguments = hasRestParameter ? functionArguments.slice(0, parameters.length - 1) : functionArguments;\n                var properties = ts.map(nonRestArguments, function (arg, i) {\n                    var parameterName = getParameterName(parameters[i]);\n                    var property = createPropertyOrShorthandAssignment(parameterName, arg);\n                    ts.suppressLeadingAndTrailingTrivia(property.name);\n                    if (ts.isPropertyAssignment(property))\n                        ts.suppressLeadingAndTrailingTrivia(property.initializer);\n                    ts.copyComments(arg, property);\n                    return property;\n                });\n                if (hasRestParameter && functionArguments.length >= parameters.length) {\n                    var restArguments = functionArguments.slice(parameters.length - 1);\n                    var restProperty = ts.factory.createPropertyAssignment(getParameterName(ts.last(parameters)), ts.factory.createArrayLiteralExpression(restArguments));\n                    properties.push(restProperty);\n                }\n                var objectLiteral = ts.factory.createObjectLiteralExpression(properties, /*multiLine*/ false);\n                return objectLiteral;\n            }\n            function createNewParameters(functionDeclaration, program, host) {\n                var checker = program.getTypeChecker();\n                var refactorableParameters = getRefactorableParameters(functionDeclaration.parameters);\n                var bindingElements = ts.map(refactorableParameters, createBindingElementFromParameterDeclaration);\n                var objectParameterName = ts.factory.createObjectBindingPattern(bindingElements);\n                var objectParameterType = createParameterTypeNode(refactorableParameters);\n                var objectInitializer;\n                // If every parameter in the original function was optional, add an empty object initializer to the new object parameter\n                if (ts.every(refactorableParameters, isOptionalParameter)) {\n                    objectInitializer = ts.factory.createObjectLiteralExpression();\n                }\n                var objectParameter = ts.factory.createParameterDeclaration(\n                /*decorators*/ undefined, \n                /*modifiers*/ undefined, \n                /*dotDotDotToken*/ undefined, objectParameterName, \n                /*questionToken*/ undefined, objectParameterType, objectInitializer);\n                if (hasThisParameter(functionDeclaration.parameters)) {\n                    var thisParameter = functionDeclaration.parameters[0];\n                    var newThisParameter = ts.factory.createParameterDeclaration(\n                    /*decorators*/ undefined, \n                    /*modifiers*/ undefined, \n                    /*dotDotDotToken*/ undefined, thisParameter.name, \n                    /*questionToken*/ undefined, thisParameter.type);\n                    ts.suppressLeadingAndTrailingTrivia(newThisParameter.name);\n                    ts.copyComments(thisParameter.name, newThisParameter.name);\n                    if (thisParameter.type) {\n                        ts.suppressLeadingAndTrailingTrivia(newThisParameter.type);\n                        ts.copyComments(thisParameter.type, newThisParameter.type);\n                    }\n                    return ts.factory.createNodeArray([newThisParameter, objectParameter]);\n                }\n                return ts.factory.createNodeArray([objectParameter]);\n                function createBindingElementFromParameterDeclaration(parameterDeclaration) {\n                    var element = ts.factory.createBindingElement(\n                    /*dotDotDotToken*/ undefined, \n                    /*propertyName*/ undefined, getParameterName(parameterDeclaration), ts.isRestParameter(parameterDeclaration) && isOptionalParameter(parameterDeclaration) ? ts.factory.createArrayLiteralExpression() : parameterDeclaration.initializer);\n                    ts.suppressLeadingAndTrailingTrivia(element);\n                    if (parameterDeclaration.initializer && element.initializer) {\n                        ts.copyComments(parameterDeclaration.initializer, element.initializer);\n                    }\n                    return element;\n                }\n                function createParameterTypeNode(parameters) {\n                    var members = ts.map(parameters, createPropertySignatureFromParameterDeclaration);\n                    var typeNode = ts.addEmitFlags(ts.factory.createTypeLiteralNode(members), 1 /* SingleLine */);\n                    return typeNode;\n                }\n                function createPropertySignatureFromParameterDeclaration(parameterDeclaration) {\n                    var parameterType = parameterDeclaration.type;\n                    if (!parameterType && (parameterDeclaration.initializer || ts.isRestParameter(parameterDeclaration))) {\n                        parameterType = getTypeNode(parameterDeclaration);\n                    }\n                    var propertySignature = ts.factory.createPropertySignature(\n                    /*modifiers*/ undefined, getParameterName(parameterDeclaration), isOptionalParameter(parameterDeclaration) ? ts.factory.createToken(57 /* QuestionToken */) : parameterDeclaration.questionToken, parameterType);\n                    ts.suppressLeadingAndTrailingTrivia(propertySignature);\n                    ts.copyComments(parameterDeclaration.name, propertySignature.name);\n                    if (parameterDeclaration.type && propertySignature.type) {\n                        ts.copyComments(parameterDeclaration.type, propertySignature.type);\n                    }\n                    return propertySignature;\n                }\n                function getTypeNode(node) {\n                    var type = checker.getTypeAtLocation(node);\n                    return ts.getTypeNodeIfAccessible(type, node, program, host);\n                }\n                function isOptionalParameter(parameterDeclaration) {\n                    if (ts.isRestParameter(parameterDeclaration)) {\n                        var type = checker.getTypeAtLocation(parameterDeclaration);\n                        return !checker.isTupleType(type);\n                    }\n                    return checker.isOptionalParameter(parameterDeclaration);\n                }\n            }\n            function getParameterName(paramDeclaration) {\n                return ts.getTextOfIdentifierOrLiteral(paramDeclaration.name);\n            }\n            function getClassNames(constructorDeclaration) {\n                switch (constructorDeclaration.parent.kind) {\n                    case 252 /* ClassDeclaration */:\n                        var classDeclaration = constructorDeclaration.parent;\n                        if (classDeclaration.name)\n                            return [classDeclaration.name];\n                        // If the class declaration doesn't have a name, it should have a default modifier.\n                        // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault`\n                        var defaultModifier = ts.Debug.checkDefined(ts.findModifier(classDeclaration, 87 /* DefaultKeyword */), \"Nameless class declaration should be a default export\");\n                        return [defaultModifier];\n                    case 221 /* ClassExpression */:\n                        var classExpression = constructorDeclaration.parent;\n                        var variableDeclaration = constructorDeclaration.parent.parent;\n                        var className = classExpression.name;\n                        if (className)\n                            return [className, variableDeclaration.name];\n                        return [variableDeclaration.name];\n                }\n            }\n            function getFunctionNames(functionDeclaration) {\n                switch (functionDeclaration.kind) {\n                    case 251 /* FunctionDeclaration */:\n                        if (functionDeclaration.name)\n                            return [functionDeclaration.name];\n                        // If the function declaration doesn't have a name, it should have a default modifier.\n                        // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault`\n                        var defaultModifier = ts.Debug.checkDefined(ts.findModifier(functionDeclaration, 87 /* DefaultKeyword */), \"Nameless function declaration should be a default export\");\n                        return [defaultModifier];\n                    case 165 /* MethodDeclaration */:\n                        return [functionDeclaration.name];\n                    case 166 /* Constructor */:\n                        var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 132 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), \"Constructor declaration should have constructor keyword\");\n                        if (functionDeclaration.parent.kind === 221 /* ClassExpression */) {\n                            var variableDeclaration = functionDeclaration.parent.parent;\n                            return [variableDeclaration.name, ctrKeyword];\n                        }\n                        return [ctrKeyword];\n                    case 209 /* ArrowFunction */:\n                        return [functionDeclaration.parent.name];\n                    case 208 /* FunctionExpression */:\n                        if (functionDeclaration.name)\n                            return [functionDeclaration.name, functionDeclaration.parent.name];\n                        return [functionDeclaration.parent.name];\n                    default:\n                        return ts.Debug.assertNever(functionDeclaration, \"Unexpected function declaration kind \" + functionDeclaration.kind);\n                }\n            }\n        })(convertParamsToDestructuredObject = refactor.convertParamsToDestructuredObject || (refactor.convertParamsToDestructuredObject = {}));\n    })(refactor = ts.refactor || (ts.refactor = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var refactor;\n    (function (refactor) {\n        var convertStringOrTemplateLiteral;\n        (function (convertStringOrTemplateLiteral) {\n            var refactorName = \"Convert to template string\";\n            var refactorDescription = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_template_string);\n            var convertStringAction = {\n                name: refactorName,\n                description: refactorDescription,\n                kind: \"refactor.rewrite.string\"\n            };\n            refactor.registerRefactor(refactorName, {\n                kinds: [convertStringAction.kind],\n                getEditsForAction: getEditsForAction,\n                getAvailableActions: getAvailableActions\n            });\n            function getAvailableActions(context) {\n                var file = context.file, startPosition = context.startPosition;\n                var node = getNodeOrParentOfParentheses(file, startPosition);\n                var maybeBinary = getParentBinaryExpression(node);\n                var refactorInfo = { name: refactorName, description: refactorDescription, actions: [] };\n                if (ts.isBinaryExpression(maybeBinary) && isStringConcatenationValid(maybeBinary)) {\n                    refactorInfo.actions.push(convertStringAction);\n                    return [refactorInfo];\n                }\n                else if (context.preferences.provideRefactorNotApplicableReason) {\n                    refactorInfo.actions.push(__assign(__assign({}, convertStringAction), { notApplicableReason: ts.getLocaleSpecificMessage(ts.Diagnostics.Can_only_convert_string_concatenation) }));\n                    return [refactorInfo];\n                }\n                return ts.emptyArray;\n            }\n            function getNodeOrParentOfParentheses(file, startPosition) {\n                var node = ts.getTokenAtPosition(file, startPosition);\n                var nestedBinary = getParentBinaryExpression(node);\n                var isNonStringBinary = !isStringConcatenationValid(nestedBinary);\n                if (isNonStringBinary &&\n                    ts.isParenthesizedExpression(nestedBinary.parent) &&\n                    ts.isBinaryExpression(nestedBinary.parent.parent)) {\n                    return nestedBinary.parent.parent;\n                }\n                return node;\n            }\n            function getEditsForAction(context, actionName) {\n                var file = context.file, startPosition = context.startPosition;\n                var node = getNodeOrParentOfParentheses(file, startPosition);\n                switch (actionName) {\n                    case refactorDescription:\n                        return { edits: getEditsForToTemplateLiteral(context, node) };\n                    default:\n                        return ts.Debug.fail(\"invalid action\");\n                }\n            }\n            function getEditsForToTemplateLiteral(context, node) {\n                var maybeBinary = getParentBinaryExpression(node);\n                var file = context.file;\n                var templateLiteral = nodesToTemplate(treeToArray(maybeBinary), file);\n                var trailingCommentRanges = ts.getTrailingCommentRanges(file.text, maybeBinary.end);\n                if (trailingCommentRanges) {\n                    var lastComment = trailingCommentRanges[trailingCommentRanges.length - 1];\n                    var trailingRange_1 = { pos: trailingCommentRanges[0].pos, end: lastComment.end };\n                    // since suppressTrailingTrivia(maybeBinary) does not work, the trailing comment is removed manually\n                    // otherwise it would have the trailing comment twice\n                    return ts.textChanges.ChangeTracker.with(context, function (t) {\n                        t.deleteRange(file, trailingRange_1);\n                        t.replaceNode(file, maybeBinary, templateLiteral);\n                    });\n                }\n                else {\n                    return ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceNode(file, maybeBinary, templateLiteral); });\n                }\n            }\n            function isNotEqualsOperator(node) {\n                return node.operatorToken.kind !== 62 /* EqualsToken */;\n            }\n            function getParentBinaryExpression(expr) {\n                var container = ts.findAncestor(expr.parent, function (n) {\n                    switch (n.kind) {\n                        case 201 /* PropertyAccessExpression */:\n                        case 202 /* ElementAccessExpression */:\n                            return false;\n                        case 218 /* TemplateExpression */:\n                        case 216 /* BinaryExpression */:\n                            return !(ts.isBinaryExpression(n.parent) && isNotEqualsOperator(n.parent));\n                        default:\n                            return \"quit\";\n                    }\n                });\n                return container || expr;\n            }\n            function isStringConcatenationValid(node) {\n                var _a = treeToArray(node), containsString = _a.containsString, areOperatorsValid = _a.areOperatorsValid;\n                return containsString && areOperatorsValid;\n            }\n            function treeToArray(current) {\n                if (ts.isBinaryExpression(current)) {\n                    var _a = treeToArray(current.left), nodes = _a.nodes, operators = _a.operators, leftHasString = _a.containsString, leftOperatorValid = _a.areOperatorsValid;\n                    if (!leftHasString && !ts.isStringLiteral(current.right) && !ts.isTemplateExpression(current.right)) {\n                        return { nodes: [current], operators: [], containsString: false, areOperatorsValid: true };\n                    }\n                    var currentOperatorValid = current.operatorToken.kind === 39 /* PlusToken */;\n                    var areOperatorsValid = leftOperatorValid && currentOperatorValid;\n                    nodes.push(current.right);\n                    operators.push(current.operatorToken);\n                    return { nodes: nodes, operators: operators, containsString: true, areOperatorsValid: areOperatorsValid };\n                }\n                return { nodes: [current], operators: [], containsString: ts.isStringLiteral(current), areOperatorsValid: true };\n            }\n            // to copy comments following the operator\n            // \"foo\" + /* comment */ \"bar\"\n            var copyTrailingOperatorComments = function (operators, file) { return function (index, targetNode) {\n                if (index < operators.length) {\n                    ts.copyTrailingComments(operators[index], targetNode, file, 3 /* MultiLineCommentTrivia */, /* hasTrailingNewLine */ false);\n                }\n            }; };\n            // to copy comments following the string\n            // \"foo\" /* comment */ + \"bar\" /* comment */ + \"bar2\"\n            var copyCommentFromMultiNode = function (nodes, file, copyOperatorComments) {\n                return function (indexes, targetNode) {\n                    while (indexes.length > 0) {\n                        var index = indexes.shift();\n                        ts.copyTrailingComments(nodes[index], targetNode, file, 3 /* MultiLineCommentTrivia */, /* hasTrailingNewLine */ false);\n                        copyOperatorComments(index, targetNode);\n                    }\n                };\n            };\n            function concatConsecutiveString(index, nodes) {\n                var indexes = [];\n                var text = \"\";\n                while (index < nodes.length) {\n                    var node = nodes[index];\n                    if (ts.isStringLiteralLike(node)) {\n                        text = text + node.text;\n                        indexes.push(index);\n                        index++;\n                    }\n                    else if (ts.isTemplateExpression(node)) {\n                        text = text + node.head.text;\n                        break;\n                    }\n                    else {\n                        break;\n                    }\n                }\n                return [index, text, indexes];\n            }\n            function nodesToTemplate(_a, file) {\n                var nodes = _a.nodes, operators = _a.operators;\n                var copyOperatorComments = copyTrailingOperatorComments(operators, file);\n                var copyCommentFromStringLiterals = copyCommentFromMultiNode(nodes, file, copyOperatorComments);\n                var _b = concatConsecutiveString(0, nodes), begin = _b[0], headText = _b[1], headIndexes = _b[2];\n                if (begin === nodes.length) {\n                    var noSubstitutionTemplateLiteral = ts.factory.createNoSubstitutionTemplateLiteral(headText);\n                    copyCommentFromStringLiterals(headIndexes, noSubstitutionTemplateLiteral);\n                    return noSubstitutionTemplateLiteral;\n                }\n                var templateSpans = [];\n                var templateHead = ts.factory.createTemplateHead(headText);\n                copyCommentFromStringLiterals(headIndexes, templateHead);\n                var _loop_19 = function (i) {\n                    var currentNode = getExpressionFromParenthesesOrExpression(nodes[i]);\n                    copyOperatorComments(i, currentNode);\n                    var _c = concatConsecutiveString(i + 1, nodes), newIndex = _c[0], subsequentText = _c[1], stringIndexes = _c[2];\n                    i = newIndex - 1;\n                    var isLast = i === nodes.length - 1;\n                    if (ts.isTemplateExpression(currentNode)) {\n                        var spans = ts.map(currentNode.templateSpans, function (span, index) {\n                            copyExpressionComments(span);\n                            var nextSpan = currentNode.templateSpans[index + 1];\n                            var text = span.literal.text + (nextSpan ? \"\" : subsequentText);\n                            return ts.factory.createTemplateSpan(span.expression, isLast ? ts.factory.createTemplateTail(text) : ts.factory.createTemplateMiddle(text));\n                        });\n                        templateSpans.push.apply(templateSpans, spans);\n                    }\n                    else {\n                        var templatePart = isLast ? ts.factory.createTemplateTail(subsequentText) : ts.factory.createTemplateMiddle(subsequentText);\n                        copyCommentFromStringLiterals(stringIndexes, templatePart);\n                        templateSpans.push(ts.factory.createTemplateSpan(currentNode, templatePart));\n                    }\n                    out_i_1 = i;\n                };\n                var out_i_1;\n                for (var i = begin; i < nodes.length; i++) {\n                    _loop_19(i);\n                    i = out_i_1;\n                }\n                return ts.factory.createTemplateExpression(templateHead, templateSpans);\n            }\n            // to copy comments following the opening & closing parentheses\n            // \"foo\" + ( /* comment */ 5 + 5 ) /* comment */ + \"bar\"\n            function copyExpressionComments(node) {\n                var file = node.getSourceFile();\n                ts.copyTrailingComments(node, node.expression, file, 3 /* MultiLineCommentTrivia */, /* hasTrailingNewLine */ false);\n                ts.copyTrailingAsLeadingComments(node.expression, node.expression, file, 3 /* MultiLineCommentTrivia */, /* hasTrailingNewLine */ false);\n            }\n            function getExpressionFromParenthesesOrExpression(node) {\n                if (ts.isParenthesizedExpression(node)) {\n                    copyExpressionComments(node);\n                    node = node.expression;\n                }\n                return node;\n            }\n        })(convertStringOrTemplateLiteral = refactor.convertStringOrTemplateLiteral || (refactor.convertStringOrTemplateLiteral = {}));\n    })(refactor = ts.refactor || (ts.refactor = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var refactor;\n    (function (refactor) {\n        var convertArrowFunctionOrFunctionExpression;\n        (function (convertArrowFunctionOrFunctionExpression) {\n            var refactorName = \"Convert arrow function or function expression\";\n            var refactorDescription = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_arrow_function_or_function_expression);\n            var toAnonymousFunctionAction = {\n                name: \"Convert to anonymous function\",\n                description: ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_anonymous_function),\n                kind: \"refactor.rewrite.function.anonymous\",\n            };\n            var toNamedFunctionAction = {\n                name: \"Convert to named function\",\n                description: ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_named_function),\n                kind: \"refactor.rewrite.function.named\",\n            };\n            var toArrowFunctionAction = {\n                name: \"Convert to arrow function\",\n                description: ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_arrow_function),\n                kind: \"refactor.rewrite.function.arrow\",\n            };\n            refactor.registerRefactor(refactorName, {\n                kinds: [\n                    toAnonymousFunctionAction.kind,\n                    toNamedFunctionAction.kind,\n                    toArrowFunctionAction.kind\n                ],\n                getEditsForAction: getEditsForAction,\n                getAvailableActions: getAvailableActions\n            });\n            function getAvailableActions(context) {\n                var file = context.file, startPosition = context.startPosition, program = context.program, kind = context.kind;\n                var info = getFunctionInfo(file, startPosition, program);\n                if (!info)\n                    return ts.emptyArray;\n                var selectedVariableDeclaration = info.selectedVariableDeclaration, func = info.func;\n                var possibleActions = [];\n                var errors = [];\n                if (refactor.refactorKindBeginsWith(toNamedFunctionAction.kind, kind)) {\n                    var error = selectedVariableDeclaration || (ts.isArrowFunction(func) && ts.isVariableDeclaration(func.parent)) ?\n                        undefined : ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_convert_to_named_function);\n                    if (error) {\n                        errors.push(__assign(__assign({}, toNamedFunctionAction), { notApplicableReason: error }));\n                    }\n                    else {\n                        possibleActions.push(toNamedFunctionAction);\n                    }\n                }\n                if (refactor.refactorKindBeginsWith(toAnonymousFunctionAction.kind, kind)) {\n                    var error = !selectedVariableDeclaration && ts.isArrowFunction(func) ?\n                        undefined : ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_convert_to_anonymous_function);\n                    if (error) {\n                        errors.push(__assign(__assign({}, toAnonymousFunctionAction), { notApplicableReason: error }));\n                    }\n                    else {\n                        possibleActions.push(toAnonymousFunctionAction);\n                    }\n                }\n                if (refactor.refactorKindBeginsWith(toArrowFunctionAction.kind, kind)) {\n                    var error = ts.isFunctionExpression(func) ? undefined : ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_convert_to_arrow_function);\n                    if (error) {\n                        errors.push(__assign(__assign({}, toArrowFunctionAction), { notApplicableReason: error }));\n                    }\n                    else {\n                        possibleActions.push(toArrowFunctionAction);\n                    }\n                }\n                return [{\n                        name: refactorName,\n                        description: refactorDescription,\n                        actions: possibleActions.length === 0 && context.preferences.provideRefactorNotApplicableReason ?\n                            errors : possibleActions\n                    }];\n            }\n            function getEditsForAction(context, actionName) {\n                var file = context.file, startPosition = context.startPosition, program = context.program;\n                var info = getFunctionInfo(file, startPosition, program);\n                if (!info)\n                    return undefined;\n                var func = info.func;\n                var edits = [];\n                switch (actionName) {\n                    case toAnonymousFunctionAction.name:\n                        edits.push.apply(edits, getEditInfoForConvertToAnonymousFunction(context, func));\n                        break;\n                    case toNamedFunctionAction.name:\n                        var variableInfo = getVariableInfo(func);\n                        if (!variableInfo)\n                            return undefined;\n                        edits.push.apply(edits, getEditInfoForConvertToNamedFunction(context, func, variableInfo));\n                        break;\n                    case toArrowFunctionAction.name:\n                        if (!ts.isFunctionExpression(func))\n                            return undefined;\n                        edits.push.apply(edits, getEditInfoForConvertToArrowFunction(context, func));\n                        break;\n                    default:\n                        return ts.Debug.fail(\"invalid action\");\n                }\n                return { renameFilename: undefined, renameLocation: undefined, edits: edits };\n            }\n            function containingThis(node) {\n                var containsThis = false;\n                node.forEachChild(function checkThis(child) {\n                    if (ts.isThis(child)) {\n                        containsThis = true;\n                        return;\n                    }\n                    if (!ts.isClassLike(child) && !ts.isFunctionDeclaration(child) && !ts.isFunctionExpression(child)) {\n                        ts.forEachChild(child, checkThis);\n                    }\n                });\n                return containsThis;\n            }\n            function getFunctionInfo(file, startPosition, program) {\n                var token = ts.getTokenAtPosition(file, startPosition);\n                var typeChecker = program.getTypeChecker();\n                var func = tryGetFunctionFromVariableDeclaration(file, typeChecker, token.parent);\n                if (func && !containingThis(func.body)) {\n                    return { selectedVariableDeclaration: true, func: func };\n                }\n                var maybeFunc = ts.getContainingFunction(token);\n                if (maybeFunc &&\n                    (ts.isFunctionExpression(maybeFunc) || ts.isArrowFunction(maybeFunc)) &&\n                    !ts.rangeContainsRange(maybeFunc.body, token) &&\n                    !containingThis(maybeFunc.body)) {\n                    if (ts.isFunctionExpression(maybeFunc) && isFunctionReferencedInFile(file, typeChecker, maybeFunc))\n                        return undefined;\n                    return { selectedVariableDeclaration: false, func: maybeFunc };\n                }\n                return undefined;\n            }\n            function isSingleVariableDeclaration(parent) {\n                return ts.isVariableDeclaration(parent) || (ts.isVariableDeclarationList(parent) && parent.declarations.length === 1);\n            }\n            function tryGetFunctionFromVariableDeclaration(sourceFile, typeChecker, parent) {\n                if (!isSingleVariableDeclaration(parent)) {\n                    return undefined;\n                }\n                var variableDeclaration = ts.isVariableDeclaration(parent) ? parent : ts.first(parent.declarations);\n                var initializer = variableDeclaration.initializer;\n                if (initializer && (ts.isArrowFunction(initializer) || ts.isFunctionExpression(initializer) && !isFunctionReferencedInFile(sourceFile, typeChecker, initializer))) {\n                    return initializer;\n                }\n                return undefined;\n            }\n            function convertToBlock(body) {\n                if (ts.isExpression(body)) {\n                    return ts.factory.createBlock([ts.factory.createReturnStatement(body)], /* multiLine */ true);\n                }\n                else {\n                    return body;\n                }\n            }\n            function getVariableInfo(func) {\n                var variableDeclaration = func.parent;\n                if (!ts.isVariableDeclaration(variableDeclaration) || !ts.isVariableDeclarationInVariableStatement(variableDeclaration))\n                    return undefined;\n                var variableDeclarationList = variableDeclaration.parent;\n                var statement = variableDeclarationList.parent;\n                if (!ts.isVariableDeclarationList(variableDeclarationList) || !ts.isVariableStatement(statement) || !ts.isIdentifier(variableDeclaration.name))\n                    return undefined;\n                return { variableDeclaration: variableDeclaration, variableDeclarationList: variableDeclarationList, statement: statement, name: variableDeclaration.name };\n            }\n            function getEditInfoForConvertToAnonymousFunction(context, func) {\n                var file = context.file;\n                var body = convertToBlock(func.body);\n                var newNode = ts.factory.createFunctionExpression(func.modifiers, func.asteriskToken, /* name */ undefined, func.typeParameters, func.parameters, func.type, body);\n                return ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceNode(file, func, newNode); });\n            }\n            function getEditInfoForConvertToNamedFunction(context, func, variableInfo) {\n                var file = context.file;\n                var body = convertToBlock(func.body);\n                var variableDeclaration = variableInfo.variableDeclaration, variableDeclarationList = variableInfo.variableDeclarationList, statement = variableInfo.statement, name = variableInfo.name;\n                ts.suppressLeadingTrivia(statement);\n                var newNode = ts.factory.createFunctionDeclaration(func.decorators, statement.modifiers, func.asteriskToken, name, func.typeParameters, func.parameters, func.type, body);\n                if (variableDeclarationList.declarations.length === 1) {\n                    return ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceNode(file, statement, newNode); });\n                }\n                else {\n                    return ts.textChanges.ChangeTracker.with(context, function (t) {\n                        t.delete(file, variableDeclaration);\n                        t.insertNodeAfter(file, statement, newNode);\n                    });\n                }\n            }\n            function getEditInfoForConvertToArrowFunction(context, func) {\n                var file = context.file;\n                var statements = func.body.statements;\n                var head = statements[0];\n                var body;\n                if (canBeConvertedToExpression(func.body, head)) {\n                    body = head.expression;\n                    ts.suppressLeadingAndTrailingTrivia(body);\n                    ts.copyComments(head, body);\n                }\n                else {\n                    body = func.body;\n                }\n                var newNode = ts.factory.createArrowFunction(func.modifiers, func.typeParameters, func.parameters, func.type, ts.factory.createToken(38 /* EqualsGreaterThanToken */), body);\n                return ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceNode(file, func, newNode); });\n            }\n            function canBeConvertedToExpression(body, head) {\n                return body.statements.length === 1 && ((ts.isReturnStatement(head) && !!head.expression));\n            }\n            function isFunctionReferencedInFile(sourceFile, typeChecker, node) {\n                return !!node.name && ts.FindAllReferences.Core.isSymbolReferencedInFile(node.name, typeChecker, sourceFile);\n            }\n        })(convertArrowFunctionOrFunctionExpression = refactor.convertArrowFunctionOrFunctionExpression || (refactor.convertArrowFunctionOrFunctionExpression = {}));\n    })(refactor = ts.refactor || (ts.refactor = {}));\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var refactor;\n    (function (refactor) {\n        var inferFunctionReturnType;\n        (function (inferFunctionReturnType) {\n            var refactorName = \"Infer function return type\";\n            var refactorDescription = ts.Diagnostics.Infer_function_return_type.message;\n            var inferReturnTypeAction = {\n                name: refactorName,\n                description: refactorDescription,\n                kind: \"refactor.rewrite.function.returnType\"\n            };\n            refactor.registerRefactor(refactorName, {\n                kinds: [inferReturnTypeAction.kind],\n                getEditsForAction: getEditsForAction,\n                getAvailableActions: getAvailableActions\n            });\n            function getEditsForAction(context) {\n                var info = getInfo(context);\n                if (info && !refactor.isRefactorErrorInfo(info)) {\n                    var edits = ts.textChanges.ChangeTracker.with(context, function (t) {\n                        return t.tryInsertTypeAnnotation(context.file, info.declaration, info.returnTypeNode);\n                    });\n                    return { renameFilename: undefined, renameLocation: undefined, edits: edits };\n                }\n                return undefined;\n            }\n            function getAvailableActions(context) {\n                var info = getInfo(context);\n                if (!info)\n                    return ts.emptyArray;\n                if (!refactor.isRefactorErrorInfo(info)) {\n                    return [{\n                            name: refactorName,\n                            description: refactorDescription,\n                            actions: [inferReturnTypeAction]\n                        }];\n                }\n                if (context.preferences.provideRefactorNotApplicableReason) {\n                    return [{\n                            name: refactorName,\n                            description: refactorDescription,\n                            actions: [__assign(__assign({}, inferReturnTypeAction), { notApplicableReason: info.error })]\n                        }];\n                }\n                return ts.emptyArray;\n            }\n            function getInfo(context) {\n                if (ts.isInJSFile(context.file) || !refactor.refactorKindBeginsWith(inferReturnTypeAction.kind, context.kind))\n                    return;\n                var token = ts.getTokenAtPosition(context.file, context.startPosition);\n                var declaration = ts.findAncestor(token, isConvertibleDeclaration);\n                if (!declaration || !declaration.body || declaration.type) {\n                    return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Return_type_must_be_inferred_from_a_function) };\n                }\n                var typeChecker = context.program.getTypeChecker();\n                var returnType = tryGetReturnType(typeChecker, declaration);\n                if (!returnType) {\n                    return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_determine_function_return_type) };\n                }\n                ;\n                var returnTypeNode = typeChecker.typeToTypeNode(returnType, declaration, 1 /* NoTruncation */);\n                if (returnTypeNode) {\n                    return { declaration: declaration, returnTypeNode: returnTypeNode };\n                }\n            }\n            function isConvertibleDeclaration(node) {\n                switch (node.kind) {\n                    case 251 /* FunctionDeclaration */:\n                    case 208 /* FunctionExpression */:\n                    case 209 /* ArrowFunction */:\n                    case 165 /* MethodDeclaration */:\n                        return true;\n                    default:\n                        return false;\n                }\n            }\n            function tryGetReturnType(typeChecker, node) {\n                if (typeChecker.isImplementationOfOverload(node)) {\n                    var signatures = typeChecker.getTypeAtLocation(node).getCallSignatures();\n                    if (signatures.length > 1) {\n                        return typeChecker.getUnionType(ts.mapDefined(signatures, function (s) { return s.getReturnType(); }));\n                    }\n                }\n                var signature = typeChecker.getSignatureFromDeclaration(node);\n                if (signature) {\n                    return typeChecker.getReturnTypeOfSignature(signature);\n                }\n            }\n        })(inferFunctionReturnType = refactor.inferFunctionReturnType || (refactor.inferFunctionReturnType = {}));\n    })(refactor = ts.refactor || (ts.refactor = {}));\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    /** The version of the language service API */\n    ts.servicesVersion = \"0.8\";\n    function createNode(kind, pos, end, parent) {\n        var node = ts.isNodeKind(kind) ? new NodeObject(kind, pos, end) :\n            kind === 78 /* Identifier */ ? new IdentifierObject(78 /* Identifier */, pos, end) :\n                kind === 79 /* PrivateIdentifier */ ? new PrivateIdentifierObject(79 /* PrivateIdentifier */, pos, end) :\n                    new TokenObject(kind, pos, end);\n        node.parent = parent;\n        node.flags = parent.flags & 25358336 /* ContextFlags */;\n        return node;\n    }\n    var NodeObject = /** @class */ (function () {\n        function NodeObject(kind, pos, end) {\n            this.pos = pos;\n            this.end = end;\n            this.flags = 0 /* None */;\n            this.modifierFlagsCache = 0 /* None */;\n            this.transformFlags = 0 /* None */;\n            this.parent = undefined;\n            this.kind = kind;\n        }\n        NodeObject.prototype.assertHasRealPosition = function (message) {\n            // eslint-disable-next-line debug-assert\n            ts.Debug.assert(!ts.positionIsSynthesized(this.pos) && !ts.positionIsSynthesized(this.end), message || \"Node must have a real position for this operation\");\n        };\n        NodeObject.prototype.getSourceFile = function () {\n            return ts.getSourceFileOfNode(this);\n        };\n        NodeObject.prototype.getStart = function (sourceFile, includeJsDocComment) {\n            this.assertHasRealPosition();\n            return ts.getTokenPosOfNode(this, sourceFile, includeJsDocComment);\n        };\n        NodeObject.prototype.getFullStart = function () {\n            this.assertHasRealPosition();\n            return this.pos;\n        };\n        NodeObject.prototype.getEnd = function () {\n            this.assertHasRealPosition();\n            return this.end;\n        };\n        NodeObject.prototype.getWidth = function (sourceFile) {\n            this.assertHasRealPosition();\n            return this.getEnd() - this.getStart(sourceFile);\n        };\n        NodeObject.prototype.getFullWidth = function () {\n            this.assertHasRealPosition();\n            return this.end - this.pos;\n        };\n        NodeObject.prototype.getLeadingTriviaWidth = function (sourceFile) {\n            this.assertHasRealPosition();\n            return this.getStart(sourceFile) - this.pos;\n        };\n        NodeObject.prototype.getFullText = function (sourceFile) {\n            this.assertHasRealPosition();\n            return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end);\n        };\n        NodeObject.prototype.getText = function (sourceFile) {\n            this.assertHasRealPosition();\n            if (!sourceFile) {\n                sourceFile = this.getSourceFile();\n            }\n            return sourceFile.text.substring(this.getStart(sourceFile), this.getEnd());\n        };\n        NodeObject.prototype.getChildCount = function (sourceFile) {\n            return this.getChildren(sourceFile).length;\n        };\n        NodeObject.prototype.getChildAt = function (index, sourceFile) {\n            return this.getChildren(sourceFile)[index];\n        };\n        NodeObject.prototype.getChildren = function (sourceFile) {\n            this.assertHasRealPosition(\"Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine\");\n            return this._children || (this._children = createChildren(this, sourceFile));\n        };\n        NodeObject.prototype.getFirstToken = function (sourceFile) {\n            this.assertHasRealPosition();\n            var children = this.getChildren(sourceFile);\n            if (!children.length) {\n                return undefined;\n            }\n            var child = ts.find(children, function (kid) { return kid.kind < 301 /* FirstJSDocNode */ || kid.kind > 333 /* LastJSDocNode */; });\n            return child.kind < 157 /* FirstNode */ ?\n                child :\n                child.getFirstToken(sourceFile);\n        };\n        NodeObject.prototype.getLastToken = function (sourceFile) {\n            this.assertHasRealPosition();\n            var children = this.getChildren(sourceFile);\n            var child = ts.lastOrUndefined(children);\n            if (!child) {\n                return undefined;\n            }\n            return child.kind < 157 /* FirstNode */ ? child : child.getLastToken(sourceFile);\n        };\n        NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) {\n            return ts.forEachChild(this, cbNode, cbNodeArray);\n        };\n        return NodeObject;\n    }());\n    function createChildren(node, sourceFile) {\n        if (!ts.isNodeKind(node.kind)) {\n            return ts.emptyArray;\n        }\n        var children = [];\n        if (ts.isJSDocCommentContainingNode(node)) {\n            /** Don't add trivia for \"tokens\" since this is in a comment. */\n            node.forEachChild(function (child) { children.push(child); });\n            return children;\n        }\n        ts.scanner.setText((sourceFile || node.getSourceFile()).text);\n        var pos = node.pos;\n        var processNode = function (child) {\n            addSyntheticNodes(children, pos, child.pos, node);\n            children.push(child);\n            pos = child.end;\n        };\n        var processNodes = function (nodes) {\n            addSyntheticNodes(children, pos, nodes.pos, node);\n            children.push(createSyntaxList(nodes, node));\n            pos = nodes.end;\n        };\n        // jsDocComments need to be the first children\n        ts.forEach(node.jsDoc, processNode);\n        // For syntactic classifications, all trivia are classified together, including jsdoc comments.\n        // For that to work, the jsdoc comments should still be the leading trivia of the first child.\n        // Restoring the scanner position ensures that.\n        pos = node.pos;\n        node.forEachChild(processNode, processNodes);\n        addSyntheticNodes(children, pos, node.end, node);\n        ts.scanner.setText(undefined);\n        return children;\n    }\n    function addSyntheticNodes(nodes, pos, end, parent) {\n        ts.scanner.setTextPos(pos);\n        while (pos < end) {\n            var token = ts.scanner.scan();\n            var textPos = ts.scanner.getTextPos();\n            if (textPos <= end) {\n                if (token === 78 /* Identifier */) {\n                    ts.Debug.fail(\"Did not expect \" + ts.Debug.formatSyntaxKind(parent.kind) + \" to have an Identifier in its trivia\");\n                }\n                nodes.push(createNode(token, pos, textPos, parent));\n            }\n            pos = textPos;\n            if (token === 1 /* EndOfFileToken */) {\n                break;\n            }\n        }\n    }\n    function createSyntaxList(nodes, parent) {\n        var list = createNode(334 /* SyntaxList */, nodes.pos, nodes.end, parent);\n        list._children = [];\n        var pos = nodes.pos;\n        for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {\n            var node = nodes_1[_i];\n            addSyntheticNodes(list._children, pos, node.pos, parent);\n            list._children.push(node);\n            pos = node.end;\n        }\n        addSyntheticNodes(list._children, pos, nodes.end, parent);\n        return list;\n    }\n    var TokenOrIdentifierObject = /** @class */ (function () {\n        function TokenOrIdentifierObject(pos, end) {\n            // Set properties in same order as NodeObject\n            this.pos = pos;\n            this.end = end;\n            this.flags = 0 /* None */;\n            this.modifierFlagsCache = 0 /* None */;\n            this.transformFlags = 0 /* None */;\n            this.parent = undefined;\n        }\n        TokenOrIdentifierObject.prototype.getSourceFile = function () {\n            return ts.getSourceFileOfNode(this);\n        };\n        TokenOrIdentifierObject.prototype.getStart = function (sourceFile, includeJsDocComment) {\n            return ts.getTokenPosOfNode(this, sourceFile, includeJsDocComment);\n        };\n        TokenOrIdentifierObject.prototype.getFullStart = function () {\n            return this.pos;\n        };\n        TokenOrIdentifierObject.prototype.getEnd = function () {\n            return this.end;\n        };\n        TokenOrIdentifierObject.prototype.getWidth = function (sourceFile) {\n            return this.getEnd() - this.getStart(sourceFile);\n        };\n        TokenOrIdentifierObject.prototype.getFullWidth = function () {\n            return this.end - this.pos;\n        };\n        TokenOrIdentifierObject.prototype.getLeadingTriviaWidth = function (sourceFile) {\n            return this.getStart(sourceFile) - this.pos;\n        };\n        TokenOrIdentifierObject.prototype.getFullText = function (sourceFile) {\n            return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end);\n        };\n        TokenOrIdentifierObject.prototype.getText = function (sourceFile) {\n            if (!sourceFile) {\n                sourceFile = this.getSourceFile();\n            }\n            return sourceFile.text.substring(this.getStart(sourceFile), this.getEnd());\n        };\n        TokenOrIdentifierObject.prototype.getChildCount = function () {\n            return 0;\n        };\n        TokenOrIdentifierObject.prototype.getChildAt = function () {\n            return undefined; // TODO: GH#18217\n        };\n        TokenOrIdentifierObject.prototype.getChildren = function () {\n            return this.kind === 1 /* EndOfFileToken */ ? this.jsDoc || ts.emptyArray : ts.emptyArray;\n        };\n        TokenOrIdentifierObject.prototype.getFirstToken = function () {\n            return undefined;\n        };\n        TokenOrIdentifierObject.prototype.getLastToken = function () {\n            return undefined;\n        };\n        TokenOrIdentifierObject.prototype.forEachChild = function () {\n            return undefined;\n        };\n        return TokenOrIdentifierObject;\n    }());\n    var SymbolObject = /** @class */ (function () {\n        function SymbolObject(flags, name) {\n            this.flags = flags;\n            this.escapedName = name;\n        }\n        SymbolObject.prototype.getFlags = function () {\n            return this.flags;\n        };\n        Object.defineProperty(SymbolObject.prototype, \"name\", {\n            get: function () {\n                return ts.symbolName(this);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        SymbolObject.prototype.getEscapedName = function () {\n            return this.escapedName;\n        };\n        SymbolObject.prototype.getName = function () {\n            return this.name;\n        };\n        SymbolObject.prototype.getDeclarations = function () {\n            return this.declarations;\n        };\n        SymbolObject.prototype.getDocumentationComment = function (checker) {\n            if (!this.documentationComment) {\n                this.documentationComment = ts.emptyArray; // Set temporarily to avoid an infinite loop finding inherited docs\n                if (!this.declarations && this.target && this.target.tupleLabelDeclaration) {\n                    var labelDecl = this.target.tupleLabelDeclaration;\n                    this.documentationComment = getDocumentationComment([labelDecl], checker);\n                }\n                else {\n                    this.documentationComment = getDocumentationComment(this.declarations, checker);\n                }\n            }\n            return this.documentationComment;\n        };\n        SymbolObject.prototype.getContextualDocumentationComment = function (context, checker) {\n            switch (context === null || context === void 0 ? void 0 : context.kind) {\n                case 167 /* GetAccessor */:\n                    if (!this.contextualGetAccessorDocumentationComment) {\n                        this.contextualGetAccessorDocumentationComment = ts.emptyArray;\n                        this.contextualGetAccessorDocumentationComment = getDocumentationComment(ts.filter(this.declarations, ts.isGetAccessor), checker);\n                    }\n                    return this.contextualGetAccessorDocumentationComment;\n                case 168 /* SetAccessor */:\n                    if (!this.contextualSetAccessorDocumentationComment) {\n                        this.contextualSetAccessorDocumentationComment = ts.emptyArray;\n                        this.contextualSetAccessorDocumentationComment = getDocumentationComment(ts.filter(this.declarations, ts.isSetAccessor), checker);\n                    }\n                    return this.contextualSetAccessorDocumentationComment;\n                default:\n                    return this.getDocumentationComment(checker);\n            }\n        };\n        SymbolObject.prototype.getJsDocTags = function () {\n            if (this.tags === undefined) {\n                this.tags = ts.JsDoc.getJsDocTagsFromDeclarations(this.declarations);\n            }\n            return this.tags;\n        };\n        return SymbolObject;\n    }());\n    var TokenObject = /** @class */ (function (_super) {\n        __extends(TokenObject, _super);\n        function TokenObject(kind, pos, end) {\n            var _this = _super.call(this, pos, end) || this;\n            _this.kind = kind;\n            return _this;\n        }\n        return TokenObject;\n    }(TokenOrIdentifierObject));\n    var IdentifierObject = /** @class */ (function (_super) {\n        __extends(IdentifierObject, _super);\n        function IdentifierObject(_kind, pos, end) {\n            var _this = _super.call(this, pos, end) || this;\n            _this.kind = 78 /* Identifier */;\n            return _this;\n        }\n        Object.defineProperty(IdentifierObject.prototype, \"text\", {\n            get: function () {\n                return ts.idText(this);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return IdentifierObject;\n    }(TokenOrIdentifierObject));\n    IdentifierObject.prototype.kind = 78 /* Identifier */;\n    var PrivateIdentifierObject = /** @class */ (function (_super) {\n        __extends(PrivateIdentifierObject, _super);\n        function PrivateIdentifierObject(_kind, pos, end) {\n            return _super.call(this, pos, end) || this;\n        }\n        Object.defineProperty(PrivateIdentifierObject.prototype, \"text\", {\n            get: function () {\n                return ts.idText(this);\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return PrivateIdentifierObject;\n    }(TokenOrIdentifierObject));\n    PrivateIdentifierObject.prototype.kind = 79 /* PrivateIdentifier */;\n    var TypeObject = /** @class */ (function () {\n        function TypeObject(checker, flags) {\n            this.checker = checker;\n            this.flags = flags;\n        }\n        TypeObject.prototype.getFlags = function () {\n            return this.flags;\n        };\n        TypeObject.prototype.getSymbol = function () {\n            return this.symbol;\n        };\n        TypeObject.prototype.getProperties = function () {\n            return this.checker.getPropertiesOfType(this);\n        };\n        TypeObject.prototype.getProperty = function (propertyName) {\n            return this.checker.getPropertyOfType(this, propertyName);\n        };\n        TypeObject.prototype.getApparentProperties = function () {\n            return this.checker.getAugmentedPropertiesOfType(this);\n        };\n        TypeObject.prototype.getCallSignatures = function () {\n            return this.checker.getSignaturesOfType(this, 0 /* Call */);\n        };\n        TypeObject.prototype.getConstructSignatures = function () {\n            return this.checker.getSignaturesOfType(this, 1 /* Construct */);\n        };\n        TypeObject.prototype.getStringIndexType = function () {\n            return this.checker.getIndexTypeOfType(this, 0 /* String */);\n        };\n        TypeObject.prototype.getNumberIndexType = function () {\n            return this.checker.getIndexTypeOfType(this, 1 /* Number */);\n        };\n        TypeObject.prototype.getBaseTypes = function () {\n            return this.isClassOrInterface() ? this.checker.getBaseTypes(this) : undefined;\n        };\n        TypeObject.prototype.isNullableType = function () {\n            return this.checker.isNullableType(this);\n        };\n        TypeObject.prototype.getNonNullableType = function () {\n            return this.checker.getNonNullableType(this);\n        };\n        TypeObject.prototype.getNonOptionalType = function () {\n            return this.checker.getNonOptionalType(this);\n        };\n        TypeObject.prototype.getConstraint = function () {\n            return this.checker.getBaseConstraintOfType(this);\n        };\n        TypeObject.prototype.getDefault = function () {\n            return this.checker.getDefaultFromTypeParameter(this);\n        };\n        TypeObject.prototype.isUnion = function () {\n            return !!(this.flags & 1048576 /* Union */);\n        };\n        TypeObject.prototype.isIntersection = function () {\n            return !!(this.flags & 2097152 /* Intersection */);\n        };\n        TypeObject.prototype.isUnionOrIntersection = function () {\n            return !!(this.flags & 3145728 /* UnionOrIntersection */);\n        };\n        TypeObject.prototype.isLiteral = function () {\n            return !!(this.flags & 384 /* StringOrNumberLiteral */);\n        };\n        TypeObject.prototype.isStringLiteral = function () {\n            return !!(this.flags & 128 /* StringLiteral */);\n        };\n        TypeObject.prototype.isNumberLiteral = function () {\n            return !!(this.flags & 256 /* NumberLiteral */);\n        };\n        TypeObject.prototype.isTypeParameter = function () {\n            return !!(this.flags & 262144 /* TypeParameter */);\n        };\n        TypeObject.prototype.isClassOrInterface = function () {\n            return !!(ts.getObjectFlags(this) & 3 /* ClassOrInterface */);\n        };\n        TypeObject.prototype.isClass = function () {\n            return !!(ts.getObjectFlags(this) & 1 /* Class */);\n        };\n        Object.defineProperty(TypeObject.prototype, \"typeArguments\", {\n            /**\n             * This polyfills `referenceType.typeArguments` for API consumers\n             */\n            get: function () {\n                if (ts.getObjectFlags(this) & 4 /* Reference */) {\n                    return this.checker.getTypeArguments(this);\n                }\n                return undefined;\n            },\n            enumerable: false,\n            configurable: true\n        });\n        return TypeObject;\n    }());\n    var SignatureObject = /** @class */ (function () {\n        function SignatureObject(checker, flags) {\n            this.checker = checker;\n            this.flags = flags;\n        }\n        SignatureObject.prototype.getDeclaration = function () {\n            return this.declaration;\n        };\n        SignatureObject.prototype.getTypeParameters = function () {\n            return this.typeParameters;\n        };\n        SignatureObject.prototype.getParameters = function () {\n            return this.parameters;\n        };\n        SignatureObject.prototype.getReturnType = function () {\n            return this.checker.getReturnTypeOfSignature(this);\n        };\n        SignatureObject.prototype.getDocumentationComment = function () {\n            return this.documentationComment || (this.documentationComment = getDocumentationComment(ts.singleElementArray(this.declaration), this.checker));\n        };\n        SignatureObject.prototype.getJsDocTags = function () {\n            if (this.jsDocTags === undefined) {\n                this.jsDocTags = this.declaration ? getJsDocTags([this.declaration], this.checker) : [];\n            }\n            return this.jsDocTags;\n        };\n        return SignatureObject;\n    }());\n    /**\n     * Returns whether or not the given node has a JSDoc \"inheritDoc\" tag on it.\n     * @param node the Node in question.\n     * @returns `true` if `node` has a JSDoc \"inheritDoc\" tag on it, otherwise `false`.\n     */\n    function hasJSDocInheritDocTag(node) {\n        return ts.getJSDocTags(node).some(function (tag) { return tag.tagName.text === \"inheritDoc\"; });\n    }\n    function getJsDocTags(declarations, checker) {\n        var tags = ts.JsDoc.getJsDocTagsFromDeclarations(declarations);\n        if (tags.length === 0 || declarations.some(hasJSDocInheritDocTag)) {\n            ts.forEachUnique(declarations, function (declaration) {\n                var inheritedTags = findBaseOfDeclaration(checker, declaration, function (symbol) { return symbol.getJsDocTags(); });\n                if (inheritedTags) {\n                    tags = __spreadArray(__spreadArray([], inheritedTags), tags);\n                }\n            });\n        }\n        return tags;\n    }\n    function getDocumentationComment(declarations, checker) {\n        if (!declarations)\n            return ts.emptyArray;\n        var doc = ts.JsDoc.getJsDocCommentsFromDeclarations(declarations);\n        if (checker && (doc.length === 0 || declarations.some(hasJSDocInheritDocTag))) {\n            ts.forEachUnique(declarations, function (declaration) {\n                var inheritedDocs = findBaseOfDeclaration(checker, declaration, function (symbol) { return symbol.getDocumentationComment(checker); });\n                // TODO: GH#16312 Return a ReadonlyArray, avoid copying inheritedDocs\n                if (inheritedDocs)\n                    doc = doc.length === 0 ? inheritedDocs.slice() : inheritedDocs.concat(ts.lineBreakPart(), doc);\n            });\n        }\n        return doc;\n    }\n    function findBaseOfDeclaration(checker, declaration, cb) {\n        return ts.firstDefined(declaration.parent ? ts.getAllSuperTypeNodes(declaration.parent) : ts.emptyArray, function (superTypeNode) {\n            var symbol = checker.getPropertyOfType(checker.getTypeAtLocation(superTypeNode), declaration.symbol.name);\n            return symbol ? cb(symbol) : undefined;\n        });\n    }\n    var SourceFileObject = /** @class */ (function (_super) {\n        __extends(SourceFileObject, _super);\n        function SourceFileObject(kind, pos, end) {\n            var _this = _super.call(this, kind, pos, end) || this;\n            _this.kind = 297 /* SourceFile */;\n            return _this;\n        }\n        SourceFileObject.prototype.update = function (newText, textChangeRange) {\n            return ts.updateSourceFile(this, newText, textChangeRange);\n        };\n        SourceFileObject.prototype.getLineAndCharacterOfPosition = function (position) {\n            return ts.getLineAndCharacterOfPosition(this, position);\n        };\n        SourceFileObject.prototype.getLineStarts = function () {\n            return ts.getLineStarts(this);\n        };\n        SourceFileObject.prototype.getPositionOfLineAndCharacter = function (line, character, allowEdits) {\n            return ts.computePositionOfLineAndCharacter(ts.getLineStarts(this), line, character, this.text, allowEdits);\n        };\n        SourceFileObject.prototype.getLineEndOfPosition = function (pos) {\n            var line = this.getLineAndCharacterOfPosition(pos).line;\n            var lineStarts = this.getLineStarts();\n            var lastCharPos;\n            if (line + 1 >= lineStarts.length) {\n                lastCharPos = this.getEnd();\n            }\n            if (!lastCharPos) {\n                lastCharPos = lineStarts[line + 1] - 1;\n            }\n            var fullText = this.getFullText();\n            // if the new line is \"\\r\\n\", we should return the last non-new-line-character position\n            return fullText[lastCharPos] === \"\\n\" && fullText[lastCharPos - 1] === \"\\r\" ? lastCharPos - 1 : lastCharPos;\n        };\n        SourceFileObject.prototype.getNamedDeclarations = function () {\n            if (!this.namedDeclarations) {\n                this.namedDeclarations = this.computeNamedDeclarations();\n            }\n            return this.namedDeclarations;\n        };\n        SourceFileObject.prototype.computeNamedDeclarations = function () {\n            var result = ts.createMultiMap();\n            this.forEachChild(visit);\n            return result;\n            function addDeclaration(declaration) {\n                var name = getDeclarationName(declaration);\n                if (name) {\n                    result.add(name, declaration);\n                }\n            }\n            function getDeclarations(name) {\n                var declarations = result.get(name);\n                if (!declarations) {\n                    result.set(name, declarations = []);\n                }\n                return declarations;\n            }\n            function getDeclarationName(declaration) {\n                var name = ts.getNonAssignedNameOfDeclaration(declaration);\n                return name && (ts.isComputedPropertyName(name) && ts.isPropertyAccessExpression(name.expression) ? name.expression.name.text\n                    : ts.isPropertyName(name) ? ts.getNameFromPropertyName(name) : undefined);\n            }\n            function visit(node) {\n                switch (node.kind) {\n                    case 251 /* FunctionDeclaration */:\n                    case 208 /* FunctionExpression */:\n                    case 165 /* MethodDeclaration */:\n                    case 164 /* MethodSignature */:\n                        var functionDeclaration = node;\n                        var declarationName = getDeclarationName(functionDeclaration);\n                        if (declarationName) {\n                            var declarations = getDeclarations(declarationName);\n                            var lastDeclaration = ts.lastOrUndefined(declarations);\n                            // Check whether this declaration belongs to an \"overload group\".\n                            if (lastDeclaration && functionDeclaration.parent === lastDeclaration.parent && functionDeclaration.symbol === lastDeclaration.symbol) {\n                                // Overwrite the last declaration if it was an overload\n                                // and this one is an implementation.\n                                if (functionDeclaration.body && !lastDeclaration.body) {\n                                    declarations[declarations.length - 1] = functionDeclaration;\n                                }\n                            }\n                            else {\n                                declarations.push(functionDeclaration);\n                            }\n                        }\n                        ts.forEachChild(node, visit);\n                        break;\n                    case 252 /* ClassDeclaration */:\n                    case 221 /* ClassExpression */:\n                    case 253 /* InterfaceDeclaration */:\n                    case 254 /* TypeAliasDeclaration */:\n                    case 255 /* EnumDeclaration */:\n                    case 256 /* ModuleDeclaration */:\n                    case 260 /* ImportEqualsDeclaration */:\n                    case 270 /* ExportSpecifier */:\n                    case 265 /* ImportSpecifier */:\n                    case 262 /* ImportClause */:\n                    case 263 /* NamespaceImport */:\n                    case 167 /* GetAccessor */:\n                    case 168 /* SetAccessor */:\n                    case 177 /* TypeLiteral */:\n                        addDeclaration(node);\n                        ts.forEachChild(node, visit);\n                        break;\n                    case 160 /* Parameter */:\n                        // Only consider parameter properties\n                        if (!ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */)) {\n                            break;\n                        }\n                    // falls through\n                    case 249 /* VariableDeclaration */:\n                    case 198 /* BindingElement */: {\n                        var decl = node;\n                        if (ts.isBindingPattern(decl.name)) {\n                            ts.forEachChild(decl.name, visit);\n                            break;\n                        }\n                        if (decl.initializer) {\n                            visit(decl.initializer);\n                        }\n                    }\n                    // falls through\n                    case 291 /* EnumMember */:\n                    case 163 /* PropertyDeclaration */:\n                    case 162 /* PropertySignature */:\n                        addDeclaration(node);\n                        break;\n                    case 267 /* ExportDeclaration */:\n                        // Handle named exports case e.g.:\n                        //    export {a, b as B} from \"mod\";\n                        var exportDeclaration = node;\n                        if (exportDeclaration.exportClause) {\n                            if (ts.isNamedExports(exportDeclaration.exportClause)) {\n                                ts.forEach(exportDeclaration.exportClause.elements, visit);\n                            }\n                            else {\n                                visit(exportDeclaration.exportClause.name);\n                            }\n                        }\n                        break;\n                    case 261 /* ImportDeclaration */:\n                        var importClause = node.importClause;\n                        if (importClause) {\n                            // Handle default import case e.g.:\n                            //    import d from \"mod\";\n                            if (importClause.name) {\n                                addDeclaration(importClause.name);\n                            }\n                            // Handle named bindings in imports e.g.:\n                            //    import * as NS from \"mod\";\n                            //    import {a, b as B} from \"mod\";\n                            if (importClause.namedBindings) {\n                                if (importClause.namedBindings.kind === 263 /* NamespaceImport */) {\n                                    addDeclaration(importClause.namedBindings);\n                                }\n                                else {\n                                    ts.forEach(importClause.namedBindings.elements, visit);\n                                }\n                            }\n                        }\n                        break;\n                    case 216 /* BinaryExpression */:\n                        if (ts.getAssignmentDeclarationKind(node) !== 0 /* None */) {\n                            addDeclaration(node);\n                        }\n                    // falls through\n                    default:\n                        ts.forEachChild(node, visit);\n                }\n            }\n        };\n        return SourceFileObject;\n    }(NodeObject));\n    var SourceMapSourceObject = /** @class */ (function () {\n        function SourceMapSourceObject(fileName, text, skipTrivia) {\n            this.fileName = fileName;\n            this.text = text;\n            this.skipTrivia = skipTrivia;\n        }\n        SourceMapSourceObject.prototype.getLineAndCharacterOfPosition = function (pos) {\n            return ts.getLineAndCharacterOfPosition(this, pos);\n        };\n        return SourceMapSourceObject;\n    }());\n    function getServicesObjectAllocator() {\n        return {\n            getNodeConstructor: function () { return NodeObject; },\n            getTokenConstructor: function () { return TokenObject; },\n            getIdentifierConstructor: function () { return IdentifierObject; },\n            getPrivateIdentifierConstructor: function () { return PrivateIdentifierObject; },\n            getSourceFileConstructor: function () { return SourceFileObject; },\n            getSymbolConstructor: function () { return SymbolObject; },\n            getTypeConstructor: function () { return TypeObject; },\n            getSignatureConstructor: function () { return SignatureObject; },\n            getSourceMapSourceConstructor: function () { return SourceMapSourceObject; },\n        };\n    }\n    function toEditorSettings(optionsAsMap) {\n        var allPropertiesAreCamelCased = true;\n        for (var key in optionsAsMap) {\n            if (ts.hasProperty(optionsAsMap, key) && !isCamelCase(key)) {\n                allPropertiesAreCamelCased = false;\n                break;\n            }\n        }\n        if (allPropertiesAreCamelCased) {\n            return optionsAsMap;\n        }\n        var settings = {};\n        for (var key in optionsAsMap) {\n            if (ts.hasProperty(optionsAsMap, key)) {\n                var newKey = isCamelCase(key) ? key : key.charAt(0).toLowerCase() + key.substr(1);\n                settings[newKey] = optionsAsMap[key];\n            }\n        }\n        return settings;\n    }\n    ts.toEditorSettings = toEditorSettings;\n    function isCamelCase(s) {\n        return !s.length || s.charAt(0) === s.charAt(0).toLowerCase();\n    }\n    function displayPartsToString(displayParts) {\n        if (displayParts) {\n            return ts.map(displayParts, function (displayPart) { return displayPart.text; }).join(\"\");\n        }\n        return \"\";\n    }\n    ts.displayPartsToString = displayPartsToString;\n    function getDefaultCompilerOptions() {\n        // Always default to \"ScriptTarget.ES5\" for the language service\n        return {\n            target: 1 /* ES5 */,\n            jsx: 1 /* Preserve */\n        };\n    }\n    ts.getDefaultCompilerOptions = getDefaultCompilerOptions;\n    function getSupportedCodeFixes() {\n        return ts.codefix.getSupportedErrorCodes();\n    }\n    ts.getSupportedCodeFixes = getSupportedCodeFixes;\n    // Cache host information about script Should be refreshed\n    // at each language service public entry point, since we don't know when\n    // the set of scripts handled by the host changes.\n    var HostCache = /** @class */ (function () {\n        function HostCache(host, getCanonicalFileName) {\n            this.host = host;\n            // script id => script index\n            this.currentDirectory = host.getCurrentDirectory();\n            this.fileNameToEntry = new ts.Map();\n            // Initialize the list with the root file names\n            var rootFileNames = host.getScriptFileNames();\n            for (var _i = 0, rootFileNames_1 = rootFileNames; _i < rootFileNames_1.length; _i++) {\n                var fileName = rootFileNames_1[_i];\n                this.createEntry(fileName, ts.toPath(fileName, this.currentDirectory, getCanonicalFileName));\n            }\n            // store the compilation settings\n            this._compilationSettings = host.getCompilationSettings() || getDefaultCompilerOptions();\n        }\n        HostCache.prototype.compilationSettings = function () {\n            return this._compilationSettings;\n        };\n        HostCache.prototype.getProjectReferences = function () {\n            return this.host.getProjectReferences && this.host.getProjectReferences();\n        };\n        HostCache.prototype.createEntry = function (fileName, path) {\n            var entry;\n            var scriptSnapshot = this.host.getScriptSnapshot(fileName);\n            if (scriptSnapshot) {\n                entry = {\n                    hostFileName: fileName,\n                    version: this.host.getScriptVersion(fileName),\n                    scriptSnapshot: scriptSnapshot,\n                    scriptKind: ts.getScriptKind(fileName, this.host)\n                };\n            }\n            else {\n                entry = fileName;\n            }\n            this.fileNameToEntry.set(path, entry);\n            return entry;\n        };\n        HostCache.prototype.getEntryByPath = function (path) {\n            return this.fileNameToEntry.get(path);\n        };\n        HostCache.prototype.getHostFileInformation = function (path) {\n            var entry = this.fileNameToEntry.get(path);\n            return !ts.isString(entry) ? entry : undefined;\n        };\n        HostCache.prototype.getOrCreateEntryByPath = function (fileName, path) {\n            var info = this.getEntryByPath(path) || this.createEntry(fileName, path);\n            return ts.isString(info) ? undefined : info; // TODO: GH#18217\n        };\n        HostCache.prototype.getRootFileNames = function () {\n            var names = [];\n            this.fileNameToEntry.forEach(function (entry) {\n                if (ts.isString(entry)) {\n                    names.push(entry);\n                }\n                else {\n                    names.push(entry.hostFileName);\n                }\n            });\n            return names;\n        };\n        HostCache.prototype.getScriptSnapshot = function (path) {\n            var file = this.getHostFileInformation(path);\n            return (file && file.scriptSnapshot); // TODO: GH#18217\n        };\n        return HostCache;\n    }());\n    var SyntaxTreeCache = /** @class */ (function () {\n        function SyntaxTreeCache(host) {\n            this.host = host;\n        }\n        SyntaxTreeCache.prototype.getCurrentSourceFile = function (fileName) {\n            var scriptSnapshot = this.host.getScriptSnapshot(fileName);\n            if (!scriptSnapshot) {\n                // The host does not know about this file.\n                throw new Error(\"Could not find file: '\" + fileName + \"'.\");\n            }\n            var scriptKind = ts.getScriptKind(fileName, this.host);\n            var version = this.host.getScriptVersion(fileName);\n            var sourceFile;\n            if (this.currentFileName !== fileName) {\n                // This is a new file, just parse it\n                sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 99 /* Latest */, version, /*setNodeParents*/ true, scriptKind);\n            }\n            else if (this.currentFileVersion !== version) {\n                // This is the same file, just a newer version. Incrementally parse the file.\n                var editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot);\n                sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version, editRange);\n            }\n            if (sourceFile) {\n                // All done, ensure state is up to date\n                this.currentFileVersion = version;\n                this.currentFileName = fileName;\n                this.currentFileScriptSnapshot = scriptSnapshot;\n                this.currentSourceFile = sourceFile;\n            }\n            return this.currentSourceFile;\n        };\n        return SyntaxTreeCache;\n    }());\n    function setSourceFileFields(sourceFile, scriptSnapshot, version) {\n        sourceFile.version = version;\n        sourceFile.scriptSnapshot = scriptSnapshot;\n    }\n    function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, setNodeParents, scriptKind) {\n        var sourceFile = ts.createSourceFile(fileName, ts.getSnapshotText(scriptSnapshot), scriptTarget, setNodeParents, scriptKind);\n        setSourceFileFields(sourceFile, scriptSnapshot, version);\n        return sourceFile;\n    }\n    ts.createLanguageServiceSourceFile = createLanguageServiceSourceFile;\n    function updateLanguageServiceSourceFile(sourceFile, scriptSnapshot, version, textChangeRange, aggressiveChecks) {\n        // If we were given a text change range, and our version or open-ness changed, then\n        // incrementally parse this file.\n        if (textChangeRange) {\n            if (version !== sourceFile.version) {\n                var newText = void 0;\n                // grab the fragment from the beginning of the original text to the beginning of the span\n                var prefix = textChangeRange.span.start !== 0\n                    ? sourceFile.text.substr(0, textChangeRange.span.start)\n                    : \"\";\n                // grab the fragment from the end of the span till the end of the original text\n                var suffix = ts.textSpanEnd(textChangeRange.span) !== sourceFile.text.length\n                    ? sourceFile.text.substr(ts.textSpanEnd(textChangeRange.span))\n                    : \"\";\n                if (textChangeRange.newLength === 0) {\n                    // edit was a deletion - just combine prefix and suffix\n                    newText = prefix && suffix ? prefix + suffix : prefix || suffix;\n                }\n                else {\n                    // it was actual edit, fetch the fragment of new text that correspond to new span\n                    var changedText = scriptSnapshot.getText(textChangeRange.span.start, textChangeRange.span.start + textChangeRange.newLength);\n                    // combine prefix, changed text and suffix\n                    newText = prefix && suffix\n                        ? prefix + changedText + suffix\n                        : prefix\n                            ? (prefix + changedText)\n                            : (changedText + suffix);\n                }\n                var newSourceFile = ts.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);\n                setSourceFileFields(newSourceFile, scriptSnapshot, version);\n                // after incremental parsing nameTable might not be up-to-date\n                // drop it so it can be lazily recreated later\n                newSourceFile.nameTable = undefined;\n                // dispose all resources held by old script snapshot\n                if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) {\n                    if (sourceFile.scriptSnapshot.dispose) {\n                        sourceFile.scriptSnapshot.dispose();\n                    }\n                    sourceFile.scriptSnapshot = undefined;\n                }\n                return newSourceFile;\n            }\n        }\n        // Otherwise, just create a new source file.\n        return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents*/ true, sourceFile.scriptKind);\n    }\n    ts.updateLanguageServiceSourceFile = updateLanguageServiceSourceFile;\n    var NoopCancellationToken = {\n        isCancellationRequested: ts.returnFalse,\n        throwIfCancellationRequested: ts.noop,\n    };\n    var CancellationTokenObject = /** @class */ (function () {\n        function CancellationTokenObject(cancellationToken) {\n            this.cancellationToken = cancellationToken;\n        }\n        CancellationTokenObject.prototype.isCancellationRequested = function () {\n            return this.cancellationToken.isCancellationRequested();\n        };\n        CancellationTokenObject.prototype.throwIfCancellationRequested = function () {\n            if (this.isCancellationRequested()) {\n                ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant(\"session\" /* Session */, \"cancellationThrown\", { kind: \"CancellationTokenObject\" });\n                throw new ts.OperationCanceledException();\n            }\n        };\n        return CancellationTokenObject;\n    }());\n    /* @internal */\n    /** A cancellation that throttles calls to the host */\n    var ThrottledCancellationToken = /** @class */ (function () {\n        function ThrottledCancellationToken(hostCancellationToken, throttleWaitMilliseconds) {\n            if (throttleWaitMilliseconds === void 0) { throttleWaitMilliseconds = 20; }\n            this.hostCancellationToken = hostCancellationToken;\n            this.throttleWaitMilliseconds = throttleWaitMilliseconds;\n            // Store when we last tried to cancel.  Checking cancellation can be expensive (as we have\n            // to marshall over to the host layer).  So we only bother actually checking once enough\n            // time has passed.\n            this.lastCancellationCheckTime = 0;\n        }\n        ThrottledCancellationToken.prototype.isCancellationRequested = function () {\n            var time = ts.timestamp();\n            var duration = Math.abs(time - this.lastCancellationCheckTime);\n            if (duration >= this.throttleWaitMilliseconds) {\n                // Check no more than once every throttle wait milliseconds\n                this.lastCancellationCheckTime = time;\n                return this.hostCancellationToken.isCancellationRequested();\n            }\n            return false;\n        };\n        ThrottledCancellationToken.prototype.throwIfCancellationRequested = function () {\n            if (this.isCancellationRequested()) {\n                ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant(\"session\" /* Session */, \"cancellationThrown\", { kind: \"ThrottledCancellationToken\" });\n                throw new ts.OperationCanceledException();\n            }\n        };\n        return ThrottledCancellationToken;\n    }());\n    ts.ThrottledCancellationToken = ThrottledCancellationToken;\n    var invalidOperationsInPartialSemanticMode = [\n        \"getSyntacticDiagnostics\",\n        \"getSemanticDiagnostics\",\n        \"getSuggestionDiagnostics\",\n        \"getCompilerOptionsDiagnostics\",\n        \"getSemanticClassifications\",\n        \"getEncodedSemanticClassifications\",\n        \"getCodeFixesAtPosition\",\n        \"getCombinedCodeFix\",\n        \"applyCodeActionCommand\",\n        \"organizeImports\",\n        \"getEditsForFileRename\",\n        \"getEmitOutput\",\n        \"getApplicableRefactors\",\n        \"getEditsForRefactor\",\n        \"prepareCallHierarchy\",\n        \"provideCallHierarchyIncomingCalls\",\n        \"provideCallHierarchyOutgoingCalls\",\n    ];\n    var invalidOperationsInSyntacticMode = __spreadArray(__spreadArray([], invalidOperationsInPartialSemanticMode), [\n        \"getCompletionsAtPosition\",\n        \"getCompletionEntryDetails\",\n        \"getCompletionEntrySymbol\",\n        \"getSignatureHelpItems\",\n        \"getQuickInfoAtPosition\",\n        \"getDefinitionAtPosition\",\n        \"getDefinitionAndBoundSpan\",\n        \"getImplementationAtPosition\",\n        \"getTypeDefinitionAtPosition\",\n        \"getReferencesAtPosition\",\n        \"findReferences\",\n        \"getOccurrencesAtPosition\",\n        \"getDocumentHighlights\",\n        \"getNavigateToItems\",\n        \"getRenameInfo\",\n        \"findRenameLocations\",\n        \"getApplicableRefactors\",\n    ]);\n    function createLanguageService(host, documentRegistry, syntaxOnlyOrLanguageServiceMode) {\n        var _a;\n        if (documentRegistry === void 0) { documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); }\n        var languageServiceMode;\n        if (syntaxOnlyOrLanguageServiceMode === undefined) {\n            languageServiceMode = ts.LanguageServiceMode.Semantic;\n        }\n        else if (typeof syntaxOnlyOrLanguageServiceMode === \"boolean\") {\n            // languageServiceMode = SyntaxOnly\n            languageServiceMode = syntaxOnlyOrLanguageServiceMode ? ts.LanguageServiceMode.Syntactic : ts.LanguageServiceMode.Semantic;\n        }\n        else {\n            languageServiceMode = syntaxOnlyOrLanguageServiceMode;\n        }\n        var syntaxTreeCache = new SyntaxTreeCache(host);\n        var program;\n        var lastProjectVersion;\n        var lastTypesRootVersion = 0;\n        var cancellationToken = host.getCancellationToken\n            ? new CancellationTokenObject(host.getCancellationToken())\n            : NoopCancellationToken;\n        var currentDirectory = host.getCurrentDirectory();\n        // Check if the localized messages json is set, otherwise query the host for it\n        if (!ts.localizedDiagnosticMessages && host.getLocalizedDiagnosticMessages) {\n            ts.setLocalizedDiagnosticMessages(host.getLocalizedDiagnosticMessages());\n        }\n        function log(message) {\n            if (host.log) {\n                host.log(message);\n            }\n        }\n        var useCaseSensitiveFileNames = ts.hostUsesCaseSensitiveFileNames(host);\n        var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);\n        var sourceMapper = ts.getSourceMapper({\n            useCaseSensitiveFileNames: function () { return useCaseSensitiveFileNames; },\n            getCurrentDirectory: function () { return currentDirectory; },\n            getProgram: getProgram,\n            fileExists: ts.maybeBind(host, host.fileExists),\n            readFile: ts.maybeBind(host, host.readFile),\n            getDocumentPositionMapper: ts.maybeBind(host, host.getDocumentPositionMapper),\n            getSourceFileLike: ts.maybeBind(host, host.getSourceFileLike),\n            log: log\n        });\n        function getValidSourceFile(fileName) {\n            var sourceFile = program.getSourceFile(fileName);\n            if (!sourceFile) {\n                var error = new Error(\"Could not find source file: '\" + fileName + \"'.\");\n                // We've been having trouble debugging this, so attach sidecar data for the tsserver log.\n                // See https://github.com/microsoft/TypeScript/issues/30180.\n                error.ProgramFiles = program.getSourceFiles().map(function (f) { return f.fileName; });\n                throw error;\n            }\n            return sourceFile;\n        }\n        function synchronizeHostData() {\n            var _a, _b;\n            ts.Debug.assert(languageServiceMode !== ts.LanguageServiceMode.Syntactic);\n            // perform fast check if host supports it\n            if (host.getProjectVersion) {\n                var hostProjectVersion = host.getProjectVersion();\n                if (hostProjectVersion) {\n                    if (lastProjectVersion === hostProjectVersion && !((_a = host.hasChangedAutomaticTypeDirectiveNames) === null || _a === void 0 ? void 0 : _a.call(host))) {\n                        return;\n                    }\n                    lastProjectVersion = hostProjectVersion;\n                }\n            }\n            var typeRootsVersion = host.getTypeRootsVersion ? host.getTypeRootsVersion() : 0;\n            if (lastTypesRootVersion !== typeRootsVersion) {\n                log(\"TypeRoots version has changed; provide new program\");\n                program = undefined; // TODO: GH#18217\n                lastTypesRootVersion = typeRootsVersion;\n            }\n            // Get a fresh cache of the host information\n            var hostCache = new HostCache(host, getCanonicalFileName);\n            var rootFileNames = hostCache.getRootFileNames();\n            var hasInvalidatedResolution = host.hasInvalidatedResolution || ts.returnFalse;\n            var hasChangedAutomaticTypeDirectiveNames = ts.maybeBind(host, host.hasChangedAutomaticTypeDirectiveNames);\n            var projectReferences = hostCache.getProjectReferences();\n            // If the program is already up-to-date, we can reuse it\n            if (ts.isProgramUptoDate(program, rootFileNames, hostCache.compilationSettings(), function (_path, fileName) { return host.getScriptVersion(fileName); }, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, projectReferences)) {\n                return;\n            }\n            // IMPORTANT - It is critical from this moment onward that we do not check\n            // cancellation tokens.  We are about to mutate source files from a previous program\n            // instance.  If we cancel midway through, we may end up in an inconsistent state where\n            // the program points to old source files that have been invalidated because of\n            // incremental parsing.\n            var newSettings = hostCache.compilationSettings();\n            // Now create a new compiler\n            var compilerHost = {\n                getSourceFile: getOrCreateSourceFile,\n                getSourceFileByPath: getOrCreateSourceFileByPath,\n                getCancellationToken: function () { return cancellationToken; },\n                getCanonicalFileName: getCanonicalFileName,\n                useCaseSensitiveFileNames: function () { return useCaseSensitiveFileNames; },\n                getNewLine: function () { return ts.getNewLineCharacter(newSettings, function () { return ts.getNewLineOrDefaultFromHost(host); }); },\n                getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); },\n                writeFile: ts.noop,\n                getCurrentDirectory: function () { return currentDirectory; },\n                fileExists: fileExists,\n                readFile: readFile,\n                getSymlinkCache: ts.maybeBind(host, host.getSymlinkCache),\n                realpath: ts.maybeBind(host, host.realpath),\n                directoryExists: function (directoryName) {\n                    return ts.directoryProbablyExists(directoryName, host);\n                },\n                getDirectories: function (path) {\n                    return host.getDirectories ? host.getDirectories(path) : [];\n                },\n                readDirectory: function (path, extensions, exclude, include, depth) {\n                    ts.Debug.checkDefined(host.readDirectory, \"'LanguageServiceHost.readDirectory' must be implemented to correctly process 'projectReferences'\");\n                    return host.readDirectory(path, extensions, exclude, include, depth);\n                },\n                onReleaseOldSourceFile: onReleaseOldSourceFile,\n                hasInvalidatedResolution: hasInvalidatedResolution,\n                hasChangedAutomaticTypeDirectiveNames: hasChangedAutomaticTypeDirectiveNames,\n                trace: ts.maybeBind(host, host.trace),\n                resolveModuleNames: ts.maybeBind(host, host.resolveModuleNames),\n                resolveTypeReferenceDirectives: ts.maybeBind(host, host.resolveTypeReferenceDirectives),\n                useSourceOfProjectReferenceRedirect: ts.maybeBind(host, host.useSourceOfProjectReferenceRedirect),\n            };\n            (_b = host.setCompilerHost) === null || _b === void 0 ? void 0 : _b.call(host, compilerHost);\n            var documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings);\n            var options = {\n                rootNames: rootFileNames,\n                options: newSettings,\n                host: compilerHost,\n                oldProgram: program,\n                projectReferences: projectReferences\n            };\n            program = ts.createProgram(options);\n            // hostCache is captured in the closure for 'getOrCreateSourceFile' but it should not be used past this point.\n            // It needs to be cleared to allow all collected snapshots to be released\n            hostCache = undefined;\n            // We reset this cache on structure invalidation so we don't hold on to outdated files for long; however we can't use the `compilerHost` above,\n            // Because it only functions until `hostCache` is cleared, while we'll potentially need the functionality to lazily read sourcemap files during\n            // the course of whatever called `synchronizeHostData`\n            sourceMapper.clearCache();\n            // Make sure all the nodes in the program are both bound, and have their parent\n            // pointers set property.\n            program.getTypeChecker();\n            return;\n            function fileExists(fileName) {\n                var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName);\n                var entry = hostCache && hostCache.getEntryByPath(path);\n                return entry ?\n                    !ts.isString(entry) :\n                    (!!host.fileExists && host.fileExists(fileName));\n            }\n            function readFile(fileName) {\n                // stub missing host functionality\n                var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName);\n                var entry = hostCache && hostCache.getEntryByPath(path);\n                if (entry) {\n                    return ts.isString(entry) ? undefined : ts.getSnapshotText(entry.scriptSnapshot);\n                }\n                return host.readFile && host.readFile(fileName);\n            }\n            // Release any files we have acquired in the old program but are\n            // not part of the new program.\n            function onReleaseOldSourceFile(oldSourceFile, oldOptions) {\n                var oldSettingsKey = documentRegistry.getKeyForCompilationSettings(oldOptions);\n                documentRegistry.releaseDocumentWithKey(oldSourceFile.resolvedPath, oldSettingsKey);\n            }\n            function getOrCreateSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile) {\n                return getOrCreateSourceFileByPath(fileName, ts.toPath(fileName, currentDirectory, getCanonicalFileName), languageVersion, onError, shouldCreateNewSourceFile);\n            }\n            function getOrCreateSourceFileByPath(fileName, path, _languageVersion, _onError, shouldCreateNewSourceFile) {\n                ts.Debug.assert(hostCache !== undefined, \"getOrCreateSourceFileByPath called after typical CompilerHost lifetime, check the callstack something with a reference to an old host.\");\n                // The program is asking for this file, check first if the host can locate it.\n                // If the host can not locate the file, then it does not exist. return undefined\n                // to the program to allow reporting of errors for missing files.\n                var hostFileInformation = hostCache && hostCache.getOrCreateEntryByPath(fileName, path);\n                if (!hostFileInformation) {\n                    return undefined;\n                }\n                // Check if the language version has changed since we last created a program; if they are the same,\n                // it is safe to reuse the sourceFiles; if not, then the shape of the AST can change, and the oldSourceFile\n                // can not be reused. we have to dump all syntax trees and create new ones.\n                if (!shouldCreateNewSourceFile) {\n                    // Check if the old program had this file already\n                    var oldSourceFile = program && program.getSourceFileByPath(path);\n                    if (oldSourceFile) {\n                        // We already had a source file for this file name.  Go to the registry to\n                        // ensure that we get the right up to date version of it.  We need this to\n                        // address the following race-condition.  Specifically, say we have the following:\n                        //\n                        //      LS1\n                        //          \\\n                        //           DocumentRegistry\n                        //          /\n                        //      LS2\n                        //\n                        // Each LS has a reference to file 'foo.ts' at version 1.  LS2 then updates\n                        // it's version of 'foo.ts' to version 2.  This will cause LS2 and the\n                        // DocumentRegistry to have version 2 of the document.  However, LS1 will\n                        // have version 1.  And *importantly* this source file will be *corrupt*.\n                        // The act of creating version 2 of the file irrevocably damages the version\n                        // 1 file.\n                        //\n                        // So, later when we call into LS1, we need to make sure that it doesn't use\n                        // it's source file any more, and instead defers to DocumentRegistry to get\n                        // either version 1, version 2 (or some other version) depending on what the\n                        // host says should be used.\n                        // We do not support the scenario where a host can modify a registered\n                        // file's script kind, i.e. in one project some file is treated as \".ts\"\n                        // and in another as \".js\"\n                        ts.Debug.assertEqual(hostFileInformation.scriptKind, oldSourceFile.scriptKind, \"Registered script kind should match new script kind.\");\n                        return documentRegistry.updateDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind);\n                    }\n                    // We didn't already have the file.  Fall through and acquire it from the registry.\n                }\n                // Could not find this file in the old program, create a new SourceFile for it.\n                return documentRegistry.acquireDocumentWithKey(fileName, path, newSettings, documentRegistryBucketKey, hostFileInformation.scriptSnapshot, hostFileInformation.version, hostFileInformation.scriptKind);\n            }\n        }\n        // TODO: GH#18217 frequently asserted as defined\n        function getProgram() {\n            if (languageServiceMode === ts.LanguageServiceMode.Syntactic) {\n                ts.Debug.assert(program === undefined);\n                return undefined;\n            }\n            synchronizeHostData();\n            return program;\n        }\n        function getAutoImportProvider() {\n            var _a;\n            return (_a = host.getPackageJsonAutoImportProvider) === null || _a === void 0 ? void 0 : _a.call(host);\n        }\n        function cleanupSemanticCache() {\n            program = undefined; // TODO: GH#18217\n        }\n        function dispose() {\n            if (program) {\n                // Use paths to ensure we are using correct key and paths as document registry could be created with different current directory than host\n                var key_1 = documentRegistry.getKeyForCompilationSettings(program.getCompilerOptions());\n                ts.forEach(program.getSourceFiles(), function (f) {\n                    return documentRegistry.releaseDocumentWithKey(f.resolvedPath, key_1);\n                });\n                program = undefined; // TODO: GH#18217\n            }\n            host = undefined;\n        }\n        /// Diagnostics\n        function getSyntacticDiagnostics(fileName) {\n            synchronizeHostData();\n            return program.getSyntacticDiagnostics(getValidSourceFile(fileName), cancellationToken).slice();\n        }\n        /**\n         * getSemanticDiagnostics return array of Diagnostics. If '-d' is not enabled, only report semantic errors\n         * If '-d' enabled, report both semantic and emitter errors\n         */\n        function getSemanticDiagnostics(fileName) {\n            synchronizeHostData();\n            var targetSourceFile = getValidSourceFile(fileName);\n            // Only perform the action per file regardless of '-out' flag as LanguageServiceHost is expected to call this function per file.\n            // Therefore only get diagnostics for given file.\n            var semanticDiagnostics = program.getSemanticDiagnostics(targetSourceFile, cancellationToken);\n            if (!ts.getEmitDeclarations(program.getCompilerOptions())) {\n                return semanticDiagnostics.slice();\n            }\n            // If '-d' is enabled, check for emitter error. One example of emitter error is export class implements non-export interface\n            var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile, cancellationToken);\n            return __spreadArray(__spreadArray([], semanticDiagnostics), declarationDiagnostics);\n        }\n        function getSuggestionDiagnostics(fileName) {\n            synchronizeHostData();\n            return ts.computeSuggestionDiagnostics(getValidSourceFile(fileName), program, cancellationToken);\n        }\n        function getCompilerOptionsDiagnostics() {\n            synchronizeHostData();\n            return __spreadArray(__spreadArray([], program.getOptionsDiagnostics(cancellationToken)), program.getGlobalDiagnostics(cancellationToken));\n        }\n        function getCompletionsAtPosition(fileName, position, options) {\n            if (options === void 0) { options = ts.emptyOptions; }\n            // Convert from deprecated options names to new names\n            var fullPreferences = __assign(__assign({}, ts.identity(options)), { includeCompletionsForModuleExports: options.includeCompletionsForModuleExports || options.includeExternalModuleExports, includeCompletionsWithInsertText: options.includeCompletionsWithInsertText || options.includeInsertTextCompletions });\n            synchronizeHostData();\n            return ts.Completions.getCompletionsAtPosition(host, program, log, getValidSourceFile(fileName), position, fullPreferences, options.triggerCharacter);\n        }\n        function getCompletionEntryDetails(fileName, position, name, formattingOptions, source, preferences) {\n            if (preferences === void 0) { preferences = ts.emptyOptions; }\n            synchronizeHostData();\n            return ts.Completions.getCompletionEntryDetails(program, log, getValidSourceFile(fileName), position, { name: name, source: source }, host, (formattingOptions && ts.formatting.getFormatContext(formattingOptions, host)), // TODO: GH#18217\n            preferences, cancellationToken);\n        }\n        function getCompletionEntrySymbol(fileName, position, name, source, preferences) {\n            if (preferences === void 0) { preferences = ts.emptyOptions; }\n            synchronizeHostData();\n            return ts.Completions.getCompletionEntrySymbol(program, log, getValidSourceFile(fileName), position, { name: name, source: source }, host, preferences);\n        }\n        function getQuickInfoAtPosition(fileName, position) {\n            synchronizeHostData();\n            var sourceFile = getValidSourceFile(fileName);\n            var node = ts.getTouchingPropertyName(sourceFile, position);\n            if (node === sourceFile) {\n                // Avoid giving quickInfo for the sourceFile as a whole.\n                return undefined;\n            }\n            var typeChecker = program.getTypeChecker();\n            var nodeForQuickInfo = getNodeForQuickInfo(node);\n            var symbol = getSymbolAtLocationForQuickInfo(nodeForQuickInfo, typeChecker);\n            if (!symbol || typeChecker.isUnknownSymbol(symbol)) {\n                var type_2 = shouldGetType(sourceFile, nodeForQuickInfo, position) ? typeChecker.getTypeAtLocation(nodeForQuickInfo) : undefined;\n                return type_2 && {\n                    kind: \"\" /* unknown */,\n                    kindModifiers: \"\" /* none */,\n                    textSpan: ts.createTextSpanFromNode(nodeForQuickInfo, sourceFile),\n                    displayParts: typeChecker.runWithCancellationToken(cancellationToken, function (typeChecker) { return ts.typeToDisplayParts(typeChecker, type_2, ts.getContainerNode(nodeForQuickInfo)); }),\n                    documentation: type_2.symbol ? type_2.symbol.getDocumentationComment(typeChecker) : undefined,\n                    tags: type_2.symbol ? type_2.symbol.getJsDocTags() : undefined\n                };\n            }\n            var _a = typeChecker.runWithCancellationToken(cancellationToken, function (typeChecker) {\n                return ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, ts.getContainerNode(nodeForQuickInfo), nodeForQuickInfo);\n            }), symbolKind = _a.symbolKind, displayParts = _a.displayParts, documentation = _a.documentation, tags = _a.tags;\n            return {\n                kind: symbolKind,\n                kindModifiers: ts.SymbolDisplay.getSymbolModifiers(typeChecker, symbol),\n                textSpan: ts.createTextSpanFromNode(nodeForQuickInfo, sourceFile),\n                displayParts: displayParts,\n                documentation: documentation,\n                tags: tags,\n            };\n        }\n        function getNodeForQuickInfo(node) {\n            if (ts.isNewExpression(node.parent) && node.pos === node.parent.pos) {\n                return node.parent.expression;\n            }\n            return node;\n        }\n        function shouldGetType(sourceFile, node, position) {\n            switch (node.kind) {\n                case 78 /* Identifier */:\n                    return !ts.isLabelName(node) && !ts.isTagName(node);\n                case 201 /* PropertyAccessExpression */:\n                case 157 /* QualifiedName */:\n                    // Don't return quickInfo if inside the comment in `a/**/.b`\n                    return !ts.isInComment(sourceFile, position);\n                case 107 /* ThisKeyword */:\n                case 187 /* ThisType */:\n                case 105 /* SuperKeyword */:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n        /// Goto definition\n        function getDefinitionAtPosition(fileName, position) {\n            synchronizeHostData();\n            return ts.GoToDefinition.getDefinitionAtPosition(program, getValidSourceFile(fileName), position);\n        }\n        function getDefinitionAndBoundSpan(fileName, position) {\n            synchronizeHostData();\n            return ts.GoToDefinition.getDefinitionAndBoundSpan(program, getValidSourceFile(fileName), position);\n        }\n        function getTypeDefinitionAtPosition(fileName, position) {\n            synchronizeHostData();\n            return ts.GoToDefinition.getTypeDefinitionAtPosition(program.getTypeChecker(), getValidSourceFile(fileName), position);\n        }\n        /// Goto implementation\n        function getImplementationAtPosition(fileName, position) {\n            synchronizeHostData();\n            return ts.FindAllReferences.getImplementationsAtPosition(program, cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position);\n        }\n        /// References and Occurrences\n        function getOccurrencesAtPosition(fileName, position) {\n            return ts.flatMap(getDocumentHighlights(fileName, position, [fileName]), function (entry) { return entry.highlightSpans.map(function (highlightSpan) { return (__assign(__assign({ fileName: entry.fileName, textSpan: highlightSpan.textSpan, isWriteAccess: highlightSpan.kind === \"writtenReference\" /* writtenReference */, isDefinition: false }, highlightSpan.isInString && { isInString: true }), highlightSpan.contextSpan && { contextSpan: highlightSpan.contextSpan })); }); });\n        }\n        function getDocumentHighlights(fileName, position, filesToSearch) {\n            var normalizedFileName = ts.normalizePath(fileName);\n            ts.Debug.assert(filesToSearch.some(function (f) { return ts.normalizePath(f) === normalizedFileName; }));\n            synchronizeHostData();\n            var sourceFilesToSearch = ts.mapDefined(filesToSearch, function (fileName) { return program.getSourceFile(fileName); });\n            var sourceFile = getValidSourceFile(fileName);\n            return ts.DocumentHighlights.getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch);\n        }\n        function findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename) {\n            synchronizeHostData();\n            var sourceFile = getValidSourceFile(fileName);\n            var node = ts.getAdjustedRenameLocation(ts.getTouchingPropertyName(sourceFile, position));\n            if (ts.isIdentifier(node) && (ts.isJsxOpeningElement(node.parent) || ts.isJsxClosingElement(node.parent)) && ts.isIntrinsicJsxName(node.escapedText)) {\n                var _a = node.parent.parent, openingElement = _a.openingElement, closingElement = _a.closingElement;\n                return [openingElement, closingElement].map(function (node) {\n                    var textSpan = ts.createTextSpanFromNode(node.tagName, sourceFile);\n                    return __assign({ fileName: sourceFile.fileName, textSpan: textSpan }, ts.FindAllReferences.toContextSpan(textSpan, sourceFile, node.parent));\n                });\n            }\n            else {\n                return getReferencesWorker(node, position, { findInStrings: findInStrings, findInComments: findInComments, providePrefixAndSuffixTextForRename: providePrefixAndSuffixTextForRename, use: 2 /* Rename */ }, function (entry, originalNode, checker) { return ts.FindAllReferences.toRenameLocation(entry, originalNode, checker, providePrefixAndSuffixTextForRename || false); });\n            }\n        }\n        function getReferencesAtPosition(fileName, position) {\n            synchronizeHostData();\n            return getReferencesWorker(ts.getTouchingPropertyName(getValidSourceFile(fileName), position), position, { use: 1 /* References */ }, ts.FindAllReferences.toReferenceEntry);\n        }\n        function getReferencesWorker(node, position, options, cb) {\n            synchronizeHostData();\n            // Exclude default library when renaming as commonly user don't want to change that file.\n            var sourceFiles = options && options.use === 2 /* Rename */\n                ? program.getSourceFiles().filter(function (sourceFile) { return !program.isSourceFileDefaultLibrary(sourceFile); })\n                : program.getSourceFiles();\n            return ts.FindAllReferences.findReferenceOrRenameEntries(program, cancellationToken, sourceFiles, node, position, options, cb);\n        }\n        function findReferences(fileName, position) {\n            synchronizeHostData();\n            return ts.FindAllReferences.findReferencedSymbols(program, cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position);\n        }\n        function getFileReferences(fileName) {\n            synchronizeHostData();\n            return ts.FindAllReferences.Core.getReferencesForFileName(fileName, program, program.getSourceFiles()).map(ts.FindAllReferences.toReferenceEntry);\n        }\n        function getNavigateToItems(searchValue, maxResultCount, fileName, excludeDtsFiles) {\n            if (excludeDtsFiles === void 0) { excludeDtsFiles = false; }\n            synchronizeHostData();\n            var sourceFiles = fileName ? [getValidSourceFile(fileName)] : program.getSourceFiles();\n            return ts.NavigateTo.getNavigateToItems(sourceFiles, program.getTypeChecker(), cancellationToken, searchValue, maxResultCount, excludeDtsFiles);\n        }\n        function getEmitOutput(fileName, emitOnlyDtsFiles, forceDtsEmit) {\n            synchronizeHostData();\n            var sourceFile = getValidSourceFile(fileName);\n            var customTransformers = host.getCustomTransformers && host.getCustomTransformers();\n            return ts.getFileEmitOutput(program, sourceFile, !!emitOnlyDtsFiles, cancellationToken, customTransformers, forceDtsEmit);\n        }\n        // Signature help\n        /**\n         * This is a semantic operation.\n         */\n        function getSignatureHelpItems(fileName, position, _a) {\n            var _b = _a === void 0 ? ts.emptyOptions : _a, triggerReason = _b.triggerReason;\n            synchronizeHostData();\n            var sourceFile = getValidSourceFile(fileName);\n            return ts.SignatureHelp.getSignatureHelpItems(program, sourceFile, position, triggerReason, cancellationToken);\n        }\n        /// Syntactic features\n        function getNonBoundSourceFile(fileName) {\n            return syntaxTreeCache.getCurrentSourceFile(fileName);\n        }\n        function getNameOrDottedNameSpan(fileName, startPos, _endPos) {\n            var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);\n            // Get node at the location\n            var node = ts.getTouchingPropertyName(sourceFile, startPos);\n            if (node === sourceFile) {\n                return undefined;\n            }\n            switch (node.kind) {\n                case 201 /* PropertyAccessExpression */:\n                case 157 /* QualifiedName */:\n                case 10 /* StringLiteral */:\n                case 94 /* FalseKeyword */:\n                case 109 /* TrueKeyword */:\n                case 103 /* NullKeyword */:\n                case 105 /* SuperKeyword */:\n                case 107 /* ThisKeyword */:\n                case 187 /* ThisType */:\n                case 78 /* Identifier */:\n                    break;\n                // Cant create the text span\n                default:\n                    return undefined;\n            }\n            var nodeForStartPos = node;\n            while (true) {\n                if (ts.isRightSideOfPropertyAccess(nodeForStartPos) || ts.isRightSideOfQualifiedName(nodeForStartPos)) {\n                    // If on the span is in right side of the the property or qualified name, return the span from the qualified name pos to end of this node\n                    nodeForStartPos = nodeForStartPos.parent;\n                }\n                else if (ts.isNameOfModuleDeclaration(nodeForStartPos)) {\n                    // If this is name of a module declarations, check if this is right side of dotted module name\n                    // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of\n                    // Then this name is name from dotted module\n                    if (nodeForStartPos.parent.parent.kind === 256 /* ModuleDeclaration */ &&\n                        nodeForStartPos.parent.parent.body === nodeForStartPos.parent) {\n                        // Use parent module declarations name for start pos\n                        nodeForStartPos = nodeForStartPos.parent.parent.name;\n                    }\n                    else {\n                        // We have to use this name for start pos\n                        break;\n                    }\n                }\n                else {\n                    // Is not a member expression so we have found the node for start pos\n                    break;\n                }\n            }\n            return ts.createTextSpanFromBounds(nodeForStartPos.getStart(), node.getEnd());\n        }\n        function getBreakpointStatementAtPosition(fileName, position) {\n            // doesn't use compiler - no need to synchronize with host\n            var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);\n            return ts.BreakpointResolver.spanInSourceFileAtLocation(sourceFile, position);\n        }\n        function getNavigationBarItems(fileName) {\n            return ts.NavigationBar.getNavigationBarItems(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken);\n        }\n        function getNavigationTree(fileName) {\n            return ts.NavigationBar.getNavigationTree(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken);\n        }\n        function isTsOrTsxFile(fileName) {\n            var kind = ts.getScriptKind(fileName, host);\n            return kind === 3 /* TS */ || kind === 4 /* TSX */;\n        }\n        function getSemanticClassifications(fileName, span, format) {\n            if (!isTsOrTsxFile(fileName)) {\n                // do not run semantic classification on non-ts-or-tsx files\n                return [];\n            }\n            synchronizeHostData();\n            var responseFormat = format || \"original\" /* Original */;\n            if (responseFormat === \"2020\" /* TwentyTwenty */) {\n                return ts.classifier.v2020.getSemanticClassifications(program, cancellationToken, getValidSourceFile(fileName), span);\n            }\n            else {\n                return ts.getSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span);\n            }\n        }\n        function getEncodedSemanticClassifications(fileName, span, format) {\n            if (!isTsOrTsxFile(fileName)) {\n                // do not run semantic classification on non-ts-or-tsx files\n                return { spans: [], endOfLineState: 0 /* None */ };\n            }\n            synchronizeHostData();\n            var responseFormat = format || \"original\" /* Original */;\n            if (responseFormat === \"original\" /* Original */) {\n                return ts.getEncodedSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span);\n            }\n            else {\n                return ts.classifier.v2020.getEncodedSemanticClassifications(program, cancellationToken, getValidSourceFile(fileName), span);\n            }\n        }\n        function getSyntacticClassifications(fileName, span) {\n            // doesn't use compiler - no need to synchronize with host\n            return ts.getSyntacticClassifications(cancellationToken, syntaxTreeCache.getCurrentSourceFile(fileName), span);\n        }\n        function getEncodedSyntacticClassifications(fileName, span) {\n            // doesn't use compiler - no need to synchronize with host\n            return ts.getEncodedSyntacticClassifications(cancellationToken, syntaxTreeCache.getCurrentSourceFile(fileName), span);\n        }\n        function getOutliningSpans(fileName) {\n            // doesn't use compiler - no need to synchronize with host\n            var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);\n            return ts.OutliningElementsCollector.collectElements(sourceFile, cancellationToken);\n        }\n        var braceMatching = new ts.Map(ts.getEntries((_a = {},\n            _a[18 /* OpenBraceToken */] = 19 /* CloseBraceToken */,\n            _a[20 /* OpenParenToken */] = 21 /* CloseParenToken */,\n            _a[22 /* OpenBracketToken */] = 23 /* CloseBracketToken */,\n            _a[31 /* GreaterThanToken */] = 29 /* LessThanToken */,\n            _a)));\n        braceMatching.forEach(function (value, key) { return braceMatching.set(value.toString(), Number(key)); });\n        function getBraceMatchingAtPosition(fileName, position) {\n            var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);\n            var token = ts.getTouchingToken(sourceFile, position);\n            var matchKind = token.getStart(sourceFile) === position ? braceMatching.get(token.kind.toString()) : undefined;\n            var match = matchKind && ts.findChildOfKind(token.parent, matchKind, sourceFile);\n            // We want to order the braces when we return the result.\n            return match ? [ts.createTextSpanFromNode(token, sourceFile), ts.createTextSpanFromNode(match, sourceFile)].sort(function (a, b) { return a.start - b.start; }) : ts.emptyArray;\n        }\n        function getIndentationAtPosition(fileName, position, editorOptions) {\n            var start = ts.timestamp();\n            var settings = toEditorSettings(editorOptions);\n            var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);\n            log(\"getIndentationAtPosition: getCurrentSourceFile: \" + (ts.timestamp() - start));\n            start = ts.timestamp();\n            var result = ts.formatting.SmartIndenter.getIndentation(position, sourceFile, settings);\n            log(\"getIndentationAtPosition: computeIndentation  : \" + (ts.timestamp() - start));\n            return result;\n        }\n        function getFormattingEditsForRange(fileName, start, end, options) {\n            var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);\n            return ts.formatting.formatSelection(start, end, sourceFile, ts.formatting.getFormatContext(toEditorSettings(options), host));\n        }\n        function getFormattingEditsForDocument(fileName, options) {\n            return ts.formatting.formatDocument(syntaxTreeCache.getCurrentSourceFile(fileName), ts.formatting.getFormatContext(toEditorSettings(options), host));\n        }\n        function getFormattingEditsAfterKeystroke(fileName, position, key, options) {\n            var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);\n            var formatContext = ts.formatting.getFormatContext(toEditorSettings(options), host);\n            if (!ts.isInComment(sourceFile, position)) {\n                switch (key) {\n                    case \"{\":\n                        return ts.formatting.formatOnOpeningCurly(position, sourceFile, formatContext);\n                    case \"}\":\n                        return ts.formatting.formatOnClosingCurly(position, sourceFile, formatContext);\n                    case \";\":\n                        return ts.formatting.formatOnSemicolon(position, sourceFile, formatContext);\n                    case \"\\n\":\n                        return ts.formatting.formatOnEnter(position, sourceFile, formatContext);\n                }\n            }\n            return [];\n        }\n        function getCodeFixesAtPosition(fileName, start, end, errorCodes, formatOptions, preferences) {\n            if (preferences === void 0) { preferences = ts.emptyOptions; }\n            synchronizeHostData();\n            var sourceFile = getValidSourceFile(fileName);\n            var span = ts.createTextSpanFromBounds(start, end);\n            var formatContext = ts.formatting.getFormatContext(formatOptions, host);\n            return ts.flatMap(ts.deduplicate(errorCodes, ts.equateValues, ts.compareValues), function (errorCode) {\n                cancellationToken.throwIfCancellationRequested();\n                return ts.codefix.getFixes({ errorCode: errorCode, sourceFile: sourceFile, span: span, program: program, host: host, cancellationToken: cancellationToken, formatContext: formatContext, preferences: preferences });\n            });\n        }\n        function getCombinedCodeFix(scope, fixId, formatOptions, preferences) {\n            if (preferences === void 0) { preferences = ts.emptyOptions; }\n            synchronizeHostData();\n            ts.Debug.assert(scope.type === \"file\");\n            var sourceFile = getValidSourceFile(scope.fileName);\n            var formatContext = ts.formatting.getFormatContext(formatOptions, host);\n            return ts.codefix.getAllFixes({ fixId: fixId, sourceFile: sourceFile, program: program, host: host, cancellationToken: cancellationToken, formatContext: formatContext, preferences: preferences });\n        }\n        function organizeImports(scope, formatOptions, preferences) {\n            if (preferences === void 0) { preferences = ts.emptyOptions; }\n            synchronizeHostData();\n            ts.Debug.assert(scope.type === \"file\");\n            var sourceFile = getValidSourceFile(scope.fileName);\n            var formatContext = ts.formatting.getFormatContext(formatOptions, host);\n            return ts.OrganizeImports.organizeImports(sourceFile, formatContext, host, program, preferences);\n        }\n        function getEditsForFileRename(oldFilePath, newFilePath, formatOptions, preferences) {\n            if (preferences === void 0) { preferences = ts.emptyOptions; }\n            return ts.getEditsForFileRename(getProgram(), oldFilePath, newFilePath, host, ts.formatting.getFormatContext(formatOptions, host), preferences, sourceMapper);\n        }\n        function applyCodeActionCommand(fileName, actionOrFormatSettingsOrUndefined) {\n            var action = typeof fileName === \"string\" ? actionOrFormatSettingsOrUndefined : fileName;\n            return ts.isArray(action) ? Promise.all(action.map(function (a) { return applySingleCodeActionCommand(a); })) : applySingleCodeActionCommand(action);\n        }\n        function applySingleCodeActionCommand(action) {\n            var getPath = function (path) { return ts.toPath(path, currentDirectory, getCanonicalFileName); };\n            ts.Debug.assertEqual(action.type, \"install package\");\n            return host.installPackage\n                ? host.installPackage({ fileName: getPath(action.file), packageName: action.packageName })\n                : Promise.reject(\"Host does not implement `installPackage`\");\n        }\n        function getDocCommentTemplateAtPosition(fileName, position, options) {\n            return ts.JsDoc.getDocCommentTemplateAtPosition(ts.getNewLineOrDefaultFromHost(host), syntaxTreeCache.getCurrentSourceFile(fileName), position, options);\n        }\n        function isValidBraceCompletionAtPosition(fileName, position, openingBrace) {\n            // '<' is currently not supported, figuring out if we're in a Generic Type vs. a comparison is too\n            // expensive to do during typing scenarios\n            // i.e. whether we're dealing with:\n            //      var x = new foo<| ( with class foo<T>{} )\n            // or\n            //      var y = 3 <|\n            if (openingBrace === 60 /* lessThan */) {\n                return false;\n            }\n            var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);\n            // Check if in a context where we don't want to perform any insertion\n            if (ts.isInString(sourceFile, position)) {\n                return false;\n            }\n            if (ts.isInsideJsxElementOrAttribute(sourceFile, position)) {\n                return openingBrace === 123 /* openBrace */;\n            }\n            if (ts.isInTemplateString(sourceFile, position)) {\n                return false;\n            }\n            switch (openingBrace) {\n                case 39 /* singleQuote */:\n                case 34 /* doubleQuote */:\n                case 96 /* backtick */:\n                    return !ts.isInComment(sourceFile, position);\n            }\n            return true;\n        }\n        function getJsxClosingTagAtPosition(fileName, position) {\n            var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);\n            var token = ts.findPrecedingToken(position, sourceFile);\n            if (!token)\n                return undefined;\n            var element = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningElement(token.parent) ? token.parent.parent\n                : ts.isJsxText(token) ? token.parent : undefined;\n            if (element && isUnclosedTag(element)) {\n                return { newText: \"</\" + element.openingElement.tagName.getText(sourceFile) + \">\" };\n            }\n        }\n        function getLinesForRange(sourceFile, textRange) {\n            return {\n                lineStarts: sourceFile.getLineStarts(),\n                firstLine: sourceFile.getLineAndCharacterOfPosition(textRange.pos).line,\n                lastLine: sourceFile.getLineAndCharacterOfPosition(textRange.end).line\n            };\n        }\n        function toggleLineComment(fileName, textRange, insertComment) {\n            var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);\n            var textChanges = [];\n            var _a = getLinesForRange(sourceFile, textRange), lineStarts = _a.lineStarts, firstLine = _a.firstLine, lastLine = _a.lastLine;\n            var isCommenting = insertComment || false;\n            var leftMostPosition = Number.MAX_VALUE;\n            var lineTextStarts = new ts.Map();\n            var firstNonWhitespaceCharacterRegex = new RegExp(/\\S/);\n            var isJsx = ts.isInsideJsxElement(sourceFile, lineStarts[firstLine]);\n            var openComment = isJsx ? \"{/*\" : \"//\";\n            // Check each line before any text changes.\n            for (var i = firstLine; i <= lastLine; i++) {\n                var lineText = sourceFile.text.substring(lineStarts[i], sourceFile.getLineEndOfPosition(lineStarts[i]));\n                // Find the start of text and the left-most character. No-op on empty lines.\n                var regExec = firstNonWhitespaceCharacterRegex.exec(lineText);\n                if (regExec) {\n                    leftMostPosition = Math.min(leftMostPosition, regExec.index);\n                    lineTextStarts.set(i.toString(), regExec.index);\n                    if (lineText.substr(regExec.index, openComment.length) !== openComment) {\n                        isCommenting = insertComment === undefined || insertComment;\n                    }\n                }\n            }\n            // Push all text changes.\n            for (var i = firstLine; i <= lastLine; i++) {\n                // If the range is multiline and ends on a beginning of a line, don't comment/uncomment.\n                if (firstLine !== lastLine && lineStarts[i] === textRange.end) {\n                    continue;\n                }\n                var lineTextStart = lineTextStarts.get(i.toString());\n                // If the line is not an empty line; otherwise no-op.\n                if (lineTextStart !== undefined) {\n                    if (isJsx) {\n                        textChanges.push.apply(textChanges, toggleMultilineComment(fileName, { pos: lineStarts[i] + leftMostPosition, end: sourceFile.getLineEndOfPosition(lineStarts[i]) }, isCommenting, isJsx));\n                    }\n                    else if (isCommenting) {\n                        textChanges.push({\n                            newText: openComment,\n                            span: {\n                                length: 0,\n                                start: lineStarts[i] + leftMostPosition\n                            }\n                        });\n                    }\n                    else if (sourceFile.text.substr(lineStarts[i] + lineTextStart, openComment.length) === openComment) {\n                        textChanges.push({\n                            newText: \"\",\n                            span: {\n                                length: openComment.length,\n                                start: lineStarts[i] + lineTextStart\n                            }\n                        });\n                    }\n                }\n            }\n            return textChanges;\n        }\n        function toggleMultilineComment(fileName, textRange, insertComment, isInsideJsx) {\n            var _a;\n            var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);\n            var textChanges = [];\n            var text = sourceFile.text;\n            var hasComment = false;\n            var isCommenting = insertComment || false;\n            var positions = [];\n            var pos = textRange.pos;\n            var isJsx = isInsideJsx !== undefined ? isInsideJsx : ts.isInsideJsxElement(sourceFile, pos);\n            var openMultiline = isJsx ? \"{/*\" : \"/*\";\n            var closeMultiline = isJsx ? \"*/}\" : \"*/\";\n            var openMultilineRegex = isJsx ? \"\\\\{\\\\/\\\\*\" : \"\\\\/\\\\*\";\n            var closeMultilineRegex = isJsx ? \"\\\\*\\\\/\\\\}\" : \"\\\\*\\\\/\";\n            // Get all comment positions\n            while (pos <= textRange.end) {\n                // Start of comment is considered inside comment.\n                var offset = text.substr(pos, openMultiline.length) === openMultiline ? openMultiline.length : 0;\n                var commentRange = ts.isInComment(sourceFile, pos + offset);\n                // If position is in a comment add it to the positions array.\n                if (commentRange) {\n                    // Comment range doesn't include the brace character. Increase it to include them.\n                    if (isJsx) {\n                        commentRange.pos--;\n                        commentRange.end++;\n                    }\n                    positions.push(commentRange.pos);\n                    if (commentRange.kind === 3 /* MultiLineCommentTrivia */) {\n                        positions.push(commentRange.end);\n                    }\n                    hasComment = true;\n                    pos = commentRange.end + 1;\n                }\n                else { // If it's not in a comment range, then we need to comment the uncommented portions.\n                    var newPos = text.substring(pos, textRange.end).search(\"(\" + openMultilineRegex + \")|(\" + closeMultilineRegex + \")\");\n                    isCommenting = insertComment !== undefined\n                        ? insertComment\n                        : isCommenting || !ts.isTextWhiteSpaceLike(text, pos, newPos === -1 ? textRange.end : pos + newPos); // If isCommenting is already true we don't need to check whitespace again.\n                    pos = newPos === -1 ? textRange.end + 1 : pos + newPos + closeMultiline.length;\n                }\n            }\n            // If it didn't found a comment and isCommenting is false means is only empty space.\n            // We want to insert comment in this scenario.\n            if (isCommenting || !hasComment) {\n                if (((_a = ts.isInComment(sourceFile, textRange.pos)) === null || _a === void 0 ? void 0 : _a.kind) !== 2 /* SingleLineCommentTrivia */) {\n                    ts.insertSorted(positions, textRange.pos, ts.compareValues);\n                }\n                ts.insertSorted(positions, textRange.end, ts.compareValues);\n                // Insert open comment if the first position is not a comment already.\n                var firstPos = positions[0];\n                if (text.substr(firstPos, openMultiline.length) !== openMultiline) {\n                    textChanges.push({\n                        newText: openMultiline,\n                        span: {\n                            length: 0,\n                            start: firstPos\n                        }\n                    });\n                }\n                // Insert open and close comment to all positions between first and last. Exclusive.\n                for (var i = 1; i < positions.length - 1; i++) {\n                    if (text.substr(positions[i] - closeMultiline.length, closeMultiline.length) !== closeMultiline) {\n                        textChanges.push({\n                            newText: closeMultiline,\n                            span: {\n                                length: 0,\n                                start: positions[i]\n                            }\n                        });\n                    }\n                    if (text.substr(positions[i], openMultiline.length) !== openMultiline) {\n                        textChanges.push({\n                            newText: openMultiline,\n                            span: {\n                                length: 0,\n                                start: positions[i]\n                            }\n                        });\n                    }\n                }\n                // Insert open comment if the last position is not a comment already.\n                if (textChanges.length % 2 !== 0) {\n                    textChanges.push({\n                        newText: closeMultiline,\n                        span: {\n                            length: 0,\n                            start: positions[positions.length - 1]\n                        }\n                    });\n                }\n            }\n            else {\n                // If is not commenting then remove all comments found.\n                for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {\n                    var pos_1 = positions_1[_i];\n                    var from = pos_1 - closeMultiline.length > 0 ? pos_1 - closeMultiline.length : 0;\n                    var offset = text.substr(from, closeMultiline.length) === closeMultiline ? closeMultiline.length : 0;\n                    textChanges.push({\n                        newText: \"\",\n                        span: {\n                            length: openMultiline.length,\n                            start: pos_1 - offset\n                        }\n                    });\n                }\n            }\n            return textChanges;\n        }\n        function commentSelection(fileName, textRange) {\n            var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);\n            var _a = getLinesForRange(sourceFile, textRange), firstLine = _a.firstLine, lastLine = _a.lastLine;\n            // If there is a selection that is on the same line, add multiline.\n            return firstLine === lastLine && textRange.pos !== textRange.end\n                ? toggleMultilineComment(fileName, textRange, /*insertComment*/ true)\n                : toggleLineComment(fileName, textRange, /*insertComment*/ true);\n        }\n        function uncommentSelection(fileName, textRange) {\n            var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);\n            var textChanges = [];\n            var pos = textRange.pos;\n            var end = textRange.end;\n            // If cursor is not a selection we need to increase the end position\n            // to include the start of the comment.\n            if (pos === end) {\n                end += ts.isInsideJsxElement(sourceFile, pos) ? 2 : 1;\n            }\n            for (var i = pos; i <= end; i++) {\n                var commentRange = ts.isInComment(sourceFile, i);\n                if (commentRange) {\n                    switch (commentRange.kind) {\n                        case 2 /* SingleLineCommentTrivia */:\n                            textChanges.push.apply(textChanges, toggleLineComment(fileName, { end: commentRange.end, pos: commentRange.pos + 1 }, /*insertComment*/ false));\n                            break;\n                        case 3 /* MultiLineCommentTrivia */:\n                            textChanges.push.apply(textChanges, toggleMultilineComment(fileName, { end: commentRange.end, pos: commentRange.pos + 1 }, /*insertComment*/ false));\n                    }\n                    i = commentRange.end + 1;\n                }\n            }\n            return textChanges;\n        }\n        function isUnclosedTag(_a) {\n            var openingElement = _a.openingElement, closingElement = _a.closingElement, parent = _a.parent;\n            return !ts.tagNamesAreEquivalent(openingElement.tagName, closingElement.tagName) ||\n                ts.isJsxElement(parent) && ts.tagNamesAreEquivalent(openingElement.tagName, parent.openingElement.tagName) && isUnclosedTag(parent);\n        }\n        function getSpanOfEnclosingComment(fileName, position, onlyMultiLine) {\n            var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);\n            var range = ts.formatting.getRangeOfEnclosingComment(sourceFile, position);\n            return range && (!onlyMultiLine || range.kind === 3 /* MultiLineCommentTrivia */) ? ts.createTextSpanFromRange(range) : undefined;\n        }\n        function getTodoComments(fileName, descriptors) {\n            // Note: while getting todo comments seems like a syntactic operation, we actually\n            // treat it as a semantic operation here.  This is because we expect our host to call\n            // this on every single file.  If we treat this syntactically, then that will cause\n            // us to populate and throw away the tree in our syntax tree cache for each file.  By\n            // treating this as a semantic operation, we can access any tree without throwing\n            // anything away.\n            synchronizeHostData();\n            var sourceFile = getValidSourceFile(fileName);\n            cancellationToken.throwIfCancellationRequested();\n            var fileContents = sourceFile.text;\n            var result = [];\n            // Exclude node_modules files as we don't want to show the todos of external libraries.\n            if (descriptors.length > 0 && !isNodeModulesFile(sourceFile.fileName)) {\n                var regExp = getTodoCommentsRegExp();\n                var matchArray = void 0;\n                while (matchArray = regExp.exec(fileContents)) {\n                    cancellationToken.throwIfCancellationRequested();\n                    // If we got a match, here is what the match array will look like.  Say the source text is:\n                    //\n                    //      \"    // hack   1\"\n                    //\n                    // The result array with the regexp:    will be:\n                    //\n                    //      [\"// hack   1\", \"// \", \"hack   1\", undefined, \"hack\"]\n                    //\n                    // Here are the relevant capture groups:\n                    //  0) The full match for the entire regexp.\n                    //  1) The preamble to the message portion.\n                    //  2) The message portion.\n                    //  3...N) The descriptor that was matched - by index.  'undefined' for each\n                    //         descriptor that didn't match.  an actual value if it did match.\n                    //\n                    //  i.e. 'undefined' in position 3 above means TODO(jason) didn't match.\n                    //       \"hack\"      in position 4 means HACK did match.\n                    var firstDescriptorCaptureIndex = 3;\n                    ts.Debug.assert(matchArray.length === descriptors.length + firstDescriptorCaptureIndex);\n                    var preamble = matchArray[1];\n                    var matchPosition = matchArray.index + preamble.length;\n                    // OK, we have found a match in the file.  This is only an acceptable match if\n                    // it is contained within a comment.\n                    if (!ts.isInComment(sourceFile, matchPosition)) {\n                        continue;\n                    }\n                    var descriptor = void 0;\n                    for (var i = 0; i < descriptors.length; i++) {\n                        if (matchArray[i + firstDescriptorCaptureIndex]) {\n                            descriptor = descriptors[i];\n                        }\n                    }\n                    if (descriptor === undefined)\n                        return ts.Debug.fail();\n                    // We don't want to match something like 'TODOBY', so we make sure a non\n                    // letter/digit follows the match.\n                    if (isLetterOrDigit(fileContents.charCodeAt(matchPosition + descriptor.text.length))) {\n                        continue;\n                    }\n                    var message = matchArray[2];\n                    result.push({ descriptor: descriptor, message: message, position: matchPosition });\n                }\n            }\n            return result;\n            function escapeRegExp(str) {\n                return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\");\n            }\n            function getTodoCommentsRegExp() {\n                // NOTE: `?:` means 'non-capture group'.  It allows us to have groups without having to\n                // filter them out later in the final result array.\n                // TODO comments can appear in one of the following forms:\n                //\n                //  1)      // TODO     or  /////////// TODO\n                //\n                //  2)      /* TODO     or  /********** TODO\n                //\n                //  3)      /*\n                //           *   TODO\n                //           */\n                //\n                // The following three regexps are used to match the start of the text up to the TODO\n                // comment portion.\n                var singleLineCommentStart = /(?:\\/\\/+\\s*)/.source;\n                var multiLineCommentStart = /(?:\\/\\*+\\s*)/.source;\n                var anyNumberOfSpacesAndAsterisksAtStartOfLine = /(?:^(?:\\s|\\*)*)/.source;\n                // Match any of the above three TODO comment start regexps.\n                // Note that the outermost group *is* a capture group.  We want to capture the preamble\n                // so that we can determine the starting position of the TODO comment match.\n                var preamble = \"(\" + anyNumberOfSpacesAndAsterisksAtStartOfLine + \"|\" + singleLineCommentStart + \"|\" + multiLineCommentStart + \")\";\n                // Takes the descriptors and forms a regexp that matches them as if they were literals.\n                // For example, if the descriptors are \"TODO(jason)\" and \"HACK\", then this will be:\n                //\n                //      (?:(TODO\\(jason\\))|(HACK))\n                //\n                // Note that the outermost group is *not* a capture group, but the innermost groups\n                // *are* capture groups.  By capturing the inner literals we can determine after\n                // matching which descriptor we are dealing with.\n                var literals = \"(?:\" + ts.map(descriptors, function (d) { return \"(\" + escapeRegExp(d.text) + \")\"; }).join(\"|\") + \")\";\n                // After matching a descriptor literal, the following regexp matches the rest of the\n                // text up to the end of the line (or */).\n                var endOfLineOrEndOfComment = /(?:$|\\*\\/)/.source;\n                var messageRemainder = /(?:.*?)/.source;\n                // This is the portion of the match we'll return as part of the TODO comment result. We\n                // match the literal portion up to the end of the line or end of comment.\n                var messagePortion = \"(\" + literals + messageRemainder + \")\";\n                var regExpString = preamble + messagePortion + endOfLineOrEndOfComment;\n                // The final regexp will look like this:\n                // /((?:\\/\\/+\\s*)|(?:\\/\\*+\\s*)|(?:^(?:\\s|\\*)*))((?:(TODO\\(jason\\))|(HACK))(?:.*?))(?:$|\\*\\/)/gim\n                // The flags of the regexp are important here.\n                //  'g' is so that we are doing a global search and can find matches several times\n                //  in the input.\n                //\n                //  'i' is for case insensitivity (We do this to match C# TODO comment code).\n                //\n                //  'm' is so we can find matches in a multi-line input.\n                return new RegExp(regExpString, \"gim\");\n            }\n            function isLetterOrDigit(char) {\n                return (char >= 97 /* a */ && char <= 122 /* z */) ||\n                    (char >= 65 /* A */ && char <= 90 /* Z */) ||\n                    (char >= 48 /* _0 */ && char <= 57 /* _9 */);\n            }\n            function isNodeModulesFile(path) {\n                return ts.stringContains(path, \"/node_modules/\");\n            }\n        }\n        function getRenameInfo(fileName, position, options) {\n            synchronizeHostData();\n            return ts.Rename.getRenameInfo(program, getValidSourceFile(fileName), position, options);\n        }\n        function getRefactorContext(file, positionOrRange, preferences, formatOptions, triggerReason, kind) {\n            var _a = typeof positionOrRange === \"number\" ? [positionOrRange, undefined] : [positionOrRange.pos, positionOrRange.end], startPosition = _a[0], endPosition = _a[1];\n            return {\n                file: file,\n                startPosition: startPosition,\n                endPosition: endPosition,\n                program: getProgram(),\n                host: host,\n                formatContext: ts.formatting.getFormatContext(formatOptions, host),\n                cancellationToken: cancellationToken,\n                preferences: preferences,\n                triggerReason: triggerReason,\n                kind: kind\n            };\n        }\n        function getSmartSelectionRange(fileName, position) {\n            return ts.SmartSelectionRange.getSmartSelectionRange(position, syntaxTreeCache.getCurrentSourceFile(fileName));\n        }\n        function getApplicableRefactors(fileName, positionOrRange, preferences, triggerReason, kind) {\n            if (preferences === void 0) { preferences = ts.emptyOptions; }\n            synchronizeHostData();\n            var file = getValidSourceFile(fileName);\n            return ts.refactor.getApplicableRefactors(getRefactorContext(file, positionOrRange, preferences, ts.emptyOptions, triggerReason, kind));\n        }\n        function getEditsForRefactor(fileName, formatOptions, positionOrRange, refactorName, actionName, preferences) {\n            if (preferences === void 0) { preferences = ts.emptyOptions; }\n            synchronizeHostData();\n            var file = getValidSourceFile(fileName);\n            return ts.refactor.getEditsForRefactor(getRefactorContext(file, positionOrRange, preferences, formatOptions), refactorName, actionName);\n        }\n        function prepareCallHierarchy(fileName, position) {\n            synchronizeHostData();\n            var declarations = ts.CallHierarchy.resolveCallHierarchyDeclaration(program, ts.getTouchingPropertyName(getValidSourceFile(fileName), position));\n            return declarations && ts.mapOneOrMany(declarations, function (declaration) { return ts.CallHierarchy.createCallHierarchyItem(program, declaration); });\n        }\n        function provideCallHierarchyIncomingCalls(fileName, position) {\n            synchronizeHostData();\n            var sourceFile = getValidSourceFile(fileName);\n            var declaration = ts.firstOrOnly(ts.CallHierarchy.resolveCallHierarchyDeclaration(program, position === 0 ? sourceFile : ts.getTouchingPropertyName(sourceFile, position)));\n            return declaration ? ts.CallHierarchy.getIncomingCalls(program, declaration, cancellationToken) : [];\n        }\n        function provideCallHierarchyOutgoingCalls(fileName, position) {\n            synchronizeHostData();\n            var sourceFile = getValidSourceFile(fileName);\n            var declaration = ts.firstOrOnly(ts.CallHierarchy.resolveCallHierarchyDeclaration(program, position === 0 ? sourceFile : ts.getTouchingPropertyName(sourceFile, position)));\n            return declaration ? ts.CallHierarchy.getOutgoingCalls(program, declaration) : [];\n        }\n        var ls = {\n            dispose: dispose,\n            cleanupSemanticCache: cleanupSemanticCache,\n            getSyntacticDiagnostics: getSyntacticDiagnostics,\n            getSemanticDiagnostics: getSemanticDiagnostics,\n            getSuggestionDiagnostics: getSuggestionDiagnostics,\n            getCompilerOptionsDiagnostics: getCompilerOptionsDiagnostics,\n            getSyntacticClassifications: getSyntacticClassifications,\n            getSemanticClassifications: getSemanticClassifications,\n            getEncodedSyntacticClassifications: getEncodedSyntacticClassifications,\n            getEncodedSemanticClassifications: getEncodedSemanticClassifications,\n            getCompletionsAtPosition: getCompletionsAtPosition,\n            getCompletionEntryDetails: getCompletionEntryDetails,\n            getCompletionEntrySymbol: getCompletionEntrySymbol,\n            getSignatureHelpItems: getSignatureHelpItems,\n            getQuickInfoAtPosition: getQuickInfoAtPosition,\n            getDefinitionAtPosition: getDefinitionAtPosition,\n            getDefinitionAndBoundSpan: getDefinitionAndBoundSpan,\n            getImplementationAtPosition: getImplementationAtPosition,\n            getTypeDefinitionAtPosition: getTypeDefinitionAtPosition,\n            getReferencesAtPosition: getReferencesAtPosition,\n            findReferences: findReferences,\n            getFileReferences: getFileReferences,\n            getOccurrencesAtPosition: getOccurrencesAtPosition,\n            getDocumentHighlights: getDocumentHighlights,\n            getNameOrDottedNameSpan: getNameOrDottedNameSpan,\n            getBreakpointStatementAtPosition: getBreakpointStatementAtPosition,\n            getNavigateToItems: getNavigateToItems,\n            getRenameInfo: getRenameInfo,\n            getSmartSelectionRange: getSmartSelectionRange,\n            findRenameLocations: findRenameLocations,\n            getNavigationBarItems: getNavigationBarItems,\n            getNavigationTree: getNavigationTree,\n            getOutliningSpans: getOutliningSpans,\n            getTodoComments: getTodoComments,\n            getBraceMatchingAtPosition: getBraceMatchingAtPosition,\n            getIndentationAtPosition: getIndentationAtPosition,\n            getFormattingEditsForRange: getFormattingEditsForRange,\n            getFormattingEditsForDocument: getFormattingEditsForDocument,\n            getFormattingEditsAfterKeystroke: getFormattingEditsAfterKeystroke,\n            getDocCommentTemplateAtPosition: getDocCommentTemplateAtPosition,\n            isValidBraceCompletionAtPosition: isValidBraceCompletionAtPosition,\n            getJsxClosingTagAtPosition: getJsxClosingTagAtPosition,\n            getSpanOfEnclosingComment: getSpanOfEnclosingComment,\n            getCodeFixesAtPosition: getCodeFixesAtPosition,\n            getCombinedCodeFix: getCombinedCodeFix,\n            applyCodeActionCommand: applyCodeActionCommand,\n            organizeImports: organizeImports,\n            getEditsForFileRename: getEditsForFileRename,\n            getEmitOutput: getEmitOutput,\n            getNonBoundSourceFile: getNonBoundSourceFile,\n            getProgram: getProgram,\n            getAutoImportProvider: getAutoImportProvider,\n            getApplicableRefactors: getApplicableRefactors,\n            getEditsForRefactor: getEditsForRefactor,\n            toLineColumnOffset: sourceMapper.toLineColumnOffset,\n            getSourceMapper: function () { return sourceMapper; },\n            clearSourceMapperCache: function () { return sourceMapper.clearCache(); },\n            prepareCallHierarchy: prepareCallHierarchy,\n            provideCallHierarchyIncomingCalls: provideCallHierarchyIncomingCalls,\n            provideCallHierarchyOutgoingCalls: provideCallHierarchyOutgoingCalls,\n            toggleLineComment: toggleLineComment,\n            toggleMultilineComment: toggleMultilineComment,\n            commentSelection: commentSelection,\n            uncommentSelection: uncommentSelection,\n        };\n        switch (languageServiceMode) {\n            case ts.LanguageServiceMode.Semantic:\n                break;\n            case ts.LanguageServiceMode.PartialSemantic:\n                invalidOperationsInPartialSemanticMode.forEach(function (key) {\n                    return ls[key] = function () {\n                        throw new Error(\"LanguageService Operation: \" + key + \" not allowed in LanguageServiceMode.PartialSemantic\");\n                    };\n                });\n                break;\n            case ts.LanguageServiceMode.Syntactic:\n                invalidOperationsInSyntacticMode.forEach(function (key) {\n                    return ls[key] = function () {\n                        throw new Error(\"LanguageService Operation: \" + key + \" not allowed in LanguageServiceMode.Syntactic\");\n                    };\n                });\n                break;\n            default:\n                ts.Debug.assertNever(languageServiceMode);\n        }\n        return ls;\n    }\n    ts.createLanguageService = createLanguageService;\n    /* @internal */\n    /** Names in the name table are escaped, so an identifier `__foo` will have a name table entry `___foo`. */\n    function getNameTable(sourceFile) {\n        if (!sourceFile.nameTable) {\n            initializeNameTable(sourceFile);\n        }\n        return sourceFile.nameTable; // TODO: GH#18217\n    }\n    ts.getNameTable = getNameTable;\n    function initializeNameTable(sourceFile) {\n        var nameTable = sourceFile.nameTable = new ts.Map();\n        sourceFile.forEachChild(function walk(node) {\n            if (ts.isIdentifier(node) && !ts.isTagName(node) && node.escapedText || ts.isStringOrNumericLiteralLike(node) && literalIsName(node)) {\n                var text = ts.getEscapedTextOfIdentifierOrLiteral(node);\n                nameTable.set(text, nameTable.get(text) === undefined ? node.pos : -1);\n            }\n            else if (ts.isPrivateIdentifier(node)) {\n                var text = node.escapedText;\n                nameTable.set(text, nameTable.get(text) === undefined ? node.pos : -1);\n            }\n            ts.forEachChild(node, walk);\n            if (ts.hasJSDocNodes(node)) {\n                for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) {\n                    var jsDoc = _a[_i];\n                    ts.forEachChild(jsDoc, walk);\n                }\n            }\n        });\n    }\n    /**\n     * We want to store any numbers/strings if they were a name that could be\n     * related to a declaration.  So, if we have 'import x = require(\"something\")'\n     * then we want 'something' to be in the name table.  Similarly, if we have\n     * \"a['propname']\" then we want to store \"propname\" in the name table.\n     */\n    function literalIsName(node) {\n        return ts.isDeclarationName(node) ||\n            node.parent.kind === 272 /* ExternalModuleReference */ ||\n            isArgumentOfElementAccessExpression(node) ||\n            ts.isLiteralComputedPropertyDeclarationName(node);\n    }\n    /**\n     * Returns the containing object literal property declaration given a possible name node, e.g. \"a\" in x = { \"a\": 1 }\n     */\n    /* @internal */\n    function getContainingObjectLiteralElement(node) {\n        var element = getContainingObjectLiteralElementWorker(node);\n        return element && (ts.isObjectLiteralExpression(element.parent) || ts.isJsxAttributes(element.parent)) ? element : undefined;\n    }\n    ts.getContainingObjectLiteralElement = getContainingObjectLiteralElement;\n    function getContainingObjectLiteralElementWorker(node) {\n        switch (node.kind) {\n            case 10 /* StringLiteral */:\n            case 14 /* NoSubstitutionTemplateLiteral */:\n            case 8 /* NumericLiteral */:\n                if (node.parent.kind === 158 /* ComputedPropertyName */) {\n                    return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined;\n                }\n            // falls through\n            case 78 /* Identifier */:\n                return ts.isObjectLiteralElement(node.parent) &&\n                    (node.parent.parent.kind === 200 /* ObjectLiteralExpression */ || node.parent.parent.kind === 281 /* JsxAttributes */) &&\n                    node.parent.name === node ? node.parent : undefined;\n        }\n        return undefined;\n    }\n    function getSymbolAtLocationForQuickInfo(node, checker) {\n        var object = getContainingObjectLiteralElement(node);\n        if (object) {\n            var contextualType = checker.getContextualType(object.parent);\n            var properties = contextualType && getPropertySymbolsFromContextualType(object, checker, contextualType, /*unionSymbolOk*/ false);\n            if (properties && properties.length === 1) {\n                return ts.first(properties);\n            }\n        }\n        return checker.getSymbolAtLocation(node);\n    }\n    /** Gets all symbols for one property. Does not get symbols for every property. */\n    /* @internal */\n    function getPropertySymbolsFromContextualType(node, checker, contextualType, unionSymbolOk) {\n        var name = ts.getNameFromPropertyName(node.name);\n        if (!name)\n            return ts.emptyArray;\n        if (!contextualType.isUnion()) {\n            var symbol = contextualType.getProperty(name);\n            return symbol ? [symbol] : ts.emptyArray;\n        }\n        var discriminatedPropertySymbols = ts.mapDefined(contextualType.types, function (t) { return (ts.isObjectLiteralExpression(node.parent) || ts.isJsxAttributes(node.parent)) && checker.isTypeInvalidDueToUnionDiscriminant(t, node.parent) ? undefined : t.getProperty(name); });\n        if (unionSymbolOk && (discriminatedPropertySymbols.length === 0 || discriminatedPropertySymbols.length === contextualType.types.length)) {\n            var symbol = contextualType.getProperty(name);\n            if (symbol)\n                return [symbol];\n        }\n        if (discriminatedPropertySymbols.length === 0) {\n            // Bad discriminant -- do again without discriminating\n            return ts.mapDefined(contextualType.types, function (t) { return t.getProperty(name); });\n        }\n        return discriminatedPropertySymbols;\n    }\n    ts.getPropertySymbolsFromContextualType = getPropertySymbolsFromContextualType;\n    function isArgumentOfElementAccessExpression(node) {\n        return node &&\n            node.parent &&\n            node.parent.kind === 202 /* ElementAccessExpression */ &&\n            node.parent.argumentExpression === node;\n    }\n    /**\n     * Get the path of the default library files (lib.d.ts) as distributed with the typescript\n     * node package.\n     * The functionality is not supported if the ts module is consumed outside of a node module.\n     */\n    function getDefaultLibFilePath(options) {\n        // Check __dirname is defined and that we are on a node.js system.\n        if (true) {\n            return __dirname + ts.directorySeparator + ts.getDefaultLibFileName(options);\n        }\n        throw new Error(\"getDefaultLibFilePath is only supported when consumed as a node module. \");\n    }\n    ts.getDefaultLibFilePath = getDefaultLibFilePath;\n    ts.setObjectAllocator(getServicesObjectAllocator());\n})(ts || (ts = {}));\n/* @internal */\nvar ts;\n(function (ts) {\n    var BreakpointResolver;\n    (function (BreakpointResolver) {\n        /**\n         * Get the breakpoint span in given sourceFile\n         */\n        function spanInSourceFileAtLocation(sourceFile, position) {\n            // Cannot set breakpoint in dts file\n            if (sourceFile.isDeclarationFile) {\n                return undefined;\n            }\n            var tokenAtLocation = ts.getTokenAtPosition(sourceFile, position);\n            var lineOfPosition = sourceFile.getLineAndCharacterOfPosition(position).line;\n            if (sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getStart(sourceFile)).line > lineOfPosition) {\n                // Get previous token if the token is returned starts on new line\n                // eg: let x =10; |--- cursor is here\n                //     let y = 10;\n                // token at position will return let keyword on second line as the token but we would like to use\n                // token on same line if trailing trivia (comments or white spaces on same line) part of the last token on that line\n                var preceding = ts.findPrecedingToken(tokenAtLocation.pos, sourceFile);\n                // It's a blank line\n                if (!preceding || sourceFile.getLineAndCharacterOfPosition(preceding.getEnd()).line !== lineOfPosition) {\n                    return undefined;\n                }\n                tokenAtLocation = preceding;\n            }\n            // Cannot set breakpoint in ambient declarations\n            if (tokenAtLocation.flags & 8388608 /* Ambient */) {\n                return undefined;\n            }\n            // Get the span in the node based on its syntax\n            return spanInNode(tokenAtLocation);\n            function textSpan(startNode, endNode) {\n                var start = startNode.decorators ?\n                    ts.skipTrivia(sourceFile.text, startNode.decorators.end) :\n                    startNode.getStart(sourceFile);\n                return ts.createTextSpanFromBounds(start, (endNode || startNode).getEnd());\n            }\n            function textSpanEndingAtNextToken(startNode, previousTokenToFindNextEndToken) {\n                return textSpan(startNode, ts.findNextToken(previousTokenToFindNextEndToken, previousTokenToFindNextEndToken.parent, sourceFile));\n            }\n            function spanInNodeIfStartsOnSameLine(node, otherwiseOnNode) {\n                if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line) {\n                    return spanInNode(node);\n                }\n                return spanInNode(otherwiseOnNode);\n            }\n            function spanInNodeArray(nodeArray) {\n                return ts.createTextSpanFromBounds(ts.skipTrivia(sourceFile.text, nodeArray.pos), nodeArray.end);\n            }\n            function spanInPreviousNode(node) {\n                return spanInNode(ts.findPrecedingToken(node.pos, sourceFile));\n            }\n            function spanInNextNode(node) {\n                return spanInNode(ts.findNextToken(node, node.parent, sourceFile));\n            }\n            function spanInNode(node) {\n                if (node) {\n                    var parent = node.parent;\n                    switch (node.kind) {\n                        case 232 /* VariableStatement */:\n                            // Span on first variable declaration\n                            return spanInVariableDeclaration(node.declarationList.declarations[0]);\n                        case 249 /* VariableDeclaration */:\n                        case 163 /* PropertyDeclaration */:\n                        case 162 /* PropertySignature */:\n                            return spanInVariableDeclaration(node);\n                        case 160 /* Parameter */:\n                            return spanInParameterDeclaration(node);\n                        case 251 /* FunctionDeclaration */:\n                        case 165 /* MethodDeclaration */:\n                        case 164 /* MethodSignature */:\n                        case 167 /* GetAccessor */:\n                        case 168 /* SetAccessor */:\n                        case 166 /* Constructor */:\n                        case 208 /* FunctionExpression */:\n                        case 209 /* ArrowFunction */:\n                            return spanInFunctionDeclaration(node);\n                        case 230 /* Block */:\n                            if (ts.isFunctionBlock(node)) {\n                                return spanInFunctionBlock(node);\n                            }\n                        // falls through\n                        case 257 /* ModuleBlock */:\n                            return spanInBlock(node);\n                        case 287 /* CatchClause */:\n                            return spanInBlock(node.block);\n                        case 233 /* ExpressionStatement */:\n                            // span on the expression\n                            return textSpan(node.expression);\n                        case 242 /* ReturnStatement */:\n                            // span on return keyword and expression if present\n                            return textSpan(node.getChildAt(0), node.expression);\n                        case 236 /* WhileStatement */:\n                            // Span on while(...)\n                            return textSpanEndingAtNextToken(node, node.expression);\n                        case 235 /* DoStatement */:\n                            // span in statement of the do statement\n                            return spanInNode(node.statement);\n                        case 248 /* DebuggerStatement */:\n                            // span on debugger keyword\n                            return textSpan(node.getChildAt(0));\n                        case 234 /* IfStatement */:\n                            // set on if(..) span\n                            return textSpanEndingAtNextToken(node, node.expression);\n                        case 245 /* LabeledStatement */:\n                            // span in statement\n                            return spanInNode(node.statement);\n                        case 241 /* BreakStatement */:\n                        case 240 /* ContinueStatement */:\n                            // On break or continue keyword and label if present\n                            return textSpan(node.getChildAt(0), node.label);\n                        case 237 /* ForStatement */:\n                            return spanInForStatement(node);\n                        case 238 /* ForInStatement */:\n                            // span of for (a in ...)\n                            return textSpanEndingAtNextToken(node, node.expression);\n                        case 239 /* ForOfStatement */:\n                            // span in initializer\n                            return spanInInitializerOfForLike(node);\n                        case 244 /* SwitchStatement */:\n                            // span on switch(...)\n                            return textSpanEndingAtNextToken(node, node.expression);\n                        case 284 /* CaseClause */:\n                        case 285 /* DefaultClause */:\n                            // span in first statement of the clause\n                            return spanInNode(node.statements[0]);\n                        case 247 /* TryStatement */:\n                            // span in try block\n                            return spanInBlock(node.tryBlock);\n                        case 246 /* ThrowStatement */:\n                            // span in throw ...\n                            return textSpan(node, node.expression);\n                        case 266 /* ExportAssignment */:\n                            // span on export = id\n                            return textSpan(node, node.expression);\n                        case 260 /* ImportEqualsDeclaration */:\n                            // import statement without including semicolon\n                            return textSpan(node, node.moduleReference);\n                        case 261 /* ImportDeclaration */:\n                            // import statement without including semicolon\n                            return textSpan(node, node.moduleSpecifier);\n                        case 267 /* ExportDeclaration */:\n                            // import statement without including semicolon\n                            return textSpan(node, node.moduleSpecifier);\n                        case 256 /* ModuleDeclaration */:\n                            // span on complete module if it is instantiated\n                            if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) {\n                                return undefined;\n                            }\n                        // falls through\n                        case 252 /* ClassDeclaration */:\n                        case 255 /* EnumDeclaration */:\n                        case 291 /* EnumMember */:\n                        case 198 /* BindingElement */:\n                            // span on complete node\n                            return textSpan(node);\n                        case 243 /* WithStatement */:\n                            // span in statement\n                            return spanInNode(node.statement);\n                        case 161 /* Decorator */:\n                            return spanInNodeArray(parent.decorators);\n                        case 196 /* ObjectBindingPattern */:\n                        case 197 /* ArrayBindingPattern */:\n                            return spanInBindingPattern(node);\n                        // No breakpoint in interface, type alias\n                        case 253 /* InterfaceDeclaration */:\n                        case 254 /* TypeAliasDeclaration */:\n                            return undefined;\n                        // Tokens:\n                        case 26 /* SemicolonToken */:\n                        case 1 /* EndOfFileToken */:\n                            return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile));\n                        case 27 /* CommaToken */:\n                            return spanInPreviousNode(node);\n                        case 18 /* OpenBraceToken */:\n                            return spanInOpenBraceToken(node);\n                        case 19 /* CloseBraceToken */:\n                            return spanInCloseBraceToken(node);\n                        case 23 /* CloseBracketToken */:\n                            return spanInCloseBracketToken(node);\n                        case 20 /* OpenParenToken */:\n                            return spanInOpenParenToken(node);\n                        case 21 /* CloseParenToken */:\n                            return spanInCloseParenToken(node);\n                        case 58 /* ColonToken */:\n                            return spanInColonToken(node);\n                        case 31 /* GreaterThanToken */:\n                        case 29 /* LessThanToken */:\n                            return spanInGreaterThanOrLessThanToken(node);\n                        // Keywords:\n                        case 114 /* WhileKeyword */:\n                            return spanInWhileKeyword(node);\n                        case 90 /* ElseKeyword */:\n                        case 82 /* CatchKeyword */:\n                        case 95 /* FinallyKeyword */:\n                            return spanInNextNode(node);\n                        case 156 /* OfKeyword */:\n                            return spanInOfKeyword(node);\n                        default:\n                            // Destructuring pattern in destructuring assignment\n                            // [a, b, c] of\n                            // [a, b, c] = expression\n                            if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node)) {\n                                return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node);\n                            }\n                            // Set breakpoint on identifier element of destructuring pattern\n                            // `a` or `...c` or `d: x` from\n                            // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern\n                            if ((node.kind === 78 /* Identifier */ ||\n                                node.kind === 220 /* SpreadElement */ ||\n                                node.kind === 288 /* PropertyAssignment */ ||\n                                node.kind === 289 /* ShorthandPropertyAssignment */) &&\n                                ts.isArrayLiteralOrObjectLiteralDestructuringPattern(parent)) {\n                                return textSpan(node);\n                            }\n                            if (node.kind === 216 /* BinaryExpression */) {\n                                var _a = node, left = _a.left, operatorToken = _a.operatorToken;\n                                // Set breakpoint in destructuring pattern if its destructuring assignment\n                                // [a, b, c] or {a, b, c} of\n                                // [a, b, c] = expression or\n                                // {a, b, c} = expression\n                                if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left)) {\n                                    return spanInArrayLiteralOrObjectLiteralDestructuringPattern(left);\n                                }\n                                if (operatorToken.kind === 62 /* EqualsToken */ && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) {\n                                    // Set breakpoint on assignment expression element of destructuring pattern\n                                    // a = expression of\n                                    // [a = expression, b, c] = someExpression or\n                                    // { a = expression, b, c } = someExpression\n                                    return textSpan(node);\n                                }\n                                if (operatorToken.kind === 27 /* CommaToken */) {\n                                    return spanInNode(left);\n                                }\n                            }\n                            if (ts.isExpressionNode(node)) {\n                                switch (parent.kind) {\n                                    case 235 /* DoStatement */:\n                                        // Set span as if on while keyword\n                                        return spanInPreviousNode(node);\n                                    case 161 /* Decorator */:\n                                        // Set breakpoint on the decorator emit\n                                        return spanInNode(node.parent);\n                                    case 237 /* ForStatement */:\n                                    case 239 /* ForOfStatement */:\n                                        return textSpan(node);\n                                    case 216 /* BinaryExpression */:\n                                        if (node.parent.operatorToken.kind === 27 /* CommaToken */) {\n                                            // If this is a comma expression, the breakpoint is possible in this expression\n                                            return textSpan(node);\n                                        }\n                                        break;\n                                    case 209 /* ArrowFunction */:\n                                        if (node.parent.body === node) {\n                                            // If this is body of arrow function, it is allowed to have the breakpoint\n                                            return textSpan(node);\n                                        }\n                                        break;\n                                }\n                            }\n                            switch (node.parent.kind) {\n                                case 288 /* PropertyAssignment */:\n                                    // If this is name of property assignment, set breakpoint in the initializer\n                                    if (node.parent.name === node &&\n                                        !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) {\n                                        return spanInNode(node.parent.initializer);\n                                    }\n                                    break;\n                                case 206 /* TypeAssertionExpression */:\n                                    // Breakpoint in type assertion goes to its operand\n                                    if (node.parent.type === node) {\n                                        return spanInNextNode(node.parent.type);\n                                    }\n                                    break;\n                                case 249 /* VariableDeclaration */:\n                                case 160 /* Parameter */: {\n                                    // initializer of variable/parameter declaration go to previous node\n                                    var _b = node.parent, initializer = _b.initializer, type = _b.type;\n                                    if (initializer === node || type === node || ts.isAssignmentOperator(node.kind)) {\n                                        return spanInPreviousNode(node);\n                                    }\n                                    break;\n                                }\n                                case 216 /* BinaryExpression */: {\n                                    var left = node.parent.left;\n                                    if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) {\n                                        // If initializer of destructuring assignment move to previous token\n                                        return spanInPreviousNode(node);\n                                    }\n                                    break;\n                                }\n                                default:\n                                    // return type of function go to previous token\n                                    if (ts.isFunctionLike(node.parent) && node.parent.type === node) {\n                                        return spanInPreviousNode(node);\n                                    }\n                            }\n                            // Default go to parent to set the breakpoint\n                            return spanInNode(node.parent);\n                    }\n                }\n                function textSpanFromVariableDeclaration(variableDeclaration) {\n                    if (ts.isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] === variableDeclaration) {\n                        // First declaration - include let keyword\n                        return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration);\n                    }\n                    else {\n                        // Span only on this declaration\n                        return textSpan(variableDeclaration);\n                    }\n                }\n                function spanInVariableDeclaration(variableDeclaration) {\n                    // If declaration of for in statement, just set the span in parent\n                    if (variableDeclaration.parent.parent.kind === 238 /* ForInStatement */) {\n                        return spanInNode(variableDeclaration.parent.parent);\n                    }\n                    var parent = variableDeclaration.parent;\n                    // If this is a destructuring pattern, set breakpoint in binding pattern\n                    if (ts.isBindingPattern(variableDeclaration.name)) {\n                        return spanInBindingPattern(variableDeclaration.name);\n                    }\n                    // Breakpoint is possible in variableDeclaration only if there is initialization\n                    // or its declaration from 'for of'\n                    if (variableDeclaration.initializer ||\n                        ts.hasSyntacticModifier(variableDeclaration, 1 /* Export */) ||\n                        parent.parent.kind === 239 /* ForOfStatement */) {\n                        return textSpanFromVariableDeclaration(variableDeclaration);\n                    }\n                    if (ts.isVariableDeclarationList(variableDeclaration.parent) &&\n                        variableDeclaration.parent.declarations[0] !== variableDeclaration) {\n                        // If we cannot set breakpoint on this declaration, set it on previous one\n                        // Because the variable declaration may be binding pattern and\n                        // we would like to set breakpoint in last binding element if that's the case,\n                        // use preceding token instead\n                        return spanInNode(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent));\n                    }\n                }\n                function canHaveSpanInParameterDeclaration(parameter) {\n                    // Breakpoint is possible on parameter only if it has initializer, is a rest parameter, or has public or private modifier\n                    return !!parameter.initializer || parameter.dotDotDotToken !== undefined ||\n                        ts.hasSyntacticModifier(parameter, 4 /* Public */ | 8 /* Private */);\n                }\n                function spanInParameterDeclaration(parameter) {\n                    if (ts.isBindingPattern(parameter.name)) {\n                        // Set breakpoint in binding pattern\n                        return spanInBindingPattern(parameter.name);\n                    }\n                    else if (canHaveSpanInParameterDeclaration(parameter)) {\n                        return textSpan(parameter);\n                    }\n                    else {\n                        var functionDeclaration = parameter.parent;\n                        var indexOfParameter = functionDeclaration.parameters.indexOf(parameter);\n                        ts.Debug.assert(indexOfParameter !== -1);\n                        if (indexOfParameter !== 0) {\n                            // Not a first parameter, go to previous parameter\n                            return spanInParameterDeclaration(functionDeclaration.parameters[indexOfParameter - 1]);\n                        }\n                        else {\n                            // Set breakpoint in the function declaration body\n                            return spanInNode(functionDeclaration.body);\n                        }\n                    }\n                }\n                function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) {\n                    return ts.hasSyntacticModifier(functionDeclaration, 1 /* Export */) ||\n                        (functionDeclaration.parent.kind === 252 /* ClassDeclaration */ && functionDeclaration.kind !== 166 /* Constructor */);\n                }\n                function spanInFunctionDeclaration(functionDeclaration) {\n                    // No breakpoints in the function signature\n                    if (!functionDeclaration.body) {\n                        return undefined;\n                    }\n                    if (canFunctionHaveSpanInWholeDeclaration(functionDeclaration)) {\n                        // Set the span on whole function declaration\n                        return textSpan(functionDeclaration);\n                    }\n                    // Set span in function body\n                    return spanInNode(functionDeclaration.body);\n                }\n                function spanInFunctionBlock(block) {\n                    var nodeForSpanInBlock = block.statements.length ? block.statements[0] : block.getLastToken();\n                    if (canFunctionHaveSpanInWholeDeclaration(block.parent)) {\n                        return spanInNodeIfStartsOnSameLine(block.parent, nodeForSpanInBlock);\n                    }\n                    return spanInNode(nodeForSpanInBlock);\n                }\n                function spanInBlock(block) {\n                    switch (block.parent.kind) {\n                        case 256 /* ModuleDeclaration */:\n                            if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) {\n                                return undefined;\n                            }\n                        // Set on parent if on same line otherwise on first statement\n                        // falls through\n                        case 236 /* WhileStatement */:\n                        case 234 /* IfStatement */:\n                        case 238 /* ForInStatement */:\n                            return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]);\n                        // Set span on previous token if it starts on same line otherwise on the first statement of the block\n                        case 237 /* ForStatement */:\n                        case 239 /* ForOfStatement */:\n                            return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]);\n                    }\n                    // Default action is to set on first statement\n                    return spanInNode(block.statements[0]);\n                }\n                function spanInInitializerOfForLike(forLikeStatement) {\n                    if (forLikeStatement.initializer.kind === 250 /* VariableDeclarationList */) {\n                        // Declaration list - set breakpoint in first declaration\n                        var variableDeclarationList = forLikeStatement.initializer;\n                        if (variableDeclarationList.declarations.length > 0) {\n                            return spanInNode(variableDeclarationList.declarations[0]);\n                        }\n                    }\n                    else {\n                        // Expression - set breakpoint in it\n                        return spanInNode(forLikeStatement.initializer);\n                    }\n                }\n                function spanInForStatement(forStatement) {\n                    if (forStatement.initializer) {\n                        return spanInInitializerOfForLike(forStatement);\n                    }\n                    if (forStatement.condition) {\n                        return textSpan(forStatement.condition);\n                    }\n                    if (forStatement.incrementor) {\n                        return textSpan(forStatement.incrementor);\n                    }\n                }\n                function spanInBindingPattern(bindingPattern) {\n                    // Set breakpoint in first binding element\n                    var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 222 /* OmittedExpression */ ? element : undefined; });\n                    if (firstBindingElement) {\n                        return spanInNode(firstBindingElement);\n                    }\n                    // Empty binding pattern of binding element, set breakpoint on binding element\n                    if (bindingPattern.parent.kind === 198 /* BindingElement */) {\n                        return textSpan(bindingPattern.parent);\n                    }\n                    // Variable declaration is used as the span\n                    return textSpanFromVariableDeclaration(bindingPattern.parent);\n                }\n                function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) {\n                    ts.Debug.assert(node.kind !== 197 /* ArrayBindingPattern */ && node.kind !== 196 /* ObjectBindingPattern */);\n                    var elements = node.kind === 199 /* ArrayLiteralExpression */ ? node.elements : node.properties;\n                    var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 222 /* OmittedExpression */ ? element : undefined; });\n                    if (firstBindingElement) {\n                        return spanInNode(firstBindingElement);\n                    }\n                    // Could be ArrayLiteral from destructuring assignment or\n                    // just nested element in another destructuring assignment\n                    // set breakpoint on assignment when parent is destructuring assignment\n                    // Otherwise set breakpoint for this element\n                    return textSpan(node.parent.kind === 216 /* BinaryExpression */ ? node.parent : node);\n                }\n                // Tokens:\n                function spanInOpenBraceToken(node) {\n                    switch (node.parent.kind) {\n                        case 255 /* EnumDeclaration */:\n                            var enumDeclaration = node.parent;\n                            return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile));\n                        case 252 /* ClassDeclaration */:\n                            var classDeclaration = node.parent;\n                            return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile));\n                        case 258 /* CaseBlock */:\n                            return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]);\n                    }\n                    // Default to parent node\n                    return spanInNode(node.parent);\n                }\n                function spanInCloseBraceToken(node) {\n                    switch (node.parent.kind) {\n                        case 257 /* ModuleBlock */:\n                            // If this is not an instantiated module block, no bp span\n                            if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) {\n                                return undefined;\n                            }\n                        // falls through\n                        case 255 /* EnumDeclaration */:\n                        case 252 /* ClassDeclaration */:\n                            // Span on close brace token\n                            return textSpan(node);\n                        case 230 /* Block */:\n                            if (ts.isFunctionBlock(node.parent)) {\n                                // Span on close brace token\n                                return textSpan(node);\n                            }\n                        // falls through\n                        case 287 /* CatchClause */:\n                            return spanInNode(ts.lastOrUndefined(node.parent.statements));\n                        case 258 /* CaseBlock */:\n                            // breakpoint in last statement of the last clause\n                            var caseBlock = node.parent;\n                            var lastClause = ts.lastOrUndefined(caseBlock.clauses);\n                            if (lastClause) {\n                                return spanInNode(ts.lastOrUndefined(lastClause.statements));\n                            }\n                            return undefined;\n                        case 196 /* ObjectBindingPattern */:\n                            // Breakpoint in last binding element or binding pattern if it contains no elements\n                            var bindingPattern = node.parent;\n                            return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern);\n                        // Default to parent node\n                        default:\n                            if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) {\n                                // Breakpoint in last binding element or binding pattern if it contains no elements\n                                var objectLiteral = node.parent;\n                                return textSpan(ts.lastOrUndefined(objectLiteral.properties) || objectLiteral);\n                            }\n                            return spanInNode(node.parent);\n                    }\n                }\n                function spanInCloseBracketToken(node) {\n                    switch (node.parent.kind) {\n                        case 197 /* ArrayBindingPattern */:\n                            // Breakpoint in last binding element or binding pattern if it contains no elements\n                            var bindingPattern = node.parent;\n                            return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern);\n                        default:\n                            if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) {\n                                // Breakpoint in last binding element or binding pattern if it contains no elements\n                                var arrayLiteral = node.parent;\n                                return textSpan(ts.lastOrUndefined(arrayLiteral.elements) || arrayLiteral);\n                            }\n                            // Default to parent node\n                            return spanInNode(node.parent);\n                    }\n                }\n                function spanInOpenParenToken(node) {\n                    if (node.parent.kind === 235 /* DoStatement */ || // Go to while keyword and do action instead\n                        node.parent.kind === 203 /* CallExpression */ ||\n                        node.parent.kind === 204 /* NewExpression */) {\n                        return spanInPreviousNode(node);\n                    }\n                    if (node.parent.kind === 207 /* ParenthesizedExpression */) {\n                        return spanInNextNode(node);\n                    }\n                    // Default to parent node\n                    return spanInNode(node.parent);\n                }\n                function spanInCloseParenToken(node) {\n                    // Is this close paren token of parameter list, set span in previous token\n                    switch (node.parent.kind) {\n                        case 208 /* FunctionExpression */:\n                        case 251 /* FunctionDeclaration */:\n                        case 209 /* ArrowFunction */:\n                        case 165 /* MethodDeclaration */:\n                        case 164 /* MethodSignature */:\n                        case 167 /* GetAccessor */:\n                        case 168 /* SetAccessor */:\n                        case 166 /* Constructor */:\n                        case 236 /* WhileStatement */:\n                        case 235 /* DoStatement */:\n                        case 237 /* ForStatement */:\n                        case 239 /* ForOfStatement */:\n                        case 203 /* CallExpression */:\n                        case 204 /* NewExpression */:\n                        case 207 /* ParenthesizedExpression */:\n                            return spanInPreviousNode(node);\n                        // Default to parent node\n                        default:\n                            return spanInNode(node.parent);\n                    }\n                }\n                function spanInColonToken(node) {\n                    // Is this : specifying return annotation of the function declaration\n                    if (ts.isFunctionLike(node.parent) ||\n                        node.parent.kind === 288 /* PropertyAssignment */ ||\n                        node.parent.kind === 160 /* Parameter */) {\n                        return spanInPreviousNode(node);\n                    }\n                    return spanInNode(node.parent);\n                }\n                function spanInGreaterThanOrLessThanToken(node) {\n                    if (node.parent.kind === 206 /* TypeAssertionExpression */) {\n                        return spanInNextNode(node);\n                    }\n                    return spanInNode(node.parent);\n                }\n                function spanInWhileKeyword(node) {\n                    if (node.parent.kind === 235 /* DoStatement */) {\n                        // Set span on while expression\n                        return textSpanEndingAtNextToken(node, node.parent.expression);\n                    }\n                    // Default to parent node\n                    return spanInNode(node.parent);\n                }\n                function spanInOfKeyword(node) {\n                    if (node.parent.kind === 239 /* ForOfStatement */) {\n                        // Set using next token\n                        return spanInNextNode(node);\n                    }\n                    // Default to parent node\n                    return spanInNode(node.parent);\n                }\n            }\n        }\n        BreakpointResolver.spanInSourceFileAtLocation = spanInSourceFileAtLocation;\n    })(BreakpointResolver = ts.BreakpointResolver || (ts.BreakpointResolver = {}));\n})(ts || (ts = {}));\nvar ts;\n(function (ts) {\n    /**\n     * Transform one or more nodes using the supplied transformers.\n     * @param source A single `Node` or an array of `Node` objects.\n     * @param transformers An array of `TransformerFactory` callbacks used to process the transformation.\n     * @param compilerOptions Optional compiler options.\n     */\n    function transform(source, transformers, compilerOptions) {\n        var diagnostics = [];\n        compilerOptions = ts.fixupCompilerOptions(compilerOptions, diagnostics); // TODO: GH#18217\n        var nodes = ts.isArray(source) ? source : [source];\n        var result = ts.transformNodes(/*resolver*/ undefined, /*emitHost*/ undefined, ts.factory, compilerOptions, nodes, transformers, /*allowDtsFiles*/ true);\n        result.diagnostics = ts.concatenate(result.diagnostics, diagnostics);\n        return result;\n    }\n    ts.transform = transform;\n})(ts || (ts = {}));\n//\n// Copyright (c) Microsoft Corporation.  All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//   http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n/* @internal */\nvar debugObjectHost = (function () { return this; })(); // eslint-disable-line prefer-const\n// We need to use 'null' to interface with the managed side.\n/* eslint-disable no-in-operator */\n/* @internal */\nvar ts;\n(function (ts) {\n    function logInternalError(logger, err) {\n        if (logger) {\n            logger.log(\"*INTERNAL ERROR* - Exception in typescript services: \" + err.message);\n        }\n    }\n    var ScriptSnapshotShimAdapter = /** @class */ (function () {\n        function ScriptSnapshotShimAdapter(scriptSnapshotShim) {\n            this.scriptSnapshotShim = scriptSnapshotShim;\n        }\n        ScriptSnapshotShimAdapter.prototype.getText = function (start, end) {\n            return this.scriptSnapshotShim.getText(start, end);\n        };\n        ScriptSnapshotShimAdapter.prototype.getLength = function () {\n            return this.scriptSnapshotShim.getLength();\n        };\n        ScriptSnapshotShimAdapter.prototype.getChangeRange = function (oldSnapshot) {\n            var oldSnapshotShim = oldSnapshot;\n            var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim);\n            /* eslint-disable no-null/no-null */\n            if (encoded === null) {\n                return null; // TODO: GH#18217\n            }\n            /* eslint-enable no-null/no-null */\n            var decoded = JSON.parse(encoded); // TODO: GH#18217\n            return ts.createTextChangeRange(ts.createTextSpan(decoded.span.start, decoded.span.length), decoded.newLength);\n        };\n        ScriptSnapshotShimAdapter.prototype.dispose = function () {\n            // if scriptSnapshotShim is a COM object then property check becomes method call with no arguments\n            // 'in' does not have this effect\n            if (\"dispose\" in this.scriptSnapshotShim) {\n                this.scriptSnapshotShim.dispose(); // TODO: GH#18217 Can we just use `if (this.scriptSnapshotShim.dispose)`?\n            }\n        };\n        return ScriptSnapshotShimAdapter;\n    }());\n    var LanguageServiceShimHostAdapter = /** @class */ (function () {\n        function LanguageServiceShimHostAdapter(shimHost) {\n            var _this = this;\n            this.shimHost = shimHost;\n            this.loggingEnabled = false;\n            this.tracingEnabled = false;\n            // if shimHost is a COM object then property check will become method call with no arguments.\n            // 'in' does not have this effect.\n            if (\"getModuleResolutionsForFile\" in this.shimHost) {\n                this.resolveModuleNames = function (moduleNames, containingFile) {\n                    var resolutionsInFile = JSON.parse(_this.shimHost.getModuleResolutionsForFile(containingFile)); // TODO: GH#18217\n                    return ts.map(moduleNames, function (name) {\n                        var result = ts.getProperty(resolutionsInFile, name);\n                        return result ? { resolvedFileName: result, extension: ts.extensionFromPath(result), isExternalLibraryImport: false } : undefined;\n                    });\n                };\n            }\n            if (\"directoryExists\" in this.shimHost) {\n                this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); };\n            }\n            if (\"getTypeReferenceDirectiveResolutionsForFile\" in this.shimHost) {\n                this.resolveTypeReferenceDirectives = function (typeDirectiveNames, containingFile) {\n                    var typeDirectivesForFile = JSON.parse(_this.shimHost.getTypeReferenceDirectiveResolutionsForFile(containingFile)); // TODO: GH#18217\n                    return ts.map(typeDirectiveNames, function (name) { return ts.getProperty(typeDirectivesForFile, name); });\n                };\n            }\n        }\n        LanguageServiceShimHostAdapter.prototype.log = function (s) {\n            if (this.loggingEnabled) {\n                this.shimHost.log(s);\n            }\n        };\n        LanguageServiceShimHostAdapter.prototype.trace = function (s) {\n            if (this.tracingEnabled) {\n                this.shimHost.trace(s);\n            }\n        };\n        LanguageServiceShimHostAdapter.prototype.error = function (s) {\n            this.shimHost.error(s);\n        };\n        LanguageServiceShimHostAdapter.prototype.getProjectVersion = function () {\n            if (!this.shimHost.getProjectVersion) {\n                // shimmed host does not support getProjectVersion\n                return undefined; // TODO: GH#18217\n            }\n            return this.shimHost.getProjectVersion();\n        };\n        LanguageServiceShimHostAdapter.prototype.getTypeRootsVersion = function () {\n            if (!this.shimHost.getTypeRootsVersion) {\n                return 0;\n            }\n            return this.shimHost.getTypeRootsVersion();\n        };\n        LanguageServiceShimHostAdapter.prototype.useCaseSensitiveFileNames = function () {\n            return this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false;\n        };\n        LanguageServiceShimHostAdapter.prototype.getCompilationSettings = function () {\n            var settingsJson = this.shimHost.getCompilationSettings();\n            // eslint-disable-next-line no-null/no-null\n            if (settingsJson === null || settingsJson === \"\") {\n                throw Error(\"LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings\");\n            }\n            var compilerOptions = JSON.parse(settingsJson);\n            // permit language service to handle all files (filtering should be performed on the host side)\n            compilerOptions.allowNonTsExtensions = true;\n            return compilerOptions;\n        };\n        LanguageServiceShimHostAdapter.prototype.getScriptFileNames = function () {\n            var encoded = this.shimHost.getScriptFileNames();\n            return JSON.parse(encoded);\n        };\n        LanguageServiceShimHostAdapter.prototype.getScriptSnapshot = function (fileName) {\n            var scriptSnapshot = this.shimHost.getScriptSnapshot(fileName);\n            return scriptSnapshot && new ScriptSnapshotShimAdapter(scriptSnapshot);\n        };\n        LanguageServiceShimHostAdapter.prototype.getScriptKind = function (fileName) {\n            if (\"getScriptKind\" in this.shimHost) {\n                return this.shimHost.getScriptKind(fileName); // TODO: GH#18217\n            }\n            else {\n                return 0 /* Unknown */;\n            }\n        };\n        LanguageServiceShimHostAdapter.prototype.getScriptVersion = function (fileName) {\n            return this.shimHost.getScriptVersion(fileName);\n        };\n        LanguageServiceShimHostAdapter.prototype.getLocalizedDiagnosticMessages = function () {\n            /* eslint-disable no-null/no-null */\n            var diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages();\n            if (diagnosticMessagesJson === null || diagnosticMessagesJson === \"\") {\n                return null;\n            }\n            try {\n                return JSON.parse(diagnosticMessagesJson);\n            }\n            catch (e) {\n                this.log(e.description || \"diagnosticMessages.generated.json has invalid JSON format\");\n                return null;\n            }\n            /* eslint-enable no-null/no-null */\n        };\n        LanguageServiceShimHostAdapter.prototype.getCancellationToken = function () {\n            var hostCancellationToken = this.shimHost.getCancellationToken();\n            return new ts.ThrottledCancellationToken(hostCancellationToken);\n        };\n        LanguageServiceShimHostAdapter.prototype.getCurrentDirectory = function () {\n            return this.shimHost.getCurrentDirectory();\n        };\n        LanguageServiceShimHostAdapter.prototype.getDirectories = function (path) {\n            return JSON.parse(this.shimHost.getDirectories(path));\n        };\n        LanguageServiceShimHostAdapter.prototype.getDefaultLibFileName = function (options) {\n            return this.shimHost.getDefaultLibFileName(JSON.stringify(options));\n        };\n        LanguageServiceShimHostAdapter.prototype.readDirectory = function (path, extensions, exclude, include, depth) {\n            var pattern = ts.getFileMatcherPatterns(path, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory()); // TODO: GH#18217\n            return JSON.parse(this.shimHost.readDirectory(path, JSON.stringify(extensions), JSON.stringify(pattern.basePaths), pattern.excludePattern, pattern.includeFilePattern, pattern.includeDirectoryPattern, depth));\n        };\n        LanguageServiceShimHostAdapter.prototype.readFile = function (path, encoding) {\n            return this.shimHost.readFile(path, encoding);\n        };\n        LanguageServiceShimHostAdapter.prototype.fileExists = function (path) {\n            return this.shimHost.fileExists(path);\n        };\n        return LanguageServiceShimHostAdapter;\n    }());\n    ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter;\n    var CoreServicesShimHostAdapter = /** @class */ (function () {\n        function CoreServicesShimHostAdapter(shimHost) {\n            var _this = this;\n            this.shimHost = shimHost;\n            this.useCaseSensitiveFileNames = this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false;\n            if (\"directoryExists\" in this.shimHost) {\n                this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); };\n            }\n            else {\n                this.directoryExists = undefined; // TODO: GH#18217\n            }\n            if (\"realpath\" in this.shimHost) {\n                this.realpath = function (path) { return _this.shimHost.realpath(path); }; // TODO: GH#18217\n            }\n            else {\n                this.realpath = undefined; // TODO: GH#18217\n            }\n        }\n        CoreServicesShimHostAdapter.prototype.readDirectory = function (rootDir, extensions, exclude, include, depth) {\n            var pattern = ts.getFileMatcherPatterns(rootDir, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory()); // TODO: GH#18217\n            return JSON.parse(this.shimHost.readDirectory(rootDir, JSON.stringify(extensions), JSON.stringify(pattern.basePaths), pattern.excludePattern, pattern.includeFilePattern, pattern.includeDirectoryPattern, depth));\n        };\n        CoreServicesShimHostAdapter.prototype.fileExists = function (fileName) {\n            return this.shimHost.fileExists(fileName);\n        };\n        CoreServicesShimHostAdapter.prototype.readFile = function (fileName) {\n            return this.shimHost.readFile(fileName);\n        };\n        CoreServicesShimHostAdapter.prototype.getDirectories = function (path) {\n            return JSON.parse(this.shimHost.getDirectories(path));\n        };\n        return CoreServicesShimHostAdapter;\n    }());\n    ts.CoreServicesShimHostAdapter = CoreServicesShimHostAdapter;\n    function simpleForwardCall(logger, actionDescription, action, logPerformance) {\n        var start;\n        if (logPerformance) {\n            logger.log(actionDescription);\n            start = ts.timestamp();\n        }\n        var result = action();\n        if (logPerformance) {\n            var end = ts.timestamp();\n            logger.log(actionDescription + \" completed in \" + (end - start) + \" msec\");\n            if (ts.isString(result)) {\n                var str = result;\n                if (str.length > 128) {\n                    str = str.substring(0, 128) + \"...\";\n                }\n                logger.log(\"  result.length=\" + str.length + \", result='\" + JSON.stringify(str) + \"'\");\n            }\n        }\n        return result;\n    }\n    function forwardJSONCall(logger, actionDescription, action, logPerformance) {\n        return forwardCall(logger, actionDescription, /*returnJson*/ true, action, logPerformance);\n    }\n    function forwardCall(logger, actionDescription, returnJson, action, logPerformance) {\n        try {\n            var result = simpleForwardCall(logger, actionDescription, action, logPerformance);\n            return returnJson ? JSON.stringify({ result: result }) : result;\n        }\n        catch (err) {\n            if (err instanceof ts.OperationCanceledException) {\n                return JSON.stringify({ canceled: true });\n            }\n            logInternalError(logger, err);\n            err.description = actionDescription;\n            return JSON.stringify({ error: err });\n        }\n    }\n    var ShimBase = /** @class */ (function () {\n        function ShimBase(factory) {\n            this.factory = factory;\n            factory.registerShim(this);\n        }\n        ShimBase.prototype.dispose = function (_dummy) {\n            this.factory.unregisterShim(this);\n        };\n        return ShimBase;\n    }());\n    function realizeDiagnostics(diagnostics, newLine) {\n        return diagnostics.map(function (d) { return realizeDiagnostic(d, newLine); });\n    }\n    ts.realizeDiagnostics = realizeDiagnostics;\n    function realizeDiagnostic(diagnostic, newLine) {\n        return {\n            message: ts.flattenDiagnosticMessageText(diagnostic.messageText, newLine),\n            start: diagnostic.start,\n            length: diagnostic.length,\n            category: ts.diagnosticCategoryName(diagnostic),\n            code: diagnostic.code,\n            reportsUnnecessary: diagnostic.reportsUnnecessary,\n            reportsDeprecated: diagnostic.reportsDeprecated\n        };\n    }\n    var LanguageServiceShimObject = /** @class */ (function (_super) {\n        __extends(LanguageServiceShimObject, _super);\n        function LanguageServiceShimObject(factory, host, languageService) {\n            var _this = _super.call(this, factory) || this;\n            _this.host = host;\n            _this.languageService = languageService;\n            _this.logPerformance = false;\n            _this.logger = _this.host;\n            return _this;\n        }\n        LanguageServiceShimObject.prototype.forwardJSONCall = function (actionDescription, action) {\n            return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance);\n        };\n        /// DISPOSE\n        /**\n         * Ensure (almost) deterministic release of internal Javascript resources when\n         * some external native objects holds onto us (e.g. Com/Interop).\n         */\n        LanguageServiceShimObject.prototype.dispose = function (dummy) {\n            this.logger.log(\"dispose()\");\n            this.languageService.dispose();\n            this.languageService = null; // eslint-disable-line no-null/no-null\n            // force a GC\n            if (debugObjectHost && debugObjectHost.CollectGarbage) {\n                debugObjectHost.CollectGarbage();\n                this.logger.log(\"CollectGarbage()\");\n            }\n            this.logger = null; // eslint-disable-line no-null/no-null\n            _super.prototype.dispose.call(this, dummy);\n        };\n        /// REFRESH\n        /**\n         * Update the list of scripts known to the compiler\n         */\n        LanguageServiceShimObject.prototype.refresh = function (throwOnError) {\n            this.forwardJSONCall(\"refresh(\" + throwOnError + \")\", function () { return null; } // eslint-disable-line no-null/no-null\n            );\n        };\n        LanguageServiceShimObject.prototype.cleanupSemanticCache = function () {\n            var _this = this;\n            this.forwardJSONCall(\"cleanupSemanticCache()\", function () {\n                _this.languageService.cleanupSemanticCache();\n                return null; // eslint-disable-line no-null/no-null\n            });\n        };\n        LanguageServiceShimObject.prototype.realizeDiagnostics = function (diagnostics) {\n            var newLine = ts.getNewLineOrDefaultFromHost(this.host);\n            return realizeDiagnostics(diagnostics, newLine);\n        };\n        LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) {\n            var _this = this;\n            return this.forwardJSONCall(\"getSyntacticClassifications('\" + fileName + \"', \" + start + \", \" + length + \")\", function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); });\n        };\n        LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) {\n            var _this = this;\n            return this.forwardJSONCall(\"getSemanticClassifications('\" + fileName + \"', \" + start + \", \" + length + \")\", function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); });\n        };\n        LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) {\n            var _this = this;\n            return this.forwardJSONCall(\"getEncodedSyntacticClassifications('\" + fileName + \"', \" + start + \", \" + length + \")\", \n            // directly serialize the spans out to a string.  This is much faster to decode\n            // on the managed side versus a full JSON array.\n            function () { return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); });\n        };\n        LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) {\n            var _this = this;\n            return this.forwardJSONCall(\"getEncodedSemanticClassifications('\" + fileName + \"', \" + start + \", \" + length + \")\", \n            // directly serialize the spans out to a string.  This is much faster to decode\n            // on the managed side versus a full JSON array.\n            function () { return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); });\n        };\n        LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) {\n            var _this = this;\n            return this.forwardJSONCall(\"getSyntacticDiagnostics('\" + fileName + \"')\", function () {\n                var diagnostics = _this.languageService.getSyntacticDiagnostics(fileName);\n                return _this.realizeDiagnostics(diagnostics);\n            });\n        };\n        LanguageServiceShimObject.prototype.getSemanticDiagnostics = function (fileName) {\n            var _this = this;\n            return this.forwardJSONCall(\"getSemanticDiagnostics('\" + fileName + \"')\", function () {\n                var diagnostics = _this.languageService.getSemanticDiagnostics(fileName);\n                return _this.realizeDiagnostics(diagnostics);\n            });\n        };\n        LanguageServiceShimObject.prototype.getSuggestionDiagnostics = function (fileName) {\n            var _this = this;\n            return this.forwardJSONCall(\"getSuggestionDiagnostics('\" + fileName + \"')\", function () { return _this.realizeDiagnostics(_this.languageService.getSuggestionDiagnostics(fileName)); });\n        };\n        LanguageServiceShimObject.prototype.getCompilerOptionsDiagnostics = function () {\n            var _this = this;\n            return this.forwardJSONCall(\"getCompilerOptionsDiagnostics()\", function () {\n                var diagnostics = _this.languageService.getCompilerOptionsDiagnostics();\n                return _this.realizeDiagnostics(diagnostics);\n            });\n        };\n        /// QUICKINFO\n        /**\n         * Computes a string representation of the type at the requested position\n         * in the active file.\n         */\n        LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) {\n            var _this = this;\n            return this.forwardJSONCall(\"getQuickInfoAtPosition('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); });\n        };\n        /// NAMEORDOTTEDNAMESPAN\n        /**\n         * Computes span information of the name or dotted name at the requested position\n         * in the active file.\n         */\n        LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) {\n            var _this = this;\n            return this.forwardJSONCall(\"getNameOrDottedNameSpan('\" + fileName + \"', \" + startPos + \", \" + endPos + \")\", function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); });\n        };\n        /**\n         * STATEMENTSPAN\n         * Computes span information of statement at the requested position in the active file.\n         */\n        LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) {\n            var _this = this;\n            return this.forwardJSONCall(\"getBreakpointStatementAtPosition('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); });\n        };\n        /// SIGNATUREHELP\n        LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position, options) {\n            var _this = this;\n            return this.forwardJSONCall(\"getSignatureHelpItems('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.getSignatureHelpItems(fileName, position, options); });\n        };\n        /// GOTO DEFINITION\n        /**\n         * Computes the definition location and file for the symbol\n         * at the requested position.\n         */\n        LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) {\n            var _this = this;\n            return this.forwardJSONCall(\"getDefinitionAtPosition('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.getDefinitionAtPosition(fileName, position); });\n        };\n        /**\n         * Computes the definition location and file for the symbol\n         * at the requested position.\n         */\n        LanguageServiceShimObject.prototype.getDefinitionAndBoundSpan = function (fileName, position) {\n            var _this = this;\n            return this.forwardJSONCall(\"getDefinitionAndBoundSpan('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.getDefinitionAndBoundSpan(fileName, position); });\n        };\n        /// GOTO Type\n        /**\n         * Computes the definition location of the type of the symbol\n         * at the requested position.\n         */\n        LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) {\n            var _this = this;\n            return this.forwardJSONCall(\"getTypeDefinitionAtPosition('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); });\n        };\n        /// GOTO Implementation\n        /**\n         * Computes the implementation location of the symbol\n         * at the requested position.\n         */\n        LanguageServiceShimObject.prototype.getImplementationAtPosition = function (fileName, position) {\n            var _this = this;\n            return this.forwardJSONCall(\"getImplementationAtPosition('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.getImplementationAtPosition(fileName, position); });\n        };\n        LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position, options) {\n            var _this = this;\n            return this.forwardJSONCall(\"getRenameInfo('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.getRenameInfo(fileName, position, options); });\n        };\n        LanguageServiceShimObject.prototype.getSmartSelectionRange = function (fileName, position) {\n            var _this = this;\n            return this.forwardJSONCall(\"getSmartSelectionRange('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.getSmartSelectionRange(fileName, position); });\n        };\n        LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename) {\n            var _this = this;\n            return this.forwardJSONCall(\"findRenameLocations('\" + fileName + \"', \" + position + \", \" + findInStrings + \", \" + findInComments + \", \" + providePrefixAndSuffixTextForRename + \")\", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename); });\n        };\n        /// GET BRACE MATCHING\n        LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) {\n            var _this = this;\n            return this.forwardJSONCall(\"getBraceMatchingAtPosition('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); });\n        };\n        LanguageServiceShimObject.prototype.isValidBraceCompletionAtPosition = function (fileName, position, openingBrace) {\n            var _this = this;\n            return this.forwardJSONCall(\"isValidBraceCompletionAtPosition('\" + fileName + \"', \" + position + \", \" + openingBrace + \")\", function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); });\n        };\n        LanguageServiceShimObject.prototype.getSpanOfEnclosingComment = function (fileName, position, onlyMultiLine) {\n            var _this = this;\n            return this.forwardJSONCall(\"getSpanOfEnclosingComment('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine); });\n        };\n        /// GET SMART INDENT\n        LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options /*Services.EditorOptions*/) {\n            var _this = this;\n            return this.forwardJSONCall(\"getIndentationAtPosition('\" + fileName + \"', \" + position + \")\", function () {\n                var localOptions = JSON.parse(options);\n                return _this.languageService.getIndentationAtPosition(fileName, position, localOptions);\n            });\n        };\n        /// GET REFERENCES\n        LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) {\n            var _this = this;\n            return this.forwardJSONCall(\"getReferencesAtPosition('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.getReferencesAtPosition(fileName, position); });\n        };\n        LanguageServiceShimObject.prototype.findReferences = function (fileName, position) {\n            var _this = this;\n            return this.forwardJSONCall(\"findReferences('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.findReferences(fileName, position); });\n        };\n        LanguageServiceShimObject.prototype.getFileReferences = function (fileName) {\n            var _this = this;\n            return this.forwardJSONCall(\"getFileReferences('\" + fileName + \")\", function () { return _this.languageService.getFileReferences(fileName); });\n        };\n        LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) {\n            var _this = this;\n            return this.forwardJSONCall(\"getOccurrencesAtPosition('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); });\n        };\n        LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) {\n            var _this = this;\n            return this.forwardJSONCall(\"getDocumentHighlights('\" + fileName + \"', \" + position + \")\", function () {\n                var results = _this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));\n                // workaround for VS document highlighting issue - keep only items from the initial file\n                var normalizedName = ts.toFileNameLowerCase(ts.normalizeSlashes(fileName));\n                return ts.filter(results, function (r) { return ts.toFileNameLowerCase(ts.normalizeSlashes(r.fileName)) === normalizedName; });\n            });\n        };\n        /// COMPLETION LISTS\n        /**\n         * Get a string based representation of the completions\n         * to provide at the given source position and providing a member completion\n         * list if requested.\n         */\n        LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, preferences) {\n            var _this = this;\n            return this.forwardJSONCall(\"getCompletionsAtPosition('\" + fileName + \"', \" + position + \", \" + preferences + \")\", function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences); });\n        };\n        /** Get a string based representation of a completion list entry details */\n        LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName, formatOptions, source, preferences) {\n            var _this = this;\n            return this.forwardJSONCall(\"getCompletionEntryDetails('\" + fileName + \"', \" + position + \", '\" + entryName + \"')\", function () {\n                var localOptions = formatOptions === undefined ? undefined : JSON.parse(formatOptions);\n                return _this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source, preferences);\n            });\n        };\n        LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options /*Services.FormatCodeOptions*/) {\n            var _this = this;\n            return this.forwardJSONCall(\"getFormattingEditsForRange('\" + fileName + \"', \" + start + \", \" + end + \")\", function () {\n                var localOptions = JSON.parse(options);\n                return _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions);\n            });\n        };\n        LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options /*Services.FormatCodeOptions*/) {\n            var _this = this;\n            return this.forwardJSONCall(\"getFormattingEditsForDocument('\" + fileName + \"')\", function () {\n                var localOptions = JSON.parse(options);\n                return _this.languageService.getFormattingEditsForDocument(fileName, localOptions);\n            });\n        };\n        LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options /*Services.FormatCodeOptions*/) {\n            var _this = this;\n            return this.forwardJSONCall(\"getFormattingEditsAfterKeystroke('\" + fileName + \"', \" + position + \", '\" + key + \"')\", function () {\n                var localOptions = JSON.parse(options);\n                return _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions);\n            });\n        };\n        LanguageServiceShimObject.prototype.getDocCommentTemplateAtPosition = function (fileName, position, options) {\n            var _this = this;\n            return this.forwardJSONCall(\"getDocCommentTemplateAtPosition('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.getDocCommentTemplateAtPosition(fileName, position, options); });\n        };\n        /// NAVIGATE TO\n        /** Return a list of symbols that are interesting to navigate to */\n        LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount, fileName) {\n            var _this = this;\n            return this.forwardJSONCall(\"getNavigateToItems('\" + searchValue + \"', \" + maxResultCount + \", \" + fileName + \")\", function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName); });\n        };\n        LanguageServiceShimObject.prototype.getNavigationBarItems = function (fileName) {\n            var _this = this;\n            return this.forwardJSONCall(\"getNavigationBarItems('\" + fileName + \"')\", function () { return _this.languageService.getNavigationBarItems(fileName); });\n        };\n        LanguageServiceShimObject.prototype.getNavigationTree = function (fileName) {\n            var _this = this;\n            return this.forwardJSONCall(\"getNavigationTree('\" + fileName + \"')\", function () { return _this.languageService.getNavigationTree(fileName); });\n        };\n        LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName) {\n            var _this = this;\n            return this.forwardJSONCall(\"getOutliningSpans('\" + fileName + \"')\", function () { return _this.languageService.getOutliningSpans(fileName); });\n        };\n        LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) {\n            var _this = this;\n            return this.forwardJSONCall(\"getTodoComments('\" + fileName + \"')\", function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); });\n        };\n        /// CALL HIERARCHY\n        LanguageServiceShimObject.prototype.prepareCallHierarchy = function (fileName, position) {\n            var _this = this;\n            return this.forwardJSONCall(\"prepareCallHierarchy('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.prepareCallHierarchy(fileName, position); });\n        };\n        LanguageServiceShimObject.prototype.provideCallHierarchyIncomingCalls = function (fileName, position) {\n            var _this = this;\n            return this.forwardJSONCall(\"provideCallHierarchyIncomingCalls('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.provideCallHierarchyIncomingCalls(fileName, position); });\n        };\n        LanguageServiceShimObject.prototype.provideCallHierarchyOutgoingCalls = function (fileName, position) {\n            var _this = this;\n            return this.forwardJSONCall(\"provideCallHierarchyOutgoingCalls('\" + fileName + \"', \" + position + \")\", function () { return _this.languageService.provideCallHierarchyOutgoingCalls(fileName, position); });\n        };\n        /// Emit\n        LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) {\n            var _this = this;\n            return this.forwardJSONCall(\"getEmitOutput('\" + fileName + \"')\", function () {\n                var _a = _this.languageService.getEmitOutput(fileName), diagnostics = _a.diagnostics, rest = __rest(_a, [\"diagnostics\"]);\n                return __assign(__assign({}, rest), { diagnostics: _this.realizeDiagnostics(diagnostics) });\n            });\n        };\n        LanguageServiceShimObject.prototype.getEmitOutputObject = function (fileName) {\n            var _this = this;\n            return forwardCall(this.logger, \"getEmitOutput('\" + fileName + \"')\", \n            /*returnJson*/ false, function () { return _this.languageService.getEmitOutput(fileName); }, this.logPerformance);\n        };\n        LanguageServiceShimObject.prototype.toggleLineComment = function (fileName, textRange) {\n            var _this = this;\n            return this.forwardJSONCall(\"toggleLineComment('\" + fileName + \"', '\" + JSON.stringify(textRange) + \"')\", function () { return _this.languageService.toggleLineComment(fileName, textRange); });\n        };\n        LanguageServiceShimObject.prototype.toggleMultilineComment = function (fileName, textRange) {\n            var _this = this;\n            return this.forwardJSONCall(\"toggleMultilineComment('\" + fileName + \"', '\" + JSON.stringify(textRange) + \"')\", function () { return _this.languageService.toggleMultilineComment(fileName, textRange); });\n        };\n        LanguageServiceShimObject.prototype.commentSelection = function (fileName, textRange) {\n            var _this = this;\n            return this.forwardJSONCall(\"commentSelection('\" + fileName + \"', '\" + JSON.stringify(textRange) + \"')\", function () { return _this.languageService.commentSelection(fileName, textRange); });\n        };\n        LanguageServiceShimObject.prototype.uncommentSelection = function (fileName, textRange) {\n            var _this = this;\n            return this.forwardJSONCall(\"uncommentSelection('\" + fileName + \"', '\" + JSON.stringify(textRange) + \"')\", function () { return _this.languageService.uncommentSelection(fileName, textRange); });\n        };\n        return LanguageServiceShimObject;\n    }(ShimBase));\n    function convertClassifications(classifications) {\n        return { spans: classifications.spans.join(\",\"), endOfLineState: classifications.endOfLineState };\n    }\n    var ClassifierShimObject = /** @class */ (function (_super) {\n        __extends(ClassifierShimObject, _super);\n        function ClassifierShimObject(factory, logger) {\n            var _this = _super.call(this, factory) || this;\n            _this.logger = logger;\n            _this.logPerformance = false;\n            _this.classifier = ts.createClassifier();\n            return _this;\n        }\n        ClassifierShimObject.prototype.getEncodedLexicalClassifications = function (text, lexState, syntacticClassifierAbsent) {\n            var _this = this;\n            if (syntacticClassifierAbsent === void 0) { syntacticClassifierAbsent = false; }\n            return forwardJSONCall(this.logger, \"getEncodedLexicalClassifications\", function () { return convertClassifications(_this.classifier.getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent)); }, this.logPerformance);\n        };\n        /// COLORIZATION\n        ClassifierShimObject.prototype.getClassificationsForLine = function (text, lexState, classifyKeywordsInGenerics) {\n            if (classifyKeywordsInGenerics === void 0) { classifyKeywordsInGenerics = false; }\n            var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics);\n            var result = \"\";\n            for (var _i = 0, _a = classification.entries; _i < _a.length; _i++) {\n                var item = _a[_i];\n                result += item.length + \"\\n\";\n                result += item.classification + \"\\n\";\n            }\n            result += classification.finalLexState;\n            return result;\n        };\n        return ClassifierShimObject;\n    }(ShimBase));\n    var CoreServicesShimObject = /** @class */ (function (_super) {\n        __extends(CoreServicesShimObject, _super);\n        function CoreServicesShimObject(factory, logger, host) {\n            var _this = _super.call(this, factory) || this;\n            _this.logger = logger;\n            _this.host = host;\n            _this.logPerformance = false;\n            return _this;\n        }\n        CoreServicesShimObject.prototype.forwardJSONCall = function (actionDescription, action) {\n            return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance);\n        };\n        CoreServicesShimObject.prototype.resolveModuleName = function (fileName, moduleName, compilerOptionsJson) {\n            var _this = this;\n            return this.forwardJSONCall(\"resolveModuleName('\" + fileName + \"')\", function () {\n                var compilerOptions = JSON.parse(compilerOptionsJson);\n                var result = ts.resolveModuleName(moduleName, ts.normalizeSlashes(fileName), compilerOptions, _this.host);\n                var resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined;\n                if (result.resolvedModule && result.resolvedModule.extension !== \".ts\" /* Ts */ && result.resolvedModule.extension !== \".tsx\" /* Tsx */ && result.resolvedModule.extension !== \".d.ts\" /* Dts */) {\n                    resolvedFileName = undefined;\n                }\n                return {\n                    resolvedFileName: resolvedFileName,\n                    failedLookupLocations: result.failedLookupLocations\n                };\n            });\n        };\n        CoreServicesShimObject.prototype.resolveTypeReferenceDirective = function (fileName, typeReferenceDirective, compilerOptionsJson) {\n            var _this = this;\n            return this.forwardJSONCall(\"resolveTypeReferenceDirective(\" + fileName + \")\", function () {\n                var compilerOptions = JSON.parse(compilerOptionsJson);\n                var result = ts.resolveTypeReferenceDirective(typeReferenceDirective, ts.normalizeSlashes(fileName), compilerOptions, _this.host);\n                return {\n                    resolvedFileName: result.resolvedTypeReferenceDirective ? result.resolvedTypeReferenceDirective.resolvedFileName : undefined,\n                    primary: result.resolvedTypeReferenceDirective ? result.resolvedTypeReferenceDirective.primary : true,\n                    failedLookupLocations: result.failedLookupLocations\n                };\n            });\n        };\n        CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) {\n            var _this = this;\n            return this.forwardJSONCall(\"getPreProcessedFileInfo('\" + fileName + \"')\", function () {\n                // for now treat files as JavaScript\n                var result = ts.preProcessFile(ts.getSnapshotText(sourceTextSnapshot), /* readImportFiles */ true, /* detectJavaScriptImports */ true);\n                return {\n                    referencedFiles: _this.convertFileReferences(result.referencedFiles),\n                    importedFiles: _this.convertFileReferences(result.importedFiles),\n                    ambientExternalModules: result.ambientExternalModules,\n                    isLibFile: result.isLibFile,\n                    typeReferenceDirectives: _this.convertFileReferences(result.typeReferenceDirectives),\n                    libReferenceDirectives: _this.convertFileReferences(result.libReferenceDirectives)\n                };\n            });\n        };\n        CoreServicesShimObject.prototype.getAutomaticTypeDirectiveNames = function (compilerOptionsJson) {\n            var _this = this;\n            return this.forwardJSONCall(\"getAutomaticTypeDirectiveNames('\" + compilerOptionsJson + \"')\", function () {\n                var compilerOptions = JSON.parse(compilerOptionsJson);\n                return ts.getAutomaticTypeDirectiveNames(compilerOptions, _this.host);\n            });\n        };\n        CoreServicesShimObject.prototype.convertFileReferences = function (refs) {\n            if (!refs) {\n                return undefined;\n            }\n            var result = [];\n            for (var _i = 0, refs_1 = refs; _i < refs_1.length; _i++) {\n                var ref = refs_1[_i];\n                result.push({\n                    path: ts.normalizeSlashes(ref.fileName),\n                    position: ref.pos,\n                    length: ref.end - ref.pos\n                });\n            }\n            return result;\n        };\n        CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) {\n            var _this = this;\n            return this.forwardJSONCall(\"getTSConfigFileInfo('\" + fileName + \"')\", function () {\n                var result = ts.parseJsonText(fileName, ts.getSnapshotText(sourceTextSnapshot));\n                var normalizedFileName = ts.normalizeSlashes(fileName);\n                var configFile = ts.parseJsonSourceFileConfigFileContent(result, _this.host, ts.getDirectoryPath(normalizedFileName), /*existingOptions*/ {}, normalizedFileName);\n                return {\n                    options: configFile.options,\n                    typeAcquisition: configFile.typeAcquisition,\n                    files: configFile.fileNames,\n                    raw: configFile.raw,\n                    errors: realizeDiagnostics(__spreadArray(__spreadArray([], result.parseDiagnostics), configFile.errors), \"\\r\\n\")\n                };\n            });\n        };\n        CoreServicesShimObject.prototype.getDefaultCompilationSettings = function () {\n            return this.forwardJSONCall(\"getDefaultCompilationSettings()\", function () { return ts.getDefaultCompilerOptions(); });\n        };\n        CoreServicesShimObject.prototype.discoverTypings = function (discoverTypingsJson) {\n            var _this = this;\n            var getCanonicalFileName = ts.createGetCanonicalFileName(/*useCaseSensitivefileNames:*/ false);\n            return this.forwardJSONCall(\"discoverTypings()\", function () {\n                var info = JSON.parse(discoverTypingsJson);\n                if (_this.safeList === undefined) {\n                    _this.safeList = ts.JsTyping.loadSafeList(_this.host, ts.toPath(info.safeListPath, info.safeListPath, getCanonicalFileName));\n                }\n                return ts.JsTyping.discoverTypings(_this.host, function (msg) { return _this.logger.log(msg); }, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), _this.safeList, info.packageNameToTypingLocation, info.typeAcquisition, info.unresolvedImports, info.typesRegistry);\n            });\n        };\n        return CoreServicesShimObject;\n    }(ShimBase));\n    var TypeScriptServicesFactory = /** @class */ (function () {\n        function TypeScriptServicesFactory() {\n            this._shims = [];\n        }\n        /*\n         * Returns script API version.\n         */\n        TypeScriptServicesFactory.prototype.getServicesVersion = function () {\n            return ts.servicesVersion;\n        };\n        TypeScriptServicesFactory.prototype.createLanguageServiceShim = function (host) {\n            try {\n                if (this.documentRegistry === undefined) {\n                    this.documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory());\n                }\n                var hostAdapter = new LanguageServiceShimHostAdapter(host);\n                var languageService = ts.createLanguageService(hostAdapter, this.documentRegistry, /*syntaxOnly*/ false);\n                return new LanguageServiceShimObject(this, host, languageService);\n            }\n            catch (err) {\n                logInternalError(host, err);\n                throw err;\n            }\n        };\n        TypeScriptServicesFactory.prototype.createClassifierShim = function (logger) {\n            try {\n                return new ClassifierShimObject(this, logger);\n            }\n            catch (err) {\n                logInternalError(logger, err);\n                throw err;\n            }\n        };\n        TypeScriptServicesFactory.prototype.createCoreServicesShim = function (host) {\n            try {\n                var adapter = new CoreServicesShimHostAdapter(host);\n                return new CoreServicesShimObject(this, host, adapter);\n            }\n            catch (err) {\n                logInternalError(host, err);\n                throw err;\n            }\n        };\n        TypeScriptServicesFactory.prototype.close = function () {\n            // Forget all the registered shims\n            ts.clear(this._shims);\n            this.documentRegistry = undefined;\n        };\n        TypeScriptServicesFactory.prototype.registerShim = function (shim) {\n            this._shims.push(shim);\n        };\n        TypeScriptServicesFactory.prototype.unregisterShim = function (shim) {\n            for (var i = 0; i < this._shims.length; i++) {\n                if (this._shims[i] === shim) {\n                    delete this._shims[i];\n                    return;\n                }\n            }\n            throw new Error(\"Invalid operation\");\n        };\n        return TypeScriptServicesFactory;\n    }());\n    ts.TypeScriptServicesFactory = TypeScriptServicesFactory;\n})(ts || (ts = {}));\n/* eslint-enable no-in-operator */\n// We polyfill `globalThis` here so re can reliably patch the global scope\n// in the contexts we want to in the same way across script and module formats\n/* eslint-enable no-var */\n((function () {\n    if (typeof globalThis === \"object\")\n        return;\n    try {\n        Object.defineProperty(Object.prototype, \"__magic__\", {\n            get: function () {\n                return this;\n            },\n            configurable: true\n        });\n        //@ts-ignore\n        __magic__.globalThis = __magic__;\n        // The previous line should have made `globalThis` globally\n        // available, but it fails in Internet Explorer 10 and older.\n        // Detect this failure and fall back.\n        if (typeof globalThis === \"undefined\") {\n            // Assume `window` exists.\n            //@ts-ignore\n            window.globalThis = window;\n        }\n        //@ts-ignore\n        delete Object.prototype.__magic__;\n    }\n    catch (error) {\n        // In IE8, Object.defineProperty only works on DOM objects.\n        // If we hit this code path, assume `window` exists.\n        //@ts-ignore\n        window.globalThis = window;\n    }\n})());\n// #endregion The polyfill ends here.\n// if `process` is undefined, we're probably not running in node - patch legacy members onto the global scope\n// @ts-ignore\nif (typeof process === \"undefined\" || process.browser) {\n    /// TODO: this is used by VS, clean this up on both sides of the interface\n    //@ts-ignore\n    globalThis.TypeScript = globalThis.TypeScript || {};\n    //@ts-ignore\n    globalThis.TypeScript.Services = globalThis.TypeScript.Services || {};\n    //@ts-ignore\n    globalThis.TypeScript.Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory;\n    // 'toolsVersion' gets consumed by the managed side, so it's not unused.\n    // TODO: it should be moved into a namespace though.\n    //@ts-ignore\n    globalThis.toolsVersion = ts.versionMajorMinor;\n}\nif ( true && module.exports) {\n    module.exports = ts;\n}\nvar ts;\n(function (ts) {\n    // The following are deprecations for the public API. Deprecated exports are removed from the compiler itself\n    // and compatible implementations are added here, along with an appropriate deprecation warning using\n    // the `@deprecated` JSDoc tag as well as the `Debug.deprecate` API.\n    //\n    // Deprecations fall into one of three categories:\n    //\n    //   * \"soft\" - Soft deprecations are indicated with the `@deprecated` JSDoc Tag.\n    //   * \"warn\" - Warning deprecations are indicated with the `@deprecated` JSDoc Tag and a diagnostic message (assuming a compatible host)\n    //   * \"error\" - Error deprecations are indicated with the `@deprecated` JSDoc tag and will throw a `TypeError` when invoked.\n    // DEPRECATION: Node factory top-level exports\n    // DEPRECATION PLAN:\n    //     - soft: 4.0\n    //     - warn: 4.1\n    //     - error: TBD\n    // #region Node factory top-level exports\n    // NOTE: These exports are deprecated in favor of using a `NodeFactory` instance and exist here purely for backwards compatibility reasons.\n    var factoryDeprecation = { since: \"4.0\", warnAfter: \"4.1\", message: \"Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.\" };\n    /** @deprecated Use `factory.createNodeArray` or the factory supplied by your transformation context instead. */\n    ts.createNodeArray = ts.Debug.deprecate(ts.factory.createNodeArray, factoryDeprecation);\n    /** @deprecated Use `factory.createNumericLiteral` or the factory supplied by your transformation context instead. */\n    ts.createNumericLiteral = ts.Debug.deprecate(ts.factory.createNumericLiteral, factoryDeprecation);\n    /** @deprecated Use `factory.createBigIntLiteral` or the factory supplied by your transformation context instead. */\n    ts.createBigIntLiteral = ts.Debug.deprecate(ts.factory.createBigIntLiteral, factoryDeprecation);\n    /** @deprecated Use `factory.createStringLiteral` or the factory supplied by your transformation context instead. */\n    ts.createStringLiteral = ts.Debug.deprecate(ts.factory.createStringLiteral, factoryDeprecation);\n    /** @deprecated Use `factory.createStringLiteralFromNode` or the factory supplied by your transformation context instead. */\n    ts.createStringLiteralFromNode = ts.Debug.deprecate(ts.factory.createStringLiteralFromNode, factoryDeprecation);\n    /** @deprecated Use `factory.createRegularExpressionLiteral` or the factory supplied by your transformation context instead. */\n    ts.createRegularExpressionLiteral = ts.Debug.deprecate(ts.factory.createRegularExpressionLiteral, factoryDeprecation);\n    /** @deprecated Use `factory.createLoopVariable` or the factory supplied by your transformation context instead. */\n    ts.createLoopVariable = ts.Debug.deprecate(ts.factory.createLoopVariable, factoryDeprecation);\n    /** @deprecated Use `factory.createUniqueName` or the factory supplied by your transformation context instead. */\n    ts.createUniqueName = ts.Debug.deprecate(ts.factory.createUniqueName, factoryDeprecation);\n    /** @deprecated Use `factory.createPrivateIdentifier` or the factory supplied by your transformation context instead. */\n    ts.createPrivateIdentifier = ts.Debug.deprecate(ts.factory.createPrivateIdentifier, factoryDeprecation);\n    /** @deprecated Use `factory.createSuper` or the factory supplied by your transformation context instead. */\n    ts.createSuper = ts.Debug.deprecate(ts.factory.createSuper, factoryDeprecation);\n    /** @deprecated Use `factory.createThis` or the factory supplied by your transformation context instead. */\n    ts.createThis = ts.Debug.deprecate(ts.factory.createThis, factoryDeprecation);\n    /** @deprecated Use `factory.createNull` or the factory supplied by your transformation context instead. */\n    ts.createNull = ts.Debug.deprecate(ts.factory.createNull, factoryDeprecation);\n    /** @deprecated Use `factory.createTrue` or the factory supplied by your transformation context instead. */\n    ts.createTrue = ts.Debug.deprecate(ts.factory.createTrue, factoryDeprecation);\n    /** @deprecated Use `factory.createFalse` or the factory supplied by your transformation context instead. */\n    ts.createFalse = ts.Debug.deprecate(ts.factory.createFalse, factoryDeprecation);\n    /** @deprecated Use `factory.createModifier` or the factory supplied by your transformation context instead. */\n    ts.createModifier = ts.Debug.deprecate(ts.factory.createModifier, factoryDeprecation);\n    /** @deprecated Use `factory.createModifiersFromModifierFlags` or the factory supplied by your transformation context instead. */\n    ts.createModifiersFromModifierFlags = ts.Debug.deprecate(ts.factory.createModifiersFromModifierFlags, factoryDeprecation);\n    /** @deprecated Use `factory.createQualifiedName` or the factory supplied by your transformation context instead. */\n    ts.createQualifiedName = ts.Debug.deprecate(ts.factory.createQualifiedName, factoryDeprecation);\n    /** @deprecated Use `factory.updateQualifiedName` or the factory supplied by your transformation context instead. */\n    ts.updateQualifiedName = ts.Debug.deprecate(ts.factory.updateQualifiedName, factoryDeprecation);\n    /** @deprecated Use `factory.createComputedPropertyName` or the factory supplied by your transformation context instead. */\n    ts.createComputedPropertyName = ts.Debug.deprecate(ts.factory.createComputedPropertyName, factoryDeprecation);\n    /** @deprecated Use `factory.updateComputedPropertyName` or the factory supplied by your transformation context instead. */\n    ts.updateComputedPropertyName = ts.Debug.deprecate(ts.factory.updateComputedPropertyName, factoryDeprecation);\n    /** @deprecated Use `factory.createTypeParameterDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createTypeParameterDeclaration = ts.Debug.deprecate(ts.factory.createTypeParameterDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.updateTypeParameterDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateTypeParameterDeclaration = ts.Debug.deprecate(ts.factory.updateTypeParameterDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.createParameterDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createParameter = ts.Debug.deprecate(ts.factory.createParameterDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.updateParameterDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateParameter = ts.Debug.deprecate(ts.factory.updateParameterDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.createDecorator` or the factory supplied by your transformation context instead. */\n    ts.createDecorator = ts.Debug.deprecate(ts.factory.createDecorator, factoryDeprecation);\n    /** @deprecated Use `factory.updateDecorator` or the factory supplied by your transformation context instead. */\n    ts.updateDecorator = ts.Debug.deprecate(ts.factory.updateDecorator, factoryDeprecation);\n    /** @deprecated Use `factory.createPropertyDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createProperty = ts.Debug.deprecate(ts.factory.createPropertyDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.updatePropertyDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateProperty = ts.Debug.deprecate(ts.factory.updatePropertyDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.createMethodDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createMethod = ts.Debug.deprecate(ts.factory.createMethodDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.updateMethodDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateMethod = ts.Debug.deprecate(ts.factory.updateMethodDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.createConstructorDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createConstructor = ts.Debug.deprecate(ts.factory.createConstructorDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.updateConstructorDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateConstructor = ts.Debug.deprecate(ts.factory.updateConstructorDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.createGetAccessorDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createGetAccessor = ts.Debug.deprecate(ts.factory.createGetAccessorDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.updateGetAccessorDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateGetAccessor = ts.Debug.deprecate(ts.factory.updateGetAccessorDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.createSetAccessorDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createSetAccessor = ts.Debug.deprecate(ts.factory.createSetAccessorDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.updateSetAccessorDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateSetAccessor = ts.Debug.deprecate(ts.factory.updateSetAccessorDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.createCallSignature` or the factory supplied by your transformation context instead. */\n    ts.createCallSignature = ts.Debug.deprecate(ts.factory.createCallSignature, factoryDeprecation);\n    /** @deprecated Use `factory.updateCallSignature` or the factory supplied by your transformation context instead. */\n    ts.updateCallSignature = ts.Debug.deprecate(ts.factory.updateCallSignature, factoryDeprecation);\n    /** @deprecated Use `factory.createConstructSignature` or the factory supplied by your transformation context instead. */\n    ts.createConstructSignature = ts.Debug.deprecate(ts.factory.createConstructSignature, factoryDeprecation);\n    /** @deprecated Use `factory.updateConstructSignature` or the factory supplied by your transformation context instead. */\n    ts.updateConstructSignature = ts.Debug.deprecate(ts.factory.updateConstructSignature, factoryDeprecation);\n    /** @deprecated Use `factory.updateIndexSignature` or the factory supplied by your transformation context instead. */\n    ts.updateIndexSignature = ts.Debug.deprecate(ts.factory.updateIndexSignature, factoryDeprecation);\n    /** @deprecated Use `factory.createKeywordTypeNode` or the factory supplied by your transformation context instead. */\n    ts.createKeywordTypeNode = ts.Debug.deprecate(ts.factory.createKeywordTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */\n    ts.createTypePredicateNodeWithModifier = ts.Debug.deprecate(ts.factory.createTypePredicateNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */\n    ts.updateTypePredicateNodeWithModifier = ts.Debug.deprecate(ts.factory.updateTypePredicateNode, factoryDeprecation);\n    /** @deprecated Use `factory.createTypeReferenceNode` or the factory supplied by your transformation context instead. */\n    ts.createTypeReferenceNode = ts.Debug.deprecate(ts.factory.createTypeReferenceNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateTypeReferenceNode` or the factory supplied by your transformation context instead. */\n    ts.updateTypeReferenceNode = ts.Debug.deprecate(ts.factory.updateTypeReferenceNode, factoryDeprecation);\n    /** @deprecated Use `factory.createFunctionTypeNode` or the factory supplied by your transformation context instead. */\n    ts.createFunctionTypeNode = ts.Debug.deprecate(ts.factory.createFunctionTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateFunctionTypeNode` or the factory supplied by your transformation context instead. */\n    ts.updateFunctionTypeNode = ts.Debug.deprecate(ts.factory.updateFunctionTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.createConstructorTypeNode` or the factory supplied by your transformation context instead. */\n    ts.createConstructorTypeNode = ts.Debug.deprecate(function (typeParameters, parameters, type) {\n        return ts.factory.createConstructorTypeNode(/*modifiers*/ undefined, typeParameters, parameters, type);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.updateConstructorTypeNode` or the factory supplied by your transformation context instead. */\n    ts.updateConstructorTypeNode = ts.Debug.deprecate(function (node, typeParameters, parameters, type) {\n        return ts.factory.updateConstructorTypeNode(node, node.modifiers, typeParameters, parameters, type);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createTypeQueryNode` or the factory supplied by your transformation context instead. */\n    ts.createTypeQueryNode = ts.Debug.deprecate(ts.factory.createTypeQueryNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateTypeQueryNode` or the factory supplied by your transformation context instead. */\n    ts.updateTypeQueryNode = ts.Debug.deprecate(ts.factory.updateTypeQueryNode, factoryDeprecation);\n    /** @deprecated Use `factory.createTypeLiteralNode` or the factory supplied by your transformation context instead. */\n    ts.createTypeLiteralNode = ts.Debug.deprecate(ts.factory.createTypeLiteralNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateTypeLiteralNode` or the factory supplied by your transformation context instead. */\n    ts.updateTypeLiteralNode = ts.Debug.deprecate(ts.factory.updateTypeLiteralNode, factoryDeprecation);\n    /** @deprecated Use `factory.createArrayTypeNode` or the factory supplied by your transformation context instead. */\n    ts.createArrayTypeNode = ts.Debug.deprecate(ts.factory.createArrayTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateArrayTypeNode` or the factory supplied by your transformation context instead. */\n    ts.updateArrayTypeNode = ts.Debug.deprecate(ts.factory.updateArrayTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.createTupleTypeNode` or the factory supplied by your transformation context instead. */\n    ts.createTupleTypeNode = ts.Debug.deprecate(ts.factory.createTupleTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateTupleTypeNode` or the factory supplied by your transformation context instead. */\n    ts.updateTupleTypeNode = ts.Debug.deprecate(ts.factory.updateTupleTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.createOptionalTypeNode` or the factory supplied by your transformation context instead. */\n    ts.createOptionalTypeNode = ts.Debug.deprecate(ts.factory.createOptionalTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateOptionalTypeNode` or the factory supplied by your transformation context instead. */\n    ts.updateOptionalTypeNode = ts.Debug.deprecate(ts.factory.updateOptionalTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.createRestTypeNode` or the factory supplied by your transformation context instead. */\n    ts.createRestTypeNode = ts.Debug.deprecate(ts.factory.createRestTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateRestTypeNode` or the factory supplied by your transformation context instead. */\n    ts.updateRestTypeNode = ts.Debug.deprecate(ts.factory.updateRestTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.createUnionTypeNode` or the factory supplied by your transformation context instead. */\n    ts.createUnionTypeNode = ts.Debug.deprecate(ts.factory.createUnionTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateUnionTypeNode` or the factory supplied by your transformation context instead. */\n    ts.updateUnionTypeNode = ts.Debug.deprecate(ts.factory.updateUnionTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.createIntersectionTypeNode` or the factory supplied by your transformation context instead. */\n    ts.createIntersectionTypeNode = ts.Debug.deprecate(ts.factory.createIntersectionTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateIntersectionTypeNode` or the factory supplied by your transformation context instead. */\n    ts.updateIntersectionTypeNode = ts.Debug.deprecate(ts.factory.updateIntersectionTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.createConditionalTypeNode` or the factory supplied by your transformation context instead. */\n    ts.createConditionalTypeNode = ts.Debug.deprecate(ts.factory.createConditionalTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateConditionalTypeNode` or the factory supplied by your transformation context instead. */\n    ts.updateConditionalTypeNode = ts.Debug.deprecate(ts.factory.updateConditionalTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.createInferTypeNode` or the factory supplied by your transformation context instead. */\n    ts.createInferTypeNode = ts.Debug.deprecate(ts.factory.createInferTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateInferTypeNode` or the factory supplied by your transformation context instead. */\n    ts.updateInferTypeNode = ts.Debug.deprecate(ts.factory.updateInferTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.createImportTypeNode` or the factory supplied by your transformation context instead. */\n    ts.createImportTypeNode = ts.Debug.deprecate(ts.factory.createImportTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateImportTypeNode` or the factory supplied by your transformation context instead. */\n    ts.updateImportTypeNode = ts.Debug.deprecate(ts.factory.updateImportTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.createParenthesizedType` or the factory supplied by your transformation context instead. */\n    ts.createParenthesizedType = ts.Debug.deprecate(ts.factory.createParenthesizedType, factoryDeprecation);\n    /** @deprecated Use `factory.updateParenthesizedType` or the factory supplied by your transformation context instead. */\n    ts.updateParenthesizedType = ts.Debug.deprecate(ts.factory.updateParenthesizedType, factoryDeprecation);\n    /** @deprecated Use `factory.createThisTypeNode` or the factory supplied by your transformation context instead. */\n    ts.createThisTypeNode = ts.Debug.deprecate(ts.factory.createThisTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateTypeOperatorNode` or the factory supplied by your transformation context instead. */\n    ts.updateTypeOperatorNode = ts.Debug.deprecate(ts.factory.updateTypeOperatorNode, factoryDeprecation);\n    /** @deprecated Use `factory.createIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */\n    ts.createIndexedAccessTypeNode = ts.Debug.deprecate(ts.factory.createIndexedAccessTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */\n    ts.updateIndexedAccessTypeNode = ts.Debug.deprecate(ts.factory.updateIndexedAccessTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.createMappedTypeNode` or the factory supplied by your transformation context instead. */\n    ts.createMappedTypeNode = ts.Debug.deprecate(ts.factory.createMappedTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateMappedTypeNode` or the factory supplied by your transformation context instead. */\n    ts.updateMappedTypeNode = ts.Debug.deprecate(ts.factory.updateMappedTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.createLiteralTypeNode` or the factory supplied by your transformation context instead. */\n    ts.createLiteralTypeNode = ts.Debug.deprecate(ts.factory.createLiteralTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.updateLiteralTypeNode` or the factory supplied by your transformation context instead. */\n    ts.updateLiteralTypeNode = ts.Debug.deprecate(ts.factory.updateLiteralTypeNode, factoryDeprecation);\n    /** @deprecated Use `factory.createObjectBindingPattern` or the factory supplied by your transformation context instead. */\n    ts.createObjectBindingPattern = ts.Debug.deprecate(ts.factory.createObjectBindingPattern, factoryDeprecation);\n    /** @deprecated Use `factory.updateObjectBindingPattern` or the factory supplied by your transformation context instead. */\n    ts.updateObjectBindingPattern = ts.Debug.deprecate(ts.factory.updateObjectBindingPattern, factoryDeprecation);\n    /** @deprecated Use `factory.createArrayBindingPattern` or the factory supplied by your transformation context instead. */\n    ts.createArrayBindingPattern = ts.Debug.deprecate(ts.factory.createArrayBindingPattern, factoryDeprecation);\n    /** @deprecated Use `factory.updateArrayBindingPattern` or the factory supplied by your transformation context instead. */\n    ts.updateArrayBindingPattern = ts.Debug.deprecate(ts.factory.updateArrayBindingPattern, factoryDeprecation);\n    /** @deprecated Use `factory.createBindingElement` or the factory supplied by your transformation context instead. */\n    ts.createBindingElement = ts.Debug.deprecate(ts.factory.createBindingElement, factoryDeprecation);\n    /** @deprecated Use `factory.updateBindingElement` or the factory supplied by your transformation context instead. */\n    ts.updateBindingElement = ts.Debug.deprecate(ts.factory.updateBindingElement, factoryDeprecation);\n    /** @deprecated Use `factory.createArrayLiteralExpression` or the factory supplied by your transformation context instead. */\n    ts.createArrayLiteral = ts.Debug.deprecate(ts.factory.createArrayLiteralExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateArrayLiteralExpression` or the factory supplied by your transformation context instead. */\n    ts.updateArrayLiteral = ts.Debug.deprecate(ts.factory.updateArrayLiteralExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createObjectLiteralExpression` or the factory supplied by your transformation context instead. */\n    ts.createObjectLiteral = ts.Debug.deprecate(ts.factory.createObjectLiteralExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateObjectLiteralExpression` or the factory supplied by your transformation context instead. */\n    ts.updateObjectLiteral = ts.Debug.deprecate(ts.factory.updateObjectLiteralExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createPropertyAccessExpression` or the factory supplied by your transformation context instead. */\n    ts.createPropertyAccess = ts.Debug.deprecate(ts.factory.createPropertyAccessExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updatePropertyAccessExpression` or the factory supplied by your transformation context instead. */\n    ts.updatePropertyAccess = ts.Debug.deprecate(ts.factory.updatePropertyAccessExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createPropertyAccessChain` or the factory supplied by your transformation context instead. */\n    ts.createPropertyAccessChain = ts.Debug.deprecate(ts.factory.createPropertyAccessChain, factoryDeprecation);\n    /** @deprecated Use `factory.updatePropertyAccessChain` or the factory supplied by your transformation context instead. */\n    ts.updatePropertyAccessChain = ts.Debug.deprecate(ts.factory.updatePropertyAccessChain, factoryDeprecation);\n    /** @deprecated Use `factory.createElementAccessExpression` or the factory supplied by your transformation context instead. */\n    ts.createElementAccess = ts.Debug.deprecate(ts.factory.createElementAccessExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateElementAccessExpression` or the factory supplied by your transformation context instead. */\n    ts.updateElementAccess = ts.Debug.deprecate(ts.factory.updateElementAccessExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createElementAccessChain` or the factory supplied by your transformation context instead. */\n    ts.createElementAccessChain = ts.Debug.deprecate(ts.factory.createElementAccessChain, factoryDeprecation);\n    /** @deprecated Use `factory.updateElementAccessChain` or the factory supplied by your transformation context instead. */\n    ts.updateElementAccessChain = ts.Debug.deprecate(ts.factory.updateElementAccessChain, factoryDeprecation);\n    /** @deprecated Use `factory.createCallExpression` or the factory supplied by your transformation context instead. */\n    ts.createCall = ts.Debug.deprecate(ts.factory.createCallExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateCallExpression` or the factory supplied by your transformation context instead. */\n    ts.updateCall = ts.Debug.deprecate(ts.factory.updateCallExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createCallChain` or the factory supplied by your transformation context instead. */\n    ts.createCallChain = ts.Debug.deprecate(ts.factory.createCallChain, factoryDeprecation);\n    /** @deprecated Use `factory.updateCallChain` or the factory supplied by your transformation context instead. */\n    ts.updateCallChain = ts.Debug.deprecate(ts.factory.updateCallChain, factoryDeprecation);\n    /** @deprecated Use `factory.createNewExpression` or the factory supplied by your transformation context instead. */\n    ts.createNew = ts.Debug.deprecate(ts.factory.createNewExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateNewExpression` or the factory supplied by your transformation context instead. */\n    ts.updateNew = ts.Debug.deprecate(ts.factory.updateNewExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createTypeAssertion` or the factory supplied by your transformation context instead. */\n    ts.createTypeAssertion = ts.Debug.deprecate(ts.factory.createTypeAssertion, factoryDeprecation);\n    /** @deprecated Use `factory.updateTypeAssertion` or the factory supplied by your transformation context instead. */\n    ts.updateTypeAssertion = ts.Debug.deprecate(ts.factory.updateTypeAssertion, factoryDeprecation);\n    /** @deprecated Use `factory.createParenthesizedExpression` or the factory supplied by your transformation context instead. */\n    ts.createParen = ts.Debug.deprecate(ts.factory.createParenthesizedExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateParenthesizedExpression` or the factory supplied by your transformation context instead. */\n    ts.updateParen = ts.Debug.deprecate(ts.factory.updateParenthesizedExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createFunctionExpression` or the factory supplied by your transformation context instead. */\n    ts.createFunctionExpression = ts.Debug.deprecate(ts.factory.createFunctionExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateFunctionExpression` or the factory supplied by your transformation context instead. */\n    ts.updateFunctionExpression = ts.Debug.deprecate(ts.factory.updateFunctionExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createDeleteExpression` or the factory supplied by your transformation context instead. */\n    ts.createDelete = ts.Debug.deprecate(ts.factory.createDeleteExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateDeleteExpression` or the factory supplied by your transformation context instead. */\n    ts.updateDelete = ts.Debug.deprecate(ts.factory.updateDeleteExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createTypeOfExpression` or the factory supplied by your transformation context instead. */\n    ts.createTypeOf = ts.Debug.deprecate(ts.factory.createTypeOfExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateTypeOfExpression` or the factory supplied by your transformation context instead. */\n    ts.updateTypeOf = ts.Debug.deprecate(ts.factory.updateTypeOfExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createVoidExpression` or the factory supplied by your transformation context instead. */\n    ts.createVoid = ts.Debug.deprecate(ts.factory.createVoidExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateVoidExpression` or the factory supplied by your transformation context instead. */\n    ts.updateVoid = ts.Debug.deprecate(ts.factory.updateVoidExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createAwaitExpression` or the factory supplied by your transformation context instead. */\n    ts.createAwait = ts.Debug.deprecate(ts.factory.createAwaitExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateAwaitExpression` or the factory supplied by your transformation context instead. */\n    ts.updateAwait = ts.Debug.deprecate(ts.factory.updateAwaitExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createPrefixExpression` or the factory supplied by your transformation context instead. */\n    ts.createPrefix = ts.Debug.deprecate(ts.factory.createPrefixUnaryExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updatePrefixExpression` or the factory supplied by your transformation context instead. */\n    ts.updatePrefix = ts.Debug.deprecate(ts.factory.updatePrefixUnaryExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createPostfixUnaryExpression` or the factory supplied by your transformation context instead. */\n    ts.createPostfix = ts.Debug.deprecate(ts.factory.createPostfixUnaryExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updatePostfixUnaryExpression` or the factory supplied by your transformation context instead. */\n    ts.updatePostfix = ts.Debug.deprecate(ts.factory.updatePostfixUnaryExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createBinaryExpression` or the factory supplied by your transformation context instead. */\n    ts.createBinary = ts.Debug.deprecate(ts.factory.createBinaryExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateConditionalExpression` or the factory supplied by your transformation context instead. */\n    ts.updateConditional = ts.Debug.deprecate(ts.factory.updateConditionalExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createTemplateExpression` or the factory supplied by your transformation context instead. */\n    ts.createTemplateExpression = ts.Debug.deprecate(ts.factory.createTemplateExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateTemplateExpression` or the factory supplied by your transformation context instead. */\n    ts.updateTemplateExpression = ts.Debug.deprecate(ts.factory.updateTemplateExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createTemplateHead` or the factory supplied by your transformation context instead. */\n    ts.createTemplateHead = ts.Debug.deprecate(ts.factory.createTemplateHead, factoryDeprecation);\n    /** @deprecated Use `factory.createTemplateMiddle` or the factory supplied by your transformation context instead. */\n    ts.createTemplateMiddle = ts.Debug.deprecate(ts.factory.createTemplateMiddle, factoryDeprecation);\n    /** @deprecated Use `factory.createTemplateTail` or the factory supplied by your transformation context instead. */\n    ts.createTemplateTail = ts.Debug.deprecate(ts.factory.createTemplateTail, factoryDeprecation);\n    /** @deprecated Use `factory.createNoSubstitutionTemplateLiteral` or the factory supplied by your transformation context instead. */\n    ts.createNoSubstitutionTemplateLiteral = ts.Debug.deprecate(ts.factory.createNoSubstitutionTemplateLiteral, factoryDeprecation);\n    /** @deprecated Use `factory.updateYieldExpression` or the factory supplied by your transformation context instead. */\n    ts.updateYield = ts.Debug.deprecate(ts.factory.updateYieldExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createSpreadExpression` or the factory supplied by your transformation context instead. */\n    ts.createSpread = ts.Debug.deprecate(ts.factory.createSpreadElement, factoryDeprecation);\n    /** @deprecated Use `factory.updateSpreadExpression` or the factory supplied by your transformation context instead. */\n    ts.updateSpread = ts.Debug.deprecate(ts.factory.updateSpreadElement, factoryDeprecation);\n    /** @deprecated Use `factory.createOmittedExpression` or the factory supplied by your transformation context instead. */\n    ts.createOmittedExpression = ts.Debug.deprecate(ts.factory.createOmittedExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createAsExpression` or the factory supplied by your transformation context instead. */\n    ts.createAsExpression = ts.Debug.deprecate(ts.factory.createAsExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateAsExpression` or the factory supplied by your transformation context instead. */\n    ts.updateAsExpression = ts.Debug.deprecate(ts.factory.updateAsExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createNonNullExpression` or the factory supplied by your transformation context instead. */\n    ts.createNonNullExpression = ts.Debug.deprecate(ts.factory.createNonNullExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateNonNullExpression` or the factory supplied by your transformation context instead. */\n    ts.updateNonNullExpression = ts.Debug.deprecate(ts.factory.updateNonNullExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createNonNullChain` or the factory supplied by your transformation context instead. */\n    ts.createNonNullChain = ts.Debug.deprecate(ts.factory.createNonNullChain, factoryDeprecation);\n    /** @deprecated Use `factory.updateNonNullChain` or the factory supplied by your transformation context instead. */\n    ts.updateNonNullChain = ts.Debug.deprecate(ts.factory.updateNonNullChain, factoryDeprecation);\n    /** @deprecated Use `factory.createMetaProperty` or the factory supplied by your transformation context instead. */\n    ts.createMetaProperty = ts.Debug.deprecate(ts.factory.createMetaProperty, factoryDeprecation);\n    /** @deprecated Use `factory.updateMetaProperty` or the factory supplied by your transformation context instead. */\n    ts.updateMetaProperty = ts.Debug.deprecate(ts.factory.updateMetaProperty, factoryDeprecation);\n    /** @deprecated Use `factory.createTemplateSpan` or the factory supplied by your transformation context instead. */\n    ts.createTemplateSpan = ts.Debug.deprecate(ts.factory.createTemplateSpan, factoryDeprecation);\n    /** @deprecated Use `factory.updateTemplateSpan` or the factory supplied by your transformation context instead. */\n    ts.updateTemplateSpan = ts.Debug.deprecate(ts.factory.updateTemplateSpan, factoryDeprecation);\n    /** @deprecated Use `factory.createSemicolonClassElement` or the factory supplied by your transformation context instead. */\n    ts.createSemicolonClassElement = ts.Debug.deprecate(ts.factory.createSemicolonClassElement, factoryDeprecation);\n    /** @deprecated Use `factory.createBlock` or the factory supplied by your transformation context instead. */\n    ts.createBlock = ts.Debug.deprecate(ts.factory.createBlock, factoryDeprecation);\n    /** @deprecated Use `factory.updateBlock` or the factory supplied by your transformation context instead. */\n    ts.updateBlock = ts.Debug.deprecate(ts.factory.updateBlock, factoryDeprecation);\n    /** @deprecated Use `factory.createVariableStatement` or the factory supplied by your transformation context instead. */\n    ts.createVariableStatement = ts.Debug.deprecate(ts.factory.createVariableStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateVariableStatement` or the factory supplied by your transformation context instead. */\n    ts.updateVariableStatement = ts.Debug.deprecate(ts.factory.updateVariableStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createEmptyStatement` or the factory supplied by your transformation context instead. */\n    ts.createEmptyStatement = ts.Debug.deprecate(ts.factory.createEmptyStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */\n    ts.createExpressionStatement = ts.Debug.deprecate(ts.factory.createExpressionStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */\n    ts.updateExpressionStatement = ts.Debug.deprecate(ts.factory.updateExpressionStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */\n    ts.createStatement = ts.Debug.deprecate(ts.factory.createExpressionStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */\n    ts.updateStatement = ts.Debug.deprecate(ts.factory.updateExpressionStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createIfStatement` or the factory supplied by your transformation context instead. */\n    ts.createIf = ts.Debug.deprecate(ts.factory.createIfStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateIfStatement` or the factory supplied by your transformation context instead. */\n    ts.updateIf = ts.Debug.deprecate(ts.factory.updateIfStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createDoStatement` or the factory supplied by your transformation context instead. */\n    ts.createDo = ts.Debug.deprecate(ts.factory.createDoStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateDoStatement` or the factory supplied by your transformation context instead. */\n    ts.updateDo = ts.Debug.deprecate(ts.factory.updateDoStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createWhileStatement` or the factory supplied by your transformation context instead. */\n    ts.createWhile = ts.Debug.deprecate(ts.factory.createWhileStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateWhileStatement` or the factory supplied by your transformation context instead. */\n    ts.updateWhile = ts.Debug.deprecate(ts.factory.updateWhileStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createForStatement` or the factory supplied by your transformation context instead. */\n    ts.createFor = ts.Debug.deprecate(ts.factory.createForStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateForStatement` or the factory supplied by your transformation context instead. */\n    ts.updateFor = ts.Debug.deprecate(ts.factory.updateForStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createForInStatement` or the factory supplied by your transformation context instead. */\n    ts.createForIn = ts.Debug.deprecate(ts.factory.createForInStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateForInStatement` or the factory supplied by your transformation context instead. */\n    ts.updateForIn = ts.Debug.deprecate(ts.factory.updateForInStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createForOfStatement` or the factory supplied by your transformation context instead. */\n    ts.createForOf = ts.Debug.deprecate(ts.factory.createForOfStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateForOfStatement` or the factory supplied by your transformation context instead. */\n    ts.updateForOf = ts.Debug.deprecate(ts.factory.updateForOfStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createContinueStatement` or the factory supplied by your transformation context instead. */\n    ts.createContinue = ts.Debug.deprecate(ts.factory.createContinueStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateContinueStatement` or the factory supplied by your transformation context instead. */\n    ts.updateContinue = ts.Debug.deprecate(ts.factory.updateContinueStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createBreakStatement` or the factory supplied by your transformation context instead. */\n    ts.createBreak = ts.Debug.deprecate(ts.factory.createBreakStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateBreakStatement` or the factory supplied by your transformation context instead. */\n    ts.updateBreak = ts.Debug.deprecate(ts.factory.updateBreakStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createReturnStatement` or the factory supplied by your transformation context instead. */\n    ts.createReturn = ts.Debug.deprecate(ts.factory.createReturnStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateReturnStatement` or the factory supplied by your transformation context instead. */\n    ts.updateReturn = ts.Debug.deprecate(ts.factory.updateReturnStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createWithStatement` or the factory supplied by your transformation context instead. */\n    ts.createWith = ts.Debug.deprecate(ts.factory.createWithStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateWithStatement` or the factory supplied by your transformation context instead. */\n    ts.updateWith = ts.Debug.deprecate(ts.factory.updateWithStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createSwitchStatement` or the factory supplied by your transformation context instead. */\n    ts.createSwitch = ts.Debug.deprecate(ts.factory.createSwitchStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateSwitchStatement` or the factory supplied by your transformation context instead. */\n    ts.updateSwitch = ts.Debug.deprecate(ts.factory.updateSwitchStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createLabelStatement` or the factory supplied by your transformation context instead. */\n    ts.createLabel = ts.Debug.deprecate(ts.factory.createLabeledStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateLabelStatement` or the factory supplied by your transformation context instead. */\n    ts.updateLabel = ts.Debug.deprecate(ts.factory.updateLabeledStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createThrowStatement` or the factory supplied by your transformation context instead. */\n    ts.createThrow = ts.Debug.deprecate(ts.factory.createThrowStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateThrowStatement` or the factory supplied by your transformation context instead. */\n    ts.updateThrow = ts.Debug.deprecate(ts.factory.updateThrowStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createTryStatement` or the factory supplied by your transformation context instead. */\n    ts.createTry = ts.Debug.deprecate(ts.factory.createTryStatement, factoryDeprecation);\n    /** @deprecated Use `factory.updateTryStatement` or the factory supplied by your transformation context instead. */\n    ts.updateTry = ts.Debug.deprecate(ts.factory.updateTryStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createDebuggerStatement` or the factory supplied by your transformation context instead. */\n    ts.createDebuggerStatement = ts.Debug.deprecate(ts.factory.createDebuggerStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createVariableDeclarationList` or the factory supplied by your transformation context instead. */\n    ts.createVariableDeclarationList = ts.Debug.deprecate(ts.factory.createVariableDeclarationList, factoryDeprecation);\n    /** @deprecated Use `factory.updateVariableDeclarationList` or the factory supplied by your transformation context instead. */\n    ts.updateVariableDeclarationList = ts.Debug.deprecate(ts.factory.updateVariableDeclarationList, factoryDeprecation);\n    /** @deprecated Use `factory.createFunctionDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createFunctionDeclaration = ts.Debug.deprecate(ts.factory.createFunctionDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.updateFunctionDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateFunctionDeclaration = ts.Debug.deprecate(ts.factory.updateFunctionDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.createClassDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createClassDeclaration = ts.Debug.deprecate(ts.factory.createClassDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.updateClassDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateClassDeclaration = ts.Debug.deprecate(ts.factory.updateClassDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.createInterfaceDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createInterfaceDeclaration = ts.Debug.deprecate(ts.factory.createInterfaceDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.updateInterfaceDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateInterfaceDeclaration = ts.Debug.deprecate(ts.factory.updateInterfaceDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.createTypeAliasDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createTypeAliasDeclaration = ts.Debug.deprecate(ts.factory.createTypeAliasDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.updateTypeAliasDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateTypeAliasDeclaration = ts.Debug.deprecate(ts.factory.updateTypeAliasDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.createEnumDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createEnumDeclaration = ts.Debug.deprecate(ts.factory.createEnumDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.updateEnumDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateEnumDeclaration = ts.Debug.deprecate(ts.factory.updateEnumDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.createModuleDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createModuleDeclaration = ts.Debug.deprecate(ts.factory.createModuleDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.updateModuleDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateModuleDeclaration = ts.Debug.deprecate(ts.factory.updateModuleDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.createModuleBlock` or the factory supplied by your transformation context instead. */\n    ts.createModuleBlock = ts.Debug.deprecate(ts.factory.createModuleBlock, factoryDeprecation);\n    /** @deprecated Use `factory.updateModuleBlock` or the factory supplied by your transformation context instead. */\n    ts.updateModuleBlock = ts.Debug.deprecate(ts.factory.updateModuleBlock, factoryDeprecation);\n    /** @deprecated Use `factory.createCaseBlock` or the factory supplied by your transformation context instead. */\n    ts.createCaseBlock = ts.Debug.deprecate(ts.factory.createCaseBlock, factoryDeprecation);\n    /** @deprecated Use `factory.updateCaseBlock` or the factory supplied by your transformation context instead. */\n    ts.updateCaseBlock = ts.Debug.deprecate(ts.factory.updateCaseBlock, factoryDeprecation);\n    /** @deprecated Use `factory.createNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createNamespaceExportDeclaration = ts.Debug.deprecate(ts.factory.createNamespaceExportDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.updateNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateNamespaceExportDeclaration = ts.Debug.deprecate(ts.factory.updateNamespaceExportDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.createImportEqualsDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createImportEqualsDeclaration = ts.Debug.deprecate(ts.factory.createImportEqualsDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.updateImportEqualsDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateImportEqualsDeclaration = ts.Debug.deprecate(ts.factory.updateImportEqualsDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.createImportDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createImportDeclaration = ts.Debug.deprecate(ts.factory.createImportDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.updateImportDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateImportDeclaration = ts.Debug.deprecate(ts.factory.updateImportDeclaration, factoryDeprecation);\n    /** @deprecated Use `factory.createNamespaceImport` or the factory supplied by your transformation context instead. */\n    ts.createNamespaceImport = ts.Debug.deprecate(ts.factory.createNamespaceImport, factoryDeprecation);\n    /** @deprecated Use `factory.updateNamespaceImport` or the factory supplied by your transformation context instead. */\n    ts.updateNamespaceImport = ts.Debug.deprecate(ts.factory.updateNamespaceImport, factoryDeprecation);\n    /** @deprecated Use `factory.createNamedImports` or the factory supplied by your transformation context instead. */\n    ts.createNamedImports = ts.Debug.deprecate(ts.factory.createNamedImports, factoryDeprecation);\n    /** @deprecated Use `factory.updateNamedImports` or the factory supplied by your transformation context instead. */\n    ts.updateNamedImports = ts.Debug.deprecate(ts.factory.updateNamedImports, factoryDeprecation);\n    /** @deprecated Use `factory.createImportSpecifier` or the factory supplied by your transformation context instead. */\n    ts.createImportSpecifier = ts.Debug.deprecate(ts.factory.createImportSpecifier, factoryDeprecation);\n    /** @deprecated Use `factory.updateImportSpecifier` or the factory supplied by your transformation context instead. */\n    ts.updateImportSpecifier = ts.Debug.deprecate(ts.factory.updateImportSpecifier, factoryDeprecation);\n    /** @deprecated Use `factory.createExportAssignment` or the factory supplied by your transformation context instead. */\n    ts.createExportAssignment = ts.Debug.deprecate(ts.factory.createExportAssignment, factoryDeprecation);\n    /** @deprecated Use `factory.updateExportAssignment` or the factory supplied by your transformation context instead. */\n    ts.updateExportAssignment = ts.Debug.deprecate(ts.factory.updateExportAssignment, factoryDeprecation);\n    /** @deprecated Use `factory.createNamedExports` or the factory supplied by your transformation context instead. */\n    ts.createNamedExports = ts.Debug.deprecate(ts.factory.createNamedExports, factoryDeprecation);\n    /** @deprecated Use `factory.updateNamedExports` or the factory supplied by your transformation context instead. */\n    ts.updateNamedExports = ts.Debug.deprecate(ts.factory.updateNamedExports, factoryDeprecation);\n    /** @deprecated Use `factory.createExportSpecifier` or the factory supplied by your transformation context instead. */\n    ts.createExportSpecifier = ts.Debug.deprecate(ts.factory.createExportSpecifier, factoryDeprecation);\n    /** @deprecated Use `factory.updateExportSpecifier` or the factory supplied by your transformation context instead. */\n    ts.updateExportSpecifier = ts.Debug.deprecate(ts.factory.updateExportSpecifier, factoryDeprecation);\n    /** @deprecated Use `factory.createExternalModuleReference` or the factory supplied by your transformation context instead. */\n    ts.createExternalModuleReference = ts.Debug.deprecate(ts.factory.createExternalModuleReference, factoryDeprecation);\n    /** @deprecated Use `factory.updateExternalModuleReference` or the factory supplied by your transformation context instead. */\n    ts.updateExternalModuleReference = ts.Debug.deprecate(ts.factory.updateExternalModuleReference, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocTypeExpression` or the factory supplied by your transformation context instead. */\n    ts.createJSDocTypeExpression = ts.Debug.deprecate(ts.factory.createJSDocTypeExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocTypeTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocTypeTag = ts.Debug.deprecate(ts.factory.createJSDocTypeTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocReturnTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocReturnTag = ts.Debug.deprecate(ts.factory.createJSDocReturnTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocThisTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocThisTag = ts.Debug.deprecate(ts.factory.createJSDocThisTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocComment` or the factory supplied by your transformation context instead. */\n    ts.createJSDocComment = ts.Debug.deprecate(ts.factory.createJSDocComment, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocParameterTag = ts.Debug.deprecate(ts.factory.createJSDocParameterTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocClassTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocClassTag = ts.Debug.deprecate(ts.factory.createJSDocClassTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocAugmentsTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocAugmentsTag = ts.Debug.deprecate(ts.factory.createJSDocAugmentsTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocEnumTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocEnumTag = ts.Debug.deprecate(ts.factory.createJSDocEnumTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocTemplateTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocTemplateTag = ts.Debug.deprecate(ts.factory.createJSDocTemplateTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocTypedefTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocTypedefTag = ts.Debug.deprecate(ts.factory.createJSDocTypedefTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocCallbackTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocCallbackTag = ts.Debug.deprecate(ts.factory.createJSDocCallbackTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocSignature` or the factory supplied by your transformation context instead. */\n    ts.createJSDocSignature = ts.Debug.deprecate(ts.factory.createJSDocSignature, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocPropertyTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocPropertyTag = ts.Debug.deprecate(ts.factory.createJSDocPropertyTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocTypeLiteral` or the factory supplied by your transformation context instead. */\n    ts.createJSDocTypeLiteral = ts.Debug.deprecate(ts.factory.createJSDocTypeLiteral, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocImplementsTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocImplementsTag = ts.Debug.deprecate(ts.factory.createJSDocImplementsTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocAuthorTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocAuthorTag = ts.Debug.deprecate(ts.factory.createJSDocAuthorTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocPublicTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocPublicTag = ts.Debug.deprecate(ts.factory.createJSDocPublicTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocPrivateTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocPrivateTag = ts.Debug.deprecate(ts.factory.createJSDocPrivateTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocProtectedTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocProtectedTag = ts.Debug.deprecate(ts.factory.createJSDocProtectedTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocReadonlyTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocReadonlyTag = ts.Debug.deprecate(ts.factory.createJSDocReadonlyTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocUnknownTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocTag = ts.Debug.deprecate(ts.factory.createJSDocUnknownTag, factoryDeprecation);\n    /** @deprecated Use `factory.createJsxElement` or the factory supplied by your transformation context instead. */\n    ts.createJsxElement = ts.Debug.deprecate(ts.factory.createJsxElement, factoryDeprecation);\n    /** @deprecated Use `factory.updateJsxElement` or the factory supplied by your transformation context instead. */\n    ts.updateJsxElement = ts.Debug.deprecate(ts.factory.updateJsxElement, factoryDeprecation);\n    /** @deprecated Use `factory.createJsxSelfClosingElement` or the factory supplied by your transformation context instead. */\n    ts.createJsxSelfClosingElement = ts.Debug.deprecate(ts.factory.createJsxSelfClosingElement, factoryDeprecation);\n    /** @deprecated Use `factory.updateJsxSelfClosingElement` or the factory supplied by your transformation context instead. */\n    ts.updateJsxSelfClosingElement = ts.Debug.deprecate(ts.factory.updateJsxSelfClosingElement, factoryDeprecation);\n    /** @deprecated Use `factory.createJsxOpeningElement` or the factory supplied by your transformation context instead. */\n    ts.createJsxOpeningElement = ts.Debug.deprecate(ts.factory.createJsxOpeningElement, factoryDeprecation);\n    /** @deprecated Use `factory.updateJsxOpeningElement` or the factory supplied by your transformation context instead. */\n    ts.updateJsxOpeningElement = ts.Debug.deprecate(ts.factory.updateJsxOpeningElement, factoryDeprecation);\n    /** @deprecated Use `factory.createJsxClosingElement` or the factory supplied by your transformation context instead. */\n    ts.createJsxClosingElement = ts.Debug.deprecate(ts.factory.createJsxClosingElement, factoryDeprecation);\n    /** @deprecated Use `factory.updateJsxClosingElement` or the factory supplied by your transformation context instead. */\n    ts.updateJsxClosingElement = ts.Debug.deprecate(ts.factory.updateJsxClosingElement, factoryDeprecation);\n    /** @deprecated Use `factory.createJsxFragment` or the factory supplied by your transformation context instead. */\n    ts.createJsxFragment = ts.Debug.deprecate(ts.factory.createJsxFragment, factoryDeprecation);\n    /** @deprecated Use `factory.createJsxText` or the factory supplied by your transformation context instead. */\n    ts.createJsxText = ts.Debug.deprecate(ts.factory.createJsxText, factoryDeprecation);\n    /** @deprecated Use `factory.updateJsxText` or the factory supplied by your transformation context instead. */\n    ts.updateJsxText = ts.Debug.deprecate(ts.factory.updateJsxText, factoryDeprecation);\n    /** @deprecated Use `factory.createJsxOpeningFragment` or the factory supplied by your transformation context instead. */\n    ts.createJsxOpeningFragment = ts.Debug.deprecate(ts.factory.createJsxOpeningFragment, factoryDeprecation);\n    /** @deprecated Use `factory.createJsxJsxClosingFragment` or the factory supplied by your transformation context instead. */\n    ts.createJsxJsxClosingFragment = ts.Debug.deprecate(ts.factory.createJsxJsxClosingFragment, factoryDeprecation);\n    /** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */\n    ts.updateJsxFragment = ts.Debug.deprecate(ts.factory.updateJsxFragment, factoryDeprecation);\n    /** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */\n    ts.createJsxAttribute = ts.Debug.deprecate(ts.factory.createJsxAttribute, factoryDeprecation);\n    /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */\n    ts.updateJsxAttribute = ts.Debug.deprecate(ts.factory.updateJsxAttribute, factoryDeprecation);\n    /** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */\n    ts.createJsxAttributes = ts.Debug.deprecate(ts.factory.createJsxAttributes, factoryDeprecation);\n    /** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */\n    ts.updateJsxAttributes = ts.Debug.deprecate(ts.factory.updateJsxAttributes, factoryDeprecation);\n    /** @deprecated Use `factory.createJsxSpreadAttribute` or the factory supplied by your transformation context instead. */\n    ts.createJsxSpreadAttribute = ts.Debug.deprecate(ts.factory.createJsxSpreadAttribute, factoryDeprecation);\n    /** @deprecated Use `factory.updateJsxSpreadAttribute` or the factory supplied by your transformation context instead. */\n    ts.updateJsxSpreadAttribute = ts.Debug.deprecate(ts.factory.updateJsxSpreadAttribute, factoryDeprecation);\n    /** @deprecated Use `factory.createJsxExpression` or the factory supplied by your transformation context instead. */\n    ts.createJsxExpression = ts.Debug.deprecate(ts.factory.createJsxExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateJsxExpression` or the factory supplied by your transformation context instead. */\n    ts.updateJsxExpression = ts.Debug.deprecate(ts.factory.updateJsxExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createCaseClause` or the factory supplied by your transformation context instead. */\n    ts.createCaseClause = ts.Debug.deprecate(ts.factory.createCaseClause, factoryDeprecation);\n    /** @deprecated Use `factory.updateCaseClause` or the factory supplied by your transformation context instead. */\n    ts.updateCaseClause = ts.Debug.deprecate(ts.factory.updateCaseClause, factoryDeprecation);\n    /** @deprecated Use `factory.createDefaultClause` or the factory supplied by your transformation context instead. */\n    ts.createDefaultClause = ts.Debug.deprecate(ts.factory.createDefaultClause, factoryDeprecation);\n    /** @deprecated Use `factory.updateDefaultClause` or the factory supplied by your transformation context instead. */\n    ts.updateDefaultClause = ts.Debug.deprecate(ts.factory.updateDefaultClause, factoryDeprecation);\n    /** @deprecated Use `factory.createHeritageClause` or the factory supplied by your transformation context instead. */\n    ts.createHeritageClause = ts.Debug.deprecate(ts.factory.createHeritageClause, factoryDeprecation);\n    /** @deprecated Use `factory.updateHeritageClause` or the factory supplied by your transformation context instead. */\n    ts.updateHeritageClause = ts.Debug.deprecate(ts.factory.updateHeritageClause, factoryDeprecation);\n    /** @deprecated Use `factory.createCatchClause` or the factory supplied by your transformation context instead. */\n    ts.createCatchClause = ts.Debug.deprecate(ts.factory.createCatchClause, factoryDeprecation);\n    /** @deprecated Use `factory.updateCatchClause` or the factory supplied by your transformation context instead. */\n    ts.updateCatchClause = ts.Debug.deprecate(ts.factory.updateCatchClause, factoryDeprecation);\n    /** @deprecated Use `factory.createPropertyAssignment` or the factory supplied by your transformation context instead. */\n    ts.createPropertyAssignment = ts.Debug.deprecate(ts.factory.createPropertyAssignment, factoryDeprecation);\n    /** @deprecated Use `factory.updatePropertyAssignment` or the factory supplied by your transformation context instead. */\n    ts.updatePropertyAssignment = ts.Debug.deprecate(ts.factory.updatePropertyAssignment, factoryDeprecation);\n    /** @deprecated Use `factory.createShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */\n    ts.createShorthandPropertyAssignment = ts.Debug.deprecate(ts.factory.createShorthandPropertyAssignment, factoryDeprecation);\n    /** @deprecated Use `factory.updateShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */\n    ts.updateShorthandPropertyAssignment = ts.Debug.deprecate(ts.factory.updateShorthandPropertyAssignment, factoryDeprecation);\n    /** @deprecated Use `factory.createSpreadAssignment` or the factory supplied by your transformation context instead. */\n    ts.createSpreadAssignment = ts.Debug.deprecate(ts.factory.createSpreadAssignment, factoryDeprecation);\n    /** @deprecated Use `factory.updateSpreadAssignment` or the factory supplied by your transformation context instead. */\n    ts.updateSpreadAssignment = ts.Debug.deprecate(ts.factory.updateSpreadAssignment, factoryDeprecation);\n    /** @deprecated Use `factory.createEnumMember` or the factory supplied by your transformation context instead. */\n    ts.createEnumMember = ts.Debug.deprecate(ts.factory.createEnumMember, factoryDeprecation);\n    /** @deprecated Use `factory.updateEnumMember` or the factory supplied by your transformation context instead. */\n    ts.updateEnumMember = ts.Debug.deprecate(ts.factory.updateEnumMember, factoryDeprecation);\n    /** @deprecated Use `factory.updateSourceFile` or the factory supplied by your transformation context instead. */\n    ts.updateSourceFileNode = ts.Debug.deprecate(ts.factory.updateSourceFile, factoryDeprecation);\n    /** @deprecated Use `factory.createNotEmittedStatement` or the factory supplied by your transformation context instead. */\n    ts.createNotEmittedStatement = ts.Debug.deprecate(ts.factory.createNotEmittedStatement, factoryDeprecation);\n    /** @deprecated Use `factory.createPartiallyEmittedExpression` or the factory supplied by your transformation context instead. */\n    ts.createPartiallyEmittedExpression = ts.Debug.deprecate(ts.factory.createPartiallyEmittedExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updatePartiallyEmittedExpression` or the factory supplied by your transformation context instead. */\n    ts.updatePartiallyEmittedExpression = ts.Debug.deprecate(ts.factory.updatePartiallyEmittedExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createCommaListExpression` or the factory supplied by your transformation context instead. */\n    ts.createCommaList = ts.Debug.deprecate(ts.factory.createCommaListExpression, factoryDeprecation);\n    /** @deprecated Use `factory.updateCommaListExpression` or the factory supplied by your transformation context instead. */\n    ts.updateCommaList = ts.Debug.deprecate(ts.factory.updateCommaListExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createBundle` or the factory supplied by your transformation context instead. */\n    ts.createBundle = ts.Debug.deprecate(ts.factory.createBundle, factoryDeprecation);\n    /** @deprecated Use `factory.updateBundle` or the factory supplied by your transformation context instead. */\n    ts.updateBundle = ts.Debug.deprecate(ts.factory.updateBundle, factoryDeprecation);\n    /** @deprecated Use `factory.createImmediatelyInvokedFunctionExpression` or the factory supplied by your transformation context instead. */\n    ts.createImmediatelyInvokedFunctionExpression = ts.Debug.deprecate(ts.factory.createImmediatelyInvokedFunctionExpression, factoryDeprecation);\n    /** @deprecated Use `factory.createImmediatelyInvokedArrowFunction` or the factory supplied by your transformation context instead. */\n    ts.createImmediatelyInvokedArrowFunction = ts.Debug.deprecate(ts.factory.createImmediatelyInvokedArrowFunction, factoryDeprecation);\n    /** @deprecated Use `factory.createVoidZero` or the factory supplied by your transformation context instead. */\n    ts.createVoidZero = ts.Debug.deprecate(ts.factory.createVoidZero, factoryDeprecation);\n    /** @deprecated Use `factory.createExportDefault` or the factory supplied by your transformation context instead. */\n    ts.createExportDefault = ts.Debug.deprecate(ts.factory.createExportDefault, factoryDeprecation);\n    /** @deprecated Use `factory.createExternalModuleExport` or the factory supplied by your transformation context instead. */\n    ts.createExternalModuleExport = ts.Debug.deprecate(ts.factory.createExternalModuleExport, factoryDeprecation);\n    /** @deprecated Use `factory.createNamespaceExport` or the factory supplied by your transformation context instead. */\n    ts.createNamespaceExport = ts.Debug.deprecate(ts.factory.createNamespaceExport, factoryDeprecation);\n    /** @deprecated Use `factory.updateNamespaceExport` or the factory supplied by your transformation context instead. */\n    ts.updateNamespaceExport = ts.Debug.deprecate(ts.factory.updateNamespaceExport, factoryDeprecation);\n    /** @deprecated Use `factory.createToken` or the factory supplied by your transformation context instead. */\n    ts.createToken = ts.Debug.deprecate(function createToken(kind) {\n        return ts.factory.createToken(kind);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createIdentifier` or the factory supplied by your transformation context instead. */\n    ts.createIdentifier = ts.Debug.deprecate(function createIdentifier(text) {\n        return ts.factory.createIdentifier(text, /*typeArguments*/ undefined, /*originalKeywordKind*/ undefined);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createTempVariable` or the factory supplied by your transformation context instead. */\n    ts.createTempVariable = ts.Debug.deprecate(function createTempVariable(recordTempVariable) {\n        return ts.factory.createTempVariable(recordTempVariable, /*reserveInNestedScopes*/ undefined);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.getGeneratedNameForNode` or the factory supplied by your transformation context instead. */\n    ts.getGeneratedNameForNode = ts.Debug.deprecate(function getGeneratedNameForNode(node) {\n        return ts.factory.getGeneratedNameForNode(node, /*flags*/ undefined);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic)` or the factory supplied by your transformation context instead. */\n    ts.createOptimisticUniqueName = ts.Debug.deprecate(function createOptimisticUniqueName(text) {\n        return ts.factory.createUniqueName(text, 16 /* Optimistic */);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.FileLevel)` or the factory supplied by your transformation context instead. */\n    ts.createFileLevelUniqueName = ts.Debug.deprecate(function createFileLevelUniqueName(text) {\n        return ts.factory.createUniqueName(text, 16 /* Optimistic */ | 32 /* FileLevel */);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createIndexSignature` or the factory supplied by your transformation context instead. */\n    ts.createIndexSignature = ts.Debug.deprecate(function createIndexSignature(decorators, modifiers, parameters, type) {\n        return ts.factory.createIndexSignature(decorators, modifiers, parameters, type);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */\n    ts.createTypePredicateNode = ts.Debug.deprecate(function createTypePredicateNode(parameterName, type) {\n        return ts.factory.createTypePredicateNode(/*assertsModifier*/ undefined, parameterName, type);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */\n    ts.updateTypePredicateNode = ts.Debug.deprecate(function updateTypePredicateNode(node, parameterName, type) {\n        return ts.factory.updateTypePredicateNode(node, /*assertsModifier*/ undefined, parameterName, type);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead. */\n    ts.createLiteral = ts.Debug.deprecate(function createLiteral(value) {\n        if (typeof value === \"number\") {\n            return ts.factory.createNumericLiteral(value);\n        }\n        // eslint-disable-next-line no-in-operator\n        if (typeof value === \"object\" && \"base10Value\" in value) { // PseudoBigInt\n            return ts.factory.createBigIntLiteral(value);\n        }\n        if (typeof value === \"boolean\") {\n            return value ? ts.factory.createTrue() : ts.factory.createFalse();\n        }\n        if (typeof value === \"string\") {\n            return ts.factory.createStringLiteral(value, /*isSingleQuote*/ undefined);\n        }\n        return ts.factory.createStringLiteralFromNode(value);\n    }, { since: \"4.0\", warnAfter: \"4.1\", message: \"Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead.\" });\n    /** @deprecated Use `factory.createMethodSignature` or the factory supplied by your transformation context instead. */\n    ts.createMethodSignature = ts.Debug.deprecate(function createMethodSignature(typeParameters, parameters, type, name, questionToken) {\n        return ts.factory.createMethodSignature(/*modifiers*/ undefined, name, questionToken, typeParameters, parameters, type);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.updateMethodSignature` or the factory supplied by your transformation context instead. */\n    ts.updateMethodSignature = ts.Debug.deprecate(function updateMethodSignature(node, typeParameters, parameters, type, name, questionToken) {\n        return ts.factory.updateMethodSignature(node, node.modifiers, name, questionToken, typeParameters, parameters, type);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createTypeOperatorNode` or the factory supplied by your transformation context instead. */\n    ts.createTypeOperatorNode = ts.Debug.deprecate(function createTypeOperatorNode(operatorOrType, type) {\n        var operator;\n        if (type) {\n            operator = operatorOrType;\n        }\n        else {\n            type = operatorOrType;\n            operator = 138 /* KeyOfKeyword */;\n        }\n        return ts.factory.createTypeOperatorNode(operator, type);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createTaggedTemplate` or the factory supplied by your transformation context instead. */\n    ts.createTaggedTemplate = ts.Debug.deprecate(function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) {\n        var typeArguments;\n        if (template) {\n            typeArguments = typeArgumentsOrTemplate;\n        }\n        else {\n            template = typeArgumentsOrTemplate;\n        }\n        return ts.factory.createTaggedTemplateExpression(tag, typeArguments, template);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.updateTaggedTemplate` or the factory supplied by your transformation context instead. */\n    ts.updateTaggedTemplate = ts.Debug.deprecate(function updateTaggedTemplate(node, tag, typeArgumentsOrTemplate, template) {\n        var typeArguments;\n        if (template) {\n            typeArguments = typeArgumentsOrTemplate;\n        }\n        else {\n            template = typeArgumentsOrTemplate;\n        }\n        return ts.factory.updateTaggedTemplateExpression(node, tag, typeArguments, template);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.updateBinary` or the factory supplied by your transformation context instead. */\n    ts.updateBinary = ts.Debug.deprecate(function updateBinary(node, left, right, operator) {\n        if (operator === void 0) { operator = node.operatorToken; }\n        if (typeof operator === \"number\") {\n            operator = operator === node.operatorToken.kind ? node.operatorToken : ts.factory.createToken(operator);\n        }\n        return ts.factory.updateBinaryExpression(node, left, operator, right);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createConditional` or the factory supplied by your transformation context instead. */\n    ts.createConditional = ts.Debug.deprecate(function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) {\n        return arguments.length === 5 ? ts.factory.createConditionalExpression(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) :\n            arguments.length === 3 ? ts.factory.createConditionalExpression(condition, ts.factory.createToken(57 /* QuestionToken */), questionTokenOrWhenTrue, ts.factory.createToken(58 /* ColonToken */), whenTrueOrWhenFalse) :\n                ts.Debug.fail(\"Argument count mismatch\");\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createYield` or the factory supplied by your transformation context instead. */\n    ts.createYield = ts.Debug.deprecate(function createYield(asteriskTokenOrExpression, expression) {\n        var asteriskToken;\n        if (expression) {\n            asteriskToken = asteriskTokenOrExpression;\n        }\n        else {\n            expression = asteriskTokenOrExpression;\n        }\n        return ts.factory.createYieldExpression(asteriskToken, expression);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createClassExpression` or the factory supplied by your transformation context instead. */\n    ts.createClassExpression = ts.Debug.deprecate(function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) {\n        return ts.factory.createClassExpression(/*decorators*/ undefined, modifiers, name, typeParameters, heritageClauses, members);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.updateClassExpression` or the factory supplied by your transformation context instead. */\n    ts.updateClassExpression = ts.Debug.deprecate(function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) {\n        return ts.factory.updateClassExpression(node, /*decorators*/ undefined, modifiers, name, typeParameters, heritageClauses, members);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createPropertySignature` or the factory supplied by your transformation context instead. */\n    ts.createPropertySignature = ts.Debug.deprecate(function createPropertySignature(modifiers, name, questionToken, type, initializer) {\n        var node = ts.factory.createPropertySignature(modifiers, name, questionToken, type);\n        node.initializer = initializer;\n        return node;\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.updatePropertySignature` or the factory supplied by your transformation context instead. */\n    ts.updatePropertySignature = ts.Debug.deprecate(function updatePropertySignature(node, modifiers, name, questionToken, type, initializer) {\n        var updated = ts.factory.updatePropertySignature(node, modifiers, name, questionToken, type);\n        if (node.initializer !== initializer) {\n            if (updated === node) {\n                updated = ts.factory.cloneNode(node);\n            }\n            updated.initializer = initializer;\n        }\n        return updated;\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */\n    ts.createExpressionWithTypeArguments = ts.Debug.deprecate(function createExpressionWithTypeArguments(typeArguments, expression) {\n        return ts.factory.createExpressionWithTypeArguments(expression, typeArguments);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.updateExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */\n    ts.updateExpressionWithTypeArguments = ts.Debug.deprecate(function updateExpressionWithTypeArguments(node, typeArguments, expression) {\n        return ts.factory.updateExpressionWithTypeArguments(node, expression, typeArguments);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createArrowFunction` or the factory supplied by your transformation context instead. */\n    ts.createArrowFunction = ts.Debug.deprecate(function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody, body) {\n        return arguments.length === 6 ? ts.factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody, body) :\n            arguments.length === 5 ? ts.factory.createArrowFunction(modifiers, typeParameters, parameters, type, /*equalsGreaterThanToken*/ undefined, equalsGreaterThanTokenOrBody) :\n                ts.Debug.fail(\"Argument count mismatch\");\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.updateArrowFunction` or the factory supplied by your transformation context instead. */\n    ts.updateArrowFunction = ts.Debug.deprecate(function updateArrowFunction(node, modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody, body) {\n        return arguments.length === 7 ? ts.factory.updateArrowFunction(node, modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody, body) :\n            arguments.length === 6 ? ts.factory.updateArrowFunction(node, modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, equalsGreaterThanTokenOrBody) :\n                ts.Debug.fail(\"Argument count mismatch\");\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createVariableDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createVariableDeclaration = ts.Debug.deprecate(function createVariableDeclaration(name, exclamationTokenOrType, typeOrInitializer, initializer) {\n        return arguments.length === 4 ? ts.factory.createVariableDeclaration(name, exclamationTokenOrType, typeOrInitializer, initializer) :\n            arguments.length >= 1 && arguments.length <= 3 ? ts.factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, exclamationTokenOrType, typeOrInitializer) :\n                ts.Debug.fail(\"Argument count mismatch\");\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.updateVariableDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateVariableDeclaration = ts.Debug.deprecate(function updateVariableDeclaration(node, name, exclamationTokenOrType, typeOrInitializer, initializer) {\n        return arguments.length === 5 ? ts.factory.updateVariableDeclaration(node, name, exclamationTokenOrType, typeOrInitializer, initializer) :\n            arguments.length === 4 ? ts.factory.updateVariableDeclaration(node, name, node.exclamationToken, exclamationTokenOrType, typeOrInitializer) :\n                ts.Debug.fail(\"Argument count mismatch\");\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createImportClause` or the factory supplied by your transformation context instead. */\n    ts.createImportClause = ts.Debug.deprecate(function createImportClause(name, namedBindings, isTypeOnly) {\n        if (isTypeOnly === void 0) { isTypeOnly = false; }\n        return ts.factory.createImportClause(isTypeOnly, name, namedBindings);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.updateImportClause` or the factory supplied by your transformation context instead. */\n    ts.updateImportClause = ts.Debug.deprecate(function updateImportClause(node, name, namedBindings, isTypeOnly) {\n        return ts.factory.updateImportClause(node, isTypeOnly, name, namedBindings);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createExportDeclaration` or the factory supplied by your transformation context instead. */\n    ts.createExportDeclaration = ts.Debug.deprecate(function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) {\n        if (isTypeOnly === void 0) { isTypeOnly = false; }\n        return ts.factory.createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.updateExportDeclaration` or the factory supplied by your transformation context instead. */\n    ts.updateExportDeclaration = ts.Debug.deprecate(function updateExportDeclaration(node, decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) {\n        return ts.factory.updateExportDeclaration(node, decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */\n    ts.createJSDocParamTag = ts.Debug.deprecate(function createJSDocParamTag(name, isBracketed, typeExpression, comment) {\n        return ts.factory.createJSDocParameterTag(/*tagName*/ undefined, name, isBracketed, typeExpression, /*isNameFirst*/ false, comment);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createComma` or the factory supplied by your transformation context instead. */\n    ts.createComma = ts.Debug.deprecate(function createComma(left, right) {\n        return ts.factory.createComma(left, right);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createLessThan` or the factory supplied by your transformation context instead. */\n    ts.createLessThan = ts.Debug.deprecate(function createLessThan(left, right) {\n        return ts.factory.createLessThan(left, right);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createAssignment` or the factory supplied by your transformation context instead. */\n    ts.createAssignment = ts.Debug.deprecate(function createAssignment(left, right) {\n        return ts.factory.createAssignment(left, right);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createStrictEquality` or the factory supplied by your transformation context instead. */\n    ts.createStrictEquality = ts.Debug.deprecate(function createStrictEquality(left, right) {\n        return ts.factory.createStrictEquality(left, right);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createStrictInequality` or the factory supplied by your transformation context instead. */\n    ts.createStrictInequality = ts.Debug.deprecate(function createStrictInequality(left, right) {\n        return ts.factory.createStrictInequality(left, right);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createAdd` or the factory supplied by your transformation context instead. */\n    ts.createAdd = ts.Debug.deprecate(function createAdd(left, right) {\n        return ts.factory.createAdd(left, right);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createSubtract` or the factory supplied by your transformation context instead. */\n    ts.createSubtract = ts.Debug.deprecate(function createSubtract(left, right) {\n        return ts.factory.createSubtract(left, right);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createLogicalAnd` or the factory supplied by your transformation context instead. */\n    ts.createLogicalAnd = ts.Debug.deprecate(function createLogicalAnd(left, right) {\n        return ts.factory.createLogicalAnd(left, right);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createLogicalOr` or the factory supplied by your transformation context instead. */\n    ts.createLogicalOr = ts.Debug.deprecate(function createLogicalOr(left, right) {\n        return ts.factory.createLogicalOr(left, right);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createPostfixIncrement` or the factory supplied by your transformation context instead. */\n    ts.createPostfixIncrement = ts.Debug.deprecate(function createPostfixIncrement(operand) {\n        return ts.factory.createPostfixIncrement(operand);\n    }, factoryDeprecation);\n    /** @deprecated Use `factory.createLogicalNot` or the factory supplied by your transformation context instead. */\n    ts.createLogicalNot = ts.Debug.deprecate(function createLogicalNot(operand) {\n        return ts.factory.createLogicalNot(operand);\n    }, factoryDeprecation);\n    /** @deprecated Use an appropriate `factory` method instead. */\n    ts.createNode = ts.Debug.deprecate(function createNode(kind, pos, end) {\n        if (pos === void 0) { pos = 0; }\n        if (end === void 0) { end = 0; }\n        return ts.setTextRangePosEnd(kind === 297 /* SourceFile */ ? ts.parseBaseNodeFactory.createBaseSourceFileNode(kind) :\n            kind === 78 /* Identifier */ ? ts.parseBaseNodeFactory.createBaseIdentifierNode(kind) :\n                kind === 79 /* PrivateIdentifier */ ? ts.parseBaseNodeFactory.createBasePrivateIdentifierNode(kind) :\n                    !ts.isNodeKind(kind) ? ts.parseBaseNodeFactory.createBaseTokenNode(kind) :\n                        ts.parseBaseNodeFactory.createBaseNode(kind), pos, end);\n    }, { since: \"4.0\", warnAfter: \"4.1\", message: \"Use an appropriate `factory` method instead.\" });\n    /**\n     * Creates a shallow, memberwise clone of a node ~for mutation~ with its `pos`, `end`, and `parent` set.\n     *\n     * NOTE: It is unsafe to change any properties of a `Node` that relate to its AST children, as those changes won't be\n     * captured with respect to transformations.\n     *\n     * @deprecated Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`.\n     */\n    ts.getMutableClone = ts.Debug.deprecate(function getMutableClone(node) {\n        var clone = ts.factory.cloneNode(node);\n        ts.setTextRange(clone, node);\n        ts.setParent(clone, node.parent);\n        return clone;\n    }, { since: \"4.0\", warnAfter: \"4.1\", message: \"Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`.\" });\n    // #endregion Node Factory top-level exports\n    // DEPRECATION: Renamed node tests\n    // DEPRECATION PLAN:\n    //     - soft: 4.0\n    //     - warn: 4.1\n    //     - error: TBD\n    // #region Renamed node Tests\n    /** @deprecated Use `isTypeAssertionExpression` instead. */\n    ts.isTypeAssertion = ts.Debug.deprecate(function isTypeAssertion(node) {\n        return node.kind === 206 /* TypeAssertionExpression */;\n    }, {\n        since: \"4.0\",\n        warnAfter: \"4.1\",\n        message: \"Use `isTypeAssertionExpression` instead.\"\n    });\n    // #endregion\n})(ts || (ts = {}));\n\n\n\n// MONACOCHANGE\nvar createClassifier = ts.createClassifier;\nvar createLanguageService = ts.createLanguageService;\nvar displayPartsToString = ts.displayPartsToString;\nvar EndOfLineState = ts.EndOfLineState;\nvar flattenDiagnosticMessageText = ts.flattenDiagnosticMessageText;\nvar IndentStyle = ts.IndentStyle;\nvar ScriptKind = ts.ScriptKind;\nvar ScriptTarget = ts.ScriptTarget;\nvar TokenClass = ts.TokenClass;\n// END MONACOCHANGE\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/language/typescript/lib/typescriptServices.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js":
/*!****************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _editor_editor_worker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editor/editor.worker.js */ \"./node_modules/monaco-editor/esm/vs/editor/editor.worker.js\");\n/* harmony import */ var _tsWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tsWorker.js */ \"./node_modules/monaco-editor/esm/vs/language/typescript/tsWorker.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n\r\n\r\nself.onmessage = function () {\r\n    // ignore the first message\r\n    _editor_editor_worker_js__WEBPACK_IMPORTED_MODULE_0__.initialize(function (ctx, createData) {\r\n        return new _tsWorker_js__WEBPACK_IMPORTED_MODULE_1__.TypeScriptWorker(ctx, createData);\r\n    });\r\n};\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js?");

/***/ }),

/***/ "./node_modules/monaco-editor/esm/vs/language/typescript/tsWorker.js":
/*!***************************************************************************!*\
  !*** ./node_modules/monaco-editor/esm/vs/language/typescript/tsWorker.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"TypeScriptWorker\": () => (/* binding */ TypeScriptWorker),\n/* harmony export */   \"create\": () => (/* binding */ create)\n/* harmony export */ });\n/* harmony import */ var _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/typescriptServices.js */ \"./node_modules/monaco-editor/esm/vs/language/typescript/lib/typescriptServices.js\");\n/* harmony import */ var _lib_lib_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/lib.js */ \"./node_modules/monaco-editor/esm/vs/language/typescript/lib/lib.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n    return new (P || (P = Promise))(function (resolve, reject) {\r\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n    });\r\n};\r\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\r\n    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n    return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n    function verb(n) { return function (v) { return step([n, v]); }; }\r\n    function step(op) {\r\n        if (f) throw new TypeError(\"Generator is already executing.\");\r\n        while (_) try {\r\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;\r\n            if (y = 0, t) op = [op[0] & 2, t.value];\r\n            switch (op[0]) {\r\n                case 0: case 1: t = op; break;\r\n                case 4: _.label++; return { value: op[1], done: false };\r\n                case 5: _.label++; y = op[1]; op = [0]; continue;\r\n                case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n                default:\r\n                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n                    if (t[2]) _.ops.pop();\r\n                    _.trys.pop(); continue;\r\n            }\r\n            op = body.call(thisArg, _);\r\n        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n    }\r\n};\r\n\r\n\r\n/**\r\n * Loading a default lib as a source file will mess up TS completely.\r\n * So our strategy is to hide such a text model from TS.\r\n * See https://github.com/microsoft/monaco-editor/issues/2182\r\n */\r\nfunction fileNameIsLib(resource) {\r\n    if (typeof resource === 'string') {\r\n        if (/^file:\\/\\/\\//.test(resource)) {\r\n            return !!_lib_lib_js__WEBPACK_IMPORTED_MODULE_1__.libFileMap[resource.substr(8)];\r\n        }\r\n        return false;\r\n    }\r\n    if (resource.path.indexOf('/lib.') === 0) {\r\n        return !!_lib_lib_js__WEBPACK_IMPORTED_MODULE_1__.libFileMap[resource.path.slice(1)];\r\n    }\r\n    return false;\r\n}\r\nvar TypeScriptWorker = /** @class */ (function () {\r\n    function TypeScriptWorker(ctx, createData) {\r\n        this._extraLibs = Object.create(null);\r\n        this._languageService = _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__.createLanguageService(this);\r\n        this._ctx = ctx;\r\n        this._compilerOptions = createData.compilerOptions;\r\n        this._extraLibs = createData.extraLibs;\r\n    }\r\n    // --- language service host ---------------\r\n    TypeScriptWorker.prototype.getCompilationSettings = function () {\r\n        return this._compilerOptions;\r\n    };\r\n    TypeScriptWorker.prototype.getScriptFileNames = function () {\r\n        var allModels = this._ctx.getMirrorModels().map(function (model) { return model.uri; });\r\n        var models = allModels.filter(function (uri) { return !fileNameIsLib(uri); }).map(function (uri) { return uri.toString(); });\r\n        return models.concat(Object.keys(this._extraLibs));\r\n    };\r\n    TypeScriptWorker.prototype._getModel = function (fileName) {\r\n        var models = this._ctx.getMirrorModels();\r\n        for (var i = 0; i < models.length; i++) {\r\n            if (models[i].uri.toString() === fileName) {\r\n                return models[i];\r\n            }\r\n        }\r\n        return null;\r\n    };\r\n    TypeScriptWorker.prototype.getScriptVersion = function (fileName) {\r\n        var model = this._getModel(fileName);\r\n        if (model) {\r\n            return model.version.toString();\r\n        }\r\n        else if (this.isDefaultLibFileName(fileName)) {\r\n            // default lib is static\r\n            return '1';\r\n        }\r\n        else if (fileName in this._extraLibs) {\r\n            return String(this._extraLibs[fileName].version);\r\n        }\r\n        return '';\r\n    };\r\n    TypeScriptWorker.prototype.getScriptText = function (fileName) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                return [2 /*return*/, this._getScriptText(fileName)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype._getScriptText = function (fileName) {\r\n        var text;\r\n        var model = this._getModel(fileName);\r\n        var libizedFileName = 'lib.' + fileName + '.d.ts';\r\n        if (model) {\r\n            // a true editor model\r\n            text = model.getValue();\r\n        }\r\n        else if (fileName in _lib_lib_js__WEBPACK_IMPORTED_MODULE_1__.libFileMap) {\r\n            text = _lib_lib_js__WEBPACK_IMPORTED_MODULE_1__.libFileMap[fileName];\r\n        }\r\n        else if (libizedFileName in _lib_lib_js__WEBPACK_IMPORTED_MODULE_1__.libFileMap) {\r\n            text = _lib_lib_js__WEBPACK_IMPORTED_MODULE_1__.libFileMap[libizedFileName];\r\n        }\r\n        else if (fileName in this._extraLibs) {\r\n            // extra lib\r\n            text = this._extraLibs[fileName].content;\r\n        }\r\n        else {\r\n            return;\r\n        }\r\n        return text;\r\n    };\r\n    TypeScriptWorker.prototype.getScriptSnapshot = function (fileName) {\r\n        var text = this._getScriptText(fileName);\r\n        if (text === undefined) {\r\n            return;\r\n        }\r\n        return {\r\n            getText: function (start, end) { return text.substring(start, end); },\r\n            getLength: function () { return text.length; },\r\n            getChangeRange: function () { return undefined; }\r\n        };\r\n    };\r\n    TypeScriptWorker.prototype.getScriptKind = function (fileName) {\r\n        var suffix = fileName.substr(fileName.lastIndexOf('.') + 1);\r\n        switch (suffix) {\r\n            case 'ts':\r\n                return _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__.ScriptKind.TS;\r\n            case 'tsx':\r\n                return _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__.ScriptKind.TSX;\r\n            case 'js':\r\n                return _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__.ScriptKind.JS;\r\n            case 'jsx':\r\n                return _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__.ScriptKind.JSX;\r\n            default:\r\n                return this.getCompilationSettings().allowJs ? _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__.ScriptKind.JS : _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__.ScriptKind.TS;\r\n        }\r\n    };\r\n    TypeScriptWorker.prototype.getCurrentDirectory = function () {\r\n        return '';\r\n    };\r\n    TypeScriptWorker.prototype.getDefaultLibFileName = function (options) {\r\n        switch (options.target) {\r\n            case 99 /* ESNext */:\r\n                var esnext = 'lib.esnext.full.d.ts';\r\n                if (esnext in _lib_lib_js__WEBPACK_IMPORTED_MODULE_1__.libFileMap || esnext in this._extraLibs)\r\n                    return esnext;\r\n            case 7 /* ES2020 */:\r\n            case 6 /* ES2019 */:\r\n            case 5 /* ES2018 */:\r\n            case 4 /* ES2017 */:\r\n            case 3 /* ES2016 */:\r\n            case 2 /* ES2015 */:\r\n            default:\r\n                // Support a dynamic lookup for the ES20XX version based on the target\r\n                // which is safe unless TC39 changes their numbering system\r\n                var eslib = \"lib.es\" + (2013 + (options.target || 99)) + \".full.d.ts\";\r\n                // Note: This also looks in _extraLibs, If you want\r\n                // to add support for additional target options, you will need to\r\n                // add the extra dts files to _extraLibs via the API.\r\n                if (eslib in _lib_lib_js__WEBPACK_IMPORTED_MODULE_1__.libFileMap || eslib in this._extraLibs) {\r\n                    return eslib;\r\n                }\r\n                return 'lib.es6.d.ts'; // We don't use lib.es2015.full.d.ts due to breaking change.\r\n            case 1:\r\n            case 0:\r\n                return 'lib.d.ts';\r\n        }\r\n    };\r\n    TypeScriptWorker.prototype.isDefaultLibFileName = function (fileName) {\r\n        return fileName === this.getDefaultLibFileName(this._compilerOptions);\r\n    };\r\n    TypeScriptWorker.prototype.getLibFiles = function () {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                return [2 /*return*/, _lib_lib_js__WEBPACK_IMPORTED_MODULE_1__.libFileMap];\r\n            });\r\n        });\r\n    };\r\n    // --- language features\r\n    TypeScriptWorker.clearFiles = function (diagnostics) {\r\n        // Clear the `file` field, which cannot be JSON'yfied because it\r\n        // contains cyclic data structures, except for the `fileName`\r\n        // property.\r\n        diagnostics.forEach(function (diag) {\r\n            var _a;\r\n            diag.file = diag.file ? { fileName: diag.file.fileName } : undefined;\r\n            (_a = diag.relatedInformation) === null || _a === void 0 ? void 0 : _a.forEach(function (diag2) { return (diag2.file = diag2.file ? { fileName: diag2.file.fileName } : undefined); });\r\n        });\r\n        return diagnostics;\r\n    };\r\n    TypeScriptWorker.prototype.getSyntacticDiagnostics = function (fileName) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var diagnostics;\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, []];\r\n                }\r\n                diagnostics = this._languageService.getSyntacticDiagnostics(fileName);\r\n                return [2 /*return*/, TypeScriptWorker.clearFiles(diagnostics)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getSemanticDiagnostics = function (fileName) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var diagnostics;\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, []];\r\n                }\r\n                diagnostics = this._languageService.getSemanticDiagnostics(fileName);\r\n                return [2 /*return*/, TypeScriptWorker.clearFiles(diagnostics)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getSuggestionDiagnostics = function (fileName) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var diagnostics;\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, []];\r\n                }\r\n                diagnostics = this._languageService.getSuggestionDiagnostics(fileName);\r\n                return [2 /*return*/, TypeScriptWorker.clearFiles(diagnostics)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getCompilerOptionsDiagnostics = function (fileName) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var diagnostics;\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, []];\r\n                }\r\n                diagnostics = this._languageService.getCompilerOptionsDiagnostics();\r\n                return [2 /*return*/, TypeScriptWorker.clearFiles(diagnostics)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getCompletionsAtPosition = function (fileName, position) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, undefined];\r\n                }\r\n                return [2 /*return*/, this._languageService.getCompletionsAtPosition(fileName, position, undefined)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getCompletionEntryDetails = function (fileName, position, entry) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                return [2 /*return*/, this._languageService.getCompletionEntryDetails(fileName, position, entry, undefined, undefined, undefined)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getSignatureHelpItems = function (fileName, position, options) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, undefined];\r\n                }\r\n                return [2 /*return*/, this._languageService.getSignatureHelpItems(fileName, position, options)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getQuickInfoAtPosition = function (fileName, position) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, undefined];\r\n                }\r\n                return [2 /*return*/, this._languageService.getQuickInfoAtPosition(fileName, position)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getOccurrencesAtPosition = function (fileName, position) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, undefined];\r\n                }\r\n                return [2 /*return*/, this._languageService.getOccurrencesAtPosition(fileName, position)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getDefinitionAtPosition = function (fileName, position) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, undefined];\r\n                }\r\n                return [2 /*return*/, this._languageService.getDefinitionAtPosition(fileName, position)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getReferencesAtPosition = function (fileName, position) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, undefined];\r\n                }\r\n                return [2 /*return*/, this._languageService.getReferencesAtPosition(fileName, position)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getNavigationBarItems = function (fileName) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, []];\r\n                }\r\n                return [2 /*return*/, this._languageService.getNavigationBarItems(fileName)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getFormattingEditsForDocument = function (fileName, options) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, []];\r\n                }\r\n                return [2 /*return*/, this._languageService.getFormattingEditsForDocument(fileName, options)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getFormattingEditsForRange = function (fileName, start, end, options) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, []];\r\n                }\r\n                return [2 /*return*/, this._languageService.getFormattingEditsForRange(fileName, start, end, options)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getFormattingEditsAfterKeystroke = function (fileName, postion, ch, options) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, []];\r\n                }\r\n                return [2 /*return*/, this._languageService.getFormattingEditsAfterKeystroke(fileName, postion, ch, options)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, undefined];\r\n                }\r\n                return [2 /*return*/, this._languageService.findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getRenameInfo = function (fileName, position, options) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, { canRename: false, localizedErrorMessage: 'Cannot rename in lib file' }];\r\n                }\r\n                return [2 /*return*/, this._languageService.getRenameInfo(fileName, position, options)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getEmitOutput = function (fileName) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, { outputFiles: [], emitSkipped: true }];\r\n                }\r\n                return [2 /*return*/, this._languageService.getEmitOutput(fileName)];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.getCodeFixesAtPosition = function (fileName, start, end, errorCodes, formatOptions) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var preferences;\r\n            return __generator(this, function (_a) {\r\n                if (fileNameIsLib(fileName)) {\r\n                    return [2 /*return*/, []];\r\n                }\r\n                preferences = {};\r\n                try {\r\n                    return [2 /*return*/, this._languageService.getCodeFixesAtPosition(fileName, start, end, errorCodes, formatOptions, preferences)];\r\n                }\r\n                catch (_b) {\r\n                    return [2 /*return*/, []];\r\n                }\r\n                return [2 /*return*/];\r\n            });\r\n        });\r\n    };\r\n    TypeScriptWorker.prototype.updateExtraLibs = function (extraLibs) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            return __generator(this, function (_a) {\r\n                this._extraLibs = extraLibs;\r\n                return [2 /*return*/];\r\n            });\r\n        });\r\n    };\r\n    return TypeScriptWorker;\r\n}());\r\n\r\nfunction create(ctx, createData) {\r\n    var TSWorkerClass = TypeScriptWorker;\r\n    if (createData.customWorkerPath) {\r\n        if (typeof importScripts === 'undefined') {\r\n            console.warn('Monaco is not using webworkers for background tasks, and that is needed to support the customWorkerPath flag');\r\n        }\r\n        else {\r\n            importScripts(createData.customWorkerPath);\r\n            var workerFactoryFunc = self.customTSWorkerFactory;\r\n            if (!workerFactoryFunc) {\r\n                throw new Error(\"The script at \" + createData.customWorkerPath + \" does not add customTSWorkerFactory to self\");\r\n            }\r\n            TSWorkerClass = workerFactoryFunc(TypeScriptWorker, _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__, _lib_lib_js__WEBPACK_IMPORTED_MODULE_1__.libFileMap);\r\n        }\r\n    }\r\n    return new TSWorkerClass(ctx, createData);\r\n}\r\n\n\n//# sourceURL=webpack://browser-esm-webpack/./node_modules/monaco-editor/esm/vs/language/typescript/tsWorker.js?");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			id: moduleId,
/******/ 			loaded: false,
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/global */
/******/ 	(() => {
/******/ 		__webpack_require__.g = (function() {
/******/ 			if (typeof globalThis === 'object') return globalThis;
/******/ 			try {
/******/ 				return this || new Function('return this')();
/******/ 			} catch (e) {
/******/ 				if (typeof window === 'object') return window;
/******/ 			}
/******/ 		})();
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/harmony module decorator */
/******/ 	(() => {
/******/ 		__webpack_require__.hmd = (module) => {
/******/ 			module = Object.create(module);
/******/ 			if (!module.children) module.children = [];
/******/ 			Object.defineProperty(module, 'exports', {
/******/ 				enumerable: true,
/******/ 				set: () => {
/******/ 					throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
/******/ 				}
/******/ 			});
/******/ 			return module;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module can't be inlined because the eval devtool is used.
/******/ 	var __webpack_exports__ = __webpack_require__("./node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js");
/******/ 	
/******/ })()
;